vue-audio-ui 0.1.0 → 0.1.1

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.
@@ -0,0 +1,1948 @@
1
+ import { ref as g, defineComponent as T, watch as N, computed as b, onMounted as Ct, onUnmounted as At, createElementBlock as x, openBlock as k, createStaticVNode as ct, createElementVNode as c, normalizeStyle as Z, resolveComponent as et, createVNode as X, renderSlot as xt, reactive as Bt, useTemplateRef as kt, normalizeClass as ut, toDisplayString as R, createCommentVNode as Dt, withDirectives as Ht, vModelText as Ft, nextTick as Yt, Fragment as lt, renderList as dt, onBeforeUnmount as _t } from "vue";
2
+ const V = {
3
+ colors: {
4
+ primary: "#70bfff",
5
+ secondary: "#6c757d",
6
+ success: "#28a745",
7
+ danger: "#dc3545",
8
+ warning: "#ffc107",
9
+ info: "#17a2b8",
10
+ light: "#e0e0e0",
11
+ dark: "#343a40",
12
+ muted: "#6c757d",
13
+ white: "#ffffff",
14
+ black: "#000000"
15
+ }
16
+ };
17
+ function pt(t, e) {
18
+ let a, i;
19
+ e && o(e);
20
+ function o(s) {
21
+ a = s.context.createAnalyser(), a.fftSize = t, i = new Float32Array(a.frequencyBinCount), s.connect(a);
22
+ }
23
+ function n(s) {
24
+ a && s && s.disconnect(a);
25
+ }
26
+ function r(s, f) {
27
+ s && o(s);
28
+ }
29
+ function d() {
30
+ return a?.getFloatTimeDomainData(i), i;
31
+ }
32
+ function y() {
33
+ return a?.getFloatFrequencyData(i), i;
34
+ }
35
+ function C(s) {
36
+ let f = 0, m;
37
+ for (let p = 0; p < s.length; p++)
38
+ m = Math.abs(s[p]), m > f && (f = m);
39
+ return 20 * Math.log10(f);
40
+ }
41
+ function h(s) {
42
+ let f = 0, m;
43
+ for (let p = 0; p < s.length; p++)
44
+ m = Math.abs(s[p]), f += m * m;
45
+ return 20 * Math.log10(Math.sqrt(f / s.length));
46
+ }
47
+ return {
48
+ getPeakDb: C,
49
+ getRmsDb: h,
50
+ getFloatTimeDomainData: d,
51
+ getFloatFrequencyData: y,
52
+ onInputChanged: r,
53
+ disposeMetering: n
54
+ };
55
+ }
56
+ function ft() {
57
+ const t = g(!1);
58
+ function e(o) {
59
+ try {
60
+ o();
61
+ } catch (n) {
62
+ t.value = !1, console.log(`error in render callback - ${n}`);
63
+ }
64
+ t.value && window.requestAnimationFrame(() => e(o));
65
+ }
66
+ function a(o) {
67
+ t.value = !0, e(o);
68
+ }
69
+ function i() {
70
+ t.value = !1;
71
+ }
72
+ return { startRendering: a, stopRendering: i };
73
+ }
74
+ const Kt = T({
75
+ name: "VAAnalogMeter",
76
+ props: {
77
+ input: {
78
+ required: !1,
79
+ type: AudioNode,
80
+ default: void 0
81
+ },
82
+ type: {
83
+ required: !1,
84
+ type: String,
85
+ default: "peak"
86
+ },
87
+ fftSize: {
88
+ required: !1,
89
+ type: Number,
90
+ default: 2048
91
+ },
92
+ width: {
93
+ required: !1,
94
+ type: Number,
95
+ default: 300
96
+ }
97
+ },
98
+ setup(t) {
99
+ const { getPeakDb: e, getRmsDb: a, getFloatTimeDomainData: i, onInputChanged: o } = pt(t.fftSize, t.input);
100
+ N(() => t.input, o);
101
+ const { startRendering: n, stopRendering: r } = ft(), d = g(-1), y = g("black"), C = b(() => isNaN(d.value) ? "rotate(0 160 150)" : `rotate(${50 * d.value} 160 150)`);
102
+ return Ct(() => {
103
+ n(() => {
104
+ const h = i();
105
+ let s = 0;
106
+ t.type === "peak" && h ? s = e(h) : t.type === "rms" && h && (s = a(h));
107
+ const f = 80;
108
+ s = s < -f ? -f : s;
109
+ const m = (f + s) / f;
110
+ d.value = m * 2 - 1;
111
+ });
112
+ }), At(() => {
113
+ r();
114
+ }), {
115
+ color: y,
116
+ rotation: C,
117
+ value: d
118
+ };
119
+ }
120
+ }), D = (t, e) => {
121
+ const a = t.__vccOpts || t;
122
+ for (const [i, o] of e)
123
+ a[i] = o;
124
+ return a;
125
+ }, Xt = { class: "meter-container" }, Zt = ["width"], jt = ["transform"];
126
+ function Jt(t, e, a, i, o, n) {
127
+ return k(), x("div", Xt, [
128
+ (k(), x("svg", {
129
+ width: `${t.width}px`,
130
+ viewBox: "0 0 320 220",
131
+ xmlns: "http://www.w3.org/2000/svg"
132
+ }, [
133
+ e[1] || (e[1] = ct('<defs data-v-048f897f><linearGradient id="frameGrad" x1="0" y1="0" x2="0" y2="1" data-v-048f897f><stop offset="0%" stop-color="#f0f0f0" data-v-048f897f></stop><stop offset="50%" stop-color="#b5b5b5" data-v-048f897f></stop><stop offset="100%" stop-color="#8a8a8a" data-v-048f897f></stop></linearGradient><linearGradient id="faceGrad" x1="0" y1="0" x2="0" y2="1" data-v-048f897f><stop offset="0%" stop-color="#fffdf7" data-v-048f897f></stop><stop offset="100%" stop-color="#e9e2d3" data-v-048f897f></stop></linearGradient><radialGradient id="glassGrad" cx="50%" cy="0%" r="80%" data-v-048f897f><stop offset="0%" stop-color="white" stop-opacity="0.7" data-v-048f897f></stop><stop offset="60%" stop-color="white" stop-opacity="0.15" data-v-048f897f></stop><stop offset="100%" stop-color="white" stop-opacity="0" data-v-048f897f></stop></radialGradient><filter id="shadow" x="-20%" y="-20%" width="140%" height="140%" data-v-048f897f><feDropShadow dx="0" dy="3" stdDeviation="4" flood-opacity="0.4" data-v-048f897f></feDropShadow></filter><filter id="needleShadow" data-v-048f897f><feDropShadow dx="1" dy="1" stdDeviation="1" flood-opacity="0.5" data-v-048f897f></feDropShadow></filter></defs><rect x="10" y="10" rx="18" ry="18" width="300" height="200" fill="url(#frameGrad)" filter="url(#shadow)" data-v-048f897f></rect><rect x="24" y="24" rx="12" ry="12" width="272" height="172" fill="url(#faceGrad)" stroke="#777" stroke-width="1" data-v-048f897f></rect><path d="M 60 90 A 130 70 0 0 1 260 90" fill="none" stroke="#222" stroke-width="2" data-v-048f897f></path><g stroke="#222" stroke-width="2" data-v-048f897f><line x1="100" y1="120" x2="105" y2="130" data-v-048f897f></line><line x1="160" y1="110" x2="160" y2="122" data-v-048f897f></line><line x1="220" y1="120" x2="215" y2="130" data-v-048f897f></line></g>', 5)),
134
+ c("g", {
135
+ id: "needle",
136
+ transform: t.rotation
137
+ }, [...e[0] || (e[0] = [
138
+ c("polygon", {
139
+ points: "160,70 158,150 162,150",
140
+ fill: "#c62828"
141
+ }, null, -1),
142
+ c("circle", {
143
+ cx: "160",
144
+ cy: "150",
145
+ r: "6",
146
+ fill: "#333"
147
+ }, null, -1),
148
+ c("circle", {
149
+ cx: "160",
150
+ cy: "150",
151
+ r: "3",
152
+ fill: "#777"
153
+ }, null, -1)
154
+ ])], 8, jt),
155
+ e[2] || (e[2] = c("rect", {
156
+ x: "24",
157
+ y: "24",
158
+ rx: "12",
159
+ ry: "12",
160
+ width: "272",
161
+ height: "172",
162
+ fill: "url(#glassGrad)"
163
+ }, null, -1)),
164
+ e[3] || (e[3] = c("text", {
165
+ x: "160",
166
+ y: "185",
167
+ "text-anchor": "middle",
168
+ "font-size": "16",
169
+ "font-weight": "bold",
170
+ "font-family": "Arial, Helvetica, sans-serif",
171
+ fill: "#333"
172
+ }, null, -1))
173
+ ], 8, Zt))
174
+ ]);
175
+ }
176
+ const Qt = /* @__PURE__ */ D(Kt, [["render", Jt], ["__scopeId", "data-v-048f897f"]]);
177
+ function H(t, e, a) {
178
+ return t < e ? e : t > a ? a : t;
179
+ }
180
+ function te(t, e) {
181
+ const a = Math.abs(t), i = Math.abs(e);
182
+ return a > i ? t : i > a ? e : Math.max(t, e);
183
+ }
184
+ function ee(t) {
185
+ return (t & t - 1) === 0;
186
+ }
187
+ function $t(t, e) {
188
+ return +`${Math.round(+`${t}e${e}`)}e${-e}`;
189
+ }
190
+ class Pt {
191
+ min;
192
+ max;
193
+ constructor(e, a) {
194
+ this.min = e, this.max = a;
195
+ }
196
+ getCurvedValue(e) {
197
+ throw "getCurvedValue must be overriden in child class";
198
+ }
199
+ getLinearValue(e) {
200
+ throw "getLinearValue must be overriden in child class";
201
+ }
202
+ validateInput(e) {
203
+ if (e < this.min)
204
+ throw `given value ${e} is less than min value ${this.min}`;
205
+ if (e > this.max)
206
+ throw `given value ${e} is greater than max value ${this.max}`;
207
+ }
208
+ }
209
+ function wt(t) {
210
+ return Math.pow(Math.E, t);
211
+ }
212
+ function ae(t, e, a, i, o, n) {
213
+ return (wt(((t - e) / (a - e) - 1) * n) - 1) / (wt(-n) - 1) * (i - o) + o;
214
+ }
215
+ function ie(t, e, a, i, o, n) {
216
+ return (Math.log((t - o) * (wt(-n) - 1) / (i - o) + 1) / n + 1) * (a - e) + e;
217
+ }
218
+ class Tt extends Pt {
219
+ curveAmount;
220
+ constructor(e, a, i) {
221
+ super(e, a), this.curveAmount = i;
222
+ }
223
+ getCurvedValue(e) {
224
+ return this.validateInput(e), ae(e, this.min, this.max, this.min, this.max, this.curveAmount);
225
+ }
226
+ getLinearValue(e) {
227
+ return this.validateInput(e), ie(e, this.min, this.max, this.min, this.max, this.curveAmount);
228
+ }
229
+ }
230
+ class ht extends Pt {
231
+ constructor(e, a) {
232
+ super(e, a);
233
+ }
234
+ getCurvedValue(e) {
235
+ return this.validateInput(e), e;
236
+ }
237
+ getLinearValue(e) {
238
+ return this.validateInput(e), e;
239
+ }
240
+ }
241
+ const re = 3, oe = 300, ne = 16, se = T({
242
+ name: "VAAudioFileVisualizer",
243
+ data() {
244
+ return {
245
+ canvas: null,
246
+ canvasContext: null,
247
+ // x coordinate of the marker position on the canvas (in px)
248
+ markerPosition: 0,
249
+ // sample index of where the marker is placed
250
+ markerIndex: 0,
251
+ // x coordinate of where selection ends (can be before marker index)
252
+ selectionPosition: void 0,
253
+ // sample index of where selection ends (can be before marker index)
254
+ selectionIndex: void 0,
255
+ // starting sample index of the zoom window
256
+ zoomWindowStartIndex: 0,
257
+ // ending sample index of the zoom window
258
+ zoomWindowEndIndex: 0,
259
+ // value between 0 and 1 representing how far zoomed the graph is
260
+ zoom: 1,
261
+ prevY: -1,
262
+ prevX: -1,
263
+ // todo: adjust curve based on sample length?
264
+ curedRange: new Tt(0, 1, 8)
265
+ };
266
+ },
267
+ props: {
268
+ amplitudeData: {
269
+ required: !1,
270
+ type: Float32Array
271
+ },
272
+ lineColor: {
273
+ required: !1,
274
+ type: String
275
+ },
276
+ backgroundColor: {
277
+ required: !1,
278
+ type: String
279
+ },
280
+ width: {
281
+ required: !1,
282
+ type: Number,
283
+ default: 500
284
+ },
285
+ height: {
286
+ required: !1,
287
+ type: Number
288
+ }
289
+ },
290
+ computed: {
291
+ cssVars() {
292
+ return {
293
+ "--line-color": `${this.canvasLineColor}`,
294
+ "--background-color": `${this.canvasBackgroundColor}`
295
+ };
296
+ },
297
+ graphWidth() {
298
+ return this.width;
299
+ },
300
+ graphHeight() {
301
+ return this.height ?? this.width / re;
302
+ },
303
+ zoomMult() {
304
+ if (!this.amplitudeData) return 1;
305
+ const t = this.curedRange.getCurvedValue(this.zoom);
306
+ return Math.max(t, ne / this.amplitudeData.length);
307
+ },
308
+ // number of samples between start and end of zoom window
309
+ zoomWindowLength() {
310
+ return this.zoomWindowEndIndex - this.zoomWindowStartIndex;
311
+ },
312
+ canvasLineColor() {
313
+ return this.lineColor ?? V.colors.white;
314
+ },
315
+ canvasBackgroundColor() {
316
+ return this.backgroundColor ?? V.colors.black;
317
+ },
318
+ canvasMarkerColor() {
319
+ return V.colors.primary;
320
+ },
321
+ canvasSelectColor() {
322
+ return V.colors.primary;
323
+ }
324
+ },
325
+ mounted() {
326
+ this.canvas = this.$refs.visualizer, this.canvasContext = this.canvas.getContext("2d");
327
+ },
328
+ methods: {
329
+ pixelsToSamples(t) {
330
+ return this.zoomWindowLength / this.graphWidth * t;
331
+ },
332
+ shiftZoomWindow(t) {
333
+ this.zoomWindowStartIndex += t, this.zoomWindowEndIndex += t;
334
+ },
335
+ setZoomWindow() {
336
+ if (!this.amplitudeData) {
337
+ this.zoomWindowStartIndex = 0, this.zoomWindowEndIndex = 0, this.zoom = 1;
338
+ return;
339
+ }
340
+ this.zoomWindowStartIndex = this.markerIndex - Math.round(this.amplitudeData.length * this.zoomMult / 2), this.zoomWindowEndIndex = this.markerIndex + Math.round(this.amplitudeData.length * this.zoomMult / 2);
341
+ const e = (this.graphWidth / 2 - this.markerPosition) / this.graphWidth, a = Math.round(
342
+ e * this.zoomWindowLength
343
+ );
344
+ this.shiftZoomWindow(a);
345
+ let i = 0;
346
+ i += this.zoomWindowStartIndex < 0 ? -this.zoomWindowStartIndex : 0, i += this.zoomWindowEndIndex > this.amplitudeData.length ? this.amplitudeData.length - this.zoomWindowEndIndex : 0, this.shiftZoomWindow(i);
347
+ },
348
+ drawZoom() {
349
+ this.setZoomWindow(), this.drawAmplitude();
350
+ },
351
+ getMaxSampleValue(t, e, a) {
352
+ let i = Number.NEGATIVE_INFINITY;
353
+ for (let o = e; o < a; o++)
354
+ i = Math.max(i, t[o]);
355
+ return i;
356
+ },
357
+ getMinSampleValue(t, e, a) {
358
+ let i = Number.POSITIVE_INFINITY;
359
+ for (let o = e; o < a; o++)
360
+ i = Math.min(i, t[o]);
361
+ return i;
362
+ },
363
+ getAvgSampleValue(t, e, a) {
364
+ let i = 0;
365
+ for (let o = e; o < a; o++)
366
+ i += Math.abs(t[o]);
367
+ return i / (a - e);
368
+ },
369
+ drawMarker() {
370
+ this.canvasContext.fillStyle = this.canvasMarkerColor, this.canvasContext?.fillRect(this.markerPosition, 0, 2, this.graphHeight);
371
+ },
372
+ drawSelection() {
373
+ this.selectionPosition !== void 0 && (this.canvasContext.globalAlpha = 0.5, this.canvasContext.fillStyle = this.canvasSelectColor, this.canvasContext.fillRect(
374
+ this.markerPosition,
375
+ 0,
376
+ this.selectionPosition - this.markerPosition,
377
+ this.graphHeight
378
+ ), this.canvasContext.globalAlpha = 1);
379
+ },
380
+ drawPoint(t, e) {
381
+ this.canvasContext.fillStyle = this.canvasLineColor, this.canvasContext?.beginPath(), this.canvasContext?.arc(t + 0.5, e + 0.5, 2, 0, Math.PI * 2), this.canvasContext?.fill();
382
+ },
383
+ drawBackground() {
384
+ this.canvasContext?.clearRect(0, 0, this.graphWidth, this.graphHeight), this.canvasContext.fillStyle = this.canvasBackgroundColor, this.canvasContext?.fillRect(0, 0, this.graphWidth, this.graphHeight);
385
+ },
386
+ drawAmplitudeMinMax() {
387
+ if (!this.amplitudeData) return;
388
+ const t = this.zoomWindowLength / this.graphWidth, e = Math.max(Math.round(t), 1);
389
+ this.drawBackground();
390
+ let a = 0, i = 0, o = 0, n = 0, r = 0;
391
+ for (let d = 0; d < this.graphWidth; d++)
392
+ a = d, n = this.getMinSampleValue(
393
+ this.amplitudeData,
394
+ this.zoomWindowStartIndex + d * e,
395
+ this.zoomWindowStartIndex + (d + 1) * e
396
+ ), r = this.getMaxSampleValue(
397
+ this.amplitudeData,
398
+ this.zoomWindowStartIndex + d * e,
399
+ this.zoomWindowStartIndex + (d + 1) * e
400
+ ), i = this.graphHeight - (this.graphHeight / 2 + n * this.graphHeight / 2), o = this.graphHeight - (this.graphHeight / 2 + r * this.graphHeight / 2), this.canvasContext.fillStyle = this.canvasLineColor, this.canvasContext?.fillRect(a, i, 1, te(o - i, 1));
401
+ this.drawSelection(), this.drawMarker();
402
+ },
403
+ drawAmplitudeSampleLine(t = !1) {
404
+ if (!this.amplitudeData) return;
405
+ const e = this.zoomWindowLength / this.graphWidth, a = Math.max(Math.round(e), 1), i = this.graphWidth / this.zoomWindowLength;
406
+ this.drawBackground();
407
+ const o = new Path2D();
408
+ let n = 0, r = 0, d = 0;
409
+ for (let y = this.zoomWindowStartIndex; y < this.zoomWindowEndIndex; y += a)
410
+ d = this.amplitudeData[y], n = (y - this.zoomWindowStartIndex) * i, r = this.graphHeight - (this.graphHeight / 2 + d * this.graphHeight / 2), y === 0 ? o.moveTo(n, r) : o.lineTo(n, r), t && this.drawPoint(n, r);
411
+ o.lineTo(this.graphWidth, r), this.canvasContext.strokeStyle = this.canvasLineColor, this.canvasContext?.stroke(o), this.drawSelection(), this.drawMarker();
412
+ },
413
+ drawAmplitudeAvg() {
414
+ if (!this.amplitudeData) return;
415
+ const t = this.zoomWindowLength / this.graphWidth, e = Math.max(Math.round(t), 1);
416
+ this.drawBackground();
417
+ const a = new Path2D();
418
+ a.moveTo(0, 0);
419
+ let i = 0, o = 0, n = 0;
420
+ for (let r = 0; r < this.graphWidth; r++)
421
+ i = r, n = this.getAvgSampleValue(
422
+ this.amplitudeData,
423
+ this.zoomWindowStartIndex + r * e,
424
+ this.zoomWindowStartIndex + (r + 1) * e
425
+ ), o = this.graphHeight - (this.graphHeight / 2 + n * this.graphHeight / 2), a.moveTo(i, o), o = this.graphHeight - (this.graphHeight / 2 + -n * this.graphHeight / 2), a.lineTo(i, o);
426
+ a.lineTo(this.graphWidth, this.graphHeight / 2), this.canvasContext.strokeStyle = this.canvasLineColor, this.canvasContext?.stroke(a), this.drawSelection(), this.drawMarker();
427
+ },
428
+ drawAmplitude() {
429
+ this.zoomWindowLength / this.graphWidth < 0.25 ? this.drawAmplitudeSampleLine(!0) : this.zoomWindowLength / this.graphWidth <= 2 ? this.drawAmplitudeSampleLine(!1) : this.drawAmplitudeMinMax();
430
+ },
431
+ onCanvasDoubleClick() {
432
+ this.amplitudeData && (this.zoom = 1, this.zoomWindowStartIndex = 0, this.zoomWindowEndIndex = this.amplitudeData.length, this.markerIndex = Math.round(this.pixelsToSamples(this.markerPosition)) + this.zoomWindowStartIndex, this.selectionPosition = void 0, this.selectionIndex = void 0, window.requestAnimationFrame(this.drawAmplitude));
433
+ },
434
+ onCanvasMouseDown(t) {
435
+ this.prevX = t.pageX, this.prevY = t.pageY;
436
+ const e = this.canvas?.getBoundingClientRect()?.x, a = t.clientX - e;
437
+ this.markerIndex = Math.round(this.pixelsToSamples(a)) + this.zoomWindowStartIndex, this.markerPosition = a, this.selectionPosition = void 0, this.selectionIndex = void 0, window.requestAnimationFrame(this.drawAmplitude), document.getElementsByTagName("body")[0].classList.add("--no-text-select"), t.metaKey || t.ctrlKey ? (window.addEventListener("mousemove", this.onCtrlClickDrag), window.addEventListener("mouseup", this.endCtrlClickDrag)) : (window.addEventListener("mousemove", this.onClickDrag), window.addEventListener("mouseup", this.endClickDrag));
438
+ },
439
+ onClickDrag(t) {
440
+ const e = t.pageY, a = t.pageX, i = a - this.prevX;
441
+ e - this.prevY, this.selectionPosition = this.selectionPosition === void 0 ? this.markerPosition + i : this.selectionPosition + i, window.requestAnimationFrame(this.drawAmplitude), this.prevY = e, this.prevX = a;
442
+ },
443
+ endClickDrag() {
444
+ window.removeEventListener("mousemove", this.onClickDrag), this.prevY = -1, this.prevX = -1, this.selectionPosition && this.$emit("audioSelection", {
445
+ startIndex: this.markerIndex,
446
+ endIndex: Math.round(this.pixelsToSamples(this.selectionPosition)) + this.zoomWindowStartIndex
447
+ }), document.getElementsByTagName("body")[0].classList.remove("--no-text-select");
448
+ },
449
+ onCtrlClickDrag(t) {
450
+ if (!this.amplitudeData) return;
451
+ const e = t.pageY, a = t.pageX, i = a - this.prevX, o = e - this.prevY;
452
+ if (Math.abs(i) >= Math.abs(o)) {
453
+ if (this.prevX >= 0) {
454
+ let n = -Math.round(i / this.graphWidth * this.zoomWindowLength);
455
+ const r = -this.zoomWindowStartIndex, d = this.amplitudeData.length - this.zoomWindowEndIndex;
456
+ n = H(n, r, d), this.shiftZoomWindow(n), this.markerIndex += n;
457
+ }
458
+ } else
459
+ this.prevY >= 0 && (this.zoom = H(this.zoom - o / oe * 1, 0, 1), this.setZoomWindow());
460
+ this.markerPosition = Math.round(
461
+ (this.markerIndex - this.zoomWindowStartIndex) / this.zoomWindowLength * this.graphWidth
462
+ ), window.requestAnimationFrame(this.drawAmplitude), this.prevY = e, this.prevX = a;
463
+ },
464
+ endCtrlClickDrag() {
465
+ window.removeEventListener("mousemove", this.onCtrlClickDrag), this.prevY = -1, this.prevX = -1, document.getElementsByTagName("body")[0].classList.remove("--no-text-select");
466
+ }
467
+ },
468
+ watch: {
469
+ amplitudeData(t, e) {
470
+ window.requestAnimationFrame(this.drawZoom);
471
+ }
472
+ }
473
+ }), le = ["width", "height"];
474
+ function de(t, e, a, i, o, n) {
475
+ return k(), x("canvas", {
476
+ ref: "visualizer",
477
+ class: "visualizer-canvas",
478
+ style: Z(t.cssVars),
479
+ width: t.graphWidth,
480
+ height: t.graphHeight,
481
+ onMousedown: e[0] || (e[0] = (...r) => t.onCanvasMouseDown && t.onCanvasMouseDown(...r)),
482
+ onDblclick: e[1] || (e[1] = (...r) => t.onCanvasDoubleClick && t.onCanvasDoubleClick(...r))
483
+ }, null, 44, le);
484
+ }
485
+ const he = /* @__PURE__ */ D(se, [["render", de], ["__scopeId", "data-v-f20165f6"]]), ce = T({
486
+ name: "VADigitalMeterStereo",
487
+ props: {
488
+ leftInput: {
489
+ required: !1,
490
+ type: AudioNode
491
+ },
492
+ rightInput: {
493
+ required: !1,
494
+ type: AudioNode
495
+ },
496
+ type: {
497
+ required: !1,
498
+ type: String,
499
+ default: "peak"
500
+ },
501
+ fftSize: {
502
+ required: !1,
503
+ type: Number,
504
+ default: 2048
505
+ },
506
+ clippingColor: {
507
+ required: !1,
508
+ type: String,
509
+ default: "#e64a19"
510
+ },
511
+ barColor: {
512
+ required: !1,
513
+ type: String
514
+ },
515
+ backgroundColor: {
516
+ required: !1,
517
+ type: String
518
+ },
519
+ markerColor: {
520
+ required: !1,
521
+ type: String,
522
+ default: "gray"
523
+ },
524
+ drawMarkers: {
525
+ required: !1,
526
+ type: Boolean,
527
+ default: !1
528
+ },
529
+ height: {
530
+ required: !1,
531
+ type: Number,
532
+ default: 200
533
+ },
534
+ width: {
535
+ required: !1,
536
+ type: Number,
537
+ default: 20
538
+ },
539
+ font: {
540
+ required: !1,
541
+ type: String,
542
+ default: "Helvetica, sans-serif"
543
+ }
544
+ }
545
+ }), ue = { class: "stereo-meter-container" };
546
+ function pe(t, e, a, i, o, n) {
547
+ const r = et("v-a-digital-meter");
548
+ return k(), x("div", null, [
549
+ c("div", ue, [
550
+ X(r, {
551
+ class: "meter-channel",
552
+ input: t.leftInput,
553
+ fftSize: t.fftSize,
554
+ type: t.type,
555
+ height: t.height,
556
+ width: t.width,
557
+ barColor: t.barColor,
558
+ backgroundColor: t.backgroundColor,
559
+ markerColor: t.markerColor,
560
+ font: t.font,
561
+ clippingColor: t.clippingColor,
562
+ drawMarkers: !1
563
+ }, null, 8, ["input", "fftSize", "type", "height", "width", "barColor", "backgroundColor", "markerColor", "font", "clippingColor"]),
564
+ X(r, {
565
+ class: "meter-channel",
566
+ input: t.rightInput,
567
+ fftSize: t.fftSize,
568
+ type: t.type,
569
+ height: t.height,
570
+ width: t.width,
571
+ barColor: t.barColor,
572
+ backgroundColor: t.backgroundColor,
573
+ markerColor: t.markerColor,
574
+ font: t.font,
575
+ clippingColor: t.clippingColor,
576
+ drawMarkers: t.drawMarkers
577
+ }, null, 8, ["input", "fftSize", "type", "height", "width", "barColor", "backgroundColor", "markerColor", "font", "clippingColor", "drawMarkers"])
578
+ ])
579
+ ]);
580
+ }
581
+ const fe = /* @__PURE__ */ D(ce, [["render", pe], ["__scopeId", "data-v-688c5c09"]]), E = 90, me = new Tt(0, E, 2), ge = T({
582
+ name: "VADigitalMeter",
583
+ props: {
584
+ input: {
585
+ required: !1,
586
+ type: AudioNode,
587
+ default: void 0
588
+ },
589
+ type: {
590
+ required: !1,
591
+ type: String,
592
+ default: "peak"
593
+ },
594
+ fftSize: {
595
+ required: !1,
596
+ type: Number,
597
+ default: 2048
598
+ },
599
+ clippingColor: {
600
+ required: !1,
601
+ type: String
602
+ },
603
+ barColor: {
604
+ required: !1,
605
+ type: String
606
+ },
607
+ backgroundColor: {
608
+ required: !1,
609
+ type: String
610
+ },
611
+ markerColor: {
612
+ required: !1,
613
+ type: String
614
+ },
615
+ drawMarkers: {
616
+ required: !1,
617
+ type: Boolean,
618
+ default: !1
619
+ },
620
+ height: {
621
+ required: !1,
622
+ type: Number,
623
+ default: 200
624
+ },
625
+ width: {
626
+ required: !1,
627
+ type: Number,
628
+ default: 20
629
+ },
630
+ font: {
631
+ required: !1,
632
+ type: String,
633
+ default: "Helvetica, sans-serif"
634
+ }
635
+ },
636
+ computed: {
637
+ canvasWidth() {
638
+ return this.width + (this.drawMarkers ? 30 : 0);
639
+ }
640
+ },
641
+ setup(t) {
642
+ const e = pt(t.fftSize, t.input);
643
+ return N(() => t.input, e.onInputChanged), {
644
+ ...e,
645
+ ...ft()
646
+ };
647
+ },
648
+ data() {
649
+ return {
650
+ canvasCxt: null
651
+ };
652
+ },
653
+ mounted() {
654
+ const t = this.$refs.meterCanvas;
655
+ this.canvasCxt = t.getContext("2d"), this.startRendering(this.draw);
656
+ },
657
+ methods: {
658
+ getMeterHeight(t) {
659
+ return this.height * ((E + t) / E) * (E / (E + 10));
660
+ },
661
+ scaleY(t) {
662
+ return me.getCurvedValue(t + E) - E;
663
+ },
664
+ draw() {
665
+ if (this.canvasCxt) {
666
+ const t = this.getFloatTimeDomainData();
667
+ let e = -E;
668
+ this.type === "peak" && t ? e = this.getPeakDb(t) : this.type === "rms" && t && (e = this.getRmsDb(t));
669
+ const a = e > 0;
670
+ e = H(e, -E, 0);
671
+ const i = this.getMeterHeight(this.scaleY(e));
672
+ this.canvasCxt.clearRect(0, 0, this.canvasWidth, this.height), this.canvasCxt.fillStyle = this.backgroundColor ?? V.colors.light, this.canvasCxt.beginPath(), this.canvasCxt.fillRect(0, 0, this.width, this.height), this.canvasCxt.stroke(), this.canvasCxt.fillStyle = a ? this.clippingColor ?? V.colors.danger : this.barColor ?? V.colors.success, this.canvasCxt.beginPath(), this.canvasCxt.fillRect(
673
+ 0,
674
+ this.height - i,
675
+ this.width,
676
+ i
677
+ ), this.canvasCxt.stroke(), this.drawMarkers && this.drawDbMarkers();
678
+ }
679
+ },
680
+ drawDbMarkers() {
681
+ this.drawDbMarker(0), this.drawDbMarker(-10), this.drawDbMarker(-20), this.drawDbMarker(-30), this.drawDbMarker(-40), this.drawDbMarker(-60);
682
+ },
683
+ drawDbMarker(t) {
684
+ const e = this.height - this.getMeterHeight(this.scaleY(t)), a = this.width + 4;
685
+ this.canvasCxt.lineWidth = 1, this.canvasCxt.strokeStyle = this.markerColor ?? V.colors.muted, this.canvasCxt?.beginPath(), this.canvasCxt?.moveTo(a, e), this.canvasCxt?.lineTo(a + 4, e), this.canvasCxt?.stroke(), this.canvasCxt.font = `10px ${this.font}`, this.canvasCxt.fillStyle = this.markerColor ?? V.colors.muted, this.canvasCxt.fillText(`${Math.abs(t)}`, a + 8, e + 3);
686
+ }
687
+ }
688
+ }), ye = ["height", "width"];
689
+ function ve(t, e, a, i, o, n) {
690
+ return k(), x("canvas", {
691
+ class: "meter",
692
+ ref: "meterCanvas",
693
+ height: t.height,
694
+ width: t.canvasWidth
695
+ }, null, 8, ye);
696
+ }
697
+ const xe = /* @__PURE__ */ D(ge, [["render", ve]]), ke = {}, we = {
698
+ version: "1.1",
699
+ viewBox: "0 0 62.143 129.29",
700
+ xmlns: "http://www.w3.org/2000/svg",
701
+ width: "27"
702
+ };
703
+ function Ce(t, e) {
704
+ return k(), x("svg", we, [...e[0] || (e[0] = [
705
+ ct('<defs><filter id="filter4165" x="-.18715" y="-.046414" width="1.3743" height="1.0928" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="2.4419414"></feGaussianBlur></filter><filter id="filter4165-1" x="-.18715" y="-.046414" width="1.3743" height="1.0928" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="2.4419414"></feGaussianBlur></filter><filter id="filter4165-4" x="-.18715" y="-.046414" width="1.3743" height="1.0928" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="2.4419414"></feGaussianBlur></filter><linearGradient id="linearGradient7341" x1="678.43" x2="668.76" y1="597.36" y2="597.36" gradientTransform="translate(406.7,-14.18)" gradientUnits="userSpaceOnUse"><stop stop-color="#9a9a9a" offset="0"></stop><stop offset="1"></stop></linearGradient><linearGradient id="linearGradient7468" x1="678.43" x2="668.76" y1="597.36" y2="597.36" gradientTransform="translate(203.35,-14.18)" gradientUnits="userSpaceOnUse"><stop stop-color="#9a9a9a" offset="0"></stop><stop offset="1"></stop></linearGradient><linearGradient id="linearGradient7595" x1="678.43" x2="668.76" y1="597.36" y2="597.36" gradientTransform="translate(0,-14.18)" gradientUnits="userSpaceOnUse"><stop stop-color="#9a9a9a" offset="0"></stop><stop offset="1"></stop></linearGradient><linearGradient id="linearGradient7698" x1="87.866" x2="87.866" y1="516.83" y2="528.75" gradientTransform="matrix(1.0278,0,0,1,582.85,121.43)" gradientUnits="userSpaceOnUse"><stop stop-color="#999" offset="0"></stop><stop stop-color="#999" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7700" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0235,0,0,1,37.712,-1157.9)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7702" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1 0 0 .50643 51.792 414.75)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7704" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1 0 0 .42746 51.792 466.71)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7706" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1 0 0 .26952 51.792 554.43)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7708" x1="87.866" x2="87.866" y1="516.83" y2="521.42" gradientTransform="matrix(1.0364 0 0 .96441 581.97 -1263.8)" gradientUnits="userSpaceOnUse"><stop stop-color="#999" offset="0"></stop><stop stop-color="#333" offset="1"></stop></linearGradient><linearGradient id="linearGradient7710" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0364 0 0 .96441 29.714 -1226.1)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7712" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0274 0 0 .48841 35.581 -982.83)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7714" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0213 0 0 .41225 39.183 -932.97)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7716" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0122 0 0 .25993 44.587 -848)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient></defs><g transform="translate(-642.36 -637.36)"><rect x="642.36" y="637.36" width="62.143" height="129.29" rx="3" ry="3" fill="#4d4d4d"></rect><rect x="643.3" y="701.75" width="60.419" height="3.5355" fill="#e6e6e6"></rect><rect x="643.05" y="638.08" width="60.613" height="21.071" rx="2.1483" ry="2" fill="url(#linearGradient7698)"></rect><rect x="643.25" y="689.59" width="58.811" height="10.119" fill="#333"></rect><rect x="642.36" y="680.23" width="61.133" height="8.7929" fill="#333"></rect><rect x="642.36" y="661.81" width="61.133" height="4.5457" fill="#1a1a1a"></rect><rect x="642.36" y="667.58" width="61.133" height="11.364" fill="#1a1a1a"></rect><rect transform="scale(1,-1)" x="643.05" y="-661.09" width="60.012" height="2.2612" rx="1.0235" ry=".63958" fill="url(#linearGradient7700)"></rect><rect x="643.22" y="666.37" width="58.633" height="1.1452" rx="1" ry=".3239" fill="url(#linearGradient7702)"></rect><rect x="643.22" y="679.09" width="58.633" height=".9666" rx="1" ry=".2734" fill="url(#linearGradient7704)"></rect><rect x="643.22" y="688.34" width="58.633" height=".60946" rx="1" ry=".17238" fill="url(#linearGradient7706)"></rect><rect transform="scale(1,-1)" x="642.67" y="-765.57" width="61.118" height="20.321" rx="2.1662" ry="1.9288" fill="url(#linearGradient7708)"></rect><rect transform="scale(1,-1)" x="643.25" y="-717.26" width="58.811" height="9.7593" fill="#333"></rect><rect transform="scale(1,-1)" x="642.36" y="-726.3" width="61.133" height="8.4799" fill="#666"></rect><rect transform="scale(1,-1)" x="642.36" y="-744.06" width="61.133" height="4.3839" fill="#808080"></rect><rect transform="scale(1,-1)" x="642.36" y="-738.49" width="61.133" height="10.96" fill="#808080"></rect><rect transform="scale(1,-1)" x="642.67" y="-746.93" width="60.767" height="2.1808" rx="1.0364" ry=".61681" fill="url(#linearGradient7710)"></rect><rect transform="scale(1,-1)" x="643.22" y="-740.17" width="60.24" height="1.1044" rx="1.0274" ry=".31237" fill="url(#linearGradient7712)"></rect><rect transform="scale(1,-1)" x="643.22" y="-728.15" width="59.883" height=".9322" rx="1.0213" ry=".26366" fill="url(#linearGradient7714)"></rect><rect transform="scale(1,-1)" x="643.22" y="-718.85" width="59.347" height=".58776" rx="1.0122" ry=".16624" fill="url(#linearGradient7716)"></rect></g>', 2)
706
+ ])]);
707
+ }
708
+ const be = /* @__PURE__ */ D(ke, [["render", Ce]]), Me = {}, Se = {
709
+ version: "1.1",
710
+ viewBox: "0 0 104 460",
711
+ xmlns: "http://www.w3.org/2000/svg"
712
+ };
713
+ function Ge(t, e) {
714
+ return k(), x("svg", Se, [...e[0] || (e[0] = [
715
+ ct('<defs><filter id="filter4165" x="-.18715" y="-.046414" width="1.3743" height="1.0928" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="2.4419414"></feGaussianBlur></filter><filter id="filter4165-1" x="-.18715" y="-.046414" width="1.3743" height="1.0928" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="2.4419414"></feGaussianBlur></filter><filter id="filter4165-4" x="-.18715" y="-.046414" width="1.3743" height="1.0928" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="2.4419414"></feGaussianBlur></filter><linearGradient id="linearGradient7341" x1="678.43" x2="668.76" y1="597.36" y2="597.36" gradientTransform="translate(406.7,-14.18)" gradientUnits="userSpaceOnUse"><stop stop-color="#9a9a9a" offset="0"></stop><stop offset="1"></stop></linearGradient><linearGradient id="linearGradient7468" x1="678.43" x2="668.76" y1="597.36" y2="597.36" gradientTransform="translate(203.35,-14.18)" gradientUnits="userSpaceOnUse"><stop stop-color="#9a9a9a" offset="0"></stop><stop offset="1"></stop></linearGradient><linearGradient id="linearGradient7595" x1="678.43" x2="668.76" y1="597.36" y2="597.36" gradientTransform="translate(0,-14.18)" gradientUnits="userSpaceOnUse"><stop stop-color="#9a9a9a" offset="0"></stop><stop offset="1"></stop></linearGradient><linearGradient id="linearGradient7698" x1="87.866" x2="87.866" y1="516.83" y2="528.75" gradientTransform="matrix(1.0278,0,0,1,582.85,121.43)" gradientUnits="userSpaceOnUse"><stop stop-color="#999" offset="0"></stop><stop stop-color="#999" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7700" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0235,0,0,1,37.712,-1157.9)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7702" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1 0 0 .50643 51.792 414.75)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7704" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1 0 0 .42746 51.792 466.71)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7706" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1 0 0 .26952 51.792 554.43)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7708" x1="87.866" x2="87.866" y1="516.83" y2="521.42" gradientTransform="matrix(1.0364 0 0 .96441 581.97 -1263.8)" gradientUnits="userSpaceOnUse"><stop stop-color="#999" offset="0"></stop><stop stop-color="#333" offset="1"></stop></linearGradient><linearGradient id="linearGradient7710" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0364 0 0 .96441 29.714 -1226.1)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7712" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0274 0 0 .48841 35.581 -982.83)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7714" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0213 0 0 .41225 39.183 -932.97)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7716" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0122 0 0 .25993 44.587 -848)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7718" x1="87.866" x2="87.866" y1="516.83" y2="528.75" gradientTransform="matrix(1.0278,0,0,1,787.52,-27.904)" gradientUnits="userSpaceOnUse"><stop stop-color="#999" offset="0"></stop><stop stop-color="#999" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7720" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0235,0,0,1,242.38,-1008.6)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7722" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1 0 0 .50643 256.46 265.42)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7724" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1 0 0 .42746 256.46 317.38)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7726" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1 0 0 .26952 256.46 405.1)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7728" x1="87.866" x2="87.866" y1="516.83" y2="521.42" gradientTransform="matrix(1.0364 0 0 .96441 786.64 -1114.5)" gradientUnits="userSpaceOnUse"><stop stop-color="#999" offset="0"></stop><stop stop-color="#333" offset="1"></stop></linearGradient><linearGradient id="linearGradient7730" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0364 0 0 .96441 234.39 -1076.7)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7732" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0274 0 0 .48841 240.25 -833.5)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7734" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0213 0 0 .41225 243.85 -783.64)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7736" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0122 0 0 .25993 249.26 -698.66)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7738" x1="87.866" x2="87.866" y1="516.83" y2="528.75" gradientTransform="matrix(1.0278,0,0,1,989.55,-112.75)" gradientUnits="userSpaceOnUse"><stop stop-color="#999" offset="0"></stop><stop stop-color="#999" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7740" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0235,0,0,1,444.41,-923.75)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7742" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1 0 0 .50643 458.49 180.57)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7744" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1 0 0 .42746 458.49 232.53)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7746" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1 0 0 .26952 458.49 320.25)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7748" x1="87.866" x2="87.866" y1="516.83" y2="521.42" gradientTransform="matrix(1.0364 0 0 .96441 988.67 -1029.6)" gradientUnits="userSpaceOnUse"><stop stop-color="#999" offset="0"></stop><stop stop-color="#333" offset="1"></stop></linearGradient><linearGradient id="linearGradient7750" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0364 0 0 .96441 436.42 -991.9)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7752" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0274 0 0 .48841 442.28 -748.65)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7754" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0213 0 0 .41225 445.88 -698.79)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><linearGradient id="linearGradient7756" x1="618.49" x2="618.49" y1="496.57" y2="499.1" gradientTransform="matrix(1.0122 0 0 .25993 451.29 -613.82)" gradientUnits="userSpaceOnUse"><stop stop-color="#ccc" offset="0"></stop><stop stop-color="#ccc" stop-opacity="0" offset="1"></stop></linearGradient><clipPath id="clipPath1318"><rect x="618.68" y="336.2" width="107.89" height="491.49" rx="1" ry="112.86" fill="#0d0000" fill-opacity=".14859" stroke-opacity="0" style="paint-order:fill markers stroke;"></rect></clipPath><clipPath id="clipPath1322"><rect x="618.68" y="336.2" width="107.89" height="491.49" rx="1" ry="112.86" fill="#0d0000" fill-opacity=".14859" stroke-opacity="0" style="paint-order:fill markers stroke;"></rect></clipPath><clipPath id="clipPath1326"><rect x="618.68" y="336.2" width="107.89" height="491.49" rx="1" ry="112.86" fill="#0d0000" fill-opacity=".14859" stroke-opacity="0" style="paint-order:fill markers stroke;"></rect></clipPath><clipPath id="clipPath1330"><rect x="618.68" y="336.2" width="107.89" height="491.49" rx="1" ry="112.86" fill="#0d0000" fill-opacity=".14859" stroke-opacity="0" style="paint-order:fill markers stroke;"></rect></clipPath><clipPath id="clipPath1334"><rect x="211.98" y="350.38" width="107.89" height="491.49" rx="1" ry="112.86" fill="#0d0000" fill-opacity=".14859" stroke-opacity="0" style="paint-order:fill markers stroke;"></rect></clipPath><clipPath id="clipPath1338"><rect x="620" y="321.05" width="107.89" height="491.49" rx="1" ry="112.86" fill="#0d0000" fill-opacity=".14859" stroke-opacity="0" style="paint-order:fill markers stroke;"></rect></clipPath><clipPath id="clipPath1342"><rect x="618.68" y="336.2" width="107.89" height="491.49" rx="1" ry="112.86" fill="#0d0000" fill-opacity=".14859" stroke-opacity="0" style="paint-order:fill markers stroke;"></rect></clipPath><clipPath id="clipPath1346"><rect x="618.68" y="336.2" width="107.89" height="491.49" rx="1" ry="112.86" fill="#0d0000" fill-opacity=".14859" stroke-opacity="0" style="paint-order:fill markers stroke;"></rect></clipPath><clipPath id="clipPath1350"><rect x="618.68" y="336.2" width="107.89" height="491.49" rx="1" ry="112.86" fill="#0d0000" fill-opacity=".14859" stroke-opacity="0" style="paint-order:fill markers stroke;"></rect></clipPath><clipPath id="clipPath1354"><rect x="415.33" y="350.38" width="107.89" height="491.49" rx="1" ry="112.86" fill="#0d0000" fill-opacity=".14859" stroke-opacity="0" style="paint-order:fill markers stroke;"></rect></clipPath><clipPath id="clipPath1358"><rect x="415.33" y="350.38" width="107.89" height="491.49" rx="1" ry="112.86" fill="#0d0000" fill-opacity=".14859" stroke-opacity="0" style="paint-order:fill markers stroke;"></rect></clipPath><clipPath id="clipPath1362"><rect x="618.68" y="350.38" width="107.89" height="491.49" rx="1" ry="112.86" fill="#0d0000" fill-opacity=".14859" stroke-opacity="0" style="paint-order:fill markers stroke;"></rect></clipPath><clipPath id="clipPath1366"><rect x="618.68" y="336.2" width="107.89" height="491.49" rx="1" ry="112.86" fill="#0d0000" fill-opacity=".14859" stroke-opacity="0" style="paint-order:fill markers stroke;"></rect></clipPath><clipPath id="clipPath1370"><rect x="618.68" y="336.2" width="107.89" height="491.49" rx="1" ry="112.86" fill="#0d0000" fill-opacity=".14859" stroke-opacity="0" style="paint-order:fill markers stroke;"></rect></clipPath><clipPath id="clipPath1374"><rect x="618.68" y="336.2" width="107.89" height="491.49" rx="1" ry="112.86" fill="#0d0000" fill-opacity=".14859" stroke-opacity="0" style="paint-order:fill markers stroke;"></rect></clipPath><clipPath id="clipPath1378"><rect x="618.68" y="350.38" width="107.89" height="491.49" rx="1" ry="112.86" fill="#0d0000" fill-opacity=".14859" stroke-opacity="0" style="paint-order:fill markers stroke;"></rect></clipPath><clipPath id="clipPath1382"><rect x="618.68" y="350.38" width="107.89" height="491.49" rx="1" ry="112.86" fill="#0d0000" fill-opacity=".14859" stroke-opacity="0" style="paint-order:fill markers stroke;"></rect></clipPath></defs><g transform="translate(-621.34 -349.25)"><g transform="translate(0,-14.18)" clip-path="url(#clipPath1382)" fill="#b3b3b3"><g stroke="#b4b4b4" stroke-linecap="round"><g stroke-width="2.2535"><path d="m686.4 383.13h34.461"></path><path d="m686.4 434.78h34.461"></path><path d="m686.4 602.64h34.461"></path><path d="m686.4 654.29h34.461"></path><path d="m686.4 705.94h34.461"></path><path d="m686.4 757.59h34.461"></path><path d="m686.4 809.24h34.461"></path></g><g stroke-width="1.4468"><path d="m707.72 396.04h13.549"></path><path d="m707.72 408.95h13.549"></path><path d="m707.72 421.86h13.549"></path><path d="m707.72 447.69h13.549"></path><path d="m707.72 460.6h13.549"></path><path d="m707.72 473.51h13.549"></path><path d="m707.72 615.55h13.549"></path><path d="m707.72 628.46h13.549"></path><path d="m707.72 641.38h13.549"></path><path d="m707.72 667.2h13.549"></path><path d="m707.72 680.11h13.549"></path><path d="m707.72 693.03h13.549"></path><path d="m707.72 718.85h13.549"></path><path d="m707.72 731.76h13.549"></path><path d="m707.72 744.68h13.549"></path><path d="m707.72 770.5h13.549"></path><path d="m707.72 783.41h13.549"></path></g><path d="m686.4 538.08h34.461" stroke-width="2.2535"></path><g stroke-width="1.4468"><path d="m707.72 563.9h13.549"></path><path d="m707.72 576.81h13.549"></path><path d="m707.72 589.73h13.549"></path><path d="m707.72 499.34h13.549"></path><path d="m707.72 512.25h13.549"></path><path d="m707.72 525.16h13.549"></path></g></g><g font-family="Sawasdee" font-size="20px" letter-spacing="0px" word-spacing="0px"><text x="732.51788" y="816.73883" style="line-height:125%;" xml:space="preserve"><tspan x="732.51788" y="816.73883">60</tspan></text><text x="732.48859" y="764.85846" style="line-height:125%;" xml:space="preserve"><tspan x="732.48859" y="764.85846">50</tspan></text><text x="732.9671" y="713.24292" style="line-height:125%;" xml:space="preserve"><tspan x="732.9671" y="713.24292">40</tspan></text><text x="732.29816" y="661.56879" style="line-height:125%;" xml:space="preserve"><tspan x="732.29816" y="661.56879">30</tspan></text><text x="732.47394" y="609.91901" style="line-height:125%;" xml:space="preserve"><tspan x="732.47394" y="609.91901">20</tspan></text><text x="731.29718" y="545.35681" style="line-height:125%;" xml:space="preserve"><tspan x="731.29718" y="545.35681">10</tspan></text><text x="738.29425" y="493.71683" style="line-height:125%;" xml:space="preserve"><tspan x="738.29425" y="493.71683">0</tspan></text><text x="738.29913" y="441.98407" style="line-height:125%;" xml:space="preserve"><tspan x="738.29913" y="441.98407">5</tspan></text><text x="731.29718" y="390.41727" style="line-height:125%;" xml:space="preserve"><tspan x="731.29718" y="390.41727">10</tspan></text></g><path d="m708.23 796.33h13.549" stroke="#b4b4b4" stroke-linecap="round" stroke-width="1.4468"></path><g transform="translate(0,3.0785)" stroke="#b4b4b4" stroke-linecap="round"><path d="m657.43 380.16h-34.461" stroke-width="2.2535"></path><path d="m657.43 431.81h-34.461" stroke-width="2.2535"></path><path d="m658.06 483.46h-34.461" stroke-width="3.5"></path><g stroke-width="2.2535"><path d="m657.43 599.68h-34.461"></path><path d="m657.43 651.33h-34.461"></path><path d="m657.43 702.98h-34.461"></path><path d="m657.43 754.62h-34.461"></path><path d="m657.43 806.27h-34.461"></path></g><g stroke-width="1.4468"><path d="m636.12 393.08h-13.549"></path><path d="m636.12 405.99h-13.549"></path><path d="m636.12 418.9h-13.549"></path><path d="m636.12 444.73h-13.549"></path><path d="m636.12 457.64h-13.549"></path><path d="m636.12 470.55h-13.549"></path><path d="m636.12 612.59h-13.549"></path><path d="m636.12 625.5h-13.549"></path><path d="m636.12 638.41h-13.549"></path><path d="m636.12 664.24h-13.549"></path><path d="m636.12 677.15h-13.549"></path><path d="m636.12 690.06h-13.549"></path><path d="m636.12 715.89h-13.549"></path><path d="m636.12 728.8h-13.549"></path><path d="m636.12 741.71h-13.549"></path><path d="m636.12 767.54h-13.549"></path><path d="m636.12 780.45h-13.549"></path></g><path d="m657.43 535.11h-34.461" stroke-width="2.2535"></path><g stroke-width="1.4468"><path d="m636.12 560.94h-13.549"></path><path d="m636.12 573.85h-13.549"></path><path d="m636.12 586.76h-13.549"></path><path d="m636.12 496.38h-13.549"></path><path d="m636.12 509.29h-13.549"></path><path d="m636.12 522.2h-13.549"></path><path d="m635.61 793.36h-13.549"></path></g></g></g><g transform="translate(0,-14.18)" clip-path="url(#clipPath1378)" stroke-linecap="round"><path d="m673.43 370.93v445.71" fill="#333" stroke="#414141" stroke-width="15"></path><path d="m673.43 370.93v445.71" fill="#454545" stroke="#494949" stroke-width="14.545"></path><path d="m673.43 370.93v445.71" fill="#585858" stroke="#515151" stroke-width="14.091"></path><path d="m673.43 370.93v445.71" fill="#6a6a6a" stroke="#595959" stroke-width="13.636"></path><path d="m673.43 370.93v445.71" fill="#7d7d7d" stroke="#616161" stroke-width="13.182"></path><path d="m673.43 370.93v445.71" fill="#8f8f8f" stroke="#696969" stroke-width="12.727"></path><path d="m673.43 370.93v445.71" fill="#a2a2a2" stroke="#717171" stroke-width="12.273"></path><path d="m673.43 370.93v445.71" fill="#b4b4b4" stroke="#797979" stroke-width="11.818"></path><path d="m673.43 370.93v445.71" fill="#c7c7c7" stroke="#818181" stroke-width="11.364"></path><path d="m673.43 370.93v445.71" fill="#d9d9d9" stroke="#898989" stroke-width="10.909"></path><path d="m673.43 370.93v445.71" fill="#ececec" stroke="#919191" stroke-width="10.455"></path><path d="m673.43 370.93v445.71" fill="#fff" stroke="#9a9a9a" stroke-width="10"></path></g><g stroke-linecap="round"><path d="m673.43 356.75v445.71" clip-path="url(#clipPath1374)" fill="#333" stroke="#414141" stroke-width="15"></path><path d="m679.64 802.47v-445.18" clip-path="url(#clipPath1370)" fill="#999" stroke="#b1b1b1" stroke-width=".6"></path><path d="m673.43 356.75v445.71" clip-path="url(#clipPath1366)" fill="#fff" opacity=".50896" stroke="url(#linearGradient7595)" stroke-width="12"></path></g><g transform="translate(203.35,-14.18)" clip-path="url(#clipPath1358)" fill="#b3b3b3"><g stroke="#b4b4b4" stroke-linecap="round"><g stroke-width="2.2535"><path d="m686.4 383.13h34.461"></path><path d="m686.4 434.78h34.461"></path><path d="m686.4 602.64h34.461"></path><path d="m686.4 654.29h34.461"></path><path d="m686.4 705.94h34.461"></path><path d="m686.4 757.59h34.461"></path><path d="m686.4 809.24h34.461"></path></g><g stroke-width="1.4468"><path d="m707.72 396.04h13.549"></path><path d="m707.72 408.95h13.549"></path><path d="m707.72 421.86h13.549"></path><path d="m707.72 447.69h13.549"></path><path d="m707.72 460.6h13.549"></path><path d="m707.72 473.51h13.549"></path><path d="m707.72 615.55h13.549"></path><path d="m707.72 628.46h13.549"></path><path d="m707.72 641.38h13.549"></path><path d="m707.72 667.2h13.549"></path><path d="m707.72 680.11h13.549"></path><path d="m707.72 693.03h13.549"></path><path d="m707.72 718.85h13.549"></path><path d="m707.72 731.76h13.549"></path><path d="m707.72 744.68h13.549"></path><path d="m707.72 770.5h13.549"></path><path d="m707.72 783.41h13.549"></path></g><path d="m686.4 538.08h34.461" stroke-width="2.2535"></path><g stroke-width="1.4468"><path d="m707.72 563.9h13.549"></path><path d="m707.72 576.81h13.549"></path><path d="m707.72 589.73h13.549"></path><path d="m707.72 499.34h13.549"></path><path d="m707.72 512.25h13.549"></path><path d="m707.72 525.16h13.549"></path></g></g><g font-family="Sawasdee" font-size="20px" letter-spacing="0px" word-spacing="0px"><text x="732.51788" y="816.73883" style="line-height:125%;" xml:space="preserve"><tspan x="732.51788" y="816.73883">60</tspan></text><text x="732.48859" y="764.85846" style="line-height:125%;" xml:space="preserve"><tspan x="732.48859" y="764.85846">50</tspan></text><text x="732.9671" y="713.24292" style="line-height:125%;" xml:space="preserve"><tspan x="732.9671" y="713.24292">40</tspan></text><text x="732.29816" y="661.56879" style="line-height:125%;" xml:space="preserve"><tspan x="732.29816" y="661.56879">30</tspan></text><text x="732.47394" y="609.91901" style="line-height:125%;" xml:space="preserve"><tspan x="732.47394" y="609.91901">20</tspan></text><text x="731.29718" y="545.35681" style="line-height:125%;" xml:space="preserve"><tspan x="731.29718" y="545.35681">10</tspan></text><text x="738.29425" y="493.71683" style="line-height:125%;" xml:space="preserve"><tspan x="738.29425" y="493.71683">0</tspan></text><text x="738.29913" y="441.98407" style="line-height:125%;" xml:space="preserve"><tspan x="738.29913" y="441.98407">5</tspan></text><text x="731.29718" y="390.41727" style="line-height:125%;" xml:space="preserve"><tspan x="731.29718" y="390.41727">10</tspan></text></g><path d="m708.23 796.33h13.549" stroke="#b4b4b4" stroke-linecap="round" stroke-width="1.4468"></path><g transform="translate(0,3.0785)" stroke="#b4b4b4" stroke-linecap="round"><path d="m657.43 380.16h-34.461" stroke-width="2.2535"></path><path d="m657.43 431.81h-34.461" stroke-width="2.2535"></path><path d="m658.06 483.46h-34.461" stroke-width="3.5"></path><g stroke-width="2.2535"><path d="m657.43 599.68h-34.461"></path><path d="m657.43 651.33h-34.461"></path><path d="m657.43 702.98h-34.461"></path><path d="m657.43 754.62h-34.461"></path><path d="m657.43 806.27h-34.461"></path></g><g stroke-width="1.4468"><path d="m636.12 393.08h-13.549"></path><path d="m636.12 405.99h-13.549"></path><path d="m636.12 418.9h-13.549"></path><path d="m636.12 444.73h-13.549"></path><path d="m636.12 457.64h-13.549"></path><path d="m636.12 470.55h-13.549"></path><path d="m636.12 612.59h-13.549"></path><path d="m636.12 625.5h-13.549"></path><path d="m636.12 638.41h-13.549"></path><path d="m636.12 664.24h-13.549"></path><path d="m636.12 677.15h-13.549"></path><path d="m636.12 690.06h-13.549"></path><path d="m636.12 715.89h-13.549"></path><path d="m636.12 728.8h-13.549"></path><path d="m636.12 741.71h-13.549"></path><path d="m636.12 767.54h-13.549"></path><path d="m636.12 780.45h-13.549"></path></g><path d="m657.43 535.11h-34.461" stroke-width="2.2535"></path><g stroke-width="1.4468"><path d="m636.12 560.94h-13.549"></path><path d="m636.12 573.85h-13.549"></path><path d="m636.12 586.76h-13.549"></path><path d="m636.12 496.38h-13.549"></path><path d="m636.12 509.29h-13.549"></path><path d="m636.12 522.2h-13.549"></path><path d="m635.61 793.36h-13.549"></path></g></g></g><g transform="translate(203.35,-14.18)" clip-path="url(#clipPath1354)" stroke-linecap="round"><path d="m673.43 370.93v445.71" fill="#333" stroke="#414141" stroke-width="15"></path><path d="m673.43 370.93v445.71" fill="#454545" stroke="#494949" stroke-width="14.545"></path><path d="m673.43 370.93v445.71" fill="#585858" stroke="#515151" stroke-width="14.091"></path><path d="m673.43 370.93v445.71" fill="#6a6a6a" stroke="#595959" stroke-width="13.636"></path><path d="m673.43 370.93v445.71" fill="#7d7d7d" stroke="#616161" stroke-width="13.182"></path><path d="m673.43 370.93v445.71" fill="#8f8f8f" stroke="#696969" stroke-width="12.727"></path><path d="m673.43 370.93v445.71" fill="#a2a2a2" stroke="#717171" stroke-width="12.273"></path><path d="m673.43 370.93v445.71" fill="#b4b4b4" stroke="#797979" stroke-width="11.818"></path><path d="m673.43 370.93v445.71" fill="#c7c7c7" stroke="#818181" stroke-width="11.364"></path><path d="m673.43 370.93v445.71" fill="#d9d9d9" stroke="#898989" stroke-width="10.909"></path><path d="m673.43 370.93v445.71" fill="#ececec" stroke="#919191" stroke-width="10.455"></path><path d="m673.43 370.93v445.71" fill="#fff" stroke="#9a9a9a" stroke-width="10"></path></g><g stroke-linecap="round"><path d="m876.78 356.75v445.71" clip-path="url(#clipPath1350)" fill="#333" stroke="#414141" stroke-width="15"></path><path d="m882.99 802.47v-445.18" clip-path="url(#clipPath1346)" fill="#999" stroke="#b1b1b1" stroke-width=".6"></path><path d="m876.78 356.75v445.71" clip-path="url(#clipPath1342)" fill="#fff" opacity=".50896" stroke="url(#linearGradient7468)" stroke-width="12"></path></g><g transform="translate(-1.3202,15.152)" clip-path="url(#clipPath1338)"><path transform="matrix(.53231 0 0 .99811 560.96 12.701)" d="m649.84 478.85v126.27l31.315-18.94s-35.355-47.982 0-83.338c-27.779-21.466-31.315-23.991-31.315-23.991z" fill="#a1a1a1" filter="url(#filter4165-1)"></path><path d="m890.45 497.09h34.461" fill="#e6e6e6" stroke="#b4b4b4" stroke-linecap="round" stroke-width="3.5"></path><rect x="847.03" y="488.03" width="62.143" height="129.29" rx="3" ry="3" fill="#4d4d4d"></rect><rect x="847.97" y="552.42" width="60.419" height="3.5355" fill="#e6e6e6"></rect><rect x="847.72" y="488.74" width="60.613" height="21.071" rx="2.1483" ry="2" fill="url(#linearGradient7718)"></rect><rect x="847.92" y="540.26" width="58.811" height="10.119" fill="#333"></rect><rect x="847.03" y="530.89" width="61.133" height="8.7929" fill="#333"></rect><rect x="847.03" y="512.48" width="61.133" height="4.5457" fill="#1a1a1a"></rect><rect x="847.03" y="518.25" width="61.133" height="11.364" fill="#1a1a1a"></rect><rect transform="scale(1,-1)" x="847.72" y="-511.76" width="60.012" height="2.2612" rx="1.0235" ry=".63958" fill="url(#linearGradient7720)"></rect><rect x="847.89" y="517.03" width="58.633" height="1.1452" rx="1" ry=".3239" fill="url(#linearGradient7722)"></rect><rect x="847.89" y="529.76" width="58.633" height=".9666" rx="1" ry=".2734" fill="url(#linearGradient7724)"></rect><rect x="847.89" y="539.01" width="58.633" height=".60946" rx="1" ry=".17238" fill="url(#linearGradient7726)"></rect><rect transform="scale(1,-1)" x="847.34" y="-616.24" width="61.118" height="20.321" rx="2.1662" ry="1.9288" fill="url(#linearGradient7728)"></rect><rect transform="scale(1,-1)" x="847.92" y="-567.93" width="58.811" height="9.7593" fill="#333"></rect><rect transform="scale(1,-1)" x="847.03" y="-576.96" width="61.133" height="8.4799" fill="#666"></rect><rect transform="scale(1,-1)" x="847.03" y="-594.72" width="61.133" height="4.3839" fill="#808080"></rect><rect transform="scale(1,-1)" x="847.03" y="-589.16" width="61.133" height="10.96" fill="#808080"></rect><rect transform="scale(1,-1)" x="847.34" y="-597.6" width="60.767" height="2.1808" rx="1.0364" ry=".61681" fill="url(#linearGradient7730)"></rect><rect transform="scale(1,-1)" x="847.89" y="-590.84" width="60.24" height="1.1044" rx="1.0274" ry=".31237" fill="url(#linearGradient7732)"></rect><rect transform="scale(1,-1)" x="847.89" y="-578.82" width="59.883" height=".9322" rx="1.0213" ry=".26366" fill="url(#linearGradient7734)"></rect><rect transform="scale(1,-1)" x="847.89" y="-569.52" width="59.347" height=".58776" rx="1.0122" ry=".16624" fill="url(#linearGradient7736)"></rect></g><g transform="translate(406.7,-14.18)" clip-path="url(#clipPath1334)" stroke-linecap="round"><path d="m673.43 370.93v445.71" fill="#333" stroke="#414141" stroke-width="15"></path><path d="m673.43 370.93v445.71" fill="#454545" stroke="#494949" stroke-width="14.545"></path><path d="m673.43 370.93v445.71" fill="#585858" stroke="#515151" stroke-width="14.091"></path><path d="m673.43 370.93v445.71" fill="#6a6a6a" stroke="#595959" stroke-width="13.636"></path><path d="m673.43 370.93v445.71" fill="#7d7d7d" stroke="#616161" stroke-width="13.182"></path><path d="m673.43 370.93v445.71" fill="#8f8f8f" stroke="#696969" stroke-width="12.727"></path><path d="m673.43 370.93v445.71" fill="#a2a2a2" stroke="#717171" stroke-width="12.273"></path><path d="m673.43 370.93v445.71" fill="#b4b4b4" stroke="#797979" stroke-width="11.818"></path><path d="m673.43 370.93v445.71" fill="#c7c7c7" stroke="#818181" stroke-width="11.364"></path><path d="m673.43 370.93v445.71" fill="#d9d9d9" stroke="#898989" stroke-width="10.909"></path><path d="m673.43 370.93v445.71" fill="#ececec" stroke="#919191" stroke-width="10.455"></path><path d="m673.43 370.93v445.71" fill="#fff" stroke="#9a9a9a" stroke-width="10"></path></g><g stroke-linecap="round"><path d="m1080.1 356.75v445.71" clip-path="url(#clipPath1330)" fill="#333" stroke="#414141" stroke-width="15"></path><path d="m1086.3 802.47v-445.18" clip-path="url(#clipPath1326)" fill="#999" stroke="#b1b1b1" stroke-width=".6"></path><path d="m1080.1 356.75v445.71" clip-path="url(#clipPath1322)" fill="#fff" opacity=".50896" stroke="url(#linearGradient7341)" stroke-width="12"></path></g><g clip-path="url(#clipPath1318)"><path transform="matrix(.53231 0 0 .99811 762.99 -72.147)" d="m649.84 478.85v126.27l31.315-18.94s-35.355-47.982 0-83.338c-27.779-21.466-31.315-23.991-31.315-23.991z" fill="#a1a1a1" filter="url(#filter4165-4)"></path><path d="m1092.5 412.25h34.461" fill="#e6e6e6" stroke="#b4b4b4" stroke-linecap="round" stroke-width="3.5"></path><rect x="1049.1" y="403.18" width="62.143" height="129.29" rx="3" ry="3" fill="#4d4d4d"></rect><rect x="1050" y="467.57" width="60.419" height="3.5355" fill="#e6e6e6"></rect><rect x="1049.8" y="403.9" width="60.613" height="21.071" rx="2.1483" ry="2" fill="url(#linearGradient7738)"></rect><rect x="1050" y="455.41" width="58.811" height="10.119" fill="#333"></rect><rect x="1049.1" y="446.05" width="61.133" height="8.7929" fill="#333"></rect><rect x="1049.1" y="427.63" width="61.133" height="4.5457" fill="#1a1a1a"></rect><rect x="1049.1" y="433.4" width="61.133" height="11.364" fill="#1a1a1a"></rect><rect transform="scale(1,-1)" x="1049.8" y="-426.91" width="60.012" height="2.2612" rx="1.0235" ry=".63958" fill="url(#linearGradient7740)"></rect><rect x="1049.9" y="432.19" width="58.633" height="1.1452" rx="1" ry=".3239" fill="url(#linearGradient7742)"></rect><rect x="1049.9" y="444.91" width="58.633" height=".9666" rx="1" ry=".2734" fill="url(#linearGradient7744)"></rect><rect x="1049.9" y="454.16" width="58.633" height=".60946" rx="1" ry=".17238" fill="url(#linearGradient7746)"></rect><rect transform="scale(1,-1)" x="1049.4" y="-531.39" width="61.118" height="20.321" rx="2.1662" ry="1.9288" fill="url(#linearGradient7748)"></rect><rect transform="scale(1,-1)" x="1050" y="-483.08" width="58.811" height="9.7593" fill="#333"></rect><rect transform="scale(1,-1)" x="1049.1" y="-492.12" width="61.133" height="8.4799" fill="#666"></rect><rect transform="scale(1,-1)" x="1049.1" y="-509.88" width="61.133" height="4.3839" fill="#808080"></rect><rect transform="scale(1,-1)" x="1049.1" y="-504.31" width="61.133" height="10.96" fill="#808080"></rect><rect transform="scale(1,-1)" x="1049.4" y="-512.75" width="60.767" height="2.1808" rx="1.0364" ry=".61681" fill="url(#linearGradient7750)"></rect><rect transform="scale(1,-1)" x="1049.9" y="-505.99" width="60.24" height="1.1044" rx="1.0274" ry=".31237" fill="url(#linearGradient7752)"></rect><rect transform="scale(1,-1)" x="1049.9" y="-493.97" width="59.883" height=".9322" rx="1.0213" ry=".26366" fill="url(#linearGradient7754)"></rect><rect transform="scale(1,-1)" x="1049.9" y="-484.67" width="59.347" height=".58776" rx="1.0122" ry=".16624" fill="url(#linearGradient7756)"></rect></g></g>', 2)
716
+ ])]);
717
+ }
718
+ const Ve = /* @__PURE__ */ D(Me, [["render", Ge]]), De = T({
719
+ name: "VAFader",
720
+ components: {
721
+ defaultFaderHead: be,
722
+ defaultFaderBackground: Ve
723
+ },
724
+ emits: ["update:modelValue"],
725
+ setup(t) {
726
+ const e = g(new ht(t.minValue, t.maxValue)), a = g(0), i = g(t.modelValue), o = g(e.value.getCurvedValue(t.modelValue)), n = g(0), r = g(void 0);
727
+ return {
728
+ valueCurve: e,
729
+ faderContainerY: a,
730
+ linearValue: i,
731
+ curvedValue: o,
732
+ // faderContainer,
733
+ // faderBackground,
734
+ // faderHead,
735
+ faderHeadHeight: n,
736
+ resizeObserver: r
737
+ };
738
+ },
739
+ props: {
740
+ modelValue: {
741
+ required: !0,
742
+ type: Number
743
+ },
744
+ minValue: {
745
+ required: !0,
746
+ type: Number
747
+ },
748
+ maxValue: {
749
+ required: !0,
750
+ type: Number
751
+ },
752
+ height: {
753
+ required: !1,
754
+ type: Number,
755
+ default: 200
756
+ },
757
+ width: {
758
+ required: !1,
759
+ type: Number,
760
+ default: 46
761
+ },
762
+ default: {
763
+ required: !1,
764
+ type: Number
765
+ }
766
+ },
767
+ computed: {
768
+ midValue() {
769
+ return this.minValue + this.valueRange / 2;
770
+ },
771
+ valueRange() {
772
+ return this.maxValue - this.minValue;
773
+ },
774
+ faderDragRange() {
775
+ return Math.abs(this.height - this.faderHeadHeight);
776
+ },
777
+ faderHeadTop() {
778
+ const t = (this.linearValue - this.minValue) / (this.maxValue - this.minValue);
779
+ return this.faderDragRange - t * this.faderDragRange;
780
+ },
781
+ cssVars() {
782
+ return {
783
+ "--fader-height": `${this.height}px`,
784
+ "--fader-width": `${this.width}px`,
785
+ "--fader-head-top": `${this.faderHeadTop}px`
786
+ };
787
+ }
788
+ },
789
+ mounted() {
790
+ this.resizeObserver = new ResizeObserver((t, e) => {
791
+ this.faderHeadHeight = this.getFaderHeadHeight();
792
+ }), this.resizeObserver.observe(this.$refs.faderHead);
793
+ },
794
+ unmounted() {
795
+ this.resizeObserver?.disconnect();
796
+ },
797
+ methods: {
798
+ getContainedImgOrSvg(t) {
799
+ if (t.children.length == 1) {
800
+ if (t.children.item(0) instanceof SVGElement)
801
+ return t.children.item(0);
802
+ if (t.children.item(0) instanceof HTMLImageElement)
803
+ return t.children.item(0);
804
+ }
805
+ },
806
+ getFaderHeadHeight() {
807
+ const t = this.$refs.faderHead, e = this.getContainedImgOrSvg(t);
808
+ return e ? e.getBoundingClientRect().height : t.getBoundingClientRect().height;
809
+ },
810
+ onHeadMouseDown(t) {
811
+ t.preventDefault(), this.faderContainerY = this.$refs.faderContainer.getBoundingClientRect().y, this.faderHeadHeight = this.getFaderHeadHeight(), document.addEventListener("mousemove", this.onHeadMouseDrag), document.addEventListener("touchmove", this.onHeadTouchDrag), document.addEventListener("mouseup", this.onDocumentMouseUp), document.addEventListener("touchend", this.onDocumentMouseUp);
812
+ },
813
+ onDocumentMouseUp() {
814
+ document.removeEventListener("mousemove", this.onHeadMouseDrag), document.removeEventListener("touchmove", this.onHeadTouchDrag), document.removeEventListener("mouseup", this.onDocumentMouseUp), document.removeEventListener("touchend", this.onDocumentMouseUp);
815
+ },
816
+ onHeadDblClick() {
817
+ const t = typeof this.default > "u" ? this.midValue : this.default;
818
+ this.$emit("update:modelValue", this.valueCurve.getCurvedValue(t));
819
+ },
820
+ onHeadDrag(t) {
821
+ let e = t - this.faderContainerY;
822
+ e > this.height ? e = this.height : e < 0 && (e = 0);
823
+ const i = (this.height - e) / this.height * this.valueRange + this.minValue;
824
+ this.$emit(
825
+ "update:modelValue",
826
+ this.valueCurve.getCurvedValue(i)
827
+ );
828
+ },
829
+ onHeadTouchDrag(t) {
830
+ t.touches[0] && this.onHeadDrag(t.touches[0].clientY);
831
+ },
832
+ onHeadMouseDrag(t) {
833
+ this.onHeadDrag(t.clientY);
834
+ }
835
+ },
836
+ watch: {
837
+ modelValue(t) {
838
+ this.curvedValue = t, this.linearValue = this.valueCurve.getLinearValue(this.curvedValue);
839
+ },
840
+ minValue(t) {
841
+ this.valueCurve = new ht(t, this.maxValue);
842
+ },
843
+ maxValue(t) {
844
+ this.valueCurve = new ht(this.minValue, t);
845
+ }
846
+ }
847
+ }), $e = {
848
+ ref: "faderBackground",
849
+ class: "fader-background"
850
+ };
851
+ function Ae(t, e, a, i, o, n) {
852
+ const r = et("defaultFaderBackground"), d = et("defaultFaderHead");
853
+ return k(), x("div", {
854
+ ref: "faderContainer",
855
+ class: "fader-container",
856
+ style: Z(t.cssVars)
857
+ }, [
858
+ c("div", $e, [
859
+ xt(t.$slots, "faderBackground", {}, () => [
860
+ X(r)
861
+ ], !0)
862
+ ], 512),
863
+ c("div", {
864
+ ref: "faderHead",
865
+ class: "fader-head",
866
+ onMousedown: e[0] || (e[0] = (...y) => t.onHeadMouseDown && t.onHeadMouseDown(...y)),
867
+ onTouchstart: e[1] || (e[1] = (...y) => t.onHeadMouseDown && t.onHeadMouseDown(...y)),
868
+ onDblclick: e[2] || (e[2] = (...y) => t.onHeadDblClick && t.onHeadDblClick(...y))
869
+ }, [
870
+ xt(t.$slots, "faderHead", {}, () => [
871
+ X(d)
872
+ ], !0)
873
+ ], 544)
874
+ ], 4);
875
+ }
876
+ const Pe = /* @__PURE__ */ D(De, [["render", Ae], ["__scopeId", "data-v-9d74edfd"]]), Te = {}, Ue = {
877
+ width: "50",
878
+ height: "50",
879
+ viewBox: "0 0 100 100"
880
+ };
881
+ function Ie(t, e) {
882
+ return k(), x("svg", Ue, [...e[0] || (e[0] = [
883
+ ct(`<g data-v-3cef4f4a><g data-v-3cef4f4a><circle class="st0" cx="50%" cy="50%" r="50%" data-v-3cef4f4a></circle><g transform="translate(-20 -20)" data-v-3cef4f4a><g transform="translate(0 -6)" data-v-3cef4f4a><path d="M109.4,78.2c-2.3-2.5-4-5.6-4.6-9c-0.7-3.5-0.5-6.9,0.6-10.2c-2.2-4.6-5.3-8.6-9.2-11.9c-3.3,0.2-6.8-0.4-10-2
884
+ s-5.8-4-7.7-6.7c-5.1-1-10.2-1.1-15-0.2c-1.9,2.8-4.6,5.1-7.8,6.6s-6.7,2.1-10.1,1.7c-3.8,3.1-7.1,7.1-9.5,11.6
885
+ c0.9,3.2,1.1,6.7,0.4,10.2c-0.9,3.5-2.6,6.5-5,8.9c0.1,5.1,1.1,10.1,3.1,14.6c3.1,1.2,5.9,3.2,8.2,6.2c2.2,2.8,3.5,6.2,4,9.4
886
+ c4,3,8.4,5.3,13.5,6.7c2.9-1.6,6.3-2.6,9.9-2.6s6.9,1,9.9,2.8c4.8-1.1,9.5-3.3,13.6-6.4c0.6-3.3,1.9-6.5,4.2-9.3
887
+ c2.3-2.8,5.2-4.7,8.4-5.9c1-2.2,1.9-4.6,2.5-7.1C109.1,83.4,109.3,80.7,109.4,78.2z" data-v-3cef4f4a></path></g><ellipse class="st1" cx="70.4" cy="70.4" rx="26.7" ry="26.7" data-v-3cef4f4a></ellipse><g transform="translate(0 -8)" data-v-3cef4f4a><path class="st2" d="M71.5,28.5c-0.4,0-0.9,0-1.1,0c-0.3,0-0.9,0-1.1,0v31h2.5v-31H71.5z" data-v-3cef4f4a></path></g></g></g></g>`, 1)
888
+ ])]);
889
+ }
890
+ const Ee = /* @__PURE__ */ D(Te, [["render", Ie], ["__scopeId", "data-v-3cef4f4a"]]), We = T({
891
+ components: {
892
+ defaultKnob: Ee
893
+ },
894
+ setup(t) {
895
+ const e = {
896
+ curvedValue: 0,
897
+ linearValue: 0,
898
+ unsteppedValue: 0,
899
+ rotationMax: 3 * Math.PI / 4,
900
+ dragRange: 70,
901
+ prevY: -1,
902
+ valueCurve: new ht(t.minValue, t.maxValue)
903
+ // audioParamValue: null as AudioParam | null
904
+ };
905
+ return t.modelValue instanceof Number && (e.linearValue = t.modelValue, e.curvedValue = e.valueCurve.getCurvedValue(t.modelValue), e.unsteppedValue = e.curvedValue), Bt(e);
906
+ },
907
+ props: {
908
+ modelValue: {
909
+ required: !0,
910
+ type: Number
911
+ },
912
+ minValue: {
913
+ required: !0,
914
+ type: Number
915
+ },
916
+ maxValue: {
917
+ required: !0,
918
+ type: Number
919
+ },
920
+ step: {
921
+ required: !1,
922
+ type: Number,
923
+ default: 0
924
+ },
925
+ size: {
926
+ required: !1,
927
+ type: Number,
928
+ default: 60
929
+ },
930
+ default: {
931
+ required: !1,
932
+ type: Number
933
+ }
934
+ },
935
+ computed: {
936
+ knobRotation() {
937
+ return (this.linearValue - this.midValue) / (this.valueRange / 2) * this.rotationMax;
938
+ },
939
+ midValue() {
940
+ return this.minValue + this.valueRange / 2;
941
+ },
942
+ valueRange() {
943
+ return this.maxValue - this.minValue;
944
+ }
945
+ },
946
+ methods: {
947
+ onKnobMouseDown(t) {
948
+ t.preventDefault(), document.addEventListener("mousemove", this.onKnobMouseDrag), document.addEventListener("touchmove", this.onKnobTouchDrag), document.addEventListener("mouseup", this.onDocumentMouseUp), document.addEventListener("touchend", this.onDocumentMouseUp);
949
+ },
950
+ onDocumentMouseUp() {
951
+ document.removeEventListener("mousemove", this.onKnobMouseDrag), document.removeEventListener("touchmove", this.onKnobTouchDrag), document.removeEventListener("mouseup", this.onDocumentMouseUp), document.removeEventListener("touchend", this.onDocumentMouseUp), this.prevY = -1;
952
+ },
953
+ onKnobDblClick() {
954
+ const t = typeof this.default > "u" ? this.midValue : this.default;
955
+ this.unsteppedValue = t, this.$emit("update:modelValue", this.valueCurve.getCurvedValue(t));
956
+ },
957
+ roundToStep(t) {
958
+ if (this.step === 0)
959
+ throw "step is zero or undefined";
960
+ const e = Math.round(t / this.step) * this.step;
961
+ return H(e, this.minValue, this.maxValue);
962
+ },
963
+ onKnobDrag(t) {
964
+ if (this.prevY >= 0) {
965
+ const e = this.prevY - t;
966
+ let a = this.unsteppedValue + e / this.dragRange * (this.valueRange / 2);
967
+ a = H(a, this.minValue, this.maxValue), this.unsteppedValue = a;
968
+ const i = this.step === 0 ? this.unsteppedValue : this.roundToStep(this.unsteppedValue);
969
+ this.$emit(
970
+ "update:modelValue",
971
+ this.valueCurve.getCurvedValue(i)
972
+ );
973
+ }
974
+ },
975
+ onKnobTouchDrag(t) {
976
+ t.touches[0] && (this.onKnobDrag(t.touches[0].pageY), this.prevY = t.touches[0].pageY);
977
+ },
978
+ onKnobMouseDrag(t) {
979
+ this.onKnobDrag(t.pageY), this.prevY = t.pageY;
980
+ }
981
+ },
982
+ watch: {
983
+ modelValue(t) {
984
+ this.curvedValue = t, this.unsteppedValue = this.valueCurve.getLinearValue(this.curvedValue), this.linearValue = this.step === 0 ? this.unsteppedValue : this.roundToStep(this.unsteppedValue);
985
+ }
986
+ }
987
+ }), Oe = { class: "control-container" }, qe = { class: "knob-row" };
988
+ function Le(t, e, a, i, o, n) {
989
+ const r = et("default-knob");
990
+ return k(), x("div", Oe, [
991
+ c("div", qe, [
992
+ c("span", {
993
+ onMousedown: e[0] || (e[0] = (...d) => t.onKnobMouseDown && t.onKnobMouseDown(...d)),
994
+ onTouchstart: e[1] || (e[1] = (...d) => t.onKnobMouseDown && t.onKnobMouseDown(...d)),
995
+ onDblclick: e[2] || (e[2] = (...d) => t.onKnobDblClick && t.onKnobDblClick(...d)),
996
+ class: "knob-container",
997
+ style: Z(`transform: rotate(${t.knobRotation}rad); width: ${t.size}px; height: ${t.size}px;`)
998
+ }, [
999
+ xt(t.$slots, "default", {}, () => [
1000
+ X(r)
1001
+ ], !0)
1002
+ ], 36)
1003
+ ])
1004
+ ]);
1005
+ }
1006
+ const ze = /* @__PURE__ */ D(We, [["render", Le], ["__scopeId", "data-v-516025e9"]]), Q = 20, tt = -120, Re = 3, Ne = T({
1007
+ name: "VASpectrumAnalyzer",
1008
+ data() {
1009
+ return {
1010
+ continueDrawing: !1,
1011
+ canvas: null,
1012
+ canvasContext: null
1013
+ };
1014
+ },
1015
+ props: {
1016
+ input: {
1017
+ required: !1,
1018
+ type: AudioNode
1019
+ },
1020
+ fftSize: {
1021
+ type: Number,
1022
+ required: !1,
1023
+ default: 1024
1024
+ // todo: this breaks types with options api
1025
+ // validator(n: number) {
1026
+ // return n >= 32 && n <= 32768 && isPowerOfTwo(n);
1027
+ // }
1028
+ },
1029
+ height: {
1030
+ type: Number,
1031
+ required: !1
1032
+ },
1033
+ width: {
1034
+ type: Number,
1035
+ required: !1,
1036
+ default: 500
1037
+ },
1038
+ fillStyle: {
1039
+ type: String,
1040
+ required: !1,
1041
+ default: "none"
1042
+ },
1043
+ lineColor: {
1044
+ type: String,
1045
+ required: !1
1046
+ },
1047
+ backgroundColor: {
1048
+ type: String,
1049
+ required: !1,
1050
+ default: "black"
1051
+ },
1052
+ gridColor: {
1053
+ type: String,
1054
+ required: !1,
1055
+ default: "gray"
1056
+ },
1057
+ dbColor: {
1058
+ type: String,
1059
+ required: !1,
1060
+ default: "gray"
1061
+ },
1062
+ hzColor: {
1063
+ type: String,
1064
+ required: !1,
1065
+ default: "white"
1066
+ },
1067
+ font: {
1068
+ required: !1,
1069
+ type: String,
1070
+ default: "Helvetica, sans-serif"
1071
+ }
1072
+ },
1073
+ setup(t) {
1074
+ const e = pt(t.fftSize, t.input);
1075
+ return N(() => t.input, e.onInputChanged), {
1076
+ ...e,
1077
+ ...ft()
1078
+ };
1079
+ },
1080
+ computed: {
1081
+ graphWidth() {
1082
+ return this.width;
1083
+ },
1084
+ graphHeight() {
1085
+ return this.height ? this.height : this.width / Re;
1086
+ },
1087
+ cssVars() {
1088
+ return {
1089
+ "--border-color": this.backgroundColor
1090
+ };
1091
+ }
1092
+ },
1093
+ mounted() {
1094
+ this.canvasContext = this.$refs.analyserCanvas.getContext("2d"), this.startRendering(this.drawFrequencyDomain);
1095
+ },
1096
+ methods: {
1097
+ scaleX(t, e, a, i) {
1098
+ const o = 0.30111412225233364;
1099
+ let n = (a - e) / a;
1100
+ n *= 1 - o, n = 1 - n;
1101
+ let r = (t - e) / (a - e);
1102
+ return r = Math.pow(r, n), r < 1 && (r *= i), r;
1103
+ },
1104
+ scaleXLegacy(t, e, a, i) {
1105
+ return Math.floor(
1106
+ Math.log2(t - e) / Math.log2(a - e) * i
1107
+ );
1108
+ },
1109
+ drawFrequencyDomain() {
1110
+ if (this.canvasContext) {
1111
+ const t = 0 - tt, e = this.input ? this.input.context.sampleRate / 2 : 24e3, a = this.getFloatFrequencyData();
1112
+ if (this.canvasContext.clearRect(0, 0, this.graphWidth, this.graphHeight), this.canvasContext.fillStyle = this.backgroundColor, this.canvasContext.fillRect(0, 0, this.graphWidth, this.graphHeight), a) {
1113
+ this.canvasContext.beginPath(), this.canvasContext.lineWidth = 1, this.canvasContext.strokeStyle = this.lineColor ?? V.colors.primary, this.canvasContext.fillStyle = this.lineColor ?? V.colors.primary, this.canvasContext.moveTo(0, this.graphHeight);
1114
+ let i = 0, o = this.graphHeight - (a[0] - tt) / t * this.graphHeight;
1115
+ for (let n = 0; n < a.length; n++) {
1116
+ const r = (a[n] - tt) / t * this.graphHeight, d = n * (e / a.length);
1117
+ this.canvasContext.lineTo(i, o), d >= Q && (i = this.scaleX(d, Q, e, this.graphWidth), o = this.graphHeight - r, this.fillStyle === "lines" && this.canvasContext.fillRect(i, o, 1, r)), this.canvasContext.lineTo(i, o);
1118
+ }
1119
+ this.canvasContext.lineTo(this.graphWidth, this.graphHeight), this.canvasContext.closePath(), this.canvasContext.stroke(), this.fillStyle === "solid" && this.canvasContext.fill();
1120
+ }
1121
+ this.drawDbMarkers(), this.drawFrequencyMarkers(e);
1122
+ }
1123
+ },
1124
+ drawDbMarkers() {
1125
+ this.drawDbMarker(-20), this.drawDbMarker(-40), this.drawDbMarker(-60), this.drawDbMarker(-80), this.drawDbMarker(-100);
1126
+ },
1127
+ drawDbMarker(t) {
1128
+ if (this.canvasContext) {
1129
+ const e = this.graphHeight - (tt - t) / tt * this.graphHeight;
1130
+ this.canvasContext.strokeStyle = this.dbColor, this.canvasContext.beginPath(), this.canvasContext.moveTo(0, e), this.canvasContext.lineTo(this.graphWidth, e), this.canvasContext.stroke(), this.canvasContext.font = `12px ${this.font}`, this.canvasContext.fillStyle = this.gridColor, this.canvasContext.fillText(`${t}db`, 10, e);
1131
+ }
1132
+ },
1133
+ drawFrequencyMarkers(t) {
1134
+ this.drawFrequencyMarker(
1135
+ Q,
1136
+ t,
1137
+ this.graphWidth > 300,
1138
+ !1
1139
+ ), this.drawFrequencyMarker(25, t), this.drawFrequencyMarker(50, t, !0), this.drawFrequencyMarker(100, t), this.drawFrequencyMarker(200, t, this.graphWidth > 600), this.drawFrequencyMarker(500, t, this.graphWidth > 300), this.drawFrequencyMarker(1e3, t, this.graphWidth > 600), this.drawFrequencyMarker(1500, t), this.drawFrequencyMarker(2e3, t, !0), this.drawFrequencyMarker(3e3, t, this.graphWidth > 600), this.drawFrequencyMarker(5e3, t, this.graphWidth > 300), this.drawFrequencyMarker(7e3, t, this.graphWidth > 600), this.drawFrequencyMarker(1e4, t, !0), this.drawFrequencyMarker(15e3, t, this.graphWidth > 600), this.drawFrequencyMarker(2e4, t, this.graphWidth > 800);
1140
+ },
1141
+ drawFrequencyMarker(t, e, a = !1, i = !0) {
1142
+ if (this.canvasContext && t >= Q) {
1143
+ const o = this.scaleX(t, Q, e, this.graphWidth);
1144
+ i && (this.canvasContext.strokeStyle = this.gridColor, this.canvasContext.beginPath(), this.canvasContext.moveTo(o, 0), this.canvasContext.lineTo(o, this.graphWidth), this.canvasContext.stroke()), a && (this.canvasContext.font = `14px ${this.font}`, this.canvasContext.fillStyle = this.hzColor ?? V.colors.primary, t < 1e3 ? this.canvasContext.fillText(`${t}hz`, o, 50) : this.canvasContext.fillText(`${t / 1e3}khz`, o, 50));
1145
+ }
1146
+ }
1147
+ }
1148
+ }), Be = ["width", "height"];
1149
+ function He(t, e, a, i, o, n) {
1150
+ return k(), x("canvas", {
1151
+ width: t.graphWidth,
1152
+ height: t.graphHeight,
1153
+ ref: "analyserCanvas",
1154
+ class: "analyser-canvas",
1155
+ style: Z(t.cssVars)
1156
+ }, null, 12, Be);
1157
+ }
1158
+ const Fe = /* @__PURE__ */ D(Ne, [["render", He], ["__scopeId", "data-v-670d0fd3"]]), Ye = ["height", "width"], _e = 3, Ke = /* @__PURE__ */ T({
1159
+ __name: "v-a-oscilloscope",
1160
+ props: {
1161
+ input: {
1162
+ type: AudioNode,
1163
+ required: !1
1164
+ },
1165
+ width: {
1166
+ type: Number,
1167
+ required: !1,
1168
+ default: 500
1169
+ },
1170
+ height: {
1171
+ type: Number,
1172
+ required: !1
1173
+ },
1174
+ fftSize: {
1175
+ type: Number,
1176
+ required: !1,
1177
+ default: 2048,
1178
+ validator(t) {
1179
+ return t >= 32 && t <= 32768 && ee(t);
1180
+ }
1181
+ },
1182
+ lineColor: {
1183
+ type: String,
1184
+ required: !1
1185
+ }
1186
+ },
1187
+ setup(t) {
1188
+ const e = t, a = pt(e.fftSize, e.input), i = ft();
1189
+ N(() => e.input, a.onInputChanged);
1190
+ const o = kt("analyserCanvas");
1191
+ let n;
1192
+ Ct(() => {
1193
+ n = o.value?.getContext("2d"), i.startRendering(y);
1194
+ }), At(d);
1195
+ const r = b(() => e.height ? e.height : e.width / _e);
1196
+ function d() {
1197
+ a.disposeMetering(e.input);
1198
+ }
1199
+ function y() {
1200
+ let C = a.getFloatTimeDomainData();
1201
+ if (!n || (n.fillStyle = "black", n.fillRect(0, 0, e.width, r.value), !C)) return;
1202
+ n.lineWidth = 2.5, n.strokeStyle = e.lineColor ?? V.colors.primary, n.beginPath();
1203
+ const h = e.width / C.length;
1204
+ let s = 0, f = 0;
1205
+ for (let m = 0; m < C.length; m++) {
1206
+ const p = -C[m] * r.value / 2;
1207
+ f = r.value / 2 + p, m === 0 ? n.moveTo(s, f) : n.lineTo(s, f), s += h;
1208
+ }
1209
+ n.lineTo(e.width, f), n.stroke();
1210
+ }
1211
+ return (C, h) => (k(), x("canvas", {
1212
+ ref_key: "analyserCanvas",
1213
+ ref: o,
1214
+ height: r.value,
1215
+ width: t.width,
1216
+ class: "analyser-canvas"
1217
+ }, null, 8, Ye));
1218
+ }
1219
+ }), Xe = T({
1220
+ Name: "VAToggleButton",
1221
+ props: {
1222
+ color: {
1223
+ required: !1,
1224
+ type: String,
1225
+ default: "red"
1226
+ },
1227
+ label: {
1228
+ require: !1,
1229
+ type: String,
1230
+ default: ""
1231
+ }
1232
+ },
1233
+ setup(t) {
1234
+ const e = g(!1), a = b(() => ({
1235
+ "--on-color": `${t.color}`
1236
+ }));
1237
+ function i() {
1238
+ e.value = !e.value;
1239
+ }
1240
+ return { on: e, cssVars: a, onButtonClick: i };
1241
+ }
1242
+ });
1243
+ function Ze(t, e, a, i, o, n) {
1244
+ return k(), x("button", {
1245
+ onClick: e[0] || (e[0] = (...r) => t.onButtonClick && t.onButtonClick(...r)),
1246
+ class: ut([t.on ? "button-on" : "button-off", "button"]),
1247
+ style: Z(t.cssVars)
1248
+ }, R(t.label), 7);
1249
+ }
1250
+ const je = /* @__PURE__ */ D(Xe, [["render", Ze], ["__scopeId", "data-v-87a8a5ae"]]), Je = T({
1251
+ emits: ["update:modelValue"],
1252
+ props: {
1253
+ modelValue: { type: Object, required: !0 },
1254
+ attackMax: { type: Number, required: !1, default: 1e3 },
1255
+ decayMax: { type: Number, required: !1, default: 1e3 },
1256
+ releaseMax: { type: Number, required: !1, default: 1e3 },
1257
+ width: { type: Number, required: !1, default: 200 },
1258
+ height: { type: Number, required: !1 }
1259
+ },
1260
+ setup(t, e) {
1261
+ const a = g("black"), i = g("#70bfff"), o = g("#70bfff"), n = g(4), r = g(16), d = 0.25, y = 0.4, C = 0.1, h = 0.25, s = g(0), f = g(0), m = g(0), p = g(0);
1262
+ let M = 0, $ = 0, A = 0, P = 0;
1263
+ const U = g(0), u = g(0), l = g(0), v = g(0);
1264
+ let B = 0, F = 0, bt = 0, Mt = 0;
1265
+ const mt = g(0), gt = g(0), S = 10, W = g("");
1266
+ let at = -1, St = -1;
1267
+ const Ut = b(() => t.modelValue.attack + t.modelValue.decay + t.modelValue.release), Gt = b(() => t.width), Vt = b(() => t.height ? t.height : t.width / 2.5), j = b(() => Gt.value - S * 2), G = b(() => Vt.value - S * 2), It = b(() => G.value * 1), Y = b(() => d * j.value), J = b(() => Y.value * (t.modelValue.attack / t.attackMax)), _ = b(() => y * j.value), it = b(() => _.value * (t.modelValue.decay / t.decayMax)), rt = b(() => C * j.value), yt = b(() => h * j.value), ot = b(() => yt.value * (t.modelValue.release / t.releaseMax)), Et = b(() => {
1268
+ s.value = S, f.value = G.value + S, m.value = J.value + S, p.value = S, M = J.value + it.value / 4 + S, $ = (G.value - G.value * t.modelValue.sustain) / 2 + S, A = J.value + it.value / 2 + S, P = G.value - G.value * t.modelValue.sustain + S, U.value = J.value + it.value + S, u.value = G.value - G.value * t.modelValue.sustain + S, l.value = Y.value + _.value + rt.value, v.value = G.value - G.value * t.modelValue.sustain + S, B = Y.value + _.value + rt.value + ot.value / 4, F = G.value - G.value * t.modelValue.sustain / 2 + S, bt = Y.value + _.value + rt.value + ot.value / 2, Mt = G.value + S, mt.value = l.value + ot.value, gt.value = G.value + S;
1269
+ const w = `M ${s.value} ${f.value} `, nt = `L ${m.value} ${p.value} `, O = `C
1270
+ ${M}
1271
+ ${$}
1272
+ ${A}
1273
+ ${P}
1274
+ ${U.value}
1275
+ ${u.value}`, st = `L ${l.value} ${v.value}`, I = `C
1276
+ ${B}
1277
+ ${F}
1278
+ ${bt}
1279
+ ${Mt}
1280
+ ${mt.value}
1281
+ ${gt.value}`;
1282
+ return w + nt + O + st + I;
1283
+ });
1284
+ function Wt(w) {
1285
+ w.preventDefault ? w.preventDefault() : w.returnValue = !1, W.value = "attackAnchor";
1286
+ }
1287
+ function Ot(w) {
1288
+ w.preventDefault ? w.preventDefault() : w.returnValue = !1, W.value = "decaySustainAnchor";
1289
+ }
1290
+ function qt(w) {
1291
+ w.preventDefault ? w.preventDefault() : w.returnValue = !1, W.value = "releaseAnchor";
1292
+ }
1293
+ function vt(w, nt) {
1294
+ let O, st, I = 0, q = 0, L = 0, z = 0;
1295
+ if (W.value != "") {
1296
+ switch (W.value) {
1297
+ case "attackAnchor":
1298
+ O = w - at, I = O / Y.value * t.attackMax, I = t.modelValue.attack + I >= t.attackMax && I > 0 ? t.attackMax - t.modelValue.attack : t.modelValue.attack + I <= 0 && I < 0 ? 0 : I;
1299
+ break;
1300
+ case "decaySustainAnchor":
1301
+ O = w - at, q = O / _.value * t.decayMax, q = t.modelValue.decay + q >= t.decayMax && q > 0 ? t.decayMax - t.modelValue.decay : t.modelValue.decay + q <= 0 && q < 0 ? 0 : q, st = nt - St, L = -(st / G.value), L = t.modelValue.sustain + L >= 1 && L > 0 ? 1 - t.modelValue.sustain : t.modelValue.sustain + L <= 0 && L < 0 ? 0 : L;
1302
+ break;
1303
+ case "releaseAnchor":
1304
+ O = w - at, z = O / yt.value * t.releaseMax, z = t.modelValue.release + z >= t.releaseMax && z > 0 ? t.releaseMax - t.modelValue.release : t.modelValue.release + z <= 0 && z < 0 ? 0 : z;
1305
+ break;
1306
+ }
1307
+ e.emit("update:modelValue", {
1308
+ attack: t.modelValue.attack + I,
1309
+ decay: t.modelValue.decay + q,
1310
+ sustain: t.modelValue.sustain + L,
1311
+ release: t.modelValue.release + z
1312
+ });
1313
+ }
1314
+ at = w, St = nt;
1315
+ }
1316
+ function Lt(w) {
1317
+ vt(w.pageX, w.pageY);
1318
+ }
1319
+ function zt(w) {
1320
+ w.touches[0] && vt(w.touches[0].pageX, w.touches[0].pageY);
1321
+ }
1322
+ function Rt() {
1323
+ W.value = "";
1324
+ }
1325
+ function Nt() {
1326
+ W.value = "";
1327
+ }
1328
+ return {
1329
+ backgroundColor: a,
1330
+ envelopeColor: i,
1331
+ anchorColor: o,
1332
+ anchorRadius: n,
1333
+ ghostAnchorRadius: r,
1334
+ activeAnchorId: W,
1335
+ startX: s,
1336
+ startY: f,
1337
+ attackPeakX: m,
1338
+ attackPeakY: p,
1339
+ decayEndX: U,
1340
+ decayEndY: u,
1341
+ releaseEndX: mt,
1342
+ releaseEndY: gt,
1343
+ envTime: Ut,
1344
+ containerWidth: Gt,
1345
+ containerHeight: Vt,
1346
+ graphWidth: j,
1347
+ graphHeight: G,
1348
+ envHeight: It,
1349
+ attackTotalWidth: Y,
1350
+ attackWidth: J,
1351
+ decayTotalWidth: _,
1352
+ decayWidth: it,
1353
+ sustainTotalWidth: rt,
1354
+ releaseTotalWidth: yt,
1355
+ releaseWidth: ot,
1356
+ adsrPath: Et,
1357
+ attackAnchorMouseDown: Wt,
1358
+ decaySustainAnchorMouseDown: Ot,
1359
+ releaseAnchorMouseDown: qt,
1360
+ onMouseUp: Rt,
1361
+ onMouseLeave: Nt,
1362
+ onMove: vt,
1363
+ onMouseMove: Lt,
1364
+ onTouchMove: zt
1365
+ };
1366
+ }
1367
+ }), Qe = { class: "component-container" }, ta = ["width", "height"], ea = ["width", "height"], aa = ["width", "height", "fill"], ia = ["d", "stroke"], ra = ["cx", "cy", "r", "stroke", "fill"], oa = ["cx", "cy", "r"], na = ["cx", "cy", "r", "stroke", "fill"], sa = ["cx", "cy", "r"], la = ["cx", "cy", "r", "stroke", "fill"], da = ["cx", "cy", "r"], ha = ["cx", "cy", "r", "stroke", "fill"], ca = { class: "value-label-container" }, ua = { class: "value-label" }, pa = { class: "value-label" }, fa = { class: "value-label" }, ma = { class: "value-label" };
1368
+ function ga(t, e, a, i, o, n) {
1369
+ return k(), x("div", Qe, [
1370
+ c("div", {
1371
+ class: ut(["graph-container", t.activeAnchorId !== "" ? "dragging" : ""]),
1372
+ onMousemove: e[12] || (e[12] = (...r) => t.onMouseMove && t.onMouseMove(...r)),
1373
+ onTouchmove: e[13] || (e[13] = (...r) => t.onTouchMove && t.onTouchMove(...r)),
1374
+ onMouseup: e[14] || (e[14] = (...r) => t.onMouseUp && t.onMouseUp(...r)),
1375
+ onTouchend: e[15] || (e[15] = (...r) => t.onMouseUp && t.onMouseUp(...r)),
1376
+ onMouseleave: e[16] || (e[16] = (...r) => t.onMouseLeave && t.onMouseLeave(...r)),
1377
+ width: t.containerWidth,
1378
+ height: t.containerHeight
1379
+ }, [
1380
+ (k(), x("svg", {
1381
+ width: t.containerWidth,
1382
+ height: t.containerHeight
1383
+ }, [
1384
+ c("rect", {
1385
+ width: t.containerWidth,
1386
+ height: t.containerHeight,
1387
+ fill: t.backgroundColor
1388
+ }, null, 8, aa),
1389
+ c("path", {
1390
+ id: "envPath",
1391
+ d: t.adsrPath,
1392
+ fill: "transparent",
1393
+ stroke: t.envelopeColor,
1394
+ "stroke-width": "2"
1395
+ }, null, 8, ia),
1396
+ c("circle", {
1397
+ class: "anchor",
1398
+ cx: t.startX,
1399
+ cy: t.startY,
1400
+ r: t.anchorRadius,
1401
+ stroke: t.anchorColor,
1402
+ fill: t.anchorColor
1403
+ }, null, 8, ra),
1404
+ c("circle", {
1405
+ class: "anchor",
1406
+ id: "attackAnchorGhost",
1407
+ onMousedown: e[0] || (e[0] = (...r) => t.attackAnchorMouseDown && t.attackAnchorMouseDown(...r)),
1408
+ onTouchstart: e[1] || (e[1] = (...r) => t.attackAnchorMouseDown && t.attackAnchorMouseDown(...r)),
1409
+ cx: t.attackPeakX,
1410
+ cy: t.attackPeakY,
1411
+ r: t.ghostAnchorRadius,
1412
+ stroke: "rgba(0, 0, 0, 0)",
1413
+ fill: "rgba(0, 0, 0, 0)"
1414
+ }, null, 40, oa),
1415
+ c("circle", {
1416
+ class: "anchor",
1417
+ id: "attackAnchor",
1418
+ onMousedown: e[2] || (e[2] = (...r) => t.attackAnchorMouseDown && t.attackAnchorMouseDown(...r)),
1419
+ onTouchstart: e[3] || (e[3] = (...r) => t.attackAnchorMouseDown && t.attackAnchorMouseDown(...r)),
1420
+ cx: t.attackPeakX,
1421
+ cy: t.attackPeakY,
1422
+ r: t.anchorRadius,
1423
+ stroke: t.anchorColor,
1424
+ fill: t.anchorColor
1425
+ }, null, 40, na),
1426
+ c("circle", {
1427
+ class: "anchor",
1428
+ id: "decaySustainAnchorGhost",
1429
+ onMousedown: e[4] || (e[4] = (...r) => t.decaySustainAnchorMouseDown && t.decaySustainAnchorMouseDown(...r)),
1430
+ onTouchstart: e[5] || (e[5] = (...r) => t.decaySustainAnchorMouseDown && t.decaySustainAnchorMouseDown(...r)),
1431
+ cx: t.decayEndX,
1432
+ cy: t.decayEndY,
1433
+ r: t.ghostAnchorRadius,
1434
+ stroke: "rgba(0, 0, 0, 0)",
1435
+ fill: "rgba(0, 0, 0, 0)"
1436
+ }, null, 40, sa),
1437
+ c("circle", {
1438
+ class: "anchor",
1439
+ id: "decaySustainAnchor",
1440
+ onMousedown: e[6] || (e[6] = (...r) => t.decaySustainAnchorMouseDown && t.decaySustainAnchorMouseDown(...r)),
1441
+ onTouchstart: e[7] || (e[7] = (...r) => t.decaySustainAnchorMouseDown && t.decaySustainAnchorMouseDown(...r)),
1442
+ cx: t.decayEndX,
1443
+ cy: t.decayEndY,
1444
+ r: t.anchorRadius,
1445
+ stroke: t.anchorColor,
1446
+ fill: t.anchorColor
1447
+ }, null, 40, la),
1448
+ c("circle", {
1449
+ class: "anchor",
1450
+ id: "releaseAnchorGhost",
1451
+ onMousedown: e[8] || (e[8] = (...r) => t.releaseAnchorMouseDown && t.releaseAnchorMouseDown(...r)),
1452
+ onTouchstart: e[9] || (e[9] = (...r) => t.releaseAnchorMouseDown && t.releaseAnchorMouseDown(...r)),
1453
+ cx: t.releaseEndX,
1454
+ cy: t.releaseEndY,
1455
+ r: t.ghostAnchorRadius,
1456
+ stroke: "rgba(0, 0, 0, 0)",
1457
+ fill: "rgba(0, 0, 0, 0)"
1458
+ }, null, 40, da),
1459
+ c("circle", {
1460
+ class: "anchor",
1461
+ id: "releaseAnchor",
1462
+ onMousedown: e[10] || (e[10] = (...r) => t.releaseAnchorMouseDown && t.releaseAnchorMouseDown(...r)),
1463
+ onTouchstart: e[11] || (e[11] = (...r) => t.releaseAnchorMouseDown && t.releaseAnchorMouseDown(...r)),
1464
+ cx: t.releaseEndX,
1465
+ cy: t.releaseEndY,
1466
+ r: t.anchorRadius,
1467
+ stroke: t.anchorColor,
1468
+ fill: t.anchorColor
1469
+ }, null, 40, ha)
1470
+ ], 8, ea)),
1471
+ c("div", ca, [
1472
+ c("div", ua, R(Math.round(t.modelValue.attack)) + " ms", 1),
1473
+ c("div", pa, R(Math.round(t.modelValue.decay)) + " ms", 1),
1474
+ c("div", fa, R(t.modelValue.sustain.toFixed(2)), 1),
1475
+ c("div", ma, R(Math.round(t.modelValue.release)) + " ms", 1)
1476
+ ])
1477
+ ], 42, ta)
1478
+ ]);
1479
+ }
1480
+ const ya = /* @__PURE__ */ D(Je, [["render", ga], ["__scopeId", "data-v-f87b5263"]]), va = {
1481
+ width: "8",
1482
+ height: "12",
1483
+ viewBox: "0 0 8 12",
1484
+ "aria-hidden": "true",
1485
+ class: "num-trianlge"
1486
+ }, xa = ["fill"], ka = {
1487
+ key: 0,
1488
+ class: "num-value"
1489
+ }, wa = ["min", "max"], Ca = 90, ba = /* @__PURE__ */ T({
1490
+ __name: "v-a-num-box",
1491
+ props: {
1492
+ modelValue: {
1493
+ required: !0,
1494
+ type: Number
1495
+ },
1496
+ minValue: {
1497
+ type: Number,
1498
+ required: !1,
1499
+ default: 0
1500
+ },
1501
+ maxValue: {
1502
+ type: Number,
1503
+ required: !1,
1504
+ default: 99
1505
+ },
1506
+ fixedDecimals: {
1507
+ type: Number,
1508
+ required: !1,
1509
+ default: 0
1510
+ },
1511
+ showBorder: {
1512
+ type: Boolean,
1513
+ required: !1,
1514
+ default: !0
1515
+ },
1516
+ width: {
1517
+ type: Number,
1518
+ required: !1
1519
+ }
1520
+ },
1521
+ emits: ["update:modelValue"],
1522
+ setup(t, { emit: e }) {
1523
+ const a = e, i = t, o = g(!1), n = g(!1), r = g(i.modelValue), d = kt("manualInputEl"), y = kt("numBox");
1524
+ let C = -1;
1525
+ const h = b(() => o.value ? V.colors.primary : V.colors.secondary), s = b(() => ({
1526
+ "--border-color": `${V.colors.secondary}`,
1527
+ "--numbox-width": i.width ? `${i.width}px` : "auto"
1528
+ })), f = b(() => i.maxValue - i.minValue);
1529
+ N(() => i.modelValue, (v) => r.value = v);
1530
+ function m() {
1531
+ n.value = !0, r.value = i.modelValue, Yt().then(() => {
1532
+ d.value?.select(), document.addEventListener("mouseup", p);
1533
+ });
1534
+ }
1535
+ function p(v) {
1536
+ y.value.contains(v.target) || $();
1537
+ }
1538
+ function M(v) {
1539
+ v.key === "Enter" && $();
1540
+ }
1541
+ function $() {
1542
+ a(
1543
+ "update:modelValue",
1544
+ H(
1545
+ $t(r.value, i.fixedDecimals),
1546
+ i.minValue,
1547
+ i.maxValue
1548
+ )
1549
+ ), n.value = !1, document.removeEventListener("mouseup", p);
1550
+ }
1551
+ function A(v) {
1552
+ n.value || (v.preventDefault(), document.addEventListener("mousemove", l), document.addEventListener("touchmove", u), document.addEventListener("mouseup", P), document.addEventListener("touchend", P));
1553
+ }
1554
+ function P() {
1555
+ o.value = !1, document.removeEventListener("mousemove", l), document.removeEventListener("touchmove", u), document.removeEventListener("mouseup", P), document.removeEventListener("touchend", P), C = -1;
1556
+ }
1557
+ function U(v) {
1558
+ if (o.value = !0, C >= 0) {
1559
+ const B = C - v, F = H(
1560
+ i.modelValue + B / Ca * (f.value / 2),
1561
+ i.minValue,
1562
+ i.maxValue
1563
+ );
1564
+ a("update:modelValue", $t(F, i.fixedDecimals));
1565
+ }
1566
+ }
1567
+ function u(v) {
1568
+ v.touches[0] && (U(v.touches[0].pageY), C = v.touches[0].pageY);
1569
+ }
1570
+ function l(v) {
1571
+ U(v.pageY), C = v.pageY;
1572
+ }
1573
+ return (v, B) => (k(), x("div", {
1574
+ ref_key: "numBox",
1575
+ ref: y,
1576
+ class: ut(["numbox", { "show-border": t.showBorder }]),
1577
+ style: Z(s.value),
1578
+ onMousedown: A,
1579
+ onDblclick: m
1580
+ }, [
1581
+ (k(), x("svg", va, [
1582
+ c("polygon", {
1583
+ points: "0,0 0,12 8,6",
1584
+ fill: h.value
1585
+ }, null, 8, xa)
1586
+ ])),
1587
+ n.value ? Dt("", !0) : (k(), x("span", ka, R(t.modelValue), 1)),
1588
+ n.value ? Ht((k(), x("input", {
1589
+ key: 1,
1590
+ id: "manualInputEl",
1591
+ ref_key: "manualInputEl",
1592
+ ref: d,
1593
+ type: "number",
1594
+ min: t.minValue,
1595
+ max: t.maxValue,
1596
+ "onUpdate:modelValue": B[0] || (B[0] = (F) => r.value = F),
1597
+ onKeydown: M
1598
+ }, null, 40, wa)), [
1599
+ [Ft, r.value]
1600
+ ]) : Dt("", !0)
1601
+ ], 38));
1602
+ }
1603
+ }), Ma = /* @__PURE__ */ D(ba, [["__scopeId", "data-v-41e990e3"]]);
1604
+ class Sa {
1605
+ _minusInputMin;
1606
+ _plusOutputMin;
1607
+ _dividedByInputRange;
1608
+ _multipliedByOutputRange;
1609
+ input;
1610
+ output;
1611
+ constructor(e, a, i, o, n, r) {
1612
+ this._minusInputMin = new ConstantSourceNode(e, { offset: -a }), this._dividedByInputRange = new GainNode(e, { gain: 1 / (i - a) }), this._multipliedByOutputRange = new GainNode(e, { gain: n - o }), this._plusOutputMin = new ConstantSourceNode(e, { offset: o }), this._minusInputMin.start(), this._plusOutputMin.start(), this.input = new GainNode(e, { gain: 1 }), this.output = new GainNode(e, { gain: 1 }), this._minusInputMin.connect(this.input), this.input.connect(this._dividedByInputRange), this._dividedByInputRange.connect(this._multipliedByOutputRange), this._multipliedByOutputRange.connect(this.output), this._plusOutputMin.connect(this.output), r && this.output.connect(r);
1613
+ }
1614
+ dispose() {
1615
+ this._minusInputMin.stop(), this._plusOutputMin.stop(), this._minusInputMin.disconnect(), this._plusOutputMin.disconnect(), this._dividedByInputRange.disconnect(), this._multipliedByOutputRange.disconnect(), this.input.disconnect(), this.output.disconnect();
1616
+ }
1617
+ }
1618
+ class Ga {
1619
+ _minusInputMin;
1620
+ _dividedByInputRange;
1621
+ input;
1622
+ output;
1623
+ constructor(e, a, i, o) {
1624
+ this._minusInputMin = new ConstantSourceNode(e, { offset: -a }), this._dividedByInputRange = new GainNode(e, { gain: 1 / (i - a) }), this._minusInputMin.start(), this.input = new GainNode(e, { gain: 1 }), this.output = new GainNode(e, { gain: 1 }), this._minusInputMin.connect(this.input), this.input.connect(this._dividedByInputRange), this.output = this._dividedByInputRange;
1625
+ }
1626
+ dispose() {
1627
+ this._minusInputMin.stop(), this._minusInputMin.disconnect(), this._dividedByInputRange.disconnect(), this.input.disconnect(), this.output.disconnect();
1628
+ }
1629
+ }
1630
+ const Va = { class: "matrix-row header" }, Da = { class: "matrix-cell source-label" }, $a = /* @__PURE__ */ T({
1631
+ __name: "v-a-mod-matrix",
1632
+ props: {
1633
+ sources: {
1634
+ type: Array,
1635
+ required: !0
1636
+ },
1637
+ destinations: {
1638
+ type: Array,
1639
+ required: !0
1640
+ },
1641
+ loggerNode: {
1642
+ type: AudioNode,
1643
+ required: !1
1644
+ }
1645
+ },
1646
+ setup(t) {
1647
+ const e = t, a = g(), i = g([]);
1648
+ let o = [];
1649
+ N(() => e.sources, (h, s) => {
1650
+ C(s, e.destinations), y(h, e.destinations);
1651
+ }), N(() => e.destinations, (h, s) => {
1652
+ C(e.sources), y(e.sources, h);
1653
+ });
1654
+ function n(h, s) {
1655
+ h.modAmountNode.gain.setValueAtTime(s, a.value.currentTime);
1656
+ }
1657
+ function r(h, s) {
1658
+ s.ratioSum = new GainNode(h, { gain: 1 }), s.sourceCells.forEach(((f) => {
1659
+ s.ratioSum && f.modAmountNode.connect(s.ratioSum);
1660
+ })), s.clamper = new WaveShaperNode(h, { curve: [0, 0, 1] }), s.ratioSum.connect(s.clamper), s.outputScaler = new Sa(h, 0, 1, s.destination.minValue, s.destination.maxValue), s.clamper.connect(s.outputScaler.input), s.output = s.outputScaler.output, (s.destination.node instanceof AudioParam || s.destination.node instanceof AudioNode) && s.output.connect(s.destination.node);
1661
+ }
1662
+ function d(h) {
1663
+ h.sourceCells.forEach((s) => {
1664
+ s.modAmountNode.disconnect();
1665
+ }), h.ratioSum?.disconnect(), h.ratioSum = void 0, h.clamper?.disconnect(), h.clamper = void 0;
1666
+ }
1667
+ function y(h, s) {
1668
+ if (h.length > 0 && (a.value = h[0]?.node.context), !a.value)
1669
+ return;
1670
+ const f = a.value, m = [];
1671
+ h.forEach((p) => {
1672
+ const M = [];
1673
+ s.forEach((A) => {
1674
+ const P = new GainNode(f, { gain: 0 }), U = new Ga(f, p.minValue, p.maxValue);
1675
+ p.node.connect(U.input), U.output.connect(P);
1676
+ const u = {
1677
+ modAmountValue: 0,
1678
+ modAmountNode: P,
1679
+ signalToRatioConverter: U,
1680
+ source: p,
1681
+ destination: A
1682
+ };
1683
+ M.push(u), m.push(u);
1684
+ }), i.value.push(M);
1685
+ }), s.forEach((p) => {
1686
+ const M = {
1687
+ destination: p,
1688
+ sourceCells: m.filter(($) => $.destination === p)
1689
+ };
1690
+ r(f, M), o.push(M);
1691
+ });
1692
+ }
1693
+ function C(h, s) {
1694
+ h.forEach((f) => {
1695
+ i.value.shift()?.forEach((p) => {
1696
+ p.source.node.disconnect(p.signalToRatioConverter.input), p.signalToRatioConverter.dispose(), p.modAmountNode.disconnect();
1697
+ });
1698
+ }), i.value = [], o.forEach((f) => {
1699
+ d(f);
1700
+ }), o = [];
1701
+ }
1702
+ return (h, s) => {
1703
+ const f = et("v-a-num-box");
1704
+ return k(), x("div", null, [
1705
+ c("div", Va, [
1706
+ s[0] || (s[0] = c("div", { class: "matrix-cell source-label" }, null, -1)),
1707
+ (k(!0), x(lt, null, dt(t.destinations, (m, p) => (k(), x("div", {
1708
+ class: "matrix-cell destination-label",
1709
+ key: `header-${p}`
1710
+ }, R(m.name), 1))), 128))
1711
+ ]),
1712
+ (k(!0), x(lt, null, dt(i.value, (m, p) => (k(), x("div", {
1713
+ class: "matrix-row",
1714
+ key: `src-${p}`
1715
+ }, [
1716
+ c("div", Da, R(m[0]?.source.name), 1),
1717
+ (k(!0), x(lt, null, dt(m, (M, $) => (k(), x("div", {
1718
+ class: "matrix-cell",
1719
+ key: `dest-${$}`
1720
+ }, [
1721
+ X(f, {
1722
+ minValue: 0,
1723
+ maxValue: 1,
1724
+ "onUpdate:modelValue": [(A) => n(M, A), (A) => M.modAmountValue = A],
1725
+ modelValue: M.modAmountValue,
1726
+ fixedDecimals: 2,
1727
+ width: 60
1728
+ }, null, 8, ["onUpdate:modelValue", "modelValue"])
1729
+ ]))), 128))
1730
+ ]))), 128))
1731
+ ]);
1732
+ };
1733
+ }
1734
+ }), Aa = /* @__PURE__ */ D($a, [["__scopeId", "data-v-c8b43eec"]]), K = g(!1), Pa = T({
1735
+ emits: [
1736
+ "keySlideOn",
1737
+ "keySlideOff",
1738
+ "keyMouseDown",
1739
+ "keyMouseUp",
1740
+ "keyboardKeyDown",
1741
+ "keyboardKeyUp"
1742
+ ],
1743
+ props: {
1744
+ disabled: { type: Boolean, required: !1, default: !1 },
1745
+ enableKeyControls: { type: Boolean, required: !1, default: !0 },
1746
+ startingOctave: { type: Number, required: !1, default: 3 },
1747
+ numOctaves: { type: Number, required: !1, default: 2 },
1748
+ enableKeyboardControls: { type: Boolean, required: !1, default: !0 }
1749
+ },
1750
+ setup(t, e) {
1751
+ const a = "#ff2929", i = [1, 3, 6, 8, 10], o = [
1752
+ "KeyA",
1753
+ "KeyW",
1754
+ "KeyS",
1755
+ "KeyE",
1756
+ "KeyD",
1757
+ "KeyF",
1758
+ "KeyT",
1759
+ "KeyG",
1760
+ "KeyY",
1761
+ "KeyH",
1762
+ "KeyU",
1763
+ "KeyJ",
1764
+ "KeyK",
1765
+ "KeyO",
1766
+ "KeyL"
1767
+ ];
1768
+ let n = t.startingOctave * 12;
1769
+ function r(u) {
1770
+ const l = o.findIndex((v) => v === u.code);
1771
+ if (l > -1) {
1772
+ const v = l + n;
1773
+ y(v), e.emit("keyboardKeyDown", v);
1774
+ }
1775
+ }
1776
+ function d(u) {
1777
+ const l = o.findIndex((v) => v === u.code);
1778
+ if (l > -1) {
1779
+ const v = l + n;
1780
+ C(v), e.emit("keyboardKeyUp", v);
1781
+ } else u.code === "KeyZ" ? n -= 12 : u.code === "KeyX" ? n += 12 : u.code === "KeyC" || u.code;
1782
+ }
1783
+ function y(u) {
1784
+ const l = document.querySelector(`#key${u}`);
1785
+ l != null && (l.style.background = a);
1786
+ }
1787
+ function C(u) {
1788
+ const l = document.querySelector(`#key${u}`);
1789
+ l != null && (l.style.background = i.includes(u % 12) ? "black" : "white");
1790
+ }
1791
+ function h(u) {
1792
+ const l = u.target;
1793
+ return parseInt(l.id.replace("key", ""));
1794
+ }
1795
+ function s(u) {
1796
+ if (!K.value) return;
1797
+ const l = h(u);
1798
+ u.stopPropagation(), t.disabled || (y(l), e.emit("keySlideOn", l));
1799
+ }
1800
+ function f(u) {
1801
+ if (!K.value) return;
1802
+ u.stopPropagation();
1803
+ const l = h(u);
1804
+ t.disabled || (C(l), e.emit("keySlideOff", l));
1805
+ }
1806
+ function m(u) {
1807
+ u.stopPropagation(), K.value = !0;
1808
+ const l = h(u);
1809
+ t.disabled || (y(l), e.emit("keyMouseDown", l));
1810
+ }
1811
+ function p(u) {
1812
+ u.stopPropagation(), K.value = !1;
1813
+ const l = h(u);
1814
+ t.disabled || (C(l), e.emit("keyMouseUp", h(u)));
1815
+ }
1816
+ function M() {
1817
+ K.value = !0;
1818
+ }
1819
+ function $() {
1820
+ K.value = !1;
1821
+ }
1822
+ function A() {
1823
+ document.addEventListener("mousedown", M), document.addEventListener("mouseup", $), document.addEventListener("keydown", r), document.addEventListener("keyup", d);
1824
+ const u = document.querySelectorAll(
1825
+ "div.keyboard div.key, div.keyboard div.black-key"
1826
+ );
1827
+ for (const l of u)
1828
+ l.addEventListener("mousedown", m), l.addEventListener("mouseup", p), l.addEventListener("mouseover", s), l.addEventListener("mouseout", f), l.addEventListener("touchstart", m), l.addEventListener("touchend", p);
1829
+ }
1830
+ function P() {
1831
+ document.removeEventListener("mousedown", M), document.removeEventListener("mouseup", $), document.removeEventListener("keydown", r), document.removeEventListener("keyup", d);
1832
+ const u = document.querySelectorAll(
1833
+ "div.keyboard div.key, div.keyboard div.black-key"
1834
+ );
1835
+ for (const l of u)
1836
+ l.removeEventListener("mousedown", m), l.removeEventListener("mouseup", p), l.removeEventListener("mouseover", s), l.removeEventListener("mouseout", f), l.removeEventListener("touchstart", m), l.removeEventListener("touchend", p);
1837
+ }
1838
+ function U() {
1839
+ P(), A();
1840
+ }
1841
+ Ct(() => {
1842
+ A();
1843
+ }), _t(() => {
1844
+ P();
1845
+ }), N(() => t.numOctaves, U);
1846
+ }
1847
+ }), Ta = ["id"], Ua = ["id"], Ia = ["id"], Ea = ["id"], Wa = ["id"], Oa = ["id"], qa = ["id"], La = ["id"], za = ["id"], Ra = ["id"], Na = ["id"], Ba = ["id"];
1848
+ function Ha(t, e, a, i, o, n) {
1849
+ return k(), x("div", {
1850
+ class: ut(["keyboard", t.disabled ? "disabled" : ""])
1851
+ }, [
1852
+ (k(!0), x(lt, null, dt(t.numOctaves, (r) => (k(), x("div", {
1853
+ key: r,
1854
+ class: "octave-section"
1855
+ }, [
1856
+ c("div", {
1857
+ id: `key${t.startingOctave * 12 + (r - 1) * 12 + 0}`,
1858
+ class: "key"
1859
+ }, [
1860
+ c("div", {
1861
+ id: `key${t.startingOctave * 12 + (r - 1) * 12 + 1}`,
1862
+ class: "black-key"
1863
+ }, null, 8, Ua)
1864
+ ], 8, Ta),
1865
+ c("div", {
1866
+ id: `key${t.startingOctave * 12 + (r - 1) * 12 + 2}`,
1867
+ class: "key"
1868
+ }, [
1869
+ c("div", {
1870
+ id: `key${t.startingOctave * 12 + (r - 1) * 12 + 3}`,
1871
+ class: "black-key"
1872
+ }, null, 8, Ea)
1873
+ ], 8, Ia),
1874
+ c("div", {
1875
+ id: `key${t.startingOctave * 12 + (r - 1) * 12 + 4}`,
1876
+ class: "key"
1877
+ }, null, 8, Wa),
1878
+ c("div", {
1879
+ id: `key${t.startingOctave * 12 + (r - 1) * 12 + 5}`,
1880
+ class: "key"
1881
+ }, [
1882
+ c("div", {
1883
+ id: `key${t.startingOctave * 12 + (r - 1) * 12 + 6}`,
1884
+ class: "black-key"
1885
+ }, null, 8, qa)
1886
+ ], 8, Oa),
1887
+ c("div", {
1888
+ id: `key${t.startingOctave * 12 + (r - 1) * 12 + 7}`,
1889
+ class: "key"
1890
+ }, [
1891
+ c("div", {
1892
+ id: `key${t.startingOctave * 12 + (r - 1) * 12 + 8}`,
1893
+ class: "black-key"
1894
+ }, null, 8, za)
1895
+ ], 8, La),
1896
+ c("div", {
1897
+ id: `key${t.startingOctave * 12 + (r - 1) * 12 + 9}`,
1898
+ class: "key"
1899
+ }, [
1900
+ c("div", {
1901
+ id: `key${t.startingOctave * 12 + (r - 1) * 12 + 10}`,
1902
+ class: "black-key"
1903
+ }, null, 8, Na)
1904
+ ], 8, Ra),
1905
+ c("div", {
1906
+ id: `key${t.startingOctave * 12 + (r - 1) * 12 + 11}`,
1907
+ class: "key"
1908
+ }, null, 8, Ba)
1909
+ ]))), 128))
1910
+ ], 2);
1911
+ }
1912
+ const Fa = /* @__PURE__ */ D(Pa, [["render", Ha], ["__scopeId", "data-v-25deb579"]]), Ya = {
1913
+ // test,
1914
+ VAAnalogMeter: Qt,
1915
+ VAAudioFileVisualizer: he,
1916
+ VADigitalMeterStereo: fe,
1917
+ VADigitalMeter: xe,
1918
+ VAFader: Pe,
1919
+ VAKnob: ze,
1920
+ VASpectrumAnalyzer: Fe,
1921
+ VAOscilloscope: Ke,
1922
+ VAToggleButton: je,
1923
+ VAEnvelopeAdsr: ya,
1924
+ VANumBox: Ma,
1925
+ VAModMatrix: Aa,
1926
+ VAPiano: Fa
1927
+ }, Ka = function(e) {
1928
+ Object.entries(Ya).forEach(([a, i]) => {
1929
+ e.component(a, i);
1930
+ });
1931
+ };
1932
+ export {
1933
+ Qt as VAAnalogMeter,
1934
+ he as VAAudioFileVisualizer,
1935
+ xe as VADigitalMeter,
1936
+ fe as VADigitalMeterStereo,
1937
+ ya as VAEnvelopeAdsr,
1938
+ Pe as VAFader,
1939
+ ze as VAKnob,
1940
+ Aa as VAModMatrix,
1941
+ Ma as VANumBox,
1942
+ Ke as VAOscilloscope,
1943
+ Fa as VAPiano,
1944
+ Fe as VASpectrumAnalyzer,
1945
+ je as VAToggleButton,
1946
+ Ka as default,
1947
+ V as vueAudioUITheme
1948
+ };