chordsheetjs 7.2.0 → 7.4.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/lib/index.js CHANGED
@@ -1,6 +1,4 @@
1
- var $988mA$process = require("process");
2
1
  var $988mA$lodashget = require("lodash.get");
3
- var $988mA$handlebars = require("handlebars");
4
2
 
5
3
  function $parcel$defineInteropFlag(a) {
6
4
  Object.defineProperty(a, '__esModule', {value: true, configurable: true});
@@ -1936,7 +1934,6 @@ var $6ebb068142750218$export$2e2bcd8739ae039 = {
1936
1934
  };
1937
1935
 
1938
1936
 
1939
-
1940
1937
  const $21a34a464e7bc609$export$13215d9ce4923f76 = (collection, Klass)=>{
1941
1938
  const newObject = new Klass();
1942
1939
  collection.push(newObject);
@@ -1969,7 +1966,8 @@ function $21a34a464e7bc609$export$b680e6b2c82f8c2f(message) {
1969
1966
  try {
1970
1967
  throw new Error(`DEPRECATION: ${message}`);
1971
1968
  } catch (e) {
1972
- if (typeof $988mA$process === "object" && typeof $988mA$process.emitWarning === "function") $988mA$process.emitWarning(`${message}\n${e.stack}`);
1969
+ const proc = globalThis.process;
1970
+ if (typeof proc === "object" && typeof proc.emitWarning === "function") proc.emitWarning(`${message}\n${e.stack}`);
1973
1971
  else console.warn(`${message}\n${e.stack}`);
1974
1972
  }
1975
1973
  }
@@ -3089,7 +3087,7 @@ var $e12151f977ef7bf6$export$2e2bcd8739ae039 = $e12151f977ef7bf6$var$mapping;
3089
3087
 
3090
3088
 
3091
3089
 
3092
- function $26f57998457eb2d4$var$normalizeSuffix(suffix) {
3090
+ function $26f57998457eb2d4$var$normalizeChordSuffix(suffix) {
3093
3091
  if ((0, $e12151f977ef7bf6$export$2e2bcd8739ae039)[suffix] === "[blank]") return null;
3094
3092
  return (0, $e12151f977ef7bf6$export$2e2bcd8739ae039)[suffix] || suffix;
3095
3093
  }
@@ -3136,7 +3134,7 @@ const $26f57998457eb2d4$var$regexes = [
3136
3134
  const keyObj = (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(key);
3137
3135
  const rootKey = this.root.toChordSymbol(keyObj).normalizeEnharmonics(keyObj);
3138
3136
  let chordSymbolChord = new $26f57998457eb2d4$var$Chord({
3139
- suffix: $26f57998457eb2d4$var$normalizeSuffix(this.suffix),
3137
+ suffix: $26f57998457eb2d4$var$normalizeChordSuffix(this.suffix),
3140
3138
  root: rootKey,
3141
3139
  bass: this.bass?.toChordSymbol(keyObj).normalizeEnharmonics(rootKey)
3142
3140
  });
@@ -3172,7 +3170,7 @@ const $26f57998457eb2d4$var$regexes = [
3172
3170
  });
3173
3171
  const keyObj = (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(key);
3174
3172
  return new $26f57998457eb2d4$var$Chord({
3175
- suffix: $26f57998457eb2d4$var$normalizeSuffix(this.suffix),
3173
+ suffix: $26f57998457eb2d4$var$normalizeChordSuffix(this.suffix),
3176
3174
  root: this.root.toNumeric(keyObj),
3177
3175
  bass: this.bass?.toNumeric(keyObj)
3178
3176
  });
@@ -3190,7 +3188,7 @@ const $26f57998457eb2d4$var$regexes = [
3190
3188
  });
3191
3189
  const keyObj = (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(key);
3192
3190
  return new $26f57998457eb2d4$var$Chord({
3193
- suffix: $26f57998457eb2d4$var$normalizeSuffix(this.suffix),
3191
+ suffix: $26f57998457eb2d4$var$normalizeChordSuffix(this.suffix),
3194
3192
  root: this.root.toNumeral(keyObj),
3195
3193
  bass: this.bass?.toNumeral(keyObj)
3196
3194
  });
@@ -3244,17 +3242,21 @@ const $26f57998457eb2d4$var$regexes = [
3244
3242
  * - 7# becomes 1
3245
3243
  * - 3# becomes 4
3246
3244
  *
3247
- * Besides that it normalizes the suffix. For example, `sus2` becomes `2`, `sus4` becomes `sus`.
3245
+ * Besides that it normalizes the suffix if `normalizeSuffix` is `true`.
3246
+ * For example, `sus2` becomes `2`, `sus4` becomes `sus`.
3248
3247
  * All suffix normalizations can be found in `src/normalize_mappings/suffix-mapping.txt`.
3249
- *
3248
+ * @param {Key|string} [key=null] the key to normalize to
3249
+ * @param {Object} [options={}] options
3250
+ * @param {boolean} [options.normalizeSuffix=true] whether to normalize the chord suffix after transposing
3250
3251
  * @returns {Chord} the normalized chord
3251
- */ normalize(key = null) {
3252
+ */ normalize(key = null, { normalizeSuffix: normalizeSuffix = true } = {}) {
3253
+ const suffix = normalizeSuffix ? $26f57998457eb2d4$var$normalizeChordSuffix(this.suffix) : this.suffix;
3252
3254
  if ((0, $21a34a464e7bc609$export$7ee701e290d9865)(key)) return this.process("normalize").set({
3253
- suffix: (0, $21a34a464e7bc609$export$ed9b06b5ee264ad3)($26f57998457eb2d4$var$normalizeSuffix(this.suffix))
3255
+ suffix: suffix
3254
3256
  });
3255
3257
  return this.set({
3258
+ suffix: suffix,
3256
3259
  root: this.root.normalizeEnharmonics(key),
3257
- suffix: (0, $21a34a464e7bc609$export$ed9b06b5ee264ad3)($26f57998457eb2d4$var$normalizeSuffix(this.suffix)),
3258
3260
  bass: this.bass ? this.bass.normalizeEnharmonics(this.root.toString()) : null
3259
3261
  });
3260
3262
  }
@@ -3375,11 +3377,13 @@ var $26f57998457eb2d4$export$2e2bcd8739ae039 = $26f57998457eb2d4$var$Chord;
3375
3377
  lyrics: lyrics
3376
3378
  });
3377
3379
  }
3378
- transpose(delta, key = null) {
3380
+ transpose(delta, key = null, { normalizeChordSuffix: normalizeChordSuffix = false } = {}) {
3379
3381
  const chordObj = (0, $26f57998457eb2d4$export$2e2bcd8739ae039).parse(this.chords);
3380
3382
  if (chordObj) {
3381
3383
  let transposedChord = chordObj.transpose(delta);
3382
- if (key) transposedChord = transposedChord.normalize(key);
3384
+ if (key) transposedChord = transposedChord.normalize(key, {
3385
+ normalizeSuffix: normalizeChordSuffix
3386
+ });
3383
3387
  return this.set({
3384
3388
  chords: transposedChord.toString()
3385
3389
  });
@@ -4142,8 +4146,10 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
4142
4146
  * - transpose the song key in {@link metadata}
4143
4147
  * - update any existing `key` directive
4144
4148
  * @param {number} delta The number of semitones (positive or negative) to transpose with
4149
+ * @param {Object} [options={}] options
4150
+ * @param {boolean} [options.normalizeChordSuffix=false] whether to normalize the chord suffixes after transposing
4145
4151
  * @returns {Song} The transposed song
4146
- */ transpose(delta) {
4152
+ */ transpose(delta, { normalizeChordSuffix: normalizeChordSuffix = false } = {}) {
4147
4153
  const wrappedKey = (0, $bff5407e03fdc8ee$export$2e2bcd8739ae039).wrap(this.key);
4148
4154
  let transposedKey = null;
4149
4155
  let song = this;
@@ -4152,7 +4158,9 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
4152
4158
  song = song.setKey(transposedKey);
4153
4159
  }
4154
4160
  return song.mapItems((item)=>{
4155
- if (item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) return item.transpose(delta, transposedKey);
4161
+ if (item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039)) return item.transpose(delta, transposedKey, {
4162
+ normalizeChordSuffix: normalizeChordSuffix
4163
+ });
4156
4164
  return item;
4157
4165
  });
4158
4166
  }
@@ -4161,18 +4169,26 @@ var $ce1dd7d0f2cd2369$export$2e2bcd8739ae039 = $ce1dd7d0f2cd2369$var$ParserWarni
4161
4169
  * - transpose all chords, see: {@link Chord#transpose}
4162
4170
  * - transpose the song key in {@link metadata}
4163
4171
  * - update any existing `key` directive
4172
+ * @param {Object} [options={}] options
4173
+ * @param {boolean} [options.normalizeChordSuffix=false] whether to normalize the chord suffixes after transposing
4164
4174
  * @returns {Song} The transposed song
4165
- */ transposeUp() {
4166
- return this.transpose(1);
4175
+ */ transposeUp({ normalizeChordSuffix: normalizeChordSuffix = false } = {}) {
4176
+ return this.transpose(1, {
4177
+ normalizeChordSuffix: normalizeChordSuffix
4178
+ });
4167
4179
  }
4168
4180
  /**
4169
4181
  * Transposes the song down by one semitone. It will:
4170
4182
  * - transpose all chords, see: {@link Chord#transpose}
4171
4183
  * - transpose the song key in {@link metadata}
4172
4184
  * - update any existing `key` directive
4185
+ * @param {Object} [options={}] options
4186
+ * @param {boolean} [options.normalizeChordSuffix=false] whether to normalize the chord suffixes after transposing
4173
4187
  * @returns {Song} The transposed song
4174
- */ transposeDown() {
4175
- return this.transpose(-1);
4188
+ */ transposeDown({ normalizeChordSuffix: normalizeChordSuffix = false } = {}) {
4189
+ return this.transpose(-1, {
4190
+ normalizeChordSuffix: normalizeChordSuffix
4191
+ });
4176
4192
  }
4177
4193
  /**
4178
4194
  * Returns a copy of the song with the key set to the specified key. It changes:
@@ -4809,40 +4825,38 @@ function $dfecd32049fa58e9$export$74743eda5dda3ccf(key) {
4809
4825
 
4810
4826
 
4811
4827
 
4812
-
4813
- const $376e205ced98486b$var$lineHasContents = (line)=>line.items.some((item)=>item.isRenderable());
4828
+ const $376e205ced98486b$export$17c9e635b932873b = (item)=>item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039);
4829
+ const $376e205ced98486b$export$3db5961874282581 = (line)=>line.items.some((item)=>item.isRenderable());
4830
+ const $376e205ced98486b$export$3bf645f08efe3292 = (item)=>item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039);
4831
+ const $376e205ced98486b$export$3ab01370f5e64ac8 = (item)=>item.name === "comment";
4832
+ function $376e205ced98486b$export$6ea1b0eb82ead3f(string) {
4833
+ return string.trim().replace(/(<\/[a-z]+>)\s+(<)/g, "$1$2").replace(/(\n)\s+/g, "");
4834
+ }
4835
+ function $376e205ced98486b$export$79b2f7037acddd43(collection, callback) {
4836
+ return collection.map(callback).join("");
4837
+ }
4838
+ function $376e205ced98486b$export$a55877ca9db47377(condition, callback) {
4839
+ return condition ? callback() : "";
4840
+ }
4814
4841
  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));
4815
- (0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("isChordLyricsPair", (item)=>item instanceof (0, $d454f4215ba01af2$export$2e2bcd8739ae039));
4816
- (0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("isTag", (item)=>item instanceof (0, $5e9ede69210ec54a$export$2e2bcd8739ae039));
4817
- (0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("isComment", (item)=>item.name === "comment");
4818
- (0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("shouldRenderLine", (line, options)=>{
4819
- if (options.data.root.renderBlankLines) return true;
4820
- return $376e205ced98486b$var$lineHasContents(line);
4821
- });
4822
- (0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("hasChordContents", (0, $21a34a464e7bc609$export$d332d76d125f0cbe));
4823
- (0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("hasTextContents", $376e205ced98486b$export$b8d631d9200974fa);
4824
- (0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("lineHasContents", $376e205ced98486b$var$lineHasContents);
4825
- (0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("lineClasses", (line)=>{
4842
+ const $376e205ced98486b$export$8a559c16cc3576 = (line)=>{
4826
4843
  const classes = [
4827
4844
  "row"
4828
4845
  ];
4829
- if (!$376e205ced98486b$var$lineHasContents(line)) classes.push("empty-line");
4846
+ if (!$376e205ced98486b$export$3db5961874282581(line)) classes.push("empty-line");
4830
4847
  return classes.join(" ");
4831
- });
4832
- (0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("toUpperCase", (line)=>line.toUpperCase());
4833
- (0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("paragraphClasses", (paragraph)=>{
4848
+ };
4849
+ const $376e205ced98486b$export$dcd1550c9709312c = (paragraph)=>{
4834
4850
  const classes = [
4835
4851
  "paragraph"
4836
4852
  ];
4837
4853
  if (paragraph.type !== (0, $af8d31735c159a26$export$c5a6fe907430212e) && paragraph.type !== (0, $af8d31735c159a26$export$c53d0f541b41b88e)) classes.push(paragraph.type);
4838
4854
  return classes.join(" ");
4839
- });
4840
- (0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("isEvaluatable", (0, $21a34a464e7bc609$export$e3f63561d52b936d));
4841
- (0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("evaluate", (item, metadata, configuration)=>{
4855
+ };
4856
+ const $376e205ced98486b$export$fef61f332f2c0afc = (item, metadata, configuration)=>{
4842
4857
  if (!metadata) throw new Error("cannot evaluate, metadata is null");
4843
4858
  return item.evaluate(metadata, configuration.get("metadata.separator"));
4844
- });
4845
- (0, ($parcel$interopDefault($988mA$handlebars))).registerHelper("renderChord", (0, $dfecd32049fa58e9$export$596ec52955da9472));
4859
+ };
4846
4860
 
4847
4861
 
4848
4862
 
@@ -4929,647 +4943,6 @@ var $525b2331e4b0ed83$export$2e2bcd8739ae039 = $525b2331e4b0ed83$var$TextFormatt
4929
4943
 
4930
4944
 
4931
4945
 
4932
-
4933
- var $cc306339371360c4$var$template = $988mA$handlebars.template, $cc306339371360c4$var$templates = $988mA$handlebars.templates = $988mA$handlebars.templates || {};
4934
- $cc306339371360c4$var$templates["html_table_formatter"] = $cc306339371360c4$var$template({
4935
- "1": function(container, depth0, helpers, partials, data, blockParams) {
4936
- var stack1, alias1 = depth0 != null ? depth0 : container.nullContext || {}, lookupProperty = container.lookupProperty || function(parent, propertyName) {
4937
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
4938
- return undefined;
4939
- };
4940
- return ((stack1 = lookupProperty(helpers, "if").call(alias1, depth0 != null ? lookupProperty(depth0, "title") : depth0, {
4941
- "name": "if",
4942
- "hash": {},
4943
- "fn": container.program(2, data, 0, blockParams),
4944
- "inverse": container.noop,
4945
- "data": data,
4946
- "blockParams": blockParams,
4947
- "loc": {
4948
- "start": {
4949
- "line": 2,
4950
- "column": 2
4951
- },
4952
- "end": {
4953
- "line": 4,
4954
- "column": 11
4955
- }
4956
- }
4957
- })) != null ? stack1 : "") + ((stack1 = lookupProperty(helpers, "if").call(alias1, depth0 != null ? lookupProperty(depth0, "subtitle") : depth0, {
4958
- "name": "if",
4959
- "hash": {},
4960
- "fn": container.program(4, data, 0, blockParams),
4961
- "inverse": container.noop,
4962
- "data": data,
4963
- "blockParams": blockParams,
4964
- "loc": {
4965
- "start": {
4966
- "line": 6,
4967
- "column": 2
4968
- },
4969
- "end": {
4970
- "line": 8,
4971
- "column": 11
4972
- }
4973
- }
4974
- })) != null ? stack1 : "") + ((stack1 = lookupProperty(helpers, "if").call(alias1, depth0 != null ? lookupProperty(depth0, "bodyLines") : depth0, {
4975
- "name": "if",
4976
- "hash": {},
4977
- "fn": container.program(6, data, 0, blockParams),
4978
- "inverse": container.noop,
4979
- "data": data,
4980
- "blockParams": blockParams,
4981
- "loc": {
4982
- "start": {
4983
- "line": 10,
4984
- "column": 2
4985
- },
4986
- "end": {
4987
- "line": 52,
4988
- "column": 11
4989
- }
4990
- }
4991
- })) != null ? stack1 : "");
4992
- },
4993
- "2": function(container, depth0, helpers, partials, data) {
4994
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
4995
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
4996
- return undefined;
4997
- };
4998
- return "<h1>" + container.escapeExpression((helper = (helper = lookupProperty(helpers, "title") || (depth0 != null ? lookupProperty(depth0, "title") : depth0)) != null ? helper : container.hooks.helperMissing, typeof helper === "function" ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, {
4999
- "name": "title",
5000
- "hash": {},
5001
- "data": data,
5002
- "loc": {
5003
- "start": {
5004
- "line": 3,
5005
- "column": 8
5006
- },
5007
- "end": {
5008
- "line": 3,
5009
- "column": 19
5010
- }
5011
- }
5012
- }) : helper)) + "</h1>";
5013
- },
5014
- "4": function(container, depth0, helpers, partials, data) {
5015
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5016
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5017
- return undefined;
5018
- };
5019
- return "<h2>" + container.escapeExpression((helper = (helper = lookupProperty(helpers, "subtitle") || (depth0 != null ? lookupProperty(depth0, "subtitle") : depth0)) != null ? helper : container.hooks.helperMissing, typeof helper === "function" ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, {
5020
- "name": "subtitle",
5021
- "hash": {},
5022
- "data": data,
5023
- "loc": {
5024
- "start": {
5025
- "line": 7,
5026
- "column": 8
5027
- },
5028
- "end": {
5029
- "line": 7,
5030
- "column": 22
5031
- }
5032
- }
5033
- }) : helper)) + "</h2>";
5034
- },
5035
- "6": function(container, depth0, helpers, partials, data, blockParams) {
5036
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5037
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5038
- return undefined;
5039
- };
5040
- return '<div class="chord-sheet">' + ((stack1 = lookupProperty(helpers, "each").call(depth0 != null ? depth0 : container.nullContext || {}, depth0 != null ? lookupProperty(depth0, "bodyParagraphs") : depth0, {
5041
- "name": "each",
5042
- "hash": {},
5043
- "fn": container.program(7, data, 1, blockParams),
5044
- "inverse": container.noop,
5045
- "data": data,
5046
- "blockParams": blockParams,
5047
- "loc": {
5048
- "start": {
5049
- "line": 12,
5050
- "column": 6
5051
- },
5052
- "end": {
5053
- "line": 50,
5054
- "column": 17
5055
- }
5056
- }
5057
- })) != null ? stack1 : "") + "</div>";
5058
- },
5059
- "7": function(container, depth0, helpers, partials, data, blockParams) {
5060
- var stack1, alias1 = depth0 != null ? depth0 : container.nullContext || {}, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5061
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5062
- return undefined;
5063
- };
5064
- return '<div class="' + container.escapeExpression(lookupProperty(helpers, "paragraphClasses").call(alias1, blockParams[0][0], {
5065
- "name": "paragraphClasses",
5066
- "hash": {},
5067
- "data": data,
5068
- "blockParams": blockParams,
5069
- "loc": {
5070
- "start": {
5071
- "line": 13,
5072
- "column": 20
5073
- },
5074
- "end": {
5075
- "line": 13,
5076
- "column": 50
5077
- }
5078
- }
5079
- })) + '">' + ((stack1 = lookupProperty(helpers, "each").call(alias1, depth0 != null ? lookupProperty(depth0, "lines") : depth0, {
5080
- "name": "each",
5081
- "hash": {},
5082
- "fn": container.program(8, data, 1, blockParams),
5083
- "inverse": container.noop,
5084
- "data": data,
5085
- "blockParams": blockParams,
5086
- "loc": {
5087
- "start": {
5088
- "line": 14,
5089
- "column": 10
5090
- },
5091
- "end": {
5092
- "line": 48,
5093
- "column": 21
5094
- }
5095
- }
5096
- })) != null ? stack1 : "") + "</div>";
5097
- },
5098
- "8": function(container, depth0, helpers, partials, data, blockParams) {
5099
- var stack1, alias1 = depth0 != null ? depth0 : container.nullContext || {}, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5100
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5101
- return undefined;
5102
- };
5103
- return (stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(helpers, "shouldRenderLine").call(alias1, blockParams[0][0], {
5104
- "name": "shouldRenderLine",
5105
- "hash": {},
5106
- "data": data,
5107
- "blockParams": blockParams,
5108
- "loc": {
5109
- "start": {
5110
- "line": 15,
5111
- "column": 19
5112
- },
5113
- "end": {
5114
- "line": 15,
5115
- "column": 42
5116
- }
5117
- }
5118
- }), {
5119
- "name": "if",
5120
- "hash": {},
5121
- "fn": container.program(9, data, 0, blockParams),
5122
- "inverse": container.noop,
5123
- "data": data,
5124
- "blockParams": blockParams,
5125
- "loc": {
5126
- "start": {
5127
- "line": 15,
5128
- "column": 12
5129
- },
5130
- "end": {
5131
- "line": 47,
5132
- "column": 21
5133
- }
5134
- }
5135
- })) != null ? stack1 : "";
5136
- },
5137
- "9": function(container, depth0, helpers, partials, data, blockParams) {
5138
- var stack1, alias1 = depth0 != null ? depth0 : container.nullContext || {}, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5139
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5140
- return undefined;
5141
- };
5142
- return '<table class="' + container.escapeExpression(lookupProperty(helpers, "lineClasses").call(alias1, blockParams[1][0], {
5143
- "name": "lineClasses",
5144
- "hash": {},
5145
- "data": data,
5146
- "blockParams": blockParams,
5147
- "loc": {
5148
- "start": {
5149
- "line": 16,
5150
- "column": 28
5151
- },
5152
- "end": {
5153
- "line": 16,
5154
- "column": 48
5155
- }
5156
- }
5157
- })) + '">' + ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(helpers, "hasChordContents").call(alias1, blockParams[1][0], {
5158
- "name": "hasChordContents",
5159
- "hash": {},
5160
- "data": data,
5161
- "blockParams": blockParams,
5162
- "loc": {
5163
- "start": {
5164
- "line": 17,
5165
- "column": 23
5166
- },
5167
- "end": {
5168
- "line": 17,
5169
- "column": 46
5170
- }
5171
- }
5172
- }), {
5173
- "name": "if",
5174
- "hash": {},
5175
- "fn": container.program(10, data, 0, blockParams),
5176
- "inverse": container.noop,
5177
- "data": data,
5178
- "blockParams": blockParams,
5179
- "loc": {
5180
- "start": {
5181
- "line": 17,
5182
- "column": 16
5183
- },
5184
- "end": {
5185
- "line": 25,
5186
- "column": 25
5187
- }
5188
- }
5189
- })) != null ? stack1 : "") + ((stack1 = lookupProperty(helpers, "if").call(alias1, (lookupProperty(helpers, "hasTextContents") || depth0 && lookupProperty(depth0, "hasTextContents") || container.hooks.helperMissing).call(alias1, blockParams[1][0], {
5190
- "name": "hasTextContents",
5191
- "hash": {},
5192
- "data": data,
5193
- "blockParams": blockParams,
5194
- "loc": {
5195
- "start": {
5196
- "line": 27,
5197
- "column": 23
5198
- },
5199
- "end": {
5200
- "line": 27,
5201
- "column": 45
5202
- }
5203
- }
5204
- }), {
5205
- "name": "if",
5206
- "hash": {},
5207
- "fn": container.program(14, data, 0, blockParams),
5208
- "inverse": container.noop,
5209
- "data": data,
5210
- "blockParams": blockParams,
5211
- "loc": {
5212
- "start": {
5213
- "line": 27,
5214
- "column": 16
5215
- },
5216
- "end": {
5217
- "line": 45,
5218
- "column": 25
5219
- }
5220
- }
5221
- })) != null ? stack1 : "") + "</table>";
5222
- },
5223
- "10": function(container, depth0, helpers, partials, data, blockParams) {
5224
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5225
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5226
- return undefined;
5227
- };
5228
- return "<tr>" + ((stack1 = lookupProperty(helpers, "each").call(depth0 != null ? depth0 : container.nullContext || {}, depth0 != null ? lookupProperty(depth0, "items") : depth0, {
5229
- "name": "each",
5230
- "hash": {},
5231
- "fn": container.program(11, data, 1, blockParams),
5232
- "inverse": container.noop,
5233
- "data": data,
5234
- "blockParams": blockParams,
5235
- "loc": {
5236
- "start": {
5237
- "line": 19,
5238
- "column": 20
5239
- },
5240
- "end": {
5241
- "line": 23,
5242
- "column": 31
5243
- }
5244
- }
5245
- })) != null ? stack1 : "") + "</tr>";
5246
- },
5247
- "11": function(container, depth0, helpers, partials, data, blockParams) {
5248
- var stack1, alias1 = depth0 != null ? depth0 : container.nullContext || {}, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5249
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5250
- return undefined;
5251
- };
5252
- return (stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(helpers, "isChordLyricsPair").call(alias1, blockParams[0][0], {
5253
- "name": "isChordLyricsPair",
5254
- "hash": {},
5255
- "data": data,
5256
- "blockParams": blockParams,
5257
- "loc": {
5258
- "start": {
5259
- "line": 20,
5260
- "column": 29
5261
- },
5262
- "end": {
5263
- "line": 20,
5264
- "column": 53
5265
- }
5266
- }
5267
- }), {
5268
- "name": "if",
5269
- "hash": {},
5270
- "fn": container.program(12, data, 0, blockParams),
5271
- "inverse": container.noop,
5272
- "data": data,
5273
- "blockParams": blockParams,
5274
- "loc": {
5275
- "start": {
5276
- "line": 20,
5277
- "column": 22
5278
- },
5279
- "end": {
5280
- "line": 22,
5281
- "column": 31
5282
- }
5283
- }
5284
- })) != null ? stack1 : "";
5285
- },
5286
- "12": function(container, depth0, helpers, partials, data, blockParams) {
5287
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5288
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5289
- return undefined;
5290
- };
5291
- 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"), {
5292
- "name": "renderChord",
5293
- "hash": {},
5294
- "data": data,
5295
- "blockParams": blockParams,
5296
- "loc": {
5297
- "start": {
5298
- "line": 21,
5299
- "column": 42
5300
- },
5301
- "end": {
5302
- "line": 21,
5303
- "column": 102
5304
- }
5305
- }
5306
- })) + "</td>";
5307
- },
5308
- "14": function(container, depth0, helpers, partials, data, blockParams) {
5309
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5310
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5311
- return undefined;
5312
- };
5313
- return "<tr>" + ((stack1 = lookupProperty(helpers, "each").call(depth0 != null ? depth0 : container.nullContext || {}, depth0 != null ? lookupProperty(depth0, "items") : depth0, {
5314
- "name": "each",
5315
- "hash": {},
5316
- "fn": container.program(15, data, 1, blockParams),
5317
- "inverse": container.noop,
5318
- "data": data,
5319
- "blockParams": blockParams,
5320
- "loc": {
5321
- "start": {
5322
- "line": 29,
5323
- "column": 20
5324
- },
5325
- "end": {
5326
- "line": 43,
5327
- "column": 31
5328
- }
5329
- }
5330
- })) != null ? stack1 : "") + "</tr>";
5331
- },
5332
- "15": function(container, depth0, helpers, partials, data, blockParams) {
5333
- var stack1, alias1 = depth0 != null ? depth0 : container.nullContext || {}, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5334
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5335
- return undefined;
5336
- };
5337
- return ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(helpers, "isChordLyricsPair").call(alias1, blockParams[0][0], {
5338
- "name": "isChordLyricsPair",
5339
- "hash": {},
5340
- "data": data,
5341
- "blockParams": blockParams,
5342
- "loc": {
5343
- "start": {
5344
- "line": 30,
5345
- "column": 29
5346
- },
5347
- "end": {
5348
- "line": 30,
5349
- "column": 53
5350
- }
5351
- }
5352
- }), {
5353
- "name": "if",
5354
- "hash": {},
5355
- "fn": container.program(16, data, 0, blockParams),
5356
- "inverse": container.noop,
5357
- "data": data,
5358
- "blockParams": blockParams,
5359
- "loc": {
5360
- "start": {
5361
- "line": 30,
5362
- "column": 22
5363
- },
5364
- "end": {
5365
- "line": 32,
5366
- "column": 31
5367
- }
5368
- }
5369
- })) != null ? stack1 : "") + ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(helpers, "isTag").call(alias1, blockParams[0][0], {
5370
- "name": "isTag",
5371
- "hash": {},
5372
- "data": data,
5373
- "blockParams": blockParams,
5374
- "loc": {
5375
- "start": {
5376
- "line": 34,
5377
- "column": 29
5378
- },
5379
- "end": {
5380
- "line": 34,
5381
- "column": 41
5382
- }
5383
- }
5384
- }), {
5385
- "name": "if",
5386
- "hash": {},
5387
- "fn": container.program(18, data, 0, blockParams),
5388
- "inverse": container.noop,
5389
- "data": data,
5390
- "blockParams": blockParams,
5391
- "loc": {
5392
- "start": {
5393
- "line": 34,
5394
- "column": 22
5395
- },
5396
- "end": {
5397
- "line": 38,
5398
- "column": 31
5399
- }
5400
- }
5401
- })) != null ? stack1 : "") + ((stack1 = lookupProperty(helpers, "if").call(alias1, (lookupProperty(helpers, "isEvaluatable") || depth0 && lookupProperty(depth0, "isEvaluatable") || container.hooks.helperMissing).call(alias1, blockParams[0][0], {
5402
- "name": "isEvaluatable",
5403
- "hash": {},
5404
- "data": data,
5405
- "blockParams": blockParams,
5406
- "loc": {
5407
- "start": {
5408
- "line": 40,
5409
- "column": 29
5410
- },
5411
- "end": {
5412
- "line": 40,
5413
- "column": 49
5414
- }
5415
- }
5416
- }), {
5417
- "name": "if",
5418
- "hash": {},
5419
- "fn": container.program(21, data, 0, blockParams),
5420
- "inverse": container.noop,
5421
- "data": data,
5422
- "blockParams": blockParams,
5423
- "loc": {
5424
- "start": {
5425
- "line": 40,
5426
- "column": 22
5427
- },
5428
- "end": {
5429
- "line": 42,
5430
- "column": 31
5431
- }
5432
- }
5433
- })) != null ? stack1 : "");
5434
- },
5435
- "16": function(container, depth0, helpers, partials, data) {
5436
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5437
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5438
- return undefined;
5439
- };
5440
- 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 || {}, {
5441
- "name": "lyrics",
5442
- "hash": {},
5443
- "data": data,
5444
- "loc": {
5445
- "start": {
5446
- "line": 31,
5447
- "column": 43
5448
- },
5449
- "end": {
5450
- "line": 31,
5451
- "column": 53
5452
- }
5453
- }
5454
- }) : helper)) + "</td>";
5455
- },
5456
- "18": function(container, depth0, helpers, partials, data, blockParams) {
5457
- var stack1, alias1 = depth0 != null ? depth0 : container.nullContext || {}, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5458
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5459
- return undefined;
5460
- };
5461
- return (stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(helpers, "isComment").call(alias1, blockParams[1][0], {
5462
- "name": "isComment",
5463
- "hash": {},
5464
- "data": data,
5465
- "blockParams": blockParams,
5466
- "loc": {
5467
- "start": {
5468
- "line": 35,
5469
- "column": 31
5470
- },
5471
- "end": {
5472
- "line": 35,
5473
- "column": 47
5474
- }
5475
- }
5476
- }), {
5477
- "name": "if",
5478
- "hash": {},
5479
- "fn": container.program(19, data, 0, blockParams),
5480
- "inverse": container.noop,
5481
- "data": data,
5482
- "blockParams": blockParams,
5483
- "loc": {
5484
- "start": {
5485
- "line": 35,
5486
- "column": 24
5487
- },
5488
- "end": {
5489
- "line": 37,
5490
- "column": 33
5491
- }
5492
- }
5493
- })) != null ? stack1 : "";
5494
- },
5495
- "19": function(container, depth0, helpers, partials, data) {
5496
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5497
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5498
- return undefined;
5499
- };
5500
- 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 || {}, {
5501
- "name": "value",
5502
- "hash": {},
5503
- "data": data,
5504
- "loc": {
5505
- "start": {
5506
- "line": 36,
5507
- "column": 46
5508
- },
5509
- "end": {
5510
- "line": 36,
5511
- "column": 55
5512
- }
5513
- }
5514
- }) : helper)) + "</td>";
5515
- },
5516
- "21": function(container, depth0, helpers, partials, data, blockParams) {
5517
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5518
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5519
- return undefined;
5520
- };
5521
- 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"), {
5522
- "name": "evaluate",
5523
- "hash": {},
5524
- "data": data,
5525
- "blockParams": blockParams,
5526
- "loc": {
5527
- "start": {
5528
- "line": 41,
5529
- "column": 43
5530
- },
5531
- "end": {
5532
- "line": 41,
5533
- "column": 100
5534
- }
5535
- }
5536
- })) + "</td>";
5537
- },
5538
- "compiler": [
5539
- 8,
5540
- ">= 4.3.0"
5541
- ],
5542
- "main": function(container, depth0, helpers, partials, data, blockParams) {
5543
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5544
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5545
- return undefined;
5546
- };
5547
- return (stack1 = lookupProperty(helpers, "with").call(depth0 != null ? depth0 : container.nullContext || {}, depth0 != null ? lookupProperty(depth0, "song") : depth0, {
5548
- "name": "with",
5549
- "hash": {},
5550
- "fn": container.program(1, data, 0, blockParams),
5551
- "inverse": container.noop,
5552
- "data": data,
5553
- "blockParams": blockParams,
5554
- "loc": {
5555
- "start": {
5556
- "line": 1,
5557
- "column": 0
5558
- },
5559
- "end": {
5560
- "line": 53,
5561
- "column": 11
5562
- }
5563
- }
5564
- })) != null ? stack1 : "";
5565
- },
5566
- "useData": true,
5567
- "useBlockParams": true
5568
- });
5569
-
5570
-
5571
-
5572
-
5573
4946
  /**
5574
4947
  * Acts as a base class for HTML formatters, taking care of whitelisting prototype property access.
5575
4948
  */ class $d834af97c9a2e4df$var$HtmlFormatter extends (0, $0055ecb09272ba2d$export$2e2bcd8739ae039) {
@@ -5577,15 +4950,6 @@ $cc306339371360c4$var$templates["html_table_formatter"] = $cc306339371360c4$var$
5577
4950
  return template({
5578
4951
  song: song,
5579
4952
  configuration: this.configuration
5580
- }, {
5581
- allowedProtoProperties: {
5582
- bodyLines: true,
5583
- bodyParagraphs: true,
5584
- subtitle: true,
5585
- title: true,
5586
- value: true,
5587
- key: true
5588
- }
5589
4953
  });
5590
4954
  }
5591
4955
  }
@@ -5593,7 +4957,57 @@ var $d834af97c9a2e4df$export$2e2bcd8739ae039 = $d834af97c9a2e4df$var$HtmlFormatt
5593
4957
 
5594
4958
 
5595
4959
 
5596
- const { html_table_formatter: $5b02ea769c63fd56$var$template } = (0, ($parcel$interopDefault($988mA$handlebars))).templates;
4960
+
4961
+
4962
+ var $5381a6b1b90601c7$export$2e2bcd8739ae039 = ({ configuration: configuration , song: song , renderBlankLines: renderBlankLines = false , song: { title: title , subtitle: subtitle , bodyParagraphs: bodyParagraphs , bodyLines: bodyLines , metadata: metadata , } , })=>(0, $376e205ced98486b$export$6ea1b0eb82ead3f)(`
4963
+ ${(0, $376e205ced98486b$export$a55877ca9db47377)(title, ()=>`<h1>${title}</h1>`)}
4964
+ ${(0, $376e205ced98486b$export$a55877ca9db47377)(subtitle, ()=>`<h2>${subtitle}</h2>`)}
4965
+
4966
+ ${(0, $376e205ced98486b$export$a55877ca9db47377)(bodyLines.length > 0, ()=>`
4967
+ <div class="chord-sheet">
4968
+ ${(0, $376e205ced98486b$export$79b2f7037acddd43)(bodyParagraphs, (paragraph)=>`
4969
+ <div class="${(0, $376e205ced98486b$export$dcd1550c9709312c)(paragraph)}">
4970
+ ${(0, $376e205ced98486b$export$79b2f7037acddd43)(paragraph.lines, (line)=>`
4971
+ ${(0, $376e205ced98486b$export$a55877ca9db47377)(renderBlankLines || (0, $376e205ced98486b$export$3db5961874282581)(line), ()=>`
4972
+ <table class="${(0, $376e205ced98486b$export$8a559c16cc3576)(line)}">
4973
+ ${(0, $376e205ced98486b$export$a55877ca9db47377)((0, $21a34a464e7bc609$export$d332d76d125f0cbe)(line), ()=>`
4974
+ <tr>
4975
+ ${(0, $376e205ced98486b$export$79b2f7037acddd43)(line.items, (item)=>`
4976
+ ${(0, $376e205ced98486b$export$a55877ca9db47377)((0, $376e205ced98486b$export$17c9e635b932873b)(item), ()=>`
4977
+ <td class="chord">${(0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line.key, line.transposeKey, song)}</td>
4978
+ `)}
4979
+ `)}
4980
+ </tr>
4981
+ `)}
4982
+
4983
+ ${(0, $376e205ced98486b$export$a55877ca9db47377)((0, $376e205ced98486b$export$b8d631d9200974fa)(line), ()=>`
4984
+ <tr>
4985
+ ${(0, $376e205ced98486b$export$79b2f7037acddd43)(line.items, (item)=>`
4986
+ ${(0, $376e205ced98486b$export$a55877ca9db47377)((0, $376e205ced98486b$export$17c9e635b932873b)(item), ()=>`
4987
+ <td class="lyrics">${item.lyrics}</td>
4988
+ `)}
4989
+
4990
+ ${(0, $376e205ced98486b$export$a55877ca9db47377)((0, $376e205ced98486b$export$3bf645f08efe3292)(item) && (0, $376e205ced98486b$export$3ab01370f5e64ac8)(item), ()=>`
4991
+ <td class="comment">${item.value}</td>
4992
+ `)}
4993
+
4994
+ ${(0, $376e205ced98486b$export$a55877ca9db47377)((0, $21a34a464e7bc609$export$e3f63561d52b936d)(item), ()=>`
4995
+ <td class="lyrics">${(0, $376e205ced98486b$export$fef61f332f2c0afc)(item, metadata, configuration)}</td>
4996
+ `)}
4997
+ `)}
4998
+ </tr>
4999
+ `)}
5000
+ </table>
5001
+ `)}
5002
+ `)}
5003
+ </div>
5004
+ `)}
5005
+ </div>
5006
+ `)}
5007
+ `);
5008
+
5009
+
5010
+
5597
5011
  const $5b02ea769c63fd56$export$200cf2de69532aa8 = {
5598
5012
  h1: {
5599
5013
  fontSize: "1.5em"
@@ -5627,7 +5041,7 @@ function $5b02ea769c63fd56$export$aa5b6043dd05348b(scope) {
5627
5041
  * @param {Song} song The song to be formatted
5628
5042
  * @returns {string} The HTML string
5629
5043
  */ format(song) {
5630
- return this.formatWithTemplate(song, $5b02ea769c63fd56$var$template);
5044
+ return this.formatWithTemplate(song, (0, $5381a6b1b90601c7$export$2e2bcd8739ae039));
5631
5045
  }
5632
5046
  /**
5633
5047
  * Generates basic CSS, optionally scoped within the provided selector, to use with output generated by
@@ -5664,484 +5078,44 @@ var $5b02ea769c63fd56$export$2e2bcd8739ae039 = $5b02ea769c63fd56$var$HtmlTableFo
5664
5078
 
5665
5079
 
5666
5080
 
5667
- var $9d647eea0a7973fb$var$template = $988mA$handlebars.template, $9d647eea0a7973fb$var$templates = $988mA$handlebars.templates = $988mA$handlebars.templates || {};
5668
- $9d647eea0a7973fb$var$templates["html_div_formatter"] = $9d647eea0a7973fb$var$template({
5669
- "1": function(container, depth0, helpers, partials, data, blockParams) {
5670
- var stack1, alias1 = depth0 != null ? depth0 : container.nullContext || {}, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5671
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5672
- return undefined;
5673
- };
5674
- return ((stack1 = lookupProperty(helpers, "if").call(alias1, depth0 != null ? lookupProperty(depth0, "title") : depth0, {
5675
- "name": "if",
5676
- "hash": {},
5677
- "fn": container.program(2, data, 0, blockParams),
5678
- "inverse": container.noop,
5679
- "data": data,
5680
- "blockParams": blockParams,
5681
- "loc": {
5682
- "start": {
5683
- "line": 2,
5684
- "column": 2
5685
- },
5686
- "end": {
5687
- "line": 4,
5688
- "column": 11
5689
- }
5690
- }
5691
- })) != null ? stack1 : "") + ((stack1 = lookupProperty(helpers, "if").call(alias1, depth0 != null ? lookupProperty(depth0, "subtitle") : depth0, {
5692
- "name": "if",
5693
- "hash": {},
5694
- "fn": container.program(4, data, 0, blockParams),
5695
- "inverse": container.noop,
5696
- "data": data,
5697
- "blockParams": blockParams,
5698
- "loc": {
5699
- "start": {
5700
- "line": 6,
5701
- "column": 2
5702
- },
5703
- "end": {
5704
- "line": 8,
5705
- "column": 11
5706
- }
5707
- }
5708
- })) != null ? stack1 : "") + '<div class="chord-sheet">' + ((stack1 = lookupProperty(helpers, "each").call(alias1, depth0 != null ? lookupProperty(depth0, "bodyParagraphs") : depth0, {
5709
- "name": "each",
5710
- "hash": {},
5711
- "fn": container.program(6, data, 1, blockParams),
5712
- "inverse": container.noop,
5713
- "data": data,
5714
- "blockParams": blockParams,
5715
- "loc": {
5716
- "start": {
5717
- "line": 11,
5718
- "column": 4
5719
- },
5720
- "end": {
5721
- "line": 35,
5722
- "column": 15
5723
- }
5724
- }
5725
- })) != null ? stack1 : "") + "</div>";
5726
- },
5727
- "2": function(container, depth0, helpers, partials, data) {
5728
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5729
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5730
- return undefined;
5731
- };
5732
- return "<h1>" + container.escapeExpression((helper = (helper = lookupProperty(helpers, "title") || (depth0 != null ? lookupProperty(depth0, "title") : depth0)) != null ? helper : container.hooks.helperMissing, typeof helper === "function" ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, {
5733
- "name": "title",
5734
- "hash": {},
5735
- "data": data,
5736
- "loc": {
5737
- "start": {
5738
- "line": 3,
5739
- "column": 8
5740
- },
5741
- "end": {
5742
- "line": 3,
5743
- "column": 19
5744
- }
5745
- }
5746
- }) : helper)) + "</h1>";
5747
- },
5748
- "4": function(container, depth0, helpers, partials, data) {
5749
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5750
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5751
- return undefined;
5752
- };
5753
- return "<h2>" + container.escapeExpression((helper = (helper = lookupProperty(helpers, "subtitle") || (depth0 != null ? lookupProperty(depth0, "subtitle") : depth0)) != null ? helper : container.hooks.helperMissing, typeof helper === "function" ? helper.call(depth0 != null ? depth0 : container.nullContext || {}, {
5754
- "name": "subtitle",
5755
- "hash": {},
5756
- "data": data,
5757
- "loc": {
5758
- "start": {
5759
- "line": 7,
5760
- "column": 8
5761
- },
5762
- "end": {
5763
- "line": 7,
5764
- "column": 22
5765
- }
5766
- }
5767
- }) : helper)) + "</h2>";
5768
- },
5769
- "6": function(container, depth0, helpers, partials, data, blockParams) {
5770
- var stack1, alias1 = depth0 != null ? depth0 : container.nullContext || {}, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5771
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5772
- return undefined;
5773
- };
5774
- return '<div class="' + container.escapeExpression(lookupProperty(helpers, "paragraphClasses").call(alias1, blockParams[0][0], {
5775
- "name": "paragraphClasses",
5776
- "hash": {},
5777
- "data": data,
5778
- "blockParams": blockParams,
5779
- "loc": {
5780
- "start": {
5781
- "line": 12,
5782
- "column": 18
5783
- },
5784
- "end": {
5785
- "line": 12,
5786
- "column": 48
5787
- }
5788
- }
5789
- })) + '">' + ((stack1 = lookupProperty(helpers, "each").call(alias1, depth0 != null ? lookupProperty(depth0, "lines") : depth0, {
5790
- "name": "each",
5791
- "hash": {},
5792
- "fn": container.program(7, data, 1, blockParams),
5793
- "inverse": container.noop,
5794
- "data": data,
5795
- "blockParams": blockParams,
5796
- "loc": {
5797
- "start": {
5798
- "line": 13,
5799
- "column": 8
5800
- },
5801
- "end": {
5802
- "line": 33,
5803
- "column": 19
5804
- }
5805
- }
5806
- })) != null ? stack1 : "") + "</div>";
5807
- },
5808
- "7": function(container, depth0, helpers, partials, data, blockParams) {
5809
- var stack1, alias1 = depth0 != null ? depth0 : container.nullContext || {}, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5810
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5811
- return undefined;
5812
- };
5813
- return (stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(helpers, "shouldRenderLine").call(alias1, blockParams[0][0], {
5814
- "name": "shouldRenderLine",
5815
- "hash": {},
5816
- "data": data,
5817
- "blockParams": blockParams,
5818
- "loc": {
5819
- "start": {
5820
- "line": 14,
5821
- "column": 17
5822
- },
5823
- "end": {
5824
- "line": 14,
5825
- "column": 40
5826
- }
5827
- }
5828
- }), {
5829
- "name": "if",
5830
- "hash": {},
5831
- "fn": container.program(8, data, 0, blockParams),
5832
- "inverse": container.noop,
5833
- "data": data,
5834
- "blockParams": blockParams,
5835
- "loc": {
5836
- "start": {
5837
- "line": 14,
5838
- "column": 10
5839
- },
5840
- "end": {
5841
- "line": 32,
5842
- "column": 19
5843
- }
5844
- }
5845
- })) != null ? stack1 : "";
5846
- },
5847
- "8": function(container, depth0, helpers, partials, data, blockParams) {
5848
- var stack1, alias1 = depth0 != null ? depth0 : container.nullContext || {}, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5849
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5850
- return undefined;
5851
- };
5852
- return '<div class="' + container.escapeExpression(lookupProperty(helpers, "lineClasses").call(alias1, blockParams[1][0], {
5853
- "name": "lineClasses",
5854
- "hash": {},
5855
- "data": data,
5856
- "blockParams": blockParams,
5857
- "loc": {
5858
- "start": {
5859
- "line": 15,
5860
- "column": 24
5861
- },
5862
- "end": {
5863
- "line": 15,
5864
- "column": 44
5865
- }
5866
- }
5867
- })) + '">' + ((stack1 = lookupProperty(helpers, "each").call(alias1, depth0 != null ? lookupProperty(depth0, "items") : depth0, {
5868
- "name": "each",
5869
- "hash": {},
5870
- "fn": container.program(9, data, 1, blockParams),
5871
- "inverse": container.noop,
5872
- "data": data,
5873
- "blockParams": blockParams,
5874
- "loc": {
5875
- "start": {
5876
- "line": 16,
5877
- "column": 14
5878
- },
5879
- "end": {
5880
- "line": 30,
5881
- "column": 25
5882
- }
5883
- }
5884
- })) != null ? stack1 : "") + "</div>";
5885
- },
5886
- "9": function(container, depth0, helpers, partials, data, blockParams) {
5887
- var stack1, alias1 = depth0 != null ? depth0 : container.nullContext || {}, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5888
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5889
- return undefined;
5890
- };
5891
- return ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(helpers, "isChordLyricsPair").call(alias1, blockParams[0][0], {
5892
- "name": "isChordLyricsPair",
5893
- "hash": {},
5894
- "data": data,
5895
- "blockParams": blockParams,
5896
- "loc": {
5897
- "start": {
5898
- "line": 17,
5899
- "column": 23
5900
- },
5901
- "end": {
5902
- "line": 17,
5903
- "column": 47
5904
- }
5905
- }
5906
- }), {
5907
- "name": "if",
5908
- "hash": {},
5909
- "fn": container.program(10, data, 0, blockParams),
5910
- "inverse": container.noop,
5911
- "data": data,
5912
- "blockParams": blockParams,
5913
- "loc": {
5914
- "start": {
5915
- "line": 17,
5916
- "column": 16
5917
- },
5918
- "end": {
5919
- "line": 19,
5920
- "column": 25
5921
- }
5922
- }
5923
- })) != null ? stack1 : "") + ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(helpers, "isTag").call(alias1, blockParams[0][0], {
5924
- "name": "isTag",
5925
- "hash": {},
5926
- "data": data,
5927
- "blockParams": blockParams,
5928
- "loc": {
5929
- "start": {
5930
- "line": 21,
5931
- "column": 23
5932
- },
5933
- "end": {
5934
- "line": 21,
5935
- "column": 35
5936
- }
5937
- }
5938
- }), {
5939
- "name": "if",
5940
- "hash": {},
5941
- "fn": container.program(12, data, 0, blockParams),
5942
- "inverse": container.noop,
5943
- "data": data,
5944
- "blockParams": blockParams,
5945
- "loc": {
5946
- "start": {
5947
- "line": 21,
5948
- "column": 16
5949
- },
5950
- "end": {
5951
- "line": 25,
5952
- "column": 25
5953
- }
5954
- }
5955
- })) != null ? stack1 : "") + ((stack1 = lookupProperty(helpers, "if").call(alias1, (lookupProperty(helpers, "isEvaluatable") || depth0 && lookupProperty(depth0, "isEvaluatable") || container.hooks.helperMissing).call(alias1, blockParams[0][0], {
5956
- "name": "isEvaluatable",
5957
- "hash": {},
5958
- "data": data,
5959
- "blockParams": blockParams,
5960
- "loc": {
5961
- "start": {
5962
- "line": 27,
5963
- "column": 23
5964
- },
5965
- "end": {
5966
- "line": 27,
5967
- "column": 43
5968
- }
5969
- }
5970
- }), {
5971
- "name": "if",
5972
- "hash": {},
5973
- "fn": container.program(15, data, 0, blockParams),
5974
- "inverse": container.noop,
5975
- "data": data,
5976
- "blockParams": blockParams,
5977
- "loc": {
5978
- "start": {
5979
- "line": 27,
5980
- "column": 16
5981
- },
5982
- "end": {
5983
- "line": 29,
5984
- "column": 25
5985
- }
5986
- }
5987
- })) != null ? stack1 : "");
5988
- },
5989
- "10": function(container, depth0, helpers, partials, data, blockParams) {
5990
- var stack1, helper, alias1 = depth0 != null ? depth0 : container.nullContext || {}, alias2 = container.hooks.helperMissing, alias3 = container.escapeExpression, lookupProperty = container.lookupProperty || function(parent, propertyName) {
5991
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
5992
- return undefined;
5993
- };
5994
- 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"), {
5995
- "name": "renderChord",
5996
- "hash": {},
5997
- "data": data,
5998
- "blockParams": blockParams,
5999
- "loc": {
6000
- "start": {
6001
- "line": 18,
6002
- "column": 57
6003
- },
6004
- "end": {
6005
- "line": 18,
6006
- "column": 117
6007
- }
6008
- }
6009
- })) + '</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, {
6010
- "name": "lyrics",
6011
- "hash": {},
6012
- "data": data,
6013
- "blockParams": blockParams,
6014
- "loc": {
6015
- "start": {
6016
- "line": 18,
6017
- "column": 143
6018
- },
6019
- "end": {
6020
- "line": 18,
6021
- "column": 153
6022
- }
6023
- }
6024
- }) : helper)) + "</div></div>";
6025
- },
6026
- "12": function(container, depth0, helpers, partials, data, blockParams) {
6027
- var stack1, alias1 = depth0 != null ? depth0 : container.nullContext || {}, lookupProperty = container.lookupProperty || function(parent, propertyName) {
6028
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
6029
- return undefined;
6030
- };
6031
- return (stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(helpers, "isComment").call(alias1, blockParams[1][0], {
6032
- "name": "isComment",
6033
- "hash": {},
6034
- "data": data,
6035
- "blockParams": blockParams,
6036
- "loc": {
6037
- "start": {
6038
- "line": 22,
6039
- "column": 25
6040
- },
6041
- "end": {
6042
- "line": 22,
6043
- "column": 41
6044
- }
6045
- }
6046
- }), {
6047
- "name": "if",
6048
- "hash": {},
6049
- "fn": container.program(13, data, 0, blockParams),
6050
- "inverse": container.noop,
6051
- "data": data,
6052
- "blockParams": blockParams,
6053
- "loc": {
6054
- "start": {
6055
- "line": 22,
6056
- "column": 18
6057
- },
6058
- "end": {
6059
- "line": 24,
6060
- "column": 27
6061
- }
6062
- }
6063
- })) != null ? stack1 : "";
6064
- },
6065
- "13": function(container, depth0, helpers, partials, data) {
6066
- var helper, lookupProperty = container.lookupProperty || function(parent, propertyName) {
6067
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
6068
- return undefined;
6069
- };
6070
- 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 || {}, {
6071
- "name": "value",
6072
- "hash": {},
6073
- "data": data,
6074
- "loc": {
6075
- "start": {
6076
- "line": 23,
6077
- "column": 41
6078
- },
6079
- "end": {
6080
- "line": 23,
6081
- "column": 50
6082
- }
6083
- }
6084
- }) : helper)) + "</div>";
6085
- },
6086
- "15": function(container, depth0, helpers, partials, data, blockParams) {
6087
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
6088
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
6089
- return undefined;
6090
- };
6091
- 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"), {
6092
- "name": "evaluate",
6093
- "hash": {},
6094
- "data": data,
6095
- "blockParams": blockParams,
6096
- "loc": {
6097
- "start": {
6098
- "line": 28,
6099
- "column": 83
6100
- },
6101
- "end": {
6102
- "line": 28,
6103
- "column": 140
6104
- }
6105
- }
6106
- })) + "</div></div>";
6107
- },
6108
- "compiler": [
6109
- 8,
6110
- ">= 4.3.0"
6111
- ],
6112
- "main": function(container, depth0, helpers, partials, data, blockParams) {
6113
- var stack1, lookupProperty = container.lookupProperty || function(parent, propertyName) {
6114
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return parent[propertyName];
6115
- return undefined;
6116
- };
6117
- return (stack1 = lookupProperty(helpers, "with").call(depth0 != null ? depth0 : container.nullContext || {}, depth0 != null ? lookupProperty(depth0, "song") : depth0, {
6118
- "name": "with",
6119
- "hash": {},
6120
- "fn": container.program(1, data, 0, blockParams),
6121
- "inverse": container.noop,
6122
- "data": data,
6123
- "blockParams": blockParams,
6124
- "loc": {
6125
- "start": {
6126
- "line": 1,
6127
- "column": 0
6128
- },
6129
- "end": {
6130
- "line": 37,
6131
- "column": 11
6132
- }
6133
- }
6134
- })) != null ? stack1 : "";
6135
- },
6136
- "useData": true,
6137
- "useBlockParams": true
6138
- });
6139
-
6140
5081
 
5082
+ var $93f055b77b2d269f$export$2e2bcd8739ae039 = ({ configuration: configuration , song: song , renderBlankLines: renderBlankLines = false , song: { title: title , subtitle: subtitle , bodyParagraphs: bodyParagraphs , metadata: metadata , } , })=>(0, $376e205ced98486b$export$6ea1b0eb82ead3f)(`
5083
+ ${(0, $376e205ced98486b$export$a55877ca9db47377)(title, ()=>`<h1>${title}</h1>`)}
5084
+ ${(0, $376e205ced98486b$export$a55877ca9db47377)(subtitle, ()=>`<h2>${subtitle}</h2>`)}
5085
+
5086
+ <div class="chord-sheet">
5087
+ ${(0, $376e205ced98486b$export$79b2f7037acddd43)(bodyParagraphs, (paragraph)=>`
5088
+ <div class="${(0, $376e205ced98486b$export$dcd1550c9709312c)(paragraph)}">
5089
+ ${(0, $376e205ced98486b$export$79b2f7037acddd43)(paragraph.lines, (line)=>`
5090
+ ${(0, $376e205ced98486b$export$a55877ca9db47377)(renderBlankLines || (0, $376e205ced98486b$export$3db5961874282581)(line), ()=>`
5091
+ <div class="${(0, $376e205ced98486b$export$8a559c16cc3576)(line)}">
5092
+ ${(0, $376e205ced98486b$export$79b2f7037acddd43)(line.items, (item)=>`
5093
+ ${(0, $376e205ced98486b$export$a55877ca9db47377)((0, $376e205ced98486b$export$17c9e635b932873b)(item), ()=>`
5094
+ <div class="column">
5095
+ <div class="chord">${(0, $dfecd32049fa58e9$export$596ec52955da9472)(item.chords, line.key, line.transposeKey, song)}</div>
5096
+ <div class="lyrics">${item.lyrics}</div>
5097
+ </div>
5098
+ `)}
5099
+
5100
+ ${(0, $376e205ced98486b$export$a55877ca9db47377)((0, $376e205ced98486b$export$3bf645f08efe3292)(item) && (0, $376e205ced98486b$export$3ab01370f5e64ac8)(item), ()=>`<div class="comment">${item.value}</div>`)}
5101
+
5102
+ ${(0, $376e205ced98486b$export$a55877ca9db47377)((0, $21a34a464e7bc609$export$e3f63561d52b936d)(item), ()=>`
5103
+ <div class="column">
5104
+ <div class="chord"></div>
5105
+ <div class="lyrics">${(0, $376e205ced98486b$export$fef61f332f2c0afc)(item, metadata, configuration)}</div>
5106
+ </div>
5107
+ `)}
5108
+ `)}
5109
+ </div>
5110
+ `)}
5111
+ `)}
5112
+ </div>
5113
+ `)}
5114
+ </div>
5115
+ `);
6141
5116
 
6142
5117
 
6143
5118
 
6144
- const { html_div_formatter: $ee0c149cc33dc156$var$template } = (0, ($parcel$interopDefault($988mA$handlebars))).templates;
6145
5119
  const $ee0c149cc33dc156$var$defaultCss = {
6146
5120
  ".chord:not(:last-child)": {
6147
5121
  paddingRight: "10px"
@@ -6167,7 +5141,7 @@ const $ee0c149cc33dc156$var$defaultCss = {
6167
5141
  * @param {Song} song The song to be formatted
6168
5142
  * @returns {string} The HTML string
6169
5143
  */ format(song) {
6170
- return this.formatWithTemplate(song, $ee0c149cc33dc156$var$template);
5144
+ return this.formatWithTemplate(song, (0, $93f055b77b2d269f$export$2e2bcd8739ae039));
6171
5145
  }
6172
5146
  /**
6173
5147
  * Generates basic CSS, optionally scoped within the provided selector, to use with output generated by