@waveform-playlist/browser 9.3.2 → 9.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -2
- package/dist/index.js +19 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +424 -425
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -87,25 +87,25 @@ function Ph() {
|
|
|
87
87
|
}
|
|
88
88
|
var d = (function(h) {
|
|
89
89
|
function g(y) {
|
|
90
|
-
var
|
|
90
|
+
var w, b, _, S, C, E;
|
|
91
91
|
return (function(x, M) {
|
|
92
92
|
if (!(x instanceof M)) throw new TypeError("Cannot call a class as a function");
|
|
93
|
-
})(this, g),
|
|
93
|
+
})(this, g), b = this, w = !(_ = u(g).call(this, y.id, y.length, y.buffer, y.subChunks)) || l(_) !== "object" && typeof _ != "function" ? p(b) : _, S = p(p(w)), E = void 0, (C = "subChunks") in S ? Object.defineProperty(S, C, { value: E, enumerable: !0, configurable: !0, writable: !0 }) : S[C] = E, w.subChunks = y.subChunks.map((function(x) {
|
|
94
94
|
return new g(x);
|
|
95
|
-
})),
|
|
95
|
+
})), w;
|
|
96
96
|
}
|
|
97
97
|
var v, m;
|
|
98
|
-
return (function(y,
|
|
99
|
-
if (typeof
|
|
100
|
-
y.prototype = Object.create(
|
|
98
|
+
return (function(y, w) {
|
|
99
|
+
if (typeof w != "function" && w !== null) throw new TypeError("Super expression must either be null or a function");
|
|
100
|
+
y.prototype = Object.create(w && w.prototype, { constructor: { value: y, writable: !0, configurable: !0 } }), w && f(y, w);
|
|
101
101
|
})(g, h), v = g, (m = [{ key: "getMetaData", value: function() {
|
|
102
102
|
if (this.id !== "LIST") throw new a.ParseError("Unexpected chunk ID", "'LIST'", "'".concat(this.id, "'"));
|
|
103
|
-
var y = this.subChunks.reduce((function(
|
|
104
|
-
if (
|
|
105
|
-
if (
|
|
106
|
-
b
|
|
107
|
-
} else b
|
|
108
|
-
return
|
|
103
|
+
var y = this.subChunks.reduce((function(w, b) {
|
|
104
|
+
if (b.id === "ifil" || b.id === "iver") {
|
|
105
|
+
if (b.length !== s.SF_VERSION_LENGTH) throw new a.ParseError("Invalid size for the '".concat(b.id, "' sub-chunk"));
|
|
106
|
+
w[b.id] = "".concat(b.getInt16(), ".").concat(b.getInt16(2));
|
|
107
|
+
} else w[b.id] = b.getString();
|
|
108
|
+
return w;
|
|
109
109
|
}), {});
|
|
110
110
|
if (!y.ifil) throw new a.ParseError("Missing required 'ifil' sub-chunk");
|
|
111
111
|
if (!y.INAM) throw new a.ParseError("Missing required 'INAM' sub-chunk");
|
|
@@ -366,23 +366,23 @@ function Ph() {
|
|
|
366
366
|
return { generatorIndex: g.getInt16(), modulatorIndex: g.getInt16() };
|
|
367
367
|
}));
|
|
368
368
|
}, c = function(d, h, g, v, m, y) {
|
|
369
|
-
for (var
|
|
370
|
-
for (var _ = d[
|
|
369
|
+
for (var w = [], b = 0; b < d.length; b++) {
|
|
370
|
+
for (var _ = d[b], S = d[b + 1], C = _.bagIndex, E = S ? S.bagIndex : h.length, x = [], M = void 0, R = C; R < E; R++) {
|
|
371
371
|
var A = u(R, h, g), I = f(R, h, v), D = I[i.GeneratorType.KeyRange] && I[i.GeneratorType.KeyRange].range, F = I[y];
|
|
372
372
|
if (F) {
|
|
373
373
|
var L = m[F.value];
|
|
374
374
|
L && x.push({ keyRange: D, modulators: A, generators: I, reference: L });
|
|
375
375
|
} else R - C == 0 && (M = { keyRange: D, modulators: A, generators: I });
|
|
376
376
|
}
|
|
377
|
-
|
|
377
|
+
w.push({ header: _, globalZone: M, zones: x });
|
|
378
378
|
}
|
|
379
|
-
return
|
|
379
|
+
return w;
|
|
380
380
|
}, u = function(d, h, g) {
|
|
381
|
-
var v = h[d], m = h[d + 1], y = v.modulatorIndex,
|
|
382
|
-
return p(y,
|
|
381
|
+
var v = h[d], m = h[d + 1], y = v.modulatorIndex, w = m ? m.modulatorIndex : h.length;
|
|
382
|
+
return p(y, w, g);
|
|
383
383
|
}, f = function(d, h, g) {
|
|
384
|
-
var v = h[d], m = h[d + 1], y = v.generatorIndex,
|
|
385
|
-
return p(y,
|
|
384
|
+
var v = h[d], m = h[d + 1], y = v.generatorIndex, w = m ? m.generatorIndex : h.length;
|
|
385
|
+
return p(y, w, g);
|
|
386
386
|
}, p = function(d, h, g) {
|
|
387
387
|
for (var v = {}, m = d; m < h; m++) {
|
|
388
388
|
var y = g[m];
|
|
@@ -617,10 +617,10 @@ function Ph() {
|
|
|
617
617
|
}
|
|
618
618
|
function c(d, h, g) {
|
|
619
619
|
return (c = l() ? Reflect.construct : function(v, m, y) {
|
|
620
|
-
var
|
|
621
|
-
|
|
622
|
-
var
|
|
623
|
-
return y && u(
|
|
620
|
+
var w = [null];
|
|
621
|
+
w.push.apply(w, m);
|
|
622
|
+
var b = new (Function.bind.apply(v, w))();
|
|
623
|
+
return y && u(b, y.prototype), b;
|
|
624
624
|
}).apply(null, arguments);
|
|
625
625
|
}
|
|
626
626
|
function u(d, h) {
|
|
@@ -638,8 +638,8 @@ function Ph() {
|
|
|
638
638
|
}));
|
|
639
639
|
var p = (function(d) {
|
|
640
640
|
function h(g, v, m) {
|
|
641
|
-
return (function(y,
|
|
642
|
-
if (!(y instanceof
|
|
641
|
+
return (function(y, w) {
|
|
642
|
+
if (!(y instanceof w)) throw new TypeError("Cannot call a class as a function");
|
|
643
643
|
})(this, h), s(this, f(h).call(this, "".concat(g).concat(v && m ? ", expected ".concat(v, ", received ").concat(m) : "")));
|
|
644
644
|
}
|
|
645
645
|
return (function(g, v) {
|
|
@@ -783,10 +783,10 @@ function Ph() {
|
|
|
783
783
|
function u(g) {
|
|
784
784
|
for (var v = 1; v < arguments.length; v++) {
|
|
785
785
|
var m = arguments[v] != null ? arguments[v] : {}, y = Object.keys(m);
|
|
786
|
-
typeof Object.getOwnPropertySymbols == "function" && (y = y.concat(Object.getOwnPropertySymbols(m).filter((function(
|
|
787
|
-
return Object.getOwnPropertyDescriptor(m,
|
|
788
|
-
})))), y.forEach((function(
|
|
789
|
-
d(g,
|
|
786
|
+
typeof Object.getOwnPropertySymbols == "function" && (y = y.concat(Object.getOwnPropertySymbols(m).filter((function(w) {
|
|
787
|
+
return Object.getOwnPropertyDescriptor(m, w).enumerable;
|
|
788
|
+
})))), y.forEach((function(w) {
|
|
789
|
+
d(g, w, m[w]);
|
|
790
790
|
}));
|
|
791
791
|
}
|
|
792
792
|
return g;
|
|
@@ -805,8 +805,8 @@ function Ph() {
|
|
|
805
805
|
}
|
|
806
806
|
var h = (function() {
|
|
807
807
|
function g(v) {
|
|
808
|
-
if ((function(y,
|
|
809
|
-
if (!(y instanceof
|
|
808
|
+
if ((function(y, w) {
|
|
809
|
+
if (!(y instanceof w)) throw new TypeError("Cannot call a class as a function");
|
|
810
810
|
})(this, g), d(this, "chunk", void 0), d(this, "metaData", void 0), d(this, "sampleData", void 0), d(this, "samples", void 0), d(this, "presetData", void 0), d(this, "instruments", void 0), d(this, "presets", void 0), d(this, "banks", void 0), !(v instanceof s.SF2Chunk)) {
|
|
811
811
|
var m = Object(i.parseBuffer)(v);
|
|
812
812
|
v = new s.SF2Chunk(m);
|
|
@@ -817,28 +817,28 @@ function Ph() {
|
|
|
817
817
|
return p(g, null, [{ key: "from", value: function(v) {
|
|
818
818
|
return new g(v);
|
|
819
819
|
} }]), p(g, [{ key: "getKeyData", value: function(v) {
|
|
820
|
-
var m = this, y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0,
|
|
821
|
-
return Object(c.memoize)((function(
|
|
820
|
+
var m = this, y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, w = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
|
|
821
|
+
return Object(c.memoize)((function(b, _, S) {
|
|
822
822
|
var C = m.banks[_];
|
|
823
823
|
if (C) {
|
|
824
824
|
var E = C.presets[S];
|
|
825
825
|
if (E) {
|
|
826
826
|
var x = E.zones.filter((function(Z) {
|
|
827
|
-
return m.isKeyInRange(Z,
|
|
827
|
+
return m.isKeyInRange(Z, b);
|
|
828
828
|
}));
|
|
829
829
|
if (x.length > 0) {
|
|
830
830
|
var M = !0, R = !1, A = void 0;
|
|
831
831
|
try {
|
|
832
832
|
for (var I, D = x[Symbol.iterator](); !(M = (I = D.next()).done); M = !0) {
|
|
833
833
|
var F = I.value, L = F.instrument, H = L.zones.filter((function(Z) {
|
|
834
|
-
return m.isKeyInRange(Z,
|
|
834
|
+
return m.isKeyInRange(Z, b);
|
|
835
835
|
}));
|
|
836
836
|
if (H.length > 0) {
|
|
837
837
|
var Q = !0, q = !1, oe = void 0;
|
|
838
838
|
try {
|
|
839
839
|
for (var X, ee = H[Symbol.iterator](); !(Q = (X = ee.next()).done); Q = !0) {
|
|
840
840
|
var ie = X.value, fe = ie.sample, he = u({}, F.generators, ie.generators), Re = u({}, F.modulators, ie.modulators);
|
|
841
|
-
return { keyNumber:
|
|
841
|
+
return { keyNumber: b, preset: E, instrument: L, sample: fe, generators: he, modulators: Re };
|
|
842
842
|
}
|
|
843
843
|
} catch (Z) {
|
|
844
844
|
q = !0, oe = Z;
|
|
@@ -864,7 +864,7 @@ function Ph() {
|
|
|
864
864
|
}
|
|
865
865
|
}
|
|
866
866
|
return null;
|
|
867
|
-
}))(v, y,
|
|
867
|
+
}))(v, y, w);
|
|
868
868
|
} }, { key: "isKeyInRange", value: function(v, m) {
|
|
869
869
|
return v.keyRange === void 0 || v.keyRange.lo <= m && v.keyRange.hi >= m;
|
|
870
870
|
} }, { key: "getBanks", value: function() {
|
|
@@ -873,8 +873,8 @@ function Ph() {
|
|
|
873
873
|
return v[y] || (v[y] = { presets: [] }), v[y].presets[m.header.preset] = m, v;
|
|
874
874
|
}), []);
|
|
875
875
|
} }, { key: "getPresets", value: function() {
|
|
876
|
-
var v = this.presetData, m = v.presetHeaders, y = v.presetZones,
|
|
877
|
-
return Object(l.getItemsInZone)(m, y,
|
|
876
|
+
var v = this.presetData, m = v.presetHeaders, y = v.presetZones, w = v.presetGenerators, b = v.presetModulators;
|
|
877
|
+
return Object(l.getItemsInZone)(m, y, b, w, this.instruments, a.GeneratorType.Instrument).filter((function(_) {
|
|
878
878
|
return _.header.name !== "EOP";
|
|
879
879
|
})).map((function(_) {
|
|
880
880
|
return { header: _.header, globalZone: _.globalZone, zones: _.zones.map((function(S) {
|
|
@@ -882,8 +882,8 @@ function Ph() {
|
|
|
882
882
|
})) };
|
|
883
883
|
}));
|
|
884
884
|
} }, { key: "getInstruments", value: function() {
|
|
885
|
-
var v = this.presetData, m = v.instrumentHeaders, y = v.instrumentZones,
|
|
886
|
-
return Object(l.getItemsInZone)(m, y,
|
|
885
|
+
var v = this.presetData, m = v.instrumentHeaders, y = v.instrumentZones, w = v.instrumentModulators, b = v.instrumentGenerators;
|
|
886
|
+
return Object(l.getItemsInZone)(m, y, w, b, this.samples, a.GeneratorType.SampleId).filter((function(_) {
|
|
887
887
|
return _.header.name !== "EOI";
|
|
888
888
|
})).map((function(_) {
|
|
889
889
|
return { header: _.header, globalZone: _.globalZone, zones: _.zones.map((function(S) {
|
|
@@ -1991,17 +1991,17 @@ var Zh = class {
|
|
|
1991
1991
|
}
|
|
1992
1992
|
const c = Lt().rawContext, u = c.createBufferSource();
|
|
1993
1993
|
u.buffer = l.buffer, u.playbackRate.value = l.playbackRate, (l.loopMode === 1 || l.loopMode === 3) && (u.loop = !0, u.loopStart = l.loopStart, u.loopEnd = l.loopEnd);
|
|
1994
|
-
const f = l.buffer.duration / l.playbackRate, p = l.loopMode === 0 ? Math.max(n, f) : n, d = o * o, h = c.createGain(), { attackVolEnv: g, holdVolEnv: v, decayVolEnv: m, sustainVolEnv: y, releaseVolEnv:
|
|
1994
|
+
const f = l.buffer.duration / l.playbackRate, p = l.loopMode === 0 ? Math.max(n, f) : n, d = o * o, h = c.createGain(), { attackVolEnv: g, holdVolEnv: v, decayVolEnv: m, sustainVolEnv: y, releaseVolEnv: w } = l, b = d * y;
|
|
1995
1995
|
h.gain.setValueAtTime(0, r), h.gain.linearRampToValueAtTime(d, r + g), v > 1e-3 && h.gain.setValueAtTime(d, r + g + v);
|
|
1996
1996
|
const _ = r + g + v;
|
|
1997
|
-
h.gain.linearRampToValueAtTime(
|
|
1997
|
+
h.gain.linearRampToValueAtTime(b, _ + m), h.gain.setValueAtTime(b, r + p), h.gain.linearRampToValueAtTime(0, r + p + w), u.connect(h), h.connect(this.volumeNode.input.input), this.activeSources.add(u), u.onended = () => {
|
|
1998
1998
|
this.activeSources.delete(u);
|
|
1999
1999
|
try {
|
|
2000
2000
|
h.disconnect();
|
|
2001
2001
|
} catch (S) {
|
|
2002
2002
|
console.warn("[waveform-playlist] GainNode already disconnected:", S);
|
|
2003
2003
|
}
|
|
2004
|
-
}, u.start(r), u.stop(r + p +
|
|
2004
|
+
}, u.start(r), u.stop(r + p + w);
|
|
2005
2005
|
}
|
|
2006
2006
|
gainToDb(t) {
|
|
2007
2007
|
return 20 * Math.log10(t);
|
|
@@ -2405,14 +2405,14 @@ function Yh(e) {
|
|
|
2405
2405
|
stereoPan: f.pan,
|
|
2406
2406
|
startTime: h,
|
|
2407
2407
|
endTime: g
|
|
2408
|
-
}, y = d.map((
|
|
2409
|
-
notes:
|
|
2410
|
-
startTime: co(
|
|
2411
|
-
duration: Cl(
|
|
2412
|
-
offset: kl(
|
|
2408
|
+
}, y = d.map((w) => ({
|
|
2409
|
+
notes: w.midiNotes,
|
|
2410
|
+
startTime: co(w) - h,
|
|
2411
|
+
duration: Cl(w),
|
|
2412
|
+
offset: kl(w)
|
|
2413
2413
|
}));
|
|
2414
2414
|
if (e?.soundFontCache?.isLoaded) {
|
|
2415
|
-
const
|
|
2415
|
+
const w = d[0], _ = w.midiChannel === 9, S = w.midiProgram ?? 0;
|
|
2416
2416
|
t.addSoundFontTrack({
|
|
2417
2417
|
clips: y,
|
|
2418
2418
|
track: m,
|
|
@@ -3138,12 +3138,12 @@ var op = Object.create, Ls = Object.defineProperty, ap = Object.defineProperties
|
|
|
3138
3138
|
}, rr = (e, t, n, r, o, a) => {
|
|
3139
3139
|
var s, i, l, c, u, f = t & 7, p = !!(t & 8), d = !!(t & 16), h = f > 3 ? e.length + 1 : f ? p ? 1 : 2 : 0, g = zc[f + 5], v = f > 3 && (e[h - 1] = []), m = e[h] || (e[h] = []), y = f && (!d && !p && (o = o.prototype), f < 5 && (f > 3 || !d) && sp(f < 4 ? o : { get [n]() {
|
|
3140
3140
|
return Sn(this, a);
|
|
3141
|
-
}, set [n](
|
|
3142
|
-
return rn(this, a,
|
|
3141
|
+
}, set [n](b) {
|
|
3142
|
+
return rn(this, a, b);
|
|
3143
3143
|
} }, n));
|
|
3144
3144
|
f ? d && f < 4 && Rl(a, (f > 2 ? "set " : f > 1 ? "get " : "") + n) : Rl(o, n);
|
|
3145
|
-
for (var
|
|
3146
|
-
c = pp(f, n, l = {}, e[3], m), f && (c.static = p, c.private = d, u = c.access = { has: d ? (
|
|
3145
|
+
for (var w = r.length - 1; w >= 0; w--)
|
|
3146
|
+
c = pp(f, n, l = {}, e[3], m), f && (c.static = p, c.private = d, u = c.access = { has: d ? (b) => mp(o, b) : (b) => n in b }, f ^ 3 && (u.get = d ? (b) => (f ^ 1 ? Sn : gp)(b, o, f ^ 4 ? a : y.get) : (b) => b[n]), f > 2 && (u.set = d ? (b, _) => rn(b, o, _, f ^ 4 ? a : y.set) : (b, _) => b[n] = _)), i = (0, r[w])(f ? f < 4 ? d ? a : y[g] : f > 4 ? void 0 : { get: y.get, set: y.set } : o, c), l._ = 1, f ^ 4 || i === void 0 ? mr(i) && (f > 4 ? v.unshift(i) : f ? d ? a = i : y[g] = i : o = i) : typeof i != "object" || i === null ? nr("Object expected") : (mr(s = i.get) && (y.get = s), mr(s = i.set) && (y.set = s), mr(s = i.init) && v.unshift(s));
|
|
3147
3147
|
return f || Zc(e, o), y && Ls(o, n, y), d ? f ^ 4 ? a : y : o;
|
|
3148
3148
|
}, Bs = (e, t, n) => t.has(e) || nr("Cannot " + n), mp = (e, t) => Object(t) !== t ? nr('Cannot use the "in" operator on this value') : e.has(t), Sn = (e, t, n) => (Bs(e, t, "read from private field"), n ? n.call(e) : t.get(e)), fo = (e, t, n) => t.has(e) ? nr("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), rn = (e, t, n, r) => (Bs(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), gp = (e, t, n) => (Bs(e, t, "access private method"), n);
|
|
3149
3149
|
function Po(e, t) {
|
|
@@ -3479,12 +3479,12 @@ var au = /* @__PURE__ */ ((e) => (e.Horizontal = "x", e.Vertical = "y", e))(au |
|
|
|
3479
3479
|
}, de = (e, t, n, r, o, a) => {
|
|
3480
3480
|
var s, i, l, c, u, f = t & 7, p = !!(t & 8), d = !!(t & 16), h = f > 3 ? e.length + 1 : f ? p ? 1 : 2 : 0, g = hu[f + 5], v = f > 3 && (e[h - 1] = []), m = e[h] || (e[h] = []), y = f && (!d && !p && (o = o.prototype), f < 5 && (f > 3 || !d) && Dp(f < 4 ? o : { get [n]() {
|
|
3481
3481
|
return Je(this, a);
|
|
3482
|
-
}, set [n](
|
|
3483
|
-
return It(this, a,
|
|
3482
|
+
}, set [n](b) {
|
|
3483
|
+
return It(this, a, b);
|
|
3484
3484
|
} }, n));
|
|
3485
3485
|
f ? d && f < 4 && Ol(a, (f > 2 ? "set " : f > 1 ? "get " : "") + n) : Ol(o, n);
|
|
3486
|
-
for (var
|
|
3487
|
-
c = Pp(f, n, l = {}, e[3], m), f && (c.static = p, c.private = d, u = c.access = { has: d ? (
|
|
3486
|
+
for (var w = r.length - 1; w >= 0; w--)
|
|
3487
|
+
c = Pp(f, n, l = {}, e[3], m), f && (c.static = p, c.private = d, u = c.access = { has: d ? (b) => Fp(o, b) : (b) => n in b }, f ^ 3 && (u.get = d ? (b) => (f ^ 1 ? Je : Op)(b, o, f ^ 4 ? a : y.get) : (b) => b[n]), f > 2 && (u.set = d ? (b, _) => It(b, o, _, f ^ 4 ? a : y.set) : (b, _) => b[n] = _)), i = (0, r[w])(f ? f < 4 ? d ? a : y[g] : f > 4 ? void 0 : { get: y.get, set: y.set } : o, c), l._ = 1, f ^ 4 || i === void 0 ? gr(i) && (f > 4 ? v.unshift(i) : f ? d ? a = i : y[g] = i : o = i) : typeof i != "object" || i === null ? or("Object expected") : (gr(s = i.get) && (y.get = s), gr(s = i.set) && (y.set = s), gr(s = i.init) && v.unshift(s));
|
|
3488
3488
|
return f || In(e, o), y && zs(o, n, y), d ? f ^ 4 ? a : y : o;
|
|
3489
3489
|
}, Zs = (e, t, n) => t.has(e) || or("Cannot " + n), Fp = (e, t) => Object(t) !== t ? or('Cannot use the "in" operator on this value') : e.has(t), Je = (e, t, n) => (Zs(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Se = (e, t, n) => t.has(e) ? or("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), It = (e, t, n, r) => (Zs(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), Op = (e, t, n) => (Zs(e, t, "access private method"), n);
|
|
3490
3490
|
function pu(e, t) {
|
|
@@ -4515,8 +4515,8 @@ var Up = class {
|
|
|
4515
4515
|
for (const m of g)
|
|
4516
4516
|
v.includes(m) || m.destroy();
|
|
4517
4517
|
this.dragOperation.modifiers = (h = (d = (p = this.dragOperation.source) == null ? void 0 : p.modifiers) == null ? void 0 : d.map((m) => {
|
|
4518
|
-
const { plugin: y, options:
|
|
4519
|
-
return new y(this,
|
|
4518
|
+
const { plugin: y, options: w } = Hs(m);
|
|
4519
|
+
return new y(this, w);
|
|
4520
4520
|
})) != null ? h : v;
|
|
4521
4521
|
});
|
|
4522
4522
|
this.destroy = () => {
|
|
@@ -4645,12 +4645,12 @@ function Oo(e, t = e.getBoundingClientRect(), n = 0) {
|
|
|
4645
4645
|
let f = e.parentElement;
|
|
4646
4646
|
for (; f && f !== c.documentElement; ) {
|
|
4647
4647
|
if (!jp(f)) {
|
|
4648
|
-
const
|
|
4648
|
+
const w = f.getBoundingClientRect(), b = n * (w.bottom - w.top), _ = n * (w.right - w.left), S = n * (w.bottom - w.top), C = n * (w.right - w.left);
|
|
4649
4649
|
l = {
|
|
4650
|
-
top: Math.max(l.top,
|
|
4651
|
-
right: Math.min(l.right,
|
|
4652
|
-
bottom: Math.min(l.bottom,
|
|
4653
|
-
left: Math.max(l.left,
|
|
4650
|
+
top: Math.max(l.top, w.top - b),
|
|
4651
|
+
right: Math.min(l.right, w.right + _),
|
|
4652
|
+
bottom: Math.min(l.bottom, w.bottom + S),
|
|
4653
|
+
left: Math.max(l.left, w.left - C),
|
|
4654
4654
|
width: 0,
|
|
4655
4655
|
// Will be calculated next
|
|
4656
4656
|
height: 0
|
|
@@ -4871,7 +4871,7 @@ var Nl = Array.from({ length: 100 }, (e, t) => t / 100), od = 75, yn, Bo, tn, bn
|
|
|
4871
4871
|
const { element: l } = this;
|
|
4872
4872
|
if ((a = ce(this, bn)) == null || a.disconnect(), ce(this, Ir) || !ce(this, yn) || !l.isConnected)
|
|
4873
4873
|
return;
|
|
4874
|
-
const c = (s = l.ownerDocument) != null ? s : document, { innerHeight: u, innerWidth: f } = (i = c.defaultView) != null ? i : window, p = l.getBoundingClientRect(), d = Oo(l, p), { top: h, left: g, bottom: v, right: m } = d, y = -Math.floor(h),
|
|
4874
|
+
const c = (s = l.ownerDocument) != null ? s : document, { innerHeight: u, innerWidth: f } = (i = c.defaultView) != null ? i : window, p = l.getBoundingClientRect(), d = Oo(l, p), { top: h, left: g, bottom: v, right: m } = d, y = -Math.floor(h), w = -Math.floor(g), b = -Math.floor(f - m), _ = -Math.floor(u - v), S = `${y}px ${b}px ${_}px ${w}px`;
|
|
4875
4875
|
this.boundingClientRect = p, St(this, bn, new IntersectionObserver(
|
|
4876
4876
|
(C) => {
|
|
4877
4877
|
const [E] = C, { intersectionRect: x } = E;
|
|
@@ -5212,28 +5212,28 @@ function Sm(e, t, n, r = 25, o = wm, a = _m) {
|
|
|
5212
5212
|
l.top * d.scaleY + d.y,
|
|
5213
5213
|
l.width * d.scaleX,
|
|
5214
5214
|
l.height * d.scaleY
|
|
5215
|
-
),
|
|
5215
|
+
), w = {
|
|
5216
5216
|
x: 0,
|
|
5217
5217
|
y: 0
|
|
5218
5218
|
/* Idle */
|
|
5219
|
-
},
|
|
5219
|
+
}, b = {
|
|
5220
5220
|
x: 0,
|
|
5221
5221
|
y: 0
|
|
5222
5222
|
}, _ = {
|
|
5223
5223
|
height: y.height * o.y,
|
|
5224
5224
|
width: y.width * o.x
|
|
5225
5225
|
};
|
|
5226
|
-
return (!c || m && !u) && i <= y.top + _.height && n?.y !== 1 && s >= y.left - a.x && s <= y.right + a.x ? (
|
|
5226
|
+
return (!c || m && !u) && i <= y.top + _.height && n?.y !== 1 && s >= y.left - a.x && s <= y.right + a.x ? (w.y = m ? 1 : -1, b.y = r * Math.abs(
|
|
5227
5227
|
(y.top + _.height - i) / _.height
|
|
5228
|
-
)) : (!u || m && !c) && i >= y.bottom - _.height && n?.y !== -1 && s >= y.left - a.x && s <= y.right + a.x && (
|
|
5228
|
+
)) : (!u || m && !c) && i >= y.bottom - _.height && n?.y !== -1 && s >= y.left - a.x && s <= y.right + a.x && (w.y = m ? -1 : 1, b.y = r * Math.abs(
|
|
5229
5229
|
(y.bottom - _.height - i) / _.height
|
|
5230
|
-
)), (!p || v && !f) && s >= y.right - _.width && n?.x !== -1 && i >= y.top - a.y && i <= y.bottom + a.y ? (
|
|
5230
|
+
)), (!p || v && !f) && s >= y.right - _.width && n?.x !== -1 && i >= y.top - a.y && i <= y.bottom + a.y ? (w.x = v ? -1 : 1, b.x = r * Math.abs(
|
|
5231
5231
|
(y.right - _.width - s) / _.width
|
|
5232
|
-
)) : (!f || v && !p) && s <= y.left + _.width && n?.x !== 1 && i >= y.top - a.y && i <= y.bottom + a.y && (
|
|
5232
|
+
)) : (!f || v && !p) && s <= y.left + _.width && n?.x !== 1 && i >= y.top - a.y && i <= y.bottom + a.y && (w.x = v ? 1 : -1, b.x = r * Math.abs(
|
|
5233
5233
|
(y.left + _.width - s) / _.width
|
|
5234
5234
|
)), {
|
|
5235
|
-
direction:
|
|
5236
|
-
speed:
|
|
5235
|
+
direction: w,
|
|
5236
|
+
speed: b
|
|
5237
5237
|
};
|
|
5238
5238
|
}
|
|
5239
5239
|
function km(e) {
|
|
@@ -5328,25 +5328,25 @@ var Yt = class extends Hr {
|
|
|
5328
5328
|
const v = qt(e), m = bi(v), y = {
|
|
5329
5329
|
x: (n = m?.scaleX) != null ? n : 1,
|
|
5330
5330
|
y: (r = m?.scaleY) != null ? r : 1
|
|
5331
|
-
},
|
|
5331
|
+
}, w = Dm(e, v);
|
|
5332
5332
|
c?.(), m && (g = Em(
|
|
5333
5333
|
u,
|
|
5334
5334
|
m,
|
|
5335
5335
|
v.transformOrigin
|
|
5336
|
-
), (i ||
|
|
5337
|
-
const
|
|
5336
|
+
), (i || w) && (f = g.top, p = g.left, d = g.width, h = g.height));
|
|
5337
|
+
const b = {
|
|
5338
5338
|
width: (o = g?.width) != null ? o : d,
|
|
5339
5339
|
height: (a = g?.height) != null ? a : h
|
|
5340
5340
|
};
|
|
5341
|
-
if (
|
|
5341
|
+
if (w && !i && g) {
|
|
5342
5342
|
const _ = xm(
|
|
5343
5343
|
g,
|
|
5344
|
-
|
|
5344
|
+
w,
|
|
5345
5345
|
v.transformOrigin
|
|
5346
5346
|
);
|
|
5347
|
-
f = _.top, p = _.left, d = _.width, h = _.height, y.x =
|
|
5347
|
+
f = _.top, p = _.left, d = _.width, h = _.height, y.x = w.scaleX, y.y = w.scaleY;
|
|
5348
5348
|
}
|
|
5349
|
-
s && (i || (p *= s.scaleX, d *= s.scaleX, f *= s.scaleY, h *= s.scaleY), p += s.x, f += s.y), super(p, f, d, h), this.scale = y, this.intrinsicWidth =
|
|
5349
|
+
s && (i || (p *= s.scaleX, d *= s.scaleX, f *= s.scaleY, h *= s.scaleY), p += s.x, f += s.y), super(p, f, d, h), this.scale = y, this.intrinsicWidth = b.width, this.intrinsicHeight = b.height;
|
|
5350
5350
|
}
|
|
5351
5351
|
};
|
|
5352
5352
|
function Dm(e, t) {
|
|
@@ -5504,12 +5504,12 @@ var Lm = ({
|
|
|
5504
5504
|
}, Ct = (e, t, n, r, o, a) => {
|
|
5505
5505
|
var s, i, l, c, u, f = t & 7, p = !!(t & 8), d = !!(t & 16), h = f > 3 ? e.length + 1 : f ? p ? 1 : 2 : 0, g = hd[f + 5], v = f > 3 && (e[h - 1] = []), m = e[h] || (e[h] = []), y = f && (!d && !p && (o = o.prototype), f < 5 && (f > 3 || !d) && zm(f < 4 ? o : { get [n]() {
|
|
5506
5506
|
return Ie(this, a);
|
|
5507
|
-
}, set [n](
|
|
5508
|
-
return ut(this, a,
|
|
5507
|
+
}, set [n](b) {
|
|
5508
|
+
return ut(this, a, b);
|
|
5509
5509
|
} }, n));
|
|
5510
5510
|
f ? d && f < 4 && Hl(a, (f > 2 ? "set " : f > 1 ? "get " : "") + n) : Hl(o, n);
|
|
5511
|
-
for (var
|
|
5512
|
-
c = Hm(f, n, l = {}, e[3], m), f && (c.static = p, c.private = d, u = c.access = { has: d ? (
|
|
5511
|
+
for (var w = r.length - 1; w >= 0; w--)
|
|
5512
|
+
c = Hm(f, n, l = {}, e[3], m), f && (c.static = p, c.private = d, u = c.access = { has: d ? (b) => Gm(o, b) : (b) => n in b }, f ^ 3 && (u.get = d ? (b) => (f ^ 1 ? Ie : xn)(b, o, f ^ 4 ? a : y.get) : (b) => b[n]), f > 2 && (u.set = d ? (b, _) => ut(b, o, _, f ^ 4 ? a : y.set) : (b, _) => b[n] = _)), i = (0, r[w])(f ? f < 4 ? d ? a : y[g] : f > 4 ? void 0 : { get: y.get, set: y.set } : o, c), l._ = 1, f ^ 4 || i === void 0 ? kr(i) && (f > 4 ? v.unshift(i) : f ? d ? a = i : y[g] = i : o = i) : typeof i != "object" || i === null ? sr("Object expected") : (kr(s = i.get) && (y.get = s), kr(s = i.set) && (y.set = s), kr(s = i.init) && v.unshift(s));
|
|
5513
5513
|
return f || Tn(e, o), y && _i(o, n, y), d ? f ^ 4 ? a : y : o;
|
|
5514
5514
|
}, ki = (e, t, n) => t.has(e) || sr("Cannot " + n), Gm = (e, t) => Object(t) !== t ? sr('Cannot use the "in" operator on this value') : e.has(t), Ie = (e, t, n) => (ki(e, t, "read from private field"), n ? n.call(e) : t.get(e)), We = (e, t, n) => t.has(e) ? sr("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), ut = (e, t, n, r) => (ki(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), xn = (e, t, n) => (ki(e, t, "access private method"), n), Gl = {
|
|
5515
5515
|
role: "button",
|
|
@@ -5577,38 +5577,38 @@ var Qm = ["dragover", "dragmove"], eg = class extends mt {
|
|
|
5577
5577
|
l,
|
|
5578
5578
|
s.draggable
|
|
5579
5579
|
), _.push(u)), f?.isConnected || (f = Jm(c), p = document.createTextNode(""), f.appendChild(p), _.push(f)), _.length > 0 && document.body.append(..._);
|
|
5580
|
-
},
|
|
5581
|
-
function
|
|
5582
|
-
for (const _ of
|
|
5580
|
+
}, w = /* @__PURE__ */ new Set();
|
|
5581
|
+
function b() {
|
|
5582
|
+
for (const _ of w)
|
|
5583
5583
|
_();
|
|
5584
5584
|
}
|
|
5585
5585
|
this.registerEffect(() => {
|
|
5586
5586
|
var _;
|
|
5587
|
-
|
|
5587
|
+
w.clear();
|
|
5588
5588
|
for (const S of this.manager.registry.draggables.value) {
|
|
5589
5589
|
const C = (_ = S.handle) != null ? _ : S.element;
|
|
5590
5590
|
if (C) {
|
|
5591
|
-
(!u || !f) &&
|
|
5591
|
+
(!u || !f) && w.add(y), (!Km(C) || mi()) && !C.hasAttribute("tabindex") && w.add(() => C.setAttribute("tabindex", "0")), !C.hasAttribute("role") && C.tagName.toLowerCase() !== "button" && w.add(
|
|
5592
5592
|
() => C.setAttribute("role", Gl.role)
|
|
5593
|
-
), C.hasAttribute("aria-roledescription") ||
|
|
5593
|
+
), C.hasAttribute("aria-roledescription") || w.add(
|
|
5594
5594
|
() => C.setAttribute(
|
|
5595
5595
|
"aria-roledescription",
|
|
5596
5596
|
Gl.roleDescription
|
|
5597
5597
|
)
|
|
5598
|
-
), C.hasAttribute("aria-describedby") ||
|
|
5598
|
+
), C.hasAttribute("aria-describedby") || w.add(
|
|
5599
5599
|
() => C.setAttribute("aria-describedby", l)
|
|
5600
5600
|
);
|
|
5601
5601
|
for (const x of ["aria-pressed", "aria-grabbed"]) {
|
|
5602
5602
|
const M = String(S.isDragging);
|
|
5603
|
-
C.getAttribute(x) !== M &&
|
|
5603
|
+
C.getAttribute(x) !== M && w.add(() => C.setAttribute(x, M));
|
|
5604
5604
|
}
|
|
5605
5605
|
const E = String(S.disabled);
|
|
5606
|
-
C.getAttribute("aria-disabled") !== E &&
|
|
5606
|
+
C.getAttribute("aria-disabled") !== E && w.add(
|
|
5607
5607
|
() => C.setAttribute("aria-disabled", E)
|
|
5608
5608
|
);
|
|
5609
5609
|
}
|
|
5610
5610
|
}
|
|
5611
|
-
|
|
5611
|
+
w.size > 0 && Vo.schedule(b);
|
|
5612
5612
|
}), this.destroy = () => {
|
|
5613
5613
|
super.destroy(), u?.remove(), f?.remove(), m.forEach((_) => _());
|
|
5614
5614
|
};
|
|
@@ -6073,8 +6073,8 @@ xd = function() {
|
|
|
6073
6073
|
x: g.scaleX / h.scaleX,
|
|
6074
6074
|
y: g.scaleY / h.scaleY
|
|
6075
6075
|
};
|
|
6076
|
-
let { width:
|
|
6077
|
-
v && (
|
|
6076
|
+
let { width: w, height: b, top: _, left: S } = m;
|
|
6077
|
+
v && (w = w / y.x, b = b / y.y);
|
|
6078
6078
|
const C = new Rm(d), {
|
|
6079
6079
|
transition: E,
|
|
6080
6080
|
translate: x,
|
|
@@ -6097,8 +6097,8 @@ xd = function() {
|
|
|
6097
6097
|
if (!p.transformOrigin) {
|
|
6098
6098
|
const le = ke(() => i.current);
|
|
6099
6099
|
p.transformOrigin = {
|
|
6100
|
-
x: (le.x - S * h.scaleX - h.x) / (
|
|
6101
|
-
y: (le.y - _ * h.scaleY - h.y) / (
|
|
6100
|
+
x: (le.x - S * h.scaleX - h.x) / (w * h.scaleX),
|
|
6101
|
+
y: (le.y - _ * h.scaleY - h.y) / (b * h.scaleY)
|
|
6102
6102
|
};
|
|
6103
6103
|
}
|
|
6104
6104
|
const { transformOrigin: he } = p, Re = _ * h.scaleY + h.y, Z = S * h.scaleX + h.x;
|
|
@@ -6107,15 +6107,15 @@ xd = function() {
|
|
|
6107
6107
|
y: Re
|
|
6108
6108
|
}, y.x !== 1 || y.y !== 1)) {
|
|
6109
6109
|
const { scaleX: le, scaleY: pe } = g, { x: Ke, y: Rt } = he;
|
|
6110
|
-
p.coordinates.x += (
|
|
6110
|
+
p.coordinates.x += (w * le - w) * Ke, p.coordinates.y += (b * pe - b) * Rt;
|
|
6111
6111
|
}
|
|
6112
|
-
p.dimensions || (p.dimensions = { width:
|
|
6112
|
+
p.dimensions || (p.dimensions = { width: w, height: b }), p.frameTransform || (p.frameTransform = h);
|
|
6113
6113
|
const Y = {
|
|
6114
6114
|
x: p.coordinates.x - Z,
|
|
6115
6115
|
y: p.coordinates.y - Re
|
|
6116
6116
|
}, _e = {
|
|
6117
|
-
width: (p.dimensions.width * p.frameTransform.scaleX -
|
|
6118
|
-
height: (p.dimensions.height * p.frameTransform.scaleY -
|
|
6117
|
+
width: (p.dimensions.width * p.frameTransform.scaleX - w * h.scaleX) * he.x,
|
|
6118
|
+
height: (p.dimensions.height * p.frameTransform.scaleY - b * h.scaleY) * he.y
|
|
6119
6119
|
}, G = {
|
|
6120
6120
|
x: Y.x / h.scaleX + _e.width,
|
|
6121
6121
|
y: Y.y / h.scaleY + _e.height
|
|
@@ -6127,8 +6127,8 @@ xd = function() {
|
|
|
6127
6127
|
const Me = ke(() => s.transform), B = (t = p.translate) != null ? t : { x: 0, y: 0 }, Oe = Me.x * h.scaleX + B.x, st = Me.y * h.scaleY + B.y, Ge = Qu();
|
|
6128
6128
|
C.set(
|
|
6129
6129
|
{
|
|
6130
|
-
width:
|
|
6131
|
-
height:
|
|
6130
|
+
width: w - X,
|
|
6131
|
+
height: b - ee,
|
|
6132
6132
|
top: te.top + Ge.y,
|
|
6133
6133
|
left: te.left + Ge.x,
|
|
6134
6134
|
translate: `${Oe}px ${st}px 0`,
|
|
@@ -6145,8 +6145,8 @@ xd = function() {
|
|
|
6145
6145
|
feedbackElement: d,
|
|
6146
6146
|
frameTransform: h,
|
|
6147
6147
|
transformOrigin: he,
|
|
6148
|
-
width:
|
|
6149
|
-
height:
|
|
6148
|
+
width: w,
|
|
6149
|
+
height: b,
|
|
6150
6150
|
top: _,
|
|
6151
6151
|
left: S,
|
|
6152
6152
|
widthOffset: X,
|
|
@@ -6354,16 +6354,16 @@ var Td, gs, Vr, Ai, nn, vs, ia = class extends (gs = Ur, Td = [ge], gs) {
|
|
|
6354
6354
|
for (const m of su)
|
|
6355
6355
|
p[m].isLocked(v[m]) && (g[m] = 0, v[m] = 0);
|
|
6356
6356
|
if (v.x || v.y) {
|
|
6357
|
-
const { x: m, y } = u ?? v,
|
|
6358
|
-
if (
|
|
6357
|
+
const { x: m, y } = u ?? v, w = m * g.x, b = y * g.y;
|
|
6358
|
+
if (w || b) {
|
|
6359
6359
|
const _ = (s = Ie(this, nn)) == null ? void 0 : s.by;
|
|
6360
|
-
if (this.autoScrolling && _ && (_.x && !
|
|
6360
|
+
if (this.autoScrolling && _ && (_.x && !w || _.y && !b))
|
|
6361
6361
|
continue;
|
|
6362
6362
|
return ut(this, nn, {
|
|
6363
6363
|
element: d,
|
|
6364
6364
|
by: {
|
|
6365
|
-
x:
|
|
6366
|
-
y:
|
|
6365
|
+
x: w,
|
|
6366
|
+
y: b
|
|
6367
6367
|
}
|
|
6368
6368
|
}), Vo.schedule(Ie(this, vs)), !0;
|
|
6369
6369
|
}
|
|
@@ -8016,7 +8016,7 @@ var kv = O.canvas.attrs((e) => ({
|
|
|
8016
8016
|
},
|
|
8017
8017
|
`${r}-${_}`
|
|
8018
8018
|
);
|
|
8019
|
-
}),
|
|
8019
|
+
}), b = p ? "transparent" : cn(c);
|
|
8020
8020
|
return /* @__PURE__ */ k(
|
|
8021
8021
|
Cv,
|
|
8022
8022
|
{
|
|
@@ -8024,7 +8024,7 @@ var kv = O.canvas.attrs((e) => ({
|
|
|
8024
8024
|
$cssWidth: r,
|
|
8025
8025
|
className: a,
|
|
8026
8026
|
$waveHeight: i,
|
|
8027
|
-
$waveFillColor:
|
|
8027
|
+
$waveFillColor: b,
|
|
8028
8028
|
children: y
|
|
8029
8029
|
}
|
|
8030
8030
|
);
|
|
@@ -8258,9 +8258,9 @@ var rc = ({
|
|
|
8258
8258
|
fadeOut: v,
|
|
8259
8259
|
sampleRate: m = 44100,
|
|
8260
8260
|
showFades: y = !1,
|
|
8261
|
-
touchOptimized:
|
|
8261
|
+
touchOptimized: w = !1
|
|
8262
8262
|
}) => {
|
|
8263
|
-
const
|
|
8263
|
+
const b = Math.floor(s / l), _ = $c(s, i, l), S = c && !u && !f, C = `clip-${r}-${o}`, {
|
|
8264
8264
|
ref: E,
|
|
8265
8265
|
handleRef: x,
|
|
8266
8266
|
isDragSource: M
|
|
@@ -8285,7 +8285,7 @@ var rc = ({
|
|
|
8285
8285
|
ref: E,
|
|
8286
8286
|
style: M ? { zIndex: 100 } : void 0,
|
|
8287
8287
|
className: t,
|
|
8288
|
-
$left:
|
|
8288
|
+
$left: b,
|
|
8289
8289
|
$width: _,
|
|
8290
8290
|
$isOverlay: f,
|
|
8291
8291
|
"data-clip-container": "true",
|
|
@@ -8305,7 +8305,7 @@ var rc = ({
|
|
|
8305
8305
|
dragHandleProps: S ? { handleRef: x } : void 0
|
|
8306
8306
|
}
|
|
8307
8307
|
),
|
|
8308
|
-
/* @__PURE__ */ k(yv, { originX:
|
|
8308
|
+
/* @__PURE__ */ k(yv, { originX: b, children: /* @__PURE__ */ me(Fv, { $isOverlay: f, children: [
|
|
8309
8309
|
e,
|
|
8310
8310
|
y && g && g.duration > 0 && /* @__PURE__ */ k(
|
|
8311
8311
|
rc,
|
|
@@ -8334,7 +8334,7 @@ var rc = ({
|
|
|
8334
8334
|
trackIndex: r,
|
|
8335
8335
|
clipIndex: o,
|
|
8336
8336
|
edge: "left",
|
|
8337
|
-
touchOptimized:
|
|
8337
|
+
touchOptimized: w,
|
|
8338
8338
|
dragHandleProps: {
|
|
8339
8339
|
ref: A,
|
|
8340
8340
|
isDragging: I
|
|
@@ -8348,7 +8348,7 @@ var rc = ({
|
|
|
8348
8348
|
trackIndex: r,
|
|
8349
8349
|
clipIndex: o,
|
|
8350
8350
|
edge: "right",
|
|
8351
|
-
touchOptimized:
|
|
8351
|
+
touchOptimized: w,
|
|
8352
8352
|
dragHandleProps: {
|
|
8353
8353
|
ref: F,
|
|
8354
8354
|
isDragging: L
|
|
@@ -8434,7 +8434,7 @@ var rc = ({
|
|
|
8434
8434
|
for (const E of t)
|
|
8435
8435
|
E.midi < S && (S = E.midi), E.midi > C && (C = E.midi);
|
|
8436
8436
|
return { minMidi: Math.max(0, S - 1), maxMidi: Math.min(127, C + 1) };
|
|
8437
|
-
}, [t]),
|
|
8437
|
+
}, [t]), w = u ? c : l;
|
|
8438
8438
|
K(() => {
|
|
8439
8439
|
const S = y - m + 1, C = Math.max(2, r / S), E = s / a;
|
|
8440
8440
|
for (const [x, M] of h.current.entries()) {
|
|
@@ -8446,7 +8446,7 @@ var rc = ({
|
|
|
8446
8446
|
const H = L.time - i;
|
|
8447
8447
|
if (H + L.duration <= D || H >= F) continue;
|
|
8448
8448
|
const q = H * E - R, oe = Math.max(2, L.duration * E), X = (y - L.midi) / S * r, ee = 0.3 + L.velocity * 0.7;
|
|
8449
|
-
I.fillStyle =
|
|
8449
|
+
I.fillStyle = w, I.globalAlpha = ee;
|
|
8450
8450
|
const ie = 1;
|
|
8451
8451
|
I.beginPath(), I.roundRect(q, X, oe, C, ie), I.fill();
|
|
8452
8452
|
}
|
|
@@ -8460,14 +8460,14 @@ var rc = ({
|
|
|
8460
8460
|
a,
|
|
8461
8461
|
s,
|
|
8462
8462
|
i,
|
|
8463
|
-
|
|
8463
|
+
w,
|
|
8464
8464
|
m,
|
|
8465
8465
|
y,
|
|
8466
8466
|
n,
|
|
8467
8467
|
v,
|
|
8468
8468
|
e
|
|
8469
8469
|
]);
|
|
8470
|
-
const
|
|
8470
|
+
const b = v.map((S) => {
|
|
8471
8471
|
const C = S * Ze, E = Math.min(n - C, Ze);
|
|
8472
8472
|
return /* @__PURE__ */ k(
|
|
8473
8473
|
Vv,
|
|
@@ -8483,7 +8483,7 @@ var rc = ({
|
|
|
8483
8483
|
`${n}-${S}`
|
|
8484
8484
|
);
|
|
8485
8485
|
});
|
|
8486
|
-
return /* @__PURE__ */ k(Nv, { $index: e, $cssWidth: n, $waveHeight: r, $backgroundColor: f ? "transparent" : p, children:
|
|
8486
|
+
return /* @__PURE__ */ k(Nv, { $index: e, $cssWidth: n, $waveHeight: r, $backgroundColor: f ? "transparent" : p, children: b });
|
|
8487
8487
|
};
|
|
8488
8488
|
O.div.attrs((e) => ({
|
|
8489
8489
|
style: {
|
|
@@ -8590,8 +8590,8 @@ var Zv = O.div`
|
|
|
8590
8590
|
timescaleGapHeight: g = 0
|
|
8591
8591
|
}) => {
|
|
8592
8592
|
const v = T(null), m = $(
|
|
8593
|
-
(
|
|
8594
|
-
v.current =
|
|
8593
|
+
(w) => {
|
|
8594
|
+
v.current = w, f?.(w);
|
|
8595
8595
|
},
|
|
8596
8596
|
[f]
|
|
8597
8597
|
), y = s !== void 0 && s > 0;
|
|
@@ -8749,7 +8749,7 @@ var oc = O.div.attrs((e) => ({
|
|
|
8749
8749
|
const [c, u] = z(null), f = T(0), p = T(0), d = T(0), h = Math.max(0, t - e), g = $(
|
|
8750
8750
|
(m, y) => {
|
|
8751
8751
|
m.preventDefault(), m.stopPropagation(), u(y), f.current = m.clientX, p.current = y === "start" ? e : t;
|
|
8752
|
-
const
|
|
8752
|
+
const w = (_) => {
|
|
8753
8753
|
const S = _.clientX - f.current, C = p.current + S;
|
|
8754
8754
|
if (y === "start") {
|
|
8755
8755
|
const E = Math.max(i, Math.min(t - 10, C));
|
|
@@ -8758,23 +8758,23 @@ var oc = O.div.attrs((e) => ({
|
|
|
8758
8758
|
const E = Math.max(e + 10, Math.min(l, C));
|
|
8759
8759
|
a?.(E);
|
|
8760
8760
|
}
|
|
8761
|
-
},
|
|
8762
|
-
u(null), document.removeEventListener("mousemove",
|
|
8761
|
+
}, b = () => {
|
|
8762
|
+
u(null), document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", b);
|
|
8763
8763
|
};
|
|
8764
|
-
document.addEventListener("mousemove",
|
|
8764
|
+
document.addEventListener("mousemove", w), document.addEventListener("mouseup", b);
|
|
8765
8765
|
},
|
|
8766
8766
|
[e, t, i, l, o, a]
|
|
8767
8767
|
), v = $(
|
|
8768
8768
|
(m) => {
|
|
8769
8769
|
m.preventDefault(), m.stopPropagation(), u("region"), f.current = m.clientX, p.current = e, d.current = t;
|
|
8770
|
-
const y = t - e,
|
|
8770
|
+
const y = t - e, w = (_) => {
|
|
8771
8771
|
const S = _.clientX - f.current;
|
|
8772
8772
|
let C = p.current + S, E = d.current + S;
|
|
8773
8773
|
C < i && (C = i, E = i + y), E > l && (E = l, C = l - y), s?.(C, E);
|
|
8774
|
-
},
|
|
8775
|
-
u(null), document.removeEventListener("mousemove",
|
|
8774
|
+
}, b = () => {
|
|
8775
|
+
u(null), document.removeEventListener("mousemove", w), document.removeEventListener("mouseup", b);
|
|
8776
8776
|
};
|
|
8777
|
-
document.addEventListener("mousemove",
|
|
8777
|
+
document.addEventListener("mousemove", w), document.addEventListener("mouseup", b);
|
|
8778
8778
|
},
|
|
8779
8779
|
[e, t, i, l, s]
|
|
8780
8780
|
);
|
|
@@ -8840,8 +8840,8 @@ var oc = O.div.attrs((e) => ({
|
|
|
8840
8840
|
if (!h) return;
|
|
8841
8841
|
const g = p.clientX - h.left, v = Math.max(a, Math.min(s, g));
|
|
8842
8842
|
l.current = v, o?.(v, v);
|
|
8843
|
-
const m = (
|
|
8844
|
-
const
|
|
8843
|
+
const m = (w) => {
|
|
8844
|
+
const b = w.clientX - h.left, _ = Math.max(a, Math.min(s, b)), S = Math.min(l.current, _), C = Math.max(l.current, _);
|
|
8845
8845
|
o?.(S, C);
|
|
8846
8846
|
}, y = () => {
|
|
8847
8847
|
i(!1), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", y);
|
|
@@ -9087,14 +9087,14 @@ var h0 = f0(), sc = ({
|
|
|
9087
9087
|
clipId: p,
|
|
9088
9088
|
onCanvasesReady: d
|
|
9089
9089
|
}) => {
|
|
9090
|
-
const h = t ?? e, { canvasRef: g, canvasMapRef: v } = da(), m = T([]), y = T(/* @__PURE__ */ new WeakSet()),
|
|
9090
|
+
const h = t ?? e, { canvasRef: g, canvasMapRef: v } = da(), m = T([]), y = T(/* @__PURE__ */ new WeakSet()), w = T(f), b = T(d), _ = !!(f && p), S = Li(), C = ua(r, Ze, S), E = i ?? h0, x = u ?? (n ? n.sampleRate / 2 : 22050), M = l ?? c0, R = !!l;
|
|
9091
9091
|
K(() => {
|
|
9092
|
-
|
|
9092
|
+
w.current = f;
|
|
9093
9093
|
}, [f]), K(() => {
|
|
9094
|
-
|
|
9094
|
+
b.current = d;
|
|
9095
9095
|
}, [d]), K(() => {
|
|
9096
9096
|
if (!_) return;
|
|
9097
|
-
const I =
|
|
9097
|
+
const I = w.current;
|
|
9098
9098
|
if (!I || !p) return;
|
|
9099
9099
|
const D = m.current.length, F = [];
|
|
9100
9100
|
for (const Q of m.current) {
|
|
@@ -9141,10 +9141,10 @@ var h0 = f0(), sc = ({
|
|
|
9141
9141
|
const ee = parseInt(X[1], 10);
|
|
9142
9142
|
return Math.min(r - ee * Ze, Ze);
|
|
9143
9143
|
});
|
|
9144
|
-
|
|
9144
|
+
b.current?.(Q, q);
|
|
9145
9145
|
}
|
|
9146
9146
|
}, [v, _, p, h, r, C]), K(() => () => {
|
|
9147
|
-
const I =
|
|
9147
|
+
const I = w.current;
|
|
9148
9148
|
if (I) {
|
|
9149
9149
|
for (const D of m.current)
|
|
9150
9150
|
try {
|
|
@@ -9251,10 +9251,10 @@ var h0 = f0(), sc = ({
|
|
|
9251
9251
|
const v = Qr(), {
|
|
9252
9252
|
waveHeight: m,
|
|
9253
9253
|
barWidth: y,
|
|
9254
|
-
barGap:
|
|
9255
|
-
samplesPerPixel:
|
|
9254
|
+
barGap: w,
|
|
9255
|
+
samplesPerPixel: b,
|
|
9256
9256
|
sampleRate: _
|
|
9257
|
-
} = fa(), S = Vi(), C = a ??
|
|
9257
|
+
} = fa(), S = Vi(), C = a ?? b, E = e && v ? v.selectedWaveOutlineColor : v?.waveOutlineColor, x = e && v ? v.selectedWaveFillColor : v?.waveFillColor, M = v?.waveformDrawMode || "inverted", R = r || c;
|
|
9258
9258
|
if (n === "spectrogram" && R)
|
|
9259
9259
|
return /* @__PURE__ */ k(
|
|
9260
9260
|
sc,
|
|
@@ -9315,7 +9315,7 @@ var h0 = f0(), sc = ({
|
|
|
9315
9315
|
waveHeight: A,
|
|
9316
9316
|
devicePixelRatio: S,
|
|
9317
9317
|
barWidth: y,
|
|
9318
|
-
barGap:
|
|
9318
|
+
barGap: w,
|
|
9319
9319
|
transparentBackground: t,
|
|
9320
9320
|
drawMode: M
|
|
9321
9321
|
}
|
|
@@ -9350,7 +9350,7 @@ var h0 = f0(), sc = ({
|
|
|
9350
9350
|
waveHeight: m,
|
|
9351
9351
|
devicePixelRatio: S,
|
|
9352
9352
|
barWidth: y,
|
|
9353
|
-
barGap:
|
|
9353
|
+
barGap: w,
|
|
9354
9354
|
transparentBackground: t,
|
|
9355
9355
|
drawMode: M
|
|
9356
9356
|
}
|
|
@@ -9410,10 +9410,10 @@ var g0 = ({
|
|
|
9410
9410
|
for (let m = 0; m < t; m++) {
|
|
9411
9411
|
const y = m * e + d;
|
|
9412
9412
|
g.font = "11px monospace", g.textBaseline = "middle";
|
|
9413
|
-
for (const
|
|
9414
|
-
const
|
|
9415
|
-
if (
|
|
9416
|
-
const _ = y + f * (1 -
|
|
9413
|
+
for (const w of v) {
|
|
9414
|
+
const b = n(w, r, o);
|
|
9415
|
+
if (b < 0 || b > 1) continue;
|
|
9416
|
+
const _ = y + f * (1 - b), S = w >= 1e3 ? `${(w / 1e3).toFixed(1)}k` : `${w} Hz`, C = g.measureText(S), E = 3;
|
|
9417
9417
|
g.fillStyle = s, g.fillRect(0, _ - 7, C.width + E * 2, 14), g.fillStyle = a, g.fillText(S, E, _);
|
|
9418
9418
|
}
|
|
9419
9419
|
}
|
|
@@ -9484,11 +9484,11 @@ var g0 = ({
|
|
|
9484
9484
|
for (const [g, v] of o.current.entries()) {
|
|
9485
9485
|
const m = v.getContext("2d");
|
|
9486
9486
|
if (!m) continue;
|
|
9487
|
-
const y = g * Ze,
|
|
9487
|
+
const y = g * Ze, w = v.width / s;
|
|
9488
9488
|
m.resetTransform(), m.clearRect(0, 0, v.width, v.height), m.imageSmoothingEnabled = !1, m.fillStyle = t, m.scale(s, s);
|
|
9489
|
-
for (const [
|
|
9490
|
-
if (
|
|
9491
|
-
const S =
|
|
9489
|
+
for (const [b, _] of l.entries()) {
|
|
9490
|
+
if (b < y || b >= y + w) continue;
|
|
9491
|
+
const S = b - y, C = a - _;
|
|
9492
9492
|
m.fillRect(S, C, 1, _);
|
|
9493
9493
|
}
|
|
9494
9494
|
}
|
|
@@ -9533,10 +9533,10 @@ var S0 = O.div.attrs((e) => ({
|
|
|
9533
9533
|
const { samplesPerPixel: t, sampleRate: n, duration: r, timeScaleHeight: o } = Fe(Jr), a = df(), s = Ce(() => {
|
|
9534
9534
|
const i = Oh(r / 1e3, t, n);
|
|
9535
9535
|
if (a && a.scaleMode === "beats") {
|
|
9536
|
-
const { bpm: v, timeSignature: m, ticksPerBar: y, ticksPerBeat:
|
|
9536
|
+
const { bpm: v, timeSignature: m, ticksPerBar: y, ticksPerBeat: w } = a, b = /* @__PURE__ */ new Map(), _ = [], S = r / 1e3, C = Math.ceil(S * v * er / 60), E = Gn(w, v, n) / t, x = Gn(y, v, n) / t, M = 10, R = 30;
|
|
9537
9537
|
let A;
|
|
9538
9538
|
if (E >= M)
|
|
9539
|
-
A =
|
|
9539
|
+
A = w;
|
|
9540
9540
|
else if (x >= M)
|
|
9541
9541
|
A = y;
|
|
9542
9542
|
else {
|
|
@@ -9545,7 +9545,7 @@ var S0 = O.div.attrs((e) => ({
|
|
|
9545
9545
|
}
|
|
9546
9546
|
let I;
|
|
9547
9547
|
if (E >= R)
|
|
9548
|
-
I =
|
|
9548
|
+
I = w;
|
|
9549
9549
|
else if (x >= R)
|
|
9550
9550
|
I = y;
|
|
9551
9551
|
else {
|
|
@@ -9556,7 +9556,7 @@ var S0 = O.div.attrs((e) => ({
|
|
|
9556
9556
|
const F = Gn(D, v, n), L = Fh(F, t);
|
|
9557
9557
|
if (L >= i) break;
|
|
9558
9558
|
const H = D % y === 0, Q = D % I === 0, q = H ? o : Math.floor(Q ? o / 2 : o / 5);
|
|
9559
|
-
if (
|
|
9559
|
+
if (b.set(L, q), Q) {
|
|
9560
9560
|
const oe = Lh(D, m), X = e ? /* @__PURE__ */ k(at.Fragment, { children: e(oe, L) }, `bb-${D}`) : /* @__PURE__ */ k(
|
|
9561
9561
|
"div",
|
|
9562
9562
|
{
|
|
@@ -9573,15 +9573,15 @@ var S0 = O.div.attrs((e) => ({
|
|
|
9573
9573
|
_.push({ pix: L, element: X });
|
|
9574
9574
|
}
|
|
9575
9575
|
}
|
|
9576
|
-
return { widthX: i, canvasInfo:
|
|
9576
|
+
return { widthX: i, canvasInfo: b, timeMarkersWithPositions: _ };
|
|
9577
9577
|
}
|
|
9578
9578
|
const l = xs(t), { marker: c, bigStep: u, smallStep: f } = l, p = /* @__PURE__ */ new Map(), d = [], h = n / t;
|
|
9579
9579
|
let g = 0;
|
|
9580
9580
|
for (let v = 0; v < i; v += h * f / 1e3) {
|
|
9581
9581
|
const m = Math.floor(v);
|
|
9582
9582
|
if (g % c === 0) {
|
|
9583
|
-
const y = _0(g),
|
|
9584
|
-
d.push({ pix: m, element:
|
|
9583
|
+
const y = _0(g), w = e ? /* @__PURE__ */ k(at.Fragment, { children: e(y, m) }, `timestamp-${g}`) : /* @__PURE__ */ k(S0, { $left: m, children: y }, y);
|
|
9584
|
+
d.push({ pix: m, element: w }), p.set(m, o);
|
|
9585
9585
|
} else g % u === 0 ? p.set(m, Math.floor(o / 2)) : g % f === 0 && p.set(m, Math.floor(o / 5));
|
|
9586
9586
|
g += f;
|
|
9587
9587
|
}
|
|
@@ -9974,17 +9974,17 @@ function U0(e) {
|
|
|
9974
9974
|
return new Float32Array(R);
|
|
9975
9975
|
}), i = r ? s.length : 1, l = 24, c = G0(o, t), u = e.bits === 8 ? 1 : 2, f = l + c * 2 * u * i, p = new ArrayBuffer(f), d = new DataView(p), h = 0, g = l, v = new Array(i), m = new Array(i), y = 0; y < i; y++)
|
|
9976
9976
|
v[y] = 1 / 0, m[y] = -1 / 0;
|
|
9977
|
-
var
|
|
9977
|
+
var w = e.bits === 8 ? z0 : H0, b = e.bits === 8 ? N0 : Z0;
|
|
9978
9978
|
d.setInt32(0, 2, !0), d.setUint32(4, e.bits === 8, !0), d.setInt32(8, a, !0), d.setInt32(12, t, !0), d.setInt32(16, c, !0), d.setInt32(20, i, !0);
|
|
9979
9979
|
for (var _ = 0; _ < o; _++) {
|
|
9980
9980
|
var S = 0;
|
|
9981
9981
|
if (i === 1) {
|
|
9982
9982
|
for (var C = 0; C < s.length; ++C)
|
|
9983
9983
|
S += s[C][_];
|
|
9984
|
-
S = Math.floor(
|
|
9984
|
+
S = Math.floor(b * S * n / s.length), S < v[0] && (v[0] = S, v[0] < w && (v[0] = w)), S > m[0] && (m[0] = S, m[0] > b && (m[0] = b));
|
|
9985
9985
|
} else
|
|
9986
9986
|
for (var E = 0; E < i; ++E)
|
|
9987
|
-
S = Math.floor(
|
|
9987
|
+
S = Math.floor(b * s[E][_] * n), S < v[E] && (v[E] = S, v[E] < w && (v[E] = w)), S > m[E] && (m[E] = S, m[E] > b && (m[E] = b));
|
|
9988
9988
|
if (++h === t) {
|
|
9989
9989
|
for (var x = 0; x < i; x++)
|
|
9990
9990
|
e.bits === 8 ? (d.setInt8(g++, v[x]), d.setInt8(g++, m[x])) : (d.setInt16(g, v[x], !0), d.setInt16(g + 2, m[x], !0), g += 4), v[x] = 1 / 0, m[x] = -1 / 0;
|
|
@@ -10629,26 +10629,26 @@ function vo(e, t, n, r) {
|
|
|
10629
10629
|
function Ub(e, t = {}) {
|
|
10630
10630
|
const { immediate: n = !1, progressive: r = !1 } = t, o = n || r, [a, s] = z(!0), [i, l] = z(null), [c, u] = z(0), f = e.length, [p, d] = z(/* @__PURE__ */ new Map()), h = T(/* @__PURE__ */ new Map()), g = Ce(() => {
|
|
10631
10631
|
if (!o) return null;
|
|
10632
|
-
const
|
|
10633
|
-
for (let
|
|
10634
|
-
const _ = vo(e[
|
|
10635
|
-
_ &&
|
|
10632
|
+
const w = [];
|
|
10633
|
+
for (let b = 0; b < e.length; b++) {
|
|
10634
|
+
const _ = vo(e[b], b, p.get(b), h.current);
|
|
10635
|
+
_ && w.push(_);
|
|
10636
10636
|
}
|
|
10637
|
-
return
|
|
10637
|
+
return w;
|
|
10638
10638
|
}, [o, e, p]), [v, m] = z(g ?? []), y = T(g);
|
|
10639
10639
|
return g !== y.current && (y.current = g, g && m(g)), K(() => {
|
|
10640
10640
|
if (e.length === 0) {
|
|
10641
10641
|
m([]), s(!1), u(0);
|
|
10642
10642
|
return;
|
|
10643
10643
|
}
|
|
10644
|
-
let
|
|
10645
|
-
const
|
|
10644
|
+
let w = !1;
|
|
10645
|
+
const b = new AbortController();
|
|
10646
10646
|
return (async () => {
|
|
10647
10647
|
try {
|
|
10648
10648
|
s(!0), l(null), u(0), o && d(/* @__PURE__ */ new Map());
|
|
10649
10649
|
const S = nh.getContext().rawContext, C = e.map(async (x, M) => {
|
|
10650
10650
|
if (x.audioBuffer) {
|
|
10651
|
-
if (o && !
|
|
10651
|
+
if (o && !w) {
|
|
10652
10652
|
d((D) => {
|
|
10653
10653
|
const F = new Map(D);
|
|
10654
10654
|
return F.set(M, x.audioBuffer), F;
|
|
@@ -10658,7 +10658,7 @@ function Ub(e, t = {}) {
|
|
|
10658
10658
|
return vo(x, M, x.audioBuffer, h.current);
|
|
10659
10659
|
}
|
|
10660
10660
|
if (!x.src && x.waveformData) {
|
|
10661
|
-
if (o && !
|
|
10661
|
+
if (o && !w) {
|
|
10662
10662
|
u((D) => D + 1);
|
|
10663
10663
|
return;
|
|
10664
10664
|
}
|
|
@@ -10666,13 +10666,13 @@ function Ub(e, t = {}) {
|
|
|
10666
10666
|
}
|
|
10667
10667
|
if (!x.src)
|
|
10668
10668
|
throw new Error(`Track ${M + 1}: Must provide src, audioBuffer, or waveformData`);
|
|
10669
|
-
const R = await fetch(x.src, { signal:
|
|
10669
|
+
const R = await fetch(x.src, { signal: b.signal });
|
|
10670
10670
|
if (!R.ok)
|
|
10671
10671
|
throw new Error(`Failed to fetch ${x.src}: ${R.statusText}`);
|
|
10672
10672
|
const A = await R.arrayBuffer(), I = await S.decodeAudioData(A);
|
|
10673
10673
|
if (!I || !I.sampleRate || !I.duration)
|
|
10674
10674
|
throw new Error(`Invalid audio buffer for ${x.src}`);
|
|
10675
|
-
if (o && !
|
|
10675
|
+
if (o && !w) {
|
|
10676
10676
|
d((D) => {
|
|
10677
10677
|
const F = new Map(D);
|
|
10678
10678
|
return F.set(M, I), F;
|
|
@@ -10681,7 +10681,7 @@ function Ub(e, t = {}) {
|
|
|
10681
10681
|
}
|
|
10682
10682
|
return vo(x, M, I, h.current);
|
|
10683
10683
|
}), E = await Promise.all(C);
|
|
10684
|
-
if (!
|
|
10684
|
+
if (!w) {
|
|
10685
10685
|
if (!o) {
|
|
10686
10686
|
const x = E.filter((M) => M != null);
|
|
10687
10687
|
m(x), u(x.length);
|
|
@@ -10689,13 +10689,13 @@ function Ub(e, t = {}) {
|
|
|
10689
10689
|
s(!1);
|
|
10690
10690
|
}
|
|
10691
10691
|
} catch (S) {
|
|
10692
|
-
if (!
|
|
10692
|
+
if (!w) {
|
|
10693
10693
|
const C = S instanceof Error ? S.message : "Unknown error loading audio";
|
|
10694
10694
|
l(C), s(!1), console.error(`[waveform-playlist] Error loading audio tracks: ${C}`);
|
|
10695
10695
|
}
|
|
10696
10696
|
}
|
|
10697
10697
|
})(), () => {
|
|
10698
|
-
|
|
10698
|
+
w = !0, b.abort();
|
|
10699
10699
|
};
|
|
10700
10700
|
}, [e, o]), { tracks: v, loading: a, error: i, loadedCount: c, totalCount: f };
|
|
10701
10701
|
}
|
|
@@ -10763,8 +10763,8 @@ function hy({
|
|
|
10763
10763
|
(d) => {
|
|
10764
10764
|
const h = d.operation.source?.data;
|
|
10765
10765
|
if (!h || !h.boundary || !l.current) return;
|
|
10766
|
-
const { boundary: g, trackIndex: v, clipIndex: m } = h,
|
|
10767
|
-
let C =
|
|
10766
|
+
const { boundary: g, trackIndex: v, clipIndex: m } = h, w = (d.to?.x ?? d.operation.position.current.x) - d.operation.position.initial.x, b = w * n, _ = l.current, S = i.current;
|
|
10767
|
+
let C = b;
|
|
10768
10768
|
const E = e.map((x, M) => {
|
|
10769
10769
|
if (M !== v) return x;
|
|
10770
10770
|
const R = [...x.clips].sort((D, F) => D.startSample - F.startSample), A = R.findIndex((D) => D === x.clips[m]), I = x.clips.map((D, F) => {
|
|
@@ -10772,7 +10772,7 @@ function hy({
|
|
|
10772
10772
|
let L = fy({
|
|
10773
10773
|
originalClip: _,
|
|
10774
10774
|
clip: D,
|
|
10775
|
-
pixelDelta:
|
|
10775
|
+
pixelDelta: w,
|
|
10776
10776
|
samplesPerPixel: n,
|
|
10777
10777
|
sampleRate: r,
|
|
10778
10778
|
boundary: g,
|
|
@@ -10810,9 +10810,9 @@ function hy({
|
|
|
10810
10810
|
(d) => {
|
|
10811
10811
|
if (d.canceled) {
|
|
10812
10812
|
if (l.current) {
|
|
10813
|
-
const
|
|
10814
|
-
if (
|
|
10815
|
-
const { trackIndex: _, clipIndex: S } =
|
|
10813
|
+
const b = d.operation.source?.data;
|
|
10814
|
+
if (b) {
|
|
10815
|
+
const { trackIndex: _, clipIndex: S } = b, C = l.current, E = e.map((x, M) => {
|
|
10816
10816
|
if (M !== _) return x;
|
|
10817
10817
|
const R = x.clips.map((A, I) => I !== S ? A : {
|
|
10818
10818
|
...A,
|
|
@@ -10830,14 +10830,14 @@ function hy({
|
|
|
10830
10830
|
}
|
|
10831
10831
|
const h = d.operation.source?.data;
|
|
10832
10832
|
if (!h) return;
|
|
10833
|
-
const { trackIndex: g, clipId: v, boundary: m } = h, y = m ? c.current : d.operation.transform.x * n,
|
|
10833
|
+
const { trackIndex: g, clipId: v, boundary: m } = h, y = m ? c.current : d.operation.transform.x * n, w = e[g]?.id;
|
|
10834
10834
|
if (m) {
|
|
10835
|
-
a.current = !1,
|
|
10835
|
+
a.current = !1, w ? o.current ? o.current.trimClip(w, v, m, Math.floor(y)) : console.warn("[waveform-playlist] engineRef is null — trim not synced to adapter") : console.warn(
|
|
10836
10836
|
`[waveform-playlist] onDragEnd: track at index ${g} not found — trim not synced to adapter`
|
|
10837
10837
|
), l.current = null, c.current = 0;
|
|
10838
10838
|
return;
|
|
10839
10839
|
}
|
|
10840
|
-
|
|
10840
|
+
w ? o.current ? o.current.moveClip(w, v, Math.floor(y)) : console.warn("[waveform-playlist] engineRef is null — move not synced to adapter") : console.warn(
|
|
10841
10841
|
`[waveform-playlist] onDragEnd: track at index ${g} not found — move not synced to adapter`
|
|
10842
10842
|
);
|
|
10843
10843
|
},
|
|
@@ -10879,7 +10879,7 @@ function py({
|
|
|
10879
10879
|
return;
|
|
10880
10880
|
const f = u.operation.source?.data;
|
|
10881
10881
|
if (!f) return;
|
|
10882
|
-
const { edge: p, annotationIndex: d } = f, h = s.current, m = ((u.to?.x ?? u.operation.position.current.x) - u.operation.position.initial.x) * n / r, y = p === "start" ? h.start + m : h.end + m,
|
|
10882
|
+
const { edge: p, annotationIndex: d } = f, h = s.current, m = ((u.to?.x ?? u.operation.position.current.x) - u.operation.position.initial.x) * n / r, y = p === "start" ? h.start + m : h.end + m, w = my({
|
|
10883
10883
|
annotationIndex: d,
|
|
10884
10884
|
newTime: y,
|
|
10885
10885
|
isDraggingStart: p === "start",
|
|
@@ -10887,7 +10887,7 @@ function py({
|
|
|
10887
10887
|
duration: o,
|
|
10888
10888
|
linkEndpoints: a
|
|
10889
10889
|
});
|
|
10890
|
-
t(
|
|
10890
|
+
t(w);
|
|
10891
10891
|
},
|
|
10892
10892
|
[e, t, n, r, o, a]
|
|
10893
10893
|
), c = at.useCallback(
|
|
@@ -11218,9 +11218,9 @@ function by({
|
|
|
11218
11218
|
!r || e.length === 0 || (p < 0 || p >= e.length - 1 ? r(e[0].id) : r(e[p + 1].id));
|
|
11219
11219
|
}, [e, p, r]), y = $(() => {
|
|
11220
11220
|
!r || e.length === 0 || r(e[0].id);
|
|
11221
|
-
}, [e, r]), b = $(() => {
|
|
11222
|
-
!r || e.length === 0 || r(e[e.length - 1].id);
|
|
11223
11221
|
}, [e, r]), w = $(() => {
|
|
11222
|
+
!r || e.length === 0 || r(e[e.length - 1].id);
|
|
11223
|
+
}, [e, r]), b = $(() => {
|
|
11224
11224
|
r && r(null);
|
|
11225
11225
|
}, [r]), _ = $(() => {
|
|
11226
11226
|
if (p < 0 || !f) return;
|
|
@@ -11296,18 +11296,18 @@ function by({
|
|
|
11296
11296
|
},
|
|
11297
11297
|
{
|
|
11298
11298
|
key: "End",
|
|
11299
|
-
action:
|
|
11299
|
+
action: w,
|
|
11300
11300
|
description: "Select last annotation",
|
|
11301
11301
|
preventDefault: !0
|
|
11302
11302
|
},
|
|
11303
11303
|
{
|
|
11304
11304
|
key: "Escape",
|
|
11305
|
-
action:
|
|
11305
|
+
action: b,
|
|
11306
11306
|
description: "Deselect annotation",
|
|
11307
11307
|
preventDefault: !0
|
|
11308
11308
|
}
|
|
11309
11309
|
],
|
|
11310
|
-
[v, m, y,
|
|
11310
|
+
[v, m, y, w, b]
|
|
11311
11311
|
);
|
|
11312
11312
|
return Es({
|
|
11313
11313
|
shortcuts: S,
|
|
@@ -11321,8 +11321,8 @@ function by({
|
|
|
11321
11321
|
selectPrevious: v,
|
|
11322
11322
|
selectNext: m,
|
|
11323
11323
|
selectFirst: y,
|
|
11324
|
-
selectLast:
|
|
11325
|
-
clearSelection:
|
|
11324
|
+
selectLast: w,
|
|
11325
|
+
clearSelection: b,
|
|
11326
11326
|
scrollToAnnotation: d,
|
|
11327
11327
|
playActiveAnnotation: _
|
|
11328
11328
|
};
|
|
@@ -11967,7 +11967,7 @@ function qb(e = 256) {
|
|
|
11967
11967
|
const o = T(/* @__PURE__ */ new Map()), a = T(null), s = T(null), i = $((v) => {
|
|
11968
11968
|
const m = s.current;
|
|
11969
11969
|
if (!m) return;
|
|
11970
|
-
const { masterGainNode: y, destination:
|
|
11970
|
+
const { masterGainNode: y, destination: w, analyserNode: b } = m;
|
|
11971
11971
|
try {
|
|
11972
11972
|
y.disconnect();
|
|
11973
11973
|
} catch (S) {
|
|
@@ -11975,7 +11975,7 @@ function qb(e = 256) {
|
|
|
11975
11975
|
}
|
|
11976
11976
|
const _ = v.map((S) => o.current.get(S.instanceId)).filter((S) => S !== void 0);
|
|
11977
11977
|
if (_.length === 0)
|
|
11978
|
-
y.connect(
|
|
11978
|
+
y.connect(b), b.connect(w);
|
|
11979
11979
|
else {
|
|
11980
11980
|
let S = y;
|
|
11981
11981
|
_.forEach((C) => {
|
|
@@ -11985,7 +11985,7 @@ function qb(e = 256) {
|
|
|
11985
11985
|
console.warn(`[waveform-playlist] Error disconnecting effect "${C.id}":`, E);
|
|
11986
11986
|
}
|
|
11987
11987
|
S.connect(C.effect), S = C.effect;
|
|
11988
|
-
}), S.connect(
|
|
11988
|
+
}), S.connect(b), b.connect(w);
|
|
11989
11989
|
}
|
|
11990
11990
|
}, []), l = $((v) => {
|
|
11991
11991
|
const m = wf(v);
|
|
@@ -11997,44 +11997,44 @@ function qb(e = 256) {
|
|
|
11997
11997
|
m.parameters.forEach((_) => {
|
|
11998
11998
|
y[_.name] = _.default;
|
|
11999
11999
|
});
|
|
12000
|
-
const
|
|
12001
|
-
o.current.set(
|
|
12002
|
-
const
|
|
12003
|
-
instanceId:
|
|
12000
|
+
const w = jo(m, y);
|
|
12001
|
+
o.current.set(w.instanceId, w);
|
|
12002
|
+
const b = {
|
|
12003
|
+
instanceId: w.instanceId,
|
|
12004
12004
|
effectId: m.id,
|
|
12005
12005
|
definition: m,
|
|
12006
12006
|
params: y,
|
|
12007
12007
|
bypassed: !1
|
|
12008
12008
|
};
|
|
12009
|
-
n((_) => [..._,
|
|
12009
|
+
n((_) => [..._, b]);
|
|
12010
12010
|
}, []), c = $((v) => {
|
|
12011
12011
|
const m = o.current.get(v);
|
|
12012
|
-
m && (m.dispose(), o.current.delete(v)), n((y) => y.filter((
|
|
12012
|
+
m && (m.dispose(), o.current.delete(v)), n((y) => y.filter((w) => w.instanceId !== v));
|
|
12013
12013
|
}, []), u = $(
|
|
12014
12014
|
(v, m, y) => {
|
|
12015
|
-
const
|
|
12016
|
-
|
|
12017
|
-
(
|
|
12015
|
+
const w = o.current.get(v);
|
|
12016
|
+
w && w.setParameter(m, y), n(
|
|
12017
|
+
(b) => b.map(
|
|
12018
12018
|
(_) => _.instanceId === v ? { ..._, params: { ..._.params, [m]: y } } : _
|
|
12019
12019
|
)
|
|
12020
12020
|
);
|
|
12021
12021
|
},
|
|
12022
12022
|
[]
|
|
12023
12023
|
), f = $((v) => {
|
|
12024
|
-
const m = r.current.find((
|
|
12024
|
+
const m = r.current.find((b) => b.instanceId === v);
|
|
12025
12025
|
if (!m) return;
|
|
12026
|
-
const y = !m.bypassed,
|
|
12027
|
-
if (
|
|
12028
|
-
const
|
|
12029
|
-
|
|
12026
|
+
const y = !m.bypassed, w = o.current.get(v);
|
|
12027
|
+
if (w) {
|
|
12028
|
+
const b = m.params.wet ?? 1;
|
|
12029
|
+
w.setParameter("wet", y ? 0 : b);
|
|
12030
12030
|
}
|
|
12031
12031
|
n(
|
|
12032
|
-
(
|
|
12032
|
+
(b) => b.map((_) => _.instanceId === v ? { ..._, bypassed: y } : _)
|
|
12033
12033
|
);
|
|
12034
12034
|
}, []), p = $((v, m) => {
|
|
12035
12035
|
n((y) => {
|
|
12036
|
-
const
|
|
12037
|
-
return
|
|
12036
|
+
const w = [...y], [b] = w.splice(v, 1);
|
|
12037
|
+
return w.splice(m, 0, b), w;
|
|
12038
12038
|
});
|
|
12039
12039
|
}, []), d = $(() => {
|
|
12040
12040
|
o.current.forEach((v) => v.dispose()), o.current.clear(), n([]);
|
|
@@ -12044,23 +12044,23 @@ function qb(e = 256) {
|
|
|
12044
12044
|
}, [t, i]);
|
|
12045
12045
|
const h = $(
|
|
12046
12046
|
(v, m, y) => {
|
|
12047
|
-
const
|
|
12048
|
-
a.current =
|
|
12047
|
+
const w = new _c("fft", e);
|
|
12048
|
+
a.current = w, s.current = {
|
|
12049
12049
|
masterGainNode: v,
|
|
12050
12050
|
destination: m,
|
|
12051
|
-
analyserNode:
|
|
12051
|
+
analyserNode: w
|
|
12052
12052
|
};
|
|
12053
12053
|
const _ = r.current.map((S) => o.current.get(S.instanceId)).filter((S) => S !== void 0);
|
|
12054
12054
|
if (_.length === 0)
|
|
12055
|
-
v.connect(
|
|
12055
|
+
v.connect(w), w.connect(m);
|
|
12056
12056
|
else {
|
|
12057
12057
|
let S = v;
|
|
12058
12058
|
_.forEach((C) => {
|
|
12059
12059
|
S.connect(C.effect), S = C.effect;
|
|
12060
|
-
}), S.connect(
|
|
12060
|
+
}), S.connect(w), w.connect(m);
|
|
12061
12061
|
}
|
|
12062
12062
|
return function() {
|
|
12063
|
-
|
|
12063
|
+
w.dispose(), a.current = null, s.current = null;
|
|
12064
12064
|
};
|
|
12065
12065
|
},
|
|
12066
12066
|
[e]
|
|
@@ -12075,22 +12075,22 @@ function qb(e = 256) {
|
|
|
12075
12075
|
const g = $(() => {
|
|
12076
12076
|
const v = t.filter((m) => !m.bypassed);
|
|
12077
12077
|
if (v.length !== 0)
|
|
12078
|
-
return (m, y,
|
|
12079
|
-
const
|
|
12078
|
+
return (m, y, w) => {
|
|
12079
|
+
const b = [];
|
|
12080
12080
|
for (const _ of v) {
|
|
12081
12081
|
const S = jo(_.definition, _.params);
|
|
12082
|
-
|
|
12082
|
+
b.push(S);
|
|
12083
12083
|
}
|
|
12084
|
-
if (
|
|
12084
|
+
if (b.length === 0)
|
|
12085
12085
|
m.connect(y);
|
|
12086
12086
|
else {
|
|
12087
12087
|
let _ = m;
|
|
12088
|
-
|
|
12088
|
+
b.forEach((S) => {
|
|
12089
12089
|
_.connect(S.effect), _ = S.effect;
|
|
12090
12090
|
}), _.connect(y);
|
|
12091
12091
|
}
|
|
12092
12092
|
return function() {
|
|
12093
|
-
|
|
12093
|
+
b.forEach((S) => S.dispose());
|
|
12094
12094
|
};
|
|
12095
12095
|
};
|
|
12096
12096
|
}, [t]);
|
|
@@ -12117,15 +12117,15 @@ function Jb() {
|
|
|
12117
12117
|
const { graphEnd: v, masterGainNode: m } = g, y = n.current.get(d);
|
|
12118
12118
|
try {
|
|
12119
12119
|
v.disconnect();
|
|
12120
|
-
} catch (
|
|
12121
|
-
console.warn(`[waveform-playlist] Error disconnecting track "${d}" effect chain:`,
|
|
12120
|
+
} catch (b) {
|
|
12121
|
+
console.warn(`[waveform-playlist] Error disconnecting track "${d}" effect chain:`, b);
|
|
12122
12122
|
}
|
|
12123
|
-
const
|
|
12124
|
-
if (
|
|
12123
|
+
const w = h.map((b) => y?.get(b.instanceId)).filter((b) => b !== void 0);
|
|
12124
|
+
if (w.length === 0)
|
|
12125
12125
|
v.connect(m);
|
|
12126
12126
|
else {
|
|
12127
|
-
let
|
|
12128
|
-
|
|
12127
|
+
let b = v;
|
|
12128
|
+
w.forEach((_) => {
|
|
12129
12129
|
try {
|
|
12130
12130
|
_.disconnect();
|
|
12131
12131
|
} catch (S) {
|
|
@@ -12134,8 +12134,8 @@ function Jb() {
|
|
|
12134
12134
|
S
|
|
12135
12135
|
);
|
|
12136
12136
|
}
|
|
12137
|
-
|
|
12138
|
-
}),
|
|
12137
|
+
b.connect(_.effect), b = _.effect;
|
|
12138
|
+
}), b.connect(m);
|
|
12139
12139
|
}
|
|
12140
12140
|
}, []), a = $((d, h) => {
|
|
12141
12141
|
const g = wf(h);
|
|
@@ -12144,8 +12144,8 @@ function Jb() {
|
|
|
12144
12144
|
return;
|
|
12145
12145
|
}
|
|
12146
12146
|
const v = {};
|
|
12147
|
-
g.parameters.forEach((
|
|
12148
|
-
v[
|
|
12147
|
+
g.parameters.forEach((w) => {
|
|
12148
|
+
v[w.name] = w.default;
|
|
12149
12149
|
});
|
|
12150
12150
|
const m = jo(g, v);
|
|
12151
12151
|
n.current.has(d) || n.current.set(d, /* @__PURE__ */ new Map()), n.current.get(d).set(m.instanceId, m);
|
|
@@ -12156,43 +12156,43 @@ function Jb() {
|
|
|
12156
12156
|
params: v,
|
|
12157
12157
|
bypassed: !1
|
|
12158
12158
|
};
|
|
12159
|
-
t((
|
|
12160
|
-
const
|
|
12161
|
-
return
|
|
12159
|
+
t((w) => {
|
|
12160
|
+
const b = new Map(w), _ = b.get(d) || [];
|
|
12161
|
+
return b.set(d, [..._, y]), b;
|
|
12162
12162
|
});
|
|
12163
12163
|
}, []), s = $((d, h) => {
|
|
12164
12164
|
const g = n.current.get(d), v = g?.get(h);
|
|
12165
12165
|
v && (v.dispose(), g?.delete(h)), t((m) => {
|
|
12166
|
-
const y = new Map(m),
|
|
12166
|
+
const y = new Map(m), w = y.get(d) || [];
|
|
12167
12167
|
return y.set(
|
|
12168
12168
|
d,
|
|
12169
|
-
|
|
12169
|
+
w.filter((b) => b.instanceId !== h)
|
|
12170
12170
|
), y;
|
|
12171
12171
|
});
|
|
12172
12172
|
}, []), i = $(
|
|
12173
12173
|
(d, h, g, v) => {
|
|
12174
12174
|
const y = n.current.get(d)?.get(h);
|
|
12175
|
-
y && y.setParameter(g, v), t((
|
|
12176
|
-
const
|
|
12177
|
-
return
|
|
12175
|
+
y && y.setParameter(g, v), t((w) => {
|
|
12176
|
+
const b = new Map(w), _ = b.get(d) || [];
|
|
12177
|
+
return b.set(
|
|
12178
12178
|
d,
|
|
12179
12179
|
_.map(
|
|
12180
12180
|
(S) => S.instanceId === h ? { ...S, params: { ...S.params, [g]: v } } : S
|
|
12181
12181
|
)
|
|
12182
|
-
),
|
|
12182
|
+
), b;
|
|
12183
12183
|
});
|
|
12184
12184
|
},
|
|
12185
12185
|
[]
|
|
12186
12186
|
), l = $((d, h) => {
|
|
12187
|
-
const v = (u.current.get(d) || []).find((
|
|
12187
|
+
const v = (u.current.get(d) || []).find((b) => b.instanceId === h);
|
|
12188
12188
|
if (!v) return;
|
|
12189
|
-
const m = !v.bypassed,
|
|
12190
|
-
if (
|
|
12191
|
-
const
|
|
12192
|
-
|
|
12189
|
+
const m = !v.bypassed, w = n.current.get(d)?.get(h);
|
|
12190
|
+
if (w) {
|
|
12191
|
+
const b = v.params.wet ?? 1;
|
|
12192
|
+
w.setParameter("wet", m ? 0 : b);
|
|
12193
12193
|
}
|
|
12194
|
-
t((
|
|
12195
|
-
const _ = new Map(
|
|
12194
|
+
t((b) => {
|
|
12195
|
+
const _ = new Map(b), S = _.get(d) || [];
|
|
12196
12196
|
return _.set(
|
|
12197
12197
|
d,
|
|
12198
12198
|
S.map((C) => C.instanceId === h ? { ...C, bypassed: m } : C)
|
|
@@ -12212,14 +12212,14 @@ function Jb() {
|
|
|
12212
12212
|
graphEnd: h,
|
|
12213
12213
|
masterGainNode: g
|
|
12214
12214
|
});
|
|
12215
|
-
const m = u.current.get(d) || [], y = n.current.get(d),
|
|
12216
|
-
if (
|
|
12215
|
+
const m = u.current.get(d) || [], y = n.current.get(d), w = m.map((b) => y?.get(b.instanceId)).filter((b) => b !== void 0);
|
|
12216
|
+
if (w.length === 0)
|
|
12217
12217
|
h.connect(g);
|
|
12218
12218
|
else {
|
|
12219
|
-
let
|
|
12220
|
-
|
|
12221
|
-
|
|
12222
|
-
}),
|
|
12219
|
+
let b = h;
|
|
12220
|
+
w.forEach((_) => {
|
|
12221
|
+
b.connect(_.effect), b = _.effect;
|
|
12222
|
+
}), b.connect(g);
|
|
12223
12223
|
}
|
|
12224
12224
|
return function() {
|
|
12225
12225
|
r.current.delete(d);
|
|
@@ -12245,21 +12245,21 @@ function Jb() {
|
|
|
12245
12245
|
const g = (e.get(d) || []).filter((v) => !v.bypassed);
|
|
12246
12246
|
if (g.length !== 0)
|
|
12247
12247
|
return (v, m, y) => {
|
|
12248
|
-
const
|
|
12249
|
-
for (const
|
|
12250
|
-
const _ = jo(
|
|
12251
|
-
|
|
12248
|
+
const w = [];
|
|
12249
|
+
for (const b of g) {
|
|
12250
|
+
const _ = jo(b.definition, b.params);
|
|
12251
|
+
w.push(_);
|
|
12252
12252
|
}
|
|
12253
|
-
if (
|
|
12253
|
+
if (w.length === 0)
|
|
12254
12254
|
v.connect(m);
|
|
12255
12255
|
else {
|
|
12256
|
-
let
|
|
12257
|
-
|
|
12258
|
-
|
|
12259
|
-
}),
|
|
12256
|
+
let b = v;
|
|
12257
|
+
w.forEach((_) => {
|
|
12258
|
+
b.connect(_.effect), b = _.effect;
|
|
12259
|
+
}), b.connect(m);
|
|
12260
12260
|
}
|
|
12261
12261
|
return function() {
|
|
12262
|
-
|
|
12262
|
+
w.forEach((_) => _.dispose());
|
|
12263
12263
|
};
|
|
12264
12264
|
};
|
|
12265
12265
|
},
|
|
@@ -12287,8 +12287,8 @@ function ky(e, t = {}) {
|
|
|
12287
12287
|
if (n === 16)
|
|
12288
12288
|
for (let v = 0; v < a; v++)
|
|
12289
12289
|
for (let m = 0; m < r; m++) {
|
|
12290
|
-
const y = h[m][v],
|
|
12291
|
-
d.setInt16(g,
|
|
12290
|
+
const y = h[m][v], w = Math.max(-1, Math.min(1, y)), b = w < 0 ? w * 32768 : w * 32767;
|
|
12291
|
+
d.setInt16(g, b, !0), g += 2;
|
|
12292
12292
|
}
|
|
12293
12293
|
else
|
|
12294
12294
|
for (let v = 0; v < a; v++)
|
|
@@ -12326,15 +12326,15 @@ function xy() {
|
|
|
12326
12326
|
throw new Error("No tracks to export");
|
|
12327
12327
|
if (f === "individual" && (p === void 0 || p < 0 || p >= i.length))
|
|
12328
12328
|
throw new Error("Invalid track index for individual export");
|
|
12329
|
-
const
|
|
12330
|
-
let
|
|
12329
|
+
const w = i[0].clips[0]?.sampleRate || 44100;
|
|
12330
|
+
let b = 0;
|
|
12331
12331
|
for (const R of i)
|
|
12332
12332
|
for (const A of R.clips) {
|
|
12333
12333
|
const I = A.startSample + A.durationSamples;
|
|
12334
|
-
|
|
12334
|
+
b = Math.max(b, I);
|
|
12335
12335
|
}
|
|
12336
|
-
|
|
12337
|
-
const _ =
|
|
12336
|
+
b += Math.round(w * 0.1);
|
|
12337
|
+
const _ = b / w, S = f === "individual" ? [{ track: i[p], state: l[p], index: p }] : i.map((R, A) => ({ track: R, state: l[A], index: A })), C = l.some((R) => R.soloed), E = !!v;
|
|
12338
12338
|
let x;
|
|
12339
12339
|
if ((g || E) && h)
|
|
12340
12340
|
x = await Ey(
|
|
@@ -12342,7 +12342,7 @@ function xy() {
|
|
|
12342
12342
|
l,
|
|
12343
12343
|
C,
|
|
12344
12344
|
_,
|
|
12345
|
-
|
|
12345
|
+
w,
|
|
12346
12346
|
g,
|
|
12347
12347
|
v,
|
|
12348
12348
|
(R) => {
|
|
@@ -12350,13 +12350,13 @@ function xy() {
|
|
|
12350
12350
|
}
|
|
12351
12351
|
);
|
|
12352
12352
|
else {
|
|
12353
|
-
const R = new OfflineAudioContext(2,
|
|
12353
|
+
const R = new OfflineAudioContext(2, b, w);
|
|
12354
12354
|
let A = 0;
|
|
12355
12355
|
const I = S.reduce((D, { track: F }) => D + F.clips.length, 0);
|
|
12356
12356
|
for (const { track: D, state: F } of S)
|
|
12357
12357
|
if (!(F.muted && !F.soloed) && !(C && !F.soloed))
|
|
12358
12358
|
for (const L of D.clips) {
|
|
12359
|
-
await Ay(R, L, F,
|
|
12359
|
+
await Ay(R, L, F, w, h), A++;
|
|
12360
12360
|
const H = A / I * 0.5;
|
|
12361
12361
|
r(H), y?.(H);
|
|
12362
12362
|
}
|
|
@@ -12373,9 +12373,9 @@ function xy() {
|
|
|
12373
12373
|
blob: M,
|
|
12374
12374
|
duration: _
|
|
12375
12375
|
};
|
|
12376
|
-
} catch (
|
|
12377
|
-
const
|
|
12378
|
-
throw a(
|
|
12376
|
+
} catch (w) {
|
|
12377
|
+
const b = w instanceof Error ? w.message : "Export failed";
|
|
12378
|
+
throw a(b), w;
|
|
12379
12379
|
} finally {
|
|
12380
12380
|
t(!1);
|
|
12381
12381
|
}
|
|
@@ -12397,11 +12397,11 @@ async function Ey(e, t, n, r, o, a, s, i) {
|
|
|
12397
12397
|
const m = new c(0);
|
|
12398
12398
|
let y;
|
|
12399
12399
|
a ? y = a(m, v, !0) : m.connect(v);
|
|
12400
|
-
for (const { track:
|
|
12401
|
-
if (
|
|
12402
|
-
const _ = new c(Iy(
|
|
12400
|
+
for (const { track: w, state: b } of e) {
|
|
12401
|
+
if (b.muted && !b.soloed || n && !b.soloed) continue;
|
|
12402
|
+
const _ = new c(Iy(b.volume)), S = new f(b.pan), C = new u(b.muted ? 0 : 1), E = s?.(w.id);
|
|
12403
12403
|
E ? E(C, m, !0) : C.connect(m), S.connect(C), _.connect(S);
|
|
12404
|
-
for (const x of
|
|
12404
|
+
for (const x of w.clips) {
|
|
12405
12405
|
const {
|
|
12406
12406
|
audioBuffer: M,
|
|
12407
12407
|
startSample: R,
|
|
@@ -12456,22 +12456,22 @@ async function Ay(e, t, n, r, o) {
|
|
|
12456
12456
|
const v = e.createGain(), m = c * n.volume, y = e.createStereoPanner();
|
|
12457
12457
|
if (y.pan.value = n.pan, g.connect(v), v.connect(y), y.connect(e.destination), o) {
|
|
12458
12458
|
if (u ? v.gain.setValueAtTime(0, p) : v.gain.setValueAtTime(m, p), u) {
|
|
12459
|
-
const
|
|
12459
|
+
const w = p, b = p + u.duration;
|
|
12460
12460
|
hc(
|
|
12461
12461
|
v.gain,
|
|
12462
|
-
b,
|
|
12463
12462
|
w,
|
|
12463
|
+
b,
|
|
12464
12464
|
0,
|
|
12465
12465
|
m,
|
|
12466
12466
|
u.type || "linear"
|
|
12467
12467
|
);
|
|
12468
12468
|
}
|
|
12469
12469
|
if (f) {
|
|
12470
|
-
const
|
|
12471
|
-
(!u || u.duration < d - f.duration) && v.gain.setValueAtTime(m,
|
|
12470
|
+
const w = p + d - f.duration, b = p + d;
|
|
12471
|
+
(!u || u.duration < d - f.duration) && v.gain.setValueAtTime(m, w), hc(
|
|
12472
12472
|
v.gain,
|
|
12473
|
-
b,
|
|
12474
12473
|
w,
|
|
12474
|
+
b,
|
|
12475
12475
|
m,
|
|
12476
12476
|
0,
|
|
12477
12477
|
f.type || "linear"
|
|
@@ -12748,60 +12748,60 @@ function Dy(e, t) {
|
|
|
12748
12748
|
return K(() => {
|
|
12749
12749
|
let p = !1;
|
|
12750
12750
|
const d = i.current, h = l.current, g = c.current, v = [], m = /* @__PURE__ */ new Map();
|
|
12751
|
-
for (const
|
|
12752
|
-
for (const
|
|
12753
|
-
if (!
|
|
12751
|
+
for (const w of e)
|
|
12752
|
+
for (const b of w.clips) {
|
|
12753
|
+
if (!b.audioBuffer || b.waveformData)
|
|
12754
12754
|
continue;
|
|
12755
|
-
const _ = d.get(
|
|
12755
|
+
const _ = d.get(b.audioBuffer);
|
|
12756
12756
|
if (_) {
|
|
12757
12757
|
v.push({
|
|
12758
|
-
clipId:
|
|
12758
|
+
clipId: b.id,
|
|
12759
12759
|
waveformData: _
|
|
12760
12760
|
});
|
|
12761
12761
|
continue;
|
|
12762
12762
|
}
|
|
12763
|
-
if (h.get(
|
|
12764
|
-
const C = g.get(
|
|
12765
|
-
C ? C.add(
|
|
12763
|
+
if (h.get(b.audioBuffer)) {
|
|
12764
|
+
const C = g.get(b.audioBuffer);
|
|
12765
|
+
C ? C.add(b.id) : g.set(b.audioBuffer, /* @__PURE__ */ new Set([b.id]));
|
|
12766
12766
|
continue;
|
|
12767
12767
|
}
|
|
12768
|
-
const S = m.get(
|
|
12769
|
-
S ? S.add(
|
|
12768
|
+
const S = m.get(b.audioBuffer);
|
|
12769
|
+
S ? S.add(b.id) : m.set(b.audioBuffer, /* @__PURE__ */ new Set([b.id]));
|
|
12770
12770
|
}
|
|
12771
|
-
if (v.length > 0 && r((
|
|
12772
|
-
const
|
|
12771
|
+
if (v.length > 0 && r((w) => {
|
|
12772
|
+
const b = new Map(w);
|
|
12773
12773
|
for (const _ of v)
|
|
12774
|
-
|
|
12775
|
-
return
|
|
12774
|
+
b.set(_.clipId, _.waveformData);
|
|
12775
|
+
return b;
|
|
12776
12776
|
}), m.size === 0) return;
|
|
12777
12777
|
u.current += m.size, a(!0);
|
|
12778
12778
|
const y = f();
|
|
12779
|
-
for (const [
|
|
12780
|
-
g.set(
|
|
12779
|
+
for (const [w, b] of m) {
|
|
12780
|
+
g.set(w, new Set(b));
|
|
12781
12781
|
const _ = [];
|
|
12782
|
-
for (let E = 0; E <
|
|
12783
|
-
_.push(
|
|
12782
|
+
for (let E = 0; E < w.numberOfChannels; E++)
|
|
12783
|
+
_.push(w.getChannelData(E).slice().buffer);
|
|
12784
12784
|
const S = `buffer-${Math.random().toString(36).slice(2, 11)}`, C = y.generate({
|
|
12785
12785
|
id: S,
|
|
12786
12786
|
channels: _,
|
|
12787
|
-
length:
|
|
12788
|
-
sampleRate:
|
|
12787
|
+
length: w.length,
|
|
12788
|
+
sampleRate: w.sampleRate,
|
|
12789
12789
|
scale: t,
|
|
12790
12790
|
bits: 16,
|
|
12791
12791
|
splitChannels: !0
|
|
12792
12792
|
}).then((E) => {
|
|
12793
|
-
d.set(
|
|
12794
|
-
const x = g.get(
|
|
12795
|
-
g.delete(
|
|
12793
|
+
d.set(w, E);
|
|
12794
|
+
const x = g.get(w) ?? /* @__PURE__ */ new Set();
|
|
12795
|
+
g.delete(w), h.delete(w), !p && (r((M) => {
|
|
12796
12796
|
const R = new Map(M);
|
|
12797
12797
|
for (const A of x)
|
|
12798
12798
|
R.set(A, E);
|
|
12799
12799
|
return R;
|
|
12800
12800
|
}), u.current--, u.current <= 0 && (u.current = 0, a(!1)));
|
|
12801
12801
|
}).catch((E) => {
|
|
12802
|
-
g.delete(
|
|
12802
|
+
g.delete(w), h.delete(w), !p && (console.warn("[waveform-playlist] Worker peak generation failed:", E), u.current--, u.current <= 0 && (u.current = 0, a(!1)));
|
|
12803
12803
|
});
|
|
12804
|
-
h.set(
|
|
12804
|
+
h.set(w, C);
|
|
12805
12805
|
}
|
|
12806
12806
|
return () => {
|
|
12807
12807
|
p = !0, l.current = /* @__PURE__ */ new WeakMap(), c.current = /* @__PURE__ */ new WeakMap(), u.current = 0, a(!1);
|
|
@@ -12847,7 +12847,7 @@ function Qb() {
|
|
|
12847
12847
|
const v = new AbortController();
|
|
12848
12848
|
l.current.set(h.id, v), (async () => {
|
|
12849
12849
|
try {
|
|
12850
|
-
const { audioBuffer: m, name: y } = await Ry(g, p, v.signal),
|
|
12850
|
+
const { audioBuffer: m, name: y } = await Ry(g, p, v.signal), w = Ac({
|
|
12851
12851
|
audioBuffer: m,
|
|
12852
12852
|
startTime: 0,
|
|
12853
12853
|
duration: m.duration,
|
|
@@ -12855,11 +12855,11 @@ function Qb() {
|
|
|
12855
12855
|
name: y
|
|
12856
12856
|
});
|
|
12857
12857
|
!s.current && i.current.has(h.id) && t(
|
|
12858
|
-
(
|
|
12858
|
+
(b) => b.map((_) => _.id === h.id ? { ..._, name: y, clips: [w] } : _)
|
|
12859
12859
|
);
|
|
12860
12860
|
} catch (m) {
|
|
12861
12861
|
if (m instanceof DOMException && m.name === "AbortError") return;
|
|
12862
|
-
console.warn("[waveform-playlist] Error loading audio:", m), !s.current && i.current.has(h.id) && (t((y) => y.filter((
|
|
12862
|
+
console.warn("[waveform-playlist] Error loading audio:", m), !s.current && i.current.has(h.id) && (t((y) => y.filter((w) => w.id !== h.id)), a((y) => [
|
|
12863
12863
|
...y,
|
|
12864
12864
|
{
|
|
12865
12865
|
name: Is(g),
|
|
@@ -12905,8 +12905,8 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
|
|
|
12905
12905
|
progressBarWidth: v,
|
|
12906
12906
|
onTracksChange: m,
|
|
12907
12907
|
soundFontCache: y,
|
|
12908
|
-
deferEngineRebuild:
|
|
12909
|
-
children:
|
|
12908
|
+
deferEngineRebuild: w = !1,
|
|
12909
|
+
children: b
|
|
12910
12910
|
}) => {
|
|
12911
12911
|
const _ = v ?? h + g, S = Ce(
|
|
12912
12912
|
() => a,
|
|
@@ -12995,7 +12995,7 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
|
|
|
12995
12995
|
}), L(W);
|
|
12996
12996
|
return;
|
|
12997
12997
|
}
|
|
12998
|
-
if (
|
|
12998
|
+
if (w) {
|
|
12999
12999
|
let W = 0;
|
|
13000
13000
|
e.forEach((Ee) => {
|
|
13001
13001
|
Ee.clips.forEach((Te) => {
|
|
@@ -13096,7 +13096,7 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
|
|
|
13096
13096
|
Xi,
|
|
13097
13097
|
S,
|
|
13098
13098
|
y,
|
|
13099
|
-
|
|
13099
|
+
w
|
|
13100
13100
|
]), K(() => {
|
|
13101
13101
|
if (e.length === 0) return;
|
|
13102
13102
|
const N = e.map((U) => U.clips.map((W) => {
|
|
@@ -13129,7 +13129,7 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
|
|
|
13129
13129
|
}
|
|
13130
13130
|
}
|
|
13131
13131
|
if (!Ee) {
|
|
13132
|
-
!
|
|
13132
|
+
!w && !W.audioBuffer && !W.waveformData && !W.midiNotes && console.warn(
|
|
13133
13133
|
`[waveform-playlist] Clip "${W.id}" has no audio data or waveform data`
|
|
13134
13134
|
);
|
|
13135
13135
|
const Te = n ? 1 : W.audioBuffer?.numberOfChannels ?? 1, Ae = W.midiNotes ? Math.ceil(W.durationSamples / V) : 0;
|
|
@@ -13153,7 +13153,7 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
|
|
|
13153
13153
|
};
|
|
13154
13154
|
}));
|
|
13155
13155
|
oe(N);
|
|
13156
|
-
}, [e, V, n, nl,
|
|
13156
|
+
}, [e, V, n, nl, w]);
|
|
13157
13157
|
const al = T(!1), Fn = $(() => {
|
|
13158
13158
|
if (B.current)
|
|
13159
13159
|
return B.current.getCurrentTime();
|
|
@@ -13484,7 +13484,7 @@ const Sf = Ve(null), kf = Ve(null), Cf = Ve(null), xf = Ve(null), e1 = ({
|
|
|
13484
13484
|
m
|
|
13485
13485
|
]
|
|
13486
13486
|
), Qf = { ...rf, ...i };
|
|
13487
|
-
return /* @__PURE__ */ k(Ec, { theme: Qf, children: /* @__PURE__ */ k(Sf.Provider, { value: jf, children: /* @__PURE__ */ k(kf.Provider, { value: Kf, children: /* @__PURE__ */ k(Cf.Provider, { value: qf, children: /* @__PURE__ */ k(xf.Provider, { value: Jf, children:
|
|
13487
|
+
return /* @__PURE__ */ k(Ec, { theme: Qf, children: /* @__PURE__ */ k(Sf.Provider, { value: jf, children: /* @__PURE__ */ k(kf.Provider, { value: Kf, children: /* @__PURE__ */ k(Cf.Provider, { value: qf, children: /* @__PURE__ */ k(xf.Provider, { value: Jf, children: b }) }) }) }) });
|
|
13488
13488
|
}, Et = () => {
|
|
13489
13489
|
const e = Fe(Sf);
|
|
13490
13490
|
if (!e)
|
|
@@ -13766,7 +13766,7 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
|
|
|
13766
13766
|
onReady: d,
|
|
13767
13767
|
children: h
|
|
13768
13768
|
}) => {
|
|
13769
|
-
const g = f ?? c + u, [v, m] = z(!1), [y,
|
|
13769
|
+
const g = f ?? c + u, [v, m] = z(!1), [y, w] = z(0), [b, _] = z(0), [S, C] = z([]), [E, x] = z(o), M = Ce(() => {
|
|
13770
13770
|
if (!l?.annotations) return [];
|
|
13771
13771
|
if (process.env.NODE_ENV !== "production" && l.annotations.length > 0) {
|
|
13772
13772
|
const j = l.annotations[0];
|
|
@@ -13806,7 +13806,7 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
|
|
|
13806
13806
|
return ye && ye.setOnTimeUpdateCallback((je) => {
|
|
13807
13807
|
oe.current = je;
|
|
13808
13808
|
}), j.setOnPlaybackComplete(() => {
|
|
13809
|
-
Z(), m(!1), Y(null), oe.current = 0,
|
|
13809
|
+
Z(), m(!1), Y(null), oe.current = 0, w(0);
|
|
13810
13810
|
}), q.current = j, _(e.waveformData.duration), d?.(), () => {
|
|
13811
13811
|
Z(), j.dispose();
|
|
13812
13812
|
};
|
|
@@ -13881,15 +13881,15 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
|
|
|
13881
13881
|
},
|
|
13882
13882
|
[Me]
|
|
13883
13883
|
), st = $(() => {
|
|
13884
|
-
q.current && (q.current.pause(), m(!1), B(),
|
|
13884
|
+
q.current && (q.current.pause(), m(!1), B(), w(q.current.getCurrentTime()));
|
|
13885
13885
|
}, [B]), Ge = $(() => {
|
|
13886
|
-
q.current && (q.current.stop(), m(!1), B(), oe.current = 0,
|
|
13886
|
+
q.current && (q.current.stop(), m(!1), B(), oe.current = 0, w(0), Y(null));
|
|
13887
13887
|
}, [B, Y]), ve = $(
|
|
13888
13888
|
(j) => {
|
|
13889
|
-
const ye = Math.max(0, Math.min(j,
|
|
13890
|
-
oe.current = ye,
|
|
13889
|
+
const ye = Math.max(0, Math.min(j, b));
|
|
13890
|
+
oe.current = ye, w(ye), q.current && q.current.seekTo(ye);
|
|
13891
13891
|
},
|
|
13892
|
-
[
|
|
13892
|
+
[b]
|
|
13893
13893
|
), re = $((j) => {
|
|
13894
13894
|
const ye = Math.max(0.5, Math.min(2, j));
|
|
13895
13895
|
x(ye), q.current && q.current.setPlaybackRate(ye);
|
|
@@ -13952,7 +13952,7 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
|
|
|
13952
13952
|
]
|
|
13953
13953
|
), Dt = Ce(
|
|
13954
13954
|
() => ({
|
|
13955
|
-
duration:
|
|
13955
|
+
duration: b,
|
|
13956
13956
|
peaksDataArray: S,
|
|
13957
13957
|
sampleRate: te,
|
|
13958
13958
|
waveHeight: n,
|
|
@@ -13965,7 +13965,7 @@ const Ef = Ve(null), If = Ve(null), Af = Ve(null), Mf = Ve(null), t1 = ({
|
|
|
13965
13965
|
progressBarWidth: g
|
|
13966
13966
|
}),
|
|
13967
13967
|
[
|
|
13968
|
-
|
|
13968
|
+
b,
|
|
13969
13969
|
S,
|
|
13970
13970
|
te,
|
|
13971
13971
|
n,
|
|
@@ -14326,7 +14326,7 @@ const Wy = O.div.attrs((e) => ({
|
|
|
14326
14326
|
const m = l?.waveformDrawMode || "inverted";
|
|
14327
14327
|
let y;
|
|
14328
14328
|
m === "inverted" ? y = a.isSelected && l ? l.selectedWaveFillColor : l?.waveFillColor || "white" : y = a.isSelected && l ? l.selectedWaveOutlineColor : l?.waveOutlineColor || "grey";
|
|
14329
|
-
const
|
|
14329
|
+
const w = a.renderMode === "spectrogram" || a.renderMode === "both", b = a.renderMode === "piano-roll", _ = a.renderMode === "both", S = w ? "#000" : b ? l?.pianoRollBackgroundColor || "#1a1a2e" : cn(y), C = Math.floor(c / 2), E = c, x = a.index * c, M = cn(y);
|
|
14330
14330
|
return /* @__PURE__ */ me(Ny, { children: [
|
|
14331
14331
|
_ ? /* @__PURE__ */ me(zt, { children: [
|
|
14332
14332
|
/* @__PURE__ */ k(
|
|
@@ -14356,7 +14356,7 @@ const Wy = O.div.attrs((e) => ({
|
|
|
14356
14356
|
$width: a.length
|
|
14357
14357
|
}
|
|
14358
14358
|
),
|
|
14359
|
-
!
|
|
14359
|
+
!b && /* @__PURE__ */ k(
|
|
14360
14360
|
zy,
|
|
14361
14361
|
{
|
|
14362
14362
|
ref: s,
|
|
@@ -14416,8 +14416,8 @@ const Hy = 60, Gy = O.div.attrs((e) => ({
|
|
|
14416
14416
|
getPlaybackTime: m
|
|
14417
14417
|
} = Et(), {
|
|
14418
14418
|
selectionStart: y,
|
|
14419
|
-
selectionEnd:
|
|
14420
|
-
annotations:
|
|
14419
|
+
selectionEnd: w,
|
|
14420
|
+
annotations: b,
|
|
14421
14421
|
activeAnnotationId: _,
|
|
14422
14422
|
annotationsEditable: S,
|
|
14423
14423
|
linkEndpoints: C,
|
|
@@ -14822,7 +14822,7 @@ const Hy = 60, Gy = O.div.attrs((e) => ({
|
|
|
14822
14822
|
ne.id
|
|
14823
14823
|
);
|
|
14824
14824
|
}),
|
|
14825
|
-
|
|
14825
|
+
b.length > 0 && I && /* @__PURE__ */ k(I.AnnotationBoxesWrapper, { height: 30, width: ze, children: b.map((V, J) => {
|
|
14826
14826
|
const ne = V.start * te / G, ue = V.end * te / G, Le = o ? o(V, J) : V.id;
|
|
14827
14827
|
return /* @__PURE__ */ k(
|
|
14828
14828
|
I.AnnotationBox,
|
|
@@ -14840,15 +14840,15 @@ const Hy = 60, Gy = O.div.attrs((e) => ({
|
|
|
14840
14840
|
V.id
|
|
14841
14841
|
);
|
|
14842
14842
|
}) }),
|
|
14843
|
-
y !==
|
|
14843
|
+
y !== w && /* @__PURE__ */ k(
|
|
14844
14844
|
cf,
|
|
14845
14845
|
{
|
|
14846
|
-
startPosition: Math.min(y,
|
|
14847
|
-
endPosition: Math.max(y,
|
|
14846
|
+
startPosition: Math.min(y, w) * te / G,
|
|
14847
|
+
endPosition: Math.max(y, w) * te / G,
|
|
14848
14848
|
color: p.selectionColor
|
|
14849
14849
|
}
|
|
14850
14850
|
),
|
|
14851
|
-
(d || y ===
|
|
14851
|
+
(d || y === w) && (n ? n({
|
|
14852
14852
|
position: (h.current ?? 0) * te / G,
|
|
14853
14853
|
color: p.playheadColor,
|
|
14854
14854
|
isPlaying: d,
|
|
@@ -14933,7 +14933,7 @@ const Hy = 60, Gy = O.div.attrs((e) => ({
|
|
|
14933
14933
|
onRemoveTrack: v,
|
|
14934
14934
|
recordingState: m
|
|
14935
14935
|
}) => {
|
|
14936
|
-
const { annotations: y } = gt(),
|
|
14936
|
+
const { annotations: y } = gt(), w = By();
|
|
14937
14937
|
return /* @__PURE__ */ me(zt, { children: [
|
|
14938
14938
|
/* @__PURE__ */ k(
|
|
14939
14939
|
Uy,
|
|
@@ -14945,7 +14945,7 @@ const Hy = 60, Gy = O.div.attrs((e) => ({
|
|
|
14945
14945
|
getAnnotationBoxLabel: l,
|
|
14946
14946
|
className: f,
|
|
14947
14947
|
showClipHeaders: p,
|
|
14948
|
-
interactiveClips: d ||
|
|
14948
|
+
interactiveClips: d || w,
|
|
14949
14949
|
showFades: h,
|
|
14950
14950
|
touchOptimized: g,
|
|
14951
14951
|
onRemoveTrack: v,
|
|
@@ -15033,7 +15033,7 @@ function Rf(e) {
|
|
|
15033
15033
|
"onDragOver",
|
|
15034
15034
|
"onDragEnd"
|
|
15035
15035
|
]);
|
|
15036
|
-
const u = T(null), { plugins: f, modifiers: p, sensors: d } = c, h = Xt(f, Un.plugins), g = Xt(d, Un.sensors), v = Xt(p, Un.modifiers), m = Bn(o), y = Bn(a),
|
|
15036
|
+
const u = T(null), { plugins: f, modifiers: p, sensors: d } = c, h = Xt(f, Un.plugins), g = Xt(d, Un.sensors), v = Xt(p, Un.modifiers), m = Bn(o), y = Bn(a), w = Bn(i), b = Bn(s), _ = Bn(l), S = Bn(r), C = tb(() => {
|
|
15037
15037
|
var E;
|
|
15038
15038
|
return (E = c.manager) != null ? E : new Mi(c);
|
|
15039
15039
|
});
|
|
@@ -15054,11 +15054,11 @@ function Rf(e) {
|
|
|
15054
15054
|
}
|
|
15055
15055
|
),
|
|
15056
15056
|
M.addEventListener("dragover", (A) => {
|
|
15057
|
-
const I =
|
|
15057
|
+
const I = w.current;
|
|
15058
15058
|
I && x(() => I(A, C));
|
|
15059
15059
|
}),
|
|
15060
15060
|
M.addEventListener("dragmove", (A) => {
|
|
15061
|
-
const I =
|
|
15061
|
+
const I = b.current;
|
|
15062
15062
|
I && x(() => I(A, C));
|
|
15063
15063
|
}),
|
|
15064
15064
|
M.addEventListener("dragend", (A) => {
|
|
@@ -15311,16 +15311,16 @@ const Xf = (e) => {
|
|
|
15311
15311
|
const g = () => {
|
|
15312
15312
|
if (r.current) {
|
|
15313
15313
|
const m = (l.current ?? 0) * u, y = e + t;
|
|
15314
|
-
let
|
|
15314
|
+
let w = 0;
|
|
15315
15315
|
if (m <= e)
|
|
15316
|
-
|
|
15316
|
+
w = 0;
|
|
15317
15317
|
else if (m >= y)
|
|
15318
|
-
|
|
15318
|
+
w = n.length;
|
|
15319
15319
|
else {
|
|
15320
|
-
const
|
|
15321
|
-
|
|
15320
|
+
const b = m - e;
|
|
15321
|
+
w = Math.floor(b / c);
|
|
15322
15322
|
}
|
|
15323
|
-
r.current.style.width = `${
|
|
15323
|
+
r.current.style.width = `${w}px`;
|
|
15324
15324
|
}
|
|
15325
15325
|
i && (o.current = requestAnimationFrame(g));
|
|
15326
15326
|
};
|
|
@@ -15344,8 +15344,8 @@ const Xf = (e) => {
|
|
|
15344
15344
|
else if (v >= m)
|
|
15345
15345
|
y = n.length;
|
|
15346
15346
|
else {
|
|
15347
|
-
const
|
|
15348
|
-
y = Math.floor(
|
|
15347
|
+
const w = v - e;
|
|
15348
|
+
y = Math.floor(w / c);
|
|
15349
15349
|
}
|
|
15350
15350
|
r.current.style.width = `${y}px`;
|
|
15351
15351
|
}
|
|
@@ -15387,8 +15387,8 @@ const Xf = (e) => {
|
|
|
15387
15387
|
peaksDataArray: v,
|
|
15388
15388
|
sampleRate: m,
|
|
15389
15389
|
waveHeight: y,
|
|
15390
|
-
timeScaleHeight:
|
|
15391
|
-
samplesPerPixel:
|
|
15390
|
+
timeScaleHeight: w,
|
|
15391
|
+
samplesPerPixel: b,
|
|
15392
15392
|
controls: _,
|
|
15393
15393
|
playoutRef: S,
|
|
15394
15394
|
barWidth: C,
|
|
@@ -15398,7 +15398,7 @@ const Xf = (e) => {
|
|
|
15398
15398
|
F.current = Z, h(Z);
|
|
15399
15399
|
},
|
|
15400
15400
|
[h]
|
|
15401
|
-
), H = Math.floor(g * m /
|
|
15401
|
+
), H = Math.floor(g * m / b), Q = $(
|
|
15402
15402
|
async (Z) => {
|
|
15403
15403
|
p(Z.id);
|
|
15404
15404
|
try {
|
|
@@ -15420,23 +15420,23 @@ const Xf = (e) => {
|
|
|
15420
15420
|
), { onDragStart: oe, onDragMove: X, onDragEnd: ee } = py({
|
|
15421
15421
|
annotations: i,
|
|
15422
15422
|
onAnnotationsChange: q,
|
|
15423
|
-
samplesPerPixel:
|
|
15423
|
+
samplesPerPixel: b,
|
|
15424
15424
|
sampleRate: m,
|
|
15425
15425
|
duration: g,
|
|
15426
15426
|
linkEndpoints: n
|
|
15427
15427
|
}), ie = T(0), fe = $(
|
|
15428
15428
|
(Z) => {
|
|
15429
|
-
const Y = Z.currentTarget.getBoundingClientRect(), G = (Z.clientX - Y.left) *
|
|
15429
|
+
const Y = Z.currentTarget.getBoundingClientRect(), G = (Z.clientX - Y.left) * b / m;
|
|
15430
15430
|
ie.current = G, D(!0), M(G), A(G);
|
|
15431
15431
|
},
|
|
15432
|
-
[
|
|
15432
|
+
[b, m]
|
|
15433
15433
|
), he = $(
|
|
15434
15434
|
(Z) => {
|
|
15435
15435
|
if (!I) return;
|
|
15436
|
-
const Y = Z.currentTarget.getBoundingClientRect(), G = (Z.clientX - Y.left) *
|
|
15436
|
+
const Y = Z.currentTarget.getBoundingClientRect(), G = (Z.clientX - Y.left) * b / m;
|
|
15437
15437
|
A(G);
|
|
15438
15438
|
},
|
|
15439
|
-
[I,
|
|
15439
|
+
[I, b, m]
|
|
15440
15440
|
), Re = $(
|
|
15441
15441
|
(Z) => {
|
|
15442
15442
|
if (!I) return;
|
|
@@ -15445,20 +15445,20 @@ const Xf = (e) => {
|
|
|
15445
15445
|
f(B), M(B), A(B), S.current.stop(), u(B);
|
|
15446
15446
|
return;
|
|
15447
15447
|
}
|
|
15448
|
-
const Y = Z.currentTarget.getBoundingClientRect(), G = (Z.clientX - Y.left) *
|
|
15448
|
+
const Y = Z.currentTarget.getBoundingClientRect(), G = (Z.clientX - Y.left) * b / m, te = Math.min(x, G), Me = Math.max(x, G);
|
|
15449
15449
|
Math.abs(Me - te) < 0.1 ? (f(te), M(te), A(te)) : (M(te), A(Me));
|
|
15450
15450
|
},
|
|
15451
|
-
[I, x,
|
|
15451
|
+
[I, x, b, m, f, s, S, u]
|
|
15452
15452
|
);
|
|
15453
15453
|
return v.length === 0 ? /* @__PURE__ */ k("div", { className: o, children: "Loading waveform..." }) : /* @__PURE__ */ k(hf, { children: /* @__PURE__ */ k(
|
|
15454
15454
|
Jr.Provider,
|
|
15455
15455
|
{
|
|
15456
15456
|
value: {
|
|
15457
|
-
samplesPerPixel:
|
|
15457
|
+
samplesPerPixel: b,
|
|
15458
15458
|
sampleRate: m,
|
|
15459
|
-
zoomLevels: [
|
|
15459
|
+
zoomLevels: [b],
|
|
15460
15460
|
waveHeight: y,
|
|
15461
|
-
timeScaleHeight:
|
|
15461
|
+
timeScaleHeight: w,
|
|
15462
15462
|
duration: g * 1e3,
|
|
15463
15463
|
controls: _,
|
|
15464
15464
|
barWidth: C,
|
|
@@ -15478,7 +15478,7 @@ const Xf = (e) => {
|
|
|
15478
15478
|
onTracksMouseUp: Re,
|
|
15479
15479
|
scrollContainerRef: L,
|
|
15480
15480
|
isSelecting: I,
|
|
15481
|
-
timescale:
|
|
15481
|
+
timescale: w > 0 ? /* @__PURE__ */ k(mf, {}) : void 0,
|
|
15482
15482
|
children: /* @__PURE__ */ me(zt, { children: [
|
|
15483
15483
|
v.map((Z, Y) => {
|
|
15484
15484
|
const _e = Z.length > 0 ? Math.max(...Z.map((G) => G.peaks.data.length)) : 1;
|
|
@@ -15503,7 +15503,7 @@ const Xf = (e) => {
|
|
|
15503
15503
|
trackName: G.trackName,
|
|
15504
15504
|
startSample: G.startSample,
|
|
15505
15505
|
durationSamples: G.durationSamples,
|
|
15506
|
-
samplesPerPixel:
|
|
15506
|
+
samplesPerPixel: b,
|
|
15507
15507
|
showHeader: !1,
|
|
15508
15508
|
disableHeaderDrag: !0,
|
|
15509
15509
|
isSelected: !0,
|
|
@@ -15537,7 +15537,7 @@ const Xf = (e) => {
|
|
|
15537
15537
|
modifiers: t ? [Uf] : [],
|
|
15538
15538
|
plugins: Xf,
|
|
15539
15539
|
children: /* @__PURE__ */ k(c.AnnotationBoxesWrapper, { height: 30, width: H, children: i.map((Z, Y) => {
|
|
15540
|
-
const _e = Z.start * m /
|
|
15540
|
+
const _e = Z.start * m / b, G = Z.end * m / b, te = e ? e(Z, Y) : Z.id;
|
|
15541
15541
|
return /* @__PURE__ */ k(
|
|
15542
15542
|
c.AnnotationBox,
|
|
15543
15543
|
{
|
|
@@ -15559,8 +15559,8 @@ const Xf = (e) => {
|
|
|
15559
15559
|
x !== R && /* @__PURE__ */ k(
|
|
15560
15560
|
cf,
|
|
15561
15561
|
{
|
|
15562
|
-
startPosition: Math.min(x, R) * m /
|
|
15563
|
-
endPosition: Math.max(x, R) * m /
|
|
15562
|
+
startPosition: Math.min(x, R) * m / b,
|
|
15563
|
+
endPosition: Math.max(x, R) * m / b,
|
|
15564
15564
|
color: a.selectionColor
|
|
15565
15565
|
}
|
|
15566
15566
|
),
|
|
@@ -15642,41 +15642,40 @@ const Xf = (e) => {
|
|
|
15642
15642
|
playback: e = !1,
|
|
15643
15643
|
clipSplitting: t = !1,
|
|
15644
15644
|
annotations: n = !1,
|
|
15645
|
-
additionalShortcuts: r = []
|
|
15646
|
-
enabled: o = !0
|
|
15645
|
+
additionalShortcuts: r = []
|
|
15647
15646
|
}) => {
|
|
15648
|
-
const { tracks:
|
|
15649
|
-
annotations:
|
|
15650
|
-
linkEndpoints:
|
|
15651
|
-
activeAnnotationId:
|
|
15652
|
-
continuousPlay:
|
|
15653
|
-
} = gt(), { setAnnotations:
|
|
15654
|
-
tracks:
|
|
15655
|
-
sampleRate:
|
|
15656
|
-
samplesPerPixel:
|
|
15657
|
-
engineRef:
|
|
15658
|
-
}),
|
|
15659
|
-
return t &&
|
|
15647
|
+
const { tracks: o, samplesPerPixel: a, sampleRate: s, playoutRef: i, duration: l } = vt(), {
|
|
15648
|
+
annotations: c,
|
|
15649
|
+
linkEndpoints: u,
|
|
15650
|
+
activeAnnotationId: f,
|
|
15651
|
+
continuousPlay: p
|
|
15652
|
+
} = gt(), { setAnnotations: d, setActiveAnnotationId: h, scrollContainerRef: g, play: v } = De(), { splitClipAtPlayhead: m } = vy({
|
|
15653
|
+
tracks: o,
|
|
15654
|
+
sampleRate: s,
|
|
15655
|
+
samplesPerPixel: a,
|
|
15656
|
+
engineRef: i
|
|
15657
|
+
}), y = [];
|
|
15658
|
+
return t && y.push({
|
|
15660
15659
|
key: "s",
|
|
15661
|
-
action:
|
|
15660
|
+
action: m,
|
|
15662
15661
|
description: "Split clip at playhead",
|
|
15663
15662
|
preventDefault: !0
|
|
15664
|
-
}), r.length > 0 &&
|
|
15665
|
-
enabled:
|
|
15666
|
-
...e ? { additionalShortcuts:
|
|
15663
|
+
}), r.length > 0 && y.push(...r), yy({
|
|
15664
|
+
enabled: e || y.length > 0,
|
|
15665
|
+
...e ? { additionalShortcuts: y } : { shortcuts: y }
|
|
15667
15666
|
}), by({
|
|
15668
|
-
annotations:
|
|
15669
|
-
activeAnnotationId:
|
|
15670
|
-
onAnnotationsChange:
|
|
15671
|
-
onActiveAnnotationChange:
|
|
15672
|
-
duration:
|
|
15673
|
-
linkEndpoints:
|
|
15674
|
-
continuousPlay:
|
|
15675
|
-
scrollContainerRef:
|
|
15676
|
-
samplesPerPixel:
|
|
15677
|
-
sampleRate:
|
|
15678
|
-
onPlay:
|
|
15679
|
-
enabled:
|
|
15667
|
+
annotations: c,
|
|
15668
|
+
activeAnnotationId: f,
|
|
15669
|
+
onAnnotationsChange: d,
|
|
15670
|
+
onActiveAnnotationChange: h,
|
|
15671
|
+
duration: l,
|
|
15672
|
+
linkEndpoints: u,
|
|
15673
|
+
continuousPlay: p,
|
|
15674
|
+
scrollContainerRef: g,
|
|
15675
|
+
samplesPerPixel: a,
|
|
15676
|
+
sampleRate: s,
|
|
15677
|
+
onPlay: v,
|
|
15678
|
+
enabled: n && c.length > 0
|
|
15680
15679
|
}), null;
|
|
15681
15680
|
}, qo = class qo extends jn {
|
|
15682
15681
|
apply(t) {
|
|
@@ -15704,8 +15703,8 @@ const Jo = class Jo extends jn {
|
|
|
15704
15703
|
if (this.options.mode === "timescale") {
|
|
15705
15704
|
const { gridSamples: v } = this.options;
|
|
15706
15705
|
if (a !== void 0) {
|
|
15707
|
-
const
|
|
15708
|
-
return { x: (Math.round(
|
|
15706
|
+
const w = a + n.x * s;
|
|
15707
|
+
return { x: (Math.round(w / v) * v - a) / s, y: 0 };
|
|
15709
15708
|
}
|
|
15710
15709
|
const m = n.x * s;
|
|
15711
15710
|
return { x: Math.round(m / v) * v / s, y: 0 };
|
|
@@ -15737,15 +15736,15 @@ const Eb = () => {
|
|
|
15737
15736
|
}, [l]);
|
|
15738
15737
|
const d = Ce(() => {
|
|
15739
15738
|
if (f && u) {
|
|
15740
|
-
const { bpm:
|
|
15739
|
+
const { bpm: b, timeSignature: _, snapTo: S } = u, C = S === "bar" ? Fs(_) : ta(_);
|
|
15741
15740
|
return (E) => {
|
|
15742
|
-
const x = za(E,
|
|
15743
|
-
return Gn(M,
|
|
15741
|
+
const x = za(E, b, a), M = Za(x, C);
|
|
15742
|
+
return Gn(M, b, a);
|
|
15744
15743
|
};
|
|
15745
15744
|
}
|
|
15746
15745
|
if (p) {
|
|
15747
|
-
const
|
|
15748
|
-
return (_) => Math.round(_ /
|
|
15746
|
+
const b = Math.round(xs(o).smallStep / 1e3 * a);
|
|
15747
|
+
return (_) => Math.round(_ / b) * b;
|
|
15749
15748
|
}
|
|
15750
15749
|
}, [f, p, u, a, o]), h = gy({ touchOptimized: t }), {
|
|
15751
15750
|
onDragStart: g,
|
|
@@ -15760,14 +15759,14 @@ const Eb = () => {
|
|
|
15760
15759
|
isDraggingRef: i,
|
|
15761
15760
|
snapSamplePosition: d
|
|
15762
15761
|
}), y = at.useCallback(
|
|
15763
|
-
(
|
|
15764
|
-
const _ =
|
|
15765
|
-
_ !== void 0 && r[_] && c(r[_].id), g(
|
|
15762
|
+
(b) => {
|
|
15763
|
+
const _ = b.operation?.source?.data?.trackIndex;
|
|
15764
|
+
_ !== void 0 && r[_] && c(r[_].id), g(b);
|
|
15766
15765
|
},
|
|
15767
15766
|
[g, r, c]
|
|
15768
|
-
),
|
|
15769
|
-
const
|
|
15770
|
-
return f && u ?
|
|
15767
|
+
), w = Ce(() => {
|
|
15768
|
+
const b = [Uf];
|
|
15769
|
+
return f && u ? b.push(
|
|
15771
15770
|
Ko.configure({
|
|
15772
15771
|
mode: "beats",
|
|
15773
15772
|
snapTo: u.snapTo,
|
|
@@ -15776,13 +15775,13 @@ const Eb = () => {
|
|
|
15776
15775
|
samplesPerPixel: o,
|
|
15777
15776
|
sampleRate: a
|
|
15778
15777
|
})
|
|
15779
|
-
) : p &&
|
|
15778
|
+
) : p && b.push(
|
|
15780
15779
|
Ko.configure({
|
|
15781
15780
|
mode: "timescale",
|
|
15782
15781
|
gridSamples: Math.round(xs(o).smallStep / 1e3 * a),
|
|
15783
15782
|
samplesPerPixel: o
|
|
15784
15783
|
})
|
|
15785
|
-
),
|
|
15784
|
+
), b.push($s.configure({ tracks: r, samplesPerPixel: o })), b;
|
|
15786
15785
|
}, [f, p, u, r, o, a]);
|
|
15787
15786
|
return /* @__PURE__ */ k(Ly, { value: !0, children: /* @__PURE__ */ k(
|
|
15788
15787
|
Rf,
|
|
@@ -15791,7 +15790,7 @@ const Eb = () => {
|
|
|
15791
15790
|
onDragStart: y,
|
|
15792
15791
|
onDragMove: v,
|
|
15793
15792
|
onDragEnd: m,
|
|
15794
|
-
modifiers:
|
|
15793
|
+
modifiers: w,
|
|
15795
15794
|
plugins: Xf,
|
|
15796
15795
|
children: n
|
|
15797
15796
|
}
|