chordsheetjs 7.0.0 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/lib/bundle.js +498 -559
- package/lib/index.js +498 -559
- package/lib/index.js.map +1 -1
- package/lib/main.d.ts +4 -5
- package/lib/main.d.ts.map +1 -1
- package/package.json +4 -4
package/lib/index.js
CHANGED
|
@@ -48,7 +48,7 @@ $parcel$export(module.exports, "NUMERIC", () => $af8d31735c159a26$export$4d31898
|
|
|
48
48
|
// https://peggyjs.org/ https://github.com/metadevpro/ts-pegjs
|
|
49
49
|
"use strict";
|
|
50
50
|
function $1a506a341538d943$var$peg$padEnd(str, targetLength, padString) {
|
|
51
|
-
padString = padString ||
|
|
51
|
+
padString = padString || " ";
|
|
52
52
|
if (str.length > targetLength) return str;
|
|
53
53
|
targetLength -= str.length;
|
|
54
54
|
padString += padString.repeat(targetLength);
|
|
@@ -60,19 +60,15 @@ class $1a506a341538d943$export$f21cea08b0dd60e8 extends Error {
|
|
|
60
60
|
return ch.charCodeAt(0).toString(16).toUpperCase();
|
|
61
61
|
}
|
|
62
62
|
function literalEscape(s) {
|
|
63
|
-
return s.replace(/\\/g, "\\\\").replace(/"/g, "
|
|
64
|
-
).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch)=>"\\x" + hex(ch)
|
|
65
|
-
);
|
|
63
|
+
return s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch)=>"\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch)=>"\\x" + hex(ch));
|
|
66
64
|
}
|
|
67
65
|
function classEscape(s) {
|
|
68
|
-
return s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch)=>"\\x0" + hex(ch)
|
|
69
|
-
).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch)=>"\\x" + hex(ch)
|
|
70
|
-
);
|
|
66
|
+
return s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch)=>"\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch)=>"\\x" + hex(ch));
|
|
71
67
|
}
|
|
72
68
|
function describeExpectation(expectation) {
|
|
73
69
|
switch(expectation.type){
|
|
74
70
|
case "literal":
|
|
75
|
-
return "
|
|
71
|
+
return '"' + literalEscape(expectation.text) + '"';
|
|
76
72
|
case "class":
|
|
77
73
|
const escapedParts = expectation.parts.map((part)=>{
|
|
78
74
|
return Array.isArray(part) ? classEscape(part[0]) + "-" + classEscape(part[1]) : classEscape(part);
|
|
@@ -108,7 +104,7 @@ class $1a506a341538d943$export$f21cea08b0dd60e8 extends Error {
|
|
|
108
104
|
}
|
|
109
105
|
}
|
|
110
106
|
function describeFound(found1) {
|
|
111
|
-
return found1 ? "
|
|
107
|
+
return found1 ? '"' + literalEscape(found1) + '"' : "end of input";
|
|
112
108
|
}
|
|
113
109
|
return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
|
|
114
110
|
}
|
|
@@ -124,7 +120,7 @@ class $1a506a341538d943$export$f21cea08b0dd60e8 extends Error {
|
|
|
124
120
|
if (typeof Error.captureStackTrace === "function") Error.captureStackTrace(this, $1a506a341538d943$export$f21cea08b0dd60e8);
|
|
125
121
|
}
|
|
126
122
|
format(sources) {
|
|
127
|
-
let str =
|
|
123
|
+
let str = "Error: " + this.message;
|
|
128
124
|
if (this.location) {
|
|
129
125
|
let src = null;
|
|
130
126
|
let k;
|
|
@@ -133,14 +129,14 @@ class $1a506a341538d943$export$f21cea08b0dd60e8 extends Error {
|
|
|
133
129
|
break;
|
|
134
130
|
}
|
|
135
131
|
let s = this.location.start;
|
|
136
|
-
let loc = this.location.source +
|
|
132
|
+
let loc = this.location.source + ":" + s.line + ":" + s.column;
|
|
137
133
|
if (src) {
|
|
138
134
|
let e = this.location.end;
|
|
139
|
-
let filler = $1a506a341538d943$var$peg$padEnd(
|
|
135
|
+
let filler = $1a506a341538d943$var$peg$padEnd("", s.line.toString().length, " ");
|
|
140
136
|
let line = src[s.line - 1];
|
|
141
137
|
let last = s.line === e.line ? e.column : line.length + 1;
|
|
142
|
-
str +=
|
|
143
|
-
} else str +=
|
|
138
|
+
str += "\n --> " + loc + "\n" + filler + " |\n" + s.line + " | " + line + "\n" + filler + " | " + $1a506a341538d943$var$peg$padEnd("", s.column - 1, " ") + $1a506a341538d943$var$peg$padEnd("", last - s.column, "^");
|
|
139
|
+
} else str += "\n at " + loc;
|
|
144
140
|
}
|
|
145
141
|
return str;
|
|
146
142
|
}
|
|
@@ -171,21 +167,20 @@ function $1a506a341538d943$var$peg$parse(input, options) {
|
|
|
171
167
|
items: [
|
|
172
168
|
lyrics ? {
|
|
173
169
|
type: "chordLyricsPair",
|
|
174
|
-
chords:
|
|
170
|
+
chords: "",
|
|
175
171
|
lyrics: lyrics
|
|
176
172
|
} : null,
|
|
177
173
|
...tokens,
|
|
178
174
|
chords ? {
|
|
179
175
|
type: "chordLyricsPair",
|
|
180
176
|
chords: chords,
|
|
181
|
-
lyrics:
|
|
177
|
+
lyrics: ""
|
|
182
178
|
} : null,
|
|
183
179
|
comment ? {
|
|
184
180
|
type: "comment",
|
|
185
181
|
comment: comment
|
|
186
182
|
} : null
|
|
187
|
-
].filter((x)=>x
|
|
188
|
-
)
|
|
183
|
+
].filter((x)=>x)
|
|
189
184
|
};
|
|
190
185
|
};
|
|
191
186
|
const peg$c3 = "#";
|
|
@@ -201,21 +196,19 @@ function $1a506a341538d943$var$peg$parse(input, options) {
|
|
|
201
196
|
const peg$c8 = function(chords, lyrics) {
|
|
202
197
|
return {
|
|
203
198
|
type: "chordLyricsPair",
|
|
204
|
-
chords: chords ||
|
|
199
|
+
chords: chords || "",
|
|
205
200
|
lyrics: lyrics
|
|
206
201
|
};
|
|
207
202
|
};
|
|
208
203
|
const peg$c9 = function(lyrics) {
|
|
209
|
-
return lyrics.map((c)=>c.char || c
|
|
210
|
-
).join("");
|
|
204
|
+
return lyrics.map((c)=>c.char || c).join("");
|
|
211
205
|
};
|
|
212
206
|
const peg$c10 = "[";
|
|
213
207
|
const peg$c11 = peg$literalExpectation("[", false);
|
|
214
208
|
const peg$c12 = "]";
|
|
215
209
|
const peg$c13 = peg$literalExpectation("]", false);
|
|
216
210
|
const peg$c14 = function(chords) {
|
|
217
|
-
return chords.map((c)=>c.char || c
|
|
218
|
-
).join("");
|
|
211
|
+
return chords.map((c)=>c.char || c).join("");
|
|
219
212
|
};
|
|
220
213
|
const peg$c15 = /^[^\]\r\n]/;
|
|
221
214
|
const peg$c16 = peg$classExpectation([
|
|
@@ -297,7 +290,7 @@ function $1a506a341538d943$var$peg$parse(input, options) {
|
|
|
297
290
|
const peg$c37 = function() {
|
|
298
291
|
return {
|
|
299
292
|
type: "char",
|
|
300
|
-
char: "
|
|
293
|
+
char: "}"
|
|
301
294
|
};
|
|
302
295
|
};
|
|
303
296
|
const peg$c38 = /^[^|[\]\\{}%#\r\n]/;
|
|
@@ -324,7 +317,7 @@ function $1a506a341538d943$var$peg$parse(input, options) {
|
|
|
324
317
|
const peg$c43 = function() {
|
|
325
318
|
return {
|
|
326
319
|
type: "char",
|
|
327
|
-
char: "
|
|
320
|
+
char: "{"
|
|
328
321
|
};
|
|
329
322
|
};
|
|
330
323
|
const peg$c44 = "%";
|
|
@@ -352,8 +345,7 @@ function $1a506a341538d943$var$peg$parse(input, options) {
|
|
|
352
345
|
const peg$c49 = ":";
|
|
353
346
|
const peg$c50 = peg$literalExpectation(":", false);
|
|
354
347
|
const peg$c51 = function(tagValue) {
|
|
355
|
-
return tagValue.map((c)=>c.char || c
|
|
356
|
-
).join('');
|
|
348
|
+
return tagValue.map((c)=>c.char || c).join("");
|
|
357
349
|
};
|
|
358
350
|
const peg$c52 = /^[a-zA-Z\-_]/;
|
|
359
351
|
const peg$c53 = peg$classExpectation([
|
|
@@ -379,7 +371,7 @@ function $1a506a341538d943$var$peg$parse(input, options) {
|
|
|
379
371
|
const peg$c57 = /^[ \t\n\r]/;
|
|
380
372
|
const peg$c58 = peg$classExpectation([
|
|
381
373
|
" ",
|
|
382
|
-
"
|
|
374
|
+
" ",
|
|
383
375
|
"\n",
|
|
384
376
|
"\r"
|
|
385
377
|
], false, false);
|
|
@@ -387,7 +379,7 @@ function $1a506a341538d943$var$peg$parse(input, options) {
|
|
|
387
379
|
const peg$c60 = /^[ \t]/;
|
|
388
380
|
const peg$c61 = peg$classExpectation([
|
|
389
381
|
" ",
|
|
390
|
-
"
|
|
382
|
+
" "
|
|
391
383
|
], false, false);
|
|
392
384
|
const peg$c62 = "\n";
|
|
393
385
|
const peg$c63 = peg$literalExpectation("\n", false);
|
|
@@ -406,7 +398,7 @@ function $1a506a341538d943$var$peg$parse(input, options) {
|
|
|
406
398
|
let peg$silentFails = 0;
|
|
407
399
|
let peg$result;
|
|
408
400
|
if (options.startRule !== undefined) {
|
|
409
|
-
if (!(options.startRule in peg$startRuleFunctions)) throw new Error("Can't start parsing from rule \"" + options.startRule + "
|
|
401
|
+
if (!(options.startRule in peg$startRuleFunctions)) throw new Error("Can't start parsing from rule \"" + options.startRule + '".');
|
|
410
402
|
peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
|
|
411
403
|
}
|
|
412
404
|
function text() {
|
|
@@ -1652,27 +1644,27 @@ class $e1378a714a1834c5$var$Literal {
|
|
|
1652
1644
|
var $e1378a714a1834c5$export$2e2bcd8739ae039 = $e1378a714a1834c5$var$Literal;
|
|
1653
1645
|
|
|
1654
1646
|
|
|
1655
|
-
const $af8d31735c159a26$export$4b194284baed1659 =
|
|
1656
|
-
const $af8d31735c159a26$export$8db6c706fc9142b2 =
|
|
1657
|
-
const $af8d31735c159a26$export$c53d0f541b41b88e =
|
|
1658
|
-
const $af8d31735c159a26$export$c5a6fe907430212e =
|
|
1659
|
-
const $af8d31735c159a26$export$f1c9dd0f5207dd5e =
|
|
1660
|
-
const $af8d31735c159a26$export$27c95a7104c1f7aa =
|
|
1661
|
-
const $af8d31735c159a26$export$4d318981b5a83836 =
|
|
1662
|
-
const $af8d31735c159a26$export$1321df9b16c30c6a =
|
|
1647
|
+
const $af8d31735c159a26$export$4b194284baed1659 = "verse";
|
|
1648
|
+
const $af8d31735c159a26$export$8db6c706fc9142b2 = "chorus";
|
|
1649
|
+
const $af8d31735c159a26$export$c53d0f541b41b88e = "none";
|
|
1650
|
+
const $af8d31735c159a26$export$c5a6fe907430212e = "indeterminate";
|
|
1651
|
+
const $af8d31735c159a26$export$f1c9dd0f5207dd5e = "tab";
|
|
1652
|
+
const $af8d31735c159a26$export$27c95a7104c1f7aa = "symbol";
|
|
1653
|
+
const $af8d31735c159a26$export$4d318981b5a83836 = "numeric";
|
|
1654
|
+
const $af8d31735c159a26$export$1321df9b16c30c6a = "numeral";
|
|
1663
1655
|
const $af8d31735c159a26$export$6145372d252f6576 = [
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1656
|
+
"I",
|
|
1657
|
+
"II",
|
|
1658
|
+
"III",
|
|
1659
|
+
"IV",
|
|
1660
|
+
"V",
|
|
1661
|
+
"VI",
|
|
1662
|
+
"VII"
|
|
1671
1663
|
];
|
|
1672
1664
|
|
|
1673
1665
|
|
|
1674
|
-
const $8fcf445ea0999053$var$A =
|
|
1675
|
-
const $8fcf445ea0999053$var$G =
|
|
1666
|
+
const $8fcf445ea0999053$var$A = "A".charCodeAt(0);
|
|
1667
|
+
const $8fcf445ea0999053$var$G = "G".charCodeAt(0);
|
|
1676
1668
|
const $8fcf445ea0999053$var$TRANSPOSE_DISTANCE_MAJOR = [
|
|
1677
1669
|
null,
|
|
1678
1670
|
0,
|
|
@@ -1703,14 +1695,14 @@ function $8fcf445ea0999053$var$clamp(note, min, max) {
|
|
|
1703
1695
|
return newNote;
|
|
1704
1696
|
}
|
|
1705
1697
|
function $8fcf445ea0999053$var$numeralToNumber(numeral) {
|
|
1706
|
-
for(let i = 0, count = $af8d31735c159a26$export$6145372d252f6576.length; i < count; i += 1){
|
|
1707
|
-
const romanNumeral = $af8d31735c159a26$export$6145372d252f6576[i];
|
|
1698
|
+
for(let i = 0, count = (0, $af8d31735c159a26$export$6145372d252f6576).length; i < count; i += 1){
|
|
1699
|
+
const romanNumeral = (0, $af8d31735c159a26$export$6145372d252f6576)[i];
|
|
1708
1700
|
if (romanNumeral === numeral || romanNumeral.toLowerCase() === numeral) return i + 1;
|
|
1709
1701
|
}
|
|
1710
1702
|
return null;
|
|
1711
1703
|
}
|
|
1712
1704
|
function $8fcf445ea0999053$var$numberToNumeral(number) {
|
|
1713
|
-
return $af8d31735c159a26$export$6145372d252f6576[number - 1];
|
|
1705
|
+
return (0, $af8d31735c159a26$export$6145372d252f6576)[number - 1];
|
|
1714
1706
|
}
|
|
1715
1707
|
class $8fcf445ea0999053$var$Note {
|
|
1716
1708
|
constructor({ note: note , type: type , minor: minor = false }){
|
|
@@ -1721,16 +1713,16 @@ class $8fcf445ea0999053$var$Note {
|
|
|
1721
1713
|
static parse(note) {
|
|
1722
1714
|
if (/^[A-Ga-g]$/.test(note)) return new $8fcf445ea0999053$var$Note({
|
|
1723
1715
|
note: note.toUpperCase(),
|
|
1724
|
-
type: $af8d31735c159a26$export$27c95a7104c1f7aa
|
|
1716
|
+
type: (0, $af8d31735c159a26$export$27c95a7104c1f7aa)
|
|
1725
1717
|
});
|
|
1726
1718
|
if (/^[1-7]$/.test(note)) return new $8fcf445ea0999053$var$Note({
|
|
1727
1719
|
note: parseInt(note, 10),
|
|
1728
|
-
type: $af8d31735c159a26$export$4d318981b5a83836
|
|
1720
|
+
type: (0, $af8d31735c159a26$export$4d318981b5a83836)
|
|
1729
1721
|
});
|
|
1730
1722
|
const romanNumeralValue = $8fcf445ea0999053$var$numeralToNumber(note);
|
|
1731
1723
|
if (romanNumeralValue) return new $8fcf445ea0999053$var$Note({
|
|
1732
1724
|
note: romanNumeralValue,
|
|
1733
|
-
type: $af8d31735c159a26$export$1321df9b16c30c6a,
|
|
1725
|
+
type: (0, $af8d31735c159a26$export$1321df9b16c30c6a),
|
|
1734
1726
|
minor: note.toLowerCase() === note
|
|
1735
1727
|
});
|
|
1736
1728
|
throw new Error(`Invalid note ${note}`);
|
|
@@ -1738,14 +1730,14 @@ class $8fcf445ea0999053$var$Note {
|
|
|
1738
1730
|
toNumeral() {
|
|
1739
1731
|
if (this.isNumeral()) return this.clone();
|
|
1740
1732
|
if (this.isNumeric()) return this.set({
|
|
1741
|
-
type: $af8d31735c159a26$export$1321df9b16c30c6a
|
|
1733
|
+
type: (0, $af8d31735c159a26$export$1321df9b16c30c6a)
|
|
1742
1734
|
});
|
|
1743
1735
|
throw new Error(`Converting a ${this.type} note to numeral is not supported`);
|
|
1744
1736
|
}
|
|
1745
1737
|
toNumeric() {
|
|
1746
1738
|
if (this.isNumeric()) return this.clone();
|
|
1747
1739
|
if (this.isNumeral()) return this.set({
|
|
1748
|
-
type: $af8d31735c159a26$export$4d318981b5a83836
|
|
1740
|
+
type: (0, $af8d31735c159a26$export$4d318981b5a83836)
|
|
1749
1741
|
});
|
|
1750
1742
|
throw new Error(`Converting a ${this.type} note to numeric is not supported`);
|
|
1751
1743
|
}
|
|
@@ -1768,13 +1760,13 @@ class $8fcf445ea0999053$var$Note {
|
|
|
1768
1760
|
return options.includes(this._note);
|
|
1769
1761
|
}
|
|
1770
1762
|
isNumeric() {
|
|
1771
|
-
return this.is($af8d31735c159a26$export$4d318981b5a83836);
|
|
1763
|
+
return this.is((0, $af8d31735c159a26$export$4d318981b5a83836));
|
|
1772
1764
|
}
|
|
1773
1765
|
isChordSymbol() {
|
|
1774
|
-
return this.is($af8d31735c159a26$export$27c95a7104c1f7aa);
|
|
1766
|
+
return this.is((0, $af8d31735c159a26$export$27c95a7104c1f7aa));
|
|
1775
1767
|
}
|
|
1776
1768
|
isNumeral() {
|
|
1777
|
-
return this.is($af8d31735c159a26$export$1321df9b16c30c6a);
|
|
1769
|
+
return this.is((0, $af8d31735c159a26$export$1321df9b16c30c6a));
|
|
1778
1770
|
}
|
|
1779
1771
|
is(noteType) {
|
|
1780
1772
|
return this.type === noteType;
|
|
@@ -1825,121 +1817,121 @@ var $8fcf445ea0999053$export$2e2bcd8739ae039 = $8fcf445ea0999053$var$Note;
|
|
|
1825
1817
|
|
|
1826
1818
|
|
|
1827
1819
|
var $6ebb068142750218$export$2e2bcd8739ae039 = {
|
|
1828
|
-
|
|
1829
|
-
|
|
1820
|
+
"Ab": {
|
|
1821
|
+
"B": "Cb"
|
|
1830
1822
|
},
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1823
|
+
"Cb": {
|
|
1824
|
+
"B": "Cb",
|
|
1825
|
+
"A#": "Bb",
|
|
1826
|
+
"E": "Fb"
|
|
1835
1827
|
},
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1828
|
+
"C": {
|
|
1829
|
+
"C#": "Db",
|
|
1830
|
+
"D#": "Eb",
|
|
1831
|
+
"F#": "Gb",
|
|
1832
|
+
"G#": "Ab",
|
|
1833
|
+
"A#": "Bb"
|
|
1842
1834
|
},
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1835
|
+
"C#": {
|
|
1836
|
+
"D#": "Eb",
|
|
1837
|
+
"A#": "Bb"
|
|
1846
1838
|
},
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1839
|
+
"Db": {
|
|
1840
|
+
"B": "Cb",
|
|
1841
|
+
"F#": "Gb"
|
|
1850
1842
|
},
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1843
|
+
"D": {
|
|
1844
|
+
"D#": "Eb",
|
|
1845
|
+
"A#": "Bb"
|
|
1854
1846
|
},
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1847
|
+
"E": {
|
|
1848
|
+
"Ab": "G#",
|
|
1849
|
+
"A#": "Bb",
|
|
1850
|
+
"D#": "Eb"
|
|
1859
1851
|
},
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1852
|
+
"F": {
|
|
1853
|
+
"A#": "Bb",
|
|
1854
|
+
"F#": "Gb",
|
|
1855
|
+
"C#": "Db",
|
|
1856
|
+
"D#": "Eb",
|
|
1857
|
+
"G#": "Ab"
|
|
1866
1858
|
},
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1859
|
+
"F#": {
|
|
1860
|
+
"A#": "Bb",
|
|
1861
|
+
"D#": "Eb"
|
|
1870
1862
|
},
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1863
|
+
"Gb": {
|
|
1864
|
+
"A#": "Bb",
|
|
1865
|
+
"D#": "Eb",
|
|
1866
|
+
"G#": "Ab",
|
|
1867
|
+
"B": "Cb",
|
|
1868
|
+
"E": "Fb"
|
|
1877
1869
|
},
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1870
|
+
"G": {
|
|
1871
|
+
"A#": "Bb",
|
|
1872
|
+
"D#": "Eb",
|
|
1873
|
+
"G#": "Ab"
|
|
1882
1874
|
},
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1875
|
+
"G#": {
|
|
1876
|
+
"A#": "Bb",
|
|
1877
|
+
"D#": "Eb"
|
|
1886
1878
|
},
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1879
|
+
"Am": {
|
|
1880
|
+
"Gb": "G",
|
|
1881
|
+
"G#": "Ab",
|
|
1882
|
+
"F#": "Gb",
|
|
1883
|
+
"C#": "Db",
|
|
1884
|
+
"D#": "Eb",
|
|
1885
|
+
"A#": "Bb"
|
|
1894
1886
|
},
|
|
1895
|
-
|
|
1896
|
-
|
|
1887
|
+
"Bbm": {
|
|
1888
|
+
"Cb": "B"
|
|
1897
1889
|
},
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1890
|
+
"Bm": {
|
|
1891
|
+
"A#": "Bb",
|
|
1892
|
+
"D#": "Eb"
|
|
1901
1893
|
},
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1894
|
+
"C#m": {
|
|
1895
|
+
"A#": "Bb",
|
|
1896
|
+
"D#": "Eb"
|
|
1905
1897
|
},
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1898
|
+
"Cm": {
|
|
1899
|
+
"G#": "Ab",
|
|
1900
|
+
"A#": "Bb",
|
|
1901
|
+
"D#": "Eb",
|
|
1902
|
+
"F#": "Gb",
|
|
1903
|
+
"C#": "Db"
|
|
1912
1904
|
},
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1905
|
+
"Dm": {
|
|
1906
|
+
"A#": "Bb",
|
|
1907
|
+
"D#": "Eb"
|
|
1916
1908
|
},
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1909
|
+
"Em": {
|
|
1910
|
+
"A#": "Bb",
|
|
1911
|
+
"D#": "Eb"
|
|
1920
1912
|
},
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1913
|
+
"F#m": {
|
|
1914
|
+
"A#": "Bb",
|
|
1915
|
+
"D#": "Eb",
|
|
1916
|
+
"Gb": "F#",
|
|
1917
|
+
"Ab": "G#",
|
|
1918
|
+
"Db": "C#"
|
|
1927
1919
|
},
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1920
|
+
"Fm": {
|
|
1921
|
+
"G#": "Ab",
|
|
1922
|
+
"A#": "Bb",
|
|
1923
|
+
"D#": "Eb",
|
|
1924
|
+
"F#": "Gb",
|
|
1925
|
+
"C#": "Db"
|
|
1934
1926
|
},
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1927
|
+
"Gm": {
|
|
1928
|
+
"G#": "Ab",
|
|
1929
|
+
"A#": "Bb",
|
|
1930
|
+
"D#": "Eb"
|
|
1939
1931
|
},
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1932
|
+
"G#m": {
|
|
1933
|
+
"A#": "Bb",
|
|
1934
|
+
"D#": "Eb"
|
|
1943
1935
|
}
|
|
1944
1936
|
};
|
|
1945
1937
|
|
|
@@ -1950,47 +1942,39 @@ const $21a34a464e7bc609$export$13215d9ce4923f76 = (collection, Klass)=>{
|
|
|
1950
1942
|
collection.push(newObject);
|
|
1951
1943
|
return newObject;
|
|
1952
1944
|
};
|
|
1953
|
-
const $21a34a464e7bc609$export$d332d76d125f0cbe = (line)=>line.items.some((item)=>!!item.chords
|
|
1954
|
-
|
|
1955
|
-
;
|
|
1956
|
-
const $21a34a464e7bc609$export$e3f63561d52b936d = (item)=>typeof item.evaluate === 'function'
|
|
1957
|
-
;
|
|
1945
|
+
const $21a34a464e7bc609$export$d332d76d125f0cbe = (line)=>line.items.some((item)=>!!item.chords);
|
|
1946
|
+
const $21a34a464e7bc609$export$e3f63561d52b936d = (item)=>typeof item.evaluate === "function";
|
|
1958
1947
|
const $21a34a464e7bc609$export$bc3bea8325045070 = (str, length)=>{
|
|
1959
1948
|
let paddedString = str;
|
|
1960
|
-
for(let l = str.length; l < length; l += 1, paddedString +=
|
|
1949
|
+
for(let l = str.length; l < length; l += 1, paddedString += " ");
|
|
1961
1950
|
return paddedString;
|
|
1962
1951
|
};
|
|
1963
|
-
const $21a34a464e7bc609$export$ee27c052bca048fb = (object)=>object && object.length > 0
|
|
1964
|
-
;
|
|
1965
|
-
const $21a34a464e7bc609$export$
|
|
1966
|
-
;
|
|
1967
|
-
const $21a34a464e7bc609$export$ed9b06b5ee264ad3 = (object)=>$21a34a464e7bc609$export$ee27c052bca048fb(object) ? object : null
|
|
1968
|
-
;
|
|
1952
|
+
const $21a34a464e7bc609$export$ee27c052bca048fb = (object)=>object && object.length > 0;
|
|
1953
|
+
const $21a34a464e7bc609$export$7ee701e290d9865 = (object)=>!$21a34a464e7bc609$export$ee27c052bca048fb(object);
|
|
1954
|
+
const $21a34a464e7bc609$export$ed9b06b5ee264ad3 = (object)=>$21a34a464e7bc609$export$ee27c052bca048fb(object) ? object : null;
|
|
1969
1955
|
function $21a34a464e7bc609$var$dasherize(string) {
|
|
1970
|
-
return string.replace(/[A-Z]/g, (match)=>`-${match.toLowerCase()}`
|
|
1971
|
-
);
|
|
1956
|
+
return string.replace(/[A-Z]/g, (match)=>`-${match.toLowerCase()}`);
|
|
1972
1957
|
}
|
|
1973
1958
|
function $21a34a464e7bc609$export$59d377d2a2e0150a(css, scope) {
|
|
1974
1959
|
return Object.entries(css).map(([selector, styles])=>{
|
|
1975
|
-
const rules = Object.entries(styles).map(([property, value])=>`${$21a34a464e7bc609$var$dasherize(property)}: ${value};`
|
|
1976
|
-
).join('\n ');
|
|
1960
|
+
const rules = Object.entries(styles).map(([property, value])=>`${$21a34a464e7bc609$var$dasherize(property)}: ${value};`).join("\n ");
|
|
1977
1961
|
const scopedSelector = `${scope} ${selector}`.trim();
|
|
1978
1962
|
return `
|
|
1979
1963
|
${scopedSelector} {
|
|
1980
1964
|
${rules}
|
|
1981
1965
|
}`.substring(1);
|
|
1982
|
-
}).join(
|
|
1966
|
+
}).join("\n\n");
|
|
1983
1967
|
}
|
|
1984
1968
|
function $21a34a464e7bc609$export$b680e6b2c82f8c2f(message) {
|
|
1985
1969
|
try {
|
|
1986
1970
|
throw new Error(`DEPRECATION: ${message}`);
|
|
1987
1971
|
} catch (e) {
|
|
1988
|
-
if (typeof $988mA$process ===
|
|
1972
|
+
if (typeof $988mA$process === "object" && typeof $988mA$process.emitWarning === "function") $988mA$process.emitWarning(`${message}\n${e.stack}`);
|
|
1989
1973
|
else console.warn(`${message}\n${e.stack}`);
|
|
1990
1974
|
}
|
|
1991
1975
|
}
|
|
1992
1976
|
function $21a34a464e7bc609$export$78d1711480f95c3e(string) {
|
|
1993
|
-
return string === null || string === undefined || string ===
|
|
1977
|
+
return string === null || string === undefined || string === "";
|
|
1994
1978
|
}
|
|
1995
1979
|
function $21a34a464e7bc609$export$595e981f61839426(string, constructor, regexes) {
|
|
1996
1980
|
if ($21a34a464e7bc609$export$78d1711480f95c3e(string)) return null;
|
|
@@ -2002,8 +1986,8 @@ function $21a34a464e7bc609$export$595e981f61839426(string, constructor, regexes)
|
|
|
2002
1986
|
}
|
|
2003
1987
|
|
|
2004
1988
|
|
|
2005
|
-
const $bff5407e03fdc8ee$var$FLAT =
|
|
2006
|
-
const $bff5407e03fdc8ee$var$SHARP =
|
|
1989
|
+
const $bff5407e03fdc8ee$var$FLAT = "b";
|
|
1990
|
+
const $bff5407e03fdc8ee$var$SHARP = "#";
|
|
2007
1991
|
const $bff5407e03fdc8ee$var$MODIFIER_TRANSPOSITION = {
|
|
2008
1992
|
[$bff5407e03fdc8ee$var$SHARP]: 1,
|
|
2009
1993
|
[$bff5407e03fdc8ee$var$FLAT]: -1
|
|
@@ -2020,7 +2004,7 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2020
2004
|
modifier = null;
|
|
2021
2005
|
minor = false;
|
|
2022
2006
|
static parse(keyString) {
|
|
2023
|
-
return $21a34a464e7bc609$export$595e981f61839426(keyString, $bff5407e03fdc8ee$var$Key, $bff5407e03fdc8ee$var$regexes);
|
|
2007
|
+
return (0, $21a34a464e7bc609$export$595e981f61839426)(keyString, $bff5407e03fdc8ee$var$Key, $bff5407e03fdc8ee$var$regexes);
|
|
2024
2008
|
}
|
|
2025
2009
|
static wrap(keyStringOrObject) {
|
|
2026
2010
|
if (keyStringOrObject instanceof $bff5407e03fdc8ee$var$Key) return keyStringOrObject;
|
|
@@ -2043,7 +2027,7 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2043
2027
|
return delta;
|
|
2044
2028
|
}
|
|
2045
2029
|
constructor({ note: note , modifier: modifier = null , minor: minor = false }){
|
|
2046
|
-
this.note = note instanceof $8fcf445ea0999053$export$2e2bcd8739ae039 ? note : $8fcf445ea0999053$export$2e2bcd8739ae039.parse(note);
|
|
2030
|
+
this.note = note instanceof (0, $8fcf445ea0999053$export$2e2bcd8739ae039) ? note : (0, $8fcf445ea0999053$export$2e2bcd8739ae039).parse(note);
|
|
2047
2031
|
this.modifier = modifier || null;
|
|
2048
2032
|
this.minor = !!minor || false;
|
|
2049
2033
|
}
|
|
@@ -2054,7 +2038,7 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2054
2038
|
return this.set({});
|
|
2055
2039
|
}
|
|
2056
2040
|
toChordSymbol(key) {
|
|
2057
|
-
if (this.is($af8d31735c159a26$export$27c95a7104c1f7aa)) return this.clone();
|
|
2041
|
+
if (this.is((0, $af8d31735c159a26$export$27c95a7104c1f7aa))) return this.clone();
|
|
2058
2042
|
const transposeDistance = this.note.getTransposeDistance(key.minor) + ($bff5407e03fdc8ee$var$MODIFIER_TRANSPOSITION[this.modifier] || 0);
|
|
2059
2043
|
return key.transpose(transposeDistance).normalize().useModifier(key.modifier);
|
|
2060
2044
|
}
|
|
@@ -2065,13 +2049,13 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2065
2049
|
return this.note.is(type);
|
|
2066
2050
|
}
|
|
2067
2051
|
isNumeric() {
|
|
2068
|
-
return this.is($af8d31735c159a26$export$4d318981b5a83836);
|
|
2052
|
+
return this.is((0, $af8d31735c159a26$export$4d318981b5a83836));
|
|
2069
2053
|
}
|
|
2070
2054
|
isChordSymbol() {
|
|
2071
|
-
return this.is($af8d31735c159a26$export$27c95a7104c1f7aa);
|
|
2055
|
+
return this.is((0, $af8d31735c159a26$export$27c95a7104c1f7aa));
|
|
2072
2056
|
}
|
|
2073
2057
|
isNumeral() {
|
|
2074
|
-
return this.is($af8d31735c159a26$export$1321df9b16c30c6a);
|
|
2058
|
+
return this.is((0, $af8d31735c159a26$export$1321df9b16c30c6a));
|
|
2075
2059
|
}
|
|
2076
2060
|
equals({ note: note , modifier: modifier = null }) {
|
|
2077
2061
|
return this.note.equals(note) && this.modifier === modifier;
|
|
@@ -2091,20 +2075,20 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2091
2075
|
if (this.isNumeric()) return this.set({
|
|
2092
2076
|
note: this.note.toNumeral()
|
|
2093
2077
|
});
|
|
2094
|
-
return this.transposeNoteUpToKey(
|
|
2078
|
+
return this.transposeNoteUpToKey("I", key);
|
|
2095
2079
|
}
|
|
2096
2080
|
toNumeralString(key = null) {
|
|
2097
2081
|
return this.toNumeral(key).toString();
|
|
2098
2082
|
}
|
|
2099
2083
|
toString() {
|
|
2100
|
-
if (this.isChordSymbol()) return `${this.note}${this.modifier ||
|
|
2101
|
-
return `${this.modifier ||
|
|
2084
|
+
if (this.isChordSymbol()) return `${this.note}${this.modifier || ""}`;
|
|
2085
|
+
return `${this.modifier || ""}${this.note}`;
|
|
2102
2086
|
}
|
|
2103
2087
|
transpose(delta) {
|
|
2104
2088
|
if (delta === 0) return this;
|
|
2105
2089
|
const originalModifier = this.modifier;
|
|
2106
2090
|
let transposedKey = this.clone();
|
|
2107
|
-
const func = delta < 0 ?
|
|
2091
|
+
const func = delta < 0 ? "transposeDown" : "transposeUp";
|
|
2108
2092
|
for(let i = 0, count = Math.abs(delta); i < count; i += 1)transposedKey = transposedKey[func]();
|
|
2109
2093
|
return transposedKey.useModifier(originalModifier);
|
|
2110
2094
|
}
|
|
@@ -2112,7 +2096,7 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2112
2096
|
if (this.modifier === $bff5407e03fdc8ee$var$FLAT) return this.set({
|
|
2113
2097
|
modifier: null
|
|
2114
2098
|
});
|
|
2115
|
-
if (this.note.isOneOf(3, 7,
|
|
2099
|
+
if (this.note.isOneOf(3, 7, "E", "B")) return this.set({
|
|
2116
2100
|
note: this.note.up()
|
|
2117
2101
|
});
|
|
2118
2102
|
if (this.modifier === $bff5407e03fdc8ee$var$SHARP) return this.set({
|
|
@@ -2127,7 +2111,7 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2127
2111
|
if (this.modifier === $bff5407e03fdc8ee$var$SHARP) return this.set({
|
|
2128
2112
|
modifier: null
|
|
2129
2113
|
});
|
|
2130
|
-
if (this.note.isOneOf(1, 4,
|
|
2114
|
+
if (this.note.isOneOf(1, 4, "C", "F")) return this.set({
|
|
2131
2115
|
note: this.note.down()
|
|
2132
2116
|
});
|
|
2133
2117
|
if (this.modifier === $bff5407e03fdc8ee$var$FLAT) return this.set({
|
|
@@ -2150,11 +2134,11 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2150
2134
|
return this.clone();
|
|
2151
2135
|
}
|
|
2152
2136
|
normalize() {
|
|
2153
|
-
if (this.modifier === $bff5407e03fdc8ee$var$SHARP && this.note.isOneOf(3, 7,
|
|
2137
|
+
if (this.modifier === $bff5407e03fdc8ee$var$SHARP && this.note.isOneOf(3, 7, "E", "B")) return this.set({
|
|
2154
2138
|
note: this.note.up(),
|
|
2155
2139
|
modifier: null
|
|
2156
2140
|
});
|
|
2157
|
-
if (this.modifier === $bff5407e03fdc8ee$var$FLAT && this.note.isOneOf(1, 4,
|
|
2141
|
+
if (this.modifier === $bff5407e03fdc8ee$var$FLAT && this.note.isOneOf(1, 4, "C", "F")) return this.set({
|
|
2158
2142
|
note: this.note.down(),
|
|
2159
2143
|
modifier: null
|
|
2160
2144
|
});
|
|
@@ -2163,7 +2147,7 @@ class $bff5407e03fdc8ee$var$Key {
|
|
|
2163
2147
|
normalizeEnharmonics(key) {
|
|
2164
2148
|
if (key) {
|
|
2165
2149
|
const rootKeyString = key.minor ? `${key}m` : key.toString();
|
|
2166
|
-
const enharmonics = $6ebb068142750218$export$2e2bcd8739ae039[rootKeyString];
|
|
2150
|
+
const enharmonics = (0, $6ebb068142750218$export$2e2bcd8739ae039)[rootKeyString];
|
|
2167
2151
|
const thisKeyString = this.toString();
|
|
2168
2152
|
if (enharmonics && enharmonics[thisKeyString]) return $bff5407e03fdc8ee$var$Key.parse(enharmonics[thisKeyString]);
|
|
2169
2153
|
}
|
|
@@ -3106,20 +3090,18 @@ var $e12151f977ef7bf6$export$2e2bcd8739ae039 = $e12151f977ef7bf6$var$mapping;
|
|
|
3106
3090
|
|
|
3107
3091
|
|
|
3108
3092
|
function $26f57998457eb2d4$var$normalizeSuffix(suffix) {
|
|
3109
|
-
if ($e12151f977ef7bf6$export$2e2bcd8739ae039[suffix] ===
|
|
3110
|
-
return $e12151f977ef7bf6$export$2e2bcd8739ae039[suffix] || suffix;
|
|
3093
|
+
if ((0, $e12151f977ef7bf6$export$2e2bcd8739ae039)[suffix] === "[blank]") return null;
|
|
3094
|
+
return (0, $e12151f977ef7bf6$export$2e2bcd8739ae039)[suffix] || suffix;
|
|
3111
3095
|
}
|
|
3112
3096
|
const $26f57998457eb2d4$var$chordRegex = /^(?<base>[A-G])(?<modifier>#|b)?(?<suffix>[^/\s]*)(\/(?<bassBase>[A-G])(?<bassModifier>#|b)?)?$/i;
|
|
3113
3097
|
const $26f57998457eb2d4$var$numericChordRegex = /^(?<modifier>#|b)?(?<base>[1-7])(?<suffix>[^/\s]*)(\/(?<bassModifier>#|b)?(?<bassBase>[0-7]))?$/;
|
|
3114
3098
|
const $26f57998457eb2d4$var$sortedNumerals = [
|
|
3115
|
-
|
|
3116
|
-
].sort((numeralA, numeralB)=>numeralB.length - numeralA.length
|
|
3117
|
-
);
|
|
3099
|
+
...(0, $af8d31735c159a26$export$6145372d252f6576)
|
|
3100
|
+
].sort((numeralA, numeralB)=>numeralB.length - numeralA.length);
|
|
3118
3101
|
const $26f57998457eb2d4$var$numerals = [
|
|
3119
3102
|
...$26f57998457eb2d4$var$sortedNumerals,
|
|
3120
|
-
...$26f57998457eb2d4$var$sortedNumerals.map((numeral)=>numeral.toLowerCase()
|
|
3121
|
-
|
|
3122
|
-
].join('|');
|
|
3103
|
+
...$26f57998457eb2d4$var$sortedNumerals.map((numeral)=>numeral.toLowerCase()),
|
|
3104
|
+
].join("|");
|
|
3123
3105
|
const $26f57998457eb2d4$var$numeralChordRegex = // eslint-disable-next-line max-len
|
|
3124
3106
|
new RegExp(`^(?<modifier>#|b)?(?<base>${$26f57998457eb2d4$var$numerals})(?<suffix>[^/\\s]*)(\\/(?<bassModifier>#|b)?(?<bassBase>${$26f57998457eb2d4$var$numerals}))?$`);
|
|
3125
3107
|
const $26f57998457eb2d4$var$regexes = [
|
|
@@ -3135,7 +3117,7 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3135
3117
|
* @param chordString the chord string, eg `Esus4/G#` or `1sus4/#3`
|
|
3136
3118
|
* @returns {null|Chord}
|
|
3137
3119
|
*/ static parse(chordString) {
|
|
3138
|
-
return $21a34a464e7bc609$export$595e981f61839426(chordString, $26f57998457eb2d4$var$Chord, $26f57998457eb2d4$var$regexes);
|
|
3120
|
+
return (0, $21a34a464e7bc609$export$595e981f61839426)(chordString, $26f57998457eb2d4$var$Chord, $26f57998457eb2d4$var$regexes);
|
|
3139
3121
|
}
|
|
3140
3122
|
/**
|
|
3141
3123
|
* Returns a deep copy of the chord
|
|
@@ -3151,7 +3133,7 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3151
3133
|
* @returns {Chord} the chord symbol
|
|
3152
3134
|
*/ toChordSymbol(key = null) {
|
|
3153
3135
|
if (this.isChordSymbol()) return this.clone();
|
|
3154
|
-
const keyObj = $bff5407e03fdc8ee$export$2e2bcd8739ae039.wrap(key);
|
|
3136
|
+
const keyObj = (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(key);
|
|
3155
3137
|
const rootKey = this.root.toChordSymbol(keyObj).normalizeEnharmonics(keyObj);
|
|
3156
3138
|
let chordSymbolChord = new $26f57998457eb2d4$var$Chord({
|
|
3157
3139
|
suffix: $26f57998457eb2d4$var$normalizeSuffix(this.suffix),
|
|
@@ -3175,7 +3157,7 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3175
3157
|
* Determines whether the chord is a chord symbol
|
|
3176
3158
|
* @returns {boolean}
|
|
3177
3159
|
*/ isChordSymbol() {
|
|
3178
|
-
return this.is($af8d31735c159a26$export$27c95a7104c1f7aa);
|
|
3160
|
+
return this.is((0, $af8d31735c159a26$export$27c95a7104c1f7aa));
|
|
3179
3161
|
}
|
|
3180
3162
|
/**
|
|
3181
3163
|
* Converts the chord to a numeric chord, using the supplied key as a reference.
|
|
@@ -3188,7 +3170,7 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3188
3170
|
root: this.root.toNumeric(),
|
|
3189
3171
|
bass: this.bass?.toNumeric()
|
|
3190
3172
|
});
|
|
3191
|
-
const keyObj = $bff5407e03fdc8ee$export$2e2bcd8739ae039.wrap(key);
|
|
3173
|
+
const keyObj = (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(key);
|
|
3192
3174
|
return new $26f57998457eb2d4$var$Chord({
|
|
3193
3175
|
suffix: $26f57998457eb2d4$var$normalizeSuffix(this.suffix),
|
|
3194
3176
|
root: this.root.toNumeric(keyObj),
|
|
@@ -3206,7 +3188,7 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3206
3188
|
root: this.root.toNumeral(),
|
|
3207
3189
|
bass: this.bass?.toNumeral()
|
|
3208
3190
|
});
|
|
3209
|
-
const keyObj = $bff5407e03fdc8ee$export$2e2bcd8739ae039.wrap(key);
|
|
3191
|
+
const keyObj = (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(key);
|
|
3210
3192
|
return new $26f57998457eb2d4$var$Chord({
|
|
3211
3193
|
suffix: $26f57998457eb2d4$var$normalizeSuffix(this.suffix),
|
|
3212
3194
|
root: this.root.toNumeral(keyObj),
|
|
@@ -3226,7 +3208,7 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3226
3208
|
* Determines whether the chord is numeric
|
|
3227
3209
|
* @returns {boolean}
|
|
3228
3210
|
*/ isNumeric() {
|
|
3229
|
-
return this.is($af8d31735c159a26$export$4d318981b5a83836);
|
|
3211
|
+
return this.is((0, $af8d31735c159a26$export$4d318981b5a83836));
|
|
3230
3212
|
}
|
|
3231
3213
|
/**
|
|
3232
3214
|
* Converts the chord to a numeric chord string, using the supplied kye as a reference.
|
|
@@ -3241,13 +3223,13 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3241
3223
|
* Determines whether the chord is a numeral
|
|
3242
3224
|
* @returns {boolean}
|
|
3243
3225
|
*/ isNumeral() {
|
|
3244
|
-
return this.is($af8d31735c159a26$export$1321df9b16c30c6a);
|
|
3226
|
+
return this.is((0, $af8d31735c159a26$export$1321df9b16c30c6a));
|
|
3245
3227
|
}
|
|
3246
3228
|
/**
|
|
3247
3229
|
* Converts the chord to a string, eg `Esus4/G#` or `1sus4/#3`
|
|
3248
3230
|
* @returns {string} the chord string
|
|
3249
3231
|
*/ toString() {
|
|
3250
|
-
const chordString = this.root.toString() + (this.suffix ||
|
|
3232
|
+
const chordString = this.root.toString() + (this.suffix || "");
|
|
3251
3233
|
if (this.bass) return `${chordString}/${this.bass.toString()}`;
|
|
3252
3234
|
return chordString;
|
|
3253
3235
|
}
|
|
@@ -3267,12 +3249,12 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3267
3249
|
*
|
|
3268
3250
|
* @returns {Chord} the normalized chord
|
|
3269
3251
|
*/ normalize(key = null) {
|
|
3270
|
-
if ($21a34a464e7bc609$export$7ee701e290d9865(key)) return this.process(
|
|
3271
|
-
suffix: $21a34a464e7bc609$export$ed9b06b5ee264ad3($26f57998457eb2d4$var$normalizeSuffix(this.suffix))
|
|
3252
|
+
if ((0, $21a34a464e7bc609$export$7ee701e290d9865)(key)) return this.process("normalize").set({
|
|
3253
|
+
suffix: (0, $21a34a464e7bc609$export$ed9b06b5ee264ad3)($26f57998457eb2d4$var$normalizeSuffix(this.suffix))
|
|
3272
3254
|
});
|
|
3273
3255
|
return this.set({
|
|
3274
3256
|
root: this.root.normalizeEnharmonics(key),
|
|
3275
|
-
suffix: $21a34a464e7bc609$export$ed9b06b5ee264ad3($26f57998457eb2d4$var$normalizeSuffix(this.suffix)),
|
|
3257
|
+
suffix: (0, $21a34a464e7bc609$export$ed9b06b5ee264ad3)($26f57998457eb2d4$var$normalizeSuffix(this.suffix)),
|
|
3276
3258
|
bass: this.bass ? this.bass.normalizeEnharmonics(this.root.toString()) : null
|
|
3277
3259
|
});
|
|
3278
3260
|
}
|
|
@@ -3281,45 +3263,45 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3281
3263
|
* @param newModifier the modifier to use: `'#'` or `'b'`
|
|
3282
3264
|
* @returns {Chord} the new, changed chord
|
|
3283
3265
|
*/ useModifier(newModifier) {
|
|
3284
|
-
return this.process(
|
|
3266
|
+
return this.process("useModifier", newModifier);
|
|
3285
3267
|
}
|
|
3286
3268
|
/**
|
|
3287
3269
|
* Transposes the chord up by 1 semitone. Eg. A becomes A#, Eb becomes E
|
|
3288
3270
|
* @returns {Chord} the new, transposed chord
|
|
3289
3271
|
*/ transposeUp() {
|
|
3290
|
-
return this.process(
|
|
3272
|
+
return this.process("transposeUp");
|
|
3291
3273
|
}
|
|
3292
3274
|
/**
|
|
3293
3275
|
* Transposes the chord down by 1 semitone. Eg. A# becomes A, E becomes Eb
|
|
3294
3276
|
* @returns {Chord} the new, transposed chord
|
|
3295
3277
|
*/ transposeDown() {
|
|
3296
|
-
return this.process(
|
|
3278
|
+
return this.process("transposeDown");
|
|
3297
3279
|
}
|
|
3298
3280
|
/**
|
|
3299
3281
|
* Transposes the chord by the specified number of semitones
|
|
3300
3282
|
* @param delta de number of semitones
|
|
3301
3283
|
* @returns {Chord} the new, transposed chord
|
|
3302
3284
|
*/ transpose(delta) {
|
|
3303
|
-
return this.process(
|
|
3285
|
+
return this.process("transpose", delta);
|
|
3304
3286
|
}
|
|
3305
3287
|
constructor({ base: base = null , modifier: modifier = null , suffix: suffix = null , bassBase: bassBase = null , bassModifier: bassModifier = null , root: root = null , bass: bass = null , }){
|
|
3306
|
-
this.suffix = $21a34a464e7bc609$export$ed9b06b5ee264ad3(suffix);
|
|
3307
|
-
this.root = root || new $bff5407e03fdc8ee$export$2e2bcd8739ae039({
|
|
3288
|
+
this.suffix = (0, $21a34a464e7bc609$export$ed9b06b5ee264ad3)(suffix);
|
|
3289
|
+
this.root = root || new (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039)({
|
|
3308
3290
|
note: base,
|
|
3309
3291
|
modifier: modifier,
|
|
3310
|
-
minor: suffix ===
|
|
3292
|
+
minor: suffix === "m"
|
|
3311
3293
|
});
|
|
3312
3294
|
if (bass) this.bass = bass;
|
|
3313
|
-
else if (bassBase) this.bass = new $bff5407e03fdc8ee$export$2e2bcd8739ae039({
|
|
3295
|
+
else if (bassBase) this.bass = new (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039)({
|
|
3314
3296
|
note: bassBase,
|
|
3315
3297
|
modifier: bassModifier,
|
|
3316
|
-
minor: suffix ===
|
|
3298
|
+
minor: suffix === "m"
|
|
3317
3299
|
});
|
|
3318
3300
|
else this.bass = null;
|
|
3319
3301
|
}
|
|
3320
3302
|
makeMinor() {
|
|
3321
|
-
if (!this.suffix || this.suffix[0] !==
|
|
3322
|
-
suffix: `m${this.suffix ||
|
|
3303
|
+
if (!this.suffix || this.suffix[0] !== "m") return this.set({
|
|
3304
|
+
suffix: `m${this.suffix || ""}`
|
|
3323
3305
|
});
|
|
3324
3306
|
return this.clone();
|
|
3325
3307
|
}
|
|
@@ -3345,7 +3327,7 @@ const $26f57998457eb2d4$var$regexes = [
|
|
|
3345
3327
|
}
|
|
3346
3328
|
}
|
|
3347
3329
|
function $26f57998457eb2d4$export$621b8187b24d90c6(chordString) {
|
|
3348
|
-
$21a34a464e7bc609$export$b680e6b2c82f8c2f(
|
|
3330
|
+
(0, $21a34a464e7bc609$export$b680e6b2c82f8c2f)("parseChord() is deprecated, please use Chord.parse() instead");
|
|
3349
3331
|
return $26f57998457eb2d4$var$Chord.parse(chordString);
|
|
3350
3332
|
}
|
|
3351
3333
|
var $26f57998457eb2d4$export$2e2bcd8739ae039 = $26f57998457eb2d4$var$Chord;
|
|
@@ -3358,17 +3340,17 @@ var $26f57998457eb2d4$export$2e2bcd8739ae039 = $26f57998457eb2d4$var$Chord;
|
|
|
3358
3340
|
* Initialises a ChordLyricsPair
|
|
3359
3341
|
* @param {string} chords The chords
|
|
3360
3342
|
* @param {string} lyrics The lyrics
|
|
3361
|
-
*/ constructor(chords =
|
|
3343
|
+
*/ constructor(chords = "", lyrics = ""){
|
|
3362
3344
|
/**
|
|
3363
3345
|
* The chords
|
|
3364
3346
|
* @member
|
|
3365
3347
|
* @type {string}
|
|
3366
|
-
*/ this.chords = chords ||
|
|
3348
|
+
*/ this.chords = chords || "";
|
|
3367
3349
|
/**
|
|
3368
3350
|
* The lyrics
|
|
3369
3351
|
* @member
|
|
3370
3352
|
* @type {string}
|
|
3371
|
-
*/ this.lyrics = lyrics ||
|
|
3353
|
+
*/ this.lyrics = lyrics || "";
|
|
3372
3354
|
}
|
|
3373
3355
|
/**
|
|
3374
3356
|
* Indicates whether a ChordLyricsPair should be visible in a formatted chord sheet (except for ChordPro sheets)
|
|
@@ -3394,7 +3376,7 @@ var $26f57998457eb2d4$export$2e2bcd8739ae039 = $26f57998457eb2d4$var$Chord;
|
|
|
3394
3376
|
});
|
|
3395
3377
|
}
|
|
3396
3378
|
transpose(delta, key) {
|
|
3397
|
-
const chordObj = $26f57998457eb2d4$export$2e2bcd8739ae039.parse(this.chords);
|
|
3379
|
+
const chordObj = (0, $26f57998457eb2d4$export$2e2bcd8739ae039).parse(this.chords);
|
|
3398
3380
|
if (chordObj) return this.set({
|
|
3399
3381
|
chords: chordObj.transpose(delta).normalize(key).toString()
|
|
3400
3382
|
});
|
|
@@ -3419,37 +3401,37 @@ class $cf00b4d3af89fa07$var$AstComponent {
|
|
|
3419
3401
|
var $cf00b4d3af89fa07$export$2e2bcd8739ae039 = $cf00b4d3af89fa07$var$AstComponent;
|
|
3420
3402
|
|
|
3421
3403
|
|
|
3422
|
-
const $5e9ede69210ec54a$export$10227cb086d1770c =
|
|
3423
|
-
const $5e9ede69210ec54a$export$17d8dfb3db842bf =
|
|
3424
|
-
const $5e9ede69210ec54a$export$866f445d49bad88e =
|
|
3425
|
-
const $5e9ede69210ec54a$export$a29989082612d0d9 =
|
|
3426
|
-
const $5e9ede69210ec54a$export$98424633dc8c377f =
|
|
3427
|
-
const $5e9ede69210ec54a$export$4ab8c75045d12480 =
|
|
3428
|
-
const $5e9ede69210ec54a$export$bacc88974c736870 =
|
|
3429
|
-
const $5e9ede69210ec54a$export$473c1a4819e5180b =
|
|
3430
|
-
const $5e9ede69210ec54a$export$66a0ef3ffeab32b7 =
|
|
3431
|
-
const $5e9ede69210ec54a$export$640d294ab83f9040 =
|
|
3432
|
-
const $5e9ede69210ec54a$export$7167c830cefcb6b5 =
|
|
3433
|
-
const $5e9ede69210ec54a$export$430b1920f5feeae =
|
|
3434
|
-
const $5e9ede69210ec54a$export$a6901bd008617c61 =
|
|
3435
|
-
const $5e9ede69210ec54a$export$4f5168acae064e01 =
|
|
3436
|
-
const $5e9ede69210ec54a$export$8dd1111100e0e88d =
|
|
3437
|
-
const $5e9ede69210ec54a$export$deca399f8cd9b7dc =
|
|
3438
|
-
const $5e9ede69210ec54a$export$5895c693c74b9cf4 =
|
|
3439
|
-
const $5e9ede69210ec54a$export$bd8d57d0bc5a8478 =
|
|
3440
|
-
const $5e9ede69210ec54a$export$a9905336c0111a3a =
|
|
3441
|
-
const $5e9ede69210ec54a$export$f1e53f710478ceb4 =
|
|
3442
|
-
const $5e9ede69210ec54a$export$ae60ab9b4739fc3d =
|
|
3443
|
-
const $5e9ede69210ec54a$export$b7627374a6424f68 =
|
|
3444
|
-
const $5e9ede69210ec54a$export$90b88dc425a06a95 =
|
|
3445
|
-
const $5e9ede69210ec54a$var$TITLE_SHORT =
|
|
3446
|
-
const $5e9ede69210ec54a$var$SUBTITLE_SHORT =
|
|
3447
|
-
const $5e9ede69210ec54a$var$COMMENT_SHORT =
|
|
3448
|
-
const $5e9ede69210ec54a$var$START_OF_CHORUS_SHORT =
|
|
3449
|
-
const $5e9ede69210ec54a$var$END_OF_CHORUS_SHORT =
|
|
3450
|
-
const $5e9ede69210ec54a$var$START_OF_TAB_SHORT =
|
|
3451
|
-
const $5e9ede69210ec54a$var$END_OF_TAB_SHORT =
|
|
3452
|
-
const $5e9ede69210ec54a$var$NEW_KEY_SHORT =
|
|
3404
|
+
const $5e9ede69210ec54a$export$10227cb086d1770c = "album";
|
|
3405
|
+
const $5e9ede69210ec54a$export$17d8dfb3db842bf = "artist";
|
|
3406
|
+
const $5e9ede69210ec54a$export$866f445d49bad88e = "capo";
|
|
3407
|
+
const $5e9ede69210ec54a$export$a29989082612d0d9 = "comment";
|
|
3408
|
+
const $5e9ede69210ec54a$export$98424633dc8c377f = "composer";
|
|
3409
|
+
const $5e9ede69210ec54a$export$4ab8c75045d12480 = "copyright";
|
|
3410
|
+
const $5e9ede69210ec54a$export$bacc88974c736870 = "duration";
|
|
3411
|
+
const $5e9ede69210ec54a$export$473c1a4819e5180b = "end_of_chorus";
|
|
3412
|
+
const $5e9ede69210ec54a$export$66a0ef3ffeab32b7 = "end_of_tab";
|
|
3413
|
+
const $5e9ede69210ec54a$export$640d294ab83f9040 = "end_of_verse";
|
|
3414
|
+
const $5e9ede69210ec54a$export$7167c830cefcb6b5 = "key";
|
|
3415
|
+
const $5e9ede69210ec54a$export$430b1920f5feeae = "_key";
|
|
3416
|
+
const $5e9ede69210ec54a$export$a6901bd008617c61 = "lyricist";
|
|
3417
|
+
const $5e9ede69210ec54a$export$4f5168acae064e01 = "start_of_chorus";
|
|
3418
|
+
const $5e9ede69210ec54a$export$8dd1111100e0e88d = "start_of_tab";
|
|
3419
|
+
const $5e9ede69210ec54a$export$deca399f8cd9b7dc = "start_of_verse";
|
|
3420
|
+
const $5e9ede69210ec54a$export$5895c693c74b9cf4 = "subtitle";
|
|
3421
|
+
const $5e9ede69210ec54a$export$bd8d57d0bc5a8478 = "tempo";
|
|
3422
|
+
const $5e9ede69210ec54a$export$a9905336c0111a3a = "time";
|
|
3423
|
+
const $5e9ede69210ec54a$export$f1e53f710478ceb4 = "title";
|
|
3424
|
+
const $5e9ede69210ec54a$export$ae60ab9b4739fc3d = "transpose";
|
|
3425
|
+
const $5e9ede69210ec54a$export$b7627374a6424f68 = "new_key";
|
|
3426
|
+
const $5e9ede69210ec54a$export$90b88dc425a06a95 = "year";
|
|
3427
|
+
const $5e9ede69210ec54a$var$TITLE_SHORT = "t";
|
|
3428
|
+
const $5e9ede69210ec54a$var$SUBTITLE_SHORT = "st";
|
|
3429
|
+
const $5e9ede69210ec54a$var$COMMENT_SHORT = "c";
|
|
3430
|
+
const $5e9ede69210ec54a$var$START_OF_CHORUS_SHORT = "soc";
|
|
3431
|
+
const $5e9ede69210ec54a$var$END_OF_CHORUS_SHORT = "eoc";
|
|
3432
|
+
const $5e9ede69210ec54a$var$START_OF_TAB_SHORT = "sot";
|
|
3433
|
+
const $5e9ede69210ec54a$var$END_OF_TAB_SHORT = "eot";
|
|
3434
|
+
const $5e9ede69210ec54a$var$NEW_KEY_SHORT = "nk";
|
|
3453
3435
|
const $5e9ede69210ec54a$var$RENDERABLE_TAGS = [
|
|
3454
3436
|
$5e9ede69210ec54a$export$a29989082612d0d9
|
|
3455
3437
|
];
|
|
@@ -3495,11 +3477,11 @@ const $5e9ede69210ec54a$var$translateTagNameAlias = (name)=>{
|
|
|
3495
3477
|
};
|
|
3496
3478
|
/**
|
|
3497
3479
|
* Represents a tag/directive. See https://www.chordpro.org/chordpro/chordpro-directives/
|
|
3498
|
-
*/ class $5e9ede69210ec54a$var$Tag extends $cf00b4d3af89fa07$export$2e2bcd8739ae039 {
|
|
3499
|
-
constructor(name, value =
|
|
3480
|
+
*/ class $5e9ede69210ec54a$var$Tag extends (0, $cf00b4d3af89fa07$export$2e2bcd8739ae039) {
|
|
3481
|
+
constructor(name, value = "", traceInfo = null){
|
|
3500
3482
|
super(traceInfo);
|
|
3501
3483
|
this.name = name;
|
|
3502
|
-
this.value = value ||
|
|
3484
|
+
this.value = value || "";
|
|
3503
3485
|
}
|
|
3504
3486
|
static parse(tag) {
|
|
3505
3487
|
if (tag instanceof $5e9ede69210ec54a$var$Tag) return tag;
|
|
@@ -3617,7 +3599,7 @@ var $2115988b22311cb1$export$2e2bcd8739ae039 = $2115988b22311cb1$var$Comment;
|
|
|
3617
3599
|
* Values can be {@link VERSE}, {@link CHORUS} or {@link NONE}
|
|
3618
3600
|
* @member
|
|
3619
3601
|
* @type {string}
|
|
3620
|
-
*/ type = $af8d31735c159a26$export$c53d0f541b41b88e;
|
|
3602
|
+
*/ type = (0, $af8d31735c159a26$export$c53d0f541b41b88e);
|
|
3621
3603
|
/**
|
|
3622
3604
|
* @ignore
|
|
3623
3605
|
* @type {ChordLyricsPair}
|
|
@@ -3631,7 +3613,7 @@ var $2115988b22311cb1$export$2e2bcd8739ae039 = $2115988b22311cb1$var$Comment;
|
|
|
3631
3613
|
* @type {string|null}
|
|
3632
3614
|
*/ transposeKey = null;
|
|
3633
3615
|
constructor({ type: type , items: items } = {
|
|
3634
|
-
type: $af8d31735c159a26$export$c53d0f541b41b88e,
|
|
3616
|
+
type: (0, $af8d31735c159a26$export$c53d0f541b41b88e),
|
|
3635
3617
|
items: []
|
|
3636
3618
|
}){
|
|
3637
3619
|
this.type = type;
|
|
@@ -3647,17 +3629,16 @@ var $2115988b22311cb1$export$2e2bcd8739ae039 = $2115988b22311cb1$var$Comment;
|
|
|
3647
3629
|
* Adds an item ({@link ChordLyricsPair} or {@link Tag}) to the line
|
|
3648
3630
|
* @param {ChordLyricsPair|Tag} item The item to be added
|
|
3649
3631
|
*/ addItem(item) {
|
|
3650
|
-
if (item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039) this.addTag(item);
|
|
3651
|
-
else if (item instanceof $d454f4215ba01af2$export$2e2bcd8739ae039) this.addChordLyricsPair(item);
|
|
3652
|
-
else if (item instanceof $2115988b22311cb1$export$2e2bcd8739ae039) this.addComment(item);
|
|
3632
|
+
if (item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)) this.addTag(item);
|
|
3633
|
+
else if (item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) this.addChordLyricsPair(item);
|
|
3634
|
+
else if (item instanceof (0, $2115988b22311cb1$export$2e2bcd8739ae039)) this.addComment(item);
|
|
3653
3635
|
else this.items.push(item);
|
|
3654
3636
|
}
|
|
3655
3637
|
/**
|
|
3656
3638
|
* Indicates whether the line contains items that are renderable
|
|
3657
3639
|
* @returns {boolean}
|
|
3658
3640
|
*/ hasRenderableItems() {
|
|
3659
|
-
return this.items.some((item)=>item.isRenderable()
|
|
3660
|
-
);
|
|
3641
|
+
return this.items.some((item)=>item.isRenderable());
|
|
3661
3642
|
}
|
|
3662
3643
|
/**
|
|
3663
3644
|
* Returns a deep copy of the line and all of its items
|
|
@@ -3670,8 +3651,7 @@ var $2115988b22311cb1$export$2e2bcd8739ae039 = $2115988b22311cb1$var$Comment;
|
|
|
3670
3651
|
clonedLine.items = this.items.map((item)=>{
|
|
3671
3652
|
const clonedItem = item.clone();
|
|
3672
3653
|
return func ? func(clonedItem) : clonedItem;
|
|
3673
|
-
}).filter((item)=>item
|
|
3674
|
-
);
|
|
3654
|
+
}).filter((item)=>item);
|
|
3675
3655
|
clonedLine.type = this.type;
|
|
3676
3656
|
return clonedLine;
|
|
3677
3657
|
}
|
|
@@ -3679,13 +3659,13 @@ var $2115988b22311cb1$export$2e2bcd8739ae039 = $2115988b22311cb1$var$Comment;
|
|
|
3679
3659
|
* Indicates whether the line type is {@link VERSE}
|
|
3680
3660
|
* @returns {boolean}
|
|
3681
3661
|
*/ isVerse() {
|
|
3682
|
-
return this.type === $af8d31735c159a26$export$4b194284baed1659;
|
|
3662
|
+
return this.type === (0, $af8d31735c159a26$export$4b194284baed1659);
|
|
3683
3663
|
}
|
|
3684
3664
|
/**
|
|
3685
3665
|
* Indicates whether the line type is {@link CHORUS}
|
|
3686
3666
|
* @returns {boolean}
|
|
3687
3667
|
*/ isChorus() {
|
|
3688
|
-
return this.type === $af8d31735c159a26$export$8db6c706fc9142b2;
|
|
3668
|
+
return this.type === (0, $af8d31735c159a26$export$8db6c706fc9142b2);
|
|
3689
3669
|
}
|
|
3690
3670
|
/**
|
|
3691
3671
|
* Indicates whether the line contains items that are renderable. Please use {@link hasRenderableItems}
|
|
@@ -3695,8 +3675,8 @@ var $2115988b22311cb1$export$2e2bcd8739ae039 = $2115988b22311cb1$var$Comment;
|
|
|
3695
3675
|
return this.hasRenderableItems();
|
|
3696
3676
|
}
|
|
3697
3677
|
addChordLyricsPair(chords = null, lyrics = null) {
|
|
3698
|
-
if (chords instanceof $d454f4215ba01af2$export$2e2bcd8739ae039) this.currentChordLyricsPair = chords;
|
|
3699
|
-
else this.currentChordLyricsPair = new $d454f4215ba01af2$export$2e2bcd8739ae039(chords, lyrics);
|
|
3678
|
+
if (chords instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) this.currentChordLyricsPair = chords;
|
|
3679
|
+
else this.currentChordLyricsPair = new (0, $d454f4215ba01af2$export$2e2bcd8739ae039)(chords, lyrics);
|
|
3700
3680
|
this.items.push(this.currentChordLyricsPair);
|
|
3701
3681
|
return this.currentChordLyricsPair;
|
|
3702
3682
|
}
|
|
@@ -3712,12 +3692,12 @@ var $2115988b22311cb1$export$2e2bcd8739ae039 = $2115988b22311cb1$var$Comment;
|
|
|
3712
3692
|
this.currentChordLyricsPair.lyrics += chr;
|
|
3713
3693
|
}
|
|
3714
3694
|
addTag(name, value = null) {
|
|
3715
|
-
const tag = name instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039 ? name : new $5e9ede69210ec54a$export$2e2bcd8739ae039(name, value);
|
|
3695
|
+
const tag = name instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) ? name : new (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)(name, value);
|
|
3716
3696
|
this.items.push(tag);
|
|
3717
3697
|
return tag;
|
|
3718
3698
|
}
|
|
3719
3699
|
addComment(content) {
|
|
3720
|
-
const comment = content instanceof $2115988b22311cb1$export$2e2bcd8739ae039 ? content : new $2115988b22311cb1$export$2e2bcd8739ae039(content);
|
|
3700
|
+
const comment = content instanceof (0, $2115988b22311cb1$export$2e2bcd8739ae039) ? content : new (0, $2115988b22311cb1$export$2e2bcd8739ae039)(content);
|
|
3721
3701
|
this.items.push(comment);
|
|
3722
3702
|
return comment;
|
|
3723
3703
|
}
|
|
@@ -3749,21 +3729,19 @@ var $bc411321e9739719$export$2e2bcd8739ae039 = $bc411321e9739719$var$Line;
|
|
|
3749
3729
|
* If not, it returns {@link INDETERMINATE}
|
|
3750
3730
|
* @returns {string}
|
|
3751
3731
|
*/ get type() {
|
|
3752
|
-
const types = this.lines.map((line)=>line.type
|
|
3753
|
-
);
|
|
3732
|
+
const types = this.lines.map((line)=>line.type);
|
|
3754
3733
|
const uniqueTypes = [
|
|
3755
3734
|
...new Set(types)
|
|
3756
3735
|
];
|
|
3757
3736
|
if (uniqueTypes.length === 1) return uniqueTypes[0];
|
|
3758
|
-
return $af8d31735c159a26$export$c5a6fe907430212e;
|
|
3737
|
+
return 0, $af8d31735c159a26$export$c5a6fe907430212e;
|
|
3759
3738
|
}
|
|
3760
3739
|
/**
|
|
3761
3740
|
* Indicates whether the paragraph contains lines with renderable items.
|
|
3762
3741
|
* @see {@link Line.hasRenderableItems}
|
|
3763
3742
|
* @returns {boolean}
|
|
3764
3743
|
*/ hasRenderableItems() {
|
|
3765
|
-
return this.lines.some((line)=>line.hasRenderableItems()
|
|
3766
|
-
);
|
|
3744
|
+
return this.lines.some((line)=>line.hasRenderableItems());
|
|
3767
3745
|
}
|
|
3768
3746
|
}
|
|
3769
3747
|
var $0c3420c6a3e8a9d7$export$2e2bcd8739ae039 = $0c3420c6a3e8a9d7$var$Paragraph;
|
|
@@ -3776,43 +3754,43 @@ var $0c3420c6a3e8a9d7$export$2e2bcd8739ae039 = $0c3420c6a3e8a9d7$var$Paragraph;
|
|
|
3776
3754
|
|
|
3777
3755
|
class $59abde4480df2d69$var$MetadataAccessors {
|
|
3778
3756
|
get key() {
|
|
3779
|
-
return this.getMetadata($5e9ede69210ec54a$export$7167c830cefcb6b5);
|
|
3757
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$7167c830cefcb6b5));
|
|
3780
3758
|
}
|
|
3781
3759
|
get title() {
|
|
3782
|
-
return this.getMetadata($5e9ede69210ec54a$export$f1e53f710478ceb4);
|
|
3760
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$f1e53f710478ceb4));
|
|
3783
3761
|
}
|
|
3784
3762
|
get subtitle() {
|
|
3785
|
-
return this.getMetadata($5e9ede69210ec54a$export$5895c693c74b9cf4);
|
|
3763
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$5895c693c74b9cf4));
|
|
3786
3764
|
}
|
|
3787
3765
|
get capo() {
|
|
3788
|
-
return this.getMetadata($5e9ede69210ec54a$export$866f445d49bad88e);
|
|
3766
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$866f445d49bad88e));
|
|
3789
3767
|
}
|
|
3790
3768
|
get duration() {
|
|
3791
|
-
return this.getMetadata($5e9ede69210ec54a$export$bacc88974c736870);
|
|
3769
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$bacc88974c736870));
|
|
3792
3770
|
}
|
|
3793
3771
|
get tempo() {
|
|
3794
|
-
return this.getMetadata($5e9ede69210ec54a$export$bd8d57d0bc5a8478);
|
|
3772
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$bd8d57d0bc5a8478));
|
|
3795
3773
|
}
|
|
3796
3774
|
get time() {
|
|
3797
|
-
return this.getMetadata($5e9ede69210ec54a$export$a9905336c0111a3a);
|
|
3775
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$a9905336c0111a3a));
|
|
3798
3776
|
}
|
|
3799
3777
|
get year() {
|
|
3800
|
-
return this.getMetadata($5e9ede69210ec54a$export$90b88dc425a06a95);
|
|
3778
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$90b88dc425a06a95));
|
|
3801
3779
|
}
|
|
3802
3780
|
get album() {
|
|
3803
|
-
return this.getMetadata($5e9ede69210ec54a$export$10227cb086d1770c);
|
|
3781
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$10227cb086d1770c));
|
|
3804
3782
|
}
|
|
3805
3783
|
get copyright() {
|
|
3806
|
-
return this.getMetadata($5e9ede69210ec54a$export$4ab8c75045d12480);
|
|
3784
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$4ab8c75045d12480));
|
|
3807
3785
|
}
|
|
3808
3786
|
get lyricist() {
|
|
3809
|
-
return this.getMetadata($5e9ede69210ec54a$export$a6901bd008617c61);
|
|
3787
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$a6901bd008617c61));
|
|
3810
3788
|
}
|
|
3811
3789
|
get artist() {
|
|
3812
|
-
return this.getMetadata($5e9ede69210ec54a$export$17d8dfb3db842bf);
|
|
3790
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$17d8dfb3db842bf));
|
|
3813
3791
|
}
|
|
3814
3792
|
get composer() {
|
|
3815
|
-
return this.getMetadata($5e9ede69210ec54a$export$98424633dc8c377f);
|
|
3793
|
+
return this.getMetadata((0, $5e9ede69210ec54a$export$98424633dc8c377f));
|
|
3816
3794
|
}
|
|
3817
3795
|
}
|
|
3818
3796
|
var $59abde4480df2d69$export$2e2bcd8739ae039 = $59abde4480df2d69$var$MetadataAccessors;
|
|
@@ -3829,12 +3807,11 @@ function $1406c61233580008$var$appendValue(array, key, value) {
|
|
|
3829
3807
|
* metadata.get('author') // => 'John'
|
|
3830
3808
|
*
|
|
3831
3809
|
* See {@link Metadata#get}
|
|
3832
|
-
*/ class $1406c61233580008$var$Metadata extends $59abde4480df2d69$export$2e2bcd8739ae039 {
|
|
3810
|
+
*/ class $1406c61233580008$var$Metadata extends (0, $59abde4480df2d69$export$2e2bcd8739ae039) {
|
|
3833
3811
|
metadata = {};
|
|
3834
3812
|
constructor(metadata = null){
|
|
3835
3813
|
super();
|
|
3836
|
-
Object.keys(metadata || {}).filter((key)
|
|
3837
|
-
).forEach((key)=>{
|
|
3814
|
+
Object.keys(metadata || {}).filter((key)=>!(0, $5e9ede69210ec54a$export$3ef04055cb4a269a)(key)).forEach((key)=>{
|
|
3838
3815
|
const value = metadata[key];
|
|
3839
3816
|
if (value instanceof Array) this.metadata[key] = [
|
|
3840
3817
|
...value
|
|
@@ -3846,7 +3823,7 @@ function $1406c61233580008$var$appendValue(array, key, value) {
|
|
|
3846
3823
|
return key in this.metadata;
|
|
3847
3824
|
}
|
|
3848
3825
|
add(key, value) {
|
|
3849
|
-
if ($5e9ede69210ec54a$export$3ef04055cb4a269a(key)) return;
|
|
3826
|
+
if ((0, $5e9ede69210ec54a$export$3ef04055cb4a269a)(key)) return;
|
|
3850
3827
|
if (!(key in this.metadata)) {
|
|
3851
3828
|
this.metadata[key] = value;
|
|
3852
3829
|
return;
|
|
@@ -3892,7 +3869,7 @@ function $1406c61233580008$var$appendValue(array, key, value) {
|
|
|
3892
3869
|
* @returns {Array<String>|String} the metadata value(s). If there is only one value, it will return a String,
|
|
3893
3870
|
* else it returns an array of strings.
|
|
3894
3871
|
*/ get(prop) {
|
|
3895
|
-
if (prop === $5e9ede69210ec54a$export$430b1920f5feeae) return this.calculateKeyFromCapo();
|
|
3872
|
+
if (prop === (0, $5e9ede69210ec54a$export$430b1920f5feeae)) return this.calculateKeyFromCapo();
|
|
3896
3873
|
if (prop in this.metadata) return this.metadata[prop];
|
|
3897
3874
|
return this.getArrayItem(prop);
|
|
3898
3875
|
}
|
|
@@ -3933,9 +3910,9 @@ function $1406c61233580008$var$appendValue(array, key, value) {
|
|
|
3933
3910
|
return new $1406c61233580008$var$Metadata(this.metadata);
|
|
3934
3911
|
}
|
|
3935
3912
|
calculateKeyFromCapo() {
|
|
3936
|
-
const capo = this.getSingle($5e9ede69210ec54a$export$866f445d49bad88e);
|
|
3937
|
-
const key = this.getSingle($5e9ede69210ec54a$export$7167c830cefcb6b5);
|
|
3938
|
-
if (capo && key) return $26f57998457eb2d4$export$2e2bcd8739ae039.parse(key).transpose(parseInt(capo, 10)).toString();
|
|
3913
|
+
const capo = this.getSingle((0, $5e9ede69210ec54a$export$866f445d49bad88e));
|
|
3914
|
+
const key = this.getSingle((0, $5e9ede69210ec54a$export$7167c830cefcb6b5));
|
|
3915
|
+
if (capo && key) return (0, $26f57998457eb2d4$export$2e2bcd8739ae039).parse(key).transpose(parseInt(capo, 10)).toString();
|
|
3939
3916
|
return undefined;
|
|
3940
3917
|
}
|
|
3941
3918
|
}
|
|
@@ -3967,14 +3944,14 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
3967
3944
|
|
|
3968
3945
|
/**
|
|
3969
3946
|
* Represents a song in a chord sheet. Currently a chord sheet can only have one song.
|
|
3970
|
-
*/ class $6f653df65dfdf4ef$var$Song extends $59abde4480df2d69$export$2e2bcd8739ae039 {
|
|
3947
|
+
*/ class $6f653df65dfdf4ef$var$Song extends (0, $59abde4480df2d69$export$2e2bcd8739ae039) {
|
|
3971
3948
|
/**
|
|
3972
3949
|
* The {@link Line} items of which the song consists
|
|
3973
3950
|
* @member {Line[]}
|
|
3974
3951
|
*/ lines = [];
|
|
3975
3952
|
currentLine = null;
|
|
3976
3953
|
warnings = [];
|
|
3977
|
-
sectionType = $af8d31735c159a26$export$c53d0f541b41b88e;
|
|
3954
|
+
sectionType = (0, $af8d31735c159a26$export$c53d0f541b41b88e);
|
|
3978
3955
|
currentKey = null;
|
|
3979
3956
|
transposeKey = null;
|
|
3980
3957
|
/**
|
|
@@ -3982,7 +3959,7 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
3982
3959
|
* @param metadata {Object|Metadata} predefined metadata
|
|
3983
3960
|
*/ constructor(metadata = {}){
|
|
3984
3961
|
super();
|
|
3985
|
-
this.metadata = new $1406c61233580008$export$2e2bcd8739ae039(metadata);
|
|
3962
|
+
this.metadata = new (0, $1406c61233580008$export$2e2bcd8739ae039)(metadata);
|
|
3986
3963
|
}
|
|
3987
3964
|
get previousLine() {
|
|
3988
3965
|
const count = this.lines.length;
|
|
@@ -3994,7 +3971,7 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
3994
3971
|
* if you want to skip the "header lines": the lines that only contain meta data.
|
|
3995
3972
|
* @returns {Line[]} The song body lines
|
|
3996
3973
|
*/ get bodyLines() {
|
|
3997
|
-
return this.selectRenderableItems(
|
|
3974
|
+
return this.selectRenderableItems("_bodyLines", "lines");
|
|
3998
3975
|
}
|
|
3999
3976
|
/**
|
|
4000
3977
|
* Returns the song paragraphs, skipping the paragraphs that only contain empty lines
|
|
@@ -4002,7 +3979,7 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
4002
3979
|
* @see {@link bodyLines}
|
|
4003
3980
|
* @returns {Paragraph[]}
|
|
4004
3981
|
*/ get bodyParagraphs() {
|
|
4005
|
-
return this.selectRenderableItems(
|
|
3982
|
+
return this.selectRenderableItems("_bodyParagraphs", "paragraphs");
|
|
4006
3983
|
}
|
|
4007
3984
|
selectRenderableItems(targetProp, sourceProp) {
|
|
4008
3985
|
if (this[targetProp] === undefined) {
|
|
@@ -4022,23 +3999,23 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
4022
3999
|
this.currentLine.lyrics(chr);
|
|
4023
4000
|
}
|
|
4024
4001
|
addLine(line) {
|
|
4025
|
-
this.currentLine = line || $21a34a464e7bc609$export$13215d9ce4923f76(this.lines, $bc411321e9739719$export$2e2bcd8739ae039);
|
|
4002
|
+
this.currentLine = line || (0, $21a34a464e7bc609$export$13215d9ce4923f76)(this.lines, (0, $bc411321e9739719$export$2e2bcd8739ae039));
|
|
4026
4003
|
this.setCurrentLineType(this.sectionType);
|
|
4027
4004
|
this.currentLine.transposeKey = this.transposeKey ?? this.currentKey;
|
|
4028
|
-
this.currentLine.key = this.currentKey || this.metadata.getSingle($5e9ede69210ec54a$export$7167c830cefcb6b5);
|
|
4005
|
+
this.currentLine.key = this.currentKey || this.metadata.getSingle((0, $5e9ede69210ec54a$export$7167c830cefcb6b5));
|
|
4029
4006
|
return this.currentLine;
|
|
4030
4007
|
}
|
|
4031
4008
|
/**
|
|
4032
4009
|
* The {@link Paragraph} items of which the song consists
|
|
4033
4010
|
* @member {Paragraph[]}
|
|
4034
4011
|
*/ get paragraphs() {
|
|
4035
|
-
let currentParagraph = new $0c3420c6a3e8a9d7$export$2e2bcd8739ae039();
|
|
4012
|
+
let currentParagraph = new (0, $0c3420c6a3e8a9d7$export$2e2bcd8739ae039)();
|
|
4036
4013
|
const paragraphs = [
|
|
4037
4014
|
currentParagraph
|
|
4038
4015
|
];
|
|
4039
4016
|
this.lines.forEach((line)=>{
|
|
4040
4017
|
if (line.isEmpty()) {
|
|
4041
|
-
currentParagraph = new $0c3420c6a3e8a9d7$export$2e2bcd8739ae039();
|
|
4018
|
+
currentParagraph = new (0, $0c3420c6a3e8a9d7$export$2e2bcd8739ae039)();
|
|
4042
4019
|
paragraphs.push(currentParagraph);
|
|
4043
4020
|
} else if (line.hasRenderableItems()) currentParagraph.addLine(line);
|
|
4044
4021
|
});
|
|
@@ -4051,10 +4028,10 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
4051
4028
|
if (this.currentLine === null) this.addLine();
|
|
4052
4029
|
}
|
|
4053
4030
|
addTag(tagContents) {
|
|
4054
|
-
const tag = $5e9ede69210ec54a$export$2e2bcd8739ae039.parse(tagContents);
|
|
4031
|
+
const tag = (0, $5e9ede69210ec54a$export$2e2bcd8739ae039).parse(tagContents);
|
|
4055
4032
|
if (tag.isMetaTag()) this.setMetadata(tag.name, tag.value);
|
|
4056
|
-
else if (tag.name === $5e9ede69210ec54a$export$ae60ab9b4739fc3d) this.transposeKey = tag.value;
|
|
4057
|
-
else if (tag.name === $5e9ede69210ec54a$export$b7627374a6424f68) this.currentKey = tag.value;
|
|
4033
|
+
else if (tag.name === (0, $5e9ede69210ec54a$export$ae60ab9b4739fc3d)) this.transposeKey = tag.value;
|
|
4034
|
+
else if (tag.name === (0, $5e9ede69210ec54a$export$b7627374a6424f68)) this.currentKey = tag.value;
|
|
4058
4035
|
else this.setSectionTypeFromTag(tag);
|
|
4059
4036
|
this.ensureLine();
|
|
4060
4037
|
this.currentLine.addTag(tag);
|
|
@@ -4062,46 +4039,46 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
4062
4039
|
}
|
|
4063
4040
|
setSectionTypeFromTag(tag) {
|
|
4064
4041
|
switch(tag.name){
|
|
4065
|
-
case $5e9ede69210ec54a$export$4f5168acae064e01:
|
|
4066
|
-
this.startSection($af8d31735c159a26$export$8db6c706fc9142b2, tag);
|
|
4042
|
+
case 0, $5e9ede69210ec54a$export$4f5168acae064e01:
|
|
4043
|
+
this.startSection((0, $af8d31735c159a26$export$8db6c706fc9142b2), tag);
|
|
4067
4044
|
break;
|
|
4068
|
-
case $5e9ede69210ec54a$export$473c1a4819e5180b:
|
|
4069
|
-
this.endSection($af8d31735c159a26$export$8db6c706fc9142b2, tag);
|
|
4045
|
+
case 0, $5e9ede69210ec54a$export$473c1a4819e5180b:
|
|
4046
|
+
this.endSection((0, $af8d31735c159a26$export$8db6c706fc9142b2), tag);
|
|
4070
4047
|
break;
|
|
4071
|
-
case $5e9ede69210ec54a$export$8dd1111100e0e88d:
|
|
4072
|
-
this.startSection($af8d31735c159a26$export$f1c9dd0f5207dd5e, tag);
|
|
4048
|
+
case 0, $5e9ede69210ec54a$export$8dd1111100e0e88d:
|
|
4049
|
+
this.startSection((0, $af8d31735c159a26$export$f1c9dd0f5207dd5e), tag);
|
|
4073
4050
|
break;
|
|
4074
|
-
case $5e9ede69210ec54a$export$66a0ef3ffeab32b7:
|
|
4075
|
-
this.endSection($af8d31735c159a26$export$f1c9dd0f5207dd5e, tag);
|
|
4051
|
+
case 0, $5e9ede69210ec54a$export$66a0ef3ffeab32b7:
|
|
4052
|
+
this.endSection((0, $af8d31735c159a26$export$f1c9dd0f5207dd5e), tag);
|
|
4076
4053
|
break;
|
|
4077
|
-
case $5e9ede69210ec54a$export$deca399f8cd9b7dc:
|
|
4078
|
-
this.startSection($af8d31735c159a26$export$4b194284baed1659, tag);
|
|
4054
|
+
case 0, $5e9ede69210ec54a$export$deca399f8cd9b7dc:
|
|
4055
|
+
this.startSection((0, $af8d31735c159a26$export$4b194284baed1659), tag);
|
|
4079
4056
|
break;
|
|
4080
|
-
case $5e9ede69210ec54a$export$640d294ab83f9040:
|
|
4081
|
-
this.endSection($af8d31735c159a26$export$4b194284baed1659, tag);
|
|
4057
|
+
case 0, $5e9ede69210ec54a$export$640d294ab83f9040:
|
|
4058
|
+
this.endSection((0, $af8d31735c159a26$export$4b194284baed1659), tag);
|
|
4082
4059
|
break;
|
|
4083
4060
|
default:
|
|
4084
4061
|
break;
|
|
4085
4062
|
}
|
|
4086
4063
|
}
|
|
4087
4064
|
startSection(sectionType, tag) {
|
|
4088
|
-
this.checkCurrentSectionType($af8d31735c159a26$export$c53d0f541b41b88e, tag);
|
|
4065
|
+
this.checkCurrentSectionType((0, $af8d31735c159a26$export$c53d0f541b41b88e), tag);
|
|
4089
4066
|
this.sectionType = sectionType;
|
|
4090
4067
|
this.setCurrentLineType(sectionType);
|
|
4091
4068
|
}
|
|
4092
4069
|
endSection(sectionType, tag) {
|
|
4093
4070
|
this.checkCurrentSectionType(sectionType, tag);
|
|
4094
|
-
this.sectionType = $af8d31735c159a26$export$c53d0f541b41b88e;
|
|
4071
|
+
this.sectionType = (0, $af8d31735c159a26$export$c53d0f541b41b88e);
|
|
4095
4072
|
}
|
|
4096
4073
|
checkCurrentSectionType(sectionType, tag) {
|
|
4097
4074
|
if (this.sectionType !== sectionType) this.addWarning(`Unexpected tag {${tag.originalName}, current section is: ${this.sectionType}`, tag);
|
|
4098
4075
|
}
|
|
4099
4076
|
addWarning(message, { line: line , column: column }) {
|
|
4100
|
-
const warning = new $ce1dd7d0f2cd2369$export$2e2bcd8739ae039(message, line, column);
|
|
4077
|
+
const warning = new (0, $ce1dd7d0f2cd2369$export$2e2bcd8739ae039)(message, line, column);
|
|
4101
4078
|
this.warnings.push(warning);
|
|
4102
4079
|
}
|
|
4103
4080
|
addItem(item) {
|
|
4104
|
-
if (item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039) this.addTag(item);
|
|
4081
|
+
if (item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)) this.addTag(item);
|
|
4105
4082
|
else {
|
|
4106
4083
|
this.ensureLine();
|
|
4107
4084
|
this.currentLine.addItem(item);
|
|
@@ -4111,8 +4088,7 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
4111
4088
|
* Returns a deep clone of the song
|
|
4112
4089
|
* @returns {Song} The cloned song
|
|
4113
4090
|
*/ clone() {
|
|
4114
|
-
return this.mapItems((item)=>item
|
|
4115
|
-
);
|
|
4091
|
+
return this.mapItems((item)=>item);
|
|
4116
4092
|
}
|
|
4117
4093
|
setMetadata(name, value) {
|
|
4118
4094
|
this.metadata.add(name, value);
|
|
@@ -4122,7 +4098,7 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
4122
4098
|
* @deprecated
|
|
4123
4099
|
* @returns {@link Metadata} The metadata
|
|
4124
4100
|
*/ get metaData() {
|
|
4125
|
-
$21a34a464e7bc609$export$b680e6b2c82f8c2f('metaData has been deprecated, please use metadata instead (notice the lowercase "d")');
|
|
4101
|
+
(0, $21a34a464e7bc609$export$b680e6b2c82f8c2f)('metaData has been deprecated, please use metadata instead (notice the lowercase "d")');
|
|
4126
4102
|
return this.metadata;
|
|
4127
4103
|
}
|
|
4128
4104
|
getMetadata(name) {
|
|
@@ -4137,7 +4113,7 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
4137
4113
|
* - remove any `key` directive
|
|
4138
4114
|
* @returns {Song} The changed song
|
|
4139
4115
|
*/ setKey(key) {
|
|
4140
|
-
return this.changeMetadata($5e9ede69210ec54a$export$7167c830cefcb6b5, key);
|
|
4116
|
+
return this.changeMetadata((0, $5e9ede69210ec54a$export$7167c830cefcb6b5), key);
|
|
4141
4117
|
}
|
|
4142
4118
|
/**
|
|
4143
4119
|
* Returns a copy of the song with the key value set to the specified capo. It changes:
|
|
@@ -4148,17 +4124,13 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
4148
4124
|
* - remove any `capo` directive
|
|
4149
4125
|
* @returns {Song} The changed song
|
|
4150
4126
|
*/ setCapo(capo) {
|
|
4151
|
-
return this.changeMetadata($5e9ede69210ec54a$export$866f445d49bad88e, capo);
|
|
4127
|
+
return this.changeMetadata((0, $5e9ede69210ec54a$export$866f445d49bad88e), capo);
|
|
4152
4128
|
}
|
|
4153
4129
|
setDirective(name, value) {
|
|
4154
|
-
if (value === null) return this.removeItem((item)=>item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039 && item.name === name
|
|
4155
|
-
)
|
|
4156
|
-
return this.updateItem((item)=>item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039 && item.name === name
|
|
4157
|
-
, (item)=>item.set({
|
|
4130
|
+
if (value === null) return this.removeItem((item)=>item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) && item.name === name);
|
|
4131
|
+
return this.updateItem((item)=>item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) && item.name === name, (item)=>item.set({
|
|
4158
4132
|
value: value
|
|
4159
|
-
})
|
|
4160
|
-
, (song)=>song.insertDirective(name, value)
|
|
4161
|
-
);
|
|
4133
|
+
}), (song)=>song.insertDirective(name, value));
|
|
4162
4134
|
}
|
|
4163
4135
|
/**
|
|
4164
4136
|
* Returns a copy of the song with the key set to the specified key. It changes:
|
|
@@ -4170,17 +4142,17 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
|
|
|
4170
4142
|
*/ changeKey(newKey) {
|
|
4171
4143
|
const transpose = this.getTransposeDistance(newKey);
|
|
4172
4144
|
const updatedSong = this.mapItems((item)=>{
|
|
4173
|
-
if (item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039 && item.name === $5e9ede69210ec54a$export$7167c830cefcb6b5) return item.set({
|
|
4145
|
+
if (item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) && item.name === (0, $5e9ede69210ec54a$export$7167c830cefcb6b5)) return item.set({
|
|
4174
4146
|
value: newKey
|
|
4175
4147
|
});
|
|
4176
|
-
if (item instanceof $d454f4215ba01af2$export$2e2bcd8739ae039) return item.transpose(transpose, newKey);
|
|
4148
|
+
if (item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) return item.transpose(transpose, newKey);
|
|
4177
4149
|
return item;
|
|
4178
4150
|
});
|
|
4179
|
-
updatedSong.metadata.set(
|
|
4151
|
+
updatedSong.metadata.set("key", newKey);
|
|
4180
4152
|
return updatedSong;
|
|
4181
4153
|
}
|
|
4182
4154
|
getTransposeDistance(newKey) {
|
|
4183
|
-
const wrappedKey = $bff5407e03fdc8ee$export$2e2bcd8739ae039.wrap(this.key);
|
|
4155
|
+
const wrappedKey = (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(this.key);
|
|
4184
4156
|
if (!wrappedKey) throw new Error(`
|
|
4185
4157
|
Cannot change song key, the original key is unknown.
|
|
4186
4158
|
|
|
@@ -4204,10 +4176,8 @@ Or set the song key before changing key:
|
|
|
4204
4176
|
return updatedSong;
|
|
4205
4177
|
}
|
|
4206
4178
|
insertDirective(name, value, { after: after = null } = {}) {
|
|
4207
|
-
const insertIndex = this.lines.findIndex((line)=>line.items.some((item)=>!(item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039) || after && item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039 && item.name === after
|
|
4208
|
-
|
|
4209
|
-
);
|
|
4210
|
-
const newLine = new $bc411321e9739719$export$2e2bcd8739ae039();
|
|
4179
|
+
const insertIndex = this.lines.findIndex((line)=>line.items.some((item)=>!(item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)) || after && item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) && item.name === after));
|
|
4180
|
+
const newLine = new (0, $bc411321e9739719$export$2e2bcd8739ae039)();
|
|
4211
4181
|
newLine.addTag(name, value);
|
|
4212
4182
|
const clonedSong = this.clone();
|
|
4213
4183
|
const { lines: lines } = clonedSong;
|
|
@@ -4261,8 +4231,7 @@ Or set the song key before changing key:
|
|
|
4261
4231
|
const changedLine = func(line);
|
|
4262
4232
|
if (changedLine) {
|
|
4263
4233
|
clonedSong.addLine();
|
|
4264
|
-
changedLine.items.forEach((item)=>clonedSong.addItem(item)
|
|
4265
|
-
);
|
|
4234
|
+
changedLine.items.forEach((item)=>clonedSong.addItem(item));
|
|
4266
4235
|
}
|
|
4267
4236
|
});
|
|
4268
4237
|
return clonedSong;
|
|
@@ -4303,7 +4272,7 @@ var $6f653df65dfdf4ef$export$2e2bcd8739ae039 = $6f653df65dfdf4ef$var$Song;
|
|
|
4303
4272
|
class $55622b65d99fa8e1$var$EvaluationError extends Error {
|
|
4304
4273
|
constructor(message, line, column, offset){
|
|
4305
4274
|
super(`${message} on line ${line} column ${column}`);
|
|
4306
|
-
this.name =
|
|
4275
|
+
this.name = "ExpressionError";
|
|
4307
4276
|
this.line = line;
|
|
4308
4277
|
this.column = column;
|
|
4309
4278
|
this.offset = offset;
|
|
@@ -4320,16 +4289,14 @@ class $812df3771838671d$var$Composite {
|
|
|
4320
4289
|
this.variable = variable;
|
|
4321
4290
|
}
|
|
4322
4291
|
evaluate(metadata, metadataSeparator) {
|
|
4323
|
-
return this.expressions.map((expression)=>expression.evaluate(metadata, metadataSeparator, this.variable)
|
|
4324
|
-
).join('');
|
|
4292
|
+
return this.expressions.map((expression)=>expression.evaluate(metadata, metadataSeparator, this.variable)).join("");
|
|
4325
4293
|
}
|
|
4326
4294
|
isRenderable() {
|
|
4327
4295
|
return true;
|
|
4328
4296
|
}
|
|
4329
4297
|
clone() {
|
|
4330
4298
|
return new $812df3771838671d$var$Composite({
|
|
4331
|
-
expressions: this.expressions.map((expression)=>expression.clone()
|
|
4332
|
-
),
|
|
4299
|
+
expressions: this.expressions.map((expression)=>expression.clone()),
|
|
4333
4300
|
variable: this.variable
|
|
4334
4301
|
});
|
|
4335
4302
|
}
|
|
@@ -4338,7 +4305,7 @@ var $812df3771838671d$export$2e2bcd8739ae039 = $812df3771838671d$var$Composite;
|
|
|
4338
4305
|
|
|
4339
4306
|
|
|
4340
4307
|
|
|
4341
|
-
class $b6d84b168638423d$var$Ternary extends $cf00b4d3af89fa07$export$2e2bcd8739ae039 {
|
|
4308
|
+
class $b6d84b168638423d$var$Ternary extends (0, $cf00b4d3af89fa07$export$2e2bcd8739ae039) {
|
|
4342
4309
|
trueExpression = [];
|
|
4343
4310
|
falseExpression = [];
|
|
4344
4311
|
constructor({ variable: variable = null , valueTest: valueTest = null , trueExpression: trueExpression = null , falseExpression: falseExpression = null , line: line = null , column: column = null , offset: offset = null , } = {}){
|
|
@@ -4347,7 +4314,7 @@ class $b6d84b168638423d$var$Ternary extends $cf00b4d3af89fa07$export$2e2bcd8739a
|
|
|
4347
4314
|
column: column,
|
|
4348
4315
|
offset: offset
|
|
4349
4316
|
});
|
|
4350
|
-
this.variable = $21a34a464e7bc609$export$ed9b06b5ee264ad3(variable);
|
|
4317
|
+
this.variable = (0, $21a34a464e7bc609$export$ed9b06b5ee264ad3)(variable);
|
|
4351
4318
|
this.valueTest = valueTest;
|
|
4352
4319
|
this.trueExpression = trueExpression;
|
|
4353
4320
|
this.falseExpression = falseExpression;
|
|
@@ -4359,7 +4326,7 @@ class $b6d84b168638423d$var$Ternary extends $cf00b4d3af89fa07$export$2e2bcd8739a
|
|
|
4359
4326
|
* @returns {string} The evaluated expression
|
|
4360
4327
|
*/ evaluate(metadata, metadataSeparator = null, upperContext = null) {
|
|
4361
4328
|
if (this.variable) return this.evaluateWithVariable(metadata, metadataSeparator);
|
|
4362
|
-
if (!upperContext) throw new $55622b65d99fa8e1$export$2e2bcd8739ae039(
|
|
4329
|
+
if (!upperContext) throw new (0, $55622b65d99fa8e1$export$2e2bcd8739ae039)("Unexpected empty expression", this.line, this.column, this.offset);
|
|
4363
4330
|
return this.evaluateToString(metadata.get(upperContext), metadataSeparator);
|
|
4364
4331
|
}
|
|
4365
4332
|
evaluateToString(value, metadataSeparator) {
|
|
@@ -4368,12 +4335,12 @@ class $b6d84b168638423d$var$Ternary extends $cf00b4d3af89fa07$export$2e2bcd8739a
|
|
|
4368
4335
|
}
|
|
4369
4336
|
evaluateWithVariable(metadata, metadataSeparator) {
|
|
4370
4337
|
const value = metadata.get(this.variable);
|
|
4371
|
-
if ($21a34a464e7bc609$export$ee27c052bca048fb(value) && (!this.valueTest || value === this.valueTest)) return this.evaluateForTruthyValue(metadata, metadataSeparator, value);
|
|
4372
|
-
if (this.falseExpression) return new $812df3771838671d$export$2e2bcd8739ae039(this.falseExpression, this.variable).evaluate(metadata, metadataSeparator);
|
|
4373
|
-
return
|
|
4338
|
+
if ((0, $21a34a464e7bc609$export$ee27c052bca048fb)(value) && (!this.valueTest || value === this.valueTest)) return this.evaluateForTruthyValue(metadata, metadataSeparator, value);
|
|
4339
|
+
if (this.falseExpression) return new (0, $812df3771838671d$export$2e2bcd8739ae039)(this.falseExpression, this.variable).evaluate(metadata, metadataSeparator);
|
|
4340
|
+
return "";
|
|
4374
4341
|
}
|
|
4375
4342
|
evaluateForTruthyValue(metadata, metadataSeparator, value) {
|
|
4376
|
-
if (this.trueExpression) return new $812df3771838671d$export$2e2bcd8739ae039(this.trueExpression, this.variable).evaluate(metadata, metadataSeparator);
|
|
4343
|
+
if (this.trueExpression) return new (0, $812df3771838671d$export$2e2bcd8739ae039)(this.trueExpression, this.variable).evaluate(metadata, metadataSeparator);
|
|
4377
4344
|
return value;
|
|
4378
4345
|
}
|
|
4379
4346
|
isRenderable() {
|
|
@@ -4383,10 +4350,8 @@ class $b6d84b168638423d$var$Ternary extends $cf00b4d3af89fa07$export$2e2bcd8739a
|
|
|
4383
4350
|
return new $b6d84b168638423d$var$Ternary({
|
|
4384
4351
|
variable: this.variable,
|
|
4385
4352
|
valueTest: this.valueTest,
|
|
4386
|
-
trueExpression: this.trueExpression?.map((part)=>part.clone()
|
|
4387
|
-
),
|
|
4388
|
-
falseExpression: this.falseExpression?.map((part)=>part.clone()
|
|
4389
|
-
),
|
|
4353
|
+
trueExpression: this.trueExpression?.map((part)=>part.clone()),
|
|
4354
|
+
falseExpression: this.falseExpression?.map((part)=>part.clone()),
|
|
4390
4355
|
line: this.line,
|
|
4391
4356
|
column: this.column,
|
|
4392
4357
|
offset: this.offset
|
|
@@ -4397,12 +4362,12 @@ var $b6d84b168638423d$export$2e2bcd8739ae039 = $b6d84b168638423d$var$Ternary;
|
|
|
4397
4362
|
|
|
4398
4363
|
|
|
4399
4364
|
|
|
4400
|
-
const $1c14afc274b727b7$var$CHORD_SHEET =
|
|
4401
|
-
const $1c14afc274b727b7$var$CHORD_LYRICS_PAIR =
|
|
4402
|
-
const $1c14afc274b727b7$var$TAG =
|
|
4403
|
-
const $1c14afc274b727b7$var$COMMENT =
|
|
4404
|
-
const $1c14afc274b727b7$var$TERNARY =
|
|
4405
|
-
const $1c14afc274b727b7$var$LINE =
|
|
4365
|
+
const $1c14afc274b727b7$var$CHORD_SHEET = "chordSheet";
|
|
4366
|
+
const $1c14afc274b727b7$var$CHORD_LYRICS_PAIR = "chordLyricsPair";
|
|
4367
|
+
const $1c14afc274b727b7$var$TAG = "tag";
|
|
4368
|
+
const $1c14afc274b727b7$var$COMMENT = "comment";
|
|
4369
|
+
const $1c14afc274b727b7$var$TERNARY = "ternary";
|
|
4370
|
+
const $1c14afc274b727b7$var$LINE = "line";
|
|
4406
4371
|
/**
|
|
4407
4372
|
* Serializes a song into een plain object, and deserializes the serialized object back into a {@link Song}
|
|
4408
4373
|
*/ class $1c14afc274b727b7$var$ChordSheetSerializer {
|
|
@@ -4413,22 +4378,20 @@ const $1c14afc274b727b7$var$LINE = 'line';
|
|
|
4413
4378
|
*/ serialize(song) {
|
|
4414
4379
|
return {
|
|
4415
4380
|
type: $1c14afc274b727b7$var$CHORD_SHEET,
|
|
4416
|
-
lines: song.lines.map((line)=>this.serializeLine(line)
|
|
4417
|
-
)
|
|
4381
|
+
lines: song.lines.map((line)=>this.serializeLine(line))
|
|
4418
4382
|
};
|
|
4419
4383
|
}
|
|
4420
4384
|
serializeLine(line) {
|
|
4421
4385
|
return {
|
|
4422
4386
|
type: $1c14afc274b727b7$var$LINE,
|
|
4423
|
-
items: line.items.map((item)=>this.serializeItem(item)
|
|
4424
|
-
)
|
|
4387
|
+
items: line.items.map((item)=>this.serializeItem(item))
|
|
4425
4388
|
};
|
|
4426
4389
|
}
|
|
4427
4390
|
serializeItem(item) {
|
|
4428
|
-
if (item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039) return this.serializeTag(item);
|
|
4429
|
-
if (item instanceof $d454f4215ba01af2$export$2e2bcd8739ae039) return this.serializeChordLyricsPair(item);
|
|
4430
|
-
if (item instanceof $b6d84b168638423d$export$2e2bcd8739ae039) return this.serializeTernary(item);
|
|
4431
|
-
if (item instanceof $e1378a714a1834c5$export$2e2bcd8739ae039) return this.serializeLiteral(item);
|
|
4391
|
+
if (item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)) return this.serializeTag(item);
|
|
4392
|
+
if (item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) return this.serializeChordLyricsPair(item);
|
|
4393
|
+
if (item instanceof (0, $b6d84b168638423d$export$2e2bcd8739ae039)) return this.serializeTernary(item);
|
|
4394
|
+
if (item instanceof (0, $e1378a714a1834c5$export$2e2bcd8739ae039)) return this.serializeLiteral(item);
|
|
4432
4395
|
throw new Error(`Don't know how to serialize ${item.constructor.name}`);
|
|
4433
4396
|
}
|
|
4434
4397
|
serializeTag(tag) {
|
|
@@ -4458,8 +4421,7 @@ const $1c14afc274b727b7$var$LINE = 'line';
|
|
|
4458
4421
|
return literal.string;
|
|
4459
4422
|
}
|
|
4460
4423
|
serializeExpression(expression) {
|
|
4461
|
-
return expression?.map((part)=>this.serializeItem(part)
|
|
4462
|
-
);
|
|
4424
|
+
return expression?.map((part)=>this.serializeItem(part));
|
|
4463
4425
|
}
|
|
4464
4426
|
/**
|
|
4465
4427
|
* Deserializes a song that has been serialized using {@link serialize}
|
|
@@ -4471,7 +4433,7 @@ const $1c14afc274b727b7$var$LINE = 'line';
|
|
|
4471
4433
|
}
|
|
4472
4434
|
parseAstComponent(astComponent) {
|
|
4473
4435
|
if (!astComponent) return null;
|
|
4474
|
-
if (typeof astComponent ===
|
|
4436
|
+
if (typeof astComponent === "string") return new (0, $e1378a714a1834c5$export$2e2bcd8739ae039)(astComponent);
|
|
4475
4437
|
const { type: type } = astComponent;
|
|
4476
4438
|
switch(type){
|
|
4477
4439
|
case $1c14afc274b727b7$var$CHORD_SHEET:
|
|
@@ -4491,9 +4453,8 @@ const $1c14afc274b727b7$var$LINE = 'line';
|
|
|
4491
4453
|
}
|
|
4492
4454
|
parseChordSheet(astComponent) {
|
|
4493
4455
|
const { lines: lines } = astComponent;
|
|
4494
|
-
this.song = new $6f653df65dfdf4ef$export$2e2bcd8739ae039();
|
|
4495
|
-
lines.forEach((line)=>this.parseLine(line)
|
|
4496
|
-
);
|
|
4456
|
+
this.song = new (0, $6f653df65dfdf4ef$export$2e2bcd8739ae039)();
|
|
4457
|
+
lines.forEach((line)=>this.parseLine(line));
|
|
4497
4458
|
}
|
|
4498
4459
|
parseLine(astComponent) {
|
|
4499
4460
|
const { items: items } = astComponent;
|
|
@@ -4505,11 +4466,11 @@ const $1c14afc274b727b7$var$LINE = 'line';
|
|
|
4505
4466
|
}
|
|
4506
4467
|
parseChordLyricsPair(astComponent) {
|
|
4507
4468
|
const { chords: chords , lyrics: lyrics } = astComponent;
|
|
4508
|
-
return new $d454f4215ba01af2$export$2e2bcd8739ae039(chords, lyrics);
|
|
4469
|
+
return new (0, $d454f4215ba01af2$export$2e2bcd8739ae039)(chords, lyrics);
|
|
4509
4470
|
}
|
|
4510
4471
|
parseTag(astComponent) {
|
|
4511
4472
|
const { name: name , value: value , location: { offset: offset = null , line: line = null , column: column = null } = {} , } = astComponent;
|
|
4512
|
-
return new $5e9ede69210ec54a$export$2e2bcd8739ae039(name, value, {
|
|
4473
|
+
return new (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)(name, value, {
|
|
4513
4474
|
line: line,
|
|
4514
4475
|
column: column,
|
|
4515
4476
|
offset: offset
|
|
@@ -4517,11 +4478,11 @@ const $1c14afc274b727b7$var$LINE = 'line';
|
|
|
4517
4478
|
}
|
|
4518
4479
|
parseComment(astComponent) {
|
|
4519
4480
|
const { comment: comment } = astComponent;
|
|
4520
|
-
return new $2115988b22311cb1$export$2e2bcd8739ae039(comment);
|
|
4481
|
+
return new (0, $2115988b22311cb1$export$2e2bcd8739ae039)(comment);
|
|
4521
4482
|
}
|
|
4522
4483
|
parseTernary(astComponent) {
|
|
4523
4484
|
const { variable: variable , valueTest: valueTest , trueExpression: trueExpression , falseExpression: falseExpression , location: { offset: offset = null , line: line = null , column: column = null } = {} , } = astComponent;
|
|
4524
|
-
return new $b6d84b168638423d$export$2e2bcd8739ae039({
|
|
4485
|
+
return new (0, $b6d84b168638423d$export$2e2bcd8739ae039)({
|
|
4525
4486
|
variable: variable,
|
|
4526
4487
|
valueTest: valueTest,
|
|
4527
4488
|
trueExpression: this.parseExpression(trueExpression),
|
|
@@ -4532,9 +4493,8 @@ const $1c14afc274b727b7$var$LINE = 'line';
|
|
|
4532
4493
|
});
|
|
4533
4494
|
}
|
|
4534
4495
|
parseExpression(expression) {
|
|
4535
|
-
const parsedParts = (expression || []).map((part)=>this.parseAstComponent(part)
|
|
4536
|
-
);
|
|
4537
|
-
return $21a34a464e7bc609$export$ed9b06b5ee264ad3(parsedParts);
|
|
4496
|
+
const parsedParts = (expression || []).map((part)=>this.parseAstComponent(part));
|
|
4497
|
+
return (0, $21a34a464e7bc609$export$ed9b06b5ee264ad3)(parsedParts);
|
|
4538
4498
|
}
|
|
4539
4499
|
}
|
|
4540
4500
|
var $1c14afc274b727b7$export$2e2bcd8739ae039 = $1c14afc274b727b7$var$ChordSheetSerializer;
|
|
@@ -4548,12 +4508,8 @@ var $1c14afc274b727b7$export$2e2bcd8739ae039 = $1c14afc274b727b7$var$ChordSheetS
|
|
|
4548
4508
|
* @param {string} chordProChordSheet the ChordPro chord sheet
|
|
4549
4509
|
* @returns {Song} The parsed song
|
|
4550
4510
|
*/ parse(chordProChordSheet) {
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
* @member
|
|
4554
|
-
* @type {ParserWarning[]}
|
|
4555
|
-
*/ const ast = $1a506a341538d943$export$98e6a39c04603d36(chordProChordSheet);
|
|
4556
|
-
this.song = new $1c14afc274b727b7$export$2e2bcd8739ae039().deserialize(ast);
|
|
4511
|
+
const ast = (0, $1a506a341538d943$export$98e6a39c04603d36)(chordProChordSheet);
|
|
4512
|
+
this.song = new (0, $1c14afc274b727b7$export$2e2bcd8739ae039)().deserialize(ast);
|
|
4557
4513
|
return this.song;
|
|
4558
4514
|
}
|
|
4559
4515
|
/**
|
|
@@ -4616,8 +4572,8 @@ const $c049675f48c823b2$var$CHORD_LINE_REGEX = /^\s*((([A-G])(#|b)?([^/\s]*)(\/(
|
|
|
4616
4572
|
} else this.chordLyricsPair.lyrics = `${line}`;
|
|
4617
4573
|
}
|
|
4618
4574
|
initialize(document, { song: song = null } = {}) {
|
|
4619
|
-
this.song = song || new $6f653df65dfdf4ef$export$2e2bcd8739ae039();
|
|
4620
|
-
this.lines = document.split(
|
|
4575
|
+
this.song = song || new (0, $6f653df65dfdf4ef$export$2e2bcd8739ae039)();
|
|
4576
|
+
this.lines = document.split("\n");
|
|
4621
4577
|
this.currentLine = 0;
|
|
4622
4578
|
this.lineCount = this.lines.length;
|
|
4623
4579
|
this.processingText = true;
|
|
@@ -4643,7 +4599,7 @@ const $c049675f48c823b2$var$CHORD_LINE_REGEX = /^\s*((([A-G])(#|b)?([^/\s]*)(\/(
|
|
|
4643
4599
|
const nextChar = chordsLine[c + 1];
|
|
4644
4600
|
const isWhiteSpace = $c049675f48c823b2$var$WHITE_SPACE.test(chr);
|
|
4645
4601
|
this.addCharacter(chr, nextChar);
|
|
4646
|
-
this.chordLyricsPair.lyrics += lyricsLine[c] ||
|
|
4602
|
+
this.chordLyricsPair.lyrics += lyricsLine[c] || "";
|
|
4647
4603
|
this.processingText = !isWhiteSpace;
|
|
4648
4604
|
}
|
|
4649
4605
|
}
|
|
@@ -4672,30 +4628,30 @@ const $db9c80925e255cd2$var$VERSE_LINE_REGEX = /^\[Verse.*]/;
|
|
|
4672
4628
|
const $db9c80925e255cd2$var$CHORUS_LINE_REGEX = /^\[Chorus]/;
|
|
4673
4629
|
const $db9c80925e255cd2$var$OTHER_METADATA_LINE_REGEX = /^\[([^\]]+)]/;
|
|
4674
4630
|
const $db9c80925e255cd2$var$startSectionTags = {
|
|
4675
|
-
[$af8d31735c159a26$export$4b194284baed1659]: $5e9ede69210ec54a$export$deca399f8cd9b7dc,
|
|
4676
|
-
[$af8d31735c159a26$export$8db6c706fc9142b2]: $5e9ede69210ec54a$export$4f5168acae064e01
|
|
4631
|
+
[(0, $af8d31735c159a26$export$4b194284baed1659)]: (0, $5e9ede69210ec54a$export$deca399f8cd9b7dc),
|
|
4632
|
+
[(0, $af8d31735c159a26$export$8db6c706fc9142b2)]: (0, $5e9ede69210ec54a$export$4f5168acae064e01)
|
|
4677
4633
|
};
|
|
4678
4634
|
const $db9c80925e255cd2$var$endSectionTags = {
|
|
4679
|
-
[$af8d31735c159a26$export$4b194284baed1659]: $5e9ede69210ec54a$export$640d294ab83f9040,
|
|
4680
|
-
[$af8d31735c159a26$export$8db6c706fc9142b2]: $5e9ede69210ec54a$export$473c1a4819e5180b
|
|
4635
|
+
[(0, $af8d31735c159a26$export$4b194284baed1659)]: (0, $5e9ede69210ec54a$export$640d294ab83f9040),
|
|
4636
|
+
[(0, $af8d31735c159a26$export$8db6c706fc9142b2)]: (0, $5e9ede69210ec54a$export$473c1a4819e5180b)
|
|
4681
4637
|
};
|
|
4682
4638
|
/**
|
|
4683
4639
|
* Parses an Ultimate Guitar chord sheet with metadata
|
|
4684
4640
|
* Inherits from {@link ChordSheetParser}
|
|
4685
|
-
*/ class $db9c80925e255cd2$var$UltimateGuitarParser extends $c049675f48c823b2$export$2e2bcd8739ae039 {
|
|
4641
|
+
*/ class $db9c80925e255cd2$var$UltimateGuitarParser extends (0, $c049675f48c823b2$export$2e2bcd8739ae039) {
|
|
4686
4642
|
parseLine(line) {
|
|
4687
4643
|
if (this.isSectionEnd()) this.endSection();
|
|
4688
4644
|
if ($db9c80925e255cd2$var$VERSE_LINE_REGEX.test(line)) {
|
|
4689
4645
|
this.startNewLine();
|
|
4690
|
-
this.startSection($af8d31735c159a26$export$4b194284baed1659);
|
|
4646
|
+
this.startSection((0, $af8d31735c159a26$export$4b194284baed1659));
|
|
4691
4647
|
} else if ($db9c80925e255cd2$var$CHORUS_LINE_REGEX.test(line)) {
|
|
4692
4648
|
this.startNewLine();
|
|
4693
|
-
this.startSection($af8d31735c159a26$export$8db6c706fc9142b2);
|
|
4649
|
+
this.startSection((0, $af8d31735c159a26$export$8db6c706fc9142b2));
|
|
4694
4650
|
} else if ($db9c80925e255cd2$var$OTHER_METADATA_LINE_REGEX.test(line)) {
|
|
4695
4651
|
this.startNewLine();
|
|
4696
4652
|
this.endSection();
|
|
4697
4653
|
const comment = line.match($db9c80925e255cd2$var$OTHER_METADATA_LINE_REGEX)[1];
|
|
4698
|
-
this.songLine.addTag(new $5e9ede69210ec54a$export$2e2bcd8739ae039($5e9ede69210ec54a$export$a29989082612d0d9, comment));
|
|
4654
|
+
this.songLine.addTag(new (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)((0, $5e9ede69210ec54a$export$a29989082612d0d9), comment));
|
|
4699
4655
|
} else super.parseLine(line);
|
|
4700
4656
|
}
|
|
4701
4657
|
isSectionEnd() {
|
|
@@ -4712,14 +4668,14 @@ const $db9c80925e255cd2$var$endSectionTags = {
|
|
|
4712
4668
|
if (this.currentSectionType) this.endSection();
|
|
4713
4669
|
this.currentSectionType = sectionType;
|
|
4714
4670
|
this.song.setCurrentLineType(sectionType);
|
|
4715
|
-
if (sectionType in $db9c80925e255cd2$var$startSectionTags) this.song.addTag(new $5e9ede69210ec54a$export$2e2bcd8739ae039($db9c80925e255cd2$var$startSectionTags[sectionType]));
|
|
4671
|
+
if (sectionType in $db9c80925e255cd2$var$startSectionTags) this.song.addTag(new (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)($db9c80925e255cd2$var$startSectionTags[sectionType]));
|
|
4716
4672
|
}
|
|
4717
4673
|
endSection({ addNewLine: addNewLine = true } = {}) {
|
|
4718
4674
|
if (this.currentSectionType in $db9c80925e255cd2$var$endSectionTags) {
|
|
4719
|
-
this.song.addTag(new $5e9ede69210ec54a$export$2e2bcd8739ae039($db9c80925e255cd2$var$endSectionTags[this.currentSectionType]));
|
|
4675
|
+
this.song.addTag(new (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)($db9c80925e255cd2$var$endSectionTags[this.currentSectionType]));
|
|
4720
4676
|
if (addNewLine) this.startNewLine();
|
|
4721
4677
|
}
|
|
4722
|
-
this.song.setCurrentLineType($af8d31735c159a26$export$c53d0f541b41b88e);
|
|
4678
|
+
this.song.setCurrentLineType((0, $af8d31735c159a26$export$c53d0f541b41b88e));
|
|
4723
4679
|
this.currentSectionType = null;
|
|
4724
4680
|
}
|
|
4725
4681
|
startNewLine() {
|
|
@@ -4740,13 +4696,13 @@ var $71c330be198ce421$export$2e2bcd8739ae039 = $71c330be198ce421$var$MetadataCon
|
|
|
4740
4696
|
|
|
4741
4697
|
class $bbcfd2c49e8e9957$var$Configuration {
|
|
4742
4698
|
constructor({ evaluate: evaluate = false , metadata: metadata = {
|
|
4743
|
-
separator:
|
|
4699
|
+
separator: ","
|
|
4744
4700
|
} }){
|
|
4745
4701
|
this.evaluate = evaluate;
|
|
4746
|
-
this.metadata = new $71c330be198ce421$export$2e2bcd8739ae039(metadata);
|
|
4702
|
+
this.metadata = new (0, $71c330be198ce421$export$2e2bcd8739ae039)(metadata);
|
|
4747
4703
|
}
|
|
4748
4704
|
get(key) {
|
|
4749
|
-
return ($parcel$interopDefault($988mA$lodashget))(this, key);
|
|
4705
|
+
return (0, ($parcel$interopDefault($988mA$lodashget)))(this, key);
|
|
4750
4706
|
}
|
|
4751
4707
|
}
|
|
4752
4708
|
var $bbcfd2c49e8e9957$export$2e2bcd8739ae039 = $bbcfd2c49e8e9957$var$Configuration;
|
|
@@ -4764,7 +4720,7 @@ var $bbcfd2c49e8e9957$export$2e2bcd8739ae039 = $bbcfd2c49e8e9957$var$Configurati
|
|
|
4764
4720
|
* @param {string} [configuration.metadata.separator=", "] The separator to be used when rendering a metadata value
|
|
4765
4721
|
* that has multiple values. See: https://bit.ly/2SC9c2u
|
|
4766
4722
|
*/ constructor(configuration = {}){
|
|
4767
|
-
this.configuration = new $bbcfd2c49e8e9957$export$2e2bcd8739ae039(configuration);
|
|
4723
|
+
this.configuration = new (0, $bbcfd2c49e8e9957$export$2e2bcd8739ae039)(configuration);
|
|
4768
4724
|
}
|
|
4769
4725
|
}
|
|
4770
4726
|
var $0055ecb09272ba2d$export$2e2bcd8739ae039 = $0055ecb09272ba2d$var$Formatter;
|
|
@@ -4776,33 +4732,33 @@ var $0055ecb09272ba2d$export$2e2bcd8739ae039 = $0055ecb09272ba2d$var$Formatter;
|
|
|
4776
4732
|
|
|
4777
4733
|
|
|
4778
4734
|
var $37d1d6d5b59826cf$exports = {};
|
|
4779
|
-
$37d1d6d5b59826cf$exports = JSON.parse(
|
|
4735
|
+
$37d1d6d5b59826cf$exports = JSON.parse('{"majorKeys":["A","Bb","B","C","C#","Db","D","Eb","E","F","F#","Gb","G","G#","Ab"],"minorKeys":["F#m","Gm","G#m","Am","Bbm","Bm","Cm","C#m","Dm","D#m","Ebm","Em","Fm"],"capos":{"Bb":{"1":"A","3":"G","6":"E","8":"D","10":"C"},"D":{"2":"C","5":"A","7":"G","10":"E"},"Eb":{"1":"D","3":"C","6":"A","8":"G"},"Db":{"1":"C","4":"A","6":"G","9":"E"},"C#":{"1":"C","4":"A","6":"G","9":"E"},"E":{"2":"D","4":"C","7":"A","9":"G"},"F":{"1":"E","3":"D","5":"C","6":"B","8":"A","10":"G"},"F#":{"2":"E","4":"D","6":"C","7":"B","9":"A"},"Gb":{"2":"E","4":"D","6":"C","7":"B","9":"A"},"G":{"3":"E","5":"D","7":"C","8":"B","10":"A"},"G#":{"1":"G","4":"E","6":"D","8":"C"},"Ab":{"1":"G","4":"E","6":"D","8":"C"},"A":{"2":"G","5":"E","7":"D","9":"C"},"B":{"2":"A","4":"G","7":"E","9":"D"},"C":{"3":"A","5":"G","8":"E","10":"D"},"Am":{"3":"F#m","5":"Em","7":"Dm"},"Bbm":{"1":"Am","4":"F#m","6":"Em","8":"Dm"},"Bm":{"2":"Am","5":"F#m","7":"Em"},"Cm":{"1":"Bm","3":"Am","6":"F#m","8":"Em"},"C#m":{"2":"Bm","4":"Am","7":"F#m","9":"Em"},"Dm":{"3":"Bm","5":"Am","8":"F#m"},"Ebm":{"1":"Dm","4":"Bm","6":"Am"},"D#m":{"1":"Dm","4":"Bm","6":"Am"}}}');
|
|
4780
4736
|
|
|
4781
4737
|
|
|
4782
4738
|
function $dfecd32049fa58e9$export$fd31a53e6281557e(transposeKey, songKey) {
|
|
4783
4739
|
if (/^\d+$/.test(transposeKey)) return parseInt(transposeKey, 10);
|
|
4784
|
-
return $bff5407e03fdc8ee$export$2e2bcd8739ae039.distance(songKey, transposeKey);
|
|
4740
|
+
return (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).distance(songKey, transposeKey);
|
|
4785
4741
|
}
|
|
4786
4742
|
function $dfecd32049fa58e9$var$chordTransposeDistance(capo, transposeKey, songKey) {
|
|
4787
4743
|
let transpose = -1 * (capo || 0);
|
|
4788
|
-
if ($21a34a464e7bc609$export$ee27c052bca048fb(transposeKey) && $21a34a464e7bc609$export$ee27c052bca048fb(songKey)) transpose += $dfecd32049fa58e9$export$fd31a53e6281557e(transposeKey, songKey);
|
|
4744
|
+
if ((0, $21a34a464e7bc609$export$ee27c052bca048fb)(transposeKey) && (0, $21a34a464e7bc609$export$ee27c052bca048fb)(songKey)) transpose += $dfecd32049fa58e9$export$fd31a53e6281557e(transposeKey, songKey);
|
|
4789
4745
|
return transpose;
|
|
4790
4746
|
}
|
|
4791
4747
|
function $dfecd32049fa58e9$export$596ec52955da9472(chord, lineKey, transposeKey, song) {
|
|
4792
|
-
let chordObj = $26f57998457eb2d4$export$2e2bcd8739ae039.parse(chord);
|
|
4748
|
+
let chordObj = (0, $26f57998457eb2d4$export$2e2bcd8739ae039).parse(chord);
|
|
4793
4749
|
const { capo: capo , key: songKey } = song;
|
|
4794
4750
|
if (!chordObj) return chord;
|
|
4795
4751
|
chordObj = chordObj.transpose($dfecd32049fa58e9$var$chordTransposeDistance(capo, transposeKey, songKey));
|
|
4796
|
-
if ($21a34a464e7bc609$export$ee27c052bca048fb(transposeKey)) chordObj = chordObj.useModifier(transposeKey.modifier);
|
|
4797
|
-
if ($21a34a464e7bc609$export$ee27c052bca048fb(lineKey)) chordObj = chordObj.normalize(lineKey);
|
|
4752
|
+
if ((0, $21a34a464e7bc609$export$ee27c052bca048fb)(transposeKey)) chordObj = chordObj.useModifier(transposeKey.modifier);
|
|
4753
|
+
if ((0, $21a34a464e7bc609$export$ee27c052bca048fb)(lineKey)) chordObj = chordObj.normalize(lineKey);
|
|
4798
4754
|
return chordObj.toString();
|
|
4799
4755
|
}
|
|
4800
4756
|
function $dfecd32049fa58e9$export$b07b16221c14aaa(key) {
|
|
4801
|
-
return $37d1d6d5b59826cf$exports.capos[$bff5407e03fdc8ee$export$2e2bcd8739ae039.toString(key)];
|
|
4757
|
+
return (0, $37d1d6d5b59826cf$exports.capos)[(0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).toString(key)];
|
|
4802
4758
|
}
|
|
4803
4759
|
function $dfecd32049fa58e9$export$74743eda5dda3ccf(key) {
|
|
4804
|
-
const keyObj = $bff5407e03fdc8ee$export$2e2bcd8739ae039.wrap(key);
|
|
4805
|
-
return keyObj.isMinor() ? $37d1d6d5b59826cf$exports.minorKeys : $37d1d6d5b59826cf$exports.majorKeys;
|
|
4760
|
+
const keyObj = (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(key);
|
|
4761
|
+
return keyObj.isMinor() ? (0, $37d1d6d5b59826cf$exports.minorKeys) : (0, $37d1d6d5b59826cf$exports.majorKeys);
|
|
4806
4762
|
}
|
|
4807
4763
|
|
|
4808
4764
|
|
|
@@ -4812,53 +4768,45 @@ function $dfecd32049fa58e9$export$74743eda5dda3ccf(key) {
|
|
|
4812
4768
|
|
|
4813
4769
|
|
|
4814
4770
|
|
|
4815
|
-
const $376e205ced98486b$var$lineHasContents = (line)=>line.items.some((item)=>item.isRenderable()
|
|
4816
|
-
|
|
4817
|
-
;
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper('isChordLyricsPair', (item)=>item instanceof $d454f4215ba01af2$export$2e2bcd8739ae039
|
|
4822
|
-
);
|
|
4823
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper('isTag', (item)=>item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039
|
|
4824
|
-
);
|
|
4825
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper('isComment', (item)=>item.name === 'comment'
|
|
4826
|
-
);
|
|
4827
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper('shouldRenderLine', (line, options)=>{
|
|
4771
|
+
const $376e205ced98486b$var$lineHasContents = (line)=>line.items.some((item)=>item.isRenderable());
|
|
4772
|
+
const $376e205ced98486b$export$b8d631d9200974fa = (line)=>line.items.some((item)=>item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039) && item.lyrics || item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) && item.isRenderable() || (0, $21a34a464e7bc609$export$e3f63561d52b936d)(item));
|
|
4773
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("isChordLyricsPair", (item)=>item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039));
|
|
4774
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("isTag", (item)=>item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039));
|
|
4775
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("isComment", (item)=>item.name === "comment");
|
|
4776
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("shouldRenderLine", (line, options)=>{
|
|
4828
4777
|
if (options.data.root.renderBlankLines) return true;
|
|
4829
4778
|
return $376e205ced98486b$var$lineHasContents(line);
|
|
4830
4779
|
});
|
|
4831
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper(
|
|
4832
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper(
|
|
4833
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper(
|
|
4834
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper(
|
|
4780
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("hasChordContents", (0, $21a34a464e7bc609$export$d332d76d125f0cbe));
|
|
4781
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("hasTextContents", $376e205ced98486b$export$b8d631d9200974fa);
|
|
4782
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("lineHasContents", $376e205ced98486b$var$lineHasContents);
|
|
4783
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("lineClasses", (line)=>{
|
|
4835
4784
|
const classes = [
|
|
4836
|
-
|
|
4785
|
+
"row"
|
|
4837
4786
|
];
|
|
4838
|
-
if (!$376e205ced98486b$var$lineHasContents(line)) classes.push(
|
|
4839
|
-
return classes.join(
|
|
4787
|
+
if (!$376e205ced98486b$var$lineHasContents(line)) classes.push("empty-line");
|
|
4788
|
+
return classes.join(" ");
|
|
4840
4789
|
});
|
|
4841
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper(
|
|
4842
|
-
)
|
|
4843
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper('paragraphClasses', (paragraph)=>{
|
|
4790
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("toUpperCase", (line)=>line.toUpperCase());
|
|
4791
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("paragraphClasses", (paragraph)=>{
|
|
4844
4792
|
const classes = [
|
|
4845
|
-
|
|
4793
|
+
"paragraph"
|
|
4846
4794
|
];
|
|
4847
|
-
if (paragraph.type !== $af8d31735c159a26$export$c5a6fe907430212e && paragraph.type !== $af8d31735c159a26$export$c53d0f541b41b88e) classes.push(paragraph.type);
|
|
4848
|
-
return classes.join(
|
|
4795
|
+
if (paragraph.type !== (0, $af8d31735c159a26$export$c5a6fe907430212e) && paragraph.type !== (0, $af8d31735c159a26$export$c53d0f541b41b88e)) classes.push(paragraph.type);
|
|
4796
|
+
return classes.join(" ");
|
|
4849
4797
|
});
|
|
4850
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper(
|
|
4851
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper(
|
|
4852
|
-
if (!metadata) throw new Error(
|
|
4853
|
-
return item.evaluate(metadata, configuration.get(
|
|
4798
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("isEvaluatable", (0, $21a34a464e7bc609$export$e3f63561d52b936d));
|
|
4799
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("evaluate", (item, metadata, configuration)=>{
|
|
4800
|
+
if (!metadata) throw new Error("cannot evaluate, metadata is null");
|
|
4801
|
+
return item.evaluate(metadata, configuration.get("metadata.separator"));
|
|
4854
4802
|
});
|
|
4855
|
-
($parcel$interopDefault($988mA$handlebars)).registerHelper(
|
|
4803
|
+
(0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("renderChord", (0, $dfecd32049fa58e9$export$596ec52955da9472));
|
|
4856
4804
|
|
|
4857
4805
|
|
|
4858
4806
|
|
|
4859
4807
|
/**
|
|
4860
4808
|
* Formats a song into a plain text chord sheet
|
|
4861
|
-
*/ class $525b2331e4b0ed83$var$TextFormatter extends $0055ecb09272ba2d$export$2e2bcd8739ae039 {
|
|
4809
|
+
*/ class $525b2331e4b0ed83$var$TextFormatter extends (0, $0055ecb09272ba2d$export$2e2bcd8739ae039) {
|
|
4862
4810
|
/**
|
|
4863
4811
|
* Formats a song into a plain text chord sheet
|
|
4864
4812
|
* @param {Song} song The song to be formatted
|
|
@@ -4868,77 +4816,71 @@ const $376e205ced98486b$export$b8d631d9200974fa = (line)=>line.items.some((item)
|
|
|
4868
4816
|
return [
|
|
4869
4817
|
this.formatHeader(),
|
|
4870
4818
|
this.formatParagraphs(),
|
|
4871
|
-
].join(
|
|
4819
|
+
].join("");
|
|
4872
4820
|
}
|
|
4873
4821
|
formatHeader() {
|
|
4874
4822
|
const { title: title , subtitle: subtitle } = this.song;
|
|
4875
|
-
const separator = title || subtitle ?
|
|
4823
|
+
const separator = title || subtitle ? "\n" : "";
|
|
4876
4824
|
return [
|
|
4877
4825
|
this.formatTitle(title),
|
|
4878
4826
|
this.formatSubTitle(subtitle),
|
|
4879
4827
|
separator,
|
|
4880
|
-
].join(
|
|
4828
|
+
].join("");
|
|
4881
4829
|
}
|
|
4882
4830
|
formatParagraphs() {
|
|
4883
4831
|
const { bodyParagraphs: bodyParagraphs , metadata: metadata } = this.song;
|
|
4884
|
-
return bodyParagraphs.map((paragraph)=>this.formatParagraph(paragraph, metadata)
|
|
4885
|
-
).join('\n\n');
|
|
4832
|
+
return bodyParagraphs.map((paragraph)=>this.formatParagraph(paragraph, metadata)).join("\n\n");
|
|
4886
4833
|
}
|
|
4887
4834
|
formatParagraph(paragraph, metadata) {
|
|
4888
|
-
return paragraph.lines.filter((line)=>line.hasRenderableItems()
|
|
4889
|
-
).map((line)=>this.formatLine(line, metadata)
|
|
4890
|
-
).join('\n');
|
|
4835
|
+
return paragraph.lines.filter((line)=>line.hasRenderableItems()).map((line)=>this.formatLine(line, metadata)).join("\n");
|
|
4891
4836
|
}
|
|
4892
4837
|
formatLine(line, metadata) {
|
|
4893
4838
|
const parts = [
|
|
4894
4839
|
this.formatLineTop(line),
|
|
4895
4840
|
this.formatLineBottom(line, metadata),
|
|
4896
4841
|
];
|
|
4897
|
-
return parts.filter((i)=>i !== null
|
|
4898
|
-
).map((part)=>part.trimRight()
|
|
4899
|
-
).join('\n');
|
|
4842
|
+
return parts.filter((i)=>i !== null).map((part)=>part.trimRight()).join("\n");
|
|
4900
4843
|
}
|
|
4901
4844
|
formatTitle(title) {
|
|
4902
4845
|
if (title) return `${title.toUpperCase()}\n`;
|
|
4903
|
-
return
|
|
4846
|
+
return "";
|
|
4904
4847
|
}
|
|
4905
4848
|
formatSubTitle(subtitle) {
|
|
4906
4849
|
if (subtitle) return `${subtitle}\n`;
|
|
4907
|
-
return
|
|
4850
|
+
return "";
|
|
4908
4851
|
}
|
|
4909
4852
|
formatLineTop(line) {
|
|
4910
|
-
if ($21a34a464e7bc609$export$d332d76d125f0cbe(line)) return this.formatLineWithFormatter(line, this.formatItemTop);
|
|
4853
|
+
if ((0, $21a34a464e7bc609$export$d332d76d125f0cbe)(line)) return this.formatLineWithFormatter(line, this.formatItemTop);
|
|
4911
4854
|
return null;
|
|
4912
4855
|
}
|
|
4913
4856
|
chordLyricsPairLength(chordLyricsPair, line) {
|
|
4914
|
-
const chords = $dfecd32049fa58e9$export$596ec52955da9472(chordLyricsPair.chords, line.key, line.transposeKey, this.song);
|
|
4857
|
+
const chords = (0, $dfecd32049fa58e9$export$596ec52955da9472)(chordLyricsPair.chords, line.key, line.transposeKey, this.song);
|
|
4915
4858
|
const { lyrics: lyrics } = chordLyricsPair;
|
|
4916
|
-
const chordsLength = (chords ||
|
|
4917
|
-
const lyricsLength = (lyrics ||
|
|
4859
|
+
const chordsLength = (chords || "").length;
|
|
4860
|
+
const lyricsLength = (lyrics || "").length;
|
|
4918
4861
|
if (chordsLength >= lyricsLength) return chordsLength + 1;
|
|
4919
4862
|
return Math.max(chordsLength, lyricsLength);
|
|
4920
4863
|
}
|
|
4921
4864
|
formatItemTop(item, metadata, line) {
|
|
4922
|
-
if (item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039 && item.isRenderable()) return $21a34a464e7bc609$export$bc3bea8325045070(
|
|
4923
|
-
if (item instanceof $d454f4215ba01af2$export$2e2bcd8739ae039) {
|
|
4924
|
-
const chords = $dfecd32049fa58e9$export$596ec52955da9472(item.chords, line.key, line.transposeKey, this.song);
|
|
4925
|
-
return $21a34a464e7bc609$export$bc3bea8325045070(chords, this.chordLyricsPairLength(item, line));
|
|
4865
|
+
if (item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) && item.isRenderable()) return (0, $21a34a464e7bc609$export$bc3bea8325045070)("", item.value);
|
|
4866
|
+
if (item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) {
|
|
4867
|
+
const chords = (0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line.key, line.transposeKey, this.song);
|
|
4868
|
+
return (0, $21a34a464e7bc609$export$bc3bea8325045070)(chords, this.chordLyricsPairLength(item, line));
|
|
4926
4869
|
}
|
|
4927
|
-
return
|
|
4870
|
+
return "";
|
|
4928
4871
|
}
|
|
4929
4872
|
formatLineBottom(line, metadata) {
|
|
4930
|
-
if ($376e205ced98486b$export$b8d631d9200974fa(line)) return this.formatLineWithFormatter(line, this.formatItemBottom, metadata);
|
|
4873
|
+
if ((0, $376e205ced98486b$export$b8d631d9200974fa)(line)) return this.formatLineWithFormatter(line, this.formatItemBottom, metadata);
|
|
4931
4874
|
return null;
|
|
4932
4875
|
}
|
|
4933
4876
|
formatLineWithFormatter(line, formatter, metadata = null) {
|
|
4934
|
-
return line.items.map((item)=>formatter.call(this, item, metadata, line)
|
|
4935
|
-
).join('');
|
|
4877
|
+
return line.items.map((item)=>formatter.call(this, item, metadata, line)).join("");
|
|
4936
4878
|
}
|
|
4937
4879
|
formatItemBottom(item, metadata, line) {
|
|
4938
|
-
if (item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039 && item.isRenderable()) return item.value;
|
|
4939
|
-
if (item instanceof $d454f4215ba01af2$export$2e2bcd8739ae039) return $21a34a464e7bc609$export$bc3bea8325045070(item.lyrics, this.chordLyricsPairLength(item, line));
|
|
4940
|
-
if (typeof item.evaluate ===
|
|
4941
|
-
return
|
|
4880
|
+
if (item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039) && item.isRenderable()) return item.value;
|
|
4881
|
+
if (item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) return (0, $21a34a464e7bc609$export$bc3bea8325045070)(item.lyrics, this.chordLyricsPairLength(item, line));
|
|
4882
|
+
if (typeof item.evaluate === "function") return item.evaluate(metadata, this.configuration.get("metadata.separator"));
|
|
4883
|
+
return "";
|
|
4942
4884
|
}
|
|
4943
4885
|
}
|
|
4944
4886
|
var $525b2331e4b0ed83$export$2e2bcd8739ae039 = $525b2331e4b0ed83$var$TextFormatter;
|
|
@@ -4947,7 +4889,7 @@ var $525b2331e4b0ed83$export$2e2bcd8739ae039 = $525b2331e4b0ed83$var$TextFormatt
|
|
|
4947
4889
|
|
|
4948
4890
|
|
|
4949
4891
|
var $cc306339371360c4$var$template = $988mA$handlebars.template, $cc306339371360c4$var$templates = $988mA$handlebars.templates = $988mA$handlebars.templates || {};
|
|
4950
|
-
$cc306339371360c4$var$templates[
|
|
4892
|
+
$cc306339371360c4$var$templates["html_table_formatter"] = $cc306339371360c4$var$template({
|
|
4951
4893
|
"1": function(container, depth0, helpers, partials, data, blockParams) {
|
|
4952
4894
|
var stack1, alias1 = depth0 != null ? depth0 : container.nullContext || {}, lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
4953
4895
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
@@ -5053,7 +4995,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5053
4995
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5054
4996
|
return undefined;
|
|
5055
4997
|
};
|
|
5056
|
-
return
|
|
4998
|
+
return '<div class="chord-sheet">' + ((stack1 = lookupProperty(helpers, "each").call(depth0 != null ? depth0 : container.nullContext || {}, depth0 != null ? lookupProperty(depth0, "bodyParagraphs") : depth0, {
|
|
5057
4999
|
"name": "each",
|
|
5058
5000
|
"hash": {},
|
|
5059
5001
|
"fn": container.program(7, data, 1, blockParams),
|
|
@@ -5077,7 +5019,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5077
5019
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5078
5020
|
return undefined;
|
|
5079
5021
|
};
|
|
5080
|
-
return
|
|
5022
|
+
return '<div class="' + container.escapeExpression(lookupProperty(helpers, "paragraphClasses").call(alias1, blockParams[0][0], {
|
|
5081
5023
|
"name": "paragraphClasses",
|
|
5082
5024
|
"hash": {},
|
|
5083
5025
|
"data": data,
|
|
@@ -5092,7 +5034,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5092
5034
|
"column": 50
|
|
5093
5035
|
}
|
|
5094
5036
|
}
|
|
5095
|
-
})) + "
|
|
5037
|
+
})) + '">' + ((stack1 = lookupProperty(helpers, "each").call(alias1, depth0 != null ? lookupProperty(depth0, "lines") : depth0, {
|
|
5096
5038
|
"name": "each",
|
|
5097
5039
|
"hash": {},
|
|
5098
5040
|
"fn": container.program(8, data, 1, blockParams),
|
|
@@ -5155,7 +5097,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5155
5097
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5156
5098
|
return undefined;
|
|
5157
5099
|
};
|
|
5158
|
-
return
|
|
5100
|
+
return '<table class="' + container.escapeExpression(lookupProperty(helpers, "lineClasses").call(alias1, blockParams[1][0], {
|
|
5159
5101
|
"name": "lineClasses",
|
|
5160
5102
|
"hash": {},
|
|
5161
5103
|
"data": data,
|
|
@@ -5170,7 +5112,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5170
5112
|
"column": 48
|
|
5171
5113
|
}
|
|
5172
5114
|
}
|
|
5173
|
-
})) + "
|
|
5115
|
+
})) + '">' + ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(helpers, "hasChordContents").call(alias1, blockParams[1][0], {
|
|
5174
5116
|
"name": "hasChordContents",
|
|
5175
5117
|
"hash": {},
|
|
5176
5118
|
"data": data,
|
|
@@ -5304,7 +5246,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5304
5246
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5305
5247
|
return undefined;
|
|
5306
5248
|
};
|
|
5307
|
-
return
|
|
5249
|
+
return '<td class="chord">' + container.escapeExpression((lookupProperty(helpers, "renderChord") || depth0 && lookupProperty(depth0, "renderChord") || container.hooks.helperMissing).call(depth0 != null ? depth0 : container.nullContext || {}, depth0 != null ? lookupProperty(depth0, "chords") : depth0, (stack1 = blockParams[4][0]) != null ? lookupProperty(stack1, "key") : stack1, (stack1 = blockParams[4][0]) != null ? lookupProperty(stack1, "transposeKey") : stack1, (stack1 = data && lookupProperty(data, "root")) && lookupProperty(stack1, "song"), {
|
|
5308
5250
|
"name": "renderChord",
|
|
5309
5251
|
"hash": {},
|
|
5310
5252
|
"data": data,
|
|
@@ -5453,7 +5395,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5453
5395
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5454
5396
|
return undefined;
|
|
5455
5397
|
};
|
|
5456
|
-
return
|
|
5398
|
+
return '<td class="lyrics">' + container.escapeExpression((helper = (helper = lookupProperty(helpers, "lyrics") || (depth0 != null ? lookupProperty(depth0, "lyrics") : depth0)) != null ? helper : container.hooks.helperMissing, typeof helper === "function" ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, {
|
|
5457
5399
|
"name": "lyrics",
|
|
5458
5400
|
"hash": {},
|
|
5459
5401
|
"data": data,
|
|
@@ -5513,7 +5455,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5513
5455
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5514
5456
|
return undefined;
|
|
5515
5457
|
};
|
|
5516
|
-
return
|
|
5458
|
+
return '<td class="comment">' + container.escapeExpression((helper = (helper = lookupProperty(helpers, "value") || (depth0 != null ? lookupProperty(depth0, "value") : depth0)) != null ? helper : container.hooks.helperMissing, typeof helper === "function" ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, {
|
|
5517
5459
|
"name": "value",
|
|
5518
5460
|
"hash": {},
|
|
5519
5461
|
"data": data,
|
|
@@ -5534,7 +5476,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5534
5476
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5535
5477
|
return undefined;
|
|
5536
5478
|
};
|
|
5537
|
-
return
|
|
5479
|
+
return '<td class="lyrics">' + container.escapeExpression((lookupProperty(helpers, "evaluate") || depth0 && lookupProperty(depth0, "evaluate") || container.hooks.helperMissing).call(depth0 != null ? depth0 : container.nullContext || {}, blockParams[1][0], (stack1 = (stack1 = data && lookupProperty(data, "root")) && lookupProperty(stack1, "song")) && lookupProperty(stack1, "metadata"), (stack1 = data && lookupProperty(data, "root")) && lookupProperty(stack1, "configuration"), {
|
|
5538
5480
|
"name": "evaluate",
|
|
5539
5481
|
"hash": {},
|
|
5540
5482
|
"data": data,
|
|
@@ -5588,7 +5530,7 @@ $cc306339371360c4$var$templates['html_table_formatter'] = $cc306339371360c4$var$
|
|
|
5588
5530
|
|
|
5589
5531
|
/**
|
|
5590
5532
|
* Acts as a base class for HTML formatters, taking care of whitelisting prototype property access.
|
|
5591
|
-
*/ class $d834af97c9a2e4df$var$HtmlFormatter extends $0055ecb09272ba2d$export$2e2bcd8739ae039 {
|
|
5533
|
+
*/ class $d834af97c9a2e4df$var$HtmlFormatter extends (0, $0055ecb09272ba2d$export$2e2bcd8739ae039) {
|
|
5592
5534
|
formatWithTemplate(song, template) {
|
|
5593
5535
|
return template({
|
|
5594
5536
|
song: song,
|
|
@@ -5609,35 +5551,35 @@ var $d834af97c9a2e4df$export$2e2bcd8739ae039 = $d834af97c9a2e4df$var$HtmlFormatt
|
|
|
5609
5551
|
|
|
5610
5552
|
|
|
5611
5553
|
|
|
5612
|
-
const { html_table_formatter: $5b02ea769c63fd56$var$template } = ($parcel$interopDefault($988mA$handlebars)).templates;
|
|
5554
|
+
const { html_table_formatter: $5b02ea769c63fd56$var$template } = (0, ($parcel$interopDefault($988mA$handlebars))).templates;
|
|
5613
5555
|
const $5b02ea769c63fd56$export$200cf2de69532aa8 = {
|
|
5614
5556
|
h1: {
|
|
5615
|
-
fontSize:
|
|
5557
|
+
fontSize: "1.5em"
|
|
5616
5558
|
},
|
|
5617
5559
|
h2: {
|
|
5618
|
-
fontSize:
|
|
5560
|
+
fontSize: "1.1em"
|
|
5619
5561
|
},
|
|
5620
5562
|
table: {
|
|
5621
|
-
borderSpacing:
|
|
5622
|
-
color:
|
|
5563
|
+
borderSpacing: "0",
|
|
5564
|
+
color: "inherit"
|
|
5623
5565
|
},
|
|
5624
5566
|
td: {
|
|
5625
|
-
padding:
|
|
5567
|
+
padding: "3px 0"
|
|
5626
5568
|
},
|
|
5627
|
-
|
|
5628
|
-
paddingRight:
|
|
5569
|
+
".chord:not(:last-child)": {
|
|
5570
|
+
paddingRight: "10px"
|
|
5629
5571
|
},
|
|
5630
|
-
|
|
5631
|
-
marginBottom:
|
|
5572
|
+
".paragraph": {
|
|
5573
|
+
marginBottom: "1em"
|
|
5632
5574
|
}
|
|
5633
5575
|
};
|
|
5634
5576
|
function $5b02ea769c63fd56$export$aa5b6043dd05348b(scope) {
|
|
5635
|
-
return $21a34a464e7bc609$export$59d377d2a2e0150a($5b02ea769c63fd56$export$200cf2de69532aa8, scope);
|
|
5577
|
+
return (0, $21a34a464e7bc609$export$59d377d2a2e0150a)($5b02ea769c63fd56$export$200cf2de69532aa8, scope);
|
|
5636
5578
|
}
|
|
5637
5579
|
/**
|
|
5638
5580
|
* Formats a song into HTML. It uses TABLEs to align lyrics with chords, which makes the HTML for things like
|
|
5639
5581
|
* PDF conversion.
|
|
5640
|
-
*/ class $5b02ea769c63fd56$var$HtmlTableFormatter extends $d834af97c9a2e4df$export$2e2bcd8739ae039 {
|
|
5582
|
+
*/ class $5b02ea769c63fd56$var$HtmlTableFormatter extends (0, $d834af97c9a2e4df$export$2e2bcd8739ae039) {
|
|
5641
5583
|
/**
|
|
5642
5584
|
* Formats a song into HTML.
|
|
5643
5585
|
* @param {Song} song The song to be formatted
|
|
@@ -5657,8 +5599,8 @@ function $5b02ea769c63fd56$export$aa5b6043dd05348b(scope) {
|
|
|
5657
5599
|
*
|
|
5658
5600
|
* @param scope the CSS scope to use, for example `.chordSheetViewer`
|
|
5659
5601
|
* @returns {string} the CSS string
|
|
5660
|
-
*/ static cssString(scope =
|
|
5661
|
-
return $21a34a464e7bc609$export$59d377d2a2e0150a($5b02ea769c63fd56$export$200cf2de69532aa8, scope);
|
|
5602
|
+
*/ static cssString(scope = "") {
|
|
5603
|
+
return (0, $21a34a464e7bc609$export$59d377d2a2e0150a)($5b02ea769c63fd56$export$200cf2de69532aa8, scope);
|
|
5662
5604
|
}
|
|
5663
5605
|
/**
|
|
5664
5606
|
* Basic CSS, in object style à la useStyles, to use with output generated by {@link HtmlTableFormatter}
|
|
@@ -5681,7 +5623,7 @@ var $5b02ea769c63fd56$export$2e2bcd8739ae039 = $5b02ea769c63fd56$var$HtmlTableFo
|
|
|
5681
5623
|
|
|
5682
5624
|
|
|
5683
5625
|
var $9d647eea0a7973fb$var$template = $988mA$handlebars.template, $9d647eea0a7973fb$var$templates = $988mA$handlebars.templates = $988mA$handlebars.templates || {};
|
|
5684
|
-
$9d647eea0a7973fb$var$templates[
|
|
5626
|
+
$9d647eea0a7973fb$var$templates["html_div_formatter"] = $9d647eea0a7973fb$var$template({
|
|
5685
5627
|
"1": function(container, depth0, helpers, partials, data, blockParams) {
|
|
5686
5628
|
var stack1, alias1 = depth0 != null ? depth0 : container.nullContext || {}, lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
5687
5629
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
@@ -5721,7 +5663,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
5721
5663
|
"column": 11
|
|
5722
5664
|
}
|
|
5723
5665
|
}
|
|
5724
|
-
})) != null ? stack1 : "") +
|
|
5666
|
+
})) != null ? stack1 : "") + '<div class="chord-sheet">' + ((stack1 = lookupProperty(helpers, "each").call(alias1, depth0 != null ? lookupProperty(depth0, "bodyParagraphs") : depth0, {
|
|
5725
5667
|
"name": "each",
|
|
5726
5668
|
"hash": {},
|
|
5727
5669
|
"fn": container.program(6, data, 1, blockParams),
|
|
@@ -5787,7 +5729,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
5787
5729
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5788
5730
|
return undefined;
|
|
5789
5731
|
};
|
|
5790
|
-
return
|
|
5732
|
+
return '<div class="' + container.escapeExpression(lookupProperty(helpers, "paragraphClasses").call(alias1, blockParams[0][0], {
|
|
5791
5733
|
"name": "paragraphClasses",
|
|
5792
5734
|
"hash": {},
|
|
5793
5735
|
"data": data,
|
|
@@ -5802,7 +5744,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
5802
5744
|
"column": 48
|
|
5803
5745
|
}
|
|
5804
5746
|
}
|
|
5805
|
-
})) + "
|
|
5747
|
+
})) + '">' + ((stack1 = lookupProperty(helpers, "each").call(alias1, depth0 != null ? lookupProperty(depth0, "lines") : depth0, {
|
|
5806
5748
|
"name": "each",
|
|
5807
5749
|
"hash": {},
|
|
5808
5750
|
"fn": container.program(7, data, 1, blockParams),
|
|
@@ -5865,7 +5807,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
5865
5807
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
5866
5808
|
return undefined;
|
|
5867
5809
|
};
|
|
5868
|
-
return
|
|
5810
|
+
return '<div class="' + container.escapeExpression(lookupProperty(helpers, "lineClasses").call(alias1, blockParams[1][0], {
|
|
5869
5811
|
"name": "lineClasses",
|
|
5870
5812
|
"hash": {},
|
|
5871
5813
|
"data": data,
|
|
@@ -5880,7 +5822,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
5880
5822
|
"column": 44
|
|
5881
5823
|
}
|
|
5882
5824
|
}
|
|
5883
|
-
})) + "
|
|
5825
|
+
})) + '">' + ((stack1 = lookupProperty(helpers, "each").call(alias1, depth0 != null ? lookupProperty(depth0, "items") : depth0, {
|
|
5884
5826
|
"name": "each",
|
|
5885
5827
|
"hash": {},
|
|
5886
5828
|
"fn": container.program(9, data, 1, blockParams),
|
|
@@ -6007,7 +5949,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
6007
5949
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
6008
5950
|
return undefined;
|
|
6009
5951
|
};
|
|
6010
|
-
return
|
|
5952
|
+
return '<div class="column"><div class="chord">' + alias3((lookupProperty(helpers, "renderChord") || depth0 && lookupProperty(depth0, "renderChord") || alias2).call(alias1, depth0 != null ? lookupProperty(depth0, "chords") : depth0, (stack1 = blockParams[3][0]) != null ? lookupProperty(stack1, "key") : stack1, (stack1 = blockParams[3][0]) != null ? lookupProperty(stack1, "transposeKey") : stack1, (stack1 = data && lookupProperty(data, "root")) && lookupProperty(stack1, "song"), {
|
|
6011
5953
|
"name": "renderChord",
|
|
6012
5954
|
"hash": {},
|
|
6013
5955
|
"data": data,
|
|
@@ -6022,7 +5964,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
6022
5964
|
"column": 117
|
|
6023
5965
|
}
|
|
6024
5966
|
}
|
|
6025
|
-
})) +
|
|
5967
|
+
})) + '</div><div class="lyrics">' + alias3((helper = (helper = lookupProperty(helpers, "lyrics") || (depth0 != null ? lookupProperty(depth0, "lyrics") : depth0)) != null ? helper : alias2, typeof helper === "function" ? helper.call(alias1, {
|
|
6026
5968
|
"name": "lyrics",
|
|
6027
5969
|
"hash": {},
|
|
6028
5970
|
"data": data,
|
|
@@ -6083,7 +6025,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
6083
6025
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
6084
6026
|
return undefined;
|
|
6085
6027
|
};
|
|
6086
|
-
return
|
|
6028
|
+
return '<div class="comment">' + container.escapeExpression((helper = (helper = lookupProperty(helpers, "value") || (depth0 != null ? lookupProperty(depth0, "value") : depth0)) != null ? helper : container.hooks.helperMissing, typeof helper === "function" ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, {
|
|
6087
6029
|
"name": "value",
|
|
6088
6030
|
"hash": {},
|
|
6089
6031
|
"data": data,
|
|
@@ -6104,7 +6046,7 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
6104
6046
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
|
|
6105
6047
|
return undefined;
|
|
6106
6048
|
};
|
|
6107
|
-
return
|
|
6049
|
+
return '<div class="column"><div class="chord"></div><div class="lyrics">' + container.escapeExpression((lookupProperty(helpers, "evaluate") || depth0 && lookupProperty(depth0, "evaluate") || container.hooks.helperMissing).call(depth0 != null ? depth0 : container.nullContext || {}, blockParams[1][0], (stack1 = (stack1 = data && lookupProperty(data, "root")) && lookupProperty(stack1, "song")) && lookupProperty(stack1, "metadata"), (stack1 = data && lookupProperty(data, "root")) && lookupProperty(stack1, "configuration"), {
|
|
6108
6050
|
"name": "evaluate",
|
|
6109
6051
|
"hash": {},
|
|
6110
6052
|
"data": data,
|
|
@@ -6157,27 +6099,27 @@ $9d647eea0a7973fb$var$templates['html_div_formatter'] = $9d647eea0a7973fb$var$te
|
|
|
6157
6099
|
|
|
6158
6100
|
|
|
6159
6101
|
|
|
6160
|
-
const { html_div_formatter: $ee0c149cc33dc156$var$template } = ($parcel$interopDefault($988mA$handlebars)).templates;
|
|
6102
|
+
const { html_div_formatter: $ee0c149cc33dc156$var$template } = (0, ($parcel$interopDefault($988mA$handlebars))).templates;
|
|
6161
6103
|
const $ee0c149cc33dc156$var$defaultCss = {
|
|
6162
|
-
|
|
6163
|
-
paddingRight:
|
|
6104
|
+
".chord:not(:last-child)": {
|
|
6105
|
+
paddingRight: "10px"
|
|
6164
6106
|
},
|
|
6165
|
-
|
|
6166
|
-
marginBottom:
|
|
6107
|
+
".paragraph": {
|
|
6108
|
+
marginBottom: "1em"
|
|
6167
6109
|
},
|
|
6168
|
-
|
|
6169
|
-
display:
|
|
6110
|
+
".row": {
|
|
6111
|
+
display: "flex"
|
|
6170
6112
|
},
|
|
6171
|
-
|
|
6172
|
-
content: '
|
|
6113
|
+
".chord:after": {
|
|
6114
|
+
content: "'\\200b'"
|
|
6173
6115
|
},
|
|
6174
|
-
|
|
6175
|
-
content: '
|
|
6116
|
+
".lyrics:after": {
|
|
6117
|
+
content: "'\\200b'"
|
|
6176
6118
|
}
|
|
6177
6119
|
};
|
|
6178
6120
|
/**
|
|
6179
6121
|
* Formats a song into HTML. It uses DIVs to align lyrics with chords, which makes it useful for responsive web pages.
|
|
6180
|
-
*/ class $ee0c149cc33dc156$var$HtmlDivFormatter extends $d834af97c9a2e4df$export$2e2bcd8739ae039 {
|
|
6122
|
+
*/ class $ee0c149cc33dc156$var$HtmlDivFormatter extends (0, $d834af97c9a2e4df$export$2e2bcd8739ae039) {
|
|
6181
6123
|
/**
|
|
6182
6124
|
* Formats a song into HTML.
|
|
6183
6125
|
* @param {Song} song The song to be formatted
|
|
@@ -6197,8 +6139,8 @@ const $ee0c149cc33dc156$var$defaultCss = {
|
|
|
6197
6139
|
*
|
|
6198
6140
|
* @param scope the CSS scope to use, for example `.chordSheetViewer`
|
|
6199
6141
|
* @returns {string} the CSS string
|
|
6200
|
-
*/ static cssString(scope =
|
|
6201
|
-
return $21a34a464e7bc609$export$59d377d2a2e0150a($ee0c149cc33dc156$var$defaultCss, scope);
|
|
6142
|
+
*/ static cssString(scope = "") {
|
|
6143
|
+
return (0, $21a34a464e7bc609$export$59d377d2a2e0150a)($ee0c149cc33dc156$var$defaultCss, scope);
|
|
6202
6144
|
}
|
|
6203
6145
|
/**
|
|
6204
6146
|
* Basic CSS, in object style à la useStyles, to use with output generated by {@link HtmlDivFormatter}
|
|
@@ -6223,59 +6165,56 @@ var $ee0c149cc33dc156$export$2e2bcd8739ae039 = $ee0c149cc33dc156$var$HtmlDivForm
|
|
|
6223
6165
|
|
|
6224
6166
|
|
|
6225
6167
|
|
|
6226
|
-
const $b601b9602157ea5f$var$NEW_LINE =
|
|
6168
|
+
const $b601b9602157ea5f$var$NEW_LINE = "\n";
|
|
6227
6169
|
/**
|
|
6228
6170
|
* Formats a song into a ChordPro chord sheet
|
|
6229
|
-
*/ class $b601b9602157ea5f$var$ChordProFormatter extends $0055ecb09272ba2d$export$2e2bcd8739ae039 {
|
|
6171
|
+
*/ class $b601b9602157ea5f$var$ChordProFormatter extends (0, $0055ecb09272ba2d$export$2e2bcd8739ae039) {
|
|
6230
6172
|
/**
|
|
6231
6173
|
* Formats a song into a ChordPro chord sheet.
|
|
6232
6174
|
* @param {Song} song The song to be formatted
|
|
6233
6175
|
* @returns {string} The ChordPro string
|
|
6234
6176
|
*/ format(song) {
|
|
6235
6177
|
const { lines: lines , metadata: metadata } = song;
|
|
6236
|
-
return lines.map((line)=>this.formatLine(line, metadata)
|
|
6237
|
-
).join($b601b9602157ea5f$var$NEW_LINE);
|
|
6178
|
+
return lines.map((line)=>this.formatLine(line, metadata)).join($b601b9602157ea5f$var$NEW_LINE);
|
|
6238
6179
|
}
|
|
6239
6180
|
formatLine(line, metadata) {
|
|
6240
|
-
return line.items.map((item)=>this.formatItem(item, metadata)
|
|
6241
|
-
).join('');
|
|
6181
|
+
return line.items.map((item)=>this.formatItem(item, metadata)).join("");
|
|
6242
6182
|
}
|
|
6243
6183
|
formatItem(item, metadata) {
|
|
6244
|
-
if (item instanceof $5e9ede69210ec54a$export$2e2bcd8739ae039) return this.formatTag(item);
|
|
6245
|
-
if (item instanceof $d454f4215ba01af2$export$2e2bcd8739ae039) return this.formatChordLyricsPair(item);
|
|
6246
|
-
if (typeof item.evaluate ===
|
|
6184
|
+
if (item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039)) return this.formatTag(item);
|
|
6185
|
+
if (item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) return this.formatChordLyricsPair(item);
|
|
6186
|
+
if (typeof item.evaluate === "function") return this.formatOrEvaluateItem(item, metadata);
|
|
6247
6187
|
throw new Error(`Don't know how to format a ${item.constructor.name}`);
|
|
6248
6188
|
}
|
|
6249
6189
|
formatOrEvaluateItem(item, metadata) {
|
|
6250
|
-
if (this.configuration.evaluate) return item.evaluate(metadata, this.configuration.get(
|
|
6251
|
-
if (item instanceof $b6d84b168638423d$export$2e2bcd8739ae039) return this.formatTernary(item);
|
|
6252
|
-
if (item instanceof $e1378a714a1834c5$export$2e2bcd8739ae039) return item.evaluate();
|
|
6190
|
+
if (this.configuration.evaluate) return item.evaluate(metadata, this.configuration.get("metadata.separator"));
|
|
6191
|
+
if (item instanceof (0, $b6d84b168638423d$export$2e2bcd8739ae039)) return this.formatTernary(item);
|
|
6192
|
+
if (item instanceof (0, $e1378a714a1834c5$export$2e2bcd8739ae039)) return item.evaluate();
|
|
6253
6193
|
throw new Error(`Don't know how to format a ${item.constructor.name}`);
|
|
6254
6194
|
}
|
|
6255
6195
|
formatTernary(ternary) {
|
|
6256
6196
|
const { variable: variable , valueTest: valueTest , trueExpression: trueExpression , falseExpression: falseExpression , } = ternary;
|
|
6257
6197
|
return [
|
|
6258
|
-
|
|
6259
|
-
variable ||
|
|
6198
|
+
"%{",
|
|
6199
|
+
variable || "",
|
|
6260
6200
|
this.formatValueTest(valueTest),
|
|
6261
6201
|
this.formatExpressionRange(trueExpression),
|
|
6262
6202
|
this.formatExpressionRange(falseExpression),
|
|
6263
|
-
|
|
6264
|
-
].join(
|
|
6203
|
+
"}",
|
|
6204
|
+
].join("");
|
|
6265
6205
|
}
|
|
6266
6206
|
formatValueTest(valueTest) {
|
|
6267
|
-
if (!valueTest) return
|
|
6207
|
+
if (!valueTest) return "";
|
|
6268
6208
|
return `=${valueTest}`;
|
|
6269
6209
|
}
|
|
6270
6210
|
formatExpressionRange(expressionRange) {
|
|
6271
|
-
if (!expressionRange) return
|
|
6272
|
-
return `|${expressionRange.map((expression)=>this.formatExpression(expression)
|
|
6273
|
-
).join('')}`;
|
|
6211
|
+
if (!expressionRange) return "";
|
|
6212
|
+
return `|${expressionRange.map((expression)=>this.formatExpression(expression)).join("")}`;
|
|
6274
6213
|
}
|
|
6275
6214
|
formatExpression(expression) {
|
|
6276
|
-
if (expression instanceof $b6d84b168638423d$export$2e2bcd8739ae039) return this.formatTernary(expression);
|
|
6277
|
-
if (expression instanceof $e1378a714a1834c5$export$2e2bcd8739ae039) return expression.string;
|
|
6278
|
-
return
|
|
6215
|
+
if (expression instanceof (0, $b6d84b168638423d$export$2e2bcd8739ae039)) return this.formatTernary(expression);
|
|
6216
|
+
if (expression instanceof (0, $e1378a714a1834c5$export$2e2bcd8739ae039)) return expression.string;
|
|
6217
|
+
return "";
|
|
6279
6218
|
}
|
|
6280
6219
|
formatTag(tag) {
|
|
6281
6220
|
if (tag.hasValue()) return `{${tag.originalName}: ${tag.value}}`;
|
|
@@ -6285,14 +6224,14 @@ const $b601b9602157ea5f$var$NEW_LINE = '\n';
|
|
|
6285
6224
|
return [
|
|
6286
6225
|
this.formatChordLyricsPairChords(chordLyricsPair),
|
|
6287
6226
|
this.formatChordLyricsPairLyrics(chordLyricsPair),
|
|
6288
|
-
].join(
|
|
6227
|
+
].join("");
|
|
6289
6228
|
}
|
|
6290
6229
|
formatChordLyricsPairChords(chordLyricsPair) {
|
|
6291
6230
|
if (chordLyricsPair.chords) return `[${chordLyricsPair.chords}]`;
|
|
6292
|
-
return
|
|
6231
|
+
return "";
|
|
6293
6232
|
}
|
|
6294
6233
|
formatChordLyricsPairLyrics(chordLyricsPair) {
|
|
6295
|
-
return chordLyricsPair.lyrics ||
|
|
6234
|
+
return chordLyricsPair.lyrics || "";
|
|
6296
6235
|
}
|
|
6297
6236
|
}
|
|
6298
6237
|
var $b601b9602157ea5f$export$2e2bcd8739ae039 = $b601b9602157ea5f$var$ChordProFormatter;
|