hyperframes 0.8.62 → 0.8.64

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.
@@ -313,28 +313,28 @@ var init_decode = __esm({
313
313
  * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
314
314
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
315
315
  */
316
- write(input, offset2) {
316
+ write(input, offset3) {
317
317
  switch (this.state) {
318
318
  case EntityDecoderState.EntityStart: {
319
- if (input.charCodeAt(offset2) === CharCodes.NUM) {
319
+ if (input.charCodeAt(offset3) === CharCodes.NUM) {
320
320
  this.state = EntityDecoderState.NumericStart;
321
321
  this.consumed += 1;
322
- return this.stateNumericStart(input, offset2 + 1);
322
+ return this.stateNumericStart(input, offset3 + 1);
323
323
  }
324
324
  this.state = EntityDecoderState.NamedEntity;
325
- return this.stateNamedEntity(input, offset2);
325
+ return this.stateNamedEntity(input, offset3);
326
326
  }
327
327
  case EntityDecoderState.NumericStart: {
328
- return this.stateNumericStart(input, offset2);
328
+ return this.stateNumericStart(input, offset3);
329
329
  }
330
330
  case EntityDecoderState.NumericDecimal: {
331
- return this.stateNumericDecimal(input, offset2);
331
+ return this.stateNumericDecimal(input, offset3);
332
332
  }
333
333
  case EntityDecoderState.NumericHex: {
334
- return this.stateNumericHex(input, offset2);
334
+ return this.stateNumericHex(input, offset3);
335
335
  }
336
336
  case EntityDecoderState.NamedEntity: {
337
- return this.stateNamedEntity(input, offset2);
337
+ return this.stateNamedEntity(input, offset3);
338
338
  }
339
339
  }
340
340
  }
@@ -347,17 +347,17 @@ var init_decode = __esm({
347
347
  * @param offset The current offset.
348
348
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
349
349
  */
350
- stateNumericStart(input, offset2) {
351
- if (offset2 >= input.length) {
350
+ stateNumericStart(input, offset3) {
351
+ if (offset3 >= input.length) {
352
352
  return -1;
353
353
  }
354
- if ((input.charCodeAt(offset2) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
354
+ if ((input.charCodeAt(offset3) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
355
355
  this.state = EntityDecoderState.NumericHex;
356
356
  this.consumed += 1;
357
- return this.stateNumericHex(input, offset2 + 1);
357
+ return this.stateNumericHex(input, offset3 + 1);
358
358
  }
359
359
  this.state = EntityDecoderState.NumericDecimal;
360
- return this.stateNumericDecimal(input, offset2);
360
+ return this.stateNumericDecimal(input, offset3);
361
361
  }
362
362
  /**
363
363
  * Parses a hexadecimal numeric entity.
@@ -368,14 +368,14 @@ var init_decode = __esm({
368
368
  * @param offset The current offset.
369
369
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
370
370
  */
371
- stateNumericHex(input, offset2) {
372
- while (offset2 < input.length) {
373
- const char = input.charCodeAt(offset2);
371
+ stateNumericHex(input, offset3) {
372
+ while (offset3 < input.length) {
373
+ const char = input.charCodeAt(offset3);
374
374
  if (isNumber(char) || isHexadecimalCharacter(char)) {
375
375
  const digit = char <= CharCodes.NINE ? char - CharCodes.ZERO : (char | TO_LOWER_BIT) - CharCodes.LOWER_A + 10;
376
376
  this.result = this.result * 16 + digit;
377
377
  this.consumed++;
378
- offset2++;
378
+ offset3++;
379
379
  } else {
380
380
  return this.emitNumericEntity(char, 3);
381
381
  }
@@ -391,13 +391,13 @@ var init_decode = __esm({
391
391
  * @param offset The current offset.
392
392
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
393
393
  */
394
- stateNumericDecimal(input, offset2) {
395
- while (offset2 < input.length) {
396
- const char = input.charCodeAt(offset2);
394
+ stateNumericDecimal(input, offset3) {
395
+ while (offset3 < input.length) {
396
+ const char = input.charCodeAt(offset3);
397
397
  if (isNumber(char)) {
398
398
  this.result = this.result * 10 + (char - CharCodes.ZERO);
399
399
  this.consumed++;
400
- offset2++;
400
+ offset3++;
401
401
  } else {
402
402
  return this.emitNumericEntity(char, 2);
403
403
  }
@@ -446,34 +446,34 @@ var init_decode = __esm({
446
446
  * @param offset The current offset.
447
447
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
448
448
  */
449
- stateNamedEntity(input, offset2) {
449
+ stateNamedEntity(input, offset3) {
450
450
  const { decodeTree } = this;
451
451
  let current2 = decodeTree[this.treeIndex];
452
452
  let valueLength = (current2 & BinTrieFlags.VALUE_LENGTH) >> 14;
453
- while (offset2 < input.length) {
453
+ while (offset3 < input.length) {
454
454
  if (valueLength === 0 && (current2 & BinTrieFlags.FLAG13) !== 0) {
455
455
  const runLength = (current2 & BinTrieFlags.BRANCH_LENGTH) >> 7;
456
456
  if (this.runConsumed === 0) {
457
457
  const firstChar = current2 & BinTrieFlags.JUMP_TABLE;
458
- if (input.charCodeAt(offset2) !== firstChar) {
458
+ if (input.charCodeAt(offset3) !== firstChar) {
459
459
  return this.result === 0 ? 0 : this.emitNotTerminatedNamedEntity();
460
460
  }
461
- offset2++;
461
+ offset3++;
462
462
  this.excess++;
463
463
  this.runConsumed++;
464
464
  }
465
465
  while (this.runConsumed < runLength) {
466
- if (offset2 >= input.length) {
466
+ if (offset3 >= input.length) {
467
467
  return -1;
468
468
  }
469
469
  const charIndexInPacked = this.runConsumed - 1;
470
470
  const packedWord = decodeTree[this.treeIndex + 1 + (charIndexInPacked >> 1)];
471
471
  const expectedChar = charIndexInPacked % 2 === 0 ? packedWord & 255 : packedWord >> 8 & 255;
472
- if (input.charCodeAt(offset2) !== expectedChar) {
472
+ if (input.charCodeAt(offset3) !== expectedChar) {
473
473
  this.runConsumed = 0;
474
474
  return this.result === 0 ? 0 : this.emitNotTerminatedNamedEntity();
475
475
  }
476
- offset2++;
476
+ offset3++;
477
477
  this.excess++;
478
478
  this.runConsumed++;
479
479
  }
@@ -482,9 +482,9 @@ var init_decode = __esm({
482
482
  current2 = decodeTree[this.treeIndex];
483
483
  valueLength = (current2 & BinTrieFlags.VALUE_LENGTH) >> 14;
484
484
  }
485
- if (offset2 >= input.length)
485
+ if (offset3 >= input.length)
486
486
  break;
487
- const char = input.charCodeAt(offset2);
487
+ const char = input.charCodeAt(offset3);
488
488
  if (char === CharCodes.SEMI && valueLength !== 0 && (current2 & BinTrieFlags.FLAG13) !== 0) {
489
489
  return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
490
490
  }
@@ -507,7 +507,7 @@ var init_decode = __esm({
507
507
  this.excess = 0;
508
508
  }
509
509
  }
510
- offset2++;
510
+ offset3++;
511
511
  this.excess++;
512
512
  }
513
513
  return -1;
@@ -856,10 +856,10 @@ var init_Tokenizer = __esm({
856
856
  isTagStartChar(c) {
857
857
  return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);
858
858
  }
859
- startSpecial(sequence, offset2) {
859
+ startSpecial(sequence, offset3) {
860
860
  this.isSpecial = true;
861
861
  this.currentSequence = sequence;
862
- this.sequenceIndex = offset2;
862
+ this.sequenceIndex = offset3;
863
863
  this.state = State.SpecialStartSequence;
864
864
  }
865
865
  stateBeforeTagName(c) {
@@ -1588,18 +1588,18 @@ var init_Parser = __esm({
1588
1588
  this.startIndex = endIndex + 1;
1589
1589
  }
1590
1590
  /** @internal */
1591
- oncomment(start, endIndex, offset2) {
1591
+ oncomment(start, endIndex, offset3) {
1592
1592
  var _a3, _b, _c, _d;
1593
1593
  this.endIndex = endIndex;
1594
- (_b = (_a3 = this.cbs).oncomment) === null || _b === void 0 ? void 0 : _b.call(_a3, this.getSlice(start, endIndex - offset2));
1594
+ (_b = (_a3 = this.cbs).oncomment) === null || _b === void 0 ? void 0 : _b.call(_a3, this.getSlice(start, endIndex - offset3));
1595
1595
  (_d = (_c = this.cbs).oncommentend) === null || _d === void 0 ? void 0 : _d.call(_c);
1596
1596
  this.startIndex = endIndex + 1;
1597
1597
  }
1598
1598
  /** @internal */
1599
- oncdata(start, endIndex, offset2) {
1599
+ oncdata(start, endIndex, offset3) {
1600
1600
  var _a3, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1601
1601
  this.endIndex = endIndex;
1602
- const value = this.getSlice(start, endIndex - offset2);
1602
+ const value = this.getSlice(start, endIndex - offset3);
1603
1603
  if (!this.htmlMode || this.options.recognizeCDATA) {
1604
1604
  (_b = (_a3 = this.cbs).oncdatastart) === null || _b === void 0 ? void 0 : _b.call(_a3);
1605
1605
  (_d = (_c = this.cbs).ontext) === null || _d === void 0 ? void 0 : _d.call(_c, value);
@@ -2297,21 +2297,21 @@ function getDecoder(decodeTree) {
2297
2297
  const decoder = new EntityDecoder2(decodeTree, (str) => ret += fromCodePoint2(str));
2298
2298
  return function decodeWithTrie(str, decodeMode) {
2299
2299
  let lastIndex = 0;
2300
- let offset2 = 0;
2301
- while ((offset2 = str.indexOf("&", offset2)) >= 0) {
2302
- ret += str.slice(lastIndex, offset2);
2300
+ let offset3 = 0;
2301
+ while ((offset3 = str.indexOf("&", offset3)) >= 0) {
2302
+ ret += str.slice(lastIndex, offset3);
2303
2303
  decoder.startEntity(decodeMode);
2304
2304
  const len = decoder.write(
2305
2305
  str,
2306
2306
  // Skip the "&"
2307
- offset2 + 1
2307
+ offset3 + 1
2308
2308
  );
2309
2309
  if (len < 0) {
2310
- lastIndex = offset2 + decoder.end();
2310
+ lastIndex = offset3 + decoder.end();
2311
2311
  break;
2312
2312
  }
2313
- lastIndex = offset2 + len;
2314
- offset2 = len === 0 ? lastIndex + 1 : lastIndex;
2313
+ lastIndex = offset3 + len;
2314
+ offset3 = len === 0 ? lastIndex + 1 : lastIndex;
2315
2315
  }
2316
2316
  const result = ret + str.slice(lastIndex);
2317
2317
  ret = "";
@@ -2415,28 +2415,28 @@ var init_decode2 = __esm({
2415
2415
  * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
2416
2416
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
2417
2417
  */
2418
- write(str, offset2) {
2418
+ write(str, offset3) {
2419
2419
  switch (this.state) {
2420
2420
  case EntityDecoderState2.EntityStart: {
2421
- if (str.charCodeAt(offset2) === CharCodes3.NUM) {
2421
+ if (str.charCodeAt(offset3) === CharCodes3.NUM) {
2422
2422
  this.state = EntityDecoderState2.NumericStart;
2423
2423
  this.consumed += 1;
2424
- return this.stateNumericStart(str, offset2 + 1);
2424
+ return this.stateNumericStart(str, offset3 + 1);
2425
2425
  }
2426
2426
  this.state = EntityDecoderState2.NamedEntity;
2427
- return this.stateNamedEntity(str, offset2);
2427
+ return this.stateNamedEntity(str, offset3);
2428
2428
  }
2429
2429
  case EntityDecoderState2.NumericStart: {
2430
- return this.stateNumericStart(str, offset2);
2430
+ return this.stateNumericStart(str, offset3);
2431
2431
  }
2432
2432
  case EntityDecoderState2.NumericDecimal: {
2433
- return this.stateNumericDecimal(str, offset2);
2433
+ return this.stateNumericDecimal(str, offset3);
2434
2434
  }
2435
2435
  case EntityDecoderState2.NumericHex: {
2436
- return this.stateNumericHex(str, offset2);
2436
+ return this.stateNumericHex(str, offset3);
2437
2437
  }
2438
2438
  case EntityDecoderState2.NamedEntity: {
2439
- return this.stateNamedEntity(str, offset2);
2439
+ return this.stateNamedEntity(str, offset3);
2440
2440
  }
2441
2441
  }
2442
2442
  }
@@ -2449,17 +2449,17 @@ var init_decode2 = __esm({
2449
2449
  * @param offset The current offset.
2450
2450
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
2451
2451
  */
2452
- stateNumericStart(str, offset2) {
2453
- if (offset2 >= str.length) {
2452
+ stateNumericStart(str, offset3) {
2453
+ if (offset3 >= str.length) {
2454
2454
  return -1;
2455
2455
  }
2456
- if ((str.charCodeAt(offset2) | TO_LOWER_BIT2) === CharCodes3.LOWER_X) {
2456
+ if ((str.charCodeAt(offset3) | TO_LOWER_BIT2) === CharCodes3.LOWER_X) {
2457
2457
  this.state = EntityDecoderState2.NumericHex;
2458
2458
  this.consumed += 1;
2459
- return this.stateNumericHex(str, offset2 + 1);
2459
+ return this.stateNumericHex(str, offset3 + 1);
2460
2460
  }
2461
2461
  this.state = EntityDecoderState2.NumericDecimal;
2462
- return this.stateNumericDecimal(str, offset2);
2462
+ return this.stateNumericDecimal(str, offset3);
2463
2463
  }
2464
2464
  addToNumericResult(str, start, end, base2) {
2465
2465
  if (start !== end) {
@@ -2477,18 +2477,18 @@ var init_decode2 = __esm({
2477
2477
  * @param offset The current offset.
2478
2478
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
2479
2479
  */
2480
- stateNumericHex(str, offset2) {
2481
- const startIdx = offset2;
2482
- while (offset2 < str.length) {
2483
- const char = str.charCodeAt(offset2);
2480
+ stateNumericHex(str, offset3) {
2481
+ const startIdx = offset3;
2482
+ while (offset3 < str.length) {
2483
+ const char = str.charCodeAt(offset3);
2484
2484
  if (isNumber2(char) || isHexadecimalCharacter2(char)) {
2485
- offset2 += 1;
2485
+ offset3 += 1;
2486
2486
  } else {
2487
- this.addToNumericResult(str, startIdx, offset2, 16);
2487
+ this.addToNumericResult(str, startIdx, offset3, 16);
2488
2488
  return this.emitNumericEntity(char, 3);
2489
2489
  }
2490
2490
  }
2491
- this.addToNumericResult(str, startIdx, offset2, 16);
2491
+ this.addToNumericResult(str, startIdx, offset3, 16);
2492
2492
  return -1;
2493
2493
  }
2494
2494
  /**
@@ -2500,18 +2500,18 @@ var init_decode2 = __esm({
2500
2500
  * @param offset The current offset.
2501
2501
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
2502
2502
  */
2503
- stateNumericDecimal(str, offset2) {
2504
- const startIdx = offset2;
2505
- while (offset2 < str.length) {
2506
- const char = str.charCodeAt(offset2);
2503
+ stateNumericDecimal(str, offset3) {
2504
+ const startIdx = offset3;
2505
+ while (offset3 < str.length) {
2506
+ const char = str.charCodeAt(offset3);
2507
2507
  if (isNumber2(char)) {
2508
- offset2 += 1;
2508
+ offset3 += 1;
2509
2509
  } else {
2510
- this.addToNumericResult(str, startIdx, offset2, 10);
2510
+ this.addToNumericResult(str, startIdx, offset3, 10);
2511
2511
  return this.emitNumericEntity(char, 2);
2512
2512
  }
2513
2513
  }
2514
- this.addToNumericResult(str, startIdx, offset2, 10);
2514
+ this.addToNumericResult(str, startIdx, offset3, 10);
2515
2515
  return -1;
2516
2516
  }
2517
2517
  /**
@@ -2556,12 +2556,12 @@ var init_decode2 = __esm({
2556
2556
  * @param offset The current offset.
2557
2557
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
2558
2558
  */
2559
- stateNamedEntity(str, offset2) {
2559
+ stateNamedEntity(str, offset3) {
2560
2560
  const { decodeTree } = this;
2561
2561
  let current2 = decodeTree[this.treeIndex];
2562
2562
  let valueLength = (current2 & BinTrieFlags2.VALUE_LENGTH) >> 14;
2563
- for (; offset2 < str.length; offset2++, this.excess++) {
2564
- const char = str.charCodeAt(offset2);
2563
+ for (; offset3 < str.length; offset3++, this.excess++) {
2564
+ const char = str.charCodeAt(offset3);
2565
2565
  this.treeIndex = determineBranch2(decodeTree, current2, this.treeIndex + Math.max(1, valueLength), char);
2566
2566
  if (this.treeIndex < 0) {
2567
2567
  return this.result === 0 || // If we are parsing an attribute
@@ -5023,23 +5023,23 @@ var init_character_data = __esm({
5023
5023
  get length() {
5024
5024
  return this.data.length;
5025
5025
  }
5026
- substringData(offset2, count) {
5027
- return this.data.substr(offset2, count);
5026
+ substringData(offset3, count) {
5027
+ return this.data.substr(offset3, count);
5028
5028
  }
5029
5029
  appendData(data2) {
5030
5030
  this.data += data2;
5031
5031
  }
5032
- insertData(offset2, data2) {
5032
+ insertData(offset3, data2) {
5033
5033
  const { data: t } = this;
5034
- this.data = t.slice(0, offset2) + data2 + t.slice(offset2);
5034
+ this.data = t.slice(0, offset3) + data2 + t.slice(offset3);
5035
5035
  }
5036
- deleteData(offset2, count) {
5036
+ deleteData(offset3, count) {
5037
5037
  const { data: t } = this;
5038
- this.data = t.slice(0, offset2) + t.slice(offset2 + count);
5038
+ this.data = t.slice(0, offset3) + t.slice(offset3 + count);
5039
5039
  }
5040
- replaceData(offset2, count, data2) {
5040
+ replaceData(offset3, count, data2) {
5041
5041
  const { data: t } = this;
5042
- this.data = t.slice(0, offset2) + data2 + t.slice(offset2 + count);
5042
+ this.data = t.slice(0, offset3) + data2 + t.slice(offset3 + count);
5043
5043
  }
5044
5044
  /* c8 ignore stop */
5045
5045
  toJSON() {
@@ -5186,17 +5186,17 @@ function parse(selector) {
5186
5186
  }
5187
5187
  function parseSelector(subselects2, selector, selectorIndex) {
5188
5188
  let tokens = [];
5189
- function getName3(offset2) {
5190
- const match = selector.slice(selectorIndex + offset2).match(reName);
5189
+ function getName3(offset3) {
5190
+ const match = selector.slice(selectorIndex + offset3).match(reName);
5191
5191
  if (!match) {
5192
5192
  throw new Error(`Expected name, found ${selector.slice(selectorIndex)}`);
5193
5193
  }
5194
5194
  const [name] = match;
5195
- selectorIndex += offset2 + name.length;
5195
+ selectorIndex += offset3 + name.length;
5196
5196
  return unescapeCSS(name);
5197
5197
  }
5198
- function stripWhitespace(offset2) {
5199
- selectorIndex += offset2;
5198
+ function stripWhitespace(offset3) {
5199
+ selectorIndex += offset3;
5200
5200
  while (selectorIndex < selector.length && isWhitespace2(selector.charCodeAt(selectorIndex))) {
5201
5201
  selectorIndex++;
5202
5202
  }
@@ -14223,9 +14223,9 @@ var require_path = __commonJS({
14223
14223
  };
14224
14224
  function emptyMoves() {
14225
14225
  }
14226
- function getMoves(path, offset2, start, end) {
14226
+ function getMoves(path, offset3, start, end) {
14227
14227
  isArray3.assert(path.value);
14228
- if (offset2 === 0) {
14228
+ if (offset3 === 0) {
14229
14229
  return emptyMoves;
14230
14230
  }
14231
14231
  var length = path.value.length;
@@ -14253,7 +14253,7 @@ var require_path = __commonJS({
14253
14253
  if (childPath.name !== i) {
14254
14254
  throw new Error("");
14255
14255
  }
14256
- var newIndex = i + offset2;
14256
+ var newIndex = i + offset3;
14257
14257
  childPath.name = newIndex;
14258
14258
  moves[newIndex] = childPath;
14259
14259
  delete cache2[i];
@@ -18177,13 +18177,13 @@ var require_source_map_consumer = __commonJS({
18177
18177
  if (s.url) {
18178
18178
  throw new Error("Support for url field in sections not implemented.");
18179
18179
  }
18180
- var offset2 = util.getArg(s, "offset");
18181
- var offsetLine = util.getArg(offset2, "line");
18182
- var offsetColumn = util.getArg(offset2, "column");
18180
+ var offset3 = util.getArg(s, "offset");
18181
+ var offsetLine = util.getArg(offset3, "line");
18182
+ var offsetColumn = util.getArg(offset3, "column");
18183
18183
  if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
18184
18184
  throw new Error("Section offsets must be ordered and non-overlapping.");
18185
18185
  }
18186
- lastOffset = offset2;
18186
+ lastOffset = offset3;
18187
18187
  return {
18188
18188
  generatedOffset: {
18189
18189
  // The offset fields are 0-based, but we use 1-based indices when
@@ -23628,16 +23628,16 @@ var require_esprima2 = __commonJS({
23628
23628
  }
23629
23629
  this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message);
23630
23630
  };
23631
- Scanner2.prototype.skipSingleLineComment = function(offset2) {
23631
+ Scanner2.prototype.skipSingleLineComment = function(offset3) {
23632
23632
  var comments = [];
23633
23633
  var start, loc;
23634
23634
  if (this.trackComment) {
23635
23635
  comments = [];
23636
- start = this.index - offset2;
23636
+ start = this.index - offset3;
23637
23637
  loc = {
23638
23638
  start: {
23639
23639
  line: this.lineNumber,
23640
- column: this.index - this.lineStart - offset2
23640
+ column: this.index - this.lineStart - offset3
23641
23641
  },
23642
23642
  end: {}
23643
23643
  };
@@ -23653,7 +23653,7 @@ var require_esprima2 = __commonJS({
23653
23653
  };
23654
23654
  var entry = {
23655
23655
  multiLine: false,
23656
- slice: [start + offset2, this.index - 1],
23656
+ slice: [start + offset3, this.index - 1],
23657
23657
  range: [start, this.index - 1],
23658
23658
  loc
23659
23659
  };
@@ -23674,7 +23674,7 @@ var require_esprima2 = __commonJS({
23674
23674
  };
23675
23675
  var entry = {
23676
23676
  multiLine: false,
23677
- slice: [start + offset2, this.index],
23677
+ slice: [start + offset3, this.index],
23678
23678
  range: [start, this.index],
23679
23679
  loc
23680
23680
  };
@@ -44193,11 +44193,11 @@ function codePointToString(code) {
44193
44193
  code -= 65536;
44194
44194
  return String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320);
44195
44195
  }
44196
- function getLineInfo(input, offset2) {
44196
+ function getLineInfo(input, offset3) {
44197
44197
  for (var line = 1, cur = 0; ; ) {
44198
- var nextBreak = nextLineBreak(input, cur, offset2);
44198
+ var nextBreak = nextLineBreak(input, cur, offset3);
44199
44199
  if (nextBreak < 0) {
44200
- return new Position(line, offset2 - cur);
44200
+ return new Position(line, offset3 - cur);
44201
44201
  }
44202
44202
  ++line;
44203
44203
  cur = nextBreak;
@@ -52939,16 +52939,16 @@ function readAscii(bytes, start, length) {
52939
52939
  }
52940
52940
  return value;
52941
52941
  }
52942
- function readU16LE(bytes, offset2) {
52943
- if (offset2 + 1 >= bytes.length)
52942
+ function readU16LE(bytes, offset3) {
52943
+ if (offset3 + 1 >= bytes.length)
52944
52944
  return null;
52945
- return (bytes[offset2] ?? 0) | (bytes[offset2 + 1] ?? 0) << 8;
52945
+ return (bytes[offset3] ?? 0) | (bytes[offset3 + 1] ?? 0) << 8;
52946
52946
  }
52947
52947
  function colorTableByteLength(packed) {
52948
52948
  return 3 * 2 ** ((packed & 7) + 1);
52949
52949
  }
52950
- function skipSubBlocks(bytes, offset2) {
52951
- let pos = offset2;
52950
+ function skipSubBlocks(bytes, offset3) {
52951
+ let pos = offset3;
52952
52952
  while (pos < bytes.length) {
52953
52953
  const size = bytes[pos];
52954
52954
  if (size === void 0)
@@ -52960,12 +52960,12 @@ function skipSubBlocks(bytes, offset2) {
52960
52960
  }
52961
52961
  return null;
52962
52962
  }
52963
- function parseApplicationExtension(bytes, offset2) {
52964
- const blockSize = bytes[offset2];
52965
- if (blockSize === void 0 || offset2 + 1 + blockSize > bytes.length)
52963
+ function parseApplicationExtension(bytes, offset3) {
52964
+ const blockSize = bytes[offset3];
52965
+ if (blockSize === void 0 || offset3 + 1 + blockSize > bytes.length)
52966
52966
  return null;
52967
- const appId = readAscii(bytes, offset2 + 1, blockSize);
52968
- let pos = offset2 + 1 + blockSize;
52967
+ const appId = readAscii(bytes, offset3 + 1, blockSize);
52968
+ let pos = offset3 + 1 + blockSize;
52969
52969
  let loopCount = null;
52970
52970
  while (pos < bytes.length) {
52971
52971
  const size = bytes[pos];
@@ -54400,6 +54400,588 @@ var init_canaryRegistry = __esm({
54400
54400
  }
54401
54401
  });
54402
54402
 
54403
+ // ../core/dist/vfx/fractalNoise.frag.js
54404
+ var HASH_CONSTANTS, mulX, mulY, mulMix, offset2, shift1, shift2, divisor, MAX_OCTAVES, FRACTAL_NOISE_FRAG;
54405
+ var init_fractalNoise_frag = __esm({
54406
+ "../core/dist/vfx/fractalNoise.frag.js"() {
54407
+ "use strict";
54408
+ HASH_CONSTANTS = {
54409
+ /** Odd 32-bit multipliers, one per lattice axis plus one for the seed. */
54410
+ mulX: 374761393,
54411
+ mulY: 668265263,
54412
+ mulMix: 1274126177,
54413
+ /** 2^32/φ — breaks the all-zero fixed point at lattice corner (0, 0). */
54414
+ offset: 2654435769,
54415
+ shift1: 13,
54416
+ shift2: 16,
54417
+ /** 2^32: maps the mixed 32-bit word into [0, 1). */
54418
+ divisor: 4294967296
54419
+ };
54420
+ ({ mulX, mulY, mulMix, offset: offset2, shift1, shift2, divisor } = HASH_CONSTANTS);
54421
+ MAX_OCTAVES = 20;
54422
+ FRACTAL_NOISE_FRAG = `#version 300 es
54423
+ precision highp float;
54424
+ precision highp int;
54425
+
54426
+ in vec2 v_uv;
54427
+ out vec4 fragColor;
54428
+
54429
+ uniform vec2 u_size;
54430
+ uniform float u_t;
54431
+ uniform float u_fps;
54432
+ uniform float u_fractalType;
54433
+ uniform float u_noiseType;
54434
+ uniform float u_invert;
54435
+ uniform float u_contrast;
54436
+ uniform float u_brightness;
54437
+ uniform float u_scale;
54438
+ uniform float u_complexity;
54439
+ uniform float u_subInfluence;
54440
+ uniform float u_subScaling;
54441
+ uniform float u_evolution;
54442
+ uniform float u_randomSeed;
54443
+ uniform float u_opacity;
54444
+
54445
+ float hfHashUnit(int ix, int iy, int seed) {
54446
+ uint h = ((uint(ix) * ${mulX}u) ^ (uint(iy) * ${mulY}u) ^ (uint(seed) * ${mulMix}u)) + ${offset2}u;
54447
+ h = h ^ (h >> ${shift1}u);
54448
+ h = h * ${mulMix}u;
54449
+ h = h ^ (h >> ${shift2}u);
54450
+ return float(h) / ${divisor}.0;
54451
+ }
54452
+
54453
+ float hfFade(float f, float noiseType) {
54454
+ if (noiseType < 1.5) return 0.0;
54455
+ if (noiseType < 2.5) return f;
54456
+ if (noiseType < 3.5) return f * f * (3.0 - 2.0 * f);
54457
+ return f * f * f * (f * (f * 6.0 - 15.0) + 10.0);
54458
+ }
54459
+
54460
+ float hfValueNoise(vec2 p, int seed) {
54461
+ vec2 cell = floor(p);
54462
+ vec2 f = p - cell;
54463
+ int ix = int(cell.x);
54464
+ int iy = int(cell.y);
54465
+ float sx = hfFade(f.x, u_noiseType);
54466
+ float sy = hfFade(f.y, u_noiseType);
54467
+ float bottom = mix(hfHashUnit(ix, iy, seed), hfHashUnit(ix + 1, iy, seed), sx);
54468
+ float top = mix(hfHashUnit(ix, iy + 1, seed), hfHashUnit(ix + 1, iy + 1, seed), sx);
54469
+ return mix(bottom, top, sy);
54470
+ }
54471
+
54472
+ float hfFbm(vec2 p) {
54473
+ float lacunarity = 100.0 / max(u_subScaling, 1.0);
54474
+ float gain = u_subInfluence / 100.0;
54475
+ int seed = int(u_randomSeed);
54476
+ float amp = 1.0;
54477
+ float freq = 1.0;
54478
+ float sum = 0.0;
54479
+ float norm = 0.0;
54480
+ for (int i = 0; i < ${MAX_OCTAVES}; i++) {
54481
+ if (float(i) >= u_complexity) break;
54482
+ sum += amp * hfValueNoise(p * freq, seed + i);
54483
+ norm += amp;
54484
+ amp *= gain;
54485
+ freq *= lacunarity;
54486
+ }
54487
+ return norm > 0.0 ? sum / norm : 0.0;
54488
+ }
54489
+
54490
+ void main() {
54491
+ vec2 px = v_uv * u_size;
54492
+ vec2 p = px / max(u_scale, 1.0) + vec2(u_evolution, u_evolution * 0.5);
54493
+ float v = hfFbm(p);
54494
+ v = (v - 0.5) * (u_contrast / 100.0) + 0.5 + u_brightness / 100.0;
54495
+ if (u_invert > 0.5) v = 1.0 - v;
54496
+ v = clamp(v, 0.0, 1.0);
54497
+ float a = clamp(u_opacity / 100.0, 0.0, 1.0);
54498
+ fragColor = vec4(v * a, v * a, v * a, a);
54499
+ }
54500
+ `;
54501
+ }
54502
+ });
54503
+
54504
+ // ../core/dist/vfx/displacementMap.frag.js
54505
+ var DISPLACEMENT_MAP_CONSTANTS, lumaR, lumaG, lumaB, DISPLACEMENT_MAP_FRAG;
54506
+ var init_displacementMap_frag = __esm({
54507
+ "../core/dist/vfx/displacementMap.frag.js"() {
54508
+ "use strict";
54509
+ DISPLACEMENT_MAP_CONSTANTS = {
54510
+ lumaR: 0.299,
54511
+ lumaG: 0.587,
54512
+ lumaB: 0.114
54513
+ };
54514
+ ({ lumaR, lumaG, lumaB } = DISPLACEMENT_MAP_CONSTANTS);
54515
+ DISPLACEMENT_MAP_FRAG = `#version 300 es
54516
+ precision highp float;
54517
+
54518
+ in vec2 v_uv;
54519
+ out vec4 fragColor;
54520
+
54521
+ uniform vec2 u_size;
54522
+ uniform float u_t;
54523
+ uniform float u_fps;
54524
+ uniform sampler2D u_src;
54525
+ uniform float u_useH;
54526
+ uniform float u_maxH;
54527
+ uniform float u_useV;
54528
+ uniform float u_maxV;
54529
+ uniform float u_behavior;
54530
+ uniform float u_edge;
54531
+ uniform float u_expand;
54532
+
54533
+ vec4 hfSampleSrc(vec2 uv) {
54534
+ if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) return vec4(0.0);
54535
+ return texture(u_src, uv);
54536
+ }
54537
+
54538
+ // The selector's value, in [0, 1]. Half and Off both land on 0.5, which is the
54539
+ // "no displacement" midpoint the caller subtracts.
54540
+ float hfMapChannel(vec4 premultiplied, float selector) {
54541
+ vec3 rgb = premultiplied.a > 0.0 ? premultiplied.rgb / premultiplied.a : vec3(0.0);
54542
+ if (selector < 1.5) return rgb.r;
54543
+ if (selector < 2.5) return rgb.g;
54544
+ if (selector < 3.5) return rgb.b;
54545
+ if (selector < 4.5) return premultiplied.a;
54546
+ if (selector < 8.5) return dot(rgb, vec3(${lumaR}, ${lumaG}, ${lumaB}));
54547
+ if (selector < 9.5) return 1.0;
54548
+ return 0.5;
54549
+ }
54550
+
54551
+ void main() {
54552
+ vec4 mapTexel = texture(u_src, v_uv);
54553
+ float h = hfMapChannel(mapTexel, u_useH);
54554
+ float v = hfMapChannel(mapTexel, u_useV);
54555
+ vec2 d = vec2((h - 0.5) * 2.0 * u_maxH, (v - 0.5) * 2.0 * u_maxV);
54556
+ fragColor = hfSampleSrc(v_uv + d / u_size);
54557
+ }
54558
+ `;
54559
+ }
54560
+ });
54561
+
54562
+ // ../core/dist/vfx/waveWarp.frag.js
54563
+ var WAVE_WARP_CONSTANTS, tau, degreesPerTurn, WAVE_WARP_FRAG;
54564
+ var init_waveWarp_frag = __esm({
54565
+ "../core/dist/vfx/waveWarp.frag.js"() {
54566
+ "use strict";
54567
+ WAVE_WARP_CONSTANTS = {
54568
+ tau: 6.283185307179586,
54569
+ degreesPerTurn: 360
54570
+ };
54571
+ ({ tau, degreesPerTurn } = WAVE_WARP_CONSTANTS);
54572
+ WAVE_WARP_FRAG = `#version 300 es
54573
+ precision highp float;
54574
+
54575
+ in vec2 v_uv;
54576
+ out vec4 fragColor;
54577
+
54578
+ uniform vec2 u_size;
54579
+ uniform float u_t;
54580
+ uniform float u_fps;
54581
+ uniform sampler2D u_src;
54582
+ uniform float u_waveType;
54583
+ uniform float u_height;
54584
+ uniform float u_width;
54585
+ uniform float u_direction;
54586
+ uniform float u_speed;
54587
+ uniform float u_pinning;
54588
+ uniform float u_phase;
54589
+
54590
+ // Outside the layer's own box there is nothing to warp in from, so the wave
54591
+ // carries transparency rather than a smeared edge pixel.
54592
+ vec4 hfSampleSrc(vec2 uv) {
54593
+ if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) return vec4(0.0);
54594
+ return texture(u_src, uv);
54595
+ }
54596
+
54597
+ void main() {
54598
+ vec2 px = v_uv * u_size;
54599
+ float dir = radians(u_direction);
54600
+ vec2 travel = vec2(sin(dir), -cos(dir));
54601
+ vec2 swing = vec2(-travel.y, travel.x);
54602
+ float proj = (px.x + 1.0) * travel.x + px.y * travel.y;
54603
+ float turns = proj / max(u_width, 1.0) + u_phase / ${degreesPerTurn}.0 + u_speed * u_t;
54604
+ float disp = u_height * sin(${tau} * turns);
54605
+ fragColor = hfSampleSrc((px + swing * disp) / u_size);
54606
+ }
54607
+ `;
54608
+ }
54609
+ });
54610
+
54611
+ // ../core/dist/vfx.js
54612
+ function enabledVfxNodes(chain) {
54613
+ return chain.nodes.filter((n) => n.enabled !== false);
54614
+ }
54615
+ function chainCapture(chain) {
54616
+ let best = "none";
54617
+ for (const node of enabledVfxNodes(chain)) {
54618
+ const def = BY_ID2.get(node.type);
54619
+ if (def && CAPTURE_RANK[def.capture] > CAPTURE_RANK[best])
54620
+ best = def.capture;
54621
+ }
54622
+ return best;
54623
+ }
54624
+ function parseVfxChain(json) {
54625
+ let raw;
54626
+ try {
54627
+ raw = JSON.parse(json);
54628
+ } catch (err) {
54629
+ throw new VfxChainError(`Chain file is not valid JSON: ${err.message}`);
54630
+ }
54631
+ if (typeof raw !== "object" || raw === null) {
54632
+ throw new VfxChainError("Chain file must be a JSON object.");
54633
+ }
54634
+ const obj = raw;
54635
+ if (obj.version !== HF_VFX_CHAIN_VERSION) {
54636
+ throw new VfxChainError(`Unsupported chain version: ${String(obj.version)}`);
54637
+ }
54638
+ if (!Array.isArray(obj.nodes)) {
54639
+ throw new VfxChainError("Chain file is missing a `nodes` array.");
54640
+ }
54641
+ const nodes = obj.nodes.map(parseVfxNode);
54642
+ return { version: HF_VFX_CHAIN_VERSION, nodes };
54643
+ }
54644
+ function isPlainObject(v) {
54645
+ return typeof v === "object" && v !== null;
54646
+ }
54647
+ function requireVfxNodeType(node, i) {
54648
+ if (typeof node.type !== "string" || !BY_ID2.has(node.type)) {
54649
+ throw new VfxChainError(`Node ${i} has unknown effect type: ${String(node.type)}`);
54650
+ }
54651
+ return node.type;
54652
+ }
54653
+ function requireVfxNodeId(node, i) {
54654
+ if (typeof node.id !== "string" || node.id === "") {
54655
+ throw new VfxChainError(`Node ${i} is missing an id.`);
54656
+ }
54657
+ return node.id;
54658
+ }
54659
+ function parseVfxNode(n, i) {
54660
+ if (!isPlainObject(n)) {
54661
+ throw new VfxChainError(`Node ${i} is not an object.`);
54662
+ }
54663
+ const node = n;
54664
+ const type = requireVfxNodeType(node, i);
54665
+ const id = requireVfxNodeId(node, i);
54666
+ const params = isPlainObject(node.params) ? node.params : {};
54667
+ return withoutUndefined2({
54668
+ type,
54669
+ id,
54670
+ enabled: node.enabled === false ? false : void 0,
54671
+ params
54672
+ });
54673
+ }
54674
+ function withoutUndefined2(obj) {
54675
+ for (const key2 of Object.keys(obj)) {
54676
+ if (obj[key2] === void 0)
54677
+ delete obj[key2];
54678
+ }
54679
+ return obj;
54680
+ }
54681
+ var HF_VFX_ATTR, HF_VFX_CHAIN_VERSION, DISPLACEMENT_CHANNELS, HF_VFX, BY_ID2, VfxChainError, CAPTURE_RANK;
54682
+ var init_vfx = __esm({
54683
+ "../core/dist/vfx.js"() {
54684
+ "use strict";
54685
+ init_fractalNoise_frag();
54686
+ init_displacementMap_frag();
54687
+ init_waveWarp_frag();
54688
+ HF_VFX_ATTR = "data-vfx-chain";
54689
+ HF_VFX_CHAIN_VERSION = 1;
54690
+ DISPLACEMENT_CHANNELS = [
54691
+ { value: 1, label: "Red" },
54692
+ { value: 2, label: "Green" },
54693
+ { value: 3, label: "Blue" },
54694
+ { value: 4, label: "Alpha" },
54695
+ { value: 5, label: "Luminance" },
54696
+ { value: 6, label: "Hue" },
54697
+ { value: 7, label: "Lightness" },
54698
+ { value: 8, label: "Saturation" },
54699
+ { value: 9, label: "Full" },
54700
+ { value: 10, label: "Half" },
54701
+ { value: 11, label: "Off" }
54702
+ ];
54703
+ HF_VFX = [
54704
+ {
54705
+ id: "fractal-noise",
54706
+ label: "Fractal Noise",
54707
+ ae: "ADBE Fractal Noise",
54708
+ capture: "none",
54709
+ frag: FRACTAL_NOISE_FRAG,
54710
+ params: [
54711
+ {
54712
+ kind: "enum",
54713
+ key: "fractalType",
54714
+ label: "Fractal Type",
54715
+ options: [{ value: 1, label: "Basic" }],
54716
+ default: 1,
54717
+ hint: "Only Basic is implemented in v1."
54718
+ },
54719
+ {
54720
+ kind: "enum",
54721
+ key: "noiseType",
54722
+ label: "Noise Type",
54723
+ options: [
54724
+ { value: 1, label: "Block" },
54725
+ { value: 2, label: "Linear" },
54726
+ { value: 3, label: "Soft Linear" },
54727
+ { value: 4, label: "Spline" }
54728
+ ],
54729
+ default: 3
54730
+ },
54731
+ { kind: "bool", key: "invert", label: "Invert", default: false },
54732
+ {
54733
+ kind: "number",
54734
+ key: "contrast",
54735
+ label: "Contrast",
54736
+ unit: "%",
54737
+ min: 0,
54738
+ max: 1e3,
54739
+ step: 1,
54740
+ default: 100
54741
+ },
54742
+ {
54743
+ kind: "number",
54744
+ key: "brightness",
54745
+ label: "Brightness",
54746
+ unit: "",
54747
+ min: -1e3,
54748
+ max: 1e3,
54749
+ step: 1,
54750
+ default: 0
54751
+ },
54752
+ {
54753
+ kind: "number",
54754
+ key: "scale",
54755
+ label: "Scale",
54756
+ unit: "%",
54757
+ min: 6,
54758
+ max: 1e4,
54759
+ step: 1,
54760
+ default: 100
54761
+ },
54762
+ {
54763
+ kind: "number",
54764
+ key: "complexity",
54765
+ label: "Complexity",
54766
+ unit: "",
54767
+ min: 1,
54768
+ max: 20,
54769
+ step: 1,
54770
+ default: 6
54771
+ },
54772
+ {
54773
+ kind: "number",
54774
+ key: "subInfluence",
54775
+ label: "Sub Influence",
54776
+ unit: "%",
54777
+ min: 0,
54778
+ max: 100,
54779
+ step: 1,
54780
+ default: 70
54781
+ },
54782
+ {
54783
+ kind: "number",
54784
+ key: "subScaling",
54785
+ label: "Sub Scaling",
54786
+ unit: "%",
54787
+ min: 0,
54788
+ max: 100,
54789
+ step: 1,
54790
+ default: 56
54791
+ },
54792
+ {
54793
+ kind: "number",
54794
+ key: "evolution",
54795
+ label: "Evolution",
54796
+ unit: "revolutions",
54797
+ min: -1e4,
54798
+ max: 1e4,
54799
+ step: 0.01,
54800
+ default: 0,
54801
+ animatable: true
54802
+ },
54803
+ {
54804
+ kind: "number",
54805
+ key: "randomSeed",
54806
+ label: "Random Seed",
54807
+ unit: "",
54808
+ min: 0,
54809
+ max: 99999,
54810
+ step: 1,
54811
+ default: 0
54812
+ },
54813
+ {
54814
+ kind: "number",
54815
+ key: "opacity",
54816
+ label: "Opacity",
54817
+ unit: "%",
54818
+ min: 0,
54819
+ max: 100,
54820
+ step: 1,
54821
+ default: 100,
54822
+ animatable: true
54823
+ }
54824
+ ]
54825
+ },
54826
+ {
54827
+ id: "wave-warp",
54828
+ label: "Wave Warp",
54829
+ ae: "ADBE Wave Warp",
54830
+ capture: "self",
54831
+ frag: WAVE_WARP_FRAG,
54832
+ params: [
54833
+ {
54834
+ kind: "enum",
54835
+ key: "waveType",
54836
+ label: "Wave Type",
54837
+ options: [{ value: 1, label: "Sine" }],
54838
+ default: 1,
54839
+ hint: "Only Sine is implemented in v1; the exporter marks the others cosmetic."
54840
+ },
54841
+ {
54842
+ kind: "number",
54843
+ key: "height",
54844
+ label: "Wave Height",
54845
+ unit: "px",
54846
+ min: -1e3,
54847
+ max: 1e3,
54848
+ step: 1,
54849
+ default: 10,
54850
+ animatable: true
54851
+ },
54852
+ {
54853
+ kind: "number",
54854
+ key: "width",
54855
+ label: "Wave Width",
54856
+ unit: "px",
54857
+ min: 1,
54858
+ max: 1e4,
54859
+ step: 1,
54860
+ default: 40,
54861
+ animatable: true
54862
+ },
54863
+ {
54864
+ kind: "number",
54865
+ key: "direction",
54866
+ label: "Direction",
54867
+ unit: "deg",
54868
+ min: -360,
54869
+ max: 360,
54870
+ step: 1,
54871
+ default: 90
54872
+ },
54873
+ {
54874
+ kind: "number",
54875
+ key: "speed",
54876
+ label: "Wave Speed",
54877
+ unit: "waves/s",
54878
+ min: -100,
54879
+ max: 100,
54880
+ step: 0.1,
54881
+ default: 1
54882
+ },
54883
+ {
54884
+ kind: "enum",
54885
+ key: "pinning",
54886
+ label: "Pinning",
54887
+ options: [{ value: 1, label: "None" }],
54888
+ default: 1,
54889
+ hint: "Only None is implemented in v1; the exporter marks the others cosmetic."
54890
+ },
54891
+ {
54892
+ kind: "number",
54893
+ key: "phase",
54894
+ label: "Phase",
54895
+ unit: "deg",
54896
+ min: -360,
54897
+ max: 360,
54898
+ step: 1,
54899
+ default: 0,
54900
+ animatable: true
54901
+ }
54902
+ ]
54903
+ },
54904
+ {
54905
+ id: "displacement-map",
54906
+ label: "Displacement Map",
54907
+ ae: "ADBE Displacement Map",
54908
+ capture: "self",
54909
+ frag: DISPLACEMENT_MAP_FRAG,
54910
+ params: [
54911
+ {
54912
+ kind: "enum",
54913
+ key: "useH",
54914
+ label: "Use For Horizontal Displacement",
54915
+ options: DISPLACEMENT_CHANNELS,
54916
+ default: 1,
54917
+ hint: "Hue, Lightness and Saturation are read as Luminance in v1."
54918
+ },
54919
+ {
54920
+ kind: "number",
54921
+ key: "maxH",
54922
+ label: "Max Horizontal Displacement",
54923
+ unit: "px",
54924
+ min: -32e3,
54925
+ max: 32e3,
54926
+ step: 1,
54927
+ default: 5,
54928
+ animatable: true
54929
+ },
54930
+ {
54931
+ kind: "enum",
54932
+ key: "useV",
54933
+ label: "Use For Vertical Displacement",
54934
+ options: DISPLACEMENT_CHANNELS,
54935
+ default: 2,
54936
+ hint: "Hue, Lightness and Saturation are read as Luminance in v1."
54937
+ },
54938
+ {
54939
+ kind: "number",
54940
+ key: "maxV",
54941
+ label: "Max Vertical Displacement",
54942
+ unit: "px",
54943
+ min: -32e3,
54944
+ max: 32e3,
54945
+ step: 1,
54946
+ default: 5,
54947
+ animatable: true
54948
+ },
54949
+ {
54950
+ kind: "enum",
54951
+ key: "behavior",
54952
+ label: "Displacement Map Behavior",
54953
+ options: [{ value: 1, label: "Center Map" }],
54954
+ default: 1,
54955
+ hint: "Only Center Map is implemented in v1."
54956
+ },
54957
+ {
54958
+ kind: "enum",
54959
+ key: "edge",
54960
+ label: "Edge Behavior",
54961
+ options: [{ value: 0, label: "Off" }],
54962
+ default: 0,
54963
+ hint: "Only Off (transparent outside the layer) is implemented in v1."
54964
+ },
54965
+ {
54966
+ kind: "bool",
54967
+ key: "expand",
54968
+ label: "Expand Output",
54969
+ default: true
54970
+ }
54971
+ ]
54972
+ }
54973
+ ];
54974
+ BY_ID2 = new Map(HF_VFX.map((d) => [d.id, d]));
54975
+ VfxChainError = class extends Error {
54976
+ constructor(message) {
54977
+ super(message);
54978
+ this.name = "VfxChainError";
54979
+ }
54980
+ };
54981
+ CAPTURE_RANK = { none: 0, self: 1, backdrop: 2 };
54982
+ }
54983
+ });
54984
+
54403
54985
  // ../core/dist/index.js
54404
54986
  var init_dist2 = __esm({
54405
54987
  "../core/dist/index.js"() {
@@ -54444,6 +55026,7 @@ var init_dist2 = __esm({
54444
55026
  init_registry();
54445
55027
  init_canary();
54446
55028
  init_canaryRegistry();
55029
+ init_vfx();
54447
55030
  }
54448
55031
  });
54449
55032
 
@@ -54645,7 +55228,7 @@ var init_vp9Options = __esm({
54645
55228
  // ../engine/src/config.ts
54646
55229
  import { tmpdir } from "os";
54647
55230
  import { join as join3 } from "path";
54648
- function isPlainObject(value) {
55231
+ function isPlainObject2(value) {
54649
55232
  return typeof value === "object" && value !== null && !Array.isArray(value) && [Object.prototype, null].includes(Object.getPrototypeOf(value));
54650
55233
  }
54651
55234
  function assertEngineConfigNumber(config, field, min, integer = false) {
@@ -54714,7 +55297,7 @@ function validateEngineConfigRuntime(config) {
54714
55297
  }
54715
55298
  function validateEngineConfigHdr(config) {
54716
55299
  const { hdr } = config;
54717
- if (hdr !== false && (!isPlainObject(hdr) || Object.keys(hdr).length !== 1 || hdr.transfer !== "hlg" && hdr.transfer !== "pq")) {
55300
+ if (hdr !== false && (!isPlainObject2(hdr) || Object.keys(hdr).length !== 1 || hdr.transfer !== "hlg" && hdr.transfer !== "pq")) {
54718
55301
  throw new Error("Engine config hdr must be false or an hlg/pq transfer object");
54719
55302
  }
54720
55303
  }
@@ -54738,7 +55321,7 @@ function validateOptionalEngineConfigFields(config) {
54738
55321
  }
54739
55322
  }
54740
55323
  function validateEngineConfigSnapshot(value) {
54741
- if (!isPlainObject(value)) throw new Error("Engine config snapshot must be a plain object");
55324
+ if (!isPlainObject2(value)) throw new Error("Engine config snapshot must be a plain object");
54742
55325
  validateRequiredEngineConfigFields(value);
54743
55326
  validateEngineConfigScalars(value);
54744
55327
  validateEngineConfigParallelism(value);
@@ -55119,17 +55702,22 @@ var BrowserLeasePool;
55119
55702
  var init_browserLeasePool = __esm({
55120
55703
  "../engine/src/services/browserLeasePool.ts"() {
55121
55704
  "use strict";
55122
- BrowserLeasePool = class {
55705
+ BrowserLeasePool = class _BrowserLeasePool {
55123
55706
  constructor(options) {
55124
55707
  this.options = options;
55125
55708
  }
55126
55709
  options;
55710
+ /** Under the CLI's 3s exit watchdog, alongside the render-wait bound it races. */
55711
+ static DRAIN_FORCE_CLOSE_MS = 1e3;
55127
55712
  available = /* @__PURE__ */ new Map();
55128
55713
  entries = /* @__PURE__ */ new Set();
55129
55714
  leasesByBrowser = /* @__PURE__ */ new Map();
55130
55715
  drainPromise = null;
55716
+ closed = false;
55131
55717
  async acquire(fingerprintInput, pooled) {
55718
+ if (this.closed) throw new Error("Browser pool is closed; no new browsers can be acquired");
55132
55719
  if (this.drainPromise) await this.drainPromise;
55720
+ if (this.closed) throw new Error("Browser pool is closed; no new browsers can be acquired");
55133
55721
  const fingerprint = freezeFingerprint(fingerprintInput);
55134
55722
  const entry = this.reserveEntry(fingerprint, pooled);
55135
55723
  return this.issueLease(entry);
@@ -55188,17 +55776,30 @@ var init_browserLeasePool = __esm({
55188
55776
  if (this.drainPromise) return this.drainPromise;
55189
55777
  const entries2 = [...this.entries];
55190
55778
  for (const entry of entries2) this.requestClose(entry, false);
55191
- this.drainPromise = Promise.all(entries2.map((entry) => entry.closePromise)).then(() => {
55779
+ const settle = Promise.all(entries2.map((entry) => entry.closePromise));
55780
+ const bound = new Promise(
55781
+ (resolve18) => setTimeout(resolve18, _BrowserLeasePool.DRAIN_FORCE_CLOSE_MS).unref()
55782
+ );
55783
+ this.drainPromise = Promise.race([settle, bound]).then(() => {
55784
+ for (const entry of entries2) if (this.entries.has(entry)) this.requestClose(entry, true);
55785
+ return settle;
55786
+ }).then(() => {
55192
55787
  this.drainPromise = null;
55193
55788
  });
55194
55789
  return this.drainPromise;
55195
55790
  }
55791
+ /** Terminal: drains every entry and refuses every `acquire()` after. */
55792
+ close() {
55793
+ this.closed = true;
55794
+ return this.drain();
55795
+ }
55196
55796
  /** Test-only state reset. Call `drain()` first when entries own real browsers. */
55197
55797
  reset() {
55198
55798
  this.available.clear();
55199
55799
  this.entries.clear();
55200
55800
  this.leasesByBrowser.clear();
55201
55801
  this.drainPromise = null;
55802
+ this.closed = false;
55202
55803
  }
55203
55804
  createEntry(key2, fingerprint, pooled) {
55204
55805
  const entry = {
@@ -55732,6 +56333,9 @@ function forceReleaseBrowser(browser) {
55732
56333
  async function drainBrowserPool() {
55733
56334
  await browserLeasePool.drain();
55734
56335
  }
56336
+ async function closeBrowserPool() {
56337
+ await browserLeasePool.close();
56338
+ }
55735
56339
  function probeNvidiaVramMb() {
55736
56340
  if (_cachedVramMb !== null) return _cachedVramMb;
55737
56341
  try {
@@ -56695,7 +57299,7 @@ function motionBlurSampleTimes(plan2, frameIndex, fps, samplesPerFrame) {
56695
57299
  const grid = fps * plan2.subFrameDivisions;
56696
57300
  const frameTicks = frameIndex * plan2.subFrameDivisions;
56697
57301
  return sampleTickOffsets(plan2, samplesPerFrame).map(
56698
- (offset2) => Math.max(0, frameTicks + offset2) / grid
57302
+ (offset3) => Math.max(0, frameTicks + offset3) / grid
56699
57303
  );
56700
57304
  }
56701
57305
  function motionBlurProbeTimes(plan2, frameIndex, fps) {
@@ -60598,14 +61202,14 @@ async function computeStaticFrameSet(page, fps) {
60598
61202
  const intervals2 = [];
60599
61203
  let tweenCount2 = 0;
60600
61204
  let hasTimelineCall2 = false;
60601
- function walk(tl, offset2) {
61205
+ function walk(tl, offset3) {
60602
61206
  if (typeof tl.getChildren !== "function") return;
60603
61207
  if (typeof tl.vars?.onUpdate === "function") {
60604
61208
  const total = typeof tl.totalDuration === "function" ? tl.totalDuration() : 0;
60605
- if (total > 0) intervals2.push({ start: offset2, end: offset2 + total, spatial: true });
61209
+ if (total > 0) intervals2.push({ start: offset3, end: offset3 + total, spatial: true });
60606
61210
  }
60607
61211
  for (const child of tl.getChildren(false, true, true)) {
60608
- const start = offset2 + (typeof child.startTime === "function" ? child.startTime() : 0);
61212
+ const start = offset3 + (typeof child.startTime === "function" ? child.startTime() : 0);
60609
61213
  const single = typeof child.duration === "function" ? child.duration() : 0;
60610
61214
  const total = typeof child.totalDuration === "function" ? child.totalDuration() : single;
60611
61215
  if (typeof child.getChildren === "function") {
@@ -61033,10 +61637,10 @@ async function computeTimelineAtRiskFrames(page, fps) {
61033
61637
  "maskImage",
61034
61638
  "mask"
61035
61639
  ]);
61036
- function walkTimeline(tl, offset2, out) {
61640
+ function walkTimeline(tl, offset3, out) {
61037
61641
  if (typeof tl.getChildren !== "function") return;
61038
61642
  for (const child of tl.getChildren(false, true, true)) {
61039
- const childStart = offset2 + (typeof child.startTime === "function" ? child.startTime() : 0);
61643
+ const childStart = offset3 + (typeof child.startTime === "function" ? child.startTime() : 0);
61040
61644
  const childDur = typeof child.duration === "function" ? child.duration() : 0;
61041
61645
  if (typeof child.getChildren === "function") {
61042
61646
  walkTimeline(child, childStart, out);
@@ -62372,8 +62976,8 @@ function redactFfprobeInput(stderr, filePath) {
62372
62976
  const inputBasename = basename2(filePath);
62373
62977
  if (inputBasename) redacted = redacted.split(inputBasename).join("[input]");
62374
62978
  if (!redacted.startsWith("[input]")) {
62375
- for (let offset2 = 1; offset2 < filePath.length; offset2 += 1) {
62376
- const suffix = filePath.slice(offset2);
62979
+ for (let offset3 = 1; offset3 < filePath.length; offset3 += 1) {
62980
+ const suffix = filePath.slice(offset3);
62377
62981
  if (suffix.length < 4 || !redacted.startsWith(suffix)) continue;
62378
62982
  const boundary = redacted[suffix.length];
62379
62983
  if (boundary !== void 0 && !/[\s:'")\]}]/.test(boundary)) continue;
@@ -62468,8 +63072,8 @@ async function hasAvifFileBrand(filePath) {
62468
63072
  if (boxSize < 16 || boxSize > bytes.length) return false;
62469
63073
  const avifBrands = /* @__PURE__ */ new Set(["avif", "avis"]);
62470
63074
  if (avifBrands.has(bytes.toString("ascii", 8, 12))) return true;
62471
- for (let offset2 = 16; offset2 + 4 <= boxSize; offset2 += 4) {
62472
- if (avifBrands.has(bytes.toString("ascii", offset2, offset2 + 4))) return true;
63075
+ for (let offset3 = 16; offset3 + 4 <= boxSize; offset3 += 4) {
63076
+ if (avifBrands.has(bytes.toString("ascii", offset3, offset3 + 4))) return true;
62473
63077
  }
62474
63078
  return false;
62475
63079
  } catch {
@@ -62551,20 +63155,20 @@ async function hasCompletePngStructure(filePath, signal) {
62551
63155
  }
62552
63156
  let seenHeader = false;
62553
63157
  let seenImageData = false;
62554
- let offset2 = 8;
62555
- while (offset2 + 12 <= fileSize) {
63158
+ let offset3 = 8;
63159
+ while (offset3 + 12 <= fileSize) {
62556
63160
  signal?.throwIfAborted();
62557
- const chunkHeader = await readFileRange(filePath, offset2, 8, signal);
63161
+ const chunkHeader = await readFileRange(filePath, offset3, 8, signal);
62558
63162
  signal?.throwIfAborted();
62559
63163
  if (chunkHeader.length !== 8) return false;
62560
63164
  const chunkLength = chunkHeader.readUInt32BE(0);
62561
- const chunkEnd = offset2 + 12 + chunkLength;
63165
+ const chunkEnd = offset3 + 12 + chunkLength;
62562
63166
  if (chunkEnd > fileSize) return false;
62563
63167
  const chunkType = chunkHeader.toString("ascii", 4, 8);
62564
- if (chunkType === "IHDR") seenHeader = chunkLength === 13 && offset2 === 8;
63168
+ if (chunkType === "IHDR") seenHeader = chunkLength === 13 && offset3 === 8;
62565
63169
  if (chunkType === "IDAT") seenImageData = true;
62566
63170
  if (chunkType === "IEND") return seenHeader && seenImageData && chunkLength === 0;
62567
- offset2 = chunkEnd;
63171
+ offset3 = chunkEnd;
62568
63172
  }
62569
63173
  return false;
62570
63174
  } catch (error) {
@@ -62755,11 +63359,19 @@ async function extractMediaMetadata(filePath) {
62755
63359
  });
62756
63360
  return probePromise;
62757
63361
  }
63362
+ function resolveStreamWindow(filePath, metadata) {
63363
+ const videoStreamDurationSeconds = metadata.videoStreamDurationSeconds;
63364
+ const candidateStart = metadata.videoStreamStartSeconds ?? 0;
63365
+ const videoStreamStartSeconds = Number.isFinite(candidateStart) ? candidateStart : 0;
63366
+ const cacheKey = `${filePath}\0${String(videoStreamStartSeconds)}\0${String(videoStreamDurationSeconds)}`;
63367
+ return { videoStreamStartSeconds, videoStreamDurationSeconds, cacheKey };
63368
+ }
62758
63369
  async function extractFinalVideoFrameTimestamp(filePath, metadata, signal) {
62759
- const videoDurationSeconds = metadata.videoStreamDurationSeconds;
62760
- const candidateStreamStart = metadata.videoStreamStartSeconds ?? 0;
62761
- const videoStreamStartSeconds = Number.isFinite(candidateStreamStart) ? candidateStreamStart : 0;
62762
- const cacheKey = `${filePath}\0${String(videoStreamStartSeconds)}\0${String(videoDurationSeconds)}`;
63370
+ const {
63371
+ videoStreamStartSeconds,
63372
+ videoStreamDurationSeconds: videoDurationSeconds,
63373
+ cacheKey
63374
+ } = resolveStreamWindow(filePath, metadata);
62763
63375
  let probeCache = finalVideoFrameTimestampCache;
62764
63376
  if (signal) {
62765
63377
  probeCache = finalVideoFrameTimestampSignalCaches.get(signal) ?? /* @__PURE__ */ new Map();
@@ -62862,19 +63474,27 @@ async function extractAudioMetadata(filePath, options) {
62862
63474
  });
62863
63475
  return probePromise;
62864
63476
  }
62865
- async function analyzeKeyframeIntervals(filePath) {
62866
- const cached2 = keyframeCache.get(filePath);
63477
+ async function analyzeKeyframeIntervals(filePath, metadata) {
63478
+ const { videoStreamStartSeconds, videoStreamDurationSeconds, cacheKey } = resolveStreamWindow(
63479
+ filePath,
63480
+ metadata
63481
+ );
63482
+ const cached2 = keyframeCache.get(cacheKey);
62867
63483
  if (cached2) return cached2;
62868
- const promise = analyzeKeyframeIntervalsUncached(filePath);
62869
- keyframeCache.set(filePath, promise);
63484
+ const promise = analyzeKeyframeIntervalsUncached(
63485
+ filePath,
63486
+ videoStreamStartSeconds,
63487
+ videoStreamDurationSeconds
63488
+ );
63489
+ keyframeCache.set(cacheKey, promise);
62870
63490
  promise.catch(() => {
62871
- if (keyframeCache.get(filePath) === promise) {
62872
- keyframeCache.delete(filePath);
63491
+ if (keyframeCache.get(cacheKey) === promise) {
63492
+ keyframeCache.delete(cacheKey);
62873
63493
  }
62874
63494
  });
62875
63495
  return promise;
62876
63496
  }
62877
- async function analyzeKeyframeIntervalsUncached(filePath) {
63497
+ async function analyzeKeyframeIntervalsUncached(filePath, videoStreamStartSeconds, videoStreamDurationSeconds) {
62878
63498
  const stdout = await runFfprobe(filePath, [
62879
63499
  "-select_streams",
62880
63500
  "v:0",
@@ -62886,14 +63506,26 @@ async function analyzeKeyframeIntervalsUncached(filePath) {
62886
63506
  "csv=p=0"
62887
63507
  ]);
62888
63508
  const timestamps = stdout.split("\n").map((line) => parseFloat(line.trim())).filter((t) => Number.isFinite(t));
62889
- if (timestamps.length < 2) {
63509
+ if (timestamps.length === 0) {
62890
63510
  return {
62891
63511
  avgIntervalSeconds: 0,
62892
63512
  maxIntervalSeconds: 0,
62893
- keyframeCount: timestamps.length,
63513
+ keyframeCount: 0,
62894
63514
  isProblematic: false
62895
63515
  };
62896
63516
  }
63517
+ if (timestamps.length === 1) {
63518
+ const streamEnd = videoStreamStartSeconds + videoStreamDurationSeconds;
63519
+ const rawInterval = streamEnd - (timestamps[0] ?? videoStreamStartSeconds);
63520
+ const singleGopInterval = Number.isFinite(rawInterval) ? Math.max(rawInterval, 0) : 0;
63521
+ const roundedInterval = Math.round(singleGopInterval * 100) / 100;
63522
+ return {
63523
+ avgIntervalSeconds: roundedInterval,
63524
+ maxIntervalSeconds: roundedInterval,
63525
+ keyframeCount: 1,
63526
+ isProblematic: singleGopInterval > PROBLEMATIC_KEYFRAME_INTERVAL_SECONDS
63527
+ };
63528
+ }
62897
63529
  let maxInterval = 0;
62898
63530
  let totalInterval = 0;
62899
63531
  for (let i = 1; i < timestamps.length; i++) {
@@ -62906,10 +63538,10 @@ async function analyzeKeyframeIntervalsUncached(filePath) {
62906
63538
  avgIntervalSeconds: Math.round(avgInterval * 100) / 100,
62907
63539
  maxIntervalSeconds: Math.round(maxInterval * 100) / 100,
62908
63540
  keyframeCount: timestamps.length,
62909
- isProblematic: maxInterval > 2
63541
+ isProblematic: maxInterval > PROBLEMATIC_KEYFRAME_INTERVAL_SECONDS
62910
63542
  };
62911
63543
  }
62912
- var FFPROBE_STDERR_MAX_BYTES, FFPROBE_STDOUT_MAX_CHARS, FFPROBE_ERROR_MAX_CHARS, videoMetadataCache, finalVideoFrameTimestampCache, finalVideoFrameTimestampSignalCaches, audioMetadataCache, mediaProbeOutputCache, mediaProbeOutputSignalCaches, MEDIA_PROBE_OUTPUT_CACHE_MAX_ENTRIES, AAC_LC_SAMPLES_PER_PACKET, STILL_IMAGE_DEMUXERS, StructurallyIncompletePngError, extractVideoMetadata, keyframeCache;
63544
+ var FFPROBE_STDERR_MAX_BYTES, FFPROBE_STDOUT_MAX_CHARS, FFPROBE_ERROR_MAX_CHARS, videoMetadataCache, finalVideoFrameTimestampCache, finalVideoFrameTimestampSignalCaches, audioMetadataCache, mediaProbeOutputCache, mediaProbeOutputSignalCaches, MEDIA_PROBE_OUTPUT_CACHE_MAX_ENTRIES, AAC_LC_SAMPLES_PER_PACKET, STILL_IMAGE_DEMUXERS, StructurallyIncompletePngError, extractVideoMetadata, keyframeCache, PROBLEMATIC_KEYFRAME_INTERVAL_SECONDS;
62913
63545
  var init_ffprobe = __esm({
62914
63546
  "../engine/src/utils/ffprobe.ts"() {
62915
63547
  "use strict";
@@ -62952,6 +63584,7 @@ var init_ffprobe = __esm({
62952
63584
  };
62953
63585
  extractVideoMetadata = extractMediaMetadata;
62954
63586
  keyframeCache = /* @__PURE__ */ new Map();
63587
+ PROBLEMATIC_KEYFRAME_INTERVAL_SECONDS = 2;
62955
63588
  }
62956
63589
  });
62957
63590
 
@@ -63644,9 +64277,9 @@ var init_chunkEncoder = __esm({
63644
64277
  function jpegInputError(buffer) {
63645
64278
  if (buffer.length === 0) return "empty frame";
63646
64279
  if (buffer[0] !== 255 || buffer[1] !== 216) return "missing JPEG SOI marker";
63647
- let offset2 = 2;
63648
- while (offset2 < buffer.length) {
63649
- const segment = readSegment(buffer, offset2);
64280
+ let offset3 = 2;
64281
+ while (offset3 < buffer.length) {
64282
+ const segment = readSegment(buffer, offset3);
63650
64283
  if (typeof segment === "string") return segment;
63651
64284
  const { marker, start, end } = segment;
63652
64285
  if (marker === 219) {
@@ -63654,33 +64287,33 @@ function jpegInputError(buffer) {
63654
64287
  if (error) return error;
63655
64288
  }
63656
64289
  if (marker === 218) return void 0;
63657
- offset2 = end;
64290
+ offset3 = end;
63658
64291
  }
63659
64292
  return "missing JPEG scan";
63660
64293
  }
63661
- function readSegment(buffer, offset2) {
63662
- if (buffer[offset2++] !== 255) return "invalid JPEG marker";
63663
- while (buffer[offset2] === 255) offset2++;
63664
- const marker = buffer[offset2++];
64294
+ function readSegment(buffer, offset3) {
64295
+ if (buffer[offset3++] !== 255) return "invalid JPEG marker";
64296
+ while (buffer[offset3] === 255) offset3++;
64297
+ const marker = buffer[offset3++];
63665
64298
  if (marker === void 0) return "truncated JPEG marker";
63666
- if (marker === 1) return { marker, start: offset2, end: offset2 };
63667
- if (offset2 + 2 > buffer.length) return "truncated JPEG segment length";
63668
- const length = buffer.readUInt16BE(offset2);
63669
- const end = offset2 + length;
64299
+ if (marker === 1) return { marker, start: offset3, end: offset3 };
64300
+ if (offset3 + 2 > buffer.length) return "truncated JPEG segment length";
64301
+ const length = buffer.readUInt16BE(offset3);
64302
+ const end = offset3 + length;
63670
64303
  if (length < 2 || end > buffer.length) return "invalid JPEG segment length";
63671
- return { marker, start: offset2 + 2, end };
64304
+ return { marker, start: offset3 + 2, end };
63672
64305
  }
63673
64306
  function quantizationTableError(buffer, start, end) {
63674
64307
  if (start === end) return "empty JPEG DQT segment";
63675
- let offset2 = start;
63676
- while (offset2 < end) {
63677
- const descriptor = buffer[offset2++];
64308
+ let offset3 = start;
64309
+ while (offset3 < end) {
64310
+ const descriptor = buffer[offset3++];
63678
64311
  if (descriptor === void 0) return "truncated JPEG DQT descriptor";
63679
64312
  const precision = descriptor >> 4;
63680
64313
  if (precision > 1) return `invalid JPEG DQT precision ${precision}`;
63681
64314
  if ((descriptor & 15) > 3) return "invalid JPEG DQT table id";
63682
- offset2 += precision === 0 ? 64 : 128;
63683
- if (offset2 > end) return "truncated JPEG DQT table";
64315
+ offset3 += precision === 0 ? 64 : 128;
64316
+ if (offset3 > end) return "truncated JPEG DQT table";
63684
64317
  }
63685
64318
  return void 0;
63686
64319
  }
@@ -64117,6 +64750,11 @@ function isUnresolvedAssetPlaceholder(rawSrc) {
64117
64750
  function cleanAssetUrl(url) {
64118
64751
  return url.trim().split(/[?#]/, 1)[0] ?? "";
64119
64752
  }
64753
+ function isWithinProjectRoot(projectDir, candidate, pathModule = { resolve: resolve5, relative, isAbsolute }) {
64754
+ const projectRoot = pathModule.resolve(projectDir);
64755
+ const relativePath = pathModule.relative(projectRoot, candidate);
64756
+ return relativePath === "" || !relativePath.startsWith("..") && !pathModule.isAbsolute(relativePath);
64757
+ }
64120
64758
  function reanchoredCandidates(variant, baseDir, compiledDir) {
64121
64759
  const baseAbs = resolve5(baseDir);
64122
64760
  const joinedAbs = resolve5(join8(baseDir, variant));
@@ -68134,7 +68772,7 @@ var require_tokenize = __commonJS({
68134
68772
  var tokens = [];
68135
68773
  var css = input.css.valueOf();
68136
68774
  var length = css.length;
68137
- var offset2 = -1;
68775
+ var offset3 = -1;
68138
68776
  var line = 1;
68139
68777
  var start = 0;
68140
68778
  var end = 0;
@@ -68144,13 +68782,13 @@ var require_tokenize = __commonJS({
68144
68782
  css += fix;
68145
68783
  next = css.length - 1;
68146
68784
  } else {
68147
- throw input.error("Unclosed " + what, line, start - offset2, start);
68785
+ throw input.error("Unclosed " + what, line, start - offset3, start);
68148
68786
  }
68149
68787
  }
68150
68788
  while (start < length) {
68151
68789
  code = css.charCodeAt(start);
68152
68790
  if (code === t.newline) {
68153
- offset2 = start;
68791
+ offset3 = start;
68154
68792
  line += 1;
68155
68793
  }
68156
68794
  switch (code) {
@@ -68164,13 +68802,13 @@ var require_tokenize = __commonJS({
68164
68802
  next += 1;
68165
68803
  code = css.charCodeAt(next);
68166
68804
  if (code === t.newline) {
68167
- offset2 = next;
68805
+ offset3 = next;
68168
68806
  line += 1;
68169
68807
  }
68170
68808
  } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed);
68171
68809
  tokenType = t.space;
68172
68810
  endLine = line;
68173
- endColumn = next - offset2 - 1;
68811
+ endColumn = next - offset3 - 1;
68174
68812
  end = next;
68175
68813
  break;
68176
68814
  case t.plus:
@@ -68184,7 +68822,7 @@ var require_tokenize = __commonJS({
68184
68822
  } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe);
68185
68823
  tokenType = t.combinator;
68186
68824
  endLine = line;
68187
- endColumn = start - offset2;
68825
+ endColumn = start - offset3;
68188
68826
  end = next;
68189
68827
  break;
68190
68828
  // Consume these characters as single tokens.
@@ -68204,7 +68842,7 @@ var require_tokenize = __commonJS({
68204
68842
  next = start;
68205
68843
  tokenType = code;
68206
68844
  endLine = line;
68207
- endColumn = start - offset2;
68845
+ endColumn = start - offset3;
68208
68846
  end = next + 1;
68209
68847
  break;
68210
68848
  case t.singleQuote:
@@ -68225,7 +68863,7 @@ var require_tokenize = __commonJS({
68225
68863
  } while (escaped);
68226
68864
  tokenType = t.str;
68227
68865
  endLine = line;
68228
- endColumn = start - offset2;
68866
+ endColumn = start - offset3;
68229
68867
  end = next + 1;
68230
68868
  break;
68231
68869
  default:
@@ -68242,7 +68880,7 @@ var require_tokenize = __commonJS({
68242
68880
  nextOffset = next - lines[last].length;
68243
68881
  } else {
68244
68882
  nextLine = line;
68245
- nextOffset = offset2;
68883
+ nextOffset = offset3;
68246
68884
  }
68247
68885
  tokenType = t.comment;
68248
68886
  line = nextLine;
@@ -68252,13 +68890,13 @@ var require_tokenize = __commonJS({
68252
68890
  next = start;
68253
68891
  tokenType = code;
68254
68892
  endLine = line;
68255
- endColumn = start - offset2;
68893
+ endColumn = start - offset3;
68256
68894
  end = next + 1;
68257
68895
  } else {
68258
68896
  next = consumeWord(css, start);
68259
68897
  tokenType = t.word;
68260
68898
  endLine = line;
68261
- endColumn = next - offset2;
68899
+ endColumn = next - offset3;
68262
68900
  }
68263
68901
  end = next + 1;
68264
68902
  break;
@@ -68268,7 +68906,7 @@ var require_tokenize = __commonJS({
68268
68906
  // [0] Token type
68269
68907
  line,
68270
68908
  // [1] Starting line
68271
- start - offset2,
68909
+ start - offset3,
68272
68910
  // [2] Starting column
68273
68911
  endLine,
68274
68912
  // [3] Ending line
@@ -68280,7 +68918,7 @@ var require_tokenize = __commonJS({
68280
68918
  // [6] End position
68281
68919
  ]);
68282
68920
  if (nextOffset) {
68283
- offset2 = nextOffset;
68921
+ offset3 = nextOffset;
68284
68922
  nextOffset = null;
68285
68923
  }
68286
68924
  start = end;
@@ -76690,8 +77328,8 @@ ${other.raw}`)
76690
77328
  (tag) => tagSimpleSelectors(tag).some((token) => alreadyHidden.has(token))
76691
77329
  );
76692
77330
  if (hiddenByToken || hiddenByElement) continue;
76693
- const offset2 = win.propertyValues["strokeDashoffset"];
76694
- const hidesByOffset = numberValue(offset2) !== null && !zeroValue(offset2);
77331
+ const offset3 = win.propertyValues["strokeDashoffset"];
77332
+ const hidesByOffset = numberValue(offset3) !== null && !zeroValue(offset3);
76695
77333
  const hides = isHiddenGsapState(win.propertyValues) || zeroValue(win.propertyValues["scale"]) || hidesByOffset;
76696
77334
  if (!hides) continue;
76697
77335
  findings.push({
@@ -80168,12 +80806,12 @@ var init_mediaVolumeEnvelope = __esm({
80168
80806
 
80169
80807
  // ../engine/src/services/wavChunks.ts
80170
80808
  function* riffChunks(buffer) {
80171
- let offset2 = 12;
80172
- while (offset2 + 8 <= buffer.length) {
80173
- const id = buffer.toString("ascii", offset2, offset2 + 4);
80174
- const size = buffer.readUInt32LE(offset2 + 4);
80175
- yield { id, body: offset2 + 8, size };
80176
- offset2 += 8 + size + size % 2;
80809
+ let offset3 = 12;
80810
+ while (offset3 + 8 <= buffer.length) {
80811
+ const id = buffer.toString("ascii", offset3, offset3 + 4);
80812
+ const size = buffer.readUInt32LE(offset3 + 4);
80813
+ yield { id, body: offset3 + 8, size };
80814
+ offset3 += 8 + size + size % 2;
80177
80815
  }
80178
80816
  }
80179
80817
  function extensibleFormatTag(fmt) {
@@ -80583,13 +81221,13 @@ async function readPlaneFromPage(page, index, byteLength) {
80583
81221
  const parts = [];
80584
81222
  for (let at2 = 0; at2 < byteLength; at2 += TRANSFER_BYTES) {
80585
81223
  const b64 = await page.evaluate(
80586
- ([plane_index, offset2, limit]) => {
81224
+ ([plane_index, offset3, limit]) => {
80587
81225
  const plane = window.__HF_FX_IO?.out[plane_index];
80588
81226
  if (!plane) return "";
80589
81227
  const u8 = new Uint8Array(
80590
81228
  plane.buffer,
80591
- plane.byteOffset + offset2,
80592
- Math.min(limit, plane.length * 4 - offset2)
81229
+ plane.byteOffset + offset3,
81230
+ Math.min(limit, plane.length * 4 - offset3)
80593
81231
  );
80594
81232
  let s = "";
80595
81233
  const CHUNK = 32768;
@@ -82175,11 +82813,11 @@ async function verifyDiskDrawElementSamples(session, task, streaming) {
82175
82813
  if (!truths || truths.size === 0) return;
82176
82814
  const verifyMinDb = resolveDeVerifyMinDb();
82177
82815
  const ext = session.options.format === "png" ? "png" : "jpg";
82178
- const offset2 = task.outputFrameOffset ?? 0;
82816
+ const offset3 = task.outputFrameOffset ?? 0;
82179
82817
  for (const idx of selectVerifySampleIndicesForTask(truths.keys(), task)) {
82180
82818
  const truth = truths.get(idx);
82181
82819
  if (!truth) continue;
82182
- const framePath = join17(task.outputDir, `frame_${String(idx - offset2).padStart(6, "0")}.${ext}`);
82820
+ const framePath = join17(task.outputDir, `frame_${String(idx - offset3).padStart(6, "0")}.${ext}`);
82183
82821
  const db = await psnrForDiskSample(framePath, truth, task.workerId, idx);
82184
82822
  if (db === null) continue;
82185
82823
  assertDiskSampleAboveFloor(db, verifyMinDb, idx, task.workerId);
@@ -82481,6 +83119,14 @@ function readRegularFile(filePath) {
82481
83119
  closeSync4(fd);
82482
83120
  }
82483
83121
  }
83122
+ function resolveContainedPaths(projectDir, compiledDir, relativePath) {
83123
+ const projectPath = join18(projectDir, relativePath);
83124
+ if (!isWithinProjectRoot(projectDir, projectPath)) return null;
83125
+ if (!compiledDir) return { projectPath, compiledPath: null };
83126
+ const compiledPath = join18(compiledDir, relativePath);
83127
+ if (!isWithinProjectRoot(compiledDir, compiledPath)) return null;
83128
+ return { projectPath, compiledPath };
83129
+ }
82484
83130
  function createFileServer(options) {
82485
83131
  const { projectDir, compiledDir, port = 0, stripEmbeddedRuntime = true } = options;
82486
83132
  const headScripts = options.headScripts ?? [];
@@ -82490,8 +83136,9 @@ function createFileServer(options) {
82490
83136
  let requestPath = c.req.path;
82491
83137
  if (requestPath === "/") requestPath = "/index.html";
82492
83138
  const relativePath = requestPath.replace(/^\//, "");
82493
- const compiledPath = compiledDir ? join18(compiledDir, relativePath) : null;
82494
- const content = (compiledPath ? readRegularFile(compiledPath) : null) ?? readRegularFile(join18(projectDir, relativePath));
83139
+ const resolved = resolveContainedPaths(projectDir, compiledDir, relativePath);
83140
+ if (!resolved) return c.text("Not found", 404);
83141
+ const content = (resolved.compiledPath ? readRegularFile(resolved.compiledPath) : null) ?? readRegularFile(resolved.projectPath);
82495
83142
  if (content === null) return c.text("Not found", 404);
82496
83143
  const ext = extname3(relativePath).toLowerCase();
82497
83144
  const contentType = MIME_TYPES[ext] || "application/octet-stream";
@@ -82522,6 +83169,7 @@ var init_fileServer = __esm({
82522
83169
  "../engine/src/services/fileServer.ts"() {
82523
83170
  "use strict";
82524
83171
  init_compiler();
83172
+ init_assetResolution();
82525
83173
  MIME_TYPES = {
82526
83174
  ".html": "text/html; charset=utf-8",
82527
83175
  ".css": "text/css; charset=utf-8",
@@ -83675,6 +84323,7 @@ __export(src_exports, {
83675
84323
  classifyVideoExtractionError: () => classifyVideoExtractionError,
83676
84324
  cloneCaptureWarning: () => cloneCaptureWarning,
83677
84325
  cloneCaptureWarnings: () => cloneCaptureWarnings,
84326
+ closeBrowserPool: () => closeBrowserPool,
83678
84327
  closeCaptureSession: () => closeCaptureSession,
83679
84328
  completeDeferredDrawElementInit: () => completeDeferredDrawElementInit,
83680
84329
  compositionRequiresWebGpu: () => compositionRequiresWebGpu,
@@ -90043,6 +90692,9 @@ function aggregateDrawElement(perfs, de) {
90043
90692
  hasLut: de.hasLut,
90044
90693
  rootBodyMismatch: de.rootBodyMismatch,
90045
90694
  rootBodyDeltaPxBucket: de.rootBodyDeltaPxBucket,
90695
+ vfxHostCount: de.vfxHostCount,
90696
+ vfxCapture: de.vfxCapture,
90697
+ vfxTypes: de.vfxTypes,
90046
90698
  shortBand: de.shortBand,
90047
90699
  parallelRouter: de.parallelRouter ?? "none",
90048
90700
  preRouterWorkers: de.preRouterWorkers,
@@ -91976,30 +92628,32 @@ init_dist2();
91976
92628
  init_mediaTiming();
91977
92629
  init_src();
91978
92630
  var COMPOSITION_HOST_ATTR = "data-composition-file";
91979
- var ROOT_WINDOW = { offset: 0, limit: Infinity, basis: "local" };
91980
- function parseNumeric3(value) {
91981
- if (value == null || value === "") return null;
91982
- const parsed = Number.parseFloat(value);
91983
- return Number.isFinite(parsed) ? parsed : null;
92631
+ function resolveHostEnd(host, hostStart) {
92632
+ return resolveAuthoredTimingWindow({
92633
+ start: hostStart,
92634
+ duration: host.getAttribute("data-duration"),
92635
+ end: host.getAttribute("data-end")
92636
+ })?.end ?? null;
91984
92637
  }
92638
+ var ROOT_WINDOW = { offset: 0, limit: Infinity, basis: "local" };
91985
92639
  function resolveHostWindow(element, document2, startCache, visiting) {
91986
92640
  const hosts = [];
91987
92641
  for (let ancestor2 = element.parentElement; ancestor2; ancestor2 = ancestor2.parentElement) {
91988
92642
  if (ancestor2.hasAttribute(COMPOSITION_HOST_ATTR)) hosts.push(ancestor2);
91989
92643
  }
91990
92644
  if (hosts.length === 0) return ROOT_WINDOW;
91991
- let offset2 = 0;
92645
+ let offset3 = 0;
91992
92646
  let limit = Infinity;
91993
92647
  for (const host of hosts.reverse()) {
91994
92648
  const hostStart = resolveReferencedStart(document2, host, startCache, visiting);
91995
- const hostEnd = parseNumeric3(host.getAttribute("data-end"));
91996
- if (hostEnd != null) limit = Math.min(limit, offset2 + hostEnd);
91997
- offset2 += hostStart;
92649
+ const hostEnd = resolveHostEnd(host, hostStart);
92650
+ if (hostEnd != null) limit = Math.min(limit, offset3 + hostEnd);
92651
+ offset3 += hostStart;
91998
92652
  }
91999
92653
  const tag = element.tagName.toLowerCase();
92000
92654
  const basis = tag === "video" || tag === "audio" ? readMediaStartBasis(element.getAttribute(MEDIA_START_BASIS_ATTR)) : "local";
92001
92655
  return {
92002
- offset: offset2,
92656
+ offset: offset3,
92003
92657
  limit,
92004
92658
  basis
92005
92659
  };
@@ -93928,7 +94582,7 @@ function studioPositionSeekReapplyRuntime() {
93928
94582
  }
93929
94583
 
93930
94584
  // ../core/dist/generated/position-edits-render-inline.js
93931
- var POSITION_EDITS_RENDER_IIFE = '"use strict";(()=>{function T(){return globalThis}function P(e,t){if(typeof window>"u")return;let o=T(),r=o.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(s){}(o.__hfDebug||o.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var x=null;function R(e,t){if(x)try{x({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(o){P("runtime.analytics.site1",o)}}var W="http://www.w3.org/1999/xhtml";function N(e){return e!=null&&e.nodeType===1}function _(e){return N(e)&&(e.namespaceURI===W||e.namespaceURI==="http://www.w3.org/2000/svg")}var w="data-hf-edit-base-x",y="data-hf-edit-base-y",m="data-hf-edit-original-translate",k=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},O=e=>{let t=[],o=0,r="";for(let s of e.trim())s==="("&&(o+=1),s===")"&&(o=Math.max(0,o-1)),/\\s/.test(s)&&o===0?(r&&t.push(r),r=""):r+=s;return r&&t.push(r),t},L=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,b=(e,t)=>L.test(e)&&L.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,V=(e,t,o)=>{if(!e||e==="none")return`${t} ${o}`;let[r,s,a]=O(e);if(r===void 0)return`${t} ${o}`;if(s===void 0)return`${b(r,t)} ${o}`;let i=a===void 0?"":` ${a}`;return`${b(r,t)} ${b(s,o)}${i}`},j=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},G=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let o=e.ownerDocument.defaultView,r=o?o.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},E=new WeakMap;function B(e,t){let o=E.get(e);if(!t?.force&&o!==void 0&&e.style.getPropertyValue("translate")!==o){R("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=k(e.getAttribute("data-x"))-k(e.getAttribute(w)),s=k(e.getAttribute("data-y"))-k(e.getAttribute(y));e.hasAttribute(m)||e.setAttribute(m,G(e)),o===void 0&&j(e);let a=e.getAttribute(m)??"",i=V(a,`${r}px`,`${s}px`);e.style.setProperty("translate",i),E.set(e,e.style.getPropertyValue("translate"))}function S(e,t){let o=e.querySelectorAll(`[${m}]:not([${w}]):not([${y}])`);for(let a=0;a<o.length;a++){let i=o[a];if(i===void 0||!_(i))continue;let g=i.getAttribute(m)??"";g===""?i.style.removeProperty("translate"):i.style.setProperty("translate",g),i.removeAttribute(m),E.delete(i)}let r=e.querySelectorAll(`[${w}], [${y}]`),s=0;for(let a=0;a<r.length;a++){let i=r[a];i===void 0||!_(i)||(B(i,t),s+=1)}return s}var $="__hfPositionEditsSeekReapplyWrapped",D=new WeakSet,M=new WeakMap,F=new WeakMap;function H(e){let t=e,o=()=>{try{S(t.document)}catch{}},r=n=>typeof n=="function"&&(D.has(n)||!!n[$]),s=n=>{D.add(n);try{Object.defineProperty(n,$,{value:!0})}catch{}},a=n=>{if(typeof n!="function"||r(n))return n;let l=function(...u){let d=n.apply(this,u);return o(),d};return s(l),l},i=(n,l)=>{let u=M.get(n);if(u?.has(l))return!0;let d=Object.getOwnPropertyDescriptor(n,l);if(d?.configurable===!1){let c=n[l];return typeof c=="function"&&(n[l]=a(c),o()),!1}let p=n[l],f=d?.set;return Object.defineProperty(n,l,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>p,set:c=>{p=a(c),f?.call(n,c)}}),p=a(p),u??(u=new Set),u.add(l),M.set(n,u),o(),!0},g=(n,l)=>{let u=F.get(t),d=Object.getOwnPropertyDescriptor(t,n);if(!u?.has(n)){if(d?.configurable===!1){let c=t[n];return c?i(c,l):!1}let f=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>f,set:c=>{f=c,f&&i(f,l)}}),u??(u=new Set),u.add(n),F.set(t,u)}let p=t[n];return p?i(p,l):!1},h=()=>{let n=g("__hf","seek"),l=g("__player","renderSeek");return n&&l};if(h())return;let v=120,A=t.setInterval(()=>{if(h()){t.clearInterval(A);return}v-=1,v<=0&&t.clearInterval(A)},50)}function I(){document.querySelector(`[${w}], [${y}]`)&&(S(document),H(window))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",I,{once:!0}):I();})();\n';
94585
+ var POSITION_EDITS_RENDER_IIFE = '"use strict";(()=>{function T(){return globalThis}function P(e,t){if(typeof window>"u")return;let o=T(),r=o.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(s){}(o.__hfDebug||o.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var x=null;function R(e,t){if(x)try{x({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(o){P("runtime.analytics.site1",o)}}var W="http://www.w3.org/1999/xhtml";function N(e){return e!=null&&e.nodeType===1}function _(e){return N(e)&&(e.namespaceURI===W||e.namespaceURI==="http://www.w3.org/2000/svg")}var w="data-hf-edit-base-x",y="data-hf-edit-base-y",m="data-hf-edit-original-translate",k=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},O=e=>{let t=[],o=0,r="";for(let s of e.trim())s==="("&&(o+=1),s===")"&&(o=Math.max(0,o-1)),/\\s/.test(s)&&o===0?(r&&t.push(r),r=""):r+=s;return r&&t.push(r),t},L=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,b=(e,t)=>L.test(e)&&L.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,V=(e,t,o)=>{if(!e||e==="none")return`${t} ${o}`;let[r,s,a]=O(e);if(r===void 0)return`${t} ${o}`;if(s===void 0)return`${b(r,t)} ${o}`;let i=a===void 0?"":` ${a}`;return`${b(r,t)} ${b(s,o)}${i}`},j=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},G=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let o=e.ownerDocument.defaultView,r=o?o.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},E=new WeakMap;function B(e,t){let o=E.get(e);if(!t?.force&&o!==void 0&&e.style.getPropertyValue("translate")!==o){R("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=k(e.getAttribute("data-x"))-k(e.getAttribute(w)),s=k(e.getAttribute("data-y"))-k(e.getAttribute(y));e.hasAttribute(m)||e.setAttribute(m,G(e)),o===void 0&&j(e);let a=e.getAttribute(m)??"",i=V(a,`${r}px`,`${s}px`);e.style.setProperty("translate",i),E.set(e,e.style.getPropertyValue("translate"))}function S(e,t){let o=e.querySelectorAll(`[${m}]:not([${w}]):not([${y}])`);for(let a=0;a<o.length;a++){let i=o[a];if(i===void 0||!_(i))continue;let g=i.getAttribute(m)??"";g===""?i.style.removeProperty("translate"):i.style.setProperty("translate",g),i.removeAttribute(m),E.delete(i)}let r=e.querySelectorAll(`[${w}], [${y}]`),s=0;for(let a=0;a<r.length;a++){let i=r[a];i===void 0||!_(i)||(B(i,t),s+=1)}return s}var $="__hfPositionEditsSeekReapplyWrapped",D=new WeakSet,M=new WeakMap,H=new WeakMap;function F(e){let t=e,o=()=>{try{S(t.document)}catch{}},r=n=>typeof n=="function"&&(D.has(n)||!!n[$]),s=n=>{D.add(n);try{Object.defineProperty(n,$,{value:!0})}catch{}},a=n=>{if(typeof n!="function"||r(n))return n;let l=function(...u){let d=n.apply(this,u);return o(),d};return s(l),l},i=(n,l)=>{let u=M.get(n);if(u?.has(l))return!0;let d=Object.getOwnPropertyDescriptor(n,l);if(d?.configurable===!1){let c=n[l];return typeof c=="function"&&(n[l]=a(c),o()),!1}let p=n[l],f=d?.set;return Object.defineProperty(n,l,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>p,set:c=>{p=a(c),f?.call(n,c)}}),p=a(p),u??(u=new Set),u.add(l),M.set(n,u),o(),!0},g=(n,l)=>{let u=H.get(t),d=Object.getOwnPropertyDescriptor(t,n);if(!u?.has(n)){if(d?.configurable===!1){let c=t[n];return c?i(c,l):!1}let f=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>f,set:c=>{f=c,f&&i(f,l)}}),u??(u=new Set),u.add(n),H.set(t,u)}let p=t[n];return p?i(p,l):!1},v=()=>{let n=g("__hf","seek"),l=g("__player","renderSeek");return n&&l};if(v())return;let h=120,A=t.setInterval(()=>{if(v()){t.clearInterval(A);return}h-=1,h<=0&&t.clearInterval(A)},50)}function I(){document.querySelector(`[${w}], [${y}]`)&&(S(document),F(window))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",I,{once:!0}):I();})();\n';
93932
94586
  function getPositionEditsRenderScript() {
93933
94587
  return POSITION_EDITS_RENDER_IIFE;
93934
94588
  }
@@ -95262,10 +95916,11 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
95262
95916
  if (isHttpUrl(video.src)) continue;
95263
95917
  const videoPath = resolve12(projectDir, video.src);
95264
95918
  const reencode = `ffmpeg -i "${video.src}" -c:v libx264 -r 30 -g 30 -keyint_min 30 -movflags +faststart -c:a copy output.mp4`;
95265
- Promise.all([
95266
- withMediaProbeSlot(() => analyzeKeyframeIntervals(videoPath)),
95267
- withMediaProbeSlot(() => extractMediaMetadata(videoPath))
95268
- ]).then(([analysis, metadata]) => {
95919
+ (async () => {
95920
+ const metadata = await withMediaProbeSlot(() => extractMediaMetadata(videoPath));
95921
+ const analysis = await withMediaProbeSlot(
95922
+ () => analyzeKeyframeIntervals(videoPath, metadata)
95923
+ );
95269
95924
  if (analysis.isProblematic) {
95270
95925
  defaultLogger.warn(
95271
95926
  `[Compiler] WARNING: Video "${video.id}" has sparse keyframes (max interval: ${analysis.maxIntervalSeconds}s). This causes seek failures and frame freezing. Re-encode with: ${reencode}`
@@ -95276,7 +95931,7 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
95276
95931
  `[Compiler] Video "${video.id}" is variable frame rate (VFR); the engine will normalize it to CFR before frame extraction. If rendering feels slow on this video, pre-encode once with: ${reencode}`
95277
95932
  );
95278
95933
  }
95279
- }).catch(() => {
95934
+ })().catch(() => {
95280
95935
  });
95281
95936
  }
95282
95937
  const { document: document2 } = parseHTML(html);
@@ -99327,6 +99982,7 @@ function envInt(name, fallback) {
99327
99982
  return Number.isInteger(parsed) ? parsed : fallback;
99328
99983
  }
99329
99984
  var MAX_REPORTED_ELEMENT_TAGS = 50;
99985
+ var VFX_CAPTURE_RANK = { none: 0, self: 1, backdrop: 2 };
99330
99986
  var ROOT_COMPOSITION_TAG_RE = /<[a-zA-Z][-a-zA-Z0-9]*\b[^>]*\bdata-composition-id=["'][^"']*["'][^>]*>/i;
99331
99987
  function bucketPxDelta(delta) {
99332
99988
  if (delta === 0) return "0";
@@ -99381,6 +100037,25 @@ function scanElementTags(html) {
99381
100037
  colorGradingCount++;
99382
100038
  if (!hasLut) hasLut = colorGradingValueHasLut(m[1] ?? m[2] ?? "");
99383
100039
  }
100040
+ let vfxHostCount = 0;
100041
+ let vfxCapture;
100042
+ const vfxTypeSet = /* @__PURE__ */ new Set();
100043
+ for (const m of markup.matchAll(new RegExp(`\\b${HF_VFX_ATTR}=(?:"([^"]*)"|'([^']*)')`, "gi"))) {
100044
+ vfxHostCount++;
100045
+ try {
100046
+ const chain = parseVfxChain(decodeHtmlAttrJson(m[1] ?? m[2] ?? ""));
100047
+ for (const node of chain.nodes) {
100048
+ if (node.enabled === false) continue;
100049
+ vfxTypeSet.add(node.type);
100050
+ }
100051
+ const capture = chainCapture(chain);
100052
+ if (vfxCapture === void 0 || VFX_CAPTURE_RANK[capture] > VFX_CAPTURE_RANK[vfxCapture]) {
100053
+ vfxCapture = capture;
100054
+ }
100055
+ } catch {
100056
+ }
100057
+ }
100058
+ const vfxTypes = [...vfxTypeSet].sort().join(",");
99384
100059
  return {
99385
100060
  total,
99386
100061
  byTag,
@@ -99392,11 +100067,17 @@ function scanElementTags(html) {
99392
100067
  audioGroupCount,
99393
100068
  colorGradingCount,
99394
100069
  hasLut,
100070
+ vfxHostCount,
100071
+ vfxCapture,
100072
+ vfxTypes,
99395
100073
  ...detectRootBodySizeMismatch(html)
99396
100074
  };
99397
100075
  }
100076
+ function decodeHtmlAttrJson(rawAttributeValue) {
100077
+ return rawAttributeValue.replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, "&");
100078
+ }
99398
100079
  function colorGradingValueHasLut(rawAttributeValue) {
99399
- const decoded = rawAttributeValue.replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, "&");
100080
+ const decoded = decodeHtmlAttrJson(rawAttributeValue);
99400
100081
  try {
99401
100082
  const parsed = JSON.parse(decoded);
99402
100083
  if (typeof parsed !== "object" || parsed === null || !("lut" in parsed)) return false;
@@ -99437,7 +100118,10 @@ async function resolveCompositionElementCount(probeSession, html) {
99437
100118
  colorGradingCount: scan.colorGradingCount,
99438
100119
  hasLut: scan.hasLut,
99439
100120
  rootBodyMismatch: scan.rootBodyMismatch,
99440
- rootBodyDeltaPxBucket: scan.rootBodyDeltaPxBucket
100121
+ rootBodyDeltaPxBucket: scan.rootBodyDeltaPxBucket,
100122
+ vfxHostCount: scan.vfxHostCount,
100123
+ vfxCapture: scan.vfxCapture,
100124
+ vfxTypes: scan.vfxTypes
99441
100125
  };
99442
100126
  }
99443
100127
  var KNOWN_RUNTIME_ADAPTERS = [
@@ -100249,7 +100933,10 @@ async function executeRenderPipeline(input) {
100249
100933
  colorGradingCount,
100250
100934
  hasLut,
100251
100935
  rootBodyMismatch,
100252
- rootBodyDeltaPxBucket
100936
+ rootBodyDeltaPxBucket,
100937
+ vfxHostCount,
100938
+ vfxCapture,
100939
+ vfxTypes
100253
100940
  } = await resolveCompositionElementCount(probeSession, compiled.html);
100254
100941
  const adaptersUsed = await resolveAdaptersUsed(probeSession, compiled.html);
100255
100942
  const deShortBandEnabled = deShortBandMaxElements > 0;
@@ -101325,6 +102012,9 @@ async function executeRenderPipeline(input) {
101325
102012
  hasLut,
101326
102013
  rootBodyMismatch,
101327
102014
  rootBodyDeltaPxBucket,
102015
+ vfxHostCount,
102016
+ vfxCapture,
102017
+ vfxTypes,
101328
102018
  shortBand: deShortBand,
101329
102019
  parallelRouter: deParallelRouter,
101330
102020
  preRouterWorkers: deParallelRouter ? preRoutingWorkerCount : void 0,
@@ -101533,14 +102223,14 @@ function describeValue(value) {
101533
102223
 
101534
102224
  // ../producer/src/renderRequest.ts
101535
102225
  var RENDER_REQUEST_VERSION = 1;
101536
- function isPlainObject2(value) {
102226
+ function isPlainObject3(value) {
101537
102227
  if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
101538
102228
  const proto = Object.getPrototypeOf(value);
101539
102229
  return proto === Object.prototype || proto === null;
101540
102230
  }
101541
102231
  function assertPositiveFps(options) {
101542
102232
  const fps = options.fps;
101543
- if (!isPlainObject2(fps) || typeof fps.num !== "number" || typeof fps.den !== "number" || !Number.isInteger(fps.num) || !Number.isInteger(fps.den) || fps.num <= 0 || fps.den <= 0) {
102233
+ if (!isPlainObject3(fps) || typeof fps.num !== "number" || typeof fps.den !== "number" || !Number.isInteger(fps.num) || !Number.isInteger(fps.den) || fps.num <= 0 || fps.den <= 0) {
101544
102234
  throw new Error("Render request fps must be a positive rational");
101545
102235
  }
101546
102236
  }
@@ -101570,7 +102260,7 @@ function isCanvasResolution(value) {
101570
102260
  return typeof value === "string" && VALID_CANVAS_RESOLUTIONS.some((resolution) => resolution === value);
101571
102261
  }
101572
102262
  function assertDistributedOptions(value) {
101573
- if (!isPlainObject2(value)) throw new Error("Render request distributed must be an object");
102263
+ if (!isPlainObject3(value)) throw new Error("Render request distributed must be an object");
101574
102264
  for (const field of ["width", "height"]) {
101575
102265
  if (typeof value[field] !== "number" || !Number.isInteger(value[field]) || value[field] <= 0) {
101576
102266
  throw new Error(`Render request distributed.${field} must be a positive integer`);
@@ -101618,13 +102308,13 @@ function assertRequestOptionScalars(options) {
101618
102308
  }
101619
102309
  function assertRequestOptionObjects(options) {
101620
102310
  validateEngineConfigSnapshot(options.engineConfig);
101621
- if (options.variables !== void 0 && !isPlainObject2(options.variables)) {
102311
+ if (options.variables !== void 0 && !isPlainObject3(options.variables)) {
101622
102312
  throw new Error("Render request variables must be a JSON object");
101623
102313
  }
101624
102314
  if (options.distributed !== void 0) assertDistributedOptions(options.distributed);
101625
102315
  }
101626
102316
  function assertRequestOptions(options) {
101627
- if (!isPlainObject2(options)) throw new Error("Render request options must be an object");
102317
+ if (!isPlainObject3(options)) throw new Error("Render request options must be an object");
101628
102318
  assertPositiveFps(options);
101629
102319
  if (!["draft", "standard", "high"].includes(String(options.quality))) {
101630
102320
  throw new Error("Render request quality is invalid");
@@ -101644,8 +102334,8 @@ function omitUndefinedProperties(value) {
101644
102334
  return Object.fromEntries(Object.entries(value).filter(([, item]) => item !== void 0));
101645
102335
  }
101646
102336
  function assertRenderRequest(value) {
101647
- if (!isPlainObject2(value) || value.version !== RENDER_REQUEST_VERSION) {
101648
- const version2 = isPlainObject2(value) ? value.version : void 0;
102337
+ if (!isPlainObject3(value) || value.version !== RENDER_REQUEST_VERSION) {
102338
+ const version2 = isPlainObject3(value) ? value.version : void 0;
101649
102339
  throw new Error(`Unsupported render request version: ${String(version2)}`);
101650
102340
  }
101651
102341
  assertNonEmptyPath(value.projectDir, "projectDir");
@@ -101941,7 +102631,7 @@ function extractSafeRenderErrorMetadata(error) {
101941
102631
  errorCode,
101942
102632
  errorOwner: owner === "user" || owner === "system" ? owner : void 0,
101943
102633
  retryable: typeof retryable === "boolean" ? retryable : void 0,
101944
- ...isPlainObject3(publicMetadata) ? { errorMetadata: publicMetadata } : {}
102634
+ ...isPlainObject4(publicMetadata) ? { errorMetadata: publicMetadata } : {}
101945
102635
  };
101946
102636
  }
101947
102637
  function parseServerFps(value) {
@@ -102009,11 +102699,11 @@ function parseRenderOptions(body) {
102009
102699
  videoFrameFormat
102010
102700
  };
102011
102701
  }
102012
- function isPlainObject3(value) {
102702
+ function isPlainObject4(value) {
102013
102703
  return typeof value === "object" && value !== null && !Array.isArray(value);
102014
102704
  }
102015
102705
  function parseRenderOverrides(body) {
102016
- const variables = isPlainObject3(body.variables) ? body.variables : void 0;
102706
+ const variables = isPlainObject4(body.variables) ? body.variables : void 0;
102017
102707
  const rawOutputResolution = typeof body.outputResolution === "string" ? body.outputResolution : void 0;
102018
102708
  const outputResolution = rawOutputResolution ? normalizeResolutionFlag(rawOutputResolution) : void 0;
102019
102709
  const outputResolutionAspectAgnostic = outputResolution ? isAspectAgnosticResolutionAlias(rawOutputResolution) : void 0;
@@ -102049,7 +102739,7 @@ function resolvePreparedRenderOutput(prepared, rendersDir, log) {
102049
102739
  return { input, cleanupProjectDir, absoluteOutputPath };
102050
102740
  }
102051
102741
  function validateRenderOverrides(body) {
102052
- if (body.variables !== void 0 && !isPlainObject3(body.variables)) {
102742
+ if (body.variables !== void 0 && !isPlainObject4(body.variables)) {
102053
102743
  return 'variables must be a JSON object keyed by variable id (e.g. {"title":"Hello"})';
102054
102744
  }
102055
102745
  if (body.outputDynamicRange !== void 0 && parseServerOutputDynamicRange(body.outputDynamicRange) === void 0) {
@@ -102748,8 +103438,8 @@ async function runFontLocalize(io, localize) {
102748
103438
  }
102749
103439
 
102750
103440
  // src/version.ts
102751
- var VERSION = true ? "0.8.62" : "0.0.0-dev";
102752
- var PRODUCER_VERSION = true ? "0.8.62" : "0.0.0-dev";
103441
+ var VERSION = true ? "0.8.64" : "0.0.0-dev";
103442
+ var PRODUCER_VERSION = true ? "0.8.64" : "0.0.0-dev";
102753
103443
 
102754
103444
  // src/fontLocalizeCli.ts
102755
103445
  async function readStdin() {