orbitchat 3.1.0 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +82 -215
  2. package/bin/orbitchat.js +292 -655
  3. package/dist/assets/{ChartRenderer-BEwTOgnq.js → ChartRenderer-C6fHQxUM.js} +1 -1
  4. package/dist/assets/{MermaidRenderer-Cwj5RQ3g.js → MermaidRenderer-uOsrV112.js} +5 -5
  5. package/dist/assets/{MusicRenderer-jiCOczly.js → MusicRenderer-C-8fXPzl.js} +2 -2
  6. package/dist/assets/{SVGRenderer-B7MdKpL3.js → SVGRenderer-7yLFncSt.js} +1 -1
  7. package/dist/assets/{_basePickBy-CYc6FJVo.js → _basePickBy-BaAS07_g.js} +1 -1
  8. package/dist/assets/{_baseUniq-Db9U29CG.js → _baseUniq-C0rd4rnF.js} +1 -1
  9. package/dist/assets/{architectureDiagram-VXUJARFQ-ByDEpAtB.js → architectureDiagram-VXUJARFQ-DB0b91Sa.js} +1 -1
  10. package/dist/assets/{blockDiagram-VD42YOAC-DeU2cMg9.js → blockDiagram-VD42YOAC-BQ4Z_gCK.js} +1 -1
  11. package/dist/assets/{c4Diagram-YG6GDRKO-C9ykT6JL.js → c4Diagram-YG6GDRKO-Dtix_O1L.js} +1 -1
  12. package/dist/assets/channel-CuLY6R17.js +1 -0
  13. package/dist/assets/{chunk-4BX2VUAB-DSGrQP0T.js → chunk-4BX2VUAB-BMK9KFRb.js} +1 -1
  14. package/dist/assets/{chunk-55IACEB6-BqJf9Ja5.js → chunk-55IACEB6-DireVK0h.js} +1 -1
  15. package/dist/assets/{chunk-B4BG7PRW-CjLmShZ1.js → chunk-B4BG7PRW-BRwwDrXp.js} +1 -1
  16. package/dist/assets/{chunk-DI55MBZ5-DpYiJhBX.js → chunk-DI55MBZ5-DeD4e72t.js} +1 -1
  17. package/dist/assets/{chunk-FMBD7UC4-B_-ci5rY.js → chunk-FMBD7UC4-D1-BcrE_.js} +1 -1
  18. package/dist/assets/{chunk-QN33PNHL-PupYKHzM.js → chunk-QN33PNHL-5dHN5THo.js} +1 -1
  19. package/dist/assets/{chunk-QZHKN3VN-Ddt7KdjH.js → chunk-QZHKN3VN-BFj7kkUd.js} +1 -1
  20. package/dist/assets/{chunk-TZMSLE5B-DFxHvBUh.js → chunk-TZMSLE5B-B5JCOX6Y.js} +1 -1
  21. package/dist/assets/classDiagram-2ON5EDUG-CCd0SByT.js +1 -0
  22. package/dist/assets/classDiagram-v2-WZHVMYZB-CCd0SByT.js +1 -0
  23. package/dist/assets/clone-DRrrmN93.js +1 -0
  24. package/dist/assets/{cose-bilkent-S5V4N54A-CoAwh2dl.js → cose-bilkent-S5V4N54A-CmgTSX_t.js} +1 -1
  25. package/dist/assets/{dagre-6UL2VRFP-wqnQLI1r.js → dagre-6UL2VRFP-C3rzyEFR.js} +1 -1
  26. package/dist/assets/{diagram-PSM6KHXK-BThDYp3k.js → diagram-PSM6KHXK-CyHeoxQN.js} +1 -1
  27. package/dist/assets/{diagram-QEK2KX5R-QO0jbKYo.js → diagram-QEK2KX5R-2gCRyxH5.js} +1 -1
  28. package/dist/assets/{diagram-S2PKOQOG-DqXZQ_2w.js → diagram-S2PKOQOG-BV4hBni4.js} +1 -1
  29. package/dist/assets/{erDiagram-Q2GNP2WA-BbHMUMHv.js → erDiagram-Q2GNP2WA-DLJ0STwx.js} +1 -1
  30. package/dist/assets/{flowDiagram-NV44I4VS-BcZTJeWn.js → flowDiagram-NV44I4VS-DaJev1Dk.js} +1 -1
  31. package/dist/assets/{ganttDiagram-JELNMOA3-n27iVieA.js → ganttDiagram-JELNMOA3-BVqSlqWd.js} +1 -1
  32. package/dist/assets/{gitGraphDiagram-V2S2FVAM-DaO03D0c.js → gitGraphDiagram-V2S2FVAM-fILg4kGK.js} +1 -1
  33. package/dist/assets/{graph-CqgsEnyP.js → graph-CMQ9In6q.js} +1 -1
  34. package/dist/assets/{index-pVqH5W3l.js → index-Bp6Dtnjv.js} +37 -37
  35. package/dist/assets/{index-BLVU3y3C.js → index-CeOmPokb.js} +116 -116
  36. package/dist/assets/{index-DEMLXEhu.css → index-w5RjGGjS.css} +1 -1
  37. package/dist/assets/{infoDiagram-HS3SLOUP-DA9UPsCv.js → infoDiagram-HS3SLOUP-D7dyBxUc.js} +1 -1
  38. package/dist/assets/{journeyDiagram-XKPGCS4Q-DOnOrs8o.js → journeyDiagram-XKPGCS4Q-B5mS1ZV0.js} +1 -1
  39. package/dist/assets/{kanban-definition-3W4ZIXB7-CeCakzDJ.js → kanban-definition-3W4ZIXB7-BiWSAAjN.js} +1 -1
  40. package/dist/assets/{layout-D9Y_lOuO.js → layout-BME0mjSq.js} +1 -1
  41. package/dist/assets/{mindmap-definition-VGOIOE7T-DBP7KZgR.js → mindmap-definition-VGOIOE7T-CoH0z1ra.js} +1 -1
  42. package/dist/assets/{pieDiagram-ADFJNKIX-DSpFXjVs.js → pieDiagram-ADFJNKIX-Dq0SKRlZ.js} +1 -1
  43. package/dist/assets/{quadrantDiagram-AYHSOK5B-1w3noe3A.js → quadrantDiagram-AYHSOK5B-DwutakEK.js} +1 -1
  44. package/dist/assets/{requirementDiagram-UZGBJVZJ-B9YzwP8J.js → requirementDiagram-UZGBJVZJ-BzFetBkD.js} +1 -1
  45. package/dist/assets/{sankeyDiagram-TZEHDZUN-FLiuEFVI.js → sankeyDiagram-TZEHDZUN-BbOUy78i.js} +1 -1
  46. package/dist/assets/{sequenceDiagram-WL72ISMW-BSJt3OHN.js → sequenceDiagram-WL72ISMW-1ZNpnZKs.js} +1 -1
  47. package/dist/assets/{stateDiagram-FKZM4ZOC-Ch3MODOU.js → stateDiagram-FKZM4ZOC-BAP0pbLV.js} +1 -1
  48. package/dist/assets/stateDiagram-v2-4FDKWEC3-HGuFIOmd.js +1 -0
  49. package/dist/assets/{timeline-definition-IT6M3QCI-C_qTQlCc.js → timeline-definition-IT6M3QCI-CuyYlb9E.js} +1 -1
  50. package/dist/assets/{treemap-GDKQZRPO-yzuGqs4o.js → treemap-GDKQZRPO-CUELWxdP.js} +1 -1
  51. package/dist/assets/{xychartDiagram-PRI3JC2R-G6i_3Vla.js → xychartDiagram-PRI3JC2R-CaZOodKt.js} +1 -1
  52. package/dist/index.html +2 -2
  53. package/orbitchat.sh +118 -37
  54. package/package.json +1 -1
  55. package/dist/assets/channel-C4M311uf.js +0 -1
  56. package/dist/assets/classDiagram-2ON5EDUG-Brx1b2Nn.js +0 -1
  57. package/dist/assets/classDiagram-v2-WZHVMYZB-Brx1b2Nn.js +0 -1
  58. package/dist/assets/clone-C6___fhg.js +0 -1
  59. package/dist/assets/stateDiagram-v2-4FDKWEC3-CT2uJHYZ.js +0 -1
  60. package/dist/logo.png +0 -0
@@ -1,43 +1,43 @@
1
- import{g as ss}from"./index-BLVU3y3C.js";function os(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const n in a)if(n!=="default"&&!(n in e)){const i=Object.getOwnPropertyDescriptor(a,n);i&&Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>a[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var cs="6.6.1",ls=cs,hs=function(e,t){var r=this;if(t||(t={}),r.qpm=t.qpm?parseInt(t.qpm,10):null,!r.qpm){var a=e.metaText?e.metaText.tempo:null;r.qpm=e.getBpm(a)}r.extraMeasuresAtBeginning=t.extraMeasuresAtBeginning?parseInt(t.extraMeasuresAtBeginning,10):0,r.beatCallback=t.beatCallback,r.eventCallback=t.eventCallback,r.lineEndCallback=t.lineEndCallback,r.lineEndAnticipation=t.lineEndAnticipation?parseInt(t.lineEndAnticipation,10):0,r.beatSubdivisions=t.beatSubdivisions?parseInt(t.beatSubdivisions,10):1,r.beatSubdivisions||(r.beatSubdivisions=1),r.joggerTimer=null,r.replaceTarget=function(i){if(r.noteTimings=i.setTiming(r.qpm,r.extraMeasuresAtBeginning),i.noteTimings.length===0&&(r.noteTimings=i.setTiming(0,0)),r.lineEndCallback&&(r.lineEndTimings=fs(i.noteTimings,r.lineEndAnticipation)),r.startTime=null,r.currentBeat=0,r.currentEvent=0,r.currentLine=0,r.currentTime=0,r.isPaused=!1,r.isRunning=!1,r.pausedPercent=null,r.justUnpaused=!1,r.newSeekPercent=0,r.lastTimestamp=0,r.noteTimings.length!==0){r.millisecondsPerBeat=1e3/(r.qpm/60)/r.beatSubdivisions,r.lastMoment=r.noteTimings[r.noteTimings.length-1].milliseconds;var s=i.getMeter(),o="";if(s&&s.type==="specified"&&s.value&&s.value.length>0&&s.value[0].num.indexOf("+")>0&&(o=s.value[0].num),r.beatStarts=[],o){for(var c=r.noteTimings[r.noteTimings.length-1].millisecondsPerMeasure,f=r.lastMoment/c,u=o.split("+"),l=0;l<u.length;l++)u[l]=parseInt(u[l],10)/2;for(var h=0,d=0,p=0;p<f;p++)for(var g=p*c,v=0,m=0;m<u.length;m++){var y=u[m];if(r.beatSubdivisions===1)r.beatSubdivisions===1&&h<r.lastMoment&&r.beatStarts.push({b:d,ts:h}),h+=y*r.millisecondsPerBeat;else for(var x=y*r.beatSubdivisions,b=0;b<Math.floor(x);b++){var w=b/x,C=Math.round(g+v*r.millisecondsPerBeat);C<r.lastMoment&&r.beatStarts.push({b:d+w,ts:C}),v++}d++}r.beatStarts.push({b:f*u.length,ts:r.lastMoment}),r.totalBeats=r.beatStarts.length}else{r.totalBeats=Math.round(r.lastMoment/r.millisecondsPerBeat);for(var T=0;T<r.totalBeats+1;T++)r.beatStarts.push({b:T/r.beatSubdivisions,ts:Math.round(T*r.millisecondsPerBeat)})}}},r.replaceTarget(e),r.doTiming=function(i){if(r.lastTimestamp!==i&&(r.lastTimestamp=i,!r.isPaused&&r.isRunning)){for(r.startTime||(r.startTime=i),r.currentTime=i-r.startTime,r.currentTime+=16;r.noteTimings.length>r.currentEvent&&r.noteTimings[r.currentEvent].milliseconds<r.currentTime;){if(r.eventCallback&&r.noteTimings[r.currentEvent].type==="event"){var s=r.startTime;r.eventCallback(r.noteTimings[r.currentEvent]),s!==r.startTime&&(r.currentTime=i-r.startTime)}r.currentEvent++}if(r.lineEndCallback&&r.lineEndTimings.length>r.currentLine&&r.lineEndTimings[r.currentLine].milliseconds<r.currentTime&&r.currentEvent<r.noteTimings.length){var o=r.noteTimings[r.currentEvent].milliseconds===r.currentTime?r.noteTimings[r.currentEvent]:r.noteTimings[r.currentEvent-1];r.lineEndCallback(r.lineEndTimings[r.currentLine],o,{line:r.currentLine,endTimings:r.lineEndTimings,currentTime:r.currentTime}),r.currentLine++}if(r.currentTime<r.lastMoment){if(requestAnimationFrame(r.doTiming),r.currentBeat<r.beatStarts.length&&r.beatStarts[r.currentBeat].ts<=r.currentTime){var c=r.doBeatCallback(i);r.currentBeat++,c!==null&&(r.currentTime=c)}}else if(r.currentBeat<=r.totalBeats&&r.beatCallback){var f=r.doBeatCallback(i);r.currentBeat++,f!==null&&(r.currentTime=f),requestAnimationFrame(r.doTiming)}if(r.currentTime>=r.lastMoment)if(r.eventCallback){var u=r.eventCallback(null);r.shouldStop(u).then(function(l){l&&r.stop()})}else r.stop()}},r.shouldStop=function(i){return new Promise(function(s){if(!i)return s(!0);if(i==="continue")return s(!1);i.then&&i.then(function(o){s(o!=="continue")})})},r.doBeatCallback=function(i){if(r.beatCallback){for(var s=r.currentEvent;s<r.noteTimings.length&&r.noteTimings[s].left===null;)s++;var o,c;if(s<r.noteTimings.length){for(o=r.noteTimings[s].milliseconds,s=Math.max(0,r.currentEvent-1);s>=0&&r.noteTimings[s].left===null;)s--;c=r.noteTimings[s]}var f={},u={};if(c){f.top=c.top,f.height=c.height;var l=Math.max(0,i-r.startTime-c.milliseconds),h=o-c.milliseconds,d=c.endX-c.left,p=h?l*d/h:0;f.left=c.left+p,r.currentEvent===0&&c.milliseconds>i-r.startTime&&(f.left=void 0),u={timestamp:i,startTime:r.startTime,ev:c,endMs:o,offMs:l,offPx:p,gapMs:h,gapPx:d}}else u={timestamp:i,startTime:r.startTime};var g=r.startTime;if(r.beatCallback(r.beatStarts[r.currentBeat].b,r.totalBeats/r.beatSubdivisions,r.lastMoment,f,u),g!==r.startTime)return i-r.startTime}return null};var n=60;r.animationJogger=function(){r.isRunning&&(r.doTiming(performance.now()),r.joggerTimer=setTimeout(r.animationJogger,n))},r.start=function(i,s){if(r.isRunning=!0,r.isPaused&&(r.isPaused=!1,i===void 0&&(r.justUnpaused=!0)),i)r.setProgress(i,s);else if(i===0)r.reset();else if(r.pausedPercent!==null){var o=performance.now();r.currentTime=r.lastMoment*r.pausedPercent,r.startTime=o-r.currentTime,r.pausedPercent=null,r.reportNext=!0}requestAnimationFrame(r.doTiming),r.joggerTimer=setTimeout(r.animationJogger,n)},r.pause=function(){r.isPaused=!0;var i=performance.now();r.pausedPercent=(i-r.startTime)/r.lastMoment,r.isRunning=!1,r.joggerTimer&&(clearTimeout(r.joggerTimer),r.joggerTimer=null)},r.currentMillisecond=function(){return r.currentTime},r.reset=function(){r.currentBeat=0,r.currentEvent=0,r.currentLine=0,r.startTime=null,r.pausedPercent=null},r.stop=function(){r.pause(),r.reset()},r.setProgress=function(i,s){var o;switch(s){case"seconds":r.currentTime=i*1e3,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),o=r.currentTime/r.lastMoment;break;case"beats":r.currentTime=i*r.millisecondsPerBeat*r.beatSubdivisions,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),o=r.currentTime/r.lastMoment;break;default:o=i,o<0&&(o=0),o>1&&(o=1),r.currentTime=r.lastMoment*o;break}r.isRunning||(r.pausedPercent=o);var c=performance.now();for(r.startTime=c-r.currentTime,r.currentEvent=0;r.noteTimings.length>r.currentEvent&&r.noteTimings[r.currentEvent].milliseconds<r.currentTime;)r.currentEvent++;if(r.lineEndCallback)for(r.currentLine=0;r.lineEndTimings.length>r.currentLine&&r.lineEndTimings[r.currentLine].milliseconds+r.lineEndAnticipation<r.currentTime;)r.currentLine++;var f=r.currentBeat;for(r.currentBeat=0;r.currentBeat<r.beatStarts.length&&!(r.beatStarts[r.currentBeat].ts>r.currentTime);r.currentBeat++);r.currentBeat--,r.beatCallback&&f!==r.currentBeat&&(r.doBeatCallback(r.startTime+r.currentTime),r.currentBeat++),r.eventCallback&&r.currentEvent>=0&&r.noteTimings[r.currentEvent].type==="event"&&r.eventCallback(r.noteTimings[r.currentEvent]),r.lineEndCallback&&r.lineEndCallback(r.lineEndTimings[r.currentLine],r.noteTimings[r.currentEvent],{line:r.currentLine,endTimings:r.lineEndTimings}),r.joggerTimer=setTimeout(r.animationJogger,n)}};function fs(e,t){for(var r=[],a=null,n=0;n<e.length;n++){var i=e[n];i.type!=="end"&&i.top!==a&&(r.push({measureNumber:i.measureNumber,milliseconds:i.milliseconds-t,top:i.top,bottom:i.top+i.height}),a=i.top)}return r}var $r=hs,us=$r,X0={};(function(){var e,t;X0.startAnimation=function(r,a,n){e&&(e.stop(),e=void 0),n.showCursor&&(t=r.querySelector(".abcjs-cursor"),t||(t=document.createElement("DIV"),t.className="abcjs-cursor cursor",t.style.position="absolute",r.appendChild(t),r.style.position="relative"));function i(h){for(var d=0;d<h.length;d++){var p=h[d];p.classList.contains("abcjs-bar")||(p.style.display="none")}}var s;function o(h){if(s){var d=r.querySelectorAll(s);i(d)}s=h}function c(h){var d=r.querySelectorAll(h);i(d)}function f(h){n.hideCurrentMeasure?c(h):n.hideFinishedMeasures&&o(h)}function u(h){return".abcjs-l"+h.line+".abcjs-m"+h.measureNumber}function l(h){if(h){if(h.measureStart){var d=u(h);d&&f(d)}t&&(t.style.left=h.left+"px",t.style.top=h.top+"px",t.style.width=h.width+"px",t.style.height=h.height+"px")}else e.stop(),e=void 0}e=new us(a,{qpm:n.bpm,eventCallback:l}),e.start()},X0.pauseAnimation=function(r){e&&(r?e.pause():e.start())},X0.stopAnimation=function(){e&&(e.stop(),e=void 0)}})();var ds=X0,lt={};lt.cloneArray=function(e){for(var t=[],r=0;r<e.length;r++)t.push(Object.assign({},e[r]));return t};lt.cloneHashOfHash=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=Object.assign({},e[r]));return t};lt.cloneHashOfArrayOfHash=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=lt.cloneArray(e[r]));return t};lt.strip=function(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")};lt.startsWith=function(e,t){return e.indexOf(t)===0};lt.endsWith=function(e,t){var r=e.length-t.length;return r>=0&&e.lastIndexOf(t)===r};lt.last=function(e){return e.length===0?null:e[e.length-1]};var rt=lt,da=rt,At={};(function(){var e,t,r,a,n;At.initialize=function(k,_,L,A,G){e=k,t=_,r=L,a=A,n=G,i()};function i(){r.annotationfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},r.gchordfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},r.historyfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},r.infofont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},r.measurefont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},r.partsfont={face:'"Times New Roman"',size:15,weight:"normal",style:"normal",decoration:"none"},r.repeatfont={face:'"Times New Roman"',size:13,weight:"normal",style:"normal",decoration:"none"},r.textfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},r.tripletfont={face:"Times",size:11,weight:"normal",style:"italic",decoration:"none"},r.vocalfont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},r.wordsfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},a.formatting.composerfont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},a.formatting.subtitlefont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},a.formatting.tempofont={face:'"Times New Roman"',size:15,weight:"bold",style:"normal",decoration:"none"},a.formatting.titlefont={face:'"Times New Roman"',size:20,weight:"normal",style:"normal",decoration:"none"},a.formatting.footerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},a.formatting.headerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},a.formatting.voicefont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},a.formatting.tablabelfont={face:'"Trebuchet MS"',size:16,weight:"normal",style:"normal",decoration:"none"},a.formatting.tabnumberfont={face:'"Arial"',size:11,weight:"normal",style:"normal",decoration:"none"},a.formatting.tabgracefont={face:'"Arial"',size:8,weight:"normal",style:"normal",decoration:"none"},a.formatting.annotationfont=r.annotationfont,a.formatting.gchordfont=r.gchordfont,a.formatting.historyfont=r.historyfont,a.formatting.infofont=r.infofont,a.formatting.measurefont=r.measurefont,a.formatting.partsfont=r.partsfont,a.formatting.repeatfont=r.repeatfont,a.formatting.textfont=r.textfont,a.formatting.tripletfont=r.tripletfont,a.formatting.vocalfont=r.vocalfont,a.formatting.wordsfont=r.wordsfont}var s={gchordfont:!0,measurefont:!0,partsfont:!0,annotationfont:!0,composerfont:!0,historyfont:!0,infofont:!0,subtitlefont:!0,textfont:!0,titlefont:!0,voicefont:!0},o=function(k){switch(k){case"Arial-Italic":return{face:"Arial",weight:"normal",style:"italic",decoration:"none"};case"Arial-Bold":return{face:"Arial",weight:"bold",style:"normal",decoration:"none"};case"Bookman-Demi":return{face:"Bookman,serif",weight:"bold",style:"normal",decoration:"none"};case"Bookman-DemiItalic":return{face:"Bookman,serif",weight:"bold",style:"italic",decoration:"none"};case"Bookman-Light":return{face:"Bookman,serif",weight:"normal",style:"normal",decoration:"none"};case"Bookman-LightItalic":return{face:"Bookman,serif",weight:"normal",style:"italic",decoration:"none"};case"Courier":return{face:'"Courier New"',weight:"normal",style:"normal",decoration:"none"};case"Courier-Oblique":return{face:'"Courier New"',weight:"normal",style:"italic",decoration:"none"};case"Courier-Bold":return{face:'"Courier New"',weight:"bold",style:"normal",decoration:"none"};case"Courier-BoldOblique":return{face:'"Courier New"',weight:"bold",style:"italic",decoration:"none"};case"AvantGarde-Book":return{face:"AvantGarde,Arial",weight:"normal",style:"normal",decoration:"none"};case"AvantGarde-BookOblique":return{face:"AvantGarde,Arial",weight:"normal",style:"italic",decoration:"none"};case"AvantGarde-Demi":case"Avant-Garde-Demi":return{face:"AvantGarde,Arial",weight:"bold",style:"normal",decoration:"none"};case"AvantGarde-DemiOblique":return{face:"AvantGarde,Arial",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Oblique":return{face:"Helvetica",weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Bold":return{face:"Helvetica",weight:"bold",style:"normal",decoration:"none"};case"Helvetica-BoldOblique":return{face:"Helvetica",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Narrow":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"normal",decoration:"none"};case"Helvetica-Narrow-Oblique":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Narrow-Bold":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"normal",decoration:"none"};case"Helvetica-Narrow-BoldOblique":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"italic",decoration:"none"};case"Palatino-Roman":return{face:"Palatino",weight:"normal",style:"normal",decoration:"none"};case"Palatino-Italic":return{face:"Palatino",weight:"normal",style:"italic",decoration:"none"};case"Palatino-Bold":return{face:"Palatino",weight:"bold",style:"normal",decoration:"none"};case"Palatino-BoldItalic":return{face:"Palatino",weight:"bold",style:"italic",decoration:"none"};case"NewCenturySchlbk-Roman":return{face:'"New Century",serif',weight:"normal",style:"normal",decoration:"none"};case"NewCenturySchlbk-Italic":return{face:'"New Century",serif',weight:"normal",style:"italic",decoration:"none"};case"NewCenturySchlbk-Bold":return{face:'"New Century",serif',weight:"bold",style:"normal",decoration:"none"};case"NewCenturySchlbk-BoldItalic":return{face:'"New Century",serif',weight:"bold",style:"italic",decoration:"none"};case"Times":case"Times-Roman":case"Times-Narrow":case"Times-Courier":case"Times-New-Roman":return{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none"};case"Times-Italic":case"Times-Italics":return{face:'"Times New Roman"',weight:"normal",style:"italic",decoration:"none"};case"Times-Bold":return{face:'"Times New Roman"',weight:"bold",style:"normal",decoration:"none"};case"Times-BoldItalic":return{face:'"Times New Roman"',weight:"bold",style:"italic",decoration:"none"};case"ZapfChancery-MediumItalic":return{face:'"Zapf Chancery",cursive,serif',weight:"normal",style:"normal",decoration:"none"};default:return null}},c=function(k,_,L,A,G){function V(){var Ae=parseInt(k[0].token);return k.shift(),_?k.length===0?{face:_.face,weight:_.weight,style:_.style,decoration:_.decoration,size:Ae}:k.length===1&&k[0].token==="box"&&s[G]?{face:_.face,weight:_.weight,style:_.style,decoration:_.decoration,size:Ae,box:!0}:(t("Extra parameters in font definition.",L,A),{face:_.face,weight:_.weight,style:_.style,decoration:_.decoration,size:Ae}):(t("Can't set just the size of the font since there is no default value.",L,A),{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none",size:Ae})}if(k[0].token==="*"){if(k.shift(),k[0].type==="number")return V();t("Expected font size number after *.",L,A)}if(k[0].type==="number")return V();for(var Q=[],le,Qe="normal",Ye="normal",Me="none",me=!1,q="face",Ie=!1;k.length;){var te=k.shift(),Z=te.token.toLowerCase();switch(q){case"face":Ie||Z!=="utf"&&te.type!=="number"&&Z!=="bold"&&Z!=="italic"&&Z!=="underline"&&Z!=="box"?Q.length>0&&te.token==="-"?(Ie=!0,Q[Q.length-1]=Q[Q.length-1]+te.token):Ie?(Ie=!1,Q[Q.length-1]=Q[Q.length-1]+te.token):Q.push(te.token):te.type==="number"?(le?t("Font size specified twice in font definition.",L,A):le=te.token,q="modifier"):Z==="bold"?Qe="bold":Z==="italic"?Ye="italic":Z==="underline"?Me="underline":Z==="box"?(s[G]?me=!0:t(`This font style doesn't support "box"`,L,A),q="finished"):Z==="utf"?(te=k.shift(),q="size"):t("Unknown parameter "+te.token+" in font definition.",L,A);break;case"size":te.type==="number"?le?t("Font size specified twice in font definition.",L,A):le=te.token:t("Expected font size in font definition.",L,A),q="modifier";break;case"modifier":Z==="bold"?Qe="bold":Z==="italic"?Ye="italic":Z==="underline"?Me="underline":Z==="box"?(s[G]?me=!0:t(`This font style doesn't support "box"`,L,A),q="finished"):t("Unknown parameter "+te.token+" in font definition.",L,A);break;case"finished":t('Extra characters found after "box" in font definition.',L,A);break}}le===void 0?_?le=_.size:(t("Must specify the size of the font since there is no default value.",L,A),le=12):le=parseFloat(le),Q=Q.join(" "),Q===""&&(_?Q=_.face:(t("Must specify the name of the font since there is no default value.",L,A),Q="sans-serif"));var ge=o(Q),oe={};return ge?(oe.face=ge.face,oe.weight=ge.weight,oe.style=ge.style,oe.decoration=ge.decoration,oe.size=le,me&&(oe.box=!0),oe):(oe.face=Q,oe.weight=Qe,oe.style=Ye,oe.decoration=Me,oe.size=le,me&&(oe.box=!0),oe)},f=function(k,_,L){return _.length===0?'Directive "'+k+'" requires a font as a parameter.':(r[k]=c(_,r[k],L,0,k),r.is_in_header&&(a.formatting[k]=r[k]),null)},u=function(k,_,L){return _.length===0?'Directive "'+k+'" requires a font as a parameter.':(a.formatting[k]=c(_,a.formatting[k],L,0,k),null)},l=function(k,_){var L="";_.forEach(function(G){L+=G.token});var A=parseFloat(L);if(isNaN(A)||A===0)return'Directive "'+k+'" requires a number as a parameter.';a.formatting.scale=A},h=["acoustic-bass-drum","bass-drum-1","side-stick","acoustic-snare","hand-clap","electric-snare","low-floor-tom","closed-hi-hat","high-floor-tom","pedal-hi-hat","low-tom","open-hi-hat","low-mid-tom","hi-mid-tom","crash-cymbal-1","high-tom","ride-cymbal-1","chinese-cymbal","ride-bell","tambourine","splash-cymbal","cowbell","crash-cymbal-2","vibraslap","ride-cymbal-2","hi-bongo","low-bongo","mute-hi-conga","open-hi-conga","low-conga","high-timbale","low-timbale","high-agogo","low-agogo","cabasa","maracas","short-whistle","long-whistle","short-guiro","long-guiro","claves","hi-wood-block","low-wood-block","mute-cuica","open-cuica","mute-triangle","open-triangle"],d=function(k){var _=k.split(/\s+/);if(_.length!==2&&_.length!==3)return{error:'Expected parameters "abc-note", "drum-sound", and optionally "note-head"'};var L=_[0],A=parseInt(_[1],10);if((isNaN(A)||A<35||A>81)&&_[1]&&(A=h.indexOf(_[1].toLowerCase())+35),isNaN(A)||A<35||A>81)return{error:'Expected drum name, received "'+_[1]+'"'};var G={sound:A};return _.length===3&&(G.noteHead=_[2]),{key:L,value:G}},p=function(k,_){var L=e.getMeasurement(_);return L.used===0||_.length!==0?{error:'Directive "'+k+'" requires a measurement as a parameter.'}:L.value},g=function(k,_){var L=e.getMeasurement(_);return L.used===0||_.length!==0?'Directive "'+k+'" requires a measurement as a parameter.':(a.formatting[k]=L.value,null)},v=function(k,_,L,A,G){if(L.length!==1||L[0].type!=="number")return'Directive "'+_+'" requires a number as a parameter.';var V=L[0].intt;return A!==void 0&&V<A?'Directive "'+_+'" requires a number greater than or equal to '+A+" as a parameter.":G!==void 0&&V>G?'Directive "'+_+'" requires a number less than or equal to '+G+" as a parameter.":(r[k]=V,null)},m=function(k,_,L){if(L.length===1&&(L[0].token==="true"||L[0].token==="false"))return r[k]=L[0].token==="true",null;var A=v(k,_,L,0,1);return A!==null?A:(r[k]=r[k]===1,null)},y=function(k,_,L,A){if(L.length!==1)return'Directive "'+_+'" requires one of [ '+A.join(", ")+" ] as a parameter.";for(var G=L[0].token,V=!1,Q=0;!V&&Q<A.length;Q++)A[Q]===G&&(V=!0);return V?(r[k]=G,null):'Directive "'+_+'" requires one of [ '+A.join(", ")+" ] as a parameter."},x=["nobarlines","barlines","beataccents","nobeataccents","droneon","droneoff","drumon","drumoff","fermatafixed","fermataproportional","gchordon","gchordoff","controlcombo","temperamentnormal","noportamento"],b=["gchord","ptstress","beatstring"],w=["bassvol","chordvol","c","channel","beatmod","deltaloudness","drumbars","gracedivider","makechordchannels","randomchordattack","chordattack","stressmodel","transpose","rtranspose","vol","volinc","gchordbars"],C=["program"],T=["ratio","snt","bendvelocity","pitchbend","control","temperamentlinear"],B=["beat"],E=["drone"],z=["portamento"],F=["expand","grace","trim"],O=["drum","chordname"],R=["bassprog","chordprog"],Y=function(k,_,L){var A=k.shift().token,G=[];if(x.indexOf(A)>=0)k.length!==0&&t("Unexpected parameter in MIDI "+A,L,0);else if(b.indexOf(A)>=0)k.length!==1?t("Expected one parameter in MIDI "+A,L,0):G.push(k[0].token);else if(w.indexOf(A)>=0)k.length!==1?t("Expected one parameter in MIDI "+A,L,0):k[0].type!=="number"?t("Expected one integer parameter in MIDI "+A,L,0):G.push(k[0].intt);else if(C.indexOf(A)>=0)k.length!==1&&k.length!==2?t("Expected one or two parameters in MIDI "+A,L,0):k[0].type!=="number"||k.length===2&&k[1].type!=="number"?t("Expected integer parameter in MIDI "+A,L,0):(G.push(k[0].intt),k.length===2&&G.push(k[1].intt));else if(T.indexOf(A)>=0)k.length!==2?t("Expected two parameters in MIDI "+A,L,0):k[0].type!=="number"||k[1].type!=="number"?t("Expected two integer parameters in MIDI "+A,L,0):(G.push(k[0].intt),G.push(k[1].intt));else if(z.indexOf(A)>=0)k.length!==2?t("Expected two parameters in MIDI "+A,L,0):k[0].type!=="alpha"||k[1].type!=="number"?t("Expected one string and one integer parameters in MIDI "+A,L,0):(G.push(k[0].token),G.push(k[1].intt));else if(A==="drummap")k.length===2&&k[0].type==="alpha"&&k[1].type==="number"?(_.formatting||(_.formatting={}),_.formatting.midi||(_.formatting.midi={}),_.formatting.midi.drummap||(_.formatting.midi.drummap={}),_.formatting.midi.drummap[k[0].token]=k[1].intt,G=_.formatting.midi.drummap):k.length===3&&k[0].type==="punct"&&k[1].type==="alpha"&&k[2].type==="number"?(_.formatting||(_.formatting={}),_.formatting.midi||(_.formatting.midi={}),_.formatting.midi.drummap||(_.formatting.midi.drummap={}),_.formatting.midi.drummap[k[0].token+k[1].token]=k[2].intt,G=_.formatting.midi.drummap):t("Expected one note name and one integer parameter in MIDI "+A,L,0);else if(F.indexOf(A)>=0)k.length!==3||k[0].type!=="number"||k[1].token!=="/"||k[2].type!=="number"?t("Expected fraction parameter in MIDI "+A,L,0):(G.push(k[0].intt),G.push(k[2].intt));else if(B.indexOf(A)>=0)k.length!==4?t("Expected four parameters in MIDI "+A,L,0):k[0].type!=="number"||k[1].type!=="number"||k[2].type!=="number"||k[3].type!=="number"?t("Expected four integer parameters in MIDI "+A,L,0):(G.push(k[0].intt),G.push(k[1].intt),G.push(k[2].intt),G.push(k[3].intt));else if(E.indexOf(A)>=0)k.length!==5?t("Expected five parameters in MIDI "+A,L,0):k[0].type!=="number"||k[1].type!=="number"||k[2].type!=="number"||k[3].type!=="number"||k[4].type!=="number"?t("Expected five integer parameters in MIDI "+A,L,0):(G.push(k[0].intt),G.push(k[1].intt),G.push(k[2].intt),G.push(k[3].intt),G.push(k[4].intt));else if(C.indexOf(A)>=0)k.length!==1||k.length!==4?t("Expected one or two parameters in MIDI "+A,L,0):k[0].type!=="number"?t("Expected integer parameter in MIDI "+A,L,0):k.length===4?(k[1].token!=="octave"&&t("Expected octave parameter in MIDI "+A,L,0),k[2].token!=="="&&t("Expected octave parameter in MIDI "+A,L,0),k[3].type!=="number"&&t("Expected integer parameter for octave in MIDI "+A,L,0)):(G.push(k[0].intt),k.length===4&&G.push(k[3].intt));else if(O.indexOf(A)>=0)if(k.length<2)t("Expected string parameter and at least one integer parameter in MIDI "+A,L,0);else if(k[0].type!=="alpha")t("Expected string parameter and at least one integer parameter in MIDI "+A,L,0);else{var V=k.shift();for(G.push(V.token);k.length>0;)V=k.shift(),V.type!=="number"&&t("Expected integer parameter in MIDI "+A,L,0),G.push(V.intt)}else if(R.indexOf(A)>=0){if(k.length!==1&&k.length!==2)t("Expected one or two parameters in MIDI "+A,L,0);else if(k[0].type!=="number")t("Expected integer parameter in MIDI "+A,L,0);else if(k.length===2&&k[1].type!=="alpha")t("Expected alpha parameter in MIDI "+A,L,0);else if(G.push(k[0].intt),k.length===2){var Q=k[1].token;Q.indexOf("octave=")!=-1?(Q=Q.replace("octave=",""),Q=parseInt(Q),isNaN(Q)?t("Expected octave value in MIDI"+A):(Q<-1&&(t("Expected octave= in MIDI "+A+" to be >= -1 (recv:"+Q+")"),Q=-1),Q>3&&(t("Expected octave= in MIDI "+A+" to be <= 3 (recv:"+Q+")"),Q=3),G.push(Q))):t("Expected octave= in MIDI"+A)}}n.hasBeginMusic()?n.appendElement("midi",-1,-1,{cmd:A,params:G}):(_.formatting.midi===void 0&&(_.formatting.midi={}),_.formatting.midi[A]=G)};At.parseFontChangeLine=function(k){k=k.replace(/\$\$/g,"");var _=k.split("$");if(_.length>1&&r.setfont){var L=[];_[0]!==""&&L.push({text:_[0]});for(var A=1;A<_.length;A++)if(_[A][0]==="0")L.push({text:_[A].substring(1).replace(/\x03/g,"$$")});else{var G=parseInt(_[A][0],10);r.setfont[G]?L.push({font:r.setfont[G],text:_[A].substring(1).replace(/\x03/g,"$$")}):L[L.length-1].text+="$"+_[A].replace(/\x03/g,"$$")}return L}return k.replace(/\x03/g,"$$")};var K=["auto","above","below","hidden"];At.addDirective=function(k){var _=e.tokenize(k,0,k.length);if(_.length===0||_[0].type!=="alpha")return null;var L=k.substring(k.indexOf(_[0].token)+_[0].token.length);L=e.stripComment(L);var A=_.shift().token.toLowerCase(),G="",V;switch(A){case"bagpipes":a.formatting.bagpipes=!0;break;case"flatbeams":a.formatting.flatbeams=!0;break;case"jazzchords":a.formatting.jazzchords=!0;break;case"accentAbove":a.formatting.accentAbove=!0;break;case"germanAlphabet":a.formatting.germanAlphabet=!0;break;case"landscape":r.landscape=!0;break;case"papersize":r.papersize=L;break;case"graceslurs":if(_.length!==1)return"Directive graceslurs requires one parameter: 0 or 1";if(_[0].token==="0"||_[0].token==="false")a.formatting.graceSlurs=!1;else if(_[0].token==="1"||_[0].token==="true")a.formatting.graceSlurs=!0;else return"Directive graceslurs requires one parameter: 0 or 1 (received "+_[0].token+")";break;case"lineThickness":var Q=P(_);if(Q.value!==void 0&&(a.formatting.lineThickness=Q.value),Q.error)return Q.error;break;case"stretchlast":var le=P(_);if(le.value!==void 0&&(a.formatting.stretchlast=le.value),le.error)return le.error;break;case"titlecaps":r.titlecaps=!0;break;case"titleleft":a.formatting.titleleft=!0;break;case"measurebox":a.formatting.measurebox=!0;break;case"vocal":return y("vocalPosition",A,_,K);case"dynamic":return y("dynamicPosition",A,_,K);case"gchord":return y("chordPosition",A,_,K);case"ornament":return y("ornamentPosition",A,_,K);case"volume":return y("volumePosition",A,_,K);case"botmargin":case"botspace":case"composerspace":case"indent":case"leftmargin":case"linesep":case"musicspace":case"partsspace":case"pageheight":case"pagewidth":case"rightmargin":case"stafftopmargin":case"staffsep":case"staffwidth":case"subtitlespace":case"sysstaffsep":case"systemsep":case"textspace":case"titlespace":case"topmargin":case"topspace":case"vocalspace":case"wordsspace":return g(A,_);case"voicescale":if(_.length!==1||_[0].type!=="number")return"voicescale requires one float as a parameter";var Qe=_.shift();return r.currentVoice&&(r.currentVoice.scale=Qe.floatt,n.changeVoiceScale(r.currentVoice.scale)),null;case"voicecolor":if(_.length!==1)return"voicecolor requires one string as a parameter";var Ye=_.shift();return r.currentVoice&&(r.currentVoice.color=Ye.token,n.changeVoiceColor(r.currentVoice.color)),null;case"vskip":var Me=Math.round(p(A,_));return Me.error?Me.error:(n.addSpacing(Me),null);case"scale":l(A,_);break;case"sep":if(_.length===0)n.addSeparator(14,14,85,{startChar:r.iChar,endChar:r.iChar+5});else{var me=e.getMeasurement(_);if(me.used===0)return'Directive "'+A+'" requires 3 numbers: space above, space below, length of line';var q=me.value;if(me=e.getMeasurement(_),me.used===0)return'Directive "'+A+'" requires 3 numbers: space above, space below, length of line';var Ie=me.value;if(me=e.getMeasurement(_),me.used===0||_.length!==0)return'Directive "'+A+'" requires 3 numbers: space above, space below, length of line';var te=me.value;n.addSeparator(q,Ie,te,{startChar:r.iChar,endChar:r.iChar+L.length})}break;case"barsperstaff":if(G=v("barsperstaff",A,_),G!==null)return G;break;case"staffnonote":if(_.length!==1)return"Directive staffnonote requires one parameter: 0 or 1";if(_[0].token==="0")r.staffnonote=!0;else if(_[0].token==="1")r.staffnonote=!1;else return"Directive staffnonote requires one parameter: 0 or 1 (received "+_[0].token+")";break;case"printtempo":if(G=m("printTempo",A,_),G!==null)return G;break;case"partsbox":if(G=m("partsBox",A,_),G!==null)return G;r.partsfont.box=r.partsBox;break;case"freegchord":if(G=m("freegchord",A,_),G!==null)return G;break;case"measurenb":case"barnumbers":if(G=v("barNumbers",A,_),G!==null)return G;break;case"setbarnb":if(_.length!==1||_[0].type!=="number")return"Directive setbarnb requires a number as a parameter.";r.currBarNumber=n.setBarNumberImmediate(_[0].intt);break;case"keywarn":if(_.length!==1||_[0].type!=="number"||_[0].intt!==1&&_[0].intt!==0)return"Directive "+A+" requires 0 or 1 as a parameter.";r[A]=_[0].intt===1;break;case"begintext":var Z="";for(V=e.nextLine();V&&V.indexOf("%%endtext")!==0;){if(da.startsWith(V,"%%")){var ge=V.substring(2);ge=ge.trim()+`
1
+ import{g as ss}from"./index-CeOmPokb.js";function cs(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const i in a)if(i!=="default"&&!(i in e)){const n=Object.getOwnPropertyDescriptor(a,i);n&&Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:()=>a[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var os="6.6.2",ls=os,hs=function(e,t){var r=this;if(t||(t={}),r.qpm=t.qpm?parseInt(t.qpm,10):null,!r.qpm){var a=e.metaText?e.metaText.tempo:null;r.qpm=e.getBpm(a)}r.extraMeasuresAtBeginning=t.extraMeasuresAtBeginning?parseInt(t.extraMeasuresAtBeginning,10):0,r.beatCallback=t.beatCallback,r.eventCallback=t.eventCallback,r.lineEndCallback=t.lineEndCallback,r.lineEndAnticipation=t.lineEndAnticipation?parseInt(t.lineEndAnticipation,10):0,r.beatSubdivisions=t.beatSubdivisions?parseInt(t.beatSubdivisions,10):1,r.beatSubdivisions||(r.beatSubdivisions=1),r.joggerTimer=null,r.replaceTarget=function(n){if(r.noteTimings=n.setTiming(r.qpm,r.extraMeasuresAtBeginning),n.noteTimings.length===0&&(r.noteTimings=n.setTiming(0,0)),r.lineEndCallback&&(r.lineEndTimings=fs(n.noteTimings,r.lineEndAnticipation)),r.startTime=null,r.currentBeat=0,r.currentEvent=0,r.currentLine=0,r.currentTime=0,r.isPaused=!1,r.isRunning=!1,r.pausedPercent=null,r.justUnpaused=!1,r.newSeekPercent=0,r.lastTimestamp=0,r.noteTimings.length!==0){r.millisecondsPerBeat=1e3/(r.qpm/60)/r.beatSubdivisions,r.lastMoment=r.noteTimings[r.noteTimings.length-1].milliseconds;var s=n.getMeter(),c="";if(s&&s.type==="specified"&&s.value&&s.value.length>0&&s.value[0].num.indexOf("+")>0&&(c=s.value[0].num),r.beatStarts=[],c){for(var o=r.noteTimings[r.noteTimings.length-1].millisecondsPerMeasure,f=r.lastMoment/o,u=c.split("+"),l=0;l<u.length;l++)u[l]=parseInt(u[l],10)/2;for(var h=0,d=0,p=0;p<f;p++)for(var g=p*o,v=0,m=0;m<u.length;m++){var y=u[m];if(r.beatSubdivisions===1)r.beatSubdivisions===1&&h<r.lastMoment&&r.beatStarts.push({b:d,ts:h}),h+=y*r.millisecondsPerBeat;else for(var x=y*r.beatSubdivisions,b=0;b<Math.floor(x);b++){var w=b/x,C=Math.round(g+v*r.millisecondsPerBeat);C<r.lastMoment&&r.beatStarts.push({b:d+w,ts:C}),v++}d++}r.beatStarts.push({b:f*u.length,ts:r.lastMoment}),r.totalBeats=r.beatStarts.length}else{r.totalBeats=Math.round(r.lastMoment/r.millisecondsPerBeat);for(var T=0;T<r.totalBeats+1;T++)r.beatStarts.push({b:T/r.beatSubdivisions,ts:Math.round(T*r.millisecondsPerBeat)})}}},r.replaceTarget(e),r.doTiming=function(n){if(r.lastTimestamp!==n&&(r.lastTimestamp=n,!r.isPaused&&r.isRunning)){for(r.startTime||(r.startTime=n),r.currentTime=n-r.startTime,r.currentTime+=16;r.noteTimings.length>r.currentEvent&&r.noteTimings[r.currentEvent].milliseconds<r.currentTime;){if(r.eventCallback&&r.noteTimings[r.currentEvent].type==="event"){var s=r.startTime;r.eventCallback(r.noteTimings[r.currentEvent]),s!==r.startTime&&(r.currentTime=n-r.startTime)}r.currentEvent++}if(r.lineEndCallback&&r.lineEndTimings.length>r.currentLine&&r.lineEndTimings[r.currentLine].milliseconds<r.currentTime&&r.currentEvent<r.noteTimings.length){var c=r.noteTimings[r.currentEvent].milliseconds===r.currentTime?r.noteTimings[r.currentEvent]:r.noteTimings[r.currentEvent-1];r.lineEndCallback(r.lineEndTimings[r.currentLine],c,{line:r.currentLine,endTimings:r.lineEndTimings,currentTime:r.currentTime}),r.currentLine++}if(r.currentTime<r.lastMoment){if(requestAnimationFrame(r.doTiming),r.currentBeat<r.beatStarts.length&&r.beatStarts[r.currentBeat].ts<=r.currentTime){var o=r.doBeatCallback(n);r.currentBeat++,o!==null&&(r.currentTime=o)}}else if(r.currentBeat<=r.totalBeats&&r.beatCallback){var f=r.doBeatCallback(n);r.currentBeat++,f!==null&&(r.currentTime=f),requestAnimationFrame(r.doTiming)}if(r.currentTime>=r.lastMoment)if(r.eventCallback){var u=r.eventCallback(null);r.shouldStop(u).then(function(l){l&&r.stop()})}else r.stop()}},r.shouldStop=function(n){return new Promise(function(s){if(!n)return s(!0);if(n==="continue")return s(!1);n.then&&n.then(function(c){s(c!=="continue")})})},r.doBeatCallback=function(n){if(r.beatCallback){for(var s=r.currentEvent;s<r.noteTimings.length&&r.noteTimings[s].left===null;)s++;var c,o;if(s<r.noteTimings.length){for(c=r.noteTimings[s].milliseconds,s=Math.max(0,r.currentEvent-1);s>=0&&r.noteTimings[s].left===null;)s--;o=r.noteTimings[s]}var f={},u={};if(o){f.top=o.top,f.height=o.height;var l=Math.max(0,n-r.startTime-o.milliseconds),h=c-o.milliseconds,d=o.endX-o.left,p=h?l*d/h:0;f.left=o.left+p,r.currentEvent===0&&o.milliseconds>n-r.startTime&&(f.left=void 0),u={timestamp:n,startTime:r.startTime,ev:o,endMs:c,offMs:l,offPx:p,gapMs:h,gapPx:d}}else u={timestamp:n,startTime:r.startTime};var g=r.startTime;if(r.beatCallback(r.beatStarts[r.currentBeat].b,r.totalBeats/r.beatSubdivisions,r.lastMoment,f,u),g!==r.startTime)return n-r.startTime}return null};var i=60;r.animationJogger=function(){r.isRunning&&(r.doTiming(performance.now()),r.joggerTimer=setTimeout(r.animationJogger,i))},r.start=function(n,s){if(r.isRunning=!0,r.isPaused&&(r.isPaused=!1,n===void 0&&(r.justUnpaused=!0)),n)r.setProgress(n,s);else if(n===0)r.reset();else if(r.pausedPercent!==null){var c=performance.now();r.currentTime=r.lastMoment*r.pausedPercent,r.startTime=c-r.currentTime,r.pausedPercent=null,r.reportNext=!0}requestAnimationFrame(r.doTiming),r.joggerTimer=setTimeout(r.animationJogger,i)},r.pause=function(){r.isPaused=!0;var n=performance.now();r.pausedPercent=(n-r.startTime)/r.lastMoment,r.isRunning=!1,r.joggerTimer&&(clearTimeout(r.joggerTimer),r.joggerTimer=null)},r.currentMillisecond=function(){return r.currentTime},r.reset=function(){r.currentBeat=0,r.currentEvent=0,r.currentLine=0,r.startTime=null,r.pausedPercent=null},r.stop=function(){r.pause(),r.reset()},r.setProgress=function(n,s){var c;switch(s){case"seconds":r.currentTime=n*1e3,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),c=r.currentTime/r.lastMoment;break;case"beats":r.currentTime=n*r.millisecondsPerBeat*r.beatSubdivisions,r.currentTime<0&&(r.currentTime=0),r.currentTime>r.lastMoment&&(r.currentTime=r.lastMoment),c=r.currentTime/r.lastMoment;break;default:c=n,c<0&&(c=0),c>1&&(c=1),r.currentTime=r.lastMoment*c;break}r.isRunning||(r.pausedPercent=c);var o=performance.now();for(r.startTime=o-r.currentTime,r.currentEvent=0;r.noteTimings.length>r.currentEvent&&r.noteTimings[r.currentEvent].milliseconds<r.currentTime;)r.currentEvent++;if(r.lineEndCallback)for(r.currentLine=0;r.lineEndTimings.length>r.currentLine&&r.lineEndTimings[r.currentLine].milliseconds+r.lineEndAnticipation<r.currentTime;)r.currentLine++;var f=r.currentBeat;for(r.currentBeat=0;r.currentBeat<r.beatStarts.length&&!(r.beatStarts[r.currentBeat].ts>r.currentTime);r.currentBeat++);r.currentBeat--,r.beatCallback&&f!==r.currentBeat&&(r.doBeatCallback(r.startTime+r.currentTime),r.currentBeat++),r.eventCallback&&r.currentEvent>=0&&r.noteTimings[r.currentEvent].type==="event"&&r.eventCallback(r.noteTimings[r.currentEvent]),r.lineEndCallback&&r.lineEndCallback(r.lineEndTimings[r.currentLine],r.noteTimings[r.currentEvent],{line:r.currentLine,endTimings:r.lineEndTimings}),r.joggerTimer=setTimeout(r.animationJogger,i)}};function fs(e,t){for(var r=[],a=null,i=0;i<e.length;i++){var n=e[i];n.type!=="end"&&n.top!==a&&(r.push({measureNumber:n.measureNumber,milliseconds:n.milliseconds-t,top:n.top,bottom:n.top+n.height}),a=n.top)}return r}var $r=hs,us=$r,X0={};(function(){var e,t;X0.startAnimation=function(r,a,i){e&&(e.stop(),e=void 0),i.showCursor&&(t=r.querySelector(".abcjs-cursor"),t||(t=document.createElement("DIV"),t.className="abcjs-cursor cursor",t.style.position="absolute",r.appendChild(t),r.style.position="relative"));function n(h){for(var d=0;d<h.length;d++){var p=h[d];p.classList.contains("abcjs-bar")||(p.style.display="none")}}var s;function c(h){if(s){var d=r.querySelectorAll(s);n(d)}s=h}function o(h){var d=r.querySelectorAll(h);n(d)}function f(h){i.hideCurrentMeasure?o(h):i.hideFinishedMeasures&&c(h)}function u(h){return".abcjs-l"+h.line+".abcjs-m"+h.measureNumber}function l(h){if(h){if(h.measureStart){var d=u(h);d&&f(d)}t&&(t.style.left=h.left+"px",t.style.top=h.top+"px",t.style.width=h.width+"px",t.style.height=h.height+"px")}else e.stop(),e=void 0}e=new us(a,{qpm:i.bpm,eventCallback:l}),e.start()},X0.pauseAnimation=function(r){e&&(r?e.pause():e.start())},X0.stopAnimation=function(){e&&(e.stop(),e=void 0)}})();var ds=X0,lt={};lt.cloneArray=function(e){for(var t=[],r=0;r<e.length;r++)t.push(Object.assign({},e[r]));return t};lt.cloneHashOfHash=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=Object.assign({},e[r]));return t};lt.cloneHashOfArrayOfHash=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=lt.cloneArray(e[r]));return t};lt.strip=function(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")};lt.startsWith=function(e,t){return e.indexOf(t)===0};lt.endsWith=function(e,t){var r=e.length-t.length;return r>=0&&e.lastIndexOf(t)===r};lt.last=function(e){return e.length===0?null:e[e.length-1]};var rt=lt,da=rt,At={};(function(){var e,t,r,a,i;At.initialize=function(k,_,L,A,R){e=k,t=_,r=L,a=A,i=R,n()};function n(){r.annotationfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},r.gchordfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},r.historyfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},r.infofont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},r.measurefont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},r.partsfont={face:'"Times New Roman"',size:15,weight:"normal",style:"normal",decoration:"none"},r.repeatfont={face:'"Times New Roman"',size:13,weight:"normal",style:"normal",decoration:"none"},r.textfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},r.tripletfont={face:"Times",size:11,weight:"normal",style:"italic",decoration:"none"},r.vocalfont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},r.wordsfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},a.formatting.composerfont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},a.formatting.subtitlefont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},a.formatting.tempofont={face:'"Times New Roman"',size:15,weight:"bold",style:"normal",decoration:"none"},a.formatting.titlefont={face:'"Times New Roman"',size:20,weight:"normal",style:"normal",decoration:"none"},a.formatting.footerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},a.formatting.headerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},a.formatting.voicefont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},a.formatting.tablabelfont={face:'"Trebuchet MS"',size:16,weight:"normal",style:"normal",decoration:"none"},a.formatting.tabnumberfont={face:'"Arial"',size:11,weight:"normal",style:"normal",decoration:"none"},a.formatting.tabgracefont={face:'"Arial"',size:8,weight:"normal",style:"normal",decoration:"none"},a.formatting.annotationfont=r.annotationfont,a.formatting.gchordfont=r.gchordfont,a.formatting.historyfont=r.historyfont,a.formatting.infofont=r.infofont,a.formatting.measurefont=r.measurefont,a.formatting.partsfont=r.partsfont,a.formatting.repeatfont=r.repeatfont,a.formatting.textfont=r.textfont,a.formatting.tripletfont=r.tripletfont,a.formatting.vocalfont=r.vocalfont,a.formatting.wordsfont=r.wordsfont}var s={gchordfont:!0,measurefont:!0,partsfont:!0,annotationfont:!0,composerfont:!0,historyfont:!0,infofont:!0,subtitlefont:!0,textfont:!0,titlefont:!0,voicefont:!0},c=function(k){switch(k){case"Arial-Italic":return{face:"Arial",weight:"normal",style:"italic",decoration:"none"};case"Arial-Bold":return{face:"Arial",weight:"bold",style:"normal",decoration:"none"};case"Bookman-Demi":return{face:"Bookman,serif",weight:"bold",style:"normal",decoration:"none"};case"Bookman-DemiItalic":return{face:"Bookman,serif",weight:"bold",style:"italic",decoration:"none"};case"Bookman-Light":return{face:"Bookman,serif",weight:"normal",style:"normal",decoration:"none"};case"Bookman-LightItalic":return{face:"Bookman,serif",weight:"normal",style:"italic",decoration:"none"};case"Courier":return{face:'"Courier New"',weight:"normal",style:"normal",decoration:"none"};case"Courier-Oblique":return{face:'"Courier New"',weight:"normal",style:"italic",decoration:"none"};case"Courier-Bold":return{face:'"Courier New"',weight:"bold",style:"normal",decoration:"none"};case"Courier-BoldOblique":return{face:'"Courier New"',weight:"bold",style:"italic",decoration:"none"};case"AvantGarde-Book":return{face:"AvantGarde,Arial",weight:"normal",style:"normal",decoration:"none"};case"AvantGarde-BookOblique":return{face:"AvantGarde,Arial",weight:"normal",style:"italic",decoration:"none"};case"AvantGarde-Demi":case"Avant-Garde-Demi":return{face:"AvantGarde,Arial",weight:"bold",style:"normal",decoration:"none"};case"AvantGarde-DemiOblique":return{face:"AvantGarde,Arial",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Oblique":return{face:"Helvetica",weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Bold":return{face:"Helvetica",weight:"bold",style:"normal",decoration:"none"};case"Helvetica-BoldOblique":return{face:"Helvetica",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Narrow":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"normal",decoration:"none"};case"Helvetica-Narrow-Oblique":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Narrow-Bold":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"normal",decoration:"none"};case"Helvetica-Narrow-BoldOblique":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"italic",decoration:"none"};case"Palatino-Roman":return{face:"Palatino",weight:"normal",style:"normal",decoration:"none"};case"Palatino-Italic":return{face:"Palatino",weight:"normal",style:"italic",decoration:"none"};case"Palatino-Bold":return{face:"Palatino",weight:"bold",style:"normal",decoration:"none"};case"Palatino-BoldItalic":return{face:"Palatino",weight:"bold",style:"italic",decoration:"none"};case"NewCenturySchlbk-Roman":return{face:'"New Century",serif',weight:"normal",style:"normal",decoration:"none"};case"NewCenturySchlbk-Italic":return{face:'"New Century",serif',weight:"normal",style:"italic",decoration:"none"};case"NewCenturySchlbk-Bold":return{face:'"New Century",serif',weight:"bold",style:"normal",decoration:"none"};case"NewCenturySchlbk-BoldItalic":return{face:'"New Century",serif',weight:"bold",style:"italic",decoration:"none"};case"Times":case"Times-Roman":case"Times-Narrow":case"Times-Courier":case"Times-New-Roman":return{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none"};case"Times-Italic":case"Times-Italics":return{face:'"Times New Roman"',weight:"normal",style:"italic",decoration:"none"};case"Times-Bold":return{face:'"Times New Roman"',weight:"bold",style:"normal",decoration:"none"};case"Times-BoldItalic":return{face:'"Times New Roman"',weight:"bold",style:"italic",decoration:"none"};case"ZapfChancery-MediumItalic":return{face:'"Zapf Chancery",cursive,serif',weight:"normal",style:"normal",decoration:"none"};default:return null}},o=function(k,_,L,A,R){function V(){var Ae=parseInt(k[0].token);return k.shift(),_?k.length===0?{face:_.face,weight:_.weight,style:_.style,decoration:_.decoration,size:Ae}:k.length===1&&k[0].token==="box"&&s[R]?{face:_.face,weight:_.weight,style:_.style,decoration:_.decoration,size:Ae,box:!0}:(t("Extra parameters in font definition.",L,A),{face:_.face,weight:_.weight,style:_.style,decoration:_.decoration,size:Ae}):(t("Can't set just the size of the font since there is no default value.",L,A),{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none",size:Ae})}if(k[0].token==="*"){if(k.shift(),k[0].type==="number")return V();t("Expected font size number after *.",L,A)}if(k[0].type==="number")return V();for(var Q=[],le,Qe="normal",Ye="normal",Me="none",me=!1,q="face",Ie=!1;k.length;){var te=k.shift(),Z=te.token.toLowerCase();switch(q){case"face":Ie||Z!=="utf"&&te.type!=="number"&&Z!=="bold"&&Z!=="italic"&&Z!=="underline"&&Z!=="box"?Q.length>0&&te.token==="-"?(Ie=!0,Q[Q.length-1]=Q[Q.length-1]+te.token):Ie?(Ie=!1,Q[Q.length-1]=Q[Q.length-1]+te.token):Q.push(te.token):te.type==="number"?(le?t("Font size specified twice in font definition.",L,A):le=te.token,q="modifier"):Z==="bold"?Qe="bold":Z==="italic"?Ye="italic":Z==="underline"?Me="underline":Z==="box"?(s[R]?me=!0:t(`This font style doesn't support "box"`,L,A),q="finished"):Z==="utf"?(te=k.shift(),q="size"):t("Unknown parameter "+te.token+" in font definition.",L,A);break;case"size":te.type==="number"?le?t("Font size specified twice in font definition.",L,A):le=te.token:t("Expected font size in font definition.",L,A),q="modifier";break;case"modifier":Z==="bold"?Qe="bold":Z==="italic"?Ye="italic":Z==="underline"?Me="underline":Z==="box"?(s[R]?me=!0:t(`This font style doesn't support "box"`,L,A),q="finished"):t("Unknown parameter "+te.token+" in font definition.",L,A);break;case"finished":t('Extra characters found after "box" in font definition.',L,A);break}}le===void 0?_?le=_.size:(t("Must specify the size of the font since there is no default value.",L,A),le=12):le=parseFloat(le),Q=Q.join(" "),Q===""&&(_?Q=_.face:(t("Must specify the name of the font since there is no default value.",L,A),Q="sans-serif"));var ge=c(Q),ce={};return ge?(ce.face=ge.face,ce.weight=ge.weight,ce.style=ge.style,ce.decoration=ge.decoration,ce.size=le,me&&(ce.box=!0),ce):(ce.face=Q,ce.weight=Qe,ce.style=Ye,ce.decoration=Me,ce.size=le,me&&(ce.box=!0),ce)},f=function(k,_,L){return _.length===0?'Directive "'+k+'" requires a font as a parameter.':(r[k]=o(_,r[k],L,0,k),r.is_in_header&&(a.formatting[k]=r[k]),null)},u=function(k,_,L){return _.length===0?'Directive "'+k+'" requires a font as a parameter.':(a.formatting[k]=o(_,a.formatting[k],L,0,k),null)},l=function(k,_){var L="";_.forEach(function(R){L+=R.token});var A=parseFloat(L);if(isNaN(A)||A===0)return'Directive "'+k+'" requires a number as a parameter.';a.formatting.scale=A},h=["acoustic-bass-drum","bass-drum-1","side-stick","acoustic-snare","hand-clap","electric-snare","low-floor-tom","closed-hi-hat","high-floor-tom","pedal-hi-hat","low-tom","open-hi-hat","low-mid-tom","hi-mid-tom","crash-cymbal-1","high-tom","ride-cymbal-1","chinese-cymbal","ride-bell","tambourine","splash-cymbal","cowbell","crash-cymbal-2","vibraslap","ride-cymbal-2","hi-bongo","low-bongo","mute-hi-conga","open-hi-conga","low-conga","high-timbale","low-timbale","high-agogo","low-agogo","cabasa","maracas","short-whistle","long-whistle","short-guiro","long-guiro","claves","hi-wood-block","low-wood-block","mute-cuica","open-cuica","mute-triangle","open-triangle"],d=function(k){var _=k.split(/\s+/);if(_.length!==2&&_.length!==3)return{error:'Expected parameters "abc-note", "drum-sound", and optionally "note-head"'};var L=_[0],A=parseInt(_[1],10);if((isNaN(A)||A<35||A>81)&&_[1]&&(A=h.indexOf(_[1].toLowerCase())+35),isNaN(A)||A<35||A>81)return{error:'Expected drum name, received "'+_[1]+'"'};var R={sound:A};return _.length===3&&(R.noteHead=_[2]),{key:L,value:R}},p=function(k,_){var L=e.getMeasurement(_);return L.used===0||_.length!==0?{error:'Directive "'+k+'" requires a measurement as a parameter.'}:L.value},g=function(k,_){var L=e.getMeasurement(_);return L.used===0||_.length!==0?'Directive "'+k+'" requires a measurement as a parameter.':(a.formatting[k]=L.value,null)},v=function(k,_,L,A,R){if(L.length!==1||L[0].type!=="number")return'Directive "'+_+'" requires a number as a parameter.';var V=L[0].intt;return A!==void 0&&V<A?'Directive "'+_+'" requires a number greater than or equal to '+A+" as a parameter.":R!==void 0&&V>R?'Directive "'+_+'" requires a number less than or equal to '+R+" as a parameter.":(r[k]=V,null)},m=function(k,_,L){if(L.length===1&&(L[0].token==="true"||L[0].token==="false"))return r[k]=L[0].token==="true",null;var A=v(k,_,L,0,1);return A!==null?A:(r[k]=r[k]===1,null)},y=function(k,_,L,A){if(L.length!==1)return'Directive "'+_+'" requires one of [ '+A.join(", ")+" ] as a parameter.";for(var R=L[0].token,V=!1,Q=0;!V&&Q<A.length;Q++)A[Q]===R&&(V=!0);return V?(r[k]=R,null):'Directive "'+_+'" requires one of [ '+A.join(", ")+" ] as a parameter."},x=["nobarlines","barlines","beataccents","nobeataccents","droneon","droneoff","drumon","drumoff","fermatafixed","fermataproportional","gchordon","gchordoff","controlcombo","temperamentnormal","noportamento"],b=["gchord","ptstress","beatstring"],w=["bassvol","chordvol","c","channel","beatmod","deltaloudness","drumbars","gracedivider","makechordchannels","randomchordattack","chordattack","stressmodel","transpose","rtranspose","vol","volinc","gchordbars"],C=["program"],T=["ratio","snt","bendvelocity","pitchbend","control","temperamentlinear"],B=["beat"],E=["drone"],z=["portamento"],I=["expand","grace","trim"],F=["drum","chordname"],G=["bassprog","chordprog"],Y=function(k,_,L){var A=k.shift().token,R=[];if(x.indexOf(A)>=0)k.length!==0&&t("Unexpected parameter in MIDI "+A,L,0);else if(b.indexOf(A)>=0)k.length!==1?t("Expected one parameter in MIDI "+A,L,0):R.push(k[0].token);else if(w.indexOf(A)>=0)k.length!==1?t("Expected one parameter in MIDI "+A,L,0):k[0].type!=="number"?t("Expected one integer parameter in MIDI "+A,L,0):R.push(k[0].intt);else if(C.indexOf(A)>=0)k.length!==1&&k.length!==2?t("Expected one or two parameters in MIDI "+A,L,0):k[0].type!=="number"||k.length===2&&k[1].type!=="number"?t("Expected integer parameter in MIDI "+A,L,0):(R.push(k[0].intt),k.length===2&&R.push(k[1].intt));else if(T.indexOf(A)>=0)k.length!==2?t("Expected two parameters in MIDI "+A,L,0):k[0].type!=="number"||k[1].type!=="number"?t("Expected two integer parameters in MIDI "+A,L,0):(R.push(k[0].intt),R.push(k[1].intt));else if(z.indexOf(A)>=0)k.length!==2?t("Expected two parameters in MIDI "+A,L,0):k[0].type!=="alpha"||k[1].type!=="number"?t("Expected one string and one integer parameters in MIDI "+A,L,0):(R.push(k[0].token),R.push(k[1].intt));else if(A==="drummap")k.length===2&&k[0].type==="alpha"&&k[1].type==="number"?(_.formatting||(_.formatting={}),_.formatting.midi||(_.formatting.midi={}),_.formatting.midi.drummap||(_.formatting.midi.drummap={}),_.formatting.midi.drummap[k[0].token]=k[1].intt,R=_.formatting.midi.drummap):k.length===3&&k[0].type==="punct"&&k[1].type==="alpha"&&k[2].type==="number"?(_.formatting||(_.formatting={}),_.formatting.midi||(_.formatting.midi={}),_.formatting.midi.drummap||(_.formatting.midi.drummap={}),_.formatting.midi.drummap[k[0].token+k[1].token]=k[2].intt,R=_.formatting.midi.drummap):t("Expected one note name and one integer parameter in MIDI "+A,L,0);else if(I.indexOf(A)>=0)k.length!==3||k[0].type!=="number"||k[1].token!=="/"||k[2].type!=="number"?t("Expected fraction parameter in MIDI "+A,L,0):(R.push(k[0].intt),R.push(k[2].intt));else if(B.indexOf(A)>=0)k.length!==4?t("Expected four parameters in MIDI "+A,L,0):k[0].type!=="number"||k[1].type!=="number"||k[2].type!=="number"||k[3].type!=="number"?t("Expected four integer parameters in MIDI "+A,L,0):(R.push(k[0].intt),R.push(k[1].intt),R.push(k[2].intt),R.push(k[3].intt));else if(E.indexOf(A)>=0)k.length!==5?t("Expected five parameters in MIDI "+A,L,0):k[0].type!=="number"||k[1].type!=="number"||k[2].type!=="number"||k[3].type!=="number"||k[4].type!=="number"?t("Expected five integer parameters in MIDI "+A,L,0):(R.push(k[0].intt),R.push(k[1].intt),R.push(k[2].intt),R.push(k[3].intt),R.push(k[4].intt));else if(C.indexOf(A)>=0)k.length!==1||k.length!==4?t("Expected one or two parameters in MIDI "+A,L,0):k[0].type!=="number"?t("Expected integer parameter in MIDI "+A,L,0):k.length===4?(k[1].token!=="octave"&&t("Expected octave parameter in MIDI "+A,L,0),k[2].token!=="="&&t("Expected octave parameter in MIDI "+A,L,0),k[3].type!=="number"&&t("Expected integer parameter for octave in MIDI "+A,L,0)):(R.push(k[0].intt),k.length===4&&R.push(k[3].intt));else if(F.indexOf(A)>=0)if(k.length<2)t("Expected string parameter and at least one integer parameter in MIDI "+A,L,0);else if(k[0].type!=="alpha")t("Expected string parameter and at least one integer parameter in MIDI "+A,L,0);else{var V=k.shift();for(R.push(V.token);k.length>0;)V=k.shift(),V.type!=="number"&&t("Expected integer parameter in MIDI "+A,L,0),R.push(V.intt)}else if(G.indexOf(A)>=0){if(k.length!==1&&k.length!==2)t("Expected one or two parameters in MIDI "+A,L,0);else if(k[0].type!=="number")t("Expected integer parameter in MIDI "+A,L,0);else if(k.length===2&&k[1].type!=="alpha")t("Expected alpha parameter in MIDI "+A,L,0);else if(R.push(k[0].intt),k.length===2){var Q=k[1].token;Q.indexOf("octave=")!=-1?(Q=Q.replace("octave=",""),Q=parseInt(Q),isNaN(Q)?t("Expected octave value in MIDI"+A):(Q<-1&&(t("Expected octave= in MIDI "+A+" to be >= -1 (recv:"+Q+")"),Q=-1),Q>3&&(t("Expected octave= in MIDI "+A+" to be <= 3 (recv:"+Q+")"),Q=3),R.push(Q))):t("Expected octave= in MIDI"+A)}}i.hasBeginMusic()?i.appendElement("midi",-1,-1,{cmd:A,params:R}):(_.formatting.midi===void 0&&(_.formatting.midi={}),_.formatting.midi[A]=R)};At.parseFontChangeLine=function(k){k=k.replace(/\$\$/g,"");var _=k.split("$");if(_.length>1&&r.setfont){var L=[];_[0]!==""&&L.push({text:_[0]});for(var A=1;A<_.length;A++)if(_[A][0]==="0")L.push({text:_[A].substring(1).replace(/\x03/g,"$$")});else{var R=parseInt(_[A][0],10);r.setfont[R]?L.push({font:r.setfont[R],text:_[A].substring(1).replace(/\x03/g,"$$")}):L[L.length-1].text+="$"+_[A].replace(/\x03/g,"$$")}return L}return k.replace(/\x03/g,"$$")};var K=["auto","above","below","hidden"];At.addDirective=function(k){var _=e.tokenize(k,0,k.length);if(_.length===0||_[0].type!=="alpha")return null;var L=k.substring(k.indexOf(_[0].token)+_[0].token.length);L=e.stripComment(L);var A=_.shift().token.toLowerCase(),R="",V;switch(A){case"bagpipes":a.formatting.bagpipes=!0;break;case"flatbeams":a.formatting.flatbeams=!0;break;case"jazzchords":a.formatting.jazzchords=!0;break;case"accentAbove":a.formatting.accentAbove=!0;break;case"germanAlphabet":a.formatting.germanAlphabet=!0;break;case"landscape":r.landscape=!0;break;case"papersize":r.papersize=L;break;case"graceslurs":if(_.length!==1)return"Directive graceslurs requires one parameter: 0 or 1";if(_[0].token==="0"||_[0].token==="false")a.formatting.graceSlurs=!1;else if(_[0].token==="1"||_[0].token==="true")a.formatting.graceSlurs=!0;else return"Directive graceslurs requires one parameter: 0 or 1 (received "+_[0].token+")";break;case"lineThickness":var Q=P(_);if(Q.value!==void 0&&(a.formatting.lineThickness=Q.value),Q.error)return Q.error;break;case"stretchlast":var le=P(_);if(le.value!==void 0&&(a.formatting.stretchlast=le.value),le.error)return le.error;break;case"titlecaps":r.titlecaps=!0;break;case"titleleft":a.formatting.titleleft=!0;break;case"measurebox":a.formatting.measurebox=!0;break;case"vocal":return y("vocalPosition",A,_,K);case"dynamic":return y("dynamicPosition",A,_,K);case"gchord":return y("chordPosition",A,_,K);case"ornament":return y("ornamentPosition",A,_,K);case"volume":return y("volumePosition",A,_,K);case"botmargin":case"botspace":case"composerspace":case"indent":case"leftmargin":case"linesep":case"musicspace":case"partsspace":case"pageheight":case"pagewidth":case"rightmargin":case"stafftopmargin":case"staffsep":case"staffwidth":case"subtitlespace":case"sysstaffsep":case"systemsep":case"textspace":case"titlespace":case"topmargin":case"topspace":case"vocalspace":case"wordsspace":return g(A,_);case"voicescale":if(_.length!==1||_[0].type!=="number")return"voicescale requires one float as a parameter";var Qe=_.shift();return r.currentVoice&&(r.currentVoice.scale=Qe.floatt,i.changeVoiceScale(r.currentVoice.scale)),null;case"voicecolor":if(_.length!==1)return"voicecolor requires one string as a parameter";var Ye=_.shift();return r.currentVoice&&(r.currentVoice.color=Ye.token,i.changeVoiceColor(r.currentVoice.color)),null;case"vskip":var Me=Math.round(p(A,_));return Me.error?Me.error:(i.addSpacing(Me),null);case"scale":l(A,_);break;case"sep":if(_.length===0)i.addSeparator(14,14,85,{startChar:r.iChar,endChar:r.iChar+5});else{var me=e.getMeasurement(_);if(me.used===0)return'Directive "'+A+'" requires 3 numbers: space above, space below, length of line';var q=me.value;if(me=e.getMeasurement(_),me.used===0)return'Directive "'+A+'" requires 3 numbers: space above, space below, length of line';var Ie=me.value;if(me=e.getMeasurement(_),me.used===0||_.length!==0)return'Directive "'+A+'" requires 3 numbers: space above, space below, length of line';var te=me.value;i.addSeparator(q,Ie,te,{startChar:r.iChar,endChar:r.iChar+L.length})}break;case"barsperstaff":if(R=v("barsperstaff",A,_),R!==null)return R;break;case"staffnonote":if(_.length!==1)return"Directive staffnonote requires one parameter: 0 or 1";if(_[0].token==="0")r.staffnonote=!0;else if(_[0].token==="1")r.staffnonote=!1;else return"Directive staffnonote requires one parameter: 0 or 1 (received "+_[0].token+")";break;case"printtempo":if(R=m("printTempo",A,_),R!==null)return R;break;case"partsbox":if(R=m("partsBox",A,_),R!==null)return R;r.partsfont.box=r.partsBox;break;case"freegchord":if(R=m("freegchord",A,_),R!==null)return R;break;case"measurenb":case"barnumbers":if(R=v("barNumbers",A,_),R!==null)return R;break;case"setbarnb":if(_.length!==1||_[0].type!=="number")return"Directive setbarnb requires a number as a parameter.";r.currBarNumber=i.setBarNumberImmediate(_[0].intt);break;case"keywarn":if(_.length!==1||_[0].type!=="number"||_[0].intt!==1&&_[0].intt!==0)return"Directive "+A+" requires 0 or 1 as a parameter.";r[A]=_[0].intt===1;break;case"begintext":var Z="";for(V=e.nextLine();V&&V.indexOf("%%endtext")!==0;){if(da.startsWith(V,"%%")){var ge=V.substring(2);ge=ge.trim()+`
2
2
  `,Z+=ge}else Z+=V.trim()+`
3
- `;V=e.nextLine()}n.addText(Z,{startChar:r.iChar,endChar:r.iChar+Z.length+7});break;case"continueall":r.continueall=!0;break;case"beginps":for(V=e.nextLine();V&&V.indexOf("%%endps")!==0;)e.nextLine();t("Postscript ignored",k,0);break;case"deco":L.length>0&&r.ignoredDecorations.push(L.substring(0,L.indexOf(" "))),t("Decoration redefinition ignored",k,0);break;case"text":var oe=e.translateString(L);n.addText(At.parseFontChangeLine(oe),{startChar:r.iChar,endChar:r.iChar+L.length+7});break;case"center":var Ae=e.translateString(L);n.addCentered(At.parseFontChangeLine(Ae));break;case"font":break;case"setfont":var ke=e.tokenize(L,0,L.length);if(ke.length>=4&&ke[0].token==="-"&&ke[1].type==="number"){var _e=parseInt(ke[1].token);_e>=1&&_e<=9&&(r.setfont||(r.setfont=[]),ke.shift(),ke.shift(),r.setfont[_e]=c(ke,r.setfont[_e],k,0,"setfont"))}break;case"gchordfont":case"partsfont":case"tripletfont":case"vocalfont":case"textfont":case"annotationfont":case"historyfont":case"infofont":case"measurefont":case"repeatfont":case"wordsfont":return f(A,_,k);case"composerfont":case"subtitlefont":case"tempofont":case"titlefont":case"voicefont":case"footerfont":case"headerfont":return u(A,_,k);case"barlabelfont":case"barnumberfont":case"barnumfont":return f("measurefont",_,k);case"staves":case"score":r.score_is_present=!0;for(var xt=function(a0,ns,fa,ua,is){(ns||r.staves.length===0)&&r.staves.push({index:r.staves.length,numVoices:0});var ut=da.last(r.staves);fa!==void 0&&ut.bracket===void 0&&(ut.bracket=fa),ua!==void 0&&ut.brace===void 0&&(ut.brace=ua),is&&(ut.connectBarLines="end"),r.voices[a0]===void 0&&(r.voices[a0]={staffNum:ut.index,index:ut.numVoices},ut.numVoices++)},M=!1,I=!1,N=!1,D=!1,$=!1,W=!1,J=!1,ee,j=function(){if(J=!0,ee){var a0="start";ee.staffNum>0&&(r.staves[ee.staffNum-1].connectBarLines==="start"||r.staves[ee.staffNum-1].connectBarLines==="continue")&&(a0="continue"),r.staves[ee.staffNum].connectBarLines=a0}};_.length;){var X=_.shift();switch(X.token){case"(":M?t("Can't nest parenthesis in %%score",k,X.start):(M=!0,D=!0);break;case")":!M||D?t("Unexpected close parenthesis in %%score",k,X.start):M=!1;break;case"[":I?t("Can't nest brackets in %%score",k,X.start):(I=!0,$=!0);break;case"]":!I||$?t("Unexpected close bracket in %%score",k,X.start):(I=!1,r.staves[ee.staffNum].bracket="end");break;case"{":N?t("Can't nest braces in %%score",k,X.start):(N=!0,W=!0);break;case"}":!N||W?t("Unexpected close brace in %%score",k,X.start):(N=!1,r.staves[ee.staffNum].brace="end");break;case"|":j();break;default:for(var re="";(X.type==="alpha"||X.type==="number")&&(re+=X.token,X.continueId);)X=_.shift();var se=!M||D,U=$?"start":I?"continue":void 0,ie=W?"start":N?"continue":void 0;xt(re,se,U,ie,J),D=!1,$=!1,W=!1,J=!1,ee=r.voices[re],A==="staves"&&j();break}}break;case"maxstaves":var he=e.getInt(L);he.digits===0?t("Expected number of staves in maxstaves"):he.value>0&&(a.formatting.maxStaves=he.value);break;case"newpage":var ae=e.getInt(L);n.addNewPage(ae.digits===0?-1:ae.value);break;case"abc":var Fe=L.split(" ");switch(Fe[0]){case"-copyright":case"-creator":case"-edited-by":case"-version":case"-charset":var Ft=Fe.shift();n.addMetaText(A+Ft,Fe.join(" "),{startChar:r.iChar,endChar:r.iChar+L.length+5});break;default:return"Unknown directive: "+A+Fe[0]}break;case"header":case"footer":var ye=e.getMeat(L,0,L.length);ye=L.substring(ye.start,ye.end),ye[0]==='"'&&ye[ye.length-1]==='"'&&(ye=ye.substring(1,ye.length-1));var Be=ye.split(" "),Ct={};Be.length===1?Ct={left:"",center:Be[0],right:""}:Be.length===2?Ct={left:Be[0],center:Be[1],right:""}:Ct={left:Be[0],center:Be[1],right:Be[2]},Be.length>3&&t("Too many tabs in "+A+": "+Be.length+" found.",L,0),n.addMetaTextObj(A,Ct,{startChar:r.iChar,endChar:r.iChar+k.length});break;case"midi":var st=e.tokenize(L,0,L.length,!0);st.length>0&&st[0].token==="="&&st.shift(),st.length===0?t("Expected midi command",L,0):Y(st,a,L);break;case"percmap":var kt=d(L);kt.error?t(kt.error,k,8):(a.formatting.percmap||(a.formatting.percmap={}),a.formatting.percmap[kt.key]=kt.value);break;case"visualtranspose":var ha=e.getInt(L);ha.digits===0?t("Expected number of half steps in visualTranspose"):r.globalTranspose=ha.value;break;case"map":case"playtempo":case"auquality":case"continuous":case"nobarcheck":a.formatting[A]=L;break;default:return"Unknown directive: "+A}return null},At.globalFormatting=function(k){for(var _ in k)if(k.hasOwnProperty(_)){var L=""+k[_],A=e.tokenize(L,0,L.length),G;switch(_){case"titlefont":case"gchordfont":case"composerfont":case"footerfont":case"headerfont":case"historyfont":case"infofont":case"measurefont":case"partsfont":case"repeatfont":case"subtitlefont":case"tempofont":case"textfont":case"voicefont":case"tripletfont":case"vocalfont":case"wordsfont":case"annotationfont":case"tablabelfont":case"tabnumberfont":case"tabgracefont":f(_,A,L);break;case"scale":l(_,A);break;case"partsbox":G=m("partsBox",_,A),G!==null&&t(G),r.partsfont.box=r.partsBox;break;case"freegchord":G=m("freegchord",_,A),G!==null&&t(G);break;case"fontboxpadding":(A.length!==1||A[0].type!=="number")&&t('Directive "'+_+'" requires a number as a parameter.'),a.formatting.fontboxpadding=A[0].floatt;break;case"stafftopmargin":(A.length!==1||A[0].type!=="number")&&t('Directive "'+_+'" requires a number as a parameter.'),a.formatting.stafftopmargin=A[0].floatt;break;case"stretchlast":var V=P(A);if(V.value!==void 0&&(a.formatting.stretchlast=V.value),V.error)return V.error;break;default:t("Formatting directive unrecognized: ",_,0)}}};function P(k){if(k.length===0)return{value:1};if(k.length===1)if(k[0].type==="number"){if(k[0].floatt>=0||k[0].floatt<=1)return{value:k[0].floatt}}else{if(k[0].token==="false")return{value:0};if(k[0].token==="true")return{value:1}}return{error:"Directive stretchlast requires zero or one parameter: false, true, or number between 0 and 1 (received "+k[0].token+")"}}})();var Rr=At,Gr={};const Gn=["C,,,","D,,,","E,,,","F,,,","G,,,","A,,,","B,,,","C,,","D,,","E,,","F,,","G,,","A,,","B,,","C,","D,","E,","F,","G,","A,","B,","C","D","E","F","G","A","B","c","d","e","f","g","a","b","c'","d'","e'","f'","g'","a'","b'","c''","d''","e''","f''","g''","a''","b''","c'''","d'''","e'''","f'''","g'''","a'''","b'''"];Gr.pitchIndex=function(e){return Gn.indexOf(e)};Gr.noteName=function(e){return Gn[e]};var ps=Gr,M0=["C","C♯","D","D♯","E","F","F♯","G","G♯","A","A♯","B"],A0=["C","D♭","D","E♭","E","F","G♭","G","A♭","A","B♭","B"],B0=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],N0=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"];function vs(e,t,r,a){if(!t||t%12===0)return e;for(;t<0;)t+=12;t>11&&(t=t%12);var n=e.match(/^([A-G][b#♭♯]?)([^\/]+)?\/?([A-G][b#♭♯]?)?(.+)?/);if(!n)return e;var i=n[1],s=n[2],o=n[3],c=n[4],f=M0.indexOf(i);if(f<0&&(f=A0.indexOf(i)),f<0&&(f=B0.indexOf(i)),f<0&&(f=N0.indexOf(i)),f<0)return e;f+=t,f=f%12,r?a?e=N0[f]:e=A0[f]:a?e=B0[f]:e=M0[f];var u=s&&(s.indexOf("dim")>=0||s.indexOf("°")>=0);if(u&&e==="A#"&&(e="Bb"),u&&e==="D#"&&(e="Eb"),u&&e==="A♯"&&(e="B♭"),u&&e==="D♯"&&(e="E♭"),s&&(e+=s),o){var f=M0.indexOf(o);f<0&&(f=A0.indexOf(o)),f<0&&(f=B0.indexOf(o)),f<0&&(f=N0.indexOf(o)),e+="/",f>=0?(f+=t,f=f%12,r?a?e+=N0[f]:e+=A0[f]:a?e+=B0[f]:e+=M0[f]):e+=o}return c&&(e+=c),e}var Yn=vs,Bt={C:{modes:["CMaj","CIon","Amin","AAeo","Am","GMix","DDor","EPhr","FLyd","BLoc"],stepsFromC:0},Db:{modes:["DbMaj","DbIon","Bbmin","BbAeo","Bbm","AbMix","EbDor","FPhr","GbLyd","CLoc"],stepsFromC:1},D:{modes:["DMaj","DIon","Bmin","BAeo","Bm","AMix","EDor","F#Phr","GLyd","C#Loc"],stepsFromC:2},Eb:{modes:["EbMaj","EbIon","Cmin","CAeo","Cm","BbMix","FDor","GPhr","AbLyd","DLoc"],stepsFromC:3},E:{modes:["EMaj","EIon","C#min","C#Aeo","C#m","BMix","F#Dor","G#Phr","ALyd","D#Loc"],stepsFromC:4},F:{modes:["FMaj","FIon","Dmin","DAeo","Dm","CMix","GDor","APhr","BbLyd","ELoc"],stepsFromC:5},Gb:{modes:["GbMaj","GbIon","Ebmin","EbAeo","Ebm","DbMix","AbDor","BbPhr","CbLyd","FLoc"],stepsFromC:6},G:{modes:["GMaj","GIon","Emin","EAeo","Em","DMix","ADor","BPhr","CLyd","F#Loc"],stepsFromC:7},Ab:{modes:["AbMaj","AbIon","Fmin","FAeo","Fm","EbMix","BbDor","CPhr","DbLyd","GLoc"],stepsFromC:8},A:{modes:["AMaj","AIon","F#min","F#Aeo","F#m","EMix","BDor","C#Phr","DLyd","G#Loc"],stepsFromC:9},Bb:{modes:["BbMaj","BbIon","Gmin","GAeo","Gm","FMix","CDor","DPhr","EbLyd","ALoc"],stepsFromC:10},B:{modes:["BMaj","BIon","G#min","G#Aeo","G#m","F#Mix","C#Dor","D#Phr","ELyd","A#Loc"],stepsFromC:11},"C#":{modes:["C#Maj","C#Ion","A#min","A#Aeo","A#m","G#Mix","D#Dor","E#Phr","F#Lyd","B#Loc"],stepsFromC:1},"F#":{modes:["F#Maj","F#Ion","D#min","D#Aeo","D#m","C#Mix","G#Dor","A#Phr","BLyd","E#Loc"],stepsFromC:6},Cb:{modes:["CbMaj","CbIon","Abmin","AbAeo","Abm","GbMix","DbDor","EbPhr","FbLyd","BbLoc"],stepsFromC:11}},gs=["maj","ion","min","aeo","m","mix","dor","phr","lyd","loc"];function bs(e){return gs.indexOf(e.toLowerCase())>=0}var v0=null;function ms(){v0={};for(var e=Object.keys(Bt),t=0;t<e.length;t++){var r=Bt[e[t]];v0[e[t].toLowerCase()]=e[t];for(var a=0;a<r.modes.length;a++){var n=r.modes[a].toLowerCase();v0[n]=e[t]}}}function ys(e){v0||ms();var t=e.toLowerCase().match(/([a-g][b#]?)(maj|ion|min|aeo|mix|dor|phr|lyd|loc|m)?/);if(!t||!t[2])return e;t=t[1]+t[2];var r=v0[t];return r||e}function ws(e,t){var r=Bt[e];if(!r||t==="")return e;var a=t.toLowerCase().match(/^(maj|ion|min|aeo|mix|dor|phr|lyd|loc|m)/);if(!a)return e;for(var n=a[1],i=0;i<r.modes.length;i++){var s=r.modes[i],o=s.toLowerCase().indexOf(n);if(o!==-1&&o===s.length-n.length)return s.substring(0,s.length-n.length)}return e}function xs(e,t){var r=Bt[e];if(!r)return e;for(;t<0;)t+=12;for(var a=(r.stepsFromC+t)%12,n=0;n<Object.keys(Bt).length;n++){var i=Object.keys(Bt)[n];if(Bt[i].stepsFromC===a)return i}return e}var qn={relativeMajor:ys,relativeMode:ws,transposeKey:xs,isLegalMode:bs},{relativeMajor:Cs}=qn,_t={acc:"sharp",note:"f"},Ot={acc:"sharp",note:"c"},n0={acc:"sharp",note:"g"},L0={acc:"sharp",note:"d"},cr={acc:"sharp",note:"A"},pa={acc:"sharp",note:"e"},ks={acc:"sharp",note:"B"},Oe={acc:"flat",note:"B"},Je={acc:"flat",note:"e"},dt={acc:"flat",note:"A"},i0={acc:"flat",note:"d"},lr={acc:"flat",note:"G"},va={acc:"flat",note:"c"},_s={acc:"flat",note:"F"},Ts={"C#":[_t,Ot,n0,L0,cr,pa,ks],"F#":[_t,Ot,n0,L0,cr,pa],B:[_t,Ot,n0,L0,cr],E:[_t,Ot,n0,L0],A:[_t,Ot,n0],D:[_t,Ot],G:[_t],C:[],F:[Oe],Bb:[Oe,Je],Eb:[Oe,Je,dt],Cm:[Oe,Je,dt],Ab:[Oe,Je,dt,i0],Db:[Oe,Je,dt,i0,lr],Gb:[Oe,Je,dt,i0,lr,va],Cb:[Oe,Je,dt,i0,lr,va,_s],"A#":[Oe,Je],"B#":[],"D#":[Oe,Je,dt],"E#":[Oe],"G#":[Oe,Je,dt,i0],none:[]};function Es(e){var t=Ts[Cs(e)];return t?JSON.parse(JSON.stringify(t)):null}var Wn=Es,ga=ps,Ss=Yn,hr=Wn,Z0={},Ms={C:0,"C#":1,Db:1,D:2,"D#":3,Eb:3,E:4,F:5,"F#":6,Gb:6,G:7,"G#":8,Ab:8,A:9,"A#":10,Bb:10,B:11},As=["C","Db","D","Eb","E","F","F#","G","Ab","A","Bb","B"],Bs=["C","C#","D","D#","E","F","F#","G","G#","A","Bb","B"];Z0.keySignature=function(e,t,r,a,n){if(e.clef.type==="perc"||e.clef.type==="none")return{accidentals:hr(t),root:r,acc:a};n||(n=0),e.localTransposeVerticalMovement=0,e.localTransposePreferFlats=!1;var i=hr(t);if(!i)return e.key;if(e.localTranspose=(e.globalTranspose?e.globalTranspose:0)+n,!e.localTranspose)return{accidentals:i,root:r,acc:a};if(e.globalTransposeOrigKeySig=i,e.localTranspose%12===0)return e.localTransposeVerticalMovement=e.localTranspose/12*7,{accidentals:i,root:r,acc:a};var s=t[0];t[1]==="b"||t[1]==="#"?(s+=t[1],t=t.substr(2)):t=t.substr(1);var o=Ms[s],c=o!==void 0;c||(o=0,s="C",t="");for(var f=o+e.localTranspose;f<0;)f+=12;f>11&&(f=f%12);var u=t[0]==="m"?Bs[f]:As[f],l=u+t,h=hr(l);(h.length===0||h[0].acc==="flat")&&(e.localTransposePreferFlats=!0);var d=l.charCodeAt(0)-s.charCodeAt(0);return e.localTranspose>0?(d<0||d===0&&(s[1]==="#"||l[1]==="b"))&&(d+=7):e.localTranspose<0&&(d>0||d===0&&(s[1]==="b"||l[1]==="#"))&&(d-=7),e.localTranspose>0?e.localTransposeVerticalMovement=d+Math.floor(e.localTranspose/12)*7:e.localTransposeVerticalMovement=d+Math.ceil(e.localTranspose/12)*7,c?{accidentals:h,root:u[0],acc:u.length>1?u[1]:""}:{accidentals:[],root:r,acc:a}};Z0.chordName=function(e,t){return Ss(t,e.localTranspose,e.localTransposePreferFlats,e.freegchord)};var ba=["c","d","e","f","g","a","b"];function Ns(e,t,r,a,n){for(var i=ba[(e+49)%7],s=0,o=0;o<a.length;o++)a[o].note.toLowerCase()===i&&(s=fr[a[o].acc]);for(var c=fr[r],f=c-s,u=ba[(t+49)%7],l=0,h=0;h<n.accidentals.length;h++)n.accidentals[h].note.toLowerCase()===u&&(l=fr[n.accidentals[h].acc]);var d=f+l;return d<-2&&(t--,d+=u==="c"||u==="f"?1:2),d>2&&(t++,d-=u==="b"||u==="e"?1:2),[t,d]}var fr={dblflat:-2,flat:-1,natural:0,sharp:1,dblsharp:2},Ls={"-2":"dblflat","-1":"flat",0:"natural",1:"sharp",2:"dblsharp"},Ps={"-2":"__","-1":"_",0:"=",1:"^",2:"^^"};Z0.note=function(e,t){if(!(!e.localTranspose||e.clef.type==="perc")){var r=t.pitch;if(e.localTransposeVerticalMovement&&(t.pitch=t.pitch+e.localTransposeVerticalMovement,t.name)){var a=t.accidental?t.name.substring(1):t.name,n=t.accidental?t.name[0]:"",i=ga.pitchIndex(a);t.name=n+ga.noteName(i+e.localTransposeVerticalMovement)}if(t.accidental){var s=Ns(r,t.pitch,t.accidental,e.globalTransposeOrigKeySig,e.targetKey);t.pitch=s[0],t.accidental=Ls[s[1]],t.name&&(t.name=Ps[s[1]]+t.name.replace(/[_^=]/g,""))}}};var Xn=Z0,ma=Rr,Ds=Xn,Te={};(function(){var e,t,r,a;Te.initialize=function(u,l,h,d,p){e=u,t=l,r=h,a=p},Te.standardKey=function(u,l,h,d){return Ds.keySignature(r,u,l,h,d)};var n={treble:{clef:"treble",pitch:4,mid:0},"treble+8":{clef:"treble+8",pitch:4,mid:0},"treble-8":{clef:"treble-8",pitch:4,mid:0},"treble^8":{clef:"treble+8",pitch:4,mid:0},treble_8:{clef:"treble-8",pitch:4,mid:0},treble1:{clef:"treble",pitch:2,mid:2},treble2:{clef:"treble",pitch:4,mid:0},treble3:{clef:"treble",pitch:6,mid:-2},treble4:{clef:"treble",pitch:8,mid:-4},treble5:{clef:"treble",pitch:10,mid:-6},perc:{clef:"perc",pitch:6,mid:0},none:{clef:"none",mid:0},bass:{clef:"bass",pitch:8,mid:-12},"bass+8":{clef:"bass+8",pitch:8,mid:-12},"bass-8":{clef:"bass-8",pitch:8,mid:-12},"bass^8":{clef:"bass+8",pitch:8,mid:-12},bass_8:{clef:"bass-8",pitch:8,mid:-12},"bass+16":{clef:"bass",pitch:8,mid:-12},"bass-16":{clef:"bass",pitch:8,mid:-12},"bass^16":{clef:"bass",pitch:8,mid:-12},bass_16:{clef:"bass",pitch:8,mid:-12},bass1:{clef:"bass",pitch:2,mid:-6},bass2:{clef:"bass",pitch:4,mid:-8},bass3:{clef:"bass",pitch:6,mid:-10},bass4:{clef:"bass",pitch:8,mid:-12},bass5:{clef:"bass",pitch:10,mid:-14},tenor:{clef:"alto",pitch:8,mid:-8},tenor1:{clef:"alto",pitch:2,mid:-2},tenor2:{clef:"alto",pitch:4,mid:-4},tenor3:{clef:"alto",pitch:6,mid:-6},tenor4:{clef:"alto",pitch:8,mid:-8},tenor5:{clef:"alto",pitch:10,mid:-10},alto:{clef:"alto",pitch:6,mid:-6},alto1:{clef:"alto",pitch:2,mid:-2},alto2:{clef:"alto",pitch:4,mid:-4},alto3:{clef:"alto",pitch:6,mid:-6},alto4:{clef:"alto",pitch:8,mid:-8},alto5:{clef:"alto",pitch:10,mid:-10},"alto+8":{clef:"alto+8",pitch:6,mid:-6},"alto-8":{clef:"alto-8",pitch:6,mid:-6},"alto^8":{clef:"alto+8",pitch:6,mid:-6},alto_8:{clef:"alto-8",pitch:6,mid:-6}},i=function(u,l){var h=n[u],d=h?h.mid:0;return d+l};Te.fixClef=function(u){var l=n[u.type];l&&(u.clefPos=l.pitch,u.type=l.clef)},Te.deepCopyKey=function(u){var l={accidentals:[],root:u.root,acc:u.acc,mode:u.mode};return u.accidentals.forEach(function(h){l.accidentals.push(Object.assign({},h))}),l};var s={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11};Te.addPosToKey=function(u,l){var h=u.verticalPos;l.accidentals.forEach(function(d){var p=s[d.note];p=p-h,d.verticalPos=p}),l.impliedNaturals&&l.impliedNaturals.forEach(function(d){var p=s[d.note];p=p-h,d.verticalPos=p}),h<-10?(l.accidentals.forEach(function(d){d.verticalPos-=7,(d.verticalPos>=11||d.verticalPos===10&&d.acc==="flat")&&(d.verticalPos-=7),d.note==="A"&&d.acc==="sharp"&&(d.verticalPos-=7),(d.note==="G"||d.note==="F")&&d.acc==="flat"&&(d.verticalPos-=7)}),l.impliedNaturals&&l.impliedNaturals.forEach(function(d){d.verticalPos-=7,(d.verticalPos>=11||d.verticalPos===10&&d.acc==="flat")&&(d.verticalPos-=7),d.note==="A"&&d.acc==="sharp"&&(d.verticalPos-=7),(d.note==="G"||d.note==="F")&&d.acc==="flat"&&(d.verticalPos-=7)})):h<-4?(l.accidentals.forEach(function(d){d.verticalPos-=7,h===-8&&(d.note==="f"||d.note==="g")&&d.acc==="sharp"&&(d.verticalPos-=7)}),l.impliedNaturals&&l.impliedNaturals.forEach(function(d){d.verticalPos-=7,h===-8&&(d.note==="f"||d.note==="g")&&d.acc==="sharp"&&(d.verticalPos-=7)})):h>=7&&(l.accidentals.forEach(function(d){d.verticalPos+=7}),l.impliedNaturals&&l.impliedNaturals.forEach(function(d){d.verticalPos+=7}))},Te.fixKey=function(u,l){var h=Object.assign({},l);return Te.addPosToKey(u,h),h};var o=function(u){var l=0,h=u[l++];(h==="^"||h==="_")&&(h=u[l++]);var d=s[h];for(d===void 0&&(d=6);l<u.length;l++)if(u[l]===",")d-=7;else if(u[l]==="'")d+=7;else break;return{mid:d-6,str:u.substring(l)}},c=function(u){for(var l=0;l<u.length;l++)u[l].note==="b"?u[l].note="B":u[l].note==="a"?u[l].note="A":u[l].note==="F"?u[l].note="f":u[l].note==="E"?u[l].note="e":u[l].note==="D"?u[l].note="d":u[l].note==="C"?u[l].note="c":u[l].note==="G"&&u[l].acc==="sharp"?u[l].note="g":u[l].note==="g"&&u[l].acc==="flat"&&(u[l].note="G")};Te.parseKey=function(u,l){u.length===0&&(u="none");var h=e.tokenize(u,0,u.length),d={};if(h.length===0)return t("Must pass in key signature.",u,0),d;switch(h[0].token){case"HP":ma.addDirective("bagpipes"),r.key={root:"HP",accidentals:[],acc:"",mode:""},d.foundKey=!0,h.shift();break;case"Hp":ma.addDirective("bagpipes"),r.key={root:"Hp",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}],acc:"",mode:""},d.foundKey=!0,h.shift();break;case"none":r.key={root:"none",accidentals:[],acc:"",mode:""},d.foundKey=!0,h.shift();break;default:var p=e.getKeyPitch(h[0].token);if(p.len>0){d.foundKey=!0;var g="",v="";h[0].token.length>1?h[0].token=h[0].token.substring(1):h.shift();var m=p.token;if(h.length>0){var y=e.getSharpFlat(h[0].token);if(y.len>0&&(h[0].token.length>1?h[0].token=h[0].token.substring(1):h.shift(),m+=y.token,g=y.token),h.length>0){var x=e.getMode(h[0].token);x.len>0&&(h.shift(),m+=x.token,v=x.token)}if(Te.standardKey(m,p.token,g,0)===void 0)return t("Unsupported key signature: "+m,u,0),d}var b=Te.deepCopyKey(r.key),w=!l&&r.globalTranspose?-r.globalTranspose:0,C;if(l&&(C=r.globalTransposeOrigKeySig),r.key=Te.deepCopyKey(Te.standardKey(m,p.token,g,w)),l&&(r.globalTransposeOrigKeySig=C),r.key.mode=v,b&&r.keywarn!==!1){for(var T,B=0;B<r.key.accidentals.length;B++)for(T=0;T<b.accidentals.length;T++)b.accidentals[T].note&&r.key.accidentals[B].note.toLowerCase()===b.accidentals[T].note.toLowerCase()&&(b.accidentals[T].note=null);for(T=0;T<b.accidentals.length;T++)b.accidentals[T].note&&(r.key.impliedNaturals||(r.key.impliedNaturals=[]),r.key.impliedNaturals.push({acc:"natural",note:b.accidentals[T].note}))}}break}if(h.length===0||(h[0].token==="exp"&&h.shift(),h.length===0)||(h[0].token==="oct"&&h.shift(),h.length===0))return d;var E=e.getKeyAccidentals2(h);if(E.warn&&t(E.warn,u,0),E.accs){d.foundKey||(d.foundKey=!0,r.key={root:"none",acc:"",mode:"",accidentals:[]}),c(E.accs);for(var z=0;z<E.accs.length;z++){for(var F=!1,O=0;O<r.key.accidentals.length&&!F;O++)r.key.accidentals[O].note===E.accs[z].note&&(F=!0,r.key.accidentals[O].acc!==E.accs[z].acc&&(r.key.accidentals[O].acc=E.accs[z].acc,r.key.explicitAccidentals||(r.key.explicitAccidentals=[]),r.key.explicitAccidentals.push(E.accs[z])));if(!F&&(r.key.explicitAccidentals||(r.key.explicitAccidentals=[]),r.key.explicitAccidentals.push(E.accs[z]),r.key.accidentals.push(E.accs[z]),r.key.impliedNaturals))for(var R=0;R<r.key.impliedNaturals.length;R++)r.key.impliedNaturals[R].note===E.accs[z].note&&r.key.impliedNaturals.splice(R,1)}}for(var Y;h.length>0;)switch(h[0].token){case"m":case"middle":if(h.shift(),h.length===0)return t("Expected = after middle",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after middle",u,Y.start);break}if(h.length===0)return t("Expected parameter after middle=",u,0),d;var K=e.getPitchFromTokens(h);K.warn&&t(K.warn,u,0),K.position&&(r.clef.verticalPos=K.position-6);break;case"transpose":if(h.shift(),h.length===0)return t("Expected = after transpose",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after transpose",u,Y.start);break}if(h.length===0)return t("Expected parameter after transpose=",u,0),d;if(h[0].type!=="number"){t("Expected number after transpose",u,h[0].start);break}r.clef.transpose=h[0].intt,h.shift();break;case"stafflines":if(h.shift(),h.length===0)return t("Expected = after stafflines",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after stafflines",u,Y.start);break}if(h.length===0)return t("Expected parameter after stafflines=",u,0),d;if(h[0].type!=="number"){t("Expected number after stafflines",u,h[0].start);break}r.clef.stafflines=h[0].intt,h.shift();break;case"staffscale":if(h.shift(),h.length===0)return t("Expected = after staffscale",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after staffscale",u,Y.start);break}if(h.length===0)return t("Expected parameter after staffscale=",u,0),d;if(h[0].type!=="number"){t("Expected number after staffscale",u,h[0].start);break}r.clef.staffscale=h[0].floatt,h.shift();break;case"octave":if(h.shift(),h.length===0)return t("Expected = after octave",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after octave",u,Y.start);break}if(h.length===0)return t("Expected parameter after octave=",u,0),d;if(h[0].type!=="number"){t("Expected number after octave",u,h[0].start);break}r.octave=h[0].intt,h.shift();break;case"style":if(h.shift(),h.length===0)return t("Expected = after style",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after style",u,Y.start);break}if(h.length===0)return t("Expected parameter after style=",u,0),d;switch(h[0].token){case"normal":case"harmonic":case"rhythm":case"x":case"triangle":r.style=h[0].token,h.shift();break;default:t("error parsing style element: "+h[0].token,u,h[0].start);break}break;case"clef":if(h.shift(),h.length===0)return t("Expected = after clef",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after clef",u,Y.start);break}if(h.length===0)return t("Expected parameter after clef=",u,0),d;case"treble":case"bass":case"alto":case"tenor":case"perc":case"none":var P=h.shift();switch(P.token){case"treble":case"tenor":case"alto":case"bass":case"perc":case"none":break;case"C":P.token="alto";break;case"F":P.token="bass";break;case"G":P.token="treble";break;case"c":P.token="alto";break;case"f":P.token="bass";break;case"g":P.token="treble";break;default:t("Expected clef name. Found "+P.token,u,P.start);break}h.length>0&&h[0].type==="number"&&(P.token+=h[0].token,h.shift()),h.length>1&&(h[0].token==="-"||h[0].token==="+"||h[0].token==="^"||h[0].token==="_")&&h[1].token==="8"&&(P.token+=h[0].token+h[1].token,h.shift(),h.shift()),r.clef={type:P.token,verticalPos:i(P.token,0)},r.currentVoice&&r.currentVoice.transpose!==void 0&&(r.clef.transpose=r.currentVoice.transpose),d.foundClef=!0;break;default:t("Unknown parameter: "+h[0].token,u,h[0].start),h.shift()}return d};var f=function(u){var l=r.voices[u];if(!(r.currentVoice&&r.currentVoice.index===l.index&&r.currentVoice.staffNum===l.staffNum))return r.currentVoice=l,a.setCurrentVoice(l.staffNum,l.index,u)};Te.parseVoice=function(u,l,h){var d=e.getMeat(u,l,h),p=d.start,g=d.end,v=e.getToken(u,p,g);if(v.length===0){t("Expected a voice id",u,p);return}var m=!1;r.voices[v]===void 0&&(r.voices[v]={},m=!0,r.score_is_present&&t("Can't have an unknown V: id when the %score directive is present",u,p)),p+=v.length,p+=e.eatWhiteSpace(u,p);for(var y={startStaff:m},x=function(K){var P=e.getVoiceToken(u,p,g);P.warn!==void 0?t("Expected value for "+K+" in voice: "+P.warn,u,p):P.err!==void 0?t("Expected value for "+K+" in voice: "+P.err,u,p):P.token.length===0&&u[p]!=='"'?t("Expected value for "+K+" in voice",u,p):y[K]=P.token,p+=P.len},b=function(K,P,k){var _=e.getVoiceToken(u,p,g);_.warn!==void 0?t("Expected value for "+P+" in voice: "+_.warn,u,p):_.err!==void 0?t("Expected value for "+P+" in voice: "+_.err,u,p):_.token.length===0&&u[p]!=='"'?t("Expected value for "+P+" in voice",u,p):(_.token=parseFloat(_.token),r.voices[K][P]=_.token),p+=_.len},w=function(K,P){var k=e.getVoiceToken(u,p,g);if(k.warn!==void 0)t("Expected value for "+K+" in voice: "+k.warn,u,p);else if(k.err!==void 0)t("Expected value for "+K+" in voice: "+k.err,u,p);else if(k.token.length===0&&u[p]!=='"')t("Expected value for "+K+" in voice",u,p);else return k.token;p+=k.len},C=function(K,P){var k={_B:2,_E:9,_b:-10,_e:-3},_=e.getVoiceToken(u,p,g);if(_.warn!==void 0)t("Expected one of (_B, _E, _b, _e) for "+P+" in voice: "+_.warn,u,p);else if(_.token.length===0&&u[p]!=='"')t("Expected one of (_B, _E, _b, _e) for "+P+" in voice",u,p);else{var L=k[_.token];L?r.voices[K][P]=L:t("Expected one of (_B, _E, _b, _e) for "+P+" in voice",u,p)}p+=_.len};p<g;){var T=e.getVoiceToken(u,p,g);if(p+=T.len,T.warn)t("Error parsing voice: "+T.warn,u,p);else{var B=null;switch(T.token){case"clef":case"cl":x("clef");var E=0;y.clef!==void 0&&(y.clef=y.clef.replace(/[',]/g,""),y.clef.indexOf("+16")!==-1&&(E+=14,y.clef=y.clef.replace("+16","")),y.verticalPos=i(y.clef,E));break;case"treble":case"bass":case"tenor":case"alto":case"perc":case"none":case"treble'":case"bass'":case"tenor'":case"alto'":case"none'":case"treble''":case"bass''":case"tenor''":case"alto''":case"none''":case"treble,":case"bass,":case"tenor,":case"alto,":case"none,":case"treble,,":case"bass,,":case"tenor,,":case"alto,,":case"none,,":case"treble+8":case"treble-8":case"treble^8":case"treble_8":case"treble1":case"treble2":case"treble3":case"treble4":case"treble5":case"bass+8":case"bass-8":case"bass^8":case"bass_8":case"bass+16":case"bass-16":case"bass^16":case"bass_16":case"bass1":case"bass2":case"bass3":case"bass4":case"bass5":case"tenor1":case"tenor2":case"tenor3":case"tenor4":case"tenor5":case"alto1":case"alto2":case"alto3":case"alto4":case"alto5":case"alto+8":case"alto-8":case"alto^8":case"alto_8":var z=0;y.clef=T.token.replace(/[',]/g,""),y.verticalPos=i(y.clef,z),r.voices[v].clef=T.token;break;case"staves":case"stave":case"stv":x("staves");break;case"brace":case"brc":x("brace");break;case"bracket":case"brk":x("bracket");break;case"name":case"nm":x("name");break;case"subname":case"sname":case"snm":x("subname");break;case"merge":y.startStaff=!1;break;case"stem":case"stems":B=e.getVoiceToken(u,p,g),B.warn!==void 0?t("Expected value for stems in voice: "+B.warn,u,p):B.err!==void 0?t("Expected value for stems in voice: "+B.err,u,p):B.token==="up"||B.token==="down"?r.voices[v].stem=B.token:t("Expected up or down for voice stem",u,p),p+=B.len;break;case"up":case"down":r.voices[v].stem=T.token;break;case"middle":case"m":x("verticalPos"),y.verticalPos=o(y.verticalPos).mid;break;case"gchords":case"gch":r.voices[v].suppressChords=!0,B=e.getVoiceToken(u,p,g),B.token==="0"&&(p=p+B.len);break;case"space":case"spc":x("spacing");break;case"scale":b(v,"scale");break;case"score":C(v,"scoreTranspose");break;case"transpose":b(v,"transpose");break;case"stafflines":b(v,"stafflines");break;case"staffscale":b(v,"staffscale");break;case"octave":b(v,"octave");break;case"volume":b(v,"volume");break;case"cue":var F=w("cue");F==="on"?r.voices[v].scale=.6:r.voices[v].scale=1;break;case"style":B=e.getVoiceToken(u,p,g),B.warn!==void 0?t("Expected value for style in voice: "+B.warn,u,p):B.err!==void 0?t("Expected value for style in voice: "+B.err,u,p):B.token==="normal"||B.token==="harmonic"||B.token==="rhythm"||B.token==="x"||B.token==="triangle"?r.voices[v].style=B.token:t("Expected one of [normal, harmonic, rhythm, x, triangle] for voice style",u,p),p+=B.len;break}}p+=e.eatWhiteSpace(u,p)}if((y.startStaff||r.staves.length===0)&&(r.staves.push({index:r.staves.length,meter:r.origMeter}),r.score_is_present||(r.staves[r.staves.length-1].numVoices=0)),r.voices[v].staffNum===void 0){r.voices[v].staffNum=r.staves.length-1;var O=0;for(var R in r.voices)r.voices.hasOwnProperty(R)&&r.voices[R].staffNum===r.voices[v].staffNum&&O++;r.voices[v].index=O-1}var Y=r.staves[r.voices[v].staffNum];return r.score_is_present||Y.numVoices++,y.clef&&(Y.clef={type:y.clef,verticalPos:y.verticalPos}),y.spacing&&(Y.spacing_below_offset=y.spacing),y.verticalPos&&(Y.verticalPos=y.verticalPos),y.name&&(Y.name?Y.name.push(y.name):Y.name=[y.name]),y.subname&&(Y.subname?Y.subname.push(y.subname):Y.subname=[y.subname]),f(v)}})();var Yr=Te,P0=rt,Ze=Rr,et=Yr,Is=function(e,t,r,a,n){this.reset=function(o,c,f,u){et.initialize(o,c,f,u,n),Ze.initialize(o,c,f,u,n)},this.reset(e,t,r,a),this.setTitle=function(o,c){r.hasMainTitle?n.addSubtitle(o,{startChar:r.iChar,endChar:r.iChar+c+2}):(n.addMetaText("title",o,{startChar:r.iChar,endChar:r.iChar+c+2}),r.hasMainTitle=!0)},this.setMeter=function(o){if(o=e.stripComment(o),o==="C")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"common_time"};if(o==="C|")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"cut_time"};if(o==="o")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"tempus_perfectum"};if(o==="c")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"tempus_imperfectum"};if(o==="o.")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"tempus_perfectum_prolatio"};if(o==="c.")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"tempus_imperfectum_prolatio"};if(o.length===0||o.toLowerCase()==="none")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),null;var c=e.tokenize(o,0,o.length);try{var f=function(){var g={value:0,num:""},v=c.shift();for(v.token==="("&&(v=c.shift());;){if(v.type!=="number")throw"Expected top number of meter";if(g.value+=parseInt(v.token),g.num+=v.token,c.length===0||c[0].token==="/")return g;if(v=c.shift(),v.token===")"){if(c.length===0||c[0].token==="/")return g;throw"Unexpected paren in meter"}if(v.token!=="."&&v.token!=="+"||(g.num+=v.token,c.length===0))throw"Expected top number of meter";v=c.shift()}return g},u=function(){var g=f();if(c.length===0)return g;var v=c.shift();if(v.token!=="/")throw"Expected slash in meter";if(v=c.shift(),v.type!=="number")throw"Expected bottom number of meter";return g.den=v.token,g.value=g.value/parseInt(g.den),g};if(c.length===0)throw"Expected meter definition in M: line";for(var l={type:"specified",value:[]},h=0;;){var d=u();h+=d.value;var p={num:d.num};if(d.den!==void 0&&(p.den=d.den),l.value.push(p),c.length===0)break}return r.havent_set_length===!0&&(r.default_length=h<.75?.0625:.125,r.havent_set_length=!1),l}catch(g){t(g,o,0)}return null},this.calcTempo=function(o){var c=.25;r.meter&&r.meter.type==="specified"?c=1/parseInt(r.meter.value[0].den):r.origMeter&&r.origMeter.type==="specified"&&(c=1/parseInt(r.origMeter.value[0].den));for(var f=0;f<o.duration;f++)o.duration[f]=c*o.duration[f];return o},this.resolveTempo=function(){r.tempo&&(this.calcTempo(r.tempo),a.metaText.tempo=r.tempo,delete r.tempo)},this.addUserDefinition=function(o,c,f){var u=o.indexOf("=",c);if(u===-1){t("Need an = in a macro definition",o,c);return}var l=P0.strip(o.substring(c,u)),h=P0.strip(o.substring(u+1));if(l.length!==1){t("Macro definitions can only be one character",o,c);return}var d="HIJKLMNOPQRSTUVWXYhijklmnopqrstuvw~";if(d.indexOf(l)===-1){t("Macro definitions must be H-Y, h-w, or tilde",o,c);return}if(h.length===0){t("Missing macro definition",o,c);return}r.macros===void 0&&(r.macros={}),r.macros[l]=h},this.setDefaultLength=function(o,c,f){var u=o.substring(c,f).replace(/ /g,""),l=u.split("/");if(l.length===2){var h=parseInt(l[0]),d=parseInt(l[1]);d>0&&(r.default_length=h/d,r.havent_set_length=!1)}else l.length===1&&l[0]==="1"&&(r.default_length=1,r.havent_set_length=!1)};var i={larghissimo:20,adagissimo:24,sostenuto:28,grave:32,largo:40,lento:50,larghetto:60,adagio:68,adagietto:74,andante:80,andantino:88,"marcia moderato":84,"andante moderato":100,moderato:112,allegretto:116,"allegro moderato":120,allegro:126,animato:132,agitato:140,veloce:148,"mosso vivo":156,vivace:164,vivacissimo:172,allegrissimo:176,presto:184,prestissimo:210};this.setTempo=function(o,c,f,u){try{var l=e.tokenize(o,c,f);if(l.length===0)throw"Missing parameter in Q: field";var h={startChar:u+c-2,endChar:u+f},d=!0,p=l.shift();if(p.type==="quote"&&(h.preString=p.token,p=l.shift(),l.length===0))return i[h.preString.toLowerCase()]&&(h.bpm=i[h.preString.toLowerCase()],h.suppressBpm=!0),{type:"immediate",tempo:h};if(p.type==="alpha"&&p.token==="C"){if(l.length===0)throw"Missing tempo after C in Q: field";if(p=l.shift(),p.type==="punct"&&p.token==="="){if(l.length===0)throw"Missing tempo after = in Q: field";if(p=l.shift(),p.type!=="number")throw"Expected number after = in Q: field";h.duration=[1],h.bpm=parseInt(p.token)}else if(p.type==="number"){if(h.duration=[parseInt(p.token)],l.length===0)throw"Missing = after duration in Q: field";if(p=l.shift(),p.type!=="punct"||p.token!=="=")throw"Expected = after duration in Q: field";if(l.length===0)throw"Missing tempo after = in Q: field";if(p=l.shift(),p.type!=="number")throw"Expected number after = in Q: field";h.bpm=parseInt(p.token)}else throw"Expected number or equal after C in Q: field"}else if(p.type==="number"){var g=parseInt(p.token);if(l.length===0||l[0].type==="quote")h.duration=[1],h.bpm=g;else{if(d=!1,p=l.shift(),p.type!=="punct"&&p.token!=="/"||(p=l.shift(),p.type!=="number"))throw"Expected fraction in Q: field";var v=parseInt(p.token);for(h.duration=[g/v];l.length>0&&l[0].token!=="="&&l[0].type!=="quote";){if(p=l.shift(),p.type!=="number"||(g=parseInt(p.token),p=l.shift(),p.type!=="punct"&&p.token!=="/")||(p=l.shift(),p.type!=="number"))throw"Expected fraction in Q: field";v=parseInt(p.token),h.duration.push(g/v)}if(p=l.shift(),p.type!=="punct"&&p.token!=="=")throw"Expected = in Q: field";if(p=l.shift(),p.type!=="number")throw"Expected tempo in Q: field";h.bpm=parseInt(p.token)}}else throw"Unknown value in Q: field";if(l.length!==0&&(p=l.shift(),p.type==="quote"&&(h.postString=p.token,p=l.shift()),l.length!==0))throw"Unexpected string at end of Q: field";return r.printTempo===!1&&(h.suppress=!0),{type:d?"delaySet":"immediate",tempo:h}}catch(m){return t(m,o,c),{type:"none"}}},this.letter_to_inline_header=function(o,c,f){var u=!1,l=e.eatWhiteSpace(o,c);if(c+=l,o.length>=c+5&&o[c]==="["&&o[c+2]===":"){var h=o.indexOf("]",c),d=r.iChar+c,p=r.iChar+h+1;switch(o.substring(c,c+3)){case"[I:":var g=Ze.addDirective(o.substring(c+3,h));return g&&t(g,o,c),[h-c+1+l];case"[M:":var v=this.setMeter(o.substring(c+3,h));return n.hasBeginMusic()&&v?n.appendStartingElement("meter",d,p,v):r.meter=v,[h-c+1+l];case"[K:":var m=et.parseKey(o.substring(c+3,h),!0);return m.foundClef&&n.hasBeginMusic()&&n.appendStartingElement("clef",d,p,r.clef),m.foundKey&&n.hasBeginMusic()&&n.appendStartingElement("key",d,p,et.fixKey(r.clef,r.key)),[h-c+1+l];case"[P:":var y=Ze.parseFontChangeLine(o.substring(c+3,h));return f||a.lines.length<=a.lineNum?r.partForNextLine={title:y,startChar:d,endChar:p}:n.appendElement("part",d,p,{title:y}),[h-c+1+l];case"[L:":return this.setDefaultLength(o,c+3,h),[h-c+1+l];case"[Q:":if(h>0){var x=this.setTempo(o,c+3,h,r.iChar);return x.type==="delaySet"?n.hasBeginMusic()?n.appendElement("tempo",d,p,this.calcTempo(x.tempo)):r.tempoForNextLine=["tempo",d,p,this.calcTempo(x.tempo)]:x.type==="immediate"&&(!f&&n.hasBeginMusic()?n.appendElement("tempo",d,p,x.tempo):r.tempoForNextLine=["tempo",d,p,x.tempo]),[h-c+1+l,o[c+1],o.substring(c+3,h)]}break;case"[V:":if(h>0)return u=et.parseVoice(o,c+3,h),[h-c+1+l,o[c+1],o.substring(c+3,h),u];break;case"[r:":return[h-c+1+l]}}return[0]},this.letter_to_body_header=function(o,c){var f=!1;if(o.length>=c+3)switch(o.substring(c,c+2)){case"I:":var u=Ze.addDirective(o.substring(c+2));return u&&t(u,o,c),[o.length];case"M:":var l=this.setMeter(o.substring(c+2));return n.hasBeginMusic()&&l&&n.appendStartingElement("meter",r.iChar+c,r.iChar+o.length,l),[o.length];case"K:":var h=et.parseKey(o.substring(c+2),n.hasBeginMusic());return h.foundClef&&n.hasBeginMusic()&&r.keywarn!==!1&&n.appendStartingElement("clef",r.iChar+c,r.iChar+o.length,r.clef),h.foundKey&&n.hasBeginMusic()&&r.keywarn!==!1&&n.appendStartingElement("key",r.iChar+c,r.iChar+o.length,et.fixKey(r.clef,r.key)),[o.length];case"P:":return n.hasBeginMusic()&&n.appendElement("part",r.iChar+c,r.iChar+o.length,{title:o.substring(c+2)}),[o.length];case"L:":return this.setDefaultLength(o,c+2,o.length),[o.length];case"Q:":var d=o.indexOf("",c+2);d===-1&&(d=o.length);var p=this.setTempo(o,c+2,d,r.iChar);return p.type==="delaySet"?n.appendElement("tempo",r.iChar+c,r.iChar+o.length,this.calcTempo(p.tempo)):p.type==="immediate"&&n.appendElement("tempo",r.iChar+c,r.iChar+o.length,p.tempo),[d,o[c],P0.strip(o.substring(c+2))];case"V:":return f=et.parseVoice(o,c+2,o.length),[o.length,o[c],P0.strip(o.substring(c+2)),f]}return[0]};var s={A:"author",B:"book",C:"composer",D:"discography",F:"url",G:"group",I:"instruction",N:"notes",O:"origin",R:"rhythm",S:"source",W:"unalignedWords",Z:"transcription"};this.parseHeader=function(o){var c=s[o[0]],f=o.length-2,u=e.translateString(e.stripComment(o.substring(2)));if(c==="unalignedWords"||c==="notes")n.addMetaTextArray(c,Ze.parseFontChangeLine(u),{startChar:r.iChar,endChar:r.iChar+o.length});else if(c!==void 0)n.addMetaText(c,Ze.parseFontChangeLine(u),{startChar:r.iChar,endChar:r.iChar+o.length});else{var l=r.iChar,h=l+o.length;switch(o[0]){case"H":for(n.addMetaTextArray("history",Ze.parseFontChangeLine(u),{startChar:r.iChar,endChar:r.iChar+o.length}),o=e.peekLine();o&&o[1]!==":";)e.nextLine(),n.addMetaTextArray("history",Ze.parseFontChangeLine(e.translateString(e.stripComment(o))),{startChar:r.iChar,endChar:r.iChar+o.length}),o=e.peekLine();break;case"K":this.resolveTempo();var d=et.parseKey(o.substring(2),!1);!r.is_in_header&&n.hasBeginMusic()&&r.keywarn!==!1&&(d.foundClef&&n.appendStartingElement("clef",l,h,r.clef),d.foundKey&&n.appendStartingElement("key",l,h,et.fixKey(r.clef,r.key))),r.is_in_header=!1;break;case"L":this.setDefaultLength(o,2,o.length);break;case"M":r.origMeter=r.meter=this.setMeter(o.substring(2));break;case"P":r.is_in_header?n.addMetaText("partOrder",Ze.parseFontChangeLine(u),{startChar:r.iChar,endChar:r.iChar+o.length}):r.partForNextLine={title:u,startChar:l,endChar:h};break;case"Q":var p=this.setTempo(o,2,o.length,r.iChar);p.type==="delaySet"?r.tempo=p.tempo:p.type==="immediate"&&(a.metaText.tempo?r.tempoForNextLine=["tempo",l,h,p.tempo]:a.metaText.tempo=p.tempo);break;case"T":r.titlecaps&&(u=u.toUpperCase()),this.setTitle(Ze.parseFontChangeLine(e.theReverser(u)),f);break;case"U":this.addUserDefinition(o,2,o.length);break;case"V":if(et.parseVoice(o,2,o.length),!r.is_in_header)return{newline:!0};break;case"s":return{symbols:!0};case"w":return{words:!0};case"X":break;case"E":case"m":t("Ignored header",o,0);break;default:return{regular:!0}}}return{}}},Fs=Is,$e={};$e.legalAccents=["trill","trillh","lowermordent","uppermordent","mordent","pralltriller","accent","fermata","invertedfermata","tenuto","0","1","2","3","4","5","+","wedge","open","thumb","snap","turn","roll","breath","shortphrase","mediumphrase","longphrase","segno","coda","D.S.","D.C.","fine","beambr1","beambr2","slide","marcato","upbow","downbow","/","//","///","////","trem1","trem2","trem3","trem4","turnx","invertedturn","invertedturnx","trill(","trill)","arpeggio","xstem","mark","umarcato","style=normal","style=harmonic","style=rhythm","style=x","style=triangle","D.C.alcoda","D.C.alfine","D.S.alcoda","D.S.alfine","editorial","courtesy"];$e.volumeDecorations=["p","pp","f","ff","mf","mp","ppp","pppp","fff","ffff","sfz"];$e.dynamicDecorations=["crescendo(","crescendo)","diminuendo(","diminuendo)","glissando(","glissando)","~(","~)"];$e.accentPseudonyms=[["<","accent"],[">","accent"],["tr","trill"],["plus","+"],["emphasis","accent"],["^","umarcato"],["marcato","umarcato"]];$e.accentDynamicPseudonyms=[["<(","crescendo("],["<)","crescendo)"],[">(","diminuendo("],[">)","diminuendo)"]];$e.nonDecorations="ABCDEFGabcdefgxyzZ[]|^_{";$e.durations=[.5,.75,.875,.9375,.96875,.984375,.25,.375,.4375,.46875,.484375,.4921875,.125,.1875,.21875,.234375,.2421875,.24609375,.0625,.09375,.109375,.1171875,.12109375,.123046875,.03125,.046875,.0546875,.05859375,.060546875,.0615234375,.015625,.0234375,.02734375,.029296875,.0302734375,.03076171875];$e.pitches={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11};$e.rests={x:"invisible",X:"invisible-multimeasure",y:"spacer",z:"rest",Z:"multimeasure"};$e.accMap={dblflat:"__",flat:"_",natural:"=",sharp:"^",dblsharp:"^^",quarterflat:"_/",quartersharp:"^/"};$e.tripletQ={2:3,3:2,4:3,5:2,6:2,7:2,8:3,9:2};var ya=Yr,Un=Xn,fe,be,S,Ue,We,p0,{legalAccents:wa,volumeDecorations:xa,dynamicDecorations:Ca,accentPseudonyms:ka,accentDynamicPseudonyms:_a,nonDecorations:Os,durations:Hs,pitches:zs,rests:$s,accMap:Ta,tripletQ:Rs}=$e,qr=function(e,t,r,a,n,i){fe=e,be=t,S=r,Ue=a,We=n,p0=i,this.lineContinuation=!1},Ea=function(e,t,r){if(e.inTie[t]===void 0)return!1;var a=e.currentVoice?e.currentVoice.staffNum*100+e.currentVoice.index:0;return!!(e.inTie[t][a]&&(r.pitches!==void 0||r.rest.type!=="spacer"))},H={};qr.prototype.parseMusic=function(e){p0.resolveTempo(),S.is_in_header=!1;for(var t=0,r=S.iChar;fe.isWhiteSpace(e[t])&&t<e.length;)t++;if(!(t===e.length||e[t]==="%")){var a=S.start_new_line;S.continueall===void 0?S.start_new_line=!0:S.start_new_line=!1;var n=0,i=p0.letter_to_body_header(e,t);i[0]>0&&(t+=i[0],i[1]==="V"&&this.startNewLine());for(var s=0;t<e.length;){var o=t;if(e[t]==="%")break;var c=p0.letter_to_inline_header(e,t,a);if(c[0]>0)t+=c[0],c[1]==="V"&&(a=!0);else{(!We.hasBeginMusic()||a&&!this.lineContinuation)&&(this.startNewLine(),a=!1);for(var f;;)if(f=fe.eatWhiteSpace(e,t),f>0&&(t+=f),t>0&&e[t-1]===""&&(f=p0.letter_to_body_header(e,t),f[0]>0&&(f[1]==="V"&&this.startNewLine(),t=f[0],S.start_new_line=!1)),f=Ws(e,t),f[0]>0&&(t+=f[0]),f=Gs(e,t),f[0]>0){H.chord||(H.chord=[]);var u=fe.translateString(f[1]);u=u.replace(/;/g,`
3
+ `;V=e.nextLine()}i.addText(Z,{startChar:r.iChar,endChar:r.iChar+Z.length+7});break;case"continueall":r.continueall=!0;break;case"beginps":for(V=e.nextLine();V&&V.indexOf("%%endps")!==0;)e.nextLine();t("Postscript ignored",k,0);break;case"deco":L.length>0&&r.ignoredDecorations.push(L.substring(0,L.indexOf(" "))),t("Decoration redefinition ignored",k,0);break;case"text":var ce=e.translateString(L);i.addText(At.parseFontChangeLine(ce),{startChar:r.iChar,endChar:r.iChar+L.length+7});break;case"center":var Ae=e.translateString(L);i.addCentered(At.parseFontChangeLine(Ae));break;case"font":break;case"setfont":var ke=e.tokenize(L,0,L.length);if(ke.length>=4&&ke[0].token==="-"&&ke[1].type==="number"){var _e=parseInt(ke[1].token);_e>=1&&_e<=9&&(r.setfont||(r.setfont=[]),ke.shift(),ke.shift(),r.setfont[_e]=o(ke,r.setfont[_e],k,0,"setfont"))}break;case"gchordfont":case"partsfont":case"tripletfont":case"vocalfont":case"textfont":case"annotationfont":case"historyfont":case"infofont":case"measurefont":case"repeatfont":case"wordsfont":return f(A,_,k);case"composerfont":case"subtitlefont":case"tempofont":case"titlefont":case"voicefont":case"footerfont":case"headerfont":return u(A,_,k);case"barlabelfont":case"barnumberfont":case"barnumfont":return f("measurefont",_,k);case"staves":case"score":r.score_is_present=!0;for(var xt=function(a0,is,fa,ua,ns){(is||r.staves.length===0)&&r.staves.push({index:r.staves.length,numVoices:0});var ut=da.last(r.staves);fa!==void 0&&ut.bracket===void 0&&(ut.bracket=fa),ua!==void 0&&ut.brace===void 0&&(ut.brace=ua),ns&&(ut.connectBarLines="end"),r.voices[a0]===void 0&&(r.voices[a0]={staffNum:ut.index,index:ut.numVoices},ut.numVoices++)},M=!1,O=!1,N=!1,D=!1,$=!1,W=!1,J=!1,ee,j=function(){if(J=!0,ee){var a0="start";ee.staffNum>0&&(r.staves[ee.staffNum-1].connectBarLines==="start"||r.staves[ee.staffNum-1].connectBarLines==="continue")&&(a0="continue"),r.staves[ee.staffNum].connectBarLines=a0}};_.length;){var X=_.shift();switch(X.token){case"(":M?t("Can't nest parenthesis in %%score",k,X.start):(M=!0,D=!0);break;case")":!M||D?t("Unexpected close parenthesis in %%score",k,X.start):M=!1;break;case"[":O?t("Can't nest brackets in %%score",k,X.start):(O=!0,$=!0);break;case"]":!O||$?t("Unexpected close bracket in %%score",k,X.start):(O=!1,r.staves[ee.staffNum].bracket="end");break;case"{":N?t("Can't nest braces in %%score",k,X.start):(N=!0,W=!0);break;case"}":!N||W?t("Unexpected close brace in %%score",k,X.start):(N=!1,r.staves[ee.staffNum].brace="end");break;case"|":j();break;default:for(var re="";(X.type==="alpha"||X.type==="number")&&(re+=X.token,X.continueId);)X=_.shift();var se=!M||D,U=$?"start":O?"continue":void 0,ne=W?"start":N?"continue":void 0;xt(re,se,U,ne,J),D=!1,$=!1,W=!1,J=!1,ee=r.voices[re],A==="staves"&&j();break}}break;case"maxstaves":var he=e.getInt(L);he.digits===0?t("Expected number of staves in maxstaves"):he.value>0&&(a.formatting.maxStaves=he.value);break;case"newpage":var ae=e.getInt(L);i.addNewPage(ae.digits===0?-1:ae.value);break;case"abc":var Fe=L.split(" ");switch(Fe[0]){case"-copyright":case"-creator":case"-edited-by":case"-version":case"-charset":var Ft=Fe.shift();i.addMetaText(A+Ft,Fe.join(" "),{startChar:r.iChar,endChar:r.iChar+L.length+5});break;default:return"Unknown directive: "+A+Fe[0]}break;case"header":case"footer":var ye=e.getMeat(L,0,L.length);ye=L.substring(ye.start,ye.end),ye[0]==='"'&&ye[ye.length-1]==='"'&&(ye=ye.substring(1,ye.length-1));var Be=ye.split(" "),Ct={};Be.length===1?Ct={left:"",center:Be[0],right:""}:Be.length===2?Ct={left:Be[0],center:Be[1],right:""}:Ct={left:Be[0],center:Be[1],right:Be[2]},Be.length>3&&t("Too many tabs in "+A+": "+Be.length+" found.",L,0),i.addMetaTextObj(A,Ct,{startChar:r.iChar,endChar:r.iChar+k.length});break;case"midi":var st=e.tokenize(L,0,L.length,!0);st.length>0&&st[0].token==="="&&st.shift(),st.length===0?t("Expected midi command",L,0):Y(st,a,L);break;case"percmap":var kt=d(L);kt.error?t(kt.error,k,8):(a.formatting.percmap||(a.formatting.percmap={}),a.formatting.percmap[kt.key]=kt.value);break;case"visualtranspose":var ha=e.getInt(L);ha.digits===0?t("Expected number of half steps in visualTranspose"):r.globalTranspose=ha.value;break;case"map":case"playtempo":case"auquality":case"continuous":case"nobarcheck":a.formatting[A]=L;break;default:return"Unknown directive: "+A}return null},At.globalFormatting=function(k){for(var _ in k)if(k.hasOwnProperty(_)){var L=""+k[_],A=e.tokenize(L,0,L.length),R;switch(_){case"titlefont":case"gchordfont":case"composerfont":case"footerfont":case"headerfont":case"historyfont":case"infofont":case"measurefont":case"partsfont":case"repeatfont":case"subtitlefont":case"tempofont":case"textfont":case"voicefont":case"tripletfont":case"vocalfont":case"wordsfont":case"annotationfont":case"tablabelfont":case"tabnumberfont":case"tabgracefont":f(_,A,L);break;case"scale":l(_,A);break;case"partsbox":R=m("partsBox",_,A),R!==null&&t(R),r.partsfont.box=r.partsBox;break;case"freegchord":R=m("freegchord",_,A),R!==null&&t(R);break;case"fontboxpadding":(A.length!==1||A[0].type!=="number")&&t('Directive "'+_+'" requires a number as a parameter.'),a.formatting.fontboxpadding=A[0].floatt;break;case"stafftopmargin":(A.length!==1||A[0].type!=="number")&&t('Directive "'+_+'" requires a number as a parameter.'),a.formatting.stafftopmargin=A[0].floatt;break;case"stretchlast":var V=P(A);if(V.value!==void 0&&(a.formatting.stretchlast=V.value),V.error)return V.error;break;default:t("Formatting directive unrecognized: ",_,0)}}};function P(k){if(k.length===0)return{value:1};if(k.length===1)if(k[0].type==="number"){if(k[0].floatt>=0||k[0].floatt<=1)return{value:k[0].floatt}}else{if(k[0].token==="false")return{value:0};if(k[0].token==="true")return{value:1}}return{error:"Directive stretchlast requires zero or one parameter: false, true, or number between 0 and 1 (received "+k[0].token+")"}}})();var Gr=At,Rr={};const Gi=["C,,,","D,,,","E,,,","F,,,","G,,,","A,,,","B,,,","C,,","D,,","E,,","F,,","G,,","A,,","B,,","C,","D,","E,","F,","G,","A,","B,","C","D","E","F","G","A","B","c","d","e","f","g","a","b","c'","d'","e'","f'","g'","a'","b'","c''","d''","e''","f''","g''","a''","b''","c'''","d'''","e'''","f'''","g'''","a'''","b'''"];Rr.pitchIndex=function(e){return Gi.indexOf(e)};Rr.noteName=function(e){return Gi[e]};var ps=Rr,M0=["C","C♯","D","D♯","E","F","F♯","G","G♯","A","A♯","B"],A0=["C","D♭","D","E♭","E","F","G♭","G","A♭","A","B♭","B"],B0=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],N0=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"];function vs(e,t,r,a){if(!t||t%12===0)return e;for(;t<0;)t+=12;t>11&&(t=t%12);var i=e.match(/^([A-G][b#♭♯]?)([^\/]+)?\/?([A-G][b#♭♯]?)?(.+)?/);if(!i)return e;var n=i[1],s=i[2],c=i[3],o=i[4],f=M0.indexOf(n);if(f<0&&(f=A0.indexOf(n)),f<0&&(f=B0.indexOf(n)),f<0&&(f=N0.indexOf(n)),f<0)return e;f+=t,f=f%12,r?a?e=N0[f]:e=A0[f]:a?e=B0[f]:e=M0[f];var u=s&&(s.indexOf("dim")>=0||s.indexOf("°")>=0);if(u&&e==="A#"&&(e="Bb"),u&&e==="D#"&&(e="Eb"),u&&e==="A♯"&&(e="B♭"),u&&e==="D♯"&&(e="E♭"),s&&(e+=s),c){var f=M0.indexOf(c);f<0&&(f=A0.indexOf(c)),f<0&&(f=B0.indexOf(c)),f<0&&(f=N0.indexOf(c)),e+="/",f>=0?(f+=t,f=f%12,r?a?e+=N0[f]:e+=A0[f]:a?e+=B0[f]:e+=M0[f]):e+=c}return o&&(e+=o),e}var Ri=vs,Bt={C:{modes:["CMaj","CIon","Amin","AAeo","Am","GMix","DDor","EPhr","FLyd","BLoc"],stepsFromC:0},Db:{modes:["DbMaj","DbIon","Bbmin","BbAeo","Bbm","AbMix","EbDor","FPhr","GbLyd","CLoc"],stepsFromC:1},D:{modes:["DMaj","DIon","Bmin","BAeo","Bm","AMix","EDor","F#Phr","GLyd","C#Loc"],stepsFromC:2},Eb:{modes:["EbMaj","EbIon","Cmin","CAeo","Cm","BbMix","FDor","GPhr","AbLyd","DLoc"],stepsFromC:3},E:{modes:["EMaj","EIon","C#min","C#Aeo","C#m","BMix","F#Dor","G#Phr","ALyd","D#Loc"],stepsFromC:4},F:{modes:["FMaj","FIon","Dmin","DAeo","Dm","CMix","GDor","APhr","BbLyd","ELoc"],stepsFromC:5},Gb:{modes:["GbMaj","GbIon","Ebmin","EbAeo","Ebm","DbMix","AbDor","BbPhr","CbLyd","FLoc"],stepsFromC:6},G:{modes:["GMaj","GIon","Emin","EAeo","Em","DMix","ADor","BPhr","CLyd","F#Loc"],stepsFromC:7},Ab:{modes:["AbMaj","AbIon","Fmin","FAeo","Fm","EbMix","BbDor","CPhr","DbLyd","GLoc"],stepsFromC:8},A:{modes:["AMaj","AIon","F#min","F#Aeo","F#m","EMix","BDor","C#Phr","DLyd","G#Loc"],stepsFromC:9},Bb:{modes:["BbMaj","BbIon","Gmin","GAeo","Gm","FMix","CDor","DPhr","EbLyd","ALoc"],stepsFromC:10},B:{modes:["BMaj","BIon","G#min","G#Aeo","G#m","F#Mix","C#Dor","D#Phr","ELyd","A#Loc"],stepsFromC:11},"C#":{modes:["C#Maj","C#Ion","A#min","A#Aeo","A#m","G#Mix","D#Dor","E#Phr","F#Lyd","B#Loc"],stepsFromC:1},"F#":{modes:["F#Maj","F#Ion","D#min","D#Aeo","D#m","C#Mix","G#Dor","A#Phr","BLyd","E#Loc"],stepsFromC:6},Cb:{modes:["CbMaj","CbIon","Abmin","AbAeo","Abm","GbMix","DbDor","EbPhr","FbLyd","BbLoc"],stepsFromC:11}},gs=["maj","ion","min","aeo","m","mix","dor","phr","lyd","loc"];function bs(e){return gs.indexOf(e.toLowerCase())>=0}var v0=null;function ms(){v0={};for(var e=Object.keys(Bt),t=0;t<e.length;t++){var r=Bt[e[t]];v0[e[t].toLowerCase()]=e[t];for(var a=0;a<r.modes.length;a++){var i=r.modes[a].toLowerCase();v0[i]=e[t]}}}function ys(e){v0||ms();var t=e.toLowerCase().match(/([a-g][b#]?)(maj|ion|min|aeo|mix|dor|phr|lyd|loc|m)?/);if(!t||!t[2])return e;t=t[1]+t[2];var r=v0[t];return r||e}function ws(e,t){var r=Bt[e];if(!r||t==="")return e;var a=t.toLowerCase().match(/^(maj|ion|min|aeo|mix|dor|phr|lyd|loc|m)/);if(!a)return e;for(var i=a[1],n=0;n<r.modes.length;n++){var s=r.modes[n],c=s.toLowerCase().indexOf(i);if(c!==-1&&c===s.length-i.length)return s.substring(0,s.length-i.length)}return e}function xs(e,t){var r=Bt[e];if(!r)return e;for(;t<0;)t+=12;for(var a=(r.stepsFromC+t)%12,i=0;i<Object.keys(Bt).length;i++){var n=Object.keys(Bt)[i];if(Bt[n].stepsFromC===a)return n}return e}var Yi={relativeMajor:ys,relativeMode:ws,transposeKey:xs,isLegalMode:bs},{relativeMajor:Cs}=Yi,_t={acc:"sharp",note:"f"},Ot={acc:"sharp",note:"c"},i0={acc:"sharp",note:"g"},L0={acc:"sharp",note:"d"},or={acc:"sharp",note:"A"},pa={acc:"sharp",note:"e"},ks={acc:"sharp",note:"B"},Oe={acc:"flat",note:"B"},Je={acc:"flat",note:"e"},dt={acc:"flat",note:"A"},n0={acc:"flat",note:"d"},lr={acc:"flat",note:"G"},va={acc:"flat",note:"c"},_s={acc:"flat",note:"F"},Ts={"C#":[_t,Ot,i0,L0,or,pa,ks],"F#":[_t,Ot,i0,L0,or,pa],B:[_t,Ot,i0,L0,or],E:[_t,Ot,i0,L0],A:[_t,Ot,i0],D:[_t,Ot],G:[_t],C:[],F:[Oe],Bb:[Oe,Je],Eb:[Oe,Je,dt],Cm:[Oe,Je,dt],Ab:[Oe,Je,dt,n0],Db:[Oe,Je,dt,n0,lr],Gb:[Oe,Je,dt,n0,lr,va],Cb:[Oe,Je,dt,n0,lr,va,_s],"A#":[Oe,Je],"B#":[],"D#":[Oe,Je,dt],"E#":[Oe],"G#":[Oe,Je,dt,n0],none:[]};function Es(e){var t=Ts[Cs(e)];return t?JSON.parse(JSON.stringify(t)):null}var qi=Es,ga=ps,Ss=Ri,hr=qi,Z0={},Ms={C:0,"C#":1,Db:1,D:2,"D#":3,Eb:3,E:4,F:5,"F#":6,Gb:6,G:7,"G#":8,Ab:8,A:9,"A#":10,Bb:10,B:11},As=["C","Db","D","Eb","E","F","F#","G","Ab","A","Bb","B"],Bs=["C","C#","D","D#","E","F","F#","G","G#","A","Bb","B"];Z0.keySignature=function(e,t,r,a,i){if(e.clef.type==="perc"||e.clef.type==="none")return{accidentals:hr(t),root:r,acc:a};i||(i=0),e.localTransposeVerticalMovement=0,e.localTransposePreferFlats=!1;var n=hr(t);if(!n)return e.key;if(e.localTranspose=(e.globalTranspose?e.globalTranspose:0)+i,!e.localTranspose)return{accidentals:n,root:r,acc:a};if(e.globalTransposeOrigKeySig=n,e.localTranspose%12===0)return e.localTransposeVerticalMovement=e.localTranspose/12*7,{accidentals:n,root:r,acc:a};var s=t[0];t[1]==="b"||t[1]==="#"?(s+=t[1],t=t.substr(2)):t=t.substr(1);var c=Ms[s],o=c!==void 0;o||(c=0,s="C",t="");for(var f=c+e.localTranspose;f<0;)f+=12;f>11&&(f=f%12);var u=t[0]==="m"?Bs[f]:As[f],l=u+t,h=hr(l);(h.length===0||h[0].acc==="flat")&&(e.localTransposePreferFlats=!0);var d=l.charCodeAt(0)-s.charCodeAt(0);return e.localTranspose>0?(d<0||d===0&&(s[1]==="#"||l[1]==="b"))&&(d+=7):e.localTranspose<0&&(d>0||d===0&&(s[1]==="b"||l[1]==="#"))&&(d-=7),e.localTranspose>0?e.localTransposeVerticalMovement=d+Math.floor(e.localTranspose/12)*7:e.localTransposeVerticalMovement=d+Math.ceil(e.localTranspose/12)*7,o?{accidentals:h,root:u[0],acc:u.length>1?u[1]:""}:{accidentals:[],root:r,acc:a}};Z0.chordName=function(e,t){return Ss(t,e.localTranspose,e.localTransposePreferFlats,e.freegchord)};var ba=["c","d","e","f","g","a","b"];function Ns(e,t,r,a,i){for(var n=ba[(e+49)%7],s=0,c=0;c<a.length;c++)a[c].note.toLowerCase()===n&&(s=fr[a[c].acc]);for(var o=fr[r],f=o-s,u=ba[(t+49)%7],l=0,h=0;h<i.accidentals.length;h++)i.accidentals[h].note.toLowerCase()===u&&(l=fr[i.accidentals[h].acc]);var d=f+l;return d<-2&&(t--,d+=u==="c"||u==="f"?1:2),d>2&&(t++,d-=u==="b"||u==="e"?1:2),[t,d]}var fr={dblflat:-2,flat:-1,natural:0,sharp:1,dblsharp:2},Ls={"-2":"dblflat","-1":"flat",0:"natural",1:"sharp",2:"dblsharp"},Ps={"-2":"__","-1":"_",0:"=",1:"^",2:"^^"};Z0.note=function(e,t){if(!(!e.localTranspose||e.clef.type==="perc")){var r=t.pitch;if(e.localTransposeVerticalMovement&&(t.pitch=t.pitch+e.localTransposeVerticalMovement,t.name)){var a=t.accidental?t.name.substring(1):t.name,i=t.accidental?t.name[0]:"",n=ga.pitchIndex(a);t.name=i+ga.noteName(n+e.localTransposeVerticalMovement)}if(t.accidental){var s=Ns(r,t.pitch,t.accidental,e.globalTransposeOrigKeySig,e.targetKey);t.pitch=s[0],t.accidental=Ls[s[1]],t.name&&(t.name=Ps[s[1]]+t.name.replace(/[_^=]/g,""))}}};var Wi=Z0,ma=Gr,Ds=Wi,Te={};(function(){var e,t,r,a;Te.initialize=function(u,l,h,d,p){e=u,t=l,r=h,a=p},Te.standardKey=function(u,l,h,d){return Ds.keySignature(r,u,l,h,d)};var i={treble:{clef:"treble",pitch:4,mid:0},"treble+8":{clef:"treble+8",pitch:4,mid:0},"treble-8":{clef:"treble-8",pitch:4,mid:0},"treble^8":{clef:"treble+8",pitch:4,mid:0},treble_8:{clef:"treble-8",pitch:4,mid:0},treble1:{clef:"treble",pitch:2,mid:2},treble2:{clef:"treble",pitch:4,mid:0},treble3:{clef:"treble",pitch:6,mid:-2},treble4:{clef:"treble",pitch:8,mid:-4},treble5:{clef:"treble",pitch:10,mid:-6},perc:{clef:"perc",pitch:6,mid:0},none:{clef:"none",mid:0},bass:{clef:"bass",pitch:8,mid:-12},"bass+8":{clef:"bass+8",pitch:8,mid:-12},"bass-8":{clef:"bass-8",pitch:8,mid:-12},"bass^8":{clef:"bass+8",pitch:8,mid:-12},bass_8:{clef:"bass-8",pitch:8,mid:-12},"bass+16":{clef:"bass",pitch:8,mid:-12},"bass-16":{clef:"bass",pitch:8,mid:-12},"bass^16":{clef:"bass",pitch:8,mid:-12},bass_16:{clef:"bass",pitch:8,mid:-12},bass1:{clef:"bass",pitch:2,mid:-6},bass2:{clef:"bass",pitch:4,mid:-8},bass3:{clef:"bass",pitch:6,mid:-10},bass4:{clef:"bass",pitch:8,mid:-12},bass5:{clef:"bass",pitch:10,mid:-14},tenor:{clef:"alto",pitch:8,mid:-8},tenor1:{clef:"alto",pitch:2,mid:-2},tenor2:{clef:"alto",pitch:4,mid:-4},tenor3:{clef:"alto",pitch:6,mid:-6},tenor4:{clef:"alto",pitch:8,mid:-8},tenor5:{clef:"alto",pitch:10,mid:-10},alto:{clef:"alto",pitch:6,mid:-6},alto1:{clef:"alto",pitch:2,mid:-2},alto2:{clef:"alto",pitch:4,mid:-4},alto3:{clef:"alto",pitch:6,mid:-6},alto4:{clef:"alto",pitch:8,mid:-8},alto5:{clef:"alto",pitch:10,mid:-10},"alto+8":{clef:"alto+8",pitch:6,mid:-6},"alto-8":{clef:"alto-8",pitch:6,mid:-6},"alto^8":{clef:"alto+8",pitch:6,mid:-6},alto_8:{clef:"alto-8",pitch:6,mid:-6}},n=function(u,l){var h=i[u],d=h?h.mid:0;return d+l};Te.fixClef=function(u){var l=i[u.type];l&&(u.clefPos=l.pitch,u.type=l.clef)},Te.deepCopyKey=function(u){var l={accidentals:[],root:u.root,acc:u.acc,mode:u.mode};return u.accidentals.forEach(function(h){l.accidentals.push(Object.assign({},h))}),l};var s={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11};Te.addPosToKey=function(u,l){var h=u.verticalPos;l.accidentals.forEach(function(d){var p=s[d.note];p=p-h,d.verticalPos=p}),l.impliedNaturals&&l.impliedNaturals.forEach(function(d){var p=s[d.note];p=p-h,d.verticalPos=p}),h<-10?(l.accidentals.forEach(function(d){d.verticalPos-=7,(d.verticalPos>=11||d.verticalPos===10&&d.acc==="flat")&&(d.verticalPos-=7),d.note==="A"&&d.acc==="sharp"&&(d.verticalPos-=7),(d.note==="G"||d.note==="F")&&d.acc==="flat"&&(d.verticalPos-=7)}),l.impliedNaturals&&l.impliedNaturals.forEach(function(d){d.verticalPos-=7,(d.verticalPos>=11||d.verticalPos===10&&d.acc==="flat")&&(d.verticalPos-=7),d.note==="A"&&d.acc==="sharp"&&(d.verticalPos-=7),(d.note==="G"||d.note==="F")&&d.acc==="flat"&&(d.verticalPos-=7)})):h<-4?(l.accidentals.forEach(function(d){d.verticalPos-=7,h===-8&&(d.note==="f"||d.note==="g")&&d.acc==="sharp"&&(d.verticalPos-=7)}),l.impliedNaturals&&l.impliedNaturals.forEach(function(d){d.verticalPos-=7,h===-8&&(d.note==="f"||d.note==="g")&&d.acc==="sharp"&&(d.verticalPos-=7)})):h>=7&&(l.accidentals.forEach(function(d){d.verticalPos+=7}),l.impliedNaturals&&l.impliedNaturals.forEach(function(d){d.verticalPos+=7}))},Te.fixKey=function(u,l){var h=Object.assign({},l);return Te.addPosToKey(u,h),h};var c=function(u){var l=0,h=u[l++];(h==="^"||h==="_")&&(h=u[l++]);var d=s[h];for(d===void 0&&(d=6);l<u.length;l++)if(u[l]===",")d-=7;else if(u[l]==="'")d+=7;else break;return{mid:d-6,str:u.substring(l)}},o=function(u){for(var l=0;l<u.length;l++)u[l].note==="b"?u[l].note="B":u[l].note==="a"?u[l].note="A":u[l].note==="F"?u[l].note="f":u[l].note==="E"?u[l].note="e":u[l].note==="D"?u[l].note="d":u[l].note==="C"?u[l].note="c":u[l].note==="G"&&u[l].acc==="sharp"?u[l].note="g":u[l].note==="g"&&u[l].acc==="flat"&&(u[l].note="G")};Te.parseKey=function(u,l){u.length===0&&(u="none");var h=e.tokenize(u,0,u.length),d={};if(h.length===0)return t("Must pass in key signature.",u,0),d;switch(h[0].token){case"HP":ma.addDirective("bagpipes"),r.key={root:"HP",accidentals:[],acc:"",mode:""},d.foundKey=!0,h.shift();break;case"Hp":ma.addDirective("bagpipes"),r.key={root:"Hp",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}],acc:"",mode:""},d.foundKey=!0,h.shift();break;case"none":r.key={root:"none",accidentals:[],acc:"",mode:""},d.foundKey=!0,h.shift();break;default:var p=e.getKeyPitch(h[0].token);if(p.len>0){d.foundKey=!0;var g="",v="";h[0].token.length>1?h[0].token=h[0].token.substring(1):h.shift();var m=p.token;if(h.length>0){var y=e.getSharpFlat(h[0].token);if(y.len>0&&(h[0].token.length>1?h[0].token=h[0].token.substring(1):h.shift(),m+=y.token,g=y.token),h.length>0){var x=e.getMode(h[0].token);x.len>0&&(h.shift(),m+=x.token,v=x.token)}if(Te.standardKey(m,p.token,g,0)===void 0)return t("Unsupported key signature: "+m,u,0),d}var b=Te.deepCopyKey(r.key),w=!l&&r.globalTranspose?-r.globalTranspose:0,C;if(l&&(C=r.globalTransposeOrigKeySig),r.key=Te.deepCopyKey(Te.standardKey(m,p.token,g,w)),l&&(r.globalTransposeOrigKeySig=C),r.key.mode=v,b&&r.keywarn!==!1){for(var T,B=0;B<r.key.accidentals.length;B++)for(T=0;T<b.accidentals.length;T++)b.accidentals[T].note&&r.key.accidentals[B].note.toLowerCase()===b.accidentals[T].note.toLowerCase()&&(b.accidentals[T].note=null);for(T=0;T<b.accidentals.length;T++)b.accidentals[T].note&&(r.key.impliedNaturals||(r.key.impliedNaturals=[]),r.key.impliedNaturals.push({acc:"natural",note:b.accidentals[T].note}))}}break}if(h.length===0||(h[0].token==="exp"&&h.shift(),h.length===0)||(h[0].token==="oct"&&h.shift(),h.length===0))return d;var E=e.getKeyAccidentals2(h);if(E.warn&&t(E.warn,u,0),E.accs){d.foundKey||(d.foundKey=!0,r.key={root:"none",acc:"",mode:"",accidentals:[]}),o(E.accs);for(var z=0;z<E.accs.length;z++){for(var I=!1,F=0;F<r.key.accidentals.length&&!I;F++)r.key.accidentals[F].note===E.accs[z].note&&(I=!0,r.key.accidentals[F].acc!==E.accs[z].acc&&(r.key.accidentals[F].acc=E.accs[z].acc,r.key.explicitAccidentals||(r.key.explicitAccidentals=[]),r.key.explicitAccidentals.push(E.accs[z])));if(!I&&(r.key.explicitAccidentals||(r.key.explicitAccidentals=[]),r.key.explicitAccidentals.push(E.accs[z]),r.key.accidentals.push(E.accs[z]),r.key.impliedNaturals))for(var G=0;G<r.key.impliedNaturals.length;G++)r.key.impliedNaturals[G].note===E.accs[z].note&&r.key.impliedNaturals.splice(G,1)}}for(var Y;h.length>0;)switch(h[0].token){case"m":case"middle":if(h.shift(),h.length===0)return t("Expected = after middle",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after middle",u,Y.start);break}if(h.length===0)return t("Expected parameter after middle=",u,0),d;var K=e.getPitchFromTokens(h);K.warn&&t(K.warn,u,0),K.position&&(r.clef.verticalPos=K.position-6);break;case"transpose":if(h.shift(),h.length===0)return t("Expected = after transpose",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after transpose",u,Y.start);break}if(h.length===0)return t("Expected parameter after transpose=",u,0),d;if(h[0].type!=="number"){t("Expected number after transpose",u,h[0].start);break}r.clef.transpose=h[0].intt,h.shift();break;case"stafflines":if(h.shift(),h.length===0)return t("Expected = after stafflines",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after stafflines",u,Y.start);break}if(h.length===0)return t("Expected parameter after stafflines=",u,0),d;if(h[0].type!=="number"){t("Expected number after stafflines",u,h[0].start);break}r.clef.stafflines=h[0].intt,h.shift();break;case"staffscale":if(h.shift(),h.length===0)return t("Expected = after staffscale",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after staffscale",u,Y.start);break}if(h.length===0)return t("Expected parameter after staffscale=",u,0),d;if(h[0].type!=="number"){t("Expected number after staffscale",u,h[0].start);break}r.clef.staffscale=h[0].floatt,h.shift();break;case"octave":if(h.shift(),h.length===0)return t("Expected = after octave",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after octave",u,Y.start);break}if(h.length===0)return t("Expected parameter after octave=",u,0),d;if(h[0].type!=="number"){t("Expected number after octave",u,h[0].start);break}r.octave=h[0].intt,h.shift();break;case"style":if(h.shift(),h.length===0)return t("Expected = after style",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after style",u,Y.start);break}if(h.length===0)return t("Expected parameter after style=",u,0),d;switch(h[0].token){case"normal":case"harmonic":case"rhythm":case"x":case"triangle":r.style=h[0].token,h.shift();break;default:t("error parsing style element: "+h[0].token,u,h[0].start);break}break;case"clef":if(h.shift(),h.length===0)return t("Expected = after clef",u,0),d;if(Y=h.shift(),Y.token!=="="){t("Expected = after clef",u,Y.start);break}if(h.length===0)return t("Expected parameter after clef=",u,0),d;case"treble":case"bass":case"alto":case"tenor":case"perc":case"none":var P=h.shift();switch(P.token){case"treble":case"tenor":case"alto":case"bass":case"perc":case"none":break;case"C":P.token="alto";break;case"F":P.token="bass";break;case"G":P.token="treble";break;case"c":P.token="alto";break;case"f":P.token="bass";break;case"g":P.token="treble";break;default:t("Expected clef name. Found "+P.token,u,P.start);break}h.length>0&&h[0].type==="number"&&(P.token+=h[0].token,h.shift()),h.length>1&&(h[0].token==="-"||h[0].token==="+"||h[0].token==="^"||h[0].token==="_")&&h[1].token==="8"&&(P.token+=h[0].token+h[1].token,h.shift(),h.shift()),r.clef={type:P.token,verticalPos:n(P.token,0)},r.currentVoice&&r.currentVoice.transpose!==void 0&&(r.clef.transpose=r.currentVoice.transpose),d.foundClef=!0;break;default:t("Unknown parameter: "+h[0].token,u,h[0].start),h.shift()}return d};var f=function(u){var l=r.voices[u];if(!(r.currentVoice&&r.currentVoice.index===l.index&&r.currentVoice.staffNum===l.staffNum))return r.currentVoice=l,a.setCurrentVoice(l.staffNum,l.index,u)};Te.parseVoice=function(u,l,h){var d=e.getMeat(u,l,h),p=d.start,g=d.end,v=e.getToken(u,p,g);if(v.length===0){t("Expected a voice id",u,p);return}var m=!1;r.voices[v]===void 0&&(r.voices[v]={},m=!0,r.score_is_present&&t("Can't have an unknown V: id when the %score directive is present",u,p)),p+=v.length,p+=e.eatWhiteSpace(u,p);for(var y={startStaff:m},x=function(K){var P=e.getVoiceToken(u,p,g);P.warn!==void 0?t("Expected value for "+K+" in voice: "+P.warn,u,p):P.err!==void 0?t("Expected value for "+K+" in voice: "+P.err,u,p):P.token.length===0&&u[p]!=='"'?t("Expected value for "+K+" in voice",u,p):y[K]=P.token,p+=P.len},b=function(K,P,k){var _=e.getVoiceToken(u,p,g);_.warn!==void 0?t("Expected value for "+P+" in voice: "+_.warn,u,p):_.err!==void 0?t("Expected value for "+P+" in voice: "+_.err,u,p):_.token.length===0&&u[p]!=='"'?t("Expected value for "+P+" in voice",u,p):(_.token=parseFloat(_.token),r.voices[K][P]=_.token),p+=_.len},w=function(K,P){var k=e.getVoiceToken(u,p,g);if(k.warn!==void 0)t("Expected value for "+K+" in voice: "+k.warn,u,p);else if(k.err!==void 0)t("Expected value for "+K+" in voice: "+k.err,u,p);else if(k.token.length===0&&u[p]!=='"')t("Expected value for "+K+" in voice",u,p);else return k.token;p+=k.len},C=function(K,P){var k={_B:2,_E:9,_b:-10,_e:-3},_=e.getVoiceToken(u,p,g);if(_.warn!==void 0)t("Expected one of (_B, _E, _b, _e) for "+P+" in voice: "+_.warn,u,p);else if(_.token.length===0&&u[p]!=='"')t("Expected one of (_B, _E, _b, _e) for "+P+" in voice",u,p);else{var L=k[_.token];L?r.voices[K][P]=L:t("Expected one of (_B, _E, _b, _e) for "+P+" in voice",u,p)}p+=_.len};p<g;){var T=e.getVoiceToken(u,p,g);if(p+=T.len,T.warn)t("Error parsing voice: "+T.warn,u,p);else{var B=null;switch(T.token){case"clef":case"cl":x("clef");var E=0;y.clef!==void 0&&(y.clef=y.clef.replace(/[',]/g,""),y.clef.indexOf("+16")!==-1&&(E+=14,y.clef=y.clef.replace("+16","")),y.verticalPos=n(y.clef,E));break;case"treble":case"bass":case"tenor":case"alto":case"perc":case"none":case"treble'":case"bass'":case"tenor'":case"alto'":case"none'":case"treble''":case"bass''":case"tenor''":case"alto''":case"none''":case"treble,":case"bass,":case"tenor,":case"alto,":case"none,":case"treble,,":case"bass,,":case"tenor,,":case"alto,,":case"none,,":case"treble+8":case"treble-8":case"treble^8":case"treble_8":case"treble1":case"treble2":case"treble3":case"treble4":case"treble5":case"bass+8":case"bass-8":case"bass^8":case"bass_8":case"bass+16":case"bass-16":case"bass^16":case"bass_16":case"bass1":case"bass2":case"bass3":case"bass4":case"bass5":case"tenor1":case"tenor2":case"tenor3":case"tenor4":case"tenor5":case"alto1":case"alto2":case"alto3":case"alto4":case"alto5":case"alto+8":case"alto-8":case"alto^8":case"alto_8":var z=0;y.clef=T.token.replace(/[',]/g,""),y.verticalPos=n(y.clef,z),r.voices[v].clef=T.token;break;case"staves":case"stave":case"stv":x("staves");break;case"brace":case"brc":x("brace");break;case"bracket":case"brk":x("bracket");break;case"name":case"nm":x("name");break;case"subname":case"sname":case"snm":x("subname");break;case"merge":y.startStaff=!1;break;case"stem":case"stems":B=e.getVoiceToken(u,p,g),B.warn!==void 0?t("Expected value for stems in voice: "+B.warn,u,p):B.err!==void 0?t("Expected value for stems in voice: "+B.err,u,p):B.token==="up"||B.token==="down"?r.voices[v].stem=B.token:t("Expected up or down for voice stem",u,p),p+=B.len;break;case"up":case"down":r.voices[v].stem=T.token;break;case"middle":case"m":x("verticalPos"),y.verticalPos=c(y.verticalPos).mid;break;case"gchords":case"gch":r.voices[v].suppressChords=!0,B=e.getVoiceToken(u,p,g),B.token==="0"&&(p=p+B.len);break;case"space":case"spc":x("spacing");break;case"scale":b(v,"scale");break;case"score":C(v,"scoreTranspose");break;case"transpose":b(v,"transpose");break;case"stafflines":b(v,"stafflines");break;case"staffscale":b(v,"staffscale");break;case"octave":b(v,"octave");break;case"volume":b(v,"volume");break;case"cue":var I=w("cue");I==="on"?r.voices[v].scale=.6:r.voices[v].scale=1;break;case"style":B=e.getVoiceToken(u,p,g),B.warn!==void 0?t("Expected value for style in voice: "+B.warn,u,p):B.err!==void 0?t("Expected value for style in voice: "+B.err,u,p):B.token==="normal"||B.token==="harmonic"||B.token==="rhythm"||B.token==="x"||B.token==="triangle"?r.voices[v].style=B.token:t("Expected one of [normal, harmonic, rhythm, x, triangle] for voice style",u,p),p+=B.len;break}}p+=e.eatWhiteSpace(u,p)}if((y.startStaff||r.staves.length===0)&&(r.staves.push({index:r.staves.length,meter:r.origMeter}),r.score_is_present||(r.staves[r.staves.length-1].numVoices=0)),r.voices[v].staffNum===void 0){r.voices[v].staffNum=r.staves.length-1;var F=0;for(var G in r.voices)r.voices.hasOwnProperty(G)&&r.voices[G].staffNum===r.voices[v].staffNum&&F++;r.voices[v].index=F-1}var Y=r.staves[r.voices[v].staffNum];return r.score_is_present||Y.numVoices++,y.clef&&(Y.clef={type:y.clef,verticalPos:y.verticalPos}),y.spacing&&(Y.spacing_below_offset=y.spacing),y.verticalPos&&(Y.verticalPos=y.verticalPos),y.name&&(Y.name?Y.name.push(y.name):Y.name=[y.name]),y.subname&&(Y.subname?Y.subname.push(y.subname):Y.subname=[y.subname]),f(v)}})();var Yr=Te,P0=rt,Ze=Gr,et=Yr,Is=function(e,t,r,a,i){this.reset=function(c,o,f,u){et.initialize(c,o,f,u,i),Ze.initialize(c,o,f,u,i)},this.reset(e,t,r,a),this.setTitle=function(c,o){r.hasMainTitle?i.addSubtitle(c,{startChar:r.iChar,endChar:r.iChar+o+2}):(i.addMetaText("title",c,{startChar:r.iChar,endChar:r.iChar+o+2}),r.hasMainTitle=!0)},this.setMeter=function(c){if(c=e.stripComment(c),c==="C")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"common_time"};if(c==="C|")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"cut_time"};if(c==="o")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"tempus_perfectum"};if(c==="c")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"tempus_imperfectum"};if(c==="o.")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"tempus_perfectum_prolatio"};if(c==="c.")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),{type:"tempus_imperfectum_prolatio"};if(c.length===0||c.toLowerCase()==="none")return r.havent_set_length===!0&&(r.default_length=.125,r.havent_set_length=!1),null;var o=e.tokenize(c,0,c.length);try{var f=function(){var g={value:0,num:""},v=o.shift();for(v.token==="("&&(v=o.shift());;){if(v.type!=="number")throw"Expected top number of meter";if(g.value+=parseInt(v.token),g.num+=v.token,o.length===0||o[0].token==="/")return g;if(v=o.shift(),v.token===")"){if(o.length===0||o[0].token==="/")return g;throw"Unexpected paren in meter"}if(v.token!=="."&&v.token!=="+"||(g.num+=v.token,o.length===0))throw"Expected top number of meter";v=o.shift()}return g},u=function(){var g=f();if(o.length===0)return g;var v=o.shift();if(v.token!=="/")throw"Expected slash in meter";if(v=o.shift(),v.type!=="number")throw"Expected bottom number of meter";return g.den=v.token,g.value=g.value/parseInt(g.den),g};if(o.length===0)throw"Expected meter definition in M: line";for(var l={type:"specified",value:[]},h=0;;){var d=u();h+=d.value;var p={num:d.num};if(d.den!==void 0&&(p.den=d.den),l.value.push(p),o.length===0)break}return r.havent_set_length===!0&&(r.default_length=h<.75?.0625:.125,r.havent_set_length=!1),l}catch(g){t(g,c,0)}return null},this.calcTempo=function(c){var o=.25;r.meter&&r.meter.type==="specified"?o=1/parseInt(r.meter.value[0].den):r.origMeter&&r.origMeter.type==="specified"&&(o=1/parseInt(r.origMeter.value[0].den));for(var f=0;f<c.duration;f++)c.duration[f]=o*c.duration[f];return c},this.resolveTempo=function(){r.tempo&&(this.calcTempo(r.tempo),a.metaText.tempo=r.tempo,delete r.tempo)},this.addUserDefinition=function(c,o,f){var u=c.indexOf("=",o);if(u===-1){t("Need an = in a macro definition",c,o);return}var l=P0.strip(c.substring(o,u)),h=P0.strip(c.substring(u+1));if(l.length!==1){t("Macro definitions can only be one character",c,o);return}var d="HIJKLMNOPQRSTUVWXYhijklmnopqrstuvw~";if(d.indexOf(l)===-1){t("Macro definitions must be H-Y, h-w, or tilde",c,o);return}if(h.length===0){t("Missing macro definition",c,o);return}r.macros===void 0&&(r.macros={}),r.macros[l]=h},this.setDefaultLength=function(c,o,f){var u=c.substring(o,f).replace(/ /g,""),l=u.split("/");if(l.length===2){var h=parseInt(l[0]),d=parseInt(l[1]);d>0&&(r.default_length=h/d,r.havent_set_length=!1)}else l.length===1&&l[0]==="1"&&(r.default_length=1,r.havent_set_length=!1)};var n={larghissimo:20,adagissimo:24,sostenuto:28,grave:32,largo:40,lento:50,larghetto:60,adagio:68,adagietto:74,andante:80,andantino:88,"marcia moderato":84,"andante moderato":100,moderato:112,allegretto:116,"allegro moderato":120,allegro:126,animato:132,agitato:140,veloce:148,"mosso vivo":156,vivace:164,vivacissimo:172,allegrissimo:176,presto:184,prestissimo:210};this.setTempo=function(c,o,f,u){try{var l=e.tokenize(c,o,f);if(l.length===0)throw"Missing parameter in Q: field";var h={startChar:u+o-2,endChar:u+f},d=!0,p=l.shift();if(p.type==="quote"&&(h.preString=p.token,p=l.shift(),l.length===0))return n[h.preString.toLowerCase()]&&(h.bpm=n[h.preString.toLowerCase()],h.suppressBpm=!0),{type:"immediate",tempo:h};if(p.type==="alpha"&&p.token==="C"){if(l.length===0)throw"Missing tempo after C in Q: field";if(p=l.shift(),p.type==="punct"&&p.token==="="){if(l.length===0)throw"Missing tempo after = in Q: field";if(p=l.shift(),p.type!=="number")throw"Expected number after = in Q: field";h.duration=[1],h.bpm=parseInt(p.token)}else if(p.type==="number"){if(h.duration=[parseInt(p.token)],l.length===0)throw"Missing = after duration in Q: field";if(p=l.shift(),p.type!=="punct"||p.token!=="=")throw"Expected = after duration in Q: field";if(l.length===0)throw"Missing tempo after = in Q: field";if(p=l.shift(),p.type!=="number")throw"Expected number after = in Q: field";h.bpm=parseInt(p.token)}else throw"Expected number or equal after C in Q: field"}else if(p.type==="number"){var g=parseInt(p.token);if(l.length===0||l[0].type==="quote")h.duration=[1],h.bpm=g;else{if(d=!1,p=l.shift(),p.type!=="punct"&&p.token!=="/"||(p=l.shift(),p.type!=="number"))throw"Expected fraction in Q: field";var v=parseInt(p.token);for(h.duration=[g/v];l.length>0&&l[0].token!=="="&&l[0].type!=="quote";){if(p=l.shift(),p.type!=="number"||(g=parseInt(p.token),p=l.shift(),p.type!=="punct"&&p.token!=="/")||(p=l.shift(),p.type!=="number"))throw"Expected fraction in Q: field";v=parseInt(p.token),h.duration.push(g/v)}if(p=l.shift(),p.type!=="punct"&&p.token!=="=")throw"Expected = in Q: field";if(p=l.shift(),p.type!=="number")throw"Expected tempo in Q: field";h.bpm=parseInt(p.token)}}else throw"Unknown value in Q: field";if(l.length!==0&&(p=l.shift(),p.type==="quote"&&(h.postString=p.token,p=l.shift()),l.length!==0))throw"Unexpected string at end of Q: field";return r.printTempo===!1&&(h.suppress=!0),{type:d?"delaySet":"immediate",tempo:h}}catch(m){return t(m,c,o),{type:"none"}}},this.letter_to_inline_header=function(c,o,f){var u=!1,l=e.eatWhiteSpace(c,o);if(o+=l,c.length>=o+5&&c[o]==="["&&c[o+2]===":"){var h=c.indexOf("]",o),d=r.iChar+o,p=r.iChar+h+1;switch(c.substring(o,o+3)){case"[I:":var g=Ze.addDirective(c.substring(o+3,h));return g&&t(g,c,o),[h-o+1+l];case"[M:":var v=this.setMeter(c.substring(o+3,h));return i.hasBeginMusic()&&v?i.appendStartingElement("meter",d,p,v):r.meter=v,[h-o+1+l];case"[K:":var m=et.parseKey(c.substring(o+3,h),!0);return m.foundClef&&i.hasBeginMusic()&&i.appendStartingElement("clef",d,p,r.clef),m.foundKey&&i.hasBeginMusic()&&i.appendStartingElement("key",d,p,et.fixKey(r.clef,r.key)),[h-o+1+l];case"[P:":var y=Ze.parseFontChangeLine(c.substring(o+3,h));return f||a.lines.length<=a.lineNum?r.partForNextLine={title:y,startChar:d,endChar:p}:i.appendElement("part",d,p,{title:y}),[h-o+1+l];case"[L:":return this.setDefaultLength(c,o+3,h),[h-o+1+l];case"[Q:":if(h>0){var x=this.setTempo(c,o+3,h,r.iChar);return x.type==="delaySet"?i.hasBeginMusic()?i.appendElement("tempo",d,p,this.calcTempo(x.tempo)):r.tempoForNextLine=["tempo",d,p,this.calcTempo(x.tempo)]:x.type==="immediate"&&(!f&&i.hasBeginMusic()?i.appendElement("tempo",d,p,x.tempo):r.tempoForNextLine=["tempo",d,p,x.tempo]),[h-o+1+l,c[o+1],c.substring(o+3,h)]}break;case"[V:":if(h>0)return u=et.parseVoice(c,o+3,h),[h-o+1+l,c[o+1],c.substring(o+3,h),u];break;case"[r:":return[h-o+1+l]}}return[0]},this.letter_to_body_header=function(c,o){var f=!1;if(c.length>=o+3)switch(c.substring(o,o+2)){case"I:":var u=Ze.addDirective(c.substring(o+2));return u&&t(u,c,o),[c.length];case"M:":var l=this.setMeter(c.substring(o+2));return i.hasBeginMusic()&&l&&i.appendStartingElement("meter",r.iChar+o,r.iChar+c.length,l),[c.length];case"K:":var h=et.parseKey(c.substring(o+2),i.hasBeginMusic());return h.foundClef&&i.hasBeginMusic()&&r.keywarn!==!1&&i.appendStartingElement("clef",r.iChar+o,r.iChar+c.length,r.clef),h.foundKey&&i.hasBeginMusic()&&r.keywarn!==!1&&i.appendStartingElement("key",r.iChar+o,r.iChar+c.length,et.fixKey(r.clef,r.key)),[c.length];case"P:":return i.hasBeginMusic()&&i.appendElement("part",r.iChar+o,r.iChar+c.length,{title:c.substring(o+2)}),[c.length];case"L:":return this.setDefaultLength(c,o+2,c.length),[c.length];case"Q:":var d=c.indexOf("",o+2);d===-1&&(d=c.length);var p=this.setTempo(c,o+2,d,r.iChar);return p.type==="delaySet"?i.appendElement("tempo",r.iChar+o,r.iChar+c.length,this.calcTempo(p.tempo)):p.type==="immediate"&&i.appendElement("tempo",r.iChar+o,r.iChar+c.length,p.tempo),[d,c[o],P0.strip(c.substring(o+2))];case"V:":return f=et.parseVoice(c,o+2,c.length),[c.length,c[o],P0.strip(c.substring(o+2)),f]}return[0]};var s={A:"author",B:"book",C:"composer",D:"discography",F:"url",G:"group",I:"instruction",N:"notes",O:"origin",R:"rhythm",S:"source",W:"unalignedWords",Z:"transcription"};this.parseHeader=function(c){var o=s[c[0]],f=c.length-2,u=e.translateString(e.stripComment(c.substring(2)));if(o==="unalignedWords"||o==="notes")i.addMetaTextArray(o,Ze.parseFontChangeLine(u),{startChar:r.iChar,endChar:r.iChar+c.length});else if(o!==void 0)i.addMetaText(o,Ze.parseFontChangeLine(u),{startChar:r.iChar,endChar:r.iChar+c.length});else{var l=r.iChar,h=l+c.length;switch(c[0]){case"H":for(i.addMetaTextArray("history",Ze.parseFontChangeLine(u),{startChar:r.iChar,endChar:r.iChar+c.length}),c=e.peekLine();c&&c[1]!==":";)e.nextLine(),i.addMetaTextArray("history",Ze.parseFontChangeLine(e.translateString(e.stripComment(c))),{startChar:r.iChar,endChar:r.iChar+c.length}),c=e.peekLine();break;case"K":this.resolveTempo();var d=et.parseKey(c.substring(2),!1);!r.is_in_header&&i.hasBeginMusic()&&r.keywarn!==!1&&(d.foundClef&&i.appendStartingElement("clef",l,h,r.clef),d.foundKey&&i.appendStartingElement("key",l,h,et.fixKey(r.clef,r.key))),r.is_in_header=!1;break;case"L":this.setDefaultLength(c,2,c.length);break;case"M":r.origMeter=r.meter=this.setMeter(c.substring(2));break;case"P":r.is_in_header?i.addMetaText("partOrder",Ze.parseFontChangeLine(u),{startChar:r.iChar,endChar:r.iChar+c.length}):r.partForNextLine={title:u,startChar:l,endChar:h};break;case"Q":var p=this.setTempo(c,2,c.length,r.iChar);p.type==="delaySet"?r.tempo=p.tempo:p.type==="immediate"&&(a.metaText.tempo?r.tempoForNextLine=["tempo",l,h,p.tempo]:a.metaText.tempo=p.tempo);break;case"T":r.titlecaps&&(u=u.toUpperCase()),this.setTitle(Ze.parseFontChangeLine(e.theReverser(u)),f);break;case"U":this.addUserDefinition(c,2,c.length);break;case"V":if(et.parseVoice(c,2,c.length),!r.is_in_header)return{newline:!0};break;case"s":return{symbols:!0};case"w":return{words:!0};case"X":break;case"E":case"m":t("Ignored header",c,0);break;default:return{regular:!0}}}return{}}},Fs=Is,$e={};$e.legalAccents=["trill","trillh","lowermordent","uppermordent","mordent","pralltriller","accent","fermata","invertedfermata","tenuto","0","1","2","3","4","5","+","wedge","open","thumb","snap","turn","roll","breath","shortphrase","mediumphrase","longphrase","segno","coda","D.S.","D.C.","fine","beambr1","beambr2","slide","marcato","upbow","downbow","/","//","///","////","trem1","trem2","trem3","trem4","turnx","invertedturn","invertedturnx","trill(","trill)","arpeggio","xstem","mark","umarcato","style=normal","style=harmonic","style=rhythm","style=x","style=triangle","D.C.alcoda","D.C.alfine","D.S.alcoda","D.S.alfine","editorial","courtesy"];$e.volumeDecorations=["p","pp","f","ff","mf","mp","ppp","pppp","fff","ffff","sfz"];$e.dynamicDecorations=["crescendo(","crescendo)","diminuendo(","diminuendo)","glissando(","glissando)","~(","~)"];$e.accentPseudonyms=[["<","accent"],[">","accent"],["tr","trill"],["plus","+"],["emphasis","accent"],["^","umarcato"],["marcato","umarcato"]];$e.accentDynamicPseudonyms=[["<(","crescendo("],["<)","crescendo)"],[">(","diminuendo("],[">)","diminuendo)"]];$e.nonDecorations="ABCDEFGabcdefgxyzZ[]|^_{";$e.durations=[.5,.75,.875,.9375,.96875,.984375,.25,.375,.4375,.46875,.484375,.4921875,.125,.1875,.21875,.234375,.2421875,.24609375,.0625,.09375,.109375,.1171875,.12109375,.123046875,.03125,.046875,.0546875,.05859375,.060546875,.0615234375,.015625,.0234375,.02734375,.029296875,.0302734375,.03076171875];$e.pitches={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11};$e.rests={x:"invisible",X:"invisible-multimeasure",y:"spacer",z:"rest",Z:"multimeasure"};$e.accMap={dblflat:"__",flat:"_",natural:"=",sharp:"^",dblsharp:"^^",quarterflat:"_/",quartersharp:"^/"};$e.tripletQ={2:3,3:2,4:3,5:2,6:2,7:2,8:3,9:2};var ya=Yr,Xi=Wi,fe,be,S,Ue,We,p0,{legalAccents:wa,volumeDecorations:xa,dynamicDecorations:Ca,accentPseudonyms:ka,accentDynamicPseudonyms:_a,nonDecorations:Os,durations:Hs,pitches:zs,rests:$s,accMap:Ta,tripletQ:Gs}=$e,qr=function(e,t,r,a,i,n){fe=e,be=t,S=r,Ue=a,We=i,p0=n,this.lineContinuation=!1},Ea=function(e,t,r){if(e.inTie[t]===void 0)return!1;var a=e.currentVoice?e.currentVoice.staffNum*100+e.currentVoice.index:0;return!!(e.inTie[t][a]&&(r.pitches!==void 0||r.rest.type!=="spacer"))},H={};qr.prototype.parseMusic=function(e){p0.resolveTempo(),S.is_in_header=!1;for(var t=0,r=S.iChar;fe.isWhiteSpace(e[t])&&t<e.length;)t++;if(!(t===e.length||e[t]==="%")){var a=S.start_new_line;S.continueall===void 0?S.start_new_line=!0:S.start_new_line=!1;var i=0,n=p0.letter_to_body_header(e,t);n[0]>0&&(t+=n[0],n[1]==="V"&&this.startNewLine());for(var s=0;t<e.length;){var c=t;if(e[t]==="%")break;var o=p0.letter_to_inline_header(e,t,a);if(o[0]>0)t+=o[0],o[1]==="V"&&(a=!0);else{(!We.hasBeginMusic()||a&&!this.lineContinuation)&&(this.startNewLine(),a=!1);for(var f;;)if(f=fe.eatWhiteSpace(e,t),f>0&&(t+=f),t>0&&e[t-1]===""&&(f=p0.letter_to_body_header(e,t),f[0]>0&&(f[1]==="V"&&this.startNewLine(),t=f[0],S.start_new_line=!1)),f=Ws(e,t),f[0]>0&&(t+=f[0]),f=Rs(e,t),f[0]>0){H.chord||(H.chord=[]);var u=fe.translateString(f[1]);u=u.replace(/;/g,`
4
4
  `);for(var l=!1,h=0;h<H.chord.length;h++)H.chord[h].position===f[2]&&(l=!0,H.chord[h].name+=`
5
- `+u);l===!1&&(f[2]===null&&f[3]?H.chord.push({name:u,rel_position:f[3]}):H.chord.push({name:u,position:f[2]})),t+=f[0];var d=fe.skipWhiteSpace(e.substring(t));d>0&&(H.force_end_beam_last=!0),t+=d}else if(Os.indexOf(e[t])===-1?f=Ma(e,t):f=[0],f[0]>0)f[1]===null?t+1<e.length&&this.startNewLine():f[1].length>0&&(f[1].indexOf("style=")===0?H.style=f[1].substr(6):(H.decoration===void 0&&(H.decoration=[]),f[1]==="beambr1"?H.beambr=1:f[1]==="beambr2"?H.beambr=2:H.decoration.push(f[1]))),t+=f[0];else if(f=Ys(e,t),f[0]>0)H.gracenotes=f[1],t+=f[0];else break;if(f=Xs(e,t),f[0]>0){s=0,H.gracenotes!==void 0&&(H.rest={type:"spacer"},H.duration=.125,S.addFormattingOptions(H,Ue.formatting,"note"),We.appendElement("note",r+t,r+t+f[0],H),S.measureNotEmpty=!0,H={});var p={type:f[1]};p.type.length===0?be("Unknown bar type",e,t):(S.inEnding&&p.type!=="bar_thin"&&(p.endEnding=!0,S.inEnding=!1),f[2]&&(p.startEnding=f[2],S.inEnding&&(p.endEnding=!0),S.inEnding=!0,f[1]==="bar_right_repeat"?S.restoreStartEndingHoldOvers():S.duplicateStartEndingHoldOvers()),H.decoration!==void 0&&(p.decoration=H.decoration),H.chord!==void 0&&(p.chord=H.chord),p.startEnding&&S.barFirstEndingNum===void 0?S.barFirstEndingNum=S.currBarNumber:p.startEnding&&p.endEnding&&S.barFirstEndingNum?S.currBarNumber=S.barFirstEndingNum:p.endEnding&&(S.barFirstEndingNum=void 0),p.type!=="bar_invisible"&&S.measureNotEmpty&&Ar()&&(S.currBarNumber++,S.barNumbers&&S.currBarNumber%S.barNumbers===0&&(p.barNumber=S.currBarNumber)),S.addFormattingOptions(H,Ue.formatting,"bar"),We.appendElement("bar",r+o,r+t+f[0],p),S.measureNotEmpty=!1,H={}),t+=f[0]}else if(e[t]==="&")f=qs(e,t),f[0]>0&&(We.appendElement("overlay",r,r+1,{}),t+=1,s++);else{if(f=Us(e,t),f.consumed>0&&(f.startSlur!==void 0&&(H.startSlur=f.startSlur),f.dottedSlur&&(H.dottedSlur=!0),f.triplet!==void 0&&(n>0?be("Can't nest triplets",e,t):(H.startTriplet=f.triplet,H.tripletMultiplier=f.tripletQ/f.triplet,H.tripletR=f.num_notes,n=f.num_notes===void 0?f.triplet:f.num_notes)),t+=f.consumed),e[t]==="["){t++;for(var g=null,v=!1,m=!1;!m;){var y=Ma(e,t);y[0]>0&&(t+=y[0]);var x=Mr(e,t,{},!1);if(x!==null&&x.pitch!==void 0)y[0]>0&&y[1].indexOf("style=")!==0&&(H.decoration===void 0&&(H.decoration=[]),H.decoration.push(y[1])),x.end_beam&&(H.end_beam=!0,delete x.end_beam),H.pitches===void 0?(H.duration=x.duration,H.pitches=[x]):H.pitches.push(x),delete x.duration,y[0]>0&&y[1].indexOf("style=")===0&&(H.pitches[H.pitches.length-1].style=y[1].substr(6)),S.inTieChord[H.pitches.length]&&(x.endTie=!0,S.inTieChord[H.pitches.length]=void 0),x.startTie&&(S.inTieChord[H.pitches.length]=!0),t=x.endChar,delete x.endChar;else if(e[t]===" ")be("Spaces are not allowed in chords",e,t),t++;else{if(t<e.length&&e[t]==="]"){t++,S.next_note_duration!==0&&(H.duration=H.duration*S.next_note_duration,S.next_note_duration=0),Ea(S,s,H)&&(H.pitches.forEach(function(F){F.endTie=!0}),s0(S,s,!1)),n>0&&!(H.rest&&H.rest.type==="spacer")&&(n--,n===0&&(H.endTriplet=!0));for(var b=!1;t<e.length&&!b;){switch(e[t]){case" ":case" ":g0(H);break;case")":H.endSlur===void 0?H.endSlur=1:H.endSlur++;break;case"-":H.pitches.forEach(function(F){F.startTie={}}),s0(S,s,!0);break;case">":case"<":var w=Vn(e,t);t+=w[0]-1,S.next_note_duration=w[2],g?g=g*w[1]:g=w[1];break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"/":var C=fe.getFraction(e,t);g=C.value,t=C.index;var T=e[t];T===" "&&(v=!0),T==="-"||T===")"||T===" "||T==="<"||T===">"?t--:b=!0;break;case"0":g=0;break;default:b=!0;break}b||t++}}else be("Expected ']' to end the chords",e,t);H.pitches!==void 0&&(g!==null&&(H.duration=H.duration*g,v&&g0(H)),S.addFormattingOptions(H,Ue.formatting,"note"),We.appendElement("note",r+o,r+t,H),S.measureNotEmpty=!0,H={}),m=!0}}}else{var B={},E=Mr(e,t,B,!0);if(B.endTie!==void 0&&s0(S,s,!0),E!==null){E.pitch!==void 0?(H.pitches=[{}],E.accidental!==void 0&&(H.pitches[0].accidental=E.accidental),H.pitches[0].pitch=E.pitch,H.pitches[0].name=E.name,(E.midipitch||E.midipitch===0)&&(H.pitches[0].midipitch=E.midipitch),E.endSlur!==void 0&&(H.pitches[0].endSlur=E.endSlur),E.endTie!==void 0&&(H.pitches[0].endTie=E.endTie),E.startSlur!==void 0&&(H.pitches[0].startSlur=E.startSlur),H.startSlur!==void 0&&(H.pitches[0].startSlur=H.startSlur),H.dottedSlur!==void 0&&(H.pitches[0].dottedSlur=!0),E.startTie!==void 0&&(H.pitches[0].startTie=E.startTie),H.startTie!==void 0&&(H.pitches[0].startTie=H.startTie)):(H.rest=E.rest,E.rest.type==="multimeasure"&&Ar()&&(S.currBarNumber+=E.rest.text-1),E.endSlur!==void 0&&(H.endSlur=E.endSlur),E.endTie!==void 0&&(H.rest.endTie=E.endTie),E.startSlur!==void 0&&(H.startSlur=E.startSlur),E.startTie!==void 0&&(H.rest.startTie=E.startTie),H.startTie!==void 0&&(H.rest.startTie=H.startTie)),E.chord!==void 0&&(H.chord=E.chord),E.duration!==void 0&&(H.duration=E.duration),E.decoration!==void 0&&(H.decoration=E.decoration),E.graceNotes!==void 0&&(H.graceNotes=E.graceNotes),delete H.startSlur,delete H.dottedSlur,Ea(S,s,H)&&(H.pitches!==void 0?H.pitches[0].endTie=!0:H.rest.type!=="spacer"&&(H.rest.endTie=!0),s0(S,s,!1)),(E.startTie||H.startTie)&&s0(S,s,!0),t=E.endChar,n>0&&!(E.rest&&E.rest.type==="spacer")&&(n--,n===0&&(H.endTriplet=!0)),E.end_beam&&g0(H),H.rest&&H.rest.type==="rest"&&H.duration===1&&Sa(S)<=1&&(H.rest.type="whole",H.duration=Sa(S)),H.duration<1&&Hs.indexOf(H.duration)===-1&&H.duration!==0&&(!H.rest||H.rest.type!=="spacer")&&be("Duration not representable: "+e.substring(o,t),e,t),S.addFormattingOptions(H,Ue.formatting,"note");var z=We.appendElement("note",r+o,r+t,H);z||(this.startNewLine(),We.appendElement("note",r+o,r+t,H)),S.measureNotEmpty=!0,H={}}}t===o&&(e[t]!==" "&&e[t]!=="`"&&be("Unknown character ignored",e,t),t++)}}}this.lineContinuation=e.indexOf("")>=0||i[0]>0,this.lineContinuation||(H={})}};var s0=function(e,t,r){var a=e.currentVoice?e.currentVoice.staffNum*100+e.currentVoice.index:0;e.inTie[t]===void 0&&(e.inTie[t]=[]),e.inTie[t][a]=r},Gs=function(e,t){if(e[t]==='"'){var r=fe.getBrackettedSubstring(e,t,5);if(r[2]||be("Missing the closing quote while parsing the chord symbol",e,t),r[0]>0&&r[1].length>0&&r[1][0]==="^")r[1]=r[1].substring(1),r[2]="above";else if(r[0]>0&&r[1].length>0&&r[1][0]==="_")r[1]=r[1].substring(1),r[2]="below";else if(r[0]>0&&r[1].length>0&&r[1][0]==="<")r[1]=r[1].substring(1),r[2]="left";else if(r[0]>0&&r[1].length>0&&r[1][0]===">")r[1]=r[1].substring(1),r[2]="right";else if(r[0]>0&&r[1].length>0&&r[1][0]==="@"){r[1]=r[1].substring(1);var a=fe.getFloat(r[1]);if(a.digits===0)return be("Missing first position in absolutely positioned annotation.",e,t),r[1]=r[1].replace("@",""),r[2]="above",r;if(r[1]=r[1].substring(a.digits),r[1][0]!==",")return be("Missing comma absolutely positioned annotation.",e,t),r[1]=r[1].replace("@",""),r[2]="above",r;r[1]=r[1].substring(1);var n=fe.getFloat(r[1]);if(n.digits===0)return be("Missing second position in absolutely positioned annotation.",e,t),r[1]=r[1].replace("@",""),r[2]="above",r;r[1]=r[1].substring(n.digits);var i=fe.skipWhiteSpace(r[1]);r[1]=r[1].substring(i),r[2]=null,r[3]={x:a.value,y:n.value}}else S.freegchord!==!0&&(r[1]=r[1].replace(/([ABCDEFG0-9])b/g,"$1♭"),r[1]=r[1].replace(/([ABCDEFG0-9])#/g,"$1♯"),r[1]=r[1].replace(/^([ABCDEFG])([♯♭]?)o([^A-Za-z])/g,"$1$2°$3"),r[1]=r[1].replace(/^([ABCDEFG])([♯♭]?)o$/g,"$1$2°"),r[1]=r[1].replace(/^([ABCDEFG])([♯♭]?)0([^A-Za-z])/g,"$1$2ø$3"),r[1]=r[1].replace(/^([ABCDEFG])([♯♭]?)\^([^A-Za-z])/g,"$1$2∆$3")),r[2]="default",r[1]=Un.chordName(S,r[1]);return r}return[0,""]},Ys=function(e,t){if(e[t]==="{"){var r=fe.getBrackettedSubstring(e,t,1,"}");r[2]||be("Missing the closing '}' while parsing grace note",e,t),e[t+r[0]]===")"&&(r[0]++,r[1]+=")");for(var a=[],n=0,i=!1;n<r[1].length;){var s=!1;r[1][n]==="/"&&(s=!0,n++);var o=Mr(r[1],n,{},!1);o!==null?(o.duration=o.duration/(S.default_length*8),s&&(o.acciaccatura=!0),o.rest?be("Rests not allowed as grace notes '"+r[1][n]+"' while parsing grace note",e,t):a.push(o),i&&(o.endTie=!0,i=!1),o.startTie&&(i=!0),n=o.endChar,delete o.endChar,o.end_beam&&(o.endBeam=!0,delete o.end_beam)):(r[1][n]===" "?a.length>0&&(a[a.length-1].endBeam=!0):be("Unknown character '"+r[1][n]+"' while parsing grace note",e,t),n++)}if(a.length)return[r[0],a]}return[0]};function qs(e,t){if(e[t]==="&"){for(var r=t;e[t]&&e[t]!==":"&&e[t]!=="|";)t++;return[t-r,e.substring(r+1,t)]}return[0]}function Sa(e){var t=e.origMeter;return!t||t.type!=="specified"||!t.value||t.value.length===0?1:parseInt(t.value[0].num,10)/parseInt(t.value[0].den,10)}var Ma=function(e,t){var r=S.macros[e[t]];if(r!==void 0)return(r[0]==="!"||r[0]==="+")&&(r=r.substring(1)),(r[r.length-1]==="!"||r[r.length-1]==="+")&&(r=r.substring(0,r.length-1)),wa.includes(r)?[1,r]:xa.includes(r)?(S.volumePosition==="hidden"&&(r=""),[1,r]):Ca.includes(r)?(S.dynamicPosition==="hidden"&&(r=""),[1,r]):(S.ignoredDecorations.includes(r)||be("Unknown macro: "+r,e,t),[1,""]);switch(e[t]){case".":if(e[t+1]==="("||e[t+1]==="-")break;return[1,"staccato"];case"u":return[1,"upbow"];case"v":return[1,"downbow"];case"~":return[1,"irishroll"];case"!":case"+":var a=fe.getBrackettedSubstring(e,t,5);if(a[1].length>1&&(a[1][0]==="^"||a[1][0]==="_")&&(a[1]=a[1].substring(1)),wa.includes(a[1]))return a;if(xa.includes(a[1]))return S.volumePosition==="hidden"&&(a[1]=""),a;if(Ca.includes(a[1]))return S.dynamicPosition==="hidden"&&(a[1]=""),a;var n=ka.findIndex(function(i){return a[1]===i[0]});return n>=0?(a[1]=ka[n][1],a):(n=_a.findIndex(function(i){return a[1]===i[0]}),n>=0?(a[1]=_a[n][1],S.dynamicPosition==="hidden"&&(a[1]=""),a):e[t]==="!"&&(a[0]===1||e[t+a[0]-1]!=="!")?[1,null]:(be("Unknown decoration: "+a[1],e,t),a[1]="",a));case"H":return[1,"fermata"];case"J":return[1,"slide"];case"L":return[1,"accent"];case"M":return[1,"mordent"];case"O":return[1,"coda"];case"P":return[1,"pralltriller"];case"R":return[1,"roll"];case"S":return[1,"segno"];case"T":return[1,"trill"];case"t":return[1,"trillh"]}return[0,0]},Ws=function(e,t){for(var r=t;fe.isWhiteSpace(e[t]);)t++;return[t-r]},Xs=function(e,t){var r=fe.getBarLine(e,t);if(r.len===0)return[0,""];if(r.warn)return be(r.warn,e,t),[r.len,""];for(var a=0;a<e.length&&e[t+r.len+a]===" ";a++);var n=r.len;if(e[t+r.len+a]==="["&&(r.len+=a+1),e[t+r.len]==='"'&&e[t+r.len-1]==="["){var i=fe.getBrackettedSubstring(e,t+r.len,5);return[r.len+i[0],r.token,i[1]]}var s=fe.getTokenOf(e.substring(t+r.len),"1234567890-,");return s.len===0||s.token[0]==="-"?[n,r.token]:[r.len+s.len,r.token,s.token]},Us=function(e,t){var r={},a=t;for(e[t]==="."&&e[t+1]==="("&&(r.dottedSlur=!0,t++);e[t]==="("||fe.isWhiteSpace(e[t]);)e[t]==="("&&(t+1<e.length&&e[t+1]>="2"&&e[t+1]<="9"?(r.triplet!==void 0?be("Can't nest triplets",e,t):(r.triplet=e[t+1]-"0",r.tripletQ=Rs[r.triplet],r.num_notes=r.triplet,t+2<e.length&&e[t+2]===":"&&(t+3<e.length&&e[t+3]===":"?t+4<e.length&&e[t+4]>="1"&&e[t+4]<="9"?(r.num_notes=e[t+4]-"0",t+=3):be("expected number after the two colons after the triplet to mark the duration",e,t):t+3<e.length&&e[t+3]>="1"&&e[t+3]<="9"?(r.tripletQ=e[t+3]-"0",t+4<e.length&&e[t+4]===":"?t+5<e.length&&e[t+5]>="1"&&e[t+5]<="9"&&(r.num_notes=e[t+5]-"0",t+=4):t+=2):be("expected number after the triplet to mark the duration",e,t))),t++):r.startSlur===void 0?r.startSlur=1:r.startSlur++),t++;return r.consumed=t-a,r};qr.prototype.startNewLine=function(){var e={startChar:-1,endChar:-1};S.partForNextLine.title&&(e.part=S.partForNextLine),e.clef=S.currentVoice&&S.staves[S.currentVoice.staffNum].clef!==void 0?Object.assign({},S.staves[S.currentVoice.staffNum].clef):Object.assign({},S.clef);var t=S.currentVoice?S.currentVoice.scoreTranspose:0;if(e.key=ya.standardKey(S.key.root+S.key.acc+S.key.mode,S.key.root,S.key.acc,t),e.key.mode=S.key.mode,S.key.impliedNaturals&&(e.key.impliedNaturals=S.key.impliedNaturals),S.key.explicitAccidentals)for(var r=0;r<S.key.explicitAccidentals.length;r++){for(var a=!1,n=0;n<e.key.accidentals.length;n++)e.key.accidentals[n].note===S.key.explicitAccidentals[r].note&&(e.key.accidentals[n].acc=S.key.explicitAccidentals[r].acc,a=!0);a||e.key.accidentals.push(S.key.explicitAccidentals[r])}if(S.targetKey=e.key,e.key.explicitAccidentals&&delete e.key.explicitAccidentals,ya.addPosToKey(e.clef,e.key),S.meter!==null?(S.currentVoice?(S.staves.forEach(function(c){c.meter=S.meter}),e.meter=S.staves[S.currentVoice.staffNum].meter,S.staves[S.currentVoice.staffNum].meter=null):e.meter=S.meter,S.meter=null):S.currentVoice&&S.staves[S.currentVoice.staffNum].meter&&(e.meter=S.staves[S.currentVoice.staffNum].meter,S.staves[S.currentVoice.staffNum].meter=null),S.currentVoice&&S.currentVoice.name&&(e.name=S.currentVoice.name),S.vocalfont&&(e.vocalfont=S.vocalfont),S.tripletfont&&(e.tripletfont=S.tripletfont),S.gchordfont&&(e.gchordfont=S.gchordfont),S.style&&(e.style=S.style),S.currentVoice){var i=S.staves[S.currentVoice.staffNum];i.brace&&(e.brace=i.brace),i.bracket&&(e.bracket=i.bracket),i.connectBarLines&&(e.connectBarLines=i.connectBarLines),i.name&&(e.name=i.name[S.currentVoice.index]),i.subname&&(e.subname=i.subname[S.currentVoice.index]),S.currentVoice.stem&&(e.stem=S.currentVoice.stem),S.currentVoice.stafflines&&(e.stafflines=S.currentVoice.stafflines),S.currentVoice.staffscale&&(e.staffscale=S.currentVoice.staffscale),S.currentVoice.scale&&(e.scale=S.currentVoice.scale),S.currentVoice.color&&(e.color=S.currentVoice.color),S.currentVoice.style&&(e.style=S.currentVoice.style),S.currentVoice.transpose&&(e.clef.transpose=S.currentVoice.transpose),e.currentVoice=S.currentVoice;for(var s=Object.keys(S.voices),o=0;o<s.length;o++)e.currentVoice.staffNum===S.voices[s[o]].staffNum&&e.currentVoice.index===S.voices[s[o]].index&&(e.currentVoiceName=s[o])}S.barNumbers===0&&Ar()&&S.currBarNumber!==1&&(e.barNumber=S.currBarNumber),We.startNewLine(e),S.key.impliedNaturals&&delete S.key.impliedNaturals,S.partForNextLine={},S.tempoForNextLine.length===4&&We.appendElement(S.tempoForNextLine[0],S.tempoForNextLine[1],S.tempoForNextLine[2],S.tempoForNextLine[3]),S.tempoForNextLine=[]};var g0=function(e){return e.duration!==void 0&&e.duration<.25&&(e.end_beam=!0),e},Mr=function(e,t,r,a){var n=function(h){return h==="octave"||h==="duration"||h==="Zduration"||h==="broken_rhythm"||h==="end_slur"},i;e[t]==="."&&e[t+1]==="-"&&(i=!0,t++);for(var s="startSlur",o=!1;;){switch(e[t]){case"(":if(s==="startSlur")r.startSlur===void 0?r.startSlur=1:r.startSlur++;else return n(s)?(r.endChar=t,r):null;break;case")":if(n(s))r.endSlur===void 0?r.endSlur=1:r.endSlur++;else return null;break;case"^":if(s==="startSlur")r.accidental="sharp",s="sharp2";else if(s==="sharp2")r.accidental="dblsharp",s="pitch";else return n(s)?(r.endChar=t,r):null;break;case"_":if(s==="startSlur")r.accidental="flat",s="flat2";else if(s==="flat2")r.accidental="dblflat",s="pitch";else return n(s)?(r.endChar=t,r):null;break;case"=":if(s==="startSlur")r.accidental="natural",s="pitch";else return n(s)?(r.endChar=t,r):null;break;case"A":case"B":case"C":case"D":case"E":case"F":case"G":case"a":case"b":case"c":case"d":case"e":case"f":case"g":if(s==="startSlur"||s==="sharp2"||s==="flat2"||s==="pitch"){if(r.pitch=zs[e[t]],r.pitch+=7*(S.currentVoice&&S.currentVoice.octave!==void 0?S.currentVoice.octave:S.octave),r.name=e[t],r.accidental&&(r.name=Ta[r.accidental]+r.name),Un.note(S,r),s="octave",a&&S.next_note_duration!==0?(r.duration=S.default_length*S.next_note_duration,S.next_note_duration=0,o=!0):r.duration=S.default_length,S.clef&&S.clef.type==="perc"||S.currentVoice&&S.currentVoice.clef==="perc"){var c=e[t];r.accidental&&(c=Ta[r.accidental]+c),Ue.formatting&&Ue.formatting.midi&&Ue.formatting.midi.drummap&&(r.midipitch=Ue.formatting.midi.drummap[c])}}else return n(s)?(r.endChar=t,r):null;break;case",":if(s==="octave")r.pitch-=7,r.name+=",";else return n(s)?(r.endChar=t,r):null;break;case"'":if(s==="octave")r.pitch+=7,r.name+="'";else return n(s)?(r.endChar=t,r):null;break;case"x":case"X":case"y":case"z":case"Z":if(s==="startSlur")r.rest={type:$s[e[t]]},delete r.accidental,delete r.startSlur,delete r.startTie,delete r.endSlur,delete r.endTie,delete r.end_beam,delete r.grace_notes,r.rest.type.indexOf("multimeasure")>=0?(r.duration=Ue.getBarLength(),r.rest.text=1,s="Zduration"):(a&&S.next_note_duration!==0?(r.duration=S.default_length*S.next_note_duration,S.next_note_duration=0,o=!0):r.duration=S.default_length,s="duration");else return n(s)?(r.endChar=t,r):null;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"0":case"/":if(s==="octave"||s==="duration"){var f=fe.getFraction(e,t);for(r.duration=r.duration*f.value,r.endChar=f.index;f.index<e.length&&(fe.isWhiteSpace(e[f.index])||e[f.index]==="-");)e[f.index]==="-"?r.startTie={}:r=g0(r),f.index++;t=f.index-1,s="broken_rhythm"}else if(s==="sharp2")r.accidental="quartersharp",s="pitch";else if(s==="flat2")r.accidental="quarterflat",s="pitch";else if(s==="Zduration"){var u=fe.getNumber(e,t);return r.duration=u.num*Ue.getBarLength(),r.rest.text=u.num,r.endChar=u.index,r}else return null;break;case"-":if(s==="startSlur")We.addTieToLastNote(i),r.endTie=!0;else if(s==="octave"||s==="duration"||s==="end_slur")if(r.startTie={},!o&&a)s="broken_rhythm";else return fe.isWhiteSpace(e[t+1])&&g0(r),r.endChar=t+1,r;else return s==="broken_rhythm"?(r.endChar=t,r):null;break;case" ":case" ":if(n(s)){r.end_beam=!0,i=!1;do e[t]==="."&&e[t+1]==="-"&&(i=!0,t++),e[t]==="-"&&(r.startTie={},i&&(r.startTie.style="dotted")),t++;while(t<e.length&&(fe.isWhiteSpace(e[t])||e[t]==="-")||e[t]==="."&&e[t+1]==="-");if(r.endChar=t,!o&&a&&(e[t]==="<"||e[t]===">"))t--,s="broken_rhythm";else return r}else return null;break;case">":case"<":if(n(s))if(a){var l=Vn(e,t);t+=l[0]-1,S.next_note_duration=l[2],r.duration=l[1]*r.duration,s="end_slur"}else return r.endChar=t,r;else return null;break;default:return n(s)?(r.endChar=t,r):null}if(t++,t===e.length)return n(s)?(r.endChar=t,r):null}return null},Vn=function(e,t){switch(e[t]){case">":return t<e.length-2&&e[t+1]===">"&&e[t+2]===">"?[3,1.875,.125]:t<e.length-1&&e[t+1]===">"?[2,1.75,.25]:[1,1.5,.5];case"<":return t<e.length-2&&e[t+1]==="<"&&e[t+2]==="<"?[3,.125,1.875]:t<e.length-1&&e[t+1]==="<"?[2,.25,1.75]:[1,.5,1.5]}return null};function Ar(){return S.currentVoice===void 0||S.currentVoice.staffNum===0&&S.currentVoice.index===0}var Vs=qr,Ce=rt,Wr=function(e,t){this.lineIndex=0,this.lines=e,this.multilineVars=t,this.skipWhiteSpace=function(l){for(var h=0;h<l.length;h++)if(!this.isWhiteSpace(l[h]))return h;return l.length};var r=function(l,h){return h>=l.length};this.eatWhiteSpace=function(l,h){for(var d=h;d<l.length;d++)if(!this.isWhiteSpace(l[d]))return d-h;return d-h},this.getKeyPitch=function(l){var h=this.skipWhiteSpace(l);if(r(l,h))return{len:0};switch(l[h]){case"A":return{len:h+1,token:"A"};case"B":return{len:h+1,token:"B"};case"C":return{len:h+1,token:"C"};case"D":return{len:h+1,token:"D"};case"E":return{len:h+1,token:"E"};case"F":return{len:h+1,token:"F"};case"G":return{len:h+1,token:"G"}}return{len:0}},this.getSharpFlat=function(l){if(l==="bass")return{len:0};switch(l[0]){case"#":return{len:1,token:"#"};case"b":return{len:1,token:"b"}}return{len:0}},this.getMode=function(l){var h=function(g,v){for(;v<g.length&&(g[v]>="a"&&g[v]<="z"||g[v]>="A"&&g[v]<="Z");)v++;return v},d=this.skipWhiteSpace(l);if(r(l,d))return{len:0};var p=l.substring(d,d+3).toLowerCase();switch((p.length>1&&p[1]===" "||p[1]==="^"||p[1]==="_"||p[1]==="=")&&(p=p[0]),p){case"mix":return{len:h(l,d),token:"Mix"};case"dor":return{len:h(l,d),token:"Dor"};case"phr":return{len:h(l,d),token:"Phr"};case"lyd":return{len:h(l,d),token:"Lyd"};case"loc":return{len:h(l,d),token:"Loc"};case"aeo":return{len:h(l,d),token:"m"};case"maj":return{len:h(l,d),token:""};case"ion":return{len:h(l,d),token:""};case"min":return{len:h(l,d),token:"m"};case"m":return{len:h(l,d),token:"m"}}return{len:0}},this.getClef=function(l,h){var d=l,p=this.skipWhiteSpace(l);if(r(l,p))return{len:0};var g=!1,v=l.substring(p);if(Ce.startsWith(v,"clef=")&&(g=!0,v=v.substring(5),p+=5),v.length===0&&g)return{len:p+5,warn:"No clef specified: "+d};var m=this.skipWhiteSpace(v);if(r(v,m))return{len:0};m>0&&(p+=m,v=v.substring(m));var y=null;if(Ce.startsWith(v,"treble"))y="treble";else if(Ce.startsWith(v,"bass3"))y="bass3";else if(Ce.startsWith(v,"bass"))y="bass";else if(Ce.startsWith(v,"tenor"))y="tenor";else if(Ce.startsWith(v,"alto2"))y="alto2";else if(Ce.startsWith(v,"alto1"))y="alto1";else if(Ce.startsWith(v,"alto"))y="alto";else if(!h&&g&&Ce.startsWith(v,"none"))y="none";else if(Ce.startsWith(v,"perc"))y="perc";else if(!h&&g&&Ce.startsWith(v,"C"))y="tenor";else if(!h&&g&&Ce.startsWith(v,"F"))y="bass";else if(!h&&g&&Ce.startsWith(v,"G"))y="treble";else return{len:p+5,warn:"Unknown clef specified: "+d};return v=v.substring(y.length),m=this.isMatch(v,"+8"),m>0?y+="+8":(m=this.isMatch(v,"-8"),m>0&&(y+="-8")),{len:p+y.length,token:y,explicit:g}},this.getBarLine=function(l,h){switch(l[h]){case"]":switch(++h,l[h]){case"|":return{len:2,token:"bar_thick_thin"};case"[":return++h,l[h]>="1"&&l[h]<="9"||l[h]==='"'?{len:2,token:"bar_invisible"}:{len:1,warn:"Unknown bar symbol"};default:return{len:1,token:"bar_invisible"}}case":":switch(++h,l[h]){case":":return{len:2,token:"bar_dbl_repeat"};case"|":switch(++h,l[h]){case"]":switch(++h,l[h]){case"|":return++h,l[h]===":"?{len:5,token:"bar_dbl_repeat"}:{len:3,token:"bar_right_repeat"};default:return{len:3,token:"bar_right_repeat"}}case"|":return++h,l[h]===":"?{len:4,token:"bar_dbl_repeat"}:{len:3,token:"bar_right_repeat"};default:return{len:2,token:"bar_right_repeat"}}default:return{len:1,warn:"Unknown bar symbol"}}case"[":if(++h,l[h]==="|")switch(++h,l[h]){case":":return{len:3,token:"bar_left_repeat"};case"]":return{len:3,token:"bar_invisible"};default:return{len:2,token:"bar_thick_thin"}}else return l[h]>="1"&&l[h]<="9"||l[h]==='"'?{len:1,token:"bar_invisible"}:{len:0};case"|":switch(++h,l[h]){case"]":return{len:2,token:"bar_thin_thick"};case"|":return++h,l[h]===":"?{len:3,token:"bar_left_repeat"}:{len:2,token:"bar_thin_thin"};case":":for(var d=0;l[h+d]===":";)d++;return{len:1+d,token:"bar_left_repeat"};default:return{len:1,token:"bar_thin"}}}return{len:0}},this.getTokenOf=function(l,h){for(var d=0;d<l.length;d++)if(h.indexOf(l[d])<0)return{len:d,token:l.substring(0,d)};return{len:d,token:l}},this.getToken=function(l,h,d){for(var p=h;p<d&&!this.isWhiteSpace(l[p]);)p++;return l.substring(h,p)},this.isMatch=function(l,h){var d=this.skipWhiteSpace(l);return r(l,d)?0:Ce.startsWith(l.substring(d),h)?d+h.length:0},this.getPitchFromTokens=function(l){var h={},d={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11};if(h.position=d[l[0].token],h.position===void 0)return{warn:"Pitch expected. Found: "+l[0].token};for(l.shift();l.length;)switch(l[0].token){case",":h.position-=7,l.shift();break;case"'":h.position+=7,l.shift();break;default:return h}return h},this.getKeyAccidentals2=function(l){for(var h;l.length>0;){var d;if(l[0].token==="^"){if(d="sharp",l.shift(),l.length===0)return{accs:h,warn:"Expected note name after "+d};switch(l[0].token){case"^":d="dblsharp",l.shift();break;case"/":d="quartersharp",l.shift();break}}else if(l[0].token==="=")d="natural",l.shift();else if(l[0].token==="_"){if(d="flat",l.shift(),l.length===0)return{accs:h,warn:"Expected note name after "+d};switch(l[0].token){case"_":d="dblflat",l.shift();break;case"/":d="quarterflat",l.shift();break}}else return{accs:h};if(l.length===0)return{accs:h,warn:"Expected note name after "+d};switch(l[0].token[0]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":h===void 0&&(h=[]),h.push({acc:d,note:l[0].token[0]}),l[0].token.length===1?l.shift():l[0].token=l[0].token.substring(1);break;default:return{accs:h,warn:"Expected note name after "+d+" Found: "+l[0].token}}}return{accs:h}},this.getKeyAccidental=function(l){var h={"^":"sharp","^^":"dblsharp","=":"natural",_:"flat",__:"dblflat","_/":"quarterflat","^/":"quartersharp"},d=this.skipWhiteSpace(l);if(r(l,d))return{len:0};var p=null;switch(l[d]){case"^":case"_":case"=":p=l[d];break;default:return{len:0}}if(d++,r(l,d))return{len:1,warn:"Expected note name after accidental"};switch(l[d]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":return{len:d+1,token:{acc:h[p],note:l[d]}};case"^":case"_":case"/":if(p+=l[d],d++,r(l,d))return{len:2,warn:"Expected note name after accidental"};switch(l[d]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":return{len:d+1,token:{acc:h[p],note:l[d]}};default:return{len:2,warn:"Expected note name after accidental"}}break;default:return{len:1,warn:"Expected note name after accidental"}}},this.isWhiteSpace=function(l){return l===" "||l===" "||l===""},this.getMeat=function(l,h,d){var p=l.indexOf("%",h);for(p>=0&&p<d&&(d=p);h<d&&(l[h]===" "||l[h]===" "||l[h]==="");)h++;for(;h<d&&(l[d-1]===" "||l[d-1]===" "||l[d-1]==="");)d--;return{start:h,end:d}};var a=function(l){return l>="A"&&l<="Z"||l>="a"&&l<="z"},n=function(l){return l>="0"&&l<="9"};this.tokenize=function(l,h,d,p){var g=this.getMeat(l,h,d);h=g.start,d=g.end;for(var v=[],m;h<d;){if(l[h]==='"'){for(m=h+1;m<d&&l[m]!=='"';)m++;v.push({type:"quote",token:l.substring(h+1,m),start:h+1,end:m}),m++}else if(a(l[h])){if(m=h+1,p)for(;m<d&&!this.isWhiteSpace(l[m]);)m++;else for(;m<d&&a(l[m]);)m++;v.push({type:"alpha",token:l.substring(h,m),continueId:n(l[m]),start:h,end:m}),h=m+1}else if(l[h]==="."&&n(l[m+1])){m=h+1;for(var y=null,x=null;m<d&&n(l[m]);)m++;x=parseFloat(l.substring(h,m)),v.push({type:"number",token:l.substring(h,m),intt:y,floatt:x,continueId:a(l[m]),start:h,end:m}),h=m+1}else if(n(l[h])||l[h]==="-"&&n(l[m+1])){m=h+1;for(var b=null,w=null;m<d&&n(l[m]);)m++;if(l[m]==="."&&n(l[m+1]))for(m++;m<d&&n(l[m]);)m++;else b=parseInt(l.substring(h,m));w=parseFloat(l.substring(h,m)),v.push({type:"number",token:l.substring(h,m),intt:b,floatt:w,continueId:a(l[m]),start:h,end:m}),h=m+1}else l[h]===" "||l[h]===" "||v.push({type:"punct",token:l[h],start:h,end:h+1}),m=h+1;h=m}return v},this.getVoiceToken=function(l,h,d){for(var p=h;p<d&&this.isWhiteSpace(l[p])||l[p]==="=";)p++;if(l[p]==='"'){var g=l.indexOf('"',p+1);return g===-1||g>=d?{len:1,err:"Missing close quote"}:{len:g-h+1,token:this.translateString(l.substring(p+1,g))}}else{for(var v=p;v<d&&!this.isWhiteSpace(l[v])&&l[v]!=="=";)v++;return{len:v-h+1,token:l.substring(p,v)}}};var i={"`a":"à","'a":"á","^a":"â","~a":"ã",'"a':"ä",oa:"å",aa:"å","=a":"ā",ua:"ă",";a":"ą","`e":"è","'e":"é","^e":"ê",'"e':"ë","=e":"ē",ue:"ĕ",";e":"ę",".e":"ė","`i":"ì","'i":"í","^i":"î",'"i':"ï","=i":"ī",ui:"ĭ",";i":"į","`o":"ò","'o":"ó","^o":"ô","~o":"õ",'"o':"ö","=o":"ō",uo:"ŏ","/o":"ø","`u":"ù","'u":"ú","^u":"û","~u":"ũ",'"u':"ü",ou:"ů","=u":"ū",uu:"ŭ",";u":"ų","`A":"À","'A":"Á","^A":"Â","~A":"Ã",'"A':"Ä",oA:"Å",AA:"Å","=A":"Ā",uA:"Ă",";A":"Ą","`E":"È","'E":"É","^E":"Ê",'"E':"Ë","=E":"Ē",uE:"Ĕ",";E":"Ę",".E":"Ė","`I":"Ì","'I":"Í","^I":"Î","~I":"Ĩ",'"I':"Ï","=I":"Ī",uI:"Ĭ",";I":"Į",".I":"İ","`O":"Ò","'O":"Ó","^O":"Ô","~O":"Õ",'"O':"Ö","=O":"Ō",uO:"Ŏ","/O":"Ø","`U":"Ù","'U":"Ú","^U":"Û","~U":"Ũ",'"U':"Ü",oU:"Ů","=U":"Ū",uU:"Ŭ",";U":"Ų",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",ss:"ß","'c":"ć","^c":"ĉ",uc:"č",cc:"ç",".c":"ċ",cC:"Ç","'C":"Ć","^C":"Ĉ",uC:"Č",".C":"Ċ","~N":"Ñ","~n":"ñ","=s":"š",vs:"š",DH:"Ð",dh:"ð",HO:"Ő",Ho:"ő",HU:"Ű",Hu:"ű","'Y":"Ý","'y":"ý","^Y":"Ŷ","^y":"ŷ",'"Y':"Ÿ",'"y':"ÿ",vS:"Š",vZ:"Ž",vz:"ž"},s={"#":"♯",b:"♭","=":"♮"},o={201:"♯",202:"♭",203:"♮",241:"¡",242:"¢",252:"a",262:"2",272:"o",302:"Â",312:"Ê",322:"Ò",332:"Ú",342:"â",352:"ê",362:"ò",372:"ú",243:"£",253:"«",263:"3",273:"»",303:"Ã",313:"Ë",323:"Ó",333:"Û",343:"ã",353:"ë",363:"ó",373:"û",244:"¤",254:"¬",264:" ́",274:"1⁄4",304:"Ä",314:"Ì",324:"Ô",334:"Ü",344:"ä",354:"ì",364:"ô",374:"ü",245:"¥",255:"-",265:"μ",275:"1⁄2",305:"Å",315:"Í",325:"Õ",335:"Ý",345:"å",355:"í",365:"õ",375:"ý",246:"¦",256:"®",266:"¶",276:"3⁄4",306:"Æ",316:"Î",326:"Ö",336:"Þ",346:"æ",356:"î",366:"ö",376:"þ",247:"§",257:" ̄",267:"·",277:"¿",307:"Ç",317:"Ï",327:"×",337:"ß",347:"ç",357:"ï",367:"÷",377:"ÿ",250:" ̈",260:"°",270:" ̧",300:"À",310:"È",320:"Ð",330:"Ø",340:"à",350:"è",360:"ð",370:"ø",251:"©",261:"±",271:"1",301:"Á",311:"É",321:"Ñ",331:"Ù",341:"á",351:"é",361:"ñ",371:"ù"};this.translateString=function(l){var h=l.split("\\");if(h.length===1)return l;var d=null;return h.forEach(function(p){if(d===null)d=p;else{var g=i[p.substring(0,2)];g!==void 0?d+=g+p.substring(2):(g=o[p.substring(0,3)],g!==void 0?d+=g+p.substring(3):(g=s[p.substring(0,1)],g!==void 0?d+=g+p.substring(1):d+="\\"+p))}}),d},this.getNumber=function(l,h){for(var d=0;h<l.length;)switch(l[h]){case"0":d=d*10,h++;break;case"1":d=d*10+1,h++;break;case"2":d=d*10+2,h++;break;case"3":d=d*10+3,h++;break;case"4":d=d*10+4,h++;break;case"5":d=d*10+5,h++;break;case"6":d=d*10+6,h++;break;case"7":d=d*10+7,h++;break;case"8":d=d*10+8,h++;break;case"9":d=d*10+9,h++;break;default:return{num:d,index:h}}return{num:d,index:h}},this.getFraction=function(l,h){var d=1,p=1;if(l[h]!=="/"){var g=this.getNumber(l,h);d=g.num,h=g.index}if(l[h]==="/")if(h++,l[h]==="/"){for(var v=.5;l[h++]==="/";)v=v/2;return{value:d*v,index:h-1}}else{var m=h,y=this.getNumber(l,h);y.num===0&&m===h&&(y.num=2),y.num!==0&&(p=y.num),h=y.index}return{value:d/p,index:h}};function c(l){const d=/^(\d+)\./.exec(l);return d?d[1]:null}var f=[{match:/,\s*The$/,replace:"The "},{match:/,\s*the$/,replace:"the "},{match:/,\s*A$/,replace:"A "},{match:/,\s*a$/,replace:"a "},{match:/,\s*An$/,replace:"An "},{match:/,\s*an$/,replace:"an "},{match:/,\s*Da$/,replace:"Da "},{match:/,\s*La$/,replace:"La "},{match:/,\s*Le$/,replace:"Le "},{match:/,\s*Les$/,replace:"Les "},{match:/,\s*Ye$/,replace:"Ye "}];this.theReverser=function(l){for(var h=0;h<f.length;h++){var d=f[h],p=l.match(d.match);if(p){var g=c(l);g&&(l=l.replace(g+".",""),l=l.trim());var v=p[0].length,m=d.replace+l.substring(0,l.length-v);return g&&(m=g+". "+m),m}}return l},this.stripComment=function(l){var h=l.indexOf("%");return h>=0?Ce.strip(l.substring(0,h)):Ce.strip(l)},this.getInt=function(l){var h=parseInt(l);if(isNaN(h))return{digits:0};var d=""+h,p=l.indexOf(d);return{value:h,digits:p+d.length}},this.getFloat=function(l){var h=parseFloat(l);if(isNaN(h))return{digits:0};var d=""+h,p=l.indexOf(d);return{value:h,digits:p+d.length}},this.getMeasurement=function(l){if(l.length===0)return{used:0};var h=1,d="";if(l[0].token==="-")l.shift(),d="-",h++;else if(l[0].type!=="number")return{used:0};if(d+=l.shift().token,l.length===0)return{used:1,value:parseInt(d)};var p=l.shift();if(p.token==="."){if(h++,l.length===0)return{used:h,value:parseInt(d)};if(l[0].type==="number"&&(p=l.shift(),d=d+"."+p.token,h++,l.length===0))return{used:h,value:parseFloat(d)};p=l.shift()}switch(p.token){case"pt":return{used:h+1,value:parseFloat(d)};case"px":return{used:h+1,value:parseFloat(d)};case"cm":return{used:h+1,value:parseFloat(d)/2.54*72};case"in":return{used:h+1,value:parseFloat(d)*72};default:return l.unshift(p),{used:h,value:parseFloat(d)}}};var u=function(l){return l=l.replace(/\\n/g,`
6
- `),l=l.replace(/\\"/g,'"'),l};this.getBrackettedSubstring=function(l,h,d,p){for(var g=p||l[h],v=h+1,m=!1;v<l.length&&(m||l[v]!==g);)m=l[v]==="\\",++v;return l[v]===g?[v-h+1,u(l.substring(h+1,v)),!0]:(v=h+d,v>l.length-1&&(v=l.length-1),[v-h+1,u(l.substring(h+1,v)),!1])}};Wr.prototype.peekLine=function(){return this.lines[this.lineIndex]};Wr.prototype.nextLine=function(){if(this.lineIndex>0&&(this.multilineVars.iChar+=this.lines[this.lineIndex-1].length+1),this.lineIndex<this.lines.length){var e=this.lines[this.lineIndex];return this.lineIndex++,e}return null};var js=Wr;function Ks(e,t,r){if(!(!t||e.lines.length===0)){var a=e.deline({lineBreaks:!1}),n=Js(a,t);e.lines=Qs(a,n,r),e.lineBreaks=n}}function Qs(e,t,r){for(var a=[],n=[],i=[],s=1,o=0;o<t.length;o++){var c=t[o];if(e[c.ogLine].staff){var f=e[c.ogLine].staff[c.staff];if(a[c.line]||(a[c.line]={staff:[]}),!a[c.line].staff[c.staff]){a[c.line].staff[c.staff]={voices:[]},r!==void 0&&c.staff===0&&c.line>0&&(a[c.line].staff[c.staff].barNumber=s);for(var u=Object.keys(f),l=0;l<u.length;l++){var h=u[l]==="voices";u[l]==="meter"&&c.line!==0&&(h=!0),h||(a[c.line].staff[c.staff][u[l]]=f[u[l]])}n[c.staff]&&(a[c.line].staff[c.staff].key=n[c.staff])}a[c.line].staff[c.staff].voices[c.voice]||(a[c.line].staff[c.staff].voices[c.voice]=[]),a[c.line].staff[c.staff].voices[c.voice]=e[c.ogLine].staff[c.staff].voices[c.voice].slice(c.start,c.end+1),i[c.staff*10+c.voice]&&a[c.line].staff[c.staff].voices[c.voice].unshift({el_type:"stem",direction:i[c.staff*10+c.voice].direction});for(var d=a[c.line].staff[c.staff].voices[c.voice],p=d.length-1;p>=0;p--)if(d[p].el_type==="key"){n[c.staff]={root:d[p].root,acc:d[p].acc,mode:d[p].mode,accidentals:d[p].accidentals.filter(function(v){return v.acc!=="natural"})};break}for(p=d.length-1;p>=0;p--)if(d[p].el_type==="stem"){i[c.staff*10+c.voice]={direction:d[p].direction};break}if(r!==void 0&&c.staff===0&&c.voice===0)for(p=0;p<d.length;p++)d[p].el_type==="bar"&&(s++,p===d.length-1?delete d[p].barNumber:d[p].barNumber=s)}else a[c.line]=e[c.ogLine]}for(var g=0;g<a.length;g++)a[g].staff&&(a[g].staff=a[g].staff.filter(function(v){return v!=null}));return a}function Js(e,t){for(var r=[],a=0,n=0,i=0,s=0;s<e.length;s++){var o=e[s];if(o.staff){var c=n,f=t[a];a++;for(var u=0;u<o.staff.length;u++)for(var l=o.staff[u],h=0;h<l.voices.length;h++){i=c;for(var d=0,p=0,g=l.voices[h],v=0,m=0;m<g.length;m++){var y=g[m];y.el_type==="bar"&&(f[p]===d&&(r.push({ogLine:s,line:i,staff:u,voice:h,start:v,end:m}),v=m+1,i++,n=Math.max(n,i),p++),d++)}r.push({ogLine:s,line:i,staff:u,voice:h,start:v,end:g.length}),i++,n=Math.max(n,i)}}else r.push({ogLine:s,line:i}),i++,n=Math.max(n,i)}return r}function Zs(e,t){for(var r=[],a=[],n=0,i=0;i<e.length;i++){var s=e[i],o=n+s;if(o<t)n=o;else{var c=t-n,f=o-t;c<f&&n>0?(r.push(i-1),a.push(Math.round(n-s)),n=s):i<e.length-1&&(r.push(i),a.push(Math.round(n)),n=0)}}return a.push(Math.round(n)),{lineBreaks:r,totals:a}}function D0(e){for(var t=[],r=0;r<e.length;r++)t.push(e[r]);return t}function eo(e,t,r,a,n,i,s,o,c,f,u){for(var l=f;l<e.length;l++){var h=e[l];r+=h,a+=h;var d=Math.abs(r-t[o]),p=Math.abs(d-i)<t[0]/10;if(p)if(d<i){var g=D0(n),v=D0(c);v.push(l-1),g.push(a-h),u.push({accumulator:r,lineAccumulator:h,lineWidths:g,lastVariance:Math.abs(r-t[o+1]),highestVariance:Math.max(s,i),currLine:o+1,lineBreaks:v,startIndex:l+1})}else d>i&&l<e.length-1&&(g=D0(n),v=D0(c),u.push({accumulator:r,lineAccumulator:a,lineWidths:g,lastVariance:d,highestVariance:Math.max(s,d),currLine:o,lineBreaks:v,startIndex:l+1}));d>i?(c.push(l-1),o++,s=Math.max(s,i),i=Math.abs(r-t[o]),n.push(a-h),a=h):i=d}n.push(a)}function to(e,t,r,a){for(var n=Math.ceil(e.total/t),i=Math.floor(e.total/n),s=[],o=0;o<n;o++)s.push(i*(o+1));var c=[];c.push({accumulator:0,lineAccumulator:0,lineWidths:[],lastVariance:999999,highestVariance:0,currLine:0,lineBreaks:[],startIndex:0});for(var f=0;f<c.length;)eo(e.measureWidths,s,c[f].accumulator,c[f].lineAccumulator,c[f].lineWidths,c[f].lastVariance,c[f].highestVariance,c[f].currLine,c[f].lineBreaks,c[f].startIndex,c),f++;for(o=0;o<c.length;o++){var u=c[o];u.variances=[],u.aveVariance=0;for(var l=0;l<u.lineWidths.length;l++){var h=u.lineWidths[l];u.variances.push(h-s[0]),u.aveVariance+=Math.abs(h-s[0])}u.aveVariance=u.aveVariance/u.lineWidths.length,a.attempts.push({type:"optimizeLineWidths",lineBreaks:u.lineBreaks,variances:u.variances,aveVariance:u.aveVariance,widths:e.measureWidths})}var d=9999999,p=-1;for(o=0;o<c.length;o++)u=c[o],u.aveVariance<d&&(d=u.aveVariance,p=o);return{failed:!1,lineBreaks:c[p].lineBreaks,variance:c[p].highestVariance}}function ro(e,t,r){for(var a=[],n=[],i=0,s=!1,o=0;o<e.length;o++)i+=e[o],i>t&&(s=!0),o%r===r-1&&(o!==e.length-1&&a.push(o),n.push(Math.round(i)),i=0);return{failed:s,totals:n,lineBreaks:a}}function ao(e,t,r){var a={lineBreaks:e,staffwidth:t};for(var n in r)r.hasOwnProperty(n)&&n!=="wrap"&&n!=="staffwidth"&&(a[n]=r[n]);return{revisedParams:a}}function no(e,t,r){if(t.length===0||r.staffwidth<t[0].left)return{reParse:!1,explanation:"Staff width is narrower than the margin",revisedParams:r};var a=r.scale?Math.max(r.scale,.1):1,n=r.wrap.minSpacing?Math.max(parseFloat(r.wrap.minSpacing),1):1,i=r.wrap.minSpacingLimit?Math.max(parseFloat(r.wrap.minSpacingLimit),1):n-.1,s=r.wrap.maxSpacing?Math.max(parseFloat(r.wrap.maxSpacing),1):void 0;r.wrap.lastLineLimit&&!s&&(s=Math.max(parseFloat(r.wrap.lastLineLimit),1));for(var o=r.wrap.preferredMeasuresPerLine?Math.max(parseInt(r.wrap.preferredMeasuresPerLine,10),0):void 0,c=[],f=[],u=0;u<t.length;u++){var l=t[u],h=r.staffwidth-l.left,d=h/n/a,p=h/s/a,g=h/i/a,v={widths:l,lineBreakPoint:d,minLineSize:p,attempts:[],staffWidth:r.staffwidth,minWidth:Math.round(g)},m=null;if(o){var y=ro(l.measureWidths,d,o);v.attempts.push({type:"Fixed Measures Per Line",preferredMeasuresPerLine:o,lineBreaks:y.lineBreaks,failed:y.failed,totals:y.totals}),y.failed||(m=y.lineBreaks)}if(!m){var x=Zs(l.measureWidths,d);v.attempts.push({type:"Free Form",lineBreaks:x.lineBreaks,totals:x.totals}),m=x.lineBreaks,m.length>0&&l.measureWidths.length<25&&(x=to(l,d,m,v),v.attempts.push({type:"Optimize",failed:x.failed,reason:x.reason,lineBreaks:x.lineBreaks,totals:x.totals}),x.failed||(m=x.lineBreaks))}c.push(m),f.push(v)}var b=r.staffwidth,w=ao(c,b,r);return w.explanation=f,w.reParse=!0,w}var jn={wrapLines:Ks,calcLineWraps:no};function io(e){const t=e.getMeterFraction(),r=t.num===4&&t.den===4;if(!(t.num===2&&t.den===2)&&!r)throw new Error("notCommonTime");const n=e.deline();let i=[],s=!1;return n.forEach(o=>{if(o.subtitle)s&&i.push({type:"subtitle",subtitle:o.subtitle.text});else if(o.text)s=!0,i.push({type:"text",text:o.text.text});else if(o.staff){s=!0;const c=o.staff,f=so(c);i=i.concat(f)}}),co(i),lo(i),ho(i),i}const Aa=["break","(break)","no chord","n.c.","tacet"];function so(e){const t=[];let r="",a=[],n={chord:["","","",""]},i="",s="";if(e.forEach((o,c)=>{o.voices&&o.voices.forEach((f,u)=>{let l=0,h=0;f.forEach(d=>{if(d.el_type==="part")a.length>0&&c===0&&u===0&&(t.push({type:"part",name:r,lines:[a]}),a=[]),r=d.title;else if(d.el_type==="note"){Ba(d,n);const p=Math.floor(l);if(d.chord&&d.chord.length>0){const g=d.chord[0],v=g.position==="default"||Aa.indexOf(g.name.toLowerCase())>=0?g.name:"";v&&(p>0&&!n.chord[0]&&(n.chord[0]=i),i=v,n.chord[p]?p<4&&!n.chord[p+1]&&(n.chord[p+1]=v):n.chord[p]=v),d.chord.forEach(m=>{m.position!=="default"&&Aa.indexOf(g.name.toLowerCase())<0&&(n.annotations||(n.annotations=[]),n.annotations.push(m.name))})}if(!d.rest||d.rest.type!=="spacer"){const g=d.duration===0&&!d.rest?.25:d.duration,v=Math.floor(g*4);if(v>4)h+=Math.floor(v/4),l=0;else{let m=g*4;d.tripletMultiplier&&(m*=d.tripletMultiplier),l+=m}}}else if(d.el_type==="bar"){if(s&&(n.ending=s,s=""),Ba(d,n),d.chord&&d.chord.forEach(p=>{p.position!=="default"&&(n.annotations||(n.annotations=[]),n.annotations.push(p.name))}),(d.type==="bar_dbl_repeat"||d.type==="bar_left_repeat")&&(n.hasStartRepeat=!0),(d.type==="bar_dbl_repeat"||d.type==="bar_right_repeat")&&(n.hasEndRepeat=!0),d.startEnding&&(s=d.startEnding),l>=4){if(n.chord[0]===""&&(n.chord[1]||n.chord[2]||n.chord[3])&&(n.chord[0]=oo(a)),c===0&&u===0)a.push(n);else{let p=h,g=0;for(;p>=t[g].lines[0].length&&g<t.length;)p-=t[g].lines[0].length,g++;if(g<t.length&&p<t[g].lines[0].length){const v=t[g].lines[0][p];!v.chord[0]&&n.chord[0]&&(v.chord[0]=n.chord[0]),!v.chord[1]&&n.chord[1]&&(v.chord[1]=n.chord[1]),!v.chord[2]&&n.chord[2]&&(v.chord[2]=n.chord[2]),!v.chord[3]&&n.chord[3]&&(v.chord[3]=n.chord[3]),n.annotations&&(v.annotations?v.annotations=v.annotations.concat(n.annotations):v.annotations=n.annotations)}h++}n={chord:["","","",""]}}else n.chord=["","","",""];l=0}else d.el_type}),c===0&&u===0&&t.push({type:"part",name:r,lines:[a]})})}),!i)throw new Error("noChords");return t}function oo(e){for(let t=e.length-1;t>=0;t--)for(let r=e[t].chord.length-1;r>=0;r--)if(e[t].chord[r])return e[t].chord[r]}function co(e){e.forEach(t=>{if(t.type==="part"){const r=t.lines[0],a=r.findIndex(i=>!!i.ending),n=r.findIndex((i,s)=>s>a&&!!i.ending);if(a>=0&&n>=0&&n-a===r.length-n){let i=!0;for(let s=0;s<n-a&&i;s++){const o=r[a+s],c=r[n+s];if(o.chord[0]!==c.chord[0]&&(i=!1),o.chord[1]!==c.chord[1]&&(i=!1),o.chord[2]!==c.chord[2]&&(i=!1),o.chord[3]!==c.chord[3]&&(i=!1),o.annotations&&!c.annotations&&(i=!1),!o.annotations&&c.annotations&&(i=!1),o.annotations&&c.annotations)if(o.annotations.length!==c.annotations.length)i=!1;else for(let f=0;f<o.annotations.length;f++)o.annotations[f]!==c.annotations[f]&&(i=!1)}i&&(delete r[a].ending,r.splice(n,r.length-n))}}})}function lo(e){e.forEach(t=>{if(t.type==="part"){const r=[],a=t.lines[0];let n=!1;const i=a.findIndex(c=>!!c.hasEndRepeat);(i>=0?Math.min(i+1,a.length):a.length)===12&&(n=!0);const o=n?4:8;for(let c=0;c<a.length;c+=o){const f=a.slice(c,c+o),u=f.findIndex(l=>!!l.hasEndRepeat);u>=0&&u<f.length-1?(r.push(f.slice(0,u+1)),r.push(f.slice(u+1))):r.push(f)}for(let c=0;c<r.length;c++)if(r[c][0].ending){const f=Math.max(0,c-1),u=r[f].length-r[c].length,l=[];for(let h=0;h<u;h++)l.push({noBorder:!0,chord:["","","",""]});r[c]=l.concat(r[c])}t.lines=r}})}function ho(e){e.forEach(t=>{if(t.lines){let r=!1,a="";t.lines.forEach(n=>{n.forEach(i=>{if(!i.noBorder){const s=i.chord;!s[0]&&!s[1]&&!s[2]&&!s[3]?(r?a&&(s[0]="%"):s[0]=a,r=!0):!s[1]&&!s[2]&&!s[3]?(r=!0,a=s[0]):(r=!1,a=s[3]||s[2]||s[1])}})})}})}function Ba(e,t){if(e.decoration)for(let r=0;r<e.decoration.length;r++)switch(e.decoration[r]){case"fermata":case"segno":case"coda":case"D.C.":case"D.S.":case"D.C.alcoda":case"D.C.alfine":case"D.S.alcoda":case"D.S.alfine":case"fine":t.annotations||(t.annotations=[]),t.annotations.push(e.decoration[r]);break}}var fo=io,ht={};ht.FONTEM=360;ht.FONTSIZE=30;ht.STEP=ht.FONTSIZE*93/720;ht.SPACE=10;ht.TOPNOTE=15;ht.STAVEHEIGHT=100;ht.INDENT=50;var Se=ht;const uo=rt;function po(e){this.sections=[{type:"startRepeat",index:-1}],this.addBar=function(t){var r=e.length-1,a=t.type==="bar_left_repeat"||t.type==="bar_dbl_repeat",n=t.type==="bar_right_repeat"||t.type==="bar_dbl_repeat",i=t.startEnding?bo(t.startEnding):void 0;n&&(this.sections.length>0&&this.sections[this.sections.length-1].type==="endRepeat"&&this.sections.push({type:"startRepeat",index:this.sections[this.sections.length-1].index}),this.sections.push({type:"endRepeat",index:r})),a&&this.sections.push({type:"startRepeat",index:r}),i&&this.sections.push({type:"startEnding",index:r,endings:i})},this.resolveRepeats=function(){var t,r=this.sections[this.sections.length-1],a=e.length-1;if(r.type==="startRepeat"?r.end=a:r.index+1<a&&this.sections.push({type:"startRepeat",index:r.index+1}),this.sections.length<2)return e;for(var n=[],i=null,s=0;s<this.sections.length;s++){var o=this.sections[s];switch(o.type){case"startRepeat":if(i){if(i.common.end||(i.common.end=o.index),i.endings)for(t=0;t<i.endings.length;t++)i.endings[t]&&!i.endings[t].end&&i.endings[t].start!==o.index&&(i.endings[t].end=o.index);this.sections[s-1].type==="endRepeat"&&i.endings&&i.endings.length&&(i.endings[i.endings.length]={start:-1,end:-1}),n.push(i)}if(i){var c=i.common.end;if(i.endings)for(t=0;t<i.endings.length;t++)i.endings[t]&&(c=Math.max(c,i.endings[t].end));c<o.index-1&&n.push({common:{start:c+1,end:o.index}})}i={common:{start:o.index}};break;case"startEnding":{if(i)for(i.common.end||(i.common.end=o.index),i.endings||(i.endings=[]),t=0;t<o.endings.length;t++)i.endings[o.endings[t]]={start:o.index+1};break}case"endRepeat":if(i){if(i.endings||(i.endings=[]),i.endings.length>0)for(t=0;t<i.endings.length;t++)i.endings[t]&&!i.endings[t].end&&(i.endings[t].end=o.index);i.common.end||(i.common.end=o.index)}break}}if(i){if(i.common.end||(i.common.end=a),i.endings)for(t=0;t<i.endings.length;t++)i.endings[t]&&!i.endings[t].end&&(i.endings[t].end=a);n.push(i)}for(var f=[],u=-1,l=0;l<n.length;l++){var h=n[l];if(!h.endings)o0(e,f,h.common.start,h.common.end);else if(h.endings.length===0)o0(e,f,h.common.start,h.common.end),o0(e,f,h.common.start,h.common.end);else for(t=0;t<h.endings.length;t++){var d=h.endings[t];d&&(o0(e,f,h.common.start,h.common.end),d.start>0&&o0(e,f,d.start,d.end),u=Math.max(u,d.end))}}return f}}function o0(e,t,r,a){r<0&&(r=0),t.length>0&&e[r].el_type==="bar"&&t[t.length-1].el_type==="bar"&&r++;for(var n=r;n<=a;n++){var i,s=!1;if(e[n].el_type==="key"||e[n].el_type==="meter"||e[n].el_type==="tempo"||e[n].el_type==="instrument"){for(i=t.length-1;i>=0&&t[i].el_type!==e[n].el_type;)i--;i>=0&&(e[n].el_type==="key"&&go(e[n],t[i])||e[n].el_type==="meter"&&e[n].num===t[i].num&&e[n].den===t[i].den||e[n].el_type==="instrument"&&e[n].program===t[i].program||e[n].el_type==="tempo"&&e[n].qpm===t[i].qpm)&&(s=!0)}s||t.push(vo(e[n]))}}function vo(e){var t=Object.assign({},e);return t.pitches&&(t.pitches=uo.cloneArray(t.pitches)),t}function go(e,t){return!e.accidentals||!t.accidentals?!1:JSON.stringify(e.accidentals)===JSON.stringify(t.accidentals)}function bo(e){var t=[],r,a,n;if(e.indexOf(",")>0)for(a=e.split(","),n=0;n<a.length;n++)r=parseInt(a[n],10),r>0&&t.push(r);else if(e.indexOf("-")>0){a=e.split("-");var i=parseInt(a[0],10),s=parseInt(a[1],10);for(n=i;n<=s;n++)t.push(n)}else r=parseInt(e,10),r>0&&t.push(r);return t}var mo=po,Kn,ur=rt,yo=mo;(function(){var e=1,t=128;Kn=function(d,p){p=p||{};var g,v=p.program||0,m=p.midiTranspose||0;d.visualTranspose&&(m-=d.visualTranspose);var y=p.channel||0,x=!1,b=p.drum||"",w=p.drumBars||1,C=p.drumIntro||0,T=b!=="",B=!!p.drumOff,E=[],z=50;v=parseInt(v,10),m=parseInt(m,10),y=parseInt(y,10),y===10&&(v=t),b=b.split(" "),w=parseInt(w,10),C=parseInt(C,10);var F=d.formatting.bagpipes;F&&(v=71);var O=[];if(d.formatting.midi){var R=d.formatting.midi;R.program&&R.program.length>0&&(v=R.program[0],R.program.length>1&&(v=R.program[1],y=R.program[0]),x=!0),R.transpose&&(m=R.transpose[0]),R.channel&&(y=R.channel[0],x=!0),R.drum&&(b=R.drum),R.drumbars&&(w=R.drumbars[0]),R.drumon&&(T=!0),y===10&&(v=t),R.beat&&O.push({el_type:"beat",beats:R.beat}),R.nobeataccents&&O.push({el_type:"beataccents",value:!1})}p.qpm?g=parseInt(p.qpm,10):d.metaText.tempo?g=o(d.metaText.tempo,d.getBeatLength()):p.defaultQpm?g=p.defaultQpm:g=180;var Y=[];F&&Y.push({el_type:"bagpipes"}),Y.push({el_type:"instrument",program:v}),y&&Y.push({el_type:"channel",channel:y}),m&&Y.push({el_type:"transpose",transpose:m}),Y.push({el_type:"tempo",qpm:g});for(var K=0;K<O.length;K++)Y.push(O[K]);var P=[],k=[],_=[],L=[],A=[0],G={};G[0]={el_type:"tempo",qpm:g,timing:0};for(var V,Q=[],le=!1,Qe=d.lines,Ye=0;Ye<Qe.length;Ye++){var Me=Qe[Ye];if(Me.staff){let se=function(U){var ie={pppp:[15,10,5,1],ppp:[30,20,10,1],pp:[45,35,20,1],p:[60,50,35,1],mp:[75,65,50,1],mf:[90,80,65,1],f:[105,95,80,1],ff:[120,110,95,1],fff:[127,125,110,1],ffff:[127,125,110,1]},he;if(U.decoration){if(U.decoration.indexOf("pppp")>=0?he="pppp":U.decoration.indexOf("ppp")>=0?he="ppp":U.decoration.indexOf("pp")>=0?he="pp":U.decoration.indexOf("p")>=0?he="p":U.decoration.indexOf("mp")>=0?he="mp":U.decoration.indexOf("mf")>=0?he="mf":U.decoration.indexOf("f")>=0?he="f":U.decoration.indexOf("ff")>=0?he="ff":U.decoration.indexOf("fff")>=0?he="fff":U.decoration.indexOf("ffff")>=0&&(he="ffff"),he){V=ie[he].slice(0);let st=[V];Array.isArray(U.decoration)&&(st=[],U.decoration.forEach(kt=>{kt in ie&&st.push(ie[kt].slice(0))})),P[q].push({el_type:"beat",beats:V.slice(0),volumesPerNotePitch:st}),_[Z]=!1,L[Z]=!1}if(U.decoration.indexOf("crescendo(")>=0){var ae=r(ge,I,"crescendo)"),Fe=Math.min(127,V[0]+z),Ft=a(ge,I+ae+1,Object.keys(ie));Ft&&(Fe=ie[Ft][0]),ae>0?_[Z]=Math.floor((Fe-V[0])/ae):_[Z]=!1,L[Z]=!1}else if(U.decoration.indexOf("crescendo)")>=0)_[Z]=!1;else if(U.decoration.indexOf("diminuendo(")>=0){var ye=r(ge,I,"diminuendo)"),Be=Math.max(15,V[0]-z),Ct=a(ge,I+ye+1,Object.keys(ie));Ct&&(Be=ie[Ct][0]),_[Z]=!1,ye>0?L[Z]=Math.floor((Be-V[0])/ye):L[Z]=!1}else U.decoration.indexOf("diminuendo)")>=0&&(L[Z]=!1)}};for(var me=Me.staff,q=0,Ie=0;Ie<me.length;Ie++){var te=me[Ie];if(!(te.clef&&te.clef.type==="TAB"))for(var Z=0;Z<te.voices.length;Z++){var ge=te.voices[Z];if(!P[q]){P[q]=[].concat(JSON.parse(JSON.stringify(Y)));var oe=s(Me.staff,q);oe&&P[q].unshift({el_type:"name",trackName:oe}),Q[q]=new yo(P[q])}if(m&&te.clef.type==="perc"&&P[q].push({el_type:"transpose",transpose:0}),te.clef&&te.clef.type==="perc"&&!x)for(var Ae=0;Ae<P[q].length;Ae++)P[q][Ae].el_type==="instrument"&&(P[q][Ae].program=t);else te.key&&u(P[q],te.key);te.meter&&l(P[q],te.meter),!le&&T&&(P[q].push({el_type:"drum",params:{pattern:b,bars:w,on:T,intro:C}}),le=!0),te.clef&&te.clef.type!=="perc"&&te.clef.transpose&&(te.clef.el_type="clef",P[q].push({el_type:"transpose",transpose:te.clef.transpose}),k[q]=!1),te.clef&&te.clef.type&&(te.clef.type.indexOf("-8")>=0?(P[q].push({el_type:"transpose",transpose:-12}),k[q]=!0):te.clef.type.indexOf("+8")>=0?(P[q].push({el_type:"transpose",transpose:12}),k[q]=!0):k[q]&&(P[q].push({el_type:"transpose",transpose:0}),k[q]=!1)),d.formatting.midi&&d.formatting.midi.drumoff&&(P[q].push({el_type:"bar"}),P[q].push({el_type:"drum",params:{pattern:"",on:!1}}));var ke=0,_e=0,xt=0,M=0;V=[105,95,85,1];for(var I=0;I<ge.length;I++){var N=ge[I];switch(N.el_type){case"note":if(_[Z]&&(V[0]+=_[Z],V[1]+=_[Z],V[2]+=_[Z],P[q].push({el_type:"beat",beats:V.slice(0)})),L[Z]&&(V[0]+=L[Z],V[1]+=L[Z],V[2]+=L[Z],P[q].push({el_type:"beat",beats:V.slice(0)})),se(N),!N.rest||N.rest.type!=="spacer"){var D={elem:N,el_type:"note",timing:A[q]};if(N.style?D.style=N.style:E[q]&&(D.style=E[q]),D.duration=N.duration===0?.25:N.duration,N.startTriplet){if(_e=N.tripletMultiplier,xt=N.startTriplet*_e*N.duration,N.startTriplet!==N.tripletR&&I+N.tripletR<=ge.length){for(var $=0,W=I;W<I+N.tripletR;W++)$+=ge[W].duration;xt=_e*$}D.duration=D.duration*_e,D.duration=Math.round(D.duration*1e6)/1e6,M=D.duration}else _e&&(N.endTriplet?(_e=0,D.duration=Math.round((xt-M)*1e6)/1e6):(D.duration=D.duration*_e,D.duration=Math.round(D.duration*1e6)/1e6,M+=D.duration));N.rest&&(D.rest=N.rest),N.decoration&&(D.decoration=N.decoration.slice(0)),N.pitches&&(D.pitches=ur.cloneArray(N.pitches)),N.gracenotes&&(D.gracenotes=ur.cloneArray(N.gracenotes)),N.chord&&(D.chord=ur.cloneArray(N.chord)),P[q].push(D),N.style==="rhythm"&&i(P),ke++,A[q]+=D.duration}break;case"key":case"keySignature":u(P[q],N);break;case"meter":l(P[q],N);break;case"clef":N.transpose&&P[q].push({el_type:"transpose",transpose:N.transpose}),N.type&&(N.type.indexOf("-8")>=0?P[q].push({el_type:"transpose",transpose:-12}):N.type.indexOf("+8")>=0&&P[q].push({el_type:"transpose",transpose:12}));break;case"tempo":g=o(N,d.getBeatLength()),P[q].push({el_type:"tempo",qpm:g,timing:A[q]}),G[""+A[q]]={el_type:"tempo",qpm:g,timing:A[q]};break;case"bar":ke>0&&P[q].push({el_type:"bar"}),se(N),ke=0,Q[q].addBar(N,q);break;case"style":E[q]=N.head;break;case"timeSignature":P[q].push(c(N));break;case"part":break;case"stem":case"scale":case"break":case"font":break;case"midi":var J=!1;switch(N.cmd){case"drumon":T=!0,J=!0;break;case"drumoff":T=!1,J=!0;break;case"drum":b=N.params,J=!0;break;case"drumbars":w=N.params[0],J=!0;break;case"drummap":break;case"channel":N.params[0]===10&&P[q].push({el_type:"instrument",program:t});break;case"program":h(P[q],{el_type:"instrument",program:N.params[0]}),x=!0;break;case"transpose":P[q].push({el_type:"transpose",transpose:N.params[0]});break;case"gchordoff":P[q].push({el_type:"gchordOn",tacet:!0});break;case"gchordon":P[q].push({el_type:"gchordOn",tacet:!1});break;case"beat":P[q].push({el_type:"beat",beats:N.params});break;case"nobeataccents":P[q].push({el_type:"beataccents",value:!1});break;case"beataccents":P[q].push({el_type:"beataccents",value:!0});break;case"vol":case"volinc":P[q].push({el_type:N.cmd,volume:N.params[0]});break;case"swing":case"gchord":case"bassvol":case"chordvol":P[q].push({el_type:N.cmd,param:N.params[0]});break;case"bassprog":case"chordprog":P[q].push({el_type:N.cmd,value:N.params[0],octaveShift:N.params[1]});break;case"gchordbars":P[q].push({el_type:N.cmd,param:N.params[0]});break;default:console.log("MIDI seq: midi cmd not handled: ",N.cmd,N)}J&&(P[0].push({el_type:"drum",params:{pattern:b,bars:w,intro:C,on:T}}),le=!0);break;default:console.log("MIDI: element type "+N.el_type+" not handled.")}}q++,A[q]||(A[q]=0)}}}}for(var ee=0;ee<Q.length;ee++)P[ee]=Q[ee].resolveRepeats();if(n(P,G),C)for(var j=d.getPickupLength(),X=0;X<P.length;X++){for(var re=0;P[X][re].el_type!=="note"&&P[X].length>re;)re++;if(P[X].length>re){for(var W=0;W<C;W++)j===0||W<C-1?(P[X].splice(re,0,{el_type:"note",rest:{type:"rest"},duration:e},{el_type:"bar"}),re+=2):P[X].splice(re++,0,{el_type:"note",rest:{type:"rest"},duration:e-j});B&&(T=!1,P[X].splice(re++,0,{el_type:"drum",params:{pattern:b,bars:w,intro:C,on:T}}),B=!1)}}return P.length>0&&P[0].length>0&&(P[0][0].pickupLength=d.getPickupLength()),P};function r(d,p,g){for(var v=0,m=p+1;m<d.length;m++)if(d[m].el_type==="note"&&v++,d[m].decoration&&d[m].decoration.indexOf(g)>=0)return v;return v}function a(d,p,g){for(var v=Math.min(d.length,p+3),m=p;m<v;m++)if(d[m].el_type==="note"&&d[m].decoration){for(var y=0;y<d[m].decoration.length;y++)if(g.indexOf(d[m].decoration[y])>=0)return d[m].decoration[y]}return null}function n(d,p){if(!(!p||p.length===0))for(var g=Object.keys(p),v=0;v<d.length;v++)for(var m=d[v],y=p[0]?p[0].qpm:0,x=0;x<m.length;x++){var b=m[x];b.el_type==="tempo"&&(y=b.qpm),g.indexOf(""+b.timing)>=0&&y!==p[""+b.timing].qpm&&(y=p[""+b.timing].qpm,b.el_type==="tempo"?(b.qpm=p[""+b.timing].qpm,x++):(d[v].splice(x,0,{el_type:"tempo",qpm:p[""+b.timing].qpm,timing:b.timing}),x+=2))}}function i(d){for(var p=0;p<d.length;p++)for(var g=d[p],v=g.length-1;v>=0&&g[v].el_type!=="bar";)g[v].noChordVoice=!0,v--}function s(d,p){if(!(!d||d.length<=p||!d[p].title))return d[p].title.join(" ")}function o(d,p){var g=.25;d.duration&&(g=d.duration[0]);var v=60;return d.bpm&&(v=d.bpm),g*v/p}function c(d){var p;switch(d.type){case"common_time":p={el_type:"meter",num:4,den:4},e=4/4;break;case"cut_time":p={el_type:"meter",num:2,den:2},e=2/2;break;case"specified":let m=0;if(d.value&&d.value.length>0&&d.value[0].num.indexOf("+")>0)for(var g=d.value[0].num.split("+"),v=0;v<g.length;v++)m+=parseInt(g[v],10);else m=parseInt(d.value[0].num,10);p={el_type:"meter",num:m,den:d.value[0].den},e=m/parseInt(d.value[0].den,10);break;default:p={el_type:"meter"},e=1}return p}function f(d){for(var p=[],g=0;g<d.length;g++)d[g].acc!=="natural"&&p.push(d[g]);return p}function u(d,p){var g;p.root==="HP"?g={el_type:"key",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}]}:g={el_type:"key",accidentals:f(p.accidentals)},h(d,g)}function l(d,p){var g=c(p);h(d,g)}function h(d,p){for(var g=d.length-1;g>=0;g--)if(d[g].el_type===p.el_type){JSON.stringify(d[g])!==JSON.stringify(p)&&d.push(p);return}d.push(p)}})();var Qn=Kn,ue=function(t,r,a,n){this.chordTrack=[],this.chordTrackFinished=!1,this.chordChannel=t,this.currentChords=[],this.lastChord,this.chordLastBar,this.chordsOff=!!r,this.gChordTacet=this.chordsOff,this.hasRhythmHead=!1,this.transpose=0,this.lastBarTime=0,this.meter=n,this.tempoChangeFactor=1,this.bassInstrument=a.bassprog&&a.bassprog.length>=1?a.bassprog[0]:0,this.chordInstrument=a.chordprog&&a.chordprog.length>=1?a.chordprog[0]:0,this.bassOctaveShift=a.bassprog&&a.bassprog.length===2?a.bassprog[1]:0,this.chordOctaveShift=a.chordprog&&a.chordprog.length===2?a.chordprog[1]:0,this.boomVolume=a.bassvol&&a.bassvol.length===1?a.bassvol[0]:64,this.chickVolume=a.chordvol&&a.chordvol.length===1?a.chordvol[0]:48,a.gchord&&a.gchord.length>0?this.overridePattern=Jn(a.gchord[0]):this.overridePattern=void 0};ue.prototype.setMeter=function(e){this.meter=e};ue.prototype.setTempoChangeFactor=function(e){this.tempoChangeFactor=e};ue.prototype.setLastBarTime=function(e){this.lastBarTime=e};ue.prototype.setTranspose=function(e){this.transpose=e};ue.prototype.setRhythmHead=function(e,t){this.hasRhythmHead=e;var r=[];if(e&&this.lastChord&&this.lastChord.chick)for(var a=0;a<this.lastChord.chick.length;a++){var n=Object.assign({},t.pitches[0]);n.actualPitch=this.lastChord.chick[a],r.push(n)}return r};ue.prototype.barEnd=function(e){this.chordTrack.length>0&&!this.chordTrackFinished&&(this.resolveChords(this.lastBarTime,Br(e.time)),this.currentChords=[]),this.chordLastBar=this.lastChord};ue.prototype.gChordOn=function(e){this.chordsOff||(this.gChordTacet=e.tacet)};ue.prototype.paramChange=function(e){switch(e.el_type){case"gchord":e.param&&e.param.length>0?this.overridePattern=Jn(e.param):this.overridePattern=void 0;break;case"bassprog":this.bassInstrument=e.value,e.octaveShift!=null&&e.octaveShift!=null?this.bassOctaveShift=e.octaveShift:this.bassOctaveShift=0;break;case"chordprog":this.chordInstrument=e.value,e.octaveShift!=null&&e.octaveShift!=null?this.chordOctaveShift=e.octaveShift:this.chordOctaveShift=0;break;case"bassvol":this.boomVolume=e.param;break;case"chordvol":this.chickVolume=e.param;break;default:console.log("unhandled midi param",e)}};ue.prototype.finish=function(){this.chordTrackEmpty()||(this.chordTrackFinished=!0)};ue.prototype.addTrack=function(e){this.chordTrackEmpty()||e.push(this.chordTrack)};ue.prototype.findChord=function(e){if(this.gChordTacet)return"break";if(this.chordTrackFinished||!e.chord||e.chord.length===0)return null;for(var t=0;t<e.chord.length;t++){var r=e.chord[t];if(r.position==="default")return r.name;if(this.breakSynonyms.indexOf(r.name.toLowerCase())>=0)return"break"}return null};ue.prototype.interpretChord=function(e){if(e.length!==0){if(e==="break")return{chick:[]};var t=e.substring(0,1);if(t==="("){if(e=e.substring(1,e.length-1),e.length===0)return;t=e.substring(0,1)}var r=this.basses[t];if(r){for(var a=this.transpose;a<-8;)a+=12;for(;a>8;)a-=12;r+=a,r<33?r+=12:r>44&&(r-=12);var n=r;r+=this.bassOctaveShift*12;var i=r-5,s;e.length===1&&(s=this.chordNotes(r,""));var o=e.substring(1),c=o.substring(0,1);c==="b"||c==="♭"?(n--,r--,i--,o=o.substring(1)):(c==="#"||c==="♯")&&(n++,r++,i++,o=o.substring(1));var f=o.split("/");if(s=this.chordNotes(n,f[0]),s.length>=3){var u=s[2]-s[0];i=i+u-7}if(f.length===2){var l=this.basses[f[1].substring(0,1)];if(l){var h=f[1].substring(1),d={"#":1,"♯":1,b:-1,"♭":-1}[h]||0;r=this.basses[f[1].substring(0,1)]+d+a,r+=this.bassOctaveShift*12,i=r}}return{boom:r,boom2:i,chick:s}}}};ue.prototype.chordNotes=function(e,t){var r=this.chordIntervals[t];r||(t.slice(0,2).toLowerCase()==="ma"||t[0]==="M"?r=this.chordIntervals.M:t[0]==="m"||t[0]==="-"?r=this.chordIntervals.m:r=this.chordIntervals.M),e+=12,e+=this.chordOctaveShift*12;for(var a=[],n=0;n<r.length;n++)a.push(e+r[n]);return a};ue.prototype.writeNote=function(e,t,r,a,n,i){e!==void 0&&this.chordTrack.push({cmd:"note",pitch:e,volume:r,start:this.lastBarTime+a*Na(t,this.tempoChangeFactor),duration:Na(n,this.tempoChangeFactor),gap:0,instrument:i})};ue.prototype.chordTrackEmpty=function(){for(var e=!0,t=0;t<this.chordTrack.length&&e;t++)this.chordTrack[t].cmd==="note"&&(e=!1);return e};ue.prototype.resolveChords=function(e,t){if(!this.hasRhythmHead){var r=this.meter.num,a=this.meter.den,n=1/a,i=n/2,s=parseInt(r,10)/parseInt(a,10),o=s-(t-e)/this.tempoChangeFactor;Math.abs(o)<1e-5&&(o=0),(this.currentChords.length===0||this.currentChords[0].beat!==0)&&this.currentChords.unshift({beat:0,chord:this.chordLastBar});var c=xo(this.currentChords,8*r/a),f=this.overridePattern?this.overridePattern:this.rhythmPatterns[r+"/"+a];if(o){f=[];for(var u=(t-e)/this.tempoChangeFactor*8,l=0;l<u/2;l+=2)f.push("chick"),f.push("")}if(!f){f=[];for(var l=0;l<8*r/a/2;l++)f.push("chick"),f.push("")}for(var h=!0,d=Math.min(f.length,c.length),l=0;l<d;l++){l>0&&c[l-1]&&c[l]&&c[l-1].boom!==c[l].boom&&(h=!0);var p=f[l],g=p.indexOf("boom")>=0,v=!g&&l!==0&&f[0].indexOf("boom")>=0&&(!c[l-1]||c[l-1].boom!==c[l].boom),m=wo(c[l],p,h,v);g&&(h=!1);for(var y=0;y<m.length;y++)this.writeNote(m[y],.125,g||v?this.boomVolume:this.chickVolume,l,i,g||v?this.bassInstrument:this.chordInstrument),v?v=!1:g=!1}}};ue.prototype.processChord=function(e){if(!this.chordTrackFinished){var t=this.findChord(e);if(t){var r=this.interpretChord(t);if(r){this.chordTrack.length===0&&this.chordTrack.push({cmd:"program",channel:this.chordChannel,instrument:this.chordInstrument}),this.lastChord=r;var a=Co(this.lastBarTime,Br(e.time));this.currentChords.push({chord:this.lastChord,beat:a,start:Br(e.time)})}}}};function wo(e,t,r,a){var n=[];if(!e)return n;t.indexOf("boom")>=0?n.push(r?e.boom:e.boom2):a&&n.push(e.boom);var i=e.chick.length;if(t.indexOf("chick")>=0)for(var s=0;s<i;s++)n.push(e.chick[s]);switch(t){case"DO":n.push(e.chick[0]);break;case"MI":n.push(e.chick[1]);break;case"SOL":n.push(Ht(e,2));break;case"TI":n.push(Ht(e,3));break;case"TOP":n.push(Ht(e,4));break;case"do":n.push(e.chick[0]+12);break;case"mi":n.push(e.chick[1]+12);break;case"sol":n.push(Ht(e,2)+12);break;case"ti":n.push(Ht(e,3)+12);break;case"top":n.push(Ht(e,4)+12);break}return n}function Ht(e,t){var r=Math.floor(t/e.chick.length),a=e.chick[t%e.chick.length];return a+r*12}function Jn(e){for(var t=[],r=0;r<e.length;r++){var a=e[r];switch(a){case"z":t.push("");break;case"2":t.push("");break;case"c":t.push("chick");break;case"b":t.push("boom&chick");break;case"f":t.push("boom");break;case"G":t.push("DO");break;case"H":t.push("MI");break;case"I":t.push("SOL");break;case"J":t.push("TI");break;case"K":t.push("TOP");break;case"g":t.push("do");break;case"h":t.push("mi");break;case"i":t.push("sol");break;case"j":t.push("ti");break;case"k":t.push("top");break}}return t}function xo(e,t,r){var a=[];if(e.length===0)return a;for(var n=e[0].chord,i=1;i<e.length;i++){for(var s=e[i];a.length<s.beat;)a.push(n);n=s.chord}for(;a.length<t;)a.push(n);return a}function Co(e,t){var r=t-e;return r*8}ue.prototype.breakSynonyms=["break","(break)","no chord","n.c.","tacet"];ue.prototype.basses={A:33,B:35,C:36,D:38,E:40,F:41,G:43};ue.prototype.chordIntervals={dim:[0,3,6],"°":[0,3,6],"˚":[0,3,6],dim7:[0,3,6,9],"°7":[0,3,6,9],"˚7":[0,3,6,9],ø7:[0,3,6,10],"m7(b5)":[0,3,6,10],m7b5:[0,3,6,10],"m7♭5":[0,3,6,10],"-7(b5)":[0,3,6,10],"-7b5":[0,3,6,10],"7b5":[0,4,6,10],"7(b5)":[0,4,6,10],"7♭5":[0,4,6,10],"7(b9,b5)":[0,4,6,10,13],"7b9,b5":[0,4,6,10,13],"7(#9,b5)":[0,4,6,10,15],"7#9b5":[0,4,6,10,15],"maj7(b5)":[0,4,6,11],maj7b5:[0,4,6,11],"13(b5)":[0,4,6,10,14,21],"13b5":[0,4,6,10,14,21],m:[0,3,7],"-":[0,3,7],m6:[0,3,7,9],"-6":[0,3,7,9],m7:[0,3,7,10],"-7":[0,3,7,10],"-(b6)":[0,3,7,8],"-b6":[0,3,7,8],"-6/9":[0,3,7,9,14],"-7(b9)":[0,3,7,10,13],"-7b9":[0,3,7,10,13],"-maj7":[0,3,7,11],"-9+7":[0,3,7,11,13],"-11":[0,3,7,11,14,17],m11:[0,3,7,11,14,17],"-maj9":[0,3,7,11,14],"-∆9":[0,3,7,11,14],mM9:[0,3,7,11,14],M:[0,4,7],6:[0,4,7,9],"6/9":[0,4,7,9,14],"6add9":[0,4,7,9,14],69:[0,4,7,9,14],7:[0,4,7,10],9:[0,4,7,10,14],11:[0,7,10,14,17],13:[0,4,7,10,14,21],"7b9":[0,4,7,10,13],"7♭9":[0,4,7,10,13],"7(b9)":[0,4,7,10,13],"7(#9)":[0,4,7,10,15],"7#9":[0,4,7,10,15],"(13)":[0,4,7,10,14,21],"7(9,13)":[0,4,7,10,14,21],"7(#9,b13)":[0,4,7,10,15,20],"7(#11)":[0,4,7,10,14,18],"7#11":[0,4,7,10,14,18],"7(b13)":[0,4,7,10,20],"7b13":[0,4,7,10,20],"9(#11)":[0,4,7,10,14,18],"9#11":[0,4,7,10,14,18],"13(#11)":[0,4,7,10,18,21],"13#11":[0,4,7,10,18,21],maj7:[0,4,7,11],"∆7":[0,4,7,11],Δ7:[0,4,7,11],maj9:[0,4,7,11,14],"maj7(9)":[0,4,7,11,14],"maj7(11)":[0,4,7,11,17],"maj7(#11)":[0,4,7,11,18],"maj7(13)":[0,4,7,14,21],"maj7(9,13)":[0,4,7,11,14,21],"7sus4":[0,5,7,10],m7sus4:[0,3,7,10,17],sus4:[0,5,7],sus2:[0,2,7],"7sus2":[0,2,7,10],"9sus4":[0,5,7,10,14],"13sus4":[0,5,7,10,14,21],aug7:[0,4,8,10],"+7":[0,4,8,10],"+":[0,4,8],"7#5":[0,4,8,10],"7♯5":[0,4,8,10],"7+5":[0,4,8,10],"9#5":[0,4,8,10,14],"9♯5":[0,4,8,10,14],"9+5":[0,4,8,10,14],"-7(#5)":[0,3,8,10],"-7#5":[0,3,8,10],"7(#5)":[0,4,8,10],"7(b9,#5)":[0,4,8,10,13],"7b9#5":[0,4,8,10,13],"maj7(#5)":[0,4,8,11],"maj7#5":[0,4,8,11],"maj7(#5,#11)":[0,4,8,11,18],"maj7#5#11":[0,4,8,11,18],"9(#5)":[0,4,8,10,14],"13(#5)":[0,4,8,10,14,21],"13#5":[0,4,8,10,14,21],5:[0,7],"5(8)":[0,7,12],"5add8":[0,7,12]};ue.prototype.rhythmPatterns={"2/2":["boom","","","","chick","","",""],"3/2":["boom","","","","chick","","","","chick","","",""],"4/2":["boom","","","","chick","","","","boom","","","","chick","","",""],"2/4":["boom","","chick",""],"3/4":["boom","","chick","","chick",""],"4/4":["boom","","chick","","boom","","chick",""],"5/4":["boom","","chick","","chick","","boom","","chick",""],"6/4":["boom","","chick","","boom","","chick","","boom","","chick",""],"3/8":["boom","","chick"],"5/8":["boom","chick","chick","boom","chick"],"6/8":["boom","","chick","boom","","chick"],"7/8":["boom","chick","chick","boom","chick","boom","chick"],"9/8":["boom","","chick","boom","","chick","boom","","chick"],"10/8":["boom","chick","chick","boom","chick","chick","boom","chick","boom","chick"],"11/8":["boom","chick","chick","boom","chick","chick","boom","chick","boom","chick","chick"],"12/8":["boom","","chick","boom","","chick","boom","","chick","boom","","chick"]};function Br(e){return e/1e6}function Na(e,t){return Math.round(e*t*1e6)/1e6}var ko=ue,_o={f0:"_C",n0:"=C",s0:"^C",x0:"C",f1:"_D",n1:"=D",s1:"^D",x1:"D",f2:"_E",n2:"=E",s2:"^E",x2:"E",f3:"_F",n3:"=F",s3:"^F",x3:"F",f4:"_G",n4:"=G",s4:"^G",x4:"G",f5:"_A",n5:"=A",s5:"^A",x5:"A",f6:"_B",n6:"=B",s6:"^B",x6:"B",f7:"_c",n7:"=c",s7:"^c",x7:"c",f8:"_d",n8:"=d",s8:"^d",x8:"d",f9:"_e",n9:"=e",s9:"^e",x9:"e",f10:"_f",n10:"=f",s10:"^f",x10:"f",f11:"_g",n11:"=g",s11:"^g",x11:"g",f12:"_a",n12:"=a",s12:"^a",x12:"a",f13:"_b",n13:"=b",s13:"^b",x13:"b",f14:"_c'",n14:"=c'",s14:"^c'",x14:"c'",f15:"_d'",n15:"=d'",s15:"^d'",x15:"d'",f16:"_e'",n16:"=e'",s16:"^e'",x16:"e'"};function To(e){var t=(e.accidental?e.accidental[0]:"x")+e.verticalPos;return _o[t]}var Zn=To,ei,Eo=ko,La=Zn;(function(){var e,t,r,a,n,i=1,s,o,c,f,u,l,h={num:4,den:4},d=128,p,g=!0,v=105,m=95,y=85,x=[[v,m,y]],b=.25,w,C,T=0,B,E={},z,F=0,O,R=0,Y=-.001,K=.4;ei=function(M,I,N,D){I||(I={}),D||(D={}),e=[],t=[0,0,0,0,0,0,0],a=[],n=I.qpm,i=1,s=void 0,o=void 0,c=void 0,f=void 0,u=0,O=N,h={num:4,den:4},g=!0,v=105,m=95,y=85,x=[],b=.25,w=void 0,C=void 0,T=0,B=[],E={},z=1,M.length>0&&M[0].length>0&&(F=M[0][0].pickupLength),I.bassprog!==void 0&&!D.bassprog&&(D.bassprog=[I.bassprog]),I.bassvol!==void 0&&!D.bassvol&&(D.bassvol=[I.bassvol]),I.chordprog!==void 0&&!D.chordprog&&(D.chordprog=[I.chordprog]),I.chordvol!==void 0&&!D.chordvol&&(D.chordvol=[I.chordvol]),I.gchord!==void 0&&!D.gchord&&(D.gchord=[I.gchord]),l=new Eo(M.length,I.chordsOff,D,h),L(M,I);for(var $=0;$<M.length;$++){r=0,l.setTranspose(r);var W=M[$];c=[{cmd:"program",channel:$,instrument:s}],f=void 0,p=0,l.setLastBarTime(0);var J=!1;(I.voicesOff===!0||I.voicesOff&&I.voicesOff.length&&I.voicesOff.indexOf($)>=0)&&(J=!0);for(var ee=0;ee<W.length;ee++){var j=W[ee];switch(j.el_type){case"name":f={cmd:"text",type:"name",text:j.trackName};break;case"note":Qe(j,J);break;case"key":t=q(j);break;case"meter":h=j,l.setMeter(h),b=A(h),ke();break;case"tempo":n?i=j.qpm?n/j.qpm:1:n=j.qpm,l.setTempoChangeFactor(i);break;case"transpose":r=j.transpose,l.setTranspose(r);break;case"bar":l.barEnd(j),e=[],$===0&&_e(M.length+1),l.setRhythmHead(!1),p=k(j.time),l.setLastBarTime(p);break;case"bagpipes":break;case"instrument":if(s===void 0&&(s=j.program),o=j.program,c.length>0&&c[c.length-1].cmd==="program")c[c.length-1].instrument=j.program;else{var X;for(X=c.length-1;X>=0&&c[X].cmd!=="program";X--);(X<0||c[X].instrument!==j.program)&&c.push({cmd:"program",channel:0,instrument:j.program})}break;case"channel":P(j.channel);break;case"drum":E=Ae(j.params),ke();break;case"gchordOn":l.gChordOn(j);break;case"beat":v=j.beats[0],m=j.beats[1],y=j.beats[2],j.volumesPerNotePitch?x=j.volumesPerNotePitch:x=[];break;case"vol":w=j.volume;break;case"volinc":C=j.volume;break;case"beataccents":g=j.value;break;case"gchord":case"bassprog":case"chordprog":case"bassvol":case"chordvol":case"gchordbars":l.paramChange(j);break;default:console.log("MIDI creation. Unknown el_type: "+j.el_type+`
7
- `);break}}c[0].instrument===void 0&&(c[0].instrument=s||0),f&&c.unshift(f),a.push(c),l.finish(),B.length>0}return I.detuneOctave&&xt(a,parseInt(I.detuneOctave,10)),l.addTrack(a),B.length>0&&a.push(B),{tempo:n,instrument:s,tracks:a,totalDuration:u}};function P(M){for(var I=c.length-1;I>=0;I--)if(c[I].cmd==="program"){c[I].channel=M;return}}function k(M){return M/1e6}function _(M){return Math.round(M*i*1e6)/1e6}function L(M,I){for(var N=0;N<M.length;N++){for(var D=M[N],$={},W=I.qpm,J=0,ee=1,j=0;j<D.length;j++){var X=D[j];if(X.el_type==="tempo"){W?ee=X.qpm?W/X.qpm:1:W=X.qpm;continue}X.time=J;var re=X.duration?X.duration:0;if(J+=Math.round(re*ee*1e6),X.pitches){for(var se=0;se<X.pitches.length;se++){var U=X.pitches[se];if(U){if(U.duration=X.duration,U.startTie)$[U.pitch]===void 0?$[U.pitch]={el:j,pitch:se}:(D[$[U.pitch].el].pitches[$[U.pitch].pitch].duration+=U.duration,X.pitches[se]=null);else if(U.endTie){var ie=$[U.pitch];if(ie){var he=U.duration;delete D[ie.el].pitches[ie.pitch].startTie,D[ie.el].pitches[ie.pitch].duration+=he,X.pitches[se]=null,delete $[U.pitch]}else delete U.endTie}}}delete X.duration}}for(var ae in $)if($.hasOwnProperty(ae)){var Fe=$[ae];delete D[Fe.el].pitches[Fe.pitch].startTie}}}function A(M){switch(parseInt(M.den,10)){case 2:return .5;case 4:return .25;case 8:return M.num%3===0?.375:.125;case 16:return .125}return .25}function G(M,I,N){var D=N-M;return D/I}function V(M,I,N){if(I)return 0;let D=v,$=m,W=y;N!==void 0&&x.length>=N+1&&(D=x[N][0],$=x[N][1],W=x[N][2]);var J;if(w!==void 0)J=w,w=void 0;else if(!g)J=$;else if(F>M)J=W;else{var ee=G(p,A(h),M);ee===0?J=D:parseInt(ee,10)===ee?J=$:J=W}return C&&(J+=C,C=void 0),J<0&&(J=0),J>127&&(J=127),I?0:J}function Q(M,I){var N={};if(M.decoration)for(var D=0;D<M.decoration.length;D++)M.decoration[D]==="staccato"?N.thisBreakBetweenNotes="staccato":M.decoration[D]==="tenuto"?N.thisBreakBetweenNotes="tenuto":M.decoration[D]==="accent"?N.velocity=Math.min(127,I*1.5):M.decoration[D]==="trill"?N.noteModification="trill":M.decoration[D]==="lowermordent"?N.noteModification="lowermordent":M.decoration[D]==="uppermordent"?N.noteModification="pralltriller":M.decoration[D]==="mordent"?N.noteModification="mordent":M.decoration[D]==="turn"?N.noteModification="turn":M.decoration[D]==="roll"?N.noteModification="roll":M.decoration[D]==="pralltriller"?N.noteModification="pralltriller":M.decoration[D]==="trillh"&&(N.noteModification="trillh");return N}function le(M,I){var N=I.start,D=I.duration,$=_(1/32);switch(M){case"trill":for(var W=2;D>0;)c.push({cmd:"note",pitch:I.pitch+W,volume:I.volume,start:N,duration:$,gap:0,instrument:o,style:"decoration"}),W=W===2?0:2,D-=$,N+=$;break;case"trillh":for(var W=1;D>0;)c.push({cmd:"note",pitch:I.pitch+W,volume:I.volume,start:N,duration:$,gap:0,instrument:o,style:"decoration"}),W=W===1?0:1,D-=$,N+=$;break;case"pralltriller":c.push({cmd:"note",pitch:I.pitch,volume:I.volume,start:N,duration:$,gap:0,instrument:o,style:"decoration"}),D-=$,N+=$,c.push({cmd:"note",pitch:I.pitch+2,volume:I.volume,start:N,duration:$,gap:0,instrument:o,style:"decoration"}),D-=$,N+=$,c.push({cmd:"note",pitch:I.pitch,volume:I.volume,start:N,duration:D,gap:0,instrument:o});break;case"mordent":case"lowermordent":c.push({cmd:"note",pitch:I.pitch,volume:I.volume,start:N,duration:$,gap:0,instrument:o,style:"decoration"}),D-=$,N+=$,c.push({cmd:"note",pitch:I.pitch-2,volume:I.volume,start:N,duration:$,gap:0,instrument:o,style:"decoration"}),D-=$,N+=$,c.push({cmd:"note",pitch:I.pitch,volume:I.volume,start:N,duration:D,gap:0,instrument:o});break;case"turn":$=I.duration/4,c.push({cmd:"note",pitch:I.pitch+2,volume:I.volume,start:N,duration:$,gap:0,instrument:o,style:"decoration"}),c.push({cmd:"note",pitch:I.pitch,volume:I.volume,start:N+$,duration:$,gap:0,instrument:o,style:"decoration"}),c.push({cmd:"note",pitch:I.pitch-1,volume:I.volume,start:N+$*2,duration:$,gap:0,instrument:o,style:"decoration"}),c.push({cmd:"note",pitch:I.pitch,volume:I.volume,start:N+$*3,duration:$,gap:0,instrument:o,style:"decoration"});break;case"roll":for(;D>0;)c.push({cmd:"note",pitch:I.pitch,volume:I.volume,start:N,duration:$,gap:0,instrument:o,style:"decoration"}),D-=$*2,N+=$*2;break}}function Qe(M,I){var N=V(k(M.time),I);l.processChord(M);var D;if(M.gracenotes&&M.pitches&&M.pitches.length>0&&M.pitches[0]&&(D=Ie(M.gracenotes,M.pitches[0].duration),M.elem&&(M.elem.midiGraceNotePitches=te(D,k(M.time),N*2/3,o))),M.elem){var $=k(M.time),W=$/b/n*60*1e3;if(M.elem.currentTrackMilliseconds===void 0)M.elem.currentTrackMilliseconds=W,M.elem.currentTrackWholeNotes=$;else if(M.elem.currentTrackMilliseconds.length===void 0)M.elem.currentTrackMilliseconds!==W&&(M.elem.currentTrackMilliseconds=[M.elem.currentTrackMilliseconds,W],M.elem.currentTrackWholeNotes=[M.elem.currentTrackWholeNotes,$]);else{for(var J=!1,ee=0;ee<M.elem.currentTrackMilliseconds.length;ee++)M.elem.currentTrackMilliseconds[ee]===W&&(J=!0);J||(M.elem.currentTrackMilliseconds.push(W),M.elem.currentTrackWholeNotes.push($))}}if(M.pitches){var j="",X=Q(M,N);X.thisBreakBetweenNotes&&(j=X.thisBreakBetweenNotes),X.velocity&&(N=X.velocity);var re=M.pitches;M.style==="rhythm"&&(re=l.setRhythmHead(!0,M)),M.elem&&(M.elem.midiPitches=[]);for(var se=0;se<re.length;se++){let ye=N;!X.velocity&&Array.isArray(M.decoration)&&M.decoration.length>se&&(ye=V(k(M.time),I,se));var U=re[se];if(U){U.startSlur&&(T+=U.startSlur.length),U.endSlur&&(T-=U.endSlur.length);var ie=U.actualPitch?U.actualPitch:me(U);if(o===d&&O){var he=La(U);he&&O[he]&&(ie=O[he].sound)}var ae={cmd:"note",pitch:ie,volume:ye,start:k(M.time),duration:_(U.duration),instrument:o,startChar:M.elem.startChar,endChar:M.elem.endChar};if(ae=Z(ae),M.gracenotes&&(ae.duration=ae.duration/2,ae.start=ae.start+ae.duration),M.elem&&M.elem.midiPitches.push(ae),X.noteModification)le(X.noteModification,ae);else{switch(T>0?ae.endType="tenuto":j&&(ae.endType=j),ae.endType){case"tenuto":ae.gap=Y;break;case"staccato":var Fe=ae.duration*K;ae.gap=n/60*Fe;break;default:ae.gap=R;break}c.push(ae)}}}c.length-1}var Ft=Ye(M);u=Math.max(u,k(M.time)+_(Ft))}function Ye(M){return M.pitches&&M.pitches.length>0&&M.pitches[0]?M.pitches[0].duration:M.elem?M.elem.duration:M.duration}var Me=[0,2,4,5,7,9,11];function me(M){if(M.midipitch!==void 0)return M.midipitch;var I=M.pitch;if(M.accidental)switch(M.accidental){case"sharp":e[I]=1;break;case"flat":e[I]=-1;break;case"natural":e[I]=0;break;case"dblsharp":e[I]=2;break;case"dblflat":e[I]=-2;break;case"quartersharp":e[I]=.25;break;case"quarterflat":e[I]=-.25;break}var N=ge(I)*12+Me[oe(I)]+60;return e[I]!==void 0?N+=e[I]:N+=t[oe(I)],N+=r,N}function q(M){var I=[0,0,0,0,0,0,0];if(!M.accidentals)return I;for(var N=0;N<M.accidentals.length;N++){var D=M.accidentals[N],$;switch(D.acc){case"flat":$=-1;break;case"quarterflat":$=-.25;break;case"sharp":$=1;break;case"quartersharp":$=.25;break;default:$=0;break}var W=D.note.toLowerCase(),J=oe(W.charCodeAt(0)-99);I[J]+=$}return I}function Ie(M,I){for(var N=0,D=[],$,W=0;W<M.length;W++)$=M[W],N+=$.duration;var J=I/2/N;for(W=0;W<M.length;W++){$=M[W];var ee=me($);if(o===d&&O){var j=La($);j&&O[j]&&(ee=O[j].sound)}var X={pitch:ee,duration:$.duration*J};X=Z(X),D.push(X)}return D}function te(M,I,N,D){var $=[];N=Math.round(N);for(var W=0;W<M.length;W++){var J=M[W];c.push({cmd:"note",pitch:J.pitch,volume:N,start:I,duration:J.duration,gap:0,instrument:D,style:"grace"}),$.push({pitch:J.pitch,durationInMeasures:J.duration,volume:N,instrument:D}),I+=J.duration}return $}function Z(M){var I=""+M.pitch;return I.indexOf(".75")>=0?(M.pitch=Math.round(M.pitch),M.cents=-50):I.indexOf(".25")>=0&&(M.pitch=Math.round(M.pitch),M.cents=50),M}function ge(M){return Math.floor(M/7)}function oe(M){return M=M%7,M<0&&(M+=7),M}function Ae(M){if(M.pattern.length===0||M.on===!1)return{on:!1};for(var I=M.pattern[0],N=[],D="",$=0,W=0;W<I.length;W++)if(I[W]==="d"&&$++,I[W]==="d"||I[W]==="z")D.length!==0?(N.push(D),D=I[W]):D=D+I[W];else{if(D.length===0)return{on:!1};D=D+I[W]}if(D.length!==0&&N.push(D),M.pattern.length!==$*2+1)return{on:!1};for(var J={on:!0,bars:M.bars,pattern:[]},ee=A(h),j=0,X=0;X<N.length;X++){D=N[X];for(var re=1,se=!1,U=0,ie=1;ie<D.length;ie++)switch(D[ie]){case"/":U!==0&&(re*=U),U=0,se=!0;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":U=U*10+D[ie];break;default:return{on:!1}}se?(U===0&&(U=2),re/=U):U&&(re*=U),D[0]==="d"?(J.pattern.push({len:re*ee,pitch:M.pattern[1+j],velocity:M.pattern[1+j+$]}),j++):J.pattern.push({len:re*ee,pitch:null})}return z=M.bars?M.bars:1,J}function ke(){if(!(!E||!E.pattern)){for(var M=E,I=0,N=h.num/h.den,D=0;D<M.pattern.length;D++)I+=M.pattern[D].len;var $=I/z/N;for(D=0;D<M.pattern.length;D++)M.pattern[D].len=M.pattern[D].len/$;E=M}}function _e(M){if(!(B.length===0&&!E.on)){var I=h.num/h.den;if(B.length===0){if(u<I)return;B.push({cmd:"program",channel:M,instrument:d})}if(E.on)for(var N=p,D=0;D<E.pattern.length;D++){var $=_(E.pattern[D].len);E.pattern[D].pitch&&B.push({cmd:"note",pitch:E.pattern[D].pitch,volume:E.pattern[D].velocity,start:N,duration:$,gap:0,instrument:d}),N+=$}}}function xt(M,I){for(var N={},D=0;D<M.length;D++)for(var $=0;$<M[D].length;$++){var W=M[D][$];W.cmd==="note"&&(N[W.start]===void 0&&(N[W.start]=[]),N[W.start].push({track:D,event:$,pitch:W.pitch}))}var J=Object.keys(N);for(D=0;D<J.length;D++){var ee=N[J[D]];if(ee.length>1){ee=ee.sort(function(U,ie){return U.pitch-ie.pitch});var j=ee[ee.length-1],X=j.pitch%12,re=!1;for($=0;!re&&$<ee.length-1;$++)ee[$].pitch%12===X&&(re=!0);if(re){var se=M[j.track][j.event];se.cents||(se.cents=0),se.cents+=I}}}}})();var So=ei;function Mo(e,t){t||(t={});for(var r=!!t.lineBreaks,a=[],n=!1,i=[],s=[],o=[],c=[],f=[],u=[],l=[],h=0;h<e.length;h++){var d=Da(e[h]);if(d.staff){if(n&&!d.vskip)for(var p=a[a.length-1],g=0;g<p.staff.length;g++){var v=d.staff[g],m=p.staff[g];if(v&&(Tt(v.meter,i[g])||(Ao(v.meter,v.voices),i[g]=v.meter,delete v.meter),Tt(v.key,s[g])||(Bo(v.key,v.voices),s[g]=v.key,delete v.key),v.title&&(m.abbrevTitle=v.title),Tt(v.clef,o[g])||(No(v.clef,v.voices),o[g]=v.clef,delete v.clef),Tt(v.vocalfont,c[g])||(I0(v.vocalfont,v.voices,"vocalfont"),c[g]=v.vocalfont,delete v.vocalfont),Tt(v.gchordfont,f[g])||(I0(v.gchordfont,v.voices,"gchordfont"),f[g]=v.gchordfont,delete v.gchordfont),Tt(v.tripletfont,u[g])||(I0(v.tripletfont,v.voices,"tripletfont"),u[g]=v.tripletfont,delete v.tripletfont),Tt(v.annotationfont,l[g])||(I0(v.annotationfont,v.voices,"annotationfont"),l[g]=v.annotationfont,delete v.annotationfont)),v)for(var y=0;y<m.voices.length;y++){var x=m.voices[y],b=v.voices[y];r&&x.push({el_type:"break"}),b&&(m.voices[y]=x.concat(b))}}else{for(var w=0;w<d.staff.length;w++)s[w]=d.staff[w].key,i[w]=d.staff[w].meter,o[w]=d.staff[w].clef;a.push(Da(d))}n=!0}else n=!1,a.push(d)}return a}function Pa(e,t){return e==="abselem"?"abselem":t}function Ao(e,t){e.el_type="meter",e.startChar=-1,e.endChar=-1;for(var r=0;r<t.length;r++)t[r].unshift(e)}function Bo(e,t){e.el_type="key",e.startChar=-1,e.endChar=-1;for(var r=0;r<t.length;r++)t[r].unshift(e)}function No(e,t){e.el_type="clef",e.startChar=-1,e.endChar=-1;for(var r=0;r<t.length;r++)t[r].unshift(e)}function I0(e,t,r){e.el_type="font",e.type=r,e.startChar=-1,e.endChar=-1;for(var a=0;a<t.length;a++)t[a].unshift(e)}function Tt(e,t){if(!e)return!0;var r=JSON.stringify(e,Pa),a=JSON.stringify(t,Pa);return r===a}function Da(e){for(var t={},r=Object.keys(e),a=0;a<r.length;a++)if(r[a]!=="staff")t[r[a]]=e[r[a]];else{t.staff=[];for(var n=0;n<e.staff.length;n++){for(var i={},s=Object.keys(e.staff[n]),o=0;o<s.length;o++)if(s[o]!=="voices")i[s[o]]=e.staff[n][s[o]];else{i.voices=[];for(var c=0;c<e.staff[n].voices.length;c++)i.voices.push([].concat(e.staff[n].voices[c]))}t.staff.push(i)}}return t}var Lo=Mo,Ia=rt,Fa=Se,Po=Qn,Do=So,Io=Lo,Fo=function(){this.reset=function(){this.version="1.1.0",this.media="screen",this.metaText={},this.metaTextInfo={},this.formatting={},this.lines=[],this.staffNum=0,this.voiceNum=0,this.lineNum=0,this.runningFonts={},delete this.visualTranspose},this.reset();function e(s,o,c,f){for(var u=0;u<f.length;u++)s[c][f[u]]=o[c][f[u]]}this.copyTopInfo=function(s){var o=["tempo","title","header","rhythm","origin","composer","author","partOrder"];e(this,s,"metaText",o),e(this,s,"metaTextInfo",o)},this.copyBottomInfo=function(s){var o=["unalignedWords","book","source","discography","notes","transcription","history","abc-copyright","abc-creator","abc-edited-by","footer"];e(this,s,"metaText",o),e(this,s,"metaTextInfo",o)},this.getBeatLength=function(){var s=this.getMeterFraction(),o=1;return s.num===6||s.num===9||s.num===12||s.num===3&&s.den===8?o=3:s.den===8&&(s.num===5||s.num===7)&&(o=2),o/s.den};function t(s,o){for(var c=0,f=0;f<s.length;f++)if(s[f].staff)for(var u=0;u<s[f].staff.length;u++)for(var l=0;l<s[f].staff[u].voices.length;l++)for(var h=s[f].staff[u].voices[l],d=1,p=0;p<h.length;p++){var g=h[p].rest&&h[p].rest.type==="spacer";if(h[p].startTriplet&&(d=h[p].tripletMultiplier),h[p].duration&&!g&&h[p].el_type!=="tempo"&&(c+=h[p].duration*d),h[p].endTriplet&&(d=1),c>=o&&(c-=o),h[p].el_type==="bar")return c}return c}this.getPickupLength=function(){var s=this.getBarLength(),o=t(this.lines,s);return o<1e-8||s-o<1e-8?0:o},this.getBarLength=function(){var s=this.getMeterFraction();return s.num/s.den},this.getTotalTime=function(){return this.totalTime},this.getTotalBeats=function(){return this.totalBeats},this.millisecondsPerMeasure=function(s){var o;if(s)o=s;else{var c=this.metaText?this.metaText.tempo:null;o=this.getBpm(c)}o<=0&&(o=1);var f=this.getBeatsPerMeasure(),u=f/o;return u*6e4},this.getBeatsPerMeasure=function(){var s=this.getBeatLength(),o=this.getBarLength();return o/s},this.getMeter=function(){for(var s=0;s<this.lines.length;s++){var o=this.lines[s];if(o.staff)for(var c=0;c<o.staff.length;c++){var f=o.staff[c].meter;if(f)return f}}return{type:"common_time"}},this.getMeterFraction=function(){var s=this.getMeter(),o=4,c=4;if(s)if(s.type==="specified"){if(s.value&&s.value.length>0&&s.value[0].num.indexOf("+")>0){var f=s.value[0].num.split("+");o=0;for(var u=0;u<f.length;u++)o+=parseInt(f[u],10)}else o=parseInt(s.value[0].num,10);c=parseInt(s.value[0].den,10)}else s.type==="cut_time"?(o=2,c=2):s.type==="common_time"&&(o=4,c=4);return this.meter={num:o,den:c},this.meter},this.getKeySignature=function(){for(var s=0;s<this.lines.length;s++){var o=this.lines[s];if(o.staff){for(var c=0;c<o.staff.length;c++)if(o.staff[c].key)return o.staff[c].key}}return{}},this.getElementFromChar=function(s){for(var o=0;o<this.lines.length;o++){var c=this.lines[o];if(c.staff)for(var f=0;f<c.staff.length;f++)for(var u=c.staff[f],l=0;l<u.voices.length;l++)for(var h=u.voices[l],d=0;d<h.length;d++){var p=h[d];if(p.startChar&&p.endChar&&p.startChar<=s&&p.endChar>s)return p}}return null};function r(s){for(var o,c,f,u,l=s.length-1;l>=0;l--){var h=s[l];h.type==="bar"?(h.top=f,h.nextTop=o,o=f,h.bottom=u,h.nextBottom=c,c=u):h.type==="event"&&(f=h.top,u=h.top+h.height)}}function a(s){var o=[];for(var c in s)s.hasOwnProperty(c)&&o.push(s[c]);return o=o.sort(function(f,u){var l=f.milliseconds-u.milliseconds;return l!==0?l:f.type==="bar"?-1:1}),o}this.addElementToEvents=function(s,o,c,f,u,l,h,d,p,g){if(o.hint)return{isTiedState:void 0,duration:0};var v=o.durationClass?o.durationClass:o.duration;if(o.abcelem.rest&&o.abcelem.rest.type==="spacer"&&(v=0),v>0){for(var m=[],y=0;y<o.elemset.length;y++)o.elemset[y]!==null&&m.push(o.elemset[y]);var x=o.startTie;if(p!==void 0)s["event"+p].elements.push(m),g&&(s["event"+c]||(s["event"+c]={type:"event",milliseconds:c,line:l,measureNumber:h,top:f,height:u,left:null,width:0,elements:[],startChar:null,endChar:null,startCharArray:[],endCharArray:[]}),s["event"+c].measureStart=!0,g=!1),x||(p=void 0);else{if(!s["event"+c])s["event"+c]={type:"event",milliseconds:c,line:l,measureNumber:h,top:f,height:u,left:o.x,width:o.w,elements:[m],startChar:o.abcelem.startChar,endChar:o.abcelem.endChar,startCharArray:[o.abcelem.startChar],endCharArray:[o.abcelem.endChar],midiPitches:o.abcelem.midiPitches?Ia.cloneArray(o.abcelem.midiPitches):[]},o.abcelem.midiGraceNotePitches&&(s["event"+c].midiGraceNotePitches=Ia.cloneArray(o.abcelem.midiGraceNotePitches));else{if(s["event"+c].left?s["event"+c].left=Math.min(s["event"+c].left,o.x):s["event"+c].left=o.x,s["event"+c].elements.push(m),s["event"+c].startCharArray.push(o.abcelem.startChar),s["event"+c].endCharArray.push(o.abcelem.endChar),s["event"+c].startChar===null&&(s["event"+c].startChar=o.abcelem.startChar),s["event"+c].endChar===null&&(s["event"+c].endChar=o.abcelem.endChar),o.abcelem.midiPitches&&o.abcelem.midiPitches.length){s["event"+c].midiPitches||(s["event"+c].midiPitches=[]);for(var y=0;y<o.abcelem.midiPitches.length;y++)s["event"+c].midiPitches.push(o.abcelem.midiPitches[y])}if(o.abcelem.midiGraceNotePitches&&o.abcelem.midiGraceNotePitches.length){s["event"+c].midiGraceNotePitches||(s["event"+c].midiGraceNotePitches=[]);for(var b=0;b<o.abcelem.midiGraceNotePitches.length;b++)s["event"+c].midiGraceNotePitches.push(o.abcelem.midiGraceNotePitches[b])}}g&&(s["event"+c].measureStart=!0,g=!1)}}return{isTiedState:p,duration:v/d,nextIsBar:g||o.type==="bar"}},this.makeVoicesArray=function(){for(var s=[],o=[],c={},f=0;f<this.engraver.staffgroups.length;f++){var u=this.engraver.staffgroups[f];if(u&&u.staffs&&u.staffs.length>0){var l=u.staffs[0],h=l.absoluteY,d=h-l.top*Fa.STEP,p=u.staffs[u.staffs.length-1];h=p.absoluteY;for(var g=h-p.bottom*Fa.STEP,v=g-d,m=u.voices,y=0;y<m.length;y++)if(!(m[y].staff&&m[y].staff.isTabStaff)){var x=!1;s[y]||(s[y]=[]),o[y]===void 0&&(o[y]=0);for(var b=m[y].children,w=0;w<b.length;w++)b[w].type==="tempo"&&(c[o[y]]=this.getBpm(b[w].abcelem)),s[y].push({top:d,height:v,line:u.line,measureNumber:o[y],elem:b[w]}),b[w].type==="bar"&&x&&o[y]++,(b[w].type==="note"||b[w].type==="rest")&&(x=!0)}}}return this.tempoLocations=c,s},this.setupEvents=function(s,o,c,f){f||(f=1);for(var u=[],l={},h=s,d,p=!0,g=this.makeVoicesArray(),v=0,m=0;m<g.length;m++){var y=h,x=Math.round(y*1e3),b=0,w=-1,C=g[m],T=c;o=this.getBeatLength()*T/60;for(var B=-1,E=0;E<C.length;E++){var z=C[E].measureNumber;B!==z&&this.tempoLocations[z]&&(T=this.tempoLocations[z],o=f*this.getBeatLength()*T/60,B=z);var F=C[E].elem,O=this.addElementToEvents(l,F,x,C[E].top,C[E].height,C[E].line,C[E].measureNumber,o,d,p);d=O.isTiedState,p=O.nextIsBar,y+=O.duration;var R;if(F.duration>0&&l["event"+x]&&(R="event"+x),x=Math.round(y*1e3),F.type==="bar"){var Y=F.abcelem.type,K=Y==="bar_right_repeat"||Y==="bar_dbl_repeat",P=F.abcelem.startEnding==="1",k=Y==="bar_left_repeat"||Y==="bar_dbl_repeat"||Y==="bar_right_repeat";if(K){E>0&&(l[R].endX=F.x),w===-1&&(w=E);var _=0;B=-1;for(var L=b;L<w;L++){z=C[L].measureNumber,B!==z&&this.tempoLocations[z]&&(T=this.tempoLocations[z],o=f*this.getBeatLength()*T/60,B=z);var A=C[L].elem;O=this.addElementToEvents(l,A,x,C[L].top,C[L].height,C[L].line,C[L].measureNumber,o,d,p),d=O.isTiedState,p=O.nextIsBar,y+=O.duration,_=x,x=Math.round(y*1e3)}l["event"+_]&&(l["event"+_].endX=C[w].elem.x),p=!0,w=-1}P&&(w=E),k&&(b=E)}}v=Math.max(v,x)}return u=a(l),r(u),i(this.lines,u),u.push({type:"end",milliseconds:v}),this.addUsefulCallbackInfo(u,T*f),u},this.addUsefulCallbackInfo=function(s,o){for(var c=this.millisecondsPerMeasure(o),f=0;f<s.length;f++){var u=s[f];u.millisecondsPerMeasure=c}};function n(s,o){for(;o<s.length&&s[o].left===null;)o++;return s[o]}function i(s,o){if(!(o.length<1)){for(var c=0;c<o.length-1;c++){var f=o[c],u=n(o,c+1);if(f.left!==null){var l=u&&f.top===u.top?u.left:s[f.line].staffGroup.w;f.endX!==void 0?l>f.left&&(f.endX=Math.min(f.endX,l)):f.endX=l}}var h=o[o.length-1];h.endX=s[h.line].staffGroup.w}}this.getBpm=function(s){var o;if(s||(s=this.metaText?this.metaText.tempo:null),s){o=s.bpm;var c=this.getBeatLength(),f=s.duration&&s.duration.length>0?s.duration[0]:c;o=o*f/c}if(!o){o=180;var u=this.getMeterFraction();u&&u.num!==3&&u.num%3===0&&(o=120)}return o},this.setTiming=function(s,o){if(o=o||0,!this.engraver||!this.engraver.staffgroups)return console.log("setTiming cannot be called before the tune is drawn."),this.noteTimings=[],this.noteTimings;var c=this.metaText?this.metaText.tempo:null,f=this.getBpm(c),u=1;s?c&&(u=s/f):s=f;var l=this.getBeatLength(),h=s/60,d=this.getBarLength(),p=d/l*o/h;p&&(p-=this.getPickupLength()/l/h);var g=l*h;return this.noteTimings=this.setupEvents(p,g,s,u),this.noteTimings.length>0?(this.totalTime=this.noteTimings[this.noteTimings.length-1].milliseconds/1e3,this.totalBeats=this.totalTime*h):(this.totalTime=void 0,this.totalBeats=void 0),this.noteTimings},this.setUpAudio=function(s){s||(s={});var o=Po(this,s);return Do(o,s,this.formatting.percmap,this.formatting.midi)},this.deline=function(s){return Io(this.lines,s)},this.findSelectableElement=function(s){return this.engraver&&this.engraver.selectables?this.engraver.findSelectableElement(s):null},this.getSelectableArray=function(){return this.engraver&&this.engraver.selectables?this.engraver.selectables:[]}},Oo=Fo,Oa=Yr,Ho=function(e){var t=this,r={},a="";e.reset(),this.setVisualTranspose=function(n){n!==void 0&&(e.visualTranspose=n)},this.cleanUp=function(n,i,s){dr(e),delete e.runningFonts,zo(e),e.metaText.tempo&&e.metaText.tempo.bpm&&!e.metaText.tempo.duration&&(e.metaText.tempo.duration=[e.getBeatLength()]);var o=!1,c,f,u;for(c=0;c<e.lines.length;c++)if(e.lines[c].staff!==void 0){var l=!1;for(f=0;f<e.lines[c].staff.length;f++)if(e.lines[c].staff[f]===void 0)o=!0,e.lines[c].staff[f]=null;else for(u=0;u<e.lines[c].staff[f].voices.length;u++)e.lines[c].staff[f].voices[u]===void 0?e.lines[c].staff[f].voices[u]=[]:pr(e.lines[c].staff[f].voices[u])&&(l=!0);l||(e.lines[c]=null,o=!0)}if(o&&(e.lines=e.lines.filter(function(b){return!!b}),e.lines.forEach(function(b){b.staff&&(b.staff=b.staff.filter(function(w){return!!w}))})),n)for(;qo(e.lines,n););if(i){for(o=!1,c=0;c<e.lines.length;c++)if(e.lines[c].staff!==void 0)for(f=0;f<e.lines[c].staff.length;f++){var h=!1;for(u=0;u<e.lines[c].staff[f].voices.length;u++)Vo(e.lines[c].staff[f].voices[u])&&(h=!0);h||(o=!0,e.lines[c].staff[f]=null)}o&&e.lines.forEach(function(b){b.staff&&(b.staff=b.staff.filter(function(w){return!!w}))})}for(Go(e.lines),c=0;c<e.lines.length;c++)if(e.lines[c].staff)for(f=0;f<e.lines[c].staff.length;f++)delete e.lines[c].staff[f].workingClef;for(var d=!1;$o(e);)d=!0;if(d)for(var p=0,g=za(e.lines,p);g!=="not-found";)g=za(e.lines,p),g?p++:Jo(e.lines,p);for(var c=0;c<e.lines.length;c++){var v=e.lines[c].staff;if(v)for(e.staffNum=0;e.staffNum<v.length;e.staffNum++)for(v[e.staffNum].clef&&Oa.fixClef(v[e.staffNum].clef),e.voiceNum=0;e.voiceNum<v[e.staffNum].voices.length;e.voiceNum++){var m=v[e.staffNum].voices[e.voiceNum];Yo(m,e.staffNum,e.voiceNum,s);for(var y=0;y<m.length;y++)m[y].el_type==="clef"&&Oa.fixClef(m[y]);if(m.length>0&&m[m.length-1].barNumber){var x=ti(e.lines,c);x&&(x.staff[0].barNumber=m[m.length-1].barNumber),delete m[m.length-1].barNumber}}}return delete e.staffNum,delete e.voiceNum,delete e.lineNum,delete e.potentialStartBeam,delete e.potentialEndBeam,delete e.vskipPending,s},this.addTieToLastNote=function(n){var i=Xo(e);return i&&i.pitches&&i.pitches.length>0?(i.pitches[0].startTie={},n&&(i.pitches[0].startTie.style="dotted"),!0):!1},this.appendElement=function(n,i,s,o){if(o.el_type=n,i!==null&&(o.startChar=i),s!==null&&(o.endChar=s),n==="note"){var c=Uo(o);c>=.25||o.force_end_beam_last&&e.potentialStartBeam!==void 0?F0(e):o.end_beam&&e.potentialStartBeam!==void 0?o.rest===void 0?Ko(o,e):F0(e):o.rest===void 0&&(e.potentialStartBeam===void 0?o.end_beam||(e.potentialStartBeam=o,delete e.potentialEndBeam):e.potentialEndBeam=o)}else F0(e);return delete o.end_beam,delete o.force_end_beam_last,o.rest&&o.rest.type==="invisible"&&delete o.decoration,e.lines.length<=e.lineNum||e.lines[e.lineNum].staff.length<=e.staffNum?!1:(jo(t,e,o,r,a),!0)},this.appendStartingElement=function(n,i,s,o){dr(e);var c;n==="key"&&(c=o.impliedNaturals,delete o.impliedNaturals,delete o.explicitAccidentals);var f=Object.assign({},o);if(e.lines[e.lineNum]){var u=e.lines[e.lineNum].staff;if(u){u.length<=e.staffNum&&(u[e.staffNum]={},u[e.staffNum].clef=Object.assign({},u[0].clef),u[e.staffNum].key=Object.assign({},u[0].key),u[0].meter&&(u[e.staffNum].meter=Object.assign({},u[0].meter)),u[e.staffNum].workingClef=Object.assign({},u[0].workingClef),u[e.staffNum].voices=[[]]),n==="clef"&&(u[e.staffNum].workingClef=f);for(var l=u[e.staffNum].voices[e.voiceNum],h=0;h<l.length;h++){if(l[h].el_type==="note"||l[h].el_type==="bar"){f.el_type=n,f.startChar=i,f.endChar=s,c&&(f.accidentals=c.concat(f.accidentals)),l.push(f);return}if(l[h].el_type===n){f.el_type=n,f.startChar=i,f.endChar=s,c&&(f.accidentals=c.concat(f.accidentals)),l[h]=f;return}}u[e.staffNum][n]=o}}},this.addSubtitle=function(n,i){c0(e,{subtitle:{text:n,startChar:i.startChar,endChar:i.endChar}})},this.addSpacing=function(n){e.vskipPending=n},this.addNewPage=function(n){c0(e,{newpage:n})},this.addSeparator=function(n,i,s,o){c0(e,{separator:{spaceAbove:Math.round(n),spaceBelow:Math.round(i),lineLength:Math.round(s),startChar:o.startChar,endChar:o.endChar}})},this.addText=function(n,i){c0(e,{text:{text:n,startChar:i.startChar,endChar:i.endChar}})},this.addCentered=function(n){c0(e,{text:[{text:n,center:!0}]})},this.changeVoiceScale=function(n){t.appendElement("scale",null,null,{size:n})},this.changeVoiceColor=function(n){t.appendElement("color",null,null,{color:n})},this.startNewLine=function(n){dr(e),n.currentVoiceName&&(a=n.currentVoiceName,r[n.currentVoiceName]=n),e.lines[e.lineNum]===void 0?Qo(t,e,n):e.lines[e.lineNum].staff===void 0?(e.lineNum++,this.startNewLine(n)):e.lines[e.lineNum].staff[e.staffNum]===void 0?ri(t,e,n):e.lines[e.lineNum].staff[e.staffNum].voices[e.voiceNum]===void 0?Xr(t,e,n):pr(e.lines[e.lineNum].staff[e.staffNum].voices[e.voiceNum])?(e.lineNum++,this.startNewLine(n)):n.part&&t.appendElement("part",n.part.startChar,n.part.endChar,{title:n.part.title})},this.setRunningFont=function(n,i){e.runningFonts[n]=i},this.setBarNumberImmediate=function(n){var i=this.getCurrentVoice();if(i&&i.length>0){var s=i[i.length-1];if(s.el_type==="bar")s.barNumber!==void 0&&(s.barNumber=n);else return n-1}return n},this.hasBeginMusic=function(){for(var n=0;n<e.lines.length;n++)if(e.lines[n].staff)return!0;return!1},this.isFirstLine=function(n){for(var i=n-1;i>=0;i--)if(e.lines[i].staff!==void 0)return!1;return!0},this.getCurrentVoice=function(){var n=Wo(e.lines,e.lineNum);if(!n)return null;var i=n.staff[e.staffNum];return i&&i.voices[e.voiceNum]!==void 0?i.voices[e.voiceNum]:null},this.setCurrentVoice=function(n,i,s){e.staffNum=n,e.voiceNum=i,a=s;for(var o=0;o<e.lines.length;o++)if(e.lines[o].staff&&(e.lines[o].staff[n]===void 0||e.lines[o].staff[n].voices[i]===void 0||!pr(e.lines[o].staff[n].voices[i])))return e.lineNum=o,!!(!e.lines[o].staff[n]||e.lines[o].staff[n].voices[i]);return e.lineNum=o,!1},this.addMetaText=function(n,i,s){e.metaText[n]===void 0?(e.metaText[n]=i,e.metaTextInfo[n]=s):(typeof e.metaText[n]=="string"&&typeof i=="string"?e.metaText[n]+=`
8
- `+i:(e.metaText[n]==="string"&&(e.metaText[n]=[{text:e.metaText[n]}]),typeof i=="string"&&(i=[{text:i}]),e.metaText[n]=e.metaText[n].concat(i)),e.metaTextInfo[n].endChar=s.endChar)},this.addMetaTextArray=function(n,i,s){e.metaText[n]===void 0?(e.metaText[n]=[i],e.metaTextInfo[n]=s):(e.metaText[n].push(i),e.metaTextInfo[n].endChar=s.endChar)},this.addMetaTextObj=function(n,i,s){e.metaText[n]=i,e.metaTextInfo[n]=s}};function Ha(e){if(!e||typeof e=="string")return!1;for(var t=0;t<e.length;t++)if(typeof e[t]!="string")return!1;return!0}function zo(e){Ha(e.metaText.notes)&&(e.metaText.notes=e.metaText.notes.join(`
5
+ `+u);l===!1&&(f[2]===null&&f[3]?H.chord.push({name:u,rel_position:f[3]}):H.chord.push({name:u,position:f[2]})),t+=f[0];var d=fe.skipWhiteSpace(e.substring(t));d>0&&(H.force_end_beam_last=!0),t+=d}else if(Os.indexOf(e[t])===-1?f=Ma(e,t):f=[0],f[0]>0)f[1]===null?t+1<e.length&&this.startNewLine():f[1].length>0&&(f[1].indexOf("style=")===0?H.style=f[1].substr(6):(H.decoration===void 0&&(H.decoration=[]),f[1]==="beambr1"?H.beambr=1:f[1]==="beambr2"?H.beambr=2:H.decoration.push(f[1]))),t+=f[0];else if(f=Ys(e,t),f[0]>0)H.gracenotes=f[1],t+=f[0];else break;if(f=Xs(e,t),f[0]>0){s=0,H.gracenotes!==void 0&&(H.rest={type:"spacer"},H.duration=.125,S.addFormattingOptions(H,Ue.formatting,"note"),We.appendElement("note",r+t,r+t+f[0],H),S.measureNotEmpty=!0,H={});var p={type:f[1]};p.type.length===0?be("Unknown bar type",e,t):(S.inEnding&&p.type!=="bar_thin"&&(p.endEnding=!0,S.inEnding=!1),f[2]&&(p.startEnding=f[2],S.inEnding&&(p.endEnding=!0),S.inEnding=!0,f[1]==="bar_right_repeat"?S.restoreStartEndingHoldOvers():S.duplicateStartEndingHoldOvers()),H.decoration!==void 0&&(p.decoration=H.decoration),H.chord!==void 0&&(p.chord=H.chord),p.startEnding&&S.barFirstEndingNum===void 0?S.barFirstEndingNum=S.currBarNumber:p.startEnding&&p.endEnding&&S.barFirstEndingNum?S.currBarNumber=S.barFirstEndingNum:p.endEnding&&(S.barFirstEndingNum=void 0),p.type!=="bar_invisible"&&S.measureNotEmpty&&Ar()&&(S.currBarNumber++,S.barNumbers&&S.currBarNumber%S.barNumbers===0&&(p.barNumber=S.currBarNumber)),S.addFormattingOptions(H,Ue.formatting,"bar"),We.appendElement("bar",r+c,r+t+f[0],p),S.measureNotEmpty=!1,H={}),t+=f[0]}else if(e[t]==="&")f=qs(e,t),f[0]>0&&(We.appendElement("overlay",r,r+1,{}),t+=1,s++);else{if(f=Us(e,t),f.consumed>0&&(f.startSlur!==void 0&&(H.startSlur=f.startSlur),f.dottedSlur&&(H.dottedSlur=!0),f.triplet!==void 0&&(i>0?be("Can't nest triplets",e,t):(H.startTriplet=f.triplet,H.tripletMultiplier=f.tripletQ/f.triplet,H.tripletR=f.num_notes,i=f.num_notes===void 0?f.triplet:f.num_notes)),t+=f.consumed),e[t]==="["){t++;for(var g=null,v=!1,m=!1;!m;){var y=Ma(e,t);y[0]>0&&(t+=y[0]);var x=Mr(e,t,{},!1);if(x!==null&&x.pitch!==void 0)y[0]>0&&y[1].indexOf("style=")!==0&&(H.decoration===void 0&&(H.decoration=[]),H.decoration.push(y[1])),x.end_beam&&(H.end_beam=!0,delete x.end_beam),H.pitches===void 0?(H.duration=x.duration,H.pitches=[x]):H.pitches.push(x),delete x.duration,y[0]>0&&y[1].indexOf("style=")===0&&(H.pitches[H.pitches.length-1].style=y[1].substr(6)),S.inTieChord[H.pitches.length]&&(x.endTie=!0,S.inTieChord[H.pitches.length]=void 0),x.startTie&&(S.inTieChord[H.pitches.length]=!0),t=x.endChar,delete x.endChar;else if(e[t]===" ")be("Spaces are not allowed in chords",e,t),t++;else{if(t<e.length&&e[t]==="]"){t++,S.next_note_duration!==0&&(H.duration=H.duration*S.next_note_duration,S.next_note_duration=0),Ea(S,s,H)&&(H.pitches.forEach(function(I){I.endTie=!0}),s0(S,s,!1)),i>0&&!(H.rest&&H.rest.type==="spacer")&&(i--,i===0&&(H.endTriplet=!0));for(var b=!1;t<e.length&&!b;){switch(e[t]){case" ":case" ":g0(H);break;case")":H.endSlur===void 0?H.endSlur=1:H.endSlur++;break;case"-":H.pitches.forEach(function(I){I.startTie={}}),s0(S,s,!0);break;case">":case"<":var w=Ui(e,t);t+=w[0]-1,S.next_note_duration=w[2],g?g=g*w[1]:g=w[1];break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"/":var C=fe.getFraction(e,t);g=C.value,t=C.index;var T=e[t];T===" "&&(v=!0),T==="-"||T===")"||T===" "||T==="<"||T===">"?t--:b=!0;break;case"0":g=0;break;default:b=!0;break}b||t++}}else be("Expected ']' to end the chords",e,t);H.pitches!==void 0&&(g!==null&&(H.duration=H.duration*g,v&&g0(H)),S.addFormattingOptions(H,Ue.formatting,"note"),We.appendElement("note",r+c,r+t,H),S.measureNotEmpty=!0,H={}),m=!0}}}else{var B={},E=Mr(e,t,B,!0);if(B.endTie!==void 0&&s0(S,s,!0),E!==null){E.pitch!==void 0?(H.pitches=[{}],E.accidental!==void 0&&(H.pitches[0].accidental=E.accidental),H.pitches[0].pitch=E.pitch,H.pitches[0].name=E.name,(E.midipitch||E.midipitch===0)&&(H.pitches[0].midipitch=E.midipitch),E.endSlur!==void 0&&(H.pitches[0].endSlur=E.endSlur),E.endTie!==void 0&&(H.pitches[0].endTie=E.endTie),E.startSlur!==void 0&&(H.pitches[0].startSlur=E.startSlur),H.startSlur!==void 0&&(H.pitches[0].startSlur=H.startSlur),H.dottedSlur!==void 0&&(H.pitches[0].dottedSlur=!0),E.startTie!==void 0&&(H.pitches[0].startTie=E.startTie),H.startTie!==void 0&&(H.pitches[0].startTie=H.startTie)):(H.rest=E.rest,E.rest.type==="multimeasure"&&Ar()&&(S.currBarNumber+=E.rest.text-1),E.endSlur!==void 0&&(H.endSlur=E.endSlur),E.endTie!==void 0&&(H.rest.endTie=E.endTie),E.startSlur!==void 0&&(H.startSlur=E.startSlur),E.startTie!==void 0&&(H.rest.startTie=E.startTie),H.startTie!==void 0&&(H.rest.startTie=H.startTie)),E.chord!==void 0&&(H.chord=E.chord),E.duration!==void 0&&(H.duration=E.duration),E.decoration!==void 0&&(H.decoration=E.decoration),E.graceNotes!==void 0&&(H.graceNotes=E.graceNotes),delete H.startSlur,delete H.dottedSlur,Ea(S,s,H)&&(H.pitches!==void 0?H.pitches[0].endTie=!0:H.rest.type!=="spacer"&&(H.rest.endTie=!0),s0(S,s,!1)),(E.startTie||H.startTie)&&s0(S,s,!0),t=E.endChar,i>0&&!(E.rest&&E.rest.type==="spacer")&&(i--,i===0&&(H.endTriplet=!0)),E.end_beam&&g0(H),H.rest&&H.rest.type==="rest"&&H.duration===1&&Sa(S)<=1&&(H.rest.type="whole",H.duration=Sa(S)),H.duration<1&&Hs.indexOf(H.duration)===-1&&H.duration!==0&&(!H.rest||H.rest.type!=="spacer")&&be("Duration not representable: "+e.substring(c,t),e,t),S.addFormattingOptions(H,Ue.formatting,"note");var z=We.appendElement("note",r+c,r+t,H);z||(this.startNewLine(),We.appendElement("note",r+c,r+t,H)),S.measureNotEmpty=!0,H={}}}t===c&&(e[t]!==" "&&e[t]!=="`"&&be("Unknown character ignored",e,t),t++)}}}this.lineContinuation=e.indexOf("")>=0||n[0]>0,this.lineContinuation||(H={})}};var s0=function(e,t,r){var a=e.currentVoice?e.currentVoice.staffNum*100+e.currentVoice.index:0;e.inTie[t]===void 0&&(e.inTie[t]=[]),e.inTie[t][a]=r},Rs=function(e,t){if(e[t]==='"'){var r=fe.getBrackettedSubstring(e,t,5);if(r[2]||be("Missing the closing quote while parsing the chord symbol",e,t),r[0]>0&&r[1].length>0&&r[1][0]==="^")r[1]=r[1].substring(1),r[2]="above";else if(r[0]>0&&r[1].length>0&&r[1][0]==="_")r[1]=r[1].substring(1),r[2]="below";else if(r[0]>0&&r[1].length>0&&r[1][0]==="<")r[1]=r[1].substring(1),r[2]="left";else if(r[0]>0&&r[1].length>0&&r[1][0]===">")r[1]=r[1].substring(1),r[2]="right";else if(r[0]>0&&r[1].length>0&&r[1][0]==="@"){r[1]=r[1].substring(1);var a=fe.getFloat(r[1]);if(a.digits===0)return be("Missing first position in absolutely positioned annotation.",e,t),r[1]=r[1].replace("@",""),r[2]="above",r;if(r[1]=r[1].substring(a.digits),r[1][0]!==",")return be("Missing comma absolutely positioned annotation.",e,t),r[1]=r[1].replace("@",""),r[2]="above",r;r[1]=r[1].substring(1);var i=fe.getFloat(r[1]);if(i.digits===0)return be("Missing second position in absolutely positioned annotation.",e,t),r[1]=r[1].replace("@",""),r[2]="above",r;r[1]=r[1].substring(i.digits);var n=fe.skipWhiteSpace(r[1]);r[1]=r[1].substring(n),r[2]=null,r[3]={x:a.value,y:i.value}}else S.freegchord!==!0&&(r[1]=r[1].replace(/([ABCDEFG0-9])b/g,"$1♭"),r[1]=r[1].replace(/([ABCDEFG0-9])#/g,"$1♯"),r[1]=r[1].replace(/^([ABCDEFG])([♯♭]?)o([^A-Za-z])/g,"$1$2°$3"),r[1]=r[1].replace(/^([ABCDEFG])([♯♭]?)o$/g,"$1$2°"),r[1]=r[1].replace(/^([ABCDEFG])([♯♭]?)0([^A-Za-z])/g,"$1$2ø$3"),r[1]=r[1].replace(/^([ABCDEFG])([♯♭]?)\^([^A-Za-z])/g,"$1$2∆$3")),r[2]="default",r[1]=Xi.chordName(S,r[1]);return r}return[0,""]},Ys=function(e,t){if(e[t]==="{"){var r=fe.getBrackettedSubstring(e,t,1,"}");r[2]||be("Missing the closing '}' while parsing grace note",e,t),e[t+r[0]]===")"&&(r[0]++,r[1]+=")");for(var a=[],i=0,n=!1;i<r[1].length;){var s=!1;r[1][i]==="/"&&(s=!0,i++);var c=Mr(r[1],i,{},!1);c!==null?(c.duration=c.duration/(S.default_length*8),s&&(c.acciaccatura=!0),c.rest?be("Rests not allowed as grace notes '"+r[1][i]+"' while parsing grace note",e,t):a.push(c),n&&(c.endTie=!0,n=!1),c.startTie&&(n=!0),i=c.endChar,delete c.endChar,c.end_beam&&(c.endBeam=!0,delete c.end_beam)):(r[1][i]===" "?a.length>0&&(a[a.length-1].endBeam=!0):be("Unknown character '"+r[1][i]+"' while parsing grace note",e,t),i++)}if(a.length)return[r[0],a]}return[0]};function qs(e,t){if(e[t]==="&"){for(var r=t;e[t]&&e[t]!==":"&&e[t]!=="|";)t++;return[t-r,e.substring(r+1,t)]}return[0]}function Sa(e){var t=e.origMeter;return!t||t.type!=="specified"||!t.value||t.value.length===0?1:parseInt(t.value[0].num,10)/parseInt(t.value[0].den,10)}var Ma=function(e,t){var r=S.macros[e[t]];if(r!==void 0)return(r[0]==="!"||r[0]==="+")&&(r=r.substring(1)),(r[r.length-1]==="!"||r[r.length-1]==="+")&&(r=r.substring(0,r.length-1)),wa.includes(r)?[1,r]:xa.includes(r)?(S.volumePosition==="hidden"&&(r=""),[1,r]):Ca.includes(r)?(S.dynamicPosition==="hidden"&&(r=""),[1,r]):(S.ignoredDecorations.includes(r)||be("Unknown macro: "+r,e,t),[1,""]);switch(e[t]){case".":if(e[t+1]==="("||e[t+1]==="-")break;return[1,"staccato"];case"u":return[1,"upbow"];case"v":return[1,"downbow"];case"~":return[1,"irishroll"];case"!":case"+":var a=fe.getBrackettedSubstring(e,t,5);if(a[1].length>1&&(a[1][0]==="^"||a[1][0]==="_")&&(a[1]=a[1].substring(1)),wa.includes(a[1]))return a;if(xa.includes(a[1]))return S.volumePosition==="hidden"&&(a[1]=""),a;if(Ca.includes(a[1]))return S.dynamicPosition==="hidden"&&(a[1]=""),a;var i=ka.findIndex(function(n){return a[1]===n[0]});return i>=0?(a[1]=ka[i][1],a):(i=_a.findIndex(function(n){return a[1]===n[0]}),i>=0?(a[1]=_a[i][1],S.dynamicPosition==="hidden"&&(a[1]=""),a):e[t]==="!"&&(a[0]===1||e[t+a[0]-1]!=="!")?[1,null]:(be("Unknown decoration: "+a[1],e,t),a[1]="",a));case"H":return[1,"fermata"];case"J":return[1,"slide"];case"L":return[1,"accent"];case"M":return[1,"mordent"];case"O":return[1,"coda"];case"P":return[1,"pralltriller"];case"R":return[1,"roll"];case"S":return[1,"segno"];case"T":return[1,"trill"];case"t":return[1,"trillh"]}return[0,0]},Ws=function(e,t){for(var r=t;fe.isWhiteSpace(e[t]);)t++;return[t-r]},Xs=function(e,t){var r=fe.getBarLine(e,t);if(r.len===0)return[0,""];if(r.warn)return be(r.warn,e,t),[r.len,""];for(var a=0;a<e.length&&e[t+r.len+a]===" ";a++);var i=r.len;if(e[t+r.len+a]==="["&&(r.len+=a+1),e[t+r.len]==='"'&&e[t+r.len-1]==="["){var n=fe.getBrackettedSubstring(e,t+r.len,5);return[r.len+n[0],r.token,n[1]]}var s=fe.getTokenOf(e.substring(t+r.len),"1234567890-,");return s.len===0||s.token[0]==="-"?[i,r.token]:[r.len+s.len,r.token,s.token]},Us=function(e,t){var r={},a=t;for(e[t]==="."&&e[t+1]==="("&&(r.dottedSlur=!0,t++);e[t]==="("||fe.isWhiteSpace(e[t]);)e[t]==="("&&(t+1<e.length&&e[t+1]>="2"&&e[t+1]<="9"?(r.triplet!==void 0?be("Can't nest triplets",e,t):(r.triplet=e[t+1]-"0",r.tripletQ=Gs[r.triplet],r.num_notes=r.triplet,t+2<e.length&&e[t+2]===":"&&(t+3<e.length&&e[t+3]===":"?t+4<e.length&&e[t+4]>="1"&&e[t+4]<="9"?(r.num_notes=e[t+4]-"0",t+=3):be("expected number after the two colons after the triplet to mark the duration",e,t):t+3<e.length&&e[t+3]>="1"&&e[t+3]<="9"?(r.tripletQ=e[t+3]-"0",t+4<e.length&&e[t+4]===":"?t+5<e.length&&e[t+5]>="1"&&e[t+5]<="9"&&(r.num_notes=e[t+5]-"0",t+=4):t+=2):be("expected number after the triplet to mark the duration",e,t))),t++):r.startSlur===void 0?r.startSlur=1:r.startSlur++),t++;return r.consumed=t-a,r};qr.prototype.startNewLine=function(){var e={startChar:-1,endChar:-1};S.partForNextLine.title&&(e.part=S.partForNextLine),e.clef=S.currentVoice&&S.staves[S.currentVoice.staffNum].clef!==void 0?Object.assign({},S.staves[S.currentVoice.staffNum].clef):Object.assign({},S.clef);var t=S.currentVoice?S.currentVoice.scoreTranspose:0;if(e.key=ya.standardKey(S.key.root+S.key.acc+S.key.mode,S.key.root,S.key.acc,t),e.key.mode=S.key.mode,S.key.impliedNaturals&&(e.key.impliedNaturals=S.key.impliedNaturals),S.key.explicitAccidentals)for(var r=0;r<S.key.explicitAccidentals.length;r++){for(var a=!1,i=0;i<e.key.accidentals.length;i++)e.key.accidentals[i].note===S.key.explicitAccidentals[r].note&&(e.key.accidentals[i].acc=S.key.explicitAccidentals[r].acc,a=!0);a||e.key.accidentals.push(S.key.explicitAccidentals[r])}if(S.targetKey=e.key,e.key.explicitAccidentals&&delete e.key.explicitAccidentals,ya.addPosToKey(e.clef,e.key),S.meter!==null?(S.currentVoice?(S.staves.forEach(function(o){o.meter=S.meter}),e.meter=S.staves[S.currentVoice.staffNum].meter,S.staves[S.currentVoice.staffNum].meter=null):e.meter=S.meter,S.meter=null):S.currentVoice&&S.staves[S.currentVoice.staffNum].meter&&(e.meter=S.staves[S.currentVoice.staffNum].meter,S.staves[S.currentVoice.staffNum].meter=null),S.currentVoice&&S.currentVoice.name&&(e.name=S.currentVoice.name),S.vocalfont&&(e.vocalfont=S.vocalfont),S.tripletfont&&(e.tripletfont=S.tripletfont),S.gchordfont&&(e.gchordfont=S.gchordfont),S.style&&(e.style=S.style),S.currentVoice){var n=S.staves[S.currentVoice.staffNum];n.brace&&(e.brace=n.brace),n.bracket&&(e.bracket=n.bracket),n.connectBarLines&&(e.connectBarLines=n.connectBarLines),n.name&&(e.name=n.name[S.currentVoice.index]),n.subname&&(e.subname=n.subname[S.currentVoice.index]),S.currentVoice.stem&&(e.stem=S.currentVoice.stem),S.currentVoice.stafflines&&(e.stafflines=S.currentVoice.stafflines),S.currentVoice.staffscale&&(e.staffscale=S.currentVoice.staffscale),S.currentVoice.scale&&(e.scale=S.currentVoice.scale),S.currentVoice.color&&(e.color=S.currentVoice.color),S.currentVoice.style&&(e.style=S.currentVoice.style),S.currentVoice.transpose&&(e.clef.transpose=S.currentVoice.transpose),e.currentVoice=S.currentVoice;for(var s=Object.keys(S.voices),c=0;c<s.length;c++)e.currentVoice.staffNum===S.voices[s[c]].staffNum&&e.currentVoice.index===S.voices[s[c]].index&&(e.currentVoiceName=s[c])}S.barNumbers===0&&Ar()&&S.currBarNumber!==1&&(e.barNumber=S.currBarNumber),We.startNewLine(e),S.key.impliedNaturals&&delete S.key.impliedNaturals,S.partForNextLine={},S.tempoForNextLine.length===4&&We.appendElement(S.tempoForNextLine[0],S.tempoForNextLine[1],S.tempoForNextLine[2],S.tempoForNextLine[3]),S.tempoForNextLine=[]};var g0=function(e){return e.duration!==void 0&&e.duration<.25&&(e.end_beam=!0),e},Mr=function(e,t,r,a){var i=function(h){return h==="octave"||h==="duration"||h==="Zduration"||h==="broken_rhythm"||h==="end_slur"},n;e[t]==="."&&e[t+1]==="-"&&(n=!0,t++);for(var s="startSlur",c=!1;;){switch(e[t]){case"(":if(s==="startSlur")r.startSlur===void 0?r.startSlur=1:r.startSlur++;else return i(s)?(r.endChar=t,r):null;break;case")":if(i(s))r.endSlur===void 0?r.endSlur=1:r.endSlur++;else return null;break;case"^":if(s==="startSlur")r.accidental="sharp",s="sharp2";else if(s==="sharp2")r.accidental="dblsharp",s="pitch";else return i(s)?(r.endChar=t,r):null;break;case"_":if(s==="startSlur")r.accidental="flat",s="flat2";else if(s==="flat2")r.accidental="dblflat",s="pitch";else return i(s)?(r.endChar=t,r):null;break;case"=":if(s==="startSlur")r.accidental="natural",s="pitch";else return i(s)?(r.endChar=t,r):null;break;case"A":case"B":case"C":case"D":case"E":case"F":case"G":case"a":case"b":case"c":case"d":case"e":case"f":case"g":if(s==="startSlur"||s==="sharp2"||s==="flat2"||s==="pitch"){if(r.pitch=zs[e[t]],r.pitch+=7*(S.currentVoice&&S.currentVoice.octave!==void 0?S.currentVoice.octave:S.octave),r.name=e[t],r.accidental&&(r.name=Ta[r.accidental]+r.name),Xi.note(S,r),s="octave",a&&S.next_note_duration!==0?(r.duration=S.default_length*S.next_note_duration,S.next_note_duration=0,c=!0):r.duration=S.default_length,S.clef&&S.clef.type==="perc"||S.currentVoice&&S.currentVoice.clef==="perc"){var o=e[t];r.accidental&&(o=Ta[r.accidental]+o),Ue.formatting&&Ue.formatting.midi&&Ue.formatting.midi.drummap&&(r.midipitch=Ue.formatting.midi.drummap[o])}}else return i(s)?(r.endChar=t,r):null;break;case",":if(s==="octave")r.pitch-=7,r.name+=",";else return i(s)?(r.endChar=t,r):null;break;case"'":if(s==="octave")r.pitch+=7,r.name+="'";else return i(s)?(r.endChar=t,r):null;break;case"x":case"X":case"y":case"z":case"Z":if(s==="startSlur")r.rest={type:$s[e[t]]},delete r.accidental,delete r.startSlur,delete r.startTie,delete r.endSlur,delete r.endTie,delete r.end_beam,delete r.grace_notes,r.rest.type.indexOf("multimeasure")>=0?(r.duration=Ue.getBarLength(),r.rest.text=1,s="Zduration"):(a&&S.next_note_duration!==0?(r.duration=S.default_length*S.next_note_duration,S.next_note_duration=0,c=!0):r.duration=S.default_length,s="duration");else return i(s)?(r.endChar=t,r):null;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"0":case"/":if(s==="octave"||s==="duration"){var f=fe.getFraction(e,t);for(r.duration=r.duration*f.value,r.endChar=f.index;f.index<e.length&&(fe.isWhiteSpace(e[f.index])||e[f.index]==="-");)e[f.index]==="-"?r.startTie={}:r=g0(r),f.index++;t=f.index-1,s="broken_rhythm"}else if(s==="sharp2")r.accidental="quartersharp",s="pitch";else if(s==="flat2")r.accidental="quarterflat",s="pitch";else if(s==="Zduration"){var u=fe.getNumber(e,t);return r.duration=u.num*Ue.getBarLength(),r.rest.text=u.num,r.endChar=u.index,r}else return null;break;case"-":if(s==="startSlur")We.addTieToLastNote(n),r.endTie=!0;else if(s==="octave"||s==="duration"||s==="end_slur")if(r.startTie={},!c&&a)s="broken_rhythm";else return fe.isWhiteSpace(e[t+1])&&g0(r),r.endChar=t+1,r;else return s==="broken_rhythm"?(r.endChar=t,r):null;break;case" ":case" ":if(i(s)){r.end_beam=!0,n=!1;do e[t]==="."&&e[t+1]==="-"&&(n=!0,t++),e[t]==="-"&&(r.startTie={},n&&(r.startTie.style="dotted")),t++;while(t<e.length&&(fe.isWhiteSpace(e[t])||e[t]==="-")||e[t]==="."&&e[t+1]==="-");if(r.endChar=t,!c&&a&&(e[t]==="<"||e[t]===">"))t--,s="broken_rhythm";else return r}else return null;break;case">":case"<":if(i(s))if(a){var l=Ui(e,t);t+=l[0]-1,S.next_note_duration=l[2],r.duration=l[1]*r.duration,s="end_slur"}else return r.endChar=t,r;else return null;break;default:return i(s)?(r.endChar=t,r):null}if(t++,t===e.length)return i(s)?(r.endChar=t,r):null}return null},Ui=function(e,t){switch(e[t]){case">":return t<e.length-2&&e[t+1]===">"&&e[t+2]===">"?[3,1.875,.125]:t<e.length-1&&e[t+1]===">"?[2,1.75,.25]:[1,1.5,.5];case"<":return t<e.length-2&&e[t+1]==="<"&&e[t+2]==="<"?[3,.125,1.875]:t<e.length-1&&e[t+1]==="<"?[2,.25,1.75]:[1,.5,1.5]}return null};function Ar(){return S.currentVoice===void 0||S.currentVoice.staffNum===0&&S.currentVoice.index===0}var Vs=qr,Ce=rt,Wr=function(e,t){this.lineIndex=0,this.lines=e,this.multilineVars=t,this.skipWhiteSpace=function(l){for(var h=0;h<l.length;h++)if(!this.isWhiteSpace(l[h]))return h;return l.length};var r=function(l,h){return h>=l.length};this.eatWhiteSpace=function(l,h){for(var d=h;d<l.length;d++)if(!this.isWhiteSpace(l[d]))return d-h;return d-h},this.getKeyPitch=function(l){var h=this.skipWhiteSpace(l);if(r(l,h))return{len:0};switch(l[h]){case"A":return{len:h+1,token:"A"};case"B":return{len:h+1,token:"B"};case"C":return{len:h+1,token:"C"};case"D":return{len:h+1,token:"D"};case"E":return{len:h+1,token:"E"};case"F":return{len:h+1,token:"F"};case"G":return{len:h+1,token:"G"}}return{len:0}},this.getSharpFlat=function(l){if(l==="bass")return{len:0};switch(l[0]){case"#":return{len:1,token:"#"};case"b":return{len:1,token:"b"}}return{len:0}},this.getMode=function(l){var h=function(g,v){for(;v<g.length&&(g[v]>="a"&&g[v]<="z"||g[v]>="A"&&g[v]<="Z");)v++;return v},d=this.skipWhiteSpace(l);if(r(l,d))return{len:0};var p=l.substring(d,d+3).toLowerCase();switch((p.length>1&&p[1]===" "||p[1]==="^"||p[1]==="_"||p[1]==="=")&&(p=p[0]),p){case"mix":return{len:h(l,d),token:"Mix"};case"dor":return{len:h(l,d),token:"Dor"};case"phr":return{len:h(l,d),token:"Phr"};case"lyd":return{len:h(l,d),token:"Lyd"};case"loc":return{len:h(l,d),token:"Loc"};case"aeo":return{len:h(l,d),token:"m"};case"maj":return{len:h(l,d),token:""};case"ion":return{len:h(l,d),token:""};case"min":return{len:h(l,d),token:"m"};case"m":return{len:h(l,d),token:"m"}}return{len:0}},this.getClef=function(l,h){var d=l,p=this.skipWhiteSpace(l);if(r(l,p))return{len:0};var g=!1,v=l.substring(p);if(Ce.startsWith(v,"clef=")&&(g=!0,v=v.substring(5),p+=5),v.length===0&&g)return{len:p+5,warn:"No clef specified: "+d};var m=this.skipWhiteSpace(v);if(r(v,m))return{len:0};m>0&&(p+=m,v=v.substring(m));var y=null;if(Ce.startsWith(v,"treble"))y="treble";else if(Ce.startsWith(v,"bass3"))y="bass3";else if(Ce.startsWith(v,"bass"))y="bass";else if(Ce.startsWith(v,"tenor"))y="tenor";else if(Ce.startsWith(v,"alto2"))y="alto2";else if(Ce.startsWith(v,"alto1"))y="alto1";else if(Ce.startsWith(v,"alto"))y="alto";else if(!h&&g&&Ce.startsWith(v,"none"))y="none";else if(Ce.startsWith(v,"perc"))y="perc";else if(!h&&g&&Ce.startsWith(v,"C"))y="tenor";else if(!h&&g&&Ce.startsWith(v,"F"))y="bass";else if(!h&&g&&Ce.startsWith(v,"G"))y="treble";else return{len:p+5,warn:"Unknown clef specified: "+d};return v=v.substring(y.length),m=this.isMatch(v,"+8"),m>0?y+="+8":(m=this.isMatch(v,"-8"),m>0&&(y+="-8")),{len:p+y.length,token:y,explicit:g}},this.getBarLine=function(l,h){switch(l[h]){case"]":switch(++h,l[h]){case"|":return{len:2,token:"bar_thick_thin"};case"[":return++h,l[h]>="1"&&l[h]<="9"||l[h]==='"'?{len:2,token:"bar_invisible"}:{len:1,warn:"Unknown bar symbol"};default:return{len:1,token:"bar_invisible"}}case":":switch(++h,l[h]){case":":return{len:2,token:"bar_dbl_repeat"};case"|":switch(++h,l[h]){case"]":switch(++h,l[h]){case"|":return++h,l[h]===":"?{len:5,token:"bar_dbl_repeat"}:{len:3,token:"bar_right_repeat"};default:return{len:3,token:"bar_right_repeat"}}case"|":return++h,l[h]===":"?{len:4,token:"bar_dbl_repeat"}:{len:3,token:"bar_right_repeat"};default:return{len:2,token:"bar_right_repeat"}}default:return{len:1,warn:"Unknown bar symbol"}}case"[":if(++h,l[h]==="|")switch(++h,l[h]){case":":return{len:3,token:"bar_left_repeat"};case"]":return{len:3,token:"bar_invisible"};default:return{len:2,token:"bar_thick_thin"}}else return l[h]>="1"&&l[h]<="9"||l[h]==='"'?{len:1,token:"bar_invisible"}:{len:0};case"|":switch(++h,l[h]){case"]":return{len:2,token:"bar_thin_thick"};case"|":return++h,l[h]===":"?{len:3,token:"bar_left_repeat"}:{len:2,token:"bar_thin_thin"};case":":for(var d=0;l[h+d]===":";)d++;return{len:1+d,token:"bar_left_repeat"};default:return{len:1,token:"bar_thin"}}}return{len:0}},this.getTokenOf=function(l,h){for(var d=0;d<l.length;d++)if(h.indexOf(l[d])<0)return{len:d,token:l.substring(0,d)};return{len:d,token:l}},this.getToken=function(l,h,d){for(var p=h;p<d&&!this.isWhiteSpace(l[p]);)p++;return l.substring(h,p)},this.isMatch=function(l,h){var d=this.skipWhiteSpace(l);return r(l,d)?0:Ce.startsWith(l.substring(d),h)?d+h.length:0},this.getPitchFromTokens=function(l){var h={},d={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11};if(h.position=d[l[0].token],h.position===void 0)return{warn:"Pitch expected. Found: "+l[0].token};for(l.shift();l.length;)switch(l[0].token){case",":h.position-=7,l.shift();break;case"'":h.position+=7,l.shift();break;default:return h}return h},this.getKeyAccidentals2=function(l){for(var h;l.length>0;){var d;if(l[0].token==="^"){if(d="sharp",l.shift(),l.length===0)return{accs:h,warn:"Expected note name after "+d};switch(l[0].token){case"^":d="dblsharp",l.shift();break;case"/":d="quartersharp",l.shift();break}}else if(l[0].token==="=")d="natural",l.shift();else if(l[0].token==="_"){if(d="flat",l.shift(),l.length===0)return{accs:h,warn:"Expected note name after "+d};switch(l[0].token){case"_":d="dblflat",l.shift();break;case"/":d="quarterflat",l.shift();break}}else return{accs:h};if(l.length===0)return{accs:h,warn:"Expected note name after "+d};switch(l[0].token[0]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":h===void 0&&(h=[]),h.push({acc:d,note:l[0].token[0]}),l[0].token.length===1?l.shift():l[0].token=l[0].token.substring(1);break;default:return{accs:h,warn:"Expected note name after "+d+" Found: "+l[0].token}}}return{accs:h}},this.getKeyAccidental=function(l){var h={"^":"sharp","^^":"dblsharp","=":"natural",_:"flat",__:"dblflat","_/":"quarterflat","^/":"quartersharp"},d=this.skipWhiteSpace(l);if(r(l,d))return{len:0};var p=null;switch(l[d]){case"^":case"_":case"=":p=l[d];break;default:return{len:0}}if(d++,r(l,d))return{len:1,warn:"Expected note name after accidental"};switch(l[d]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":return{len:d+1,token:{acc:h[p],note:l[d]}};case"^":case"_":case"/":if(p+=l[d],d++,r(l,d))return{len:2,warn:"Expected note name after accidental"};switch(l[d]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":return{len:d+1,token:{acc:h[p],note:l[d]}};default:return{len:2,warn:"Expected note name after accidental"}}break;default:return{len:1,warn:"Expected note name after accidental"}}},this.isWhiteSpace=function(l){return l===" "||l===" "||l===""},this.getMeat=function(l,h,d){var p=l.indexOf("%",h);for(p>=0&&p<d&&(d=p);h<d&&(l[h]===" "||l[h]===" "||l[h]==="");)h++;for(;h<d&&(l[d-1]===" "||l[d-1]===" "||l[d-1]==="");)d--;return{start:h,end:d}};var a=function(l){return l>="A"&&l<="Z"||l>="a"&&l<="z"},i=function(l){return l>="0"&&l<="9"};this.tokenize=function(l,h,d,p){var g=this.getMeat(l,h,d);h=g.start,d=g.end;for(var v=[],m;h<d;){if(l[h]==='"'){for(m=h+1;m<d&&l[m]!=='"';)m++;v.push({type:"quote",token:l.substring(h+1,m),start:h+1,end:m}),m++}else if(a(l[h])){if(m=h+1,p)for(;m<d&&!this.isWhiteSpace(l[m]);)m++;else for(;m<d&&a(l[m]);)m++;v.push({type:"alpha",token:l.substring(h,m),continueId:i(l[m]),start:h,end:m}),h=m+1}else if(l[h]==="."&&i(l[m+1])){m=h+1;for(var y=null,x=null;m<d&&i(l[m]);)m++;x=parseFloat(l.substring(h,m)),v.push({type:"number",token:l.substring(h,m),intt:y,floatt:x,continueId:a(l[m]),start:h,end:m}),h=m+1}else if(i(l[h])||l[h]==="-"&&i(l[m+1])){m=h+1;for(var b=null,w=null;m<d&&i(l[m]);)m++;if(l[m]==="."&&i(l[m+1]))for(m++;m<d&&i(l[m]);)m++;else b=parseInt(l.substring(h,m));w=parseFloat(l.substring(h,m)),v.push({type:"number",token:l.substring(h,m),intt:b,floatt:w,continueId:a(l[m]),start:h,end:m}),h=m+1}else l[h]===" "||l[h]===" "||v.push({type:"punct",token:l[h],start:h,end:h+1}),m=h+1;h=m}return v},this.getVoiceToken=function(l,h,d){for(var p=h;p<d&&this.isWhiteSpace(l[p])||l[p]==="=";)p++;if(l[p]==='"'){var g=l.indexOf('"',p+1);return g===-1||g>=d?{len:1,err:"Missing close quote"}:{len:g-h+1,token:this.translateString(l.substring(p+1,g))}}else{for(var v=p;v<d&&!this.isWhiteSpace(l[v])&&l[v]!=="=";)v++;return{len:v-h+1,token:l.substring(p,v)}}};var n={"`a":"à","'a":"á","^a":"â","~a":"ã",'"a':"ä",oa:"å",aa:"å","=a":"ā",ua:"ă",";a":"ą","`e":"è","'e":"é","^e":"ê",'"e':"ë","=e":"ē",ue:"ĕ",";e":"ę",".e":"ė","`i":"ì","'i":"í","^i":"î",'"i':"ï","=i":"ī",ui:"ĭ",";i":"į","`o":"ò","'o":"ó","^o":"ô","~o":"õ",'"o':"ö","=o":"ō",uo:"ŏ","/o":"ø","`u":"ù","'u":"ú","^u":"û","~u":"ũ",'"u':"ü",ou:"ů","=u":"ū",uu:"ŭ",";u":"ų","`A":"À","'A":"Á","^A":"Â","~A":"Ã",'"A':"Ä",oA:"Å",AA:"Å","=A":"Ā",uA:"Ă",";A":"Ą","`E":"È","'E":"É","^E":"Ê",'"E':"Ë","=E":"Ē",uE:"Ĕ",";E":"Ę",".E":"Ė","`I":"Ì","'I":"Í","^I":"Î","~I":"Ĩ",'"I':"Ï","=I":"Ī",uI:"Ĭ",";I":"Į",".I":"İ","`O":"Ò","'O":"Ó","^O":"Ô","~O":"Õ",'"O':"Ö","=O":"Ō",uO:"Ŏ","/O":"Ø","`U":"Ù","'U":"Ú","^U":"Û","~U":"Ũ",'"U':"Ü",oU:"Ů","=U":"Ū",uU:"Ŭ",";U":"Ų",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",ss:"ß","'c":"ć","^c":"ĉ",uc:"č",cc:"ç",".c":"ċ",cC:"Ç","'C":"Ć","^C":"Ĉ",uC:"Č",".C":"Ċ","~N":"Ñ","~n":"ñ","=s":"š",vs:"š",DH:"Ð",dh:"ð",HO:"Ő",Ho:"ő",HU:"Ű",Hu:"ű","'Y":"Ý","'y":"ý","^Y":"Ŷ","^y":"ŷ",'"Y':"Ÿ",'"y':"ÿ",vS:"Š",vZ:"Ž",vz:"ž"},s={"#":"♯",b:"♭","=":"♮"},c={201:"♯",202:"♭",203:"♮",241:"¡",242:"¢",252:"a",262:"2",272:"o",302:"Â",312:"Ê",322:"Ò",332:"Ú",342:"â",352:"ê",362:"ò",372:"ú",243:"£",253:"«",263:"3",273:"»",303:"Ã",313:"Ë",323:"Ó",333:"Û",343:"ã",353:"ë",363:"ó",373:"û",244:"¤",254:"¬",264:" ́",274:"1⁄4",304:"Ä",314:"Ì",324:"Ô",334:"Ü",344:"ä",354:"ì",364:"ô",374:"ü",245:"¥",255:"-",265:"μ",275:"1⁄2",305:"Å",315:"Í",325:"Õ",335:"Ý",345:"å",355:"í",365:"õ",375:"ý",246:"¦",256:"®",266:"¶",276:"3⁄4",306:"Æ",316:"Î",326:"Ö",336:"Þ",346:"æ",356:"î",366:"ö",376:"þ",247:"§",257:" ̄",267:"·",277:"¿",307:"Ç",317:"Ï",327:"×",337:"ß",347:"ç",357:"ï",367:"÷",377:"ÿ",250:" ̈",260:"°",270:" ̧",300:"À",310:"È",320:"Ð",330:"Ø",340:"à",350:"è",360:"ð",370:"ø",251:"©",261:"±",271:"1",301:"Á",311:"É",321:"Ñ",331:"Ù",341:"á",351:"é",361:"ñ",371:"ù"};this.translateString=function(l){var h=l.split("\\");if(h.length===1)return l;var d=null;return h.forEach(function(p){if(d===null)d=p;else{var g=n[p.substring(0,2)];g!==void 0?d+=g+p.substring(2):(g=c[p.substring(0,3)],g!==void 0?d+=g+p.substring(3):(g=s[p.substring(0,1)],g!==void 0?d+=g+p.substring(1):d+="\\"+p))}}),d},this.getNumber=function(l,h){for(var d=0;h<l.length;)switch(l[h]){case"0":d=d*10,h++;break;case"1":d=d*10+1,h++;break;case"2":d=d*10+2,h++;break;case"3":d=d*10+3,h++;break;case"4":d=d*10+4,h++;break;case"5":d=d*10+5,h++;break;case"6":d=d*10+6,h++;break;case"7":d=d*10+7,h++;break;case"8":d=d*10+8,h++;break;case"9":d=d*10+9,h++;break;default:return{num:d,index:h}}return{num:d,index:h}},this.getFraction=function(l,h){var d=1,p=1;if(l[h]!=="/"){var g=this.getNumber(l,h);d=g.num,h=g.index}if(l[h]==="/")if(h++,l[h]==="/"){for(var v=.5;l[h++]==="/";)v=v/2;return{value:d*v,index:h-1}}else{var m=h,y=this.getNumber(l,h);y.num===0&&m===h&&(y.num=2),y.num!==0&&(p=y.num),h=y.index}return{value:d/p,index:h}};function o(l){const d=/^(\d+)\./.exec(l);return d?d[1]:null}var f=[{match:/,\s*The$/,replace:"The "},{match:/,\s*the$/,replace:"the "},{match:/,\s*A$/,replace:"A "},{match:/,\s*a$/,replace:"a "},{match:/,\s*An$/,replace:"An "},{match:/,\s*an$/,replace:"an "},{match:/,\s*Da$/,replace:"Da "},{match:/,\s*La$/,replace:"La "},{match:/,\s*Le$/,replace:"Le "},{match:/,\s*Les$/,replace:"Les "},{match:/,\s*Ye$/,replace:"Ye "}];this.theReverser=function(l){for(var h=0;h<f.length;h++){var d=f[h],p=l.match(d.match);if(p){var g=o(l);g&&(l=l.replace(g+".",""),l=l.trim());var v=p[0].length,m=d.replace+l.substring(0,l.length-v);return g&&(m=g+". "+m),m}}return l},this.stripComment=function(l){var h=l.indexOf("%");return h>=0?Ce.strip(l.substring(0,h)):Ce.strip(l)},this.getInt=function(l){var h=parseInt(l);if(isNaN(h))return{digits:0};var d=""+h,p=l.indexOf(d);return{value:h,digits:p+d.length}},this.getFloat=function(l){var h=parseFloat(l);if(isNaN(h))return{digits:0};var d=""+h,p=l.indexOf(d);return{value:h,digits:p+d.length}},this.getMeasurement=function(l){if(l.length===0)return{used:0};var h=1,d="";if(l[0].token==="-")l.shift(),d="-",h++;else if(l[0].type!=="number")return{used:0};if(d+=l.shift().token,l.length===0)return{used:1,value:parseInt(d)};var p=l.shift();if(p.token==="."){if(h++,l.length===0)return{used:h,value:parseInt(d)};if(l[0].type==="number"&&(p=l.shift(),d=d+"."+p.token,h++,l.length===0))return{used:h,value:parseFloat(d)};p=l.shift()}switch(p.token){case"pt":return{used:h+1,value:parseFloat(d)};case"px":return{used:h+1,value:parseFloat(d)};case"cm":return{used:h+1,value:parseFloat(d)/2.54*72};case"in":return{used:h+1,value:parseFloat(d)*72};default:return l.unshift(p),{used:h,value:parseFloat(d)}}};var u=function(l){return l=l.replace(/\\n/g,`
6
+ `),l=l.replace(/\\"/g,'"'),l};this.getBrackettedSubstring=function(l,h,d,p){for(var g=p||l[h],v=h+1,m=!1;v<l.length&&(m||l[v]!==g);)m=l[v]==="\\",++v;return l[v]===g?[v-h+1,u(l.substring(h+1,v)),!0]:(v=h+d,v>l.length-1&&(v=l.length-1),[v-h+1,u(l.substring(h+1,v)),!1])}};Wr.prototype.peekLine=function(){return this.lines[this.lineIndex]};Wr.prototype.nextLine=function(){if(this.lineIndex>0&&(this.multilineVars.iChar+=this.lines[this.lineIndex-1].length+1),this.lineIndex<this.lines.length){var e=this.lines[this.lineIndex];return this.lineIndex++,e}return null};var js=Wr;function Ks(e,t,r){if(!(!t||e.lines.length===0)){var a=e.deline({lineBreaks:!1}),i=Js(a,t);e.lines=Qs(a,i,r),e.lineBreaks=i}}function Qs(e,t,r){for(var a=[],i=[],n=[],s=1,c=0;c<t.length;c++){var o=t[c];if(e[o.ogLine].staff){var f=e[o.ogLine].staff[o.staff];if(a[o.line]||(a[o.line]={staff:[]}),!a[o.line].staff[o.staff]){a[o.line].staff[o.staff]={voices:[]},r!==void 0&&o.staff===0&&o.line>0&&(a[o.line].staff[o.staff].barNumber=s);for(var u=Object.keys(f),l=0;l<u.length;l++){var h=u[l]==="voices";u[l]==="meter"&&o.line!==0&&(h=!0),h||(a[o.line].staff[o.staff][u[l]]=f[u[l]])}i[o.staff]&&(a[o.line].staff[o.staff].key=i[o.staff])}a[o.line].staff[o.staff].voices[o.voice]||(a[o.line].staff[o.staff].voices[o.voice]=[]),a[o.line].staff[o.staff].voices[o.voice]=e[o.ogLine].staff[o.staff].voices[o.voice].slice(o.start,o.end+1),n[o.staff*10+o.voice]&&a[o.line].staff[o.staff].voices[o.voice].unshift({el_type:"stem",direction:n[o.staff*10+o.voice].direction});for(var d=a[o.line].staff[o.staff].voices[o.voice],p=d.length-1;p>=0;p--)if(d[p].el_type==="key"){i[o.staff]={root:d[p].root,acc:d[p].acc,mode:d[p].mode,accidentals:d[p].accidentals.filter(function(v){return v.acc!=="natural"})};break}for(p=d.length-1;p>=0;p--)if(d[p].el_type==="stem"){n[o.staff*10+o.voice]={direction:d[p].direction};break}if(r!==void 0&&o.staff===0&&o.voice===0)for(p=0;p<d.length;p++)d[p].el_type==="bar"&&(s++,p===d.length-1?delete d[p].barNumber:d[p].barNumber=s)}else a[o.line]=e[o.ogLine]}for(var g=0;g<a.length;g++)a[g].staff&&(a[g].staff=a[g].staff.filter(function(v){return v!=null}));return a}function Js(e,t){for(var r=[],a=0,i=0,n=0,s=0;s<e.length;s++){var c=e[s];if(c.staff){var o=i,f=t[a];a++;for(var u=0;u<c.staff.length;u++)for(var l=c.staff[u],h=0;h<l.voices.length;h++){n=o;for(var d=0,p=0,g=l.voices[h],v=0,m=0;m<g.length;m++){var y=g[m];y.el_type==="bar"&&(f[p]===d&&(r.push({ogLine:s,line:n,staff:u,voice:h,start:v,end:m}),v=m+1,n++,i=Math.max(i,n),p++),d++)}r.push({ogLine:s,line:n,staff:u,voice:h,start:v,end:g.length}),n++,i=Math.max(i,n)}}else r.push({ogLine:s,line:n}),n++,i=Math.max(i,n)}return r}function Zs(e,t){for(var r=[],a=[],i=0,n=0;n<e.length;n++){var s=e[n],c=i+s;if(c<t)i=c;else{var o=t-i,f=c-t;o<f&&i>0?(r.push(n-1),a.push(Math.round(i-s)),i=s):n<e.length-1&&(r.push(n),a.push(Math.round(i)),i=0)}}return a.push(Math.round(i)),{lineBreaks:r,totals:a}}function D0(e){for(var t=[],r=0;r<e.length;r++)t.push(e[r]);return t}function ec(e,t,r,a,i,n,s,c,o,f,u){for(var l=f;l<e.length;l++){var h=e[l];r+=h,a+=h;var d=Math.abs(r-t[c]),p=Math.abs(d-n)<t[0]/10;if(p)if(d<n){var g=D0(i),v=D0(o);v.push(l-1),g.push(a-h),u.push({accumulator:r,lineAccumulator:h,lineWidths:g,lastVariance:Math.abs(r-t[c+1]),highestVariance:Math.max(s,n),currLine:c+1,lineBreaks:v,startIndex:l+1})}else d>n&&l<e.length-1&&(g=D0(i),v=D0(o),u.push({accumulator:r,lineAccumulator:a,lineWidths:g,lastVariance:d,highestVariance:Math.max(s,d),currLine:c,lineBreaks:v,startIndex:l+1}));d>n?(o.push(l-1),c++,s=Math.max(s,n),n=Math.abs(r-t[c]),i.push(a-h),a=h):n=d}i.push(a)}function tc(e,t,r,a){for(var i=Math.ceil(e.total/t),n=Math.floor(e.total/i),s=[],c=0;c<i;c++)s.push(n*(c+1));var o=[];o.push({accumulator:0,lineAccumulator:0,lineWidths:[],lastVariance:999999,highestVariance:0,currLine:0,lineBreaks:[],startIndex:0});for(var f=0;f<o.length;)ec(e.measureWidths,s,o[f].accumulator,o[f].lineAccumulator,o[f].lineWidths,o[f].lastVariance,o[f].highestVariance,o[f].currLine,o[f].lineBreaks,o[f].startIndex,o),f++;for(c=0;c<o.length;c++){var u=o[c];u.variances=[],u.aveVariance=0;for(var l=0;l<u.lineWidths.length;l++){var h=u.lineWidths[l];u.variances.push(h-s[0]),u.aveVariance+=Math.abs(h-s[0])}u.aveVariance=u.aveVariance/u.lineWidths.length,a.attempts.push({type:"optimizeLineWidths",lineBreaks:u.lineBreaks,variances:u.variances,aveVariance:u.aveVariance,widths:e.measureWidths})}var d=9999999,p=-1;for(c=0;c<o.length;c++)u=o[c],u.aveVariance<d&&(d=u.aveVariance,p=c);return{failed:!1,lineBreaks:o[p].lineBreaks,variance:o[p].highestVariance}}function rc(e,t,r){for(var a=[],i=[],n=0,s=!1,c=0;c<e.length;c++)n+=e[c],n>t&&(s=!0),c%r===r-1&&(c!==e.length-1&&a.push(c),i.push(Math.round(n)),n=0);return{failed:s,totals:i,lineBreaks:a}}function ac(e,t,r){var a={lineBreaks:e,staffwidth:t};for(var i in r)r.hasOwnProperty(i)&&i!=="wrap"&&i!=="staffwidth"&&(a[i]=r[i]);return{revisedParams:a}}function ic(e,t,r){if(t.length===0||r.staffwidth<t[0].left)return{reParse:!1,explanation:"Staff width is narrower than the margin",revisedParams:r};var a=r.scale?Math.max(r.scale,.1):1,i=r.wrap.minSpacing?Math.max(parseFloat(r.wrap.minSpacing),1):1,n=r.wrap.minSpacingLimit?Math.max(parseFloat(r.wrap.minSpacingLimit),1):i-.1,s=r.wrap.maxSpacing?Math.max(parseFloat(r.wrap.maxSpacing),1):void 0;r.wrap.lastLineLimit&&!s&&(s=Math.max(parseFloat(r.wrap.lastLineLimit),1));for(var c=r.wrap.preferredMeasuresPerLine?Math.max(parseInt(r.wrap.preferredMeasuresPerLine,10),0):void 0,o=[],f=[],u=0;u<t.length;u++){var l=t[u],h=r.staffwidth-l.left,d=h/i/a,p=h/s/a,g=h/n/a,v={widths:l,lineBreakPoint:d,minLineSize:p,attempts:[],staffWidth:r.staffwidth,minWidth:Math.round(g)},m=null;if(c){var y=rc(l.measureWidths,d,c);v.attempts.push({type:"Fixed Measures Per Line",preferredMeasuresPerLine:c,lineBreaks:y.lineBreaks,failed:y.failed,totals:y.totals}),y.failed||(m=y.lineBreaks)}if(!m){var x=Zs(l.measureWidths,d);v.attempts.push({type:"Free Form",lineBreaks:x.lineBreaks,totals:x.totals}),m=x.lineBreaks,m.length>0&&l.measureWidths.length<25&&(x=tc(l,d,m,v),v.attempts.push({type:"Optimize",failed:x.failed,reason:x.reason,lineBreaks:x.lineBreaks,totals:x.totals}),x.failed||(m=x.lineBreaks))}o.push(m),f.push(v)}var b=r.staffwidth,w=ac(o,b,r);return w.explanation=f,w.reParse=!0,w}var Vi={wrapLines:Ks,calcLineWraps:ic};function nc(e){const t=e.getMeterFraction(),r=t.num===4&&t.den===4;if(!(t.num===2&&t.den===2)&&!r)throw new Error("notCommonTime");const i=e.deline();let n=[],s=!1;return i.forEach(c=>{if(c.subtitle)s&&n.push({type:"subtitle",subtitle:c.subtitle.text});else if(c.text)s=!0,n.push({type:"text",text:c.text.text});else if(c.staff){s=!0;const o=c.staff,f=sc(o);n=n.concat(f)}}),oc(n),lc(n),hc(n),n}const Aa=["break","(break)","no chord","n.c.","tacet"];function sc(e){const t=[];let r="",a=[],i={chord:["","","",""]},n="",s="";if(e.forEach((c,o)=>{c.voices&&c.voices.forEach((f,u)=>{let l=0,h=0;f.forEach(d=>{if(d.el_type==="part")a.length>0&&o===0&&u===0&&(t.push({type:"part",name:r,lines:[a]}),a=[]),r=d.title;else if(d.el_type==="note"){Ba(d,i);const p=Math.floor(l);if(d.chord&&d.chord.length>0){const g=d.chord[0],v=g.position==="default"||Aa.indexOf(g.name.toLowerCase())>=0?g.name:"";v&&(p>0&&!i.chord[0]&&(i.chord[0]=n),n=v,i.chord[p]?p<4&&!i.chord[p+1]&&(i.chord[p+1]=v):i.chord[p]=v),d.chord.forEach(m=>{m.position!=="default"&&Aa.indexOf(g.name.toLowerCase())<0&&(i.annotations||(i.annotations=[]),i.annotations.push(m.name))})}if(!d.rest||d.rest.type!=="spacer"){const g=d.duration===0&&!d.rest?.25:d.duration,v=Math.floor(g*4);if(v>4)h+=Math.floor(v/4),l=0;else{let m=g*4;d.tripletMultiplier&&(m*=d.tripletMultiplier),l+=m}}}else if(d.el_type==="bar"){if(s&&(i.ending=s,s=""),Ba(d,i),d.chord&&d.chord.forEach(p=>{p.position!=="default"&&(i.annotations||(i.annotations=[]),i.annotations.push(p.name))}),(d.type==="bar_dbl_repeat"||d.type==="bar_left_repeat")&&(i.hasStartRepeat=!0),(d.type==="bar_dbl_repeat"||d.type==="bar_right_repeat")&&(i.hasEndRepeat=!0),d.startEnding&&(s=d.startEnding),l>=4){if(i.chord[0]===""&&(i.chord[1]||i.chord[2]||i.chord[3])&&(i.chord[0]=cc(a)),o===0&&u===0)a.push(i);else{let p=h,g=0;for(;p>=t[g].lines[0].length&&g<t.length;)p-=t[g].lines[0].length,g++;if(g<t.length&&p<t[g].lines[0].length){const v=t[g].lines[0][p];!v.chord[0]&&i.chord[0]&&(v.chord[0]=i.chord[0]),!v.chord[1]&&i.chord[1]&&(v.chord[1]=i.chord[1]),!v.chord[2]&&i.chord[2]&&(v.chord[2]=i.chord[2]),!v.chord[3]&&i.chord[3]&&(v.chord[3]=i.chord[3]),i.annotations&&(v.annotations?v.annotations=v.annotations.concat(i.annotations):v.annotations=i.annotations)}h++}i={chord:["","","",""]}}else i.chord=["","","",""];l=0}else d.el_type}),o===0&&u===0&&t.push({type:"part",name:r,lines:[a]})})}),!n)throw new Error("noChords");return t}function cc(e){for(let t=e.length-1;t>=0;t--)for(let r=e[t].chord.length-1;r>=0;r--)if(e[t].chord[r])return e[t].chord[r]}function oc(e){e.forEach(t=>{if(t.type==="part"){const r=t.lines[0],a=r.findIndex(n=>!!n.ending),i=r.findIndex((n,s)=>s>a&&!!n.ending);if(a>=0&&i>=0&&i-a===r.length-i){let n=!0;for(let s=0;s<i-a&&n;s++){const c=r[a+s],o=r[i+s];if(c.chord[0]!==o.chord[0]&&(n=!1),c.chord[1]!==o.chord[1]&&(n=!1),c.chord[2]!==o.chord[2]&&(n=!1),c.chord[3]!==o.chord[3]&&(n=!1),c.annotations&&!o.annotations&&(n=!1),!c.annotations&&o.annotations&&(n=!1),c.annotations&&o.annotations)if(c.annotations.length!==o.annotations.length)n=!1;else for(let f=0;f<c.annotations.length;f++)c.annotations[f]!==o.annotations[f]&&(n=!1)}n&&(delete r[a].ending,r.splice(i,r.length-i))}}})}function lc(e){e.forEach(t=>{if(t.type==="part"){const r=[],a=t.lines[0];let i=!1;const n=a.findIndex(o=>!!o.hasEndRepeat);(n>=0?Math.min(n+1,a.length):a.length)===12&&(i=!0);const c=i?4:8;for(let o=0;o<a.length;o+=c){const f=a.slice(o,o+c),u=f.findIndex(l=>!!l.hasEndRepeat);u>=0&&u<f.length-1?(r.push(f.slice(0,u+1)),r.push(f.slice(u+1))):r.push(f)}for(let o=0;o<r.length;o++)if(r[o][0].ending){const f=Math.max(0,o-1),u=r[f].length-r[o].length,l=[];for(let h=0;h<u;h++)l.push({noBorder:!0,chord:["","","",""]});r[o]=l.concat(r[o])}t.lines=r}})}function hc(e){e.forEach(t=>{if(t.lines){let r=!1,a="";t.lines.forEach(i=>{i.forEach(n=>{if(!n.noBorder){const s=n.chord;!s[0]&&!s[1]&&!s[2]&&!s[3]?(r?a&&(s[0]="%"):s[0]=a,r=!0):!s[1]&&!s[2]&&!s[3]?(r=!0,a=s[0]):(r=!1,a=s[3]||s[2]||s[1])}})})}})}function Ba(e,t){if(e.decoration)for(let r=0;r<e.decoration.length;r++)switch(e.decoration[r]){case"fermata":case"segno":case"coda":case"D.C.":case"D.S.":case"D.C.alcoda":case"D.C.alfine":case"D.S.alcoda":case"D.S.alfine":case"fine":t.annotations||(t.annotations=[]),t.annotations.push(e.decoration[r]);break}}var fc=nc,ht={};ht.FONTEM=360;ht.FONTSIZE=30;ht.STEP=ht.FONTSIZE*93/720;ht.SPACE=10;ht.TOPNOTE=15;ht.STAVEHEIGHT=100;ht.INDENT=50;var Se=ht;const uc=rt;function dc(e){this.sections=[{type:"startRepeat",index:-1}],this.addBar=function(t){var r=e.length-1,a=t.type==="bar_left_repeat"||t.type==="bar_dbl_repeat",i=t.type==="bar_right_repeat"||t.type==="bar_dbl_repeat",n=t.startEnding?gc(t.startEnding):void 0;i&&(this.sections.length>0&&this.sections[this.sections.length-1].type==="endRepeat"&&this.sections.push({type:"startRepeat",index:this.sections[this.sections.length-1].index}),this.sections.push({type:"endRepeat",index:r})),a&&this.sections.push({type:"startRepeat",index:r}),n&&this.sections.push({type:"startEnding",index:r,endings:n})},this.resolveRepeats=function(){var t,r=this.sections[this.sections.length-1],a=e.length-1;if(r.type==="startRepeat"?r.end=a:r.index+1<a&&this.sections.push({type:"startRepeat",index:r.index+1}),this.sections.length<2)return e;for(var i=[],n=null,s=0;s<this.sections.length;s++){var c=this.sections[s];switch(c.type){case"startRepeat":if(n){if(n.common.end||(n.common.end=c.index),n.endings)for(t=0;t<n.endings.length;t++)n.endings[t]&&!n.endings[t].end&&n.endings[t].start!==c.index&&(n.endings[t].end=c.index);this.sections[s-1].type==="endRepeat"&&n.endings&&n.endings.length&&(n.endings[n.endings.length]={start:-1,end:-1}),i.push(n)}if(n){var o=n.common.end;if(n.endings)for(t=0;t<n.endings.length;t++)n.endings[t]&&(o=Math.max(o,n.endings[t].end));o<c.index-1&&i.push({common:{start:o+1,end:c.index}})}n={common:{start:c.index}};break;case"startEnding":{if(n)for(n.common.end||(n.common.end=c.index),n.endings||(n.endings=[]),t=0;t<c.endings.length;t++)n.endings[c.endings[t]]={start:c.index+1};break}case"endRepeat":if(n){if(n.endings||(n.endings=[]),n.endings.length>0)for(t=0;t<n.endings.length;t++)n.endings[t]&&!n.endings[t].end&&(n.endings[t].end=c.index);n.common.end||(n.common.end=c.index)}break}}if(n){if(n.common.end||(n.common.end=a),n.endings)for(t=0;t<n.endings.length;t++)n.endings[t]&&!n.endings[t].end&&(n.endings[t].end=a);i.push(n)}for(var f=[],u=-1,l=0;l<i.length;l++){var h=i[l];if(!h.endings)c0(e,f,h.common.start,h.common.end);else if(h.endings.length===0)c0(e,f,h.common.start,h.common.end),c0(e,f,h.common.start,h.common.end);else for(t=0;t<h.endings.length;t++){var d=h.endings[t];d&&(c0(e,f,h.common.start,h.common.end),d.start>0&&c0(e,f,d.start,d.end),u=Math.max(u,d.end))}}return f}}function c0(e,t,r,a){r<0&&(r=0),t.length>0&&e[r].el_type==="bar"&&t[t.length-1].el_type==="bar"&&r++;for(var i=r;i<=a;i++){var n,s=!1;if(e[i].el_type==="key"||e[i].el_type==="meter"||e[i].el_type==="tempo"||e[i].el_type==="instrument"){for(n=t.length-1;n>=0&&t[n].el_type!==e[i].el_type;)n--;n>=0&&(e[i].el_type==="key"&&vc(e[i],t[n])||e[i].el_type==="meter"&&e[i].num===t[n].num&&e[i].den===t[n].den||e[i].el_type==="instrument"&&e[i].program===t[n].program||e[i].el_type==="tempo"&&e[i].qpm===t[n].qpm)&&(s=!0)}s||t.push(pc(e[i]))}}function pc(e){var t=Object.assign({},e);return t.pitches&&(t.pitches=uc.cloneArray(t.pitches)),t}function vc(e,t){return!e.accidentals||!t.accidentals?!1:JSON.stringify(e.accidentals)===JSON.stringify(t.accidentals)}function gc(e){var t=[],r,a,i;if(e.indexOf(",")>0)for(a=e.split(","),i=0;i<a.length;i++)r=parseInt(a[i],10),r>0&&t.push(r);else if(e.indexOf("-")>0){a=e.split("-");var n=parseInt(a[0],10),s=parseInt(a[1],10);for(i=n;i<=s;i++)t.push(i)}else r=parseInt(e,10),r>0&&t.push(r);return t}var bc=dc,ji,ur=rt,mc=bc;(function(){var e=1,t=128;ji=function(d,p){p=p||{};var g,v=p.program||0,m=p.midiTranspose||0;d.visualTranspose&&(m-=d.visualTranspose);var y=p.channel||0,x=!1,b=p.drum||"",w=p.drumBars||1,C=p.drumIntro||0,T=b!=="",B=!!p.drumOff,E=[],z=50;v=parseInt(v,10),m=parseInt(m,10),y=parseInt(y,10),y===10&&(v=t),b=b.split(" "),w=parseInt(w,10),C=parseInt(C,10);var I=d.formatting.bagpipes;I&&(v=71);var F=[];if(d.formatting.midi){var G=d.formatting.midi;G.program&&G.program.length>0&&(v=G.program[0],G.program.length>1&&(v=G.program[1],y=G.program[0]),x=!0),G.transpose&&(m=G.transpose[0]),G.channel&&(y=G.channel[0],x=!0),G.drum&&(b=G.drum),G.drumbars&&(w=G.drumbars[0]),G.drumon&&(T=!0),y===10&&(v=t),G.beat&&F.push({el_type:"beat",beats:G.beat}),G.nobeataccents&&F.push({el_type:"beataccents",value:!1})}p.qpm?g=parseInt(p.qpm,10):d.metaText.tempo?g=c(d.metaText.tempo,d.getBeatLength()):p.defaultQpm?g=p.defaultQpm:g=180;var Y=[];I&&Y.push({el_type:"bagpipes"}),Y.push({el_type:"instrument",program:v}),y&&Y.push({el_type:"channel",channel:y}),m&&Y.push({el_type:"transpose",transpose:m}),Y.push({el_type:"tempo",qpm:g});for(var K=0;K<F.length;K++)Y.push(F[K]);var P=[],k=[],_=[],L=[],A=[0],R={};R[0]={el_type:"tempo",qpm:g,timing:0};for(var V,Q=[],le=!1,Qe=d.lines,Ye=0;Ye<Qe.length;Ye++){var Me=Qe[Ye];if(Me.staff){let se=function(U){var ne={pppp:[15,10,5,1],ppp:[30,20,10,1],pp:[45,35,20,1],p:[60,50,35,1],mp:[75,65,50,1],mf:[90,80,65,1],f:[105,95,80,1],ff:[120,110,95,1],fff:[127,125,110,1],ffff:[127,125,110,1]},he;if(U.decoration){if(U.decoration.indexOf("pppp")>=0?he="pppp":U.decoration.indexOf("ppp")>=0?he="ppp":U.decoration.indexOf("pp")>=0?he="pp":U.decoration.indexOf("p")>=0?he="p":U.decoration.indexOf("mp")>=0?he="mp":U.decoration.indexOf("mf")>=0?he="mf":U.decoration.indexOf("f")>=0?he="f":U.decoration.indexOf("ff")>=0?he="ff":U.decoration.indexOf("fff")>=0?he="fff":U.decoration.indexOf("ffff")>=0&&(he="ffff"),he){V=ne[he].slice(0);let st=[V];Array.isArray(U.decoration)&&(st=[],U.decoration.forEach(kt=>{kt in ne&&st.push(ne[kt].slice(0))})),P[q].push({el_type:"beat",beats:V.slice(0),volumesPerNotePitch:st}),_[Z]=!1,L[Z]=!1}if(U.decoration.indexOf("crescendo(")>=0){var ae=r(ge,O,"crescendo)"),Fe=Math.min(127,V[0]+z),Ft=a(ge,O+ae+1,Object.keys(ne));Ft&&(Fe=ne[Ft][0]),ae>0?_[Z]=Math.floor((Fe-V[0])/ae):_[Z]=!1,L[Z]=!1}else if(U.decoration.indexOf("crescendo)")>=0)_[Z]=!1;else if(U.decoration.indexOf("diminuendo(")>=0){var ye=r(ge,O,"diminuendo)"),Be=Math.max(15,V[0]-z),Ct=a(ge,O+ye+1,Object.keys(ne));Ct&&(Be=ne[Ct][0]),_[Z]=!1,ye>0?L[Z]=Math.floor((Be-V[0])/ye):L[Z]=!1}else U.decoration.indexOf("diminuendo)")>=0&&(L[Z]=!1)}};for(var me=Me.staff,q=0,Ie=0;Ie<me.length;Ie++){var te=me[Ie];if(!(te.clef&&te.clef.type==="TAB"))for(var Z=0;Z<te.voices.length;Z++){var ge=te.voices[Z];if(!P[q]){P[q]=[].concat(JSON.parse(JSON.stringify(Y)));var ce=s(Me.staff,q);ce&&P[q].unshift({el_type:"name",trackName:ce}),Q[q]=new mc(P[q])}if(m&&te.clef.type==="perc"&&P[q].push({el_type:"transpose",transpose:0}),te.clef&&te.clef.type==="perc"&&!x)for(var Ae=0;Ae<P[q].length;Ae++)P[q][Ae].el_type==="instrument"&&(P[q][Ae].program=t);else te.key&&u(P[q],te.key);te.meter&&l(P[q],te.meter),!le&&T&&(P[q].push({el_type:"drum",params:{pattern:b,bars:w,on:T,intro:C}}),le=!0),te.clef&&te.clef.type!=="perc"&&te.clef.transpose&&(te.clef.el_type="clef",P[q].push({el_type:"transpose",transpose:te.clef.transpose}),k[q]=!1),te.clef&&te.clef.type&&(te.clef.type.indexOf("-8")>=0?(P[q].push({el_type:"transpose",transpose:-12}),k[q]=!0):te.clef.type.indexOf("+8")>=0?(P[q].push({el_type:"transpose",transpose:12}),k[q]=!0):k[q]&&(P[q].push({el_type:"transpose",transpose:0}),k[q]=!1)),d.formatting.midi&&d.formatting.midi.drumoff&&(P[q].push({el_type:"bar"}),P[q].push({el_type:"drum",params:{pattern:"",on:!1}}));var ke=0,_e=0,xt=0,M=0;V=[105,95,85,1];for(var O=0;O<ge.length;O++){var N=ge[O];switch(N.el_type){case"note":if(_[Z]&&(V[0]+=_[Z],V[1]+=_[Z],V[2]+=_[Z],P[q].push({el_type:"beat",beats:V.slice(0)})),L[Z]&&(V[0]+=L[Z],V[1]+=L[Z],V[2]+=L[Z],P[q].push({el_type:"beat",beats:V.slice(0)})),se(N),!N.rest||N.rest.type!=="spacer"){var D={elem:N,el_type:"note",timing:A[q]};if(N.style?D.style=N.style:E[q]&&(D.style=E[q]),D.duration=N.duration===0?.25:N.duration,N.startTriplet){if(_e=N.tripletMultiplier,xt=N.startTriplet*_e*N.duration,N.startTriplet!==N.tripletR&&O+N.tripletR<=ge.length){for(var $=0,W=O;W<O+N.tripletR;W++)$+=ge[W].duration;xt=_e*$}D.duration=D.duration*_e,D.duration=Math.round(D.duration*1e6)/1e6,M=D.duration}else _e&&(N.endTriplet?(_e=0,D.duration=Math.round((xt-M)*1e6)/1e6):(D.duration=D.duration*_e,D.duration=Math.round(D.duration*1e6)/1e6,M+=D.duration));N.rest&&(D.rest=N.rest),N.decoration&&(D.decoration=N.decoration.slice(0)),N.pitches&&(D.pitches=ur.cloneArray(N.pitches)),N.gracenotes&&(D.gracenotes=ur.cloneArray(N.gracenotes)),N.chord&&(D.chord=ur.cloneArray(N.chord)),P[q].push(D),N.style==="rhythm"&&n(P),ke++,A[q]+=D.duration}break;case"key":case"keySignature":u(P[q],N);break;case"meter":l(P[q],N);break;case"clef":N.transpose&&P[q].push({el_type:"transpose",transpose:N.transpose}),N.type&&(N.type.indexOf("-8")>=0?P[q].push({el_type:"transpose",transpose:-12}):N.type.indexOf("+8")>=0&&P[q].push({el_type:"transpose",transpose:12}));break;case"tempo":g=c(N,d.getBeatLength()),P[q].push({el_type:"tempo",qpm:g,timing:A[q]}),R[""+A[q]]={el_type:"tempo",qpm:g,timing:A[q]};break;case"bar":ke>0&&P[q].push({el_type:"bar"}),se(N),ke=0,Q[q].addBar(N,q);break;case"style":E[q]=N.head;break;case"timeSignature":P[q].push(o(N));break;case"part":break;case"stem":case"scale":case"break":case"font":break;case"midi":var J=!1;switch(N.cmd){case"drumon":T=!0,J=!0;break;case"drumoff":T=!1,J=!0;break;case"drum":b=N.params,J=!0;break;case"drumbars":w=N.params[0],J=!0;break;case"drummap":break;case"channel":N.params[0]===10&&P[q].push({el_type:"instrument",program:t});break;case"program":h(P[q],{el_type:"instrument",program:N.params[0]}),x=!0;break;case"transpose":P[q].push({el_type:"transpose",transpose:N.params[0]});break;case"gchordoff":P[q].push({el_type:"gchordOn",tacet:!0});break;case"gchordon":P[q].push({el_type:"gchordOn",tacet:!1});break;case"beat":P[q].push({el_type:"beat",beats:N.params});break;case"nobeataccents":P[q].push({el_type:"beataccents",value:!1});break;case"beataccents":P[q].push({el_type:"beataccents",value:!0});break;case"vol":case"volinc":P[q].push({el_type:N.cmd,volume:N.params[0]});break;case"swing":case"gchord":case"bassvol":case"chordvol":P[q].push({el_type:N.cmd,param:N.params[0]});break;case"bassprog":case"chordprog":P[q].push({el_type:N.cmd,value:N.params[0],octaveShift:N.params[1]});break;case"gchordbars":P[q].push({el_type:N.cmd,param:N.params[0]});break;default:console.log("MIDI seq: midi cmd not handled: ",N.cmd,N)}J&&(P[0].push({el_type:"drum",params:{pattern:b,bars:w,intro:C,on:T}}),le=!0);break;default:console.log("MIDI: element type "+N.el_type+" not handled.")}}q++,A[q]||(A[q]=0)}}}}for(var ee=0;ee<Q.length;ee++)P[ee]=Q[ee].resolveRepeats();if(i(P,R),C)for(var j=d.getPickupLength(),X=0;X<P.length;X++){for(var re=0;P[X][re].el_type!=="note"&&P[X].length>re;)re++;if(P[X].length>re){for(var W=0;W<C;W++)j===0||W<C-1?(P[X].splice(re,0,{el_type:"note",rest:{type:"rest"},duration:e},{el_type:"bar"}),re+=2):P[X].splice(re++,0,{el_type:"note",rest:{type:"rest"},duration:e-j});B&&(T=!1,P[X].splice(re++,0,{el_type:"drum",params:{pattern:b,bars:w,intro:C,on:T}}),B=!1)}}return P.length>0&&P[0].length>0&&(P[0][0].pickupLength=d.getPickupLength()),P};function r(d,p,g){for(var v=0,m=p+1;m<d.length;m++)if(d[m].el_type==="note"&&v++,d[m].decoration&&d[m].decoration.indexOf(g)>=0)return v;return v}function a(d,p,g){for(var v=Math.min(d.length,p+3),m=p;m<v;m++)if(d[m].el_type==="note"&&d[m].decoration){for(var y=0;y<d[m].decoration.length;y++)if(g.indexOf(d[m].decoration[y])>=0)return d[m].decoration[y]}return null}function i(d,p){if(!(!p||p.length===0))for(var g=Object.keys(p),v=0;v<d.length;v++)for(var m=d[v],y=p[0]?p[0].qpm:0,x=0;x<m.length;x++){var b=m[x];b.el_type==="tempo"&&(y=b.qpm),g.indexOf(""+b.timing)>=0&&y!==p[""+b.timing].qpm&&(y=p[""+b.timing].qpm,b.el_type==="tempo"?(b.qpm=p[""+b.timing].qpm,x++):(d[v].splice(x,0,{el_type:"tempo",qpm:p[""+b.timing].qpm,timing:b.timing}),x+=2))}}function n(d){for(var p=0;p<d.length;p++)for(var g=d[p],v=g.length-1;v>=0&&g[v].el_type!=="bar";)g[v].noChordVoice=!0,v--}function s(d,p){if(!(!d||d.length<=p||!d[p].title))return d[p].title.join(" ")}function c(d,p){var g=.25;d.duration&&(g=d.duration[0]);var v=60;return d.bpm&&(v=d.bpm),g*v/p}function o(d){var p;switch(d.type){case"common_time":p={el_type:"meter",num:4,den:4},e=4/4;break;case"cut_time":p={el_type:"meter",num:2,den:2},e=2/2;break;case"specified":let m=0;if(d.value&&d.value.length>0&&d.value[0].num.indexOf("+")>0)for(var g=d.value[0].num.split("+"),v=0;v<g.length;v++)m+=parseInt(g[v],10);else m=parseInt(d.value[0].num,10);p={el_type:"meter",num:m,den:d.value[0].den},e=m/parseInt(d.value[0].den,10);break;default:p={el_type:"meter"},e=1}return p}function f(d){for(var p=[],g=0;g<d.length;g++)d[g].acc!=="natural"&&p.push(d[g]);return p}function u(d,p){var g;p.root==="HP"?g={el_type:"key",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}]}:g={el_type:"key",accidentals:f(p.accidentals)},h(d,g)}function l(d,p){var g=o(p);h(d,g)}function h(d,p){for(var g=d.length-1;g>=0;g--)if(d[g].el_type===p.el_type){JSON.stringify(d[g])!==JSON.stringify(p)&&d.push(p);return}d.push(p)}})();var Ki=ji,ue=function(t,r,a,i){this.chordTrack=[],this.chordTrackFinished=!1,this.chordChannel=t,this.currentChords=[],this.lastChord,this.chordLastBar,this.chordsOff=!!r,this.gChordTacet=this.chordsOff,this.hasRhythmHead=!1,this.transpose=0,this.lastBarTime=0,this.meter=i,this.tempoChangeFactor=1,this.bassInstrument=a.bassprog&&a.bassprog.length>=1?a.bassprog[0]:0,this.chordInstrument=a.chordprog&&a.chordprog.length>=1?a.chordprog[0]:0,this.bassOctaveShift=a.bassprog&&a.bassprog.length===2?a.bassprog[1]:0,this.chordOctaveShift=a.chordprog&&a.chordprog.length===2?a.chordprog[1]:0,this.boomVolume=a.bassvol&&a.bassvol.length===1?a.bassvol[0]:64,this.chickVolume=a.chordvol&&a.chordvol.length===1?a.chordvol[0]:48,a.gchord&&a.gchord.length>0?this.overridePattern=Qi(a.gchord[0]):this.overridePattern=void 0};ue.prototype.setMeter=function(e){this.meter=e};ue.prototype.setTempoChangeFactor=function(e){this.tempoChangeFactor=e};ue.prototype.setLastBarTime=function(e){this.lastBarTime=e};ue.prototype.setTranspose=function(e){this.transpose=e};ue.prototype.setRhythmHead=function(e,t){this.hasRhythmHead=e;var r=[];if(e&&this.lastChord&&this.lastChord.chick)for(var a=0;a<this.lastChord.chick.length;a++){var i=Object.assign({},t.pitches[0]);i.actualPitch=this.lastChord.chick[a],r.push(i)}return r};ue.prototype.barEnd=function(e){this.chordTrack.length>0&&!this.chordTrackFinished&&(this.resolveChords(this.lastBarTime,Br(e.time)),this.currentChords=[]),this.chordLastBar=this.lastChord};ue.prototype.gChordOn=function(e){this.chordsOff||(this.gChordTacet=e.tacet)};ue.prototype.paramChange=function(e){switch(e.el_type){case"gchord":e.param&&e.param.length>0?this.overridePattern=Qi(e.param):this.overridePattern=void 0;break;case"bassprog":this.bassInstrument=e.value,e.octaveShift!=null&&e.octaveShift!=null?this.bassOctaveShift=e.octaveShift:this.bassOctaveShift=0;break;case"chordprog":this.chordInstrument=e.value,e.octaveShift!=null&&e.octaveShift!=null?this.chordOctaveShift=e.octaveShift:this.chordOctaveShift=0;break;case"bassvol":this.boomVolume=e.param;break;case"chordvol":this.chickVolume=e.param;break;default:console.log("unhandled midi param",e)}};ue.prototype.finish=function(){this.chordTrackEmpty()||(this.chordTrackFinished=!0)};ue.prototype.addTrack=function(e){this.chordTrackEmpty()||e.push(this.chordTrack)};ue.prototype.findChord=function(e){if(this.gChordTacet)return"break";if(this.chordTrackFinished||!e.chord||e.chord.length===0)return null;for(var t=0;t<e.chord.length;t++){var r=e.chord[t];if(r.position==="default")return r.name;if(this.breakSynonyms.indexOf(r.name.toLowerCase())>=0)return"break"}return null};ue.prototype.interpretChord=function(e){if(e.length!==0){if(e==="break")return{chick:[]};var t=e.substring(0,1);if(t==="("){if(e=e.substring(1,e.length-1),e.length===0)return;t=e.substring(0,1)}var r=this.basses[t];if(r){for(var a=this.transpose;a<-8;)a+=12;for(;a>8;)a-=12;r+=a,r<33?r+=12:r>44&&(r-=12);var i=r;r+=this.bassOctaveShift*12;var n=r-5,s;e.length===1&&(s=this.chordNotes(r,""));var c=e.substring(1),o=c.substring(0,1);o==="b"||o==="♭"?(i--,r--,n--,c=c.substring(1)):(o==="#"||o==="♯")&&(i++,r++,n++,c=c.substring(1));var f=c.split("/");if(s=this.chordNotes(i,f[0]),s.length>=3){var u=s[2]-s[0];n=n+u-7}if(f.length===2){var l=this.basses[f[1].substring(0,1)];if(l){var h=f[1].substring(1),d={"#":1,"♯":1,b:-1,"♭":-1}[h]||0;r=this.basses[f[1].substring(0,1)]+d+a,r+=this.bassOctaveShift*12,n=r}}return{boom:r,boom2:n,chick:s}}}};ue.prototype.chordNotes=function(e,t){var r=this.chordIntervals[t];r||(t.slice(0,2).toLowerCase()==="ma"||t[0]==="M"?r=this.chordIntervals.M:t[0]==="m"||t[0]==="-"?r=this.chordIntervals.m:r=this.chordIntervals.M),e+=12,e+=this.chordOctaveShift*12;for(var a=[],i=0;i<r.length;i++)a.push(e+r[i]);return a};ue.prototype.writeNote=function(e,t,r,a,i,n){e!==void 0&&this.chordTrack.push({cmd:"note",pitch:e,volume:r,start:this.lastBarTime+a*Na(t,this.tempoChangeFactor),duration:Na(i,this.tempoChangeFactor),gap:0,instrument:n})};ue.prototype.chordTrackEmpty=function(){for(var e=!0,t=0;t<this.chordTrack.length&&e;t++)this.chordTrack[t].cmd==="note"&&(e=!1);return e};ue.prototype.resolveChords=function(e,t){if(!this.hasRhythmHead){var r=this.meter.num,a=this.meter.den,i=1/a,n=i/2,s=parseInt(r,10)/parseInt(a,10),c=s-(t-e)/this.tempoChangeFactor;Math.abs(c)<1e-5&&(c=0),(this.currentChords.length===0||this.currentChords[0].beat!==0)&&this.currentChords.unshift({beat:0,chord:this.chordLastBar});var o=wc(this.currentChords,8*r/a),f=this.overridePattern?this.overridePattern:this.rhythmPatterns[r+"/"+a];if(c){f=[];for(var u=(t-e)/this.tempoChangeFactor*8,l=0;l<u/2;l+=2)f.push("chick"),f.push("")}if(!f){f=[];for(var l=0;l<8*r/a/2;l++)f.push("chick"),f.push("")}for(var h=!0,d=Math.min(f.length,o.length),l=0;l<d;l++){l>0&&o[l-1]&&o[l]&&o[l-1].boom!==o[l].boom&&(h=!0);var p=f[l],g=p.indexOf("boom")>=0,v=!g&&l!==0&&f[0].indexOf("boom")>=0&&(!o[l-1]||o[l-1].boom!==o[l].boom),m=yc(o[l],p,h,v);g&&(h=!1);for(var y=0;y<m.length;y++)this.writeNote(m[y],.125,g||v?this.boomVolume:this.chickVolume,l,n,g||v?this.bassInstrument:this.chordInstrument),v?v=!1:g=!1}}};ue.prototype.processChord=function(e){if(!this.chordTrackFinished){var t=this.findChord(e);if(t){var r=this.interpretChord(t);if(r){this.chordTrack.length===0&&this.chordTrack.push({cmd:"program",channel:this.chordChannel,instrument:this.chordInstrument}),this.lastChord=r;var a=xc(this.lastBarTime,Br(e.time));this.currentChords.push({chord:this.lastChord,beat:a,start:Br(e.time)})}}}};function yc(e,t,r,a){var i=[];if(!e)return i;t.indexOf("boom")>=0?i.push(r?e.boom:e.boom2):a&&i.push(e.boom);var n=e.chick.length;if(t.indexOf("chick")>=0)for(var s=0;s<n;s++)i.push(e.chick[s]);switch(t){case"DO":i.push(e.chick[0]);break;case"MI":i.push(e.chick[1]);break;case"SOL":i.push(Ht(e,2));break;case"TI":i.push(Ht(e,3));break;case"TOP":i.push(Ht(e,4));break;case"do":i.push(e.chick[0]+12);break;case"mi":i.push(e.chick[1]+12);break;case"sol":i.push(Ht(e,2)+12);break;case"ti":i.push(Ht(e,3)+12);break;case"top":i.push(Ht(e,4)+12);break}return i}function Ht(e,t){var r=Math.floor(t/e.chick.length),a=e.chick[t%e.chick.length];return a+r*12}function Qi(e){for(var t=[],r=0;r<e.length;r++){var a=e[r];switch(a){case"z":t.push("");break;case"2":t.push("");break;case"c":t.push("chick");break;case"b":t.push("boom&chick");break;case"f":t.push("boom");break;case"G":t.push("DO");break;case"H":t.push("MI");break;case"I":t.push("SOL");break;case"J":t.push("TI");break;case"K":t.push("TOP");break;case"g":t.push("do");break;case"h":t.push("mi");break;case"i":t.push("sol");break;case"j":t.push("ti");break;case"k":t.push("top");break}}return t}function wc(e,t,r){var a=[];if(e.length===0)return a;for(var i=e[0].chord,n=1;n<e.length;n++){for(var s=e[n];a.length<s.beat;)a.push(i);i=s.chord}for(;a.length<t;)a.push(i);return a}function xc(e,t){var r=t-e;return r*8}ue.prototype.breakSynonyms=["break","(break)","no chord","n.c.","tacet"];ue.prototype.basses={A:33,B:35,C:36,D:38,E:40,F:41,G:43};ue.prototype.chordIntervals={dim:[0,3,6],"°":[0,3,6],"˚":[0,3,6],dim7:[0,3,6,9],"°7":[0,3,6,9],"˚7":[0,3,6,9],ø7:[0,3,6,10],"m7(b5)":[0,3,6,10],m7b5:[0,3,6,10],"m7♭5":[0,3,6,10],"-7(b5)":[0,3,6,10],"-7b5":[0,3,6,10],"7b5":[0,4,6,10],"7(b5)":[0,4,6,10],"7♭5":[0,4,6,10],"7(b9,b5)":[0,4,6,10,13],"7b9,b5":[0,4,6,10,13],"7(#9,b5)":[0,4,6,10,15],"7#9b5":[0,4,6,10,15],"maj7(b5)":[0,4,6,11],maj7b5:[0,4,6,11],"13(b5)":[0,4,6,10,14,21],"13b5":[0,4,6,10,14,21],m:[0,3,7],"-":[0,3,7],m6:[0,3,7,9],"-6":[0,3,7,9],m7:[0,3,7,10],"-7":[0,3,7,10],"-(b6)":[0,3,7,8],"-b6":[0,3,7,8],"-6/9":[0,3,7,9,14],"-7(b9)":[0,3,7,10,13],"-7b9":[0,3,7,10,13],"-maj7":[0,3,7,11],"-9+7":[0,3,7,11,13],"-11":[0,3,7,11,14,17],m11:[0,3,7,11,14,17],"-maj9":[0,3,7,11,14],"-∆9":[0,3,7,11,14],mM9:[0,3,7,11,14],M:[0,4,7],6:[0,4,7,9],"6/9":[0,4,7,9,14],"6add9":[0,4,7,9,14],69:[0,4,7,9,14],7:[0,4,7,10],9:[0,4,7,10,14],11:[0,7,10,14,17],13:[0,4,7,10,14,21],"7b9":[0,4,7,10,13],"7♭9":[0,4,7,10,13],"7(b9)":[0,4,7,10,13],"7(#9)":[0,4,7,10,15],"7#9":[0,4,7,10,15],"(13)":[0,4,7,10,14,21],"7(9,13)":[0,4,7,10,14,21],"7(#9,b13)":[0,4,7,10,15,20],"7(#11)":[0,4,7,10,14,18],"7#11":[0,4,7,10,14,18],"7(b13)":[0,4,7,10,20],"7b13":[0,4,7,10,20],"9(#11)":[0,4,7,10,14,18],"9#11":[0,4,7,10,14,18],"13(#11)":[0,4,7,10,18,21],"13#11":[0,4,7,10,18,21],maj7:[0,4,7,11],"∆7":[0,4,7,11],Δ7:[0,4,7,11],maj9:[0,4,7,11,14],"maj7(9)":[0,4,7,11,14],"maj7(11)":[0,4,7,11,17],"maj7(#11)":[0,4,7,11,18],"maj7(13)":[0,4,7,14,21],"maj7(9,13)":[0,4,7,11,14,21],"7sus4":[0,5,7,10],m7sus4:[0,3,7,10,17],sus4:[0,5,7],sus2:[0,2,7],"7sus2":[0,2,7,10],"9sus4":[0,5,7,10,14],"13sus4":[0,5,7,10,14,21],aug7:[0,4,8,10],"+7":[0,4,8,10],"+":[0,4,8],"7#5":[0,4,8,10],"7♯5":[0,4,8,10],"7+5":[0,4,8,10],"9#5":[0,4,8,10,14],"9♯5":[0,4,8,10,14],"9+5":[0,4,8,10,14],"-7(#5)":[0,3,8,10],"-7#5":[0,3,8,10],"7(#5)":[0,4,8,10],"7(b9,#5)":[0,4,8,10,13],"7b9#5":[0,4,8,10,13],"maj7(#5)":[0,4,8,11],"maj7#5":[0,4,8,11],"maj7(#5,#11)":[0,4,8,11,18],"maj7#5#11":[0,4,8,11,18],"9(#5)":[0,4,8,10,14],"13(#5)":[0,4,8,10,14,21],"13#5":[0,4,8,10,14,21],5:[0,7],"5(8)":[0,7,12],"5add8":[0,7,12]};ue.prototype.rhythmPatterns={"2/2":["boom","","","","chick","","",""],"3/2":["boom","","","","chick","","","","chick","","",""],"4/2":["boom","","","","chick","","","","boom","","","","chick","","",""],"2/4":["boom","","chick",""],"3/4":["boom","","chick","","chick",""],"4/4":["boom","","chick","","boom","","chick",""],"5/4":["boom","","chick","","chick","","boom","","chick",""],"6/4":["boom","","chick","","boom","","chick","","boom","","chick",""],"3/8":["boom","","chick"],"5/8":["boom","chick","chick","boom","chick"],"6/8":["boom","","chick","boom","","chick"],"7/8":["boom","chick","chick","boom","chick","boom","chick"],"9/8":["boom","","chick","boom","","chick","boom","","chick"],"10/8":["boom","chick","chick","boom","chick","chick","boom","chick","boom","chick"],"11/8":["boom","chick","chick","boom","chick","chick","boom","chick","boom","chick","chick"],"12/8":["boom","","chick","boom","","chick","boom","","chick","boom","","chick"]};function Br(e){return e/1e6}function Na(e,t){return Math.round(e*t*1e6)/1e6}var Cc=ue,kc={f0:"_C",n0:"=C",s0:"^C",x0:"C",f1:"_D",n1:"=D",s1:"^D",x1:"D",f2:"_E",n2:"=E",s2:"^E",x2:"E",f3:"_F",n3:"=F",s3:"^F",x3:"F",f4:"_G",n4:"=G",s4:"^G",x4:"G",f5:"_A",n5:"=A",s5:"^A",x5:"A",f6:"_B",n6:"=B",s6:"^B",x6:"B",f7:"_c",n7:"=c",s7:"^c",x7:"c",f8:"_d",n8:"=d",s8:"^d",x8:"d",f9:"_e",n9:"=e",s9:"^e",x9:"e",f10:"_f",n10:"=f",s10:"^f",x10:"f",f11:"_g",n11:"=g",s11:"^g",x11:"g",f12:"_a",n12:"=a",s12:"^a",x12:"a",f13:"_b",n13:"=b",s13:"^b",x13:"b",f14:"_c'",n14:"=c'",s14:"^c'",x14:"c'",f15:"_d'",n15:"=d'",s15:"^d'",x15:"d'",f16:"_e'",n16:"=e'",s16:"^e'",x16:"e'"};function _c(e){var t=(e.accidental?e.accidental[0]:"x")+e.verticalPos;return kc[t]}var Ji=_c,Zi,Tc=Cc,La=Ji;(function(){var e,t,r,a,i,n=1,s,c,o,f,u,l,h={num:4,den:4},d=128,p,g=!0,v=105,m=95,y=85,x=[[v,m,y]],b=.25,w,C,T=0,B,E={},z,I=0,F,G=0,Y=-.001,K=.4;Zi=function(M,O,N,D){O||(O={}),D||(D={}),e=[],t=[0,0,0,0,0,0,0],a=[],i=O.qpm,n=1,s=void 0,c=void 0,o=void 0,f=void 0,u=0,F=N,h={num:4,den:4},g=!0,v=105,m=95,y=85,x=[],b=.25,w=void 0,C=void 0,T=0,B=[],E={},z=1,M.length>0&&M[0].length>0&&(I=M[0][0].pickupLength),O.bassprog!==void 0&&!D.bassprog&&(D.bassprog=[O.bassprog]),O.bassvol!==void 0&&!D.bassvol&&(D.bassvol=[O.bassvol]),O.chordprog!==void 0&&!D.chordprog&&(D.chordprog=[O.chordprog]),O.chordvol!==void 0&&!D.chordvol&&(D.chordvol=[O.chordvol]),O.gchord!==void 0&&!D.gchord&&(D.gchord=[O.gchord]),l=new Tc(M.length,O.chordsOff,D,h),L(M,O);for(var $=0;$<M.length;$++){r=0,l.setTranspose(r);var W=M[$];o=[{cmd:"program",channel:$,instrument:s}],f=void 0,p=0,l.setLastBarTime(0);var J=!1;(O.voicesOff===!0||O.voicesOff&&O.voicesOff.length&&O.voicesOff.indexOf($)>=0)&&(J=!0);for(var ee=0;ee<W.length;ee++){var j=W[ee];switch(j.el_type){case"name":f={cmd:"text",type:"name",text:j.trackName};break;case"note":Qe(j,J);break;case"key":t=q(j);break;case"meter":h=j,l.setMeter(h),b=A(h),ke();break;case"tempo":i?n=j.qpm?i/j.qpm:1:i=j.qpm,l.setTempoChangeFactor(n);break;case"transpose":r=j.transpose,l.setTranspose(r);break;case"bar":l.barEnd(j),e=[],$===0&&_e(M.length+1),l.setRhythmHead(!1),p=k(j.time),l.setLastBarTime(p);break;case"bagpipes":break;case"instrument":if(s===void 0&&(s=j.program),c=j.program,o.length>0&&o[o.length-1].cmd==="program")o[o.length-1].instrument=j.program;else{var X;for(X=o.length-1;X>=0&&o[X].cmd!=="program";X--);(X<0||o[X].instrument!==j.program)&&o.push({cmd:"program",channel:0,instrument:j.program})}break;case"channel":P(j.channel);break;case"drum":E=Ae(j.params),ke();break;case"gchordOn":l.gChordOn(j);break;case"beat":v=j.beats[0],m=j.beats[1],y=j.beats[2],j.volumesPerNotePitch?x=j.volumesPerNotePitch:x=[];break;case"vol":w=j.volume;break;case"volinc":C=j.volume;break;case"beataccents":g=j.value;break;case"gchord":case"bassprog":case"chordprog":case"bassvol":case"chordvol":case"gchordbars":l.paramChange(j);break;default:console.log("MIDI creation. Unknown el_type: "+j.el_type+`
7
+ `);break}}o[0].instrument===void 0&&(o[0].instrument=s||0),f&&o.unshift(f),a.push(o),l.finish(),B.length>0}return O.detuneOctave&&xt(a,parseInt(O.detuneOctave,10)),l.addTrack(a),B.length>0&&a.push(B),{tempo:i,instrument:s,tracks:a,totalDuration:u}};function P(M){for(var O=o.length-1;O>=0;O--)if(o[O].cmd==="program"){o[O].channel=M;return}}function k(M){return M/1e6}function _(M){return Math.round(M*n*1e6)/1e6}function L(M,O){for(var N=0;N<M.length;N++){for(var D=M[N],$={},W=O.qpm,J=0,ee=1,j=0;j<D.length;j++){var X=D[j];if(X.el_type==="tempo"){W?ee=X.qpm?W/X.qpm:1:W=X.qpm;continue}X.time=J;var re=X.duration?X.duration:0;if(J+=Math.round(re*ee*1e6),X.pitches){for(var se=0;se<X.pitches.length;se++){var U=X.pitches[se];if(U){if(U.duration=X.duration,U.startTie)$[U.pitch]===void 0?$[U.pitch]={el:j,pitch:se}:(D[$[U.pitch].el].pitches[$[U.pitch].pitch].duration+=U.duration,X.pitches[se]=null);else if(U.endTie){var ne=$[U.pitch];if(ne){var he=U.duration;delete D[ne.el].pitches[ne.pitch].startTie,D[ne.el].pitches[ne.pitch].duration+=he,X.pitches[se]=null,delete $[U.pitch]}else delete U.endTie}}}delete X.duration}}for(var ae in $)if($.hasOwnProperty(ae)){var Fe=$[ae];delete D[Fe.el].pitches[Fe.pitch].startTie}}}function A(M){switch(parseInt(M.den,10)){case 2:return .5;case 4:return .25;case 8:return M.num%3===0?.375:.125;case 16:return .125}return .25}function R(M,O,N){var D=N-M;return D/O}function V(M,O,N){if(O)return 0;let D=v,$=m,W=y;N!==void 0&&x.length>=N+1&&(D=x[N][0],$=x[N][1],W=x[N][2]);var J;if(w!==void 0)J=w,w=void 0;else if(!g)J=$;else if(I>M)J=W;else{var ee=R(p,A(h),M);ee===0?J=D:parseInt(ee,10)===ee?J=$:J=W}return C&&(J+=C,C=void 0),J<0&&(J=0),J>127&&(J=127),O?0:J}function Q(M,O){var N={};if(M.decoration)for(var D=0;D<M.decoration.length;D++)M.decoration[D]==="staccato"?N.thisBreakBetweenNotes="staccato":M.decoration[D]==="tenuto"?N.thisBreakBetweenNotes="tenuto":M.decoration[D]==="accent"?N.velocity=Math.min(127,O*1.5):M.decoration[D]==="trill"?N.noteModification="trill":M.decoration[D]==="lowermordent"?N.noteModification="lowermordent":M.decoration[D]==="uppermordent"?N.noteModification="pralltriller":M.decoration[D]==="mordent"?N.noteModification="mordent":M.decoration[D]==="turn"?N.noteModification="turn":M.decoration[D]==="roll"?N.noteModification="roll":M.decoration[D]==="pralltriller"?N.noteModification="pralltriller":M.decoration[D]==="trillh"&&(N.noteModification="trillh");return N}function le(M,O){var N=O.start,D=O.duration,$=_(1/32);switch(M){case"trill":for(var W=2;D>0;)o.push({cmd:"note",pitch:O.pitch+W,volume:O.volume,start:N,duration:$,gap:0,instrument:c,style:"decoration"}),W=W===2?0:2,D-=$,N+=$;break;case"trillh":for(var W=1;D>0;)o.push({cmd:"note",pitch:O.pitch+W,volume:O.volume,start:N,duration:$,gap:0,instrument:c,style:"decoration"}),W=W===1?0:1,D-=$,N+=$;break;case"pralltriller":o.push({cmd:"note",pitch:O.pitch,volume:O.volume,start:N,duration:$,gap:0,instrument:c,style:"decoration"}),D-=$,N+=$,o.push({cmd:"note",pitch:O.pitch+2,volume:O.volume,start:N,duration:$,gap:0,instrument:c,style:"decoration"}),D-=$,N+=$,o.push({cmd:"note",pitch:O.pitch,volume:O.volume,start:N,duration:D,gap:0,instrument:c});break;case"mordent":case"lowermordent":o.push({cmd:"note",pitch:O.pitch,volume:O.volume,start:N,duration:$,gap:0,instrument:c,style:"decoration"}),D-=$,N+=$,o.push({cmd:"note",pitch:O.pitch-2,volume:O.volume,start:N,duration:$,gap:0,instrument:c,style:"decoration"}),D-=$,N+=$,o.push({cmd:"note",pitch:O.pitch,volume:O.volume,start:N,duration:D,gap:0,instrument:c});break;case"turn":$=O.duration/4,o.push({cmd:"note",pitch:O.pitch+2,volume:O.volume,start:N,duration:$,gap:0,instrument:c,style:"decoration"}),o.push({cmd:"note",pitch:O.pitch,volume:O.volume,start:N+$,duration:$,gap:0,instrument:c,style:"decoration"}),o.push({cmd:"note",pitch:O.pitch-1,volume:O.volume,start:N+$*2,duration:$,gap:0,instrument:c,style:"decoration"}),o.push({cmd:"note",pitch:O.pitch,volume:O.volume,start:N+$*3,duration:$,gap:0,instrument:c,style:"decoration"});break;case"roll":for(;D>0;)o.push({cmd:"note",pitch:O.pitch,volume:O.volume,start:N,duration:$,gap:0,instrument:c,style:"decoration"}),D-=$*2,N+=$*2;break}}function Qe(M,O){var N=V(k(M.time),O);l.processChord(M);var D;if(M.gracenotes&&M.pitches&&M.pitches.length>0&&M.pitches[0]&&(D=Ie(M.gracenotes,M.pitches[0].duration),M.elem&&(M.elem.midiGraceNotePitches=te(D,k(M.time),N*2/3,c))),M.elem){var $=k(M.time),W=$/b/i*60*1e3;if(M.elem.currentTrackMilliseconds===void 0)M.elem.currentTrackMilliseconds=W,M.elem.currentTrackWholeNotes=$;else if(M.elem.currentTrackMilliseconds.length===void 0)M.elem.currentTrackMilliseconds!==W&&(M.elem.currentTrackMilliseconds=[M.elem.currentTrackMilliseconds,W],M.elem.currentTrackWholeNotes=[M.elem.currentTrackWholeNotes,$]);else{for(var J=!1,ee=0;ee<M.elem.currentTrackMilliseconds.length;ee++)M.elem.currentTrackMilliseconds[ee]===W&&(J=!0);J||(M.elem.currentTrackMilliseconds.push(W),M.elem.currentTrackWholeNotes.push($))}}if(M.pitches){var j="",X=Q(M,N);X.thisBreakBetweenNotes&&(j=X.thisBreakBetweenNotes),X.velocity&&(N=X.velocity);var re=M.pitches;M.style==="rhythm"&&(re=l.setRhythmHead(!0,M)),M.elem&&(M.elem.midiPitches=[]);for(var se=0;se<re.length;se++){let ye=N;!X.velocity&&Array.isArray(M.decoration)&&M.decoration.length>se&&(ye=V(k(M.time),O,se));var U=re[se];if(U){U.startSlur&&(T+=U.startSlur.length),U.endSlur&&(T-=U.endSlur.length);var ne=U.actualPitch?U.actualPitch:me(U);if(c===d&&F){var he=La(U);he&&F[he]&&(ne=F[he].sound)}var ae={cmd:"note",pitch:ne,volume:ye,start:k(M.time),duration:_(U.duration),instrument:c,startChar:M.elem.startChar,endChar:M.elem.endChar};if(ae=Z(ae),M.gracenotes&&(ae.duration=ae.duration/2,ae.start=ae.start+ae.duration),M.elem&&M.elem.midiPitches.push(ae),X.noteModification)le(X.noteModification,ae);else{switch(T>0?ae.endType="tenuto":j&&(ae.endType=j),ae.endType){case"tenuto":ae.gap=Y;break;case"staccato":var Fe=ae.duration*K;ae.gap=i/60*Fe;break;default:ae.gap=G;break}o.push(ae)}}}o.length-1}var Ft=Ye(M);u=Math.max(u,k(M.time)+_(Ft))}function Ye(M){return M.pitches&&M.pitches.length>0&&M.pitches[0]?M.pitches[0].duration:M.elem?M.elem.duration:M.duration}var Me=[0,2,4,5,7,9,11];function me(M){if(M.midipitch!==void 0)return M.midipitch;var O=M.pitch;if(M.accidental)switch(M.accidental){case"sharp":e[O]=1;break;case"flat":e[O]=-1;break;case"natural":e[O]=0;break;case"dblsharp":e[O]=2;break;case"dblflat":e[O]=-2;break;case"quartersharp":e[O]=.25;break;case"quarterflat":e[O]=-.25;break}var N=ge(O)*12+Me[ce(O)]+60;return e[O]!==void 0?N+=e[O]:N+=t[ce(O)],N+=r,N}function q(M){var O=[0,0,0,0,0,0,0];if(!M.accidentals)return O;for(var N=0;N<M.accidentals.length;N++){var D=M.accidentals[N],$;switch(D.acc){case"flat":$=-1;break;case"quarterflat":$=-.25;break;case"sharp":$=1;break;case"quartersharp":$=.25;break;default:$=0;break}var W=D.note.toLowerCase(),J=ce(W.charCodeAt(0)-99);O[J]+=$}return O}function Ie(M,O){for(var N=0,D=[],$,W=0;W<M.length;W++)$=M[W],N+=$.duration;var J=O/2/N;for(W=0;W<M.length;W++){$=M[W];var ee=me($);if(c===d&&F){var j=La($);j&&F[j]&&(ee=F[j].sound)}var X={pitch:ee,duration:$.duration*J};X=Z(X),D.push(X)}return D}function te(M,O,N,D){var $=[];N=Math.round(N);for(var W=0;W<M.length;W++){var J=M[W];o.push({cmd:"note",pitch:J.pitch,volume:N,start:O,duration:J.duration,gap:0,instrument:D,style:"grace"}),$.push({pitch:J.pitch,durationInMeasures:J.duration,volume:N,instrument:D}),O+=J.duration}return $}function Z(M){var O=""+M.pitch;return O.indexOf(".75")>=0?(M.pitch=Math.round(M.pitch),M.cents=-50):O.indexOf(".25")>=0&&(M.pitch=Math.round(M.pitch),M.cents=50),M}function ge(M){return Math.floor(M/7)}function ce(M){return M=M%7,M<0&&(M+=7),M}function Ae(M){if(M.pattern.length===0||M.on===!1)return{on:!1};for(var O=M.pattern[0],N=[],D="",$=0,W=0;W<O.length;W++)if(O[W]==="d"&&$++,O[W]==="d"||O[W]==="z")D.length!==0?(N.push(D),D=O[W]):D=D+O[W];else{if(D.length===0)return{on:!1};D=D+O[W]}if(D.length!==0&&N.push(D),M.pattern.length!==$*2+1)return{on:!1};for(var J={on:!0,bars:M.bars,pattern:[]},ee=A(h),j=0,X=0;X<N.length;X++){D=N[X];for(var re=1,se=!1,U=0,ne=1;ne<D.length;ne++)switch(D[ne]){case"/":U!==0&&(re*=U),U=0,se=!0;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":U=U*10+D[ne];break;default:return{on:!1}}se?(U===0&&(U=2),re/=U):U&&(re*=U),D[0]==="d"?(J.pattern.push({len:re*ee,pitch:M.pattern[1+j],velocity:M.pattern[1+j+$]}),j++):J.pattern.push({len:re*ee,pitch:null})}return z=M.bars?M.bars:1,J}function ke(){if(!(!E||!E.pattern)){for(var M=E,O=0,N=h.num/h.den,D=0;D<M.pattern.length;D++)O+=M.pattern[D].len;var $=O/z/N;for(D=0;D<M.pattern.length;D++)M.pattern[D].len=M.pattern[D].len/$;E=M}}function _e(M){if(!(B.length===0&&!E.on)){var O=h.num/h.den;if(B.length===0){if(u<O)return;B.push({cmd:"program",channel:M,instrument:d})}if(E.on)for(var N=p,D=0;D<E.pattern.length;D++){var $=_(E.pattern[D].len);E.pattern[D].pitch&&B.push({cmd:"note",pitch:E.pattern[D].pitch,volume:E.pattern[D].velocity,start:N,duration:$,gap:0,instrument:d}),N+=$}}}function xt(M,O){for(var N={},D=0;D<M.length;D++)for(var $=0;$<M[D].length;$++){var W=M[D][$];W.cmd==="note"&&(N[W.start]===void 0&&(N[W.start]=[]),N[W.start].push({track:D,event:$,pitch:W.pitch}))}var J=Object.keys(N);for(D=0;D<J.length;D++){var ee=N[J[D]];if(ee.length>1){ee=ee.sort(function(U,ne){return U.pitch-ne.pitch});var j=ee[ee.length-1],X=j.pitch%12,re=!1;for($=0;!re&&$<ee.length-1;$++)ee[$].pitch%12===X&&(re=!0);if(re){var se=M[j.track][j.event];se.cents||(se.cents=0),se.cents+=O}}}}})();var Ec=Zi;function Sc(e,t){t||(t={});for(var r=!!t.lineBreaks,a=[],i=!1,n=[],s=[],c=[],o=[],f=[],u=[],l=[],h=0;h<e.length;h++){var d=Da(e[h]);if(d.staff){if(i&&!d.vskip)for(var p=a[a.length-1],g=0;g<p.staff.length;g++){var v=d.staff[g],m=p.staff[g];if(v&&(Tt(v.meter,n[g])||(Mc(v.meter,v.voices),n[g]=v.meter,delete v.meter),Tt(v.key,s[g])||(Ac(v.key,v.voices),s[g]=v.key,delete v.key),v.title&&(m.abbrevTitle=v.title),Tt(v.clef,c[g])||(Bc(v.clef,v.voices),c[g]=v.clef,delete v.clef),Tt(v.vocalfont,o[g])||(I0(v.vocalfont,v.voices,"vocalfont"),o[g]=v.vocalfont,delete v.vocalfont),Tt(v.gchordfont,f[g])||(I0(v.gchordfont,v.voices,"gchordfont"),f[g]=v.gchordfont,delete v.gchordfont),Tt(v.tripletfont,u[g])||(I0(v.tripletfont,v.voices,"tripletfont"),u[g]=v.tripletfont,delete v.tripletfont),Tt(v.annotationfont,l[g])||(I0(v.annotationfont,v.voices,"annotationfont"),l[g]=v.annotationfont,delete v.annotationfont)),v)for(var y=0;y<m.voices.length;y++){var x=m.voices[y],b=v.voices[y];r&&x.push({el_type:"break"}),b&&(m.voices[y]=x.concat(b))}}else{for(var w=0;w<d.staff.length;w++)s[w]=d.staff[w].key,n[w]=d.staff[w].meter,c[w]=d.staff[w].clef;a.push(Da(d))}i=!0}else i=!1,a.push(d)}return a}function Pa(e,t){return e==="abselem"?"abselem":t}function Mc(e,t){e.el_type="meter",e.startChar=-1,e.endChar=-1;for(var r=0;r<t.length;r++)t[r].unshift(e)}function Ac(e,t){e.el_type="key",e.startChar=-1,e.endChar=-1;for(var r=0;r<t.length;r++)t[r].unshift(e)}function Bc(e,t){e.el_type="clef",e.startChar=-1,e.endChar=-1;for(var r=0;r<t.length;r++)t[r].unshift(e)}function I0(e,t,r){e.el_type="font",e.type=r,e.startChar=-1,e.endChar=-1;for(var a=0;a<t.length;a++)t[a].unshift(e)}function Tt(e,t){if(!e)return!0;var r=JSON.stringify(e,Pa),a=JSON.stringify(t,Pa);return r===a}function Da(e){for(var t={},r=Object.keys(e),a=0;a<r.length;a++)if(r[a]!=="staff")t[r[a]]=e[r[a]];else{t.staff=[];for(var i=0;i<e.staff.length;i++){for(var n={},s=Object.keys(e.staff[i]),c=0;c<s.length;c++)if(s[c]!=="voices")n[s[c]]=e.staff[i][s[c]];else{n.voices=[];for(var o=0;o<e.staff[i].voices.length;o++)n.voices.push([].concat(e.staff[i].voices[o]))}t.staff.push(n)}}return t}var Nc=Sc,Ia=rt,Fa=Se,Lc=Ki,Pc=Ec,Dc=Nc,Ic=function(){this.reset=function(){this.version="1.1.0",this.media="screen",this.metaText={},this.metaTextInfo={},this.formatting={},this.lines=[],this.staffNum=0,this.voiceNum=0,this.lineNum=0,this.runningFonts={},delete this.visualTranspose},this.reset();function e(s,c,o,f){for(var u=0;u<f.length;u++)s[o][f[u]]=c[o][f[u]]}this.copyTopInfo=function(s){var c=["tempo","title","header","rhythm","origin","composer","author","partOrder"];e(this,s,"metaText",c),e(this,s,"metaTextInfo",c)},this.copyBottomInfo=function(s){var c=["unalignedWords","book","source","discography","notes","transcription","history","abc-copyright","abc-creator","abc-edited-by","footer"];e(this,s,"metaText",c),e(this,s,"metaTextInfo",c)},this.getBeatLength=function(){var s=this.getMeterFraction(),c=1;return s.num===6||s.num===9||s.num===12||s.num===3&&s.den===8?c=3:s.den===8&&(s.num===5||s.num===7)&&(c=2),c/s.den};function t(s,c){for(var o=0,f=0;f<s.length;f++)if(s[f].staff)for(var u=0;u<s[f].staff.length;u++)for(var l=0;l<s[f].staff[u].voices.length;l++)for(var h=s[f].staff[u].voices[l],d=1,p=0;p<h.length;p++){var g=h[p].rest&&h[p].rest.type==="spacer";if(h[p].startTriplet&&(d=h[p].tripletMultiplier),h[p].duration&&!g&&h[p].el_type!=="tempo"&&(o+=h[p].duration*d),h[p].endTriplet&&(d=1),o>=c&&(o-=c),h[p].el_type==="bar")return o}return o}this.getPickupLength=function(){var s=this.getBarLength(),c=t(this.lines,s);return c<1e-8||s-c<1e-8?0:c},this.getBarLength=function(){var s=this.getMeterFraction();return s.num/s.den},this.getTotalTime=function(){return this.totalTime},this.getTotalBeats=function(){return this.totalBeats},this.millisecondsPerMeasure=function(s){var c;if(s)c=s;else{var o=this.metaText?this.metaText.tempo:null;c=this.getBpm(o)}c<=0&&(c=1);var f=this.getBeatsPerMeasure(),u=f/c;return u*6e4},this.getBeatsPerMeasure=function(){var s=this.getBeatLength(),c=this.getBarLength();return c/s},this.getMeter=function(){for(var s=0;s<this.lines.length;s++){var c=this.lines[s];if(c.staff)for(var o=0;o<c.staff.length;o++){var f=c.staff[o].meter;if(f)return f}}return{type:"common_time"}},this.getMeterFraction=function(){var s=this.getMeter(),c=4,o=4;if(s)if(s.type==="specified"){if(s.value&&s.value.length>0&&s.value[0].num.indexOf("+")>0){var f=s.value[0].num.split("+");c=0;for(var u=0;u<f.length;u++)c+=parseInt(f[u],10)}else c=parseInt(s.value[0].num,10);o=parseInt(s.value[0].den,10)}else s.type==="cut_time"?(c=2,o=2):s.type==="common_time"&&(c=4,o=4);return this.meter={num:c,den:o},this.meter},this.getKeySignature=function(){for(var s=0;s<this.lines.length;s++){var c=this.lines[s];if(c.staff){for(var o=0;o<c.staff.length;o++)if(c.staff[o].key)return c.staff[o].key}}return{}},this.getElementFromChar=function(s){for(var c=0;c<this.lines.length;c++){var o=this.lines[c];if(o.staff)for(var f=0;f<o.staff.length;f++)for(var u=o.staff[f],l=0;l<u.voices.length;l++)for(var h=u.voices[l],d=0;d<h.length;d++){var p=h[d];if(p.startChar&&p.endChar&&p.startChar<=s&&p.endChar>s)return p}}return null};function r(s){for(var c,o,f,u,l=s.length-1;l>=0;l--){var h=s[l];h.type==="bar"?(h.top=f,h.nextTop=c,c=f,h.bottom=u,h.nextBottom=o,o=u):h.type==="event"&&(f=h.top,u=h.top+h.height)}}function a(s){var c=[];for(var o in s)s.hasOwnProperty(o)&&c.push(s[o]);return c=c.sort(function(f,u){var l=f.milliseconds-u.milliseconds;return l!==0?l:f.type==="bar"?-1:1}),c}this.addElementToEvents=function(s,c,o,f,u,l,h,d,p,g){if(c.hint)return{isTiedState:void 0,duration:0};var v=c.durationClass?c.durationClass:c.duration;if(c.abcelem.rest&&c.abcelem.rest.type==="spacer"&&(v=0),v>0){for(var m=[],y=0;y<c.elemset.length;y++)c.elemset[y]!==null&&m.push(c.elemset[y]);var x=c.startTie;if(p!==void 0)s["event"+p].elements.push(m),g&&(s["event"+o]||(s["event"+o]={type:"event",milliseconds:o,line:l,measureNumber:h,top:f,height:u,left:null,width:0,elements:[],startChar:null,endChar:null,startCharArray:[],endCharArray:[]}),s["event"+o].measureStart=!0,g=!1),x||(p=void 0);else{if(!s["event"+o])s["event"+o]={type:"event",milliseconds:o,line:l,measureNumber:h,top:f,height:u,left:c.x,width:c.w,elements:[m],startChar:c.abcelem.startChar,endChar:c.abcelem.endChar,startCharArray:[c.abcelem.startChar],endCharArray:[c.abcelem.endChar],midiPitches:c.abcelem.midiPitches?Ia.cloneArray(c.abcelem.midiPitches):[]},c.abcelem.midiGraceNotePitches&&(s["event"+o].midiGraceNotePitches=Ia.cloneArray(c.abcelem.midiGraceNotePitches));else{if(s["event"+o].left?s["event"+o].left=Math.min(s["event"+o].left,c.x):s["event"+o].left=c.x,s["event"+o].elements.push(m),s["event"+o].startCharArray.push(c.abcelem.startChar),s["event"+o].endCharArray.push(c.abcelem.endChar),s["event"+o].startChar===null&&(s["event"+o].startChar=c.abcelem.startChar),s["event"+o].endChar===null&&(s["event"+o].endChar=c.abcelem.endChar),c.abcelem.midiPitches&&c.abcelem.midiPitches.length){s["event"+o].midiPitches||(s["event"+o].midiPitches=[]);for(var y=0;y<c.abcelem.midiPitches.length;y++)s["event"+o].midiPitches.push(c.abcelem.midiPitches[y])}if(c.abcelem.midiGraceNotePitches&&c.abcelem.midiGraceNotePitches.length){s["event"+o].midiGraceNotePitches||(s["event"+o].midiGraceNotePitches=[]);for(var b=0;b<c.abcelem.midiGraceNotePitches.length;b++)s["event"+o].midiGraceNotePitches.push(c.abcelem.midiGraceNotePitches[b])}}g&&(s["event"+o].measureStart=!0,g=!1)}}return{isTiedState:p,duration:v/d,nextIsBar:g||c.type==="bar"}},this.makeVoicesArray=function(){for(var s=[],c=[],o={},f=0;f<this.engraver.staffgroups.length;f++){var u=this.engraver.staffgroups[f];if(u&&u.staffs&&u.staffs.length>0){var l=u.staffs[0],h=l.absoluteY,d=h-l.top*Fa.STEP,p=u.staffs[u.staffs.length-1];h=p.absoluteY;for(var g=h-p.bottom*Fa.STEP,v=g-d,m=u.voices,y=0;y<m.length;y++)if(!(m[y].staff&&m[y].staff.isTabStaff)){var x=!1;s[y]||(s[y]=[]),c[y]===void 0&&(c[y]=0);for(var b=m[y].children,w=0;w<b.length;w++)b[w].type==="tempo"&&(o[c[y]]=this.getBpm(b[w].abcelem)),s[y].push({top:d,height:v,line:u.line,measureNumber:c[y],elem:b[w]}),b[w].type==="bar"&&x&&c[y]++,(b[w].type==="note"||b[w].type==="rest")&&(x=!0)}}}return this.tempoLocations=o,s},this.setupEvents=function(s,c,o,f){f||(f=1);for(var u=[],l={},h=s,d,p=!0,g=this.makeVoicesArray(),v=0,m=0;m<g.length;m++){var y=h,x=Math.round(y*1e3),b=0,w=-1,C=g[m],T=o;c=this.getBeatLength()*T/60;for(var B=-1,E=0;E<C.length;E++){var z=C[E].measureNumber;B!==z&&this.tempoLocations[z]&&(T=this.tempoLocations[z],c=f*this.getBeatLength()*T/60,B=z);var I=C[E].elem,F=this.addElementToEvents(l,I,x,C[E].top,C[E].height,C[E].line,C[E].measureNumber,c,d,p);d=F.isTiedState,p=F.nextIsBar,y+=F.duration;var G;if(I.duration>0&&l["event"+x]&&(G="event"+x),x=Math.round(y*1e3),I.type==="bar"){var Y=I.abcelem.type,K=Y==="bar_right_repeat"||Y==="bar_dbl_repeat",P=I.abcelem.startEnding==="1",k=Y==="bar_left_repeat"||Y==="bar_dbl_repeat"||Y==="bar_right_repeat";if(K){E>0&&(l[G].endX=I.x),w===-1&&(w=E);var _=0;B=-1;for(var L=b;L<w;L++){z=C[L].measureNumber,B!==z&&this.tempoLocations[z]&&(T=this.tempoLocations[z],c=f*this.getBeatLength()*T/60,B=z);var A=C[L].elem;F=this.addElementToEvents(l,A,x,C[L].top,C[L].height,C[L].line,C[L].measureNumber,c,d,p),d=F.isTiedState,p=F.nextIsBar,y+=F.duration,_=x,x=Math.round(y*1e3)}l["event"+_]&&(l["event"+_].endX=C[w].elem.x),p=!0,w=-1}P&&(w=E),k&&(b=E)}}v=Math.max(v,x)}return u=a(l),r(u),n(this.lines,u),u.push({type:"end",milliseconds:v}),this.addUsefulCallbackInfo(u,T*f),u},this.addUsefulCallbackInfo=function(s,c){for(var o=this.millisecondsPerMeasure(c),f=0;f<s.length;f++){var u=s[f];u.millisecondsPerMeasure=o}};function i(s,c){for(;c<s.length&&s[c].left===null;)c++;return s[c]}function n(s,c){if(!(c.length<1)){for(var o=0;o<c.length-1;o++){var f=c[o],u=i(c,o+1);if(f.left!==null){var l=u&&f.top===u.top?u.left:s[f.line].staffGroup.w;f.endX!==void 0?l>f.left&&(f.endX=Math.min(f.endX,l)):f.endX=l}}var h=c[c.length-1];h.endX=s[h.line].staffGroup.w}}this.getBpm=function(s){var c;if(s||(s=this.metaText?this.metaText.tempo:null),s){c=s.bpm;var o=this.getBeatLength(),f=s.duration&&s.duration.length>0?s.duration[0]:o;c=c*f/o}if(!c){c=180;var u=this.getMeterFraction();u&&u.num!==3&&u.num%3===0&&(c=120)}return c},this.setTiming=function(s,c){if(c=c||0,!this.engraver||!this.engraver.staffgroups)return console.log("setTiming cannot be called before the tune is drawn."),this.noteTimings=[],this.noteTimings;var o=this.metaText?this.metaText.tempo:null,f=this.getBpm(o),u=1;s?o&&(u=s/f):s=f;var l=this.getBeatLength(),h=s/60,d=this.getBarLength(),p=d/l*c/h;p&&(p-=this.getPickupLength()/l/h);var g=l*h;return this.noteTimings=this.setupEvents(p,g,s,u),this.noteTimings.length>0?(this.totalTime=this.noteTimings[this.noteTimings.length-1].milliseconds/1e3,this.totalBeats=this.totalTime*h):(this.totalTime=void 0,this.totalBeats=void 0),this.noteTimings},this.setUpAudio=function(s){s||(s={});var c=Lc(this,s);return Pc(c,s,this.formatting.percmap,this.formatting.midi)},this.deline=function(s){return Dc(this.lines,s)},this.findSelectableElement=function(s){return this.engraver&&this.engraver.selectables?this.engraver.findSelectableElement(s):null},this.getSelectableArray=function(){return this.engraver&&this.engraver.selectables?this.engraver.selectables:[]}},Fc=Ic,Oa=Yr,Oc=function(e){var t=this,r={},a="";e.reset(),this.setVisualTranspose=function(i){i!==void 0&&(e.visualTranspose=i)},this.cleanUp=function(i,n,s){dr(e),delete e.runningFonts,Hc(e),e.metaText.tempo&&e.metaText.tempo.bpm&&!e.metaText.tempo.duration&&(e.metaText.tempo.duration=[e.getBeatLength()]);var c=!1,o,f,u;for(o=0;o<e.lines.length;o++)if(e.lines[o].staff!==void 0){var l=!1;for(f=0;f<e.lines[o].staff.length;f++)if(e.lines[o].staff[f]===void 0)c=!0,e.lines[o].staff[f]=null;else for(u=0;u<e.lines[o].staff[f].voices.length;u++)e.lines[o].staff[f].voices[u]===void 0?e.lines[o].staff[f].voices[u]=[]:pr(e.lines[o].staff[f].voices[u])&&(l=!0);l||(e.lines[o]=null,c=!0)}if(c&&(e.lines=e.lines.filter(function(b){return!!b}),e.lines.forEach(function(b){b.staff&&(b.staff=b.staff.filter(function(w){return!!w}))})),i)for(;Yc(e.lines,i););if(n){for(c=!1,o=0;o<e.lines.length;o++)if(e.lines[o].staff!==void 0)for(f=0;f<e.lines[o].staff.length;f++){var h=!1;for(u=0;u<e.lines[o].staff[f].voices.length;u++)Uc(e.lines[o].staff[f].voices[u])&&(h=!0);h||(c=!0,e.lines[o].staff[f]=null)}c&&e.lines.forEach(function(b){b.staff&&(b.staff=b.staff.filter(function(w){return!!w}))})}for(Gc(e.lines),o=0;o<e.lines.length;o++)if(e.lines[o].staff)for(f=0;f<e.lines[o].staff.length;f++)delete e.lines[o].staff[f].workingClef;for(var d=!1;zc(e);)d=!0;if(d)for(var p=0,g=za(e.lines,p);g!=="not-found";)g=za(e.lines,p),g?p++:Qc(e.lines,p);for(var o=0;o<e.lines.length;o++){var v=e.lines[o].staff;if(v)for(e.staffNum=0;e.staffNum<v.length;e.staffNum++)for(v[e.staffNum].clef&&Oa.fixClef(v[e.staffNum].clef),e.voiceNum=0;e.voiceNum<v[e.staffNum].voices.length;e.voiceNum++){var m=v[e.staffNum].voices[e.voiceNum];Rc(m,e.staffNum,e.voiceNum,s);for(var y=0;y<m.length;y++)m[y].el_type==="clef"&&Oa.fixClef(m[y]);if(m.length>0&&m[m.length-1].barNumber){var x=en(e.lines,o);x&&(x.staff[0].barNumber=m[m.length-1].barNumber),delete m[m.length-1].barNumber}}}return delete e.staffNum,delete e.voiceNum,delete e.lineNum,delete e.potentialStartBeam,delete e.potentialEndBeam,delete e.vskipPending,s},this.addTieToLastNote=function(i){var n=Wc(e);return n&&n.pitches&&n.pitches.length>0?(n.pitches[0].startTie={},i&&(n.pitches[0].startTie.style="dotted"),!0):!1},this.appendElement=function(i,n,s,c){if(c.el_type=i,n!==null&&(c.startChar=n),s!==null&&(c.endChar=s),i==="note"){var o=Xc(c);o>=.25||c.force_end_beam_last&&e.potentialStartBeam!==void 0?F0(e):c.end_beam&&e.potentialStartBeam!==void 0?c.rest===void 0?jc(c,e):F0(e):c.rest===void 0&&(e.potentialStartBeam===void 0?c.end_beam||(e.potentialStartBeam=c,delete e.potentialEndBeam):e.potentialEndBeam=c)}else F0(e);return delete c.end_beam,delete c.force_end_beam_last,c.rest&&c.rest.type==="invisible"&&delete c.decoration,e.lines.length<=e.lineNum||e.lines[e.lineNum].staff.length<=e.staffNum?!1:(Vc(t,e,c,r,a),!0)},this.appendStartingElement=function(i,n,s,c){dr(e);var o;i==="key"&&(o=c.impliedNaturals,delete c.impliedNaturals,delete c.explicitAccidentals);var f=Object.assign({},c);if(e.lines[e.lineNum]){var u=e.lines[e.lineNum].staff;if(u){u.length<=e.staffNum&&(u[e.staffNum]={},u[e.staffNum].clef=Object.assign({},u[0].clef),u[e.staffNum].key=Object.assign({},u[0].key),u[0].meter&&(u[e.staffNum].meter=Object.assign({},u[0].meter)),u[e.staffNum].workingClef=Object.assign({},u[0].workingClef),u[e.staffNum].voices=[[]]),i==="clef"&&(u[e.staffNum].workingClef=f);for(var l=u[e.staffNum].voices[e.voiceNum],h=0;h<l.length;h++){if(l[h].el_type==="note"||l[h].el_type==="bar"){f.el_type=i,f.startChar=n,f.endChar=s,o&&(f.accidentals=o.concat(f.accidentals)),l.push(f);return}if(l[h].el_type===i){f.el_type=i,f.startChar=n,f.endChar=s,o&&(f.accidentals=o.concat(f.accidentals)),l[h]=f;return}}u[e.staffNum][i]=c}}},this.addSubtitle=function(i,n){o0(e,{subtitle:{text:i,startChar:n.startChar,endChar:n.endChar}})},this.addSpacing=function(i){e.vskipPending=i},this.addNewPage=function(i){o0(e,{newpage:i})},this.addSeparator=function(i,n,s,c){o0(e,{separator:{spaceAbove:Math.round(i),spaceBelow:Math.round(n),lineLength:Math.round(s),startChar:c.startChar,endChar:c.endChar}})},this.addText=function(i,n){o0(e,{text:{text:i,startChar:n.startChar,endChar:n.endChar}})},this.addCentered=function(i){o0(e,{text:[{text:i,center:!0}]})},this.changeVoiceScale=function(i){t.appendElement("scale",null,null,{size:i})},this.changeVoiceColor=function(i){t.appendElement("color",null,null,{color:i})},this.startNewLine=function(i){dr(e),i.currentVoiceName&&(a=i.currentVoiceName,r[i.currentVoiceName]=i),e.lines[e.lineNum]===void 0?Kc(t,e,i):e.lines[e.lineNum].staff===void 0?(e.lineNum++,this.startNewLine(i)):e.lines[e.lineNum].staff[e.staffNum]===void 0?tn(t,e,i):e.lines[e.lineNum].staff[e.staffNum].voices[e.voiceNum]===void 0?Xr(t,e,i):pr(e.lines[e.lineNum].staff[e.staffNum].voices[e.voiceNum])?(e.lineNum++,this.startNewLine(i)):i.part&&t.appendElement("part",i.part.startChar,i.part.endChar,{title:i.part.title})},this.setRunningFont=function(i,n){e.runningFonts[i]=n},this.setBarNumberImmediate=function(i){var n=this.getCurrentVoice();if(n&&n.length>0){var s=n[n.length-1];if(s.el_type==="bar")s.barNumber!==void 0&&(s.barNumber=i);else return i-1}return i},this.hasBeginMusic=function(){for(var i=0;i<e.lines.length;i++)if(e.lines[i].staff)return!0;return!1},this.isFirstLine=function(i){for(var n=i-1;n>=0;n--)if(e.lines[n].staff!==void 0)return!1;return!0},this.getCurrentVoice=function(){var i=qc(e.lines,e.lineNum);if(!i)return null;var n=i.staff[e.staffNum];return n&&n.voices[e.voiceNum]!==void 0?n.voices[e.voiceNum]:null},this.setCurrentVoice=function(i,n,s){e.staffNum=i,e.voiceNum=n,a=s;for(var c=0;c<e.lines.length;c++)if(e.lines[c].staff&&(e.lines[c].staff[i]===void 0||e.lines[c].staff[i].voices[n]===void 0||!pr(e.lines[c].staff[i].voices[n])))return e.lineNum=c,!!(!e.lines[c].staff[i]||e.lines[c].staff[i].voices[n]);return e.lineNum=c,!1},this.addMetaText=function(i,n,s){e.metaText[i]===void 0?(e.metaText[i]=n,e.metaTextInfo[i]=s):(typeof e.metaText[i]=="string"&&typeof n=="string"?e.metaText[i]+=`
8
+ `+n:(e.metaText[i]==="string"&&(e.metaText[i]=[{text:e.metaText[i]}]),typeof n=="string"&&(n=[{text:n}]),e.metaText[i]=e.metaText[i].concat(n)),e.metaTextInfo[i].endChar=s.endChar)},this.addMetaTextArray=function(i,n,s){e.metaText[i]===void 0?(e.metaText[i]=[n],e.metaTextInfo[i]=s):(e.metaText[i].push(n),e.metaTextInfo[i].endChar=s.endChar)},this.addMetaTextObj=function(i,n,s){e.metaText[i]=n,e.metaTextInfo[i]=s}};function Ha(e){if(!e||typeof e=="string")return!1;for(var t=0;t<e.length;t++)if(typeof e[t]!="string")return!1;return!0}function Hc(e){Ha(e.metaText.notes)&&(e.metaText.notes=e.metaText.notes.join(`
9
9
  `)),Ha(e.metaText.history)&&(e.metaText.history=e.metaText.history.join(`
10
- `))}function $o(e){for(var t=!1,r=0;r<e.lines.length;r++){var a=e.lines[r];if(a.staff)for(var n=0;n<a.staff.length;n++){for(var i=a.staff[n],s=[],o=0;o<i.voices.length;o++){var c=i.voices[o];s.push({hasOverlay:!1,voice:[],snip:[]});for(var f=0,u=!1,l=-1,h=0;h<c.length;h++){var d=c[h];if(d.el_type==="overlay"&&!u){t=!0,u=!0,l=h,s[o].hasOverlay=!0;for(var p=0;p<r;p++)e.lines[p].staff&&e.lines[p].staff.forEach(b=>{i.voices.length>=b.voices.length&&b.voices.forEach(w=>{let C=[];w.forEach(T=>{T.el_type==="bar"?C.push(T):T.el_type==="note"&&C.push({el_type:"note",duration:T.duration,rest:{type:"invisible"},startChar:T.startChar,endChar:T.endChar})}),b.voices.push(C)})})}else d.el_type==="bar"?(u?(u=!1,s[o].snip.push({start:l,len:h-l}),s[o].voice.push(d)):(f>0&&s[o].voice.push({el_type:"note",duration:f,rest:{type:"invisible"},startChar:d.startChar,endChar:d.endChar}),s[o].voice.push(d)),f=0):d.el_type==="note"?u?s[o].voice.push(d):(!d.rest||d.rest.type!=="spacer")&&(f+=d.duration):(d.el_type==="scale"||d.el_type==="stem"||d.el_type==="overlay"||d.el_type==="style"||d.el_type==="transpose"||d.el_type==="color")&&s[o].voice.push(d)}s[o].hasOverlay&&s[o].snip.length===0&&s[o].snip.push({start:l,len:c.length-l})}for(o=0;o<s.length;o++){var g=s[o];if(g.hasOverlay){g.voice.splice(0,0,{el_type:"stem",direction:"down"}),i.voices.push(g.voice);for(var v=g.snip.length-1;v>=0;v--){var m=g.snip[v];i.voices[o].splice(m.start,m.len),i.voices[o].splice(m.start+1,0,{el_type:"stem",direction:"auto"});var y=Ro(i.voices[o],m.start);i.voices[o].splice(y,0,{el_type:"stem",direction:"up"})}for(v=0;v<i.voices[i.voices.length-1].length;v++){i.voices[i.voices.length-1][v]=Object.assign({},i.voices[i.voices.length-1][v]);var x=i.voices[i.voices.length-1][v];x.el_type==="bar"&&x.startEnding&&delete x.startEnding,x.el_type==="bar"&&x.endEnding&&delete x.endEnding}}}}}return t}function Ro(e,t){for(var r=t-1;r>0&&e[r].el_type!=="bar";r--);return r}function Go(e){for(var t=!0,r=0;r<e.length;r++){var a=e[r];if(a.staff){for(var n=0;n<a.staff.length;n++){var i=a.staff[n];if(i.title){for(var s=!1,o=0;o<i.title.length;o++)i.title[o]?(i.title[o]=t?i.title[o].name:i.title[o].subname,i.title[o]?s=!0:i.title[o]=""):i.title[o]="";s||delete i.title}}t=!1}}}function Yo(e,t,r,a){a[t]||(a[t]=[]),a[t][r]||(a[t][r]=[]);for(var n,i=function(m,y,x){if(a[t][r][x]===void 0){for(n=0;n<a[t][r].length;n++)if(a[t][r][n]!==void 0){x=n;break}if(a[t][r][x]===void 0){var b=x*100+1;m.endSlur.forEach(function(T){b===T&&--b}),a[t][r][x]=[b]}}for(var w,C=0;C<y;C++)w=a[t][r][x].pop(),m.endSlur.push(w);return a[t][r][x].length===0&&delete a[t][r][x],w},s=function(m,y,x,b){m.startSlur=[],a[t][r][x]===void 0&&(a[t][r][x]=[]);for(var w=x*100+1,C=0;C<y;C++)b&&(b.forEach(function(T){w===T&&++w}),b.forEach(function(T){w===T&&++w}),b.forEach(function(T){w===T&&++w})),a[t][r][x].forEach(function(T){w===T&&++w}),a[t][r][x].forEach(function(T){w===T&&++w}),a[t][r][x].push(w),m.startSlur.push({label:w}),m.dottedSlur&&(m.startSlur[m.startSlur.length-1].style="dotted",delete m.dottedSlur),w++},o=0;o<e.length;o++){var c=e[o];if(c.el_type==="note"){if(c.gracenotes)for(var f=0;f<c.gracenotes.length;f++){if(c.gracenotes[f].endSlur){var u=c.gracenotes[f].endSlur;c.gracenotes[f].endSlur=[];for(var l=0;l<u;l++)i(c.gracenotes[f],1,20)}c.gracenotes[f].startSlur&&(n=c.gracenotes[f].startSlur,s(c.gracenotes[f],n,20))}if(c.endSlur&&(n=c.endSlur,c.endSlur=[],i(c,n,0)),c.startSlur&&(n=c.startSlur,s(c,n,0)),c.pitches){for(var h=[],d=0;d<c.pitches.length;d++)if(c.pitches[d].endSlur){var p=c.pitches[d].endSlur;c.pitches[d].endSlur=[];for(var g=0;g<p;g++){var v=i(c.pitches[d],1,d+1);h.push(v)}}for(d=0;d<c.pitches.length;d++)c.pitches[d].startSlur&&(n=c.pitches[d].startSlur,s(c.pitches[d],n,d+1,h));c.gracenotes&&c.pitches[0].endSlur&&c.pitches[0].endSlur[0]===100&&c.pitches[0].startSlur&&(c.gracenotes[0].endSlur?c.gracenotes[0].endSlur.push(c.pitches[0].startSlur[0].label):c.gracenotes[0].endSlur=[c.pitches[0].startSlur[0].label],c.pitches[0].endSlur.length===1?delete c.pitches[0].endSlur:c.pitches[0].endSlur[0]===100?c.pitches[0].endSlur.shift():c.pitches[0].endSlur[c.pitches[0].endSlur.length-1]===100&&c.pitches[0].endSlur.pop(),a[t][r][1].length===1?delete a[t][r][1]:a[t][r][1].pop())}}}}function qo(e,t){for(var r=0;r<e.length;r++)if(e[r].staff!==void 0)for(var a=0;a<e[r].staff.length;a++)for(var n=[],i=0;i<e[r].staff[a].voices.length;i++)for(var s=e[r].staff[a].voices[i],o=0,c=0;c<s.length;c++)if(s[c].el_type==="bar"){if(o++,o>=t&&c<s.length-1){var f=ti(e,r);if(!f){var u=JSON.parse(JSON.stringify(e[r]));e.push(Object.assign({},u)),f=e[e.length-1];for(var l=0;l<f.staff.length;l++)for(var h=0;h<f.staff[l].voices.length;h++)f.staff[l].voices[h]=[]}var d=c+1,p=e[r].staff[a].voices[i].slice(d);return e[r].staff[a].voices[i]=e[r].staff[a].voices[i].slice(0,d),f.staff[a].voices[i]=n.concat(p.concat(f.staff[a].voices[i])),!0}}else s[c].duration||n.push(s[c]);return!1}function Wo(e,t){if(e.length<=t)return null;for(;t>=0;){if(e[t].staff)return e[t];t--}return null}function ti(e,t){for(t++;e.length>t;){if(e[t].staff)return e[t];t++}return null}function Xo(e){if(!e.lines[e.lineNum]||!e.lines[e.lineNum].staff||!e.lines[e.lineNum].staff[e.staffNum])return null;var t=e.lines[e.lineNum].staff[e.staffNum].voices[e.voiceNum];if(!t)return null;for(var r=t.length-1;r>=0;r--){var a=t[r];if(a.el_type==="note")return a}return null}function Uo(e){return e.duration?e.duration:0}function dr(e){e.potentialStartBeam&&e.potentialEndBeam&&(e.potentialStartBeam.startBeam=!0,e.potentialEndBeam.endBeam=!0),delete e.potentialStartBeam,delete e.potentialEndBeam}function pr(e){for(var t=0;t<e.length;t++)if(e[t].el_type==="note"||e[t].el_type==="bar")return!0;return!1}function Vo(e){for(var t=0;t<e.length;t++)if(e[t].el_type==="note"&&(e[t].rest===void 0||e[t].chord!==void 0))return!0;return!1}function c0(e,t){e.vskipPending&&(t.vskip=e.vskipPending,delete e.vskipPending),e.lines.push(t)}function jo(e,t,r,a,n){var i=t.lines[t.lineNum].staff[t.staffNum];if(r.pitches!==void 0){var s=i.workingClef.verticalPos;r.pitches.forEach(function(c){c.verticalPos=c.pitch-s})}if(r.gracenotes!==void 0){var o=i.workingClef.verticalPos;r.gracenotes.forEach(function(c){c.verticalPos=c.pitch-o})}i.voices.length<=t.voiceNum&&(a[n]||(a[n]={}),Xr(e,t,a[n])),i.voices[t.voiceNum].push(r)}function Ko(e,t){t.potentialStartBeam.startBeam=!0,e.endBeam=!0,delete t.potentialStartBeam,delete t.potentialEndBeam}function F0(e){e.potentialStartBeam!==void 0&&e.potentialEndBeam!==void 0&&(e.potentialStartBeam.startBeam=!0,e.potentialEndBeam.endBeam=!0),delete e.potentialStartBeam,delete e.potentialEndBeam}function O0(e,t,r){if(e.runningFonts[t]){for(var a=!1,n=Object.keys(r),i=0;i<n.length;i++)e.runningFonts[t][n[i]]!==r[n[i]]&&(a=!0);a&&(e.lines[e.lineNum].staff[e.staffNum][t]=r)}e.runningFonts[t]=r}function Xr(e,t,r){var a=t.lines[t.lineNum].staff[t.staffNum];if(a.voices[t.voiceNum]=[],a.title||(a.title=[]),a.title[t.voiceNum]={name:r.name,subname:r.subname},r.style&&e.appendElement("style",null,null,{head:r.style}),r.stem)e.appendElement("stem",null,null,{direction:r.stem});else if(t.voiceNum>0){if(a.voices[0]!==void 0){for(var n=!1,i=0;i<a.voices[0].length;i++)a.voices[0].el_type==="stem"&&(n=!0);if(!n){var s={el_type:"stem",direction:"up"};a.voices[0].splice(0,0,s)}}e.appendElement("stem",null,null,{direction:"down"})}r.scale&&e.appendElement("scale",null,null,{size:r.scale}),r.color&&e.appendElement("color",null,null,{color:r.color})}function ri(e,t,r){r.key&&r.key.impliedNaturals&&(r.key.accidentals=r.key.accidentals.concat(r.key.impliedNaturals),delete r.key.impliedNaturals),t.lines[t.lineNum].staff[t.staffNum]={voices:[],clef:r.clef,key:r.key,workingClef:r.clef};var a=t.lines[t.lineNum].staff[t.staffNum];r.stafflines!==void 0&&(a.clef.stafflines=r.stafflines,a.workingClef.stafflines=r.stafflines),r.staffscale&&(a.staffscale=r.staffscale),r.annotationfont&&O0(t,"annotationfont",r.annotationfont),r.gchordfont&&O0(t,"gchordfont",r.gchordfont),r.tripletfont&&O0(t,"tripletfont",r.tripletfont),r.vocalfont&&O0(t,"vocalfont",r.vocalfont),r.bracket&&(a.bracket=r.bracket),r.brace&&(a.brace=r.brace),r.connectBarLines&&(a.connectBarLines=r.connectBarLines),r.barNumber&&(a.barNumber=r.barNumber),Xr(e,t,r),r.part&&e.appendElement("part",r.part.startChar,r.part.endChar,{title:r.part.title}),r.meter!==void 0&&(a.meter=r.meter),t.vskipPending&&(t.lines[t.lineNum].vskip=t.vskipPending,delete t.vskipPending)}function Qo(e,t,r){t.lines[t.lineNum]={staff:[]},ri(e,t,r)}function za(e,t){for(var r=!1,a=!1,n=0;n<e.length;n++){var i=e[n].staff;if(i)for(var s=0;s<i.length;s++){var o=i[s];if(t<o.voices.length){a=!0;for(var c=o.voices[t],f=0;f<c.length;f++){var u=c[f];u.el_type==="note"&&(!u.rest||u.chord)&&(r=!0)}}}}return a?r:"not-found"}function Jo(e,t){for(var r=0;r<e.length;r++){var a=e[r].staff;if(a)for(var n=0;n<a.length;n++){var i=a[n];t<i.voices.length&&i.voices.splice(t,1)}}}var Zo=Ho,pt=rt,$a=Rr,ec=Fs,tc=Vs,rc=js,ac=jn,nc=fo,ic=Oo,sc=Zo,oc=function(){var e=new ic,t=new sc(e),r,a="",n="";this.getTune=function(){var b={formatting:e.formatting,lines:e.lines,media:e.media,metaText:e.metaText,metaTextInfo:e.metaTextInfo,version:e.version,addElementToEvents:e.addElementToEvents,addUsefulCallbackInfo:e.addUsefulCallbackInfo,getTotalTime:e.getTotalTime,getTotalBeats:e.getTotalBeats,getBarLength:e.getBarLength,getBeatLength:e.getBeatLength,getBeatsPerMeasure:e.getBeatsPerMeasure,getBpm:e.getBpm,getMeter:e.getMeter,getMeterFraction:e.getMeterFraction,getPickupLength:e.getPickupLength,getKeySignature:e.getKeySignature,getElementFromChar:e.getElementFromChar,makeVoicesArray:e.makeVoicesArray,millisecondsPerMeasure:e.millisecondsPerMeasure,setupEvents:e.setupEvents,setTiming:e.setTiming,setUpAudio:e.setUpAudio,deline:e.deline,findSelectableElement:e.findSelectableElement,getSelectableArray:e.getSelectableArray};return e.lineBreaks&&(b.lineBreaks=e.lineBreaks),e.visualTranspose&&(b.visualTranspose=e.visualTranspose),e.chordGrid&&(b.chordGrid=e.chordGrid),b};function i(b,w,C){b.positioning||(b.positioning={}),b.positioning[w]=C}function s(b,w,C){b.fonts||(b.fonts={}),b.fonts[w]=C}var o={reset:function(){for(var b in this)this.hasOwnProperty(b)&&typeof this[b]!="function"&&delete this[b];this.iChar=0,this.key={accidentals:[],root:"none",acc:"",mode:""},this.meter=null,this.origMeter=null,this.hasMainTitle=!1,this.default_length=.125,this.clef={type:"treble",verticalPos:0},this.octave=0,this.next_note_duration=0,this.start_new_line=!0,this.is_in_header=!0,this.partForNextLine={},this.tempoForNextLine=[],this.havent_set_length=!0,this.voices={},this.staves=[],this.macros={},this.currBarNumber=1,this.barCounter={},this.ignoredDecorations=[],this.score_is_present=!1,this.inEnding=!1,this.inTie=[],this.inTieChord={},this.vocalPosition="auto",this.dynamicPosition="auto",this.chordPosition="auto",this.ornamentPosition="auto",this.volumePosition="auto",this.openSlurs=[],this.freegchord=!1,this.endingHoldOver={}},differentFont:function(b,w){return this[b].decoration!==w[b].decoration||this[b].face!==w[b].face||this[b].size!==w[b].size||this[b].style!==w[b].style||this[b].weight!==w[b].weight},addFormattingOptions:function(b,w,C){C==="note"?(this.vocalPosition!=="auto"&&i(b,"vocalPosition",this.vocalPosition),this.dynamicPosition!=="auto"&&i(b,"dynamicPosition",this.dynamicPosition),this.chordPosition!=="auto"&&i(b,"chordPosition",this.chordPosition),this.ornamentPosition!=="auto"&&i(b,"ornamentPosition",this.ornamentPosition),this.volumePosition!=="auto"&&i(b,"volumePosition",this.volumePosition),this.differentFont("annotationfont",w)&&s(b,"annotationfont",this.annotationfont),this.differentFont("gchordfont",w)&&s(b,"gchordfont",this.gchordfont),this.differentFont("vocalfont",w)&&s(b,"vocalfont",this.vocalfont),this.differentFont("tripletfont",w)&&s(b,"tripletfont",this.tripletfont)):C==="bar"&&(this.dynamicPosition!=="auto"&&i(b,"dynamicPosition",this.dynamicPosition),this.chordPosition!=="auto"&&i(b,"chordPosition",this.chordPosition),this.ornamentPosition!=="auto"&&i(b,"ornamentPosition",this.ornamentPosition),this.volumePosition!=="auto"&&i(b,"volumePosition",this.volumePosition),this.differentFont("measurefont",w)&&s(b,"measurefont",this.measurefont),this.differentFont("repeatfont",w)&&s(b,"repeatfont",this.repeatfont))},duplicateStartEndingHoldOvers:function(){this.endingHoldOver={inTie:[],inTieChord:{}};for(var b=0;b<this.inTie.length;b++)if(this.endingHoldOver.inTie.push([]),this.inTie[b])for(var w=0;w<this.inTie[b].length;w++)this.endingHoldOver.inTie[b].push(this.inTie[b][w]);for(var C in this.inTieChord)this.inTieChord.hasOwnProperty(C)&&(this.endingHoldOver.inTieChord[C]=this.inTieChord[C])},restoreStartEndingHoldOvers:function(){if(this.endingHoldOver.inTie){this.inTie=[],this.inTieChord={};for(var b=0;b<this.endingHoldOver.inTie.length;b++){this.inTie.push([]);for(var w=0;w<this.endingHoldOver.inTie[b].length;w++)this.inTie[b].push(this.endingHoldOver.inTie[b][w])}for(var C in this.endingHoldOver.inTieChord)this.endingHoldOver.inTieChord.hasOwnProperty(C)&&(this.inTieChord[C]=this.endingHoldOver.inTieChord[C])}}},c=function(b){o.warnings||(o.warnings=[]),o.warnings.push(b)},f=function(b){o.warningObjects||(o.warningObjects=[]),o.warningObjects.push(b)},u=function(b){var w=b.replace(/\x12/g," ");return w=w.replace(/&/g,"&amp;"),w=w.replace(/</g,"&lt;"),w.replace(/>/g,"&gt;")},l=function(b,w,C){w||(w=" ");var T=w[C];(T===" "||!T)&&(T="SPACE");var B=u(w.substring(C-64,C))+'<span style="text-decoration:underline;font-size:1.3em;font-weight:bold;">'+T+"</span>"+u(w.substring(C+1).substring(0,64));c("Music Line:"+r.lineIndex+":"+(C+1)+": "+b+": "+B),f({message:b,line:w,startChar:o.iChar+C,column:C})},h,d;this.getWarnings=function(){return o.warnings},this.getWarningObjects=function(){return o.warningObjects};var p=function(b,w){if(w.indexOf("")>=0){a+=w;return}if(w=a+w,a="",!b){l("Can't add words before the first line of music",b,0);return}w=pt.strip(w),w[w.length-1]!=="-"&&(w=w+" ");for(var C=[],T=0,B=!1,E=function(O){var R=pt.strip(w.substring(T,O));if(R=R.replace(/\\([-_*|~])/g,"$1"),T=O+1,R.length>0){B&&(R=R.replace(/~/g," "));var Y=w[O];return Y!=="_"&&Y!=="-"&&(Y=" "),C.push({syllable:r.translateString(R),divider:Y}),B=!1,!0}return!1},z=!1,F=0;F<w.length;F++){switch(w[F]){case" ":case"":E(F);break;case"-":!z&&!E(F)&&C.length>0&&(pt.last(C).divider="-",C.push({skip:!0,to:"next"}));break;case"_":z||(E(F),C.push({skip:!0,to:"slur"}));break;case"*":z||(E(F),C.push({skip:!0,to:"next"}));break;case"|":z||(E(F),C.push({skip:!0,to:"bar"}));break;case"~":z||(B=!0);break}z=w[F]==="\\"}b.forEach(function(O){if(C.length!==0){if(C[0].skip){switch(C[0].to){case"next":O.el_type==="note"&&O.pitches!==null&&C.shift();break;case"slur":O.el_type==="note"&&O.pitches!==null&&C.shift();break;case"bar":O.el_type==="bar"&&C.shift();break}O.el_type!=="bar"&&(O.lyric===void 0?O.lyric=[{syllable:"",divider:" "}]:O.lyric.push({syllable:"",divider:" "}))}else if(O.el_type==="note"&&O.rest===void 0){var R=C.shift();R.syllable&&(R.syllable=R.syllable.replace(/ +/g," ")),O.lyric===void 0?O.lyric=[R]:O.lyric.push(R)}}})},g=function(b,w){if(w.indexOf("")>=0){n+=w;return}if(w=n+w,n="",!b){l("Can't add symbols before the first line of music",b,0);return}w=pt.strip(w),w[w.length-1]!=="-"&&(w=w+" ");for(var C=[],T=0,B=!1,E=function(F){var O=pt.strip(w.substring(T,F));if(T=F+1,O.length>0){B&&(O=O.replace(/~/g," "));var R=w[F];return R!=="_"&&R!=="-"&&(R=" "),C.push({syllable:r.translateString(O),divider:R}),B=!1,!0}return!1},z=0;z<w.length;z++)switch(w[z]){case" ":case"":E(z);break;case"-":!E(z)&&C.length>0&&(pt.last(C).divider="-",C.push({skip:!0,to:"next"}));break;case"_":E(z),C.push({skip:!0,to:"slur"});break;case"*":E(z),C.push({skip:!0,to:"next"});break;case"|":E(z),C.push({skip:!0,to:"bar"});break;case"~":B=!0;break}b.forEach(function(F){if(C.length!==0){if(C[0].skip)switch(C[0].to){case"next":F.el_type==="note"&&F.pitches!==null&&C.shift();break;case"slur":F.el_type==="note"&&F.pitches!==null&&C.shift();break;case"bar":F.el_type==="bar"&&C.shift();break}else if(F.el_type==="note"&&F.rest===void 0){var O=C.shift();F.lyric===void 0?F.lyric=[O]:F.lyric.push(O)}}})},v=function(b){if(pt.startsWith(b,"%%")){var w=$a.addDirective(b.substring(2));w&&l(w,b,2);return}var C=b.indexOf("%");if(C>=0&&(b=b.substring(0,C)),b=b.replace(/\s+$/,""),b.length!==0){if(a){p(t.getCurrentVoice(),b.substring(2));return}if(n){g(t.getCurrentVoice(),b.substring(2));return}if(b.length<2||b[1]!==":"||d.lineContinuation){d.parseMusic(b);return}var T=h.parseHeader(b);T.regular&&d.parseMusic(b),T.newline&&d.startNewLine(),T.words&&p(t.getCurrentVoice(),b.substring(2)),T.symbols&&g(t.getCurrentVoice(),b.substring(2))}};function m(b,w){b.push({el_type:"hint"});for(var C=0;C<w.length;C++){var T=w[C],B=Object.assign({},T);if(b.push(B),T.el_type==="bar")return}}function y(b,w){for(var C=0;C<b.length;C++){var T=b[C],B=w[C];if(B)for(var E=0;E<B.voices.length;E++){var z=B.voices[E],F=T.voices[E];F&&m(F,z)}}}function x(){for(var b=0;b<e.lines.length;b++){var w=e.lines[b].staff;if(w){for(var C=b+1;C<e.lines.length&&e.lines[C].staff===void 0;)C++;if(C<e.lines.length){var T=e.lines[C].staff;y(w,T)}}}}this.parse=function(b,w,C){w||(w={}),C||(C=0),e.reset(),b=b.replace(/\r\n?/g,`
10
+ `))}function zc(e){for(var t=!1,r=0;r<e.lines.length;r++){var a=e.lines[r];if(a.staff)for(var i=0;i<a.staff.length;i++){for(var n=a.staff[i],s=[],c=0;c<n.voices.length;c++){var o=n.voices[c];s.push({hasOverlay:!1,voice:[],snip:[]});for(var f=0,u=!1,l=-1,h=0;h<o.length;h++){var d=o[h];if(d.el_type==="overlay"&&!u){t=!0,u=!0,l=h,s[c].hasOverlay=!0;for(var p=0;p<r;p++)e.lines[p].staff&&e.lines[p].staff.forEach(b=>{n.voices.length>=b.voices.length&&b.voices.forEach(w=>{let C=[];w.forEach(T=>{T.el_type==="bar"?C.push(T):T.el_type==="note"&&C.push({el_type:"note",duration:T.duration,rest:{type:"invisible"},startChar:T.startChar,endChar:T.endChar})}),b.voices.push(C)})})}else d.el_type==="bar"?(u?(u=!1,s[c].snip.push({start:l,len:h-l}),s[c].voice.push(d)):(f>0&&s[c].voice.push({el_type:"note",duration:f,rest:{type:"invisible"},startChar:d.startChar,endChar:d.endChar}),s[c].voice.push(d)),f=0):d.el_type==="note"?u?s[c].voice.push(d):(!d.rest||d.rest.type!=="spacer")&&(f+=d.duration):(d.el_type==="scale"||d.el_type==="stem"||d.el_type==="overlay"||d.el_type==="style"||d.el_type==="transpose"||d.el_type==="color")&&s[c].voice.push(d)}s[c].hasOverlay&&s[c].snip.length===0&&s[c].snip.push({start:l,len:o.length-l})}for(c=0;c<s.length;c++){var g=s[c];if(g.hasOverlay){g.voice.splice(0,0,{el_type:"stem",direction:"down"}),n.voices.push(g.voice);for(var v=g.snip.length-1;v>=0;v--){var m=g.snip[v];n.voices[c].splice(m.start,m.len),n.voices[c].splice(m.start+1,0,{el_type:"stem",direction:"auto"});var y=$c(n.voices[c],m.start);n.voices[c].splice(y,0,{el_type:"stem",direction:"up"})}for(v=0;v<n.voices[n.voices.length-1].length;v++){n.voices[n.voices.length-1][v]=Object.assign({},n.voices[n.voices.length-1][v]);var x=n.voices[n.voices.length-1][v];x.el_type==="bar"&&x.startEnding&&delete x.startEnding,x.el_type==="bar"&&x.endEnding&&delete x.endEnding}}}}}return t}function $c(e,t){for(var r=t-1;r>0&&e[r].el_type!=="bar";r--);return r}function Gc(e){for(var t=!0,r=0;r<e.length;r++){var a=e[r];if(a.staff){for(var i=0;i<a.staff.length;i++){var n=a.staff[i];if(n.title){for(var s=!1,c=0;c<n.title.length;c++)n.title[c]?(n.title[c]=t?n.title[c].name:n.title[c].subname,n.title[c]?s=!0:n.title[c]=""):n.title[c]="";s||delete n.title}}t=!1}}}function Rc(e,t,r,a){a[t]||(a[t]=[]),a[t][r]||(a[t][r]=[]);for(var i,n=function(m,y,x){if(a[t][r][x]===void 0){for(i=0;i<a[t][r].length;i++)if(a[t][r][i]!==void 0){x=i;break}if(a[t][r][x]===void 0){var b=x*100+1;m.endSlur.forEach(function(T){b===T&&--b}),a[t][r][x]=[b]}}for(var w,C=0;C<y;C++)w=a[t][r][x].pop(),m.endSlur.push(w);return a[t][r][x].length===0&&delete a[t][r][x],w},s=function(m,y,x,b){m.startSlur=[],a[t][r][x]===void 0&&(a[t][r][x]=[]);for(var w=x*100+1,C=0;C<y;C++)b&&(b.forEach(function(T){w===T&&++w}),b.forEach(function(T){w===T&&++w}),b.forEach(function(T){w===T&&++w})),a[t][r][x].forEach(function(T){w===T&&++w}),a[t][r][x].forEach(function(T){w===T&&++w}),a[t][r][x].push(w),m.startSlur.push({label:w}),m.dottedSlur&&(m.startSlur[m.startSlur.length-1].style="dotted",delete m.dottedSlur),w++},c=0;c<e.length;c++){var o=e[c];if(o.el_type==="note"){if(o.gracenotes)for(var f=0;f<o.gracenotes.length;f++){if(o.gracenotes[f].endSlur){var u=o.gracenotes[f].endSlur;o.gracenotes[f].endSlur=[];for(var l=0;l<u;l++)n(o.gracenotes[f],1,20)}o.gracenotes[f].startSlur&&(i=o.gracenotes[f].startSlur,s(o.gracenotes[f],i,20))}if(o.endSlur&&(i=o.endSlur,o.endSlur=[],n(o,i,0)),o.startSlur&&(i=o.startSlur,s(o,i,0)),o.pitches){for(var h=[],d=0;d<o.pitches.length;d++)if(o.pitches[d].endSlur){var p=o.pitches[d].endSlur;o.pitches[d].endSlur=[];for(var g=0;g<p;g++){var v=n(o.pitches[d],1,d+1);h.push(v)}}for(d=0;d<o.pitches.length;d++)o.pitches[d].startSlur&&(i=o.pitches[d].startSlur,s(o.pitches[d],i,d+1,h));o.gracenotes&&o.pitches[0].endSlur&&o.pitches[0].endSlur[0]===100&&o.pitches[0].startSlur&&(o.gracenotes[0].endSlur?o.gracenotes[0].endSlur.push(o.pitches[0].startSlur[0].label):o.gracenotes[0].endSlur=[o.pitches[0].startSlur[0].label],o.pitches[0].endSlur.length===1?delete o.pitches[0].endSlur:o.pitches[0].endSlur[0]===100?o.pitches[0].endSlur.shift():o.pitches[0].endSlur[o.pitches[0].endSlur.length-1]===100&&o.pitches[0].endSlur.pop(),a[t][r][1].length===1?delete a[t][r][1]:a[t][r][1].pop())}}}}function Yc(e,t){for(var r=0;r<e.length;r++)if(e[r].staff!==void 0)for(var a=0;a<e[r].staff.length;a++)for(var i=[],n=0;n<e[r].staff[a].voices.length;n++)for(var s=e[r].staff[a].voices[n],c=0,o=0;o<s.length;o++)if(s[o].el_type==="bar"){if(c++,c>=t&&o<s.length-1){var f=en(e,r);if(!f){var u=JSON.parse(JSON.stringify(e[r]));e.push(Object.assign({},u)),f=e[e.length-1];for(var l=0;l<f.staff.length;l++)for(var h=0;h<f.staff[l].voices.length;h++)f.staff[l].voices[h]=[]}var d=o+1,p=e[r].staff[a].voices[n].slice(d);return e[r].staff[a].voices[n]=e[r].staff[a].voices[n].slice(0,d),f.staff[a].voices[n]=i.concat(p.concat(f.staff[a].voices[n])),!0}}else s[o].duration||i.push(s[o]);return!1}function qc(e,t){if(e.length<=t)return null;for(;t>=0;){if(e[t].staff)return e[t];t--}return null}function en(e,t){for(t++;e.length>t;){if(e[t].staff)return e[t];t++}return null}function Wc(e){if(!e.lines[e.lineNum]||!e.lines[e.lineNum].staff||!e.lines[e.lineNum].staff[e.staffNum])return null;var t=e.lines[e.lineNum].staff[e.staffNum].voices[e.voiceNum];if(!t)return null;for(var r=t.length-1;r>=0;r--){var a=t[r];if(a.el_type==="note")return a}return null}function Xc(e){return e.duration?e.duration:0}function dr(e){e.potentialStartBeam&&e.potentialEndBeam&&(e.potentialStartBeam.startBeam=!0,e.potentialEndBeam.endBeam=!0),delete e.potentialStartBeam,delete e.potentialEndBeam}function pr(e){for(var t=0;t<e.length;t++)if(e[t].el_type==="note"||e[t].el_type==="bar")return!0;return!1}function Uc(e){for(var t=0;t<e.length;t++)if(e[t].el_type==="note"&&(e[t].rest===void 0||e[t].chord!==void 0))return!0;return!1}function o0(e,t){e.vskipPending&&(t.vskip=e.vskipPending,delete e.vskipPending),e.lines.push(t)}function Vc(e,t,r,a,i){var n=t.lines[t.lineNum].staff[t.staffNum];if(r.pitches!==void 0){var s=n.workingClef.verticalPos;r.pitches.forEach(function(o){o.verticalPos=o.pitch-s})}if(r.gracenotes!==void 0){var c=n.workingClef.verticalPos;r.gracenotes.forEach(function(o){o.verticalPos=o.pitch-c})}n.voices.length<=t.voiceNum&&(a[i]||(a[i]={}),Xr(e,t,a[i])),n.voices[t.voiceNum].push(r)}function jc(e,t){t.potentialStartBeam.startBeam=!0,e.endBeam=!0,delete t.potentialStartBeam,delete t.potentialEndBeam}function F0(e){e.potentialStartBeam!==void 0&&e.potentialEndBeam!==void 0&&(e.potentialStartBeam.startBeam=!0,e.potentialEndBeam.endBeam=!0),delete e.potentialStartBeam,delete e.potentialEndBeam}function O0(e,t,r){if(e.runningFonts[t]){for(var a=!1,i=Object.keys(r),n=0;n<i.length;n++)e.runningFonts[t][i[n]]!==r[i[n]]&&(a=!0);a&&(e.lines[e.lineNum].staff[e.staffNum][t]=r)}e.runningFonts[t]=r}function Xr(e,t,r){var a=t.lines[t.lineNum].staff[t.staffNum];if(a.voices[t.voiceNum]=[],a.title||(a.title=[]),a.title[t.voiceNum]={name:r.name,subname:r.subname},r.style&&e.appendElement("style",null,null,{head:r.style}),r.stem)e.appendElement("stem",null,null,{direction:r.stem});else if(t.voiceNum>0){if(a.voices[0]!==void 0){for(var i=!1,n=0;n<a.voices[0].length;n++)a.voices[0].el_type==="stem"&&(i=!0);if(!i){var s={el_type:"stem",direction:"up"};a.voices[0].splice(0,0,s)}}e.appendElement("stem",null,null,{direction:"down"})}r.scale&&e.appendElement("scale",null,null,{size:r.scale}),r.color&&e.appendElement("color",null,null,{color:r.color})}function tn(e,t,r){r.key&&r.key.impliedNaturals&&(r.key.accidentals=r.key.accidentals.concat(r.key.impliedNaturals),delete r.key.impliedNaturals),t.lines[t.lineNum].staff[t.staffNum]={voices:[],clef:r.clef,key:r.key,workingClef:r.clef};var a=t.lines[t.lineNum].staff[t.staffNum];r.stafflines!==void 0&&(a.clef.stafflines=r.stafflines,a.workingClef.stafflines=r.stafflines),r.staffscale&&(a.staffscale=r.staffscale),r.annotationfont&&O0(t,"annotationfont",r.annotationfont),r.gchordfont&&O0(t,"gchordfont",r.gchordfont),r.tripletfont&&O0(t,"tripletfont",r.tripletfont),r.vocalfont&&O0(t,"vocalfont",r.vocalfont),r.bracket&&(a.bracket=r.bracket),r.brace&&(a.brace=r.brace),r.connectBarLines&&(a.connectBarLines=r.connectBarLines),r.barNumber&&(a.barNumber=r.barNumber),Xr(e,t,r),r.part&&e.appendElement("part",r.part.startChar,r.part.endChar,{title:r.part.title}),r.meter!==void 0&&(a.meter=r.meter),t.vskipPending&&(t.lines[t.lineNum].vskip=t.vskipPending,delete t.vskipPending)}function Kc(e,t,r){t.lines[t.lineNum]={staff:[]},tn(e,t,r)}function za(e,t){for(var r=!1,a=!1,i=0;i<e.length;i++){var n=e[i].staff;if(n)for(var s=0;s<n.length;s++){var c=n[s];if(t<c.voices.length){a=!0;for(var o=c.voices[t],f=0;f<o.length;f++){var u=o[f];u.el_type==="note"&&(!u.rest||u.chord)&&(r=!0)}}}}return a?r:"not-found"}function Qc(e,t){for(var r=0;r<e.length;r++){var a=e[r].staff;if(a)for(var i=0;i<a.length;i++){var n=a[i];t<n.voices.length&&n.voices.splice(t,1)}}}var Jc=Oc,pt=rt,$a=Gr,Zc=Fs,eo=Vs,to=js,ro=Vi,ao=fc,io=Fc,no=Jc,so=function(){var e=new io,t=new no(e),r,a="",i="";this.getTune=function(){var b={formatting:e.formatting,lines:e.lines,media:e.media,metaText:e.metaText,metaTextInfo:e.metaTextInfo,version:e.version,addElementToEvents:e.addElementToEvents,addUsefulCallbackInfo:e.addUsefulCallbackInfo,getTotalTime:e.getTotalTime,getTotalBeats:e.getTotalBeats,getBarLength:e.getBarLength,getBeatLength:e.getBeatLength,getBeatsPerMeasure:e.getBeatsPerMeasure,getBpm:e.getBpm,getMeter:e.getMeter,getMeterFraction:e.getMeterFraction,getPickupLength:e.getPickupLength,getKeySignature:e.getKeySignature,getElementFromChar:e.getElementFromChar,makeVoicesArray:e.makeVoicesArray,millisecondsPerMeasure:e.millisecondsPerMeasure,setupEvents:e.setupEvents,setTiming:e.setTiming,setUpAudio:e.setUpAudio,deline:e.deline,findSelectableElement:e.findSelectableElement,getSelectableArray:e.getSelectableArray};return e.lineBreaks&&(b.lineBreaks=e.lineBreaks),e.visualTranspose&&(b.visualTranspose=e.visualTranspose),e.chordGrid&&(b.chordGrid=e.chordGrid),b};function n(b,w,C){b.positioning||(b.positioning={}),b.positioning[w]=C}function s(b,w,C){b.fonts||(b.fonts={}),b.fonts[w]=C}var c={reset:function(){for(var b in this)this.hasOwnProperty(b)&&typeof this[b]!="function"&&delete this[b];this.iChar=0,this.key={accidentals:[],root:"none",acc:"",mode:""},this.meter=null,this.origMeter=null,this.hasMainTitle=!1,this.default_length=.125,this.clef={type:"treble",verticalPos:0},this.octave=0,this.next_note_duration=0,this.start_new_line=!0,this.is_in_header=!0,this.partForNextLine={},this.tempoForNextLine=[],this.havent_set_length=!0,this.voices={},this.staves=[],this.macros={},this.currBarNumber=1,this.barCounter={},this.ignoredDecorations=[],this.score_is_present=!1,this.inEnding=!1,this.inTie=[],this.inTieChord={},this.vocalPosition="auto",this.dynamicPosition="auto",this.chordPosition="auto",this.ornamentPosition="auto",this.volumePosition="auto",this.openSlurs=[],this.freegchord=!1,this.endingHoldOver={}},differentFont:function(b,w){return this[b].decoration!==w[b].decoration||this[b].face!==w[b].face||this[b].size!==w[b].size||this[b].style!==w[b].style||this[b].weight!==w[b].weight},addFormattingOptions:function(b,w,C){C==="note"?(this.vocalPosition!=="auto"&&n(b,"vocalPosition",this.vocalPosition),this.dynamicPosition!=="auto"&&n(b,"dynamicPosition",this.dynamicPosition),this.chordPosition!=="auto"&&n(b,"chordPosition",this.chordPosition),this.ornamentPosition!=="auto"&&n(b,"ornamentPosition",this.ornamentPosition),this.volumePosition!=="auto"&&n(b,"volumePosition",this.volumePosition),this.differentFont("annotationfont",w)&&s(b,"annotationfont",this.annotationfont),this.differentFont("gchordfont",w)&&s(b,"gchordfont",this.gchordfont),this.differentFont("vocalfont",w)&&s(b,"vocalfont",this.vocalfont),this.differentFont("tripletfont",w)&&s(b,"tripletfont",this.tripletfont)):C==="bar"&&(this.dynamicPosition!=="auto"&&n(b,"dynamicPosition",this.dynamicPosition),this.chordPosition!=="auto"&&n(b,"chordPosition",this.chordPosition),this.ornamentPosition!=="auto"&&n(b,"ornamentPosition",this.ornamentPosition),this.volumePosition!=="auto"&&n(b,"volumePosition",this.volumePosition),this.differentFont("measurefont",w)&&s(b,"measurefont",this.measurefont),this.differentFont("repeatfont",w)&&s(b,"repeatfont",this.repeatfont))},duplicateStartEndingHoldOvers:function(){this.endingHoldOver={inTie:[],inTieChord:{}};for(var b=0;b<this.inTie.length;b++)if(this.endingHoldOver.inTie.push([]),this.inTie[b])for(var w=0;w<this.inTie[b].length;w++)this.endingHoldOver.inTie[b].push(this.inTie[b][w]);for(var C in this.inTieChord)this.inTieChord.hasOwnProperty(C)&&(this.endingHoldOver.inTieChord[C]=this.inTieChord[C])},restoreStartEndingHoldOvers:function(){if(this.endingHoldOver.inTie){this.inTie=[],this.inTieChord={};for(var b=0;b<this.endingHoldOver.inTie.length;b++){this.inTie.push([]);for(var w=0;w<this.endingHoldOver.inTie[b].length;w++)this.inTie[b].push(this.endingHoldOver.inTie[b][w])}for(var C in this.endingHoldOver.inTieChord)this.endingHoldOver.inTieChord.hasOwnProperty(C)&&(this.inTieChord[C]=this.endingHoldOver.inTieChord[C])}}},o=function(b){c.warnings||(c.warnings=[]),c.warnings.push(b)},f=function(b){c.warningObjects||(c.warningObjects=[]),c.warningObjects.push(b)},u=function(b){var w=b.replace(/\x12/g," ");return w=w.replace(/&/g,"&amp;"),w=w.replace(/</g,"&lt;"),w.replace(/>/g,"&gt;")},l=function(b,w,C){w||(w=" ");var T=w[C];(T===" "||!T)&&(T="SPACE");var B=u(w.substring(C-64,C))+'<span style="text-decoration:underline;font-size:1.3em;font-weight:bold;">'+T+"</span>"+u(w.substring(C+1).substring(0,64));o("Music Line:"+r.lineIndex+":"+(C+1)+": "+b+": "+B),f({message:b,line:w,startChar:c.iChar+C,column:C})},h,d;this.getWarnings=function(){return c.warnings},this.getWarningObjects=function(){return c.warningObjects};var p=function(b,w){if(w.indexOf("")>=0){a+=w;return}if(w=a+w,a="",!b){l("Can't add words before the first line of music",b,0);return}w=pt.strip(w),w[w.length-1]!=="-"&&(w=w+" ");for(var C=[],T=0,B=!1,E=function(F){var G=pt.strip(w.substring(T,F));if(G=G.replace(/\\([-_*|~])/g,"$1"),T=F+1,G.length>0){B&&(G=G.replace(/~/g," "));var Y=w[F];return Y!=="_"&&Y!=="-"&&(Y=" "),C.push({syllable:r.translateString(G),divider:Y}),B=!1,!0}return!1},z=!1,I=0;I<w.length;I++){switch(w[I]){case" ":case"":E(I);break;case"-":!z&&!E(I)&&C.length>0&&(pt.last(C).divider="-",C.push({skip:!0,to:"next"}));break;case"_":z||(E(I),C.push({skip:!0,to:"slur"}));break;case"*":z||(E(I),C.push({skip:!0,to:"next"}));break;case"|":z||(E(I),C.push({skip:!0,to:"bar"}));break;case"~":z||(B=!0);break}z=w[I]==="\\"}b.forEach(function(F){if(C.length!==0){if(C[0].skip){switch(C[0].to){case"next":F.el_type==="note"&&F.pitches!==null&&C.shift();break;case"slur":F.el_type==="note"&&F.pitches!==null&&C.shift();break;case"bar":F.el_type==="bar"&&C.shift();break}F.el_type!=="bar"&&(F.lyric===void 0?F.lyric=[{syllable:"",divider:" "}]:F.lyric.push({syllable:"",divider:" "}))}else if(F.el_type==="note"&&F.rest===void 0){var G=C.shift();G.syllable&&(G.syllable=G.syllable.replace(/ +/g," ")),F.lyric===void 0?F.lyric=[G]:F.lyric.push(G)}}})},g=function(b,w){if(w.indexOf("")>=0){i+=w;return}if(w=i+w,i="",!b){l("Can't add symbols before the first line of music",b,0);return}w=pt.strip(w),w[w.length-1]!=="-"&&(w=w+" ");for(var C=[],T=0,B=!1,E=function(I){var F=pt.strip(w.substring(T,I));if(T=I+1,F.length>0){B&&(F=F.replace(/~/g," "));var G=w[I];return G!=="_"&&G!=="-"&&(G=" "),C.push({syllable:r.translateString(F),divider:G}),B=!1,!0}return!1},z=0;z<w.length;z++)switch(w[z]){case" ":case"":E(z);break;case"-":!E(z)&&C.length>0&&(pt.last(C).divider="-",C.push({skip:!0,to:"next"}));break;case"_":E(z),C.push({skip:!0,to:"slur"});break;case"*":E(z),C.push({skip:!0,to:"next"});break;case"|":E(z),C.push({skip:!0,to:"bar"});break;case"~":B=!0;break}b.forEach(function(I){if(C.length!==0){if(C[0].skip)switch(C[0].to){case"next":I.el_type==="note"&&I.pitches!==null&&C.shift();break;case"slur":I.el_type==="note"&&I.pitches!==null&&C.shift();break;case"bar":I.el_type==="bar"&&C.shift();break}else if(I.el_type==="note"&&I.rest===void 0){var F=C.shift();I.lyric===void 0?I.lyric=[F]:I.lyric.push(F)}}})},v=function(b){if(pt.startsWith(b,"%%")){var w=$a.addDirective(b.substring(2));w&&l(w,b,2);return}var C=b.indexOf("%");if(C>=0&&(b=b.substring(0,C)),b=b.replace(/\s+$/,""),b.length!==0){if(a){p(t.getCurrentVoice(),b.substring(2));return}if(i){g(t.getCurrentVoice(),b.substring(2));return}if(b.length<2||b[1]!==":"||d.lineContinuation){d.parseMusic(b);return}var T=h.parseHeader(b);T.regular&&d.parseMusic(b),T.newline&&d.startNewLine(),T.words&&p(t.getCurrentVoice(),b.substring(2)),T.symbols&&g(t.getCurrentVoice(),b.substring(2))}};function m(b,w){b.push({el_type:"hint"});for(var C=0;C<w.length;C++){var T=w[C],B=Object.assign({},T);if(b.push(B),T.el_type==="bar")return}}function y(b,w){for(var C=0;C<b.length;C++){var T=b[C],B=w[C];if(B)for(var E=0;E<B.voices.length;E++){var z=B.voices[E],I=T.voices[E];I&&m(I,z)}}}function x(){for(var b=0;b<e.lines.length;b++){var w=e.lines[b].staff;if(w){for(var C=b+1;C<e.lines.length&&e.lines[C].staff===void 0;)C++;if(C<e.lines.length){var T=e.lines[C].staff;y(w,T)}}}}this.parse=function(b,w,C){w||(w={}),C||(C=0),e.reset(),b=b.replace(/\r\n?/g,`
11
11
  `)+`
12
12
  `;var T=b.split(`
13
13
  \\`);if(T.length>1){for(var B=1;B<T.length;B++)for(;T[B].length>0&&T[B][0]!==`
14
14
  `;)T[B]=T[B].substr(1),T[B-1]+=" ";b=T.join(" ")}b=b.replace(/\\([ \t]*)(%.*)*\n/g,function(K,P,k){var _=k?Array(k.length+1).join(" "):"";return P+""+_+`
15
15
  `});var E=b.split(`
16
- `);pt.last(E).length===0&&E.pop(),r=new rc(E,o),h=new ec(r,l,o,e,t),d=new tc(r,l,o,e,t,h),w.print&&(e.media="print"),o.reset(),o.iChar=C,w.visualTranspose?(o.globalTranspose=parseInt(w.visualTranspose),o.globalTranspose===0?o.globalTranspose=void 0:t.setVisualTranspose(w.visualTranspose)):o.globalTranspose=void 0,w.lineBreaks&&(o.lineBreaks=w.lineBreaks),h.reset(r,l,o,e);try{w.format&&$a.globalFormatting(w.format);for(var z=r.nextLine();z;){if(w.header_only&&o.is_in_header===!1||w.stop_on_warning&&o.warnings)throw"normal_abort";var F=o.is_in_header;v(z),F&&!o.is_in_header&&(t.setRunningFont("annotationfont",o.annotationfont),t.setRunningFont("gchordfont",o.gchordfont),t.setRunningFont("tripletfont",o.tripletfont),t.setRunningFont("vocalfont",o.vocalfont)),z=r.nextLine()}a&&p(t.getCurrentVoice(),""),n&&g(t.getCurrentVoice(),""),o.openSlurs=t.cleanUp(o.barsperstaff,o.staffnonote,o.openSlurs)}catch(K){if(K!=="normal_abort")throw K}var O=11*72,R=8.5*72;switch(o.papersize){case"legal":O=14*72,R=8.5*72;break;case"A4":O=11.7*72,R=8.3*72;break}if(o.landscape){var Y=O;O=R,R=Y}if(e.formatting.pagewidth||(e.formatting.pagewidth=R),e.formatting.pageheight||(e.formatting.pageheight=O),w.hint_measures&&x(),ac.wrapLines(e,o.lineBreaks,o.barNumbers),w.chordGrid)try{e.chordGrid=nc(e)}catch(K){switch(K.message){case"notCommonTime":l("Chord grid only works for 2/2 and 4/4 time.",0,0);break;case"noChords":l("No chords are found in the tune.",0,0);break;default:l(K.message,0,0)}}}},ai=oc,l0=rt,cc=function(e){var t="",r=e.match(/(\s*)/);e=l0.strip(e);for(var a=e.split(`
17
- X:`),n=1;n<a.length;n++)a[n]="X:"+a[n];var i=r?r[0].length:0,s=[];if(a.forEach(function(u){s.push({abc:u,startPos:i}),i+=u.length+1}),s.length>1&&!l0.startsWith(s[0].abc,"X:")){var o=s.shift(),c=o.abc.split(`
18
- `);c.forEach(function(u){l0.startsWith(u,"%%")&&(t+=u+`
16
+ `);pt.last(E).length===0&&E.pop(),r=new to(E,c),h=new Zc(r,l,c,e,t),d=new eo(r,l,c,e,t,h),w.print&&(e.media="print"),c.reset(),c.iChar=C,w.visualTranspose?(c.globalTranspose=parseInt(w.visualTranspose),c.globalTranspose===0?c.globalTranspose=void 0:t.setVisualTranspose(w.visualTranspose)):c.globalTranspose=void 0,w.lineBreaks&&(c.lineBreaks=w.lineBreaks),h.reset(r,l,c,e);try{w.format&&$a.globalFormatting(w.format);for(var z=r.nextLine();z;){if(w.header_only&&c.is_in_header===!1||w.stop_on_warning&&c.warnings)throw"normal_abort";var I=c.is_in_header;v(z),I&&!c.is_in_header&&(t.setRunningFont("annotationfont",c.annotationfont),t.setRunningFont("gchordfont",c.gchordfont),t.setRunningFont("tripletfont",c.tripletfont),t.setRunningFont("vocalfont",c.vocalfont)),z=r.nextLine()}a&&p(t.getCurrentVoice(),""),i&&g(t.getCurrentVoice(),""),c.openSlurs=t.cleanUp(c.barsperstaff,c.staffnonote,c.openSlurs)}catch(K){if(K!=="normal_abort")throw K}var F=11*72,G=8.5*72;switch(c.papersize){case"legal":F=14*72,G=8.5*72;break;case"A4":F=11.7*72,G=8.3*72;break}if(c.landscape){var Y=F;F=G,G=Y}if(e.formatting.pagewidth||(e.formatting.pagewidth=G),e.formatting.pageheight||(e.formatting.pageheight=F),w.hint_measures&&x(),ro.wrapLines(e,c.lineBreaks,c.barNumbers),w.chordGrid)try{e.chordGrid=ao(e)}catch(K){switch(K.message){case"notCommonTime":l("Chord grid only works for 2/2 and 4/4 time.",0,0);break;case"noChords":l("No chords are found in the tune.",0,0);break;default:l(K.message,0,0)}}}},rn=so,l0=rt,co=function(e){var t="",r=e.match(/(\s*)/);e=l0.strip(e);for(var a=e.split(`
17
+ X:`),i=1;i<a.length;i++)a[i]="X:"+a[i];var n=r?r[0].length:0,s=[];if(a.forEach(function(u){s.push({abc:u,startPos:n}),n+=u.length+1}),s.length>1&&!l0.startsWith(s[0].abc,"X:")){var c=s.shift(),o=c.abc.split(`
18
+ `);o.forEach(function(u){l0.startsWith(u,"%%")&&(t+=u+`
19
19
  `)})}var f=t;return s.forEach(function(u){var l=u.abc.indexOf(`
20
20
 
21
21
  `);l>0&&(u.abc=u.abc.substring(0,l)),u.pure=u.abc,u.abc=t+u.abc,u.title="";var h=u.pure.split("T:");h.length>1&&(h=h[1].split(`
22
22
  `),u.title=l0.strip(h[0]));var d=u.pure.substring(2,u.pure.indexOf(`
23
- `));u.id=l0.strip(d)}),{header:f,tunes:s}},lc=cc;function Ur(e,t){this.numLines=e,this.lineSpace=t,this.verticalSize=this.numLines*this.lineSpace;var r=3;this.bar={pitch:r,pitch2:t*e,height:5}}Ur.prototype.bypass=function(e){var t=e.staffGroup.voices;return!!(t.length>0&&t[0].isPercussion)};Ur.prototype.setRelative=function(e,t,r){switch(e.type){case"bar":t.pitch=this.bar.pitch,t.pitch2=this.bar.pitch2,t.height=this.height;break;case"symbol":var a=this.bar.pitch2/2;if(e.name=="dots.dot")return r?(t.pitch=a,!1):(t.pitch=a+this.lineSpace,!0);break}return r};var hc=Ur,bt=function(t,r){this.children=[],this.beams=[],this.otherchildren=[],this.w=0,this.duplicate=!1,this.voicenumber=t,this.voicetotal=r,this.bottom=7,this.top=7,this.specialY={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}};bt.prototype.addChild=function(e){if(e.type==="bar"){for(var t=!0,r=0;t&&r<this.children.length;r++)this.children[r].type.indexOf("staff-extra")<0&&this.children[r].type!=="tempo"&&(t=!1);t||(this.beams.push("bar"),this.otherchildren.push("bar"))}this.children[this.children.length]=e,this.setRange(e)};bt.prototype.setLimit=function(e,t){var r=t.specialY;r||(r=t),r[e]&&(this.specialY[e]?this.specialY[e]=Math.max(this.specialY[e],r[e]):this.specialY[e]=r[e])};bt.prototype.adjustRange=function(e){e.bottom!==void 0&&(this.bottom=Math.min(this.bottom,e.bottom)),e.top!==void 0&&(this.top=Math.max(this.top,e.top))};bt.prototype.setRange=function(e){this.adjustRange(e),this.setLimit("tempoHeightAbove",e),this.setLimit("partHeightAbove",e),this.setLimit("volumeHeightAbove",e),this.setLimit("dynamicHeightAbove",e),this.setLimit("endingHeightAbove",e),this.setLimit("chordHeightAbove",e),this.setLimit("lyricHeightAbove",e),this.setLimit("lyricHeightBelow",e),this.setLimit("chordHeightBelow",e),this.setLimit("volumeHeightBelow",e),this.setLimit("dynamicHeightBelow",e)};bt.prototype.addOther=function(e){this.otherchildren.push(e),this.setRange(e)};bt.prototype.addBeam=function(e){this.beams.push(e)};bt.prototype.setWidth=function(e){this.w=e};var ni=bt,fc=function(e,t,r,a){if(e)for(var n=0;n<e.length;n++){var i=e[n],s=i.getAttribute("highlight");s||(s="fill"),i.setAttribute(s,a);var o=i.getAttribute("class");o||(o=""),o=o.replace(r,""),o=o.replace(t,""),t.length>0&&(o.length>0&&o[o.length-1]!==" "&&(o+=" "),o+=t),i.setAttribute("class",o)}},Vr=fc,uc=Vr,dc=function(e,t){e===void 0&&(e="abcjs-note_selected"),t===void 0&&(t="#ff0000"),uc(this.elemset,e,"",t)},ii=dc,pc=Vr,vc=function(e,t){e===void 0&&(e="abcjs-note_selected"),t===void 0&&(t="#000000"),pc(this.elemset,"",e,t)},si=vc,gc=ii,bc=si,we=function(t,r,a,n,i,s){s||(s={}),this.tuneNumber=i,this.abcelem=t,this.duration=r,this.durationClass=s.durationClassOveride?s.durationClassOveride:this.duration,this.minspacing=a||0,this.x=0,this.children=[],this.heads=[],this.extra=[],this.extraw=0,this.w=0,this.right=[],this.invisible=!1,this.bottom=void 0,this.top=void 0,this.type=n,this.fixed={w:0,t:void 0,b:void 0},this.specialY={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}};we.prototype.getFixedCoords=function(){return{x:this.x,w:this.fixed.w,t:this.fixed.t,b:this.fixed.b}};we.prototype.addExtra=function(e){this.fixed.w=Math.max(this.fixed.w,e.dx+e.w),this.fixed.t===void 0?this.fixed.t=e.top:this.fixed.t=Math.max(this.fixed.t,e.top),this.fixed.b===void 0?this.fixed.b=e.bottom:this.fixed.b=Math.min(this.fixed.b,e.bottom),e.dx<this.extraw&&(this.extraw=e.dx),this.extra[this.extra.length]=e,this._addChild(e)};we.prototype.addHead=function(e){e.dx<this.extraw&&(this.extraw=e.dx),this.heads[this.heads.length]=e,this.addRight(e)};we.prototype.addRight=function(e){this.fixed.w=Math.max(this.fixed.w,e.dx+e.w),e.top!==void 0&&(this.fixed.t===void 0?this.fixed.t=e.top:this.fixed.t=Math.max(this.fixed.t,e.top)),e.bottom!==void 0&&(this.fixed.b===void 0?this.fixed.b=e.bottom:this.fixed.b=Math.min(this.fixed.b,e.bottom)),e.dx+e.w>this.w&&(this.w=e.dx+e.w),this.right[this.right.length]=e,this._addChild(e)};we.prototype.addFixed=function(e){this._addChild(e)};we.prototype.addFixedX=function(e){this._addChild(e)};we.prototype.addCentered=function(e){var t=e.w/2;-t<this.extraw&&(this.extraw=-t),this.extra[this.extra.length]=e,e.dx+t>this.w&&(this.w=e.dx+t),this.right[this.right.length]=e,this._addChild(e)};we.prototype.setLimit=function(e,t){t[e]&&(this.specialY[e]?this.specialY[e]=Math.max(this.specialY[e],t[e]):this.specialY[e]=t[e])};we.prototype._addChild=function(e){var t=!0;this.abcelem.el_type=="clef"&&e.type=="barNumber"&&(t=!1),e.parent=this,this.children[this.children.length]=e,t&&this.pushTop(e.top),this.pushBottom(e.bottom),this.setLimit("tempoHeightAbove",e),this.setLimit("partHeightAbove",e),this.setLimit("volumeHeightAbove",e),this.setLimit("dynamicHeightAbove",e),this.setLimit("endingHeightAbove",e),this.setLimit("chordHeightAbove",e),this.setLimit("lyricHeightAbove",e),this.setLimit("lyricHeightBelow",e),this.setLimit("chordHeightBelow",e),this.setLimit("volumeHeightBelow",e),this.setLimit("dynamicHeightBelow",e)};we.prototype.pushTop=function(e){e!==void 0&&(this.top===void 0?this.top=e:this.top=Math.max(e,this.top))};we.prototype.pushBottom=function(e){e!==void 0&&(this.bottom===void 0?this.bottom=e:this.bottom=Math.min(e,this.bottom))};we.prototype.setX=function(e){this.x=e;for(var t=0;t<this.children.length;t++)this.children[t].setX(e)};we.prototype.center=function(e,t){var r=(t.x-e.x)/2+e.x;this.x=r-this.w/2;for(var a=0;a<this.children.length;a++)this.children[a].setX(this.x)};we.prototype.setHint=function(){this.hint=!0};we.prototype.highlight=function(e,t){gc.bind(this)(e,t)};we.prototype.unhighlight=function(e,t){bc.bind(this)(e,t)};var Qt=we,Jt=function(t,r,a,n,i){switch(i=i||{},this.x=0,this.c=t,this.dx=r,this.w=a,this.pitch=n,this.scalex=i.scalex||1,this.scaley=i.scaley||1,this.type=i.type||"symbol",this.pitch2=i.pitch2,this.linewidth=i.linewidth,this.klass=i.klass,this.anchor=i.anchor?i.anchor:"middle",this.top=n,this.pitch2!==void 0&&this.pitch2>this.top&&(this.top=this.pitch2),this.bottom=n,this.pitch2!==void 0&&this.pitch2<this.bottom&&(this.bottom=this.pitch2),i.thickness&&(this.top+=i.thickness/2,this.bottom-=i.thickness/2),i.stemHeight&&(i.stemHeight>0?this.top+=i.stemHeight:this.bottom+=i.stemHeight),i.dim&&(this.dim=i.dim),i.position&&(this.position=i.position),this.height=i.height?i.height:4,i.top&&(this.top=i.top),i.bottom&&(this.bottom=i.bottom),i.name?this.name=i.name:this.c?this.name=this.c:this.name=this.type,i.realWidth?this.realWidth=i.realWidth:this.realWidth=this.w,this.centerVertically=!1,this.type){case"debug":this.chordHeightAbove=this.height;break;case"lyric":i.position&&i.position==="below"?this.lyricHeightBelow=this.height:this.lyricHeightAbove=this.height;break;case"chord":i.position&&i.position==="below"?this.chordHeightBelow=this.height:this.chordHeightAbove=this.height;break;case"text":this.pitch===void 0?i.position&&i.position==="below"?this.chordHeightBelow=this.height:this.chordHeightAbove=this.height:this.centerVertically=!0;break;case"part":this.partHeightAbove=this.height;break}};Jt.prototype.getChordDim=function(){if(this.type==="debug"||!this.chordHeightAbove&&!this.chordHeightBelow)return null;var e=0,t=this.type==="chord"?this.realWidth/2:0,r=this.x-t-e,a=r+this.realWidth+e;return{left:r,right:a}};Jt.prototype.invertLane=function(e){this.lane===void 0&&(this.lane=0),this.lane=e-this.lane-1};Jt.prototype.putChordInLane=function(e){this.lane=e,this.chordHeightAbove?this.chordHeightAbove=this.height*1.25*this.lane:this.chordHeightBelow=this.height*1.25*this.lane};Jt.prototype.getLane=function(){return this.lane===void 0?0:this.lane};Jt.prototype.setX=function(e){this.x=e+this.dx};var at=Jt,oi=Qt,jr=at;function mc(e){return e!=null&&e.constructor===Object}function Nr(e,t){for(var r in t)t.hasOwnProperty(r)&&(Array.isArray(t[r])||mc(t[r])||(e[r]=t[r]))}function ci(e){var t=new oi("",0,0,"",0);return Nr(t,e),t.top=0,t.bottom=-1,e.abcelem&&(t.abcelem={},Nr(t.abcelem,e.abcelem),t.abcelem.el_type==="note"&&(t.abcelem.el_type="tabNumber")),e.cloned=t,t}function yc(e,t){var r=ci(e);if(t)for(var a=e.children,n=!0,i=0;i<a.length;i++){var s=a[i],o=new jr("",0,0,0,"");Nr(o,s),n=t.tablature.setRelative(s,o,n),r.children.push(o)}return r}function wc(e,t,r){var a="tab.tiny",n=7.5;e.isTabBig&&(a="tab.big",n=10);var i={el_type:"tab",icon:a,Ypos:n};if(n+=e.tabSymbolOffset,!e.hideTabSymbol){var s=new oi(i,0,0,"symbol",0);s.x=t;var o=new jr(a,0,0,7.5,"tab");o.x=r,s.children.push(o),s.abcelem.el_type=="tab"&&(o.pitch=n)}return s}function xc(e){if(e.extra)for(var t=0;t<e.extra.length;t++){var r=e.extra[t];if(r.type=="lyric")return{bottom:r.bottom,height:r.height}}return null}function li(){this.accidentals=null}function Cc(e){for(var t=0,r=0;r<e.length;r++)e[r].tabNameInfos||t++;return t}function Lr(e,t,r,a,n){var i=a.num;a.note.quarter!=null&&(i=i.toString(),i+=a.note.quarter);var s=e.semantics.stringToPitch(a.str);r.notes.push({num:i,str:a.str,pitch:a.note.emit()});var o={type:"tabNumber"},c=new jr(i,0,0,s+.3,o);return c.x=t,c.isGrace=n,c.isAltered=a.note.isAltered,c}function hi(e,t){var r=0;if(e.extra){for(var a=0;a<e.extra.length;a++)if(e.extra[a].c.indexOf("noteheads")>=0){if(r===t)return e.extra[a].x+e.extra[a].w/2;r++}}return-1}function kc(e){if(e.abcelem){var t=e.abcelem;if(t.rest)return t.gracenotes}return null}function Ra(e,t,r){var a=e.semantics.notesToNumber(t,r);if(a.error)return e.setError(a.error),a;if(a.graces&&a.notes){var n=a.notes.length-1;a.notes[n].graces=a.graces}return a}function _c(e,t,r,a,n){for(var i=0;i<a.length;i++){var s={el_type:"note",startChar:r.abcelem.startChar,endChar:r.abcelem.endChar,notes:[],grace:!0},o=hi(r,i),c=a[i],f=Lr(e,o,s,c,!0);t.children.push(f),n.push(s)}}li.prototype.build=function(e,t,r,a,n,i,s){Cc(t);var o=t[n+a],c=t[s],f=null,u=null;o.children[0].abcelem.el_type!="clef"&&i!="none"&&o.children.splice(0,0,i);for(var l=0;l<o.children.length;l++){var h=o.children[l],d=h.x,p=d;switch(h.isClef&&(c.children.push(wc(e,d,p)),h.abcelem.type.indexOf("-8")>=0&&(e.semantics.clefTranspose=-12),h.abcelem.type.indexOf("+8")>=0&&(e.semantics.clefTranspose=12)),h.type){case"staff-extra key-signature":this.accidentals=h.abcelem.accidentals,e.semantics.accidentals=this.accidentals;break;case"bar":e.semantics.measureAccidentals={};var g=!1;l===o.children.length-1&&(g=!0);var v=yc(h,e);if(v.abcelem.barNumber){delete v.abcelem.barNumber;for(var m=0;m<v.children.length;m++)if(v.children[m].type==="barNumber"){v.children.splice(m,1);break}}v.abcelem.lastBar=g,c.children.push(v),r.push({el_type:h.abcelem.el_type,type:h.abcelem.type,endChar:h.abcelem.endChar,startChar:h.abcelem.startChar,abselem:v});break;case"rest":var y=kc(h);if(y){if(f=Ra(e,null,y),f.error)return;z={el_type:"note",startChar:h.abcelem.startChar,endChar:h.abcelem.endChar,notes:[],grace:!0},_c(e,x,h,f.graces,r)}break;case"note":var x=ci(h);x.x=h.heads[0].x+h.heads[0].w/2,x.lyricDim=xc(h);var b=h.abcelem.pitches,w=h.abcelem.gracenotes;if(x.type="tabNumber",f=Ra(e,b,w),f.error)return;if(f.graces){var C=f.notes.length-1;f.notes[C].graces=f.graces}u={el_type:"note",startChar:h.abcelem.startChar,endChar:h.abcelem.endChar,notes:[]};for(var T=0;T<f.notes.length;T++){var B=f.notes[T];if(B.graces)for(var E=0;E<B.graces.length;E++){var z={el_type:"note",startChar:h.abcelem.startChar,endChar:h.abcelem.endChar,notes:[],grace:!0},F=hi(h,E),O=B.graces[E],R=Lr(e,F,z,O,!0);x.children.push(R),r.push(z)}var Y=Lr(e,x.x+h.heads[T].dx,u,B,!1);x.children.push(Y)}u.notes.length>0&&(u.abselem=x,r.push(u),c.children.push(x));break}}};var Tc=li,Ec=ni,Sc=Tc,Mc=Se;function Ac(){return{tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}}function Bc(e){for(var t=0,r=0;r<e.children.length;r++){var a=e.children[r];a.specialY&&a.specialY.lyricHeightBelow>t&&(t=a.specialY.lyricHeightBelow)}return t}function Nc(e,t,r){var a=e.semantics,n=t.controller.getTextSize,i=a.tabInfos(e),s=a.suppress(e),o=!0;if(s&&(o=!1),o){var c=n.calc(i,"tablabelfont","text instrumentname");return r.tabNameInfos={textSize:{height:c.height,width:c.width},name:i},c.height}return 0}function Lc(e,t){return t[e].isTabStaff?e===t.length-1?!0:!t[e+1].isTabStaff:!1}function Pc(e){for(var t=0,r=0;r<e.length;r++)e[r].isTabStaff||t++;return t}function Dc(e,t){for(var r=t;r>=0;r--)if(!e[r].isTabStaff)return r;return-1}function Ic(e){for(var t=0;t<e.length;t++)if(e[t].isTabStaff){var r=Dc(e,t);e[t].hasStaff=e[r],e[r].hasTab||(e[r].hasTab=[]),e[r].hasTab.push(e[t])}}function Fc(e,t){return Pc(e)===1&&t.voices.length>1}function Oc(e,t){for(var r=0,a=0,n=!0,i=0;n;){if(!t[r])return-1;if(t[r].isTabStaff||(i=t[r].voices.length),t[r].isTabStaff){if(a++,Lc(r,t)&&a<i)return r+1}else if(a=0,r>=e&&(r+1==t.length||!t[r+1].isTabStaff))return r+1;if(r++,r>t.length)return-1}}function Hc(e,t){for(var r=t;r>=0;r--)if(!e[r].isTabStaff)return e[r];return null}function zc(e,t){var r=e[t],a=r.children[0].abcelem;return a.el_type==="clef"?null:t==0?"none":e[t-1].children[0]}function $c(e,t,r,a){var n=new Sc,i={clef:{type:"TAB"}},s=e.linePitch*e.nbLines,o=r.staff;if(o){var c=o[0];if(c&&c.clef&&c.clef.stafflines==0){e.setError("No tablatures when stafflines=0");return}o.splice(o.length,0,i)}var f=r.staffGroup,u=f.voices,l=u[0],h=Bc(l),d=3,p=a,g=f.staffs[p],v=s+d-g.bottom-h;g.isTabStaff&&(v=g.top);var m={bottom:-1,isTabStaff:!0,specialY:Ac(),lines:e.nbLines,linePitch:e.linePitch,dy:.15,top:v},y=Oc(a,f.staffs);if(y!==-1){m.parentIndex=y-1,f.staffs.splice(y,0,m),f.height+=s+d;var x=Hc(f.staffs,y),b=1;Fc(f.staffs,x)&&(b=x.voices.length),i.voices=[];for(var w=0;w<b;w++){var C=new Ec(0,0);w>0&&(C.duplicate=!0);var T=Nc(e,t,C)/Mc.STEP;T=Math.max(T,1),f.staffs[a].top+=1,f.height+=T,C.staff=m;var B=u.length;u.splice(u.length,0,C);var E=zc(u,w+a);i.voices[w]=[],n.build(e,u,i.voices[w],w,a,E,B)}Ic(f.staffs)}}var Rc=$c,Gc={__:-2,_:-1,"_/":-.5,"=":0,"":0,"^/":.5,"^":1,"^^":2},Pr=["C","-","D","-","E","F","-","G","-","A","-","B","c","-","d","-","e","f","-","g","-","a","-","b"];function Yc(e){var t=e.match(/([_^\/]*)([ABCDEFGabcdefg])(,*)('*)/);if(t&&t.length===5){var r=Gc[t[1]],a=Pr.indexOf(t[2]),n=t[4].length-t[3].length;return 48+a+r+n*12}return 0}function qc(e){e=parseInt(e,10);var t=Math.floor(e/12),r=e%12,a=Pr[r];if(a==="-"&&(a="^"+Pr[r-1]),t>4)for(a=a.toLowerCase(),t-=5;t>0;)a+="'",t--;else for(;t<4;)a+=",",t++;return a}var fi={noteToMidi:Yc,midiToNote:qc},{noteToMidi:Wc,midiToNote:Kr}=fi;function ze(e,t){var r=Wc(e);t&&(r+=t);var a=Kr(r),n=!1,i=!1,s=!1,o=null,c=null,f=!1,u=0;e.startsWith("_")?(n=!0,u=-1,e[1]=="/"?(n=!1,c="v",u=0):e[1]=="_"&&(f=!0,u-=1)):e.startsWith("^")?(i=!0,u=1,e[1]=="/"?(i=!1,c="^",u=0):e[1]=="^"&&(f=!0,u+=1)):e.startsWith("=")&&(o=!0,u=0),s=n||i||c!=null,(s||o)&&(c!=null||f?a=e.slice(2):a=e.slice(1));var l=(a.match(/,/g)||[]).length,h=(a.match(/'/g)||[]).length;this.pitch=r,this.pitchAltered=0,this.name=a,this.acc=u,this.isSharp=i,this.isKeySharp=!1,this.isDouble=f,this.isAltered=s,this.isFlat=n,this.isKeyFlat=!1,this.natural=o,this.quarter=c,this.isLower=this.name==this.name.toLowerCase(),this.name=this.name[0].toUpperCase(),this.hasComma=l,this.isQuoted=h}function Xc(e){var t=e.name,r=new ze(t);return r.pitch=e.pitch,r.hasComma=e.hasComma,r.isLower=e.isLower,r.isQuoted=e.isQuoted,r.isSharp=e.isSharp,r.isKeySharp=e.isKeySharp,r.isFlat=e.isFlat,r.isKeyFlat=e.isKeyFlat,r}ze.prototype.sameNoteAs=function(e){return e.pitch===this.pitch};ze.prototype.isLowerThan=function(e){return e.pitch>this.pitch};ze.prototype.checkKeyAccidentals=function(e,t){if(!(this.isAltered||this.natural)){if(t[this.name.toUpperCase()])switch(t[this.name.toUpperCase()]){case"__":this.acc=-2,this.pitchAltered=-2;return;case"_":this.acc=-1,this.pitchAltered=-1;return;case"=":this.acc=0,this.pitchAltered=0;return;case"^":this.acc=1,this.pitchAltered=1;return;case"^^":this.acc=2,this.pitchAltered=2;return}else if(e)for(var r=this.name,a=0;a<e.length;a++){var n=e[a];r==n.note.toUpperCase()&&(n.acc=="flat"&&(this.acc=-1,this.isKeyFlat=!0,this.pitchAltered=-1),n.acc=="sharp"&&(this.acc=1,this.isKeySharp=!0,this.pitchAltered=1))}}};ze.prototype.getAccidentalEquiv=function(){var e=Xc(this);return e.isSharp||e.isKeySharp?(e=e.nextNote(),e.isFlat=!0,e.isSharp=!1,e.isKeySharp=!1):(e.isFlat||e.isKeyFlat)&&(e=e.prevNote(),e.isSharp=!0,e.isFlat=!1,e.isKeyFlat=!1),e};ze.prototype.nextNote=function(){var e=Kr(this.pitch+1+this.pitchAltered);return new ze(e)};ze.prototype.prevNote=function(){var e=Kr(this.pitch-1+this.pitchAltered);return new ze(e)};ze.prototype.emitNoAccidentals=function(){var e=this.name;this.isLower&&(e=e.toLowerCase());for(var t=0;t<this.isQuoted;t++)e+="'";for(var r=0;r<this.hasComma;r++)e+=",";return e};ze.prototype.emit=function(){var e=this.name;(this.isSharp||this.isKeySharp)&&(e="^"+e,this.isDouble&&(e="^"+e)),(this.isFlat||this.isKeyFlat)&&(e="_"+e,this.isDouble&&(e="_"+e)),this.quarter&&(this.quarter=="^"?e="^/"+e:e="_/"+e),this.natural&&(e="="+e);for(var t=1;t<=this.hasComma;t++)e+=",";if(this.isLower){e=e.toLowerCase();for(var r=1;r<=this.isQuoted;r++)e+="'"}return e};var ui=ze,Ga=ui,Ya=["A","B","C","D","E","F","G"];function Uc(e,t){var r=new Ga(e),a=new Ga(t);if(a.isLowerThan(r)){var n=r.emit(),i=a.emit();return{error:"Invalid string Instrument tuning : "+i+" string lower than "+n+" string"}}var s=[],o=Ya.indexOf(r.name),c=Ya.indexOf(a.name);if(o==-1||c==-1)return s;for(var f=!1;!f;)s.push(r.emit()),r=r.nextNote(),r.sameNoteAs(a)&&(f=!0);return s}var Vc=Uc;const{noteToMidi:jc}=fi;var j0=ui,Kc=Vc;function Qc(e){var t=null,r=e.tuning;if(e.capo>0){t=[];for(var a=0;a<r.length;a++){for(var n=new j0(r[a]),i=0;i<e.capo;i++)n=n.nextNote();t[a]=n.emit()}}return t}function Jc(e){var t=[],r=e.tuning;e.capo>0&&(r=e.capoTuning);for(var a=r.length-1,n=0;n<r.length;n++){var i=e.highestNote;n!=r.length-1&&(i=r[n+1]);var s=Kc(r[n],i);if(s.error)return s;t[a--]=s}return t}function Zc(e){var t=[];t[0]=[];for(var r=e.strings,a=1;a<r.length;a++)t[a]=r[a-1];return t}function e1(e,t){for(var r=0;r<t.length-1;r++){var a=t[r],n=t[r+1];if(a.str==n.str){if(a.str==e.strings.length-1){a.num="?",n.num="?";return}n.num<a.num?(n.str++,n=qa(e,n.note,n.str,e.secondPos,e.strings[n.str].length)):(a.str++,a=qa(e,a.note,a.str,e.secondPos,e.strings[a.str].length)),t[r]=a,t[r+1]=n}}return null}function t1(e,t){for(var r=[],a=0;a<t.length;a++)if(!t[a].endTie){var n=new j0(t[a].name,e.clefTranspose);n.checkKeyAccidentals(e.accidentals,e.measureAccidentals);var i=Dr(e,n);r.push(i)}return e1(e,r),r}function qa(e,t,r,a,n){var i=e.strings;t.checkKeyAccidentals(e.accidentals,e.measureAccidentals),a&&(i=a);var s=t.emitNoAccidentals(),o=i[r].indexOf(s),c=t.acc;if(o!=-1){if(a&&(o+=n),(t.isFlat||t.acc==-1)&&o==0){var f=t.getAccidentalEquiv();r++,o=i[r].indexOf(f.emit()),c=0}return{num:o+c,str:r,note:t}}return null}function Dr(e,t){if(t.isAltered||t.natural){var r;t.isFlat?t.isDouble?r="__":r="_":t.isSharp?t.isDouble?r="^^":r="^":t.natural&&(r="="),e.measureAccidentals[t.name.toUpperCase()]=r}for(var a=e.stringPitches.length-1;a>=0;a--)if(t.pitch+t.pitchAltered>=e.stringPitches[a]){var n=t.pitch+t.pitchAltered-e.stringPitches[a];return t.quarter==="^"?n-=.5:t.quarter==="v"&&(n+=.5),{num:Math.round(n),str:e.stringPitches.length-1-a,note:t}}return{num:"?",str:e.stringPitches.length-1,note:t}}Zt.prototype.stringToPitch=function(e){var t=5.3,r=this.strings.length-1;return t+(r-e)*this.linePitch};function Wa(e,t){var r={num:"?",str:0,note:t};e.push(r),e.error=t.emit()+": unexpected note for instrument"}Zt.prototype.notesToNumber=function(e,t){var r,a,n=null,i=null;if(e&&(i=[],e.length>1?(i=t1(this,e),i.error&&(n=i.error)):e[0].endTie||(r=new j0(e[0].name,this.clefTranspose),r.checkKeyAccidentals(this.accidentals,this.measureAccidentals),a=Dr(this,r),a?i.push(a):(Wa(i,r),n=i.error))),n)return i;var s=null;if(t){s=[];for(var o=0;o<t.length;o++)r=new j0(t[o].name,this.clefTranspose),r.checkKeyAccidentals(this.accidentals,this.measureAccidentals),a=Dr(this,r),a?s.push(a):(Wa(s,r),n=i.error)}return{notes:i,graces:s,error:n}};Zt.prototype.toString=function(){for(var e=[],t=0;t<this.tuning.length;t++){var r=this.tuning[t].replaceAll(",","").replaceAll("'","").toUpperCase();r[0]==="_"?r=r[1]+"b ":r[0]==="^"&&(r=r[1]+"# "),e.push(r)}return e.join("")};Zt.prototype.tabInfos=function(e){var t=e.params.label;if(t){var r=t.indexOf("%T"),a="";return r!=-1&&(a=this.toString(),e.capo>0&&(a+=" capo:"+e.capo),t=t.replace("%T",a)),t}return""};Zt.prototype.suppress=function(e){var t=e.params.suppress;return!!t};function Zt(e){var t=e.tuning,r=e.capo,a=e.params.highestNote;this.linePitch=e.linePitch,this.highestNote="a'",a&&(this.highestNote=a),this.measureAccidentals={},this.capo=0,r&&(this.capo=parseInt(r,10)),this.transpose=e.transpose?e.transpose:0,this.tuning=t,this.stringPitches=[];for(var n=0;n<this.tuning.length;n++){var i=jc(this.tuning[n])+this.capo;this.stringPitches.push(i)}if(this.capo>0&&(this.capoTuning=Qc(this)),this.strings=Jc(this),this.strings.error){e.setError(this.strings.error),e.inError=!0;return}this.secondPos=Zc(this)}var r1=Zt,a1=hc,n1=Rc,i1=r1;er.prototype.init=function(e,t,r,a){this.tune=e,this.params=r,this.tuneNumber=t,this.inError=!1,this.abcTune=e,this.linePitch=3,this.nbLines=a.defaultTuning.length,this.isTabBig=a.isTabBig,this.tabSymbolOffset=a.tabSymbolOffset,this.capo=r.capo,this.transpose=r.visualTranspose,this.hideTabSymbol=r.hideTabSymbol,this.tablature=new a1(this.nbLines,this.linePitch);var n=r.tuning;n||(n=a.defaultTuning),this.tuning=n,this.semantics=new i1(this)};er.prototype.setError=function(e){e&&(this.error=e,this.inError=!0,this.tune.warnings?this.tune.warnings.push(e):this.tune.warnings=[e])};er.prototype.render=function(e,t,r){this.inError||this.tablature.bypass(t)||n1(this,e,t,r)};function er(){}var s1=function(){return{name:"StringTab",tablature:er}},o1=s1,c1=o1,l1={violin:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},fiddle:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},mandolin:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},guitar:{name:"StringTab",defaultTuning:["E,","A,","D","G","B","e"],isTabBig:!0,tabSymbolOffset:0},fiveString:{name:"StringTab",defaultTuning:["C,","G,","D","A","e"],isTabBig:!1,tabSymbolOffset:-.95}},h1={inited:!1,plugins:{},register:function(e){var t=e.name,r=e.tablature;this.plugins[t]=r},setError:function(e,t){e.warnings?e.warning.push(t):e.warnings=[t]},preparePlugins:function(e,t,r){this.inited||(this.register(new c1),this.inited=!0);var a=null;if(r.tablature){var n=r.tablature;a=[];for(var i=0;i<n.length;i++){var s=n[i],o=s.instrument;if(o==null)return this.setError(e,"tablature 'instrument' is missing"),a;var c=l1[o],f=null;if(c&&(f=this.plugins[c.name]),f){r.visualTranspose!=0&&(s.visualTranspose=r.visualTranspose),s.abcSrc=r.tablature.abcSrc;var u={classz:f,tuneNumber:t,params:s,instance:null,tabType:c};a.push(u)}else if(o==="")a.push(null);else return this.setError(e,"Undefined tablature plugin: "+o),a}}return a},layoutTablatures:function(t,r){var a=r.tablatures,n=0;if(a&&a.length>0)for(var i=a.length,s=0;s<i;++s)a[s]&&a[s].params.firstStaffOnly&&(a[s].params.suppress=!1);for(var o=0;o<r.lines.length;o++){var c=r.lines[o];if(c.staff&&n++,n>1&&a&&a.length>0)for(var i=a.length,s=0;s<i;++s)a[s].params.firstStaffOnly&&(a[s].params.suppress=!0);var f=c.staff;if(f){for(var u=f.length,l=0;l<f.length;l++)if(a[l]&&l<u){var h=a[l];h.instance==null&&(h.instance=new h.classz,h.instance.init(r,h.tuneNumber,h.params,h.tabType)),h.instance.render(t,c,l)}}}}},di=h1,f1=ai,u1=lc,d1=di,ct={};(function(){ct.numberOfTunes=function(t){var r=t.split(`
24
- X:`),a=r.length;return a===0&&(a=1),a};var e=ct.TuneBook=function(t){var r=u1(t);this.header=r.header,this.tunes=r.tunes};e.prototype.getTuneById=function(t){for(var r=0;r<this.tunes.length;r++)if(this.tunes[r].id===""+t)return this.tunes[r];return null},e.prototype.getTuneByTitle=function(t){for(var r=0;r<this.tunes.length;r++)if(this.tunes[r].title===t)return this.tunes[r];return null},ct.parseOnly=function(t,r){for(var a=ct.numberOfTunes(t),n=[],i=0;i<a;i++)n.push(1);function s(){}return ct.renderEngine(s,n,t,r)},ct.renderEngine=function(t,r,a,n){var i=[],s=function(g){return g&&!g.propertyIsEnumerable("length")&&typeof g=="object"&&typeof g.length=="number"};if(!(r===void 0||a===void 0)){s(r)||(r=[r]),n===void 0&&(n={});for(var o=n.startingTune?parseInt(n.startingTune,10):0,c=new e(a),f=new f1,u=0;u<r.length;u++){var l=r[u];if(l==="*"||typeof l=="string"&&(l=document.getElementById(l)),l)if(o>=0&&o<c.tunes.length){f.parse(c.tunes[o].abc,n,c.tunes[o].startPos-c.header.length);var h=f.getTune();n.tablature&&(h.tablatures=d1.preparePlugins(h,o,n));var d=f.getWarnings();d&&(h.warnings=d);var p=t(l,h,u,c.tunes[o].abc);i.push(p||h)}else l.innerHTML&&(l.innerHTML="");o++}return i}},ct.extractMeasures=function(t){for(var r=[],a=new e(t),n=0;n<a.tunes.length;n++){for(var i=a.tunes[n],s=i.abc.split("K:"),o=s[1].split(`
25
- `),c=s[0]+"K:"+o[0]+`
26
- `,f=null,u=null,l=null,h=[],d=!1,p=ct.parseOnly(i.abc)[0],g=p.getPickupLength()>0,v=0;v<p.lines.length;v++){var m=p.lines[v];if(m.staff)for(var y=0;y<1;y++)for(var x=m.staff[y],b=0;b<1;b++)for(var w=x.voices[b],C=0;C<w.length;C++){var T=w[C];if(l===null&&T.startChar>=0&&(l=T.startChar,T.chord===void 0?u=f:u=null),T.chord&&(f=T),T.el_type==="bar"){if(d){var B=i.abc.substring(l,T.endChar),E={abc:B};f=u&&u.chord&&u.chord.length>0?u.chord[0].name:null,f&&(E.lastChord=f),T.startEnding&&(E.startEnding=T.startEnding),T.endEnding&&(E.endEnding=T.endEnding),h.push(E),l=null,d=!1}}else T.el_type==="note"&&(d=!0)}}r.push({header:c,measures:h,hasPickup:g})}return r}})();var tr=ct,Xa=Wn,{relativeMajor:Ua,transposeKey:vr,relativeMode:Va,isLegalMode:p1}=qn,ja=Yn,pi;(function(){pi=function(m,y,x){if(y==="TEST")return{keyAccidentals:Xa,relativeMajor:Ua,transposeKey:vr,relativeMode:Va,transposeChordName:ja};x=parseInt(x,10);var b=[],w;for(w=0;w<y.length;w++)b=b.concat(e(m,y[w],x));b=b.sort(function(B,E){return E.start-B.start});var C=m.split("");for(w=0;w<b.length;w++){var T=b[w];C.splice(T.start,T.end-T.start,T.note)}return C.join("")};function e(m,y,x){var b=[],w=y.getKeySignature();if(w.root==="Hp"||w.root==="HP")return b;b=b.concat(t(m,x));for(var C=0;C<y.lines.length;C++){var T=y.lines[C].staff;if(T)for(var B=0;B<T.length;B++){var E=T[B];E.clef.type!=="perc"&&(b=b.concat(r(m,E.voices,E.key,x)))}}return b}function t(m,y){for(var x=[],b=m.split("K:"),w=b[0].length,C=1;C<b.length;C++){var T=b[C],B=T.match(/^( *)([A-G])([#b]?)( ?)(\w*)/);if(B){var E=w+2+B[1].length,z=p1(B[5])?B[5]:"",F=B[2]+B[3]+B[4]+z,O=c({root:B[2],acc:B[3],mode:z},y),R=O.root+O.acc+B[4]+O.mode;x.push({start:E,end:E+F.length,note:R})}w+=T.length+2}return x}function r(m,y,x,b){for(var w=[],C=c(x,b),T=0;T<y.length;T++)w=w.concat(i(m,y[T],x.root,a(x),C,b));return w}function a(m){for(var y={},x=0;x<m.accidentals.length;x++){var b=m.accidentals[x];b.acc==="flat"?y[b.note.toUpperCase()]="_":b.acc==="sharp"&&(y[b.note.toUpperCase()]="^")}return y}function n(m,y,x){var b=s.indexOf(m.root)-s.indexOf(y);return y==="none"&&(b=s.indexOf(m.root)),b===0?x>2?b+=7:x===-12&&(b-=7):x>0&&b<0?b+=7:x<0&&b>0&&(b-=7),x>12?b+=7:x<-12&&(b-=7),b}function i(m,y,x,b,w,C){for(var T=[],B=n(w,x,C),E={},z={},F=0;F<y.length;F++){var O=y[F];if(O.chord)for(var R=0;R<O.chord.length;R++){var Y=O.chord[R];if(Y.position==="default"){var K=w.accidentals.length&&w.accidentals[0].acc==="flat",P=ja(Y.name,C,K,!0);P=P.replace(/♭/g,"b").replace(/♯/g,"#"),P!==Y.name&&T.push(g(m,O.startChar,O.endChar,P))}}if(O.el_type==="note"&&O.pitches){for(var k=d(m,O.startChar,O.endChar),_=0;_<k.length;_++){var L=h(k[_].note,x,b,E);L.acc&&(E[L.name.toUpperCase()]=L.acc);var A=f(L,w,B,z);A.acc&&(z[A.upper]=A.acc),T.push({note:A.acc+A.name,start:k[_].index,end:k[_].index+k[_].note.length})}if(O.gracenotes)for(var G=0;G<O.gracenotes.length;G++){var V=h(O.gracenotes[G].name,x,b,E);V.acc&&(E[V.name.toUpperCase()]=V.acc);var Q=f(V,w,B,E);Q.acc&&(z[Q.upper]=Q.acc),T.push(p(m,O.startChar,O.endChar,Q.acc+Q.name,G))}}else O.el_type==="bar"?(E={},z={}):O.el_type==="keySignature"&&(x=O.root,b=a(O),w=c(O,C),B=n(w,x,C))}return T}var s="CDEFGAB",o=[",,,,",",,,",",,",",","","'","''","'''","''''"];function c(m,y){if(m.root==="none")return{root:vr("C",y),mode:"",acc:"",accidentals:[]};var x=Ua(m.root+m.acc+m.mode),b=vr(x,y),w=Va(b,m.mode),C=Xa(b);return{root:w[0],mode:m.mode,acc:w.length>1?w[1]:"",accidentals:C}}function f(m,y,x,b){for(var w=m.pitch,C=s.indexOf(m.name),T=s.indexOf(y.root),B=(T+w)%7,E=C+x,z=m.oct;E>6;)z++,E-=7;for(;E<0;)z--,E+=7;for(var F=s[B],O="",R=m.adj,Y="=",K=0;K<y.accidentals.length;K++)if(y.accidentals[K].note.toLowerCase()===F.toLowerCase()){R=R+(y.accidentals[K].acc==="flat"?-1:1),Y=y.accidentals[K].acc==="flat"?"_":"^";break}var P;switch(R){case-2:O="__";break;case-1:O="_";break;case 0:O="=";break;case 1:O="^";break;case 2:O="^^";break;case-3:return P={},P.pitch=m.pitch-1,P.oct=m.oct,P.name=s[s.indexOf(m.name)-1],P.name||(P.name="B",P.oct--),P.name==="B"||P.name==="E"?P.adj=m.adj+1:P.adj=m.adj+2,f(P,y,x+1,b);case 3:return P={},P.pitch=m.pitch+1,P.oct=m.oct,P.name=s[s.indexOf(m.name)+1],P.name||(P.name="C",P.oct++),P.name==="C"||P.name==="F"?P.adj=m.adj-1:P.adj=m.adj-2,f(P,y,x+1,b)}switch((b[F]===O||!b[F]&&O===Y)&&!m.courtesy&&(O=""),z){case 0:F=F+",,,";break;case 1:F=F+",,";break;case 2:F=F+",";break;case 4:F=F.toLowerCase();break;case 5:F=F.toLowerCase()+"'";break;case 6:F=F.toLowerCase()+"''";break;case 7:F=F.toLowerCase()+"'''";break;case 8:F=F.toLowerCase()+"''''";break}return z>4&&(F=F.toLowerCase()),{acc:O,name:F,upper:F.toUpperCase()}}var u=/([_^=]*)([A-Ga-g])([,']*)/,l=/([_^=]*[A-Ga-g][,']*)?(\d*\/*\d*)?([\>\<\-\)]*)?/;function h(m,y,x,b){var w=y==="none"?0:s.indexOf(y),C=m.match(u),T=C[2].toUpperCase(),B=s.indexOf(T)-w;B<0&&(B+=7);var E=o.indexOf(C[3]);T===C[2]&&E--;var z=b[T]||x[T]||"=";return{acc:C[1],name:T,pitch:B,oct:E,adj:v(C[1],x[T],b[T]),courtesy:C[1]===z}}function d(m,y,x){for(var b=m.substring(y,x),w,C=[],T=/("[^"]+")+/g;(w=T.exec(b))!==null;)C.push({start:T.lastIndex-w[0].length,end:T.lastIndex});for(var B=/(![^!]+!)+/g;(w=B.exec(b))!==null;)C.push({start:B.lastIndex-w[0].length,end:B.lastIndex});for(var E=[],z=/([_^=]*)([A-Ga-g])([,']*)/g;(w=z.exec(b))!==null;){for(var F=!1,O=0;O<C.length;O++)z.lastIndex>=C[O].start&&z.lastIndex<=C[O].end&&(F=!0);F||E.push({note:w[0],index:y+z.lastIndex-w[0].length})}return E}function p(m,y,x,b,w){var C=m.substring(y,x),T=/\{/,B=/\}/,E=/([^\{]*)/,z=/(\/*)/,F=C.match(new RegExp(E.source+T.source+z.source+l.source+z.source+l.source+z.source+l.source+z.source+l.source+z.source+l.source+z.source+l.source+z.source+l.source+z.source+l.source+B.source));if(F){for(var O=1+F[1].length,R=0;R<w;R++)F[R*3+2]&&(O+=F[R*3+2].length),F[R*3+3]&&(O+=F[R*3+3].length),F[R*3+4]&&(O+=F[R*3+4].length),F[R*3+5]&&(O+=F[R*3+5].length);F[w*3+2]&&(O+=F[R*3+2].length),y+=O;var Y=F[w*3+3]?F[w*3+3].length:0;Y+=F[w*3+4]?F[w*3+4].length:0,Y+=F[w*3+5]?F[w*3+5].length:0,x=y+Y}return{start:y,end:x,note:b}}function g(m,y,x,b){var w=m.substring(y,x).match(/([^"]+)?(".+")+/);return w[1]&&(y+=w[1].length),x=y+w[2].length,{start:y+1,end:x-1,note:b}}function v(m,y,x){if(!m&&x&&(m=x),!m)return 0;switch(y){case void 0:switch(m){case"__":return-2;case"_":return-1;case"=":return 0;case"^":return 1;case"^^":return 2;default:return 0}case"_":switch(m){case"__":return-1;case"_":return 0;case"=":return 1;case"^":return 2;case"^^":return 3;default:return 0}case"^":switch(m){case"__":return-3;case"_":return-2;case"=":return-1;case"^":return 0;case"^^":return 1;default:return 0}}return 0}})();var v1=pi,Dt=function(t,r,a,n){this.type="BeamElem",this.isflat=!!a,this.isgrace=!!(r&&r==="grace"),this.forceup=!!(this.isgrace||r&&r==="up"),this.forcedown=!!(r&&r==="down"),this.elems=[],this.total=0,this.average=6,this.allrests=!0,this.stemHeight=t,this.beams=[],n&&n.duration?(this.duration=n.duration,n.startTriplet&&(this.duration*=n.tripletMultiplier),this.duration=Math.round(this.duration*1e3)/1e3):this.duration=0};Dt.prototype.setHint=function(){this.hint=!0};Dt.prototype.runningDirection=function(e){var t=e.averagepitch;t!==void 0&&(this.total=Math.round(this.total+t),this.count||(this.count=0),this.count++)};Dt.prototype.add=function(e){var t=e.abcelem.averagepitch;t!==void 0&&(e.abcelem.rest||(this.allrests=!1),e.beam=this,this.elems.push(e),this.total=Math.round(this.total+t),(this.min===void 0||e.abcelem.minpitch<this.min)&&(this.min=e.abcelem.minpitch),(this.max===void 0||e.abcelem.maxpitch>this.max)&&(this.max=e.abcelem.maxpitch))};Dt.prototype.addBeam=function(e){this.beams.push(e)};Dt.prototype.setStemDirection=function(){if(this.average=vi(this.total,this.count),this.forceup)this.stemsUp=!0;else if(this.forcedown)this.stemsUp=!1;else{var e=6;this.stemsUp=this.average<e}delete this.count,this.total=0};Dt.prototype.calcDir=function(){if(this.average=vi(this.total,this.elems.length),this.forceup)this.stemsUp=!0;else if(this.forcedown)this.stemsUp=!1;else{var e=6;this.stemsUp=this.average<e}for(var t=this.stemsUp?"up":"down",r=0;r<this.elems.length;r++)for(var a=0;a<this.elems[r].heads.length;a++)this.elems[r].heads[a].stemDir=t};function vi(e,t){return t?e/t:0}var g1=Dt,C0=function(t,r){this.startVoice=t,this.type=r};C0.prototype.setBottomStaff=function(e){this.endVoice=e,this.startVoice.header&&!this.endVoice.header&&(this.header=this.startVoice.header,delete this.startVoice.header)};C0.prototype.continuing=function(e){this.lastContinuedVoice=e};C0.prototype.getWidth=function(){return 10};C0.prototype.isStartVoice=function(e){return!!(this.startVoice&&this.startVoice.staff&&this.startVoice.staff.voices.length>0&&this.startVoice.staff.voices[0]===e)};var b1=C0,m1=Se,Le={0:{d:[["M",4.83,-14.97],["c",.33,-.03,1.11,0,1.47,.06],["c",1.68,.36,2.97,1.59,3.78,3.6],["c",1.2,2.97,.81,6.96,-.9,9.27],["c",-.78,1.08,-1.71,1.71,-2.91,1.95],["c",-.45,.09,-1.32,.09,-1.77,0],["c",-.81,-.18,-1.47,-.51,-2.07,-1.02],["c",-2.34,-2.07,-3.15,-6.72,-1.74,-10.2],["c",.87,-2.16,2.28,-3.42,4.14,-3.66],["z"],["m",1.11,.87],["c",-.21,-.06,-.69,-.09,-.87,-.06],["c",-.54,.12,-.87,.42,-1.17,.99],["c",-.36,.66,-.51,1.56,-.6,3],["c",-.03,.75,-.03,4.59,0,5.31],["c",.09,1.5,.27,2.4,.6,3.06],["c",.24,.48,.57,.78,.96,.9],["c",.27,.09,.78,.09,1.05,0],["c",.39,-.12,.72,-.42,.96,-.9],["c",.33,-.66,.51,-1.56,.6,-3.06],["c",.03,-.72,.03,-4.56,0,-5.31],["c",-.09,-1.47,-.27,-2.37,-.6,-3.03],["c",-.24,-.48,-.54,-.78,-.93,-.9],["z"]],w:10.78,h:14.959},1:{d:[["M",3.3,-15.06],["c",.06,-.06,.21,-.03,.66,.15],["c",.81,.39,1.08,.39,1.83,.03],["c",.21,-.09,.39,-.15,.42,-.15],["c",.12,0,.21,.09,.27,.21],["c",.06,.12,.06,.33,.06,5.94],["c",0,3.93,0,5.85,.03,6.03],["c",.06,.36,.15,.69,.27,.96],["c",.36,.75,.93,1.17,1.68,1.26],["c",.3,.03,.39,.09,.39,.3],["c",0,.15,-.03,.18,-.09,.24],["c",-.06,.06,-.09,.06,-.48,.06],["c",-.42,0,-.69,-.03,-2.1,-.24],["c",-.9,-.15,-1.77,-.15,-2.67,0],["c",-1.41,.21,-1.68,.24,-2.1,.24],["c",-.39,0,-.42,0,-.48,-.06],["c",-.06,-.06,-.06,-.09,-.06,-.24],["c",0,-.21,.06,-.27,.36,-.3],["c",.75,-.09,1.32,-.51,1.68,-1.26],["c",.12,-.27,.21,-.6,.27,-.96],["c",.03,-.18,.03,-1.59,.03,-4.29],["c",0,-3.87,0,-4.05,-.06,-4.14],["c",-.09,-.15,-.18,-.24,-.39,-.24],["c",-.12,0,-.15,.03,-.21,.06],["c",-.03,.06,-.45,.99,-.96,2.13],["c",-.48,1.14,-.9,2.1,-.93,2.16],["c",-.06,.15,-.21,.24,-.33,.24],["c",-.24,0,-.42,-.18,-.42,-.39],["c",0,-.06,3.27,-7.62,3.33,-7.74],["z"]],w:8.94,h:15.058},2:{d:[["M",4.23,-14.97],["c",.57,-.06,1.68,0,2.34,.18],["c",.69,.18,1.5,.54,2.01,.9],["c",1.35,.96,1.95,2.25,1.77,3.81],["c",-.15,1.35,-.66,2.34,-1.68,3.15],["c",-.6,.48,-1.44,.93,-3.12,1.65],["c",-1.32,.57,-1.8,.81,-2.37,1.14],["c",-.57,.33,-.57,.33,-.24,.27],["c",.39,-.09,1.26,-.09,1.68,0],["c",.72,.15,1.41,.45,2.1,.9],["c",.99,.63,1.86,.87,2.55,.75],["c",.24,-.06,.42,-.15,.57,-.3],["c",.12,-.09,.3,-.42,.3,-.51],["c",0,-.09,.12,-.21,.24,-.24],["c",.18,-.03,.39,.12,.39,.3],["c",0,.12,-.15,.57,-.3,.87],["c",-.54,1.02,-1.56,1.74,-2.79,2.01],["c",-.42,.09,-1.23,.09,-1.62,.03],["c",-.81,-.18,-1.32,-.45,-2.01,-1.11],["c",-.45,-.45,-.63,-.57,-.96,-.69],["c",-.84,-.27,-1.89,.12,-2.25,.9],["c",-.12,.21,-.21,.54,-.21,.72],["c",0,.12,-.12,.21,-.27,.24],["c",-.15,0,-.27,-.03,-.33,-.15],["c",-.09,-.21,.09,-1.08,.33,-1.71],["c",.24,-.66,.66,-1.26,1.29,-1.89],["c",.45,-.45,.9,-.81,1.92,-1.56],["c",1.29,-.93,1.89,-1.44,2.34,-1.98],["c",.87,-1.05,1.26,-2.19,1.2,-3.63],["c",-.06,-1.29,-.39,-2.31,-.96,-2.91],["c",-.36,-.33,-.72,-.51,-1.17,-.54],["c",-.84,-.03,-1.53,.42,-1.59,1.05],["c",-.03,.33,.12,.6,.57,1.14],["c",.45,.54,.54,.87,.42,1.41],["c",-.15,.63,-.54,1.11,-1.08,1.38],["c",-.63,.33,-1.2,.33,-1.83,0],["c",-.24,-.12,-.33,-.18,-.54,-.39],["c",-.18,-.18,-.27,-.3,-.36,-.51],["c",-.24,-.45,-.27,-.84,-.21,-1.38],["c",.12,-.75,.45,-1.41,1.02,-1.98],["c",.72,-.72,1.74,-1.17,2.85,-1.32],["z"]],w:10.764,h:14.97},3:{d:[["M",3.78,-14.97],["c",.3,-.03,1.41,0,1.83,.06],["c",2.22,.3,3.51,1.32,3.72,2.91],["c",.03,.33,.03,1.26,-.03,1.65],["c",-.12,.84,-.48,1.47,-1.05,1.77],["c",-.27,.15,-.36,.24,-.45,.39],["c",-.09,.21,-.09,.36,0,.57],["c",.09,.15,.18,.24,.51,.39],["c",.75,.42,1.23,1.14,1.41,2.13],["c",.06,.42,.06,1.35,0,1.71],["c",-.18,.81,-.48,1.38,-1.02,1.95],["c",-.75,.72,-1.8,1.2,-3.18,1.38],["c",-.42,.06,-1.56,.06,-1.95,0],["c",-1.89,-.33,-3.18,-1.29,-3.51,-2.64],["c",-.03,-.12,-.03,-.33,-.03,-.6],["c",0,-.36,0,-.42,.06,-.63],["c",.12,-.3,.27,-.51,.51,-.75],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.36,.33,.57,.75,.6,1.2],["c",0,.21,0,.27,-.06,.42],["c",-.09,.18,-.12,.24,-.54,.54],["c",-.51,.36,-.63,.54,-.6,.87],["c",.06,.54,.54,.9,1.38,.99],["c",.36,.06,.72,.03,.96,-.06],["c",.81,-.27,1.29,-1.23,1.44,-2.79],["c",.03,-.45,.03,-1.95,-.03,-2.37],["c",-.09,-.75,-.33,-1.23,-.75,-1.44],["c",-.33,-.18,-.45,-.18,-1.98,-.18],["c",-1.35,0,-1.41,0,-1.5,-.06],["c",-.18,-.12,-.24,-.39,-.12,-.6],["c",.12,-.15,.15,-.15,1.68,-.15],["c",1.5,0,1.62,0,1.89,-.15],["c",.18,-.09,.42,-.36,.54,-.57],["c",.18,-.42,.27,-.9,.3,-1.95],["c",.03,-1.2,-.06,-1.8,-.36,-2.37],["c",-.24,-.48,-.63,-.81,-1.14,-.96],["c",-.3,-.06,-1.08,-.06,-1.38,.03],["c",-.6,.15,-.9,.42,-.96,.84],["c",-.03,.3,.06,.45,.63,.84],["c",.33,.24,.42,.39,.45,.63],["c",.03,.72,-.57,1.5,-1.32,1.65],["c",-1.05,.27,-2.1,-.57,-2.1,-1.65],["c",0,-.45,.15,-.96,.39,-1.38],["c",.12,-.21,.54,-.63,.81,-.81],["c",.57,-.42,1.38,-.69,2.25,-.81],["z"]],w:9.735,h:14.967},4:{d:[["M",8.64,-14.94],["c",.27,-.09,.42,-.12,.54,-.03],["c",.09,.06,.15,.21,.15,.3],["c",-.03,.06,-1.92,2.31,-4.23,5.04],["c",-2.31,2.73,-4.23,4.98,-4.26,5.01],["c",-.03,.06,.12,.06,2.55,.06],["l",2.61,0],["l",0,-2.37],["c",0,-2.19,.03,-2.37,.06,-2.46],["c",.03,-.06,.21,-.18,.57,-.42],["c",1.08,-.72,1.38,-1.08,1.86,-2.16],["c",.12,-.3,.24,-.54,.27,-.57],["c",.12,-.12,.39,-.06,.45,.12],["c",.06,.09,.06,.57,.06,3.96],["l",0,3.9],["l",1.08,0],["c",1.05,0,1.11,0,1.2,.06],["c",.24,.15,.24,.54,0,.69],["c",-.09,.06,-.15,.06,-1.2,.06],["l",-1.08,0],["l",0,.33],["c",0,.57,.09,1.11,.3,1.53],["c",.36,.75,.93,1.17,1.68,1.26],["c",.3,.03,.39,.09,.39,.3],["c",0,.15,-.03,.18,-.09,.24],["c",-.06,.06,-.09,.06,-.48,.06],["c",-.42,0,-.69,-.03,-2.1,-.24],["c",-.9,-.15,-1.77,-.15,-2.67,0],["c",-1.41,.21,-1.68,.24,-2.1,.24],["c",-.39,0,-.42,0,-.48,-.06],["c",-.06,-.06,-.06,-.09,-.06,-.24],["c",0,-.21,.06,-.27,.36,-.3],["c",.75,-.09,1.32,-.51,1.68,-1.26],["c",.21,-.42,.3,-.96,.3,-1.53],["l",0,-.33],["l",-2.7,0],["c",-2.91,0,-2.85,0,-3.09,-.15],["c",-.18,-.12,-.3,-.39,-.27,-.54],["c",.03,-.06,.18,-.24,.33,-.45],["c",.75,-.9,1.59,-2.07,2.13,-3.03],["c",.33,-.54,.84,-1.62,1.05,-2.16],["c",.57,-1.41,.84,-2.64,.9,-4.05],["c",.03,-.63,.06,-.72,.24,-.81],["l",.12,-.06],["l",.45,.12],["c",.66,.18,1.02,.24,1.47,.27],["c",.6,.03,1.23,-.09,2.01,-.33],["z"]],w:11.795,h:14.994},5:{d:[["M",1.02,-14.94],["c",.12,-.09,.03,-.09,1.08,.06],["c",2.49,.36,4.35,.36,6.96,-.06],["c",.57,-.09,.66,-.06,.81,.06],["c",.15,.18,.12,.24,-.15,.51],["c",-1.29,1.26,-3.24,2.04,-5.58,2.31],["c",-.6,.09,-1.2,.12,-1.71,.12],["c",-.39,0,-.45,0,-.57,.06],["c",-.09,.06,-.15,.12,-.21,.21],["l",-.06,.12],["l",0,1.65],["l",0,1.65],["l",.21,-.21],["c",.66,-.57,1.41,-.96,2.19,-1.14],["c",.33,-.06,1.41,-.06,1.95,0],["c",2.61,.36,4.02,1.74,4.26,4.14],["c",.03,.45,.03,1.08,-.03,1.44],["c",-.18,1.02,-.78,2.01,-1.59,2.7],["c",-.72,.57,-1.62,1.02,-2.49,1.2],["c",-1.38,.27,-3.03,.06,-4.2,-.54],["c",-1.08,-.54,-1.71,-1.32,-1.86,-2.28],["c",-.09,-.69,.09,-1.29,.57,-1.74],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.36,.33,.57,.75,.6,1.2],["c",0,.21,0,.27,-.06,.42],["c",-.09,.18,-.12,.24,-.54,.54],["c",-.18,.12,-.36,.3,-.42,.33],["c",-.36,.42,-.18,.99,.36,1.26],["c",.51,.27,1.47,.36,2.01,.27],["c",.93,-.21,1.47,-1.17,1.65,-2.91],["c",.06,-.45,.06,-1.89,0,-2.31],["c",-.15,-1.2,-.51,-2.1,-1.05,-2.55],["c",-.21,-.18,-.54,-.36,-.81,-.39],["c",-.3,-.06,-.84,-.03,-1.26,.06],["c",-.93,.18,-1.65,.6,-2.16,1.2],["c",-.15,.21,-.27,.3,-.39,.3],["c",-.15,0,-.3,-.09,-.36,-.18],["c",-.06,-.09,-.06,-.15,-.06,-3.66],["c",0,-3.39,0,-3.57,.06,-3.66],["c",.03,-.06,.09,-.15,.15,-.18],["z"]],w:10.212,h:14.997},6:{d:[["M",4.98,-14.97],["c",.36,-.03,1.2,0,1.59,.06],["c",.9,.15,1.68,.51,2.25,1.05],["c",.57,.51,.87,1.23,.84,1.98],["c",-.03,.51,-.21,.9,-.6,1.26],["c",-.24,.24,-.45,.39,-.75,.51],["c",-.21,.06,-.27,.06,-.6,.06],["c",-.33,0,-.39,0,-.6,-.06],["c",-.3,-.12,-.51,-.27,-.75,-.51],["c",-.39,-.36,-.57,-.78,-.57,-1.26],["c",0,-.27,0,-.3,.09,-.42],["c",.03,-.09,.18,-.21,.3,-.3],["c",.12,-.09,.3,-.21,.39,-.27],["c",.09,-.06,.21,-.18,.27,-.24],["c",.06,-.12,.09,-.15,.09,-.33],["c",0,-.18,-.03,-.24,-.09,-.36],["c",-.24,-.39,-.75,-.6,-1.38,-.57],["c",-.54,.03,-.9,.18,-1.23,.48],["c",-.81,.72,-1.08,2.16,-.96,5.37],["l",0,.63],["l",.3,-.12],["c",.78,-.27,1.29,-.33,2.1,-.27],["c",1.47,.12,2.49,.54,3.27,1.29],["c",.48,.51,.81,1.11,.96,1.89],["c",.06,.27,.06,.42,.06,.93],["c",0,.54,0,.69,-.06,.96],["c",-.15,.78,-.48,1.38,-.96,1.89],["c",-.54,.51,-1.17,.87,-1.98,1.08],["c",-1.14,.3,-2.4,.33,-3.24,.03],["c",-1.5,-.48,-2.64,-1.89,-3.27,-4.02],["c",-.36,-1.23,-.51,-2.82,-.42,-4.08],["c",.3,-3.66,2.28,-6.3,4.95,-6.66],["z"],["m",.66,7.41],["c",-.27,-.09,-.81,-.12,-1.08,-.06],["c",-.72,.18,-1.08,.69,-1.23,1.71],["c",-.06,.54,-.06,3,0,3.54],["c",.18,1.26,.72,1.77,1.8,1.74],["c",.39,-.03,.63,-.09,.9,-.27],["c",.66,-.42,.9,-1.32,.9,-3.24],["c",0,-2.22,-.36,-3.12,-1.29,-3.42],["z"]],w:9.956,h:14.982},7:{d:[["M",.21,-14.97],["c",.21,-.06,.45,0,.54,.15],["c",.06,.09,.06,.15,.06,.39],["c",0,.24,0,.33,.06,.42],["c",.06,.12,.21,.24,.27,.24],["c",.03,0,.12,-.12,.24,-.21],["c",.96,-1.2,2.58,-1.35,3.99,-.42],["c",.15,.12,.42,.3,.54,.45],["c",.48,.39,.81,.57,1.29,.6],["c",.69,.03,1.5,-.3,2.13,-.87],["c",.09,-.09,.27,-.3,.39,-.45],["c",.12,-.15,.24,-.27,.3,-.3],["c",.18,-.06,.39,.03,.51,.21],["c",.06,.18,.06,.24,-.27,.72],["c",-.18,.24,-.54,.78,-.78,1.17],["c",-2.37,3.54,-3.54,6.27,-3.87,9],["c",-.03,.33,-.03,.66,-.03,1.26],["c",0,.9,0,1.08,.15,1.89],["c",.06,.45,.06,.48,.03,.6],["c",-.06,.09,-.21,.21,-.3,.21],["c",-.03,0,-.27,-.06,-.54,-.15],["c",-.84,-.27,-1.11,-.3,-1.65,-.3],["c",-.57,0,-.84,.03,-1.56,.27],["c",-.6,.18,-.69,.21,-.81,.15],["c",-.12,-.06,-.21,-.18,-.21,-.3],["c",0,-.15,.6,-1.44,1.2,-2.61],["c",1.14,-2.22,2.73,-4.68,5.1,-8.01],["c",.21,-.27,.36,-.48,.33,-.48],["c",0,0,-.12,.06,-.27,.12],["c",-.54,.3,-.99,.39,-1.56,.39],["c",-.75,.03,-1.2,-.18,-1.83,-.75],["c",-.99,-.9,-1.83,-1.17,-2.31,-.72],["c",-.18,.15,-.36,.51,-.45,.84],["c",-.06,.24,-.06,.33,-.09,1.98],["c",0,1.62,-.03,1.74,-.06,1.8],["c",-.15,.24,-.54,.24,-.69,0],["c",-.06,-.09,-.06,-.15,-.06,-3.57],["c",0,-3.42,0,-3.48,.06,-3.57],["c",.03,-.06,.09,-.12,.15,-.15],["z"]],w:10.561,h:15.093},8:{d:[["M",4.98,-14.97],["c",.33,-.03,1.02,-.03,1.32,0],["c",1.32,.12,2.49,.6,3.21,1.32],["c",.39,.39,.66,.81,.78,1.29],["c",.09,.36,.09,1.08,0,1.44],["c",-.21,.84,-.66,1.59,-1.59,2.55],["l",-.3,.3],["l",.27,.18],["c",1.47,.93,2.31,2.31,2.25,3.75],["c",-.03,.75,-.24,1.35,-.63,1.95],["c",-.45,.66,-1.02,1.14,-1.83,1.53],["c",-1.8,.87,-4.2,.87,-6,.03],["c",-1.62,-.78,-2.52,-2.16,-2.46,-3.66],["c",.06,-.99,.54,-1.77,1.8,-2.97],["c",.54,-.51,.54,-.54,.48,-.57],["c",-.39,-.27,-.96,-.78,-1.2,-1.14],["c",-.75,-1.11,-.87,-2.4,-.3,-3.6],["c",.69,-1.35,2.25,-2.25,4.2,-2.4],["z"],["m",1.53,.69],["c",-.42,-.09,-1.11,-.12,-1.38,-.06],["c",-.3,.06,-.6,.18,-.81,.3],["c",-.21,.12,-.6,.51,-.72,.72],["c",-.51,.87,-.42,1.89,.21,2.52],["c",.21,.21,.36,.3,1.95,1.23],["c",.96,.54,1.74,.99,1.77,1.02],["c",.09,0,.63,-.6,.99,-1.11],["c",.21,-.36,.48,-.87,.57,-1.23],["c",.06,-.24,.06,-.36,.06,-.72],["c",0,-.45,-.03,-.66,-.15,-.99],["c",-.39,-.81,-1.29,-1.44,-2.49,-1.68],["z"],["m",-1.44,8.07],["l",-1.89,-1.08],["c",-.03,0,-.18,.15,-.39,.33],["c",-1.2,1.08,-1.65,1.95,-1.59,3],["c",.09,1.59,1.35,2.85,3.21,3.24],["c",.33,.06,.45,.06,.93,.06],["c",.63,0,.81,-.03,1.29,-.27],["c",.9,-.42,1.47,-1.41,1.41,-2.4],["c",-.06,-.66,-.39,-1.29,-.9,-1.65],["c",-.12,-.09,-1.05,-.63,-2.07,-1.23],["z"]],w:10.926,h:14.989},9:{d:[["M",4.23,-14.97],["c",.42,-.03,1.29,0,1.62,.06],["c",.51,.12,.93,.3,1.38,.57],["c",1.53,1.02,2.52,3.24,2.73,5.94],["c",.18,2.55,-.48,4.98,-1.83,6.57],["c",-1.05,1.26,-2.4,1.89,-3.93,1.83],["c",-1.23,-.06,-2.31,-.45,-3.03,-1.14],["c",-.57,-.51,-.87,-1.23,-.84,-1.98],["c",.03,-.51,.21,-.9,.6,-1.26],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.39,.36,.57,.78,.57,1.26],["c",0,.27,0,.3,-.09,.42],["c",-.03,.09,-.18,.21,-.3,.3],["c",-.12,.09,-.3,.21,-.39,.27],["c",-.09,.06,-.21,.18,-.27,.24],["c",-.06,.12,-.06,.15,-.06,.33],["c",0,.18,0,.24,.06,.36],["c",.24,.39,.75,.6,1.38,.57],["c",.54,-.03,.9,-.18,1.23,-.48],["c",.81,-.72,1.08,-2.16,.96,-5.37],["l",0,-.63],["l",-.3,.12],["c",-.78,.27,-1.29,.33,-2.1,.27],["c",-1.47,-.12,-2.49,-.54,-3.27,-1.29],["c",-.48,-.51,-.81,-1.11,-.96,-1.89],["c",-.06,-.27,-.06,-.42,-.06,-.96],["c",0,-.51,0,-.66,.06,-.93],["c",.15,-.78,.48,-1.38,.96,-1.89],["c",.15,-.12,.33,-.27,.42,-.36],["c",.69,-.51,1.62,-.81,2.76,-.93],["z"],["m",1.17,.66],["c",-.21,-.06,-.57,-.06,-.81,-.03],["c",-.78,.12,-1.26,.69,-1.41,1.74],["c",-.12,.63,-.15,1.95,-.09,2.79],["c",.12,1.71,.63,2.4,1.77,2.46],["c",1.08,.03,1.62,-.48,1.8,-1.74],["c",.06,-.54,.06,-3,0,-3.54],["c",-.15,-1.05,-.51,-1.53,-1.26,-1.68],["z"]],w:9.959,h:14.986},"rests.multimeasure":{d:[["M",0,-4],["l",0,16],["l",1,0],["l",0,-5],["l",40,0],["l",0,5],["l",1,0],["l",0,-16],["l",-1,0],["l",0,5],["l",-40,0],["l",0,-5],["z"]],w:42,h:18},"rests.whole":{d:[["M",.06,.03],["l",.09,-.06],["l",5.46,0],["l",5.49,0],["l",.09,.06],["l",.06,.09],["l",0,2.19],["l",0,2.19],["l",-.06,.09],["l",-.09,.06],["l",-5.49,0],["l",-5.46,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-2.19],["l",0,-2.19],["z"]],w:11.25,h:4.68},"rests.half":{d:[["M",.06,-4.62],["l",.09,-.06],["l",5.46,0],["l",5.49,0],["l",.09,.06],["l",.06,.09],["l",0,2.19],["l",0,2.19],["l",-.06,.09],["l",-.09,.06],["l",-5.49,0],["l",-5.46,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-2.19],["l",0,-2.19],["z"]],w:11.25,h:4.68},"rests.quarter":{d:[["M",1.89,-11.82],["c",.12,-.06,.24,-.06,.36,-.03],["c",.09,.06,4.74,5.58,4.86,5.82],["c",.21,.39,.15,.78,-.15,1.26],["c",-.24,.33,-.72,.81,-1.62,1.56],["c",-.45,.36,-.87,.75,-.96,.84],["c",-.93,.99,-1.14,2.49,-.6,3.63],["c",.18,.39,.27,.48,1.32,1.68],["c",1.92,2.25,1.83,2.16,1.83,2.34],["c",0,.18,-.18,.36,-.36,.39],["c",-.15,0,-.27,-.06,-.48,-.27],["c",-.75,-.75,-2.46,-1.29,-3.39,-1.08],["c",-.45,.09,-.69,.27,-.9,.69],["c",-.12,.3,-.21,.66,-.24,1.14],["c",-.03,.66,.09,1.35,.3,2.01],["c",.15,.42,.24,.66,.45,.96],["c",.18,.24,.18,.33,.03,.42],["c",-.12,.06,-.18,.03,-.45,-.3],["c",-1.08,-1.38,-2.07,-3.36,-2.4,-4.83],["c",-.27,-1.05,-.15,-1.77,.27,-2.07],["c",.21,-.12,.42,-.15,.87,-.15],["c",.87,.06,2.1,.39,3.3,.9],["l",.39,.18],["l",-1.65,-1.95],["c",-2.52,-2.97,-2.61,-3.09,-2.7,-3.27],["c",-.09,-.24,-.12,-.48,-.03,-.75],["c",.15,-.48,.57,-.96,1.83,-2.01],["c",.45,-.36,.84,-.72,.93,-.78],["c",.69,-.75,1.02,-1.8,.9,-2.79],["c",-.06,-.33,-.21,-.84,-.39,-1.11],["c",-.09,-.15,-.45,-.6,-.81,-1.05],["c",-.36,-.42,-.69,-.81,-.72,-.87],["c",-.09,-.18,0,-.42,.21,-.51],["z"]],w:7.888,h:21.435},"rests.8th":{d:[["M",1.68,-6.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.12,0,.18,0,.33,-.09],["c",.39,-.18,1.32,-1.29,1.68,-1.98],["c",.09,-.21,.24,-.3,.39,-.3],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.27,1.11,-1.86,6.42],["c",-1.02,3.48,-1.89,6.39,-1.92,6.42],["c",0,.03,-.12,.12,-.24,.15],["c",-.18,.09,-.21,.09,-.45,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.15,-.57,1.68,-4.92],["c",.96,-2.67,1.74,-4.89,1.71,-4.89],["l",-.51,.15],["c",-1.08,.36,-1.74,.48,-2.55,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:7.534,h:13.883},"rests.16th":{d:[["M",3.33,-6.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.15,.39,.57,.57,.87,.42],["c",.39,-.18,1.2,-1.23,1.62,-2.07],["c",.06,-.15,.24,-.24,.36,-.24],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.45,1.86,-2.67,10.17],["c",-1.5,5.55,-2.73,10.14,-2.76,10.17],["c",-.03,.03,-.12,.12,-.24,.15],["c",-.18,.09,-.21,.09,-.45,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.12,-.57,1.44,-4.92],["c",.81,-2.67,1.47,-4.86,1.47,-4.89],["c",-.03,0,-.27,.06,-.54,.15],["c",-1.08,.36,-1.77,.48,-2.58,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.09,.09,.27,.18,.45,.21],["c",.12,0,.18,0,.33,-.09],["c",.33,-.15,1.02,-.93,1.41,-1.59],["c",.12,-.21,.18,-.39,.39,-1.08],["c",.66,-2.1,1.17,-3.84,1.17,-3.87],["c",0,0,-.21,.06,-.42,.15],["c",-.51,.15,-1.2,.33,-1.68,.42],["c",-.33,.06,-.51,.06,-.96,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:9.724,h:21.383},"rests.32nd":{d:[["M",4.23,-13.62],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.12,0,.18,0,.27,-.06],["c",.33,-.21,.99,-1.11,1.44,-1.98],["c",.09,-.24,.21,-.33,.39,-.33],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.57,2.67,-3.21,13.89],["c",-1.8,7.62,-3.3,13.89,-3.3,13.92],["c",-.03,.06,-.12,.12,-.24,.18],["c",-.21,.09,-.24,.09,-.48,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.09,-.57,1.23,-4.92],["c",.69,-2.67,1.26,-4.86,1.29,-4.89],["c",0,-.03,-.12,-.03,-.48,.12],["c",-1.17,.39,-2.22,.57,-3,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.12,.09,.3,.18,.48,.21],["c",.12,0,.18,0,.3,-.09],["c",.42,-.21,1.29,-1.29,1.56,-1.89],["c",.03,-.12,1.23,-4.59,1.23,-4.65],["c",0,-.03,-.18,.03,-.39,.12],["c",-.63,.18,-1.2,.36,-1.74,.45],["c",-.39,.06,-.54,.06,-1.02,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.18,.18,.51,.27,.72,.15],["c",.3,-.12,.69,-.57,1.08,-1.17],["c",.42,-.6,.39,-.51,1.05,-3.03],["c",.33,-1.26,.6,-2.31,.6,-2.34],["c",0,0,-.21,.03,-.45,.12],["c",-.57,.18,-1.14,.33,-1.62,.42],["c",-.33,.06,-.51,.06,-.96,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:11.373,h:28.883},"rests.64th":{d:[["M",5.13,-13.62],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.21,.54,.3,.75,.18],["c",.24,-.12,.63,-.66,1.08,-1.56],["c",.33,-.66,.39,-.72,.6,-.72],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.69,3.66,-3.54,17.64],["c",-1.95,9.66,-3.57,17.61,-3.57,17.64],["c",-.03,.06,-.12,.12,-.24,.18],["c",-.21,.09,-.24,.09,-.48,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.06,-.57,1.05,-4.95],["c",.6,-2.7,1.08,-4.89,1.08,-4.92],["c",0,0,-.24,.06,-.51,.15],["c",-.66,.24,-1.2,.36,-1.77,.48],["c",-.42,.06,-.57,.06,-1.05,.06],["c",-.69,0,-.87,-.03,-1.35,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.09,.09,.27,.18,.45,.21],["c",.21,.03,.39,-.09,.72,-.42],["c",.45,-.45,1.02,-1.26,1.17,-1.65],["c",.03,-.09,.27,-1.14,.54,-2.34],["c",.27,-1.2,.48,-2.19,.51,-2.22],["c",0,-.03,-.09,-.03,-.48,.12],["c",-1.17,.39,-2.22,.57,-3,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.15,.39,.57,.57,.9,.42],["c",.36,-.18,1.2,-1.26,1.47,-1.89],["c",.03,-.09,.3,-1.2,.57,-2.43],["l",.51,-2.28],["l",-.54,.18],["c",-1.11,.36,-1.8,.48,-2.61,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.21,.21,.54,.3,.75,.18],["c",.36,-.18,.93,-.93,1.29,-1.68],["c",.12,-.24,.18,-.48,.63,-2.55],["l",.51,-2.31],["c",0,-.03,-.18,.03,-.39,.12],["c",-1.14,.36,-2.1,.54,-2.82,.51],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:12.453,h:36.383},"rests.128th":{d:[["M",6.03,-21.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.21,0,.33,-.06,.54,-.36],["c",.15,-.21,.54,-.93,.78,-1.47],["c",.15,-.33,.18,-.39,.3,-.48],["c",.18,-.09,.45,0,.51,.15],["c",.03,.09,-7.11,42.75,-7.17,42.84],["c",-.03,.03,-.15,.09,-.24,.15],["c",-.18,.06,-.24,.06,-.45,.06],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.03,-.57,.84,-4.98],["c",.51,-2.7,.93,-4.92,.9,-4.92],["c",0,0,-.15,.06,-.36,.12],["c",-.78,.27,-1.62,.48,-2.31,.57],["c",-.15,.03,-.54,.03,-.81,.03],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.63,.48],["c",.12,0,.18,0,.3,-.09],["c",.42,-.21,1.14,-1.11,1.5,-1.83],["c",.12,-.27,.12,-.27,.54,-2.52],["c",.24,-1.23,.42,-2.25,.39,-2.25],["c",0,0,-.24,.06,-.51,.18],["c",-1.26,.39,-2.25,.57,-3.06,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.21,.51,.3,.75,.18],["c",.36,-.15,1.05,-.99,1.41,-1.77],["l",.15,-.3],["l",.42,-2.25],["c",.21,-1.26,.42,-2.28,.39,-2.28],["l",-.51,.15],["c",-1.11,.39,-1.89,.51,-2.7,.51],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.18,.48,.27,.72,.21],["c",.33,-.12,1.14,-1.26,1.41,-1.95],["c",0,-.09,.21,-1.11,.45,-2.34],["c",.21,-1.2,.39,-2.22,.39,-2.28],["c",.03,-.03,0,-.03,-.45,.12],["c",-.57,.18,-1.2,.33,-1.71,.42],["c",-.3,.06,-.51,.06,-.93,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.18,0,.36,-.09,.57,-.33],["c",.33,-.36,.78,-1.14,.93,-1.56],["c",.03,-.12,.24,-1.2,.45,-2.4],["c",.24,-1.2,.42,-2.22,.42,-2.28],["c",.03,-.03,0,-.03,-.39,.09],["c",-1.05,.36,-1.8,.48,-2.58,.48],["c",-.63,0,-.84,-.03,-1.29,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:12.992,h:43.883},"accidentals.sharp":{d:[["M",5.73,-11.19],["c",.21,-.12,.54,-.03,.66,.24],["c",.06,.12,.06,.21,.06,2.31],["c",0,1.23,0,2.22,.03,2.22],["c",0,0,.27,-.12,.6,-.24],["c",.69,-.27,.78,-.3,.96,-.15],["c",.21,.15,.21,.18,.21,1.38],["c",0,1.02,0,1.11,-.06,1.2],["c",-.03,.06,-.09,.12,-.12,.15],["c",-.06,.03,-.42,.21,-.84,.36],["l",-.75,.33],["l",-.03,2.43],["c",0,1.32,0,2.43,.03,2.43],["c",0,0,.27,-.12,.6,-.24],["c",.69,-.27,.78,-.3,.96,-.15],["c",.21,.15,.21,.18,.21,1.38],["c",0,1.02,0,1.11,-.06,1.2],["c",-.03,.06,-.09,.12,-.12,.15],["c",-.06,.03,-.42,.21,-.84,.36],["l",-.75,.33],["l",-.03,2.52],["c",0,2.28,-.03,2.55,-.06,2.64],["c",-.21,.36,-.72,.36,-.93,0],["c",-.03,-.09,-.06,-.33,-.06,-2.43],["l",0,-2.31],["l",-1.29,.51],["l",-1.26,.51],["l",0,2.43],["c",0,2.58,0,2.52,-.15,2.67],["c",-.06,.09,-.27,.18,-.36,.18],["c",-.12,0,-.33,-.09,-.39,-.18],["c",-.15,-.15,-.15,-.09,-.15,-2.43],["c",0,-1.23,0,-2.22,-.03,-2.22],["c",0,0,-.27,.12,-.6,.24],["c",-.69,.27,-.78,.3,-.96,.15],["c",-.21,-.15,-.21,-.18,-.21,-1.38],["c",0,-1.02,0,-1.11,.06,-1.2],["c",.03,-.06,.09,-.12,.12,-.15],["c",.06,-.03,.42,-.21,.84,-.36],["l",.78,-.33],["l",0,-2.43],["c",0,-1.32,0,-2.43,-.03,-2.43],["c",0,0,-.27,.12,-.6,.24],["c",-.69,.27,-.78,.3,-.96,.15],["c",-.21,-.15,-.21,-.18,-.21,-1.38],["c",0,-1.02,0,-1.11,.06,-1.2],["c",.03,-.06,.09,-.12,.12,-.15],["c",.06,-.03,.42,-.21,.84,-.36],["l",.78,-.33],["l",0,-2.52],["c",0,-2.28,.03,-2.55,.06,-2.64],["c",.21,-.36,.72,-.36,.93,0],["c",.03,.09,.06,.33,.06,2.43],["l",.03,2.31],["l",1.26,-.51],["l",1.26,-.51],["l",0,-2.43],["c",0,-2.28,0,-2.43,.06,-2.55],["c",.06,-.12,.12,-.18,.27,-.24],["z"],["m",-.33,10.65],["l",0,-2.43],["l",-1.29,.51],["l",-1.26,.51],["l",0,2.46],["l",0,2.43],["l",.09,-.03],["c",.06,-.03,.63,-.27,1.29,-.51],["l",1.17,-.48],["l",0,-2.46],["z"]],w:8.25,h:22.462},"accidentals.halfsharp":{d:[["M",2.43,-10.05],["c",.21,-.12,.54,-.03,.66,.24],["c",.06,.12,.06,.21,.06,2.01],["c",0,1.05,0,1.89,.03,1.89],["l",.72,-.48],["c",.69,-.48,.69,-.51,.87,-.51],["c",.15,0,.18,.03,.27,.09],["c",.21,.15,.21,.18,.21,1.41],["c",0,1.11,-.03,1.14,-.09,1.23],["c",-.03,.03,-.48,.39,-1.02,.75],["l",-.99,.66],["l",0,2.37],["c",0,1.32,0,2.37,.03,2.37],["l",.72,-.48],["c",.69,-.48,.69,-.51,.87,-.51],["c",.15,0,.18,.03,.27,.09],["c",.21,.15,.21,.18,.21,1.41],["c",0,1.11,-.03,1.14,-.09,1.23],["c",-.03,.03,-.48,.39,-1.02,.75],["l",-.99,.66],["l",0,2.25],["c",0,1.95,0,2.28,-.06,2.37],["c",-.06,.12,-.12,.21,-.24,.27],["c",-.27,.12,-.54,.03,-.69,-.24],["c",-.06,-.12,-.06,-.21,-.06,-2.01],["c",0,-1.05,0,-1.89,-.03,-1.89],["l",-.72,.48],["c",-.69,.48,-.69,.48,-.87,.48],["c",-.15,0,-.18,0,-.27,-.06],["c",-.21,-.15,-.21,-.18,-.21,-1.41],["c",0,-1.11,.03,-1.14,.09,-1.23],["c",.03,-.03,.48,-.39,1.02,-.75],["l",.99,-.66],["l",0,-2.37],["c",0,-1.32,0,-2.37,-.03,-2.37],["l",-.72,.48],["c",-.69,.48,-.69,.48,-.87,.48],["c",-.15,0,-.18,0,-.27,-.06],["c",-.21,-.15,-.21,-.18,-.21,-1.41],["c",0,-1.11,.03,-1.14,.09,-1.23],["c",.03,-.03,.48,-.39,1.02,-.75],["l",.99,-.66],["l",0,-2.25],["c",0,-2.13,0,-2.28,.06,-2.4],["c",.06,-.12,.12,-.18,.27,-.24],["z"]],w:5.25,h:20.174},"accidentals.nat":{d:[["M",.21,-11.4],["c",.24,-.06,.78,0,.99,.15],["c",.03,.03,.03,.48,0,2.61],["c",-.03,1.44,-.03,2.61,-.03,2.61],["c",0,.03,.75,-.09,1.68,-.24],["c",.96,-.18,1.71,-.27,1.74,-.27],["c",.15,.03,.27,.15,.36,.3],["l",.06,.12],["l",.09,8.67],["c",.09,6.96,.12,8.67,.09,8.67],["c",-.03,.03,-.12,.06,-.21,.09],["c",-.24,.09,-.72,.09,-.96,0],["c",-.09,-.03,-.18,-.06,-.21,-.09],["c",-.03,-.03,-.03,-.48,0,-2.61],["c",.03,-1.44,.03,-2.61,.03,-2.61],["c",0,-.03,-.75,.09,-1.68,.24],["c",-.96,.18,-1.71,.27,-1.74,.27],["c",-.15,-.03,-.27,-.15,-.36,-.3],["l",-.06,-.15],["l",-.09,-7.53],["c",-.06,-4.14,-.09,-8.04,-.12,-8.67],["l",0,-1.11],["l",.15,-.06],["c",.09,-.03,.21,-.06,.27,-.09],["z"],["m",3.75,8.4],["c",0,-.33,0,-.42,-.03,-.42],["c",-.12,0,-2.79,.45,-2.79,.48],["c",-.03,0,-.09,6.3,-.09,6.33],["c",.03,0,2.79,-.45,2.82,-.48],["c",0,0,.09,-4.53,.09,-5.91],["z"]],w:5.4,h:22.8},"accidentals.flat":{d:[["M",-.36,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"]],w:6.75,h:18.801},"accidentals.halfflat":{d:[["M",4.83,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.6,-.12,9.06],["c",-.09,5.55,-.15,9.06,-.18,9.12],["c",-.03,.09,-.09,.18,-.15,.27],["c",-.24,.21,-.54,.24,-.81,.06],["c",-.06,-.03,-.27,-.24,-.45,-.42],["c",-.36,-.42,-.66,-.66,-1.8,-1.44],["c",-1.23,-.84,-1.83,-1.32,-2.25,-1.77],["c",-.66,-.78,-.96,-1.56,-.93,-2.46],["c",.09,-1.41,1.11,-2.58,2.4,-2.79],["c",.3,-.06,.84,-.03,1.23,.06],["c",.54,.12,1.08,.33,1.53,.63],["c",.12,.09,.24,.15,.24,.12],["c",0,0,-.12,-8.37,-.18,-9.75],["l",0,-.66],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",-1.65,10.95],["c",-.6,-.18,-1.08,.09,-1.38,.69],["c",-.27,.6,-.36,1.38,-.18,2.07],["c",.12,.42,.42,.99,.72,1.41],["c",.3,.42,.93,1.05,1.56,1.59],["l",.48,.39],["l",0,-.12],["c",.03,-.09,.03,-.48,.06,-.9],["c",.03,-.57,.03,-1.08,0,-2.22],["c",-.03,-1.62,-.03,-1.62,-.24,-2.07],["c",-.21,-.42,-.6,-.75,-1.02,-.84],["z"]],w:6.728,h:18.801},"accidentals.dblflat":{d:[["M",-.36,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"],["m",3,-11],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"]],w:12.1,h:18.804},"accidentals.dblsharp":{d:[["M",-.18,-3.96],["c",.06,-.03,.12,-.06,.15,-.06],["c",.09,0,2.76,.27,2.79,.3],["c",.12,.03,.15,.12,.15,.51],["c",.06,.96,.24,1.59,.57,2.1],["c",.06,.09,.15,.21,.18,.24],["l",.09,.06],["l",.09,-.06],["c",.03,-.03,.12,-.15,.18,-.24],["c",.33,-.51,.51,-1.14,.57,-2.1],["c",0,-.39,.03,-.45,.12,-.51],["c",.03,0,.66,-.09,1.44,-.15],["c",1.47,-.15,1.5,-.15,1.56,-.03],["c",.03,.06,0,.42,-.09,1.44],["c",-.09,.72,-.15,1.35,-.15,1.38],["c",0,.03,-.03,.09,-.06,.12],["c",-.06,.06,-.12,.09,-.51,.09],["c",-1.08,.06,-1.8,.3,-2.28,.75],["l",-.12,.09],["l",.09,.09],["c",.12,.15,.39,.33,.63,.45],["c",.42,.18,.96,.27,1.68,.33],["c",.39,0,.45,.03,.51,.09],["c",.03,.03,.06,.09,.06,.12],["c",0,.03,.06,.66,.15,1.38],["c",.09,1.02,.12,1.38,.09,1.44],["c",-.06,.12,-.09,.12,-1.56,-.03],["c",-.78,-.06,-1.41,-.15,-1.44,-.15],["c",-.09,-.06,-.12,-.12,-.12,-.54],["c",-.06,-.93,-.24,-1.56,-.57,-2.07],["c",-.06,-.09,-.15,-.21,-.18,-.24],["l",-.09,-.06],["l",-.09,.06],["c",-.03,.03,-.12,.15,-.18,.24],["c",-.33,.51,-.51,1.14,-.57,2.07],["c",0,.42,-.03,.48,-.12,.54],["c",-.03,0,-.66,.09,-1.44,.15],["c",-1.47,.15,-1.5,.15,-1.56,.03],["c",-.03,-.06,0,-.42,.09,-1.44],["c",.09,-.72,.15,-1.35,.15,-1.38],["c",0,-.03,.03,-.09,.06,-.12],["c",.06,-.06,.12,-.09,.51,-.09],["c",.72,-.06,1.26,-.15,1.68,-.33],["c",.24,-.12,.51,-.3,.63,-.45],["l",.09,-.09],["l",-.12,-.09],["c",-.48,-.45,-1.2,-.69,-2.28,-.75],["c",-.39,0,-.45,-.03,-.51,-.09],["c",-.03,-.03,-.06,-.09,-.06,-.12],["c",0,-.03,-.06,-.63,-.12,-1.38],["c",-.09,-.72,-.15,-1.35,-.15,-1.38],["z"]],w:7.95,h:7.977},"dots.dot":{d:[["M",1.32,-1.68],["c",.09,-.03,.27,-.06,.39,-.06],["c",.96,0,1.74,.78,1.74,1.71],["c",0,.96,-.78,1.74,-1.71,1.74],["c",-.96,0,-1.74,-.78,-1.74,-1.71],["c",0,-.78,.54,-1.5,1.32,-1.68],["z"]],w:3.45,h:3.45},"noteheads.dbl":{d:[["M",-.69,-4.02],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["c",.06,.15,.06,.18,.06,1.41],["l",0,1.23],["l",.12,-.18],["c",.72,-1.26,2.64,-2.31,4.86,-2.64],["c",.81,-.15,1.11,-.15,2.13,-.15],["c",.99,0,1.29,0,2.1,.15],["c",.75,.12,1.38,.27,2.04,.54],["c",1.35,.51,2.34,1.26,2.82,2.1],["l",.12,.18],["l",0,-1.23],["c",0,-1.2,0,-1.26,.06,-1.38],["c",.09,-.18,.15,-.24,.33,-.33],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,3.54],["l",0,3.54],["l",-.06,.15],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.06,-.12,-.06,-.18,-.06,-1.38],["l",0,-1.23],["l",-.12,.18],["c",-.48,.84,-1.47,1.59,-2.82,2.1],["c",-.84,.33,-1.71,.54,-2.85,.66],["c",-.45,.06,-2.16,.06,-2.61,0],["c",-1.14,-.12,-2.01,-.33,-2.85,-.66],["c",-1.35,-.51,-2.34,-1.26,-2.82,-2.1],["l",-.12,-.18],["l",0,1.23],["c",0,1.23,0,1.26,-.06,1.38],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["l",-.06,-.15],["l",0,-3.54],["c",0,-3.48,0,-3.54,.06,-3.66],["c",.09,-.18,.15,-.24,.33,-.33],["z"],["m",7.71,.63],["c",-.36,-.06,-.9,-.06,-1.14,0],["c",-.3,.03,-.66,.24,-.87,.42],["c",-.6,.54,-.9,1.62,-.75,2.82],["c",.12,.93,.51,1.68,1.11,2.31],["c",.75,.72,1.83,1.2,2.85,1.26],["c",1.05,.06,1.83,-.54,2.1,-1.65],["c",.21,-.9,.12,-1.95,-.24,-2.82],["c",-.36,-.81,-1.08,-1.53,-1.95,-1.95],["c",-.3,-.15,-.78,-.3,-1.11,-.39],["z"]],w:16.83,h:8.145},"noteheads.whole":{d:[["M",6.51,-4.05],["c",.51,-.03,2.01,0,2.52,.03],["c",1.41,.18,2.64,.51,3.72,1.08],["c",1.2,.63,1.95,1.41,2.19,2.31],["c",.09,.33,.09,.9,0,1.23],["c",-.24,.9,-.99,1.68,-2.19,2.31],["c",-1.08,.57,-2.28,.9,-3.75,1.08],["c",-.66,.06,-2.31,.06,-2.97,0],["c",-1.47,-.18,-2.67,-.51,-3.75,-1.08],["c",-1.2,-.63,-1.95,-1.41,-2.19,-2.31],["c",-.09,-.33,-.09,-.9,0,-1.23],["c",.24,-.9,.99,-1.68,2.19,-2.31],["c",1.2,-.63,2.61,-.99,4.23,-1.11],["z"],["m",.57,.66],["c",-.87,-.15,-1.53,0,-2.04,.51],["c",-.15,.15,-.24,.27,-.33,.48],["c",-.24,.51,-.36,1.08,-.33,1.77],["c",.03,.69,.18,1.26,.42,1.77],["c",.6,1.17,1.74,1.98,3.18,2.22],["c",1.11,.21,1.95,-.15,2.34,-.99],["c",.24,-.51,.36,-1.08,.33,-1.8],["c",-.06,-1.11,-.45,-2.04,-1.17,-2.76],["c",-.63,-.63,-1.47,-1.05,-2.4,-1.2],["z"]],w:14.985,h:8.097},"noteheads.half":{d:[["M",7.44,-4.05],["c",.06,-.03,.27,-.03,.48,-.03],["c",1.05,0,1.71,.24,2.1,.81],["c",.42,.6,.45,1.35,.18,2.4],["c",-.42,1.59,-1.14,2.73,-2.16,3.39],["c",-1.41,.93,-3.18,1.44,-5.4,1.53],["c",-1.17,.03,-1.89,-.21,-2.28,-.81],["c",-.42,-.6,-.45,-1.35,-.18,-2.4],["c",.42,-1.59,1.14,-2.73,2.16,-3.39],["c",.63,-.42,1.23,-.72,1.98,-.96],["c",.9,-.3,1.65,-.42,3.12,-.54],["z"],["m",1.29,.87],["c",-.27,-.09,-.63,-.12,-.9,-.03],["c",-.72,.24,-1.53,.69,-3.27,1.8],["c",-2.34,1.5,-3.3,2.25,-3.57,2.79],["c",-.36,.72,-.06,1.5,.66,1.77],["c",.24,.12,.69,.09,.99,0],["c",.84,-.3,1.92,-.93,4.14,-2.37],["c",1.62,-1.08,2.37,-1.71,2.61,-2.19],["c",.36,-.72,.06,-1.5,-.66,-1.77],["z"]],w:10.37,h:8.132},"noteheads.quarter":{d:[["M",6.09,-4.05],["c",.36,-.03,1.2,0,1.53,.06],["c",1.17,.24,1.89,.84,2.16,1.83],["c",.06,.18,.06,.3,.06,.66],["c",0,.45,0,.63,-.15,1.08],["c",-.66,2.04,-3.06,3.93,-5.52,4.38],["c",-.54,.09,-1.44,.09,-1.83,.03],["c",-1.23,-.27,-1.98,-.87,-2.25,-1.86],["c",-.06,-.18,-.06,-.3,-.06,-.66],["c",0,-.45,0,-.63,.15,-1.08],["c",.24,-.78,.75,-1.53,1.44,-2.22],["c",1.2,-1.2,2.85,-2.01,4.47,-2.22],["z"]],w:9.81,h:8.094},"noteheads.slash.nostem":{d:[["M",9.3,-7.77],["c",.06,-.06,.18,-.06,1.71,-.06],["l",1.65,0],["l",.09,.09],["c",.06,.06,.06,.09,.06,.15],["c",-.03,.12,-9.21,15.24,-9.3,15.33],["c",-.06,.06,-.18,.06,-1.71,.06],["l",-1.65,0],["l",-.09,-.09],["c",-.06,-.06,-.06,-.09,-.06,-.15],["c",.03,-.12,9.21,-15.24,9.3,-15.33],["z"]],w:12.81,h:15.63},"noteheads.indeterminate":{d:[["M",.78,-4.05],["c",.12,-.03,.24,-.03,.36,.03],["c",.03,.03,.93,.72,1.95,1.56],["l",1.86,1.5],["l",1.86,-1.5],["c",1.02,-.84,1.92,-1.53,1.95,-1.56],["c",.21,-.12,.33,-.09,.75,.24],["c",.3,.27,.36,.36,.36,.54],["c",0,.03,-.03,.12,-.06,.18],["c",-.03,.06,-.9,.75,-1.89,1.56],["l",-1.8,1.47],["c",0,.03,.81,.69,1.8,1.5],["c",.99,.81,1.86,1.5,1.89,1.56],["c",.03,.06,.06,.15,.06,.18],["c",0,.18,-.06,.27,-.36,.54],["c",-.42,.33,-.54,.36,-.75,.24],["c",-.03,-.03,-.93,-.72,-1.95,-1.56],["l",-1.86,-1.5],["l",-1.86,1.5],["c",-1.02,.84,-1.92,1.53,-1.95,1.56],["c",-.21,.12,-.33,.09,-.75,-.24],["c",-.3,-.27,-.36,-.36,-.36,-.54],["c",0,-.03,.03,-.12,.06,-.18],["c",.03,-.06,.9,-.75,1.89,-1.56],["l",1.8,-1.47],["c",0,-.03,-.81,-.69,-1.8,-1.5],["c",-.99,-.81,-1.86,-1.5,-1.89,-1.56],["c",-.06,-.12,-.09,-.21,-.03,-.36],["c",.03,-.09,.57,-.57,.72,-.63],["z"]],w:9.843,h:8.139},"scripts.ufermata":{d:[["M",-.75,-10.77],["c",.12,0,.45,-.03,.69,-.03],["c",2.91,-.03,5.55,1.53,7.41,4.35],["c",1.17,1.71,1.95,3.72,2.43,6.03],["c",.12,.51,.12,.57,.03,.69],["c",-.12,.21,-.48,.27,-.69,.12],["c",-.12,-.09,-.18,-.24,-.27,-.69],["c",-.78,-3.63,-3.42,-6.54,-6.78,-7.38],["c",-.78,-.21,-1.2,-.24,-2.07,-.24],["c",-.63,0,-.84,0,-1.2,.06],["c",-1.83,.27,-3.42,1.08,-4.8,2.37],["c",-1.41,1.35,-2.4,3.21,-2.85,5.19],["c",-.09,.45,-.15,.6,-.27,.69],["c",-.21,.15,-.57,.09,-.69,-.12],["c",-.09,-.12,-.09,-.18,.03,-.69],["c",.33,-1.62,.78,-3,1.47,-4.38],["c",1.77,-3.54,4.44,-5.67,7.56,-5.97],["z"],["m",.33,7.47],["c",1.38,-.3,2.58,.9,2.31,2.25],["c",-.15,.72,-.78,1.35,-1.47,1.5],["c",-1.38,.27,-2.58,-.93,-2.31,-2.31],["c",.15,-.69,.78,-1.29,1.47,-1.44],["z"]],w:19.748,h:11.289},"scripts.dfermata":{d:[["M",-9.63,-.42],["c",.15,-.09,.36,-.06,.51,.03],["c",.12,.09,.18,.24,.27,.66],["c",.78,3.66,3.42,6.57,6.78,7.41],["c",.78,.21,1.2,.24,2.07,.24],["c",.63,0,.84,0,1.2,-.06],["c",1.83,-.27,3.42,-1.08,4.8,-2.37],["c",1.41,-1.35,2.4,-3.21,2.85,-5.22],["c",.09,-.42,.15,-.57,.27,-.66],["c",.21,-.15,.57,-.09,.69,.12],["c",.09,.12,.09,.18,-.03,.69],["c",-.33,1.62,-.78,3,-1.47,4.38],["c",-1.92,3.84,-4.89,6,-8.31,6],["c",-3.42,0,-6.39,-2.16,-8.31,-6],["c",-.48,-.96,-.84,-1.92,-1.14,-2.97],["c",-.18,-.69,-.42,-1.74,-.42,-1.92],["c",0,-.12,.09,-.27,.24,-.33],["z"],["m",9.21,0],["c",1.2,-.27,2.34,.63,2.34,1.86],["c",0,.9,-.66,1.68,-1.5,1.89],["c",-1.38,.27,-2.58,-.93,-2.31,-2.31],["c",.15,-.69,.78,-1.29,1.47,-1.44],["z"]],w:19.744,h:11.274},"scripts.sforzato":{d:[["M",-6.45,-3.69],["c",.06,-.03,.15,-.06,.18,-.06],["c",.06,0,2.85,.72,6.24,1.59],["l",6.33,1.65],["c",.33,.06,.45,.21,.45,.51],["c",0,.3,-.12,.45,-.45,.51],["l",-6.33,1.65],["c",-3.39,.87,-6.18,1.59,-6.21,1.59],["c",-.21,0,-.48,-.24,-.51,-.45],["c",0,-.15,.06,-.36,.18,-.45],["c",.09,-.06,.87,-.27,3.84,-1.05],["c",2.04,-.54,3.84,-.99,4.02,-1.02],["c",.15,-.06,1.14,-.24,2.22,-.42],["c",1.05,-.18,1.92,-.36,1.92,-.36],["c",0,0,-.87,-.18,-1.92,-.36],["c",-1.08,-.18,-2.07,-.36,-2.22,-.42],["c",-.18,-.03,-1.98,-.48,-4.02,-1.02],["c",-2.97,-.78,-3.75,-.99,-3.84,-1.05],["c",-.12,-.09,-.18,-.3,-.18,-.45],["c",.03,-.15,.15,-.3,.3,-.39],["z"]],w:13.5,h:7.5},"scripts.staccato":{d:[["M",-.36,-1.47],["c",.93,-.21,1.86,.51,1.86,1.47],["c",0,.93,-.87,1.65,-1.8,1.47],["c",-.54,-.12,-1.02,-.57,-1.14,-1.08],["c",-.21,-.81,.27,-1.65,1.08,-1.86],["z"]],w:2.989,h:3.004},"scripts.tenuto":{d:[["M",-4.2,-.48],["l",.12,-.06],["l",4.08,0],["l",4.08,0],["l",.12,.06],["c",.39,.21,.39,.75,0,.96],["l",-.12,.06],["l",-4.08,0],["l",-4.08,0],["l",-.12,-.06],["c",-.39,-.21,-.39,-.75,0,-.96],["z"]],w:8.985,h:1.08},"scripts.umarcato":{d:[["M",-.15,-8.19],["c",.15,-.12,.36,-.03,.45,.15],["c",.21,.42,3.45,7.65,3.45,7.71],["c",0,.12,-.12,.27,-.21,.3],["c",-.03,.03,-.51,.03,-1.14,.03],["c",-1.05,0,-1.08,0,-1.17,-.06],["c",-.09,-.06,-.24,-.36,-1.17,-2.4],["c",-.57,-1.29,-1.05,-2.34,-1.08,-2.34],["c",0,-.03,-.51,1.02,-1.08,2.34],["c",-.93,2.07,-1.08,2.34,-1.14,2.4],["c",-.06,.03,-.15,.06,-.18,.06],["c",-.15,0,-.33,-.18,-.33,-.33],["c",0,-.06,3.24,-7.32,3.45,-7.71],["c",.03,-.06,.09,-.15,.15,-.15],["z"]],w:7.5,h:8.245},"scripts.dmarcato":{d:[["M",-3.57,.03],["c",.03,0,.57,-.03,1.17,-.03],["c",1.05,0,1.08,0,1.17,.06],["c",.09,.06,.24,.36,1.17,2.4],["c",.57,1.29,1.05,2.34,1.08,2.34],["c",0,.03,.51,-1.02,1.08,-2.34],["c",.93,-2.07,1.08,-2.34,1.14,-2.4],["c",.06,-.03,.15,-.06,.18,-.06],["c",.15,0,.33,.18,.33,.33],["c",0,.09,-3.45,7.74,-3.54,7.83],["c",-.12,.12,-.3,.12,-.42,0],["c",-.09,-.09,-3.54,-7.74,-3.54,-7.83],["c",0,-.09,.12,-.27,.18,-.3],["z"]],w:7.5,h:8.25},"scripts.stopped":{d:[["M",-.27,-4.08],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,1.5],["l",0,1.47],["l",1.47,0],["l",1.5,0],["l",.15,.06],["c",.15,.09,.21,.15,.3,.33],["c",.09,.18,.09,.36,0,.54],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.12,.06,-.18,.06,-1.62,.06],["l",-1.47,0],["l",0,1.47],["l",0,1.47],["l",-.06,.15],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["l",-.06,-.15],["l",0,-1.47],["l",0,-1.47],["l",-1.47,0],["c",-1.44,0,-1.5,0,-1.62,-.06],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.09,-.36,0,-.54],["c",.09,-.18,.15,-.24,.33,-.33],["l",.15,-.06],["l",1.47,0],["l",1.47,0],["l",0,-1.47],["c",0,-1.44,0,-1.5,.06,-1.62],["c",.09,-.18,.15,-.24,.33,-.33],["z"]],w:8.295,h:8.295},"scripts.upbow":{d:[["M",-4.65,-15.54],["c",.12,-.09,.36,-.06,.48,.03],["c",.03,.03,.09,.09,.12,.15],["c",.03,.06,.66,2.13,1.41,4.62],["c",1.35,4.41,1.38,4.56,2.01,6.96],["l",.63,2.46],["l",.63,-2.46],["c",.63,-2.4,.66,-2.55,2.01,-6.96],["c",.75,-2.49,1.38,-4.56,1.41,-4.62],["c",.06,-.15,.18,-.21,.36,-.24],["c",.15,0,.3,.06,.39,.18],["c",.15,.21,.24,-.18,-2.1,7.56],["c",-1.2,3.96,-2.22,7.32,-2.25,7.41],["c",0,.12,-.06,.27,-.09,.3],["c",-.12,.21,-.6,.21,-.72,0],["c",-.03,-.03,-.09,-.18,-.09,-.3],["c",-.03,-.09,-1.05,-3.45,-2.25,-7.41],["c",-2.34,-7.74,-2.25,-7.35,-2.1,-7.56],["c",.03,-.03,.09,-.09,.15,-.12],["z"]],w:9.73,h:15.608},"scripts.downbow":{d:[["M",-5.55,-9.93],["l",.09,-.06],["l",5.46,0],["l",5.46,0],["l",.09,.06],["l",.06,.09],["l",0,4.77],["c",0,5.28,0,4.89,-.18,5.01],["c",-.18,.12,-.42,.06,-.54,-.12],["c",-.06,-.09,-.06,-.18,-.06,-2.97],["l",0,-2.85],["l",-4.83,0],["l",-4.83,0],["l",0,2.85],["c",0,2.79,0,2.88,-.06,2.97],["c",-.15,.24,-.51,.24,-.66,0],["c",-.06,-.09,-.06,-.21,-.06,-4.89],["l",0,-4.77],["z"]],w:11.22,h:9.992},"scripts.turn":{d:[["M",-4.77,-3.9],["c",.36,-.06,1.05,-.06,1.44,.03],["c",.78,.15,1.5,.51,2.34,1.14],["c",.6,.45,1.05,.87,2.22,2.01],["c",1.11,1.08,1.62,1.5,2.22,1.86],["c",.6,.36,1.32,.57,1.92,.57],["c",.9,0,1.71,-.57,1.89,-1.35],["c",.24,-.93,-.39,-1.89,-1.35,-2.1],["l",-.15,-.06],["l",-.09,.15],["c",-.03,.09,-.15,.24,-.24,.33],["c",-.72,.72,-2.04,.54,-2.49,-.36],["c",-.48,-.93,.03,-1.86,1.17,-2.19],["c",.3,-.09,1.02,-.09,1.35,0],["c",.99,.27,1.74,.87,2.25,1.83],["c",.69,1.41,.63,3,-.21,4.26],["c",-.21,.3,-.69,.81,-.99,1.02],["c",-.3,.21,-.84,.45,-1.17,.54],["c",-1.23,.36,-2.49,.15,-3.72,-.6],["c",-.75,-.48,-1.41,-1.02,-2.85,-2.46],["c",-1.11,-1.08,-1.62,-1.5,-2.22,-1.86],["c",-.6,-.36,-1.32,-.57,-1.92,-.57],["c",-.9,0,-1.71,.57,-1.89,1.35],["c",-.24,.93,.39,1.89,1.35,2.1],["l",.15,.06],["l",.09,-.15],["c",.03,-.09,.15,-.24,.24,-.33],["c",.72,-.72,2.04,-.54,2.49,.36],["c",.48,.93,-.03,1.86,-1.17,2.19],["c",-.3,.09,-1.02,.09,-1.35,0],["c",-.99,-.27,-1.74,-.87,-2.25,-1.83],["c",-.69,-1.41,-.63,-3,.21,-4.26],["c",.21,-.3,.69,-.81,.99,-1.02],["c",.48,-.33,1.11,-.57,1.74,-.66],["z"]],w:16.366,h:7.893},"scripts.trill":{d:[["M",-.51,-16.02],["c",.12,-.09,.21,-.18,.21,-.18],["l",-.81,4.02],["l",-.81,4.02],["c",.03,0,.51,-.27,1.08,-.6],["c",.6,-.3,1.14,-.63,1.26,-.66],["c",1.14,-.54,2.31,-.6,3.09,-.18],["c",.27,.15,.54,.36,.6,.51],["l",.06,.12],["l",.21,-.21],["c",.9,-.81,2.22,-.99,3.12,-.42],["c",.6,.42,.9,1.14,.78,2.07],["c",-.15,1.29,-1.05,2.31,-1.95,2.25],["c",-.48,-.03,-.78,-.3,-.96,-.81],["c",-.09,-.27,-.09,-.9,-.03,-1.2],["c",.21,-.75,.81,-1.23,1.59,-1.32],["l",.24,-.03],["l",-.09,-.12],["c",-.51,-.66,-1.62,-.63,-2.31,.03],["c",-.39,.42,-.3,.09,-1.23,4.77],["l",-.81,4.14],["c",-.03,0,-.12,-.03,-.21,-.09],["c",-.33,-.15,-.54,-.18,-.99,-.18],["c",-.42,0,-.66,.03,-1.05,.18],["c",-.12,.06,-.21,.09,-.21,.09],["c",0,-.03,.36,-1.86,.81,-4.11],["c",.9,-4.47,.87,-4.26,.69,-4.53],["c",-.21,-.36,-.66,-.51,-1.17,-.36],["c",-.15,.06,-2.22,1.14,-2.58,1.38],["c",-.12,.09,-.12,.09,-.21,.6],["l",-.09,.51],["l",.21,.24],["c",.63,.75,1.02,1.47,1.2,2.19],["c",.06,.27,.06,.36,.06,.81],["c",0,.42,0,.54,-.06,.78],["c",-.15,.54,-.33,.93,-.63,1.35],["c",-.18,.24,-.57,.63,-.81,.78],["c",-.24,.15,-.63,.36,-.84,.42],["c",-.27,.06,-.66,.06,-.87,.03],["c",-.81,-.18,-1.32,-1.05,-1.38,-2.46],["c",-.03,-.6,.03,-.99,.33,-2.46],["c",.21,-1.08,.24,-1.32,.21,-1.29],["c",-1.2,.48,-2.4,.75,-3.21,.72],["c",-.69,-.06,-1.17,-.3,-1.41,-.72],["c",-.39,-.75,-.12,-1.8,.66,-2.46],["c",.24,-.18,.69,-.42,1.02,-.51],["c",.69,-.18,1.53,-.15,2.31,.09],["c",.3,.09,.75,.3,.99,.45],["c",.12,.09,.15,.09,.15,.03],["c",.03,-.03,.33,-1.59,.72,-3.45],["c",.36,-1.86,.66,-3.42,.69,-3.45],["c",0,-.03,.03,-.03,.21,.03],["c",.21,.06,.27,.06,.48,.06],["c",.42,-.03,.78,-.18,1.26,-.48],["c",.15,-.12,.36,-.27,.48,-.39],["z"],["m",-5.73,7.68],["c",-.27,-.03,-.96,-.06,-1.2,-.03],["c",-.81,.12,-1.35,.57,-1.5,1.2],["c",-.18,.66,.12,1.14,.75,1.29],["c",.66,.12,1.92,-.12,3.18,-.66],["l",.33,-.15],["l",.09,-.39],["c",.06,-.21,.09,-.42,.09,-.45],["c",0,-.03,-.45,-.3,-.75,-.45],["c",-.27,-.15,-.66,-.27,-.99,-.36],["z"],["m",4.29,3.63],["c",-.24,-.39,-.51,-.75,-.51,-.69],["c",-.06,.12,-.39,1.92,-.45,2.28],["c",-.09,.54,-.12,1.14,-.06,1.38],["c",.06,.42,.21,.6,.51,.57],["c",.39,-.06,.75,-.48,.93,-1.14],["c",.09,-.33,.09,-1.05,0,-1.38],["c",-.09,-.39,-.24,-.69,-.42,-1.02],["z"]],w:17.963,h:16.49},"scripts.segno":{d:[["M",-3.72,-11.22],["c",.78,-.09,1.59,.03,2.31,.42],["c",1.2,.6,2.01,1.71,2.31,3.09],["c",.09,.42,.09,1.2,.03,1.5],["c",-.15,.45,-.39,.81,-.66,.93],["c",-.33,.18,-.84,.21,-1.23,.15],["c",-.81,-.18,-1.32,-.93,-1.26,-1.89],["c",.03,-.36,.09,-.57,.24,-.9],["c",.15,-.33,.45,-.6,.72,-.75],["c",.12,-.06,.18,-.09,.18,-.12],["c",0,-.03,-.03,-.15,-.09,-.24],["c",-.18,-.45,-.54,-.87,-.96,-1.08],["c",-1.11,-.57,-2.34,-.18,-2.88,.9],["c",-.24,.51,-.33,1.11,-.24,1.83],["c",.27,1.92,1.5,3.54,3.93,5.13],["c",.48,.33,1.26,.78,1.29,.78],["c",.03,0,1.35,-2.19,2.94,-4.89],["l",2.88,-4.89],["l",.84,0],["l",.87,0],["l",-.03,.06],["c",-.15,.21,-6.15,10.41,-6.15,10.44],["c",0,0,.21,.15,.48,.27],["c",2.61,1.47,4.35,3.03,5.13,4.65],["c",1.14,2.34,.51,5.07,-1.44,6.39],["c",-.66,.42,-1.32,.63,-2.13,.69],["c",-2.01,.09,-3.81,-1.41,-4.26,-3.54],["c",-.09,-.42,-.09,-1.2,-.03,-1.5],["c",.15,-.45,.39,-.81,.66,-.93],["c",.33,-.18,.84,-.21,1.23,-.15],["c",.81,.18,1.32,.93,1.26,1.89],["c",-.03,.36,-.09,.57,-.24,.9],["c",-.15,.33,-.45,.6,-.72,.75],["c",-.12,.06,-.18,.09,-.18,.12],["c",0,.03,.03,.15,.09,.24],["c",.18,.45,.54,.87,.96,1.08],["c",1.11,.57,2.34,.18,2.88,-.9],["c",.24,-.51,.33,-1.11,.24,-1.83],["c",-.27,-1.92,-1.5,-3.54,-3.93,-5.13],["c",-.48,-.33,-1.26,-.78,-1.29,-.78],["c",-.03,0,-1.35,2.19,-2.91,4.89],["l",-2.88,4.89],["l",-.87,0],["l",-.87,0],["l",.03,-.06],["c",.15,-.21,6.15,-10.41,6.15,-10.44],["c",0,0,-.21,-.15,-.48,-.3],["c",-2.61,-1.44,-4.35,-3,-5.13,-4.62],["c",-.9,-1.89,-.72,-4.02,.48,-5.52],["c",.69,-.84,1.68,-1.41,2.73,-1.53],["z"],["m",8.76,9.09],["c",.03,-.03,.15,-.03,.27,-.03],["c",.33,.03,.57,.18,.72,.48],["c",.09,.18,.09,.57,0,.75],["c",-.09,.18,-.21,.3,-.36,.39],["c",-.15,.06,-.21,.06,-.39,.06],["c",-.21,0,-.27,0,-.39,-.06],["c",-.3,-.15,-.48,-.45,-.48,-.75],["c",0,-.39,.24,-.72,.63,-.84],["z"],["m",-10.53,2.61],["c",.03,-.03,.15,-.03,.27,-.03],["c",.33,.03,.57,.18,.72,.48],["c",.09,.18,.09,.57,0,.75],["c",-.09,.18,-.21,.3,-.36,.39],["c",-.15,.06,-.21,.06,-.39,.06],["c",-.21,0,-.27,0,-.39,-.06],["c",-.3,-.15,-.48,-.45,-.48,-.75],["c",0,-.39,.24,-.72,.63,-.84],["z"]],w:15,h:22.504},"scripts.coda":{d:[["M",-.21,-10.47],["c",.18,-.12,.42,-.06,.54,.12],["c",.06,.09,.06,.18,.06,1.5],["l",0,1.38],["l",.18,0],["c",.39,.06,.96,.24,1.38,.48],["c",1.68,.93,2.82,3.24,3.03,6.12],["c",.03,.24,.03,.45,.03,.45],["c",0,.03,.6,.03,1.35,.03],["c",1.5,0,1.47,0,1.59,.18],["c",.09,.12,.09,.3,0,.42],["c",-.12,.18,-.09,.18,-1.59,.18],["c",-.75,0,-1.35,0,-1.35,.03],["c",0,0,0,.21,-.03,.42],["c",-.24,3.15,-1.53,5.58,-3.45,6.36],["c",-.27,.12,-.72,.24,-.96,.27],["l",-.18,0],["l",0,1.38],["c",0,1.32,0,1.41,-.06,1.5],["c",-.15,.24,-.51,.24,-.66,0],["c",-.06,-.09,-.06,-.18,-.06,-1.5],["l",0,-1.38],["l",-.18,0],["c",-.39,-.06,-.96,-.24,-1.38,-.48],["c",-1.68,-.93,-2.82,-3.24,-3.03,-6.15],["c",-.03,-.21,-.03,-.42,-.03,-.42],["c",0,-.03,-.6,-.03,-1.35,-.03],["c",-1.5,0,-1.47,0,-1.59,-.18],["c",-.09,-.12,-.09,-.3,0,-.42],["c",.12,-.18,.09,-.18,1.59,-.18],["c",.75,0,1.35,0,1.35,-.03],["c",0,0,0,-.21,.03,-.45],["c",.24,-3.12,1.53,-5.55,3.45,-6.33],["c",.27,-.12,.72,-.24,.96,-.27],["l",.18,0],["l",0,-1.38],["c",0,-1.53,0,-1.5,.18,-1.62],["z"],["m",-.18,6.93],["c",0,-2.97,0,-3.15,-.06,-3.15],["c",-.09,0,-.51,.15,-.66,.21],["c",-.87,.51,-1.38,1.62,-1.56,3.51],["c",-.06,.54,-.12,1.59,-.12,2.16],["l",0,.42],["l",1.2,0],["l",1.2,0],["l",0,-3.15],["z"],["m",1.17,-3.06],["c",-.09,-.03,-.21,-.06,-.27,-.09],["l",-.12,0],["l",0,3.15],["l",0,3.15],["l",1.2,0],["l",1.2,0],["l",0,-.81],["c",-.06,-2.4,-.33,-3.69,-.93,-4.59],["c",-.27,-.39,-.66,-.69,-1.08,-.81],["z"],["m",-1.17,10.14],["l",0,-3.15],["l",-1.2,0],["l",-1.2,0],["l",0,.81],["c",.03,.96,.06,1.47,.15,2.13],["c",.24,2.04,.96,3.12,2.13,3.36],["l",.12,0],["l",0,-3.15],["z"],["m",3.18,-2.34],["l",0,-.81],["l",-1.2,0],["l",-1.2,0],["l",0,3.15],["l",0,3.15],["l",.12,0],["c",1.17,-.24,1.89,-1.32,2.13,-3.36],["c",.09,-.66,.12,-1.17,.15,-2.13],["z"]],w:16.035,h:21.062},"scripts.comma":{d:[["M",1.14,-4.62],["c",.3,-.12,.69,-.03,.93,.15],["c",.12,.12,.36,.45,.51,.78],["c",.9,1.77,.54,4.05,-1.08,6.75],["c",-.36,.63,-.87,1.38,-.96,1.44],["c",-.18,.12,-.42,.06,-.54,-.12],["c",-.09,-.18,-.09,-.3,.12,-.6],["c",.96,-1.44,1.44,-2.97,1.38,-4.35],["c",-.06,-.93,-.3,-1.68,-.78,-2.46],["c",-.27,-.39,-.33,-.63,-.24,-.96],["c",.09,-.27,.36,-.54,.66,-.63],["z"]],w:3.042,h:9.237},"scripts.roll":{d:[["M",1.95,-6],["c",.21,-.09,.36,-.09,.57,0],["c",.39,.15,.63,.39,1.47,1.35],["c",.66,.75,.78,.87,1.08,1.05],["c",.75,.45,1.65,.42,2.4,-.06],["c",.12,-.09,.27,-.27,.54,-.6],["c",.42,-.54,.51,-.63,.69,-.63],["c",.09,0,.3,.12,.36,.21],["c",.09,.12,.12,.3,.03,.42],["c",-.06,.12,-3.15,3.9,-3.3,4.08],["c",-.06,.06,-.18,.12,-.27,.18],["c",-.27,.12,-.6,.06,-.99,-.27],["c",-.27,-.21,-.42,-.39,-1.08,-1.14],["c",-.63,-.72,-.81,-.9,-1.17,-1.08],["c",-.36,-.18,-.57,-.21,-.99,-.21],["c",-.39,0,-.63,.03,-.93,.18],["c",-.36,.15,-.51,.27,-.9,.81],["c",-.24,.27,-.45,.51,-.48,.54],["c",-.12,.09,-.27,.06,-.39,0],["c",-.24,-.15,-.33,-.39,-.21,-.6],["c",.09,-.12,3.18,-3.87,3.33,-4.02],["c",.06,-.06,.18,-.15,.24,-.21],["z"]],w:10.817,h:6.125},"scripts.prall":{d:[["M",-4.38,-3.69],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["c",.03,0,.57,-.84,1.23,-1.83],["c",1.14,-1.68,1.23,-1.83,1.35,-1.89],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["l",.48,-.69],["c",.51,-.78,.54,-.84,.69,-.9],["c",.42,-.18,.87,.15,.81,.6],["c",-.03,.12,-.3,.51,-1.5,2.37],["c",-1.38,2.07,-1.5,2.22,-1.62,2.28],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["c",-.03,0,-.57,.84,-1.23,1.83],["c",-1.14,1.68,-1.23,1.83,-1.35,1.89],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["l",-.48,.69],["c",-.51,.78,-.54,.84,-.69,.9],["c",-.42,.18,-.87,-.15,-.81,-.6],["c",.03,-.12,.3,-.51,1.5,-2.37],["c",1.38,-2.07,1.5,-2.22,1.62,-2.28],["z"]],w:15.011,h:7.5},"scripts.arpeggio":{d:[["M",1.5,0],["c",1.5,2,1.5,3,1.5,3],["s",0,1,-2,1.5],["s",-.5,3,1,5.5],["l",1.5,0],["s",-1.75,-2,-1.9,-3.25],["s",2.15,-.6,2.95,-1.6],["s",.45,-1,.5,-1.25],["s",0,-1,-2,-3.9],["l",-1.5,0],["z"]],w:5,h:10},"scripts.mordent":{d:[["M",-.21,-4.95],["c",.27,-.15,.63,0,.75,.27],["c",.06,.12,.06,.24,.06,1.44],["l",0,1.29],["l",.57,-.84],["c",.51,-.75,.57,-.84,.69,-.9],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["l",.48,-.69],["c",.51,-.78,.54,-.84,.69,-.9],["c",.42,-.18,.87,.15,.81,.6],["c",-.03,.12,-.3,.51,-1.5,2.37],["c",-1.38,2.07,-1.5,2.22,-1.62,2.28],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.83,-1.89],["c",-.81,-.99,-1.5,-1.8,-1.53,-1.86],["c",-.06,-.03,-.06,-.03,-.12,.03],["c",-.06,.06,-.06,.15,-.06,2.28],["c",0,1.95,0,2.25,-.06,2.34],["c",-.18,.45,-.81,.48,-1.05,.03],["c",-.03,-.06,-.06,-.24,-.06,-1.41],["l",0,-1.35],["l",-.57,.84],["c",-.54,.78,-.6,.87,-.72,.93],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["l",-.48,.69],["c",-.51,.78,-.54,.84,-.69,.9],["c",-.42,.18,-.87,-.15,-.81,-.6],["c",.03,-.12,.3,-.51,1.5,-2.37],["c",1.38,-2.07,1.5,-2.22,1.62,-2.28],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["c",.03,0,.06,-.06,.09,-.09],["c",.06,-.12,.06,-.15,.06,-2.28],["c",0,-1.92,0,-2.22,.06,-2.31],["c",.06,-.15,.15,-.24,.3,-.3],["z"]],w:15.011,h:10.012},"flags.u8th":{d:[["M",-.42,3.75],["l",0,-3.75],["l",.21,0],["l",.21,0],["l",0,.18],["c",0,.3,.06,.84,.12,1.23],["c",.24,1.53,.9,3.12,2.13,5.16],["l",.99,1.59],["c",.87,1.44,1.38,2.34,1.77,3.09],["c",.81,1.68,1.2,3.06,1.26,4.53],["c",.03,1.53,-.21,3.27,-.75,5.01],["c",-.21,.69,-.51,1.5,-.6,1.59],["c",-.09,.12,-.27,.21,-.42,.21],["c",-.15,0,-.42,-.12,-.51,-.21],["c",-.15,-.18,-.18,-.42,-.09,-.66],["c",.15,-.33,.45,-1.2,.57,-1.62],["c",.42,-1.38,.6,-2.58,.6,-3.9],["c",0,-.66,0,-.81,-.06,-1.11],["c",-.39,-2.07,-1.8,-4.26,-4.59,-7.14],["l",-.42,-.45],["l",-.21,0],["l",-.21,0],["l",0,-3.75],["z"]],w:6.692,h:22.59},"flags.u16th":{d:[["M",-.42,7.5],["l",0,-7.5],["l",.21,0],["l",.21,0],["l",0,.39],["c",.06,1.08,.39,2.19,.99,3.39],["c",.45,.9,.87,1.59,1.95,3.12],["c",1.29,1.86,1.77,2.64,2.22,3.57],["c",.45,.93,.72,1.8,.87,2.64],["c",.06,.51,.06,1.5,0,1.92],["c",-.12,.6,-.3,1.2,-.54,1.71],["l",-.09,.24],["l",.18,.45],["c",.51,1.2,.72,2.22,.69,3.42],["c",-.06,1.53,-.39,3.03,-.99,4.53],["c",-.3,.75,-.36,.81,-.57,.9],["c",-.15,.09,-.33,.06,-.48,0],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.12,-.75],["c",.66,-1.41,1.02,-2.88,1.08,-4.32],["c",0,-.6,-.03,-1.05,-.18,-1.59],["c",-.3,-1.2,-.99,-2.4,-2.25,-3.87],["c",-.42,-.48,-1.53,-1.62,-2.19,-2.22],["l",-.45,-.42],["l",-.03,1.11],["l",0,1.11],["l",-.21,0],["l",-.21,0],["l",0,-7.5],["z"],["m",1.65,.09],["c",-.3,-.3,-.69,-.72,-.9,-.87],["l",-.33,-.33],["l",0,.15],["c",0,.3,.06,.81,.15,1.26],["c",.27,1.29,.87,2.61,2.04,4.29],["c",.15,.24,.6,.87,.96,1.38],["l",1.08,1.53],["l",.42,.63],["c",.03,0,.12,-.36,.21,-.72],["c",.06,-.33,.06,-1.2,0,-1.62],["c",-.33,-1.71,-1.44,-3.48,-3.63,-5.7],["z"]],w:6.693,h:26.337},"flags.u32nd":{d:[["M",-.42,11.25],["l",0,-11.25],["l",.21,0],["l",.21,0],["l",0,.36],["c",.09,1.68,.69,3.27,2.07,5.46],["l",.87,1.35],["c",1.02,1.62,1.47,2.37,1.86,3.18],["c",.48,1.02,.78,1.92,.93,2.88],["c",.06,.48,.06,1.5,0,1.89],["c",-.09,.42,-.21,.87,-.36,1.26],["l",-.12,.3],["l",.15,.39],["c",.69,1.56,.84,2.88,.54,4.38],["c",-.09,.45,-.27,1.08,-.45,1.47],["l",-.12,.24],["l",.18,.36],["c",.33,.72,.57,1.56,.69,2.34],["c",.12,1.02,-.06,2.52,-.42,3.84],["c",-.27,.93,-.75,2.13,-.93,2.31],["c",-.18,.15,-.45,.18,-.66,.09],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.06,-.6],["c",.21,-.36,.42,-.9,.57,-1.38],["c",.51,-1.41,.69,-3.06,.48,-4.08],["c",-.15,-.81,-.57,-1.68,-1.2,-2.55],["c",-.72,-.99,-1.83,-2.13,-3.3,-3.33],["l",-.48,-.42],["l",-.03,1.53],["l",0,1.56],["l",-.21,0],["l",-.21,0],["l",0,-11.25],["z"],["m",1.26,-3.96],["c",-.27,-.3,-.54,-.6,-.66,-.72],["l",-.18,-.21],["l",0,.42],["c",.06,.87,.24,1.74,.66,2.67],["c",.36,.87,.96,1.86,1.92,3.18],["c",.21,.33,.63,.87,.87,1.23],["c",.27,.39,.6,.84,.75,1.08],["l",.27,.39],["l",.03,-.12],["c",.12,-.45,.15,-1.05,.09,-1.59],["c",-.27,-1.86,-1.38,-3.78,-3.75,-6.33],["z"],["m",-.27,6.09],["c",-.27,-.21,-.48,-.42,-.51,-.45],["c",-.06,-.03,-.06,-.03,-.06,.21],["c",0,.9,.3,2.04,.81,3.09],["c",.48,1.02,.96,1.77,2.37,3.63],["c",.6,.78,1.05,1.44,1.29,1.77],["c",.06,.12,.15,.21,.15,.18],["c",.03,-.03,.18,-.57,.24,-.87],["c",.06,-.45,.06,-1.32,-.03,-1.74],["c",-.09,-.48,-.24,-.9,-.51,-1.44],["c",-.66,-1.35,-1.83,-2.7,-3.75,-4.38],["z"]],w:6.697,h:32.145},"flags.u64th":{d:[["M",-.42,15],["l",0,-15],["l",.21,0],["l",.21,0],["l",0,.36],["c",.06,1.2,.39,2.37,1.02,3.66],["c",.39,.81,.84,1.56,1.8,3.09],["c",.81,1.26,1.05,1.68,1.35,2.22],["c",.87,1.5,1.35,2.79,1.56,4.08],["c",.06,.54,.06,1.56,-.03,2.04],["c",-.09,.48,-.21,.99,-.36,1.35],["l",-.12,.27],["l",.12,.27],["c",.09,.15,.21,.45,.27,.66],["c",.69,1.89,.63,3.66,-.18,5.46],["l",-.18,.39],["l",.15,.33],["c",.3,.66,.51,1.44,.63,2.1],["c",.06,.48,.06,1.35,0,1.71],["c",-.15,.57,-.42,1.2,-.78,1.68],["l",-.21,.27],["l",.18,.33],["c",.57,1.05,.93,2.13,1.02,3.18],["c",.06,.72,0,1.83,-.21,2.79],["c",-.18,1.02,-.63,2.34,-1.02,3.09],["c",-.15,.33,-.48,.45,-.78,.3],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.03,-.54],["c",.75,-1.5,1.23,-3.45,1.17,-4.89],["c",-.06,-1.02,-.42,-2.01,-1.17,-3.15],["c",-.48,-.72,-1.02,-1.35,-1.89,-2.22],["c",-.57,-.57,-1.56,-1.5,-1.92,-1.77],["l",-.12,-.09],["l",0,1.68],["l",0,1.68],["l",-.21,0],["l",-.21,0],["l",0,-15],["z"],["m",.93,-8.07],["c",-.27,-.3,-.48,-.54,-.51,-.54],["c",0,0,0,.69,.03,1.02],["c",.15,1.47,.75,2.94,2.04,4.83],["l",1.08,1.53],["c",.39,.57,.84,1.2,.99,1.44],["c",.15,.24,.3,.45,.3,.45],["c",0,0,.03,-.09,.06,-.21],["c",.36,-1.59,-.15,-3.33,-1.47,-5.4],["c",-.63,-.93,-1.35,-1.83,-2.52,-3.12],["z"],["m",.06,6.72],["c",-.24,-.21,-.48,-.42,-.51,-.45],["l",-.06,-.06],["l",0,.33],["c",0,1.2,.3,2.34,.93,3.6],["c",.45,.9,.96,1.68,2.25,3.51],["c",.39,.54,.84,1.17,1.02,1.44],["c",.21,.33,.33,.51,.33,.48],["c",.06,-.09,.21,-.63,.3,-.99],["c",.06,-.33,.06,-.45,.06,-.96],["c",0,-.6,-.03,-.84,-.18,-1.35],["c",-.3,-1.08,-1.02,-2.28,-2.13,-3.57],["c",-.39,-.45,-1.44,-1.47,-2.01,-1.98],["z"],["m",0,6.72],["c",-.24,-.21,-.48,-.39,-.51,-.42],["l",-.06,-.06],["l",0,.33],["c",0,1.41,.45,2.82,1.38,4.35],["c",.42,.72,.72,1.14,1.86,2.73],["c",.36,.45,.75,.99,.87,1.2],["c",.15,.21,.3,.36,.3,.36],["c",.06,0,.3,-.48,.39,-.75],["c",.09,-.36,.12,-.63,.12,-1.05],["c",-.06,-1.05,-.45,-2.04,-1.2,-3.18],["c",-.57,-.87,-1.11,-1.53,-2.07,-2.49],["c",-.36,-.33,-.84,-.78,-1.08,-1.02],["z"]],w:6.682,h:39.694},"flags.d8th":{d:[["M",5.67,-21.63],["c",.24,-.12,.54,-.06,.69,.15],["c",.06,.06,.21,.36,.39,.66],["c",.84,1.77,1.26,3.36,1.32,5.1],["c",.03,1.29,-.21,2.37,-.81,3.63],["c",-.6,1.23,-1.26,2.13,-3.21,4.38],["c",-1.35,1.53,-1.86,2.19,-2.4,2.97],["c",-.63,.93,-1.11,1.92,-1.38,2.79],["c",-.15,.54,-.27,1.35,-.27,1.8],["l",0,.15],["l",-.21,0],["l",-.21,0],["l",0,-3.75],["l",0,-3.75],["l",.21,0],["l",.21,0],["l",.48,-.3],["c",1.83,-1.11,3.12,-2.1,4.17,-3.12],["c",.78,-.81,1.32,-1.53,1.71,-2.31],["c",.45,-.93,.6,-1.74,.51,-2.88],["c",-.12,-1.56,-.63,-3.18,-1.47,-4.68],["c",-.12,-.21,-.15,-.33,-.06,-.51],["c",.06,-.15,.15,-.24,.33,-.33],["z"]],w:8.492,h:21.691},"flags.ugrace":{d:[["M",6.03,6.93],["c",.15,-.09,.33,-.06,.51,0],["c",.15,.09,.21,.15,.3,.33],["c",.09,.18,.06,.39,-.03,.54],["c",-.06,.15,-10.89,8.88,-11.07,8.97],["c",-.15,.09,-.33,.06,-.48,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.06,-.39,.03,-.54],["c",.06,-.15,10.89,-8.88,11.07,-8.97],["z"]],w:12.019,h:9.954},"flags.dgrace":{d:[["M",-6.06,-15.93],["c",.18,-.09,.33,-.12,.48,-.06],["c",.18,.09,14.01,8.04,14.1,8.1],["c",.12,.12,.18,.33,.18,.51],["c",-.03,.21,-.15,.39,-.36,.48],["c",-.18,.09,-.33,.12,-.48,.06],["c",-.18,-.09,-14.01,-8.04,-14.1,-8.1],["c",-.12,-.12,-.18,-.33,-.18,-.51],["c",.03,-.21,.15,-.39,.36,-.48],["z"]],w:15.12,h:9.212},"flags.d16th":{d:[["M",6.84,-22.53],["c",.27,-.12,.57,-.06,.72,.15],["c",.15,.15,.33,.87,.45,1.56],["c",.06,.33,.06,1.35,0,1.65],["c",-.06,.33,-.15,.78,-.27,1.11],["c",-.12,.33,-.45,.96,-.66,1.32],["l",-.18,.27],["l",.09,.18],["c",.48,1.02,.72,2.25,.69,3.3],["c",-.06,1.23,-.42,2.28,-1.26,3.45],["c",-.57,.87,-.99,1.32,-3,3.39],["c",-1.56,1.56,-2.22,2.4,-2.76,3.45],["c",-.42,.84,-.66,1.8,-.66,2.55],["l",0,.15],["l",-.21,0],["l",-.21,0],["l",0,-7.5],["l",0,-7.5],["l",.21,0],["l",.21,0],["l",0,1.14],["l",0,1.11],["l",.27,-.15],["c",1.11,-.57,1.77,-.99,2.52,-1.47],["c",2.37,-1.56,3.69,-3.15,4.05,-4.83],["c",.03,-.18,.03,-.39,.03,-.78],["c",0,-.6,-.03,-.93,-.24,-1.5],["c",-.06,-.18,-.12,-.39,-.15,-.45],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.63,7.5],["c",-.06,-.18,-.15,-.36,-.15,-.36],["c",-.03,0,-.03,.03,-.06,.06],["c",-.06,.12,-.96,1.02,-1.95,1.98],["c",-.63,.57,-1.26,1.17,-1.44,1.35],["c",-1.53,1.62,-2.28,2.85,-2.55,4.32],["c",-.03,.18,-.03,.54,-.06,.99],["l",0,.69],["l",.18,-.09],["c",.93,-.54,2.1,-1.29,2.82,-1.83],["c",.69,-.51,1.02,-.81,1.53,-1.29],["c",1.86,-1.89,2.37,-3.66,1.68,-5.82],["z"]],w:8.475,h:22.591},"flags.d32nd":{d:[["M",6.84,-29.13],["c",.27,-.12,.57,-.06,.72,.15],["c",.12,.12,.27,.63,.36,1.11],["c",.33,1.59,.06,3.06,-.81,4.47],["l",-.18,.27],["l",.09,.15],["c",.12,.24,.33,.69,.45,1.05],["c",.63,1.83,.45,3.57,-.57,5.22],["l",-.18,.3],["l",.15,.27],["c",.42,.87,.6,1.71,.57,2.61],["c",-.06,1.29,-.48,2.46,-1.35,3.78],["c",-.54,.81,-.93,1.29,-2.46,3],["c",-.51,.54,-1.05,1.17,-1.26,1.41],["c",-1.56,1.86,-2.25,3.36,-2.37,5.01],["l",0,.33],["l",-.21,0],["l",-.21,0],["l",0,-11.25],["l",0,-11.25],["l",.21,0],["l",.21,0],["l",0,1.35],["l",.03,1.35],["l",.78,-.39],["c",1.38,-.69,2.34,-1.26,3.24,-1.92],["c",1.38,-1.02,2.28,-2.13,2.64,-3.21],["c",.15,-.48,.18,-.72,.18,-1.29],["c",0,-.57,-.06,-.9,-.24,-1.47],["c",-.06,-.18,-.12,-.39,-.15,-.45],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.63,7.2],["c",-.09,-.18,-.12,-.21,-.12,-.15],["c",-.03,.09,-1.02,1.08,-2.04,2.04],["c",-1.17,1.08,-1.65,1.56,-2.07,2.04],["c",-.84,.96,-1.38,1.86,-1.68,2.76],["c",-.21,.57,-.27,.99,-.3,1.65],["l",0,.54],["l",.66,-.33],["c",3.57,-1.86,5.49,-3.69,5.94,-5.7],["c",.06,-.39,.06,-1.2,-.03,-1.65],["c",-.06,-.39,-.24,-.9,-.36,-1.2],["z"],["m",-.06,7.2],["c",-.06,-.15,-.12,-.33,-.15,-.45],["l",-.06,-.18],["l",-.18,.21],["l",-1.83,1.83],["c",-.87,.9,-1.77,1.8,-1.95,2.01],["c",-1.08,1.29,-1.62,2.31,-1.89,3.51],["c",-.06,.3,-.06,.51,-.09,.93],["l",0,.57],["l",.09,-.06],["c",.75,-.45,1.89,-1.26,2.52,-1.74],["c",.81,-.66,1.74,-1.53,2.22,-2.16],["c",1.26,-1.53,1.68,-3.06,1.32,-4.47],["z"]],w:8.385,h:29.191},"flags.d64th":{d:[["M",7.08,-32.88],["c",.3,-.12,.66,-.03,.78,.24],["c",.18,.33,.27,2.1,.15,2.64],["c",-.09,.39,-.21,.78,-.39,1.08],["l",-.15,.3],["l",.09,.27],["c",.03,.12,.09,.45,.12,.69],["c",.27,1.44,.18,2.55,-.3,3.6],["l",-.12,.33],["l",.06,.42],["c",.27,1.35,.33,2.82,.21,3.63],["c",-.12,.6,-.3,1.23,-.57,1.8],["l",-.15,.27],["l",.03,.42],["c",.06,1.02,.06,2.7,.03,3.06],["c",-.15,1.47,-.66,2.76,-1.74,4.41],["c",-.45,.69,-.75,1.11,-1.74,2.37],["c",-1.05,1.38,-1.5,1.98,-1.95,2.73],["c",-.93,1.5,-1.38,2.82,-1.44,4.2],["l",0,.42],["l",-.21,0],["l",-.21,0],["l",0,-15],["l",0,-15],["l",.21,0],["l",.21,0],["l",0,1.86],["l",0,1.89],["c",0,0,.21,-.03,.45,-.09],["c",2.22,-.39,4.08,-1.11,5.19,-2.01],["c",.63,-.54,1.02,-1.14,1.2,-1.8],["c",.06,-.3,.06,-1.14,-.03,-1.65],["c",-.03,-.18,-.06,-.39,-.09,-.48],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.45,6.15],["c",-.03,-.18,-.06,-.42,-.06,-.54],["l",-.03,-.18],["l",-.33,.3],["c",-.42,.36,-.87,.72,-1.68,1.29],["c",-1.98,1.38,-2.25,1.59,-2.85,2.16],["c",-.75,.69,-1.23,1.44,-1.47,2.19],["c",-.15,.45,-.18,.63,-.21,1.35],["l",0,.66],["l",.39,-.18],["c",1.83,-.9,3.45,-1.95,4.47,-2.91],["c",.93,-.9,1.53,-1.83,1.74,-2.82],["c",.06,-.33,.06,-.87,.03,-1.32],["z"],["m",-.27,4.86],["c",-.03,-.21,-.06,-.36,-.06,-.36],["c",0,-.03,-.12,.09,-.24,.24],["c",-.39,.48,-.99,1.08,-2.16,2.19],["c",-1.47,1.38,-1.92,1.83,-2.46,2.49],["c",-.66,.87,-1.08,1.74,-1.29,2.58],["c",-.09,.42,-.15,.87,-.15,1.44],["l",0,.54],["l",.48,-.33],["c",1.5,-1.02,2.58,-1.89,3.51,-2.82],["c",1.47,-1.47,2.25,-2.85,2.4,-4.26],["c",.03,-.39,.03,-1.17,-.03,-1.71],["z"],["m",-.66,7.68],["c",.03,-.15,.03,-.6,.03,-.99],["l",0,-.72],["l",-.27,.33],["l",-1.74,1.98],["c",-1.77,1.92,-2.43,2.76,-2.97,3.9],["c",-.51,1.02,-.72,1.77,-.75,2.91],["c",0,.63,0,.63,.06,.6],["c",.03,-.03,.3,-.27,.63,-.54],["c",.66,-.6,1.86,-1.8,2.31,-2.31],["c",1.65,-1.89,2.52,-3.54,2.7,-5.16],["z"]],w:8.485,h:32.932},"clefs.C":{d:[["M",.06,-14.94],["l",.09,-.06],["l",1.92,0],["l",1.92,0],["l",.09,.06],["l",.06,.09],["l",0,14.85],["l",0,14.82],["l",-.06,.09],["l",-.09,.06],["l",-1.92,0],["l",-1.92,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-14.82],["l",0,-14.85],["z"],["m",5.37,0],["c",.09,-.06,.09,-.06,.57,-.06],["c",.45,0,.45,0,.54,.06],["l",.06,.09],["l",0,7.14],["l",0,7.11],["l",.09,-.06],["c",.18,-.18,.72,-.84,.96,-1.2],["c",.3,-.45,.66,-1.17,.84,-1.65],["c",.36,-.9,.57,-1.83,.6,-2.79],["c",.03,-.48,.03,-.54,.09,-.63],["c",.12,-.18,.36,-.21,.54,-.12],["c",.18,.09,.21,.15,.24,.66],["c",.06,.87,.21,1.56,.57,2.22],["c",.51,1.02,1.26,1.68,2.22,1.92],["c",.21,.06,.33,.06,.78,.06],["c",.45,0,.57,0,.84,-.06],["c",.45,-.12,.81,-.33,1.08,-.6],["c",.57,-.57,.87,-1.41,.99,-2.88],["c",.06,-.54,.06,-3,0,-3.57],["c",-.21,-2.58,-.84,-3.87,-2.16,-4.5],["c",-.48,-.21,-1.17,-.36,-1.77,-.36],["c",-.69,0,-1.29,.27,-1.5,.72],["c",-.06,.15,-.06,.21,-.06,.42],["c",0,.24,0,.3,.06,.45],["c",.12,.24,.24,.39,.63,.66],["c",.42,.3,.57,.48,.69,.72],["c",.06,.15,.06,.21,.06,.48],["c",0,.39,-.03,.63,-.21,.96],["c",-.3,.6,-.87,1.08,-1.5,1.26],["c",-.27,.06,-.87,.06,-1.14,0],["c",-.78,-.24,-1.44,-.87,-1.65,-1.68],["c",-.12,-.42,-.09,-1.17,.09,-1.71],["c",.51,-1.65,1.98,-2.82,3.81,-3.09],["c",.84,-.09,2.46,.03,3.51,.27],["c",2.22,.57,3.69,1.8,4.44,3.75],["c",.36,.93,.57,2.13,.57,3.36],["c",0,1.44,-.48,2.73,-1.38,3.81],["c",-1.26,1.5,-3.27,2.43,-5.28,2.43],["c",-.48,0,-.51,0,-.75,-.09],["c",-.15,-.03,-.48,-.21,-.78,-.36],["c",-.69,-.36,-.87,-.42,-1.26,-.42],["c",-.27,0,-.3,0,-.51,.09],["c",-.57,.3,-.81,.9,-.81,2.1],["c",0,1.23,.24,1.83,.81,2.13],["c",.21,.09,.24,.09,.51,.09],["c",.39,0,.57,-.06,1.26,-.42],["c",.3,-.15,.63,-.33,.78,-.36],["c",.24,-.09,.27,-.09,.75,-.09],["c",2.01,0,4.02,.93,5.28,2.4],["c",.9,1.11,1.38,2.4,1.38,3.84],["c",0,1.5,-.3,2.88,-.84,3.96],["c",-.78,1.59,-2.19,2.64,-4.17,3.15],["c",-1.05,.24,-2.67,.36,-3.51,.27],["c",-1.83,-.27,-3.3,-1.44,-3.81,-3.09],["c",-.18,-.54,-.21,-1.29,-.09,-1.74],["c",.15,-.6,.63,-1.2,1.23,-1.47],["c",.36,-.18,.57,-.21,.99,-.21],["c",.42,0,.63,.03,1.02,.21],["c",.42,.21,.84,.63,1.05,1.05],["c",.18,.36,.21,.6,.21,.96],["c",0,.3,0,.36,-.06,.51],["c",-.12,.24,-.27,.42,-.69,.72],["c",-.57,.42,-.69,.63,-.69,1.08],["c",0,.24,0,.3,.06,.45],["c",.12,.21,.3,.39,.57,.54],["c",.42,.18,.87,.21,1.53,.15],["c",1.08,-.15,1.8,-.57,2.34,-1.32],["c",.54,-.75,.84,-1.83,.99,-3.51],["c",.06,-.57,.06,-3.03,0,-3.57],["c",-.12,-1.47,-.42,-2.31,-.99,-2.88],["c",-.27,-.27,-.63,-.48,-1.08,-.6],["c",-.27,-.06,-.39,-.06,-.84,-.06],["c",-.45,0,-.57,0,-.78,.06],["c",-1.14,.27,-2.01,1.17,-2.46,2.49],["c",-.21,.57,-.3,.99,-.33,1.65],["c",-.03,.51,-.06,.57,-.24,.66],["c",-.12,.06,-.27,.06,-.39,0],["c",-.21,-.09,-.21,-.15,-.24,-.75],["c",-.09,-1.92,-.78,-3.72,-2.01,-5.19],["c",-.18,-.21,-.36,-.42,-.39,-.45],["l",-.09,-.06],["l",0,7.11],["l",0,7.14],["l",-.06,.09],["c",-.09,.06,-.09,.06,-.54,.06],["c",-.48,0,-.48,0,-.57,-.06],["l",-.06,-.09],["l",0,-14.82],["l",0,-14.85],["z"]],w:20.31,h:29.97},"clefs.F":{d:[["M",6.3,-7.8],["c",.36,-.03,1.65,0,2.13,.03],["c",3.6,.42,6.03,2.1,6.93,4.86],["c",.27,.84,.36,1.5,.36,2.58],["c",0,.9,-.03,1.35,-.18,2.16],["c",-.78,3.78,-3.54,7.08,-8.37,9.96],["c",-1.74,1.05,-3.87,2.13,-6.18,3.12],["c",-.39,.18,-.75,.33,-.81,.36],["c",-.06,.03,-.15,.06,-.18,.06],["c",-.15,0,-.33,-.18,-.33,-.33],["c",0,-.15,.06,-.21,.51,-.48],["c",3,-1.77,5.13,-3.21,6.84,-4.74],["c",.51,-.45,1.59,-1.5,1.95,-1.95],["c",1.89,-2.19,2.88,-4.32,3.15,-6.78],["c",.06,-.42,.06,-1.77,0,-2.19],["c",-.24,-2.01,-.93,-3.63,-2.04,-4.71],["c",-.63,-.63,-1.29,-1.02,-2.07,-1.2],["c",-1.62,-.39,-3.36,.15,-4.56,1.44],["c",-.54,.6,-1.05,1.47,-1.32,2.22],["l",-.09,.21],["l",.24,-.12],["c",.39,-.21,.63,-.24,1.11,-.24],["c",.3,0,.45,0,.66,.06],["c",1.92,.48,2.85,2.55,1.95,4.38],["c",-.45,.99,-1.41,1.62,-2.46,1.71],["c",-1.47,.09,-2.91,-.87,-3.39,-2.25],["c",-.18,-.57,-.21,-1.32,-.03,-2.28],["c",.39,-2.25,1.83,-4.2,3.81,-5.19],["c",.69,-.36,1.59,-.6,2.37,-.69],["z"],["m",11.58,2.52],["c",.84,-.21,1.71,.3,1.89,1.14],["c",.3,1.17,-.72,2.19,-1.89,1.89],["c",-.99,-.21,-1.5,-1.32,-1.02,-2.25],["c",.18,-.39,.6,-.69,1.02,-.78],["z"],["m",0,7.5],["c",.84,-.21,1.71,.3,1.89,1.14],["c",.21,.87,-.3,1.71,-1.14,1.89],["c",-.87,.21,-1.71,-.3,-1.89,-1.14],["c",-.21,-.84,.3,-1.71,1.14,-1.89],["z"]],w:20.153,h:23.142},"clefs.G":{d:[["M",9.69,-37.41],["c",.09,-.09,.24,-.06,.36,0],["c",.12,.09,.57,.6,.96,1.11],["c",1.77,2.34,3.21,5.85,3.57,8.73],["c",.21,1.56,.03,3.27,-.45,4.86],["c",-.69,2.31,-1.92,4.47,-4.23,7.44],["c",-.3,.39,-.57,.72,-.6,.75],["c",-.03,.06,0,.15,.18,.78],["c",.54,1.68,1.38,4.44,1.68,5.49],["l",.09,.42],["l",.39,0],["c",1.47,.09,2.76,.51,3.96,1.29],["c",1.83,1.23,3.06,3.21,3.39,5.52],["c",.09,.45,.12,1.29,.06,1.74],["c",-.09,1.02,-.33,1.83,-.75,2.73],["c",-.84,1.71,-2.28,3.06,-4.02,3.72],["l",-.33,.12],["l",.03,1.26],["c",0,1.74,-.06,3.63,-.21,4.62],["c",-.45,3.06,-2.19,5.49,-4.47,6.21],["c",-.57,.18,-.9,.21,-1.59,.21],["c",-.69,0,-1.02,-.03,-1.65,-.21],["c",-1.14,-.27,-2.13,-.84,-2.94,-1.65],["c",-.99,-.99,-1.56,-2.16,-1.71,-3.54],["c",-.09,-.81,.06,-1.53,.45,-2.13],["c",.63,-.99,1.83,-1.56,3,-1.53],["c",1.5,.09,2.64,1.32,2.73,2.94],["c",.06,1.47,-.93,2.7,-2.37,2.97],["c",-.45,.06,-.84,.03,-1.29,-.09],["l",-.21,-.09],["l",.09,.12],["c",.39,.54,.78,.93,1.32,1.26],["c",1.35,.87,3.06,1.02,4.35,.36],["c",1.44,-.72,2.52,-2.28,2.97,-4.35],["c",.15,-.66,.24,-1.5,.3,-3.03],["c",.03,-.84,.03,-2.94,0,-3],["c",-.03,0,-.18,0,-.36,.03],["c",-.66,.12,-.99,.12,-1.83,.12],["c",-1.05,0,-1.71,-.06,-2.61,-.3],["c",-4.02,-.99,-7.11,-4.35,-7.8,-8.46],["c",-.12,-.66,-.12,-.99,-.12,-1.83],["c",0,-.84,0,-1.14,.15,-1.92],["c",.36,-2.28,1.41,-4.62,3.3,-7.29],["l",2.79,-3.6],["c",.54,-.66,.96,-1.2,.96,-1.23],["c",0,-.03,-.09,-.33,-.18,-.69],["c",-.96,-3.21,-1.41,-5.28,-1.59,-7.68],["c",-.12,-1.38,-.15,-3.09,-.06,-3.96],["c",.33,-2.67,1.38,-5.07,3.12,-7.08],["c",.36,-.42,.99,-1.05,1.17,-1.14],["z"],["m",2.01,4.71],["c",-.15,-.3,-.3,-.54,-.3,-.54],["c",-.03,0,-.18,.09,-.3,.21],["c",-2.4,1.74,-3.87,4.2,-4.26,7.11],["c",-.06,.54,-.06,1.41,-.03,1.89],["c",.09,1.29,.48,3.12,1.08,5.22],["c",.15,.42,.24,.78,.24,.81],["c",0,.03,.84,-1.11,1.23,-1.68],["c",1.89,-2.73,2.88,-5.07,3.15,-7.53],["c",.09,-.57,.12,-1.74,.06,-2.37],["c",-.09,-1.23,-.27,-1.92,-.87,-3.12],["z"],["m",-2.94,20.7],["c",-.21,-.72,-.39,-1.32,-.42,-1.32],["c",0,0,-1.2,1.47,-1.86,2.37],["c",-2.79,3.63,-4.02,6.3,-4.35,9.3],["c",-.03,.21,-.03,.69,-.03,1.08],["c",0,.69,0,.75,.06,1.11],["c",.12,.54,.27,.99,.51,1.47],["c",.69,1.38,1.83,2.55,3.42,3.42],["c",.96,.54,2.07,.9,3.21,1.08],["c",.78,.12,2.04,.12,2.94,-.03],["c",.51,-.06,.45,-.03,.42,-.3],["c",-.24,-3.33,-.72,-6.33,-1.62,-10.08],["c",-.09,-.39,-.18,-.75,-.18,-.78],["c",-.03,-.03,-.42,0,-.81,.09],["c",-.9,.18,-1.65,.57,-2.22,1.14],["c",-.72,.72,-1.08,1.65,-1.05,2.64],["c",.06,.96,.48,1.83,1.23,2.58],["c",.36,.36,.72,.63,1.17,.9],["c",.33,.18,.36,.21,.42,.33],["c",.18,.42,-.18,.9,-.6,.87],["c",-.18,-.03,-.84,-.36,-1.26,-.63],["c",-.78,-.51,-1.38,-1.11,-1.86,-1.83],["c",-1.77,-2.7,-.99,-6.42,1.71,-8.19],["c",.3,-.21,.81,-.48,1.17,-.63],["c",.3,-.09,1.02,-.3,1.14,-.3],["c",.06,0,.09,0,.09,-.03],["c",.03,-.03,-.51,-1.92,-1.23,-4.26],["z"],["m",3.78,7.41],["c",-.18,-.03,-.36,-.06,-.39,-.06],["c",-.03,0,0,.21,.18,1.02],["c",.75,3.18,1.26,6.3,1.5,9.09],["c",.06,.72,0,.69,.51,.42],["c",.78,-.36,1.44,-.96,1.98,-1.77],["c",1.08,-1.62,1.2,-3.69,.3,-5.55],["c",-.81,-1.62,-2.31,-2.79,-4.08,-3.15],["z"]],w:19.051,h:57.057},"clefs.perc":{d:[["M",5.07,-7.44],["l",.09,-.06],["l",1.53,0],["l",1.53,0],["l",.09,.06],["l",.06,.09],["l",0,7.35],["l",0,7.32],["l",-.06,.09],["l",-.09,.06],["l",-1.53,0],["l",-1.53,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-7.32],["l",0,-7.35],["z"],["m",6.63,0],["l",.09,-.06],["l",1.53,0],["l",1.53,0],["l",.09,.06],["l",.06,.09],["l",0,7.35],["l",0,7.32],["l",-.06,.09],["l",-.09,.06],["l",-1.53,0],["l",-1.53,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-7.32],["l",0,-7.35],["z"]],w:21,h:14.97},"tab.big":{d:[["M",20.16,-21.66],["c",.24,-.09,.66,.09,.78,.36],["c",.09,.21,.09,.24,-.18,.54],["c",-.78,.81,-1.86,1.44,-2.94,1.71],["c",-.87,.24,-1.71,.24,-2.55,.03],["l",-.06,-.03],["l",-.18,.99],["c",-.33,1.98,-.75,4.26,-.96,5.04],["c",-.42,1.65,-1.26,3.18,-2.28,4.14],["c",-.57,.57,-1.17,.9,-1.86,1.08],["c",-.18,.06,-.33,.06,-.66,.06],["c",-.54,0,-.78,-.03,-1.23,-.27],["c",-.39,-.18,-.66,-.39,-1.38,-.99],["c",-.3,-.24,-.66,-.51,-.75,-.57],["c",-.21,-.15,-.27,-.24,-.24,-.45],["c",.06,-.27,.36,-.6,.6,-.66],["c",.18,-.03,.33,.06,.9,.57],["c",.48,.42,.72,.57,.93,.69],["c",.66,.33,1.38,.21,1.95,-.36],["c",.63,-.6,1.05,-1.62,1.23,-3],["c",.03,-.18,.09,-.66,.09,-1.11],["c",.09,-1.56,.33,-3.81,.57,-5.49],["c",.06,-.33,.09,-.63,.09,-.63],["c",-.03,-.03,-.81,-.12,-1.02,-.12],["c",-.57,0,-1.32,.12,-1.8,.33],["c",-.87,.3,-1.35,.78,-1.5,1.41],["c",-.18,.63,.09,1.26,.66,1.65],["c",.12,.06,.15,.12,.18,.24],["c",.09,.27,.06,.57,-.09,.75],["c",-.03,.06,-.12,.09,-.27,.15],["c",-.72,.21,-1.44,.15,-2.1,-.18],["c",-.54,-.27,-.96,-.66,-1.2,-1.14],["c",-.39,-.75,-.33,-1.74,.15,-2.52],["c",.27,-.42,.84,-.93,1.41,-1.23],["c",1.17,-.57,2.88,-.9,4.8,-.9],["c",.69,0,.78,0,1.08,.06],["c",.45,.09,1.11,.3,2.07,.6],["c",1.47,.48,1.83,.57,2.55,.54],["c",1.02,-.06,2.04,-.45,2.94,-1.11],["c",.12,-.09,.24,-.18,.27,-.18],["z"],["m",-5.88,13.05],["c",.21,-.03,.81,0,1.08,.06],["c",.48,.12,.9,.42,.99,.69],["c",.03,.09,.03,.15,0,.27],["c",0,.09,-.03,.57,-.06,1.08],["c",-.09,2.19,-.24,5.76,-.39,8.28],["c",-.06,1.53,-.06,1.77,.03,2.01],["c",.09,.18,.15,.24,.3,.3],["c",.24,.12,.54,.06,1.23,-.27],["c",.57,-.27,.66,-.3,.75,-.24],["c",.09,.06,.18,.3,.18,.45],["c",0,.33,-.15,.51,-.45,.63],["c",-.12,.03,-.39,.15,-.6,.27],["c",-1.17,.6,-1.38,.69,-1.8,.72],["c",-.45,.03,-.78,-.09,-1.08,-.39],["c",-.39,-.42,-.66,-1.2,-1.02,-3.12],["c",-.24,-1.23,-.36,-2.07,-.54,-3.75],["l",0,-.18],["l",-.36,.45],["c",-.6,.75,-1.32,1.59,-1.95,2.25],["c",-.15,.18,-.27,.3,-.27,.33],["c",0,0,.06,.09,.15,.18],["c",.24,.33,.6,.57,1.05,.69],["c",.18,.06,.3,.06,.69,.06],["l",.48,.03],["l",.06,.12],["c",.15,.27,.03,.72,-.21,.9],["c",-.18,.12,-.93,.27,-1.41,.27],["c",-.84,0,-1.59,-.3,-1.98,-.84],["l",-.12,-.15],["l",-.45,.42],["c",-.99,.87,-1.53,1.32,-2.16,1.74],["c",-.78,.51,-1.5,.84,-2.1,.93],["c",-.69,.12,-1.2,.03,-1.95,-.42],["c",-.21,-.12,-.51,-.27,-.66,-.36],["c",-.24,-.12,-.3,-.18,-.33,-.24],["c",-.12,-.27,.15,-.78,.45,-.93],["c",.24,-.12,.33,-.09,.9,.18],["c",.6,.3,.84,.39,1.2,.36],["c",.87,-.09,1.77,-.69,3.24,-2.31],["c",2.67,-2.85,4.59,-5.94,5.7,-9.15],["c",.15,-.45,.24,-.63,.42,-.81],["c",.21,-.24,.6,-.45,.99,-.51],["z"],["m",-3.99,16.05],["c",.18,0,.69,-.03,1.17,0],["c",3.27,.03,5.37,.75,6,2.07],["c",.45,.99,.12,2.4,-.81,3.42],["c",-.24,.27,-.57,.57,-.84,.75],["c",-.09,.06,-.18,.09,-.18,.12],["c",0,0,.18,.03,.42,.09],["c",1.23,.3,2.01,.81,2.37,1.59],["c",.27,.54,.3,1.32,.09,2.1],["c",-.12,.36,-.45,1.05,-.69,1.35],["c",-.87,1.17,-2.1,1.92,-3.54,2.25],["c",-.36,.06,-.48,.06,-.96,.06],["c",-.45,0,-.66,0,-.84,-.03],["c",-.84,-.18,-1.47,-.51,-2.07,-1.11],["c",-.33,-.33,-.45,-.51,-.45,-.63],["c",0,-.06,.03,-.15,.06,-.24],["c",.18,-.33,.69,-.6,.93,-.48],["c",.03,.03,.15,.12,.27,.24],["c",.39,.42,.99,.57,1.62,.45],["c",1.05,-.21,1.98,-1.02,2.31,-2.01],["c",.48,-1.53,-.48,-2.55,-2.58,-2.67],["c",-.21,0,-.36,-.03,-.42,-.06],["c",-.15,-.09,-.21,-.51,-.06,-.78],["c",.12,-.27,.24,-.33,.6,-.36],["c",.57,-.06,1.11,-.42,1.5,-.99],["c",.48,-.72,.54,-1.59,.18,-2.31],["c",-.12,-.21,-.45,-.54,-.69,-.69],["c",-.33,-.21,-.93,-.45,-1.35,-.51],["l",-.12,-.03],["l",-.06,.48],["c",-.54,2.94,-1.14,6.24,-1.29,6.75],["c",-.33,1.35,-.93,2.61,-1.65,3.6],["c",-.3,.36,-.81,.9,-1.14,1.14],["c",-.3,.24,-.84,.48,-1.14,.57],["c",-.33,.09,-.96,.09,-1.26,.03],["c",-.45,-.12,-.87,-.39,-1.53,-.96],["c",-.24,-.15,-.51,-.39,-.63,-.48],["c",-.3,-.21,-.33,-.33,-.21,-.63],["c",.12,-.18,.27,-.36,.42,-.45],["c",.27,-.12,.36,-.09,.87,.33],["c",.78,.6,1.08,.75,1.65,.72],["c",.45,-.03,.81,-.21,1.17,-.54],["c",.87,-.9,1.38,-2.85,1.38,-5.37],["c",0,-.6,.03,-1.11,.12,-2.04],["c",.06,-.69,.24,-2.01,.33,-2.58],["c",.06,-.24,.06,-.42,.06,-.42],["c",0,0,-.12,.03,-.21,.09],["c",-1.44,.57,-2.16,1.65,-1.74,2.55],["c",.09,.15,.18,.24,.27,.33],["c",.24,.21,.3,.27,.33,.39],["c",.06,.24,0,.63,-.15,.78],["c",-.09,.12,-.54,.21,-.96,.24],["c",-1.02,.03,-2.01,-.48,-2.43,-1.32],["c",-.21,-.45,-.27,-.9,-.15,-1.44],["c",.06,-.27,.21,-.66,.39,-.93],["c",.87,-1.29,3,-2.22,5.64,-2.43],["z"]],w:19.643,h:43.325},"tab.tiny":{d:[["M",16.02,-17.25],["c",.12,-.09,.15,-.09,.27,-.09],["c",.21,.03,.51,.3,.51,.45],["c",0,.06,-.12,.18,-.3,.36],["c",-1.11,1.08,-2.55,1.59,-3.84,1.41],["c",-.15,-.03,-.33,-.06,-.39,-.09],["c",-.06,-.03,-.09,-.03,-.12,-.03],["c",0,0,-.06,.42,-.15,.93],["c",-.33,2.01,-.66,3.69,-.84,4.26],["c",-.42,1.41,-1.23,2.67,-2.16,3.33],["c",-.27,.18,-.75,.42,-.99,.48],["c",-.3,.09,-.72,.09,-1.02,.06],["c",-.45,-.09,-.84,-.33,-1.53,-.9],["c",-.21,-.18,-.51,-.39,-.63,-.48],["c",-.27,-.21,-.3,-.24,-.3,-.36],["c",0,-.12,.09,-.36,.18,-.45],["c",.09,-.09,.27,-.18,.36,-.18],["c",.12,0,.3,.12,.66,.45],["c",.57,.51,.87,.69,1.23,.72],["c",.93,.06,1.68,-.78,1.98,-2.37],["c",.09,-.39,.15,-.75,.18,-1.53],["c",.06,-.99,.24,-2.79,.42,-4.05],["c",.03,-.3,.06,-.57,.06,-.6],["c",0,-.06,-.03,-.09,-.15,-.12],["c",-.9,-.18,-2.13,.06,-2.76,.57],["c",-.36,.3,-.51,.6,-.51,1.02],["c",0,.45,.15,.75,.48,.99],["c",.06,.06,.15,.18,.18,.24],["c",.12,.24,.03,.63,-.15,.69],["c",-.24,.12,-.6,.15,-.9,.15],["c",-.36,-.03,-.57,-.09,-.87,-.24],["c",-.78,-.36,-1.23,-1.11,-1.2,-1.92],["c",.12,-1.53,1.74,-2.49,4.62,-2.7],["c",1.2,-.09,1.47,-.03,3.33,.57],["c",.9,.3,1.14,.36,1.56,.39],["c",.45,0,.93,-.06,1.38,-.21],["c",.51,-.18,.81,-.33,1.41,-.75],["z"],["m",-4.68,10.38],["c",.39,-.06,.84,0,1.2,.15],["c",.24,.12,.36,.21,.45,.36],["l",.09,.09],["l",-.06,1.41],["c",-.09,2.19,-.18,3.96,-.27,5.49],["c",-.03,.78,-.06,1.59,-.06,1.86],["c",0,.42,0,.48,.06,.57],["c",.06,.18,.18,.24,.36,.27],["c",.18,0,.39,-.06,.84,-.27],["c",.45,-.21,.54,-.24,.63,-.18],["c",.12,.12,.15,.54,.03,.69],["c",-.03,.03,-.15,.12,-.27,.18],["c",-.15,.03,-.3,.12,-.36,.15],["c",-.87,.45,-1.02,.51,-1.26,.57],["c",-.33,.09,-.6,.06,-.84,-.06],["c",-.42,-.18,-.63,-.6,-.87,-1.44],["c",-.3,-1.23,-.57,-2.97,-.66,-4.08],["c",0,-.18,-.03,-.3,-.03,-.33],["l",-.06,.06],["c",-.18,.27,-1.11,1.38,-1.68,2.01],["l",-.33,.33],["l",.06,.09],["c",.06,.15,.27,.33,.48,.42],["c",.27,.18,.51,.24,.96,.27],["l",.39,0],["l",.03,.12],["c",.12,.21,.03,.57,-.15,.69],["c",-.03,.03,-.21,.09,-.36,.15],["c",-.27,.06,-.39,.06,-.75,.06],["c",-.48,0,-.75,-.03,-1.08,-.21],["c",-.21,-.12,-.51,-.36,-.57,-.48],["l",-.03,-.09],["l",-.39,.36],["c",-1.47,1.35,-2.49,1.98,-3.42,2.13],["c",-.54,.09,-.96,-.03,-1.62,-.39],["c",-.21,-.15,-.45,-.27,-.54,-.3],["c",-.18,-.09,-.21,-.21,-.12,-.45],["c",.06,-.27,.33,-.48,.54,-.48],["c",.03,0,.27,.09,.48,.21],["c",.48,.24,.69,.27,.99,.27],["c",.6,-.06,1.17,-.42,2.1,-1.35],["c",2.22,-2.22,4.02,-4.98,4.95,-7.59],["c",.21,-.57,.3,-.78,.48,-.93],["c",.15,-.15,.42,-.27,.66,-.33],["z"],["m",-3.06,12.84],["c",.27,-.03,1.68,0,2.01,.03],["c",1.92,.18,3.15,.69,3.63,1.5],["c",.18,.33,.24,.51,.21,.93],["c",0,.45,-.06,.72,-.24,1.11],["c",-.24,.51,-.69,1.02,-1.17,1.35],["c",-.21,.15,-.21,.15,-.12,.18],["c",.72,.15,1.11,.3,1.5,.57],["c",.39,.24,.63,.57,.75,.96],["c",.09,.3,.09,.96,0,1.29],["c",-.15,.57,-.39,1.05,-.78,1.5],["c",-.66,.75,-1.62,1.32,-2.61,1.53],["c",-.27,.06,-.42,.06,-.84,.06],["c",-.48,0,-.57,0,-.81,-.06],["c",-.6,-.18,-1.05,-.42,-1.47,-.81],["c",-.36,-.39,-.42,-.51,-.3,-.75],["c",.12,-.21,.39,-.39,.6,-.39],["c",.09,0,.15,.03,.33,.18],["c",.12,.12,.27,.24,.36,.27],["c",.96,.48,2.46,-.33,2.82,-1.5],["c",.24,-.81,-.03,-1.44,-.69,-1.77],["c",-.39,-.21,-1.02,-.33,-1.53,-.33],["c",-.18,0,-.21,0,-.27,-.09],["c",-.06,-.09,-.06,-.3,-.03,-.48],["c",.06,-.18,.18,-.36,.33,-.36],["c",.39,-.06,.51,-.09,.72,-.18],["c",.69,-.36,1.11,-1.23,.99,-2.01],["c",-.09,-.51,-.42,-.9,-.93,-1.17],["c",-.24,-.12,-.6,-.27,-.87,-.3],["c",-.09,-.03,-.09,-.03,-.12,.12],["c",0,.09,-.21,1.11,-.42,2.25],["c",-.66,3.75,-.72,3.99,-1.26,5.07],["c",-.9,1.89,-2.25,2.85,-3.48,2.61],["c",-.39,-.09,-.69,-.27,-1.38,-.84],["c",-.63,-.51,-.63,-.48,-.63,-.6],["c",0,-.18,.18,-.48,.39,-.57],["c",.21,-.12,.3,-.09,.81,.33],["c",.15,.15,.39,.3,.54,.36],["c",.18,.12,.27,.12,.48,.15],["c",.99,.06,1.71,-.78,2.04,-2.46],["c",.12,-.66,.18,-1.14,.21,-2.22],["c",.03,-1.23,.12,-2.25,.36,-3.63],["c",.03,-.24,.06,-.45,.06,-.48],["c",-.06,-.03,-.66,.27,-.9,.42],["c",-.06,.06,-.21,.18,-.33,.3],["c",-.57,.57,-.6,1.35,-.06,1.74],["c",.18,.12,.24,.24,.21,.51],["c",-.03,.3,-.15,.42,-.57,.48],["c",-1.11,.24,-2.22,-.42,-2.43,-1.38],["c",-.09,-.45,.03,-1.02,.3,-1.47],["c",.18,-.24,.6,-.63,.9,-.84],["c",.9,-.6,2.28,-1.02,3.69,-1.11],["z"]],w:15.709,h:34.656},"timesig.common":{d:[["M",6.66,-7.83],["c",.72,-.06,1.41,-.03,1.98,.09],["c",1.2,.27,2.34,.96,3.09,1.92],["c",.63,.81,1.08,1.86,1.14,2.73],["c",.06,1.02,-.51,1.92,-1.44,2.22],["c",-.24,.09,-.3,.09,-.63,.09],["c",-.33,0,-.42,0,-.63,-.06],["c",-.66,-.24,-1.14,-.63,-1.41,-1.2],["c",-.15,-.3,-.21,-.51,-.24,-.9],["c",-.06,-1.08,.57,-2.04,1.56,-2.37],["c",.18,-.06,.27,-.06,.63,-.06],["l",.45,0],["c",.06,.03,.09,.03,.09,0],["c",0,0,-.09,-.12,-.24,-.27],["c",-1.02,-1.11,-2.55,-1.68,-4.08,-1.5],["c",-1.29,.15,-2.04,.69,-2.4,1.74],["c",-.36,.93,-.42,1.89,-.42,5.37],["c",0,2.97,.06,3.96,.24,4.77],["c",.24,1.08,.63,1.68,1.41,2.07],["c",.81,.39,2.16,.45,3.18,.09],["c",1.29,-.45,2.37,-1.53,3.03,-2.97],["c",.15,-.33,.33,-.87,.39,-1.17],["c",.09,-.24,.15,-.36,.3,-.39],["c",.21,-.03,.42,.15,.39,.36],["c",-.06,.39,-.42,1.38,-.69,1.89],["c",-.96,1.8,-2.49,2.94,-4.23,3.18],["c",-.99,.12,-2.58,-.06,-3.63,-.45],["c",-.96,-.36,-1.71,-.84,-2.4,-1.5],["c",-1.11,-1.11,-1.8,-2.61,-2.04,-4.56],["c",-.06,-.6,-.06,-2.01,0,-2.61],["c",.24,-1.95,.9,-3.45,2.01,-4.56],["c",.69,-.66,1.44,-1.11,2.37,-1.47],["c",.63,-.24,1.47,-.42,2.22,-.48],["z"]],w:13.038,h:15.689},"timesig.cut":{d:[["M",6.24,-10.44],["c",.09,-.06,.09,-.06,.48,-.06],["c",.36,0,.36,0,.45,.06],["l",.06,.09],["l",0,1.23],["l",0,1.26],["l",.27,0],["c",1.26,0,2.49,.45,3.48,1.29],["c",1.05,.87,1.8,2.28,1.89,3.48],["c",.06,1.02,-.51,1.92,-1.44,2.22],["c",-.24,.09,-.3,.09,-.63,.09],["c",-.33,0,-.42,0,-.63,-.06],["c",-.66,-.24,-1.14,-.63,-1.41,-1.2],["c",-.15,-.3,-.21,-.51,-.24,-.9],["c",-.06,-1.08,.57,-2.04,1.56,-2.37],["c",.18,-.06,.27,-.06,.63,-.06],["l",.45,0],["c",.06,.03,.09,.03,.09,0],["c",0,-.03,-.45,-.51,-.66,-.69],["c",-.87,-.69,-1.83,-1.05,-2.94,-1.11],["l",-.42,0],["l",0,7.17],["l",0,7.14],["l",.42,0],["c",.69,-.03,1.23,-.18,1.86,-.51],["c",1.05,-.51,1.89,-1.47,2.46,-2.7],["c",.15,-.33,.33,-.87,.39,-1.17],["c",.09,-.24,.15,-.36,.3,-.39],["c",.21,-.03,.42,.15,.39,.36],["c",-.03,.24,-.21,.78,-.39,1.2],["c",-.96,2.37,-2.94,3.9,-5.13,3.9],["l",-.3,0],["l",0,1.26],["l",0,1.23],["l",-.06,.09],["c",-.09,.06,-.09,.06,-.45,.06],["c",-.39,0,-.39,0,-.48,-.06],["l",-.06,-.09],["l",0,-1.29],["l",0,-1.29],["l",-.21,-.03],["c",-1.23,-.21,-2.31,-.63,-3.21,-1.29],["c",-.15,-.09,-.45,-.36,-.66,-.57],["c",-1.11,-1.11,-1.8,-2.61,-2.04,-4.56],["c",-.06,-.6,-.06,-2.01,0,-2.61],["c",.24,-1.95,.93,-3.45,2.04,-4.59],["c",.42,-.39,.78,-.66,1.26,-.93],["c",.75,-.45,1.65,-.75,2.61,-.9],["l",.21,-.03],["l",0,-1.29],["l",0,-1.29],["z"],["m",-.06,10.44],["c",0,-5.58,0,-6.99,-.03,-6.99],["c",-.15,0,-.63,.27,-.87,.45],["c",-.45,.36,-.75,.93,-.93,1.77],["c",-.18,.81,-.24,1.8,-.24,4.74],["c",0,2.97,.06,3.96,.24,4.77],["c",.24,1.08,.66,1.68,1.41,2.07],["c",.12,.06,.3,.12,.33,.15],["l",.09,0],["l",0,-6.96],["z"]],w:13.038,h:20.97},"timesig.imperfectum":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.imperfectum2":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.perfectum":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.perfectum2":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},f:{d:[["M",9.93,-14.28],["c",1.53,-.18,2.88,.45,3.12,1.5],["c",.12,.51,0,1.32,-.27,1.86],["c",-.15,.3,-.42,.57,-.63,.69],["c",-.69,.36,-1.56,.03,-1.83,-.69],["c",-.09,-.24,-.09,-.69,0,-.87],["c",.06,-.12,.21,-.24,.45,-.42],["c",.42,-.24,.57,-.45,.6,-.72],["c",.03,-.33,-.09,-.39,-.63,-.42],["c",-.3,0,-.45,0,-.6,.03],["c",-.81,.21,-1.35,.93,-1.74,2.46],["c",-.06,.27,-.48,2.25,-.48,2.31],["c",0,.03,.39,.03,.9,.03],["c",.72,0,.9,0,.99,.06],["c",.42,.15,.45,.72,.03,.9],["c",-.12,.06,-.24,.06,-1.17,.06],["l",-1.05,0],["l",-.78,2.55],["c",-.45,1.41,-.87,2.79,-.96,3.06],["c",-.87,2.37,-2.37,4.74,-3.78,5.91],["c",-1.05,.9,-2.04,1.23,-3.09,1.08],["c",-1.11,-.18,-1.89,-.78,-2.04,-1.59],["c",-.12,-.66,.15,-1.71,.54,-2.19],["c",.69,-.75,1.86,-.54,2.22,.39],["c",.06,.15,.09,.27,.09,.48],["c",0,.24,-.03,.27,-.12,.42],["c",-.03,.09,-.15,.18,-.27,.27],["c",-.09,.06,-.27,.21,-.36,.27],["c",-.24,.18,-.36,.36,-.39,.6],["c",-.03,.33,.09,.39,.63,.42],["c",.42,0,.63,-.03,.9,-.15],["c",.6,-.3,.96,-.96,1.38,-2.64],["c",.09,-.42,.63,-2.55,1.17,-4.77],["l",1.02,-4.08],["c",0,-.03,-.36,-.03,-.81,-.03],["c",-.72,0,-.81,0,-.93,-.06],["c",-.42,-.18,-.39,-.75,.03,-.9],["c",.09,-.06,.27,-.06,1.05,-.06],["l",.96,0],["l",0,-.09],["c",.06,-.18,.3,-.72,.51,-1.17],["c",1.2,-2.46,3.3,-4.23,5.34,-4.5],["z"]],w:16.155,h:19.445},m:{d:[["M",2.79,-8.91],["c",.09,0,.3,-.03,.45,-.03],["c",.24,.03,.3,.03,.45,.12],["c",.36,.15,.63,.54,.75,1.02],["l",.03,.21],["l",.33,-.3],["c",.69,-.69,1.38,-1.02,2.07,-1.02],["c",.27,0,.33,0,.48,.06],["c",.21,.09,.48,.36,.63,.6],["c",.03,.09,.12,.27,.18,.42],["c",.03,.15,.09,.27,.12,.27],["c",0,0,.09,-.09,.18,-.21],["c",.33,-.39,.87,-.81,1.29,-.99],["c",.78,-.33,1.47,-.21,2.01,.33],["c",.3,.33,.48,.69,.6,1.14],["c",.09,.42,.06,.54,-.54,3.06],["c",-.33,1.29,-.57,2.4,-.57,2.43],["c",0,.12,.09,.21,.21,.21],["c",.24,0,.75,-.3,1.2,-.72],["c",.45,-.39,.6,-.45,.78,-.27],["c",.18,.18,.09,.36,-.45,.87],["c",-1.05,.96,-1.83,1.47,-2.58,1.71],["c",-.93,.33,-1.53,.21,-1.8,-.33],["c",-.06,-.15,-.06,-.21,-.06,-.45],["c",0,-.24,.03,-.48,.6,-2.82],["c",.42,-1.71,.6,-2.64,.63,-2.79],["c",.03,-.57,-.3,-.75,-.84,-.48],["c",-.24,.12,-.54,.39,-.66,.63],["c",-.03,.09,-.42,1.38,-.9,3],["c",-.9,3.15,-.84,3,-1.14,3.15],["l",-.15,.09],["l",-.78,0],["c",-.6,0,-.78,0,-.84,-.06],["c",-.09,-.03,-.18,-.18,-.18,-.27],["c",0,-.03,.36,-1.38,.84,-2.97],["c",.57,-2.04,.81,-2.97,.84,-3.12],["c",.03,-.54,-.3,-.72,-.84,-.45],["c",-.24,.12,-.57,.42,-.66,.63],["c",-.06,.09,-.51,1.44,-1.05,2.97],["c",-.51,1.56,-.99,2.85,-.99,2.91],["c",-.06,.12,-.21,.24,-.36,.3],["c",-.12,.06,-.21,.06,-.9,.06],["c",-.6,0,-.78,0,-.84,-.06],["c",-.09,-.03,-.18,-.18,-.18,-.27],["c",0,-.03,.45,-1.38,.99,-2.97],["c",1.05,-3.18,1.05,-3.18,.93,-3.45],["c",-.12,-.27,-.39,-.3,-.72,-.15],["c",-.54,.27,-1.14,1.17,-1.56,2.4],["c",-.06,.15,-.15,.3,-.18,.36],["c",-.21,.21,-.57,.27,-.72,.09],["c",-.09,-.09,-.06,-.21,.06,-.63],["c",.48,-1.26,1.26,-2.46,2.01,-3.21],["c",.57,-.54,1.2,-.87,1.83,-1.02],["z"]],w:14.687,h:9.126},p:{d:[["M",1.92,-8.7],["c",.27,-.09,.81,-.06,1.11,.03],["c",.54,.18,.93,.51,1.17,.99],["c",.09,.15,.15,.33,.18,.36],["l",0,.12],["l",.3,-.27],["c",.66,-.6,1.35,-1.02,2.13,-1.2],["c",.21,-.06,.33,-.06,.78,-.06],["c",.45,0,.51,0,.84,.09],["c",1.29,.33,2.07,1.32,2.25,2.79],["c",.09,.81,-.09,2.01,-.45,2.79],["c",-.54,1.26,-1.86,2.55,-3.18,3.03],["c",-.45,.18,-.81,.24,-1.29,.24],["c",-.69,-.03,-1.35,-.18,-1.86,-.45],["c",-.3,-.15,-.51,-.18,-.69,-.09],["c",-.09,.03,-.18,.09,-.18,.12],["c",-.09,.12,-1.05,2.94,-1.05,3.06],["c",0,.24,.18,.48,.51,.63],["c",.18,.06,.54,.15,.75,.15],["c",.21,0,.36,.06,.42,.18],["c",.12,.18,.06,.42,-.12,.54],["c",-.09,.03,-.15,.03,-.78,0],["c",-1.98,-.15,-3.81,-.15,-5.79,0],["c",-.63,.03,-.69,.03,-.78,0],["c",-.24,-.15,-.24,-.57,.03,-.66],["c",.06,-.03,.48,-.09,.99,-.12],["c",.87,-.06,1.11,-.09,1.35,-.21],["c",.18,-.06,.33,-.18,.39,-.3],["c",.06,-.12,3.24,-9.42,3.27,-9.6],["c",.06,-.33,.03,-.57,-.15,-.69],["c",-.09,-.06,-.12,-.06,-.3,-.06],["c",-.69,.06,-1.53,1.02,-2.28,2.61],["c",-.09,.21,-.21,.45,-.27,.51],["c",-.09,.12,-.33,.24,-.48,.24],["c",-.18,0,-.36,-.15,-.36,-.3],["c",0,-.24,.78,-1.83,1.26,-2.55],["c",.72,-1.11,1.47,-1.74,2.28,-1.92],["z"],["m",5.37,1.47],["c",-.27,-.12,-.75,-.03,-1.14,.21],["c",-.75,.48,-1.47,1.68,-1.89,3.15],["c",-.45,1.47,-.42,2.34,0,2.7],["c",.45,.39,1.26,.21,1.83,-.36],["c",.51,-.51,.99,-1.68,1.38,-3.27],["c",.3,-1.17,.33,-1.74,.15,-2.13],["c",-.09,-.15,-.15,-.21,-.33,-.3],["z"]],w:14.689,h:13.127},r:{d:[["M",6.33,-9.12],["c",.27,-.03,.93,0,1.2,.06],["c",.84,.21,1.23,.81,1.02,1.53],["c",-.24,.75,-.9,1.17,-1.56,.96],["c",-.33,-.09,-.51,-.3,-.66,-.75],["c",-.03,-.12,-.09,-.24,-.12,-.3],["c",-.09,-.15,-.3,-.24,-.48,-.24],["c",-.57,0,-1.38,.54,-1.65,1.08],["c",-.06,.15,-.33,1.17,-.9,3.27],["c",-.57,2.31,-.81,3.12,-.87,3.21],["c",-.03,.06,-.12,.15,-.18,.21],["l",-.12,.06],["l",-.81,.03],["c",-.69,0,-.81,0,-.9,-.03],["c",-.09,-.06,-.18,-.21,-.18,-.3],["c",0,-.06,.39,-1.62,.9,-3.51],["c",.84,-3.24,.87,-3.45,.87,-3.72],["c",0,-.21,0,-.27,-.03,-.36],["c",-.12,-.15,-.21,-.24,-.42,-.24],["c",-.24,0,-.45,.15,-.78,.42],["c",-.33,.36,-.45,.54,-.72,1.14],["c",-.03,.12,-.21,.24,-.36,.27],["c",-.12,0,-.15,0,-.24,-.06],["c",-.18,-.12,-.18,-.21,-.06,-.54],["c",.21,-.57,.42,-.93,.78,-1.32],["c",.54,-.51,1.2,-.81,1.95,-.87],["c",.81,-.03,1.53,.3,1.92,.87],["l",.12,.18],["l",.09,-.09],["c",.57,-.45,1.41,-.84,2.19,-.96],["z"]],w:9.41,h:9.132},s:{d:[["M",4.47,-8.73],["c",.09,0,.36,-.03,.57,-.03],["c",.75,.03,1.29,.24,1.71,.63],["c",.51,.54,.66,1.26,.36,1.83],["c",-.24,.42,-.63,.57,-1.11,.42],["c",-.33,-.09,-.6,-.36,-.6,-.57],["c",0,-.03,.06,-.21,.15,-.39],["c",.12,-.21,.15,-.33,.18,-.48],["c",0,-.24,-.06,-.48,-.15,-.6],["c",-.15,-.21,-.42,-.24,-.75,-.15],["c",-.27,.06,-.48,.18,-.69,.36],["c",-.39,.39,-.51,.96,-.33,1.38],["c",.09,.21,.42,.51,.78,.72],["c",1.11,.69,1.59,1.11,1.89,1.68],["c",.21,.39,.24,.78,.15,1.29],["c",-.18,1.2,-1.17,2.16,-2.52,2.52],["c",-1.02,.24,-1.95,.12,-2.7,-.42],["c",-.72,-.51,-.99,-1.47,-.6,-2.19],["c",.24,-.48,.72,-.63,1.17,-.42],["c",.33,.18,.54,.45,.57,.81],["c",0,.21,-.03,.3,-.33,.51],["c",-.33,.24,-.39,.42,-.27,.69],["c",.06,.15,.21,.27,.45,.33],["c",.3,.09,.87,.09,1.2,0],["c",.75,-.21,1.23,-.72,1.29,-1.35],["c",.03,-.42,-.15,-.81,-.54,-1.2],["c",-.24,-.24,-.48,-.42,-1.41,-1.02],["c",-.69,-.42,-1.05,-.93,-1.05,-1.47],["c",0,-.39,.12,-.87,.3,-1.23],["c",.27,-.57,.78,-1.05,1.38,-1.35],["c",.24,-.12,.63,-.27,.9,-.3],["z"]],w:6.632,h:8.758},z:{d:[["M",2.64,-7.95],["c",.36,-.09,.81,-.03,1.71,.27],["c",.78,.21,.96,.27,1.74,.3],["c",.87,.06,1.02,.03,1.38,-.21],["c",.21,-.15,.33,-.15,.48,-.06],["c",.15,.09,.21,.3,.15,.45],["c",-.03,.06,-1.26,1.26,-2.76,2.67],["l",-2.73,2.55],["l",.54,.03],["c",.54,.03,.72,.03,2.01,.15],["c",.36,.03,.9,.06,1.2,.09],["c",.66,0,.81,-.03,1.02,-.24],["c",.3,-.3,.39,-.72,.27,-1.23],["c",-.06,-.27,-.06,-.27,-.03,-.39],["c",.15,-.3,.54,-.27,.69,.03],["c",.15,.33,.27,1.02,.27,1.5],["c",0,1.47,-1.11,2.7,-2.52,2.79],["c",-.57,.03,-1.02,-.09,-2.01,-.51],["c",-1.02,-.42,-1.23,-.48,-2.13,-.54],["c",-.81,-.06,-.96,-.03,-1.26,.18],["c",-.12,.06,-.24,.12,-.27,.12],["c",-.27,0,-.45,-.3,-.36,-.51],["c",.03,-.06,1.32,-1.32,2.91,-2.79],["l",2.88,-2.73],["c",-.03,0,-.21,.03,-.42,.06],["c",-.21,.03,-.78,.09,-1.23,.12],["c",-1.11,.12,-1.23,.15,-1.95,.27],["c",-.72,.15,-1.17,.18,-1.29,.09],["c",-.27,-.18,-.21,-.75,.12,-1.26],["c",.39,-.6,.93,-1.02,1.59,-1.2],["z"]],w:8.573,h:8.743},"+":{d:[["M",3.48,-9.3],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,1.29],["l",0,1.29],["l",1.29,0],["c",1.23,0,1.29,0,1.41,.06],["c",.06,.03,.15,.09,.18,.12],["c",.12,.09,.21,.33,.21,.48],["c",0,.15,-.09,.39,-.21,.48],["c",-.03,.03,-.12,.09,-.18,.12],["c",-.12,.06,-.18,.06,-1.41,.06],["l",-1.29,0],["l",0,1.29],["c",0,1.23,0,1.29,-.06,1.41],["c",-.09,.18,-.15,.24,-.3,.33],["c",-.21,.09,-.39,.09,-.57,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.06,-.12,-.06,-.18,-.06,-1.41],["l",0,-1.29],["l",-1.29,0],["c",-1.23,0,-1.29,0,-1.41,-.06],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.09,-.36,0,-.54],["c",.09,-.18,.15,-.24,.33,-.33],["l",.15,-.06],["l",1.26,0],["l",1.29,0],["l",0,-1.29],["c",0,-1.23,0,-1.29,.06,-1.41],["c",.09,-.18,.15,-.24,.33,-.33],["z"]],w:7.507,h:7.515},",":{d:[["M",1.85,-3.36],["c",.57,-.15,1.17,.03,1.59,.45],["c",.45,.45,.6,.96,.51,1.89],["c",-.09,1.23,-.42,2.46,-.99,3.93],["c",-.3,.72,-.72,1.62,-.78,1.68],["c",-.18,.21,-.51,.18,-.66,-.06],["c",-.03,-.06,-.06,-.15,-.06,-.18],["c",0,-.06,.12,-.33,.24,-.63],["c",.84,-1.8,1.02,-2.61,.69,-3.24],["c",-.12,-.24,-.27,-.36,-.75,-.6],["c",-.36,-.15,-.42,-.21,-.6,-.39],["c",-.69,-.69,-.69,-1.71,0,-2.4],["c",.21,-.21,.51,-.39,.81,-.45],["z"]],w:3.452,h:8.143},"-":{d:[["M",.18,-5.34],["c",.09,-.06,.15,-.06,2.31,-.06],["c",2.46,0,2.37,0,2.46,.21],["c",.12,.21,.03,.42,-.15,.54],["c",-.09,.06,-.15,.06,-2.28,.06],["c",-2.16,0,-2.22,0,-2.31,-.06],["c",-.27,-.15,-.27,-.54,-.03,-.69],["z"]],w:5.001,h:.81},".":{d:[["M",1.32,-3.36],["c",1.05,-.27,2.1,.57,2.1,1.65],["c",0,1.08,-1.05,1.92,-2.1,1.65],["c",-.9,-.21,-1.5,-1.14,-1.26,-2.04],["c",.12,-.63,.63,-1.11,1.26,-1.26],["z"]],w:3.413,h:3.402},"scripts.wedge":{d:[["M",-3.66,-7.44],["c",.06,-.09,0,-.09,.81,.03],["c",1.86,.3,3.84,.3,5.73,0],["c",.78,-.12,.72,-.12,.78,-.03],["c",.15,.15,.12,.24,-.24,.6],["c",-.93,.93,-1.98,2.76,-2.67,4.62],["c",-.3,.78,-.51,1.71,-.51,2.13],["c",0,.15,0,.18,-.06,.27],["c",-.12,.09,-.24,.09,-.36,0],["c",-.06,-.09,-.06,-.12,-.06,-.27],["c",0,-.42,-.21,-1.35,-.51,-2.13],["c",-.69,-1.86,-1.74,-3.69,-2.67,-4.62],["c",-.36,-.36,-.39,-.45,-.24,-.6],["z"]],w:7.49,h:7.752},"scripts.thumb":{d:[["M",-.54,-3.69],["c",.15,-.03,.36,-.06,.51,-.06],["c",1.44,0,2.58,1.11,2.94,2.85],["c",.09,.48,.09,1.32,0,1.8],["c",-.27,1.41,-1.08,2.43,-2.16,2.73],["l",-.18,.06],["l",0,.12],["c",.03,.06,.06,.45,.09,.87],["c",.03,.57,.03,.78,0,.84],["c",-.09,.27,-.39,.48,-.66,.48],["c",-.27,0,-.57,-.21,-.66,-.48],["c",-.03,-.06,-.03,-.27,0,-.84],["c",.03,-.42,.06,-.81,.09,-.87],["l",0,-.12],["l",-.18,-.06],["c",-1.08,-.3,-1.89,-1.32,-2.16,-2.73],["c",-.09,-.48,-.09,-1.32,0,-1.8],["c",.15,-.84,.51,-1.53,1.02,-2.04],["c",.39,-.39,.84,-.63,1.35,-.75],["z"],["m",1.05,.9],["c",-.15,-.09,-.21,-.09,-.45,-.12],["c",-.15,0,-.3,.03,-.39,.03],["c",-.57,.18,-.9,.72,-1.08,1.74],["c",-.06,.48,-.06,1.8,0,2.28],["c",.15,.9,.42,1.44,.9,1.65],["c",.18,.09,.21,.09,.51,.09],["c",.3,0,.33,0,.51,-.09],["c",.48,-.21,.75,-.75,.9,-1.65],["c",.03,-.27,.03,-.54,.03,-1.14],["c",0,-.6,0,-.87,-.03,-1.14],["c",-.15,-.9,-.45,-1.44,-.9,-1.65],["z"]],w:5.955,h:9.75},"scripts.open":{d:[["M",-.54,-3.69],["c",.15,-.03,.36,-.06,.51,-.06],["c",1.44,0,2.58,1.11,2.94,2.85],["c",.09,.48,.09,1.32,0,1.8],["c",-.33,1.74,-1.47,2.85,-2.91,2.85],["c",-1.44,0,-2.58,-1.11,-2.91,-2.85],["c",-.09,-.48,-.09,-1.32,0,-1.8],["c",.15,-.84,.51,-1.53,1.02,-2.04],["c",.39,-.39,.84,-.63,1.35,-.75],["z"],["m",1.11,.9],["c",-.21,-.09,-.27,-.09,-.51,-.12],["c",-.3,0,-.42,.03,-.66,.15],["c",-.24,.12,-.51,.39,-.66,.63],["c",-.54,.93,-.63,2.64,-.21,3.81],["c",.21,.54,.51,.9,.93,1.11],["c",.21,.09,.24,.09,.54,.09],["c",.3,0,.33,0,.54,-.09],["c",.42,-.21,.72,-.57,.93,-1.11],["c",.36,-.99,.36,-2.37,0,-3.36],["c",-.21,-.54,-.51,-.9,-.9,-1.11],["z"]],w:5.955,h:7.5},"scripts.longphrase":{d:[["M",1.47,-15.09],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.54,.06,11.25],["l",0,11.25],["l",-.63,.15],["c",-.66,.18,-1.44,.39,-1.5,.39],["c",-.03,0,-.03,-3.39,-.03,-11.25],["l",0,-11.25],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:23.04},"scripts.mediumphrase":{d:[["M",1.47,-7.59],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.39,.06,7.5],["l",0,7.5],["l",-.63,.15],["c",-.66,.18,-1.44,.39,-1.5,.39],["c",-.03,0,-.03,-2.28,-.03,-7.5],["l",0,-7.5],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:15.54},"scripts.shortphrase":{d:[["M",1.47,-7.59],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.21,.06,3.75],["l",0,3.75],["l",-.42,.09],["c",-.57,.18,-1.65,.45,-1.71,.45],["c",-.03,0,-.03,-.72,-.03,-3.75],["l",0,-3.75],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:8.04},"scripts.snap":{d:[["M",4.5,-3.39],["c",.36,-.03,.96,-.03,1.35,0],["c",1.56,.15,3.15,.9,4.2,2.01],["c",.24,.27,.33,.42,.33,.6],["c",0,.27,.03,.24,-2.46,2.22],["c",-1.29,1.02,-2.4,1.86,-2.49,1.92],["c",-.18,.09,-.3,.09,-.48,0],["c",-.09,-.06,-1.2,-.9,-2.49,-1.92],["c",-2.49,-1.98,-2.46,-1.95,-2.46,-2.22],["c",0,-.18,.09,-.33,.33,-.6],["c",1.05,-1.08,2.64,-1.86,4.17,-2.01],["z"],["m",1.29,1.17],["c",-1.47,-.15,-2.97,.3,-4.14,1.2],["l",-.18,.15],["l",.06,.09],["c",.15,.12,3.63,2.85,3.66,2.85],["c",.03,0,3.51,-2.73,3.66,-2.85],["l",.06,-.09],["l",-.18,-.15],["c",-.84,-.66,-1.89,-1.08,-2.94,-1.2],["z"]],w:10.38,h:6.84}};Le["noteheads.slash.whole"]={d:[["M",5,-5],["l",1,1],["l",-5,5],["l",-1,-1],["z"],["m",4,6],["l",-5,-5],["l",2,-2],["l",5,5],["z"],["m",0,-2],["l",1,1],["l",-5,5],["l",-1,-1],["z"],["m",-4,6],["l",-5,-5],["l",2,-2],["l",5,5],["z"]],w:10.81,h:15.63};Le["noteheads.slash.quarter"]={d:[["M",9,-6],["l",0,4],["l",-9,9],["l",0,-4],["z"]],w:9,h:9};Le["noteheads.harmonic.quarter"]={d:[["M",3.63,-4.02],["c",.09,-.06,.18,-.09,.24,-.03],["c",.03,.03,.87,.93,1.83,2.01],["c",1.5,1.65,1.8,1.98,1.8,2.04],["c",0,.06,-.3,.39,-1.8,2.04],["c",-.96,1.08,-1.8,1.98,-1.83,2.01],["c",-.06,.06,-.15,.03,-.24,-.03],["c",-.12,-.09,-3.54,-3.84,-3.6,-3.93],["c",-.03,-.03,-.03,-.09,-.03,-.15],["c",.03,-.06,3.45,-3.84,3.63,-3.96],["z"]],w:7.5,h:8.165};Le["noteheads.triangle.quarter"]={d:[["M",0,4],["l",9,0],["l",-4.5,-9],["z"]],w:9,h:9};var Ka=function(e){for(var t=[],r=0,a=e.length;r<a;r++){t[r]=[];for(var n=0,i=e[r].length;n<i;n++)t[r][n]=e[r][n]}return t},y1=function(e,t,r){for(var a=0,n=e.length;a<n;a++){var i=e[a],s,o;for(s=1,o=i.length;s<o;s++)i[s]*=s%2?t:r}},w1={printSymbol:function(e,t,r,a,n){if(!Le[r])return null;var i=Ka(Le[r].d);i[0][1]+=e,i[0][2]+=t;for(var s="",o=0;o<i.length;o++)s+=i[o].join(" ");return n.path=s,a.path(n)},getPathForSymbol:function(e,t,r,a,n){if(a=a||1,n=n||1,!Le[r])return null;var i=Ka(Le[r].d);return(a!==1||n!==1)&&y1(i,a,n),i[0][1]+=e,i[0][2]+=t,i},getSymbolWidth:function(e){return Le[e]?Le[e].w:0},symbolHeightInPitches:function(e){var t=Le[e]?Le[e].h:0;return t/m1.STEP},getSymbolAlign:function(e){return e.substring(0,7)==="scripts"&&e!=="scripts.roll"?"center":"left"},getYCorr:function(e){switch(e){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":return-2;case"timesig.common":case"timesig.cut":return 0;case"flags.d32nd":return-1;case"flags.d64th":return-2;case"flags.u32nd":return 1;case"flags.u64th":return 3;case"rests.whole":return 1;case"rests.half":return-1;case"rests.8th":return-1;case"rests.quarter":return-1;case"rests.16th":return-1;case"rests.32nd":return-1;case"rests.64th":return-1;case"f":case"m":case"p":case"s":case"z":return-4;case"scripts.trill":case"scripts.upbow":case"scripts.downbow":return-2;case"scripts.ufermata":case"scripts.wedge":case"scripts.roll":case"scripts.shortphrase":case"scripts.longphrase":return-1;case"scripts.dfermata":return 1;default:return 0}},setSymbol:function(e,t){Le[e]=t}},mt=w1,x1=Qt,h0=mt,gr=at,C1=function(e,t){var r,a=0;e.el_type="clef";var n=new x1(e,0,10,"staff-extra clef",t);switch(n.isClef=!0,e.type){case"treble":r="clefs.G";break;case"tenor":r="clefs.C";break;case"alto":r="clefs.C";break;case"bass":r="clefs.F";break;case"treble+8":r="clefs.G",a=1;break;case"tenor+8":r="clefs.C",a=1;break;case"bass+8":r="clefs.F",a=1;break;case"alto+8":r="clefs.C",a=1;break;case"treble-8":r="clefs.G",a=-1;break;case"tenor-8":r="clefs.C",a=-1;break;case"bass-8":r="clefs.F",a=-1;break;case"alto-8":r="clefs.C",a=-1;break;case"none":return null;case"perc":r="clefs.perc";break;default:n.addFixed(new gr("clef="+e.type,0,0,void 0,{type:"debug"}))}var i=5;if(r){var s=h0.symbolHeightInPitches(r),o=k1(r);if(n.addRight(new gr(r,i,h0.getSymbolWidth(r),e.clefPos,{top:s+e.clefPos+o,bottom:e.clefPos+o})),a!==0){var c=.6666666666666666,f=(h0.getSymbolWidth(r)-h0.getSymbolWidth("8")*c)/2,u=a>0?n.top+3:n.bottom-1,l=a>0?n.top+3:n.bottom-3,h=l-2;e.type==="bass-8"&&(u=3,f=0),n.addRight(new gr("8",i+f,h0.getSymbolWidth("8")*c,u,{scalex:c,scaley:c,top:l,bottom:h}))}}return n};function k1(e){switch(e){case"clefs.G":return-5;case"clefs.C":return-4;case"clefs.F":return-4;case"clefs.perc":return-2;default:return 0}}var _1=C1,T1=Qt,H0=mt,E1=at,S1=function(e,t){if(e.el_type="keySignature",!e.accidentals||e.accidentals.length===0)return null;var r=new T1(e,0,10,"staff-extra key-signature",t);r.isKeySig=!0;var a=0;return e.accidentals.forEach(function(n){var i,s=0;switch(n.acc){case"sharp":i="accidentals.sharp",s=-3;break;case"natural":i="accidentals.nat";break;case"flat":i="accidentals.flat",s=-1.2;break;case"quartersharp":i="accidentals.halfsharp",s=-2.5;break;case"quarterflat":i="accidentals.halfflat",s=-1.2;break;default:i="accidentals.flat"}r.addRight(new E1(i,a,H0.getSymbolWidth(i),n.verticalPos,{thickness:H0.symbolHeightInPitches(i),top:n.verticalPos+H0.symbolHeightInPitches(i)+s,bottom:n.verticalPos+s})),a+=H0.getSymbolWidth(i)+2},this),r},M1=S1,qe=mt,zt=at,A1=function(e,t,r,a){a||(a={});var n=a.dir!==void 0?a.dir:null,i=a.headx!==void 0?a.headx:0,s=a.extrax!==void 0?a.extrax:0,o=a.flag!==void 0?a.flag:null,c=a.dot!==void 0?a.dot:0,f=a.dotshiftx!==void 0?a.dotshiftx:0,u=a.scale!==void 0?a.scale:1,l=a.accidentalSlot!==void 0?a.accidentalSlot:[],h=a.shouldExtendStem!==void 0?a.shouldExtendStem:!1,d=a.printAccidentals!==void 0?a.printAccidentals:!0,p=r.verticalPos,g,v=0,m=0,y=0;if(t===void 0)e.addFixed(new zt("pitch is undefined",0,0,0,{type:"debug"}));else if(t==="")g=new zt(null,0,0,p);else{var x=i;if(r.printer_shift){var b=r.printer_shift==="same"?1:0;x=n==="down"?-qe.getSymbolWidth(t)*u+b:qe.getSymbolWidth(t)*u-b}var w={scalex:u,scaley:u,thickness:qe.symbolHeightInPitches(t)*u,name:r.name};if(g=new zt(t,x,qe.getSymbolWidth(t)*u,p,w),g.stemDir=n,o){var C=p+(n==="down"?-7:7)*u;h&&(n==="down"&&C>6&&(C=6),n==="up"&&C<6&&(C=6));var T=n==="down"?i:i+g.w-.6;e.addRight(new zt(o,T,qe.getSymbolWidth(o)*u,C,{scalex:u,scaley:u}))}for(m=g.w+f-2+5*c;c>0;c--){var B=1-Math.abs(p)%2;e.addRight(new zt("dots.dot",g.w+f-2+5*c,qe.getSymbolWidth("dots.dot"),p+B))}}if(g&&(g.highestVert=r.highestVert),d&&r.accidental){var E;switch(r.accidental){case"quartersharp":E="accidentals.halfsharp";break;case"dblsharp":E="accidentals.dblsharp";break;case"sharp":E="accidentals.sharp";break;case"quarterflat":E="accidentals.halfflat";break;case"flat":E="accidentals.flat";break;case"dblflat":E="accidentals.dblflat";break;case"natural":E="accidentals.nat"}for(var z=!1,F=s,O=0;O<l.length;O++)if(p-l[O][0]>=6){l[O][0]=p,F=l[O][1],z=!0;break}z===!1&&(F-=qe.getSymbolWidth(E)*u+2,l.push([p,F]),v=qe.getSymbolWidth(E)*u+2);var R=qe.symbolHeightInPitches(E);e.addExtra(new zt(E,F,qe.getSymbolWidth(E),p,{scalex:u,scaley:u,top:p+R/2,bottom:p-R/2})),y=qe.getSymbolWidth(E)/2}return{notehead:g,accidentalshiftx:v,dotshiftx:m,extraLeft:y}},B1=A1,N1=Qt,de=mt,tt=at,L1=function(e,t){e.el_type="timeSignature";var r=new N1(e,0,10,"staff-extra time-signature",t);if(e.type==="specified")for(var a=0,n=0;n<e.value.length;n++)if(n!==0&&(r.addRight(new tt("+",a+1,de.getSymbolWidth("+"),6,{thickness:de.symbolHeightInPitches("+")})),a+=de.getSymbolWidth("+")+2),e.value[n].den){for(var i=0,s=0;s<e.value[n].num.length;s++)i+=de.getSymbolWidth(e.value[n].num[s]);var o=0;for(s=0;s<e.value[n].num.length;s++)o+=de.getSymbolWidth(e.value[n].den[s]);var c=Math.max(i,o);r.addRight(new tt(e.value[n].num,a+(c-i)/2,i,8,{thickness:de.symbolHeightInPitches(e.value[n].num[0])})),r.addRight(new tt(e.value[n].den,a+(c-o)/2,o,4,{thickness:de.symbolHeightInPitches(e.value[n].den[0])})),a+=c}else{for(var f=0,u=0;u<e.value[n].num.length;u++)f+=de.getSymbolWidth(e.value[n].num[u]);r.addRight(new tt(e.value[n].num,a,f,6,{thickness:de.symbolHeightInPitches(e.value[n].num[0])})),a+=f}else e.type==="common_time"?r.addRight(new tt("timesig.common",0,de.getSymbolWidth("timesig.common"),6,{thickness:de.symbolHeightInPitches("timesig.common")})):e.type==="cut_time"?r.addRight(new tt("timesig.cut",0,de.getSymbolWidth("timesig.cut"),6,{thickness:de.symbolHeightInPitches("timesig.cut")})):e.type==="tempus_imperfectum"?r.addRight(new tt("timesig.imperfectum",0,de.getSymbolWidth("timesig.imperfectum"),6,{thickness:de.symbolHeightInPitches("timesig.imperfectum")})):e.type==="tempus_imperfectum_prolatio"?r.addRight(new tt("timesig.imperfectum2",0,de.getSymbolWidth("timesig.imperfectum2"),6,{thickness:de.symbolHeightInPitches("timesig.imperfectum2")})):e.type==="tempus_perfectum"?r.addRight(new tt("timesig.perfectum",0,de.getSymbolWidth("timesig.perfectum"),6,{thickness:de.symbolHeightInPitches("timesig.perfectum")})):e.type==="tempus_perfectum_prolatio"?r.addRight(new tt("timesig.perfectum2",0,de.getSymbolWidth("timesig.perfectum2"),6,{thickness:de.symbolHeightInPitches("timesig.perfectum2")})):console.log("time signature:",e);return r},P1=L1,D1=function(t,r,a){this.type="DynamicDecoration",this.anchor=t,this.dec=r,a==="below"?this.volumeHeightBelow=6:this.volumeHeightAbove=6,this.pitch=void 0},I1=D1,F1=function(t,r,a,n){this.type="CrescendoElem",this.anchor1=t,this.anchor2=r,this.dir=a,n==="above"?this.dynamicHeightAbove=6:this.dynamicHeightBelow=6,this.pitch=void 0},O1=F1,H1=function(t,r){this.type="GlissandoElem",this.anchor1=t,this.anchor2=r},z1=H1,Pe=function(t){this.type="TieElem",this.anchor1=t.anchor1,this.anchor2=t.anchor2,t.isGrace&&(this.isGrace=!0),t.fixedY&&(this.fixedY=!0),t.stemDir&&(this.stemDir=t.stemDir),t.voiceNumber!==void 0&&(this.voiceNumber=t.voiceNumber),t.style!==void 0&&(this.dotted=!0),this.internalNotes=[]};Pe.prototype.addInternalNote=function(e){this.internalNotes.push(e)};Pe.prototype.setEndAnchor=function(e){this.anchor2=e,this.anchor1?(this.top=Math.max(this.anchor1.pitch,this.anchor2.pitch)+4,this.bottom=Math.min(this.anchor1.pitch,this.anchor2.pitch)-4):(this.top=this.anchor2.pitch+4,this.bottom=this.anchor2.pitch-4)};Pe.prototype.setStartX=function(e){this.startLimitX=e};Pe.prototype.setEndX=function(e){this.endLimitX=e};Pe.prototype.setHint=function(){this.hint=!0};Pe.prototype.calcTieDirection=function(){if(this.isGrace)this.above=!1;else if(this.voiceNumber===0)this.above=!0;else if(this.voiceNumber>0)this.above=!1;else{var e;this.anchor1?e=this.anchor1.pitch:this.anchor2?e=this.anchor2.pitch:e=14,this.anchor1&&this.anchor1.stemDir==="down"&&this.anchor2&&this.anchor2.stemDir==="down"?this.above=!0:this.anchor1&&this.anchor1.stemDir==="up"&&this.anchor2&&this.anchor2.stemDir==="up"?this.above=!1:this.anchor1&&this.anchor2?this.above=e>=6:this.anchor1?this.above=this.anchor1.stemDir==="down":this.anchor2?this.above=this.anchor2.stemDir==="down":this.above=e>=6}};Pe.prototype.calcSlurDirection=function(){if(this.isGrace)this.above=!1;else if(this.voiceNumber===0)this.above=!0;else if(this.voiceNumber>0)this.above=!1;else{var e=!1;this.anchor1&&this.anchor1.stemDir==="down"&&(e=!0),this.anchor2&&this.anchor2.stemDir==="down"&&(e=!0);for(var t=0;t<this.internalNotes.length;t++){var r=this.internalNotes[t];r.stemDir==="down"&&(e=!0)}this.above=e}};Pe.prototype.calcX=function(e,t){this.anchor1?(this.startX=this.anchor1.x,this.anchor1.scalex<1&&(this.startX-=3)):this.startLimitX?this.startX=this.startLimitX.x+this.startLimitX.w:this.anchor2?this.startX=this.anchor2.x-20:this.startX=e,!this.anchor1&&this.dotted&&(this.startX-=3),this.anchor2?this.endX=this.anchor2.x:this.endLimitX?this.endX=this.endLimitX.x:this.endX=t};Pe.prototype.calcTieY=function(){this.anchor1?this.startY=this.anchor1.pitch:this.anchor2?this.startY=this.anchor2.pitch:this.startY=this.above?14:0,this.anchor2?this.endY=this.anchor2.pitch:this.anchor1?this.endY=this.anchor1.pitch:this.endY=this.above?14:0};Pe.prototype.calcSlurY=function(){if(this.anchor1&&this.anchor2){this.above&&this.anchor1.stemDir==="up"&&!this.fixedY?(this.startY=(this.anchor1.highestVert+this.anchor1.pitch)/2,this.startX+=this.anchor1.w/2):this.startY=this.anchor1.pitch;var e=this.anchor2.parent.beam&&this.anchor2.parent.beam.stemsUp&&this.anchor2.parent.beam.elems[0]!==this.anchor2.parent,t=(this.anchor2.highestVert+this.anchor2.pitch)/2;if(this.above&&this.anchor2.stemDir==="up"&&!this.fixedY&&!e&&t<this.startY?(this.endY=t,this.endX+=Math.round(this.anchor2.w/2)):this.endY=this.above&&e?this.anchor2.highestVert:this.anchor2.pitch,this.anchor1.scalex===1){var r=!!this.anchor1.parent.beam,a=!!this.anchor2.parent.beam;if(r){var n=this.anchor1.parent===this.anchor1.parent.beam.elems[this.anchor1.parent.beam.elems.length-1];n||(this.above?this.startY=this.anchor1.parent.fixed.t:this.startY=this.anchor1.parent.fixed.b)}if(a){var i=this.anchor2.parent===this.anchor2.parent.beam.elems[0];i||(this.above?this.endY=this.anchor2.parent.fixed.t:this.endY=this.anchor2.parent.fixed.b)}}}else this.anchor1?this.startY=this.endY=this.anchor1.pitch:this.anchor2?this.startY=this.endY=this.anchor2.pitch:(this.startY=this.above?14:0,this.endY=this.above?14:0)};Pe.prototype.avoidCollisionAbove=function(){if(this.above){for(var e=-50,t=0;t<this.internalNotes.length;t++)this.internalNotes[t].highestVert>e&&(e=this.internalNotes[t].highestVert);e>this.startY&&e>this.endY&&(this.startY=this.endY=e-1)}};Pe.prototype.getYBounds=function(){var e=10,t=1e3;this.isTie?(this.calcTieDirection(),this.calcX(e,t),this.calcTieY()):(this.calcSlurDirection(),this.calcX(e,t),this.calcSlurY());var r,a;return this.above?(a=Math.min(this.startY,this.endY),r=a+3):(r=Math.min(this.startY,this.endY),a=r-3),[r,a]};var gi=Pe,$1=I1,K0=O1,R1=z1,je=mt,Pt=at,G1=gi,rr=function(){this.startDiminuendoX=void 0,this.startCrescendoX=void 0,this.minTop=12,this.minBottom=0},Y1=function(e,t,r,a,n,i,s,o,c){for(var f,u=0;u<t.length;u++){if(t[u]==="staccato"||t[u]==="tenuto"||t[u]==="accent"&&!c){var l="scripts."+t[u];if(t[u]==="accent"&&(l="scripts.sforzato"),f===void 0?f=s==="down"?r+2:o-2:f=s==="down"?f+2:f-2,t[u]==="accent")s==="up"?f--:f++;else switch(f){case 2:case 4:case 6:case 8:case 10:s==="up"?f--:f++;break}r>9&&f++;var h=a/2;je.getSymbolAlign(l)!=="center"&&(h-=je.getSymbolWidth(l)/2),n.addFixedX(new Pt(l,h,je.getSymbolWidth(l),f))}if(t[u]==="slide"&&n.heads[0]){var d=n.heads[0].pitch;d-=2;var p=new Pt("",-i-15,0,d-1),g=new Pt("",-i-5,0,d+1);n.addFixedX(p),n.addFixedX(g),e.addOther(new G1({anchor1:p,anchor2:g,fixedY:!0}))}}return f===void 0&&(f=r),{above:f,below:n.bottom}},q1=function(e,t,r,a){for(var n=0;n<t.length;n++)switch(t[n]){case"p":case"mp":case"pp":case"ppp":case"pppp":case"f":case"ff":case"fff":case"ffff":case"sfz":case"mf":var i=new $1(r,t[n],a);e.addOther(i)}},W1=function(e,t,r,a,n){function i(){if(a.heads.length===0)return 10;for(var f=a.heads[0].pitch,u=1;u<a.heads.length;u++)f=Math.max(f,a.heads[u].pitch);return f}function s(){if(a.heads.length===0)return 2;for(var f=a.heads[0].pitch,u=1;u<a.heads.length;u++)f=Math.min(f,a.heads[u].pitch);return f}function o(f,u){var l=n==="down"?s()+1:i()+9;n!=="down"&&u===1&&l--;var h=r/2;h+=n==="down"?-5:3;for(var d=0;d<u;d++)l-=1,a.addFixedX(new Pt(f,h,je.getSymbolWidth(f),l))}for(var c=0;c<e.length;c++)switch(e[c]){case"/":o("flags.ugrace",1);break;case"//":o("flags.ugrace",2);break;case"///":o("flags.ugrace",3);break;case"////":o("flags.ugrace",4);break}},X1=function(e,t,r,a,n,i,s,o){function c(g,v){g==="above"?a.above+=v:a.below-=v}function f(g){var v;return g==="above"?(v=a.above,v<i&&(v=i)):(v=a.below,v>s&&(v=s)),v}function u(g,v,m){var y=f(v),x=2,b=5;r.addFixedX(new Pt(g,t/2,0,y+x,{type:"decoration",klass:"ornament",thickness:3,anchor:m})),c(v,b)}function l(g,v){var m=t/2;je.getSymbolAlign(g)!=="center"&&(m-=je.getSymbolWidth(g)/2);var y=je.symbolHeightInPitches(g)+1,x=f(v);x=v==="above"?x+y/2:x-y/2,r.addFixedX(new Pt(g,m,je.getSymbolWidth(g),x,{klass:"ornament",thickness:je.symbolHeightInPitches(g),position:v})),c(v,y)}for(var h={"+":"scripts.stopped",open:"scripts.open",snap:"scripts.snap",wedge:"scripts.wedge",thumb:"scripts.thumb",shortphrase:"scripts.shortphrase",mediumphrase:"scripts.mediumphrase",longphrase:"scripts.longphrase",trill:"scripts.trill",trillh:"scripts.trill",roll:"scripts.roll",irishroll:"scripts.roll",marcato:"scripts.umarcato",dmarcato:"scripts.dmarcato",umarcato:"scripts.umarcato",turn:"scripts.turn",uppermordent:"scripts.prall",pralltriller:"scripts.prall",mordent:"scripts.mordent",lowermordent:"scripts.mordent",downbow:"scripts.downbow",upbow:"scripts.upbow",fermata:"scripts.ufermata",invertedfermata:"scripts.dfermata",breath:",",coda:"scripts.coda",segno:"scripts.segno"},d=!1,p=0;p<e.length;p++)switch(e[p]){case"0":case"1":case"2":case"3":case"4":case"5":case"D.C.":case"D.S.":u(e[p],n,"middle"),d=!0;break;case"D.C.alcoda":u("D.C. al coda",n,"end"),d=!0;break;case"D.C.alfine":u("D.C. al fine",n,"end"),d=!0;break;case"D.S.alcoda":u("D.S. al coda",n,"end"),d=!0;break;case"D.S.alfine":u("D.S. al fine",n,"end"),d=!0;break;case"fine":u("FINE",n,"middle"),d=!0;break;case"+":case"open":case"snap":case"wedge":case"thumb":case"shortphrase":case"mediumphrase":case"longphrase":case"trill":case"trillh":case"roll":case"irishroll":case"marcato":case"dmarcato":case"turn":case"uppermordent":case"pralltriller":case"mordent":case"lowermordent":case"downbow":case"upbow":case"fermata":case"breath":case"umarcato":case"coda":case"segno":l(h[e[p]],n),d=!0;break;case"invertedfermata":l(h[e[p]],"below"),d=!0;break;case"mark":r.klass="mark";break;case"accent":o&&(l("scripts.sforzato",n),d=!0);break}return d};function U1(e,t,r){for(var a=0;a<e.length;a++)switch(e[a]){case"arpeggio":for(var n=t.abcelem.minpitch-1;n<=t.abcelem.maxpitch;n+=2)t.addExtra(new Pt("scripts.arpeggio",-je.getSymbolWidth("scripts.arpeggio")*2-r,0,n+2,{klass:"ornament",thickness:je.symbolHeightInPitches("scripts.arpeggio")}));break}}rr.prototype.endLine=function(e){this.startDiminuendoX&&(e.addOther(new K0(this.startDiminuendoX,Ja(e.children),">",this.dynamicPositioning)),this.startDiminuendoX=void 0),this.startCrescendoX&&(e.addOther(new K0(this.startCrescendoX,Ja(e.children),"<",this.dynamicPositioning)),this.startCrescendoX=void 0)};rr.prototype.dynamicDecoration=function(e,t,r,a){for(var n,i,s,o=0;o<t.length;o++)switch(t[o]){case"diminuendo(":this.startDiminuendoX=r,this.dynamicPositioning=a,n=void 0;break;case"diminuendo)":this.startDiminuendoX||(this.startDiminuendoX=Qa(e.children)),n={start:this.startDiminuendoX,stop:r},this.startDiminuendoX=void 0;break;case"crescendo(":this.startCrescendoX=r,this.dynamicPositioning=a,i=void 0;break;case"crescendo)":this.startCrescendoX||(this.startCrescendoX=Qa(e.children)),i={start:this.startCrescendoX,stop:r},this.startCrescendoX=void 0;break;case"~(":case"glissando(":this.startGlissandoX=r,s=void 0;break;case"~)":case"glissando)":s={start:this.startGlissandoX,stop:r},this.startGlissandoX=void 0;break}n&&e.addOther(new K0(n.start,n.stop,">",a)),i&&e.addOther(new K0(i.start,i.stop,"<",a)),s&&e.addOther(new R1(s.start,s.stop))};function Qa(e){for(var t=0;t<e.length;t++)if(e[t].abcelem.pitches)return e[t];return null}function Ja(e){return e[e.length-1]}rr.prototype.createDecoration=function(e,t,r,a,n,i,s,o,c,f,u){c||(c={ornamentPosition:"above",volumePosition:f?"above":"below",dynamicPosition:f?"above":"below"}),q1(e,t,n,c.volumePosition),this.dynamicDecoration(e,t,n,c.dynamicPosition),W1(t,r,a,n,s);var l=Y1(e,t,r,a,n,i,s,o,u);l.above=Math.max(l.above,this.minTop),l.below=Math.min(l.below,o),X1(t,a,n,l,c.ornamentPosition,this.minTop,o,u),U1(t,n,i)};var V1=rr,j1=function(t,r,a){this.type="EndingElem",this.text=t,this.anchor1=r,this.anchor2=a,this.endingHeightAbove=5,this.pitch=void 0},K1=j1,Q1=function(e){for(var t=0,r=0;r<e.voices.length;r++){var a=e.voices[r].staff;e.voices[r].duplicate||(t+=a.top,t+=-a.bottom)}return t},J1=Q1,Z1=J1,e0=function(e){this.getTextSize=e,this.voices=[],this.staffs=[],this.brace=void 0,this.bracket=void 0};e0.prototype.setLimit=function(e,t){t.specialY[e]&&(t.staff.specialY[e]?t.staff.specialY[e]=Math.max(t.staff.specialY[e],t.specialY[e]):t.staff.specialY[e]=t.specialY[e])};e0.prototype.addVoice=function(e,t,r){var a=this.voices.length;this.voices[a]=e,this.staffs[t]?this.staffs[t].voices.push(a):this.staffs[this.staffs.length]={top:10,bottom:2,lines:r,voices:[a],specialY:{tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}},e.staff=this.staffs[t]};e0.prototype.setHeight=function(){this.height=Z1(this)};e0.prototype.setWidth=function(e){this.w=e;for(var t=0;t<this.voices.length;t++)this.voices[t].setWidth(e)};e0.prototype.setStaffLimits=function(e){e.staff.top=Math.max(e.staff.top,e.top),e.staff.bottom=Math.min(e.staff.bottom,e.bottom),this.setLimit("tempoHeightAbove",e),this.setLimit("partHeightAbove",e),this.setLimit("volumeHeightAbove",e),this.setLimit("dynamicHeightAbove",e),this.setLimit("endingHeightAbove",e),this.setLimit("chordHeightAbove",e),this.setLimit("lyricHeightAbove",e),this.setLimit("lyricHeightBelow",e),this.setLimit("chordHeightBelow",e),this.setLimit("volumeHeightBelow",e),this.setLimit("dynamicHeightBelow",e)};var el=e0,tl=Qt,rl=at,Qr=function(t,r,a){this.type="TempoElement",this.tempo=t,this.tempo.type="tempo",this.tuneNumber=r,this.totalHeightInPitches=6,this.tempoHeightAbove=this.totalHeightInPitches,this.pitch=void 0,this.tempo.duration&&!this.tempo.suppressBpm&&(this.note=this.createNote(a,t,r))};Qr.prototype.setX=function(e){this.x=e};Qr.prototype.createNote=function(e,t,r){var a=.75,n=t.duration[0],i=new tl(t,n,1,"tempo",r),s,o,c;n<=1/32?(c="noteheads.quarter",o="flags.u32nd",s=0):n<=1/16?(c="noteheads.quarter",o="flags.u16th",s=0):n<=3/32?(c="noteheads.quarter",o="flags.u16nd",s=1):n<=1/8?(c="noteheads.quarter",o="flags.u8th",s=0):n<=3/16?(c="noteheads.quarter",o="flags.u8th",s=1):n<=1/4?(c="noteheads.quarter",s=0):n<=3/8?(c="noteheads.quarter",s=1):n<=1/2?(c="noteheads.half",s=0):n<=3/4?(c="noteheads.half",s=1):n<=1?(c="noteheads.whole",s=0):n<=1.5?(c="noteheads.whole",s=1):n<=2?(c="noteheads.dbl",s=0):(c="noteheads.dbl",s=1);var f=e(i,c,{verticalPos:0},{dir:"up",flag:o,dot:s,scale:a}),u=f.notehead;i.addHead(u);var l;if(c!=="noteheads.whole"&&c!=="noteheads.dbl"){var h=.3333333333333333*a,d=5*a,p=u.dx+u.w,g=-.6;l=new rl(null,p,0,h,{type:"stem",pitch2:d,linewidth:g}),i.addRight(l)}return i};var al=Qr,ar=function(t,r,a){this.type="TripletElem",this.anchor1=r,this.number=t,this.durationClass=("d"+Math.round(r.parent.durationClass*1e3)/1e3).replace(/\./,"-"),this.middleElems=[],this.flatBeams=a.flatBeams};ar.prototype.isClosed=function(){return!!this.anchor2};ar.prototype.middleNote=function(e){this.middleElems.push(e)};ar.prototype.setCloseAnchor=function(e){this.anchor2=e,(!this.anchor1.parent.beam||this.anchor1.stemDir==="up")&&(this.endingHeightAbove=4)};var nl=ar;function Za(e){switch(e){case"B#":return"H#";case"B♯":return"H♯";case"B":return"H";case"Bb":return"B";case"B♭":return"B"}return e}function il(e,t,r){var a=e.split(`
27
- `);for(let n=0;n<a.length;n++){let s=a[n].match(/^([ABCDEFG][♯♭]?)?([^\/]+)?(\/([ABCDEFG][#b♯♭]?))?/);if(!s)continue;let o=s[1]||"",c=s[2]||"",f=s[4]||"";r&&(o=Za(o),f=Za(f));const u=t?"":"",l=f?"/"+f:"";a[n]=[o,c,l].join(u)}return a.join(`
28
- `)}var sl=il,$t=at,br=Se;const ol=sl;var cl=function(e,t,r,a,n,i,s,o){for(var c=0;c<r.chord.length;c++){var f=r.chord[c].position,u=r.chord[c].rel_position,l=f==="left"||f==="right"||f==="below"||f==="above"||!!u,h,d;l?(h="annotationfont",d="abcjs-annotation"):(h="gchordfont",d="abcjs-chord");var p=e.attr(h,d),g=r.chord[c].name,v;if(typeof g=="string")v=en(g,f,u,l,h,d,p,e,t,r,a,n,i,s,o),a=v.roomTaken,n=v.roomTakenRight;else for(var m=0;m<g.length;m++)v=en(g[m].text,f,u,l,h,d,p,e,t,r,a,n,i,s,o),a=v.roomTaken,n=v.roomTakenRight}return{roomTaken:a,roomTakenRight:n}};function en(e,t,r,a,n,i,s,o,c,f,u,l,h,d,p){for(var g=e.split(`
29
- `),v=g.length-1;v>=0;v--){var m=g[v],y=0,x;a||(m=ol(m,d,p));var b=o.calc(m,n,i),w=b.width,C=b.height/br.STEP;switch(t){case"left":u+=w+7,y=-u,x=f.averagepitch,c.addExtra(new $t(m,y,w+4,x,{type:"text",height:C,dim:s,position:"left"}));break;case"right":l+=4,y=l,x=f.averagepitch,c.addRight(new $t(m,y,w+4,x,{type:"text",height:C,dim:s,position:"right"}));break;case"below":c.addRight(new $t(m,0,0,void 0,{type:"text",position:"below",height:C,dim:s,realWidth:w}));break;case"above":c.addRight(new $t(m,0,0,void 0,{type:"text",position:"above",height:C,dim:s,realWidth:w}));break;default:if(r){var T=r.y+3*br.STEP;c.addRight(new $t(m,y+r.x,0,f.minpitch+T/br.STEP,{position:"relative",type:"text",height:C,dim:s}))}else{var B="above";f.positioning&&f.positioning.chordPosition&&(B=f.positioning.chordPosition),B!=="hidden"&&c.addCentered(new $t(m,h/2,w,void 0,{type:"chord",position:B,height:C,dim:s,realWidth:w}))}}}return{roomTaken:u,roomTakenRight:l}}var ll=cl,Vt=Qt,bi=g1,tn=b1,mi=_1,yi=M1,k0=B1,wi=P1,hl=V1,xi=K1,b0=mt,pe=at,_0=Se,fl=el,Ci=al,jt=gi,ul=nl,dl=ni,ki=ll,pl=Zn,gt=rt,Ir=function(e){var t=0;return e.duration&&(t=e.duration),t},Ke=!1,Ve={rest:{0:"rests.whole",1:"rests.half",2:"rests.quarter",3:"rests.8th",4:"rests.16th",5:"rests.32nd",6:"rests.64th",7:"rests.128th",multi:"rests.multimeasure"},note:{"-1":"noteheads.dbl",0:"noteheads.whole",1:"noteheads.half",2:"noteheads.quarter",3:"noteheads.quarter",4:"noteheads.quarter",5:"noteheads.quarter",6:"noteheads.quarter",7:"noteheads.quarter",nostem:"noteheads.quarter"},rhythm:{"-1":"noteheads.slash.whole",0:"noteheads.slash.whole",1:"noteheads.slash.whole",2:"noteheads.slash.quarter",3:"noteheads.slash.quarter",4:"noteheads.slash.quarter",5:"noteheads.slash.quarter",6:"noteheads.slash.quarter",7:"noteheads.slash.quarter",nostem:"noteheads.slash.nostem"},x:{"-1":"noteheads.indeterminate",0:"noteheads.indeterminate",1:"noteheads.indeterminate",2:"noteheads.indeterminate",3:"noteheads.indeterminate",4:"noteheads.indeterminate",5:"noteheads.indeterminate",6:"noteheads.indeterminate",7:"noteheads.indeterminate",nostem:"noteheads.indeterminate"},harmonic:{"-1":"noteheads.harmonic.quarter",0:"noteheads.harmonic.quarter",1:"noteheads.harmonic.quarter",2:"noteheads.harmonic.quarter",3:"noteheads.harmonic.quarter",4:"noteheads.harmonic.quarter",5:"noteheads.harmonic.quarter",6:"noteheads.harmonic.quarter",7:"noteheads.harmonic.quarter",nostem:"noteheads.harmonic.quarter"},triangle:{"-1":"noteheads.triangle.quarter",0:"noteheads.triangle.quarter",1:"noteheads.triangle.quarter",2:"noteheads.triangle.quarter",3:"noteheads.triangle.quarter",4:"noteheads.triangle.quarter",5:"noteheads.triangle.quarter",6:"noteheads.triangle.quarter",7:"noteheads.triangle.quarter",nostem:"noteheads.triangle.quarter"},uflags:{3:"flags.u8th",4:"flags.u16th",5:"flags.u32nd",6:"flags.u64th"},dflags:{3:"flags.d8th",4:"flags.d16th",5:"flags.d32nd",6:"flags.d64th"}},ve=function(e,t,r){this.decoration=new hl,this.getTextSize=e,this.tuneNumber=t,this.isBagpipes=r.bagpipes,this.flatBeams=r.flatbeams,this.graceSlurs=r.graceSlurs,this.percmap=r.percmap,this.initialClef=r.initialClef,this.jazzchords=!!r.jazzchords,this.accentAbove=!!r.accentAbove,this.germanAlphabet=!!r.germanAlphabet,this.reset()};ve.prototype.reset=function(){this.slurs={},this.ties=[],this.voiceScale=1,this.voiceColor=void 0,this.slursbyvoice={},this.tiesbyvoice={},this.endingsbyvoice={},this.scaleByVoice={},this.colorByVoice={},this.tripletmultiplier=1,this.abcline=void 0,this.accidentalSlot=void 0,this.accidentalshiftx=void 0,this.dotshiftx=void 0,this.hasVocals=!1,this.minY=void 0,this.partstartelem=void 0,this.startlimitelem=void 0,this.stemdir=void 0};ve.prototype.setStemHeight=function(e){this.stemHeight=Math.round(e*10/_0.STEP)/10};ve.prototype.getCurrentVoiceId=function(e,t){return"s"+e+"v"+t};ve.prototype.pushCrossLineElems=function(e,t){this.slursbyvoice[this.getCurrentVoiceId(e,t)]=this.slurs,this.tiesbyvoice[this.getCurrentVoiceId(e,t)]=this.ties,this.endingsbyvoice[this.getCurrentVoiceId(e,t)]=this.partstartelem,this.scaleByVoice[this.getCurrentVoiceId(e,t)]=this.voiceScale,this.voiceColor&&(this.colorByVoice[this.getCurrentVoiceId(e,t)]=this.voiceColor)};ve.prototype.popCrossLineElems=function(e,t){this.slurs=this.slursbyvoice[this.getCurrentVoiceId(e,t)]||{},this.ties=this.tiesbyvoice[this.getCurrentVoiceId(e,t)]||[],this.partstartelem=this.endingsbyvoice[this.getCurrentVoiceId(e,t)],this.voiceScale=this.scaleByVoice[this.getCurrentVoiceId(e,t)],this.voiceScale===void 0&&(this.voiceScale=1),this.voiceColor=this.colorByVoice[this.getCurrentVoiceId(e,t)]};ve.prototype.containsLyrics=function(e){for(var t=0;t<e.length;t++)for(var r=0;r<e[t].voices.length;r++)for(var a=0;a<e[t].voices[r].length;a++){var n=e[t].voices[r][a];if(n.lyric){(!n.positioning||n.positioning.vocalPosition==="below")&&(this.hasVocals=!0);return}}};ve.prototype.createABCLine=function(e,t,r){this.minY=2,this.containsLyrics(e);var a=new fl(this.getTextSize);this.tempoSet=!1;for(var n=0;n<e.length;n++)Ke&&this.restoreState(),Ke=!1,this.createABCStaff(a,e[n],t,n,r);return a};ve.prototype.createABCStaff=function(e,t,r,a,n){e.getTextSize.updateFonts(t);for(var i=0;i<t.voices.length;i++){var s=new dl(i,t.voices.length);i===0?(s.barfrom=t.connectBarLines==="start"||t.connectBarLines==="continue",s.barto=t.connectBarLines==="continue"||t.connectBarLines==="end"):s.duplicate=!0,t.title&&t.title[i]&&(s.header=t.title[i].replace(/\\n/g,`
30
- `),s.headerPosition=6+e.getTextSize.baselineToCenter(s.header,"voicefont","staff-extra voice-name",i,t.voices.length)/_0.STEP),t.clef&&t.clef.type==="perc"&&(s.isPercussion=!0);var o=(!this.initialClef||n===0)&&mi(t.clef,this.tuneNumber);o&&(i===0&&t.barNumber&&this.addMeasureNumber(t.barNumber,o),s.addChild(o),this.startlimitelem=o);var c=yi(t.key,this.tuneNumber);if(c&&(s.addChild(c),this.startlimitelem=c),t.meter){t.meter.type==="specified"?this.measureLength=t.meter.value[0].num/t.meter.value[0].den:this.measureLength=1;var f=wi(t.meter,this.tuneNumber);s.addChild(f),this.startlimitelem=f}s.duplicate&&(s.children=[]);var u=t.clef.stafflines||t.clef.stafflines===0?t.clef.stafflines:5;e.addVoice(s,a,u);var l=u===1;this.createABCVoice(t.voices[i],r,a,i,l,s),e.setStaffLimits(s),i===0&&(t.brace==="start"||!e.brace&&t.brace?(e.brace||(e.brace=[]),e.brace.push(new tn(s,"brace"))):t.brace==="end"&&e.brace?e.brace[e.brace.length-1].setBottomStaff(s):t.brace==="continue"&&e.brace&&e.brace[e.brace.length-1].continuing(s),t.bracket==="start"||!e.bracket&&t.bracket?(e.bracket||(e.bracket=[]),e.bracket.push(new tn(s,"bracket"))):t.bracket==="end"&&e.bracket?e.bracket[e.bracket.length-1].setBottomStaff(s):t.bracket==="continue"&&e.bracket&&e.bracket[e.bracket.length-1].continuing(s))}};function vl(e,t){var r=e[t];if(r.el_type!=="note"||!r.startBeam||r.endBeam)return{count:1,elem:r};for(var a=[];t<e.length&&e[t].el_type==="note"&&(a.push(e[t]),!e[t].endBeam);)t++;return{count:a.length,elem:a}}ve.prototype.createABCVoice=function(e,t,r,a,n,i){this.popCrossLineElems(r,a),this.stemdir=this.isBagpipes?"down":null,this.abcline=e,this.partstartelem&&(this.partstartelem=new xi("",null,null),i.addOther(this.partstartelem));var s=i.voicetotal<2?-1:i.voicenumber;for(var o in this.slurs)this.slurs.hasOwnProperty(o)&&(this.slurs[o]=new jt({force:this.slurs[o].force,voiceNumber:s,stemDir:this.slurs[o].stemDir,style:this.slurs[o].dotted}),Ke&&this.slurs[o].setHint(),i.addOther(this.slurs[o]));for(var c=0;c<this.ties.length;c++)this.ties[c]=new jt({force:this.ties[c].force,stemDir:this.ties[c].stemDir,voiceNumber:s,style:this.ties[c].dotted}),Ke&&this.ties[c].setHint(),i.addOther(this.ties[c]);for(var f=0;f<this.abcline.length;f++)gl(this.abcline[f]),this.minY=Math.min(this.abcline[f].minpitch,this.minY);for(var u=r===0,l=0;l<this.abcline.length;){var h=vl(this.abcline,l),d=this.createABCElement(u,n,i,h.elem);if(d)for(c=0;c<d.length;c++){if(!this.tempoSet&&t&&!t.suppress){this.tempoSet=!0;var p=new Vt(t,0,0,"tempo",this.tuneNumber,{});p.addFixedX(new Ci(t,this.tuneNumber,k0)),i.addChild(p)}i.addChild(d[c])}l+=h.count}this.decoration.endLine(i),this.pushCrossLineElems(r,a)};ve.prototype.saveState=function(){this.tiesSave=gt.cloneArray(this.ties),this.slursSave=gt.cloneHashOfHash(this.slurs),this.slursbyvoiceSave=gt.cloneHashOfHash(this.slursbyvoice),this.tiesbyvoiceSave=gt.cloneHashOfArrayOfHash(this.tiesbyvoice)};ve.prototype.restoreState=function(){this.ties=gt.cloneArray(this.tiesSave),this.slurs=gt.cloneHashOfHash(this.slursSave),this.slursbyvoice=gt.cloneHashOfHash(this.slursbyvoiceSave),this.tiesbyvoice=gt.cloneHashOfArrayOfHash(this.tiesbyvoiceSave)};ve.prototype.createABCElement=function(e,t,r,a){var n=[];switch(a.el_type){case void 0:n=this.createBeam(t,r,a);break;case"note":n[0]=this.createNote(a,!1,t,r),this.triplet&&this.triplet.isClosed()&&(r.addOther(this.triplet),this.triplet=null,this.tripletmultiplier=1);break;case"bar":n[0]=this.createBarLine(r,a,e),r.duplicate&&n.length>0&&(n[0].invisible=!0);break;case"meter":n[0]=wi(a,this.tuneNumber),this.startlimitelem=n[0],r.duplicate&&n.length>0&&(n[0].invisible=!0);break;case"clef":if(n[0]=mi(a,this.tuneNumber),!n[0])return null;r.duplicate&&n.length>0&&(n[0].invisible=!0);break;case"key":var i=yi(a,this.tuneNumber);i&&(n[0]=i,this.startlimitelem=n[0]),r.duplicate&&n.length>0&&(n[0].invisible=!0);break;case"stem":this.stemdir=a.direction==="auto"?void 0:a.direction;break;case"part":var s=new Vt(a,0,0,"part",this.tuneNumber),o=this.getTextSize.calc(a.title,"partsfont","part");s.addFixedX(new pe(a.title,0,0,void 0,{type:"part",height:o.height/_0.STEP})),n[0]=s;break;case"tempo":var c=new Vt(a,0,0,"tempo",this.tuneNumber);a.suppress||c.addFixedX(new Ci(a,this.tuneNumber,k0)),n[0]=c;break;case"style":a.head==="normal"?delete this.style:this.style=a.head;break;case"hint":Ke=!0,this.saveState();break;case"midi":break;case"scale":this.voiceScale=a.size;break;case"color":this.voiceColor=a.color,r.color=this.voiceColor;break;default:var f=new Vt(a,0,0,"unsupported",this.tuneNumber);f.addFixed(new pe("element type "+a.el_type,0,0,void 0,{type:"debug"})),n[0]=f}return n};function gl(e){if(e.pitches){bl(e);for(var t=0,r=0;r<e.pitches.length;r++)t+=e.pitches[r].verticalPos;e.averagepitch=t/e.pitches.length,e.minpitch=e.pitches[0].verticalPos,e.maxpitch=e.pitches[e.pitches.length-1].verticalPos}}ve.prototype.createBeam=function(e,t,r){var a=[],n=new bi(this.stemHeight*this.voiceScale,this.stemdir,this.flatBeams,r[0]);Ke&&n.setHint();for(var i=0;i<r.length;i++)n.runningDirection(r[i]);n.setStemDirection();var s=this.stemdir;for(this.stemdir=n.stemsUp?"up":"down",i=0;i<r.length;i++){var o=r[i],c=this.createNote(o,!0,e,t);a.push(c),n.add(c),this.triplet&&this.triplet.isClosed()&&(t.addOther(this.triplet),this.triplet=null,this.tripletmultiplier=1)}return n.calcDir(),t.addBeam(n),this.stemdir=s,a};var bl=function(e){var t;do{t=!0;for(var r=0;r<e.pitches.length-1;r++)if(e.pitches[r].pitch>e.pitches[r+1].pitch){t=!1;var a=e.pitches[r];e.pitches[r]=e.pitches[r+1],e.pitches[r+1]=a}}while(!t)},_i=function(e,t,r,a,n,i,s,o,c){for(var f=r;f>11;f--)f%2===0&&!a&&e.addFixed(new pe(null,o,(n+4)*c,f,{type:"ledger"}));for(f=t;f<1;f++)f%2===0&&!a&&e.addFixed(new pe(null,o,(n+4)*c,f,{type:"ledger"}));for(f=0;f<i.length;f++){var u=n;s==="down"&&(u=-u),e.addFixed(new pe(null,u+o,(n+4)*c,i[f],{type:"ledger"}))}};ve.prototype.addGraceNotes=function(e,t,r,a,n,i,s){var o=.6,c=3.5/5;n=Math.round(n*c);var f=null,u;e.gracenotes.length>1&&(f=new bi(n,"grace",i),Ke&&f.setHint(),f.mainNote=r);var l,h=[];for(l=e.gracenotes.length-1;l>=0;l--)s+=10,h[l]=s,e.gracenotes[l].accidental&&(s+=7);for(l=0;l<e.gracenotes.length;l++){var d=e.gracenotes[l].verticalPos;u=f?null:Ve.uflags[i?5:3];var p=[],g=k0(r,"noteheads.quarter",e.gracenotes[l],{dir:"up",headx:-h[l],extrax:-h[l],flag:u,scale:o*this.voiceScale,accidentalSlot:p});g.notehead.highestVert=g.notehead.pitch+n;var v=g.notehead;if(this.addSlursAndTies(r,e.gracenotes[l],v,t,"up",!0),r.addExtra(v),e.gracenotes[l].acciaccatura){var m=e.gracenotes[l].verticalPos+7*o,y=f?5:6;r.addRight(new pe("flags.ugrace",-h[l]+y,0,m,{scalex:o,scaley:o}))}if(f){var x=e.gracenotes[l].duration/2;i&&(x/=2);var b={heads:[v],abcelem:{averagepitch:d,minpitch:d,maxpitch:d,duration:x}};f.add(b)}else{var w=d+.3333333333333333*o,C=d+7*o,T=v.dx+v.w,B=-.6;r.addExtra(new pe(null,T,0,w,{type:"stem",pitch2:C,linewidth:B}))}_i(r,d,d,!1,b0.getSymbolWidth("noteheads.quarter"),[],!0,v.dx-1,.6);var E=e.rest&&(e.rest.type==="spacer"||e.rest.type==="invisible");l===0&&!i&&this.graceSlurs&&!E&&t.addOther(new jt({anchor1:v,anchor2:a,isGrace:!0}))}return f&&(f.calcDir(),t.addBeam(f)),s};function ml(e,t,r,a,n,i,s,o,c){var f,u=7,l,h,d;switch(n&&(i==="down"&&(u=3),i==="up"&&(u=11)),s&&(r<.5||r<1?u=7:u=5),t.rest.type){case"whole":f=Ve.rest[0],t.averagepitch=u,t.minpitch=u,t.maxpitch=u,a=0;break;case"rest":t.style==="rhythm"?f=Ve.rhythm[-o]:f=Ve.rest[-o],t.averagepitch=u,t.minpitch=u,t.maxpitch=u;break;case"invisible":case"invisible-multimeasure":case"spacer":f="",t.averagepitch=u,t.minpitch=u,t.maxpitch=u;break;case"multimeasure":f=Ve.rest.multi,t.averagepitch=u,t.minpitch=u,t.maxpitch=u,a=0;var p=b0.getSymbolWidth(f);e.addHead(new pe(f,p,p*2,7));var g=new pe(""+t.rest.text,p,p,16,{type:"multimeasure-text"});e.addExtra(g)}if(t.rest.type.indexOf("multimeasure")<0&&t.rest.type!=="invisible"){var v=k0(e,f,{verticalPos:u},{dot:a,scale:c});l=v.notehead,l&&(e.addHead(l),h=v.accidentalshiftx,d=v.dotshiftx)}return{noteHead:l,roomTaken:h,roomTakenRight:d}}function rn(e,t){for(var r=0;r<e.length;r++)if(JSON.stringify(e[r])===JSON.stringify(t))return;e.push(t)}ve.prototype.addNoteToAbcElement=function(e,t,r,a,n,i,s,o,c){var f=0,u,l=0,h=0,d,p,g=[],v=[],m=0,y=t.averagepitch>=6?"down":"up";a&&(y=a),n=t.style?t.style:n,(!n||n==="normal")&&(n="note");var x;i?x=Ve[n].nostem:x=Ve[n][-s],x||console.log("noteSymbol:",n,s,i);var b;for(b=y==="down"?t.pitches.length-2:1;y==="down"?b>=0:b<t.pitches.length;b=y==="down"?b-1:b+1){var w=t.pitches[y==="down"?b+1:b-1],C=t.pitches[b],T=y==="down"?w.pitch-C.pitch:C.pitch-w.pitch;T<=1&&!w.printer_shift&&(C.printer_shift=T?"different":"same",(C.verticalPos>11||C.verticalPos<1)&&g.push(C.verticalPos-C.verticalPos%2),y==="down"?l=b0.getSymbolWidth(x)+2:f=b0.getSymbolWidth(x)+2)}var B=t.pitches.length;for(b=0;b<t.pitches.length;b++){if(!o){var E;y==="down"&&b!==0||y==="up"&&b!==B-1?E=null:E=Ve[y==="down"?"dflags":"uflags"][-s]}var z;if(t.pitches[b].style)z=Ve[t.pitches[b].style][-s];else if(c.isPercussion&&this.percmap){z=x;var F=this.percmap[pl(t.pitches[b])];F&&F.noteHead&&Ve[F.noteHead]&&(z=Ve[F.noteHead][-s])}else z=x;t.pitches[b].highestVert=t.pitches[b].verticalPos;var O=(a==="up"||y==="up")&&b===0,R=(a==="down"||y==="down")&&b===B-1;if(O||R){if((t.startSlur||B===1)&&(t.pitches[b].highestVert=t.pitches[B-1].verticalPos,Ir(t)<1&&(a==="up"||y==="up")&&(t.pitches[b].highestVert+=6)),t.startSlur)for(t.pitches[b].startSlur||(t.pitches[b].startSlur=[]),p=0;p<t.startSlur.length;p++)rn(t.pitches[b].startSlur,t.startSlur[p]);if(t.endSlur)for(t.pitches[b].highestVert=t.pitches[B-1].verticalPos,Ir(t)<1&&(a==="up"||y==="up")&&(t.pitches[b].highestVert+=6),t.pitches[b].endSlur||(t.pitches[b].endSlur=[]),p=0;p<t.endSlur.length;p++)rn(t.pitches[b].endSlur,t.endSlur[p])}var Y=!o&&s<=-1,K=k0(e,z,t.pitches[b],{dir:y,extrax:-l,flag:E,dot:r,dotshiftx:f,scale:this.voiceScale,accidentalSlot:v,shouldExtendStem:!a,printAccidentals:!c.isPercussion});m=Math.max(b0.getSymbolWidth(z),m),e.extraw-=K.extraLeft,u=K.notehead,u&&(this.addSlursAndTies(e,t.pitches[b],u,c,Y?y:null,!1),t.gracenotes&&t.gracenotes.length>0&&(u.bottom=u.bottom-1),e.addHead(u)),l+=K.accidentalshiftx,h=Math.max(h,K.dotshiftx)}if(Y){var P=Math.round(70*this.voiceScale)/10,k=y==="down"?t.minpitch-P:t.minpitch+1/3;k>6&&!a&&(k=6);var _=y==="down"?t.maxpitch-1/3:t.maxpitch+P;_<6&&!a&&(_=6);var L=y==="down"||e.heads.length===0?0:e.heads[0].w,A=y==="down"?1:-1;u&&u.c==="noteheads.slash.quarter"&&(y==="down"?_-=1:k+=1),u&&u.c==="noteheads.triangle.quarter"&&(y==="down"?_-=.7:k-=1.2),e.addRight(new pe(null,L,0,k,{type:"stem",pitch2:_,linewidth:A,bottom:k-1})),d=Math.min(k,_)}return{noteHead:u,roomTaken:l,roomTakenRight:h,min:d,additionalLedgers:g,dir:y,symbolWidth:m}};ve.prototype.addLyric=function(e,t){var r="";t.lyric.forEach(function(i){var s=i.divider===" "?"":i.divider;r+=i.syllable+s+`
31
- `});var a=this.getTextSize.calc(r,"vocalfont","lyric"),n=t.positioning?t.positioning.vocalPosition:"below";e.addCentered(new pe(r,0,a.width,void 0,{type:"lyric",position:n,height:a.height/_0.STEP,dim:this.getTextSize.attr("vocalfont","lyric")}))};ve.prototype.createNote=function(e,t,r,a){var n=null,i=0,s=0,o=0,c=[],f,u=Ir(e),l=!1;u===0&&(l=!0,u=.25,t=!0);for(var h=Math.floor(Math.log(u)/Math.log(2)),d=0,p=Math.pow(2,h),g=p/2;p<u;d++,p+=g,g/=2);e.startTriplet&&(this.tripletmultiplier=e.tripletMultiplier);var v=u*this.tripletmultiplier;e.rest&&e.rest.type==="multimeasure"&&(v=1),e.rest&&e.rest.type==="invisible-multimeasure"&&(v=this.measureLength*e.rest.text);var m=e.rest?"rest":"note",y=new Vt(e,v,1,m,this.tuneNumber,{durationClassOveride:e.duration*this.tripletmultiplier});if(Ke&&y.setHint(),e.rest){this.measureLength===u&&e.rest.type!=="invisible"&&e.rest.type!=="spacer"&&e.rest.type.indexOf("multimeasure")<0&&(e.rest.type="whole");var x=ml(y,e,u,d,a.voicetotal>1,this.stemdir,r,h,this.voiceScale);n=x.noteHead,i=x.roomTaken,s=x.roomTakenRight}else{var b=this.addNoteToAbcElement(y,e,d,this.stemdir,this.style,l,h,t,a);b.min!==void 0&&(this.minY=Math.min(b.min,this.minY)),n=b.noteHead,i=b.roomTaken,s=b.roomTakenRight,c=b.additionalLedgers,f=b.dir,o=b.symbolWidth}if(e.lyric!==void 0&&this.addLyric(y,e),e.gracenotes!==void 0&&(i+=this.addGraceNotes(e,a,y,n,this.stemHeight*this.voiceScale,this.isBagpipes,i)),e.decoration){var w=t&&f!=="up"?Math.min(-3,y.bottom-6):y.bottom;this.decoration.createDecoration(a,e.decoration,y.top,n?n.w:0,y,i,f,w,e.positioning,this.hasVocals,this.accentAbove)}if(e.barNumber&&y.addFixed(new pe(e.barNumber,-10,0,0,{type:"barNumber"})),_i(y,e.minpitch,e.maxpitch,e.rest,o,c,f,-2,1),e.chord!==void 0){var C=ki(this.getTextSize,y,e,i,s,o,this.jazzchords,this.germanAlphabet);i=C.roomTaken,s=C.roomTakenRight}return e.startTriplet&&(this.triplet=new ul(e.startTriplet,n,{flatBeams:this.flatBeams})),e.endTriplet&&this.triplet&&this.triplet.setCloseAnchor(n),this.triplet&&!e.startTriplet&&!e.endTriplet&&!(e.rest&&e.rest.type==="spacer")&&this.triplet.middleNote(n),y};ve.prototype.addSlursAndTies=function(e,t,r,a,n,i){if(t.endTie&&this.ties.length>0){for(var s=!1,o=0;o<this.ties.length;o++)if(this.ties[o].anchor1&&this.ties[o].anchor1.pitch===r.pitch){this.ties[o].setEndAnchor(r),a.setRange(this.ties[o]),this.ties.splice(o,1),s=!0;break}s||(this.ties[0].setEndAnchor(r),a.setRange(this.ties[0]),this.ties.splice(0,1))}var c=a.voicetotal<2?-1:a.voicenumber;if(t.startTie){var f=new jt({anchor1:r,force:this.stemdir==="down"||this.stemdir==="up",stemDir:this.stemdir,isGrace:i,voiceNumber:c,style:t.startTie.style});Ke&&f.setHint(),this.ties[this.ties.length]=f,a.addOther(f),e.startTie=!0}var u,l;if(t.endSlur)for(var h=0;h<t.endSlur.length;h++)l=t.endSlur[h],this.slurs[l]?(u=this.slurs[l],u.setEndAnchor(r),a.setRange(u),delete this.slurs[l]):(u=new jt({anchor2:r,stemDir:this.stemdir,voiceNumber:c}),Ke&&u.setHint(),a.addOther(u)),this.startlimitelem&&u.setStartX(this.startlimitelem);else if(!i)for(var d in this.slurs)this.slurs.hasOwnProperty(d)&&this.slurs[d].addInternalNote(r);if(t.startSlur)for(h=0;h<t.startSlur.length;h++)l=t.startSlur[h].label,u=new jt({anchor1:r,stemDir:this.stemdir,voiceNumber:c,style:t.startSlur[h].style}),Ke&&u.setHint(),this.slurs[l]=u,a.addOther(u)};ve.prototype.addMeasureNumber=function(e,t){var r=this.getTextSize.calc(e,"measurefont","bar-number"),a=0;t.isClef&&(a+=r.width/2);var n=r.width>10&&t.abcelem.type==="treble"?13.5:11;t.addFixed(new pe(e,a,r.width,n+r.height/_0.STEP,{type:"barNumber",dim:this.getTextSize.attr("measurefont","bar-number")}))};ve.prototype.createBarLine=function(e,t,r){var a=new Vt(t,0,10,"bar",this.tuneNumber),n=null,i=0;t.barNumber&&this.addMeasureNumber(t.barNumber,a);var s=t.type==="bar_right_repeat"||t.type==="bar_dbl_repeat",o=t.type!=="bar_left_repeat"&&t.type!=="bar_thick_thin"&&t.type!=="bar_invisible",c=t.type==="bar_right_repeat"||t.type==="bar_dbl_repeat"||t.type==="bar_left_repeat"||t.type==="bar_thin_thick"||t.type==="bar_thick_thin",f=t.type==="bar_left_repeat"||t.type==="bar_thick_thin"||t.type==="bar_thin_thin"||t.type==="bar_dbl_repeat",u=t.type==="bar_left_repeat"||t.type==="bar_dbl_repeat";if(s||u){for(var l in this.slurs)this.slurs.hasOwnProperty(l)&&this.slurs[l].setEndX(a);this.startlimitelem=a}if(s&&(a.addRight(new pe("dots.dot",i,1,7)),a.addRight(new pe("dots.dot",i,1,5)),i+=6),o&&(n=new pe(null,i,1,2,{type:"bar",pitch2:10,linewidth:.6}),a.addRight(n)),t.type==="bar_invisible"&&(n=new pe(null,i,1,2,{type:"none",pitch2:10,linewidth:.6}),a.addRight(n)),t.decoration&&this.decoration.createDecoration(e,t.decoration,12,c?3:1,a,0,"down",2,t.positioning,this.hasVocals,this.accentAbove),c&&(i+=4,n=new pe(null,i,4,2,{type:"bar",pitch2:10,linewidth:4}),a.addRight(n),i+=5),this.partstartelem&&t.endEnding&&(this.partstartelem.anchor2=n,this.partstartelem=null),f&&(i+=3,n=new pe(null,i,1,2,{type:"bar",pitch2:10,linewidth:.6}),a.addRight(n)),u&&(i+=3,a.addRight(new pe("dots.dot",i,1,7)),a.addRight(new pe("dots.dot",i,1,5))),t.startEnding&&r&&e.voicenumber===0){var h=this.getTextSize.calc(t.startEnding,"repeatfont","").width;a.minspacing+=h+10,this.partstartelem=new xi(t.startEnding,n,null),e.addOther(this.partstartelem)}return a.extraw-=5,t.chord!==void 0&&ki(this.getTextSize,a,t,0,0,0,!1,this.germanAlphabet),a};var yl=ve,Ee="http://www.w3.org/2000/svg";function ne(e){this.svg=Jr(),this.currentGroup=[],e.appendChild(this.svg)}ne.prototype.clear=function(){if(this.svg){var e=this.svg.parentNode;this.svg=Jr(),this.currentGroup=[],e&&(e.innerHTML="",e.appendChild(this.svg))}};ne.prototype.setTitle=function(e){var t=document.createElement("title"),r=document.createTextNode(e);t.appendChild(r),this.svg.insertBefore(t,this.svg.firstChild)};ne.prototype.setResponsiveWidth=function(e,t){if(this.svg.setAttribute("viewBox","0 0 "+e+" "+t),this.svg.setAttribute("preserveAspectRatio","xMinYMin meet"),this.svg.removeAttribute("height"),this.svg.removeAttribute("width"),this.svg.style.display="inline-block",this.svg.style.position="absolute",this.svg.style.top="0",this.svg.style.left="0",this.svg.parentNode){var r=this.svg.parentNode.getAttribute("class");r?r.indexOf("abcjs-container")<0&&this.svg.parentNode.setAttribute("class",r+" abcjs-container"):this.svg.parentNode.setAttribute("class","abcjs-container"),this.svg.parentNode.style.display="inline-block",this.svg.parentNode.style.position="relative",this.svg.parentNode.style.width="100%";var a=t/e*100;this.svg.parentNode.style["padding-bottom"]=a+"%",this.svg.parentNode.style["vertical-align"]="middle",this.svg.parentNode.style.overflow="hidden"}};ne.prototype.setSize=function(e,t){this.svg.setAttribute("width",e),this.svg.setAttribute("height",t)};ne.prototype.setAttribute=function(e,t){this.svg.setAttribute(e,t)};ne.prototype.setScale=function(e){e!==1?(this.svg.style.transform="scale("+e+","+e+")",this.svg.style["-ms-transform"]="scale("+e+","+e+")",this.svg.style["-webkit-transform"]="scale("+e+","+e+")",this.svg.style["transform-origin"]="0 0",this.svg.style["-ms-transform-origin-x"]="0",this.svg.style["-ms-transform-origin-y"]="0",this.svg.style["-webkit-transform-origin-x"]="0",this.svg.style["-webkit-transform-origin-y"]="0"):(this.svg.style.transform="",this.svg.style["-ms-transform"]="",this.svg.style["-webkit-transform"]="")};ne.prototype.insertStyles=function(e){var t=document.createElementNS(Ee,"style");t.textContent=e,this.svg.insertBefore(t,this.svg.firstChild)};ne.prototype.setParentStyles=function(e){for(var t in e)e.hasOwnProperty(t)&&this.svg.parentNode&&(this.svg.parentNode.style[t]=e[t]);if(this.dummySvg){var r=document.querySelector("body");r.removeChild(this.dummySvg),this.dummySvg=null}};function an(e,t,r){var a=r-e;return"M "+e+" "+t+" l "+a+" 0 l 0 1 l "+-a+" 0 z "}function nn(e,t,r){var a=r-t;return"M "+e+" "+t+" l 0 "+a+" l 1 0 l 0 "+-a+" z "}ne.prototype.rect=function(e){var t=[],r=e.x,a=e.y,n=e.x+e.width,i=e.y+e.height;return t.push(an(r,a,n)),t.push(an(r,i,n)),t.push(nn(n,a,i)),t.push(nn(r,i,a)),this.path({path:t.join(" "),stroke:"none","data-name":e["data-name"]})};ne.prototype.dottedLine=function(e){var t=document.createElementNS(Ee,"line");t.setAttribute("x1",e.x1),t.setAttribute("x2",e.x2),t.setAttribute("y1",e.y1),t.setAttribute("y2",e.y2),t.setAttribute("stroke",e.stroke),t.setAttribute("stroke-dasharray","5,5"),this.svg.insertBefore(t,this.svg.firstChild)};ne.prototype.rectBeneath=function(e){var t=document.createElementNS(Ee,"rect");t.setAttribute("x",e.x),t.setAttribute("width",e.width),t.setAttribute("y",e.y),t.setAttribute("height",e.height),e.stroke&&t.setAttribute("stroke",e.stroke),e["stroke-opacity"]&&t.setAttribute("stroke-opacity",e["stroke-opacity"]),e.fill&&t.setAttribute("fill",e.fill),e["fill-opacity"]&&t.setAttribute("fill-opacity",e["fill-opacity"]),this.svg.insertBefore(t,this.svg.firstChild)};ne.prototype.text=function(e,t,r,a){var n=document.createElementNS(Ee,"text");n.setAttribute("stroke","none");for(var i in t)t.hasOwnProperty(i)&&n.setAttribute(i,t[i]);for(var s=t["data-name"]=="free-text",o=(""+e).split(`
32
- `),c=0;c<o.length;c++)if(!(s&&o[c]=="")){var f=document.createElementNS(Ee,"tspan");if(a)for(var u in a)a.hasOwnProperty(u)&&f.setAttribute(u,a[u]);if(f.setAttribute("x",t.x?t.x:0),c!==0&&f.setAttribute("dy","1.2em"),o[c].indexOf("")!==-1){var l=o[c].split("");if(f.textContent=l[0],l[1]){var h=document.createElementNS(Ee,"tspan");h.setAttribute("dy","-0.3em"),h.setAttribute("style","font-size:0.7em"),h.textContent=l[1],f.appendChild(h)}if(l[2]){var d=l[1]?"0.4em":"0.1em",p=document.createElementNS(Ee,"tspan");p.setAttribute("dy",d),p.setAttribute("style","font-size:0.7em"),p.textContent=l[2],f.appendChild(p)}}else s&&o[c].trim()==""?f.innerHTML="&nbsp;":f.textContent=o[c];n.appendChild(f)}return r?r.appendChild(n):this.append(n),n};ne.prototype.richTextLine=function(e,t,r,a,n,i){var s=document.createElementNS(Ee,"text");s.setAttribute("stroke","none"),s.setAttribute("class",a),s.setAttribute("x",t),s.setAttribute("y",r),s.setAttribute("text-anchor",n),s.setAttribute("dominant-baseline","middle");for(var o=0;o<e.length;o++){for(var c=e[o],f=document.createElementNS(Ee,"tspan"),u=Object.keys(c.attrs),l=0;l<u.length;l++){var h=c.attrs[u[l]];h!==""&&f.setAttribute(u[l],h)}f.textContent=c.content,s.appendChild(f)}return i?i.appendChild(s):this.append(s),s};ne.prototype.guessWidth=function(e,t){var r=this.createDummySvg(),a=this.text(e,t,r),n;try{n=a.getBBox(),isNaN(n.height)||!n.height?n={width:t["font-size"]/2,height:t["font-size"]+2}:n={width:n.width,height:n.height}}catch{n={width:t["font-size"]/2,height:t["font-size"]+2}}return r.removeChild(a),n};ne.prototype.createDummySvg=function(){if(!this.dummySvg){this.dummySvg=Jr();var e=["display: block !important;","height: 1px;","width: 1px;","position: absolute;"];this.dummySvg.setAttribute("style",e.join(""));var t=document.querySelector("body");t.appendChild(this.dummySvg)}return this.dummySvg};var mr={};ne.prototype.getTextSize=function(e,t,r){if(typeof e=="number"&&(e=""+e),!e||e.match(/^\s+$/))return{width:0,height:0};var a;if(e.length<20&&(a=e+JSON.stringify(t),mr[a]))return mr[a];var n=!r;r||(r=this.text(e,t));var i;try{i=r.getBBox(),isNaN(i.height)||!i.height?i=this.guessWidth(e,t):i={width:i.width,height:i.height}}catch{i=this.guessWidth(e,t)}return n&&(this.currentGroup.length>0?this.currentGroup[0].removeChild(r):this.svg.removeChild(r)),a&&(mr[a]=i),i};ne.prototype.openGroup=function(e){e=e||{};var t=document.createElementNS(Ee,"g");return e.klass&&t.setAttribute("class",e.klass),e.fill&&t.setAttribute("fill",e.fill),e.stroke&&t.setAttribute("stroke",e.stroke),e["data-name"]&&t.setAttribute("data-name",e["data-name"]),e.prepend?this.prepend(t):this.append(t),this.currentGroup.unshift(t),t};ne.prototype.closeGroup=function(){var e=this.currentGroup.shift();return e&&e.children.length===0?(e.parentElement.removeChild(e),null):e};ne.prototype.path=function(e){var t=document.createElementNS(Ee,"path");for(var r in e)e.hasOwnProperty(r)&&(r==="path"?t.setAttributeNS(null,"d",e.path):r==="klass"?t.setAttributeNS(null,"class",e[r]):e[r]!==void 0&&t.setAttributeNS(null,r,e[r]));return this.append(t),t};ne.prototype.pathToBack=function(e){var t=document.createElementNS(Ee,"path");for(var r in e)e.hasOwnProperty(r)&&(r==="path"?t.setAttributeNS(null,"d",e.path):r==="klass"?t.setAttributeNS(null,"class",e[r]):t.setAttributeNS(null,r,e[r]));return this.prepend(t),t};ne.prototype.lineToBack=function(e){for(var t=document.createElementNS(Ee,"line"),r=Object.keys(e),a=0;a<r.length;a++)t.setAttribute(r[a],e[r[a]]);return this.prepend(t),t};ne.prototype.append=function(e){this.currentGroup.length>0?this.currentGroup[0].appendChild(e):this.svg.appendChild(e)};ne.prototype.prepend=function(e){this.currentGroup.length>0?this.currentGroup[0].appendChild(e):this.svg.insertBefore(e,this.svg.firstChild)};ne.prototype.setAttributeOnElement=function(e,t){for(var r in t)t.hasOwnProperty(r)&&e.setAttributeNS(null,r,t[r])};ne.prototype.moveElementToChild=function(e,t){e.appendChild(t)};function Jr(){var e=document.createElementNS(Ee,"svg");return e.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),e.setAttribute("role","img"),e.setAttribute("fill","currentColor"),e.setAttribute("stroke","currentColor"),e}var wl=ne,Zr=Se,xl=wl,De=function(e){this.paper=new xl(e),this.controller=null,this.space=3*Zr.SPACE,this.padding={},this.reset(),this.firefox112=navigator.userAgent.indexOf("Firefox/112.0")>=0};De.prototype.reset=function(){this.paper.clear(),this.y=0,this.abctune=null,this.path=null,this.isPrint=!1,this.lineThickness=0,this.initVerticalSpace()};De.prototype.newTune=function(e){this.abctune=e,this.setVerticalSpace(e.formatting),this.isPrint=e.media==="print",this.setPadding(e)};De.prototype.setLineThickness=function(e){this.lineThickness=e};De.prototype.setPaddingOverride=function(e){this.paddingOverride={top:e.paddingtop,bottom:e.paddingbottom,right:e.paddingright,left:e.paddingleft}};De.prototype.setPadding=function(e){function t(r,a,n,i,s){e.formatting[n]!==void 0?r.padding[a]=e.formatting[n]:r.paddingOverride[a]!==void 0?r.padding[a]=r.paddingOverride[a]:r.isPrint?r.padding[a]=i:r.padding[a]=s}t(this,"top","topmargin",38,15),t(this,"bottom","botmargin",38,15),t(this,"left","leftmargin",68,15),t(this,"right","rightmargin",68,15)};De.prototype.adjustNonScaledItems=function(e){this.padding.top/=e,this.padding.bottom/=e,this.padding.left/=e,this.padding.right/=e,this.abctune.formatting.headerfont.size/=e,this.abctune.formatting.footerfont.size/=e};De.prototype.initVerticalSpace=function(){this.spacing={composer:7.56,graceBefore:8.67,graceInside:10.67,graceAfter:16,info:0,lineSkipFactor:1.1,music:7.56,paragraphSkipFactor:.4,parts:11.33,slurHeight:1,staffSeparation:61.33,staffTopMargin:0,stemHeight:26.67+10,subtitle:3.78,systemStaffSeparation:48,text:18.9,title:7.56,top:30.24,vocal:0,words:0}};De.prototype.setVerticalSpace=function(e){e.staffsep!==void 0&&(this.spacing.staffSeparation=e.staffsep*4/3),e.composerspace!==void 0&&(this.spacing.composer=e.composerspace*4/3),e.partsspace!==void 0&&(this.spacing.parts=e.partsspace*4/3),e.textspace!==void 0&&(this.spacing.text=e.textspace*4/3),e.musicspace!==void 0&&(this.spacing.music=e.musicspace*4/3),e.titlespace!==void 0&&(this.spacing.title=e.titlespace*4/3),e.sysstaffsep!==void 0&&(this.spacing.systemStaffSeparation=e.sysstaffsep*4/3),e.stafftopmargin!==void 0&&(this.spacing.staffTopMargin=e.stafftopmargin*4/3),e.subtitlespace!==void 0&&(this.spacing.subtitle=e.subtitlespace*4/3),e.topspace!==void 0&&(this.spacing.top=e.topspace*4/3),e.vocalspace!==void 0&&(this.spacing.vocal=e.vocalspace*4/3),e.wordsspace!==void 0&&(this.spacing.words=e.wordsspace*4/3)};De.prototype.calcY=function(e){return this.y-e*Zr.STEP};De.prototype.yToPitch=function(e){return e/Zr.STEP};De.prototype.moveY=function(e,t){t===void 0&&(t=1),this.y+=e*t};De.prototype.absolutemoveY=function(e){this.y=e};var Cl=De;function kl(e,t,r,a,n,i){var s=e.text;this.rows=[];var o;t&&this.rows.push({move:t});var c=r.calc("textfont","defined-text");if(s==="")this.rows.push({move:c.attr["font-size"]*2});else if(typeof s=="string"){let g=function(v){return v.replace(/^[ \t]*\n/gm,`X
33
- `)};this.rows.push({move:c.attr["font-size"]/2}),this.rows.push({left:a,text:s,font:"textfont",klass:"defined-text",anchor:"start",startChar:e.startChar,endChar:e.endChar,absElemType:"freeText",name:"free-text"});var f=g(s);o=i.calc(f,"textfont","defined-text"),this.rows.push({move:o.height})}else if(s){for(var u=0,l=a,h="textfont",d=0;d<s.length;d++)s[d].font?h=s[d].font:h="textfont",this.rows.push({left:l,text:s[d].text,font:h,klass:"defined-text",anchor:"start",startChar:e.startChar,endChar:e.endChar,absElemType:"freeText",name:"free-text"}),o=i.calc(s[d].text,r.calc(h,"defined-text").font,"defined-text"),l+=o.width+o.height/2,u=Math.max(u,o.height);this.rows.push({move:u})}else if(e.length===1){var p=n/2;this.rows.push({left:p,text:e[0].text,font:"textfont",klass:"defined-text",anchor:"middle",startChar:e.startChar,endChar:e.endChar,absElemType:"freeText",name:"free-text"}),o=i.calc(e[0].text,"textfont","defined-text"),this.rows.push({move:o.height})}}var _l=kl;function Tl(e,t,r){this.rows=[],e&&this.rows.push({move:e}),this.rows.push({separator:t,absElemType:"separator"}),r&&this.rows.push({move:r})}var El=Tl;function Sl(e,t,r,a,n,i){this.rows=[],e&&this.rows.push({move:e});var s=t.titleleft?"start":"middle",o=t.titleleft?n:a;this.rows.push({left:o,text:r.text,font:"subtitlefont",klass:"text subtitle",anchor:s,startChar:r.startChar,endChar:r.endChar,absElemType:"subtitle",name:"subtitle"});var c=i.calc(r.text,"subtitlefont","text subtitle");this.rows.push({move:c.height})}var Ml=Sl;function Al(e,t,r){if(t.text){t.marginLeft||(t.marginLeft=0),t.klass||(t.klass=""),t.anchor||(t.anchor="start"),t.info||(t.info={startChar:-2,endChar:-2}),t.marginTop&&e.push({move:t.marginTop});var a={left:t.marginLeft,text:t.text,font:t.font,anchor:t.anchor,startChar:t.info.startChar,endChar:t.info.endChar,"dominant-baseline":t["dominant-baseline"]};t.absElemType&&(a.absElemType=t.absElemType),!t.inGroup&&t.klass&&(a.klass=t.klass),t.name&&(a.name=t.name),e.push(a);var n=r.calc("A",t.font,t.klass),i=t.text.split(`
23
+ `));u.id=l0.strip(d)}),{header:f,tunes:s}},oo=co;function Ur(e,t){this.numLines=e,this.lineSpace=t,this.verticalSize=this.numLines*this.lineSpace;var r=3;this.bar={pitch:r,pitch2:t*e,height:5}}Ur.prototype.bypass=function(e){var t=e.staffGroup.voices;return!!(t.length>0&&t[0].isPercussion)};Ur.prototype.setRelative=function(e,t,r){switch(e.type){case"bar":t.pitch=this.bar.pitch,t.pitch2=this.bar.pitch2,t.height=this.height;break;case"symbol":var a=this.bar.pitch2/2;if(e.name=="dots.dot")return r?(t.pitch=a,!1):(t.pitch=a+this.lineSpace,!0);break}return r};var lo=Ur,bt=function(t,r){this.children=[],this.beams=[],this.otherchildren=[],this.w=0,this.duplicate=!1,this.voicenumber=t,this.voicetotal=r,this.bottom=7,this.top=7,this.specialY={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}};bt.prototype.addChild=function(e){if(e.type==="bar"){for(var t=!0,r=0;t&&r<this.children.length;r++)this.children[r].type.indexOf("staff-extra")<0&&this.children[r].type!=="tempo"&&(t=!1);t||(this.beams.push("bar"),this.otherchildren.push("bar"))}this.children[this.children.length]=e,this.setRange(e)};bt.prototype.setLimit=function(e,t){var r=t.specialY;r||(r=t),r[e]&&(this.specialY[e]?this.specialY[e]=Math.max(this.specialY[e],r[e]):this.specialY[e]=r[e])};bt.prototype.adjustRange=function(e){e.bottom!==void 0&&(this.bottom=Math.min(this.bottom,e.bottom)),e.top!==void 0&&(this.top=Math.max(this.top,e.top))};bt.prototype.setRange=function(e){this.adjustRange(e),this.setLimit("tempoHeightAbove",e),this.setLimit("partHeightAbove",e),this.setLimit("volumeHeightAbove",e),this.setLimit("dynamicHeightAbove",e),this.setLimit("endingHeightAbove",e),this.setLimit("chordHeightAbove",e),this.setLimit("lyricHeightAbove",e),this.setLimit("lyricHeightBelow",e),this.setLimit("chordHeightBelow",e),this.setLimit("volumeHeightBelow",e),this.setLimit("dynamicHeightBelow",e)};bt.prototype.addOther=function(e){this.otherchildren.push(e),this.setRange(e)};bt.prototype.addBeam=function(e){this.beams.push(e)};bt.prototype.setWidth=function(e){this.w=e};var an=bt,ho=function(e,t,r,a){if(e)for(var i=0;i<e.length;i++){var n=e[i],s=n.getAttribute("highlight");s||(s="fill"),n.setAttribute(s,a);var c=n.getAttribute("class");c||(c=""),c=c.replace(r,""),c=c.replace(t,""),t.length>0&&(c.length>0&&c[c.length-1]!==" "&&(c+=" "),c+=t),n.setAttribute("class",c)}},Vr=ho,fo=Vr,uo=function(e,t){e===void 0&&(e="abcjs-note_selected"),t===void 0&&(t="#ff0000"),fo(this.elemset,e,"",t)},nn=uo,po=Vr,vo=function(e,t){e===void 0&&(e="abcjs-note_selected"),t===void 0&&(t="#000000"),po(this.elemset,"",e,t)},sn=vo,go=nn,bo=sn,we=function(t,r,a,i,n,s){s||(s={}),this.tuneNumber=n,this.abcelem=t,this.duration=r,this.durationClass=s.durationClassOveride?s.durationClassOveride:this.duration,this.minspacing=a||0,this.x=0,this.children=[],this.heads=[],this.extra=[],this.extraw=0,this.w=0,this.right=[],this.invisible=!1,this.bottom=void 0,this.top=void 0,this.type=i,this.fixed={w:0,t:void 0,b:void 0},this.specialY={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}};we.prototype.getFixedCoords=function(){return{x:this.x,w:this.fixed.w,t:this.fixed.t,b:this.fixed.b}};we.prototype.addExtra=function(e){this.fixed.w=Math.max(this.fixed.w,e.dx+e.w),this.fixed.t===void 0?this.fixed.t=e.top:this.fixed.t=Math.max(this.fixed.t,e.top),this.fixed.b===void 0?this.fixed.b=e.bottom:this.fixed.b=Math.min(this.fixed.b,e.bottom),e.dx<this.extraw&&(this.extraw=e.dx),this.extra[this.extra.length]=e,this._addChild(e)};we.prototype.addHead=function(e){e.dx<this.extraw&&(this.extraw=e.dx),this.heads[this.heads.length]=e,this.addRight(e)};we.prototype.addRight=function(e){this.fixed.w=Math.max(this.fixed.w,e.dx+e.w),e.top!==void 0&&(this.fixed.t===void 0?this.fixed.t=e.top:this.fixed.t=Math.max(this.fixed.t,e.top)),e.bottom!==void 0&&(this.fixed.b===void 0?this.fixed.b=e.bottom:this.fixed.b=Math.min(this.fixed.b,e.bottom)),e.dx+e.w>this.w&&(this.w=e.dx+e.w),this.right[this.right.length]=e,this._addChild(e)};we.prototype.addFixed=function(e){this._addChild(e)};we.prototype.addFixedX=function(e){this._addChild(e)};we.prototype.addCentered=function(e){var t=e.w/2;-t<this.extraw&&(this.extraw=-t),this.extra[this.extra.length]=e,e.dx+t>this.w&&(this.w=e.dx+t),this.right[this.right.length]=e,this._addChild(e)};we.prototype.setLimit=function(e,t){t[e]&&(this.specialY[e]?this.specialY[e]=Math.max(this.specialY[e],t[e]):this.specialY[e]=t[e])};we.prototype._addChild=function(e){var t=!0;this.abcelem.el_type=="clef"&&e.type=="barNumber"&&(t=!1),e.parent=this,this.children[this.children.length]=e,t&&this.pushTop(e.top),this.pushBottom(e.bottom),this.setLimit("tempoHeightAbove",e),this.setLimit("partHeightAbove",e),this.setLimit("volumeHeightAbove",e),this.setLimit("dynamicHeightAbove",e),this.setLimit("endingHeightAbove",e),this.setLimit("chordHeightAbove",e),this.setLimit("lyricHeightAbove",e),this.setLimit("lyricHeightBelow",e),this.setLimit("chordHeightBelow",e),this.setLimit("volumeHeightBelow",e),this.setLimit("dynamicHeightBelow",e)};we.prototype.pushTop=function(e){e!==void 0&&(this.top===void 0?this.top=e:this.top=Math.max(e,this.top))};we.prototype.pushBottom=function(e){e!==void 0&&(this.bottom===void 0?this.bottom=e:this.bottom=Math.min(e,this.bottom))};we.prototype.setX=function(e){this.x=e;for(var t=0;t<this.children.length;t++)this.children[t].setX(e)};we.prototype.center=function(e,t){var r=(t.x-e.x)/2+e.x;this.x=r-this.w/2;for(var a=0;a<this.children.length;a++)this.children[a].setX(this.x)};we.prototype.setHint=function(){this.hint=!0};we.prototype.highlight=function(e,t){go.bind(this)(e,t)};we.prototype.unhighlight=function(e,t){bo.bind(this)(e,t)};var Qt=we,Jt=function(t,r,a,i,n){switch(n=n||{},this.x=0,this.c=t,this.dx=r,this.w=a,this.pitch=i,this.scalex=n.scalex||1,this.scaley=n.scaley||1,this.type=n.type||"symbol",this.pitch2=n.pitch2,this.linewidth=n.linewidth,this.klass=n.klass,this.anchor=n.anchor?n.anchor:"middle",this.top=i,this.pitch2!==void 0&&this.pitch2>this.top&&(this.top=this.pitch2),this.bottom=i,this.pitch2!==void 0&&this.pitch2<this.bottom&&(this.bottom=this.pitch2),n.thickness&&(this.top+=n.thickness/2,this.bottom-=n.thickness/2),n.stemHeight&&(n.stemHeight>0?this.top+=n.stemHeight:this.bottom+=n.stemHeight),n.dim&&(this.dim=n.dim),n.position&&(this.position=n.position),this.height=n.height?n.height:4,n.top&&(this.top=n.top),n.bottom&&(this.bottom=n.bottom),n.name?this.name=n.name:this.c?this.name=this.c:this.name=this.type,n.realWidth?this.realWidth=n.realWidth:this.realWidth=this.w,this.centerVertically=!1,this.type){case"debug":this.chordHeightAbove=this.height;break;case"lyric":n.position&&n.position==="below"?this.lyricHeightBelow=this.height:this.lyricHeightAbove=this.height;break;case"chord":n.position&&n.position==="below"?this.chordHeightBelow=this.height:this.chordHeightAbove=this.height;break;case"text":this.pitch===void 0?n.position&&n.position==="below"?this.chordHeightBelow=this.height:this.chordHeightAbove=this.height:this.centerVertically=!0;break;case"part":this.partHeightAbove=this.height;break}};Jt.prototype.getChordDim=function(){if(this.type==="debug"||!this.chordHeightAbove&&!this.chordHeightBelow)return null;var e=0,t=this.type==="chord"?this.realWidth/2:0,r=this.x-t-e,a=r+this.realWidth+e;return{left:r,right:a}};Jt.prototype.invertLane=function(e){this.lane===void 0&&(this.lane=0),this.lane=e-this.lane-1};Jt.prototype.putChordInLane=function(e){this.lane=e,this.chordHeightAbove?this.chordHeightAbove=this.height*1.25*this.lane:this.chordHeightBelow=this.height*1.25*this.lane};Jt.prototype.getLane=function(){return this.lane===void 0?0:this.lane};Jt.prototype.setX=function(e){this.x=e+this.dx};var at=Jt,cn=Qt,jr=at;function mo(e){return e!=null&&e.constructor===Object}function Nr(e,t){for(var r in t)t.hasOwnProperty(r)&&(Array.isArray(t[r])||mo(t[r])||(e[r]=t[r]))}function on(e){var t=new cn("",0,0,"",0);return Nr(t,e),t.top=0,t.bottom=-1,e.abcelem&&(t.abcelem={},Nr(t.abcelem,e.abcelem),t.abcelem.el_type==="note"&&(t.abcelem.el_type="tabNumber")),e.cloned=t,t}function yo(e,t){var r=on(e);if(t)for(var a=e.children,i=!0,n=0;n<a.length;n++){var s=a[n],c=new jr("",0,0,0,"");Nr(c,s),i=t.tablature.setRelative(s,c,i),r.children.push(c)}return r}function wo(e,t,r){var a="tab.tiny",i=7.5;e.isTabBig&&(a="tab.big",i=10);var n={el_type:"tab",icon:a,Ypos:i};if(i+=e.tabSymbolOffset,!e.hideTabSymbol){var s=new cn(n,0,0,"symbol",0);s.x=t;var c=new jr(a,0,0,7.5,"tab");c.x=r,s.children.push(c),s.abcelem.el_type=="tab"&&(c.pitch=i)}return s}function xo(e){if(e.extra)for(var t=0;t<e.extra.length;t++){var r=e.extra[t];if(r.type=="lyric")return{bottom:r.bottom,height:r.height}}return null}function ln(){this.accidentals=null}function Co(e){for(var t=0,r=0;r<e.length;r++)e[r].tabNameInfos||t++;return t}function Lr(e,t,r,a,i){var n=a.num;a.note.quarter!=null&&(n=n.toString(),n+=a.note.quarter);var s=e.semantics.stringToPitch(a.str);r.notes.push({num:n,str:a.str,pitch:a.note.emit()});var c={type:"tabNumber"},o=new jr(n,0,0,s+.3,c);return o.x=t,o.isGrace=i,o.isAltered=a.note.isAltered,o}function hn(e,t){var r=0;if(e.extra){for(var a=0;a<e.extra.length;a++)if(e.extra[a].c.indexOf("noteheads")>=0){if(r===t)return e.extra[a].x+e.extra[a].w/2;r++}}return-1}function ko(e){if(e.abcelem){var t=e.abcelem;if(t.rest)return t.gracenotes}return null}function Ga(e,t,r){var a=e.semantics.notesToNumber(t,r);if(a.error)return e.setError(a.error),a;if(a.graces&&a.notes){var i=a.notes.length-1;a.notes[i].graces=a.graces}return a}function _o(e,t,r,a,i){for(var n=0;n<a.length;n++){var s={el_type:"note",startChar:r.abcelem.startChar,endChar:r.abcelem.endChar,notes:[],grace:!0},c=hn(r,n),o=a[n],f=Lr(e,c,s,o,!0);t.children.push(f),i.push(s)}}ln.prototype.build=function(e,t,r,a,i,n,s){Co(t);var c=t[i+a],o=t[s],f=null,u=null;c.children[0].abcelem.el_type!="clef"&&n!="none"&&c.children.splice(0,0,n);for(var l=0;l<c.children.length;l++){var h=c.children[l],d=h.x,p=d;switch(h.isClef&&(o.children.push(wo(e,d,p)),h.abcelem.type.indexOf("-8")>=0&&(e.semantics.clefTranspose=-12),h.abcelem.type.indexOf("+8")>=0&&(e.semantics.clefTranspose=12)),h.type){case"staff-extra key-signature":this.accidentals=h.abcelem.accidentals,e.semantics.accidentals=this.accidentals;break;case"bar":e.semantics.measureAccidentals={};var g=!1;l===c.children.length-1&&(g=!0);var v=yo(h,e);if(v.abcelem.barNumber){delete v.abcelem.barNumber;for(var m=0;m<v.children.length;m++)if(v.children[m].type==="barNumber"){v.children.splice(m,1);break}}v.abcelem.lastBar=g,o.children.push(v),r.push({el_type:h.abcelem.el_type,type:h.abcelem.type,endChar:h.abcelem.endChar,startChar:h.abcelem.startChar,abselem:v});break;case"rest":var y=ko(h);if(y){if(f=Ga(e,null,y),f.error)return;z={el_type:"note",startChar:h.abcelem.startChar,endChar:h.abcelem.endChar,notes:[],grace:!0},_o(e,x,h,f.graces,r)}break;case"note":var x=on(h);x.x=h.heads[0].x+h.heads[0].w/2,x.lyricDim=xo(h);var b=h.abcelem.pitches,w=h.abcelem.gracenotes;if(x.type="tabNumber",f=Ga(e,b,w),f.error)return;if(f.graces){var C=f.notes.length-1;f.notes[C].graces=f.graces}u={el_type:"note",startChar:h.abcelem.startChar,endChar:h.abcelem.endChar,notes:[]};for(var T=0;T<f.notes.length;T++){var B=f.notes[T];if(B.graces)for(var E=0;E<B.graces.length;E++){var z={el_type:"note",startChar:h.abcelem.startChar,endChar:h.abcelem.endChar,notes:[],grace:!0},I=hn(h,E),F=B.graces[E],G=Lr(e,I,z,F,!0);x.children.push(G),r.push(z)}var Y=Lr(e,x.x+h.heads[T].dx,u,B,!1);x.children.push(Y)}u.notes.length>0&&(u.abselem=x,r.push(u),o.children.push(x));break}}};var To=ln,Eo=an,So=To,Mo=Se;function Ao(){return{tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}}function Bo(e){for(var t=0,r=0;r<e.children.length;r++){var a=e.children[r];a.specialY&&a.specialY.lyricHeightBelow>t&&(t=a.specialY.lyricHeightBelow)}return t}function No(e,t,r){var a=e.semantics,i=t.controller.getTextSize,n=a.tabInfos(e),s=a.suppress(e),c=!0;if(s&&(c=!1),c){var o=i.calc(n,"tablabelfont","text instrumentname");return r.tabNameInfos={textSize:{height:o.height,width:o.width},name:n},o.height}return 0}function Lo(e,t){return t[e].isTabStaff?e===t.length-1?!0:!t[e+1].isTabStaff:!1}function Po(e){for(var t=0,r=0;r<e.length;r++)e[r].isTabStaff||t++;return t}function Do(e,t){for(var r=t;r>=0;r--)if(!e[r].isTabStaff)return r;return-1}function Io(e){for(var t=0;t<e.length;t++)if(e[t].isTabStaff){var r=Do(e,t);e[t].hasStaff=e[r],e[r].hasTab||(e[r].hasTab=[]),e[r].hasTab.push(e[t])}}function Fo(e,t){return Po(e)===1&&t.voices.length>1}function Oo(e,t){for(var r=0,a=0,i=!0,n=0;i;){if(!t[r])return-1;if(t[r].isTabStaff||(n=t[r].voices.length),t[r].isTabStaff){if(a++,Lo(r,t)&&a<n)return r+1}else if(a=0,r>=e&&(r+1==t.length||!t[r+1].isTabStaff))return r+1;if(r++,r>t.length)return-1}}function Ho(e,t){for(var r=t;r>=0;r--)if(!e[r].isTabStaff)return e[r];return null}function zo(e,t){var r=e[t],a=r.children[0].abcelem;return a.el_type==="clef"?null:t==0?"none":e[t-1].children[0]}function $o(e,t,r,a){var i=new So,n={clef:{type:"TAB"}},s=e.linePitch*e.nbLines,c=r.staff;if(c){var o=c[0];if(o&&o.clef&&o.clef.stafflines==0){e.setError("No tablatures when stafflines=0");return}c.splice(c.length,0,n)}var f=r.staffGroup,u=f.voices,l=u[0],h=Bo(l),d=3,p=a,g=f.staffs[p],v=s+d-g.bottom-h;g.isTabStaff&&(v=g.top);var m={bottom:-1,isTabStaff:!0,specialY:Ao(),lines:e.nbLines,linePitch:e.linePitch,dy:.15,top:v},y=Oo(a,f.staffs);if(y!==-1){m.parentIndex=y-1,f.staffs.splice(y,0,m),f.height+=s+d;var x=Ho(f.staffs,y),b=1;Fo(f.staffs,x)&&(b=x.voices.length),n.voices=[];for(var w=0;w<b;w++){var C=new Eo(0,0);w>0&&(C.duplicate=!0);var T=No(e,t,C)/Mo.STEP;T=Math.max(T,1),f.staffs[a].top+=1,f.height+=T,C.staff=m;var B=u.length;u.splice(u.length,0,C);var E=zo(u,w+a);n.voices[w]=[],i.build(e,u,n.voices[w],w,a,E,B)}Io(f.staffs)}}var Go=$o,Ro={__:-2,_:-1,"_/":-.5,"=":0,"":0,"^/":.5,"^":1,"^^":2},Pr=["C","-","D","-","E","F","-","G","-","A","-","B","c","-","d","-","e","f","-","g","-","a","-","b"];function Yo(e){var t=e.match(/([_^\/]*)([ABCDEFGabcdefg])(,*)('*)/);if(t&&t.length===5){var r=Ro[t[1]],a=Pr.indexOf(t[2]),i=t[4].length-t[3].length;return 48+a+r+i*12}return 0}function qo(e){e=parseInt(e,10);var t=Math.floor(e/12),r=e%12,a=Pr[r];if(a==="-"&&(a="^"+Pr[r-1]),t>4)for(a=a.toLowerCase(),t-=5;t>0;)a+="'",t--;else for(;t<4;)a+=",",t++;return a}var fn={noteToMidi:Yo,midiToNote:qo},{noteToMidi:Wo,midiToNote:Kr}=fn;function ze(e,t){var r=Wo(e);t&&(r+=t);var a=Kr(r),i=!1,n=!1,s=!1,c=null,o=null,f=!1,u=0;e.startsWith("_")?(i=!0,u=-1,e[1]=="/"?(i=!1,o="v",u=0):e[1]=="_"&&(f=!0,u-=1)):e.startsWith("^")?(n=!0,u=1,e[1]=="/"?(n=!1,o="^",u=0):e[1]=="^"&&(f=!0,u+=1)):e.startsWith("=")&&(c=!0,u=0),s=i||n||o!=null,(s||c)&&(o!=null||f?a=e.slice(2):a=e.slice(1));var l=(a.match(/,/g)||[]).length,h=(a.match(/'/g)||[]).length;this.pitch=r,this.pitchAltered=0,this.name=a,this.acc=u,this.isSharp=n,this.isKeySharp=!1,this.isDouble=f,this.isAltered=s,this.isFlat=i,this.isKeyFlat=!1,this.natural=c,this.quarter=o,this.isLower=this.name==this.name.toLowerCase(),this.name=this.name[0].toUpperCase(),this.hasComma=l,this.isQuoted=h}function Xo(e){var t=e.name,r=new ze(t);return r.pitch=e.pitch,r.hasComma=e.hasComma,r.isLower=e.isLower,r.isQuoted=e.isQuoted,r.isSharp=e.isSharp,r.isKeySharp=e.isKeySharp,r.isFlat=e.isFlat,r.isKeyFlat=e.isKeyFlat,r}ze.prototype.sameNoteAs=function(e){return e.pitch===this.pitch};ze.prototype.isLowerThan=function(e){return e.pitch>this.pitch};ze.prototype.checkKeyAccidentals=function(e,t){if(!(this.isAltered||this.natural)){if(t[this.name.toUpperCase()])switch(t[this.name.toUpperCase()]){case"__":this.acc=-2,this.pitchAltered=-2;return;case"_":this.acc=-1,this.pitchAltered=-1;return;case"=":this.acc=0,this.pitchAltered=0;return;case"^":this.acc=1,this.pitchAltered=1;return;case"^^":this.acc=2,this.pitchAltered=2;return}else if(e)for(var r=this.name,a=0;a<e.length;a++){var i=e[a];r==i.note.toUpperCase()&&(i.acc=="flat"&&(this.acc=-1,this.isKeyFlat=!0,this.pitchAltered=-1),i.acc=="sharp"&&(this.acc=1,this.isKeySharp=!0,this.pitchAltered=1))}}};ze.prototype.getAccidentalEquiv=function(){var e=Xo(this);return e.isSharp||e.isKeySharp?(e=e.nextNote(),e.isFlat=!0,e.isSharp=!1,e.isKeySharp=!1):(e.isFlat||e.isKeyFlat)&&(e=e.prevNote(),e.isSharp=!0,e.isFlat=!1,e.isKeyFlat=!1),e};ze.prototype.nextNote=function(){var e=Kr(this.pitch+1+this.pitchAltered);return new ze(e)};ze.prototype.prevNote=function(){var e=Kr(this.pitch-1+this.pitchAltered);return new ze(e)};ze.prototype.emitNoAccidentals=function(){var e=this.name;this.isLower&&(e=e.toLowerCase());for(var t=0;t<this.isQuoted;t++)e+="'";for(var r=0;r<this.hasComma;r++)e+=",";return e};ze.prototype.emit=function(){var e=this.name;(this.isSharp||this.isKeySharp)&&(e="^"+e,this.isDouble&&(e="^"+e)),(this.isFlat||this.isKeyFlat)&&(e="_"+e,this.isDouble&&(e="_"+e)),this.quarter&&(this.quarter=="^"?e="^/"+e:e="_/"+e),this.natural&&(e="="+e);for(var t=1;t<=this.hasComma;t++)e+=",";if(this.isLower){e=e.toLowerCase();for(var r=1;r<=this.isQuoted;r++)e+="'"}return e};var un=ze,Ra=un,Ya=["A","B","C","D","E","F","G"];function Uo(e,t){var r=new Ra(e),a=new Ra(t);if(a.isLowerThan(r)){var i=r.emit(),n=a.emit();return{error:"Invalid string Instrument tuning : "+n+" string lower than "+i+" string"}}var s=[],c=Ya.indexOf(r.name),o=Ya.indexOf(a.name);if(c==-1||o==-1)return s;for(var f=!1;!f;)s.push(r.emit()),r=r.nextNote(),r.sameNoteAs(a)&&(f=!0);return s}var Vo=Uo;const{noteToMidi:jo}=fn;var j0=un,Ko=Vo;function Qo(e){var t=null,r=e.tuning;if(e.capo>0){t=[];for(var a=0;a<r.length;a++){for(var i=new j0(r[a]),n=0;n<e.capo;n++)i=i.nextNote();t[a]=i.emit()}}return t}function Jo(e){var t=[],r=e.tuning;e.capo>0&&(r=e.capoTuning);for(var a=r.length-1,i=0;i<r.length;i++){var n=e.highestNote;i!=r.length-1&&(n=r[i+1]);var s=Ko(r[i],n);if(s.error)return s;t[a--]=s}return t}function Zo(e){var t=[];t[0]=[];for(var r=e.strings,a=1;a<r.length;a++)t[a]=r[a-1];return t}function e1(e,t){for(var r=0;r<t.length-1;r++){var a=t[r],i=t[r+1];if(a.str==i.str){if(a.str==e.strings.length-1){a.num="?",i.num="?";return}i.num<a.num?(i.str++,i=qa(e,i.note,i.str,e.secondPos,e.strings[i.str].length)):(a.str++,a=qa(e,a.note,a.str,e.secondPos,e.strings[a.str].length)),t[r]=a,t[r+1]=i}}return null}function t1(e,t){for(var r=[],a=0;a<t.length;a++)if(!t[a].endTie){var i=new j0(t[a].name,e.clefTranspose);i.checkKeyAccidentals(e.accidentals,e.measureAccidentals);var n=Dr(e,i);r.push(n)}return e1(e,r),r}function qa(e,t,r,a,i){var n=e.strings;t.checkKeyAccidentals(e.accidentals,e.measureAccidentals),a&&(n=a);var s=t.emitNoAccidentals(),c=n[r].indexOf(s),o=t.acc;if(c!=-1){if(a&&(c+=i),(t.isFlat||t.acc==-1)&&c==0){var f=t.getAccidentalEquiv();r++,c=n[r].indexOf(f.emit()),o=0}return{num:c+o,str:r,note:t}}return null}function Dr(e,t){if(t.isAltered||t.natural){var r;t.isFlat?t.isDouble?r="__":r="_":t.isSharp?t.isDouble?r="^^":r="^":t.natural&&(r="="),e.measureAccidentals[t.name.toUpperCase()]=r}for(var a=e.stringPitches.length-1;a>=0;a--)if(t.pitch+t.pitchAltered>=e.stringPitches[a]){var i=t.pitch+t.pitchAltered-e.stringPitches[a];return t.quarter==="^"?i-=.5:t.quarter==="v"&&(i+=.5),{num:Math.round(i),str:e.stringPitches.length-1-a,note:t}}return{num:"?",str:e.stringPitches.length-1,note:t}}Zt.prototype.stringToPitch=function(e){var t=5.3,r=this.strings.length-1;return t+(r-e)*this.linePitch};function Wa(e,t){var r={num:"?",str:0,note:t};e.push(r),e.error=t.emit()+": unexpected note for instrument"}Zt.prototype.notesToNumber=function(e,t){var r,a,i=null,n=null;if(e&&(n=[],e.length>1?(n=t1(this,e),n.error&&(i=n.error)):e[0].endTie||(r=new j0(e[0].name,this.clefTranspose),r.checkKeyAccidentals(this.accidentals,this.measureAccidentals),a=Dr(this,r),a?n.push(a):(Wa(n,r),i=n.error))),i)return n;var s=null;if(t){s=[];for(var c=0;c<t.length;c++)r=new j0(t[c].name,this.clefTranspose),r.checkKeyAccidentals(this.accidentals,this.measureAccidentals),a=Dr(this,r),a?s.push(a):(Wa(s,r),i=n.error)}return{notes:n,graces:s,error:i}};Zt.prototype.toString=function(){for(var e=[],t=0;t<this.tuning.length;t++){var r=this.tuning[t].replaceAll(",","").replaceAll("'","").toUpperCase();r[0]==="_"?r=r[1]+"b ":r[0]==="^"&&(r=r[1]+"# "),e.push(r)}return e.join("")};Zt.prototype.tabInfos=function(e){var t=e.params.label;if(t){var r=t.indexOf("%T"),a="";return r!=-1&&(a=this.toString(),e.capo>0&&(a+=" capo:"+e.capo),t=t.replace("%T",a)),t}return""};Zt.prototype.suppress=function(e){var t=e.params.suppress;return!!t};function Zt(e){var t=e.tuning,r=e.capo,a=e.params.highestNote;this.linePitch=e.linePitch,this.highestNote="a'",a&&(this.highestNote=a),this.measureAccidentals={},this.capo=0,r&&(this.capo=parseInt(r,10)),this.transpose=e.transpose?e.transpose:0,this.tuning=t,this.stringPitches=[];for(var i=0;i<this.tuning.length;i++){var n=jo(this.tuning[i])+this.capo;this.stringPitches.push(n)}if(this.capo>0&&(this.capoTuning=Qo(this)),this.strings=Jo(this),this.strings.error){e.setError(this.strings.error),e.inError=!0;return}this.secondPos=Zo(this)}var r1=Zt,a1=lo,i1=Go,n1=r1;er.prototype.init=function(e,t,r,a){this.tune=e,this.params=r,this.tuneNumber=t,this.inError=!1,this.abcTune=e,this.linePitch=3,this.nbLines=a.defaultTuning.length,this.isTabBig=a.isTabBig,this.tabSymbolOffset=a.tabSymbolOffset,this.capo=r.capo,this.transpose=r.visualTranspose,this.hideTabSymbol=r.hideTabSymbol,this.tablature=new a1(this.nbLines,this.linePitch);var i=r.tuning;i||(i=a.defaultTuning),this.tuning=i,this.semantics=new n1(this)};er.prototype.setError=function(e){e&&(this.error=e,this.inError=!0,this.tune.warnings?this.tune.warnings.push(e):this.tune.warnings=[e])};er.prototype.render=function(e,t,r){this.inError||this.tablature.bypass(t)||i1(this,e,t,r)};function er(){}var s1=function(){return{name:"StringTab",tablature:er}},c1=s1,o1=c1,l1={violin:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},fiddle:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},mandolin:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},guitar:{name:"StringTab",defaultTuning:["E,","A,","D","G","B","e"],isTabBig:!0,tabSymbolOffset:0},fiveString:{name:"StringTab",defaultTuning:["C,","G,","D","A","e"],isTabBig:!1,tabSymbolOffset:-.95}},h1={inited:!1,plugins:{},register:function(e){var t=e.name,r=e.tablature;this.plugins[t]=r},setError:function(e,t){e.warnings?e.warning.push(t):e.warnings=[t]},preparePlugins:function(e,t,r){this.inited||(this.register(new o1),this.inited=!0);var a=null;if(r.tablature){var i=r.tablature;a=[];for(var n=0;n<i.length;n++){var s=i[n],c=s.instrument;if(c==null)return this.setError(e,"tablature 'instrument' is missing"),a;var o=l1[c],f=null;if(o&&(f=this.plugins[o.name]),f){r.visualTranspose!=0&&(s.visualTranspose=r.visualTranspose),s.abcSrc=r.tablature.abcSrc;var u={classz:f,tuneNumber:t,params:s,instance:null,tabType:o};a.push(u)}else if(c==="")a.push(null);else return this.setError(e,"Undefined tablature plugin: "+c),a}}return a},layoutTablatures:function(t,r){var a=r.tablatures,i=0;if(a&&a.length>0)for(var n=a.length,s=0;s<n;++s)a[s]&&a[s].params.firstStaffOnly&&(a[s].params.suppress=!1);for(var c=0;c<r.lines.length;c++){var o=r.lines[c];if(o.staff&&i++,i>1&&a&&a.length>0)for(var n=a.length,s=0;s<n;++s)a[s].params.firstStaffOnly&&(a[s].params.suppress=!0);var f=o.staff;if(f){for(var u=f.length,l=0;l<f.length;l++)if(a[l]&&l<u){var h=a[l];h.instance==null&&(h.instance=new h.classz,h.instance.init(r,h.tuneNumber,h.params,h.tabType)),h.instance.render(t,o,l)}}}}},dn=h1,f1=rn,u1=oo,d1=dn,ot={};(function(){ot.numberOfTunes=function(t){var r=t.split(`
24
+ X:`),a=r.length;return a===0&&(a=1),a};var e=ot.TuneBook=function(t){var r=u1(t);this.header=r.header,this.tunes=r.tunes};e.prototype.getTuneById=function(t){for(var r=0;r<this.tunes.length;r++)if(this.tunes[r].id===""+t)return this.tunes[r];return null},e.prototype.getTuneByTitle=function(t){for(var r=0;r<this.tunes.length;r++)if(this.tunes[r].title===t)return this.tunes[r];return null},ot.parseOnly=function(t,r){for(var a=ot.numberOfTunes(t),i=[],n=0;n<a;n++)i.push(1);function s(){}return ot.renderEngine(s,i,t,r)},ot.renderEngine=function(t,r,a,i){var n=[],s=function(g){return g&&!g.propertyIsEnumerable("length")&&typeof g=="object"&&typeof g.length=="number"};if(!(r===void 0||a===void 0)){s(r)||(r=[r]),i===void 0&&(i={});for(var c=i.startingTune?parseInt(i.startingTune,10):0,o=new e(a),f=new f1,u=0;u<r.length;u++){var l=r[u];if(l==="*"||typeof l=="string"&&(l=document.getElementById(l)),l)if(c>=0&&c<o.tunes.length){f.parse(o.tunes[c].abc,i,o.tunes[c].startPos-o.header.length);var h=f.getTune();i.tablature&&(h.tablatures=d1.preparePlugins(h,c,i));var d=f.getWarnings();d&&(h.warnings=d);var p=t(l,h,u,o.tunes[c].abc);n.push(p||h)}else l.innerHTML&&(l.innerHTML="");c++}return n}},ot.extractMeasures=function(t){for(var r=[],a=new e(t),i=0;i<a.tunes.length;i++){for(var n=a.tunes[i],s=n.abc.split("K:"),c=s[1].split(`
25
+ `),o=s[0]+"K:"+c[0]+`
26
+ `,f=null,u=null,l=null,h=[],d=!1,p=ot.parseOnly(n.abc)[0],g=p.getPickupLength()>0,v=0;v<p.lines.length;v++){var m=p.lines[v];if(m.staff)for(var y=0;y<1;y++)for(var x=m.staff[y],b=0;b<1;b++)for(var w=x.voices[b],C=0;C<w.length;C++){var T=w[C];if(l===null&&T.startChar>=0&&(l=T.startChar,T.chord===void 0?u=f:u=null),T.chord&&(f=T),T.el_type==="bar"){if(d){var B=n.abc.substring(l,T.endChar),E={abc:B};f=u&&u.chord&&u.chord.length>0?u.chord[0].name:null,f&&(E.lastChord=f),T.startEnding&&(E.startEnding=T.startEnding),T.endEnding&&(E.endEnding=T.endEnding),h.push(E),l=null,d=!1}}else T.el_type==="note"&&(d=!0)}}r.push({header:o,measures:h,hasPickup:g})}return r}})();var tr=ot,Xa=qi,{relativeMajor:Ua,transposeKey:vr,relativeMode:Va,isLegalMode:p1}=Yi,ja=Ri,pn;(function(){pn=function(m,y,x){if(y==="TEST")return{keyAccidentals:Xa,relativeMajor:Ua,transposeKey:vr,relativeMode:Va,transposeChordName:ja};x=parseInt(x,10);var b=[],w;for(w=0;w<y.length;w++)b=b.concat(e(m,y[w],x));b=b.sort(function(B,E){return E.start-B.start});var C=m.split("");for(w=0;w<b.length;w++){var T=b[w];C.splice(T.start,T.end-T.start,T.note)}return C.join("")};function e(m,y,x){var b=[],w=y.getKeySignature();if(w.root==="Hp"||w.root==="HP")return b;b=b.concat(t(m,x));for(var C=0;C<y.lines.length;C++){var T=y.lines[C].staff;if(T)for(var B=0;B<T.length;B++){var E=T[B];E.clef.type!=="perc"&&(b=b.concat(r(m,E.voices,E.key,x)))}}return b}function t(m,y){for(var x=[],b=m.split("K:"),w=b[0].length,C=1;C<b.length;C++){var T=b[C],B=T.match(/^( *)([A-G])([#b]?)( ?)(\w*)/);if(B){var E=w+2+B[1].length,z=p1(B[5])?B[5]:"",I=B[2]+B[3]+B[4]+z,F=o({root:B[2],acc:B[3],mode:z},y),G=F.root+F.acc+B[4]+F.mode;x.push({start:E,end:E+I.length,note:G})}w+=T.length+2}return x}function r(m,y,x,b){for(var w=[],C=o(x,b),T=0;T<y.length;T++)w=w.concat(n(m,y[T],x.root,a(x),C,b));return w}function a(m){for(var y={},x=0;x<m.accidentals.length;x++){var b=m.accidentals[x];b.acc==="flat"?y[b.note.toUpperCase()]="_":b.acc==="sharp"&&(y[b.note.toUpperCase()]="^")}return y}function i(m,y,x){var b=s.indexOf(m.root)-s.indexOf(y);return y==="none"&&(b=s.indexOf(m.root)),b===0?x>2?b+=7:x===-12&&(b-=7):x>0&&b<0?b+=7:x<0&&b>0&&(b-=7),x>12?b+=7:x<-12&&(b-=7),b}function n(m,y,x,b,w,C){for(var T=[],B=i(w,x,C),E={},z={},I=0;I<y.length;I++){var F=y[I];if(F.chord)for(var G=0;G<F.chord.length;G++){var Y=F.chord[G];if(Y.position==="default"){var K=w.accidentals.length&&w.accidentals[0].acc==="flat",P=ja(Y.name,C,K,!0);P=P.replace(/♭/g,"b").replace(/♯/g,"#"),P!==Y.name&&T.push(g(m,F.startChar,F.endChar,P))}}if(F.el_type==="note"&&F.pitches){for(var k=d(m,F.startChar,F.endChar),_=0;_<k.length;_++){var L=h(k[_].note,x,b,E);L.acc&&(E[L.name.toUpperCase()]=L.acc);var A=f(L,w,B,z);A.acc&&(z[A.upper]=A.acc),T.push({note:A.acc+A.name,start:k[_].index,end:k[_].index+k[_].note.length})}if(F.gracenotes)for(var R=0;R<F.gracenotes.length;R++){var V=h(F.gracenotes[R].name,x,b,E);V.acc&&(E[V.name.toUpperCase()]=V.acc);var Q=f(V,w,B,E);Q.acc&&(z[Q.upper]=Q.acc),T.push(p(m,F.startChar,F.endChar,Q.acc+Q.name,R))}}else F.el_type==="bar"?(E={},z={}):F.el_type==="keySignature"&&(x=F.root,b=a(F),w=o(F,C),B=i(w,x,C))}return T}var s="CDEFGAB",c=[",,,,",",,,",",,",",","","'","''","'''","''''"];function o(m,y){if(m.root==="none")return{root:vr("C",y),mode:"",acc:"",accidentals:[]};var x=Ua(m.root+m.acc+m.mode),b=vr(x,y),w=Va(b,m.mode),C=Xa(b);return{root:w[0],mode:m.mode,acc:w.length>1?w[1]:"",accidentals:C}}function f(m,y,x,b){for(var w=m.pitch,C=s.indexOf(m.name),T=s.indexOf(y.root),B=(T+w)%7,E=C+x,z=m.oct;E>6;)z++,E-=7;for(;E<0;)z--,E+=7;for(var I=s[B],F="",G=m.adj,Y="=",K=0;K<y.accidentals.length;K++)if(y.accidentals[K].note.toLowerCase()===I.toLowerCase()){G=G+(y.accidentals[K].acc==="flat"?-1:1),Y=y.accidentals[K].acc==="flat"?"_":"^";break}var P;switch(G){case-2:F="__";break;case-1:F="_";break;case 0:F="=";break;case 1:F="^";break;case 2:F="^^";break;case-3:return P={},P.pitch=m.pitch-1,P.oct=m.oct,P.name=s[s.indexOf(m.name)-1],P.name||(P.name="B",P.oct--),P.name==="B"||P.name==="E"?P.adj=m.adj+1:P.adj=m.adj+2,f(P,y,x+1,b);case 3:return P={},P.pitch=m.pitch+1,P.oct=m.oct,P.name=s[s.indexOf(m.name)+1],P.name||(P.name="C",P.oct++),P.name==="C"||P.name==="F"?P.adj=m.adj-1:P.adj=m.adj-2,f(P,y,x+1,b)}switch((b[I]===F||!b[I]&&F===Y)&&!m.courtesy&&(F=""),z){case 0:I=I+",,,";break;case 1:I=I+",,";break;case 2:I=I+",";break;case 4:I=I.toLowerCase();break;case 5:I=I.toLowerCase()+"'";break;case 6:I=I.toLowerCase()+"''";break;case 7:I=I.toLowerCase()+"'''";break;case 8:I=I.toLowerCase()+"''''";break}return z>4&&(I=I.toLowerCase()),{acc:F,name:I,upper:I.toUpperCase()}}var u=/([_^=]*)([A-Ga-g])([,']*)/,l=/([_^=]*[A-Ga-g][,']*)?(\d*\/*\d*)?([\>\<\-\)]*)?/;function h(m,y,x,b){var w=y==="none"?0:s.indexOf(y),C=m.match(u),T=C[2].toUpperCase(),B=s.indexOf(T)-w;B<0&&(B+=7);var E=c.indexOf(C[3]);T===C[2]&&E--;var z=b[T]||x[T]||"=";return{acc:C[1],name:T,pitch:B,oct:E,adj:v(C[1],x[T],b[T]),courtesy:C[1]===z}}function d(m,y,x){for(var b=m.substring(y,x),w,C=[],T=/("[^"]+")+/g;(w=T.exec(b))!==null;)C.push({start:T.lastIndex-w[0].length,end:T.lastIndex});for(var B=/(![^!]+!)+/g;(w=B.exec(b))!==null;)C.push({start:B.lastIndex-w[0].length,end:B.lastIndex});for(var E=[],z=/([_^=]*)([A-Ga-g])([,']*)/g;(w=z.exec(b))!==null;){for(var I=!1,F=0;F<C.length;F++)z.lastIndex>=C[F].start&&z.lastIndex<=C[F].end&&(I=!0);I||E.push({note:w[0],index:y+z.lastIndex-w[0].length})}return E}function p(m,y,x,b,w){var C=m.substring(y,x),T=/\{/,B=/\}/,E=/([^\{]*)/,z=/(\/*)/,I=C.match(new RegExp(E.source+T.source+z.source+l.source+z.source+l.source+z.source+l.source+z.source+l.source+z.source+l.source+z.source+l.source+z.source+l.source+z.source+l.source+B.source));if(I){for(var F=1+I[1].length,G=0;G<w;G++)I[G*3+2]&&(F+=I[G*3+2].length),I[G*3+3]&&(F+=I[G*3+3].length),I[G*3+4]&&(F+=I[G*3+4].length),I[G*3+5]&&(F+=I[G*3+5].length);I[w*3+2]&&(F+=I[G*3+2].length),y+=F;var Y=I[w*3+3]?I[w*3+3].length:0;Y+=I[w*3+4]?I[w*3+4].length:0,Y+=I[w*3+5]?I[w*3+5].length:0,x=y+Y}return{start:y,end:x,note:b}}function g(m,y,x,b){var w=m.substring(y,x).match(/([^"]+)?(".+")+/);return w[1]&&(y+=w[1].length),x=y+w[2].length,{start:y+1,end:x-1,note:b}}function v(m,y,x){if(!m&&x&&(m=x),!m)return 0;switch(y){case void 0:switch(m){case"__":return-2;case"_":return-1;case"=":return 0;case"^":return 1;case"^^":return 2;default:return 0}case"_":switch(m){case"__":return-1;case"_":return 0;case"=":return 1;case"^":return 2;case"^^":return 3;default:return 0}case"^":switch(m){case"__":return-3;case"_":return-2;case"=":return-1;case"^":return 0;case"^^":return 1;default:return 0}}return 0}})();var v1=pn,Dt=function(t,r,a,i){this.type="BeamElem",this.isflat=!!a,this.isgrace=!!(r&&r==="grace"),this.forceup=!!(this.isgrace||r&&r==="up"),this.forcedown=!!(r&&r==="down"),this.elems=[],this.total=0,this.average=6,this.allrests=!0,this.stemHeight=t,this.beams=[],i&&i.duration?(this.duration=i.duration,i.startTriplet&&(this.duration*=i.tripletMultiplier),this.duration=Math.round(this.duration*1e3)/1e3):this.duration=0};Dt.prototype.setHint=function(){this.hint=!0};Dt.prototype.runningDirection=function(e){var t=e.averagepitch;t!==void 0&&(this.total=Math.round(this.total+t),this.count||(this.count=0),this.count++)};Dt.prototype.add=function(e){var t=e.abcelem.averagepitch;t!==void 0&&(e.abcelem.rest||(this.allrests=!1),e.beam=this,this.elems.push(e),this.total=Math.round(this.total+t),(this.min===void 0||e.abcelem.minpitch<this.min)&&(this.min=e.abcelem.minpitch),(this.max===void 0||e.abcelem.maxpitch>this.max)&&(this.max=e.abcelem.maxpitch))};Dt.prototype.addBeam=function(e){this.beams.push(e)};Dt.prototype.setStemDirection=function(){if(this.average=vn(this.total,this.count),this.forceup)this.stemsUp=!0;else if(this.forcedown)this.stemsUp=!1;else{var e=6;this.stemsUp=this.average<e}delete this.count,this.total=0};Dt.prototype.calcDir=function(){if(this.average=vn(this.total,this.elems.length),this.forceup)this.stemsUp=!0;else if(this.forcedown)this.stemsUp=!1;else{var e=6;this.stemsUp=this.average<e}for(var t=this.stemsUp?"up":"down",r=0;r<this.elems.length;r++)for(var a=0;a<this.elems[r].heads.length;a++)this.elems[r].heads[a].stemDir=t};function vn(e,t){return t?e/t:0}var g1=Dt,C0=function(t,r){this.startVoice=t,this.type=r};C0.prototype.setBottomStaff=function(e){this.endVoice=e,this.startVoice.header&&!this.endVoice.header&&(this.header=this.startVoice.header,delete this.startVoice.header)};C0.prototype.continuing=function(e){this.lastContinuedVoice=e};C0.prototype.getWidth=function(){return 10};C0.prototype.isStartVoice=function(e){return!!(this.startVoice&&this.startVoice.staff&&this.startVoice.staff.voices.length>0&&this.startVoice.staff.voices[0]===e)};var b1=C0,m1=Se,Le={0:{d:[["M",4.83,-14.97],["c",.33,-.03,1.11,0,1.47,.06],["c",1.68,.36,2.97,1.59,3.78,3.6],["c",1.2,2.97,.81,6.96,-.9,9.27],["c",-.78,1.08,-1.71,1.71,-2.91,1.95],["c",-.45,.09,-1.32,.09,-1.77,0],["c",-.81,-.18,-1.47,-.51,-2.07,-1.02],["c",-2.34,-2.07,-3.15,-6.72,-1.74,-10.2],["c",.87,-2.16,2.28,-3.42,4.14,-3.66],["z"],["m",1.11,.87],["c",-.21,-.06,-.69,-.09,-.87,-.06],["c",-.54,.12,-.87,.42,-1.17,.99],["c",-.36,.66,-.51,1.56,-.6,3],["c",-.03,.75,-.03,4.59,0,5.31],["c",.09,1.5,.27,2.4,.6,3.06],["c",.24,.48,.57,.78,.96,.9],["c",.27,.09,.78,.09,1.05,0],["c",.39,-.12,.72,-.42,.96,-.9],["c",.33,-.66,.51,-1.56,.6,-3.06],["c",.03,-.72,.03,-4.56,0,-5.31],["c",-.09,-1.47,-.27,-2.37,-.6,-3.03],["c",-.24,-.48,-.54,-.78,-.93,-.9],["z"]],w:10.78,h:14.959},1:{d:[["M",3.3,-15.06],["c",.06,-.06,.21,-.03,.66,.15],["c",.81,.39,1.08,.39,1.83,.03],["c",.21,-.09,.39,-.15,.42,-.15],["c",.12,0,.21,.09,.27,.21],["c",.06,.12,.06,.33,.06,5.94],["c",0,3.93,0,5.85,.03,6.03],["c",.06,.36,.15,.69,.27,.96],["c",.36,.75,.93,1.17,1.68,1.26],["c",.3,.03,.39,.09,.39,.3],["c",0,.15,-.03,.18,-.09,.24],["c",-.06,.06,-.09,.06,-.48,.06],["c",-.42,0,-.69,-.03,-2.1,-.24],["c",-.9,-.15,-1.77,-.15,-2.67,0],["c",-1.41,.21,-1.68,.24,-2.1,.24],["c",-.39,0,-.42,0,-.48,-.06],["c",-.06,-.06,-.06,-.09,-.06,-.24],["c",0,-.21,.06,-.27,.36,-.3],["c",.75,-.09,1.32,-.51,1.68,-1.26],["c",.12,-.27,.21,-.6,.27,-.96],["c",.03,-.18,.03,-1.59,.03,-4.29],["c",0,-3.87,0,-4.05,-.06,-4.14],["c",-.09,-.15,-.18,-.24,-.39,-.24],["c",-.12,0,-.15,.03,-.21,.06],["c",-.03,.06,-.45,.99,-.96,2.13],["c",-.48,1.14,-.9,2.1,-.93,2.16],["c",-.06,.15,-.21,.24,-.33,.24],["c",-.24,0,-.42,-.18,-.42,-.39],["c",0,-.06,3.27,-7.62,3.33,-7.74],["z"]],w:8.94,h:15.058},2:{d:[["M",4.23,-14.97],["c",.57,-.06,1.68,0,2.34,.18],["c",.69,.18,1.5,.54,2.01,.9],["c",1.35,.96,1.95,2.25,1.77,3.81],["c",-.15,1.35,-.66,2.34,-1.68,3.15],["c",-.6,.48,-1.44,.93,-3.12,1.65],["c",-1.32,.57,-1.8,.81,-2.37,1.14],["c",-.57,.33,-.57,.33,-.24,.27],["c",.39,-.09,1.26,-.09,1.68,0],["c",.72,.15,1.41,.45,2.1,.9],["c",.99,.63,1.86,.87,2.55,.75],["c",.24,-.06,.42,-.15,.57,-.3],["c",.12,-.09,.3,-.42,.3,-.51],["c",0,-.09,.12,-.21,.24,-.24],["c",.18,-.03,.39,.12,.39,.3],["c",0,.12,-.15,.57,-.3,.87],["c",-.54,1.02,-1.56,1.74,-2.79,2.01],["c",-.42,.09,-1.23,.09,-1.62,.03],["c",-.81,-.18,-1.32,-.45,-2.01,-1.11],["c",-.45,-.45,-.63,-.57,-.96,-.69],["c",-.84,-.27,-1.89,.12,-2.25,.9],["c",-.12,.21,-.21,.54,-.21,.72],["c",0,.12,-.12,.21,-.27,.24],["c",-.15,0,-.27,-.03,-.33,-.15],["c",-.09,-.21,.09,-1.08,.33,-1.71],["c",.24,-.66,.66,-1.26,1.29,-1.89],["c",.45,-.45,.9,-.81,1.92,-1.56],["c",1.29,-.93,1.89,-1.44,2.34,-1.98],["c",.87,-1.05,1.26,-2.19,1.2,-3.63],["c",-.06,-1.29,-.39,-2.31,-.96,-2.91],["c",-.36,-.33,-.72,-.51,-1.17,-.54],["c",-.84,-.03,-1.53,.42,-1.59,1.05],["c",-.03,.33,.12,.6,.57,1.14],["c",.45,.54,.54,.87,.42,1.41],["c",-.15,.63,-.54,1.11,-1.08,1.38],["c",-.63,.33,-1.2,.33,-1.83,0],["c",-.24,-.12,-.33,-.18,-.54,-.39],["c",-.18,-.18,-.27,-.3,-.36,-.51],["c",-.24,-.45,-.27,-.84,-.21,-1.38],["c",.12,-.75,.45,-1.41,1.02,-1.98],["c",.72,-.72,1.74,-1.17,2.85,-1.32],["z"]],w:10.764,h:14.97},3:{d:[["M",3.78,-14.97],["c",.3,-.03,1.41,0,1.83,.06],["c",2.22,.3,3.51,1.32,3.72,2.91],["c",.03,.33,.03,1.26,-.03,1.65],["c",-.12,.84,-.48,1.47,-1.05,1.77],["c",-.27,.15,-.36,.24,-.45,.39],["c",-.09,.21,-.09,.36,0,.57],["c",.09,.15,.18,.24,.51,.39],["c",.75,.42,1.23,1.14,1.41,2.13],["c",.06,.42,.06,1.35,0,1.71],["c",-.18,.81,-.48,1.38,-1.02,1.95],["c",-.75,.72,-1.8,1.2,-3.18,1.38],["c",-.42,.06,-1.56,.06,-1.95,0],["c",-1.89,-.33,-3.18,-1.29,-3.51,-2.64],["c",-.03,-.12,-.03,-.33,-.03,-.6],["c",0,-.36,0,-.42,.06,-.63],["c",.12,-.3,.27,-.51,.51,-.75],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.36,.33,.57,.75,.6,1.2],["c",0,.21,0,.27,-.06,.42],["c",-.09,.18,-.12,.24,-.54,.54],["c",-.51,.36,-.63,.54,-.6,.87],["c",.06,.54,.54,.9,1.38,.99],["c",.36,.06,.72,.03,.96,-.06],["c",.81,-.27,1.29,-1.23,1.44,-2.79],["c",.03,-.45,.03,-1.95,-.03,-2.37],["c",-.09,-.75,-.33,-1.23,-.75,-1.44],["c",-.33,-.18,-.45,-.18,-1.98,-.18],["c",-1.35,0,-1.41,0,-1.5,-.06],["c",-.18,-.12,-.24,-.39,-.12,-.6],["c",.12,-.15,.15,-.15,1.68,-.15],["c",1.5,0,1.62,0,1.89,-.15],["c",.18,-.09,.42,-.36,.54,-.57],["c",.18,-.42,.27,-.9,.3,-1.95],["c",.03,-1.2,-.06,-1.8,-.36,-2.37],["c",-.24,-.48,-.63,-.81,-1.14,-.96],["c",-.3,-.06,-1.08,-.06,-1.38,.03],["c",-.6,.15,-.9,.42,-.96,.84],["c",-.03,.3,.06,.45,.63,.84],["c",.33,.24,.42,.39,.45,.63],["c",.03,.72,-.57,1.5,-1.32,1.65],["c",-1.05,.27,-2.1,-.57,-2.1,-1.65],["c",0,-.45,.15,-.96,.39,-1.38],["c",.12,-.21,.54,-.63,.81,-.81],["c",.57,-.42,1.38,-.69,2.25,-.81],["z"]],w:9.735,h:14.967},4:{d:[["M",8.64,-14.94],["c",.27,-.09,.42,-.12,.54,-.03],["c",.09,.06,.15,.21,.15,.3],["c",-.03,.06,-1.92,2.31,-4.23,5.04],["c",-2.31,2.73,-4.23,4.98,-4.26,5.01],["c",-.03,.06,.12,.06,2.55,.06],["l",2.61,0],["l",0,-2.37],["c",0,-2.19,.03,-2.37,.06,-2.46],["c",.03,-.06,.21,-.18,.57,-.42],["c",1.08,-.72,1.38,-1.08,1.86,-2.16],["c",.12,-.3,.24,-.54,.27,-.57],["c",.12,-.12,.39,-.06,.45,.12],["c",.06,.09,.06,.57,.06,3.96],["l",0,3.9],["l",1.08,0],["c",1.05,0,1.11,0,1.2,.06],["c",.24,.15,.24,.54,0,.69],["c",-.09,.06,-.15,.06,-1.2,.06],["l",-1.08,0],["l",0,.33],["c",0,.57,.09,1.11,.3,1.53],["c",.36,.75,.93,1.17,1.68,1.26],["c",.3,.03,.39,.09,.39,.3],["c",0,.15,-.03,.18,-.09,.24],["c",-.06,.06,-.09,.06,-.48,.06],["c",-.42,0,-.69,-.03,-2.1,-.24],["c",-.9,-.15,-1.77,-.15,-2.67,0],["c",-1.41,.21,-1.68,.24,-2.1,.24],["c",-.39,0,-.42,0,-.48,-.06],["c",-.06,-.06,-.06,-.09,-.06,-.24],["c",0,-.21,.06,-.27,.36,-.3],["c",.75,-.09,1.32,-.51,1.68,-1.26],["c",.21,-.42,.3,-.96,.3,-1.53],["l",0,-.33],["l",-2.7,0],["c",-2.91,0,-2.85,0,-3.09,-.15],["c",-.18,-.12,-.3,-.39,-.27,-.54],["c",.03,-.06,.18,-.24,.33,-.45],["c",.75,-.9,1.59,-2.07,2.13,-3.03],["c",.33,-.54,.84,-1.62,1.05,-2.16],["c",.57,-1.41,.84,-2.64,.9,-4.05],["c",.03,-.63,.06,-.72,.24,-.81],["l",.12,-.06],["l",.45,.12],["c",.66,.18,1.02,.24,1.47,.27],["c",.6,.03,1.23,-.09,2.01,-.33],["z"]],w:11.795,h:14.994},5:{d:[["M",1.02,-14.94],["c",.12,-.09,.03,-.09,1.08,.06],["c",2.49,.36,4.35,.36,6.96,-.06],["c",.57,-.09,.66,-.06,.81,.06],["c",.15,.18,.12,.24,-.15,.51],["c",-1.29,1.26,-3.24,2.04,-5.58,2.31],["c",-.6,.09,-1.2,.12,-1.71,.12],["c",-.39,0,-.45,0,-.57,.06],["c",-.09,.06,-.15,.12,-.21,.21],["l",-.06,.12],["l",0,1.65],["l",0,1.65],["l",.21,-.21],["c",.66,-.57,1.41,-.96,2.19,-1.14],["c",.33,-.06,1.41,-.06,1.95,0],["c",2.61,.36,4.02,1.74,4.26,4.14],["c",.03,.45,.03,1.08,-.03,1.44],["c",-.18,1.02,-.78,2.01,-1.59,2.7],["c",-.72,.57,-1.62,1.02,-2.49,1.2],["c",-1.38,.27,-3.03,.06,-4.2,-.54],["c",-1.08,-.54,-1.71,-1.32,-1.86,-2.28],["c",-.09,-.69,.09,-1.29,.57,-1.74],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.36,.33,.57,.75,.6,1.2],["c",0,.21,0,.27,-.06,.42],["c",-.09,.18,-.12,.24,-.54,.54],["c",-.18,.12,-.36,.3,-.42,.33],["c",-.36,.42,-.18,.99,.36,1.26],["c",.51,.27,1.47,.36,2.01,.27],["c",.93,-.21,1.47,-1.17,1.65,-2.91],["c",.06,-.45,.06,-1.89,0,-2.31],["c",-.15,-1.2,-.51,-2.1,-1.05,-2.55],["c",-.21,-.18,-.54,-.36,-.81,-.39],["c",-.3,-.06,-.84,-.03,-1.26,.06],["c",-.93,.18,-1.65,.6,-2.16,1.2],["c",-.15,.21,-.27,.3,-.39,.3],["c",-.15,0,-.3,-.09,-.36,-.18],["c",-.06,-.09,-.06,-.15,-.06,-3.66],["c",0,-3.39,0,-3.57,.06,-3.66],["c",.03,-.06,.09,-.15,.15,-.18],["z"]],w:10.212,h:14.997},6:{d:[["M",4.98,-14.97],["c",.36,-.03,1.2,0,1.59,.06],["c",.9,.15,1.68,.51,2.25,1.05],["c",.57,.51,.87,1.23,.84,1.98],["c",-.03,.51,-.21,.9,-.6,1.26],["c",-.24,.24,-.45,.39,-.75,.51],["c",-.21,.06,-.27,.06,-.6,.06],["c",-.33,0,-.39,0,-.6,-.06],["c",-.3,-.12,-.51,-.27,-.75,-.51],["c",-.39,-.36,-.57,-.78,-.57,-1.26],["c",0,-.27,0,-.3,.09,-.42],["c",.03,-.09,.18,-.21,.3,-.3],["c",.12,-.09,.3,-.21,.39,-.27],["c",.09,-.06,.21,-.18,.27,-.24],["c",.06,-.12,.09,-.15,.09,-.33],["c",0,-.18,-.03,-.24,-.09,-.36],["c",-.24,-.39,-.75,-.6,-1.38,-.57],["c",-.54,.03,-.9,.18,-1.23,.48],["c",-.81,.72,-1.08,2.16,-.96,5.37],["l",0,.63],["l",.3,-.12],["c",.78,-.27,1.29,-.33,2.1,-.27],["c",1.47,.12,2.49,.54,3.27,1.29],["c",.48,.51,.81,1.11,.96,1.89],["c",.06,.27,.06,.42,.06,.93],["c",0,.54,0,.69,-.06,.96],["c",-.15,.78,-.48,1.38,-.96,1.89],["c",-.54,.51,-1.17,.87,-1.98,1.08],["c",-1.14,.3,-2.4,.33,-3.24,.03],["c",-1.5,-.48,-2.64,-1.89,-3.27,-4.02],["c",-.36,-1.23,-.51,-2.82,-.42,-4.08],["c",.3,-3.66,2.28,-6.3,4.95,-6.66],["z"],["m",.66,7.41],["c",-.27,-.09,-.81,-.12,-1.08,-.06],["c",-.72,.18,-1.08,.69,-1.23,1.71],["c",-.06,.54,-.06,3,0,3.54],["c",.18,1.26,.72,1.77,1.8,1.74],["c",.39,-.03,.63,-.09,.9,-.27],["c",.66,-.42,.9,-1.32,.9,-3.24],["c",0,-2.22,-.36,-3.12,-1.29,-3.42],["z"]],w:9.956,h:14.982},7:{d:[["M",.21,-14.97],["c",.21,-.06,.45,0,.54,.15],["c",.06,.09,.06,.15,.06,.39],["c",0,.24,0,.33,.06,.42],["c",.06,.12,.21,.24,.27,.24],["c",.03,0,.12,-.12,.24,-.21],["c",.96,-1.2,2.58,-1.35,3.99,-.42],["c",.15,.12,.42,.3,.54,.45],["c",.48,.39,.81,.57,1.29,.6],["c",.69,.03,1.5,-.3,2.13,-.87],["c",.09,-.09,.27,-.3,.39,-.45],["c",.12,-.15,.24,-.27,.3,-.3],["c",.18,-.06,.39,.03,.51,.21],["c",.06,.18,.06,.24,-.27,.72],["c",-.18,.24,-.54,.78,-.78,1.17],["c",-2.37,3.54,-3.54,6.27,-3.87,9],["c",-.03,.33,-.03,.66,-.03,1.26],["c",0,.9,0,1.08,.15,1.89],["c",.06,.45,.06,.48,.03,.6],["c",-.06,.09,-.21,.21,-.3,.21],["c",-.03,0,-.27,-.06,-.54,-.15],["c",-.84,-.27,-1.11,-.3,-1.65,-.3],["c",-.57,0,-.84,.03,-1.56,.27],["c",-.6,.18,-.69,.21,-.81,.15],["c",-.12,-.06,-.21,-.18,-.21,-.3],["c",0,-.15,.6,-1.44,1.2,-2.61],["c",1.14,-2.22,2.73,-4.68,5.1,-8.01],["c",.21,-.27,.36,-.48,.33,-.48],["c",0,0,-.12,.06,-.27,.12],["c",-.54,.3,-.99,.39,-1.56,.39],["c",-.75,.03,-1.2,-.18,-1.83,-.75],["c",-.99,-.9,-1.83,-1.17,-2.31,-.72],["c",-.18,.15,-.36,.51,-.45,.84],["c",-.06,.24,-.06,.33,-.09,1.98],["c",0,1.62,-.03,1.74,-.06,1.8],["c",-.15,.24,-.54,.24,-.69,0],["c",-.06,-.09,-.06,-.15,-.06,-3.57],["c",0,-3.42,0,-3.48,.06,-3.57],["c",.03,-.06,.09,-.12,.15,-.15],["z"]],w:10.561,h:15.093},8:{d:[["M",4.98,-14.97],["c",.33,-.03,1.02,-.03,1.32,0],["c",1.32,.12,2.49,.6,3.21,1.32],["c",.39,.39,.66,.81,.78,1.29],["c",.09,.36,.09,1.08,0,1.44],["c",-.21,.84,-.66,1.59,-1.59,2.55],["l",-.3,.3],["l",.27,.18],["c",1.47,.93,2.31,2.31,2.25,3.75],["c",-.03,.75,-.24,1.35,-.63,1.95],["c",-.45,.66,-1.02,1.14,-1.83,1.53],["c",-1.8,.87,-4.2,.87,-6,.03],["c",-1.62,-.78,-2.52,-2.16,-2.46,-3.66],["c",.06,-.99,.54,-1.77,1.8,-2.97],["c",.54,-.51,.54,-.54,.48,-.57],["c",-.39,-.27,-.96,-.78,-1.2,-1.14],["c",-.75,-1.11,-.87,-2.4,-.3,-3.6],["c",.69,-1.35,2.25,-2.25,4.2,-2.4],["z"],["m",1.53,.69],["c",-.42,-.09,-1.11,-.12,-1.38,-.06],["c",-.3,.06,-.6,.18,-.81,.3],["c",-.21,.12,-.6,.51,-.72,.72],["c",-.51,.87,-.42,1.89,.21,2.52],["c",.21,.21,.36,.3,1.95,1.23],["c",.96,.54,1.74,.99,1.77,1.02],["c",.09,0,.63,-.6,.99,-1.11],["c",.21,-.36,.48,-.87,.57,-1.23],["c",.06,-.24,.06,-.36,.06,-.72],["c",0,-.45,-.03,-.66,-.15,-.99],["c",-.39,-.81,-1.29,-1.44,-2.49,-1.68],["z"],["m",-1.44,8.07],["l",-1.89,-1.08],["c",-.03,0,-.18,.15,-.39,.33],["c",-1.2,1.08,-1.65,1.95,-1.59,3],["c",.09,1.59,1.35,2.85,3.21,3.24],["c",.33,.06,.45,.06,.93,.06],["c",.63,0,.81,-.03,1.29,-.27],["c",.9,-.42,1.47,-1.41,1.41,-2.4],["c",-.06,-.66,-.39,-1.29,-.9,-1.65],["c",-.12,-.09,-1.05,-.63,-2.07,-1.23],["z"]],w:10.926,h:14.989},9:{d:[["M",4.23,-14.97],["c",.42,-.03,1.29,0,1.62,.06],["c",.51,.12,.93,.3,1.38,.57],["c",1.53,1.02,2.52,3.24,2.73,5.94],["c",.18,2.55,-.48,4.98,-1.83,6.57],["c",-1.05,1.26,-2.4,1.89,-3.93,1.83],["c",-1.23,-.06,-2.31,-.45,-3.03,-1.14],["c",-.57,-.51,-.87,-1.23,-.84,-1.98],["c",.03,-.51,.21,-.9,.6,-1.26],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.39,.36,.57,.78,.57,1.26],["c",0,.27,0,.3,-.09,.42],["c",-.03,.09,-.18,.21,-.3,.3],["c",-.12,.09,-.3,.21,-.39,.27],["c",-.09,.06,-.21,.18,-.27,.24],["c",-.06,.12,-.06,.15,-.06,.33],["c",0,.18,0,.24,.06,.36],["c",.24,.39,.75,.6,1.38,.57],["c",.54,-.03,.9,-.18,1.23,-.48],["c",.81,-.72,1.08,-2.16,.96,-5.37],["l",0,-.63],["l",-.3,.12],["c",-.78,.27,-1.29,.33,-2.1,.27],["c",-1.47,-.12,-2.49,-.54,-3.27,-1.29],["c",-.48,-.51,-.81,-1.11,-.96,-1.89],["c",-.06,-.27,-.06,-.42,-.06,-.96],["c",0,-.51,0,-.66,.06,-.93],["c",.15,-.78,.48,-1.38,.96,-1.89],["c",.15,-.12,.33,-.27,.42,-.36],["c",.69,-.51,1.62,-.81,2.76,-.93],["z"],["m",1.17,.66],["c",-.21,-.06,-.57,-.06,-.81,-.03],["c",-.78,.12,-1.26,.69,-1.41,1.74],["c",-.12,.63,-.15,1.95,-.09,2.79],["c",.12,1.71,.63,2.4,1.77,2.46],["c",1.08,.03,1.62,-.48,1.8,-1.74],["c",.06,-.54,.06,-3,0,-3.54],["c",-.15,-1.05,-.51,-1.53,-1.26,-1.68],["z"]],w:9.959,h:14.986},"rests.multimeasure":{d:[["M",0,-4],["l",0,16],["l",1,0],["l",0,-5],["l",40,0],["l",0,5],["l",1,0],["l",0,-16],["l",-1,0],["l",0,5],["l",-40,0],["l",0,-5],["z"]],w:42,h:18},"rests.whole":{d:[["M",.06,.03],["l",.09,-.06],["l",5.46,0],["l",5.49,0],["l",.09,.06],["l",.06,.09],["l",0,2.19],["l",0,2.19],["l",-.06,.09],["l",-.09,.06],["l",-5.49,0],["l",-5.46,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-2.19],["l",0,-2.19],["z"]],w:11.25,h:4.68},"rests.half":{d:[["M",.06,-4.62],["l",.09,-.06],["l",5.46,0],["l",5.49,0],["l",.09,.06],["l",.06,.09],["l",0,2.19],["l",0,2.19],["l",-.06,.09],["l",-.09,.06],["l",-5.49,0],["l",-5.46,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-2.19],["l",0,-2.19],["z"]],w:11.25,h:4.68},"rests.quarter":{d:[["M",1.89,-11.82],["c",.12,-.06,.24,-.06,.36,-.03],["c",.09,.06,4.74,5.58,4.86,5.82],["c",.21,.39,.15,.78,-.15,1.26],["c",-.24,.33,-.72,.81,-1.62,1.56],["c",-.45,.36,-.87,.75,-.96,.84],["c",-.93,.99,-1.14,2.49,-.6,3.63],["c",.18,.39,.27,.48,1.32,1.68],["c",1.92,2.25,1.83,2.16,1.83,2.34],["c",0,.18,-.18,.36,-.36,.39],["c",-.15,0,-.27,-.06,-.48,-.27],["c",-.75,-.75,-2.46,-1.29,-3.39,-1.08],["c",-.45,.09,-.69,.27,-.9,.69],["c",-.12,.3,-.21,.66,-.24,1.14],["c",-.03,.66,.09,1.35,.3,2.01],["c",.15,.42,.24,.66,.45,.96],["c",.18,.24,.18,.33,.03,.42],["c",-.12,.06,-.18,.03,-.45,-.3],["c",-1.08,-1.38,-2.07,-3.36,-2.4,-4.83],["c",-.27,-1.05,-.15,-1.77,.27,-2.07],["c",.21,-.12,.42,-.15,.87,-.15],["c",.87,.06,2.1,.39,3.3,.9],["l",.39,.18],["l",-1.65,-1.95],["c",-2.52,-2.97,-2.61,-3.09,-2.7,-3.27],["c",-.09,-.24,-.12,-.48,-.03,-.75],["c",.15,-.48,.57,-.96,1.83,-2.01],["c",.45,-.36,.84,-.72,.93,-.78],["c",.69,-.75,1.02,-1.8,.9,-2.79],["c",-.06,-.33,-.21,-.84,-.39,-1.11],["c",-.09,-.15,-.45,-.6,-.81,-1.05],["c",-.36,-.42,-.69,-.81,-.72,-.87],["c",-.09,-.18,0,-.42,.21,-.51],["z"]],w:7.888,h:21.435},"rests.8th":{d:[["M",1.68,-6.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.12,0,.18,0,.33,-.09],["c",.39,-.18,1.32,-1.29,1.68,-1.98],["c",.09,-.21,.24,-.3,.39,-.3],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.27,1.11,-1.86,6.42],["c",-1.02,3.48,-1.89,6.39,-1.92,6.42],["c",0,.03,-.12,.12,-.24,.15],["c",-.18,.09,-.21,.09,-.45,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.15,-.57,1.68,-4.92],["c",.96,-2.67,1.74,-4.89,1.71,-4.89],["l",-.51,.15],["c",-1.08,.36,-1.74,.48,-2.55,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:7.534,h:13.883},"rests.16th":{d:[["M",3.33,-6.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.15,.39,.57,.57,.87,.42],["c",.39,-.18,1.2,-1.23,1.62,-2.07],["c",.06,-.15,.24,-.24,.36,-.24],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.45,1.86,-2.67,10.17],["c",-1.5,5.55,-2.73,10.14,-2.76,10.17],["c",-.03,.03,-.12,.12,-.24,.15],["c",-.18,.09,-.21,.09,-.45,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.12,-.57,1.44,-4.92],["c",.81,-2.67,1.47,-4.86,1.47,-4.89],["c",-.03,0,-.27,.06,-.54,.15],["c",-1.08,.36,-1.77,.48,-2.58,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.09,.09,.27,.18,.45,.21],["c",.12,0,.18,0,.33,-.09],["c",.33,-.15,1.02,-.93,1.41,-1.59],["c",.12,-.21,.18,-.39,.39,-1.08],["c",.66,-2.1,1.17,-3.84,1.17,-3.87],["c",0,0,-.21,.06,-.42,.15],["c",-.51,.15,-1.2,.33,-1.68,.42],["c",-.33,.06,-.51,.06,-.96,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:9.724,h:21.383},"rests.32nd":{d:[["M",4.23,-13.62],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.12,0,.18,0,.27,-.06],["c",.33,-.21,.99,-1.11,1.44,-1.98],["c",.09,-.24,.21,-.33,.39,-.33],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.57,2.67,-3.21,13.89],["c",-1.8,7.62,-3.3,13.89,-3.3,13.92],["c",-.03,.06,-.12,.12,-.24,.18],["c",-.21,.09,-.24,.09,-.48,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.09,-.57,1.23,-4.92],["c",.69,-2.67,1.26,-4.86,1.29,-4.89],["c",0,-.03,-.12,-.03,-.48,.12],["c",-1.17,.39,-2.22,.57,-3,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.12,.09,.3,.18,.48,.21],["c",.12,0,.18,0,.3,-.09],["c",.42,-.21,1.29,-1.29,1.56,-1.89],["c",.03,-.12,1.23,-4.59,1.23,-4.65],["c",0,-.03,-.18,.03,-.39,.12],["c",-.63,.18,-1.2,.36,-1.74,.45],["c",-.39,.06,-.54,.06,-1.02,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.18,.18,.51,.27,.72,.15],["c",.3,-.12,.69,-.57,1.08,-1.17],["c",.42,-.6,.39,-.51,1.05,-3.03],["c",.33,-1.26,.6,-2.31,.6,-2.34],["c",0,0,-.21,.03,-.45,.12],["c",-.57,.18,-1.14,.33,-1.62,.42],["c",-.33,.06,-.51,.06,-.96,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:11.373,h:28.883},"rests.64th":{d:[["M",5.13,-13.62],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.21,.54,.3,.75,.18],["c",.24,-.12,.63,-.66,1.08,-1.56],["c",.33,-.66,.39,-.72,.6,-.72],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.69,3.66,-3.54,17.64],["c",-1.95,9.66,-3.57,17.61,-3.57,17.64],["c",-.03,.06,-.12,.12,-.24,.18],["c",-.21,.09,-.24,.09,-.48,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.06,-.57,1.05,-4.95],["c",.6,-2.7,1.08,-4.89,1.08,-4.92],["c",0,0,-.24,.06,-.51,.15],["c",-.66,.24,-1.2,.36,-1.77,.48],["c",-.42,.06,-.57,.06,-1.05,.06],["c",-.69,0,-.87,-.03,-1.35,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.09,.09,.27,.18,.45,.21],["c",.21,.03,.39,-.09,.72,-.42],["c",.45,-.45,1.02,-1.26,1.17,-1.65],["c",.03,-.09,.27,-1.14,.54,-2.34],["c",.27,-1.2,.48,-2.19,.51,-2.22],["c",0,-.03,-.09,-.03,-.48,.12],["c",-1.17,.39,-2.22,.57,-3,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.15,.39,.57,.57,.9,.42],["c",.36,-.18,1.2,-1.26,1.47,-1.89],["c",.03,-.09,.3,-1.2,.57,-2.43],["l",.51,-2.28],["l",-.54,.18],["c",-1.11,.36,-1.8,.48,-2.61,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.21,.21,.54,.3,.75,.18],["c",.36,-.18,.93,-.93,1.29,-1.68],["c",.12,-.24,.18,-.48,.63,-2.55],["l",.51,-2.31],["c",0,-.03,-.18,.03,-.39,.12],["c",-1.14,.36,-2.1,.54,-2.82,.51],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:12.453,h:36.383},"rests.128th":{d:[["M",6.03,-21.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.21,0,.33,-.06,.54,-.36],["c",.15,-.21,.54,-.93,.78,-1.47],["c",.15,-.33,.18,-.39,.3,-.48],["c",.18,-.09,.45,0,.51,.15],["c",.03,.09,-7.11,42.75,-7.17,42.84],["c",-.03,.03,-.15,.09,-.24,.15],["c",-.18,.06,-.24,.06,-.45,.06],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.03,-.57,.84,-4.98],["c",.51,-2.7,.93,-4.92,.9,-4.92],["c",0,0,-.15,.06,-.36,.12],["c",-.78,.27,-1.62,.48,-2.31,.57],["c",-.15,.03,-.54,.03,-.81,.03],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.63,.48],["c",.12,0,.18,0,.3,-.09],["c",.42,-.21,1.14,-1.11,1.5,-1.83],["c",.12,-.27,.12,-.27,.54,-2.52],["c",.24,-1.23,.42,-2.25,.39,-2.25],["c",0,0,-.24,.06,-.51,.18],["c",-1.26,.39,-2.25,.57,-3.06,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.21,.51,.3,.75,.18],["c",.36,-.15,1.05,-.99,1.41,-1.77],["l",.15,-.3],["l",.42,-2.25],["c",.21,-1.26,.42,-2.28,.39,-2.28],["l",-.51,.15],["c",-1.11,.39,-1.89,.51,-2.7,.51],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.18,.48,.27,.72,.21],["c",.33,-.12,1.14,-1.26,1.41,-1.95],["c",0,-.09,.21,-1.11,.45,-2.34],["c",.21,-1.2,.39,-2.22,.39,-2.28],["c",.03,-.03,0,-.03,-.45,.12],["c",-.57,.18,-1.2,.33,-1.71,.42],["c",-.3,.06,-.51,.06,-.93,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.18,0,.36,-.09,.57,-.33],["c",.33,-.36,.78,-1.14,.93,-1.56],["c",.03,-.12,.24,-1.2,.45,-2.4],["c",.24,-1.2,.42,-2.22,.42,-2.28],["c",.03,-.03,0,-.03,-.39,.09],["c",-1.05,.36,-1.8,.48,-2.58,.48],["c",-.63,0,-.84,-.03,-1.29,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:12.992,h:43.883},"accidentals.sharp":{d:[["M",5.73,-11.19],["c",.21,-.12,.54,-.03,.66,.24],["c",.06,.12,.06,.21,.06,2.31],["c",0,1.23,0,2.22,.03,2.22],["c",0,0,.27,-.12,.6,-.24],["c",.69,-.27,.78,-.3,.96,-.15],["c",.21,.15,.21,.18,.21,1.38],["c",0,1.02,0,1.11,-.06,1.2],["c",-.03,.06,-.09,.12,-.12,.15],["c",-.06,.03,-.42,.21,-.84,.36],["l",-.75,.33],["l",-.03,2.43],["c",0,1.32,0,2.43,.03,2.43],["c",0,0,.27,-.12,.6,-.24],["c",.69,-.27,.78,-.3,.96,-.15],["c",.21,.15,.21,.18,.21,1.38],["c",0,1.02,0,1.11,-.06,1.2],["c",-.03,.06,-.09,.12,-.12,.15],["c",-.06,.03,-.42,.21,-.84,.36],["l",-.75,.33],["l",-.03,2.52],["c",0,2.28,-.03,2.55,-.06,2.64],["c",-.21,.36,-.72,.36,-.93,0],["c",-.03,-.09,-.06,-.33,-.06,-2.43],["l",0,-2.31],["l",-1.29,.51],["l",-1.26,.51],["l",0,2.43],["c",0,2.58,0,2.52,-.15,2.67],["c",-.06,.09,-.27,.18,-.36,.18],["c",-.12,0,-.33,-.09,-.39,-.18],["c",-.15,-.15,-.15,-.09,-.15,-2.43],["c",0,-1.23,0,-2.22,-.03,-2.22],["c",0,0,-.27,.12,-.6,.24],["c",-.69,.27,-.78,.3,-.96,.15],["c",-.21,-.15,-.21,-.18,-.21,-1.38],["c",0,-1.02,0,-1.11,.06,-1.2],["c",.03,-.06,.09,-.12,.12,-.15],["c",.06,-.03,.42,-.21,.84,-.36],["l",.78,-.33],["l",0,-2.43],["c",0,-1.32,0,-2.43,-.03,-2.43],["c",0,0,-.27,.12,-.6,.24],["c",-.69,.27,-.78,.3,-.96,.15],["c",-.21,-.15,-.21,-.18,-.21,-1.38],["c",0,-1.02,0,-1.11,.06,-1.2],["c",.03,-.06,.09,-.12,.12,-.15],["c",.06,-.03,.42,-.21,.84,-.36],["l",.78,-.33],["l",0,-2.52],["c",0,-2.28,.03,-2.55,.06,-2.64],["c",.21,-.36,.72,-.36,.93,0],["c",.03,.09,.06,.33,.06,2.43],["l",.03,2.31],["l",1.26,-.51],["l",1.26,-.51],["l",0,-2.43],["c",0,-2.28,0,-2.43,.06,-2.55],["c",.06,-.12,.12,-.18,.27,-.24],["z"],["m",-.33,10.65],["l",0,-2.43],["l",-1.29,.51],["l",-1.26,.51],["l",0,2.46],["l",0,2.43],["l",.09,-.03],["c",.06,-.03,.63,-.27,1.29,-.51],["l",1.17,-.48],["l",0,-2.46],["z"]],w:8.25,h:22.462},"accidentals.halfsharp":{d:[["M",2.43,-10.05],["c",.21,-.12,.54,-.03,.66,.24],["c",.06,.12,.06,.21,.06,2.01],["c",0,1.05,0,1.89,.03,1.89],["l",.72,-.48],["c",.69,-.48,.69,-.51,.87,-.51],["c",.15,0,.18,.03,.27,.09],["c",.21,.15,.21,.18,.21,1.41],["c",0,1.11,-.03,1.14,-.09,1.23],["c",-.03,.03,-.48,.39,-1.02,.75],["l",-.99,.66],["l",0,2.37],["c",0,1.32,0,2.37,.03,2.37],["l",.72,-.48],["c",.69,-.48,.69,-.51,.87,-.51],["c",.15,0,.18,.03,.27,.09],["c",.21,.15,.21,.18,.21,1.41],["c",0,1.11,-.03,1.14,-.09,1.23],["c",-.03,.03,-.48,.39,-1.02,.75],["l",-.99,.66],["l",0,2.25],["c",0,1.95,0,2.28,-.06,2.37],["c",-.06,.12,-.12,.21,-.24,.27],["c",-.27,.12,-.54,.03,-.69,-.24],["c",-.06,-.12,-.06,-.21,-.06,-2.01],["c",0,-1.05,0,-1.89,-.03,-1.89],["l",-.72,.48],["c",-.69,.48,-.69,.48,-.87,.48],["c",-.15,0,-.18,0,-.27,-.06],["c",-.21,-.15,-.21,-.18,-.21,-1.41],["c",0,-1.11,.03,-1.14,.09,-1.23],["c",.03,-.03,.48,-.39,1.02,-.75],["l",.99,-.66],["l",0,-2.37],["c",0,-1.32,0,-2.37,-.03,-2.37],["l",-.72,.48],["c",-.69,.48,-.69,.48,-.87,.48],["c",-.15,0,-.18,0,-.27,-.06],["c",-.21,-.15,-.21,-.18,-.21,-1.41],["c",0,-1.11,.03,-1.14,.09,-1.23],["c",.03,-.03,.48,-.39,1.02,-.75],["l",.99,-.66],["l",0,-2.25],["c",0,-2.13,0,-2.28,.06,-2.4],["c",.06,-.12,.12,-.18,.27,-.24],["z"]],w:5.25,h:20.174},"accidentals.nat":{d:[["M",.21,-11.4],["c",.24,-.06,.78,0,.99,.15],["c",.03,.03,.03,.48,0,2.61],["c",-.03,1.44,-.03,2.61,-.03,2.61],["c",0,.03,.75,-.09,1.68,-.24],["c",.96,-.18,1.71,-.27,1.74,-.27],["c",.15,.03,.27,.15,.36,.3],["l",.06,.12],["l",.09,8.67],["c",.09,6.96,.12,8.67,.09,8.67],["c",-.03,.03,-.12,.06,-.21,.09],["c",-.24,.09,-.72,.09,-.96,0],["c",-.09,-.03,-.18,-.06,-.21,-.09],["c",-.03,-.03,-.03,-.48,0,-2.61],["c",.03,-1.44,.03,-2.61,.03,-2.61],["c",0,-.03,-.75,.09,-1.68,.24],["c",-.96,.18,-1.71,.27,-1.74,.27],["c",-.15,-.03,-.27,-.15,-.36,-.3],["l",-.06,-.15],["l",-.09,-7.53],["c",-.06,-4.14,-.09,-8.04,-.12,-8.67],["l",0,-1.11],["l",.15,-.06],["c",.09,-.03,.21,-.06,.27,-.09],["z"],["m",3.75,8.4],["c",0,-.33,0,-.42,-.03,-.42],["c",-.12,0,-2.79,.45,-2.79,.48],["c",-.03,0,-.09,6.3,-.09,6.33],["c",.03,0,2.79,-.45,2.82,-.48],["c",0,0,.09,-4.53,.09,-5.91],["z"]],w:5.4,h:22.8},"accidentals.flat":{d:[["M",-.36,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"]],w:6.75,h:18.801},"accidentals.halfflat":{d:[["M",4.83,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.6,-.12,9.06],["c",-.09,5.55,-.15,9.06,-.18,9.12],["c",-.03,.09,-.09,.18,-.15,.27],["c",-.24,.21,-.54,.24,-.81,.06],["c",-.06,-.03,-.27,-.24,-.45,-.42],["c",-.36,-.42,-.66,-.66,-1.8,-1.44],["c",-1.23,-.84,-1.83,-1.32,-2.25,-1.77],["c",-.66,-.78,-.96,-1.56,-.93,-2.46],["c",.09,-1.41,1.11,-2.58,2.4,-2.79],["c",.3,-.06,.84,-.03,1.23,.06],["c",.54,.12,1.08,.33,1.53,.63],["c",.12,.09,.24,.15,.24,.12],["c",0,0,-.12,-8.37,-.18,-9.75],["l",0,-.66],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",-1.65,10.95],["c",-.6,-.18,-1.08,.09,-1.38,.69],["c",-.27,.6,-.36,1.38,-.18,2.07],["c",.12,.42,.42,.99,.72,1.41],["c",.3,.42,.93,1.05,1.56,1.59],["l",.48,.39],["l",0,-.12],["c",.03,-.09,.03,-.48,.06,-.9],["c",.03,-.57,.03,-1.08,0,-2.22],["c",-.03,-1.62,-.03,-1.62,-.24,-2.07],["c",-.21,-.42,-.6,-.75,-1.02,-.84],["z"]],w:6.728,h:18.801},"accidentals.dblflat":{d:[["M",-.36,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"],["m",3,-11],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"]],w:12.1,h:18.804},"accidentals.dblsharp":{d:[["M",-.18,-3.96],["c",.06,-.03,.12,-.06,.15,-.06],["c",.09,0,2.76,.27,2.79,.3],["c",.12,.03,.15,.12,.15,.51],["c",.06,.96,.24,1.59,.57,2.1],["c",.06,.09,.15,.21,.18,.24],["l",.09,.06],["l",.09,-.06],["c",.03,-.03,.12,-.15,.18,-.24],["c",.33,-.51,.51,-1.14,.57,-2.1],["c",0,-.39,.03,-.45,.12,-.51],["c",.03,0,.66,-.09,1.44,-.15],["c",1.47,-.15,1.5,-.15,1.56,-.03],["c",.03,.06,0,.42,-.09,1.44],["c",-.09,.72,-.15,1.35,-.15,1.38],["c",0,.03,-.03,.09,-.06,.12],["c",-.06,.06,-.12,.09,-.51,.09],["c",-1.08,.06,-1.8,.3,-2.28,.75],["l",-.12,.09],["l",.09,.09],["c",.12,.15,.39,.33,.63,.45],["c",.42,.18,.96,.27,1.68,.33],["c",.39,0,.45,.03,.51,.09],["c",.03,.03,.06,.09,.06,.12],["c",0,.03,.06,.66,.15,1.38],["c",.09,1.02,.12,1.38,.09,1.44],["c",-.06,.12,-.09,.12,-1.56,-.03],["c",-.78,-.06,-1.41,-.15,-1.44,-.15],["c",-.09,-.06,-.12,-.12,-.12,-.54],["c",-.06,-.93,-.24,-1.56,-.57,-2.07],["c",-.06,-.09,-.15,-.21,-.18,-.24],["l",-.09,-.06],["l",-.09,.06],["c",-.03,.03,-.12,.15,-.18,.24],["c",-.33,.51,-.51,1.14,-.57,2.07],["c",0,.42,-.03,.48,-.12,.54],["c",-.03,0,-.66,.09,-1.44,.15],["c",-1.47,.15,-1.5,.15,-1.56,.03],["c",-.03,-.06,0,-.42,.09,-1.44],["c",.09,-.72,.15,-1.35,.15,-1.38],["c",0,-.03,.03,-.09,.06,-.12],["c",.06,-.06,.12,-.09,.51,-.09],["c",.72,-.06,1.26,-.15,1.68,-.33],["c",.24,-.12,.51,-.3,.63,-.45],["l",.09,-.09],["l",-.12,-.09],["c",-.48,-.45,-1.2,-.69,-2.28,-.75],["c",-.39,0,-.45,-.03,-.51,-.09],["c",-.03,-.03,-.06,-.09,-.06,-.12],["c",0,-.03,-.06,-.63,-.12,-1.38],["c",-.09,-.72,-.15,-1.35,-.15,-1.38],["z"]],w:7.95,h:7.977},"dots.dot":{d:[["M",1.32,-1.68],["c",.09,-.03,.27,-.06,.39,-.06],["c",.96,0,1.74,.78,1.74,1.71],["c",0,.96,-.78,1.74,-1.71,1.74],["c",-.96,0,-1.74,-.78,-1.74,-1.71],["c",0,-.78,.54,-1.5,1.32,-1.68],["z"]],w:3.45,h:3.45},"noteheads.dbl":{d:[["M",-.69,-4.02],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["c",.06,.15,.06,.18,.06,1.41],["l",0,1.23],["l",.12,-.18],["c",.72,-1.26,2.64,-2.31,4.86,-2.64],["c",.81,-.15,1.11,-.15,2.13,-.15],["c",.99,0,1.29,0,2.1,.15],["c",.75,.12,1.38,.27,2.04,.54],["c",1.35,.51,2.34,1.26,2.82,2.1],["l",.12,.18],["l",0,-1.23],["c",0,-1.2,0,-1.26,.06,-1.38],["c",.09,-.18,.15,-.24,.33,-.33],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,3.54],["l",0,3.54],["l",-.06,.15],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.06,-.12,-.06,-.18,-.06,-1.38],["l",0,-1.23],["l",-.12,.18],["c",-.48,.84,-1.47,1.59,-2.82,2.1],["c",-.84,.33,-1.71,.54,-2.85,.66],["c",-.45,.06,-2.16,.06,-2.61,0],["c",-1.14,-.12,-2.01,-.33,-2.85,-.66],["c",-1.35,-.51,-2.34,-1.26,-2.82,-2.1],["l",-.12,-.18],["l",0,1.23],["c",0,1.23,0,1.26,-.06,1.38],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["l",-.06,-.15],["l",0,-3.54],["c",0,-3.48,0,-3.54,.06,-3.66],["c",.09,-.18,.15,-.24,.33,-.33],["z"],["m",7.71,.63],["c",-.36,-.06,-.9,-.06,-1.14,0],["c",-.3,.03,-.66,.24,-.87,.42],["c",-.6,.54,-.9,1.62,-.75,2.82],["c",.12,.93,.51,1.68,1.11,2.31],["c",.75,.72,1.83,1.2,2.85,1.26],["c",1.05,.06,1.83,-.54,2.1,-1.65],["c",.21,-.9,.12,-1.95,-.24,-2.82],["c",-.36,-.81,-1.08,-1.53,-1.95,-1.95],["c",-.3,-.15,-.78,-.3,-1.11,-.39],["z"]],w:16.83,h:8.145},"noteheads.whole":{d:[["M",6.51,-4.05],["c",.51,-.03,2.01,0,2.52,.03],["c",1.41,.18,2.64,.51,3.72,1.08],["c",1.2,.63,1.95,1.41,2.19,2.31],["c",.09,.33,.09,.9,0,1.23],["c",-.24,.9,-.99,1.68,-2.19,2.31],["c",-1.08,.57,-2.28,.9,-3.75,1.08],["c",-.66,.06,-2.31,.06,-2.97,0],["c",-1.47,-.18,-2.67,-.51,-3.75,-1.08],["c",-1.2,-.63,-1.95,-1.41,-2.19,-2.31],["c",-.09,-.33,-.09,-.9,0,-1.23],["c",.24,-.9,.99,-1.68,2.19,-2.31],["c",1.2,-.63,2.61,-.99,4.23,-1.11],["z"],["m",.57,.66],["c",-.87,-.15,-1.53,0,-2.04,.51],["c",-.15,.15,-.24,.27,-.33,.48],["c",-.24,.51,-.36,1.08,-.33,1.77],["c",.03,.69,.18,1.26,.42,1.77],["c",.6,1.17,1.74,1.98,3.18,2.22],["c",1.11,.21,1.95,-.15,2.34,-.99],["c",.24,-.51,.36,-1.08,.33,-1.8],["c",-.06,-1.11,-.45,-2.04,-1.17,-2.76],["c",-.63,-.63,-1.47,-1.05,-2.4,-1.2],["z"]],w:14.985,h:8.097},"noteheads.half":{d:[["M",7.44,-4.05],["c",.06,-.03,.27,-.03,.48,-.03],["c",1.05,0,1.71,.24,2.1,.81],["c",.42,.6,.45,1.35,.18,2.4],["c",-.42,1.59,-1.14,2.73,-2.16,3.39],["c",-1.41,.93,-3.18,1.44,-5.4,1.53],["c",-1.17,.03,-1.89,-.21,-2.28,-.81],["c",-.42,-.6,-.45,-1.35,-.18,-2.4],["c",.42,-1.59,1.14,-2.73,2.16,-3.39],["c",.63,-.42,1.23,-.72,1.98,-.96],["c",.9,-.3,1.65,-.42,3.12,-.54],["z"],["m",1.29,.87],["c",-.27,-.09,-.63,-.12,-.9,-.03],["c",-.72,.24,-1.53,.69,-3.27,1.8],["c",-2.34,1.5,-3.3,2.25,-3.57,2.79],["c",-.36,.72,-.06,1.5,.66,1.77],["c",.24,.12,.69,.09,.99,0],["c",.84,-.3,1.92,-.93,4.14,-2.37],["c",1.62,-1.08,2.37,-1.71,2.61,-2.19],["c",.36,-.72,.06,-1.5,-.66,-1.77],["z"]],w:10.37,h:8.132},"noteheads.quarter":{d:[["M",6.09,-4.05],["c",.36,-.03,1.2,0,1.53,.06],["c",1.17,.24,1.89,.84,2.16,1.83],["c",.06,.18,.06,.3,.06,.66],["c",0,.45,0,.63,-.15,1.08],["c",-.66,2.04,-3.06,3.93,-5.52,4.38],["c",-.54,.09,-1.44,.09,-1.83,.03],["c",-1.23,-.27,-1.98,-.87,-2.25,-1.86],["c",-.06,-.18,-.06,-.3,-.06,-.66],["c",0,-.45,0,-.63,.15,-1.08],["c",.24,-.78,.75,-1.53,1.44,-2.22],["c",1.2,-1.2,2.85,-2.01,4.47,-2.22],["z"]],w:9.81,h:8.094},"noteheads.slash.nostem":{d:[["M",9.3,-7.77],["c",.06,-.06,.18,-.06,1.71,-.06],["l",1.65,0],["l",.09,.09],["c",.06,.06,.06,.09,.06,.15],["c",-.03,.12,-9.21,15.24,-9.3,15.33],["c",-.06,.06,-.18,.06,-1.71,.06],["l",-1.65,0],["l",-.09,-.09],["c",-.06,-.06,-.06,-.09,-.06,-.15],["c",.03,-.12,9.21,-15.24,9.3,-15.33],["z"]],w:12.81,h:15.63},"noteheads.indeterminate":{d:[["M",.78,-4.05],["c",.12,-.03,.24,-.03,.36,.03],["c",.03,.03,.93,.72,1.95,1.56],["l",1.86,1.5],["l",1.86,-1.5],["c",1.02,-.84,1.92,-1.53,1.95,-1.56],["c",.21,-.12,.33,-.09,.75,.24],["c",.3,.27,.36,.36,.36,.54],["c",0,.03,-.03,.12,-.06,.18],["c",-.03,.06,-.9,.75,-1.89,1.56],["l",-1.8,1.47],["c",0,.03,.81,.69,1.8,1.5],["c",.99,.81,1.86,1.5,1.89,1.56],["c",.03,.06,.06,.15,.06,.18],["c",0,.18,-.06,.27,-.36,.54],["c",-.42,.33,-.54,.36,-.75,.24],["c",-.03,-.03,-.93,-.72,-1.95,-1.56],["l",-1.86,-1.5],["l",-1.86,1.5],["c",-1.02,.84,-1.92,1.53,-1.95,1.56],["c",-.21,.12,-.33,.09,-.75,-.24],["c",-.3,-.27,-.36,-.36,-.36,-.54],["c",0,-.03,.03,-.12,.06,-.18],["c",.03,-.06,.9,-.75,1.89,-1.56],["l",1.8,-1.47],["c",0,-.03,-.81,-.69,-1.8,-1.5],["c",-.99,-.81,-1.86,-1.5,-1.89,-1.56],["c",-.06,-.12,-.09,-.21,-.03,-.36],["c",.03,-.09,.57,-.57,.72,-.63],["z"]],w:9.843,h:8.139},"scripts.ufermata":{d:[["M",-.75,-10.77],["c",.12,0,.45,-.03,.69,-.03],["c",2.91,-.03,5.55,1.53,7.41,4.35],["c",1.17,1.71,1.95,3.72,2.43,6.03],["c",.12,.51,.12,.57,.03,.69],["c",-.12,.21,-.48,.27,-.69,.12],["c",-.12,-.09,-.18,-.24,-.27,-.69],["c",-.78,-3.63,-3.42,-6.54,-6.78,-7.38],["c",-.78,-.21,-1.2,-.24,-2.07,-.24],["c",-.63,0,-.84,0,-1.2,.06],["c",-1.83,.27,-3.42,1.08,-4.8,2.37],["c",-1.41,1.35,-2.4,3.21,-2.85,5.19],["c",-.09,.45,-.15,.6,-.27,.69],["c",-.21,.15,-.57,.09,-.69,-.12],["c",-.09,-.12,-.09,-.18,.03,-.69],["c",.33,-1.62,.78,-3,1.47,-4.38],["c",1.77,-3.54,4.44,-5.67,7.56,-5.97],["z"],["m",.33,7.47],["c",1.38,-.3,2.58,.9,2.31,2.25],["c",-.15,.72,-.78,1.35,-1.47,1.5],["c",-1.38,.27,-2.58,-.93,-2.31,-2.31],["c",.15,-.69,.78,-1.29,1.47,-1.44],["z"]],w:19.748,h:11.289},"scripts.dfermata":{d:[["M",-9.63,-.42],["c",.15,-.09,.36,-.06,.51,.03],["c",.12,.09,.18,.24,.27,.66],["c",.78,3.66,3.42,6.57,6.78,7.41],["c",.78,.21,1.2,.24,2.07,.24],["c",.63,0,.84,0,1.2,-.06],["c",1.83,-.27,3.42,-1.08,4.8,-2.37],["c",1.41,-1.35,2.4,-3.21,2.85,-5.22],["c",.09,-.42,.15,-.57,.27,-.66],["c",.21,-.15,.57,-.09,.69,.12],["c",.09,.12,.09,.18,-.03,.69],["c",-.33,1.62,-.78,3,-1.47,4.38],["c",-1.92,3.84,-4.89,6,-8.31,6],["c",-3.42,0,-6.39,-2.16,-8.31,-6],["c",-.48,-.96,-.84,-1.92,-1.14,-2.97],["c",-.18,-.69,-.42,-1.74,-.42,-1.92],["c",0,-.12,.09,-.27,.24,-.33],["z"],["m",9.21,0],["c",1.2,-.27,2.34,.63,2.34,1.86],["c",0,.9,-.66,1.68,-1.5,1.89],["c",-1.38,.27,-2.58,-.93,-2.31,-2.31],["c",.15,-.69,.78,-1.29,1.47,-1.44],["z"]],w:19.744,h:11.274},"scripts.sforzato":{d:[["M",-6.45,-3.69],["c",.06,-.03,.15,-.06,.18,-.06],["c",.06,0,2.85,.72,6.24,1.59],["l",6.33,1.65],["c",.33,.06,.45,.21,.45,.51],["c",0,.3,-.12,.45,-.45,.51],["l",-6.33,1.65],["c",-3.39,.87,-6.18,1.59,-6.21,1.59],["c",-.21,0,-.48,-.24,-.51,-.45],["c",0,-.15,.06,-.36,.18,-.45],["c",.09,-.06,.87,-.27,3.84,-1.05],["c",2.04,-.54,3.84,-.99,4.02,-1.02],["c",.15,-.06,1.14,-.24,2.22,-.42],["c",1.05,-.18,1.92,-.36,1.92,-.36],["c",0,0,-.87,-.18,-1.92,-.36],["c",-1.08,-.18,-2.07,-.36,-2.22,-.42],["c",-.18,-.03,-1.98,-.48,-4.02,-1.02],["c",-2.97,-.78,-3.75,-.99,-3.84,-1.05],["c",-.12,-.09,-.18,-.3,-.18,-.45],["c",.03,-.15,.15,-.3,.3,-.39],["z"]],w:13.5,h:7.5},"scripts.staccato":{d:[["M",-.36,-1.47],["c",.93,-.21,1.86,.51,1.86,1.47],["c",0,.93,-.87,1.65,-1.8,1.47],["c",-.54,-.12,-1.02,-.57,-1.14,-1.08],["c",-.21,-.81,.27,-1.65,1.08,-1.86],["z"]],w:2.989,h:3.004},"scripts.tenuto":{d:[["M",-4.2,-.48],["l",.12,-.06],["l",4.08,0],["l",4.08,0],["l",.12,.06],["c",.39,.21,.39,.75,0,.96],["l",-.12,.06],["l",-4.08,0],["l",-4.08,0],["l",-.12,-.06],["c",-.39,-.21,-.39,-.75,0,-.96],["z"]],w:8.985,h:1.08},"scripts.umarcato":{d:[["M",-.15,-8.19],["c",.15,-.12,.36,-.03,.45,.15],["c",.21,.42,3.45,7.65,3.45,7.71],["c",0,.12,-.12,.27,-.21,.3],["c",-.03,.03,-.51,.03,-1.14,.03],["c",-1.05,0,-1.08,0,-1.17,-.06],["c",-.09,-.06,-.24,-.36,-1.17,-2.4],["c",-.57,-1.29,-1.05,-2.34,-1.08,-2.34],["c",0,-.03,-.51,1.02,-1.08,2.34],["c",-.93,2.07,-1.08,2.34,-1.14,2.4],["c",-.06,.03,-.15,.06,-.18,.06],["c",-.15,0,-.33,-.18,-.33,-.33],["c",0,-.06,3.24,-7.32,3.45,-7.71],["c",.03,-.06,.09,-.15,.15,-.15],["z"]],w:7.5,h:8.245},"scripts.dmarcato":{d:[["M",-3.57,.03],["c",.03,0,.57,-.03,1.17,-.03],["c",1.05,0,1.08,0,1.17,.06],["c",.09,.06,.24,.36,1.17,2.4],["c",.57,1.29,1.05,2.34,1.08,2.34],["c",0,.03,.51,-1.02,1.08,-2.34],["c",.93,-2.07,1.08,-2.34,1.14,-2.4],["c",.06,-.03,.15,-.06,.18,-.06],["c",.15,0,.33,.18,.33,.33],["c",0,.09,-3.45,7.74,-3.54,7.83],["c",-.12,.12,-.3,.12,-.42,0],["c",-.09,-.09,-3.54,-7.74,-3.54,-7.83],["c",0,-.09,.12,-.27,.18,-.3],["z"]],w:7.5,h:8.25},"scripts.stopped":{d:[["M",-.27,-4.08],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,1.5],["l",0,1.47],["l",1.47,0],["l",1.5,0],["l",.15,.06],["c",.15,.09,.21,.15,.3,.33],["c",.09,.18,.09,.36,0,.54],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.12,.06,-.18,.06,-1.62,.06],["l",-1.47,0],["l",0,1.47],["l",0,1.47],["l",-.06,.15],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["l",-.06,-.15],["l",0,-1.47],["l",0,-1.47],["l",-1.47,0],["c",-1.44,0,-1.5,0,-1.62,-.06],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.09,-.36,0,-.54],["c",.09,-.18,.15,-.24,.33,-.33],["l",.15,-.06],["l",1.47,0],["l",1.47,0],["l",0,-1.47],["c",0,-1.44,0,-1.5,.06,-1.62],["c",.09,-.18,.15,-.24,.33,-.33],["z"]],w:8.295,h:8.295},"scripts.upbow":{d:[["M",-4.65,-15.54],["c",.12,-.09,.36,-.06,.48,.03],["c",.03,.03,.09,.09,.12,.15],["c",.03,.06,.66,2.13,1.41,4.62],["c",1.35,4.41,1.38,4.56,2.01,6.96],["l",.63,2.46],["l",.63,-2.46],["c",.63,-2.4,.66,-2.55,2.01,-6.96],["c",.75,-2.49,1.38,-4.56,1.41,-4.62],["c",.06,-.15,.18,-.21,.36,-.24],["c",.15,0,.3,.06,.39,.18],["c",.15,.21,.24,-.18,-2.1,7.56],["c",-1.2,3.96,-2.22,7.32,-2.25,7.41],["c",0,.12,-.06,.27,-.09,.3],["c",-.12,.21,-.6,.21,-.72,0],["c",-.03,-.03,-.09,-.18,-.09,-.3],["c",-.03,-.09,-1.05,-3.45,-2.25,-7.41],["c",-2.34,-7.74,-2.25,-7.35,-2.1,-7.56],["c",.03,-.03,.09,-.09,.15,-.12],["z"]],w:9.73,h:15.608},"scripts.downbow":{d:[["M",-5.55,-9.93],["l",.09,-.06],["l",5.46,0],["l",5.46,0],["l",.09,.06],["l",.06,.09],["l",0,4.77],["c",0,5.28,0,4.89,-.18,5.01],["c",-.18,.12,-.42,.06,-.54,-.12],["c",-.06,-.09,-.06,-.18,-.06,-2.97],["l",0,-2.85],["l",-4.83,0],["l",-4.83,0],["l",0,2.85],["c",0,2.79,0,2.88,-.06,2.97],["c",-.15,.24,-.51,.24,-.66,0],["c",-.06,-.09,-.06,-.21,-.06,-4.89],["l",0,-4.77],["z"]],w:11.22,h:9.992},"scripts.turn":{d:[["M",-4.77,-3.9],["c",.36,-.06,1.05,-.06,1.44,.03],["c",.78,.15,1.5,.51,2.34,1.14],["c",.6,.45,1.05,.87,2.22,2.01],["c",1.11,1.08,1.62,1.5,2.22,1.86],["c",.6,.36,1.32,.57,1.92,.57],["c",.9,0,1.71,-.57,1.89,-1.35],["c",.24,-.93,-.39,-1.89,-1.35,-2.1],["l",-.15,-.06],["l",-.09,.15],["c",-.03,.09,-.15,.24,-.24,.33],["c",-.72,.72,-2.04,.54,-2.49,-.36],["c",-.48,-.93,.03,-1.86,1.17,-2.19],["c",.3,-.09,1.02,-.09,1.35,0],["c",.99,.27,1.74,.87,2.25,1.83],["c",.69,1.41,.63,3,-.21,4.26],["c",-.21,.3,-.69,.81,-.99,1.02],["c",-.3,.21,-.84,.45,-1.17,.54],["c",-1.23,.36,-2.49,.15,-3.72,-.6],["c",-.75,-.48,-1.41,-1.02,-2.85,-2.46],["c",-1.11,-1.08,-1.62,-1.5,-2.22,-1.86],["c",-.6,-.36,-1.32,-.57,-1.92,-.57],["c",-.9,0,-1.71,.57,-1.89,1.35],["c",-.24,.93,.39,1.89,1.35,2.1],["l",.15,.06],["l",.09,-.15],["c",.03,-.09,.15,-.24,.24,-.33],["c",.72,-.72,2.04,-.54,2.49,.36],["c",.48,.93,-.03,1.86,-1.17,2.19],["c",-.3,.09,-1.02,.09,-1.35,0],["c",-.99,-.27,-1.74,-.87,-2.25,-1.83],["c",-.69,-1.41,-.63,-3,.21,-4.26],["c",.21,-.3,.69,-.81,.99,-1.02],["c",.48,-.33,1.11,-.57,1.74,-.66],["z"]],w:16.366,h:7.893},"scripts.trill":{d:[["M",-.51,-16.02],["c",.12,-.09,.21,-.18,.21,-.18],["l",-.81,4.02],["l",-.81,4.02],["c",.03,0,.51,-.27,1.08,-.6],["c",.6,-.3,1.14,-.63,1.26,-.66],["c",1.14,-.54,2.31,-.6,3.09,-.18],["c",.27,.15,.54,.36,.6,.51],["l",.06,.12],["l",.21,-.21],["c",.9,-.81,2.22,-.99,3.12,-.42],["c",.6,.42,.9,1.14,.78,2.07],["c",-.15,1.29,-1.05,2.31,-1.95,2.25],["c",-.48,-.03,-.78,-.3,-.96,-.81],["c",-.09,-.27,-.09,-.9,-.03,-1.2],["c",.21,-.75,.81,-1.23,1.59,-1.32],["l",.24,-.03],["l",-.09,-.12],["c",-.51,-.66,-1.62,-.63,-2.31,.03],["c",-.39,.42,-.3,.09,-1.23,4.77],["l",-.81,4.14],["c",-.03,0,-.12,-.03,-.21,-.09],["c",-.33,-.15,-.54,-.18,-.99,-.18],["c",-.42,0,-.66,.03,-1.05,.18],["c",-.12,.06,-.21,.09,-.21,.09],["c",0,-.03,.36,-1.86,.81,-4.11],["c",.9,-4.47,.87,-4.26,.69,-4.53],["c",-.21,-.36,-.66,-.51,-1.17,-.36],["c",-.15,.06,-2.22,1.14,-2.58,1.38],["c",-.12,.09,-.12,.09,-.21,.6],["l",-.09,.51],["l",.21,.24],["c",.63,.75,1.02,1.47,1.2,2.19],["c",.06,.27,.06,.36,.06,.81],["c",0,.42,0,.54,-.06,.78],["c",-.15,.54,-.33,.93,-.63,1.35],["c",-.18,.24,-.57,.63,-.81,.78],["c",-.24,.15,-.63,.36,-.84,.42],["c",-.27,.06,-.66,.06,-.87,.03],["c",-.81,-.18,-1.32,-1.05,-1.38,-2.46],["c",-.03,-.6,.03,-.99,.33,-2.46],["c",.21,-1.08,.24,-1.32,.21,-1.29],["c",-1.2,.48,-2.4,.75,-3.21,.72],["c",-.69,-.06,-1.17,-.3,-1.41,-.72],["c",-.39,-.75,-.12,-1.8,.66,-2.46],["c",.24,-.18,.69,-.42,1.02,-.51],["c",.69,-.18,1.53,-.15,2.31,.09],["c",.3,.09,.75,.3,.99,.45],["c",.12,.09,.15,.09,.15,.03],["c",.03,-.03,.33,-1.59,.72,-3.45],["c",.36,-1.86,.66,-3.42,.69,-3.45],["c",0,-.03,.03,-.03,.21,.03],["c",.21,.06,.27,.06,.48,.06],["c",.42,-.03,.78,-.18,1.26,-.48],["c",.15,-.12,.36,-.27,.48,-.39],["z"],["m",-5.73,7.68],["c",-.27,-.03,-.96,-.06,-1.2,-.03],["c",-.81,.12,-1.35,.57,-1.5,1.2],["c",-.18,.66,.12,1.14,.75,1.29],["c",.66,.12,1.92,-.12,3.18,-.66],["l",.33,-.15],["l",.09,-.39],["c",.06,-.21,.09,-.42,.09,-.45],["c",0,-.03,-.45,-.3,-.75,-.45],["c",-.27,-.15,-.66,-.27,-.99,-.36],["z"],["m",4.29,3.63],["c",-.24,-.39,-.51,-.75,-.51,-.69],["c",-.06,.12,-.39,1.92,-.45,2.28],["c",-.09,.54,-.12,1.14,-.06,1.38],["c",.06,.42,.21,.6,.51,.57],["c",.39,-.06,.75,-.48,.93,-1.14],["c",.09,-.33,.09,-1.05,0,-1.38],["c",-.09,-.39,-.24,-.69,-.42,-1.02],["z"]],w:17.963,h:16.49},"scripts.segno":{d:[["M",-3.72,-11.22],["c",.78,-.09,1.59,.03,2.31,.42],["c",1.2,.6,2.01,1.71,2.31,3.09],["c",.09,.42,.09,1.2,.03,1.5],["c",-.15,.45,-.39,.81,-.66,.93],["c",-.33,.18,-.84,.21,-1.23,.15],["c",-.81,-.18,-1.32,-.93,-1.26,-1.89],["c",.03,-.36,.09,-.57,.24,-.9],["c",.15,-.33,.45,-.6,.72,-.75],["c",.12,-.06,.18,-.09,.18,-.12],["c",0,-.03,-.03,-.15,-.09,-.24],["c",-.18,-.45,-.54,-.87,-.96,-1.08],["c",-1.11,-.57,-2.34,-.18,-2.88,.9],["c",-.24,.51,-.33,1.11,-.24,1.83],["c",.27,1.92,1.5,3.54,3.93,5.13],["c",.48,.33,1.26,.78,1.29,.78],["c",.03,0,1.35,-2.19,2.94,-4.89],["l",2.88,-4.89],["l",.84,0],["l",.87,0],["l",-.03,.06],["c",-.15,.21,-6.15,10.41,-6.15,10.44],["c",0,0,.21,.15,.48,.27],["c",2.61,1.47,4.35,3.03,5.13,4.65],["c",1.14,2.34,.51,5.07,-1.44,6.39],["c",-.66,.42,-1.32,.63,-2.13,.69],["c",-2.01,.09,-3.81,-1.41,-4.26,-3.54],["c",-.09,-.42,-.09,-1.2,-.03,-1.5],["c",.15,-.45,.39,-.81,.66,-.93],["c",.33,-.18,.84,-.21,1.23,-.15],["c",.81,.18,1.32,.93,1.26,1.89],["c",-.03,.36,-.09,.57,-.24,.9],["c",-.15,.33,-.45,.6,-.72,.75],["c",-.12,.06,-.18,.09,-.18,.12],["c",0,.03,.03,.15,.09,.24],["c",.18,.45,.54,.87,.96,1.08],["c",1.11,.57,2.34,.18,2.88,-.9],["c",.24,-.51,.33,-1.11,.24,-1.83],["c",-.27,-1.92,-1.5,-3.54,-3.93,-5.13],["c",-.48,-.33,-1.26,-.78,-1.29,-.78],["c",-.03,0,-1.35,2.19,-2.91,4.89],["l",-2.88,4.89],["l",-.87,0],["l",-.87,0],["l",.03,-.06],["c",.15,-.21,6.15,-10.41,6.15,-10.44],["c",0,0,-.21,-.15,-.48,-.3],["c",-2.61,-1.44,-4.35,-3,-5.13,-4.62],["c",-.9,-1.89,-.72,-4.02,.48,-5.52],["c",.69,-.84,1.68,-1.41,2.73,-1.53],["z"],["m",8.76,9.09],["c",.03,-.03,.15,-.03,.27,-.03],["c",.33,.03,.57,.18,.72,.48],["c",.09,.18,.09,.57,0,.75],["c",-.09,.18,-.21,.3,-.36,.39],["c",-.15,.06,-.21,.06,-.39,.06],["c",-.21,0,-.27,0,-.39,-.06],["c",-.3,-.15,-.48,-.45,-.48,-.75],["c",0,-.39,.24,-.72,.63,-.84],["z"],["m",-10.53,2.61],["c",.03,-.03,.15,-.03,.27,-.03],["c",.33,.03,.57,.18,.72,.48],["c",.09,.18,.09,.57,0,.75],["c",-.09,.18,-.21,.3,-.36,.39],["c",-.15,.06,-.21,.06,-.39,.06],["c",-.21,0,-.27,0,-.39,-.06],["c",-.3,-.15,-.48,-.45,-.48,-.75],["c",0,-.39,.24,-.72,.63,-.84],["z"]],w:15,h:22.504},"scripts.coda":{d:[["M",-.21,-10.47],["c",.18,-.12,.42,-.06,.54,.12],["c",.06,.09,.06,.18,.06,1.5],["l",0,1.38],["l",.18,0],["c",.39,.06,.96,.24,1.38,.48],["c",1.68,.93,2.82,3.24,3.03,6.12],["c",.03,.24,.03,.45,.03,.45],["c",0,.03,.6,.03,1.35,.03],["c",1.5,0,1.47,0,1.59,.18],["c",.09,.12,.09,.3,0,.42],["c",-.12,.18,-.09,.18,-1.59,.18],["c",-.75,0,-1.35,0,-1.35,.03],["c",0,0,0,.21,-.03,.42],["c",-.24,3.15,-1.53,5.58,-3.45,6.36],["c",-.27,.12,-.72,.24,-.96,.27],["l",-.18,0],["l",0,1.38],["c",0,1.32,0,1.41,-.06,1.5],["c",-.15,.24,-.51,.24,-.66,0],["c",-.06,-.09,-.06,-.18,-.06,-1.5],["l",0,-1.38],["l",-.18,0],["c",-.39,-.06,-.96,-.24,-1.38,-.48],["c",-1.68,-.93,-2.82,-3.24,-3.03,-6.15],["c",-.03,-.21,-.03,-.42,-.03,-.42],["c",0,-.03,-.6,-.03,-1.35,-.03],["c",-1.5,0,-1.47,0,-1.59,-.18],["c",-.09,-.12,-.09,-.3,0,-.42],["c",.12,-.18,.09,-.18,1.59,-.18],["c",.75,0,1.35,0,1.35,-.03],["c",0,0,0,-.21,.03,-.45],["c",.24,-3.12,1.53,-5.55,3.45,-6.33],["c",.27,-.12,.72,-.24,.96,-.27],["l",.18,0],["l",0,-1.38],["c",0,-1.53,0,-1.5,.18,-1.62],["z"],["m",-.18,6.93],["c",0,-2.97,0,-3.15,-.06,-3.15],["c",-.09,0,-.51,.15,-.66,.21],["c",-.87,.51,-1.38,1.62,-1.56,3.51],["c",-.06,.54,-.12,1.59,-.12,2.16],["l",0,.42],["l",1.2,0],["l",1.2,0],["l",0,-3.15],["z"],["m",1.17,-3.06],["c",-.09,-.03,-.21,-.06,-.27,-.09],["l",-.12,0],["l",0,3.15],["l",0,3.15],["l",1.2,0],["l",1.2,0],["l",0,-.81],["c",-.06,-2.4,-.33,-3.69,-.93,-4.59],["c",-.27,-.39,-.66,-.69,-1.08,-.81],["z"],["m",-1.17,10.14],["l",0,-3.15],["l",-1.2,0],["l",-1.2,0],["l",0,.81],["c",.03,.96,.06,1.47,.15,2.13],["c",.24,2.04,.96,3.12,2.13,3.36],["l",.12,0],["l",0,-3.15],["z"],["m",3.18,-2.34],["l",0,-.81],["l",-1.2,0],["l",-1.2,0],["l",0,3.15],["l",0,3.15],["l",.12,0],["c",1.17,-.24,1.89,-1.32,2.13,-3.36],["c",.09,-.66,.12,-1.17,.15,-2.13],["z"]],w:16.035,h:21.062},"scripts.comma":{d:[["M",1.14,-4.62],["c",.3,-.12,.69,-.03,.93,.15],["c",.12,.12,.36,.45,.51,.78],["c",.9,1.77,.54,4.05,-1.08,6.75],["c",-.36,.63,-.87,1.38,-.96,1.44],["c",-.18,.12,-.42,.06,-.54,-.12],["c",-.09,-.18,-.09,-.3,.12,-.6],["c",.96,-1.44,1.44,-2.97,1.38,-4.35],["c",-.06,-.93,-.3,-1.68,-.78,-2.46],["c",-.27,-.39,-.33,-.63,-.24,-.96],["c",.09,-.27,.36,-.54,.66,-.63],["z"]],w:3.042,h:9.237},"scripts.roll":{d:[["M",1.95,-6],["c",.21,-.09,.36,-.09,.57,0],["c",.39,.15,.63,.39,1.47,1.35],["c",.66,.75,.78,.87,1.08,1.05],["c",.75,.45,1.65,.42,2.4,-.06],["c",.12,-.09,.27,-.27,.54,-.6],["c",.42,-.54,.51,-.63,.69,-.63],["c",.09,0,.3,.12,.36,.21],["c",.09,.12,.12,.3,.03,.42],["c",-.06,.12,-3.15,3.9,-3.3,4.08],["c",-.06,.06,-.18,.12,-.27,.18],["c",-.27,.12,-.6,.06,-.99,-.27],["c",-.27,-.21,-.42,-.39,-1.08,-1.14],["c",-.63,-.72,-.81,-.9,-1.17,-1.08],["c",-.36,-.18,-.57,-.21,-.99,-.21],["c",-.39,0,-.63,.03,-.93,.18],["c",-.36,.15,-.51,.27,-.9,.81],["c",-.24,.27,-.45,.51,-.48,.54],["c",-.12,.09,-.27,.06,-.39,0],["c",-.24,-.15,-.33,-.39,-.21,-.6],["c",.09,-.12,3.18,-3.87,3.33,-4.02],["c",.06,-.06,.18,-.15,.24,-.21],["z"]],w:10.817,h:6.125},"scripts.prall":{d:[["M",-4.38,-3.69],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["c",.03,0,.57,-.84,1.23,-1.83],["c",1.14,-1.68,1.23,-1.83,1.35,-1.89],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["l",.48,-.69],["c",.51,-.78,.54,-.84,.69,-.9],["c",.42,-.18,.87,.15,.81,.6],["c",-.03,.12,-.3,.51,-1.5,2.37],["c",-1.38,2.07,-1.5,2.22,-1.62,2.28],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["c",-.03,0,-.57,.84,-1.23,1.83],["c",-1.14,1.68,-1.23,1.83,-1.35,1.89],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["l",-.48,.69],["c",-.51,.78,-.54,.84,-.69,.9],["c",-.42,.18,-.87,-.15,-.81,-.6],["c",.03,-.12,.3,-.51,1.5,-2.37],["c",1.38,-2.07,1.5,-2.22,1.62,-2.28],["z"]],w:15.011,h:7.5},"scripts.arpeggio":{d:[["M",1.5,0],["c",1.5,2,1.5,3,1.5,3],["s",0,1,-2,1.5],["s",-.5,3,1,5.5],["l",1.5,0],["s",-1.75,-2,-1.9,-3.25],["s",2.15,-.6,2.95,-1.6],["s",.45,-1,.5,-1.25],["s",0,-1,-2,-3.9],["l",-1.5,0],["z"]],w:5,h:10},"scripts.mordent":{d:[["M",-.21,-4.95],["c",.27,-.15,.63,0,.75,.27],["c",.06,.12,.06,.24,.06,1.44],["l",0,1.29],["l",.57,-.84],["c",.51,-.75,.57,-.84,.69,-.9],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["l",.48,-.69],["c",.51,-.78,.54,-.84,.69,-.9],["c",.42,-.18,.87,.15,.81,.6],["c",-.03,.12,-.3,.51,-1.5,2.37],["c",-1.38,2.07,-1.5,2.22,-1.62,2.28],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.83,-1.89],["c",-.81,-.99,-1.5,-1.8,-1.53,-1.86],["c",-.06,-.03,-.06,-.03,-.12,.03],["c",-.06,.06,-.06,.15,-.06,2.28],["c",0,1.95,0,2.25,-.06,2.34],["c",-.18,.45,-.81,.48,-1.05,.03],["c",-.03,-.06,-.06,-.24,-.06,-1.41],["l",0,-1.35],["l",-.57,.84],["c",-.54,.78,-.6,.87,-.72,.93],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["l",-.48,.69],["c",-.51,.78,-.54,.84,-.69,.9],["c",-.42,.18,-.87,-.15,-.81,-.6],["c",.03,-.12,.3,-.51,1.5,-2.37],["c",1.38,-2.07,1.5,-2.22,1.62,-2.28],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["c",.03,0,.06,-.06,.09,-.09],["c",.06,-.12,.06,-.15,.06,-2.28],["c",0,-1.92,0,-2.22,.06,-2.31],["c",.06,-.15,.15,-.24,.3,-.3],["z"]],w:15.011,h:10.012},"flags.u8th":{d:[["M",-.42,3.75],["l",0,-3.75],["l",.21,0],["l",.21,0],["l",0,.18],["c",0,.3,.06,.84,.12,1.23],["c",.24,1.53,.9,3.12,2.13,5.16],["l",.99,1.59],["c",.87,1.44,1.38,2.34,1.77,3.09],["c",.81,1.68,1.2,3.06,1.26,4.53],["c",.03,1.53,-.21,3.27,-.75,5.01],["c",-.21,.69,-.51,1.5,-.6,1.59],["c",-.09,.12,-.27,.21,-.42,.21],["c",-.15,0,-.42,-.12,-.51,-.21],["c",-.15,-.18,-.18,-.42,-.09,-.66],["c",.15,-.33,.45,-1.2,.57,-1.62],["c",.42,-1.38,.6,-2.58,.6,-3.9],["c",0,-.66,0,-.81,-.06,-1.11],["c",-.39,-2.07,-1.8,-4.26,-4.59,-7.14],["l",-.42,-.45],["l",-.21,0],["l",-.21,0],["l",0,-3.75],["z"]],w:6.692,h:22.59},"flags.u16th":{d:[["M",-.42,7.5],["l",0,-7.5],["l",.21,0],["l",.21,0],["l",0,.39],["c",.06,1.08,.39,2.19,.99,3.39],["c",.45,.9,.87,1.59,1.95,3.12],["c",1.29,1.86,1.77,2.64,2.22,3.57],["c",.45,.93,.72,1.8,.87,2.64],["c",.06,.51,.06,1.5,0,1.92],["c",-.12,.6,-.3,1.2,-.54,1.71],["l",-.09,.24],["l",.18,.45],["c",.51,1.2,.72,2.22,.69,3.42],["c",-.06,1.53,-.39,3.03,-.99,4.53],["c",-.3,.75,-.36,.81,-.57,.9],["c",-.15,.09,-.33,.06,-.48,0],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.12,-.75],["c",.66,-1.41,1.02,-2.88,1.08,-4.32],["c",0,-.6,-.03,-1.05,-.18,-1.59],["c",-.3,-1.2,-.99,-2.4,-2.25,-3.87],["c",-.42,-.48,-1.53,-1.62,-2.19,-2.22],["l",-.45,-.42],["l",-.03,1.11],["l",0,1.11],["l",-.21,0],["l",-.21,0],["l",0,-7.5],["z"],["m",1.65,.09],["c",-.3,-.3,-.69,-.72,-.9,-.87],["l",-.33,-.33],["l",0,.15],["c",0,.3,.06,.81,.15,1.26],["c",.27,1.29,.87,2.61,2.04,4.29],["c",.15,.24,.6,.87,.96,1.38],["l",1.08,1.53],["l",.42,.63],["c",.03,0,.12,-.36,.21,-.72],["c",.06,-.33,.06,-1.2,0,-1.62],["c",-.33,-1.71,-1.44,-3.48,-3.63,-5.7],["z"]],w:6.693,h:26.337},"flags.u32nd":{d:[["M",-.42,11.25],["l",0,-11.25],["l",.21,0],["l",.21,0],["l",0,.36],["c",.09,1.68,.69,3.27,2.07,5.46],["l",.87,1.35],["c",1.02,1.62,1.47,2.37,1.86,3.18],["c",.48,1.02,.78,1.92,.93,2.88],["c",.06,.48,.06,1.5,0,1.89],["c",-.09,.42,-.21,.87,-.36,1.26],["l",-.12,.3],["l",.15,.39],["c",.69,1.56,.84,2.88,.54,4.38],["c",-.09,.45,-.27,1.08,-.45,1.47],["l",-.12,.24],["l",.18,.36],["c",.33,.72,.57,1.56,.69,2.34],["c",.12,1.02,-.06,2.52,-.42,3.84],["c",-.27,.93,-.75,2.13,-.93,2.31],["c",-.18,.15,-.45,.18,-.66,.09],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.06,-.6],["c",.21,-.36,.42,-.9,.57,-1.38],["c",.51,-1.41,.69,-3.06,.48,-4.08],["c",-.15,-.81,-.57,-1.68,-1.2,-2.55],["c",-.72,-.99,-1.83,-2.13,-3.3,-3.33],["l",-.48,-.42],["l",-.03,1.53],["l",0,1.56],["l",-.21,0],["l",-.21,0],["l",0,-11.25],["z"],["m",1.26,-3.96],["c",-.27,-.3,-.54,-.6,-.66,-.72],["l",-.18,-.21],["l",0,.42],["c",.06,.87,.24,1.74,.66,2.67],["c",.36,.87,.96,1.86,1.92,3.18],["c",.21,.33,.63,.87,.87,1.23],["c",.27,.39,.6,.84,.75,1.08],["l",.27,.39],["l",.03,-.12],["c",.12,-.45,.15,-1.05,.09,-1.59],["c",-.27,-1.86,-1.38,-3.78,-3.75,-6.33],["z"],["m",-.27,6.09],["c",-.27,-.21,-.48,-.42,-.51,-.45],["c",-.06,-.03,-.06,-.03,-.06,.21],["c",0,.9,.3,2.04,.81,3.09],["c",.48,1.02,.96,1.77,2.37,3.63],["c",.6,.78,1.05,1.44,1.29,1.77],["c",.06,.12,.15,.21,.15,.18],["c",.03,-.03,.18,-.57,.24,-.87],["c",.06,-.45,.06,-1.32,-.03,-1.74],["c",-.09,-.48,-.24,-.9,-.51,-1.44],["c",-.66,-1.35,-1.83,-2.7,-3.75,-4.38],["z"]],w:6.697,h:32.145},"flags.u64th":{d:[["M",-.42,15],["l",0,-15],["l",.21,0],["l",.21,0],["l",0,.36],["c",.06,1.2,.39,2.37,1.02,3.66],["c",.39,.81,.84,1.56,1.8,3.09],["c",.81,1.26,1.05,1.68,1.35,2.22],["c",.87,1.5,1.35,2.79,1.56,4.08],["c",.06,.54,.06,1.56,-.03,2.04],["c",-.09,.48,-.21,.99,-.36,1.35],["l",-.12,.27],["l",.12,.27],["c",.09,.15,.21,.45,.27,.66],["c",.69,1.89,.63,3.66,-.18,5.46],["l",-.18,.39],["l",.15,.33],["c",.3,.66,.51,1.44,.63,2.1],["c",.06,.48,.06,1.35,0,1.71],["c",-.15,.57,-.42,1.2,-.78,1.68],["l",-.21,.27],["l",.18,.33],["c",.57,1.05,.93,2.13,1.02,3.18],["c",.06,.72,0,1.83,-.21,2.79],["c",-.18,1.02,-.63,2.34,-1.02,3.09],["c",-.15,.33,-.48,.45,-.78,.3],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.03,-.54],["c",.75,-1.5,1.23,-3.45,1.17,-4.89],["c",-.06,-1.02,-.42,-2.01,-1.17,-3.15],["c",-.48,-.72,-1.02,-1.35,-1.89,-2.22],["c",-.57,-.57,-1.56,-1.5,-1.92,-1.77],["l",-.12,-.09],["l",0,1.68],["l",0,1.68],["l",-.21,0],["l",-.21,0],["l",0,-15],["z"],["m",.93,-8.07],["c",-.27,-.3,-.48,-.54,-.51,-.54],["c",0,0,0,.69,.03,1.02],["c",.15,1.47,.75,2.94,2.04,4.83],["l",1.08,1.53],["c",.39,.57,.84,1.2,.99,1.44],["c",.15,.24,.3,.45,.3,.45],["c",0,0,.03,-.09,.06,-.21],["c",.36,-1.59,-.15,-3.33,-1.47,-5.4],["c",-.63,-.93,-1.35,-1.83,-2.52,-3.12],["z"],["m",.06,6.72],["c",-.24,-.21,-.48,-.42,-.51,-.45],["l",-.06,-.06],["l",0,.33],["c",0,1.2,.3,2.34,.93,3.6],["c",.45,.9,.96,1.68,2.25,3.51],["c",.39,.54,.84,1.17,1.02,1.44],["c",.21,.33,.33,.51,.33,.48],["c",.06,-.09,.21,-.63,.3,-.99],["c",.06,-.33,.06,-.45,.06,-.96],["c",0,-.6,-.03,-.84,-.18,-1.35],["c",-.3,-1.08,-1.02,-2.28,-2.13,-3.57],["c",-.39,-.45,-1.44,-1.47,-2.01,-1.98],["z"],["m",0,6.72],["c",-.24,-.21,-.48,-.39,-.51,-.42],["l",-.06,-.06],["l",0,.33],["c",0,1.41,.45,2.82,1.38,4.35],["c",.42,.72,.72,1.14,1.86,2.73],["c",.36,.45,.75,.99,.87,1.2],["c",.15,.21,.3,.36,.3,.36],["c",.06,0,.3,-.48,.39,-.75],["c",.09,-.36,.12,-.63,.12,-1.05],["c",-.06,-1.05,-.45,-2.04,-1.2,-3.18],["c",-.57,-.87,-1.11,-1.53,-2.07,-2.49],["c",-.36,-.33,-.84,-.78,-1.08,-1.02],["z"]],w:6.682,h:39.694},"flags.d8th":{d:[["M",5.67,-21.63],["c",.24,-.12,.54,-.06,.69,.15],["c",.06,.06,.21,.36,.39,.66],["c",.84,1.77,1.26,3.36,1.32,5.1],["c",.03,1.29,-.21,2.37,-.81,3.63],["c",-.6,1.23,-1.26,2.13,-3.21,4.38],["c",-1.35,1.53,-1.86,2.19,-2.4,2.97],["c",-.63,.93,-1.11,1.92,-1.38,2.79],["c",-.15,.54,-.27,1.35,-.27,1.8],["l",0,.15],["l",-.21,0],["l",-.21,0],["l",0,-3.75],["l",0,-3.75],["l",.21,0],["l",.21,0],["l",.48,-.3],["c",1.83,-1.11,3.12,-2.1,4.17,-3.12],["c",.78,-.81,1.32,-1.53,1.71,-2.31],["c",.45,-.93,.6,-1.74,.51,-2.88],["c",-.12,-1.56,-.63,-3.18,-1.47,-4.68],["c",-.12,-.21,-.15,-.33,-.06,-.51],["c",.06,-.15,.15,-.24,.33,-.33],["z"]],w:8.492,h:21.691},"flags.ugrace":{d:[["M",6.03,6.93],["c",.15,-.09,.33,-.06,.51,0],["c",.15,.09,.21,.15,.3,.33],["c",.09,.18,.06,.39,-.03,.54],["c",-.06,.15,-10.89,8.88,-11.07,8.97],["c",-.15,.09,-.33,.06,-.48,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.06,-.39,.03,-.54],["c",.06,-.15,10.89,-8.88,11.07,-8.97],["z"]],w:12.019,h:9.954},"flags.dgrace":{d:[["M",-6.06,-15.93],["c",.18,-.09,.33,-.12,.48,-.06],["c",.18,.09,14.01,8.04,14.1,8.1],["c",.12,.12,.18,.33,.18,.51],["c",-.03,.21,-.15,.39,-.36,.48],["c",-.18,.09,-.33,.12,-.48,.06],["c",-.18,-.09,-14.01,-8.04,-14.1,-8.1],["c",-.12,-.12,-.18,-.33,-.18,-.51],["c",.03,-.21,.15,-.39,.36,-.48],["z"]],w:15.12,h:9.212},"flags.d16th":{d:[["M",6.84,-22.53],["c",.27,-.12,.57,-.06,.72,.15],["c",.15,.15,.33,.87,.45,1.56],["c",.06,.33,.06,1.35,0,1.65],["c",-.06,.33,-.15,.78,-.27,1.11],["c",-.12,.33,-.45,.96,-.66,1.32],["l",-.18,.27],["l",.09,.18],["c",.48,1.02,.72,2.25,.69,3.3],["c",-.06,1.23,-.42,2.28,-1.26,3.45],["c",-.57,.87,-.99,1.32,-3,3.39],["c",-1.56,1.56,-2.22,2.4,-2.76,3.45],["c",-.42,.84,-.66,1.8,-.66,2.55],["l",0,.15],["l",-.21,0],["l",-.21,0],["l",0,-7.5],["l",0,-7.5],["l",.21,0],["l",.21,0],["l",0,1.14],["l",0,1.11],["l",.27,-.15],["c",1.11,-.57,1.77,-.99,2.52,-1.47],["c",2.37,-1.56,3.69,-3.15,4.05,-4.83],["c",.03,-.18,.03,-.39,.03,-.78],["c",0,-.6,-.03,-.93,-.24,-1.5],["c",-.06,-.18,-.12,-.39,-.15,-.45],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.63,7.5],["c",-.06,-.18,-.15,-.36,-.15,-.36],["c",-.03,0,-.03,.03,-.06,.06],["c",-.06,.12,-.96,1.02,-1.95,1.98],["c",-.63,.57,-1.26,1.17,-1.44,1.35],["c",-1.53,1.62,-2.28,2.85,-2.55,4.32],["c",-.03,.18,-.03,.54,-.06,.99],["l",0,.69],["l",.18,-.09],["c",.93,-.54,2.1,-1.29,2.82,-1.83],["c",.69,-.51,1.02,-.81,1.53,-1.29],["c",1.86,-1.89,2.37,-3.66,1.68,-5.82],["z"]],w:8.475,h:22.591},"flags.d32nd":{d:[["M",6.84,-29.13],["c",.27,-.12,.57,-.06,.72,.15],["c",.12,.12,.27,.63,.36,1.11],["c",.33,1.59,.06,3.06,-.81,4.47],["l",-.18,.27],["l",.09,.15],["c",.12,.24,.33,.69,.45,1.05],["c",.63,1.83,.45,3.57,-.57,5.22],["l",-.18,.3],["l",.15,.27],["c",.42,.87,.6,1.71,.57,2.61],["c",-.06,1.29,-.48,2.46,-1.35,3.78],["c",-.54,.81,-.93,1.29,-2.46,3],["c",-.51,.54,-1.05,1.17,-1.26,1.41],["c",-1.56,1.86,-2.25,3.36,-2.37,5.01],["l",0,.33],["l",-.21,0],["l",-.21,0],["l",0,-11.25],["l",0,-11.25],["l",.21,0],["l",.21,0],["l",0,1.35],["l",.03,1.35],["l",.78,-.39],["c",1.38,-.69,2.34,-1.26,3.24,-1.92],["c",1.38,-1.02,2.28,-2.13,2.64,-3.21],["c",.15,-.48,.18,-.72,.18,-1.29],["c",0,-.57,-.06,-.9,-.24,-1.47],["c",-.06,-.18,-.12,-.39,-.15,-.45],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.63,7.2],["c",-.09,-.18,-.12,-.21,-.12,-.15],["c",-.03,.09,-1.02,1.08,-2.04,2.04],["c",-1.17,1.08,-1.65,1.56,-2.07,2.04],["c",-.84,.96,-1.38,1.86,-1.68,2.76],["c",-.21,.57,-.27,.99,-.3,1.65],["l",0,.54],["l",.66,-.33],["c",3.57,-1.86,5.49,-3.69,5.94,-5.7],["c",.06,-.39,.06,-1.2,-.03,-1.65],["c",-.06,-.39,-.24,-.9,-.36,-1.2],["z"],["m",-.06,7.2],["c",-.06,-.15,-.12,-.33,-.15,-.45],["l",-.06,-.18],["l",-.18,.21],["l",-1.83,1.83],["c",-.87,.9,-1.77,1.8,-1.95,2.01],["c",-1.08,1.29,-1.62,2.31,-1.89,3.51],["c",-.06,.3,-.06,.51,-.09,.93],["l",0,.57],["l",.09,-.06],["c",.75,-.45,1.89,-1.26,2.52,-1.74],["c",.81,-.66,1.74,-1.53,2.22,-2.16],["c",1.26,-1.53,1.68,-3.06,1.32,-4.47],["z"]],w:8.385,h:29.191},"flags.d64th":{d:[["M",7.08,-32.88],["c",.3,-.12,.66,-.03,.78,.24],["c",.18,.33,.27,2.1,.15,2.64],["c",-.09,.39,-.21,.78,-.39,1.08],["l",-.15,.3],["l",.09,.27],["c",.03,.12,.09,.45,.12,.69],["c",.27,1.44,.18,2.55,-.3,3.6],["l",-.12,.33],["l",.06,.42],["c",.27,1.35,.33,2.82,.21,3.63],["c",-.12,.6,-.3,1.23,-.57,1.8],["l",-.15,.27],["l",.03,.42],["c",.06,1.02,.06,2.7,.03,3.06],["c",-.15,1.47,-.66,2.76,-1.74,4.41],["c",-.45,.69,-.75,1.11,-1.74,2.37],["c",-1.05,1.38,-1.5,1.98,-1.95,2.73],["c",-.93,1.5,-1.38,2.82,-1.44,4.2],["l",0,.42],["l",-.21,0],["l",-.21,0],["l",0,-15],["l",0,-15],["l",.21,0],["l",.21,0],["l",0,1.86],["l",0,1.89],["c",0,0,.21,-.03,.45,-.09],["c",2.22,-.39,4.08,-1.11,5.19,-2.01],["c",.63,-.54,1.02,-1.14,1.2,-1.8],["c",.06,-.3,.06,-1.14,-.03,-1.65],["c",-.03,-.18,-.06,-.39,-.09,-.48],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.45,6.15],["c",-.03,-.18,-.06,-.42,-.06,-.54],["l",-.03,-.18],["l",-.33,.3],["c",-.42,.36,-.87,.72,-1.68,1.29],["c",-1.98,1.38,-2.25,1.59,-2.85,2.16],["c",-.75,.69,-1.23,1.44,-1.47,2.19],["c",-.15,.45,-.18,.63,-.21,1.35],["l",0,.66],["l",.39,-.18],["c",1.83,-.9,3.45,-1.95,4.47,-2.91],["c",.93,-.9,1.53,-1.83,1.74,-2.82],["c",.06,-.33,.06,-.87,.03,-1.32],["z"],["m",-.27,4.86],["c",-.03,-.21,-.06,-.36,-.06,-.36],["c",0,-.03,-.12,.09,-.24,.24],["c",-.39,.48,-.99,1.08,-2.16,2.19],["c",-1.47,1.38,-1.92,1.83,-2.46,2.49],["c",-.66,.87,-1.08,1.74,-1.29,2.58],["c",-.09,.42,-.15,.87,-.15,1.44],["l",0,.54],["l",.48,-.33],["c",1.5,-1.02,2.58,-1.89,3.51,-2.82],["c",1.47,-1.47,2.25,-2.85,2.4,-4.26],["c",.03,-.39,.03,-1.17,-.03,-1.71],["z"],["m",-.66,7.68],["c",.03,-.15,.03,-.6,.03,-.99],["l",0,-.72],["l",-.27,.33],["l",-1.74,1.98],["c",-1.77,1.92,-2.43,2.76,-2.97,3.9],["c",-.51,1.02,-.72,1.77,-.75,2.91],["c",0,.63,0,.63,.06,.6],["c",.03,-.03,.3,-.27,.63,-.54],["c",.66,-.6,1.86,-1.8,2.31,-2.31],["c",1.65,-1.89,2.52,-3.54,2.7,-5.16],["z"]],w:8.485,h:32.932},"clefs.C":{d:[["M",.06,-14.94],["l",.09,-.06],["l",1.92,0],["l",1.92,0],["l",.09,.06],["l",.06,.09],["l",0,14.85],["l",0,14.82],["l",-.06,.09],["l",-.09,.06],["l",-1.92,0],["l",-1.92,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-14.82],["l",0,-14.85],["z"],["m",5.37,0],["c",.09,-.06,.09,-.06,.57,-.06],["c",.45,0,.45,0,.54,.06],["l",.06,.09],["l",0,7.14],["l",0,7.11],["l",.09,-.06],["c",.18,-.18,.72,-.84,.96,-1.2],["c",.3,-.45,.66,-1.17,.84,-1.65],["c",.36,-.9,.57,-1.83,.6,-2.79],["c",.03,-.48,.03,-.54,.09,-.63],["c",.12,-.18,.36,-.21,.54,-.12],["c",.18,.09,.21,.15,.24,.66],["c",.06,.87,.21,1.56,.57,2.22],["c",.51,1.02,1.26,1.68,2.22,1.92],["c",.21,.06,.33,.06,.78,.06],["c",.45,0,.57,0,.84,-.06],["c",.45,-.12,.81,-.33,1.08,-.6],["c",.57,-.57,.87,-1.41,.99,-2.88],["c",.06,-.54,.06,-3,0,-3.57],["c",-.21,-2.58,-.84,-3.87,-2.16,-4.5],["c",-.48,-.21,-1.17,-.36,-1.77,-.36],["c",-.69,0,-1.29,.27,-1.5,.72],["c",-.06,.15,-.06,.21,-.06,.42],["c",0,.24,0,.3,.06,.45],["c",.12,.24,.24,.39,.63,.66],["c",.42,.3,.57,.48,.69,.72],["c",.06,.15,.06,.21,.06,.48],["c",0,.39,-.03,.63,-.21,.96],["c",-.3,.6,-.87,1.08,-1.5,1.26],["c",-.27,.06,-.87,.06,-1.14,0],["c",-.78,-.24,-1.44,-.87,-1.65,-1.68],["c",-.12,-.42,-.09,-1.17,.09,-1.71],["c",.51,-1.65,1.98,-2.82,3.81,-3.09],["c",.84,-.09,2.46,.03,3.51,.27],["c",2.22,.57,3.69,1.8,4.44,3.75],["c",.36,.93,.57,2.13,.57,3.36],["c",0,1.44,-.48,2.73,-1.38,3.81],["c",-1.26,1.5,-3.27,2.43,-5.28,2.43],["c",-.48,0,-.51,0,-.75,-.09],["c",-.15,-.03,-.48,-.21,-.78,-.36],["c",-.69,-.36,-.87,-.42,-1.26,-.42],["c",-.27,0,-.3,0,-.51,.09],["c",-.57,.3,-.81,.9,-.81,2.1],["c",0,1.23,.24,1.83,.81,2.13],["c",.21,.09,.24,.09,.51,.09],["c",.39,0,.57,-.06,1.26,-.42],["c",.3,-.15,.63,-.33,.78,-.36],["c",.24,-.09,.27,-.09,.75,-.09],["c",2.01,0,4.02,.93,5.28,2.4],["c",.9,1.11,1.38,2.4,1.38,3.84],["c",0,1.5,-.3,2.88,-.84,3.96],["c",-.78,1.59,-2.19,2.64,-4.17,3.15],["c",-1.05,.24,-2.67,.36,-3.51,.27],["c",-1.83,-.27,-3.3,-1.44,-3.81,-3.09],["c",-.18,-.54,-.21,-1.29,-.09,-1.74],["c",.15,-.6,.63,-1.2,1.23,-1.47],["c",.36,-.18,.57,-.21,.99,-.21],["c",.42,0,.63,.03,1.02,.21],["c",.42,.21,.84,.63,1.05,1.05],["c",.18,.36,.21,.6,.21,.96],["c",0,.3,0,.36,-.06,.51],["c",-.12,.24,-.27,.42,-.69,.72],["c",-.57,.42,-.69,.63,-.69,1.08],["c",0,.24,0,.3,.06,.45],["c",.12,.21,.3,.39,.57,.54],["c",.42,.18,.87,.21,1.53,.15],["c",1.08,-.15,1.8,-.57,2.34,-1.32],["c",.54,-.75,.84,-1.83,.99,-3.51],["c",.06,-.57,.06,-3.03,0,-3.57],["c",-.12,-1.47,-.42,-2.31,-.99,-2.88],["c",-.27,-.27,-.63,-.48,-1.08,-.6],["c",-.27,-.06,-.39,-.06,-.84,-.06],["c",-.45,0,-.57,0,-.78,.06],["c",-1.14,.27,-2.01,1.17,-2.46,2.49],["c",-.21,.57,-.3,.99,-.33,1.65],["c",-.03,.51,-.06,.57,-.24,.66],["c",-.12,.06,-.27,.06,-.39,0],["c",-.21,-.09,-.21,-.15,-.24,-.75],["c",-.09,-1.92,-.78,-3.72,-2.01,-5.19],["c",-.18,-.21,-.36,-.42,-.39,-.45],["l",-.09,-.06],["l",0,7.11],["l",0,7.14],["l",-.06,.09],["c",-.09,.06,-.09,.06,-.54,.06],["c",-.48,0,-.48,0,-.57,-.06],["l",-.06,-.09],["l",0,-14.82],["l",0,-14.85],["z"]],w:20.31,h:29.97},"clefs.F":{d:[["M",6.3,-7.8],["c",.36,-.03,1.65,0,2.13,.03],["c",3.6,.42,6.03,2.1,6.93,4.86],["c",.27,.84,.36,1.5,.36,2.58],["c",0,.9,-.03,1.35,-.18,2.16],["c",-.78,3.78,-3.54,7.08,-8.37,9.96],["c",-1.74,1.05,-3.87,2.13,-6.18,3.12],["c",-.39,.18,-.75,.33,-.81,.36],["c",-.06,.03,-.15,.06,-.18,.06],["c",-.15,0,-.33,-.18,-.33,-.33],["c",0,-.15,.06,-.21,.51,-.48],["c",3,-1.77,5.13,-3.21,6.84,-4.74],["c",.51,-.45,1.59,-1.5,1.95,-1.95],["c",1.89,-2.19,2.88,-4.32,3.15,-6.78],["c",.06,-.42,.06,-1.77,0,-2.19],["c",-.24,-2.01,-.93,-3.63,-2.04,-4.71],["c",-.63,-.63,-1.29,-1.02,-2.07,-1.2],["c",-1.62,-.39,-3.36,.15,-4.56,1.44],["c",-.54,.6,-1.05,1.47,-1.32,2.22],["l",-.09,.21],["l",.24,-.12],["c",.39,-.21,.63,-.24,1.11,-.24],["c",.3,0,.45,0,.66,.06],["c",1.92,.48,2.85,2.55,1.95,4.38],["c",-.45,.99,-1.41,1.62,-2.46,1.71],["c",-1.47,.09,-2.91,-.87,-3.39,-2.25],["c",-.18,-.57,-.21,-1.32,-.03,-2.28],["c",.39,-2.25,1.83,-4.2,3.81,-5.19],["c",.69,-.36,1.59,-.6,2.37,-.69],["z"],["m",11.58,2.52],["c",.84,-.21,1.71,.3,1.89,1.14],["c",.3,1.17,-.72,2.19,-1.89,1.89],["c",-.99,-.21,-1.5,-1.32,-1.02,-2.25],["c",.18,-.39,.6,-.69,1.02,-.78],["z"],["m",0,7.5],["c",.84,-.21,1.71,.3,1.89,1.14],["c",.21,.87,-.3,1.71,-1.14,1.89],["c",-.87,.21,-1.71,-.3,-1.89,-1.14],["c",-.21,-.84,.3,-1.71,1.14,-1.89],["z"]],w:20.153,h:23.142},"clefs.G":{d:[["M",9.69,-37.41],["c",.09,-.09,.24,-.06,.36,0],["c",.12,.09,.57,.6,.96,1.11],["c",1.77,2.34,3.21,5.85,3.57,8.73],["c",.21,1.56,.03,3.27,-.45,4.86],["c",-.69,2.31,-1.92,4.47,-4.23,7.44],["c",-.3,.39,-.57,.72,-.6,.75],["c",-.03,.06,0,.15,.18,.78],["c",.54,1.68,1.38,4.44,1.68,5.49],["l",.09,.42],["l",.39,0],["c",1.47,.09,2.76,.51,3.96,1.29],["c",1.83,1.23,3.06,3.21,3.39,5.52],["c",.09,.45,.12,1.29,.06,1.74],["c",-.09,1.02,-.33,1.83,-.75,2.73],["c",-.84,1.71,-2.28,3.06,-4.02,3.72],["l",-.33,.12],["l",.03,1.26],["c",0,1.74,-.06,3.63,-.21,4.62],["c",-.45,3.06,-2.19,5.49,-4.47,6.21],["c",-.57,.18,-.9,.21,-1.59,.21],["c",-.69,0,-1.02,-.03,-1.65,-.21],["c",-1.14,-.27,-2.13,-.84,-2.94,-1.65],["c",-.99,-.99,-1.56,-2.16,-1.71,-3.54],["c",-.09,-.81,.06,-1.53,.45,-2.13],["c",.63,-.99,1.83,-1.56,3,-1.53],["c",1.5,.09,2.64,1.32,2.73,2.94],["c",.06,1.47,-.93,2.7,-2.37,2.97],["c",-.45,.06,-.84,.03,-1.29,-.09],["l",-.21,-.09],["l",.09,.12],["c",.39,.54,.78,.93,1.32,1.26],["c",1.35,.87,3.06,1.02,4.35,.36],["c",1.44,-.72,2.52,-2.28,2.97,-4.35],["c",.15,-.66,.24,-1.5,.3,-3.03],["c",.03,-.84,.03,-2.94,0,-3],["c",-.03,0,-.18,0,-.36,.03],["c",-.66,.12,-.99,.12,-1.83,.12],["c",-1.05,0,-1.71,-.06,-2.61,-.3],["c",-4.02,-.99,-7.11,-4.35,-7.8,-8.46],["c",-.12,-.66,-.12,-.99,-.12,-1.83],["c",0,-.84,0,-1.14,.15,-1.92],["c",.36,-2.28,1.41,-4.62,3.3,-7.29],["l",2.79,-3.6],["c",.54,-.66,.96,-1.2,.96,-1.23],["c",0,-.03,-.09,-.33,-.18,-.69],["c",-.96,-3.21,-1.41,-5.28,-1.59,-7.68],["c",-.12,-1.38,-.15,-3.09,-.06,-3.96],["c",.33,-2.67,1.38,-5.07,3.12,-7.08],["c",.36,-.42,.99,-1.05,1.17,-1.14],["z"],["m",2.01,4.71],["c",-.15,-.3,-.3,-.54,-.3,-.54],["c",-.03,0,-.18,.09,-.3,.21],["c",-2.4,1.74,-3.87,4.2,-4.26,7.11],["c",-.06,.54,-.06,1.41,-.03,1.89],["c",.09,1.29,.48,3.12,1.08,5.22],["c",.15,.42,.24,.78,.24,.81],["c",0,.03,.84,-1.11,1.23,-1.68],["c",1.89,-2.73,2.88,-5.07,3.15,-7.53],["c",.09,-.57,.12,-1.74,.06,-2.37],["c",-.09,-1.23,-.27,-1.92,-.87,-3.12],["z"],["m",-2.94,20.7],["c",-.21,-.72,-.39,-1.32,-.42,-1.32],["c",0,0,-1.2,1.47,-1.86,2.37],["c",-2.79,3.63,-4.02,6.3,-4.35,9.3],["c",-.03,.21,-.03,.69,-.03,1.08],["c",0,.69,0,.75,.06,1.11],["c",.12,.54,.27,.99,.51,1.47],["c",.69,1.38,1.83,2.55,3.42,3.42],["c",.96,.54,2.07,.9,3.21,1.08],["c",.78,.12,2.04,.12,2.94,-.03],["c",.51,-.06,.45,-.03,.42,-.3],["c",-.24,-3.33,-.72,-6.33,-1.62,-10.08],["c",-.09,-.39,-.18,-.75,-.18,-.78],["c",-.03,-.03,-.42,0,-.81,.09],["c",-.9,.18,-1.65,.57,-2.22,1.14],["c",-.72,.72,-1.08,1.65,-1.05,2.64],["c",.06,.96,.48,1.83,1.23,2.58],["c",.36,.36,.72,.63,1.17,.9],["c",.33,.18,.36,.21,.42,.33],["c",.18,.42,-.18,.9,-.6,.87],["c",-.18,-.03,-.84,-.36,-1.26,-.63],["c",-.78,-.51,-1.38,-1.11,-1.86,-1.83],["c",-1.77,-2.7,-.99,-6.42,1.71,-8.19],["c",.3,-.21,.81,-.48,1.17,-.63],["c",.3,-.09,1.02,-.3,1.14,-.3],["c",.06,0,.09,0,.09,-.03],["c",.03,-.03,-.51,-1.92,-1.23,-4.26],["z"],["m",3.78,7.41],["c",-.18,-.03,-.36,-.06,-.39,-.06],["c",-.03,0,0,.21,.18,1.02],["c",.75,3.18,1.26,6.3,1.5,9.09],["c",.06,.72,0,.69,.51,.42],["c",.78,-.36,1.44,-.96,1.98,-1.77],["c",1.08,-1.62,1.2,-3.69,.3,-5.55],["c",-.81,-1.62,-2.31,-2.79,-4.08,-3.15],["z"]],w:19.051,h:57.057},"clefs.perc":{d:[["M",5.07,-7.44],["l",.09,-.06],["l",1.53,0],["l",1.53,0],["l",.09,.06],["l",.06,.09],["l",0,7.35],["l",0,7.32],["l",-.06,.09],["l",-.09,.06],["l",-1.53,0],["l",-1.53,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-7.32],["l",0,-7.35],["z"],["m",6.63,0],["l",.09,-.06],["l",1.53,0],["l",1.53,0],["l",.09,.06],["l",.06,.09],["l",0,7.35],["l",0,7.32],["l",-.06,.09],["l",-.09,.06],["l",-1.53,0],["l",-1.53,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-7.32],["l",0,-7.35],["z"]],w:21,h:14.97},"tab.big":{d:[["M",20.16,-21.66],["c",.24,-.09,.66,.09,.78,.36],["c",.09,.21,.09,.24,-.18,.54],["c",-.78,.81,-1.86,1.44,-2.94,1.71],["c",-.87,.24,-1.71,.24,-2.55,.03],["l",-.06,-.03],["l",-.18,.99],["c",-.33,1.98,-.75,4.26,-.96,5.04],["c",-.42,1.65,-1.26,3.18,-2.28,4.14],["c",-.57,.57,-1.17,.9,-1.86,1.08],["c",-.18,.06,-.33,.06,-.66,.06],["c",-.54,0,-.78,-.03,-1.23,-.27],["c",-.39,-.18,-.66,-.39,-1.38,-.99],["c",-.3,-.24,-.66,-.51,-.75,-.57],["c",-.21,-.15,-.27,-.24,-.24,-.45],["c",.06,-.27,.36,-.6,.6,-.66],["c",.18,-.03,.33,.06,.9,.57],["c",.48,.42,.72,.57,.93,.69],["c",.66,.33,1.38,.21,1.95,-.36],["c",.63,-.6,1.05,-1.62,1.23,-3],["c",.03,-.18,.09,-.66,.09,-1.11],["c",.09,-1.56,.33,-3.81,.57,-5.49],["c",.06,-.33,.09,-.63,.09,-.63],["c",-.03,-.03,-.81,-.12,-1.02,-.12],["c",-.57,0,-1.32,.12,-1.8,.33],["c",-.87,.3,-1.35,.78,-1.5,1.41],["c",-.18,.63,.09,1.26,.66,1.65],["c",.12,.06,.15,.12,.18,.24],["c",.09,.27,.06,.57,-.09,.75],["c",-.03,.06,-.12,.09,-.27,.15],["c",-.72,.21,-1.44,.15,-2.1,-.18],["c",-.54,-.27,-.96,-.66,-1.2,-1.14],["c",-.39,-.75,-.33,-1.74,.15,-2.52],["c",.27,-.42,.84,-.93,1.41,-1.23],["c",1.17,-.57,2.88,-.9,4.8,-.9],["c",.69,0,.78,0,1.08,.06],["c",.45,.09,1.11,.3,2.07,.6],["c",1.47,.48,1.83,.57,2.55,.54],["c",1.02,-.06,2.04,-.45,2.94,-1.11],["c",.12,-.09,.24,-.18,.27,-.18],["z"],["m",-5.88,13.05],["c",.21,-.03,.81,0,1.08,.06],["c",.48,.12,.9,.42,.99,.69],["c",.03,.09,.03,.15,0,.27],["c",0,.09,-.03,.57,-.06,1.08],["c",-.09,2.19,-.24,5.76,-.39,8.28],["c",-.06,1.53,-.06,1.77,.03,2.01],["c",.09,.18,.15,.24,.3,.3],["c",.24,.12,.54,.06,1.23,-.27],["c",.57,-.27,.66,-.3,.75,-.24],["c",.09,.06,.18,.3,.18,.45],["c",0,.33,-.15,.51,-.45,.63],["c",-.12,.03,-.39,.15,-.6,.27],["c",-1.17,.6,-1.38,.69,-1.8,.72],["c",-.45,.03,-.78,-.09,-1.08,-.39],["c",-.39,-.42,-.66,-1.2,-1.02,-3.12],["c",-.24,-1.23,-.36,-2.07,-.54,-3.75],["l",0,-.18],["l",-.36,.45],["c",-.6,.75,-1.32,1.59,-1.95,2.25],["c",-.15,.18,-.27,.3,-.27,.33],["c",0,0,.06,.09,.15,.18],["c",.24,.33,.6,.57,1.05,.69],["c",.18,.06,.3,.06,.69,.06],["l",.48,.03],["l",.06,.12],["c",.15,.27,.03,.72,-.21,.9],["c",-.18,.12,-.93,.27,-1.41,.27],["c",-.84,0,-1.59,-.3,-1.98,-.84],["l",-.12,-.15],["l",-.45,.42],["c",-.99,.87,-1.53,1.32,-2.16,1.74],["c",-.78,.51,-1.5,.84,-2.1,.93],["c",-.69,.12,-1.2,.03,-1.95,-.42],["c",-.21,-.12,-.51,-.27,-.66,-.36],["c",-.24,-.12,-.3,-.18,-.33,-.24],["c",-.12,-.27,.15,-.78,.45,-.93],["c",.24,-.12,.33,-.09,.9,.18],["c",.6,.3,.84,.39,1.2,.36],["c",.87,-.09,1.77,-.69,3.24,-2.31],["c",2.67,-2.85,4.59,-5.94,5.7,-9.15],["c",.15,-.45,.24,-.63,.42,-.81],["c",.21,-.24,.6,-.45,.99,-.51],["z"],["m",-3.99,16.05],["c",.18,0,.69,-.03,1.17,0],["c",3.27,.03,5.37,.75,6,2.07],["c",.45,.99,.12,2.4,-.81,3.42],["c",-.24,.27,-.57,.57,-.84,.75],["c",-.09,.06,-.18,.09,-.18,.12],["c",0,0,.18,.03,.42,.09],["c",1.23,.3,2.01,.81,2.37,1.59],["c",.27,.54,.3,1.32,.09,2.1],["c",-.12,.36,-.45,1.05,-.69,1.35],["c",-.87,1.17,-2.1,1.92,-3.54,2.25],["c",-.36,.06,-.48,.06,-.96,.06],["c",-.45,0,-.66,0,-.84,-.03],["c",-.84,-.18,-1.47,-.51,-2.07,-1.11],["c",-.33,-.33,-.45,-.51,-.45,-.63],["c",0,-.06,.03,-.15,.06,-.24],["c",.18,-.33,.69,-.6,.93,-.48],["c",.03,.03,.15,.12,.27,.24],["c",.39,.42,.99,.57,1.62,.45],["c",1.05,-.21,1.98,-1.02,2.31,-2.01],["c",.48,-1.53,-.48,-2.55,-2.58,-2.67],["c",-.21,0,-.36,-.03,-.42,-.06],["c",-.15,-.09,-.21,-.51,-.06,-.78],["c",.12,-.27,.24,-.33,.6,-.36],["c",.57,-.06,1.11,-.42,1.5,-.99],["c",.48,-.72,.54,-1.59,.18,-2.31],["c",-.12,-.21,-.45,-.54,-.69,-.69],["c",-.33,-.21,-.93,-.45,-1.35,-.51],["l",-.12,-.03],["l",-.06,.48],["c",-.54,2.94,-1.14,6.24,-1.29,6.75],["c",-.33,1.35,-.93,2.61,-1.65,3.6],["c",-.3,.36,-.81,.9,-1.14,1.14],["c",-.3,.24,-.84,.48,-1.14,.57],["c",-.33,.09,-.96,.09,-1.26,.03],["c",-.45,-.12,-.87,-.39,-1.53,-.96],["c",-.24,-.15,-.51,-.39,-.63,-.48],["c",-.3,-.21,-.33,-.33,-.21,-.63],["c",.12,-.18,.27,-.36,.42,-.45],["c",.27,-.12,.36,-.09,.87,.33],["c",.78,.6,1.08,.75,1.65,.72],["c",.45,-.03,.81,-.21,1.17,-.54],["c",.87,-.9,1.38,-2.85,1.38,-5.37],["c",0,-.6,.03,-1.11,.12,-2.04],["c",.06,-.69,.24,-2.01,.33,-2.58],["c",.06,-.24,.06,-.42,.06,-.42],["c",0,0,-.12,.03,-.21,.09],["c",-1.44,.57,-2.16,1.65,-1.74,2.55],["c",.09,.15,.18,.24,.27,.33],["c",.24,.21,.3,.27,.33,.39],["c",.06,.24,0,.63,-.15,.78],["c",-.09,.12,-.54,.21,-.96,.24],["c",-1.02,.03,-2.01,-.48,-2.43,-1.32],["c",-.21,-.45,-.27,-.9,-.15,-1.44],["c",.06,-.27,.21,-.66,.39,-.93],["c",.87,-1.29,3,-2.22,5.64,-2.43],["z"]],w:19.643,h:43.325},"tab.tiny":{d:[["M",16.02,-17.25],["c",.12,-.09,.15,-.09,.27,-.09],["c",.21,.03,.51,.3,.51,.45],["c",0,.06,-.12,.18,-.3,.36],["c",-1.11,1.08,-2.55,1.59,-3.84,1.41],["c",-.15,-.03,-.33,-.06,-.39,-.09],["c",-.06,-.03,-.09,-.03,-.12,-.03],["c",0,0,-.06,.42,-.15,.93],["c",-.33,2.01,-.66,3.69,-.84,4.26],["c",-.42,1.41,-1.23,2.67,-2.16,3.33],["c",-.27,.18,-.75,.42,-.99,.48],["c",-.3,.09,-.72,.09,-1.02,.06],["c",-.45,-.09,-.84,-.33,-1.53,-.9],["c",-.21,-.18,-.51,-.39,-.63,-.48],["c",-.27,-.21,-.3,-.24,-.3,-.36],["c",0,-.12,.09,-.36,.18,-.45],["c",.09,-.09,.27,-.18,.36,-.18],["c",.12,0,.3,.12,.66,.45],["c",.57,.51,.87,.69,1.23,.72],["c",.93,.06,1.68,-.78,1.98,-2.37],["c",.09,-.39,.15,-.75,.18,-1.53],["c",.06,-.99,.24,-2.79,.42,-4.05],["c",.03,-.3,.06,-.57,.06,-.6],["c",0,-.06,-.03,-.09,-.15,-.12],["c",-.9,-.18,-2.13,.06,-2.76,.57],["c",-.36,.3,-.51,.6,-.51,1.02],["c",0,.45,.15,.75,.48,.99],["c",.06,.06,.15,.18,.18,.24],["c",.12,.24,.03,.63,-.15,.69],["c",-.24,.12,-.6,.15,-.9,.15],["c",-.36,-.03,-.57,-.09,-.87,-.24],["c",-.78,-.36,-1.23,-1.11,-1.2,-1.92],["c",.12,-1.53,1.74,-2.49,4.62,-2.7],["c",1.2,-.09,1.47,-.03,3.33,.57],["c",.9,.3,1.14,.36,1.56,.39],["c",.45,0,.93,-.06,1.38,-.21],["c",.51,-.18,.81,-.33,1.41,-.75],["z"],["m",-4.68,10.38],["c",.39,-.06,.84,0,1.2,.15],["c",.24,.12,.36,.21,.45,.36],["l",.09,.09],["l",-.06,1.41],["c",-.09,2.19,-.18,3.96,-.27,5.49],["c",-.03,.78,-.06,1.59,-.06,1.86],["c",0,.42,0,.48,.06,.57],["c",.06,.18,.18,.24,.36,.27],["c",.18,0,.39,-.06,.84,-.27],["c",.45,-.21,.54,-.24,.63,-.18],["c",.12,.12,.15,.54,.03,.69],["c",-.03,.03,-.15,.12,-.27,.18],["c",-.15,.03,-.3,.12,-.36,.15],["c",-.87,.45,-1.02,.51,-1.26,.57],["c",-.33,.09,-.6,.06,-.84,-.06],["c",-.42,-.18,-.63,-.6,-.87,-1.44],["c",-.3,-1.23,-.57,-2.97,-.66,-4.08],["c",0,-.18,-.03,-.3,-.03,-.33],["l",-.06,.06],["c",-.18,.27,-1.11,1.38,-1.68,2.01],["l",-.33,.33],["l",.06,.09],["c",.06,.15,.27,.33,.48,.42],["c",.27,.18,.51,.24,.96,.27],["l",.39,0],["l",.03,.12],["c",.12,.21,.03,.57,-.15,.69],["c",-.03,.03,-.21,.09,-.36,.15],["c",-.27,.06,-.39,.06,-.75,.06],["c",-.48,0,-.75,-.03,-1.08,-.21],["c",-.21,-.12,-.51,-.36,-.57,-.48],["l",-.03,-.09],["l",-.39,.36],["c",-1.47,1.35,-2.49,1.98,-3.42,2.13],["c",-.54,.09,-.96,-.03,-1.62,-.39],["c",-.21,-.15,-.45,-.27,-.54,-.3],["c",-.18,-.09,-.21,-.21,-.12,-.45],["c",.06,-.27,.33,-.48,.54,-.48],["c",.03,0,.27,.09,.48,.21],["c",.48,.24,.69,.27,.99,.27],["c",.6,-.06,1.17,-.42,2.1,-1.35],["c",2.22,-2.22,4.02,-4.98,4.95,-7.59],["c",.21,-.57,.3,-.78,.48,-.93],["c",.15,-.15,.42,-.27,.66,-.33],["z"],["m",-3.06,12.84],["c",.27,-.03,1.68,0,2.01,.03],["c",1.92,.18,3.15,.69,3.63,1.5],["c",.18,.33,.24,.51,.21,.93],["c",0,.45,-.06,.72,-.24,1.11],["c",-.24,.51,-.69,1.02,-1.17,1.35],["c",-.21,.15,-.21,.15,-.12,.18],["c",.72,.15,1.11,.3,1.5,.57],["c",.39,.24,.63,.57,.75,.96],["c",.09,.3,.09,.96,0,1.29],["c",-.15,.57,-.39,1.05,-.78,1.5],["c",-.66,.75,-1.62,1.32,-2.61,1.53],["c",-.27,.06,-.42,.06,-.84,.06],["c",-.48,0,-.57,0,-.81,-.06],["c",-.6,-.18,-1.05,-.42,-1.47,-.81],["c",-.36,-.39,-.42,-.51,-.3,-.75],["c",.12,-.21,.39,-.39,.6,-.39],["c",.09,0,.15,.03,.33,.18],["c",.12,.12,.27,.24,.36,.27],["c",.96,.48,2.46,-.33,2.82,-1.5],["c",.24,-.81,-.03,-1.44,-.69,-1.77],["c",-.39,-.21,-1.02,-.33,-1.53,-.33],["c",-.18,0,-.21,0,-.27,-.09],["c",-.06,-.09,-.06,-.3,-.03,-.48],["c",.06,-.18,.18,-.36,.33,-.36],["c",.39,-.06,.51,-.09,.72,-.18],["c",.69,-.36,1.11,-1.23,.99,-2.01],["c",-.09,-.51,-.42,-.9,-.93,-1.17],["c",-.24,-.12,-.6,-.27,-.87,-.3],["c",-.09,-.03,-.09,-.03,-.12,.12],["c",0,.09,-.21,1.11,-.42,2.25],["c",-.66,3.75,-.72,3.99,-1.26,5.07],["c",-.9,1.89,-2.25,2.85,-3.48,2.61],["c",-.39,-.09,-.69,-.27,-1.38,-.84],["c",-.63,-.51,-.63,-.48,-.63,-.6],["c",0,-.18,.18,-.48,.39,-.57],["c",.21,-.12,.3,-.09,.81,.33],["c",.15,.15,.39,.3,.54,.36],["c",.18,.12,.27,.12,.48,.15],["c",.99,.06,1.71,-.78,2.04,-2.46],["c",.12,-.66,.18,-1.14,.21,-2.22],["c",.03,-1.23,.12,-2.25,.36,-3.63],["c",.03,-.24,.06,-.45,.06,-.48],["c",-.06,-.03,-.66,.27,-.9,.42],["c",-.06,.06,-.21,.18,-.33,.3],["c",-.57,.57,-.6,1.35,-.06,1.74],["c",.18,.12,.24,.24,.21,.51],["c",-.03,.3,-.15,.42,-.57,.48],["c",-1.11,.24,-2.22,-.42,-2.43,-1.38],["c",-.09,-.45,.03,-1.02,.3,-1.47],["c",.18,-.24,.6,-.63,.9,-.84],["c",.9,-.6,2.28,-1.02,3.69,-1.11],["z"]],w:15.709,h:34.656},"timesig.common":{d:[["M",6.66,-7.83],["c",.72,-.06,1.41,-.03,1.98,.09],["c",1.2,.27,2.34,.96,3.09,1.92],["c",.63,.81,1.08,1.86,1.14,2.73],["c",.06,1.02,-.51,1.92,-1.44,2.22],["c",-.24,.09,-.3,.09,-.63,.09],["c",-.33,0,-.42,0,-.63,-.06],["c",-.66,-.24,-1.14,-.63,-1.41,-1.2],["c",-.15,-.3,-.21,-.51,-.24,-.9],["c",-.06,-1.08,.57,-2.04,1.56,-2.37],["c",.18,-.06,.27,-.06,.63,-.06],["l",.45,0],["c",.06,.03,.09,.03,.09,0],["c",0,0,-.09,-.12,-.24,-.27],["c",-1.02,-1.11,-2.55,-1.68,-4.08,-1.5],["c",-1.29,.15,-2.04,.69,-2.4,1.74],["c",-.36,.93,-.42,1.89,-.42,5.37],["c",0,2.97,.06,3.96,.24,4.77],["c",.24,1.08,.63,1.68,1.41,2.07],["c",.81,.39,2.16,.45,3.18,.09],["c",1.29,-.45,2.37,-1.53,3.03,-2.97],["c",.15,-.33,.33,-.87,.39,-1.17],["c",.09,-.24,.15,-.36,.3,-.39],["c",.21,-.03,.42,.15,.39,.36],["c",-.06,.39,-.42,1.38,-.69,1.89],["c",-.96,1.8,-2.49,2.94,-4.23,3.18],["c",-.99,.12,-2.58,-.06,-3.63,-.45],["c",-.96,-.36,-1.71,-.84,-2.4,-1.5],["c",-1.11,-1.11,-1.8,-2.61,-2.04,-4.56],["c",-.06,-.6,-.06,-2.01,0,-2.61],["c",.24,-1.95,.9,-3.45,2.01,-4.56],["c",.69,-.66,1.44,-1.11,2.37,-1.47],["c",.63,-.24,1.47,-.42,2.22,-.48],["z"]],w:13.038,h:15.689},"timesig.cut":{d:[["M",6.24,-10.44],["c",.09,-.06,.09,-.06,.48,-.06],["c",.36,0,.36,0,.45,.06],["l",.06,.09],["l",0,1.23],["l",0,1.26],["l",.27,0],["c",1.26,0,2.49,.45,3.48,1.29],["c",1.05,.87,1.8,2.28,1.89,3.48],["c",.06,1.02,-.51,1.92,-1.44,2.22],["c",-.24,.09,-.3,.09,-.63,.09],["c",-.33,0,-.42,0,-.63,-.06],["c",-.66,-.24,-1.14,-.63,-1.41,-1.2],["c",-.15,-.3,-.21,-.51,-.24,-.9],["c",-.06,-1.08,.57,-2.04,1.56,-2.37],["c",.18,-.06,.27,-.06,.63,-.06],["l",.45,0],["c",.06,.03,.09,.03,.09,0],["c",0,-.03,-.45,-.51,-.66,-.69],["c",-.87,-.69,-1.83,-1.05,-2.94,-1.11],["l",-.42,0],["l",0,7.17],["l",0,7.14],["l",.42,0],["c",.69,-.03,1.23,-.18,1.86,-.51],["c",1.05,-.51,1.89,-1.47,2.46,-2.7],["c",.15,-.33,.33,-.87,.39,-1.17],["c",.09,-.24,.15,-.36,.3,-.39],["c",.21,-.03,.42,.15,.39,.36],["c",-.03,.24,-.21,.78,-.39,1.2],["c",-.96,2.37,-2.94,3.9,-5.13,3.9],["l",-.3,0],["l",0,1.26],["l",0,1.23],["l",-.06,.09],["c",-.09,.06,-.09,.06,-.45,.06],["c",-.39,0,-.39,0,-.48,-.06],["l",-.06,-.09],["l",0,-1.29],["l",0,-1.29],["l",-.21,-.03],["c",-1.23,-.21,-2.31,-.63,-3.21,-1.29],["c",-.15,-.09,-.45,-.36,-.66,-.57],["c",-1.11,-1.11,-1.8,-2.61,-2.04,-4.56],["c",-.06,-.6,-.06,-2.01,0,-2.61],["c",.24,-1.95,.93,-3.45,2.04,-4.59],["c",.42,-.39,.78,-.66,1.26,-.93],["c",.75,-.45,1.65,-.75,2.61,-.9],["l",.21,-.03],["l",0,-1.29],["l",0,-1.29],["z"],["m",-.06,10.44],["c",0,-5.58,0,-6.99,-.03,-6.99],["c",-.15,0,-.63,.27,-.87,.45],["c",-.45,.36,-.75,.93,-.93,1.77],["c",-.18,.81,-.24,1.8,-.24,4.74],["c",0,2.97,.06,3.96,.24,4.77],["c",.24,1.08,.66,1.68,1.41,2.07],["c",.12,.06,.3,.12,.33,.15],["l",.09,0],["l",0,-6.96],["z"]],w:13.038,h:20.97},"timesig.imperfectum":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.imperfectum2":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.perfectum":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.perfectum2":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},f:{d:[["M",9.93,-14.28],["c",1.53,-.18,2.88,.45,3.12,1.5],["c",.12,.51,0,1.32,-.27,1.86],["c",-.15,.3,-.42,.57,-.63,.69],["c",-.69,.36,-1.56,.03,-1.83,-.69],["c",-.09,-.24,-.09,-.69,0,-.87],["c",.06,-.12,.21,-.24,.45,-.42],["c",.42,-.24,.57,-.45,.6,-.72],["c",.03,-.33,-.09,-.39,-.63,-.42],["c",-.3,0,-.45,0,-.6,.03],["c",-.81,.21,-1.35,.93,-1.74,2.46],["c",-.06,.27,-.48,2.25,-.48,2.31],["c",0,.03,.39,.03,.9,.03],["c",.72,0,.9,0,.99,.06],["c",.42,.15,.45,.72,.03,.9],["c",-.12,.06,-.24,.06,-1.17,.06],["l",-1.05,0],["l",-.78,2.55],["c",-.45,1.41,-.87,2.79,-.96,3.06],["c",-.87,2.37,-2.37,4.74,-3.78,5.91],["c",-1.05,.9,-2.04,1.23,-3.09,1.08],["c",-1.11,-.18,-1.89,-.78,-2.04,-1.59],["c",-.12,-.66,.15,-1.71,.54,-2.19],["c",.69,-.75,1.86,-.54,2.22,.39],["c",.06,.15,.09,.27,.09,.48],["c",0,.24,-.03,.27,-.12,.42],["c",-.03,.09,-.15,.18,-.27,.27],["c",-.09,.06,-.27,.21,-.36,.27],["c",-.24,.18,-.36,.36,-.39,.6],["c",-.03,.33,.09,.39,.63,.42],["c",.42,0,.63,-.03,.9,-.15],["c",.6,-.3,.96,-.96,1.38,-2.64],["c",.09,-.42,.63,-2.55,1.17,-4.77],["l",1.02,-4.08],["c",0,-.03,-.36,-.03,-.81,-.03],["c",-.72,0,-.81,0,-.93,-.06],["c",-.42,-.18,-.39,-.75,.03,-.9],["c",.09,-.06,.27,-.06,1.05,-.06],["l",.96,0],["l",0,-.09],["c",.06,-.18,.3,-.72,.51,-1.17],["c",1.2,-2.46,3.3,-4.23,5.34,-4.5],["z"]],w:16.155,h:19.445},m:{d:[["M",2.79,-8.91],["c",.09,0,.3,-.03,.45,-.03],["c",.24,.03,.3,.03,.45,.12],["c",.36,.15,.63,.54,.75,1.02],["l",.03,.21],["l",.33,-.3],["c",.69,-.69,1.38,-1.02,2.07,-1.02],["c",.27,0,.33,0,.48,.06],["c",.21,.09,.48,.36,.63,.6],["c",.03,.09,.12,.27,.18,.42],["c",.03,.15,.09,.27,.12,.27],["c",0,0,.09,-.09,.18,-.21],["c",.33,-.39,.87,-.81,1.29,-.99],["c",.78,-.33,1.47,-.21,2.01,.33],["c",.3,.33,.48,.69,.6,1.14],["c",.09,.42,.06,.54,-.54,3.06],["c",-.33,1.29,-.57,2.4,-.57,2.43],["c",0,.12,.09,.21,.21,.21],["c",.24,0,.75,-.3,1.2,-.72],["c",.45,-.39,.6,-.45,.78,-.27],["c",.18,.18,.09,.36,-.45,.87],["c",-1.05,.96,-1.83,1.47,-2.58,1.71],["c",-.93,.33,-1.53,.21,-1.8,-.33],["c",-.06,-.15,-.06,-.21,-.06,-.45],["c",0,-.24,.03,-.48,.6,-2.82],["c",.42,-1.71,.6,-2.64,.63,-2.79],["c",.03,-.57,-.3,-.75,-.84,-.48],["c",-.24,.12,-.54,.39,-.66,.63],["c",-.03,.09,-.42,1.38,-.9,3],["c",-.9,3.15,-.84,3,-1.14,3.15],["l",-.15,.09],["l",-.78,0],["c",-.6,0,-.78,0,-.84,-.06],["c",-.09,-.03,-.18,-.18,-.18,-.27],["c",0,-.03,.36,-1.38,.84,-2.97],["c",.57,-2.04,.81,-2.97,.84,-3.12],["c",.03,-.54,-.3,-.72,-.84,-.45],["c",-.24,.12,-.57,.42,-.66,.63],["c",-.06,.09,-.51,1.44,-1.05,2.97],["c",-.51,1.56,-.99,2.85,-.99,2.91],["c",-.06,.12,-.21,.24,-.36,.3],["c",-.12,.06,-.21,.06,-.9,.06],["c",-.6,0,-.78,0,-.84,-.06],["c",-.09,-.03,-.18,-.18,-.18,-.27],["c",0,-.03,.45,-1.38,.99,-2.97],["c",1.05,-3.18,1.05,-3.18,.93,-3.45],["c",-.12,-.27,-.39,-.3,-.72,-.15],["c",-.54,.27,-1.14,1.17,-1.56,2.4],["c",-.06,.15,-.15,.3,-.18,.36],["c",-.21,.21,-.57,.27,-.72,.09],["c",-.09,-.09,-.06,-.21,.06,-.63],["c",.48,-1.26,1.26,-2.46,2.01,-3.21],["c",.57,-.54,1.2,-.87,1.83,-1.02],["z"]],w:14.687,h:9.126},p:{d:[["M",1.92,-8.7],["c",.27,-.09,.81,-.06,1.11,.03],["c",.54,.18,.93,.51,1.17,.99],["c",.09,.15,.15,.33,.18,.36],["l",0,.12],["l",.3,-.27],["c",.66,-.6,1.35,-1.02,2.13,-1.2],["c",.21,-.06,.33,-.06,.78,-.06],["c",.45,0,.51,0,.84,.09],["c",1.29,.33,2.07,1.32,2.25,2.79],["c",.09,.81,-.09,2.01,-.45,2.79],["c",-.54,1.26,-1.86,2.55,-3.18,3.03],["c",-.45,.18,-.81,.24,-1.29,.24],["c",-.69,-.03,-1.35,-.18,-1.86,-.45],["c",-.3,-.15,-.51,-.18,-.69,-.09],["c",-.09,.03,-.18,.09,-.18,.12],["c",-.09,.12,-1.05,2.94,-1.05,3.06],["c",0,.24,.18,.48,.51,.63],["c",.18,.06,.54,.15,.75,.15],["c",.21,0,.36,.06,.42,.18],["c",.12,.18,.06,.42,-.12,.54],["c",-.09,.03,-.15,.03,-.78,0],["c",-1.98,-.15,-3.81,-.15,-5.79,0],["c",-.63,.03,-.69,.03,-.78,0],["c",-.24,-.15,-.24,-.57,.03,-.66],["c",.06,-.03,.48,-.09,.99,-.12],["c",.87,-.06,1.11,-.09,1.35,-.21],["c",.18,-.06,.33,-.18,.39,-.3],["c",.06,-.12,3.24,-9.42,3.27,-9.6],["c",.06,-.33,.03,-.57,-.15,-.69],["c",-.09,-.06,-.12,-.06,-.3,-.06],["c",-.69,.06,-1.53,1.02,-2.28,2.61],["c",-.09,.21,-.21,.45,-.27,.51],["c",-.09,.12,-.33,.24,-.48,.24],["c",-.18,0,-.36,-.15,-.36,-.3],["c",0,-.24,.78,-1.83,1.26,-2.55],["c",.72,-1.11,1.47,-1.74,2.28,-1.92],["z"],["m",5.37,1.47],["c",-.27,-.12,-.75,-.03,-1.14,.21],["c",-.75,.48,-1.47,1.68,-1.89,3.15],["c",-.45,1.47,-.42,2.34,0,2.7],["c",.45,.39,1.26,.21,1.83,-.36],["c",.51,-.51,.99,-1.68,1.38,-3.27],["c",.3,-1.17,.33,-1.74,.15,-2.13],["c",-.09,-.15,-.15,-.21,-.33,-.3],["z"]],w:14.689,h:13.127},r:{d:[["M",6.33,-9.12],["c",.27,-.03,.93,0,1.2,.06],["c",.84,.21,1.23,.81,1.02,1.53],["c",-.24,.75,-.9,1.17,-1.56,.96],["c",-.33,-.09,-.51,-.3,-.66,-.75],["c",-.03,-.12,-.09,-.24,-.12,-.3],["c",-.09,-.15,-.3,-.24,-.48,-.24],["c",-.57,0,-1.38,.54,-1.65,1.08],["c",-.06,.15,-.33,1.17,-.9,3.27],["c",-.57,2.31,-.81,3.12,-.87,3.21],["c",-.03,.06,-.12,.15,-.18,.21],["l",-.12,.06],["l",-.81,.03],["c",-.69,0,-.81,0,-.9,-.03],["c",-.09,-.06,-.18,-.21,-.18,-.3],["c",0,-.06,.39,-1.62,.9,-3.51],["c",.84,-3.24,.87,-3.45,.87,-3.72],["c",0,-.21,0,-.27,-.03,-.36],["c",-.12,-.15,-.21,-.24,-.42,-.24],["c",-.24,0,-.45,.15,-.78,.42],["c",-.33,.36,-.45,.54,-.72,1.14],["c",-.03,.12,-.21,.24,-.36,.27],["c",-.12,0,-.15,0,-.24,-.06],["c",-.18,-.12,-.18,-.21,-.06,-.54],["c",.21,-.57,.42,-.93,.78,-1.32],["c",.54,-.51,1.2,-.81,1.95,-.87],["c",.81,-.03,1.53,.3,1.92,.87],["l",.12,.18],["l",.09,-.09],["c",.57,-.45,1.41,-.84,2.19,-.96],["z"]],w:9.41,h:9.132},s:{d:[["M",4.47,-8.73],["c",.09,0,.36,-.03,.57,-.03],["c",.75,.03,1.29,.24,1.71,.63],["c",.51,.54,.66,1.26,.36,1.83],["c",-.24,.42,-.63,.57,-1.11,.42],["c",-.33,-.09,-.6,-.36,-.6,-.57],["c",0,-.03,.06,-.21,.15,-.39],["c",.12,-.21,.15,-.33,.18,-.48],["c",0,-.24,-.06,-.48,-.15,-.6],["c",-.15,-.21,-.42,-.24,-.75,-.15],["c",-.27,.06,-.48,.18,-.69,.36],["c",-.39,.39,-.51,.96,-.33,1.38],["c",.09,.21,.42,.51,.78,.72],["c",1.11,.69,1.59,1.11,1.89,1.68],["c",.21,.39,.24,.78,.15,1.29],["c",-.18,1.2,-1.17,2.16,-2.52,2.52],["c",-1.02,.24,-1.95,.12,-2.7,-.42],["c",-.72,-.51,-.99,-1.47,-.6,-2.19],["c",.24,-.48,.72,-.63,1.17,-.42],["c",.33,.18,.54,.45,.57,.81],["c",0,.21,-.03,.3,-.33,.51],["c",-.33,.24,-.39,.42,-.27,.69],["c",.06,.15,.21,.27,.45,.33],["c",.3,.09,.87,.09,1.2,0],["c",.75,-.21,1.23,-.72,1.29,-1.35],["c",.03,-.42,-.15,-.81,-.54,-1.2],["c",-.24,-.24,-.48,-.42,-1.41,-1.02],["c",-.69,-.42,-1.05,-.93,-1.05,-1.47],["c",0,-.39,.12,-.87,.3,-1.23],["c",.27,-.57,.78,-1.05,1.38,-1.35],["c",.24,-.12,.63,-.27,.9,-.3],["z"]],w:6.632,h:8.758},z:{d:[["M",2.64,-7.95],["c",.36,-.09,.81,-.03,1.71,.27],["c",.78,.21,.96,.27,1.74,.3],["c",.87,.06,1.02,.03,1.38,-.21],["c",.21,-.15,.33,-.15,.48,-.06],["c",.15,.09,.21,.3,.15,.45],["c",-.03,.06,-1.26,1.26,-2.76,2.67],["l",-2.73,2.55],["l",.54,.03],["c",.54,.03,.72,.03,2.01,.15],["c",.36,.03,.9,.06,1.2,.09],["c",.66,0,.81,-.03,1.02,-.24],["c",.3,-.3,.39,-.72,.27,-1.23],["c",-.06,-.27,-.06,-.27,-.03,-.39],["c",.15,-.3,.54,-.27,.69,.03],["c",.15,.33,.27,1.02,.27,1.5],["c",0,1.47,-1.11,2.7,-2.52,2.79],["c",-.57,.03,-1.02,-.09,-2.01,-.51],["c",-1.02,-.42,-1.23,-.48,-2.13,-.54],["c",-.81,-.06,-.96,-.03,-1.26,.18],["c",-.12,.06,-.24,.12,-.27,.12],["c",-.27,0,-.45,-.3,-.36,-.51],["c",.03,-.06,1.32,-1.32,2.91,-2.79],["l",2.88,-2.73],["c",-.03,0,-.21,.03,-.42,.06],["c",-.21,.03,-.78,.09,-1.23,.12],["c",-1.11,.12,-1.23,.15,-1.95,.27],["c",-.72,.15,-1.17,.18,-1.29,.09],["c",-.27,-.18,-.21,-.75,.12,-1.26],["c",.39,-.6,.93,-1.02,1.59,-1.2],["z"]],w:8.573,h:8.743},"+":{d:[["M",3.48,-9.3],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,1.29],["l",0,1.29],["l",1.29,0],["c",1.23,0,1.29,0,1.41,.06],["c",.06,.03,.15,.09,.18,.12],["c",.12,.09,.21,.33,.21,.48],["c",0,.15,-.09,.39,-.21,.48],["c",-.03,.03,-.12,.09,-.18,.12],["c",-.12,.06,-.18,.06,-1.41,.06],["l",-1.29,0],["l",0,1.29],["c",0,1.23,0,1.29,-.06,1.41],["c",-.09,.18,-.15,.24,-.3,.33],["c",-.21,.09,-.39,.09,-.57,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.06,-.12,-.06,-.18,-.06,-1.41],["l",0,-1.29],["l",-1.29,0],["c",-1.23,0,-1.29,0,-1.41,-.06],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.09,-.36,0,-.54],["c",.09,-.18,.15,-.24,.33,-.33],["l",.15,-.06],["l",1.26,0],["l",1.29,0],["l",0,-1.29],["c",0,-1.23,0,-1.29,.06,-1.41],["c",.09,-.18,.15,-.24,.33,-.33],["z"]],w:7.507,h:7.515},",":{d:[["M",1.85,-3.36],["c",.57,-.15,1.17,.03,1.59,.45],["c",.45,.45,.6,.96,.51,1.89],["c",-.09,1.23,-.42,2.46,-.99,3.93],["c",-.3,.72,-.72,1.62,-.78,1.68],["c",-.18,.21,-.51,.18,-.66,-.06],["c",-.03,-.06,-.06,-.15,-.06,-.18],["c",0,-.06,.12,-.33,.24,-.63],["c",.84,-1.8,1.02,-2.61,.69,-3.24],["c",-.12,-.24,-.27,-.36,-.75,-.6],["c",-.36,-.15,-.42,-.21,-.6,-.39],["c",-.69,-.69,-.69,-1.71,0,-2.4],["c",.21,-.21,.51,-.39,.81,-.45],["z"]],w:3.452,h:8.143},"-":{d:[["M",.18,-5.34],["c",.09,-.06,.15,-.06,2.31,-.06],["c",2.46,0,2.37,0,2.46,.21],["c",.12,.21,.03,.42,-.15,.54],["c",-.09,.06,-.15,.06,-2.28,.06],["c",-2.16,0,-2.22,0,-2.31,-.06],["c",-.27,-.15,-.27,-.54,-.03,-.69],["z"]],w:5.001,h:.81},".":{d:[["M",1.32,-3.36],["c",1.05,-.27,2.1,.57,2.1,1.65],["c",0,1.08,-1.05,1.92,-2.1,1.65],["c",-.9,-.21,-1.5,-1.14,-1.26,-2.04],["c",.12,-.63,.63,-1.11,1.26,-1.26],["z"]],w:3.413,h:3.402},"scripts.wedge":{d:[["M",-3.66,-7.44],["c",.06,-.09,0,-.09,.81,.03],["c",1.86,.3,3.84,.3,5.73,0],["c",.78,-.12,.72,-.12,.78,-.03],["c",.15,.15,.12,.24,-.24,.6],["c",-.93,.93,-1.98,2.76,-2.67,4.62],["c",-.3,.78,-.51,1.71,-.51,2.13],["c",0,.15,0,.18,-.06,.27],["c",-.12,.09,-.24,.09,-.36,0],["c",-.06,-.09,-.06,-.12,-.06,-.27],["c",0,-.42,-.21,-1.35,-.51,-2.13],["c",-.69,-1.86,-1.74,-3.69,-2.67,-4.62],["c",-.36,-.36,-.39,-.45,-.24,-.6],["z"]],w:7.49,h:7.752},"scripts.thumb":{d:[["M",-.54,-3.69],["c",.15,-.03,.36,-.06,.51,-.06],["c",1.44,0,2.58,1.11,2.94,2.85],["c",.09,.48,.09,1.32,0,1.8],["c",-.27,1.41,-1.08,2.43,-2.16,2.73],["l",-.18,.06],["l",0,.12],["c",.03,.06,.06,.45,.09,.87],["c",.03,.57,.03,.78,0,.84],["c",-.09,.27,-.39,.48,-.66,.48],["c",-.27,0,-.57,-.21,-.66,-.48],["c",-.03,-.06,-.03,-.27,0,-.84],["c",.03,-.42,.06,-.81,.09,-.87],["l",0,-.12],["l",-.18,-.06],["c",-1.08,-.3,-1.89,-1.32,-2.16,-2.73],["c",-.09,-.48,-.09,-1.32,0,-1.8],["c",.15,-.84,.51,-1.53,1.02,-2.04],["c",.39,-.39,.84,-.63,1.35,-.75],["z"],["m",1.05,.9],["c",-.15,-.09,-.21,-.09,-.45,-.12],["c",-.15,0,-.3,.03,-.39,.03],["c",-.57,.18,-.9,.72,-1.08,1.74],["c",-.06,.48,-.06,1.8,0,2.28],["c",.15,.9,.42,1.44,.9,1.65],["c",.18,.09,.21,.09,.51,.09],["c",.3,0,.33,0,.51,-.09],["c",.48,-.21,.75,-.75,.9,-1.65],["c",.03,-.27,.03,-.54,.03,-1.14],["c",0,-.6,0,-.87,-.03,-1.14],["c",-.15,-.9,-.45,-1.44,-.9,-1.65],["z"]],w:5.955,h:9.75},"scripts.open":{d:[["M",-.54,-3.69],["c",.15,-.03,.36,-.06,.51,-.06],["c",1.44,0,2.58,1.11,2.94,2.85],["c",.09,.48,.09,1.32,0,1.8],["c",-.33,1.74,-1.47,2.85,-2.91,2.85],["c",-1.44,0,-2.58,-1.11,-2.91,-2.85],["c",-.09,-.48,-.09,-1.32,0,-1.8],["c",.15,-.84,.51,-1.53,1.02,-2.04],["c",.39,-.39,.84,-.63,1.35,-.75],["z"],["m",1.11,.9],["c",-.21,-.09,-.27,-.09,-.51,-.12],["c",-.3,0,-.42,.03,-.66,.15],["c",-.24,.12,-.51,.39,-.66,.63],["c",-.54,.93,-.63,2.64,-.21,3.81],["c",.21,.54,.51,.9,.93,1.11],["c",.21,.09,.24,.09,.54,.09],["c",.3,0,.33,0,.54,-.09],["c",.42,-.21,.72,-.57,.93,-1.11],["c",.36,-.99,.36,-2.37,0,-3.36],["c",-.21,-.54,-.51,-.9,-.9,-1.11],["z"]],w:5.955,h:7.5},"scripts.longphrase":{d:[["M",1.47,-15.09],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.54,.06,11.25],["l",0,11.25],["l",-.63,.15],["c",-.66,.18,-1.44,.39,-1.5,.39],["c",-.03,0,-.03,-3.39,-.03,-11.25],["l",0,-11.25],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:23.04},"scripts.mediumphrase":{d:[["M",1.47,-7.59],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.39,.06,7.5],["l",0,7.5],["l",-.63,.15],["c",-.66,.18,-1.44,.39,-1.5,.39],["c",-.03,0,-.03,-2.28,-.03,-7.5],["l",0,-7.5],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:15.54},"scripts.shortphrase":{d:[["M",1.47,-7.59],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.21,.06,3.75],["l",0,3.75],["l",-.42,.09],["c",-.57,.18,-1.65,.45,-1.71,.45],["c",-.03,0,-.03,-.72,-.03,-3.75],["l",0,-3.75],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:8.04},"scripts.snap":{d:[["M",4.5,-3.39],["c",.36,-.03,.96,-.03,1.35,0],["c",1.56,.15,3.15,.9,4.2,2.01],["c",.24,.27,.33,.42,.33,.6],["c",0,.27,.03,.24,-2.46,2.22],["c",-1.29,1.02,-2.4,1.86,-2.49,1.92],["c",-.18,.09,-.3,.09,-.48,0],["c",-.09,-.06,-1.2,-.9,-2.49,-1.92],["c",-2.49,-1.98,-2.46,-1.95,-2.46,-2.22],["c",0,-.18,.09,-.33,.33,-.6],["c",1.05,-1.08,2.64,-1.86,4.17,-2.01],["z"],["m",1.29,1.17],["c",-1.47,-.15,-2.97,.3,-4.14,1.2],["l",-.18,.15],["l",.06,.09],["c",.15,.12,3.63,2.85,3.66,2.85],["c",.03,0,3.51,-2.73,3.66,-2.85],["l",.06,-.09],["l",-.18,-.15],["c",-.84,-.66,-1.89,-1.08,-2.94,-1.2],["z"]],w:10.38,h:6.84}};Le["noteheads.slash.whole"]={d:[["M",5,-5],["l",1,1],["l",-5,5],["l",-1,-1],["z"],["m",4,6],["l",-5,-5],["l",2,-2],["l",5,5],["z"],["m",0,-2],["l",1,1],["l",-5,5],["l",-1,-1],["z"],["m",-4,6],["l",-5,-5],["l",2,-2],["l",5,5],["z"]],w:10.81,h:15.63};Le["noteheads.slash.quarter"]={d:[["M",9,-6],["l",0,4],["l",-9,9],["l",0,-4],["z"]],w:9,h:9};Le["noteheads.harmonic.quarter"]={d:[["M",3.63,-4.02],["c",.09,-.06,.18,-.09,.24,-.03],["c",.03,.03,.87,.93,1.83,2.01],["c",1.5,1.65,1.8,1.98,1.8,2.04],["c",0,.06,-.3,.39,-1.8,2.04],["c",-.96,1.08,-1.8,1.98,-1.83,2.01],["c",-.06,.06,-.15,.03,-.24,-.03],["c",-.12,-.09,-3.54,-3.84,-3.6,-3.93],["c",-.03,-.03,-.03,-.09,-.03,-.15],["c",.03,-.06,3.45,-3.84,3.63,-3.96],["z"]],w:7.5,h:8.165};Le["noteheads.triangle.quarter"]={d:[["M",0,4],["l",9,0],["l",-4.5,-9],["z"]],w:9,h:9};var Ka=function(e){for(var t=[],r=0,a=e.length;r<a;r++){t[r]=[];for(var i=0,n=e[r].length;i<n;i++)t[r][i]=e[r][i]}return t},y1=function(e,t,r){for(var a=0,i=e.length;a<i;a++){var n=e[a],s,c;for(s=1,c=n.length;s<c;s++)n[s]*=s%2?t:r}},w1={printSymbol:function(e,t,r,a,i){if(!Le[r])return null;var n=Ka(Le[r].d);n[0][1]+=e,n[0][2]+=t;for(var s="",c=0;c<n.length;c++)s+=n[c].join(" ");return i.path=s,a.path(i)},getPathForSymbol:function(e,t,r,a,i){if(a=a||1,i=i||1,!Le[r])return null;var n=Ka(Le[r].d);return(a!==1||i!==1)&&y1(n,a,i),n[0][1]+=e,n[0][2]+=t,n},getSymbolWidth:function(e){return Le[e]?Le[e].w:0},symbolHeightInPitches:function(e){var t=Le[e]?Le[e].h:0;return t/m1.STEP},getSymbolAlign:function(e){return e.substring(0,7)==="scripts"&&e!=="scripts.roll"?"center":"left"},getYCorr:function(e){switch(e){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":return-2;case"timesig.common":case"timesig.cut":return 0;case"flags.d32nd":return-1;case"flags.d64th":return-2;case"flags.u32nd":return 1;case"flags.u64th":return 3;case"rests.whole":return 1;case"rests.half":return-1;case"rests.8th":return-1;case"rests.quarter":return-1;case"rests.16th":return-1;case"rests.32nd":return-1;case"rests.64th":return-1;case"f":case"m":case"p":case"s":case"z":return-4;case"scripts.trill":case"scripts.upbow":case"scripts.downbow":return-2;case"scripts.ufermata":case"scripts.wedge":case"scripts.roll":case"scripts.shortphrase":case"scripts.longphrase":return-1;case"scripts.dfermata":return 1;default:return 0}},setSymbol:function(e,t){Le[e]=t}},mt=w1,x1=Qt,h0=mt,gr=at,C1=function(e,t){var r,a=0;e.el_type="clef";var i=new x1(e,0,10,"staff-extra clef",t);switch(i.isClef=!0,e.type){case"treble":r="clefs.G";break;case"tenor":r="clefs.C";break;case"alto":r="clefs.C";break;case"bass":r="clefs.F";break;case"treble+8":r="clefs.G",a=1;break;case"tenor+8":r="clefs.C",a=1;break;case"bass+8":r="clefs.F",a=1;break;case"alto+8":r="clefs.C",a=1;break;case"treble-8":r="clefs.G",a=-1;break;case"tenor-8":r="clefs.C",a=-1;break;case"bass-8":r="clefs.F",a=-1;break;case"alto-8":r="clefs.C",a=-1;break;case"none":return null;case"perc":r="clefs.perc";break;default:i.addFixed(new gr("clef="+e.type,0,0,void 0,{type:"debug"}))}var n=5;if(r){var s=h0.symbolHeightInPitches(r),c=k1(r);if(i.addRight(new gr(r,n,h0.getSymbolWidth(r),e.clefPos,{top:s+e.clefPos+c,bottom:e.clefPos+c})),a!==0){var o=.6666666666666666,f=(h0.getSymbolWidth(r)-h0.getSymbolWidth("8")*o)/2,u=a>0?i.top+3:i.bottom-1,l=a>0?i.top+3:i.bottom-3,h=l-2;e.type==="bass-8"&&(u=3,f=0),i.addRight(new gr("8",n+f,h0.getSymbolWidth("8")*o,u,{scalex:o,scaley:o,top:l,bottom:h}))}}return i};function k1(e){switch(e){case"clefs.G":return-5;case"clefs.C":return-4;case"clefs.F":return-4;case"clefs.perc":return-2;default:return 0}}var _1=C1,T1=Qt,H0=mt,E1=at,S1=function(e,t){if(e.el_type="keySignature",!e.accidentals||e.accidentals.length===0)return null;var r=new T1(e,0,10,"staff-extra key-signature",t);r.isKeySig=!0;var a=0;return e.accidentals.forEach(function(i){var n,s=0;switch(i.acc){case"sharp":n="accidentals.sharp",s=-3;break;case"natural":n="accidentals.nat";break;case"flat":n="accidentals.flat",s=-1.2;break;case"quartersharp":n="accidentals.halfsharp",s=-2.5;break;case"quarterflat":n="accidentals.halfflat",s=-1.2;break;default:n="accidentals.flat"}r.addRight(new E1(n,a,H0.getSymbolWidth(n),i.verticalPos,{thickness:H0.symbolHeightInPitches(n),top:i.verticalPos+H0.symbolHeightInPitches(n)+s,bottom:i.verticalPos+s})),a+=H0.getSymbolWidth(n)+2},this),r},M1=S1,qe=mt,zt=at,A1=function(e,t,r,a){a||(a={});var i=a.dir!==void 0?a.dir:null,n=a.headx!==void 0?a.headx:0,s=a.extrax!==void 0?a.extrax:0,c=a.flag!==void 0?a.flag:null,o=a.dot!==void 0?a.dot:0,f=a.dotshiftx!==void 0?a.dotshiftx:0,u=a.scale!==void 0?a.scale:1,l=a.accidentalSlot!==void 0?a.accidentalSlot:[],h=a.shouldExtendStem!==void 0?a.shouldExtendStem:!1,d=a.printAccidentals!==void 0?a.printAccidentals:!0,p=r.verticalPos,g,v=0,m=0,y=0;if(t===void 0)e.addFixed(new zt("pitch is undefined",0,0,0,{type:"debug"}));else if(t==="")g=new zt(null,0,0,p);else{var x=n;if(r.printer_shift){var b=r.printer_shift==="same"?1:0;x=i==="down"?-qe.getSymbolWidth(t)*u+b:qe.getSymbolWidth(t)*u-b}var w={scalex:u,scaley:u,thickness:qe.symbolHeightInPitches(t)*u,name:r.name};if(g=new zt(t,x,qe.getSymbolWidth(t)*u,p,w),g.stemDir=i,c){var C=p+(i==="down"?-7:7)*u;h&&(i==="down"&&C>6&&(C=6),i==="up"&&C<6&&(C=6));var T=i==="down"?n:n+g.w-.6;e.addRight(new zt(c,T,qe.getSymbolWidth(c)*u,C,{scalex:u,scaley:u}))}for(m=g.w+f-2+5*o;o>0;o--){var B=1-Math.abs(p)%2;e.addRight(new zt("dots.dot",g.w+f-2+5*o,qe.getSymbolWidth("dots.dot"),p+B))}}if(g&&(g.highestVert=r.highestVert),d&&r.accidental){var E;switch(r.accidental){case"quartersharp":E="accidentals.halfsharp";break;case"dblsharp":E="accidentals.dblsharp";break;case"sharp":E="accidentals.sharp";break;case"quarterflat":E="accidentals.halfflat";break;case"flat":E="accidentals.flat";break;case"dblflat":E="accidentals.dblflat";break;case"natural":E="accidentals.nat"}for(var z=!1,I=s,F=0;F<l.length;F++)if(p-l[F][0]>=6){l[F][0]=p,I=l[F][1],z=!0;break}z===!1&&(I-=qe.getSymbolWidth(E)*u+2,l.push([p,I]),v=qe.getSymbolWidth(E)*u+2);var G=qe.symbolHeightInPitches(E);e.addExtra(new zt(E,I,qe.getSymbolWidth(E),p,{scalex:u,scaley:u,top:p+G/2,bottom:p-G/2})),y=qe.getSymbolWidth(E)/2}return{notehead:g,accidentalshiftx:v,dotshiftx:m,extraLeft:y}},B1=A1,N1=Qt,de=mt,tt=at,L1=function(e,t){e.el_type="timeSignature";var r=new N1(e,0,10,"staff-extra time-signature",t);if(e.type==="specified")for(var a=0,i=0;i<e.value.length;i++)if(i!==0&&(r.addRight(new tt("+",a+1,de.getSymbolWidth("+"),6,{thickness:de.symbolHeightInPitches("+")})),a+=de.getSymbolWidth("+")+2),e.value[i].den){for(var n=0,s=0;s<e.value[i].num.length;s++)n+=de.getSymbolWidth(e.value[i].num[s]);var c=0;for(s=0;s<e.value[i].num.length;s++)c+=de.getSymbolWidth(e.value[i].den[s]);var o=Math.max(n,c);r.addRight(new tt(e.value[i].num,a+(o-n)/2,n,8,{thickness:de.symbolHeightInPitches(e.value[i].num[0])})),r.addRight(new tt(e.value[i].den,a+(o-c)/2,c,4,{thickness:de.symbolHeightInPitches(e.value[i].den[0])})),a+=o}else{for(var f=0,u=0;u<e.value[i].num.length;u++)f+=de.getSymbolWidth(e.value[i].num[u]);r.addRight(new tt(e.value[i].num,a,f,6,{thickness:de.symbolHeightInPitches(e.value[i].num[0])})),a+=f}else e.type==="common_time"?r.addRight(new tt("timesig.common",0,de.getSymbolWidth("timesig.common"),6,{thickness:de.symbolHeightInPitches("timesig.common")})):e.type==="cut_time"?r.addRight(new tt("timesig.cut",0,de.getSymbolWidth("timesig.cut"),6,{thickness:de.symbolHeightInPitches("timesig.cut")})):e.type==="tempus_imperfectum"?r.addRight(new tt("timesig.imperfectum",0,de.getSymbolWidth("timesig.imperfectum"),6,{thickness:de.symbolHeightInPitches("timesig.imperfectum")})):e.type==="tempus_imperfectum_prolatio"?r.addRight(new tt("timesig.imperfectum2",0,de.getSymbolWidth("timesig.imperfectum2"),6,{thickness:de.symbolHeightInPitches("timesig.imperfectum2")})):e.type==="tempus_perfectum"?r.addRight(new tt("timesig.perfectum",0,de.getSymbolWidth("timesig.perfectum"),6,{thickness:de.symbolHeightInPitches("timesig.perfectum")})):e.type==="tempus_perfectum_prolatio"?r.addRight(new tt("timesig.perfectum2",0,de.getSymbolWidth("timesig.perfectum2"),6,{thickness:de.symbolHeightInPitches("timesig.perfectum2")})):console.log("time signature:",e);return r},P1=L1,D1=function(t,r,a){this.type="DynamicDecoration",this.anchor=t,this.dec=r,a==="below"?this.volumeHeightBelow=6:this.volumeHeightAbove=6,this.pitch=void 0},I1=D1,F1=function(t,r,a,i){this.type="CrescendoElem",this.anchor1=t,this.anchor2=r,this.dir=a,i==="above"?this.dynamicHeightAbove=6:this.dynamicHeightBelow=6,this.pitch=void 0},O1=F1,H1=function(t,r){this.type="GlissandoElem",this.anchor1=t,this.anchor2=r},z1=H1,Pe=function(t){this.type="TieElem",this.anchor1=t.anchor1,this.anchor2=t.anchor2,t.isGrace&&(this.isGrace=!0),t.fixedY&&(this.fixedY=!0),t.stemDir&&(this.stemDir=t.stemDir),t.voiceNumber!==void 0&&(this.voiceNumber=t.voiceNumber),t.style!==void 0&&(this.dotted=!0),this.internalNotes=[]};Pe.prototype.addInternalNote=function(e){this.internalNotes.push(e)};Pe.prototype.setEndAnchor=function(e){this.anchor2=e,this.anchor1?(this.top=Math.max(this.anchor1.pitch,this.anchor2.pitch)+4,this.bottom=Math.min(this.anchor1.pitch,this.anchor2.pitch)-4):(this.top=this.anchor2.pitch+4,this.bottom=this.anchor2.pitch-4)};Pe.prototype.setStartX=function(e){this.startLimitX=e};Pe.prototype.setEndX=function(e){this.endLimitX=e};Pe.prototype.setHint=function(){this.hint=!0};Pe.prototype.calcTieDirection=function(){if(this.isGrace)this.above=!1;else if(this.voiceNumber===0)this.above=!0;else if(this.voiceNumber>0)this.above=!1;else{var e;this.anchor1?e=this.anchor1.pitch:this.anchor2?e=this.anchor2.pitch:e=14,this.anchor1&&this.anchor1.stemDir==="down"&&this.anchor2&&this.anchor2.stemDir==="down"?this.above=!0:this.anchor1&&this.anchor1.stemDir==="up"&&this.anchor2&&this.anchor2.stemDir==="up"?this.above=!1:this.anchor1&&this.anchor2?this.above=e>=6:this.anchor1?this.above=this.anchor1.stemDir==="down":this.anchor2?this.above=this.anchor2.stemDir==="down":this.above=e>=6}};Pe.prototype.calcSlurDirection=function(){if(this.isGrace)this.above=!1;else if(this.voiceNumber===0)this.above=!0;else if(this.voiceNumber>0)this.above=!1;else{var e=!1;this.anchor1&&this.anchor1.stemDir==="down"&&(e=!0),this.anchor2&&this.anchor2.stemDir==="down"&&(e=!0);for(var t=0;t<this.internalNotes.length;t++){var r=this.internalNotes[t];r.stemDir==="down"&&(e=!0)}this.above=e}};Pe.prototype.calcX=function(e,t){this.anchor1?(this.startX=this.anchor1.x,this.anchor1.scalex<1&&(this.startX-=3)):this.startLimitX?this.startX=this.startLimitX.x+this.startLimitX.w:this.anchor2?this.startX=this.anchor2.x-20:this.startX=e,!this.anchor1&&this.dotted&&(this.startX-=3),this.anchor2?this.endX=this.anchor2.x:this.endLimitX?this.endX=this.endLimitX.x:this.endX=t};Pe.prototype.calcTieY=function(){this.anchor1?this.startY=this.anchor1.pitch:this.anchor2?this.startY=this.anchor2.pitch:this.startY=this.above?14:0,this.anchor2?this.endY=this.anchor2.pitch:this.anchor1?this.endY=this.anchor1.pitch:this.endY=this.above?14:0};Pe.prototype.calcSlurY=function(){if(this.anchor1&&this.anchor2){this.above&&this.anchor1.stemDir==="up"&&!this.fixedY?(this.startY=(this.anchor1.highestVert+this.anchor1.pitch)/2,this.startX+=this.anchor1.w/2):this.startY=this.anchor1.pitch;var e=this.anchor2.parent.beam&&this.anchor2.parent.beam.stemsUp&&this.anchor2.parent.beam.elems[0]!==this.anchor2.parent,t=(this.anchor2.highestVert+this.anchor2.pitch)/2;if(this.above&&this.anchor2.stemDir==="up"&&!this.fixedY&&!e&&t<this.startY?(this.endY=t,this.endX+=Math.round(this.anchor2.w/2)):this.endY=this.above&&e?this.anchor2.highestVert:this.anchor2.pitch,this.anchor1.scalex===1){var r=!!this.anchor1.parent.beam,a=!!this.anchor2.parent.beam;if(r){var i=this.anchor1.parent===this.anchor1.parent.beam.elems[this.anchor1.parent.beam.elems.length-1];i||(this.above?this.startY=this.anchor1.parent.fixed.t:this.startY=this.anchor1.parent.fixed.b)}if(a){var n=this.anchor2.parent===this.anchor2.parent.beam.elems[0];n||(this.above?this.endY=this.anchor2.parent.fixed.t:this.endY=this.anchor2.parent.fixed.b)}}}else this.anchor1?this.startY=this.endY=this.anchor1.pitch:this.anchor2?this.startY=this.endY=this.anchor2.pitch:(this.startY=this.above?14:0,this.endY=this.above?14:0)};Pe.prototype.avoidCollisionAbove=function(){if(this.above){for(var e=-50,t=0;t<this.internalNotes.length;t++)this.internalNotes[t].highestVert>e&&(e=this.internalNotes[t].highestVert);e>this.startY&&e>this.endY&&(this.startY=this.endY=e-1)}};Pe.prototype.getYBounds=function(){var e=10,t=1e3;this.isTie?(this.calcTieDirection(),this.calcX(e,t),this.calcTieY()):(this.calcSlurDirection(),this.calcX(e,t),this.calcSlurY());var r,a;return this.above?(a=Math.min(this.startY,this.endY),r=a+3):(r=Math.min(this.startY,this.endY),a=r-3),[r,a]};var gn=Pe,$1=I1,K0=O1,G1=z1,je=mt,Pt=at,R1=gn,rr=function(){this.startDiminuendoX=void 0,this.startCrescendoX=void 0,this.minTop=12,this.minBottom=0},Y1=function(e,t,r,a,i,n,s,c,o){for(var f,u=0;u<t.length;u++){if(t[u]==="staccato"||t[u]==="tenuto"||t[u]==="accent"&&!o){var l="scripts."+t[u];if(t[u]==="accent"&&(l="scripts.sforzato"),f===void 0?f=s==="down"?r+2:c-2:f=s==="down"?f+2:f-2,t[u]==="accent")s==="up"?f--:f++;else switch(f){case 2:case 4:case 6:case 8:case 10:s==="up"?f--:f++;break}r>9&&f++;var h=a/2;je.getSymbolAlign(l)!=="center"&&(h-=je.getSymbolWidth(l)/2),i.addFixedX(new Pt(l,h,je.getSymbolWidth(l),f))}if(t[u]==="slide"&&i.heads[0]){var d=i.heads[0].pitch;d-=2;var p=new Pt("",-n-15,0,d-1),g=new Pt("",-n-5,0,d+1);i.addFixedX(p),i.addFixedX(g),e.addOther(new R1({anchor1:p,anchor2:g,fixedY:!0}))}}return f===void 0&&(f=r),{above:f,below:i.bottom}},q1=function(e,t,r,a){for(var i=0;i<t.length;i++)switch(t[i]){case"p":case"mp":case"pp":case"ppp":case"pppp":case"f":case"ff":case"fff":case"ffff":case"sfz":case"mf":var n=new $1(r,t[i],a);e.addOther(n)}},W1=function(e,t,r,a,i){function n(){if(a.heads.length===0)return 10;for(var f=a.heads[0].pitch,u=1;u<a.heads.length;u++)f=Math.max(f,a.heads[u].pitch);return f}function s(){if(a.heads.length===0)return 2;for(var f=a.heads[0].pitch,u=1;u<a.heads.length;u++)f=Math.min(f,a.heads[u].pitch);return f}function c(f,u){var l=i==="down"?s()+1:n()+9;i!=="down"&&u===1&&l--;var h=r/2;h+=i==="down"?-5:3;for(var d=0;d<u;d++)l-=1,a.addFixedX(new Pt(f,h,je.getSymbolWidth(f),l))}for(var o=0;o<e.length;o++)switch(e[o]){case"/":c("flags.ugrace",1);break;case"//":c("flags.ugrace",2);break;case"///":c("flags.ugrace",3);break;case"////":c("flags.ugrace",4);break}},X1=function(e,t,r,a,i,n,s,c){function o(g,v){g==="above"?a.above+=v:a.below-=v}function f(g){var v;return g==="above"?(v=a.above,v<n&&(v=n)):(v=a.below,v>s&&(v=s)),v}function u(g,v,m){var y=f(v),x=2,b=5;r.addFixedX(new Pt(g,t/2,0,y+x,{type:"decoration",klass:"ornament",thickness:3,anchor:m})),o(v,b)}function l(g,v){var m=t/2;je.getSymbolAlign(g)!=="center"&&(m-=je.getSymbolWidth(g)/2);var y=je.symbolHeightInPitches(g)+1,x=f(v);x=v==="above"?x+y/2:x-y/2,r.addFixedX(new Pt(g,m,je.getSymbolWidth(g),x,{klass:"ornament",thickness:je.symbolHeightInPitches(g),position:v})),o(v,y)}for(var h={"+":"scripts.stopped",open:"scripts.open",snap:"scripts.snap",wedge:"scripts.wedge",thumb:"scripts.thumb",shortphrase:"scripts.shortphrase",mediumphrase:"scripts.mediumphrase",longphrase:"scripts.longphrase",trill:"scripts.trill",trillh:"scripts.trill",roll:"scripts.roll",irishroll:"scripts.roll",marcato:"scripts.umarcato",dmarcato:"scripts.dmarcato",umarcato:"scripts.umarcato",turn:"scripts.turn",uppermordent:"scripts.prall",pralltriller:"scripts.prall",mordent:"scripts.mordent",lowermordent:"scripts.mordent",downbow:"scripts.downbow",upbow:"scripts.upbow",fermata:"scripts.ufermata",invertedfermata:"scripts.dfermata",breath:",",coda:"scripts.coda",segno:"scripts.segno"},d=!1,p=0;p<e.length;p++)switch(e[p]){case"0":case"1":case"2":case"3":case"4":case"5":case"D.C.":case"D.S.":u(e[p],i,"middle"),d=!0;break;case"D.C.alcoda":u("D.C. al coda",i,"end"),d=!0;break;case"D.C.alfine":u("D.C. al fine",i,"end"),d=!0;break;case"D.S.alcoda":u("D.S. al coda",i,"end"),d=!0;break;case"D.S.alfine":u("D.S. al fine",i,"end"),d=!0;break;case"fine":u("FINE",i,"middle"),d=!0;break;case"+":case"open":case"snap":case"wedge":case"thumb":case"shortphrase":case"mediumphrase":case"longphrase":case"trill":case"trillh":case"roll":case"irishroll":case"marcato":case"dmarcato":case"turn":case"uppermordent":case"pralltriller":case"mordent":case"lowermordent":case"downbow":case"upbow":case"fermata":case"breath":case"umarcato":case"coda":case"segno":l(h[e[p]],i),d=!0;break;case"invertedfermata":l(h[e[p]],"below"),d=!0;break;case"mark":r.klass="mark";break;case"accent":c&&(l("scripts.sforzato",i),d=!0);break}return d};function U1(e,t,r){for(var a=0;a<e.length;a++)switch(e[a]){case"arpeggio":for(var i=t.abcelem.minpitch-1;i<=t.abcelem.maxpitch;i+=2)t.addExtra(new Pt("scripts.arpeggio",-je.getSymbolWidth("scripts.arpeggio")*2-r,0,i+2,{klass:"ornament",thickness:je.symbolHeightInPitches("scripts.arpeggio")}));break}}rr.prototype.endLine=function(e){this.startDiminuendoX&&(e.addOther(new K0(this.startDiminuendoX,Ja(e.children),">",this.dynamicPositioning)),this.startDiminuendoX=void 0),this.startCrescendoX&&(e.addOther(new K0(this.startCrescendoX,Ja(e.children),"<",this.dynamicPositioning)),this.startCrescendoX=void 0)};rr.prototype.dynamicDecoration=function(e,t,r,a){for(var i,n,s,c=0;c<t.length;c++)switch(t[c]){case"diminuendo(":this.startDiminuendoX=r,this.dynamicPositioning=a,i=void 0;break;case"diminuendo)":this.startDiminuendoX||(this.startDiminuendoX=Qa(e.children)),i={start:this.startDiminuendoX,stop:r},this.startDiminuendoX=void 0;break;case"crescendo(":this.startCrescendoX=r,this.dynamicPositioning=a,n=void 0;break;case"crescendo)":this.startCrescendoX||(this.startCrescendoX=Qa(e.children)),n={start:this.startCrescendoX,stop:r},this.startCrescendoX=void 0;break;case"~(":case"glissando(":this.startGlissandoX=r,s=void 0;break;case"~)":case"glissando)":s={start:this.startGlissandoX,stop:r},this.startGlissandoX=void 0;break}i&&e.addOther(new K0(i.start,i.stop,">",a)),n&&e.addOther(new K0(n.start,n.stop,"<",a)),s&&e.addOther(new G1(s.start,s.stop))};function Qa(e){for(var t=0;t<e.length;t++)if(e[t].abcelem.pitches)return e[t];return null}function Ja(e){return e[e.length-1]}rr.prototype.createDecoration=function(e,t,r,a,i,n,s,c,o,f,u){o||(o={ornamentPosition:"above",volumePosition:f?"above":"below",dynamicPosition:f?"above":"below"}),q1(e,t,i,o.volumePosition),this.dynamicDecoration(e,t,i,o.dynamicPosition),W1(t,r,a,i,s);var l=Y1(e,t,r,a,i,n,s,c,u);l.above=Math.max(l.above,this.minTop),l.below=Math.min(l.below,c),X1(t,a,i,l,o.ornamentPosition,this.minTop,c,u),U1(t,i,n)};var V1=rr,j1=function(t,r,a){this.type="EndingElem",this.text=t,this.anchor1=r,this.anchor2=a,this.endingHeightAbove=5,this.pitch=void 0},K1=j1,Q1=function(e){for(var t=0,r=0;r<e.voices.length;r++){var a=e.voices[r].staff;e.voices[r].duplicate||(t+=a.top,t+=-a.bottom)}return t},J1=Q1,Z1=J1,e0=function(e){this.getTextSize=e,this.voices=[],this.staffs=[],this.brace=void 0,this.bracket=void 0};e0.prototype.setLimit=function(e,t){t.specialY[e]&&(t.staff.specialY[e]?t.staff.specialY[e]=Math.max(t.staff.specialY[e],t.specialY[e]):t.staff.specialY[e]=t.specialY[e])};e0.prototype.addVoice=function(e,t,r){var a=this.voices.length;this.voices[a]=e,this.staffs[t]?this.staffs[t].voices.push(a):this.staffs[this.staffs.length]={top:10,bottom:2,lines:r,voices:[a],specialY:{tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}},e.staff=this.staffs[t]};e0.prototype.setHeight=function(){this.height=Z1(this)};e0.prototype.setWidth=function(e){this.w=e;for(var t=0;t<this.voices.length;t++)this.voices[t].setWidth(e)};e0.prototype.setStaffLimits=function(e){e.staff.top=Math.max(e.staff.top,e.top),e.staff.bottom=Math.min(e.staff.bottom,e.bottom),this.setLimit("tempoHeightAbove",e),this.setLimit("partHeightAbove",e),this.setLimit("volumeHeightAbove",e),this.setLimit("dynamicHeightAbove",e),this.setLimit("endingHeightAbove",e),this.setLimit("chordHeightAbove",e),this.setLimit("lyricHeightAbove",e),this.setLimit("lyricHeightBelow",e),this.setLimit("chordHeightBelow",e),this.setLimit("volumeHeightBelow",e),this.setLimit("dynamicHeightBelow",e)};var el=e0,tl=Qt,rl=at,Qr=function(t,r,a){this.type="TempoElement",this.tempo=t,this.tempo.type="tempo",this.tuneNumber=r,this.totalHeightInPitches=6,this.tempoHeightAbove=this.totalHeightInPitches,this.pitch=void 0,this.tempo.duration&&!this.tempo.suppressBpm&&(this.note=this.createNote(a,t,r))};Qr.prototype.setX=function(e){this.x=e};Qr.prototype.createNote=function(e,t,r){var a=.75,i=t.duration[0],n=new tl(t,i,1,"tempo",r),s,c,o;i<=1/32?(o="noteheads.quarter",c="flags.u32nd",s=0):i<=1/16?(o="noteheads.quarter",c="flags.u16th",s=0):i<=3/32?(o="noteheads.quarter",c="flags.u16nd",s=1):i<=1/8?(o="noteheads.quarter",c="flags.u8th",s=0):i<=3/16?(o="noteheads.quarter",c="flags.u8th",s=1):i<=1/4?(o="noteheads.quarter",s=0):i<=3/8?(o="noteheads.quarter",s=1):i<=1/2?(o="noteheads.half",s=0):i<=3/4?(o="noteheads.half",s=1):i<=1?(o="noteheads.whole",s=0):i<=1.5?(o="noteheads.whole",s=1):i<=2?(o="noteheads.dbl",s=0):(o="noteheads.dbl",s=1);var f=e(n,o,{verticalPos:0},{dir:"up",flag:c,dot:s,scale:a}),u=f.notehead;n.addHead(u);var l;if(o!=="noteheads.whole"&&o!=="noteheads.dbl"){var h=.3333333333333333*a,d=5*a,p=u.dx+u.w,g=-.6;l=new rl(null,p,0,h,{type:"stem",pitch2:d,linewidth:g}),n.addRight(l)}return n};var al=Qr,ar=function(t,r,a){this.type="TripletElem",this.anchor1=r,this.number=t,this.durationClass=("d"+Math.round(r.parent.durationClass*1e3)/1e3).replace(/\./,"-"),this.middleElems=[],this.flatBeams=a.flatBeams};ar.prototype.isClosed=function(){return!!this.anchor2};ar.prototype.middleNote=function(e){this.middleElems.push(e)};ar.prototype.setCloseAnchor=function(e){this.anchor2=e,(!this.anchor1.parent.beam||this.anchor1.stemDir==="up")&&(this.endingHeightAbove=4)};var il=ar;function Za(e){switch(e){case"B#":return"H#";case"B♯":return"H♯";case"B":return"H";case"Bb":return"B";case"B♭":return"B"}return e}function nl(e,t,r){var a=e.split(`
27
+ `);for(let i=0;i<a.length;i++){let s=a[i].match(/^([ABCDEFG][♯♭]?)?([^\/]+)?(\/([ABCDEFG][#b♯♭]?))?/);if(!s)continue;let c=s[1]||"",o=s[2]||"",f=s[4]||"";r&&(c=Za(c),f=Za(f));const u=t?"":"",l=f?"/"+f:"";a[i]=[c,o,l].join(u)}return a.join(`
28
+ `)}var sl=nl,$t=at,br=Se;const cl=sl;var ol=function(e,t,r,a,i,n,s,c){for(var o=0;o<r.chord.length;o++){var f=r.chord[o].position,u=r.chord[o].rel_position,l=f==="left"||f==="right"||f==="below"||f==="above"||!!u,h,d;l?(h="annotationfont",d="abcjs-annotation"):(h="gchordfont",d="abcjs-chord");var p=e.attr(h,d),g=r.chord[o].name,v;if(typeof g=="string")v=ei(g,f,u,l,h,d,p,e,t,r,a,i,n,s,c),a=v.roomTaken,i=v.roomTakenRight;else for(var m=0;m<g.length;m++)v=ei(g[m].text,f,u,l,h,d,p,e,t,r,a,i,n,s,c),a=v.roomTaken,i=v.roomTakenRight}return{roomTaken:a,roomTakenRight:i}};function ei(e,t,r,a,i,n,s,c,o,f,u,l,h,d,p){for(var g=e.split(`
29
+ `),v=g.length-1;v>=0;v--){var m=g[v],y=0,x;a||(m=cl(m,d,p));var b=c.calc(m,i,n),w=b.width,C=b.height/br.STEP;switch(t){case"left":u+=w+7,y=-u,x=f.averagepitch,o.addExtra(new $t(m,y,w+4,x,{type:"text",height:C,dim:s,position:"left"}));break;case"right":l+=4,y=l,x=f.averagepitch,o.addRight(new $t(m,y,w+4,x,{type:"text",height:C,dim:s,position:"right"}));break;case"below":o.addRight(new $t(m,0,0,void 0,{type:"text",position:"below",height:C,dim:s,realWidth:w}));break;case"above":o.addRight(new $t(m,0,0,void 0,{type:"text",position:"above",height:C,dim:s,realWidth:w}));break;default:if(r){var T=r.y+3*br.STEP;o.addRight(new $t(m,y+r.x,0,f.minpitch+T/br.STEP,{position:"relative",type:"text",height:C,dim:s}))}else{var B="above";f.positioning&&f.positioning.chordPosition&&(B=f.positioning.chordPosition),B!=="hidden"&&o.addCentered(new $t(m,h/2,w,void 0,{type:"chord",position:B,height:C,dim:s,realWidth:w}))}}}return{roomTaken:u,roomTakenRight:l}}var ll=ol,Vt=Qt,bn=g1,ti=b1,mn=_1,yn=M1,k0=B1,wn=P1,hl=V1,xn=K1,b0=mt,pe=at,_0=Se,fl=el,Cn=al,jt=gn,ul=il,dl=an,kn=ll,pl=Ji,gt=rt,Ir=function(e){var t=0;return e.duration&&(t=e.duration),t},Ke=!1,Ve={rest:{0:"rests.whole",1:"rests.half",2:"rests.quarter",3:"rests.8th",4:"rests.16th",5:"rests.32nd",6:"rests.64th",7:"rests.128th",multi:"rests.multimeasure"},note:{"-1":"noteheads.dbl",0:"noteheads.whole",1:"noteheads.half",2:"noteheads.quarter",3:"noteheads.quarter",4:"noteheads.quarter",5:"noteheads.quarter",6:"noteheads.quarter",7:"noteheads.quarter",nostem:"noteheads.quarter"},rhythm:{"-1":"noteheads.slash.whole",0:"noteheads.slash.whole",1:"noteheads.slash.whole",2:"noteheads.slash.quarter",3:"noteheads.slash.quarter",4:"noteheads.slash.quarter",5:"noteheads.slash.quarter",6:"noteheads.slash.quarter",7:"noteheads.slash.quarter",nostem:"noteheads.slash.nostem"},x:{"-1":"noteheads.indeterminate",0:"noteheads.indeterminate",1:"noteheads.indeterminate",2:"noteheads.indeterminate",3:"noteheads.indeterminate",4:"noteheads.indeterminate",5:"noteheads.indeterminate",6:"noteheads.indeterminate",7:"noteheads.indeterminate",nostem:"noteheads.indeterminate"},harmonic:{"-1":"noteheads.harmonic.quarter",0:"noteheads.harmonic.quarter",1:"noteheads.harmonic.quarter",2:"noteheads.harmonic.quarter",3:"noteheads.harmonic.quarter",4:"noteheads.harmonic.quarter",5:"noteheads.harmonic.quarter",6:"noteheads.harmonic.quarter",7:"noteheads.harmonic.quarter",nostem:"noteheads.harmonic.quarter"},triangle:{"-1":"noteheads.triangle.quarter",0:"noteheads.triangle.quarter",1:"noteheads.triangle.quarter",2:"noteheads.triangle.quarter",3:"noteheads.triangle.quarter",4:"noteheads.triangle.quarter",5:"noteheads.triangle.quarter",6:"noteheads.triangle.quarter",7:"noteheads.triangle.quarter",nostem:"noteheads.triangle.quarter"},uflags:{3:"flags.u8th",4:"flags.u16th",5:"flags.u32nd",6:"flags.u64th"},dflags:{3:"flags.d8th",4:"flags.d16th",5:"flags.d32nd",6:"flags.d64th"}},ve=function(e,t,r){this.decoration=new hl,this.getTextSize=e,this.tuneNumber=t,this.isBagpipes=r.bagpipes,this.flatBeams=r.flatbeams,this.graceSlurs=r.graceSlurs,this.percmap=r.percmap,this.initialClef=r.initialClef,this.jazzchords=!!r.jazzchords,this.accentAbove=!!r.accentAbove,this.germanAlphabet=!!r.germanAlphabet,this.reset()};ve.prototype.reset=function(){this.slurs={},this.ties=[],this.voiceScale=1,this.voiceColor=void 0,this.slursbyvoice={},this.tiesbyvoice={},this.endingsbyvoice={},this.scaleByVoice={},this.colorByVoice={},this.tripletmultiplier=1,this.abcline=void 0,this.accidentalSlot=void 0,this.accidentalshiftx=void 0,this.dotshiftx=void 0,this.hasVocals=!1,this.minY=void 0,this.partstartelem=void 0,this.startlimitelem=void 0,this.stemdir=void 0};ve.prototype.setStemHeight=function(e){this.stemHeight=Math.round(e*10/_0.STEP)/10};ve.prototype.getCurrentVoiceId=function(e,t){return"s"+e+"v"+t};ve.prototype.pushCrossLineElems=function(e,t){this.slursbyvoice[this.getCurrentVoiceId(e,t)]=this.slurs,this.tiesbyvoice[this.getCurrentVoiceId(e,t)]=this.ties,this.endingsbyvoice[this.getCurrentVoiceId(e,t)]=this.partstartelem,this.scaleByVoice[this.getCurrentVoiceId(e,t)]=this.voiceScale,this.voiceColor&&(this.colorByVoice[this.getCurrentVoiceId(e,t)]=this.voiceColor)};ve.prototype.popCrossLineElems=function(e,t){this.slurs=this.slursbyvoice[this.getCurrentVoiceId(e,t)]||{},this.ties=this.tiesbyvoice[this.getCurrentVoiceId(e,t)]||[],this.partstartelem=this.endingsbyvoice[this.getCurrentVoiceId(e,t)],this.voiceScale=this.scaleByVoice[this.getCurrentVoiceId(e,t)],this.voiceScale===void 0&&(this.voiceScale=1),this.voiceColor=this.colorByVoice[this.getCurrentVoiceId(e,t)]};ve.prototype.containsLyrics=function(e){for(var t=0;t<e.length;t++)for(var r=0;r<e[t].voices.length;r++)for(var a=0;a<e[t].voices[r].length;a++){var i=e[t].voices[r][a];if(i.lyric){(!i.positioning||i.positioning.vocalPosition==="below")&&(this.hasVocals=!0);return}}};ve.prototype.createABCLine=function(e,t,r){this.minY=2,this.containsLyrics(e);var a=new fl(this.getTextSize);this.tempoSet=!1;for(var i=0;i<e.length;i++)Ke&&this.restoreState(),Ke=!1,this.createABCStaff(a,e[i],t,i,r);return a};ve.prototype.createABCStaff=function(e,t,r,a,i){e.getTextSize.updateFonts(t);for(var n=0;n<t.voices.length;n++){var s=new dl(n,t.voices.length);n===0?(s.barfrom=t.connectBarLines==="start"||t.connectBarLines==="continue",s.barto=t.connectBarLines==="continue"||t.connectBarLines==="end"):s.duplicate=!0,t.title&&t.title[n]&&(s.header=t.title[n].replace(/\\n/g,`
30
+ `),s.headerPosition=6+e.getTextSize.baselineToCenter(s.header,"voicefont","staff-extra voice-name",n,t.voices.length)/_0.STEP),t.clef&&t.clef.type==="perc"&&(s.isPercussion=!0);var c=(!this.initialClef||i===0)&&mn(t.clef,this.tuneNumber);c&&(n===0&&t.barNumber&&this.addMeasureNumber(t.barNumber,c),s.addChild(c),this.startlimitelem=c);var o=yn(t.key,this.tuneNumber);if(o&&(s.addChild(o),this.startlimitelem=o),t.meter){t.meter.type==="specified"?this.measureLength=t.meter.value[0].num/t.meter.value[0].den:this.measureLength=1;var f=wn(t.meter,this.tuneNumber);s.addChild(f),this.startlimitelem=f}s.duplicate&&(s.children=[]);var u=t.clef.stafflines||t.clef.stafflines===0?t.clef.stafflines:5;e.addVoice(s,a,u);var l=u===1;this.createABCVoice(t.voices[n],r,a,n,l,s),e.setStaffLimits(s),n===0&&(t.brace==="start"||!e.brace&&t.brace?(e.brace||(e.brace=[]),e.brace.push(new ti(s,"brace"))):t.brace==="end"&&e.brace?e.brace[e.brace.length-1].setBottomStaff(s):t.brace==="continue"&&e.brace&&e.brace[e.brace.length-1].continuing(s),t.bracket==="start"||!e.bracket&&t.bracket?(e.bracket||(e.bracket=[]),e.bracket.push(new ti(s,"bracket"))):t.bracket==="end"&&e.bracket?e.bracket[e.bracket.length-1].setBottomStaff(s):t.bracket==="continue"&&e.bracket&&e.bracket[e.bracket.length-1].continuing(s))}};function vl(e,t){var r=e[t];if(r.el_type!=="note"||!r.startBeam||r.endBeam)return{count:1,elem:r};for(var a=[];t<e.length&&e[t].el_type==="note"&&(a.push(e[t]),!e[t].endBeam);)t++;return{count:a.length,elem:a}}ve.prototype.createABCVoice=function(e,t,r,a,i,n){this.popCrossLineElems(r,a),this.stemdir=this.isBagpipes?"down":null,this.abcline=e,this.partstartelem&&(this.partstartelem=new xn("",null,null),n.addOther(this.partstartelem));var s=n.voicetotal<2?-1:n.voicenumber;for(var c in this.slurs)this.slurs.hasOwnProperty(c)&&(this.slurs[c]=new jt({force:this.slurs[c].force,voiceNumber:s,stemDir:this.slurs[c].stemDir,style:this.slurs[c].dotted}),Ke&&this.slurs[c].setHint(),n.addOther(this.slurs[c]));for(var o=0;o<this.ties.length;o++)this.ties[o]=new jt({force:this.ties[o].force,stemDir:this.ties[o].stemDir,voiceNumber:s,style:this.ties[o].dotted}),Ke&&this.ties[o].setHint(),n.addOther(this.ties[o]);for(var f=0;f<this.abcline.length;f++)gl(this.abcline[f]),this.minY=Math.min(this.abcline[f].minpitch,this.minY);for(var u=r===0,l=0;l<this.abcline.length;){var h=vl(this.abcline,l),d=this.createABCElement(u,i,n,h.elem);if(d)for(o=0;o<d.length;o++){if(!this.tempoSet&&t&&!t.suppress){this.tempoSet=!0;var p=new Vt(t,0,0,"tempo",this.tuneNumber,{});p.addFixedX(new Cn(t,this.tuneNumber,k0)),n.addChild(p)}n.addChild(d[o])}l+=h.count}this.decoration.endLine(n),this.pushCrossLineElems(r,a)};ve.prototype.saveState=function(){this.tiesSave=gt.cloneArray(this.ties),this.slursSave=gt.cloneHashOfHash(this.slurs),this.slursbyvoiceSave=gt.cloneHashOfHash(this.slursbyvoice),this.tiesbyvoiceSave=gt.cloneHashOfArrayOfHash(this.tiesbyvoice)};ve.prototype.restoreState=function(){this.ties=gt.cloneArray(this.tiesSave),this.slurs=gt.cloneHashOfHash(this.slursSave),this.slursbyvoice=gt.cloneHashOfHash(this.slursbyvoiceSave),this.tiesbyvoice=gt.cloneHashOfArrayOfHash(this.tiesbyvoiceSave)};ve.prototype.createABCElement=function(e,t,r,a){var i=[];switch(a.el_type){case void 0:i=this.createBeam(t,r,a);break;case"note":i[0]=this.createNote(a,!1,t,r),this.triplet&&this.triplet.isClosed()&&(r.addOther(this.triplet),this.triplet=null,this.tripletmultiplier=1);break;case"bar":i[0]=this.createBarLine(r,a,e),r.duplicate&&i.length>0&&(i[0].invisible=!0);break;case"meter":i[0]=wn(a,this.tuneNumber),this.startlimitelem=i[0],r.duplicate&&i.length>0&&(i[0].invisible=!0);break;case"clef":if(i[0]=mn(a,this.tuneNumber),!i[0])return null;r.duplicate&&i.length>0&&(i[0].invisible=!0);break;case"key":var n=yn(a,this.tuneNumber);n&&(i[0]=n,this.startlimitelem=i[0]),r.duplicate&&i.length>0&&(i[0].invisible=!0);break;case"stem":this.stemdir=a.direction==="auto"?void 0:a.direction;break;case"part":var s=new Vt(a,0,0,"part",this.tuneNumber),c=this.getTextSize.calc(a.title,"partsfont","part");s.addFixedX(new pe(a.title,0,0,void 0,{type:"part",height:c.height/_0.STEP})),i[0]=s;break;case"tempo":var o=new Vt(a,0,0,"tempo",this.tuneNumber);a.suppress||o.addFixedX(new Cn(a,this.tuneNumber,k0)),i[0]=o;break;case"style":a.head==="normal"?delete this.style:this.style=a.head;break;case"hint":Ke=!0,this.saveState();break;case"midi":break;case"scale":this.voiceScale=a.size;break;case"color":this.voiceColor=a.color,r.color=this.voiceColor;break;default:var f=new Vt(a,0,0,"unsupported",this.tuneNumber);f.addFixed(new pe("element type "+a.el_type,0,0,void 0,{type:"debug"})),i[0]=f}return i};function gl(e){if(e.pitches){bl(e);for(var t=0,r=0;r<e.pitches.length;r++)t+=e.pitches[r].verticalPos;e.averagepitch=t/e.pitches.length,e.minpitch=e.pitches[0].verticalPos,e.maxpitch=e.pitches[e.pitches.length-1].verticalPos}}ve.prototype.createBeam=function(e,t,r){var a=[],i=new bn(this.stemHeight*this.voiceScale,this.stemdir,this.flatBeams,r[0]);Ke&&i.setHint();for(var n=0;n<r.length;n++)i.runningDirection(r[n]);i.setStemDirection();var s=this.stemdir;for(this.stemdir=i.stemsUp?"up":"down",n=0;n<r.length;n++){var c=r[n],o=this.createNote(c,!0,e,t);a.push(o),i.add(o),this.triplet&&this.triplet.isClosed()&&(t.addOther(this.triplet),this.triplet=null,this.tripletmultiplier=1)}return i.calcDir(),t.addBeam(i),this.stemdir=s,a};var bl=function(e){var t;do{t=!0;for(var r=0;r<e.pitches.length-1;r++)if(e.pitches[r].pitch>e.pitches[r+1].pitch){t=!1;var a=e.pitches[r];e.pitches[r]=e.pitches[r+1],e.pitches[r+1]=a}}while(!t)},_n=function(e,t,r,a,i,n,s,c,o){for(var f=r;f>11;f--)f%2===0&&!a&&e.addFixed(new pe(null,c,(i+4)*o,f,{type:"ledger"}));for(f=t;f<1;f++)f%2===0&&!a&&e.addFixed(new pe(null,c,(i+4)*o,f,{type:"ledger"}));for(f=0;f<n.length;f++){var u=i;s==="down"&&(u=-u),e.addFixed(new pe(null,u+c,(i+4)*o,n[f],{type:"ledger"}))}};ve.prototype.addGraceNotes=function(e,t,r,a,i,n,s){var c=.6,o=3.5/5;i=Math.round(i*o);var f=null,u;e.gracenotes.length>1&&(f=new bn(i,"grace",n),Ke&&f.setHint(),f.mainNote=r);var l,h=[];for(l=e.gracenotes.length-1;l>=0;l--)s+=10,h[l]=s,e.gracenotes[l].accidental&&(s+=7);for(l=0;l<e.gracenotes.length;l++){var d=e.gracenotes[l].verticalPos;u=f?null:Ve.uflags[n?5:3];var p=[],g=k0(r,"noteheads.quarter",e.gracenotes[l],{dir:"up",headx:-h[l],extrax:-h[l],flag:u,scale:c*this.voiceScale,accidentalSlot:p});g.notehead.highestVert=g.notehead.pitch+i;var v=g.notehead;if(this.addSlursAndTies(r,e.gracenotes[l],v,t,"up",!0),r.addExtra(v),e.gracenotes[l].acciaccatura){var m=e.gracenotes[l].verticalPos+7*c,y=f?5:6;r.addRight(new pe("flags.ugrace",-h[l]+y,0,m,{scalex:c,scaley:c}))}if(f){var x=e.gracenotes[l].duration/2;n&&(x/=2);var b={heads:[v],abcelem:{averagepitch:d,minpitch:d,maxpitch:d,duration:x}};f.add(b)}else{var w=d+.3333333333333333*c,C=d+7*c,T=v.dx+v.w,B=-.6;r.addExtra(new pe(null,T,0,w,{type:"stem",pitch2:C,linewidth:B}))}_n(r,d,d,!1,b0.getSymbolWidth("noteheads.quarter"),[],!0,v.dx-1,.6);var E=e.rest&&(e.rest.type==="spacer"||e.rest.type==="invisible");l===0&&!n&&this.graceSlurs&&!E&&t.addOther(new jt({anchor1:v,anchor2:a,isGrace:!0}))}return f&&(f.calcDir(),t.addBeam(f)),s};function ml(e,t,r,a,i,n,s,c,o){var f,u=7,l,h,d;switch(i&&(n==="down"&&(u=3),n==="up"&&(u=11)),s&&(r<.5||r<1?u=7:u=5),t.rest.type){case"whole":f=Ve.rest[0],t.averagepitch=u,t.minpitch=u,t.maxpitch=u,a=0;break;case"rest":t.style==="rhythm"?f=Ve.rhythm[-c]:f=Ve.rest[-c],t.averagepitch=u,t.minpitch=u,t.maxpitch=u;break;case"invisible":case"invisible-multimeasure":case"spacer":f="",t.averagepitch=u,t.minpitch=u,t.maxpitch=u;break;case"multimeasure":f=Ve.rest.multi,t.averagepitch=u,t.minpitch=u,t.maxpitch=u,a=0;var p=b0.getSymbolWidth(f);e.addHead(new pe(f,p,p*2,7));var g=new pe(""+t.rest.text,p,p,16,{type:"multimeasure-text"});e.addExtra(g)}if(t.rest.type.indexOf("multimeasure")<0&&t.rest.type!=="invisible"){var v=k0(e,f,{verticalPos:u},{dot:a,scale:o});l=v.notehead,l&&(e.addHead(l),h=v.accidentalshiftx,d=v.dotshiftx)}return{noteHead:l,roomTaken:h,roomTakenRight:d}}function ri(e,t){for(var r=0;r<e.length;r++)if(JSON.stringify(e[r])===JSON.stringify(t))return;e.push(t)}ve.prototype.addNoteToAbcElement=function(e,t,r,a,i,n,s,c,o){var f=0,u,l=0,h=0,d,p,g=[],v=[],m=0,y=t.averagepitch>=6?"down":"up";a&&(y=a),i=t.style?t.style:i,(!i||i==="normal")&&(i="note");var x;n?x=Ve[i].nostem:x=Ve[i][-s],x||console.log("noteSymbol:",i,s,n);var b;for(b=y==="down"?t.pitches.length-2:1;y==="down"?b>=0:b<t.pitches.length;b=y==="down"?b-1:b+1){var w=t.pitches[y==="down"?b+1:b-1],C=t.pitches[b],T=y==="down"?w.pitch-C.pitch:C.pitch-w.pitch;T<=1&&!w.printer_shift&&(C.printer_shift=T?"different":"same",(C.verticalPos>11||C.verticalPos<1)&&g.push(C.verticalPos-C.verticalPos%2),y==="down"?l=b0.getSymbolWidth(x)+2:f=b0.getSymbolWidth(x)+2)}var B=t.pitches.length;for(b=0;b<t.pitches.length;b++){if(!c){var E;y==="down"&&b!==0||y==="up"&&b!==B-1?E=null:E=Ve[y==="down"?"dflags":"uflags"][-s]}var z;if(t.pitches[b].style)z=Ve[t.pitches[b].style][-s];else if(o.isPercussion&&this.percmap){z=x;var I=this.percmap[pl(t.pitches[b])];I&&I.noteHead&&Ve[I.noteHead]&&(z=Ve[I.noteHead][-s])}else z=x;t.pitches[b].highestVert=t.pitches[b].verticalPos;var F=(a==="up"||y==="up")&&b===0,G=(a==="down"||y==="down")&&b===B-1;if(F||G){if((t.startSlur||B===1)&&(t.pitches[b].highestVert=t.pitches[B-1].verticalPos,Ir(t)<1&&(a==="up"||y==="up")&&(t.pitches[b].highestVert+=6)),t.startSlur)for(t.pitches[b].startSlur||(t.pitches[b].startSlur=[]),p=0;p<t.startSlur.length;p++)ri(t.pitches[b].startSlur,t.startSlur[p]);if(t.endSlur)for(t.pitches[b].highestVert=t.pitches[B-1].verticalPos,Ir(t)<1&&(a==="up"||y==="up")&&(t.pitches[b].highestVert+=6),t.pitches[b].endSlur||(t.pitches[b].endSlur=[]),p=0;p<t.endSlur.length;p++)ri(t.pitches[b].endSlur,t.endSlur[p])}var Y=!c&&s<=-1,K=k0(e,z,t.pitches[b],{dir:y,extrax:-l,flag:E,dot:r,dotshiftx:f,scale:this.voiceScale,accidentalSlot:v,shouldExtendStem:!a,printAccidentals:!o.isPercussion});m=Math.max(b0.getSymbolWidth(z),m),e.extraw-=K.extraLeft,u=K.notehead,u&&(this.addSlursAndTies(e,t.pitches[b],u,o,Y?y:null,!1),t.gracenotes&&t.gracenotes.length>0&&(u.bottom=u.bottom-1),e.addHead(u)),l+=K.accidentalshiftx,h=Math.max(h,K.dotshiftx)}if(Y){var P=Math.round(70*this.voiceScale)/10,k=y==="down"?t.minpitch-P:t.minpitch+1/3;k>6&&!a&&(k=6);var _=y==="down"?t.maxpitch-1/3:t.maxpitch+P;_<6&&!a&&(_=6);var L=y==="down"||e.heads.length===0?0:e.heads[0].w,A=y==="down"?1:-1;u&&u.c==="noteheads.slash.quarter"&&(y==="down"?_-=1:k+=1),u&&u.c==="noteheads.triangle.quarter"&&(y==="down"?_-=.7:k-=1.2),e.addRight(new pe(null,L,0,k,{type:"stem",pitch2:_,linewidth:A,bottom:k-1})),d=Math.min(k,_)}return{noteHead:u,roomTaken:l,roomTakenRight:h,min:d,additionalLedgers:g,dir:y,symbolWidth:m}};ve.prototype.addLyric=function(e,t){var r="";t.lyric.forEach(function(n){var s=n.divider===" "?"":n.divider;r+=n.syllable+s+`
31
+ `});var a=this.getTextSize.calc(r,"vocalfont","lyric"),i=t.positioning?t.positioning.vocalPosition:"below";e.addCentered(new pe(r,0,a.width,void 0,{type:"lyric",position:i,height:a.height/_0.STEP,dim:this.getTextSize.attr("vocalfont","lyric")}))};ve.prototype.createNote=function(e,t,r,a){var i=null,n=0,s=0,c=0,o=[],f,u=Ir(e),l=!1;u===0&&(l=!0,u=.25,t=!0);for(var h=Math.floor(Math.log(u)/Math.log(2)),d=0,p=Math.pow(2,h),g=p/2;p<u;d++,p+=g,g/=2);e.startTriplet&&(this.tripletmultiplier=e.tripletMultiplier);var v=u*this.tripletmultiplier;e.rest&&e.rest.type==="multimeasure"&&(v=1),e.rest&&e.rest.type==="invisible-multimeasure"&&(v=this.measureLength*e.rest.text);var m=e.rest?"rest":"note",y=new Vt(e,v,1,m,this.tuneNumber,{durationClassOveride:e.duration*this.tripletmultiplier});if(Ke&&y.setHint(),e.rest){this.measureLength===u&&e.rest.type!=="invisible"&&e.rest.type!=="spacer"&&e.rest.type.indexOf("multimeasure")<0&&(e.rest.type="whole");var x=ml(y,e,u,d,a.voicetotal>1,this.stemdir,r,h,this.voiceScale);i=x.noteHead,n=x.roomTaken,s=x.roomTakenRight}else{var b=this.addNoteToAbcElement(y,e,d,this.stemdir,this.style,l,h,t,a);b.min!==void 0&&(this.minY=Math.min(b.min,this.minY)),i=b.noteHead,n=b.roomTaken,s=b.roomTakenRight,o=b.additionalLedgers,f=b.dir,c=b.symbolWidth}if(e.lyric!==void 0&&this.addLyric(y,e),e.gracenotes!==void 0&&(n+=this.addGraceNotes(e,a,y,i,this.stemHeight*this.voiceScale,this.isBagpipes,n)),e.decoration){var w=t&&f!=="up"?Math.min(-3,y.bottom-6):y.bottom;this.decoration.createDecoration(a,e.decoration,y.top,i?i.w:0,y,n,f,w,e.positioning,this.hasVocals,this.accentAbove)}if(e.barNumber&&y.addFixed(new pe(e.barNumber,-10,0,0,{type:"barNumber"})),_n(y,e.minpitch,e.maxpitch,e.rest,c,o,f,-2,1),e.chord!==void 0){var C=kn(this.getTextSize,y,e,n,s,c,this.jazzchords,this.germanAlphabet);n=C.roomTaken,s=C.roomTakenRight}return e.startTriplet&&(this.triplet=new ul(e.startTriplet,i,{flatBeams:this.flatBeams})),e.endTriplet&&this.triplet&&this.triplet.setCloseAnchor(i),this.triplet&&!e.startTriplet&&!e.endTriplet&&!(e.rest&&e.rest.type==="spacer")&&this.triplet.middleNote(i),y};ve.prototype.addSlursAndTies=function(e,t,r,a,i,n){if(t.endTie&&this.ties.length>0){for(var s=!1,c=0;c<this.ties.length;c++)if(this.ties[c].anchor1&&this.ties[c].anchor1.pitch===r.pitch){this.ties[c].setEndAnchor(r),a.setRange(this.ties[c]),this.ties.splice(c,1),s=!0;break}s||(this.ties[0].setEndAnchor(r),a.setRange(this.ties[0]),this.ties.splice(0,1))}var o=a.voicetotal<2?-1:a.voicenumber;if(t.startTie){var f=new jt({anchor1:r,force:this.stemdir==="down"||this.stemdir==="up",stemDir:this.stemdir,isGrace:n,voiceNumber:o,style:t.startTie.style});Ke&&f.setHint(),this.ties[this.ties.length]=f,a.addOther(f),e.startTie=!0}var u,l;if(t.endSlur)for(var h=0;h<t.endSlur.length;h++)l=t.endSlur[h],this.slurs[l]?(u=this.slurs[l],u.setEndAnchor(r),a.setRange(u),delete this.slurs[l]):(u=new jt({anchor2:r,stemDir:this.stemdir,voiceNumber:o}),Ke&&u.setHint(),a.addOther(u)),this.startlimitelem&&u.setStartX(this.startlimitelem);else if(!n)for(var d in this.slurs)this.slurs.hasOwnProperty(d)&&this.slurs[d].addInternalNote(r);if(t.startSlur)for(h=0;h<t.startSlur.length;h++)l=t.startSlur[h].label,u=new jt({anchor1:r,stemDir:this.stemdir,voiceNumber:o,style:t.startSlur[h].style}),Ke&&u.setHint(),this.slurs[l]=u,a.addOther(u)};ve.prototype.addMeasureNumber=function(e,t){var r=this.getTextSize.calc(e,"measurefont","bar-number"),a=0;t.isClef&&(a+=r.width/2);var i=r.width>10&&t.abcelem.type==="treble"?13.5:11;t.addFixed(new pe(e,a,r.width,i+r.height/_0.STEP,{type:"barNumber",dim:this.getTextSize.attr("measurefont","bar-number")}))};ve.prototype.createBarLine=function(e,t,r){var a=new Vt(t,0,10,"bar",this.tuneNumber),i=null,n=0;t.barNumber&&this.addMeasureNumber(t.barNumber,a);var s=t.type==="bar_right_repeat"||t.type==="bar_dbl_repeat",c=t.type!=="bar_left_repeat"&&t.type!=="bar_thick_thin"&&t.type!=="bar_invisible",o=t.type==="bar_right_repeat"||t.type==="bar_dbl_repeat"||t.type==="bar_left_repeat"||t.type==="bar_thin_thick"||t.type==="bar_thick_thin",f=t.type==="bar_left_repeat"||t.type==="bar_thick_thin"||t.type==="bar_thin_thin"||t.type==="bar_dbl_repeat",u=t.type==="bar_left_repeat"||t.type==="bar_dbl_repeat";if(s||u){for(var l in this.slurs)this.slurs.hasOwnProperty(l)&&this.slurs[l].setEndX(a);this.startlimitelem=a}if(s&&(a.addRight(new pe("dots.dot",n,1,7)),a.addRight(new pe("dots.dot",n,1,5)),n+=6),c&&(i=new pe(null,n,1,2,{type:"bar",pitch2:10,linewidth:.6}),a.addRight(i)),t.type==="bar_invisible"&&(i=new pe(null,n,1,2,{type:"none",pitch2:10,linewidth:.6}),a.addRight(i)),t.decoration&&this.decoration.createDecoration(e,t.decoration,12,o?3:1,a,0,"down",2,t.positioning,this.hasVocals,this.accentAbove),o&&(n+=4,i=new pe(null,n,4,2,{type:"bar",pitch2:10,linewidth:4}),a.addRight(i),n+=5),this.partstartelem&&t.endEnding&&(this.partstartelem.anchor2=i,this.partstartelem=null),f&&(n+=3,i=new pe(null,n,1,2,{type:"bar",pitch2:10,linewidth:.6}),a.addRight(i)),u&&(n+=3,a.addRight(new pe("dots.dot",n,1,7)),a.addRight(new pe("dots.dot",n,1,5))),t.startEnding&&r&&e.voicenumber===0){var h=this.getTextSize.calc(t.startEnding,"repeatfont","").width;a.minspacing+=h+10,this.partstartelem=new xn(t.startEnding,i,null),e.addOther(this.partstartelem)}return a.extraw-=5,t.chord!==void 0&&kn(this.getTextSize,a,t,0,0,0,!1,this.germanAlphabet),a};var yl=ve,Ee="http://www.w3.org/2000/svg";function ie(e){this.svg=Jr(),this.currentGroup=[],e.appendChild(this.svg)}ie.prototype.clear=function(){if(this.svg){var e=this.svg.parentNode;this.svg=Jr(),this.currentGroup=[],e&&(e.innerHTML="",e.appendChild(this.svg))}};ie.prototype.setTitle=function(e){var t=document.createElement("title"),r=document.createTextNode(e);t.appendChild(r),this.svg.insertBefore(t,this.svg.firstChild)};ie.prototype.setResponsiveWidth=function(e,t){if(this.svg.setAttribute("viewBox","0 0 "+e+" "+t),this.svg.setAttribute("preserveAspectRatio","xMinYMin meet"),this.svg.removeAttribute("height"),this.svg.removeAttribute("width"),this.svg.style.display="inline-block",this.svg.style.position="absolute",this.svg.style.top="0",this.svg.style.left="0",this.svg.parentNode){var r=this.svg.parentNode.getAttribute("class");r?r.indexOf("abcjs-container")<0&&this.svg.parentNode.setAttribute("class",r+" abcjs-container"):this.svg.parentNode.setAttribute("class","abcjs-container"),this.svg.parentNode.style.display="inline-block",this.svg.parentNode.style.position="relative",this.svg.parentNode.style.width="100%";var a=t/e*100;this.svg.parentNode.style["padding-bottom"]=a+"%",this.svg.parentNode.style["vertical-align"]="middle",this.svg.parentNode.style.overflow="hidden"}};ie.prototype.setSize=function(e,t){this.svg.setAttribute("width",e),this.svg.setAttribute("height",t)};ie.prototype.setAttribute=function(e,t){this.svg.setAttribute(e,t)};ie.prototype.setScale=function(e){e!==1?(this.svg.style.transform="scale("+e+","+e+")",this.svg.style["-ms-transform"]="scale("+e+","+e+")",this.svg.style["-webkit-transform"]="scale("+e+","+e+")",this.svg.style["transform-origin"]="0 0",this.svg.style["-ms-transform-origin-x"]="0",this.svg.style["-ms-transform-origin-y"]="0",this.svg.style["-webkit-transform-origin-x"]="0",this.svg.style["-webkit-transform-origin-y"]="0"):(this.svg.style.transform="",this.svg.style["-ms-transform"]="",this.svg.style["-webkit-transform"]="")};ie.prototype.insertStyles=function(e){var t=document.createElementNS(Ee,"style");t.textContent=e,this.svg.insertBefore(t,this.svg.firstChild)};ie.prototype.setParentStyles=function(e){for(var t in e)e.hasOwnProperty(t)&&this.svg.parentNode&&(this.svg.parentNode.style[t]=e[t]);if(this.dummySvg){var r=document.querySelector("body");r.removeChild(this.dummySvg),this.dummySvg=null}};function ai(e,t,r){var a=r-e;return"M "+e+" "+t+" l "+a+" 0 l 0 1 l "+-a+" 0 z "}function ii(e,t,r){var a=r-t;return"M "+e+" "+t+" l 0 "+a+" l 1 0 l 0 "+-a+" z "}ie.prototype.rect=function(e){var t=[],r=e.x,a=e.y,i=e.x+e.width,n=e.y+e.height;return t.push(ai(r,a,i)),t.push(ai(r,n,i)),t.push(ii(i,a,n)),t.push(ii(r,n,a)),this.path({path:t.join(" "),stroke:"none","data-name":e["data-name"]})};ie.prototype.dottedLine=function(e){var t=document.createElementNS(Ee,"line");t.setAttribute("x1",e.x1),t.setAttribute("x2",e.x2),t.setAttribute("y1",e.y1),t.setAttribute("y2",e.y2),t.setAttribute("stroke",e.stroke),t.setAttribute("stroke-dasharray","5,5"),this.svg.insertBefore(t,this.svg.firstChild)};ie.prototype.rectBeneath=function(e){var t=document.createElementNS(Ee,"rect");t.setAttribute("x",e.x),t.setAttribute("width",e.width),t.setAttribute("y",e.y),t.setAttribute("height",e.height),e.stroke&&t.setAttribute("stroke",e.stroke),e["stroke-opacity"]&&t.setAttribute("stroke-opacity",e["stroke-opacity"]),e.fill&&t.setAttribute("fill",e.fill),e["fill-opacity"]&&t.setAttribute("fill-opacity",e["fill-opacity"]),this.svg.insertBefore(t,this.svg.firstChild)};ie.prototype.text=function(e,t,r,a){var i=document.createElementNS(Ee,"text");i.setAttribute("stroke","none");for(var n in t)t.hasOwnProperty(n)&&i.setAttribute(n,t[n]);for(var s=t["data-name"]=="free-text",c=(""+e).split(`
32
+ `),o=0;o<c.length;o++)if(!(s&&c[o]=="")){var f=document.createElementNS(Ee,"tspan");if(a)for(var u in a)a.hasOwnProperty(u)&&f.setAttribute(u,a[u]);if(f.setAttribute("x",t.x?t.x:0),o!==0&&f.setAttribute("dy","1.2em"),c[o].indexOf("")!==-1){var l=c[o].split("");if(f.textContent=l[0],l[1]){var h=document.createElementNS(Ee,"tspan");h.setAttribute("dy","-0.3em"),h.setAttribute("style","font-size:0.7em"),h.textContent=l[1],f.appendChild(h)}if(l[2]){var d=l[1]?"0.4em":"0.1em",p=document.createElementNS(Ee,"tspan");p.setAttribute("dy",d),p.setAttribute("style","font-size:0.7em"),p.textContent=l[2],f.appendChild(p)}}else s&&c[o].trim()==""?f.innerHTML="&nbsp;":f.textContent=c[o];i.appendChild(f)}return r?r.appendChild(i):this.append(i),i};ie.prototype.richTextLine=function(e,t,r,a,i,n){var s=document.createElementNS(Ee,"text");s.setAttribute("stroke","none"),s.setAttribute("class",a),s.setAttribute("x",t),s.setAttribute("y",r),s.setAttribute("text-anchor",i),s.setAttribute("dominant-baseline","middle");for(var c=0;c<e.length;c++){for(var o=e[c],f=document.createElementNS(Ee,"tspan"),u=Object.keys(o.attrs),l=0;l<u.length;l++){var h=o.attrs[u[l]];h!==""&&f.setAttribute(u[l],h)}f.textContent=o.content,s.appendChild(f)}return n?n.appendChild(s):this.append(s),s};ie.prototype.guessWidth=function(e,t){var r=this.createDummySvg(),a=this.text(e,t,r),i;try{i=a.getBBox(),isNaN(i.height)||!i.height?i={width:t["font-size"]/2,height:t["font-size"]+2}:i={width:i.width,height:i.height}}catch{i={width:t["font-size"]/2,height:t["font-size"]+2}}return r.removeChild(a),i};ie.prototype.createDummySvg=function(){if(!this.dummySvg){this.dummySvg=Jr();var e=["display: block !important;","height: 1px;","width: 1px;","position: absolute;"];this.dummySvg.setAttribute("style",e.join(""));var t=document.querySelector("body");t.appendChild(this.dummySvg)}return this.dummySvg};var mr={};ie.prototype.getTextSize=function(e,t,r){if(typeof e=="number"&&(e=""+e),!e||e.match(/^\s+$/))return{width:0,height:0};var a;if(e.length<20&&(a=e+JSON.stringify(t),mr[a]))return mr[a];var i=!r;r||(r=this.text(e,t));var n;try{n=r.getBBox(),isNaN(n.height)||!n.height?n=this.guessWidth(e,t):n={width:n.width,height:n.height}}catch{n=this.guessWidth(e,t)}return i&&(this.currentGroup.length>0?this.currentGroup[0].removeChild(r):this.svg.removeChild(r)),a&&(mr[a]=n),n};ie.prototype.openGroup=function(e){e=e||{};var t=document.createElementNS(Ee,"g");return e.klass&&t.setAttribute("class",e.klass),e.fill&&t.setAttribute("fill",e.fill),e.stroke&&t.setAttribute("stroke",e.stroke),e["data-name"]&&t.setAttribute("data-name",e["data-name"]),e.prepend?this.prepend(t):this.append(t),this.currentGroup.unshift(t),t};ie.prototype.closeGroup=function(){var e=this.currentGroup.shift();return e&&e.children.length===0?(e.parentElement.removeChild(e),null):e};ie.prototype.path=function(e){var t=document.createElementNS(Ee,"path");for(var r in e)e.hasOwnProperty(r)&&(r==="path"?t.setAttributeNS(null,"d",e.path):r==="klass"?t.setAttributeNS(null,"class",e[r]):e[r]!==void 0&&t.setAttributeNS(null,r,e[r]));return this.append(t),t};ie.prototype.pathToBack=function(e){var t=document.createElementNS(Ee,"path");for(var r in e)e.hasOwnProperty(r)&&(r==="path"?t.setAttributeNS(null,"d",e.path):r==="klass"?t.setAttributeNS(null,"class",e[r]):t.setAttributeNS(null,r,e[r]));return this.prepend(t),t};ie.prototype.lineToBack=function(e){for(var t=document.createElementNS(Ee,"line"),r=Object.keys(e),a=0;a<r.length;a++)t.setAttribute(r[a],e[r[a]]);return this.prepend(t),t};ie.prototype.append=function(e){this.currentGroup.length>0?this.currentGroup[0].appendChild(e):this.svg.appendChild(e)};ie.prototype.prepend=function(e){this.currentGroup.length>0?this.currentGroup[0].appendChild(e):this.svg.insertBefore(e,this.svg.firstChild)};ie.prototype.setAttributeOnElement=function(e,t){for(var r in t)t.hasOwnProperty(r)&&e.setAttributeNS(null,r,t[r])};ie.prototype.moveElementToChild=function(e,t){e.appendChild(t)};function Jr(){var e=document.createElementNS(Ee,"svg");return e.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),e.setAttribute("role","img"),e.setAttribute("fill","currentColor"),e.setAttribute("stroke","currentColor"),e}var wl=ie,Zr=Se,xl=wl,De=function(e){this.paper=new xl(e),this.controller=null,this.space=3*Zr.SPACE,this.padding={},this.reset(),this.firefox112=navigator.userAgent.indexOf("Firefox/112.0")>=0};De.prototype.reset=function(){this.paper.clear(),this.y=0,this.abctune=null,this.path=null,this.isPrint=!1,this.lineThickness=0,this.initVerticalSpace()};De.prototype.newTune=function(e){this.abctune=e,this.setVerticalSpace(e.formatting),this.isPrint=e.media==="print",this.setPadding(e)};De.prototype.setLineThickness=function(e){this.lineThickness=e};De.prototype.setPaddingOverride=function(e){this.paddingOverride={top:e.paddingtop,bottom:e.paddingbottom,right:e.paddingright,left:e.paddingleft}};De.prototype.setPadding=function(e){function t(r,a,i,n,s){e.formatting[i]!==void 0?r.padding[a]=e.formatting[i]:r.paddingOverride[a]!==void 0?r.padding[a]=r.paddingOverride[a]:r.isPrint?r.padding[a]=n:r.padding[a]=s}t(this,"top","topmargin",38,15),t(this,"bottom","botmargin",38,15),t(this,"left","leftmargin",68,15),t(this,"right","rightmargin",68,15)};De.prototype.adjustNonScaledItems=function(e){this.padding.top/=e,this.padding.bottom/=e,this.padding.left/=e,this.padding.right/=e,this.abctune.formatting.headerfont.size/=e,this.abctune.formatting.footerfont.size/=e};De.prototype.initVerticalSpace=function(){this.spacing={composer:7.56,graceBefore:8.67,graceInside:10.67,graceAfter:16,info:0,lineSkipFactor:1.1,music:7.56,paragraphSkipFactor:.4,parts:11.33,slurHeight:1,staffSeparation:61.33,staffTopMargin:0,stemHeight:26.67+10,subtitle:3.78,systemStaffSeparation:48,text:18.9,title:7.56,top:30.24,vocal:0,words:0}};De.prototype.setVerticalSpace=function(e){e.staffsep!==void 0&&(this.spacing.staffSeparation=e.staffsep*4/3),e.composerspace!==void 0&&(this.spacing.composer=e.composerspace*4/3),e.partsspace!==void 0&&(this.spacing.parts=e.partsspace*4/3),e.textspace!==void 0&&(this.spacing.text=e.textspace*4/3),e.musicspace!==void 0&&(this.spacing.music=e.musicspace*4/3),e.titlespace!==void 0&&(this.spacing.title=e.titlespace*4/3),e.sysstaffsep!==void 0&&(this.spacing.systemStaffSeparation=e.sysstaffsep*4/3),e.stafftopmargin!==void 0&&(this.spacing.staffTopMargin=e.stafftopmargin*4/3),e.subtitlespace!==void 0&&(this.spacing.subtitle=e.subtitlespace*4/3),e.topspace!==void 0&&(this.spacing.top=e.topspace*4/3),e.vocalspace!==void 0&&(this.spacing.vocal=e.vocalspace*4/3),e.wordsspace!==void 0&&(this.spacing.words=e.wordsspace*4/3)};De.prototype.calcY=function(e){return this.y-e*Zr.STEP};De.prototype.yToPitch=function(e){return e/Zr.STEP};De.prototype.moveY=function(e,t){t===void 0&&(t=1),this.y+=e*t};De.prototype.absolutemoveY=function(e){this.y=e};var Cl=De;function kl(e,t,r,a,i,n){var s=e.text;this.rows=[];var c;t&&this.rows.push({move:t});var o=r.calc("textfont","defined-text");if(s==="")this.rows.push({move:o.attr["font-size"]*2});else if(typeof s=="string"){let g=function(v){return v.replace(/^[ \t]*\n/gm,`X
33
+ `)};this.rows.push({move:o.attr["font-size"]/2}),this.rows.push({left:a,text:s,font:"textfont",klass:"defined-text",anchor:"start",startChar:e.startChar,endChar:e.endChar,absElemType:"freeText",name:"free-text"});var f=g(s);c=n.calc(f,"textfont","defined-text"),this.rows.push({move:c.height})}else if(s){for(var u=0,l=a,h="textfont",d=0;d<s.length;d++)s[d].font?h=s[d].font:h="textfont",this.rows.push({left:l,text:s[d].text,font:h,klass:"defined-text",anchor:"start",startChar:e.startChar,endChar:e.endChar,absElemType:"freeText",name:"free-text"}),c=n.calc(s[d].text,r.calc(h,"defined-text").font,"defined-text"),l+=c.width+c.height/2,u=Math.max(u,c.height);this.rows.push({move:u})}else if(e.length===1){var p=i/2;this.rows.push({left:p,text:e[0].text,font:"textfont",klass:"defined-text",anchor:"middle",startChar:e.startChar,endChar:e.endChar,absElemType:"freeText",name:"free-text"}),c=n.calc(e[0].text,"textfont","defined-text"),this.rows.push({move:c.height})}}var _l=kl;function Tl(e,t,r){this.rows=[],e&&this.rows.push({move:e}),this.rows.push({separator:t,absElemType:"separator"}),r&&this.rows.push({move:r})}var El=Tl;function Sl(e,t,r,a,i,n){this.rows=[],e&&this.rows.push({move:e});var s=t.titleleft?"start":"middle",c=t.titleleft?i:a;this.rows.push({left:c,text:r.text,font:"subtitlefont",klass:"text subtitle",anchor:s,startChar:r.startChar,endChar:r.endChar,absElemType:"subtitle",name:"subtitle"});var o=n.calc(r.text,"subtitlefont","text subtitle");this.rows.push({move:o.height})}var Ml=Sl;function Al(e,t,r){if(t.text){t.marginLeft||(t.marginLeft=0),t.klass||(t.klass=""),t.anchor||(t.anchor="start"),t.info||(t.info={startChar:-2,endChar:-2}),t.marginTop&&e.push({move:t.marginTop});var a={left:t.marginLeft,text:t.text,font:t.font,anchor:t.anchor,startChar:t.info.startChar,endChar:t.info.endChar,"dominant-baseline":t["dominant-baseline"]};t.absElemType&&(a.absElemType=t.absElemType),!t.inGroup&&t.klass&&(a.klass=t.klass),t.name&&(a.name=t.name),e.push(a);var i=r.calc("A",t.font,t.klass),n=t.text.split(`
34
34
  `).length;if(t.text[t.text.length-1]===`
35
- `&&i--,!t.noMove){var s=n.height*1.1*i;e.push({move:Math.round(s)}),t.marginBottom&&e.push({move:t.marginBottom})}}}var ea=Al;const Bl=ea;function Nl(e,t,r,a,n,i,s,o){var c=o.calc("i",r,a);if(t==="")e.push({move:c.height});else{if(typeof t=="string"){Bl(e,{marginLeft:i,text:t,font:r,klass:a,marginTop:s.marginTop,anchor:s.anchor,absElemType:s.absElemType,info:s.info,name:n},o);return}s.marginTop&&e.push({move:s.marginTop});var f=0,u={left:i,anchor:s.anchor,phrases:[]};a&&(u.klass=a),e.push(u);for(var l=0;l<t.length;l++){var h=t[l],d=h.font?h.font:o.attr(r,a).font,p={content:h.text};d&&(p.attrs={"font-family":o.getFamily(d.face),"font-size":d.size,"font-weight":d.weight,"font-style":d.style,"font-decoration":d.decoration}),u.phrases.push(p);var g=o.calc(h.text,d,a);f=Math.max(f,g.height),h.text[h.text.length-1]===" "&&c.width}e.push({move:f})}}var Ti=Nl;const z0=ea,f0=Ti;function Ll(e,t,r,a,n,i,s,o,c,f){if(this.rows=[],e.header&&i){var u=f.calc("X","headerfont","abcjs-header abcjs-meta-top").height;z0(this.rows,{marginLeft:s,text:e.header.left,font:"headerfont",klass:"header meta-top",marginTop:-u,info:t.header,name:"header"},f),z0(this.rows,{marginLeft:s+n/2,text:e.header.center,font:"headerfont",klass:"header meta-top",marginTop:-u,anchor:"middle",info:t.header,name:"header"},f),z0(this.rows,{marginLeft:s+n,text:e.header.right,font:"headerfont",klass:"header meta-top",marginTop:-u,anchor:"end",info:t.header,name:"header"},f)}i&&this.rows.push({move:o.top});var l=r.titleleft?"start":"middle",h=r.titleleft?s:s+n/2;if(e.title){var d=c?"abcjs-title":"";f0(this.rows,e.title,"titlefont",d,"title",h,{marginTop:o.title,anchor:l,absElemType:"title",info:t.title},f)}if(a.length)for(var p=0;p<a.length&&a[p].subtitle;){var d=c?"abcjs-text abcjs-subtitle":"";f0(this.rows,a[p].subtitle.text,"subtitlefont",d,"subtitle",h,{marginTop:o.subtitle,anchor:l,absElemType:"subtitle",info:a[p].subtitle},f),p++}if(e.rhythm||e.origin||e.composer){if(this.rows.push({move:o.composer}),e.rhythm&&e.rhythm.length>0){var g=!!(e.composer||e.origin),d=c?"abcjs-rhythm":"";z0(this.rows,{marginLeft:s,text:e.rhythm,font:"infofont",klass:d,absElemType:"rhythm",noMove:g,info:t.rhythm,name:"rhythm"},f)}e.composer&&e.composer,e.origin&&e.origin;var v=e.composer?e.composer:"";if(e.origin&&(typeof v=="string"&&typeof e.origin=="string"?v+=" ("+e.origin+")":typeof v=="string"&&typeof e.origin!="string"?(v=[{text:v}],v.push({text:" ("}),v=v.concat(e.origin),v.push({text:")"})):(v.push({text:" ("}),v=v.concat(e.origin),v.push({text:")"}))),v){var d=c?"abcjs-composer":"";f0(this.rows,v,"composerfont",d,"composer",s+n,{anchor:"end",absElemType:"composer",info:t.composer},f)}}if(e.author&&e.author.length>0){var d=c?"abcjs-author":"";f0(this.rows,e.author,"composerfont",d,"author",s+n,{anchor:"end",absElemType:"author",info:t.author},f)}if(e.partOrder&&e.partOrder.length>0){var d=c?"abcjs-part-order":"";f0(this.rows,e.partOrder,"partsfont",d,"part-order",s,{absElemType:"partOrder",info:t.partOrder,anchor:"start"},f)}}var Pl=Ll;const m0=ea,Ei=Ti;function nr(e,t,r,a,n,i,s){this.rows=[],e.unalignedWords&&e.unalignedWords.length>0&&this.unalignedWords(e.unalignedWords,a,n,i,s),this.extraText(e,a,n,i,s),e.footer&&r&&this.footer(e.footer,t,a,s)}nr.prototype.unalignedWords=function(e,t,r,a,n){var i=a?"abcjs-unaligned-words":"",s="wordsfont",o=n.calc("i",s,i);this.rows.push({move:r.words}),Fr(this.rows,"",e,t,s,"unalignedWords","unalignedWords",i,"unalignedWords",r,a,n),this.rows.push({move:o.height})};function Et(e,t,r,a,n,i,s){r&&(t&&(typeof r=="string"?r=t+r:r=[{text:t}].concat(r)),n=i?"abcjs-extra-text "+n:"",Ei(e,r,"historyfont",n,"description",a,{absElemType:"extraText",anchor:"start"},s))}function Fr(e,t,r,a,n,i,s,o,c,f,u,l){if(r){o=u?"abcjs-extra-text "+o:"";var h=l.calc("A",n,o);if(typeof r=="string")t&&(r=t+`
36
- `+r),m0(e,{marginLeft:a,text:r,font:n,absElemType:"extraText",name:c,"dominant-baseline":"middle",klass:o},l);else{e.push({startGroup:s,klass:o,name:c}),e.push({move:f.info}),t&&(m0(e,{marginLeft:a,text:t,font:n,absElemType:"extraText",name:c,"dominant-baseline":"middle"},l),e.push({move:h.height*3/4}));for(var d=0;d<r.length;d++)Ei(e,r[d],n,"",c,a,{anchor:"start"},l),d<r.length-1&&typeof r[d]=="string"&&typeof r[d+1]!="string"&&e.push({move:h.height*3/4});e.push({endGroup:s,absElemType:i,startChar:-1,endChar:-1,name:c}),e.push({move:h.height})}}}nr.prototype.extraText=function(e,t,r,a,n){Et(this.rows,"Book: ",e.book,t,"abcjs-book",a,n),Et(this.rows,"Source: ",e.source,t,"abcjs-source",a,n),Et(this.rows,"Discography: ",e.discography,t,"abcjs-discography",a,n),Fr(this.rows,"Notes:",e.notes,t,"historyfont","extraText","notes","abcjs-notes","description",r,a,n),Et(this.rows,"Transcription: ",e.transcription,t,"abcjs-transcription",a,n),Fr(this.rows,"History:",e.history,t,"historyfont","extraText","history","abcjs-history","description",r,a,n),Et(this.rows,"Copyright: ",e["abc-copyright"],t,"abcjs-copyright",a,n),Et(this.rows,"Creator: ",e["abc-creator"],t,"abcjs-creator",a,n),Et(this.rows,"Edited By: ",e["abc-edited-by"],t,"abcjs-edited-by",a,n)};nr.prototype.footer=function(e,t,r,a){var n="header meta-bottom",i="footerfont";this.rows.push({startGroup:"footer",klass:n}),m0(this.rows,{marginLeft:r,text:e.left,font:i,klass:n,name:"footer"},a),m0(this.rows,{marginLeft:r+t/2,text:e.center,font:i,klass:n,anchor:"middle",name:"footer"},a),m0(this.rows,{marginLeft:r+t,text:e.right,font:i,klass:n,anchor:"end",name:"footer"},a)};var Dl=nr;function yr(e,t,r,a){if(e.indexOf(t)===0){var n=e.replace(t,""),i=parseInt(n,10);""+i===n&&(r[a]=i)}}function Il(e,t){var r=[];if(e.absEl.elemset){for(var a={},n=0;n<e.absEl.elemset.length;n++){var i=e.absEl.elemset[n];if(i)for(var s=i.getAttribute("class").split(" "),o=0;o<s.length;o++)a[s[o]]=!0}for(var c=0;c<Object.keys(a).length;c++)r.push(Object.keys(a)[c])}for(var f={},u=0;u<r.length;u++)yr(r[u],"abcjs-v",f,"voice"),yr(r[u],"abcjs-l",f,"line"),yr(r[u],"abcjs-m",f,"measure");e.staffPos&&(f.staffPos=e.staffPos);for(var l=t.target;l&&l.dataset&&!l.dataset.name&&l.tagName.toLowerCase()!=="svg";)l=l.parentNode;for(var h=t.target;h&&h.dataset&&!h.dataset.index&&h.tagName.toLowerCase()!=="svg";)h=h.parentNode;return h&&h.dataset&&(f.name=h.dataset.name,f.clickedName=l.dataset.name,f.parentClasses=h.classList),l&&l.classList&&(f.clickedClasses=l.classList),f.selectableElement=e.svgEl,{classes:r,analysis:f}}var Si=Il,Q0=Se,Fl=Si;function Ol(e,t){if(e.rangeHighlight=Ul,e.dragging)for(var r=0;r<e.selectables.length;r++){var a=e.selectables[r];a.svgEl.getAttribute("selectable")==="true"&&(a.svgEl.setAttribute("tabindex",0),a.svgEl.setAttribute("data-index",r),a.svgEl.addEventListener("keydown",$l.bind(e)),a.svgEl.addEventListener("keyup",Rl.bind(e)),a.svgEl.addEventListener("focus",zl.bind(e)))}for(var n=0;n<t.length;n++)t[n].addEventListener("touchstart",sn.bind(e),{passive:!0}),t[n].addEventListener("touchmove",on.bind(e),{passive:!0}),t[n].addEventListener("touchend",w0.bind(e),{passive:!0}),t[n].addEventListener("mousedown",sn.bind(e)),t[n].addEventListener("mousemove",on.bind(e)),t[n].addEventListener("mouseup",w0.bind(e))}function Hl(e){var t=1,r=1,a=e.target.closest("svg"),n=0;a&&a.viewBox&&a.viewBox.baseVal&&(a.viewBox.baseVal.width!==0&&(t=a.viewBox.baseVal.width/a.clientWidth),a.viewBox.baseVal.height!==0&&(r=a.viewBox.baseVal.height/a.clientHeight),n=a.viewBox.baseVal.y);var i=e.target&&e.target.tagName==="svg",s,o;return i?(s=e.offsetX,o=e.offsetY):(s=e.layerX,o=e.layerY),s=s*t,o=o*r,[s,o+n]}function zl(e){this.dragMechanism==="keyboard"&&this.dragYStep!==0&&this.dragTarget&&Ai.bind(this)(this.dragTarget,this.dragYStep,this.selectables.length,this.dragIndex,e),this.dragYStep=0}function $l(e){switch(e.keyCode){case 38:case 40:e.preventDefault()}}function Rl(e){var t=!1,r=e.target.dataset.index;switch(e.keyCode){case 13:case 32:t=!0,this.dragTarget=this.selectables[r],this.dragIndex=r,this.dragMechanism="keyboard",w0.bind(this)(e);break;case 38:t=!0,this.dragTarget=this.selectables[r],this.dragIndex=r,this.dragTarget&&this.dragTarget.isDraggable&&(this.dragging&&this.dragTarget.isDraggable&&this.dragTarget.absEl.highlight(void 0,this.dragColor),this.dragYStep--,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+this.dragYStep*Q0.STEP+")"));break;case 40:t=!0,this.dragTarget=this.selectables[r],this.dragIndex=r,this.dragMechanism="keyboard",this.dragTarget&&this.dragTarget.isDraggable&&(this.dragging&&this.dragTarget.isDraggable&&this.dragTarget.absEl.highlight(void 0,this.dragColor),this.dragYStep++,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+this.dragYStep*Q0.STEP+")"));break;case 9:this.dragYStep!==0&&w0.bind(this)(e);break}t&&e.preventDefault()}function Gl(e,t){if(!t)return-1;var r=t.dataset;if(!r)return-1;for(var a=r.index,n=0;n<e.length;n++){var i=e[n].svgEl.dataset;if(i&&a===i.index)return n}return-1}function Yl(e,t,r){for(var a=9999999,n=-1,i=0;i<e.selectables.length&&a>0;i++){var s=e.selectables[i];if(e.getDim(s),s.dim.left<t&&s.dim.right>t&&s.dim.top<r&&s.dim.bottom>r)n=i,a=0;else if(s.dim.top<r&&s.dim.bottom>r){var o=Math.min(Math.abs(s.dim.left-t),Math.abs(s.dim.right-t));o<a&&(a=o,n=i)}else if(s.dim.left<t&&s.dim.right>t){var c=Math.min(Math.abs(s.dim.top-r),Math.abs(s.dim.bottom-r));c<a&&(a=c,n=i)}else{var f=Math.abs(t-s.dim.left)>Math.abs(t-s.dim.right)?Math.abs(t-s.dim.right):Math.abs(t-s.dim.left),u=Math.abs(r-s.dim.top)>Math.abs(r-s.dim.bottom)?Math.abs(r-s.dim.bottom):Math.abs(r-s.dim.top),l=Math.sqrt(f*f+u*u);l<a&&(a=l,n=i)}}return n>=0&&a<=12?n:-1}function ql(e,t,r){if(e.x<=t.offsetX&&e.x+e.width>=t.offsetX&&e.y<=t.offsetY&&e.y+e.height>=t.offsetY)return[t.offsetX,t.offsetY];var a=Math.abs(t.layerY/r-t.offsetY);return a<3?[t.offsetX,t.offsetY]:[t.layerX,t.layerY]}function Wl(e){if(!e)return null;if(e.tagName==="svg")return e;if(!e.getAttribute)return null;for(var t=e.getAttribute("selectable");!t;)e.parentElement?(e=e.parentElement,e.tagName==="svg"?t=!0:t=e.getAttribute("selectable")):t=!0;return e}function Mi(e,t){var r,a,n,i=Gl(e.selectables,Wl(t.target));return i>=0?(n=ql(e.selectables[i].svgEl.getBBox(),t,e.scale),r=n[0],a=n[1]):(n=Hl(t),r=n[0],a=n[1],i=Yl(e,r,a)),{x:r,y:a,clickedOn:i}}function ta(e){if(!(!e||!e.target||!e.touches||e.touches.length<1)){var t=e.target.getBoundingClientRect(),r=e.touches[0].pageX-t.left,a=e.touches[0].pageY-t.top;e.touches[0].offsetX=r,e.touches[0].offsetY=a,e.touches[0].layerX=e.touches[0].pageX,e.touches[0].layerY=e.touches[0].pageY}}function sn(e){var t=e;e.type==="touchstart"&&(ta(e),e.touches.length>0&&(t=e.touches[0]));var r=Mi(this,t);r.clickedOn>=0&&(e.type==="touchstart"||e.button===0)&&this.selectables[r.clickedOn]&&(this.dragTarget=this.selectables[r.clickedOn],this.dragIndex=r.clickedOn,this.dragMechanism="mouse",this.dragMouseStart={x:r.x,y:r.y},this.dragging&&this.dragTarget.isDraggable&&(Vl(this.renderer.paper,"abcjs-dragging-in-progress"),this.dragTarget.absEl.highlight(void 0,this.dragColor)))}function on(e){var t=e;if(e.type==="touchmove"&&(ta(e),e.touches.length>0&&(t=e.touches[0])),this.lastTouchMove=e,!(!this.dragTarget||!this.dragging||!this.dragTarget.isDraggable||this.dragMechanism!=="mouse"||!this.dragMouseStart)){var r=Mi(this,t),a=Math.round((r.y-this.dragMouseStart.y)/Q0.STEP);a!==this.dragYStep&&(this.dragYStep=a,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+a*Q0.STEP+")"))}}function w0(e){var t=e;e.type==="touchend"&&this.lastTouchMove&&(ta(this.lastTouchMove),this.lastTouchMove&&this.lastTouchMove.touches&&this.lastTouchMove.touches.length>0&&(t=this.lastTouchMove.touches[0])),this.dragTarget&&(Bi.bind(this)(),this.dragTarget.absEl&&this.dragTarget.absEl.highlight&&(this.selected=[this.dragTarget.absEl],this.dragTarget.absEl.highlight(void 0,this.selectionColor)),Ai.bind(this)(this.dragTarget,this.dragYStep,this.selectables.length,this.dragIndex,t),this.dragTarget.svgEl&&this.dragTarget.svgEl.focus&&(this.dragTarget.svgEl.focus(),this.dragTarget=null,this.dragIndex=-1),jl(this.renderer.svg,"abcjs-dragging-in-progress"))}function Xl(e){e>=0&&e<this.selectables.length&&(this.dragTarget=this.selectables[e],this.dragIndex=e,this.dragMechanism="keyboard",w0.bind(this)({target:this.dragTarget.svgEl}))}function Ai(e,t,r,a,n){for(var i=Fl(e,n),s=i.classes,o=i.analysis,c=0;c<this.listeners.length;c++)this.listeners[c](e.absEl.abcelem,e.absEl.tuneNumber,s.join(" "),o,{step:t,max:r,index:a,setSelection:Xl.bind(this)},n)}function Bi(){for(var e=0;e<this.selected.length;e++)this.selected[e].unhighlight(void 0,this.renderer.foregroundColor);this.selected=[]}function Ul(e,t){Bi.bind(this)();for(var r=0;r<this.staffgroups.length;r++)for(var a=this.staffgroups[r].voices,n=0;n<a.length;n++)for(var i=a[n].children,s=0;s<i.length;s++){var o=i[s].abcelem.startChar,c=i[s].abcelem.endChar;(t>o&&e<c||t===e&&t===c)&&(this.selected[this.selected.length]=i[s],i[s].highlight(void 0,this.selectionColor))}}function Ni(e){var t=e.getAttribute("class");t||(t="");for(var r=t.split(" "),a={},n=0;n<r.length;n++)a[r[n]]=!0;return a}function Li(e,t){var r=[];for(var a in t)t.hasOwnProperty(a)&&r.push(a);e.setAttribute("class",r.join(" "))}function Vl(e,t){if(e){var r=Ni(e.svg);r[t]=!0,Li(e.svg,r)}}function jl(e,t){if(e){var r=Ni(e.svg);delete r[t],Li(e.svg,r)}}var Kl=Ol;function Ql(e,t,r,a,n){return t+(a-t)/(r-e)*(n-e)}var ra=Ql,Jl=at,Or=Se,Hr=ra,Zl=function(e){if(!(e.elems.length===0||e.allrests)){var t=th(e.stemsUp,e.isgrace),r=e.elems[0],a=e.elems[e.elems.length-1],n=0,i=e.stemsUp?r.abcelem.maxpitch:r.abcelem.minpitch;n=ln(r,e.stemsUp,i,n),n=ln(a,e.stemsUp,i,n),n=Math.max(e.stemHeight,n+3);var s=rh(e.average,e.elems.length,n,e.stemsUp,r.abcelem.averagepitch,a.abcelem.averagepitch,e.isflat,e.min,e.max,e.isgrace),o=Pi(e.stemsUp,r,a);e.addBeam({startX:o[0],endX:o[1],startY:s[0],endY:s[1],dy:t});for(var c=nh(e.elems,e.stemsUp,e.beams[0],e.isgrace,t),f=0;f<c.length;f++)e.addBeam(c[f]);ah(e.elems,e.stemsUp,e.beams[0],t,e.mainNote)}},cn=function(e){return e===void 0?0:Math.floor(Math.log(e)/Math.log(2))};function ln(e,t,r,a){if(!e.children)return a;for(var n=0;n<e.children.length;n++){var i=e.children[n];t&&i.top!==void 0&&i.c==="flags.ugrace"?a=Math.max(a,i.top-r):!t&&i.bottom!==void 0&&i.c==="flags.ugrace"&&(a=Math.max(a,r-i.bottom+7))}return a}function eh(e,t,r,a){if(a)return 0;var n=e-t,i=r/2;return n>i&&(n=i),n<-i&&(n=-i),n}function th(e,t){var r=e?Or.STEP:-Or.STEP;return t&&(r=r*.4),r}function Pi(e,t,r){var a=t.heads[e?0:t.heads.length-1],n=r.heads[e?0:r.heads.length-1],i=a.x;e&&(i+=a.w-.6);var s=n.x;return s+=e?n.w:.6,[i,s]}function rh(e,t,r,a,n,i,s,o,c,f){var u=r-2,l=r-2,h=Math.round(a?Math.max(e+u,c+l):Math.min(e-u,o-l)),d=eh(n,i,t,s),p=h+Math.floor(d/2),g=h+Math.floor(-d/2);return f||(a&&h<6||!a&&h>6)&&(p=6,g=6),[p,g]}function ah(e,t,r,a,n){for(var i=0;i<e.length;i++){var s=e[i];if(!s.abcelem.rest){var o=!s.addExtra,c=o?n:s,f=s.heads[t?0:s.heads.length-1],u=1/5,l=f.pitch+(t?u:-u),h=t?f.w:0;o||(h+=f.dx);var d=f.x+h,p=Hr(r.startX,r.startY,r.endX,r.endY,d),g=t?-.6:.6;t||(p-=a/2/Or.STEP),o&&(h+=s.heads[0].dx),f.c==="noteheads.slash.quarter"&&(t?l+=1:l-=1);var v=new Jl(null,h,0,l,{type:"stem",pitch2:p,linewidth:g});v.setX(c.x),c.addRight(v)}}}function nh(e,t,r,a,n){for(var i=[],s=[],o=0;o<e.length;o++){var c=e[o];if(!c.abcelem.rest){var f=c.heads[t?0:c.heads.length-1],u=f.x+(t?f.w:0),l=Hr(r.startX,r.startY,r.endX,r.endY,u),h=t?-1.5:1.5;a&&(h=h*2/3);var d=c.abcelem.duration;d===0&&(d=.25);for(var p=cn(d);p<-3;p++){var g=-4-p;if(s[g]?s[g].single=!1:s[g]={x:u+(t?-.6:0),y:l+h*(g+1),durlog:p,single:!0},o>0&&c.abcelem.beambr&&c.abcelem.beambr<=g+1){s[g].split||(s[g].split=[s[g].x]);var v=Pi(t,e[o-1],c);s[g].split[s[g].split.length-1]>=v[0]&&(v[0]+=c.w),s[g].split.push(v[0]),s[g].split.push(v[1])}}for(var m=s.length-1;m>=0;m--)if(o===e.length-1||cn(e[o+1].abcelem.duration)>-m-4){var y=u,x=l+h*(m+1);s[m].single&&(o===0?y=u+5:o===e.length-1?y=u-5:e[o-1].duration===e[o+1].duration?y=o%2===0?u+5:u-5:y=e[o-1].duration>e[o+1].duration?u+5:u-5,x=Hr(r.startX,r.startY,r.endX,r.endY,y)+h*(m+1));var b={startX:s[m].x,endX:y,startY:s[m].y,endY:x,dy:n};if(s[m].split!==void 0){var w=s[m].split;b.endX<=w[w.length-1]&&(w[w.length-1]-=c.w),w.push(b.endX),b.split=s[m].split}i.push(b),s=s.slice(0,m)}}}return i}var ih=Zl,sh=ra;function oh(e){if(e.anchor1&&e.anchor2){e.hasBeam=!!e.anchor1.parent.beam&&e.anchor1.parent.beam===e.anchor2.parent.beam;var t=e.anchor1.parent.beam;if(e.hasBeam&&(t.elems[0]!==e.anchor1.parent||t.elems[t.elems.length-1]!==e.anchor2.parent)&&(e.hasBeam=!1),e.hasBeam){var r=wr(t)?e.anchor1.x+e.anchor1.w:e.anchor1.x;e.yTextPos=ch(r,e.anchor2.x,t),e.yTextPos+=wr(t)?3:-2,e.xTextPos=lh(r,e.anchor2.x),e.top=e.yTextPos+1,e.bottom=e.yTextPos-2,wr(t)&&(e.endingHeightAbove=4)}else{e.startNote=Math.max(e.anchor1.parent.top,9)+4,e.endNote=Math.max(e.anchor2.parent.top,9)+4,e.anchor1.parent.type==="rest"&&e.anchor2.parent.type!=="rest"?e.startNote=e.endNote:e.anchor2.parent.type==="rest"&&e.anchor1.parent.type!=="rest"&&(e.endNote=e.startNote);for(var a=0,n=0;n<e.middleElems.length;n++)a=Math.max(a,e.middleElems[n].top);a+=4,(a>e.startNote||a>e.endNote)&&(e.startNote=a,e.endNote=a),e.flatBeams&&(e.startNote=Math.max(e.startNote,e.endNote),e.endNote=Math.max(e.startNote,e.endNote)),e.yTextPos=e.startNote+(e.endNote-e.startNote)/2,e.xTextPos=e.anchor1.x+(e.anchor2.x+e.anchor2.w-e.anchor1.x)/2,e.top=e.yTextPos+1}}delete e.middleElems,delete e.flatBeams}function wr(e){return e.stemsUp}function ch(e,t,r){if(r.beams.length===0)return 0;r=r.beams[0];var a=e+(t-e)/2;return sh(r.startX,r.startY,r.endX,r.endY,a)}function lh(e,t){return e+(t-e)/2}var hh=oh,fh=ih,uh=ra,dh=hh,ph=function(e){for(var t=0;t<e.beams.length;t++)if(e.beams[t].type==="BeamElem"){fh(e.beams[t]),vh(e.beams[t]);for(var r=0;r<e.beams[t].elems.length;r++)e.adjustRange(e.beams[t].elems[r])}for(e.staff.specialY.chordLines=gh(e.children),t=0;t<e.otherchildren.length;t++){var a=e.otherchildren[t];a.type==="TripletElem"&&(dh(a),e.adjustRange(a))}e.staff.top=Math.max(e.staff.top,e.top),e.staff.bottom=Math.min(e.staff.bottom,e.bottom)};function vh(e){for(var t=1.5,r=0;r<e.elems.length;r++){var a=e.elems[r];if(a.top)for(var n=yh(a,e),i=0;i<a.children.length;i++){var s=a.children[i];if(s.klass==="ornament"&&s.position!=="below"&&s.bottom-t<n){var o=n-s.bottom+t;s.bottom+=o,s.top+=o,s.pitch+=o,n=a.top=s.top}}}}function hn(e,t){var r=t.getChordDim();if(r){for(var a=0;a<e.length;a++){var n=e[a]<r.left;if(n){a>0&&t.putChordInLane(a),e[a]=r.right;return}}e.push(r.right),t.putChordInLane(e.length-1)}}function gh(e){var t=[0],r=[0],a,n,i;for(a=0;a<e.length;a++){for(n=0;n<e[a].children.length;n++)i=e[a].children[n],i.chordHeightAbove&&hn(t,i);for(n=e[a].children.length-1;n>=0;n--)i=e[a].children[n],i.chordHeightBelow&&hn(r,i)}return(t.length>1||r.length>1)&&mh(e,t.length,r.length),{above:t.length,below:r.length}}function bh(e){for(var t=0,r=0;r<e.children.length;r++){var a=e.children[r];a.chordHeightBelow&&t++}return t}function mh(e,t,r){for(var a=0;a<e.length;a++){bh(e[a]);for(var n=0;n<e[a].children.length;n++){var i=e[a].children[n];i.chordHeightAbove&&i.invertLane(t)}}}function yh(e,t){return t=t.beams[0],uh(t.startX,t.startY,t.endX,t.endY,e.x)}var wh=ph,Kt=Se,xh=function(e,t){for(var r,a=0;a<t.staffs.length;a++){var n=t.staffs[a],i={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0};if(e.showDebug&&e.showDebug.indexOf("box")>=0&&(n.originalTop=n.top,n.originalBottom=n.bottom),Rt(n,i,"lyricHeightAbove"),Rt(n,i,"chordHeightAbove",n.specialY.chordLines.above),n.specialY.endingHeightAbove&&(n.specialY.chordHeightAbove?n.top+=2:n.top+=n.specialY.endingHeightAbove+vt,i.endingHeightAbove=n.top),n.specialY.dynamicHeightAbove&&n.specialY.volumeHeightAbove?(n.top+=Math.max(n.specialY.dynamicHeightAbove,n.specialY.volumeHeightAbove)+vt,i.dynamicHeightAbove=n.top,i.volumeHeightAbove=n.top):(Rt(n,i,"dynamicHeightAbove"),Rt(n,i,"volumeHeightAbove")),Rt(n,i,"partHeightAbove"),Rt(n,i,"tempoHeightAbove"),n.specialY.lyricHeightBelow&&(n.specialY.lyricHeightBelow+=e.spacing.vocal/Kt.STEP,i.lyricHeightBelow=n.bottom,n.bottom-=n.specialY.lyricHeightBelow+vt),n.specialY.chordHeightBelow){i.chordHeightBelow=n.bottom;var s=n.specialY.chordHeightBelow;n.specialY.chordLines.below&&(s*=n.specialY.chordLines.below),n.bottom-=s+vt}n.specialY.volumeHeightBelow&&n.specialY.dynamicHeightBelow?(i.volumeHeightBelow=n.bottom,i.dynamicHeightBelow=n.bottom,n.bottom-=Math.max(n.specialY.volumeHeightBelow,n.specialY.dynamicHeightBelow)+vt):n.specialY.volumeHeightBelow?(i.volumeHeightBelow=n.bottom,n.bottom-=n.specialY.volumeHeightBelow+vt):n.specialY.dynamicHeightBelow&&(i.dynamicHeightBelow=n.bottom,n.bottom-=n.specialY.dynamicHeightBelow+vt),e.showDebug&&e.showDebug.indexOf("box")>=0&&(n.positionY=i);for(var o=0;o<n.voices.length;o++){var c=t.voices[n.voices[o]];Ch(i,c,e.spacing)}if(r!==void 0){var f=n.top-10,u=r+f,l=e.spacing.systemStaffSeparation/Kt.STEP,h=l-u;h>0&&(n.top+=h)}n.top+=e.spacing.staffTopMargin/Kt.STEP,r=2-n.bottom}},vt=1;function Rt(e,t,r,a){if(e.specialY[r]){var n=e.specialY[r];a&&(n*=a),e.top+=n+vt,t[r]=e.top}}function Ch(e,t,r){var a,n;for(a=0;a<t.children.length;a++)n=t.children[a],kh(e,n,r);for(a=0;a<t.otherchildren.length;a++)switch(n=t.otherchildren[a],n.type){case"CrescendoElem":_h(e,n);break;case"DynamicDecoration":Th(e,n);break;case"EndingElem":Eh(e,n);break;case"TieElem":var i=n.getYBounds();t.staff.top=Math.max(t.staff.top,i[0]),t.staff.top=Math.max(t.staff.top,i[1]),t.staff.bottom=Math.min(t.staff.bottom,i[0]),t.staff.bottom=Math.min(t.staff.bottom,i[1]);break}}function kh(e,t,r){for(var a=0;a<t.children.length;a++){var n=t.children[a];for(var i in t.specialY)t.specialY.hasOwnProperty(i)&&n[i]&&(n.pitch=e[i],n.top===void 0&&(n.type==="TempoElement"?Sh(e,n):Mh(e,n,r),t.pushTop(n.top),t.pushBottom(n.bottom)))}}function _h(e,t){t.dynamicHeightAbove?t.pitch=e.dynamicHeightAbove:t.pitch=e.dynamicHeightBelow}function Th(e,t){t.volumeHeightAbove?t.pitch=e.volumeHeightAbove:t.pitch=e.volumeHeightBelow}function Eh(e,t){t.pitch=e.endingHeightAbove-2}function Sh(e,t){if(t.pitch=e.tempoHeightAbove,t.top=e.tempoHeightAbove,t.bottom=e.tempoHeightAbove,t.note){var r=t.pitch-t.totalHeightInPitches+1;t.note.top=r,t.note.bottom=r;for(var a=0;a<t.note.children.length;a++){var n=t.note.children[a];n.top+=r,n.bottom+=r,n.pitch+=r,n.pitch2!==void 0&&(n.pitch2+=r)}}}function Mh(e,t,r){switch(t.type){case"part":t.top=e.partHeightAbove+t.height,t.bottom=e.partHeightAbove;break;case"text":case"chord":t.chordHeightAbove?(t.top=e.chordHeightAbove,t.bottom=e.chordHeightAbove):(t.top=e.chordHeightBelow,t.bottom=e.chordHeightBelow);break;case"lyric":t.lyricHeightAbove?(t.top=e.lyricHeightAbove,t.bottom=e.lyricHeightAbove):(t.top=e.lyricHeightBelow+r.vocal/Kt.STEP,t.bottom=e.lyricHeightBelow+r.vocal/Kt.STEP,t.pitch-=r.vocal/Kt.STEP);break;case"debug":t.top=e.chordHeightAbove,t.bottom=e.chordHeightAbove;break}(t.pitch===void 0||t.top===void 0)&&console.error("RelativeElement position not set.",t.type,t.pitch,t.top,e)}var Ah=xh,ft=function(){};ft.beginLayout=function(e,t){t.i=0,t.durationindex=0,t.startx=e,t.minx=e,t.nextx=e,t.spacingduration=0};ft.layoutEnded=function(e){return e.i>=e.children.length};ft.getNextX=function(e){return Math.max(e.minx,e.nextx)};ft.getSpacingUnits=function(e){return Math.sqrt(e.spacingduration*8)};ft.layoutOneItem=function(e,t,r,a,n){var i=r.children[r.i];if(!i)return 0;var s=e-r.minx,o=r.durationindex+i.duration>0?a:0;if(i.abcelem.el_type==="note"&&!i.abcelem.rest&&r.voicenumber!==0&&n){var c=n.children[n.i],f=c&&(i.abcelem.maxpitch<=c.abcelem.maxpitch+1&&i.abcelem.maxpitch>=c.abcelem.minpitch-1||i.abcelem.minpitch<=c.abcelem.maxpitch+1&&i.abcelem.minpitch>=c.abcelem.minpitch-1);if(f&&i.abcelem.minpitch===c.abcelem.minpitch&&i.abcelem.maxpitch===c.abcelem.maxpitch&&c.heads&&c.heads.length>0&&i.heads&&i.heads.length>0&&c.heads[0].c===i.heads[0].c&&(f=!1),f){var u=c.heads&&c.heads.length>0?c.heads[0].realWidth:c.fixed.w;i.adjustedWidth||(i.adjustedWidth=u+i.w),i.w=i.adjustedWidth;for(var l=0;l<i.children.length;l++){var h=i.children[l];h.name.indexOf("accidental")<0&&(h.adjustedWidth||(h.adjustedWidth=h.dx+u),h.dx=h.adjustedWidth)}}}var d=Bh(i,o);return s<d&&(r.i===0||i.type!=="bar"||r.children[r.i-1].type!=="part"&&r.children[r.i-1].type!=="tempo")&&(e+=d-s),i.setX(e),r.spacingduration=i.duration,r.minx=e+Nh(i),r.i!==r.children.length-1&&(r.minx+=i.minspacing),this.updateNextX(e,t,r),e};ft.shiftRight=function(e,t){var r=t.children[t.i];r&&(r.setX(r.x+e),t.minx+=e,t.nextx+=e)};ft.updateNextX=function(e,t,r){r.nextx=e+t*this.getSpacingUnits(r)};ft.updateIndices=function(e){this.layoutEnded(e)||(e.durationindex+=e.children[e.i].duration,e.children[e.i].type==="bar"&&(e.durationindex=Math.round(e.durationindex*64)/64),e.i++)};function Bh(e,t){var r=0;return(e.type==="note"||e.type==="bar")&&(r=t),-e.extraw+r}function Nh(e){return e.w}var Lh=ft,Ne=Lh;function Ph(e){for(var t=0,r=0;r<e.length;r++){var a=e[r];if(a.children.length>0){var n=a.children.length-1,i=a.children[n];if(i.abcelem.el_type==="bar"){var s=i.children[0].x;s>t?t=s:i.children[0].x=t}}}}var Dh=function(e,t,r,a,n){var i=1e-7,s=0,o=1e3,c=n;a.startx=c;var f,u=0;for(r&&console.log("init layout",e),f=0;f<a.voices.length;f++)Ne.beginLayout(c,a.voices[f]);for(var l=0;!Ih(a.voices);){for(u=null,f=0;f<a.voices.length;f++)!Ne.layoutEnded(a.voices[f])&&(!u||xr(a.voices[f])<u)&&(u=xr(a.voices[f]));var h=[],d=[];for(f=0;f<a.voices.length;f++){var p=xr(a.voices[f]);p-u>i?d.push(a.voices[f]):h.push(a.voices[f])}l=0;var g=0;for(f=0;f<h.length;f++)Ne.getNextX(h[f])>c&&(c=Ne.getNextX(h[f]),l=Ne.getSpacingUnits(h[f]),g=h[f].spacingduration);s+=l,o=Math.min(o,l),r&&console.log("currentduration: ",u,s,o);var v=void 0;for(f=0;f<h.length;f++){var m=h[f];m.voicenumber===0&&(v=f);var y=v!==void 0&&h[v].voicenumber!==m.voicenumber?h[v]:void 0;Fh(m,y)||(y=void 0);var x=Ne.layoutOneItem(c,e,m,t,y),b=x-c;if(b>0){c=x;for(var w=0;w<f;w++)Ne.shiftRight(b,h[w])}}for(f=0;f<d.length;f++)d[f].spacingduration-=g,Ne.updateNextX(c,e,d[f]);for(f=0;f<h.length;f++){var C=h[f];Ne.updateIndices(C)}}for(f=0;f<a.voices.length;f++)Ne.getNextX(a.voices[f])>c&&(c=Ne.getNextX(a.voices[f]),l=Ne.getSpacingUnits(a.voices[f]));return Ph(a.voices),s+=l,a.setWidth(c),{spacingUnits:s,minSpace:o}};function Ih(e){for(var t=0;t<e.length;t++)if(!Ne.layoutEnded(e[t]))return!1;return!0}function xr(e){return e.durationindex-(e.children[e.i]&&e.children[e.i].duration>0?0:5e-7)}function Fh(e,t){return!e||!e.staff||!e.staff.voices||e.staff.voices.length===0||!t||!t.staff||!t.staff.voices||t.staff.voices.length===0?!1:e.staff.voices[0]===t.staff.voices[0]}var Oh=Dh;function Hh(e,t,r,a,n){var i=e.padding.left,s=0,o,c;for(o=0;o<r.length;o++)r[o].header&&(c=t.calc(r[o].header,"voicefont",""),s=Math.max(s,c.width));if(s=fn(s,a,t),s=fn(s,n,t),s){var f=t.calc("A","voicefont","");s+=f.width}i+=s;var u=0;return u=un(a,i,u),u=un(n,i,u),i+u}function fn(e,t,r){if(t){for(var a=0;a<t.length;a++)if(t[a].header){var n=r.calc(t[a].header,"voicefont","");e=Math.max(e,n.width)}}return e}function un(e,t,r){if(e)for(var a=0;a<e.length;a++)zh(t,e[a]),r=Math.max(r,e[a].getWidth());return r}function zh(e,t){t.x=e}var Di=Hh,$h=Di;function Rh(e,t,r){var a=$h(e,t.getTextSize,t.voices,t.brace,t.bracket),n=Gh(t,r.minPadding),i=n.totalDuration,s=n.minSpacing,o=s*i;r.minWidth&&(o=Math.max(o,r.minWidth));var c=r.minPadding?r.minPadding/2:2;t.startx=a,t.w=o+a;for(var f=0;f<t.voices.length;f++){var u=t.voices[f];u.startx=a,u.w=o+a;for(var l=a,h=!1,d=0,p=0;p<u.children.length;p++){var g=u.children[p];h||(g.duration!==0?(h=!0,d=(o+a-l)/i,t.gridStart=l):(g.x=l,l+=g.w+g.minspacing)),h&&(r.align==="center"?g.x=l+g.duration*d/2-g.w/2:g.duration===0?g.x=l+1-g.w:g.x=l+c-g.extraw,l+=g.duration*d);for(var v=0;v<g.children.length;v++){var m=g.children[v],y=m.dx?m.dx:0;m.x=g.x+y}}t.gridEnd=l}return o}function Gh(e,t){for(var r=0,a=0,n=0;n<e.voices.length;n++){for(var i=0,s=e.voices[n],o=0;o<s.children.length;o++){var c=s.children[o];if(i+=c.duration,c.duration){var f=(c.w+t)/c.duration;r=Math.max(r,f)}}a=Math.max(a,i)}return{totalDuration:a,minSpacing:r}}var Yh=Rh,qh=wh,Wh=Ah,Xh=Oh,Uh=Di,Vh=Yh,jh=function(e,t,r,a,n,i){var s,o,c=r;for(s=0;s<t.lines.length;s++)if(o=t.lines[s],o.staff){var f;i!==void 0?f=Vh(e,o.staffGroup,i):f=Kh(e,c,a,o.staffGroup,t.formatting,s===t.lines.length-1,!1),Math.round(f)>Math.round(c)&&(c=f,n&&(s=-1))}for(s=0;s<t.lines.length;s++)if(o=t.lines[s],o.staffGroup&&o.staffGroup.voices){for(var u=0;u<o.staffGroup.voices.length;u++)qh(o.staffGroup.voices[u]);Wh(e,o.staffGroup)}for(s=0;s<t.lines.length;s++)o=t.lines[s],o.staffGroup&&o.staffGroup.setHeight();return c},Kh=function(e,t,r,a,n,i,s){for(var o=Uh(e,a.getTextSize,a.voices,a.brace,a.bracket),c=r,f=0;f<8;f++){var u=Xh(c,e.minPadding,s,a,o);if(c=Qh(i,n.stretchlast,t+e.padding.left,a.w,c,u.spacingUnits,u.minSpace,e.padding.left+e.padding.right),c===null)break}return Jh(a.voices),a.w-o};function Qh(e,t,r,a,n,i,s,o){if(e)if(t===void 0){if(a/r<.66)return null}else{var c=1-(a+o)/r,f=c<t;if(!f)return null}if(Math.abs(r-a)<2)return null;var u=i*n,l=a-u;return i>0?(n=(r-l)/i,n*s>50&&(n=50/s),n):null}function Jh(e){for(var t=0;t<e.length;t++)for(var r=e[t],a=1;a<r.children.length-1;a++){var n=r.children[a];if(n.abcelem.rest&&(n.abcelem.rest.type==="whole"||n.abcelem.rest.type==="multimeasure")){var i=r.children[a-1],s=r.children[a+1];n.center(i,s)}}}var Zh=jh,Re=function(t){this.shouldAddClasses=t.shouldAddClasses,this.reset()};Re.prototype.reset=function(){this.lineNumber=null,this.voiceNumber=null,this.measureNumber=null,this.measureTotalPerLine=[],this.noteNumber=null};Re.prototype.incrLine=function(){this.lineNumber===null?this.lineNumber=0:this.lineNumber++,this.voiceNumber=null,this.measureNumber=null,this.noteNumber=null};Re.prototype.incrVoice=function(){this.voiceNumber===null?this.voiceNumber=0:this.voiceNumber++,this.measureNumber=null,this.noteNumber=null};Re.prototype.isInMeasure=function(){return this.measureNumber!==null};Re.prototype.newMeasure=function(){this.measureNumber&&(this.measureTotalPerLine[this.lineNumber]=this.measureNumber),this.measureNumber=null,this.noteNumber=null};Re.prototype.startMeasure=function(){this.measureNumber=0,this.noteNumber=0};Re.prototype.incrMeasure=function(){this.measureNumber++,this.noteNumber=0};Re.prototype.incrNote=function(){this.noteNumber++};Re.prototype.measureTotal=function(){for(var e=0,t=0;t<this.lineNumber;t++)e+=this.measureTotalPerLine[t]?this.measureTotalPerLine[t]:0;return this.measureNumber&&(e+=this.measureNumber),e};Re.prototype.getCurrent=function(e){return{line:this.lineNumber,measure:this.measureNumber,measureTotal:this.measureTotal(),voice:this.voiceNumber,note:this.noteNumber}};Re.prototype.generate=function(e){if(!this.shouldAddClasses)return"";var t=[];if(e&&e.length>0&&t.push(e),e==="abcjs-tab-number")return t.join(" ");if(e==="text instrument-name")return"abcjs-text abcjs-instrument-name";if(this.lineNumber!==null&&t.push("l"+this.lineNumber),this.measureNumber!==null&&t.push("m"+this.measureNumber),this.measureNumber!==null&&t.push("mm"+this.measureTotal()),this.voiceNumber!==null&&t.push("v"+this.voiceNumber),e&&(e.indexOf("note")>=0||e.indexOf("rest")>=0||e.indexOf("lyric")>=0)&&this.noteNumber!==null&&t.push("n"+this.noteNumber),t.length>0){t=t.join(" "),t=t.split(" ");for(var r=0;r<t.length;r++)t[r].indexOf("abcjs-")!==0&&t[r].length>0&&(t[r]="abcjs-"+t[r])}return t.join(" ")};var ef=Re,ir=function(t,r){this.formatting=t,this.classes=r};ir.prototype.updateFonts=function(e){e.gchordfont&&(this.formatting.gchordfont=e.gchordfont),e.tripletfont&&(this.formatting.tripletfont=e.tripletfont),e.annotationfont&&(this.formatting.annotationfont=e.annotationfont),e.vocalfont&&(this.formatting.vocalfont=e.vocalfont)};ir.prototype.getFamily=function(e){return e[0]==='"'&&e[e.length-1]==='"'?e.substring(1,e.length-1):e};ir.prototype.calc=function(e,t){var r;typeof e=="string"?(r=this.formatting[e],r?r={face:r.face,size:Math.round(r.size*4/3),decoration:r.decoration,style:r.style,weight:r.weight,box:r.box}:r={face:"Arial",size:Math.round(12*4/3),decoration:"underline",style:"normal",weight:"normal"}):r={face:e.face,size:Math.round(e.size*4/3),decoration:e.decoration,style:e.style,weight:e.weight,box:e.box};var a=this.formatting.fontboxpadding?this.formatting.fontboxpadding:.1;r.padding=r.size*a;var n={"font-size":r.size,"font-style":r.style,"font-family":this.getFamily(r.face),"font-weight":r.weight,"text-decoration":r.decoration,class:this.classes.generate(t)};return{font:r,attr:n}};var tf=ir,t0=function(t,r){this.getFontAndAttr=t,this.svg=r};t0.prototype.updateFonts=function(e){this.getFontAndAttr.updateFonts(e)};t0.prototype.attr=function(e,t){return this.getFontAndAttr.calc(e,t)};t0.prototype.getFamily=function(e){return e[0]==='"'&&e[e.length-1]==='"'?e.substring(1,e.length-1):e};t0.prototype.calc=function(e,t,r,a){var n;typeof t=="string"?n=this.attr(t,r):n={font:{face:t.face,size:t.size,decoration:t.decoration,style:t.style,weight:t.weight},attr:{"font-size":t.size,"font-style":t.style,"font-family":this.getFamily(t.face),"font-weight":t.weight,"text-decoration":t.decoration,class:this.getFontAndAttr.classes.generate(r)}};var i=this.svg.getTextSize(e,n.attr,a);return n.font.box?{height:i.height+n.font.padding*4,width:i.width+n.font.padding*4}:i};t0.prototype.baselineToCenter=function(e,t,r,a,n){var i=this.calc(e,t,r).height,s=this.attr(t,r).font.size;return i*.5+(n-a-2)*s};var rf=t0,af=function(){for(var e=0,t,r=arguments[e++],a=[],n,i,s,o;r;){if(n=/^[^\x25]+/.exec(r))a.push(n[0]);else if(n=/^\x25{2}/.exec(r))a.push("%");else if(n=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(r)){if((t=arguments[n[1]||e++])==null||t==null)throw"Too few arguments.";if(/[^s]/.test(n[7])&&typeof t!="number")throw"Expecting number but found "+typeof t;switch(n[7]){case"b":t=t.toString(2);break;case"c":t=String.fromCharCode(t);break;case"d":t=parseInt(t);break;case"e":t=n[6]?t.toExponential(n[6]):t.toExponential();break;case"f":t=n[6]?parseFloat(t).toFixed(n[6]):parseFloat(t);break;case"o":t=t.toString(8);break;case"s":t=(t=String(t))&&n[6]?t.substring(0,n[6]):t;break;case"u":t=Math.abs(t);break;case"x":t=t.toString(16);break;case"X":t=t.toString(16).toUpperCase();break}t=/[def]/.test(n[7])&&n[2]&&t>0?"+"+t:t,s=n[3]?n[3]=="0"?"0":n[3][1]:" ",o=n[5]-String(t).length,i=n[5]?str_repeat(s,o):"",a.push(n[4]?t+i:i+t)}else throw"Huh ?!";r=r.substring(n[0].length)}return a.join("")},It=af;function nf(e){return parseFloat(e.toFixed(2))}var nt=nf,dn=nt;function sf(e,t,r){var a=t.y;if(t.phrases){var o=e.paper.richTextLine(t.phrases,t.x,t.y,t.klass,t.anchor);return o}if(t.lane){var n=t.dim.font.size*.25;a+=(t.dim.font.size+n)*t.lane}var i;t.dim?(i=t.dim,i.attr.class=t.klass):i=e.controller.getFontAndAttr.calc(t.type,t.klass),t.anchor&&(i.attr["text-anchor"]=t.anchor),t["dominant-baseline"]&&(i.attr["dominant-baseline"]=t["dominant-baseline"]),i.attr.x=t.x,i.attr.y=a,t.centerVertically||(i.attr.y+=i.font.size),t.type==="debugfont"&&(console.log("Debug msg: "+t.text),i.attr.stroke="#ff0000"),t.cursor&&(i.attr.cursor=t.cursor);var s;t.name==="free-text"?s=t.text.replace(/^[ \t]*\n/gm,`
35
+ `&&n--,!t.noMove){var s=i.height*1.1*n;e.push({move:Math.round(s)}),t.marginBottom&&e.push({move:t.marginBottom})}}}var ea=Al;const Bl=ea;function Nl(e,t,r,a,i,n,s,c){var o=c.calc("i",r,a);if(t==="")e.push({move:o.height});else{if(typeof t=="string"){Bl(e,{marginLeft:n,text:t,font:r,klass:a,marginTop:s.marginTop,anchor:s.anchor,absElemType:s.absElemType,info:s.info,name:i},c);return}s.marginTop&&e.push({move:s.marginTop});var f=0,u={left:n,anchor:s.anchor,phrases:[]};a&&(u.klass=a),e.push(u);for(var l=0;l<t.length;l++){var h=t[l],d=h.font?h.font:c.attr(r,a).font,p={content:h.text};d&&(p.attrs={"font-family":c.getFamily(d.face),"font-size":d.size,"font-weight":d.weight,"font-style":d.style,"font-decoration":d.decoration}),u.phrases.push(p);var g=c.calc(h.text,d,a);f=Math.max(f,g.height),h.text[h.text.length-1]===" "&&o.width}e.push({move:f})}}var Tn=Nl;const z0=ea,f0=Tn;function Ll(e,t,r,a,i,n,s,c,o,f){if(this.rows=[],e.header&&n){var u=f.calc("X","headerfont","abcjs-header abcjs-meta-top").height;z0(this.rows,{marginLeft:s,text:e.header.left,font:"headerfont",klass:"header meta-top",marginTop:-u,info:t.header,name:"header"},f),z0(this.rows,{marginLeft:s+i/2,text:e.header.center,font:"headerfont",klass:"header meta-top",marginTop:-u,anchor:"middle",info:t.header,name:"header"},f),z0(this.rows,{marginLeft:s+i,text:e.header.right,font:"headerfont",klass:"header meta-top",marginTop:-u,anchor:"end",info:t.header,name:"header"},f)}n&&this.rows.push({move:c.top});var l=r.titleleft?"start":"middle",h=r.titleleft?s:s+i/2;if(e.title){var d=o?"abcjs-title":"";f0(this.rows,e.title,"titlefont",d,"title",h,{marginTop:c.title,anchor:l,absElemType:"title",info:t.title},f)}if(a.length)for(var p=0;p<a.length&&a[p].subtitle;){var d=o?"abcjs-text abcjs-subtitle":"";f0(this.rows,a[p].subtitle.text,"subtitlefont",d,"subtitle",h,{marginTop:c.subtitle,anchor:l,absElemType:"subtitle",info:a[p].subtitle},f),p++}if(e.rhythm||e.origin||e.composer){if(this.rows.push({move:c.composer}),e.rhythm&&e.rhythm.length>0){var g=!!(e.composer||e.origin),d=o?"abcjs-rhythm":"";z0(this.rows,{marginLeft:s,text:e.rhythm,font:"infofont",klass:d,absElemType:"rhythm",noMove:g,info:t.rhythm,name:"rhythm"},f)}e.composer&&e.composer,e.origin&&e.origin;var v=e.composer?e.composer:"";if(e.origin&&(typeof v=="string"&&typeof e.origin=="string"?v+=" ("+e.origin+")":typeof v=="string"&&typeof e.origin!="string"?(v=[{text:v}],v.push({text:" ("}),v=v.concat(e.origin),v.push({text:")"})):(v.push({text:" ("}),v=v.concat(e.origin),v.push({text:")"}))),v){var d=o?"abcjs-composer":"";f0(this.rows,v,"composerfont",d,"composer",s+i,{anchor:"end",absElemType:"composer",info:t.composer},f)}}if(e.author&&e.author.length>0){var d=o?"abcjs-author":"";f0(this.rows,e.author,"composerfont",d,"author",s+i,{anchor:"end",absElemType:"author",info:t.author},f)}if(e.partOrder&&e.partOrder.length>0){var d=o?"abcjs-part-order":"";f0(this.rows,e.partOrder,"partsfont",d,"part-order",s,{absElemType:"partOrder",info:t.partOrder,anchor:"start"},f)}}var Pl=Ll;const m0=ea,En=Tn;function ir(e,t,r,a,i,n,s){this.rows=[],e.unalignedWords&&e.unalignedWords.length>0&&this.unalignedWords(e.unalignedWords,a,i,n,s),this.extraText(e,a,i,n,s),e.footer&&r&&this.footer(e.footer,t,a,s)}ir.prototype.unalignedWords=function(e,t,r,a,i){var n=a?"abcjs-unaligned-words":"",s="wordsfont",c=i.calc("i",s,n);this.rows.push({move:r.words}),Fr(this.rows,"",e,t,s,"unalignedWords","unalignedWords",n,"unalignedWords",r,a,i),this.rows.push({move:c.height})};function Et(e,t,r,a,i,n,s){r&&(t&&(typeof r=="string"?r=t+r:r=[{text:t}].concat(r)),i=n?"abcjs-extra-text "+i:"",En(e,r,"historyfont",i,"description",a,{absElemType:"extraText",anchor:"start"},s))}function Fr(e,t,r,a,i,n,s,c,o,f,u,l){if(r){c=u?"abcjs-extra-text "+c:"";var h=l.calc("A",i,c);if(typeof r=="string")t&&(r=t+`
36
+ `+r),m0(e,{marginLeft:a,text:r,font:i,absElemType:"extraText",name:o,"dominant-baseline":"middle",klass:c},l);else{e.push({startGroup:s,klass:c,name:o}),e.push({move:f.info}),t&&(m0(e,{marginLeft:a,text:t,font:i,absElemType:"extraText",name:o,"dominant-baseline":"middle"},l),e.push({move:h.height*3/4}));for(var d=0;d<r.length;d++)En(e,r[d],i,"",o,a,{anchor:"start"},l),d<r.length-1&&typeof r[d]=="string"&&typeof r[d+1]!="string"&&e.push({move:h.height*3/4});e.push({endGroup:s,absElemType:n,startChar:-1,endChar:-1,name:o}),e.push({move:h.height})}}}ir.prototype.extraText=function(e,t,r,a,i){Et(this.rows,"Book: ",e.book,t,"abcjs-book",a,i),Et(this.rows,"Source: ",e.source,t,"abcjs-source",a,i),Et(this.rows,"Discography: ",e.discography,t,"abcjs-discography",a,i),Fr(this.rows,"Notes:",e.notes,t,"historyfont","extraText","notes","abcjs-notes","description",r,a,i),Et(this.rows,"Transcription: ",e.transcription,t,"abcjs-transcription",a,i),Fr(this.rows,"History:",e.history,t,"historyfont","extraText","history","abcjs-history","description",r,a,i),Et(this.rows,"Copyright: ",e["abc-copyright"],t,"abcjs-copyright",a,i),Et(this.rows,"Creator: ",e["abc-creator"],t,"abcjs-creator",a,i),Et(this.rows,"Edited By: ",e["abc-edited-by"],t,"abcjs-edited-by",a,i)};ir.prototype.footer=function(e,t,r,a){var i="header meta-bottom",n="footerfont";this.rows.push({startGroup:"footer",klass:i}),m0(this.rows,{marginLeft:r,text:e.left,font:n,klass:i,name:"footer"},a),m0(this.rows,{marginLeft:r+t/2,text:e.center,font:n,klass:i,anchor:"middle",name:"footer"},a),m0(this.rows,{marginLeft:r+t,text:e.right,font:n,klass:i,anchor:"end",name:"footer"},a)};var Dl=ir;function yr(e,t,r,a){if(e.indexOf(t)===0){var i=e.replace(t,""),n=parseInt(i,10);""+n===i&&(r[a]=n)}}function Il(e,t){var r=[];if(e.absEl.elemset){for(var a={},i=0;i<e.absEl.elemset.length;i++){var n=e.absEl.elemset[i];if(n)for(var s=n.getAttribute("class").split(" "),c=0;c<s.length;c++)a[s[c]]=!0}for(var o=0;o<Object.keys(a).length;o++)r.push(Object.keys(a)[o])}for(var f={},u=0;u<r.length;u++)yr(r[u],"abcjs-v",f,"voice"),yr(r[u],"abcjs-l",f,"line"),yr(r[u],"abcjs-m",f,"measure");e.staffPos&&(f.staffPos=e.staffPos);for(var l=t.target;l&&l.dataset&&!l.dataset.name&&l.tagName.toLowerCase()!=="svg";)l=l.parentNode;for(var h=t.target;h&&h.dataset&&!h.dataset.index&&h.tagName.toLowerCase()!=="svg";)h=h.parentNode;return h&&h.dataset&&(f.name=h.dataset.name,f.clickedName=l.dataset.name,f.parentClasses=h.classList),l&&l.classList&&(f.clickedClasses=l.classList),f.selectableElement=e.svgEl,{classes:r,analysis:f}}var Sn=Il,Q0=Se,Fl=Sn;function Ol(e,t){if(e.rangeHighlight=Ul,e.dragging)for(var r=0;r<e.selectables.length;r++){var a=e.selectables[r];a.svgEl.getAttribute("selectable")==="true"&&(a.svgEl.setAttribute("tabindex",0),a.svgEl.setAttribute("data-index",r),a.svgEl.addEventListener("keydown",$l.bind(e)),a.svgEl.addEventListener("keyup",Gl.bind(e)),a.svgEl.addEventListener("focus",zl.bind(e)))}for(var i=0;i<t.length;i++)t[i].addEventListener("touchstart",ni.bind(e),{passive:!0}),t[i].addEventListener("touchmove",si.bind(e),{passive:!0}),t[i].addEventListener("touchend",w0.bind(e),{passive:!0}),t[i].addEventListener("mousedown",ni.bind(e)),t[i].addEventListener("mousemove",si.bind(e)),t[i].addEventListener("mouseup",w0.bind(e))}function Hl(e){var t=1,r=1,a=e.target.closest("svg"),i=0;a&&a.viewBox&&a.viewBox.baseVal&&(a.viewBox.baseVal.width!==0&&(t=a.viewBox.baseVal.width/a.clientWidth),a.viewBox.baseVal.height!==0&&(r=a.viewBox.baseVal.height/a.clientHeight),i=a.viewBox.baseVal.y);var n=e.target&&e.target.tagName==="svg",s,c;return n?(s=e.offsetX,c=e.offsetY):(s=e.layerX,c=e.layerY),s=s*t,c=c*r,[s,c+i]}function zl(e){this.dragMechanism==="keyboard"&&this.dragYStep!==0&&this.dragTarget&&An.bind(this)(this.dragTarget,this.dragYStep,this.selectables.length,this.dragIndex,e),this.dragYStep=0}function $l(e){switch(e.keyCode){case 38:case 40:e.preventDefault()}}function Gl(e){var t=!1,r=e.target.dataset.index;switch(e.keyCode){case 13:case 32:t=!0,this.dragTarget=this.selectables[r],this.dragIndex=r,this.dragMechanism="keyboard",w0.bind(this)(e);break;case 38:t=!0,this.dragTarget=this.selectables[r],this.dragIndex=r,this.dragTarget&&this.dragTarget.isDraggable&&(this.dragging&&this.dragTarget.isDraggable&&this.dragTarget.absEl.highlight(void 0,this.dragColor),this.dragYStep--,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+this.dragYStep*Q0.STEP+")"));break;case 40:t=!0,this.dragTarget=this.selectables[r],this.dragIndex=r,this.dragMechanism="keyboard",this.dragTarget&&this.dragTarget.isDraggable&&(this.dragging&&this.dragTarget.isDraggable&&this.dragTarget.absEl.highlight(void 0,this.dragColor),this.dragYStep++,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+this.dragYStep*Q0.STEP+")"));break;case 9:this.dragYStep!==0&&w0.bind(this)(e);break}t&&e.preventDefault()}function Rl(e,t){if(!t)return-1;var r=t.dataset;if(!r)return-1;for(var a=r.index,i=0;i<e.length;i++){var n=e[i].svgEl.dataset;if(n&&a===n.index)return i}return-1}function Yl(e,t,r){for(var a=9999999,i=-1,n=0;n<e.selectables.length&&a>0;n++){var s=e.selectables[n];if(e.getDim(s),s.dim.left<t&&s.dim.right>t&&s.dim.top<r&&s.dim.bottom>r)i=n,a=0;else if(s.dim.top<r&&s.dim.bottom>r){var c=Math.min(Math.abs(s.dim.left-t),Math.abs(s.dim.right-t));c<a&&(a=c,i=n)}else if(s.dim.left<t&&s.dim.right>t){var o=Math.min(Math.abs(s.dim.top-r),Math.abs(s.dim.bottom-r));o<a&&(a=o,i=n)}else{var f=Math.abs(t-s.dim.left)>Math.abs(t-s.dim.right)?Math.abs(t-s.dim.right):Math.abs(t-s.dim.left),u=Math.abs(r-s.dim.top)>Math.abs(r-s.dim.bottom)?Math.abs(r-s.dim.bottom):Math.abs(r-s.dim.top),l=Math.sqrt(f*f+u*u);l<a&&(a=l,i=n)}}return i>=0&&a<=12?i:-1}function ql(e,t,r){if(e.x<=t.offsetX&&e.x+e.width>=t.offsetX&&e.y<=t.offsetY&&e.y+e.height>=t.offsetY)return[t.offsetX,t.offsetY];var a=Math.abs(t.layerY/r-t.offsetY);return a<3?[t.offsetX,t.offsetY]:[t.layerX,t.layerY]}function Wl(e){if(!e)return null;if(e.tagName==="svg")return e;if(!e.getAttribute)return null;for(var t=e.getAttribute("selectable");!t;)e.parentElement?(e=e.parentElement,e.tagName==="svg"?t=!0:t=e.getAttribute("selectable")):t=!0;return e}function Mn(e,t){var r,a,i,n=Rl(e.selectables,Wl(t.target));return n>=0?(i=ql(e.selectables[n].svgEl.getBBox(),t,e.scale),r=i[0],a=i[1]):(i=Hl(t),r=i[0],a=i[1],n=Yl(e,r,a)),{x:r,y:a,clickedOn:n}}function ta(e){if(!(!e||!e.target||!e.touches||e.touches.length<1)){var t=e.target.getBoundingClientRect(),r=e.touches[0].pageX-t.left,a=e.touches[0].pageY-t.top;e.touches[0].offsetX=r,e.touches[0].offsetY=a,e.touches[0].layerX=e.touches[0].pageX,e.touches[0].layerY=e.touches[0].pageY}}function ni(e){var t=e;e.type==="touchstart"&&(ta(e),e.touches.length>0&&(t=e.touches[0]));var r=Mn(this,t);r.clickedOn>=0&&(e.type==="touchstart"||e.button===0)&&this.selectables[r.clickedOn]&&(this.dragTarget=this.selectables[r.clickedOn],this.dragIndex=r.clickedOn,this.dragMechanism="mouse",this.dragMouseStart={x:r.x,y:r.y},this.dragging&&this.dragTarget.isDraggable&&(Vl(this.renderer.paper,"abcjs-dragging-in-progress"),this.dragTarget.absEl.highlight(void 0,this.dragColor)))}function si(e){var t=e;if(e.type==="touchmove"&&(ta(e),e.touches.length>0&&(t=e.touches[0])),this.lastTouchMove=e,!(!this.dragTarget||!this.dragging||!this.dragTarget.isDraggable||this.dragMechanism!=="mouse"||!this.dragMouseStart)){var r=Mn(this,t),a=Math.round((r.y-this.dragMouseStart.y)/Q0.STEP);a!==this.dragYStep&&(this.dragYStep=a,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+a*Q0.STEP+")"))}}function w0(e){var t=e;e.type==="touchend"&&this.lastTouchMove&&(ta(this.lastTouchMove),this.lastTouchMove&&this.lastTouchMove.touches&&this.lastTouchMove.touches.length>0&&(t=this.lastTouchMove.touches[0])),this.dragTarget&&(Bn.bind(this)(),this.dragTarget.absEl&&this.dragTarget.absEl.highlight&&(this.selected=[this.dragTarget.absEl],this.dragTarget.absEl.highlight(void 0,this.selectionColor)),An.bind(this)(this.dragTarget,this.dragYStep,this.selectables.length,this.dragIndex,t),this.dragTarget.svgEl&&this.dragTarget.svgEl.focus&&(this.dragTarget.svgEl.focus(),this.dragTarget=null,this.dragIndex=-1),jl(this.renderer.svg,"abcjs-dragging-in-progress"))}function Xl(e){e>=0&&e<this.selectables.length&&(this.dragTarget=this.selectables[e],this.dragIndex=e,this.dragMechanism="keyboard",w0.bind(this)({target:this.dragTarget.svgEl}))}function An(e,t,r,a,i){for(var n=Fl(e,i),s=n.classes,c=n.analysis,o=0;o<this.listeners.length;o++)this.listeners[o](e.absEl.abcelem,e.absEl.tuneNumber,s.join(" "),c,{step:t,max:r,index:a,setSelection:Xl.bind(this)},i)}function Bn(){for(var e=0;e<this.selected.length;e++)this.selected[e].unhighlight(void 0,this.renderer.foregroundColor);this.selected=[]}function Ul(e,t){Bn.bind(this)();for(var r=0;r<this.staffgroups.length;r++)for(var a=this.staffgroups[r].voices,i=0;i<a.length;i++)for(var n=a[i].children,s=0;s<n.length;s++){var c=n[s].abcelem.startChar,o=n[s].abcelem.endChar;(t>c&&e<o||t===e&&t===o)&&(this.selected[this.selected.length]=n[s],n[s].highlight(void 0,this.selectionColor))}}function Nn(e){var t=e.getAttribute("class");t||(t="");for(var r=t.split(" "),a={},i=0;i<r.length;i++)a[r[i]]=!0;return a}function Ln(e,t){var r=[];for(var a in t)t.hasOwnProperty(a)&&r.push(a);e.setAttribute("class",r.join(" "))}function Vl(e,t){if(e){var r=Nn(e.svg);r[t]=!0,Ln(e.svg,r)}}function jl(e,t){if(e){var r=Nn(e.svg);delete r[t],Ln(e.svg,r)}}var Kl=Ol;function Ql(e,t,r,a,i){return t+(a-t)/(r-e)*(i-e)}var ra=Ql,Jl=at,Or=Se,Hr=ra,Zl=function(e){if(!(e.elems.length===0||e.allrests)){var t=th(e.stemsUp,e.isgrace),r=e.elems[0],a=e.elems[e.elems.length-1],i=0,n=e.stemsUp?r.abcelem.maxpitch:r.abcelem.minpitch;i=oi(r,e.stemsUp,n,i),i=oi(a,e.stemsUp,n,i),i=Math.max(e.stemHeight,i+3);var s=rh(e.average,e.elems.length,i,e.stemsUp,r.abcelem.averagepitch,a.abcelem.averagepitch,e.isflat,e.min,e.max,e.isgrace),c=Pn(e.stemsUp,r,a);e.addBeam({startX:c[0],endX:c[1],startY:s[0],endY:s[1],dy:t});for(var o=sh(e.elems,e.stemsUp,e.beams[0],e.isgrace,t),f=0;f<o.length;f++)e.addBeam(o[f]);ah(e.elems,e.stemsUp,e.beams[0],t,e.mainNote)}},ci=function(e){return e===void 0?0:Math.floor(Math.log(e)/Math.log(2))};function oi(e,t,r,a){if(!e.children)return a;for(var i=0;i<e.children.length;i++){var n=e.children[i];t&&n.top!==void 0&&n.c==="flags.ugrace"?a=Math.max(a,n.top-r):!t&&n.bottom!==void 0&&n.c==="flags.ugrace"&&(a=Math.max(a,r-n.bottom+7))}return a}function eh(e,t,r,a){if(a)return 0;var i=e-t,n=r/2;return i>n&&(i=n),i<-n&&(i=-n),i}function th(e,t){var r=e?Or.STEP:-Or.STEP;return t&&(r=r*.4),r}function Pn(e,t,r){var a=t.heads[e?0:t.heads.length-1],i=r.heads[e?0:r.heads.length-1],n=a.x;e&&(n+=a.w-.6);var s=i.x;return s+=e?i.w:.6,[n,s]}function rh(e,t,r,a,i,n,s,c,o,f){var u=r-2,l=r-2,h=Math.round(a?Math.max(e+u,o+l):Math.min(e-u,c-l)),d=eh(i,n,t,s),p=h+Math.floor(d/2),g=h+Math.floor(-d/2);return f||(a&&h<6||!a&&h>6)&&(p=6,g=6),[p,g]}function ah(e,t,r,a,i){for(var n=0;n<e.length;n++){var s=e[n];if(!s.abcelem.rest){var c=!s.addExtra,o=c?i:s,f=s.heads[t?0:s.heads.length-1],u=1/5,l=f.pitch+(t?u:-u),h=t?f.w:0;c||(h+=f.dx);var d=f.x+h,p=Hr(r.startX,r.startY,r.endX,r.endY,d),g=t?-.6:.6;t||(p-=a/2/Or.STEP),c&&(h+=s.heads[0].dx),f.c==="noteheads.slash.quarter"&&(t?l+=1:l-=1);var v=new Jl(null,h,0,l,{type:"stem",pitch2:p,linewidth:g});v.setX(o.x),o.addRight(v)}}}function ih(e,t){for(var r=t+1;r<e.length;r++)if(!e[r].abcelem.rest)return r;return-1}function nh(e,t){for(var r=t-1;r>=0;r--)if(!e[r].abcelem.rest)return r;return-1}function sh(e,t,r,a,i){for(var n=[],s=[],c=0;c<e.length;c++){var o=e[c];if(!o.abcelem.rest){var f=o.heads[t?0:o.heads.length-1],u=f.x+(t?f.w:0),l=Hr(r.startX,r.startY,r.endX,r.endY,u),h=t?-1.5:1.5;a&&(h=h*2/3);var d=o.abcelem.duration;d===0&&(d=.25);for(var p=ci(d);p<-3;p++){var g=-4-p;if(s[g]?s[g].single=!1:s[g]={x:u+(t?-.6:0),y:l+h*(g+1),durlog:p,single:!0},c>0&&o.abcelem.beambr&&o.abcelem.beambr<=g+1){s[g].split||(s[g].split=[s[g].x]);var v=Pn(t,e[c-1],o);s[g].split[s[g].split.length-1]>=v[0]&&(v[0]+=o.w),s[g].split.push(v[0]),s[g].split.push(v[1])}}for(var m=s.length-1;m>=0;m--){var y=ih(e,c),x=y===-1||y<e.length&&ci(e[y].abcelem.duration)>-m-4;if(x){var b=u,w=l+h*(m+1);if(s[m].single){var C=nh(e,c),T=C===-1,B=y===-1;if(T)b=u+5;else if(B)b=u-5;else{var E=e[C].abcelem.duration,z=e[y].abcelem.duration;E===z?b=c%2===0?u+5:u-5:b=E<z?u+5:u-5}w=Hr(r.startX,r.startY,r.endX,r.endY,b)+h*(m+1)}var I={startX:s[m].x,endX:b,startY:s[m].y,endY:w,dy:i};if(s[m].split!==void 0){var F=s[m].split;I.endX<=F[F.length-1]&&(F[F.length-1]-=o.w),F.push(I.endX),I.split=s[m].split}n.push(I),s=s.slice(0,m)}}}}return n}var ch=Zl,oh=ra;function lh(e){if(e.anchor1&&e.anchor2){e.hasBeam=!!e.anchor1.parent.beam&&e.anchor1.parent.beam===e.anchor2.parent.beam;var t=e.anchor1.parent.beam;if(e.hasBeam&&(t.elems[0]!==e.anchor1.parent||t.elems[t.elems.length-1]!==e.anchor2.parent)&&(e.hasBeam=!1),e.hasBeam){var r=wr(t)?e.anchor1.x+e.anchor1.w:e.anchor1.x;e.yTextPos=hh(r,e.anchor2.x,t),e.yTextPos+=wr(t)?3:-2,e.xTextPos=fh(r,e.anchor2.x),e.top=e.yTextPos+1,e.bottom=e.yTextPos-2,wr(t)&&(e.endingHeightAbove=4)}else{e.startNote=Math.max(e.anchor1.parent.top,9)+4,e.endNote=Math.max(e.anchor2.parent.top,9)+4,e.anchor1.parent.type==="rest"&&e.anchor2.parent.type!=="rest"?e.startNote=e.endNote:e.anchor2.parent.type==="rest"&&e.anchor1.parent.type!=="rest"&&(e.endNote=e.startNote);for(var a=0,i=0;i<e.middleElems.length;i++)a=Math.max(a,e.middleElems[i].top);a+=4,(a>e.startNote||a>e.endNote)&&(e.startNote=a,e.endNote=a),e.flatBeams&&(e.startNote=Math.max(e.startNote,e.endNote),e.endNote=Math.max(e.startNote,e.endNote)),e.yTextPos=e.startNote+(e.endNote-e.startNote)/2,e.xTextPos=e.anchor1.x+(e.anchor2.x+e.anchor2.w-e.anchor1.x)/2,e.top=e.yTextPos+1}}delete e.middleElems,delete e.flatBeams}function wr(e){return e.stemsUp}function hh(e,t,r){if(r.beams.length===0)return 0;r=r.beams[0];var a=e+(t-e)/2;return oh(r.startX,r.startY,r.endX,r.endY,a)}function fh(e,t){return e+(t-e)/2}var uh=lh,dh=ch,ph=ra,vh=uh,gh=function(e){for(var t=0;t<e.beams.length;t++)if(e.beams[t].type==="BeamElem"){dh(e.beams[t]),bh(e.beams[t]);for(var r=0;r<e.beams[t].elems.length;r++)e.adjustRange(e.beams[t].elems[r])}for(e.staff.specialY.chordLines=mh(e.children),t=0;t<e.otherchildren.length;t++){var a=e.otherchildren[t];a.type==="TripletElem"&&(vh(a),e.adjustRange(a))}e.staff.top=Math.max(e.staff.top,e.top),e.staff.bottom=Math.min(e.staff.bottom,e.bottom)};function bh(e){for(var t=1.5,r=0;r<e.elems.length;r++){var a=e.elems[r];if(a.top)for(var i=xh(a,e),n=0;n<a.children.length;n++){var s=a.children[n];if(s.klass==="ornament"&&s.position!=="below"&&s.bottom-t<i){var c=i-s.bottom+t;s.bottom+=c,s.top+=c,s.pitch+=c,i=a.top=s.top}}}}function li(e,t){var r=t.getChordDim();if(r){for(var a=0;a<e.length;a++){var i=e[a]<r.left;if(i){a>0&&t.putChordInLane(a),e[a]=r.right;return}}e.push(r.right),t.putChordInLane(e.length-1)}}function mh(e){var t=[0],r=[0],a,i,n;for(a=0;a<e.length;a++){for(i=0;i<e[a].children.length;i++)n=e[a].children[i],n.chordHeightAbove&&li(t,n);for(i=e[a].children.length-1;i>=0;i--)n=e[a].children[i],n.chordHeightBelow&&li(r,n)}return(t.length>1||r.length>1)&&wh(e,t.length,r.length),{above:t.length,below:r.length}}function yh(e){for(var t=0,r=0;r<e.children.length;r++){var a=e.children[r];a.chordHeightBelow&&t++}return t}function wh(e,t,r){for(var a=0;a<e.length;a++){yh(e[a]);for(var i=0;i<e[a].children.length;i++){var n=e[a].children[i];n.chordHeightAbove&&n.invertLane(t)}}}function xh(e,t){return t=t.beams[0],ph(t.startX,t.startY,t.endX,t.endY,e.x)}var Ch=gh,Kt=Se,kh=function(e,t){for(var r,a=0;a<t.staffs.length;a++){var i=t.staffs[a],n={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0};if(e.showDebug&&e.showDebug.indexOf("box")>=0&&(i.originalTop=i.top,i.originalBottom=i.bottom),Gt(i,n,"lyricHeightAbove"),Gt(i,n,"chordHeightAbove",i.specialY.chordLines.above),i.specialY.endingHeightAbove&&(i.specialY.chordHeightAbove?i.top+=2:i.top+=i.specialY.endingHeightAbove+vt,n.endingHeightAbove=i.top),i.specialY.dynamicHeightAbove&&i.specialY.volumeHeightAbove?(i.top+=Math.max(i.specialY.dynamicHeightAbove,i.specialY.volumeHeightAbove)+vt,n.dynamicHeightAbove=i.top,n.volumeHeightAbove=i.top):(Gt(i,n,"dynamicHeightAbove"),Gt(i,n,"volumeHeightAbove")),Gt(i,n,"partHeightAbove"),Gt(i,n,"tempoHeightAbove"),i.specialY.lyricHeightBelow&&(i.specialY.lyricHeightBelow+=e.spacing.vocal/Kt.STEP,n.lyricHeightBelow=i.bottom,i.bottom-=i.specialY.lyricHeightBelow+vt),i.specialY.chordHeightBelow){n.chordHeightBelow=i.bottom;var s=i.specialY.chordHeightBelow;i.specialY.chordLines.below&&(s*=i.specialY.chordLines.below),i.bottom-=s+vt}i.specialY.volumeHeightBelow&&i.specialY.dynamicHeightBelow?(n.volumeHeightBelow=i.bottom,n.dynamicHeightBelow=i.bottom,i.bottom-=Math.max(i.specialY.volumeHeightBelow,i.specialY.dynamicHeightBelow)+vt):i.specialY.volumeHeightBelow?(n.volumeHeightBelow=i.bottom,i.bottom-=i.specialY.volumeHeightBelow+vt):i.specialY.dynamicHeightBelow&&(n.dynamicHeightBelow=i.bottom,i.bottom-=i.specialY.dynamicHeightBelow+vt),e.showDebug&&e.showDebug.indexOf("box")>=0&&(i.positionY=n);for(var c=0;c<i.voices.length;c++){var o=t.voices[i.voices[c]];_h(n,o,e.spacing)}if(r!==void 0){var f=i.top-10,u=r+f,l=e.spacing.systemStaffSeparation/Kt.STEP,h=l-u;h>0&&(i.top+=h)}i.top+=e.spacing.staffTopMargin/Kt.STEP,r=2-i.bottom}},vt=1;function Gt(e,t,r,a){if(e.specialY[r]){var i=e.specialY[r];a&&(i*=a),e.top+=i+vt,t[r]=e.top}}function _h(e,t,r){var a,i;for(a=0;a<t.children.length;a++)i=t.children[a],Th(e,i,r);for(a=0;a<t.otherchildren.length;a++)switch(i=t.otherchildren[a],i.type){case"CrescendoElem":Eh(e,i);break;case"DynamicDecoration":Sh(e,i);break;case"EndingElem":Mh(e,i);break;case"TieElem":var n=i.getYBounds();t.staff.top=Math.max(t.staff.top,n[0]),t.staff.top=Math.max(t.staff.top,n[1]),t.staff.bottom=Math.min(t.staff.bottom,n[0]),t.staff.bottom=Math.min(t.staff.bottom,n[1]);break}}function Th(e,t,r){for(var a=0;a<t.children.length;a++){var i=t.children[a];for(var n in t.specialY)t.specialY.hasOwnProperty(n)&&i[n]&&(i.pitch=e[n],i.top===void 0&&(i.type==="TempoElement"?Ah(e,i):Bh(e,i,r),t.pushTop(i.top),t.pushBottom(i.bottom)))}}function Eh(e,t){t.dynamicHeightAbove?t.pitch=e.dynamicHeightAbove:t.pitch=e.dynamicHeightBelow}function Sh(e,t){t.volumeHeightAbove?t.pitch=e.volumeHeightAbove:t.pitch=e.volumeHeightBelow}function Mh(e,t){t.pitch=e.endingHeightAbove-2}function Ah(e,t){if(t.pitch=e.tempoHeightAbove,t.top=e.tempoHeightAbove,t.bottom=e.tempoHeightAbove,t.note){var r=t.pitch-t.totalHeightInPitches+1;t.note.top=r,t.note.bottom=r;for(var a=0;a<t.note.children.length;a++){var i=t.note.children[a];i.top+=r,i.bottom+=r,i.pitch+=r,i.pitch2!==void 0&&(i.pitch2+=r)}}}function Bh(e,t,r){switch(t.type){case"part":t.top=e.partHeightAbove+t.height,t.bottom=e.partHeightAbove;break;case"text":case"chord":t.chordHeightAbove?(t.top=e.chordHeightAbove,t.bottom=e.chordHeightAbove):(t.top=e.chordHeightBelow,t.bottom=e.chordHeightBelow);break;case"lyric":t.lyricHeightAbove?(t.top=e.lyricHeightAbove,t.bottom=e.lyricHeightAbove):(t.top=e.lyricHeightBelow+r.vocal/Kt.STEP,t.bottom=e.lyricHeightBelow+r.vocal/Kt.STEP,t.pitch-=r.vocal/Kt.STEP);break;case"debug":t.top=e.chordHeightAbove,t.bottom=e.chordHeightAbove;break}(t.pitch===void 0||t.top===void 0)&&console.error("RelativeElement position not set.",t.type,t.pitch,t.top,e)}var Nh=kh,ft=function(){};ft.beginLayout=function(e,t){t.i=0,t.durationindex=0,t.startx=e,t.minx=e,t.nextx=e,t.spacingduration=0};ft.layoutEnded=function(e){return e.i>=e.children.length};ft.getNextX=function(e){return Math.max(e.minx,e.nextx)};ft.getSpacingUnits=function(e){return Math.sqrt(e.spacingduration*8)};ft.layoutOneItem=function(e,t,r,a,i){var n=r.children[r.i];if(!n)return 0;var s=e-r.minx,c=r.durationindex+n.duration>0?a:0;if(n.abcelem.el_type==="note"&&!n.abcelem.rest&&r.voicenumber!==0&&i){var o=i.children[i.i],f=o&&(n.abcelem.maxpitch<=o.abcelem.maxpitch+1&&n.abcelem.maxpitch>=o.abcelem.minpitch-1||n.abcelem.minpitch<=o.abcelem.maxpitch+1&&n.abcelem.minpitch>=o.abcelem.minpitch-1);if(f&&n.abcelem.minpitch===o.abcelem.minpitch&&n.abcelem.maxpitch===o.abcelem.maxpitch&&o.heads&&o.heads.length>0&&n.heads&&n.heads.length>0&&o.heads[0].c===n.heads[0].c&&(f=!1),f){var u=o.heads&&o.heads.length>0?o.heads[0].realWidth:o.fixed.w;n.adjustedWidth||(n.adjustedWidth=u+n.w),n.w=n.adjustedWidth;for(var l=0;l<n.children.length;l++){var h=n.children[l];h.name.indexOf("accidental")<0&&(h.adjustedWidth||(h.adjustedWidth=h.dx+u),h.dx=h.adjustedWidth)}}}var d=Lh(n,c);return s<d&&(r.i===0||n.type!=="bar"||r.children[r.i-1].type!=="part"&&r.children[r.i-1].type!=="tempo")&&(e+=d-s),n.setX(e),r.spacingduration=n.duration,r.minx=e+Ph(n),r.i!==r.children.length-1&&(r.minx+=n.minspacing),this.updateNextX(e,t,r),e};ft.shiftRight=function(e,t){var r=t.children[t.i];r&&(r.setX(r.x+e),t.minx+=e,t.nextx+=e)};ft.updateNextX=function(e,t,r){r.nextx=e+t*this.getSpacingUnits(r)};ft.updateIndices=function(e){this.layoutEnded(e)||(e.durationindex+=e.children[e.i].duration,e.children[e.i].type==="bar"&&(e.durationindex=Math.round(e.durationindex*64)/64),e.i++)};function Lh(e,t){var r=0;return(e.type==="note"||e.type==="bar")&&(r=t),-e.extraw+r}function Ph(e){return e.w}var Dh=ft,Ne=Dh;function Ih(e){for(var t=0,r=0;r<e.length;r++){var a=e[r];if(a.children.length>0){var i=a.children.length-1,n=a.children[i];if(n.abcelem.el_type==="bar"){var s=n.children[0].x;s>t?t=s:n.children[0].x=t}}}}var Fh=function(e,t,r,a,i){var n=1e-7,s=0,c=1e3,o=i;a.startx=o;var f,u=0;for(r&&console.log("init layout",e),f=0;f<a.voices.length;f++)Ne.beginLayout(o,a.voices[f]);for(var l=0;!Oh(a.voices);){for(u=null,f=0;f<a.voices.length;f++)!Ne.layoutEnded(a.voices[f])&&(!u||xr(a.voices[f])<u)&&(u=xr(a.voices[f]));var h=[],d=[];for(f=0;f<a.voices.length;f++){var p=xr(a.voices[f]);p-u>n?d.push(a.voices[f]):h.push(a.voices[f])}l=0;var g=0;for(f=0;f<h.length;f++)Ne.getNextX(h[f])>o&&(o=Ne.getNextX(h[f]),l=Ne.getSpacingUnits(h[f]),g=h[f].spacingduration);s+=l,c=Math.min(c,l),r&&console.log("currentduration: ",u,s,c);var v=void 0;for(f=0;f<h.length;f++){var m=h[f];m.voicenumber===0&&(v=f);var y=v!==void 0&&h[v].voicenumber!==m.voicenumber?h[v]:void 0;Hh(m,y)||(y=void 0);var x=Ne.layoutOneItem(o,e,m,t,y),b=x-o;if(b>0){o=x;for(var w=0;w<f;w++)Ne.shiftRight(b,h[w])}}for(f=0;f<d.length;f++)d[f].spacingduration-=g,Ne.updateNextX(o,e,d[f]);for(f=0;f<h.length;f++){var C=h[f];Ne.updateIndices(C)}}for(f=0;f<a.voices.length;f++)Ne.getNextX(a.voices[f])>o&&(o=Ne.getNextX(a.voices[f]),l=Ne.getSpacingUnits(a.voices[f]));return Ih(a.voices),s+=l,a.setWidth(o),{spacingUnits:s,minSpace:c}};function Oh(e){for(var t=0;t<e.length;t++)if(!Ne.layoutEnded(e[t]))return!1;return!0}function xr(e){return e.durationindex-(e.children[e.i]&&e.children[e.i].duration>0?0:5e-7)}function Hh(e,t){return!e||!e.staff||!e.staff.voices||e.staff.voices.length===0||!t||!t.staff||!t.staff.voices||t.staff.voices.length===0?!1:e.staff.voices[0]===t.staff.voices[0]}var zh=Fh;function $h(e,t,r,a,i){var n=e.padding.left,s=0,c,o;for(c=0;c<r.length;c++)r[c].header&&(o=t.calc(r[c].header,"voicefont",""),s=Math.max(s,o.width));if(s=hi(s,a,t),s=hi(s,i,t),s){var f=t.calc("A","voicefont","");s+=f.width}n+=s;var u=0;return u=fi(a,n,u),u=fi(i,n,u),n+u}function hi(e,t,r){if(t){for(var a=0;a<t.length;a++)if(t[a].header){var i=r.calc(t[a].header,"voicefont","");e=Math.max(e,i.width)}}return e}function fi(e,t,r){if(e)for(var a=0;a<e.length;a++)Gh(t,e[a]),r=Math.max(r,e[a].getWidth());return r}function Gh(e,t){t.x=e}var Dn=$h,Rh=Dn;function Yh(e,t,r){var a=Rh(e,t.getTextSize,t.voices,t.brace,t.bracket),i=qh(t,r.minPadding),n=i.totalDuration,s=i.minSpacing,c=s*n;r.minWidth&&(c=Math.max(c,r.minWidth));var o=r.minPadding?r.minPadding/2:2;t.startx=a,t.w=c+a;for(var f=0;f<t.voices.length;f++){var u=t.voices[f];u.startx=a,u.w=c+a;for(var l=a,h=!1,d=0,p=0;p<u.children.length;p++){var g=u.children[p];h||(g.duration!==0?(h=!0,d=(c+a-l)/n,t.gridStart=l):(g.x=l,l+=g.w+g.minspacing)),h&&(r.align==="center"?g.x=l+g.duration*d/2-g.w/2:g.duration===0?g.x=l+1-g.w:g.x=l+o-g.extraw,l+=g.duration*d);for(var v=0;v<g.children.length;v++){var m=g.children[v],y=m.dx?m.dx:0;m.x=g.x+y}}t.gridEnd=l}return c}function qh(e,t){for(var r=0,a=0,i=0;i<e.voices.length;i++){for(var n=0,s=e.voices[i],c=0;c<s.children.length;c++){var o=s.children[c];if(n+=o.duration,o.duration){var f=(o.w+t)/o.duration;r=Math.max(r,f)}}a=Math.max(a,n)}return{totalDuration:a,minSpacing:r}}var Wh=Yh,Xh=Ch,Uh=Nh,Vh=zh,jh=Dn,Kh=Wh,Qh=function(e,t,r,a,i,n){var s,c,o=r;for(s=0;s<t.lines.length;s++)if(c=t.lines[s],c.staff){var f;n!==void 0?f=Kh(e,c.staffGroup,n):f=Jh(e,o,a,c.staffGroup,t.formatting,s===t.lines.length-1,!1),Math.round(f)>Math.round(o)&&(o=f,i&&(s=-1))}for(s=0;s<t.lines.length;s++)if(c=t.lines[s],c.staffGroup&&c.staffGroup.voices){for(var u=0;u<c.staffGroup.voices.length;u++)Xh(c.staffGroup.voices[u]);Uh(e,c.staffGroup)}for(s=0;s<t.lines.length;s++)c=t.lines[s],c.staffGroup&&c.staffGroup.setHeight();return o},Jh=function(e,t,r,a,i,n,s){for(var c=jh(e,a.getTextSize,a.voices,a.brace,a.bracket),o=r,f=0;f<8;f++){var u=Vh(o,e.minPadding,s,a,c);if(o=Zh(n,i.stretchlast,t+e.padding.left,a.w,o,u.spacingUnits,u.minSpace,e.padding.left+e.padding.right),o===null)break}return ef(a.voices),a.w-c};function Zh(e,t,r,a,i,n,s,c){if(e)if(t===void 0){if(a/r<.66)return null}else{var o=1-(a+c)/r,f=o<t;if(!f)return null}if(Math.abs(r-a)<2)return null;var u=n*i,l=a-u;return n>0?(i=(r-l)/n,i*s>50&&(i=50/s),i):null}function ef(e){for(var t=0;t<e.length;t++)for(var r=e[t],a=1;a<r.children.length-1;a++){var i=r.children[a];if(i.abcelem.rest&&(i.abcelem.rest.type==="whole"||i.abcelem.rest.type==="multimeasure")){var n=r.children[a-1],s=r.children[a+1];i.center(n,s)}}}var tf=Qh,Ge=function(t){this.shouldAddClasses=t.shouldAddClasses,this.reset()};Ge.prototype.reset=function(){this.lineNumber=null,this.voiceNumber=null,this.measureNumber=null,this.measureTotalPerLine=[],this.noteNumber=null};Ge.prototype.incrLine=function(){this.lineNumber===null?this.lineNumber=0:this.lineNumber++,this.voiceNumber=null,this.measureNumber=null,this.noteNumber=null};Ge.prototype.incrVoice=function(){this.voiceNumber===null?this.voiceNumber=0:this.voiceNumber++,this.measureNumber=null,this.noteNumber=null};Ge.prototype.isInMeasure=function(){return this.measureNumber!==null};Ge.prototype.newMeasure=function(){this.measureNumber&&(this.measureTotalPerLine[this.lineNumber]=this.measureNumber),this.measureNumber=null,this.noteNumber=null};Ge.prototype.startMeasure=function(){this.measureNumber=0,this.noteNumber=0};Ge.prototype.incrMeasure=function(){this.measureNumber++,this.noteNumber=0};Ge.prototype.incrNote=function(){this.noteNumber++};Ge.prototype.measureTotal=function(){for(var e=0,t=0;t<this.lineNumber;t++)e+=this.measureTotalPerLine[t]?this.measureTotalPerLine[t]:0;return this.measureNumber&&(e+=this.measureNumber),e};Ge.prototype.getCurrent=function(e){return{line:this.lineNumber,measure:this.measureNumber,measureTotal:this.measureTotal(),voice:this.voiceNumber,note:this.noteNumber}};Ge.prototype.generate=function(e){if(!this.shouldAddClasses)return"";var t=[];if(e&&e.length>0&&t.push(e),e==="abcjs-tab-number")return t.join(" ");if(e==="text instrument-name")return"abcjs-text abcjs-instrument-name";if(this.lineNumber!==null&&t.push("l"+this.lineNumber),this.measureNumber!==null&&t.push("m"+this.measureNumber),this.measureNumber!==null&&t.push("mm"+this.measureTotal()),this.voiceNumber!==null&&t.push("v"+this.voiceNumber),e&&(e.indexOf("note")>=0||e.indexOf("rest")>=0||e.indexOf("lyric")>=0)&&this.noteNumber!==null&&t.push("n"+this.noteNumber),t.length>0){t=t.join(" "),t=t.split(" ");for(var r=0;r<t.length;r++)t[r].indexOf("abcjs-")!==0&&t[r].length>0&&(t[r]="abcjs-"+t[r])}return t.join(" ")};var rf=Ge,nr=function(t,r){this.formatting=t,this.classes=r};nr.prototype.updateFonts=function(e){e.gchordfont&&(this.formatting.gchordfont=e.gchordfont),e.tripletfont&&(this.formatting.tripletfont=e.tripletfont),e.annotationfont&&(this.formatting.annotationfont=e.annotationfont),e.vocalfont&&(this.formatting.vocalfont=e.vocalfont)};nr.prototype.getFamily=function(e){return e[0]==='"'&&e[e.length-1]==='"'?e.substring(1,e.length-1):e};nr.prototype.calc=function(e,t){var r;typeof e=="string"?(r=this.formatting[e],r?r={face:r.face,size:Math.round(r.size*4/3),decoration:r.decoration,style:r.style,weight:r.weight,box:r.box}:r={face:"Arial",size:Math.round(12*4/3),decoration:"underline",style:"normal",weight:"normal"}):r={face:e.face,size:Math.round(e.size*4/3),decoration:e.decoration,style:e.style,weight:e.weight,box:e.box};var a=this.formatting.fontboxpadding?this.formatting.fontboxpadding:.1;r.padding=r.size*a;var i={"font-size":r.size,"font-style":r.style,"font-family":this.getFamily(r.face),"font-weight":r.weight,"text-decoration":r.decoration,class:this.classes.generate(t)};return{font:r,attr:i}};var af=nr,t0=function(t,r){this.getFontAndAttr=t,this.svg=r};t0.prototype.updateFonts=function(e){this.getFontAndAttr.updateFonts(e)};t0.prototype.attr=function(e,t){return this.getFontAndAttr.calc(e,t)};t0.prototype.getFamily=function(e){return e[0]==='"'&&e[e.length-1]==='"'?e.substring(1,e.length-1):e};t0.prototype.calc=function(e,t,r,a){var i;typeof t=="string"?i=this.attr(t,r):i={font:{face:t.face,size:t.size,decoration:t.decoration,style:t.style,weight:t.weight},attr:{"font-size":t.size,"font-style":t.style,"font-family":this.getFamily(t.face),"font-weight":t.weight,"text-decoration":t.decoration,class:this.getFontAndAttr.classes.generate(r)}};var n=this.svg.getTextSize(e,i.attr,a);return i.font.box?{height:n.height+i.font.padding*4,width:n.width+i.font.padding*4}:n};t0.prototype.baselineToCenter=function(e,t,r,a,i){var n=this.calc(e,t,r).height,s=this.attr(t,r).font.size;return n*.5+(i-a-2)*s};var nf=t0,sf=function(){for(var e=0,t,r=arguments[e++],a=[],i,n,s,c;r;){if(i=/^[^\x25]+/.exec(r))a.push(i[0]);else if(i=/^\x25{2}/.exec(r))a.push("%");else if(i=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(r)){if((t=arguments[i[1]||e++])==null||t==null)throw"Too few arguments.";if(/[^s]/.test(i[7])&&typeof t!="number")throw"Expecting number but found "+typeof t;switch(i[7]){case"b":t=t.toString(2);break;case"c":t=String.fromCharCode(t);break;case"d":t=parseInt(t);break;case"e":t=i[6]?t.toExponential(i[6]):t.toExponential();break;case"f":t=i[6]?parseFloat(t).toFixed(i[6]):parseFloat(t);break;case"o":t=t.toString(8);break;case"s":t=(t=String(t))&&i[6]?t.substring(0,i[6]):t;break;case"u":t=Math.abs(t);break;case"x":t=t.toString(16);break;case"X":t=t.toString(16).toUpperCase();break}t=/[def]/.test(i[7])&&i[2]&&t>0?"+"+t:t,s=i[3]?i[3]=="0"?"0":i[3][1]:" ",c=i[5]-String(t).length,n=i[5]?str_repeat(s,c):"",a.push(i[4]?t+n:n+t)}else throw"Huh ?!";r=r.substring(i[0].length)}return a.join("")},It=sf;function cf(e){return parseFloat(e.toFixed(2))}var it=cf,ui=it;function of(e,t,r){var a=t.y;if(t.phrases){var c=e.paper.richTextLine(t.phrases,t.x,t.y,t.klass,t.anchor);return c}if(t.lane){var i=t.dim.font.size*.25;a+=(t.dim.font.size+i)*t.lane}var n;t.dim?(n=t.dim,n.attr.class=t.klass):n=e.controller.getFontAndAttr.calc(t.type,t.klass),t.anchor&&(n.attr["text-anchor"]=t.anchor),t["dominant-baseline"]&&(n.attr["dominant-baseline"]=t["dominant-baseline"]),n.attr.x=t.x,n.attr.y=a,t.centerVertically||(n.attr.y+=n.font.size),t.type==="debugfont"&&(console.log("Debug msg: "+t.text),n.attr.stroke="#ff0000"),t.cursor&&(n.attr.cursor=t.cursor);var s;t.name==="free-text"?s=t.text.replace(/^[ \t]*\n/gm,`
37
37
  `):s=t.text.replace(/\n\n/g,`
38
38
 
39
39
  `),s=s.replace(/^\n/,` 
40
- `),i.font.box&&(r||e.paper.openGroup({klass:i.attr.class,fill:e.foregroundColor,"data-name":t.name}),i.attr["text-anchor"]==="end"?i.attr.x-=i.font.padding:i.attr["text-anchor"]==="start"&&(i.attr.x+=i.font.padding),i.attr.y+=i.font.padding,delete i.attr.class),t.noClass&&delete i.attr.class,i.attr.x=dn(i.attr.x),i.attr.y=dn(i.attr.y),t.name&&(i.attr["data-name"]=t.name);var o=e.paper.text(s,i.attr);if(i.font.box){var c=o.getBBox(),f=0;i.attr["text-anchor"]==="middle"?f=c.width/2+i.font.padding:i.attr["text-anchor"]==="end"&&(f=c.width+i.font.padding*2);var u=0;t.centerVertically&&(u=c.height-i.font.padding),e.paper.rect({"data-name":"box",x:Math.round(t.x-f),y:Math.round(a-u),width:Math.round(c.width+i.font.padding*2),height:Math.round(c.height+i.font.padding*2)}),r||(o=e.paper.closeGroup())}return o}var yt=sf,U0=It,Xe=Se,of=yt;function cf(e,t,r){var a=t.startVoice.staff.absoluteY-Xe.STEP*10;return t.endVoice&&t.endVoice.staff?t.endY=t.endVoice.staff.absoluteY-Xe.STEP*2:t.lastContinuedVoice&&t.lastContinuedVoice.staff?t.endY=t.lastContinuedVoice.staff.absoluteY-Xe.STEP*2:t.endY=t.startVoice.staff.absoluteY-Xe.STEP*2,ff(e,t.x,a,t.endY,t.type,t.header,r)}function lf(e,t,r,a,n){t+=Xe.STEP;var i=Xe.STEP*.75,s=Xe.STEP*.75,o=a-r,c=U0("M %f %f l %f %f l %f %f l %f %f z",t,r-s,0,o+s*2,i,0,0,-(o+s*2)),f=Xe.STEP*2,u=Xe.STEP;return c+=U0("M %f %f q %f %f %f %f q %f %f %f %f z",t+i,r-s,f*.6,u*.2,f,-u,-f*.1,u*.3,-f,u+Xe.STEP),c+=U0("M %f %f q %f %f %f %f q %f %f %f %f z",t+i,r+s+o,f*.6,-u*.2,f,u,-f*.1,-u*.3,-f,-u-Xe.STEP),e.paper.path({path:c,stroke:e.foregroundColor,fill:e.foregroundColor,class:e.controller.classes.generate(n),"data-name":n})}function hf(e,t,r,a,n){var i=a-r,s=pn(t,r,[7.5,-8,21,0,18.5,-10.5,7.5],[0,i/5.5,i/3.14,i/2,i/2.93,i/4.88,0]);return s+=pn(t,r,[0,17.5,-7.5,6.6,-5,20,0],[i/2,i/1.46,i/1.22,i,i/1.19,i/1.42,i/2]),e.paper.path({path:s,stroke:e.foregroundColor,fill:e.foregroundColor,class:e.controller.classes.generate(n),"data-name":n})}function pn(e,t,r,a){return U0("M %f %f C %f %f %f %f %f %f C %f %f %f %f %f %f z",e+r[0],t+a[0],e+r[1],t+a[1],e+r[2],t+a[2],e+r[3],t+a[3],e+r[4],t+a[4],e+r[5],t+a[5],e+r[6],t+a[6])}var ff=function(e,t,r,a,n,i,s){var o;if(i){e.paper.openGroup({klass:e.controller.classes.generate("staff-extra voice-name"),"data-name":n});var c=r+(a-r)/2;c=c-e.controller.getTextSize.baselineToCenter(i,"voicefont","staff-extra voice-name",0,1),of(e,{x:e.padding.left,y:c,text:i,type:"voicefont",klass:"staff-extra voice-name",anchor:"start",centerVertically:!0})}return n==="brace"?o=hf(e,t,r,a,n):n==="bracket"&&(o=lf(e,t,r,a,n)),i&&(o=e.paper.closeGroup()),s.wrapSvgEl({el_type:n,startChar:-1,endChar:-1},o),o},uf=cf;function df(e,t,r){var a=e.paper.path(t);return a}var T0=df,pf=It,vf=T0,gf=nt;function bf(e,t,r){(!t.anchor1||!t.anchor2||!t.anchor1.heads||!t.anchor2.heads||t.anchor1.heads.length===0||t.anchor2.heads.length===0)&&window.console.error("Glissando Element not set.");var a=4,n=e.calcY(t.anchor1.heads[0].pitch),i=e.calcY(t.anchor2.heads[0].pitch),s=t.anchor1.x+t.anchor1.w/2,o=t.anchor2.x+t.anchor2.w/2,c=mf(s,n,o,i),f=t.anchor1.w/2+a,u=t.anchor2.w/2+a,l=yf(s,n,o,i),h=zr(n,l,f);zr(i,l,-u);var d=wf(c-f-u),p=Ef(e,s+f,h,d,l);return r.wrapSvgEl({el_type:"glissando",startChar:-1,endChar:-1},p),[p]}function mf(e,t,r,a){var n=r-e,i=a-t;return Math.sqrt(n*n+i*i)}function yf(e,t,r,a){return(a-t)/(r-e)}function zr(e,t,r){return gf(e+r*t)}function wf(e){var t=5;return Math.max(2,Math.floor((e-t*2)/6))}var xf=[[3.5,-4.8]],Cf=[[1.5,-1],[.3,-.3],[-3.5,3.8]],kf=[[-1.5,2]],_f=[[3,4],[3,-4]],Tf=[[-3,4],[-3,-4]];function u0(e,t){for(var r="",a=0;a<e.length;a++)r+="l"+e[a][0]+" "+zr(e[a][1],t,e[a][0]);return r}var Ef=function(e,t,r,a,n){var i=pf("M %f %f",t,r);i+=u0(xf,n);var s;for(s=0;s<a;s++)i+=u0(_f,n);for(i+=u0(Cf,n),s=0;s<a;s++)i+=u0(Tf,n);return i+=u0(kf,n)+"z",vf(e,{path:i,highlight:"stroke",stroke:e.foregroundColor,class:e.controller.classes.generate("decoration"),"data-name":"glissando"})},Sf=bf,Mf=It,Af=T0,Gt=nt;function Bf(e,t,r){t.pitch===void 0&&window.console.error("Crescendo Element y-coordinate not set.");var a=e.calcY(t.pitch)+4,n=8,i=t.anchor1?t.anchor1.x:0,s=t.anchor2?t.anchor2.x:800,o;return t.dir==="<"?o=vn(e,a+n/2,a,a+n/2,a+n,i,s):o=vn(e,a,a+n/2,a+n,a+n/2,i,s),r.wrapSvgEl({el_type:"dynamicDecoration",startChar:-1,endChar:-1},o),[o]}var vn=function(e,t,r,a,n,i,s){t=Gt(t),r=Gt(r),a=Gt(a),n=Gt(n),i=Gt(i),s=Gt(s);var o=Mf("M %f %f L %f %f M %f %f L %f %f",i,t,s,r,i,a,s,n);return Af(e,{path:o,highlight:"stroke",stroke:e.foregroundColor,class:e.controller.classes.generate("dynamics decoration"),"data-name":"dynamics"})},Nf=Bf,gn=nt;function E0(){this.ingroup=!1}E0.prototype.beginGroup=function(e,t){this.paper=e,this.controller=t,this.path=[],this.lastM=[0,0],this.ingroup=!0,this.paper.openGroup()};E0.prototype.isInGroup=function(){return this.ingroup};E0.prototype.addPath=function(e){if(e=e||[],e.length!==0){e[0][0]="m",e[0][1]=gn(e[0][1]-this.lastM[0]),e[0][2]=gn(e[0][2]-this.lastM[1]),this.lastM[0]+=e[0][1],this.lastM[1]+=e[0][2],this.path.push(e[0]);for(var t=1,r=e.length;t<r;t++)e[t][0]==="m"&&(this.lastM[0]+=e[t][1],this.lastM[1]+=e[t][2]),this.path.push(e[t])}};E0.prototype.endGroup=function(e,t){this.ingroup=!1;for(var r="",a=0;a<this.path.length;a++)r+=this.path[a].join(" ");this.path=[];var n=this.paper.closeGroup();return n&&(n.setAttribute("class",this.controller.classes.generate(e)),n.setAttribute("fill",this.controller.renderer.foregroundColor),n.setAttribute("stroke","none"),n.setAttribute("data-name",t)),n};var Lf=new E0,aa=Lf,bn=yt,Yt=mt,mn=aa;function Pf(e,t,r,a,n){var i,s;if(!a)return null;if(a.length>1&&a.indexOf(".")<0){var o=mn.isInGroup()?"":n.klass;e.paper.openGroup({"data-name":n.name,klass:o});for(var c=0,f=0;f<a.length;f++){var u=a[f];s=Yt.getYCorr(u),i=Yt.printSymbol(t+c,e.calcY(r+s),u,e.paper,{stroke:n.stroke,fill:n.fill}),i?f<a.length-1&&(c+=Df(u,a[f+1],Yt.getSymbolWidth(u))):bn(e,{x:t,y:e.y,text:"no symbol:"+a,type:"debugfont",klass:"debug-msg",anchor:"start"},!1)}var l=e.paper.closeGroup();return l}else return s=Yt.getYCorr(a),mn.isInGroup()?i=Yt.printSymbol(t,e.calcY(r+s),a,e.paper,{"data-name":n.name}):i=Yt.printSymbol(t,e.calcY(r+s),a,e.paper,{klass:n.klass,stroke:n.stroke,fill:n.fill,"data-name":n.name}),i||(bn(e,{x:t,y:e.y,text:"no symbol:"+a,type:"debugfont",klass:"debug-msg",anchor:"start"},!1),null)}function Df(e,t,r){var a=r;return e==="f"&&t==="f"&&(a=a*2/3),e==="p"&&t==="p"&&(a=a*5/6),e==="f"&&t==="z"&&(a=a*5/8),a}var na=Pf,If=na;function Ff(e,t,r){t.pitch===void 0&&window.console.error("Dynamic Element y-coordinate not set.");var a=If(e,t.anchor.x,t.pitch,t.dec,{klass:e.controller.classes.generate("decoration dynamics"),fill:e.foregroundColor,stroke:"none",name:"dynamics"});return r.wrapSvgEl({el_type:"dynamicDecoration",startChar:-1,endChar:-1,decoration:t.dec},a),[a]}var Of=Ff,Hf=It,zf=yt,$f=T0,$0=nt;function Rf(e,t,r){e.paper.openGroup({klass:e.controller.classes.generate("triplet "+t.durationClass),"data-name":"triplet"}),t.hasBeam||Gf(e,t.anchor1.x,t.startNote,t.anchor2.x+t.anchor2.w,t.endNote),zf(e,{x:t.xTextPos,y:e.calcY(t.yTextPos-1),text:""+t.number,type:"tripletfont",anchor:"middle",centerVertically:!0,noClass:!0,name:""+t.number},!0);var a=e.paper.closeGroup();return r.wrapSvgEl({el_type:"triplet",startChar:-1,endChar:-1},a),a}function R0(e,t,r,a){return Hf("M %f %f L %f %f",$0(e),$0(t),$0(r),$0(a))}function Gf(e,t,r,a,n){r=e.calcY(r),n=e.calcY(n);var i=5,s="";s+=R0(t,r,t,r+i),s+=R0(a,n,a,n+i);var o=t+(a-t)/2,c=8,f=(n-r)/(a-t),u=o-c,l=r+(u-t)*f;s+=R0(t,r,u,l);var h=o+c,d=r+(h-t)*f;s+=R0(h,d,a,n),$f(e,{path:s,stroke:e.foregroundColor,"data-name":"triplet-bracket"})}var Yf=Rf,Cr=It,qf=yt,Wf=T0,St=nt;function Xf(e,t,r,a,n){t.pitch===void 0&&window.console.error("Ending Element y-coordinate not set.");var i=St(e.calcY(t.pitch)),s=20,o="";t.anchor1&&(r=St(t.anchor1.x+t.anchor1.w),o+=Cr("M %f %f L %f %f ",r,i,r,St(i+s))),t.anchor2&&(a=St(t.anchor2.x),o+=Cr("M %f %f L %f %f ",a,i,a,St(i+s))),o+=Cr("M %f %f L %f %f ",r,i,a,i),e.paper.openGroup({klass:e.controller.classes.generate("ending"),fill:e.foregroundColor,"data-name":"ending"}),Wf(e,{path:o,stroke:e.foregroundColor,fill:e.foregroundColor,"data-name":"line"}),t.anchor1&&qf(e,{x:St(r+5),y:St(e.calcY(t.pitch-.5)),text:t.text,type:"repeatfont",klass:"ending",anchor:"start",noClass:!0,name:t.text});var c=e.paper.closeGroup();return n.wrapSvgEl({el_type:"ending",startChar:-1,endChar:-1},c),[c]}var Uf=Xf,yn=It,He=nt;function Vf(e,t,r,a,n){jf(t,r,a);var i="";t.anchor1?i+="abcjs-start-m"+t.anchor1.parent.counters.measure+"-n"+t.anchor1.parent.counters.note:i+="abcjs-start-edge",t.anchor2?i+=" abcjs-end-m"+t.anchor2.parent.counters.measure+"-n"+t.anchor2.parent.counters.note:i+=" abcjs-end-edge",t.hint&&(i="abcjs-hint");var s=t.fixedY?1.5:0,o=Kf(e,t.startX,t.endX,t.startY+s,t.endY+s,t.above,i,t.isTie,t.dotted),c=-1;t.anchor1&&!t.isTie&&(c=t.anchor1.parent.abcelem.startChar-1);var f=-1;return t.anchor2&&!t.isTie&&(f=t.anchor2.parent.abcelem.endChar+1),n.wrapSvgEl({el_type:"slur",startChar:c,endChar:f},o),[o]}var jf=function(e,t,r){!e.anchor1||!e.anchor2||e.anchor1.pitch===e.anchor2.pitch&&e.internalNotes.length===0?e.isTie=!0:e.isTie=!1,e.isTie?(e.calcTieDirection(),e.calcX(t,r),e.calcTieY()):(e.calcSlurDirection(),e.calcX(t,r),e.calcSlurY()),e.avoidCollisionAbove()},Kf=function(e,t,r,a,n,i,s,o,c){var f=o?1.2:1.5;t=He(t+6),r=He(r+4),a=a+(i?f:-f),n=n+(i?f:-f);var u=He(e.calcY(a)),l=He(e.calcY(n)),h=r-t,d=l-u,p=Math.sqrt(h*h+d*d),g=h/p,v=d/p,m=p/3.5,y=o?10:25,x=(i?-1:1)*Math.min(y,Math.max(4,m)),b=He(t+m*g-x*v),w=He(u+m*v+x*g),C=He(r-m*g-x*v),T=He(l-m*v+x*g),B=2;s?s+=" slur":s="slur",s+=o?" tie":" legato";var E;if(c){s+=" dotted";var z=yn("M %f %f C %f %f %f %f %f %f",t,u,b,w,C,T,r,l);E=e.paper.path({path:z,stroke:e.foregroundColor,fill:"none","stroke-dasharray":"5 5",class:e.controller.classes.generate(s),"data-name":o?"tie":"slur"})}else{var F=yn("M %f %f C %f %f %f %f %f %f C %f %f %f %f %f %f z",t,u,b,w,C,T,r,l,He(C-B*v),He(T+B*g),He(b-B*v),He(w+B*g),t,u);E=e.paper.path({path:F,stroke:"none",fill:e.foregroundColor,class:e.controller.classes.generate(s),"data-name":o?"tie":"slur"})}return E},Qf=Vf,Jf=T0,qt=nt;function Zf(e,t){if(t.beams.length!==0){for(var r="",a=0;a<t.beams.length;a++){var n=t.beams[a];if(n.split){for(var i=eu(e,n.startX,n.startY,n.endX,n.endY),s=[],o=0;o<n.split.length;o+=2)s.push([n.split[o],n.split[o+1]]);for(o=0;o<s.length;o++){var c=xn(n.startX,n.startY,i,s[o][0]),f=xn(n.startX,n.startY,i,s[o][1]);r+=wn(e,s[o][0],c,s[o][1],f,n.dy)}}else r+=wn(e,n.startX,n.startY,n.endX,n.endY,n.dy)}var u=("abcjs-d"+t.duration).replace(/\./g,"-"),l=e.controller.classes.generate("beam-elem "+u),h=Jf(e,{path:r,stroke:"none",fill:e.foregroundColor,class:l});return[h]}}function wn(e,t,r,a,n,i){r=qt(e.calcY(r)),n=qt(e.calcY(n)),t=qt(t),a=qt(a);var s=qt(r+i),o=qt(n+i);return"M"+t+" "+r+" L"+a+" "+n+"L"+a+" "+o+" L"+t+" "+s+"z"}function eu(e,t,r,a,n){return(n-r)/(a-t)}function xn(e,t,r,a){var n=a-e;return t+n*r}var tu=Zf,ru=aa,Wt=nt;function au(e,t,r,a,n,i,s){if(r<0||a<n){var o=Wt(n);n=Wt(a),a=o}else a=Wt(a),n=Wt(n);t=Wt(t);var c=Wt(t+r);if(e.firefox112){t+=r/2;var u={x1:t,x2:t,y1:a,y2:n,stroke:e.foregroundColor,"stroke-width":Math.abs(r)};return i&&(u.class=i),s&&(u["data-name"]=s),e.paper.lineToBack(u)}for(var f=[["M",t,a],["L",t,n],["L",c,n],["L",c,a],["z"]],u={path:""},l=0;l<f.length;l++)u.path+=f[l].join(" ");return i&&(u.class=i),s&&(u["data-name"]=s),ru.isInGroup()||(u.stroke="none",u.fill=e.foregroundColor),e.paper.pathToBack(u)}var ia=au,nu=It,G0=nt;function iu(e,t,r,a,n,i,s){var o=e.foregroundColor;t=G0(t),r=G0(r);var c=G0(a-s),f=G0(a+s);if(e.firefox112){a+=s/2;var u={x1:t,x2:r,y1:a,y2:a,stroke:e.foregroundColor,"stroke-width":Math.abs(s*2)};return n&&(u.class=n),i&&(u["data-name"]=i),e.paper.lineToBack(u)}var l=nu("M %f %f L %f %f L %f %f L %f %f z",t,c,r,c,r,f,t,f),h={path:l,stroke:"none",fill:o};i&&(h["data-name"]=i),n&&(h.class=n);var d=e.paper.pathToBack(h);return d}var su=iu,ou=su;function cu(e,t,r,a,n,i,s){var o=e.calcY(a);return ou(e,t,r,o,n,i,s)}var Ii=cu,ot=yt,Cn=ia,lu=Ii,hu=na;function fu(e,t,r){t.pitch===void 0&&window.console.error(t.type+" Relative Element y-coordinate not set.");var a=e.calcY(t.pitch);switch(t.type){case"symbol":if(t.c===null)return null;var n="symbol";t.klass&&(n+=" "+t.klass),t.graphelem=hu(e,t.x,t.pitch,t.c,{scalex:t.scalex,scaley:t.scaley,klass:e.controller.classes.generate(n),name:t.name});break;case"debug":t.graphelem=ot(e,{x:t.x,y:e.calcY(15),text:""+t.c,type:"debugfont",klass:e.controller.classes.generate("debug-msg"),anchor:"start",centerVertically:!1,dim:t.dim},!1);break;case"tabNumber":var i="middle",s="tabnumberfont",o="abcjs-tab-number";t.isGrace&&(s="tabgracefont",a+=2.5,o="tab-grace"),t.graphelem=ot(e,{x:t.x,y:a,text:""+t.c,type:s,klass:e.controller.classes.generate(o),anchor:i,centerVertically:!1,dim:t.dim,cursor:"default"},!1);break;case"barNumber":t.graphelem=ot(e,{x:t.x,y:a,text:""+t.c,type:"measurefont",klass:e.controller.classes.generate("bar-number"),anchor:"middle",dim:t.dim,name:"bar-number"},!0);break;case"lyric":t.graphelem=ot(e,{x:t.x,y:a,text:t.c,type:"vocalfont",klass:e.controller.classes.generate("lyric"),anchor:"middle",dim:t.dim,name:"lyric"},!1);break;case"chord":t.graphelem=ot(e,{x:t.x,y:a,text:t.c,type:"gchordfont",klass:e.controller.classes.generate("chord"),anchor:"middle",dim:t.dim,lane:t.getLane(),name:"chord"},!1);break;case"decoration":t.graphelem=ot(e,{x:t.x,y:a+6,text:t.c,type:"annotationfont",klass:e.controller.classes.generate("annotation"),anchor:t.anchor,centerVertically:!0,dim:t.dim},!1);break;case"text":t.graphelem=ot(e,{x:t.x,y:a,text:t.c,type:"annotationfont",klass:e.controller.classes.generate("annotation"),anchor:"start",centerVertically:t.centerVertically,dim:t.dim,lane:t.getLane(),name:"annotation"},!1);break;case"multimeasure-text":t.graphelem=ot(e,{x:t.x+t.w/2,y:a,text:t.c,type:"tempofont",klass:e.controller.classes.generate("rest"),anchor:"middle",centerVertically:!1,dim:t.dim},!1);break;case"part":t.graphelem=ot(e,{x:t.x,y:a,text:t.c,type:"partsfont",klass:e.controller.classes.generate("part"),anchor:"start",dim:t.dim,name:t.c},!0);break;case"bar":t.graphelem=Cn(e,t.x,t.linewidth+e.lineThickness,a,r||e.calcY(t.pitch2),null,"bar");break;case"stem":var c=t.linewidth>0?t.linewidth+e.lineThickness:t.linewidth-e.lineThickness;t.graphelem=Cn(e,t.x,c,a,e.calcY(t.pitch2),"abcjs-stem","stem");break;case"ledger":t.graphelem=lu(e,t.x,t.x+t.w,t.pitch,"abcjs-ledger","ledger",.35+e.lineThickness);break}return t.scalex!==1&&t.graphelem&&uu(e.paper,t.graphelem,t.scalex,t.scaley,t.x,a),t.graphelem}function uu(e,t,r,a,n,i){e.setAttributeOnElement(t,{style:"transform:scale("+r+","+a+");transform-origin:"+n+"px "+i+"px;"})}var Fi=fu,du=Fi,kr=yt;function pu(e,t){var r=t.x;t.pitch===void 0&&window.console.error("Tempo Element y-coordinate not set."),t.tempo.el_type="tempo";var a=e.calcY(t.pitch)+2,n,i;if(t.tempo.preString){n=kr(e,{x:r,y:a,text:t.tempo.preString,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"pre"},!0),i=e.controller.getTextSize.calc(t.tempo.preString,"tempofont","tempo",n);var s=i.width,o=s/t.tempo.preString.length;r+=s+o}if(t.note){t.note.setX(r);for(var c=0;c<t.note.children.length;c++)du(e,t.note.children[c],r);r+=t.note.w+5;var f="= "+t.tempo.bpm;n=kr(e,{x:r,y:a,text:f,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"beats"}),i=e.controller.getTextSize.calc(f,"tempofont","tempo",n);var u=i.width,l=u/f.length;r+=u+l}t.tempo.postString&&kr(e,{x:r,y:a,text:t.tempo.postString,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"post"},!0)}var vu=pu,gu=vu,bu=Fi,mu=Se,kn=Vr,_n=aa;function yu(e,t,r,a,n){if(!t.invisible){var i=t.children.length>0&&t.children[0].type==="TempoElement";t.elemset=[],_n.beginGroup(e.paper,e.controller);for(var s=0;s<t.children.length;s++){var o=t.children[s];switch(o.type){case"TempoElement":gu(e,o);break;default:var c=bu(e,o,r);o.type==="symbol"&&o.c&&o.c.indexOf("notehead")>=0&&c.setAttribute("class","abcjs-notehead")}}var f=t.type;if((t.type==="note"||t.type==="rest")&&(t.counters=e.controller.classes.getCurrent(),f+=" d"+Math.round(t.durationClass*1e3)/1e3,f=f.replace(/\./g,"-"),t.abcelem.pitches))for(var u=0;u<t.abcelem.pitches.length;u++)f+=" p"+t.abcelem.pitches[u].pitch;var l=_n.endGroup(f,t.type);if(l){if(t.cloned&&(t.cloned.overrideClasses=l.className.baseVal),t.overrideClasses){var h=l.classList&&l.classList.length>0?l.classList[0]+" ":"";l.setAttribute("class",h+t.overrideClasses)}if(i)t.startChar=t.abcelem.startChar,t.endChar=t.abcelem.endChar,a.add(t,l,!1,n);else{t.elemset.push(l);var d=!1;(t.type==="note"||t.type==="tabNumber")&&(d=!0),a.add(t,l,d,n)}}else t.elemset.length>0&&a.add(t,t.elemset[0],t.type==="note",n);if(t.klass&&kn(t.elemset,"mark","","#00ff00"),t.hint&&kn(t.elemset,"abcjs-hint","",null),t.abcelem.abselem=t,t.heads&&t.heads.length>0){t.notePositions=[];for(var p=0;p<t.heads.length;p++)t.notePositions.push({x:t.heads[p].x+t.heads[p].w/2,y:n.zero-t.heads[p].pitch*mu.STEP})}}}var wu=yu,xu=Sf,Cu=Nf,ku=Of,_u=Yf,Tu=Uf,Eu=Qf,Su=tu,Mu=yt,Tn=wu;function Au(e,t,r,a,n){var i=t.w-1;e.staffbottom=t.staff.bottom;var s=e.foregroundColor;if(t.color&&(e.foregroundColor=t.color),t.header){var o=Mu(e,{x:e.padding.left,y:e.calcY(t.headerPosition),text:t.header,type:"voicefont",klass:"staff-extra voice-name",anchor:"start",centerVertically:!0,name:"voice-name"},!0);a.wrapSvgEl({el_type:"voiceName",startChar:-1,endChar:-1,text:t.header},o)}var c,f,u=!1;for(c=0;c<t.children.length;c++){f=t.children[c],(f.type==="note"||f.type==="rest")&&(u=!0);var l=!1;f.type!=="staff-extra"&&!e.controller.classes.isInMeasure()&&(e.controller.classes.startMeasure(),l=!0),t.staff.isTabStaff&&(f.invisible=!1,f.type=="bar"&&f.abcelem.lastBar&&(r=t.topLine)),Tn(e,f,t.barto||c===t.children.length-1?r:0,a,n),(f.type==="note"||Bu(f))&&e.controller.classes.incrNote(),f.type==="bar"&&!l&&u&&e.controller.classes.incrMeasure()}for(e.controller.classes.startMeasure(),c=0;c<t.beams.length;c++){var h=t.beams[c];h==="bar"?e.controller.classes.incrMeasure():Su(e,h)}for(e.controller.classes.startMeasure(),c=0;c<t.otherchildren.length;c++)if(f=t.otherchildren[c],f==="bar")e.controller.classes.incrMeasure();else switch(f.type){case"GlissandoElem":f.elemset=xu(e,f,a);break;case"CrescendoElem":f.elemset=Cu(e,f,a);break;case"DynamicDecoration":f.elemset=ku(e,f,a);break;case"TripletElem":_u(e,f,a);break;case"EndingElem":f.elemset=Tu(e,f,t.startx+10,i,a);break;case"TieElem":f.elemset=Eu(e,f,t.startx+10,i,a);break;default:console.log(f),Tn(e,f,t.startx+10,i,a)}e.foregroundColor=s}function Bu(e){return e.type!=="rest"?!1:!!(e.abcelem&&e.abcelem.rest&&e.abcelem.rest.type!=="spacer")}var Nu=Au,En=Ii;function Lu(e,t,r,a,n,i){var s="abcjs-top-line",o=2;n&&(o=n),e.paper.openGroup({prepend:!0,klass:e.controller.classes.generate("abcjs-staff")});var c=0,f=0;if(a===1)En(e,t,r,6,s,null,i+e.lineThickness),c=e.calcY(10),f=e.calcY(2);else for(var u=a-1;u>=0;u--){var l=(u+1)*o;f=e.calcY(l),c===0&&(c=f),En(e,t,r,l,s,null,i+e.lineThickness),s=void 0}return e.paper.closeGroup(),[c,f]}var Pu=Lu;function Du(e,t,r){var a=e.paper.rectBeneath(t);return r&&e.paper.text(r,{x:0,y:t.y+7,"text-anchor":"start","font-size":"14px",fill:"rgba(0,0,255,.4)",stroke:"rgba(0,0,255,.4)"}),a}var Iu=Du;function Fu(e,t){var r="rgba(0,0,0,255)",a="rgba(0,0,0,0)",n=Math.round(e.y),i=e.controller.width,s=(i-t)/2,o=s+t,c="M "+s+" "+n+" L "+o+" "+n+" L "+o+" "+(n+1)+" L "+s+" "+(n+1)+" L "+s+" "+n+" z";e.paper.pathToBack({path:c,stroke:a,fill:r,class:e.controller.classes.generate("defined-text")})}var Ou=Fu,Hu=Ou,zu=yt;function $u(e,t,r){for(var a=0;a<t.rows.length;a++){var n=t.rows[a];if(n.absmove)e.absolutemoveY(n.absmove);else if(n.move)e.moveY(n.move);else if(n.text||n.phrases){var i=n.left?n.left:0,s=zu(e,{x:i,y:e.y,text:n.text,phrases:n.phrases,"dominant-baseline":n["dominant-baseline"],type:n.font,klass:n.klass,name:n.name,anchor:n.anchor});n.absElemType&&r.wrapSvgEl({el_type:n.absElemType,name:n.name,startChar:n.startChar,endChar:n.endChar,text:n.text},s)}else if(n.separator)Hu(e,n.separator);else if(n.startGroup)e.paper.openGroup({klass:n.klass,"data-name":n.name});else if(n.endGroup){var o=e.paper.closeGroup();n.absElemType&&r.wrapSvgEl({el_type:n.absElemType,name:n.name,startChar:n.startChar,endChar:n.endChar,text:""},o)}}}var Oi=$u,Xt=Se,Ru=uf,Gu=Nu,Yu=Pu,J0=Iu,qu=ia,Wu=Oi;function Xu(e,t,r,a){for(var n,i=e.y,s=0;s<t.staffs.length;s++){var o=t.staffs[s];e.moveY(Xt.STEP,o.top),o.absoluteY=e.y,e.showDebug&&(e.showDebug.indexOf("box")>=0&&o.voices&&Uu(e,t.voices,o.voices),e.showDebug.indexOf("grid")>=0&&(e.paper.dottedLine({x1:e.padding.left,x2:e.padding.left+e.controller.width,y1:i,y2:i,stroke:"#0000ff"}),J0(e,{x:e.padding.left,y:e.calcY(o.originalTop),width:e.controller.width,height:e.calcY(o.originalBottom)-e.calcY(o.originalTop),fill:e.foregroundColor,stroke:e.foregroundColor,"fill-opacity":.1,"stroke-opacity":.1}),n=0,b(o,"chordHeightAbove"),b(o,"chordHeightBelow"),b(o,"dynamicHeightAbove"),b(o,"dynamicHeightBelow"),b(o,"endingHeightAbove"),b(o,"lyricHeightAbove"),b(o,"lyricHeightBelow"),b(o,"partHeightAbove"),b(o,"tempoHeightAbove"),b(o,"volumeHeightAbove"),b(o,"volumeHeightBelow"))),e.moveY(Xt.STEP,-o.bottom),e.showDebug&&e.showDebug.indexOf("grid")>=0&&e.paper.dottedLine({x1:e.padding.left,x2:e.padding.left+e.controller.width,y1:e.y,y2:e.y,stroke:"#0000aa"})}for(var c,f,u=2,l=0,h=0;h<t.voices.length;h++){var d=t.voices[h].staff,p=t.voices[h].tabNameInfos;if(e.y=d.absoluteY,e.controller.classes.incrVoice(),!t.voices[h].duplicate){if(c||(c=e.calcY(10)),f=e.calcY(u),d.lines!==0){d.linePitch&&(u=d.linePitch),e.controller.classes.newMeasure();var g=Yu(e,t.startx,t.w,d.lines,d.linePitch,.35);f=g[1],d.bottomLine=f,d.topLine=g[0],d.hasTab&&(l=d.topLine),d.hasStaff&&(l=d.hasStaff.topLine,t.voices[h].barto=!0,t.voices[h].topLine=c)}Sn(e,d.absoluteY,t.brace,h,r),Sn(e,d.absoluteY,t.bracket,h,r)}Gu(e,t.voices[h],l,r,{top:i,zero:e.y,height:t.height*Xt.STEP});var v=0;if(p){var m={rows:[]};m.rows.push({absmove:f+2});var y=8;m.rows.push({left:t.startx+y,text:p.name,font:"tablabelfont",klass:"text instrument-name",anchor:"start"}),m.rows.push({move:p.textSize.height}),Wu(e,m),v=p.textSize.height}e.controller.classes.newMeasure(),t.voices[h].duplicate||(l=e.calcY(2+v))}e.controller.classes.newMeasure();var x=t.staffs.length;x>1&&(c=t.staffs[0].topLine,f=t.staffs[x-1].bottomLine,qu(e,t.startx,.6,c,f,null)),e.y=i;function b(w,C){var T=["rgb(207,27,36)","rgb(168,214,80)","rgb(110,161,224)","rgb(191,119,218)","rgb(195,30,151)","rgb(31,170,177)","rgb(220,166,142)"];if(w.positionY&&w.positionY[C]){var B=w.specialY[C]*Xt.STEP;C==="chordHeightAbove"&&w.specialY.chordLines&&w.specialY.chordLines.above&&(B*=w.specialY.chordLines.above),C==="chordHeightBelow"&&w.specialY.chordLines&&w.specialY.chordLines.below&&(B*=w.specialY.chordLines.below),J0(e,{x:e.padding.left,y:e.calcY(w.positionY[C]),width:e.controller.width,height:B,fill:T[n],stroke:T[n],"fill-opacity":.4,"stroke-opacity":.4},C.substr(0,4)),n+=1,n>6&&(n=0)}}}function Sn(e,t,r,a,n){if(r)for(var i=0;i<r.length;i++)r[i].isStartVoice(a)&&(r[i].startY=t-Xt.STEP*10,r[i].elemset=Ru(e,r[i],n))}function Uu(e,t,r){for(var a=0;a<r.length;a++)for(var n=t[r[a]].children,i=0;i<n.length;i++){var s=n[i],o=s.getFixedCoords();if(!(s.invisible||o.t===void 0||o.b===void 0)){var c=(o.t-o.b)*Xt.STEP;J0(e,{x:o.x,y:e.calcY(o.t),width:o.w,height:c,fill:"#88e888","fill-opacity":.4,stroke:"#4aa93d","stroke-opacity":.8});for(var f=0;f<s.children.length;f++){var u=s.children[f],l=u.getChordDim();if(l){var h=e.calcY(u.pitch);h+=u.dim.font.size*u.getLane(),J0(e,{x:l.left,y:h,width:l.right-l.left,height:u.dim.font.size,fill:"none",stroke:"#4aa93d","stroke-opacity":.8})}}}}}var Vu=Xu;function ju(e,t,r,a){var n=(t+e.padding.left+e.padding.right)*r,i=(e.y+e.padding.bottom)*r;if(e.isPrint&&(i=Math.max(i,1056)),e.ariaLabel!==""){var s="Sheet Music";e.abctune&&e.abctune.metaText&&e.abctune.metaText.title&&(s+=' for "'+e.abctune.metaText.title+'"'),e.paper.setTitle(s);var o=e.ariaLabel?e.ariaLabel:s;e.paper.setAttribute("aria-label",o)}var c=["-webkit-touch-callout: none;","-webkit-user-select: none;","-khtml-user-select: none;","-moz-user-select: none;","-ms-user-select: none;","user-select: none;"];e.paper.insertStyles(".abcjs-dragging-in-progress text, .abcjs-dragging-in-progress tspan {"+c.join(" ")+"}");var f={overflow:"hidden"};a==="resize"?e.paper.setResponsiveWidth(n,i):(f.width="",f.height=i+"px",r<1?(f.width=n+"px",e.paper.setSize(n/r,i/r)):e.paper.setSize(n,i)),e.paper.setScale(r),e.paper.setParentStyles(f)}var Ku=ju,Qu=ii,Ju=si;function S0(e,t,r){this.elements=[],this.paper=e,this.tuneNumber=r,this.selectTypes=t}S0.prototype.getElements=function(){return this.elements};S0.prototype.add=function(e,t,r,a){if(this.canSelect(e)){var n;this.selectTypes===void 0?n={selectable:!1,"data-index":this.elements.length}:n={selectable:!0,tabindex:0,"data-index":this.elements.length},this.paper.setAttributeOnElement(t,n);var i={absEl:e,svgEl:t,isDraggable:r};a!==void 0&&(i.staffPos=a),this.elements.push(i)}};S0.prototype.canSelect=function(e){return this.selectTypes===!1||!e||!e.abcelem?!1:this.selectTypes===!0?!0:this.selectTypes===void 0?e.abcelem.el_type==="note"||e.abcelem.el_type==="tabNumber":this.selectTypes.indexOf(e.abcelem.el_type)>=0};S0.prototype.wrapSvgEl=function(e,t){var r={tuneNumber:this.tuneNumber,abcelem:e,elemset:[t],highlight:Qu,unhighlight:Ju};this.add(r,t,!1)};var Zu=S0;const x0=na,ed=ia;function td(e,t,r,a,n){const i=n.gchordfont;n.partsfont;const s=n.annotationfont,o=n.repeatfont,c=n.textfont,f=n.subtitlefont,u=50,l=10,h=14,d=10,p=20,g=16;e.paper.openGroup({klass:"abcjs-chord-grid"}),t.forEach(v=>{switch(v.type){case"text":Ut(e,v.text,r,e.y,16,c,null,null,!1),e.moveY(g);break;case"subtitle":Ut(e,v.subtitle,r,e.y+d,20,f,null,"abcjs-subtitle",!1),e.moveY(p);break;case"part":if(v.lines.length>0){Ut(e,v.name,r,e.y+d,20,f,v.name,"abcjs-part",!1),e.moveY(p);const m=v.lines[0].length,y=a/m;v.lines.forEach((x,b)=>{let w=!1,C=!1;x.forEach(B=>{B.ending&&(w=!0),B.annotations&&B.annotations.length>0&&(C=!0)});const T=C?h:w?l:0;x.forEach((B,E)=>{if(!B.noBorder){e.paper.rect({x:r+E*y,y:e.y,width:y,height:T+u}),e.paper.rect({x:r+E*y+1,y:e.y+1,width:y-1*2,height:T+u-1*2});let F=0,O=0;const R=e.y,Y=r+y*E;B.hasStartRepeat&&(Mn(e,Y,R,R+u+T,!0,T),F=12),B.hasEndRepeat&&(Mn(e,Y+y,R,R+u+T,!1,T),O=12);let K=0;B.ending&&(K=Ut(e,B.ending,r+E*y+4,R+10,12,o,null,null,!1).getBBox().width+4),nd(e,R,r+F,y,b,E,B.chord,i,F+O,u,T),B.annotations&&B.annotations.length>0&&ad(e,R,r+E*y+K,B.annotations,s),T&&e.paper.rectBeneath({x:r+E*y,y:e.y,width:y,height:T,fill:"#e8e8e8",stroke:"none"})}}),e.moveY(T+u)}),e.moveY(p)}break}}),e.paper.closeGroup()}function rd(e,t,r,a){var n=t-10,i=t+10,s=r+10,o=r-10,c=t-10,f=-e.yToPitch(a)+2,u=t+6.5,l=-e.yToPitch(a)-2.3;e.paper.lineToBack({x1:n,x2:i,y1:s,y2:o,"stroke-width":"3px","stroke-linecap":"round"}),x0(e,c,f,"dots.dot",{klass:"",name:"dot"}),x0(e,u,l,"dots.dot",{klass:"",name:"dot"})}function Mn(e,t,r,a,n,i){const s=n?t+2:t-4,o=n?t+9:t-11;e.paper.openGroup({klass:"abcjs-repeat"}),ed(e,s,3+e.lineThickness,r,a,null,"bar"),x0(e,o,-e.yToPitch(i)-4,"dots.dot",{klass:"",name:"dot"}),x0(e,o,-e.yToPitch(i)-8,"dots.dot",{klass:"",name:"dot"}),e.paper.closeGroup()}const An={segno:"scripts.segno",coda:"scripts.coda",fermata:"scripts.ufermata"};function ad(e,t,r,a,n){r+=3;let i;for(let s=0;s<a.length;s++)switch(a[s]){case"segno":case"coda":case"fermata":{r+=12,i=x0(e,r,-3,An[a[s]],{name:An[a[s]]});const o=i.getBBox();r+=o.width}break;default:Ut(e,a[s],r,t+12,12,n,null,null,!1)}}function nd(e,t,r,a,n,i,s,o,c,f,u){const l=r+a*i;!s[1]&&!s[2]&&!s[3]?sd(e,l,t+u,a-c,f,s[0],o,u):!s[1]&&!s[3]?od(e,l,t,a-c,f,s[0],s[2],o,u):cd(e,l,t,a-c,f,s,o,u)}function Nt(e,t,r,a,n,i,s){const o=Ut(e,n,t,r,a,i,null,"abcjs-chord",!0);let c=o.getBBox(),f=a;for(;c.width>s&&f>=14;)f-=2,o.setAttribute("font-size",f),c=o.getBBox()}const id=34,Bn=26,Y0=20,Lt=-3;function sd(e,t,r,a,n,i,s,o){i==="%"?rd(e,t+a/2,r+n/2,o+n/2):Nt(e,t+a/2,r+n/2+Lt,id,i,s,a)}function od(e,t,r,a,n,i,s,o,c){e.paper.lineToBack({x1:t,x2:t+a,y1:r+n+c,y2:r+2}),Nt(e,t+a/4,r+n/4+5+c+Lt,Bn,i,o,a/2),Nt(e,t+3*a/4,r+3*n/4+c+Lt,Bn,s,o,a/2)}function cd(e,t,r,a,n,i,s,o){e.paper.lineToBack({x1:t+3,x2:t+a-3,y1:r+n/2+o,y2:r+n/2+o}),e.paper.lineToBack({x1:t+a/2,x2:t+a/2,y1:r+3+o,y2:r+n-3+o}),i[0]&&Nt(e,t+a/4,r+n/4+2+o+Lt,Y0,q0(i[0]),s,a/2),i[1]&&Nt(e,t+3*a/4,r+n/4+2+o+Lt,Y0,q0(i[1]),s,a/2),i[2]&&Nt(e,t+a/4,r+3*n/4+o+Lt,Y0,q0(i[2]),s,a/2),i[3]&&Nt(e,t+3*a/4,r+3*n/4+o+Lt,Y0,q0(i[3]),s,a/2)}function q0(e){return e==="No Chord"?"N.C.":e}function Ut(e,t,r,a,n,i,s,o,c){const f={x:r,y:a,stroke:"none","font-size":n,"font-style":i.style,"font-family":i.face,"font-weight":i.weight,"text-decoration":i.decoration};return s&&(f["data-name"]=s),o&&(f.class=o),f["text-anchor"]=c?"middle":"start",e.paper.text(t,f,null,{"alignment-baseline":"middle"})}var ld=td,hd=Vu,fd=Ku,_r=Oi,Hi=Se,ud=Zu,dd=ld;function pd(e,t,r,a,n,i,s,o,c,f,u){var l=new ud(e.paper,o,c),h={};t.shouldAddClasses&&(h.klass="abcjs-meta-top"),e.paper.openGroup(h),e.moveY(e.padding.top),_r(e,r.topText,l),e.paper.closeGroup(),e.moveY(e.spacing.music);let d=!1;u&&r.chordGrid&&(dd(e,r.chordGrid,e.padding.left,a,r.formatting),u==="noMusic"&&(d=!0));var p=[],g=0;if(!d)for(var v=0;v<r.lines.length;v++){t.incrLine();var m=r.lines[v];if(m.staff){if(g++,r.formatting.maxStaves&&g>r.formatting.maxStaves)break;t.shouldAddClasses&&(h.klass="abcjs-staff-wrapper abcjs-l"+t.lineNumber),e.paper.openGroup(h),m.vskip&&e.moveY(m.vskip),p.length>=1&&gd(e,e.spacing.staffSeparation,p[p.length-1],m.staffGroup);var y=vd(e,m.staffGroup,l);y.line=f+v,p.push(y),e.paper.closeGroup()}else m.nonMusic&&(t.shouldAddClasses&&(h.klass="abcjs-non-music"),e.paper.openGroup(h),_r(e,m.nonMusic,l),e.paper.closeGroup())}return t.reset(),d||r.bottomText&&r.bottomText.rows&&r.bottomText.rows.length>0&&(t.shouldAddClasses&&(h.klass="abcjs-meta-bottom"),e.paper.openGroup(h),e.moveY(24),_r(e,r.bottomText,l),e.paper.closeGroup()),fd(e,n,s,i),{staffgroups:p,selectables:l.getElements()}}function vd(e,t,r,a){hd(e,t,r);var n=t.height*Hi.STEP;return e.y+=n,t}function gd(e,t,r,a){var n=r.staffs[r.staffs.length-1],i=-(n.bottom-2),s=a.staffs[0].top-10,o=s+i,c=o*Hi.STEP;c<t&&e.moveY(t-c)}var bd=pd,md=Si;function yd(e){for(var t=e;t&&t.attributes&&t.tagName.toLowerCase()!=="svg"&&!t.attributes.selectable;)t=t.parentNode;if(t&&t.attributes&&t.attributes.selectable){var r=t.attributes["data-index"].nodeValue;if(r&&(r=parseInt(r,10),r>=0&&r<this.selectables.length)){var a=this.selectables[r],n=md(a,e);return n.index=r,n.element=a,n}}return null}var wd=yd,xd=Se,Cd=yl,kd=Cl,_d=_l,Td=El,Ed=Ml,zi=Pl,Sd=Dl,Md=Kl,$i=Zh,Ad=ef,Ri=tf,Gi=rf,Bd=bd,Nd=di,Ld=wd,it=function(e,t){t=t||{},this.findSelectableElement=Ld,this.oneSvgPerLine=t.oneSvgPerLine,this.selectionColor=t.selectionColor,this.dragColor=t.dragColor?t.dragColor:t.selectionColor,this.dragging=!!t.dragging,this.selectTypes=t.selectTypes,this.responsive=t.responsive,this.space=3*xd.SPACE,this.initialClef=t.initialClef,this.timeBasedLayout=t.timeBasedLayout,this.expandToWidest=!!t.expandToWidest,this.scale=t.scale?parseFloat(t.scale):0,this.classes=new Ad({shouldAddClasses:t.add_classes}),this.scale>.1||(this.scale=void 0),t.staffwidth?(this.staffwidthScreen=t.staffwidth,this.staffwidthPrint=t.staffwidth):(this.staffwidthScreen=740,this.staffwidthPrint=680),this.listeners=[],t.clickListener&&this.addSelectListener(t.clickListener),this.renderer=new kd(e),this.renderer.setPaddingOverride(t),t.showDebug&&(this.renderer.showDebug=t.showDebug),t.jazzchords&&(this.jazzchords=t.jazzchords),t.accentAbove&&(this.accentAbove=t.accentAbove),t.germanAlphabet&&(this.germanAlphabet=t.germanAlphabet),t.lineThickness&&(this.lineThickness=t.lineThickness),t.chordGrid&&(this.chordGrid=t.chordGrid),this.renderer.controller=this,this.renderer.foregroundColor=t.foregroundColor?t.foregroundColor:"currentColor",t.ariaLabel!==void 0&&(this.renderer.ariaLabel=t.ariaLabel),this.renderer.minPadding=t.minPadding?t.minPadding:0,this.reset()};it.prototype.reset=function(){this.selected=[],this.staffgroups=[],this.engraver&&this.engraver.reset(),this.engraver=null,this.renderer.reset(),this.dragTarget=null,this.dragIndex=-1,this.dragMouseStart={x:-1,y:-1},this.dragYStep=0,this.lineThickness&&this.renderer.setLineThickness(this.lineThickness)};it.prototype.engraveABC=function(e,t,r){e[0]===void 0&&(e=[e]),this.reset();for(var a=0;a<e.length;a++)t===void 0&&(t=a),this.getFontAndAttr=new Ri(e[a].formatting,this.classes),this.getTextSize=new Gi(this.getFontAndAttr,this.renderer.paper),this.engraveTune(e[a],t,r)};it.prototype.adjustNonScaledItems=function(e){this.width/=e,this.renderer.adjustNonScaledItems(e)};it.prototype.getMeasureWidths=function(e){this.reset(),this.getFontAndAttr=new Ri(e.formatting,this.classes),this.getTextSize=new Gi(this.getFontAndAttr,this.renderer.paper);var t=this.jazzchords;this.setupTune(e,0),this.constructTuneElements(e),$i(this.renderer,e,0,this.space,this.timeBasedLayout);for(var r=[],a,n=!0,i=0;i<e.lines.length;i++){var s=e.lines[i];if(s.staff){if(n&&(a={left:0,measureWidths:[],total:0},r.push(a),n=!1),s.staffGroup.voices.length>0)for(var o=s.staffGroup.voices[0],c=!1,f=0,u=0;u<o.children.length;u++){var l=o.children[u];!c&&!l.isClef&&!l.isKeySig&&(c=!0,a.left=l.x,f=l.x),l.type==="bar"&&(a.measureWidths.push(l.x-f),a.total+=l.x-f,f=l.x)}}else n=!0}return this.jazzchords=t,r};it.prototype.setupTune=function(e,t){this.classes.reset(),e.formatting.jazzchords!==void 0&&(this.jazzchords=e.formatting.jazzchords),e.formatting.accentAbove!==void 0&&(this.accentAbove=e.formatting.accentAbove),this.renderer.newTune(e),this.engraver=new Cd(this.getTextSize,t,{bagpipes:e.formatting.bagpipes,flatbeams:e.formatting.flatbeams,graceSlurs:e.formatting.graceSlurs!==!1,percmap:e.formatting.percmap,initialClef:this.initialClef,jazzchords:this.jazzchords,timeBasedLayout:this.timeBasedLayout,accentAbove:this.accentAbove,germanAlphabet:this.germanAlphabet}),this.engraver.setStemHeight(this.renderer.spacing.stemHeight),this.engraver.measureLength=e.getMeterFraction().num/e.getMeterFraction().den,e.formatting.staffwidth?this.width=e.formatting.staffwidth*1.33:this.width=this.renderer.isPrint?this.staffwidthPrint:this.staffwidthScreen;var r=e.formatting.scale?e.formatting.scale:this.scale;return this.responsive==="resize"&&(r=void 0),r===void 0&&(r=this.renderer.isPrint?.75:1),this.adjustNonScaledItems(r),r};it.prototype.constructTuneElements=function(e){e.topText=new zi(e.metaText,e.metaTextInfo,e.formatting,e.lines,this.width,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize);var t,r,a=!1,n=!1;for(t=0;t<e.lines.length;t++)if(r=e.lines[t],r.staff)n=!0,r.staffGroup=this.engraver.createABCLine(r.staff,a?null:e.metaText.tempo,t),a=!0;else if(r.subtitle){if(n){var i=this.width/2+this.renderer.padding.left;r.nonMusic=new Ed(this.renderer.spacing.subtitle,e.formatting,r.subtitle,i,this.renderer.padding.left,this.getTextSize)}}else r.text!==void 0?(n=!0,r.nonMusic=new _d(r.text,r.vskip,this.getFontAndAttr,this.renderer.padding.left,this.width,this.getTextSize)):r.separator!==void 0&&r.separator.lineLength&&(n=!0,r.nonMusic=new Td(r.separator.spaceAbove,r.separator.lineLength,r.separator.spaceBelow));e.bottomText=new Sd(e.metaText,this.width,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize)};it.prototype.engraveTune=function(e,t,r){var a=this.jazzchords,n=this.setupTune(e,t);this.constructTuneElements(e);var i=$i(this.renderer,e,this.width,this.space,this.expandToWidest,this.timeBasedLayout);if(this.expandToWidest&&i>this.width+1&&(e.topText=new zi(e.metaText,e.metaTextInfo,e.formatting,e.lines,i,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize),e.lines&&e.lines.length>0))for(var s=e.lines.length,o=0;o<s;++o){var c=e.lines[o];if(c.nonMusic&&c.nonMusic.rows&&c.nonMusic.rows.length>0)for(var f=c.nonMusic.rows.length,u=0;u<f;++u){var l=c.nonMusic.rows[u];l.left&&(c.subtitle?l.left=i/2+this.renderer.padding.left:c.text&&c.text.length>0&&c.text[0].center&&(l.left=i/2+this.renderer.padding.left))}}e.tablatures&&Nd.layoutTablatures(this.renderer,e);var h=Bd(this.renderer,this.classes,e,this.width,i,this.responsive,n,this.selectTypes,t,r,this.chordGrid);if(this.staffgroups=h.staffgroups,this.selectables=h.selectables,this.oneSvgPerLine){var d=this.renderer.paper.svg.parentNode;this.svgs=Pd(this.renderer,d,e.metaText.title,this.responsive,n)}else this.svgs=[this.renderer.paper.svg];Md(this,this.svgs),this.jazzchords=a};function Pd(e,t,r,a,n){r||(r="Untitled");var i=t.querySelector("svg");a==="resize"&&(t.style.paddingBottom="");for(var s=i.querySelector("style"),o=a==="resize"?i.viewBox.baseVal.width:i.getAttribute("width"),c=t.querySelectorAll("svg > g"),f=0,u=[],l=0;l<c.length;l++){var h=c[l],d=h.getBBox(),p=d.y-f,g=d.height+p,v=document.createElement("div"),m="overflow: hidden;";a!=="resize"&&(m+="height:"+g*n+"px;"),v.setAttribute("style",m);var y=Dd(i),x='Sheet Music for "'+r+'" section '+(l+1);y.setAttribute("aria-label",x),a!=="resize"&&y.setAttribute("height",g),a==="resize"&&(y.style.position="");var b=e.firefox112?g+1:g;y.setAttribute("viewBox","0 "+f+" "+o+" "+b),y.appendChild(s.cloneNode(!0));var w=document.createElement("title");w.innerText=x,y.appendChild(w),y.appendChild(h),v.appendChild(y),u.push(y),t.appendChild(v),f=d.y+d.height}return t.removeChild(i),u}function Dd(e){for(var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg"),a=0;a<e.attributes.length;a++){var n=e.attributes[a];n.name!=="height"&&n.name!="aria-label"&&r.setAttribute(n.name,n.value)}return r}it.prototype.getDim=function(e){if(!e.dim){var t=e.svgEl.getBBox();e.dim={left:Math.round(t.x),top:Math.round(t.y),right:Math.round(t.x+t.width),bottom:Math.round(t.y+t.height)}}return e.dim};it.prototype.addSelectListener=function(e){this.listeners[this.listeners.length]=e};var Yi=it,Id=tr,qi=Yi,Fd=ai,Od=jn,V0={};function Nn(){var e=window.innerWidth;for(var t in V0)if(V0.hasOwnProperty(t)){var r=V0[t],a=r.offsetLeft;e-=a*2,r.style.width=e+"px"}}try{window.addEventListener("resize",Nn),window.addEventListener("orientationChange",Nn)}catch{}function Wi(e,t,r,a,n){r.viewportHorizontal?(e.innerHTML='<div class="abcjs-inner"></div>',r.scrollHorizontal?(e.style.overflowX="auto",e.style.overflowY="hidden"):e.style.overflow="hidden",V0[e.id]=e,e=e.children[0]):r.viewportVertical?(e.innerHTML='<div class="abcjs-inner scroll-amount"></div>',e.style.overflowX="hidden",e.style.overflowY="auto",e=e.children[0]):e.innerHTML="";var i=new qi(e,r);if(i.engraveABC(t,a,n),t.engraver=i,r.viewportVertical||r.viewportHorizontal){var s=e.parentNode;s.style.width=e.style.width}}var Hd=function(e,t,r,a,n){var i={},s;if(r){for(s in r)r.hasOwnProperty(s)&&(i[s]=r[s]);i.warnings_id&&i.tablature&&(i.tablature.warning_id=i.warnings_id)}if(a)for(s in a)a.hasOwnProperty(s)&&(s==="listener"?a[s].highlight&&(i.clickListener=a[s].highlight):i[s]=a[s]);if(n)for(s in n)n.hasOwnProperty(s)&&(i[s]=n[s]);function o(c,f,u,l){var h=!1;return c==="*"&&(h=!0,c=document.createElement("div"),c.setAttribute("style","visibility: hidden;"),document.body.appendChild(c)),!h&&i.wrap&&i.staffwidth?(f=zd(c,f,u,l,i),f):(i.afterParsing&&i.afterParsing(f,u,l),Wi(c,f,i,u,0),h&&c.parentNode.removeChild(c),null)}return Id.renderEngine(o,e,t,i)};function zd(e,t,r,a,n){var i=new qi(e,n),s=i.getMeasureWidths(t),o=Od.calcLineWraps(t,s,n);if(o.reParse){var c=new Fd;c.parse(a,o.revisedParams),t=c.getTune();var f=c.getWarnings();f&&(t.warnings=f)}return n.afterParsing&&n.afterParsing(t,r,a),Wi(e,t,o.revisedParams,r,0),t.explanation=o.explanation,t}var Xi=Hd,$d=tr,Rd=Yi,Gd=function(e,t){function r(a,n,i,s){a=document.createElement("div"),a.setAttribute("style","visibility: hidden;"),document.body.appendChild(a);var o=new Rd(a,t),c=o.getMeasureWidths(n);return a.parentNode.removeChild(a),{sections:c}}return $d.renderEngine(r,"*",e,t)},Yd=Gd,qd={},sa=qd,Tr=sa,Wd=function(e,t,r,a){Tr[t]||(Tr[t]={});var n=Tr[t];return n[r]||(n[r]=new Promise(function(i,s){var o=new XMLHttpRequest;let c=e+t+"-mp3/"+r+".mp3";o.open("GET",c,!0),o.responseType="arraybuffer",o.onload=function(){if(o.status!==200){s(Error("Can't load sound at "+c+" status="+o.status));return}var f=function(l){i({instrument:t,name:r,status:"loaded",audioBuffer:l})},u=a.decodeAudioData(o.response,f,function(){s(Error("Can't decode sound at "+c))});u&&typeof u.catch=="function"&&u.catch(s)},o.onerror=function(){s(Error("Can't load sound at "+c))},o.send()}).catch(i=>{throw console.error("Didn't load note",t,r,":",i.message),i})),n[r]},Xd=Wd,Ud=["acoustic_grand_piano","bright_acoustic_piano","electric_grand_piano","honkytonk_piano","electric_piano_1","electric_piano_2","harpsichord","clavinet","celesta","glockenspiel","music_box","vibraphone","marimba","xylophone","tubular_bells","dulcimer","drawbar_organ","percussive_organ","rock_organ","church_organ","reed_organ","accordion","harmonica","tango_accordion","acoustic_guitar_nylon","acoustic_guitar_steel","electric_guitar_jazz","electric_guitar_clean","electric_guitar_muted","overdriven_guitar","distortion_guitar","guitar_harmonics","acoustic_bass","electric_bass_finger","electric_bass_pick","fretless_bass","slap_bass_1","slap_bass_2","synth_bass_1","synth_bass_2","violin","viola","cello","contrabass","tremolo_strings","pizzicato_strings","orchestral_harp","timpani","string_ensemble_1","string_ensemble_2","synth_strings_1","synth_strings_2","choir_aahs","voice_oohs","synth_choir","orchestra_hit","trumpet","trombone","tuba","muted_trumpet","french_horn","brass_section","synth_brass_1","synth_brass_2","soprano_sax","alto_sax","tenor_sax","baritone_sax","oboe","english_horn","bassoon","clarinet","piccolo","flute","recorder","pan_flute","blown_bottle","shakuhachi","whistle","ocarina","lead_1_square","lead_2_sawtooth","lead_3_calliope","lead_4_chiff","lead_5_charang","lead_6_voice","lead_7_fifths","lead_8_bass_lead","pad_1_new_age","pad_2_warm","pad_3_polysynth","pad_4_choir","pad_5_bowed","pad_6_metallic","pad_7_halo","pad_8_sweep","fx_1_rain","fx_2_soundtrack","fx_3_crystal","fx_4_atmosphere","fx_5_brightness","fx_6_goblins","fx_7_echoes","fx_8_scifi","sitar","banjo","shamisen","koto","kalimba","bagpipe","fiddle","shanai","tinkle_bell","agogo","steel_drums","woodblock","taiko_drum","melodic_tom","synth_drum","reverse_cymbal","guitar_fret_noise","breath_noise","seashore","bird_tweet","telephone_ring","helicopter","applause","gunshot","percussion"],oa=Ud,Er=oa,Vd=function(e){for(var t=[],r=0;r<e.tracks.length;r++)t.push([]);var a=Er[0];return e.tracks.forEach(function(n,i){n.forEach(function(s){switch(s.cmd){case"note":var o=s.instrument!==void 0?Er[s.instrument]:a;if(s.duration>0){var c=s.gap?s.gap:0,f=s.duration;c=Math.min(c,f*2/3);var u={pitch:s.pitch,instrument:o,start:Math.round(s.start*1e6)/1e6,end:Math.round((s.start+f-c)*1e6)/1e6,volume:s.volume};s.startChar&&(u.startChar=s.startChar),s.endChar&&(u.endChar=s.endChar),s.style&&(u.style=s.style),s.cents&&(u.cents=s.cents),t[i].push(u)}break;case"program":a=Er[s.instrument];break;case"text":break;default:console.log("Unhandled midi event",s)}})}),t},jd=Vd;function Kd(e){if(e)window.abcjsAudioContext=e;else if(!window.abcjsAudioContext){var t=window.AudioContext||window.webkitAudioContext;if(t)window.abcjsAudioContext=new t;else return!1}return window.abcjsAudioContext.state!=="suspended"}var sr=Kd,Qd=sr;function Jd(){return window.abcjsAudioContext||Qd(),window.abcjsAudioContext}var r0=Jd,Zd=r0;function e2(){if(!window.Promise||!window.AudioContext&&!window.webkitAudioContext&&!navigator.mozAudioContext&&!navigator.msAudioContext)return!1;var e=Zd();if(e)return e.resume!==void 0}var or=e2,t2={21:"A0",22:"Bb0",23:"B0",24:"C1",25:"Db1",26:"D1",27:"Eb1",28:"E1",29:"F1",30:"Gb1",31:"G1",32:"Ab1",33:"A1",34:"Bb1",35:"B1",36:"C2",37:"Db2",38:"D2",39:"Eb2",40:"E2",41:"F2",42:"Gb2",43:"G2",44:"Ab2",45:"A2",46:"Bb2",47:"B2",48:"C3",49:"Db3",50:"D3",51:"Eb3",52:"E3",53:"F3",54:"Gb3",55:"G3",56:"Ab3",57:"A3",58:"Bb3",59:"B3",60:"C4",61:"Db4",62:"D4",63:"Eb4",64:"E4",65:"F4",66:"Gb4",67:"G4",68:"Ab4",69:"A4",70:"Bb4",71:"B4",72:"C5",73:"Db5",74:"D5",75:"Eb5",76:"E5",77:"F5",78:"Gb5",79:"G5",80:"Ab5",81:"A5",82:"Bb5",83:"B5",84:"C6",85:"Db6",86:"D6",87:"Eb6",88:"E6",89:"F6",90:"Gb6",91:"G6",92:"Ab6",93:"A6",94:"Bb6",95:"B6",96:"C7",97:"Db7",98:"D7",99:"Eb7",100:"E7",101:"F7",102:"Gb7",103:"G7",104:"Ab7",105:"A7",106:"Bb7",107:"B7",108:"C8",109:"Db8",110:"D8",111:"Eb8",112:"E8",113:"F8",114:"Gb8",115:"G8",116:"Ab8",117:"A8",118:"Bb8",119:"B8",120:"C9",121:"Db9"},ca=t2,r2=function(e){return window.URL.createObjectURL(a2(e.audioBuffers))};function a2(e){var t=e[0],r=t.numberOfChannels,a=t.length*r*2+44,n=new ArrayBuffer(a),i=new DataView(n),s=[],o,c,f=0,u=0;for(h(1179011410),h(a-8),h(1163280727),h(544501094),h(16),l(1),l(r),h(t.sampleRate),h(t.sampleRate*2*r),l(r*2),l(16),h(1635017060),h(a-u-4),o=0;o<r;o++)s.push(t.getChannelData(o));for(;u<a;){for(o=0;o<s.length;o++)c=Math.max(-1,Math.min(1,s[o][f])),c=(.5+c<0?c*32768:c*32767)|0,i.setInt16(u,c,!0),u+=2;f++}return new Blob([n],{type:"audio/wav"});function l(d){i.setUint16(u,d,!0),u+=2}function h(d){i.setUint32(u,d,!0),u+=4}}var n2=r2;function i2(e){return Math.pow(2,e/1200)}var Ui=i2,Ln=sa,s2=ca,o2=Ui;function c2(e,t,r,a,n,i,s,o,c){var f=window.OfflineAudioContext||window.webkitOfflineAudioContext,u=r.len*r.tempoMultiplier;i&&(u+=i/1e3),u-=o,u<0&&(u=.005);var l=new f(2,Math.floor((u+s)*t),t),h=s2[r.pitch];if(!Ln[r.instrument])return c&&c("placeNote skipped (instrument empty): "+r.instrument+":"+h),Promise.resolve();var d=Ln[r.instrument][h];return d?d.then(function(p){var g=l.createBufferSource();g.buffer=p.audioBuffer;var v=r.volume/96*n;g.gainNode=l.createGain(),r.pan&&l.createStereoPanner&&(g.panNode=l.createStereoPanner(),g.panNode.pan.setValueAtTime(r.pan,0)),g.gainNode.gain.value=v,g.gainNode.gain.linearRampToValueAtTime(g.gainNode.gain.value,u),g.gainNode.gain.linearRampToValueAtTime(0,u+s),r.cents&&(g.playbackRate.value=o2(r.cents)),g.panNode?(g.panNode.connect(l.destination),g.gainNode.connect(g.panNode)):g.gainNode.connect(l.destination),g.connect(g.gainNode),g.start(0),g.noteOff?g.noteOff(u+s):g.stop(u+s);var m;return l.oncomplete=function(y){if(y.renderedBuffer&&y.renderedBuffer.getChannelData)for(var x=0;x<a.length;x++){var b=a[x]*r.tempoMultiplier;i&&(b-=i/1e3),b<0&&(b=0),b=Math.floor(b*t),l2(e,y.renderedBuffer,b)}c&&c("placeNote: "+r.instrument+":"+h),m()},l.startRendering(),new Promise(function(y){m=y})}).catch(function(p){return c&&c("placeNote catch: "+p.message),Promise.reject(p)}):(c&&c("placeNote skipped: "+r.instrument+":"+h),Promise.resolve())}var l2=function(e,t,r){for(var a=0;a<2;a++)for(var n=t.getChannelData(a),i=e.getChannelData(a),s=0;s<n.length;s++)i[s+r]+=n[s]},h2=c2,f2=Xd,u2=jd,d2=sr,ce=r0,p2=or,v2=ca,W0=oa,g2=n2,b2=h2,Pn=sa,Mt="MIDI is not supported in this browser.",Dn="https://paulrosen.github.io/midi-js-soundfonts/abcjs/",In="https://paulrosen.github.io/midi-js-soundfonts/FluidR3_GM/",m2="https://paulrosen.github.io/midi-js-soundfonts/MusyngKite/";function y2(){var e=this;e.audioBufferPossible=void 0,e.directSource=[],e.startTimeSec=void 0,e.pausedTimeSec=void 0,e.audioBuffers=[],e.duration=void 0,e.isRunning=!1,e.options={},e.pickupLength=0,e.init=function(a){a||(a={}),a.options&&(e.options=a.options),d2(a.audioContext);var n=ce().currentTime;if(e.debugCallback=a.debugCallback,e.debugCallback&&e.debugCallback("init called"),e.audioBufferPossible=e._deviceCapable(),!e.audioBufferPossible)return Promise.reject({status:"NotSupported",message:Mt});var i=a.options?a.options:{};e.soundFontUrl=i.soundFontUrl?i.soundFontUrl:In,e.soundFontUrl[e.soundFontUrl.length-1]!=="/"&&(e.soundFontUrl+="/"),i.soundFontVolumeMultiplier||i.soundFontVolumeMultiplier===0?e.soundFontVolumeMultiplier=i.soundFontVolumeMultiplier:e.soundFontUrl===In||e.soundFontUrl===m2?e.soundFontVolumeMultiplier=3:e.soundFontUrl===Dn?e.soundFontVolumeMultiplier=.4:e.soundFontVolumeMultiplier=1,i.programOffsets?e.programOffsets=i.programOffsets:e.soundFontUrl===Dn?e.programOffsets={bright_acoustic_piano:20,honkytonk_piano:20,electric_piano_1:30,electric_piano_2:30,harpsichord:40,clavinet:20,celesta:20,glockenspiel:40,vibraphone:30,marimba:35,xylophone:30,tubular_bells:35,dulcimer:30,drawbar_organ:20,percussive_organ:25,rock_organ:20,church_organ:40,reed_organ:40,accordion:40,harmonica:40,acoustic_guitar_nylon:20,acoustic_guitar_steel:30,electric_guitar_jazz:25,electric_guitar_clean:15,electric_guitar_muted:35,overdriven_guitar:25,distortion_guitar:20,guitar_harmonics:30,electric_bass_finger:15,electric_bass_pick:30,fretless_bass:40,violin:105,viola:50,cello:40,contrabass:60,trumpet:10,trombone:90,alto_sax:20,tenor_sax:20,clarinet:20,flute:50,banjo:50,woodblock:20}:e.programOffsets={};var s=i.fadeLength!==void 0?parseInt(i.fadeLength,10):NaN;if(e.fadeLength=isNaN(s)?200:s,s=i.noteEnd!==void 0?parseInt(i.noteEnd,10):NaN,e.noteEnd=isNaN(s)?0:s,e.pan=i.pan,e.meterSize=1,a.visualObj){e.flattened=a.visualObj.setUpAudio(i);var o=a.visualObj.getMeterFraction();o.den&&(e.meterSize=o.num/o.den),e.pickupLength=a.visualObj.getPickupLength()}else if(a.sequence)e.flattened=a.sequence;else return Promise.reject(new Error("Must pass in either a visualObj or a sequence"));e.millisecondsPerMeasure=a.millisecondsPerMeasure?a.millisecondsPerMeasure:a.visualObj?a.visualObj.millisecondsPerMeasure(e.flattened.tempo):1e3,e.beatsPerMeasure=a.visualObj?a.visualObj.getBeatsPerMeasure():4,e.sequenceCallback=i.sequenceCallback,e.callbackContext=i.callbackContext,e.onEnded=i.onEnded,e.meterFraction=a.visualObj?a.visualObj.getMeterFraction():{den:1};var c={},f=[],u=[],l=W0[0];e.flattened.tracks.forEach(function(v){v.forEach(function(m){if(m.cmd==="program"&&W0[m.instrument]&&(l=W0[m.instrument]),m.pitch!==void 0){var y=m.pitch,x=v2[y],b=m.instrument!==void 0?W0[m.instrument]:l;if(x)if(c[b]||(c[b]={}),!Pn[b]||!Pn[b][x])c[b][x]=!0;else{var w=b+":"+x;f.indexOf(w)<0&&f.push(w)}else{var C=b+":"+x;console.log("Can't find note: ",y,C),u.indexOf(C)<0&&u.push(C)}}})}),e.debugCallback&&e.debugCallback("note gathering time = "+Math.floor((ce().currentTime-n)*1e3)+"ms"),n=ce().currentTime;var h=[];Object.keys(c).forEach(function(v){Object.keys(c[v]).forEach(function(m){h.push({instrument:v,note:m})})}),e.debugCallback&&e.debugCallback("notes "+JSON.stringify(h));for(var d=[],p=256,g=0;g<h.length;g+=p)d.push(h.slice(g,g+p));return new Promise(function(v,m){var y={cached:f,error:u,loaded:[]},x=0,b=function(){e.debugCallback&&e.debugCallback("loadBatch idx="+x+" len="+d.length),x<d.length?e._loadBatch(d[x],e.soundFontUrl,n).then(function(w){e.debugCallback&&e.debugCallback("loadBatch then"),n=ce().currentTime,w&&(w.error&&(y.error=y.error.concat(w.error)),w.loaded&&(y.loaded=y.loaded.concat(w.loaded))),x++,b()},m):(e.debugCallback&&e.debugCallback("resolve init"),v(y))};b()})},e._loadBatch=function(a,n,i,s){var o=[];return a.forEach(function(c){e.debugCallback&&e.debugCallback("getNote "+c.instrument+":"+c.note),o.push(f2(n,c.instrument,c.note,ce()))}),Promise.all(o).then(function(c){e.debugCallback&&e.debugCallback("mp3 load time = "+Math.floor((ce().currentTime-i)*1e3)+"ms");for(var f=[],u=[],l=[],h=[],d=0;d<c.length;d++){var p=c[d],g=p.instrument+":"+p.name;p.status==="loaded"?f.push(g):p.status==="pending"?l.push(g):p.status==="cached"?u.push(g):h.push(g+" "+p.message)}if(l.length>0){if(e.debugCallback&&e.debugCallback("pending "+JSON.stringify(l)),s?s=s*2:s=50,s<9e4)return new Promise(function(y,x){setTimeout(function(){var b=[];for(d=0;d<l.length;d++)g=l[d].split(":"),b.push({instrument:g[0],note:g[1]});e.debugCallback&&e.debugCallback("retry "+JSON.stringify(b)),e._loadBatch(b,n,i,s).then(function(w){y(w)}).catch(function(w){x(w)})},s)});for(var v=[],m=0;m<a.length;m++)v.push(a[m].instrument+"/"+a[m].note);return e.debugCallback&&e.debugCallback("loadBatch timeout"),Promise.reject(new Error("timeout attempting to load: "+v.join(", ")))}else return e.debugCallback&&e.debugCallback("loadBatch resolve"),Promise.resolve({loaded:f,cached:u,error:h})}).catch(function(c){e.debugCallback&&e.debugCallback("loadBatch catch "+c.message)})},e.prime=function(){var a=e.fadeLength/1e3;return e.isRunning=!1,e.audioBufferPossible?(e.debugCallback&&e.debugCallback("prime called"),new Promise(function(n,i){try{let y=function(x){var b=x&&x.audioBuffers&&x.audioBuffers.length>0?x.audioBuffers[0].duration:0;return{status:ce().state,duration:b}};var s=ce().currentTime,o=e.millisecondsPerMeasure/1e3/e.meterSize;if(e.duration=e.flattened.totalDuration*o,e.duration<=0)return e.audioBuffers=[],n({status:"empty",seconds:0});e.duration+=a;var c=Math.floor(ce().sampleRate*e.duration);e.stop();var f=u2(e.flattened);e.options.swing&&r(f,e.options.swing,e.meterFraction,e.pickupLength),e.sequenceCallback&&e.sequenceCallback(f,e.callbackContext);var u=t(f.length,e.pan),l={};f.forEach(function(x,b){var w=u&&u.length>b?u[b]:0;x.forEach(function(C){var T=C.instrument+":"+C.pitch+":"+C.volume+":"+Math.round((C.end-C.start)*1e3)/1e3+":"+w+":"+o+":"+(C.cents?C.cents:0);e.debugCallback&&e.debugCallback("noteMapTrack "+T),l[T]||(l[T]=[]),l[T].push(C.start)})});for(var h=[],d=ce().createBuffer(2,c,ce().sampleRate),p=0;p<Object.keys(l).length;p++){var g=Object.keys(l)[p],v=g.split(":"),m=v[6]!==void 0?parseFloat(v[6]):0;v={instrument:v[0],pitch:parseInt(v[1],10),volume:parseInt(v[2],10),len:parseFloat(v[3]),pan:parseFloat(v[4]),tempoMultiplier:parseFloat(v[5]),cents:m},h.push(b2(d,ce().sampleRate,v,l[g],e.soundFontVolumeMultiplier,e.programOffsets[v.instrument],a,e.noteEnd/1e3,e.debugCallback))}e.audioBuffers=[d],e.debugCallback&&(e.debugCallback("sampleRate = "+ce().sampleRate),e.debugCallback("totalSamples = "+c),e.debugCallback("creationTime = "+Math.floor((ce().currentTime-s)*1e3)+"ms")),Promise.all(h).then(function(){ce().state==="suspended"?ce().resume().then(function(){n(y(e))}):ce().state==="interrupted"?ce().suspend().then(function(){ce().resume().then(function(){n(y(e))})}):n(y(e))}).catch(function(x){i(x)})}catch(y){i(y)}})):Promise.reject(new Error(Mt))};function t(a,n){if(n==null)return null;var i=[];if(n.length){for(var s=0;s<a;s++)if(s<n.length){var o=parseFloat(n[s]);o<-1?o=-1:o>1&&(o=1),i.push(o)}else i.push(0);return i}else{var c=parseFloat(n);if(c*(a-1)>2)return null;for(var f=a%2===0,u=f?0-c/2:0,l=u+c,h=0;h<a;h++)f=h%2===0,f?(i.push(u),u-=c):(i.push(l),l+=c);return i}}e.start=function(){if(!e.audioBufferPossible)throw new Error(Mt);e.debugCallback&&e.debugCallback("start called");var a=e.pausedTimeSec?e.pausedTimeSec:0;e._kickOffSound(a),e.startTimeSec=ce().currentTime-a,e.pausedTimeSec=void 0,e.debugCallback&&e.debugCallback("MIDI STARTED",e.startTimeSec)},e.pause=function(){if(!e.audioBufferPossible)throw new Error(Mt);return e.debugCallback&&e.debugCallback("pause called"),e.pausedTimeSec=e.stop(),e.pausedTimeSec},e.resume=function(){e.start()},e.seek=function(a,n){var i;switch(n){case"seconds":i=a;break;case"beats":i=a*e.millisecondsPerMeasure/e.beatsPerMeasure/1e3;break;default:i=(e.duration-e.fadeLength/1e3)*a;break}if(!e.audioBufferPossible)throw new Error(Mt);e.debugCallback&&e.debugCallback("seek called sec="+i),e.isRunning?(e.stop(),e._kickOffSound(i)):e.pausedTimeSec=i,e.pausedTimeSec=i},e.stop=function(){e.isRunning=!1,e.pausedTimeSec=void 0,e.directSource.forEach(function(n){try{n.stop()}catch(i){console.log("direct source didn't stop:",i)}}),e.directSource=[];var a=ce().currentTime-e.startTimeSec;return a},e.finished=function(){e.startTimeSec=void 0,e.pausedTimeSec=void 0,e.isRunning=!1},e.download=function(){return g2(e)},e.getAudioBuffer=function(){return e.audioBuffers[0]},e.getIsRunning=function(){return e.isRunning},e._deviceCapable=function(){return p2()?!0:(console.warn(Mt),e.debugCallback&&e.debugCallback(Mt),!1)},e._kickOffSound=function(a){e.isRunning=!0,e.directSource=[],e.audioBuffers.forEach(function(n,i){e.directSource[i]=ce().createBufferSource(),e.directSource[i].buffer=n,e.directSource[i].connect(ce().destination)}),e.directSource.forEach(function(n){n.start(0,a)}),e.onEnded&&(e.directSource[0].onended=function(){e.onEnded(e.callbackContext)})};function r(a,n,i,s){if(!(i.den!=4&&i.den!=8)&&(n=parseFloat(n),!(isNaN(n)||n<=50))){n>75&&(n=75),n=n/50-1;var o=0,c=.25;i.den===8&&(c=c/2);for(var f=c/2,u=f*n,l=0;l<a.length;l++)for(var h=a[l],d=0;d<h.length;d++){var p=h[d];if((p.start-s)%f==0&&(p.start-s)%c!=0&&(d==0||h[d-1].start<=h[d].start-f)&&(d==h.length-1||h[d+1].start>=h[d].start+f)){var g=p.start;p.start+=u,p.volume*=1+o,d>0&&h[d-1].end==g&&(h[d-1].end=p.start,h[d-1].volume*=1-o)}}}}}var la=y2,w2=function(){var e=this;e.tracks=[],e.totalDuration=0,e.currentInstrument=[],e.starts=[],e.addTrack=function(){return e.tracks.push([]),e.currentInstrument.push(0),e.starts.push(0),e.tracks.length-1},e.setInstrument=function(t,r){e.tracks[t].push({channel:0,cmd:"program",instrument:r}),e.currentInstrument[t]=r},e.appendNote=function(t,r,a,n,i){var s={cmd:"note",duration:a,gap:0,instrument:e.currentInstrument[t],pitch:r,start:e.starts[t],volume:n};i&&(s.cents=i),e.tracks[t].push(s),e.starts[t]+=a,e.totalDuration=Math.max(e.totalDuration,e.starts[t])}},Vi=w2,x2=`
40
+ `),n.font.box&&(r||e.paper.openGroup({klass:n.attr.class,fill:e.foregroundColor,"data-name":t.name}),n.attr["text-anchor"]==="end"?n.attr.x-=n.font.padding:n.attr["text-anchor"]==="start"&&(n.attr.x+=n.font.padding),n.attr.y+=n.font.padding,delete n.attr.class),t.noClass&&delete n.attr.class,n.attr.x=ui(n.attr.x),n.attr.y=ui(n.attr.y),t.name&&(n.attr["data-name"]=t.name);var c=e.paper.text(s,n.attr);if(n.font.box){var o=c.getBBox(),f=0;n.attr["text-anchor"]==="middle"?f=o.width/2+n.font.padding:n.attr["text-anchor"]==="end"&&(f=o.width+n.font.padding*2);var u=0;t.centerVertically&&(u=o.height-n.font.padding),e.paper.rect({"data-name":"box",x:Math.round(t.x-f),y:Math.round(a-u),width:Math.round(o.width+n.font.padding*2),height:Math.round(o.height+n.font.padding*2)}),r||(c=e.paper.closeGroup())}return c}var yt=of,U0=It,Xe=Se,lf=yt;function hf(e,t,r){var a=t.startVoice.staff.absoluteY-Xe.STEP*10;return t.endVoice&&t.endVoice.staff?t.endY=t.endVoice.staff.absoluteY-Xe.STEP*2:t.lastContinuedVoice&&t.lastContinuedVoice.staff?t.endY=t.lastContinuedVoice.staff.absoluteY-Xe.STEP*2:t.endY=t.startVoice.staff.absoluteY-Xe.STEP*2,df(e,t.x,a,t.endY,t.type,t.header,r)}function ff(e,t,r,a,i){t+=Xe.STEP;var n=Xe.STEP*.75,s=Xe.STEP*.75,c=a-r,o=U0("M %f %f l %f %f l %f %f l %f %f z",t,r-s,0,c+s*2,n,0,0,-(c+s*2)),f=Xe.STEP*2,u=Xe.STEP;return o+=U0("M %f %f q %f %f %f %f q %f %f %f %f z",t+n,r-s,f*.6,u*.2,f,-u,-f*.1,u*.3,-f,u+Xe.STEP),o+=U0("M %f %f q %f %f %f %f q %f %f %f %f z",t+n,r+s+c,f*.6,-u*.2,f,u,-f*.1,-u*.3,-f,-u-Xe.STEP),e.paper.path({path:o,stroke:e.foregroundColor,fill:e.foregroundColor,class:e.controller.classes.generate(i),"data-name":i})}function uf(e,t,r,a,i){var n=a-r,s=di(t,r,[7.5,-8,21,0,18.5,-10.5,7.5],[0,n/5.5,n/3.14,n/2,n/2.93,n/4.88,0]);return s+=di(t,r,[0,17.5,-7.5,6.6,-5,20,0],[n/2,n/1.46,n/1.22,n,n/1.19,n/1.42,n/2]),e.paper.path({path:s,stroke:e.foregroundColor,fill:e.foregroundColor,class:e.controller.classes.generate(i),"data-name":i})}function di(e,t,r,a){return U0("M %f %f C %f %f %f %f %f %f C %f %f %f %f %f %f z",e+r[0],t+a[0],e+r[1],t+a[1],e+r[2],t+a[2],e+r[3],t+a[3],e+r[4],t+a[4],e+r[5],t+a[5],e+r[6],t+a[6])}var df=function(e,t,r,a,i,n,s){var c;if(n){e.paper.openGroup({klass:e.controller.classes.generate("staff-extra voice-name"),"data-name":i});var o=r+(a-r)/2;o=o-e.controller.getTextSize.baselineToCenter(n,"voicefont","staff-extra voice-name",0,1),lf(e,{x:e.padding.left,y:o,text:n,type:"voicefont",klass:"staff-extra voice-name",anchor:"start",centerVertically:!0})}return i==="brace"?c=uf(e,t,r,a,i):i==="bracket"&&(c=ff(e,t,r,a,i)),n&&(c=e.paper.closeGroup()),s.wrapSvgEl({el_type:i,startChar:-1,endChar:-1},c),c},pf=hf;function vf(e,t,r){var a=e.paper.path(t);return a}var T0=vf,gf=It,bf=T0,mf=it;function yf(e,t,r){(!t.anchor1||!t.anchor2||!t.anchor1.heads||!t.anchor2.heads||t.anchor1.heads.length===0||t.anchor2.heads.length===0)&&window.console.error("Glissando Element not set.");var a=4,i=e.calcY(t.anchor1.heads[0].pitch),n=e.calcY(t.anchor2.heads[0].pitch),s=t.anchor1.x+t.anchor1.w/2,c=t.anchor2.x+t.anchor2.w/2,o=wf(s,i,c,n),f=t.anchor1.w/2+a,u=t.anchor2.w/2+a,l=xf(s,i,c,n),h=zr(i,l,f);zr(n,l,-u);var d=Cf(o-f-u),p=Mf(e,s+f,h,d,l);return r.wrapSvgEl({el_type:"glissando",startChar:-1,endChar:-1},p),[p]}function wf(e,t,r,a){var i=r-e,n=a-t;return Math.sqrt(i*i+n*n)}function xf(e,t,r,a){return(a-t)/(r-e)}function zr(e,t,r){return mf(e+r*t)}function Cf(e){var t=5;return Math.max(2,Math.floor((e-t*2)/6))}var kf=[[3.5,-4.8]],_f=[[1.5,-1],[.3,-.3],[-3.5,3.8]],Tf=[[-1.5,2]],Ef=[[3,4],[3,-4]],Sf=[[-3,4],[-3,-4]];function u0(e,t){for(var r="",a=0;a<e.length;a++)r+="l"+e[a][0]+" "+zr(e[a][1],t,e[a][0]);return r}var Mf=function(e,t,r,a,i){var n=gf("M %f %f",t,r);n+=u0(kf,i);var s;for(s=0;s<a;s++)n+=u0(Ef,i);for(n+=u0(_f,i),s=0;s<a;s++)n+=u0(Sf,i);return n+=u0(Tf,i)+"z",bf(e,{path:n,highlight:"stroke",stroke:e.foregroundColor,class:e.controller.classes.generate("decoration"),"data-name":"glissando"})},Af=yf,Bf=It,Nf=T0,Rt=it;function Lf(e,t,r){t.pitch===void 0&&window.console.error("Crescendo Element y-coordinate not set.");var a=e.calcY(t.pitch)+4,i=8,n=t.anchor1?t.anchor1.x:0,s=t.anchor2?t.anchor2.x:800,c;return t.dir==="<"?c=pi(e,a+i/2,a,a+i/2,a+i,n,s):c=pi(e,a,a+i/2,a+i,a+i/2,n,s),r.wrapSvgEl({el_type:"dynamicDecoration",startChar:-1,endChar:-1},c),[c]}var pi=function(e,t,r,a,i,n,s){t=Rt(t),r=Rt(r),a=Rt(a),i=Rt(i),n=Rt(n),s=Rt(s);var c=Bf("M %f %f L %f %f M %f %f L %f %f",n,t,s,r,n,a,s,i);return Nf(e,{path:c,highlight:"stroke",stroke:e.foregroundColor,class:e.controller.classes.generate("dynamics decoration"),"data-name":"dynamics"})},Pf=Lf,vi=it;function E0(){this.ingroup=!1}E0.prototype.beginGroup=function(e,t){this.paper=e,this.controller=t,this.path=[],this.lastM=[0,0],this.ingroup=!0,this.paper.openGroup()};E0.prototype.isInGroup=function(){return this.ingroup};E0.prototype.addPath=function(e){if(e=e||[],e.length!==0){e[0][0]="m",e[0][1]=vi(e[0][1]-this.lastM[0]),e[0][2]=vi(e[0][2]-this.lastM[1]),this.lastM[0]+=e[0][1],this.lastM[1]+=e[0][2],this.path.push(e[0]);for(var t=1,r=e.length;t<r;t++)e[t][0]==="m"&&(this.lastM[0]+=e[t][1],this.lastM[1]+=e[t][2]),this.path.push(e[t])}};E0.prototype.endGroup=function(e,t){this.ingroup=!1;for(var r="",a=0;a<this.path.length;a++)r+=this.path[a].join(" ");this.path=[];var i=this.paper.closeGroup();return i&&(i.setAttribute("class",this.controller.classes.generate(e)),i.setAttribute("fill",this.controller.renderer.foregroundColor),i.setAttribute("stroke","none"),i.setAttribute("data-name",t)),i};var Df=new E0,aa=Df,gi=yt,Yt=mt,bi=aa;function If(e,t,r,a,i){var n,s;if(!a)return null;if(a.length>1&&a.indexOf(".")<0){var c=bi.isInGroup()?"":i.klass;e.paper.openGroup({"data-name":i.name,klass:c});for(var o=0,f=0;f<a.length;f++){var u=a[f];s=Yt.getYCorr(u),n=Yt.printSymbol(t+o,e.calcY(r+s),u,e.paper,{stroke:i.stroke,fill:i.fill}),n?f<a.length-1&&(o+=Ff(u,a[f+1],Yt.getSymbolWidth(u))):gi(e,{x:t,y:e.y,text:"no symbol:"+a,type:"debugfont",klass:"debug-msg",anchor:"start"},!1)}var l=e.paper.closeGroup();return l}else return s=Yt.getYCorr(a),bi.isInGroup()?n=Yt.printSymbol(t,e.calcY(r+s),a,e.paper,{"data-name":i.name}):n=Yt.printSymbol(t,e.calcY(r+s),a,e.paper,{klass:i.klass,stroke:i.stroke,fill:i.fill,"data-name":i.name}),n||(gi(e,{x:t,y:e.y,text:"no symbol:"+a,type:"debugfont",klass:"debug-msg",anchor:"start"},!1),null)}function Ff(e,t,r){var a=r;return e==="f"&&t==="f"&&(a=a*2/3),e==="p"&&t==="p"&&(a=a*5/6),e==="f"&&t==="z"&&(a=a*5/8),a}var ia=If,Of=ia;function Hf(e,t,r){t.pitch===void 0&&window.console.error("Dynamic Element y-coordinate not set.");var a=Of(e,t.anchor.x,t.pitch,t.dec,{klass:e.controller.classes.generate("decoration dynamics"),fill:e.foregroundColor,stroke:"none",name:"dynamics"});return r.wrapSvgEl({el_type:"dynamicDecoration",startChar:-1,endChar:-1,decoration:t.dec},a),[a]}var zf=Hf,$f=It,Gf=yt,Rf=T0,$0=it;function Yf(e,t,r){e.paper.openGroup({klass:e.controller.classes.generate("triplet "+t.durationClass),"data-name":"triplet"}),t.hasBeam||qf(e,t.anchor1.x,t.startNote,t.anchor2.x+t.anchor2.w,t.endNote),Gf(e,{x:t.xTextPos,y:e.calcY(t.yTextPos-1),text:""+t.number,type:"tripletfont",anchor:"middle",centerVertically:!0,noClass:!0,name:""+t.number},!0);var a=e.paper.closeGroup();return r.wrapSvgEl({el_type:"triplet",startChar:-1,endChar:-1},a),a}function G0(e,t,r,a){return $f("M %f %f L %f %f",$0(e),$0(t),$0(r),$0(a))}function qf(e,t,r,a,i){r=e.calcY(r),i=e.calcY(i);var n=5,s="";s+=G0(t,r,t,r+n),s+=G0(a,i,a,i+n);var c=t+(a-t)/2,o=8,f=(i-r)/(a-t),u=c-o,l=r+(u-t)*f;s+=G0(t,r,u,l);var h=c+o,d=r+(h-t)*f;s+=G0(h,d,a,i),Rf(e,{path:s,stroke:e.foregroundColor,"data-name":"triplet-bracket"})}var Wf=Yf,Cr=It,Xf=yt,Uf=T0,St=it;function Vf(e,t,r,a,i){t.pitch===void 0&&window.console.error("Ending Element y-coordinate not set.");var n=St(e.calcY(t.pitch)),s=20,c="";t.anchor1&&(r=St(t.anchor1.x+t.anchor1.w),c+=Cr("M %f %f L %f %f ",r,n,r,St(n+s))),t.anchor2&&(a=St(t.anchor2.x),c+=Cr("M %f %f L %f %f ",a,n,a,St(n+s))),c+=Cr("M %f %f L %f %f ",r,n,a,n),e.paper.openGroup({klass:e.controller.classes.generate("ending"),fill:e.foregroundColor,"data-name":"ending"}),Uf(e,{path:c,stroke:e.foregroundColor,fill:e.foregroundColor,"data-name":"line"}),t.anchor1&&Xf(e,{x:St(r+5),y:St(e.calcY(t.pitch-.5)),text:t.text,type:"repeatfont",klass:"ending",anchor:"start",noClass:!0,name:t.text});var o=e.paper.closeGroup();return i.wrapSvgEl({el_type:"ending",startChar:-1,endChar:-1},o),[o]}var jf=Vf,mi=It,He=it;function Kf(e,t,r,a,i){Qf(t,r,a);var n="";t.anchor1?n+="abcjs-start-m"+t.anchor1.parent.counters.measure+"-n"+t.anchor1.parent.counters.note:n+="abcjs-start-edge",t.anchor2?n+=" abcjs-end-m"+t.anchor2.parent.counters.measure+"-n"+t.anchor2.parent.counters.note:n+=" abcjs-end-edge",t.hint&&(n="abcjs-hint");var s=t.fixedY?1.5:0,c=Jf(e,t.startX,t.endX,t.startY+s,t.endY+s,t.above,n,t.isTie,t.dotted),o=-1;t.anchor1&&!t.isTie&&(o=t.anchor1.parent.abcelem.startChar-1);var f=-1;return t.anchor2&&!t.isTie&&(f=t.anchor2.parent.abcelem.endChar+1),i.wrapSvgEl({el_type:"slur",startChar:o,endChar:f},c),[c]}var Qf=function(e,t,r){!e.anchor1||!e.anchor2||e.anchor1.pitch===e.anchor2.pitch&&e.internalNotes.length===0?e.isTie=!0:e.isTie=!1,e.isTie?(e.calcTieDirection(),e.calcX(t,r),e.calcTieY()):(e.calcSlurDirection(),e.calcX(t,r),e.calcSlurY()),e.avoidCollisionAbove()},Jf=function(e,t,r,a,i,n,s,c,o){var f=c?1.2:1.5;t=He(t+6),r=He(r+4),a=a+(n?f:-f),i=i+(n?f:-f);var u=He(e.calcY(a)),l=He(e.calcY(i)),h=r-t,d=l-u,p=Math.sqrt(h*h+d*d),g=h/p,v=d/p,m=p/3.5,y=c?10:25,x=(n?-1:1)*Math.min(y,Math.max(4,m)),b=He(t+m*g-x*v),w=He(u+m*v+x*g),C=He(r-m*g-x*v),T=He(l-m*v+x*g),B=2;s?s+=" slur":s="slur",s+=c?" tie":" legato";var E;if(o){s+=" dotted";var z=mi("M %f %f C %f %f %f %f %f %f",t,u,b,w,C,T,r,l);E=e.paper.path({path:z,stroke:e.foregroundColor,fill:"none","stroke-dasharray":"5 5",class:e.controller.classes.generate(s),"data-name":c?"tie":"slur"})}else{var I=mi("M %f %f C %f %f %f %f %f %f C %f %f %f %f %f %f z",t,u,b,w,C,T,r,l,He(C-B*v),He(T+B*g),He(b-B*v),He(w+B*g),t,u);E=e.paper.path({path:I,stroke:"none",fill:e.foregroundColor,class:e.controller.classes.generate(s),"data-name":c?"tie":"slur"})}return E},Zf=Kf,eu=T0,qt=it;function tu(e,t){if(t.beams.length!==0){for(var r="",a=0;a<t.beams.length;a++){var i=t.beams[a];if(i.split){for(var n=ru(e,i.startX,i.startY,i.endX,i.endY),s=[],c=0;c<i.split.length;c+=2)s.push([i.split[c],i.split[c+1]]);for(c=0;c<s.length;c++){var o=wi(i.startX,i.startY,n,s[c][0]),f=wi(i.startX,i.startY,n,s[c][1]);r+=yi(e,s[c][0],o,s[c][1],f,i.dy)}}else r+=yi(e,i.startX,i.startY,i.endX,i.endY,i.dy)}var u=("abcjs-d"+t.duration).replace(/\./g,"-"),l=e.controller.classes.generate("beam-elem "+u),h=eu(e,{path:r,stroke:"none",fill:e.foregroundColor,class:l});return[h]}}function yi(e,t,r,a,i,n){r=qt(e.calcY(r)),i=qt(e.calcY(i)),t=qt(t),a=qt(a);var s=qt(r+n),c=qt(i+n);return"M"+t+" "+r+" L"+a+" "+i+"L"+a+" "+c+" L"+t+" "+s+"z"}function ru(e,t,r,a,i){return(i-r)/(a-t)}function wi(e,t,r,a){var i=a-e;return t+i*r}var au=tu,iu=aa,Wt=it;function nu(e,t,r,a,i,n,s){if(r<0||a<i){var c=Wt(i);i=Wt(a),a=c}else a=Wt(a),i=Wt(i);t=Wt(t);var o=Wt(t+r);if(e.firefox112){t+=r/2;var u={x1:t,x2:t,y1:a,y2:i,stroke:e.foregroundColor,"stroke-width":Math.abs(r)};return n&&(u.class=n),s&&(u["data-name"]=s),e.paper.lineToBack(u)}for(var f=[["M",t,a],["L",t,i],["L",o,i],["L",o,a],["z"]],u={path:""},l=0;l<f.length;l++)u.path+=f[l].join(" ");return n&&(u.class=n),s&&(u["data-name"]=s),iu.isInGroup()||(u.stroke="none",u.fill=e.foregroundColor),e.paper.pathToBack(u)}var na=nu,su=It,R0=it;function cu(e,t,r,a,i,n,s){var c=e.foregroundColor;t=R0(t),r=R0(r);var o=R0(a-s),f=R0(a+s);if(e.firefox112){a+=s/2;var u={x1:t,x2:r,y1:a,y2:a,stroke:e.foregroundColor,"stroke-width":Math.abs(s*2)};return i&&(u.class=i),n&&(u["data-name"]=n),e.paper.lineToBack(u)}var l=su("M %f %f L %f %f L %f %f L %f %f z",t,o,r,o,r,f,t,f),h={path:l,stroke:"none",fill:c};n&&(h["data-name"]=n),i&&(h.class=i);var d=e.paper.pathToBack(h);return d}var ou=cu,lu=ou;function hu(e,t,r,a,i,n,s){var c=e.calcY(a);return lu(e,t,r,c,i,n,s)}var In=hu,ct=yt,xi=na,fu=In,uu=ia;function du(e,t,r){t.pitch===void 0&&window.console.error(t.type+" Relative Element y-coordinate not set.");var a=e.calcY(t.pitch);switch(t.type){case"symbol":if(t.c===null)return null;var i="symbol";t.klass&&(i+=" "+t.klass),t.graphelem=uu(e,t.x,t.pitch,t.c,{scalex:t.scalex,scaley:t.scaley,klass:e.controller.classes.generate(i),name:t.name});break;case"debug":t.graphelem=ct(e,{x:t.x,y:e.calcY(15),text:""+t.c,type:"debugfont",klass:e.controller.classes.generate("debug-msg"),anchor:"start",centerVertically:!1,dim:t.dim},!1);break;case"tabNumber":var n="middle",s="tabnumberfont",c="abcjs-tab-number";t.isGrace&&(s="tabgracefont",a+=2.5,c="tab-grace"),t.graphelem=ct(e,{x:t.x,y:a,text:""+t.c,type:s,klass:e.controller.classes.generate(c),anchor:n,centerVertically:!1,dim:t.dim,cursor:"default"},!1);break;case"barNumber":t.graphelem=ct(e,{x:t.x,y:a,text:""+t.c,type:"measurefont",klass:e.controller.classes.generate("bar-number"),anchor:"middle",dim:t.dim,name:"bar-number"},!0);break;case"lyric":t.graphelem=ct(e,{x:t.x,y:a,text:t.c,type:"vocalfont",klass:e.controller.classes.generate("lyric"),anchor:"middle",dim:t.dim,name:"lyric"},!1);break;case"chord":t.graphelem=ct(e,{x:t.x,y:a,text:t.c,type:"gchordfont",klass:e.controller.classes.generate("chord"),anchor:"middle",dim:t.dim,lane:t.getLane(),name:"chord"},!1);break;case"decoration":t.graphelem=ct(e,{x:t.x,y:a+6,text:t.c,type:"annotationfont",klass:e.controller.classes.generate("annotation"),anchor:t.anchor,centerVertically:!0,dim:t.dim},!1);break;case"text":t.graphelem=ct(e,{x:t.x,y:a,text:t.c,type:"annotationfont",klass:e.controller.classes.generate("annotation"),anchor:"start",centerVertically:t.centerVertically,dim:t.dim,lane:t.getLane(),name:"annotation"},!1);break;case"multimeasure-text":t.graphelem=ct(e,{x:t.x+t.w/2,y:a,text:t.c,type:"tempofont",klass:e.controller.classes.generate("rest"),anchor:"middle",centerVertically:!1,dim:t.dim},!1);break;case"part":t.graphelem=ct(e,{x:t.x,y:a,text:t.c,type:"partsfont",klass:e.controller.classes.generate("part"),anchor:"start",dim:t.dim,name:t.c},!0);break;case"bar":t.graphelem=xi(e,t.x,t.linewidth+e.lineThickness,a,r||e.calcY(t.pitch2),null,"bar");break;case"stem":var o=t.linewidth>0?t.linewidth+e.lineThickness:t.linewidth-e.lineThickness;t.graphelem=xi(e,t.x,o,a,e.calcY(t.pitch2),"abcjs-stem","stem");break;case"ledger":t.graphelem=fu(e,t.x,t.x+t.w,t.pitch,"abcjs-ledger","ledger",.35+e.lineThickness);break}return t.scalex!==1&&t.graphelem&&pu(e.paper,t.graphelem,t.scalex,t.scaley,t.x,a),t.graphelem}function pu(e,t,r,a,i,n){e.setAttributeOnElement(t,{style:"transform:scale("+r+","+a+");transform-origin:"+i+"px "+n+"px;"})}var Fn=du,vu=Fn,kr=yt;function gu(e,t){var r=t.x;t.pitch===void 0&&window.console.error("Tempo Element y-coordinate not set."),t.tempo.el_type="tempo";var a=e.calcY(t.pitch)+2,i,n;if(t.tempo.preString){i=kr(e,{x:r,y:a,text:t.tempo.preString,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"pre"},!0),n=e.controller.getTextSize.calc(t.tempo.preString,"tempofont","tempo",i);var s=n.width,c=s/t.tempo.preString.length;r+=s+c}if(t.note){t.note.setX(r);for(var o=0;o<t.note.children.length;o++)vu(e,t.note.children[o],r);r+=t.note.w+5;var f="= "+t.tempo.bpm;i=kr(e,{x:r,y:a,text:f,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"beats"}),n=e.controller.getTextSize.calc(f,"tempofont","tempo",i);var u=n.width,l=u/f.length;r+=u+l}t.tempo.postString&&kr(e,{x:r,y:a,text:t.tempo.postString,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"post"},!0)}var bu=gu,mu=bu,yu=Fn,wu=Se,Ci=Vr,ki=aa;function xu(e,t,r,a,i){if(!t.invisible){var n=t.children.length>0&&t.children[0].type==="TempoElement";t.elemset=[],ki.beginGroup(e.paper,e.controller);for(var s=0;s<t.children.length;s++){var c=t.children[s];switch(c.type){case"TempoElement":mu(e,c);break;default:var o=yu(e,c,r);c.type==="symbol"&&c.c&&c.c.indexOf("notehead")>=0&&o.setAttribute("class","abcjs-notehead")}}var f=t.type;if((t.type==="note"||t.type==="rest")&&(t.counters=e.controller.classes.getCurrent(),f+=" d"+Math.round(t.durationClass*1e3)/1e3,f=f.replace(/\./g,"-"),t.abcelem.pitches))for(var u=0;u<t.abcelem.pitches.length;u++)f+=" p"+t.abcelem.pitches[u].pitch;var l=ki.endGroup(f,t.type);if(l){if(t.cloned&&(t.cloned.overrideClasses=l.className.baseVal),t.overrideClasses){var h=l.classList&&l.classList.length>0?l.classList[0]+" ":"";l.setAttribute("class",h+t.overrideClasses)}if(n)t.startChar=t.abcelem.startChar,t.endChar=t.abcelem.endChar,a.add(t,l,!1,i);else{t.elemset.push(l);var d=!1;(t.type==="note"||t.type==="tabNumber")&&(d=!0),a.add(t,l,d,i)}}else t.elemset.length>0&&a.add(t,t.elemset[0],t.type==="note",i);if(t.klass&&Ci(t.elemset,"mark","","#00ff00"),t.hint&&Ci(t.elemset,"abcjs-hint","",null),t.abcelem.abselem=t,t.heads&&t.heads.length>0){t.notePositions=[];for(var p=0;p<t.heads.length;p++)t.notePositions.push({x:t.heads[p].x+t.heads[p].w/2,y:i.zero-t.heads[p].pitch*wu.STEP})}}}var Cu=xu,ku=Af,_u=Pf,Tu=zf,Eu=Wf,Su=jf,Mu=Zf,Au=au,Bu=yt,_i=Cu;function Nu(e,t,r,a,i){var n=t.w-1;e.staffbottom=t.staff.bottom;var s=e.foregroundColor;if(t.color&&(e.foregroundColor=t.color),t.header){var c=Bu(e,{x:e.padding.left,y:e.calcY(t.headerPosition),text:t.header,type:"voicefont",klass:"staff-extra voice-name",anchor:"start",centerVertically:!0,name:"voice-name"},!0);a.wrapSvgEl({el_type:"voiceName",startChar:-1,endChar:-1,text:t.header},c)}var o,f,u=!1;for(o=0;o<t.children.length;o++){f=t.children[o],(f.type==="note"||f.type==="rest")&&(u=!0);var l=!1;f.type!=="staff-extra"&&!e.controller.classes.isInMeasure()&&(e.controller.classes.startMeasure(),l=!0),t.staff.isTabStaff&&(f.invisible=!1,f.type=="bar"&&f.abcelem.lastBar&&(r=t.topLine)),_i(e,f,t.barto||o===t.children.length-1?r:0,a,i),(f.type==="note"||Lu(f))&&e.controller.classes.incrNote(),f.type==="bar"&&!l&&u&&e.controller.classes.incrMeasure()}for(e.controller.classes.startMeasure(),o=0;o<t.beams.length;o++){var h=t.beams[o];h==="bar"?e.controller.classes.incrMeasure():Au(e,h)}for(e.controller.classes.startMeasure(),o=0;o<t.otherchildren.length;o++)if(f=t.otherchildren[o],f==="bar")e.controller.classes.incrMeasure();else switch(f.type){case"GlissandoElem":f.elemset=ku(e,f,a);break;case"CrescendoElem":f.elemset=_u(e,f,a);break;case"DynamicDecoration":f.elemset=Tu(e,f,a);break;case"TripletElem":Eu(e,f,a);break;case"EndingElem":f.elemset=Su(e,f,t.startx+10,n,a);break;case"TieElem":f.elemset=Mu(e,f,t.startx+10,n,a);break;default:console.log(f),_i(e,f,t.startx+10,n,a)}e.foregroundColor=s}function Lu(e){return e.type!=="rest"?!1:!!(e.abcelem&&e.abcelem.rest&&e.abcelem.rest.type!=="spacer")}var Pu=Nu,Ti=In;function Du(e,t,r,a,i,n){var s="abcjs-top-line",c=2;i&&(c=i),e.paper.openGroup({prepend:!0,klass:e.controller.classes.generate("abcjs-staff")});var o=0,f=0;if(a===1)Ti(e,t,r,6,s,null,n+e.lineThickness),o=e.calcY(10),f=e.calcY(2);else for(var u=a-1;u>=0;u--){var l=(u+1)*c;f=e.calcY(l),o===0&&(o=f),Ti(e,t,r,l,s,null,n+e.lineThickness),s=void 0}return e.paper.closeGroup(),[o,f]}var Iu=Du;function Fu(e,t,r){var a=e.paper.rectBeneath(t);return r&&e.paper.text(r,{x:0,y:t.y+7,"text-anchor":"start","font-size":"14px",fill:"rgba(0,0,255,.4)",stroke:"rgba(0,0,255,.4)"}),a}var Ou=Fu;function Hu(e,t){var r="rgba(0,0,0,255)",a="rgba(0,0,0,0)",i=Math.round(e.y),n=e.controller.width,s=(n-t)/2,c=s+t,o="M "+s+" "+i+" L "+c+" "+i+" L "+c+" "+(i+1)+" L "+s+" "+(i+1)+" L "+s+" "+i+" z";e.paper.pathToBack({path:o,stroke:a,fill:r,class:e.controller.classes.generate("defined-text")})}var zu=Hu,$u=zu,Gu=yt;function Ru(e,t,r){for(var a=0;a<t.rows.length;a++){var i=t.rows[a];if(i.absmove)e.absolutemoveY(i.absmove);else if(i.move)e.moveY(i.move);else if(i.text||i.phrases){var n=i.left?i.left:0,s=Gu(e,{x:n,y:e.y,text:i.text,phrases:i.phrases,"dominant-baseline":i["dominant-baseline"],type:i.font,klass:i.klass,name:i.name,anchor:i.anchor});i.absElemType&&r.wrapSvgEl({el_type:i.absElemType,name:i.name,startChar:i.startChar,endChar:i.endChar,text:i.text},s)}else if(i.separator)$u(e,i.separator);else if(i.startGroup)e.paper.openGroup({klass:i.klass,"data-name":i.name});else if(i.endGroup){var c=e.paper.closeGroup();i.absElemType&&r.wrapSvgEl({el_type:i.absElemType,name:i.name,startChar:i.startChar,endChar:i.endChar,text:""},c)}}}var On=Ru,Xt=Se,Yu=pf,qu=Pu,Wu=Iu,J0=Ou,Xu=na,Uu=On;function Vu(e,t,r,a){for(var i,n=e.y,s=0;s<t.staffs.length;s++){var c=t.staffs[s];e.moveY(Xt.STEP,c.top),c.absoluteY=e.y,e.showDebug&&(e.showDebug.indexOf("box")>=0&&c.voices&&ju(e,t.voices,c.voices),e.showDebug.indexOf("grid")>=0&&(e.paper.dottedLine({x1:e.padding.left,x2:e.padding.left+e.controller.width,y1:n,y2:n,stroke:"#0000ff"}),J0(e,{x:e.padding.left,y:e.calcY(c.originalTop),width:e.controller.width,height:e.calcY(c.originalBottom)-e.calcY(c.originalTop),fill:e.foregroundColor,stroke:e.foregroundColor,"fill-opacity":.1,"stroke-opacity":.1}),i=0,b(c,"chordHeightAbove"),b(c,"chordHeightBelow"),b(c,"dynamicHeightAbove"),b(c,"dynamicHeightBelow"),b(c,"endingHeightAbove"),b(c,"lyricHeightAbove"),b(c,"lyricHeightBelow"),b(c,"partHeightAbove"),b(c,"tempoHeightAbove"),b(c,"volumeHeightAbove"),b(c,"volumeHeightBelow"))),e.moveY(Xt.STEP,-c.bottom),e.showDebug&&e.showDebug.indexOf("grid")>=0&&e.paper.dottedLine({x1:e.padding.left,x2:e.padding.left+e.controller.width,y1:e.y,y2:e.y,stroke:"#0000aa"})}for(var o,f,u=2,l=0,h=0;h<t.voices.length;h++){var d=t.voices[h].staff,p=t.voices[h].tabNameInfos;if(e.y=d.absoluteY,e.controller.classes.incrVoice(),!t.voices[h].duplicate){if(o||(o=e.calcY(10)),f=e.calcY(u),d.lines!==0){d.linePitch&&(u=d.linePitch),e.controller.classes.newMeasure();var g=Wu(e,t.startx,t.w,d.lines,d.linePitch,.35);f=g[1],d.bottomLine=f,d.topLine=g[0],d.hasTab&&(l=d.topLine),d.hasStaff&&(l=d.hasStaff.topLine,t.voices[h].barto=!0,t.voices[h].topLine=o)}Ei(e,d.absoluteY,t.brace,h,r),Ei(e,d.absoluteY,t.bracket,h,r)}qu(e,t.voices[h],l,r,{top:n,zero:e.y,height:t.height*Xt.STEP});var v=0;if(p){var m={rows:[]};m.rows.push({absmove:f+2});var y=8;m.rows.push({left:t.startx+y,text:p.name,font:"tablabelfont",klass:"text instrument-name",anchor:"start"}),m.rows.push({move:p.textSize.height}),Uu(e,m),v=p.textSize.height}e.controller.classes.newMeasure(),t.voices[h].duplicate||(l=e.calcY(2+v))}e.controller.classes.newMeasure();var x=t.staffs.length;x>1&&(o=t.staffs[0].topLine,f=t.staffs[x-1].bottomLine,Xu(e,t.startx,.6,o,f,null)),e.y=n;function b(w,C){var T=["rgb(207,27,36)","rgb(168,214,80)","rgb(110,161,224)","rgb(191,119,218)","rgb(195,30,151)","rgb(31,170,177)","rgb(220,166,142)"];if(w.positionY&&w.positionY[C]){var B=w.specialY[C]*Xt.STEP;C==="chordHeightAbove"&&w.specialY.chordLines&&w.specialY.chordLines.above&&(B*=w.specialY.chordLines.above),C==="chordHeightBelow"&&w.specialY.chordLines&&w.specialY.chordLines.below&&(B*=w.specialY.chordLines.below),J0(e,{x:e.padding.left,y:e.calcY(w.positionY[C]),width:e.controller.width,height:B,fill:T[i],stroke:T[i],"fill-opacity":.4,"stroke-opacity":.4},C.substr(0,4)),i+=1,i>6&&(i=0)}}}function Ei(e,t,r,a,i){if(r)for(var n=0;n<r.length;n++)r[n].isStartVoice(a)&&(r[n].startY=t-Xt.STEP*10,r[n].elemset=Yu(e,r[n],i))}function ju(e,t,r){for(var a=0;a<r.length;a++)for(var i=t[r[a]].children,n=0;n<i.length;n++){var s=i[n],c=s.getFixedCoords();if(!(s.invisible||c.t===void 0||c.b===void 0)){var o=(c.t-c.b)*Xt.STEP;J0(e,{x:c.x,y:e.calcY(c.t),width:c.w,height:o,fill:"#88e888","fill-opacity":.4,stroke:"#4aa93d","stroke-opacity":.8});for(var f=0;f<s.children.length;f++){var u=s.children[f],l=u.getChordDim();if(l){var h=e.calcY(u.pitch);h+=u.dim.font.size*u.getLane(),J0(e,{x:l.left,y:h,width:l.right-l.left,height:u.dim.font.size,fill:"none",stroke:"#4aa93d","stroke-opacity":.8})}}}}}var Ku=Vu;function Qu(e,t,r,a){var i=(t+e.padding.left+e.padding.right)*r,n=(e.y+e.padding.bottom)*r;if(e.isPrint&&(n=Math.max(n,1056)),e.ariaLabel!==""){var s="Sheet Music";e.abctune&&e.abctune.metaText&&e.abctune.metaText.title&&(s+=' for "'+e.abctune.metaText.title+'"'),e.paper.setTitle(s);var c=e.ariaLabel?e.ariaLabel:s;e.paper.setAttribute("aria-label",c)}var o=["-webkit-touch-callout: none;","-webkit-user-select: none;","-khtml-user-select: none;","-moz-user-select: none;","-ms-user-select: none;","user-select: none;"];e.paper.insertStyles(".abcjs-dragging-in-progress text, .abcjs-dragging-in-progress tspan {"+o.join(" ")+"}");var f={overflow:"hidden"};a==="resize"?e.paper.setResponsiveWidth(i,n):(f.width="",f.height=n+"px",r<1?(f.width=i+"px",e.paper.setSize(i/r,n/r)):e.paper.setSize(i,n)),e.paper.setScale(r),e.paper.setParentStyles(f)}var Ju=Qu,Zu=nn,ed=sn;function S0(e,t,r){this.elements=[],this.paper=e,this.tuneNumber=r,this.selectTypes=t}S0.prototype.getElements=function(){return this.elements};S0.prototype.add=function(e,t,r,a){if(this.canSelect(e)){var i;this.selectTypes===void 0?i={selectable:!1,"data-index":this.elements.length}:i={selectable:!0,tabindex:0,"data-index":this.elements.length},this.paper.setAttributeOnElement(t,i);var n={absEl:e,svgEl:t,isDraggable:r};a!==void 0&&(n.staffPos=a),this.elements.push(n)}};S0.prototype.canSelect=function(e){return this.selectTypes===!1||!e||!e.abcelem?!1:this.selectTypes===!0?!0:this.selectTypes===void 0?e.abcelem.el_type==="note"||e.abcelem.el_type==="tabNumber":this.selectTypes.indexOf(e.abcelem.el_type)>=0};S0.prototype.wrapSvgEl=function(e,t){var r={tuneNumber:this.tuneNumber,abcelem:e,elemset:[t],highlight:Zu,unhighlight:ed};this.add(r,t,!1)};var td=S0;const x0=ia,rd=na;function ad(e,t,r,a,i){const n=i.gchordfont;i.partsfont;const s=i.annotationfont,c=i.repeatfont,o=i.textfont,f=i.subtitlefont,u=50,l=10,h=14,d=10,p=20,g=16;e.paper.openGroup({klass:"abcjs-chord-grid"}),t.forEach(v=>{switch(v.type){case"text":Ut(e,v.text,r,e.y,16,o,null,null,!1),e.moveY(g);break;case"subtitle":Ut(e,v.subtitle,r,e.y+d,20,f,null,"abcjs-subtitle",!1),e.moveY(p);break;case"part":if(v.lines.length>0){Ut(e,v.name,r,e.y+d,20,f,v.name,"abcjs-part",!1),e.moveY(p);const m=v.lines[0].length,y=a/m;v.lines.forEach((x,b)=>{let w=!1,C=!1;x.forEach(B=>{B.ending&&(w=!0),B.annotations&&B.annotations.length>0&&(C=!0)});const T=C?h:w?l:0;x.forEach((B,E)=>{if(!B.noBorder){e.paper.rect({x:r+E*y,y:e.y,width:y,height:T+u}),e.paper.rect({x:r+E*y+1,y:e.y+1,width:y-1*2,height:T+u-1*2});let I=0,F=0;const G=e.y,Y=r+y*E;B.hasStartRepeat&&(Si(e,Y,G,G+u+T,!0,T),I=12),B.hasEndRepeat&&(Si(e,Y+y,G,G+u+T,!1,T),F=12);let K=0;B.ending&&(K=Ut(e,B.ending,r+E*y+4,G+10,12,c,null,null,!1).getBBox().width+4),sd(e,G,r+I,y,b,E,B.chord,n,I+F,u,T),B.annotations&&B.annotations.length>0&&nd(e,G,r+E*y+K,B.annotations,s),T&&e.paper.rectBeneath({x:r+E*y,y:e.y,width:y,height:T,fill:"#e8e8e8",stroke:"none"})}}),e.moveY(T+u)}),e.moveY(p)}break}}),e.paper.closeGroup()}function id(e,t,r,a){var i=t-10,n=t+10,s=r+10,c=r-10,o=t-10,f=-e.yToPitch(a)+2,u=t+6.5,l=-e.yToPitch(a)-2.3;e.paper.lineToBack({x1:i,x2:n,y1:s,y2:c,"stroke-width":"3px","stroke-linecap":"round"}),x0(e,o,f,"dots.dot",{klass:"",name:"dot"}),x0(e,u,l,"dots.dot",{klass:"",name:"dot"})}function Si(e,t,r,a,i,n){const s=i?t+2:t-4,c=i?t+9:t-11;e.paper.openGroup({klass:"abcjs-repeat"}),rd(e,s,3+e.lineThickness,r,a,null,"bar"),x0(e,c,-e.yToPitch(n)-4,"dots.dot",{klass:"",name:"dot"}),x0(e,c,-e.yToPitch(n)-8,"dots.dot",{klass:"",name:"dot"}),e.paper.closeGroup()}const Mi={segno:"scripts.segno",coda:"scripts.coda",fermata:"scripts.ufermata"};function nd(e,t,r,a,i){r+=3;let n;for(let s=0;s<a.length;s++)switch(a[s]){case"segno":case"coda":case"fermata":{r+=12,n=x0(e,r,-3,Mi[a[s]],{name:Mi[a[s]]});const c=n.getBBox();r+=c.width}break;default:Ut(e,a[s],r,t+12,12,i,null,null,!1)}}function sd(e,t,r,a,i,n,s,c,o,f,u){const l=r+a*n;!s[1]&&!s[2]&&!s[3]?od(e,l,t+u,a-o,f,s[0],c,u):!s[1]&&!s[3]?ld(e,l,t,a-o,f,s[0],s[2],c,u):hd(e,l,t,a-o,f,s,c,u)}function Nt(e,t,r,a,i,n,s){const c=Ut(e,i,t,r,a,n,null,"abcjs-chord",!0);let o=c.getBBox(),f=a;for(;o.width>s&&f>=14;)f-=2,c.setAttribute("font-size",f),o=c.getBBox()}const cd=34,Ai=26,Y0=20,Lt=-3;function od(e,t,r,a,i,n,s,c){n==="%"?id(e,t+a/2,r+i/2,c+i/2):Nt(e,t+a/2,r+i/2+Lt,cd,n,s,a)}function ld(e,t,r,a,i,n,s,c,o){e.paper.lineToBack({x1:t,x2:t+a,y1:r+i+o,y2:r+2}),Nt(e,t+a/4,r+i/4+5+o+Lt,Ai,n,c,a/2),Nt(e,t+3*a/4,r+3*i/4+o+Lt,Ai,s,c,a/2)}function hd(e,t,r,a,i,n,s,c){e.paper.lineToBack({x1:t+3,x2:t+a-3,y1:r+i/2+c,y2:r+i/2+c}),e.paper.lineToBack({x1:t+a/2,x2:t+a/2,y1:r+3+c,y2:r+i-3+c}),n[0]&&Nt(e,t+a/4,r+i/4+2+c+Lt,Y0,q0(n[0]),s,a/2),n[1]&&Nt(e,t+3*a/4,r+i/4+2+c+Lt,Y0,q0(n[1]),s,a/2),n[2]&&Nt(e,t+a/4,r+3*i/4+c+Lt,Y0,q0(n[2]),s,a/2),n[3]&&Nt(e,t+3*a/4,r+3*i/4+c+Lt,Y0,q0(n[3]),s,a/2)}function q0(e){return e==="No Chord"?"N.C.":e}function Ut(e,t,r,a,i,n,s,c,o){const f={x:r,y:a,stroke:"none","font-size":i,"font-style":n.style,"font-family":n.face,"font-weight":n.weight,"text-decoration":n.decoration};return s&&(f["data-name"]=s),c&&(f.class=c),f["text-anchor"]=o?"middle":"start",e.paper.text(t,f,null,{"alignment-baseline":"middle"})}var fd=ad,ud=Ku,dd=Ju,_r=On,Hn=Se,pd=td,vd=fd;function gd(e,t,r,a,i,n,s,c,o,f,u){var l=new pd(e.paper,c,o),h={};t.shouldAddClasses&&(h.klass="abcjs-meta-top"),e.paper.openGroup(h),e.moveY(e.padding.top),_r(e,r.topText,l),e.paper.closeGroup(),e.moveY(e.spacing.music);let d=!1;u&&r.chordGrid&&(vd(e,r.chordGrid,e.padding.left,a,r.formatting),u==="noMusic"&&(d=!0));var p=[],g=0;if(!d)for(var v=0;v<r.lines.length;v++){t.incrLine();var m=r.lines[v];if(m.staff){if(g++,r.formatting.maxStaves&&g>r.formatting.maxStaves)break;t.shouldAddClasses&&(h.klass="abcjs-staff-wrapper abcjs-l"+t.lineNumber),e.paper.openGroup(h),m.vskip&&e.moveY(m.vskip),p.length>=1&&md(e,e.spacing.staffSeparation,p[p.length-1],m.staffGroup);var y=bd(e,m.staffGroup,l);y.line=f+v,p.push(y),e.paper.closeGroup()}else m.nonMusic&&(t.shouldAddClasses&&(h.klass="abcjs-non-music"),e.paper.openGroup(h),_r(e,m.nonMusic,l),e.paper.closeGroup())}return t.reset(),d||r.bottomText&&r.bottomText.rows&&r.bottomText.rows.length>0&&(t.shouldAddClasses&&(h.klass="abcjs-meta-bottom"),e.paper.openGroup(h),e.moveY(24),_r(e,r.bottomText,l),e.paper.closeGroup()),dd(e,i,s,n),{staffgroups:p,selectables:l.getElements()}}function bd(e,t,r,a){ud(e,t,r);var i=t.height*Hn.STEP;return e.y+=i,t}function md(e,t,r,a){var i=r.staffs[r.staffs.length-1],n=-(i.bottom-2),s=a.staffs[0].top-10,c=s+n,o=c*Hn.STEP;o<t&&e.moveY(t-o)}var yd=gd,wd=Sn;function xd(e){for(var t=e;t&&t.attributes&&t.tagName.toLowerCase()!=="svg"&&!t.attributes.selectable;)t=t.parentNode;if(t&&t.attributes&&t.attributes.selectable){var r=t.attributes["data-index"].nodeValue;if(r&&(r=parseInt(r,10),r>=0&&r<this.selectables.length)){var a=this.selectables[r],i=wd(a,e);return i.index=r,i.element=a,i}}return null}var Cd=xd,kd=Se,_d=yl,Td=Cl,Ed=_l,Sd=El,Md=Ml,zn=Pl,Ad=Dl,Bd=Kl,$n=tf,Nd=rf,Gn=af,Rn=nf,Ld=yd,Pd=dn,Dd=Cd,nt=function(e,t){t=t||{},this.findSelectableElement=Dd,this.oneSvgPerLine=t.oneSvgPerLine,this.selectionColor=t.selectionColor,this.dragColor=t.dragColor?t.dragColor:t.selectionColor,this.dragging=!!t.dragging,this.selectTypes=t.selectTypes,this.responsive=t.responsive,this.space=3*kd.SPACE,this.initialClef=t.initialClef,this.timeBasedLayout=t.timeBasedLayout,this.expandToWidest=!!t.expandToWidest,this.scale=t.scale?parseFloat(t.scale):0,this.classes=new Nd({shouldAddClasses:t.add_classes}),this.scale>.1||(this.scale=void 0),t.staffwidth?(this.staffwidthScreen=t.staffwidth,this.staffwidthPrint=t.staffwidth):(this.staffwidthScreen=740,this.staffwidthPrint=680),this.listeners=[],t.clickListener&&this.addSelectListener(t.clickListener),this.renderer=new Td(e),this.renderer.setPaddingOverride(t),t.showDebug&&(this.renderer.showDebug=t.showDebug),t.jazzchords&&(this.jazzchords=t.jazzchords),t.accentAbove&&(this.accentAbove=t.accentAbove),t.germanAlphabet&&(this.germanAlphabet=t.germanAlphabet),t.lineThickness&&(this.lineThickness=t.lineThickness),t.chordGrid&&(this.chordGrid=t.chordGrid),this.renderer.controller=this,this.renderer.foregroundColor=t.foregroundColor?t.foregroundColor:"currentColor",t.ariaLabel!==void 0&&(this.renderer.ariaLabel=t.ariaLabel),this.renderer.minPadding=t.minPadding?t.minPadding:0,this.reset()};nt.prototype.reset=function(){this.selected=[],this.staffgroups=[],this.engraver&&this.engraver.reset(),this.engraver=null,this.renderer.reset(),this.dragTarget=null,this.dragIndex=-1,this.dragMouseStart={x:-1,y:-1},this.dragYStep=0,this.lineThickness&&this.renderer.setLineThickness(this.lineThickness)};nt.prototype.engraveABC=function(e,t,r){e[0]===void 0&&(e=[e]),this.reset();for(var a=0;a<e.length;a++)t===void 0&&(t=a),this.getFontAndAttr=new Gn(e[a].formatting,this.classes),this.getTextSize=new Rn(this.getFontAndAttr,this.renderer.paper),this.engraveTune(e[a],t,r)};nt.prototype.adjustNonScaledItems=function(e){this.width/=e,this.renderer.adjustNonScaledItems(e)};nt.prototype.getMeasureWidths=function(e){this.reset(),this.getFontAndAttr=new Gn(e.formatting,this.classes),this.getTextSize=new Rn(this.getFontAndAttr,this.renderer.paper);var t=this.jazzchords;this.setupTune(e,0),this.constructTuneElements(e),$n(this.renderer,e,0,this.space,this.timeBasedLayout);for(var r=[],a,i=!0,n=0;n<e.lines.length;n++){var s=e.lines[n];if(s.staff){if(i&&(a={left:0,measureWidths:[],total:0},r.push(a),i=!1),s.staffGroup.voices.length>0)for(var c=s.staffGroup.voices[0],o=!1,f=0,u=0;u<c.children.length;u++){var l=c.children[u];!o&&!l.isClef&&!l.isKeySig&&(o=!0,a.left=l.x,f=l.x),l.type==="bar"&&(a.measureWidths.push(l.x-f),a.total+=l.x-f,f=l.x)}}else i=!0}return this.jazzchords=t,r};nt.prototype.setupTune=function(e,t){this.classes.reset(),e.formatting.jazzchords!==void 0&&(this.jazzchords=e.formatting.jazzchords),e.formatting.accentAbove!==void 0&&(this.accentAbove=e.formatting.accentAbove),this.renderer.newTune(e),this.engraver=new _d(this.getTextSize,t,{bagpipes:e.formatting.bagpipes,flatbeams:e.formatting.flatbeams,graceSlurs:e.formatting.graceSlurs!==!1,percmap:e.formatting.percmap,initialClef:this.initialClef,jazzchords:this.jazzchords,timeBasedLayout:this.timeBasedLayout,accentAbove:this.accentAbove,germanAlphabet:this.germanAlphabet}),this.engraver.setStemHeight(this.renderer.spacing.stemHeight),this.engraver.measureLength=e.getMeterFraction().num/e.getMeterFraction().den,e.formatting.staffwidth?this.width=e.formatting.staffwidth*1.33:this.width=this.renderer.isPrint?this.staffwidthPrint:this.staffwidthScreen;var r=e.formatting.scale?e.formatting.scale:this.scale;return this.responsive==="resize"&&(r=void 0),r===void 0&&(r=this.renderer.isPrint?.75:1),this.adjustNonScaledItems(r),r};nt.prototype.constructTuneElements=function(e){e.topText=new zn(e.metaText,e.metaTextInfo,e.formatting,e.lines,this.width,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize);var t,r,a=!1,i=!1;for(t=0;t<e.lines.length;t++)if(r=e.lines[t],r.staff)i=!0,r.staffGroup=this.engraver.createABCLine(r.staff,a?null:e.metaText.tempo,t),a=!0;else if(r.subtitle){if(i){var n=this.width/2+this.renderer.padding.left;r.nonMusic=new Md(this.renderer.spacing.subtitle,e.formatting,r.subtitle,n,this.renderer.padding.left,this.getTextSize)}}else r.text!==void 0?(i=!0,r.nonMusic=new Ed(r.text,r.vskip,this.getFontAndAttr,this.renderer.padding.left,this.width,this.getTextSize)):r.separator!==void 0&&r.separator.lineLength&&(i=!0,r.nonMusic=new Sd(r.separator.spaceAbove,r.separator.lineLength,r.separator.spaceBelow));e.bottomText=new Ad(e.metaText,this.width,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize)};nt.prototype.engraveTune=function(e,t,r){var a=this.jazzchords,i=this.setupTune(e,t);this.constructTuneElements(e);var n=$n(this.renderer,e,this.width,this.space,this.expandToWidest,this.timeBasedLayout);if(this.expandToWidest&&n>this.width+1&&(e.topText=new zn(e.metaText,e.metaTextInfo,e.formatting,e.lines,n,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize),e.lines&&e.lines.length>0))for(var s=e.lines.length,c=0;c<s;++c){var o=e.lines[c];if(o.nonMusic&&o.nonMusic.rows&&o.nonMusic.rows.length>0)for(var f=o.nonMusic.rows.length,u=0;u<f;++u){var l=o.nonMusic.rows[u];l.left&&(o.subtitle?l.left=n/2+this.renderer.padding.left:o.text&&o.text.length>0&&o.text[0].center&&(l.left=n/2+this.renderer.padding.left))}}e.tablatures&&Pd.layoutTablatures(this.renderer,e);var h=Ld(this.renderer,this.classes,e,this.width,n,this.responsive,i,this.selectTypes,t,r,this.chordGrid);if(this.staffgroups=h.staffgroups,this.selectables=h.selectables,this.oneSvgPerLine){var d=this.renderer.paper.svg.parentNode;this.svgs=Id(this.renderer,d,e.metaText.title,this.responsive,i)}else this.svgs=[this.renderer.paper.svg];Bd(this,this.svgs),this.jazzchords=a};function Id(e,t,r,a,i){r||(r="Untitled");var n=t.querySelector("svg");a==="resize"&&(t.style.paddingBottom="");for(var s=n.querySelector("style"),c=a==="resize"?n.viewBox.baseVal.width:n.getAttribute("width"),o=t.querySelectorAll("svg > g"),f=0,u=[],l=0;l<o.length;l++){var h=o[l],d=h.getBBox(),p=d.y-f,g=d.height+p,v=document.createElement("div"),m="overflow: hidden;";a!=="resize"&&(m+="height:"+g*i+"px;"),v.setAttribute("style",m);var y=Fd(n),x='Sheet Music for "'+r+'" section '+(l+1);y.setAttribute("aria-label",x),a!=="resize"&&y.setAttribute("height",g),a==="resize"&&(y.style.position="");var b=e.firefox112?g+1:g;y.setAttribute("viewBox","0 "+f+" "+c+" "+b),y.appendChild(s.cloneNode(!0));var w=document.createElement("title");w.innerText=x,y.appendChild(w),y.appendChild(h),v.appendChild(y),u.push(y),t.appendChild(v),f=d.y+d.height}return t.removeChild(n),u}function Fd(e){for(var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg"),a=0;a<e.attributes.length;a++){var i=e.attributes[a];i.name!=="height"&&i.name!="aria-label"&&r.setAttribute(i.name,i.value)}return r}nt.prototype.getDim=function(e){if(!e.dim){var t=e.svgEl.getBBox();e.dim={left:Math.round(t.x),top:Math.round(t.y),right:Math.round(t.x+t.width),bottom:Math.round(t.y+t.height)}}return e.dim};nt.prototype.addSelectListener=function(e){this.listeners[this.listeners.length]=e};var Yn=nt,Od=tr,qn=Yn,Hd=rn,zd=Vi,V0={};function Bi(){var e=window.innerWidth;for(var t in V0)if(V0.hasOwnProperty(t)){var r=V0[t],a=r.offsetLeft;e-=a*2,r.style.width=e+"px"}}try{window.addEventListener("resize",Bi),window.addEventListener("orientationChange",Bi)}catch{}function Wn(e,t,r,a,i){r.viewportHorizontal?(e.innerHTML='<div class="abcjs-inner"></div>',r.scrollHorizontal?(e.style.overflowX="auto",e.style.overflowY="hidden"):e.style.overflow="hidden",V0[e.id]=e,e=e.children[0]):r.viewportVertical?(e.innerHTML='<div class="abcjs-inner scroll-amount"></div>',e.style.overflowX="hidden",e.style.overflowY="auto",e=e.children[0]):e.innerHTML="";var n=new qn(e,r);if(n.engraveABC(t,a,i),t.engraver=n,r.viewportVertical||r.viewportHorizontal){var s=e.parentNode;s.style.width=e.style.width}}var $d=function(e,t,r,a,i){var n={},s;if(r){for(s in r)r.hasOwnProperty(s)&&(n[s]=r[s]);n.warnings_id&&n.tablature&&(n.tablature.warning_id=n.warnings_id)}if(a)for(s in a)a.hasOwnProperty(s)&&(s==="listener"?a[s].highlight&&(n.clickListener=a[s].highlight):n[s]=a[s]);if(i)for(s in i)i.hasOwnProperty(s)&&(n[s]=i[s]);function c(o,f,u,l){var h=!1;return o==="*"&&(h=!0,o=document.createElement("div"),o.setAttribute("style","visibility: hidden;"),document.body.appendChild(o)),!h&&n.wrap&&n.staffwidth?(f=Gd(o,f,u,l,n),f):(n.afterParsing&&n.afterParsing(f,u,l),Wn(o,f,n,u,0),h&&o.parentNode.removeChild(o),null)}return Od.renderEngine(c,e,t,n)};function Gd(e,t,r,a,i){var n=new qn(e,i),s=n.getMeasureWidths(t),c=zd.calcLineWraps(t,s,i);if(c.reParse){var o=new Hd;o.parse(a,c.revisedParams),t=o.getTune();var f=o.getWarnings();f&&(t.warnings=f)}return i.afterParsing&&i.afterParsing(t,r,a),Wn(e,t,c.revisedParams,r,0),t.explanation=c.explanation,t}var Xn=$d,Rd=tr,Yd=Yn,qd=function(e,t){function r(a,i,n,s){a=document.createElement("div"),a.setAttribute("style","visibility: hidden;"),document.body.appendChild(a);var c=new Yd(a,t),o=c.getMeasureWidths(i);return a.parentNode.removeChild(a),{sections:o}}return Rd.renderEngine(r,"*",e,t)},Wd=qd,Xd={},sa=Xd,Tr=sa,Ud=function(e,t,r,a){Tr[t]||(Tr[t]={});var i=Tr[t];return i[r]||(i[r]=new Promise(function(n,s){var c=new XMLHttpRequest;let o=e+t+"-mp3/"+r+".mp3";c.open("GET",o,!0),c.responseType="arraybuffer",c.onload=function(){if(c.status!==200){s(Error("Can't load sound at "+o+" status="+c.status));return}var f=function(l){n({instrument:t,name:r,status:"loaded",audioBuffer:l})},u=a.decodeAudioData(c.response,f,function(){s(Error("Can't decode sound at "+o))});u&&typeof u.catch=="function"&&u.catch(s)},c.onerror=function(){s(Error("Can't load sound at "+o))},c.send()}).catch(n=>{throw console.error("Didn't load note",t,r,":",n.message),n})),i[r]},Vd=Ud,jd=["acoustic_grand_piano","bright_acoustic_piano","electric_grand_piano","honkytonk_piano","electric_piano_1","electric_piano_2","harpsichord","clavinet","celesta","glockenspiel","music_box","vibraphone","marimba","xylophone","tubular_bells","dulcimer","drawbar_organ","percussive_organ","rock_organ","church_organ","reed_organ","accordion","harmonica","tango_accordion","acoustic_guitar_nylon","acoustic_guitar_steel","electric_guitar_jazz","electric_guitar_clean","electric_guitar_muted","overdriven_guitar","distortion_guitar","guitar_harmonics","acoustic_bass","electric_bass_finger","electric_bass_pick","fretless_bass","slap_bass_1","slap_bass_2","synth_bass_1","synth_bass_2","violin","viola","cello","contrabass","tremolo_strings","pizzicato_strings","orchestral_harp","timpani","string_ensemble_1","string_ensemble_2","synth_strings_1","synth_strings_2","choir_aahs","voice_oohs","synth_choir","orchestra_hit","trumpet","trombone","tuba","muted_trumpet","french_horn","brass_section","synth_brass_1","synth_brass_2","soprano_sax","alto_sax","tenor_sax","baritone_sax","oboe","english_horn","bassoon","clarinet","piccolo","flute","recorder","pan_flute","blown_bottle","shakuhachi","whistle","ocarina","lead_1_square","lead_2_sawtooth","lead_3_calliope","lead_4_chiff","lead_5_charang","lead_6_voice","lead_7_fifths","lead_8_bass_lead","pad_1_new_age","pad_2_warm","pad_3_polysynth","pad_4_choir","pad_5_bowed","pad_6_metallic","pad_7_halo","pad_8_sweep","fx_1_rain","fx_2_soundtrack","fx_3_crystal","fx_4_atmosphere","fx_5_brightness","fx_6_goblins","fx_7_echoes","fx_8_scifi","sitar","banjo","shamisen","koto","kalimba","bagpipe","fiddle","shanai","tinkle_bell","agogo","steel_drums","woodblock","taiko_drum","melodic_tom","synth_drum","reverse_cymbal","guitar_fret_noise","breath_noise","seashore","bird_tweet","telephone_ring","helicopter","applause","gunshot","percussion"],ca=jd,Er=ca,Kd=function(e){for(var t=[],r=0;r<e.tracks.length;r++)t.push([]);var a=Er[0];return e.tracks.forEach(function(i,n){i.forEach(function(s){switch(s.cmd){case"note":var c=s.instrument!==void 0?Er[s.instrument]:a;if(s.duration>0){var o=s.gap?s.gap:0,f=s.duration;o=Math.min(o,f*2/3);var u={pitch:s.pitch,instrument:c,start:Math.round(s.start*1e6)/1e6,end:Math.round((s.start+f-o)*1e6)/1e6,volume:s.volume};s.startChar&&(u.startChar=s.startChar),s.endChar&&(u.endChar=s.endChar),s.style&&(u.style=s.style),s.cents&&(u.cents=s.cents),t[n].push(u)}break;case"program":a=Er[s.instrument];break;case"text":break;default:console.log("Unhandled midi event",s)}})}),t},Qd=Kd;function Jd(e){if(e)window.abcjsAudioContext=e;else if(!window.abcjsAudioContext){var t=window.AudioContext||window.webkitAudioContext;if(t)window.abcjsAudioContext=new t;else return!1}return window.abcjsAudioContext.state!=="suspended"}var sr=Jd,Zd=sr;function e2(){return window.abcjsAudioContext||Zd(),window.abcjsAudioContext}var r0=e2,t2=r0;function r2(){if(!window.Promise||!window.AudioContext&&!window.webkitAudioContext&&!navigator.mozAudioContext&&!navigator.msAudioContext)return!1;var e=t2();if(e)return e.resume!==void 0}var cr=r2,a2={21:"A0",22:"Bb0",23:"B0",24:"C1",25:"Db1",26:"D1",27:"Eb1",28:"E1",29:"F1",30:"Gb1",31:"G1",32:"Ab1",33:"A1",34:"Bb1",35:"B1",36:"C2",37:"Db2",38:"D2",39:"Eb2",40:"E2",41:"F2",42:"Gb2",43:"G2",44:"Ab2",45:"A2",46:"Bb2",47:"B2",48:"C3",49:"Db3",50:"D3",51:"Eb3",52:"E3",53:"F3",54:"Gb3",55:"G3",56:"Ab3",57:"A3",58:"Bb3",59:"B3",60:"C4",61:"Db4",62:"D4",63:"Eb4",64:"E4",65:"F4",66:"Gb4",67:"G4",68:"Ab4",69:"A4",70:"Bb4",71:"B4",72:"C5",73:"Db5",74:"D5",75:"Eb5",76:"E5",77:"F5",78:"Gb5",79:"G5",80:"Ab5",81:"A5",82:"Bb5",83:"B5",84:"C6",85:"Db6",86:"D6",87:"Eb6",88:"E6",89:"F6",90:"Gb6",91:"G6",92:"Ab6",93:"A6",94:"Bb6",95:"B6",96:"C7",97:"Db7",98:"D7",99:"Eb7",100:"E7",101:"F7",102:"Gb7",103:"G7",104:"Ab7",105:"A7",106:"Bb7",107:"B7",108:"C8",109:"Db8",110:"D8",111:"Eb8",112:"E8",113:"F8",114:"Gb8",115:"G8",116:"Ab8",117:"A8",118:"Bb8",119:"B8",120:"C9",121:"Db9"},oa=a2,i2=function(e){return window.URL.createObjectURL(n2(e.audioBuffers))};function n2(e){var t=e[0],r=t.numberOfChannels,a=t.length*r*2+44,i=new ArrayBuffer(a),n=new DataView(i),s=[],c,o,f=0,u=0;for(h(1179011410),h(a-8),h(1163280727),h(544501094),h(16),l(1),l(r),h(t.sampleRate),h(t.sampleRate*2*r),l(r*2),l(16),h(1635017060),h(a-u-4),c=0;c<r;c++)s.push(t.getChannelData(c));for(;u<a;){for(c=0;c<s.length;c++)o=Math.max(-1,Math.min(1,s[c][f])),o=(.5+o<0?o*32768:o*32767)|0,n.setInt16(u,o,!0),u+=2;f++}return new Blob([i],{type:"audio/wav"});function l(d){n.setUint16(u,d,!0),u+=2}function h(d){n.setUint32(u,d,!0),u+=4}}var s2=i2;function c2(e){return Math.pow(2,e/1200)}var Un=c2,Ni=sa,o2=oa,l2=Un;function h2(e,t,r,a,i,n,s,c,o){var f=window.OfflineAudioContext||window.webkitOfflineAudioContext,u=r.len*r.tempoMultiplier;n&&(u+=n/1e3),u-=c,u<0&&(u=.005);var l=new f(2,Math.floor((u+s)*t),t),h=o2[r.pitch];if(!Ni[r.instrument])return o&&o("placeNote skipped (instrument empty): "+r.instrument+":"+h),Promise.resolve();var d=Ni[r.instrument][h];return d?d.then(function(p){var g=l.createBufferSource();g.buffer=p.audioBuffer;var v=r.volume/96*i;g.gainNode=l.createGain(),r.pan&&l.createStereoPanner&&(g.panNode=l.createStereoPanner(),g.panNode.pan.setValueAtTime(r.pan,0)),g.gainNode.gain.value=v,g.gainNode.gain.linearRampToValueAtTime(g.gainNode.gain.value,u),g.gainNode.gain.linearRampToValueAtTime(0,u+s),r.cents&&(g.playbackRate.value=l2(r.cents)),g.panNode?(g.panNode.connect(l.destination),g.gainNode.connect(g.panNode)):g.gainNode.connect(l.destination),g.connect(g.gainNode),g.start(0),g.noteOff?g.noteOff(u+s):g.stop(u+s);var m;return l.oncomplete=function(y){if(y.renderedBuffer&&y.renderedBuffer.getChannelData)for(var x=0;x<a.length;x++){var b=a[x]*r.tempoMultiplier;n&&(b-=n/1e3),b<0&&(b=0),b=Math.floor(b*t),f2(e,y.renderedBuffer,b)}o&&o("placeNote: "+r.instrument+":"+h),m()},l.startRendering(),new Promise(function(y){m=y})}).catch(function(p){return o&&o("placeNote catch: "+p.message),Promise.reject(p)}):(o&&o("placeNote skipped: "+r.instrument+":"+h),Promise.resolve())}var f2=function(e,t,r){for(var a=0;a<2;a++)for(var i=t.getChannelData(a),n=e.getChannelData(a),s=0;s<i.length;s++)n[s+r]+=i[s]},u2=h2,d2=Vd,p2=Qd,v2=sr,oe=r0,g2=cr,b2=oa,W0=ca,m2=s2,y2=u2,Li=sa,Mt="MIDI is not supported in this browser.",Pi="https://paulrosen.github.io/midi-js-soundfonts/abcjs/",Di="https://paulrosen.github.io/midi-js-soundfonts/FluidR3_GM/",w2="https://paulrosen.github.io/midi-js-soundfonts/MusyngKite/";function x2(){var e=this;e.audioBufferPossible=void 0,e.directSource=[],e.startTimeSec=void 0,e.pausedTimeSec=void 0,e.audioBuffers=[],e.duration=void 0,e.isRunning=!1,e.options={},e.pickupLength=0,e.init=function(a){a||(a={}),a.options&&(e.options=a.options),v2(a.audioContext);var i=oe().currentTime;if(e.debugCallback=a.debugCallback,e.debugCallback&&e.debugCallback("init called"),e.audioBufferPossible=e._deviceCapable(),!e.audioBufferPossible)return Promise.reject({status:"NotSupported",message:Mt});var n=a.options?a.options:{};e.soundFontUrl=n.soundFontUrl?n.soundFontUrl:Di,e.soundFontUrl[e.soundFontUrl.length-1]!=="/"&&(e.soundFontUrl+="/"),n.soundFontVolumeMultiplier||n.soundFontVolumeMultiplier===0?e.soundFontVolumeMultiplier=n.soundFontVolumeMultiplier:e.soundFontUrl===Di||e.soundFontUrl===w2?e.soundFontVolumeMultiplier=3:e.soundFontUrl===Pi?e.soundFontVolumeMultiplier=.4:e.soundFontVolumeMultiplier=1,n.programOffsets?e.programOffsets=n.programOffsets:e.soundFontUrl===Pi?e.programOffsets={bright_acoustic_piano:20,honkytonk_piano:20,electric_piano_1:30,electric_piano_2:30,harpsichord:40,clavinet:20,celesta:20,glockenspiel:40,vibraphone:30,marimba:35,xylophone:30,tubular_bells:35,dulcimer:30,drawbar_organ:20,percussive_organ:25,rock_organ:20,church_organ:40,reed_organ:40,accordion:40,harmonica:40,acoustic_guitar_nylon:20,acoustic_guitar_steel:30,electric_guitar_jazz:25,electric_guitar_clean:15,electric_guitar_muted:35,overdriven_guitar:25,distortion_guitar:20,guitar_harmonics:30,electric_bass_finger:15,electric_bass_pick:30,fretless_bass:40,violin:105,viola:50,cello:40,contrabass:60,trumpet:10,trombone:90,alto_sax:20,tenor_sax:20,clarinet:20,flute:50,banjo:50,woodblock:20}:e.programOffsets={};var s=n.fadeLength!==void 0?parseInt(n.fadeLength,10):NaN;if(e.fadeLength=isNaN(s)?200:s,s=n.noteEnd!==void 0?parseInt(n.noteEnd,10):NaN,e.noteEnd=isNaN(s)?0:s,e.pan=n.pan,e.meterSize=1,a.visualObj){e.flattened=a.visualObj.setUpAudio(n);var c=a.visualObj.getMeterFraction();c.den&&(e.meterSize=c.num/c.den),e.pickupLength=a.visualObj.getPickupLength()}else if(a.sequence)e.flattened=a.sequence;else return Promise.reject(new Error("Must pass in either a visualObj or a sequence"));e.millisecondsPerMeasure=a.millisecondsPerMeasure?a.millisecondsPerMeasure:a.visualObj?a.visualObj.millisecondsPerMeasure(e.flattened.tempo):1e3,e.beatsPerMeasure=a.visualObj?a.visualObj.getBeatsPerMeasure():4,e.sequenceCallback=n.sequenceCallback,e.callbackContext=n.callbackContext,e.onEnded=n.onEnded,e.meterFraction=a.visualObj?a.visualObj.getMeterFraction():{den:1};var o={},f=[],u=[],l=W0[0];e.flattened.tracks.forEach(function(v){v.forEach(function(m){if(m.cmd==="program"&&W0[m.instrument]&&(l=W0[m.instrument]),m.pitch!==void 0){var y=m.pitch,x=b2[y],b=m.instrument!==void 0?W0[m.instrument]:l;if(x)if(o[b]||(o[b]={}),!Li[b]||!Li[b][x])o[b][x]=!0;else{var w=b+":"+x;f.indexOf(w)<0&&f.push(w)}else{var C=b+":"+x;console.log("Can't find note: ",y,C),u.indexOf(C)<0&&u.push(C)}}})}),e.debugCallback&&e.debugCallback("note gathering time = "+Math.floor((oe().currentTime-i)*1e3)+"ms"),i=oe().currentTime;var h=[];Object.keys(o).forEach(function(v){Object.keys(o[v]).forEach(function(m){h.push({instrument:v,note:m})})}),e.debugCallback&&e.debugCallback("notes "+JSON.stringify(h));for(var d=[],p=256,g=0;g<h.length;g+=p)d.push(h.slice(g,g+p));return new Promise(function(v,m){var y={cached:f,error:u,loaded:[]},x=0,b=function(){e.debugCallback&&e.debugCallback("loadBatch idx="+x+" len="+d.length),x<d.length?e._loadBatch(d[x],e.soundFontUrl,i).then(function(w){e.debugCallback&&e.debugCallback("loadBatch then"),i=oe().currentTime,w&&(w.error&&(y.error=y.error.concat(w.error)),w.loaded&&(y.loaded=y.loaded.concat(w.loaded))),x++,b()},m):(e.debugCallback&&e.debugCallback("resolve init"),v(y))};b()})},e._loadBatch=function(a,i,n,s){var c=[];return a.forEach(function(o){e.debugCallback&&e.debugCallback("getNote "+o.instrument+":"+o.note),c.push(d2(i,o.instrument,o.note,oe()))}),Promise.all(c).then(function(o){e.debugCallback&&e.debugCallback("mp3 load time = "+Math.floor((oe().currentTime-n)*1e3)+"ms");for(var f=[],u=[],l=[],h=[],d=0;d<o.length;d++){var p=o[d],g=p.instrument+":"+p.name;p.status==="loaded"?f.push(g):p.status==="pending"?l.push(g):p.status==="cached"?u.push(g):h.push(g+" "+p.message)}if(l.length>0){if(e.debugCallback&&e.debugCallback("pending "+JSON.stringify(l)),s?s=s*2:s=50,s<9e4)return new Promise(function(y,x){setTimeout(function(){var b=[];for(d=0;d<l.length;d++)g=l[d].split(":"),b.push({instrument:g[0],note:g[1]});e.debugCallback&&e.debugCallback("retry "+JSON.stringify(b)),e._loadBatch(b,i,n,s).then(function(w){y(w)}).catch(function(w){x(w)})},s)});for(var v=[],m=0;m<a.length;m++)v.push(a[m].instrument+"/"+a[m].note);return e.debugCallback&&e.debugCallback("loadBatch timeout"),Promise.reject(new Error("timeout attempting to load: "+v.join(", ")))}else return e.debugCallback&&e.debugCallback("loadBatch resolve"),Promise.resolve({loaded:f,cached:u,error:h})}).catch(function(o){e.debugCallback&&e.debugCallback("loadBatch catch "+o.message)})},e.prime=function(){var a=e.fadeLength/1e3;return e.isRunning=!1,e.audioBufferPossible?(e.debugCallback&&e.debugCallback("prime called"),new Promise(function(i,n){try{let y=function(x){var b=x&&x.audioBuffers&&x.audioBuffers.length>0?x.audioBuffers[0].duration:0;return{status:oe().state,duration:b}};var s=oe().currentTime,c=e.millisecondsPerMeasure/1e3/e.meterSize;if(e.duration=e.flattened.totalDuration*c,e.duration<=0)return e.audioBuffers=[],i({status:"empty",seconds:0});e.duration+=a;var o=Math.floor(oe().sampleRate*e.duration);e.stop();var f=p2(e.flattened);e.options.swing&&r(f,e.options.swing,e.meterFraction,e.pickupLength),e.sequenceCallback&&e.sequenceCallback(f,e.callbackContext);var u=t(f.length,e.pan),l={};f.forEach(function(x,b){var w=u&&u.length>b?u[b]:0;x.forEach(function(C){var T=C.instrument+":"+C.pitch+":"+C.volume+":"+Math.round((C.end-C.start)*1e3)/1e3+":"+w+":"+c+":"+(C.cents?C.cents:0);e.debugCallback&&e.debugCallback("noteMapTrack "+T),l[T]||(l[T]=[]),l[T].push(C.start)})});for(var h=[],d=oe().createBuffer(2,o,oe().sampleRate),p=0;p<Object.keys(l).length;p++){var g=Object.keys(l)[p],v=g.split(":"),m=v[6]!==void 0?parseFloat(v[6]):0;v={instrument:v[0],pitch:parseInt(v[1],10),volume:parseInt(v[2],10),len:parseFloat(v[3]),pan:parseFloat(v[4]),tempoMultiplier:parseFloat(v[5]),cents:m},h.push(y2(d,oe().sampleRate,v,l[g],e.soundFontVolumeMultiplier,e.programOffsets[v.instrument],a,e.noteEnd/1e3,e.debugCallback))}e.audioBuffers=[d],e.debugCallback&&(e.debugCallback("sampleRate = "+oe().sampleRate),e.debugCallback("totalSamples = "+o),e.debugCallback("creationTime = "+Math.floor((oe().currentTime-s)*1e3)+"ms")),Promise.all(h).then(function(){oe().state==="suspended"?oe().resume().then(function(){i(y(e))}):oe().state==="interrupted"?oe().suspend().then(function(){oe().resume().then(function(){i(y(e))})}):i(y(e))}).catch(function(x){n(x)})}catch(y){n(y)}})):Promise.reject(new Error(Mt))};function t(a,i){if(i==null)return null;var n=[];if(i.length){for(var s=0;s<a;s++)if(s<i.length){var c=parseFloat(i[s]);c<-1?c=-1:c>1&&(c=1),n.push(c)}else n.push(0);return n}else{var o=parseFloat(i);if(o*(a-1)>2)return null;for(var f=a%2===0,u=f?0-o/2:0,l=u+o,h=0;h<a;h++)f=h%2===0,f?(n.push(u),u-=o):(n.push(l),l+=o);return n}}e.start=function(){if(!e.audioBufferPossible)throw new Error(Mt);e.debugCallback&&e.debugCallback("start called");var a=e.pausedTimeSec?e.pausedTimeSec:0;e._kickOffSound(a),e.startTimeSec=oe().currentTime-a,e.pausedTimeSec=void 0,e.debugCallback&&e.debugCallback("MIDI STARTED",e.startTimeSec)},e.pause=function(){if(!e.audioBufferPossible)throw new Error(Mt);return e.debugCallback&&e.debugCallback("pause called"),e.pausedTimeSec=e.stop(),e.pausedTimeSec},e.resume=function(){e.start()},e.seek=function(a,i){var n;switch(i){case"seconds":n=a;break;case"beats":n=a*e.millisecondsPerMeasure/e.beatsPerMeasure/1e3;break;default:n=(e.duration-e.fadeLength/1e3)*a;break}if(!e.audioBufferPossible)throw new Error(Mt);e.debugCallback&&e.debugCallback("seek called sec="+n),e.isRunning?(e.stop(),e._kickOffSound(n)):e.pausedTimeSec=n,e.pausedTimeSec=n},e.stop=function(){e.isRunning=!1,e.pausedTimeSec=void 0,e.directSource.forEach(function(i){try{i.stop()}catch(n){console.log("direct source didn't stop:",n)}}),e.directSource=[];var a=oe().currentTime-e.startTimeSec;return a},e.finished=function(){e.startTimeSec=void 0,e.pausedTimeSec=void 0,e.isRunning=!1},e.download=function(){return m2(e)},e.getAudioBuffer=function(){return e.audioBuffers[0]},e.getIsRunning=function(){return e.isRunning},e._deviceCapable=function(){return g2()?!0:(console.warn(Mt),e.debugCallback&&e.debugCallback(Mt),!1)},e._kickOffSound=function(a){e.isRunning=!0,e.directSource=[],e.audioBuffers.forEach(function(i,n){e.directSource[n]=oe().createBufferSource(),e.directSource[n].buffer=i,e.directSource[n].connect(oe().destination)}),e.directSource.forEach(function(i){i.start(0,a)}),e.onEnded&&(e.directSource[0].onended=function(){e.onEnded(e.callbackContext)})};function r(a,i,n,s){if(!(n.den!=4&&n.den!=8)&&(i=parseFloat(i),!(isNaN(i)||i<=50))){i>75&&(i=75),i=i/50-1;var c=0,o=.25;n.den===8&&(o=o/2);for(var f=o/2,u=f*i,l=0;l<a.length;l++)for(var h=a[l],d=0;d<h.length;d++){var p=h[d];if((p.start-s)%f==0&&(p.start-s)%o!=0&&(d==0||h[d-1].start<=h[d].start-f)&&(d==h.length-1||h[d+1].start>=h[d].start+f)){var g=p.start;p.start+=u,p.volume*=1+c,d>0&&h[d-1].end==g&&(h[d-1].end=p.start,h[d-1].volume*=1-c)}}}}}var la=x2,C2=function(){var e=this;e.tracks=[],e.totalDuration=0,e.currentInstrument=[],e.starts=[],e.addTrack=function(){return e.tracks.push([]),e.currentInstrument.push(0),e.starts.push(0),e.tracks.length-1},e.setInstrument=function(t,r){e.tracks[t].push({channel:0,cmd:"program",instrument:r}),e.currentInstrument[t]=r},e.appendNote=function(t,r,a,i,n){var s={cmd:"note",duration:a,gap:0,instrument:e.currentInstrument[t],pitch:r,start:e.starts[t],volume:i};n&&(s.cents=n),e.tracks[t].push(s),e.starts[t]+=a,e.totalDuration=Math.max(e.totalDuration,e.starts[t])}},Vn=C2,k2=`
41
41
  <svg version="1.0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 700" preserveAspectRatio="xMidYMid meet">
42
42
  <g transform="translate(0,700) scale(0.1,-0.1)" >
43
43
  <path d="M3111 6981 c-20 -37 -90 -55 -364 -96 -120 -18 -190 -33 -244 -55
@@ -99,36 +99,36 @@ X:`),a=r.length;return a===0&&(a=1),a};var e=ct.TuneBook=function(t){var r=u1(t)
99
99
  0 -1086 -11z"></path>
100
100
  </g>
101
101
  </svg>
102
- `,C2=x2,k2=`
102
+ `,_2=k2,T2=`
103
103
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" class="abcjs-play-svg">
104
104
  <g>
105
105
  <polygon points="4 0 23 12.5 4 25"/>
106
106
  </g>
107
107
  </svg>
108
- `,_2=k2,T2=`
108
+ `,E2=T2,S2=`
109
109
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" class="abcjs-pause-svg">
110
110
  <g>
111
111
  <rect width="8.23" height="25"/>
112
112
  <rect width="8.23" height="25" x="17"/>
113
113
  </g>
114
114
  </svg>
115
- `,E2=T2,S2=`
115
+ `,M2=S2,A2=`
116
116
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" class="abcjs-loading-svg">
117
117
  <circle cx="50" cy="50" fill="none" stroke-width="20" r="35" stroke-dasharray="160 55"></circle>
118
118
  </svg>
119
- `,M2=S2,A2=`
119
+ `,B2=A2,N2=`
120
120
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25">
121
121
  <g>
122
122
  <polygon points="5 12.5 24 0 24 25"/>
123
123
  <rect width="3" height="25" x="0" y="0"/>
124
124
  </g>
125
125
  </svg>
126
- `,B2=A2,N2=or,ji=sr,y0=r0,L2=C2,P2=_2,D2=E2,I2=M2,F2=B2;function O2(e,t){var r=this;if(typeof e=="string"){var a=e;if(e=document.querySelector(a),!e)throw new Error('Cannot find element "'+a+'" in the DOM.')}else if(!(e instanceof HTMLElement))throw new Error("The first parameter must be a valid element or selector in the DOM.");if(r.parent=e,r.options={},t&&(r.options=Object.assign({},t)),r.options.ac&&ji(r.options.ac),H2(r.parent,r.options),z2(r),r.disable=function(i){var s=r.parent.querySelector(".abcjs-inline-audio");i?s.classList.add("abcjs-disabled"):s.classList.remove("abcjs-disabled")},r.setWarp=function(i,s){var o=r.parent.querySelector(".abcjs-midi-tempo");o.value=Math.round(s),r.setTempo(i)},r.setTempo=function(i){var s=r.parent.querySelector(".abcjs-midi-current-tempo");s&&(s.innerHTML=Math.round(i))},r.resetAll=function(){for(var i=r.parent.querySelectorAll(".abcjs-pushed"),s=0;s<i.length;s++){var o=i[s];o.classList.remove("abcjs-pushed")}},r.pushPlay=function(i){var s=r.parent.querySelector(".abcjs-midi-start");s&&(i?s.classList.add("abcjs-pushed"):s.classList.remove("abcjs-pushed"))},r.pushLoop=function(i){var s=r.parent.querySelector(".abcjs-midi-loop");s&&(i?s.classList.add("abcjs-pushed"):s.classList.remove("abcjs-pushed"))},r.setProgress=function(i,s){var o=r.parent.querySelector(".abcjs-midi-progress-background"),c=r.parent.querySelector(".abcjs-midi-progress-indicator");if(!(!o||!c)){var f=o.clientWidth,u=f*i;c.style.left=u+"px";var l=r.parent.querySelector(".abcjs-midi-clock");if(l){var h=s*i/1e3,d=Math.floor(h/60),p=Math.floor(h%60),g=p<10?"0"+p:p;l.innerHTML=d+":"+g}}},r.options.afterResume){var n=!1;r.options.ac?n=r.options.ac.state!=="suspended":y0()&&(n=y0().state!=="suspended"),n&&r.options.afterResume()}}function H2(e,t){var r=!!t.loopHandler,a=!!t.restartHandler,n=!!t.playHandler||!!t.playPromiseHandler,i=!!t.progressHandler,s=!!t.warpHandler,o=t.hasClock!==!1,c=`<div class="abcjs-inline-audio">
127
- `;if(r){var f=t.repeatTitle?t.repeatTitle:"Click to toggle play once/repeat.",u=t.repeatAria?t.repeatAria:f;c+='<button type="button" class="abcjs-midi-loop abcjs-btn" title="'+f+'" aria-label="'+u+'">'+L2+`</button>
128
- `}if(a){var l=t.restartTitle?t.restartTitle:"Click to go to beginning.",h=t.restartAria?t.restartAria:l;c+='<button type="button" class="abcjs-midi-reset abcjs-btn" title="'+l+'" aria-label="'+h+'">'+F2+`</button>
129
- `}if(n){var d=t.playTitle?t.playTitle:"Click to play/pause.",p=t.playAria?t.playAria:d;c+='<button type="button" class="abcjs-midi-start abcjs-btn" title="'+d+'" aria-label="'+p+'">'+P2+D2+I2+`</button>
130
- `}if(i){var g=t.randomTitle?t.randomTitle:"Click to change the playback position.",v=t.randomAria?t.randomAria:g;c+='<button type="button" class="abcjs-midi-progress-background" title="'+g+'" aria-label="'+v+`"><span class="abcjs-midi-progress-indicator"></span></button>
131
- `}if(o&&(c+=`<span class="abcjs-midi-clock"></span>
132
- `),s){var m=t.warpTitle?t.warpTitle:"Change the playback speed.",y=t.warpAria?t.warpAria:m,x=t.bpm?t.bpm:"BPM";c+='<span class="abcjs-tempo-wrapper"><label><input class="abcjs-midi-tempo" type="number" min="1" max="300" value="100" title="'+m+'" aria-label="'+y+'">%</label><span>&nbsp;(<span class="abcjs-midi-current-tempo"></span> '+x+`)</span></span>
133
- `}c+='<div class="abcjs-css-warning" style="font-size: 12px;color:red;border: 1px solid red;text-align: center;width: 300px;margin-top: 4px;font-weight: bold;border-radius: 4px;">CSS required: load abcjs-audio.css</div>',c+=`</div>
134
- `,e.innerHTML=c}function d0(e,t,r,a,n){var i=!0;if(y0()?i=y0().state==="suspended":ji(),!N2())throw{status:"NotSupported",message:"This browser does not support audio."};(i||n)&&r&&r.classList.add("abcjs-loading"),i?y0().resume().then(function(){a?a().then(function(s){Sr(e,t,r,n)}):Sr(e,t,r,n)}):Sr(e,t,r,n)}function Sr(e,t,r,a){a?e(t).then(function(){r&&r.classList.remove("abcjs-loading")}):(e(t),r&&r.classList.remove("abcjs-loading"))}function z2(e){var t=!!e.options.loopHandler,r=!!e.options.restartHandler,a=!!e.options.playHandler||!!e.options.playPromiseHandler,n=!!e.options.progressHandler,i=!!e.options.warpHandler,s=e.parent.querySelector(".abcjs-midi-start");t&&e.parent.querySelector(".abcjs-midi-loop").addEventListener("click",function(o){d0(e.options.loopHandler,o,s,e.options.afterResume)}),r&&e.parent.querySelector(".abcjs-midi-reset").addEventListener("click",function(o){d0(e.options.restartHandler,o,s,e.options.afterResume)}),a&&s.addEventListener("click",function(o){d0(e.options.playPromiseHandler||e.options.playHandler,o,s,e.options.afterResume,!!e.options.playPromiseHandler)}),n&&e.parent.querySelector(".abcjs-midi-progress-background").addEventListener("click",function(o){d0(e.options.progressHandler,o,s,e.options.afterResume)}),i&&e.parent.querySelector(".abcjs-midi-tempo").addEventListener("change",function(o){d0(e.options.warpHandler,o,s,e.options.afterResume)})}var Ki=O2,$2=Vi,R2=la,G2=r0;function Y2(e,t,r,a,n){for(var i=new $2,s=0;s<e.length;s++){var o=e[s],c=i.addTrack();if(i.setInstrument(c,o.instrument),s===0&&t)for(var f=0;f<t.length;f++){var u=t[f];i.appendNote(c,u.pitch,1/64,u.volume,u.cents)}i.appendNote(c,o.pitch,o.duration,o.volume,o.cents)}var l=G2();return l.state==="suspended"?l.resume().then(function(){return Fn(i,r,a,n)}):Fn(i,r,a,n)}function Fn(e,t,r,a){var n=new R2;return n.init({sequence:e,millisecondsPerMeasure:t,options:{soundFontUrl:r},debugCallback:a}).then(function(){return n.prime()}).then(function(){return n.start(),Promise.resolve()})}var q2=Y2,W2=Ki,X2=la,U2=$r,On=r0;function V2(){var e=this;e.warp=100,e.cursorControl=null,e.visualObj=null,e.timer=null,e.midiBuffer=null,e.options=null,e.currentTempo=null,e.control=null,e.isLooping=!1,e.isStarted=!1,e.isLoaded=!1,e.isLoading=!1,e.load=function(r,a,n){n||(n={}),n.displayPlay===void 0&&(n.displayPlay=!0),n.displayProgress===void 0&&(n.displayProgress=!0),e.control=new W2(r,{loopHandler:n.displayLoop?e.toggleLoop:void 0,restartHandler:n.displayRestart?e.restart:void 0,playPromiseHandler:n.displayPlay?e.play:void 0,progressHandler:n.displayProgress?e.randomAccess:void 0,warpHandler:n.displayWarp?e.onWarp:void 0,afterResume:e.init}),e.cursorControl=a,e.disable(!0)},e.disable=function(r){e.control&&e.control.disable(r)},e.setTune=function(r,a,n){return e.visualObj=r,e.disable(!1),e.options=n||{},e.control&&(e.pause(),e.setProgress(0,1),e.control.resetAll(),e.restart(),e.isStarted=!1),e.isLooping=!1,a?e.go():Promise.resolve({status:"no-audio-context"})},e.go=function(){e.isLoading=!0;var r=e.visualObj.millisecondsPerMeasure()*100/e.warp;e.currentTempo=Math.round(e.visualObj.getBeatsPerMeasure()/r*6e4),e.control&&e.control.setTempo(e.currentTempo),e.percent=0;var a;return e.midiBuffer||(e.midiBuffer=new X2),On().resume().then(function(n){return e.midiBuffer.init({visualObj:e.visualObj,options:e.options,millisecondsPerMeasure:r})}).then(function(n){return a=n,e.midiBuffer.prime()}).then(function(){var n=16;return e.cursorControl&&e.cursorControl.beatSubdivisions!==void 0&&parseInt(e.cursorControl.beatSubdivisions,10)>=1&&parseInt(e.cursorControl.beatSubdivisions,10)<=64&&(n=parseInt(e.cursorControl.beatSubdivisions,10)),e.timer=new U2(e.visualObj,{beatCallback:e.beatCallback,eventCallback:e.eventCallback,lineEndCallback:e.lineEndCallback,qpm:e.currentTempo,extraMeasuresAtBeginning:e.cursorControl?e.cursorControl.extraMeasuresAtBeginning:void 0,lineEndAnticipation:e.cursorControl?e.cursorControl.lineEndAnticipation:0,beatSubdivisions:n}),e.cursorControl&&e.cursorControl.onReady&&typeof e.cursorControl.onReady=="function"&&e.cursorControl.onReady(e),e.isLoaded=!0,e.isLoading=!1,Promise.resolve({status:"created",notesStatus:a})})},e.destroy=function(){e.timer&&(e.timer.reset(),e.timer.stop(),e.timer=null),e.midiBuffer&&(e.midiBuffer.stop(),e.midiBuffer=null),e.setProgress(0,1),e.control&&e.control.resetAll()},e.play=function(){return e.runWhenReady(e._play,void 0)};function t(r){return new Promise(function(a){setTimeout(a,r)})}e.runWhenReady=function(r,a){return e.visualObj?e.isLoading?t(500).then(function(){return e.isLoading?e.runWhenReady(r,a):r(a)}):e.isLoaded?r(a):e.go().then(function(){return r(a)}):Promise.resolve({status:"loading"})},e._play=function(){return On().resume().then(function(){return e.isStarted=!e.isStarted,e.isStarted?(e.cursorControl&&e.cursorControl.onStart&&typeof e.cursorControl.onStart=="function"&&e.cursorControl.onStart(),e.midiBuffer.start(),e.timer.start(e.percent),e.control&&e.control.pushPlay(!0)):e.pause(),Promise.resolve({status:"ok"})})},e.pause=function(){e.timer&&(e.timer.pause(),e.midiBuffer.pause(),e.control&&e.control.pushPlay(!1))},e.toggleLoop=function(){e.isLooping=!e.isLooping,e.control&&e.control.pushLoop(e.isLooping)},e.restart=function(){e.timer&&(e.timer.setProgress(0),e.midiBuffer.seek(0))},e.randomAccess=function(r){return e.runWhenReady(e._randomAccess,r)},e._randomAccess=function(r){var a=r.target.classList.contains("abcjs-midi-progress-indicator")?r.target.parentNode:r.target,n=(r.x-a.getBoundingClientRect().left)/a.offsetWidth;return n<0&&(n=0),n>1&&(n=1),e.seek(n),Promise.resolve({status:"ok"})},e.seek=function(r,a){e.timer&&e.midiBuffer&&(e.timer.setProgress(r,a),e.midiBuffer.seek(r,a))},e.setWarp=function(r){if(parseInt(r,10)>0){e.warp=parseInt(r,10);var a=e.isStarted,n=e.percent;return e.destroy(),e.isStarted=!1,e.go().then(function(){return e.setProgress(n,e.midiBuffer.duration*1e3),e.control&&e.control.setWarp(e.currentTempo,e.warp),a?e.play().then(function(){return e.seek(n),Promise.resolve()}):(e.seek(n),Promise.resolve())})}return Promise.resolve()},e.onWarp=function(r){var a=r.target.value;return e.setWarp(a)},e.setProgress=function(r,a){e.percent=r,e.control&&e.control.setProgress(r,a)},e.finished=function(){if(e.timer.reset(),e.isLooping)return e.timer.start(0),e.midiBuffer.finished(),e.midiBuffer.start(),"continue";e.timer.stop(),e.isStarted&&(e.control&&e.control.pushPlay(!1),e.isStarted=!1,e.midiBuffer.finished(),e.cursorControl&&e.cursorControl.onFinished&&typeof e.cursorControl.onFinished=="function"&&e.cursorControl.onFinished(),e.setProgress(0,1))},e.beatCallback=function(r,a,n,i){var s=r/a;e.setProgress(s,n),e.cursorControl&&e.cursorControl.onBeat&&typeof e.cursorControl.onBeat=="function"&&e.cursorControl.onBeat(r,a,n,i)},e.eventCallback=function(r){if(r)e.cursorControl&&e.cursorControl.onEvent&&typeof e.cursorControl.onEvent=="function"&&e.cursorControl.onEvent(r);else return e.finished()},e.lineEndCallback=function(r,a){e.cursorControl&&e.cursorControl.onLineEnd&&typeof e.cursorControl.onLineEnd=="function"&&e.cursorControl.onLineEnd(r,a)},e.getUrl=function(){return e.midiBuffer.download()},e.download=function(r){var a=e.getUrl(),n=document.createElement("a");document.body.appendChild(n),n.setAttribute("style","display: none;"),n.href=a,n.download=r||"output.wav",n.click(),window.URL.revokeObjectURL(a),document.body.removeChild(n)}}var Qi=V2,j2=Ui,Ji;(function(){function e(u,l){for(var h in l)l.hasOwnProperty(h)&&u.setAttribute(h,l[h]);return u}function t(){this.trackstrings="",this.trackcount=0,this.noteOnAndChannel="%90",this.noteOffAndChannel="%80"}t.prototype.setTempo=function(u){this.trackcount===0&&(this.startTrack(),this.track+="%00%FF%51%03"+o(Math.round(6e7/u),6),this.endTrack())},t.prototype.setGlobalInfo=function(u,l,h,d){if(this.trackcount===0){this.startTrack();var p=Math.round(6e7/u);this.track+="%00%FF%51%03"+o(p,6),h&&(this.track+=n(h)),d&&(this.track+=i(d)),l&&(this.track+=a(l,"%01")),this.endTrack()}},t.prototype.startTrack=function(){this.noteWarped={},this.track="",this.trackName="",this.trackInstrument="",this.silencelength=0,this.trackcount++,this.instrument&&this.setInstrument(this.instrument)},t.prototype.endTrack=function(){this.track=this.trackName+this.trackInstrument+this.track;var u=o(this.track.length/3+4,8);this.track="MTrk"+u+this.track+"%00%FF%2F%00",this.trackstrings+=this.track},t.prototype.setText=function(u,l){switch(u){case"name":this.trackName=a(l,"%03");break}},t.prototype.setInstrument=function(u){this.trackInstrument="%00%C0"+o(u,2),this.instrument=u},t.prototype.setChannel=function(u,l){this.channel=u;var h="%00%B"+this.channel.toString(16);this.track+=h+"%79%00",this.track+=h+"%40%00",this.track+=h+"%5B%30",l||(l=0),l=Math.round((l+1)*64),this.track+=h+"%0A"+o(l,2),this.track+=h+"%07%64",this.noteOnAndChannel="%9"+this.channel.toString(16),this.noteOffAndChannel="%8"+this.channel.toString(16)};var r=4096;t.prototype.startNote=function(u,l,h){if(this.track+=f(this.silencelength),this.silencelength=0,h){this.track+="%e"+this.channel.toString(16);var d=Math.round(j2(h)*r);this.track+=c(8192+d),this.track+=f(0),this.noteWarped[u]=!0}this.track+=this.noteOnAndChannel,this.track+="%"+u.toString(16)+o(l,2)},t.prototype.endNote=function(u){this.track+=f(this.silencelength),this.silencelength=0,this.noteWarped[u]&&(this.track+="%e"+this.channel.toString(16),this.track+=c(8192),this.track+=f(0),this.noteWarped[u]=!1),this.track+=this.noteOffAndChannel,this.track+="%"+u.toString(16)+"%00"},t.prototype.addRest=function(u){this.silencelength+=u,this.silencelength<0&&(this.silencelength=0)},t.prototype.getData=function(){return"data:audio/midi,MThd%00%00%00%06%00%01"+o(this.trackcount,4)+"%01%e0"+this.trackstrings},t.prototype.embed=function(u,l){var h=this.getData(),d=e(document.createElement("a"),{href:h});if(d.innerHTML="download midi",u.insertBefore(d,u.firstChild),!l){var p=e(document.createElement("embed"),{src:h,type:"video/quicktime",controller:"true",autoplay:"false",loop:"false",enablejavascript:"true",style:"display:block; height: 20px;"});u.insertBefore(p,u.firstChild)}};function a(u,l){for(var h="",d=0;d<u.length;d++)h+=o(u.charCodeAt(d),2);return"%00%FF"+l+o(h.length/3,2)+h}function n(u){if(!u||!u.accidentals)return"";for(var l="%00%FF%59%02",h=0,d=256,p=0;p<u.accidentals.length;p++)u.accidentals[p].acc==="sharp"?h++:u.accidentals[p].acc==="flat"&&d--;var g=o(d!==256?d:h,2),v=u.mode==="m"?"%01":"%00";return l+g+v}function i(u){var l="%00%FF%58%04"+o(u.num,2),h={1:0,2:1,4:2,8:3,16:4,32:5},d=h[u.den];if(!d)return"";l+=o(d,2);var p;switch(u.num+"/"+u.den){case"2/4":case"3/4":case"4/4":case"5/4":p=24;break;case"6/4":p=72;break;case"2/2":case"3/2":case"4/2":p=48;break;case"3/8":case"6/8":case"9/8":case"12/8":p=36;break}return p?(l+=o(p,2),l+"%08"):""}function s(u){for(var l="",h=0;h<u.length;h+=2)l+="%",l+=u.substr(h,2);return l}function o(u,l){var h=u.toString(16);for(h=h.split(".")[0];h.length<l;)h="0"+h;return h.length>l&&(h=h.substring(0,l)),s(h)}function c(u){u=Math.round(u);var l=u%128,h=u-l;return o(h*2+l,4)}function f(u){var l=0,h=[];for(u=Math.round(u);u!==0;)h.push(u&127),u=u>>7;for(var d=h.length-1;d>=0;d--){l=l<<8;var p=h[d];d!==0&&(p=p|128),l=l|p}var g=l.toString(16).length;return g+=g%2,o(l,g)}Ji=function(){return new t}})();var Zi=Ji,K2=Zi,es;(function(){var e=1920;es=function(a,n){n===void 0&&(n={});var i=a.setUpAudio(n),s=K2(),o=a.metaText?a.metaText.title:void 0;o&&o.length>128&&(o=o.substring(0,124)+"...");var c=a.getKeySignature(),f=a.getMeterFraction(),u=i.tempo,l=u/60;if(f.den===8&&f.num!==5&&f.num!==7){var h=a.millisecondsPerMeasure();u=6e4/(h/f.num)/2,l=u/60}s.setGlobalInfo(u,o,c,f);for(var d=0;d<i.tracks.length;d++){s.startTrack();for(var p={},g=0;g<i.tracks[d].length;g++){var v=i.tracks[d][g];switch(v.cmd){case"text":s.setText(v.type,v.text);break;case"program":var m=0;n.pan&&n.pan.length>d&&(m=n.pan[d]),v.instrument===128?(s.setChannel(9,m),s.setInstrument(0)):(s.setChannel(v.channel,m),s.setInstrument(v.instrument));break;case"note":var y=v.gap*l,x=v.start,b=x+v.duration-y;p[x]||(p[x]=[]),p[x].push({pitch:v.pitch,volume:v.volume,cents:v.cents}),p[b]||(p[b]=[]),p[b].push({pitch:v.pitch,volume:0});break;default:console.log("MIDI create Unknown: "+v.cmd)}}t(s,p,e),s.endTrack()}return s.getData()};function t(r,a,n){for(var i=Object.keys(a),s=0;s<i.length;s++)i[s]=parseFloat(i[s]);i.sort(function(d,p){return d-p});for(var o=0,c=0;c<i.length;c++){var f=a[i[c]];if(i[c]>o){var u=(i[c]-o)*n;r.addRest(u),o=i[c]}for(var l=0;l<f.length;l++){var h=f[l];h.volume?r.startNote(h.pitch,h.volume,h.cents):r.endNote(h.pitch)}}}})();var Q2=es,J2=tr,Z2=Q2,e3=function(e,t){var r={};if(t)for(var a in t)t.hasOwnProperty(a)&&(r[a]=t[a]);r.generateInline=!1;function n(i,s,o){var c=Z2(s,r);switch(r.midiOutputType){case"encoded":return c;case"binary":var f=c.replace("data:audio/midi,","");f=f.replace(/MThd/g,"%4d%54%68%64"),f=f.replace(/MTrk/g,"%4d%54%72%6b");for(var u=new ArrayBuffer(f.length/3),l=new Uint8Array(u),h=0;h<f.length/3;h++){var d=h*3+1,p=parseInt(f.substring(d,d+2),16);l[h]=p}return l;case"link":default:return r3(s,r,c,o)}}return typeof e=="string"?J2.renderEngine(n,"*",e,r):n(null,e,0)};function t3(e){var t={};return e&&t.toString.call(e)==="[object Function]"}var r3=function(e,t,r,a){var n=["abcjs-download-midi","abcjs-midi-"+a];t.downloadClass&&n.push(t.downloadClass);var i='<div class="'+n.join(" ")+'">';t.preTextDownload&&(i+=t.preTextDownload);var s=e.metaText&&e.metaText.title?e.metaText.title:"Untitled",o;t.downloadLabel&&t3(t.downloadLabel)?o=t.downloadLabel(e,a):t.downloadLabel?o=t.downloadLabel.replace(/%T/,s):o='Download MIDI for "'+s+'"',s=s.toLowerCase().replace(/'/g,"").replace(/\W/g,"_").replace(/__/g,"_");var c=t.fileName?t.fileName:s+".midi";return i+='<a download="'+c+'" href="'+r+'">'+o+"</a>",t.postTextDownload&&(i+=t.postTextDownload),i+"</div>"},a3=e3;try{if(typeof window.CustomEvent!="function"){var Hn=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var r=document.createEvent("CustomEvent");return r.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r};Hn.prototype=window.Event.prototype,window.CustomEvent=Hn}}catch{}var wt=function(e){this.isEditArea=!0,typeof e=="string"?(this.textarea=document.getElementById(e),this.textarea||(this.textarea=document.querySelector(e))):this.textarea=e,this.initialText=this.textarea.value,this.isDragging=!1};wt.prototype.addSelectionListener=function(e){this.textarea.onmousemove=function(t){this.isDragging&&e.fireSelectionChanged()}};wt.prototype.addChangeListener=function(e){this.changelistener=e,this.textarea.onkeyup=function(){e.fireChanged()},this.textarea.onmousedown=function(){this.isDragging=!0,e.fireSelectionChanged()},this.textarea.onmouseup=function(){this.isDragging=!1,e.fireChanged()},this.textarea.onchange=function(){e.fireChanged()}};wt.prototype.getSelection=function(){return{start:this.textarea.selectionStart,end:this.textarea.selectionEnd}};wt.prototype.setSelection=function(e,t){if(this.textarea.setSelectionRange)this.textarea.setSelectionRange(e,t);else if(this.textarea.createTextRange){var r=this.textarea.createTextRange();r.collapse(!0),r.moveEnd("character",t),r.moveStart("character",e),r.select()}this.textarea.focus()};wt.prototype.getString=function(){return this.textarea.value};wt.prototype.setString=function(e){this.textarea.value=e,this.initialText=this.getString(),this.changelistener&&this.changelistener.fireChanged()};wt.prototype.getElem=function(){return this.textarea};var ts=wt,rs=rt,n3=Qi,i3=or,s3=Xi,zn=ts;function o3(e){var t={},r;if(e.abcjsParams)for(r in e.abcjsParams)e.abcjsParams.hasOwnProperty(r)&&(t[r]=e.abcjsParams[r]);if(e.midi_options)for(r in e.midi_options)e.midi_options.hasOwnProperty(r)&&(t[r]=e.midi_options[r]);if(e.parser_options)for(r in e.parser_options)e.parser_options.hasOwnProperty(r)&&(t[r]=e.parser_options[r]);if(e.render_options)for(r in e.render_options)e.render_options.hasOwnProperty(r)&&(t[r]=e.render_options[r]);return t.tablature&&e.warnings_id&&(t.tablature.warnings_id=e.warnings_id),t}var xe=function(e,t){this.abcjsParams=o3(t),t.indicate_changed&&(this.indicate_changed=!0),typeof e=="string"?this.editarea=new zn(e):e.isEditArea?this.editarea=e:this.editarea=new zn(e),this.editarea.addSelectionListener(this),this.editarea.addChangeListener(this),t.canvas_id?this.div=t.canvas_id:t.paper_id?this.div=t.paper_id:(this.div=document.createElement("DIV"),this.editarea.getElem().parentNode.insertBefore(this.div,this.editarea.getElem())),typeof this.div=="string"&&(this.div=document.getElementById(this.div)),t.selectionChangeCallback&&(this.selectionChangeCallback=t.selectionChangeCallback),this.clientClickListener=this.abcjsParams.clickListener,this.abcjsParams.clickListener=this.highlight.bind(this),t.synth&&i3()&&(this.synth={el:t.synth.el,cursorControl:t.synth.cursorControl,options:t.synth.options}),t.generate_midi&&(this.generate_midi=t.generate_midi,this.abcjsParams.generateDownload&&(typeof t.midi_download_id=="string"?this.downloadMidi=document.getElementById(t.midi_download_id):t.midi_download_id&&(this.downloadMidi=t.midi_download_id)),this.abcjsParams.generateInline!==!1&&(typeof t.midi_id=="string"?this.inlineMidi=document.getElementById(t.midi_id):t.midi_id&&(this.inlineMidi=t.midi_id))),t.warnings_id?typeof t.warnings_id=="string"?this.warningsdiv=document.getElementById(t.warnings_id):this.warningsdiv=t.warnings_id:t.generate_warnings&&(this.warningsdiv=document.createElement("div"),this.div.parentNode.insertBefore(this.warningsdiv,this.div)),this.onchangeCallback=t.onchange,this.redrawCallback=t.redrawCallback,this.currentAbc="",this.tunes=[],this.bReentry=!1,this.parseABC(),this.modelChanged(),this.addClassName=function(r,a){var n=function(i,s){var o=i.className;return o.length>0&&(o===s||new RegExp("(^|\\s)"+s+"(\\s|$)").test(o))};return n(r,a)||(r.className+=(r.className?" ":"")+a),r},this.removeClassName=function(r,a){return r.className=rs.strip(r.className.replace(new RegExp("(^|\\s+)"+a+"(\\s+|$)")," ")),r},this.setReadOnly=function(r){var a="abc_textarea_readonly",n=this.editarea.getElem();r?(n.setAttribute("readonly","yes"),this.addClassName(n,a)):(n.removeAttribute("readonly"),this.removeClassName(n,a))}};xe.prototype.redrawMidi=function(){if(this.generate_midi&&!this.midiPause){var e=new window.CustomEvent("generateMidi",{detail:{tunes:this.tunes,abcjsParams:this.abcjsParams,downloadMidiEl:this.downloadMidi,inlineMidiEl:this.inlineMidi,engravingEl:this.div}});window.dispatchEvent(e)}if(this.synth){var t=this.synth.synthControl;this.synth.synthControl||(this.synth.synthControl=new n3,this.synth.synthControl.load(this.synth.el,this.synth.cursorControl,this.synth.options)),this.synth.synthControl.setTune(this.tunes[0],t,this.synth.options)}};xe.prototype.modelChanged=function(){if(!this.bReentry){this.bReentry=!0;try{this.timerId=null,this.redrawCallback&&this.redrawCallback(!0),this.synth&&this.synth.synthControl&&this.synth.synthControl.disable(!0),this.tunes=s3(this.div,this.currentAbc,this.abcjsParams),this.tunes.length>0&&(this.warnings=this.tunes[0].warnings),this.redrawMidi(),this.redrawCallback&&this.redrawCallback(!1)}catch(e){console.error("ABCJS error: ",e),this.warnings||(this.warnings=[]),this.warnings.push(e.message)}this.warningsdiv&&(this.warningsdiv.innerHTML=this.warnings?this.warnings.join("<br />"):"No errors"),this.updateSelection(),this.bReentry=!1}};xe.prototype.paramChanged=function(e){if(e)for(var t in e)e.hasOwnProperty(t)&&(this.abcjsParams[t]=e[t]);this.currentAbc="",this.fireChanged()};xe.prototype.getTunes=function(){return this.tunes};xe.prototype.synthParamChanged=function(e){if(this.synth){if(this.synth.options={},e)for(var t in e)e.hasOwnProperty(t)&&(this.synth.options[t]=e[t]);this.currentAbc="",this.fireChanged()}};xe.prototype.parseABC=function(){var e=this.editarea.getString();return e===this.currentAbc?(this.updateSelection(),!1):(this.currentAbc=e,!0)};xe.prototype.updateSelection=function(){var e=this.editarea.getSelection();try{this.tunes.length>0&&this.tunes[0].engraver&&this.tunes[0].engraver.rangeHighlight(e.start,e.end)}catch{}this.selectionChangeCallback&&this.selectionChangeCallback(e.start,e.end)};xe.prototype.fireSelectionChanged=function(){this.updateSelection()};xe.prototype.setDirtyStyle=function(e){if(this.indicate_changed!==void 0){var t=function(i,s){var o=function(c,f){var u=c.className;return u.length>0&&(u===f||new RegExp("(^|\\s)"+f+"(\\s|$)").test(u))};return o(i,s)||(i.className+=(i.className?" ":"")+s),i},r=function(i,s){return i.className=rs.strip(i.className.replace(new RegExp("(^|\\s+)"+s+"(\\s+|$)")," ")),i},a="abc_textarea_dirty",n=this.editarea.getElem();e?t(n,a):r(n,a)}};xe.prototype.fireChanged=function(){if(!this.bIsPaused&&this.parseABC()){var e=this;this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout(function(){e.modelChanged()},300);var t=this.isDirty();this.wasDirty!==t&&(this.wasDirty=t,this.setDirtyStyle(t)),this.onchangeCallback&&this.onchangeCallback(this)}};xe.prototype.setNotDirty=function(){this.editarea.initialText=this.editarea.getString(),this.wasDirty=!1,this.setDirtyStyle(!1)};xe.prototype.isDirty=function(){return this.indicate_changed===void 0?!1:this.editarea.initialText!==this.editarea.getString()};xe.prototype.highlight=function(e,t,r,a,n,i){this.editarea.setSelection(e.startChar,e.endChar),this.selectionChangeCallback&&this.selectionChangeCallback(e.startChar,e.endChar),this.clientClickListener&&this.clientClickListener(e,t,r,a,n,i)};xe.prototype.pause=function(e){this.bIsPaused=e,e||this.fireChanged()};xe.prototype.millisecondsPerMeasure=function(){return!this.synth||!this.synth.synthControl||!this.synth.synthControl.visualObj?0:this.synth.synthControl.visualObj.millisecondsPerMeasure()};xe.prototype.pauseMidi=function(e){this.midiPause=e,e||this.redrawMidi()};var c3=xe,l3=ls,$n=ds,Rn=tr,h3=Qn,f3=v1,Ge={};Ge.signature="abcjs-basic v"+l3;Object.keys($n).forEach(function(e){Ge[e]=$n[e]});Object.keys(Rn).forEach(function(e){Ge[e]=Rn[e]});Ge.renderAbc=Xi;Ge.tuneMetrics=Yd;Ge.TimingCallbacks=$r;var u3=mt;Ge.setGlyph=u3.setSymbol;Ge.strTranspose=f3;var d3=la,p3=oa,v3=ca,g3=Vi,b3=Ki,m3=sr,y3=r0,w3=or,x3=q2,C3=Qi,k3=a3,_3=Zi;Ge.synth={CreateSynth:d3,instrumentIndexToName:p3,pitchToNoteName:v3,SynthController:C3,SynthSequence:g3,CreateSynthControl:b3,registerAudioContext:m3,activeAudioContext:y3,supportsAudio:w3,playEvent:x3,getMidiFile:k3,sequence:h3,midiRenderer:_3};Ge.Editor=c3;Ge.EditArea=ts;var as=Ge;const T3=ss(as),S3=os({__proto__:null,default:T3},[as]);export{S3 as i};
126
+ `,L2=N2,P2=cr,jn=sr,y0=r0,D2=_2,I2=E2,F2=M2,O2=B2,H2=L2;function z2(e,t){var r=this;if(typeof e=="string"){var a=e;if(e=document.querySelector(a),!e)throw new Error('Cannot find element "'+a+'" in the DOM.')}else if(!(e instanceof HTMLElement))throw new Error("The first parameter must be a valid element or selector in the DOM.");if(r.parent=e,r.options={},t&&(r.options=Object.assign({},t)),r.options.ac&&jn(r.options.ac),$2(r.parent,r.options),G2(r),r.disable=function(n){var s=r.parent.querySelector(".abcjs-inline-audio");n?s.classList.add("abcjs-disabled"):s.classList.remove("abcjs-disabled")},r.setWarp=function(n,s){var c=r.parent.querySelector(".abcjs-midi-tempo");c.value=Math.round(s),r.setTempo(n)},r.setTempo=function(n){var s=r.parent.querySelector(".abcjs-midi-current-tempo");s&&(s.innerHTML=Math.round(n))},r.resetAll=function(){for(var n=r.parent.querySelectorAll(".abcjs-pushed"),s=0;s<n.length;s++){var c=n[s];c.classList.remove("abcjs-pushed")}},r.pushPlay=function(n){var s=r.parent.querySelector(".abcjs-midi-start");s&&(n?s.classList.add("abcjs-pushed"):s.classList.remove("abcjs-pushed"))},r.pushLoop=function(n){var s=r.parent.querySelector(".abcjs-midi-loop");s&&(n?s.classList.add("abcjs-pushed"):s.classList.remove("abcjs-pushed"))},r.setProgress=function(n,s){var c=r.parent.querySelector(".abcjs-midi-progress-background"),o=r.parent.querySelector(".abcjs-midi-progress-indicator");if(!(!c||!o)){var f=c.clientWidth,u=f*n;o.style.left=u+"px";var l=r.parent.querySelector(".abcjs-midi-clock");if(l){var h=s*n/1e3,d=Math.floor(h/60),p=Math.floor(h%60),g=p<10?"0"+p:p;l.innerHTML=d+":"+g}}},r.options.afterResume){var i=!1;r.options.ac?i=r.options.ac.state!=="suspended":y0()&&(i=y0().state!=="suspended"),i&&r.options.afterResume()}}function $2(e,t){var r=!!t.loopHandler,a=!!t.restartHandler,i=!!t.playHandler||!!t.playPromiseHandler,n=!!t.progressHandler,s=!!t.warpHandler,c=t.hasClock!==!1,o=`<div class="abcjs-inline-audio">
127
+ `;if(r){var f=t.repeatTitle?t.repeatTitle:"Click to toggle play once/repeat.",u=t.repeatAria?t.repeatAria:f;o+='<button type="button" class="abcjs-midi-loop abcjs-btn" title="'+f+'" aria-label="'+u+'">'+D2+`</button>
128
+ `}if(a){var l=t.restartTitle?t.restartTitle:"Click to go to beginning.",h=t.restartAria?t.restartAria:l;o+='<button type="button" class="abcjs-midi-reset abcjs-btn" title="'+l+'" aria-label="'+h+'">'+H2+`</button>
129
+ `}if(i){var d=t.playTitle?t.playTitle:"Click to play/pause.",p=t.playAria?t.playAria:d;o+='<button type="button" class="abcjs-midi-start abcjs-btn" title="'+d+'" aria-label="'+p+'">'+I2+F2+O2+`</button>
130
+ `}if(n){var g=t.randomTitle?t.randomTitle:"Click to change the playback position.",v=t.randomAria?t.randomAria:g;o+='<button type="button" class="abcjs-midi-progress-background" title="'+g+'" aria-label="'+v+`"><span class="abcjs-midi-progress-indicator"></span></button>
131
+ `}if(c&&(o+=`<span class="abcjs-midi-clock"></span>
132
+ `),s){var m=t.warpTitle?t.warpTitle:"Change the playback speed.",y=t.warpAria?t.warpAria:m,x=t.bpm?t.bpm:"BPM";o+='<span class="abcjs-tempo-wrapper"><label><input class="abcjs-midi-tempo" type="number" min="1" max="300" value="100" title="'+m+'" aria-label="'+y+'">%</label><span>&nbsp;(<span class="abcjs-midi-current-tempo"></span> '+x+`)</span></span>
133
+ `}o+='<div class="abcjs-css-warning" style="font-size: 12px;color:red;border: 1px solid red;text-align: center;width: 300px;margin-top: 4px;font-weight: bold;border-radius: 4px;">CSS required: load abcjs-audio.css</div>',o+=`</div>
134
+ `,e.innerHTML=o}function d0(e,t,r,a,i){var n=!0;if(y0()?n=y0().state==="suspended":jn(),!P2())throw{status:"NotSupported",message:"This browser does not support audio."};(n||i)&&r&&r.classList.add("abcjs-loading"),n?y0().resume().then(function(){a?a().then(function(s){Sr(e,t,r,i)}):Sr(e,t,r,i)}):Sr(e,t,r,i)}function Sr(e,t,r,a){a?e(t).then(function(){r&&r.classList.remove("abcjs-loading")}):(e(t),r&&r.classList.remove("abcjs-loading"))}function G2(e){var t=!!e.options.loopHandler,r=!!e.options.restartHandler,a=!!e.options.playHandler||!!e.options.playPromiseHandler,i=!!e.options.progressHandler,n=!!e.options.warpHandler,s=e.parent.querySelector(".abcjs-midi-start");t&&e.parent.querySelector(".abcjs-midi-loop").addEventListener("click",function(c){d0(e.options.loopHandler,c,s,e.options.afterResume)}),r&&e.parent.querySelector(".abcjs-midi-reset").addEventListener("click",function(c){d0(e.options.restartHandler,c,s,e.options.afterResume)}),a&&s.addEventListener("click",function(c){d0(e.options.playPromiseHandler||e.options.playHandler,c,s,e.options.afterResume,!!e.options.playPromiseHandler)}),i&&e.parent.querySelector(".abcjs-midi-progress-background").addEventListener("click",function(c){d0(e.options.progressHandler,c,s,e.options.afterResume)}),n&&e.parent.querySelector(".abcjs-midi-tempo").addEventListener("change",function(c){d0(e.options.warpHandler,c,s,e.options.afterResume)})}var Kn=z2,R2=Vn,Y2=la,q2=r0;function W2(e,t,r,a,i){for(var n=new R2,s=0;s<e.length;s++){var c=e[s],o=n.addTrack();if(n.setInstrument(o,c.instrument),s===0&&t)for(var f=0;f<t.length;f++){var u=t[f];n.appendNote(o,u.pitch,1/64,u.volume,u.cents)}n.appendNote(o,c.pitch,c.duration,c.volume,c.cents)}var l=q2();return l.state==="suspended"?l.resume().then(function(){return Ii(n,r,a,i)}):Ii(n,r,a,i)}function Ii(e,t,r,a){var i=new Y2;return i.init({sequence:e,millisecondsPerMeasure:t,options:{soundFontUrl:r},debugCallback:a}).then(function(){return i.prime()}).then(function(){return i.start(),Promise.resolve()})}var X2=W2,U2=Kn,V2=la,j2=$r,Fi=r0;function K2(){var e=this;e.warp=100,e.cursorControl=null,e.visualObj=null,e.timer=null,e.midiBuffer=null,e.options=null,e.currentTempo=null,e.control=null,e.isLooping=!1,e.isStarted=!1,e.isLoaded=!1,e.isLoading=!1,e.load=function(r,a,i){i||(i={}),i.displayPlay===void 0&&(i.displayPlay=!0),i.displayProgress===void 0&&(i.displayProgress=!0),e.control=new U2(r,{loopHandler:i.displayLoop?e.toggleLoop:void 0,restartHandler:i.displayRestart?e.restart:void 0,playPromiseHandler:i.displayPlay?e.play:void 0,progressHandler:i.displayProgress?e.randomAccess:void 0,warpHandler:i.displayWarp?e.onWarp:void 0,afterResume:e.init}),e.cursorControl=a,e.disable(!0)},e.disable=function(r){e.control&&e.control.disable(r)},e.setTune=function(r,a,i){return e.visualObj=r,e.disable(!1),e.options=i||{},e.control&&(e.pause(),e.setProgress(0,1),e.control.resetAll(),e.restart(),e.isStarted=!1),e.isLooping=!1,a?e.go():Promise.resolve({status:"no-audio-context"})},e.go=function(){e.isLoading=!0;var r=e.visualObj.millisecondsPerMeasure()*100/e.warp;e.currentTempo=Math.round(e.visualObj.getBeatsPerMeasure()/r*6e4),e.control&&e.control.setTempo(e.currentTempo),e.percent=0;var a;return e.midiBuffer||(e.midiBuffer=new V2),Fi().resume().then(function(i){return e.midiBuffer.init({visualObj:e.visualObj,options:e.options,millisecondsPerMeasure:r})}).then(function(i){return a=i,e.midiBuffer.prime()}).then(function(){var i=16;return e.cursorControl&&e.cursorControl.beatSubdivisions!==void 0&&parseInt(e.cursorControl.beatSubdivisions,10)>=1&&parseInt(e.cursorControl.beatSubdivisions,10)<=64&&(i=parseInt(e.cursorControl.beatSubdivisions,10)),e.timer=new j2(e.visualObj,{beatCallback:e.beatCallback,eventCallback:e.eventCallback,lineEndCallback:e.lineEndCallback,qpm:e.currentTempo,extraMeasuresAtBeginning:e.cursorControl?e.cursorControl.extraMeasuresAtBeginning:void 0,lineEndAnticipation:e.cursorControl?e.cursorControl.lineEndAnticipation:0,beatSubdivisions:i}),e.cursorControl&&e.cursorControl.onReady&&typeof e.cursorControl.onReady=="function"&&e.cursorControl.onReady(e),e.isLoaded=!0,e.isLoading=!1,Promise.resolve({status:"created",notesStatus:a})})},e.destroy=function(){e.timer&&(e.timer.reset(),e.timer.stop(),e.timer=null),e.midiBuffer&&(e.midiBuffer.stop(),e.midiBuffer=null),e.setProgress(0,1),e.control&&e.control.resetAll()},e.play=function(){return e.runWhenReady(e._play,void 0)};function t(r){return new Promise(function(a){setTimeout(a,r)})}e.runWhenReady=function(r,a){return e.visualObj?e.isLoading?t(500).then(function(){return e.isLoading?e.runWhenReady(r,a):r(a)}):e.isLoaded?r(a):e.go().then(function(){return r(a)}):Promise.resolve({status:"loading"})},e._play=function(){return Fi().resume().then(function(){return e.isStarted=!e.isStarted,e.isStarted?(e.cursorControl&&e.cursorControl.onStart&&typeof e.cursorControl.onStart=="function"&&e.cursorControl.onStart(),e.midiBuffer.start(),e.timer.start(e.percent),e.control&&e.control.pushPlay(!0)):e.pause(),Promise.resolve({status:"ok"})})},e.pause=function(){e.timer&&(e.timer.pause(),e.midiBuffer.pause(),e.control&&e.control.pushPlay(!1))},e.toggleLoop=function(){e.isLooping=!e.isLooping,e.control&&e.control.pushLoop(e.isLooping)},e.restart=function(){e.timer&&(e.timer.setProgress(0),e.midiBuffer.seek(0))},e.randomAccess=function(r){return e.runWhenReady(e._randomAccess,r)},e._randomAccess=function(r){var a=r.target.classList.contains("abcjs-midi-progress-indicator")?r.target.parentNode:r.target,i=(r.x-a.getBoundingClientRect().left)/a.offsetWidth;return i<0&&(i=0),i>1&&(i=1),e.seek(i),Promise.resolve({status:"ok"})},e.seek=function(r,a){e.timer&&e.midiBuffer&&(e.timer.setProgress(r,a),e.midiBuffer.seek(r,a))},e.setWarp=function(r){if(parseInt(r,10)>0){e.warp=parseInt(r,10);var a=e.isStarted,i=e.percent;return e.destroy(),e.isStarted=!1,e.go().then(function(){return e.setProgress(i,e.midiBuffer.duration*1e3),e.control&&e.control.setWarp(e.currentTempo,e.warp),a?e.play().then(function(){return e.seek(i),Promise.resolve()}):(e.seek(i),Promise.resolve())})}return Promise.resolve()},e.onWarp=function(r){var a=r.target.value;return e.setWarp(a)},e.setProgress=function(r,a){e.percent=r,e.control&&e.control.setProgress(r,a)},e.finished=function(){if(e.timer.reset(),e.isLooping)return e.timer.start(0),e.midiBuffer.finished(),e.midiBuffer.start(),"continue";e.timer.stop(),e.isStarted&&(e.control&&e.control.pushPlay(!1),e.isStarted=!1,e.midiBuffer.finished(),e.cursorControl&&e.cursorControl.onFinished&&typeof e.cursorControl.onFinished=="function"&&e.cursorControl.onFinished(),e.setProgress(0,1))},e.beatCallback=function(r,a,i,n){var s=r/a;e.setProgress(s,i),e.cursorControl&&e.cursorControl.onBeat&&typeof e.cursorControl.onBeat=="function"&&e.cursorControl.onBeat(r,a,i,n)},e.eventCallback=function(r){if(r)e.cursorControl&&e.cursorControl.onEvent&&typeof e.cursorControl.onEvent=="function"&&e.cursorControl.onEvent(r);else return e.finished()},e.lineEndCallback=function(r,a){e.cursorControl&&e.cursorControl.onLineEnd&&typeof e.cursorControl.onLineEnd=="function"&&e.cursorControl.onLineEnd(r,a)},e.getUrl=function(){return e.midiBuffer.download()},e.download=function(r){var a=e.getUrl(),i=document.createElement("a");document.body.appendChild(i),i.setAttribute("style","display: none;"),i.href=a,i.download=r||"output.wav",i.click(),window.URL.revokeObjectURL(a),document.body.removeChild(i)}}var Qn=K2,Q2=Un,Jn;(function(){function e(u,l){for(var h in l)l.hasOwnProperty(h)&&u.setAttribute(h,l[h]);return u}function t(){this.trackstrings="",this.trackcount=0,this.noteOnAndChannel="%90",this.noteOffAndChannel="%80"}t.prototype.setTempo=function(u){this.trackcount===0&&(this.startTrack(),this.track+="%00%FF%51%03"+c(Math.round(6e7/u),6),this.endTrack())},t.prototype.setGlobalInfo=function(u,l,h,d){if(this.trackcount===0){this.startTrack();var p=Math.round(6e7/u);this.track+="%00%FF%51%03"+c(p,6),h&&(this.track+=i(h)),d&&(this.track+=n(d)),l&&(this.track+=a(l,"%01")),this.endTrack()}},t.prototype.startTrack=function(){this.noteWarped={},this.track="",this.trackName="",this.trackInstrument="",this.silencelength=0,this.trackcount++,this.instrument&&this.setInstrument(this.instrument)},t.prototype.endTrack=function(){this.track=this.trackName+this.trackInstrument+this.track;var u=c(this.track.length/3+4,8);this.track="MTrk"+u+this.track+"%00%FF%2F%00",this.trackstrings+=this.track},t.prototype.setText=function(u,l){switch(u){case"name":this.trackName=a(l,"%03");break}},t.prototype.setInstrument=function(u){this.trackInstrument="%00%C0"+c(u,2),this.instrument=u},t.prototype.setChannel=function(u,l){this.channel=u;var h="%00%B"+this.channel.toString(16);this.track+=h+"%79%00",this.track+=h+"%40%00",this.track+=h+"%5B%30",l||(l=0),l=Math.round((l+1)*64),this.track+=h+"%0A"+c(l,2),this.track+=h+"%07%64",this.noteOnAndChannel="%9"+this.channel.toString(16),this.noteOffAndChannel="%8"+this.channel.toString(16)};var r=4096;t.prototype.startNote=function(u,l,h){if(this.track+=f(this.silencelength),this.silencelength=0,h){this.track+="%e"+this.channel.toString(16);var d=Math.round(Q2(h)*r);this.track+=o(8192+d),this.track+=f(0),this.noteWarped[u]=!0}this.track+=this.noteOnAndChannel,this.track+="%"+u.toString(16)+c(l,2)},t.prototype.endNote=function(u){this.track+=f(this.silencelength),this.silencelength=0,this.noteWarped[u]&&(this.track+="%e"+this.channel.toString(16),this.track+=o(8192),this.track+=f(0),this.noteWarped[u]=!1),this.track+=this.noteOffAndChannel,this.track+="%"+u.toString(16)+"%00"},t.prototype.addRest=function(u){this.silencelength+=u,this.silencelength<0&&(this.silencelength=0)},t.prototype.getData=function(){return"data:audio/midi,MThd%00%00%00%06%00%01"+c(this.trackcount,4)+"%01%e0"+this.trackstrings},t.prototype.embed=function(u,l){var h=this.getData(),d=e(document.createElement("a"),{href:h});if(d.innerHTML="download midi",u.insertBefore(d,u.firstChild),!l){var p=e(document.createElement("embed"),{src:h,type:"video/quicktime",controller:"true",autoplay:"false",loop:"false",enablejavascript:"true",style:"display:block; height: 20px;"});u.insertBefore(p,u.firstChild)}};function a(u,l){for(var h="",d=0;d<u.length;d++)h+=c(u.charCodeAt(d),2);return"%00%FF"+l+c(h.length/3,2)+h}function i(u){if(!u||!u.accidentals)return"";for(var l="%00%FF%59%02",h=0,d=256,p=0;p<u.accidentals.length;p++)u.accidentals[p].acc==="sharp"?h++:u.accidentals[p].acc==="flat"&&d--;var g=c(d!==256?d:h,2),v=u.mode==="m"?"%01":"%00";return l+g+v}function n(u){var l="%00%FF%58%04"+c(u.num,2),h={1:0,2:1,4:2,8:3,16:4,32:5},d=h[u.den];if(!d)return"";l+=c(d,2);var p;switch(u.num+"/"+u.den){case"2/4":case"3/4":case"4/4":case"5/4":p=24;break;case"6/4":p=72;break;case"2/2":case"3/2":case"4/2":p=48;break;case"3/8":case"6/8":case"9/8":case"12/8":p=36;break}return p?(l+=c(p,2),l+"%08"):""}function s(u){for(var l="",h=0;h<u.length;h+=2)l+="%",l+=u.substr(h,2);return l}function c(u,l){var h=u.toString(16);for(h=h.split(".")[0];h.length<l;)h="0"+h;return h.length>l&&(h=h.substring(0,l)),s(h)}function o(u){u=Math.round(u);var l=u%128,h=u-l;return c(h*2+l,4)}function f(u){var l=0,h=[];for(u=Math.round(u);u!==0;)h.push(u&127),u=u>>7;for(var d=h.length-1;d>=0;d--){l=l<<8;var p=h[d];d!==0&&(p=p|128),l=l|p}var g=l.toString(16).length;return g+=g%2,c(l,g)}Jn=function(){return new t}})();var Zn=Jn,J2=Zn,es;(function(){var e=1920;es=function(a,i){i===void 0&&(i={});var n=a.setUpAudio(i),s=J2(),c=a.metaText?a.metaText.title:void 0;c&&c.length>128&&(c=c.substring(0,124)+"...");var o=a.getKeySignature(),f=a.getMeterFraction(),u=n.tempo,l=u/60;if(f.den===8&&f.num!==5&&f.num!==7){var h=a.millisecondsPerMeasure();u=6e4/(h/f.num)/2,l=u/60}s.setGlobalInfo(u,c,o,f);for(var d=0;d<n.tracks.length;d++){s.startTrack();for(var p={},g=0;g<n.tracks[d].length;g++){var v=n.tracks[d][g];switch(v.cmd){case"text":s.setText(v.type,v.text);break;case"program":var m=0;i.pan&&i.pan.length>d&&(m=i.pan[d]),v.instrument===128?(s.setChannel(9,m),s.setInstrument(0)):(s.setChannel(v.channel,m),s.setInstrument(v.instrument));break;case"note":var y=v.gap*l,x=v.start,b=x+v.duration-y;p[x]||(p[x]=[]),p[x].push({pitch:v.pitch,volume:v.volume,cents:v.cents}),p[b]||(p[b]=[]),p[b].push({pitch:v.pitch,volume:0});break;default:console.log("MIDI create Unknown: "+v.cmd)}}t(s,p,e),s.endTrack()}return s.getData()};function t(r,a,i){for(var n=Object.keys(a),s=0;s<n.length;s++)n[s]=parseFloat(n[s]);n.sort(function(d,p){return d-p});for(var c=0,o=0;o<n.length;o++){var f=a[n[o]];if(n[o]>c){var u=(n[o]-c)*i;r.addRest(u),c=n[o]}for(var l=0;l<f.length;l++){var h=f[l];h.volume?r.startNote(h.pitch,h.volume,h.cents):r.endNote(h.pitch)}}}})();var Z2=es,e3=tr,t3=Z2,r3=function(e,t){var r={};if(t)for(var a in t)t.hasOwnProperty(a)&&(r[a]=t[a]);r.generateInline=!1;function i(n,s,c){var o=t3(s,r);switch(r.midiOutputType){case"encoded":return o;case"binary":var f=o.replace("data:audio/midi,","");f=f.replace(/MThd/g,"%4d%54%68%64"),f=f.replace(/MTrk/g,"%4d%54%72%6b");for(var u=new ArrayBuffer(f.length/3),l=new Uint8Array(u),h=0;h<f.length/3;h++){var d=h*3+1,p=parseInt(f.substring(d,d+2),16);l[h]=p}return l;case"link":default:return i3(s,r,o,c)}}return typeof e=="string"?e3.renderEngine(i,"*",e,r):i(null,e,0)};function a3(e){var t={};return e&&t.toString.call(e)==="[object Function]"}var i3=function(e,t,r,a){var i=["abcjs-download-midi","abcjs-midi-"+a];t.downloadClass&&i.push(t.downloadClass);var n='<div class="'+i.join(" ")+'">';t.preTextDownload&&(n+=t.preTextDownload);var s=e.metaText&&e.metaText.title?e.metaText.title:"Untitled",c;t.downloadLabel&&a3(t.downloadLabel)?c=t.downloadLabel(e,a):t.downloadLabel?c=t.downloadLabel.replace(/%T/,s):c='Download MIDI for "'+s+'"',s=s.toLowerCase().replace(/'/g,"").replace(/\W/g,"_").replace(/__/g,"_");var o=t.fileName?t.fileName:s+".midi";return n+='<a download="'+o+'" href="'+r+'">'+c+"</a>",t.postTextDownload&&(n+=t.postTextDownload),n+"</div>"},n3=r3;try{if(typeof window.CustomEvent!="function"){var Oi=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var r=document.createEvent("CustomEvent");return r.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r};Oi.prototype=window.Event.prototype,window.CustomEvent=Oi}}catch{}var wt=function(e){this.isEditArea=!0,typeof e=="string"?(this.textarea=document.getElementById(e),this.textarea||(this.textarea=document.querySelector(e))):this.textarea=e,this.initialText=this.textarea.value,this.isDragging=!1};wt.prototype.addSelectionListener=function(e){this.textarea.onmousemove=function(t){this.isDragging&&e.fireSelectionChanged()}};wt.prototype.addChangeListener=function(e){this.changelistener=e,this.textarea.onkeyup=function(){e.fireChanged()},this.textarea.onmousedown=function(){this.isDragging=!0,e.fireSelectionChanged()},this.textarea.onmouseup=function(){this.isDragging=!1,e.fireChanged()},this.textarea.onchange=function(){e.fireChanged()}};wt.prototype.getSelection=function(){return{start:this.textarea.selectionStart,end:this.textarea.selectionEnd}};wt.prototype.setSelection=function(e,t){if(this.textarea.setSelectionRange)this.textarea.setSelectionRange(e,t);else if(this.textarea.createTextRange){var r=this.textarea.createTextRange();r.collapse(!0),r.moveEnd("character",t),r.moveStart("character",e),r.select()}this.textarea.focus()};wt.prototype.getString=function(){return this.textarea.value};wt.prototype.setString=function(e){this.textarea.value=e,this.initialText=this.getString(),this.changelistener&&this.changelistener.fireChanged()};wt.prototype.getElem=function(){return this.textarea};var ts=wt,rs=rt,s3=Qn,c3=cr,o3=Xn,Hi=ts;function l3(e){var t={},r;if(e.abcjsParams)for(r in e.abcjsParams)e.abcjsParams.hasOwnProperty(r)&&(t[r]=e.abcjsParams[r]);if(e.midi_options)for(r in e.midi_options)e.midi_options.hasOwnProperty(r)&&(t[r]=e.midi_options[r]);if(e.parser_options)for(r in e.parser_options)e.parser_options.hasOwnProperty(r)&&(t[r]=e.parser_options[r]);if(e.render_options)for(r in e.render_options)e.render_options.hasOwnProperty(r)&&(t[r]=e.render_options[r]);return t.tablature&&e.warnings_id&&(t.tablature.warnings_id=e.warnings_id),t}var xe=function(e,t){this.abcjsParams=l3(t),t.indicate_changed&&(this.indicate_changed=!0),typeof e=="string"?this.editarea=new Hi(e):e.isEditArea?this.editarea=e:this.editarea=new Hi(e),this.editarea.addSelectionListener(this),this.editarea.addChangeListener(this),t.canvas_id?this.div=t.canvas_id:t.paper_id?this.div=t.paper_id:(this.div=document.createElement("DIV"),this.editarea.getElem().parentNode.insertBefore(this.div,this.editarea.getElem())),typeof this.div=="string"&&(this.div=document.getElementById(this.div)),t.selectionChangeCallback&&(this.selectionChangeCallback=t.selectionChangeCallback),this.clientClickListener=this.abcjsParams.clickListener,this.abcjsParams.clickListener=this.highlight.bind(this),t.synth&&c3()&&(this.synth={el:t.synth.el,cursorControl:t.synth.cursorControl,options:t.synth.options}),t.generate_midi&&(this.generate_midi=t.generate_midi,this.abcjsParams.generateDownload&&(typeof t.midi_download_id=="string"?this.downloadMidi=document.getElementById(t.midi_download_id):t.midi_download_id&&(this.downloadMidi=t.midi_download_id)),this.abcjsParams.generateInline!==!1&&(typeof t.midi_id=="string"?this.inlineMidi=document.getElementById(t.midi_id):t.midi_id&&(this.inlineMidi=t.midi_id))),t.warnings_id?typeof t.warnings_id=="string"?this.warningsdiv=document.getElementById(t.warnings_id):this.warningsdiv=t.warnings_id:t.generate_warnings&&(this.warningsdiv=document.createElement("div"),this.div.parentNode.insertBefore(this.warningsdiv,this.div)),this.onchangeCallback=t.onchange,this.redrawCallback=t.redrawCallback,this.currentAbc="",this.tunes=[],this.bReentry=!1,this.parseABC(),this.modelChanged(),this.addClassName=function(r,a){var i=function(n,s){var c=n.className;return c.length>0&&(c===s||new RegExp("(^|\\s)"+s+"(\\s|$)").test(c))};return i(r,a)||(r.className+=(r.className?" ":"")+a),r},this.removeClassName=function(r,a){return r.className=rs.strip(r.className.replace(new RegExp("(^|\\s+)"+a+"(\\s+|$)")," ")),r},this.setReadOnly=function(r){var a="abc_textarea_readonly",i=this.editarea.getElem();r?(i.setAttribute("readonly","yes"),this.addClassName(i,a)):(i.removeAttribute("readonly"),this.removeClassName(i,a))}};xe.prototype.redrawMidi=function(){if(this.generate_midi&&!this.midiPause){var e=new window.CustomEvent("generateMidi",{detail:{tunes:this.tunes,abcjsParams:this.abcjsParams,downloadMidiEl:this.downloadMidi,inlineMidiEl:this.inlineMidi,engravingEl:this.div}});window.dispatchEvent(e)}if(this.synth){var t=this.synth.synthControl;this.synth.synthControl||(this.synth.synthControl=new s3,this.synth.synthControl.load(this.synth.el,this.synth.cursorControl,this.synth.options)),this.synth.synthControl.setTune(this.tunes[0],t,this.synth.options)}};xe.prototype.modelChanged=function(){if(!this.bReentry){this.bReentry=!0;try{this.timerId=null,this.redrawCallback&&this.redrawCallback(!0),this.synth&&this.synth.synthControl&&this.synth.synthControl.disable(!0),this.tunes=o3(this.div,this.currentAbc,this.abcjsParams),this.tunes.length>0&&(this.warnings=this.tunes[0].warnings),this.redrawMidi(),this.redrawCallback&&this.redrawCallback(!1)}catch(e){console.error("ABCJS error: ",e),this.warnings||(this.warnings=[]),this.warnings.push(e.message)}this.warningsdiv&&(this.warningsdiv.innerHTML=this.warnings?this.warnings.join("<br />"):"No errors"),this.updateSelection(),this.bReentry=!1}};xe.prototype.paramChanged=function(e){if(e)for(var t in e)e.hasOwnProperty(t)&&(this.abcjsParams[t]=e[t]);this.currentAbc="",this.fireChanged()};xe.prototype.getTunes=function(){return this.tunes};xe.prototype.synthParamChanged=function(e){if(this.synth){if(this.synth.options={},e)for(var t in e)e.hasOwnProperty(t)&&(this.synth.options[t]=e[t]);this.currentAbc="",this.fireChanged()}};xe.prototype.parseABC=function(){var e=this.editarea.getString();return e===this.currentAbc?(this.updateSelection(),!1):(this.currentAbc=e,!0)};xe.prototype.updateSelection=function(){var e=this.editarea.getSelection();try{this.tunes.length>0&&this.tunes[0].engraver&&this.tunes[0].engraver.rangeHighlight(e.start,e.end)}catch{}this.selectionChangeCallback&&this.selectionChangeCallback(e.start,e.end)};xe.prototype.fireSelectionChanged=function(){this.updateSelection()};xe.prototype.setDirtyStyle=function(e){if(this.indicate_changed!==void 0){var t=function(n,s){var c=function(o,f){var u=o.className;return u.length>0&&(u===f||new RegExp("(^|\\s)"+f+"(\\s|$)").test(u))};return c(n,s)||(n.className+=(n.className?" ":"")+s),n},r=function(n,s){return n.className=rs.strip(n.className.replace(new RegExp("(^|\\s+)"+s+"(\\s+|$)")," ")),n},a="abc_textarea_dirty",i=this.editarea.getElem();e?t(i,a):r(i,a)}};xe.prototype.fireChanged=function(){if(!this.bIsPaused&&this.parseABC()){var e=this;this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout(function(){e.modelChanged()},300);var t=this.isDirty();this.wasDirty!==t&&(this.wasDirty=t,this.setDirtyStyle(t)),this.onchangeCallback&&this.onchangeCallback(this)}};xe.prototype.setNotDirty=function(){this.editarea.initialText=this.editarea.getString(),this.wasDirty=!1,this.setDirtyStyle(!1)};xe.prototype.isDirty=function(){return this.indicate_changed===void 0?!1:this.editarea.initialText!==this.editarea.getString()};xe.prototype.highlight=function(e,t,r,a,i,n){this.editarea.setSelection(e.startChar,e.endChar),this.selectionChangeCallback&&this.selectionChangeCallback(e.startChar,e.endChar),this.clientClickListener&&this.clientClickListener(e,t,r,a,i,n)};xe.prototype.pause=function(e){this.bIsPaused=e,e||this.fireChanged()};xe.prototype.millisecondsPerMeasure=function(){return!this.synth||!this.synth.synthControl||!this.synth.synthControl.visualObj?0:this.synth.synthControl.visualObj.millisecondsPerMeasure()};xe.prototype.pauseMidi=function(e){this.midiPause=e,e||this.redrawMidi()};var h3=xe,f3=ls,zi=ds,$i=tr,u3=Ki,d3=v1,Re={};Re.signature="abcjs-basic v"+f3;Object.keys(zi).forEach(function(e){Re[e]=zi[e]});Object.keys($i).forEach(function(e){Re[e]=$i[e]});Re.renderAbc=Xn;Re.tuneMetrics=Wd;Re.TimingCallbacks=$r;var p3=mt;Re.setGlyph=p3.setSymbol;Re.strTranspose=d3;var v3=la,g3=ca,b3=oa,m3=Vn,y3=Kn,w3=sr,x3=r0,C3=cr,k3=X2,_3=Qn,T3=n3,E3=Zn;Re.synth={CreateSynth:v3,instrumentIndexToName:g3,pitchToNoteName:b3,SynthController:_3,SynthSequence:m3,CreateSynthControl:y3,registerAudioContext:w3,activeAudioContext:x3,supportsAudio:C3,playEvent:k3,getMidiFile:T3,sequence:u3,midiRenderer:E3};Re.Editor=h3;Re.EditArea=ts;var as=Re;const S3=ss(as),A3=cs({__proto__:null,default:S3},[as]);export{A3 as i};