hyperframes 0.8.13 → 0.8.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -50,7 +50,7 @@ var VERSION;
50
50
  var init_version = __esm({
51
51
  "src/version.ts"() {
52
52
  "use strict";
53
- VERSION = true ? "0.8.13" : "0.0.0-dev";
53
+ VERSION = true ? "0.8.15" : "0.0.0-dev";
54
54
  }
55
55
  });
56
56
 
@@ -809,11 +809,11 @@ function __metadata(metadataKey, metadataValue) {
809
809
  }
810
810
  function __awaiter(thisArg, _arguments, P2, generator) {
811
811
  function adopt(value) {
812
- return value instanceof P2 ? value : new P2(function(resolve78) {
813
- resolve78(value);
812
+ return value instanceof P2 ? value : new P2(function(resolve79) {
813
+ resolve79(value);
814
814
  });
815
815
  }
816
- return new (P2 || (P2 = Promise))(function(resolve78, reject2) {
816
+ return new (P2 || (P2 = Promise))(function(resolve79, reject2) {
817
817
  function fulfilled(value) {
818
818
  try {
819
819
  step(generator.next(value));
@@ -829,7 +829,7 @@ function __awaiter(thisArg, _arguments, P2, generator) {
829
829
  }
830
830
  }
831
831
  function step(result) {
832
- result.done ? resolve78(result.value) : adopt(result.value).then(fulfilled, rejected);
832
+ result.done ? resolve79(result.value) : adopt(result.value).then(fulfilled, rejected);
833
833
  }
834
834
  step((generator = generator.apply(thisArg, _arguments || [])).next());
835
835
  });
@@ -1020,14 +1020,14 @@ function __asyncValues(o) {
1020
1020
  }, i2);
1021
1021
  function verb(n2) {
1022
1022
  i2[n2] = o[n2] && function(v2) {
1023
- return new Promise(function(resolve78, reject2) {
1024
- v2 = o[n2](v2), settle(resolve78, reject2, v2.done, v2.value);
1023
+ return new Promise(function(resolve79, reject2) {
1024
+ v2 = o[n2](v2), settle(resolve79, reject2, v2.done, v2.value);
1025
1025
  });
1026
1026
  };
1027
1027
  }
1028
- function settle(resolve78, reject2, d2, v2) {
1028
+ function settle(resolve79, reject2, d2, v2) {
1029
1029
  Promise.resolve(v2).then(function(v3) {
1030
- resolve78({ value: v3, done: d2 });
1030
+ resolve79({ value: v3, done: d2 });
1031
1031
  }, reject2);
1032
1032
  }
1033
1033
  }
@@ -4858,7 +4858,7 @@ var require_util = __commonJS({
4858
4858
  }
4859
4859
  path2 = url.path;
4860
4860
  }
4861
- var isAbsolute18 = exports.isAbsolute(path2);
4861
+ var isAbsolute19 = exports.isAbsolute(path2);
4862
4862
  var parts = path2.split(/\/+/);
4863
4863
  for (var part, up = 0, i2 = parts.length - 1; i2 >= 0; i2--) {
4864
4864
  part = parts[i2];
@@ -4878,7 +4878,7 @@ var require_util = __commonJS({
4878
4878
  }
4879
4879
  path2 = parts.join("/");
4880
4880
  if (path2 === "") {
4881
- path2 = isAbsolute18 ? "/" : ".";
4881
+ path2 = isAbsolute19 ? "/" : ".";
4882
4882
  }
4883
4883
  if (url) {
4884
4884
  url.path = path2;
@@ -4923,7 +4923,7 @@ var require_util = __commonJS({
4923
4923
  exports.isAbsolute = function(aPath) {
4924
4924
  return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
4925
4925
  };
4926
- function relative31(aRoot, aPath) {
4926
+ function relative33(aRoot, aPath) {
4927
4927
  if (aRoot === "") {
4928
4928
  aRoot = ".";
4929
4929
  }
@@ -4942,7 +4942,7 @@ var require_util = __commonJS({
4942
4942
  }
4943
4943
  return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
4944
4944
  }
4945
- exports.relative = relative31;
4945
+ exports.relative = relative33;
4946
4946
  var supportsNullProto = (function() {
4947
4947
  var obj = /* @__PURE__ */ Object.create(null);
4948
4948
  return !("__proto__" in obj);
@@ -41390,10 +41390,10 @@ function compareDocumentPosition(nodeA, nodeB) {
41390
41390
  function uniqueSort(nodes) {
41391
41391
  nodes = nodes.filter((node, i2, arr) => !arr.includes(node, i2 + 1));
41392
41392
  nodes.sort((a, b2) => {
41393
- const relative31 = compareDocumentPosition(a, b2);
41394
- if (relative31 & DocumentPosition.PRECEDING) {
41393
+ const relative33 = compareDocumentPosition(a, b2);
41394
+ if (relative33 & DocumentPosition.PRECEDING) {
41395
41395
  return -1;
41396
- } else if (relative31 & DocumentPosition.FOLLOWING) {
41396
+ } else if (relative33 & DocumentPosition.FOLLOWING) {
41397
41397
  return 1;
41398
41398
  }
41399
41399
  return 0;
@@ -41855,8 +41855,8 @@ var init_custom_element_registry = __esm({
41855
41855
  } : (element) => element.localName === localName;
41856
41856
  registry.set(localName, { Class, check });
41857
41857
  if (waiting.has(localName)) {
41858
- for (const resolve78 of waiting.get(localName))
41859
- resolve78(Class);
41858
+ for (const resolve79 of waiting.get(localName))
41859
+ resolve79(Class);
41860
41860
  waiting.delete(localName);
41861
41861
  }
41862
41862
  ownerDocument.querySelectorAll(
@@ -41896,13 +41896,13 @@ var init_custom_element_registry = __esm({
41896
41896
  */
41897
41897
  whenDefined(localName) {
41898
41898
  const { registry, waiting } = this;
41899
- return new Promise((resolve78) => {
41899
+ return new Promise((resolve79) => {
41900
41900
  if (registry.has(localName))
41901
- resolve78(registry.get(localName).Class);
41901
+ resolve79(registry.get(localName).Class);
41902
41902
  else {
41903
41903
  if (!waiting.has(localName))
41904
41904
  waiting.set(localName, []);
41905
- waiting.get(localName).push(resolve78);
41905
+ waiting.get(localName).push(resolve79);
41906
41906
  }
41907
41907
  });
41908
41908
  }
@@ -50603,8 +50603,8 @@ var init_esm10 = __esm({
50603
50603
  });
50604
50604
 
50605
50605
  // ../../node_modules/.bun/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
50606
- function encodeInteger(builder, num2, relative31) {
50607
- let delta = num2 - relative31;
50606
+ function encodeInteger(builder, num2, relative33) {
50607
+ let delta = num2 - relative33;
50608
50608
  delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
50609
50609
  do {
50610
50610
  let clamped = delta & 31;
@@ -52269,14 +52269,14 @@ function inlineHelper(call, ctx) {
52269
52269
  };
52270
52270
  return expandBody(fn.body.body, bindings, prov, ctx);
52271
52271
  }
52272
- function assignStep(update2, resolve78) {
52273
- if (update2.operator === "+=") return asNum(resolve78(update2.right));
52272
+ function assignStep(update2, resolve79) {
52273
+ if (update2.operator === "+=") return asNum(resolve79(update2.right));
52274
52274
  if (update2.operator === "-=") {
52275
- const s2 = asNum(resolve78(update2.right));
52275
+ const s2 = asNum(resolve79(update2.right));
52276
52276
  return s2 === void 0 ? void 0 : -s2;
52277
52277
  }
52278
52278
  if (update2.operator === "=" && update2.right?.type === "BinaryExpression") {
52279
- return asNum(resolve78(update2.right.right));
52279
+ return asNum(resolve79(update2.right.right));
52280
52280
  }
52281
52281
  return void 0;
52282
52282
  }
@@ -52285,10 +52285,10 @@ function updatedVarName(update2) {
52285
52285
  if (update2?.type === "AssignmentExpression") return update2.left?.name ?? null;
52286
52286
  return null;
52287
52287
  }
52288
- function loopStep(update2, varName, resolve78) {
52288
+ function loopStep(update2, varName, resolve79) {
52289
52289
  if (updatedVarName(update2) !== varName) return void 0;
52290
52290
  if (update2.type === "UpdateExpression") return update2.operator === "++" ? 1 : -1;
52291
- return assignStep(update2, resolve78);
52291
+ return assignStep(update2, resolve79);
52292
52292
  }
52293
52293
  function asNum(v2) {
52294
52294
  return typeof v2 === "number" && Number.isFinite(v2) ? v2 : void 0;
@@ -52305,13 +52305,13 @@ function forInitVar(init) {
52305
52305
  const d2 = init.declarations[0];
52306
52306
  return d2.id?.type === "Identifier" ? { name: d2.id.name, initExpr: d2.init } : null;
52307
52307
  }
52308
- function parseForHeader(stmt, resolve78) {
52308
+ function parseForHeader(stmt, resolve79) {
52309
52309
  const iv = forInitVar(stmt.init);
52310
52310
  const test = stmt.test;
52311
52311
  if (!iv || test?.type !== "BinaryExpression" || test.left?.name !== iv.name) return null;
52312
- const start = asNum(resolve78(iv.initExpr));
52313
- const end = asNum(resolve78(test.right));
52314
- const step = loopStep(stmt.update, iv.name, resolve78);
52312
+ const start = asNum(resolve79(iv.initExpr));
52313
+ const end = asNum(resolve79(test.right));
52314
+ const step = loopStep(stmt.update, iv.name, resolve79);
52315
52315
  if (start === void 0 || end === void 0 || !step) return null;
52316
52316
  return { v: iv.name, start, end, op: test.operator, step };
52317
52317
  }
@@ -52423,12 +52423,12 @@ function expandStatements(stmts, ctx) {
52423
52423
  }
52424
52424
  return out;
52425
52425
  }
52426
- function inlineComputedTimelines(ast, timelineVar, resolve78) {
52426
+ function inlineComputedTimelines(ast, timelineVar, resolve79) {
52427
52427
  const helpers = collectInlinableHelpers(ast, timelineVar);
52428
52428
  const ctx = {
52429
52429
  helpers,
52430
52430
  timelineVar,
52431
- resolve: resolve78,
52431
+ resolve: resolve79,
52432
52432
  depth: 0,
52433
52433
  site: { n: 0 },
52434
52434
  order: { n: 0 }
@@ -56279,6 +56279,16 @@ var init_timingCompiler = __esm({
56279
56279
  });
56280
56280
 
56281
56281
  // ../core/dist/compiler/mediaRenderIds.js
56282
+ function hasPlayableSource(el) {
56283
+ if (el.getAttribute("src"))
56284
+ return true;
56285
+ const sources = el.querySelectorAll?.("source[src]");
56286
+ if (!sources)
56287
+ return false;
56288
+ for (const _ of sources)
56289
+ return true;
56290
+ return false;
56291
+ }
56282
56292
  function uniqueRenderId(baseId, taken) {
56283
56293
  if (!taken.has(baseId))
56284
56294
  return baseId;
@@ -56291,6 +56301,8 @@ function assignMediaRenderIds(document2) {
56291
56301
  const taken = /* @__PURE__ */ new Set();
56292
56302
  const pending = [];
56293
56303
  for (const el of document2.querySelectorAll(MEDIA_SELECTOR)) {
56304
+ if (!hasPlayableSource(el))
56305
+ continue;
56294
56306
  const existing = el.getAttribute(MEDIA_RENDER_ID_ATTR);
56295
56307
  if (existing) {
56296
56308
  taken.add(existing);
@@ -56351,7 +56363,7 @@ var init_mediaRenderIds = __esm({
56351
56363
  "use strict";
56352
56364
  MEDIA_RENDER_ID_ATTR = "data-hf-render-id";
56353
56365
  AUDIO_GROUP_RENDER_ID_ATTR = "data-hf-group-render-id";
56354
- MEDIA_SELECTOR = "video[src], audio[src], img[src]";
56366
+ MEDIA_SELECTOR = "video, audio, img[src]";
56355
56367
  AUDIO_GROUP_SELECTOR = "hf-audio-group[id]";
56356
56368
  }
56357
56369
  });
@@ -65311,11 +65323,11 @@ var init_browserLeasePool = __esm({
65311
65323
  await Promise.race([
65312
65324
  this.options.close(result.browser).catch(() => {
65313
65325
  }),
65314
- new Promise((resolve78) => {
65326
+ new Promise((resolve79) => {
65315
65327
  entry.forceClose = () => {
65316
65328
  entry.forceClose = void 0;
65317
65329
  this.options.forceClose(result.browser);
65318
- resolve78();
65330
+ resolve79();
65319
65331
  };
65320
65332
  })
65321
65333
  ]);
@@ -66037,8 +66049,8 @@ async function probeBeginFrameLiveness(page, timeoutMs, frameTimeTicks, interval
66037
66049
  try {
66038
66050
  return await Promise.race([
66039
66051
  client.send("HeadlessExperimental.beginFrame", params).then(() => true).catch(() => false),
66040
- new Promise((resolve78) => {
66041
- timer = setTimeout(() => resolve78(false), timeoutMs);
66052
+ new Promise((resolve79) => {
66053
+ timer = setTimeout(() => resolve79(false), timeoutMs);
66042
66054
  })
66043
66055
  ]);
66044
66056
  } finally {
@@ -66814,7 +66826,7 @@ async function produceDrawElementFrame(page, width, height, quality = 80, syncTo
66814
66826
  );
66815
66827
  }
66816
66828
  const frameId = ++state.nextId;
66817
- const encodeResult = new Promise((resolve78, reject2) => {
66829
+ const encodeResult = new Promise((resolve79, reject2) => {
66818
66830
  const timer = setTimeout(() => {
66819
66831
  if (state.pending.delete(frameId)) {
66820
66832
  reject2(new Error(`drawElement worker encode timed out (frame ${frameId})`));
@@ -66823,7 +66835,7 @@ async function produceDrawElementFrame(page, width, height, quality = 80, syncTo
66823
66835
  state.pending.set(frameId, {
66824
66836
  resolve: (b2) => {
66825
66837
  clearTimeout(timer);
66826
- resolve78(b2);
66838
+ resolve79(b2);
66827
66839
  },
66828
66840
  reject: (e3) => {
66829
66841
  clearTimeout(timer);
@@ -66974,7 +66986,7 @@ async function produceDrawElementFrameBatch(page, times, width, height, quality
66974
66986
  for (let i2 = 0; i2 < times.length; i2++) {
66975
66987
  const frameId = ++state.nextId;
66976
66988
  fids.push(frameId);
66977
- const p2 = new Promise((resolve78, reject2) => {
66989
+ const p2 = new Promise((resolve79, reject2) => {
66978
66990
  const timer = setTimeout(() => {
66979
66991
  if (state.pending.delete(frameId)) {
66980
66992
  reject2(new Error(`drawElement worker encode timed out (frame ${frameId})`));
@@ -66983,7 +66995,7 @@ async function produceDrawElementFrameBatch(page, times, width, height, quality
66983
66995
  state.pending.set(frameId, {
66984
66996
  resolve: (b2) => {
66985
66997
  clearTimeout(timer);
66986
- resolve78(b2);
66998
+ resolve79(b2);
66987
66999
  },
66988
67000
  reject: (e3) => {
66989
67001
  clearTimeout(timer);
@@ -67254,9 +67266,9 @@ async function initThreeDProjectionInPage() {
67254
67266
  const toDataUrl = async (url) => {
67255
67267
  const resp = await fetch(url);
67256
67268
  const blob = await resp.blob();
67257
- return new Promise((resolve78, reject2) => {
67269
+ return new Promise((resolve79, reject2) => {
67258
67270
  const r2 = new FileReader();
67259
- r2.onload = () => resolve78(String(r2.result));
67271
+ r2.onload = () => resolve79(String(r2.result));
67260
67272
  r2.onerror = () => reject2(new Error(`FileReader failed for ${url}`));
67261
67273
  r2.readAsDataURL(blob);
67262
67274
  });
@@ -68469,10 +68481,10 @@ async function waitForCloseWithTimeout(promise) {
68469
68481
  () => void 0,
68470
68482
  () => void 0
68471
68483
  ),
68472
- new Promise((resolve78) => {
68484
+ new Promise((resolve79) => {
68473
68485
  timer = setTimeout(() => {
68474
68486
  timedOut = true;
68475
- resolve78();
68487
+ resolve79();
68476
68488
  }, CAPTURE_SESSION_CLOSE_TIMEOUT_MS);
68477
68489
  })
68478
68490
  ]);
@@ -68880,7 +68892,7 @@ async function pollHfReady(page, timeoutMs, intervalMs = 100) {
68880
68892
  }
68881
68893
  }
68882
68894
  }
68883
- await new Promise((resolve78) => setTimeout(resolve78, intervalMs));
68895
+ await new Promise((resolve79) => setTimeout(resolve79, intervalMs));
68884
68896
  }
68885
68897
  const diag2 = await evaluateHfDiagnostic(page);
68886
68898
  if (diag2.hasSeek && diag2.duration === 0) {
@@ -68921,7 +68933,7 @@ async function pollSubCompositionTimelines(page, timeoutMs, intervalMs = 150, ge
68921
68933
  );
68922
68934
  break;
68923
68935
  }
68924
- await new Promise((resolve78) => setTimeout(resolve78, intervalMs));
68936
+ await new Promise((resolve79) => setTimeout(resolve79, intervalMs));
68925
68937
  }
68926
68938
  if (ready) {
68927
68939
  await page.evaluate(`(function() {
@@ -68970,7 +68982,7 @@ async function pollVideosReady(page, skipIds, timeoutMs, intervalMs = 100) {
68970
68982
  const deadline = Date.now() + timeoutMs;
68971
68983
  while (Date.now() < deadline) {
68972
68984
  if (await check()) return true;
68973
- await new Promise((resolve78) => setTimeout(resolve78, intervalMs));
68985
+ await new Promise((resolve79) => setTimeout(resolve79, intervalMs));
68974
68986
  }
68975
68987
  return check();
68976
68988
  }
@@ -68993,7 +69005,7 @@ async function pollImagesReady(page, timeoutMs, intervalMs = 100) {
68993
69005
  const deadline = Date.now() + timeoutMs;
68994
69006
  while (Date.now() < deadline) {
68995
69007
  if (await check()) return true;
68996
- await new Promise((resolve78) => setTimeout(resolve78, intervalMs));
69008
+ await new Promise((resolve79) => setTimeout(resolve79, intervalMs));
68997
69009
  }
68998
69010
  return check();
68999
69011
  }
@@ -69120,7 +69132,7 @@ async function waitForOptionalTailwindReady(page, timeoutMs) {
69120
69132
  page.evaluate(
69121
69133
  `Promise.resolve(window.__tailwindReady).then(() => true, () => false)`
69122
69134
  ),
69123
- new Promise((resolve78) => setTimeout(() => resolve78(false), timeoutMs))
69135
+ new Promise((resolve79) => setTimeout(() => resolve79(false), timeoutMs))
69124
69136
  ]);
69125
69137
  if (!ready) {
69126
69138
  throw new Error(
@@ -70412,7 +70424,7 @@ var init_frameCapture = __esm({
70412
70424
  BROWSER_CONSOLE_BUFFER_SIZE = 200;
70413
70425
  CAPTURE_SESSION_CLOSE_TIMEOUT_MS = 5e3;
70414
70426
  LOCKED_WARMUP_TICKS = 60;
70415
- realSleep = (ms) => new Promise((resolve78) => setTimeout(resolve78, ms));
70427
+ realSleep = (ms) => new Promise((resolve79) => setTimeout(resolve79, ms));
70416
70428
  BEGIN_FRAME_CAPTURE_HEADROOM_INTERVALS = 10;
70417
70429
  BEGIN_FRAME_COMMIT_LEAD_INTERVALS = 6;
70418
70430
  BEGIN_FRAME_PROBE_LEAD_INTERVALS = 5;
@@ -70464,8 +70476,8 @@ var init_managedChildProcess = __esm({
70464
70476
  this.options = options;
70465
70477
  this.now = options.now ?? Date.now;
70466
70478
  this.startedAtMs = this.now();
70467
- this.outcomePromise = new Promise((resolve78) => {
70468
- this.resolveOutcome = resolve78;
70479
+ this.outcomePromise = new Promise((resolve79) => {
70480
+ this.resolveOutcome = resolve79;
70469
70481
  });
70470
70482
  child.stderr?.on("data", this.onStderr);
70471
70483
  child.once("spawn", this.onSpawn);
@@ -72105,12 +72117,12 @@ function createFrameReorderBuffer(startFrame, endFrame) {
72105
72117
  let cursor = startFrame;
72106
72118
  let aborted = null;
72107
72119
  const pending = /* @__PURE__ */ new Map();
72108
- const enqueueAt = (frame, resolve78, reject2) => {
72120
+ const enqueueAt = (frame, resolve79, reject2) => {
72109
72121
  const list = pending.get(frame);
72110
72122
  if (list === void 0) {
72111
- pending.set(frame, [{ resolve: resolve78, reject: reject2 }]);
72123
+ pending.set(frame, [{ resolve: resolve79, reject: reject2 }]);
72112
72124
  } else {
72113
- list.push({ resolve: resolve78, reject: reject2 });
72125
+ list.push({ resolve: resolve79, reject: reject2 });
72114
72126
  }
72115
72127
  };
72116
72128
  const flushAt = (frame) => {
@@ -72119,31 +72131,31 @@ function createFrameReorderBuffer(startFrame, endFrame) {
72119
72131
  pending.delete(frame);
72120
72132
  for (const waiter of list) waiter.resolve();
72121
72133
  };
72122
- const waitForFrame = (frame) => new Promise((resolve78, reject2) => {
72134
+ const waitForFrame = (frame) => new Promise((resolve79, reject2) => {
72123
72135
  if (aborted) {
72124
72136
  reject2(aborted);
72125
72137
  return;
72126
72138
  }
72127
72139
  if (frame === cursor) {
72128
- resolve78();
72140
+ resolve79();
72129
72141
  return;
72130
72142
  }
72131
- enqueueAt(frame, resolve78, reject2);
72143
+ enqueueAt(frame, resolve79, reject2);
72132
72144
  });
72133
72145
  const advanceTo = (frame) => {
72134
72146
  cursor = frame;
72135
72147
  flushAt(frame);
72136
72148
  };
72137
- const waitForAllDone = () => new Promise((resolve78, reject2) => {
72149
+ const waitForAllDone = () => new Promise((resolve79, reject2) => {
72138
72150
  if (aborted) {
72139
72151
  reject2(aborted);
72140
72152
  return;
72141
72153
  }
72142
72154
  if (cursor >= endFrame) {
72143
- resolve78();
72155
+ resolve79();
72144
72156
  return;
72145
72157
  }
72146
- enqueueAt(endFrame, resolve78, reject2);
72158
+ enqueueAt(endFrame, resolve79, reject2);
72147
72159
  });
72148
72160
  const abort = (err) => {
72149
72161
  if (aborted) return;
@@ -72414,8 +72426,8 @@ async function spawnStreamingEncoder(outputPath, options, signal, config) {
72414
72426
  close: async () => {
72415
72427
  const stdin = ffmpeg.stdin;
72416
72428
  if (stdin && !stdin.destroyed) {
72417
- await new Promise((resolve78) => {
72418
- stdin.end(() => resolve78());
72429
+ await new Promise((resolve79) => {
72430
+ stdin.end(() => resolve79());
72419
72431
  });
72420
72432
  }
72421
72433
  const outcome = await exitPromise;
@@ -72690,10 +72702,10 @@ async function waitForCacheLock(signal) {
72690
72702
  if (signal?.aborted) {
72691
72703
  throw new UrlDownloadError("cancelled", false, "Download cancelled");
72692
72704
  }
72693
- await new Promise((resolve78, reject2) => {
72705
+ await new Promise((resolve79, reject2) => {
72694
72706
  const timeout = setTimeout(() => {
72695
72707
  signal?.removeEventListener("abort", onAbort);
72696
- resolve78();
72708
+ resolve79();
72697
72709
  }, CACHE_LOCK_POLL_MS);
72698
72710
  const onAbort = () => {
72699
72711
  clearTimeout(timeout);
@@ -77684,7 +77696,7 @@ var require_processor = __commonJS({
77684
77696
  if (options === void 0) {
77685
77697
  options = {};
77686
77698
  }
77687
- return new Promise(function(resolve78, reject2) {
77699
+ return new Promise(function(resolve79, reject2) {
77688
77700
  try {
77689
77701
  var root_1 = _this._root(rule, options);
77690
77702
  Promise.resolve(_this.func(root_1)).then(function(transform) {
@@ -77694,7 +77706,7 @@ var require_processor = __commonJS({
77694
77706
  rule.selector = string;
77695
77707
  }
77696
77708
  return { transform, root: root_1, string };
77697
- }).then(resolve78, reject2);
77709
+ }).then(resolve79, reject2);
77698
77710
  } catch (e3) {
77699
77711
  reject2(e3);
77700
77712
  return;
@@ -77972,6 +77984,28 @@ function hasUnresolvedTemplatingToken(url) {
77972
77984
  function isUnresolvedAssetPlaceholder(rawSrc) {
77973
77985
  return /^__[A-Z_]+__$/.test(rawSrc.trim()) || hasUnresolvedTemplatingToken(rawSrc);
77974
77986
  }
77987
+ function collectSubCompositionSrcs(html) {
77988
+ const scannable = maskNonScannableRanges(html);
77989
+ const srcs = [];
77990
+ const seen = /* @__PURE__ */ new Set();
77991
+ let cursor = 0;
77992
+ while (cursor < scannable.length) {
77993
+ const open3 = scannable.indexOf("<", cursor);
77994
+ if (open3 === -1) break;
77995
+ const close = scannable.indexOf(">", open3 + 1);
77996
+ if (close === -1) break;
77997
+ cursor = close + 1;
77998
+ const match = COMPOSITION_SRC_ATTR.exec(scannable.slice(open3, cursor));
77999
+ if (!match) continue;
78000
+ const src = (match[1] ?? "").trim();
78001
+ if (!src || seen.has(src)) continue;
78002
+ if (isUnresolvedAssetPlaceholder(src)) continue;
78003
+ if (isRemoteOrInlineUrl(src)) continue;
78004
+ seen.add(src);
78005
+ srcs.push(src);
78006
+ }
78007
+ return srcs;
78008
+ }
77975
78009
  function cleanAssetUrl(url) {
77976
78010
  return url.trim().split(/[?#]/, 1)[0] ?? "";
77977
78011
  }
@@ -78031,9 +78065,11 @@ function maskNonScannableRanges(html) {
78031
78065
  out = maskRange(out, /<script\b[^>]*>[\s\S]*?<\/script\b[^>]*>/gi);
78032
78066
  return out;
78033
78067
  }
78068
+ var COMPOSITION_SRC_ATTR;
78034
78069
  var init_assetResolution = __esm({
78035
78070
  "../parsers/dist/assetResolution.js"() {
78036
78071
  "use strict";
78072
+ COMPOSITION_SRC_ATTR = /\bdata-composition-src\s*=\s*["']([^"']+)["']/i;
78037
78073
  }
78038
78074
  });
78039
78075
 
@@ -78400,14 +78436,14 @@ function inlineHelper2(call, ctx) {
78400
78436
  };
78401
78437
  return expandBody2(fn.body.body, bindings, prov, ctx);
78402
78438
  }
78403
- function assignStep2(update2, resolve78) {
78404
- if (update2.operator === "+=") return asNum2(resolve78(update2.right));
78439
+ function assignStep2(update2, resolve79) {
78440
+ if (update2.operator === "+=") return asNum2(resolve79(update2.right));
78405
78441
  if (update2.operator === "-=") {
78406
- const s2 = asNum2(resolve78(update2.right));
78442
+ const s2 = asNum2(resolve79(update2.right));
78407
78443
  return s2 === void 0 ? void 0 : -s2;
78408
78444
  }
78409
78445
  if (update2.operator === "=" && update2.right?.type === "BinaryExpression") {
78410
- return asNum2(resolve78(update2.right.right));
78446
+ return asNum2(resolve79(update2.right.right));
78411
78447
  }
78412
78448
  return void 0;
78413
78449
  }
@@ -78416,10 +78452,10 @@ function updatedVarName2(update2) {
78416
78452
  if (update2?.type === "AssignmentExpression") return update2.left?.name ?? null;
78417
78453
  return null;
78418
78454
  }
78419
- function loopStep2(update2, varName, resolve78) {
78455
+ function loopStep2(update2, varName, resolve79) {
78420
78456
  if (updatedVarName2(update2) !== varName) return void 0;
78421
78457
  if (update2.type === "UpdateExpression") return update2.operator === "++" ? 1 : -1;
78422
- return assignStep2(update2, resolve78);
78458
+ return assignStep2(update2, resolve79);
78423
78459
  }
78424
78460
  function asNum2(v2) {
78425
78461
  return typeof v2 === "number" && Number.isFinite(v2) ? v2 : void 0;
@@ -78436,13 +78472,13 @@ function forInitVar2(init) {
78436
78472
  const d2 = init.declarations[0];
78437
78473
  return d2.id?.type === "Identifier" ? { name: d2.id.name, initExpr: d2.init } : null;
78438
78474
  }
78439
- function parseForHeader2(stmt, resolve78) {
78475
+ function parseForHeader2(stmt, resolve79) {
78440
78476
  const iv = forInitVar2(stmt.init);
78441
78477
  const test = stmt.test;
78442
78478
  if (!iv || test?.type !== "BinaryExpression" || test.left?.name !== iv.name) return null;
78443
- const start = asNum2(resolve78(iv.initExpr));
78444
- const end = asNum2(resolve78(test.right));
78445
- const step = loopStep2(stmt.update, iv.name, resolve78);
78479
+ const start = asNum2(resolve79(iv.initExpr));
78480
+ const end = asNum2(resolve79(test.right));
78481
+ const step = loopStep2(stmt.update, iv.name, resolve79);
78446
78482
  if (start === void 0 || end === void 0 || !step) return null;
78447
78483
  return { v: iv.name, start, end, op: test.operator, step };
78448
78484
  }
@@ -78554,12 +78590,12 @@ function expandStatements2(stmts, ctx) {
78554
78590
  }
78555
78591
  return out;
78556
78592
  }
78557
- function inlineComputedTimelines2(ast, timelineVar, resolve78) {
78593
+ function inlineComputedTimelines2(ast, timelineVar, resolve79) {
78558
78594
  const helpers = collectInlinableHelpers2(ast, timelineVar);
78559
78595
  const ctx = {
78560
78596
  helpers,
78561
78597
  timelineVar,
78562
- resolve: resolve78,
78598
+ resolve: resolve79,
78563
78599
  depth: 0,
78564
78600
  site: { n: 0 },
78565
78601
  order: { n: 0 }
@@ -80045,13 +80081,7 @@ function readDecodedAttr(tagSource, attr2) {
80045
80081
  return value;
80046
80082
  }
80047
80083
  function readJsonAttr(tagSource, attr2) {
80048
- if (!tagSource) return null;
80049
- const escaped = attr2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
80050
- const match = tagSource.match(
80051
- new RegExp(`(?<![\\w-])${escaped}\\s*=\\s*(?:"([^"]*)"|'([^']*)')`, "i")
80052
- );
80053
- if (!match) return null;
80054
- return match[1] ?? match[2] ?? null;
80084
+ return readDecodedAttr(tagSource, attr2);
80055
80085
  }
80056
80086
  function collectCompositionIds(tags) {
80057
80087
  const ids = /* @__PURE__ */ new Set();
@@ -82356,13 +82386,7 @@ function lintMissingOrEmptySubComposition(projectDir, rootHtml) {
82356
82386
  const checked = /* @__PURE__ */ new Map();
82357
82387
  const visited = /* @__PURE__ */ new Set();
82358
82388
  const walk = (html) => {
82359
- const compositionSrcRe = /<[^>]*\bdata-composition-src\s*=\s*["']([^"']+)["'][^>]*>/gi;
82360
- const scannable = maskNonScannableRanges(html);
82361
- let match;
82362
- while ((match = compositionSrcRe.exec(scannable)) !== null) {
82363
- const srcPath = (match[1] ?? "").trim();
82364
- if (!srcPath) continue;
82365
- if (isUnresolvedAssetPlaceholder(srcPath)) continue;
82389
+ for (const srcPath of collectSubCompositionSrcs(html)) {
82366
82390
  const filePath = resolve8(projectDir, srcPath);
82367
82391
  if (visited.has(filePath)) continue;
82368
82392
  visited.add(filePath);
@@ -82490,7 +82514,7 @@ var init_dist4 = __esm({
82490
82514
  }
82491
82515
  ];
82492
82516
  },
82493
- // missing_timeline_registry + timeline_registry_missing_init
82517
+ // missing_timeline_registry
82494
82518
  // fallow-ignore-next-line complexity
82495
82519
  ({ source, rawSource, rootTag, options }) => {
82496
82520
  if (options.isSubComposition || rawSource.trimStart().toLowerCase().startsWith("<template")) {
@@ -82506,14 +82530,6 @@ var init_dist4 = __esm({
82506
82530
  fixHint: "Register each composition timeline on `window.__timelines[compositionId]`."
82507
82531
  });
82508
82532
  }
82509
- if (TIMELINE_REGISTRY_ASSIGN_PATTERN.test(source) && !TIMELINE_REGISTRY_INIT_PATTERN.test(source)) {
82510
- findings.push({
82511
- code: "timeline_registry_missing_init",
82512
- severity: "error",
82513
- message: "`window.__timelines[\u2026] = \u2026` is used without initializing `window.__timelines` first.",
82514
- fixHint: "Add `window.__timelines = window.__timelines || {};` before any timeline assignment."
82515
- });
82516
- }
82517
82533
  return findings;
82518
82534
  },
82519
82535
  // timeline_id_mismatch
@@ -82893,9 +82909,9 @@ var init_dist4 = __esm({
82893
82909
  findings.push({
82894
82910
  code: "video_nested_in_timed_element",
82895
82911
  severity: "error",
82896
- message: `<video> with data-start is nested inside <${parent.name}${parent.id ? ` id="${parent.id}"` : ""}> which also has data-start. The framework cannot manage playback of nested media \u2014 video will be FROZEN in renders.`,
82912
+ message: `<video> with data-start is nested inside <${parent.name}${parent.id ? ` id="${parent.id}"` : ""}> which also has data-start. The frame extractor resolves the video's start from its own data-start without the wrapper's offset, while visibility uses the wrapper's window, so the two disagree: the clip shows the wrong source frames and then disappears partway through its slot.`,
82897
82913
  elementId: readAttr(tag.raw, "id") || void 0,
82898
- fixHint: "Move the <video> to be a direct child of the stage, or remove data-start from the wrapper div (use it as a non-timed visual container).",
82914
+ fixHint: "Time the wrapper OR the video, never both: remove data-start from the wrapper (use it as a non-timed visual container), or move the <video> up to be a direct child of the stage.",
82899
82915
  snippet: truncateSnippet(tag.raw)
82900
82916
  });
82901
82917
  break;
@@ -84464,7 +84480,7 @@ ${other.raw}`)
84464
84480
  severity: "error",
84465
84481
  message: `<${tag.name}${elementId ? ` id="${elementId}"` : ""}> uses data-layer instead of data-track-index.`,
84466
84482
  elementId,
84467
- fixHint: "Replace data-layer with data-track-index. The runtime reads data-track-index.",
84483
+ fixHint: "Replace data-layer with data-track-index, which is the canonical name Studio and the linter read. Neither name is read by the render.",
84468
84484
  snippet: truncateSnippet(tag.raw)
84469
84485
  });
84470
84486
  }
@@ -84862,10 +84878,13 @@ ${other.raw}`)
84862
84878
  // can't leak styles into each other. A rule whose LEFTMOST selector is the ROOT
84863
84879
  // element's own class (e.g. `.frame { ... }` on the same element that carries
84864
84880
  // data-composition-id) therefore becomes a DESCENDANT selector that can never
84865
- // match the root — the whole scene renders unstyled (tiny text top-left, images
84866
- // at natural size). lint/validate/inspect evaluate the file in isolation (no
84867
- // scoping) and Studio previews each scene in its own iframe (no scoping), so the
84868
- // break is invisible until the composited MP4 render. Style the root via `#root`
84881
+ // match the SCOPED element itself. NOTE on the symptom: since #1886 the producer
84882
+ // preserves the authored root as a `data-hf-inner-root` wrapper INSIDE the scoped
84883
+ // element (regression fixture packages/producer/tests/sub-comp-class-selector),
84884
+ // so the class still matches as a descendant and the scene no longer renders
84885
+ // unstyled. This rule is now a consistency constraint, not a render-bug guard:
84886
+ // `#root` is the shape the registry blocks model and the one the scoper
84887
+ // special-cases. Style the root via `#root`
84869
84888
  // (the scoper special-cases the root id) and descendants via plain selectors,
84870
84889
  // like the registry blocks — the runtime already scopes each scene by id, so a
84871
84890
  // class namespace on the root is redundant.
@@ -84882,9 +84901,9 @@ ${other.raw}`)
84882
84901
  {
84883
84902
  code: "subcomposition_root_styled_by_class",
84884
84903
  severity: "error",
84885
- message: `Root element has class="${rootClasses.join(" ")}" and is styled by ${offenders.length} rule(s) keyed off that class (e.g. ${example}). At render, every sub-composition rule is scoped to [data-composition-id="${rootCompositionId}"] <selector>, so a selector whose leftmost part is the ROOT's own class becomes a descendant selector that cannot match the root \u2014 the scene renders unstyled (tiny text top-left, full-size images). lint/validate/inspect and Studio's per-frame iframe preview do not scope, so this passes every static check and looks correct in preview.`,
84904
+ message: `Root element has class="${rootClasses.join(" ")}" and is styled by ${offenders.length} rule(s) keyed off that class (e.g. ${example}). At render, every sub-composition rule is scoped to [data-composition-id="${rootCompositionId}"] <selector>, so a selector whose leftmost part is the ROOT's own class becomes a descendant selector that cannot match the scoped element itself. Since #1886 the producer preserves the authored root as an inner wrapper, so this no longer renders the scene unstyled, but #root is the shape the scoper special-cases and the registry blocks model. Use it so preview, render, and Studio agree.`,
84886
84905
  selector: example,
84887
- fixHint: `Give the root id="root" and style it with \`#root { ... }\` plus plain descendant selectors (\`.kicker\`, \`#hero\`) \u2014 the runtime already scopes each sub-composition by data-composition-id, so a class namespace on the root is redundant and breaks under scoping.`,
84906
+ fixHint: `Give the root id="root" and style it with \`#root { ... }\` plus plain descendant selectors (\`.kicker\`, \`#hero\`) \u2014 the runtime already scopes each sub-composition by data-composition-id, so a class namespace on the root is redundant.`,
84888
84907
  snippet: truncateSnippet(rootTag.raw)
84889
84908
  }
84890
84909
  ];
@@ -85321,7 +85340,7 @@ function enumerateNestedCompositionHosts(assembledHost, ancestry) {
85321
85340
  const hosts = [];
85322
85341
  const skipped = [];
85323
85342
  for (const nestedHost of assembledHost.querySelectorAll(COMPOSITION_HOST_SELECTOR)) {
85324
- const src = nestedHost.getAttribute(COMPOSITION_SRC_ATTR);
85343
+ const src = nestedHost.getAttribute(COMPOSITION_SRC_ATTR2);
85325
85344
  if (!src)
85326
85345
  continue;
85327
85346
  if (ancestry.includes(src)) {
@@ -85336,14 +85355,14 @@ function enumerateNestedCompositionHosts(assembledHost, ancestry) {
85336
85355
  }
85337
85356
  return { hosts, skipped };
85338
85357
  }
85339
- var COMPOSITION_ID_ATTR, COMPOSITION_SRC_ATTR, COMPOSITION_ROOT_SELECTOR, COMPOSITION_HOST_SELECTOR, STYLE_SELECTOR, SCRIPT_SELECTOR, HOISTED_LINK_SELECTOR, MAX_SUB_COMPOSITION_DEPTH;
85358
+ var COMPOSITION_ID_ATTR, COMPOSITION_SRC_ATTR2, COMPOSITION_ROOT_SELECTOR, COMPOSITION_HOST_SELECTOR, STYLE_SELECTOR, SCRIPT_SELECTOR, HOISTED_LINK_SELECTOR, MAX_SUB_COMPOSITION_DEPTH;
85340
85359
  var init_compositionAssembly = __esm({
85341
85360
  "../core/dist/compiler/compositionAssembly.js"() {
85342
85361
  "use strict";
85343
85362
  COMPOSITION_ID_ATTR = "data-composition-id";
85344
- COMPOSITION_SRC_ATTR = "data-composition-src";
85363
+ COMPOSITION_SRC_ATTR2 = "data-composition-src";
85345
85364
  COMPOSITION_ROOT_SELECTOR = `[${COMPOSITION_ID_ATTR}]`;
85346
- COMPOSITION_HOST_SELECTOR = `[${COMPOSITION_SRC_ATTR}]`;
85365
+ COMPOSITION_HOST_SELECTOR = `[${COMPOSITION_SRC_ATTR2}]`;
85347
85366
  STYLE_SELECTOR = "style";
85348
85367
  SCRIPT_SELECTOR = "script";
85349
85368
  HOISTED_LINK_SELECTOR = 'link[rel="stylesheet"], link[rel="preconnect"]';
@@ -90680,6 +90699,24 @@ function distributeFramesInterleaved(totalFrames, workerCount, workDir, rangeSta
90680
90699
  function shouldVerifyWorkerGpu(workerId, config) {
90681
90700
  return config?.browserGpuMode === "software" && workerId === 0;
90682
90701
  }
90702
+ function raceAgainstAbort(promise, signal) {
90703
+ if (!signal) return promise;
90704
+ if (signal.aborted) return Promise.reject(new Error("Parallel worker cancelled"));
90705
+ return new Promise((resolve79, reject2) => {
90706
+ const onAbort = () => reject2(new Error("Parallel worker cancelled"));
90707
+ signal.addEventListener("abort", onAbort, { once: true });
90708
+ promise.then(
90709
+ (value) => {
90710
+ signal.removeEventListener("abort", onAbort);
90711
+ resolve79(value);
90712
+ },
90713
+ (error) => {
90714
+ signal.removeEventListener("abort", onAbort);
90715
+ reject2(error);
90716
+ }
90717
+ );
90718
+ });
90719
+ }
90683
90720
  async function captureFrameRange(session, task, captureOptions, signal, onFrameCaptured, onFrameBuffer) {
90684
90721
  let framesCaptured = 0;
90685
90722
  const outputOffset = task.outputFrameOffset ?? 0;
@@ -90695,7 +90732,10 @@ async function captureFrameRange(session, task, captureOptions, signal, onFrameC
90695
90732
  if (dbg && i2 < task.startFrame + dbgWin) {
90696
90733
  console.log(`[par:w${task.workerId}] +${Date.now() - dbgT0}ms produce ${i2} start`);
90697
90734
  }
90698
- const { encodeResult } = await captureFrameToBufferPipelined(session, i2 - outputOffset, time);
90735
+ const { encodeResult } = await raceAgainstAbort(
90736
+ captureFrameToBufferPipelined(session, i2 - outputOffset, time),
90737
+ signal
90738
+ );
90699
90739
  encodeResult.catch(() => {
90700
90740
  });
90701
90741
  if (dbg && i2 < task.startFrame + dbgWin) {
@@ -90734,10 +90774,13 @@ async function captureFrameRange(session, task, captureOptions, signal, onFrameC
90734
90774
  const time = i2 * captureOptions.fps.den / captureOptions.fps.num;
90735
90775
  const fileFrameIdx = i2 - outputOffset;
90736
90776
  if (onFrameBuffer) {
90737
- const { buffer } = await captureFrameToBuffer(session, fileFrameIdx, time);
90777
+ const { buffer } = await raceAgainstAbort(
90778
+ captureFrameToBuffer(session, fileFrameIdx, time),
90779
+ signal
90780
+ );
90738
90781
  await onFrameBuffer(i2, buffer, session);
90739
90782
  } else {
90740
- await captureFrame(session, fileFrameIdx, time);
90783
+ await raceAgainstAbort(captureFrame(session, fileFrameIdx, time), signal);
90741
90784
  }
90742
90785
  framesCaptured++;
90743
90786
  if (onFrameCaptured) onFrameCaptured(task.workerId, i2);
@@ -91049,11 +91092,11 @@ function createFileServer(options) {
91049
91092
  headers: { "Content-Type": contentType }
91050
91093
  });
91051
91094
  });
91052
- return new Promise((resolve78) => {
91095
+ return new Promise((resolve79) => {
91053
91096
  const server = serve({ fetch: app.fetch, port }, (info) => {
91054
91097
  const actualPort = info.port;
91055
91098
  const url = `http://localhost:${actualPort}`;
91056
- resolve78({
91099
+ resolve79({
91057
91100
  url,
91058
91101
  port: actualPort,
91059
91102
  close: () => server.close()
@@ -93740,6 +93783,25 @@ function trackCommand(command2, runId3) {
93740
93783
  ...runIdField(runId3)
93741
93784
  });
93742
93785
  }
93786
+ function catalogEventProperties(usage) {
93787
+ if (!usage) return {};
93788
+ if (usage.manifestUnreadable) return { registry_manifest_unreadable: true };
93789
+ const names = usage.installed.slice(0, MAX_REPORTED_ITEM_NAMES);
93790
+ const reportedNames = new Set(names);
93791
+ const used = usage.usedBlocks.filter((name) => reportedNames.has(name));
93792
+ const truncated = names.length < usage.installed.length;
93793
+ return {
93794
+ registry_item_count: usage.installed.length,
93795
+ registry_blocks_used_count: usage.usedBlocks.length,
93796
+ // Say when the name lists are a window rather than the whole set. Without
93797
+ // it a name-joining drop-off query silently reads a truncated project as
93798
+ // all-abandoned: the used blocks can all sit past the cap, leaving an empty
93799
+ // `registry_blocks_used` against a non-zero count.
93800
+ ...truncated ? { registry_items_truncated: true } : {},
93801
+ ...names.length > 0 ? { registry_items: names.join(",") } : {},
93802
+ ...used.length > 0 ? { registry_blocks_used: used.join(",") } : {}
93803
+ };
93804
+ }
93743
93805
  function trackRenderComplete(props) {
93744
93806
  trackEvent(
93745
93807
  "render_complete",
@@ -93753,6 +93815,7 @@ function trackRenderComplete(props) {
93753
93815
  fps: props.fps,
93754
93816
  quality: props.quality,
93755
93817
  authoring_skill: props.authoringSkill,
93818
+ ...catalogEventProperties(props.catalogUsage),
93756
93819
  workers: props.workers,
93757
93820
  workers_bound_by: props.workersBoundBy,
93758
93821
  workers_cpu_based: props.workersCpuBased,
@@ -94056,6 +94119,7 @@ function trackLintRuleStreak(props) {
94056
94119
  ...runIdField(props.runId)
94057
94120
  });
94058
94121
  }
94122
+ var MAX_REPORTED_ITEM_NAMES;
94059
94123
  var init_events = __esm({
94060
94124
  "src/telemetry/events.ts"() {
94061
94125
  "use strict";
@@ -94064,6 +94128,7 @@ var init_events = __esm({
94064
94128
  init_client();
94065
94129
  init_config();
94066
94130
  init_system();
94131
+ MAX_REPORTED_ITEM_NAMES = 40;
94067
94132
  }
94068
94133
  });
94069
94134
 
@@ -96441,7 +96506,7 @@ async function fetchWithRetry(url, attempts = 3) {
96441
96506
  } catch (err) {
96442
96507
  lastErr = err;
96443
96508
  if (attempt === attempts || !isRetryableTransport(err)) break;
96444
- await new Promise((resolve78) => setTimeout(resolve78, 150 * attempt));
96509
+ await new Promise((resolve79) => setTimeout(resolve79, 150 * attempt));
96445
96510
  }
96446
96511
  }
96447
96512
  throw lastErr;
@@ -97265,7 +97330,7 @@ function downloadFile(url, dest, options = {}) {
97265
97330
  const tmp = `${dest}.${process.pid}.${randomUUID6()}.tmp`;
97266
97331
  const timeoutMs = options.timeoutMs ?? DEFAULT_DOWNLOAD_TIMEOUT_MS;
97267
97332
  const maxBytes = options.maxBytes;
97268
- return new Promise((resolve78, reject2) => {
97333
+ return new Promise((resolve79, reject2) => {
97269
97334
  const follow = (u, hops = 0) => {
97270
97335
  let activeResponse;
97271
97336
  let responsePipelineStarted = false;
@@ -97306,7 +97371,7 @@ function downloadFile(url, dest, options = {}) {
97306
97371
  const transfer = maxBytes === void 0 ? pipeline2(res, file) : pipeline2(res, enforceByteLimit(maxBytes), file);
97307
97372
  transfer.then(() => {
97308
97373
  renameSync4(tmp, dest);
97309
- resolve78();
97374
+ resolve79();
97310
97375
  }).catch((err) => {
97311
97376
  removePartialFile(tmp);
97312
97377
  reject2(requestError ?? err);
@@ -98253,6 +98318,8 @@ __export(projectConfig_exports, {
98253
98318
  normalizeConfig: () => normalizeConfig,
98254
98319
  projectConfigPath: () => projectConfigPath,
98255
98320
  readProjectConfig: () => readProjectConfig,
98321
+ readProjectConfigWithStatus: () => readProjectConfigWithStatus,
98322
+ recordProjectRegistryItems: () => recordProjectRegistryItems,
98256
98323
  resolveAutoProxy: () => resolveAutoProxy,
98257
98324
  seedProjectAuthoringSkill: () => seedProjectAuthoringSkill,
98258
98325
  writeProjectConfig: () => writeProjectConfig
@@ -98262,15 +98329,23 @@ import { join as join25, resolve as resolve12 } from "path";
98262
98329
  function projectConfigPath(projectDir) {
98263
98330
  return join25(resolve12(projectDir), PROJECT_CONFIG_FILENAME);
98264
98331
  }
98265
- function readProjectConfig(projectDir) {
98332
+ function readProjectConfigWithStatus(projectDir) {
98266
98333
  const path2 = projectConfigPath(projectDir);
98334
+ let text2;
98335
+ try {
98336
+ text2 = readFileSync17(path2, "utf-8");
98337
+ } catch (error) {
98338
+ return { status: isFileNotFound(error) ? "missing" : "unreadable" };
98339
+ }
98267
98340
  try {
98268
- const parsed = JSON.parse(readFileSync17(path2, "utf-8"));
98269
- return normalizeConfig(parsed);
98341
+ return { status: "ok", config: normalizeConfig(JSON.parse(text2)) };
98270
98342
  } catch {
98271
- return void 0;
98343
+ return { status: "unreadable" };
98272
98344
  }
98273
98345
  }
98346
+ function readProjectConfig(projectDir) {
98347
+ return readProjectConfigWithStatus(projectDir).config;
98348
+ }
98274
98349
  function normalizeConfig(partial) {
98275
98350
  return {
98276
98351
  $schema: partial.$schema ?? DEFAULT_PROJECT_CONFIG.$schema,
@@ -98285,9 +98360,20 @@ function normalizeConfig(partial) {
98285
98360
  },
98286
98361
  // Slug-gate on read so a hand-edited or corrupt value never reaches the
98287
98362
  // telemetry stream; an invalid slug simply drops the attribution.
98288
- authoringSkill: normalizeSkillSlug(partial.authoringSkill)
98363
+ authoringSkill: normalizeSkillSlug(partial.authoringSkill),
98364
+ // Whitelist rebuild - an omission here silently drops the manifest on
98365
+ // every config round-trip, which would read as "this project never
98366
+ // installed a catalog item".
98367
+ registryItems: normalizeRegistryItems(partial.registryItems)
98289
98368
  };
98290
98369
  }
98370
+ function normalizeRegistryItems(raw) {
98371
+ if (!Array.isArray(raw)) return void 0;
98372
+ const items = raw.filter(
98373
+ (entry) => isJsonObject(entry) && typeof entry.name === "string" && entry.name !== "" && typeof entry.type === "string" && typeof entry.target === "string"
98374
+ );
98375
+ return items.length > 0 ? items : void 0;
98376
+ }
98291
98377
  function writeProjectConfig(projectDir, config = DEFAULT_PROJECT_CONFIG) {
98292
98378
  const path2 = projectConfigPath(projectDir);
98293
98379
  writeFileSync11(path2, JSON.stringify(config, null, 2) + "\n", "utf-8");
@@ -98333,6 +98419,33 @@ function seedProjectAuthoringSkill(projectDir, rawSkill) {
98333
98419
  } catch {
98334
98420
  }
98335
98421
  }
98422
+ function recordProjectRegistryItems(projectDir, items) {
98423
+ if (items.length === 0) return;
98424
+ const path2 = projectConfigPath(projectDir);
98425
+ let text2;
98426
+ try {
98427
+ text2 = readFileSync17(path2, "utf-8");
98428
+ } catch {
98429
+ return;
98430
+ }
98431
+ try {
98432
+ const parsed = JSON.parse(text2);
98433
+ if (!isJsonObject(parsed)) return;
98434
+ const existing = normalizeRegistryItems(parsed.registryItems) ?? [];
98435
+ const byName = new Map(existing.map((item) => [item.name, item]));
98436
+ for (const item of items) byName.set(item.name, item);
98437
+ const merged = [...byName.values()];
98438
+ const unchanged = merged.length === existing.length && merged.every((item, index) => {
98439
+ const prior = existing[index];
98440
+ return prior !== void 0 && prior.name === item.name && prior.type === item.type && prior.target === item.target;
98441
+ });
98442
+ if (unchanged) return;
98443
+ parsed.registryItems = merged;
98444
+ const indent = /\n([ \t]+)"/.exec(text2)?.[1] ?? " ";
98445
+ writeFileSync11(path2, JSON.stringify(parsed, null, indent) + "\n", "utf-8");
98446
+ } catch {
98447
+ }
98448
+ }
98336
98449
  var PROJECT_CONFIG_FILENAME, PROJECT_CONFIG_SCHEMA_URL, DEFAULT_PROJECT_CONFIG;
98337
98450
  var init_projectConfig = __esm({
98338
98451
  "src/utils/projectConfig.ts"() {
@@ -99287,7 +99400,7 @@ function hasGit2() {
99287
99400
  }
99288
99401
  function spawnNpx(args, opts = {}) {
99289
99402
  const npx = buildNpxCommand(args);
99290
- return new Promise((resolve78, reject2) => {
99403
+ return new Promise((resolve79, reject2) => {
99291
99404
  const child = spawn6(npx.command, npx.args, {
99292
99405
  // Route the child's stdout to the parent's stderr (fd 2), keeping stdin
99293
99406
  // inherited. `skills update --json` runs this installer before printing its
@@ -99316,7 +99429,7 @@ function spawnNpx(args, opts = {}) {
99316
99429
  }
99317
99430
  });
99318
99431
  child.on("close", (code, signal) => {
99319
- if (code === 0) resolve78();
99432
+ if (code === 0) resolve79();
99320
99433
  else if (signal === "SIGINT" || code === 130)
99321
99434
  reject2(new CliResultSignal({ exitCode: 0, kind: "success", presented: true }));
99322
99435
  else reject2(new Error(`npx ${args.join(" ")} exited with code ${code}`));
@@ -115032,7 +115145,7 @@ function isErrno(err, code) {
115032
115145
  return err.code === code;
115033
115146
  }
115034
115147
  function sleep(ms) {
115035
- return new Promise((resolve78) => setTimeout(resolve78, ms));
115148
+ return new Promise((resolve79) => setTimeout(resolve79, ms));
115036
115149
  }
115037
115150
  function tryAcquireDirLock(lockDir) {
115038
115151
  try {
@@ -116328,10 +116441,10 @@ function createFileServer2(options) {
116328
116441
  }
116329
116442
  });
116330
116443
  });
116331
- return new Promise((resolve78) => {
116444
+ return new Promise((resolve79) => {
116332
116445
  const connections = /* @__PURE__ */ new Set();
116333
116446
  const server = serve2({ fetch: app.fetch, port, hostname: "127.0.0.1" }, (info) => {
116334
- resolve78({
116447
+ resolve79({
116335
116448
  url: `http://localhost:${info.port}`,
116336
116449
  port: info.port,
116337
116450
  addPreHeadScript: (script) => {
@@ -118971,9 +119084,9 @@ var require_compress_binding = __commonJS({
118971
119084
  });
118972
119085
  } else {
118973
119086
  if (readAsync) {
118974
- return new Promise(function(resolve78, reject2) {
119087
+ return new Promise(function(resolve79, reject2) {
118975
119088
  readAsync(wasmBinaryFile, function(response) {
118976
- resolve78(new Uint8Array(response));
119089
+ resolve79(new Uint8Array(response));
118977
119090
  }, reject2);
118978
119091
  });
118979
119092
  }
@@ -120007,8 +120120,8 @@ var require_compress = __commonJS({
120007
120120
  "../../node_modules/.bun/wawoff2@2.0.1/node_modules/wawoff2/compress.js"(exports, module) {
120008
120121
  "use strict";
120009
120122
  var em_module = require_compress_binding();
120010
- var runtimeInit = new Promise((resolve78) => {
120011
- em_module.onRuntimeInitialized = resolve78;
120123
+ var runtimeInit = new Promise((resolve79) => {
120124
+ em_module.onRuntimeInitialized = resolve79;
120012
120125
  });
120013
120126
  module.exports = async function compress2(buffer) {
120014
120127
  await runtimeInit;
@@ -120527,9 +120640,9 @@ var require_decompress_binding = __commonJS({
120527
120640
  });
120528
120641
  } else {
120529
120642
  if (readAsync) {
120530
- return new Promise(function(resolve78, reject2) {
120643
+ return new Promise(function(resolve79, reject2) {
120531
120644
  readAsync(wasmBinaryFile, function(response) {
120532
- resolve78(new Uint8Array(response));
120645
+ resolve79(new Uint8Array(response));
120533
120646
  }, reject2);
120534
120647
  });
120535
120648
  }
@@ -121544,8 +121657,8 @@ var require_decompress = __commonJS({
121544
121657
  "../../node_modules/.bun/wawoff2@2.0.1/node_modules/wawoff2/decompress.js"(exports, module) {
121545
121658
  "use strict";
121546
121659
  var em_module = require_decompress_binding();
121547
- var runtimeInit = new Promise((resolve78) => {
121548
- em_module.onRuntimeInitialized = resolve78;
121660
+ var runtimeInit = new Promise((resolve79) => {
121661
+ em_module.onRuntimeInitialized = resolve79;
121549
121662
  });
121550
121663
  module.exports = async function decompress(buffer) {
121551
121664
  await runtimeInit;
@@ -122132,10 +122245,10 @@ function throwIfCallerAborted(signal) {
122132
122245
  async function waitForFontFetchRetry(delayMs, signal) {
122133
122246
  throwIfCallerAborted(signal);
122134
122247
  if (delayMs <= 0) return;
122135
- await new Promise((resolve78, reject2) => {
122248
+ await new Promise((resolve79, reject2) => {
122136
122249
  const timeout = setTimeout(() => {
122137
122250
  signal?.removeEventListener("abort", onAbort);
122138
- resolve78();
122251
+ resolve79();
122139
122252
  }, delayMs);
122140
122253
  const onAbort = () => {
122141
122254
  clearTimeout(timeout);
@@ -122287,10 +122400,16 @@ async function fetchGoogleFont(familyName, options, fontText) {
122287
122400
  function extractGoogleFontsText(html) {
122288
122401
  const { document: document2 } = parseHTML(html);
122289
122402
  const decodedBodyText = document2.body?.textContent ?? "";
122290
- const uniqueCharacters = [.../* @__PURE__ */ new Set([...Array.from(html), ...Array.from(decodedBodyText)])].join(
122291
- ""
122292
- );
122293
- return encodeURIComponent(uniqueCharacters).length <= GOOGLE_FONTS_TEXT_MAX_ENCODED_LENGTH ? uniqueCharacters : void 0;
122403
+ const characters = [...Array.from(html), ...Array.from(decodedBodyText)];
122404
+ const uniqueCharacters = /* @__PURE__ */ new Set();
122405
+ for (const character of characters) {
122406
+ uniqueCharacters.add(character);
122407
+ for (const variant of `${character.toUpperCase()}${character.toLowerCase()}`) {
122408
+ uniqueCharacters.add(variant);
122409
+ }
122410
+ }
122411
+ const fontText = [...uniqueCharacters].join("");
122412
+ return encodeURIComponent(fontText).length <= GOOGLE_FONTS_TEXT_MAX_ENCODED_LENGTH ? fontText : void 0;
122294
122413
  }
122295
122414
  function resolveFontFetchRetryPolicy(configured) {
122296
122415
  return {
@@ -122858,10 +122977,10 @@ var init_semaphore = __esm({
122858
122977
  this.active++;
122859
122978
  return () => this.release();
122860
122979
  }
122861
- return new Promise((resolve78) => {
122980
+ return new Promise((resolve79) => {
122862
122981
  this.queue.push(() => {
122863
122982
  this.active++;
122864
- resolve78(() => this.release());
122983
+ resolve79(() => this.release());
122865
122984
  });
122866
122985
  });
122867
122986
  }
@@ -126890,7 +127009,7 @@ function resolveDeStallTimeoutMs() {
126890
127009
  return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_DE_STALL_MS;
126891
127010
  }
126892
127011
  function raceAgainstStall(promise, deadlineMs, message, signal) {
126893
- return new Promise((resolve78, reject2) => {
127012
+ return new Promise((resolve79, reject2) => {
126894
127013
  const timer = setTimeout(
126895
127014
  () => {
126896
127015
  reject2(
@@ -126904,7 +127023,7 @@ function raceAgainstStall(promise, deadlineMs, message, signal) {
126904
127023
  promise.then(
126905
127024
  (value) => {
126906
127025
  clearTimeout(timer);
126907
- resolve78(value);
127026
+ resolve79(value);
126908
127027
  },
126909
127028
  (error) => {
126910
127029
  clearTimeout(timer);
@@ -127789,8 +127908,8 @@ async function createShaderTransitionWorkerPool(opts) {
127789
127908
  if (terminated) {
127790
127909
  throw new Error("shader-blend pool already terminated");
127791
127910
  }
127792
- return new Promise((resolve78, reject2) => {
127793
- const task = traceEnabled ? { req, resolve: resolve78, reject: reject2, enqueuedAtMs: Date.now(), traceId: ++nextTaskId } : { req, resolve: resolve78, reject: reject2 };
127911
+ return new Promise((resolve79, reject2) => {
127912
+ const task = traceEnabled ? { req, resolve: resolve79, reject: reject2, enqueuedAtMs: Date.now(), traceId: ++nextTaskId } : { req, resolve: resolve79, reject: reject2 };
127794
127913
  const idle = slots.find((s2) => !s2.busy && !s2.dead);
127795
127914
  if (idle) {
127796
127915
  queue.unshift(task);
@@ -131691,12 +131810,12 @@ async function startHealthWorker(options = {}) {
131691
131810
  stdout: false,
131692
131811
  stderr: false
131693
131812
  });
131694
- await new Promise((resolve78, reject2) => {
131813
+ await new Promise((resolve79, reject2) => {
131695
131814
  const onMessage = (msg) => {
131696
131815
  if (msg?.type === "listening") {
131697
131816
  worker.off("error", onError);
131698
131817
  worker.off("message", onMessage);
131699
- resolve78();
131818
+ resolve79();
131700
131819
  } else if (msg?.type === "listen-error") {
131701
131820
  worker.off("error", onError);
131702
131821
  worker.off("message", onMessage);
@@ -136068,12 +136187,12 @@ async function runPipeline(options, session, media, format, bgFormat, ffmpegPath
136068
136187
  const drains = [];
136069
136188
  if (!fgWroteFully) {
136070
136189
  drains.push(
136071
- new Promise((resolve78) => fg.proc.stdin.once("drain", () => resolve78()))
136190
+ new Promise((resolve79) => fg.proc.stdin.once("drain", () => resolve79()))
136072
136191
  );
136073
136192
  }
136074
136193
  if (!bgWroteFully && bg) {
136075
136194
  drains.push(
136076
- new Promise((resolve78) => bg.proc.stdin.once("drain", () => resolve78()))
136195
+ new Promise((resolve79) => bg.proc.stdin.once("drain", () => resolve79()))
136077
136196
  );
136078
136197
  }
136079
136198
  await Promise.all(drains);
@@ -136106,11 +136225,11 @@ ${decoder.getStderr().slice(-400)}`
136106
136225
  return processed;
136107
136226
  }
136108
136227
  function waitForExit(proc, label2, getStderr) {
136109
- return new Promise((resolve78, reject2) => {
136228
+ return new Promise((resolve79, reject2) => {
136110
136229
  proc.on("error", reject2);
136111
136230
  proc.on("exit", (code, signal) => {
136112
136231
  if (code === 0 && !signal) {
136113
- resolve78();
136232
+ resolve79();
136114
136233
  return;
136115
136234
  }
136116
136235
  const cause = signal ? `killed by ${signal}` : `exited with code ${code}`;
@@ -139383,6 +139502,10 @@ function variableValuesAttribute(values) {
139383
139502
  const json = JSON.stringify(values).replace(/'/g, "&#39;");
139384
139503
  return ` data-variable-values='${json}'`;
139385
139504
  }
139505
+ function primaryInstalledTarget(item) {
139506
+ const primary = item.files.find((f3) => f3.type === "hyperframes:snippet") ?? item.files.find((f3) => f3.type === "hyperframes:composition") ?? item.files[0];
139507
+ return primary?.target ?? "";
139508
+ }
139386
139509
  function buildSnippet(item, relativeTarget, values = null) {
139387
139510
  if (item.type === "hyperframes:block") {
139388
139511
  const dims = "dimensions" in item && item.dimensions ? ` data-width="${item.dimensions.width}" data-height="${item.dimensions.height}"` : "";
@@ -139502,9 +139625,16 @@ async function runAdd(opts) {
139502
139625
  requested: planItem.name === item.name
139503
139626
  });
139504
139627
  }
139628
+ recordProjectRegistryItems(
139629
+ projectDir,
139630
+ installPlan.map((planItem) => ({
139631
+ name: planItem.name,
139632
+ type: planItem.type,
139633
+ target: primaryInstalledTarget(planItem)
139634
+ }))
139635
+ );
139505
139636
  const itemForInstall = installPlan[installPlan.length - 1];
139506
- const primaryFile = itemForInstall.files.find((f3) => f3.type === "hyperframes:snippet") ?? itemForInstall.files.find((f3) => f3.type === "hyperframes:composition") ?? itemForInstall.files[0];
139507
- const snippetTargetRel = primaryFile?.target ?? "";
139637
+ const snippetTargetRel = primaryInstalledTarget(itemForInstall);
139508
139638
  const snippet = buildSnippet(item, snippetTargetRel, variableValues);
139509
139639
  const clipboardCopied = !opts.skipClipboard && snippet ? copyToClipboard(snippet) : false;
139510
139640
  for (const { id, reason } of variablesInvalid) {
@@ -141912,8 +142042,8 @@ async function startLoopback(opts) {
141912
142042
  const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
141913
142043
  let resolveResult;
141914
142044
  let rejectResult;
141915
- const result = new Promise((resolve78, reject2) => {
141916
- resolveResult = resolve78;
142045
+ const result = new Promise((resolve79, reject2) => {
142046
+ resolveResult = resolve79;
141917
142047
  rejectResult = reject2;
141918
142048
  });
141919
142049
  let redirectUri = "";
@@ -141929,7 +142059,7 @@ async function startLoopback(opts) {
141929
142059
  closed = true;
141930
142060
  clearTimeout(timer);
141931
142061
  server.closeAllConnections?.();
141932
- await new Promise((resolve78) => server.close(() => resolve78()));
142062
+ await new Promise((resolve79) => server.close(() => resolve79()));
141933
142063
  };
141934
142064
  const timer = setTimeout(() => {
141935
142065
  rejectResult(new Error(`OAuth callback timed out after ${timeoutMs}ms`));
@@ -141940,11 +142070,11 @@ async function startLoopback(opts) {
141940
142070
  return { result, redirectUri, close };
141941
142071
  }
141942
142072
  async function listen(server, port) {
141943
- await new Promise((resolve78, reject2) => {
142073
+ await new Promise((resolve79, reject2) => {
141944
142074
  server.once("error", reject2);
141945
142075
  server.listen(port, "127.0.0.1", () => {
141946
142076
  server.off("error", reject2);
141947
- resolve78();
142077
+ resolve79();
141948
142078
  });
141949
142079
  });
141950
142080
  }
@@ -142131,7 +142261,7 @@ async function startDeviceAuthorizationFlow(opts = {}) {
142131
142261
  const runtime = {
142132
142262
  clientId: resolveClientId(),
142133
142263
  fetchImpl: opts.fetchImpl ?? fetch,
142134
- sleepImpl: opts.sleepImpl ?? ((ms) => new Promise((resolve78) => setTimeout(resolve78, ms))),
142264
+ sleepImpl: opts.sleepImpl ?? ((ms) => new Promise((resolve79) => setTimeout(resolve79, ms))),
142135
142265
  now: opts.now ?? Date.now,
142136
142266
  requestTimeoutMs: opts.requestTimeoutMs ?? DEVICE_REQUEST_TIMEOUT_MS
142137
142267
  };
@@ -142825,7 +142955,7 @@ function isRequestTimeout(error) {
142825
142955
  return error instanceof DOMException && (error.name === "TimeoutError" || error.name === "AbortError");
142826
142956
  }
142827
142957
  function waitBeforePublishRetry() {
142828
- return new Promise((resolve78) => setTimeout(resolve78, PUBLISH_RETRY_DELAY_MS));
142958
+ return new Promise((resolve79) => setTimeout(resolve79, PUBLISH_RETRY_DELAY_MS));
142829
142959
  }
142830
142960
  async function fetchForPublish(input2, createInit, failureStage, attempts = 1) {
142831
142961
  if (attempts < 1) throw new RangeError("Publish fetch attempts must be at least 1");
@@ -143526,9 +143656,78 @@ var init_publish = __esm({
143526
143656
  }
143527
143657
  });
143528
143658
 
143659
+ // src/utils/catalogUsage.ts
143660
+ import { readFileSync as readFileSync54 } from "fs";
143661
+ import { isAbsolute as isAbsolute13, relative as relative20, resolve as resolve51 } from "path";
143662
+ function reachableCompositions(projectDir, entryPath) {
143663
+ const seen = /* @__PURE__ */ new Set();
143664
+ const queue = [resolve51(entryPath)];
143665
+ while (queue.length > 0 && seen.size < MAX_VISITED_FILES) {
143666
+ const current2 = queue.shift();
143667
+ if (seen.has(current2)) continue;
143668
+ seen.add(current2);
143669
+ let html;
143670
+ try {
143671
+ html = readFileSync54(current2, "utf-8");
143672
+ } catch {
143673
+ continue;
143674
+ }
143675
+ if (html.length > MAX_HTML_BYTES) continue;
143676
+ for (const src of collectSubCompositionSrcs(html)) {
143677
+ queue.push(resolve51(projectDir, src));
143678
+ }
143679
+ }
143680
+ return seen;
143681
+ }
143682
+ function isReached(projectDir, target, reachable) {
143683
+ if (isAbsolute13(target)) return false;
143684
+ const abs = resolve51(projectDir, target);
143685
+ if (relative20(projectDir, abs).startsWith("..")) return false;
143686
+ return reachable.has(abs);
143687
+ }
143688
+ function reportableNames(names) {
143689
+ return [...new Set(names.filter((name) => REGISTRY_ITEM_NAME.test(name)))].sort();
143690
+ }
143691
+ function summarizeCatalogUsage(projectDir, entryPath) {
143692
+ const { status, config } = readProjectConfigWithStatus(projectDir);
143693
+ if (status === "unreadable") return UNREADABLE;
143694
+ const items = config?.registryItems ?? [];
143695
+ if (items.length === 0) return EMPTY;
143696
+ const installed = reportableNames(items.map((item) => item.name));
143697
+ if (installed.length === 0) return EMPTY;
143698
+ const reachable = reachableCompositions(projectDir, entryPath);
143699
+ const usedBlocks = reportableNames(
143700
+ items.filter(
143701
+ (item) => item.type === "hyperframes:block" && isReached(projectDir, item.target, reachable)
143702
+ ).map((item) => item.name)
143703
+ );
143704
+ return { installed, usedBlocks, manifestUnreadable: false };
143705
+ }
143706
+ var EMPTY, UNREADABLE, MAX_VISITED_FILES, MAX_HTML_BYTES, REGISTRY_ITEM_NAME;
143707
+ var init_catalogUsage = __esm({
143708
+ "src/utils/catalogUsage.ts"() {
143709
+ "use strict";
143710
+ init_assetResolution();
143711
+ init_projectConfig();
143712
+ EMPTY = Object.freeze({
143713
+ installed: [],
143714
+ usedBlocks: [],
143715
+ manifestUnreadable: false
143716
+ });
143717
+ UNREADABLE = Object.freeze({
143718
+ installed: [],
143719
+ usedBlocks: [],
143720
+ manifestUnreadable: true
143721
+ });
143722
+ MAX_VISITED_FILES = 250;
143723
+ MAX_HTML_BYTES = 20 * 1024 * 1024;
143724
+ REGISTRY_ITEM_NAME = /^[a-z0-9][a-z0-9-]{0,63}$/;
143725
+ }
143726
+ });
143727
+
143529
143728
  // src/commands/render/plan.ts
143530
143729
  import { statSync as statSync28 } from "fs";
143531
- import { dirname as dirname39, join as join89, resolve as resolve51 } from "path";
143730
+ import { dirname as dirname39, join as join89, resolve as resolve52 } from "path";
143532
143731
  function formatFpsParseError(input2, reason) {
143533
143732
  switch (reason) {
143534
143733
  case "empty":
@@ -143561,7 +143760,7 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
143561
143760
  const hasExplicitComposition = hasExplicitCompositionArg(args.composition);
143562
143761
  const project = resolveProject(args.dir, { requireIndex: !hasExplicitComposition });
143563
143762
  const entryFile = resolveCompositionEntryArg(args.composition, project.dir, statSync28);
143564
- const renderTarget = entryFile ? resolve51(project.dir, entryFile) : project.indexPath;
143763
+ const renderTarget = entryFile ? resolve52(project.dir, entryFile) : project.indexPath;
143565
143764
  const fpsArg = resolveDefaultFpsArg(args.fps, project.dir, project.indexPath, entryFile);
143566
143765
  const fpsParse = parseFps(fpsArg ?? "30");
143567
143766
  if (!fpsParse.ok) {
@@ -143578,6 +143777,7 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
143578
143777
  const flagSkill = normalizeSkillSlug(args.skill);
143579
143778
  const authoringSkill = flagSkill ?? loadProjectConfig(project.dir).authoringSkill;
143580
143779
  const invalidAuthoringSkill = typeof args.skill === "string" && args.skill.trim() !== "" && !flagSkill ? args.skill : void 0;
143780
+ const catalogUsage = summarizeCatalogUsage(project.dir, renderTarget);
143581
143781
  const formatRaw = args.format ?? "mp4";
143582
143782
  const format = parseRenderFormat(formatRaw);
143583
143783
  if (!format) {
@@ -143657,7 +143857,7 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
143657
143857
  const raw = args["frames-cache-dir"].trim();
143658
143858
  const normalized2 = raw.toLowerCase();
143659
143859
  const isDisableAlias = EXTRACT_CACHE_DIR_DISABLED_ALIASES.includes(normalized2);
143660
- environment.HYPERFRAMES_EXTRACT_CACHE_DIR = isDisableAlias ? raw : resolve51(raw);
143860
+ environment.HYPERFRAMES_EXTRACT_CACHE_DIR = isDisableAlias ? raw : resolve52(raw);
143661
143861
  }
143662
143862
  if (args["max-concurrent-renders"] != null) {
143663
143863
  const parsed = positiveInteger(
@@ -143695,11 +143895,11 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
143695
143895
  "Invalid batch-concurrency",
143696
143896
  `Got "${args["batch-concurrency"]}". Must be a positive integer.`
143697
143897
  ) : 1;
143698
- const rendersDir = resolve51("renders");
143898
+ const rendersDir = resolve52("renders");
143699
143899
  const ext = FORMAT_EXT[format];
143700
143900
  const timestamp = formatRenderOutputTimestamp(now);
143701
143901
  const batchOutputTemplate = args.output ? args.output : join89(rendersDir, `${project.name}_${timestamp}_{index}${ext}`);
143702
- const outputPath = args.output ? resolve51(args.output) : join89(rendersDir, `${project.name}_${timestamp}${ext}`);
143902
+ const outputPath = args.output ? resolve52(args.output) : join89(rendersDir, `${project.name}_${timestamp}${ext}`);
143703
143903
  const useDocker = args.docker ?? false;
143704
143904
  const useGpu = args.gpu ?? false;
143705
143905
  const browserGpuMode = resolveBrowserGpuForCli(useDocker, args["browser-gpu"]);
@@ -143751,6 +143951,7 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
143751
143951
  quality,
143752
143952
  authoringSkill,
143753
143953
  invalidAuthoringSkill,
143954
+ catalogUsage,
143754
143955
  format,
143755
143956
  gifLoop,
143756
143957
  gifFpsCapped,
@@ -143814,6 +144015,7 @@ var init_plan2 = __esm({
143814
144015
  init_renderArgs();
143815
144016
  init_skill();
143816
144017
  init_projectConfig();
144018
+ init_catalogUsage();
143817
144019
  VALID_QUALITY = /* @__PURE__ */ new Set(["draft", "standard", "high"]);
143818
144020
  RENDER_FORMATS = ["mp4", "webm", "mov", "png-sequence", "gif"];
143819
144021
  VALID_FORMAT = new Set(RENDER_FORMATS);
@@ -143830,7 +144032,7 @@ var init_plan2 = __esm({
143830
144032
 
143831
144033
  // src/commands/render/present.ts
143832
144034
  import { cpus as cpus5 } from "os";
143833
- import { readFileSync as readFileSync54 } from "fs";
144035
+ import { readFileSync as readFileSync55 } from "fs";
143834
144036
  async function presentRenderPlan(plan2) {
143835
144037
  await presentRenderWarnings(plan2);
143836
144038
  if (plan2.effectiveQuiet || plan2.batchPath) return;
@@ -143873,7 +144075,7 @@ function presentRenderSummary(plan2) {
143873
144075
  async function warnForSlideshow(plan2) {
143874
144076
  try {
143875
144077
  const { slideshowIslandRegex: slideshowIslandRegex2 } = await Promise.resolve().then(() => (init_slideshow2(), slideshow_exports));
143876
- if (!slideshowIslandRegex2("i").test(readFileSync54(plan2.renderTarget, "utf8"))) return;
144078
+ if (!slideshowIslandRegex2("i").test(readFileSync55(plan2.renderTarget, "utf8"))) return;
143877
144079
  console.log(
143878
144080
  c.warn("\u26A0") + " This composition carries a slideshow island \u2014 `render` captures only the first scene, so the MP4 will be truncated to slide 1. Use " + c.accent("hyperframes present") + " for the deck; a linear main-line MP4 export is not yet available."
143879
144081
  );
@@ -143890,9 +144092,9 @@ var init_present2 = __esm({
143890
144092
  });
143891
144093
 
143892
144094
  // src/utils/variables.ts
143893
- import { readFileSync as readFileSync55 } from "fs";
143894
- import { resolve as resolve52 } from "path";
143895
- function parseVariablesArg(inline, filePath, readFile5 = (p2) => readFileSync55(resolve52(p2), "utf8")) {
144095
+ import { readFileSync as readFileSync56 } from "fs";
144096
+ import { resolve as resolve53 } from "path";
144097
+ function parseVariablesArg(inline, filePath, readFile5 = (p2) => readFileSync56(resolve53(p2), "utf8")) {
143896
144098
  if (inline != null && filePath != null) {
143897
144099
  return { ok: false, error: { kind: "conflict" } };
143898
144100
  }
@@ -143975,7 +144177,7 @@ function validateVariablesAgainstProject(indexPath2, values) {
143975
144177
  function loadProjectVariableSchema(indexPath2) {
143976
144178
  let html;
143977
144179
  try {
143978
- html = readFileSync55(indexPath2, "utf8");
144180
+ html = readFileSync56(indexPath2, "utf8");
143979
144181
  } catch {
143980
144182
  return [];
143981
144183
  }
@@ -144030,8 +144232,8 @@ __export(batchRender_exports, {
144030
144232
  resolveOutputTemplate: () => resolveOutputTemplate,
144031
144233
  runBatchRender: () => runBatchRender
144032
144234
  });
144033
- import { mkdirSync as mkdirSync43, readFileSync as readFileSync56, writeFileSync as writeFileSync31 } from "fs";
144034
- import { dirname as dirname40, join as join90, resolve as resolve53, sep as sep12 } from "path";
144235
+ import { mkdirSync as mkdirSync43, readFileSync as readFileSync57, writeFileSync as writeFileSync31 } from "fs";
144236
+ import { dirname as dirname40, join as join90, resolve as resolve54, sep as sep12 } from "path";
144035
144237
  function isRecord10(value) {
144036
144238
  return value !== null && typeof value === "object" && !Array.isArray(value);
144037
144239
  }
@@ -144092,7 +144294,7 @@ function isSameOrChildPath(path2, parent) {
144092
144294
  }
144093
144295
  function commonOutputDirectory(outputPaths) {
144094
144296
  const firstPath = outputPaths[0];
144095
- if (!firstPath) return resolve53("renders");
144297
+ if (!firstPath) return resolve54("renders");
144096
144298
  let common = dirname40(firstPath);
144097
144299
  for (const outputPath of outputPaths.slice(1)) {
144098
144300
  const dir = dirname40(outputPath);
@@ -144155,8 +144357,8 @@ function reportBatchVariableIssues(row, index, schema, quiet, json) {
144155
144357
  return issues.length;
144156
144358
  }
144157
144359
  function prepareBatchRender(options) {
144158
- const batchPath = resolve53(options.batchPath);
144159
- const read = options.readFile ?? ((path2) => readFileSync56(path2, "utf8"));
144360
+ const batchPath = resolve54(options.batchPath);
144361
+ const read = options.readFile ?? ((path2) => readFileSync57(path2, "utf8"));
144160
144362
  let raw;
144161
144363
  try {
144162
144364
  raw = read(batchPath);
@@ -144170,7 +144372,7 @@ function prepareBatchRender(options) {
144170
144372
  const rows = variableRows.map((variables, index) => ({
144171
144373
  index,
144172
144374
  variables,
144173
- outputPath: resolve53(resolveOutputTemplate(options.outputTemplate, variables, index))
144375
+ outputPath: resolve54(resolveOutputTemplate(options.outputTemplate, variables, index))
144174
144376
  }));
144175
144377
  const manifestPath2 = join90(
144176
144378
  commonOutputDirectory(rows.map((row) => row.outputPath)),
@@ -144352,7 +144554,7 @@ var init_batchRender = __esm({
144352
144554
  });
144353
144555
 
144354
144556
  // src/commands/render/execute.ts
144355
- import { mkdirSync as mkdirSync44, readFileSync as readFileSync57 } from "fs";
144557
+ import { mkdirSync as mkdirSync44, readFileSync as readFileSync58 } from "fs";
144356
144558
  function renderLintContinuationHint(strictErrors) {
144357
144559
  return strictErrors ? " Continuing render despite lint warnings. Use --strict-all to block warnings." : " Continuing render despite lint issues. Use --strict to block errors.";
144358
144560
  }
@@ -144395,6 +144597,7 @@ async function executeRenderPlan(plan2, dependencies) {
144395
144597
  fps: plan2.fps,
144396
144598
  quality: plan2.quality,
144397
144599
  authoringSkill: plan2.authoringSkill,
144600
+ catalogUsage: plan2.catalogUsage,
144398
144601
  format: plan2.format,
144399
144602
  gifLoop: plan2.gifLoop,
144400
144603
  workers: plan2.workers,
@@ -144495,7 +144698,7 @@ async function runResolutionPreflight(plan2, checkResolution) {
144495
144698
  if (!plan2.outputResolution) return;
144496
144699
  let issue;
144497
144700
  try {
144498
- issue = await checkResolution(readFileSync57(plan2.renderTarget, "utf8"), plan2.outputResolution, {
144701
+ issue = await checkResolution(readFileSync58(plan2.renderTarget, "utf8"), plan2.outputResolution, {
144499
144702
  alphaRequested: plan2.format === "webm" || plan2.format === "mov" || plan2.format === "png-sequence",
144500
144703
  hdrRequested: plan2.hdrMode === "force-hdr",
144501
144704
  aspectAgnostic: plan2.outputResolutionAspectAgnostic
@@ -144513,6 +144716,7 @@ async function executeBatchRender(plan2, browserPath, batchModule, preparedBatch
144513
144716
  fps: plan2.fps,
144514
144717
  quality: plan2.quality,
144515
144718
  authoringSkill: plan2.authoringSkill,
144719
+ catalogUsage: plan2.catalogUsage,
144516
144720
  format: plan2.format,
144517
144721
  workers: plan2.workers,
144518
144722
  gpu: plan2.useGpu,
@@ -144792,18 +144996,18 @@ async function getDoctorSummary() {
144792
144996
  }
144793
144997
  }
144794
144998
  function askQuestion(prompt) {
144795
- return new Promise((resolve78) => {
144999
+ return new Promise((resolve79) => {
144796
145000
  const rl = readline.createInterface({
144797
145001
  input: process.stdin,
144798
145002
  output: process.stdout
144799
145003
  });
144800
145004
  rl.question(prompt, (answer) => {
144801
145005
  rl.close();
144802
- resolve78(answer);
145006
+ resolve79(answer);
144803
145007
  });
144804
145008
  const timeout = setTimeout(() => {
144805
145009
  rl.close();
144806
- resolve78("");
145010
+ resolve79("");
144807
145011
  }, 1e4);
144808
145012
  if (typeof timeout === "object" && timeout !== null && "unref" in timeout) {
144809
145013
  timeout.unref();
@@ -144965,9 +145169,9 @@ __export(render_exports, {
144965
145169
  resolveBrowserGpuForCli: () => resolveBrowserGpuForCli,
144966
145170
  runRenderLint: () => runRenderLint
144967
145171
  });
144968
- import { mkdtempSync as mkdtempSync13, readdirSync as readdirSync29, readFileSync as readFileSync58, statSync as statSync29, writeFileSync as writeFileSync33, rmSync as rmSync28 } from "fs";
145172
+ import { mkdtempSync as mkdtempSync13, readdirSync as readdirSync29, readFileSync as readFileSync59, statSync as statSync29, writeFileSync as writeFileSync33, rmSync as rmSync28 } from "fs";
144969
145173
  import { freemem as freemem5, tmpdir as tmpdir13 } from "os";
144970
- import { resolve as resolve54, dirname as dirname41, join as join91, basename as basename16 } from "path";
145174
+ import { resolve as resolve55, dirname as dirname41, join as join91, basename as basename16 } from "path";
144971
145175
  import { execFileSync as execFileSync12, spawn as spawn15 } from "child_process";
144972
145176
  async function readCompositionDimensions(compositionHtml) {
144973
145177
  try {
@@ -145001,8 +145205,8 @@ function dockerImageTag(version2) {
145001
145205
  return `${DOCKER_IMAGE_PREFIX}:${version2}`;
145002
145206
  }
145003
145207
  function resolveDockerfilePath() {
145004
- const builtPath = resolve54(__dirname, "docker", "Dockerfile.render");
145005
- const devPath = resolve54(__dirname, "..", "src", "docker", "Dockerfile.render");
145208
+ const builtPath = resolve55(__dirname, "docker", "Dockerfile.render");
145209
+ const devPath = resolve55(__dirname, "..", "src", "docker", "Dockerfile.render");
145006
145210
  for (const p2 of [builtPath, devPath]) {
145007
145211
  try {
145008
145212
  statSync29(p2);
@@ -145034,7 +145238,7 @@ function ensureDockerImage(version2, platform11, quiet) {
145034
145238
  if (!quiet) console.log(c.dim(` Building Docker image: ${tag} (${platform11})...`));
145035
145239
  const dockerfilePath = resolveDockerfilePath();
145036
145240
  const tmpDir = mkdtempSync13(join91(tmpdir13(), "hyperframes-docker-"));
145037
- writeFileSync33(join91(tmpDir, "Dockerfile"), readFileSync58(dockerfilePath));
145241
+ writeFileSync33(join91(tmpDir, "Dockerfile"), readFileSync59(dockerfilePath));
145038
145242
  const targetArch = platform11 === "linux/arm64" ? "arm64" : "amd64";
145039
145243
  try {
145040
145244
  execFileSync12(
@@ -145105,8 +145309,8 @@ async function renderDocker(projectDir, outputPath, options) {
145105
145309
  const outputFilename = basename16(outputPath);
145106
145310
  const dockerArgs = buildDockerRunArgs({
145107
145311
  imageTag,
145108
- projectDir: resolve54(projectDir),
145109
- outputDir: resolve54(outputDir),
145312
+ projectDir: resolve55(projectDir),
145313
+ outputDir: resolve55(outputDir),
145110
145314
  outputFilename,
145111
145315
  platform: platform11,
145112
145316
  options: {
@@ -145166,6 +145370,7 @@ async function renderDocker(projectDir, outputPath, options) {
145166
145370
  docker: true,
145167
145371
  gpu: options.gpu,
145168
145372
  authoringSkill: options.authoringSkill,
145373
+ catalogUsage: options.catalogUsage,
145169
145374
  ...getMemorySnapshot()
145170
145375
  })
145171
145376
  );
@@ -145504,7 +145709,7 @@ function maybeConsumeDeParallelRouterTrial(routerActive, job, quiet) {
145504
145709
  const config = readConfigFresh();
145505
145710
  const renderCount = (config.deParallelRouterTrialRenderCount ?? 0) + 1;
145506
145711
  config.deParallelRouterTrialRenderCount = renderCount;
145507
- const fired = outcome === "reverted";
145712
+ const fired = outcome !== "routed";
145508
145713
  if (fired) {
145509
145714
  config.deParallelRouterTrialFired = true;
145510
145715
  deParallelRouterBreakerTrippedThisProcess = true;
@@ -145591,6 +145796,7 @@ function trackRenderMetrics(job, elapsedMs, options, docker) {
145591
145796
  docker,
145592
145797
  gpu: options.gpu,
145593
145798
  authoringSkill: options.authoringSkill,
145799
+ catalogUsage: options.catalogUsage,
145594
145800
  staticDedupEnabled: perf?.staticDedup?.enabled,
145595
145801
  staticDedupArmed: perf?.staticDedup?.armed,
145596
145802
  staticDedupSkipReason: perf?.staticDedup?.skipReason,
@@ -145971,7 +146177,7 @@ var init_render = __esm({
145971
146177
 
145972
146178
  // src/telemetry/lintStreaks.ts
145973
146179
  import { createHash as createHash23 } from "crypto";
145974
- import { mkdirSync as mkdirSync45, readFileSync as readFileSync59, writeFileSync as writeFileSync34 } from "fs";
146180
+ import { mkdirSync as mkdirSync45, readFileSync as readFileSync60, writeFileSync as writeFileSync34 } from "fs";
145975
146181
  import { homedir as homedir19 } from "os";
145976
146182
  import { join as join93 } from "path";
145977
146183
  function emptyState() {
@@ -145979,7 +146185,7 @@ function emptyState() {
145979
146185
  }
145980
146186
  function readState() {
145981
146187
  try {
145982
- const parsed = JSON.parse(readFileSync59(STATE_FILE2, "utf-8"));
146188
+ const parsed = JSON.parse(readFileSync60(STATE_FILE2, "utf-8"));
145983
146189
  if (typeof parsed === "object" && parsed !== null && parsed.version === 1 && typeof parsed.files === "object") {
145984
146190
  return parsed;
145985
146191
  }
@@ -146247,7 +146453,7 @@ __export(staticProjectServer_exports, {
146247
146453
  });
146248
146454
  import { createServer as createServer2 } from "http";
146249
146455
  import { createReadStream as createReadStream7, existsSync as existsSync85, statSync as statSync30 } from "fs";
146250
- import { isAbsolute as isAbsolute13, relative as relative20, resolve as resolve55 } from "path";
146456
+ import { isAbsolute as isAbsolute14, relative as relative21, resolve as resolve56 } from "path";
146251
146457
  function serveFileWithRange(filePath, rangeHeader, res, contentType = getMimeType(filePath)) {
146252
146458
  const size = statSync30(filePath).size;
146253
146459
  const headers = {
@@ -146347,9 +146553,9 @@ async function serveStaticProjectHtml(projectDir, html, bindErrorMessage = "Fail
146347
146553
  const proxyRequest = proxyParam !== null && isProxyVariantRequest(proxyParam) ? proxyParam : null;
146348
146554
  const requestPath = decodeURIComponent(pathOnly).replace(/^\//, "");
146349
146555
  for (const root of roots) {
146350
- const filePath = resolve55(root, requestPath);
146351
- const rel = relative20(root, filePath);
146352
- if (rel.startsWith("..") || isAbsolute13(rel)) continue;
146556
+ const filePath = resolve56(root, requestPath);
146557
+ const rel = relative21(root, filePath);
146558
+ if (rel.startsWith("..") || isAbsolute14(rel)) continue;
146353
146559
  if (existsSync85(filePath)) {
146354
146560
  if (proxyRequest) {
146355
146561
  void serveProxyRequest(
@@ -146814,7 +147020,7 @@ var init_motionAudit = __esm({
146814
147020
  });
146815
147021
 
146816
147022
  // src/utils/motionSpec.ts
146817
- import { existsSync as existsSync86, readFileSync as readFileSync60, readdirSync as readdirSync30 } from "fs";
147023
+ import { existsSync as existsSync86, readFileSync as readFileSync61, readdirSync as readdirSync30 } from "fs";
146818
147024
  import { basename as basename17, join as join94 } from "path";
146819
147025
  function isObject2(value) {
146820
147026
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -146876,7 +147082,7 @@ function findMotionSpec(projectDir) {
146876
147082
  function readMotionSpec(path2) {
146877
147083
  let raw;
146878
147084
  try {
146879
- raw = JSON.parse(readFileSync60(path2, "utf-8"));
147085
+ raw = JSON.parse(readFileSync61(path2, "utf-8"));
146880
147086
  } catch (err) {
146881
147087
  return { ok: false, errors: [`could not read ${basename17(path2)}: ${err.message}`] };
146882
147088
  }
@@ -146929,7 +147135,7 @@ __export(layout_exports, {
146929
147135
  loadBrowserScript: () => loadBrowserScript,
146930
147136
  parseAt: () => parseAt
146931
147137
  });
146932
- import { existsSync as existsSync87, readFileSync as readFileSync61 } from "fs";
147138
+ import { existsSync as existsSync87, readFileSync as readFileSync63 } from "fs";
146933
147139
  import { dirname as dirname42, join as join95 } from "path";
146934
147140
  import { fileURLToPath as fileURLToPath11 } from "url";
146935
147141
  function buildMotionSampleTimes(duration) {
@@ -147090,7 +147296,7 @@ async function runLayoutAudit(projectDir, opts) {
147090
147296
  function loadBrowserScript(name) {
147091
147297
  const candidates = [join95(__dirname2, name), join95(__dirname2, "commands", name)];
147092
147298
  for (const candidate of candidates) {
147093
- if (existsSync87(candidate)) return readFileSync61(candidate, "utf-8");
147299
+ if (existsSync87(candidate)) return readFileSync63(candidate, "utf-8");
147094
147300
  }
147095
147301
  throw new Error(`Missing browser script ${name}`);
147096
147302
  }
@@ -147487,7 +147693,7 @@ __export(validate_exports, {
147487
147693
  resolveNavigationTimeoutMs: () => resolveNavigationTimeoutMs,
147488
147694
  shouldIgnoreRequestFailure: () => shouldIgnoreRequestFailure
147489
147695
  });
147490
- import { existsSync as existsSync88, mkdtempSync as mkdtempSync14, readFileSync as readFileSync63, rmSync as rmSync29 } from "fs";
147696
+ import { existsSync as existsSync88, mkdtempSync as mkdtempSync14, readFileSync as readFileSync64, rmSync as rmSync29 } from "fs";
147491
147697
  import { tmpdir as tmpdir14 } from "os";
147492
147698
  import { join as join96, dirname as dirname43 } from "path";
147493
147699
  import { fileURLToPath as fileURLToPath12 } from "url";
@@ -147519,12 +147725,12 @@ async function getCompositionDuration3(page) {
147519
147725
  }
147520
147726
  function raceMediaReady(el, deadlineMs) {
147521
147727
  if (Number.isFinite(el.duration) && el.duration > 0) return Promise.resolve();
147522
- return new Promise((resolve78) => {
147728
+ return new Promise((resolve79) => {
147523
147729
  const onReady = () => {
147524
147730
  el.removeEventListener("loadedmetadata", onReady);
147525
147731
  el.removeEventListener("error", onReady);
147526
147732
  clearTimeout(timer);
147527
- resolve78();
147733
+ resolve79();
147528
147734
  };
147529
147735
  el.addEventListener("loadedmetadata", onReady, { once: true });
147530
147736
  el.addEventListener("error", onReady, { once: true });
@@ -147540,7 +147746,7 @@ async function auditClipDurations(page, analyzeClipMediaFit2, extraWaitMs) {
147540
147746
  await Promise.all(
147541
147747
  nodes.map((el) => {
147542
147748
  if (Number.isFinite(el.duration) && el.duration > 0) return Promise.resolve();
147543
- return new Promise((resolve78) => {
147749
+ return new Promise((resolve79) => {
147544
147750
  const cleanup = () => {
147545
147751
  el.removeEventListener("loadedmetadata", onReady);
147546
147752
  el.removeEventListener("error", onReady);
@@ -147548,7 +147754,7 @@ async function auditClipDurations(page, analyzeClipMediaFit2, extraWaitMs) {
147548
147754
  };
147549
147755
  const onReady = () => {
147550
147756
  cleanup();
147551
- resolve78();
147757
+ resolve79();
147552
147758
  };
147553
147759
  el.addEventListener("loadedmetadata", onReady, { once: true });
147554
147760
  el.addEventListener("error", onReady, { once: true });
@@ -147642,7 +147848,7 @@ function loadContrastAuditScript() {
147642
147848
  join96(__dirname3, "commands", "contrast-audit.browser.js")
147643
147849
  ];
147644
147850
  for (const candidate of candidates) {
147645
- if (existsSync88(candidate)) return readFileSync63(candidate, "utf-8");
147851
+ if (existsSync88(candidate)) return readFileSync64(candidate, "utf-8");
147646
147852
  }
147647
147853
  throw new Error("Missing contrast audit browser script");
147648
147854
  }
@@ -147973,7 +148179,7 @@ __export(checkBrowser_exports, {
147973
148179
  runBrowserCheck: () => runBrowserCheck
147974
148180
  });
147975
148181
  import { mkdirSync as mkdirSync46, writeFileSync as writeFileSync35 } from "fs";
147976
- import { join as join97, resolve as resolve56 } from "path";
148182
+ import { join as join97, resolve as resolve57 } from "path";
147977
148183
  async function preResolveHostileMediaProxies(projectDir, html, autoProxyOverride) {
147978
148184
  if (!resolveAutoProxy(projectDir, autoProxyOverride)) return;
147979
148185
  let codecMap;
@@ -147994,7 +148200,7 @@ async function preResolveHostileMediaProxies(projectDir, html, autoProxyOverride
147994
148200
  hostileEntries.map(
147995
148201
  ([pathname, facts]) => resolveProxy(
147996
148202
  projectDir,
147997
- resolve56(projectDir, pathname.replace(/^\/+/, "")),
148203
+ resolve57(projectDir, pathname.replace(/^\/+/, "")),
147998
148204
  proxyVariantFor(facts)
147999
148205
  )
148000
148206
  )
@@ -148891,7 +149097,7 @@ var init_checkBrowser = __esm({
148891
149097
 
148892
149098
  // src/utils/checkPipeline.ts
148893
149099
  import { mkdirSync as mkdirSync47, writeFileSync as writeFileSync36 } from "fs";
148894
- import { join as join98, relative as relative21 } from "path";
149100
+ import { join as join98, relative as relative23 } from "path";
148895
149101
  function selectContrastTimes(grid) {
148896
149102
  if (grid.length <= 5) return [...grid];
148897
149103
  return Array.from({ length: 5 }, (_, index) => {
@@ -149538,7 +149744,7 @@ async function runCheckPipeline(project, options, dependencies = DEFAULT_DEPENDE
149538
149744
  "motion_spec_invalid",
149539
149745
  "error",
149540
149746
  motion.message,
149541
- relative21(project.dir, motion.path) || "index.motion.json"
149747
+ relative23(project.dir, motion.path) || "index.motion.json"
149542
149748
  );
149543
149749
  return buildReport(options, lint, emptyBrowserResult(), motion, [finding], []);
149544
149750
  }
@@ -150443,7 +150649,7 @@ var init_beats = __esm({
150443
150649
  });
150444
150650
 
150445
150651
  // src/beats/headlessAnalyzer.ts
150446
- import { existsSync as existsSync89, readFileSync as readFileSync64 } from "fs";
150652
+ import { existsSync as existsSync89, readFileSync as readFileSync65 } from "fs";
150447
150653
  import { createRequire as createRequire4 } from "module";
150448
150654
  import { dirname as dirname44, join as join99 } from "path";
150449
150655
  import { fileURLToPath as fileURLToPath13 } from "url";
@@ -150486,7 +150692,7 @@ function buildAnalyzerBundle() {
150486
150692
  if (bundlePromise) return bundlePromise;
150487
150693
  bundlePromise = (async () => {
150488
150694
  const prebuilt = findPrebuiltBundle();
150489
- if (prebuilt) return readFileSync64(prebuilt, "utf8");
150695
+ if (prebuilt) return readFileSync65(prebuilt, "utf8");
150490
150696
  return buildFromCoreSource();
150491
150697
  })().catch((err) => {
150492
150698
  bundlePromise = null;
@@ -150564,14 +150770,14 @@ __export(beats_exports, {
150564
150770
  default: () => beats_default,
150565
150771
  examples: () => examples13
150566
150772
  });
150567
- import { existsSync as existsSync90, readFileSync as readFileSync65, mkdirSync as mkdirSync48, writeFileSync as writeFileSync37 } from "fs";
150568
- import { resolve as resolve57, join as join100, dirname as dirname45 } from "path";
150773
+ import { existsSync as existsSync90, readFileSync as readFileSync66, mkdirSync as mkdirSync48, writeFileSync as writeFileSync37 } from "fs";
150774
+ import { resolve as resolve58, join as join100, dirname as dirname45 } from "path";
150569
150775
  function fail(message) {
150570
150776
  console.error(c.error(message));
150571
150777
  failCommand();
150572
150778
  }
150573
150779
  function resolveMusicTarget(project) {
150574
- const src = findMusicAudioSrc(readFileSync65(project.indexPath, "utf-8"));
150780
+ const src = findMusicAudioSrc(readFileSync66(project.indexPath, "utf-8"));
150575
150781
  if (!src) {
150576
150782
  fail(
150577
150783
  'No music track found. Add data-timeline-role="music" to the <audio> element (or give it an id like music/bgm/soundtrack).'
@@ -150579,13 +150785,13 @@ function resolveMusicTarget(project) {
150579
150785
  }
150580
150786
  const rel = audioRelPathForSrc(src);
150581
150787
  if (!rel) fail(`Cannot derive a beat-file path for music src: ${src}`);
150582
- const audioPath = resolve57(project.dir, rel);
150788
+ const audioPath = resolve58(project.dir, rel);
150583
150789
  if (!existsSync90(audioPath)) fail(`Audio file not found: ${rel}`);
150584
150790
  return { rel, audioPath };
150585
150791
  }
150586
150792
  async function detect(audioPath) {
150587
150793
  try {
150588
- return await analyzeBeatsHeadless(readFileSync65(audioPath));
150794
+ return await analyzeBeatsHeadless(readFileSync66(audioPath));
150589
150795
  } catch (err) {
150590
150796
  const msg = err instanceof Error ? err.message : String(err);
150591
150797
  const hint2 = /chrome|executable|browser|ENOENT/i.test(msg) ? "\nRun: npx hyperframes browser ensure" : "";
@@ -150658,8 +150864,8 @@ __export(normalize_audio_exports, {
150658
150864
  updateAudioVolume: () => updateAudioVolume
150659
150865
  });
150660
150866
  import { execFile as execFile8 } from "child_process";
150661
- import { existsSync as existsSync91, readFileSync as readFileSync66, renameSync as renameSync15, writeFileSync as writeFileSync38 } from "fs";
150662
- import { isAbsolute as isAbsolute14, relative as relative23, resolve as resolve58 } from "path";
150867
+ import { existsSync as existsSync91, readFileSync as readFileSync67, renameSync as renameSync15, writeFileSync as writeFileSync38 } from "fs";
150868
+ import { isAbsolute as isAbsolute15, relative as relative24, resolve as resolve59 } from "path";
150663
150869
  import { promisify as promisify6 } from "util";
150664
150870
  function authoredNumber(raw, fallback, attribute2, id, strictlyPositive = false) {
150665
150871
  if (raw === void 0) return fallback;
@@ -150822,12 +151028,12 @@ function resolveLocalAudioPath(projectDir, src) {
150822
151028
  } catch {
150823
151029
  throw new Error(`Audio source must be a local project file: ${src}`);
150824
151030
  }
150825
- if (!decoded || isAbsolute14(decoded) || /^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(decoded)) {
151031
+ if (!decoded || isAbsolute15(decoded) || /^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(decoded)) {
150826
151032
  throw new Error(`Audio source must be a local project file: ${src}`);
150827
151033
  }
150828
- const root = resolve58(projectDir);
150829
- const file = resolve58(root, decoded);
150830
- const rel = relative23(root, file);
151034
+ const root = resolve59(projectDir);
151035
+ const file = resolve59(root, decoded);
151036
+ const rel = relative24(root, file);
150831
151037
  if (!rel || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
150832
151038
  throw new Error(`Audio source must be a local project file: ${src}`);
150833
151039
  }
@@ -150944,7 +151150,7 @@ function requiredFfmpeg() {
150944
151150
  function existingAudioFile(projectDir, tag) {
150945
151151
  const file = resolveLocalAudioPath(projectDir, tag.src);
150946
151152
  if (!existsSync91(file)) {
150947
- throw new Error(`Audio #${tag.id} file was not found: ${relative23(projectDir, file)}`);
151153
+ throw new Error(`Audio #${tag.id} file was not found: ${relative24(projectDir, file)}`);
150948
151154
  }
150949
151155
  return file;
150950
151156
  }
@@ -150975,7 +151181,7 @@ function parsedTolerance(raw) {
150975
151181
  }
150976
151182
  async function normalizeAudio(options) {
150977
151183
  const project = resolveProject(options.dir);
150978
- const html = readFileSync66(project.indexPath, "utf8");
151184
+ const html = readFileSync67(project.indexPath, "utf8");
150979
151185
  const { referenceTag, targetTag } = selectedTags(html, options.reference, options.target);
150980
151186
  const tolerance = parsedTolerance(options.tolerance);
150981
151187
  const plan2 = await measuredPlan(project.dir, referenceTag, targetTag);
@@ -150984,7 +151190,7 @@ async function normalizeAudio(options) {
150984
151190
  if (wrote) {
150985
151191
  writeAtomically(
150986
151192
  project.indexPath,
150987
- updateAudioVolume(readFileSync66(project.indexPath, "utf8"), targetTag.id, plan2.volume)
151193
+ updateAudioVolume(readFileSync67(project.indexPath, "utf8"), targetTag.id, plan2.volume)
150988
151194
  );
150989
151195
  }
150990
151196
  return { ok: true, wrote, withinTolerance, tolerance, indexPath: project.indexPath, ...plan2 };
@@ -151003,7 +151209,7 @@ function printHumanResult(result) {
151003
151209
  `Set #${result.targetId} data-volume ${result.previousVolume.toFixed(3)} \u2192 ${result.volume.toFixed(6)} (${result.changeDb >= 0 ? "+" : ""}${result.changeDb.toFixed(1)} dB).`
151004
151210
  );
151005
151211
  console.log(
151006
- result.wrote ? c.success(`Updated ${relative23(process.cwd(), result.indexPath) || "index.html"}.`) : c.dim("Dry run only. Pass --write to persist this gain.")
151212
+ result.wrote ? c.success(`Updated ${relative24(process.cwd(), result.indexPath) || "index.html"}.`) : c.dim("Dry run only. Pass --write to persist this gain.")
151007
151213
  );
151008
151214
  }
151009
151215
  var execFileAsync4, FFMPEG_TIMEOUT_MS, DEFAULT_TOLERANCE_LU, examples14, normalize_audio_default;
@@ -151484,14 +151690,14 @@ function inlineHelper3(call, ctx) {
151484
151690
  };
151485
151691
  return expandBody3(fn.body.body, bindings, prov, ctx);
151486
151692
  }
151487
- function assignStep3(update2, resolve78) {
151488
- if (update2.operator === "+=") return asNum3(resolve78(update2.right));
151693
+ function assignStep3(update2, resolve79) {
151694
+ if (update2.operator === "+=") return asNum3(resolve79(update2.right));
151489
151695
  if (update2.operator === "-=") {
151490
- const s2 = asNum3(resolve78(update2.right));
151696
+ const s2 = asNum3(resolve79(update2.right));
151491
151697
  return s2 === void 0 ? void 0 : -s2;
151492
151698
  }
151493
151699
  if (update2.operator === "=" && update2.right?.type === "BinaryExpression") {
151494
- return asNum3(resolve78(update2.right.right));
151700
+ return asNum3(resolve79(update2.right.right));
151495
151701
  }
151496
151702
  return void 0;
151497
151703
  }
@@ -151500,10 +151706,10 @@ function updatedVarName3(update2) {
151500
151706
  if (update2?.type === "AssignmentExpression") return update2.left?.name ?? null;
151501
151707
  return null;
151502
151708
  }
151503
- function loopStep3(update2, varName, resolve78) {
151709
+ function loopStep3(update2, varName, resolve79) {
151504
151710
  if (updatedVarName3(update2) !== varName) return void 0;
151505
151711
  if (update2.type === "UpdateExpression") return update2.operator === "++" ? 1 : -1;
151506
- return assignStep3(update2, resolve78);
151712
+ return assignStep3(update2, resolve79);
151507
151713
  }
151508
151714
  function asNum3(v2) {
151509
151715
  return typeof v2 === "number" && Number.isFinite(v2) ? v2 : void 0;
@@ -151520,13 +151726,13 @@ function forInitVar3(init) {
151520
151726
  const d2 = init.declarations[0];
151521
151727
  return d2.id?.type === "Identifier" ? { name: d2.id.name, initExpr: d2.init } : null;
151522
151728
  }
151523
- function parseForHeader3(stmt, resolve78) {
151729
+ function parseForHeader3(stmt, resolve79) {
151524
151730
  const iv = forInitVar3(stmt.init);
151525
151731
  const test = stmt.test;
151526
151732
  if (!iv || test?.type !== "BinaryExpression" || test.left?.name !== iv.name) return null;
151527
- const start = asNum3(resolve78(iv.initExpr));
151528
- const end = asNum3(resolve78(test.right));
151529
- const step = loopStep3(stmt.update, iv.name, resolve78);
151733
+ const start = asNum3(resolve79(iv.initExpr));
151734
+ const end = asNum3(resolve79(test.right));
151735
+ const step = loopStep3(stmt.update, iv.name, resolve79);
151530
151736
  if (start === void 0 || end === void 0 || !step) return null;
151531
151737
  return { v: iv.name, start, end, op: test.operator, step };
151532
151738
  }
@@ -151638,12 +151844,12 @@ function expandStatements3(stmts, ctx) {
151638
151844
  }
151639
151845
  return out;
151640
151846
  }
151641
- function inlineComputedTimelines3(ast, timelineVar, resolve78) {
151847
+ function inlineComputedTimelines3(ast, timelineVar, resolve79) {
151642
151848
  const helpers = collectInlinableHelpers3(ast, timelineVar);
151643
151849
  const ctx = {
151644
151850
  helpers,
151645
151851
  timelineVar,
151646
- resolve: resolve78,
151852
+ resolve: resolve79,
151647
151853
  depth: 0,
151648
151854
  site: { n: 0 },
151649
151855
  order: { n: 0 }
@@ -153054,13 +153260,13 @@ function applyOrbitCamera(selectors, cam) {
153054
153260
  lens.style.perspectiveOrigin = "50% 50%";
153055
153261
  }
153056
153262
  function compositeGhostFrames(frames, alphas, W2, H3, label2) {
153057
- return new Promise((resolve78) => {
153263
+ return new Promise((resolve79) => {
153058
153264
  const cv = document.createElement("canvas");
153059
153265
  cv.width = W2;
153060
153266
  cv.height = H3;
153061
153267
  const ctx = cv.getContext("2d");
153062
153268
  if (!ctx) {
153063
- resolve78("");
153269
+ resolve79("");
153064
153270
  return;
153065
153271
  }
153066
153272
  ctx.fillStyle = "#000";
@@ -153072,7 +153278,7 @@ function compositeGhostFrames(frames, alphas, W2, H3, label2) {
153072
153278
  ctx.font = "600 22px ui-monospace, SFMono-Regular, Menlo, monospace";
153073
153279
  ctx.fillStyle = "#86c2ff";
153074
153280
  ctx.fillText(label2, 24, 38);
153075
- resolve78(cv.toDataURL("image/png"));
153281
+ resolve79(cv.toDataURL("image/png"));
153076
153282
  return;
153077
153283
  }
153078
153284
  const img = new Image();
@@ -153495,8 +153701,8 @@ __export(keyframes_exports, {
153495
153701
  resolveScope: () => resolveScope,
153496
153702
  surfaceComposition: () => surfaceComposition
153497
153703
  });
153498
- import { existsSync as existsSync93, readFileSync as readFileSync67, statSync as statSync31 } from "fs";
153499
- import { resolve as resolve59, dirname as dirname47, basename as basename18, join as join101, relative as relative24, sep as sep13 } from "path";
153704
+ import { existsSync as existsSync93, readFileSync as readFileSync68, statSync as statSync31 } from "fs";
153705
+ import { resolve as resolve60, dirname as dirname47, basename as basename18, join as join101, relative as relative25, sep as sep13 } from "path";
153500
153706
  function queryIncludingTemplates(html, selector) {
153501
153707
  const doc = new DOMParser().parseFromString(html, "text/html");
153502
153708
  const roots = [doc];
@@ -153857,7 +154063,7 @@ function groupTraces(tweens) {
153857
154063
  return traces;
153858
154064
  }
153859
154065
  function collectCompositions(indexPath2) {
153860
- const html = readFileSync67(indexPath2, "utf-8");
154066
+ const html = readFileSync68(indexPath2, "utf-8");
153861
154067
  const baseDir = dirname47(indexPath2);
153862
154068
  const out = [
153863
154069
  surfaceComposition(html, basename18(indexPath2), basename18(indexPath2))
@@ -153866,10 +154072,10 @@ function collectCompositions(indexPath2) {
153866
154072
  for (const div of Array.from(doc.querySelectorAll("[data-composition-src]"))) {
153867
154073
  const src = div.getAttribute("data-composition-src");
153868
154074
  if (!src) continue;
153869
- const subPath = resolve59(baseDir, src);
154075
+ const subPath = resolve60(baseDir, src);
153870
154076
  if (!existsSync93(subPath)) continue;
153871
154077
  const id = div.getAttribute("data-composition-id") ?? src;
153872
- out.push(surfaceComposition(readFileSync67(subPath, "utf-8"), id, src));
154078
+ out.push(surfaceComposition(readFileSync68(subPath, "utf-8"), id, src));
153873
154079
  }
153874
154080
  return out;
153875
154081
  }
@@ -153973,7 +154179,7 @@ async function runOnionShot(comps, allComps, projectDir, entryFile, args) {
153973
154179
  console.log(c.dim(guardError));
153974
154180
  return true;
153975
154181
  }
153976
- const saved = await captureMotionPathShot2(projectDir, requests, resolve59(args.shot), {
154182
+ const saved = await captureMotionPathShot2(projectDir, requests, resolve60(args.shot), {
153977
154183
  ...onionShotOptions(args),
153978
154184
  entryFile
153979
154185
  });
@@ -153987,11 +154193,11 @@ function resolveScope(args) {
153987
154193
  let projectDir;
153988
154194
  let entryFile;
153989
154195
  if (raw && raw.endsWith(".html") && existsSync93(raw) && statSync31(raw).isFile()) {
153990
- const entryPath = resolve59(raw);
153991
- comps = [surfaceComposition(readFileSync67(entryPath, "utf-8"), basename18(entryPath), entryPath)];
154196
+ const entryPath = resolve60(raw);
154197
+ comps = [surfaceComposition(readFileSync68(entryPath, "utf-8"), basename18(entryPath), entryPath)];
153992
154198
  projectName = basename18(entryPath);
153993
154199
  projectDir = findProjectRoot(entryPath);
153994
- entryFile = relative24(projectDir, entryPath).split(sep13).join("/");
154200
+ entryFile = relative25(projectDir, entryPath).split(sep13).join("/");
153995
154201
  } else {
153996
154202
  const project = resolveProject(raw);
153997
154203
  comps = collectCompositions(project.indexPath);
@@ -154209,7 +154415,7 @@ __export(info_exports, {
154209
154415
  examples: () => examples17,
154210
154416
  orientation: () => orientation
154211
154417
  });
154212
- import { readFileSync as readFileSync68, readdirSync as readdirSync31, statSync as statSync33 } from "fs";
154418
+ import { readFileSync as readFileSync69, readdirSync as readdirSync31, statSync as statSync33 } from "fs";
154213
154419
  import { join as join103 } from "path";
154214
154420
  function orientation(width, height) {
154215
154421
  if (width > height) return "landscape";
@@ -154256,7 +154462,7 @@ var init_info = __esm({
154256
154462
  },
154257
154463
  async run({ args }) {
154258
154464
  const project = resolveProject(args.dir);
154259
- const html = readFileSync68(project.indexPath, "utf-8");
154465
+ const html = readFileSync69(project.indexPath, "utf-8");
154260
154466
  ensureDOMParser();
154261
154467
  const parsed = parseHtml(html);
154262
154468
  const tracks = new Set(parsed.elements.map((el) => el.zIndex));
@@ -154316,8 +154522,8 @@ __export(compositions_exports, {
154316
154522
  parseCompositions: () => parseCompositions,
154317
154523
  parseSubComposition: () => parseSubComposition
154318
154524
  });
154319
- import { existsSync as existsSync94, readFileSync as readFileSync69 } from "fs";
154320
- import { resolve as resolve60, dirname as dirname48 } from "path";
154525
+ import { existsSync as existsSync94, readFileSync as readFileSync70 } from "fs";
154526
+ import { resolve as resolve61, dirname as dirname48 } from "path";
154321
154527
  function countRenderableDescendants(root) {
154322
154528
  return Array.from(root.querySelectorAll("*")).filter(
154323
154529
  (el) => !NON_RENDERED_TAGS2.has(el.tagName.toLowerCase())
@@ -154395,9 +154601,9 @@ function parseCompositions(html, baseDir) {
154395
154601
  const height = parseInt(div.getAttribute("data-height") ?? "1080", 10);
154396
154602
  const compositionSrc = div.getAttribute("data-composition-src");
154397
154603
  if (compositionSrc) {
154398
- const subPath = resolve60(baseDir, compositionSrc);
154604
+ const subPath = resolve61(baseDir, compositionSrc);
154399
154605
  if (existsSync94(subPath)) {
154400
- const subHtml = readFileSync69(subPath, "utf-8");
154606
+ const subHtml = readFileSync70(subPath, "utf-8");
154401
154607
  const subInfo = parseSubComposition(subHtml, id, width, height);
154402
154608
  compositions.push({ ...subInfo, source: compositionSrc });
154403
154609
  return;
@@ -154503,7 +154709,7 @@ var init_compositions = __esm({
154503
154709
  },
154504
154710
  async run({ args }) {
154505
154711
  const project = resolveProject(args.dir);
154506
- const html = readFileSync69(project.indexPath, "utf-8");
154712
+ const html = readFileSync70(project.indexPath, "utf-8");
154507
154713
  ensureDOMParser();
154508
154714
  const compositions = parseCompositions(html, dirname48(project.indexPath));
154509
154715
  if (args.json) {
@@ -154542,7 +154748,7 @@ __export(benchmark_exports, {
154542
154748
  examples: () => examples19
154543
154749
  });
154544
154750
  import { existsSync as existsSync95, statSync as statSync34 } from "fs";
154545
- import { resolve as resolve61, join as join104 } from "path";
154751
+ import { resolve as resolve62, join as join104 } from "path";
154546
154752
  var examples19, FPS_30, FPS_60, DEFAULT_CONFIGS, benchmark_default;
154547
154753
  var init_benchmark = __esm({
154548
154754
  "src/commands/benchmark.ts"() {
@@ -154588,7 +154794,7 @@ var init_benchmark = __esm({
154588
154794
  failCommand();
154589
154795
  }
154590
154796
  const jsonOutput = args.json ?? false;
154591
- const benchDir = resolve61("renders", ".benchmark");
154797
+ const benchDir = resolve62("renders", ".benchmark");
154592
154798
  let producer = null;
154593
154799
  try {
154594
154800
  producer = await loadProducer();
@@ -154909,7 +155115,7 @@ __export(remove_background_exports, {
154909
155115
  default: () => remove_background_default,
154910
155116
  examples: () => examples21
154911
155117
  });
154912
- import { resolve as resolve62 } from "path";
155118
+ import { resolve as resolve63 } from "path";
154913
155119
  import { existsSync as existsSync96 } from "fs";
154914
155120
  async function showInfo(json) {
154915
155121
  const { selectProviders: selectProviders2, listAvailableProviders: listAvailableProviders2, DEFAULT_MODEL: DEFAULT_MODEL5, MODEL_MEMORY_MB: MODEL_MEMORY_MB2, modelPath: modelPath2 } = await Promise.resolve().then(() => (init_manager3(), manager_exports3));
@@ -155053,10 +155259,10 @@ var init_remove_background = __esm({
155053
155259
  );
155054
155260
  failCommand();
155055
155261
  }
155056
- const inputPath = resolve62(args.input);
155057
- const outputPath = resolve62(args.output);
155262
+ const inputPath = resolve63(args.input);
155263
+ const outputPath = resolve63(args.output);
155058
155264
  const backgroundOutputArg = args["background-output"];
155059
- const backgroundOutputPath = backgroundOutputArg ? resolve62(backgroundOutputArg) : void 0;
155265
+ const backgroundOutputPath = backgroundOutputArg ? resolve63(backgroundOutputArg) : void 0;
155060
155266
  const { render: render3 } = await Promise.resolve().then(() => (init_pipeline(), pipeline_exports));
155061
155267
  const spin = args.json ? null : ft();
155062
155268
  spin?.start("Preparing background-removal pipeline...");
@@ -155121,7 +155327,7 @@ var init_remove_background = __esm({
155121
155327
 
155122
155328
  // src/whisper/parakeet.ts
155123
155329
  import { execFileSync as execFileSync13 } from "child_process";
155124
- import { existsSync as existsSync97, mkdtempSync as mkdtempSync15, readFileSync as readFileSync70, rmSync as rmSync30, writeFileSync as writeFileSync40 } from "fs";
155330
+ import { existsSync as existsSync97, mkdtempSync as mkdtempSync15, readFileSync as readFileSync71, rmSync as rmSync30, writeFileSync as writeFileSync40 } from "fs";
155125
155331
  import { homedir as homedir20, tmpdir as tmpdir15 } from "os";
155126
155332
  import { basename as basename19, extname as extname16, join as join105 } from "path";
155127
155333
  function isRunnable(bin) {
@@ -155198,7 +155404,7 @@ function transcribeWithParakeet(inputPath, dir, options) {
155198
155404
  execFileSync13(runner, argv2, { stdio: ["ignore", "pipe", "pipe"], timeout: 18e5 });
155199
155405
  const produced = join105(workDir, `${basename19(inputPath, extname16(inputPath))}.json`);
155200
155406
  if (!existsSync97(produced)) throw new Error("Parakeet did not produce output.");
155201
- const words = mergeTokensToWords(JSON.parse(readFileSync70(produced, "utf-8")));
155407
+ const words = mergeTokensToWords(JSON.parse(readFileSync71(produced, "utf-8")));
155202
155408
  const transcriptPath = join105(dir, "transcript.json");
155203
155409
  writeFileSync40(transcriptPath, JSON.stringify(words, null, 2));
155204
155410
  const durationSeconds = words.length > 0 ? words[words.length - 1].end : 0;
@@ -155223,7 +155429,7 @@ __export(transcribe_exports2, {
155223
155429
  examples: () => examples22
155224
155430
  });
155225
155431
  import { existsSync as existsSync98, writeFileSync as writeFileSync41 } from "fs";
155226
- import { resolve as resolve63, join as join106, extname as extname17, dirname as dirname49 } from "path";
155432
+ import { resolve as resolve64, join as join106, extname as extname17, dirname as dirname49 } from "path";
155227
155433
  function parseTimeoutMs(raw, json) {
155228
155434
  const source = raw ?? process.env["HYPERFRAMES_TRANSCRIBE_TIMEOUT_MS"];
155229
155435
  if (source == null || source === "") return void 0;
@@ -155277,7 +155483,7 @@ async function exportTranscript(inputPath, dir, to, output, json, preserveCues)
155277
155483
  const { words, format } = loadTranscript2(inputPath);
155278
155484
  if (words.length === 0) exitNoWords(json);
155279
155485
  const preGrouped = preserveCues || format === "srt" || format === "vtt" || void 0;
155280
- const outPath = resolve63(output ?? join106(dir, `transcript.${to}`));
155486
+ const outPath = resolve64(output ?? join106(dir, `transcript.${to}`));
155281
155487
  const content = to === "srt" ? formatSrt2(words, { preGrouped }) : formatVtt2(words, { preGrouped });
155282
155488
  writeFileSync41(outPath, content);
155283
155489
  if (json) {
@@ -155460,14 +155666,14 @@ var init_transcribe2 = __esm({
155460
155666
  }
155461
155667
  },
155462
155668
  async run({ args }) {
155463
- const inputPath = resolve63(args.input);
155669
+ const inputPath = resolve64(args.input);
155464
155670
  if (!existsSync98(inputPath)) {
155465
155671
  const message = `File not found: ${args.input}`;
155466
155672
  trackCommandFailure("transcribe", message);
155467
155673
  console.error(c.error(message));
155468
155674
  failCommand();
155469
155675
  }
155470
- const dir = resolve63(args.dir ?? dirname49(inputPath));
155676
+ const dir = resolve64(args.dir ?? dirname49(inputPath));
155471
155677
  const ext = extname17(inputPath).toLowerCase();
155472
155678
  const isImport = ext === ".json" || ext === ".srt" || ext === ".vtt";
155473
155679
  const to = parseExportFormat(args.to, args.json);
@@ -155810,8 +156016,8 @@ __export(tts_exports, {
155810
156016
  default: () => tts_default,
155811
156017
  examples: () => examples23
155812
156018
  });
155813
- import { existsSync as existsSync101, readFileSync as readFileSync71 } from "fs";
155814
- import { resolve as resolve64, extname as extname18 } from "path";
156019
+ import { existsSync as existsSync101, readFileSync as readFileSync73 } from "fs";
156020
+ import { resolve as resolve65, extname as extname18 } from "path";
155815
156021
  function listVoices(json) {
155816
156022
  const rows = BUNDLED_VOICES.map((v2) => ({ ...v2, defaultLang: inferLangFromVoiceId(v2.id) }));
155817
156023
  if (json) {
@@ -155926,9 +156132,9 @@ var init_tts = __esm({
155926
156132
  failCommand();
155927
156133
  }
155928
156134
  let text2;
155929
- const maybeFile = resolve64(input2);
156135
+ const maybeFile = resolve65(input2);
155930
156136
  if (existsSync101(maybeFile) && extname18(maybeFile).toLowerCase() === ".txt") {
155931
- text2 = readFileSync71(maybeFile, "utf-8").trim();
156137
+ text2 = readFileSync73(maybeFile, "utf-8").trim();
155932
156138
  if (!text2) {
155933
156139
  console.error(c.error("File is empty."));
155934
156140
  failCommand();
@@ -155940,7 +156146,7 @@ var init_tts = __esm({
155940
156146
  console.error(c.error("No text provided."));
155941
156147
  failCommand();
155942
156148
  }
155943
- const output = resolve64(args.output ?? "speech.wav");
156149
+ const output = resolve65(args.output ?? "speech.wav");
155944
156150
  const voice = args.voice ?? DEFAULT_VOICE;
155945
156151
  const speed = args.speed ? parseFloat(args.speed) : 1;
155946
156152
  if (isNaN(speed) || speed <= 0 || speed > 3) {
@@ -156020,14 +156226,14 @@ __export(docs_exports, {
156020
156226
  default: () => docs_default,
156021
156227
  examples: () => examples24
156022
156228
  });
156023
- import { readFileSync as readFileSync73, existsSync as existsSync103 } from "fs";
156024
- import { resolve as resolve65, dirname as dirname51, join as join109 } from "path";
156229
+ import { readFileSync as readFileSync74, existsSync as existsSync103 } from "fs";
156230
+ import { resolve as resolve66, dirname as dirname51, join as join109 } from "path";
156025
156231
  import { fileURLToPath as fileURLToPath14 } from "url";
156026
156232
  function docsDir() {
156027
156233
  const thisFile = fileURLToPath14(import.meta.url);
156028
156234
  const dir = dirname51(thisFile);
156029
- const devPath = resolve65(dir, "..", "docs");
156030
- const builtPath = resolve65(dir, "docs");
156235
+ const devPath = resolve66(dir, "..", "docs");
156236
+ const builtPath = resolve66(dir, "docs");
156031
156237
  return existsSync103(devPath) ? devPath : builtPath;
156032
156238
  }
156033
156239
  function formatInlineCode(line2) {
@@ -156131,7 +156337,7 @@ var init_docs = __esm({
156131
156337
  console.error(c.error(`Doc file not found: ${filePath}`));
156132
156338
  failCommand();
156133
156339
  }
156134
- const content = readFileSync73(filePath, "utf-8");
156340
+ const content = readFileSync74(filePath, "utf-8");
156135
156341
  console.log();
156136
156342
  renderMarkdown(content);
156137
156343
  }
@@ -156529,8 +156735,8 @@ __export(upgrade_exports, {
156529
156735
  upgradeProjectPins: () => upgradeProjectPins
156530
156736
  });
156531
156737
  import { execFileSync as execFileSync17 } from "child_process";
156532
- import { existsSync as existsSync105, readFileSync as readFileSync74, writeFileSync as writeFileSync44, renameSync as renameSync16 } from "fs";
156533
- import { resolve as resolve66 } from "path";
156738
+ import { existsSync as existsSync105, readFileSync as readFileSync75, writeFileSync as writeFileSync44, renameSync as renameSync16 } from "fs";
156739
+ import { resolve as resolve67 } from "path";
156534
156740
  async function confirmUpgrade() {
156535
156741
  const shouldUpgrade = await ue({ message: "Upgrade now?" });
156536
156742
  return !q(shouldUpgrade) && shouldUpgrade === true;
@@ -156588,11 +156794,11 @@ function resolveProjectArgs(project, opts) {
156588
156794
  return { dir: project, check: opts.check, json: opts.json };
156589
156795
  }
156590
156796
  async function upgradeProjectPins(dir, opts) {
156591
- const pkgPath = resolve66(dir, "package.json");
156797
+ const pkgPath = resolve67(dir, "package.json");
156592
156798
  if (!existsSync105(pkgPath)) {
156593
156799
  return { changed: false, from: [], to: "", path: pkgPath };
156594
156800
  }
156595
- const raw = JSON.parse(readFileSync74(pkgPath, "utf-8"));
156801
+ const raw = JSON.parse(readFileSync75(pkgPath, "utf-8"));
156596
156802
  const scripts = raw.scripts ?? {};
156597
156803
  const { latest } = await checkForUpdate(true);
156598
156804
  if (!isSafeVersion(latest)) return { changed: false, from: [], to: latest, path: pkgPath };
@@ -156670,7 +156876,7 @@ var init_upgrade = __esm({
156670
156876
  const checkOnly = args.check === true;
156671
156877
  if (args.project !== void 0) {
156672
156878
  const p2 = resolveProjectArgs(args.project, { check: checkOnly, json: useJson });
156673
- const res = await upgradeProjectPins(resolve66(p2.dir), { json: p2.json, check: p2.check });
156879
+ const res = await upgradeProjectPins(resolve67(p2.dir), { json: p2.json, check: p2.check });
156674
156880
  if (p2.json) {
156675
156881
  console.log(JSON.stringify(withMeta(res), null, 2));
156676
156882
  return;
@@ -156869,7 +157075,7 @@ __export(feedback_exports, {
156869
157075
  examples: () => examples27
156870
157076
  });
156871
157077
  import { randomUUID as randomUUID12 } from "crypto";
156872
- import { resolve as resolve67 } from "path";
157078
+ import { resolve as resolve68 } from "path";
156873
157079
  import open from "open";
156874
157080
  function normalizeComment(raw) {
156875
157081
  return raw || void 0;
@@ -156942,7 +157148,7 @@ async function openAndPrintIssue(url) {
156942
157148
  console.log();
156943
157149
  }
156944
157150
  async function fileGithubIssue(opts) {
156945
- const dir = resolve67(opts.rawDir ?? ".");
157151
+ const dir = resolve68(opts.rawDir ?? ".");
156946
157152
  if (!await confirmFileIssue(dir, opts.yes)) return;
156947
157153
  const repoPublicUrl = await publishRepro(dir);
156948
157154
  const url = buildIssueUrl({
@@ -157278,7 +157484,7 @@ __export(contactSheet_exports, {
157278
157484
  createSvgContactSheet: () => createSvgContactSheet
157279
157485
  });
157280
157486
  import sharp from "sharp";
157281
- import { readdirSync as readdirSync34, readFileSync as readFileSync75, writeFileSync as writeFileSync45, unlinkSync as unlinkSync10, existsSync as existsSync106 } from "fs";
157487
+ import { readdirSync as readdirSync34, readFileSync as readFileSync76, writeFileSync as writeFileSync45, unlinkSync as unlinkSync10, existsSync as existsSync106 } from "fs";
157282
157488
  import { join as join110, extname as extname19, basename as basename21, dirname as dirname53 } from "path";
157283
157489
  async function createContactSheet(imagePaths, outputPath, opts = {}) {
157284
157490
  const {
@@ -157438,7 +157644,7 @@ async function createSvgContactSheet(svgsDir, outputPath, assetsRootDir, budget
157438
157644
  const svgPath = svgPaths[i2];
157439
157645
  const tmpPath = join110(tmpDir, `.thumb-${i2}.png`);
157440
157646
  try {
157441
- const svgBuf = readFileSync75(svgPath);
157647
+ const svgBuf = readFileSync76(svgPath);
157442
157648
  const thumb = await sharp(svgBuf).resize(thumbSize, thumbSize, {
157443
157649
  fit: "contain",
157444
157650
  background: { r: 245, g: 245, b: 245, alpha: 1 }
@@ -157747,7 +157953,7 @@ var require_p_retry = __commonJS({
157747
157953
  return error;
157748
157954
  };
157749
157955
  var isNetworkError = (errorMessage2) => networkErrorMsgs.includes(errorMessage2);
157750
- var pRetry2 = (input2, options) => new Promise((resolve78, reject2) => {
157956
+ var pRetry2 = (input2, options) => new Promise((resolve79, reject2) => {
157751
157957
  options = {
157752
157958
  onFailedAttempt: () => {
157753
157959
  },
@@ -157757,7 +157963,7 @@ var require_p_retry = __commonJS({
157757
157963
  const operation = retry.operation(options);
157758
157964
  operation.attempt(async (attemptNumber) => {
157759
157965
  try {
157760
- resolve78(await input2(attemptNumber));
157966
+ resolve79(await input2(attemptNumber));
157761
157967
  } catch (error) {
157762
157968
  if (!(error instanceof Error)) {
157763
157969
  reject2(new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`));
@@ -158293,8 +158499,8 @@ var require_retry3 = __commonJS({
158293
158499
  }
158294
158500
  const delay2 = getNextRetryDelay(config);
158295
158501
  err.config.retryConfig.currentRetryAttempt += 1;
158296
- const backoff = config.retryBackoff ? config.retryBackoff(err, delay2) : new Promise((resolve78) => {
158297
- setTimeout(resolve78, delay2);
158502
+ const backoff = config.retryBackoff ? config.retryBackoff(err, delay2) : new Promise((resolve79) => {
158503
+ setTimeout(resolve79, delay2);
158298
158504
  });
158299
158505
  if (config.onRetryAttempt) {
158300
158506
  await config.onRetryAttempt(err);
@@ -158422,8 +158628,8 @@ var require_helpers = __commonJS({
158422
158628
  function req(url, opts = {}) {
158423
158629
  const href = typeof url === "string" ? url : url.href;
158424
158630
  const req2 = (href.startsWith("https:") ? https2 : http4).request(url, opts);
158425
- const promise = new Promise((resolve78, reject2) => {
158426
- req2.once("response", resolve78).once("error", reject2).end();
158631
+ const promise = new Promise((resolve79, reject2) => {
158632
+ req2.once("response", resolve79).once("error", reject2).end();
158427
158633
  });
158428
158634
  req2.then = promise.then.bind(promise);
158429
158635
  return req2;
@@ -158600,7 +158806,7 @@ var require_parse_proxy_response = __commonJS({
158600
158806
  var debug_1 = __importDefault2(__require("debug"));
158601
158807
  var debug = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
158602
158808
  function parseProxyResponse(socket) {
158603
- return new Promise((resolve78, reject2) => {
158809
+ return new Promise((resolve79, reject2) => {
158604
158810
  let buffersLength = 0;
158605
158811
  const buffers = [];
158606
158812
  function read() {
@@ -158666,7 +158872,7 @@ var require_parse_proxy_response = __commonJS({
158666
158872
  }
158667
158873
  debug("got proxy server response: %o %o", firstLine, headers);
158668
158874
  cleanup();
158669
- resolve78({
158875
+ resolve79({
158670
158876
  connect: {
158671
158877
  statusCode,
158672
158878
  statusText,
@@ -158910,7 +159116,7 @@ var require_ponyfill_es2018 = __commonJS({
158910
159116
  return new originalPromise(executor);
158911
159117
  }
158912
159118
  function promiseResolvedWith(value) {
158913
- return newPromise((resolve78) => resolve78(value));
159119
+ return newPromise((resolve79) => resolve79(value));
158914
159120
  }
158915
159121
  function promiseRejectedWith(reason) {
158916
159122
  return originalPromiseReject(reason);
@@ -159080,8 +159286,8 @@ var require_ponyfill_es2018 = __commonJS({
159080
159286
  return new TypeError("Cannot " + name + " a stream using a released reader");
159081
159287
  }
159082
159288
  function defaultReaderClosedPromiseInitialize(reader) {
159083
- reader._closedPromise = newPromise((resolve78, reject2) => {
159084
- reader._closedPromise_resolve = resolve78;
159289
+ reader._closedPromise = newPromise((resolve79, reject2) => {
159290
+ reader._closedPromise_resolve = resolve79;
159085
159291
  reader._closedPromise_reject = reject2;
159086
159292
  });
159087
159293
  }
@@ -159255,8 +159461,8 @@ var require_ponyfill_es2018 = __commonJS({
159255
159461
  }
159256
159462
  let resolvePromise;
159257
159463
  let rejectPromise;
159258
- const promise = newPromise((resolve78, reject2) => {
159259
- resolvePromise = resolve78;
159464
+ const promise = newPromise((resolve79, reject2) => {
159465
+ resolvePromise = resolve79;
159260
159466
  rejectPromise = reject2;
159261
159467
  });
159262
159468
  const readRequest = {
@@ -159361,8 +159567,8 @@ var require_ponyfill_es2018 = __commonJS({
159361
159567
  const reader = this._reader;
159362
159568
  let resolvePromise;
159363
159569
  let rejectPromise;
159364
- const promise = newPromise((resolve78, reject2) => {
159365
- resolvePromise = resolve78;
159570
+ const promise = newPromise((resolve79, reject2) => {
159571
+ resolvePromise = resolve79;
159366
159572
  rejectPromise = reject2;
159367
159573
  });
159368
159574
  const readRequest = {
@@ -160381,8 +160587,8 @@ var require_ponyfill_es2018 = __commonJS({
160381
160587
  }
160382
160588
  let resolvePromise;
160383
160589
  let rejectPromise;
160384
- const promise = newPromise((resolve78, reject2) => {
160385
- resolvePromise = resolve78;
160590
+ const promise = newPromise((resolve79, reject2) => {
160591
+ resolvePromise = resolve79;
160386
160592
  rejectPromise = reject2;
160387
160593
  });
160388
160594
  const readIntoRequest = {
@@ -160694,10 +160900,10 @@ var require_ponyfill_es2018 = __commonJS({
160694
160900
  wasAlreadyErroring = true;
160695
160901
  reason = void 0;
160696
160902
  }
160697
- const promise = newPromise((resolve78, reject2) => {
160903
+ const promise = newPromise((resolve79, reject2) => {
160698
160904
  stream._pendingAbortRequest = {
160699
160905
  _promise: void 0,
160700
- _resolve: resolve78,
160906
+ _resolve: resolve79,
160701
160907
  _reject: reject2,
160702
160908
  _reason: reason,
160703
160909
  _wasAlreadyErroring: wasAlreadyErroring
@@ -160714,9 +160920,9 @@ var require_ponyfill_es2018 = __commonJS({
160714
160920
  if (state === "closed" || state === "errored") {
160715
160921
  return promiseRejectedWith(new TypeError(`The stream (in ${state} state) is not in the writable state and cannot be closed`));
160716
160922
  }
160717
- const promise = newPromise((resolve78, reject2) => {
160923
+ const promise = newPromise((resolve79, reject2) => {
160718
160924
  const closeRequest = {
160719
- _resolve: resolve78,
160925
+ _resolve: resolve79,
160720
160926
  _reject: reject2
160721
160927
  };
160722
160928
  stream._closeRequest = closeRequest;
@@ -160729,9 +160935,9 @@ var require_ponyfill_es2018 = __commonJS({
160729
160935
  return promise;
160730
160936
  }
160731
160937
  function WritableStreamAddWriteRequest(stream) {
160732
- const promise = newPromise((resolve78, reject2) => {
160938
+ const promise = newPromise((resolve79, reject2) => {
160733
160939
  const writeRequest = {
160734
- _resolve: resolve78,
160940
+ _resolve: resolve79,
160735
160941
  _reject: reject2
160736
160942
  };
160737
160943
  stream._writeRequests.push(writeRequest);
@@ -161347,8 +161553,8 @@ var require_ponyfill_es2018 = __commonJS({
161347
161553
  return new TypeError("Cannot " + name + " a stream using a released writer");
161348
161554
  }
161349
161555
  function defaultWriterClosedPromiseInitialize(writer) {
161350
- writer._closedPromise = newPromise((resolve78, reject2) => {
161351
- writer._closedPromise_resolve = resolve78;
161556
+ writer._closedPromise = newPromise((resolve79, reject2) => {
161557
+ writer._closedPromise_resolve = resolve79;
161352
161558
  writer._closedPromise_reject = reject2;
161353
161559
  writer._closedPromiseState = "pending";
161354
161560
  });
@@ -161384,8 +161590,8 @@ var require_ponyfill_es2018 = __commonJS({
161384
161590
  writer._closedPromiseState = "resolved";
161385
161591
  }
161386
161592
  function defaultWriterReadyPromiseInitialize(writer) {
161387
- writer._readyPromise = newPromise((resolve78, reject2) => {
161388
- writer._readyPromise_resolve = resolve78;
161593
+ writer._readyPromise = newPromise((resolve79, reject2) => {
161594
+ writer._readyPromise_resolve = resolve79;
161389
161595
  writer._readyPromise_reject = reject2;
161390
161596
  });
161391
161597
  writer._readyPromiseState = "pending";
@@ -161472,7 +161678,7 @@ var require_ponyfill_es2018 = __commonJS({
161472
161678
  source._disturbed = true;
161473
161679
  let shuttingDown = false;
161474
161680
  let currentWrite = promiseResolvedWith(void 0);
161475
- return newPromise((resolve78, reject2) => {
161681
+ return newPromise((resolve79, reject2) => {
161476
161682
  let abortAlgorithm;
161477
161683
  if (signal !== void 0) {
161478
161684
  abortAlgorithm = () => {
@@ -161617,7 +161823,7 @@ var require_ponyfill_es2018 = __commonJS({
161617
161823
  if (isError) {
161618
161824
  reject2(error);
161619
161825
  } else {
161620
- resolve78(void 0);
161826
+ resolve79(void 0);
161621
161827
  }
161622
161828
  return null;
161623
161829
  }
@@ -161898,8 +162104,8 @@ var require_ponyfill_es2018 = __commonJS({
161898
162104
  let branch1;
161899
162105
  let branch2;
161900
162106
  let resolveCancelPromise;
161901
- const cancelPromise = newPromise((resolve78) => {
161902
- resolveCancelPromise = resolve78;
162107
+ const cancelPromise = newPromise((resolve79) => {
162108
+ resolveCancelPromise = resolve79;
161903
162109
  });
161904
162110
  function pullAlgorithm() {
161905
162111
  if (reading) {
@@ -161990,8 +162196,8 @@ var require_ponyfill_es2018 = __commonJS({
161990
162196
  let branch1;
161991
162197
  let branch2;
161992
162198
  let resolveCancelPromise;
161993
- const cancelPromise = newPromise((resolve78) => {
161994
- resolveCancelPromise = resolve78;
162199
+ const cancelPromise = newPromise((resolve79) => {
162200
+ resolveCancelPromise = resolve79;
161995
162201
  });
161996
162202
  function forwardReaderError(thisReader) {
161997
162203
  uponRejection(thisReader._closedPromise, (r2) => {
@@ -162771,8 +162977,8 @@ var require_ponyfill_es2018 = __commonJS({
162771
162977
  const writableHighWaterMark = ExtractHighWaterMark(writableStrategy, 1);
162772
162978
  const writableSizeAlgorithm = ExtractSizeAlgorithm(writableStrategy);
162773
162979
  let startPromise_resolve;
162774
- const startPromise = newPromise((resolve78) => {
162775
- startPromise_resolve = resolve78;
162980
+ const startPromise = newPromise((resolve79) => {
162981
+ startPromise_resolve = resolve79;
162776
162982
  });
162777
162983
  InitializeTransformStream(this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm);
162778
162984
  SetUpTransformStreamDefaultControllerFromTransformer(this, transformer);
@@ -162865,8 +163071,8 @@ var require_ponyfill_es2018 = __commonJS({
162865
163071
  if (stream._backpressureChangePromise !== void 0) {
162866
163072
  stream._backpressureChangePromise_resolve();
162867
163073
  }
162868
- stream._backpressureChangePromise = newPromise((resolve78) => {
162869
- stream._backpressureChangePromise_resolve = resolve78;
163074
+ stream._backpressureChangePromise = newPromise((resolve79) => {
163075
+ stream._backpressureChangePromise_resolve = resolve79;
162870
163076
  });
162871
163077
  stream._backpressure = backpressure;
162872
163078
  }
@@ -163034,8 +163240,8 @@ var require_ponyfill_es2018 = __commonJS({
163034
163240
  return controller._finishPromise;
163035
163241
  }
163036
163242
  const readable = stream._readable;
163037
- controller._finishPromise = newPromise((resolve78, reject2) => {
163038
- controller._finishPromise_resolve = resolve78;
163243
+ controller._finishPromise = newPromise((resolve79, reject2) => {
163244
+ controller._finishPromise_resolve = resolve79;
163039
163245
  controller._finishPromise_reject = reject2;
163040
163246
  });
163041
163247
  const cancelPromise = controller._cancelAlgorithm(reason);
@@ -163061,8 +163267,8 @@ var require_ponyfill_es2018 = __commonJS({
163061
163267
  return controller._finishPromise;
163062
163268
  }
163063
163269
  const readable = stream._readable;
163064
- controller._finishPromise = newPromise((resolve78, reject2) => {
163065
- controller._finishPromise_resolve = resolve78;
163270
+ controller._finishPromise = newPromise((resolve79, reject2) => {
163271
+ controller._finishPromise_resolve = resolve79;
163066
163272
  controller._finishPromise_reject = reject2;
163067
163273
  });
163068
163274
  const flushPromise = controller._flushAlgorithm();
@@ -163092,8 +163298,8 @@ var require_ponyfill_es2018 = __commonJS({
163092
163298
  return controller._finishPromise;
163093
163299
  }
163094
163300
  const writable = stream._writable;
163095
- controller._finishPromise = newPromise((resolve78, reject2) => {
163096
- controller._finishPromise_resolve = resolve78;
163301
+ controller._finishPromise = newPromise((resolve79, reject2) => {
163302
+ controller._finishPromise_resolve = resolve79;
163097
163303
  controller._finishPromise_reject = reject2;
163098
163304
  });
163099
163305
  const cancelPromise = controller._cancelAlgorithm(reason);
@@ -165062,7 +165268,7 @@ import zlib2 from "zlib";
165062
165268
  import Stream2, { PassThrough as PassThrough2, pipeline as pump } from "stream";
165063
165269
  import { Buffer as Buffer4 } from "buffer";
165064
165270
  async function fetch3(url, options_) {
165065
- return new Promise((resolve78, reject2) => {
165271
+ return new Promise((resolve79, reject2) => {
165066
165272
  const request = new Request2(url, options_);
165067
165273
  const { parsedURL, options } = getNodeRequestOptions(request);
165068
165274
  if (!supportedSchemas.has(parsedURL.protocol)) {
@@ -165071,7 +165277,7 @@ async function fetch3(url, options_) {
165071
165277
  if (parsedURL.protocol === "data:") {
165072
165278
  const data2 = dist_default3(request.url);
165073
165279
  const response2 = new Response2(data2, { headers: { "Content-Type": data2.typeFull } });
165074
- resolve78(response2);
165280
+ resolve79(response2);
165075
165281
  return;
165076
165282
  }
165077
165283
  const send = (parsedURL.protocol === "https:" ? https : http3).request;
@@ -165193,7 +165399,7 @@ async function fetch3(url, options_) {
165193
165399
  if (responseReferrerPolicy) {
165194
165400
  requestOptions.referrerPolicy = responseReferrerPolicy;
165195
165401
  }
165196
- resolve78(fetch3(new Request2(locationURL, requestOptions)));
165402
+ resolve79(fetch3(new Request2(locationURL, requestOptions)));
165197
165403
  finalize();
165198
165404
  return;
165199
165405
  }
@@ -165226,7 +165432,7 @@ async function fetch3(url, options_) {
165226
165432
  const codings = headers.get("Content-Encoding");
165227
165433
  if (!request.compress || request.method === "HEAD" || codings === null || response_.statusCode === 204 || response_.statusCode === 304) {
165228
165434
  response = new Response2(body, responseOptions);
165229
- resolve78(response);
165435
+ resolve79(response);
165230
165436
  return;
165231
165437
  }
165232
165438
  const zlibOptions = {
@@ -165240,7 +165446,7 @@ async function fetch3(url, options_) {
165240
165446
  }
165241
165447
  });
165242
165448
  response = new Response2(body, responseOptions);
165243
- resolve78(response);
165449
+ resolve79(response);
165244
165450
  return;
165245
165451
  }
165246
165452
  if (codings === "deflate" || codings === "x-deflate") {
@@ -165264,12 +165470,12 @@ async function fetch3(url, options_) {
165264
165470
  });
165265
165471
  }
165266
165472
  response = new Response2(body, responseOptions);
165267
- resolve78(response);
165473
+ resolve79(response);
165268
165474
  });
165269
165475
  raw.once("end", () => {
165270
165476
  if (!response) {
165271
165477
  response = new Response2(body, responseOptions);
165272
- resolve78(response);
165478
+ resolve79(response);
165273
165479
  }
165274
165480
  });
165275
165481
  return;
@@ -165281,11 +165487,11 @@ async function fetch3(url, options_) {
165281
165487
  }
165282
165488
  });
165283
165489
  response = new Response2(body, responseOptions);
165284
- resolve78(response);
165490
+ resolve79(response);
165285
165491
  return;
165286
165492
  }
165287
165493
  response = new Response2(body, responseOptions);
165288
- resolve78(response);
165494
+ resolve79(response);
165289
165495
  });
165290
165496
  writeToStream(request_, request).catch(reject2);
165291
165497
  });
@@ -171367,7 +171573,7 @@ var require_jwtaccess = __commonJS({
171367
171573
  }
171368
171574
  }
171369
171575
  fromStreamAsync(inputStream) {
171370
- return new Promise((resolve78, reject2) => {
171576
+ return new Promise((resolve79, reject2) => {
171371
171577
  if (!inputStream) {
171372
171578
  reject2(new Error("Must pass in a stream containing the service account auth settings."));
171373
171579
  }
@@ -171376,7 +171582,7 @@ var require_jwtaccess = __commonJS({
171376
171582
  try {
171377
171583
  const data2 = JSON.parse(s2);
171378
171584
  this.fromJSON(data2);
171379
- resolve78();
171585
+ resolve79();
171380
171586
  } catch (err) {
171381
171587
  reject2(err);
171382
171588
  }
@@ -171615,7 +171821,7 @@ var require_jwtclient = __commonJS({
171615
171821
  }
171616
171822
  }
171617
171823
  fromStreamAsync(inputStream) {
171618
- return new Promise((resolve78, reject2) => {
171824
+ return new Promise((resolve79, reject2) => {
171619
171825
  if (!inputStream) {
171620
171826
  throw new Error("Must pass in a stream containing the service account auth settings.");
171621
171827
  }
@@ -171624,7 +171830,7 @@ var require_jwtclient = __commonJS({
171624
171830
  try {
171625
171831
  const data2 = JSON.parse(s2);
171626
171832
  this.fromJSON(data2);
171627
- resolve78();
171833
+ resolve79();
171628
171834
  } catch (e3) {
171629
171835
  reject2(e3);
171630
171836
  }
@@ -171757,7 +171963,7 @@ var require_refreshclient = __commonJS({
171757
171963
  }
171758
171964
  }
171759
171965
  async fromStreamAsync(inputStream) {
171760
- return new Promise((resolve78, reject2) => {
171966
+ return new Promise((resolve79, reject2) => {
171761
171967
  if (!inputStream) {
171762
171968
  return reject2(new Error("Must pass in a stream containing the user refresh token."));
171763
171969
  }
@@ -171766,7 +171972,7 @@ var require_refreshclient = __commonJS({
171766
171972
  try {
171767
171973
  const data2 = JSON.parse(s2);
171768
171974
  this.fromJSON(data2);
171769
- return resolve78();
171975
+ return resolve79();
171770
171976
  } catch (err) {
171771
171977
  return reject2(err);
171772
171978
  }
@@ -173599,7 +173805,7 @@ var require_pluggable_auth_handler = __commonJS({
173599
173805
  * @return A promise that resolves with the executable response.
173600
173806
  */
173601
173807
  retrieveResponseFromExecutable(envMap) {
173602
- return new Promise((resolve78, reject2) => {
173808
+ return new Promise((resolve79, reject2) => {
173603
173809
  const child = childProcess.spawn(this.commandComponents[0], this.commandComponents.slice(1), {
173604
173810
  env: { ...process.env, ...Object.fromEntries(envMap) }
173605
173811
  });
@@ -173621,7 +173827,7 @@ var require_pluggable_auth_handler = __commonJS({
173621
173827
  try {
173622
173828
  const responseJson = JSON.parse(output);
173623
173829
  const response = new executable_response_1.ExecutableResponse(responseJson);
173624
- return resolve78(response);
173830
+ return resolve79(response);
173625
173831
  } catch (error) {
173626
173832
  if (error instanceof executable_response_1.ExecutableResponseError) {
173627
173833
  return reject2(error);
@@ -174524,7 +174730,7 @@ var require_googleauth = __commonJS({
174524
174730
  }
174525
174731
  }
174526
174732
  fromStreamAsync(inputStream, options) {
174527
- return new Promise((resolve78, reject2) => {
174733
+ return new Promise((resolve79, reject2) => {
174528
174734
  if (!inputStream) {
174529
174735
  throw new Error("Must pass in a stream containing the Google auth settings.");
174530
174736
  }
@@ -174534,7 +174740,7 @@ var require_googleauth = __commonJS({
174534
174740
  try {
174535
174741
  const data2 = JSON.parse(chunks.join(""));
174536
174742
  const r2 = this._cacheClientFromJSON(data2, options);
174537
- return resolve78(r2);
174743
+ return resolve79(r2);
174538
174744
  } catch (err) {
174539
174745
  if (!this.keyFilename)
174540
174746
  throw err;
@@ -174544,7 +174750,7 @@ var require_googleauth = __commonJS({
174544
174750
  });
174545
174751
  this.cachedCredential = client;
174546
174752
  this.setGapicJWTValues(client);
174547
- return resolve78(client);
174753
+ return resolve79(client);
174548
174754
  }
174549
174755
  } catch (err) {
174550
174756
  return reject2(err);
@@ -174580,17 +174786,17 @@ var require_googleauth = __commonJS({
174580
174786
  * Run the Google Cloud SDK command that prints the default project ID
174581
174787
  */
174582
174788
  async getDefaultServiceProjectId() {
174583
- return new Promise((resolve78) => {
174789
+ return new Promise((resolve79) => {
174584
174790
  (0, child_process_1.exec)("gcloud config config-helper --format json", (err, stdout2) => {
174585
174791
  if (!err && stdout2) {
174586
174792
  try {
174587
174793
  const projectId = JSON.parse(stdout2).configuration.properties.core.project;
174588
- resolve78(projectId);
174794
+ resolve79(projectId);
174589
174795
  return;
174590
174796
  } catch (e3) {
174591
174797
  }
174592
174798
  }
174593
- resolve78(null);
174799
+ resolve79(null);
174594
174800
  });
174595
174801
  });
174596
174802
  }
@@ -182433,14 +182639,14 @@ function __asyncValues2(o) {
182433
182639
  }, i2);
182434
182640
  function verb(n2) {
182435
182641
  i2[n2] = o[n2] && function(v2) {
182436
- return new Promise(function(resolve78, reject2) {
182437
- v2 = o[n2](v2), settle(resolve78, reject2, v2.done, v2.value);
182642
+ return new Promise(function(resolve79, reject2) {
182643
+ v2 = o[n2](v2), settle(resolve79, reject2, v2.done, v2.value);
182438
182644
  });
182439
182645
  };
182440
182646
  }
182441
- function settle(resolve78, reject2, d2, v2) {
182647
+ function settle(resolve79, reject2, d2, v2) {
182442
182648
  Promise.resolve(v2).then(function(v3) {
182443
- resolve78({ value: v3, done: d2 });
182649
+ resolve79({ value: v3, done: d2 });
182444
182650
  }, reject2);
182445
182651
  }
182446
182652
  }
@@ -189867,7 +190073,7 @@ function getApiKeyFromEnv() {
189867
190073
  }
189868
190074
  return envGoogleApiKey || envGeminiApiKey || void 0;
189869
190075
  }
189870
- var import_p_retry, import_google_auth_library, _defaultBaseGeminiUrl, _defaultBaseVertexUrl, BaseModule, Language, Outcome, FunctionResponseScheduling, Type, Environment, AuthType, HttpElementLocation, ApiSpec, PhishBlockThreshold, Behavior, DynamicRetrievalConfigMode, FunctionCallingConfigMode, ThinkingLevel, PersonGeneration, ProminentPeople, HarmCategory, HarmBlockMethod, HarmBlockThreshold, FinishReason, HarmProbability, HarmSeverity, UrlRetrievalStatus, BlockedReason, TrafficType, Modality, ModelStage, MediaResolution, TuningMode, AdapterSize, JobState, TuningJobState, AggregationMetric, PairwiseChoice, TuningTask, DocumentState, PartMediaResolutionLevel, ToolType, ResourceScope, ServiceTier, FeatureSelectionPreference, EmbeddingApiType, SafetyFilterLevel, ImagePromptLanguage, MaskReferenceMode, ControlReferenceType, SubjectReferenceType, EditMode, SegmentMode, VideoGenerationReferenceType, VideoGenerationMaskMode, VideoCompressionQuality, ImageResizeMode, TuningMethod, FileState, FileSource, TurnCompleteReason, MediaModality, VadSignalType, VoiceActivityType, StartSensitivity, EndSensitivity, ActivityHandling, TurnCoverage, Scale, MusicGenerationMode, LiveMusicPlaybackControl, ToolResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponse, HttpResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateContentResponse, EmbedContentResponse, GenerateImagesResponse, EditImageResponse, UpscaleImageResponse, RecontextImageResponse, SegmentImageResponse, ListModelsResponse, DeleteModelResponse, CountTokensResponse, ComputeTokensResponse, GenerateVideosResponse, GenerateVideosOperation, EvaluateDatasetResponse, ListTuningJobsResponse, CancelTuningJobResponse, DeleteCachedContentResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, UploadToFileSearchStoreResumableResponse, ImportFileResponse, ImportFileOperation, ListFilesResponse, CreateFileResponse, DeleteFileResponse, RegisterFilesResponse, InlinedResponse, SingleEmbedContentResponse, InlinedEmbedContentResponse, ListBatchJobsResponse, ReplayResponse, RawReferenceImage, MaskReferenceImage, ControlReferenceImage, StyleReferenceImage, SubjectReferenceImage, ContentReferenceImage, LiveServerMessage, LiveClientToolResponse, LiveSendToolResponseParameters, LiveMusicServerMessage, UploadToFileSearchStoreResponse, UploadToFileSearchStoreOperation, PagedItem, Pager, Batches, Caches, Chats, Chat, ApiError, Files, CONTENT_TYPE_HEADER, SERVER_TIMEOUT_HEADER, USER_AGENT_HEADER, GOOGLE_API_CLIENT_HEADER, SDK_VERSION, LIBRARY_LABEL, VERTEX_AI_API_DEFAULT_VERSION, GOOGLE_AI_API_DEFAULT_VERSION, MULTI_REGIONAL_LOCATIONS, DEFAULT_RETRY_ATTEMPTS, DEFAULT_RETRY_HTTP_STATUS_CODES, ApiClient, MCP_LABEL, hasMcpToolUsageFromMcpToTool, McpCallableTool, LiveMusic, LiveMusicSession, FUNCTION_RESPONSE_REQUIRES_ID, Live, defaultLiveSendClientContentParamerters, Session, DEFAULT_MAX_REMOTE_CALLS, Models, Operations, Tokens, Documents, FileSearchStores, uuid4Internal, uuid4, castToError, GeminiNextGenAPIClientError, APIError, APIUserAbortError, APIConnectionError, APIConnectionTimeoutError, BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError, startsWithSchemeRegexp, isAbsoluteURL, isArrayInternal, isArray3, isReadonlyArrayInternal, isReadonlyArray, validatePositiveInteger, safeJSON, sleep$1, FallbackEncoder, VERSION2, checkFileSupport, isAsyncIterable, isBlobLike, isFileLike, isResponseLike, APIResource, EMPTY, createPathTagFunction, path, BaseInteractions, Interactions, BaseWebhooks, Webhooks, encodeUTF8_, decodeUTF8_, LineDecoder, levelNumbers, parseLogLevel, noopLogger, cachedLoggers, formatRequestDetails, Stream3, SSEDecoder, APIPromise, brand_privateNullableHeaders, buildHeaders, readEnv, _a3, BaseGeminiNextGenAPIClient, GeminiNextGenAPIClient, GOOGLE_API_KEY_HEADER, REQUIRED_VERTEX_AI_SCOPE, NodeAuth, NodeDownloader, NodeWebSocketFactory, NodeWebSocket, Tunings, MAX_CHUNK_SIZE2, MAX_RETRY_COUNT, INITIAL_RETRY_DELAY_MS, DELAY_MULTIPLIER, X_GOOG_UPLOAD_STATUS_HEADER_FIELD, NodeUploader, NodeFiles, LANGUAGE_LABEL_PREFIX, GoogleGenAI;
190076
+ var import_p_retry, import_google_auth_library, _defaultBaseGeminiUrl, _defaultBaseVertexUrl, BaseModule, Language, Outcome, FunctionResponseScheduling, Type, Environment, AuthType, HttpElementLocation, ApiSpec, PhishBlockThreshold, Behavior, DynamicRetrievalConfigMode, FunctionCallingConfigMode, ThinkingLevel, PersonGeneration, ProminentPeople, HarmCategory, HarmBlockMethod, HarmBlockThreshold, FinishReason, HarmProbability, HarmSeverity, UrlRetrievalStatus, BlockedReason, TrafficType, Modality, ModelStage, MediaResolution, TuningMode, AdapterSize, JobState, TuningJobState, AggregationMetric, PairwiseChoice, TuningTask, DocumentState, PartMediaResolutionLevel, ToolType, ResourceScope, ServiceTier, FeatureSelectionPreference, EmbeddingApiType, SafetyFilterLevel, ImagePromptLanguage, MaskReferenceMode, ControlReferenceType, SubjectReferenceType, EditMode, SegmentMode, VideoGenerationReferenceType, VideoGenerationMaskMode, VideoCompressionQuality, ImageResizeMode, TuningMethod, FileState, FileSource, TurnCompleteReason, MediaModality, VadSignalType, VoiceActivityType, StartSensitivity, EndSensitivity, ActivityHandling, TurnCoverage, Scale, MusicGenerationMode, LiveMusicPlaybackControl, ToolResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponse, HttpResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateContentResponse, EmbedContentResponse, GenerateImagesResponse, EditImageResponse, UpscaleImageResponse, RecontextImageResponse, SegmentImageResponse, ListModelsResponse, DeleteModelResponse, CountTokensResponse, ComputeTokensResponse, GenerateVideosResponse, GenerateVideosOperation, EvaluateDatasetResponse, ListTuningJobsResponse, CancelTuningJobResponse, DeleteCachedContentResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, UploadToFileSearchStoreResumableResponse, ImportFileResponse, ImportFileOperation, ListFilesResponse, CreateFileResponse, DeleteFileResponse, RegisterFilesResponse, InlinedResponse, SingleEmbedContentResponse, InlinedEmbedContentResponse, ListBatchJobsResponse, ReplayResponse, RawReferenceImage, MaskReferenceImage, ControlReferenceImage, StyleReferenceImage, SubjectReferenceImage, ContentReferenceImage, LiveServerMessage, LiveClientToolResponse, LiveSendToolResponseParameters, LiveMusicServerMessage, UploadToFileSearchStoreResponse, UploadToFileSearchStoreOperation, PagedItem, Pager, Batches, Caches, Chats, Chat, ApiError, Files, CONTENT_TYPE_HEADER, SERVER_TIMEOUT_HEADER, USER_AGENT_HEADER, GOOGLE_API_CLIENT_HEADER, SDK_VERSION, LIBRARY_LABEL, VERTEX_AI_API_DEFAULT_VERSION, GOOGLE_AI_API_DEFAULT_VERSION, MULTI_REGIONAL_LOCATIONS, DEFAULT_RETRY_ATTEMPTS, DEFAULT_RETRY_HTTP_STATUS_CODES, ApiClient, MCP_LABEL, hasMcpToolUsageFromMcpToTool, McpCallableTool, LiveMusic, LiveMusicSession, FUNCTION_RESPONSE_REQUIRES_ID, Live, defaultLiveSendClientContentParamerters, Session, DEFAULT_MAX_REMOTE_CALLS, Models, Operations, Tokens, Documents, FileSearchStores, uuid4Internal, uuid4, castToError, GeminiNextGenAPIClientError, APIError, APIUserAbortError, APIConnectionError, APIConnectionTimeoutError, BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError, startsWithSchemeRegexp, isAbsoluteURL, isArrayInternal, isArray3, isReadonlyArrayInternal, isReadonlyArray, validatePositiveInteger, safeJSON, sleep$1, FallbackEncoder, VERSION2, checkFileSupport, isAsyncIterable, isBlobLike, isFileLike, isResponseLike, APIResource, EMPTY2, createPathTagFunction, path, BaseInteractions, Interactions, BaseWebhooks, Webhooks, encodeUTF8_, decodeUTF8_, LineDecoder, levelNumbers, parseLogLevel, noopLogger, cachedLoggers, formatRequestDetails, Stream3, SSEDecoder, APIPromise, brand_privateNullableHeaders, buildHeaders, readEnv, _a3, BaseGeminiNextGenAPIClient, GeminiNextGenAPIClient, GOOGLE_API_KEY_HEADER, REQUIRED_VERTEX_AI_SCOPE, NodeAuth, NodeDownloader, NodeWebSocketFactory, NodeWebSocket, Tunings, MAX_CHUNK_SIZE2, MAX_RETRY_COUNT, INITIAL_RETRY_DELAY_MS, DELAY_MULTIPLIER, X_GOOG_UPLOAD_STATUS_HEADER_FIELD, NodeUploader, NodeFiles, LANGUAGE_LABEL_PREFIX, GoogleGenAI;
189871
190077
  var init_node4 = __esm({
189872
190078
  "../../node_modules/.bun/@google+genai@1.52.0/node_modules/@google/genai/dist/node/index.mjs"() {
189873
190079
  "use strict";
@@ -192930,8 +193136,8 @@ var init_node4 = __esm({
192930
193136
  const url = `${websocketBaseUrl}/ws/google.ai.generativelanguage.${apiVersion}.GenerativeService.BidiGenerateMusic?key=${apiKey}`;
192931
193137
  let onopenResolve = () => {
192932
193138
  };
192933
- const onopenPromise = new Promise((resolve78) => {
192934
- onopenResolve = resolve78;
193139
+ const onopenPromise = new Promise((resolve79) => {
193140
+ onopenResolve = resolve79;
192935
193141
  });
192936
193142
  const callbacks = params.callbacks;
192937
193143
  const onopenAwaitedCallback = function() {
@@ -193137,8 +193343,8 @@ var init_node4 = __esm({
193137
193343
  }
193138
193344
  let onopenResolve = () => {
193139
193345
  };
193140
- const onopenPromise = new Promise((resolve78) => {
193141
- onopenResolve = resolve78;
193346
+ const onopenPromise = new Promise((resolve79) => {
193347
+ onopenResolve = resolve79;
193142
193348
  });
193143
193349
  const callbacks = params.callbacks;
193144
193350
  const onopenAwaitedCallback = function() {
@@ -195486,7 +195692,7 @@ var init_node4 = __esm({
195486
195692
  return void 0;
195487
195693
  }
195488
195694
  };
195489
- sleep$1 = (ms) => new Promise((resolve78) => setTimeout(resolve78, ms));
195695
+ sleep$1 = (ms) => new Promise((resolve79) => setTimeout(resolve79, ms));
195490
195696
  FallbackEncoder = ({ headers, body }) => {
195491
195697
  return {
195492
195698
  bodyHeaders: {
@@ -195514,7 +195720,7 @@ var init_node4 = __esm({
195514
195720
  }
195515
195721
  };
195516
195722
  APIResource._key = [];
195517
- EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
195723
+ EMPTY2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
195518
195724
  createPathTagFunction = (pathEncoder = encodeURIPath) => (function path2(statics, ...params) {
195519
195725
  if (statics.length === 1)
195520
195726
  return statics[0];
@@ -195528,7 +195734,7 @@ var init_node4 = __esm({
195528
195734
  const value = params[index];
195529
195735
  let encoded = (postPath ? encodeURIComponent : pathEncoder)("" + value);
195530
195736
  if (index !== params.length && (value == null || typeof value === "object" && // handle values from other realms
195531
- value.toString === ((_c2 = Object.getPrototypeOf((_b = Object.getPrototypeOf((_a4 = value.hasOwnProperty) !== null && _a4 !== void 0 ? _a4 : EMPTY)) !== null && _b !== void 0 ? _b : EMPTY)) === null || _c2 === void 0 ? void 0 : _c2.toString))) {
195737
+ value.toString === ((_c2 = Object.getPrototypeOf((_b = Object.getPrototypeOf((_a4 = value.hasOwnProperty) !== null && _a4 !== void 0 ? _a4 : EMPTY2)) !== null && _b !== void 0 ? _b : EMPTY2)) === null || _c2 === void 0 ? void 0 : _c2.toString))) {
195532
195738
  encoded = value + "";
195533
195739
  invalidSegments.push({
195534
195740
  start: previousValue.length + currentValue.length,
@@ -195995,8 +196201,8 @@ ${underline2}`);
195995
196201
  };
195996
196202
  APIPromise = class _APIPromise extends Promise {
195997
196203
  constructor(client, responsePromise, parseResponse = defaultParseResponse) {
195998
- super((resolve78) => {
195999
- resolve78(null);
196204
+ super((resolve79) => {
196205
+ resolve79(null);
196000
196206
  });
196001
196207
  this.responsePromise = responsePromise;
196002
196208
  this.parseResponse = parseResponse;
@@ -197223,9 +197429,9 @@ __export(snapshot_exports, {
197223
197429
  resolveSnapshotVideoFrameTime: () => resolveSnapshotVideoFrameTime,
197224
197430
  tailFrameTime: () => tailFrameTime
197225
197431
  });
197226
- import { existsSync as existsSync107, mkdtempSync as mkdtempSync16, readFileSync as readFileSync76, mkdirSync as mkdirSync53, rmSync as rmSync31, writeFileSync as writeFileSync46 } from "fs";
197432
+ import { existsSync as existsSync107, mkdtempSync as mkdtempSync16, readFileSync as readFileSync77, mkdirSync as mkdirSync53, rmSync as rmSync31, writeFileSync as writeFileSync46 } from "fs";
197227
197433
  import { tmpdir as tmpdir16 } from "os";
197228
- import { resolve as resolve68, join as join111, relative as relative25, isAbsolute as isAbsolute15, basename as basename25, posix as posix7 } from "path";
197434
+ import { resolve as resolve69, join as join111, relative as relative26, isAbsolute as isAbsolute16, basename as basename25, posix as posix7 } from "path";
197229
197435
  function orbitStageSource() {
197230
197436
  return `function(cam) {
197231
197437
  var root = document.querySelector("[data-composition-id]")
@@ -197293,7 +197499,7 @@ async function extractVideoFrameToBuffer(videoPath, timeSeconds, useVp9AlphaDeco
197293
197499
  );
197294
197500
  const result = await runFfmpegOnce(ffmpegPath, args, FFMPEG_EXTRACT_TIMEOUT_MS);
197295
197501
  if (result.code !== 0 || result.timedOut || !existsSync107(outPath)) return null;
197296
- return readFileSync76(outPath);
197502
+ return readFileSync77(outPath);
197297
197503
  } finally {
197298
197504
  try {
197299
197505
  rmSync31(tmp, { recursive: true, force: true });
@@ -197475,9 +197681,9 @@ async function captureSnapshots(projectDir, opts) {
197475
197681
  try {
197476
197682
  const url = new URL(v2.src);
197477
197683
  const decodedPath = decodeURIComponent(url.pathname).replace(/^\//, "");
197478
- const candidate = resolve68(projectDir, decodedPath);
197479
- const rel2 = relative25(projectDir, candidate);
197480
- if (!rel2.startsWith("..") && !isAbsolute15(rel2) && existsSync107(candidate)) {
197684
+ const candidate = resolve69(projectDir, decodedPath);
197685
+ const rel2 = relative26(projectDir, candidate);
197686
+ if (!rel2.startsWith("..") && !isAbsolute16(rel2) && existsSync107(candidate)) {
197481
197687
  ffmpegInput = candidate;
197482
197688
  inputIsLocal = true;
197483
197689
  } else if (url.protocol === "http:" || url.protocol === "https:") {
@@ -197542,8 +197748,8 @@ async function captureSnapshots(projectDir, opts) {
197542
197748
  } else {
197543
197749
  await page.screenshot({ path: framePath, type: "png", omitBackground: true });
197544
197750
  }
197545
- const rel = relative25(projectDir, framePath);
197546
- savedPaths.push(rel.startsWith("..") || isAbsolute15(rel) ? framePath : rel);
197751
+ const rel = relative26(projectDir, framePath);
197752
+ savedPaths.push(rel.startsWith("..") || isAbsolute16(rel) ? framePath : rel);
197547
197753
  }
197548
197754
  } finally {
197549
197755
  await chromeBrowser.close();
@@ -197683,7 +197889,7 @@ var init_snapshot = __esm({
197683
197889
  const angleLabel = camera && (camera.yaw !== 0 || camera.pitch !== 0) ? ` ${c.dim(`(angle yaw ${camera.yaw}\xB0 pitch ${camera.pitch}\xB0)`)}` : "";
197684
197890
  console.log(`${c.accent("\u25C6")} Capturing ${label2} from ${c.accent(project.name)}${angleLabel}`);
197685
197891
  try {
197686
- const snapshotDir = args.output ? resolve68(String(args.output)) : join111(project.dir, "snapshots");
197892
+ const snapshotDir = args.output ? resolve69(String(args.output)) : join111(project.dir, "snapshots");
197687
197893
  const paths = await captureSnapshots(project.dir, {
197688
197894
  frames,
197689
197895
  timeout,
@@ -197752,7 +197958,7 @@ ${c.success("\u25C7")} ${paths.length} snapshots saved to ${args.output ? snaps
197752
197958
  const filename = basename25(p2);
197753
197959
  const filePath = join111(snapshotDir, filename);
197754
197960
  if (!existsSync107(filePath)) return { filename, desc: "file not found" };
197755
- const raw = readFileSync76(filePath);
197961
+ const raw = readFileSync77(filePath);
197756
197962
  let imageData;
197757
197963
  let mimeType = "image/png";
197758
197964
  if (sharpFn) {
@@ -197817,22 +198023,22 @@ var init_sourceMutation = __esm({
197817
198023
  });
197818
198024
 
197819
198025
  // src/utils/pathArgs.ts
197820
- import { isAbsolute as isAbsolute16, relative as relative26, resolve as resolve69 } from "path";
198026
+ import { isAbsolute as isAbsolute17, relative as relative27, resolve as resolve70 } from "path";
197821
198027
  function readOptionalString(value) {
197822
198028
  if (typeof value !== "string") return void 0;
197823
198029
  const trimmed = value.trim();
197824
198030
  return trimmed ? trimmed : void 0;
197825
198031
  }
197826
198032
  function resolveFromBase(baseDir, input2) {
197827
- return isAbsolute16(input2) ? input2 : resolve69(baseDir, input2);
198033
+ return isAbsolute17(input2) ? input2 : resolve70(baseDir, input2);
197828
198034
  }
197829
198035
  function displayPathFromBase(baseDir, filePath) {
197830
- const rel = relative26(baseDir, filePath);
197831
- if (rel && !rel.startsWith("..") && !isAbsolute16(rel)) return rel;
198036
+ const rel = relative27(baseDir, filePath);
198037
+ if (rel && !rel.startsWith("..") && !isAbsolute17(rel)) return rel;
197832
198038
  return filePath;
197833
198039
  }
197834
198040
  function displayPathFromInput(baseDir, input2) {
197835
- return isAbsolute16(input2) ? displayPathFromBase(baseDir, input2) : input2;
198041
+ return isAbsolute17(input2) ? displayPathFromBase(baseDir, input2) : input2;
197836
198042
  }
197837
198043
  var init_pathArgs = __esm({
197838
198044
  "src/utils/pathArgs.ts"() {
@@ -198121,8 +198327,8 @@ __export(media_treatment_exports, {
198121
198327
  mediaTreatmentCommand: () => mediaTreatmentCommand,
198122
198328
  resolveMediaTreatmentSource: () => resolveMediaTreatmentSource
198123
198329
  });
198124
- import { existsSync as existsSync108, readFileSync as readFileSync77, writeFileSync as writeFileSync47 } from "fs";
198125
- import { join as join113, relative as relative27, resolve as resolve70 } from "path";
198330
+ import { existsSync as existsSync108, readFileSync as readFileSync78, writeFileSync as writeFileSync47 } from "fs";
198331
+ import { join as join113, relative as relative28, resolve as resolve71 } from "path";
198126
198332
  function getMediaTreatmentCapabilityOverview() {
198127
198333
  const capabilities = getHfColorGradingCapabilities();
198128
198334
  const family = (id, label2, description) => ({
@@ -198549,7 +198755,7 @@ function runCapabilityQuery(args) {
198549
198755
  function resolveMutationFile(args) {
198550
198756
  const project = resolveProject(readOptionalString(args.project));
198551
198757
  const fileArg = readOptionalString(args.file) ?? "index.html";
198552
- const filePath = resolve70(project.dir, fileArg);
198758
+ const filePath = resolve71(project.dir, fileArg);
198553
198759
  if (!isPathInside(filePath, project.dir) || !filePath.toLowerCase().endsWith(".html")) {
198554
198760
  throw new Error("--file must be an HTML file inside the project");
198555
198761
  }
@@ -198565,12 +198771,12 @@ function analyzeTarget(args) {
198565
198771
  }
198566
198772
  const selectorIndex = parseSelectorIndex(readOptionalString(args["selector-index"]));
198567
198773
  const { element, tag } = selectMediaElement(
198568
- readFileSync77(filePath, "utf8"),
198774
+ readFileSync78(filePath, "utf8"),
198569
198775
  selector,
198570
198776
  selectorIndex
198571
198777
  );
198572
198778
  const source = mediaSourceForElement(element);
198573
- const compositionFile = relative27(project.dir, filePath).split("\\").join("/");
198779
+ const compositionFile = relative28(project.dir, filePath).split("\\").join("/");
198574
198780
  const mediaPath = resolveMediaTreatmentSource(project.dir, compositionFile, source);
198575
198781
  return {
198576
198782
  ok: true,
@@ -198590,7 +198796,7 @@ function prepareMutation(args) {
198590
198796
  const clear = args.clear === true;
198591
198797
  const apply = args.apply === true;
198592
198798
  const selectorIndex = parseSelectorIndex(readOptionalString(args["selector-index"]));
198593
- const result = applyMediaTreatmentToHtml(readFileSync77(filePath, "utf8"), {
198799
+ const result = applyMediaTreatmentToHtml(readFileSync78(filePath, "utf8"), {
198594
198800
  selector,
198595
198801
  selectorIndex,
198596
198802
  grading: parseGrading(readOptionalString(args.grading), apply, clear),
@@ -198606,7 +198812,7 @@ function prepareMutation(args) {
198606
198812
  payload: {
198607
198813
  ok: true,
198608
198814
  action,
198609
- file: relative27(project.dir, filePath) || "index.html",
198815
+ file: relative28(project.dir, filePath) || "index.html",
198610
198816
  selector,
198611
198817
  selectorIndex: selectorIndex ?? 0,
198612
198818
  tag: result.tag,
@@ -198779,12 +198985,12 @@ import {
198779
198985
  existsSync as existsSync109,
198780
198986
  mkdirSync as mkdirSync54,
198781
198987
  mkdtempSync as mkdtempSync17,
198782
- readFileSync as readFileSync78,
198988
+ readFileSync as readFileSync79,
198783
198989
  rmSync as rmSync33,
198784
198990
  writeFileSync as writeFileSync48
198785
198991
  } from "fs";
198786
198992
  import { tmpdir as tmpdir17 } from "os";
198787
- import { basename as basename27, dirname as dirname54, extname as extname21, join as join114, resolve as resolve71 } from "path";
198993
+ import { basename as basename27, dirname as dirname54, extname as extname21, join as join114, resolve as resolve72 } from "path";
198788
198994
  import sharp2 from "sharp";
198789
198995
  function isRecord14(value) {
198790
198996
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -198875,7 +199081,7 @@ function parseGradesFile(filePath) {
198875
199081
  }
198876
199082
  let parsed;
198877
199083
  try {
198878
- parsed = JSON.parse(readFileSync78(filePath, "utf-8"));
199084
+ parsed = JSON.parse(readFileSync79(filePath, "utf-8"));
198879
199085
  } catch (err) {
198880
199086
  throw new Error(`Could not parse grades JSON: ${normalizeErrorMessage(err)}`);
198881
199087
  }
@@ -198916,7 +199122,7 @@ function parseGradeCompareArgs(args) {
198916
199122
  if (Boolean(gradesArg) === Boolean(lutsArg)) {
198917
199123
  throw new Error("Exactly one of --grades or --luts is required");
198918
199124
  }
198919
- const projectDir = resolve71(readOptionalString(args.project) ?? process.cwd());
199125
+ const projectDir = resolve72(readOptionalString(args.project) ?? process.cwd());
198920
199126
  const framePath = resolveFromBase(projectDir, frameArg);
198921
199127
  const outPath = resolveFromBase(projectDir, readOptionalString(args.out) ?? "grade-compare.png");
198922
199128
  return {
@@ -199052,7 +199258,7 @@ async function prepareGradeCompareTempProject(opts) {
199052
199258
  if (!existsSync109(sourcePath)) {
199053
199259
  throw new Error(`LUT file not found for "${cell.label}": ${sourcePath}`);
199054
199260
  }
199055
- const lutText = readFileSync78(sourcePath, "utf-8");
199261
+ const lutText = readFileSync79(sourcePath, "utf-8");
199056
199262
  try {
199057
199263
  parseCubeLut(lutText, { maxSize: 64 });
199058
199264
  } catch (err) {
@@ -199115,7 +199321,7 @@ async function extractVideoFrameToBuffer2(videoPath) {
199115
199321
  const detail = result.stderr.trim() ? `: ${result.stderr.trim()}` : "";
199116
199322
  throw new Error(`ffmpeg could not extract first frame from ${videoPath}${detail}`);
199117
199323
  }
199118
- return readFileSync78(outPath);
199324
+ return readFileSync79(outPath);
199119
199325
  } finally {
199120
199326
  rmSync33(tmp, { recursive: true, force: true });
199121
199327
  }
@@ -199124,7 +199330,7 @@ async function loadReferenceFrame(framePath) {
199124
199330
  if (!existsSync109(framePath)) {
199125
199331
  throw new Error(`Reference frame not found: ${framePath}`);
199126
199332
  }
199127
- const buffer = isVideoPath2(framePath) ? await extractVideoFrameToBuffer2(framePath) : readFileSync78(framePath);
199333
+ const buffer = isVideoPath2(framePath) ? await extractVideoFrameToBuffer2(framePath) : readFileSync79(framePath);
199128
199334
  if (!buffer) {
199129
199335
  throw new Error(`Could not extract a frame from video: ${framePath}`);
199130
199336
  }
@@ -200019,8 +200225,8 @@ __export(video_exports, {
200019
200225
  runVideoMode: () => runVideoMode,
200020
200226
  safeFilename: () => safeFilename
200021
200227
  });
200022
- import { createWriteStream as createWriteStream4, existsSync as existsSync111, mkdirSync as mkdirSync57, readFileSync as readFileSync79, unlinkSync as unlinkSync11 } from "fs";
200023
- import { resolve as resolve72, join as join117, basename as basename29 } from "path";
200228
+ import { createWriteStream as createWriteStream4, existsSync as existsSync111, mkdirSync as mkdirSync57, readFileSync as readFileSync80, unlinkSync as unlinkSync11 } from "fs";
200229
+ import { resolve as resolve73, join as join117, basename as basename29 } from "path";
200024
200230
  async function streamToFile(url, destPath) {
200025
200231
  const r2 = await safeFetch(url, {
200026
200232
  signal: AbortSignal.timeout(12e4),
@@ -200138,7 +200344,7 @@ function pickManifestEntry(manifest, args) {
200138
200344
  };
200139
200345
  }
200140
200346
  async function runVideoMode(args) {
200141
- const projectDir = resolve72(args.project);
200347
+ const projectDir = resolve73(args.project);
200142
200348
  const directPath = join117(projectDir, "extracted", "video-manifest.json");
200143
200349
  const w2hPath = join117(projectDir, "capture", "extracted", "video-manifest.json");
200144
200350
  const manifestPath2 = existsSync111(directPath) ? directPath : w2hPath;
@@ -200153,7 +200359,7 @@ async function runVideoMode(args) {
200153
200359
  }
200154
200360
  let manifest;
200155
200361
  try {
200156
- manifest = JSON.parse(readFileSync79(manifestPath2, "utf-8"));
200362
+ manifest = JSON.parse(readFileSync80(manifestPath2, "utf-8"));
200157
200363
  } catch (e3) {
200158
200364
  console.error(`${c.error("\u2717")} video-manifest.json is malformed: ${e3.message}`);
200159
200365
  setCommandExitCode(1);
@@ -201441,7 +201647,7 @@ var init_designStyleExtractor = __esm({
201441
201647
  });
201442
201648
 
201443
201649
  // src/capture/fontMetadataExtractor.ts
201444
- import { readdirSync as readdirSync35, readFileSync as readFileSync80, writeFileSync as writeFileSync50, existsSync as existsSync113 } from "fs";
201650
+ import { readdirSync as readdirSync35, readFileSync as readFileSync81, writeFileSync as writeFileSync50, existsSync as existsSync113 } from "fs";
201445
201651
  import { join as join118 } from "path";
201446
201652
  import * as fontkit from "fontkit";
201447
201653
  function isFontCollection(value) {
@@ -201492,7 +201698,7 @@ function readSingleFont(fullPath, filename) {
201492
201698
  isIcon: false
201493
201699
  };
201494
201700
  try {
201495
- const buf = readFileSync80(fullPath);
201701
+ const buf = readFileSync81(fullPath);
201496
201702
  const created = fontkit.create(buf);
201497
201703
  const font = isFontCollection(created) ? created.fonts[0] : created;
201498
201704
  if (!font) return empty2;
@@ -201760,7 +201966,7 @@ async function lazyScrollForCapture(page, budgetMs, opts = {}) {
201760
201966
  return { steps: 0, timedOut: false, degraded: false };
201761
201967
  }
201762
201968
  const stepDelayMs = opts.stepDelayMs ?? LAZY_SCROLL_STEP_DELAY_MS;
201763
- const sleep5 = opts.sleep ?? ((ms) => new Promise((resolve78) => setTimeout(resolve78, ms)));
201969
+ const sleep5 = opts.sleep ?? ((ms) => new Promise((resolve79) => setTimeout(resolve79, ms)));
201764
201970
  const deadline = Date.now() + budgetMs;
201765
201971
  let steps = 0;
201766
201972
  let timedOut = false;
@@ -201983,7 +202189,7 @@ var init_animationCataloger = __esm({
201983
202189
  });
201984
202190
 
201985
202191
  // src/capture/mediaCapture.ts
201986
- import { mkdirSync as mkdirSync58, writeFileSync as writeFileSync51, readdirSync as readdirSync36, readFileSync as readFileSync81, statSync as statSync37 } from "fs";
202192
+ import { mkdirSync as mkdirSync58, writeFileSync as writeFileSync51, readdirSync as readdirSync36, readFileSync as readFileSync83, statSync as statSync37 } from "fs";
201987
202193
  import { join as join119, extname as extname25 } from "path";
201988
202194
  function liveRemainingMs(budget, fallbackMs) {
201989
202195
  return budget.remainingMs?.() ?? fallbackMs;
@@ -202056,7 +202262,7 @@ async function renderLottiePreviews(chromeBrowser, lottieDir, outputDir, budget
202056
202262
  if (!file.endsWith(".json")) continue;
202057
202263
  if (liveRemainingMs(budget, 1) <= 0) break;
202058
202264
  try {
202059
- const raw = JSON.parse(readFileSync81(join119(lottieDir, file), "utf-8"));
202265
+ const raw = JSON.parse(readFileSync83(join119(lottieDir, file), "utf-8"));
202060
202266
  const fr = raw.fr || 30;
202061
202267
  const dur = ((raw.op || 0) - (raw.ip || 0)) / fr;
202062
202268
  const previewName = file.replace(".json", "-preview.png");
@@ -202069,7 +202275,7 @@ async function renderLottiePreviews(chromeBrowser, lottieDir, outputDir, budget
202069
202275
  previewPage = await chromeBrowser.newPage();
202070
202276
  if (liveRemainingMs(budget, 1) <= 0) break;
202071
202277
  await previewPage.setViewport({ width: 400, height: 400 });
202072
- const animData = JSON.parse(readFileSync81(join119(lottieDir, file), "utf-8"));
202278
+ const animData = JSON.parse(readFileSync83(join119(lottieDir, file), "utf-8"));
202073
202279
  const midFrame = Math.floor(((raw.op || 0) - (raw.ip || 0)) * 0.3);
202074
202280
  await previewPage.setContent(
202075
202281
  `<!DOCTYPE html>
@@ -202368,7 +202574,7 @@ var init_mediaCapture = __esm({
202368
202574
  });
202369
202575
 
202370
202576
  // src/capture/contentExtractor.ts
202371
- import { existsSync as existsSync114, readdirSync as readdirSync37, statSync as statSync38, readFileSync as readFileSync83 } from "fs";
202577
+ import { existsSync as existsSync114, readdirSync as readdirSync37, statSync as statSync38, readFileSync as readFileSync84 } from "fs";
202372
202578
  import { basename as basename30, join as join120 } from "path";
202373
202579
  function resolveVisionPhaseCompletion(outcome, remainingMs) {
202374
202580
  if (outcome.budgetExhausted || remainingMs <= 0) {
@@ -202638,7 +202844,7 @@ async function captionImagesWithGemini(outputDir, progress, warnings, options =
202638
202844
  const filePath = join120(outputDir, "assets", file);
202639
202845
  const stat3 = statSync38(filePath);
202640
202846
  if (stat3.size > 4e6) return { file, caption: "" };
202641
- const buffer = readFileSync83(filePath);
202847
+ const buffer = readFileSync84(filePath);
202642
202848
  const base64 = buffer.toString("base64");
202643
202849
  const ext = file.split(".").pop()?.toLowerCase() || "png";
202644
202850
  const mimeType = ext === "jpg" ? "image/jpeg" : `image/${ext}`;
@@ -202706,7 +202912,7 @@ async function captionImagesWithGemini(outputDir, progress, warnings, options =
202706
202912
  const filePath = join120(assetsDir, relPath);
202707
202913
  let pngBase64;
202708
202914
  try {
202709
- const svgSource = readFileSync83(filePath, "utf-8");
202915
+ const svgSource = readFileSync84(filePath, "utf-8");
202710
202916
  const lightFillHits = (svgSource.match(/fill\s*=\s*["'](#fff(fff)?|white|#[ef][ef][ef]|#[ef]{6})["']/gi) || []).length;
202711
202917
  const darkFillHits = (svgSource.match(/fill\s*=\s*["'](#000(000)?|black|#[0-3]{6}|#[0-3]{3})["']/gi) || []).length;
202712
202918
  const bg = lightFillHits > darkFillHits ? { r: 32, g: 32, b: 32 } : { r: 255, g: 255, b: 255 };
@@ -202833,7 +203039,7 @@ function generateAssetDescriptions(outputDir, tokens, catalogedAssets, geminiCap
202833
203039
  const videoLines = [];
202834
203040
  try {
202835
203041
  const manifest = JSON.parse(
202836
- readFileSync83(join120(outputDir, "extracted", "video-manifest.json"), "utf-8")
203042
+ readFileSync84(join120(outputDir, "extracted", "video-manifest.json"), "utf-8")
202837
203043
  );
202838
203044
  for (const v2 of manifest) {
202839
203045
  if (!v2.localPath) continue;
@@ -203003,15 +203209,15 @@ var init_agentPromptGenerator = __esm({
203003
203209
  });
203004
203210
 
203005
203211
  // src/capture/scaffolding.ts
203006
- import { existsSync as existsSync116, writeFileSync as writeFileSync54, readFileSync as readFileSync84 } from "fs";
203007
- import { join as join123, resolve as resolve73 } from "path";
203212
+ import { existsSync as existsSync116, writeFileSync as writeFileSync54, readFileSync as readFileSync85 } from "fs";
203213
+ import { join as join123, resolve as resolve74 } from "path";
203008
203214
  function loadEnvFile(startDir) {
203009
203215
  try {
203010
- let dir = resolve73(startDir);
203216
+ let dir = resolve74(startDir);
203011
203217
  for (let i2 = 0; i2 < 5; i2++) {
203012
- const envPath = resolve73(dir, ".env");
203218
+ const envPath = resolve74(dir, ".env");
203013
203219
  try {
203014
- const envContent = readFileSync84(envPath, "utf-8");
203220
+ const envContent = readFileSync85(envPath, "utf-8");
203015
203221
  for (const line2 of envContent.split("\n")) {
203016
203222
  const trimmed = line2.trim();
203017
203223
  if (!trimmed || trimmed.startsWith("#")) continue;
@@ -203023,7 +203229,7 @@ function loadEnvFile(startDir) {
203023
203229
  }
203024
203230
  break;
203025
203231
  } catch {
203026
- dir = resolve73(dir, "..");
203232
+ dir = resolve74(dir, "..");
203027
203233
  }
203028
203234
  }
203029
203235
  } catch {
@@ -204305,7 +204511,7 @@ __export(capture_exports2, {
204305
204511
  default: () => capture_default,
204306
204512
  examples: () => examples33
204307
204513
  });
204308
- import { resolve as resolve74 } from "path";
204514
+ import { resolve as resolve75 } from "path";
204309
204515
  function emitCapturePhase(event) {
204310
204516
  diag.notice(`${CAPTURE_PHASE_PREFIX}${JSON.stringify(event)}`);
204311
204517
  }
@@ -204429,13 +204635,13 @@ var init_capture2 = __esm({
204429
204635
  const captureBudgetMs = parseCaptureBudget(args["capture-budget"]);
204430
204636
  const isDefaultOutput = !args.output;
204431
204637
  let outputName = args.output ?? "capture";
204432
- let outputDir = resolve74(outputName);
204638
+ let outputDir = resolve75(outputName);
204433
204639
  if (isDefaultOutput) {
204434
204640
  const { existsSync: existsSync131 } = await import("fs");
204435
204641
  let n2 = 2;
204436
204642
  while (existsSync131(outputDir) && n2 < 100) {
204437
204643
  outputName = `capture-${n2}`;
204438
- outputDir = resolve74(outputName);
204644
+ outputDir = resolve75(outputName);
204439
204645
  n2++;
204440
204646
  }
204441
204647
  if (existsSync131(outputDir)) {
@@ -204595,7 +204801,7 @@ __export(state_exports, {
204595
204801
  stateFilePath: () => stateFilePath,
204596
204802
  writeStackOutputs: () => writeStackOutputs
204597
204803
  });
204598
- import { existsSync as existsSync118, mkdirSync as mkdirSync61, readdirSync as readdirSync39, readFileSync as readFileSync85, rmSync as rmSync35, writeFileSync as writeFileSync57 } from "fs";
204804
+ import { existsSync as existsSync118, mkdirSync as mkdirSync61, readdirSync as readdirSync39, readFileSync as readFileSync86, rmSync as rmSync35, writeFileSync as writeFileSync57 } from "fs";
204599
204805
  import { dirname as dirname56, join as join126 } from "path";
204600
204806
  function stateFilePath(stackName = DEFAULT_STACK_NAME, cwd = process.cwd()) {
204601
204807
  return join126(cwd, STATE_DIR_NAME, `${STATE_FILE_PREFIX}${stackName}.json`);
@@ -204610,7 +204816,7 @@ function readStackOutputs(stackName = DEFAULT_STACK_NAME, cwd = process.cwd()) {
204610
204816
  const path2 = stateFilePath(stackName, cwd);
204611
204817
  if (!existsSync118(path2)) return null;
204612
204818
  try {
204613
- return JSON.parse(readFileSync85(path2, "utf-8"));
204819
+ return JSON.parse(readFileSync86(path2, "utf-8"));
204614
204820
  } catch {
204615
204821
  return null;
204616
204822
  }
@@ -204776,16 +204982,16 @@ var init_sam = __esm({
204776
204982
 
204777
204983
  // src/commands/lambda/repoRoot.ts
204778
204984
  import { existsSync as existsSync120 } from "fs";
204779
- import { dirname as dirname57, resolve as resolve75 } from "path";
204985
+ import { dirname as dirname57, resolve as resolve76 } from "path";
204780
204986
  import { fileURLToPath as fileURLToPath15 } from "url";
204781
204987
  function repoRoot() {
204782
204988
  const override = process.env.HYPERFRAMES_REPO_ROOT;
204783
- if (override && existsSync120(resolve75(override, "packages", "aws-lambda", "package.json"))) {
204989
+ if (override && existsSync120(resolve76(override, "packages", "aws-lambda", "package.json"))) {
204784
204990
  return override;
204785
204991
  }
204786
204992
  let dir = dirname57(fileURLToPath15(import.meta.url));
204787
204993
  for (let depth = 0; depth < 12; depth++) {
204788
- if (existsSync120(resolve75(dir, "packages", "aws-lambda", "package.json"))) {
204994
+ if (existsSync120(resolve76(dir, "packages", "aws-lambda", "package.json"))) {
204789
204995
  return dir;
204790
204996
  }
204791
204997
  const parent = dirname57(dir);
@@ -204809,7 +205015,7 @@ __export(deploy_exports, {
204809
205015
  });
204810
205016
  import { spawnSync as spawnSync5 } from "child_process";
204811
205017
  import { existsSync as existsSync121 } from "fs";
204812
- import { join as join128, resolve as resolve76 } from "path";
205018
+ import { join as join128, resolve as resolve77 } from "path";
204813
205019
  async function runDeploy(args = {}) {
204814
205020
  const resolved2 = {
204815
205021
  stackName: args.stackName ?? DEFAULT_STACK_NAME,
@@ -204863,7 +205069,7 @@ async function runDeploy(args = {}) {
204863
205069
  console.log(` ${c.dim("Bucket:")} ${outputs.bucketName}`);
204864
205070
  console.log(` ${c.dim("State machine:")} ${outputs.stateMachineArn}`);
204865
205071
  console.log(` ${c.dim("Function:")} ${outputs.functionName}`);
204866
- console.log(` ${c.dim("State file:")} ${resolve76(statePath2)}`);
205072
+ console.log(` ${c.dim("State file:")} ${resolve77(statePath2)}`);
204867
205073
  console.log();
204868
205074
  console.log(c.dim(`Render with: hyperframes lambda render <project-dir>`));
204869
205075
  }
@@ -204939,14 +205145,14 @@ var init_sites = __esm({
204939
205145
  });
204940
205146
 
204941
205147
  // src/commands/lambda/_dimensions.ts
204942
- import { readFileSync as readFileSync86 } from "fs";
205148
+ import { readFileSync as readFileSync87 } from "fs";
204943
205149
  import { join as join129 } from "path";
204944
205150
  function warnOnDimensionMismatch(args) {
204945
205151
  if (args.quiet) return;
204946
205152
  if (args.outputResolution) return;
204947
205153
  let html;
204948
205154
  try {
204949
- html = readFileSync86(join129(args.projectDir, "index.html"), "utf-8");
205155
+ html = readFileSync87(join129(args.projectDir, "index.html"), "utf-8");
204950
205156
  } catch {
204951
205157
  return;
204952
205158
  }
@@ -205126,7 +205332,7 @@ __export(render_batch_exports, {
205126
205332
  runRenderBatch: () => runRenderBatch,
205127
205333
  runWithConcurrencyLimit: () => runWithConcurrencyLimit
205128
205334
  });
205129
- import { existsSync as existsSync123, readFileSync as readFileSync87 } from "fs";
205335
+ import { existsSync as existsSync123, readFileSync as readFileSync88 } from "fs";
205130
205336
  import { join as join131, resolve as resolvePath3 } from "path";
205131
205337
  async function loadSDK3() {
205132
205338
  return import("@hyperframes/aws-lambda/sdk");
@@ -205286,7 +205492,7 @@ function buildLambdaBatchRenderConfig(args) {
205286
205492
  return config;
205287
205493
  }
205288
205494
  function parseBatchFile(path2) {
205289
- const raw = readFileSync87(path2, "utf8");
205495
+ const raw = readFileSync88(path2, "utf8");
205290
205496
  const lines = raw.split(/\r?\n/);
205291
205497
  const out = [];
205292
205498
  for (let i2 = 0; i2 < lines.length; i2++) {
@@ -205480,7 +205686,7 @@ __export(policies_exports, {
205480
205686
  runPolicies: () => runPolicies,
205481
205687
  validatePolicy: () => validatePolicy
205482
205688
  });
205483
- import { readFileSync as readFileSync88 } from "fs";
205689
+ import { readFileSync as readFileSync89 } from "fs";
205484
205690
  function allRequiredActions() {
205485
205691
  const set = /* @__PURE__ */ new Set();
205486
205692
  for (const group of Object.values(REQUIRED_ACTIONS)) {
@@ -205586,7 +205792,7 @@ async function runPolicies(args) {
205586
205792
  }
205587
205793
  }
205588
205794
  function validatePolicy(policyPath) {
205589
- const raw = readFileSync88(policyPath, "utf-8");
205795
+ const raw = readFileSync89(policyPath, "utf-8");
205590
205796
  const parsed = JSON.parse(raw);
205591
205797
  const statements = Array.isArray(parsed.Statement) ? parsed.Statement : parsed.Statement ? [
205592
205798
  parsed.Statement
@@ -206197,9 +206403,9 @@ __export(cloudrun_exports, {
206197
206403
  missingCloudRunAdapterMessage: () => missingCloudRunAdapterMessage
206198
206404
  });
206199
206405
  import { spawnSync as spawnSync6 } from "child_process";
206200
- import { existsSync as existsSync124, mkdirSync as mkdirSync63, readFileSync as readFileSync89, writeFileSync as writeFileSync58 } from "fs";
206406
+ import { existsSync as existsSync124, mkdirSync as mkdirSync63, readFileSync as readFileSync90, writeFileSync as writeFileSync58 } from "fs";
206201
206407
  import { homedir as homedir23 } from "os";
206202
- import { join as join133, resolve as resolve77 } from "path";
206408
+ import { join as join133, resolve as resolve78 } from "path";
206203
206409
  function loadCloudRunAdapter() {
206204
206410
  cloudRunAdapterPromise ??= Promise.all([
206205
206411
  import("@hyperframes/gcp-cloud-run/sdk"),
@@ -206235,7 +206441,7 @@ function readState2(args) {
206235
206441
  let base2 = {};
206236
206442
  if (existsSync124(statePath())) {
206237
206443
  try {
206238
- base2 = JSON.parse(readFileSync89(statePath(), "utf8"));
206444
+ base2 = JSON.parse(readFileSync90(statePath(), "utf8"));
206239
206445
  } catch {
206240
206446
  }
206241
206447
  }
@@ -206377,7 +206583,7 @@ function machineVars(args, project, region, image) {
206377
206583
  return vars;
206378
206584
  }
206379
206585
  function findRepoRoot(tfDir) {
206380
- const candidate = resolve77(tfDir, "..", "..", "..");
206586
+ const candidate = resolve78(tfDir, "..", "..", "..");
206381
206587
  if (existsSync124(join133(candidate, "packages", "gcp-cloud-run", "Dockerfile"))) return candidate;
206382
206588
  return null;
206383
206589
  }
@@ -206412,7 +206618,7 @@ async function runSites(args) {
206412
206618
  const state = readState2(args);
206413
206619
  const { deploySite } = await loadCloudRunAdapter();
206414
206620
  const handle = await deploySite({
206415
- projectDir: resolve77(projectDir),
206621
+ projectDir: resolve78(projectDir),
206416
206622
  bucketName: state.bucketName,
206417
206623
  siteId: args["site-id"]
206418
206624
  });
@@ -206447,11 +206653,11 @@ async function runRender2(args) {
206447
206653
  }
206448
206654
  const fps = resolveCloudRunFps(args, projectDir, "render");
206449
206655
  const state = readState2(args);
206450
- const variables = resolveAndValidateVariables(args, resolve77(projectDir));
206656
+ const variables = resolveAndValidateVariables(args, resolve78(projectDir));
206451
206657
  const config = buildRenderConfig(args, fps, width, height, variables);
206452
206658
  const { renderToCloudRun, getRenderProgress } = await loadCloudRunAdapter();
206453
206659
  const handle = await renderToCloudRun({
206454
- projectDir: resolve77(projectDir),
206660
+ projectDir: resolve78(projectDir),
206455
206661
  config,
206456
206662
  bucketName: state.bucketName,
206457
206663
  projectId: state.projectId,
@@ -206527,11 +206733,11 @@ async function runRenderBatch2(args) {
206527
206733
  failCommand();
206528
206734
  }
206529
206735
  const fps = resolveCloudRunFps(args, projectDir, "render-batch");
206530
- if (!existsSync124(resolve77(batchPath))) {
206736
+ if (!existsSync124(resolve78(batchPath))) {
206531
206737
  console.error(`[cloudrun render-batch] batch file not found: ${batchPath}`);
206532
206738
  failCommand();
206533
206739
  }
206534
- const entries2 = parseBatchFile2(resolve77(batchPath));
206740
+ const entries2 = parseBatchFile2(resolve78(batchPath));
206535
206741
  if (entries2.length === 0) {
206536
206742
  console.error("[cloudrun render-batch] batch file has no entries.");
206537
206743
  failCommand();
@@ -206550,7 +206756,7 @@ async function runRenderBatch2(args) {
206550
206756
  const maxConcurrent = parsePositiveInt2(args["max-concurrent"], "--max-concurrent") ?? DEFAULT_BATCH_MAX_CONCURRENT;
206551
206757
  const { deploySite, renderToCloudRun } = await loadCloudRunAdapter();
206552
206758
  const siteHandle = await deploySite({
206553
- projectDir: resolve77(projectDir),
206759
+ projectDir: resolve78(projectDir),
206554
206760
  bucketName: state.bucketName,
206555
206761
  siteId: args["site-id"]
206556
206762
  });
@@ -206594,7 +206800,7 @@ async function runRenderBatch2(args) {
206594
206800
  if (failed.length > 0) failCommand();
206595
206801
  }
206596
206802
  function parseBatchFile2(path2) {
206597
- const lines = readFileSync89(path2, "utf8").split(/\r?\n/);
206803
+ const lines = readFileSync90(path2, "utf8").split(/\r?\n/);
206598
206804
  const entries2 = [];
206599
206805
  lines.forEach((line2, idx) => {
206600
206806
  const trimmed = line2.trim();
@@ -206619,7 +206825,7 @@ function parseBatchFile2(path2) {
206619
206825
  async function runDestroy2(args) {
206620
206826
  const { getTerraformModuleDir } = await loadCloudRunAdapter();
206621
206827
  const tfDir = getTerraformModuleDir();
206622
- const state = existsSync124(statePath()) ? JSON.parse(readFileSync89(statePath(), "utf8")) : {};
206828
+ const state = existsSync124(statePath()) ? JSON.parse(readFileSync90(statePath(), "utf8")) : {};
206623
206829
  const project = args.project ?? state.projectId;
206624
206830
  const region = args.region ?? state.region ?? "us-central1";
206625
206831
  const image = args.image ?? "unused:latest";
@@ -206921,7 +207127,7 @@ ${HELP2}`);
206921
207127
  });
206922
207128
 
206923
207129
  // src/cloud/detectAspectRatio.ts
206924
- import { readFileSync as readFileSync90 } from "fs";
207130
+ import { readFileSync as readFileSync91 } from "fs";
206925
207131
  function extractAttributeNumber(tag, re2) {
206926
207132
  const match = tag.match(re2);
206927
207133
  if (!match) return null;
@@ -206933,7 +207139,7 @@ function extractAttributeNumber(tag, re2) {
206933
207139
  function detectAspectRatioFromHtml(entryHtmlPath) {
206934
207140
  let html;
206935
207141
  try {
206936
- html = readFileSync90(entryHtmlPath, "utf-8");
207142
+ html = readFileSync91(entryHtmlPath, "utf-8");
206937
207143
  } catch (err) {
206938
207144
  return { kind: "read-error", error: normalizeErrorMessage(err) };
206939
207145
  }
@@ -207003,14 +207209,14 @@ function signalAbortError(signal) {
207003
207209
  return reason instanceof Error ? reason : new Error("Poll aborted");
207004
207210
  }
207005
207211
  function defaultAbortableSleep(signal) {
207006
- return (ms) => new Promise((resolve78, reject2) => {
207212
+ return (ms) => new Promise((resolve79, reject2) => {
207007
207213
  const onAbort = () => {
207008
207214
  clearTimeout(timer);
207009
207215
  reject2(signalAbortError(signal));
207010
207216
  };
207011
207217
  const timer = setTimeout(() => {
207012
207218
  signal?.removeEventListener("abort", onAbort);
207013
- resolve78();
207219
+ resolve79();
207014
207220
  }, ms);
207015
207221
  signal?.addEventListener("abort", onAbort, { once: true });
207016
207222
  });
@@ -207085,7 +207291,7 @@ async function downloadToFile(url, destPath, options = {}) {
207085
207291
  return { path: destPath, bytes };
207086
207292
  }
207087
207293
  function waitForDrain(file, signal) {
207088
- return new Promise((resolve78, reject2) => {
207294
+ return new Promise((resolve79, reject2) => {
207089
207295
  const cleanup = () => {
207090
207296
  file.off("drain", onDrain);
207091
207297
  file.off("error", onError);
@@ -207094,7 +207300,7 @@ function waitForDrain(file, signal) {
207094
207300
  };
207095
207301
  const onDrain = () => {
207096
207302
  cleanup();
207097
- resolve78();
207303
+ resolve79();
207098
207304
  };
207099
207305
  const onError = (err) => {
207100
207306
  cleanup();
@@ -207116,10 +207322,10 @@ function waitForDrain(file, signal) {
207116
207322
  });
207117
207323
  }
207118
207324
  function closeFile(file) {
207119
- return new Promise((resolve78) => {
207325
+ return new Promise((resolve79) => {
207120
207326
  const done = () => {
207121
207327
  file.off("error", done);
207122
- resolve78();
207328
+ resolve79();
207123
207329
  };
207124
207330
  file.once("error", done);
207125
207331
  file.end(() => done());
@@ -207640,7 +207846,7 @@ __export(render_exports3, {
207640
207846
  validateDryRunSource: () => validateDryRunSource,
207641
207847
  validateResolutionFormatCombo: () => validateResolutionFormatCombo
207642
207848
  });
207643
- import { isAbsolute as isAbsolute17, relative as relative28, resolve as resolvePath4 } from "path";
207849
+ import { isAbsolute as isAbsolute18, relative as relative29, resolve as resolvePath4 } from "path";
207644
207850
  import { existsSync as existsSync125 } from "fs";
207645
207851
  function parsePollIntervalMs(raw) {
207646
207852
  const n2 = parseNumericFlag(raw, { flag: "--poll-interval", min: 1 });
@@ -207766,7 +207972,7 @@ function prepareLocalArchive(source, composition, asJson) {
207766
207972
  }
207767
207973
  try {
207768
207974
  const fileMap = buildPublishFileMap(project.dir);
207769
- const entryPath = relative28(
207975
+ const entryPath = relative29(
207770
207976
  project.dir,
207771
207977
  resolvePath4(project.dir, composition ?? "index.html")
207772
207978
  ).replaceAll("\\", "/");
@@ -207951,7 +208157,7 @@ function handleFailedRender(detail, asJson) {
207951
208157
  }
207952
208158
  function resolveOutputPath2(output, renderId, format) {
207953
208159
  if (output) {
207954
- return isAbsolute17(output) ? output : resolvePath4(process.cwd(), output);
208160
+ return isAbsolute18(output) ? output : resolvePath4(process.cwd(), output);
207955
208161
  }
207956
208162
  const ext = FORMAT_EXT2[format] ?? `.${format}`;
207957
208163
  return resolvePath4(process.cwd(), "renders", `${renderId}${ext}`);
@@ -208912,7 +209118,7 @@ async function collectApiKey(inline) {
208912
209118
  return await promptForKey();
208913
209119
  }
208914
209120
  async function readAllWithTimeout(stream, timeoutMs) {
208915
- return await new Promise((resolve78, reject2) => {
209121
+ return await new Promise((resolve79, reject2) => {
208916
209122
  const chunks = [];
208917
209123
  const timer = setTimeout(() => {
208918
209124
  reject2(new Error(`Timed out waiting for stdin (${timeoutMs}ms). Pipe the key explicitly.`));
@@ -208922,7 +209128,7 @@ async function readAllWithTimeout(stream, timeoutMs) {
208922
209128
  });
208923
209129
  stream.on("end", () => {
208924
209130
  clearTimeout(timer);
208925
- resolve78(Buffer.concat(chunks).toString("utf8"));
209131
+ resolve79(Buffer.concat(chunks).toString("utf8"));
208926
209132
  });
208927
209133
  stream.on("error", (err) => {
208928
209134
  clearTimeout(timer);
@@ -209313,8 +209519,8 @@ async function confirmInteractive(prompt) {
209313
209519
  if (!process.stdin.isTTY) return false;
209314
209520
  const { createInterface: createInterface3 } = await import("readline");
209315
209521
  const rl = createInterface3({ input: process.stdin, output: process.stdout });
209316
- const answer = await new Promise((resolve78) => {
209317
- rl.question(prompt, (line2) => resolve78(line2));
209522
+ const answer = await new Promise((resolve79) => {
209523
+ rl.question(prompt, (line2) => resolve79(line2));
209318
209524
  });
209319
209525
  rl.close();
209320
209526
  return /^y(es)?$/i.test(answer.trim());
@@ -209752,12 +209958,12 @@ var init_freeze = __esm({
209752
209958
  });
209753
209959
 
209754
209960
  // ../core/dist/figma/jsonl.js
209755
- import { existsSync as existsSync126, readFileSync as readFileSync91 } from "fs";
209961
+ import { existsSync as existsSync126, readFileSync as readFileSync93 } from "fs";
209756
209962
  function readJsonlValues(path2) {
209757
209963
  if (!existsSync126(path2))
209758
209964
  return [];
209759
209965
  const out = [];
209760
- for (const line2 of readFileSync91(path2, "utf8").split(/\r?\n/)) {
209966
+ for (const line2 of readFileSync93(path2, "utf8").split(/\r?\n/)) {
209761
209967
  const trimmed = line2.trim();
209762
209968
  if (trimmed.length === 0)
209763
209969
  continue;
@@ -209776,7 +209982,7 @@ var init_jsonl = __esm({
209776
209982
  });
209777
209983
 
209778
209984
  // ../core/dist/figma/manifest.js
209779
- import { appendFileSync as appendFileSync2, existsSync as existsSync127, mkdirSync as mkdirSync66, readFileSync as readFileSync93, writeFileSync as writeFileSync60 } from "fs";
209985
+ import { appendFileSync as appendFileSync2, existsSync as existsSync127, mkdirSync as mkdirSync66, readFileSync as readFileSync94, writeFileSync as writeFileSync60 } from "fs";
209780
209986
  import { join as join134 } from "path";
209781
209987
  function mediaDir(projectDir) {
209782
209988
  return join134(projectDir, ".media");
@@ -209817,7 +210023,7 @@ function findAllByFigmaNode(projectDir, fileKey2, nodeId) {
209817
210023
  }
209818
210024
  function updateRecord(projectDir, record) {
209819
210025
  const p2 = manifestPath(projectDir);
209820
- const lines = readFileSync93(p2, "utf8").split(/\r?\n/);
210026
+ const lines = readFileSync94(p2, "utf8").split(/\r?\n/);
209821
210027
  const out = lines.map((line2) => {
209822
210028
  const trimmed = line2.trim();
209823
210029
  if (trimmed.length === 0)
@@ -209838,7 +210044,7 @@ function nextId(projectDir, type) {
209838
210044
  const p2 = manifestPath(projectDir);
209839
210045
  if (!existsSync127(p2))
209840
210046
  return `${type}_001`;
209841
- for (const line2 of readFileSync93(p2, "utf8").split(/\r?\n/)) {
210047
+ for (const line2 of readFileSync94(p2, "utf8").split(/\r?\n/)) {
209842
210048
  const trimmed = line2.trim();
209843
210049
  if (trimmed.length === 0)
209844
210050
  continue;
@@ -210592,7 +210798,7 @@ __export(asset_exports, {
210592
210798
  runAssetImportMany: () => runAssetImportMany
210593
210799
  });
210594
210800
  import { existsSync as existsSync128 } from "fs";
210595
- import { join as join137, relative as relative29 } from "path";
210801
+ import { join as join137, relative as relative30 } from "path";
210596
210802
  function gatherAssetRefs(positionals) {
210597
210803
  return positionals.flatMap((r2) => /^https?:/i.test(r2.trim()) ? [r2] : r2.split(",")).map((r2) => r2.trim()).filter((r2) => r2.length > 0);
210598
210804
  }
@@ -210634,7 +210840,7 @@ async function freezeAndRecord(fileKey2, nodeId, url, ext, opts, version2, deps,
210634
210840
  const record = {
210635
210841
  id,
210636
210842
  type: "image",
210637
- path: relative29(deps.projectDir, destAbs),
210843
+ path: relative30(deps.projectDir, destAbs),
210638
210844
  source: `figma:${fileKey2}/${nodeId}`,
210639
210845
  ...description !== void 0 && { description },
210640
210846
  ...entity !== void 0 && { entity },
@@ -210878,7 +211084,7 @@ __export(component_exports, {
210878
211084
  runComponentImport: () => runComponentImport
210879
211085
  });
210880
211086
  import { existsSync as existsSync129, mkdirSync as mkdirSync69, writeFileSync as writeFileSync65 } from "fs";
210881
- import { join as join139, relative as relative30 } from "path";
211087
+ import { join as join139, relative as relative31 } from "path";
210882
211088
  function escapeAttr2(value) {
210883
211089
  return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
210884
211090
  }
@@ -210928,7 +211134,7 @@ async function runComponentImport(refInput, deps) {
210928
211134
  );
210929
211135
  return {
210930
211136
  name,
210931
- htmlPath: relative30(deps.projectDir, htmlFile),
211137
+ htmlPath: relative31(deps.projectDir, htmlFile),
210932
211138
  unresolved: bindings.unresolved,
210933
211139
  rasterized: mapped.rasterize,
210934
211140
  failedRasterize
@@ -210948,7 +211154,7 @@ async function rasterizeFallback(mapped, fileKey2, componentDir, deps) {
210948
211154
  continue;
210949
211155
  }
210950
211156
  frozenAssets.push(asset.record.path);
210951
- const srcRel = relative30(componentDir, join139(deps.projectDir, asset.record.path)).replaceAll(
211157
+ const srcRel = relative31(componentDir, join139(deps.projectDir, asset.record.path)).replaceAll(
210952
211158
  "\\",
210953
211159
  "/"
210954
211160
  );
@@ -211569,10 +211775,10 @@ if (rootVersionRequested) {
211569
211775
  process.exit(0);
211570
211776
  }
211571
211777
  try {
211572
- const { readFileSync: readFileSync94 } = await import("fs");
211573
- const { resolve: resolve78 } = await import("path");
211574
- const envPath = resolve78(process.cwd(), ".env");
211575
- const envContent = readFileSync94(envPath, "utf-8");
211778
+ const { readFileSync: readFileSync95 } = await import("fs");
211779
+ const { resolve: resolve79 } = await import("path");
211780
+ const envPath = resolve79(process.cwd(), ".env");
211781
+ const envContent = readFileSync95(envPath, "utf-8");
211576
211782
  for (const rawLine of envContent.split("\n")) {
211577
211783
  let line2 = rawLine.trim();
211578
211784
  if (!line2 || line2.startsWith("#")) continue;