@shotstack/shotstack-studio 2.22.0 → 2.22.2

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.
@@ -226,7 +226,7 @@ class ha {
226
226
  return this.normaliseAdjacentBoundaries(i), this.validateKeyframes(i), this.insertFillerKeyframes(i, r, n);
227
227
  }
228
228
  createNormalizedKeyframes(e) {
229
- return e.filter((r) => typeof r.start == "number" && typeof r.length == "number").toSorted((r, n) => r.start - n.start).map((r) => ({
229
+ return e.filter((r) => typeof r.start == "number" && typeof r.length == "number").sort((r, n) => r.start - n.start).map((r) => ({
230
230
  start: r.start,
231
231
  length: r.length,
232
232
  from: typeof r.from == "number" ? r.from : 0,
@@ -580,7 +580,7 @@ class xx extends hx {
580
580
  this.uniformGroup.uniforms.uRevealFromRight = e ? 1 : 0;
581
581
  }
582
582
  }
583
- const mt = {
583
+ const pt = {
584
584
  // Playback
585
585
  PlaybackPlay: "playback:play",
586
586
  PlaybackPause: "playback:pause",
@@ -856,6 +856,11 @@ class nr extends Nx {
856
856
  clipId = null;
857
857
  /** True when the player's asset needs external resolution (e.g. alias caption awaiting transcription). */
858
858
  needsResolution = !1;
859
+ /**
860
+ * Why the asset couldn't be shown, or null. A failing player draws a placeholder and still
861
+ * resolves load() so the rest of the edit keeps loading; this is how the failure is reported.
862
+ */
863
+ loadError = null;
859
864
  edit;
860
865
  clipConfiguration;
861
866
  resolvedTiming;
@@ -905,8 +910,11 @@ class nr extends Nx {
905
910
  const y = [...d.in.brightnessKeyframes, ...d.out.brightnessKeyframes];
906
911
  y.length && (this.wipeBrightnessBuilder = new ha(y, e), this.wipeInFromRight = d.in.wipeFromRight, this.wipeOutFromRight = d.out.wipeFromRight, this.wipeOutStart = d.out.brightnessKeyframes[0]?.start ?? Number.POSITIVE_INFINITY);
907
912
  }
913
+ recordLoadError(e) {
914
+ this.loadError = e instanceof Error ? e.message : String(e);
915
+ }
908
916
  async load() {
909
- this.lumaWrapper?.destroyed && (this.lumaWrapper = new st.Container(), this.getContainer().addChild(this.lumaWrapper)), this.contentContainer?.destroyed && (this.contentContainer = new st.Container(), this.lumaWrapper.addChild(this.contentContainer)), this.getContainer().sortableChildren = !0, this.getContainer().cursor = "pointer", this.getContainer().eventMode = "static", this.getContainer().on?.("pointerdown", this.onPointerDown.bind(this));
917
+ this.loadError = null, this.lumaWrapper?.destroyed && (this.lumaWrapper = new st.Container(), this.getContainer().addChild(this.lumaWrapper)), this.contentContainer?.destroyed && (this.contentContainer = new st.Container(), this.lumaWrapper.addChild(this.contentContainer)), this.getContainer().sortableChildren = !0, this.getContainer().cursor = "pointer", this.getContainer().eventMode = "static", this.getContainer().on?.("pointerdown", this.onPointerDown.bind(this));
910
918
  }
911
919
  update(e, r) {
912
920
  this.applyPlayheadState();
@@ -8260,7 +8268,7 @@ var p9 = Ge({ "node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-e
8260
8268
  for (var Qe = 0; Qe < 3 * A; Qe++)
8261
8269
  se[Qe] = new a(0, 0), he[Qe] = new a(0, 0);
8262
8270
  for (; !vt; ) {
8263
- var we = 0, Mr, Re = [1 << 28, 1 << 28, 1 << 28], Xt = [0], Yt = [1, 1, 1], or = [0, 1, 0, 1, 0, 1], dr = [0], Ke, ke, Ie, Un, $i = null, Li = null, fn, Gr = null, pr, zr = 0, ur = null, Zi = 0, jn = 0, T = null, pt = 0, qt = 0, de = 0, ne, Le;
8271
+ var we = 0, Mr, Re = [1 << 28, 1 << 28, 1 << 28], Xt = [0], Yt = [1, 1, 1], or = [0, 1, 0, 1, 0, 1], dr = [0], Ke, ke, Ie, Un, $i = null, Li = null, fn, Gr = null, pr, zr = 0, ur = null, Zi = 0, jn = 0, T = null, mt = 0, qt = 0, de = 0, ne, Le;
8264
8272
  for (et = 0; et < 3; ++et)
8265
8273
  xt[et].codes = null, xt[et].htrees = null;
8266
8274
  yt.readMoreInput();
@@ -8295,7 +8303,7 @@ var p9 = Ge({ "node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-e
8295
8303
  if (we -= Hn, we <= 0) break;
8296
8304
  if (cr < 0) {
8297
8305
  var Ui;
8298
- if (yt.readMoreInput(), Re[2] === 0 && (jt(Yt[2], se, 2, Xt, or, dr, yt), Re[2] = ht(he, 2 * A, yt), jn = Xt[2] << b, T = jn), --Re[2], Ui = (lr > 4 ? 3 : lr - 2) & 255, pt = Gr[T + Ui], cr = j(xt[2].codes, xt[2].htrees[pt], yt), cr >= ke) {
8306
+ if (yt.readMoreInput(), Re[2] === 0 && (jt(Yt[2], se, 2, Xt, or, dr, yt), Re[2] = ht(he, 2 * A, yt), jn = Xt[2] << b, T = jn), --Re[2], Ui = (lr > 4 ? 3 : lr - 2) & 255, mt = Gr[T + Ui], cr = j(xt[2].codes, xt[2].htrees[mt], yt), cr >= ke) {
8299
8307
  var ji, qo, Wr;
8300
8308
  cr -= ke, qo = cr & Ie, cr >>= Ke, ji = (cr >> 1) + 1, Wr = (2 + (cr & 1) << ji) - 4, cr = ke + (Wr + yt.readBits(ji) << Ke) + qo;
8301
8309
  }
@@ -14630,6 +14638,8 @@ var ZI = { gsap: `/*!
14630
14638
  var origGsapPause = origGsapTl && typeof origGsapTl.pause === "function" ? origGsapTl.pause.bind(origGsapTl) : null;
14631
14639
  var origGsapSeek = origGsapTl && typeof origGsapTl.seek === "function" ? origGsapTl.seek.bind(origGsapTl) : null;
14632
14640
  var origGsapGetChildren = origGsapTl && typeof origGsapTl.getChildren === "function" ? origGsapTl.getChildren.bind(origGsapTl) : null;
14641
+ // Capture may queue longer than an animation lasts; only the host advances its clock.
14642
+ if (origGsapPause) origGsapPause(0);
14633
14643
  var origLottieRegistered = window.lottie && typeof window.lottie.getRegisteredAnimations === "function" ? window.lottie.getRegisteredAnimations.bind(window.lottie) : null;
14634
14644
  var animeInstances = [];
14635
14645
 
@@ -14706,7 +14716,7 @@ ${HI(n)}
14706
14716
  </body>
14707
14717
  </html>`;
14708
14718
  }
14709
- var YI = "v2";
14719
+ var YI = "v3";
14710
14720
  async function qI(t) {
14711
14721
  const e = `${YI} ${t.html} ${t.css} ${t.js} ${t.width} ${t.height}`, r = new TextEncoder().encode(e), n = await crypto.subtle.digest("SHA-256", r);
14712
14722
  return Array.from(new Uint8Array(n)).map((i) => i.toString(16).padStart(2, "0")).join("");
@@ -19757,7 +19767,7 @@ function _V() {
19757
19767
  pr && Zi === pr._level ? (pr._end = zr, pr._endsWithIsolInit = jn) : Gr.push(pr = { _start: zr, _end: zr, _level: Zi, _startsWithPDI: T, _endsWithIsolInit: jn });
19758
19768
  }
19759
19769
  }
19760
- for (var pt = [], qt = 0; qt < Gr.length; qt++) {
19770
+ for (var mt = [], qt = 0; qt < Gr.length; qt++) {
19761
19771
  var de = Gr[qt];
19762
19772
  if (!de._startsWithPDI || de._startsWithPDI && !se.has(de._start)) {
19763
19773
  for (var ne = [pr = de], Le = void 0; pr && pr._endsWithIsolInit && (Le = se.get(pr._end)) != null; )
@@ -19782,11 +19792,11 @@ function _V() {
19782
19792
  break;
19783
19793
  }
19784
19794
  }
19785
- pt.push({ _seqIndices: si, _sosType: Math.max(xa, Wn) % 2 ? B : L, _eosType: Math.max(cr, lr) % 2 ? B : L });
19795
+ mt.push({ _seqIndices: si, _sosType: Math.max(xa, Wn) % 2 ? B : L, _eosType: Math.max(cr, lr) % 2 ? B : L });
19786
19796
  }
19787
19797
  }
19788
- for (var Ui = 0; Ui < pt.length; Ui++) {
19789
- var gi = pt[Ui], Dt = gi._seqIndices, ji = gi._sosType, qo = gi._eosType, Wr = xt[Dt[0]] & 1 ? B : L;
19798
+ for (var Ui = 0; Ui < mt.length; Ui++) {
19799
+ var gi = mt[Ui], Dt = gi._seqIndices, ji = gi._sosType, qo = gi._eosType, Wr = xt[Dt[0]] & 1 ? B : L;
19790
19800
  if (Ft.get(W))
19791
19801
  for (var Yn = 0; Yn < Dt.length; Yn++) {
19792
19802
  var ds = Dt[Yn];
@@ -38451,7 +38461,7 @@ class Cl extends nr {
38451
38461
  emitCaptureFailed(e, r) {
38452
38462
  const n = e instanceof Error ? e.message : String(e);
38453
38463
  try {
38454
- this.edit.getInternalEvents().emit(mt.ClipCaptureFailed, {
38464
+ this.edit.getInternalEvents().emit(pt.ClipCaptureFailed, {
38455
38465
  clipId: this.clipId,
38456
38466
  assetType: "html5",
38457
38467
  error: n,
@@ -38463,7 +38473,7 @@ class Cl extends nr {
38463
38473
  }
38464
38474
  emitCaptureStarted() {
38465
38475
  try {
38466
- this.edit.getInternalEvents().emit(mt.ClipCaptureStarted, {
38476
+ this.edit.getInternalEvents().emit(pt.ClipCaptureStarted, {
38467
38477
  clipId: this.clipId,
38468
38478
  assetType: "html5"
38469
38479
  });
@@ -38473,7 +38483,7 @@ class Cl extends nr {
38473
38483
  }
38474
38484
  emitCaptureCompleted(e) {
38475
38485
  try {
38476
- this.edit.getInternalEvents().emit(mt.ClipCaptureCompleted, {
38486
+ this.edit.getInternalEvents().emit(pt.ClipCaptureCompleted, {
38477
38487
  clipId: this.clipId,
38478
38488
  assetType: "html5",
38479
38489
  frameCount: e
@@ -38749,8 +38759,8 @@ class e$ extends nr {
38749
38759
  await super.load();
38750
38760
  try {
38751
38761
  await this.loadTexture(), this.configureKeyframes();
38752
- } catch {
38753
- this.createFallbackGraphic();
38762
+ } catch (e) {
38763
+ this.recordLoadError(e), this.createFallbackGraphic();
38754
38764
  }
38755
38765
  }
38756
38766
  createFallbackGraphic() {
@@ -38774,11 +38784,11 @@ class e$ extends nr {
38774
38784
  }
38775
38785
  /** Reload the image asset when asset.src changes (e.g., merge field update) */
38776
38786
  async reloadAsset() {
38777
- this.disposeTexture(), this.clearPlaceholder();
38787
+ this.disposeTexture(), this.clearPlaceholder(), this.loadError = null;
38778
38788
  try {
38779
38789
  await this.loadTexture();
38780
- } catch {
38781
- this.createFallbackGraphic();
38790
+ } catch (e) {
38791
+ this.recordLoadError(e), this.createFallbackGraphic();
38782
38792
  }
38783
38793
  }
38784
38794
  async loadTexture() {
@@ -39103,8 +39113,8 @@ function S6(t, e, r) {
39103
39113
  }, s = ({ clipId: u, error: l }) => {
39104
39114
  u === e && r.setFailed(l);
39105
39115
  }, o = t.getInternalEvents();
39106
- return o.on(mt.ClipGenerationStarted, i), o.on(mt.ClipGenerationCompleted, a), o.on(mt.ClipGenerationFailed, s), () => {
39107
- o.off(mt.ClipGenerationStarted, i), o.off(mt.ClipGenerationCompleted, a), o.off(mt.ClipGenerationFailed, s);
39116
+ return o.on(pt.ClipGenerationStarted, i), o.on(pt.ClipGenerationCompleted, a), o.on(pt.ClipGenerationFailed, s), () => {
39117
+ o.off(pt.ClipGenerationStarted, i), o.off(pt.ClipGenerationCompleted, a), o.off(pt.ClipGenerationFailed, s);
39108
39118
  };
39109
39119
  }
39110
39120
  class _1 extends nr {
@@ -41780,6 +41790,7 @@ class qi extends nr {
41780
41790
  renderedWidth = 0;
41781
41791
  renderedHeight = 0;
41782
41792
  pendingRender = null;
41793
+ placeholder = null;
41783
41794
  constructor(e, r) {
41784
41795
  super(e, r, De.Svg);
41785
41796
  }
@@ -41802,27 +41813,36 @@ class qi extends nr {
41802
41813
  r !== e.src && (e = { ...e, src: r });
41803
41814
  }
41804
41815
  try {
41805
- if (!AL.safeParse(e).success) {
41806
- this.createFallbackGraphic();
41816
+ const r = AL.safeParse(e);
41817
+ if (!r.success) {
41818
+ this.recordLoadError(`Invalid svg asset: ${r.error.issues.map((n) => n.message).join("; ")}`), this.createFallbackGraphic();
41807
41819
  return;
41808
41820
  }
41809
41821
  await qi.initializeResvg(), await this.doRender(), this.configureKeyframes();
41810
41822
  } catch (r) {
41811
- console.error("Failed to render SVG asset:", r), this.createFallbackGraphic();
41823
+ console.error("Failed to render SVG asset:", r), this.recordLoadError(r), this.createFallbackGraphic();
41812
41824
  }
41813
41825
  }
41814
41826
  async reloadAsset() {
41815
- await this.rerenderAtCurrentDimensions();
41827
+ this.loadError = null;
41828
+ try {
41829
+ await this.rerenderAtCurrentDimensions();
41830
+ } catch (e) {
41831
+ console.error("Failed to render SVG asset:", e), this.recordLoadError(e), this.createFallbackGraphic();
41832
+ }
41816
41833
  }
41817
41834
  createFallbackGraphic() {
41818
- const e = this.clipConfiguration.width || this.edit.size.width, r = this.clipConfiguration.height || this.edit.size.height, n = Ho(e, r);
41819
- this.renderedWidth = e, this.renderedHeight = r, this.contentContainer.addChild(n), this.configureKeyframes();
41835
+ const e = this.clipConfiguration.width || this.edit.size.width, r = this.clipConfiguration.height || this.edit.size.height;
41836
+ this.clearPlaceholder(), this.placeholder = Ho(e, r), this.renderedWidth = e, this.renderedHeight = r, this.contentContainer.addChild(this.placeholder), this.configureKeyframes();
41837
+ }
41838
+ clearPlaceholder() {
41839
+ this.placeholder && (this.contentContainer.removeChild(this.placeholder), this.placeholder.destroy(), this.placeholder = null);
41820
41840
  }
41821
41841
  update(e, r) {
41822
41842
  super.update(e, r);
41823
41843
  }
41824
41844
  dispose() {
41825
- super.dispose(), this.pendingRender = null, this.sprite && (this.sprite.destroy(), this.sprite = null), this.texture && (this.texture.destroy(!0), this.texture = null);
41845
+ super.dispose(), this.pendingRender = null, this.placeholder = null, this.sprite && (this.sprite.destroy(), this.sprite = null), this.texture && (this.texture.destroy(!0), this.texture = null);
41826
41846
  }
41827
41847
  getSize() {
41828
41848
  return this.clipConfiguration.width && this.clipConfiguration.height ? {
@@ -41849,7 +41869,14 @@ class qi extends nr {
41849
41869
  this.rerenderAtCurrentDimensions();
41850
41870
  }
41851
41871
  async rerenderAtCurrentDimensions() {
41852
- this.pendingRender && await this.pendingRender, this.sprite && (this.contentContainer.removeChild(this.sprite), this.sprite.destroy(), this.sprite = null), this.texture && (this.texture.destroy(!0), this.texture = null), this.pendingRender = this.doRender(), await this.pendingRender, this.pendingRender = null;
41872
+ this.pendingRender && await this.pendingRender.catch(() => {
41873
+ }), this.sprite && (this.contentContainer.removeChild(this.sprite), this.sprite.destroy(), this.sprite = null), this.texture && (this.texture.destroy(!0), this.texture = null), this.pendingRender = this.doRender();
41874
+ try {
41875
+ await this.pendingRender;
41876
+ } finally {
41877
+ this.pendingRender = null;
41878
+ }
41879
+ this.clearPlaceholder();
41853
41880
  }
41854
41881
  async doRender() {
41855
41882
  const e = this.clipConfiguration.asset, r = this.clipConfiguration.width || this.edit.size.width, n = this.clipConfiguration.height || this.edit.size.height, i = await $I(e, {
@@ -42462,7 +42489,7 @@ class eZ extends nr {
42462
42489
  try {
42463
42490
  await this.loadVideo(), this.configureKeyframes();
42464
42491
  } catch (e) {
42465
- console.warn(`[VideoPlayer.load] FAILED clipId=${this.clipId}:`, e), this.createFallbackGraphic();
42492
+ console.warn(`[VideoPlayer.load] FAILED clipId=${this.clipId}:`, e), this.recordLoadError(e), this.createFallbackGraphic();
42466
42493
  } finally {
42467
42494
  this.skipVideoUpdate = !1;
42468
42495
  }
@@ -42493,11 +42520,11 @@ class eZ extends nr {
42493
42520
  }
42494
42521
  /** Reload the video asset when asset.src changes (e.g., merge field update) */
42495
42522
  async reloadAsset() {
42496
- this.skipVideoUpdate = !0, this.isPlaying = !1, this.syncTimer = 0, this.activeSyncTimer = 0;
42523
+ this.skipVideoUpdate = !0, this.isPlaying = !1, this.syncTimer = 0, this.activeSyncTimer = 0, this.loadError = null;
42497
42524
  try {
42498
42525
  this.disposeVideo(), this.clearPlaceholder(), await this.loadVideo();
42499
42526
  } catch (e) {
42500
- console.warn(`[VideoPlayer.reloadAsset] FAILED clipId=${this.clipId}:`, e), this.createFallbackGraphic();
42527
+ console.warn(`[VideoPlayer.reloadAsset] FAILED clipId=${this.clipId}:`, e), this.recordLoadError(e), this.createFallbackGraphic();
42501
42528
  } finally {
42502
42529
  this.skipVideoUpdate = !1;
42503
42530
  }
@@ -42682,12 +42709,12 @@ class Cp {
42682
42709
  if (!e) throw new Error("AddTrackCommand.execute: context is required");
42683
42710
  const r = e.getDocument();
42684
42711
  if (!r) throw new Error("AddTrackCommand.execute: document is required");
42685
- if (r.addTrack(this.trackIdx, this.preparedTrack), e.resolve(), e.updateDuration(), e.emitEvent(mt.TrackAdded, {
42712
+ if (r.addTrack(this.trackIdx, this.preparedTrack), e.resolve(), e.updateDuration(), e.emitEvent(pt.TrackAdded, {
42686
42713
  trackIndex: this.trackIdx,
42687
42714
  totalTracks: r.getTrackCount()
42688
42715
  }), this.preparedTrack)
42689
42716
  for (let n = 0; n < this.preparedTrack.clips.length; n += 1)
42690
- e.emitEvent(mt.ClipAdded, {
42717
+ e.emitEvent(pt.ClipAdded, {
42691
42718
  trackIndex: this.trackIdx,
42692
42719
  clipIndex: n
42693
42720
  });
@@ -42700,11 +42727,11 @@ class Cp {
42700
42727
  const i = r.getTrack(this.trackIdx)?.clips.length ?? 0;
42701
42728
  r.removeTrack(this.trackIdx), e.resolve(), e.updateDuration();
42702
42729
  for (let a = i - 1; a >= 0; a -= 1)
42703
- e.emitEvent(mt.ClipDeleted, {
42730
+ e.emitEvent(pt.ClipDeleted, {
42704
42731
  trackIndex: this.trackIdx,
42705
42732
  clipIndex: a
42706
42733
  });
42707
- return e.emitEvent(mt.TrackRemoved, { trackIndex: this.trackIdx }), ce();
42734
+ return e.emitEvent(pt.TrackRemoved, { trackIndex: this.trackIdx }), ce();
42708
42735
  }
42709
42736
  dispose() {
42710
42737
  }
@@ -42903,7 +42930,7 @@ class CZ {
42903
42930
  const n = e.documentAddClip(this.trackIdx, this.clip);
42904
42931
  this.addedClipId = n.id, this.convertedReferences && this.convertedReferences.size > 0 && Ep(r, this.convertedReferences), e.resolve(), e.updateDuration();
42905
42932
  const s = e.getDocumentTrack(this.trackIdx)?.clips?.findIndex((o) => o.id === this.addedClipId) ?? -1;
42906
- return e.emitEvent(mt.ClipAdded, {
42933
+ return e.emitEvent(pt.ClipAdded, {
42907
42934
  trackIndex: this.trackIdx,
42908
42935
  clipIndex: s
42909
42936
  }), ce();
@@ -42922,7 +42949,7 @@ class CZ {
42922
42949
  this.convertedReferences = Ap(r, e.getEditState(), s, u);
42923
42950
  }
42924
42951
  const o = e.getSelectedClip();
42925
- return o && o.clipId === this.addedClipId && (e.setSelectedClip(null), e.emitEvent(mt.SelectionCleared)), e.documentRemoveClip(this.trackIdx, a), e.resolve(), e.updateDuration(), e.emitEvent(mt.ClipDeleted, {
42952
+ return o && o.clipId === this.addedClipId && (e.setSelectedClip(null), e.emitEvent(pt.SelectionCleared)), e.documentRemoveClip(this.trackIdx, a), e.resolve(), e.updateDuration(), e.emitEvent(pt.ClipDeleted, {
42926
42953
  trackIndex: this.trackIdx,
42927
42954
  clipIndex: a
42928
42955
  }), ce();
@@ -42991,7 +43018,7 @@ class kp {
42991
43018
  a.add(`${this.trackIdx}:${s}`);
42992
43019
  this.convertedReferences = _Z(r, e.getEditState(), i, a);
42993
43020
  }
42994
- return r.removeTrack(this.trackIdx), e.resolve(), e.updateDuration(), e.emitEvent(mt.TrackRemoved, { trackIndex: this.trackIdx }), ce();
43021
+ return r.removeTrack(this.trackIdx), e.resolve(), e.updateDuration(), e.emitEvent(pt.TrackRemoved, { trackIndex: this.trackIdx }), ce();
42995
43022
  }
42996
43023
  undo(e) {
42997
43024
  if (!e) throw new Error("DeleteTrackCommand.undo: context is required");
@@ -43000,7 +43027,7 @@ class kp {
43000
43027
  r.addTrack(this.trackIdx);
43001
43028
  for (let n = 0; n < this.deletedClips.length; n += 1)
43002
43029
  r.addClip(this.trackIdx, this.deletedClips[n], n);
43003
- return this.convertedReferences && this.convertedReferences.size > 0 && Ep(r, this.convertedReferences), e.resolve(), e.updateDuration(), e.emitEvent(mt.TrackAdded, { trackIndex: this.trackIdx, totalTracks: r.getTrackCount() }), ce();
43030
+ return this.convertedReferences && this.convertedReferences.size > 0 && Ep(r, this.convertedReferences), e.resolve(), e.updateDuration(), e.emitEvent(pt.TrackAdded, { trackIndex: this.trackIdx, totalTracks: r.getTrackCount() }), ce();
43004
43031
  }
43005
43032
  dispose() {
43006
43033
  this.deletedClips = [], this.convertedReferences = void 0;
@@ -43037,9 +43064,9 @@ class j0 {
43037
43064
  }
43038
43065
  e.clearClipError(this.trackIdx, this.clipIdx);
43039
43066
  const a = e.getSelectedClip();
43040
- a && this.deletedClipId && a.clipId === this.deletedClipId && (e.setSelectedClip(null), e.emitEvent(mt.SelectionCleared)), e.documentRemoveClip(this.trackIdx, this.clipIdx);
43067
+ a && this.deletedClipId && a.clipId === this.deletedClipId && (e.setSelectedClip(null), e.emitEvent(pt.SelectionCleared)), e.documentRemoveClip(this.trackIdx, this.clipIdx);
43041
43068
  const s = r.getTrack(this.trackIdx);
43042
- return s && s.clips.length === 0 && (this.deleteTrackCommand = new kp(this.trackIdx), this.deleteTrackCommand.execute(e).status === "success" && (this.trackWasDeleted = !0)), e.resolve(), e.updateDuration(), e.emitEvent(mt.ClipDeleted, {
43069
+ return s && s.clips.length === 0 && (this.deleteTrackCommand = new kp(this.trackIdx), this.deleteTrackCommand.execute(e).status === "success" && (this.trackWasDeleted = !0)), e.resolve(), e.updateDuration(), e.emitEvent(pt.ClipDeleted, {
43043
43070
  trackIndex: this.trackIdx,
43044
43071
  clipIndex: this.clipIdx
43045
43072
  }), ce();
@@ -43051,10 +43078,10 @@ class j0 {
43051
43078
  if (!r) throw new Error("DeleteClipCommand.undo: no document");
43052
43079
  this.trackWasDeleted && r.addTrack(this.trackIdx);
43053
43080
  const i = e.documentAddClip(this.trackIdx, this.deletedClipConfig, this.clipIdx).id;
43054
- return i && this.storedBindings && this.storedBindings.size > 0 && r.setClipBindingsForClip(i, this.storedBindings), this.convertedReferences && this.convertedReferences.size > 0 && Ep(r, this.convertedReferences), e.resolve(), e.updateDuration(), this.trackWasDeleted && (e.emitEvent(mt.TrackAdded, {
43081
+ return i && this.storedBindings && this.storedBindings.size > 0 && r.setClipBindingsForClip(i, this.storedBindings), this.convertedReferences && this.convertedReferences.size > 0 && Ep(r, this.convertedReferences), e.resolve(), e.updateDuration(), this.trackWasDeleted && (e.emitEvent(pt.TrackAdded, {
43055
43082
  trackIndex: this.trackIdx,
43056
43083
  totalTracks: r.getTrackCount()
43057
- }), this.trackWasDeleted = !1), e.emitEvent(mt.ClipRestored, {
43084
+ }), this.trackWasDeleted = !1), e.emitEvent(pt.ClipRestored, {
43058
43085
  trackIndex: this.trackIdx,
43059
43086
  clipIndex: this.clipIdx
43060
43087
  }), ce();
@@ -43092,7 +43119,7 @@ class EZ {
43092
43119
  const s = r.getClip(this.effectiveToTrackIndex, this.newClipIndex);
43093
43120
  if (!this.previousDocClip || !s)
43094
43121
  throw new Error(`MoveClipCommand: document clip not found after mutation at ${this.effectiveToTrackIndex}/${this.newClipIndex}`);
43095
- e.emitEvent(mt.ClipUpdated, {
43122
+ e.emitEvent(pt.ClipUpdated, {
43096
43123
  previous: {
43097
43124
  clip: qe(this.previousDocClip),
43098
43125
  trackIndex: this.fromTrackIndex,
@@ -43105,7 +43132,7 @@ class EZ {
43105
43132
  }
43106
43133
  });
43107
43134
  const o = this.clipId ? e.getPlayerByClipId(this.clipId) : n;
43108
- return o && (e.setSelectedClip(o), e.emitEvent(mt.ClipSelected, {
43135
+ return o && (e.setSelectedClip(o), e.emitEvent(pt.ClipSelected, {
43109
43136
  clip: qe(s),
43110
43137
  trackIndex: this.effectiveToTrackIndex,
43111
43138
  clipIndex: this.newClipIndex
@@ -43124,7 +43151,7 @@ class EZ {
43124
43151
  start: this.originalStart
43125
43152
  }), e.resolve(), e.updateDuration(), this.fromTrackIndex !== this.effectiveToTrackIndex && e.propagateTimingChanges(this.effectiveToTrackIndex, this.newClipIndex - 1), e.propagateTimingChanges(this.fromTrackIndex, this.fromClipIndex);
43126
43153
  const a = r.getClip(this.fromTrackIndex, this.fromClipIndex);
43127
- this.previousDocClip && e.emitEvent(mt.ClipUpdated, {
43154
+ this.previousDocClip && e.emitEvent(pt.ClipUpdated, {
43128
43155
  previous: {
43129
43156
  clip: qe(i ?? this.previousDocClip),
43130
43157
  trackIndex: this.effectiveToTrackIndex,
@@ -43137,7 +43164,7 @@ class EZ {
43137
43164
  }
43138
43165
  });
43139
43166
  const s = e.getPlayerByClipId(this.clipId);
43140
- return s && a && (e.setSelectedClip(s), e.emitEvent(mt.ClipSelected, {
43167
+ return s && a && (e.setSelectedClip(s), e.emitEvent(pt.ClipSelected, {
43141
43168
  clip: qe(a),
43142
43169
  trackIndex: this.fromTrackIndex,
43143
43170
  clipIndex: this.fromClipIndex
@@ -43323,7 +43350,7 @@ class ku {
43323
43350
  const v = e.getDocumentClip(o, u);
43324
43351
  if (!this.previousDocClip || !v)
43325
43352
  throw new Error(`SetUpdatedClipCommand: document clip not found after mutation at ${o}/${u}`);
43326
- return e.emitEvent(mt.ClipUpdated, {
43353
+ return e.emitEvent(pt.ClipUpdated, {
43327
43354
  previous: { clip: qe(this.previousDocClip), trackIndex: o, clipIndex: u },
43328
43355
  current: { clip: qe(v), trackIndex: o, clipIndex: u }
43329
43356
  }), ce();
@@ -43349,7 +43376,7 @@ class ku {
43349
43376
  const h = e.getDocumentClip(a, s);
43350
43377
  if (!o || !h)
43351
43378
  throw new Error(`SetUpdatedClipCommand: document clip not found after undo at ${a}/${s}`);
43352
- return e.emitEvent(mt.ClipUpdated, {
43379
+ return e.emitEvent(pt.ClipUpdated, {
43353
43380
  previous: { clip: qe(o), trackIndex: a, clipIndex: s },
43354
43381
  current: { clip: qe(h), trackIndex: a, clipIndex: s }
43355
43382
  }), ce();
@@ -43384,7 +43411,7 @@ class TZ {
43384
43411
  }), e.updateDuration();
43385
43412
  const u = e.getDocumentClip(this.trackIndex, this.clipIndex);
43386
43413
  if (!u) throw new Error(`UpdateClipTimingCommand: document clip not found after mutation at ${this.trackIndex}/${this.clipIndex}`);
43387
- return e.emitEvent(mt.ClipUpdated, {
43414
+ return e.emitEvent(pt.ClipUpdated, {
43388
43415
  previous: { trackIndex: this.trackIndex, clipIndex: this.clipIndex, clip: qe(s) },
43389
43416
  current: { trackIndex: this.trackIndex, clipIndex: this.clipIndex, clip: qe(u) }
43390
43417
  }), e.propagateTimingChanges(this.trackIndex, this.clipIndex), ce();
@@ -43404,7 +43431,7 @@ class TZ {
43404
43431
  const s = e.getDocumentClip(this.trackIndex, this.clipIndex);
43405
43432
  if (!i || !s)
43406
43433
  throw new Error(`UpdateClipTimingCommand: document clip not found after undo at ${this.trackIndex}/${this.clipIndex}`);
43407
- return e.emitEvent(mt.ClipUpdated, {
43434
+ return e.emitEvent(pt.ClipUpdated, {
43408
43435
  previous: { trackIndex: this.trackIndex, clipIndex: this.clipIndex, clip: qe(i) },
43409
43436
  current: { trackIndex: this.trackIndex, clipIndex: this.clipIndex, clip: qe(s) }
43410
43437
  }), e.propagateTimingChanges(this.trackIndex, this.clipIndex), ce();
@@ -43436,7 +43463,7 @@ class PZ {
43436
43463
  const u = e.getDocumentClip(this.trackIndex, this.clipIndex);
43437
43464
  if (!this.previousDocClip || !u)
43438
43465
  throw new Error(`UpdateTextContentCommand: document clip not found after mutation at ${this.trackIndex}/${this.clipIndex}`);
43439
- return e.emitEvent(mt.ClipUpdated, {
43466
+ return e.emitEvent(pt.ClipUpdated, {
43440
43467
  previous: { clip: qe(this.previousDocClip), trackIndex: this.trackIndex, clipIndex: this.clipIndex },
43441
43468
  current: { clip: qe(u), trackIndex: this.trackIndex, clipIndex: this.clipIndex }
43442
43469
  }), ce();
@@ -43453,7 +43480,7 @@ class PZ {
43453
43480
  if (this.previousDocClip) {
43454
43481
  if (!n || !o)
43455
43482
  throw new Error(`UpdateTextContentCommand: document clip not found after undo at ${this.trackIndex}/${this.clipIndex}`);
43456
- e.emitEvent(mt.ClipUpdated, {
43483
+ e.emitEvent(pt.ClipUpdated, {
43457
43484
  previous: { clip: qe(n), trackIndex: this.trackIndex, clipIndex: this.clipIndex },
43458
43485
  current: { clip: qe(o), trackIndex: this.trackIndex, clipIndex: this.clipIndex }
43459
43486
  });
@@ -43597,10 +43624,10 @@ class VZ {
43597
43624
  }
43598
43625
  }
43599
43626
  setupEventListeners() {
43600
- this.events.on(ge.PlayerLoaded, this.onPlayerLoadedBound), this.events.on(mt.ClipUpdated, this.onClipChangedBound), this.events.on(ge.PlayerMovedBetweenTracks, this.onClipChangedBound);
43627
+ this.events.on(ge.PlayerLoaded, this.onPlayerLoadedBound), this.events.on(pt.ClipUpdated, this.onClipChangedBound), this.events.on(ge.PlayerMovedBetweenTracks, this.onClipChangedBound);
43601
43628
  }
43602
43629
  removeEventListeners() {
43603
- this.events.off(ge.PlayerLoaded, this.onPlayerLoadedBound), this.events.off(mt.ClipUpdated, this.onClipChangedBound), this.events.off(ge.PlayerMovedBetweenTracks, this.onClipChangedBound);
43630
+ this.events.off(ge.PlayerLoaded, this.onPlayerLoadedBound), this.events.off(pt.ClipUpdated, this.onClipChangedBound), this.events.off(ge.PlayerMovedBetweenTracks, this.onClipChangedBound);
43604
43631
  }
43605
43632
  processPendingMaskCleanup() {
43606
43633
  for (let e = this.pendingMaskCleanup.length - 1; e >= 0; e -= 1) {
@@ -43653,7 +43680,7 @@ class LZ {
43653
43680
  * @param options.silent If true, suppresses event emission (for command-based operations)
43654
43681
  */
43655
43682
  register(e, r) {
43656
- this.fields.set(e.name, e), r?.silent || this.events.emit(mt.MergeFieldChanged, { fields: this.getAll() });
43683
+ this.fields.set(e.name, e), r?.silent || this.events.emit(pt.MergeFieldChanged, { fields: this.getAll() });
43657
43684
  }
43658
43685
  /**
43659
43686
  * Remove a merge field by name.
@@ -43662,7 +43689,7 @@ class LZ {
43662
43689
  */
43663
43690
  remove(e, r) {
43664
43691
  const n = this.fields.delete(e);
43665
- return n && !r?.silent && this.events.emit(mt.MergeFieldChanged, { fields: this.getAll() }), n;
43692
+ return n && !r?.silent && this.events.emit(pt.MergeFieldChanged, { fields: this.getAll() }), n;
43666
43693
  }
43667
43694
  /** Get a merge field by name */
43668
43695
  get(e) {
@@ -43793,7 +43820,7 @@ class UZ {
43793
43820
  size: n
43794
43821
  }, delete i.output.resolution, delete i.output.aspectRatio);
43795
43822
  const a = this.edit.getDocument();
43796
- a?.setSize(n), a?.clearResolution(), a?.clearAspectRatio(), this.edit.updateCanvasForSize(), this.edit.getInternalEvents().emit(mt.OutputResized, n);
43823
+ a?.setSize(n), a?.clearResolution(), a?.clearAspectRatio(), this.edit.updateCanvasForSize(), this.edit.getInternalEvents().emit(pt.OutputResized, n);
43797
43824
  }
43798
43825
  getSize() {
43799
43826
  return this.edit.size;
@@ -43807,7 +43834,7 @@ class UZ {
43807
43834
  n && (n.output = {
43808
43835
  ...n.output,
43809
43836
  fps: r
43810
- }), this.edit.getDocument()?.setFps(r), this.edit.getInternalEvents().emit(mt.OutputFpsChanged, { fps: e });
43837
+ }), this.edit.getDocument()?.setFps(r), this.edit.getInternalEvents().emit(pt.OutputFpsChanged, { fps: e });
43811
43838
  }
43812
43839
  getFps() {
43813
43840
  return this.edit.getResolvedEdit()?.output?.fps ?? 30;
@@ -43818,7 +43845,7 @@ class UZ {
43818
43845
  n && (n.output = {
43819
43846
  ...n.output,
43820
43847
  format: r
43821
- }), this.edit.getDocument()?.setFormat(r), this.edit.getInternalEvents().emit(mt.OutputFormatChanged, { format: r });
43848
+ }), this.edit.getDocument()?.setFormat(r), this.edit.getInternalEvents().emit(pt.OutputFormatChanged, { format: r });
43822
43849
  }
43823
43850
  getFormat() {
43824
43851
  return this.edit.getResolvedEdit()?.output?.format ?? "mp4";
@@ -43829,7 +43856,7 @@ class UZ {
43829
43856
  n && (n.output = {
43830
43857
  ...n.output,
43831
43858
  destinations: r
43832
- }), this.edit.getInternalEvents().emit(mt.OutputDestinationsChanged, { destinations: r });
43859
+ }), this.edit.getInternalEvents().emit(pt.OutputDestinationsChanged, { destinations: r });
43833
43860
  }
43834
43861
  getDestinations() {
43835
43862
  return this.edit.getResolvedEdit()?.output?.destinations ?? [];
@@ -43842,7 +43869,7 @@ class UZ {
43842
43869
  resolution: r
43843
43870
  }, delete n.output.size);
43844
43871
  const s = this.edit.getDocument();
43845
- s?.setResolution(r), s?.clearSize(), this.edit.updateCanvasForSize(), this.edit.getInternalEvents().emit(mt.OutputResolutionChanged, { resolution: r }), this.edit.getInternalEvents().emit(mt.OutputResized, { width: a.width, height: a.height });
43872
+ s?.setResolution(r), s?.clearSize(), this.edit.updateCanvasForSize(), this.edit.getInternalEvents().emit(pt.OutputResolutionChanged, { resolution: r }), this.edit.getInternalEvents().emit(pt.OutputResized, { width: a.width, height: a.height });
43846
43873
  }
43847
43874
  getResolution() {
43848
43875
  return this.edit.getResolvedEdit()?.output?.resolution;
@@ -43854,7 +43881,7 @@ class UZ {
43854
43881
  n && (n.output = {
43855
43882
  ...n.output,
43856
43883
  aspectRatio: r
43857
- }), this.edit.getDocument()?.setAspectRatio(r), this.edit.getInternalEvents().emit(mt.OutputAspectRatioChanged, { aspectRatio: r });
43884
+ }), this.edit.getDocument()?.setAspectRatio(r), this.edit.getInternalEvents().emit(pt.OutputAspectRatioChanged, { aspectRatio: r });
43858
43885
  return;
43859
43886
  }
43860
43887
  const a = kl(i, r);
@@ -43863,7 +43890,7 @@ class UZ {
43863
43890
  aspectRatio: r
43864
43891
  }, delete n.output.size);
43865
43892
  const s = this.edit.getDocument();
43866
- s?.setAspectRatio(r), s?.clearSize(), this.edit.updateCanvasForSize(), this.edit.getInternalEvents().emit(mt.OutputAspectRatioChanged, { aspectRatio: r }), this.edit.getInternalEvents().emit(mt.OutputResized, { width: a.width, height: a.height });
43893
+ s?.setAspectRatio(r), s?.clearSize(), this.edit.updateCanvasForSize(), this.edit.getInternalEvents().emit(pt.OutputAspectRatioChanged, { aspectRatio: r }), this.edit.getInternalEvents().emit(pt.OutputResized, { width: a.width, height: a.height });
43867
43894
  }
43868
43895
  getAspectRatio() {
43869
43896
  return this.edit.getResolvedEdit()?.output?.aspectRatio;
@@ -43893,7 +43920,7 @@ class WZ {
43893
43920
  if (n) {
43894
43921
  this.selectedClip = n;
43895
43922
  const i = this.edit.getDocumentClip(e, r);
43896
- i && this.edit.getInternalEvents().emit(mt.ClipSelected, {
43923
+ i && this.edit.getInternalEvents().emit(pt.ClipSelected, {
43897
43924
  clip: qe(i),
43898
43925
  trackIndex: e,
43899
43926
  clipIndex: r
@@ -43911,7 +43938,7 @@ class WZ {
43911
43938
  * Clear the current selection.
43912
43939
  */
43913
43940
  clearSelection() {
43914
- this.selectedClip = null, this.edit.getInternalEvents().emit(mt.SelectionCleared);
43941
+ this.selectedClip = null, this.edit.getInternalEvents().emit(pt.SelectionCleared);
43915
43942
  }
43916
43943
  /**
43917
43944
  * Check if a specific clip is selected by indices.
@@ -43960,7 +43987,7 @@ class WZ {
43960
43987
  n && (this.copiedClip = {
43961
43988
  trackIndex: e,
43962
43989
  clipConfiguration: structuredClone(n)
43963
- }, this.edit.getInternalEvents().emit(mt.ClipCopied, { trackIndex: e, clipIndex: r }), GZ(aZ(n)).catch(() => {
43990
+ }, this.edit.getInternalEvents().emit(pt.ClipCopied, { trackIndex: e, clipIndex: r }), GZ(aZ(n)).catch(() => {
43964
43991
  }));
43965
43992
  }
43966
43993
  /**
@@ -44105,7 +44132,7 @@ class qZ {
44105
44132
  }), o.reconfigureAfterRestore());
44106
44133
  }
44107
44134
  }
44108
- this.edit.updateTotalDuration(), this.edit.getInternalEvents().emit(mt.TimelineUpdated, {
44135
+ this.edit.updateTotalDuration(), this.edit.getInternalEvents().emit(pt.TimelineUpdated, {
44109
44136
  current: this.edit.getEdit()
44110
44137
  });
44111
44138
  }
@@ -45145,16 +45172,16 @@ class iU {
45145
45172
  const a = this.edit.createPlayerFromAssetType(e);
45146
45173
  a.layer = n + 1, a.clipId = r, this.edit.registerPlayerByClipId(r, a), this.edit.addPlayerToTracksArray(n, a), this.edit.addPlayerToContainer(n, a);
45147
45174
  const s = e.asset?.type ?? "unknown", o = a.load().then(() => {
45148
- this.edit.getInternalEvents().emit(ge.PlayerLoaded, {
45175
+ a.loadError && this.reportLoadFailure(a, a.loadError), this.edit.getInternalEvents().emit(ge.PlayerLoaded, {
45149
45176
  player: a,
45150
45177
  trackIndex: n,
45151
45178
  clipIndex: i
45152
- }), Fu(e.asset) && this.edit.getInternalEvents().emit(mt.ClipUnresolved, {
45179
+ }), Fu(e.asset) && this.edit.getInternalEvents().emit(pt.ClipUnresolved, {
45153
45180
  trackIndex: n,
45154
45181
  clipIndex: i,
45155
45182
  assetType: s,
45156
45183
  clipId: r
45157
- }), a.needsResolution && this.edit.getInternalEvents().emit(mt.ClipUnresolved, {
45184
+ }), a.needsResolution && this.edit.getInternalEvents().emit(pt.ClipUnresolved, {
45158
45185
  trackIndex: n,
45159
45186
  clipIndex: i,
45160
45187
  assetType: s,
@@ -45162,7 +45189,7 @@ class iU {
45162
45189
  });
45163
45190
  }).catch((u) => {
45164
45191
  const l = u instanceof Error ? u.message : String(u);
45165
- this.edit.getInternalEvents().emit(mt.ClipLoadFailed, {
45192
+ this.edit.getInternalEvents().emit(pt.ClipLoadFailed, {
45166
45193
  trackIndex: n,
45167
45194
  clipIndex: i,
45168
45195
  error: l,
@@ -45205,6 +45232,16 @@ class iU {
45205
45232
  I1.has(s) || (i[s] !== void 0 ? n[s] = i[s] : delete n[s]);
45206
45233
  e.reconfigureAfterRestore();
45207
45234
  }
45235
+ /**
45236
+ * Announce a player that couldn't show its asset. Its position is looked up now, not when the
45237
+ * load started, because clips can move while an asset is still loading.
45238
+ */
45239
+ reportLoadFailure(e, r) {
45240
+ const n = this.edit.findClipIndices(e);
45241
+ if (!n) return;
45242
+ const i = e.clipConfiguration.asset?.type ?? "unknown";
45243
+ this.edit.getInternalEvents().emit(pt.ClipLoadFailed, { ...n, error: r, assetType: i });
45244
+ }
45208
45245
  /**
45209
45246
  * Check if asset properties changed (excluding type, which is handled separately).
45210
45247
  */
@@ -45225,9 +45262,9 @@ class iU {
45225
45262
  a = s !== o;
45226
45263
  }
45227
45264
  a && e.reloadAsset ? e.reloadAsset().then(() => {
45228
- e.reconfigureAfterRestore();
45265
+ e.reconfigureAfterRestore(), e.loadError && this.reportLoadFailure(e, e.loadError);
45229
45266
  }).catch((s) => {
45230
- console.error("Failed to reload asset:", s);
45267
+ console.error("Failed to reload asset:", s), this.reportLoadFailure(e, s instanceof Error ? s.message : String(s));
45231
45268
  }) : e.reconfigureAfterRestore();
45232
45269
  }
45233
45270
  /**
@@ -45611,9 +45648,9 @@ class En {
45611
45648
  ), this.playerReconciler = new iU(this), this.assetGenerator = new eU({
45612
45649
  getClipAsset: (i) => this.getResolvedClipById(i)?.asset,
45613
45650
  applyGeneratedSrc: (i, a) => this.applyGeneratedSrc(i, a),
45614
- emitStarted: (i) => this.internalEvents.emit(mt.ClipGenerationStarted, { clipId: i }),
45615
- emitCompleted: (i) => this.internalEvents.emit(mt.ClipGenerationCompleted, { clipId: i }),
45616
- emitFailed: (i, a) => this.internalEvents.emit(mt.ClipGenerationFailed, { clipId: i, error: a }),
45651
+ emitStarted: (i) => this.internalEvents.emit(pt.ClipGenerationStarted, { clipId: i }),
45652
+ emitCompleted: (i) => this.internalEvents.emit(pt.ClipGenerationCompleted, { clipId: i }),
45653
+ emitFailed: (i, a) => this.internalEvents.emit(pt.ClipGenerationFailed, { clipId: i, error: a }),
45617
45654
  emitStatusChanged: (i) => this.internalEvents.emit(ge.GenerationStatusChanged, { clipId: i })
45618
45655
  }), this.mergeFieldService = new LZ(this.internalEvents), this.outputSettings = new UZ(this), this.selectionManager = new WZ(this), this.timingManager = new qZ(this), this.setupIntentListeners(), this.setupGenerationListeners();
45619
45656
  }
@@ -45644,7 +45681,7 @@ class En {
45644
45681
  this.lumaMaskController.initialize(), await this.playerReconciler.reconcileInitial(s), this.normalizeLumaAttachments();
45645
45682
  for (const [o, u] of i)
45646
45683
  u.size > 0 && this.document.setClipBindingsForClip(o, u);
45647
- await this.timingManager.resolveAllTiming(), this.updateTotalDuration(), a.timeline.soundtrack && await this.loadSoundtrack(a.timeline.soundtrack), this.internalEvents.emit(mt.TimelineUpdated, { current: this.getEdit() }), this.emitEditChanged(e);
45684
+ await this.timingManager.resolveAllTiming(), this.updateTotalDuration(), a.timeline.soundtrack && await this.loadSoundtrack(a.timeline.soundtrack), this.internalEvents.emit(pt.TimelineUpdated, { current: this.getEdit() }), this.emitEditChanged(e);
45648
45685
  }
45649
45686
  /** @internal */
45650
45687
  getInternalEvents() {
@@ -45676,10 +45713,10 @@ class En {
45676
45713
  }), this.internalEvents.emit(ge.ViewportNeedsZoomToFit);
45677
45714
  }
45678
45715
  play() {
45679
- this.isPlaying = !0, this.playWallAnchorMs = performance.now(), this.playTimeAnchorSeconds = this.playbackTime, this.internalEvents.emit(mt.PlaybackPlay);
45716
+ this.isPlaying = !0, this.playWallAnchorMs = performance.now(), this.playTimeAnchorSeconds = this.playbackTime, this.internalEvents.emit(pt.PlaybackPlay);
45680
45717
  }
45681
45718
  pause() {
45682
- this.isPlaying = !1, this.internalEvents.emit(mt.PlaybackPause);
45719
+ this.isPlaying = !1, this.internalEvents.emit(pt.PlaybackPause);
45683
45720
  }
45684
45721
  seek(e) {
45685
45722
  this.playbackTime = Math.max(0, Math.min(e, this.totalDuration)), this.pause(), this.update(0, En.SEEK_ELAPSED_MARKER);
@@ -46021,12 +46058,15 @@ class En {
46021
46058
  * @internal
46022
46059
  */
46023
46060
  getClipError(e, r) {
46024
- const n = this.clipErrors.get(`${e}-${r}`);
46025
- if (n) return n;
46026
- const i = this.getResolvedClip(e, r)?.asset;
46027
- if (!i || !("src" in i) || typeof i.src != "string") return null;
46028
- const a = ss(i.src), s = this.getClipId(e, r), o = i.type === "video" && s ? `${s}:${a}` : a, u = this.assetLoader.loadTracker.registry[o];
46029
- return u?.status === "failed" ? { error: u.error ?? `Invalid source '${i.src}'.`, assetType: i.type } : null;
46061
+ const n = this.getPlayerClip(e, r);
46062
+ if (n?.loadError)
46063
+ return { error: n.loadError, assetType: n.clipConfiguration.asset?.type ?? "unknown" };
46064
+ const i = this.clipErrors.get(`${e}-${r}`);
46065
+ if (i) return i;
46066
+ const a = this.getResolvedClip(e, r)?.asset;
46067
+ if (!a || !("src" in a) || typeof a.src != "string") return null;
46068
+ const s = ss(a.src), o = this.getClipId(e, r), u = a.type === "video" && o ? `${o}:${s}` : s, l = this.assetLoader.loadTracker.registry[u];
46069
+ return l?.status === "failed" ? { error: l.error ?? `Invalid source '${a.src}'.`, assetType: a.type } : null;
46030
46070
  }
46031
46071
  /**
46032
46072
  * Clear the error for a deleted clip and shift indices for remaining errors.
@@ -46256,7 +46296,7 @@ class En {
46256
46296
  const e = this.commandHistory[this.commandIndex];
46257
46297
  if (!e.undo) return re("Command cannot be undone");
46258
46298
  const r = this.createCommandContext(), n = await Promise.resolve(e.undo(r));
46259
- return this.commandIndex -= 1, this.internalEvents.emit(mt.EditUndo, { command: e.name }), this.emitEditChanged(`undo:${e.name}`), n;
46299
+ return this.commandIndex -= 1, this.internalEvents.emit(pt.EditUndo, { command: e.name }), this.emitEditChanged(`undo:${e.name}`), n;
46260
46300
  });
46261
46301
  }
46262
46302
  /**
@@ -46269,7 +46309,7 @@ class En {
46269
46309
  return this.commandQueue.enqueue(async () => {
46270
46310
  if (this.commandIndex >= this.commandHistory.length - 1) return re("Nothing to redo");
46271
46311
  const e = this.commandIndex + 1, r = this.commandHistory[e], n = this.createCommandContext(), i = await Promise.resolve(r.execute(n));
46272
- return this.commandIndex = e, this.internalEvents.emit(mt.EditRedo, { command: r.name }), this.emitEditChanged(`redo:${r.name}`), i;
46312
+ return this.commandIndex = e, this.internalEvents.emit(pt.EditRedo, { command: r.name }), this.emitEditChanged(`redo:${r.name}`), i;
46273
46313
  });
46274
46314
  }
46275
46315
  /** True when there is a command to undo (the history pointer is not before the first command). */
@@ -46419,7 +46459,7 @@ class En {
46419
46459
  * @internal
46420
46460
  */
46421
46461
  emitEditChanged(e) {
46422
- this.isBatchingEvents || this.internalEvents.emit(mt.EditChanged, { source: e, timestamp: Date.now() });
46462
+ this.isBatchingEvents || this.internalEvents.emit(pt.EditChanged, { source: e, timestamp: Date.now() });
46423
46463
  }
46424
46464
  /**
46425
46465
  * Detects merge field placeholders in the raw edit before substitution.
@@ -46572,9 +46612,15 @@ class En {
46572
46612
  const a = this.document.getClipId(e, n);
46573
46613
  a && (r.clipId = a, this.playerByClipId.set(a, r));
46574
46614
  }
46575
- this.addPlayerToContainer(e, r), r.load().catch((i) => {
46615
+ this.addPlayerToContainer(e, r), r.load().then(() => {
46616
+ if (!r.loadError) return;
46617
+ const i = this.findClipIndices(r);
46618
+ if (!i) return;
46619
+ const a = r.clipConfiguration?.asset?.type ?? "unknown";
46620
+ this.internalEvents.emit(pt.ClipLoadFailed, { ...i, error: r.loadError, assetType: a });
46621
+ }).catch((i) => {
46576
46622
  const a = r.clipConfiguration?.asset?.type ?? "unknown", s = i instanceof Error ? i.message : String(i);
46577
- this.clipErrors.set(`${e}-${n}`, { error: s, assetType: a }), this.internalEvents.emit(mt.ClipLoadFailed, {
46623
+ this.clipErrors.set(`${e}-${n}`, { error: s, assetType: a }), this.internalEvents.emit(pt.ClipLoadFailed, {
46578
46624
  trackIndex: e,
46579
46625
  clipIndex: n,
46580
46626
  error: s,
@@ -46774,7 +46820,7 @@ class En {
46774
46820
  for (const i of n)
46775
46821
  e = Math.max(e, i.getEnd());
46776
46822
  const r = this.totalDuration;
46777
- this.totalDuration = e, r !== this.totalDuration && this.internalEvents.emit(mt.DurationChanged, { duration: this.totalDuration });
46823
+ this.totalDuration = e, r !== this.totalDuration && this.internalEvents.emit(pt.DurationChanged, { duration: this.totalDuration });
46778
46824
  }
46779
46825
  /** @internal */
46780
46826
  propagateTimingChanges(e, r) {
@@ -47102,7 +47148,7 @@ class En {
47102
47148
  width: this.size.width,
47103
47149
  height: this.size.height,
47104
47150
  backgroundColor: this.backgroundColor
47105
- }), this.internalEvents.emit(mt.TimelineBackgroundChanged, { color: e });
47151
+ }), this.internalEvents.emit(pt.TimelineBackgroundChanged, { color: e });
47106
47152
  }
47107
47153
  getTimelineBackground() {
47108
47154
  return this.backgroundColor;
@@ -47242,11 +47288,11 @@ class En {
47242
47288
  static DoubleClickThresholdMs = 500;
47243
47289
  // ─── Event Listeners ─────────────────────────────────────────────────────────
47244
47290
  static GenerationConfigTriggers = [
47245
- mt.ClipSelected,
47246
- mt.SelectionCleared,
47247
- mt.EditChanged,
47248
- mt.MergeFieldChanged,
47249
- mt.TimelineUpdated
47291
+ pt.ClipSelected,
47292
+ pt.SelectionCleared,
47293
+ pt.EditChanged,
47294
+ pt.MergeFieldChanged,
47295
+ pt.TimelineUpdated
47250
47296
  ];
47251
47297
  setupGenerationListeners() {
47252
47298
  this.internalEvents.on(ge.Resolved, this.onResolvedForGeneration);
@@ -47313,12 +47359,12 @@ class B1 {
47313
47359
  this.updateDocumentClip(e, n, !0);
47314
47360
  } else
47315
47361
  this.updateDocumentClip(e, this.storedNewValue, !1);
47316
- return e.resolve(), e.emitEvent(mt.MergeFieldChanged, { fields: r.getAll() }), ce();
47362
+ return e.resolve(), e.emitEvent(pt.MergeFieldChanged, { fields: r.getAll() }), ce();
47317
47363
  }
47318
47364
  async undo(e) {
47319
47365
  if (!e) throw new Error("SetMergeFieldCommand.undo: context is required");
47320
47366
  const r = e.getMergeFields();
47321
- return this.storedPreviousBinding ? e.setClipBinding(this.clipId, this.propertyPath, this.storedPreviousBinding) : e.removeClipBinding(this.clipId, this.propertyPath), this.previousFieldName && r.register({ name: this.previousFieldName, defaultValue: this.storedPreviousValue }, { silent: !0 }), this.storedPreviousBinding ? this.updateDocumentClip(e, this.storedPreviousBinding.placeholder, !0) : this.updateDocumentClip(e, this.storedPreviousValue, !1), e.resolve(), e.emitEvent(mt.MergeFieldChanged, { fields: r.getAll() }), ce();
47367
+ return this.storedPreviousBinding ? e.setClipBinding(this.clipId, this.propertyPath, this.storedPreviousBinding) : e.removeClipBinding(this.clipId, this.propertyPath), this.previousFieldName && r.register({ name: this.previousFieldName, defaultValue: this.storedPreviousValue }, { silent: !0 }), this.storedPreviousBinding ? this.updateDocumentClip(e, this.storedPreviousBinding.placeholder, !0) : this.updateDocumentClip(e, this.storedPreviousValue, !1), e.resolve(), e.emitEvent(pt.MergeFieldChanged, { fields: r.getAll() }), ce();
47322
47368
  }
47323
47369
  dispose() {
47324
47370
  this.storedPreviousBinding = void 0;
@@ -47398,7 +47444,7 @@ class GU extends En {
47398
47444
  this.mergeFieldService.register({ ...n, defaultValue: r }, { silent: !0 });
47399
47445
  for (const [, i] of this.getPlayerMap())
47400
47446
  this.updateMergeFieldBindings(i, e, r);
47401
- this.resolve(), this.getInternalEvents().emit(mt.TimelineUpdated, { current: this.getEdit() });
47447
+ this.resolve(), this.getInternalEvents().emit(pt.TimelineUpdated, { current: this.getEdit() });
47402
47448
  } finally {
47403
47449
  this.isUpdatingMergeFields = !1;
47404
47450
  }
@@ -47501,7 +47547,7 @@ class GU extends En {
47501
47547
  const o = this.getTemplateClipById(s);
47502
47548
  o && await this.restoreMergeFieldInClip(s, o, n, i);
47503
47549
  }
47504
- this.mergeFieldService.remove(e) || this.getInternalEvents().emit(mt.MergeFieldChanged, { fields: this.mergeFieldService.getAll() });
47550
+ this.mergeFieldService.remove(e) || this.getInternalEvents().emit(pt.MergeFieldChanged, { fields: this.mergeFieldService.getAll() });
47505
47551
  }
47506
47552
  // ─── Text Conversion API ───────────────────────────────────────────────────
47507
47553
  /**
@@ -48103,8 +48149,8 @@ var TU = Ge({ "node_modules/.pnpm/harfbuzzjs@0.4.12/node_modules/harfbuzzjs/hb.j
48103
48149
  var r = (() => {
48104
48150
  var n = typeof document < "u" ? document.currentScript?.src : void 0;
48105
48151
  return async function(i = {}) {
48106
- var a, s = i, o = typeof window == "object", u = typeof WorkerGlobalScope < "u", l = typeof process == "object" && process.versions?.node && process.type != "renderer", c = (T, pt) => {
48107
- throw pt;
48152
+ var a, s = i, o = typeof window == "object", u = typeof WorkerGlobalScope < "u", l = typeof process == "object" && process.versions?.node && process.type != "renderer", c = (T, mt) => {
48153
+ throw mt;
48108
48154
  };
48109
48155
  typeof __filename < "u" ? n = __filename : u && (n = self.location.href);
48110
48156
  var h = "";
@@ -48116,14 +48162,14 @@ var TU = Ge({ "node_modules/.pnpm/harfbuzzjs@0.4.12/node_modules/harfbuzzjs/hb.j
48116
48162
  var v = Kx("fs");
48117
48163
  h = __dirname + "/", y = (T) => {
48118
48164
  T = k(T) ? new URL(T) : T;
48119
- var pt = v.readFileSync(T);
48120
- return pt;
48121
- }, m = async (T, pt = !0) => {
48165
+ var mt = v.readFileSync(T);
48166
+ return mt;
48167
+ }, m = async (T, mt = !0) => {
48122
48168
  T = k(T) ? new URL(T) : T;
48123
- var qt = v.readFileSync(T, pt ? void 0 : "utf8");
48169
+ var qt = v.readFileSync(T, mt ? void 0 : "utf8");
48124
48170
  return qt;
48125
- }, process.argv.length > 1 && process.argv[1].replace(/\\/g, "/"), process.argv.slice(2), c = (T, pt) => {
48126
- throw process.exitCode = T, pt;
48171
+ }, process.argv.length > 1 && process.argv[1].replace(/\\/g, "/"), process.argv.slice(2), c = (T, mt) => {
48172
+ throw process.exitCode = T, mt;
48127
48173
  };
48128
48174
  } else if (o || u) {
48129
48175
  try {
@@ -48131,8 +48177,8 @@ var TU = Ge({ "node_modules/.pnpm/harfbuzzjs@0.4.12/node_modules/harfbuzzjs/hb.j
48131
48177
  } catch {
48132
48178
  }
48133
48179
  u && (y = (T) => {
48134
- var pt = new XMLHttpRequest();
48135
- return pt.open("GET", T, !1), pt.responseType = "arraybuffer", pt.send(null), new Uint8Array(pt.response);
48180
+ var mt = new XMLHttpRequest();
48181
+ return mt.open("GET", T, !1), mt.responseType = "arraybuffer", mt.send(null), new Uint8Array(mt.response);
48136
48182
  }), m = async (T) => {
48137
48183
  if (k(T))
48138
48184
  return new Promise((qt, de) => {
@@ -48145,10 +48191,10 @@ var TU = Ge({ "node_modules/.pnpm/harfbuzzjs@0.4.12/node_modules/harfbuzzjs/hb.j
48145
48191
  de(ne.status);
48146
48192
  }, ne.onerror = de, ne.send(null);
48147
48193
  });
48148
- var pt = await fetch(T, { credentials: "same-origin" });
48149
- if (pt.ok)
48150
- return pt.arrayBuffer();
48151
- throw new Error(pt.status + " : " + pt.url);
48194
+ var mt = await fetch(T, { credentials: "same-origin" });
48195
+ if (mt.ok)
48196
+ return mt.arrayBuffer();
48197
+ throw new Error(mt.status + " : " + mt.url);
48152
48198
  };
48153
48199
  }
48154
48200
  console.log.bind(console);
@@ -48178,14 +48224,14 @@ var TU = Ge({ "node_modules/.pnpm/harfbuzzjs@0.4.12/node_modules/harfbuzzjs/hb.j
48178
48224
  }
48179
48225
  function ht(T) {
48180
48226
  if (j--, s.monitorRunDependencies?.(j), j == 0 && ft) {
48181
- var pt = ft;
48182
- ft = null, pt();
48227
+ var mt = ft;
48228
+ ft = null, mt();
48183
48229
  }
48184
48230
  }
48185
48231
  function W(T) {
48186
48232
  s.onAbort?.(T), T = "Aborted(" + T + ")", b(T), I = !0, T += ". Build with -sASSERTIONS for more info.";
48187
- var pt = new WebAssembly.RuntimeError(T);
48188
- throw _?.(pt), pt;
48233
+ var mt = new WebAssembly.RuntimeError(T);
48234
+ throw _?.(mt), mt;
48189
48235
  }
48190
48236
  var J;
48191
48237
  function rt() {
@@ -48201,29 +48247,29 @@ var TU = Ge({ "node_modules/.pnpm/harfbuzzjs@0.4.12/node_modules/harfbuzzjs/hb.j
48201
48247
  async function Lt(T) {
48202
48248
  if (!C)
48203
48249
  try {
48204
- var pt = await m(T);
48205
- return new Uint8Array(pt);
48250
+ var mt = await m(T);
48251
+ return new Uint8Array(mt);
48206
48252
  } catch {
48207
48253
  }
48208
48254
  return St(T);
48209
48255
  }
48210
- async function jt(T, pt) {
48256
+ async function jt(T, mt) {
48211
48257
  try {
48212
- var qt = await Lt(T), de = await WebAssembly.instantiate(qt, pt);
48258
+ var qt = await Lt(T), de = await WebAssembly.instantiate(qt, mt);
48213
48259
  return de;
48214
48260
  } catch (ne) {
48215
48261
  b(`failed to asynchronously prepare wasm: ${ne}`), W(ne);
48216
48262
  }
48217
48263
  }
48218
- async function ue(T, pt, qt) {
48219
- if (!T && !k(pt) && !l)
48264
+ async function ue(T, mt, qt) {
48265
+ if (!T && !k(mt) && !l)
48220
48266
  try {
48221
- var de = fetch(pt, { credentials: "same-origin" }), ne = await WebAssembly.instantiateStreaming(de, qt);
48267
+ var de = fetch(mt, { credentials: "same-origin" }), ne = await WebAssembly.instantiateStreaming(de, qt);
48222
48268
  return ne;
48223
48269
  } catch (Le) {
48224
48270
  b(`wasm streaming compile failed: ${Le}`), b("falling back to ArrayBuffer instantiation");
48225
48271
  }
48226
- return jt(pt, qt);
48272
+ return jt(mt, qt);
48227
48273
  }
48228
48274
  function fe() {
48229
48275
  return { env: zr, wasi_snapshot_preview1: zr };
@@ -48233,7 +48279,7 @@ var TU = Ge({ "node_modules/.pnpm/harfbuzzjs@0.4.12/node_modules/harfbuzzjs/hb.j
48233
48279
  return ur = Le.exports, s.wasmExports = ur, L = ur.memory, s.wasmMemory = L, N(), Yt = ur.__indirect_function_table, pr(ur), ht(), ur;
48234
48280
  }
48235
48281
  gt();
48236
- function pt(Le) {
48282
+ function mt(Le) {
48237
48283
  return T(Le.instance);
48238
48284
  }
48239
48285
  var qt = fe();
@@ -48244,12 +48290,12 @@ var TU = Ge({ "node_modules/.pnpm/harfbuzzjs@0.4.12/node_modules/harfbuzzjs/hb.j
48244
48290
  });
48245
48291
  });
48246
48292
  J ?? (J = rt());
48247
- var de = await ue(C, J, qt), ne = pt(de);
48293
+ var de = await ue(C, J, qt), ne = mt(de);
48248
48294
  return ne;
48249
48295
  }
48250
48296
  class Ue {
48251
- constructor(pt) {
48252
- zt(this, "name", "ExitStatus"), this.message = `Program terminated with exit(${pt})`, this.status = pt;
48297
+ constructor(mt) {
48298
+ zt(this, "name", "ExitStatus"), this.message = `Program terminated with exit(${mt})`, this.status = mt;
48253
48299
  }
48254
48300
  }
48255
48301
  var le = (T) => {
@@ -48263,7 +48309,7 @@ var TU = Ge({ "node_modules/.pnpm/harfbuzzjs@0.4.12/node_modules/harfbuzzjs/hb.j
48263
48309
  c(1, T);
48264
48310
  }, at = () => vt || bt > 0, wt = (T) => {
48265
48311
  A = T, at() || (s.onExit?.(T), I = !0), c(T, new Ue(T));
48266
- }, it = (T, pt) => {
48312
+ }, it = (T, mt) => {
48267
48313
  A = T, wt(T);
48268
48314
  }, Ht = it, Ft = () => {
48269
48315
  if (!at())
@@ -48276,29 +48322,29 @@ var TU = Ge({ "node_modules/.pnpm/harfbuzzjs@0.4.12/node_modules/harfbuzzjs/hb.j
48276
48322
  if (!I)
48277
48323
  try {
48278
48324
  T(), Ft();
48279
- } catch (pt) {
48280
- X(pt);
48325
+ } catch (mt) {
48326
+ X(mt);
48281
48327
  }
48282
- }, xt = () => performance.now(), se = (T, pt) => {
48283
- if (Bt[T] && (clearTimeout(Bt[T].id), delete Bt[T]), !pt) return 0;
48328
+ }, xt = () => performance.now(), se = (T, mt) => {
48329
+ if (Bt[T] && (clearTimeout(Bt[T].id), delete Bt[T]), !mt) return 0;
48284
48330
  var qt = setTimeout(() => {
48285
48331
  delete Bt[T], Nt(() => Gr(T, xt()));
48286
- }, pt);
48287
- return Bt[T] = { id: qt, timeout_ms: pt }, 0;
48288
- }, he = () => 2147483648, yt = (T, pt) => Math.ceil(T / pt) * pt, Ve = (T) => {
48289
- var pt = L.buffer.byteLength, qt = (T - pt + 65535) / 65536 | 0;
48332
+ }, mt);
48333
+ return Bt[T] = { id: qt, timeout_ms: mt }, 0;
48334
+ }, he = () => 2147483648, yt = (T, mt) => Math.ceil(T / mt) * mt, Ve = (T) => {
48335
+ var mt = L.buffer.byteLength, qt = (T - mt + 65535) / 65536 | 0;
48290
48336
  try {
48291
48337
  return L.grow(qt), N(), 1;
48292
48338
  } catch {
48293
48339
  }
48294
48340
  }, Qe = (T) => {
48295
- var pt = B.length;
48341
+ var mt = B.length;
48296
48342
  T >>>= 0;
48297
48343
  var qt = he();
48298
48344
  if (T > qt)
48299
48345
  return !1;
48300
48346
  for (var de = 1; de <= 4; de *= 2) {
48301
- var ne = pt * (1 + 0.2 / de);
48347
+ var ne = mt * (1 + 0.2 / de);
48302
48348
  ne = Math.min(ne, T + 100663296);
48303
48349
  var Le = Math.min(qt, yt(Math.max(T, ne), 65536)), Vr = Ve(Le);
48304
48350
  if (Vr)
@@ -48306,21 +48352,21 @@ var TU = Ge({ "node_modules/.pnpm/harfbuzzjs@0.4.12/node_modules/harfbuzzjs/hb.j
48306
48352
  }
48307
48353
  return !1;
48308
48354
  }, we = (T) => {
48309
- const pt = T.length;
48310
- return [pt % 128 | 128, pt >> 7, ...T];
48311
- }, Mr = { i: 127, p: 127, j: 126, f: 125, d: 124, e: 111 }, Re = (T) => we(Array.from(T, (pt) => {
48312
- var qt = Mr[pt];
48355
+ const mt = T.length;
48356
+ return [mt % 128 | 128, mt >> 7, ...T];
48357
+ }, Mr = { i: 127, p: 127, j: 126, f: 125, d: 124, e: 111 }, Re = (T) => we(Array.from(T, (mt) => {
48358
+ var qt = Mr[mt];
48313
48359
  return qt;
48314
- })), Xt = (T, pt) => {
48315
- var qt = Uint8Array.of(0, 97, 115, 109, 1, 0, 0, 0, 1, ...we([1, 96, ...Re(pt.slice(1)), ...Re(pt[0] === "v" ? "" : pt[0])]), 2, 7, 1, 1, 101, 1, 102, 0, 0, 7, 5, 1, 1, 102, 0, 0), de = new WebAssembly.Module(qt), ne = new WebAssembly.Instance(de, { e: { f: T } }), Le = ne.exports.f;
48360
+ })), Xt = (T, mt) => {
48361
+ var qt = Uint8Array.of(0, 97, 115, 109, 1, 0, 0, 0, 1, ...we([1, 96, ...Re(mt.slice(1)), ...Re(mt[0] === "v" ? "" : mt[0])]), 2, 7, 1, 1, 101, 1, 102, 0, 0, 7, 5, 1, 1, 102, 0, 0), de = new WebAssembly.Module(qt), ne = new WebAssembly.Instance(de, { e: { f: T } }), Le = ne.exports.f;
48316
48362
  return Le;
48317
- }, Yt, or = (T) => Yt.get(T), dr = (T, pt) => {
48363
+ }, Yt, or = (T) => Yt.get(T), dr = (T, mt) => {
48318
48364
  if (Ke)
48319
- for (var qt = T; qt < T + pt; qt++) {
48365
+ for (var qt = T; qt < T + mt; qt++) {
48320
48366
  var de = or(qt);
48321
48367
  de && Ke.set(de, qt);
48322
48368
  }
48323
- }, Ke, ke = (T) => (Ke || (Ke = /* @__PURE__ */ new WeakMap(), dr(0, Yt.length)), Ke.get(T) || 0), Ie = [], Un = () => Ie.length ? Ie.pop() : Yt.grow(1), $i = (T, pt) => Yt.set(T, pt), Li = (T, pt) => {
48369
+ }, Ke, ke = (T) => (Ke || (Ke = /* @__PURE__ */ new WeakMap(), dr(0, Yt.length)), Ke.get(T) || 0), Ie = [], Un = () => Ie.length ? Ie.pop() : Yt.grow(1), $i = (T, mt) => Yt.set(T, mt), Li = (T, mt) => {
48324
48370
  var qt = ke(T);
48325
48371
  if (qt)
48326
48372
  return qt;
@@ -48330,7 +48376,7 @@ var TU = Ge({ "node_modules/.pnpm/harfbuzzjs@0.4.12/node_modules/harfbuzzjs/hb.j
48330
48376
  } catch (Le) {
48331
48377
  if (!(Le instanceof TypeError))
48332
48378
  throw Le;
48333
- var ne = Xt(T, pt);
48379
+ var ne = Xt(T, mt);
48334
48380
  $i(de, ne);
48335
48381
  }
48336
48382
  return Ke.set(T, de), de;
@@ -48364,8 +48410,8 @@ var TU = Ge({ "node_modules/.pnpm/harfbuzzjs@0.4.12/node_modules/harfbuzzjs/hb.j
48364
48410
  for (typeof s.preInit == "function" && (s.preInit = [s.preInit]); s.preInit.length > 0; )
48365
48411
  s.preInit.shift()();
48366
48412
  }
48367
- return jn(), Zi(), Z ? a = s : a = new Promise((T, pt) => {
48368
- S = T, _ = pt;
48413
+ return jn(), Zi(), Z ? a = s : a = new Promise((T, mt) => {
48414
+ S = T, _ = mt;
48369
48415
  }), a;
48370
48416
  };
48371
48417
  })();