vexflow 5.1.0 → 5.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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * VexFlow 5.1.0 2026-11-16T01:20:16.794Z c552e8f8b6d099052699892f82b34dc2688cb95b
2
+ * VexFlow 5.1.2 2026-11-16T14:50:27.719Z 419436ad3c5fb5efeb2590a6a88b2a403cbdae64
3
3
  * Copyright (c) 2023-present VexFlow contributors (see https://github.com/vexflow/vexflow/blob/main/AUTHORS.md).
4
4
  */
5
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VexFlow=e():t.VexFlow=e()}("undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:this,()=>(()=>{"use strict";const t={d:(e,i)=>{if(Array.isArray(i))for(var s=0;s<i.length;){var n=i[s++],a=i[s++];t.o(e,n)?0===a&&s++:0===a?Object.defineProperty(e,n,{enumerable:!0,value:i[s++]}):Object.defineProperty(e,n,{enumerable:!0,get:a})}else for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let e={};function i(t,e,i=!0){if("object"!=typeof t||null===t)return!1;let s=t.constructor;if(i){for(;null!==t;){if(s=t.constructor,"CATEGORY"in s&&s.CATEGORY===e)return!0;t=Object.getPrototypeOf(t)}return!1}return"CATEGORY"in s&&s.CATEGORY===e}t.d(e,{default:()=>Li});const s=t=>i(t,l.Annotation),n=t=>i(t,l.Barline),a=t=>i(t,l.GraceNote),o=t=>i(t,l.Note),r=t=>i(t,l.StaveNote),h=t=>i(t,l.StemmableNote),c=t=>i(t,l.TabNote);var l;!function(t){t.Accidental="Accidental",t.Annotation="Annotation",t.Articulation="Articulation",t.Barline="Barline",t.BarNote="BarNote",t.Beam="Beam",t.Bend="Bend",t.ChordSymbol="ChordSymbol",t.Clef="Clef",t.ClefNote="ClefNote",t.Crescendo="Crescendo",t.Curve="Curve",t.Dot="Dot",t.Element="Element",t.Flag="Flag",t.Fraction="Fraction",t.FretHandFinger="FretHandFinger",t.GhostNote="GhostNote",t.Glyph="Glyph",t.GlyphNote="GlyphNote",t.GraceNote="GraceNote",t.GraceNoteGroup="GraceNoteGroup",t.GraceTabNote="GraceTabNote",t.KeySignature="KeySignature",t.KeySigNote="KeySigNote",t.Modifier="Modifier",t.MultiMeasureRest="MultiMeasureRest",t.Note="Note",t.NoteHead="NoteHead",t.NoteSubGroup="NoteSubGroup",t.Ornament="Ornament",t.Parenthesis="Parenthesis",t.PedalMarking="PedalMarking",t.RenderContext="RenderContext",t.RepeatNote="RepeatNote",t.Repetition="Repetition",t.Stave="Stave",t.StaveConnector="StaveConnector",t.StaveHairpin="StaveHairpin",t.StaveLine="StaveLine",t.StaveModifier="StaveModifier",t.StaveNote="StaveNote",t.StaveSection="StaveSection",t.StaveTempo="StaveTempo",t.StaveText="StaveText",t.StaveTie="StaveTie",t.Stem="Stem",t.StemmableNote="StemmableNote",t.StringNumber="StringNumber",t.Stroke="Stroke",t.System="System",t.TabNote="TabNote",t.TabSlide="TabSlide",t.TabStave="TabStave",t.TabTie="TabTie",t.TextBracket="TextBracket",t.TextDynamics="TextDynamics",t.TextNote="TextNote",t.Tickable="Tickable",t.TimeSignature="TimeSignature",t.TimeSigNote="TimeSigNote",t.Tremolo="Tremolo",t.Tuplet="Tuplet",t.Vibrato="Vibrato",t.VibratoBracket="VibratoBracket",t.Voice="Voice",t.Volta="Volta"}(l||(l={}));const d="object"==typeof self?self:globalThis,u=t=>((t,e)=>{const i=(e,i)=>(t.set(i,e),e),s=n=>{if(t.has(n))return t.get(n);const[a,o]=e[n];switch(a){case 0:case-1:return i(o,n);case 1:{const t=i([],n);for(const e of o)t.push(s(e));return t}case 2:{const t=i({},n);for(const[e,i]of o)t[s(e)]=s(i);return t}case 3:return i(new Date(o),n);case 4:{const{source:t,flags:e}=o;return i(new RegExp(t,e),n)}case 5:{const t=i(new Map,n);for(const[e,i]of o)t.set(s(e),s(i));return t}case 6:{const t=i(new Set,n);for(const e of o)t.add(s(e));return t}case 7:{const{name:t,message:e}=o;return i(new d[t](e),n)}case 8:return i(BigInt(o),n);case"BigInt":return i(Object(BigInt(o)),n)}return i(new d[a](o),n)};return s})(new Map,t)(0),g="",{toString:p}={},{keys:m}=Object,f=t=>{const e=typeof t;if("object"!==e||!t)return[0,e];const i=p.call(t).slice(8,-1);switch(i){case"Array":return[1,g];case"Object":return[2,g];case"Date":return[3,g];case"RegExp":return[4,g];case"Map":return[5,g];case"Set":return[6,g]}return i.includes("Array")?[1,i]:i.includes("Error")?[7,i]:[2,i]},S=([t,e])=>0===t&&("function"===e||"symbol"===e),T=(t,{json:e,lossy:i}={})=>{const s=[];return((t,e,i,s)=>{const n=(t,e)=>{const n=s.push(t)-1;return i.set(e,n),n},a=s=>{if(i.has(s))return i.get(s);let[o,r]=f(s);switch(o){case 0:{let e=s;switch(r){case"bigint":o=8,e=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+r);e=null;break;case"undefined":return n([-1],s)}return n([o,e],s)}case 1:{if(r)return n([r,[...s]],s);const t=[],e=n([o,t],s);for(const e of s)t.push(a(e));return e}case 2:{if(r)switch(r){case"BigInt":return n([r,s.toString()],s);case"Boolean":case"Number":case"String":return n([r,s.valueOf()],s)}if(e&&"toJSON"in s)return a(s.toJSON());const i=[],h=n([o,i],s);for(const e of m(s))!t&&S(f(s[e]))||i.push([a(e),a(s[e])]);return h}case 3:return n([o,s.toISOString()],s);case 4:{const{source:t,flags:e}=s;return n([o,{source:t,flags:e}],s)}case 5:{const e=[],i=n([o,e],s);for(const[i,n]of s)(t||!S(f(i))&&!S(f(n)))&&e.push([a(i),a(n)]);return i}case 6:{const e=[],i=n([o,e],s);for(const i of s)!t&&S(f(i))||e.push(a(i));return i}}const{message:h}=s;return n([o,{name:r,message:h}],s)};return a})(!(e||i),!!e,new Map,s)(t),s},x="function"==typeof structuredClone?(t,e)=>e&&("json"in e||"lossy"in e)?u(T(t,e)):structuredClone(t):(t,e)=>u(T(t,e)),{parse:w,stringify:b}=JSON,y=x;class C extends Error{constructor(t,e=""){super("[RuntimeError] "+t+": "+e),this.code=t}}function k(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t.g?t.g:Function("return this")()}function v(t,e="undefined",i=""){if(void 0===t)throw new C(e,i);return t}function B(t,...e){if(!e)return;const i=Array.prototype.slice.call(e).join(" ");k().console.log(t+": "+i)}function D(t,e){let i=e+(t-e)/2;var s,n;return i%2>0&&(i=((s=10*i)%(n=5)>=n/2?parseInt(""+s/n,10)*n+n:parseInt(""+s/n,10)*n)/10),i}function L(t){return`vf-${t}`}function E(t){return(t%=2*Math.PI)<0&&(t+=2*Math.PI),t}function N(t){return t.reduce((t,e)=>t+e,0)}class F{static get CATEGORY(){return l.Fraction}static GCD(t,e){if(!Number.isFinite(t)||!Number.isFinite(e))throw new C("BadArgument",`Invalid numbers: ${t}, ${e}`);let i;for(;0!==e;)i=e,e=t%e,t=i;return t}static LCM(t,e){return t*e/F.GCD(t,e)}static LCMM(t){return 0===t.length?0:1===t.length?t[0]:2===t.length?F.LCM(t[0],t[1]):F.LCM(t.shift(),F.LCMM(t))}constructor(t,e){this.numerator=1,this.denominator=1,this.set(t,e)}set(t=1,e=1){if(!Number.isFinite(t)||!Number.isFinite(e)||0===e)throw new C("BadArgument",`Invalid fraction: ${t}/${e}`);return this.numerator=t,this.denominator=e,this}value(){return this.numerator/this.denominator}simplify(){let t=this.numerator,e=this.denominator;const i=F.GCD(t,e);return t/=i,e/=i,e<0&&(e=-e,t=-t),this.set(t,e)}add(t=0,e=1){const[i,s]=A(t,e),n=F.LCM(this.denominator,s),a=n/this.denominator,o=n/s,r=this.numerator*a+i*o;return this.set(r,n)}subtract(t=0,e=1){const[i,s]=A(t,e),n=F.LCM(this.denominator,s),a=n/this.denominator,o=n/s,r=this.numerator*a-i*o;return this.set(r,n)}multiply(t=1,e=1){const[i,s]=A(t,e);return this.set(this.numerator*i,this.denominator*s)}divide(t=1,e=1){const[i,s]=A(t,e);return this.set(this.numerator*s,this.denominator*i)}equals(t){const e=F.fractionA.copy(t).simplify(),i=F.fractionB.copy(this).simplify();return e.numerator===i.numerator&&e.denominator===i.denominator}greaterThan(t){const e=F.fractionA.copy(this);return e.subtract(t),e.numerator>0}greaterThanEquals(t){const e=F.fractionA.copy(this);return e.subtract(t),e.numerator>=0}lessThan(t){return!this.greaterThanEquals(t)}lessThanEquals(t){return!this.greaterThan(t)}clone(){return new F(this.numerator,this.denominator)}copy(t){return"number"==typeof t?this.set(t):this.set(t.numerator,t.denominator)}quotient(){return Math.floor(this.numerator/this.denominator)}remainder(){return this.numerator%this.denominator}makeAbs(){return this.denominator=Math.abs(this.denominator),this.numerator=Math.abs(this.numerator),this}toString(){return`${this.numerator}/${this.denominator}`}toSimplifiedString(){return F.fractionA.copy(this).simplify().toString()}toMixedString(){let t="";const e=this.quotient(),i=F.fractionA.copy(this);return e<0&&i.makeAbs(),0!==e?(t+=e,0!==i.numerator&&(t+=` ${i.toSimplifiedString()}`)):t=0===i.numerator?"0":i.toSimplifiedString(),t}parse(t){const e=t.split("/"),i=parseInt(e[0],10),s=e[1]?parseInt(e[1],10):1;return this.set(i,s)}}function A(t,e=1){return"number"==typeof t?[t,e]:[t.numerator,t.denominator]}F.fractionA=new F,F.fractionB=new F;class O{static clear(t){t?(this.cacheFont.delete(t),this.cacheStyle.delete(t)):(this.cacheFont.clear(),this.cacheStyle.clear())}static getFontInfo(t){let e=this.cacheFont.get(t);return e||(e={family:O.getFontFamily(t),size:O.get(`${t}.fontSize`)*O.get(`${t}.fontScale`),weight:O.get(`${t}.fontWeight`),style:O.get(`${t}.fontStyle`)},this.cacheFont.set(t,e)),y(e)}static getFontFamily(t){var e;if(!O.get(`${t}.isText`,!1))return O.get(`${t}.fontFamily`);let i=R.textFontFamily,s=R;for(const n of t.split(".")){if(s=null==s?void 0:s[n],!s)break;i=null!==(e=s.fontFamily)&&void 0!==e?e:i}return i}static getStyle(t){let e=this.cacheStyle.get(t);return e||(e={fillStyle:O.get(`${t}.fillStyle`),strokeStyle:O.get(`${t}.strokeStyle`),lineWidth:O.get(`${t}.lineWidth`),lineDash:O.get(`${t}.lineDash`),shadowBlur:O.get(`${t}.shadowBlur`),shadowColor:O.get(`${t}.shadowColor`)},this.cacheStyle.set(t,e)),y(e)}static get(t,e){var i;const s=t.split("."),n=s.pop();let a=R,o=e;for(;a;){o=null!==(i=a[n])&&void 0!==i?i:o;const t=s.shift();if(!t)break;a=a[t]}return o}}O.cacheStyle=new Map,O.cacheFont=new Map;const R={pointerRect:!1,fontFamily:"Bravura,Academico",textFontFamily:"Academico,Bravura",fontSize:30,fontScale:1,fontWeight:"normal",fontStyle:"normal",Accidental:{cautionary:{fontSize:20},grace:{fontSize:20},noteheadAccidentalPadding:1,leftPadding:2,accidentalSpacing:3},Annotation:{isText:!0,fontSize:10},Bend:{isText:!0,fontSize:10,line:{strokeStyle:"#777777",lineWidth:1}},ChordSymbol:{isText:!0,fontSize:12,spacing:.05,subscriptOffset:.2,superscriptOffset:-.4,superSubRatio:.6},FretHandFinger:{isText:!0,fontSize:9,fontWeight:"bold"},GraceNote:{fontScale:2/3},GraceTabNote:{fontScale:2/3},NoteHead:{minPadding:2},PedalMarking:{text:{isText:!0,fontSize:12,fontStyle:"italic"}},Repetition:{text:{isText:!0,fontSize:12,fontWeight:"bold",offsetX:12,offsetY:25,spacing:5},coda:{offsetY:25},segno:{offsetY:10}},Stave:{isText:!0,strokeStyle:"#999999",fontSize:8,padding:12,endPaddingMax:10,endPaddingMin:5,unalignedNotePadding:10},StaveConnector:{text:{isText:!0,fontSize:16}},StaveLine:{isText:!0,fontSize:10},StaveNote:{pointerRect:!0},StaveSection:{isText:!0,fontSize:10,fontWeight:"bold",lineWidth:2,padding:2,strokeStyle:"black"},StaveTempo:{isText:!0,fontSize:14,glyph:{isText:!1,fontSize:25},name:{fontWeight:"bold"}},StaveText:{isText:!0,fontSize:16},StaveTie:{isText:!0,fontSize:10},Stem:{strokeStyle:"black"},StringNumber:{isText:!0,fontSize:10,fontWeight:"bold",verticalPadding:8,stemPadding:2,leftPadding:5,rightPadding:6},Stroke:{text:{isText:!0,fontSize:10,fontStyle:"italic",fontWeight:"bold"}},TabNote:{text:{isText:!0,fontSize:9}},TabSlide:{isText:!0,fontSize:10,fontStyle:"italic",fontWeight:"bold"},TabStave:{isText:!0,strokeStyle:"#999999",fontSize:8},TabTie:{isText:!0,fontSize:10},TextBracket:{isText:!0,fontSize:15,fontStyle:"italic"},TextNote:{text:{isText:!0,fontSize:12}},Tremolo:{spacing:7},Tuplet:{pointerRect:!0,yOffset:0,textYOffset:2,bracket:{padding:5,lineWidth:1,legLength:10},suffix:{fontScale:.5,extraSpacing:1,suffixOffsetY:-3}},Volta:{isText:!0,fontSize:9,fontWeight:"bold"}};class P{static copy(t){return new P(t.x,t.y,t.w,t.h)}constructor(t,e,i,s){this.x=t,this.y=e,this.w=i,this.h=s}getX(){return this.x}getY(){return this.y}getW(){return this.w}getH(){return this.h}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setW(t){return this.w=t,this}setH(t){return this.h=t,this}move(t,e){return this.x+=t,this.y+=e,this}clone(){return P.copy(this)}mergeWith(t){const e=t,i=this.x<e.x?this.x:e.x,s=this.y<e.y?this.y:e.y,n=Math.max(this.x+this.w,e.x+e.w)-i,a=Math.max(this.y+this.h,e.y+e.h)-s;return this.x=i,this.y=s,this.w=n,this.h=a,this}}var M,I,H=function(t,e,i,s){return new(i||(i=Promise))(function(n,a){function o(t){try{h(s.next(t))}catch(t){a(t)}}function r(t){try{h(s.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(o,r)}h((s=s.apply(t,e||[])).next())})};let W;!function(t){t.NORMAL="normal",t.BOLD="bold"}(M||(M={})),function(t){t.NORMAL="normal",t.ITALIC="italic"}(I||(I={}));class G{static convertSizeToPixelValue(t){var e;if("number"==typeof t)return t*G.scaleToPxFrom.pt;{const i=parseFloat(t);if(isNaN(i))return 0;const s=t.replace(/[\d.\s]/g,"").toLowerCase();return i*(null!==(e=G.scaleToPxFrom[s])&&void 0!==e?e:1)}}static convertSizeToPointValue(t){var e;if("number"==typeof t)return t;{const i=parseFloat(t);if(isNaN(i))return 0;const s=t.replace(/[\d.\s]/g,"").toLowerCase();return i*((null!==(e=G.scaleToPxFrom[s])&&void 0!==e?e:1)/G.scaleToPxFrom.pt)}}static validate(t,e,i,s){if("string"==typeof t&&void 0===e&&void 0===i&&void 0===s)return G.fromCSSString(t);let n;return"object"==typeof t?(n=t.family,e=t.size,i=t.weight,s=t.style):n=t,n=null!=n?n:O.get("fontFamily"),e=null!=e?e:O.get("fontSize")+"pt",i=null!=i?i:M.NORMAL,s=null!=s?s:I.NORMAL,""===i&&(i=M.NORMAL),""===s&&(s=I.NORMAL),"number"==typeof e&&(e=`${e}pt`),"number"==typeof i&&(i=i.toString()),{family:n,size:e,weight:i,style:s}}static fromCSSString(t){W||(W=document.createElement("span")),W.style.font=t;const{fontFamily:e,fontSize:i,fontWeight:s,fontStyle:n}=W.style;return{family:e,size:i,weight:s,style:n}}static toCSSString(t){var e;if(!t)return"";let i;const s=t.style;let n;i=s===I.NORMAL||""===s||void 0===s?"":s.trim()+" ";const a=t.weight;let o;n=a===M.NORMAL||""===a||void 0===a?"":"number"==typeof a?a+" ":a.trim()+" ";const r=t.size;o=void 0===r?O.get("fontSize")+"pt":"number"==typeof r?r+"pt ":r.trim()+" ";return`${i}${n}${o}${null!==(e=t.family)&&void 0!==e?e:O.get("fontFamily")}`}static scaleSize(t,e){if("number"==typeof t)return t*e;return`${parseFloat(t)*e}${t.replace(/[\d.\s]/g,"")}`}static isBold(t){if(t){if("number"==typeof t)return t>=600;{const e=parseInt(t,10);return isNaN(e)?"bold"===t.toLowerCase():e>=600}}return!1}static isItalic(t){return!!t&&t.toLowerCase()===I.ITALIC}static load(t,e,i){return H(this,void 0,void 0,function*(){if("undefined"==typeof FontFace)return Promise.reject(new Error("FontFace API is not available in this environment. Cannot load fonts."));if(void 0===e){const i=G.FILES;if(!(t in i))return Promise.reject(new Error(`Font ${t} not found in Font.FILES`));e=G.HOST_URL+i[t]}const s=new FontFace(t,`url(${e})`,i),n=s.load();let a;return"undefined"!=typeof document?a=document.fonts:"undefined"!=typeof self&&"fonts"in self&&(a=self.fonts),null==a||a.add(s),n})}static getURLForFont(t){const e=G.FILES;if(t in e)return G.HOST_URL+e[t]}}G.TEXT_FONT_NAMES=["Academico","Edwin","Bravura Text","Finale Ash Text","Finale Broadway Text","Finale Jazz Text","Finale Maestro Text","Gootville Text","Leland Text","MuseJazz Text","Nepomuk","Petaluma Script","Petaluma Text","Roboto Slab","Sebastian Text"],G.scaleToPxFrom={pt:4/3,px:1,em:16,"%":.16,in:96,mm:96/25.4,cm:96/2.54},G.HOST_URL="https://cdn.jsdelivr.net/npm/@vexflow-fonts/",G.FILES={Academico:"academico/academico.woff2",Bravura:"bravura/bravura.woff2","Bravura Text":"bravuratext/bravuratext.woff2",Edwin:"edwin/edwin-roman.woff2","Finale Ash":"finaleash/finaleash.woff2","Finale Ash Text":"finaleashtext/finaleashtext.woff2","Finale Broadway":"finalebroadway/finalebroadway.woff2","Finale Broadway Text":"finalebroadwaytext/finalebroadwaytext.woff2","Finale Jazz":"finalejazz/finalejazz.woff2","Finale Jazz Text":"finalejazztext/finalejazztext.woff2","Finale Maestro":"finalemaestro/finalemaestro.woff2","Finale Maestro Text":"finalemaestrotext/finalemaestrotext-regular.woff2",Gonville:"gonville/gonville.woff2",Gootville:"gootville/gootville.woff2","Gootville Text":"gootvilletext/gootvilletext.woff2",Leipzig:"leipzig/leipzig.woff2",Leland:"leland/leland.woff2","Leland Text":"lelandtext/lelandtext.woff2",MuseJazz:"musejazz/musejazz.woff2","MuseJazz Text":"musejazztext/musejazztext.woff2",Nepomuk:"nepomuk/nepomuk.woff2",Petaluma:"petaluma/petaluma.woff2","Petaluma Script":"petalumascript/petalumascript.woff2","Petaluma Text":"petalumatext/petalumatext.woff2","Roboto Slab":"robotoslab/robotoslab-regular-400.woff2",Sebastian:"sebastian/sebastian.woff2","Sebastian Text":"sebastiantext/sebastiantext.woff2"};class U{constructor(){this.id=Object.create(null),this.type=Object.create(null),this.class=Object.create(null)}static isValidName(t){return"id"===t||"type"===t||"class"===t}}class V{static getDefaultRegistry(){return V.defaultRegistry}static enableDefaultRegistry(t){V.defaultRegistry=t}static disableDefaultRegistry(){V.defaultRegistry=void 0}constructor(){this.index=new U}clear(){return this.index=new U,this}setIndexValue(t,e,i,s){if(!U.isValidName(t))throw new C("BadArgument",`Unknown registry index: ${t}`);const n=this.index;n[t][e]||(n[t][e]=Object.create(null)),n[t][e][i]=s}updateIndex({id:t,name:e,value:i,oldValue:s}){if(!U.isValidName(e))throw new C("BadArgument",`Unknown registry index: ${e}`);const n=this.getElementById(t);void 0!==s&&this.index[e][s]&&delete this.index[e][s][t],i&&n&&this.setIndexValue(e,i,n.getAttribute("id"),n)}register(t,e){if(!(e=e||t.getAttribute("id")))throw new C("Can't add element without `id` attribute to registry");return t.setAttribute("id",e),this.setIndexValue("id",e,e,t),this.updateIndex({id:e,name:"type",value:t.getAttribute("type"),oldValue:void 0}),t.onRegister(this),this}getElementById(t){var e,i;return null===(i=null===(e=this.index.id)||void 0===e?void 0:e[t])||void 0===i?void 0:i[t]}getElementsByAttribute(t,e){if(!U.isValidName(t))return[];const i=this.index[t];if(i){const t=i[e];if(t){return Object.keys(t).map(e=>t[e])}}return[]}getElementsByType(t){return this.getElementsByAttribute("type",t)}getElementsByClass(t){return this.getElementsByAttribute("class",t)}onUpdate(t){return U.isValidName(t.name)&&this.updateIndex(t),this}}class X{static get CATEGORY(){return l.Element}static newID(){return"auto"+X.ID++}static setTextMeasurementCanvas(t){X.txtCanvas=t}static getTextMeasurementCanvas(){let t=X.txtCanvas;return t||("undefined"!=typeof document?t=document.createElement("canvas"):"undefined"!=typeof OffscreenCanvas&&(t=new OffscreenCanvas(300,150)),X.txtCanvas=t),t}constructor(t){var e;this.children=[],this.style={},this.styleExplicit=!1,this._text="",this.metricsValid=!1,this._textMetrics={fontBoundingBoxAscent:0,fontBoundingBoxDescent:0,actualBoundingBoxAscent:0,actualBoundingBoxDescent:0,actualBoundingBoxLeft:0,actualBoundingBoxRight:0,width:0,alphabeticBaseline:0,emHeightAscent:0,emHeightDescent:0,hangingBaseline:0,ideographicBaseline:0},this._height=0,this._width=0,this.xShift=0,this.yShift=0,this.x=0,this.y=0,this.attrs={id:X.newID(),type:null!=t?t:this.constructor.CATEGORY,class:""},this.rendered=!1,this._fontInfo=O.getFontInfo(this.attrs.type),this.style=O.getStyle(this.attrs.type),this.fontScale=O.get(`${this.attrs.type}.fontScale`),this.shouldDrawPointerRect=O.get(`${this.attrs.type}.pointerRect`),null===(e=V.getDefaultRegistry())||void 0===e||e.register(this)}addChild(t){if(t.parent)throw new C("Element","Parent already defined");return t.parent=this,this.children.push(t),this}getCategory(){return this.attrs.type}setStyle(t){return this.style=t,this.styleExplicit=!0,this}setGroupStyle(t){return this.style=t,this.styleExplicit=!0,this.children.forEach(e=>e.setGroupStyle(t)),this}getStyle(){return this.style}applyStyle(t=this.context,e=this.getStyle()){if(!t)return this;if(e===this.style&&!this.styleExplicit){const i=t.getDefaultStyle();e=Object.assign({},e),void 0!==i.fillStyle&&delete e.fillStyle,void 0!==i.strokeStyle&&delete e.strokeStyle}return e.shadowColor&&t.setShadowColor(e.shadowColor),void 0!==e.shadowBlur&&t.setShadowBlur(e.shadowBlur),e.fillStyle&&t.setFillStyle(e.fillStyle),e.strokeStyle&&t.setStrokeStyle(e.strokeStyle),void 0!==e.lineWidth&&t.setLineWidth(e.lineWidth),void 0!==e.lineDash&&t.setLineDash(e.lineDash?e.lineDash.split(" ").map(Number):[]),this}drawWithStyle(){const t=this.checkContext(),e=t.getDefaultStyle();t.save();try{if(this.styleExplicit){const i=Object.assign({},e);void 0!==this.style.fillStyle&&(i.fillStyle=this.style.fillStyle),void 0!==this.style.strokeStyle&&(i.strokeStyle=this.style.strokeStyle),t.setDefaultStyle(i)}this.applyStyle(t),this.draw()}finally{t.setDefaultStyle(e),t.restore()}return this}draw(){throw new C("Element","Draw not defined")}hasClass(t){var e;return!!this.attrs.class&&-1!==(null===(e=this.attrs.class)||void 0===e?void 0:e.split(" ").indexOf(t))}addClass(t){var e;return this.hasClass(t)||(this.attrs.class?this.attrs.class=`${this.attrs.class} ${t}`:this.attrs.class=`${t}`,null===(e=this.registry)||void 0===e||e.onUpdate({id:this.attrs.id,name:"class",value:t,oldValue:void 0})),this}removeClass(t){var e,i;if(!this.hasClass(t))return this;const s=null===(e=this.attrs.class)||void 0===e?void 0:e.split(" ");return s&&(s.splice(s.indexOf(t)),this.attrs.class=s.join(" ")),null===(i=this.registry)||void 0===i||i.onUpdate({id:this.attrs.id,name:"class",value:void 0,oldValue:t}),this}onRegister(t){return this.registry=t,this}isRendered(){return this.rendered}setRendered(t=!0){return this.rendered=t,this}getAttributes(){return this.attrs}getAttribute(t){return this.attrs[t]}getSVGElement(t=""){const e=L(this.attrs.id+t),i=document.getElementById(e);if(i)return i}setAttribute(t,e){var i;const s=this.attrs.id,n=this.attrs[t];return this.attrs[t]=e,null===(i=this.registry)||void 0===i||i.onUpdate({id:s,name:t,value:e,oldValue:n}),this}getBoundingBox(){return new P(this.x+this.xShift,this.y+this.yShift-this.textMetrics.actualBoundingBoxAscent,this.width,this.height)}getContext(){return this.context}drawPointerRect(){var t;if(this.shouldDrawPointerRect){const e=this.getBoundingBox();null===(t=this.context)||void 0===t||t.pointerRect(e.getX(),e.getY(),e.getW(),e.getH())}}setContext(t){return this.context=t,this}checkContext(){return v(this.context,"NoContext","No rendering context attached to instance.")}set font(t){this.setFont(t)}get font(){return G.toCSSString(this._fontInfo)}setFont(t,e,i,s){const n=O.getFontInfo(this.attrs.type),a="object"==typeof t,o="string"==typeof t,r=void 0===e&&void 0===i&&void 0===s;return this.metricsValid=!1,this._fontInfo=a?Object.assign(Object.assign({},n),t):o&&r?G.fromCSSString(t):G.validate(null!=t?t:n.family,null!=e?e:n.size,null!=i?i:n.weight,null!=s?s:n.style),this}getFont(){return G.toCSSString(this._fontInfo)}get fontInfo(){return this._fontInfo}set fontInfo(t){this.setFont(t)}setFontSize(t){const e=this.fontInfo;return this.setFont(e.family,t,e.weight,e.style),this}getFontSize(){return this.fontSize}getFontScale(){return this.fontScale}set fontSize(t){this.setFontSize(t)}get fontSize(){let t=this.fontInfo.size;return"number"==typeof t&&(t=`${t}pt`),t}get fontSizeInPoints(){return G.convertSizeToPointValue(this.fontSize)}get fontSizeInPixels(){return G.convertSizeToPixelValue(this.fontSize)}get fontStyle(){return this.fontInfo.style}set fontStyle(t){const e=this.fontInfo;this.setFont(e.family,e.size,e.weight,t)}get fontWeight(){return this.fontInfo.weight+""}set fontWeight(t){const e=this.fontInfo;this.setFont(e.family,e.size,t,e.style)}getWidth(){return this.width}get width(){return this.metricsValid||this.measureText(),this._width}setWidth(t){return this.width=t,this}set width(t){this.metricsValid||this.measureText(),this._width=t}setX(t){return this.x=t,this}getX(){return this.x}getY(){return this.y}setY(t){return this.y=t,this}setYShift(t){return this.yShift=t,this}getYShift(){return this.yShift}setXShift(t){return this.xShift=t,this}getXShift(){return this.xShift}setText(t){return this.text=t,this}set text(t){this.metricsValid=!1,this._text=t}getText(){return this._text}get text(){return this._text}renderText(t,e,i){t.setFont(this._fontInfo),t.fillText(this._text,e+this.x+this.xShift,i+this.y+this.yShift),this.children.forEach(s=>{t.setFont(s.fontInfo),t.fillText(s.text,e+s.x+s.xShift,i+s.y+s.yShift)})}measureText(){var t;const e=null===(t=X.getTextMeasurementCanvas())||void 0===t?void 0:t.getContext("2d");return e?(e.font=G.toCSSString(G.validate(this.fontInfo)),this._textMetrics=e.measureText(this.text),this._height=this._textMetrics.actualBoundingBoxAscent+this._textMetrics.actualBoundingBoxDescent,this._width=this._textMetrics.width,this.metricsValid=!0,this._textMetrics):(console.warn("Element: No context for txtCanvas. Returning empty text metrics."),this._textMetrics)}static measureWidth(t,e=""){var i;const s=null===(i=X.getTextMeasurementCanvas())||void 0===i?void 0:i.getContext("2d");return s?(s.font=G.toCSSString(O.getFontInfo(e)),s.measureText(t).width):(console.warn("Element: No context for txtCanvas. Returning empty text metrics."),0)}getTextMetrics(){return this.textMetrics}get textMetrics(){return this.metricsValid||this.measureText(),this._textMetrics}getHeight(){return this.height}get height(){return this.metricsValid||this.measureText(),this._height}set height(t){this.metricsValid||this.measureText(),this._height=t}setOriginX(t){const e=this.getBoundingBox(),i=(t-Math.abs((e.getX()-this.x-this.xShift)/e.getW()))*e.getW();this.xShift=-i}setOriginY(t){const e=this.getBoundingBox(),i=(t-Math.abs((e.getY()-this.y-this.yShift)/e.getH()))*e.getH();this.yShift=-i}setOrigin(t,e){this.setOriginX(t),this.setOriginY(e)}}var Y,_;X.ID=1e3,function(t){t[t.CENTER=0]="CENTER",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.ABOVE=3]="ABOVE",t[t.BELOW=4]="BELOW"}(Y||(Y={}));class z extends X{static get CATEGORY(){return l.Modifier}static get Position(){return Y}static get PositionString(){return{center:Y.CENTER,above:Y.ABOVE,below:Y.BELOW,left:Y.LEFT,right:Y.RIGHT}}constructor(){super(),this.width=0,this.textLine=0,this.position=z.Position.LEFT,this.spacingFromNextModifier=0}reset(){}getNote(){return v(this.note,"NoNote","Modifier has no note.")}checkAttachedNote(){const t=this.getCategory();return v(this.index,"NoIndex",`Can't draw ${t} without an index.`),v(this.note,"NoNote",`Can't draw ${t} without a note.`)}setNote(t){return this.note=t,this}getIndex(){return this.index}checkIndex(){return v(this.index,"NoIndex","Modifier has an invalid index.")}setIndex(t){return this.index=t,this}getModifierContext(){return this.modifierContext}checkModifierContext(){return v(this.modifierContext,"NoModifierContext","Modifier Context Required")}setModifierContext(t){return this.modifierContext=t,this}getPosition(){return this.position}setPosition(t){return this.position="string"==typeof t?z.PositionString[t]:t,this.reset(),this}setTextLine(t){return this.textLine=t,this}setYShift(t){return this.yShift=t,this}setSpacingFromNextModifier(t){this.spacingFromNextModifier=t}getSpacingFromNextModifier(){return this.spacingFromNextModifier}setXShift(t){return this.xShift=0,this.position===z.Position.LEFT?this.xShift-=t:this.xShift+=t,this}getXShift(){return this.xShift}draw(){throw this.checkContext(),new C("NotImplemented","draw() not implemented for this modifier.")}alignSubNotesWithNote(t,e,i=z.Position.LEFT){const s=e.getTickContext(),n=s.getMetrics(),a=e.getStave(),o=i===z.Position.RIGHT?s.getX()+this.getSpacingFromNextModifier()*t.length+10:s.getX()-n.modLeftPx-n.modRightPx+this.getSpacingFromNextModifier();t.forEach(t=>{const e=t.getTickContext();a&&t.setStave(a),e.setXOffset(o)})}}class j{static get NUM_TONES(){return this.canonicalNotes.length}static get roots(){return["c","d","e","f","g","a","b"]}static get rootValues(){return[0,2,4,5,7,9,11]}static get rootIndexes(){return{c:0,d:1,e:2,f:3,g:4,a:5,b:6}}static get canonicalNotes(){return["c","c#","d","d#","e","f","f#","g","g#","a","a#","b"]}static get diatonicIntervals(){return["unison","m2","M2","m3","M3","p4","dim5","p5","m6","M6","b7","M7","octave"]}static get diatonicAccidentals(){return{unison:{note:0,accidental:0},m2:{note:1,accidental:-1},M2:{note:1,accidental:0},m3:{note:2,accidental:-1},M3:{note:2,accidental:0},p4:{note:3,accidental:0},dim5:{note:4,accidental:-1},p5:{note:4,accidental:0},m6:{note:5,accidental:-1},M6:{note:5,accidental:0},b7:{note:6,accidental:-1},M7:{note:6,accidental:0},octave:{note:7,accidental:0}}}static get intervals(){return{u:0,unison:0,m2:1,b2:1,min2:1,S:1,H:1,2:2,M2:2,maj2:2,T:2,W:2,m3:3,b3:3,min3:3,M3:4,3:4,maj3:4,4:5,p4:5,"#4":6,b5:6,aug4:6,dim5:6,5:7,p5:7,"#5":8,b6:8,aug5:8,6:9,M6:9,maj6:9,b7:10,m7:10,min7:10,dom7:10,M7:11,maj7:11,8:12,octave:12}}static get scales(){return{major:[2,2,1,2,2,2,1],minor:[2,1,2,2,1,2,2],ionian:[2,2,1,2,2,2,1],dorian:[2,1,2,2,2,1,2],phyrgian:[1,2,2,2,1,2,2],lydian:[2,2,2,1,2,2,1],mixolydian:[2,2,1,2,2,1,2],aeolian:[2,1,2,2,1,2,2],locrian:[1,2,2,1,2,2,2]}}static get scaleTypes(){return{M:j.scales.major,m:j.scales.minor}}static get accidentals(){return["bb","b","n","#","##"]}static get noteValues(){return{c:{rootIndex:0,intVal:0},cn:{rootIndex:0,intVal:0},"c#":{rootIndex:0,intVal:1},"c##":{rootIndex:0,intVal:2},cb:{rootIndex:0,intVal:11},cbb:{rootIndex:0,intVal:10},d:{rootIndex:1,intVal:2},dn:{rootIndex:1,intVal:2},"d#":{rootIndex:1,intVal:3},"d##":{rootIndex:1,intVal:4},db:{rootIndex:1,intVal:1},dbb:{rootIndex:1,intVal:0},e:{rootIndex:2,intVal:4},en:{rootIndex:2,intVal:4},"e#":{rootIndex:2,intVal:5},"e##":{rootIndex:2,intVal:6},eb:{rootIndex:2,intVal:3},ebb:{rootIndex:2,intVal:2},f:{rootIndex:3,intVal:5},fn:{rootIndex:3,intVal:5},"f#":{rootIndex:3,intVal:6},"f##":{rootIndex:3,intVal:7},fb:{rootIndex:3,intVal:4},fbb:{rootIndex:3,intVal:3},g:{rootIndex:4,intVal:7},gn:{rootIndex:4,intVal:7},"g#":{rootIndex:4,intVal:8},"g##":{rootIndex:4,intVal:9},gb:{rootIndex:4,intVal:6},gbb:{rootIndex:4,intVal:5},a:{rootIndex:5,intVal:9},an:{rootIndex:5,intVal:9},"a#":{rootIndex:5,intVal:10},"a##":{rootIndex:5,intVal:11},ab:{rootIndex:5,intVal:8},abb:{rootIndex:5,intVal:7},b:{rootIndex:6,intVal:11},bn:{rootIndex:6,intVal:11},"b#":{rootIndex:6,intVal:0},"b##":{rootIndex:6,intVal:1},bb:{rootIndex:6,intVal:10},bbb:{rootIndex:6,intVal:9}}}isValidNoteValue(t){return t>=0&&t<j.canonicalNotes.length}isValidIntervalValue(t){return t>=0&&t<j.diatonicIntervals.length}getNoteParts(t){if(!t||t.length<1)throw new C("BadArguments","Invalid note name: "+t);if(t.length>3)throw new C("BadArguments","Invalid note name: "+t);const e=t.toLowerCase(),i=/^([cdefgab])(b|bb|n|#|##)?$/.exec(e);if(null!==i){return{root:i[1],accidental:i[2]}}throw new C("BadArguments","Invalid note name: "+t)}getKeyParts(t){if(!t||t.length<1)throw new C("BadArguments","Invalid key: "+t);const e=t.toLowerCase(),i=/^([cdefgab])(b|#)?(mel|harm|m|M)?$/.exec(e);if(null!==i){const t=i[1],e=i[2];let s=i[3];return s||(s="M"),{root:t,accidental:e,type:s}}throw new C("BadArguments",`Invalid key: ${t}`)}getNoteValue(t){const e=j.noteValues[t];if(void 0===e)throw new C("BadArguments",`Invalid note name: ${t}`);return e.intVal}getIntervalValue(t){const e=j.intervals[t];if(void 0===e)throw new C("BadArguments",`Invalid interval name: ${t}`);return e}getCanonicalNoteName(t){if(!this.isValidNoteValue(t))throw new C("BadArguments",`Invalid note value: ${t}`);return j.canonicalNotes[t]}getCanonicalIntervalName(t){if(!this.isValidIntervalValue(t))throw new C("BadArguments",`Invalid interval value: ${t}`);return j.diatonicIntervals[t]}getRelativeNoteValue(t,e,i=1){if(1!==i&&-1!==i)throw new C("BadArguments",`Invalid direction: ${i}`);let s=(t+i*e)%j.NUM_TONES;return s<0&&(s+=j.NUM_TONES),s}getRelativeNoteName(t,e){const i=this.getNoteParts(t),s=this.getNoteValue(i.root);let n=e-s;if(Math.abs(n)>j.NUM_TONES-3){let i=1;n>0&&(i=-1);const a=(e+1+(s+1))%j.NUM_TONES*i;if(Math.abs(a)>2)throw new C("BadArguments",`Notes not related: ${t}, ${e})`);n=a}if(Math.abs(n)>2)throw new C("BadArguments",`Notes not related: ${t}, ${e})`);let a=i.root;if(n>0)for(let t=1;t<=n;++t)a+="#";else if(n<0)for(let t=-1;t>=n;--t)a+="b";return a}getScaleTones(t,e){const i=[t];let s=t;for(let n=0;n<e.length;n++)s=this.getRelativeNoteValue(s,e[n]),s!==t&&i.push(s);return i}getIntervalBetween(t,e,i=1){if(1!==i&&-1!==i)throw new C("BadArguments",`Invalid direction: ${i}`);if(!this.isValidNoteValue(t)||!this.isValidNoteValue(e))throw new C("BadArguments",`Invalid notes: ${t}, ${e}`);let s=1===i?e-t:t-e;return s<0&&(s+=j.NUM_TONES),s}createScaleMap(t){const e=this.getKeyParts(t);if(!e.type)throw new C("BadArguments","Unsupported key type: undefined");const i=j.scaleTypes[e.type];let s=e.root;if(e.accidental&&(s+=e.accidental),!i)throw new C("BadArguments","Unsupported key type: "+t);const n=this.getScaleTones(this.getNoteValue(s),i),a=j.rootIndexes[e.root],o={};for(let t=0;t<j.roots.length;++t){const e=(a+t)%j.roots.length,i=j.roots[e];let s=this.getRelativeNoteName(i,n[t]);1===s.length&&(s+="n"),o[i]=s}return o}}!function(t){t.null="\0",t.fourStringTabClef="",t.sixStringTabClef="",t.accSagittal11LargeDiesisDown="",t.accSagittal11LargeDiesisUp="",t.accSagittal11MediumDiesisDown="",t.accSagittal11MediumDiesisUp="",t.accSagittal11v19LargeDiesisDown="",t.accSagittal11v19LargeDiesisUp="",t.accSagittal11v19MediumDiesisDown="",t.accSagittal11v19MediumDiesisUp="",t.accSagittal11v49CommaDown="",t.accSagittal11v49CommaUp="",t.accSagittal143CommaDown="",t.accSagittal143CommaUp="",t.accSagittal17CommaDown="",t.accSagittal17CommaUp="",t.accSagittal17KleismaDown="",t.accSagittal17KleismaUp="",t.accSagittal19CommaDown="",t.accSagittal19CommaUp="",t.accSagittal19SchismaDown="",t.accSagittal19SchismaUp="",t.accSagittal1MinaDown="",t.accSagittal1MinaUp="",t.accSagittal1TinaDown="",t.accSagittal1TinaUp="",t.accSagittal23CommaDown="",t.accSagittal23CommaUp="",t.accSagittal23SmallDiesisDown="",t.accSagittal23SmallDiesisUp="",t.accSagittal25SmallDiesisDown="",t.accSagittal25SmallDiesisUp="",t.accSagittal2MinasDown="",t.accSagittal2MinasUp="",t.accSagittal2TinasDown="",t.accSagittal2TinasUp="",t.accSagittal35LargeDiesisDown="",t.accSagittal35LargeDiesisUp="",t.accSagittal35MediumDiesisDown="",t.accSagittal35MediumDiesisUp="",t.accSagittal3TinasDown="",t.accSagittal3TinasUp="",t.accSagittal49LargeDiesisDown="",t.accSagittal49LargeDiesisUp="",t.accSagittal49MediumDiesisDown="",t.accSagittal49MediumDiesisUp="",t.accSagittal49SmallDiesisDown="",t.accSagittal49SmallDiesisUp="",t.accSagittal4TinasDown="",t.accSagittal4TinasUp="",t.accSagittal55CommaDown="",t.accSagittal55CommaUp="",t.accSagittal5CommaDown="",t.accSagittal5CommaUp="",t.accSagittal5TinasDown="",t.accSagittal5TinasUp="",t.accSagittal5v11SmallDiesisDown="",t.accSagittal5v11SmallDiesisUp="",t.accSagittal5v13LargeDiesisDown="",t.accSagittal5v13LargeDiesisUp="",t.accSagittal5v13MediumDiesisDown="",t.accSagittal5v13MediumDiesisUp="",t.accSagittal5v19CommaDown="",t.accSagittal5v19CommaUp="",t.accSagittal5v23SmallDiesisDown="",t.accSagittal5v23SmallDiesisUp="",t.accSagittal5v49MediumDiesisDown="",t.accSagittal5v49MediumDiesisUp="",t.accSagittal5v7KleismaDown="",t.accSagittal5v7KleismaUp="",t.accSagittal6TinasDown="",t.accSagittal6TinasUp="",t.accSagittal7CommaDown="",t.accSagittal7CommaUp="",t.accSagittal7TinasDown="",t.accSagittal7TinasUp="",t.accSagittal7v11CommaDown="",t.accSagittal7v11CommaUp="",t.accSagittal7v11KleismaDown="",t.accSagittal7v11KleismaUp="",t.accSagittal7v19CommaDown="",t.accSagittal7v19CommaUp="",t.accSagittal8TinasDown="",t.accSagittal8TinasUp="",t.accSagittal9TinasDown="",t.accSagittal9TinasUp="",t.accSagittalAcute="",t.accSagittalDoubleFlat="",t.accSagittalDoubleFlat11v49CUp="",t.accSagittalDoubleFlat143CUp="",t.accSagittalDoubleFlat17CUp="",t.accSagittalDoubleFlat17kUp="",t.accSagittalDoubleFlat19CUp="",t.accSagittalDoubleFlat19sUp="",t.accSagittalDoubleFlat23CUp="",t.accSagittalDoubleFlat23SUp="",t.accSagittalDoubleFlat25SUp="",t.accSagittalDoubleFlat49SUp="",t.accSagittalDoubleFlat55CUp="",t.accSagittalDoubleFlat5CUp="",t.accSagittalDoubleFlat5v11SUp="",t.accSagittalDoubleFlat5v19CUp="",t.accSagittalDoubleFlat5v23SUp="",t.accSagittalDoubleFlat5v7kUp="",t.accSagittalDoubleFlat7CUp="",t.accSagittalDoubleFlat7v11CUp="",t.accSagittalDoubleFlat7v11kUp="",t.accSagittalDoubleFlat7v19CUp="",t.accSagittalDoubleSharp="",t.accSagittalDoubleSharp11v49CDown="",t.accSagittalDoubleSharp143CDown="",t.accSagittalDoubleSharp17CDown="",t.accSagittalDoubleSharp17kDown="",t.accSagittalDoubleSharp19CDown="",t.accSagittalDoubleSharp19sDown="",t.accSagittalDoubleSharp23CDown="",t.accSagittalDoubleSharp23SDown="",t.accSagittalDoubleSharp25SDown="",t.accSagittalDoubleSharp49SDown="",t.accSagittalDoubleSharp55CDown="",t.accSagittalDoubleSharp5CDown="",t.accSagittalDoubleSharp5v11SDown="",t.accSagittalDoubleSharp5v19CDown="",t.accSagittalDoubleSharp5v23SDown="",t.accSagittalDoubleSharp5v7kDown="",t.accSagittalDoubleSharp7CDown="",t.accSagittalDoubleSharp7v11CDown="",t.accSagittalDoubleSharp7v11kDown="",t.accSagittalDoubleSharp7v19CDown="",t.accSagittalFlat="",t.accSagittalFlat11LDown="",t.accSagittalFlat11MDown="",t.accSagittalFlat11v19LDown="",t.accSagittalFlat11v19MDown="",t.accSagittalFlat11v49CDown="",t.accSagittalFlat11v49CUp="",t.accSagittalFlat143CDown="",t.accSagittalFlat143CUp="",t.accSagittalFlat17CDown="",t.accSagittalFlat17CUp="",t.accSagittalFlat17kDown="",t.accSagittalFlat17kUp="",t.accSagittalFlat19CDown="",t.accSagittalFlat19CUp="",t.accSagittalFlat19sDown="",t.accSagittalFlat19sUp="",t.accSagittalFlat23CDown="",t.accSagittalFlat23CUp="",t.accSagittalFlat23SDown="",t.accSagittalFlat23SUp="",t.accSagittalFlat25SDown="",t.accSagittalFlat25SUp="",t.accSagittalFlat35LDown="",t.accSagittalFlat35MDown="",t.accSagittalFlat49LDown="",t.accSagittalFlat49MDown="",t.accSagittalFlat49SDown="",t.accSagittalFlat49SUp="",t.accSagittalFlat55CDown="",t.accSagittalFlat55CUp="",t.accSagittalFlat5CDown="",t.accSagittalFlat5CUp="",t.accSagittalFlat5v11SDown="",t.accSagittalFlat5v11SUp="",t.accSagittalFlat5v13LDown="",t.accSagittalFlat5v13MDown="",t.accSagittalFlat5v19CDown="",t.accSagittalFlat5v19CUp="",t.accSagittalFlat5v23SDown="",t.accSagittalFlat5v23SUp="",t.accSagittalFlat5v49MDown="",t.accSagittalFlat5v7kDown="",t.accSagittalFlat5v7kUp="",t.accSagittalFlat7CDown="",t.accSagittalFlat7CUp="",t.accSagittalFlat7v11CDown="",t.accSagittalFlat7v11CUp="",t.accSagittalFlat7v11kDown="",t.accSagittalFlat7v11kUp="",t.accSagittalFlat7v19CDown="",t.accSagittalFlat7v19CUp="",t.accSagittalFractionalTinaDown="",t.accSagittalFractionalTinaUp="",t.accSagittalGrave="",t.accSagittalShaftDown="",t.accSagittalShaftUp="",t.accSagittalSharp="",t.accSagittalSharp11LUp="",t.accSagittalSharp11MUp="",t.accSagittalSharp11v19LUp="",t.accSagittalSharp11v19MUp="",t.accSagittalSharp11v49CDown="",t.accSagittalSharp11v49CUp="",t.accSagittalSharp143CDown="",t.accSagittalSharp143CUp="",t.accSagittalSharp17CDown="",t.accSagittalSharp17CUp="",t.accSagittalSharp17kDown="",t.accSagittalSharp17kUp="",t.accSagittalSharp19CDown="",t.accSagittalSharp19CUp="",t.accSagittalSharp19sDown="",t.accSagittalSharp19sUp="",t.accSagittalSharp23CDown="",t.accSagittalSharp23CUp="",t.accSagittalSharp23SDown="",t.accSagittalSharp23SUp="",t.accSagittalSharp25SDown="",t.accSagittalSharp25SUp="",t.accSagittalSharp35LUp="",t.accSagittalSharp35MUp="",t.accSagittalSharp49LUp="",t.accSagittalSharp49MUp="",t.accSagittalSharp49SDown="",t.accSagittalSharp49SUp="",t.accSagittalSharp55CDown="",t.accSagittalSharp55CUp="",t.accSagittalSharp5CDown="",t.accSagittalSharp5CUp="",t.accSagittalSharp5v11SDown="",t.accSagittalSharp5v11SUp="",t.accSagittalSharp5v13LUp="",t.accSagittalSharp5v13MUp="",t.accSagittalSharp5v19CDown="",t.accSagittalSharp5v19CUp="",t.accSagittalSharp5v23SDown="",t.accSagittalSharp5v23SUp="",t.accSagittalSharp5v49MUp="",t.accSagittalSharp5v7kDown="",t.accSagittalSharp5v7kUp="",t.accSagittalSharp7CDown="",t.accSagittalSharp7CUp="",t.accSagittalSharp7v11CDown="",t.accSagittalSharp7v11CUp="",t.accSagittalSharp7v11kDown="",t.accSagittalSharp7v11kUp="",t.accSagittalSharp7v19CDown="",t.accSagittalSharp7v19CUp="",t.accSagittalUnused1="",t.accSagittalUnused2="",t.accSagittalUnused3="",t.accSagittalUnused4="",t.accdnCombDot="",t.accdnCombLH2RanksEmpty="",t.accdnCombLH3RanksEmptySquare="",t.accdnCombRH3RanksEmpty="",t.accdnCombRH4RanksEmpty="",t.accdnDiatonicClef="",t.accdnLH2Ranks16Round="",t.accdnLH2Ranks8Plus16Round="",t.accdnLH2Ranks8Round="",t.accdnLH2RanksFullMasterRound="",t.accdnLH2RanksMasterPlus16Round="",t.accdnLH2RanksMasterRound="",t.accdnLH3Ranks2Plus8Square="",t.accdnLH3Ranks2Square="",t.accdnLH3Ranks8Square="",t.accdnLH3RanksDouble8Square="",t.accdnLH3RanksTuttiSquare="",t.accdnPull="",t.accdnPush="",t.accdnRH3RanksAccordion="",t.accdnRH3RanksAuthenticMusette="",t.accdnRH3RanksBandoneon="",t.accdnRH3RanksBassoon="",t.accdnRH3RanksClarinet="",t.accdnRH3RanksDoubleTremoloLower8ve="",t.accdnRH3RanksDoubleTremoloUpper8ve="",t.accdnRH3RanksFullFactory="",t.accdnRH3RanksHarmonium="",t.accdnRH3RanksImitationMusette="",t.accdnRH3RanksLowerTremolo8="",t.accdnRH3RanksMaster="",t.accdnRH3RanksOboe="",t.accdnRH3RanksOrgan="",t.accdnRH3RanksPiccolo="",t.accdnRH3RanksTremoloLower8ve="",t.accdnRH3RanksTremoloUpper8ve="",t.accdnRH3RanksTwoChoirs="",t.accdnRH3RanksUpperTremolo8="",t.accdnRH3RanksViolin="",t.accdnRH4RanksAlto="",t.accdnRH4RanksBassAlto="",t.accdnRH4RanksMaster="",t.accdnRH4RanksSoftBass="",t.accdnRH4RanksSoftTenor="",t.accdnRH4RanksSoprano="",t.accdnRH4RanksTenor="",t.accdnRicochet2="",t.accdnRicochet3="",t.accdnRicochet4="",t.accdnRicochet5="",t.accdnRicochet6="",t.accdnRicochetStem2="",t.accdnRicochetStem3="",t.accdnRicochetStem4="",t.accdnRicochetStem5="",t.accdnRicochetStem6="",t.accidental1CommaFlat="",t.accidental1CommaSharp="",t.accidental2CommaFlat="",t.accidental2CommaSharp="",t.accidental3CommaFlat="",t.accidental3CommaSharp="",t.accidental4CommaFlat="",t.accidental5CommaSharp="",t.accidentalArrowDown="",t.accidentalArrowUp="",t.accidentalBakiyeFlat="",t.accidentalBakiyeSharp="",t.accidentalBracketLeft="",t.accidentalBracketRight="",t.accidentalBuyukMucennebFlat="",t.accidentalBuyukMucennebSharp="",t.accidentalCombiningCloseCurlyBrace="",t.accidentalCombiningLower17Schisma="",t.accidentalCombiningLower19Schisma="",t.accidentalCombiningLower23Limit29LimitComma="",t.accidentalCombiningLower29LimitComma="",t.accidentalCombiningLower31Schisma="",t.accidentalCombiningLower37Quartertone="",t.accidentalCombiningLower41Comma="",t.accidentalCombiningLower43Comma="",t.accidentalCombiningLower47Quartertone="",t.accidentalCombiningLower53LimitComma="",t.accidentalCombiningOpenCurlyBrace="",t.accidentalCombiningRaise17Schisma="",t.accidentalCombiningRaise19Schisma="",t.accidentalCombiningRaise23Limit29LimitComma="",t.accidentalCombiningRaise29LimitComma="",t.accidentalCombiningRaise31Schisma="",t.accidentalCombiningRaise37Quartertone="",t.accidentalCombiningRaise41Comma="",t.accidentalCombiningRaise43Comma="",t.accidentalCombiningRaise47Quartertone="",t.accidentalCombiningRaise53LimitComma="",t.accidentalCommaSlashDown="",t.accidentalCommaSlashUp="",t.accidentalDoubleFlat="",t.accidentalDoubleFlatArabic="",t.accidentalDoubleFlatEqualTempered="",t.accidentalDoubleFlatOneArrowDown="",t.accidentalDoubleFlatOneArrowUp="",t.accidentalDoubleFlatReversed="",t.accidentalDoubleFlatThreeArrowsDown="",t.accidentalDoubleFlatThreeArrowsUp="",t.accidentalDoubleFlatTurned="",t.accidentalDoubleFlatTwoArrowsDown="",t.accidentalDoubleFlatTwoArrowsUp="",t.accidentalDoubleSharp="",t.accidentalDoubleSharpArabic="",t.accidentalDoubleSharpEqualTempered="",t.accidentalDoubleSharpOneArrowDown="",t.accidentalDoubleSharpOneArrowUp="",t.accidentalDoubleSharpThreeArrowsDown="",t.accidentalDoubleSharpThreeArrowsUp="",t.accidentalDoubleSharpTwoArrowsDown="",t.accidentalDoubleSharpTwoArrowsUp="",t.accidentalEnharmonicAlmostEqualTo="",t.accidentalEnharmonicEquals="",t.accidentalEnharmonicTilde="",t.accidentalFilledReversedFlatAndFlat="",t.accidentalFilledReversedFlatAndFlatArrowDown="",t.accidentalFilledReversedFlatAndFlatArrowUp="",t.accidentalFilledReversedFlatArrowDown="",t.accidentalFilledReversedFlatArrowUp="",t.accidentalFiveQuarterTonesFlatArrowDown="",t.accidentalFiveQuarterTonesSharpArrowUp="",t.accidentalFlat="",t.accidentalFlatArabic="",t.accidentalFlatEqualTempered="",t.accidentalFlatLoweredStockhausen="",t.accidentalFlatOneArrowDown="",t.accidentalFlatOneArrowUp="",t.accidentalFlatRaisedStockhausen="",t.accidentalFlatRepeatedLineStockhausen="",t.accidentalFlatRepeatedSpaceStockhausen="",t.accidentalFlatThreeArrowsDown="",t.accidentalFlatThreeArrowsUp="",t.accidentalFlatTurned="",t.accidentalFlatTwoArrowsDown="",t.accidentalFlatTwoArrowsUp="",t.accidentalHabaFlatQuarterToneHigher="",t.accidentalHabaFlatThreeQuarterTonesLower="",t.accidentalHabaQuarterToneHigher="",t.accidentalHabaQuarterToneLower="",t.accidentalHabaSharpQuarterToneLower="",t.accidentalHabaSharpThreeQuarterTonesHigher="",t.accidentalHalfSharpArrowDown="",t.accidentalHalfSharpArrowUp="",t.accidentalJohnston13="",t.accidentalJohnston31="",t.accidentalJohnstonDown="",t.accidentalJohnstonEl="",t.accidentalJohnstonMinus="",t.accidentalJohnstonPlus="",t.accidentalJohnstonSeven="",t.accidentalJohnstonUp="",t.accidentalKomaFlat="",t.accidentalKomaSharp="",t.accidentalKoron="",t.accidentalKucukMucennebFlat="",t.accidentalKucukMucennebSharp="",t.accidentalLargeDoubleSharp="",t.accidentalLowerOneSeptimalComma="",t.accidentalLowerOneTridecimalQuartertone="",t.accidentalLowerOneUndecimalQuartertone="",t.accidentalLowerTwoSeptimalCommas="",t.accidentalLoweredStockhausen="",t.accidentalNarrowReversedFlat="",t.accidentalNarrowReversedFlatAndFlat="",t.accidentalNatural="",t.accidentalNaturalArabic="",t.accidentalNaturalEqualTempered="",t.accidentalNaturalFlat="",t.accidentalNaturalLoweredStockhausen="",t.accidentalNaturalOneArrowDown="",t.accidentalNaturalOneArrowUp="",t.accidentalNaturalRaisedStockhausen="",t.accidentalNaturalReversed="",t.accidentalNaturalSharp="",t.accidentalNaturalThreeArrowsDown="",t.accidentalNaturalThreeArrowsUp="",t.accidentalNaturalTwoArrowsDown="",t.accidentalNaturalTwoArrowsUp="",t.accidentalOneAndAHalfSharpsArrowDown="",t.accidentalOneAndAHalfSharpsArrowUp="",t.accidentalOneQuarterToneFlatFerneyhough="",t.accidentalOneQuarterToneFlatStockhausen="",t.accidentalOneQuarterToneSharpFerneyhough="",t.accidentalOneQuarterToneSharpStockhausen="",t.accidentalOneThirdToneFlatFerneyhough="",t.accidentalOneThirdToneSharpFerneyhough="",t.accidentalParensLeft="",t.accidentalParensRight="",t.accidentalQuarterFlatEqualTempered="",t.accidentalQuarterSharpEqualTempered="",t.accidentalQuarterToneFlat4="",t.accidentalQuarterToneFlatArabic="",t.accidentalQuarterToneFlatArrowUp="",t.accidentalQuarterToneFlatFilledReversed="",t.accidentalQuarterToneFlatNaturalArrowDown="",t.accidentalQuarterToneFlatPenderecki="",t.accidentalQuarterToneFlatStein="",t.accidentalQuarterToneFlatVanBlankenburg="",t.accidentalQuarterToneSharp4="",t.accidentalQuarterToneSharpArabic="",t.accidentalQuarterToneSharpArrowDown="",t.accidentalQuarterToneSharpBusotti="",t.accidentalQuarterToneSharpNaturalArrowUp="",t.accidentalQuarterToneSharpStein="",t.accidentalQuarterToneSharpWiggle="",t.accidentalRaiseOneSeptimalComma="",t.accidentalRaiseOneTridecimalQuartertone="",t.accidentalRaiseOneUndecimalQuartertone="",t.accidentalRaiseTwoSeptimalCommas="",t.accidentalRaisedStockhausen="",t.accidentalReversedFlatAndFlatArrowDown="",t.accidentalReversedFlatAndFlatArrowUp="",t.accidentalReversedFlatArrowDown="",t.accidentalReversedFlatArrowUp="",t.accidentalSharp="",t.accidentalSharpArabic="",t.accidentalSharpEqualTempered="",t.accidentalSharpLoweredStockhausen="",t.accidentalSharpOneArrowDown="",t.accidentalSharpOneArrowUp="",t.accidentalSharpOneHorizontalStroke="",t.accidentalSharpRaisedStockhausen="",t.accidentalSharpRepeatedLineStockhausen="",t.accidentalSharpRepeatedSpaceStockhausen="",t.accidentalSharpReversed="",t.accidentalSharpSharp="",t.accidentalSharpThreeArrowsDown="",t.accidentalSharpThreeArrowsUp="",t.accidentalSharpTwoArrowsDown="",t.accidentalSharpTwoArrowsUp="",t.accidentalSims12Down="",t.accidentalSims12Up="",t.accidentalSims4Down="",t.accidentalSims4Up="",t.accidentalSims6Down="",t.accidentalSims6Up="",t.accidentalSori="",t.accidentalTavenerFlat="",t.accidentalTavenerSharp="",t.accidentalThreeQuarterTonesFlatArabic="",t.accidentalThreeQuarterTonesFlatArrowDown="",t.accidentalThreeQuarterTonesFlatArrowUp="",t.accidentalThreeQuarterTonesFlatCouper="",t.accidentalThreeQuarterTonesFlatGrisey="",t.accidentalThreeQuarterTonesFlatTartini="",t.accidentalThreeQuarterTonesFlatZimmermann="",t.accidentalThreeQuarterTonesSharpArabic="",t.accidentalThreeQuarterTonesSharpArrowDown="",t.accidentalThreeQuarterTonesSharpArrowUp="",t.accidentalThreeQuarterTonesSharpBusotti="",t.accidentalThreeQuarterTonesSharpStein="",t.accidentalThreeQuarterTonesSharpStockhausen="",t.accidentalTripleFlat="",t.accidentalTripleSharp="",t.accidentalTwoThirdTonesFlatFerneyhough="",t.accidentalTwoThirdTonesSharpFerneyhough="",t.accidentalUpsAndDownsDown="",t.accidentalUpsAndDownsLess="",t.accidentalUpsAndDownsMore="",t.accidentalUpsAndDownsUp="",t.accidentalWilsonMinus="",t.accidentalWilsonPlus="",t.accidentalWyschnegradsky10TwelfthsFlat="",t.accidentalWyschnegradsky10TwelfthsSharp="",t.accidentalWyschnegradsky11TwelfthsFlat="",t.accidentalWyschnegradsky11TwelfthsSharp="",t.accidentalWyschnegradsky1TwelfthsFlat="",t.accidentalWyschnegradsky1TwelfthsSharp="",t.accidentalWyschnegradsky2TwelfthsFlat="",t.accidentalWyschnegradsky2TwelfthsSharp="",t.accidentalWyschnegradsky3TwelfthsFlat="",t.accidentalWyschnegradsky3TwelfthsSharp="",t.accidentalWyschnegradsky4TwelfthsFlat="",t.accidentalWyschnegradsky4TwelfthsSharp="",t.accidentalWyschnegradsky5TwelfthsFlat="",t.accidentalWyschnegradsky5TwelfthsSharp="",t.accidentalWyschnegradsky6TwelfthsFlat="",t.accidentalWyschnegradsky6TwelfthsSharp="",t.accidentalWyschnegradsky7TwelfthsFlat="",t.accidentalWyschnegradsky7TwelfthsSharp="",t.accidentalWyschnegradsky8TwelfthsFlat="",t.accidentalWyschnegradsky8TwelfthsSharp="",t.accidentalWyschnegradsky9TwelfthsFlat="",t.accidentalWyschnegradsky9TwelfthsSharp="",t.accidentalXenakisOneThirdToneSharp="",t.accidentalXenakisTwoThirdTonesSharp="",t.analyticsChoralmelodie="",t.analyticsEndStimme="",t.analyticsHauptrhythmus="",t.analyticsHauptstimme="",t.analyticsInversion1="",t.analyticsNebenstimme="",t.analyticsStartStimme="",t.analyticsTheme="",t.analyticsTheme1="",t.analyticsThemeInversion="",t.analyticsThemeRetrograde="",t.analyticsThemeRetrogradeInversion="",t.arpeggiato="",t.arpeggiatoDown="",t.arpeggiatoUp="",t.arrowBlackDown="",t.arrowBlackDownLeft="",t.arrowBlackDownRight="",t.arrowBlackLeft="",t.arrowBlackRight="",t.arrowBlackUp="",t.arrowBlackUpLeft="",t.arrowBlackUpRight="",t.arrowOpenDown="",t.arrowOpenDownLeft="",t.arrowOpenDownRight="",t.arrowOpenLeft="",t.arrowOpenRight="",t.arrowOpenUp="",t.arrowOpenUpLeft="",t.arrowOpenUpRight="",t.arrowWhiteDown="",t.arrowWhiteDownLeft="",t.arrowWhiteDownRight="",t.arrowWhiteLeft="",t.arrowWhiteRight="",t.arrowWhiteUp="",t.arrowWhiteUpLeft="",t.arrowWhiteUpRight="",t.arrowheadBlackDown="",t.arrowheadBlackDownLeft="",t.arrowheadBlackDownRight="",t.arrowheadBlackLeft="",t.arrowheadBlackRight="",t.arrowheadBlackUp="",t.arrowheadBlackUpLeft="",t.arrowheadBlackUpRight="",t.arrowheadOpenDown="",t.arrowheadOpenDownLeft="",t.arrowheadOpenDownRight="",t.arrowheadOpenLeft="",t.arrowheadOpenRight="",t.arrowheadOpenUp="",t.arrowheadOpenUpLeft="",t.arrowheadOpenUpRight="",t.arrowheadWhiteDown="",t.arrowheadWhiteDownLeft="",t.arrowheadWhiteDownRight="",t.arrowheadWhiteLeft="",t.arrowheadWhiteRight="",t.arrowheadWhiteUp="",t.arrowheadWhiteUpLeft="",t.arrowheadWhiteUpRight="",t.articAccentAbove="",t.articAccentBelow="",t.articAccentStaccatoAbove="",t.articAccentStaccatoBelow="",t.articLaissezVibrerAbove="",t.articLaissezVibrerBelow="",t.articMarcatoAbove="",t.articMarcatoBelow="",t.articMarcatoStaccatoAbove="",t.articMarcatoStaccatoBelow="",t.articMarcatoTenutoAbove="",t.articMarcatoTenutoBelow="",t.articSoftAccentAbove="",t.articSoftAccentBelow="",t.articSoftAccentStaccatoAbove="",t.articSoftAccentStaccatoBelow="",t.articSoftAccentTenutoAbove="",t.articSoftAccentTenutoBelow="",t.articSoftAccentTenutoStaccatoAbove="",t.articSoftAccentTenutoStaccatoBelow="",t.articStaccatissimoAbove="",t.articStaccatissimoBelow="",t.articStaccatissimoStrokeAbove="",t.articStaccatissimoStrokeBelow="",t.articStaccatissimoWedgeAbove="",t.articStaccatissimoWedgeBelow="",t.articStaccatoAbove="",t.articStaccatoBelow="",t.articStressAbove="",t.articStressBelow="",t.articTenutoAbove="",t.articTenutoAccentAbove="",t.articTenutoAccentBelow="",t.articTenutoBelow="",t.articTenutoStaccatoAbove="",t.articTenutoStaccatoBelow="",t.articUnstressAbove="",t.articUnstressBelow="",t.augmentationDot="",t.barlineDashed="",t.barlineDotted="",t.barlineDouble="",t.barlineFinal="",t.barlineHeavy="",t.barlineHeavyHeavy="",t.barlineReverseFinal="",t.barlineShort="",t.barlineSingle="",t.barlineTick="",t.beamAccelRit1="",t.beamAccelRit10="",t.beamAccelRit11="",t.beamAccelRit12="",t.beamAccelRit13="",t.beamAccelRit14="",t.beamAccelRit15="",t.beamAccelRit2="",t.beamAccelRit3="",t.beamAccelRit4="",t.beamAccelRit5="",t.beamAccelRit6="",t.beamAccelRit7="",t.beamAccelRit8="",t.beamAccelRit9="",t.beamAccelRitFinal="",t.brace="",t.bracket="",t.bracketBottom="",t.bracketTop="",t.brassBend="",t.brassDoitLong="",t.brassDoitMedium="",t.brassDoitShort="",t.brassFallLipLong="",t.brassFallLipMedium="",t.brassFallLipShort="",t.brassFallRoughLong="",t.brassFallRoughMedium="",t.brassFallRoughShort="",t.brassFallSmoothLong="",t.brassFallSmoothMedium="",t.brassFallSmoothShort="",t.brassFlip="",t.brassHarmonMuteClosed="",t.brassHarmonMuteStemHalfLeft="",t.brassHarmonMuteStemHalfRight="",t.brassHarmonMuteStemOpen="",t.brassJazzTurn="",t.brassLiftLong="",t.brassLiftMedium="",t.brassLiftShort="",t.brassLiftSmoothLong="",t.brassLiftSmoothMedium="",t.brassLiftSmoothShort="",t.brassMuteClosed="",t.brassMuteHalfClosed="",t.brassMuteOpen="",t.brassPlop="",t.brassScoop="",t.brassSmear="",t.brassValveTrill="",t.breathMarkComma="",t.breathMarkSalzedo="",t.breathMarkTick="",t.breathMarkUpbow="",t.bridgeClef="",t.buzzRoll="",t.cClef="",t.cClef8vb="",t.cClefArrowDown="",t.cClefArrowUp="",t.cClefChange="",t.cClefCombining="",t.cClefReversed="",t.cClefSquare="",t.caesura="",t.caesuraCurved="",t.caesuraShort="",t.caesuraSingleStroke="",t.caesuraThick="",t.chantAccentusAbove="",t.chantAccentusBelow="",t.chantAuctumAsc="",t.chantAuctumDesc="",t.chantAugmentum="",t.chantCaesura="",t.chantCclef="",t.chantCirculusAbove="",t.chantCirculusBelow="",t.chantConnectingLineAsc2nd="",t.chantConnectingLineAsc3rd="",t.chantConnectingLineAsc4th="",t.chantConnectingLineAsc5th="",t.chantConnectingLineAsc6th="",t.chantCustosStemDownPosHigh="",t.chantCustosStemDownPosHighest="",t.chantCustosStemDownPosMiddle="",t.chantCustosStemUpPosLow="",t.chantCustosStemUpPosLowest="",t.chantCustosStemUpPosMiddle="",t.chantDeminutumLower="",t.chantDeminutumUpper="",t.chantDivisioFinalis="",t.chantDivisioMaior="",t.chantDivisioMaxima="",t.chantDivisioMinima="",t.chantEntryLineAsc2nd="",t.chantEntryLineAsc3rd="",t.chantEntryLineAsc4th="",t.chantEntryLineAsc5th="",t.chantEntryLineAsc6th="",t.chantEpisema="",t.chantFclef="",t.chantIctusAbove="",t.chantIctusBelow="",t.chantLigaturaDesc2nd="",t.chantLigaturaDesc3rd="",t.chantLigaturaDesc4th="",t.chantLigaturaDesc5th="",t.chantOriscusAscending="",t.chantOriscusDescending="",t.chantOriscusLiquescens="",t.chantPodatusLower="",t.chantPodatusUpper="",t.chantPunctum="",t.chantPunctumCavum="",t.chantPunctumDeminutum="",t.chantPunctumInclinatum="",t.chantPunctumInclinatumAuctum="",t.chantPunctumInclinatumDeminutum="",t.chantPunctumLinea="",t.chantPunctumLineaCavum="",t.chantPunctumVirga="",t.chantPunctumVirgaReversed="",t.chantQuilisma="",t.chantSemicirculusAbove="",t.chantSemicirculusBelow="",t.chantStaff="",t.chantStaffNarrow="",t.chantStaffWide="",t.chantStrophicus="",t.chantStrophicusAuctus="",t.chantStrophicusLiquescens2nd="",t.chantStrophicusLiquescens3rd="",t.chantStrophicusLiquescens4th="",t.chantStrophicusLiquescens5th="",t.chantVirgula="",t.clef15="",t.clef8="",t.clefChangeCombining="",t.coda="",t.codaSquare="",t.conductorBeat2Compound="",t.conductorBeat2Simple="",t.conductorBeat3Compound="",t.conductorBeat3Simple="",t.conductorBeat4Compound="",t.conductorBeat4Simple="",t.conductorLeftBeat="",t.conductorRightBeat="",t.conductorStrongBeat="",t.conductorUnconducted="",t.conductorWeakBeat="";t.controlBeginBeam="",t.controlBeginPhrase="",t.controlBeginSlur="",t.controlBeginTie="",t.controlEndBeam="",t.controlEndPhrase="",t.controlEndSlur="",t.controlEndTie="",t.csymAccidentalDoubleFlat="",t.csymAccidentalDoubleSharp="",t.csymAccidentalFlat="",t.csymAccidentalNatural="",t.csymAccidentalSharp="",t.csymAccidentalTripleFlat="",t.csymAccidentalTripleSharp="",t.csymAlteredBassSlash="",t.csymAugmented="",t.csymBracketLeftTall="",t.csymBracketRightTall="",t.csymDiagonalArrangementSlash="",t.csymDiminished="",t.csymHalfDiminished="",t.csymMajorSeventh="",t.csymMinor="",t.csymParensLeftTall="",t.csymParensLeftVeryTall="",t.csymParensRightTall="",t.csymParensRightVeryTall="",t.curlewSign="",t.daCapo="",t.dalSegno="",t.daseianExcellentes1="",t.daseianExcellentes2="",t.daseianExcellentes3="",t.daseianExcellentes4="",t.daseianFinales1="",t.daseianFinales2="",t.daseianFinales3="",t.daseianFinales4="",t.daseianGraves1="",t.daseianGraves2="",t.daseianGraves3="",t.daseianGraves4="",t.daseianResidua1="",t.daseianResidua2="",t.daseianSuperiores1="",t.daseianSuperiores2="",t.daseianSuperiores3="",t.daseianSuperiores4="",t.doubleLateralRollStevens="",t.doubleTongueAbove="",t.doubleTongueBelow="",t.dynamicCombinedSeparatorColon="",t.dynamicCombinedSeparatorHyphen="",t.dynamicCombinedSeparatorSlash="",t.dynamicCombinedSeparatorSpace="",t.dynamicCrescendoHairpin="",t.dynamicDiminuendoHairpin="",t.dynamicFF="",t.dynamicFFF="",t.dynamicFFFF="",t.dynamicFFFFF="",t.dynamicFFFFFF="",t.dynamicForte="",t.dynamicFortePiano="",t.dynamicForzando="",t.dynamicHairpinBracketLeft="",t.dynamicHairpinBracketRight="",t.dynamicHairpinParenthesisLeft="",t.dynamicHairpinParenthesisRight="",t.dynamicMF="",t.dynamicMP="",t.dynamicMessaDiVoce="",t.dynamicMezzo="",t.dynamicNiente="",t.dynamicNienteForHairpin="",t.dynamicPF="",t.dynamicPP="",t.dynamicPPP="",t.dynamicPPPP="",t.dynamicPPPPP="",t.dynamicPPPPPP="",t.dynamicPiano="",t.dynamicRinforzando="",t.dynamicRinforzando1="",t.dynamicRinforzando2="",t.dynamicSforzando="",t.dynamicSforzando1="",t.dynamicSforzandoPianissimo="",t.dynamicSforzandoPiano="",t.dynamicSforzato="",t.dynamicSforzatoFF="",t.dynamicSforzatoPiano="",t.dynamicZ="",t.elecAudioChannelsEight="",t.elecAudioChannelsFive="",t.elecAudioChannelsFour="",t.elecAudioChannelsOne="",t.elecAudioChannelsSeven="",t.elecAudioChannelsSix="",t.elecAudioChannelsThreeFrontal="",t.elecAudioChannelsThreeSurround="",t.elecAudioChannelsTwo="",t.elecAudioIn="",t.elecAudioMono="",t.elecAudioOut="",t.elecAudioStereo="",t.elecCamera="",t.elecDataIn="",t.elecDataOut="",t.elecDisc="",t.elecDownload="",t.elecEject="",t.elecFastForward="",t.elecHeadphones="",t.elecHeadset="",t.elecLineIn="",t.elecLineOut="",t.elecLoop="",t.elecLoudspeaker="",t.elecMIDIController0="",t.elecMIDIController100="",t.elecMIDIController20="",t.elecMIDIController40="",t.elecMIDIController60="",t.elecMIDIController80="",t.elecMIDIIn="",t.elecMIDIOut="",t.elecMicrophone="",t.elecMicrophoneMute="",t.elecMicrophoneUnmute="",t.elecMixingConsole="",t.elecMonitor="",t.elecMute="",t.elecPause="",t.elecPlay="",t.elecPowerOnOff="",t.elecProjector="",t.elecReplay="",t.elecRewind="",t.elecShuffle="",t.elecSkipBackwards="",t.elecSkipForwards="",t.elecStop="",t.elecTape="",t.elecUSB="",t.elecUnmute="",t.elecUpload="",t.elecVideoCamera="",t.elecVideoIn="",t.elecVideoOut="",t.elecVolumeFader="",t.elecVolumeFaderThumb="",t.elecVolumeLevel0="",t.elecVolumeLevel100="",t.elecVolumeLevel20="",t.elecVolumeLevel40="",t.elecVolumeLevel60="",t.elecVolumeLevel80="",t.fClef="",t.fClef15ma="",t.fClef15mb="",t.fClef8va="",t.fClef8vb="",t.fClefArrowDown="",t.fClefArrowUp="",t.fClefChange="",t.fClefReversed="",t.fClefTurned="",t.fermataAbove="",t.fermataBelow="",t.fermataLongAbove="",t.fermataLongBelow="",t.fermataLongHenzeAbove="",t.fermataLongHenzeBelow="",t.fermataShortAbove="",t.fermataShortBelow="",t.fermataShortHenzeAbove="",t.fermataShortHenzeBelow="",t.fermataVeryLongAbove="",t.fermataVeryLongBelow="",t.fermataVeryShortAbove="",t.fermataVeryShortBelow="",t.figbass0="",t.figbass1="",t.figbass2="",t.figbass2Raised="",t.figbass3="",t.figbass4="",t.figbass4Raised="",t.figbass5="",t.figbass5Raised1="",t.figbass5Raised2="",t.figbass5Raised3="",t.figbass6="",t.figbass6Raised="",t.figbass6Raised2="",t.figbass7="",t.figbass7Diminished="",t.figbass7Raised1="",t.figbass7Raised2="",t.figbass8="",t.figbass9="",t.figbass9Raised="",t.figbassBracketLeft="",t.figbassBracketRight="",t.figbassCombiningLowering="",t.figbassCombiningRaising="",t.figbassDoubleFlat="",t.figbassDoubleSharp="",t.figbassFlat="",t.figbassNatural="",t.figbassParensLeft="",t.figbassParensRight="",t.figbassPlus="",t.figbassSharp="",t.figbassTripleFlat="",t.figbassTripleSharp="",t.fingering0="",t.fingering0Italic="",t.fingering1="",t.fingering1Italic="",t.fingering2="",t.fingering2Italic="",t.fingering3="",t.fingering3Italic="",t.fingering4="",t.fingering4Italic="",t.fingering5="",t.fingering5Italic="",t.fingering6="",t.fingering6Italic="",t.fingering7="",t.fingering7Italic="",t.fingering8="",t.fingering8Italic="",t.fingering9="",t.fingering9Italic="",t.fingeringALower="",t.fingeringCLower="",t.fingeringELower="",t.fingeringILower="",t.fingeringLeftBracket="",t.fingeringLeftBracketItalic="",t.fingeringLeftParenthesis="",t.fingeringLeftParenthesisItalic="",t.fingeringMLower="",t.fingeringMultipleNotes="",t.fingeringOLower="",t.fingeringPLower="",t.fingeringQLower="",t.fingeringRightBracket="",t.fingeringRightBracketItalic="",t.fingeringRightParenthesis="",t.fingeringRightParenthesisItalic="",t.fingeringSLower="",t.fingeringSeparatorMiddleDot="",t.fingeringSeparatorMiddleDotWhite="",t.fingeringSeparatorSlash="",t.fingeringSubstitutionAbove="",t.fingeringSubstitutionBelow="",t.fingeringSubstitutionDash="",t.fingeringTLower="",t.fingeringTUpper="",t.fingeringXLower="",t.flag1024thDown="",t.flag1024thUp="",t.flag128thDown="",t.flag128thUp="",t.flag16thDown="",t.flag16thUp="",t.flag256thDown="",t.flag256thUp="",t.flag32ndDown="",t.flag32ndUp="",t.flag512thDown="",t.flag512thUp="",t.flag64thDown="",t.flag64thUp="",t.flag8thDown="",t.flag8thUp="",t.flagInternalDown="",t.flagInternalUp="",t.fretboard3String="",t.fretboard3StringNut="",t.fretboard4String="",t.fretboard4StringNut="",t.fretboard5String="",t.fretboard5StringNut="",t.fretboard6String="",t.fretboard6StringNut="",t.fretboardFilledCircle="",t.fretboardO="",t.fretboardX="",t.functionAngleLeft="",t.functionAngleRight="",t.functionBracketLeft="",t.functionBracketRight="",t.functionDD="",t.functionDLower="",t.functionDUpper="",t.functionEight="",t.functionFUpper="",t.functionFive="",t.functionFour="",t.functionGLower="",t.functionGUpper="",t.functionGreaterThan="",t.functionILower="",t.functionIUpper="",t.functionKLower="",t.functionKUpper="",t.functionLLower="",t.functionLUpper="",t.functionLessThan="",t.functionMLower="",t.functionMUpper="",t.functionMinus="",t.functionNLower="",t.functionNUpper="",t.functionNUpperSuperscript="",t.functionNine="",t.functionOne="",t.functionPLower="",t.functionPUpper="",t.functionParensLeft="",t.functionParensRight="",t.functionPlus="",t.functionRLower="",t.functionRepetition1="",t.functionRepetition2="",t.functionRing="",t.functionSLower="",t.functionSSLower="",t.functionSSUpper="",t.functionSUpper="",t.functionSeven="",t.functionSix="",t.functionSlashedDD="",t.functionTLower="",t.functionTUpper="",t.functionThree="",t.functionTwo="",t.functionVLower="",t.functionVUpper="",t.functionZero="",t.gClef="",t.gClef15ma="",t.gClef15mb="",t.gClef8va="",t.gClef8vb="",t.gClef8vbCClef="",t.gClef8vbOld="",t.gClef8vbParens="",t.gClefArrowDown="",t.gClefArrowUp="",t.gClefChange="",t.gClefLigatedNumberAbove="",t.gClefLigatedNumberBelow="",t.gClefReversed="",t.gClefTurned="",t.glissandoDown="",t.glissandoUp="",t.graceNoteAcciaccaturaStemDown="",t.graceNoteAcciaccaturaStemUp="",t.graceNoteAppoggiaturaStemDown="",t.graceNoteAppoggiaturaStemUp="",t.graceNoteSlashStemDown="",t.graceNoteSlashStemUp="",t.guitarBarreFull="",t.guitarBarreHalf="",t.guitarClosePedal="",t.guitarFadeIn="",t.guitarFadeOut="",t.guitarGolpe="",t.guitarHalfOpenPedal="",t.guitarLeftHandTapping="",t.guitarOpenPedal="",t.guitarRightHandTapping="",t.guitarShake="",t.guitarString0="",t.guitarString1="",t.guitarString10="",t.guitarString11="",t.guitarString12="",t.guitarString13="",t.guitarString2="",t.guitarString3="",t.guitarString4="",t.guitarString5="",t.guitarString6="",t.guitarString7="",t.guitarString8="",t.guitarString9="",t.guitarStrumDown="",t.guitarStrumUp="",t.guitarVibratoBarDip="",t.guitarVibratoBarScoop="",t.guitarVibratoStroke="",t.guitarVolumeSwell="",t.guitarWideVibratoStroke="",t.handbellsBelltree="",t.handbellsDamp3="",t.handbellsEcho1="",t.handbellsEcho2="",t.handbellsGyro="",t.handbellsHandMartellato="",t.handbellsMalletBellOnTable="",t.handbellsMalletBellSuspended="",t.handbellsMalletLft="",t.handbellsMartellato="",t.handbellsMartellatoLift="",t.handbellsMutedMartellato="",t.handbellsPluckLift="",t.handbellsSwing="",t.handbellsSwingDown="",t.handbellsSwingUp="",t.handbellsTablePairBells="",t.handbellsTableSingleBell="",t.harpMetalRod="",t.harpPedalCentered="",t.harpPedalDivider="",t.harpPedalLowered="",t.harpPedalRaised="",t.harpSalzedoAeolianAscending="",t.harpSalzedoAeolianDescending="",t.harpSalzedoDampAbove="",t.harpSalzedoDampBelow="",t.harpSalzedoDampBothHands="",t.harpSalzedoDampLowStrings="",t.harpSalzedoFluidicSoundsLeft="",t.harpSalzedoFluidicSoundsRight="",t.harpSalzedoIsolatedSounds="",t.harpSalzedoMetallicSounds="",t.harpSalzedoMetallicSoundsOneString="",t.harpSalzedoMuffleTotally="",t.harpSalzedoOboicFlux="",t.harpSalzedoPlayUpperEnd="",t.harpSalzedoSlideWithSuppleness="",t.harpSalzedoSnareDrum="",t.harpSalzedoTamTamSounds="",t.harpSalzedoThunderEffect="",t.harpSalzedoTimpanicSounds="",t.harpSalzedoWhistlingSounds="",t.harpStringNoiseStem="",t.harpTuningKey="",t.harpTuningKeyGlissando="",t.harpTuningKeyHandle="",t.harpTuningKeyShank="",t.indianDrumClef="",t.kahnBackChug="",t.kahnBackFlap="",t.kahnBackRiff="",t.kahnBackRip="",t.kahnBallChange="",t.kahnBallDig="",t.kahnBrushBackward="",t.kahnBrushForward="",t.kahnChug="",t.kahnClap="",t.kahnDoubleSnap="",t.kahnDoubleWing="",t.kahnDrawStep="",t.kahnDrawTap="",t.kahnFlam="",t.kahnFlap="",t.kahnFlapStep="",t.kahnFlat="",t.kahnFleaHop="",t.kahnFleaTap="",t.kahnGraceTap="",t.kahnGraceTapChange="",t.kahnGraceTapHop="",t.kahnGraceTapStamp="",t.kahnHeel="",t.kahnHeelChange="",t.kahnHeelClick="",t.kahnHeelDrop="",t.kahnHeelStep="",t.kahnHeelTap="",t.kahnHop="",t.kahnJumpApart="",t.kahnJumpTogether="",t.kahnKneeInward="",t.kahnKneeOutward="",t.kahnLeap="",t.kahnLeapFlatFoot="",t.kahnLeapHeelClick="",t.kahnLeftCatch="",t.kahnLeftCross="",t.kahnLeftFoot="",t.kahnLeftToeStrike="",t.kahnLeftTurn="",t.kahnOverTheTop="",t.kahnOverTheTopTap="",t.kahnPull="",t.kahnPush="",t.kahnRiff="",t.kahnRiffle="",t.kahnRightCatch="",t.kahnRightCross="",t.kahnRightFoot="",t.kahnRightToeStrike="",t.kahnRightTurn="",t.kahnRip="",t.kahnRipple="",t.kahnScrape="",t.kahnScuff="",t.kahnScuffle="",t.kahnShuffle="",t.kahnSlam="",t.kahnSlap="",t.kahnSlideStep="",t.kahnSlideTap="",t.kahnSnap="",t.kahnStamp="",t.kahnStampStamp="",t.kahnStep="",t.kahnStepStamp="",t.kahnStomp="",t.kahnStompBrush="",t.kahnTap="",t.kahnToe="",t.kahnToeClick="",t.kahnToeDrop="",t.kahnToeStep="",t.kahnToeTap="",t.kahnTrench="",t.kahnWing="",t.kahnWingChange="",t.kahnZank="",t.kahnZink="",t.keyboardBebung2DotsAbove="",t.keyboardBebung2DotsBelow="",t.keyboardBebung3DotsAbove="",t.keyboardBebung3DotsBelow="",t.keyboardBebung4DotsAbove="",t.keyboardBebung4DotsBelow="",t.keyboardLeftPedalPictogram="",t.keyboardMiddlePedalPictogram="",t.keyboardPedalD="",t.keyboardPedalDot="",t.keyboardPedalE="",t.keyboardPedalHalf="",t.keyboardPedalHalf2="",t.keyboardPedalHalf3="",t.keyboardPedalHeel1="",t.keyboardPedalHeel2="",t.keyboardPedalHeel3="",t.keyboardPedalHeelToToe="",t.keyboardPedalHeelToe="",t.keyboardPedalHookEnd="",t.keyboardPedalHookStart="",t.keyboardPedalHyphen="",t.keyboardPedalP="",t.keyboardPedalParensLeft="",t.keyboardPedalParensRight="",t.keyboardPedalPed="",t.keyboardPedalS="",t.keyboardPedalSost="",t.keyboardPedalToe1="",t.keyboardPedalToe2="",t.keyboardPedalToeToHeel="",t.keyboardPedalUp="",t.keyboardPedalUpNotch="",t.keyboardPedalUpSpecial="",t.keyboardPlayWithLH="",t.keyboardPlayWithLHEnd="",t.keyboardPlayWithRH="",t.keyboardPlayWithRHEnd="",t.keyboardPluckInside="",t.keyboardRightPedalPictogram="",t.kievanAccidentalFlat="",t.kievanAccidentalSharp="",t.kievanAugmentationDot="",t.kievanCClef="",t.kievanEndingSymbol="",t.kievanNote8thStemDown="",t.kievanNote8thStemUp="",t.kievanNoteBeam="",t.kievanNoteHalfStaffLine="",t.kievanNoteHalfStaffSpace="",t.kievanNoteQuarterStemDown="",t.kievanNoteQuarterStemUp="",t.kievanNoteReciting="",t.kievanNoteWhole="",t.kievanNoteWholeFinal="",t.kodalyHandDo="",t.kodalyHandFa="",t.kodalyHandLa="",t.kodalyHandMi="",t.kodalyHandRe="",t.kodalyHandSo="",t.kodalyHandTi="",t.leftRepeatSmall="",t.legerLine="",t.legerLineNarrow="",t.legerLineWide="",t.luteBarlineEndRepeat="",t.luteBarlineFinal="",t.luteBarlineStartRepeat="",t.luteDuration16th="",t.luteDuration32nd="",t.luteDuration8th="",t.luteDurationDoubleWhole="",t.luteDurationHalf="",t.luteDurationQuarter="",t.luteDurationWhole="",t.luteFingeringRHFirst="",t.luteFingeringRHSecond="",t.luteFingeringRHThird="",t.luteFingeringRHThumb="",t.luteFrench10thCourse="",t.luteFrench7thCourse="",t.luteFrench8thCourse="",t.luteFrench9thCourse="",t.luteFrenchAppoggiaturaAbove="",t.luteFrenchAppoggiaturaBelow="",t.luteFrenchFretA="",t.luteFrenchFretB="",t.luteFrenchFretC="",t.luteFrenchFretD="",t.luteFrenchFretE="",t.luteFrenchFretF="",t.luteFrenchFretG="",t.luteFrenchFretH="",t.luteFrenchFretI="",t.luteFrenchFretK="",t.luteFrenchFretL="",t.luteFrenchFretM="",t.luteFrenchFretN="",t.luteFrenchMordentInverted="",t.luteFrenchMordentLower="",t.luteFrenchMordentUpper="",t.luteGermanALower="",t.luteGermanAUpper="",t.luteGermanBLower="",t.luteGermanBUpper="",t.luteGermanCLower="",t.luteGermanCUpper="",t.luteGermanDLower="",t.luteGermanDUpper="",t.luteGermanELower="",t.luteGermanEUpper="",t.luteGermanFLower="",t.luteGermanFUpper="",t.luteGermanGLower="",t.luteGermanGUpper="",t.luteGermanHLower="",t.luteGermanHUpper="",t.luteGermanILower="",t.luteGermanIUpper="",t.luteGermanKLower="",t.luteGermanKUpper="",t.luteGermanLLower="",t.luteGermanLUpper="",t.luteGermanMLower="",t.luteGermanMUpper="",t.luteGermanNLower="",t.luteGermanNUpper="",t.luteGermanOLower="",t.luteGermanPLower="",t.luteGermanQLower="",t.luteGermanRLower="",t.luteGermanSLower="",t.luteGermanTLower="",t.luteGermanVLower="",t.luteGermanXLower="",t.luteGermanYLower="",t.luteGermanZLower="",t.luteItalianClefCSolFaUt="",t.luteItalianClefFFaUt="",t.luteItalianFret0="",t.luteItalianFret1="",t.luteItalianFret2="",t.luteItalianFret3="",t.luteItalianFret4="",t.luteItalianFret5="",t.luteItalianFret6="",t.luteItalianFret7="",t.luteItalianFret8="",t.luteItalianFret9="",t.luteItalianHoldFinger="",t.luteItalianHoldNote="",t.luteItalianReleaseFinger="",t.luteItalianTempoFast="",t.luteItalianTempoNeitherFastNorSlow="",t.luteItalianTempoSlow="",t.luteItalianTempoSomewhatFast="",t.luteItalianTempoVerySlow="",t.luteItalianTimeTriple="",t.luteItalianTremolo="",t.luteItalianVibrato="",t.luteStaff6Lines="",t.luteStaff6LinesNarrow="",t.luteStaff6LinesWide="",t.lyricsElision="",t.lyricsElisionNarrow="",t.lyricsElisionWide="",t.lyricsHyphenBaseline="",t.lyricsHyphenBaselineNonBreaking="",t.lyricsTextRepeat="",t.medRenFlatHardB="",t.medRenFlatSoftB="",t.medRenFlatWithDot="",t.medRenGClefCMN="",t.medRenLiquescenceCMN="",t.medRenLiquescentAscCMN="",t.medRenLiquescentDescCMN="",t.medRenNatural="",t.medRenNaturalWithCross="",t.medRenOriscusCMN="",t.medRenPlicaCMN="",t.medRenPunctumCMN="",t.medRenQuilismaCMN="",t.medRenSharpCroix="",t.medRenStrophicusCMN="",t.mensuralAlterationSign="",t.mensuralBlackBrevis="",t.mensuralBlackBrevisVoid="",t.mensuralBlackDragma="",t.mensuralBlackLonga="",t.mensuralBlackMaxima="",t.mensuralBlackMinima="",t.mensuralBlackMinimaVoid="",t.mensuralBlackSemibrevis="",t.mensuralBlackSemibrevisCaudata="",t.mensuralBlackSemibrevisOblique="",t.mensuralBlackSemibrevisVoid="",t.mensuralBlackSemiminima="",t.mensuralCclef="",t.mensuralCclefPetrucciPosHigh="",t.mensuralCclefPetrucciPosHighest="",t.mensuralCclefPetrucciPosLow="",t.mensuralCclefPetrucciPosLowest="",t.mensuralCclefPetrucciPosMiddle="",t.mensuralColorationEndRound="",t.mensuralColorationEndSquare="",t.mensuralColorationStartRound="",t.mensuralColorationStartSquare="",t.mensuralCombStemDiagonal="",t.mensuralCombStemDown="",t.mensuralCombStemDownFlagExtended="",t.mensuralCombStemDownFlagFlared="",t.mensuralCombStemDownFlagFusa="",t.mensuralCombStemDownFlagLeft="",t.mensuralCombStemDownFlagRight="",t.mensuralCombStemDownFlagSemiminima="",t.mensuralCombStemUp="",t.mensuralCombStemUpFlagExtended="",t.mensuralCombStemUpFlagFlared="",t.mensuralCombStemUpFlagFusa="",t.mensuralCombStemUpFlagLeft="",t.mensuralCombStemUpFlagRight="",t.mensuralCombStemUpFlagSemiminima="",t.mensuralCustosCheckmark="",t.mensuralCustosDown="",t.mensuralCustosTurn="",t.mensuralCustosUp="",t.mensuralFclef="",t.mensuralFclefPetrucci="",t.mensuralGclef="",t.mensuralGclefPetrucci="",t.mensuralModusImperfectumVert="",t.mensuralModusPerfectumVert="",t.mensuralNoteheadLongaBlack="",t.mensuralNoteheadLongaBlackVoid="",t.mensuralNoteheadLongaVoid="",t.mensuralNoteheadLongaWhite="",t.mensuralNoteheadMaximaBlack="",t.mensuralNoteheadMaximaBlackVoid="",t.mensuralNoteheadMaximaVoid="",t.mensuralNoteheadMaximaWhite="",t.mensuralNoteheadMinimaWhite="",t.mensuralNoteheadSemibrevisBlack="",t.mensuralNoteheadSemibrevisBlackVoid="",t.mensuralNoteheadSemibrevisBlackVoidTurned="",t.mensuralNoteheadSemibrevisVoid="",t.mensuralNoteheadSemiminimaWhite="",t.mensuralObliqueAsc2ndBlack="",t.mensuralObliqueAsc2ndBlackVoid="",t.mensuralObliqueAsc2ndVoid="",t.mensuralObliqueAsc2ndWhite="",t.mensuralObliqueAsc3rdBlack="",t.mensuralObliqueAsc3rdBlackVoid="",t.mensuralObliqueAsc3rdVoid="",t.mensuralObliqueAsc3rdWhite="",t.mensuralObliqueAsc4thBlack="",t.mensuralObliqueAsc4thBlackVoid="",t.mensuralObliqueAsc4thVoid="",t.mensuralObliqueAsc4thWhite="",t.mensuralObliqueAsc5thBlack="",t.mensuralObliqueAsc5thBlackVoid="",t.mensuralObliqueAsc5thVoid="",t.mensuralObliqueAsc5thWhite="",t.mensuralObliqueDesc2ndBlack="",t.mensuralObliqueDesc2ndBlackVoid="",t.mensuralObliqueDesc2ndVoid="",t.mensuralObliqueDesc2ndWhite="",t.mensuralObliqueDesc3rdBlack="";t.mensuralObliqueDesc3rdBlackVoid="",t.mensuralObliqueDesc3rdVoid="",t.mensuralObliqueDesc3rdWhite="",t.mensuralObliqueDesc4thBlack="",t.mensuralObliqueDesc4thBlackVoid="",t.mensuralObliqueDesc4thVoid="",t.mensuralObliqueDesc4thWhite="",t.mensuralObliqueDesc5thBlack="",t.mensuralObliqueDesc5thBlackVoid="",t.mensuralObliqueDesc5thVoid="",t.mensuralObliqueDesc5thWhite="",t.mensuralProlation1="",t.mensuralProlation10="",t.mensuralProlation11="",t.mensuralProlation2="",t.mensuralProlation3="",t.mensuralProlation4="",t.mensuralProlation5="",t.mensuralProlation6="",t.mensuralProlation7="",t.mensuralProlation8="",t.mensuralProlation9="",t.mensuralProlationCombiningDot="",t.mensuralProlationCombiningDotVoid="",t.mensuralProlationCombiningStroke="",t.mensuralProlationCombiningThreeDots="",t.mensuralProlationCombiningThreeDotsTri="",t.mensuralProlationCombiningTwoDots="",t.mensuralProportion1="",t.mensuralProportion2="",t.mensuralProportion3="",t.mensuralProportion4="",t.mensuralProportion5="",t.mensuralProportion6="",t.mensuralProportion7="",t.mensuralProportion8="",t.mensuralProportion9="",t.mensuralProportionMajor="",t.mensuralProportionMinor="",t.mensuralProportionProportioDupla1="",t.mensuralProportionProportioDupla2="",t.mensuralProportionProportioQuadrupla="",t.mensuralProportionProportioTripla="",t.mensuralProportionTempusPerfectum="",t.mensuralRestBrevis="",t.mensuralRestFusa="",t.mensuralRestLongaImperfecta="",t.mensuralRestLongaPerfecta="",t.mensuralRestMaxima="",t.mensuralRestMinima="",t.mensuralRestSemibrevis="",t.mensuralRestSemifusa="",t.mensuralRestSemiminima="",t.mensuralSignumDown="",t.mensuralSignumUp="",t.mensuralTempusImperfectumHoriz="",t.mensuralTempusPerfectumHoriz="",t.mensuralWhiteBrevis="",t.mensuralWhiteFusa="",t.mensuralWhiteLonga="",t.mensuralWhiteMaxima="",t.mensuralWhiteMinima="",t.mensuralWhiteSemibrevis="",t.mensuralWhiteSemiminima="",t.metAugmentationDot="",t.metNote1024thDown="",t.metNote1024thUp="",t.metNote128thDown="",t.metNote128thUp="",t.metNote16thDown="",t.metNote16thUp="",t.metNote256thDown="",t.metNote256thUp="",t.metNote32ndDown="",t.metNote32ndUp="",t.metNote512thDown="",t.metNote512thUp="",t.metNote64thDown="",t.metNote64thUp="",t.metNote8thDown="",t.metNote8thUp="",t.metNoteDoubleWhole="",t.metNoteDoubleWholeSquare="",t.metNoteHalfDown="",t.metNoteHalfUp="",t.metNoteQuarterDown="",t.metNoteQuarterUp="",t.metNoteWhole="",t.metricModulationArrowLeft="",t.metricModulationArrowRight="",t.miscDoNotCopy="",t.miscDoNotPhotocopy="",t.miscEyeglasses="",t.note1024thDown="",t.note1024thUp="",t.note128thDown="",t.note128thUp="",t.note16thDown="",t.note16thUp="",t.note256thDown="",t.note256thUp="",t.note32ndDown="",t.note32ndUp="",t.note512thDown="",t.note512thUp="",t.note64thDown="",t.note64thUp="",t.note8thDown="",t.note8thUp="",t.noteABlack="",t.noteAFlatBlack="",t.noteAFlatHalf="",t.noteAFlatWhole="",t.noteAHalf="",t.noteASharpBlack="",t.noteASharpHalf="",t.noteASharpWhole="",t.noteAWhole="",t.noteBBlack="",t.noteBFlatBlack="",t.noteBFlatHalf="",t.noteBFlatWhole="",t.noteBHalf="",t.noteBSharpBlack="",t.noteBSharpHalf="",t.noteBSharpWhole="",t.noteBWhole="",t.noteCBlack="",t.noteCFlatBlack="",t.noteCFlatHalf="",t.noteCFlatWhole="",t.noteCHalf="",t.noteCSharpBlack="",t.noteCSharpHalf="",t.noteCSharpWhole="",t.noteCWhole="",t.noteDBlack="",t.noteDFlatBlack="",t.noteDFlatHalf="",t.noteDFlatWhole="",t.noteDHalf="",t.noteDSharpBlack="",t.noteDSharpHalf="",t.noteDSharpWhole="",t.noteDWhole="",t.noteDiBlack="",t.noteDiHalf="",t.noteDiWhole="",t.noteDoBlack="",t.noteDoHalf="",t.noteDoWhole="",t.noteDoubleWhole="",t.noteDoubleWholeSquare="",t.noteEBlack="",t.noteEFlatBlack="",t.noteEFlatHalf="",t.noteEFlatWhole="",t.noteEHalf="",t.noteESharpBlack="",t.noteESharpHalf="",t.noteESharpWhole="",t.noteEWhole="",t.noteEmptyBlack="",t.noteEmptyHalf="",t.noteEmptyWhole="",t.noteFBlack="",t.noteFFlatBlack="",t.noteFFlatHalf="",t.noteFFlatWhole="",t.noteFHalf="",t.noteFSharpBlack="",t.noteFSharpHalf="",t.noteFSharpWhole="",t.noteFWhole="",t.noteFaBlack="",t.noteFaHalf="",t.noteFaWhole="",t.noteFiBlack="",t.noteFiHalf="",t.noteFiWhole="",t.noteGBlack="",t.noteGFlatBlack="",t.noteGFlatHalf="",t.noteGFlatWhole="",t.noteGHalf="",t.noteGSharpBlack="",t.noteGSharpHalf="",t.noteGSharpWhole="",t.noteGWhole="",t.noteHBlack="",t.noteHHalf="",t.noteHSharpBlack="",t.noteHSharpHalf="",t.noteHSharpWhole="",t.noteHWhole="",t.noteHalfDown="",t.noteHalfUp="",t.noteLaBlack="",t.noteLaHalf="",t.noteLaWhole="",t.noteLeBlack="",t.noteLeHalf="",t.noteLeWhole="",t.noteLiBlack="",t.noteLiHalf="",t.noteLiWhole="",t.noteMeBlack="",t.noteMeHalf="",t.noteMeWhole="",t.noteMiBlack="",t.noteMiHalf="",t.noteMiWhole="",t.noteQuarterDown="",t.noteQuarterUp="",t.noteRaBlack="",t.noteRaHalf="",t.noteRaWhole="",t.noteReBlack="",t.noteReHalf="",t.noteReWhole="",t.noteRiBlack="",t.noteRiHalf="",t.noteRiWhole="",t.noteSeBlack="",t.noteSeHalf="",t.noteSeWhole="",t.noteShapeArrowheadLeftBlack="",t.noteShapeArrowheadLeftDoubleWhole="",t.noteShapeArrowheadLeftWhite="",t.noteShapeDiamondBlack="",t.noteShapeDiamondDoubleWhole="",t.noteShapeDiamondWhite="",t.noteShapeIsoscelesTriangleBlack="",t.noteShapeIsoscelesTriangleDoubleWhole="",t.noteShapeIsoscelesTriangleWhite="",t.noteShapeKeystoneBlack="",t.noteShapeKeystoneDoubleWhole="",t.noteShapeKeystoneWhite="",t.noteShapeMoonBlack="",t.noteShapeMoonDoubleWhole="",t.noteShapeMoonLeftBlack="",t.noteShapeMoonLeftDoubleWhole="",t.noteShapeMoonLeftWhite="",t.noteShapeMoonWhite="",t.noteShapeQuarterMoonBlack="",t.noteShapeQuarterMoonDoubleWhole="",t.noteShapeQuarterMoonWhite="",t.noteShapeRoundBlack="",t.noteShapeRoundDoubleWhole="",t.noteShapeRoundWhite="",t.noteShapeSquareBlack="",t.noteShapeSquareDoubleWhole="",t.noteShapeSquareWhite="",t.noteShapeTriangleLeftBlack="",t.noteShapeTriangleLeftDoubleWhole="",t.noteShapeTriangleLeftWhite="",t.noteShapeTriangleRightBlack="",t.noteShapeTriangleRightDoubleWhole="",t.noteShapeTriangleRightWhite="",t.noteShapeTriangleRoundBlack="",t.noteShapeTriangleRoundDoubleWhole="",t.noteShapeTriangleRoundLeftBlack="",t.noteShapeTriangleRoundLeftDoubleWhole="",t.noteShapeTriangleRoundLeftWhite="",t.noteShapeTriangleRoundWhite="",t.noteShapeTriangleUpBlack="",t.noteShapeTriangleUpDoubleWhole="",t.noteShapeTriangleUpWhite="",t.noteSiBlack="",t.noteSiHalf="",t.noteSiWhole="",t.noteSoBlack="",t.noteSoHalf="",t.noteSoWhole="",t.noteTeBlack="",t.noteTeHalf="",t.noteTeWhole="",t.noteTiBlack="",t.noteTiHalf="",t.noteTiWhole="",t.noteWhole="",t.noteheadBlack="",t.noteheadCircleSlash="",t.noteheadCircleX="",t.noteheadCircleXDoubleWhole="",t.noteheadCircleXHalf="",t.noteheadCircleXWhole="",t.noteheadCircledBlack="",t.noteheadCircledBlackLarge="",t.noteheadCircledDoubleWhole="",t.noteheadCircledDoubleWholeLarge="",t.noteheadCircledHalf="",t.noteheadCircledHalfLarge="",t.noteheadCircledWhole="",t.noteheadCircledWholeLarge="",t.noteheadCircledXLarge="",t.noteheadClusterDoubleWhole2nd="",t.noteheadClusterDoubleWhole3rd="",t.noteheadClusterDoubleWholeBottom="",t.noteheadClusterDoubleWholeMiddle="",t.noteheadClusterDoubleWholeTop="",t.noteheadClusterHalf2nd="",t.noteheadClusterHalf3rd="",t.noteheadClusterHalfBottom="",t.noteheadClusterHalfMiddle="",t.noteheadClusterHalfTop="",t.noteheadClusterQuarter2nd="",t.noteheadClusterQuarter3rd="",t.noteheadClusterQuarterBottom="",t.noteheadClusterQuarterMiddle="",t.noteheadClusterQuarterTop="",t.noteheadClusterRoundBlack="",t.noteheadClusterRoundWhite="",t.noteheadClusterSquareBlack="",t.noteheadClusterSquareWhite="",t.noteheadClusterWhole2nd="",t.noteheadClusterWhole3rd="",t.noteheadClusterWholeBottom="",t.noteheadClusterWholeMiddle="",t.noteheadClusterWholeTop="",t.noteheadCowellEleventhNoteSeriesHalf="",t.noteheadCowellEleventhNoteSeriesWhole="",t.noteheadCowellEleventhSeriesBlack="",t.noteheadCowellFifteenthNoteSeriesBlack="",t.noteheadCowellFifteenthNoteSeriesHalf="",t.noteheadCowellFifteenthNoteSeriesWhole="",t.noteheadCowellFifthNoteSeriesBlack="",t.noteheadCowellFifthNoteSeriesHalf="",t.noteheadCowellFifthNoteSeriesWhole="",t.noteheadCowellNinthNoteSeriesBlack="",t.noteheadCowellNinthNoteSeriesHalf="",t.noteheadCowellNinthNoteSeriesWhole="",t.noteheadCowellSeventhNoteSeriesBlack="",t.noteheadCowellSeventhNoteSeriesHalf="",t.noteheadCowellSeventhNoteSeriesWhole="",t.noteheadCowellThirdNoteSeriesBlack="",t.noteheadCowellThirdNoteSeriesHalf="",t.noteheadCowellThirdNoteSeriesWhole="",t.noteheadCowellThirteenthNoteSeriesBlack="",t.noteheadCowellThirteenthNoteSeriesHalf="",t.noteheadCowellThirteenthNoteSeriesWhole="",t.noteheadDiamondBlack="",t.noteheadDiamondBlackOld="",t.noteheadDiamondBlackWide="",t.noteheadDiamondClusterBlack2nd="",t.noteheadDiamondClusterBlack3rd="",t.noteheadDiamondClusterBlackBottom="",t.noteheadDiamondClusterBlackMiddle="",t.noteheadDiamondClusterBlackTop="",t.noteheadDiamondClusterWhite2nd="",t.noteheadDiamondClusterWhite3rd="",t.noteheadDiamondClusterWhiteBottom="",t.noteheadDiamondClusterWhiteMiddle="",t.noteheadDiamondClusterWhiteTop="",t.noteheadDiamondDoubleWhole="",t.noteheadDiamondDoubleWholeOld="",t.noteheadDiamondHalf="",t.noteheadDiamondHalfFilled="",t.noteheadDiamondHalfOld="",t.noteheadDiamondHalfWide="",t.noteheadDiamondOpen="",t.noteheadDiamondWhite="",t.noteheadDiamondWhiteWide="",t.noteheadDiamondWhole="",t.noteheadDiamondWholeOld="",t.noteheadDoubleWhole="",t.noteheadDoubleWholeSquare="",t.noteheadDoubleWholeWithX="",t.noteheadHalf="",t.noteheadHalfFilled="",t.noteheadHalfWithX="",t.noteheadHeavyX="",t.noteheadHeavyXHat="",t.noteheadLargeArrowDownBlack="",t.noteheadLargeArrowDownDoubleWhole="",t.noteheadLargeArrowDownHalf="",t.noteheadLargeArrowDownWhole="",t.noteheadLargeArrowUpBlack="",t.noteheadLargeArrowUpDoubleWhole="",t.noteheadLargeArrowUpHalf="",t.noteheadLargeArrowUpWhole="",t.noteheadMoonBlack="",t.noteheadMoonWhite="",t.noteheadNancarrowSine="",t.noteheadNull="",t.noteheadParenthesis="",t.noteheadParenthesisLeft="",t.noteheadParenthesisRight="",t.noteheadPlusBlack="",t.noteheadPlusDoubleWhole="",t.noteheadPlusHalf="",t.noteheadPlusWhole="",t.noteheadRectangularClusterBlackBottom="",t.noteheadRectangularClusterBlackMiddle="",t.noteheadRectangularClusterBlackTop="",t.noteheadRectangularClusterWhiteBottom="",t.noteheadRectangularClusterWhiteMiddle="",t.noteheadRectangularClusterWhiteTop="",t.noteheadRoundBlack="",t.noteheadRoundBlackDoubleSlashed="",t.noteheadRoundBlackLarge="",t.noteheadRoundBlackSlashed="",t.noteheadRoundBlackSlashedLarge="",t.noteheadRoundWhite="",t.noteheadRoundWhiteDoubleSlashed="",t.noteheadRoundWhiteLarge="",t.noteheadRoundWhiteSlashed="",t.noteheadRoundWhiteSlashedLarge="",t.noteheadRoundWhiteWithDot="",t.noteheadRoundWhiteWithDotLarge="",t.noteheadSlashDiamondWhite="",t.noteheadSlashHorizontalEnds="",t.noteheadSlashHorizontalEndsMuted="",t.noteheadSlashVerticalEnds="",t.noteheadSlashVerticalEndsMuted="",t.noteheadSlashVerticalEndsSmall="",t.noteheadSlashWhiteDoubleWhole="",t.noteheadSlashWhiteHalf="",t.noteheadSlashWhiteMuted="",t.noteheadSlashWhiteWhole="",t.noteheadSlashX="",t.noteheadSlashedBlack1="",t.noteheadSlashedBlack2="",t.noteheadSlashedDoubleWhole1="",t.noteheadSlashedDoubleWhole2="",t.noteheadSlashedHalf1="",t.noteheadSlashedHalf2="",t.noteheadSlashedWhole1="",t.noteheadSlashedWhole2="",t.noteheadSquareBlack="",t.noteheadSquareBlackLarge="",t.noteheadSquareBlackWhite="",t.noteheadSquareWhite="",t.noteheadTriangleDownBlack="",t.noteheadTriangleDownDoubleWhole="",t.noteheadTriangleDownHalf="",t.noteheadTriangleDownWhite="",t.noteheadTriangleDownWhole="",t.noteheadTriangleLeftBlack="",t.noteheadTriangleLeftWhite="",t.noteheadTriangleRightBlack="",t.noteheadTriangleRightWhite="",t.noteheadTriangleRoundDownBlack="",t.noteheadTriangleRoundDownWhite="",t.noteheadTriangleUpBlack="",t.noteheadTriangleUpDoubleWhole="",t.noteheadTriangleUpHalf="",t.noteheadTriangleUpRightBlack="",t.noteheadTriangleUpRightWhite="",t.noteheadTriangleUpWhite="",t.noteheadTriangleUpWhole="",t.noteheadVoidWithX="",t.noteheadWhole="",t.noteheadWholeFilled="",t.noteheadWholeWithX="",t.noteheadXBlack="",t.noteheadXDoubleWhole="",t.noteheadXHalf="",t.noteheadXOrnate="",t.noteheadXOrnateEllipse="",t.noteheadXWhole="",t.octaveBaselineA="",t.octaveBaselineB="",t.octaveBaselineM="",t.octaveBaselineV="",t.octaveBassa="",t.octaveLoco="",t.octaveParensLeft="",t.octaveParensRight="",t.octaveSuperscriptA="",t.octaveSuperscriptB="",t.octaveSuperscriptM="",t.octaveSuperscriptV="",t.oneHandedRollStevens="",t.organGerman2Fusae="",t.organGerman2Minimae="",t.organGerman2OctaveUp="",t.organGerman2Semifusae="",t.organGerman2Semiminimae="",t.organGerman3Fusae="",t.organGerman3Minimae="",t.organGerman3Semifusae="",t.organGerman3Semiminimae="",t.organGerman4Fusae="",t.organGerman4Minimae="",t.organGerman4Semifusae="",t.organGerman4Semiminimae="",t.organGerman5Fusae="",t.organGerman5Minimae="",t.organGerman5Semifusae="",t.organGerman5Semiminimae="",t.organGerman6Fusae="",t.organGerman6Minimae="",t.organGerman6Semifusae="",t.organGerman6Semiminimae="",t.organGermanALower="",t.organGermanAUpper="",t.organGermanAugmentationDot="",t.organGermanBLower="",t.organGermanBUpper="",t.organGermanBuxheimerBrevis2="",t.organGermanBuxheimerBrevis3="",t.organGermanBuxheimerMinimaRest="",t.organGermanBuxheimerSemibrevis="",t.organGermanBuxheimerSemibrevisRest="",t.organGermanCLower="",t.organGermanCUpper="",t.organGermanCisLower="",t.organGermanCisUpper="",t.organGermanDLower="",t.organGermanDUpper="",t.organGermanDisLower="",t.organGermanDisUpper="",t.organGermanELower="",t.organGermanEUpper="",t.organGermanFLower="",t.organGermanFUpper="",t.organGermanFisLower="",t.organGermanFisUpper="",t.organGermanFusa="",t.organGermanFusaRest="",t.organGermanGLower="",t.organGermanGUpper="",t.organGermanGisLower="",t.organGermanGisUpper="",t.organGermanHLower="",t.organGermanHUpper="",t.organGermanMinima="",t.organGermanMinimaRest="",t.organGermanOctaveDown="",t.organGermanOctaveUp="",t.organGermanSemibrevis="",t.organGermanSemibrevisRest="",t.organGermanSemifusa="",t.organGermanSemifusaRest="",t.organGermanSemiminima="",t.organGermanSemiminimaRest="",t.organGermanTie="",t.ornamentBottomLeftConcaveStroke="",t.ornamentBottomLeftConcaveStrokeLarge="",t.ornamentBottomLeftConvexStroke="",t.ornamentBottomRightConcaveStroke="",t.ornamentBottomRightConvexStroke="",t.ornamentComma="",t.ornamentDoubleObliqueLinesAfterNote="",t.ornamentDoubleObliqueLinesBeforeNote="",t.ornamentDownCurve="",t.ornamentHaydn="",t.ornamentHighLeftConcaveStroke="",t.ornamentHighLeftConvexStroke="",t.ornamentHighRightConcaveStroke="",t.ornamentHighRightConvexStroke="",t.ornamentHookAfterNote="",t.ornamentHookBeforeNote="",t.ornamentLeftFacingHalfCircle="",t.ornamentLeftFacingHook="",t.ornamentLeftPlus="",t.ornamentLeftShakeT="",t.ornamentLeftVerticalStroke="",t.ornamentLeftVerticalStrokeWithCross="",t.ornamentLowLeftConcaveStroke="",t.ornamentLowLeftConvexStroke="",t.ornamentLowRightConcaveStroke="",t.ornamentLowRightConvexStroke="",t.ornamentMiddleVerticalStroke="",t.ornamentMordent="",t.ornamentObliqueLineAfterNote="",t.ornamentObliqueLineBeforeNote="",t.ornamentObliqueLineHorizAfterNote="",t.ornamentObliqueLineHorizBeforeNote="",t.ornamentOriscus="",t.ornamentPinceCouperin="",t.ornamentPortDeVoixV="",t.ornamentPrecompAppoggTrill="",t.ornamentPrecompAppoggTrillSuffix="",t.ornamentPrecompCadence="",t.ornamentPrecompCadenceUpperPrefix="",t.ornamentPrecompCadenceUpperPrefixTurn="",t.ornamentPrecompCadenceWithTurn="",t.ornamentPrecompDescendingSlide="",t.ornamentPrecompDoubleCadenceLowerPrefix="",t.ornamentPrecompDoubleCadenceUpperPrefix="",t.ornamentPrecompDoubleCadenceUpperPrefixTurn="",t.ornamentPrecompInvertedMordentUpperPrefix="",t.ornamentPrecompMordentRelease="",t.ornamentPrecompMordentUpperPrefix="",t.ornamentPrecompPortDeVoixMordent="",t.ornamentPrecompSlide="",t.ornamentPrecompSlideTrillBach="",t.ornamentPrecompSlideTrillDAnglebert="",t.ornamentPrecompSlideTrillMarpurg="",t.ornamentPrecompSlideTrillMuffat="",t.ornamentPrecompSlideTrillSuffixMuffat="",t.ornamentPrecompTrillLowerSuffix="",t.ornamentPrecompTrillSuffixDandrieu="",t.ornamentPrecompTrillWithMordent="",t.ornamentPrecompTurnTrillBach="",t.ornamentPrecompTurnTrillDAnglebert="",t.ornamentQuilisma="",t.ornamentRightFacingHalfCircle="",t.ornamentRightFacingHook="",t.ornamentRightVerticalStroke="",t.ornamentSchleifer="",t.ornamentShake3="",t.ornamentShakeMuffat1="",t.ornamentShortObliqueLineAfterNote="",t.ornamentShortObliqueLineBeforeNote="",t.ornamentShortTrill="",t.ornamentTopLeftConcaveStroke="",t.ornamentTopLeftConvexStroke="",t.ornamentTopRightConcaveStroke="",t.ornamentTopRightConvexStroke="",t.ornamentTremblement="",t.ornamentTremblementCouperin="",t.ornamentTrill="",t.ornamentTurn="",t.ornamentTurnInverted="",t.ornamentTurnSlash="",t.ornamentTurnUp="",t.ornamentTurnUpS="",t.ornamentUpCurve="",t.ornamentVerticalLine="",t.ornamentZigZagLineNoRightEnd="",t.ornamentZigZagLineWithRightEnd="",t.ottava="",t.ottavaAlta="",t.ottavaBassa="",t.ottavaBassaBa="",t.ottavaBassaVb="",t.pendereckiTremolo="",t.pictAgogo="",t.pictAlmglocken="",t.pictAnvil="",t.pictBambooChimes="",t.pictBambooScraper="",t.pictBassDrum="",t.pictBassDrumOnSide="",t.pictBeaterBow="",t.pictBeaterBox="",t.pictBeaterBrassMalletsDown="",t.pictBeaterBrassMalletsLeft="",t.pictBeaterBrassMalletsRight="",t.pictBeaterBrassMalletsUp="",t.pictBeaterCombiningDashedCircle="",t.pictBeaterCombiningParentheses="",t.pictBeaterDoubleBassDrumDown="",t.pictBeaterDoubleBassDrumUp="",t.pictBeaterFinger="",t.pictBeaterFingernails="",t.pictBeaterFist="",t.pictBeaterGuiroScraper="",t.pictBeaterHammer="",t.pictBeaterHammerMetalDown="",t.pictBeaterHammerMetalUp="",t.pictBeaterHammerPlasticDown="",t.pictBeaterHammerPlasticUp="",t.pictBeaterHammerWoodDown="",t.pictBeaterHammerWoodUp="",t.pictBeaterHand="",t.pictBeaterHardBassDrumDown="",t.pictBeaterHardBassDrumUp="",t.pictBeaterHardGlockenspielDown="",t.pictBeaterHardGlockenspielLeft="",t.pictBeaterHardGlockenspielRight="",t.pictBeaterHardGlockenspielUp="",t.pictBeaterHardTimpaniDown="",t.pictBeaterHardTimpaniLeft="",t.pictBeaterHardTimpaniRight="",t.pictBeaterHardTimpaniUp="",t.pictBeaterHardXylophoneDown="",t.pictBeaterHardXylophoneLeft="",t.pictBeaterHardXylophoneRight="",t.pictBeaterHardXylophoneUp="",t.pictBeaterHardYarnDown="",t.pictBeaterHardYarnLeft="",t.pictBeaterHardYarnRight="",t.pictBeaterHardYarnUp="",t.pictBeaterJazzSticksDown="",t.pictBeaterJazzSticksUp="",t.pictBeaterKnittingNeedle="",t.pictBeaterMallet="",t.pictBeaterMalletDown="",t.pictBeaterMediumBassDrumDown="",t.pictBeaterMediumBassDrumUp="",t.pictBeaterMediumTimpaniDown="",t.pictBeaterMediumTimpaniLeft="",t.pictBeaterMediumTimpaniRight="",t.pictBeaterMediumTimpaniUp="",t.pictBeaterMediumXylophoneDown="",t.pictBeaterMediumXylophoneLeft="",t.pictBeaterMediumXylophoneRight="",t.pictBeaterMediumXylophoneUp="",t.pictBeaterMediumYarnDown="",t.pictBeaterMediumYarnLeft="",t.pictBeaterMediumYarnRight="",t.pictBeaterMediumYarnUp="",t.pictBeaterMetalBassDrumDown="",t.pictBeaterMetalBassDrumUp="",t.pictBeaterMetalDown="",t.pictBeaterMetalHammer="",t.pictBeaterMetalLeft="",t.pictBeaterMetalRight="",t.pictBeaterMetalUp="",t.pictBeaterSnareSticksDown="",t.pictBeaterSnareSticksUp="",t.pictBeaterSoftBassDrumDown="",t.pictBeaterSoftBassDrumUp="",t.pictBeaterSoftGlockenspielDown="",t.pictBeaterSoftGlockenspielLeft="",t.pictBeaterSoftGlockenspielRight="",t.pictBeaterSoftGlockenspielUp="",t.pictBeaterSoftTimpaniDown="",t.pictBeaterSoftTimpaniLeft="",t.pictBeaterSoftTimpaniRight="",t.pictBeaterSoftTimpaniUp="",t.pictBeaterSoftXylophone="",t.pictBeaterSoftXylophoneDown="",t.pictBeaterSoftXylophoneLeft="",t.pictBeaterSoftXylophoneRight="",t.pictBeaterSoftXylophoneUp="",t.pictBeaterSoftYarnDown="",t.pictBeaterSoftYarnLeft="",t.pictBeaterSoftYarnRight="",t.pictBeaterSoftYarnUp="",t.pictBeaterSpoonWoodenMallet="",t.pictBeaterSuperballDown="",t.pictBeaterSuperballLeft="",t.pictBeaterSuperballRight="",t.pictBeaterSuperballUp="",t.pictBeaterTriangleDown="",t.pictBeaterTrianglePlain="",t.pictBeaterTriangleUp="",t.pictBeaterWireBrushesDown="",t.pictBeaterWireBrushesUp="",t.pictBeaterWoodTimpaniDown="",t.pictBeaterWoodTimpaniLeft="",t.pictBeaterWoodTimpaniRight="",t.pictBeaterWoodTimpaniUp="",t.pictBeaterWoodXylophoneDown="",t.pictBeaterWoodXylophoneLeft="",t.pictBeaterWoodXylophoneRight="",t.pictBeaterWoodXylophoneUp="",t.pictBell="",t.pictBellOfCymbal="",t.pictBellPlate="",t.pictBellTree="",t.pictBirdWhistle="",t.pictBoardClapper="",t.pictBongos="",t.pictBrakeDrum="",t.pictCabasa="",t.pictCannon="",t.pictCarHorn="",t.pictCastanets="",t.pictCastanetsWithHandle="",t.pictCelesta="",t.pictCencerro="",t.pictCenter1="",t.pictCenter2="",t.pictCenter3="",t.pictChainRattle="",t.pictChimes="",t.pictChineseCymbal="",t.pictChokeCymbal="",t.pictClaves="",t.pictCoins="",t.pictConga="",t.pictCowBell="",t.pictCrashCymbals="",t.pictCrotales="",t.pictCrushStem="",t.pictCuica="",t.pictCymbalTongs="",t.pictDamp1="",t.pictDamp2="",t.pictDamp3="",t.pictDamp4="",t.pictDeadNoteStem="",t.pictDrumStick="",t.pictDuckCall="",t.pictEdgeOfCymbal="",t.pictEmptyTrap="",t.pictFingerCymbals="",t.pictFlexatone="",t.pictFootballRatchet="",t.pictGlassHarmonica="",t.pictGlassHarp="",t.pictGlassPlateChimes="",t.pictGlassTubeChimes="",t.pictGlsp="",t.pictGlspSmithBrindle="",t.pictGobletDrum="",t.pictGong="",t.pictGongWithButton="",t.pictGuiro="",t.pictGumHardDown="",t.pictGumHardLeft="",t.pictGumHardRight="",t.pictGumHardUp="",t.pictGumMediumDown="";t.pictGumMediumLeft="",t.pictGumMediumRight="",t.pictGumMediumUp="",t.pictGumSoftDown="",t.pictGumSoftLeft="",t.pictGumSoftRight="",t.pictGumSoftUp="",t.pictHalfOpen1="",t.pictHalfOpen2="",t.pictHandbell="",t.pictHiHat="",t.pictHiHatOnStand="",t.pictJawHarp="",t.pictJingleBells="",t.pictKlaxonHorn="",t.pictLeftHandCircle="",t.pictLionsRoar="",t.pictLithophone="",t.pictLogDrum="",t.pictLotusFlute="",t.pictMar="",t.pictMarSmithBrindle="",t.pictMaraca="",t.pictMaracas="",t.pictMegaphone="",t.pictMetalPlateChimes="",t.pictMetalTubeChimes="",t.pictMusicalSaw="",t.pictNormalPosition="",t.pictOnRim="",t.pictOpen="",t.pictOpenRimShot="",t.pictPistolShot="",t.pictPoliceWhistle="",t.pictQuijada="",t.pictRainstick="",t.pictRatchet="",t.pictRecoReco="",t.pictRightHandSquare="",t.pictRim1="",t.pictRim2="",t.pictRim3="",t.pictRimShotOnStem="",t.pictSandpaperBlocks="",t.pictScrapeAroundRim="",t.pictScrapeAroundRimClockwise="",t.pictScrapeCenterToEdge="",t.pictScrapeEdgeToCenter="",t.pictShellBells="",t.pictShellChimes="",t.pictSiren="",t.pictSistrum="",t.pictSizzleCymbal="",t.pictSleighBell="",t.pictSlideBrushOnGong="",t.pictSlideWhistle="",t.pictSlitDrum="",t.pictSnareDrum="",t.pictSnareDrumMilitary="",t.pictSnareDrumSnaresOff="",t.pictSteelDrums="",t.pictStickShot="",t.pictSuperball="",t.pictSuspendedCymbal="",t.pictSwishStem="",t.pictTabla="",t.pictTamTam="",t.pictTamTamWithBeater="",t.pictTambourine="",t.pictTempleBlocks="",t.pictTenorDrum="",t.pictThundersheet="",t.pictTimbales="",t.pictTimpani="",t.pictTomTom="",t.pictTomTomChinese="",t.pictTomTomIndoAmerican="",t.pictTomTomJapanese="",t.pictTriangle="",t.pictTubaphone="",t.pictTubularBells="",t.pictTurnLeftStem="",t.pictTurnRightLeftStem="",t.pictTurnRightStem="",t.pictVib="",t.pictVibMotorOff="",t.pictVibSmithBrindle="",t.pictVibraslap="",t.pictVietnameseHat="",t.pictWhip="",t.pictWindChimesGlass="",t.pictWindMachine="",t.pictWindWhistle="",t.pictWoodBlock="",t.pictWoundHardDown="",t.pictWoundHardLeft="",t.pictWoundHardRight="",t.pictWoundHardUp="",t.pictWoundSoftDown="",t.pictWoundSoftLeft="",t.pictWoundSoftRight="",t.pictWoundSoftUp="",t.pictXyl="",t.pictXylBass="",t.pictXylSmithBrindle="",t.pictXylTenor="",t.pictXylTenorTrough="",t.pictXylTrough="",t.pluckedBuzzPizzicato="",t.pluckedDamp="",t.pluckedDampAll="",t.pluckedDampOnStem="",t.pluckedFingernailFlick="",t.pluckedLeftHandPizzicato="",t.pluckedPlectrum="",t.pluckedSnapPizzicatoAbove="",t.pluckedSnapPizzicatoBelow="",t.pluckedWithFingernails="",t.quindicesima="",t.quindicesimaAlta="",t.quindicesimaBassa="",t.quindicesimaBassaMb="",t.repeat1Bar="",t.repeat2Bars="",t.repeat4Bars="",t.repeatBarLowerDot="",t.repeatBarSlash="",t.repeatBarUpperDot="",t.repeatDot="",t.repeatDots="",t.repeatLeft="",t.repeatRight="",t.repeatRightLeft="",t.rest1024th="",t.rest128th="",t.rest16th="",t.rest256th="",t.rest32nd="",t.rest512th="",t.rest64th="",t.rest8th="",t.restDoubleWhole="",t.restDoubleWholeLegerLine="",t.restHBar="",t.restHBarLeft="",t.restHBarMiddle="",t.restHBarRight="",t.restHalf="",t.restHalfLegerLine="",t.restLonga="",t.restMaxima="",t.restQuarter="",t.restQuarterOld="",t.restQuarterZ="",t.restWhole="",t.restWholeLegerLine="",t.reversedBrace="",t.reversedBracketBottom="",t.reversedBracketTop="",t.rightRepeatSmall="",t.scaleDegree1="",t.scaleDegree2="",t.scaleDegree3="",t.scaleDegree4="",t.scaleDegree5="",t.scaleDegree6="",t.scaleDegree7="",t.scaleDegree8="",t.scaleDegree9="",t.schaefferClef="",t.schaefferFClefToGClef="",t.schaefferGClefToFClef="",t.schaefferPreviousClef="",t.segno="",t.segnoSerpent1="",t.segnoSerpent2="",t.semipitchedPercussionClef1="",t.semipitchedPercussionClef2="",t.smnFlat="",t.smnFlatWhite="",t.smnHistoryDoubleFlat="",t.smnHistoryDoubleSharp="",t.smnHistoryFlat="",t.smnHistorySharp="",t.smnNatural="",t.smnSharp="",t.smnSharpDown="",t.smnSharpWhite="",t.smnSharpWhiteDown="",t.splitBarDivider="",t.staff1Line="",t.staff1LineNarrow="",t.staff1LineWide="",t.staff2Lines="",t.staff2LinesNarrow="",t.staff2LinesWide="",t.staff3Lines="",t.staff3LinesNarrow="",t.staff3LinesWide="",t.staff4Lines="",t.staff4LinesNarrow="",t.staff4LinesWide="",t.staff5Lines="",t.staff5LinesNarrow="",t.staff5LinesWide="",t.staff6Lines="",t.staff6LinesNarrow="",t.staff6LinesWide="",t.staffDivideArrowDown="",t.staffDivideArrowUp="",t.staffDivideArrowUpDown="",t.staffPosLower1="",t.staffPosLower2="",t.staffPosLower3="",t.staffPosLower4="",t.staffPosLower5="",t.staffPosLower6="",t.staffPosLower7="",t.staffPosLower8="",t.staffPosRaise1="",t.staffPosRaise2="",t.staffPosRaise3="",t.staffPosRaise4="",t.staffPosRaise5="",t.staffPosRaise6="",t.staffPosRaise7="",t.staffPosRaise8="",t.stem="",t.stemBowOnBridge="",t.stemBowOnTailpiece="",t.stemBuzzRoll="",t.stemDamp="",t.stemHarpStringNoise="",t.stemMultiphonicsBlack="",t.stemMultiphonicsBlackWhite="",t.stemMultiphonicsWhite="",t.stemPendereckiTremolo="",t.stemRimShot="",t.stemSprechgesang="",t.stemSulPonticello="",t.stemSussurando="",t.stemSwished="",t.stemVibratoPulse="",t.stockhausenTremolo="",t.stringsBowBehindBridge="",t.stringsBowBehindBridgeFourStrings="",t.stringsBowBehindBridgeOneString="",t.stringsBowBehindBridgeThreeStrings="",t.stringsBowBehindBridgeTwoStrings="",t.stringsBowOnBridge="",t.stringsBowOnTailpiece="",t.stringsChangeBowDirection="",t.stringsDownBow="",t.stringsDownBowAwayFromBody="",t.stringsDownBowBeyondBridge="",t.stringsDownBowTowardsBody="",t.stringsDownBowTurned="",t.stringsFouette="",t.stringsHalfHarmonic="",t.stringsHarmonic="",t.stringsJeteAbove="",t.stringsJeteBelow="",t.stringsMuteOff="",t.stringsMuteOn="",t.stringsOverpressureDownBow="",t.stringsOverpressureNoDirection="",t.stringsOverpressurePossibileDownBow="",t.stringsOverpressurePossibileUpBow="",t.stringsOverpressureUpBow="",t.stringsScrapeCircularClockwise="",t.stringsScrapeCircularCounterclockwise="",t.stringsScrapeParallelInward="",t.stringsScrapeParallelOutward="",t.stringsThumbPosition="",t.stringsThumbPositionTurned="",t.stringsTripleChopInward="",t.stringsTripleChopOutward="",t.stringsUpBow="",t.stringsUpBowAwayFromBody="",t.stringsUpBowBeyondBridge="",t.stringsUpBowTowardsBody="",t.stringsUpBowTurned="",t.stringsVibratoPulse="",t.swissRudimentsNoteheadBlackDouble="",t.swissRudimentsNoteheadBlackFlam="",t.swissRudimentsNoteheadHalfDouble="",t.swissRudimentsNoteheadHalfFlam="",t.systemDivider="",t.systemDividerExtraLong="",t.systemDividerLong="",t.textAugmentationDot="",t.textBlackNoteFrac16thLongStem="",t.textBlackNoteFrac16thShortStem="",t.textBlackNoteFrac32ndLongStem="",t.textBlackNoteFrac8thLongStem="",t.textBlackNoteFrac8thShortStem="",t.textBlackNoteLongStem="",t.textBlackNoteShortStem="",t.textCont16thBeamLongStem="",t.textCont16thBeamShortStem="",t.textCont32ndBeamLongStem="",t.textCont8thBeamLongStem="",t.textCont8thBeamShortStem="",t.textHeadlessBlackNoteFrac16thLongStem="",t.textHeadlessBlackNoteFrac16thShortStem="",t.textHeadlessBlackNoteFrac32ndLongStem="",t.textHeadlessBlackNoteFrac8thLongStem="",t.textHeadlessBlackNoteFrac8thShortStem="",t.textHeadlessBlackNoteLongStem="",t.textHeadlessBlackNoteShortStem="",t.textTie="",t.textTuplet3LongStem="",t.textTuplet3ShortStem="",t.textTupletBracketEndLongStem="",t.textTupletBracketEndShortStem="",t.textTupletBracketStartLongStem="",t.textTupletBracketStartShortStem="",t.timeSig0="",t.timeSig0Reversed="",t.timeSig0Turned="",t.timeSig1="",t.timeSig1Reversed="",t.timeSig1Turned="",t.timeSig2="",t.timeSig2Reversed="",t.timeSig2Turned="",t.timeSig3="",t.timeSig3Reversed="",t.timeSig3Turned="",t.timeSig4="",t.timeSig4Reversed="",t.timeSig4Turned="",t.timeSig5="",t.timeSig5Reversed="",t.timeSig5Turned="",t.timeSig6="",t.timeSig6Reversed="",t.timeSig6Turned="",t.timeSig7="",t.timeSig7Reversed="",t.timeSig7Turned="",t.timeSig8="",t.timeSig8Reversed="",t.timeSig8Turned="",t.timeSig9="",t.timeSig9Reversed="",t.timeSig9Turned="",t.timeSigBracketLeft="",t.timeSigBracketLeftSmall="",t.timeSigBracketRight="",t.timeSigBracketRightSmall="",t.timeSigCombDenominator="",t.timeSigCombNumerator="",t.timeSigComma="",t.timeSigCommon="",t.timeSigCommonReversed="",t.timeSigCommonTurned="",t.timeSigCut2="",t.timeSigCut3="",t.timeSigCutCommon="",t.timeSigCutCommonReversed="",t.timeSigCutCommonTurned="",t.timeSigEquals="",t.timeSigFractionHalf="",t.timeSigFractionOneThird="",t.timeSigFractionQuarter="",t.timeSigFractionThreeQuarters="",t.timeSigFractionTwoThirds="",t.timeSigFractionalSlash="",t.timeSigMinus="",t.timeSigMultiply="",t.timeSigOpenPenderecki="",t.timeSigParensLeft="",t.timeSigParensLeftSmall="",t.timeSigParensRight="",t.timeSigParensRightSmall="",t.timeSigPlus="",t.timeSigPlusSmall="",t.timeSigSlash="",t.timeSigX="",t.tremolo1="",t.tremolo2="",t.tremolo3="",t.tremolo4="",t.tremolo5="",t.tremoloDivisiDots2="",t.tremoloDivisiDots3="",t.tremoloDivisiDots4="",t.tremoloDivisiDots6="",t.tremoloFingered1="",t.tremoloFingered2="",t.tremoloFingered3="",t.tremoloFingered4="",t.tremoloFingered5="",t.tripleTongueAbove="",t.tripleTongueBelow="",t.tuplet0="",t.tuplet1="",t.tuplet2="",t.tuplet3="",t.tuplet4="",t.tuplet5="",t.tuplet6="",t.tuplet7="",t.tuplet8="",t.tuplet9="",t.tupletColon="",t.unmeasuredTremolo="",t.unmeasuredTremoloSimple="",t.unpitchedPercussionClef1="",t.unpitchedPercussionClef2="",t.ventiduesima="",t.ventiduesimaAlta="",t.ventiduesimaBassa="",t.ventiduesimaBassaMb="",t.vocalFingerClickStockhausen="",t.vocalHalbGesungen="",t.vocalMouthClosed="",t.vocalMouthOpen="",t.vocalMouthPursed="",t.vocalMouthSlightlyOpen="",t.vocalMouthWideOpen="",t.vocalNasalVoice="",t.vocalSprechgesang="",t.vocalTongueClickStockhausen="",t.vocalTongueFingerClickStockhausen="",t.vocalsSussurando="",t.wiggleArpeggiatoDown="",t.wiggleArpeggiatoDownArrow="",t.wiggleArpeggiatoDownSwash="",t.wiggleArpeggiatoUp="",t.wiggleArpeggiatoUpArrow="",t.wiggleArpeggiatoUpSwash="",t.wiggleCircular="",t.wiggleCircularConstant="",t.wiggleCircularConstantFlipped="",t.wiggleCircularConstantFlippedLarge="",t.wiggleCircularConstantLarge="",t.wiggleCircularEnd="",t.wiggleCircularLarge="",t.wiggleCircularLarger="",t.wiggleCircularLargerStill="",t.wiggleCircularLargest="",t.wiggleCircularSmall="",t.wiggleCircularStart="",t.wiggleGlissando="",t.wiggleGlissandoGroup1="",t.wiggleGlissandoGroup2="",t.wiggleGlissandoGroup3="",t.wiggleRandom1="",t.wiggleRandom2="",t.wiggleRandom3="",t.wiggleRandom4="",t.wiggleSawtooth="",t.wiggleSawtoothNarrow="",t.wiggleSawtoothWide="",t.wiggleSquareWave="",t.wiggleSquareWaveNarrow="",t.wiggleSquareWaveWide="",t.wiggleTrill="",t.wiggleTrillFast="",t.wiggleTrillFaster="",t.wiggleTrillFasterStill="",t.wiggleTrillFastest="",t.wiggleTrillSlow="",t.wiggleTrillSlower="",t.wiggleTrillSlowerStill="",t.wiggleTrillSlowest="",t.wiggleVIbratoLargestSlower="",t.wiggleVIbratoMediumSlower="",t.wiggleVibrato="",t.wiggleVibratoLargeFast="",t.wiggleVibratoLargeFaster="",t.wiggleVibratoLargeFasterStill="",t.wiggleVibratoLargeFastest="",t.wiggleVibratoLargeSlow="",t.wiggleVibratoLargeSlower="",t.wiggleVibratoLargeSlowest="",t.wiggleVibratoLargestFast="",t.wiggleVibratoLargestFaster="",t.wiggleVibratoLargestFasterStill="",t.wiggleVibratoLargestFastest="",t.wiggleVibratoLargestSlow="",t.wiggleVibratoLargestSlowest="",t.wiggleVibratoMediumFast="",t.wiggleVibratoMediumFaster="",t.wiggleVibratoMediumFasterStill="",t.wiggleVibratoMediumFastest="",t.wiggleVibratoMediumSlow="",t.wiggleVibratoMediumSlowest="",t.wiggleVibratoSmallFast="",t.wiggleVibratoSmallFaster="",t.wiggleVibratoSmallFasterStill="",t.wiggleVibratoSmallFastest="",t.wiggleVibratoSmallSlow="",t.wiggleVibratoSmallSlower="",t.wiggleVibratoSmallSlowest="",t.wiggleVibratoSmallestFast="",t.wiggleVibratoSmallestFaster="",t.wiggleVibratoSmallestFasterStill="",t.wiggleVibratoSmallestFastest="",t.wiggleVibratoSmallestSlow="",t.wiggleVibratoSmallestSlower="",t.wiggleVibratoSmallestSlowest="",t.wiggleVibratoStart="",t.wiggleVibratoWide="",t.wiggleWavy="",t.wiggleWavyNarrow="",t.wiggleWavyWide="",t.windClosedHole="",t.windFlatEmbouchure="",t.windHalfClosedHole1="",t.windHalfClosedHole2="",t.windHalfClosedHole3="",t.windLessRelaxedEmbouchure="",t.windLessTightEmbouchure="",t.windMouthpiecePop="",t.windMultiphonicsBlackStem="",t.windMultiphonicsBlackWhiteStem="",t.windMultiphonicsWhiteStem="",t.windOpenHole="",t.windReedPositionIn="",t.windReedPositionNormal="",t.windReedPositionOut="",t.windRelaxedEmbouchure="",t.windRimOnly="",t.windSharpEmbouchure="",t.windStrongAirPressure="",t.windThreeQuartersClosedHole="",t.windTightEmbouchure="",t.windTrillKey="",t.windVeryTightEmbouchure="",t.windWeakAirPressure=""}(_||(_={}));const q=16384,K={"1/8":131072,"1/4":65536,"1/2":32768,1:16384,2:8192,4:4096,8:2048,16:1024,32:512,64:256,128:128,256:64,512:32,1024:16},$={m:"1/8",l:"1/4",w:"1",h:"2",q:"4",b:"256"},Q=Object.assign(Object.assign({},(()=>{const t={};for(let e=1;e<=14;e++)t[`flats_${e}`]={accidental:"b",num:e},t[`sharps_${e}`]={accidental:"#",num:e};return t.flats_0={num:0},t.sharps_0={num:0},t})()),{C:{num:0},Am:{num:0},F:{accidental:"b",num:1},Dm:{accidental:"b",num:1},Bb:{accidental:"b",num:2},Gm:{accidental:"b",num:2},Eb:{accidental:"b",num:3},Cm:{accidental:"b",num:3},Ab:{accidental:"b",num:4},Fm:{accidental:"b",num:4},Db:{accidental:"b",num:5},Bbm:{accidental:"b",num:5},Gb:{accidental:"b",num:6},Ebm:{accidental:"b",num:6},Cb:{accidental:"b",num:7},Abm:{accidental:"b",num:7},Dbm:{accidental:"b",num:8},Gbm:{accidental:"b",num:9},G:{accidental:"#",num:1},Em:{accidental:"#",num:1},D:{accidental:"#",num:2},Bm:{accidental:"#",num:2},A:{accidental:"#",num:3},"F#m":{accidental:"#",num:3},E:{accidental:"#",num:4},"C#m":{accidental:"#",num:4},B:{accidental:"#",num:5},"G#m":{accidental:"#",num:5},"F#":{accidental:"#",num:6},"D#m":{accidental:"#",num:6},"C#":{accidental:"#",num:7},"A#m":{accidental:"#",num:7},"G#":{accidental:"#",num:8},"D#":{accidental:"#",num:9},"A#":{accidental:"#",num:10}}),J={treble:{lineShift:0},bass:{lineShift:6},tenor:{lineShift:4},alto:{lineShift:3},soprano:{lineShift:1},percussion:{lineShift:0},"mezzo-soprano":{lineShift:2},"baritone-c":{lineShift:5},"baritone-f":{lineShift:5},subbass:{lineShift:7},french:{lineShift:-1}},Z={C:{index:0,intVal:0},CN:{index:0,intVal:0},"C#":{index:0,intVal:1},"C##":{index:0,intVal:2},CB:{index:0,intVal:11},CBB:{index:0,intVal:10},D:{index:1,intVal:2},DN:{index:1,intVal:2},"D#":{index:1,intVal:3},"D##":{index:1,intVal:4},DB:{index:1,intVal:1},DBB:{index:1,intVal:0},E:{index:2,intVal:4},EN:{index:2,intVal:4},"E#":{index:2,intVal:5},"E##":{index:2,intVal:6},EB:{index:2,intVal:3},EBB:{index:2,intVal:2},F:{index:3,intVal:5},FN:{index:3,intVal:5},"F#":{index:3,intVal:6},"F##":{index:3,intVal:7},FB:{index:3,intVal:4},FBB:{index:3,intVal:3},G:{index:4,intVal:7},GN:{index:4,intVal:7},"G#":{index:4,intVal:8},"G##":{index:4,intVal:9},GB:{index:4,intVal:6},GBB:{index:4,intVal:5},A:{index:5,intVal:9},AN:{index:5,intVal:9},"A#":{index:5,intVal:10},"A##":{index:5,intVal:11},AB:{index:5,intVal:8},ABB:{index:5,intVal:7},B:{index:6,intVal:11},BN:{index:6,intVal:11},"B#":{index:6,intVal:12},"B##":{index:6,intVal:13},BB:{index:6,intVal:10},BBB:{index:6,intVal:9},R:{index:6},X:{index:6}},tt={"#":_.accidentalSharp,"##":_.accidentalDoubleSharp,b:_.accidentalFlat,bb:_.accidentalDoubleFlat,n:_.accidentalNatural,"{":_.accidentalParensLeft,"}":_.accidentalParensRight,db:_.accidentalThreeQuarterTonesFlatZimmermann,d:_.accidentalQuarterToneFlatStein,"++":_.accidentalThreeQuarterTonesSharpStein,"+":_.accidentalQuarterToneSharpStein,"+-":_.accidentalKucukMucennebSharp,bs:_.accidentalBakiyeFlat,bss:_.accidentalBuyukMucennebFlat,o:_.accidentalSori,k:_.accidentalKoron,bbs:_.accidentalBuyukMucennebSharp,"++-":_.accidentalBuyukMucennebSharp,ashs:_.accidentalBuyukMucennebSharp,afhf:_.accidentalBuyukMucennebSharp},et={"a.":{code:_.augmentationDot,betweenLines:!0},av:{aboveCode:_.articStaccatissimoAbove,belowCode:_.articStaccatissimoBelow,betweenLines:!0},"a>":{aboveCode:_.articAccentAbove,belowCode:_.articAccentBelow,betweenLines:!0},"a-":{aboveCode:_.articTenutoAbove,belowCode:_.articTenutoBelow,betweenLines:!0},"a^":{aboveCode:_.articMarcatoAbove,belowCode:_.articMarcatoBelow,betweenLines:!1},"a+":{code:_.pluckedLeftHandPizzicato,betweenLines:!1},ao:{aboveCode:_.pluckedSnapPizzicatoAbove,belowCode:_.pluckedSnapPizzicatoBelow,betweenLines:!1},ah:{code:_.stringsHarmonic,betweenLines:!1},"a@":{aboveCode:_.fermataAbove,belowCode:_.fermataBelow,betweenLines:!1},"a@a":{code:_.fermataAbove,betweenLines:!1},"a@u":{code:_.fermataBelow,betweenLines:!1},"a@s":{aboveCode:_.fermataShortAbove,belowCode:_.fermataShortBelow,betweenLines:!1},"a@as":{code:_.fermataShortAbove,betweenLines:!1},"a@us":{code:_.fermataShortBelow,betweenLines:!1},"a@l":{aboveCode:_.fermataLongAbove,belowCode:_.fermataLongBelow,betweenLines:!1},"a@al":{code:_.fermataLongAbove,betweenLines:!1},"a@ul":{code:_.fermataLongBelow,betweenLines:!1},"a@vl":{aboveCode:_.fermataVeryLongAbove,belowCode:_.fermataVeryLongBelow,betweenLines:!1},"a@avl":{code:_.fermataVeryLongAbove,betweenLines:!1},"a@uvl":{code:_.fermataVeryLongBelow,betweenLines:!1},"a|":{code:_.stringsUpBow,betweenLines:!1},am:{code:_.stringsDownBow,betweenLines:!1},"a,":{code:_.pictChokeCymbal,betweenLines:!1}},it={mordent:_.ornamentShortTrill,mordentInverted:_.ornamentMordent,turn:_.ornamentTurn,turnInverted:_.ornamentTurnSlash,tr:_.ornamentTrill,upprall:_.ornamentPrecompSlideTrillDAnglebert,downprall:_.ornamentPrecompDoubleCadenceUpperPrefix,prallup:_.ornamentPrecompTrillSuffixDandrieu,pralldown:_.ornamentPrecompTrillLowerSuffix,upmordent:_.ornamentPrecompSlideTrillBach,downmordent:_.ornamentPrecompDoubleCadenceUpperPrefixTurn,lineprall:_.ornamentPrecompAppoggTrill,prallprall:_.ornamentTremblement,scoop:_.brassScoop,doit:_.brassDoitMedium,fall:_.brassFallLipShort,doitLong:_.brassLiftMedium,fallLong:_.brassFallRoughMedium,bend:_.brassBend,plungerClosed:_.brassMuteClosed,plungerOpen:_.brassMuteOpen,flip:_.brassFlip,jazzTurn:_.brassJazzTurn,smear:_.brassSmear};class st{static clefProperties(t){if(!t||!(t in J))throw new C("BadArgument","Invalid clef: "+t);return J[t]}static keyProperties(t,e="treble",i="N",s){let n={octaveShift:0,duration:"4"};"object"==typeof s&&(n=Object.assign(Object.assign({},n),s));const a=st.sanitizeDuration(n.duration),o=t.split("/");if(o.length<2)throw new C("BadArguments",`First argument must be note/octave or note/octave/glyph-code: ${t}`);const r=o[0].toUpperCase();i=i.toUpperCase();const h=Z[r];if(!h)throw new C("BadArguments","Invalid key name: "+r);let c=parseInt(o[1],10);c-=n.octaveShift;let l=(7*c-28+h.index)/2;l+=st.clefProperties(e).lineShift;const d=void 0!==h.intVal?12*c+h.intVal:void 0;let u="",g="N";return g=o.length>2&&o[2]?o[2].toUpperCase():"N"!==i?i:r,u=this.codeNoteHead(g,a),{key:r,octave:c,line:l,intValue:d,code:u,displaced:!1}}static integerToNote(t){if(void 0===t||t<0||t>11)throw new C("BadArguments",`integerToNote() requires an integer in the range [0, 11]: ${t}`);const e={0:"C",1:"C#",2:"D",3:"D#",4:"E",5:"F",6:"F#",7:"G",8:"G#",9:"A",10:"A#",11:"B"}[t];if(!e)throw new C("BadArguments",`Unknown note value for integer: ${t}`);return e}static textWidth(t){return 7*t.toString().length}static articulationCodes(t){return et[t]}static accidentalCodes(t){var e;return null!==(e=tt[t])&&void 0!==e?e:t}static ornamentCodes(t){var e;return null!==(e=it[t])&&void 0!==e?e:t}static keySignature(t){const e=Q[t];if(!e)throw new C("BadKeySignature",`Bad key signature spec: '${t}'`);if(!e.accidental)return[];const i={b:[2,.5,2.5,1,3,1.5,3.5],"#":[0,1.5,-.5,1,2.5,.5,2]}[e.accidental],s=Math.min(e.num,7),n=Math.max(e.num-7,0);return[...i.slice(n,s).map(t=>({type:`${e.accidental}`,line:t})),...i.slice(0,n).map(t=>({type:`${e.accidental}${e.accidental}`,line:t}))]}static getKeySignatures(){return Q}static hasKeySignature(t){return t in Q}static sanitizeDuration(t){const e=$[t];if(void 0!==e&&(t=e),void 0===K[t])throw new C("BadArguments",`The provided duration is not valid: ${t}`);return t}static durationToFraction(t){return(new F).parse(st.sanitizeDuration(t))}static durationToNumber(t){return st.durationToFraction(t).value()}static durationToTicks(t){t=st.sanitizeDuration(t);const e=K[t];if(void 0===e)throw new C("InvalidDuration");return e}static codeNoteHead(t,e){switch(t){case"D0":return _.noteheadDiamondWhole;case"D1":return _.noteheadDiamondHalf;case"D2":case"D3":return _.noteheadDiamondBlack;case"T0":return _.noteheadTriangleUpWhole;case"T1":return _.noteheadTriangleUpHalf;case"T2":case"T3":return _.noteheadTriangleUpBlack;case"X0":return _.noteheadXWhole;case"X1":return _.noteheadXHalf;case"X2":return _.noteheadXBlack;case"X3":return _.noteheadCircleX;case"S1":return _.noteheadSquareWhite;case"S2":return _.noteheadSquareBlack;case"R1":case"R2":return _.noteheadSquareWhite;case"DO":return _.noteheadTriangleUpBlack;case"RE":return _.noteheadMoonBlack;case"MI":return _.noteheadDiamondBlack;case"FA":return _.noteheadTriangleLeftBlack;case"FAUP":return _.noteheadTriangleRightBlack;case"SO":return _.noteheadBlack;case"LA":return _.noteheadSquareBlack;case"TI":return _.noteheadTriangleRoundDownBlack;case"DI":case"H":switch(e){case"1/2":return _.noteheadDiamondDoubleWhole;case"1":return _.noteheadDiamondWhole;case"2":return _.noteheadDiamondHalf;default:return _.noteheadDiamondBlack}case"X":case"M":switch(e){case"1/2":return _.noteheadXDoubleWhole;case"1":return _.noteheadXWhole;case"2":return _.noteheadXHalf;default:return _.noteheadXBlack}case"CX":switch(e){case"1/2":return _.noteheadCircleXDoubleWhole;case"1":return _.noteheadCircleXWhole;case"2":return _.noteheadCircleXHalf;default:return _.noteheadCircleX}case"CI":switch(e){case"1/2":return _.noteheadCircledDoubleWhole;case"1":return _.noteheadCircledWhole;case"2":return _.noteheadCircledHalf;default:return _.noteheadCircledBlack}case"SQ":switch(e){case"1/2":return _.noteheadDoubleWholeSquare;case"1":case"2":return _.noteheadSquareWhite;default:return _.noteheadSquareBlack}case"TU":switch(e){case"1/2":return _.noteheadTriangleUpDoubleWhole;case"1":return _.noteheadTriangleUpWhole;case"2":return _.noteheadTriangleUpHalf;default:return _.noteheadTriangleUpBlack}case"TD":switch(e){case"1/2":return _.noteheadTriangleDownDoubleWhole;case"1":return _.noteheadTriangleDownWhole;case"2":return _.noteheadTriangleDownHalf;default:return _.noteheadTriangleDownBlack}case"SF":switch(e){case"1/2":return _.noteheadSlashedDoubleWhole1;case"1":return _.noteheadSlashedWhole1;case"2":return _.noteheadSlashedHalf1;default:return _.noteheadSlashedBlack1}case"SB":switch(e){case"1/2":return _.noteheadSlashedDoubleWhole2;case"1":return _.noteheadSlashedWhole2;case"2":return _.noteheadSlashedHalf2;default:return _.noteheadSlashedBlack2}case"R":switch(e){case"1/8":return _.restMaxima;case"1/4":return _.restLonga;case"1/2":return _.restDoubleWhole;case"1":return _.restWhole;case"2":return _.restHalf;case"4":return _.restQuarter;case"8":return _.rest8th;case"16":return _.rest16th;case"32":return _.rest32nd;case"64":return _.rest64th;case"128":return _.rest128th;case"256":return _.rest256th;case"512":return _.rest512th;case"1024":return _.rest1024th}break;case"S":switch(e){case"1/2":return _.noteheadSlashWhiteDoubleWhole;case"1":return _.noteheadSlashWhiteWhole;case"2":return _.noteheadSlashWhiteHalf;default:return _.noteheadSlashVerticalEnds}default:switch(e){case"1/8":return _.mensuralNoteheadMaximaBlack;case"1/4":return _.mensuralNoteheadLongaBlack;case"1/2":return _.noteheadDoubleWhole;case"1":return _.noteheadWhole;case"2":return _.noteheadHalf;default:return _.noteheadBlack}}return _.null}}function nt(...t){at.DEBUG&&B("VexFlow.Accidental",t)}st.UNISON=!0,st.SOFTMAX_FACTOR=10,st.STEM_WIDTH=1.5,st.STEM_HEIGHT=35,st.STAVE_LINE_THICKNESS=1,st.RENDER_PRECISION_PLACES=3,st.RESOLUTION=q,st.durationCodes={"1/8":{stem:!0},"1/4":{stem:!1},"1/2":{stem:!1},1:{stem:!1},2:{stem:!0},4:{stem:!0},8:{stem:!0,beamCount:1,stemBeamExtension:0,codeFlagUp:_.flag8thUp},16:{beamCount:2,stemBeamExtension:0,stem:!0,codeFlagUp:_.flag16thUp},32:{beamCount:3,stemBeamExtension:7.5,stem:!0,codeFlagUp:_.flag32ndUp},64:{beamCount:4,stemBeamExtension:15,stem:!0,codeFlagUp:_.flag64thUp},128:{beamCount:5,stemBeamExtension:22.5,stem:!0,codeFlagUp:_.flag128thUp},256:{beamCount:6,stemBeamExtension:25,stem:!0,codeFlagUp:_.flag256thUp},512:{beamCount:7,stemBeamExtension:27.5,stem:!0,codeFlagUp:_.flag512thUp},1024:{beamCount:8,stemBeamExtension:30,stem:!0,codeFlagUp:_.flag1024thUp}},st.NOTATION_FONT_SCALE=39,st.TABLATURE_FONT_SCALE=39,st.SLASH_NOTEHEAD_WIDTH=15,st.STAVE_LINE_DISTANCE=10,st.noteHeadStemYOffsets={[_.noteheadXBlack]:{up:.444,down:-.44},[_.noteheadXHalf]:{up:.412,down:-.412}},st.TEXT_HEIGHT_OFFSET_HACK=1,st.accidentalColumnsTable={1:{a:[1],b:[1]},2:{a:[1,2]},3:{a:[1,3,2],b:[1,2,1],secondOnBottom:[1,2,3]},4:{a:[1,3,4,2],b:[1,2,3,1],spacedOutTetrachord:[1,2,1,2]},5:{a:[1,3,5,4,2],b:[1,2,4,3,1],spacedOutPentachord:[1,2,3,2,1],verySpacedOutPentachord:[1,2,1,2,1]},6:{a:[1,3,5,6,4,2],b:[1,2,4,5,3,1],spacedOutHexachord:[1,3,2,1,3,2],verySpacedOutHexachord:[1,2,1,2,1,2]}},st.unicode={sharp:"♯",flat:"♭",natural:"♮",triangle:"△","o-with-slash":"ø",degrees:"°",circle:"○"},st.validTypes={n:{name:"note"},r:{name:"rest"},h:{name:"harmonic"},m:{name:"muted"},s:{name:"slash"},g:{name:"ghost"},d:{name:"diamond"},x:{name:"x"},ci:{name:"circled"},cx:{name:"circle x"},sf:{name:"slashed"},sb:{name:"slashed backward"},sq:{name:"square"},tu:{name:"triangle up"},td:{name:"triangle down"}},st.TIME4_4={numBeats:4,beatValue:4,resolution:q};class at extends z{static get CATEGORY(){return l.Accidental}static format(t,e){if(!t||0===t.length)return;const i=O.get("Accidental.noteheadAccidentalPadding"),s=e.leftShift+i,n=O.get("Accidental.accidentalSpacing"),a=O.get("Accidental.leftPadding"),o=[];let r,h=0;for(let e=0;e<t.length;++e){const i=t[e],s=i.getNote(),n=s.getStave(),a=i.checkIndex(),c=s.getKeyProps()[a];if(s!==r){for(let t=0;t<s.keys.length;++t)h=Math.max(s.getLeftDisplacedHeadPx()-s.getXShift(),h);r=s}if(n){const t=n.getSpacingBetweenLines(),e=n.getYForLine(c.line),s=Math.round(e/t*2)/2;o.push({y:e,line:s,extraXSpaceNeeded:h,accidental:i,spacingBetweenStaveLines:t})}else o.push({line:c.line,extraXSpaceNeeded:h,accidental:i})}o.sort((t,e)=>e.line-t.line);const c=[];let l=0;for(let t=0;t<o.length;t++){const e=o[t],i=e.accidental.type,s=c[c.length-1];let a;s&&(null==s?void 0:s.line)===e.line?a=s:(a={line:e.line,flatLine:!0,dblSharpLine:!0,numAcc:0,width:0,column:0},c.push(a)),"b"!==i&&"bb"!==i&&(a.flatLine=!1),"##"!==i&&(a.dblSharpLine=!1),a.numAcc++,a.width+=e.accidental.getWidth()+n,l=Math.max(e.extraXSpaceNeeded,l)}let d=0;for(let t=0;t<c.length;t++){let e=!1;const i=t;let s=t;for(;s+1<c.length&&!e;)this.checkCollision(c[s],c[s+1])?s++:e=!0;const n=t=>c[i+t],a=t=>t.map(n),o=(t,e)=>{const[i,s]=a([t,e]).map(t=>t.line);return i-s},r=(...t)=>t.map(a).every(([t,e])=>!this.checkCollision(t,e)),h=s-i+1;let l,u,g=this.checkCollision(c[i],c[s])?"a":"b";switch(h){case 3:"a"===g&&.5===o(1,2)&&.5!==o(0,1)&&(g="secondOnBottom");break;case 4:r([0,2],[1,3])&&(g="spacedOutTetrachord");break;case 5:"b"===g&&r([1,3])&&(g="spacedOutPentachord",r([0,2],[2,4])&&(g="verySpacedOutPentachord"));break;case 6:r([0,3],[1,4],[2,5])&&(g="spacedOutHexachord"),r([0,2],[2,4],[1,3],[3,5])&&(g="verySpacedOutHexachord")}if(h>=7){let e=2,i=!0;for(;!0===i;){i=!1;for(let t=0;t+e<c.length;t++)if(this.checkCollision(c[t],c[t+e])){i=!0,e++;break}}for(l=t;l<=s;l++)u=(l-t)%e+1,c[l].column=u,d=d>u?d:u}else for(l=t;l<=s;l++)u=st.accidentalColumnsTable[h][g][l-t],c[l].column=u,d=d>u?d:u;t=s}const u=[],g=[];for(let t=0;t<=d;t++)u[t]=0,g[t]=0;u[0]=s+l,g[0]=s,c.forEach(t=>{t.width>u[t.column]&&(u[t.column]=t.width)});for(let t=1;t<u.length;t++)g[t]=u[t]+g[t-1];const p=g[g.length-1];let m=0;c.forEach(t=>{let e=0;const i=m+t.numAcc;for(;m<i;m++){const i=g[t.column-1]+e+l;o[m].accidental.setXShift(i),e+=o[m].accidental.getWidth()+n,nt("Line, accCount, shift: ",t.line,m,i)}}),e.leftShift=p+a}static checkCollision(t,e){let i=e.line-t.line,s=3;i>0?(s=e.flatLine||e.dblSharpLine?2.5:3,t.dblSharpLine&&(i-=.5)):(s=t.flatLine||t.dblSharpLine?2.5:3,e.dblSharpLine&&(i-=.5));const n=Math.abs(i)<s;return nt("Line1, Line2, Collision: ",t.line,e.line,n),n}static applyAccidentals(t,e){const s=[],n={};t.forEach(t=>{const e=new F(0,1);t.getTickables().forEach(t=>{if(t.shouldIgnoreTicks())return;const i=n[e.value()];i?i.push(t):(s.push(e.value()),n[e.value()]=[t]),e.add(t.getTicks())})}),s.sort((t,e)=>t-e);const a=new j;e||(e="C");const o=a.createScaleMap(e),h={};s.forEach(t=>{const e=n[t],s=[],c=t=>{if(!r(t)||t.isRest()||t.shouldIgnoreTicks())return;const e=t;e.keys.forEach((t,n)=>{const r=a.getNoteParts(t.split("/")[0]),c=t.split("/")[1],d=r.accidental||"n",u=r.root+d;h[r.root+c]||(h[r.root+c]=o[r.root]);const g=h[r.root+c]===u,p=s.indexOf(t)>-1;if(e.getModifiers().forEach((t,s)=>{i(t,l.Accidental)&&t.type==d&&t.getIndex()==n&&e.getModifiers().splice(s,1)}),!g||g&&p){h[r.root+c]=u;const i=new at(d);e.addModifier(i,n),s.push(t)}}),e.getModifiers().forEach(t=>{i(t,l.GraceNoteGroup)&&t.getGraceNotes().forEach(c)})};e.forEach(c)})}constructor(t){super(),nt("New accidental: ",t),this.type=t,this.position=z.Position.LEFT,this.cautionary=!1,this.reset()}reset(){this.text="",this.cautionary?(this.text+=st.accidentalCodes("{"),this.text+=st.accidentalCodes(this.type),this.text+=st.accidentalCodes("}"),this.fontInfo.size=O.get("Accidental.cautionary.fontSize")):(this.text+=st.accidentalCodes(this.type),this.fontInfo.size=O.get("Accidental.fontSize")),a(this.note)&&(this.fontInfo.size=O.get("Accidental.grace.fontSize"))}setNote(t){return v(t,"ArgumentError",`Bad note value: ${t}`),this.note=t,this.reset(),this}setAsCautionary(){return this.cautionary=!0,this.reset(),this}draw(){const{type:t,position:e,index:i}=this,s=this.checkContext(),n=this.checkAttachedNote();this.setRendered();const a=n.getModifierStartXY(e,i);this.x=a.x-this.width,this.y=a.y,nt("Rendering: ",t,a.x,a.y),this.renderText(s,0,0)}}at.DEBUG=!1;class ot extends X{static get CATEGORY(){return l.Stem}static get UP(){return 1}static get DOWN(){return-1}static get WIDTH(){return st.STEM_WIDTH}static get HEIGHT(){return st.STEM_HEIGHT}constructor(t){var e,i,s,n,a,o,r;super(),this.stemUpYOffset=0,this.stemDownYOffset=0,this.stemUpYBaseOffset=0,this.stemDownYBaseOffset=0,this.xBegin=null!==(e=null==t?void 0:t.xBegin)&&void 0!==e?e:0,this.xEnd=null!==(i=null==t?void 0:t.xEnd)&&void 0!==i?i:0,this.yTop=null!==(s=null==t?void 0:t.yTop)&&void 0!==s?s:0,this.yBottom=null!==(n=null==t?void 0:t.yBottom)&&void 0!==n?n:0,this.stemExtension=null!==(a=null==t?void 0:t.stemExtension)&&void 0!==a?a:0,this.stemDirection=null!==(o=null==t?void 0:t.stemDirection)&&void 0!==o?o:0,this.hide=(null==t?void 0:t.hide)||!1,this.isStemlet=(null==t?void 0:t.isStemlet)||!1,this.stemletHeight=null!==(r=null==t?void 0:t.stemletHeight)&&void 0!==r?r:0,this.renderHeightAdjustment=0,this.setOptions(t)}setOptions(t){var e,i,s,n;this.stemUpYOffset=null!==(e=null==t?void 0:t.stemUpYOffset)&&void 0!==e?e:0,this.stemDownYOffset=null!==(i=null==t?void 0:t.stemDownYOffset)&&void 0!==i?i:0,this.stemUpYBaseOffset=null!==(s=null==t?void 0:t.stemUpYBaseOffset)&&void 0!==s?s:0,this.stemDownYBaseOffset=null!==(n=null==t?void 0:t.stemDownYBaseOffset)&&void 0!==n?n:0}setNoteHeadXBounds(t,e){return this.xBegin=t,this.xEnd=e,this}setDirection(t){this.stemDirection=t}setExtension(t){this.stemExtension=t}getExtension(){return this.stemExtension}setYBounds(t,e){this.yTop=t,this.yBottom=e}getHeight(){const t=this.stemDirection===ot.UP?this.stemUpYOffset:this.stemDownYOffset;return(this.yBottom-this.yTop+(ot.HEIGHT-t+this.stemExtension))*this.stemDirection}getBoundingBox(){throw new C("NotImplemented","getBoundingBox() not implemented.")}getExtents(){const t=this.stemDirection===ot.UP,e=[this.yTop,this.yBottom],i=ot.HEIGHT+this.stemExtension,s=(t?Math.min:Math.max)(...e),n=(t?Math.max:Math.min)(...e);return{topY:s+i*-this.stemDirection,baseY:n}}setVisibility(t){return this.hide=!t,this}setStemlet(t,e){return this.isStemlet=t,this.stemletHeight=e,this}adjustHeightForFlag(){this.renderHeightAdjustment=O.get("Stem.heightAdjustmentForFlag",-3)}adjustHeightForBeam(){this.renderHeightAdjustment=-ot.WIDTH/2}draw(){if(this.setRendered(),this.hide)return;const t=this.checkContext();let e,i;const s=this.stemDirection;let n=0;s===ot.DOWN?(e=this.xBegin,i=this.yTop+this.stemDownYOffset,n=this.stemDownYBaseOffset):(e=this.xEnd,i=this.yBottom-this.stemUpYOffset,n=this.stemUpYBaseOffset);const a=this.getHeight();!function(...t){ot.DEBUG&&B("VexFlow.Stem",t)}("Rendering stem - ","Top Y: ",this.yTop,"Bottom Y: ",this.yBottom);const o=this.isStemlet?a-this.stemletHeight*this.stemDirection:0,r=this.getAttribute("class");t.openGroup("stem"+(r?" "+r:""),this.getAttribute("id")),t.beginPath(),t.setLineWidth(ot.WIDTH),t.moveTo(e,i-o+n),t.lineTo(e,i-a-this.renderHeightAdjustment*s),t.stroke(),t.closeGroup()}}var rt,ht;ot.DEBUG=!1,function(t){t[t.LEFT=1]="LEFT",t[t.CENTER=2]="CENTER",t[t.RIGHT=3]="RIGHT",t[t.CENTER_STEM=4]="CENTER_STEM"}(rt||(rt={})),function(t){t[t.TOP=1]="TOP",t[t.CENTER=2]="CENTER",t[t.BOTTOM=3]="BOTTOM",t[t.CENTER_STEM=4]="CENTER_STEM"}(ht||(ht={}));class ct extends z{static get CATEGORY(){return l.Annotation}static get minAnnotationPadding(){return O.get("NoteHead.minPadding")}static format(t,e){if(!t||0===t.length)return!1;let i=0,s=0,n=0,a=0;for(let o=0;o<t.length;++o){const r=t[o];let l=(2+G.convertSizeToPixelValue(r.fontInfo.size))/st.STAVE_LINE_DISTANCE;const d=r.checkAttachedNote(),u=d.getGlyphWidth(),g=r.getWidth();r.horizontalJustification===rt.RIGHT?(n=Math.max(u,n),i=Math.max(i,g)+ct.minAnnotationPadding):r.horizontalJustification===rt.LEFT?(a=Math.max(u,a),s=Math.max(s,g)):(i=Math.max(i,g/2)+ct.minAnnotationPadding,s=Math.max(s,g/2),n=Math.max(u/2,n),a=Math.max(u/2,a));const p=d.getStave(),m=d.hasStem()?d.getStemDirection():ot.UP;let f=0,S=5;if(c(d))if(d.renderOptions.drawStem){const t=d.getStem();t&&(f=Math.abs(t.getHeight())/st.STAVE_LINE_DISTANCE)}else f=0;else if(h(d)){const t=d.getStem();t&&"n"===d.getNoteType()&&(f=Math.abs(t.getHeight())/st.STAVE_LINE_DISTANCE)}if(p&&(S=p.getNumLines()),r.verticalJustification===this.VerticalJustify.TOP){let t=d.getLineNumber(!0);c(d)&&(t=S-(d.leastString()-.5)),m===ot.UP&&(t+=f);t+e.topTextLine+.5<S?(r.setTextLine(S-t),l+=S-t,e.topTextLine=l):(r.setTextLine(e.topTextLine),e.topTextLine+=l)}else if(r.verticalJustification===this.VerticalJustify.BOTTOM){let t=S-d.getLineNumber();c(d)&&(t=d.greatestString()-1),m===ot.DOWN&&(t+=f);const i=t+e.textLine+1;i<S?(r.setTextLine(S-i),l+=S-i,e.textLine=l):(r.setTextLine(e.textLine),e.textLine+=l)}else r.setTextLine(e.textLine)}const o=Math.min(Math.max(s-a,0),Math.max(s-e.rightShift,0)),r=Math.min(Math.max(i-n,0),Math.max(i-e.leftShift,0));return e.leftShift+=r,e.rightShift+=o,!0}constructor(t){super(),this.text=t,this.horizontalJustification=rt.CENTER,this.verticalJustification=ht.TOP}setVerticalJustification(t){return this.verticalJustification="string"==typeof t?ct.VerticalJustifyString[t]:t,this}getVerticalJustification(){return this.verticalJustification}getJustification(){return this.horizontalJustification}setJustification(t){return this.horizontalJustification="string"==typeof t?ct.HorizontalJustifyString[t]:t,this}setTextBaseline(t){if(void 0!==t&&!Number.isFinite(t))throw new C("BadArgument","Text baseline must be finite.");return this.textBaseline=t,this}computeX(){const t=this.checkAttachedNote(),e=t.getModifierStartXY(Y.ABOVE,this.index),i=this.getWidth();let s;return s=this.horizontalJustification===rt.LEFT?e.x:this.horizontalJustification===rt.RIGHT?e.x-i:this.horizontalJustification===rt.CENTER?e.x-i/2:t.getStemX()-i/2,{x:s,textWidth:i}}computeY(){const t=G.convertSizeToPixelValue(this.fontInfo.size);if(void 0!==this.textBaseline)return{y:this.textBaseline,textHeight:t};const e=this.checkAttachedNote(),i=e.hasStem()?e.getStemDirection():ot.UP;let s,n={},a=0;const o=e.hasStem(),r=e.checkStave();if(o&&(n=e.checkStem().getExtents(),a=r.getSpacingBetweenLines()),this.verticalJustification===ht.BOTTOM){s=e.getYs().reduce((t,e)=>t>e?t:e),s+=(this.textLine+1)*st.STAVE_LINE_DISTANCE+t,o&&i===ot.DOWN&&(s=Math.max(s,n.topY+t+a*this.textLine))}else if(this.verticalJustification===ht.CENTER){const i=e.getYForTopText(this.textLine)-1;s=i+(r.getYForBottomText(this.textLine)-i)/2+t/2}else if(this.verticalJustification===ht.TOP){s=Math.min(...e.getYs())-(this.textLine+1)*st.STAVE_LINE_DISTANCE,o&&i===ot.UP&&(a=n.topY<r.getTopLineTopY()?st.STAVE_LINE_DISTANCE:a,s=Math.min(s,n.topY-a*(this.textLine+1)))}else{const i=e.getStemExtents();s=i.topY+(i.baseY-i.topY)/2+t/2}return{y:s,textHeight:t}}draw(){const t=this.checkContext(),{x:e}=this.computeX(),{y:i}=this.computeY();this.setRendered();const s=this.getAttribute("class");t.openGroup("annotation"+(s?" "+s:""),this.getAttribute("id")),function(...t){ct.DEBUG&&B("VexFlow.Annotation",t)}("Rendering annotation: ",this.text,e,i),this.x=e,this.y=i,this.renderText(t,0,0),this.drawPointerRect(),t.closeGroup()}}ct.DEBUG=!1,ct.HorizontalJustify=rt,ct.HorizontalJustifyString={left:rt.LEFT,right:rt.RIGHT,center:rt.CENTER,centerStem:rt.CENTER_STEM},ct.VerticalJustify=ht,ct.VerticalJustifyString={above:ht.TOP,top:ht.TOP,below:ht.BOTTOM,bottom:ht.BOTTOM,center:ht.CENTER,centerStem:ht.CENTER_STEM};const{ABOVE:lt,BELOW:dt}=z.Position;function ut(t,e){return.5*t(e/.5)}function gt(t,e){return e===lt?t<=5:t>=1}function pt(t,e){return gt(t,e)?e===lt?Math.ceil:Math.floor:Math.round}const mt=t=>r(t)||a(t);function ft(t,e){const i=t.getStemDirection(),{topY:s,baseY:n}=t.getStemExtents();if(mt(t))return t.hasStem()?i===ot.UP?s:n:Math.min(...t.getYs());if(c(t))return t.hasStem()&&i===ot.UP?s:t.checkStave().getYForTopText(e);throw new C("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")}function St(t,e){const i=t.getStemDirection(),{topY:s,baseY:n}=t.getStemExtents();if(mt(t))return t.hasStem()?i===ot.UP?n:s:Math.max(...t.getYs());if(c(t))return t.hasStem()?i===ot.UP?t.checkStave().getYForBottomText(e):s:t.checkStave().getYForBottomText(e);throw new C("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")}function Tt(t,e){const i=e===lt&&t.getStemDirection()===ot.UP||e===dt&&t.getStemDirection()===ot.DOWN;return mt(t)?t.hasStem()&&i?.5:1:t.hasStem()&&i?1:0}class xt extends z{static get CATEGORY(){return l.Articulation}static format(t,e){if(!t||0===t.length)return!1;let i=0;const s=(t,e,i)=>ut(pt(e,i),t.height/10+.5);t.forEach(t=>{const n=t.checkAttachedNote();i=Math.max(n.getGlyphWidth(),i);let a=5;const o=n.hasStem()?n.getStemDirection():ot.UP;let r=0;if(h(n)){const t=n.getStem();t&&(r=Math.abs(t.getHeight())/st.STAVE_LINE_DISTANCE)}const c=n.getStave();if(c&&(a=c.getNumLines()),t.getPosition()===lt){let i=n.getLineNumber(!0);o===ot.UP&&(i+=r);let h=s(t,e.topTextLine,lt);const c=i+e.topTextLine+.5;!t.articulation.betweenLines&&c<a&&(h+=a-c),t.setTextLine(e.topTextLine),e.topTextLine+=h,t.setOrigin(.5,1)}else if(t.getPosition()===dt){let i=Math.max(a-n.getLineNumber(),0);o===ot.DOWN&&(i+=r);let h=s(t,e.textLine,dt);const c=i+e.textLine+.5;!t.articulation.betweenLines&&c<a&&(h+=a-c),t.setTextLine(e.textLine),e.textLine+=h,t.setOrigin(.5,0)}});const n=t.map(t=>t.getWidth()).reduce((t,e)=>Math.max(e,t)),a=Math.min(Math.max(n-i,0),Math.max(n-(e.leftShift+e.rightShift),0));return e.leftShift+=a/2,e.rightShift+=a/2,!0}static easyScoreHook({articulations:t},e,i){if(!t)return;const s={staccato:"a.",tenuto:"a-",accent:"a>"};t.split(",").map(t=>t.trim().split(".")).map(([t,e])=>{const n={type:s[t]};return e&&(n.position=z.PositionString[e]),i.getFactory().Articulation(n)}).map(t=>e.addModifier(t,0))}constructor(t){var e;super(),this.heightShift=0,this.type=t,this.position=lt,st.articulationCodes(this.type)||((null!==(e=this.type.codePointAt(0))&&void 0!==e?e:0)%2==0?this.position=lt:this.position=dt),this.articulation={betweenLines:!1},this.reset()}reset(){this.articulation=st.articulationCodes(this.type),this.articulation||(this.articulation={code:this.type,betweenLines:!1});const t=(this.position===lt?this.articulation.aboveCode:this.articulation.belowCode)||this.articulation.code||_.null;this.text=t}setBetweenLines(t=!0){return this.articulation.betweenLines=t,this}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=this.checkIndex(),{position:s,textLine:n}=this,a=this.articulation.betweenLines,o=e.checkStave(),r=o.getSpacingBetweenLines(),h=c(e),{x:l}=e.getModifierStartXY(s,i),d=!a||h,u=Tt(e,s);let g={[lt]:()=>{const t=ft(e,n)-(n+u)*r;return d?Math.min(o.getYForTopText(xt.INITIAL_OFFSET),t):t},[dt]:()=>{const t=St(e,n)+(n+u)*r;return d?Math.max(o.getYForBottomText(xt.INITIAL_OFFSET),t):t}}[s]();if(!h){const t=s===lt?-1:1,n=e.getKeyProps()[i].line,o=(e.getYs()[i]-g)/r+Number(n),h=function(t,e,i,s){const n=ut(pt(e,i),e);if(t&&gt(n,i)&&n%1==0)return n+.5*-s;return n}(a,o,s,t);gt(h,s)&&this.setOrigin(.5,.5),g+=Math.abs(h-o)*r*t}!function(...t){xt.DEBUG&&B("VexFlow.Articulation",t)}(`Rendering articulation at (x: ${l}, y: ${g})`),this.x=l,this.y=g,this.renderText(t,0,0)}}xt.DEBUG=!1,xt.INITIAL_OFFSET=-.5;class wt{constructor(){this.defaultStyle={}}setDefaultStyle(t){return this.defaultStyle=Object.assign({},t),this}getDefaultStyle(){return Object.assign({},this.defaultStyle)}static get CATEGORY(){return l.RenderContext}set font(t){this.setFont(t)}get font(){return this.getFont()}}class bt extends X{static get CATEGORY(){return l.Tickable}constructor(){super(),this._preFormatted=!1,this._postFormatted=!1,this.ticks=new F(0,1),this.intrinsicTicks=0,this.tickMultiplier=new F(1,1),this.modifiers=[],this.tupletStack=[],this.alignCenter=!1,this.centerXShift=0,this.ignoreTicks=!1,this.formatterMetrics={freedom:{left:0,right:0},duration:"",iterations:0,space:{used:0,mean:0,deviation:0}}}reset(){return this}getTicks(){return this.ticks}shouldIgnoreTicks(){return this.ignoreTicks}setIgnoreTicks(t){var e;return this.ignoreTicks=t,null===(e=this.voice)||void 0===e||e.invalidateTicks(),this}getWidth(){if(!this._preFormatted)throw new C("UnformattedNote","Can't call GetWidth on an unformatted note.");return this.width+(this.modifierContext?this.modifierContext.getWidth():0)}getX(){return this.checkTickContext("Can't getX() without a TickContext.").getX()+this.xShift}getFormatterMetrics(){return this.formatterMetrics}getCenterXShift(){return this.isCenterAligned()?this.centerXShift:0}setCenterXShift(t){return this.centerXShift=t,this}isCenterAligned(){return this.alignCenter}setCenterAlignment(t){return this.alignCenter=t,this}getVoice(){return v(this.voice,"NoVoice","Tickable has no voice.")}setVoice(t){this.voice=t}getTuplet(){return this.tupletStack.at(-1)}getTupletStack(){return this.tupletStack}removeTuplet(t){const e=this.tupletStack.indexOf(t);if(-1===e)throw new C("BadArguments","Tuplet is not found in this tickable");this.tupletStack.splice(e,1);const i=t.getNoteCount(),s=t.getNotesOccupied();return this.applyTickMultiplier(i,s),this}clearTuplets(){var t;return this.tupletStack.length?(this.tupletStack=[],this.tickMultiplier=new F(1,1),this.ticks=new F(this.intrinsicTicks,1),null===(t=this.voice)||void 0===t||t.invalidateTicks(),this):this}resetTuplet(t){if(t)try{this.removeTuplet(t)}catch(t){}else this.clearTuplets();return this}setTuplet(t){return this.tupletStack.length&&this.clearTuplets(),this.addTuplet(t)}addTuplet(t){if(this.tupletStack.includes(t))return this;this.tupletStack.push(t);const e=t.getNoteCount(),i=t.getNotesOccupied();return this.applyTickMultiplier(i,e),this}setTupletStack(t){this.clearTuplets();for(const e of t)this.addTuplet(e);return this}addToModifierContext(t){this.modifierContext=t;for(let t=0;t<this.modifiers.length;++t)this.modifierContext.addMember(this.modifiers[t]);return this.modifierContext.addMember(this),this._preFormatted=!1,this}addModifier(t,e=0){return this.modifiers.push(t),this._preFormatted=!1,this}getModifiers(){return this.modifiers}setTickContext(t){this.tickContext=t,this._preFormatted=!1}checkTickContext(t="Tickable has no tick context."){return v(this.tickContext,"NoTickContext",t)}preFormat(){this._preFormatted||(this.width=0,this.modifierContext&&(this.modifierContext.preFormat(),this.width+=this.modifierContext.getWidth()))}set preFormatted(t){this._preFormatted=t}get preFormatted(){return this._preFormatted}postFormat(){return this._postFormatted||(this._postFormatted=!0),this}set postFormatted(t){this._postFormatted=t}get postFormatted(){return this._postFormatted}getIntrinsicTicks(){return this.intrinsicTicks}setIntrinsicTicks(t){var e;this.intrinsicTicks=t,this.ticks=this.tickMultiplier.clone().multiply(this.intrinsicTicks),null===(e=this.voice)||void 0===e||e.invalidateTicks()}getTickMultiplier(){return this.tickMultiplier}applyTickMultiplier(t,e){var i;this.tickMultiplier.multiply(t,e),this.ticks=this.tickMultiplier.clone().multiply(this.intrinsicTicks),null===(i=this.voice)||void 0===i||i.invalidateTicks()}setDuration(t){var e;const i=t.numerator*(st.RESOLUTION/t.denominator);this.ticks=this.tickMultiplier.clone().multiply(i),this.intrinsicTicks=i,null===(e=this.voice)||void 0===e||e.invalidateTicks()}getAbsoluteX(){return this.checkTickContext("Can't getAbsoluteX() without a TickContext.").getX()}setModifierContext(t){return this.modifierContext=t,this}getModifierContext(){return this.modifierContext}checkModifierContext(){return v(this.modifierContext,"NoModifierContext","No modifier context attached to this tickable.")}}class yt extends bt{static get CATEGORY(){return l.Note}static getGlyphProps(t,e="n"){t=st.sanitizeDuration(t);let i=st.durationCodes[t];void 0===i&&(i=st.durationCodes[4]);const s=st.codeNoteHead(e.toUpperCase(),t);return s!==_.null&&(i=Object.assign(Object.assign({},i),{codeHead:s})),i}static plotMetrics(t,e,i){var s;const n=e.getMetrics(),a=e.getAbsoluteX()-n.modLeftPx-n.leftDisplacedHeadPx,o=e.getAbsoluteX()-n.leftDisplacedHeadPx,r=e.getAbsoluteX(),h=e.getAbsoluteX()+n.notePx,c=e.getAbsoluteX()+n.notePx+n.rightDisplacedHeadPx,l=e.getAbsoluteX()+n.notePx+n.rightDisplacedHeadPx+n.modRightPx,d=l+(null!==(s=e.getFormatterMetrics().freedom.right)&&void 0!==s?s:0),u=l-a;t.save(),t.setFont(O.get("fontFamily"),8),t.fillText(Math.round(u)+"px",a+e.getXShift(),i);const g=i+7;function p(i,s,n,a=g){t.beginPath(),t.setStrokeStyle(n),t.setFillStyle(n),t.setLineWidth(3),t.moveTo(i+e.getXShift(),a),t.lineTo(s+e.getXShift(),a),t.stroke()}p(a,o,"red"),p(o,r,"#999"),p(r,h,"green"),p(h,c,"#999"),p(c,l,"red"),p(l,d,"#DD0"),p(a-e.getXShift(),a,"#BBB"),function(t,e,i,s="#F55"){t.save(),t.setFillStyle(s),t.beginPath(),t.arc(e,i,3,0,2*Math.PI,!1),t.closePath(),t.fill(),t.restore()}(t,r+e.getXShift(),g,"blue");const m=e.getFormatterMetrics();if(m.iterations>0){const s=m.space.deviation,n=s>=0?"+":"";t.setFillStyle("red"),t.fillText(n+Math.round(s),r+e.getXShift(),i-10)}t.restore()}static parseDuration(t){if(!t||t.length>64)return;const e=/^(\d+(?:\/\d+)?|[a-z])(d*)([nrhms]?)$/.exec(t);if(!e)return;return{duration:e[1],dots:e[2].length,type:e[3]||"n"}}static parseNoteStruct(t){const e=yt.parseDuration(t.duration);if(!e)return;let i=t.type;if(i&&!st.validTypes[i])return;const s=[];i||(i=e.type||"n",void 0!==t.keys&&t.keys.forEach((t,e)=>{const n=t.split("/");s[e]=n&&3===n.length?n[2]:i}));let n=st.durationToTicks(e.duration);if(!n)return;const a=t.dots?t.dots:e.dots;if("number"!=typeof a)return;let o=n;for(let t=0;t<a;t++){if(o<=1)return;o/=2,n+=o}return{duration:e.duration,type:i,customTypes:s,dots:a,ticks:n}}constructor(t){if(super(),!t)throw new C("BadArguments","Note must have valid initialization data to identify duration and type.");const e=yt.parseNoteStruct(t);if(!e)throw new C("BadArguments",`Invalid note initialization object: ${JSON.stringify(t)}`);this.keys=t.keys||[],this.keyProps=[],this.duration=e.duration,this.noteType=e.type,this.customTypes=e.customTypes,t.durationOverride?this.setDuration(t.durationOverride):this.setIntrinsicTicks(e.ticks),this.modifiers=[],this.glyphProps=yt.getGlyphProps(this.duration,this.noteType),this.customGlyphs=this.customTypes.map(t=>yt.getGlyphProps(this.duration,t)),this.playNote=void 0,this.ignoreTicks=!1,this.width=0,this.leftDisplacedHeadPx=0,this.rightDisplacedHeadPx=0,this.xShift=0,this.ys=[],t.alignCenter&&this.setCenterAlignment(t.alignCenter),this.renderOptions={annotationSpacing:5,strokePx:1,yShift:0}}getPlayNote(){return this.playNote}setPlayNote(t){return this.playNote=t,this}isRest(){return!1}addStroke(t,e){return e.setNote(this),e.setIndex(t),this.modifiers.push(e),this.preFormatted=!1,this}getStave(){return this.stave}checkStave(){return v(this.stave,"NoStave","No stave attached to instance.")}setStave(t){return this.stave=t,this.setYs([t.getYForLine(0)]),this.setContext(this.stave.getContext()),this}getLeftDisplacedHeadPx(){return this.leftDisplacedHeadPx}getRightDisplacedHeadPx(){return this.rightDisplacedHeadPx}setLeftDisplacedHeadPx(t){return this.leftDisplacedHeadPx=t,this}setRightDisplacedHeadPx(t){return this.rightDisplacedHeadPx=t,this}shouldIgnoreTicks(){return this.ignoreTicks}getLineNumber(t){return 0}getLineForRest(){return 0}getGlyphProps(){return this.glyphProps}getGlyphWidth(){return 0}setYs(t){return this.ys=t,this}getYs(){if(0===this.ys.length)throw new C("NoYValues","No Y-values calculated for this note.");return this.ys}getYForTopText(t){return this.checkStave().getYForTopText(t)}getVoice(){if(!this.voice)throw new C("NoVoice","Note has no voice.");return this.voice}setVoice(t){return this.voice=t,this.preFormatted=!1,this}getTickContext(){return this.checkTickContext()}setTickContext(t){return this.tickContext=t,this.preFormatted=!1,this}getDuration(){return this.duration}isDotted(){return this.getModifiersByType(l.Dot).length>0}hasStem(){return!1}getNoteType(){return this.noteType}getBeam(){return this.beam}checkBeam(){return v(this.beam,"NoBeam","No beam attached to instance")}hasBeam(){return void 0!==this.beam}setBeam(t){return this.beam=t,this}addModifier(t,e=0){const i="Note.addModifier(modifier: Modifier, index: number=0)";if("string"==typeof e&&(e=parseInt(e),console.warn(i+" expected a number for `index`, but received a string.")),"object"!=typeof t||"number"!=typeof e)throw new C("WrongParams","Incorrect call signature. Use "+i+" instead.");return t.setNote(this),t.setIndex(e),super.addModifier(t),this}getModifiersByType(t){return this.modifiers.filter(e=>e.getCategory()===t)}getModifierStartXY(t,e,i){if(!this.preFormatted)throw new C("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");return{x:this.getAbsoluteX(),y:this.ys[0]}}getRightParenthesisPx(t){return this.getKeyProps()[t].displaced?this.getRightDisplacedHeadPx():0}getLeftParenthesisPx(t){return this.getKeyProps()[t].displaced?this.getLeftDisplacedHeadPx()-this.xShift:-this.xShift}getFirstDotPx(){let t=this.getRightDisplacedHeadPx();const e=this.checkModifierContext().getMembers("Parenthesis");return 0!==e.length&&(t+=e[0].getWidth()+1),t}getMetrics(){if(!this.preFormatted)throw new C("UnformattedNote","Can't call getMetrics on an unformatted note.");const t=this.modifierContext?this.modifierContext.getState().leftShift:0,e=this.modifierContext?this.modifierContext.getState().rightShift:0,i=this.getWidth();return{width:i,glyphWidth:this.getGlyphWidth(),notePx:i-t-e-this.leftDisplacedHeadPx-this.rightDisplacedHeadPx,modLeftPx:t,modRightPx:e,leftDisplacedHeadPx:this.leftDisplacedHeadPx,rightDisplacedHeadPx:this.rightDisplacedHeadPx,glyphPx:0}}getAbsoluteX(){let t=this.checkTickContext("Can't getAbsoluteX() without a TickContext.").getX();return this.stave&&(t+=this.stave.getNoteStartX()+O.get("Stave.padding",0)),this.isCenterAligned()&&(t+=this.getCenterXShift()),t}getStemDirection(){throw new C("NoStem","No stem attached to this note.")}getStemExtents(){throw new C("NoStem","No stem attached to this note.")}getTieRightX(){let t=this.getAbsoluteX();return t+=this.getGlyphWidth()/2,t+=-this.width/2+this.width+2,t}getTieLeftX(){let t=this.getAbsoluteX();return t+=this.getGlyphWidth()/2,t-=this.width/2+2,t}getKeys(){return this.keys}getKeyProps(){return this.keyProps}getBoundingBox(){const t=super.getBoundingBox();for(let e=0;e<this.modifiers.length;e++)t.mergeWith(this.modifiers[e].getBoundingBox());return t}}var Ct,kt,vt,Bt,Dt,Lt;!function(t){t[t.CENTER=0]="CENTER",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.ABOVE=3]="ABOVE",t[t.BELOW=4]="BELOW",t[t.BEGIN=5]="BEGIN",t[t.END=6]="END"}(Ct||(Ct={}));class Et extends X{static get CATEGORY(){return l.StaveModifier}static get Position(){return Ct}constructor(){super(),this.padding=10,this.position=Ct.ABOVE}getPosition(){return this.position}setPosition(t){return this.position=t,this}getStave(){return this.stave}checkStave(){return v(this.stave,"NoStave","No stave attached to instance.")}setStave(t){return this.stave=t,this}getPadding(t){return void 0!==t&&t<2?0:this.padding}setPadding(t){return this.padding=t,this}setLayoutMetrics(t){return this.layoutMetrics=t,this}getLayoutMetrics(){return this.layoutMetrics}}!function(t){t[t.SINGLE=1]="SINGLE",t[t.DOUBLE=2]="DOUBLE",t[t.END=3]="END",t[t.REPEAT_BEGIN=4]="REPEAT_BEGIN",t[t.REPEAT_END=5]="REPEAT_END",t[t.REPEAT_BOTH=6]="REPEAT_BOTH",t[t.NONE=7]="NONE"}(kt||(kt={})),function(t){t[t.NONE=0]="NONE",t[t.STRAIGHT=1]="STRAIGHT",t[t.CURVED=2]="CURVED"}(vt||(vt={}));class Nt extends Et{static get CATEGORY(){return l.Barline}static get type(){return kt}static get typeString(){return{single:kt.SINGLE,double:kt.DOUBLE,end:kt.END,repeatBegin:kt.REPEAT_BEGIN,repeatEnd:kt.REPEAT_END,repeatBoth:kt.REPEAT_BOTH,none:kt.NONE}}constructor(t){super(),this.repeatBrackets=vt.NONE,this.thickness=st.STAVE_LINE_THICKNESS;const e=kt;this.widths={},this.widths[e.SINGLE]=5,this.widths[e.DOUBLE]=5,this.widths[e.END]=5,this.widths[e.REPEAT_BEGIN]=5,this.widths[e.REPEAT_END]=5,this.widths[e.REPEAT_BOTH]=5,this.widths[e.NONE]=5,this.paddings={},this.paddings[e.SINGLE]=0,this.paddings[e.DOUBLE]=0,this.paddings[e.END]=0,this.paddings[e.REPEAT_BEGIN]=15,this.paddings[e.REPEAT_END]=15,this.paddings[e.REPEAT_BOTH]=15,this.paddings[e.NONE]=0,this.layoutMetricsMap={},this.layoutMetricsMap[e.SINGLE]={xMin:0,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.DOUBLE]={xMin:-3,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.END]={xMin:-5,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.REPEAT_END]={xMin:-10,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.REPEAT_BEGIN]={xMin:-2,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.REPEAT_BOTH]={xMin:-10,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.NONE]={xMin:0,xMax:0,paddingLeft:5,paddingRight:5},this.setPosition(Ct.BEGIN),this.setType(t)}setRepeatBracket(t){this.repeatBrackets=t}getRepeatBrackets(){return this.repeatBrackets}getType(){return this.type}setType(t){return this.type="string"==typeof t?Nt.typeString[t]:t,this.setWidth(this.widths[this.type]),this.setPadding(this.paddings[this.type]),this.setLayoutMetrics(this.layoutMetricsMap[this.type]),this}draw(){const t=this.checkStave(),e=t.checkContext();this.setRendered();const i=this.getAttribute("class");switch(e.openGroup("stavebarline"+(i?" "+i:""),this.getAttribute("id")),this.type){case kt.SINGLE:this.drawVerticalBar(t,this.x,!1);break;case kt.DOUBLE:this.drawVerticalBar(t,this.x,!0);break;case kt.END:this.drawVerticalEndBar(t,this.x);break;case kt.REPEAT_BEGIN:this.drawRepeatBar(t,this.x,!0),t.getX()!==this.x&&this.drawVerticalBar(t,t.getX());break;case kt.REPEAT_END:this.drawRepeatBar(t,this.x,!1);break;case kt.REPEAT_BOTH:this.drawRepeatBar(t,this.x,!1),this.drawRepeatBar(t,this.x,!0)}this.drawPointerRect(),e.closeGroup()}drawVerticalBar(t,e,i){const s=t.checkContext(),n=t.getTopLineTopY(),a=t.getBottomLineBottomY();i&&s.fillRect(e-3,n,1,a-n),s.fillRect(e,n,1,a-n)}drawVerticalEndBar(t,e){const i=t.checkContext(),s=t.getTopLineTopY(),n=t.getBottomLineBottomY();i.fillRect(e-5,s,1,n-s),i.fillRect(e-2,s,3,n-s)}drawStraightBrackets(t,e,i,s,n){const a=t.checkContext(),o=Math.round(1.5*st.STAVE_LINE_DISTANCE)*n,r=Math.round(.6*st.STAVE_LINE_DISTANCE),h=Math.round(r/2),c=i+s,l=n>0?e-2:e;a.moveTo(l,c),a.lineTo(l,c+r*(-1*s)),a.lineTo(l+o,c+r*s),a.lineTo(l+o,c+s*(r+h)),a.lineTo(l,c),a.fill()}drawCurvedBrackets(t,e,i,s,n){const a=t.checkContext(),o=Math.round(1.5*st.STAVE_LINE_DISTANCE)*n,r=Math.round(.6*st.STAVE_LINE_DISTANCE),h=Math.round(r/2),c=i+s,l=n>0?e-2:e;a.moveTo(l,c),a.lineTo(l,c+r*(-1*s)),a.quadraticCurveTo(l+o/2,c+r*(-1*s),l+o,c+r*s),a.lineTo(l+o,c+s*(r+h)),a.quadraticCurveTo(l+o/2,c,l,c),a.fill()}drawRepeatBar(t,e,i){const s=t.checkContext(),n=t.getTopLineTopY(),a=t.getBottomLineBottomY();let o=3;i||(o=-5);const r=i?1:-1;s.fillRect(e+o,n,1,a-n),s.fillRect(e-2,n,3,a-n),this.repeatBrackets===vt.CURVED?(this.drawCurvedBrackets(t,e,n,-1,r),this.drawCurvedBrackets(t,e,a,1,r)):this.repeatBrackets===vt.STRAIGHT&&(this.drawStraightBrackets(t,e,n,-1,r),this.drawStraightBrackets(t,e,a,1,r));i?o+=4:o-=4;const h=e+o+1;let c=(t.getNumLines()-1)*t.getSpacingBetweenLines();c=c/2-t.getSpacingBetweenLines()/2;let l=n+c+1;s.beginPath(),s.arc(h,l,2,0,2*Math.PI,!1),s.fill(),l+=t.getSpacingBetweenLines(),s.beginPath(),s.arc(h,l,2,0,2*Math.PI,!1),s.fill()}}class Ft extends yt{static get CATEGORY(){return l.BarNote}constructor(t=kt.SINGLE){super({duration:"b"}),this.metrics={widths:{}};const e=kt;this.metrics.widths={[e.SINGLE]:8,[e.DOUBLE]:12,[e.END]:15,[e.REPEAT_BEGIN]:14,[e.REPEAT_END]:14,[e.REPEAT_BOTH]:18,[e.NONE]:0},this.ignoreTicks=!0,this.setType(t)}getType(){return this.type}setType(t){return this.type="string"==typeof t?Nt.typeString[t]:t,this.setWidth(this.metrics.widths[this.type]),this}addToModifierContext(t){return this}preFormat(){return this.preFormatted=!0,this}draw(){const t=this.checkContext();!function(...t){Ft.DEBUG&&B("VexFlow.BarNote",t)}("Rendering bar line at: ",this.getAbsoluteX());const e=new Nt(this.type);e.setX(this.getAbsoluteX()),e.setStave(this.checkStave()),e.setContext(t),e.drawWithStyle(),this.setRendered()}}Ft.DEBUG=!1;class At extends z{static get CATEGORY(){return l.Bend}static get UP(){return 0}static get DOWN(){return 1}static format(t,e){if(!t||0===t.length)return!1;let i=0;for(let s=0;s<t.length;++s){const n=t[s],a=n.checkAttachedNote();if(c(a)){const t=a.leastString()-1;e.topTextLine<t&&(e.topTextLine=t)}n.setXShift(i),i=n.getWidth(),n.setTextLine(e.topTextLine)}return e.rightShift+=i,e.topTextLine+=1,!0}setStyleLine(t){return this.styleLine=t,this}getStyleLine(){return this.styleLine}constructor(t){super(),this.styleLine=O.getStyle("Bend.line"),this.xShift=0,this.tap="",this.renderOptions={bendWidth:8,releaseWidth:8},this.phrase=t,this.updateWidth()}setXShift(t){return this.xShift=t,this.updateWidth(),this}setTap(t){return this.tap=t,this}getTextHeight(){const t=new X(l.Bend);return t.setText(this.phrase[0].text),t.getHeight()}updateWidth(){const t=t=>{const e=new X(l.Bend);return e.setText(t),e.getWidth()};let e=0;for(let i=0;i<this.phrase.length;++i){const s=this.phrase[i];if(void 0!==s.width)e+=s.width;else{const i=s.type===At.UP?this.renderOptions.bendWidth:this.renderOptions.releaseWidth;s.width=Math.max(i,t(s.text))+3,s.drawWidth=s.width/2,e+=s.width}}return this.setWidth(e+this.xShift),this}draw(){var t;const e=this.checkContext(),i=this.checkAttachedNote();this.setRendered();const s=i.getModifierStartXY(z.Position.RIGHT,this.index);s.x+=3,s.y+=.5;const n=this.xShift,a=i.checkStave().getSpacingBetweenLines(),o=i.getYs().reduce((t,e)=>t<e?t:e),r=s.y-((this.textLine+1)*a+s.y-o)+3,h=s.y-((this.textLine+1)*a+s.y-o)-1,c=(t,i,s,n)=>{const a=t+s,o=i;this.applyStyle(e,this.styleLine),e.beginPath(),e.moveTo(t,i),e.quadraticCurveTo(a,o,t+s,n),e.stroke()},l=(t,i,s,n)=>{this.applyStyle(e,this.styleLine),e.beginPath(),e.moveTo(t,n),e.quadraticCurveTo(t+s,n,t+s,i),e.stroke()},d=(t,i,s)=>{const n=i+4*s;e.beginPath(),e.moveTo(t,i),e.lineTo(t-4,n),e.lineTo(t+4,n),e.closePath(),e.fill()},u=(t,i)=>{e.setFont(this.fontInfo);const s=t-e.measureText(i).width/2;e.fillText(i,s,h)};let g,p=0,m=0;if(null===(t=this.tap)||void 0===t?void 0:t.length){u(i.getModifierStartXY(z.Position.CENTER,this.index).x,this.tap)}for(let t=0;t<this.phrase.length;++t){const e=this.phrase[t];e.drawWidth||(e.drawWidth=0),0===t&&(e.drawWidth+=n),m=e.drawWidth+p-(1===t?n:0),e.type===At.UP&&(g&&g.type===At.UP&&d(s.x,r,1),c(s.x,s.y,m,r)),e.type===At.DOWN&&(g&&g.type===At.UP&&l(s.x,s.y,m,r),g&&g.type===At.DOWN&&(d(s.x,s.y,-1),l(s.x,s.y,m,r)),g||(m=e.drawWidth,l(s.x,s.y,m,r))),u(s.x+m,e.text),g=e,p=e.drawWidth,g.x=s.x,s.x+=m}if(!g||void 0===g.x)throw new C("NoLastBendForBend","Internal error.");g.type===At.UP?d(g.x+m,r,1):g.type===At.DOWN&&d(g.x+m,s.y,-1)}}function Ot(...t){Pt.DEBUG&&B("VexFlow.ChordSymbol",t)}class Rt extends X{constructor(t,e,i,s,n){super(),this.text=t,this.symbolModifier=e,this.xShift=i,this.yShift=s,this.vAlign=n}isSuperscript(){return this.symbolModifier===Lt.SUPERSCRIPT}isSubscript(){return this.symbolModifier===Lt.SUBSCRIPT}}!function(t){t[t.LEFT=1]="LEFT",t[t.CENTER=2]="CENTER",t[t.RIGHT=3]="RIGHT",t[t.CENTER_STEM=4]="CENTER_STEM"}(Bt||(Bt={})),function(t){t[t.TOP=1]="TOP",t[t.BOTTOM=2]="BOTTOM"}(Dt||(Dt={})),function(t){t[t.NONE=1]="NONE",t[t.SUBSCRIPT=2]="SUBSCRIPT",t[t.SUPERSCRIPT=3]="SUPERSCRIPT"}(Lt||(Lt={}));class Pt extends z{static get CATEGORY(){return l.ChordSymbol}static get superSubRatio(){return O.get("ChordSymbol.superSubRatio")}static get spacingBetweenBlocks(){return O.get("ChordSymbol.spacing")}static get superscriptOffset(){return O.get("ChordSymbol.superscriptOffset")}static get subscriptOffset(){return O.get("ChordSymbol.subscriptOffset")}static get minPadding(){return O.get("NoteHead.minPadding")}static format(t,e){if(!t||0===t.length)return!1;let i=0,s=0,n=0,a=0,o=0;for(const r of t){const t=r.checkAttachedNote();let c=1;for(let t=0;t<r.symbolBlocks.length;++t){const e=r.symbolBlocks[t],s=e.isSuperscript(),n=e.isSubscript();if(e.setXShift(i),(s||n)&&(c=2),n&&t>0){const s=r.symbolBlocks[t-1];s.isSuperscript()&&(e.setXShift(i-s.getWidth()-Pt.minPadding),e.vAlign=!0,i+=-s.getWidth()-Pt.minPadding+(s.getWidth()>e.getWidth()?s.getWidth()-e.getWidth():0))}i+=e.getWidth()+Pt.minPadding}if(r.getVertical()===Dt.TOP?(r.setTextLine(e.topTextLine),e.topTextLine+=c):(r.setTextLine(e.textLine+1),e.textLine+=c+1),r.getReportWidth()){if(h(t)){const e=t.getGlyphWidth();r.getHorizontal()===Bt.RIGHT?(a=Math.max(e,a),s=Math.max(s,i)+Pt.minPadding):r.getHorizontal()===Bt.LEFT?(o=Math.max(e,o),n=Math.max(n,i)):(s=Math.max(s,i/2)+Pt.minPadding,n=Math.max(n,i/2),a=Math.max(e/2,a),o=Math.max(e/2,o))}r.width=i}i=0}const r=Math.min(Math.max(n-o,0),Math.max(n-e.rightShift,0)),c=Math.min(Math.max(s-a,0),Math.max(s-e.leftShift,0));return e.leftShift+=c,e.rightShift+=r,!0}constructor(){super(),this.symbolBlocks=[],this.horizontal=Bt.LEFT,this.vertical=Dt.TOP,this.reportWidth=!0}get superscriptOffset(){return Pt.superscriptOffset*G.convertSizeToPixelValue(this.fontInfo.size)}get subscriptOffset(){return Pt.subscriptOffset*G.convertSizeToPixelValue(this.fontInfo.size)}setReportWidth(t){return this.reportWidth=t,this}getReportWidth(){return this.reportWidth}getSymbolBlock(t={}){var e,i;const s=new Rt(null!==(e=t.text)&&void 0!==e?e:"",null!==(i=t.symbolModifier)&&void 0!==i?i:Lt.NONE,0,0,!1);if(s.isSubscript()&&s.setYShift(this.subscriptOffset),s.isSuperscript()&&s.setYShift(this.superscriptOffset),s.isSubscript()||s.isSuperscript()){const{family:t,size:e,weight:i,style:n}=this.fontInfo,a=G.scaleSize(e,Pt.superSubRatio);s.setFont(t,a,i,n)}else s.setFont(this.fontInfo);return s}addSymbolBlock(t){return this.symbolBlocks.push(this.getSymbolBlock(t)),this}addText(t,e={}){return this.addSymbolBlock(Object.assign(Object.assign({},e),{text:t}))}addTextSuperscript(t){const e=Lt.SUPERSCRIPT;return this.addSymbolBlock({text:t,symbolModifier:e})}addTextSubscript(t){const e=Lt.SUBSCRIPT;return this.addSymbolBlock({text:t,symbolModifier:e})}addGlyphSuperscript(t){return this.addTextSuperscript(Pt.glyphs[t])}addGlyph(t,e={}){return this.addText(Pt.glyphs[t],e)}addGlyphOrText(t,e={}){let i="";for(let e=0;e<t.length;++e){const s=t[e],n=Pt.glyphs[s];i+=n||s}return i.length>0&&this.addText(i,e),this}addLine(t={}){return this.addText("",t)}setVertical(t){return this.vertical="string"==typeof t?Pt.VerticalJustifyString[t]:t,this}getVertical(){return this.vertical}setHorizontal(t){return this.horizontal="string"==typeof t?Pt.HorizontalJustifyString[t]:t,this}getHorizontal(){return this.horizontal}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=this.getAttribute("class");t.openGroup("chordsymbol"+(i?" "+i:""),this.getAttribute("id"));const s=e.getModifierStartXY(z.Position.ABOVE,this.index);let n;t.setFont(this.fontInfo);const a=e.hasStem(),o=e.checkStave();if(this.vertical===Dt.BOTTOM){if(n=o.getYForBottomText(this.textLine+st.TEXT_HEIGHT_OFFSET_HACK),a){const t=e.checkStem().getExtents(),i=o.getSpacingBetweenLines(),s=1===e.getStemDirection()?t.baseY:t.topY;n=Math.max(n,s+i*(this.textLine+2))}}else{const t=Math.min(...e.getYs());if(n=Math.min(o.getYForTopText(this.textLine),t-10),a){const t=e.checkStem().getExtents(),i=o.getSpacingBetweenLines();n=Math.min(n,t.topY-5-i*this.textLine)}}let r=s.x;r=this.horizontal===Bt.LEFT?s.x:this.horizontal===Bt.RIGHT?s.x+this.getWidth():this.horizontal===Bt.CENTER?s.x-this.getWidth()/2:e.getStemX()-this.getWidth()/2,Ot("Rendering ChordSymbol: ",r,n),this.symbolBlocks.forEach(e=>{Ot("Rendering Text: ",e.getText(),r+e.getXShift(),n+e.getYShift()),e.setX(r),e.setY(n),e.renderText(t,0,0)}),this.drawPointerRect(),t.closeGroup()}getBoundingBox(){const t=this.symbolBlocks[0].getBoundingBox();for(let e=1;e<this.symbolBlocks.length;e++)t.mergeWith(this.symbolBlocks[e].getBoundingBox());return t}}Pt.DEBUG=!1,Pt.HorizontalJustify=Bt,Pt.HorizontalJustifyString={left:Bt.LEFT,right:Bt.RIGHT,center:Bt.CENTER,centerStem:Bt.CENTER_STEM},Pt.VerticalJustify=Dt,Pt.VerticalJustifyString={top:Dt.TOP,above:Dt.TOP,below:Dt.BOTTOM,bottom:Dt.BOTTOM},Pt.glyphs={diminished:_.csymDiminished,dim:_.csymDiminished,halfDiminished:_.csymHalfDiminished,"+":_.csymAugmented,augmented:_.csymAugmented,majorSeventh:_.csymMajorSeventh,minor:_.csymMinor,"-":_.csymMinor,"(":"(",leftParen:"(",")":")",rightParen:")",leftBracket:_.csymBracketLeftTall,rightBracket:_.csymBracketRightTall,leftParenTall:"(",rightParenTall:")","/":_.csymDiagonalArrangementSlash,over:_.csymDiagonalArrangementSlash,"#":_.csymAccidentalSharp,b:_.csymAccidentalFlat},Pt.symbolModifiers=Lt;class Mt extends z{static get CATEGORY(){return l.Dot}static getDots(t){return t.getModifiersByType(Mt.CATEGORY)}static buildAndAttach(t,e){for(const i of t)if(null==e?void 0:e.all)for(let t=0;t<i.keys.length;t++){const e=new Mt;i.addModifier(e,t)}else if(void 0!==(null==e?void 0:e.index)){const t=new Mt;i.addModifier(t,null==e?void 0:e.index)}else{const t=new Mt;i.addModifier(t,0)}}static format(t,e){const i=e.rightShift;if(!t||0===t.length)return!1;const s=[],n={};for(let e=0;e<t.length;++e){const a=t[e],o=a.getNote();let h,l;if(r(o)){const t=a.checkIndex();h=o.getKeyProps()[t],l=o.getFirstDotPx()}else{if(!c(o))throw new C("Internal","Unexpected instance.");h={line:.5},l=i}const d=o.getAttribute("id");s.push({line:h.line,note:o,noteId:d,dot:a}),n[d]=Math.max(n[d]||l,l)}s.sort((t,e)=>e.line-t.line);let a=i,o=0,h=null,l=null,d=null,u=0;for(let t=0;t<s.length;++t){const{dot:e,note:i,noteId:r,line:c}=s[t];c===h&&i===l||(a=n[r]),i.isRest()||c===h||(.5===Math.abs(c%1)?u=0:(u=.5,null===l||l.isRest()||null===h||h-c!==.5?c+u===d&&(u=-.5):u=-.5)),i.isRest()?e.dotShiftY+=-u:e.dotShiftY=-u,d=c+u,e.setXShift(a),a+=e.getWidth()+1,o=a>o?a:o,h=c,l=i}return e.rightShift+=o,!0}constructor(){super(),this.position=z.Position.RIGHT,this.setText(_.augmentationDot),this.dotShiftY=0}setNote(t){return this.note=t,this.font=t.font,this}setDotShiftY(t){return this.dotShiftY=t,this}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=e.checkStave().getSpacingBetweenLines(),s=e.getModifierStartXY(this.position,this.index,{forceFlagRight:!0});c(e)&&(s.y=e.getStemExtents().baseY),this.x=s.x,this.y=s.y+this.dotShiftY*i,this.renderText(t,0,0)}}class It extends z{static get CATEGORY(){return l.FretHandFinger}static format(t,e){const{leftShift:i,rightShift:s}=e;if(!t||0===t.length)return!1;const n=[];let a=null,o=0,r=0;for(let h=0;h<t.length;++h){const c=t[h],l=c.getNote(),d=c.getPosition(),u=c.checkIndex(),g=l.getKeyProps()[u],p=O.get("FretHandFinger.fontSize");if(c.position===Y.ABOVE&&(e.topTextLine+=p/st.STAVE_LINE_DISTANCE+.5),c.position===Y.BELOW&&(e.textLine+=p/st.STAVE_LINE_DISTANCE+.5),l!==a){for(let t=0;t<l.keys.length;++t)0===i&&(o=Math.max(l.getLeftDisplacedHeadPx(),o)),0===s&&(r=Math.max(l.getRightDisplacedHeadPx(),r));a=l}n.push({note:l,num:c,pos:d,line:g.line,shiftL:o,shiftR:r})}n.sort((t,e)=>e.line-t.line);let h=0,c=0,l=0,d=0,u=null,g=null;for(let t=0;t<n.length;++t){let e=0;const{note:a,pos:o,num:p,line:m,shiftL:f,shiftR:S}=n[t];m===u&&a===g||(h=i+f,c=s+S);const T=p.getWidth()+1;o===z.Position.LEFT?(p.setXShift(i+h),e=i+T,l=e>l?e:l):o===z.Position.RIGHT&&(p.setXShift(c),e=r+T,d=e>d?e:d),u=m,g=a}return e.leftShift+=l,e.rightShift+=d,!0}static easyScoreHook({fingerings:t}={},e,i){null==t||t.split(",").map(t=>{const e=t.trim().split("."),s={number:e[0]};return e[1]&&(s.position=e[1]),i.getFactory().Fingering(s)}).map((t,i)=>e.addModifier(t,i))}constructor(t){super(),this.setFretHandFinger(t),this.position=z.Position.LEFT,this.xOffset=0,this.yOffset=0}setFretHandFinger(t){return this.text=t,this}getFretHandFinger(){return this.text}setOffsetX(t){return this.xOffset=t,this}setOffsetY(t){return this.yOffset=t,this}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=e.getModifierStartXY(this.position,this.index);let s=i.x+this.xOffset,n=i.y+this.yOffset+5;switch(this.position){case z.Position.ABOVE:s-=4,n-=12;break;case z.Position.BELOW:s-=2,n+=10;break;case z.Position.LEFT:s-=this.width;break;case z.Position.RIGHT:s+=1;break;default:throw new C("InvalidPosition",`The position ${this.position} does not exist`)}this.renderText(t,s,n)}}class Ht extends yt{static get CATEGORY(){return l.NoteHead}constructor(t){var e;super(t),this.customGlyph=!1,this.ledger={"":"","":""},this.index=t.index,this.x=t.x||0,this.y=t.y||0,t.noteType&&(this.noteType=t.noteType),this.displaced=t.displaced||!1,this.stemDirection=t.stemDirection||ot.UP,this.line=t.line||0,this.glyphProps=yt.getGlyphProps(this.duration,this.noteType),v(this.glyphProps,"BadArguments",`No glyph found for duration '${this.duration}' and type '${this.noteType}'`),(this.line>5||this.line<0)&&this.ledger[this.glyphProps.codeHead]&&(this.glyphProps.codeHead=this.ledger[this.glyphProps.codeHead]),this.text=this.glyphProps.codeHead,t.customGlyphCode&&(this.customGlyph=!0,this.text=t.customGlyphCode),this.setStyle(null!==(e=t.style)&&void 0!==e?e:{}),this.slashed=t.slashed||!1,this.renderOptions=Object.assign({},this.renderOptions)}getWidth(){return this.width}isDisplaced(){return!0===this.displaced}getLine(){return this.line}setLine(t){return this.line=t,this}getAbsoluteX(){const t=this.preFormatted?super.getAbsoluteX():this.x,e=ot.WIDTH/2;return t+(this.displaced?(this.width-e)*this.stemDirection:0)}setStave(t){const e=this.getLine();return this.stave=t,this.stave&&(this.setY(this.stave.getYForNote(e)),this.setContext(this.stave.getContext())),this}preFormat(){return this.preFormatted||(this.preFormatted=!0),this}draw(){var t;const e=this.checkContext();this.setRendered();const i=this.getAttribute("class");e.openGroup("notehead"+(i?" "+i:""),this.getAttribute("id")),function(...t){Ht.DEBUG&&B("VexFlow.NoteHead",t)}("Drawing note head '",this.noteType,this.duration,"' at",this.x,this.y),this.x=this.getAbsoluteX(),this.renderText(e,0,0),null===(t=this.parent)||void 0===t||t.drawModifiers(this),this.drawPointerRect(),e.closeGroup()}}Ht.DEBUG=!1;class Wt extends X{static get CATEGORY(){return l.Flag}draw(){const t=this.checkContext();this.setRendered();const e=this.getAttribute("class");t.openGroup("flag"+(e?" "+e:""),this.getAttribute("id")),function(...t){Wt.DEBUG&&B("VexFlow.Flag",t)}("Drawing flag '",this.text,"' at",this.x,this.y),this.renderText(t,0,0),this.drawPointerRect(),t.closeGroup()}}Wt.DEBUG=!1;class Gt extends yt{static get CATEGORY(){return l.StemmableNote}constructor(t){super(t),this.flag=new Wt}getStem(){return this.stem}checkStem(){if(!this.stem)throw new C("NoStem","No stem attached to instance");return this.stem}setStem(t){return this.stem=t,this.addChild(t),this}buildStem(){const t=new ot;return this.setStem(t),this}buildFlag(){var t,e,i;const{glyphProps:s}=this;if(this.hasFlag()){const n=this.getStemDirection()===ot.DOWN?String.fromCodePoint((null!==(e=null===(t=s.codeFlagUp)||void 0===t?void 0:t.codePointAt(0))&&void 0!==e?e:-1)+1):null!==(i=s.codeFlagUp)&&void 0!==i?i:_.null;this.flag.setText(n),this.flag.fontInfo=this.fontInfo}}getBaseCustomNoteHeadGlyphProps(){return this.getStemDirection()===ot.DOWN?this.customGlyphs[this.customGlyphs.length-1]:this.customGlyphs[0]}getStemLength(){return ot.HEIGHT+this.getStemExtension()}getBeamCount(){const t=this.getGlyphProps();return t?t.beamCount:0}getStemMinimumLength(){const t=st.durationToFraction(this.duration),e=void 0===this.beam;let i=t.value()<=1?0:20;switch(this.duration){case"8":case"16":i=e?35:25;break;case"32":i=e?45:35;break;case"64":i=e?50:40;break;case"128":i=e?55:45;break;case"256":i=e?60:55;break;case"512":i=e?65:60;break;case"1024":i=e?70:65}return i}getStemDirection(){if(!this.stemDirection)throw new C("NoStem","No stem attached to this note.");return this.stemDirection}setStemDirection(t){if(t||(t=ot.UP),t!==ot.UP&&t!==ot.DOWN)throw new C("BadArgument",`Invalid stem direction: ${t}`);return this.stemDirection=t,this.reset(),this.hasFlag()&&this.buildFlag(),this.beam=void 0,this.stem&&(this.stem.setDirection(t),this.stem.setExtension(this.getStemExtension())),this.preFormatted&&this.preFormat(),this}getStemX(){const t=this.getAbsoluteX()+this.xShift,e=this.getAbsoluteX()+this.xShift+this.getGlyphWidth();return this.stemDirection===ot.DOWN?t:e}getCenterGlyphX(){return this.getAbsoluteX()+this.xShift+this.getGlyphWidth()/2}getStemExtension(){const t=this.getGlyphProps(),e=this.flag.getHeight(),i=this.getFontScale();return void 0!==this.stemExtensionOverride?this.stemExtensionOverride:this.beam?t.stemBeamExtension*i:e>ot.HEIGHT*i?e-ot.HEIGHT*i:0}setStemLength(t){return this.stemExtensionOverride=t-ot.HEIGHT,this}getStemExtents(){if(!this.stem)throw new C("NoStem","No stem attached to this note.");return this.stem.getExtents()}getYForTopText(t){const e=this.checkStave();if(this.hasStem()){const i=this.getStemExtents();if(!i)throw new C("InvalidState","Stem does not have extents.");return Math.min(e.getYForTopText(t),i.topY-this.renderOptions.annotationSpacing*(t+1))}return e.getYForTopText(t)}getYForBottomText(t){const e=this.checkStave();if(this.hasStem()){const i=this.getStemExtents();if(!i)throw new C("InvalidState","Stem does not have extents.");return Math.max(e.getYForTopText(t),i.baseY+this.renderOptions.annotationSpacing*t)}return e.getYForBottomText(t)}hasFlag(){return void 0!==this.glyphProps.codeFlagUp&&!this.beam&&!this.isRest()}postFormat(){var t;return null===(t=this.beam)||void 0===t||t.postFormat(),this.postFormatted=!0,this}drawStem(t){var e;this.checkContext(),this.setRendered(),this.setStem(new ot(t)),null===(e=this.stem)||void 0===e||e.setContext(this.getContext()).drawWithStyle()}}function Ut(t,e,i){const s=i>0?e.maxLine+.5-t.minLine:t.maxLine+.5-e.minLine,n=i*Math.max(1,Math.ceil(s));t.line+=n,t.maxLine+=n,t.minLine+=n,t.note.setKeyLine(0,t.note.getKeyLine(0)+n)}class Vt extends Gt{static get CATEGORY(){return l.StaveNote}static get LEDGER_LINE_OFFSET(){return 3}static get minNoteheadPadding(){return O.get("NoteHead.minPadding")}static format(t,e){if(!t||t.length<2)return!1;const i=[];for(let e=0;e<t.length;e++){const s=t[e].sortedKeyProps,n=s[0].keyProps.line;let a=s[s.length-1].keyProps.line;const o=t[e].getStemDirection(),r=t[e].getStemLength()/10,h=t[e].getStemMinimumLength()/10;let c;t[e].isRest()?(c=n+Math.ceil(t[e]._noteHeads[0].getTextMetrics().actualBoundingBoxAscent/st.STAVE_LINE_DISTANCE),a=n-Math.ceil(t[e]._noteHeads[0].getTextMetrics().actualBoundingBoxDescent/st.STAVE_LINE_DISTANCE)):(c=1===o?s[s.length-1].keyProps.line+r:s[s.length-1].keyProps.line,a=1===o?s[0].keyProps.line:s[0].keyProps.line-r),i.push({line:s[0].keyProps.line,maxLine:c,minLine:a,isrest:t[e].isRest(),stemDirection:o,stemMax:r,stemMin:h,voiceShift:t[e].getVoiceShiftWidth(),isDisplaced:t[e].isDisplaced(),note:t[e]})}let s,n,a,o=0;const r=[!1,!1,!1];for(let t=0;t<i.length;t++)r[t]=!1!==i[t].note.renderOptions.draw;if(r[0]&&r[1]&&r[2])o=3,s=i[0],n=i[1],a=i[2];else if(r[0]&&r[1])o=2,s=i[0],a=i[1];else if(r[0]&&r[2])o=2,s=i[0],a=i[2];else{if(!r[1]||!r[2])return!0;o=2,s=i[1],a=i[2]}2===o&&-1===s.stemDirection&&1===a.stemDirection&&(s=i[1],a=i[0]);const h=Math.max(s.voiceShift,a.voiceShift);let c=0;if(2===o){const t=s.note.hasStem()&&a.note.hasStem()&&s.stemDirection===a.stemDirection?0:.5;if(a.isrest&&s.isrest&&s.note.duration===a.note.duration)a.note.renderOptions.draw=!1;else if(s.minLine<=a.maxLine+t)if(s.isrest)Ut(s,a,1);else if(a.isrest)Ut(a,s,-1);else{const t=Math.abs(s.line-a.line);if(s.note.hasStem()&&a.note.hasStem()){const e=s.note.sortedKeyProps[0].keyProps.code,i=a.note.sortedKeyProps[a.note.sortedKeyProps.length-1].keyProps.code;!st.UNISON||e!==i||s.note.getModifiers().filter(t=>t.getCategory()===l.Dot&&0===t.getIndex()).length!==a.note.getModifiers().filter(t=>t.getCategory()===l.Dot&&0===t.getIndex()).length||t<1&&t>0||JSON.stringify(s.note.getStyle())!==JSON.stringify(a.note.getStyle())?(c=h+2,s.stemDirection===a.stemDirection?s.note.setXShift(c):a.note.setXShift(c)):s.note.voice!==a.note.voice&&s.stemDirection===a.stemDirection&&(s.line!==a.line?(c=h+2,s.note.setXShift(c)):1===a.stemDirection&&(a.stemDirection=-1,a.note.setStemDirection(-1)))}else t<1?(c=h+2,s.note.duration<a.note.duration?s.note.setXShift(c):a.note.setXShift(c)):s.note.hasStem()?(s.stemDirection=-s.note.getStemDirection(),s.note.setStemDirection(s.stemDirection)):a.note.hasStem()&&(a.stemDirection=-a.note.getStemDirection(),a.note.setStemDirection(a.stemDirection))}return e.rightShift+=c,!0}if(!n)throw new C("InvalidState","noteM not defined.");if(n.isrest&&!s.isrest&&!a.isrest&&(s.minLine<=n.maxLine||n.minLine<=a.maxLine)){return n.maxLine-n.minLine<s.minLine-a.maxLine?function(t,e,i){const s=t.line-D(e.minLine,i.maxLine);t.note.setKeyLine(0,t.note.getKeyLine(0)-s),t.line-=s,t.maxLine-=s,t.minLine-=s}(n,s,a):(c=h+2,n.note.setXShift(c),!1===a.note.hasBeam()&&(a.stemDirection=-1,a.note.setStemDirection(-1)),s.minLine<=a.maxLine&&!1===s.note.hasBeam()&&(s.stemDirection=1,s.note.setStemDirection(1))),e.rightShift+=c,!0}return s.isrest&&n.isrest&&a.isrest?(s.note.renderOptions.draw=!1,a.note.renderOptions.draw=!1,e.rightShift+=c,!0):(n.isrest&&s.isrest&&n.minLine<=a.maxLine&&(n.note.renderOptions.draw=!1),n.isrest&&a.isrest&&s.minLine<=n.maxLine&&(n.note.renderOptions.draw=!1),s.isrest&&s.minLine<=n.maxLine&&Ut(s,n,1),a.isrest&&n.minLine<=a.maxLine&&Ut(a,n,-1),(s.minLine<=n.maxLine+.5||n.minLine<=a.maxLine)&&(c=h+2,n.note.setXShift(c),!1===a.note.hasBeam()&&(a.stemDirection=-1,a.note.setStemDirection(-1)),s.minLine<=a.maxLine&&!1===s.note.hasBeam()&&(s.stemDirection=1,s.note.setStemDirection(1))),e.rightShift+=c,!0)}static postFormat(t){return!!t&&(t.forEach(t=>t.postFormat()),!0)}constructor(t){var e,i,s;super(t),this.minLine=0,this.maxLine=0,this.sortedKeyProps=[],this.ledgerLineStyle={},this.clef=null!==(e=t.clef)&&void 0!==e?e:"treble",this.octaveShift=null!==(i=t.octaveShift)&&void 0!==i?i:0,this.glyphProps=yt.getGlyphProps(this.duration,this.noteType),v(this.glyphProps,"BadArguments",`No glyph found for duration '${this.duration}' and type '${this.noteType}'`),this.displaced=!1,this.dotShiftY=0,this.useDefaultHeadX=!1,this._noteHeads=[],this.modifiers=[],this.renderOptions=Object.assign(Object.assign({},this.renderOptions),{strokePx:t.strokePx||Vt.LEDGER_LINE_OFFSET}),this.calculateKeyProps(),this.buildStem(),t.autoStem?this.autoStem():this.setStemDirection(null!==(s=t.stemDirection)&&void 0!==s?s:ot.UP)}reset(){super.reset();const t=this._noteHeads.map(t=>t.getStyle());this.buildNoteHeads(),this._noteHeads.forEach((e,i)=>{const s=t[i];s&&e.setStyle(s)});const e=this.stave;return e&&this.setStave(e),this.calcNoteDisplacements(),this}setBeam(t){return this.beam=t,this.calcNoteDisplacements(),this.stem&&this.stem.setExtension(this.getStemExtension()),this}buildStem(){return this.setStem(new ot({hide:this.isRest()})),this}buildNoteHeads(){const t=new Set(this._noteHeads);this.children=this.children.filter(e=>!t.has(e)),this._noteHeads=[];const e=this.getStemDirection(),i=this.getKeys();let s,n,a,o,r,h=!1;e===ot.UP?(a=0,o=i.length,r=1):(a=i.length-1,o=-1,r=-1);for(let t=a;t!==o;t+=r){const i=this.sortedKeyProps[t].keyProps,a=i.line;void 0===s?s=a:(n=Math.abs(s-a),0===n||.5===n?h=!h:(h=!1,this.useDefaultHeadX=!0)),s=a;const o=new Ht({duration:this.duration,noteType:this.noteType,displaced:h,stemDirection:e,customGlyphCode:i.code,line:i.line});o.fontInfo=this.fontInfo,this.addChild(o),this._noteHeads[this.sortedKeyProps[t].index]=o}return this._noteHeads}autoStem(){this.setStemDirection(this.calculateOptimalStemDirection())}calculateOptimalStemDirection(){this.minLine=this.sortedKeyProps[0].keyProps.line,this.maxLine=this.sortedKeyProps[this.keyProps.length-1].keyProps.line;return(this.minLine+this.maxLine)/2<3?ot.UP:ot.DOWN}calculateKeyProps(){var t;let e;for(let i=0;i<this.keys.length;++i){const s=this.keys[i],n={octaveShift:null!==(t=this.octaveShift)&&void 0!==t?t:0,duration:this.duration},a=st.keyProperties(s,this.clef,this.noteType,n);if(!a)throw new C("BadArguments",`Invalid key for note properties: ${s}`);"R"===a.key&&("1"===this.duration||"w"===this.duration?a.line=4:a.line=3);const o=a.line;void 0===e?e=o:Math.abs(e-o)<1&&(this.displaced=!0,a.displaced=!0,this.keyProps.length>0&&(this.keyProps[i-1].displaced=!0)),e=o,this.keyProps.push(a)}this.keyProps.forEach((t,e)=>{this.sortedKeyProps.push({keyProps:t,index:e})}),this.sortedKeyProps.sort((t,e)=>t.keyProps.line-e.keyProps.line)}getBoundingBox(){const t=new P(this.getAbsoluteX(),this.ys[0],0,0);this._noteHeads.forEach(e=>{const i=e.isDisplaced()?(e.getWidth()-ot.WIDTH/2)*this.getStemDirection():0,s=e.getBoundingBox();s.setX(this.getNoteHeadBeginX()+i+e.getXShift()),t.mergeWith(s)});const{yTop:e,yBottom:i}=this.getNoteHeadBounds();if(!this.isRest()&&this.hasStem()){const s=this.stem.getHeight(),n=this.getStemDirection()===ot.DOWN?e-s-this.flag.getTextMetrics().actualBoundingBoxDescent:i-s+this.flag.getTextMetrics().actualBoundingBoxAscent;t.mergeWith(new P(this.getAbsoluteX(),n,0,0))}if(this.shouldDrawFlag()){const{x:e,y:i}=this.getFlagPosition(),s=this.flag.getBoundingBox();s.setX(e+this.flag.getXShift()),s.setY(i+this.flag.getYShift()-this.flag.getTextMetrics().actualBoundingBoxAscent),t.mergeWith(s)}for(let e=0;e<this.modifiers.length;e++)t.mergeWith(this.modifiers[e].getBoundingBox());return t}getLineNumber(t){if(!this.keyProps.length)throw new C("NoKeyProps","Can't get bottom note line, because note is not initialized properly.");let e=this.keyProps[0].line;for(let i=0;i<this.keyProps.length;i++){const s=this.keyProps[i].line;t?s>e&&(e=s):s<e&&(e=s)}return e}isRest(){const t=this.glyphProps.codeHead;return t>=""&&t<=""}isChord(){return!this.isRest()&&this.keys.length>1}hasStem(){return this.glyphProps.stem}hasFlag(){return super.hasFlag()&&!this.isRest()}getStemX(){return"r"===this.noteType?this.getCenterGlyphX():super.getStemX()+(this.stemDirection?ot.WIDTH/(2*-this.stemDirection):0)}getYForTopText(t){const e=this.getStemExtents();return Math.min(this.checkStave().getYForTopText(t),e.topY-this.renderOptions.annotationSpacing*(t+1))}getYForBottomText(t){const e=this.getStemExtents();return Math.max(this.checkStave().getYForTopText(t),e.baseY+this.renderOptions.annotationSpacing*t)}setStave(t){super.setStave(t);const e=this._noteHeads.map(e=>(e.setStave(t),e.getY()));if(this.setYs(e),this.stem){const{yTop:t,yBottom:e}=this.getStemYBounds();this.stem.setYBounds(t,e)}return this}isDisplaced(){return this.displaced}setNoteDisplaced(t){return this.displaced=t,this}getTieRightX(){let t=this.getAbsoluteX();return t+=this.getGlyphWidth()+this.xShift+this.rightDisplacedHeadPx,this.modifierContext&&(t+=this.modifierContext.getRightShiftForTie()),t}getTieLeftX(){let t=this.getAbsoluteX();return t+=this.xShift-this.leftDisplacedHeadPx,t}getLineForRest(){let t=this.keyProps[0].line;if(this.keyProps.length>1){const e=this.keyProps[this.keyProps.length-1].line;t=D(Math.max(t,e),Math.min(t,e))}return t}getModifierStartXY(t,e,i={}){if(!this.preFormatted)throw new C("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(0===this.ys.length)throw new C("NoYValues","No Y-Values calculated for this note.");const{ABOVE:s,BELOW:n,LEFT:a,RIGHT:o}=z.Position;let r=0;t===a?r=-2:t===o?(r=this.getGlyphWidth()+this.xShift+2,this.stemDirection===ot.UP&&this.hasFlag()&&(i.forceFlagRight||((t,e)=>e===(t.getStemDirection()===ot.UP?t.keyProps.length-1:0))(this,e))&&(r+=this.flag.getWidth())):t!==n&&t!==s||(r=this.getGlyphWidth()/2);let h=0;switch(this._noteHeads[e].getText()){case _.restWhole:h+=.5;break;case _.restHalf:case _.restQuarter:case _.rest8th:case _.rest16th:h-=.5;break;case _.rest32nd:case _.rest64th:h-=1.5;break;case _.rest128th:case _.rest256th:h-=2.5;break;case _.rest512th:h-=3.5;break;case _.rest1024th:h-=4.5}return{x:this.getAbsoluteX()+r,y:this.ys[e]+h*this.checkStave().getSpacingBetweenLines()}}setStyle(t){return super.setGroupStyle(t)}setStemStyle(t){const e=this.getStem();return e&&e.setStyle(t),this}getStemStyle(){var t;return null===(t=this.stem)||void 0===t?void 0:t.getStyle()}setLedgerLineStyle(t){this.ledgerLineStyle=t}getLedgerLineStyle(){return this.ledgerLineStyle}setFlagStyle(t){this.flag.setStyle(t)}getFlagStyle(){return this.flag.getStyle()}getGlyphWidth(){return this.noteHeads[0].getWidth()}setKeyStyle(t,e){return this._noteHeads[t].setStyle(e),this}setKeyLine(t,e){return this.keyProps[t].line=e,this.reset(),this}getKeyLine(t){return this.keyProps[t].line}getVoiceShiftWidth(){return this.getGlyphWidth()*(this.displaced?2:1)}calcNoteDisplacements(){this.setLeftDisplacedHeadPx(this.displaced&&this.stemDirection===ot.DOWN?this.getGlyphWidth():0),this.setRightDisplacedHeadPx(!this.hasFlag()&&this.displaced&&this.stemDirection===ot.UP?this.getGlyphWidth():0)}preFormat(){if(this.preFormatted)return;let t=0;this.modifierContext&&(this.modifierContext.preFormat(),0===this.modifierContext.getWidth()&&(t=Vt.minNoteheadPadding));let e=this.getGlyphWidth()+this.leftDisplacedHeadPx+this.rightDisplacedHeadPx+t;this.shouldDrawFlag()&&this.stemDirection===ot.UP&&(e+=this.getGlyphWidth()),this.setWidth(e),this.preFormatted=!0}getStemYBounds(){const t=this.stemDirection===ot.UP?"up":"down";let e=1/0,i=-1/0;if(this._noteHeads.forEach(s=>{const n=st.noteHeadStemYOffsets[s.text],a=n?n[t]:0,o=s.getY()-a*st.STAVE_LINE_DISTANCE;e=Math.min(o,e),i=Math.max(o,i)}),!isFinite(e)||!isFinite(i)){const t=this.getNoteHeadBounds();return{yTop:t.yTop,yBottom:t.yBottom}}return{yTop:e,yBottom:i}}getNoteHeadBounds(){let t,e,i,s,n=1/0,a=-1/0,o=this.checkStave().getNumLines(),r=1,h=o,c=r;return this._noteHeads.forEach(l=>{const d=l.getLine(),u=l.getY();n=Math.min(u,n),a=Math.max(u,a),void 0===e&&l.isDisplaced()&&(e=l.getAbsoluteX()),void 0!==t||l.isDisplaced()||(t=l.getAbsoluteX()),o=Math.max(d,o),r=Math.min(d,r),l.isDisplaced()?(i=void 0===i?d:Math.max(d,i),s=void 0===s?d:Math.min(d,s)):(h=Math.max(d,h),c=Math.min(d,c))},this),{yTop:n,yBottom:a,displacedX:e,nonDisplacedX:t,highestLine:o,lowestLine:r,highestDisplacedLine:i,lowestDisplacedLine:s,highestNonDisplacedLine:h,lowestNonDisplacedLine:c}}getNoteHeadBeginX(){return this.getAbsoluteX()+this.xShift}getNoteHeadEndX(){return this.getNoteHeadBeginX()+this.getGlyphWidth()}get noteHeads(){return this._noteHeads.slice()}drawLedgerLines(){const t=this.checkStave(),{renderOptions:{strokePx:e}}=this,i=this.checkContext(),s=this.getGlyphWidth()+2*e,n=2*(this.getGlyphWidth()+e)-ot.WIDTH/2;if(this.isRest())return;if(!i)throw new C("NoCanvasContext","Can't draw without a canvas context.");const{highestLine:a,lowestLine:o,highestDisplacedLine:r,highestNonDisplacedLine:h,lowestDisplacedLine:c,lowestNonDisplacedLine:l,displacedX:d,nonDisplacedX:u}=this.getNoteHeadBounds();if(a<6&&o>0)return;const g=Math.min(null!=d?d:0,null!=u?u:0),p=(t,a,o)=>{let r;r=o&&a?g-e:a?(null!=u?u:0)-e:(null!=d?d:0)-e;const h=a&&o?n:s;i.beginPath(),i.moveTo(r,t),i.lineTo(r+h,t),i.stroke()},m=Object.assign(Object.assign({},t.getDefaultLedgerLineStyle()),this.getLedgerLineStyle());i.save(),this.applyStyle(i,m);for(let e=6;e<=a;++e){const i=void 0!==u&&e<=h,s=void 0!==r&&e<=r;p(t.getYForNote(e),i,s)}for(let e=0;e>=o;--e){const i=void 0!==u&&e>=l,s=void 0!==c&&e>=c;p(t.getYForNote(e),i,s)}i.restore()}drawModifiers(t){const e=this.checkContext();for(let i=0;i<this.modifiers.length;i++){const s=this.modifiers[i],n=s.checkIndex();this._noteHeads[n]===t&&(s.setContext(e),s.drawWithStyle())}}shouldDrawFlag(){const t=void 0!==this.stem,e=void 0!==this.glyphProps.codeFlagUp,i=void 0===this.beam;return t&&e&&i&&!this.isRest()}getFlagPosition(){const{yTop:t,yBottom:e}=this.getNoteHeadBounds(),i=this.checkStem().getHeight();return{x:this.getStemX()-st.STEM_WIDTH/2,y:this.getStemDirection()===ot.DOWN?t-i-this.flag.getTextMetrics().actualBoundingBoxDescent:e-i+this.flag.getTextMetrics().actualBoundingBoxAscent}}drawFlag(){const t=this.checkContext();if(!t)throw new C("NoCanvasContext","Can't draw without a canvas context.");if(this.shouldDrawFlag()){const{x:e,y:i}=this.getFlagPosition();this.flag.setContext(t).setX(e).setY(i).drawWithStyle()}}drawNoteHeads(){const t=this.checkContext();this._noteHeads.forEach(e=>{e.setContext(t).drawWithStyle()})}drawStem(t){const e=this.checkContext();t&&this.setStem(new ot(t)),this.shouldDrawFlag()&&this.stem&&this.stem.adjustHeightForFlag(),this.stem&&this.stem.setContext(e).drawWithStyle()}getStemExtension(){const t=super.getStemExtension();if(!this.glyphProps.stem)return t;const e=this.getStemDirection();if(e!==this.calculateOptimalStemDirection())return t;let i;i=e===ot.UP?3-this.maxLine:this.minLine-3;const s=i-3.5;if(s<=0)return t;const n=this.getStave();let a=10;return void 0!==n&&(a=n.getSpacingBetweenLines()),t+s*a}draw(){if(!1===this.renderOptions.draw)return;if(0===this.ys.length)throw new C("NoYValues","Can't draw note without Y values.");const t=this.checkContext(),e=this.getNoteHeadBeginX(),i=this.hasStem()&&!this.beam;if(this._noteHeads.forEach(t=>t.setX(e)),this.stem){const t=this.getStemX();this.stem.setNoteHeadXBounds(t,t)}!function(...t){Vt.DEBUG&&B("VexFlow.StaveNote",t)}("Rendering ",this.isChord()?"chord :":"note :",this.keys);const s=this.getAttribute("class");t.openGroup("stavenote"+(s?" "+s:""),this.getAttribute("id")),this.drawLedgerLines(),i&&this.drawStem(),this.drawNoteHeads(),this.drawFlag(),this.drawPointerRect(),t.closeGroup(),this.setRendered()}}Vt.DEBUG=!1;class Xt extends X{static get CATEGORY(){return l.StaveTie}constructor(t,e=""){super(),this.setNotes(t),this.text=e,this.renderOptions={cp1:8,cp2:12,shortTieCutoff:10,cp1Short:2,cp2Short:8,textShiftX:0,firstXShift:0,lastXShift:0,yShift:7,tieSpacing:0}}getDirection(){return void 0!==this.direction&&null!==this.direction?this.direction:this.notes.lastNote?this.notes.lastNote.getStemDirection():this.notes.firstNote?this.notes.firstNote.getStemDirection():0}setDirection(t){return this.direction=t,this}setNotes(t){if(!t.firstNote&&!t.lastNote)throw new C("BadArguments","Tie needs to have either firstNote or lastNote set.");if(t.firstIndexes||(t.firstIndexes=[0]),t.lastIndexes||(t.lastIndexes=[0]),t.firstIndexes.length!==t.lastIndexes.length)throw new C("BadArguments","Tied notes must have same number of indexes.");return this.notes=t,this}isPartial(){return!this.notes.firstNote||!this.notes.lastNote}renderTie(t){if(0===t.firstYs.length||0===t.lastYs.length)throw new C("BadArguments","No Y-values to render");const e=this.checkContext();let i=this.renderOptions.cp1,s=this.renderOptions.cp2;Math.abs(t.lastX-t.firstX)<this.renderOptions.shortTieCutoff&&(i=this.renderOptions.cp1Short,s=this.renderOptions.cp2Short);const n=this.renderOptions.firstXShift,a=this.renderOptions.lastXShift,o=this.renderOptions.yShift*t.direction,r=this.notes.firstIndexes,h=this.notes.lastIndexes,c=this.getAttribute("class");e.openGroup("stavetie"+(c?" "+c:""),this.getAttribute("id"));for(let c=0;c<r.length;++c){const l=(t.lastX+a+(t.firstX+n))/2,d=t.firstYs[r[c]]+o,u=t.lastYs[h[c]]+o;if(isNaN(d)||isNaN(u))throw new C("BadArguments","Bad indexes for tie rendering.");const g=(d+u)/2+i*t.direction,p=(d+u)/2+s*t.direction;e.beginPath(),e.moveTo(t.firstX+n,d),e.quadraticCurveTo(l,g,t.lastX+a,u),e.quadraticCurveTo(l,p,t.firstX+n,d),e.closePath(),e.fill()}this.drawPointerRect(),e.closeGroup()}renderTieText(t,e){var i,s,n;const a=this.checkContext();let o=(t+e)/2;o-=a.measureText(this.text).width/2;const r=null!==(s=null===(i=this.notes.firstNote)||void 0===i?void 0:i.checkStave())&&void 0!==s?s:null===(n=this.notes.lastNote)||void 0===n?void 0:n.checkStave();r&&(a.setFont(this.fontInfo),a.fillText(this.text,o+this.renderOptions.textShiftX,r.getYForTopText()-1))}getNotes(){return this.notes}getFirstX(){return this.notes.firstNote?this.notes.firstNote.getTieRightX()+this.renderOptions.tieSpacing:this.notes.lastNote?this.notes.lastNote.checkStave().getTieStartX():0}getLastX(){return this.notes.lastNote?this.notes.lastNote.getTieLeftX()+this.renderOptions.tieSpacing:this.notes.firstNote?this.notes.firstNote.checkStave().getTieEndX():0}getFirstYs(){return this.notes.firstNote?this.notes.firstNote.getYs():this.notes.lastNote?this.notes.lastNote.getYs():[0]}getLastYs(){return this.notes.lastNote?this.notes.lastNote.getYs():this.notes.firstNote?this.notes.firstNote.getYs():[0]}synchronizeIndexes(){this.notes.firstNote&&this.notes.lastNote||(this.notes.firstNote||this.notes.lastNote)&&(this.notes.firstNote?this.notes.lastIndexes=this.notes.firstIndexes:this.notes.firstIndexes=this.notes.lastIndexes)}draw(){this.checkContext(),this.setRendered(),this.synchronizeIndexes();const t=this.getFirstX(),e=this.getLastX();return this.renderTie({firstX:t,lastX:e,firstYs:this.getFirstYs(),lastYs:this.getLastYs(),direction:this.getDirection()}),this.renderTieText(t,e),!0}}class Yt extends Xt{static get CATEGORY(){return l.TabTie}static createHammeron(t){return new Yt(t,"H")}static createPulloff(t){return new Yt(t,"P")}constructor(t,e){super(t,e),this.renderOptions.cp1=9,this.renderOptions.cp2=11,this.renderOptions.yShift=3,this.direction=-1}}var _t;!function(t){t[t.STRICT=1]="STRICT",t[t.SOFT=2]="SOFT",t[t.FULL=3]="FULL"}(_t||(_t={}));class zt extends X{static get CATEGORY(){return l.Voice}static get Mode(){return _t}constructor(t){let e;if(super(),this.resolutionMultiplier=1,this.mode=_t.STRICT,this.preFormatted=!1,this.ticksDirty=!1,this.ticksUsed=new F(0,1),this.largestTickWidth=0,this.tickables=[],this.options={softmaxFactor:st.SOFTMAX_FACTOR},"string"==typeof t){const i=t.length<=64?/^(\d+)\/(\d+)$/.exec(t):null;if(!i)throw new C("BadArgument","Invalid time signature. Expected positive integers such as 4/4.");e={numBeats:Number(i[1]),beatValue:Number(i[2])}}else e=t;this.time=Object.assign({numBeats:4,beatValue:4,resolution:st.RESOLUTION},e);const{numBeats:i,beatValue:s,resolution:n}=this.time;if(![i,s,n].every(t=>Number.isSafeInteger(t)&&t>0))throw new C("BadArgument","Meter and resolution must be positive safe integers.");const a=i*(n/s);if(!Number.isFinite(a)||a<=0||a>Number.MAX_SAFE_INTEGER)throw new C("BadArgument","Meter exceeds the supported tick range.");this.totalTicks=new F(a,1),this.smallestTickCount=this.totalTicks.clone()}getTotalTicks(){return this.refreshTicks(),this.totalTicks}getTicksUsed(){return this.refreshTicks(),this.ticksUsed}getLargestTickWidth(){return this.largestTickWidth}getSmallestTickCount(){return this.refreshTicks(),this.smallestTickCount}getTickables(){return this.tickables}getMode(){return this.mode}setMode(t){return this.mode=t,this}getResolutionMultiplier(){return this.refreshTicks(),this.resolutionMultiplier}getActualResolution(){return this.getResolutionMultiplier()*this.time.resolution}setStave(t){return this.stave=t,this}getStave(){return this.stave}getBoundingBox(){const t=this.tickables[0].getBoundingBox();for(let e=1;e<this.tickables.length;++e){const i=this.tickables[e];!i.getStave()&&this.stave&&i.setStave(this.stave);const s=i.getBoundingBox();t.mergeWith(s)}return t}setStrict(t){return this.mode=t?_t.STRICT:_t.SOFT,this}isComplete(){return this.refreshTicks(),this.mode!==_t.STRICT&&this.mode!==_t.FULL||this.ticksUsed.equals(this.totalTicks)}setSoftmaxFactor(t){return this.options.softmaxFactor=t,this.expTicksUsed=0,this}reCalculateExpTicksUsed(){const t=this.ticksUsed.value();return this.expTicksUsed=N(this.tickables.map(e=>Math.pow(this.options.softmaxFactor,e.getTicks().value()/t))),this.expTicksUsed}softmax(t){this.refreshTicks(),this.expTicksUsed||(this.expTicksUsed=this.reCalculateExpTicksUsed());const e=this.ticksUsed.value();return(t=>Math.pow(this.options.softmaxFactor,t/e))(t)/this.expTicksUsed}invalidateTicks(){this.ticksDirty=!0,this.expTicksUsed=void 0}refreshTicks(){if(this.ticksDirty){this.ticksUsed.set(0,1),this.totalTicks.set(this.time.numBeats*(this.time.resolution/this.time.beatValue),1),this.smallestTickCount=this.totalTicks.clone();for(const t of this.tickables){if(t.shouldIgnoreTicks())continue;const e=t.getTicks();this.ticksUsed.add(e),e.lessThan(this.smallestTickCount)&&(this.smallestTickCount=e.clone())}this.resolutionMultiplier=this.ticksUsed.denominator,this.totalTicks.add(0,this.resolutionMultiplier),this.ticksDirty=!1}}addTickable(t){if(this.refreshTicks(),!t.shouldIgnoreTicks()){const e=t.getTicks();if(this.ticksUsed.add(e),this.expTicksUsed=0,(this.mode===_t.STRICT||this.mode===_t.FULL)&&this.ticksUsed.greaterThan(this.totalTicks))throw this.ticksUsed.subtract(e),new C("BadArgument","Too many ticks.");e.lessThan(this.smallestTickCount)&&(this.smallestTickCount=e.clone()),this.resolutionMultiplier=this.ticksUsed.denominator,this.totalTicks.add(0,this.ticksUsed.denominator)}return this.tickables.push(t),t.setVoice(this),this}addTickables(t){for(let e=0;e<t.length;++e)this.addTickable(t[e]);return this}preFormat(){if(this.preFormatted)return this;const t=this.checkStave();return this.tickables.forEach(e=>{e.getStave()||e.setStave(t)}),this.preFormatted=!0,this}checkStave(){return v(this.stave,"NoStave","No stave attached to instance.")}draw(t=this.checkContext(),e){e=null!=e?e:this.stave,this.setRendered();for(let i=0;i<this.tickables.length;++i){const s=this.tickables[i];e&&s.setStave(e),v(s.getStave(),"MissingStave","The voice cannot draw tickables without staves."),s.setContext(t),s.drawWithStyle()}}}class jt extends z{static get CATEGORY(){return l.GraceNoteGroup}static format(t,e){if(!t||0===t.length)return!1;const i=[];let s=null,n=0;for(let e=0;e<t.length;++e){const a=t[e],o=a.getNote(),h=r(o),c=h?4:0;if(h&&o!==s){for(let t=0;t<o.keys.length;++t)n=Math.max(o.getLeftDisplacedHeadPx(),n);s=o}i.push({shift:n,gracenoteGroup:a,spacing:c})}let a,o=i[0].shift,h=!1,c=!1;for(let t=0;t<i.length;++t){const e=i[t].gracenoteGroup;e.position===z.Position.RIGHT?h=!0:c=!0,e.preFormat(),a=e.getWidth()+i[t].spacing,o=Math.max(a,o)}for(let t=0;t<i.length;++t){const e=i[t].gracenoteGroup;a=e.getWidth()+i[t].spacing,e.setSpacingFromNextModifier(o-Math.min(a,o)+Vt.minNoteheadPadding)}return h&&(e.rightShift+=o),c&&(e.leftShift+=o),!0}constructor(t,e){return super(),this.preFormatted=!1,this.position=z.Position.LEFT,this.graceNotes=t,this.width=0,this.showSlur=e,this.slur=void 0,this.voice=new zt({numBeats:4,beatValue:4,resolution:st.RESOLUTION}).setStrict(!1),this.renderOptions={slurYShift:0},this.beams=[],this.voice.addTickables(this.graceNotes),this}preFormat(){this.preFormatted||(this.formatter||(this.formatter=new Fe),this.formatter.joinVoices([this.voice]).format([this.voice],0,{}),this.setWidth(this.formatter.getMinTotalWidth()),this.preFormatted=!0)}beamNotes(t){if((t=t||this.graceNotes).length>1){const e=new Ie(t);e.renderOptions.beamWidth=3,e.renderOptions.partialBeamLength=4,this.beams.push(e)}return this}setWidth(t){return this.width=t,this}getWidth(){return this.width+Vt.minNoteheadPadding}getGraceNotes(){return this.graceNotes}positionGraceNotes(){const t=this.checkAttachedNote();t.checkStave(),this.preFormat(),this.alignSubNotesWithNote(this.getGraceNotes(),t,this.position),this.beams.forEach(t=>t.postFormat())}getBoundingBox(){if(0===this.graceNotes.length)return super.getBoundingBox();this.positionGraceNotes();const t=this.graceNotes[0].getBoundingBox();for(let e=1;e<this.graceNotes.length;e++)t.mergeWith(this.graceNotes[e].getBoundingBox());return t}draw(){const t=this.checkContext(),e=this.checkAttachedNote();if(this.setRendered(),function(...t){jt.DEBUG&&B("VexFlow.GraceNoteGroup",t)}("Drawing grace note group for:",e),this.positionGraceNotes(),this.graceNotes.forEach(e=>e.setContext(t).drawWithStyle()),this.beams.forEach(e=>e.setContext(t).drawWithStyle()),this.showSlur){const i=r(e),s=i?Xt:Yt;this.slur=new s({lastNote:this.graceNotes[0],firstNote:e,firstIndexes:[0],lastIndexes:[0]}),this.slur.renderOptions.cp2=12,this.slur.renderOptions.yShift=(i?7:5)+this.renderOptions.slurYShift,this.slur.setContext(t).drawWithStyle()}}}jt.DEBUG=!1;class qt extends z{static get CATEGORY(){return l.NoteSubGroup}static format(t,e){if(!t||0===t.length)return!1;let i=0;for(let e=0;e<t.length;++e){const s=t[e];s.preFormat(),i+=s.getWidth()}return e.leftShift+=i,!0}constructor(t){super(),this.preFormatted=!1,this.position=z.Position.LEFT,this.subNotes=t,this.subNotes.forEach(t=>{t.setIgnoreTicks(!1)}),this.width=0,this.formatter=new Fe,this.voice=new zt({numBeats:4,beatValue:4,resolution:st.RESOLUTION}).setStrict(!1),this.voice.addTickables(this.subNotes)}preFormat(){this.preFormatted||(this.formatter.joinVoices([this.voice]).format([this.voice],0),this.setWidth(this.formatter.getMinTotalWidth()),this.preFormatted=!0)}setWidth(t){return this.width=t,this}getWidth(){return this.width}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered(),this.alignSubNotesWithNote(this.subNotes,e),this.subNotes.forEach(e=>e.setContext(t).drawWithStyle())}}class Kt extends z{static get CATEGORY(){return l.Ornament}static get minPadding(){return O.get("NoteHead.minPadding")}static format(t,e){var i,s;if(!t||0===t.length)return!1;let n=0,a=e.rightShift,o=e.leftShift;for(let r=0;r<t.length;++r){const h=t[r],c=2;if(h.position===Y.RIGHT)h.xShift+=a+2,a+=h.width+Kt.minPadding;else if(h.position===Y.LEFT)h.xShift-=o+h.width+2,o+=h.width+Kt.minPadding;else if(h.position===Y.ABOVE){n=Math.max(h.getWidth(),n);const t=h.getNote();let a=t.getLineNumber(!0)+e.topTextLine;const o=t.getStem();o&&t.getStemDirection()===ot.UP&&(a+=Math.abs(o.getHeight())/st.STAVE_LINE_DISTANCE);const r=null!==(s=null===(i=t.getStave())||void 0===i?void 0:i.getNumLines())&&void 0!==s?s:0;a<r&&(e.topTextLine+=r-a),h.setTextLine(e.topTextLine),e.topTextLine+=c}else n=Math.max(h.getWidth(),n),h.setTextLine(e.textLine),e.textLine+=c}return e.leftShift=o+n/2,e.rightShift=a+n/2,!0}static get ornamentNoteTransition(){return["flip","jazzTurn","smear"]}static get ornamentAttack(){return["scoop"]}static get ornamentAlignWithNoteHead(){return["doit","fall","fallLong","doitLong","scoop"]}static get ornamentRelease(){return["doit","fall","fallLong","doitLong","jazzTurn","smear","flip"]}static get ornamentLeft(){return["scoop"]}static get ornamentRight(){return["doit","fall","fallLong","doitLong"]}static get ornamentYShift(){return["fallLong"]}static get ornamentArticulation(){return["bend","plungerClosed","plungerOpen"]}constructor(t){super(),this.position=Y.ABOVE,Kt.ornamentRight.indexOf(t)>=0&&(this.position=Y.RIGHT),Kt.ornamentLeft.indexOf(t)>=0&&(this.position=Y.LEFT),this.type=t,this.delayed=!1,this.renderOptions={accidentalLowerPadding:3,accidentalUpperPadding:3},this.adjustForStemDirection=!1,this.ornamentAlignWithNoteHead=Kt.ornamentAlignWithNoteHead.indexOf(this.type)>=0,Kt.ornamentNoteTransition.indexOf(this.type)>=0&&(this.delayed=!0),this.text=st.ornamentCodes(this.type)}setNote(t){return super.setNote(t),Kt.ornamentArticulation.indexOf(this.type)>=0&&(t.getLineNumber()>=3?this.position=z.Position.ABOVE:this.position=z.Position.BELOW),this}setDelayed(t){return this.delayed=t,this}setUpperAccidental(t){return this.accidentalUpper=new X,this.accidentalUpper.setText(st.accidentalCodes(t)),this}setLowerAccidental(t){return this.accidentalLower=new X,this.accidentalLower.setText(st.accidentalCodes(t)),this}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=e.checkStave(),s=this.getAttribute("class");t.openGroup("ornament"+(s?" "+s:""),this.getAttribute("id"));const n=e.getModifierStartXY(this.position,this.index);let a=n.x;const o=i.getSpacingBetweenLines(),r=Tt(e,this.position);let h=this.ornamentAlignWithNoteHead?n.y:0;if(this.position===Y.ABOVE&&(h=ft(e,this.textLine)-(this.textLine+r)*o),this.position===Y.BELOW&&(h=St(e,this.textLine)+(this.textLine+r+1.5)*o),this.delayed){let t=0;const s=e.getTickContext().getX();if(void 0!==this.delayXShift)t=this.delayXShift;else{const n=e.getVoice().getTickables(),o=n.indexOf(e),r=o+1<n.length?n[o+1].checkTickContext():void 0;t+=r?.5*(r.getX()-s):.5*(i.getX()+i.getWidth()-a),this.delayXShift=t}a+=t}!function(...t){Kt.DEBUG&&B("VexFlow.Ornament",t)}("Rendering ornament: ",this.text.charCodeAt(0),a,h),this.accidentalLower&&(this.accidentalLower.renderText(t,a+this.xShift-.5*this.accidentalLower.getWidth(),h+this.yShift-this.accidentalLower.getTextMetrics().actualBoundingBoxDescent),h-=this.accidentalLower.getHeight()+this.renderOptions.accidentalLowerPadding),Kt.ornamentYShift.indexOf(this.type)>=0&&(this.yShift+=this.getHeight()),this.x=a-(this.position===Y.ABOVE||this.position===Y.BELOW?.5*this.width:0),this.y=h,this.renderText(t,0,0),this.accidentalUpper&&(h-=this.getHeight()+this.renderOptions.accidentalUpperPadding,this.accidentalUpper.renderText(t,a+this.xShift-.5*this.accidentalUpper.getWidth(),h+this.yShift-this.accidentalUpper.getTextMetrics().actualBoundingBoxDescent)),this.drawPointerRect(),t.closeGroup()}}Kt.DEBUG=!1;class $t extends z{static get CATEGORY(){return l.Parenthesis}static buildAndAttach(t){for(const e of t)for(let t=0;t<e.keys.length;t++)e.addModifier(new $t(Y.LEFT),t),e.addModifier(new $t(Y.RIGHT),t)}static format(t,e){if(!t||0===t.length)return!1;let i=0,s=0;for(let e=0;e<t.length;++e){const n=t[e],a=n.getNote(),o=n.getPosition(),r=n.checkIndex();let h=0;o===Y.RIGHT&&(h=a.getRightParenthesisPx(r),s=s>h+n.width?s:h+n.width),o===Y.LEFT&&(h=a.getLeftParenthesisPx(r)+n.width,i=i>h+n.width?i:h+n.width),n.setXShift(h)}return e.leftShift+=i,e.rightShift+=s,!0}constructor(t){super(),this.position=null!=t?t:z.Position.LEFT,this.position===z.Position.RIGHT?this.text="":this.position===z.Position.LEFT&&(this.text="")}setNote(t){return this.note=t,this.setFont(t.getFont()),this}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=e.getModifierStartXY(this.position,this.index,{forceFlagRight:!0});this.renderText(t,i.x,i.y)}}function Qt(t){if(!t)return!1;const e=k();return"function"==typeof e.HTMLCanvasElement&&t instanceof e.HTMLCanvasElement||"function"==typeof t.getContext&&"function"==typeof t.toDataURL}class Jt extends wt{static get WIDTH(){return 600}static get HEIGHT(){return 400}static get CANVAS_BROWSER_SIZE_LIMIT(){return 32767}static sanitizeCanvasDims(t,e){const i=this.CANVAS_BROWSER_SIZE_LIMIT;return Math.max(t,e)>i&&(!function(...t){const e=t.join(" "),i=new Error;k().console.log("Warning: ",e,i.stack)}("Canvas dimensions exceed browser limit. Cropping to "+i),t>i&&(t=i),e>i&&(e=i)),[t,e]}constructor(t){super(),this.textHeight=0,this.context2D=t,this.curTransfrom=t.getTransform(),t.canvas?this.canvas=t.canvas:this.canvas={width:Jt.WIDTH,height:Jt.HEIGHT}}clear(){this.context2D.clearRect(0,0,this.canvas.width,this.canvas.height)}openGroup(t,e){}closeGroup(){}openRotation(t,e,i){this.curTransfrom=this.context2D.getTransform(),this.context2D.translate(e,i),this.context2D.rotate(t*Math.PI/180),this.context2D.translate(-e,-i)}closeRotation(){this.context2D.setTransform(this.curTransfrom)}add(t){}setFillStyle(t){return this.context2D.fillStyle=t,this}setBackgroundFillStyle(t){return this}setStrokeStyle(t){return this.context2D.strokeStyle=t,this}setShadowColor(t){return this.context2D.shadowColor=t,this}setShadowBlur(t){const e=this.context2D.getTransform(),i=Math.sqrt(e.a*e.a+e.b*e.b+e.c*e.c+e.d*e.d);return this.context2D.shadowBlur=i*t,this}setLineWidth(t){return this.context2D.lineWidth=t,this}setLineCap(t){return this.context2D.lineCap=t,this}setLineDash(t){return this.context2D.setLineDash(t),this}scale(t,e){return this.context2D.scale(t,e),this}resize(t,e,i){var s;const n=this.context2D.canvas,a=null!==(s=null!=i?i:k().devicePixelRatio)&&void 0!==s?s:1;return[t,e]=Jt.sanitizeCanvasDims(t*a,e*a),t=t/a|0,e=e/a|0,n.width=t*a,n.height=e*a,Qt(n)&&(n.style.width=t+"px",n.style.height=e+"px"),this.scale(a,a)}rect(t,e,i,s){return this.context2D.rect(t,e,i,s),this}fillRect(t,e,i,s){return this.context2D.fillRect(t,e,i,s),this}pointerRect(t,e,i,s){return this}clearRect(t,e,i,s){return this.context2D.clearRect(t,e,i,s),this}beginPath(){return this.context2D.beginPath(),this}moveTo(t,e){return this.context2D.moveTo(t,e),this}lineTo(t,e){return this.context2D.lineTo(t,e),this}bezierCurveTo(t,e,i,s,n,a){return this.context2D.bezierCurveTo(t,e,i,s,n,a),this}quadraticCurveTo(t,e,i,s){return this.context2D.quadraticCurveTo(t,e,i,s),this}arc(t,e,i,s,n,a){return this.context2D.arc(t,e,i,s,n,a),this}fill(){return this.context2D.fill(),this}stroke(){return this.context2D.stroke(),this}closePath(){return this.context2D.closePath(),this}measureText(t){const e=this.context2D.measureText(t);let i=0,s=0;return e.fontBoundingBoxAscent?(i=-e.fontBoundingBoxAscent,s=e.fontBoundingBoxDescent+e.fontBoundingBoxAscent):(i=-e.actualBoundingBoxAscent,s=e.actualBoundingBoxDescent+e.actualBoundingBoxAscent),{x:0,y:i,width:e.width,height:s}}fillText(t,e,i){return this.context2D.fillText(t,e,i),this}save(){return this.context2D.save(),this}restore(){return this.context2D.restore(),this}set fillStyle(t){this.context2D.fillStyle=t}get fillStyle(){return this.context2D.fillStyle}set strokeStyle(t){this.context2D.strokeStyle=t}get strokeStyle(){return this.context2D.strokeStyle}setFont(t,e,i,s){const n=G.validate(t,e,i,s);return this.context2D.font=G.toCSSString(n),this.textHeight=G.convertSizeToPixelValue(n.size),this}getFont(){return this.context2D.font}}function Zt(t="normal"){return"normal"===t?"400":"bold"===t?"700":String(t)}function te(t,e){let i=t;for(;i;){const t=i.getAttribute(e);if(null!==t)return t;i=i.parentElement}return null}function ee(t,e){var i,s,n,a,o,r,h,c;const l=(null!==(i=te(t,"font-family"))&&void 0!==i?i:"").split(",").map(t=>t.trim().replace(/^['"]|['"]$/g,"").toLowerCase()),d=Zt(null!==(s=te(t,"font-weight"))&&void 0!==s?s:"normal"),u=null!==(n=te(t,"font-style"))&&void 0!==n?n:"normal",g=l.map(t=>e.find(e=>{var i;return e.family.toLowerCase()===t&&Zt(e.weight)===d&&(null!==(i=e.style)&&void 0!==i?i:"normal")===u})),p=G.convertSizeToPixelValue(null!==(a=te(t,"font-size"))&&void 0!==a?a:"10pt");let m=Number(null!==(o=t.getAttribute("x"))&&void 0!==o?o:0);const f=Number(null!==(r=t.getAttribute("y"))&&void 0!==r?r:0);let S,T="",x="";function w(){S&&x&&(T+=S.getPath(x,m,f,p).toPathData(5),m+=S.getAdvanceWidth(x,p),x="")}for(const e of null!==(h=t.textContent)&&void 0!==h?h:""){const t=null===(c=g.find(t=>t&&t.font.charToGlyphIndex(e)>0))||void 0===c?void 0:c.font;if(!t)throw new C("MissingFont",`No outline for ${JSON.stringify(e)} in ${l.join(", ")} (${d} ${u}).`);t!==S&&(w(),S=t),x+=e}return w(),T}const ie={path:{x:!0,y:!0,width:!0,height:!0,"font-family":!0,"font-weight":!0,"font-style":!0,"font-size":!0},rect:{"font-family":!0,"font-weight":!0,"font-style":!0,"font-size":!0},text:{width:!0,height:!0}},se=2*Math.PI;class ne extends wt{static toSVG(t,e){var i,s;const n=void 0===e?t:function(t,e){const i=t.cloneNode(!0);for(const t of Array.from(i.querySelectorAll("text"))){if(t.children.length)throw new C("BadArgument","Portable export expects plain SVGContext text.");const s=i.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");for(const e of Array.from(t.attributes))"x"===e.name||"y"===e.name||e.name.startsWith("font-")||s.setAttribute(e.name,e.value);s.setAttribute("d",ee(t,e)),t.replaceWith(s)}return i}(t,e);return(new(null!==(s=null===(i=t.ownerDocument.defaultView)||void 0===i?void 0:i.XMLSerializer)&&void 0!==s?s:XMLSerializer)).serializeToString(n)}toSVG(t){return ne.toSVG(this.svg,t)}constructor(t){super(),this.width=0,this.height=0,this.precision=1,this.backgroundFillStyle="white",this.fontCSSString="",this.element=t,this.precision=Math.pow(10,st.RENDER_PRECISION_PLACES);const e=this.create("svg");e.setAttribute("pointer-events","none"),this.element.appendChild(e),this.svg=e,this.parent=this.svg,this.groups=[this.svg],this.path="",this.pen={x:NaN,y:NaN};const i={"font-family":O.get("fontFamily"),"font-size":"10pt","font-weight":M.NORMAL,"font-style":I.NORMAL};this.state=Object.assign({scaleX:1,scaleY:1},i),this.attributes=Object.assign({"stroke-width":1,"stroke-dasharray":"none",fill:"black",stroke:"black",shadowBlur:0,shadowColor:"black"},i),this.groupAttributes=[],this.applyAttributes(e,this.attributes),this.groupAttributes.push(Object.assign({},this.attributes)),this.stateStack=[]}round(t){return Math.round(t*this.precision)/this.precision}create(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}openGroup(t,e){const i=this.create("g");return this.groups.push(i),this.parent.appendChild(i),this.parent=i,t&&i.setAttribute("class",L(t)),e&&i.setAttribute("id",L(e)),this.applyAttributes(i,this.attributes),this.groupAttributes.push(Object.assign(Object.assign({},this.groupAttributes[this.groupAttributes.length-1]),this.attributes)),i}closeGroup(){this.groups.pop(),this.groupAttributes.pop(),this.parent=this.groups[this.groups.length-1]}openRotation(t,e,i){this.openGroup().setAttribute("transform",`translate(${e},${i}) rotate(${t}) translate(-${e},-${i})`)}closeRotation(){this.closeGroup()}add(t){this.parent.appendChild(t)}setFillStyle(t){return this.attributes.fill=t,this}setBackgroundFillStyle(t){return this.backgroundFillStyle=t,this}setStrokeStyle(t){return this.attributes.stroke=t,this}setShadowColor(t){return this.attributes.shadowColor=t,this}setShadowBlur(t){return this.attributes.shadowBlur=t,this}setLineWidth(t){return this.attributes["stroke-width"]=t,this}setLineDash(t){if("[object Array]"===Object.prototype.toString.call(t))return this.attributes["stroke-dasharray"]=t.join(","),this;throw new C("ArgumentError","lineDash must be an array of integers.")}setLineCap(t){return this.attributes["stroke-linecap"]=t,this}resize(t,e){this.width=t,this.height=e,this.element.style.width=`${t}px`,this.svg.style.width=`${t}px`,this.svg.style.height=`${e}px`;const i={width:t,height:e};return this.applyAttributes(this.svg,i),this.scale(this.state.scaleX,this.state.scaleY),this}scale(t,e){this.state.scaleX=this.state.scaleX?this.state.scaleX*t:t,this.state.scaleY=this.state.scaleY?this.state.scaleY*e:e;const i=this.width/this.state.scaleX,s=this.height/this.state.scaleY;return this.setViewBox(0,0,i,s),this}setViewBox(t,e,i,s){if("string"==typeof t)this.svg.setAttribute("viewBox",t);else{const n=t+" "+e+" "+i+" "+s;this.svg.setAttribute("viewBox",n)}}applyAttributes(t,e){const i=ie[t.nodeName];for(const s in e)i&&i[s]||!e[s]||0!==this.groupAttributes.length&&e[s]==this.groupAttributes[this.groupAttributes.length-1][s]||t.setAttributeNS(null,s,e[s]);return t}clear(){for(;this.svg.lastChild;)this.svg.removeChild(this.svg.lastChild)}rect(t,e,i,s,n){s<0&&(e+=s,s*=-1);const a=this.create("rect");return n=null!=n?n:{fill:"none","stroke-width":this.attributes["stroke-width"],stroke:"black"},t=this.round(t),e=this.round(e),i=this.round(i),s=this.round(s),this.applyAttributes(a,Object.assign({x:t,y:e,width:i,height:s},n)),this.add(a),this}fillRect(t,e,i,s){const n={fill:this.attributes.fill,stroke:"none"};return this.rect(t,e,i,s,n),this}pointerRect(t,e,i,s){return this.rect(t,e,i,s,{opacity:"0","pointer-events":"auto"}),this}clearRect(t,e,i,s){return this.rect(t,e,i,s,{fill:this.backgroundFillStyle,stroke:"none"}),this}beginPath(){return this.path="",this.pen.x=NaN,this.pen.y=NaN,this}moveTo(t,e){return t=this.round(t),e=this.round(e),this.path+="M"+t+" "+e,this.pen.x=t,this.pen.y=e,this}lineTo(t,e){return t=this.round(t),e=this.round(e),this.path+="L"+t+" "+e,this.pen.x=t,this.pen.y=e,this}bezierCurveTo(t,e,i,s,n,a){return n=this.round(n),a=this.round(a),t=this.round(t),e=this.round(e),i=this.round(i),s=this.round(s),this.path+="C"+t+" "+e+","+i+" "+s+","+n+" "+a,this.pen.x=n,this.pen.y=a,this}quadraticCurveTo(t,e,i,s){return i=this.round(i),s=this.round(s),t=this.round(t),e=this.round(e),this.path+="Q"+t+" "+e+","+i+" "+s,this.pen.x=i,this.pen.y=s,this}arc(t,e,i,s,n,a){let o=t+i*Math.cos(s),r=e+i*Math.sin(s);o=this.round(o),r=this.round(r);const h=E(s),c=E(n);if(!a&&n-s>=se||a&&s-n>=se||h===c){let n=t+i*Math.cos(s+Math.PI),a=e+i*Math.sin(s+Math.PI);n=this.round(n),a=this.round(a),i=this.round(i),this.path+=`M${o} ${r} A${i} ${i} 0 0 0 ${n} ${a} `,this.path+=`A${i} ${i} 0 0 0 ${o} ${r}`,this.pen.x=o,this.pen.y=r}else{let l,d=t+i*Math.cos(n),u=e+i*Math.sin(n);s=h,n=c,l=Math.abs(n-s)<Math.PI?a:!a,s>n&&(l=!l);const g=!a;d=this.round(d),u=this.round(u),i=this.round(i),this.path+=`M${o} ${r} A${i} ${i} 0 ${+l} ${+g} ${d} ${u}`,this.pen.x=d,this.pen.y=u}return this}closePath(){return this.path+="Z",this}getShadowStyle(){return`filter: drop-shadow(0 0 ${this.attributes.shadowBlur/1.5}px ${this.attributes.shadowColor})`}fill(t){const e=this.create("path");return void 0===t&&(t=Object.assign(Object.assign({},this.attributes),{stroke:"none"})),t.d=this.path,this.attributes.shadowBlur>0&&(t.style=this.getShadowStyle()),this.applyAttributes(e,t),this.add(e),this}stroke(){const t=this.create("path"),e=Object.assign(Object.assign({},this.attributes),{fill:"none",d:this.path});return this.attributes.shadowBlur>0&&(e.style=this.getShadowStyle()),this.applyAttributes(t,e),this.add(t),this}measureText(t){ne.measureTextElement.setText(t),ne.measureTextElement.setFont(this.attributes["font-family"],this.attributes["font-size"],this.attributes["font-weight"],this.attributes["font-style"]);const e=ne.measureTextElement.getBoundingBox();return{x:e.x,y:e.y,width:e.w,height:e.h}}fillText(t,e,i){if(!t||t.length<=0)return this;e=this.round(e),i=this.round(i);const s=Object.assign(Object.assign({},this.attributes),{stroke:"none",x:e,y:i}),n=this.create("text");return n.textContent=t,this.applyAttributes(n,s),this.add(n),this}save(){return this.stateStack.push({state:y(this.state),attributes:y(this.attributes)}),this}restore(){const t=this.stateStack.pop();if(t){const e=t;this.state=y(e.state),this.attributes=y(e.attributes)}return this}set fillStyle(t){this.setFillStyle(t)}get fillStyle(){return this.attributes.fill}set strokeStyle(t){this.setStrokeStyle(t)}get strokeStyle(){return this.attributes.stroke}setFont(t,e,i,s){const n=G.validate(t,e,i,s);this.fontCSSString=G.toCSSString(n);const a={"font-family":n.family,"font-size":n.size,"font-weight":n.weight,"font-style":n.style};return this.attributes=Object.assign(Object.assign({},this.attributes),a),this.state=Object.assign(Object.assign({},this.state),a),this}getFont(){return this.fontCSSString}}var ae,oe,re,he;ne.measureTextElement=new X,function(t){t[t.CANVAS=1]="CANVAS",t[t.SVG=2]="SVG"}(ae||(ae={})),function(t){t[t.NONE=1]="NONE",t[t.UP=2]="UP",t[t.DOWN=3]="DOWN"}(oe||(oe={}));class ce{static buildContext(t,e,i,s,n="#FFF"){const a=new ce(t,e);i&&s&&a.resize(i,s);const o=a.getContext();return o.setBackgroundFillStyle(n),ce.lastContext=o,o}static getCanvasContext(t,e,i,s){return ce.buildContext(t,ce.Backends.CANVAS,e,i,s)}static getSVGContext(t,e,i,s){return ce.buildContext(t,ce.Backends.SVG,e,i,s)}static drawDashedLine(t,e,i,s,n,a){t.beginPath();const o=s-e,r=n-i,h=Math.atan2(r,o);let c=e,l=i;t.moveTo(e,i);let d=0,u=!0;for(;!(o<0?c<=s:c>=s)||!(r<0?l<=n:l>=n);){const e=a[d++%a.length],i=c+Math.cos(h)*e;c=o<0?Math.max(s,i):Math.min(s,i);const g=l+Math.sin(h)*e;l=r<0?Math.max(n,g):Math.min(n,g),u?t.lineTo(c,l):t.moveTo(c,l),u=!u}t.closePath(),t.stroke()}constructor(t,e){if(i(t,l.RenderContext))this.ctx=t;else{if(void 0===e)throw new C("InvalidArgument","Missing backend argument");const i=e;let s;if("string"==typeof t){const e=document.getElementById(t);if(!e)throw new C("BadElementId",`Can't find element with ID "${e}"`);s=e}else s=t;if(i===ce.Backends.CANVAS){if(!Qt(s))throw new C("BadElement","CANVAS context requires an HTMLCanvasElement.");const t=s.getContext("2d",{willReadFrequently:!0});if(!t)throw new C("BadElement","Can't get canvas context");this.ctx=new Jt(t)}else{if(i!==ce.Backends.SVG)throw new C("InvalidBackend",`No support for backend: ${i}`);if(!function(t){if(!t)return!1;const e=k();return"function"==typeof e.HTMLDivElement&&t instanceof e.HTMLDivElement||"function"==typeof t.appendChild&&"object"==typeof t.style}(s))throw new C("BadElement","SVG context requires an HTMLDivElement.");this.ctx=new ne(s)}}}resize(t,e){return this.ctx.resize(t,e),this}getContext(){return this.ctx}}ce.Backends=ae,ce.LineEndType=oe,ce.lastContext=void 0;class le extends z{static get CATEGORY(){return l.StringNumber}static format(t,e){const i=e.leftShift,s=e.rightShift;if(!t||0===t.length)return!1;const n=[];let a=null,o=0,h=0;for(let i=0;i<t.length;++i){const c=t[i],l=c.getNote(),d=c.getPosition();if(!r(l))throw new C("NoStaveNote");const u=c.checkIndex(),g=l.getKeyProps()[u],p=l.getModifierContext(),m=2*c.radius/st.STAVE_LINE_DISTANCE+.5;if(p&&(d===Y.ABOVE?(c.textLine=p.getState().topTextLine,e.topTextLine+=m):d===Y.BELOW&&(c.textLine=p.getState().textLine,e.textLine+=m)),l!==a){for(let t=0;t<l.keys.length;++t)d===z.Position.LEFT&&(o=Math.max(l.getLeftDisplacedHeadPx(),o)),0===s&&(h=Math.max(l.getRightDisplacedHeadPx(),h));a=l}const f=g.line;n.push({pos:d,note:l,num:c,line:f,shiftL:o,shiftR:h})}n.sort((t,e)=>e.line-t.line);let c=0,l=0,d=0,u=null,g=null;for(let t=0;t<n.length;++t){const e=n[t].note,a=n[t].pos,r=n[t].num,h=n[t].line,p=n[t].shiftR;h===u&&e===g||(c=s+p);const m=r.getWidth()+1;let f=0;a===z.Position.LEFT?(r.setXShift(i+o),f=m,l=Math.max(f,l)):a===z.Position.RIGHT&&(r.setXShift(c),f+=m,d=f>d?f:d),u=h,g=e}return e.leftShift+=l,e.rightShift+=d,!0}constructor(t){super(),this.stringNumber=t,this.position=z.Position.ABOVE,this.xShift=0,this.yShift=0,this.textLine=0,this.stemOffset=0,this.xOffset=0,this.yOffset=0,this.dashed=!0,this.leg=ce.LineEndType.NONE,this.radius=8,this.drawCircle=!0,this.setWidth(2*this.radius+4)}setLineEndType(t){return t>=ce.LineEndType.NONE&&t<=ce.LineEndType.DOWN&&(this.leg=t),this}setStringNumber(t){return this.stringNumber=t,this}setOffsetX(t){return this.xOffset=t,this}setOffsetY(t){return this.yOffset=t,this}setLastNote(t){return this.lastNote=t,this}setDashed(t){return this.dashed=t,this}setDrawCircle(t){return this.drawCircle=t,this}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=e.getModifierStartXY(this.position,this.index),s=e.hasStem()?e.getStemDirection():ot.UP;let n=i.x+this.xShift+this.xOffset,a={};e.hasStem()&&(a=e.checkStem().getExtents());let o=i.y+this.yShift+this.yOffset;switch(this.position){case z.Position.ABOVE:o=e.getYs().reduce((t,e)=>t<e?t:e),e.hasStem()&&s===ot.UP&&(o=a.topY+O.get("StringNumber.stemPadding")),o-=this.radius+O.get("StringNumber.verticalPadding")+this.textLine*st.STAVE_LINE_DISTANCE;break;case z.Position.BELOW:o=e.getYs().reduce((t,e)=>t>e?t:e),e.hasStem()&&s===ot.DOWN&&(o=a.topY-O.get("StringNumber.stemPadding")),o+=this.radius+O.get("StringNumber.verticalPadding")+this.textLine*st.STAVE_LINE_DISTANCE;break;case z.Position.LEFT:n-=this.radius/2+O.get("StringNumber.leftPadding");break;case z.Position.RIGHT:n+=this.radius/2+O.get("StringNumber.rightPadding");break;default:throw new C("InvalidPosition",`The position ${this.position} is invalid`)}this.drawCircle&&(t.beginPath(),t.arc(n,o,this.radius,0,2*Math.PI,!1),t.setLineWidth(1.5),t.stroke()),t.setFont(this.fontInfo);const r=n-t.measureText(this.stringNumber).width/2;t.fillText(""+this.stringNumber,r,o+4.5);const c=this.lastNote;if(h(c)){const i=c.getStemX()-e.getX()+5;let s,a;switch(t.setLineCap("round"),t.setLineWidth(.6),this.dashed?ce.drawDashedLine(t,n+10,o,n+i,o,[3,3]):ce.drawDashedLine(t,n+10,o,n+i,o,[3,0]),this.leg){case ce.LineEndType.UP:s=-10,a=this.dashed?[3,3]:[3,0],ce.drawDashedLine(t,n+i,o,n+i,o+s,a);break;case ce.LineEndType.DOWN:s=10,a=this.dashed?[3,3]:[3,0],ce.drawDashedLine(t,n+i,o,n+i,o+s,a)}}}}class de extends z{static get CATEGORY(){return l.Stroke}static format(t,e){const i=e.leftShift;if(!t||0===t.length)return!1;const s=t.map(t=>{const e=t.getNote(),i=t.checkIndex();if(r(e)){const{line:s}=e.getKeyProps()[i];return{line:s,shift:e.getLeftDisplacedHeadPx(),stroke:t}}if(c(e)){const{str:s}=e.getPositions()[i];return{line:s,shift:0,stroke:t}}throw new C("Internal","Unexpected instance.")}),n=i,a=s.reduce((t,{stroke:e,shift:i})=>(e.setXShift(n+i),Math.max(e.getWidth()+5,t)),0);return e.leftShift+=a,!0}constructor(t,e){super(),this.boundingBox=new P(0,0,0,0),this.options=Object.assign({allVoices:!0},e),this.allVoices=this.options.allVoices,this.type=t,this.position=z.Position.LEFT,this.renderOptions={fontScale:O.get("Stroke.fontSize")},this.setXShift(0),this.setWidth(10)}getPosition(){return this.position}addEndNote(t){return this.noteEnd=t,this}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=e.getModifierStartXY(this.position,this.index);let s=e.getYs(),n=i.y,a=i.y;const r=i.x-5,h=e.checkStave().getSpacingBetweenLines(),c=this.checkModifierContext().getMembers(e.getCategory());for(let t=0;t<c.length;t++){const e=c[t];if(o(e)){s=e.getYs();for(let e=0;e<s.length;e++)(this.note===c[t]||this.allVoices)&&(n=Math.min(n,s[e]),a=Math.max(a,s[e]))}}let l="",d=0,u=0;switch(this.type){case de.Type.BRUSH_DOWN:case de.Type.ROLL_DOWN:case de.Type.RASGUEADO_DOWN:l=_.arrowheadBlackUp,d=n,n-=h/2,a+=h/2;break;case de.Type.BRUSH_UP:case de.Type.ROLL_UP:case de.Type.RASGUEADO_UP:l=_.arrowheadBlackDown,d=a+h,n-=h/2;break;case de.Type.ARPEGGIO_DIRECTIONLESS:n-=h/2,a+=h/2;break;default:throw new C("InvalidType",`The stroke type ${this.type} does not exist`)}if(this.type===de.Type.BRUSH_DOWN||this.type===de.Type.BRUSH_UP)t.fillRect(r+this.xShift,n,1,a-n),this.boundingBox=new P(r+this.xShift,n,1,a-n);else{const e=l===_.arrowheadBlackDown?_.wiggleArpeggiatoDown:_.wiggleArpeggiatoUp;let i="";const s=new X;for(;s.getWidth()<a-n;)i+=e,s.setText(i);this.type===de.Type.RASGUEADO_DOWN||this.type===de.Type.ROLL_DOWN||this.type===de.Type.ARPEGGIO_DIRECTIONLESS?(t.openRotation(90,r+this.xShift,n),s.renderText(t,r+this.xShift,n-s.getTextMetrics().actualBoundingBoxDescent+s.getHeight()/2),t.closeRotation(),u=n+s.getWidth()+5,this.boundingBox=new P(r+this.xShift-s.getHeight()/2,n-s.getTextMetrics().actualBoundingBoxDescent+s.getHeight()/2,s.getHeight(),s.getWidth())):(t.openRotation(-90,r+this.xShift,a),s.renderText(t,r+this.xShift,a-s.getTextMetrics().actualBoundingBoxDescent+s.getHeight()/2),t.closeRotation(),u=a-s.getWidth()-5,this.boundingBox=new P(r+this.xShift-s.getHeight()/2,a-s.getTextMetrics().actualBoundingBoxDescent+s.getHeight()/2-s.getWidth(),s.getHeight(),s.getWidth()))}if(0!==d){const e=new X;e.setText(l),e.renderText(t,r+this.xShift-e.getWidth()/2,d),this.boundingBox.mergeWith(new P(r+this.xShift-e.getWidth()/2,d-e.getHeight(),e.getWidth(),e.getHeight()))}if(this.type===de.Type.RASGUEADO_DOWN||this.type===de.Type.RASGUEADO_UP){const e=new X("Stroke.text");e.setText("R"),e.renderText(t,r+this.xShift-e.getWidth()/2,u+(this.type===de.Type.RASGUEADO_DOWN?e.getHeight():0)),this.boundingBox.mergeWith(new P(r+this.xShift-e.getWidth()/2,u+(this.type===de.Type.RASGUEADO_DOWN?e.getHeight():0)-e.getHeight(),e.getWidth(),e.getHeight()))}}getBoundingBox(){return this.boundingBox}}de.Type={BRUSH_DOWN:1,BRUSH_UP:2,ROLL_DOWN:3,ROLL_UP:4,RASGUEADO_DOWN:5,RASGUEADO_UP:6,ARPEGGIO_DIRECTIONLESS:7};class ue extends z{static get CATEGORY(){return l.Vibrato}static format(t,e,i){if(!t||0===t.length)return!1;let s=e.topTextLine,n=0,a=e.rightShift-7;const o=i.getMembers(At.CATEGORY);if(o&&o.length>0){s-=o.map(t=>t.getTextHeight()).reduce((t,e)=>t>e?t:e)/st.STAVE_LINE_DISTANCE+1}else e.topTextLine+=1;for(let e=0;e<t.length;++e){const i=t[e];i.setXShift(a),i.setTextLine(s),n+=i.getWidth(),a+=n}return e.rightShift+=n,!0}constructor(){super(),this.position=z.Position.RIGHT,this.renderOptions={code:60080,width:20},this.setVibratoWidth(this.renderOptions.width)}setVibratoWidth(t){this.renderOptions.width=t,this.text=String.fromCodePoint(this.renderOptions.code);const e=this.getWidth();if(!e)throw new C("Cannot set vibrato width if width is 0");const i=Math.round(this.renderOptions.width/e);for(let t=1;t<i;t++)this.text+=String.fromCodePoint(this.renderOptions.code);return this}setVibratoCode(t){return this.renderOptions.code=t,this.setVibratoWidth(this.renderOptions.width)}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=e.getModifierStartXY(z.Position.RIGHT,this.index).x,s=e.getYForTopText(this.textLine)+5;this.renderText(t,i,s)}}function ge(...t){pe.DEBUG&&B("VexFlow.ModifierContext",t)}class pe{constructor(){this.state={leftShift:0,rightShift:0,textLine:0,topTextLine:0},this.members={},this.preFormatted=!1,this.postFormatted=!1,this.formatted=!1,this.width=0,this.spacing=0,this.annotationRightShift=0}addModifier(t){return ge("addModifier is deprecated, use addMember instead."),this.addMember(t)}addMember(t){const e=t.getCategory();return this.members[e]||(this.members[e]=[]),this.members[e].push(t),t.setModifierContext(this),this.preFormatted=!1,this}getModifiers(t){return ge("getModifiers is deprecated, use getMembers instead."),this.getMembers(t)}getMembers(t){var e;return null!==(e=this.members[t])&&void 0!==e?e:[]}getWidth(){return this.width}getLeftShift(){return this.state.leftShift}getRightShift(){return this.state.rightShift}getRightShiftForTie(){return this.state.rightShift-this.annotationRightShift}getState(){return this.state}getMetrics(){if(!this.formatted)throw new C("UnformattedMember","Unformatted member has no metrics.");return{width:this.state.leftShift+this.state.rightShift+this.spacing,spacing:this.spacing}}preFormat(){var t;if(this.preFormatted)return;ge("Preformatting ModifierContext");const e=this.state,i=this.members;Vt.format(i[l.StaveNote],e),$t.format(i[l.Parenthesis],e),Mt.format(i[l.Dot],e),It.format(i[l.FretHandFinger],e),at.format(i[l.Accidental],e),de.format(i[l.Stroke],e),jt.format(i[l.GraceNoteGroup],e),qt.format(i[l.NoteSubGroup],e),le.format(i[l.StringNumber],e),xt.format(i[l.Articulation],e),Kt.format(i[l.Ornament],e);const s=null!==(t=i[l.Annotation])&&void 0!==t?t:[],n=t=>t.getVerticalJustification()===ct.VerticalJustify.TOP||t.getVerticalJustification()===ct.VerticalJustify.BOTTOM;ct.format(s.filter(t=>!n(t)),e);const a=e.rightShift;ct.format(s.filter(n),e);const o=e.rightShift;e.rightShift=a,Pt.format(i[l.ChordSymbol],e),At.format(i[l.Bend],e),ue.format(i[l.Vibrato],e,this),this.annotationRightShift=Math.max(0,o-e.rightShift),e.rightShift+=this.annotationRightShift,this.width=e.leftShift+e.rightShift,this.preFormatted=!0}postFormat(){this.postFormatted||(ge("Postformatting ModifierContext"),Vt.postFormat(this.getMembers(l.StaveNote)))}}pe.DEBUG=!1;class me extends Et{static get CATEGORY(){return l.Clef}static get types(){const{gClef:t,fClef:e,cClef:i,unpitchedPercussionClef1:s,sixStringTabClef:n}=_;return{treble:{code:t,line:3},bass:{code:e,line:1},alto:{code:i,line:2},tenor:{code:i,line:1},percussion:{code:s,line:2},soprano:{code:i,line:4},"mezzo-soprano":{code:i,line:3},"baritone-c":{code:i,line:0},"baritone-f":{code:e,line:2},subbass:{code:e,line:0},french:{code:t,line:4},tab:{code:n,line:2.5}}}constructor(t,e,i){super(),this.code=me.types.treble.code,this.line=me.types.treble.line,this.size="default",this.type="treble",this.setPosition(Ct.BEGIN),this.setType(t,e,i),function(...t){me.DEBUG&&B("VexFlow.Clef",t)}("Creating clef:",t)}setType(t,e="default",i){return this.type=t,this.code=me.types[t].code,this.line=me.types[t].line,this.size=null!=e?e:"default","8va"===i&&(this.code===_.gClef&&(this.code=_.gClef8va),this.code===_.fClef&&(this.code=_.fClef8va)),"8vb"===i&&(this.code===_.gClef&&(this.code=_.gClef8vb),this.code===_.fClef&&(this.code=_.fClef8vb)),this.text=this.code,this.fontInfo.size=Math.floor(me.getPoint(this.size)),this}static getPoint(t){return"default"===t?O.get("fontSize"):2*O.get("fontSize")/3}setStave(t){return this.stave=t,this}draw(){const t=this.checkStave(),e=t.checkContext();this.setRendered();const i=this.getAttribute("class");e.openGroup("clef"+(i?" "+i:""),this.getAttribute("id")),this.y=t.getYForLine(this.line),this.renderText(e,0,0),this.drawPointerRect(),e.closeGroup()}}me.DEBUG=!1;class fe extends Et{static get CATEGORY(){return l.KeySignature}constructor(t,e,i){super(),this.accList=[],this.setKeySig(t,e,i),this.setPosition(Ct.BEGIN),this.children=[],this.paddingForced=!1}convertToGlyph(t,e,i){const s=st.accidentalCodes(t.type),n=new X(l.KeySignature);n.setText(s);let a=1;if(n.setYShift(i.getYForLine(t.line)),this.children.length>0){const t=this.children[this.children.length-1],e=t=>t.getText()===_.accidentalNatural,i=(t,e)=>Math.abs(e.getYShift()-t.getYShift());(e(t)||e(n))&&i(t,n)<10&&(a=2),n.setXShift(t.getXShift()+t.getWidth()+a)}this.children.push(n),this.width+=n.getWidth()+a}cancelKey(t){return this.formatted=!1,this.cancelKeySpec=t,this}convertToCancelAccList(t){const e=st.keySignature(t),i=this.accList.length>0&&e.length>0&&e[0].type!==this.accList[0].type,s=i?e.length:e.length-this.accList.length;if(s<1)return;const n=[];for(let t=0;t<s;t++){let a=t;i||(a=e.length-s+t);const o=e[a];n.push({type:"n",line:o.line})}return this.accList=n.concat(this.accList),{accList:n,type:e[0].type}}addToStave(t){return this.paddingForced=!0,t.addModifier(this),this}setStave(t){return this.formatted=!1,super.setStave(t)}getBoundingBox(){return this.formatted||this.format(),super.getBoundingBox()}calculateDimensions(){let t;t=this.children.length>0?this.children[0].getBoundingBox():new P(this.x+this.xShift,this.y+this.yShift,0,0),this.children.forEach(e=>{t.mergeWith(e.getBoundingBox())}),this.width=t.getW(),this.height=t.getH(),this.y=t.getY()}convertAccLines(t,e,i=this.accList){let s,n,a=0;switch(t){case"soprano":"#"===e?s=[2.5,.5,2,0,1.5,-.5,1]:a=-1;break;case"mezzo-soprano":"b"===e?s=[0,2,.5,2.5,1,3,1.5]:a=1.5;break;case"alto":a=.5;break;case"tenor":"#"===e?s=[3,1,2.5,.5,2,0,1.5]:a=-.5;break;case"baritone-f":case"baritone-c":"b"===e?s=[.5,2.5,1,3,1.5,3.5,2]:a=2;break;case"bass":case"french":a=1}if(void 0!==s)for(n=0;n<i.length;++n)i[n].line=s[n];else if(0!==a)for(n=0;n<i.length;++n)i[n].line+=a}getPadding(t){return this.formatted||this.format(),0===this.children.length||!this.paddingForced&&t<2?0:this.padding}getWidth(){return this.formatted||this.format(),this.width}setKeySig(t,e,i){return this.formatted=!1,this.keySpec=t,this.cancelKeySpec=e,this.alterKeySpec=i,this}alterKey(t){return this.formatted=!1,this.alterKeySpec=t,this}convertToAlterAccList(t){const e=Math.min(t.length,this.accList.length);for(let i=0;i<e;++i)t[i]&&(this.accList[i].type=t[i])}format(){let t=this.getStave();t||(t=new Be(0,0,100),this.setStave(t)),this.width=0,this.children=[],this.accList=st.keySignature(v(this.keySpec));const e=this.accList,i=e.length>0?e[0].type:void 0;let s;if(this.cancelKeySpec&&(s=this.convertToCancelAccList(this.cancelKeySpec)),this.alterKeySpec&&this.convertToAlterAccList(this.alterKeySpec),this.accList.length>0){const n=(this.position===Ct.END?t.getEndClef():t.getClef())||t.getClef();s&&this.convertAccLines(n,s.type,s.accList),this.convertAccLines(n,i,e);for(let e=0;e<this.accList.length;++e)this.convertToGlyph(this.accList[e],this.accList[e+1],t)}this.calculateDimensions(),this.formatted=!0}draw(){const t=this.checkStave().checkContext();this.formatted||this.format(),this.setRendered();const e=this.getAttribute("class");t.openGroup("keysignature"+(e?" "+e:""),this.getAttribute("id"));for(let e=0;e<this.children.length;e++){this.children[e].renderText(t,this.x,0)}this.drawPointerRect(),t.closeGroup()}}class Se extends Et{static get CATEGORY(){return l.Repetition}constructor(t,e,i){super(),this.symbolType=t,this.x=e,this.xShift=0,this.yShift=i}setShiftX(t){return this.xShift=t,this}setShiftY(t){return this.yShift=t,this}draw(){const t=this.checkStave(),e=t.getModifierXShift(this.getPosition());switch(this.setRendered(),this.symbolType){case Se.type.CODA_RIGHT:this.drawCodaFixed(t,e+t.getWidth());break;case Se.type.CODA_LEFT:this.drawSymbolText(t,e,"Coda",!0);break;case Se.type.SEGNO_LEFT:this.drawSegnoFixed(t,e);break;case Se.type.SEGNO_RIGHT:this.drawSegnoFixed(t,e+t.getWidth());break;case Se.type.DC:this.drawSymbolText(t,e,"D.C.",!1);break;case Se.type.DC_AL_CODA:this.drawSymbolText(t,e,"D.C. al",!0);break;case Se.type.DC_AL_FINE:this.drawSymbolText(t,e,"D.C. al Fine",!1);break;case Se.type.DS:this.drawSymbolText(t,e,"D.S.",!1);break;case Se.type.DS_AL_CODA:this.drawSymbolText(t,e,"D.S. al",!0);break;case Se.type.DS_AL_FINE:this.drawSymbolText(t,e,"D.S. al Fine",!1);break;case Se.type.FINE:this.drawSymbolText(t,e,"Fine",!1);break;case Se.type.TO_CODA:this.drawSymbolText(t,e,"To",!0)}}drawCodaFixed(t,e){const i=t.getYForTopText(t.getNumLines());return this.text=_.coda,this.renderText(t.checkContext(),e,i+O.get("Repetition.coda.offsetY")),this}drawSegnoFixed(t,e){const i=t.getYForTopText(t.getNumLines());return this.text=_.segno,this.renderText(t.checkContext(),e,i+O.get("Repetition.segno.offsetY")),this}drawSymbolText(t,e,i,s){const n=t.checkContext();let a=0;switch(this.text=i,s&&(this.text+=" "),this.setFont(O.getFontInfo("Repetition.text")),this.symbolType){case Se.type.CODA_LEFT:a=t.getVerticalBarWidth();break;case Se.type.DC:case Se.type.DC_AL_FINE:case Se.type.DS:case Se.type.DS_AL_FINE:case Se.type.FINE:default:a=e-(t.getNoteStartX()-this.x)+t.getWidth()-this.width-O.get("Repetition.text.offsetX")}const o=t.getYForTopText(t.getNumLines())+O.get("Repetition.text.offsetY");return this.renderText(n,a,o),this}}Se.type={NONE:1,CODA_LEFT:2,CODA_RIGHT:3,SEGNO_LEFT:4,SEGNO_RIGHT:5,DC:6,DC_AL_CODA:7,DC_AL_FINE:8,DS:9,DS_AL_CODA:10,DS_AL_FINE:11,FINE:12,TO_CODA:13};class Te extends Et{static get CATEGORY(){return l.StaveSection}constructor(t,e=0,i=0,s=!0){super(),this.setText(t),this.x=e,this.yShift=i,this.drawRect=s,this.padding=O.get("StaveSection.padding")}setDrawRect(t){return this.drawRect=t,this}draw(){const t=this.checkStave(),e=t.checkContext();this.setRendered(),this.x=t.getX()+t.getModifierXShift(this.getPosition());const i=-1*this.textMetrics.actualBoundingBoxDescent,s=this.width+2*this.padding,n=this.height+2*this.padding,a=t.getYForTopText(1.5)+this.yShift,o=this.x+this.xShift;this.drawRect&&(e.beginPath(),e.rect(o,a-n+i,s,n),e.stroke()),this.renderText(e,this.xShift+this.padding,a-this.padding)}}class xe extends Et{static get CATEGORY(){return l.StaveTempo}constructor(t,e,i){super(),this.durationToCode={"1/4":_.metNoteDoubleWholeSquare,long:_.metNoteDoubleWholeSquare,"1/2":_.metNoteDoubleWhole,breve:_.metNoteDoubleWhole,1:_.metNoteWhole,whole:_.metNoteWhole,w:_.metNoteWhole,2:_.metNoteHalfUp,half:_.metNoteHalfUp,h:_.metNoteHalfUp,4:_.metNoteQuarterUp,quarter:_.metNoteQuarterUp,q:_.metNoteQuarterUp,8:_.metNote8thUp,eighth:_.metNote8thUp,16:_.metNote16thUp,"16th":_.metNote16thUp,32:_.metNote32ndUp,"32nd":_.metNote32ndUp,64:_.metNote64thUp,"64th":_.metNote64thUp,128:_.metNote128thUp,"128th":_.metNote128thUp,256:_.metNote256thUp,"256th":_.metNote256thUp,512:_.metNote512thUp,"512th":_.metNote512thUp,1024:_.metNote1024thUp,"1024th":_.metNote1024thUp},this.tempo=t,this.position=Ct.ABOVE,this.x=e,this.setXShift(10),this.setYShift(i)}setTempo(t){return this.tempo=t,this}draw(){const t=this.checkStave(),e=t.getModifierXShift(this.getPosition()),i=t.checkContext();this.setRendered();const{name:s,duration:n,dots:a,bpm:o,duration2:r,dots2:h,parenthesis:c}=this.tempo;let l=this.x+e;const d=t.getYForTopText(1),u=new X("StaveTempo.glyph"),g=new X("StaveTempo");if(s&&(this.text=s,this.fontInfo=O.getFontInfo("StaveTempo.name"),this.renderText(i,e,d),l+=this.getWidth()+3),(s&&n||c)&&(g.setText("("),g.renderText(i,l+this.xShift,d+this.yShift),l+=g.getWidth()+3),n){if(u.setText(this.durationToCode[n]),u.renderText(i,l+this.xShift,d+this.yShift),l+=u.getWidth()+3,a){u.setText(_.metAugmentationDot);for(let t=0;t<a;t++)u.renderText(i,l+this.xShift,d+2+this.yShift),l+=u.getWidth()+3}if(g.setText("="),g.renderText(i,l+this.xShift,d+this.yShift),l+=g.getWidth()+3,r){if(u.setText(this.durationToCode[r]),u.renderText(i,l+this.xShift,d+this.yShift),l+=u.getWidth()+3,h){u.setText(_.metAugmentationDot);for(let t=0;t<h;t++)u.renderText(i,l+this.xShift,d+2+this.yShift),l+=u.getWidth()+3}}else o&&(g.setText(""+o),g.renderText(i,l+this.xShift,d+this.yShift),l+=g.getWidth()+3);(s||c)&&(g.setText(")"),g.renderText(i,l+this.xShift,d+this.yShift))}}}!function(t){t[t.LEFT=1]="LEFT",t[t.CENTER=2]="CENTER",t[t.RIGHT=3]="RIGHT"}(re||(re={}));class we extends yt{static get CATEGORY(){return l.TextNote}static get GLYPHS(){return{segno:_.segno,tr:_.ornamentTrill,mordent:_.ornamentMordent,mordentUpper:_.ornamentShortTrill,mordentLower:_.ornamentMordent,f:_.dynamicForte,p:_.dynamicPiano,m:_.dynamicMezzo,s:_.dynamicSforzando,z:_.dynamicZ,coda:_.coda,pedalOpen:_.keyboardPedalPed,pedalClose:_.keyboardPedalUp,caesuraStraight:_.caesura,caesuraCurved:_.caesuraCurved,breath:_.breathMarkComma,tick:_.breathMarkTick,turn:_.ornamentTurn,turnInverted:_.ornamentTurnSlash}}constructor(t){var e,i;super(t),this.text=null!==(e=t.text)&&void 0!==e?e:"",t.glyph&&(this.text+=we.GLYPHS[t.glyph]||t.glyph),t.font?this.setFont(t.font):void 0===t.glyph&&this.setFont(O.getFontInfo("TextNote.text"));const s=.769231*G.convertSizeToPointValue(this.fontInfo.size);t.superscript&&(this.superscript=new X("TextNote.text"),this.superscript.setText(t.superscript),this.superscript.setFontSize(s)),t.subscript&&(this.subscript=new X("TextNote.text"),this.subscript.setText(t.subscript),this.subscript.setFontSize(s)),this.line=null!==(i=t.line)&&void 0!==i?i:0,this.smooth=t.smooth||!1,this.ignoreTicks=t.ignoreTicks||!1,this.justification=re.LEFT}setJustification(t){return this.justification=t,this}setLine(t){return this.line=t,this}getLine(){return this.line}preFormat(){if(this.preFormatted)return;const t=this.checkTickContext("Can't preformat without a TickContext.");this.justification===re.CENTER?this.leftDisplacedHeadPx=this.width/2:this.justification===re.RIGHT&&(this.leftDisplacedHeadPx=this.width),this.rightDisplacedHeadPx=t.getMetrics().glyphPx/2,this.preFormatted=!0}draw(){const t=this.checkContext(),e=this.checkStave(),i=this.checkTickContext("Can't draw without a TickContext.");this.setRendered();let s=this.getAbsoluteX()+i.getMetrics().glyphPx/2;const n=this.getWidth();this.justification===re.CENTER?s-=n/2:this.justification===re.RIGHT&&(s-=n);const a=e.getYForLine(this.line+-3);this.renderText(t,s,a);const o=this.getHeight();this.superscript&&this.superscript.renderText(t,s+this.width+2,a-o/2.2),this.subscript&&this.subscript.renderText(t,s+this.width+2,a+o/2.2-1)}}we.Justification=re;class be extends Et{static get CATEGORY(){return l.StaveText}constructor(t,e,i={}){var s,n,a;super(),this.setText(t),this.setXShift(null!==(s=i.shiftX)&&void 0!==s?s:0),this.setYShift(null!==(n=i.shiftY)&&void 0!==n?n:0),this.position=e,this.justification=null!==(a=i.justification)&&void 0!==a?a:we.Justification.CENTER}draw(){const t=this.checkStave(),e=t.checkContext();let i,s;switch(this.setRendered(),this.position){case Ct.LEFT:case Ct.RIGHT:s=(t.getYForLine(0)+t.getBottomLineY())/2,i=this.position===Ct.LEFT?t.getX()-this.width-24:t.getX()+t.getWidth()+24;break;case Ct.ABOVE:case Ct.BELOW:i=t.getX(),this.justification===re.CENTER?i+=t.getWidth()/2-this.width/2:this.justification===re.RIGHT&&(i+=t.getWidth()-this.width),s=this.position===Ct.ABOVE?t.getYForTopText(2):t.getYForBottomText(2);break;default:throw new C("InvalidPosition","Value Must be in Modifier.Position.")}this.renderText(e,i,s+4)}}!function(t){t[t.NONE=1]="NONE",t[t.BEGIN=2]="BEGIN",t[t.MID=3]="MID",t[t.END=4]="END",t[t.BEGIN_END=5]="BEGIN_END"}(he||(he={}));class ye extends Et{static get CATEGORY(){return l.Volta}static get type(){return he}constructor(t,e,i,s){super(),this.type=t,this.x=i,this.yShift=s,this.text=e}draw(){const t=this.checkStave(),e=t.getModifierXShift(this.getPosition()),i=t.checkContext();this.setRendered();let s=t.getWidth()-e;const n=t.getYForTopText(t.getNumLines())+this.yShift,a=1.5*t.getSpacingBetweenLines();switch(this.type){case he.BEGIN:i.fillRect(this.x+e,n,1,a);break;case he.END:s-=5,i.fillRect(this.x+e+s,n,1,a);break;case he.BEGIN_END:s-=3,i.fillRect(this.x+e,n,1,a),i.fillRect(this.x+e+s,n,1,a)}this.type!==he.BEGIN&&this.type!==he.BEGIN_END||this.renderText(i,e+5,n-this.yShift+15),i.fillRect(this.x+e,n,s,1)}}class Ce extends Et{static get CATEGORY(){return l.TimeSignature}constructor(t="4/4",e=15,i=!0){super(),this.topRenderY=0,this.botRenderY=0,this.timeSpec="4/4",this.line=0,this.isNumeric=!0,this.topStartX=0,this.botStartX=0,this.lineShift=0,this.topText=new X,this.botText=new X,this.validateArgs=i;const s=e;this.topLine=1,this.bottomLine=3,this.setPosition(Ct.BEGIN),this.setTimeSig(t),this.setPadding(s)}static getTimeSigCode(t,e=!1){let i=_.null;switch(t){case"C":i=_.timeSigCommon;break;case"C|":i=_.timeSigCutCommon;break;case"+":i=e?_.timeSigPlusSmall:_.timeSigPlus;break;case"-":i=_.timeSigMinus;break;case"(":i=e?_.timeSigParensLeftSmall:_.timeSigParensLeft;break;case")":i=e?_.timeSigParensRightSmall:_.timeSigParensRight;break;default:i=String.fromCodePoint(57472+Number(t[0]))}return i}makeTimeSignatureGlyph(t,e){let i="",s=0,n=0;for(let s=0;s<t.length;++s){i+=Ce.getTimeSigCode(t[s],e.length>0)}this.topText.setText(i),s=this.topText.getWidth(),n=this.topText.getHeight();let a=0;i="";for(let t=0;t<e.length;++t){i+=Ce.getTimeSigCode(e[t],!0)}this.botText.setText(i),a=this.botText.getWidth(),n=Math.max(n,this.botText.getHeight()),this.lineShift=n>30?.5:0,this.width=Math.max(s,a),this.topStartX=(this.width-s)/2,this.botStartX=(this.width-a)/2}setTimeSig(t){var e,i;if(this.timeSpec=t,"C"===t||"C|"===t){const e=Ce.getTimeSigCode(t);this.line=2,this.text=e,this.isNumeric=!1}else{this.validateArgs&&(t=>{t.split("/").forEach(e=>{if(!1===/^[0-9+\-()]+$/.test(e))throw new C("BadTimeSignature",`Invalid time spec: ${t}. Must contain valid signatures.`)})})(t);const s=t.split("/");this.line=0,this.isNumeric=!0,this.makeTimeSignatureGlyph(null!==(e=s[0])&&void 0!==e?e:"",null!==(i=s[1])&&void 0!==i?i:"")}return this}getTimeSpec(){return this.timeSpec}getLine(){return this.line}setLine(t){this.line=t}getIsNumeric(){return this.isNumeric}setIsNumeric(t){this.isNumeric=t}draw(){const t=this.checkStave(),e=t.checkContext();this.setRendered();const i=this.getAttribute("class");e.openGroup("timesignature"+(i?" "+i:""),this.getAttribute("id")),this.drawAt(e,t,this.x),this.drawPointerRect(),e.closeGroup()}drawAt(t,e,i){if(this.setRendered(),this.isNumeric){let s=i+this.topStartX;this.botText.getText().length>0?this.topRenderY=e.getYForLine(this.topLine-this.lineShift):this.topRenderY=(e.getYForLine(this.topLine)+e.getYForLine(this.bottomLine))/2,this.topText.renderText(t,s,this.topRenderY),s=i+this.botStartX,this.botRenderY=e.getYForLine(this.bottomLine+this.lineShift),this.botText.renderText(t,s,this.botRenderY)}else this.renderText(t,i-this.x,e.getYForLine(this.line))}getBoundingBox(){if(this.isNumeric){const t=this.topText.getBoundingBox(),e=this.botText.getBoundingBox();t.move(this.x+this.topStartX,this.topRenderY),e.move(this.x+this.botStartX,this.botRenderY);return t.mergeWith(e)}{const t=this.checkStave(),e=super.getBoundingBox();return e.move(0,t.getYForLine(this.line)),e}}}const ke={[Nt.CATEGORY]:0,[me.CATEGORY]:1,[fe.CATEGORY]:2,[Ce.CATEGORY]:3},ve={[Ce.CATEGORY]:0,[fe.CATEGORY]:1,[Nt.CATEGORY]:2,[me.CATEGORY]:3};class Be extends X{static get CATEGORY(){return l.Stave}static get defaultPadding(){return O.get("Stave.padding")+O.get("Stave.endPaddingMax")}static get rightPadding(){return O.get("Stave.endPaddingMax")}constructor(t,e,i,s){super(),this.x=t,this.y=e,this.width=i,this.formatted=!1,this.startX=t+5,this.endX=t+i,this.modifiers=[],this.measure=0,this.clef="treble",this.endClef=void 0,this.options=Object.assign({verticalBarWidth:10,numLines:5,leftBar:!0,rightBar:!0,spacingBetweenLinesPx:st.STAVE_LINE_DISTANCE,spaceAboveStaffLn:4,spaceBelowStaffLn:4,topTextPosition:1,bottomTextPosition:4,lineConfig:[]},s),this.bounds={x:this.x,y:this.y,w:this.width,h:0},this.defaultLedgerLineStyle={lineWidth:2},this.resetLines(),this.addModifier(new Nt(this.options.leftBar?kt.SINGLE:kt.NONE)),this.addEndModifier(new Nt(this.options.rightBar?kt.SINGLE:kt.NONE))}setDefaultLedgerLineStyle(t){this.defaultLedgerLineStyle=t}getDefaultLedgerLineStyle(){var t;const e=void 0!==(null===(t=this.getContext())||void 0===t?void 0:t.getDefaultStyle().strokeStyle)?{}:{strokeStyle:"#444"};return Object.assign(Object.assign(Object.assign({},e),this.styleExplicit?this.getStyle():{}),this.defaultLedgerLineStyle)}space(t){return this.options.spacingBetweenLinesPx*t}resetLines(){this.options.lineConfig=[];for(let t=0;t<this.options.numLines;t++)this.options.lineConfig.push({visible:!0});this.height=(this.options.numLines+this.options.spaceAboveStaffLn)*this.options.spacingBetweenLinesPx,this.options.bottomTextPosition=this.options.numLines}setNoteStartX(t){return this.formatted||this.format(),this.startX=t,this}getNoteStartX(){return this.formatted||this.format(),this.startX}getNoteEndX(){return this.formatted||this.format(),this.endX}getTieStartX(){return this.startX}getTieEndX(){return this.endX}getNumLines(){return this.options.numLines}setNumLines(t){return this.options.numLines=t,this.resetLines(),this}getTopLineTopY(){return this.getYForLine(0)}getBottomLineBottomY(){var t;return this.getYForLine(this.getNumLines()-1)+(null!==(t=this.getStyle().lineWidth)&&void 0!==t?t:1)}setX(t){const e=t-this.x;this.formatted=!1,this.x=t,this.startX+=e,this.endX+=e;for(let t=0;t<this.modifiers.length;t++){const i=this.modifiers[t];i.setX(i.getX()+e)}return this}setWidth(t){return this.formatted=!1,this.width=t,this.endX=this.x+t,this}setMeasure(t){return this.measure=t,this}getMeasure(){return this.measure}getModifierXShift(t=0){if("number"!=typeof t)throw new C("InvalidIndex","Must be of number type");if(this.formatted||this.format(),1===this.getModifiers(Ct.BEGIN).length)return 0;if(this.modifiers[t].getPosition()===Ct.RIGHT)return 0;let e=this.startX-this.x;const i=this.modifiers[0];return i.getType()===kt.REPEAT_BEGIN&&e>i.getWidth()&&(e-=i.getWidth()),e}setRepetitionType(t,e=0){return this.modifiers.push(new Se(t,this.x,e)),this}setVoltaType(t,e,i){return this.modifiers.push(new ye(t,e,this.x,i)),this}setSection(t,e,i=0,s,n=!0){const a=new Te(t).setYShift(e).setXShift(i).setDrawRect(n);return s&&a.setFontSize(s),this.addModifier(a),this}setTempo(t,e){return this.modifiers.push(new xe(t,this.x,e)),this}setStaveText(t,e,i={}){return this.modifiers.push(new be(t,e,i)),this}getSpacingBetweenLines(){return this.options.spacingBetweenLinesPx}getBoundingBox(){return new P(this.x,this.y,this.width,this.getBottomY()-this.y)}getBottomY(){const t=this.options,e=t.spacingBetweenLinesPx;return this.getYForLine(t.numLines)+t.spaceBelowStaffLn*e}getBottomLineY(){return this.getYForLine(this.options.numLines)}getYForLine(t){const e=this.options,i=e.spacingBetweenLinesPx,s=e.spaceAboveStaffLn;return this.y+t*i+s*i}getLineForY(t){const e=this.options,i=e.spacingBetweenLinesPx,s=e.spaceAboveStaffLn;return(t-this.y)/i-s}getYForTopText(t=0){return this.getYForLine(-t-this.options.topTextPosition)}getYForBottomText(t=0){return this.getYForLine(this.options.bottomTextPosition+t)}getYForNote(t){const e=this.options,i=e.spacingBetweenLinesPx,s=e.spaceAboveStaffLn;return this.y+s*i+5*i-t*i}getYForGlyphs(){return this.getYForLine(3)}addModifier(t,e){return void 0!==e&&t.setPosition(e),t.setStave(this),this.formatted=!1,this.modifiers.push(t),this}addEndModifier(t){return this.addModifier(t,Ct.END),this}setBegBarType(t,e=vt.NONE){const{SINGLE:i,REPEAT_BEGIN:s,NONE:n}=kt;return t!==i&&t!==s&&t!==n||(this.modifiers[0].setType(t).setRepeatBracket(e),this.formatted=!1),this}setEndBarType(t,e=vt.NONE){return t!==kt.REPEAT_BEGIN&&(this.modifiers[1].setType(t).setRepeatBracket(e),this.formatted=!1),this}setClef(t,e,i,s){void 0===s&&(s=Ct.BEGIN),s===Ct.END?this.endClef=t:this.clef=t;const n=this.getModifiers(s,me.CATEGORY);return 0===n.length?this.addClef(t,e,i,s):n[0].setType(t,e,i),this}getClef(){return this.clef}setEndClef(t,e,i){return this.setClef(t,e,i,Ct.END),this}getEndClef(){return this.endClef}setKeySignature(t,e,i){void 0===i&&(i=Ct.BEGIN);const s=this.getModifiers(i,fe.CATEGORY);return 0===s.length?this.addKeySignature(t,e,i):s[0].setKeySig(t,e),this}setEndKeySignature(t,e){return this.setKeySignature(t,e,Ct.END),this}setTimeSignature(t,e,i){void 0===i&&(i=Ct.BEGIN);const s=this.getModifiers(i,Ce.CATEGORY);return 0===s.length?this.addTimeSignature(t,e,i):s[0].setTimeSig(t),this}setEndTimeSignature(t,e){return this.setTimeSignature(t,e,Ct.END),this}addKeySignature(t,e,i){return void 0===i&&(i=Ct.BEGIN),this.addModifier(new fe(t,e).setPosition(i),i),this}addClef(t,e,i,s){return void 0===s||s===Ct.BEGIN?this.clef=t:s===Ct.END&&(this.endClef=t),this.addModifier(new me(t,e,i),s),this}addEndClef(t,e,i){return this.addClef(t,e,i,Ct.END),this}addTimeSignature(t,e,i){return this.addModifier(new Ce(t,e),i),this}addEndTimeSignature(t,e){return this.addTimeSignature(t,e,Ct.END),this}addTrebleGlyph(){return this.addClef("treble"),this}getModifiers(t,e){const i=void 0===t,s=void 0===e;return i&&s?this.modifiers:i?this.modifiers.filter(t=>e===t.getCategory()):s?this.modifiers.filter(e=>t===e.getPosition()):this.modifiers.filter(i=>t===i.getPosition()&&e===i.getCategory())}sortByCategory(t,e){for(let i=t.length-1;i>=0;i--)for(let s=0;s<i;s++)if(e[t[s].getCategory()]>e[t[s+1].getCategory()]){const e=t[s];t[s]=t[s+1],t[s+1]=e}}format(){var t,e,i,s;const a=this.modifiers[0],o=this.modifiers[1],r=this.getModifiers(Ct.BEGIN),h=this.getModifiers(Ct.END);let c,l,d;this.sortByCategory(r,ke),this.sortByCategory(h,ve),r.length>1&&a.getType()===kt.REPEAT_BEGIN&&(r.push(r.splice(0,1)[0]),r.splice(0,0,new Nt(kt.SINGLE))),h.indexOf(o)>0&&h.splice(0,0,new Nt(kt.NONE));let u=0,g=this.x;for(let t=0;t<r.length;t++)d=r[t],l=d.getPadding(t+u),c=d.getWidth(),g+=l,d.setX(g),g+=c,l+c===0&&u--;this.startX=g,g=this.x+this.width;const p={left:0,right:0,paddingRight:0,paddingLeft:0};let m=0;for(let a=0;a<h.length;a++){d=h[a],m=n(d)?a:m,p.right=0,p.left=0,p.paddingRight=0,p.paddingLeft=0;const o=d.getLayoutMetrics();o?(0!==a&&(p.right=null!==(t=o.xMax)&&void 0!==t?t:0,p.paddingRight=null!==(e=o.paddingRight)&&void 0!==e?e:0),p.left=-(null!==(i=o.xMin)&&void 0!==i?i:0),p.paddingLeft=null!==(s=o.paddingLeft)&&void 0!==s?s:0,a===h.length-1&&(p.paddingLeft=0)):(p.paddingRight=d.getPadding(a-m),0!==a&&(p.right=d.getWidth()),0===a&&(p.left=d.getWidth())),g-=p.paddingRight,g-=p.right,d.setX(g),g-=p.left,g-=p.paddingLeft}this.endX=1===h.length?this.x+this.width:g,this.formatted=!0}draw(){var t;const e=this.checkContext();this.setRendered();const i=this.getAttribute("class");e.openGroup("stave"+(i?" "+i:""),this.getAttribute("id")),this.formatted||this.format();const s=this.options.numLines,n=this.width,a=this.x;let o;const r=(null!==(t=this.getStyle().lineWidth)&&void 0!==t?t:1)%2==0?0:.5;for(let t=0;t<s;t++)o=this.getYForLine(t),this.options.lineConfig[t].visible&&(e.beginPath(),e.moveTo(a,o+r),e.lineTo(a+n,o+r),e.stroke());this.drawPointerRect(),e.closeGroup();for(let t=0;t<this.modifiers.length;t++){const i=this.modifiers[t];i.setContext(e),i.setStave(this),i.drawWithStyle()}if(this.measure>0){e.setFont(this.fontInfo);const t=e.measureText(""+this.measure).width;o=this.getYForTopText(0)+3,e.fillText(""+this.measure,this.x-t/2,o)}}getVerticalBarWidth(){return this.options.verticalBarWidth}getConfigForLines(){return this.options.lineConfig}setConfigForLine(t,e){if(t>=this.options.numLines||t<0)throw new C("StaveConfigError","The line number must be within the range of the number of lines in the Stave.");if(void 0===e.visible)throw new C("StaveConfigError","The line configuration object is missing the 'visible' property.");if("boolean"!=typeof e.visible)throw new C("StaveConfigError","The line configuration objects 'visible' property must be true or false.");return this.options.lineConfig[t]=e,this}setConfigForLines(t){if(t.length!==this.options.numLines)throw new C("StaveConfigError","The length of the lines configuration array must match the number of lines in the Stave");for(const e in t)void 0===t[e].visible&&(t[e]=this.options.lineConfig[e]),this.options.lineConfig[e]=Object.assign(Object.assign({},this.options.lineConfig[e]),t[e]);return this.options.lineConfig=t,this}static formatBegModifiers(t){const e=e=>{let i=0;t.forEach(t=>{const s=t.getModifiers(Ct.BEGIN,e);s.length>0&&s[0].getX()>i&&(i=s[0].getX())});let s=0;t.forEach(t=>{s=0;t.getModifiers(Ct.BEGIN,e).forEach(t=>{i-t.getX()>s&&(s=i-t.getX())});const n=t.getModifiers(Ct.BEGIN);let a=!1;n.forEach(t=>{t.getCategory()===e&&(a=!0),a&&s>0&&t.setX(t.getX()+s)}),t.setNoteStartX(t.getNoteStartX()+s)})};t.forEach(t=>{t.formatted||t.format()}),e(l.Clef),e(l.KeySignature),e(l.TimeSignature);let i=0;t.forEach(t=>{t.getNoteStartX()>i&&(i=t.getNoteStartX())}),t.forEach(t=>{t.setNoteStartX(i)}),i=0,t.forEach(t=>{t.getModifiers(Ct.BEGIN,l.Barline).forEach(t=>{t.getType()===kt.REPEAT_BEGIN&&t.getX()>i&&(i=t.getX())})}),t.forEach(t=>{t.getModifiers(Ct.BEGIN,l.Barline).forEach(t=>{t.getType()===kt.REPEAT_BEGIN&&t.setX(i)})})}}function De(t,e,i,s,n){if(e!==Le.type.BOLD_DOUBLE_LEFT&&e!==Le.type.BOLD_DOUBLE_RIGHT)throw new C("InvalidConnector","A REPEAT_BEGIN or REPEAT_END type must be provided.");let a=3,o=3.5;e===Le.type.BOLD_DOUBLE_RIGHT&&(a=-5,o=3),t.fillRect(i+a,s,1,n-s),t.fillRect(i-2,s,o,n-s)}class Le extends X{static get CATEGORY(){return l.StaveConnector}constructor(t,e){super(),this.thickness=st.STAVE_LINE_THICKNESS,this.topStave=t,this.bottomStave=e,this.type=Le.type.DOUBLE,this.xShift=0,this.texts=[]}setType(t){const e="string"==typeof t?Le.typeString[t]:t;return Object.values(Le.type).includes(e)&&(this.type=e),this}getType(){return this.type}setText(t,e={}){var i,s;const n=new X("StaveConnector.text");return n.setText(t),n.setXShift(null!==(i=e.shiftX)&&void 0!==i?i:0),n.setYShift(null!==(s=e.shiftY)&&void 0!==s?s:0),this.texts.push(n),this}draw(){const t=this.checkContext();this.setRendered();let e=this.topStave.getYForLine(0),i=this.bottomStave.getYForLine(this.bottomStave.getNumLines()-1)+this.thickness,s=3,n=this.topStave.getX();(this.type===Le.type.SINGLE_RIGHT||this.type===Le.type.BOLD_DOUBLE_RIGHT||this.type===Le.type.THIN_DOUBLE)&&(n=this.topStave.getX()+this.topStave.getWidth());let a=i-e;const o=new X;switch(this.type){case Le.type.SINGLE:case Le.type.SINGLE_LEFT:case Le.type.SINGLE_RIGHT:s=1;break;case Le.type.DOUBLE:n-=5,e-=this.thickness,a+=.5;break;case Le.type.BRACE:{s=12;const n=this.topStave.getX()-2+this.xShift,o=e,r=n,h=i,c=n-s,l=o+a/2,d=c-.9*s,u=o+.2*a,g=n+1.1*s,p=l-.135*a,m=g,f=l+.135*a,S=d,T=h-.2*a,x=c-s,w=T,b=n+.4*s,y=l+.135*a,C=b,k=l-.135*a,v=x,B=u;t.beginPath(),t.moveTo(n,o),t.bezierCurveTo(d,u,g,p,c,l),t.bezierCurveTo(m,f,S,T,r,h),t.bezierCurveTo(x,w,b,y,c,l),t.bezierCurveTo(C,k,v,B,n,o),t.fill(),t.stroke();break}case Le.type.BRACKET:e-=6,i+=6,a=i-e,o.setText(_.bracketTop),o.renderText(t,n-5,e),o.setText(_.bracketBottom),o.renderText(t,n-5,i),n-=5;break;case Le.type.BOLD_DOUBLE_LEFT:De(t,this.type,n+this.xShift,e,i-this.thickness);break;case Le.type.BOLD_DOUBLE_RIGHT:De(t,this.type,n,e,i-this.thickness);break;case Le.type.THIN_DOUBLE:s=1,a-=this.thickness;break;case Le.type.NONE:break;default:throw new C("InvalidType",`The provided StaveConnector.type (${this.type}) is invalid.`)}this.type!==Le.type.BRACE&&this.type!==Le.type.BOLD_DOUBLE_LEFT&&this.type!==Le.type.BOLD_DOUBLE_RIGHT&&this.type!==Le.type.NONE&&t.fillRect(n,e,s,a),this.type===Le.type.THIN_DOUBLE&&t.fillRect(n-3,e,s,a);for(let e=0;e<this.texts.length;e++){const i=this.texts[e],s=this.topStave.getX()-i.getWidth()-24,n=(this.topStave.getYForLine(0)+this.bottomStave.getBottomLineY())/2;i.renderText(t,s,n+4)}}}Le.type={SINGLE_RIGHT:0,SINGLE_LEFT:1,SINGLE:1,DOUBLE:2,BRACE:3,BRACKET:4,BOLD_DOUBLE_LEFT:5,BOLD_DOUBLE_RIGHT:6,THIN_DOUBLE:7,NONE:8},Le.typeString={singleRight:Le.type.SINGLE_RIGHT,singleLeft:Le.type.SINGLE_LEFT,single:Le.type.SINGLE,double:Le.type.DOUBLE,brace:Le.type.BRACE,bracket:Le.type.BRACKET,boldDoubleLeft:Le.type.BOLD_DOUBLE_LEFT,boldDoubleRight:Le.type.BOLD_DOUBLE_RIGHT,thinDouble:Le.type.THIN_DOUBLE,none:Le.type.NONE};class Ee{static getNextContext(t){const e=t.tContexts,i=e.indexOf(t);if(i+1<e.length)return e[i+1]}constructor(t){var e;this.preFormatted=!1,this.postFormatted=!1,this.tickID=null!==(e=null==t?void 0:t.tickID)&&void 0!==e?e:0,this.currentTick=new F(0,1),this.maxTicks=new F(0,1),this.maxTickable=void 0,this.minTicks=void 0,this.minTickable=void 0,this.padding=1,this.x=0,this.xBase=0,this.xOffset=0,this.tickables=[],this.tickablesByVoice={},this.notePx=0,this.glyphPx=0,this.leftDisplacedHeadPx=0,this.rightDisplacedHeadPx=0,this.modLeftPx=0,this.modRightPx=0,this.totalLeftPx=0,this.totalRightPx=0,this.tContexts=[],this.width=0,this.formatterMetrics={freedom:{left:0,right:0}}}getTickID(){return this.tickID}getX(){return this.x}setX(t){return this.x=t,this.xBase=t,this.xOffset=0,this}getXBase(){return this.xBase}setXBase(t){this.xBase=t,this.x=t+this.xOffset}getXOffset(){return this.xOffset}setXOffset(t){this.xOffset=t,this.x=this.xBase+t}getWidth(){return this.width+2*this.padding}setPadding(t){return this.padding=t,this}getMaxTicks(){return this.maxTicks}getMinTicks(){return this.minTicks}getMaxTickable(){return this.maxTickable}getMinTickable(){return this.minTickable}getTickables(){return this.tickables}getTickableForVoice(t){return this.tickablesByVoice[t]}getTickablesByVoice(){return this.tickablesByVoice}getCenterAlignedTickables(){return this.tickables.filter(t=>t.isCenterAligned())}getMetrics(){const{width:t,glyphPx:e,notePx:i,leftDisplacedHeadPx:s,rightDisplacedHeadPx:n,modLeftPx:a,modRightPx:o,totalLeftPx:r,totalRightPx:h}=this;return{width:t,glyphPx:e,notePx:i,leftDisplacedHeadPx:s,rightDisplacedHeadPx:n,modLeftPx:a,modRightPx:o,totalLeftPx:r,totalRightPx:h}}getCurrentTick(){return this.currentTick}setCurrentTick(t){this.currentTick=t,this.preFormatted=!1}addTickable(t,e){if(!t)throw new C("BadArgument","Invalid tickable added.");if(!t.shouldIgnoreTicks()){const e=t.getTicks();e.greaterThan(this.maxTicks)&&(this.maxTicks=e.clone(),this.maxTickable=t),(void 0===this.minTicks||e.lessThan(this.minTicks))&&(this.minTicks=e.clone(),this.minTickable=t)}return t.setTickContext(this),this.tickables.push(t),this.tickablesByVoice[null!=e?e:0]=t,this.preFormatted=!1,this}preFormat(){var t;if(this.preFormatted)return this;for(let e=0;e<this.tickables.length;++e){const i=this.tickables[e];i.preFormat();const s=i.getMetrics();this.leftDisplacedHeadPx=Math.max(this.leftDisplacedHeadPx,s.leftDisplacedHeadPx),this.rightDisplacedHeadPx=Math.max(this.rightDisplacedHeadPx,s.rightDisplacedHeadPx),this.notePx=Math.max(this.notePx,s.notePx),this.glyphPx=Math.max(this.glyphPx,null!==(t=s.glyphWidth)&&void 0!==t?t:0),this.modLeftPx=Math.max(this.modLeftPx,s.modLeftPx),this.modRightPx=Math.max(this.modRightPx,s.modRightPx),this.totalLeftPx=Math.max(this.totalLeftPx,s.modLeftPx+s.leftDisplacedHeadPx),this.totalRightPx=Math.max(this.totalRightPx,s.modRightPx+s.rightDisplacedHeadPx),this.width=this.notePx+this.totalLeftPx+this.totalRightPx}return this}postFormat(){return this.postFormatted||(this.postFormatted=!0),this}getFormatterMetrics(){return this.formatterMetrics}move(t,e,i){this.setX(this.getX()+t),this.getFormatterMetrics().freedom.left+=t,this.getFormatterMetrics().freedom.right-=t,e&&(e.getFormatterMetrics().freedom.right+=t),i&&(i.getFormatterMetrics().freedom.left-=t)}getDeviationCost(){return N(this.tickables.map(t=>t.getFormatterMetrics().space.deviation))}getAverageDeviationCost(){return this.tickables.length?this.getDeviationCost()/this.tickables.length:0}}function Ne(t,e,i,s){let n=e;for(let e=i+1;e<t.length;e++){const i=t[e];if(o(i)&&!i.isRest()&&!i.shouldIgnoreTicks()){n=i.getLineForRest();break}}if(s&&e!==n){n=D(Math.max(e,n),Math.min(e,n))}return n}class Fe{static SimpleFormat(t,e=0,{paddingBetween:i=10}={}){t.reduce((t,e)=>{e.addToModifierContext(new pe);const s=(new Ee).addTickable(e).preFormat(),n=s.getMetrics();return s.setX(t+n.totalLeftPx),t+s.getWidth()+n.totalRightPx+i},e)}static plotDebugging(t,e,i,s,n,a){var o,r;const h=i+(a=Object.assign({stavePadding:O.get("Stave.padding")},a)).stavePadding,c=e.contextGaps;t.save(),t.setFont(O.get("fontFamily"),8),c.gaps.forEach(e=>{var i,a,o;i=h+e.x1,a=h+e.x2,o="rgba(100,200,100,0.4)",t.beginPath(),t.setStrokeStyle(o),t.setFillStyle(o),t.setLineWidth(1),t.fillRect(i,s,Math.max(a-i,0),n-s),t.setFillStyle("green"),t.fillText(Math.round(e.x2-e.x1).toString(),h+e.x1,n+12)}),t.setFillStyle("red"),t.fillText(`Loss: ${(null!==(o=e.totalCost)&&void 0!==o?o:0).toFixed(2)} Shift: ${(null!==(r=e.totalShift)&&void 0!==r?r:0).toFixed(2)} Gap: ${c.total.toFixed(2)}`,h-20,n+27),t.restore()}static FormatAndDraw(t,e,i,s){let n={autoBeam:!1,alignRests:!1};"object"==typeof s?n=Object.assign(Object.assign({},n),s):"boolean"==typeof s&&(n.autoBeam=s);const a=new zt(st.TIME4_4).setMode(zt.Mode.SOFT).addTickables(i),o=n.autoBeam?Ie.applyAndGetBeams(a):[];return(new Fe).joinVoices([a]).formatToStave([a],e,{alignRests:n.alignRests,stave:e}),a.setContext(t).setStave(e).drawWithStyle(),o.forEach(e=>e.setContext(t).drawWithStyle()),a.getBoundingBox()}static FormatAndDrawTab(t,e,i,s,n,a,o){let r={autoBeam:a,alignRests:!1};"object"==typeof o?r=Object.assign(Object.assign({},r),o):"boolean"==typeof o&&(r.autoBeam=o);const h=new zt(st.TIME4_4).setMode(zt.Mode.SOFT).addTickables(n),c=new zt(st.TIME4_4).setMode(zt.Mode.SOFT).addTickables(s),l=r.autoBeam?Ie.applyAndGetBeams(h):[];(new Fe).joinVoices([h]).joinVoices([c]).formatToStave([h,c],i,{alignRests:r.alignRests}),h.draw(t,i),c.draw(t,e),l.forEach(e=>e.setContext(t).drawWithStyle()),new Le(i,e).setContext(t).drawWithStyle()}static AlignRestsToNotes(t,e,i=!1){t.forEach((s,n)=>{if(r(s)&&s.isRest()){if(s.getTuplet()&&!i)return;if(3!==s.getLineForRest())return;if(e||s.getBeam()){const e=s.getKeyProps()[0];if(0===n)e.line=Ne(t,e.line,n,!1);else if(n>0&&n<t.length){const i=t[n-1];if(r(i))if(i.isRest())e.line=i.getKeyProps()[0].line;else{const s=i.getLineForRest();e.line=Ne(t,s,n,!0)}}s.setKeyLine(0,e.line)}}})}constructor(t){this.formatterOptions=Object.assign({globalSoftmax:!1,softmaxFactor:st.SOFTMAX_FACTOR,maxIterations:5},t),this.justifyWidth=0,this.totalCost=0,this.totalShift=0,this.durationStats={},this.minTotalWidth=0,this.hasMinTotalWidth=!1,this.tickContexts={map:{},array:[],list:[],resolutionMultiplier:0},this.modifierContexts=[],this.contextGaps={total:0,gaps:[]},this.voices=[],this.lossHistory=[]}alignRests(t,e){if(!t||!t.length)throw new C("BadArgument","No voices to format rests");t.forEach(t=>Fe.AlignRestsToNotes(t.getTickables(),e))}preCalculateMinTotalWidth(t){const e=O.get("Stave.unalignedNotePadding");let i=0,s=0,n=0;const a=[],o=[];if(this.hasMinTotalWidth)return this.minTotalWidth;if(!t)throw new C("BadArgument","'voices' required to run preCalculateMinTotalWidth");this.createTickContexts(t);const{list:r,map:h}=this.tickContexts;this.minTotalWidth=0,r.forEach(e=>{const r=h[e];r.preFormat(),r.getTickables().length<t.length&&(i+=1),r.getTickables().forEach(t=>{s+=t.getMetrics().width,n+=t.getTicks().value(),a.push(t.getMetrics().width),o.push(t.getTicks().value())});const c=r.getWidth();this.minTotalWidth+=c}),this.hasMinTotalWidth=!0;const c=s>0?s/a.length:1/a.length,l=N(a.map(t=>Math.pow(t-c,2))),d=Math.pow(l/a.length,.5)/c,u=n/o.length,g=N(o.map(t=>Math.pow(t-u,2))),p=Math.pow(g/o.length,.5)/u,m=Math.max(p,d)*r.length*e,f=e*i;return this.minTotalWidth+Math.max(f,m)}getMinTotalWidth(){if(!this.hasMinTotalWidth)throw new C("NoMinTotalWidth","Call 'preCalculateMinTotalWidth' or 'preFormat' before calling 'getMinTotalWidth'");return this.minTotalWidth}static getResolutionMultiplier(t){if(!t||!t.length)throw new C("BadArgument","No voices to format");const e=t[0].getTotalTicks();return t.reduce((t,i)=>{if(!i.getTotalTicks().equals(e))throw new C("TickMismatch","Voices should have same total note duration in ticks.");if(i.getMode()===zt.Mode.STRICT&&!i.isComplete())throw new C("IncompleteVoice","Voice does not have enough notes.");return Math.max(t,F.LCM(t,i.getResolutionMultiplier()))},1)}createModifierContexts(t){if(0===t.length)return;const e=Fe.getResolutionMultiplier(t),i=new Map,s=[];t.forEach(t=>{const n=new F(0,e);t.getTickables().forEach(t=>{const e=n.numerator;let a=i.get(t.getStave());if(a||(i.set(t.getStave(),{}),a=i.get(t.getStave())),!(a?a[e]:void 0)){const t=new pe;s.push(t),a[e]=t}t.addToModifierContext(a[e]),n.add(t.getTicks())})}),this.modifierContexts.push({map:i,array:s,resolutionMultiplier:e})}createTickContexts(t){if(0===t.length)return{map:{},array:[],list:[],resolutionMultiplier:0};const e={},i=[],s=[],n=Fe.getResolutionMultiplier(t);t.forEach((t,a)=>{const o=new F(0,n);t.getTickables().forEach(t=>{const n=o.numerator;if(!e[n]){const t=new Ee({tickID:n});s.push(t),e[n]=t,i.push(n)}e[n].addTickable(t,a),o.add(t.getTicks())})});const a={map:e,array:s,list:i.sort((t,e)=>t-e),resolutionMultiplier:n};this.tickContexts=a;const o=this.tickContexts.array;return o.forEach(t=>{t.tContexts=o}),a}getTickContexts(){return this.tickContexts}preFormat(t=0,e,i,s){const n=this.tickContexts;if(!n)throw new C("NoTickContexts","preFormat requires TickContexts");const{list:a,map:o}=n;this.lossHistory=[],i&&s&&i.forEach(t=>t.setStave(s).preFormat());let r=0,h=0;this.minTotalWidth=0;let c=0;a.forEach(t=>{const e=o[t];e.preFormat();const i=e.getWidth();this.minTotalWidth+=i;const s=e.getMaxTicks().value();c+=s;const n=e.getMetrics();r=r+h+n.totalLeftPx,e.setX(r),h=i-n.totalLeftPx});const{globalSoftmax:l,softmaxFactor:d,maxIterations:u}=this.formatterOptions,g=N(a.map(t=>Math.pow(d,o[t].getMaxTicks().value()/c)));if(this.minTotalWidth=r+h,this.hasMinTotalWidth=!0,t<=0)return this.evaluate();const p=o[a[0]],m=o[a[a.length-1]];function f(t){return a.map((e,i)=>{const s=o[e],n=s.getTickablesByVoice();let r;if(i>0){const e=o[a[i-1]];for(let h=i-1;h>=0;h--){const i=o[a[h]].getTickablesByVoice(),u=[];if(Object.keys(n).forEach(t=>{i[t]&&u.push(t)}),u.length>0){let a=0,o=1/0,h=0;if(u.forEach(t=>{const e=i[t].getTicks().value();e>a&&(r=i[t],a=e);const s=n[t],h=s.getX()-(s.getMetrics().modLeftPx+s.getMetrics().leftDisplacedHeadPx),c=i[t].getMetrics(),l=i[t].getX()+c.notePx+c.modRightPx+c.rightDisplacedHeadPx;o=Math.min(o,h-l)}),o=Math.min(o,s.getX()-(e.getX()+.05*t)),l){const e=c;h=Math.pow(d,a/e)/g*t}else void 0!==r&&(h=r.getVoice().softmax(a)*t);return{expectedDistance:h,maxNegativeShiftPx:o,fromTickable:r}}}}return{expectedDistance:0,fromTickablePx:0,maxNegativeShiftPx:0}})}function S(t){const e=T/2;let i=0;return a.forEach((s,n)=>{const a=o[s];if(n>0){const e=a.getX(),s=t[n],o=v(s.fromTickable).getX()+s.expectedDistance-(e+i);let r=0;o>0?i+=o:o<0&&(r=Math.min(s.maxNegativeShiftPx,Math.abs(o)),i+=-r),a.setX(e+i)}a.getCenterAlignedTickables().forEach(t=>{t.setCenterXShift(e-a.getX())})}),m.getX()-p.getX()}const T=t-m.getMetrics().notePx-m.getMetrics().totalRightPx-p.getMetrics().totalLeftPx,x=O.get("Stave.endPaddingMin"),w=O.get("Stave.endPaddingMax"),b=O.get("Stave.padding");let y=T;const k=f(y);let B=S(k);if(1===a.length)return 0;const D=((t,e)=>{let i=t/2;if(e.length>1)for(let t=1;t<e.length;++t)i=Math.min(e[t].expectedDistance/2,i);return i})(y,k),L=t=>{let e=0;const i=m&&m.getMaxTickable();if(i){const s=i.getVoice();if(s.getTicksUsed().value()>s.getTotalTicks().value())return 2*w<D?D:w;const n=i.getWidth();e=s.softmax(m.getMaxTicks().value())*t-(n+b)}return 2*w<e?e:w};let E=L(y),F=E-(w-x);const A=T-F;let R=u;for(;B>A&&R>0||B+E<A&&R>1;)y-=B-A,E=L(y),F=E-(w-x),B=S(f(y)),R--;return this.justifyWidth=t,this.evaluate()}evaluate(){const t=this.tickContexts,e=this.justifyWidth;this.contextGaps={total:0,gaps:[]},t.list.forEach((e,i)=>{if(0===i)return;const s=t.list[i-1],n=t.map[s],a=t.map[e],o=n.getMetrics(),r=a.getMetrics(),h=n.getX()+o.notePx+o.totalRightPx,c=a.getX()-r.totalLeftPx,l=c-h;this.contextGaps.total+=l,this.contextGaps.gaps.push({x1:h,x2:c}),a.getFormatterMetrics().freedom.left=l,n.getFormatterMetrics().freedom.right=l}),this.durationStats={};const i=this.durationStats;this.voices.forEach(t=>{t.getTickables().forEach((t,s,n)=>{const a=t.getTicks().clone().simplify().toString(),o=t.getMetrics(),r=t.getFormatterMetrics(),h=t.getX()+o.notePx+o.modRightPx+o.rightDisplacedHeadPx;let c=0;if(s<n.length-1){const e=n[s+1],i=e.getMetrics();c=e.getX()-i.modLeftPx-i.leftDisplacedHeadPx-h,r.space.used=e.getX()-t.getX(),e.getFormatterMetrics().freedom.left=c}else c=e-h,r.space.used=e-t.getX();r.freedom.right=c,function(t,e){const s=i[t];void 0===s?i[t]={mean:e,count:1,total:e}:(s.count+=1,s.total+=e,s.mean=s.total/s.count)}(a,r.space.used)})});let s=0;return this.voices.forEach(t=>{t.getTickables().forEach(t=>{const e=t.getTicks().clone().simplify().toString(),n=t.getFormatterMetrics();n.space.mean=i[e].mean,n.duration=e,n.iterations+=1,n.space.deviation=n.space.used-n.space.mean,s+=Math.pow(n.space.deviation,2)})}),this.totalCost=Math.sqrt(s),this.lossHistory.push(this.totalCost),this.totalCost}tune(t){var e;const i=this.tickContexts;if(!i)return 0;const s=null!==(e=null==t?void 0:t.alpha)&&void 0!==e?e:.5;let n=0;return this.totalShift=0,i.list.forEach((t,e,a)=>{const o=i.map[t],r=e>0?i.map[a[e-1]]:void 0,h=e<a.length-1?i.map[a[e+1]]:void 0;o.move(n,r,h);const c=-o.getDeviationCost();c>0?n=-Math.min(o.getFormatterMetrics().freedom.right,Math.abs(c)):c<0&&(n=h?Math.min(h.getFormatterMetrics().freedom.right,Math.abs(c)):0),n*=s,this.totalShift+=n}),this.evaluate()}postFormat(){return this.modifierContexts.forEach(t=>{t.array.forEach(t=>t.postFormat())}),this.tickContexts.list.forEach(t=>{this.tickContexts.map[t].postFormat()}),this}joinVoices(t){return this.createModifierContexts(t),this.hasMinTotalWidth=!1,this}format(t,e,i){const s=Object.assign({alignRests:!1},i);this.voices=t;const n=this.formatterOptions.softmaxFactor;return n&&this.voices.forEach(t=>t.setSoftmaxFactor(n)),this.alignRests(t,s.alignRests),this.createTickContexts(t),this.preFormat(e,s.context,t,s.stave),s.stave&&this.postFormat(),this}formatToStave(t,e,i){const s=Object.assign({context:e.getContext()},i),n=e.getNoteEndX()-e.getNoteStartX()-Be.defaultPadding;return function(...t){Fe.DEBUG&&B("VexFlow.Formatter",t)}("Formatting voices to width: ",n),this.format(t,n,s)}getTickContext(t){var e;return null===(e=this.tickContexts)||void 0===e?void 0:e.map[t]}}var Ae;Fe.DEBUG=!1,function(t){t[t.BOTTOM=-1]="BOTTOM",t[t.TOP=1]="TOP"}(Ae||(Ae={}));class Oe extends X{static get CATEGORY(){return l.Tuplet}static get LOCATION_TOP(){return Ae.TOP}static get LOCATION_BOTTOM(){return Ae.BOTTOM}static get NESTING_OFFSET(){return 15}constructor(t,e={}){if(super(),!t||!t.length)throw new C("BadArguments","No notes provided for tuplet.");this.notes=t;const i=void 0!==e.numNotes?e.numNotes:t.length,s=e.notesOccupied||2,n=void 0!==e.bracketed?e.bracketed:t.some(t=>!t.hasBeam()),a=void 0!==e.ratioed?e.ratioed:Math.abs(s-i)>1,o=e.location||Oe.LOCATION_TOP,r=e.yOffset||O.get("Tuplet.yOffset"),h=e.textYOffset||O.get("Tuplet.textYOffset"),c=e.suffix||"";this.options={bracketed:n,location:o,notesOccupied:s,numNotes:i,ratioed:a,yOffset:r,textYOffset:h,suffix:c},this.textElement=new X("Tuplet"),this.suffixElement=new X("Tuplet.suffix"),this.setTupletLocation(o||Oe.LOCATION_TOP),Fe.AlignRestsToNotes(t,!0,!0),this.resolveGlyphs(),this.attach()}attach(){for(let t=0;t<this.notes.length;t++){const e=this.notes[t];e.getTupletStack().includes(this)||e.addTuplet(this)}}detach(){for(let t=0;t<this.notes.length;t++){this.notes[t].removeTuplet(this)}}setBracketed(t){return this.options.bracketed=t,this}setRatioed(t){return this.options.ratioed=t,this}setTupletLocation(t){return t!==Oe.LOCATION_TOP&&t!==Oe.LOCATION_BOTTOM&&(console.warn(`Invalid tuplet location [${t}]. Using Tuplet.LOCATION_TOP.`),t=Oe.LOCATION_TOP),this.options.location=t,this}getNotes(){return this.notes}getNoteCount(){return this.options.numNotes}getNotesOccupied(){return this.options.notesOccupied}setNotesOccupied(t){this.detach(),this.options.notesOccupied=t,this.resolveGlyphs(),this.attach()}resolveGlyphs(){let t="",e="",i=this.options.numNotes;for(;i>=1;)t=String.fromCharCode(59520+i%10)+t,i=Math.floor(i/10);if(this.options.ratioed){for(i=this.options.notesOccupied;i>=1;)e=String.fromCharCode(59520+i%10)+e,i=Math.floor(i/10);e=_.tupletColon+e}this.textElement.setText(t+e),this.options.suffix&&this.suffixElement.setText(this.options.suffix)}getNestedTupletCount(){const{location:t}=this.options;let e=0;for(const i of this.notes){const s=i.getTupletStack().filter(e=>e.options.location===t).indexOf(this);s>=0&&s>e&&(e=s)}return e}getYPosition(){var t;const e=this.getNestedTupletCount()*Oe.NESTING_OFFSET*-this.options.location,i=null!==(t=this.options.yOffset)&&void 0!==t?t:0,s=this.notes[0];let n;if(this.options.location===Oe.LOCATION_TOP){n=s.checkStave().getYForLine(0)-1.5*st.STAVE_LINE_DISTANCE;for(let t=0;t<this.notes.length;++t){const e=this.notes[t];let i=0;const s=e.getModifierContext();s&&(i=Math.max(i,s.getState().topTextLine));const a=e.getYForTopText(i)-2*st.STAVE_LINE_DISTANCE;if(e.hasStem()||e.isRest()){const t=e.getStemDirection()===ot.UP?e.getStemExtents().topY-st.STAVE_LINE_DISTANCE:e.getStemExtents().baseY-2*st.STAVE_LINE_DISTANCE;n=Math.min(t,n),i>0&&(n=Math.min(a,n))}}}else{let t=4;this.notes.forEach(e=>{const i=e.getModifierContext();i&&(t=Math.max(t,i.getState().textLine+1))}),n=s.checkStave().getYForLine(t)+2*st.STAVE_LINE_DISTANCE;for(let t=0;t<this.notes.length;++t)if(this.notes[t].hasStem()||this.notes[t].isRest()){const e=this.notes[t].getStemDirection()===ot.UP?this.notes[t].getStemExtents().baseY+2*st.STAVE_LINE_DISTANCE:this.notes[t].getStemExtents().topY+st.STAVE_LINE_DISTANCE;e>n&&(n=e)}}return n+e+i}draw(){const{location:t,bracketed:e,textYOffset:i,suffix:s}=this.options,n=O.get("Tuplet.bracket.padding"),a=O.get("Tuplet.bracket.lineWidth"),o=O.get("Tuplet.bracket.legLength"),r=O.get("Tuplet.suffix.extraSpacing"),h=O.get("Tuplet.suffix.suffixOffsetY"),c=this.checkContext();let l=0,d=0;const u=this.notes[0],g=this.notes[this.notes.length-1];let p=0;e?(l=u.getTieLeftX()-n,p=g.getTieRightX()-l+n,this.setWidth(p+a)):(l=u.getStemX(),p=g.getStemX()-l,this.setWidth(p)),this.setX(l),d=this.getYPosition(),this.setY(t===Ae.TOP?d:d-o+a),this.height=o;const m=this.textElement.getWidth();let f=m,S=0;s&&(S=this.suffixElement.getWidth(),f=m+r+S);const T=l+p/2-f/2,x=d+this.textElement.getHeight()/2+(t===Oe.LOCATION_TOP?-1:1)*i,w=this.getAttribute("class");if(c.openGroup("tuplet"+(w?" "+w:""),this.getAttribute("id")),e){const e=p/2-f/2-n,i=t===Oe.LOCATION_BOTTOM;e>0&&(c.fillRect(l,d,e,a),c.fillRect(l+p/2+f/2+n,d,e,a),c.fillRect(l,d+(i?1:0),a,t*o),c.fillRect(l+p,d+(i?1:0),a,t*o))}let b=T;if(this.textElement.setX(b),this.textElement.setY(x),this.textElement.renderText(c,0,0),b+=m+r,s){const t=x+h;this.suffixElement.setX(b),this.suffixElement.setY(t),this.suffixElement.renderText(c,0,0),b+=S}this.drawPointerRect(),c.closeGroup(),this.setRendered()}getBoundingBox(){const{bracketed:t,suffix:e}=this.options,i=this.textElement.getBoundingBox(),s=this.suffixElement.getBoundingBox(),n=e?i.mergeWith(s):i;if(!t)return n;return new P(this.x,this.y,this.width,this.height).mergeWith(n)}}function Re(t){let e=0;return t.forEach(t=>{t.keyProps&&t.keyProps.forEach(t=>{e+=t.line-3})}),e>=0?ot.DOWN:ot.UP}const Pe="L",Me="B";class Ie extends X{static get CATEGORY(){return l.Beam}getStemDirection(){return this._stemDirection}static getDefaultBeamGroups(t){t&&"c"!==t||(t="4/4");const e={"1/2":["1/2"],"2/2":["1/2"],"3/2":["1/2"],"4/2":["1/2"],"1/4":["1/4"],"2/4":["1/4"],"3/4":["1/4"],"4/4":["1/4"],"1/8":["1/8"],"2/8":["2/8"],"3/8":["3/8"],"4/8":["2/8"],"1/16":["1/16"],"2/16":["2/16"],"3/16":["3/16"],"4/16":["2/16"]}[t];if(void 0!==e)return e.map(t=>(new F).parse(t));{const e=parseInt(t.split("/")[0],10),i=parseInt(t.split("/")[1],10);if(e%3==0)return[new F(3,i)];if(i>4)return[new F(2,i)];if(i<=4)return[new F(1,i)]}return[new F(1,4)]}static applyAndGetBeams(t,e,i){return Ie.generateBeams(t.getTickables(),{groups:i,stemDirection:e})}static generateBeams(t,e={}){e.groups&&e.groups.length||(e.groups=[new F(2,8)]);const i=e.groups.map(t=>{if(!t.multiply)throw new C("InvalidBeamGroups","The beam groups must be an array of VexFlow.Fractions");return t.clone().multiply(st.RESOLUTION,1)}),s=t;let n=0,a=[],o=[];function r(){i.length-1>n?n+=1:n=0}!function(){let t=[],e=new F(0,1);s.forEach(s=>{if(t=[],s.shouldIgnoreTicks())return a.push(o),void(o=t);o.push(s);const h=i[n].clone(),c=function(t){return t.reduce((t,e)=>e.getTicks().clone().add(t),new F(0,1))}(o).add(e),l=st.durationToNumber(s.getDuration())<8;if(l&&s.getTuplet()&&(h.numerator*=2),c.greaterThan(h)){if(!l){const e=o.pop();e&&t.push(e)}a.push(o);do{e=c.subtract(i[n]),r()}while(e.greaterThanEquals(i[n]));o=t}else c.equals(h)&&(a.push(o),e=new F(0,1),o=t,r())}),o.length>0&&a.push(o)}(),function(){const t=[];a.forEach(i=>{let s=[];i.forEach((i,n,a)=>{const o=0===n||n===a.length-1,r=a[n-1],h=!e.beamRests&&i.isRest(),c=e.beamRests&&e.beamMiddleOnly&&i.isRest()&&o;let l=!1;if(e.maintainStemDirections&&r&&!i.isRest()&&!r.isRest()){const t=r.getStemDirection();l=i.getStemDirection()!==t}const d=parseInt(i.getDuration(),10)<8;h||c||l||d?(s.length>0&&t.push(s),s=l?[i]:[]):s.push(i)}),s.length>0&&t.push(s)}),a=t}(),a.forEach(t=>{let i;if(e.maintainStemDirections){const e=function(t){for(let e=0;e<t.length;e++){const i=t[e];if(!i.isRest())return i}return!1}(t);i=e?e.getStemDirection():ot.UP}else i=e.stemDirection?e.stemDirection:Re(t);!function(t,e){t.forEach(t=>{t.setStemDirection(e)})}(t,i)});const h=a.filter(t=>{if(t.length>1){let e=!0;return t.forEach(t=>{t.getIntrinsicTicks()>=st.durationToTicks("4")&&(e=!1)}),e}return!1}),c=function(){const t=[];return a.forEach(e=>{let i;e.forEach(e=>{const s=e.getTuplet();s&&i!==s&&(i=s,t.push(i))})}),t}(),l=[];return h.forEach(t=>{const i=new Ie(t);e.showStemlets&&(i.renderOptions.showStemlets=!0),e.secondaryBreaks&&(i.renderOptions.secondaryBreakTicks=st.durationToTicks(e.secondaryBreaks)),!0===e.flatBeams&&(i.renderOptions.flatBeams=!0,i.renderOptions.flatBeamOffset=e.flatBeamOffset),l.push(i)}),c.forEach(t=>{const e=t.notes[0].stemDirection===ot.DOWN?Ae.BOTTOM:Ae.TOP;t.setTupletLocation(e);let i=!1;for(let e=0;e<t.notes.length;e++){if(!t.notes[e].hasBeam()){i=!0;break}}t.setBracketed(i)}),l}constructor(t,e=!1){if(super(),this.slope=0,this.yShift=0,this.forcedPartialDirections={},!t||0===t.length)throw new C("BadArguments","No notes provided for beam.");if(1===t.length)throw new C("BadArguments","Too few notes for beam.");if(this._ticks=t[0].getIntrinsicTicks(),this._ticks>=st.durationToTicks("4"))throw new C("BadArguments","Beams can only be applied to notes shorter than a quarter note.");let i,s;this._stemDirection=t[0].getStemDirection();let n=this._stemDirection;if(e&&r(t[0]))n=Re(t);else if(e&&c(t[0])){const e=t.reduce((t,e)=>t+e.getStemDirection(),0);n=e>-1?ot.UP:ot.DOWN}for(i=0;i<t.length;++i)s=t[i],e&&(s.setStemDirection(n),this._stemDirection=n),s.setBeam(this);this.postFormatted=!1,this.notes=t,this._beamCount=this.getBeamCount(),this.breakOnIndexes=[],this.renderOptions={beamWidth:5,maxSlope:.25,minSlope:-.25,slopeIterations:20,slopeCost:100,showStemlets:!1,stemletExtension:7,partialBeamLength:10,flatBeams:!1,minFlatBeamOffset:15}}getNotes(){return this.notes}getBeamCount(){return this.notes.map(t=>t.getGlyphProps().beamCount).reduce((t,e)=>e>t?e:t)}breakSecondaryAt(t){return this.breakOnIndexes=t,this}setPartialBeamSideAt(t,e){return this.forcedPartialDirections[t]=e,this}unsetPartialBeamSideAt(t){return delete this.forcedPartialDirections[t],this}getSlopeY(t,e,i,s){return i+(t-e)*s}calculateSlope(){const{notes:t,renderOptions:{maxSlope:e,minSlope:i,slopeIterations:s,slopeCost:n}}=this,a=this._stemDirection,o=t[0],r=function(t,e){const i=t.getStemExtents().topY,s=t.getStemX();return(e.getStemExtents().topY-i)/(e.getStemX()-s)}(o,t[t.length-1]),h=(e-i)/s;let c=Number.MAX_VALUE,l=0,d=0;for(let s=i;s<=e;s+=h){let e=0,i=0;for(let n=1;n<t.length;++n){const r=t[n];if(r.hasStem()||r.isRest()){const t=this.getSlopeY(r.getStemX(),o.getStemX(),o.getStemExtents().topY,s)+i,h=r.getStemExtents().topY;if(h*a<t*a){const s=Math.abs(h-t);i+=s*-a,e+=s*n}else e+=(h-t)*a}}const h=r/2,u=n*Math.abs(h-s)+Math.abs(e);u<c&&(c=u,l=s,d=i)}this.slope=l,this.yShift=d}calculateFlatSlope(){const{notes:t,renderOptions:{beamWidth:e,minFlatBeamOffset:i,flatBeamOffset:s}}=this,n=this._stemDirection;let a=0,o=0,r=0,h=0;for(let e=0;e<t.length;e++){const i=t[e],s=i.getStemExtents().topY;a+=s,n===ot.DOWN&&h<s?(h=s,o=Math.max(...i.getYs()),r=i.getBeamCount()):n===ot.UP&&(0===h||h>s)&&(h=s,o=Math.min(...i.getYs()),r=i.getBeamCount())}let c=a/t.length;const l=i+r*e*1.5,d=o+l*-n;n===ot.DOWN&&c<d?c=o+l:n===ot.UP&&c>d&&(c=o-l),s?(n===ot.DOWN&&c>s||n===ot.UP&&c<s)&&(this.renderOptions.flatBeamOffset=c):this.renderOptions.flatBeamOffset=c,this.slope=0,this.yShift=0}getBeamYToDraw(){let t=this.notes[0].getStemExtents().topY;return this.renderOptions.flatBeams&&this.renderOptions.flatBeamOffset&&(t=this.renderOptions.flatBeamOffset),t}applyStemExtensions(){const{notes:t,slope:e,renderOptions:{showStemlets:i,stemletExtension:s,beamWidth:n}}=this,a=this.yShift,o=this._beamCount,r=t[0],h=this.getBeamYToDraw(),c=r.getStemX();for(let r=0;r<t.length;++r){const l=t[r],d=l.getStem();if(d){const t=l.getStemX(),{topY:r}=l.getStemExtents(),u=this.getSlopeY(t,c,h,e)+a,g=d.getExtension(),p=l.getStemDirection()===ot.UP?r-u:u-r;let m=0;if(l.getStemDirection()!==this._stemDirection){m=(1+1.5*(l.getGlyphProps().beamCount-1))*this.renderOptions.beamWidth}if(d.setExtension(g+p+m),d.adjustHeightForBeam(),l.isRest()&&i){const t=(o-1)*n*1.5+n;d.setVisibility(!0).setStemlet(!0,t+s)}}}}lookupBeamDirection(t,e,i,s,n){if("4"===t)return Pe;const a=this.forcedPartialDirections[n];if(a)return a;const o=""+st.durationToNumber(t)/2,r=e<st.durationToTicks(o),h=s<st.durationToTicks(o),c=i<st.durationToTicks(o);return r&&h&&c?Me:r&&!h&&c?Pe:!r&&h&&c?"R":this.lookupBeamDirection(o,e,i,s,n)}getBeamLines(t){const e=st.durationToTicks(t);let i=!1;const s=[];let n;const a=this.renderOptions.partialBeamLength;let o=!1,r=0;for(let h=0;h<this.notes.length;++h){const c=this.notes[h];r+=c.getTicks().value();let l=!1;parseInt(t,10)>=8&&(l=-1!==this.breakOnIndexes.indexOf(h),this.renderOptions.secondaryBreakTicks&&r>=this.renderOptions.secondaryBreakTicks&&(r=0,l=!0));const d=c.getIntrinsicTicks()<e,u=c.getStemX()-ot.WIDTH/2,g=this.notes[h-1],p=this.notes[h+1],m=p&&p.getIntrinsicTicks()<e,f=g&&g.getIntrinsicTicks()<e,S=g&&p&&d&&!f&&!m;if(d)if(i)n=s[s.length-1],n.end=u,l&&(i=!1,p&&!m&&void 0===n.end&&(n.end=n.start-a));else{if(n={start:u,end:void 0},i=!0,S){const e=g.getIntrinsicTicks(),i=p.getIntrinsicTicks(),s=c.getIntrinsicTicks(),o=this.lookupBeamDirection(t,e,s,i,h);[Pe,Me].includes(o)?n.end=n.start-a:n.end=n.start+a}else m?l&&(n.end=n.start-a,i=!1):n.end=(o||0===h)&&p?n.start+a:n.start-a;s.push(n)}else i=!1;o=l}const h=s[s.length-1];return h&&void 0===h.end&&(h.end=h.start-a),s}drawStems(t){this.notes.forEach(e=>{const i=e.getStem();if(i){const s=e.getStemX();i.setNoteHeadXBounds(s,s),i.setContext(t).drawWithStyle()}},this)}drawBeamLines(t){const e=["4","8","16","32","64","128","256","512","1024"],i=this.notes[0];let s=this.getBeamYToDraw();const n=i.getStemX(),a=this.renderOptions.beamWidth*this._stemDirection;for(let i=0;i<e.length;++i){const o=e[i],r=this.getBeamLines(o);for(let e=0;e<r.length;++e){const i=r[e],o=i.start,h=this.getSlopeY(o,n,s,this.slope),c=i.end;if(!c)throw new C("NoLastBeamX","lastBeamX undefined.");{const e=this.getSlopeY(c,n,s,this.slope);t.beginPath(),t.moveTo(o,h),t.lineTo(o,h+a),t.lineTo(c+1,e+a),t.lineTo(c+1,e),t.closePath(),t.fill()}}s+=1.5*a}}preFormat(){return this}postFormat(){this.postFormatted||(c(this.notes[0])||this.renderOptions.flatBeams?this.calculateFlatSlope():this.calculateSlope(),this.applyStemExtensions(),this.postFormatted=!0)}draw(){const t=this.checkContext();if(this.setRendered(),this.unbeamable)return;this.postFormatted||this.postFormat();const e=this.getAttribute("class");t.openGroup("beam"+(e?" "+e:""),this.getAttribute("id")),this.drawStems(t),this.drawBeamLines(t),this.drawPointerRect(),t.closeGroup()}}class He extends yt{static get CATEGORY(){return l.ClefNote}constructor(t,e="default",i){super({duration:"b"}),this.setType(t,e,i),this.ignoreTicks=!0}setType(t,e,i){return this.clef=new me(t,e,i),this.setWidth(this.clef.getWidth()),this}getClef(){return this.clef}preFormat(){return this.preFormatted=!0,this}draw(){const t=this.checkStave(),e=this.checkContext();this.setRendered(),this.clef.setX(this.getAbsoluteX()),this.clef.setY(t.getYForLine(this.clef.line)),this.clef.renderText(e,0,0)}getBoundingBox(){return this.clef.getBoundingBox()}}class We extends yt{static get CATEGORY(){return l.Crescendo}constructor(t){var e;super(t),this.options={extendLeft:0,extendRight:0,yShift:0},this.decrescendo=!1,this.line=null!==(e=t.line)&&void 0!==e?e:0,this.height=15}setLine(t){return this.line=t,this}setHeight(t){return this.height=t,this}setDecrescendo(t){return this.decrescendo=t,this}preFormat(){return this.preFormatted=!0,this}draw(){const t=this.checkContext(),e=this.checkStave();this.setRendered();const i=this.getTickContext(),s=Ee.getNextContext(i),n=this.getAbsoluteX(),a=s?s.getX():e.getX()+e.getWidth(),o=e.getYForLine(this.line+-3)+1;!function(...t){We.DEBUG&&B("VexFlow.Crescendo",t)}("Drawing ",this.decrescendo?"decrescendo ":"crescendo ",this.height,"x",n-a),function(t,e){const i=e.beginX,s=e.endX,n=e.y,a=e.height/2;t.beginPath(),e.reverse?(t.moveTo(i,n-a),t.lineTo(s,n),t.lineTo(i,n+a)):(t.moveTo(s,n-a),t.lineTo(i,n),t.lineTo(s,n+a)),t.stroke(),t.closePath()}(t,{beginX:n-this.options.extendLeft,endX:a+this.options.extendRight,y:o+this.options.yShift,height:this.height,reverse:this.decrescendo})}}function Ge(t,e,i,s){const n=[t,s],a=3*e-t-3*i+s,o=2*(t-2*e+i),r=e-t,h=[];if(Math.abs(a)<1e-12)Math.abs(o)>1e-12&&h.push(-r/o);else{const t=o*o-4*a*r;if(t>=0){const e=Math.sqrt(t);h.push((-o+e)/(2*a),(-o-e)/(2*a))}}for(const a of h)if(a>0&&a<1){const o=1-a;n.push(o*o*o*t+3*o*o*a*e+3*o*a*a*i+a*a*a*s)}return n}var Ue;We.DEBUG=!1,function(t){t[t.NEAR_HEAD=1]="NEAR_HEAD",t[t.NEAR_TOP=2]="NEAR_TOP"}(Ue||(Ue={}));class Ve extends X{static get CATEGORY(){return l.Curve}static get Position(){return Ue}static get PositionString(){return{nearHead:Ue.NEAR_HEAD,nearTop:Ue.NEAR_TOP}}constructor(t,e,i){super(),this.renderOptions=Object.assign({thickness:2,xShift:0,yShift:10,position:Ue.NEAR_HEAD,positionEnd:Ue.NEAR_HEAD,invert:!1,cps:[{x:0,y:10},{x:0,y:10}],openingDirection:"auto"},i),this.setNotes(t,e)}setNotes(t,e){if(!t&&!e)throw new C("BadArguments","Curve needs to have either `from` or `to` set.");return this.from=t,this.to=e,this}isPartial(){return!this.from||!this.to}getBezierPoints(t){const e=this.renderOptions.xShift,i=this.renderOptions.yShift*t.direction,s=t.firstX+e,n=t.firstY+i,a=t.lastX-e,o=t.lastY+i,r=this.renderOptions.thickness,h=this.renderOptions.cps,{x:c,y:l}=h[0],{x:d,y:u}=h[1],g=(a-s)/(h.length+2);return{first:{x:s,y:n},last:{x:a,y:o},cps:[{x:s+g+c,y:n+l*t.direction},{x:a-g+d,y:o+u*t.direction}],thicknessCps:[{x:a-g+d,y:o+(u+r)*t.direction},{x:s+g+c,y:n+(l+r)*t.direction}]}}renderCurve(t){var e,i;const s=this.checkContext(),{first:n,last:a,cps:o,thicknessCps:r}=this.getBezierPoints(t);s.beginPath(),s.moveTo(n.x,n.y),s.bezierCurveTo(o[0].x,o[0].y,o[1].x,o[1].y,a.x,a.y),(null===(e=this.style)||void 0===e?void 0:e.lineDash)||s.bezierCurveTo(r[0].x,r[0].y,r[1].x,r[1].y,n.x,n.y),s.stroke(),s.closePath(),(null===(i=this.style)||void 0===i?void 0:i.lineDash)||s.fill()}getRenderParams(){const t=this.from,e=this.to;let i,s,n,a,o=0,r="baseY",h="baseY";function c(t){return"string"==typeof t?Ve.PositionString[t]:t}const l=c(this.renderOptions.position),d=c(this.renderOptions.positionEnd);if(l===Ue.NEAR_TOP&&(r="topY",h="topY"),d===Ue.NEAR_HEAD?h="baseY":d===Ue.NEAR_TOP&&(h="topY"),t)i=t.getTieRightX(),o=t.getStemDirection(),n=t.getStemExtents()[r];else{i=e.checkStave().getTieStartX(),n=e.getStemExtents()[r]}if(e)s=e.getTieLeftX(),o=e.getStemDirection(),a=e.getStemExtents()[h];else{s=t.checkStave().getTieEndX(),a=t.getStemExtents()[h]}return"up"===this.renderOptions.openingDirection&&(o=1),"down"===this.renderOptions.openingDirection&&(o=-1),{firstX:i,lastX:s,firstY:n,lastY:a,direction:o*(!0===this.renderOptions.invert?-1:1)}}getBoundingBox(){var t;const{first:e,last:i,cps:s,thicknessCps:n}=this.getBezierPoints(this.getRenderParams()),a=Ge(e.x,s[0].x,s[1].x,i.x),o=Ge(e.y,s[0].y,s[1].y,i.y);(null===(t=this.style)||void 0===t?void 0:t.lineDash)||(a.push(...Ge(i.x,n[0].x,n[1].x,e.x)),o.push(...Ge(i.y,n[0].y,n[1].y,e.y)));const r=Math.min(...a),h=Math.min(...o);return new P(r,h,Math.max(...a)-r,Math.max(...o)-h)}draw(){return this.checkContext(),this.setRendered(),this.renderCurve(this.getRenderParams()),!0}}function Xe(...t){_e.DEBUG&&B("VexFlow.Parser",t)}function Ye(t){if("matchedString"in t)return t.matchedString;if("results"in t)return Ye(t.results);const e=t;return 1===e.length?Ye(e[0]):0===e.length?null:e.map(Ye)}class _e{constructor(t){this.grammar=t,this.line="",this.pos=0,this.errorPos=-1}parse(t){this.line=t,this.pos=0,this.errorPos=-1;const e=this.expect(this.grammar.begin());return e.errorPos=this.errorPos,e}matchFail(t){-1===this.errorPos&&(this.errorPos=this.pos),this.pos=t}matchSuccess(){this.errorPos=-1}matchToken(t,e=!1){const i=e?new RegExp("^(("+t+"))"):new RegExp("^(("+t+")\\s*)"),s=this.line.slice(this.pos).match(i);return null!==s?{success:!0,matchedString:s[2],incrementPos:s[1].length,pos:this.pos}:{success:!1,pos:this.pos}}expectOne(t,e=!1){const i=[],s=this.pos;let n=!0,a=!1;if(e=!0===e||!0===t.maybe,t.expect)for(const e of t.expect){const s=this.pos,o=this.expect(e);if(o.success){if(i.push(o),a=!0,t.or)break}else if(n=!1,!t.or){this.pos=s;break}}const o=t.or&&a||n,r=o||!0===e,h=o?1:0;return e&&!o&&(this.pos=s),r?this.matchSuccess():this.matchFail(s),{success:r,results:i,numMatches:h}}expectOneOrMore(t,e=!1){const i=[],s=this.pos;let n=0,a=!0;do{const e=this.expectOne(t);e.success&&e.results?(n++,i.push(e.results)):a=!1}while(a);const o=n>0||!0===e;return!e||n>0||(this.pos=s),o?this.matchSuccess():this.matchFail(s),{success:o,results:i,numMatches:n}}expectZeroOrMore(t){return this.expectOneOrMore(t,!0)}expect(t){if(Xe("Evaluating rule function:",t),!t)throw new C("Invalid rule function");let e;const i=t.bind(this.grammar)();if(i.token)e=this.matchToken(i.token,!0===i.noSpace),e.success&&(this.pos+=e.incrementPos);else{if(!i.expect)throw Xe(i),new C("Bad grammar! No `token` or `expect` property "+i);e=i.oneOrMore?this.expectOneOrMore(i):i.zeroOrMore?this.expectZeroOrMore(i):this.expectOne(i)}const s=[];return e.matches=s,e.results&&e.results.forEach(t=>s.push(Ye(t))),i.run&&e.success&&i.run({matches:s}),e}}function ze(...t){Ze.DEBUG&&B("VexFlow.EasyScore",t)}_e.DEBUG=!1;class je{constructor(t){this.builder=t}begin(){return this.LINE}LINE(){return{expect:[this.PIECE,this.PIECES,this.EOL]}}PIECE(){return{expect:[this.CHORDORNOTE,this.PARAMS],run:()=>this.builder.commitPiece()}}PIECES(){return{expect:[this.COMMA,this.PIECE],zeroOrMore:!0}}PARAMS(){return{expect:[this.DURATION,this.TYPE,this.DOTS,this.OPTS]}}CHORDORNOTE(){return{expect:[this.CHORD,this.SINGLENOTE],or:!0}}CHORD(){return{expect:[this.LPAREN,this.NOTES,this.RPAREN],run:t=>this.builder.addChord(t.matches[1])}}NOTES(){return{expect:[this.NOTE],oneOrMore:!0}}NOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE]}}SINGLENOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE],run:t=>{const e=t;this.builder.addSingleNote(e.matches[0],e.matches[1],e.matches[2])}}}ACCIDENTAL(){return{expect:[this.MICROTONES,this.ACCIDENTALS],maybe:!0,or:!0}}DOTS(){return{expect:[this.DOT],zeroOrMore:!0,run:t=>this.builder.setNoteDots(t.matches)}}TYPE(){return{expect:[this.SLASH,this.MAYBESLASH,this.TYPES],maybe:!0,run:t=>this.builder.setNoteType(t.matches[2])}}DURATION(){return{expect:[this.SLASH,this.DURATIONS],maybe:!0,run:t=>this.builder.setNoteDuration(t.matches[1])}}OPTS(){return{expect:[this.LBRACKET,this.KEYVAL,this.KEYVALS,this.RBRACKET],maybe:!0}}KEYVALS(){return{expect:[this.COMMA,this.KEYVAL],zeroOrMore:!0}}KEYVAL(){return{expect:[this.KEY,this.EQUALS,this.VAL],run:t=>this.builder.addNoteOption(t.matches[0],t.matches[2].slice(1,-1))}}VAL(){return{expect:[this.SVAL,this.DVAL],or:!0}}KEY(){return{token:"[a-zA-Z][a-zA-Z0-9]*"}}DVAL(){return{token:'["][^"]*["]'}}SVAL(){return{token:"['][^']*[']"}}NOTENAME(){return{token:"[a-gA-G]"}}OCTAVE(){return{token:"[0-9]+"}}ACCIDENTALS(){return{token:"bb|b|##|#|n"}}MICROTONES(){return{token:"bbs|bss|bs|db|d|\\+\\+-|\\+-|\\+\\+|\\+|k|o"}}DURATIONS(){return{token:"[0-9whq]+"}}TYPES(){return{token:"[rRsSmMhHgG]"}}LPAREN(){return{token:"[(]"}}RPAREN(){return{token:"[)]"}}COMMA(){return{token:"[,]"}}DOT(){return{token:"[.]"}}SLASH(){return{token:"[/]"}}MAYBESLASH(){return{token:"[/]?"}}EQUALS(){return{token:"[=]"}}LBRACKET(){return{token:"\\["}}RBRACKET(){return{token:"\\]"}}EOL(){return{token:"$"}}}class qe{constructor(t){this.chord=[],this.dots=0,this.options={},this.duration=t}}class Ke{constructor(t){this.commitHooks=[],this.factory=t,this.reset()}reset(t){var e;this.options=Object.assign({stem:"auto",clef:"treble"},t),this.elements={notes:[],accidentals:[]},this.rollingDuration=null!==(e=null==t?void 0:t.duration)&&void 0!==e?e:"8",this.resetPiece()}getFactory(){return this.factory}getElements(){return this.elements}addCommitHook(t){this.commitHooks.push(t)}resetPiece(){ze("resetPiece"),this.piece=new qe(this.rollingDuration)}setNoteDots(t){ze("setNoteDots:",t),t&&(this.piece.dots=t.length)}setNoteDuration(t){ze("setNoteDuration:",t),this.rollingDuration=this.piece.duration=t||this.rollingDuration}setNoteType(t){ze("setNoteType:",t),t&&(this.piece.type=t)}addNoteOption(t,e){ze("addNoteOption: key:",t,"value:",e),this.piece.options[t]=e}addNote(t,e,i){ze("addNote:",t,e,i),this.piece.chord.push({key:t,accid:e,octave:i})}addSingleNote(t,e,i){ze("addSingleNote:",t,e,i),this.addNote(t,e,i)}addChord(t){ze("startChord"),"object"!=typeof t[0]?this.addSingleNote(t[0]):t.forEach(t=>{t&&this.addNote(...t)}),ze("endChord")}commitPiece(){ze("commitPiece");const{factory:t}=this;if(!t)return;const e=Object.assign(Object.assign({},this.options),this.piece.options),i=v(e.stem,"BadArguments","options.stem is not defined").toLowerCase(),s=v(e.clef,"BadArguments","options.clef is not defined").toLowerCase(),{chord:n,duration:a,dots:o,type:r}=this.piece,h=j.accidentals,c=n.map(t=>{var e;return t.key+(h.includes(null!==(e=t.accid)&&void 0!==e?e:"")?t.accid:"")+"/"+t.octave}),l="auto"===i,d="g"===(null==r?void 0:r.toLowerCase())?t.GhostNote({duration:a,dots:o}):t.StaveNote({keys:c,duration:a,dots:o,type:r,clef:s,autoStem:l});l||d.setStemDirection("up"===i?ot.UP:ot.DOWN);const u=[];n.forEach((e,i)=>{const s=e.accid;if("string"==typeof s){const e=t.Accidental({type:s});d.addModifier(e,i),u.push(e)}else u.push(void 0)});for(let t=0;t<o;t++)Mt.buildAndAttach([d],{all:!0});this.commitHooks.forEach(t=>t(e,d,this)),this.elements.notes.push(d),this.elements.accidentals.push(u),this.resetPiece()}}function $e(t,e){void 0!==t.id&&e.setAttribute("id",t.id)}const Qe=/\s*,\s*/;function Je(t,e){void 0!==t.class&&t.class.split(Qe).forEach(t=>e.addClass(t))}class Ze{constructor(t={}){this.defaults={clef:"treble",time:"4/4",stem:"auto"},this.setOptions(t)}set(t){return this.defaults=Object.assign(Object.assign({},this.defaults),t),this}setOptions(t){var e,i;const s=t.factory,n=null!==(e=t.builder)&&void 0!==e?e:new Ke(s);return this.options=Object.assign(Object.assign({commitHooks:[$e,Je,xt.easyScoreHook,It.easyScoreHook],throwOnError:!1},t),{factory:s,builder:n}),this.factory=s,this.builder=n,this.grammar=new je(this.builder),this.parser=new _e(this.grammar),null===(i=this.options.commitHooks)||void 0===i||i.forEach(t=>this.addCommitHook(t)),this}setContext(t){return this.factory.setContext(t),this}parse(t,e={}){this.builder.reset(e);const i=this.parser.parse(t);if(!i.success&&this.options.throwOnError)throw ze(i),new C("Error parsing line: "+t);return i}beam(t,e){return this.factory.Beam({notes:t,options:e}),t}tuplet(t,e){return this.factory.Tuplet({notes:t,options:e}),t}notes(t,e={}){return e=Object.assign({clef:this.defaults.clef,stem:this.defaults.stem},e),this.parse(t,e),this.builder.getElements().notes}measures(t,e={}){const i=[];let s=0,n="";for(let e=0;e<t.length;e++){const a=t[e];n?a===n&&(n=""):'"'===a||"'"===a?n=a:"|"===a&&(i.push(t.slice(s,e)),s=e+1)}i.push(t.slice(s));const a=i.map((t,e)=>{let s=t.trim();if(e>0&&(s=s.replace(/^,\s*/,"")),e<i.length-1&&(s=s.replace(/\s*,$/,"")),!s)throw new C("BadArguments","Empty EasyScore measure. Use an explicit rest.");return s});let o=e.duration;return a.map(t=>{if(!this.parse(t,Object.assign(Object.assign({clef:this.defaults.clef,stem:this.defaults.stem},e),{duration:o})).success)throw new C("BadArguments",`Invalid EasyScore measure: ${t}`);return o=this.builder.rollingDuration,this.builder.getElements().notes})}voice(t,e={}){return e=Object.assign({time:this.defaults.time},e),this.factory.Voice(e).addTickables(t)}addCommitHook(t){this.builder.addCommitHook(t)}}Ze.DEBUG=!1;const ti="Ghost note must have valid initialization data to identify duration.";class ei extends Gt{static get CATEGORY(){return l.GhostNote}constructor(t){if(!t)throw new C("BadArguments",ti);let e;if("string"==typeof t)e={duration:t};else{if("object"!=typeof t)throw new C("BadArguments",ti);e=t}super(e),this.setWidth(0)}isRest(){return!0}setStave(t){return super.setStave(t),this}addToModifierContext(t){return this}preFormat(){return this.preFormatted=!0,this}draw(){this.setRendered();for(let t=0;t<this.modifiers.length;++t){const e=this.modifiers[t];s(e)&&(e.setContext(this.getContext()),e.drawWithStyle())}}}class ii extends yt{static get CATEGORY(){return l.GlyphNote}constructor(t,e,i){super(e),this.options=Object.assign({ignoreTicks:!1,line:2},i),this.ignoreTicks=this.options.ignoreTicks,this.setGlyph(t)}setGlyph(t){return this.text=t,this}preFormat(){return!this.preFormatted&&this.modifierContext&&this.modifierContext.preFormat(),this.preFormatted=!0,this}drawModifiers(){const t=this.checkContext();for(let e=0;e<this.modifiers.length;e++){const i=this.modifiers[e];i.setContext(t),i.drawWithStyle()}}draw(){const t=this.checkStave(),e=t.checkContext();this.setRendered();const i=this.getAttribute("class");e.openGroup("glyphNote"+(i?" "+i:""),this.getAttribute("id")),this.x=this.isCenterAligned()?this.getAbsoluteX()-this.getWidth()/2:this.getAbsoluteX(),this.y=t.getYForLine(this.options.line),this.renderText(e,0,0),this.drawModifiers(),this.drawPointerRect(),e.closeGroup()}}class si extends Vt{static get CATEGORY(){return l.GraceNote}static get LEDGER_LINE_OFFSET(){return 2}constructor(t){super(Object.assign({strokePx:si.LEDGER_LINE_OFFSET},t)),this.slash=t.slash||!1,this.slur=!0,this.buildNoteHeads(),this.width=3}getStemExtension(){if(this.stemExtensionOverride)return this.stemExtensionOverride;let t=super.getStemExtension();return t=ot.HEIGHT*this.getFontScale()-ot.HEIGHT+t,t}draw(){super.draw(),this.setRendered();const t=this.stem;if(this.slash&&t){const t=this.getFontScale();let e;const i=this.beam;if(i)i.postFormatted||i.postFormat(),e=this.calcBeamedNotesSlashBBox(8*t,8*t,{stem:6*t,beam:5*t});else{const i=this.getStemDirection(),s=this.getNoteHeadBounds(),n=this.noteHeads[0].getWidth(),a=i===ot.DOWN?this.getAbsoluteX():this.getAbsoluteX()+n,o=st.STEM_HEIGHT*t/2,r=i===ot.DOWN?s.yBottom+o:s.yTop-o;e=i===ot.DOWN?{x1:a-n,y1:r-n,x2:a+n,y2:r+n}:{x1:a-n,y1:r+n,x2:a+n,y2:r-n}}const s=this.checkContext();s.setLineWidth(1*t),s.beginPath(),s.moveTo(e.x1,e.y1),s.lineTo(e.x2,e.y2),s.closePath(),s.stroke()}}calcBeamedNotesSlashBBox(t,e,i){const s=this.beam;if(!s)throw new C("NoBeam","Can't calculate without a beam.");const n=s.slope,a=s.notes[s.notes.length-1]===this?-1:1,o=Math.atan(n*a),r=Math.cos(o)*e,h=Math.sin(o)*e;t*=this.getStemDirection();const c=Math.atan((h-t)/r),l=Math.cos(c)*i.stem*a,d=Math.sin(c)*i.stem,u=Math.cos(c)*i.beam*a,g=Math.sin(c)*i.beam,p=this.getStemX(),m=s.notes[0].getStemX(),f=s.getBeamYToDraw()+(p-m)*n;return{x1:p-l,y1:f+t-d,x2:p+r*a+u,y2:f+h+g}}}class ni extends yt{static get CATEGORY(){return l.KeySigNote}constructor(t,e,i){super({duration:"b"}),this.keySignature=new fe(t,e,i),this.ignoreTicks=!0}addToModifierContext(t){return this}preFormat(){return this.preFormatted=!0,this.keySignature.setStave(this.checkStave()),this.setWidth(this.keySignature.getWidth()),this}draw(){const t=this.checkStave().checkContext();this.setRendered(),this.keySignature.setX(this.getAbsoluteX()),this.keySignature.setContext(t),this.keySignature.drawWithStyle()}}class ai extends X{static get CATEGORY(){return l.MultiMeasureRest}constructor(t,e){var i;super(),this.xs={left:NaN,right:NaN},this.hasPaddingLeft=!1,this.hasPaddingRight=!1,this.hasLineThickness=!1,this.hasSymbolSpacing=!1;const s=null!==(i=e.numberGlyphPoint)&&void 0!==i?i:O.get("MultiMeasureRest.fontSize");this.fontInfo.size=s,this.numberOfMeasures=t,this.text="";const n=`${this.numberOfMeasures}`;for(const t of n)this.text+=String.fromCodePoint(57472+Number(t));this.hasPaddingLeft="number"==typeof e.paddingLeft,this.hasPaddingRight="number"==typeof e.paddingRight,this.hasLineThickness="number"==typeof e.lineThickness,this.hasSymbolSpacing="number"==typeof e.symbolSpacing,this.renderOptions=Object.assign({useSymbols:!1,showNumber:!0,numberLine:-.5,numberGlyphPoint:s,line:2,spacingBetweenLinesPx:st.STAVE_LINE_DISTANCE,serifThickness:2,semibreveRestGlyphScale:O.get("fontSize"),paddingLeft:0,paddingRight:0,lineThickness:5,symbolSpacing:0},e)}getXs(){return this.xs}setStave(t){return this.stave=t,this}getStave(){return this.stave}checkStave(){return v(this.stave,"NoStave","No stave attached to instance.")}drawLine(t,e,i,s){const n=this.renderOptions,a=t.getYForLine(n.line),o=.1*(s-i);i+=o,s-=o;let r="";const h=new X;h.setText(r);const c=h.getWidth();if(!c)throw new C("Cannot drawLine if width is 0");for(let t=1;(t+2)*c+i<=s;t++)r+="";r+="",h.setText(r),h.renderText(e,i+.5*(s-i)-.5*h.getWidth(),a)}drawSymbols(t,e,i,s){const n=Math.floor(this.numberOfMeasures/4),a=this.numberOfMeasures%4,o=Math.floor(a/2),r=a%2,h=this.renderOptions,c=new X;let l="";for(let t=0;t<n;++t)l+=_.restLonga+" ";for(let t=0;t<o;++t)l+=_.restDoubleWhole+" ";c.setText(l);const d=new X;l="";for(let t=0;t<r;++t)l+=_.restWhole+" ";d.setText(l);let u=i+.5*(s-i)-.5*(c.getWidth()+d.getWidth());const g=h.line,p=t.getYForLine(g-1),m=t.getYForLine(g);c.renderText(e,u,m),u+=c.getWidth(),d.renderText(e,u,p),u+=d.getWidth()}draw(){const t=this.checkContext();this.setRendered();const e=this.checkStave();let i=e.getNoteStartX(),s=e.getNoteEndX();const a=e.getModifiers(Ct.BEGIN);1===a.length&&n(a[0])&&(i-=a[0].getWidth());const o=this.renderOptions;this.hasPaddingLeft&&(i=e.getX()+o.paddingLeft),this.hasPaddingRight&&(s=e.getX()+e.getWidth()-o.paddingRight),this.xs.left=i,this.xs.right=s,o.useSymbols?this.drawSymbols(e,t,i,s):this.drawLine(e,t,i,s),o.showNumber&&this.renderText(t,i+.5*(s-i)-.5*this.width,e.getYForLine(o.numberLine)-.5*this.height)}}class oi extends X{static get CATEGORY(){return l.PedalMarking}static createSustain(t){return new oi(t)}static createSostenuto(t){const e=new oi(t);return e.setType(oi.type.MIXED),e.setCustomText("Sost. Ped."),e}static createUnaCorda(t){const e=new oi(t);return e.setType(oi.type.TEXT),e.setCustomText("una corda","tre corda"),e}constructor(t){super(),this.notes=t,this.type=oi.type.TEXT,this.line=0,this.depressText=oi.GLYPHS.pedalDepress,this.releaseText=oi.GLYPHS.pedalRelease,this.renderOptions={bracketHeight:10,textMarginRight:6,bracketLineWidth:1}}setType(t){return(t="string"==typeof t?oi.typeString[t]:t)>=oi.type.TEXT&&t<=oi.type.MIXED&&(this.type=t),this}setCustomText(t,e){return this.depressText=t||"",this.releaseText=e||"",this.setFont(O.getFontInfo("PedalMarking.text")),this}setLine(t){return this.line=t,this}getYForStave(t){let e=t.getYForBottomText(this.line+3);const i=this.notes.filter(e=>e.getStave()===t);if(!i.length)return e;const n=Math.min(...i.map(t=>t.getAbsoluteX())),a=Math.max(...i.map(t=>t.getAbsoluteX())),o=new Set(i.map(t=>t.getVoice())),h=new X("PedalMarking").setFont(this.fontInfo),c=Math.max(h.setText(this.depressText).getTextMetrics().actualBoundingBoxAscent,h.setText(this.releaseText).getTextMetrics().actualBoundingBoxAscent),l=this.type===oi.type.BRACKET?this.renderOptions.bracketHeight:Math.max(c,this.type===oi.type.MIXED?this.renderOptions.bracketHeight:0);for(const i of o)for(const o of i.getTickables())if(r(o)&&o.getStave()===t&&!(o.getAbsoluteX()<n||o.getAbsoluteX()>a))for(const t of o.getModifiers()){if(!s(t)||t.getVerticalJustification()!==ct.VerticalJustify.BOTTOM)continue;const i=t.computeY().y+t.getYShift()+t.getTextMetrics().actualBoundingBoxDescent;e=Math.max(e,i+4+l)}return e}drawBracketed(){const t=this.checkContext();let e,i,s=!1,n=0;const a=new Map(this.notes.map(t=>[t.checkStave(),0]));for(const t of a.keys())a.set(t,this.getYForStave(t));this.notes.forEach((o,r,h)=>{var c,l,d,u;s=!s;const g=o.getAbsoluteX(),p=a.get(o.checkStave());if(g<e)throw new C("InvalidConfiguration","The notes provided must be in order of ascending x positions");const m=h[r+1]===o,f=h[r-1]===o;let S=0;if(s)S=f?5:0,this.type!==oi.type.MIXED||f?(t.beginPath(),t.moveTo(g,p-this.renderOptions.bracketHeight),t.lineTo(g+S,p),t.stroke(),t.closePath()):(n=t.measureText(this.depressText).width,t.fillText(this.depressText,g,p),S=n+this.renderOptions.textMarginRight);else{const s=o.getVoice().getTickables().indexOf(o),n=s+1<o.getVoice().getTickables().length?o.getVoice().getTickables()[s+1].getAbsoluteX():(null!==(l=null===(c=o.getStave())||void 0===c?void 0:c.getX())&&void 0!==l?l:0)+(null!==(u=null===(d=o.getStave())||void 0===d?void 0:d.getWidth())&&void 0!==u?u:0);t.beginPath(),t.moveTo(e,i),t.lineTo(m?g-5:n-5,p),t.lineTo(m?g:n-5,p-this.renderOptions.bracketHeight),t.stroke(),t.closePath()}e=g+S,i=p})}drawText(){const t=this.checkContext();let e=!1,i=0;const s=new Map(this.notes.map(t=>[t.checkStave(),0]));for(const t of s.keys())s.set(t,this.getYForStave(t));this.notes.forEach(n=>{var a,o,r,h;e=!e;const c=n.checkStave(),l=n.getAbsoluteX(),d=s.get(c);if(e)i=t.measureText(this.depressText).width,t.fillText(this.depressText,l,d);else{const e=n.getVoice().getTickables().indexOf(n),s=e+1<n.getVoice().getTickables().length?n.getVoice().getTickables()[e+1].getAbsoluteX():(null!==(o=null===(a=n.getStave())||void 0===a?void 0:a.getX())&&void 0!==o?o:0)+(null!==(h=null===(r=n.getStave())||void 0===r?void 0:r.getWidth())&&void 0!==h?h:0);i=t.measureText(this.releaseText).width,t.fillText(this.releaseText,s-i,d)}})}draw(){const t=this.checkContext();this.setRendered(),void 0!==this.renderOptions.color&&(t.setStrokeStyle(this.renderOptions.color),t.setFillStyle(this.renderOptions.color)),this.applyStyle(t),t.setFont(this.font),function(...t){oi.DEBUG&&B("VexFlow.PedalMarking",t)}("Rendering Pedal Marking"),this.type===oi.type.BRACKET||this.type===oi.type.MIXED?(t.setLineWidth(this.renderOptions.bracketLineWidth),this.drawBracketed()):this.type===oi.type.TEXT&&this.drawText()}}oi.DEBUG=!1,oi.GLYPHS={pedalDepress:_.keyboardPedalPed,pedalRelease:_.keyboardPedalUp},oi.type={TEXT:1,BRACKET:2,MIXED:3},oi.typeString={text:oi.type.TEXT,bracket:oi.type.BRACKET,mixed:oi.type.MIXED};const ri={1:_.repeat1Bar,2:_.repeat2Bars,4:_.repeat4Bars,slash:_.repeatBarSlash};class hi extends ii{static get CATEGORY(){return l.RepeatNote}constructor(t,e,i){super(ri[t]||"",Object.assign({duration:"q",alignCenter:"slash"!==t},e),i)}}class ci{constructor(t){this.systems=[],this.rows=[],this.options=Object.assign({width:500,x:10,y:10,rowGap:40,measureGap:0,measurePadding:20,justify:!0},t),this.setWidth(this.options.width);for(const t of["x","y","rowGap","measureGap","measurePadding"])if(!Number.isFinite(this.options[t])||this.options[t]<0)throw new C("BadArgument",`Sheet ${t} must be a nonnegative finite number.`)}addSystem(t={}){const e=this.options.factory.System(Object.assign(Object.assign({},t),{autoWidth:!0,noJustification:!1}));return this.systems.push(e),e}setWidth(t){if(!Number.isFinite(t)||t<=0)throw new C("BadArgument","Sheet width must be a positive finite number.");return this.options.width=t,this}getSystems(){return this.systems.slice()}getRows(){return this.rows.map(t=>Object.assign(Object.assign({},t),{systems:t.systems.slice()}))}getHeight(){const t=this.rows[this.rows.length-1];return t?t.y+t.height:this.options.y}format(){const t=this.measureSystems();this.rows=[];let e=this.options.y;for(const i of this.packRows(t)){const s=this.formatRow(i,t,e);this.rows.push(s),e+=s.height+this.options.rowGap}return this}measureSystems(){return this.systems.map(t=>(t.setX(0).setY(0).setWidth(),t.format(),t.getWidth()+this.options.measurePadding))}packRows(t){const e=[];let i=[],s=0;return t.forEach((t,n)=>{const a=i.length?this.options.measureGap:0;i.length&&s+a+t>this.options.width&&(e.push(i),i=[],s=0),s+=(i.length?this.options.measureGap:0)+t,i.push(n)}),i.length&&e.push(i),e}verticalBounds(t){let e=0,i=t.getBoundingBox().getH();for(const s of t.getVoices())for(const t of s.getTickables()){const s=t.getBoundingBox();e=Math.min(e,s.getY()),i=Math.max(i,s.getY()+s.getH())}return{top:e,bottom:i}}formatRow(t,e,i){const s=t.reduce((t,i)=>t+e[i],0)+this.options.measureGap*(t.length-1),n=this.options.justify?Math.max(0,this.options.width-s)/t.length:0;let a=this.options.x,o=0,r=0;const h=t.map(t=>this.systems[t]);t.forEach(t=>{const i=this.systems[t];i.setX(a).setY(0).setWidth(e[t]+n),i.format();const s=this.verticalBounds(i);o=Math.min(o,s.top),r=Math.max(r,s.bottom),a+=i.getWidth()+this.options.measureGap});for(const t of h)t.setY(i-o),t.format();const c=a-this.options.x-this.options.measureGap;return{systems:h,x:this.options.x,y:i,width:c,height:r-o,overflow:Math.max(0,c-this.options.width)}}}function li(t,e,i,s,n,a,o){t.beginPath(),t.moveTo(e,i),t.lineTo(s,n),t.lineTo(a,o),t.lineTo(e,i),t.closePath(),t.fill()}class di extends X{static get CATEGORY(){return l.StaveLine}constructor(t){super(),this.setNotes(t),this.text="",this.renderOptions={paddingLeft:4,paddingRight:3,lineWidth:1,lineDash:void 0,roundedEnd:!0,color:void 0,drawStartArrow:!1,drawEndArrow:!1,arrowheadLength:10,arrowheadAngle:Math.PI/8,textPositionVertical:di.TextVerticalPosition.TOP,textJustification:di.TextJustification.CENTER}}setText(t){return this.text=t,this}setNotes(t){if(!t.firstNote&&!t.lastNote)throw new C("BadArguments","Notes needs to have either firstNote or lastNote set.");if(t.firstIndexes||(t.firstIndexes=[0]),t.lastIndexes||(t.lastIndexes=[0]),t.firstIndexes.length!==t.lastIndexes.length)throw new C("BadArguments","Connected notes must have same number of indexes.");return this.notes=t,this.firstNote=t.firstNote,this.firstIndexes=t.firstIndexes,this.lastNote=t.lastNote,this.lastIndexes=t.lastIndexes,this}applyLineStyle(){const t=this.checkContext(),e=this.renderOptions;e.lineDash&&t.setLineDash(e.lineDash),e.lineWidth&&t.setLineWidth(e.lineWidth),e.roundedEnd?t.setLineCap("round"):t.setLineCap("square")}drawArrowLine(t,e,i){const s=this.renderOptions.drawStartArrow&&this.renderOptions.drawEndArrow,n=e.x,a=e.y,o=i.x,r=i.y,h=Math.sqrt((o-n)*(o-n)+(r-a)*(r-a)),c=(h-this.renderOptions.arrowheadLength/3)/h;let l,d,u,g;this.renderOptions.drawEndArrow||s?(l=Math.round(n+(o-n)*c),d=Math.round(a+(r-a)*c)):(l=o,d=r),this.renderOptions.drawStartArrow||s?(u=n+(o-n)*(1-c),g=a+(r-a)*(1-c)):(u=n,g=a),this.renderOptions.color&&(t.setStrokeStyle(this.renderOptions.color),t.setFillStyle(this.renderOptions.color)),this.applyStyle(t),t.beginPath(),t.moveTo(u,g),t.lineTo(l,d),t.stroke(),t.closePath();const p=Math.atan2(r-a,o-n),m=Math.abs(this.renderOptions.arrowheadLength/Math.cos(this.renderOptions.arrowheadAngle));let f,S,T,x,w,b;(this.renderOptions.drawEndArrow||s)&&(f=p+Math.PI+this.renderOptions.arrowheadAngle,T=o+Math.cos(f)*m,x=r+Math.sin(f)*m,S=p+Math.PI-this.renderOptions.arrowheadAngle,w=o+Math.cos(S)*m,b=r+Math.sin(S)*m,li(t,T,x,o,r,w,b)),(this.renderOptions.drawStartArrow||s)&&(f=p+this.renderOptions.arrowheadAngle,T=n+Math.cos(f)*m,x=a+Math.sin(f)*m,S=p-this.renderOptions.arrowheadAngle,w=n+Math.cos(S)*m,b=a+Math.sin(S)*m,li(t,T,x,n,a,w,b))}draw(){const t=this.checkContext();this.setRendered();const e=this.firstNote,i=this.lastNote,s=this.renderOptions;this.applyLineStyle();let n={x:0,y:0},a={x:0,y:0};this.firstIndexes.forEach((o,r)=>{const h=this.lastIndexes[r];n=e.getModifierStartXY(2,o),a=i.getModifierStartXY(1,h);const c=n.y>a.y;n.x+=e.getMetrics().modRightPx+s.paddingLeft,a.x-=i.getMetrics().modLeftPx+s.paddingRight;const l=e.getGlyphWidth();e.getKeyProps()[o].displaced&&1===e.getStemDirection()&&(n.x+=l+s.paddingLeft);i.getKeyProps()[h].displaced&&-1===i.getStemDirection()&&(a.x-=l+s.paddingRight),n.y+=c?-3:1,a.y+=c?2:0,this.drawArrowLine(t,n,a)});const o=this.width,r=s.textJustification;let h=0;if(r===di.TextJustification.LEFT)h=n.x;else if(r===di.TextJustification.CENTER){h=(a.x-n.x)/2+n.x-o/2}else r===di.TextJustification.RIGHT&&(h=a.x-o);let c=0;const l=s.textPositionVertical;l===di.TextVerticalPosition.TOP?c=e.checkStave().getYForTopText():l===di.TextVerticalPosition.BOTTOM&&(c=e.checkStave().getYForBottomText(st.TEXT_HEIGHT_OFFSET_HACK));const d=s.color;this.applyStyle(t,{fillStyle:d,strokeStyle:d}),this.applyStyle(t),this.renderText(t,h,c)}}di.TextVerticalPosition={TOP:1,BOTTOM:2},di.TextJustification=re;class ui extends X{static get CATEGORY(){return l.System}constructor(t={}){super(),this.setOptions(t),this.partStaves=[],this.partStaveInfos=[],this.partVoices=[]}setOptions(t={}){if(!t.factory)throw new C("NoFactory","System.setOptions(options) requires a factory.");this.factory=t.factory,this.options=Object.assign(Object.assign({factory:this.factory,x:10,y:10,width:500,spaceBetweenStaves:12,autoWidth:!1,noJustification:!1,debugFormatter:!1,formatIterations:0,noPadding:!1},t),{details:Object.assign({alpha:.5},t.details),formatOptions:Object.assign({},t.formatOptions)}),!1===this.options.noJustification&&void 0===t.width&&(this.options.autoWidth=!0)}getX(){return this.options.x}setX(t){return this.options.x=t,this.partStaves.forEach(e=>{e.setX(t)}),this}getY(){return this.options.y}setY(t){return this.options.y=t,this.partStaves.forEach(e=>{e.setY(t)}),this}getStaves(){return this.partStaves}getVoices(){return this.partVoices}setWidth(t){if(void 0!==t&&(!Number.isFinite(t)||t<=0))throw new C("BadArgument","System width must be a positive finite number.");return this.options.autoWidth=void 0===t,void 0!==t&&(this.options.width=t,this.partStaves.forEach(e=>e.setWidth(t))),this}getWidth(){return this.options.width}setContext(t){return super.setContext(t),this.factory.setContext(t),this}addConnector(t="double"){return this.connector=this.factory.StaveConnector({topStave:this.partStaves[0],bottomStave:this.partStaves[this.partStaves.length-1],type:t}),this.connector}addStave(t){var e;const i=Object.assign({leftBar:!1},t.options),s=null!==(e=t.stave)&&void 0!==e?e:this.factory.Stave({x:this.options.x,y:this.options.y,width:this.options.width,options:i}),n=Object.assign(Object.assign({spaceAbove:0,spaceBelow:0,debugNoteMetrics:!1,noJustification:!1},t),{options:i}),a=this.getContext();return n.voices.forEach(t=>{t.setContext(a).setStave(s).getTickables().forEach(t=>t.setStave(s)),this.partVoices.push(t)}),this.partStaves.push(s),this.partStaveInfos.push(n),s}addVoices(t){const e=this.getContext();t.forEach(t=>{t.setContext(e),this.partVoices.push(t)})}format(){const t=this.options.details;let e=0;const i=new Fe(t);this.formatter=i;let s=this.options.y,n=0;const a=[];this.partStaves.forEach((t,e)=>{s+=t.space(this.partStaveInfos[e].spaceAbove),t.setY(s),s+=t.space(this.partStaveInfos[e].spaceBelow),s+=t.space(this.options.spaceBetweenStaves),this.partStaveInfos[e].debugNoteMetrics&&(a.push({y:s,stave:t}),s+=15),n=Math.max(n,t.getNoteStartX())}),this.partVoices.forEach(t=>{t.getTickables().forEach(t=>{const e=t.getStave();e&&t.setStave(e)})}),i.joinVoices(this.partVoices),this.partStaves.forEach(t=>t.setNoteStartX(n)),this.options.autoWidth&&this.partVoices.length>0?(e=i.preCalculateMinTotalWidth(this.partVoices),this.options.width=e+Be.rightPadding+(n-this.options.x),this.partStaves.forEach(t=>{t.setWidth(this.options.width)})):e=this.options.noPadding?this.options.width-(n-this.options.x):this.options.width-(n-this.options.x)-Be.defaultPadding,this.partVoices.length>0&&i.format(this.partVoices,this.options.noJustification?0:e,this.options.formatOptions),i.postFormat();for(let e=0;e<this.options.formatIterations;e++)i.tune(t);this.startX=n,this.debugNoteMetricsYs=a,this.lastY=s,Be.formatBegModifiers(this.partStaves)}getBoundingBox(){var t;return new P(this.options.x,this.options.y,this.options.width,(null!==(t=this.lastY)&&void 0!==t?t:0)-this.options.y)}draw(){const t=this.checkContext();if(!(this.formatter&&this.startX&&this.lastY&&this.debugNoteMetricsYs))throw new C("NoFormatter","format() must be called before draw()");this.setRendered(),this.options.debugFormatter&&Fe.plotDebugging(t,this.formatter,this.startX,this.options.y,this.lastY),this.debugNoteMetricsYs.forEach(e=>{this.partVoices.forEach(i=>{i.getTickables().forEach(i=>{i.getStave()===e.stave&&yt.plotMetrics(t,i,e.y)})})})}}class gi extends Gt{static get CATEGORY(){return l.TabNote}constructor(t,e=!1){super(t),this.fretElement=[],this.greatestString=()=>this.positions.map(t=>t.str).reduce((t,e)=>t>e?t:e),this.leastString=()=>this.positions.map(t=>t.str).reduce((t,e)=>t<e?t:e),this.ghost=!1,this.positions=t.positions||[],this.renderOptions=Object.assign(Object.assign({},this.renderOptions),{drawStem:e,drawDots:e,drawStemThroughStave:!1,yShift:0}),this.glyphProps=yt.getGlyphProps(this.duration,this.noteType),v(this.glyphProps,"BadArguments",`No glyph found for duration '${this.duration}' and type '${this.noteType}'`),this.buildStem(),t.stemDirection?this.setStemDirection(t.stemDirection):this.setStemDirection(ot.UP),this.ghost=!1,this.updateWidth()}reset(){return super.reset(),this.stave&&this.setStave(this.stave),this}setGhost(t){return this.ghost=t,this.updateWidth(),this}hasStem(){return!!this.renderOptions.drawStem}getStemExtension(){return void 0!==this.stemExtensionOverride?this.stemExtensionOverride:this.flag.getHeight()>ot.HEIGHT?this.flag.getHeight()-ot.HEIGHT:0}static tabToElement(t){let e;return"X"===t.toUpperCase()?(e=new X("TabNote"),e.setText(_.accidentalDoubleSharp)):(e=new X("TabNote.text"),e.setText(t),e.setYShift(e.getHeight()/2)),e}setFontSize(t){return super.setFontSize(t),this.fretFontSize=t,this.positions&&this.updateWidth(),this.preFormatted=!1,this}updateWidth(){this.fretElement=[],this.width=0;for(let t=0;t<this.positions.length;++t){let e=this.positions[t].fret;this.ghost&&(e="("+e+")");const i=gi.tabToElement(e.toString()),s=G.convertSizeToPointValue(O.getFontInfo("TabNote.text").size),n=void 0===this.fretFontSize?s*this.getFontScale():G.convertSizeToPointValue(this.fretFontSize);i.setFontSize(G.convertSizeToPointValue(i.fontInfo.size)*n/s);const a=i.getTextMetrics();i.setYShift((a.actualBoundingBoxAscent-a.actualBoundingBoxDescent)/2),this.fretElement.push(i),this.width=Math.max(i.getWidth(),this.width)}}setStave(t){super.setStave(t);const e=t.getContext();this.setContext(e);const i=this.positions.map(({str:e})=>t.getYForLine(Number(e)-1));return this.setYs(i),this.stem&&this.stem.setYBounds(this.getStemY(),this.getStemY()),this}getPositions(){return this.positions}getModifierStartXY(t,e){if(!this.preFormatted)throw new C("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(0===this.ys.length)throw new C("NoYValues","No Y-Values calculated for this note.");let i=0;if(t===z.Position.LEFT)i=-2;else if(t===z.Position.RIGHT)i=this.width+2;else if(t===z.Position.BELOW||t===z.Position.ABOVE){i=this.width/2}return{x:this.getAbsoluteX()+i,y:this.ys[e]}}getLineForRest(){return Number(this.positions[0].str)}preFormat(){this.preFormatted||(this.modifierContext&&this.modifierContext.preFormat(),this.preFormatted=!0)}getStemX(){return this.getCenterGlyphX()}getStemY(){const t=this.checkStave().getNumLines()-.5,e=ot.UP===this.stemDirection?-.5:t;return this.checkStave().getYForLine(e)}getStemExtents(){return this.checkStem().getExtents()}drawFlag(){const{beam:t,glyphProps:e,renderOptions:{drawStem:i}}=this,s=this.checkContext(),n=void 0===t&&i;if(e.codeFlagUp&&n){const t=this.getStemX(),e=this.getStemDirection()===ot.DOWN?this.getStemY()-this.checkStem().getHeight()-this.getStemExtension():this.getStemY()-this.checkStem().getHeight()+this.getStemExtension();this.flag.setContext(s).setX(t).setY(e).drawWithStyle()}}drawModifiers(){this.modifiers.forEach(t=>{i(t,l.Dot)&&!this.renderOptions.drawDots||(t.setContext(this.getContext()),t.drawWithStyle())})}drawStemThrough(){const t=this.getStemX(),e=this.getStemY(),i=this.checkContext(),s=this.renderOptions.drawStem,n=this.renderOptions.drawStemThroughStave;if(s&&n){const s=function(t,e){const i=[];let s=[];for(let n=1;n<=t;n++)e.indexOf(n)>-1?(i.push(s),s=[]):s.push(n);return s.length>0&&i.push(s),i}(this.checkStave().getNumLines(),this.positions.map(t=>Number(t.str))),n=function(t,e,i,s){const n=1!==s,a=-1!==s,o=i.getSpacingBetweenLines(),r=i.getNumLines(),h=[];return e.forEach(e=>{const c=e.indexOf(r)>-1,l=e.indexOf(1)>-1;if(n&&l||a&&c)return;1===e.length&&e.push(e[0]);const d=[];e.forEach((e,n,a)=>{const h=1===e,c=e===r;let l=i.getYForLine(e-1);0!==n||h?n!==a.length-1||c||(l+=o/2-1):l-=o/2-1,d.push(l),1===s&&h?d.push(t-2):-1===s&&c&&d.push(t+2)}),h.push(d.sort((t,e)=>t-e))}),h}(e,s,this.checkStave(),this.getStemDirection());i.setLineWidth(ot.WIDTH),n.forEach(e=>{0!==e.length&&(i.beginPath(),i.moveTo(t,e[0]),i.lineTo(t,e[e.length-1]),i.stroke(),i.closePath())})}}drawPositions(){const t=this.checkContext(),e=this.getAbsoluteX(),i=this.ys;for(let s=0;s<this.positions.length;++s){const n=i[s]+this.renderOptions.yShift,a=this.fretElement[s],o=e-a.getWidth()/2;t.clearRect(o-2,n-3,a.getWidth()+4,6),a.renderText(t,o,n)}}draw(){const t=this.checkContext();if(0===this.ys.length)throw new C("NoYValues","Can't draw note without Y values.");this.setRendered();const e=void 0===this.beam&&this.renderOptions.drawStem,i=this.getAttribute("class");if(t.openGroup("tabnote"+(i?" "+i:""),this.getAttribute("id")),this.drawPositions(),this.drawStemThrough(),this.stem&&e){const e=this.getStemX();this.stem.setNoteHeadXBounds(e,e),this.stem.setContext(t).drawWithStyle()}this.drawFlag(),this.drawModifiers(),this.drawPointerRect(),t.closeGroup()}}class pi extends Be{static get CATEGORY(){return l.TabStave}constructor(t,e,i,s){super(t,e,i,Object.assign({spacingBetweenLinesPx:13,numLines:6,topTextPosition:1},s))}getYForGlyphs(){return this.getYForLine(2.5)}addTabGlyph(){return this.addClef("tab"),this}}var mi;!function(t){t[t.TOP=1]="TOP",t[t.BOTTOM=-1]="BOTTOM"}(mi||(mi={}));class fi extends X{static get CATEGORY(){return l.TextBracket}static get Position(){return mi}static get PositionString(){return{top:mi.TOP,bottom:mi.BOTTOM}}constructor({start:t,stop:e,text:i="",superscript:s="",position:n=mi.TOP}){super(),this.start=t,this.stop=e,this.textElement=new X("TextBracket"),this.textElement.setText(i),this.superscriptElement=new X("TextBracket"),this.superscriptElement.setText(s);const a=G.scaleSize(this.fontInfo.size,.714286);this.superscriptElement.setFontSize(a),this.position="string"==typeof n?fi.PositionString[n]:n,this.line=1,this.renderOptions={dashed:!0,dash:[5],lineWidth:1,showBracket:!0,bracketHeight:8,underlineSuperscript:!0}}applyStyle(t){this.textElement.setFont(this.fontInfo);const{family:e,size:i,weight:s,style:n}=this.fontInfo,a=G.scaleSize(i,.714286);this.superscriptElement.setFont(e,a,s,n);const o=this.renderOptions;return void 0!==o.color&&(t.setStrokeStyle(o.color),t.setFillStyle(o.color)),t.setLineWidth(o.lineWidth),super.applyStyle(t)}setDashed(t,e){return this.renderOptions.dashed=t,e&&(this.renderOptions.dash=e),this}setLine(t){return this.line=t,this}draw(){const t=this.checkContext();this.setRendered();let e=0;switch(this.position){case mi.TOP:e=this.start.checkStave().getYForTopText(this.line);break;case mi.BOTTOM:e=this.start.checkStave().getYForBottomText(this.line+st.TEXT_HEIGHT_OFFSET_HACK);break;default:throw new C("InvalidPosition",`The position ${this.position} is invalid.`)}const i={x:this.start.getAbsoluteX(),y:e},s={x:this.stop.getAbsoluteX(),y:e};!function(...t){fi.DEBUG&&B("VexFlow.TextBracket",t)}("Rendering TextBracket: start:",i,"stop:",s,"y:",e);const n=this.renderOptions.bracketHeight*this.position;this.textElement.renderText(t,i.x,i.y);const a=this.textElement.getWidth(),o=this.textElement.getHeight(),r=i.y-o/2.5;this.superscriptElement.renderText(t,i.x+a+1,r);const h=this.superscriptElement.getWidth(),c=this.superscriptElement.getHeight();let l=i.x,d=r;const u=s.x+this.stop.getGlyphWidth();this.position===mi.TOP?(l+=a+h+5,d-=c/2.7):this.position===mi.BOTTOM&&(d+=c/2.7,l+=a+2,this.renderOptions.underlineSuperscript||(l+=h)),this.renderOptions.dashed?(ce.drawDashedLine(t,l,d,u,d,this.renderOptions.dash),this.renderOptions.showBracket&&ce.drawDashedLine(t,u,d+1*this.position,u,d+n,this.renderOptions.dash)):(t.beginPath(),t.moveTo(l,d),t.lineTo(u,d),this.renderOptions.showBracket&&t.lineTo(u,d+n),t.stroke(),t.closePath())}}function Si(...t){Ti.DEBUG&&B("VexFlow.TextDynamics",t)}fi.DEBUG=!1;class Ti extends yt{static get CATEGORY(){return l.TextDynamics}static get GLYPHS(){return{f:_.dynamicForte,p:_.dynamicPiano,m:_.dynamicMezzo,s:_.dynamicSforzando,z:_.dynamicZ,r:_.dynamicRinforzando}}constructor(t){var e,i;super(t),this.sequence=(null!==(e=t.text)&&void 0!==e?e:"").toLowerCase(),this.line=null!==(i=t.line)&&void 0!==i?i:0,this.text="",Si("New Dynamics Text: ",this.sequence)}setLine(t){return this.line=t,this}preFormat(){return this.text="",this.sequence.split("").forEach(t=>{const e=Ti.GLYPHS[t];if(!e)throw new C("Invalid dynamics character: "+t);this.text+=e}),this.preFormatted=!0,this}getBoundingBox(){const t=this.getTextMetrics();return new P(this.getAbsoluteX()+this.x+this.xShift,this.checkStave().getYForLine(this.line-3)+this.y+this.yShift-t.actualBoundingBoxAscent,this.getWidth(),this.getHeight())}draw(){this.setRendered();const t=this.getAbsoluteX(),e=this.checkStave().getYForLine(this.line+-3);Si("Rendering Dynamics: ",this.sequence),this.renderText(this.checkContext(),t,e)}}Ti.DEBUG=!1;class xi extends yt{static get CATEGORY(){return l.TimeSigNote}constructor(t,e){super({duration:"b"}),this.timeSig=new Ce(t,e),this.setWidth(this.timeSig.getWidth()),this.ignoreTicks=!0}addToModifierContext(t){return this}preFormat(){return this.preFormatted=!0,this}draw(){const t=this.checkStave(),e=this.checkContext();this.setRendered();const i=this.getAttribute("class");e.openGroup("timesignote"+(i?" "+i:""),this.getAttribute("id")),this.timeSig.drawAt(e,t,this.getAbsoluteX()),this.drawPointerRect(),e.closeGroup()}}class wi extends X{static get CATEGORY(){return l.VibratoBracket}constructor(t){super(),this.vibrato=new ue,t.start&&(this.start=t.start),t.stop&&(this.stop=t.stop),this.line=1}setLine(t){return this.line=t,this}setVibratoCode(t){return this.vibrato.setVibratoCode(t),this}draw(){const t=this.checkContext();this.setRendered();const e=this.start&&this.start.checkStave().getYForTopText(this.line)||this.stop&&this.stop.checkStave().getYForTopText(this.line)||0,i=this.start&&this.start.getAbsoluteX()||this.stop&&this.stop.checkStave().getTieStartX()||0,s=this.stop&&this.stop.getAbsoluteX()-this.stop.getWidth()-5||this.start&&this.start.checkStave().getTieEndX()-10||0;this.vibrato.setVibratoWidth(s-i),function(...t){wi.DEBUG&&B("VexFlow.VibratoBracket",t)}("Rendering VibratoBracket: startX:",i,"stopX:",s,"y:",e),this.vibrato.renderText(t,i,e)}}function bi(...t){yi.DEBUG&&B("VexFlow.Factory",t)}wi.DEBUG=!1;class yi{static newFromElementId(t,e=500,i=200){return new yi({renderer:{elementId:t,width:e,height:i}})}constructor(t={}){this.retained=!1,this.style={},bi("New factory: ",t),this.options={stave:{space:10},renderer:{elementId:"",width:500,height:200,background:"#FFF"}},this.setOptions(t)}reset(){this.sheets=[],this.retained=!1,this.renderQ=[],this.systems=[],this.staves=[],this.voices=[],this.stave=void 0}setOptions(t){this.options=Object.assign(Object.assign({},this.options),t),this.initRenderer(),this.reset()}initRenderer(){const{elementId:t,width:e,height:i,background:s}=this.options.renderer;if(null===t)return;if(""===t)throw bi(this),new C("renderer.elementId not set in FactoryOptions");let n=this.options.renderer.backend;if(void 0===n){n=Qt(document.getElementById(t))?ce.Backends.CANVAS:ce.Backends.SVG}this.context=ce.buildContext(t,n,e,i,s)}getContext(){return this.context}setContext(t){return this.context=t,this}getStave(){return this.stave}getVoices(){return this.voices}setStyle(t){return this.style=Object.assign({},t),this}Sheet(t={}){const e=new ci(Object.assign(Object.assign({},t),{factory:this}));return this.sheets.push(e),e}Stave(t){const e=this.options.stave.space,i=Object.assign({x:0,y:0,width:this.options.renderer.width-1*e,options:{spacingBetweenLinesPx:1*e}},t),s=new Be(i.x,i.y,i.width,i.options);return this.staves.push(s),s.setContext(this.context),this.stave=s,s}TabStave(t){const e=this.options.stave.space,i=Object.assign({x:0,y:0,width:this.options.renderer.width-1*e,options:{spacingBetweenLinesPx:1.3*e}},t),s=new pi(i.x,i.y,i.width,i.options);return this.staves.push(s),s.setContext(this.context),this.stave=s,s}StaveNote(t){const e=new Vt(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}GlyphNote(t,e,i){const s=new ii(t,e,i);return this.stave&&s.setStave(this.stave),s.setContext(this.context),this.renderQ.push(s),s}RepeatNote(t,e,i){const s=new hi(t,e,i);return this.stave&&s.setStave(this.stave),s.setContext(this.context),this.renderQ.push(s),s}GhostNote(t){const e=new ei(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}TextNote(t){const e=new we(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}BarNote(t={}){const e=new Ft(t.type);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}ClefNote(t){const e=Object.assign({type:"treble",options:{size:"default",annotation:void 0}},t),i=new He(e.type,e.options.size,e.options.annotation);return this.stave&&i.setStave(this.stave),i.setContext(this.context),this.renderQ.push(i),i}TimeSigNote(t){const e=Object.assign({time:"4/4"},t),i=new xi(e.time);return this.stave&&i.setStave(this.stave),i.setContext(this.context),this.renderQ.push(i),i}KeySigNote(t){const e=new ni(t.key,t.cancelKey,t.alterKey);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}TabNote(t){const e=new gi(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}GraceNote(t){const e=new si(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),e}GraceNoteGroup(t){const e=new jt(t.notes,t.slur);return e.setContext(this.context),e}Accidental(t){const e=new at(t.type);return e.setContext(this.context),e}Annotation(t){const e=Object.assign({text:"p",hJustify:rt.CENTER,vJustify:ht.BOTTOM},t),i=new ct(e.text);return i.setJustification(e.hJustify),i.setVerticalJustification(e.vJustify),i.setFont(e.font),i.setContext(this.context),i}ChordSymbol(t){const e=Object.assign({vJustify:"top",hJustify:"center"},t),i=new Pt;return i.setHorizontal(e.hJustify),i.setVertical(e.vJustify),"string"==typeof e.fontFamily&&"number"==typeof e.fontSize?"string"==typeof e.fontWeight?i.setFont(e.fontFamily,e.fontSize,e.fontWeight):i.setFont(e.fontFamily,e.fontSize,""):"number"==typeof e.fontSize&&i.setFontSize(e.fontSize),i.setContext(this.context),i}Articulation(t){var e;const i=new xt(null!==(e=null==t?void 0:t.type)&&void 0!==e?e:"a.");return void 0!==(null==t?void 0:t.position)&&i.setPosition(t.position),void 0!==(null==t?void 0:t.betweenLines)&&i.setBetweenLines(t.betweenLines),i.setContext(this.context),i}Ornament(t,e){const i=Object.assign({type:t,accidental:""},e),s=new Kt(t);return void 0!==(null==e?void 0:e.position)&&s.setPosition(e.position),i.upperAccidental&&s.setUpperAccidental(i.upperAccidental),i.lowerAccidental&&s.setLowerAccidental(i.lowerAccidental),void 0!==i.delayed&&s.setDelayed(i.delayed),s.setContext(this.context),s}TextDynamics(t){const e=Object.assign({text:"p",duration:"q",dots:0,line:0},t),i=new Ti({text:e.text,line:e.line,duration:e.duration,dots:e.dots});return this.stave&&i.setStave(this.stave),i.setContext(this.context),this.renderQ.push(i),i}Fingering(t){const e=Object.assign({number:"0",position:"left"},t),i=new It(e.number);return i.setPosition(e.position),i.setContext(this.context),i}StringNumber(t,e=!0){const i=new le(t.number);return i.setPosition(t.position),i.setContext(this.context),i.setDrawCircle(e),i}TickContext(){return new Ee}ModifierContext(){return new pe}MultiMeasureRest(t){const e=v(t.numberOfMeasures,"NoNumberOfMeasures"),i=new ai(e,t);return i.setContext(this.context),this.renderQ.push(i),i}Voice(t){const e=Object.assign({time:"4/4"},t),i=new zt(e.time);return this.voices.push(i),i}StaveConnector(t){const e=new Le(t.topStave,t.bottomStave);return e.setType(t.type).setContext(this.context),this.renderQ.push(e),e}Formatter(t){return new Fe(t)}Tuplet(t){const e=Object.assign({notes:[],options:{}},t),i=new Oe(e.notes,e.options).setContext(this.context);return this.renderQ.push(i),i}Beam(t){var e,i,s,n,a;const o=new Ie(t.notes,null===(e=t.options)||void 0===e?void 0:e.autoStem).setContext(this.context);return o.breakSecondaryAt(null!==(s=null===(i=t.options)||void 0===i?void 0:i.secondaryBeamBreaks)&&void 0!==s?s:[]),(null===(n=t.options)||void 0===n?void 0:n.partialBeamDirections)&&Object.entries(null===(a=t.options)||void 0===a?void 0:a.partialBeamDirections).forEach(([t,e])=>{o.setPartialBeamSideAt(Number(t),e)}),this.renderQ.push(o),o}Curve(t){const e=new Ve(t.from,t.to,t.options).setContext(this.context);return this.renderQ.push(e),e}StaveTie(t){var e;const i=new Xt({firstNote:t.from,lastNote:t.to,firstIndexes:t.firstIndexes,lastIndexes:t.lastIndexes},t.text);return(null===(e=t.options)||void 0===e?void 0:e.direction)&&i.setDirection(t.options.direction),i.setContext(this.context),this.renderQ.push(i),i}StaveLine(t){var e,i;const s=new di({firstNote:t.from,lastNote:t.to,firstIndexes:t.firstIndexes,lastIndexes:t.lastIndexes});return(null===(e=t.options)||void 0===e?void 0:e.text)&&s.setText(t.options.text),(null===(i=t.options)||void 0===i?void 0:i.font)&&s.setFont(t.options.font),s.setContext(this.context),this.renderQ.push(s),s}VibratoBracket(t){const e=new wi({start:t.from,stop:t.to});return t.options.line&&e.setLine(t.options.line),t.options.code&&e.setVibratoCode(t.options.code),e.setContext(this.context),this.renderQ.push(e),e}TextBracket(t){const e=new fi({start:t.from,stop:t.to,text:t.text,superscript:t.options.superscript,position:t.options.position});return t.options.line&&e.setLine(t.options.line),t.options.font&&e.setFont(t.options.font),e.setContext(this.context),this.renderQ.push(e),e}System(t={}){t.factory=this;const e=new ui(t).setContext(this.context);return this.systems.push(e),e}EasyScore(t={}){return t.factory=this,new Ze(t)}PedalMarking(t){const e=Object.assign({notes:[],options:{style:"mixed"}},t),i=new oi(e.notes);return i.setType(oi.typeString[e.options.style]),i.setContext(this.context),this.renderQ.push(i),i}NoteSubGroup(t){const e=Object.assign({notes:[]},t),i=new qt(e.notes);return i.setContext(this.context),i}draw(t={}){var e;const i=this.context;this.sheets.forEach(t=>t.format());const s=new Set(this.sheets.flatMap(t=>t.getSystems()));this.systems.forEach(t=>{s.has(t)||t.setContext(i).format()});const n=i.getDefaultStyle();i.save(),i.setDefaultStyle(this.style),void 0!==this.style.fillStyle&&i.setFillStyle(this.style.fillStyle),void 0!==this.style.strokeStyle&&i.setStrokeStyle(this.style.strokeStyle),this.retained&&this.renderQ.forEach(t=>t.setRendered(!1));try{this.staves.forEach(t=>t.setContext(i).drawWithStyle()),this.voices.forEach(t=>t.setContext(i).drawWithStyle()),this.renderQ.forEach(t=>{t.isRendered()||t.setContext(i).drawWithStyle()}),this.systems.forEach(t=>t.setContext(i).drawWithStyle())}finally{i.setDefaultStyle(n),i.restore()}this.retained=null!==(e=t.retain)&&void 0!==e&&e,t.retain||this.reset()}}yi.DEBUG=!1;class Ci extends X{static get CATEGORY(){return l.StaveHairpin}static FormatByTicksAndDraw(t,e,i,s,n,a){var o,r;const h=e.pixelsPerTick;if(null===h)throw new C("BadArguments","A valid Formatter must be provide to draw offsets by ticks.");const c=h*(null!==(o=a.leftShiftTicks)&&void 0!==o?o:0),l=h*(null!==(r=a.rightShiftTicks)&&void 0!==r?r:0),d={height:a.height,yShift:a.yShift,leftShiftPx:c,rightShiftPx:l,rightShiftTicks:0,leftShiftTicks:0};new Ci({firstNote:i.firstNote,lastNote:i.lastNote},s).setContext(t).setRenderOptions(d).setPosition(n).drawWithStyle()}constructor(t,e){super(),this.setNotes(t),this.hairpin=e,this.position=z.Position.BELOW,this.renderOptions={height:10,yShift:0,leftShiftPx:0,rightShiftPx:0,rightShiftTicks:0,leftShiftTicks:0}}setPosition(t){return t!==z.Position.ABOVE&&t!==z.Position.BELOW||(this.position=t),this}setRenderOptions(t){return this.renderOptions=t,this}setNotes(t){if(!t.firstNote&&!t.lastNote)throw new C("BadArguments","Hairpin needs to have either firstNote or lastNote set.");return this.notes=t,this.firstNote=t.firstNote,this.lastNote=t.lastNote,this}renderHairpin(t){const e=this.checkContext();let i=this.renderOptions.yShift+20,s=t.firstY;this.position===z.Position.ABOVE&&(i=30-i,s=t.firstY-t.staffHeight);const n=this.renderOptions.leftShiftPx,a=this.renderOptions.rightShiftPx;switch(e.beginPath(),this.hairpin){case Ci.type.CRESC:e.moveTo(t.lastX+a,s+i),e.lineTo(t.firstX+n,s+this.renderOptions.height/2+i),e.lineTo(t.lastX+a,s+this.renderOptions.height+i);break;case Ci.type.DECRESC:e.moveTo(t.firstX+n,s+i),e.lineTo(t.lastX+a,s+this.renderOptions.height/2+i),e.lineTo(t.firstX+n,s+this.renderOptions.height+i)}e.stroke(),e.closePath()}draw(){this.checkContext(),this.setRendered();const t=this.firstNote,e=this.lastNote;if(!t||!e)throw new C("NoNote","Notes required to draw");const i=t.getModifierStartXY(this.position,0),s=e.getModifierStartXY(this.position,0);this.renderHairpin({firstX:i.x,lastX:s.x,firstY:t.checkStave().getY()+t.checkStave().getHeight(),lastY:e.checkStave().getY()+e.checkStave().getHeight(),staffHeight:t.checkStave().getHeight()})}}Ci.type={CRESC:1,DECRESC:2};class ki extends Yt{static get CATEGORY(){return l.TabSlide}static get SLIDE_UP(){return 1}static get SLIDE_DOWN(){return-1}static createSlideUp(t){return new ki(t,ki.SLIDE_UP)}static createSlideDown(t){return new ki(t,ki.SLIDE_DOWN)}constructor(t,e){if(super(t,"sl."),!e){let i=t.firstNote.getPositions()[0].fret;"string"==typeof i&&(i=parseInt(i,10));let s=t.lastNote.getPositions()[0].fret;"string"==typeof s&&(s=parseInt(s,10)),e=isNaN(i)||isNaN(s)?ki.SLIDE_UP:i>s?ki.SLIDE_DOWN:ki.SLIDE_UP}this.direction=e,this.renderOptions.cp1=11,this.renderOptions.cp2=14,this.renderOptions.yShift=.5}renderTie(t){if(0===t.firstYs.length||0===t.lastYs.length)throw new C("BadArguments","No Y-values to render");const e=this.checkContext(),i=t.firstX,s=t.firstYs,n=t.lastX,a=t.direction;if(a!==ki.SLIDE_UP&&a!==ki.SLIDE_DOWN)throw new C("BadSlide","Invalid slide direction");const o=this.notes.firstIndexes;for(let t=0;t<o.length;++t){const r=s[o[t]]+this.renderOptions.yShift;if(isNaN(r))throw new C("BadArguments","Bad indexes for slide rendering.");e.beginPath(),e.moveTo(i,r+3*a),e.lineTo(n,r-3*a),e.closePath(),e.stroke()}this.setRendered()}}class vi{static get names(){return{standard:"E/5,B/4,G/4,D/4,A/3,E/3",dagdad:"D/5,A/4,G/4,D/4,A/3,D/3",dropd:"E/5,B/4,G/4,D/4,A/3,D/3",eb:"Eb/5,Bb/4,Gb/4,Db/4,Ab/3,Db/3",standardBanjo:"D/5,B/4,G/4,D/4,G/5"}}constructor(t="E/5,B/4,G/4,D/4,A/3,E/3,B/2,E/2"){this.tuningValues=[],this.setTuning(t)}noteToInteger(t){var e;return null!==(e=st.keyProperties(t).intValue)&&void 0!==e?e:-1}setTuning(t){Object.prototype.hasOwnProperty.call(vi.names,t)&&(t=vi.names[t]),this.tuningValues=[];const e=t.split(",").map(t=>t.trim());if(0===e.length)throw new C("BadArguments",`Invalid tuning string: ${t}`);for(let t=0;t<e.length;++t)this.tuningValues[t]=this.noteToInteger(e[t])}getValueForString(t){const e=Number(t);if(e<1||e>this.tuningValues.length)throw new C("BadArguments",`String number must be between 1 and ${this.tuningValues.length}:${t}`);return this.tuningValues[e-1]}getValueForFret(t,e){const i=this.getValueForString(e),s=Number(t);if(s<0)throw new C("BadArguments",`Fret number must be 0 or higher: ${t}`);return i+s}getNoteForFret(t,e){const i=this.getValueForFret(t,e),s=Math.floor(i/12),n=i%12;return`${st.integerToNote(n)}/${s}`}}var Bi=function(t,e,i,s){return new(i||(i=Promise))(function(n,a){function o(t){try{h(s.next(t))}catch(t){a(t)}}function r(t){try{h(s.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(o,r)}h((s=s.apply(t,e||[])).next())})};class Di{static loadFonts(...t){return Bi(this,void 0,void 0,function*(){t||(t=Object.keys(G.FILES));const e=[];for(const i of t)e.push(G.load(i));yield Promise.all(e)})}static setFonts(...t){const e=t.flatMap(t=>t.split(",").map(t=>t.trim())).filter(Boolean);R.fontFamily=e.join(",");const i=e.filter(t=>G.TEXT_FONT_NAMES.includes(t));Di.setTextFonts(...i.length?i:["Academico"])}static setTextFonts(...t){R.textFontFamily=[...new Set([...t,...Di.getFonts()])].join(","),O.clear()}static getTextFonts(){return O.get("textFontFamily").split(",")}static getFonts(){return O.get("fontFamily").split(",")}static get RENDER_PRECISION_PLACES(){return st.RENDER_PRECISION_PLACES}static set RENDER_PRECISION_PLACES(t){st.RENDER_PRECISION_PLACES=t}static get SOFTMAX_FACTOR(){return st.SOFTMAX_FACTOR}static set SOFTMAX_FACTOR(t){st.SOFTMAX_FACTOR=t}static get UNISON(){return st.UNISON}static set UNISON(t){st.UNISON=t}static get NOTATION_FONT_SCALE(){return st.NOTATION_FONT_SCALE}static set NOTATION_FONT_SCALE(t){st.NOTATION_FONT_SCALE=t}static get TABLATURE_FONT_SCALE(){return st.TABLATURE_FONT_SCALE}static set TABLATURE_FONT_SCALE(t){st.TABLATURE_FONT_SCALE=t}static get RESOLUTION(){return st.RESOLUTION}static set RESOLUTION(t){st.RESOLUTION=t}static get SLASH_NOTEHEAD_WIDTH(){return st.SLASH_NOTEHEAD_WIDTH}static set SLASH_NOTEHEAD_WIDTH(t){st.SLASH_NOTEHEAD_WIDTH=t}static get STAVE_LINE_DISTANCE(){return st.STAVE_LINE_DISTANCE}static set STAVE_LINE_DISTANCE(t){st.STAVE_LINE_DISTANCE=t}static get STAVE_LINE_THICKNESS(){return R.Stave.lineWidth}static set STAVE_LINE_THICKNESS(t){R.Stave.lineWidth=t,R.TabStave.lineWidth=t,O.clear("Stave"),O.clear("TabStave")}static get STEM_HEIGHT(){return st.STEM_HEIGHT}static set STEM_HEIGHT(t){st.STEM_HEIGHT=t}static get STEM_WIDTH(){return st.STEM_WIDTH}static set STEM_WIDTH(t){st.STEM_WIDTH=t}static get TIME4_4(){return st.TIME4_4}static get unicode(){return st.unicode}static keySignature(t){return st.keySignature(t)}static hasKeySignature(t){return st.hasKeySignature(t)}static getKeySignatures(){return st.getKeySignatures()}static clefProperties(t){return st.clefProperties(t)}static keyProperties(t,e,i){return st.keyProperties(t,e,i)}static durationToTicks(t){return st.durationToTicks(t)}}Di.BUILD={VERSION:"5.1.0",ID:"c552e8f8b6d099052699892f82b34dc2688cb95b",DATE:"2026-11-16T01:20:16.794Z",INFO:""},Di.Accidental=at,Di.Annotation=ct,Di.Articulation=xt,Di.Barline=Nt,Di.BarNote=Ft,Di.Beam=Ie,Di.Bend=At,Di.BoundingBox=P,Di.CanvasContext=Jt,Di.ChordSymbol=Pt,Di.Clef=me,Di.ClefNote=He,Di.Crescendo=We,Di.Curve=Ve,Di.Dot=Mt,Di.EasyScore=Ze,Di.Element=X,Di.Factory=yi,Di.Font=G,Di.Formatter=Fe,Di.Fraction=F,Di.FretHandFinger=It,Di.GhostNote=ei,Di.GlyphNote=ii,Di.GraceNote=si,Di.GraceNoteGroup=jt,Di.GraceTabNote=class extends gi{static get CATEGORY(){return l.GraceTabNote}constructor(t){super(t,!1),this.renderOptions=Object.assign(Object.assign({},this.renderOptions),{yShift:.3}),this.updateWidth()}},Di.KeyManager=class{constructor(t){this.music=new j,this.setKey(t)}setKey(t){return this.key=t,this.reset(),this}getKey(){return this.key}reset(){this.keyParts=this.music.getKeyParts(this.key),this.keyString=this.keyParts.root,this.keyParts.accidental&&(this.keyString+=this.keyParts.accidental);if(!j.scaleTypes[this.keyParts.type])throw new C("BadArguments",`Unsupported key type: ${this.key}`);this.scale=this.music.getScaleTones(this.music.getNoteValue(this.keyString),j.scaleTypes[this.keyParts.type]),this.scaleMap={},this.scaleMapByValue={},this.originalScaleMapByValue={};const t=j.rootIndexes[this.keyParts.root];for(let e=0;e<j.roots.length;++e){const i=(t+e)%j.roots.length,s=j.roots[i],n=this.music.getRelativeNoteName(s,this.scale[e]);this.scaleMap[s]=n,this.scaleMapByValue[this.scale[e]]=n,this.originalScaleMapByValue[this.scale[e]]=n}return this}getAccidental(t){const e=this.music.getKeyParts(t).root,i=this.music.getNoteParts(this.scaleMap[e]);return{note:this.scaleMap[e],accidental:i.accidental}}selectNote(t){t=t.toLowerCase();const e=this.music.getNoteParts(t),i=this.scaleMap[e.root],s=this.music.getNoteParts(i);if(i===t)return{note:i,accidental:e.accidental,change:!1};const n=this.scaleMapByValue[this.music.getNoteValue(t)];if(void 0!==n)return{note:n,accidental:this.music.getNoteParts(n).accidental,change:!1};const a=this.originalScaleMapByValue[this.music.getNoteValue(t)];return void 0!==a?(this.scaleMap[s.root]=a,delete this.scaleMapByValue[this.music.getNoteValue(i)],this.scaleMapByValue[this.music.getNoteValue(t)]=a,{note:a,accidental:this.music.getNoteParts(a).accidental,change:!0}):s.root===t?(delete this.scaleMapByValue[this.music.getNoteValue(this.scaleMap[e.root])],this.scaleMapByValue[this.music.getNoteValue(s.root)]=s.root,this.scaleMap[s.root]=s.root,{note:s.root,accidental:void 0,change:!0}):(delete this.scaleMapByValue[this.music.getNoteValue(this.scaleMap[e.root])],this.scaleMapByValue[this.music.getNoteValue(t)]=t,delete this.scaleMap[s.root],this.scaleMap[s.root]=t,{note:t,accidental:e.accidental,change:!0})}},Di.KeySignature=fe,Di.KeySigNote=ni,Di.Modifier=z,Di.ModifierContext=pe,Di.MultiMeasureRest=ai,Di.Music=j,Di.Note=yt,Di.NoteHead=Ht,Di.NoteSubGroup=qt,Di.Ornament=Kt,Di.Parenthesis=$t,Di.Parser=_e,Di.PedalMarking=oi,Di.Registry=V,Di.RenderContext=wt,Di.Renderer=ce,Di.RepeatNote=hi,Di.Repetition=Se,Di.Stave=Be,Di.StaveConnector=Le,Di.StaveHairpin=Ci,Di.StaveLine=di,Di.StaveModifier=Et,Di.StaveNote=Vt,Di.StaveTempo=xe,Di.StaveText=be,Di.StaveTie=Xt,Di.Stem=ot,Di.StringNumber=le,Di.Stroke=de,Di.SVGContext=ne,Di.System=ui,Di.Sheet=ci,Di.TabNote=gi,Di.TabSlide=ki,Di.TabStave=pi,Di.TabTie=Yt,Di.TextBracket=fi,Di.TextDynamics=Ti,Di.TextNote=we,Di.TickContext=Ee,Di.TimeSignature=Ce,Di.TimeSigNote=xi,Di.Tremolo=class extends z{static get CATEGORY(){return l.Tremolo}constructor(t){super(),this.num=t,this.position=z.Position.CENTER,this.text=_.tremolo1}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=e.getStemDirection(),s=e.getFontScale(),n=O.get("Tremolo.spacing")*i*s,a=e.getAbsoluteX()+(i===ot.UP?e.getGlyphWidth()-ot.WIDTH/2:ot.WIDTH/2);let o=e.getStemExtents().topY+(this.num<=3?n:0);this.fontInfo.size=O.get("Tremolo.fontSize")*s;for(let e=0;e<this.num;++e)this.renderText(t,a,o),o+=n}},Di.Tuning=vi,Di.Tuplet=Oe,Di.Vibrato=ue,Di.VibratoBracket=wi,Di.Voice=zt,Di.Volta=ye,Di.RuntimeError=C,Di.Test=void 0,Di.AnnotationHorizontalJustify=rt,Di.AnnotationVerticalJustify=ht,Di.ChordSymbolHorizontalJustify=Bt,Di.ChordSymbolVerticalJustify=Dt,Di.SymbolModifiers=Lt,Di.CurvePosition=Ue,Di.FontWeight=M,Di.FontStyle=I,Di.Glyphs=_,Di.ModifierPosition=Y,Di.RendererBackends=ae,Di.RendererLineEndType=oe,Di.BarlineType=kt,Di.RepeatBracketType=vt,Di.StaveModifierPosition=Ct,Di.VoltaType=he,Di.TextBracketPosition=mi,Di.TextJustification=re,Di.VoiceMode=_t,Di.BUILD.INFO="vexflow-core";const Li=Di;return e=e.default,e})());
5
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VexFlow=e():t.VexFlow=e()}("undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:this,()=>(()=>{"use strict";const t={d:(e,i)=>{if(Array.isArray(i))for(var s=0;s<i.length;){var n=i[s++],o=i[s++];t.o(e,n)?0===o&&s++:0===o?Object.defineProperty(e,n,{enumerable:!0,value:i[s++]}):Object.defineProperty(e,n,{enumerable:!0,get:o})}else for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let e={};t.d(e,{default:()=>Ri});const i="object"==typeof self?self:globalThis,s=t=>((t,e)=>{const s=(e,i)=>(t.set(i,e),e),n=o=>{if(t.has(o))return t.get(o);const[a,r]=e[o];switch(a){case 0:case-1:return s(r,o);case 1:{const t=s([],o);for(const e of r)t.push(n(e));return t}case 2:{const t=s({},o);for(const[e,i]of r)t[n(e)]=n(i);return t}case 3:return s(new Date(r),o);case 4:{const{source:t,flags:e}=r;return s(new RegExp(t,e),o)}case 5:{const t=s(new Map,o);for(const[e,i]of r)t.set(n(e),n(i));return t}case 6:{const t=s(new Set,o);for(const e of r)t.add(n(e));return t}case 7:{const{name:t,message:e}=r;return s(new i[t](e),o)}case 8:return s(BigInt(r),o);case"BigInt":return s(Object(BigInt(r)),o)}return s(new i[a](r),o)};return n})(new Map,t)(0),n="",{toString:o}={},{keys:a}=Object,r=t=>{const e=typeof t;if("object"!==e||!t)return[0,e];const i=o.call(t).slice(8,-1);switch(i){case"Array":return[1,n];case"Object":return[2,n];case"Date":return[3,n];case"RegExp":return[4,n];case"Map":return[5,n];case"Set":return[6,n]}return i.includes("Array")?[1,i]:i.includes("Error")?[7,i]:[2,i]},h=([t,e])=>0===t&&("function"===e||"symbol"===e),c=(t,{json:e,lossy:i}={})=>{const s=[];return((t,e,i,s)=>{const n=(t,e)=>{const n=s.push(t)-1;return i.set(e,n),n},o=s=>{if(i.has(s))return i.get(s);let[c,l]=r(s);switch(c){case 0:{let e=s;switch(l){case"bigint":c=8,e=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);e=null;break;case"undefined":return n([-1],s)}return n([c,e],s)}case 1:{if(l)return n([l,[...s]],s);const t=[],e=n([c,t],s);for(const e of s)t.push(o(e));return e}case 2:{if(l)switch(l){case"BigInt":return n([l,s.toString()],s);case"Boolean":case"Number":case"String":return n([l,s.valueOf()],s)}if(e&&"toJSON"in s)return o(s.toJSON());const i=[],d=n([c,i],s);for(const e of a(s))!t&&h(r(s[e]))||i.push([o(e),o(s[e])]);return d}case 3:return n([c,s.toISOString()],s);case 4:{const{source:t,flags:e}=s;return n([c,{source:t,flags:e}],s)}case 5:{const e=[],i=n([c,e],s);for(const[i,n]of s)(t||!h(r(i))&&!h(r(n)))&&e.push([o(i),o(n)]);return i}case 6:{const e=[],i=n([c,e],s);for(const i of s)!t&&h(r(i))||e.push(o(i));return i}}const{message:d}=s;return n([c,{name:l,message:d}],s)};return o})(!(e||i),!!e,new Map,s)(t),s},l="function"==typeof structuredClone?(t,e)=>e&&("json"in e||"lossy"in e)?s(c(t,e)):structuredClone(t):(t,e)=>s(c(t,e)),{parse:d,stringify:u}=JSON,g=l;class p extends Error{constructor(t,e=""){super("[RuntimeError] "+t+": "+e),this.code=t}}function m(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t.g?t.g:Function("return this")()}function f(t,e="undefined",i=""){if(void 0===t)throw new p(e,i);return t}function S(t,...e){if(!e)return;const i=Array.prototype.slice.call(e).join(" ");m().console.log(t+": "+i)}function T(t,e){let i=e+(t-e)/2;var s,n;return i%2>0&&(i=((s=10*i)%(n=5)>=n/2?parseInt(""+s/n,10)*n+n:parseInt(""+s/n,10)*n)/10),i}function x(t){return`vf-${t}`}function w(t){return(t%=2*Math.PI)<0&&(t+=2*Math.PI),t}function b(t){return t.reduce((t,e)=>t+e,0)}class y{static get CATEGORY(){return"Fraction"}static GCD(t,e){if(!Number.isFinite(t)||!Number.isFinite(e))throw new p("BadArgument",`Invalid numbers: ${t}, ${e}`);let i;for(;0!==e;)i=e,e=t%e,t=i;return t}static LCM(t,e){return t*e/y.GCD(t,e)}static LCMM(t){return 0===t.length?0:1===t.length?t[0]:2===t.length?y.LCM(t[0],t[1]):y.LCM(t.shift(),y.LCMM(t))}constructor(t,e){this.numerator=1,this.denominator=1,this.set(t,e)}set(t=1,e=1){if(!Number.isFinite(t)||!Number.isFinite(e)||0===e)throw new p("BadArgument",`Invalid fraction: ${t}/${e}`);return this.numerator=t,this.denominator=e,this}value(){return this.numerator/this.denominator}simplify(){let t=this.numerator,e=this.denominator;const i=y.GCD(t,e);return t/=i,e/=i,e<0&&(e=-e,t=-t),this.set(t,e)}add(t=0,e=1){const[i,s]=k(t,e),n=y.LCM(this.denominator,s),o=n/this.denominator,a=n/s,r=this.numerator*o+i*a;return this.set(r,n)}subtract(t=0,e=1){const[i,s]=k(t,e),n=y.LCM(this.denominator,s),o=n/this.denominator,a=n/s,r=this.numerator*o-i*a;return this.set(r,n)}multiply(t=1,e=1){const[i,s]=k(t,e);return this.set(this.numerator*i,this.denominator*s)}divide(t=1,e=1){const[i,s]=k(t,e);return this.set(this.numerator*s,this.denominator*i)}equals(t){const e=y.fractionA.copy(t).simplify(),i=y.fractionB.copy(this).simplify();return e.numerator===i.numerator&&e.denominator===i.denominator}greaterThan(t){const e=y.fractionA.copy(this);return e.subtract(t),e.numerator>0}greaterThanEquals(t){const e=y.fractionA.copy(this);return e.subtract(t),e.numerator>=0}lessThan(t){return!this.greaterThanEquals(t)}lessThanEquals(t){return!this.greaterThan(t)}clone(){return new y(this.numerator,this.denominator)}copy(t){return"number"==typeof t?this.set(t):this.set(t.numerator,t.denominator)}quotient(){return Math.floor(this.numerator/this.denominator)}remainder(){return this.numerator%this.denominator}makeAbs(){return this.denominator=Math.abs(this.denominator),this.numerator=Math.abs(this.numerator),this}toString(){return`${this.numerator}/${this.denominator}`}toSimplifiedString(){return y.fractionA.copy(this).simplify().toString()}toMixedString(){let t="";const e=this.quotient(),i=y.fractionA.copy(this);return e<0&&i.makeAbs(),0!==e?(t+=e,0!==i.numerator&&(t+=` ${i.toSimplifiedString()}`)):t=0===i.numerator?"0":i.toSimplifiedString(),t}parse(t){const e=t.split("/"),i=parseInt(e[0],10),s=e[1]?parseInt(e[1],10):1;return this.set(i,s)}}function k(t,e=1){return"number"==typeof t?[t,e]:[t.numerator,t.denominator]}y.fractionA=new y,y.fractionB=new y;class v{static clear(){this.entries.clear()}static fontsReady(){var t;const e="undefined"!=typeof document?document.fonts:globalThis.fonts;if(e!==this.fonts){for(const i of["loading","loadingdone","loadingerror"])null===(t=this.fonts)||void 0===t||t.removeEventListener(i,this.onFontsChanged),null==e||e.addEventListener(i,this.onFontsChanged);this.fonts=e,this.clear()}return(null==e?void 0:e.size)===this.fontCount&&(null==e?void 0:e.status)===this.fontStatus||(this.fontCount=null==e?void 0:e.size,this.fontStatus=null==e?void 0:e.status,this.clear()),"loading"!==(null==e?void 0:e.status)}static snapshot(t){return Object.freeze({width:t.width,actualBoundingBoxLeft:t.actualBoundingBoxLeft,actualBoundingBoxRight:t.actualBoundingBoxRight,actualBoundingBoxAscent:t.actualBoundingBoxAscent,actualBoundingBoxDescent:t.actualBoundingBoxDescent,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent,emHeightAscent:t.emHeightAscent,emHeightDescent:t.emHeightDescent,hangingBaseline:t.hangingBaseline,alphabeticBaseline:t.alphabeticBaseline,ideographicBaseline:t.ideographicBaseline})}static measure(t,e){var i,s,n;t!==this.context&&(this.context=t,this.clear());const o=this.fontsReady();let a=t.lang,r=t.direction;const h=t.canvas;h&&"ownerDocument"in h&&("inherit"===r&&(r=h.isConnected?(null===(i=h.ownerDocument.defaultView)||void 0===i?void 0:i.getComputedStyle(h).direction)||"ltr":h.style.direction||h.dir||"ltr"),a&&"inherit"!==a||(a=null!==(n=null===(s=h.closest("[lang]"))||void 0===s?void 0:s.getAttribute("lang"))&&void 0!==n?n:h.ownerDocument.documentElement.lang));const c=JSON.stringify([t.font,r,t.textAlign,t.textBaseline,t.fontKerning,t.fontStretch,t.fontVariantCaps,t.letterSpacing,t.wordSpacing,t.textRendering,a,e]),l=o?this.entries.get(c):void 0;if(l)return this.entries.delete(c),this.entries.set(c,l),l;const d=this.snapshot(t.measureText(e));return o&&c.length<=this.maxKeyLength&&(this.entries.size>=this.maxEntries&&this.entries.delete(this.entries.keys().next().value),this.entries.set(c,d)),d}}v.maxEntries=2048,v.maxKeyLength=4096,v.entries=new Map,v.onFontsChanged=()=>v.clear();class B{static clear(t){v.clear(),t?(this.cacheFont.delete(t),this.cacheStyle.delete(t)):(this.cacheFont.clear(),this.cacheStyle.clear())}static getFontInfo(t){let e=this.cacheFont.get(t);return e||(e={family:B.getFontFamily(t),size:B.get(`${t}.fontSize`)*B.get(`${t}.fontScale`),weight:B.get(`${t}.fontWeight`),style:B.get(`${t}.fontStyle`)},this.cacheFont.set(t,e)),Object.assign({},e)}static getFontFamily(t){var e;if(!B.get(`${t}.isText`,!1))return B.get(`${t}.fontFamily`);let i=C.textFontFamily,s=C;for(const n of t.split(".")){if(s=null==s?void 0:s[n],!s)break;i=null!==(e=s.fontFamily)&&void 0!==e?e:i}return i}static getStyle(t){let e=this.cacheStyle.get(t);return e||(e={fillStyle:B.get(`${t}.fillStyle`),strokeStyle:B.get(`${t}.strokeStyle`),lineWidth:B.get(`${t}.lineWidth`),lineDash:B.get(`${t}.lineDash`),shadowBlur:B.get(`${t}.shadowBlur`),shadowColor:B.get(`${t}.shadowColor`)},this.cacheStyle.set(t,e)),Object.assign({},e)}static get(t,e){var i;const s=t.split("."),n=s.pop();let o=C,a=e;for(;o;){a=null!==(i=o[n])&&void 0!==i?i:a;const t=s.shift();if(!t)break;o=o[t]}return a}}B.cacheStyle=new Map,B.cacheFont=new Map;const C={pointerRect:!1,fontFamily:"Bravura,Academico",textFontFamily:"Academico,Bravura",fontSize:30,fontScale:1,fontWeight:"normal",fontStyle:"normal",Accidental:{cautionary:{fontSize:20},grace:{fontSize:20},noteheadAccidentalPadding:1,leftPadding:2,accidentalSpacing:3},Annotation:{isText:!0,fontSize:10},Bend:{isText:!0,fontSize:10,line:{strokeStyle:"#777777",lineWidth:1}},ChordSymbol:{isText:!0,fontSize:12,spacing:.05,subscriptOffset:.2,superscriptOffset:-.4,superSubRatio:.6},FretHandFinger:{isText:!0,fontSize:9,fontWeight:"bold"},GraceNote:{fontScale:2/3},GraceTabNote:{fontScale:2/3},NoteHead:{minPadding:2},PedalMarking:{text:{isText:!0,fontSize:12,fontStyle:"italic"}},Repetition:{text:{isText:!0,fontSize:12,fontWeight:"bold",offsetX:12,offsetY:25,spacing:5},coda:{offsetY:25},segno:{offsetY:10}},Stave:{isText:!0,strokeStyle:"#999999",fontSize:8,padding:12,endPaddingMax:10,endPaddingMin:5,unalignedNotePadding:10},StaveConnector:{text:{isText:!0,fontSize:16}},StaveLine:{isText:!0,fontSize:10},StaveNote:{pointerRect:!0},StaveSection:{isText:!0,fontSize:10,fontWeight:"bold",lineWidth:2,padding:2,strokeStyle:"black"},StaveTempo:{isText:!0,fontSize:14,glyph:{isText:!1,fontSize:25},name:{fontWeight:"bold"}},StaveText:{isText:!0,fontSize:16},StaveTie:{isText:!0,fontSize:10},Stem:{strokeStyle:"black"},StringNumber:{isText:!0,fontSize:10,fontWeight:"bold",verticalPadding:8,stemPadding:2,leftPadding:5,rightPadding:6},Stroke:{text:{isText:!0,fontSize:10,fontStyle:"italic",fontWeight:"bold"}},TabNote:{text:{isText:!0,fontSize:9}},TabSlide:{isText:!0,fontSize:10,fontStyle:"italic",fontWeight:"bold"},TabStave:{isText:!0,strokeStyle:"#999999",fontSize:8},TabTie:{isText:!0,fontSize:10},TextBracket:{isText:!0,fontSize:15,fontStyle:"italic"},TextNote:{text:{isText:!0,fontSize:12}},Tremolo:{spacing:7},Tuplet:{pointerRect:!0,yOffset:0,textYOffset:2,bracket:{padding:5,lineWidth:1,legLength:10},suffix:{fontScale:.5,extraSpacing:1,suffixOffsetY:-3}},Volta:{isText:!0,fontSize:9,fontWeight:"bold"}};class D{static copy(t){return new D(t.x,t.y,t.w,t.h)}constructor(t,e,i,s){this.x=t,this.y=e,this.w=i,this.h=s}getX(){return this.x}getY(){return this.y}getW(){return this.w}getH(){return this.h}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setW(t){return this.w=t,this}setH(t){return this.h=t,this}move(t,e){return this.x+=t,this.y+=e,this}clone(){return D.copy(this)}mergeWith(t){const e=t,i=this.x<e.x?this.x:e.x,s=this.y<e.y?this.y:e.y,n=Math.max(this.x+this.w,e.x+e.w)-i,o=Math.max(this.y+this.h,e.y+e.h)-s;return this.x=i,this.y=s,this.w=n,this.h=o,this}}var E,L,N=function(t,e,i,s){return new(i||(i=Promise))(function(n,o){function a(t){try{h(s.next(t))}catch(t){o(t)}}function r(t){try{h(s.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(a,r)}h((s=s.apply(t,e||[])).next())})};let F;!function(t){t.NORMAL="normal",t.BOLD="bold"}(E||(E={})),function(t){t.NORMAL="normal",t.ITALIC="italic"}(L||(L={}));class A{static convertSizeToPixelValue(t){var e;if("number"==typeof t)return t*A.scaleToPxFrom.pt;{const i=parseFloat(t);if(isNaN(i))return 0;const s=t.replace(/[\d.\s]/g,"").toLowerCase();return i*(null!==(e=A.scaleToPxFrom[s])&&void 0!==e?e:1)}}static convertSizeToPointValue(t){var e;if("number"==typeof t)return t;{const i=parseFloat(t);if(isNaN(i))return 0;const s=t.replace(/[\d.\s]/g,"").toLowerCase();return i*((null!==(e=A.scaleToPxFrom[s])&&void 0!==e?e:1)/A.scaleToPxFrom.pt)}}static validate(t,e,i,s){if("string"==typeof t&&void 0===e&&void 0===i&&void 0===s)return A.fromCSSString(t);let n;return"object"==typeof t?(n=t.family,e=t.size,i=t.weight,s=t.style):n=t,n=null!=n?n:B.get("fontFamily"),e=null!=e?e:B.get("fontSize")+"pt",i=null!=i?i:E.NORMAL,s=null!=s?s:L.NORMAL,""===i&&(i=E.NORMAL),""===s&&(s=L.NORMAL),"number"==typeof e&&(e=`${e}pt`),"number"==typeof i&&(i=i.toString()),{family:n,size:e,weight:i,style:s}}static fromCSSString(t){F||(F=document.createElement("span")),F.style.font=t;const{fontFamily:e,fontSize:i,fontWeight:s,fontStyle:n}=F.style;return{family:e,size:i,weight:s,style:n}}static toCSSString(t){var e;if(!t)return"";let i;const s=t.style;let n;i=s===L.NORMAL||""===s||void 0===s?"":s.trim()+" ";const o=t.weight;let a;n=o===E.NORMAL||""===o||void 0===o?"":"number"==typeof o?o+" ":o.trim()+" ";const r=t.size;a=void 0===r?B.get("fontSize")+"pt":"number"==typeof r?r+"pt ":r.trim()+" ";return`${i}${n}${a}${null!==(e=t.family)&&void 0!==e?e:B.get("fontFamily")}`}static scaleSize(t,e){if("number"==typeof t)return t*e;return`${parseFloat(t)*e}${t.replace(/[\d.\s]/g,"")}`}static isBold(t){if(t){if("number"==typeof t)return t>=600;{const e=parseInt(t,10);return isNaN(e)?"bold"===t.toLowerCase():e>=600}}return!1}static isItalic(t){return!!t&&t.toLowerCase()===L.ITALIC}static load(t,e,i){return N(this,void 0,void 0,function*(){if("undefined"==typeof FontFace)return Promise.reject(new Error("FontFace API is not available in this environment. Cannot load fonts."));if(void 0===e){const i=A.FILES;if(!(t in i))return Promise.reject(new Error(`Font ${t} not found in Font.FILES`));e=A.HOST_URL+i[t]}const s=new FontFace(t,`url(${e})`,i),n=s.load();let o;return"undefined"!=typeof document?o=document.fonts:"undefined"!=typeof self&&"fonts"in self&&(o=self.fonts),null==o||o.add(s),v.clear(),n.finally(()=>v.clear())})}static getURLForFont(t){const e=A.FILES;if(t in e)return A.HOST_URL+e[t]}}A.TEXT_FONT_NAMES=["Academico","Edwin","Bravura Text","Finale Ash Text","Finale Broadway Text","Finale Jazz Text","Finale Maestro Text","Gootville Text","Leland Text","MuseJazz Text","Nepomuk","Petaluma Script","Petaluma Text","Roboto Slab","Sebastian Text"],A.scaleToPxFrom={pt:4/3,px:1,em:16,"%":.16,in:96,mm:96/25.4,cm:96/2.54},A.HOST_URL="https://cdn.jsdelivr.net/npm/@vexflow-fonts/",A.FILES={Academico:"academico/academico.woff2",Bravura:"bravura/bravura.woff2","Bravura Text":"bravuratext/bravuratext.woff2",Edwin:"edwin/edwin-roman.woff2","Finale Ash":"finaleash/finaleash.woff2","Finale Ash Text":"finaleashtext/finaleashtext.woff2","Finale Broadway":"finalebroadway/finalebroadway.woff2","Finale Broadway Text":"finalebroadwaytext/finalebroadwaytext.woff2","Finale Jazz":"finalejazz/finalejazz.woff2","Finale Jazz Text":"finalejazztext/finalejazztext.woff2","Finale Maestro":"finalemaestro/finalemaestro.woff2","Finale Maestro Text":"finalemaestrotext/finalemaestrotext-regular.woff2",Gonville:"gonville/gonville.woff2",Gootville:"gootville/gootville.woff2","Gootville Text":"gootvilletext/gootvilletext.woff2",Leipzig:"leipzig/leipzig.woff2",Leland:"leland/leland.woff2","Leland Text":"lelandtext/lelandtext.woff2",MuseJazz:"musejazz/musejazz.woff2","MuseJazz Text":"musejazztext/musejazztext.woff2",Nepomuk:"nepomuk/nepomuk.woff2",Petaluma:"petaluma/petaluma.woff2","Petaluma Script":"petalumascript/petalumascript.woff2","Petaluma Text":"petalumatext/petalumatext.woff2","Roboto Slab":"robotoslab/robotoslab-regular-400.woff2",Sebastian:"sebastian/sebastian.woff2","Sebastian Text":"sebastiantext/sebastiantext.woff2"};class O{constructor(){this.id=Object.create(null),this.type=Object.create(null),this.class=Object.create(null)}static isValidName(t){return"id"===t||"type"===t||"class"===t}}class R{static getDefaultRegistry(){return R.defaultRegistry}static enableDefaultRegistry(t){R.defaultRegistry=t}static disableDefaultRegistry(){R.defaultRegistry=void 0}constructor(){this.index=new O}clear(){return this.index=new O,this}setIndexValue(t,e,i,s){if(!O.isValidName(t))throw new p("BadArgument",`Unknown registry index: ${t}`);const n=this.index;n[t][e]||(n[t][e]=Object.create(null)),n[t][e][i]=s}updateIndex({id:t,name:e,value:i,oldValue:s}){if(!O.isValidName(e))throw new p("BadArgument",`Unknown registry index: ${e}`);const n=this.getElementById(t);void 0!==s&&this.index[e][s]&&delete this.index[e][s][t],i&&n&&this.setIndexValue(e,i,n.getAttribute("id"),n)}register(t,e){if(!(e=e||t.getAttribute("id")))throw new p("Can't add element without `id` attribute to registry");return t.setAttribute("id",e),this.setIndexValue("id",e,e,t),this.updateIndex({id:e,name:"type",value:t.getAttribute("type"),oldValue:void 0}),t.onRegister(this),this}getElementById(t){var e,i;return null===(i=null===(e=this.index.id)||void 0===e?void 0:e[t])||void 0===i?void 0:i[t]}getElementsByAttribute(t,e){if(!O.isValidName(t))return[];const i=this.index[t];if(i){const t=i[e];if(t){return Object.keys(t).map(e=>t[e])}}return[]}getElementsByType(t){return this.getElementsByAttribute("type",t)}getElementsByClass(t){return this.getElementsByAttribute("class",t)}onUpdate(t){return O.isValidName(t.name)&&this.updateIndex(t),this}}class P{static get CATEGORY(){return"Element"}static newID(){return"auto"+P.ID++}static setTextMeasurementCanvas(t){P.txtCanvas=t,P.clearTextMeasurementCache()}static clearTextMeasurementCache(){v.clear()}static getTextMeasurementCanvas(){let t=P.txtCanvas;return t||("undefined"!=typeof document?t=document.createElement("canvas"):"undefined"!=typeof OffscreenCanvas&&(t=new OffscreenCanvas(300,150)),P.txtCanvas=t),t}constructor(t){var e;this.children=[],this.style={},this.styleExplicit=!1,this._text="",this.metricsValid=!1,this._textMetrics={fontBoundingBoxAscent:0,fontBoundingBoxDescent:0,actualBoundingBoxAscent:0,actualBoundingBoxDescent:0,actualBoundingBoxLeft:0,actualBoundingBoxRight:0,width:0,alphabeticBaseline:0,emHeightAscent:0,emHeightDescent:0,hangingBaseline:0,ideographicBaseline:0},this._height=0,this._width=0,this.xShift=0,this.yShift=0,this.x=0,this.y=0,this.attrs={id:P.newID(),type:null!=t?t:this.constructor.CATEGORY,class:""},this.rendered=!1,this._fontInfo=B.getFontInfo(this.attrs.type),this.style=B.getStyle(this.attrs.type),this.fontScale=B.get(`${this.attrs.type}.fontScale`),this.shouldDrawPointerRect=B.get(`${this.attrs.type}.pointerRect`),null===(e=R.getDefaultRegistry())||void 0===e||e.register(this)}addChild(t){if(t.parent)throw new p("Element","Parent already defined");return t.parent=this,this.children.push(t),this}getCategory(){return this.attrs.type}setStyle(t){return this.style=t,this.styleExplicit=!0,this}setGroupStyle(t){return this.style=t,this.styleExplicit=!0,this.children.forEach(e=>e.setGroupStyle(t)),this}getStyle(){return this.style}applyStyle(t=this.context,e=this.getStyle()){if(!t)return this;if(e===this.style&&!this.styleExplicit){const i=t.getDefaultStyle();e=Object.assign({},e),void 0!==i.fillStyle&&delete e.fillStyle,void 0!==i.strokeStyle&&delete e.strokeStyle}return e.shadowColor&&t.setShadowColor(e.shadowColor),void 0!==e.shadowBlur&&t.setShadowBlur(e.shadowBlur),e.fillStyle&&t.setFillStyle(e.fillStyle),e.strokeStyle&&t.setStrokeStyle(e.strokeStyle),void 0!==e.lineWidth&&t.setLineWidth(e.lineWidth),void 0!==e.lineDash&&t.setLineDash(e.lineDash?e.lineDash.split(" ").map(Number):[]),this}drawWithStyle(){const t=this.checkContext(),e=t.getDefaultStyle();t.save();try{if(this.styleExplicit){const i=Object.assign({},e);void 0!==this.style.fillStyle&&(i.fillStyle=this.style.fillStyle),void 0!==this.style.strokeStyle&&(i.strokeStyle=this.style.strokeStyle),t.setDefaultStyle(i)}this.applyStyle(t),this.draw()}finally{t.setDefaultStyle(e),t.restore()}return this}draw(){throw new p("Element","Draw not defined")}hasClass(t){var e;return!!this.attrs.class&&-1!==(null===(e=this.attrs.class)||void 0===e?void 0:e.split(" ").indexOf(t))}addClass(t){var e;return this.hasClass(t)||(this.attrs.class?this.attrs.class=`${this.attrs.class} ${t}`:this.attrs.class=`${t}`,null===(e=this.registry)||void 0===e||e.onUpdate({id:this.attrs.id,name:"class",value:t,oldValue:void 0})),this}removeClass(t){var e,i;if(!this.hasClass(t))return this;const s=null===(e=this.attrs.class)||void 0===e?void 0:e.split(" ");return s&&(s.splice(s.indexOf(t)),this.attrs.class=s.join(" ")),null===(i=this.registry)||void 0===i||i.onUpdate({id:this.attrs.id,name:"class",value:void 0,oldValue:t}),this}onRegister(t){return this.registry=t,this}isRendered(){return this.rendered}setRendered(t=!0){return this.rendered=t,this}getAttributes(){return this.attrs}getAttribute(t){return this.attrs[t]}getSVGElement(t=""){const e=x(this.attrs.id+t),i=document.getElementById(e);if(i)return i}setAttribute(t,e){var i;const s=this.attrs.id,n=this.attrs[t];return this.attrs[t]=e,null===(i=this.registry)||void 0===i||i.onUpdate({id:s,name:t,value:e,oldValue:n}),this}getBoundingBox(){return new D(this.x+this.xShift,this.y+this.yShift-this.textMetrics.actualBoundingBoxAscent,this.width,this.height)}getContext(){return this.context}drawPointerRect(){var t;if(this.shouldDrawPointerRect){const e=this.getBoundingBox();null===(t=this.context)||void 0===t||t.pointerRect(e.getX(),e.getY(),e.getW(),e.getH())}}setContext(t){return this.context=t,this}checkContext(){return f(this.context,"NoContext","No rendering context attached to instance.")}set font(t){this.setFont(t)}get font(){return A.toCSSString(this._fontInfo)}setFont(t,e,i,s){const n=B.getFontInfo(this.attrs.type),o="object"==typeof t,a="string"==typeof t,r=void 0===e&&void 0===i&&void 0===s;return this.metricsValid=!1,this._fontInfo=o?Object.assign(Object.assign({},n),t):a&&r?A.fromCSSString(t):A.validate(null!=t?t:n.family,null!=e?e:n.size,null!=i?i:n.weight,null!=s?s:n.style),this}getFont(){return A.toCSSString(this._fontInfo)}get fontInfo(){return this._fontInfo}set fontInfo(t){this.setFont(t)}setFontSize(t){const e=this.fontInfo;return this.setFont(e.family,t,e.weight,e.style),this}getFontSize(){return this.fontSize}getFontScale(){return this.fontScale}set fontSize(t){this.setFontSize(t)}get fontSize(){let t=this.fontInfo.size;return"number"==typeof t&&(t=`${t}pt`),t}get fontSizeInPoints(){return A.convertSizeToPointValue(this.fontSize)}get fontSizeInPixels(){return A.convertSizeToPixelValue(this.fontSize)}get fontStyle(){return this.fontInfo.style}set fontStyle(t){const e=this.fontInfo;this.setFont(e.family,e.size,e.weight,t)}get fontWeight(){return this.fontInfo.weight+""}set fontWeight(t){const e=this.fontInfo;this.setFont(e.family,e.size,t,e.style)}getWidth(){return this.width}get width(){return this.metricsValid||this.measureText(),this._width}setWidth(t){return this.width=t,this}set width(t){this.metricsValid||this.measureText(),this._width=t}setX(t){return this.x=t,this}getX(){return this.x}getY(){return this.y}setY(t){return this.y=t,this}setYShift(t){return this.yShift=t,this}getYShift(){return this.yShift}setXShift(t){return this.xShift=t,this}getXShift(){return this.xShift}setText(t){return this.text=t,this}set text(t){this.metricsValid=!1,this._text=t}getText(){return this._text}get text(){return this._text}renderText(t,e,i){t.setFont(this._fontInfo),t.fillText(this._text,e+this.x+this.xShift,i+this.y+this.yShift),this.children.forEach(s=>{t.setFont(s.fontInfo),t.fillText(s.text,e+s.x+s.xShift,i+s.y+s.yShift)})}measureText(){var t;const e=null===(t=P.getTextMeasurementCanvas())||void 0===t?void 0:t.getContext("2d");return e?(e.font=A.toCSSString(A.validate(this.fontInfo)),this._textMetrics=Object.assign({},v.measure(e,this.text)),this._height=this._textMetrics.actualBoundingBoxAscent+this._textMetrics.actualBoundingBoxDescent,this._width=this._textMetrics.width,this.metricsValid=!0,this._textMetrics):(console.warn("Element: No context for txtCanvas. Returning empty text metrics."),this._textMetrics)}static measureWidth(t,e=""){var i;const s=null===(i=P.getTextMeasurementCanvas())||void 0===i?void 0:i.getContext("2d");return s?(s.font=A.toCSSString(B.getFontInfo(e)),v.measure(s,t).width):(console.warn("Element: No context for txtCanvas. Returning empty text metrics."),0)}getTextMetrics(){return this.textMetrics}get textMetrics(){return this.metricsValid||this.measureText(),this._textMetrics}getHeight(){return this.height}get height(){return this.metricsValid||this.measureText(),this._height}set height(t){this.metricsValid||this.measureText(),this._height=t}setOriginX(t){const e=this.getBoundingBox(),i=(t-Math.abs((e.getX()-this.x-this.xShift)/e.getW()))*e.getW();this.xShift=-i}setOriginY(t){const e=this.getBoundingBox(),i=(t-Math.abs((e.getY()-this.y-this.yShift)/e.getH()))*e.getH();this.yShift=-i}setOrigin(t,e){this.setOriginX(t),this.setOriginY(e)}}var M,I;P.ID=1e3,function(t){t[t.CENTER=0]="CENTER",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.ABOVE=3]="ABOVE",t[t.BELOW=4]="BELOW"}(M||(M={}));class W extends P{static get CATEGORY(){return"Modifier"}static get Position(){return M}static get PositionString(){return{center:M.CENTER,above:M.ABOVE,below:M.BELOW,left:M.LEFT,right:M.RIGHT}}constructor(){super(),this.width=0,this.textLine=0,this.position=W.Position.LEFT,this.spacingFromNextModifier=0}reset(){}getNote(){return f(this.note,"NoNote","Modifier has no note.")}checkAttachedNote(){const t=this.getCategory();return f(this.index,"NoIndex",`Can't draw ${t} without an index.`),f(this.note,"NoNote",`Can't draw ${t} without a note.`)}setNote(t){return this.note=t,this}getIndex(){return this.index}checkIndex(){return f(this.index,"NoIndex","Modifier has an invalid index.")}setIndex(t){return this.index=t,this}getModifierContext(){return this.modifierContext}checkModifierContext(){return f(this.modifierContext,"NoModifierContext","Modifier Context Required")}setModifierContext(t){return this.modifierContext=t,this}getPosition(){return this.position}setPosition(t){return this.position="string"==typeof t?W.PositionString[t]:t,this.reset(),this}setTextLine(t){return this.textLine=t,this}setYShift(t){return this.yShift=t,this}setSpacingFromNextModifier(t){this.spacingFromNextModifier=t}getSpacingFromNextModifier(){return this.spacingFromNextModifier}setXShift(t){return this.xShift=0,this.position===W.Position.LEFT?this.xShift-=t:this.xShift+=t,this}getXShift(){return this.xShift}draw(){throw this.checkContext(),new p("NotImplemented","draw() not implemented for this modifier.")}alignSubNotesWithNote(t,e,i=W.Position.LEFT){const s=e.getTickContext(),n=s.getMetrics(),o=e.getStave(),a=i===W.Position.RIGHT?s.getX()+this.getSpacingFromNextModifier()*t.length+10:s.getX()-n.modLeftPx-n.modRightPx+this.getSpacingFromNextModifier();t.forEach(t=>{const e=t.getTickContext();o&&t.setStave(o),e.setXOffset(a)})}}class H{static get NUM_TONES(){return this.canonicalNotes.length}static get roots(){return["c","d","e","f","g","a","b"]}static get rootValues(){return[0,2,4,5,7,9,11]}static get rootIndexes(){return{c:0,d:1,e:2,f:3,g:4,a:5,b:6}}static get canonicalNotes(){return["c","c#","d","d#","e","f","f#","g","g#","a","a#","b"]}static get diatonicIntervals(){return["unison","m2","M2","m3","M3","p4","dim5","p5","m6","M6","b7","M7","octave"]}static get diatonicAccidentals(){return{unison:{note:0,accidental:0},m2:{note:1,accidental:-1},M2:{note:1,accidental:0},m3:{note:2,accidental:-1},M3:{note:2,accidental:0},p4:{note:3,accidental:0},dim5:{note:4,accidental:-1},p5:{note:4,accidental:0},m6:{note:5,accidental:-1},M6:{note:5,accidental:0},b7:{note:6,accidental:-1},M7:{note:6,accidental:0},octave:{note:7,accidental:0}}}static get intervals(){return{u:0,unison:0,m2:1,b2:1,min2:1,S:1,H:1,2:2,M2:2,maj2:2,T:2,W:2,m3:3,b3:3,min3:3,M3:4,3:4,maj3:4,4:5,p4:5,"#4":6,b5:6,aug4:6,dim5:6,5:7,p5:7,"#5":8,b6:8,aug5:8,6:9,M6:9,maj6:9,b7:10,m7:10,min7:10,dom7:10,M7:11,maj7:11,8:12,octave:12}}static get scales(){return{major:[2,2,1,2,2,2,1],minor:[2,1,2,2,1,2,2],ionian:[2,2,1,2,2,2,1],dorian:[2,1,2,2,2,1,2],phyrgian:[1,2,2,2,1,2,2],lydian:[2,2,2,1,2,2,1],mixolydian:[2,2,1,2,2,1,2],aeolian:[2,1,2,2,1,2,2],locrian:[1,2,2,1,2,2,2]}}static get scaleTypes(){return{M:H.scales.major,m:H.scales.minor}}static get accidentals(){return["bb","b","n","#","##"]}static get noteValues(){return{c:{rootIndex:0,intVal:0},cn:{rootIndex:0,intVal:0},"c#":{rootIndex:0,intVal:1},"c##":{rootIndex:0,intVal:2},cb:{rootIndex:0,intVal:11},cbb:{rootIndex:0,intVal:10},d:{rootIndex:1,intVal:2},dn:{rootIndex:1,intVal:2},"d#":{rootIndex:1,intVal:3},"d##":{rootIndex:1,intVal:4},db:{rootIndex:1,intVal:1},dbb:{rootIndex:1,intVal:0},e:{rootIndex:2,intVal:4},en:{rootIndex:2,intVal:4},"e#":{rootIndex:2,intVal:5},"e##":{rootIndex:2,intVal:6},eb:{rootIndex:2,intVal:3},ebb:{rootIndex:2,intVal:2},f:{rootIndex:3,intVal:5},fn:{rootIndex:3,intVal:5},"f#":{rootIndex:3,intVal:6},"f##":{rootIndex:3,intVal:7},fb:{rootIndex:3,intVal:4},fbb:{rootIndex:3,intVal:3},g:{rootIndex:4,intVal:7},gn:{rootIndex:4,intVal:7},"g#":{rootIndex:4,intVal:8},"g##":{rootIndex:4,intVal:9},gb:{rootIndex:4,intVal:6},gbb:{rootIndex:4,intVal:5},a:{rootIndex:5,intVal:9},an:{rootIndex:5,intVal:9},"a#":{rootIndex:5,intVal:10},"a##":{rootIndex:5,intVal:11},ab:{rootIndex:5,intVal:8},abb:{rootIndex:5,intVal:7},b:{rootIndex:6,intVal:11},bn:{rootIndex:6,intVal:11},"b#":{rootIndex:6,intVal:0},"b##":{rootIndex:6,intVal:1},bb:{rootIndex:6,intVal:10},bbb:{rootIndex:6,intVal:9}}}isValidNoteValue(t){return t>=0&&t<H.canonicalNotes.length}isValidIntervalValue(t){return t>=0&&t<H.diatonicIntervals.length}getNoteParts(t){if(!t||t.length<1)throw new p("BadArguments","Invalid note name: "+t);if(t.length>3)throw new p("BadArguments","Invalid note name: "+t);const e=t.toLowerCase(),i=/^([cdefgab])(b|bb|n|#|##)?$/.exec(e);if(null!==i){return{root:i[1],accidental:i[2]}}throw new p("BadArguments","Invalid note name: "+t)}getKeyParts(t){if(!t||t.length<1)throw new p("BadArguments","Invalid key: "+t);const e=t.toLowerCase(),i=/^([cdefgab])(b|#)?(mel|harm|m|M)?$/.exec(e);if(null!==i){const t=i[1],e=i[2];let s=i[3];return s||(s="M"),{root:t,accidental:e,type:s}}throw new p("BadArguments",`Invalid key: ${t}`)}getNoteValue(t){const e=H.noteValues[t];if(void 0===e)throw new p("BadArguments",`Invalid note name: ${t}`);return e.intVal}getIntervalValue(t){const e=H.intervals[t];if(void 0===e)throw new p("BadArguments",`Invalid interval name: ${t}`);return e}getCanonicalNoteName(t){if(!this.isValidNoteValue(t))throw new p("BadArguments",`Invalid note value: ${t}`);return H.canonicalNotes[t]}getCanonicalIntervalName(t){if(!this.isValidIntervalValue(t))throw new p("BadArguments",`Invalid interval value: ${t}`);return H.diatonicIntervals[t]}getRelativeNoteValue(t,e,i=1){if(1!==i&&-1!==i)throw new p("BadArguments",`Invalid direction: ${i}`);let s=(t+i*e)%H.NUM_TONES;return s<0&&(s+=H.NUM_TONES),s}getRelativeNoteName(t,e){const i=this.getNoteParts(t),s=this.getNoteValue(i.root);let n=e-s;if(Math.abs(n)>H.NUM_TONES-3){let i=1;n>0&&(i=-1);const o=(e+1+(s+1))%H.NUM_TONES*i;if(Math.abs(o)>2)throw new p("BadArguments",`Notes not related: ${t}, ${e})`);n=o}if(Math.abs(n)>2)throw new p("BadArguments",`Notes not related: ${t}, ${e})`);let o=i.root;if(n>0)for(let t=1;t<=n;++t)o+="#";else if(n<0)for(let t=-1;t>=n;--t)o+="b";return o}getScaleTones(t,e){const i=[t];let s=t;for(let n=0;n<e.length;n++)s=this.getRelativeNoteValue(s,e[n]),s!==t&&i.push(s);return i}getIntervalBetween(t,e,i=1){if(1!==i&&-1!==i)throw new p("BadArguments",`Invalid direction: ${i}`);if(!this.isValidNoteValue(t)||!this.isValidNoteValue(e))throw new p("BadArguments",`Invalid notes: ${t}, ${e}`);let s=1===i?e-t:t-e;return s<0&&(s+=H.NUM_TONES),s}createScaleMap(t){const e=this.getKeyParts(t);if(!e.type)throw new p("BadArguments","Unsupported key type: undefined");const i=H.scaleTypes[e.type];let s=e.root;if(e.accidental&&(s+=e.accidental),!i)throw new p("BadArguments","Unsupported key type: "+t);const n=this.getScaleTones(this.getNoteValue(s),i),o=H.rootIndexes[e.root],a={};for(let t=0;t<H.roots.length;++t){const e=(o+t)%H.roots.length,i=H.roots[e];let s=this.getRelativeNoteName(i,n[t]);1===s.length&&(s+="n"),a[i]=s}return a}}!function(t){t.null="\0",t.fourStringTabClef="",t.sixStringTabClef="",t.accSagittal11LargeDiesisDown="",t.accSagittal11LargeDiesisUp="",t.accSagittal11MediumDiesisDown="",t.accSagittal11MediumDiesisUp="",t.accSagittal11v19LargeDiesisDown="",t.accSagittal11v19LargeDiesisUp="",t.accSagittal11v19MediumDiesisDown="",t.accSagittal11v19MediumDiesisUp="",t.accSagittal11v49CommaDown="",t.accSagittal11v49CommaUp="",t.accSagittal143CommaDown="",t.accSagittal143CommaUp="",t.accSagittal17CommaDown="",t.accSagittal17CommaUp="",t.accSagittal17KleismaDown="",t.accSagittal17KleismaUp="",t.accSagittal19CommaDown="",t.accSagittal19CommaUp="",t.accSagittal19SchismaDown="",t.accSagittal19SchismaUp="",t.accSagittal1MinaDown="",t.accSagittal1MinaUp="",t.accSagittal1TinaDown="",t.accSagittal1TinaUp="",t.accSagittal23CommaDown="",t.accSagittal23CommaUp="",t.accSagittal23SmallDiesisDown="",t.accSagittal23SmallDiesisUp="",t.accSagittal25SmallDiesisDown="",t.accSagittal25SmallDiesisUp="",t.accSagittal2MinasDown="",t.accSagittal2MinasUp="",t.accSagittal2TinasDown="",t.accSagittal2TinasUp="",t.accSagittal35LargeDiesisDown="",t.accSagittal35LargeDiesisUp="",t.accSagittal35MediumDiesisDown="",t.accSagittal35MediumDiesisUp="",t.accSagittal3TinasDown="",t.accSagittal3TinasUp="",t.accSagittal49LargeDiesisDown="",t.accSagittal49LargeDiesisUp="",t.accSagittal49MediumDiesisDown="",t.accSagittal49MediumDiesisUp="",t.accSagittal49SmallDiesisDown="",t.accSagittal49SmallDiesisUp="",t.accSagittal4TinasDown="",t.accSagittal4TinasUp="",t.accSagittal55CommaDown="",t.accSagittal55CommaUp="",t.accSagittal5CommaDown="",t.accSagittal5CommaUp="",t.accSagittal5TinasDown="",t.accSagittal5TinasUp="",t.accSagittal5v11SmallDiesisDown="",t.accSagittal5v11SmallDiesisUp="",t.accSagittal5v13LargeDiesisDown="",t.accSagittal5v13LargeDiesisUp="",t.accSagittal5v13MediumDiesisDown="",t.accSagittal5v13MediumDiesisUp="",t.accSagittal5v19CommaDown="",t.accSagittal5v19CommaUp="",t.accSagittal5v23SmallDiesisDown="",t.accSagittal5v23SmallDiesisUp="",t.accSagittal5v49MediumDiesisDown="",t.accSagittal5v49MediumDiesisUp="",t.accSagittal5v7KleismaDown="",t.accSagittal5v7KleismaUp="",t.accSagittal6TinasDown="",t.accSagittal6TinasUp="",t.accSagittal7CommaDown="",t.accSagittal7CommaUp="",t.accSagittal7TinasDown="",t.accSagittal7TinasUp="",t.accSagittal7v11CommaDown="",t.accSagittal7v11CommaUp="",t.accSagittal7v11KleismaDown="",t.accSagittal7v11KleismaUp="",t.accSagittal7v19CommaDown="",t.accSagittal7v19CommaUp="",t.accSagittal8TinasDown="",t.accSagittal8TinasUp="",t.accSagittal9TinasDown="",t.accSagittal9TinasUp="",t.accSagittalAcute="",t.accSagittalDoubleFlat="",t.accSagittalDoubleFlat11v49CUp="",t.accSagittalDoubleFlat143CUp="",t.accSagittalDoubleFlat17CUp="",t.accSagittalDoubleFlat17kUp="",t.accSagittalDoubleFlat19CUp="",t.accSagittalDoubleFlat19sUp="",t.accSagittalDoubleFlat23CUp="",t.accSagittalDoubleFlat23SUp="",t.accSagittalDoubleFlat25SUp="",t.accSagittalDoubleFlat49SUp="",t.accSagittalDoubleFlat55CUp="",t.accSagittalDoubleFlat5CUp="",t.accSagittalDoubleFlat5v11SUp="",t.accSagittalDoubleFlat5v19CUp="",t.accSagittalDoubleFlat5v23SUp="",t.accSagittalDoubleFlat5v7kUp="",t.accSagittalDoubleFlat7CUp="",t.accSagittalDoubleFlat7v11CUp="",t.accSagittalDoubleFlat7v11kUp="",t.accSagittalDoubleFlat7v19CUp="",t.accSagittalDoubleSharp="",t.accSagittalDoubleSharp11v49CDown="",t.accSagittalDoubleSharp143CDown="",t.accSagittalDoubleSharp17CDown="",t.accSagittalDoubleSharp17kDown="",t.accSagittalDoubleSharp19CDown="",t.accSagittalDoubleSharp19sDown="",t.accSagittalDoubleSharp23CDown="",t.accSagittalDoubleSharp23SDown="",t.accSagittalDoubleSharp25SDown="",t.accSagittalDoubleSharp49SDown="",t.accSagittalDoubleSharp55CDown="",t.accSagittalDoubleSharp5CDown="",t.accSagittalDoubleSharp5v11SDown="",t.accSagittalDoubleSharp5v19CDown="",t.accSagittalDoubleSharp5v23SDown="",t.accSagittalDoubleSharp5v7kDown="",t.accSagittalDoubleSharp7CDown="",t.accSagittalDoubleSharp7v11CDown="",t.accSagittalDoubleSharp7v11kDown="",t.accSagittalDoubleSharp7v19CDown="",t.accSagittalFlat="",t.accSagittalFlat11LDown="",t.accSagittalFlat11MDown="",t.accSagittalFlat11v19LDown="",t.accSagittalFlat11v19MDown="",t.accSagittalFlat11v49CDown="",t.accSagittalFlat11v49CUp="",t.accSagittalFlat143CDown="",t.accSagittalFlat143CUp="",t.accSagittalFlat17CDown="",t.accSagittalFlat17CUp="",t.accSagittalFlat17kDown="",t.accSagittalFlat17kUp="",t.accSagittalFlat19CDown="",t.accSagittalFlat19CUp="",t.accSagittalFlat19sDown="",t.accSagittalFlat19sUp="",t.accSagittalFlat23CDown="",t.accSagittalFlat23CUp="",t.accSagittalFlat23SDown="",t.accSagittalFlat23SUp="",t.accSagittalFlat25SDown="",t.accSagittalFlat25SUp="",t.accSagittalFlat35LDown="",t.accSagittalFlat35MDown="",t.accSagittalFlat49LDown="",t.accSagittalFlat49MDown="",t.accSagittalFlat49SDown="",t.accSagittalFlat49SUp="",t.accSagittalFlat55CDown="",t.accSagittalFlat55CUp="",t.accSagittalFlat5CDown="",t.accSagittalFlat5CUp="",t.accSagittalFlat5v11SDown="",t.accSagittalFlat5v11SUp="",t.accSagittalFlat5v13LDown="",t.accSagittalFlat5v13MDown="",t.accSagittalFlat5v19CDown="",t.accSagittalFlat5v19CUp="",t.accSagittalFlat5v23SDown="",t.accSagittalFlat5v23SUp="",t.accSagittalFlat5v49MDown="",t.accSagittalFlat5v7kDown="",t.accSagittalFlat5v7kUp="",t.accSagittalFlat7CDown="",t.accSagittalFlat7CUp="",t.accSagittalFlat7v11CDown="",t.accSagittalFlat7v11CUp="",t.accSagittalFlat7v11kDown="",t.accSagittalFlat7v11kUp="",t.accSagittalFlat7v19CDown="",t.accSagittalFlat7v19CUp="",t.accSagittalFractionalTinaDown="",t.accSagittalFractionalTinaUp="",t.accSagittalGrave="",t.accSagittalShaftDown="",t.accSagittalShaftUp="",t.accSagittalSharp="",t.accSagittalSharp11LUp="",t.accSagittalSharp11MUp="",t.accSagittalSharp11v19LUp="",t.accSagittalSharp11v19MUp="",t.accSagittalSharp11v49CDown="",t.accSagittalSharp11v49CUp="",t.accSagittalSharp143CDown="",t.accSagittalSharp143CUp="",t.accSagittalSharp17CDown="",t.accSagittalSharp17CUp="",t.accSagittalSharp17kDown="",t.accSagittalSharp17kUp="",t.accSagittalSharp19CDown="",t.accSagittalSharp19CUp="",t.accSagittalSharp19sDown="",t.accSagittalSharp19sUp="",t.accSagittalSharp23CDown="",t.accSagittalSharp23CUp="",t.accSagittalSharp23SDown="",t.accSagittalSharp23SUp="",t.accSagittalSharp25SDown="",t.accSagittalSharp25SUp="",t.accSagittalSharp35LUp="",t.accSagittalSharp35MUp="",t.accSagittalSharp49LUp="",t.accSagittalSharp49MUp="",t.accSagittalSharp49SDown="",t.accSagittalSharp49SUp="",t.accSagittalSharp55CDown="",t.accSagittalSharp55CUp="",t.accSagittalSharp5CDown="",t.accSagittalSharp5CUp="",t.accSagittalSharp5v11SDown="",t.accSagittalSharp5v11SUp="",t.accSagittalSharp5v13LUp="",t.accSagittalSharp5v13MUp="",t.accSagittalSharp5v19CDown="",t.accSagittalSharp5v19CUp="",t.accSagittalSharp5v23SDown="",t.accSagittalSharp5v23SUp="",t.accSagittalSharp5v49MUp="",t.accSagittalSharp5v7kDown="",t.accSagittalSharp5v7kUp="",t.accSagittalSharp7CDown="",t.accSagittalSharp7CUp="",t.accSagittalSharp7v11CDown="",t.accSagittalSharp7v11CUp="",t.accSagittalSharp7v11kDown="",t.accSagittalSharp7v11kUp="",t.accSagittalSharp7v19CDown="",t.accSagittalSharp7v19CUp="",t.accSagittalUnused1="",t.accSagittalUnused2="",t.accSagittalUnused3="",t.accSagittalUnused4="",t.accdnCombDot="",t.accdnCombLH2RanksEmpty="",t.accdnCombLH3RanksEmptySquare="",t.accdnCombRH3RanksEmpty="",t.accdnCombRH4RanksEmpty="",t.accdnDiatonicClef="",t.accdnLH2Ranks16Round="",t.accdnLH2Ranks8Plus16Round="",t.accdnLH2Ranks8Round="",t.accdnLH2RanksFullMasterRound="",t.accdnLH2RanksMasterPlus16Round="",t.accdnLH2RanksMasterRound="",t.accdnLH3Ranks2Plus8Square="",t.accdnLH3Ranks2Square="",t.accdnLH3Ranks8Square="",t.accdnLH3RanksDouble8Square="",t.accdnLH3RanksTuttiSquare="",t.accdnPull="",t.accdnPush="",t.accdnRH3RanksAccordion="",t.accdnRH3RanksAuthenticMusette="",t.accdnRH3RanksBandoneon="",t.accdnRH3RanksBassoon="",t.accdnRH3RanksClarinet="",t.accdnRH3RanksDoubleTremoloLower8ve="",t.accdnRH3RanksDoubleTremoloUpper8ve="",t.accdnRH3RanksFullFactory="",t.accdnRH3RanksHarmonium="",t.accdnRH3RanksImitationMusette="",t.accdnRH3RanksLowerTremolo8="",t.accdnRH3RanksMaster="",t.accdnRH3RanksOboe="",t.accdnRH3RanksOrgan="",t.accdnRH3RanksPiccolo="",t.accdnRH3RanksTremoloLower8ve="",t.accdnRH3RanksTremoloUpper8ve="",t.accdnRH3RanksTwoChoirs="",t.accdnRH3RanksUpperTremolo8="",t.accdnRH3RanksViolin="",t.accdnRH4RanksAlto="",t.accdnRH4RanksBassAlto="",t.accdnRH4RanksMaster="",t.accdnRH4RanksSoftBass="",t.accdnRH4RanksSoftTenor="",t.accdnRH4RanksSoprano="",t.accdnRH4RanksTenor="",t.accdnRicochet2="",t.accdnRicochet3="",t.accdnRicochet4="",t.accdnRicochet5="",t.accdnRicochet6="",t.accdnRicochetStem2="",t.accdnRicochetStem3="",t.accdnRicochetStem4="",t.accdnRicochetStem5="",t.accdnRicochetStem6="",t.accidental1CommaFlat="",t.accidental1CommaSharp="",t.accidental2CommaFlat="",t.accidental2CommaSharp="",t.accidental3CommaFlat="",t.accidental3CommaSharp="",t.accidental4CommaFlat="",t.accidental5CommaSharp="",t.accidentalArrowDown="",t.accidentalArrowUp="",t.accidentalBakiyeFlat="",t.accidentalBakiyeSharp="",t.accidentalBracketLeft="",t.accidentalBracketRight="",t.accidentalBuyukMucennebFlat="",t.accidentalBuyukMucennebSharp="",t.accidentalCombiningCloseCurlyBrace="",t.accidentalCombiningLower17Schisma="",t.accidentalCombiningLower19Schisma="",t.accidentalCombiningLower23Limit29LimitComma="",t.accidentalCombiningLower29LimitComma="",t.accidentalCombiningLower31Schisma="",t.accidentalCombiningLower37Quartertone="",t.accidentalCombiningLower41Comma="",t.accidentalCombiningLower43Comma="",t.accidentalCombiningLower47Quartertone="",t.accidentalCombiningLower53LimitComma="",t.accidentalCombiningOpenCurlyBrace="",t.accidentalCombiningRaise17Schisma="",t.accidentalCombiningRaise19Schisma="",t.accidentalCombiningRaise23Limit29LimitComma="",t.accidentalCombiningRaise29LimitComma="",t.accidentalCombiningRaise31Schisma="",t.accidentalCombiningRaise37Quartertone="",t.accidentalCombiningRaise41Comma="",t.accidentalCombiningRaise43Comma="",t.accidentalCombiningRaise47Quartertone="",t.accidentalCombiningRaise53LimitComma="",t.accidentalCommaSlashDown="",t.accidentalCommaSlashUp="",t.accidentalDoubleFlat="",t.accidentalDoubleFlatArabic="",t.accidentalDoubleFlatEqualTempered="",t.accidentalDoubleFlatOneArrowDown="",t.accidentalDoubleFlatOneArrowUp="",t.accidentalDoubleFlatReversed="",t.accidentalDoubleFlatThreeArrowsDown="",t.accidentalDoubleFlatThreeArrowsUp="",t.accidentalDoubleFlatTurned="",t.accidentalDoubleFlatTwoArrowsDown="",t.accidentalDoubleFlatTwoArrowsUp="",t.accidentalDoubleSharp="",t.accidentalDoubleSharpArabic="",t.accidentalDoubleSharpEqualTempered="",t.accidentalDoubleSharpOneArrowDown="",t.accidentalDoubleSharpOneArrowUp="",t.accidentalDoubleSharpThreeArrowsDown="",t.accidentalDoubleSharpThreeArrowsUp="",t.accidentalDoubleSharpTwoArrowsDown="",t.accidentalDoubleSharpTwoArrowsUp="",t.accidentalEnharmonicAlmostEqualTo="",t.accidentalEnharmonicEquals="",t.accidentalEnharmonicTilde="",t.accidentalFilledReversedFlatAndFlat="",t.accidentalFilledReversedFlatAndFlatArrowDown="",t.accidentalFilledReversedFlatAndFlatArrowUp="",t.accidentalFilledReversedFlatArrowDown="",t.accidentalFilledReversedFlatArrowUp="",t.accidentalFiveQuarterTonesFlatArrowDown="",t.accidentalFiveQuarterTonesSharpArrowUp="",t.accidentalFlat="",t.accidentalFlatArabic="",t.accidentalFlatEqualTempered="",t.accidentalFlatLoweredStockhausen="",t.accidentalFlatOneArrowDown="",t.accidentalFlatOneArrowUp="",t.accidentalFlatRaisedStockhausen="",t.accidentalFlatRepeatedLineStockhausen="",t.accidentalFlatRepeatedSpaceStockhausen="",t.accidentalFlatThreeArrowsDown="",t.accidentalFlatThreeArrowsUp="",t.accidentalFlatTurned="",t.accidentalFlatTwoArrowsDown="",t.accidentalFlatTwoArrowsUp="",t.accidentalHabaFlatQuarterToneHigher="",t.accidentalHabaFlatThreeQuarterTonesLower="",t.accidentalHabaQuarterToneHigher="",t.accidentalHabaQuarterToneLower="",t.accidentalHabaSharpQuarterToneLower="",t.accidentalHabaSharpThreeQuarterTonesHigher="",t.accidentalHalfSharpArrowDown="",t.accidentalHalfSharpArrowUp="",t.accidentalJohnston13="",t.accidentalJohnston31="",t.accidentalJohnstonDown="",t.accidentalJohnstonEl="",t.accidentalJohnstonMinus="",t.accidentalJohnstonPlus="",t.accidentalJohnstonSeven="",t.accidentalJohnstonUp="",t.accidentalKomaFlat="",t.accidentalKomaSharp="",t.accidentalKoron="",t.accidentalKucukMucennebFlat="",t.accidentalKucukMucennebSharp="",t.accidentalLargeDoubleSharp="",t.accidentalLowerOneSeptimalComma="",t.accidentalLowerOneTridecimalQuartertone="",t.accidentalLowerOneUndecimalQuartertone="",t.accidentalLowerTwoSeptimalCommas="",t.accidentalLoweredStockhausen="",t.accidentalNarrowReversedFlat="",t.accidentalNarrowReversedFlatAndFlat="",t.accidentalNatural="",t.accidentalNaturalArabic="",t.accidentalNaturalEqualTempered="",t.accidentalNaturalFlat="",t.accidentalNaturalLoweredStockhausen="",t.accidentalNaturalOneArrowDown="",t.accidentalNaturalOneArrowUp="",t.accidentalNaturalRaisedStockhausen="",t.accidentalNaturalReversed="",t.accidentalNaturalSharp="",t.accidentalNaturalThreeArrowsDown="",t.accidentalNaturalThreeArrowsUp="",t.accidentalNaturalTwoArrowsDown="",t.accidentalNaturalTwoArrowsUp="",t.accidentalOneAndAHalfSharpsArrowDown="",t.accidentalOneAndAHalfSharpsArrowUp="",t.accidentalOneQuarterToneFlatFerneyhough="",t.accidentalOneQuarterToneFlatStockhausen="",t.accidentalOneQuarterToneSharpFerneyhough="",t.accidentalOneQuarterToneSharpStockhausen="",t.accidentalOneThirdToneFlatFerneyhough="",t.accidentalOneThirdToneSharpFerneyhough="",t.accidentalParensLeft="",t.accidentalParensRight="",t.accidentalQuarterFlatEqualTempered="",t.accidentalQuarterSharpEqualTempered="",t.accidentalQuarterToneFlat4="",t.accidentalQuarterToneFlatArabic="",t.accidentalQuarterToneFlatArrowUp="",t.accidentalQuarterToneFlatFilledReversed="",t.accidentalQuarterToneFlatNaturalArrowDown="",t.accidentalQuarterToneFlatPenderecki="",t.accidentalQuarterToneFlatStein="",t.accidentalQuarterToneFlatVanBlankenburg="",t.accidentalQuarterToneSharp4="",t.accidentalQuarterToneSharpArabic="",t.accidentalQuarterToneSharpArrowDown="",t.accidentalQuarterToneSharpBusotti="",t.accidentalQuarterToneSharpNaturalArrowUp="",t.accidentalQuarterToneSharpStein="",t.accidentalQuarterToneSharpWiggle="",t.accidentalRaiseOneSeptimalComma="",t.accidentalRaiseOneTridecimalQuartertone="",t.accidentalRaiseOneUndecimalQuartertone="",t.accidentalRaiseTwoSeptimalCommas="",t.accidentalRaisedStockhausen="",t.accidentalReversedFlatAndFlatArrowDown="",t.accidentalReversedFlatAndFlatArrowUp="",t.accidentalReversedFlatArrowDown="",t.accidentalReversedFlatArrowUp="",t.accidentalSharp="",t.accidentalSharpArabic="",t.accidentalSharpEqualTempered="",t.accidentalSharpLoweredStockhausen="",t.accidentalSharpOneArrowDown="",t.accidentalSharpOneArrowUp="",t.accidentalSharpOneHorizontalStroke="",t.accidentalSharpRaisedStockhausen="",t.accidentalSharpRepeatedLineStockhausen="",t.accidentalSharpRepeatedSpaceStockhausen="",t.accidentalSharpReversed="",t.accidentalSharpSharp="",t.accidentalSharpThreeArrowsDown="",t.accidentalSharpThreeArrowsUp="",t.accidentalSharpTwoArrowsDown="",t.accidentalSharpTwoArrowsUp="",t.accidentalSims12Down="",t.accidentalSims12Up="",t.accidentalSims4Down="",t.accidentalSims4Up="",t.accidentalSims6Down="",t.accidentalSims6Up="",t.accidentalSori="",t.accidentalTavenerFlat="",t.accidentalTavenerSharp="",t.accidentalThreeQuarterTonesFlatArabic="",t.accidentalThreeQuarterTonesFlatArrowDown="",t.accidentalThreeQuarterTonesFlatArrowUp="",t.accidentalThreeQuarterTonesFlatCouper="",t.accidentalThreeQuarterTonesFlatGrisey="",t.accidentalThreeQuarterTonesFlatTartini="",t.accidentalThreeQuarterTonesFlatZimmermann="",t.accidentalThreeQuarterTonesSharpArabic="",t.accidentalThreeQuarterTonesSharpArrowDown="",t.accidentalThreeQuarterTonesSharpArrowUp="",t.accidentalThreeQuarterTonesSharpBusotti="",t.accidentalThreeQuarterTonesSharpStein="",t.accidentalThreeQuarterTonesSharpStockhausen="",t.accidentalTripleFlat="",t.accidentalTripleSharp="",t.accidentalTwoThirdTonesFlatFerneyhough="",t.accidentalTwoThirdTonesSharpFerneyhough="",t.accidentalUpsAndDownsDown="",t.accidentalUpsAndDownsLess="",t.accidentalUpsAndDownsMore="",t.accidentalUpsAndDownsUp="",t.accidentalWilsonMinus="",t.accidentalWilsonPlus="",t.accidentalWyschnegradsky10TwelfthsFlat="",t.accidentalWyschnegradsky10TwelfthsSharp="",t.accidentalWyschnegradsky11TwelfthsFlat="",t.accidentalWyschnegradsky11TwelfthsSharp="",t.accidentalWyschnegradsky1TwelfthsFlat="",t.accidentalWyschnegradsky1TwelfthsSharp="",t.accidentalWyschnegradsky2TwelfthsFlat="",t.accidentalWyschnegradsky2TwelfthsSharp="",t.accidentalWyschnegradsky3TwelfthsFlat="",t.accidentalWyschnegradsky3TwelfthsSharp="",t.accidentalWyschnegradsky4TwelfthsFlat="",t.accidentalWyschnegradsky4TwelfthsSharp="",t.accidentalWyschnegradsky5TwelfthsFlat="",t.accidentalWyschnegradsky5TwelfthsSharp="",t.accidentalWyschnegradsky6TwelfthsFlat="",t.accidentalWyschnegradsky6TwelfthsSharp="",t.accidentalWyschnegradsky7TwelfthsFlat="",t.accidentalWyschnegradsky7TwelfthsSharp="",t.accidentalWyschnegradsky8TwelfthsFlat="",t.accidentalWyschnegradsky8TwelfthsSharp="",t.accidentalWyschnegradsky9TwelfthsFlat="",t.accidentalWyschnegradsky9TwelfthsSharp="",t.accidentalXenakisOneThirdToneSharp="",t.accidentalXenakisTwoThirdTonesSharp="",t.analyticsChoralmelodie="",t.analyticsEndStimme="",t.analyticsHauptrhythmus="",t.analyticsHauptstimme="",t.analyticsInversion1="",t.analyticsNebenstimme="",t.analyticsStartStimme="",t.analyticsTheme="",t.analyticsTheme1="",t.analyticsThemeInversion="",t.analyticsThemeRetrograde="",t.analyticsThemeRetrogradeInversion="",t.arpeggiato="",t.arpeggiatoDown="",t.arpeggiatoUp="",t.arrowBlackDown="",t.arrowBlackDownLeft="",t.arrowBlackDownRight="",t.arrowBlackLeft="",t.arrowBlackRight="",t.arrowBlackUp="",t.arrowBlackUpLeft="",t.arrowBlackUpRight="",t.arrowOpenDown="",t.arrowOpenDownLeft="",t.arrowOpenDownRight="",t.arrowOpenLeft="",t.arrowOpenRight="",t.arrowOpenUp="",t.arrowOpenUpLeft="",t.arrowOpenUpRight="",t.arrowWhiteDown="",t.arrowWhiteDownLeft="",t.arrowWhiteDownRight="",t.arrowWhiteLeft="",t.arrowWhiteRight="",t.arrowWhiteUp="",t.arrowWhiteUpLeft="",t.arrowWhiteUpRight="",t.arrowheadBlackDown="",t.arrowheadBlackDownLeft="",t.arrowheadBlackDownRight="",t.arrowheadBlackLeft="",t.arrowheadBlackRight="",t.arrowheadBlackUp="",t.arrowheadBlackUpLeft="",t.arrowheadBlackUpRight="",t.arrowheadOpenDown="",t.arrowheadOpenDownLeft="",t.arrowheadOpenDownRight="",t.arrowheadOpenLeft="",t.arrowheadOpenRight="",t.arrowheadOpenUp="",t.arrowheadOpenUpLeft="",t.arrowheadOpenUpRight="",t.arrowheadWhiteDown="",t.arrowheadWhiteDownLeft="",t.arrowheadWhiteDownRight="",t.arrowheadWhiteLeft="",t.arrowheadWhiteRight="",t.arrowheadWhiteUp="",t.arrowheadWhiteUpLeft="",t.arrowheadWhiteUpRight="",t.articAccentAbove="",t.articAccentBelow="",t.articAccentStaccatoAbove="",t.articAccentStaccatoBelow="",t.articLaissezVibrerAbove="",t.articLaissezVibrerBelow="",t.articMarcatoAbove="",t.articMarcatoBelow="",t.articMarcatoStaccatoAbove="",t.articMarcatoStaccatoBelow="",t.articMarcatoTenutoAbove="",t.articMarcatoTenutoBelow="",t.articSoftAccentAbove="",t.articSoftAccentBelow="",t.articSoftAccentStaccatoAbove="",t.articSoftAccentStaccatoBelow="",t.articSoftAccentTenutoAbove="",t.articSoftAccentTenutoBelow="",t.articSoftAccentTenutoStaccatoAbove="",t.articSoftAccentTenutoStaccatoBelow="",t.articStaccatissimoAbove="",t.articStaccatissimoBelow="",t.articStaccatissimoStrokeAbove="",t.articStaccatissimoStrokeBelow="",t.articStaccatissimoWedgeAbove="",t.articStaccatissimoWedgeBelow="",t.articStaccatoAbove="",t.articStaccatoBelow="",t.articStressAbove="",t.articStressBelow="",t.articTenutoAbove="",t.articTenutoAccentAbove="",t.articTenutoAccentBelow="",t.articTenutoBelow="",t.articTenutoStaccatoAbove="",t.articTenutoStaccatoBelow="",t.articUnstressAbove="",t.articUnstressBelow="",t.augmentationDot="",t.barlineDashed="",t.barlineDotted="",t.barlineDouble="",t.barlineFinal="",t.barlineHeavy="",t.barlineHeavyHeavy="",t.barlineReverseFinal="",t.barlineShort="",t.barlineSingle="",t.barlineTick="",t.beamAccelRit1="",t.beamAccelRit10="",t.beamAccelRit11="",t.beamAccelRit12="",t.beamAccelRit13="",t.beamAccelRit14="",t.beamAccelRit15="",t.beamAccelRit2="",t.beamAccelRit3="",t.beamAccelRit4="",t.beamAccelRit5="",t.beamAccelRit6="",t.beamAccelRit7="",t.beamAccelRit8="",t.beamAccelRit9="",t.beamAccelRitFinal="",t.brace="",t.bracket="",t.bracketBottom="",t.bracketTop="",t.brassBend="",t.brassDoitLong="",t.brassDoitMedium="",t.brassDoitShort="",t.brassFallLipLong="",t.brassFallLipMedium="",t.brassFallLipShort="",t.brassFallRoughLong="",t.brassFallRoughMedium="",t.brassFallRoughShort="",t.brassFallSmoothLong="",t.brassFallSmoothMedium="",t.brassFallSmoothShort="",t.brassFlip="",t.brassHarmonMuteClosed="",t.brassHarmonMuteStemHalfLeft="",t.brassHarmonMuteStemHalfRight="",t.brassHarmonMuteStemOpen="",t.brassJazzTurn="",t.brassLiftLong="",t.brassLiftMedium="",t.brassLiftShort="",t.brassLiftSmoothLong="",t.brassLiftSmoothMedium="",t.brassLiftSmoothShort="",t.brassMuteClosed="",t.brassMuteHalfClosed="",t.brassMuteOpen="",t.brassPlop="",t.brassScoop="",t.brassSmear="",t.brassValveTrill="",t.breathMarkComma="",t.breathMarkSalzedo="",t.breathMarkTick="",t.breathMarkUpbow="",t.bridgeClef="",t.buzzRoll="",t.cClef="",t.cClef8vb="",t.cClefArrowDown="",t.cClefArrowUp="",t.cClefChange="",t.cClefCombining="",t.cClefReversed="",t.cClefSquare="",t.caesura="",t.caesuraCurved="",t.caesuraShort="",t.caesuraSingleStroke="",t.caesuraThick="",t.chantAccentusAbove="",t.chantAccentusBelow="",t.chantAuctumAsc="",t.chantAuctumDesc="",t.chantAugmentum="",t.chantCaesura="",t.chantCclef="",t.chantCirculusAbove="",t.chantCirculusBelow="",t.chantConnectingLineAsc2nd="",t.chantConnectingLineAsc3rd="",t.chantConnectingLineAsc4th="",t.chantConnectingLineAsc5th="",t.chantConnectingLineAsc6th="",t.chantCustosStemDownPosHigh="",t.chantCustosStemDownPosHighest="",t.chantCustosStemDownPosMiddle="",t.chantCustosStemUpPosLow="",t.chantCustosStemUpPosLowest="",t.chantCustosStemUpPosMiddle="",t.chantDeminutumLower="",t.chantDeminutumUpper="",t.chantDivisioFinalis="",t.chantDivisioMaior="",t.chantDivisioMaxima="",t.chantDivisioMinima="",t.chantEntryLineAsc2nd="",t.chantEntryLineAsc3rd="",t.chantEntryLineAsc4th="",t.chantEntryLineAsc5th="",t.chantEntryLineAsc6th="",t.chantEpisema="",t.chantFclef="",t.chantIctusAbove="",t.chantIctusBelow="",t.chantLigaturaDesc2nd="",t.chantLigaturaDesc3rd="",t.chantLigaturaDesc4th="",t.chantLigaturaDesc5th="",t.chantOriscusAscending="",t.chantOriscusDescending="",t.chantOriscusLiquescens="",t.chantPodatusLower="",t.chantPodatusUpper="",t.chantPunctum="",t.chantPunctumCavum="",t.chantPunctumDeminutum="",t.chantPunctumInclinatum="",t.chantPunctumInclinatumAuctum="",t.chantPunctumInclinatumDeminutum="",t.chantPunctumLinea="",t.chantPunctumLineaCavum="",t.chantPunctumVirga="",t.chantPunctumVirgaReversed="",t.chantQuilisma="",t.chantSemicirculusAbove="",t.chantSemicirculusBelow="",t.chantStaff="",t.chantStaffNarrow="",t.chantStaffWide="",t.chantStrophicus="",t.chantStrophicusAuctus="",t.chantStrophicusLiquescens2nd="",t.chantStrophicusLiquescens3rd="",t.chantStrophicusLiquescens4th="",t.chantStrophicusLiquescens5th="",t.chantVirgula="",t.clef15="",t.clef8="",t.clefChangeCombining="",t.coda="",t.codaSquare="",t.conductorBeat2Compound="",t.conductorBeat2Simple="",t.conductorBeat3Compound="",t.conductorBeat3Simple="",t.conductorBeat4Compound="",t.conductorBeat4Simple="",t.conductorLeftBeat="",t.conductorRightBeat="",t.conductorStrongBeat="",t.conductorUnconducted="",t.conductorWeakBeat="";t.controlBeginBeam="",t.controlBeginPhrase="",t.controlBeginSlur="",t.controlBeginTie="",t.controlEndBeam="",t.controlEndPhrase="",t.controlEndSlur="",t.controlEndTie="",t.csymAccidentalDoubleFlat="",t.csymAccidentalDoubleSharp="",t.csymAccidentalFlat="",t.csymAccidentalNatural="",t.csymAccidentalSharp="",t.csymAccidentalTripleFlat="",t.csymAccidentalTripleSharp="",t.csymAlteredBassSlash="",t.csymAugmented="",t.csymBracketLeftTall="",t.csymBracketRightTall="",t.csymDiagonalArrangementSlash="",t.csymDiminished="",t.csymHalfDiminished="",t.csymMajorSeventh="",t.csymMinor="",t.csymParensLeftTall="",t.csymParensLeftVeryTall="",t.csymParensRightTall="",t.csymParensRightVeryTall="",t.curlewSign="",t.daCapo="",t.dalSegno="",t.daseianExcellentes1="",t.daseianExcellentes2="",t.daseianExcellentes3="",t.daseianExcellentes4="",t.daseianFinales1="",t.daseianFinales2="",t.daseianFinales3="",t.daseianFinales4="",t.daseianGraves1="",t.daseianGraves2="",t.daseianGraves3="",t.daseianGraves4="",t.daseianResidua1="",t.daseianResidua2="",t.daseianSuperiores1="",t.daseianSuperiores2="",t.daseianSuperiores3="",t.daseianSuperiores4="",t.doubleLateralRollStevens="",t.doubleTongueAbove="",t.doubleTongueBelow="",t.dynamicCombinedSeparatorColon="",t.dynamicCombinedSeparatorHyphen="",t.dynamicCombinedSeparatorSlash="",t.dynamicCombinedSeparatorSpace="",t.dynamicCrescendoHairpin="",t.dynamicDiminuendoHairpin="",t.dynamicFF="",t.dynamicFFF="",t.dynamicFFFF="",t.dynamicFFFFF="",t.dynamicFFFFFF="",t.dynamicForte="",t.dynamicFortePiano="",t.dynamicForzando="",t.dynamicHairpinBracketLeft="",t.dynamicHairpinBracketRight="",t.dynamicHairpinParenthesisLeft="",t.dynamicHairpinParenthesisRight="",t.dynamicMF="",t.dynamicMP="",t.dynamicMessaDiVoce="",t.dynamicMezzo="",t.dynamicNiente="",t.dynamicNienteForHairpin="",t.dynamicPF="",t.dynamicPP="",t.dynamicPPP="",t.dynamicPPPP="",t.dynamicPPPPP="",t.dynamicPPPPPP="",t.dynamicPiano="",t.dynamicRinforzando="",t.dynamicRinforzando1="",t.dynamicRinforzando2="",t.dynamicSforzando="",t.dynamicSforzando1="",t.dynamicSforzandoPianissimo="",t.dynamicSforzandoPiano="",t.dynamicSforzato="",t.dynamicSforzatoFF="",t.dynamicSforzatoPiano="",t.dynamicZ="",t.elecAudioChannelsEight="",t.elecAudioChannelsFive="",t.elecAudioChannelsFour="",t.elecAudioChannelsOne="",t.elecAudioChannelsSeven="",t.elecAudioChannelsSix="",t.elecAudioChannelsThreeFrontal="",t.elecAudioChannelsThreeSurround="",t.elecAudioChannelsTwo="",t.elecAudioIn="",t.elecAudioMono="",t.elecAudioOut="",t.elecAudioStereo="",t.elecCamera="",t.elecDataIn="",t.elecDataOut="",t.elecDisc="",t.elecDownload="",t.elecEject="",t.elecFastForward="",t.elecHeadphones="",t.elecHeadset="",t.elecLineIn="",t.elecLineOut="",t.elecLoop="",t.elecLoudspeaker="",t.elecMIDIController0="",t.elecMIDIController100="",t.elecMIDIController20="",t.elecMIDIController40="",t.elecMIDIController60="",t.elecMIDIController80="",t.elecMIDIIn="",t.elecMIDIOut="",t.elecMicrophone="",t.elecMicrophoneMute="",t.elecMicrophoneUnmute="",t.elecMixingConsole="",t.elecMonitor="",t.elecMute="",t.elecPause="",t.elecPlay="",t.elecPowerOnOff="",t.elecProjector="",t.elecReplay="",t.elecRewind="",t.elecShuffle="",t.elecSkipBackwards="",t.elecSkipForwards="",t.elecStop="",t.elecTape="",t.elecUSB="",t.elecUnmute="",t.elecUpload="",t.elecVideoCamera="",t.elecVideoIn="",t.elecVideoOut="",t.elecVolumeFader="",t.elecVolumeFaderThumb="",t.elecVolumeLevel0="",t.elecVolumeLevel100="",t.elecVolumeLevel20="",t.elecVolumeLevel40="",t.elecVolumeLevel60="",t.elecVolumeLevel80="",t.fClef="",t.fClef15ma="",t.fClef15mb="",t.fClef8va="",t.fClef8vb="",t.fClefArrowDown="",t.fClefArrowUp="",t.fClefChange="",t.fClefReversed="",t.fClefTurned="",t.fermataAbove="",t.fermataBelow="",t.fermataLongAbove="",t.fermataLongBelow="",t.fermataLongHenzeAbove="",t.fermataLongHenzeBelow="",t.fermataShortAbove="",t.fermataShortBelow="",t.fermataShortHenzeAbove="",t.fermataShortHenzeBelow="",t.fermataVeryLongAbove="",t.fermataVeryLongBelow="",t.fermataVeryShortAbove="",t.fermataVeryShortBelow="",t.figbass0="",t.figbass1="",t.figbass2="",t.figbass2Raised="",t.figbass3="",t.figbass4="",t.figbass4Raised="",t.figbass5="",t.figbass5Raised1="",t.figbass5Raised2="",t.figbass5Raised3="",t.figbass6="",t.figbass6Raised="",t.figbass6Raised2="",t.figbass7="",t.figbass7Diminished="",t.figbass7Raised1="",t.figbass7Raised2="",t.figbass8="",t.figbass9="",t.figbass9Raised="",t.figbassBracketLeft="",t.figbassBracketRight="",t.figbassCombiningLowering="",t.figbassCombiningRaising="",t.figbassDoubleFlat="",t.figbassDoubleSharp="",t.figbassFlat="",t.figbassNatural="",t.figbassParensLeft="",t.figbassParensRight="",t.figbassPlus="",t.figbassSharp="",t.figbassTripleFlat="",t.figbassTripleSharp="",t.fingering0="",t.fingering0Italic="",t.fingering1="",t.fingering1Italic="",t.fingering2="",t.fingering2Italic="",t.fingering3="",t.fingering3Italic="",t.fingering4="",t.fingering4Italic="",t.fingering5="",t.fingering5Italic="",t.fingering6="",t.fingering6Italic="",t.fingering7="",t.fingering7Italic="",t.fingering8="",t.fingering8Italic="",t.fingering9="",t.fingering9Italic="",t.fingeringALower="",t.fingeringCLower="",t.fingeringELower="",t.fingeringILower="",t.fingeringLeftBracket="",t.fingeringLeftBracketItalic="",t.fingeringLeftParenthesis="",t.fingeringLeftParenthesisItalic="",t.fingeringMLower="",t.fingeringMultipleNotes="",t.fingeringOLower="",t.fingeringPLower="",t.fingeringQLower="",t.fingeringRightBracket="",t.fingeringRightBracketItalic="",t.fingeringRightParenthesis="",t.fingeringRightParenthesisItalic="",t.fingeringSLower="",t.fingeringSeparatorMiddleDot="",t.fingeringSeparatorMiddleDotWhite="",t.fingeringSeparatorSlash="",t.fingeringSubstitutionAbove="",t.fingeringSubstitutionBelow="",t.fingeringSubstitutionDash="",t.fingeringTLower="",t.fingeringTUpper="",t.fingeringXLower="",t.flag1024thDown="",t.flag1024thUp="",t.flag128thDown="",t.flag128thUp="",t.flag16thDown="",t.flag16thUp="",t.flag256thDown="",t.flag256thUp="",t.flag32ndDown="",t.flag32ndUp="",t.flag512thDown="",t.flag512thUp="",t.flag64thDown="",t.flag64thUp="",t.flag8thDown="",t.flag8thUp="",t.flagInternalDown="",t.flagInternalUp="",t.fretboard3String="",t.fretboard3StringNut="",t.fretboard4String="",t.fretboard4StringNut="",t.fretboard5String="",t.fretboard5StringNut="",t.fretboard6String="",t.fretboard6StringNut="",t.fretboardFilledCircle="",t.fretboardO="",t.fretboardX="",t.functionAngleLeft="",t.functionAngleRight="",t.functionBracketLeft="",t.functionBracketRight="",t.functionDD="",t.functionDLower="",t.functionDUpper="",t.functionEight="",t.functionFUpper="",t.functionFive="",t.functionFour="",t.functionGLower="",t.functionGUpper="",t.functionGreaterThan="",t.functionILower="",t.functionIUpper="",t.functionKLower="",t.functionKUpper="",t.functionLLower="",t.functionLUpper="",t.functionLessThan="",t.functionMLower="",t.functionMUpper="",t.functionMinus="",t.functionNLower="",t.functionNUpper="",t.functionNUpperSuperscript="",t.functionNine="",t.functionOne="",t.functionPLower="",t.functionPUpper="",t.functionParensLeft="",t.functionParensRight="",t.functionPlus="",t.functionRLower="",t.functionRepetition1="",t.functionRepetition2="",t.functionRing="",t.functionSLower="",t.functionSSLower="",t.functionSSUpper="",t.functionSUpper="",t.functionSeven="",t.functionSix="",t.functionSlashedDD="",t.functionTLower="",t.functionTUpper="",t.functionThree="",t.functionTwo="",t.functionVLower="",t.functionVUpper="",t.functionZero="",t.gClef="",t.gClef15ma="",t.gClef15mb="",t.gClef8va="",t.gClef8vb="",t.gClef8vbCClef="",t.gClef8vbOld="",t.gClef8vbParens="",t.gClefArrowDown="",t.gClefArrowUp="",t.gClefChange="",t.gClefLigatedNumberAbove="",t.gClefLigatedNumberBelow="",t.gClefReversed="",t.gClefTurned="",t.glissandoDown="",t.glissandoUp="",t.graceNoteAcciaccaturaStemDown="",t.graceNoteAcciaccaturaStemUp="",t.graceNoteAppoggiaturaStemDown="",t.graceNoteAppoggiaturaStemUp="",t.graceNoteSlashStemDown="",t.graceNoteSlashStemUp="",t.guitarBarreFull="",t.guitarBarreHalf="",t.guitarClosePedal="",t.guitarFadeIn="",t.guitarFadeOut="",t.guitarGolpe="",t.guitarHalfOpenPedal="",t.guitarLeftHandTapping="",t.guitarOpenPedal="",t.guitarRightHandTapping="",t.guitarShake="",t.guitarString0="",t.guitarString1="",t.guitarString10="",t.guitarString11="",t.guitarString12="",t.guitarString13="",t.guitarString2="",t.guitarString3="",t.guitarString4="",t.guitarString5="",t.guitarString6="",t.guitarString7="",t.guitarString8="",t.guitarString9="",t.guitarStrumDown="",t.guitarStrumUp="",t.guitarVibratoBarDip="",t.guitarVibratoBarScoop="",t.guitarVibratoStroke="",t.guitarVolumeSwell="",t.guitarWideVibratoStroke="",t.handbellsBelltree="",t.handbellsDamp3="",t.handbellsEcho1="",t.handbellsEcho2="",t.handbellsGyro="",t.handbellsHandMartellato="",t.handbellsMalletBellOnTable="",t.handbellsMalletBellSuspended="",t.handbellsMalletLft="",t.handbellsMartellato="",t.handbellsMartellatoLift="",t.handbellsMutedMartellato="",t.handbellsPluckLift="",t.handbellsSwing="",t.handbellsSwingDown="",t.handbellsSwingUp="",t.handbellsTablePairBells="",t.handbellsTableSingleBell="",t.harpMetalRod="",t.harpPedalCentered="",t.harpPedalDivider="",t.harpPedalLowered="",t.harpPedalRaised="",t.harpSalzedoAeolianAscending="",t.harpSalzedoAeolianDescending="",t.harpSalzedoDampAbove="",t.harpSalzedoDampBelow="",t.harpSalzedoDampBothHands="",t.harpSalzedoDampLowStrings="",t.harpSalzedoFluidicSoundsLeft="",t.harpSalzedoFluidicSoundsRight="",t.harpSalzedoIsolatedSounds="",t.harpSalzedoMetallicSounds="",t.harpSalzedoMetallicSoundsOneString="",t.harpSalzedoMuffleTotally="",t.harpSalzedoOboicFlux="",t.harpSalzedoPlayUpperEnd="",t.harpSalzedoSlideWithSuppleness="",t.harpSalzedoSnareDrum="",t.harpSalzedoTamTamSounds="",t.harpSalzedoThunderEffect="",t.harpSalzedoTimpanicSounds="",t.harpSalzedoWhistlingSounds="",t.harpStringNoiseStem="",t.harpTuningKey="",t.harpTuningKeyGlissando="",t.harpTuningKeyHandle="",t.harpTuningKeyShank="",t.indianDrumClef="",t.kahnBackChug="",t.kahnBackFlap="",t.kahnBackRiff="",t.kahnBackRip="",t.kahnBallChange="",t.kahnBallDig="",t.kahnBrushBackward="",t.kahnBrushForward="",t.kahnChug="",t.kahnClap="",t.kahnDoubleSnap="",t.kahnDoubleWing="",t.kahnDrawStep="",t.kahnDrawTap="",t.kahnFlam="",t.kahnFlap="",t.kahnFlapStep="",t.kahnFlat="",t.kahnFleaHop="",t.kahnFleaTap="",t.kahnGraceTap="",t.kahnGraceTapChange="",t.kahnGraceTapHop="",t.kahnGraceTapStamp="",t.kahnHeel="",t.kahnHeelChange="",t.kahnHeelClick="",t.kahnHeelDrop="",t.kahnHeelStep="",t.kahnHeelTap="",t.kahnHop="",t.kahnJumpApart="",t.kahnJumpTogether="",t.kahnKneeInward="",t.kahnKneeOutward="",t.kahnLeap="",t.kahnLeapFlatFoot="",t.kahnLeapHeelClick="",t.kahnLeftCatch="",t.kahnLeftCross="",t.kahnLeftFoot="",t.kahnLeftToeStrike="",t.kahnLeftTurn="",t.kahnOverTheTop="",t.kahnOverTheTopTap="",t.kahnPull="",t.kahnPush="",t.kahnRiff="",t.kahnRiffle="",t.kahnRightCatch="",t.kahnRightCross="",t.kahnRightFoot="",t.kahnRightToeStrike="",t.kahnRightTurn="",t.kahnRip="",t.kahnRipple="",t.kahnScrape="",t.kahnScuff="",t.kahnScuffle="",t.kahnShuffle="",t.kahnSlam="",t.kahnSlap="",t.kahnSlideStep="",t.kahnSlideTap="",t.kahnSnap="",t.kahnStamp="",t.kahnStampStamp="",t.kahnStep="",t.kahnStepStamp="",t.kahnStomp="",t.kahnStompBrush="",t.kahnTap="",t.kahnToe="",t.kahnToeClick="",t.kahnToeDrop="",t.kahnToeStep="",t.kahnToeTap="",t.kahnTrench="",t.kahnWing="",t.kahnWingChange="",t.kahnZank="",t.kahnZink="",t.keyboardBebung2DotsAbove="",t.keyboardBebung2DotsBelow="",t.keyboardBebung3DotsAbove="",t.keyboardBebung3DotsBelow="",t.keyboardBebung4DotsAbove="",t.keyboardBebung4DotsBelow="",t.keyboardLeftPedalPictogram="",t.keyboardMiddlePedalPictogram="",t.keyboardPedalD="",t.keyboardPedalDot="",t.keyboardPedalE="",t.keyboardPedalHalf="",t.keyboardPedalHalf2="",t.keyboardPedalHalf3="",t.keyboardPedalHeel1="",t.keyboardPedalHeel2="",t.keyboardPedalHeel3="",t.keyboardPedalHeelToToe="",t.keyboardPedalHeelToe="",t.keyboardPedalHookEnd="",t.keyboardPedalHookStart="",t.keyboardPedalHyphen="",t.keyboardPedalP="",t.keyboardPedalParensLeft="",t.keyboardPedalParensRight="",t.keyboardPedalPed="",t.keyboardPedalS="",t.keyboardPedalSost="",t.keyboardPedalToe1="",t.keyboardPedalToe2="",t.keyboardPedalToeToHeel="",t.keyboardPedalUp="",t.keyboardPedalUpNotch="",t.keyboardPedalUpSpecial="",t.keyboardPlayWithLH="",t.keyboardPlayWithLHEnd="",t.keyboardPlayWithRH="",t.keyboardPlayWithRHEnd="",t.keyboardPluckInside="",t.keyboardRightPedalPictogram="",t.kievanAccidentalFlat="",t.kievanAccidentalSharp="",t.kievanAugmentationDot="",t.kievanCClef="",t.kievanEndingSymbol="",t.kievanNote8thStemDown="",t.kievanNote8thStemUp="",t.kievanNoteBeam="",t.kievanNoteHalfStaffLine="",t.kievanNoteHalfStaffSpace="",t.kievanNoteQuarterStemDown="",t.kievanNoteQuarterStemUp="",t.kievanNoteReciting="",t.kievanNoteWhole="",t.kievanNoteWholeFinal="",t.kodalyHandDo="",t.kodalyHandFa="",t.kodalyHandLa="",t.kodalyHandMi="",t.kodalyHandRe="",t.kodalyHandSo="",t.kodalyHandTi="",t.leftRepeatSmall="",t.legerLine="",t.legerLineNarrow="",t.legerLineWide="",t.luteBarlineEndRepeat="",t.luteBarlineFinal="",t.luteBarlineStartRepeat="",t.luteDuration16th="",t.luteDuration32nd="",t.luteDuration8th="",t.luteDurationDoubleWhole="",t.luteDurationHalf="",t.luteDurationQuarter="",t.luteDurationWhole="",t.luteFingeringRHFirst="",t.luteFingeringRHSecond="",t.luteFingeringRHThird="",t.luteFingeringRHThumb="",t.luteFrench10thCourse="",t.luteFrench7thCourse="",t.luteFrench8thCourse="",t.luteFrench9thCourse="",t.luteFrenchAppoggiaturaAbove="",t.luteFrenchAppoggiaturaBelow="",t.luteFrenchFretA="",t.luteFrenchFretB="",t.luteFrenchFretC="",t.luteFrenchFretD="",t.luteFrenchFretE="",t.luteFrenchFretF="",t.luteFrenchFretG="",t.luteFrenchFretH="",t.luteFrenchFretI="",t.luteFrenchFretK="",t.luteFrenchFretL="",t.luteFrenchFretM="",t.luteFrenchFretN="",t.luteFrenchMordentInverted="",t.luteFrenchMordentLower="",t.luteFrenchMordentUpper="",t.luteGermanALower="",t.luteGermanAUpper="",t.luteGermanBLower="",t.luteGermanBUpper="",t.luteGermanCLower="",t.luteGermanCUpper="",t.luteGermanDLower="",t.luteGermanDUpper="",t.luteGermanELower="",t.luteGermanEUpper="",t.luteGermanFLower="",t.luteGermanFUpper="",t.luteGermanGLower="",t.luteGermanGUpper="",t.luteGermanHLower="",t.luteGermanHUpper="",t.luteGermanILower="",t.luteGermanIUpper="",t.luteGermanKLower="",t.luteGermanKUpper="",t.luteGermanLLower="",t.luteGermanLUpper="",t.luteGermanMLower="",t.luteGermanMUpper="",t.luteGermanNLower="",t.luteGermanNUpper="",t.luteGermanOLower="",t.luteGermanPLower="",t.luteGermanQLower="",t.luteGermanRLower="",t.luteGermanSLower="",t.luteGermanTLower="",t.luteGermanVLower="",t.luteGermanXLower="",t.luteGermanYLower="",t.luteGermanZLower="",t.luteItalianClefCSolFaUt="",t.luteItalianClefFFaUt="",t.luteItalianFret0="",t.luteItalianFret1="",t.luteItalianFret2="",t.luteItalianFret3="",t.luteItalianFret4="",t.luteItalianFret5="",t.luteItalianFret6="",t.luteItalianFret7="",t.luteItalianFret8="",t.luteItalianFret9="",t.luteItalianHoldFinger="",t.luteItalianHoldNote="",t.luteItalianReleaseFinger="",t.luteItalianTempoFast="",t.luteItalianTempoNeitherFastNorSlow="",t.luteItalianTempoSlow="",t.luteItalianTempoSomewhatFast="",t.luteItalianTempoVerySlow="",t.luteItalianTimeTriple="",t.luteItalianTremolo="",t.luteItalianVibrato="",t.luteStaff6Lines="",t.luteStaff6LinesNarrow="",t.luteStaff6LinesWide="",t.lyricsElision="",t.lyricsElisionNarrow="",t.lyricsElisionWide="",t.lyricsHyphenBaseline="",t.lyricsHyphenBaselineNonBreaking="",t.lyricsTextRepeat="",t.medRenFlatHardB="",t.medRenFlatSoftB="",t.medRenFlatWithDot="",t.medRenGClefCMN="",t.medRenLiquescenceCMN="",t.medRenLiquescentAscCMN="",t.medRenLiquescentDescCMN="",t.medRenNatural="",t.medRenNaturalWithCross="",t.medRenOriscusCMN="",t.medRenPlicaCMN="",t.medRenPunctumCMN="",t.medRenQuilismaCMN="",t.medRenSharpCroix="",t.medRenStrophicusCMN="",t.mensuralAlterationSign="",t.mensuralBlackBrevis="",t.mensuralBlackBrevisVoid="",t.mensuralBlackDragma="",t.mensuralBlackLonga="",t.mensuralBlackMaxima="",t.mensuralBlackMinima="",t.mensuralBlackMinimaVoid="",t.mensuralBlackSemibrevis="",t.mensuralBlackSemibrevisCaudata="",t.mensuralBlackSemibrevisOblique="",t.mensuralBlackSemibrevisVoid="",t.mensuralBlackSemiminima="",t.mensuralCclef="",t.mensuralCclefPetrucciPosHigh="",t.mensuralCclefPetrucciPosHighest="",t.mensuralCclefPetrucciPosLow="",t.mensuralCclefPetrucciPosLowest="",t.mensuralCclefPetrucciPosMiddle="",t.mensuralColorationEndRound="",t.mensuralColorationEndSquare="",t.mensuralColorationStartRound="",t.mensuralColorationStartSquare="",t.mensuralCombStemDiagonal="",t.mensuralCombStemDown="",t.mensuralCombStemDownFlagExtended="",t.mensuralCombStemDownFlagFlared="",t.mensuralCombStemDownFlagFusa="",t.mensuralCombStemDownFlagLeft="",t.mensuralCombStemDownFlagRight="",t.mensuralCombStemDownFlagSemiminima="",t.mensuralCombStemUp="",t.mensuralCombStemUpFlagExtended="",t.mensuralCombStemUpFlagFlared="",t.mensuralCombStemUpFlagFusa="",t.mensuralCombStemUpFlagLeft="",t.mensuralCombStemUpFlagRight="",t.mensuralCombStemUpFlagSemiminima="",t.mensuralCustosCheckmark="",t.mensuralCustosDown="",t.mensuralCustosTurn="",t.mensuralCustosUp="",t.mensuralFclef="",t.mensuralFclefPetrucci="",t.mensuralGclef="",t.mensuralGclefPetrucci="",t.mensuralModusImperfectumVert="",t.mensuralModusPerfectumVert="",t.mensuralNoteheadLongaBlack="",t.mensuralNoteheadLongaBlackVoid="",t.mensuralNoteheadLongaVoid="",t.mensuralNoteheadLongaWhite="",t.mensuralNoteheadMaximaBlack="",t.mensuralNoteheadMaximaBlackVoid="",t.mensuralNoteheadMaximaVoid="",t.mensuralNoteheadMaximaWhite="",t.mensuralNoteheadMinimaWhite="",t.mensuralNoteheadSemibrevisBlack="",t.mensuralNoteheadSemibrevisBlackVoid="",t.mensuralNoteheadSemibrevisBlackVoidTurned="",t.mensuralNoteheadSemibrevisVoid="",t.mensuralNoteheadSemiminimaWhite="",t.mensuralObliqueAsc2ndBlack="",t.mensuralObliqueAsc2ndBlackVoid="",t.mensuralObliqueAsc2ndVoid="",t.mensuralObliqueAsc2ndWhite="",t.mensuralObliqueAsc3rdBlack="",t.mensuralObliqueAsc3rdBlackVoid="",t.mensuralObliqueAsc3rdVoid="",t.mensuralObliqueAsc3rdWhite="",t.mensuralObliqueAsc4thBlack="",t.mensuralObliqueAsc4thBlackVoid="",t.mensuralObliqueAsc4thVoid="",t.mensuralObliqueAsc4thWhite="",t.mensuralObliqueAsc5thBlack="",t.mensuralObliqueAsc5thBlackVoid="",t.mensuralObliqueAsc5thVoid="",t.mensuralObliqueAsc5thWhite="",t.mensuralObliqueDesc2ndBlack="",t.mensuralObliqueDesc2ndBlackVoid="",t.mensuralObliqueDesc2ndVoid="",t.mensuralObliqueDesc2ndWhite="",t.mensuralObliqueDesc3rdBlack="";t.mensuralObliqueDesc3rdBlackVoid="",t.mensuralObliqueDesc3rdVoid="",t.mensuralObliqueDesc3rdWhite="",t.mensuralObliqueDesc4thBlack="",t.mensuralObliqueDesc4thBlackVoid="",t.mensuralObliqueDesc4thVoid="",t.mensuralObliqueDesc4thWhite="",t.mensuralObliqueDesc5thBlack="",t.mensuralObliqueDesc5thBlackVoid="",t.mensuralObliqueDesc5thVoid="",t.mensuralObliqueDesc5thWhite="",t.mensuralProlation1="",t.mensuralProlation10="",t.mensuralProlation11="",t.mensuralProlation2="",t.mensuralProlation3="",t.mensuralProlation4="",t.mensuralProlation5="",t.mensuralProlation6="",t.mensuralProlation7="",t.mensuralProlation8="",t.mensuralProlation9="",t.mensuralProlationCombiningDot="",t.mensuralProlationCombiningDotVoid="",t.mensuralProlationCombiningStroke="",t.mensuralProlationCombiningThreeDots="",t.mensuralProlationCombiningThreeDotsTri="",t.mensuralProlationCombiningTwoDots="",t.mensuralProportion1="",t.mensuralProportion2="",t.mensuralProportion3="",t.mensuralProportion4="",t.mensuralProportion5="",t.mensuralProportion6="",t.mensuralProportion7="",t.mensuralProportion8="",t.mensuralProportion9="",t.mensuralProportionMajor="",t.mensuralProportionMinor="",t.mensuralProportionProportioDupla1="",t.mensuralProportionProportioDupla2="",t.mensuralProportionProportioQuadrupla="",t.mensuralProportionProportioTripla="",t.mensuralProportionTempusPerfectum="",t.mensuralRestBrevis="",t.mensuralRestFusa="",t.mensuralRestLongaImperfecta="",t.mensuralRestLongaPerfecta="",t.mensuralRestMaxima="",t.mensuralRestMinima="",t.mensuralRestSemibrevis="",t.mensuralRestSemifusa="",t.mensuralRestSemiminima="",t.mensuralSignumDown="",t.mensuralSignumUp="",t.mensuralTempusImperfectumHoriz="",t.mensuralTempusPerfectumHoriz="",t.mensuralWhiteBrevis="",t.mensuralWhiteFusa="",t.mensuralWhiteLonga="",t.mensuralWhiteMaxima="",t.mensuralWhiteMinima="",t.mensuralWhiteSemibrevis="",t.mensuralWhiteSemiminima="",t.metAugmentationDot="",t.metNote1024thDown="",t.metNote1024thUp="",t.metNote128thDown="",t.metNote128thUp="",t.metNote16thDown="",t.metNote16thUp="",t.metNote256thDown="",t.metNote256thUp="",t.metNote32ndDown="",t.metNote32ndUp="",t.metNote512thDown="",t.metNote512thUp="",t.metNote64thDown="",t.metNote64thUp="",t.metNote8thDown="",t.metNote8thUp="",t.metNoteDoubleWhole="",t.metNoteDoubleWholeSquare="",t.metNoteHalfDown="",t.metNoteHalfUp="",t.metNoteQuarterDown="",t.metNoteQuarterUp="",t.metNoteWhole="",t.metricModulationArrowLeft="",t.metricModulationArrowRight="",t.miscDoNotCopy="",t.miscDoNotPhotocopy="",t.miscEyeglasses="",t.note1024thDown="",t.note1024thUp="",t.note128thDown="",t.note128thUp="",t.note16thDown="",t.note16thUp="",t.note256thDown="",t.note256thUp="",t.note32ndDown="",t.note32ndUp="",t.note512thDown="",t.note512thUp="",t.note64thDown="",t.note64thUp="",t.note8thDown="",t.note8thUp="",t.noteABlack="",t.noteAFlatBlack="",t.noteAFlatHalf="",t.noteAFlatWhole="",t.noteAHalf="",t.noteASharpBlack="",t.noteASharpHalf="",t.noteASharpWhole="",t.noteAWhole="",t.noteBBlack="",t.noteBFlatBlack="",t.noteBFlatHalf="",t.noteBFlatWhole="",t.noteBHalf="",t.noteBSharpBlack="",t.noteBSharpHalf="",t.noteBSharpWhole="",t.noteBWhole="",t.noteCBlack="",t.noteCFlatBlack="",t.noteCFlatHalf="",t.noteCFlatWhole="",t.noteCHalf="",t.noteCSharpBlack="",t.noteCSharpHalf="",t.noteCSharpWhole="",t.noteCWhole="",t.noteDBlack="",t.noteDFlatBlack="",t.noteDFlatHalf="",t.noteDFlatWhole="",t.noteDHalf="",t.noteDSharpBlack="",t.noteDSharpHalf="",t.noteDSharpWhole="",t.noteDWhole="",t.noteDiBlack="",t.noteDiHalf="",t.noteDiWhole="",t.noteDoBlack="",t.noteDoHalf="",t.noteDoWhole="",t.noteDoubleWhole="",t.noteDoubleWholeSquare="",t.noteEBlack="",t.noteEFlatBlack="",t.noteEFlatHalf="",t.noteEFlatWhole="",t.noteEHalf="",t.noteESharpBlack="",t.noteESharpHalf="",t.noteESharpWhole="",t.noteEWhole="",t.noteEmptyBlack="",t.noteEmptyHalf="",t.noteEmptyWhole="",t.noteFBlack="",t.noteFFlatBlack="",t.noteFFlatHalf="",t.noteFFlatWhole="",t.noteFHalf="",t.noteFSharpBlack="",t.noteFSharpHalf="",t.noteFSharpWhole="",t.noteFWhole="",t.noteFaBlack="",t.noteFaHalf="",t.noteFaWhole="",t.noteFiBlack="",t.noteFiHalf="",t.noteFiWhole="",t.noteGBlack="",t.noteGFlatBlack="",t.noteGFlatHalf="",t.noteGFlatWhole="",t.noteGHalf="",t.noteGSharpBlack="",t.noteGSharpHalf="",t.noteGSharpWhole="",t.noteGWhole="",t.noteHBlack="",t.noteHHalf="",t.noteHSharpBlack="",t.noteHSharpHalf="",t.noteHSharpWhole="",t.noteHWhole="",t.noteHalfDown="",t.noteHalfUp="",t.noteLaBlack="",t.noteLaHalf="",t.noteLaWhole="",t.noteLeBlack="",t.noteLeHalf="",t.noteLeWhole="",t.noteLiBlack="",t.noteLiHalf="",t.noteLiWhole="",t.noteMeBlack="",t.noteMeHalf="",t.noteMeWhole="",t.noteMiBlack="",t.noteMiHalf="",t.noteMiWhole="",t.noteQuarterDown="",t.noteQuarterUp="",t.noteRaBlack="",t.noteRaHalf="",t.noteRaWhole="",t.noteReBlack="",t.noteReHalf="",t.noteReWhole="",t.noteRiBlack="",t.noteRiHalf="",t.noteRiWhole="",t.noteSeBlack="",t.noteSeHalf="",t.noteSeWhole="",t.noteShapeArrowheadLeftBlack="",t.noteShapeArrowheadLeftDoubleWhole="",t.noteShapeArrowheadLeftWhite="",t.noteShapeDiamondBlack="",t.noteShapeDiamondDoubleWhole="",t.noteShapeDiamondWhite="",t.noteShapeIsoscelesTriangleBlack="",t.noteShapeIsoscelesTriangleDoubleWhole="",t.noteShapeIsoscelesTriangleWhite="",t.noteShapeKeystoneBlack="",t.noteShapeKeystoneDoubleWhole="",t.noteShapeKeystoneWhite="",t.noteShapeMoonBlack="",t.noteShapeMoonDoubleWhole="",t.noteShapeMoonLeftBlack="",t.noteShapeMoonLeftDoubleWhole="",t.noteShapeMoonLeftWhite="",t.noteShapeMoonWhite="",t.noteShapeQuarterMoonBlack="",t.noteShapeQuarterMoonDoubleWhole="",t.noteShapeQuarterMoonWhite="",t.noteShapeRoundBlack="",t.noteShapeRoundDoubleWhole="",t.noteShapeRoundWhite="",t.noteShapeSquareBlack="",t.noteShapeSquareDoubleWhole="",t.noteShapeSquareWhite="",t.noteShapeTriangleLeftBlack="",t.noteShapeTriangleLeftDoubleWhole="",t.noteShapeTriangleLeftWhite="",t.noteShapeTriangleRightBlack="",t.noteShapeTriangleRightDoubleWhole="",t.noteShapeTriangleRightWhite="",t.noteShapeTriangleRoundBlack="",t.noteShapeTriangleRoundDoubleWhole="",t.noteShapeTriangleRoundLeftBlack="",t.noteShapeTriangleRoundLeftDoubleWhole="",t.noteShapeTriangleRoundLeftWhite="",t.noteShapeTriangleRoundWhite="",t.noteShapeTriangleUpBlack="",t.noteShapeTriangleUpDoubleWhole="",t.noteShapeTriangleUpWhite="",t.noteSiBlack="",t.noteSiHalf="",t.noteSiWhole="",t.noteSoBlack="",t.noteSoHalf="",t.noteSoWhole="",t.noteTeBlack="",t.noteTeHalf="",t.noteTeWhole="",t.noteTiBlack="",t.noteTiHalf="",t.noteTiWhole="",t.noteWhole="",t.noteheadBlack="",t.noteheadCircleSlash="",t.noteheadCircleX="",t.noteheadCircleXDoubleWhole="",t.noteheadCircleXHalf="",t.noteheadCircleXWhole="",t.noteheadCircledBlack="",t.noteheadCircledBlackLarge="",t.noteheadCircledDoubleWhole="",t.noteheadCircledDoubleWholeLarge="",t.noteheadCircledHalf="",t.noteheadCircledHalfLarge="",t.noteheadCircledWhole="",t.noteheadCircledWholeLarge="",t.noteheadCircledXLarge="",t.noteheadClusterDoubleWhole2nd="",t.noteheadClusterDoubleWhole3rd="",t.noteheadClusterDoubleWholeBottom="",t.noteheadClusterDoubleWholeMiddle="",t.noteheadClusterDoubleWholeTop="",t.noteheadClusterHalf2nd="",t.noteheadClusterHalf3rd="",t.noteheadClusterHalfBottom="",t.noteheadClusterHalfMiddle="",t.noteheadClusterHalfTop="",t.noteheadClusterQuarter2nd="",t.noteheadClusterQuarter3rd="",t.noteheadClusterQuarterBottom="",t.noteheadClusterQuarterMiddle="",t.noteheadClusterQuarterTop="",t.noteheadClusterRoundBlack="",t.noteheadClusterRoundWhite="",t.noteheadClusterSquareBlack="",t.noteheadClusterSquareWhite="",t.noteheadClusterWhole2nd="",t.noteheadClusterWhole3rd="",t.noteheadClusterWholeBottom="",t.noteheadClusterWholeMiddle="",t.noteheadClusterWholeTop="",t.noteheadCowellEleventhNoteSeriesHalf="",t.noteheadCowellEleventhNoteSeriesWhole="",t.noteheadCowellEleventhSeriesBlack="",t.noteheadCowellFifteenthNoteSeriesBlack="",t.noteheadCowellFifteenthNoteSeriesHalf="",t.noteheadCowellFifteenthNoteSeriesWhole="",t.noteheadCowellFifthNoteSeriesBlack="",t.noteheadCowellFifthNoteSeriesHalf="",t.noteheadCowellFifthNoteSeriesWhole="",t.noteheadCowellNinthNoteSeriesBlack="",t.noteheadCowellNinthNoteSeriesHalf="",t.noteheadCowellNinthNoteSeriesWhole="",t.noteheadCowellSeventhNoteSeriesBlack="",t.noteheadCowellSeventhNoteSeriesHalf="",t.noteheadCowellSeventhNoteSeriesWhole="",t.noteheadCowellThirdNoteSeriesBlack="",t.noteheadCowellThirdNoteSeriesHalf="",t.noteheadCowellThirdNoteSeriesWhole="",t.noteheadCowellThirteenthNoteSeriesBlack="",t.noteheadCowellThirteenthNoteSeriesHalf="",t.noteheadCowellThirteenthNoteSeriesWhole="",t.noteheadDiamondBlack="",t.noteheadDiamondBlackOld="",t.noteheadDiamondBlackWide="",t.noteheadDiamondClusterBlack2nd="",t.noteheadDiamondClusterBlack3rd="",t.noteheadDiamondClusterBlackBottom="",t.noteheadDiamondClusterBlackMiddle="",t.noteheadDiamondClusterBlackTop="",t.noteheadDiamondClusterWhite2nd="",t.noteheadDiamondClusterWhite3rd="",t.noteheadDiamondClusterWhiteBottom="",t.noteheadDiamondClusterWhiteMiddle="",t.noteheadDiamondClusterWhiteTop="",t.noteheadDiamondDoubleWhole="",t.noteheadDiamondDoubleWholeOld="",t.noteheadDiamondHalf="",t.noteheadDiamondHalfFilled="",t.noteheadDiamondHalfOld="",t.noteheadDiamondHalfWide="",t.noteheadDiamondOpen="",t.noteheadDiamondWhite="",t.noteheadDiamondWhiteWide="",t.noteheadDiamondWhole="",t.noteheadDiamondWholeOld="",t.noteheadDoubleWhole="",t.noteheadDoubleWholeSquare="",t.noteheadDoubleWholeWithX="",t.noteheadHalf="",t.noteheadHalfFilled="",t.noteheadHalfWithX="",t.noteheadHeavyX="",t.noteheadHeavyXHat="",t.noteheadLargeArrowDownBlack="",t.noteheadLargeArrowDownDoubleWhole="",t.noteheadLargeArrowDownHalf="",t.noteheadLargeArrowDownWhole="",t.noteheadLargeArrowUpBlack="",t.noteheadLargeArrowUpDoubleWhole="",t.noteheadLargeArrowUpHalf="",t.noteheadLargeArrowUpWhole="",t.noteheadMoonBlack="",t.noteheadMoonWhite="",t.noteheadNancarrowSine="",t.noteheadNull="",t.noteheadParenthesis="",t.noteheadParenthesisLeft="",t.noteheadParenthesisRight="",t.noteheadPlusBlack="",t.noteheadPlusDoubleWhole="",t.noteheadPlusHalf="",t.noteheadPlusWhole="",t.noteheadRectangularClusterBlackBottom="",t.noteheadRectangularClusterBlackMiddle="",t.noteheadRectangularClusterBlackTop="",t.noteheadRectangularClusterWhiteBottom="",t.noteheadRectangularClusterWhiteMiddle="",t.noteheadRectangularClusterWhiteTop="",t.noteheadRoundBlack="",t.noteheadRoundBlackDoubleSlashed="",t.noteheadRoundBlackLarge="",t.noteheadRoundBlackSlashed="",t.noteheadRoundBlackSlashedLarge="",t.noteheadRoundWhite="",t.noteheadRoundWhiteDoubleSlashed="",t.noteheadRoundWhiteLarge="",t.noteheadRoundWhiteSlashed="",t.noteheadRoundWhiteSlashedLarge="",t.noteheadRoundWhiteWithDot="",t.noteheadRoundWhiteWithDotLarge="",t.noteheadSlashDiamondWhite="",t.noteheadSlashHorizontalEnds="",t.noteheadSlashHorizontalEndsMuted="",t.noteheadSlashVerticalEnds="",t.noteheadSlashVerticalEndsMuted="",t.noteheadSlashVerticalEndsSmall="",t.noteheadSlashWhiteDoubleWhole="",t.noteheadSlashWhiteHalf="",t.noteheadSlashWhiteMuted="",t.noteheadSlashWhiteWhole="",t.noteheadSlashX="",t.noteheadSlashedBlack1="",t.noteheadSlashedBlack2="",t.noteheadSlashedDoubleWhole1="",t.noteheadSlashedDoubleWhole2="",t.noteheadSlashedHalf1="",t.noteheadSlashedHalf2="",t.noteheadSlashedWhole1="",t.noteheadSlashedWhole2="",t.noteheadSquareBlack="",t.noteheadSquareBlackLarge="",t.noteheadSquareBlackWhite="",t.noteheadSquareWhite="",t.noteheadTriangleDownBlack="",t.noteheadTriangleDownDoubleWhole="",t.noteheadTriangleDownHalf="",t.noteheadTriangleDownWhite="",t.noteheadTriangleDownWhole="",t.noteheadTriangleLeftBlack="",t.noteheadTriangleLeftWhite="",t.noteheadTriangleRightBlack="",t.noteheadTriangleRightWhite="",t.noteheadTriangleRoundDownBlack="",t.noteheadTriangleRoundDownWhite="",t.noteheadTriangleUpBlack="",t.noteheadTriangleUpDoubleWhole="",t.noteheadTriangleUpHalf="",t.noteheadTriangleUpRightBlack="",t.noteheadTriangleUpRightWhite="",t.noteheadTriangleUpWhite="",t.noteheadTriangleUpWhole="",t.noteheadVoidWithX="",t.noteheadWhole="",t.noteheadWholeFilled="",t.noteheadWholeWithX="",t.noteheadXBlack="",t.noteheadXDoubleWhole="",t.noteheadXHalf="",t.noteheadXOrnate="",t.noteheadXOrnateEllipse="",t.noteheadXWhole="",t.octaveBaselineA="",t.octaveBaselineB="",t.octaveBaselineM="",t.octaveBaselineV="",t.octaveBassa="",t.octaveLoco="",t.octaveParensLeft="",t.octaveParensRight="",t.octaveSuperscriptA="",t.octaveSuperscriptB="",t.octaveSuperscriptM="",t.octaveSuperscriptV="",t.oneHandedRollStevens="",t.organGerman2Fusae="",t.organGerman2Minimae="",t.organGerman2OctaveUp="",t.organGerman2Semifusae="",t.organGerman2Semiminimae="",t.organGerman3Fusae="",t.organGerman3Minimae="",t.organGerman3Semifusae="",t.organGerman3Semiminimae="",t.organGerman4Fusae="",t.organGerman4Minimae="",t.organGerman4Semifusae="",t.organGerman4Semiminimae="",t.organGerman5Fusae="",t.organGerman5Minimae="",t.organGerman5Semifusae="",t.organGerman5Semiminimae="",t.organGerman6Fusae="",t.organGerman6Minimae="",t.organGerman6Semifusae="",t.organGerman6Semiminimae="",t.organGermanALower="",t.organGermanAUpper="",t.organGermanAugmentationDot="",t.organGermanBLower="",t.organGermanBUpper="",t.organGermanBuxheimerBrevis2="",t.organGermanBuxheimerBrevis3="",t.organGermanBuxheimerMinimaRest="",t.organGermanBuxheimerSemibrevis="",t.organGermanBuxheimerSemibrevisRest="",t.organGermanCLower="",t.organGermanCUpper="",t.organGermanCisLower="",t.organGermanCisUpper="",t.organGermanDLower="",t.organGermanDUpper="",t.organGermanDisLower="",t.organGermanDisUpper="",t.organGermanELower="",t.organGermanEUpper="",t.organGermanFLower="",t.organGermanFUpper="",t.organGermanFisLower="",t.organGermanFisUpper="",t.organGermanFusa="",t.organGermanFusaRest="",t.organGermanGLower="",t.organGermanGUpper="",t.organGermanGisLower="",t.organGermanGisUpper="",t.organGermanHLower="",t.organGermanHUpper="",t.organGermanMinima="",t.organGermanMinimaRest="",t.organGermanOctaveDown="",t.organGermanOctaveUp="",t.organGermanSemibrevis="",t.organGermanSemibrevisRest="",t.organGermanSemifusa="",t.organGermanSemifusaRest="",t.organGermanSemiminima="",t.organGermanSemiminimaRest="",t.organGermanTie="",t.ornamentBottomLeftConcaveStroke="",t.ornamentBottomLeftConcaveStrokeLarge="",t.ornamentBottomLeftConvexStroke="",t.ornamentBottomRightConcaveStroke="",t.ornamentBottomRightConvexStroke="",t.ornamentComma="",t.ornamentDoubleObliqueLinesAfterNote="",t.ornamentDoubleObliqueLinesBeforeNote="",t.ornamentDownCurve="",t.ornamentHaydn="",t.ornamentHighLeftConcaveStroke="",t.ornamentHighLeftConvexStroke="",t.ornamentHighRightConcaveStroke="",t.ornamentHighRightConvexStroke="",t.ornamentHookAfterNote="",t.ornamentHookBeforeNote="",t.ornamentLeftFacingHalfCircle="",t.ornamentLeftFacingHook="",t.ornamentLeftPlus="",t.ornamentLeftShakeT="",t.ornamentLeftVerticalStroke="",t.ornamentLeftVerticalStrokeWithCross="",t.ornamentLowLeftConcaveStroke="",t.ornamentLowLeftConvexStroke="",t.ornamentLowRightConcaveStroke="",t.ornamentLowRightConvexStroke="",t.ornamentMiddleVerticalStroke="",t.ornamentMordent="",t.ornamentObliqueLineAfterNote="",t.ornamentObliqueLineBeforeNote="",t.ornamentObliqueLineHorizAfterNote="",t.ornamentObliqueLineHorizBeforeNote="",t.ornamentOriscus="",t.ornamentPinceCouperin="",t.ornamentPortDeVoixV="",t.ornamentPrecompAppoggTrill="",t.ornamentPrecompAppoggTrillSuffix="",t.ornamentPrecompCadence="",t.ornamentPrecompCadenceUpperPrefix="",t.ornamentPrecompCadenceUpperPrefixTurn="",t.ornamentPrecompCadenceWithTurn="",t.ornamentPrecompDescendingSlide="",t.ornamentPrecompDoubleCadenceLowerPrefix="",t.ornamentPrecompDoubleCadenceUpperPrefix="",t.ornamentPrecompDoubleCadenceUpperPrefixTurn="",t.ornamentPrecompInvertedMordentUpperPrefix="",t.ornamentPrecompMordentRelease="",t.ornamentPrecompMordentUpperPrefix="",t.ornamentPrecompPortDeVoixMordent="",t.ornamentPrecompSlide="",t.ornamentPrecompSlideTrillBach="",t.ornamentPrecompSlideTrillDAnglebert="",t.ornamentPrecompSlideTrillMarpurg="",t.ornamentPrecompSlideTrillMuffat="",t.ornamentPrecompSlideTrillSuffixMuffat="",t.ornamentPrecompTrillLowerSuffix="",t.ornamentPrecompTrillSuffixDandrieu="",t.ornamentPrecompTrillWithMordent="",t.ornamentPrecompTurnTrillBach="",t.ornamentPrecompTurnTrillDAnglebert="",t.ornamentQuilisma="",t.ornamentRightFacingHalfCircle="",t.ornamentRightFacingHook="",t.ornamentRightVerticalStroke="",t.ornamentSchleifer="",t.ornamentShake3="",t.ornamentShakeMuffat1="",t.ornamentShortObliqueLineAfterNote="",t.ornamentShortObliqueLineBeforeNote="",t.ornamentShortTrill="",t.ornamentTopLeftConcaveStroke="",t.ornamentTopLeftConvexStroke="",t.ornamentTopRightConcaveStroke="",t.ornamentTopRightConvexStroke="",t.ornamentTremblement="",t.ornamentTremblementCouperin="",t.ornamentTrill="",t.ornamentTurn="",t.ornamentTurnInverted="",t.ornamentTurnSlash="",t.ornamentTurnUp="",t.ornamentTurnUpS="",t.ornamentUpCurve="",t.ornamentVerticalLine="",t.ornamentZigZagLineNoRightEnd="",t.ornamentZigZagLineWithRightEnd="",t.ottava="",t.ottavaAlta="",t.ottavaBassa="",t.ottavaBassaBa="",t.ottavaBassaVb="",t.pendereckiTremolo="",t.pictAgogo="",t.pictAlmglocken="",t.pictAnvil="",t.pictBambooChimes="",t.pictBambooScraper="",t.pictBassDrum="",t.pictBassDrumOnSide="",t.pictBeaterBow="",t.pictBeaterBox="",t.pictBeaterBrassMalletsDown="",t.pictBeaterBrassMalletsLeft="",t.pictBeaterBrassMalletsRight="",t.pictBeaterBrassMalletsUp="",t.pictBeaterCombiningDashedCircle="",t.pictBeaterCombiningParentheses="",t.pictBeaterDoubleBassDrumDown="",t.pictBeaterDoubleBassDrumUp="",t.pictBeaterFinger="",t.pictBeaterFingernails="",t.pictBeaterFist="",t.pictBeaterGuiroScraper="",t.pictBeaterHammer="",t.pictBeaterHammerMetalDown="",t.pictBeaterHammerMetalUp="",t.pictBeaterHammerPlasticDown="",t.pictBeaterHammerPlasticUp="",t.pictBeaterHammerWoodDown="",t.pictBeaterHammerWoodUp="",t.pictBeaterHand="",t.pictBeaterHardBassDrumDown="",t.pictBeaterHardBassDrumUp="",t.pictBeaterHardGlockenspielDown="",t.pictBeaterHardGlockenspielLeft="",t.pictBeaterHardGlockenspielRight="",t.pictBeaterHardGlockenspielUp="",t.pictBeaterHardTimpaniDown="",t.pictBeaterHardTimpaniLeft="",t.pictBeaterHardTimpaniRight="",t.pictBeaterHardTimpaniUp="",t.pictBeaterHardXylophoneDown="",t.pictBeaterHardXylophoneLeft="",t.pictBeaterHardXylophoneRight="",t.pictBeaterHardXylophoneUp="",t.pictBeaterHardYarnDown="",t.pictBeaterHardYarnLeft="",t.pictBeaterHardYarnRight="",t.pictBeaterHardYarnUp="",t.pictBeaterJazzSticksDown="",t.pictBeaterJazzSticksUp="",t.pictBeaterKnittingNeedle="",t.pictBeaterMallet="",t.pictBeaterMalletDown="",t.pictBeaterMediumBassDrumDown="",t.pictBeaterMediumBassDrumUp="",t.pictBeaterMediumTimpaniDown="",t.pictBeaterMediumTimpaniLeft="",t.pictBeaterMediumTimpaniRight="",t.pictBeaterMediumTimpaniUp="",t.pictBeaterMediumXylophoneDown="",t.pictBeaterMediumXylophoneLeft="",t.pictBeaterMediumXylophoneRight="",t.pictBeaterMediumXylophoneUp="",t.pictBeaterMediumYarnDown="",t.pictBeaterMediumYarnLeft="",t.pictBeaterMediumYarnRight="",t.pictBeaterMediumYarnUp="",t.pictBeaterMetalBassDrumDown="",t.pictBeaterMetalBassDrumUp="",t.pictBeaterMetalDown="",t.pictBeaterMetalHammer="",t.pictBeaterMetalLeft="",t.pictBeaterMetalRight="",t.pictBeaterMetalUp="",t.pictBeaterSnareSticksDown="",t.pictBeaterSnareSticksUp="",t.pictBeaterSoftBassDrumDown="",t.pictBeaterSoftBassDrumUp="",t.pictBeaterSoftGlockenspielDown="",t.pictBeaterSoftGlockenspielLeft="",t.pictBeaterSoftGlockenspielRight="",t.pictBeaterSoftGlockenspielUp="",t.pictBeaterSoftTimpaniDown="",t.pictBeaterSoftTimpaniLeft="",t.pictBeaterSoftTimpaniRight="",t.pictBeaterSoftTimpaniUp="",t.pictBeaterSoftXylophone="",t.pictBeaterSoftXylophoneDown="",t.pictBeaterSoftXylophoneLeft="",t.pictBeaterSoftXylophoneRight="",t.pictBeaterSoftXylophoneUp="",t.pictBeaterSoftYarnDown="",t.pictBeaterSoftYarnLeft="",t.pictBeaterSoftYarnRight="",t.pictBeaterSoftYarnUp="",t.pictBeaterSpoonWoodenMallet="",t.pictBeaterSuperballDown="",t.pictBeaterSuperballLeft="",t.pictBeaterSuperballRight="",t.pictBeaterSuperballUp="",t.pictBeaterTriangleDown="",t.pictBeaterTrianglePlain="",t.pictBeaterTriangleUp="",t.pictBeaterWireBrushesDown="",t.pictBeaterWireBrushesUp="",t.pictBeaterWoodTimpaniDown="",t.pictBeaterWoodTimpaniLeft="",t.pictBeaterWoodTimpaniRight="",t.pictBeaterWoodTimpaniUp="",t.pictBeaterWoodXylophoneDown="",t.pictBeaterWoodXylophoneLeft="",t.pictBeaterWoodXylophoneRight="",t.pictBeaterWoodXylophoneUp="",t.pictBell="",t.pictBellOfCymbal="",t.pictBellPlate="",t.pictBellTree="",t.pictBirdWhistle="",t.pictBoardClapper="",t.pictBongos="",t.pictBrakeDrum="",t.pictCabasa="",t.pictCannon="",t.pictCarHorn="",t.pictCastanets="",t.pictCastanetsWithHandle="",t.pictCelesta="",t.pictCencerro="",t.pictCenter1="",t.pictCenter2="",t.pictCenter3="",t.pictChainRattle="",t.pictChimes="",t.pictChineseCymbal="",t.pictChokeCymbal="",t.pictClaves="",t.pictCoins="",t.pictConga="",t.pictCowBell="",t.pictCrashCymbals="",t.pictCrotales="",t.pictCrushStem="",t.pictCuica="",t.pictCymbalTongs="",t.pictDamp1="",t.pictDamp2="",t.pictDamp3="",t.pictDamp4="",t.pictDeadNoteStem="",t.pictDrumStick="",t.pictDuckCall="",t.pictEdgeOfCymbal="",t.pictEmptyTrap="",t.pictFingerCymbals="",t.pictFlexatone="",t.pictFootballRatchet="",t.pictGlassHarmonica="",t.pictGlassHarp="",t.pictGlassPlateChimes="",t.pictGlassTubeChimes="",t.pictGlsp="",t.pictGlspSmithBrindle="",t.pictGobletDrum="",t.pictGong="",t.pictGongWithButton="",t.pictGuiro="",t.pictGumHardDown="",t.pictGumHardLeft="",t.pictGumHardRight="",t.pictGumHardUp="",t.pictGumMediumDown="";t.pictGumMediumLeft="",t.pictGumMediumRight="",t.pictGumMediumUp="",t.pictGumSoftDown="",t.pictGumSoftLeft="",t.pictGumSoftRight="",t.pictGumSoftUp="",t.pictHalfOpen1="",t.pictHalfOpen2="",t.pictHandbell="",t.pictHiHat="",t.pictHiHatOnStand="",t.pictJawHarp="",t.pictJingleBells="",t.pictKlaxonHorn="",t.pictLeftHandCircle="",t.pictLionsRoar="",t.pictLithophone="",t.pictLogDrum="",t.pictLotusFlute="",t.pictMar="",t.pictMarSmithBrindle="",t.pictMaraca="",t.pictMaracas="",t.pictMegaphone="",t.pictMetalPlateChimes="",t.pictMetalTubeChimes="",t.pictMusicalSaw="",t.pictNormalPosition="",t.pictOnRim="",t.pictOpen="",t.pictOpenRimShot="",t.pictPistolShot="",t.pictPoliceWhistle="",t.pictQuijada="",t.pictRainstick="",t.pictRatchet="",t.pictRecoReco="",t.pictRightHandSquare="",t.pictRim1="",t.pictRim2="",t.pictRim3="",t.pictRimShotOnStem="",t.pictSandpaperBlocks="",t.pictScrapeAroundRim="",t.pictScrapeAroundRimClockwise="",t.pictScrapeCenterToEdge="",t.pictScrapeEdgeToCenter="",t.pictShellBells="",t.pictShellChimes="",t.pictSiren="",t.pictSistrum="",t.pictSizzleCymbal="",t.pictSleighBell="",t.pictSlideBrushOnGong="",t.pictSlideWhistle="",t.pictSlitDrum="",t.pictSnareDrum="",t.pictSnareDrumMilitary="",t.pictSnareDrumSnaresOff="",t.pictSteelDrums="",t.pictStickShot="",t.pictSuperball="",t.pictSuspendedCymbal="",t.pictSwishStem="",t.pictTabla="",t.pictTamTam="",t.pictTamTamWithBeater="",t.pictTambourine="",t.pictTempleBlocks="",t.pictTenorDrum="",t.pictThundersheet="",t.pictTimbales="",t.pictTimpani="",t.pictTomTom="",t.pictTomTomChinese="",t.pictTomTomIndoAmerican="",t.pictTomTomJapanese="",t.pictTriangle="",t.pictTubaphone="",t.pictTubularBells="",t.pictTurnLeftStem="",t.pictTurnRightLeftStem="",t.pictTurnRightStem="",t.pictVib="",t.pictVibMotorOff="",t.pictVibSmithBrindle="",t.pictVibraslap="",t.pictVietnameseHat="",t.pictWhip="",t.pictWindChimesGlass="",t.pictWindMachine="",t.pictWindWhistle="",t.pictWoodBlock="",t.pictWoundHardDown="",t.pictWoundHardLeft="",t.pictWoundHardRight="",t.pictWoundHardUp="",t.pictWoundSoftDown="",t.pictWoundSoftLeft="",t.pictWoundSoftRight="",t.pictWoundSoftUp="",t.pictXyl="",t.pictXylBass="",t.pictXylSmithBrindle="",t.pictXylTenor="",t.pictXylTenorTrough="",t.pictXylTrough="",t.pluckedBuzzPizzicato="",t.pluckedDamp="",t.pluckedDampAll="",t.pluckedDampOnStem="",t.pluckedFingernailFlick="",t.pluckedLeftHandPizzicato="",t.pluckedPlectrum="",t.pluckedSnapPizzicatoAbove="",t.pluckedSnapPizzicatoBelow="",t.pluckedWithFingernails="",t.quindicesima="",t.quindicesimaAlta="",t.quindicesimaBassa="",t.quindicesimaBassaMb="",t.repeat1Bar="",t.repeat2Bars="",t.repeat4Bars="",t.repeatBarLowerDot="",t.repeatBarSlash="",t.repeatBarUpperDot="",t.repeatDot="",t.repeatDots="",t.repeatLeft="",t.repeatRight="",t.repeatRightLeft="",t.rest1024th="",t.rest128th="",t.rest16th="",t.rest256th="",t.rest32nd="",t.rest512th="",t.rest64th="",t.rest8th="",t.restDoubleWhole="",t.restDoubleWholeLegerLine="",t.restHBar="",t.restHBarLeft="",t.restHBarMiddle="",t.restHBarRight="",t.restHalf="",t.restHalfLegerLine="",t.restLonga="",t.restMaxima="",t.restQuarter="",t.restQuarterOld="",t.restQuarterZ="",t.restWhole="",t.restWholeLegerLine="",t.reversedBrace="",t.reversedBracketBottom="",t.reversedBracketTop="",t.rightRepeatSmall="",t.scaleDegree1="",t.scaleDegree2="",t.scaleDegree3="",t.scaleDegree4="",t.scaleDegree5="",t.scaleDegree6="",t.scaleDegree7="",t.scaleDegree8="",t.scaleDegree9="",t.schaefferClef="",t.schaefferFClefToGClef="",t.schaefferGClefToFClef="",t.schaefferPreviousClef="",t.segno="",t.segnoSerpent1="",t.segnoSerpent2="",t.semipitchedPercussionClef1="",t.semipitchedPercussionClef2="",t.smnFlat="",t.smnFlatWhite="",t.smnHistoryDoubleFlat="",t.smnHistoryDoubleSharp="",t.smnHistoryFlat="",t.smnHistorySharp="",t.smnNatural="",t.smnSharp="",t.smnSharpDown="",t.smnSharpWhite="",t.smnSharpWhiteDown="",t.splitBarDivider="",t.staff1Line="",t.staff1LineNarrow="",t.staff1LineWide="",t.staff2Lines="",t.staff2LinesNarrow="",t.staff2LinesWide="",t.staff3Lines="",t.staff3LinesNarrow="",t.staff3LinesWide="",t.staff4Lines="",t.staff4LinesNarrow="",t.staff4LinesWide="",t.staff5Lines="",t.staff5LinesNarrow="",t.staff5LinesWide="",t.staff6Lines="",t.staff6LinesNarrow="",t.staff6LinesWide="",t.staffDivideArrowDown="",t.staffDivideArrowUp="",t.staffDivideArrowUpDown="",t.staffPosLower1="",t.staffPosLower2="",t.staffPosLower3="",t.staffPosLower4="",t.staffPosLower5="",t.staffPosLower6="",t.staffPosLower7="",t.staffPosLower8="",t.staffPosRaise1="",t.staffPosRaise2="",t.staffPosRaise3="",t.staffPosRaise4="",t.staffPosRaise5="",t.staffPosRaise6="",t.staffPosRaise7="",t.staffPosRaise8="",t.stem="",t.stemBowOnBridge="",t.stemBowOnTailpiece="",t.stemBuzzRoll="",t.stemDamp="",t.stemHarpStringNoise="",t.stemMultiphonicsBlack="",t.stemMultiphonicsBlackWhite="",t.stemMultiphonicsWhite="",t.stemPendereckiTremolo="",t.stemRimShot="",t.stemSprechgesang="",t.stemSulPonticello="",t.stemSussurando="",t.stemSwished="",t.stemVibratoPulse="",t.stockhausenTremolo="",t.stringsBowBehindBridge="",t.stringsBowBehindBridgeFourStrings="",t.stringsBowBehindBridgeOneString="",t.stringsBowBehindBridgeThreeStrings="",t.stringsBowBehindBridgeTwoStrings="",t.stringsBowOnBridge="",t.stringsBowOnTailpiece="",t.stringsChangeBowDirection="",t.stringsDownBow="",t.stringsDownBowAwayFromBody="",t.stringsDownBowBeyondBridge="",t.stringsDownBowTowardsBody="",t.stringsDownBowTurned="",t.stringsFouette="",t.stringsHalfHarmonic="",t.stringsHarmonic="",t.stringsJeteAbove="",t.stringsJeteBelow="",t.stringsMuteOff="",t.stringsMuteOn="",t.stringsOverpressureDownBow="",t.stringsOverpressureNoDirection="",t.stringsOverpressurePossibileDownBow="",t.stringsOverpressurePossibileUpBow="",t.stringsOverpressureUpBow="",t.stringsScrapeCircularClockwise="",t.stringsScrapeCircularCounterclockwise="",t.stringsScrapeParallelInward="",t.stringsScrapeParallelOutward="",t.stringsThumbPosition="",t.stringsThumbPositionTurned="",t.stringsTripleChopInward="",t.stringsTripleChopOutward="",t.stringsUpBow="",t.stringsUpBowAwayFromBody="",t.stringsUpBowBeyondBridge="",t.stringsUpBowTowardsBody="",t.stringsUpBowTurned="",t.stringsVibratoPulse="",t.swissRudimentsNoteheadBlackDouble="",t.swissRudimentsNoteheadBlackFlam="",t.swissRudimentsNoteheadHalfDouble="",t.swissRudimentsNoteheadHalfFlam="",t.systemDivider="",t.systemDividerExtraLong="",t.systemDividerLong="",t.textAugmentationDot="",t.textBlackNoteFrac16thLongStem="",t.textBlackNoteFrac16thShortStem="",t.textBlackNoteFrac32ndLongStem="",t.textBlackNoteFrac8thLongStem="",t.textBlackNoteFrac8thShortStem="",t.textBlackNoteLongStem="",t.textBlackNoteShortStem="",t.textCont16thBeamLongStem="",t.textCont16thBeamShortStem="",t.textCont32ndBeamLongStem="",t.textCont8thBeamLongStem="",t.textCont8thBeamShortStem="",t.textHeadlessBlackNoteFrac16thLongStem="",t.textHeadlessBlackNoteFrac16thShortStem="",t.textHeadlessBlackNoteFrac32ndLongStem="",t.textHeadlessBlackNoteFrac8thLongStem="",t.textHeadlessBlackNoteFrac8thShortStem="",t.textHeadlessBlackNoteLongStem="",t.textHeadlessBlackNoteShortStem="",t.textTie="",t.textTuplet3LongStem="",t.textTuplet3ShortStem="",t.textTupletBracketEndLongStem="",t.textTupletBracketEndShortStem="",t.textTupletBracketStartLongStem="",t.textTupletBracketStartShortStem="",t.timeSig0="",t.timeSig0Reversed="",t.timeSig0Turned="",t.timeSig1="",t.timeSig1Reversed="",t.timeSig1Turned="",t.timeSig2="",t.timeSig2Reversed="",t.timeSig2Turned="",t.timeSig3="",t.timeSig3Reversed="",t.timeSig3Turned="",t.timeSig4="",t.timeSig4Reversed="",t.timeSig4Turned="",t.timeSig5="",t.timeSig5Reversed="",t.timeSig5Turned="",t.timeSig6="",t.timeSig6Reversed="",t.timeSig6Turned="",t.timeSig7="",t.timeSig7Reversed="",t.timeSig7Turned="",t.timeSig8="",t.timeSig8Reversed="",t.timeSig8Turned="",t.timeSig9="",t.timeSig9Reversed="",t.timeSig9Turned="",t.timeSigBracketLeft="",t.timeSigBracketLeftSmall="",t.timeSigBracketRight="",t.timeSigBracketRightSmall="",t.timeSigCombDenominator="",t.timeSigCombNumerator="",t.timeSigComma="",t.timeSigCommon="",t.timeSigCommonReversed="",t.timeSigCommonTurned="",t.timeSigCut2="",t.timeSigCut3="",t.timeSigCutCommon="",t.timeSigCutCommonReversed="",t.timeSigCutCommonTurned="",t.timeSigEquals="",t.timeSigFractionHalf="",t.timeSigFractionOneThird="",t.timeSigFractionQuarter="",t.timeSigFractionThreeQuarters="",t.timeSigFractionTwoThirds="",t.timeSigFractionalSlash="",t.timeSigMinus="",t.timeSigMultiply="",t.timeSigOpenPenderecki="",t.timeSigParensLeft="",t.timeSigParensLeftSmall="",t.timeSigParensRight="",t.timeSigParensRightSmall="",t.timeSigPlus="",t.timeSigPlusSmall="",t.timeSigSlash="",t.timeSigX="",t.tremolo1="",t.tremolo2="",t.tremolo3="",t.tremolo4="",t.tremolo5="",t.tremoloDivisiDots2="",t.tremoloDivisiDots3="",t.tremoloDivisiDots4="",t.tremoloDivisiDots6="",t.tremoloFingered1="",t.tremoloFingered2="",t.tremoloFingered3="",t.tremoloFingered4="",t.tremoloFingered5="",t.tripleTongueAbove="",t.tripleTongueBelow="",t.tuplet0="",t.tuplet1="",t.tuplet2="",t.tuplet3="",t.tuplet4="",t.tuplet5="",t.tuplet6="",t.tuplet7="",t.tuplet8="",t.tuplet9="",t.tupletColon="",t.unmeasuredTremolo="",t.unmeasuredTremoloSimple="",t.unpitchedPercussionClef1="",t.unpitchedPercussionClef2="",t.ventiduesima="",t.ventiduesimaAlta="",t.ventiduesimaBassa="",t.ventiduesimaBassaMb="",t.vocalFingerClickStockhausen="",t.vocalHalbGesungen="",t.vocalMouthClosed="",t.vocalMouthOpen="",t.vocalMouthPursed="",t.vocalMouthSlightlyOpen="",t.vocalMouthWideOpen="",t.vocalNasalVoice="",t.vocalSprechgesang="",t.vocalTongueClickStockhausen="",t.vocalTongueFingerClickStockhausen="",t.vocalsSussurando="",t.wiggleArpeggiatoDown="",t.wiggleArpeggiatoDownArrow="",t.wiggleArpeggiatoDownSwash="",t.wiggleArpeggiatoUp="",t.wiggleArpeggiatoUpArrow="",t.wiggleArpeggiatoUpSwash="",t.wiggleCircular="",t.wiggleCircularConstant="",t.wiggleCircularConstantFlipped="",t.wiggleCircularConstantFlippedLarge="",t.wiggleCircularConstantLarge="",t.wiggleCircularEnd="",t.wiggleCircularLarge="",t.wiggleCircularLarger="",t.wiggleCircularLargerStill="",t.wiggleCircularLargest="",t.wiggleCircularSmall="",t.wiggleCircularStart="",t.wiggleGlissando="",t.wiggleGlissandoGroup1="",t.wiggleGlissandoGroup2="",t.wiggleGlissandoGroup3="",t.wiggleRandom1="",t.wiggleRandom2="",t.wiggleRandom3="",t.wiggleRandom4="",t.wiggleSawtooth="",t.wiggleSawtoothNarrow="",t.wiggleSawtoothWide="",t.wiggleSquareWave="",t.wiggleSquareWaveNarrow="",t.wiggleSquareWaveWide="",t.wiggleTrill="",t.wiggleTrillFast="",t.wiggleTrillFaster="",t.wiggleTrillFasterStill="",t.wiggleTrillFastest="",t.wiggleTrillSlow="",t.wiggleTrillSlower="",t.wiggleTrillSlowerStill="",t.wiggleTrillSlowest="",t.wiggleVIbratoLargestSlower="",t.wiggleVIbratoMediumSlower="",t.wiggleVibrato="",t.wiggleVibratoLargeFast="",t.wiggleVibratoLargeFaster="",t.wiggleVibratoLargeFasterStill="",t.wiggleVibratoLargeFastest="",t.wiggleVibratoLargeSlow="",t.wiggleVibratoLargeSlower="",t.wiggleVibratoLargeSlowest="",t.wiggleVibratoLargestFast="",t.wiggleVibratoLargestFaster="",t.wiggleVibratoLargestFasterStill="",t.wiggleVibratoLargestFastest="",t.wiggleVibratoLargestSlow="",t.wiggleVibratoLargestSlowest="",t.wiggleVibratoMediumFast="",t.wiggleVibratoMediumFaster="",t.wiggleVibratoMediumFasterStill="",t.wiggleVibratoMediumFastest="",t.wiggleVibratoMediumSlow="",t.wiggleVibratoMediumSlowest="",t.wiggleVibratoSmallFast="",t.wiggleVibratoSmallFaster="",t.wiggleVibratoSmallFasterStill="",t.wiggleVibratoSmallFastest="",t.wiggleVibratoSmallSlow="",t.wiggleVibratoSmallSlower="",t.wiggleVibratoSmallSlowest="",t.wiggleVibratoSmallestFast="",t.wiggleVibratoSmallestFaster="",t.wiggleVibratoSmallestFasterStill="",t.wiggleVibratoSmallestFastest="",t.wiggleVibratoSmallestSlow="",t.wiggleVibratoSmallestSlower="",t.wiggleVibratoSmallestSlowest="",t.wiggleVibratoStart="",t.wiggleVibratoWide="",t.wiggleWavy="",t.wiggleWavyNarrow="",t.wiggleWavyWide="",t.windClosedHole="",t.windFlatEmbouchure="",t.windHalfClosedHole1="",t.windHalfClosedHole2="",t.windHalfClosedHole3="",t.windLessRelaxedEmbouchure="",t.windLessTightEmbouchure="",t.windMouthpiecePop="",t.windMultiphonicsBlackStem="",t.windMultiphonicsBlackWhiteStem="",t.windMultiphonicsWhiteStem="",t.windOpenHole="",t.windReedPositionIn="",t.windReedPositionNormal="",t.windReedPositionOut="",t.windRelaxedEmbouchure="",t.windRimOnly="",t.windSharpEmbouchure="",t.windStrongAirPressure="",t.windThreeQuartersClosedHole="",t.windTightEmbouchure="",t.windTrillKey="",t.windVeryTightEmbouchure="",t.windWeakAirPressure=""}(I||(I={}));const G=16384,U={"1/8":131072,"1/4":65536,"1/2":32768,1:16384,2:8192,4:4096,8:2048,16:1024,32:512,64:256,128:128,256:64,512:32,1024:16},V={m:"1/8",l:"1/4",w:"1",h:"2",q:"4",b:"256"},X=Object.assign(Object.assign({},(()=>{const t={};for(let e=1;e<=14;e++)t[`flats_${e}`]={accidental:"b",num:e},t[`sharps_${e}`]={accidental:"#",num:e};return t.flats_0={num:0},t.sharps_0={num:0},t})()),{C:{num:0},Am:{num:0},F:{accidental:"b",num:1},Dm:{accidental:"b",num:1},Bb:{accidental:"b",num:2},Gm:{accidental:"b",num:2},Eb:{accidental:"b",num:3},Cm:{accidental:"b",num:3},Ab:{accidental:"b",num:4},Fm:{accidental:"b",num:4},Db:{accidental:"b",num:5},Bbm:{accidental:"b",num:5},Gb:{accidental:"b",num:6},Ebm:{accidental:"b",num:6},Cb:{accidental:"b",num:7},Abm:{accidental:"b",num:7},Dbm:{accidental:"b",num:8},Gbm:{accidental:"b",num:9},G:{accidental:"#",num:1},Em:{accidental:"#",num:1},D:{accidental:"#",num:2},Bm:{accidental:"#",num:2},A:{accidental:"#",num:3},"F#m":{accidental:"#",num:3},E:{accidental:"#",num:4},"C#m":{accidental:"#",num:4},B:{accidental:"#",num:5},"G#m":{accidental:"#",num:5},"F#":{accidental:"#",num:6},"D#m":{accidental:"#",num:6},"C#":{accidental:"#",num:7},"A#m":{accidental:"#",num:7},"G#":{accidental:"#",num:8},"D#":{accidental:"#",num:9},"A#":{accidental:"#",num:10}}),Y={treble:{lineShift:0},bass:{lineShift:6},tenor:{lineShift:4},alto:{lineShift:3},soprano:{lineShift:1},percussion:{lineShift:0},"mezzo-soprano":{lineShift:2},"baritone-c":{lineShift:5},"baritone-f":{lineShift:5},subbass:{lineShift:7},french:{lineShift:-1}},_={C:{index:0,intVal:0},CN:{index:0,intVal:0},"C#":{index:0,intVal:1},"C##":{index:0,intVal:2},CB:{index:0,intVal:11},CBB:{index:0,intVal:10},D:{index:1,intVal:2},DN:{index:1,intVal:2},"D#":{index:1,intVal:3},"D##":{index:1,intVal:4},DB:{index:1,intVal:1},DBB:{index:1,intVal:0},E:{index:2,intVal:4},EN:{index:2,intVal:4},"E#":{index:2,intVal:5},"E##":{index:2,intVal:6},EB:{index:2,intVal:3},EBB:{index:2,intVal:2},F:{index:3,intVal:5},FN:{index:3,intVal:5},"F#":{index:3,intVal:6},"F##":{index:3,intVal:7},FB:{index:3,intVal:4},FBB:{index:3,intVal:3},G:{index:4,intVal:7},GN:{index:4,intVal:7},"G#":{index:4,intVal:8},"G##":{index:4,intVal:9},GB:{index:4,intVal:6},GBB:{index:4,intVal:5},A:{index:5,intVal:9},AN:{index:5,intVal:9},"A#":{index:5,intVal:10},"A##":{index:5,intVal:11},AB:{index:5,intVal:8},ABB:{index:5,intVal:7},B:{index:6,intVal:11},BN:{index:6,intVal:11},"B#":{index:6,intVal:12},"B##":{index:6,intVal:13},BB:{index:6,intVal:10},BBB:{index:6,intVal:9},R:{index:6},X:{index:6}},z={"#":I.accidentalSharp,"##":I.accidentalDoubleSharp,b:I.accidentalFlat,bb:I.accidentalDoubleFlat,n:I.accidentalNatural,"{":I.accidentalParensLeft,"}":I.accidentalParensRight,db:I.accidentalThreeQuarterTonesFlatZimmermann,d:I.accidentalQuarterToneFlatStein,"++":I.accidentalThreeQuarterTonesSharpStein,"+":I.accidentalQuarterToneSharpStein,"+-":I.accidentalKucukMucennebSharp,bs:I.accidentalBakiyeFlat,bss:I.accidentalBuyukMucennebFlat,o:I.accidentalSori,k:I.accidentalKoron,bbs:I.accidentalBuyukMucennebSharp,"++-":I.accidentalBuyukMucennebSharp,ashs:I.accidentalBuyukMucennebSharp,afhf:I.accidentalBuyukMucennebSharp},j={"a.":{code:I.augmentationDot,betweenLines:!0},av:{aboveCode:I.articStaccatissimoAbove,belowCode:I.articStaccatissimoBelow,betweenLines:!0},"a>":{aboveCode:I.articAccentAbove,belowCode:I.articAccentBelow,betweenLines:!0},"a-":{aboveCode:I.articTenutoAbove,belowCode:I.articTenutoBelow,betweenLines:!0},"a^":{aboveCode:I.articMarcatoAbove,belowCode:I.articMarcatoBelow,betweenLines:!1},"a+":{code:I.pluckedLeftHandPizzicato,betweenLines:!1},ao:{aboveCode:I.pluckedSnapPizzicatoAbove,belowCode:I.pluckedSnapPizzicatoBelow,betweenLines:!1},ah:{code:I.stringsHarmonic,betweenLines:!1},"a@":{aboveCode:I.fermataAbove,belowCode:I.fermataBelow,betweenLines:!1},"a@a":{code:I.fermataAbove,betweenLines:!1},"a@u":{code:I.fermataBelow,betweenLines:!1},"a@s":{aboveCode:I.fermataShortAbove,belowCode:I.fermataShortBelow,betweenLines:!1},"a@as":{code:I.fermataShortAbove,betweenLines:!1},"a@us":{code:I.fermataShortBelow,betweenLines:!1},"a@l":{aboveCode:I.fermataLongAbove,belowCode:I.fermataLongBelow,betweenLines:!1},"a@al":{code:I.fermataLongAbove,betweenLines:!1},"a@ul":{code:I.fermataLongBelow,betweenLines:!1},"a@vl":{aboveCode:I.fermataVeryLongAbove,belowCode:I.fermataVeryLongBelow,betweenLines:!1},"a@avl":{code:I.fermataVeryLongAbove,betweenLines:!1},"a@uvl":{code:I.fermataVeryLongBelow,betweenLines:!1},"a|":{code:I.stringsUpBow,betweenLines:!1},am:{code:I.stringsDownBow,betweenLines:!1},"a,":{code:I.pictChokeCymbal,betweenLines:!1}},q={mordent:I.ornamentShortTrill,mordentInverted:I.ornamentMordent,turn:I.ornamentTurn,turnInverted:I.ornamentTurnSlash,tr:I.ornamentTrill,upprall:I.ornamentPrecompSlideTrillDAnglebert,downprall:I.ornamentPrecompDoubleCadenceUpperPrefix,prallup:I.ornamentPrecompTrillSuffixDandrieu,pralldown:I.ornamentPrecompTrillLowerSuffix,upmordent:I.ornamentPrecompSlideTrillBach,downmordent:I.ornamentPrecompDoubleCadenceUpperPrefixTurn,lineprall:I.ornamentPrecompAppoggTrill,prallprall:I.ornamentTremblement,scoop:I.brassScoop,doit:I.brassDoitMedium,fall:I.brassFallLipShort,doitLong:I.brassLiftMedium,fallLong:I.brassFallRoughMedium,bend:I.brassBend,plungerClosed:I.brassMuteClosed,plungerOpen:I.brassMuteOpen,flip:I.brassFlip,jazzTurn:I.brassJazzTurn,smear:I.brassSmear};class K{static clefProperties(t){if(!t||!(t in Y))throw new p("BadArgument","Invalid clef: "+t);return Y[t]}static keyProperties(t,e="treble",i="N",s){let n={octaveShift:0,duration:"4"};"object"==typeof s&&(n=Object.assign(Object.assign({},n),s));const o=K.sanitizeDuration(n.duration),a=t.split("/");if(a.length<2)throw new p("BadArguments",`First argument must be note/octave or note/octave/glyph-code: ${t}`);const r=a[0].toUpperCase();i=i.toUpperCase();const h=_[r];if(!h)throw new p("BadArguments","Invalid key name: "+r);let c=parseInt(a[1],10);c-=n.octaveShift;let l=(7*c-28+h.index)/2;l+=K.clefProperties(e).lineShift;const d=void 0!==h.intVal?12*c+h.intVal:void 0;let u="",g="N";return g=a.length>2&&a[2]?a[2].toUpperCase():"N"!==i?i:r,u=this.codeNoteHead(g,o),{key:r,octave:c,line:l,intValue:d,code:u,displaced:!1}}static integerToNote(t){if(void 0===t||t<0||t>11)throw new p("BadArguments",`integerToNote() requires an integer in the range [0, 11]: ${t}`);const e={0:"C",1:"C#",2:"D",3:"D#",4:"E",5:"F",6:"F#",7:"G",8:"G#",9:"A",10:"A#",11:"B"}[t];if(!e)throw new p("BadArguments",`Unknown note value for integer: ${t}`);return e}static textWidth(t){return 7*t.toString().length}static articulationCodes(t){return j[t]}static accidentalCodes(t){var e;return null!==(e=z[t])&&void 0!==e?e:t}static ornamentCodes(t){var e;return null!==(e=q[t])&&void 0!==e?e:t}static keySignature(t){const e=X[t];if(!e)throw new p("BadKeySignature",`Bad key signature spec: '${t}'`);if(!e.accidental)return[];const i={b:[2,.5,2.5,1,3,1.5,3.5],"#":[0,1.5,-.5,1,2.5,.5,2]}[e.accidental],s=Math.min(e.num,7),n=Math.max(e.num-7,0);return[...i.slice(n,s).map(t=>({type:`${e.accidental}`,line:t})),...i.slice(0,n).map(t=>({type:`${e.accidental}${e.accidental}`,line:t}))]}static getKeySignatures(){return X}static hasKeySignature(t){return t in X}static sanitizeDuration(t){const e=V[t];if(void 0!==e&&(t=e),void 0===U[t])throw new p("BadArguments",`The provided duration is not valid: ${t}`);return t}static durationToFraction(t){return(new y).parse(K.sanitizeDuration(t))}static durationToNumber(t){return K.durationToFraction(t).value()}static durationToTicks(t){t=K.sanitizeDuration(t);const e=U[t];if(void 0===e)throw new p("InvalidDuration");return e}static codeNoteHead(t,e){switch(t){case"D0":return I.noteheadDiamondWhole;case"D1":return I.noteheadDiamondHalf;case"D2":case"D3":return I.noteheadDiamondBlack;case"T0":return I.noteheadTriangleUpWhole;case"T1":return I.noteheadTriangleUpHalf;case"T2":case"T3":return I.noteheadTriangleUpBlack;case"X0":return I.noteheadXWhole;case"X1":return I.noteheadXHalf;case"X2":return I.noteheadXBlack;case"X3":return I.noteheadCircleX;case"S1":return I.noteheadSquareWhite;case"S2":return I.noteheadSquareBlack;case"R1":case"R2":return I.noteheadSquareWhite;case"DO":return I.noteheadTriangleUpBlack;case"RE":return I.noteheadMoonBlack;case"MI":return I.noteheadDiamondBlack;case"FA":return I.noteheadTriangleLeftBlack;case"FAUP":return I.noteheadTriangleRightBlack;case"SO":return I.noteheadBlack;case"LA":return I.noteheadSquareBlack;case"TI":return I.noteheadTriangleRoundDownBlack;case"DI":case"H":switch(e){case"1/2":return I.noteheadDiamondDoubleWhole;case"1":return I.noteheadDiamondWhole;case"2":return I.noteheadDiamondHalf;default:return I.noteheadDiamondBlack}case"X":case"M":switch(e){case"1/2":return I.noteheadXDoubleWhole;case"1":return I.noteheadXWhole;case"2":return I.noteheadXHalf;default:return I.noteheadXBlack}case"CX":switch(e){case"1/2":return I.noteheadCircleXDoubleWhole;case"1":return I.noteheadCircleXWhole;case"2":return I.noteheadCircleXHalf;default:return I.noteheadCircleX}case"CI":switch(e){case"1/2":return I.noteheadCircledDoubleWhole;case"1":return I.noteheadCircledWhole;case"2":return I.noteheadCircledHalf;default:return I.noteheadCircledBlack}case"SQ":switch(e){case"1/2":return I.noteheadDoubleWholeSquare;case"1":case"2":return I.noteheadSquareWhite;default:return I.noteheadSquareBlack}case"TU":switch(e){case"1/2":return I.noteheadTriangleUpDoubleWhole;case"1":return I.noteheadTriangleUpWhole;case"2":return I.noteheadTriangleUpHalf;default:return I.noteheadTriangleUpBlack}case"TD":switch(e){case"1/2":return I.noteheadTriangleDownDoubleWhole;case"1":return I.noteheadTriangleDownWhole;case"2":return I.noteheadTriangleDownHalf;default:return I.noteheadTriangleDownBlack}case"SF":switch(e){case"1/2":return I.noteheadSlashedDoubleWhole1;case"1":return I.noteheadSlashedWhole1;case"2":return I.noteheadSlashedHalf1;default:return I.noteheadSlashedBlack1}case"SB":switch(e){case"1/2":return I.noteheadSlashedDoubleWhole2;case"1":return I.noteheadSlashedWhole2;case"2":return I.noteheadSlashedHalf2;default:return I.noteheadSlashedBlack2}case"R":switch(e){case"1/8":return I.restMaxima;case"1/4":return I.restLonga;case"1/2":return I.restDoubleWhole;case"1":return I.restWhole;case"2":return I.restHalf;case"4":return I.restQuarter;case"8":return I.rest8th;case"16":return I.rest16th;case"32":return I.rest32nd;case"64":return I.rest64th;case"128":return I.rest128th;case"256":return I.rest256th;case"512":return I.rest512th;case"1024":return I.rest1024th}break;case"S":switch(e){case"1/2":return I.noteheadSlashWhiteDoubleWhole;case"1":return I.noteheadSlashWhiteWhole;case"2":return I.noteheadSlashWhiteHalf;default:return I.noteheadSlashVerticalEnds}default:switch(e){case"1/8":return I.mensuralNoteheadMaximaBlack;case"1/4":return I.mensuralNoteheadLongaBlack;case"1/2":return I.noteheadDoubleWhole;case"1":return I.noteheadWhole;case"2":return I.noteheadHalf;default:return I.noteheadBlack}}return I.null}}function $(t,e,i=!0){if("object"!=typeof t||null===t)return!1;let s=t.constructor;if(i){for(;null!==t;){if(s=t.constructor,"CATEGORY"in s&&s.CATEGORY===e)return!0;t=Object.getPrototypeOf(t)}return!1}return"CATEGORY"in s&&s.CATEGORY===e}K.UNISON=!0,K.SOFTMAX_FACTOR=10,K.STEM_WIDTH=1.5,K.STEM_HEIGHT=35,K.STAVE_LINE_THICKNESS=1,K.RENDER_PRECISION_PLACES=3,K.RESOLUTION=G,K.durationCodes={"1/8":{stem:!0},"1/4":{stem:!1},"1/2":{stem:!1},1:{stem:!1},2:{stem:!0},4:{stem:!0},8:{stem:!0,beamCount:1,stemBeamExtension:0,codeFlagUp:I.flag8thUp},16:{beamCount:2,stemBeamExtension:0,stem:!0,codeFlagUp:I.flag16thUp},32:{beamCount:3,stemBeamExtension:7.5,stem:!0,codeFlagUp:I.flag32ndUp},64:{beamCount:4,stemBeamExtension:15,stem:!0,codeFlagUp:I.flag64thUp},128:{beamCount:5,stemBeamExtension:22.5,stem:!0,codeFlagUp:I.flag128thUp},256:{beamCount:6,stemBeamExtension:25,stem:!0,codeFlagUp:I.flag256thUp},512:{beamCount:7,stemBeamExtension:27.5,stem:!0,codeFlagUp:I.flag512thUp},1024:{beamCount:8,stemBeamExtension:30,stem:!0,codeFlagUp:I.flag1024thUp}},K.NOTATION_FONT_SCALE=39,K.TABLATURE_FONT_SCALE=39,K.SLASH_NOTEHEAD_WIDTH=15,K.STAVE_LINE_DISTANCE=10,K.noteHeadStemYOffsets={[I.noteheadXBlack]:{up:.444,down:-.44},[I.noteheadXHalf]:{up:.412,down:-.412}},K.TEXT_HEIGHT_OFFSET_HACK=1,K.accidentalColumnsTable={1:{a:[1],b:[1]},2:{a:[1,2]},3:{a:[1,3,2],b:[1,2,1],secondOnBottom:[1,2,3]},4:{a:[1,3,4,2],b:[1,2,3,1],spacedOutTetrachord:[1,2,1,2]},5:{a:[1,3,5,4,2],b:[1,2,4,3,1],spacedOutPentachord:[1,2,3,2,1],verySpacedOutPentachord:[1,2,1,2,1]},6:{a:[1,3,5,6,4,2],b:[1,2,4,5,3,1],spacedOutHexachord:[1,3,2,1,3,2],verySpacedOutHexachord:[1,2,1,2,1,2]}},K.unicode={sharp:"♯",flat:"♭",natural:"♮",triangle:"△","o-with-slash":"ø",degrees:"°",circle:"○"},K.validTypes={n:{name:"note"},r:{name:"rest"},h:{name:"harmonic"},m:{name:"muted"},s:{name:"slash"},g:{name:"ghost"},d:{name:"diamond"},x:{name:"x"},ci:{name:"circled"},cx:{name:"circle x"},sf:{name:"slashed"},sb:{name:"slashed backward"},sq:{name:"square"},tu:{name:"triangle up"},td:{name:"triangle down"}},K.TIME4_4={numBeats:4,beatValue:4,resolution:G};const Q=t=>$(t,"Annotation"),J=t=>$(t,"Barline"),Z=t=>$(t,"GraceNote"),tt=t=>$(t,"Note"),et=t=>$(t,"StaveNote"),it=t=>$(t,"StemmableNote"),st=t=>$(t,"TabNote");function nt(...t){ot.DEBUG&&S("VexFlow.Accidental",t)}class ot extends W{static get CATEGORY(){return"Accidental"}static format(t,e){if(!t||0===t.length)return;const i=B.get("Accidental.noteheadAccidentalPadding"),s=e.leftShift+i,n=B.get("Accidental.accidentalSpacing"),o=B.get("Accidental.leftPadding"),a=[];let r,h=0;for(let e=0;e<t.length;++e){const i=t[e],s=i.getNote(),n=s.getStave(),o=i.checkIndex(),c=s.getKeyProps()[o];if(s!==r){for(let t=0;t<s.keys.length;++t)h=Math.max(s.getLeftDisplacedHeadPx()-s.getXShift(),h);r=s}if(n){const t=n.getSpacingBetweenLines(),e=n.getYForLine(c.line),s=Math.round(e/t*2)/2;a.push({y:e,line:s,extraXSpaceNeeded:h,accidental:i,spacingBetweenStaveLines:t})}else a.push({line:c.line,extraXSpaceNeeded:h,accidental:i})}a.sort((t,e)=>e.line-t.line);const c=[];let l=0;for(let t=0;t<a.length;t++){const e=a[t],i=e.accidental.type,s=c[c.length-1];let o;s&&(null==s?void 0:s.line)===e.line?o=s:(o={line:e.line,flatLine:!0,dblSharpLine:!0,numAcc:0,width:0,column:0},c.push(o)),"b"!==i&&"bb"!==i&&(o.flatLine=!1),"##"!==i&&(o.dblSharpLine=!1),o.numAcc++,o.width+=e.accidental.getWidth()+n,l=Math.max(e.extraXSpaceNeeded,l)}let d=0;for(let t=0;t<c.length;t++){let e=!1;const i=t;let s=t;for(;s+1<c.length&&!e;)this.checkCollision(c[s],c[s+1])?s++:e=!0;const n=t=>c[i+t],o=t=>t.map(n),a=(t,e)=>{const[i,s]=o([t,e]).map(t=>t.line);return i-s},r=(...t)=>t.map(o).every(([t,e])=>!this.checkCollision(t,e)),h=s-i+1;let l,u,g=this.checkCollision(c[i],c[s])?"a":"b";switch(h){case 3:"a"===g&&.5===a(1,2)&&.5!==a(0,1)&&(g="secondOnBottom");break;case 4:r([0,2],[1,3])&&(g="spacedOutTetrachord");break;case 5:"b"===g&&r([1,3])&&(g="spacedOutPentachord",r([0,2],[2,4])&&(g="verySpacedOutPentachord"));break;case 6:r([0,3],[1,4],[2,5])&&(g="spacedOutHexachord"),r([0,2],[2,4],[1,3],[3,5])&&(g="verySpacedOutHexachord")}if(h>=7){let e=2,i=!0;for(;!0===i;){i=!1;for(let t=0;t+e<c.length;t++)if(this.checkCollision(c[t],c[t+e])){i=!0,e++;break}}for(l=t;l<=s;l++)u=(l-t)%e+1,c[l].column=u,d=d>u?d:u}else for(l=t;l<=s;l++)u=K.accidentalColumnsTable[h][g][l-t],c[l].column=u,d=d>u?d:u;t=s}const u=[],g=[];for(let t=0;t<=d;t++)u[t]=0,g[t]=0;u[0]=s+l,g[0]=s,c.forEach(t=>{t.width>u[t.column]&&(u[t.column]=t.width)});for(let t=1;t<u.length;t++)g[t]=u[t]+g[t-1];const p=g[g.length-1];let m=0;c.forEach(t=>{let e=0;const i=m+t.numAcc;for(;m<i;m++){const i=g[t.column-1]+e+l;a[m].accidental.setXShift(i),e+=a[m].accidental.getWidth()+n,nt("Line, accCount, shift: ",t.line,m,i)}}),e.leftShift=p+o}static checkCollision(t,e){let i=e.line-t.line,s=3;i>0?(s=e.flatLine||e.dblSharpLine?2.5:3,t.dblSharpLine&&(i-=.5)):(s=t.flatLine||t.dblSharpLine?2.5:3,e.dblSharpLine&&(i-=.5));const n=Math.abs(i)<s;return nt("Line1, Line2, Collision: ",t.line,e.line,n),n}static applyAccidentals(t,e){const i=[],s={};t.forEach(t=>{const e=new y(0,1);t.getTickables().forEach(t=>{if(t.shouldIgnoreTicks())return;const n=s[e.value()];n?n.push(t):(i.push(e.value()),s[e.value()]=[t]),e.add(t.getTicks())})}),i.sort((t,e)=>t-e);const n=new H;e||(e="C");const o=n.createScaleMap(e),a={};i.forEach(t=>{const e=s[t],i=[],r=t=>{if(!et(t)||t.isRest()||t.shouldIgnoreTicks())return;const e=t;e.keys.forEach((t,s)=>{const r=n.getNoteParts(t.split("/")[0]),h=t.split("/")[1],c=r.accidental||"n",l=r.root+c;a[r.root+h]||(a[r.root+h]=o[r.root]);const d=a[r.root+h]===l,u=i.indexOf(t)>-1;if(e.getModifiers().forEach((t,i)=>{$(t,"Accidental")&&t.type==c&&t.getIndex()==s&&e.getModifiers().splice(i,1)}),!d||d&&u){a[r.root+h]=l;const n=new ot(c);e.addModifier(n,s),i.push(t)}}),e.getModifiers().forEach(t=>{$(t,"GraceNoteGroup")&&t.getGraceNotes().forEach(r)})};e.forEach(r)})}constructor(t){super(),nt("New accidental: ",t),this.type=t,this.position=W.Position.LEFT,this.cautionary=!1,this.reset()}reset(){this.text="",this.cautionary?(this.text+=K.accidentalCodes("{"),this.text+=K.accidentalCodes(this.type),this.text+=K.accidentalCodes("}"),this.fontInfo.size=B.get("Accidental.cautionary.fontSize")):(this.text+=K.accidentalCodes(this.type),this.fontInfo.size=B.get("Accidental.fontSize")),Z(this.note)&&(this.fontInfo.size=B.get("Accidental.grace.fontSize"))}setNote(t){return f(t,"ArgumentError",`Bad note value: ${t}`),this.note=t,this.reset(),this}setAsCautionary(){return this.cautionary=!0,this.reset(),this}draw(){const{type:t,position:e,index:i}=this,s=this.checkContext(),n=this.checkAttachedNote();this.setRendered();const o=n.getModifierStartXY(e,i);this.x=o.x-this.width,this.y=o.y,nt("Rendering: ",t,o.x,o.y),this.renderText(s,0,0)}}ot.DEBUG=!1;class at extends P{static get CATEGORY(){return"Stem"}static get UP(){return 1}static get DOWN(){return-1}static get WIDTH(){return K.STEM_WIDTH}static get HEIGHT(){return K.STEM_HEIGHT}constructor(t){var e,i,s,n,o,a,r;super(),this.stemUpYOffset=0,this.stemDownYOffset=0,this.stemUpYBaseOffset=0,this.stemDownYBaseOffset=0,this.xBegin=null!==(e=null==t?void 0:t.xBegin)&&void 0!==e?e:0,this.xEnd=null!==(i=null==t?void 0:t.xEnd)&&void 0!==i?i:0,this.yTop=null!==(s=null==t?void 0:t.yTop)&&void 0!==s?s:0,this.yBottom=null!==(n=null==t?void 0:t.yBottom)&&void 0!==n?n:0,this.stemExtension=null!==(o=null==t?void 0:t.stemExtension)&&void 0!==o?o:0,this.stemDirection=null!==(a=null==t?void 0:t.stemDirection)&&void 0!==a?a:0,this.hide=(null==t?void 0:t.hide)||!1,this.isStemlet=(null==t?void 0:t.isStemlet)||!1,this.stemletHeight=null!==(r=null==t?void 0:t.stemletHeight)&&void 0!==r?r:0,this.renderHeightAdjustment=0,this.setOptions(t)}setOptions(t){var e,i,s,n;this.stemUpYOffset=null!==(e=null==t?void 0:t.stemUpYOffset)&&void 0!==e?e:0,this.stemDownYOffset=null!==(i=null==t?void 0:t.stemDownYOffset)&&void 0!==i?i:0,this.stemUpYBaseOffset=null!==(s=null==t?void 0:t.stemUpYBaseOffset)&&void 0!==s?s:0,this.stemDownYBaseOffset=null!==(n=null==t?void 0:t.stemDownYBaseOffset)&&void 0!==n?n:0}setNoteHeadXBounds(t,e){return this.xBegin=t,this.xEnd=e,this}setDirection(t){this.stemDirection=t}setExtension(t){this.stemExtension=t}getExtension(){return this.stemExtension}setYBounds(t,e){this.yTop=t,this.yBottom=e}getHeight(){const t=this.stemDirection===at.UP?this.stemUpYOffset:this.stemDownYOffset;return(this.yBottom-this.yTop+(at.HEIGHT-t+this.stemExtension))*this.stemDirection}getBoundingBox(){throw new p("NotImplemented","getBoundingBox() not implemented.")}getExtents(){const t=this.stemDirection===at.UP,e=[this.yTop,this.yBottom],i=at.HEIGHT+this.stemExtension,s=(t?Math.min:Math.max)(...e),n=(t?Math.max:Math.min)(...e);return{topY:s+i*-this.stemDirection,baseY:n}}setVisibility(t){return this.hide=!t,this}setStemlet(t,e){return this.isStemlet=t,this.stemletHeight=e,this}adjustHeightForFlag(){this.renderHeightAdjustment=B.get("Stem.heightAdjustmentForFlag",-3)}adjustHeightForBeam(){this.renderHeightAdjustment=-at.WIDTH/2}draw(){if(this.setRendered(),this.hide)return;const t=this.checkContext();let e,i;const s=this.stemDirection;let n=0;s===at.DOWN?(e=this.xBegin,i=this.yTop+this.stemDownYOffset,n=this.stemDownYBaseOffset):(e=this.xEnd,i=this.yBottom-this.stemUpYOffset,n=this.stemUpYBaseOffset);const o=this.getHeight();!function(...t){at.DEBUG&&S("VexFlow.Stem",t)}("Rendering stem - ","Top Y: ",this.yTop,"Bottom Y: ",this.yBottom);const a=this.isStemlet?o-this.stemletHeight*this.stemDirection:0,r=this.getAttribute("class");t.openGroup("stem"+(r?" "+r:""),this.getAttribute("id")),t.beginPath(),t.setLineWidth(at.WIDTH),t.moveTo(e,i-a+n),t.lineTo(e,i-o-this.renderHeightAdjustment*s),t.stroke(),t.closeGroup()}}var rt,ht;at.DEBUG=!1,function(t){t[t.LEFT=1]="LEFT",t[t.CENTER=2]="CENTER",t[t.RIGHT=3]="RIGHT",t[t.CENTER_STEM=4]="CENTER_STEM"}(rt||(rt={})),function(t){t[t.TOP=1]="TOP",t[t.CENTER=2]="CENTER",t[t.BOTTOM=3]="BOTTOM",t[t.CENTER_STEM=4]="CENTER_STEM"}(ht||(ht={}));class ct extends W{static get CATEGORY(){return"Annotation"}static get minAnnotationPadding(){return B.get("NoteHead.minPadding")}static format(t,e){if(!t||0===t.length)return!1;let i=0,s=0,n=0,o=0;for(let a=0;a<t.length;++a){const r=t[a];let h=(2+A.convertSizeToPixelValue(r.fontInfo.size))/K.STAVE_LINE_DISTANCE;const c=r.checkAttachedNote(),l=c.getGlyphWidth(),d=r.getWidth();r.horizontalJustification===rt.RIGHT?(n=Math.max(l,n),i=Math.max(i,d)+ct.minAnnotationPadding):r.horizontalJustification===rt.LEFT?(o=Math.max(l,o),s=Math.max(s,d)):(i=Math.max(i,d/2)+ct.minAnnotationPadding,s=Math.max(s,d/2),n=Math.max(l/2,n),o=Math.max(l/2,o));const u=c.getStave(),g=c.hasStem()?c.getStemDirection():at.UP;let p=0,m=5;if(st(c))if(c.renderOptions.drawStem){const t=c.getStem();t&&(p=Math.abs(t.getHeight())/K.STAVE_LINE_DISTANCE)}else p=0;else if(it(c)){const t=c.getStem();t&&"n"===c.getNoteType()&&(p=Math.abs(t.getHeight())/K.STAVE_LINE_DISTANCE)}if(u&&(m=u.getNumLines()),r.verticalJustification===this.VerticalJustify.TOP){let t=c.getLineNumber(!0);st(c)&&(t=m-(c.leastString()-.5)),g===at.UP&&(t+=p);t+e.topTextLine+.5<m?(r.setTextLine(m-t),h+=m-t,e.topTextLine=h):(r.setTextLine(e.topTextLine),e.topTextLine+=h)}else if(r.verticalJustification===this.VerticalJustify.BOTTOM){let t=m-c.getLineNumber();st(c)&&(t=c.greatestString()-1),g===at.DOWN&&(t+=p);const i=t+e.textLine+1;i<m?(r.setTextLine(m-i),h+=m-i,e.textLine=h):(r.setTextLine(e.textLine),e.textLine+=h)}else r.setTextLine(e.textLine)}const a=Math.min(Math.max(s-o,0),Math.max(s-e.rightShift,0)),r=Math.min(Math.max(i-n,0),Math.max(i-e.leftShift,0));return e.leftShift+=r,e.rightShift+=a,!0}constructor(t){super(),this.text=t,this.horizontalJustification=rt.CENTER,this.verticalJustification=ht.TOP}setVerticalJustification(t){return this.verticalJustification="string"==typeof t?ct.VerticalJustifyString[t]:t,this}getVerticalJustification(){return this.verticalJustification}getJustification(){return this.horizontalJustification}setJustification(t){return this.horizontalJustification="string"==typeof t?ct.HorizontalJustifyString[t]:t,this}setTextBaseline(t){if(void 0!==t&&!Number.isFinite(t))throw new p("BadArgument","Text baseline must be finite.");return this.textBaseline=t,this}computeX(){const t=this.checkAttachedNote(),e=t.getModifierStartXY(M.ABOVE,this.index),i=this.getWidth();let s;return s=this.horizontalJustification===rt.LEFT?e.x:this.horizontalJustification===rt.RIGHT?e.x-i:this.horizontalJustification===rt.CENTER?e.x-i/2:t.getStemX()-i/2,{x:s,textWidth:i}}computeY(){const t=A.convertSizeToPixelValue(this.fontInfo.size);if(void 0!==this.textBaseline)return{y:this.textBaseline,textHeight:t};const e=this.checkAttachedNote(),i=e.hasStem()?e.getStemDirection():at.UP;let s,n={},o=0;const a=e.hasStem(),r=e.checkStave();if(a&&(n=e.checkStem().getExtents(),o=r.getSpacingBetweenLines()),this.verticalJustification===ht.BOTTOM){s=e.getYs().reduce((t,e)=>t>e?t:e),s+=(this.textLine+1)*K.STAVE_LINE_DISTANCE+t,a&&i===at.DOWN&&(s=Math.max(s,n.topY+t+o*this.textLine))}else if(this.verticalJustification===ht.CENTER){const i=e.getYForTopText(this.textLine)-1;s=i+(r.getYForBottomText(this.textLine)-i)/2+t/2}else if(this.verticalJustification===ht.TOP){s=Math.min(...e.getYs())-(this.textLine+1)*K.STAVE_LINE_DISTANCE,a&&i===at.UP&&(o=n.topY<r.getTopLineTopY()?K.STAVE_LINE_DISTANCE:o,s=Math.min(s,n.topY-o*(this.textLine+1)))}else{const i=e.getStemExtents();s=i.topY+(i.baseY-i.topY)/2+t/2}return{y:s,textHeight:t}}draw(){const t=this.checkContext(),{x:e}=this.computeX(),{y:i}=this.computeY();this.setRendered();const s=this.getAttribute("class");t.openGroup("annotation"+(s?" "+s:""),this.getAttribute("id")),function(...t){ct.DEBUG&&S("VexFlow.Annotation",t)}("Rendering annotation: ",this.text,e,i),this.x=e,this.y=i,this.renderText(t,0,0),this.drawPointerRect(),t.closeGroup()}}ct.DEBUG=!1,ct.HorizontalJustify=rt,ct.HorizontalJustifyString={left:rt.LEFT,right:rt.RIGHT,center:rt.CENTER,centerStem:rt.CENTER_STEM},ct.VerticalJustify=ht,ct.VerticalJustifyString={above:ht.TOP,top:ht.TOP,below:ht.BOTTOM,bottom:ht.BOTTOM,center:ht.CENTER,centerStem:ht.CENTER_STEM};const{ABOVE:lt,BELOW:dt}=W.Position;function ut(t,e){return.5*t(e/.5)}function gt(t,e){return e===lt?t<=5:t>=1}function pt(t,e){return gt(t,e)?e===lt?Math.ceil:Math.floor:Math.round}const mt=t=>et(t)||Z(t);function ft(t,e){const i=t.getStemDirection(),{topY:s,baseY:n}=t.getStemExtents();if(mt(t))return t.hasStem()?i===at.UP?s:n:Math.min(...t.getYs());if(st(t))return t.hasStem()&&i===at.UP?s:t.checkStave().getYForTopText(e);throw new p("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")}function St(t,e){const i=t.getStemDirection(),{topY:s,baseY:n}=t.getStemExtents();if(mt(t))return t.hasStem()?i===at.UP?n:s:Math.max(...t.getYs());if(st(t))return t.hasStem()?i===at.UP?t.checkStave().getYForBottomText(e):s:t.checkStave().getYForBottomText(e);throw new p("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")}function Tt(t,e){const i=e===lt&&t.getStemDirection()===at.UP||e===dt&&t.getStemDirection()===at.DOWN;return mt(t)?t.hasStem()&&i?.5:1:t.hasStem()&&i?1:0}class xt extends W{static get CATEGORY(){return"Articulation"}static format(t,e){if(!t||0===t.length)return!1;let i=0;const s=(t,e,i)=>ut(pt(e,i),t.height/10+.5);t.forEach(t=>{const n=t.checkAttachedNote();i=Math.max(n.getGlyphWidth(),i);let o=5;const a=n.hasStem()?n.getStemDirection():at.UP;let r=0;if(it(n)){const t=n.getStem();t&&(r=Math.abs(t.getHeight())/K.STAVE_LINE_DISTANCE)}const h=n.getStave();if(h&&(o=h.getNumLines()),t.getPosition()===lt){let i=n.getLineNumber(!0);a===at.UP&&(i+=r);let h=s(t,e.topTextLine,lt);const c=i+e.topTextLine+.5;!t.articulation.betweenLines&&c<o&&(h+=o-c),t.setTextLine(e.topTextLine),e.topTextLine+=h,t.setOrigin(.5,1)}else if(t.getPosition()===dt){let i=Math.max(o-n.getLineNumber(),0);a===at.DOWN&&(i+=r);let h=s(t,e.textLine,dt);const c=i+e.textLine+.5;!t.articulation.betweenLines&&c<o&&(h+=o-c),t.setTextLine(e.textLine),e.textLine+=h,t.setOrigin(.5,0)}});const n=t.map(t=>t.getWidth()).reduce((t,e)=>Math.max(e,t)),o=Math.min(Math.max(n-i,0),Math.max(n-(e.leftShift+e.rightShift),0));return e.leftShift+=o/2,e.rightShift+=o/2,!0}static easyScoreHook({articulations:t},e,i){if(!t)return;const s={staccato:"a.",tenuto:"a-",accent:"a>"};t.split(",").map(t=>t.trim().split(".")).map(([t,e])=>{const n={type:s[t]};return e&&(n.position=W.PositionString[e]),i.getFactory().Articulation(n)}).map(t=>e.addModifier(t,0))}constructor(t){var e;super(),this.heightShift=0,this.type=t,this.position=lt,K.articulationCodes(this.type)||((null!==(e=this.type.codePointAt(0))&&void 0!==e?e:0)%2==0?this.position=lt:this.position=dt),this.articulation={betweenLines:!1},this.reset()}reset(){this.articulation=K.articulationCodes(this.type),this.articulation||(this.articulation={code:this.type,betweenLines:!1});const t=(this.position===lt?this.articulation.aboveCode:this.articulation.belowCode)||this.articulation.code||I.null;this.text=t}setBetweenLines(t=!0){return this.articulation.betweenLines=t,this}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=this.checkIndex(),{position:s,textLine:n}=this,o=this.articulation.betweenLines,a=e.checkStave(),r=a.getSpacingBetweenLines(),h=st(e),{x:c}=e.getModifierStartXY(s,i),l=!o||h,d=Tt(e,s);let u={[lt]:()=>{const t=ft(e,n)-(n+d)*r;return l?Math.min(a.getYForTopText(xt.INITIAL_OFFSET),t):t},[dt]:()=>{const t=St(e,n)+(n+d)*r;return l?Math.max(a.getYForBottomText(xt.INITIAL_OFFSET),t):t}}[s]();if(!h){const t=s===lt?-1:1,n=e.getKeyProps()[i].line,a=(e.getYs()[i]-u)/r+Number(n),h=function(t,e,i,s){const n=ut(pt(e,i),e);if(t&&gt(n,i)&&n%1==0)return n+.5*-s;return n}(o,a,s,t);gt(h,s)&&this.setOrigin(.5,.5),u+=Math.abs(h-a)*r*t}!function(...t){xt.DEBUG&&S("VexFlow.Articulation",t)}(`Rendering articulation at (x: ${c}, y: ${u})`),this.x=c,this.y=u,this.renderText(t,0,0)}}xt.DEBUG=!1,xt.INITIAL_OFFSET=-.5;class wt{constructor(){this.defaultStyle={}}setDefaultStyle(t){return this.defaultStyle=Object.assign({},t),this}getDefaultStyle(){return Object.assign({},this.defaultStyle)}static get CATEGORY(){return"RenderContext"}set font(t){this.setFont(t)}get font(){return this.getFont()}}class bt extends P{static get CATEGORY(){return"Tickable"}constructor(){super(),this._preFormatted=!1,this._postFormatted=!1,this.ticks=new y(0,1),this.intrinsicTicks=0,this.tickMultiplier=new y(1,1),this.modifiers=[],this.tupletStack=[],this.alignCenter=!1,this.centerXShift=0,this.ignoreTicks=!1,this.formatterMetrics={freedom:{left:0,right:0},duration:"",iterations:0,space:{used:0,mean:0,deviation:0}}}reset(){return this}getTicks(){return this.ticks}shouldIgnoreTicks(){return this.ignoreTicks}setIgnoreTicks(t){var e;return this.ignoreTicks=t,null===(e=this.voice)||void 0===e||e.invalidateTicks(),this}getWidth(){if(!this._preFormatted)throw new p("UnformattedNote","Can't call GetWidth on an unformatted note.");return this.width+(this.modifierContext?this.modifierContext.getWidth():0)}getX(){return this.checkTickContext("Can't getX() without a TickContext.").getX()+this.xShift}getFormatterMetrics(){return this.formatterMetrics}getCenterXShift(){return this.isCenterAligned()?this.centerXShift:0}setCenterXShift(t){return this.centerXShift=t,this}isCenterAligned(){return this.alignCenter}setCenterAlignment(t){return this.alignCenter=t,this}getVoice(){return f(this.voice,"NoVoice","Tickable has no voice.")}setVoice(t){this.voice=t}getTuplet(){return this.tupletStack.at(-1)}getTupletStack(){return this.tupletStack}removeTuplet(t){const e=this.tupletStack.indexOf(t);if(-1===e)throw new p("BadArguments","Tuplet is not found in this tickable");this.tupletStack.splice(e,1);const i=t.getNoteCount(),s=t.getNotesOccupied();return this.applyTickMultiplier(i,s),this}clearTuplets(){var t;return this.tupletStack.length?(this.tupletStack=[],this.tickMultiplier=new y(1,1),this.ticks=new y(this.intrinsicTicks,1),null===(t=this.voice)||void 0===t||t.invalidateTicks(),this):this}resetTuplet(t){if(t)try{this.removeTuplet(t)}catch(t){}else this.clearTuplets();return this}setTuplet(t){return this.tupletStack.length&&this.clearTuplets(),this.addTuplet(t)}addTuplet(t){if(this.tupletStack.includes(t))return this;this.tupletStack.push(t);const e=t.getNoteCount(),i=t.getNotesOccupied();return this.applyTickMultiplier(i,e),this}setTupletStack(t){this.clearTuplets();for(const e of t)this.addTuplet(e);return this}addToModifierContext(t){this.modifierContext=t;for(let t=0;t<this.modifiers.length;++t)this.modifierContext.addMember(this.modifiers[t]);return this.modifierContext.addMember(this),this._preFormatted=!1,this}addModifier(t,e=0){return this.modifiers.push(t),this._preFormatted=!1,this}getModifiers(){return this.modifiers}setTickContext(t){this.tickContext=t,this._preFormatted=!1}checkTickContext(t="Tickable has no tick context."){return f(this.tickContext,"NoTickContext",t)}preFormat(){this._preFormatted||(this.width=0,this.modifierContext&&(this.modifierContext.preFormat(),this.width+=this.modifierContext.getWidth()))}set preFormatted(t){this._preFormatted=t}get preFormatted(){return this._preFormatted}postFormat(){return this._postFormatted||(this._postFormatted=!0),this}set postFormatted(t){this._postFormatted=t}get postFormatted(){return this._postFormatted}getIntrinsicTicks(){return this.intrinsicTicks}setIntrinsicTicks(t){var e;this.intrinsicTicks=t,this.ticks=this.tickMultiplier.clone().multiply(this.intrinsicTicks),null===(e=this.voice)||void 0===e||e.invalidateTicks()}getTickMultiplier(){return this.tickMultiplier}applyTickMultiplier(t,e){var i;this.tickMultiplier.multiply(t,e),this.ticks=this.tickMultiplier.clone().multiply(this.intrinsicTicks),null===(i=this.voice)||void 0===i||i.invalidateTicks()}setDuration(t){var e;const i=t.numerator*(K.RESOLUTION/t.denominator);this.ticks=this.tickMultiplier.clone().multiply(i),this.intrinsicTicks=i,null===(e=this.voice)||void 0===e||e.invalidateTicks()}getAbsoluteX(){return this.checkTickContext("Can't getAbsoluteX() without a TickContext.").getX()}setModifierContext(t){return this.modifierContext=t,this}getModifierContext(){return this.modifierContext}checkModifierContext(){return f(this.modifierContext,"NoModifierContext","No modifier context attached to this tickable.")}}class yt extends bt{static get CATEGORY(){return"Note"}static getGlyphProps(t,e="n"){t=K.sanitizeDuration(t);let i=K.durationCodes[t];void 0===i&&(i=K.durationCodes[4]);const s=K.codeNoteHead(e.toUpperCase(),t);return s!==I.null&&(i=Object.assign(Object.assign({},i),{codeHead:s})),i}static plotMetrics(t,e,i){var s;const n=e.getMetrics(),o=e.getAbsoluteX()-n.modLeftPx-n.leftDisplacedHeadPx,a=e.getAbsoluteX()-n.leftDisplacedHeadPx,r=e.getAbsoluteX(),h=e.getAbsoluteX()+n.notePx,c=e.getAbsoluteX()+n.notePx+n.rightDisplacedHeadPx,l=e.getAbsoluteX()+n.notePx+n.rightDisplacedHeadPx+n.modRightPx,d=l+(null!==(s=e.getFormatterMetrics().freedom.right)&&void 0!==s?s:0),u=l-o;t.save(),t.setFont(B.get("fontFamily"),8),t.fillText(Math.round(u)+"px",o+e.getXShift(),i);const g=i+7;function p(i,s,n,o=g){t.beginPath(),t.setStrokeStyle(n),t.setFillStyle(n),t.setLineWidth(3),t.moveTo(i+e.getXShift(),o),t.lineTo(s+e.getXShift(),o),t.stroke()}p(o,a,"red"),p(a,r,"#999"),p(r,h,"green"),p(h,c,"#999"),p(c,l,"red"),p(l,d,"#DD0"),p(o-e.getXShift(),o,"#BBB"),function(t,e,i,s="#F55"){t.save(),t.setFillStyle(s),t.beginPath(),t.arc(e,i,3,0,2*Math.PI,!1),t.closePath(),t.fill(),t.restore()}(t,r+e.getXShift(),g,"blue");const m=e.getFormatterMetrics();if(m.iterations>0){const s=m.space.deviation,n=s>=0?"+":"";t.setFillStyle("red"),t.fillText(n+Math.round(s),r+e.getXShift(),i-10)}t.restore()}static parseDuration(t){if(!t||t.length>64)return;const e=/^(\d+(?:\/\d+)?|[a-z])(d*)([nrhms]?)$/.exec(t);if(!e)return;return{duration:e[1],dots:e[2].length,type:e[3]||"n"}}static parseNoteStruct(t){const e=yt.parseDuration(t.duration);if(!e)return;let i=t.type;if(i&&!K.validTypes[i])return;const s=[];i||(i=e.type||"n",void 0!==t.keys&&t.keys.forEach((t,e)=>{const n=t.split("/");s[e]=n&&3===n.length?n[2]:i}));let n=K.durationToTicks(e.duration);if(!n)return;const o=t.dots?t.dots:e.dots;if("number"!=typeof o)return;let a=n;for(let t=0;t<o;t++){if(a<=1)return;a/=2,n+=a}return{duration:e.duration,type:i,customTypes:s,dots:o,ticks:n}}constructor(t){if(super(),!t)throw new p("BadArguments","Note must have valid initialization data to identify duration and type.");const e=yt.parseNoteStruct(t);if(!e)throw new p("BadArguments",`Invalid note initialization object: ${JSON.stringify(t)}`);this.keys=t.keys||[],this.keyProps=[],this.duration=e.duration,this.noteType=e.type,this.customTypes=e.customTypes,t.durationOverride?this.setDuration(t.durationOverride):this.setIntrinsicTicks(e.ticks),this.modifiers=[],this.glyphProps=yt.getGlyphProps(this.duration,this.noteType),this.customGlyphs=this.customTypes.map(t=>yt.getGlyphProps(this.duration,t)),this.playNote=void 0,this.ignoreTicks=!1,this.width=0,this.leftDisplacedHeadPx=0,this.rightDisplacedHeadPx=0,this.xShift=0,this.ys=[],t.alignCenter&&this.setCenterAlignment(t.alignCenter),this.renderOptions={annotationSpacing:5,strokePx:1,yShift:0}}getPlayNote(){return this.playNote}setPlayNote(t){return this.playNote=t,this}isRest(){return!1}addStroke(t,e){return e.setNote(this),e.setIndex(t),this.modifiers.push(e),this.preFormatted=!1,this}getStave(){return this.stave}checkStave(){return f(this.stave,"NoStave","No stave attached to instance.")}setStave(t){return this.stave=t,this.setYs([t.getYForLine(0)]),this.setContext(this.stave.getContext()),this}getLeftDisplacedHeadPx(){return this.leftDisplacedHeadPx}getRightDisplacedHeadPx(){return this.rightDisplacedHeadPx}setLeftDisplacedHeadPx(t){return this.leftDisplacedHeadPx=t,this}setRightDisplacedHeadPx(t){return this.rightDisplacedHeadPx=t,this}shouldIgnoreTicks(){return this.ignoreTicks}getLineNumber(t){return 0}getLineForRest(){return 0}getGlyphProps(){return this.glyphProps}getGlyphWidth(){return 0}setYs(t){return this.ys=t,this}getYs(){if(0===this.ys.length)throw new p("NoYValues","No Y-values calculated for this note.");return this.ys}getYForTopText(t){return this.checkStave().getYForTopText(t)}getVoice(){if(!this.voice)throw new p("NoVoice","Note has no voice.");return this.voice}setVoice(t){return this.voice=t,this.preFormatted=!1,this}getTickContext(){return this.checkTickContext()}setTickContext(t){return this.tickContext=t,this.preFormatted=!1,this}getDuration(){return this.duration}isDotted(){return this.getModifiersByType("Dot").length>0}hasStem(){return!1}getNoteType(){return this.noteType}getBeam(){return this.beam}checkBeam(){return f(this.beam,"NoBeam","No beam attached to instance")}hasBeam(){return void 0!==this.beam}setBeam(t){return this.beam=t,this}addModifier(t,e=0){const i="Note.addModifier(modifier: Modifier, index: number=0)";if("string"==typeof e&&(e=parseInt(e),console.warn(i+" expected a number for `index`, but received a string.")),"object"!=typeof t||"number"!=typeof e)throw new p("WrongParams","Incorrect call signature. Use "+i+" instead.");return t.setNote(this),t.setIndex(e),super.addModifier(t),this}getModifiersByType(t){return this.modifiers.filter(e=>e.getCategory()===t)}getModifierStartXY(t,e,i){if(!this.preFormatted)throw new p("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");return{x:this.getAbsoluteX(),y:this.ys[0]}}getRightParenthesisPx(t){return this.getKeyProps()[t].displaced?this.getRightDisplacedHeadPx():0}getLeftParenthesisPx(t){return this.getKeyProps()[t].displaced?this.getLeftDisplacedHeadPx()-this.xShift:-this.xShift}getFirstDotPx(){let t=this.getRightDisplacedHeadPx();const e=this.checkModifierContext().getMembers("Parenthesis");return 0!==e.length&&(t+=e[0].getWidth()+1),t}getMetrics(){if(!this.preFormatted)throw new p("UnformattedNote","Can't call getMetrics on an unformatted note.");const t=this.modifierContext?this.modifierContext.getState().leftShift:0,e=this.modifierContext?this.modifierContext.getState().rightShift:0,i=this.getWidth();return{width:i,glyphWidth:this.getGlyphWidth(),notePx:i-t-e-this.leftDisplacedHeadPx-this.rightDisplacedHeadPx,modLeftPx:t,modRightPx:e,leftDisplacedHeadPx:this.leftDisplacedHeadPx,rightDisplacedHeadPx:this.rightDisplacedHeadPx,glyphPx:0}}getAbsoluteX(){let t=this.checkTickContext("Can't getAbsoluteX() without a TickContext.").getX();return this.stave&&(t+=this.stave.getNoteStartX()+B.get("Stave.padding",0)),this.isCenterAligned()&&(t+=this.getCenterXShift()),t}getStemDirection(){throw new p("NoStem","No stem attached to this note.")}getStemExtents(){throw new p("NoStem","No stem attached to this note.")}getTieRightX(){let t=this.getAbsoluteX();return t+=this.getGlyphWidth()/2,t+=-this.width/2+this.width+2,t}getTieLeftX(){let t=this.getAbsoluteX();return t+=this.getGlyphWidth()/2,t-=this.width/2+2,t}getKeys(){return this.keys}getKeyProps(){return this.keyProps}getBoundingBox(){const t=super.getBoundingBox();for(let e=0;e<this.modifiers.length;e++)t.mergeWith(this.modifiers[e].getBoundingBox());return t}}var kt,vt,Bt;!function(t){t[t.CENTER=0]="CENTER",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.ABOVE=3]="ABOVE",t[t.BELOW=4]="BELOW",t[t.BEGIN=5]="BEGIN",t[t.END=6]="END"}(kt||(kt={}));class Ct extends P{static get CATEGORY(){return"StaveModifier"}static get Position(){return kt}constructor(){super(),this.padding=10,this.position=kt.ABOVE}getPosition(){return this.position}setPosition(t){return this.position=t,this}getStave(){return this.stave}checkStave(){return f(this.stave,"NoStave","No stave attached to instance.")}setStave(t){return this.stave=t,this}getPadding(t){return void 0!==t&&t<2?0:this.padding}setPadding(t){return this.padding=t,this}setLayoutMetrics(t){return this.layoutMetrics=t,this}getLayoutMetrics(){return this.layoutMetrics}}!function(t){t[t.SINGLE=1]="SINGLE",t[t.DOUBLE=2]="DOUBLE",t[t.END=3]="END",t[t.REPEAT_BEGIN=4]="REPEAT_BEGIN",t[t.REPEAT_END=5]="REPEAT_END",t[t.REPEAT_BOTH=6]="REPEAT_BOTH",t[t.NONE=7]="NONE"}(vt||(vt={})),function(t){t[t.NONE=0]="NONE",t[t.STRAIGHT=1]="STRAIGHT",t[t.CURVED=2]="CURVED"}(Bt||(Bt={}));class Dt extends Ct{static get CATEGORY(){return"Barline"}static get type(){return vt}static get typeString(){return{single:vt.SINGLE,double:vt.DOUBLE,end:vt.END,repeatBegin:vt.REPEAT_BEGIN,repeatEnd:vt.REPEAT_END,repeatBoth:vt.REPEAT_BOTH,none:vt.NONE}}constructor(t){super(),this.repeatBrackets=Bt.NONE,this.thickness=K.STAVE_LINE_THICKNESS;const e=vt;this.widths={},this.widths[e.SINGLE]=5,this.widths[e.DOUBLE]=5,this.widths[e.END]=5,this.widths[e.REPEAT_BEGIN]=5,this.widths[e.REPEAT_END]=5,this.widths[e.REPEAT_BOTH]=5,this.widths[e.NONE]=5,this.paddings={},this.paddings[e.SINGLE]=0,this.paddings[e.DOUBLE]=0,this.paddings[e.END]=0,this.paddings[e.REPEAT_BEGIN]=15,this.paddings[e.REPEAT_END]=15,this.paddings[e.REPEAT_BOTH]=15,this.paddings[e.NONE]=0,this.layoutMetricsMap={},this.layoutMetricsMap[e.SINGLE]={xMin:0,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.DOUBLE]={xMin:-3,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.END]={xMin:-5,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.REPEAT_END]={xMin:-10,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.REPEAT_BEGIN]={xMin:-2,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.REPEAT_BOTH]={xMin:-10,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[e.NONE]={xMin:0,xMax:0,paddingLeft:5,paddingRight:5},this.setPosition(kt.BEGIN),this.setType(t)}setRepeatBracket(t){this.repeatBrackets=t}getRepeatBrackets(){return this.repeatBrackets}getType(){return this.type}setType(t){return this.type="string"==typeof t?Dt.typeString[t]:t,this.setWidth(this.widths[this.type]),this.setPadding(this.paddings[this.type]),this.setLayoutMetrics(this.layoutMetricsMap[this.type]),this}draw(){const t=this.checkStave(),e=t.checkContext();this.setRendered();const i=this.getAttribute("class");switch(e.openGroup("stavebarline"+(i?" "+i:""),this.getAttribute("id")),this.type){case vt.SINGLE:this.drawVerticalBar(t,this.x,!1);break;case vt.DOUBLE:this.drawVerticalBar(t,this.x,!0);break;case vt.END:this.drawVerticalEndBar(t,this.x);break;case vt.REPEAT_BEGIN:this.drawRepeatBar(t,this.x,!0),t.getX()!==this.x&&this.drawVerticalBar(t,t.getX());break;case vt.REPEAT_END:this.drawRepeatBar(t,this.x,!1);break;case vt.REPEAT_BOTH:this.drawRepeatBar(t,this.x,!1),this.drawRepeatBar(t,this.x,!0)}this.drawPointerRect(),e.closeGroup()}drawVerticalBar(t,e,i){const s=t.checkContext(),n=t.getTopLineTopY(),o=t.getBottomLineBottomY();i&&s.fillRect(e-3,n,1,o-n),s.fillRect(e,n,1,o-n)}drawVerticalEndBar(t,e){const i=t.checkContext(),s=t.getTopLineTopY(),n=t.getBottomLineBottomY();i.fillRect(e-5,s,1,n-s),i.fillRect(e-2,s,3,n-s)}drawStraightBrackets(t,e,i,s,n){const o=t.checkContext(),a=Math.round(1.5*K.STAVE_LINE_DISTANCE)*n,r=Math.round(.6*K.STAVE_LINE_DISTANCE),h=Math.round(r/2),c=i+s,l=n>0?e-2:e;o.moveTo(l,c),o.lineTo(l,c+r*(-1*s)),o.lineTo(l+a,c+r*s),o.lineTo(l+a,c+s*(r+h)),o.lineTo(l,c),o.fill()}drawCurvedBrackets(t,e,i,s,n){const o=t.checkContext(),a=Math.round(1.5*K.STAVE_LINE_DISTANCE)*n,r=Math.round(.6*K.STAVE_LINE_DISTANCE),h=Math.round(r/2),c=i+s,l=n>0?e-2:e;o.moveTo(l,c),o.lineTo(l,c+r*(-1*s)),o.quadraticCurveTo(l+a/2,c+r*(-1*s),l+a,c+r*s),o.lineTo(l+a,c+s*(r+h)),o.quadraticCurveTo(l+a/2,c,l,c),o.fill()}drawRepeatBar(t,e,i){const s=t.checkContext(),n=t.getTopLineTopY(),o=t.getBottomLineBottomY();let a=3;i||(a=-5);const r=i?1:-1;s.fillRect(e+a,n,1,o-n),s.fillRect(e-2,n,3,o-n),this.repeatBrackets===Bt.CURVED?(this.drawCurvedBrackets(t,e,n,-1,r),this.drawCurvedBrackets(t,e,o,1,r)):this.repeatBrackets===Bt.STRAIGHT&&(this.drawStraightBrackets(t,e,n,-1,r),this.drawStraightBrackets(t,e,o,1,r));i?a+=4:a-=4;const h=e+a+1;let c=(t.getNumLines()-1)*t.getSpacingBetweenLines();c=c/2-t.getSpacingBetweenLines()/2;let l=n+c+1;s.beginPath(),s.arc(h,l,2,0,2*Math.PI,!1),s.fill(),l+=t.getSpacingBetweenLines(),s.beginPath(),s.arc(h,l,2,0,2*Math.PI,!1),s.fill()}}class Et extends yt{static get CATEGORY(){return"BarNote"}constructor(t=vt.SINGLE){super({duration:"b"}),this.metrics={widths:{}};const e=vt;this.metrics.widths={[e.SINGLE]:8,[e.DOUBLE]:12,[e.END]:15,[e.REPEAT_BEGIN]:14,[e.REPEAT_END]:14,[e.REPEAT_BOTH]:18,[e.NONE]:0},this.ignoreTicks=!0,this.setType(t)}getType(){return this.type}setType(t){return this.type="string"==typeof t?Dt.typeString[t]:t,this.setWidth(this.metrics.widths[this.type]),this}addToModifierContext(t){return this}preFormat(){return this.preFormatted=!0,this}draw(){const t=this.checkContext();!function(...t){Et.DEBUG&&S("VexFlow.BarNote",t)}("Rendering bar line at: ",this.getAbsoluteX());const e=new Dt(this.type);e.setX(this.getAbsoluteX()),e.setStave(this.checkStave()),e.setContext(t),e.drawWithStyle(),this.setRendered()}}function Lt(t){let e=0;return t.forEach(t=>{t.keyProps&&t.keyProps.forEach(t=>{e+=t.line-3})}),e>=0?at.DOWN:at.UP}Et.DEBUG=!1;const Nt="L",Ft="B";class At extends P{static get CATEGORY(){return"Beam"}getStemDirection(){return this._stemDirection}static getDefaultBeamGroups(t){t&&"c"!==t||(t="4/4");const e={"1/2":["1/2"],"2/2":["1/2"],"3/2":["1/2"],"4/2":["1/2"],"1/4":["1/4"],"2/4":["1/4"],"3/4":["1/4"],"4/4":["1/4"],"1/8":["1/8"],"2/8":["2/8"],"3/8":["3/8"],"4/8":["2/8"],"1/16":["1/16"],"2/16":["2/16"],"3/16":["3/16"],"4/16":["2/16"]}[t];if(void 0!==e)return e.map(t=>(new y).parse(t));{const e=parseInt(t.split("/")[0],10),i=parseInt(t.split("/")[1],10);if(e%3==0)return[new y(3,i)];if(i>4)return[new y(2,i)];if(i<=4)return[new y(1,i)]}return[new y(1,4)]}static applyAndGetBeams(t,e,i){return At.generateBeams(t.getTickables(),{groups:i,stemDirection:e})}static generateBeams(t,e={}){e.groups&&e.groups.length||(e.groups=[new y(2,8)]);const i=e.groups.map(t=>{if(!t.multiply)throw new p("InvalidBeamGroups","The beam groups must be an array of VexFlow.Fractions");return t.clone().multiply(K.RESOLUTION,1)}),s=t;let n=0,o=[],a=[];function r(){i.length-1>n?n+=1:n=0}!function(){let t=[],e=new y(0,1);s.forEach(s=>{if(t=[],s.shouldIgnoreTicks())return o.push(a),void(a=t);a.push(s);const h=i[n].clone(),c=function(t){return t.reduce((t,e)=>e.getTicks().clone().add(t),new y(0,1))}(a).add(e),l=K.durationToNumber(s.getDuration())<8;if(l&&s.getTuplet()&&(h.numerator*=2),c.greaterThan(h)){if(!l){const e=a.pop();e&&t.push(e)}o.push(a);do{e=c.subtract(i[n]),r()}while(e.greaterThanEquals(i[n]));a=t}else c.equals(h)&&(o.push(a),e=new y(0,1),a=t,r())}),a.length>0&&o.push(a)}(),function(){const t=[];o.forEach(i=>{let s=[];i.forEach((i,n,o)=>{const a=0===n||n===o.length-1,r=o[n-1],h=!e.beamRests&&i.isRest(),c=e.beamRests&&e.beamMiddleOnly&&i.isRest()&&a;let l=!1;if(e.maintainStemDirections&&r&&!i.isRest()&&!r.isRest()){const t=r.getStemDirection();l=i.getStemDirection()!==t}const d=parseInt(i.getDuration(),10)<8;h||c||l||d?(s.length>0&&t.push(s),s=l?[i]:[]):s.push(i)}),s.length>0&&t.push(s)}),o=t}(),o.forEach(t=>{let i;if(e.maintainStemDirections){const e=function(t){for(let e=0;e<t.length;e++){const i=t[e];if(!i.isRest())return i}return!1}(t);i=e?e.getStemDirection():at.UP}else i=e.stemDirection?e.stemDirection:Lt(t);!function(t,e){t.forEach(t=>{t.setStemDirection(e)})}(t,i)});const h=o.filter(t=>{if(t.length>1){let e=!0;return t.forEach(t=>{t.getIntrinsicTicks()>=K.durationToTicks("4")&&(e=!1)}),e}return!1}),c=function(){const t=[];return o.forEach(e=>{let i;e.forEach(e=>{const s=e.getTuplet();s&&i!==s&&(i=s,t.push(i))})}),t}(),l=[];return h.forEach(t=>{const i=new At(t);e.showStemlets&&(i.renderOptions.showStemlets=!0),e.secondaryBreaks&&(i.renderOptions.secondaryBreakTicks=K.durationToTicks(e.secondaryBreaks)),!0===e.flatBeams&&(i.renderOptions.flatBeams=!0,i.renderOptions.flatBeamOffset=e.flatBeamOffset),l.push(i)}),c.forEach(t=>{const e=t.notes[0].stemDirection===at.DOWN?-1:1;t.setTupletLocation(e);let i=!1;for(let e=0;e<t.notes.length;e++){if(!t.notes[e].hasBeam()){i=!0;break}}t.setBracketed(i)}),l}constructor(t,e=!1){if(super(),this.slope=0,this.yShift=0,this.forcedPartialDirections={},!t||0===t.length)throw new p("BadArguments","No notes provided for beam.");if(1===t.length)throw new p("BadArguments","Too few notes for beam.");if(this._ticks=t[0].getIntrinsicTicks(),this._ticks>=K.durationToTicks("4"))throw new p("BadArguments","Beams can only be applied to notes shorter than a quarter note.");let i,s;this._stemDirection=t[0].getStemDirection();let n=this._stemDirection;if(e&&et(t[0]))n=Lt(t);else if(e&&st(t[0])){const e=t.reduce((t,e)=>t+e.getStemDirection(),0);n=e>-1?at.UP:at.DOWN}for(i=0;i<t.length;++i)s=t[i],e&&(s.setStemDirection(n),this._stemDirection=n),s.setBeam(this);this.postFormatted=!1,this.notes=t,this._beamCount=this.getBeamCount(),this.breakOnIndexes=[],this.renderOptions={beamWidth:5,maxSlope:.25,minSlope:-.25,slopeIterations:20,slopeCost:100,showStemlets:!1,stemletExtension:7,partialBeamLength:10,flatBeams:!1,minFlatBeamOffset:15}}getNotes(){return this.notes}getBeamCount(){return this.notes.map(t=>t.getGlyphProps().beamCount).reduce((t,e)=>e>t?e:t)}breakSecondaryAt(t){return this.breakOnIndexes=t,this}setPartialBeamSideAt(t,e){return this.forcedPartialDirections[t]=e,this}unsetPartialBeamSideAt(t){return delete this.forcedPartialDirections[t],this}getSlopeY(t,e,i,s){return i+(t-e)*s}calculateSlope(){const{notes:t,renderOptions:{maxSlope:e,minSlope:i,slopeIterations:s,slopeCost:n}}=this,o=this._stemDirection,a=t[0],r=function(t,e){const i=t.getStemExtents().topY,s=t.getStemX();return(e.getStemExtents().topY-i)/(e.getStemX()-s)}(a,t[t.length-1]),h=(e-i)/s;let c=Number.MAX_VALUE,l=0,d=0;for(let s=i;s<=e;s+=h){let e=0,i=0;for(let n=1;n<t.length;++n){const r=t[n];if(r.hasStem()||r.isRest()){const t=this.getSlopeY(r.getStemX(),a.getStemX(),a.getStemExtents().topY,s)+i,h=r.getStemExtents().topY;if(h*o<t*o){const s=Math.abs(h-t);i+=s*-o,e+=s*n}else e+=(h-t)*o}}const h=r/2,u=n*Math.abs(h-s)+Math.abs(e);u<c&&(c=u,l=s,d=i)}this.slope=l,this.yShift=d}calculateFlatSlope(){const{notes:t,renderOptions:{beamWidth:e,minFlatBeamOffset:i,flatBeamOffset:s}}=this,n=this._stemDirection;let o=0,a=0,r=0,h=0;for(let e=0;e<t.length;e++){const i=t[e],s=i.getStemExtents().topY;o+=s,n===at.DOWN&&h<s?(h=s,a=Math.max(...i.getYs()),r=i.getBeamCount()):n===at.UP&&(0===h||h>s)&&(h=s,a=Math.min(...i.getYs()),r=i.getBeamCount())}let c=o/t.length;const l=i+r*e*1.5,d=a+l*-n;n===at.DOWN&&c<d?c=a+l:n===at.UP&&c>d&&(c=a-l),s?(n===at.DOWN&&c>s||n===at.UP&&c<s)&&(this.renderOptions.flatBeamOffset=c):this.renderOptions.flatBeamOffset=c,this.slope=0,this.yShift=0}getBeamYToDraw(){let t=this.notes[0].getStemExtents().topY;return this.renderOptions.flatBeams&&this.renderOptions.flatBeamOffset&&(t=this.renderOptions.flatBeamOffset),t}applyStemExtensions(){const{notes:t,slope:e,renderOptions:{showStemlets:i,stemletExtension:s,beamWidth:n}}=this,o=this.yShift,a=this._beamCount,r=t[0],h=this.getBeamYToDraw(),c=r.getStemX();for(let r=0;r<t.length;++r){const l=t[r],d=l.getStem();if(d){const t=l.getStemX(),{topY:r}=l.getStemExtents(),u=this.getSlopeY(t,c,h,e)+o,g=d.getExtension(),p=l.getStemDirection()===at.UP?r-u:u-r;let m=0;if(l.getStemDirection()!==this._stemDirection){m=(1+1.5*(l.getGlyphProps().beamCount-1))*this.renderOptions.beamWidth}if(d.setExtension(g+p+m),d.adjustHeightForBeam(),l.isRest()&&i){const t=(a-1)*n*1.5+n;d.setVisibility(!0).setStemlet(!0,t+s)}}}}lookupBeamDirection(t,e,i,s,n){if("4"===t)return Nt;const o=this.forcedPartialDirections[n];if(o)return o;const a=""+K.durationToNumber(t)/2,r=e<K.durationToTicks(a),h=s<K.durationToTicks(a),c=i<K.durationToTicks(a);return r&&h&&c?Ft:r&&!h&&c?Nt:!r&&h&&c?"R":this.lookupBeamDirection(a,e,i,s,n)}getBeamLines(t){const e=K.durationToTicks(t);let i=!1;const s=[];let n;const o=this.renderOptions.partialBeamLength;let a=!1,r=0;for(let h=0;h<this.notes.length;++h){const c=this.notes[h];r+=c.getTicks().value();let l=!1;parseInt(t,10)>=8&&(l=-1!==this.breakOnIndexes.indexOf(h),this.renderOptions.secondaryBreakTicks&&r>=this.renderOptions.secondaryBreakTicks&&(r=0,l=!0));const d=c.getIntrinsicTicks()<e,u=c.getStemX()-at.WIDTH/2,g=this.notes[h-1],p=this.notes[h+1],m=p&&p.getIntrinsicTicks()<e,f=g&&g.getIntrinsicTicks()<e,S=g&&p&&d&&!f&&!m;if(d)if(i)n=s[s.length-1],n.end=u,l&&(i=!1,p&&!m&&void 0===n.end&&(n.end=n.start-o));else{if(n={start:u,end:void 0},i=!0,S){const e=g.getIntrinsicTicks(),i=p.getIntrinsicTicks(),s=c.getIntrinsicTicks(),a=this.lookupBeamDirection(t,e,s,i,h);[Nt,Ft].includes(a)?n.end=n.start-o:n.end=n.start+o}else m?l&&(n.end=n.start-o,i=!1):n.end=(a||0===h)&&p?n.start+o:n.start-o;s.push(n)}else i=!1;a=l}const h=s[s.length-1];return h&&void 0===h.end&&(h.end=h.start-o),s}drawStems(t){this.notes.forEach(e=>{const i=e.getStem();if(i){const s=e.getStemX();i.setNoteHeadXBounds(s,s),i.setContext(t).drawWithStyle()}},this)}drawBeamLines(t){const e=["4","8","16","32","64","128","256","512","1024"],i=this.notes[0];let s=this.getBeamYToDraw();const n=i.getStemX(),o=this.renderOptions.beamWidth*this._stemDirection;for(let i=0;i<e.length;++i){const a=e[i],r=this.getBeamLines(a);for(let e=0;e<r.length;++e){const i=r[e],a=i.start,h=this.getSlopeY(a,n,s,this.slope),c=i.end;if(!c)throw new p("NoLastBeamX","lastBeamX undefined.");{const e=this.getSlopeY(c,n,s,this.slope);t.beginPath(),t.moveTo(a,h),t.lineTo(a,h+o),t.lineTo(c+1,e+o),t.lineTo(c+1,e),t.closePath(),t.fill()}}s+=1.5*o}}preFormat(){return this}postFormat(){this.postFormatted||(st(this.notes[0])||this.renderOptions.flatBeams?this.calculateFlatSlope():this.calculateSlope(),this.applyStemExtensions(),this.postFormatted=!0)}draw(){const t=this.checkContext();if(this.setRendered(),this.unbeamable)return;this.postFormatted||this.postFormat();const e=this.getAttribute("class");t.openGroup("beam"+(e?" "+e:""),this.getAttribute("id")),this.drawStems(t),this.drawBeamLines(t),this.drawPointerRect(),t.closeGroup()}}class Ot extends W{static get CATEGORY(){return"Bend"}static get UP(){return 0}static get DOWN(){return 1}static format(t,e){if(!t||0===t.length)return!1;let i=0;for(let s=0;s<t.length;++s){const n=t[s],o=n.checkAttachedNote();if(st(o)){const t=o.leastString()-1;e.topTextLine<t&&(e.topTextLine=t)}n.setXShift(i),i=n.getWidth(),n.setTextLine(e.topTextLine)}return e.rightShift+=i,e.topTextLine+=1,!0}setStyleLine(t){return this.styleLine=t,this}getStyleLine(){return this.styleLine}constructor(t){super(),this.styleLine=B.getStyle("Bend.line"),this.xShift=0,this.tap="",this.renderOptions={bendWidth:8,releaseWidth:8},this.phrase=t,this.updateWidth()}setXShift(t){return this.xShift=t,this.updateWidth(),this}setTap(t){return this.tap=t,this}getTextHeight(){const t=new P("Bend");return t.setText(this.phrase[0].text),t.getHeight()}updateWidth(){const t=t=>{const e=new P("Bend");return e.setText(t),e.getWidth()};let e=0;for(let i=0;i<this.phrase.length;++i){const s=this.phrase[i];if(void 0!==s.width)e+=s.width;else{const i=s.type===Ot.UP?this.renderOptions.bendWidth:this.renderOptions.releaseWidth;s.width=Math.max(i,t(s.text))+3,s.drawWidth=s.width/2,e+=s.width}}return this.setWidth(e+this.xShift),this}draw(){var t;const e=this.checkContext(),i=this.checkAttachedNote();this.setRendered();const s=i.getModifierStartXY(W.Position.RIGHT,this.index);s.x+=3,s.y+=.5;const n=this.xShift,o=i.checkStave().getSpacingBetweenLines(),a=i.getYs().reduce((t,e)=>t<e?t:e),r=s.y-((this.textLine+1)*o+s.y-a)+3,h=s.y-((this.textLine+1)*o+s.y-a)-1,c=(t,i,s,n)=>{const o=t+s,a=i;this.applyStyle(e,this.styleLine),e.beginPath(),e.moveTo(t,i),e.quadraticCurveTo(o,a,t+s,n),e.stroke()},l=(t,i,s,n)=>{this.applyStyle(e,this.styleLine),e.beginPath(),e.moveTo(t,n),e.quadraticCurveTo(t+s,n,t+s,i),e.stroke()},d=(t,i,s)=>{const n=i+4*s;e.beginPath(),e.moveTo(t,i),e.lineTo(t-4,n),e.lineTo(t+4,n),e.closePath(),e.fill()},u=(t,i)=>{e.setFont(this.fontInfo);const s=t-e.measureText(i).width/2;e.fillText(i,s,h)};let g,m=0,f=0;if(null===(t=this.tap)||void 0===t?void 0:t.length){u(i.getModifierStartXY(W.Position.CENTER,this.index).x,this.tap)}for(let t=0;t<this.phrase.length;++t){const e=this.phrase[t];e.drawWidth||(e.drawWidth=0),0===t&&(e.drawWidth+=n),f=e.drawWidth+m-(1===t?n:0),e.type===Ot.UP&&(g&&g.type===Ot.UP&&d(s.x,r,1),c(s.x,s.y,f,r)),e.type===Ot.DOWN&&(g&&g.type===Ot.UP&&l(s.x,s.y,f,r),g&&g.type===Ot.DOWN&&(d(s.x,s.y,-1),l(s.x,s.y,f,r)),g||(f=e.drawWidth,l(s.x,s.y,f,r))),u(s.x+f,e.text),g=e,m=e.drawWidth,g.x=s.x,s.x+=f}if(!g||void 0===g.x)throw new p("NoLastBendForBend","Internal error.");g.type===Ot.UP?d(g.x+f,r,1):g.type===Ot.DOWN&&d(g.x+f,s.y,-1)}}function Rt(t){if(!t)return!1;const e=m();return"function"==typeof e.HTMLCanvasElement&&t instanceof e.HTMLCanvasElement||"function"==typeof t.getContext&&"function"==typeof t.toDataURL}class Pt extends wt{static get WIDTH(){return 600}static get HEIGHT(){return 400}static get CANVAS_BROWSER_SIZE_LIMIT(){return 32767}static sanitizeCanvasDims(t,e){const i=this.CANVAS_BROWSER_SIZE_LIMIT;return Math.max(t,e)>i&&(!function(...t){const e=t.join(" "),i=new Error;m().console.log("Warning: ",e,i.stack)}("Canvas dimensions exceed browser limit. Cropping to "+i),t>i&&(t=i),e>i&&(e=i)),[t,e]}constructor(t){super(),this.textHeight=0,this.context2D=t,this.curTransfrom=t.getTransform(),t.canvas?this.canvas=t.canvas:this.canvas={width:Pt.WIDTH,height:Pt.HEIGHT}}clear(){this.context2D.clearRect(0,0,this.canvas.width,this.canvas.height)}openGroup(t,e){}closeGroup(){}openRotation(t,e,i){this.curTransfrom=this.context2D.getTransform(),this.context2D.translate(e,i),this.context2D.rotate(t*Math.PI/180),this.context2D.translate(-e,-i)}closeRotation(){this.context2D.setTransform(this.curTransfrom)}add(t){}setFillStyle(t){return this.context2D.fillStyle=t,this}setBackgroundFillStyle(t){return this}setStrokeStyle(t){return this.context2D.strokeStyle=t,this}setShadowColor(t){return this.context2D.shadowColor=t,this}setShadowBlur(t){const e=this.context2D.getTransform(),i=Math.sqrt(e.a*e.a+e.b*e.b+e.c*e.c+e.d*e.d);return this.context2D.shadowBlur=i*t,this}setLineWidth(t){return this.context2D.lineWidth=t,this}setLineCap(t){return this.context2D.lineCap=t,this}setLineDash(t){return this.context2D.setLineDash(t),this}scale(t,e){return this.context2D.scale(t,e),this}resize(t,e,i){var s;const n=this.context2D.canvas,o=null!==(s=null!=i?i:m().devicePixelRatio)&&void 0!==s?s:1;return[t,e]=Pt.sanitizeCanvasDims(t*o,e*o),t=t/o|0,e=e/o|0,n.width=t*o,n.height=e*o,Rt(n)&&(n.style.width=t+"px",n.style.height=e+"px"),this.scale(o,o)}rect(t,e,i,s){return this.context2D.rect(t,e,i,s),this}fillRect(t,e,i,s){return this.context2D.fillRect(t,e,i,s),this}pointerRect(t,e,i,s){return this}clearRect(t,e,i,s){return this.context2D.clearRect(t,e,i,s),this}beginPath(){return this.context2D.beginPath(),this}moveTo(t,e){return this.context2D.moveTo(t,e),this}lineTo(t,e){return this.context2D.lineTo(t,e),this}bezierCurveTo(t,e,i,s,n,o){return this.context2D.bezierCurveTo(t,e,i,s,n,o),this}quadraticCurveTo(t,e,i,s){return this.context2D.quadraticCurveTo(t,e,i,s),this}arc(t,e,i,s,n,o){return this.context2D.arc(t,e,i,s,n,o),this}fill(){return this.context2D.fill(),this}stroke(){return this.context2D.stroke(),this}closePath(){return this.context2D.closePath(),this}measureText(t){const e=this.context2D.measureText(t);let i=0,s=0;return e.fontBoundingBoxAscent?(i=-e.fontBoundingBoxAscent,s=e.fontBoundingBoxDescent+e.fontBoundingBoxAscent):(i=-e.actualBoundingBoxAscent,s=e.actualBoundingBoxDescent+e.actualBoundingBoxAscent),{x:0,y:i,width:e.width,height:s}}fillText(t,e,i){return this.context2D.fillText(t,e,i),this}save(){return this.context2D.save(),this}restore(){return this.context2D.restore(),this}set fillStyle(t){this.context2D.fillStyle=t}get fillStyle(){return this.context2D.fillStyle}set strokeStyle(t){this.context2D.strokeStyle=t}get strokeStyle(){return this.context2D.strokeStyle}setFont(t,e,i,s){const n=A.validate(t,e,i,s);return this.context2D.font=A.toCSSString(n),this.textHeight=A.convertSizeToPixelValue(n.size),this}getFont(){return this.context2D.font}}function Mt(t,e){return[I.csymDiminished,I.csymHalfDiminished,I.csymMajorSeventh].flatMap(i=>[{left:"A",right:i,position:"superscript",adjustmentEm:t},{left:"F",right:i,position:"subscript",adjustmentEm:e}])}const It=[{textFont:"Academico",musicFont:"Bravura",pairs:Mt(-.18,-.12)},{textFont:"Petaluma Script",musicFont:"Petaluma",pairs:Mt(-.12,-.08)}];function Wt(t){return void 0===t||""===t||"normal"===t?"400":String(t)}function Ht(t){return/[\uE870-\uE87F\uED60-\uED67\uE260-\uE26F]/u.test(t)}function Gt(t){const e=[];for(const i of t){const t=Ht(i),s=e[e.length-1];(null==s?void 0:s.music)===t?s.text+=i:e.push({text:i,music:t})}return e}function Ut(t,e,i,s){var n,o;const a=Array.from(e).slice(-1)[0],r=Array.from(i)[0];return null!==(o=null===(n=t.pairs.find(t=>t.left===a&&t.right===r&&t.position===s))||void 0===n?void 0:n.adjustmentEm)&&void 0!==o?o:0}function Vt(t,e,i,s,n){var o,a;const r=A.convertSizeToPixelValue(null!==(o=e.size)&&void 0!==o?o:12),h=[];let c,l=0,d="";for(const o of function(t){const e=[];for(const i of t){if(!i.text)continue;const t=e[e.length-1];(null==t?void 0:t.position)===i.position?t.text+=i.text:e.push(Object.assign({},i))}return e}(t)){const t="baseline"!==o.position,u=t&&c&&c.position!==o.position;let g=u?c.x:l;!u&&h.length&&(g+=s.spacing*r+Ut(i,d,o.text,o.position)*r);const p=g,m="superscript"===o.position?s.superscript*r:"subscript"===o.position?s.subscript*r:0;let f="";for(const c of Gt(o.text)){f&&(g+=Ut(i,f,c.text,o.position)*r);const l=Object.assign(Object.assign({},e),{family:c.music?i.musicFont:i.textFont,size:t?A.scaleSize(null!==(a=e.size)&&void 0!==a?a:12,s.ratio):e.size}),d=n(c.text,l);h.push({text:c.text,position:o.position,font:l,x:g,y:m,metrics:d}),g+=d.width,f=c.text}l=u?Math.max(c.end,g):g,c=t&&!u?{position:o.position,x:p,end:l}:void 0,d=o.text}const u=Math.min(0,...h.map(t=>t.x-t.metrics.actualBoundingBoxLeft)),g=Math.max(l,...h.map(t=>t.x+t.metrics.actualBoundingBoxRight));for(const t of h)t.x-=u;return{runs:h,width:g-u}}function Xt(...t){Kt.DEBUG&&S("VexFlow.ChordSymbol",t)}class Yt extends P{constructor(t,e,i,s,n){super(),this.text=t,this.symbolModifier=e,this.xShift=i,this.yShift=s,this.vAlign=n}isSuperscript(){return this.symbolModifier===jt.SUPERSCRIPT}isSubscript(){return this.symbolModifier===jt.SUBSCRIPT}}var _t,zt,jt,qt;!function(t){t[t.LEFT=1]="LEFT",t[t.CENTER=2]="CENTER",t[t.RIGHT=3]="RIGHT",t[t.CENTER_STEM=4]="CENTER_STEM"}(_t||(_t={})),function(t){t[t.TOP=1]="TOP",t[t.BOTTOM=2]="BOTTOM"}(zt||(zt={})),function(t){t[t.NONE=1]="NONE",t[t.SUBSCRIPT=2]="SUBSCRIPT",t[t.SUPERSCRIPT=3]="SUPERSCRIPT"}(jt||(jt={}));class Kt extends W{static get CATEGORY(){return"ChordSymbol"}static get superSubRatio(){return B.get("ChordSymbol.superSubRatio")}static get spacingBetweenBlocks(){return B.get("ChordSymbol.spacing")}static get superscriptOffset(){return B.get("ChordSymbol.superscriptOffset")}static get subscriptOffset(){return B.get("ChordSymbol.subscriptOffset")}static get minPadding(){return B.get("NoteHead.minPadding")}static format(t,e){if(!t||0===t.length)return!1;let i=0,s=0,n=0,o=0,a=0;for(const r of t){const t=r.checkAttachedNote();let h=1;const c=r.formatKerning();if(void 0!==c)i=c,r.symbolBlocks.some(t=>t.isSuperscript()||t.isSubscript())&&(h=2);else for(let t=0;t<r.symbolBlocks.length;++t){const e=r.symbolBlocks[t],s=e.isSuperscript(),n=e.isSubscript();if(e.setXShift(i),(s||n)&&(h=2),n&&t>0){const s=r.symbolBlocks[t-1];s.isSuperscript()&&(e.setXShift(i-s.getWidth()-Kt.minPadding),e.vAlign=!0,i+=-s.getWidth()-Kt.minPadding+(s.getWidth()>e.getWidth()?s.getWidth()-e.getWidth():0))}i+=e.getWidth()+Kt.minPadding}if(r.getVertical()===zt.TOP?(r.setTextLine(e.topTextLine),e.topTextLine+=h):(r.setTextLine(e.textLine+1),e.textLine+=h+1),r.getReportWidth()&&it(t)){const e=t.getGlyphWidth();r.getHorizontal()===_t.RIGHT?(o=Math.max(e,o),s=Math.max(s,i)+Kt.minPadding):r.getHorizontal()===_t.LEFT?(a=Math.max(e,a),n=Math.max(n,i)):(s=Math.max(s,i/2)+Kt.minPadding,n=Math.max(n,i/2),o=Math.max(e/2,o),a=Math.max(e/2,a))}(r.getReportWidth()||r.kernedRuns)&&(r.width=i),i=0}const r=Math.min(Math.max(n-a,0),Math.max(n-e.rightShift,0)),h=Math.min(Math.max(s-o,0),Math.max(s-e.leftShift,0));return e.leftShift+=h,e.rightShift+=r,!0}setKerning(t){if("auto"!==t&&"none"!==t)throw new p("BadArgument","Kerning must be auto or none.");return this.kerning=t,this.kernedRuns=void 0,this}getKerning(){return this.kerning}setKerningProfile(t){if(t&&(!t.textFont.trim()||!t.musicFont.trim()||t.pairs.some(t=>1!==Array.from(t.left).length||1!==Array.from(t.right).length||!["baseline","superscript","subscript"].includes(t.position)||!Number.isFinite(t.adjustmentEm))))throw new p("BadArgument","Invalid chord kerning profile.");return this.kerningProfile=t&&Object.assign(Object.assign({},t),{pairs:t.pairs.map(t=>Object.assign({},t))}),this.kernedRuns=void 0,this}formatKerning(){var t;if(this.kernedRuns=void 0,"none"===this.kerning)return;const e=function(t,e){var i;const s=(null!==(i=t.family)&&void 0!==i?i:"").split(",").map(t=>t.trim().replace(/^['"]|['"]$/g,""));return(e?[e]:It).find(e=>s[0]===e.textFont&&s[1]===e.musicFont&&Wt(t.weight)===Wt(e.weight)&&(t.style||"normal")===(e.style||"normal"))}(this.fontInfo,this.kerningProfile);if(!e)return;const i=null!==(t=this.kerningMeasurement)&&void 0!==t?t:this.kerningMeasurement=new P,s=Vt(this.symbolBlocks.map(t=>({text:t.getText(),position:t.isSuperscript()?"superscript":t.isSubscript()?"subscript":"baseline"})),this.fontInfo,e,{spacing:Kt.spacingBetweenBlocks,ratio:Kt.superSubRatio,superscript:Kt.superscriptOffset,subscript:Kt.subscriptOffset},(t,e)=>i.setText(t).setFont(e).measureText());return this.kernedRuns=s.runs,s.width}constructor(){super(),this.symbolBlocks=[],this.horizontal=_t.LEFT,this.vertical=zt.TOP,this.reportWidth=!0,this.kerning="none",this.kerningOrigin={x:0,y:0}}get superscriptOffset(){return Kt.superscriptOffset*A.convertSizeToPixelValue(this.fontInfo.size)}get subscriptOffset(){return Kt.subscriptOffset*A.convertSizeToPixelValue(this.fontInfo.size)}setReportWidth(t){return this.reportWidth=t,this}getReportWidth(){return this.reportWidth}getSymbolBlock(t={}){var e,i;const s=new Yt(null!==(e=t.text)&&void 0!==e?e:"",null!==(i=t.symbolModifier)&&void 0!==i?i:jt.NONE,0,0,!1);if(s.isSubscript()&&s.setYShift(this.subscriptOffset),s.isSuperscript()&&s.setYShift(this.superscriptOffset),s.isSubscript()||s.isSuperscript()){const{family:t,size:e,weight:i,style:n}=this.fontInfo,o=A.scaleSize(e,Kt.superSubRatio);s.setFont(t,o,i,n)}else s.setFont(this.fontInfo);return s}addSymbolBlock(t){return this.symbolBlocks.push(this.getSymbolBlock(t)),this}addText(t,e={}){return this.addSymbolBlock(Object.assign(Object.assign({},e),{text:t}))}addTextSuperscript(t){const e=jt.SUPERSCRIPT;return this.addSymbolBlock({text:t,symbolModifier:e})}addTextSubscript(t){const e=jt.SUBSCRIPT;return this.addSymbolBlock({text:t,symbolModifier:e})}addGlyphSuperscript(t){return this.addTextSuperscript(Kt.glyphs[t])}addGlyph(t,e={}){return this.addText(Kt.glyphs[t],e)}addGlyphOrText(t,e={}){let i="";for(let e=0;e<t.length;++e){const s=t[e],n=Kt.glyphs[s];i+=n||s}return i.length>0&&this.addText(i,e),this}addLine(t={}){return this.addText("",t)}setVertical(t){return this.vertical="string"==typeof t?Kt.VerticalJustifyString[t]:t,this}getVertical(){return this.vertical}setHorizontal(t){return this.horizontal="string"==typeof t?Kt.HorizontalJustifyString[t]:t,this}getHorizontal(){return this.horizontal}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=this.getAttribute("class");t.openGroup("chordsymbol"+(i?" "+i:""),this.getAttribute("id"));const s=e.getModifierStartXY(W.Position.ABOVE,this.index);let n;t.setFont(this.fontInfo);const o=e.hasStem(),a=e.checkStave();if(this.vertical===zt.BOTTOM){if(n=a.getYForBottomText(this.textLine+K.TEXT_HEIGHT_OFFSET_HACK),o){const t=e.checkStem().getExtents(),i=a.getSpacingBetweenLines(),s=1===e.getStemDirection()?t.baseY:t.topY;n=Math.max(n,s+i*(this.textLine+2))}}else{const t=Math.min(...e.getYs());if(n=Math.min(a.getYForTopText(this.textLine),t-10),o){const t=e.checkStem().getExtents(),i=a.getSpacingBetweenLines();n=Math.min(n,t.topY-5-i*this.textLine)}}let r=s.x;if(r=this.horizontal===_t.LEFT?s.x:this.horizontal===_t.RIGHT?this.kernedRuns?s.x-this.getWidth():s.x+this.getWidth():this.horizontal===_t.CENTER?s.x-this.getWidth()/2:e.getStemX()-this.getWidth()/2,Xt("Rendering ChordSymbol: ",r,n),this.kernedRuns){this.kerningOrigin={x:r,y:n};for(const e of this.kernedRuns)t.setFont(e.font),t.fillText(e.text,r+e.x,n+e.y)}else this.symbolBlocks.forEach(e=>{Xt("Rendering Text: ",e.getText(),r+e.getXShift(),n+e.getYShift()),e.setX(r),e.setY(n),e.renderText(t,0,0)});this.drawPointerRect(),t.closeGroup()}getBoundingBox(){if(this.kernedRuns){const{x:t,y:e}=this.kerningOrigin;let i;for(const s of this.kernedRuns){const n=s.metrics,o=new D(t+s.x-n.actualBoundingBoxLeft,e+s.y-n.actualBoundingBoxAscent,n.actualBoundingBoxLeft+n.actualBoundingBoxRight,n.actualBoundingBoxAscent+n.actualBoundingBoxDescent);i?i.mergeWith(o):i=o}return null!=i?i:new D(t,e,0,0)}if(!this.symbolBlocks.length)return new D(0,0,0,0);const t=D.copy(this.symbolBlocks[0].getBoundingBox());for(let e=1;e<this.symbolBlocks.length;e++)t.mergeWith(this.symbolBlocks[e].getBoundingBox());return t}}Kt.DEBUG=!1,Kt.HorizontalJustify=_t,Kt.HorizontalJustifyString={left:_t.LEFT,right:_t.RIGHT,center:_t.CENTER,centerStem:_t.CENTER_STEM},Kt.VerticalJustify=zt,Kt.VerticalJustifyString={top:zt.TOP,above:zt.TOP,below:zt.BOTTOM,bottom:zt.BOTTOM},Kt.glyphs={diminished:I.csymDiminished,dim:I.csymDiminished,halfDiminished:I.csymHalfDiminished,"+":I.csymAugmented,augmented:I.csymAugmented,majorSeventh:I.csymMajorSeventh,minor:I.csymMinor,"-":I.csymMinor,"(":"(",leftParen:"(",")":")",rightParen:")",leftBracket:I.csymBracketLeftTall,rightBracket:I.csymBracketRightTall,leftParenTall:"(",rightParenTall:")","/":I.csymDiagonalArrangementSlash,over:I.csymDiagonalArrangementSlash,"#":I.csymAccidentalSharp,b:I.csymAccidentalFlat},Kt.symbolModifiers=jt;class $t extends Ct{static get CATEGORY(){return"Clef"}static get types(){const{gClef:t,fClef:e,cClef:i,unpitchedPercussionClef1:s,sixStringTabClef:n}=I;return{treble:{code:t,line:3},bass:{code:e,line:1},alto:{code:i,line:2},tenor:{code:i,line:1},percussion:{code:s,line:2},soprano:{code:i,line:4},"mezzo-soprano":{code:i,line:3},"baritone-c":{code:i,line:0},"baritone-f":{code:e,line:2},subbass:{code:e,line:0},french:{code:t,line:4},tab:{code:n,line:2.5}}}constructor(t,e,i){super(),this.code=$t.types.treble.code,this.line=$t.types.treble.line,this.size="default",this.type="treble",this.setPosition(kt.BEGIN),this.setType(t,e,i),function(...t){$t.DEBUG&&S("VexFlow.Clef",t)}("Creating clef:",t)}setType(t,e="default",i){return this.type=t,this.code=$t.types[t].code,this.line=$t.types[t].line,this.size=null!=e?e:"default","8va"===i&&(this.code===I.gClef&&(this.code=I.gClef8va),this.code===I.fClef&&(this.code=I.fClef8va)),"8vb"===i&&(this.code===I.gClef&&(this.code=I.gClef8vb),this.code===I.fClef&&(this.code=I.fClef8vb)),this.text=this.code,this.fontInfo.size=Math.floor($t.getPoint(this.size)),this}static getPoint(t){return"default"===t?B.get("fontSize"):2*B.get("fontSize")/3}setStave(t){return this.stave=t,this}draw(){const t=this.checkStave(),e=t.checkContext();this.setRendered();const i=this.getAttribute("class");e.openGroup("clef"+(i?" "+i:""),this.getAttribute("id")),this.y=t.getYForLine(this.line),this.renderText(e,0,0),this.drawPointerRect(),e.closeGroup()}}$t.DEBUG=!1;class Qt extends yt{static get CATEGORY(){return"ClefNote"}constructor(t,e="default",i){super({duration:"b"}),this.setType(t,e,i),this.ignoreTicks=!0}setType(t,e,i){return this.clef=new $t(t,e,i),this.setWidth(this.clef.getWidth()),this}getClef(){return this.clef}preFormat(){return this.preFormatted=!0,this}draw(){const t=this.checkStave(),e=this.checkContext();this.setRendered(),this.clef.setX(this.getAbsoluteX()),this.clef.setY(t.getYForLine(this.clef.line)),this.clef.renderText(e,0,0)}getBoundingBox(){return this.clef.getBoundingBox()}}class Jt{static getNextContext(t){const e=t.tContexts,i=e.indexOf(t);if(i+1<e.length)return e[i+1]}constructor(t){var e;this.preFormatted=!1,this.postFormatted=!1,this.tickID=null!==(e=null==t?void 0:t.tickID)&&void 0!==e?e:0,this.currentTick=new y(0,1),this.maxTicks=new y(0,1),this.maxTickable=void 0,this.minTicks=void 0,this.minTickable=void 0,this.padding=1,this.x=0,this.xBase=0,this.xOffset=0,this.tickables=[],this.tickablesByVoice={},this.notePx=0,this.glyphPx=0,this.leftDisplacedHeadPx=0,this.rightDisplacedHeadPx=0,this.modLeftPx=0,this.modRightPx=0,this.totalLeftPx=0,this.totalRightPx=0,this.tContexts=[],this.width=0,this.formatterMetrics={freedom:{left:0,right:0}}}getTickID(){return this.tickID}getX(){return this.x}setX(t){return this.x=t,this.xBase=t,this.xOffset=0,this}getXBase(){return this.xBase}setXBase(t){this.xBase=t,this.x=t+this.xOffset}getXOffset(){return this.xOffset}setXOffset(t){this.xOffset=t,this.x=this.xBase+t}getWidth(){return this.width+2*this.padding}setPadding(t){return this.padding=t,this}getMaxTicks(){return this.maxTicks}getMinTicks(){return this.minTicks}getMaxTickable(){return this.maxTickable}getMinTickable(){return this.minTickable}getTickables(){return this.tickables}getTickableForVoice(t){return this.tickablesByVoice[t]}getTickablesByVoice(){return this.tickablesByVoice}getCenterAlignedTickables(){return this.tickables.filter(t=>t.isCenterAligned())}getMetrics(){const{width:t,glyphPx:e,notePx:i,leftDisplacedHeadPx:s,rightDisplacedHeadPx:n,modLeftPx:o,modRightPx:a,totalLeftPx:r,totalRightPx:h}=this;return{width:t,glyphPx:e,notePx:i,leftDisplacedHeadPx:s,rightDisplacedHeadPx:n,modLeftPx:o,modRightPx:a,totalLeftPx:r,totalRightPx:h}}getCurrentTick(){return this.currentTick}setCurrentTick(t){this.currentTick=t,this.preFormatted=!1}addTickable(t,e){if(!t)throw new p("BadArgument","Invalid tickable added.");if(!t.shouldIgnoreTicks()){const e=t.getTicks();e.greaterThan(this.maxTicks)&&(this.maxTicks=e.clone(),this.maxTickable=t),(void 0===this.minTicks||e.lessThan(this.minTicks))&&(this.minTicks=e.clone(),this.minTickable=t)}return t.setTickContext(this),this.tickables.push(t),this.tickablesByVoice[null!=e?e:0]=t,this.preFormatted=!1,this}preFormat(){var t;if(this.preFormatted)return this;for(let e=0;e<this.tickables.length;++e){const i=this.tickables[e];i.preFormat();const s=i.getMetrics();this.leftDisplacedHeadPx=Math.max(this.leftDisplacedHeadPx,s.leftDisplacedHeadPx),this.rightDisplacedHeadPx=Math.max(this.rightDisplacedHeadPx,s.rightDisplacedHeadPx),this.notePx=Math.max(this.notePx,s.notePx),this.glyphPx=Math.max(this.glyphPx,null!==(t=s.glyphWidth)&&void 0!==t?t:0),this.modLeftPx=Math.max(this.modLeftPx,s.modLeftPx),this.modRightPx=Math.max(this.modRightPx,s.modRightPx),this.totalLeftPx=Math.max(this.totalLeftPx,s.modLeftPx+s.leftDisplacedHeadPx),this.totalRightPx=Math.max(this.totalRightPx,s.modRightPx+s.rightDisplacedHeadPx),this.width=this.notePx+this.totalLeftPx+this.totalRightPx}return this}postFormat(){return this.postFormatted||(this.postFormatted=!0),this}getFormatterMetrics(){return this.formatterMetrics}move(t,e,i){this.setX(this.getX()+t),this.getFormatterMetrics().freedom.left+=t,this.getFormatterMetrics().freedom.right-=t,e&&(e.getFormatterMetrics().freedom.right+=t),i&&(i.getFormatterMetrics().freedom.left-=t)}getDeviationCost(){return b(this.tickables.map(t=>t.getFormatterMetrics().space.deviation))}getAverageDeviationCost(){return this.tickables.length?this.getDeviationCost()/this.tickables.length:0}}class Zt extends yt{static get CATEGORY(){return"Crescendo"}constructor(t){var e;super(t),this.options={extendLeft:0,extendRight:0,yShift:0},this.decrescendo=!1,this.line=null!==(e=t.line)&&void 0!==e?e:0,this.height=15}setLine(t){return this.line=t,this}setHeight(t){return this.height=t,this}setDecrescendo(t){return this.decrescendo=t,this}preFormat(){return this.preFormatted=!0,this}draw(){const t=this.checkContext(),e=this.checkStave();this.setRendered();const i=this.getTickContext(),s=Jt.getNextContext(i),n=this.getAbsoluteX(),o=s?s.getX():e.getX()+e.getWidth(),a=e.getYForLine(this.line+-3)+1;!function(...t){Zt.DEBUG&&S("VexFlow.Crescendo",t)}("Drawing ",this.decrescendo?"decrescendo ":"crescendo ",this.height,"x",n-o),function(t,e){const i=e.beginX,s=e.endX,n=e.y,o=e.height/2;t.beginPath(),e.reverse?(t.moveTo(i,n-o),t.lineTo(s,n),t.lineTo(i,n+o)):(t.moveTo(s,n-o),t.lineTo(i,n),t.lineTo(s,n+o)),t.stroke(),t.closePath()}(t,{beginX:n-this.options.extendLeft,endX:o+this.options.extendRight,y:a+this.options.yShift,height:this.height,reverse:this.decrescendo})}}function te(t,e,i,s){const n=[t,s],o=3*e-t-3*i+s,a=2*(t-2*e+i),r=e-t,h=[];if(Math.abs(o)<1e-12)Math.abs(a)>1e-12&&h.push(-r/a);else{const t=a*a-4*o*r;if(t>=0){const e=Math.sqrt(t);h.push((-a+e)/(2*o),(-a-e)/(2*o))}}for(const o of h)if(o>0&&o<1){const a=1-o;n.push(a*a*a*t+3*a*a*o*e+3*a*o*o*i+o*o*o*s)}return n}Zt.DEBUG=!1,function(t){t[t.NEAR_HEAD=1]="NEAR_HEAD",t[t.NEAR_TOP=2]="NEAR_TOP"}(qt||(qt={}));class ee extends P{static get CATEGORY(){return"Curve"}static get Position(){return qt}static get PositionString(){return{nearHead:qt.NEAR_HEAD,nearTop:qt.NEAR_TOP}}constructor(t,e,i){super(),this.renderOptions=Object.assign({thickness:2,xShift:0,yShift:10,position:qt.NEAR_HEAD,positionEnd:qt.NEAR_HEAD,invert:!1,cps:[{x:0,y:10},{x:0,y:10}],openingDirection:"auto"},i),this.setNotes(t,e)}setNotes(t,e){if(!t&&!e)throw new p("BadArguments","Curve needs to have either `from` or `to` set.");return this.from=t,this.to=e,this}isPartial(){return!this.from||!this.to}getBezierPoints(t){const e=this.renderOptions.xShift,i=this.renderOptions.yShift*t.direction,s=t.firstX+e,n=t.firstY+i,o=t.lastX-e,a=t.lastY+i,r=this.renderOptions.thickness,h=this.renderOptions.cps,{x:c,y:l}=h[0],{x:d,y:u}=h[1],g=(o-s)/(h.length+2);return{first:{x:s,y:n},last:{x:o,y:a},cps:[{x:s+g+c,y:n+l*t.direction},{x:o-g+d,y:a+u*t.direction}],thicknessCps:[{x:o-g+d,y:a+(u+r)*t.direction},{x:s+g+c,y:n+(l+r)*t.direction}]}}renderCurve(t){var e,i;const s=this.checkContext(),{first:n,last:o,cps:a,thicknessCps:r}=this.getBezierPoints(t);s.beginPath(),s.moveTo(n.x,n.y),s.bezierCurveTo(a[0].x,a[0].y,a[1].x,a[1].y,o.x,o.y),(null===(e=this.style)||void 0===e?void 0:e.lineDash)||s.bezierCurveTo(r[0].x,r[0].y,r[1].x,r[1].y,n.x,n.y),s.stroke(),s.closePath(),(null===(i=this.style)||void 0===i?void 0:i.lineDash)||s.fill()}getRenderParams(){const t=this.from,e=this.to;let i,s,n,o,a=0,r="baseY",h="baseY";function c(t){return"string"==typeof t?ee.PositionString[t]:t}const l=c(this.renderOptions.position),d=c(this.renderOptions.positionEnd);if(l===qt.NEAR_TOP&&(r="topY",h="topY"),d===qt.NEAR_HEAD?h="baseY":d===qt.NEAR_TOP&&(h="topY"),t)i=t.getTieRightX(),a=t.getStemDirection(),n=t.getStemExtents()[r];else{i=e.checkStave().getTieStartX(),n=e.getStemExtents()[r]}if(e)s=e.getTieLeftX(),a=e.getStemDirection(),o=e.getStemExtents()[h];else{s=t.checkStave().getTieEndX(),o=t.getStemExtents()[h]}return"up"===this.renderOptions.openingDirection&&(a=1),"down"===this.renderOptions.openingDirection&&(a=-1),{firstX:i,lastX:s,firstY:n,lastY:o,direction:a*(!0===this.renderOptions.invert?-1:1)}}getBoundingBox(){var t;const{first:e,last:i,cps:s,thicknessCps:n}=this.getBezierPoints(this.getRenderParams()),o=te(e.x,s[0].x,s[1].x,i.x),a=te(e.y,s[0].y,s[1].y,i.y);(null===(t=this.style)||void 0===t?void 0:t.lineDash)||(o.push(...te(i.x,n[0].x,n[1].x,e.x)),a.push(...te(i.y,n[0].y,n[1].y,e.y)));const r=Math.min(...o),h=Math.min(...a);return new D(r,h,Math.max(...o)-r,Math.max(...a)-h)}draw(){return this.checkContext(),this.setRendered(),this.renderCurve(this.getRenderParams()),!0}}class ie extends W{static get CATEGORY(){return"Dot"}static getDots(t){return t.getModifiersByType(ie.CATEGORY)}static buildAndAttach(t,e){for(const i of t)if(null==e?void 0:e.all)for(let t=0;t<i.keys.length;t++){const e=new ie;i.addModifier(e,t)}else if(void 0!==(null==e?void 0:e.index)){const t=new ie;i.addModifier(t,null==e?void 0:e.index)}else{const t=new ie;i.addModifier(t,0)}}static format(t,e){const i=e.rightShift;if(!t||0===t.length)return!1;const s=[],n={};for(let e=0;e<t.length;++e){const o=t[e],a=o.getNote();let r,h;if(et(a)){const t=o.checkIndex();r=a.getKeyProps()[t],h=a.getFirstDotPx()}else{if(!st(a))throw new p("Internal","Unexpected instance.");r={line:.5},h=i}const c=a.getAttribute("id");s.push({line:r.line,note:a,noteId:c,dot:o}),n[c]=Math.max(n[c]||h,h)}s.sort((t,e)=>e.line-t.line);let o=i,a=0,r=null,h=null,c=null,l=0;for(let t=0;t<s.length;++t){const{dot:e,note:i,noteId:d,line:u}=s[t];u===r&&i===h||(o=n[d]),i.isRest()||u===r||(.5===Math.abs(u%1)?l=0:(l=.5,null===h||h.isRest()||null===r||r-u!==.5?u+l===c&&(l=-.5):l=-.5)),i.isRest()?e.dotShiftY+=-l:e.dotShiftY=-l,c=u+l,e.setXShift(o),o+=e.getWidth()+1,a=o>a?o:a,r=u,h=i}return e.rightShift+=a,!0}constructor(){super(),this.position=W.Position.RIGHT,this.setText(I.augmentationDot),this.dotShiftY=0}setNote(t){return this.note=t,this.font=t.font,this}setDotShiftY(t){return this.dotShiftY=t,this}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=e.checkStave().getSpacingBetweenLines(),s=e.getModifierStartXY(this.position,this.index,{forceFlagRight:!0});st(e)&&(s.y=e.getStemExtents().baseY),this.x=s.x,this.y=s.y+this.dotShiftY*i,this.renderText(t,0,0)}}class se extends W{static get CATEGORY(){return"FretHandFinger"}static format(t,e){const{leftShift:i,rightShift:s}=e;if(!t||0===t.length)return!1;const n=[];let o=null,a=0,r=0;for(let h=0;h<t.length;++h){const c=t[h],l=c.getNote(),d=c.getPosition(),u=c.checkIndex(),g=l.getKeyProps()[u],p=B.get("FretHandFinger.fontSize");if(c.position===M.ABOVE&&(e.topTextLine+=p/K.STAVE_LINE_DISTANCE+.5),c.position===M.BELOW&&(e.textLine+=p/K.STAVE_LINE_DISTANCE+.5),l!==o){for(let t=0;t<l.keys.length;++t)0===i&&(a=Math.max(l.getLeftDisplacedHeadPx(),a)),0===s&&(r=Math.max(l.getRightDisplacedHeadPx(),r));o=l}n.push({note:l,num:c,pos:d,line:g.line,shiftL:a,shiftR:r})}n.sort((t,e)=>e.line-t.line);let h=0,c=0,l=0,d=0,u=null,g=null;for(let t=0;t<n.length;++t){let e=0;const{note:o,pos:a,num:p,line:m,shiftL:f,shiftR:S}=n[t];m===u&&o===g||(h=i+f,c=s+S);const T=p.getWidth()+1;a===W.Position.LEFT?(p.setXShift(i+h),e=i+T,l=e>l?e:l):a===W.Position.RIGHT&&(p.setXShift(c),e=r+T,d=e>d?e:d),u=m,g=o}return e.leftShift+=l,e.rightShift+=d,!0}static easyScoreHook({fingerings:t}={},e,i){null==t||t.split(",").map(t=>{const e=t.trim().split("."),s={number:e[0]};return e[1]&&(s.position=e[1]),i.getFactory().Fingering(s)}).map((t,i)=>e.addModifier(t,i))}constructor(t){super(),this.setFretHandFinger(t),this.position=W.Position.LEFT,this.xOffset=0,this.yOffset=0}setFretHandFinger(t){return this.text=t,this}getFretHandFinger(){return this.text}setOffsetX(t){return this.xOffset=t,this}setOffsetY(t){return this.yOffset=t,this}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=e.getModifierStartXY(this.position,this.index);let s=i.x+this.xOffset,n=i.y+this.yOffset+5;switch(this.position){case W.Position.ABOVE:s-=4,n-=12;break;case W.Position.BELOW:s-=2,n+=10;break;case W.Position.LEFT:s-=this.width;break;case W.Position.RIGHT:s+=1;break;default:throw new p("InvalidPosition",`The position ${this.position} does not exist`)}this.renderText(t,s,n)}}function ne(...t){ae.DEBUG&&S("VexFlow.Parser",t)}function oe(t){if("matchedString"in t)return t.matchedString;if("results"in t)return oe(t.results);const e=t;return 1===e.length?oe(e[0]):0===e.length?null:e.map(oe)}class ae{constructor(t){this.grammar=t,this.line="",this.pos=0,this.errorPos=-1}parse(t){this.line=t,this.pos=0,this.errorPos=-1;const e=this.expect(this.grammar.begin());return e.errorPos=this.errorPos,e}matchFail(t){-1===this.errorPos&&(this.errorPos=this.pos),this.pos=t}matchSuccess(){this.errorPos=-1}matchToken(t,e=!1){const i=e?new RegExp("^(("+t+"))"):new RegExp("^(("+t+")\\s*)"),s=this.line.slice(this.pos).match(i);return null!==s?{success:!0,matchedString:s[2],incrementPos:s[1].length,pos:this.pos}:{success:!1,pos:this.pos}}expectOne(t,e=!1){const i=[],s=this.pos;let n=!0,o=!1;if(e=!0===e||!0===t.maybe,t.expect)for(const e of t.expect){const s=this.pos,a=this.expect(e);if(a.success){if(i.push(a),o=!0,t.or)break}else if(n=!1,!t.or){this.pos=s;break}}const a=t.or&&o||n,r=a||!0===e,h=a?1:0;return e&&!a&&(this.pos=s),r?this.matchSuccess():this.matchFail(s),{success:r,results:i,numMatches:h}}expectOneOrMore(t,e=!1){const i=[],s=this.pos;let n=0,o=!0;do{const e=this.expectOne(t);e.success&&e.results?(n++,i.push(e.results)):o=!1}while(o);const a=n>0||!0===e;return!e||n>0||(this.pos=s),a?this.matchSuccess():this.matchFail(s),{success:a,results:i,numMatches:n}}expectZeroOrMore(t){return this.expectOneOrMore(t,!0)}expect(t){if(ne("Evaluating rule function:",t),!t)throw new p("Invalid rule function");let e;const i=t.bind(this.grammar)();if(i.token)e=this.matchToken(i.token,!0===i.noSpace),e.success&&(this.pos+=e.incrementPos);else{if(!i.expect)throw ne(i),new p("Bad grammar! No `token` or `expect` property "+i);e=i.oneOrMore?this.expectOneOrMore(i):i.zeroOrMore?this.expectZeroOrMore(i):this.expectOne(i)}const s=[];return e.matches=s,e.results&&e.results.forEach(t=>s.push(oe(t))),i.run&&e.success&&i.run({matches:s}),e}}function re(...t){pe.DEBUG&&S("VexFlow.EasyScore",t)}ae.DEBUG=!1;class he{constructor(t){this.builder=t}begin(){return this.LINE}LINE(){return{expect:[this.PIECE,this.PIECES,this.EOL]}}PIECE(){return{expect:[this.CHORDORNOTE,this.PARAMS],run:()=>this.builder.commitPiece()}}PIECES(){return{expect:[this.COMMA,this.PIECE],zeroOrMore:!0}}PARAMS(){return{expect:[this.DURATION,this.TYPE,this.DOTS,this.OPTS]}}CHORDORNOTE(){return{expect:[this.CHORD,this.SINGLENOTE],or:!0}}CHORD(){return{expect:[this.LPAREN,this.NOTES,this.RPAREN],run:t=>this.builder.addChord(t.matches[1])}}NOTES(){return{expect:[this.NOTE],oneOrMore:!0}}NOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE]}}SINGLENOTE(){return{expect:[this.NOTENAME,this.ACCIDENTAL,this.OCTAVE],run:t=>{const e=t;this.builder.addSingleNote(e.matches[0],e.matches[1],e.matches[2])}}}ACCIDENTAL(){return{expect:[this.MICROTONES,this.ACCIDENTALS],maybe:!0,or:!0}}DOTS(){return{expect:[this.DOT],zeroOrMore:!0,run:t=>this.builder.setNoteDots(t.matches)}}TYPE(){return{expect:[this.SLASH,this.MAYBESLASH,this.TYPES],maybe:!0,run:t=>this.builder.setNoteType(t.matches[2])}}DURATION(){return{expect:[this.SLASH,this.DURATIONS],maybe:!0,run:t=>this.builder.setNoteDuration(t.matches[1])}}OPTS(){return{expect:[this.LBRACKET,this.KEYVAL,this.KEYVALS,this.RBRACKET],maybe:!0}}KEYVALS(){return{expect:[this.COMMA,this.KEYVAL],zeroOrMore:!0}}KEYVAL(){return{expect:[this.KEY,this.EQUALS,this.VAL],run:t=>this.builder.addNoteOption(t.matches[0],t.matches[2].slice(1,-1))}}VAL(){return{expect:[this.SVAL,this.DVAL],or:!0}}KEY(){return{token:"[a-zA-Z][a-zA-Z0-9]*"}}DVAL(){return{token:'["][^"]*["]'}}SVAL(){return{token:"['][^']*[']"}}NOTENAME(){return{token:"[a-gA-G]"}}OCTAVE(){return{token:"[0-9]+"}}ACCIDENTALS(){return{token:"bb|b|##|#|n"}}MICROTONES(){return{token:"bbs|bss|bs|db|d|\\+\\+-|\\+-|\\+\\+|\\+|k|o"}}DURATIONS(){return{token:"[0-9whq]+"}}TYPES(){return{token:"[rRsSmMhHgG]"}}LPAREN(){return{token:"[(]"}}RPAREN(){return{token:"[)]"}}COMMA(){return{token:"[,]"}}DOT(){return{token:"[.]"}}SLASH(){return{token:"[/]"}}MAYBESLASH(){return{token:"[/]?"}}EQUALS(){return{token:"[=]"}}LBRACKET(){return{token:"\\["}}RBRACKET(){return{token:"\\]"}}EOL(){return{token:"$"}}}class ce{constructor(t){this.chord=[],this.dots=0,this.options={},this.duration=t}}class le{constructor(t){this.commitHooks=[],this.factory=t,this.reset()}reset(t){var e;this.options=Object.assign({stem:"auto",clef:"treble"},t),this.elements={notes:[],accidentals:[]},this.rollingDuration=null!==(e=null==t?void 0:t.duration)&&void 0!==e?e:"8",this.resetPiece()}getFactory(){return this.factory}getElements(){return this.elements}addCommitHook(t){this.commitHooks.push(t)}resetPiece(){re("resetPiece"),this.piece=new ce(this.rollingDuration)}setNoteDots(t){re("setNoteDots:",t),t&&(this.piece.dots=t.length)}setNoteDuration(t){re("setNoteDuration:",t),this.rollingDuration=this.piece.duration=t||this.rollingDuration}setNoteType(t){re("setNoteType:",t),t&&(this.piece.type=t)}addNoteOption(t,e){re("addNoteOption: key:",t,"value:",e),this.piece.options[t]=e}addNote(t,e,i){re("addNote:",t,e,i),this.piece.chord.push({key:t,accid:e,octave:i})}addSingleNote(t,e,i){re("addSingleNote:",t,e,i),this.addNote(t,e,i)}addChord(t){re("startChord"),"object"!=typeof t[0]?this.addSingleNote(t[0]):t.forEach(t=>{t&&this.addNote(...t)}),re("endChord")}commitPiece(){re("commitPiece");const{factory:t}=this;if(!t)return;const e=Object.assign(Object.assign({},this.options),this.piece.options),i=f(e.stem,"BadArguments","options.stem is not defined").toLowerCase(),s=f(e.clef,"BadArguments","options.clef is not defined").toLowerCase(),{chord:n,duration:o,dots:a,type:r}=this.piece,h=H.accidentals,c=n.map(t=>{var e;return t.key+(h.includes(null!==(e=t.accid)&&void 0!==e?e:"")?t.accid:"")+"/"+t.octave}),l="auto"===i,d="g"===(null==r?void 0:r.toLowerCase())?t.GhostNote({duration:o,dots:a}):t.StaveNote({keys:c,duration:o,dots:a,type:r,clef:s,autoStem:l});l||d.setStemDirection("up"===i?at.UP:at.DOWN);const u=[];n.forEach((e,i)=>{const s=e.accid;if("string"==typeof s){const e=t.Accidental({type:s});d.addModifier(e,i),u.push(e)}else u.push(void 0)});for(let t=0;t<a;t++)ie.buildAndAttach([d],{all:!0});this.commitHooks.forEach(t=>t(e,d,this)),this.elements.notes.push(d),this.elements.accidentals.push(u),this.resetPiece()}}function de(t,e){void 0!==t.id&&e.setAttribute("id",t.id)}const ue=/\s*,\s*/;function ge(t,e){void 0!==t.class&&t.class.split(ue).forEach(t=>e.addClass(t))}class pe{constructor(t={}){this.defaults={clef:"treble",time:"4/4",stem:"auto"},this.setOptions(t)}set(t){return this.defaults=Object.assign(Object.assign({},this.defaults),t),this}setOptions(t){var e,i;const s=t.factory,n=null!==(e=t.builder)&&void 0!==e?e:new le(s);return this.options=Object.assign(Object.assign({commitHooks:[de,ge,xt.easyScoreHook,se.easyScoreHook],throwOnError:!1},t),{factory:s,builder:n}),this.factory=s,this.builder=n,this.grammar=new he(this.builder),this.parser=new ae(this.grammar),null===(i=this.options.commitHooks)||void 0===i||i.forEach(t=>this.addCommitHook(t)),this}setContext(t){return this.factory.setContext(t),this}parse(t,e={}){this.builder.reset(e);const i=this.parser.parse(t);if(!i.success&&this.options.throwOnError)throw re(i),new p("Error parsing line: "+t);return i}beam(t,e){return this.factory.Beam({notes:t,options:e}),t}tuplet(t,e){return this.factory.Tuplet({notes:t,options:e}),t}notes(t,e={}){return e=Object.assign({clef:this.defaults.clef,stem:this.defaults.stem},e),this.parse(t,e),this.builder.getElements().notes}measures(t,e={}){const i=[];let s=0,n="";for(let e=0;e<t.length;e++){const o=t[e];n?o===n&&(n=""):'"'===o||"'"===o?n=o:"|"===o&&(i.push(t.slice(s,e)),s=e+1)}i.push(t.slice(s));const o=i.map((t,e)=>{let s=t.trim();if(e>0&&(s=s.replace(/^,\s*/,"")),e<i.length-1&&(s=s.replace(/\s*,$/,"")),!s)throw new p("BadArguments","Empty EasyScore measure. Use an explicit rest.");return s});let a=e.duration;return o.map(t=>{if(!this.parse(t,Object.assign(Object.assign({clef:this.defaults.clef,stem:this.defaults.stem},e),{duration:a})).success)throw new p("BadArguments",`Invalid EasyScore measure: ${t}`);return a=this.builder.rollingDuration,this.builder.getElements().notes})}voice(t,e={}){return e=Object.assign({time:this.defaults.time},e),this.factory.Voice(e).addTickables(t)}addCommitHook(t){this.builder.addCommitHook(t)}}pe.DEBUG=!1;class me extends yt{static get CATEGORY(){return"NoteHead"}constructor(t){var e;super(t),this.customGlyph=!1,this.ledger={"":"","":""},this.index=t.index,this.x=t.x||0,this.y=t.y||0,t.noteType&&(this.noteType=t.noteType),this.displaced=t.displaced||!1,this.stemDirection=t.stemDirection||at.UP,this.line=t.line||0,this.glyphProps=yt.getGlyphProps(this.duration,this.noteType),f(this.glyphProps,"BadArguments",`No glyph found for duration '${this.duration}' and type '${this.noteType}'`),(this.line>5||this.line<0)&&this.ledger[this.glyphProps.codeHead]&&(this.glyphProps.codeHead=this.ledger[this.glyphProps.codeHead]),this.text=this.glyphProps.codeHead,t.customGlyphCode&&(this.customGlyph=!0,this.text=t.customGlyphCode),this.setStyle(null!==(e=t.style)&&void 0!==e?e:{}),this.slashed=t.slashed||!1,this.renderOptions=Object.assign({},this.renderOptions)}getWidth(){return this.width}isDisplaced(){return!0===this.displaced}getLine(){return this.line}setLine(t){return this.line=t,this}getAbsoluteX(){const t=this.preFormatted?super.getAbsoluteX():this.x,e=at.WIDTH/2;return t+(this.displaced?(this.width-e)*this.stemDirection:0)}setStave(t){const e=this.getLine();return this.stave=t,this.stave&&(this.setY(this.stave.getYForNote(e)),this.setContext(this.stave.getContext())),this}preFormat(){return this.preFormatted||(this.preFormatted=!0),this}draw(){var t;const e=this.checkContext();this.setRendered();const i=this.getAttribute("class");e.openGroup("notehead"+(i?" "+i:""),this.getAttribute("id")),function(...t){me.DEBUG&&S("VexFlow.NoteHead",t)}("Drawing note head '",this.noteType,this.duration,"' at",this.x,this.y),this.x=this.getAbsoluteX(),this.renderText(e,0,0),null===(t=this.parent)||void 0===t||t.drawModifiers(this),this.drawPointerRect(),e.closeGroup()}}me.DEBUG=!1;class fe extends P{static get CATEGORY(){return"Flag"}draw(){const t=this.checkContext();this.setRendered();const e=this.getAttribute("class");t.openGroup("flag"+(e?" "+e:""),this.getAttribute("id")),function(...t){fe.DEBUG&&S("VexFlow.Flag",t)}("Drawing flag '",this.text,"' at",this.x,this.y),this.renderText(t,0,0),this.drawPointerRect(),t.closeGroup()}}fe.DEBUG=!1;class Se extends yt{static get CATEGORY(){return"StemmableNote"}constructor(t){super(t),this.flag=new fe}getStem(){return this.stem}checkStem(){if(!this.stem)throw new p("NoStem","No stem attached to instance");return this.stem}setStem(t){return this.stem=t,this.addChild(t),this}buildStem(){const t=new at;return this.setStem(t),this}buildFlag(){var t,e,i;const{glyphProps:s}=this;if(this.hasFlag()){const n=this.getStemDirection()===at.DOWN?String.fromCodePoint((null!==(e=null===(t=s.codeFlagUp)||void 0===t?void 0:t.codePointAt(0))&&void 0!==e?e:-1)+1):null!==(i=s.codeFlagUp)&&void 0!==i?i:I.null;this.flag.setText(n),this.flag.fontInfo=this.fontInfo}}getBaseCustomNoteHeadGlyphProps(){return this.getStemDirection()===at.DOWN?this.customGlyphs[this.customGlyphs.length-1]:this.customGlyphs[0]}getStemLength(){return at.HEIGHT+this.getStemExtension()}getBeamCount(){const t=this.getGlyphProps();return t?t.beamCount:0}getStemMinimumLength(){const t=K.durationToFraction(this.duration),e=void 0===this.beam;let i=t.value()<=1?0:20;switch(this.duration){case"8":case"16":i=e?35:25;break;case"32":i=e?45:35;break;case"64":i=e?50:40;break;case"128":i=e?55:45;break;case"256":i=e?60:55;break;case"512":i=e?65:60;break;case"1024":i=e?70:65}return i}getStemDirection(){if(!this.stemDirection)throw new p("NoStem","No stem attached to this note.");return this.stemDirection}setStemDirection(t){if(t||(t=at.UP),t!==at.UP&&t!==at.DOWN)throw new p("BadArgument",`Invalid stem direction: ${t}`);return this.stemDirection=t,this.reset(),this.hasFlag()&&this.buildFlag(),this.beam=void 0,this.stem&&(this.stem.setDirection(t),this.stem.setExtension(this.getStemExtension())),this.preFormatted&&this.preFormat(),this}getStemX(){const t=this.getAbsoluteX()+this.xShift,e=this.getAbsoluteX()+this.xShift+this.getGlyphWidth();return this.stemDirection===at.DOWN?t:e}getCenterGlyphX(){return this.getAbsoluteX()+this.xShift+this.getGlyphWidth()/2}getStemExtension(){const t=this.getGlyphProps(),e=this.flag.getHeight(),i=this.getFontScale();return void 0!==this.stemExtensionOverride?this.stemExtensionOverride:this.beam?t.stemBeamExtension*i:e>at.HEIGHT*i?e-at.HEIGHT*i:0}setStemLength(t){return this.stemExtensionOverride=t-at.HEIGHT,this}getStemExtents(){if(!this.stem)throw new p("NoStem","No stem attached to this note.");return this.stem.getExtents()}getYForTopText(t){const e=this.checkStave();if(this.hasStem()){const i=this.getStemExtents();if(!i)throw new p("InvalidState","Stem does not have extents.");return Math.min(e.getYForTopText(t),i.topY-this.renderOptions.annotationSpacing*(t+1))}return e.getYForTopText(t)}getYForBottomText(t){const e=this.checkStave();if(this.hasStem()){const i=this.getStemExtents();if(!i)throw new p("InvalidState","Stem does not have extents.");return Math.max(e.getYForTopText(t),i.baseY+this.renderOptions.annotationSpacing*t)}return e.getYForBottomText(t)}hasFlag(){return void 0!==this.glyphProps.codeFlagUp&&!this.beam&&!this.isRest()}postFormat(){var t;return null===(t=this.beam)||void 0===t||t.postFormat(),this.postFormatted=!0,this}drawStem(t){var e;this.checkContext(),this.setRendered(),this.setStem(new at(t)),null===(e=this.stem)||void 0===e||e.setContext(this.getContext()).drawWithStyle()}}function Te(t,e,i){const s=i>0?e.maxLine+.5-t.minLine:t.maxLine+.5-e.minLine,n=i*Math.max(1,Math.ceil(s));t.line+=n,t.maxLine+=n,t.minLine+=n,t.note.setKeyLine(0,t.note.getKeyLine(0)+n)}class xe extends Se{static get CATEGORY(){return"StaveNote"}static get LEDGER_LINE_OFFSET(){return 3}static get minNoteheadPadding(){return B.get("NoteHead.minPadding")}static format(t,e){if(!t||t.length<2)return!1;const i=[];for(let e=0;e<t.length;e++){const s=t[e].sortedKeyProps,n=s[0].keyProps.line;let o=s[s.length-1].keyProps.line;const a=t[e].getStemDirection(),r=t[e].getStemLength()/10,h=t[e].getStemMinimumLength()/10;let c;t[e].isRest()?(c=n+Math.ceil(t[e]._noteHeads[0].getTextMetrics().actualBoundingBoxAscent/K.STAVE_LINE_DISTANCE),o=n-Math.ceil(t[e]._noteHeads[0].getTextMetrics().actualBoundingBoxDescent/K.STAVE_LINE_DISTANCE)):(c=1===a?s[s.length-1].keyProps.line+r:s[s.length-1].keyProps.line,o=1===a?s[0].keyProps.line:s[0].keyProps.line-r),i.push({line:s[0].keyProps.line,maxLine:c,minLine:o,isrest:t[e].isRest(),stemDirection:a,stemMax:r,stemMin:h,voiceShift:t[e].getVoiceShiftWidth(),isDisplaced:t[e].isDisplaced(),note:t[e]})}let s,n,o,a=0;const r=[!1,!1,!1];for(let t=0;t<i.length;t++)r[t]=!1!==i[t].note.renderOptions.draw;if(r[0]&&r[1]&&r[2])a=3,s=i[0],n=i[1],o=i[2];else if(r[0]&&r[1])a=2,s=i[0],o=i[1];else if(r[0]&&r[2])a=2,s=i[0],o=i[2];else{if(!r[1]||!r[2])return!0;a=2,s=i[1],o=i[2]}2===a&&-1===s.stemDirection&&1===o.stemDirection&&(s=i[1],o=i[0]);const h=Math.max(s.voiceShift,o.voiceShift);let c=0;if(2===a){const t=s.note.hasStem()&&o.note.hasStem()&&s.stemDirection===o.stemDirection?0:.5;if(o.isrest&&s.isrest&&s.note.duration===o.note.duration)o.note.renderOptions.draw=!1;else if(s.minLine<=o.maxLine+t)if(s.isrest)Te(s,o,1);else if(o.isrest)Te(o,s,-1);else{const t=Math.abs(s.line-o.line);if(s.note.hasStem()&&o.note.hasStem()){const e=s.note.sortedKeyProps[0].keyProps.code,i=o.note.sortedKeyProps[o.note.sortedKeyProps.length-1].keyProps.code;!K.UNISON||e!==i||s.note.getModifiers().filter(t=>"Dot"===t.getCategory()&&0===t.getIndex()).length!==o.note.getModifiers().filter(t=>"Dot"===t.getCategory()&&0===t.getIndex()).length||t<1&&t>0||JSON.stringify(s.note.getStyle())!==JSON.stringify(o.note.getStyle())?(c=h+2,s.stemDirection===o.stemDirection?s.note.setXShift(c):o.note.setXShift(c)):s.note.voice!==o.note.voice&&s.stemDirection===o.stemDirection&&(s.line!==o.line?(c=h+2,s.note.setXShift(c)):1===o.stemDirection&&(o.stemDirection=-1,o.note.setStemDirection(-1)))}else t<1?(c=h+2,s.note.duration<o.note.duration?s.note.setXShift(c):o.note.setXShift(c)):s.note.hasStem()?(s.stemDirection=-s.note.getStemDirection(),s.note.setStemDirection(s.stemDirection)):o.note.hasStem()&&(o.stemDirection=-o.note.getStemDirection(),o.note.setStemDirection(o.stemDirection))}return e.rightShift+=c,!0}if(!n)throw new p("InvalidState","noteM not defined.");if(n.isrest&&!s.isrest&&!o.isrest&&(s.minLine<=n.maxLine||n.minLine<=o.maxLine)){return n.maxLine-n.minLine<s.minLine-o.maxLine?function(t,e,i){const s=t.line-T(e.minLine,i.maxLine);t.note.setKeyLine(0,t.note.getKeyLine(0)-s),t.line-=s,t.maxLine-=s,t.minLine-=s}(n,s,o):(c=h+2,n.note.setXShift(c),!1===o.note.hasBeam()&&(o.stemDirection=-1,o.note.setStemDirection(-1)),s.minLine<=o.maxLine&&!1===s.note.hasBeam()&&(s.stemDirection=1,s.note.setStemDirection(1))),e.rightShift+=c,!0}return s.isrest&&n.isrest&&o.isrest?(s.note.renderOptions.draw=!1,o.note.renderOptions.draw=!1,e.rightShift+=c,!0):(n.isrest&&s.isrest&&n.minLine<=o.maxLine&&(n.note.renderOptions.draw=!1),n.isrest&&o.isrest&&s.minLine<=n.maxLine&&(n.note.renderOptions.draw=!1),s.isrest&&s.minLine<=n.maxLine&&Te(s,n,1),o.isrest&&n.minLine<=o.maxLine&&Te(o,n,-1),(s.minLine<=n.maxLine+.5||n.minLine<=o.maxLine)&&(c=h+2,n.note.setXShift(c),!1===o.note.hasBeam()&&(o.stemDirection=-1,o.note.setStemDirection(-1)),s.minLine<=o.maxLine&&!1===s.note.hasBeam()&&(s.stemDirection=1,s.note.setStemDirection(1))),e.rightShift+=c,!0)}static postFormat(t){return!!t&&(t.forEach(t=>t.postFormat()),!0)}constructor(t){var e,i,s;super(t),this.minLine=0,this.maxLine=0,this.sortedKeyProps=[],this.ledgerLineStyle={},this.clef=null!==(e=t.clef)&&void 0!==e?e:"treble",this.octaveShift=null!==(i=t.octaveShift)&&void 0!==i?i:0,this.glyphProps=yt.getGlyphProps(this.duration,this.noteType),f(this.glyphProps,"BadArguments",`No glyph found for duration '${this.duration}' and type '${this.noteType}'`),this.displaced=!1,this.dotShiftY=0,this.useDefaultHeadX=!1,this._noteHeads=[],this.modifiers=[],this.renderOptions=Object.assign(Object.assign({},this.renderOptions),{strokePx:t.strokePx||xe.LEDGER_LINE_OFFSET}),this.calculateKeyProps(),this.buildStem(),t.autoStem?this.autoStem():this.setStemDirection(null!==(s=t.stemDirection)&&void 0!==s?s:at.UP)}reset(){super.reset();const t=this._noteHeads.map(t=>t.getStyle());this.buildNoteHeads(),this._noteHeads.forEach((e,i)=>{const s=t[i];s&&e.setStyle(s)});const e=this.stave;return e&&this.setStave(e),this.calcNoteDisplacements(),this}setBeam(t){return this.beam=t,this.calcNoteDisplacements(),this.stem&&this.stem.setExtension(this.getStemExtension()),this}buildStem(){return this.setStem(new at({hide:this.isRest()})),this}buildNoteHeads(){const t=new Set(this._noteHeads);this.children=this.children.filter(e=>!t.has(e)),this._noteHeads=[];const e=this.getStemDirection(),i=this.getKeys();let s,n,o,a,r,h=!1;e===at.UP?(o=0,a=i.length,r=1):(o=i.length-1,a=-1,r=-1);for(let t=o;t!==a;t+=r){const i=this.sortedKeyProps[t].keyProps,o=i.line;void 0===s?s=o:(n=Math.abs(s-o),0===n||.5===n?h=!h:(h=!1,this.useDefaultHeadX=!0)),s=o;const a=new me({duration:this.duration,noteType:this.noteType,displaced:h,stemDirection:e,customGlyphCode:i.code,line:i.line});a.fontInfo=this.fontInfo,this.addChild(a),this._noteHeads[this.sortedKeyProps[t].index]=a}return this._noteHeads}autoStem(){this.setStemDirection(this.calculateOptimalStemDirection())}calculateOptimalStemDirection(){this.minLine=this.sortedKeyProps[0].keyProps.line,this.maxLine=this.sortedKeyProps[this.keyProps.length-1].keyProps.line;return(this.minLine+this.maxLine)/2<3?at.UP:at.DOWN}calculateKeyProps(){var t;let e;for(let i=0;i<this.keys.length;++i){const s=this.keys[i],n={octaveShift:null!==(t=this.octaveShift)&&void 0!==t?t:0,duration:this.duration},o=K.keyProperties(s,this.clef,this.noteType,n);if(!o)throw new p("BadArguments",`Invalid key for note properties: ${s}`);"R"===o.key&&("1"===this.duration||"w"===this.duration?o.line=4:o.line=3);const a=o.line;void 0===e?e=a:Math.abs(e-a)<1&&(this.displaced=!0,o.displaced=!0,this.keyProps.length>0&&(this.keyProps[i-1].displaced=!0)),e=a,this.keyProps.push(o)}this.keyProps.forEach((t,e)=>{this.sortedKeyProps.push({keyProps:t,index:e})}),this.sortedKeyProps.sort((t,e)=>t.keyProps.line-e.keyProps.line)}getBoundingBox(){const t=new D(this.getAbsoluteX(),this.ys[0],0,0);this._noteHeads.forEach(e=>{const i=e.isDisplaced()?(e.getWidth()-at.WIDTH/2)*this.getStemDirection():0,s=e.getBoundingBox();s.setX(this.getNoteHeadBeginX()+i+e.getXShift()),t.mergeWith(s)});const{yTop:e,yBottom:i}=this.getNoteHeadBounds();if(!this.isRest()&&this.hasStem()){const s=this.stem.getHeight(),n=this.getStemDirection()===at.DOWN?e-s-this.flag.getTextMetrics().actualBoundingBoxDescent:i-s+this.flag.getTextMetrics().actualBoundingBoxAscent;t.mergeWith(new D(this.getAbsoluteX(),n,0,0))}if(this.shouldDrawFlag()){const{x:e,y:i}=this.getFlagPosition(),s=this.flag.getBoundingBox();s.setX(e+this.flag.getXShift()),s.setY(i+this.flag.getYShift()-this.flag.getTextMetrics().actualBoundingBoxAscent),t.mergeWith(s)}for(let e=0;e<this.modifiers.length;e++)t.mergeWith(this.modifiers[e].getBoundingBox());return t}getLineNumber(t){if(!this.keyProps.length)throw new p("NoKeyProps","Can't get bottom note line, because note is not initialized properly.");let e=this.keyProps[0].line;for(let i=0;i<this.keyProps.length;i++){const s=this.keyProps[i].line;t?s>e&&(e=s):s<e&&(e=s)}return e}isRest(){const t=this.glyphProps.codeHead;return t>=""&&t<=""}isChord(){return!this.isRest()&&this.keys.length>1}hasStem(){return this.glyphProps.stem}hasFlag(){return super.hasFlag()&&!this.isRest()}getStemX(){return"r"===this.noteType?this.getCenterGlyphX():super.getStemX()+(this.stemDirection?at.WIDTH/(2*-this.stemDirection):0)}getYForTopText(t){const e=this.getStemExtents();return Math.min(this.checkStave().getYForTopText(t),e.topY-this.renderOptions.annotationSpacing*(t+1))}getYForBottomText(t){const e=this.getStemExtents();return Math.max(this.checkStave().getYForTopText(t),e.baseY+this.renderOptions.annotationSpacing*t)}setStave(t){super.setStave(t);const e=this._noteHeads.map(e=>(e.setStave(t),e.getY()));if(this.setYs(e),this.stem){const{yTop:t,yBottom:e}=this.getStemYBounds();this.stem.setYBounds(t,e)}return this}isDisplaced(){return this.displaced}setNoteDisplaced(t){return this.displaced=t,this}getTieRightX(){let t=this.getAbsoluteX();return t+=this.getGlyphWidth()+this.xShift+this.rightDisplacedHeadPx,this.modifierContext&&(t+=this.modifierContext.getRightShiftForTie()),t}getTieLeftX(){let t=this.getAbsoluteX();return t+=this.xShift-this.leftDisplacedHeadPx,t}getLineForRest(){let t=this.keyProps[0].line;if(this.keyProps.length>1){const e=this.keyProps[this.keyProps.length-1].line;t=T(Math.max(t,e),Math.min(t,e))}return t}getModifierStartXY(t,e,i={}){if(!this.preFormatted)throw new p("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(0===this.ys.length)throw new p("NoYValues","No Y-Values calculated for this note.");const{ABOVE:s,BELOW:n,LEFT:o,RIGHT:a}=W.Position;let r=0;t===o?r=-2:t===a?(r=this.getGlyphWidth()+this.xShift+2,this.stemDirection===at.UP&&this.hasFlag()&&(i.forceFlagRight||((t,e)=>e===(t.getStemDirection()===at.UP?t.keyProps.length-1:0))(this,e))&&(r+=this.flag.getWidth())):t!==n&&t!==s||(r=this.getGlyphWidth()/2);let h=0;switch(this._noteHeads[e].getText()){case I.restWhole:h+=.5;break;case I.restHalf:case I.restQuarter:case I.rest8th:case I.rest16th:h-=.5;break;case I.rest32nd:case I.rest64th:h-=1.5;break;case I.rest128th:case I.rest256th:h-=2.5;break;case I.rest512th:h-=3.5;break;case I.rest1024th:h-=4.5}return{x:this.getAbsoluteX()+r,y:this.ys[e]+h*this.checkStave().getSpacingBetweenLines()}}setStyle(t){return super.setGroupStyle(t)}setStemStyle(t){const e=this.getStem();return e&&e.setStyle(t),this}getStemStyle(){var t;return null===(t=this.stem)||void 0===t?void 0:t.getStyle()}setLedgerLineStyle(t){this.ledgerLineStyle=t}getLedgerLineStyle(){return this.ledgerLineStyle}setFlagStyle(t){this.flag.setStyle(t)}getFlagStyle(){return this.flag.getStyle()}getGlyphWidth(){return this.noteHeads[0].getWidth()}setKeyStyle(t,e){return this._noteHeads[t].setStyle(e),this}setKeyLine(t,e){return this.keyProps[t].line=e,this.reset(),this}getKeyLine(t){return this.keyProps[t].line}getVoiceShiftWidth(){return this.getGlyphWidth()*(this.displaced?2:1)}calcNoteDisplacements(){this.setLeftDisplacedHeadPx(this.displaced&&this.stemDirection===at.DOWN?this.getGlyphWidth():0),this.setRightDisplacedHeadPx(!this.hasFlag()&&this.displaced&&this.stemDirection===at.UP?this.getGlyphWidth():0)}preFormat(){if(this.preFormatted)return;let t=0;this.modifierContext&&(this.modifierContext.preFormat(),0===this.modifierContext.getWidth()&&(t=xe.minNoteheadPadding));let e=this.getGlyphWidth()+this.leftDisplacedHeadPx+this.rightDisplacedHeadPx+t;this.shouldDrawFlag()&&this.stemDirection===at.UP&&(e+=this.getGlyphWidth()),this.setWidth(e),this.preFormatted=!0}getStemYBounds(){const t=this.stemDirection===at.UP?"up":"down";let e=1/0,i=-1/0;if(this._noteHeads.forEach(s=>{const n=K.noteHeadStemYOffsets[s.text],o=n?n[t]:0,a=s.getY()-o*K.STAVE_LINE_DISTANCE;e=Math.min(a,e),i=Math.max(a,i)}),!isFinite(e)||!isFinite(i)){const t=this.getNoteHeadBounds();return{yTop:t.yTop,yBottom:t.yBottom}}return{yTop:e,yBottom:i}}getNoteHeadBounds(){let t,e,i,s,n=1/0,o=-1/0,a=this.checkStave().getNumLines(),r=1,h=a,c=r;return this._noteHeads.forEach(l=>{const d=l.getLine(),u=l.getY();n=Math.min(u,n),o=Math.max(u,o),void 0===e&&l.isDisplaced()&&(e=l.getAbsoluteX()),void 0!==t||l.isDisplaced()||(t=l.getAbsoluteX()),a=Math.max(d,a),r=Math.min(d,r),l.isDisplaced()?(i=void 0===i?d:Math.max(d,i),s=void 0===s?d:Math.min(d,s)):(h=Math.max(d,h),c=Math.min(d,c))},this),{yTop:n,yBottom:o,displacedX:e,nonDisplacedX:t,highestLine:a,lowestLine:r,highestDisplacedLine:i,lowestDisplacedLine:s,highestNonDisplacedLine:h,lowestNonDisplacedLine:c}}getNoteHeadBeginX(){return this.getAbsoluteX()+this.xShift}getNoteHeadEndX(){return this.getNoteHeadBeginX()+this.getGlyphWidth()}get noteHeads(){return this._noteHeads.slice()}drawLedgerLines(){const t=this.checkStave(),{renderOptions:{strokePx:e}}=this,i=this.checkContext(),s=this.getGlyphWidth()+2*e,n=2*(this.getGlyphWidth()+e)-at.WIDTH/2;if(this.isRest())return;if(!i)throw new p("NoCanvasContext","Can't draw without a canvas context.");const{highestLine:o,lowestLine:a,highestDisplacedLine:r,highestNonDisplacedLine:h,lowestDisplacedLine:c,lowestNonDisplacedLine:l,displacedX:d,nonDisplacedX:u}=this.getNoteHeadBounds();if(o<6&&a>0)return;const g=Math.min(null!=d?d:0,null!=u?u:0),m=(t,o,a)=>{let r;r=a&&o?g-e:o?(null!=u?u:0)-e:(null!=d?d:0)-e;const h=o&&a?n:s;i.beginPath(),i.moveTo(r,t),i.lineTo(r+h,t),i.stroke()},f=Object.assign(Object.assign({},t.getDefaultLedgerLineStyle()),this.getLedgerLineStyle());i.save(),this.applyStyle(i,f);for(let e=6;e<=o;++e){const i=void 0!==u&&e<=h,s=void 0!==r&&e<=r;m(t.getYForNote(e),i,s)}for(let e=0;e>=a;--e){const i=void 0!==u&&e>=l,s=void 0!==c&&e>=c;m(t.getYForNote(e),i,s)}i.restore()}drawModifiers(t){const e=this.checkContext();for(let i=0;i<this.modifiers.length;i++){const s=this.modifiers[i],n=s.checkIndex();this._noteHeads[n]===t&&(s.setContext(e),s.drawWithStyle())}}shouldDrawFlag(){const t=void 0!==this.stem,e=void 0!==this.glyphProps.codeFlagUp,i=void 0===this.beam;return t&&e&&i&&!this.isRest()}getFlagPosition(){const{yTop:t,yBottom:e}=this.getNoteHeadBounds(),i=this.checkStem().getHeight();return{x:this.getStemX()-K.STEM_WIDTH/2,y:this.getStemDirection()===at.DOWN?t-i-this.flag.getTextMetrics().actualBoundingBoxDescent:e-i+this.flag.getTextMetrics().actualBoundingBoxAscent}}drawFlag(){const t=this.checkContext();if(!t)throw new p("NoCanvasContext","Can't draw without a canvas context.");if(this.shouldDrawFlag()){const{x:e,y:i}=this.getFlagPosition();this.flag.setContext(t).setX(e).setY(i).drawWithStyle()}}drawNoteHeads(){const t=this.checkContext();this._noteHeads.forEach(e=>{e.setContext(t).drawWithStyle()})}drawStem(t){const e=this.checkContext();t&&this.setStem(new at(t)),this.shouldDrawFlag()&&this.stem&&this.stem.adjustHeightForFlag(),this.stem&&this.stem.setContext(e).drawWithStyle()}getStemExtension(){const t=super.getStemExtension();if(!this.glyphProps.stem)return t;const e=this.getStemDirection();if(e!==this.calculateOptimalStemDirection())return t;let i;i=e===at.UP?3-this.maxLine:this.minLine-3;const s=i-3.5;if(s<=0)return t;const n=this.getStave();let o=10;return void 0!==n&&(o=n.getSpacingBetweenLines()),t+s*o}draw(){if(!1===this.renderOptions.draw)return;if(0===this.ys.length)throw new p("NoYValues","Can't draw note without Y values.");const t=this.checkContext(),e=this.getNoteHeadBeginX(),i=this.hasStem()&&!this.beam;if(this._noteHeads.forEach(t=>t.setX(e)),this.stem){const t=this.getStemX();this.stem.setNoteHeadXBounds(t,t)}!function(...t){xe.DEBUG&&S("VexFlow.StaveNote",t)}("Rendering ",this.isChord()?"chord :":"note :",this.keys);const s=this.getAttribute("class");t.openGroup("stavenote"+(s?" "+s:""),this.getAttribute("id")),this.drawLedgerLines(),i&&this.drawStem(),this.drawNoteHeads(),this.drawFlag(),this.drawPointerRect(),t.closeGroup(),this.setRendered()}}xe.DEBUG=!1;class we extends P{static get CATEGORY(){return"StaveTie"}constructor(t,e=""){super(),this.setNotes(t),this.text=e,this.renderOptions={cp1:8,cp2:12,shortTieCutoff:10,cp1Short:2,cp2Short:8,textShiftX:0,firstXShift:0,lastXShift:0,yShift:7,tieSpacing:0}}getDirection(){return void 0!==this.direction&&null!==this.direction?this.direction:this.notes.lastNote?this.notes.lastNote.getStemDirection():this.notes.firstNote?this.notes.firstNote.getStemDirection():0}setDirection(t){return this.direction=t,this}setNotes(t){if(!t.firstNote&&!t.lastNote)throw new p("BadArguments","Tie needs to have either firstNote or lastNote set.");if(t.firstIndexes||(t.firstIndexes=[0]),t.lastIndexes||(t.lastIndexes=[0]),t.firstIndexes.length!==t.lastIndexes.length)throw new p("BadArguments","Tied notes must have same number of indexes.");return this.notes=t,this}isPartial(){return!this.notes.firstNote||!this.notes.lastNote}renderTie(t){if(0===t.firstYs.length||0===t.lastYs.length)throw new p("BadArguments","No Y-values to render");const e=this.checkContext();let i=this.renderOptions.cp1,s=this.renderOptions.cp2;Math.abs(t.lastX-t.firstX)<this.renderOptions.shortTieCutoff&&(i=this.renderOptions.cp1Short,s=this.renderOptions.cp2Short);const n=this.renderOptions.firstXShift,o=this.renderOptions.lastXShift,a=this.renderOptions.yShift*t.direction,r=this.notes.firstIndexes,h=this.notes.lastIndexes,c=this.getAttribute("class");e.openGroup("stavetie"+(c?" "+c:""),this.getAttribute("id"));for(let c=0;c<r.length;++c){const l=(t.lastX+o+(t.firstX+n))/2,d=t.firstYs[r[c]]+a,u=t.lastYs[h[c]]+a;if(isNaN(d)||isNaN(u))throw new p("BadArguments","Bad indexes for tie rendering.");const g=(d+u)/2+i*t.direction,m=(d+u)/2+s*t.direction;e.beginPath(),e.moveTo(t.firstX+n,d),e.quadraticCurveTo(l,g,t.lastX+o,u),e.quadraticCurveTo(l,m,t.firstX+n,d),e.closePath(),e.fill()}this.drawPointerRect(),e.closeGroup()}renderTieText(t,e){var i,s,n;const o=this.checkContext();let a=(t+e)/2;a-=o.measureText(this.text).width/2;const r=null!==(s=null===(i=this.notes.firstNote)||void 0===i?void 0:i.checkStave())&&void 0!==s?s:null===(n=this.notes.lastNote)||void 0===n?void 0:n.checkStave();r&&(o.setFont(this.fontInfo),o.fillText(this.text,a+this.renderOptions.textShiftX,r.getYForTopText()-1))}getNotes(){return this.notes}getFirstX(){return this.notes.firstNote?this.notes.firstNote.getTieRightX()+this.renderOptions.tieSpacing:this.notes.lastNote?this.notes.lastNote.checkStave().getTieStartX():0}getLastX(){return this.notes.lastNote?this.notes.lastNote.getTieLeftX()+this.renderOptions.tieSpacing:this.notes.firstNote?this.notes.firstNote.checkStave().getTieEndX():0}getFirstYs(){return this.notes.firstNote?this.notes.firstNote.getYs():this.notes.lastNote?this.notes.lastNote.getYs():[0]}getLastYs(){return this.notes.lastNote?this.notes.lastNote.getYs():this.notes.firstNote?this.notes.firstNote.getYs():[0]}synchronizeIndexes(){this.notes.firstNote&&this.notes.lastNote||(this.notes.firstNote||this.notes.lastNote)&&(this.notes.firstNote?this.notes.lastIndexes=this.notes.firstIndexes:this.notes.firstIndexes=this.notes.lastIndexes)}draw(){this.checkContext(),this.setRendered(),this.synchronizeIndexes();const t=this.getFirstX(),e=this.getLastX();return this.renderTie({firstX:t,lastX:e,firstYs:this.getFirstYs(),lastYs:this.getLastYs(),direction:this.getDirection()}),this.renderTieText(t,e),!0}}class be extends we{static get CATEGORY(){return"TabTie"}static createHammeron(t){return new be(t,"H")}static createPulloff(t){return new be(t,"P")}constructor(t,e){super(t,e),this.renderOptions.cp1=9,this.renderOptions.cp2=11,this.renderOptions.yShift=3,this.direction=-1}}var ye;!function(t){t[t.STRICT=1]="STRICT",t[t.SOFT=2]="SOFT",t[t.FULL=3]="FULL"}(ye||(ye={}));class ke extends P{static get CATEGORY(){return"Voice"}static get Mode(){return ye}constructor(t){let e;if(super(),this.resolutionMultiplier=1,this.mode=ye.STRICT,this.preFormatted=!1,this.ticksDirty=!1,this.ticksUsed=new y(0,1),this.largestTickWidth=0,this.tickables=[],this.options={softmaxFactor:K.SOFTMAX_FACTOR},"string"==typeof t){const i=t.length<=64?/^(\d+)\/(\d+)$/.exec(t):null;if(!i)throw new p("BadArgument","Invalid time signature. Expected positive integers such as 4/4.");e={numBeats:Number(i[1]),beatValue:Number(i[2])}}else e=t;this.time=Object.assign({numBeats:4,beatValue:4,resolution:K.RESOLUTION},e);const{numBeats:i,beatValue:s,resolution:n}=this.time;if(![i,s,n].every(t=>Number.isSafeInteger(t)&&t>0))throw new p("BadArgument","Meter and resolution must be positive safe integers.");const o=i*(n/s);if(!Number.isFinite(o)||o<=0||o>Number.MAX_SAFE_INTEGER)throw new p("BadArgument","Meter exceeds the supported tick range.");this.totalTicks=new y(o,1),this.smallestTickCount=this.totalTicks.clone()}getTotalTicks(){return this.refreshTicks(),this.totalTicks}getTicksUsed(){return this.refreshTicks(),this.ticksUsed}getLargestTickWidth(){return this.largestTickWidth}getSmallestTickCount(){return this.refreshTicks(),this.smallestTickCount}getTickables(){return this.tickables}getMode(){return this.mode}setMode(t){return this.mode=t,this}getResolutionMultiplier(){return this.refreshTicks(),this.resolutionMultiplier}getActualResolution(){return this.getResolutionMultiplier()*this.time.resolution}setStave(t){return this.stave=t,this}getStave(){return this.stave}getBoundingBox(){const t=this.tickables[0].getBoundingBox();for(let e=1;e<this.tickables.length;++e){const i=this.tickables[e];!i.getStave()&&this.stave&&i.setStave(this.stave);const s=i.getBoundingBox();t.mergeWith(s)}return t}setStrict(t){return this.mode=t?ye.STRICT:ye.SOFT,this}isComplete(){return this.refreshTicks(),this.mode!==ye.STRICT&&this.mode!==ye.FULL||this.ticksUsed.equals(this.totalTicks)}setSoftmaxFactor(t){return this.options.softmaxFactor=t,this.expTicksUsed=0,this}reCalculateExpTicksUsed(){const t=this.ticksUsed.value();return this.expTicksUsed=b(this.tickables.map(e=>Math.pow(this.options.softmaxFactor,e.getTicks().value()/t))),this.expTicksUsed}softmax(t){this.refreshTicks(),this.expTicksUsed||(this.expTicksUsed=this.reCalculateExpTicksUsed());const e=this.ticksUsed.value();return(t=>Math.pow(this.options.softmaxFactor,t/e))(t)/this.expTicksUsed}invalidateTicks(){this.ticksDirty=!0,this.expTicksUsed=void 0}refreshTicks(){if(this.ticksDirty){this.ticksUsed.set(0,1),this.totalTicks.set(this.time.numBeats*(this.time.resolution/this.time.beatValue),1),this.smallestTickCount=this.totalTicks.clone();for(const t of this.tickables){if(t.shouldIgnoreTicks())continue;const e=t.getTicks();this.ticksUsed.add(e),e.lessThan(this.smallestTickCount)&&(this.smallestTickCount=e.clone())}this.resolutionMultiplier=this.ticksUsed.denominator,this.totalTicks.add(0,this.resolutionMultiplier),this.ticksDirty=!1}}addTickable(t){if(this.refreshTicks(),!t.shouldIgnoreTicks()){const e=t.getTicks();if(this.ticksUsed.add(e),this.expTicksUsed=0,(this.mode===ye.STRICT||this.mode===ye.FULL)&&this.ticksUsed.greaterThan(this.totalTicks))throw this.ticksUsed.subtract(e),new p("BadArgument","Too many ticks.");e.lessThan(this.smallestTickCount)&&(this.smallestTickCount=e.clone()),this.resolutionMultiplier=this.ticksUsed.denominator,this.totalTicks.add(0,this.ticksUsed.denominator)}return this.tickables.push(t),t.setVoice(this),this}addTickables(t){for(let e=0;e<t.length;++e)this.addTickable(t[e]);return this}preFormat(){if(this.preFormatted)return this;const t=this.checkStave();return this.tickables.forEach(e=>{e.getStave()||e.setStave(t)}),this.preFormatted=!0,this}checkStave(){return f(this.stave,"NoStave","No stave attached to instance.")}draw(t=this.checkContext(),e){e=null!=e?e:this.stave,this.setRendered();for(let i=0;i<this.tickables.length;++i){const s=this.tickables[i];e&&s.setStave(e),f(s.getStave(),"MissingStave","The voice cannot draw tickables without staves."),s.setContext(t),s.drawWithStyle()}}}class ve extends W{static get CATEGORY(){return"GraceNoteGroup"}static format(t,e){if(!t||0===t.length)return!1;const i=[];let s=null,n=0;for(let e=0;e<t.length;++e){const o=t[e],a=o.getNote(),r=et(a),h=r?4:0;if(r&&a!==s){for(let t=0;t<a.keys.length;++t)n=Math.max(a.getLeftDisplacedHeadPx(),n);s=a}i.push({shift:n,gracenoteGroup:o,spacing:h})}let o,a=i[0].shift,r=!1,h=!1;for(let t=0;t<i.length;++t){const e=i[t].gracenoteGroup;e.position===W.Position.RIGHT?r=!0:h=!0,e.preFormat(),o=e.getWidth()+i[t].spacing,a=Math.max(o,a)}for(let t=0;t<i.length;++t){const e=i[t].gracenoteGroup;o=e.getWidth()+i[t].spacing,e.setSpacingFromNextModifier(a-Math.min(o,a)+xe.minNoteheadPadding)}return r&&(e.rightShift+=a),h&&(e.leftShift+=a),!0}constructor(t,e){return super(),this.preFormatted=!1,this.position=W.Position.LEFT,this.graceNotes=t,this.width=0,this.showSlur=e,this.slur=void 0,this.voice=new ke({numBeats:4,beatValue:4,resolution:K.RESOLUTION}).setStrict(!1),this.renderOptions={slurYShift:0},this.beams=[],this.voice.addTickables(this.graceNotes),this}preFormat(){this.preFormatted||(this.formatter||(this.formatter=new ni),this.formatter.joinVoices([this.voice]).format([this.voice],0,{}),this.setWidth(this.formatter.getMinTotalWidth()),this.preFormatted=!0)}beamNotes(t){if((t=t||this.graceNotes).length>1){const e=new At(t);e.renderOptions.beamWidth=3,e.renderOptions.partialBeamLength=4,this.beams.push(e)}return this}setWidth(t){return this.width=t,this}getWidth(){return this.width+xe.minNoteheadPadding}getGraceNotes(){return this.graceNotes}positionGraceNotes(){const t=this.checkAttachedNote();t.checkStave(),this.preFormat(),this.alignSubNotesWithNote(this.getGraceNotes(),t,this.position),this.beams.forEach(t=>t.postFormat())}getBoundingBox(){if(0===this.graceNotes.length)return super.getBoundingBox();this.positionGraceNotes();const t=this.graceNotes[0].getBoundingBox();for(let e=1;e<this.graceNotes.length;e++)t.mergeWith(this.graceNotes[e].getBoundingBox());return t}draw(){const t=this.checkContext(),e=this.checkAttachedNote();if(this.setRendered(),function(...t){ve.DEBUG&&S("VexFlow.GraceNoteGroup",t)}("Drawing grace note group for:",e),this.positionGraceNotes(),this.graceNotes.forEach(e=>e.setContext(t).drawWithStyle()),this.beams.forEach(e=>e.setContext(t).drawWithStyle()),this.showSlur){const i=et(e),s=i?we:be;this.slur=new s({lastNote:this.graceNotes[0],firstNote:e,firstIndexes:[0],lastIndexes:[0]}),this.slur.renderOptions.cp2=12,this.slur.renderOptions.yShift=(i?7:5)+this.renderOptions.slurYShift,this.slur.setContext(t).drawWithStyle()}}}ve.DEBUG=!1;class Be extends W{static get CATEGORY(){return"NoteSubGroup"}static format(t,e){if(!t||0===t.length)return!1;let i=0;for(let e=0;e<t.length;++e){const s=t[e];s.preFormat(),i+=s.getWidth()}return e.leftShift+=i,!0}constructor(t){super(),this.preFormatted=!1,this.position=W.Position.LEFT,this.subNotes=t,this.subNotes.forEach(t=>{t.setIgnoreTicks(!1)}),this.width=0,this.formatter=new ni,this.voice=new ke({numBeats:4,beatValue:4,resolution:K.RESOLUTION}).setStrict(!1),this.voice.addTickables(this.subNotes)}preFormat(){this.preFormatted||(this.formatter.joinVoices([this.voice]).format([this.voice],0),this.setWidth(this.formatter.getMinTotalWidth()),this.preFormatted=!0)}setWidth(t){return this.width=t,this}getWidth(){return this.width}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered(),this.alignSubNotesWithNote(this.subNotes,e),this.subNotes.forEach(e=>e.setContext(t).drawWithStyle())}}class Ce extends W{static get CATEGORY(){return"Ornament"}static get minPadding(){return B.get("NoteHead.minPadding")}static format(t,e){var i,s;if(!t||0===t.length)return!1;let n=0,o=e.rightShift,a=e.leftShift;for(let r=0;r<t.length;++r){const h=t[r],c=2;if(h.position===M.RIGHT)h.xShift+=o+2,o+=h.width+Ce.minPadding;else if(h.position===M.LEFT)h.xShift-=a+h.width+2,a+=h.width+Ce.minPadding;else if(h.position===M.ABOVE){n=Math.max(h.getWidth(),n);const t=h.getNote();let o=t.getLineNumber(!0)+e.topTextLine;const a=t.getStem();a&&t.getStemDirection()===at.UP&&(o+=Math.abs(a.getHeight())/K.STAVE_LINE_DISTANCE);const r=null!==(s=null===(i=t.getStave())||void 0===i?void 0:i.getNumLines())&&void 0!==s?s:0;o<r&&(e.topTextLine+=r-o),h.setTextLine(e.topTextLine),e.topTextLine+=c}else n=Math.max(h.getWidth(),n),h.setTextLine(e.textLine),e.textLine+=c}return e.leftShift=a+n/2,e.rightShift=o+n/2,!0}static get ornamentNoteTransition(){return["flip","jazzTurn","smear"]}static get ornamentAttack(){return["scoop"]}static get ornamentAlignWithNoteHead(){return["doit","fall","fallLong","doitLong","scoop"]}static get ornamentRelease(){return["doit","fall","fallLong","doitLong","jazzTurn","smear","flip"]}static get ornamentLeft(){return["scoop"]}static get ornamentRight(){return["doit","fall","fallLong","doitLong"]}static get ornamentYShift(){return["fallLong"]}static get ornamentArticulation(){return["bend","plungerClosed","plungerOpen"]}constructor(t){super(),this.position=M.ABOVE,Ce.ornamentRight.indexOf(t)>=0&&(this.position=M.RIGHT),Ce.ornamentLeft.indexOf(t)>=0&&(this.position=M.LEFT),this.type=t,this.delayed=!1,this.renderOptions={accidentalLowerPadding:3,accidentalUpperPadding:3},this.adjustForStemDirection=!1,this.ornamentAlignWithNoteHead=Ce.ornamentAlignWithNoteHead.indexOf(this.type)>=0,Ce.ornamentNoteTransition.indexOf(this.type)>=0&&(this.delayed=!0),this.text=K.ornamentCodes(this.type)}setNote(t){return super.setNote(t),Ce.ornamentArticulation.indexOf(this.type)>=0&&(t.getLineNumber()>=3?this.position=W.Position.ABOVE:this.position=W.Position.BELOW),this}setDelayed(t){return this.delayed=t,this}setUpperAccidental(t){return this.accidentalUpper=new P,this.accidentalUpper.setText(K.accidentalCodes(t)),this}setLowerAccidental(t){return this.accidentalLower=new P,this.accidentalLower.setText(K.accidentalCodes(t)),this}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=e.checkStave(),s=this.getAttribute("class");t.openGroup("ornament"+(s?" "+s:""),this.getAttribute("id"));const n=e.getModifierStartXY(this.position,this.index);let o=n.x;const a=i.getSpacingBetweenLines(),r=Tt(e,this.position);let h=this.ornamentAlignWithNoteHead?n.y:0;if(this.position===M.ABOVE&&(h=ft(e,this.textLine)-(this.textLine+r)*a),this.position===M.BELOW&&(h=St(e,this.textLine)+(this.textLine+r+1.5)*a),this.delayed){let t=0;const s=e.getTickContext().getX();if(void 0!==this.delayXShift)t=this.delayXShift;else{const n=e.getVoice().getTickables(),a=n.indexOf(e),r=a+1<n.length?n[a+1].checkTickContext():void 0;t+=r?.5*(r.getX()-s):.5*(i.getX()+i.getWidth()-o),this.delayXShift=t}o+=t}!function(...t){Ce.DEBUG&&S("VexFlow.Ornament",t)}("Rendering ornament: ",this.text.charCodeAt(0),o,h),this.accidentalLower&&(this.accidentalLower.renderText(t,o+this.xShift-.5*this.accidentalLower.getWidth(),h+this.yShift-this.accidentalLower.getTextMetrics().actualBoundingBoxDescent),h-=this.accidentalLower.getHeight()+this.renderOptions.accidentalLowerPadding),Ce.ornamentYShift.indexOf(this.type)>=0&&(this.yShift+=this.getHeight()),this.x=o-(this.position===M.ABOVE||this.position===M.BELOW?.5*this.width:0),this.y=h,this.renderText(t,0,0),this.accidentalUpper&&(h-=this.getHeight()+this.renderOptions.accidentalUpperPadding,this.accidentalUpper.renderText(t,o+this.xShift-.5*this.accidentalUpper.getWidth(),h+this.yShift-this.accidentalUpper.getTextMetrics().actualBoundingBoxDescent)),this.drawPointerRect(),t.closeGroup()}}Ce.DEBUG=!1;class De extends W{static get CATEGORY(){return"Parenthesis"}static buildAndAttach(t){for(const e of t)for(let t=0;t<e.keys.length;t++)e.addModifier(new De(M.LEFT),t),e.addModifier(new De(M.RIGHT),t)}static format(t,e){if(!t||0===t.length)return!1;let i=0,s=0;for(let e=0;e<t.length;++e){const n=t[e],o=n.getNote(),a=n.getPosition(),r=n.checkIndex();let h=0;a===M.RIGHT&&(h=o.getRightParenthesisPx(r),s=s>h+n.width?s:h+n.width),a===M.LEFT&&(h=o.getLeftParenthesisPx(r)+n.width,i=i>h+n.width?i:h+n.width),n.setXShift(h)}return e.leftShift+=i,e.rightShift+=s,!0}constructor(t){super(),this.position=null!=t?t:W.Position.LEFT,this.position===W.Position.RIGHT?this.text="":this.position===W.Position.LEFT&&(this.text="")}setNote(t){return this.note=t,this.setFont(t.getFont()),this}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=e.getModifierStartXY(this.position,this.index,{forceFlagRight:!0});this.renderText(t,i.x,i.y)}}function Ee(t="normal"){return"normal"===t?"400":"bold"===t?"700":String(t)}function Le(t,e){let i=t;for(;i;){const t=i.getAttribute(e);if(null!==t)return t;i=i.parentElement}return null}function Ne(t,e){var i,s,n,o,a,r,h,c;const l=(null!==(i=Le(t,"font-family"))&&void 0!==i?i:"").split(",").map(t=>t.trim().replace(/^['"]|['"]$/g,"").toLowerCase()),d=Ee(null!==(s=Le(t,"font-weight"))&&void 0!==s?s:"normal"),u=null!==(n=Le(t,"font-style"))&&void 0!==n?n:"normal",g=l.map(t=>e.find(e=>{var i;return e.family.toLowerCase()===t&&Ee(e.weight)===d&&(null!==(i=e.style)&&void 0!==i?i:"normal")===u})),m=A.convertSizeToPixelValue(null!==(o=Le(t,"font-size"))&&void 0!==o?o:"10pt");let f=Number(null!==(a=t.getAttribute("x"))&&void 0!==a?a:0);const S=Number(null!==(r=t.getAttribute("y"))&&void 0!==r?r:0);let T,x="",w="";function b(){T&&w&&(x+=T.getPath(w,f,S,m).toPathData(5),f+=T.getAdvanceWidth(w,m),w="")}for(const e of null!==(h=t.textContent)&&void 0!==h?h:""){const t=null===(c=g.find(t=>t&&t.font.charToGlyphIndex(e)>0))||void 0===c?void 0:c.font;if(!t)throw new p("MissingFont",`No outline for ${JSON.stringify(e)} in ${l.join(", ")} (${d} ${u}).`);t!==T&&(b(),T=t),w+=e}return b(),x}const Fe={path:{x:!0,y:!0,width:!0,height:!0,"font-family":!0,"font-weight":!0,"font-style":!0,"font-size":!0},rect:{"font-family":!0,"font-weight":!0,"font-style":!0,"font-size":!0},text:{width:!0,height:!0}},Ae=2*Math.PI;class Oe extends wt{static toSVG(t,e){var i,s;const n=void 0===e?t:function(t,e){const i=t.cloneNode(!0);for(const t of Array.from(i.querySelectorAll("text"))){if(t.children.length)throw new p("BadArgument","Portable export expects plain SVGContext text.");const s=i.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");for(const e of Array.from(t.attributes))"x"===e.name||"y"===e.name||e.name.startsWith("font-")||s.setAttribute(e.name,e.value);s.setAttribute("d",Ne(t,e)),t.replaceWith(s)}return i}(t,e);return(new(null!==(s=null===(i=t.ownerDocument.defaultView)||void 0===i?void 0:i.XMLSerializer)&&void 0!==s?s:XMLSerializer)).serializeToString(n)}toSVG(t){return Oe.toSVG(this.svg,t)}constructor(t){super(),this.width=0,this.height=0,this.precision=1,this.backgroundFillStyle="white",this.fontCSSString="",this.element=t,this.precision=Math.pow(10,K.RENDER_PRECISION_PLACES);const e=this.create("svg");e.setAttribute("pointer-events","none"),this.element.appendChild(e),this.svg=e,this.parent=this.svg,this.groups=[this.svg],this.path="",this.pen={x:NaN,y:NaN};const i={"font-family":B.get("fontFamily"),"font-size":"10pt","font-weight":E.NORMAL,"font-style":L.NORMAL};this.state=Object.assign({scaleX:1,scaleY:1},i),this.attributes=Object.assign({"stroke-width":1,"stroke-dasharray":"none",fill:"black",stroke:"black",shadowBlur:0,shadowColor:"black"},i),this.groupAttributes=[],this.applyAttributes(e,this.attributes),this.groupAttributes.push(Object.assign({},this.attributes)),this.stateStack=[]}round(t){return Math.round(t*this.precision)/this.precision}create(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}openGroup(t,e){const i=this.create("g");return this.groups.push(i),this.parent.appendChild(i),this.parent=i,t&&i.setAttribute("class",x(t)),e&&i.setAttribute("id",x(e)),this.applyAttributes(i,this.attributes),this.groupAttributes.push(Object.assign(Object.assign({},this.groupAttributes[this.groupAttributes.length-1]),this.attributes)),i}closeGroup(){this.groups.pop(),this.groupAttributes.pop(),this.parent=this.groups[this.groups.length-1]}openRotation(t,e,i){this.openGroup().setAttribute("transform",`translate(${e},${i}) rotate(${t}) translate(-${e},-${i})`)}closeRotation(){this.closeGroup()}add(t){this.parent.appendChild(t)}setFillStyle(t){return this.attributes.fill=t,this}setBackgroundFillStyle(t){return this.backgroundFillStyle=t,this}setStrokeStyle(t){return this.attributes.stroke=t,this}setShadowColor(t){return this.attributes.shadowColor=t,this}setShadowBlur(t){return this.attributes.shadowBlur=t,this}setLineWidth(t){return this.attributes["stroke-width"]=t,this}setLineDash(t){if("[object Array]"===Object.prototype.toString.call(t))return this.attributes["stroke-dasharray"]=t.join(","),this;throw new p("ArgumentError","lineDash must be an array of integers.")}setLineCap(t){return this.attributes["stroke-linecap"]=t,this}resize(t,e){this.width=t,this.height=e,this.element.style.width=`${t}px`,this.svg.style.width=`${t}px`,this.svg.style.height=`${e}px`;const i={width:t,height:e};return this.applyAttributes(this.svg,i),this.scale(this.state.scaleX,this.state.scaleY),this}scale(t,e){this.state.scaleX=this.state.scaleX?this.state.scaleX*t:t,this.state.scaleY=this.state.scaleY?this.state.scaleY*e:e;const i=this.width/this.state.scaleX,s=this.height/this.state.scaleY;return this.setViewBox(0,0,i,s),this}setViewBox(t,e,i,s){if("string"==typeof t)this.svg.setAttribute("viewBox",t);else{const n=t+" "+e+" "+i+" "+s;this.svg.setAttribute("viewBox",n)}}applyAttributes(t,e){const i=Fe[t.nodeName];for(const s in e)i&&i[s]||!e[s]||0!==this.groupAttributes.length&&e[s]==this.groupAttributes[this.groupAttributes.length-1][s]||t.setAttributeNS(null,s,e[s]);return t}clear(){for(;this.svg.lastChild;)this.svg.removeChild(this.svg.lastChild)}rect(t,e,i,s,n){s<0&&(e+=s,s*=-1);const o=this.create("rect");return n=null!=n?n:{fill:"none","stroke-width":this.attributes["stroke-width"],stroke:"black"},t=this.round(t),e=this.round(e),i=this.round(i),s=this.round(s),this.applyAttributes(o,Object.assign({x:t,y:e,width:i,height:s},n)),this.add(o),this}fillRect(t,e,i,s){const n={fill:this.attributes.fill,stroke:"none"};return this.rect(t,e,i,s,n),this}pointerRect(t,e,i,s){return this.rect(t,e,i,s,{opacity:"0","pointer-events":"auto"}),this}clearRect(t,e,i,s){return this.rect(t,e,i,s,{fill:this.backgroundFillStyle,stroke:"none"}),this}beginPath(){return this.path="",this.pen.x=NaN,this.pen.y=NaN,this}moveTo(t,e){return t=this.round(t),e=this.round(e),this.path+="M"+t+" "+e,this.pen.x=t,this.pen.y=e,this}lineTo(t,e){return t=this.round(t),e=this.round(e),this.path+="L"+t+" "+e,this.pen.x=t,this.pen.y=e,this}bezierCurveTo(t,e,i,s,n,o){return n=this.round(n),o=this.round(o),t=this.round(t),e=this.round(e),i=this.round(i),s=this.round(s),this.path+="C"+t+" "+e+","+i+" "+s+","+n+" "+o,this.pen.x=n,this.pen.y=o,this}quadraticCurveTo(t,e,i,s){return i=this.round(i),s=this.round(s),t=this.round(t),e=this.round(e),this.path+="Q"+t+" "+e+","+i+" "+s,this.pen.x=i,this.pen.y=s,this}arc(t,e,i,s,n,o){let a=t+i*Math.cos(s),r=e+i*Math.sin(s);a=this.round(a),r=this.round(r);const h=w(s),c=w(n);if(!o&&n-s>=Ae||o&&s-n>=Ae||h===c){let n=t+i*Math.cos(s+Math.PI),o=e+i*Math.sin(s+Math.PI);n=this.round(n),o=this.round(o),i=this.round(i),this.path+=`M${a} ${r} A${i} ${i} 0 0 0 ${n} ${o} `,this.path+=`A${i} ${i} 0 0 0 ${a} ${r}`,this.pen.x=a,this.pen.y=r}else{let l,d=t+i*Math.cos(n),u=e+i*Math.sin(n);s=h,n=c,l=Math.abs(n-s)<Math.PI?o:!o,s>n&&(l=!l);const g=!o;d=this.round(d),u=this.round(u),i=this.round(i),this.path+=`M${a} ${r} A${i} ${i} 0 ${+l} ${+g} ${d} ${u}`,this.pen.x=d,this.pen.y=u}return this}closePath(){return this.path+="Z",this}getShadowStyle(){return`filter: drop-shadow(0 0 ${this.attributes.shadowBlur/1.5}px ${this.attributes.shadowColor})`}fill(t){const e=this.create("path");return void 0===t&&(t=Object.assign(Object.assign({},this.attributes),{stroke:"none"})),t.d=this.path,this.attributes.shadowBlur>0&&(t.style=this.getShadowStyle()),this.applyAttributes(e,t),this.add(e),this}stroke(){const t=this.create("path"),e=Object.assign(Object.assign({},this.attributes),{fill:"none",d:this.path});return this.attributes.shadowBlur>0&&(e.style=this.getShadowStyle()),this.applyAttributes(t,e),this.add(t),this}measureText(t){Oe.measureTextElement.setText(t),Oe.measureTextElement.setFont(this.attributes["font-family"],this.attributes["font-size"],this.attributes["font-weight"],this.attributes["font-style"]);const e=Oe.measureTextElement.getBoundingBox();return{x:e.x,y:e.y,width:e.w,height:e.h}}fillText(t,e,i){if(!t||t.length<=0)return this;e=this.round(e),i=this.round(i);const s=Object.assign(Object.assign({},this.attributes),{stroke:"none",x:e,y:i}),n=this.create("text");return n.textContent=t,this.applyAttributes(n,s),this.add(n),this}save(){return this.stateStack.push({state:g(this.state),attributes:g(this.attributes)}),this}restore(){const t=this.stateStack.pop();if(t){const e=t;this.state=g(e.state),this.attributes=g(e.attributes)}return this}set fillStyle(t){this.setFillStyle(t)}get fillStyle(){return this.attributes.fill}set strokeStyle(t){this.setStrokeStyle(t)}get strokeStyle(){return this.attributes.stroke}setFont(t,e,i,s){const n=A.validate(t,e,i,s);this.fontCSSString=A.toCSSString(n);const o={"font-family":n.family,"font-size":n.size,"font-weight":n.weight,"font-style":n.style};return this.attributes=Object.assign(Object.assign({},this.attributes),o),this.state=Object.assign(Object.assign({},this.state),o),this}getFont(){return this.fontCSSString}}var Re,Pe,Me,Ie;Oe.measureTextElement=new P,function(t){t[t.CANVAS=1]="CANVAS",t[t.SVG=2]="SVG"}(Re||(Re={})),function(t){t[t.NONE=1]="NONE",t[t.UP=2]="UP",t[t.DOWN=3]="DOWN"}(Pe||(Pe={}));class We{static buildContext(t,e,i,s,n="#FFF"){const o=new We(t,e);i&&s&&o.resize(i,s);const a=o.getContext();return a.setBackgroundFillStyle(n),We.lastContext=a,a}static getCanvasContext(t,e,i,s){return We.buildContext(t,We.Backends.CANVAS,e,i,s)}static getSVGContext(t,e,i,s){return We.buildContext(t,We.Backends.SVG,e,i,s)}static drawDashedLine(t,e,i,s,n,o){t.beginPath();const a=s-e,r=n-i,h=Math.atan2(r,a);let c=e,l=i;t.moveTo(e,i);let d=0,u=!0;for(;!(a<0?c<=s:c>=s)||!(r<0?l<=n:l>=n);){const e=o[d++%o.length],i=c+Math.cos(h)*e;c=a<0?Math.max(s,i):Math.min(s,i);const g=l+Math.sin(h)*e;l=r<0?Math.max(n,g):Math.min(n,g),u?t.lineTo(c,l):t.moveTo(c,l),u=!u}t.closePath(),t.stroke()}constructor(t,e){if($(t,"RenderContext"))this.ctx=t;else{if(void 0===e)throw new p("InvalidArgument","Missing backend argument");const i=e;let s;if("string"==typeof t){const e=document.getElementById(t);if(!e)throw new p("BadElementId",`Can't find element with ID "${e}"`);s=e}else s=t;if(i===We.Backends.CANVAS){if(!Rt(s))throw new p("BadElement","CANVAS context requires an HTMLCanvasElement.");const t=s.getContext("2d",{willReadFrequently:!0});if(!t)throw new p("BadElement","Can't get canvas context");this.ctx=new Pt(t)}else{if(i!==We.Backends.SVG)throw new p("InvalidBackend",`No support for backend: ${i}`);if(!function(t){if(!t)return!1;const e=m();return"function"==typeof e.HTMLDivElement&&t instanceof e.HTMLDivElement||"function"==typeof t.appendChild&&"object"==typeof t.style}(s))throw new p("BadElement","SVG context requires an HTMLDivElement.");this.ctx=new Oe(s)}}}resize(t,e){return this.ctx.resize(t,e),this}getContext(){return this.ctx}}We.Backends=Re,We.LineEndType=Pe,We.lastContext=void 0;class He extends W{static get CATEGORY(){return"StringNumber"}static format(t,e){const i=e.leftShift,s=e.rightShift;if(!t||0===t.length)return!1;const n=[];let o=null,a=0,r=0;for(let i=0;i<t.length;++i){const h=t[i],c=h.getNote(),l=h.getPosition();if(!et(c))throw new p("NoStaveNote");const d=h.checkIndex(),u=c.getKeyProps()[d],g=c.getModifierContext(),m=2*h.radius/K.STAVE_LINE_DISTANCE+.5;if(g&&(l===M.ABOVE?(h.textLine=g.getState().topTextLine,e.topTextLine+=m):l===M.BELOW&&(h.textLine=g.getState().textLine,e.textLine+=m)),c!==o){for(let t=0;t<c.keys.length;++t)l===W.Position.LEFT&&(a=Math.max(c.getLeftDisplacedHeadPx(),a)),0===s&&(r=Math.max(c.getRightDisplacedHeadPx(),r));o=c}const f=u.line;n.push({pos:l,note:c,num:h,line:f,shiftL:a,shiftR:r})}n.sort((t,e)=>e.line-t.line);let h=0,c=0,l=0,d=null,u=null;for(let t=0;t<n.length;++t){const e=n[t].note,o=n[t].pos,r=n[t].num,g=n[t].line,p=n[t].shiftR;g===d&&e===u||(h=s+p);const m=r.getWidth()+1;let f=0;o===W.Position.LEFT?(r.setXShift(i+a),f=m,c=Math.max(f,c)):o===W.Position.RIGHT&&(r.setXShift(h),f+=m,l=f>l?f:l),d=g,u=e}return e.leftShift+=c,e.rightShift+=l,!0}constructor(t){super(),this.stringNumber=t,this.position=W.Position.ABOVE,this.xShift=0,this.yShift=0,this.textLine=0,this.stemOffset=0,this.xOffset=0,this.yOffset=0,this.dashed=!0,this.leg=We.LineEndType.NONE,this.radius=8,this.drawCircle=!0,this.setWidth(2*this.radius+4)}setLineEndType(t){return t>=We.LineEndType.NONE&&t<=We.LineEndType.DOWN&&(this.leg=t),this}setStringNumber(t){return this.stringNumber=t,this}setOffsetX(t){return this.xOffset=t,this}setOffsetY(t){return this.yOffset=t,this}setLastNote(t){return this.lastNote=t,this}setDashed(t){return this.dashed=t,this}setDrawCircle(t){return this.drawCircle=t,this}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=e.getModifierStartXY(this.position,this.index),s=e.hasStem()?e.getStemDirection():at.UP;let n=i.x+this.xShift+this.xOffset,o={};e.hasStem()&&(o=e.checkStem().getExtents());let a=i.y+this.yShift+this.yOffset;switch(this.position){case W.Position.ABOVE:a=e.getYs().reduce((t,e)=>t<e?t:e),e.hasStem()&&s===at.UP&&(a=o.topY+B.get("StringNumber.stemPadding")),a-=this.radius+B.get("StringNumber.verticalPadding")+this.textLine*K.STAVE_LINE_DISTANCE;break;case W.Position.BELOW:a=e.getYs().reduce((t,e)=>t>e?t:e),e.hasStem()&&s===at.DOWN&&(a=o.topY-B.get("StringNumber.stemPadding")),a+=this.radius+B.get("StringNumber.verticalPadding")+this.textLine*K.STAVE_LINE_DISTANCE;break;case W.Position.LEFT:n-=this.radius/2+B.get("StringNumber.leftPadding");break;case W.Position.RIGHT:n+=this.radius/2+B.get("StringNumber.rightPadding");break;default:throw new p("InvalidPosition",`The position ${this.position} is invalid`)}this.drawCircle&&(t.beginPath(),t.arc(n,a,this.radius,0,2*Math.PI,!1),t.setLineWidth(1.5),t.stroke()),t.setFont(this.fontInfo);const r=n-t.measureText(this.stringNumber).width/2;t.fillText(""+this.stringNumber,r,a+4.5);const h=this.lastNote;if(it(h)){const i=h.getStemX()-e.getX()+5;let s,o;switch(t.setLineCap("round"),t.setLineWidth(.6),this.dashed?We.drawDashedLine(t,n+10,a,n+i,a,[3,3]):We.drawDashedLine(t,n+10,a,n+i,a,[3,0]),this.leg){case We.LineEndType.UP:s=-10,o=this.dashed?[3,3]:[3,0],We.drawDashedLine(t,n+i,a,n+i,a+s,o);break;case We.LineEndType.DOWN:s=10,o=this.dashed?[3,3]:[3,0],We.drawDashedLine(t,n+i,a,n+i,a+s,o)}}}}class Ge extends W{static get CATEGORY(){return"Stroke"}static format(t,e){const i=e.leftShift;if(!t||0===t.length)return!1;const s=t.map(t=>{const e=t.getNote(),i=t.checkIndex();if(et(e)){const{line:s}=e.getKeyProps()[i];return{line:s,shift:e.getLeftDisplacedHeadPx(),stroke:t}}if(st(e)){const{str:s}=e.getPositions()[i];return{line:s,shift:0,stroke:t}}throw new p("Internal","Unexpected instance.")}),n=i,o=s.reduce((t,{stroke:e,shift:i})=>(e.setXShift(n+i),Math.max(e.getWidth()+5,t)),0);return e.leftShift+=o,!0}constructor(t,e){super(),this.boundingBox=new D(0,0,0,0),this.options=Object.assign({allVoices:!0},e),this.allVoices=this.options.allVoices,this.type=t,this.position=W.Position.LEFT,this.renderOptions={fontScale:B.get("Stroke.fontSize")},this.setXShift(0),this.setWidth(10)}getPosition(){return this.position}addEndNote(t){return this.noteEnd=t,this}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=e.getModifierStartXY(this.position,this.index);let s=e.getYs(),n=i.y,o=i.y;const a=i.x-5,r=e.checkStave().getSpacingBetweenLines(),h=this.checkModifierContext().getMembers(e.getCategory());for(let t=0;t<h.length;t++){const e=h[t];if(tt(e)){s=e.getYs();for(let e=0;e<s.length;e++)(this.note===h[t]||this.allVoices)&&(n=Math.min(n,s[e]),o=Math.max(o,s[e]))}}let c="",l=0,d=0;switch(this.type){case Ge.Type.BRUSH_DOWN:case Ge.Type.ROLL_DOWN:case Ge.Type.RASGUEADO_DOWN:c=I.arrowheadBlackUp,l=n,n-=r/2,o+=r/2;break;case Ge.Type.BRUSH_UP:case Ge.Type.ROLL_UP:case Ge.Type.RASGUEADO_UP:c=I.arrowheadBlackDown,l=o+r,n-=r/2;break;case Ge.Type.ARPEGGIO_DIRECTIONLESS:n-=r/2,o+=r/2;break;default:throw new p("InvalidType",`The stroke type ${this.type} does not exist`)}if(this.type===Ge.Type.BRUSH_DOWN||this.type===Ge.Type.BRUSH_UP)t.fillRect(a+this.xShift,n,1,o-n),this.boundingBox=new D(a+this.xShift,n,1,o-n);else{const e=c===I.arrowheadBlackDown?I.wiggleArpeggiatoDown:I.wiggleArpeggiatoUp;let i="";const s=new P;for(;s.getWidth()<o-n;)i+=e,s.setText(i);this.type===Ge.Type.RASGUEADO_DOWN||this.type===Ge.Type.ROLL_DOWN||this.type===Ge.Type.ARPEGGIO_DIRECTIONLESS?(t.openRotation(90,a+this.xShift,n),s.renderText(t,a+this.xShift,n-s.getTextMetrics().actualBoundingBoxDescent+s.getHeight()/2),t.closeRotation(),d=n+s.getWidth()+5,this.boundingBox=new D(a+this.xShift-s.getHeight()/2,n-s.getTextMetrics().actualBoundingBoxDescent+s.getHeight()/2,s.getHeight(),s.getWidth())):(t.openRotation(-90,a+this.xShift,o),s.renderText(t,a+this.xShift,o-s.getTextMetrics().actualBoundingBoxDescent+s.getHeight()/2),t.closeRotation(),d=o-s.getWidth()-5,this.boundingBox=new D(a+this.xShift-s.getHeight()/2,o-s.getTextMetrics().actualBoundingBoxDescent+s.getHeight()/2-s.getWidth(),s.getHeight(),s.getWidth()))}if(0!==l){const e=new P;e.setText(c),e.renderText(t,a+this.xShift-e.getWidth()/2,l),this.boundingBox.mergeWith(new D(a+this.xShift-e.getWidth()/2,l-e.getHeight(),e.getWidth(),e.getHeight()))}if(this.type===Ge.Type.RASGUEADO_DOWN||this.type===Ge.Type.RASGUEADO_UP){const e=new P("Stroke.text");e.setText("R"),e.renderText(t,a+this.xShift-e.getWidth()/2,d+(this.type===Ge.Type.RASGUEADO_DOWN?e.getHeight():0)),this.boundingBox.mergeWith(new D(a+this.xShift-e.getWidth()/2,d+(this.type===Ge.Type.RASGUEADO_DOWN?e.getHeight():0)-e.getHeight(),e.getWidth(),e.getHeight()))}}getBoundingBox(){return this.boundingBox}}Ge.Type={BRUSH_DOWN:1,BRUSH_UP:2,ROLL_DOWN:3,ROLL_UP:4,RASGUEADO_DOWN:5,RASGUEADO_UP:6,ARPEGGIO_DIRECTIONLESS:7};class Ue extends W{static get CATEGORY(){return"Vibrato"}static format(t,e,i){if(!t||0===t.length)return!1;let s=e.topTextLine,n=0,o=e.rightShift-7;const a=i.getMembers(Ot.CATEGORY);if(a&&a.length>0){s-=a.map(t=>t.getTextHeight()).reduce((t,e)=>t>e?t:e)/K.STAVE_LINE_DISTANCE+1}else e.topTextLine+=1;for(let e=0;e<t.length;++e){const i=t[e];i.setXShift(o),i.setTextLine(s),n+=i.getWidth(),o+=n}return e.rightShift+=n,!0}constructor(){super(),this.position=W.Position.RIGHT,this.renderOptions={code:60080,width:20},this.setVibratoWidth(this.renderOptions.width)}setVibratoWidth(t){this.renderOptions.width=t,this.text=String.fromCodePoint(this.renderOptions.code);const e=this.getWidth();if(!e)throw new p("Cannot set vibrato width if width is 0");const i=Math.round(this.renderOptions.width/e);for(let t=1;t<i;t++)this.text+=String.fromCodePoint(this.renderOptions.code);return this}setVibratoCode(t){return this.renderOptions.code=t,this.setVibratoWidth(this.renderOptions.width)}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=e.getModifierStartXY(W.Position.RIGHT,this.index).x,s=e.getYForTopText(this.textLine)+5;this.renderText(t,i,s)}}function Ve(...t){Xe.DEBUG&&S("VexFlow.ModifierContext",t)}class Xe{constructor(){this.state={leftShift:0,rightShift:0,textLine:0,topTextLine:0},this.members={},this.preFormatted=!1,this.postFormatted=!1,this.formatted=!1,this.width=0,this.spacing=0,this.annotationRightShift=0}addModifier(t){return Ve("addModifier is deprecated, use addMember instead."),this.addMember(t)}addMember(t){const e=t.getCategory();return this.members[e]||(this.members[e]=[]),this.members[e].push(t),t.setModifierContext(this),this.preFormatted=!1,this}getModifiers(t){return Ve("getModifiers is deprecated, use getMembers instead."),this.getMembers(t)}getMembers(t){var e;return null!==(e=this.members[t])&&void 0!==e?e:[]}getWidth(){return this.width}getLeftShift(){return this.state.leftShift}getRightShift(){return this.state.rightShift}getRightShiftForTie(){return this.state.rightShift-this.annotationRightShift}getState(){return this.state}getMetrics(){if(!this.formatted)throw new p("UnformattedMember","Unformatted member has no metrics.");return{width:this.state.leftShift+this.state.rightShift+this.spacing,spacing:this.spacing}}preFormat(){var t;if(this.preFormatted)return;Ve("Preformatting ModifierContext");const e=this.state,i=this.members;xe.format(i.StaveNote,e),De.format(i.Parenthesis,e),ie.format(i.Dot,e),se.format(i.FretHandFinger,e),ot.format(i.Accidental,e),Ge.format(i.Stroke,e),ve.format(i.GraceNoteGroup,e),Be.format(i.NoteSubGroup,e),He.format(i.StringNumber,e),xt.format(i.Articulation,e),Ce.format(i.Ornament,e);const s=null!==(t=i.Annotation)&&void 0!==t?t:[],n=t=>t.getVerticalJustification()===ct.VerticalJustify.TOP||t.getVerticalJustification()===ct.VerticalJustify.BOTTOM;ct.format(s.filter(t=>!n(t)),e);const o=e.rightShift;ct.format(s.filter(n),e);const a=e.rightShift;e.rightShift=o,Kt.format(i.ChordSymbol,e),Ot.format(i.Bend,e),Ue.format(i.Vibrato,e,this),this.annotationRightShift=Math.max(0,a-e.rightShift),e.rightShift+=this.annotationRightShift,this.width=e.leftShift+e.rightShift,this.preFormatted=!0}postFormat(){this.postFormatted||(Ve("Postformatting ModifierContext"),xe.postFormat(this.getMembers("StaveNote")))}}Xe.DEBUG=!1;class Ye extends Ct{static get CATEGORY(){return"KeySignature"}constructor(t,e,i){super(),this.accList=[],this.setKeySig(t,e,i),this.setPosition(kt.BEGIN),this.children=[],this.paddingForced=!1}convertToGlyph(t,e,i){const s=K.accidentalCodes(t.type),n=new P("KeySignature");n.setText(s);let o=1;if(n.setYShift(i.getYForLine(t.line)),this.children.length>0){const t=this.children[this.children.length-1],e=t=>t.getText()===I.accidentalNatural,i=(t,e)=>Math.abs(e.getYShift()-t.getYShift());(e(t)||e(n))&&i(t,n)<10&&(o=2),n.setXShift(t.getXShift()+t.getWidth()+o)}this.children.push(n),this.width+=n.getWidth()+o}cancelKey(t){return this.formatted=!1,this.cancelKeySpec=t,this}convertToCancelAccList(t){const e=K.keySignature(t),i=this.accList.length>0&&e.length>0&&e[0].type!==this.accList[0].type,s=i?e.length:e.length-this.accList.length;if(s<1)return;const n=[];for(let t=0;t<s;t++){let o=t;i||(o=e.length-s+t);const a=e[o];n.push({type:"n",line:a.line})}return this.accList=n.concat(this.accList),{accList:n,type:e[0].type}}addToStave(t){return this.paddingForced=!0,t.addModifier(this),this}setStave(t){return this.formatted=!1,super.setStave(t)}getBoundingBox(){return this.formatted||this.format(),super.getBoundingBox()}calculateDimensions(){let t;t=this.children.length>0?this.children[0].getBoundingBox():new D(this.x+this.xShift,this.y+this.yShift,0,0),this.children.forEach(e=>{t.mergeWith(e.getBoundingBox())}),this.width=t.getW(),this.height=t.getH(),this.y=t.getY()}convertAccLines(t,e,i=this.accList){let s,n,o=0;switch(t){case"soprano":"#"===e?s=[2.5,.5,2,0,1.5,-.5,1]:o=-1;break;case"mezzo-soprano":"b"===e?s=[0,2,.5,2.5,1,3,1.5]:o=1.5;break;case"alto":o=.5;break;case"tenor":"#"===e?s=[3,1,2.5,.5,2,0,1.5]:o=-.5;break;case"baritone-f":case"baritone-c":"b"===e?s=[.5,2.5,1,3,1.5,3.5,2]:o=2;break;case"bass":case"french":o=1}if(void 0!==s)for(n=0;n<i.length;++n)i[n].line=s[n];else if(0!==o)for(n=0;n<i.length;++n)i[n].line+=o}getPadding(t){return this.formatted||this.format(),0===this.children.length||!this.paddingForced&&t<2?0:this.padding}getWidth(){return this.formatted||this.format(),this.width}setKeySig(t,e,i){return this.formatted=!1,this.keySpec=t,this.cancelKeySpec=e,this.alterKeySpec=i,this}alterKey(t){return this.formatted=!1,this.alterKeySpec=t,this}convertToAlterAccList(t){const e=Math.min(t.length,this.accList.length);for(let i=0;i<e;++i)t[i]&&(this.accList[i].type=t[i])}format(){let t=this.getStave();t||(t=new ti(0,0,100),this.setStave(t)),this.width=0,this.children=[],this.accList=K.keySignature(f(this.keySpec));const e=this.accList,i=e.length>0?e[0].type:void 0;let s;if(this.cancelKeySpec&&(s=this.convertToCancelAccList(this.cancelKeySpec)),this.alterKeySpec&&this.convertToAlterAccList(this.alterKeySpec),this.accList.length>0){const n=(this.position===kt.END?t.getEndClef():t.getClef())||t.getClef();s&&this.convertAccLines(n,s.type,s.accList),this.convertAccLines(n,i,e);for(let e=0;e<this.accList.length;++e)this.convertToGlyph(this.accList[e],this.accList[e+1],t)}this.calculateDimensions(),this.formatted=!0}draw(){const t=this.checkStave().checkContext();this.formatted||this.format(),this.setRendered();const e=this.getAttribute("class");t.openGroup("keysignature"+(e?" "+e:""),this.getAttribute("id"));for(let e=0;e<this.children.length;e++){this.children[e].renderText(t,this.x,0)}this.drawPointerRect(),t.closeGroup()}}class _e extends Ct{static get CATEGORY(){return"Repetition"}constructor(t,e,i){super(),this.symbolType=t,this.x=e,this.xShift=0,this.yShift=i}setShiftX(t){return this.xShift=t,this}setShiftY(t){return this.yShift=t,this}draw(){const t=this.checkStave(),e=t.getModifierXShift(this.getPosition());switch(this.setRendered(),this.symbolType){case _e.type.CODA_RIGHT:this.drawCodaFixed(t,e+t.getWidth());break;case _e.type.CODA_LEFT:this.drawSymbolText(t,e,"Coda",!0);break;case _e.type.SEGNO_LEFT:this.drawSegnoFixed(t,e);break;case _e.type.SEGNO_RIGHT:this.drawSegnoFixed(t,e+t.getWidth());break;case _e.type.DC:this.drawSymbolText(t,e,"D.C.",!1);break;case _e.type.DC_AL_CODA:this.drawSymbolText(t,e,"D.C. al",!0);break;case _e.type.DC_AL_FINE:this.drawSymbolText(t,e,"D.C. al Fine",!1);break;case _e.type.DS:this.drawSymbolText(t,e,"D.S.",!1);break;case _e.type.DS_AL_CODA:this.drawSymbolText(t,e,"D.S. al",!0);break;case _e.type.DS_AL_FINE:this.drawSymbolText(t,e,"D.S. al Fine",!1);break;case _e.type.FINE:this.drawSymbolText(t,e,"Fine",!1);break;case _e.type.TO_CODA:this.drawSymbolText(t,e,"To",!0)}}drawCodaFixed(t,e){const i=t.getYForTopText(t.getNumLines());return this.text=I.coda,this.renderText(t.checkContext(),e,i+B.get("Repetition.coda.offsetY")),this}drawSegnoFixed(t,e){const i=t.getYForTopText(t.getNumLines());return this.text=I.segno,this.renderText(t.checkContext(),e,i+B.get("Repetition.segno.offsetY")),this}drawSymbolText(t,e,i,s){const n=t.checkContext();let o=0;switch(this.text=i,s&&(this.text+=" "),this.setFont(B.getFontInfo("Repetition.text")),this.symbolType){case _e.type.CODA_LEFT:o=t.getVerticalBarWidth();break;case _e.type.DC:case _e.type.DC_AL_FINE:case _e.type.DS:case _e.type.DS_AL_FINE:case _e.type.FINE:default:o=e-(t.getNoteStartX()-this.x)+t.getWidth()-this.width-B.get("Repetition.text.offsetX")}const a=t.getYForTopText(t.getNumLines())+B.get("Repetition.text.offsetY");return this.renderText(n,o,a),this}}_e.type={NONE:1,CODA_LEFT:2,CODA_RIGHT:3,SEGNO_LEFT:4,SEGNO_RIGHT:5,DC:6,DC_AL_CODA:7,DC_AL_FINE:8,DS:9,DS_AL_CODA:10,DS_AL_FINE:11,FINE:12,TO_CODA:13};class ze extends Ct{static get CATEGORY(){return"StaveSection"}constructor(t,e=0,i=0,s=!0){super(),this.setText(t),this.x=e,this.yShift=i,this.drawRect=s,this.padding=B.get("StaveSection.padding")}setDrawRect(t){return this.drawRect=t,this}draw(){const t=this.checkStave(),e=t.checkContext();this.setRendered(),this.x=t.getX()+t.getModifierXShift(this.getPosition());const i=-1*this.textMetrics.actualBoundingBoxDescent,s=this.width+2*this.padding,n=this.height+2*this.padding,o=t.getYForTopText(1.5)+this.yShift,a=this.x+this.xShift;this.drawRect&&(e.beginPath(),e.rect(a,o-n+i,s,n),e.stroke()),this.renderText(e,this.xShift+this.padding,o-this.padding)}}class je extends Ct{static get CATEGORY(){return"StaveTempo"}constructor(t,e,i){super(),this.durationToCode={"1/4":I.metNoteDoubleWholeSquare,long:I.metNoteDoubleWholeSquare,"1/2":I.metNoteDoubleWhole,breve:I.metNoteDoubleWhole,1:I.metNoteWhole,whole:I.metNoteWhole,w:I.metNoteWhole,2:I.metNoteHalfUp,half:I.metNoteHalfUp,h:I.metNoteHalfUp,4:I.metNoteQuarterUp,quarter:I.metNoteQuarterUp,q:I.metNoteQuarterUp,8:I.metNote8thUp,eighth:I.metNote8thUp,16:I.metNote16thUp,"16th":I.metNote16thUp,32:I.metNote32ndUp,"32nd":I.metNote32ndUp,64:I.metNote64thUp,"64th":I.metNote64thUp,128:I.metNote128thUp,"128th":I.metNote128thUp,256:I.metNote256thUp,"256th":I.metNote256thUp,512:I.metNote512thUp,"512th":I.metNote512thUp,1024:I.metNote1024thUp,"1024th":I.metNote1024thUp},this.tempo=t,this.position=kt.ABOVE,this.x=e,this.setXShift(10),this.setYShift(i)}setTempo(t){return this.tempo=t,this}draw(){const t=this.checkStave(),e=t.getModifierXShift(this.getPosition()),i=t.checkContext();this.setRendered();const{name:s,duration:n,dots:o,bpm:a,duration2:r,dots2:h,parenthesis:c}=this.tempo;let l=this.x+e;const d=t.getYForTopText(1),u=new P("StaveTempo.glyph"),g=new P("StaveTempo");if(s&&(this.text=s,this.fontInfo=B.getFontInfo("StaveTempo.name"),this.renderText(i,e,d),l+=this.getWidth()+3),(s&&n||c)&&(g.setText("("),g.renderText(i,l+this.xShift,d+this.yShift),l+=g.getWidth()+3),n){if(u.setText(this.durationToCode[n]),u.renderText(i,l+this.xShift,d+this.yShift),l+=u.getWidth()+3,o){u.setText(I.metAugmentationDot);for(let t=0;t<o;t++)u.renderText(i,l+this.xShift,d+2+this.yShift),l+=u.getWidth()+3}if(g.setText("="),g.renderText(i,l+this.xShift,d+this.yShift),l+=g.getWidth()+3,r){if(u.setText(this.durationToCode[r]),u.renderText(i,l+this.xShift,d+this.yShift),l+=u.getWidth()+3,h){u.setText(I.metAugmentationDot);for(let t=0;t<h;t++)u.renderText(i,l+this.xShift,d+2+this.yShift),l+=u.getWidth()+3}}else a&&(g.setText(""+a),g.renderText(i,l+this.xShift,d+this.yShift),l+=g.getWidth()+3);(s||c)&&(g.setText(")"),g.renderText(i,l+this.xShift,d+this.yShift))}}}!function(t){t[t.LEFT=1]="LEFT",t[t.CENTER=2]="CENTER",t[t.RIGHT=3]="RIGHT"}(Me||(Me={}));class qe extends yt{static get CATEGORY(){return"TextNote"}static get GLYPHS(){return{segno:I.segno,tr:I.ornamentTrill,mordent:I.ornamentMordent,mordentUpper:I.ornamentShortTrill,mordentLower:I.ornamentMordent,f:I.dynamicForte,p:I.dynamicPiano,m:I.dynamicMezzo,s:I.dynamicSforzando,z:I.dynamicZ,coda:I.coda,pedalOpen:I.keyboardPedalPed,pedalClose:I.keyboardPedalUp,caesuraStraight:I.caesura,caesuraCurved:I.caesuraCurved,breath:I.breathMarkComma,tick:I.breathMarkTick,turn:I.ornamentTurn,turnInverted:I.ornamentTurnSlash}}constructor(t){var e,i;super(t),this.text=null!==(e=t.text)&&void 0!==e?e:"",t.glyph&&(this.text+=qe.GLYPHS[t.glyph]||t.glyph),t.font?this.setFont(t.font):void 0===t.glyph&&this.setFont(B.getFontInfo("TextNote.text"));const s=.769231*A.convertSizeToPointValue(this.fontInfo.size);t.superscript&&(this.superscript=new P("TextNote.text"),this.superscript.setText(t.superscript),this.superscript.setFontSize(s)),t.subscript&&(this.subscript=new P("TextNote.text"),this.subscript.setText(t.subscript),this.subscript.setFontSize(s)),this.line=null!==(i=t.line)&&void 0!==i?i:0,this.smooth=t.smooth||!1,this.ignoreTicks=t.ignoreTicks||!1,this.justification=Me.LEFT}setJustification(t){return this.justification=t,this}setLine(t){return this.line=t,this}getLine(){return this.line}preFormat(){if(this.preFormatted)return;const t=this.checkTickContext("Can't preformat without a TickContext.");this.justification===Me.CENTER?this.leftDisplacedHeadPx=this.width/2:this.justification===Me.RIGHT&&(this.leftDisplacedHeadPx=this.width),this.rightDisplacedHeadPx=t.getMetrics().glyphPx/2,this.preFormatted=!0}draw(){const t=this.checkContext(),e=this.checkStave(),i=this.checkTickContext("Can't draw without a TickContext.");this.setRendered();let s=this.getAbsoluteX()+i.getMetrics().glyphPx/2;const n=this.getWidth();this.justification===Me.CENTER?s-=n/2:this.justification===Me.RIGHT&&(s-=n);const o=e.getYForLine(this.line+-3);this.renderText(t,s,o);const a=this.getHeight();this.superscript&&this.superscript.renderText(t,s+this.width+2,o-a/2.2),this.subscript&&this.subscript.renderText(t,s+this.width+2,o+a/2.2-1)}}qe.Justification=Me;class Ke extends Ct{static get CATEGORY(){return"StaveText"}constructor(t,e,i={}){var s,n,o;super(),this.setText(t),this.setXShift(null!==(s=i.shiftX)&&void 0!==s?s:0),this.setYShift(null!==(n=i.shiftY)&&void 0!==n?n:0),this.position=e,this.justification=null!==(o=i.justification)&&void 0!==o?o:qe.Justification.CENTER}draw(){const t=this.checkStave(),e=t.checkContext();let i,s;switch(this.setRendered(),this.position){case kt.LEFT:case kt.RIGHT:s=(t.getYForLine(0)+t.getBottomLineY())/2,i=this.position===kt.LEFT?t.getX()-this.width-24:t.getX()+t.getWidth()+24;break;case kt.ABOVE:case kt.BELOW:i=t.getX(),this.justification===Me.CENTER?i+=t.getWidth()/2-this.width/2:this.justification===Me.RIGHT&&(i+=t.getWidth()-this.width),s=this.position===kt.ABOVE?t.getYForTopText(2):t.getYForBottomText(2);break;default:throw new p("InvalidPosition","Value Must be in Modifier.Position.")}this.renderText(e,i,s+4)}}!function(t){t[t.NONE=1]="NONE",t[t.BEGIN=2]="BEGIN",t[t.MID=3]="MID",t[t.END=4]="END",t[t.BEGIN_END=5]="BEGIN_END"}(Ie||(Ie={}));class $e extends Ct{static get CATEGORY(){return"Volta"}static get type(){return Ie}constructor(t,e,i,s){super(),this.type=t,this.x=i,this.yShift=s,this.text=e}draw(){const t=this.checkStave(),e=t.getModifierXShift(this.getPosition()),i=t.checkContext();this.setRendered();let s=t.getWidth()-e;const n=t.getYForTopText(t.getNumLines())+this.yShift,o=1.5*t.getSpacingBetweenLines();switch(this.type){case Ie.BEGIN:i.fillRect(this.x+e,n,1,o);break;case Ie.END:s-=5,i.fillRect(this.x+e+s,n,1,o);break;case Ie.BEGIN_END:s-=3,i.fillRect(this.x+e,n,1,o),i.fillRect(this.x+e+s,n,1,o)}this.type!==Ie.BEGIN&&this.type!==Ie.BEGIN_END||this.renderText(i,e+5,n-this.yShift+15),i.fillRect(this.x+e,n,s,1)}}class Qe extends Ct{static get CATEGORY(){return"TimeSignature"}constructor(t="4/4",e=15,i=!0){super(),this.topRenderY=0,this.botRenderY=0,this.timeSpec="4/4",this.line=0,this.isNumeric=!0,this.topStartX=0,this.botStartX=0,this.lineShift=0,this.topText=new P,this.botText=new P,this.validateArgs=i;const s=e;this.topLine=1,this.bottomLine=3,this.setPosition(kt.BEGIN),this.setTimeSig(t),this.setPadding(s)}static getTimeSigCode(t,e=!1){let i=I.null;switch(t){case"C":i=I.timeSigCommon;break;case"C|":i=I.timeSigCutCommon;break;case"+":i=e?I.timeSigPlusSmall:I.timeSigPlus;break;case"-":i=I.timeSigMinus;break;case"(":i=e?I.timeSigParensLeftSmall:I.timeSigParensLeft;break;case")":i=e?I.timeSigParensRightSmall:I.timeSigParensRight;break;default:i=String.fromCodePoint(57472+Number(t[0]))}return i}makeTimeSignatureGlyph(t,e){let i="",s=0,n=0;for(let s=0;s<t.length;++s){i+=Qe.getTimeSigCode(t[s],e.length>0)}this.topText.setText(i),s=this.topText.getWidth(),n=this.topText.getHeight();let o=0;i="";for(let t=0;t<e.length;++t){i+=Qe.getTimeSigCode(e[t],!0)}this.botText.setText(i),o=this.botText.getWidth(),n=Math.max(n,this.botText.getHeight()),this.lineShift=n>30?.5:0,this.width=Math.max(s,o),this.topStartX=(this.width-s)/2,this.botStartX=(this.width-o)/2}setTimeSig(t){var e,i;if(this.timeSpec=t,"C"===t||"C|"===t){const e=Qe.getTimeSigCode(t);this.line=2,this.text=e,this.isNumeric=!1}else{this.validateArgs&&(t=>{t.split("/").forEach(e=>{if(!1===/^[0-9+\-()]+$/.test(e))throw new p("BadTimeSignature",`Invalid time spec: ${t}. Must contain valid signatures.`)})})(t);const s=t.split("/");this.line=0,this.isNumeric=!0,this.makeTimeSignatureGlyph(null!==(e=s[0])&&void 0!==e?e:"",null!==(i=s[1])&&void 0!==i?i:"")}return this}getTimeSpec(){return this.timeSpec}getLine(){return this.line}setLine(t){this.line=t}getIsNumeric(){return this.isNumeric}setIsNumeric(t){this.isNumeric=t}draw(){const t=this.checkStave(),e=t.checkContext();this.setRendered();const i=this.getAttribute("class");e.openGroup("timesignature"+(i?" "+i:""),this.getAttribute("id")),this.drawAt(e,t,this.x),this.drawPointerRect(),e.closeGroup()}drawAt(t,e,i){if(this.setRendered(),this.isNumeric){let s=i+this.topStartX;this.botText.getText().length>0?this.topRenderY=e.getYForLine(this.topLine-this.lineShift):this.topRenderY=(e.getYForLine(this.topLine)+e.getYForLine(this.bottomLine))/2,this.topText.renderText(t,s,this.topRenderY),s=i+this.botStartX,this.botRenderY=e.getYForLine(this.bottomLine+this.lineShift),this.botText.renderText(t,s,this.botRenderY)}else this.renderText(t,i-this.x,e.getYForLine(this.line))}getBoundingBox(){if(this.isNumeric){const t=this.topText.getBoundingBox(),e=this.botText.getBoundingBox();t.move(this.x+this.topStartX,this.topRenderY),e.move(this.x+this.botStartX,this.botRenderY);return t.mergeWith(e)}{const t=this.checkStave(),e=super.getBoundingBox();return e.move(0,t.getYForLine(this.line)),e}}}const Je={[Dt.CATEGORY]:0,[$t.CATEGORY]:1,[Ye.CATEGORY]:2,[Qe.CATEGORY]:3},Ze={[Qe.CATEGORY]:0,[Ye.CATEGORY]:1,[Dt.CATEGORY]:2,[$t.CATEGORY]:3};class ti extends P{static get CATEGORY(){return"Stave"}static get defaultPadding(){return B.get("Stave.padding")+B.get("Stave.endPaddingMax")}static get rightPadding(){return B.get("Stave.endPaddingMax")}constructor(t,e,i,s){super(),this.x=t,this.y=e,this.width=i,this.formatted=!1,this.startX=t+5,this.endX=t+i,this.modifiers=[],this.measure=0,this.clef="treble",this.endClef=void 0,this.options=Object.assign({verticalBarWidth:10,numLines:5,leftBar:!0,rightBar:!0,spacingBetweenLinesPx:K.STAVE_LINE_DISTANCE,spaceAboveStaffLn:4,spaceBelowStaffLn:4,topTextPosition:1,bottomTextPosition:4,lineConfig:[]},s),this.bounds={x:this.x,y:this.y,w:this.width,h:0},this.defaultLedgerLineStyle={lineWidth:2},this.resetLines(),this.addModifier(new Dt(this.options.leftBar?vt.SINGLE:vt.NONE)),this.addEndModifier(new Dt(this.options.rightBar?vt.SINGLE:vt.NONE))}setDefaultLedgerLineStyle(t){this.defaultLedgerLineStyle=t}getDefaultLedgerLineStyle(){var t;const e=void 0!==(null===(t=this.getContext())||void 0===t?void 0:t.getDefaultStyle().strokeStyle)?{}:{strokeStyle:"#444"};return Object.assign(Object.assign(Object.assign({},e),this.styleExplicit?this.getStyle():{}),this.defaultLedgerLineStyle)}space(t){return this.options.spacingBetweenLinesPx*t}resetLines(){this.options.lineConfig=[];for(let t=0;t<this.options.numLines;t++)this.options.lineConfig.push({visible:!0});this.height=(this.options.numLines+this.options.spaceAboveStaffLn)*this.options.spacingBetweenLinesPx,this.options.bottomTextPosition=this.options.numLines}setNoteStartX(t){return this.formatted||this.format(),this.startX=t,this}getNoteStartX(){return this.formatted||this.format(),this.startX}getNoteEndX(){return this.formatted||this.format(),this.endX}getTieStartX(){return this.startX}getTieEndX(){return this.endX}getNumLines(){return this.options.numLines}setNumLines(t){return this.options.numLines=t,this.resetLines(),this}getTopLineTopY(){return this.getYForLine(0)}getBottomLineBottomY(){var t;return this.getYForLine(this.getNumLines()-1)+(null!==(t=this.getStyle().lineWidth)&&void 0!==t?t:1)}setX(t){const e=t-this.x;this.formatted=!1,this.x=t,this.startX+=e,this.endX+=e;for(let t=0;t<this.modifiers.length;t++){const i=this.modifiers[t];i.setX(i.getX()+e)}return this}setWidth(t){return this.formatted=!1,this.width=t,this.endX=this.x+t,this}setMeasure(t){return this.measure=t,this}getMeasure(){return this.measure}getModifierXShift(t=0){if("number"!=typeof t)throw new p("InvalidIndex","Must be of number type");if(this.formatted||this.format(),1===this.getModifiers(kt.BEGIN).length)return 0;if(this.modifiers[t].getPosition()===kt.RIGHT)return 0;let e=this.startX-this.x;const i=this.modifiers[0];return i.getType()===vt.REPEAT_BEGIN&&e>i.getWidth()&&(e-=i.getWidth()),e}setRepetitionType(t,e=0){return this.modifiers.push(new _e(t,this.x,e)),this}setVoltaType(t,e,i){return this.modifiers.push(new $e(t,e,this.x,i)),this}setSection(t,e,i=0,s,n=!0){const o=new ze(t).setYShift(e).setXShift(i).setDrawRect(n);return s&&o.setFontSize(s),this.addModifier(o),this}setTempo(t,e){return this.modifiers.push(new je(t,this.x,e)),this}setStaveText(t,e,i={}){return this.modifiers.push(new Ke(t,e,i)),this}getSpacingBetweenLines(){return this.options.spacingBetweenLinesPx}getBoundingBox(){return new D(this.x,this.y,this.width,this.getBottomY()-this.y)}getBottomY(){const t=this.options,e=t.spacingBetweenLinesPx;return this.getYForLine(t.numLines)+t.spaceBelowStaffLn*e}getBottomLineY(){return this.getYForLine(this.options.numLines)}getYForLine(t){const e=this.options,i=e.spacingBetweenLinesPx,s=e.spaceAboveStaffLn;return this.y+t*i+s*i}getLineForY(t){const e=this.options,i=e.spacingBetweenLinesPx,s=e.spaceAboveStaffLn;return(t-this.y)/i-s}getYForTopText(t=0){return this.getYForLine(-t-this.options.topTextPosition)}getYForBottomText(t=0){return this.getYForLine(this.options.bottomTextPosition+t)}getYForNote(t){const e=this.options,i=e.spacingBetweenLinesPx,s=e.spaceAboveStaffLn;return this.y+s*i+5*i-t*i}getYForGlyphs(){return this.getYForLine(3)}addModifier(t,e){return void 0!==e&&t.setPosition(e),t.setStave(this),this.formatted=!1,this.modifiers.push(t),this}addEndModifier(t){return this.addModifier(t,kt.END),this}setBegBarType(t,e=Bt.NONE){const{SINGLE:i,REPEAT_BEGIN:s,NONE:n}=vt;return t!==i&&t!==s&&t!==n||(this.modifiers[0].setType(t).setRepeatBracket(e),this.formatted=!1),this}setEndBarType(t,e=Bt.NONE){return t!==vt.REPEAT_BEGIN&&(this.modifiers[1].setType(t).setRepeatBracket(e),this.formatted=!1),this}setClef(t,e,i,s){void 0===s&&(s=kt.BEGIN),s===kt.END?this.endClef=t:this.clef=t;const n=this.getModifiers(s,$t.CATEGORY);return 0===n.length?this.addClef(t,e,i,s):n[0].setType(t,e,i),this}getClef(){return this.clef}setEndClef(t,e,i){return this.setClef(t,e,i,kt.END),this}getEndClef(){return this.endClef}setKeySignature(t,e,i){void 0===i&&(i=kt.BEGIN);const s=this.getModifiers(i,Ye.CATEGORY);return 0===s.length?this.addKeySignature(t,e,i):s[0].setKeySig(t,e),this}setEndKeySignature(t,e){return this.setKeySignature(t,e,kt.END),this}setTimeSignature(t,e,i){void 0===i&&(i=kt.BEGIN);const s=this.getModifiers(i,Qe.CATEGORY);return 0===s.length?this.addTimeSignature(t,e,i):s[0].setTimeSig(t),this}setEndTimeSignature(t,e){return this.setTimeSignature(t,e,kt.END),this}addKeySignature(t,e,i){return void 0===i&&(i=kt.BEGIN),this.addModifier(new Ye(t,e).setPosition(i),i),this}addClef(t,e,i,s){return void 0===s||s===kt.BEGIN?this.clef=t:s===kt.END&&(this.endClef=t),this.addModifier(new $t(t,e,i),s),this}addEndClef(t,e,i){return this.addClef(t,e,i,kt.END),this}addTimeSignature(t,e,i){return this.addModifier(new Qe(t,e),i),this}addEndTimeSignature(t,e){return this.addTimeSignature(t,e,kt.END),this}addTrebleGlyph(){return this.addClef("treble"),this}getModifiers(t,e){const i=void 0===t,s=void 0===e;return i&&s?this.modifiers:i?this.modifiers.filter(t=>e===t.getCategory()):s?this.modifiers.filter(e=>t===e.getPosition()):this.modifiers.filter(i=>t===i.getPosition()&&e===i.getCategory())}sortByCategory(t,e){for(let i=t.length-1;i>=0;i--)for(let s=0;s<i;s++)if(e[t[s].getCategory()]>e[t[s+1].getCategory()]){const e=t[s];t[s]=t[s+1],t[s+1]=e}}format(){var t,e,i,s;const n=this.modifiers[0],o=this.modifiers[1],a=this.getModifiers(kt.BEGIN),r=this.getModifiers(kt.END);let h,c,l;this.sortByCategory(a,Je),this.sortByCategory(r,Ze),a.length>1&&n.getType()===vt.REPEAT_BEGIN&&(a.push(a.splice(0,1)[0]),a.splice(0,0,new Dt(vt.SINGLE))),r.indexOf(o)>0&&r.splice(0,0,new Dt(vt.NONE));let d=0,u=this.x;for(let t=0;t<a.length;t++)l=a[t],c=l.getPadding(t+d),h=l.getWidth(),u+=c,l.setX(u),u+=h,c+h===0&&d--;this.startX=u,u=this.x+this.width;const g={left:0,right:0,paddingRight:0,paddingLeft:0};let p=0;for(let n=0;n<r.length;n++){l=r[n],p=J(l)?n:p,g.right=0,g.left=0,g.paddingRight=0,g.paddingLeft=0;const o=l.getLayoutMetrics();o?(0!==n&&(g.right=null!==(t=o.xMax)&&void 0!==t?t:0,g.paddingRight=null!==(e=o.paddingRight)&&void 0!==e?e:0),g.left=-(null!==(i=o.xMin)&&void 0!==i?i:0),g.paddingLeft=null!==(s=o.paddingLeft)&&void 0!==s?s:0,n===r.length-1&&(g.paddingLeft=0)):(g.paddingRight=l.getPadding(n-p),0!==n&&(g.right=l.getWidth()),0===n&&(g.left=l.getWidth())),u-=g.paddingRight,u-=g.right,l.setX(u),u-=g.left,u-=g.paddingLeft}this.endX=1===r.length?this.x+this.width:u,this.formatted=!0}draw(){var t;const e=this.checkContext();this.setRendered();const i=this.getAttribute("class");e.openGroup("stave"+(i?" "+i:""),this.getAttribute("id")),this.formatted||this.format();const s=this.options.numLines,n=this.width,o=this.x;let a;const r=(null!==(t=this.getStyle().lineWidth)&&void 0!==t?t:1)%2==0?0:.5;for(let t=0;t<s;t++)a=this.getYForLine(t),this.options.lineConfig[t].visible&&(e.beginPath(),e.moveTo(o,a+r),e.lineTo(o+n,a+r),e.stroke());this.drawPointerRect(),e.closeGroup();for(let t=0;t<this.modifiers.length;t++){const i=this.modifiers[t];i.setContext(e),i.setStave(this),i.drawWithStyle()}if(this.measure>0){e.setFont(this.fontInfo);const t=e.measureText(""+this.measure).width;a=this.getYForTopText(0)+3,e.fillText(""+this.measure,this.x-t/2,a)}}getVerticalBarWidth(){return this.options.verticalBarWidth}getConfigForLines(){return this.options.lineConfig}setConfigForLine(t,e){if(t>=this.options.numLines||t<0)throw new p("StaveConfigError","The line number must be within the range of the number of lines in the Stave.");if(void 0===e.visible)throw new p("StaveConfigError","The line configuration object is missing the 'visible' property.");if("boolean"!=typeof e.visible)throw new p("StaveConfigError","The line configuration objects 'visible' property must be true or false.");return this.options.lineConfig[t]=e,this}setConfigForLines(t){if(t.length!==this.options.numLines)throw new p("StaveConfigError","The length of the lines configuration array must match the number of lines in the Stave");for(const e in t)void 0===t[e].visible&&(t[e]=this.options.lineConfig[e]),this.options.lineConfig[e]=Object.assign(Object.assign({},this.options.lineConfig[e]),t[e]);return this.options.lineConfig=t,this}static formatBegModifiers(t){const e=e=>{let i=0;t.forEach(t=>{const s=t.getModifiers(kt.BEGIN,e);s.length>0&&s[0].getX()>i&&(i=s[0].getX())});let s=0;t.forEach(t=>{s=0;t.getModifiers(kt.BEGIN,e).forEach(t=>{i-t.getX()>s&&(s=i-t.getX())});const n=t.getModifiers(kt.BEGIN);let o=!1;n.forEach(t=>{t.getCategory()===e&&(o=!0),o&&s>0&&t.setX(t.getX()+s)}),t.setNoteStartX(t.getNoteStartX()+s)})};t.forEach(t=>{t.formatted||t.format()}),e("Clef"),e("KeySignature"),e("TimeSignature");let i=0;t.forEach(t=>{t.getNoteStartX()>i&&(i=t.getNoteStartX())}),t.forEach(t=>{t.setNoteStartX(i)}),i=0,t.forEach(t=>{t.getModifiers(kt.BEGIN,"Barline").forEach(t=>{t.getType()===vt.REPEAT_BEGIN&&t.getX()>i&&(i=t.getX())})}),t.forEach(t=>{t.getModifiers(kt.BEGIN,"Barline").forEach(t=>{t.getType()===vt.REPEAT_BEGIN&&t.setX(i)})})}}function ei(t,e,i,s,n){if(e!==ii.type.BOLD_DOUBLE_LEFT&&e!==ii.type.BOLD_DOUBLE_RIGHT)throw new p("InvalidConnector","A REPEAT_BEGIN or REPEAT_END type must be provided.");let o=3,a=3.5;e===ii.type.BOLD_DOUBLE_RIGHT&&(o=-5,a=3),t.fillRect(i+o,s,1,n-s),t.fillRect(i-2,s,a,n-s)}class ii extends P{static get CATEGORY(){return"StaveConnector"}constructor(t,e){super(),this.thickness=K.STAVE_LINE_THICKNESS,this.topStave=t,this.bottomStave=e,this.type=ii.type.DOUBLE,this.xShift=0,this.texts=[]}setType(t){const e="string"==typeof t?ii.typeString[t]:t;return Object.values(ii.type).includes(e)&&(this.type=e),this}getType(){return this.type}setText(t,e={}){var i,s;const n=new P("StaveConnector.text");return n.setText(t),n.setXShift(null!==(i=e.shiftX)&&void 0!==i?i:0),n.setYShift(null!==(s=e.shiftY)&&void 0!==s?s:0),this.texts.push(n),this}draw(){const t=this.checkContext();this.setRendered();let e=this.topStave.getYForLine(0),i=this.bottomStave.getYForLine(this.bottomStave.getNumLines()-1)+this.thickness,s=3,n=this.topStave.getX();(this.type===ii.type.SINGLE_RIGHT||this.type===ii.type.BOLD_DOUBLE_RIGHT||this.type===ii.type.THIN_DOUBLE)&&(n=this.topStave.getX()+this.topStave.getWidth());let o=i-e;const a=new P;switch(this.type){case ii.type.SINGLE:case ii.type.SINGLE_LEFT:case ii.type.SINGLE_RIGHT:s=1;break;case ii.type.DOUBLE:n-=5,e-=this.thickness,o+=.5;break;case ii.type.BRACE:{s=12;const n=this.topStave.getX()-2+this.xShift,a=e,r=n,h=i,c=n-s,l=a+o/2,d=c-.9*s,u=a+.2*o,g=n+1.1*s,p=l-.135*o,m=g,f=l+.135*o,S=d,T=h-.2*o,x=c-s,w=T,b=n+.4*s,y=l+.135*o,k=b,v=l-.135*o,B=x,C=u;t.beginPath(),t.moveTo(n,a),t.bezierCurveTo(d,u,g,p,c,l),t.bezierCurveTo(m,f,S,T,r,h),t.bezierCurveTo(x,w,b,y,c,l),t.bezierCurveTo(k,v,B,C,n,a),t.fill(),t.stroke();break}case ii.type.BRACKET:e-=6,i+=6,o=i-e,a.setText(I.bracketTop),a.renderText(t,n-5,e),a.setText(I.bracketBottom),a.renderText(t,n-5,i),n-=5;break;case ii.type.BOLD_DOUBLE_LEFT:ei(t,this.type,n+this.xShift,e,i-this.thickness);break;case ii.type.BOLD_DOUBLE_RIGHT:ei(t,this.type,n,e,i-this.thickness);break;case ii.type.THIN_DOUBLE:s=1,o-=this.thickness;break;case ii.type.NONE:break;default:throw new p("InvalidType",`The provided StaveConnector.type (${this.type}) is invalid.`)}this.type!==ii.type.BRACE&&this.type!==ii.type.BOLD_DOUBLE_LEFT&&this.type!==ii.type.BOLD_DOUBLE_RIGHT&&this.type!==ii.type.NONE&&t.fillRect(n,e,s,o),this.type===ii.type.THIN_DOUBLE&&t.fillRect(n-3,e,s,o);for(let e=0;e<this.texts.length;e++){const i=this.texts[e],s=this.topStave.getX()-i.getWidth()-24,n=(this.topStave.getYForLine(0)+this.bottomStave.getBottomLineY())/2;i.renderText(t,s,n+4)}}}function si(t,e,i,s){let n=e;for(let e=i+1;e<t.length;e++){const i=t[e];if(tt(i)&&!i.isRest()&&!i.shouldIgnoreTicks()){n=i.getLineForRest();break}}if(s&&e!==n){n=T(Math.max(e,n),Math.min(e,n))}return n}ii.type={SINGLE_RIGHT:0,SINGLE_LEFT:1,SINGLE:1,DOUBLE:2,BRACE:3,BRACKET:4,BOLD_DOUBLE_LEFT:5,BOLD_DOUBLE_RIGHT:6,THIN_DOUBLE:7,NONE:8},ii.typeString={singleRight:ii.type.SINGLE_RIGHT,singleLeft:ii.type.SINGLE_LEFT,single:ii.type.SINGLE,double:ii.type.DOUBLE,brace:ii.type.BRACE,bracket:ii.type.BRACKET,boldDoubleLeft:ii.type.BOLD_DOUBLE_LEFT,boldDoubleRight:ii.type.BOLD_DOUBLE_RIGHT,thinDouble:ii.type.THIN_DOUBLE,none:ii.type.NONE};class ni{static SimpleFormat(t,e=0,{paddingBetween:i=10}={}){t.reduce((t,e)=>{e.addToModifierContext(new Xe);const s=(new Jt).addTickable(e).preFormat(),n=s.getMetrics();return s.setX(t+n.totalLeftPx),t+s.getWidth()+n.totalRightPx+i},e)}static plotDebugging(t,e,i,s,n,o){var a,r;const h=i+(o=Object.assign({stavePadding:B.get("Stave.padding")},o)).stavePadding,c=e.contextGaps;t.save(),t.setFont(B.get("fontFamily"),8),c.gaps.forEach(e=>{var i,o,a;i=h+e.x1,o=h+e.x2,a="rgba(100,200,100,0.4)",t.beginPath(),t.setStrokeStyle(a),t.setFillStyle(a),t.setLineWidth(1),t.fillRect(i,s,Math.max(o-i,0),n-s),t.setFillStyle("green"),t.fillText(Math.round(e.x2-e.x1).toString(),h+e.x1,n+12)}),t.setFillStyle("red"),t.fillText(`Loss: ${(null!==(a=e.totalCost)&&void 0!==a?a:0).toFixed(2)} Shift: ${(null!==(r=e.totalShift)&&void 0!==r?r:0).toFixed(2)} Gap: ${c.total.toFixed(2)}`,h-20,n+27),t.restore()}static FormatAndDraw(t,e,i,s){let n={autoBeam:!1,alignRests:!1};"object"==typeof s?n=Object.assign(Object.assign({},n),s):"boolean"==typeof s&&(n.autoBeam=s);const o=new ke(K.TIME4_4).setMode(ke.Mode.SOFT).addTickables(i),a=n.autoBeam?At.applyAndGetBeams(o):[];return(new ni).joinVoices([o]).formatToStave([o],e,{alignRests:n.alignRests,stave:e}),o.setContext(t).setStave(e).drawWithStyle(),a.forEach(e=>e.setContext(t).drawWithStyle()),o.getBoundingBox()}static FormatAndDrawTab(t,e,i,s,n,o,a){let r={autoBeam:o,alignRests:!1};"object"==typeof a?r=Object.assign(Object.assign({},r),a):"boolean"==typeof a&&(r.autoBeam=a);const h=new ke(K.TIME4_4).setMode(ke.Mode.SOFT).addTickables(n),c=new ke(K.TIME4_4).setMode(ke.Mode.SOFT).addTickables(s),l=r.autoBeam?At.applyAndGetBeams(h):[];(new ni).joinVoices([h]).joinVoices([c]).formatToStave([h,c],i,{alignRests:r.alignRests}),h.draw(t,i),c.draw(t,e),l.forEach(e=>e.setContext(t).drawWithStyle()),new ii(i,e).setContext(t).drawWithStyle()}static AlignRestsToNotes(t,e,i=!1){t.forEach((s,n)=>{if(et(s)&&s.isRest()){if(s.getTuplet()&&!i)return;if(3!==s.getLineForRest())return;if(e||s.getBeam()){const e=s.getKeyProps()[0];if(0===n)e.line=si(t,e.line,n,!1);else if(n>0&&n<t.length){const i=t[n-1];if(et(i))if(i.isRest())e.line=i.getKeyProps()[0].line;else{const s=i.getLineForRest();e.line=si(t,s,n,!0)}}s.setKeyLine(0,e.line)}}})}constructor(t){this.formatterOptions=Object.assign({globalSoftmax:!1,softmaxFactor:K.SOFTMAX_FACTOR,maxIterations:5},t),this.justifyWidth=0,this.totalCost=0,this.totalShift=0,this.durationStats={},this.minTotalWidth=0,this.hasMinTotalWidth=!1,this.tickContexts={map:{},array:[],list:[],resolutionMultiplier:0},this.modifierContexts=[],this.contextGaps={total:0,gaps:[]},this.voices=[],this.lossHistory=[]}alignRests(t,e){if(!t||!t.length)throw new p("BadArgument","No voices to format rests");t.forEach(t=>ni.AlignRestsToNotes(t.getTickables(),e))}preCalculateMinTotalWidth(t){const e=B.get("Stave.unalignedNotePadding");let i=0,s=0,n=0;const o=[],a=[];if(this.hasMinTotalWidth)return this.minTotalWidth;if(!t)throw new p("BadArgument","'voices' required to run preCalculateMinTotalWidth");this.createTickContexts(t);const{list:r,map:h}=this.tickContexts;this.minTotalWidth=0,r.forEach(e=>{const r=h[e];r.preFormat(),r.getTickables().length<t.length&&(i+=1),r.getTickables().forEach(t=>{s+=t.getMetrics().width,n+=t.getTicks().value(),o.push(t.getMetrics().width),a.push(t.getTicks().value())});const c=r.getWidth();this.minTotalWidth+=c}),this.hasMinTotalWidth=!0;const c=s>0?s/o.length:1/o.length,l=b(o.map(t=>Math.pow(t-c,2))),d=Math.pow(l/o.length,.5)/c,u=n/a.length,g=b(a.map(t=>Math.pow(t-u,2))),m=Math.pow(g/a.length,.5)/u,f=Math.max(m,d)*r.length*e,S=e*i;return this.minTotalWidth+Math.max(S,f)}getMinTotalWidth(){if(!this.hasMinTotalWidth)throw new p("NoMinTotalWidth","Call 'preCalculateMinTotalWidth' or 'preFormat' before calling 'getMinTotalWidth'");return this.minTotalWidth}static getResolutionMultiplier(t){if(!t||!t.length)throw new p("BadArgument","No voices to format");const e=t[0].getTotalTicks();return t.reduce((t,i)=>{if(!i.getTotalTicks().equals(e))throw new p("TickMismatch","Voices should have same total note duration in ticks.");if(i.getMode()===ke.Mode.STRICT&&!i.isComplete())throw new p("IncompleteVoice","Voice does not have enough notes.");return Math.max(t,y.LCM(t,i.getResolutionMultiplier()))},1)}createModifierContexts(t){if(0===t.length)return;const e=ni.getResolutionMultiplier(t),i=new Map,s=[];t.forEach(t=>{const n=new y(0,e);t.getTickables().forEach(t=>{const e=n.numerator;let o=i.get(t.getStave());if(o||(i.set(t.getStave(),{}),o=i.get(t.getStave())),!(o?o[e]:void 0)){const t=new Xe;s.push(t),o[e]=t}t.addToModifierContext(o[e]),n.add(t.getTicks())})}),this.modifierContexts.push({map:i,array:s,resolutionMultiplier:e})}createTickContexts(t){if(0===t.length)return{map:{},array:[],list:[],resolutionMultiplier:0};const e={},i=[],s=[],n=ni.getResolutionMultiplier(t);t.forEach((t,o)=>{const a=new y(0,n);t.getTickables().forEach(t=>{const n=a.numerator;if(!e[n]){const t=new Jt({tickID:n});s.push(t),e[n]=t,i.push(n)}e[n].addTickable(t,o),a.add(t.getTicks())})});const o={map:e,array:s,list:i.sort((t,e)=>t-e),resolutionMultiplier:n};this.tickContexts=o;const a=this.tickContexts.array;return a.forEach(t=>{t.tContexts=a}),o}getTickContexts(){return this.tickContexts}preFormat(t=0,e,i,s){const n=this.tickContexts;if(!n)throw new p("NoTickContexts","preFormat requires TickContexts");const{list:o,map:a}=n;this.lossHistory=[],i&&s&&i.forEach(t=>t.setStave(s).preFormat());let r=0,h=0;this.minTotalWidth=0;let c=0;o.forEach(t=>{const e=a[t];e.preFormat();const i=e.getWidth();this.minTotalWidth+=i;const s=e.getMaxTicks().value();c+=s;const n=e.getMetrics();r=r+h+n.totalLeftPx,e.setX(r),h=i-n.totalLeftPx});const{globalSoftmax:l,softmaxFactor:d,maxIterations:u}=this.formatterOptions,g=b(o.map(t=>Math.pow(d,a[t].getMaxTicks().value()/c)));if(this.minTotalWidth=r+h,this.hasMinTotalWidth=!0,t<=0)return this.evaluate();const m=a[o[0]],S=a[o[o.length-1]];function T(t){return o.map((e,i)=>{const s=a[e],n=s.getTickablesByVoice();let r;if(i>0){const e=a[o[i-1]];for(let h=i-1;h>=0;h--){const i=a[o[h]].getTickablesByVoice(),u=[];if(Object.keys(n).forEach(t=>{i[t]&&u.push(t)}),u.length>0){let o=0,a=1/0,h=0;if(u.forEach(t=>{const e=i[t].getTicks().value();e>o&&(r=i[t],o=e);const s=n[t],h=s.getX()-(s.getMetrics().modLeftPx+s.getMetrics().leftDisplacedHeadPx),c=i[t].getMetrics(),l=i[t].getX()+c.notePx+c.modRightPx+c.rightDisplacedHeadPx;a=Math.min(a,h-l)}),a=Math.min(a,s.getX()-(e.getX()+.05*t)),l){const e=c;h=Math.pow(d,o/e)/g*t}else void 0!==r&&(h=r.getVoice().softmax(o)*t);return{expectedDistance:h,maxNegativeShiftPx:a,fromTickable:r}}}}return{expectedDistance:0,fromTickablePx:0,maxNegativeShiftPx:0}})}function x(t){const e=w/2;let i=0;return o.forEach((s,n)=>{const o=a[s];if(n>0){const e=o.getX(),s=t[n],a=f(s.fromTickable).getX()+s.expectedDistance-(e+i);let r=0;a>0?i+=a:a<0&&(r=Math.min(s.maxNegativeShiftPx,Math.abs(a)),i+=-r),o.setX(e+i)}o.getCenterAlignedTickables().forEach(t=>{t.setCenterXShift(e-o.getX())})}),S.getX()-m.getX()}const w=t-S.getMetrics().notePx-S.getMetrics().totalRightPx-m.getMetrics().totalLeftPx,y=B.get("Stave.endPaddingMin"),k=B.get("Stave.endPaddingMax"),v=B.get("Stave.padding");let C=w;const D=T(C);let E=x(D);if(1===o.length)return 0;const L=((t,e)=>{let i=t/2;if(e.length>1)for(let t=1;t<e.length;++t)i=Math.min(e[t].expectedDistance/2,i);return i})(C,D),N=t=>{let e=0;const i=S&&S.getMaxTickable();if(i){const s=i.getVoice();if(s.getTicksUsed().value()>s.getTotalTicks().value())return 2*k<L?L:k;const n=i.getWidth();e=s.softmax(S.getMaxTicks().value())*t-(n+v)}return 2*k<e?e:k};let F=N(C),A=F-(k-y);const O=w-A;let R=u;for(;E>O&&R>0||E+F<O&&R>1;)C-=E-O,F=N(C),A=F-(k-y),E=x(T(C)),R--;return this.justifyWidth=t,this.evaluate()}evaluate(){const t=this.tickContexts,e=this.justifyWidth;this.contextGaps={total:0,gaps:[]},t.list.forEach((e,i)=>{if(0===i)return;const s=t.list[i-1],n=t.map[s],o=t.map[e],a=n.getMetrics(),r=o.getMetrics(),h=n.getX()+a.notePx+a.totalRightPx,c=o.getX()-r.totalLeftPx,l=c-h;this.contextGaps.total+=l,this.contextGaps.gaps.push({x1:h,x2:c}),o.getFormatterMetrics().freedom.left=l,n.getFormatterMetrics().freedom.right=l}),this.durationStats={};const i=this.durationStats;this.voices.forEach(t=>{t.getTickables().forEach((t,s,n)=>{const o=t.getTicks().clone().simplify().toString(),a=t.getMetrics(),r=t.getFormatterMetrics(),h=t.getX()+a.notePx+a.modRightPx+a.rightDisplacedHeadPx;let c=0;if(s<n.length-1){const e=n[s+1],i=e.getMetrics();c=e.getX()-i.modLeftPx-i.leftDisplacedHeadPx-h,r.space.used=e.getX()-t.getX(),e.getFormatterMetrics().freedom.left=c}else c=e-h,r.space.used=e-t.getX();r.freedom.right=c,function(t,e){const s=i[t];void 0===s?i[t]={mean:e,count:1,total:e}:(s.count+=1,s.total+=e,s.mean=s.total/s.count)}(o,r.space.used)})});let s=0;return this.voices.forEach(t=>{t.getTickables().forEach(t=>{const e=t.getTicks().clone().simplify().toString(),n=t.getFormatterMetrics();n.space.mean=i[e].mean,n.duration=e,n.iterations+=1,n.space.deviation=n.space.used-n.space.mean,s+=Math.pow(n.space.deviation,2)})}),this.totalCost=Math.sqrt(s),this.lossHistory.push(this.totalCost),this.totalCost}tune(t){var e;const i=this.tickContexts;if(!i)return 0;const s=null!==(e=null==t?void 0:t.alpha)&&void 0!==e?e:.5;let n=0;return this.totalShift=0,i.list.forEach((t,e,o)=>{const a=i.map[t],r=e>0?i.map[o[e-1]]:void 0,h=e<o.length-1?i.map[o[e+1]]:void 0;a.move(n,r,h);const c=-a.getDeviationCost();c>0?n=-Math.min(a.getFormatterMetrics().freedom.right,Math.abs(c)):c<0&&(n=h?Math.min(h.getFormatterMetrics().freedom.right,Math.abs(c)):0),n*=s,this.totalShift+=n}),this.evaluate()}postFormat(){return this.modifierContexts.forEach(t=>{t.array.forEach(t=>t.postFormat())}),this.tickContexts.list.forEach(t=>{this.tickContexts.map[t].postFormat()}),this}joinVoices(t){return this.createModifierContexts(t),this.hasMinTotalWidth=!1,this}format(t,e,i){const s=Object.assign({alignRests:!1},i);this.voices=t;const n=this.formatterOptions.softmaxFactor;return n&&this.voices.forEach(t=>t.setSoftmaxFactor(n)),this.alignRests(t,s.alignRests),this.createTickContexts(t),this.preFormat(e,s.context,t,s.stave),s.stave&&this.postFormat(),this}formatToStave(t,e,i){const s=Object.assign({context:e.getContext()},i),n=e.getNoteEndX()-e.getNoteStartX()-ti.defaultPadding;return function(...t){ni.DEBUG&&S("VexFlow.Formatter",t)}("Formatting voices to width: ",n),this.format(t,n,s)}getTickContext(t){var e;return null===(e=this.tickContexts)||void 0===e?void 0:e.map[t]}}ni.DEBUG=!1;const oi="Ghost note must have valid initialization data to identify duration.";class ai extends Se{static get CATEGORY(){return"GhostNote"}constructor(t){if(!t)throw new p("BadArguments",oi);let e;if("string"==typeof t)e={duration:t};else{if("object"!=typeof t)throw new p("BadArguments",oi);e=t}super(e),this.setWidth(0)}isRest(){return!0}setStave(t){return super.setStave(t),this}addToModifierContext(t){return this}preFormat(){return this.preFormatted=!0,this}draw(){this.setRendered();for(let t=0;t<this.modifiers.length;++t){const e=this.modifiers[t];Q(e)&&(e.setContext(this.getContext()),e.drawWithStyle())}}}class ri extends yt{static get CATEGORY(){return"GlyphNote"}constructor(t,e,i){super(e),this.options=Object.assign({ignoreTicks:!1,line:2},i),this.ignoreTicks=this.options.ignoreTicks,this.setGlyph(t)}setGlyph(t){return this.text=t,this}preFormat(){return!this.preFormatted&&this.modifierContext&&this.modifierContext.preFormat(),this.preFormatted=!0,this}drawModifiers(){const t=this.checkContext();for(let e=0;e<this.modifiers.length;e++){const i=this.modifiers[e];i.setContext(t),i.drawWithStyle()}}draw(){const t=this.checkStave(),e=t.checkContext();this.setRendered();const i=this.getAttribute("class");e.openGroup("glyphNote"+(i?" "+i:""),this.getAttribute("id")),this.x=this.isCenterAligned()?this.getAbsoluteX()-this.getWidth()/2:this.getAbsoluteX(),this.y=t.getYForLine(this.options.line),this.renderText(e,0,0),this.drawModifiers(),this.drawPointerRect(),e.closeGroup()}}class hi extends xe{static get CATEGORY(){return"GraceNote"}static get LEDGER_LINE_OFFSET(){return 2}constructor(t){super(Object.assign({strokePx:hi.LEDGER_LINE_OFFSET},t)),this.slash=t.slash||!1,this.slur=!0,this.buildNoteHeads(),this.width=3}getStemExtension(){if(this.stemExtensionOverride)return this.stemExtensionOverride;let t=super.getStemExtension();return t=at.HEIGHT*this.getFontScale()-at.HEIGHT+t,t}draw(){super.draw(),this.setRendered();const t=this.stem;if(this.slash&&t){const t=this.getFontScale();let e;const i=this.beam;if(i)i.postFormatted||i.postFormat(),e=this.calcBeamedNotesSlashBBox(8*t,8*t,{stem:6*t,beam:5*t});else{const i=this.getStemDirection(),s=this.getNoteHeadBounds(),n=this.noteHeads[0].getWidth(),o=i===at.DOWN?this.getAbsoluteX():this.getAbsoluteX()+n,a=K.STEM_HEIGHT*t/2,r=i===at.DOWN?s.yBottom+a:s.yTop-a;e=i===at.DOWN?{x1:o-n,y1:r-n,x2:o+n,y2:r+n}:{x1:o-n,y1:r+n,x2:o+n,y2:r-n}}const s=this.checkContext();s.setLineWidth(1*t),s.beginPath(),s.moveTo(e.x1,e.y1),s.lineTo(e.x2,e.y2),s.closePath(),s.stroke()}}calcBeamedNotesSlashBBox(t,e,i){const s=this.beam;if(!s)throw new p("NoBeam","Can't calculate without a beam.");const n=s.slope,o=s.notes[s.notes.length-1]===this?-1:1,a=Math.atan(n*o),r=Math.cos(a)*e,h=Math.sin(a)*e;t*=this.getStemDirection();const c=Math.atan((h-t)/r),l=Math.cos(c)*i.stem*o,d=Math.sin(c)*i.stem,u=Math.cos(c)*i.beam*o,g=Math.sin(c)*i.beam,m=this.getStemX(),f=s.notes[0].getStemX(),S=s.getBeamYToDraw()+(m-f)*n;return{x1:m-l,y1:S+t-d,x2:m+r*o+u,y2:S+h+g}}}class ci extends yt{static get CATEGORY(){return"KeySigNote"}constructor(t,e,i){super({duration:"b"}),this.keySignature=new Ye(t,e,i),this.ignoreTicks=!0}addToModifierContext(t){return this}preFormat(){return this.preFormatted=!0,this.keySignature.setStave(this.checkStave()),this.setWidth(this.keySignature.getWidth()),this}draw(){const t=this.checkStave().checkContext();this.setRendered(),this.keySignature.setX(this.getAbsoluteX()),this.keySignature.setContext(t),this.keySignature.drawWithStyle()}}class li extends P{static get CATEGORY(){return"MultiMeasureRest"}constructor(t,e){var i;super(),this.xs={left:NaN,right:NaN},this.hasPaddingLeft=!1,this.hasPaddingRight=!1,this.hasLineThickness=!1,this.hasSymbolSpacing=!1;const s=null!==(i=e.numberGlyphPoint)&&void 0!==i?i:B.get("MultiMeasureRest.fontSize");this.fontInfo.size=s,this.numberOfMeasures=t,this.text="";const n=`${this.numberOfMeasures}`;for(const t of n)this.text+=String.fromCodePoint(57472+Number(t));this.hasPaddingLeft="number"==typeof e.paddingLeft,this.hasPaddingRight="number"==typeof e.paddingRight,this.hasLineThickness="number"==typeof e.lineThickness,this.hasSymbolSpacing="number"==typeof e.symbolSpacing,this.renderOptions=Object.assign({useSymbols:!1,showNumber:!0,numberLine:-.5,numberGlyphPoint:s,line:2,spacingBetweenLinesPx:K.STAVE_LINE_DISTANCE,serifThickness:2,semibreveRestGlyphScale:B.get("fontSize"),paddingLeft:0,paddingRight:0,lineThickness:5,symbolSpacing:0},e)}getXs(){return this.xs}setStave(t){return this.stave=t,this}getStave(){return this.stave}checkStave(){return f(this.stave,"NoStave","No stave attached to instance.")}drawLine(t,e,i,s){const n=this.renderOptions,o=t.getYForLine(n.line),a=.1*(s-i);i+=a,s-=a;let r="";const h=new P;h.setText(r);const c=h.getWidth();if(!c)throw new p("Cannot drawLine if width is 0");for(let t=1;(t+2)*c+i<=s;t++)r+="";r+="",h.setText(r),h.renderText(e,i+.5*(s-i)-.5*h.getWidth(),o)}drawSymbols(t,e,i,s){const n=Math.floor(this.numberOfMeasures/4),o=this.numberOfMeasures%4,a=Math.floor(o/2),r=o%2,h=this.renderOptions,c=new P;let l="";for(let t=0;t<n;++t)l+=I.restLonga+" ";for(let t=0;t<a;++t)l+=I.restDoubleWhole+" ";c.setText(l);const d=new P;l="";for(let t=0;t<r;++t)l+=I.restWhole+" ";d.setText(l);let u=i+.5*(s-i)-.5*(c.getWidth()+d.getWidth());const g=h.line,p=t.getYForLine(g-1),m=t.getYForLine(g);c.renderText(e,u,m),u+=c.getWidth(),d.renderText(e,u,p),u+=d.getWidth()}draw(){const t=this.checkContext();this.setRendered();const e=this.checkStave();let i=e.getNoteStartX(),s=e.getNoteEndX();const n=e.getModifiers(kt.BEGIN);1===n.length&&J(n[0])&&(i-=n[0].getWidth());const o=this.renderOptions;this.hasPaddingLeft&&(i=e.getX()+o.paddingLeft),this.hasPaddingRight&&(s=e.getX()+e.getWidth()-o.paddingRight),this.xs.left=i,this.xs.right=s,o.useSymbols?this.drawSymbols(e,t,i,s):this.drawLine(e,t,i,s),o.showNumber&&this.renderText(t,i+.5*(s-i)-.5*this.width,e.getYForLine(o.numberLine)-.5*this.height)}}class di extends P{static get CATEGORY(){return"PedalMarking"}static createSustain(t){return new di(t)}static createSostenuto(t){const e=new di(t);return e.setType(di.type.MIXED),e.setCustomText("Sost. Ped."),e}static createUnaCorda(t){const e=new di(t);return e.setType(di.type.TEXT),e.setCustomText("una corda","tre corda"),e}constructor(t){super(),this.notes=t,this.type=di.type.TEXT,this.line=0,this.depressText=di.GLYPHS.pedalDepress,this.releaseText=di.GLYPHS.pedalRelease,this.renderOptions={bracketHeight:10,textMarginRight:6,bracketLineWidth:1}}setType(t){return(t="string"==typeof t?di.typeString[t]:t)>=di.type.TEXT&&t<=di.type.MIXED&&(this.type=t),this}setCustomText(t,e){return this.depressText=t||"",this.releaseText=e||"",this.setFont(B.getFontInfo("PedalMarking.text")),this}setLine(t){return this.line=t,this}getYForStave(t){let e=t.getYForBottomText(this.line+3);const i=this.notes.filter(e=>e.getStave()===t);if(!i.length)return e;const s=Math.min(...i.map(t=>t.getAbsoluteX())),n=Math.max(...i.map(t=>t.getAbsoluteX())),o=new Set(i.map(t=>t.getVoice())),a=new P("PedalMarking").setFont(this.fontInfo),r=Math.max(a.setText(this.depressText).getTextMetrics().actualBoundingBoxAscent,a.setText(this.releaseText).getTextMetrics().actualBoundingBoxAscent),h=this.type===di.type.BRACKET?this.renderOptions.bracketHeight:Math.max(r,this.type===di.type.MIXED?this.renderOptions.bracketHeight:0);for(const i of o)for(const o of i.getTickables())if(et(o)&&o.getStave()===t&&!(o.getAbsoluteX()<s||o.getAbsoluteX()>n))for(const t of o.getModifiers()){if(!Q(t)||t.getVerticalJustification()!==ct.VerticalJustify.BOTTOM)continue;const i=t.computeY().y+t.getYShift()+t.getTextMetrics().actualBoundingBoxDescent;e=Math.max(e,i+4+h)}return e}drawBracketed(){const t=this.checkContext();let e,i,s=!1,n=0;const o=new Map(this.notes.map(t=>[t.checkStave(),0]));for(const t of o.keys())o.set(t,this.getYForStave(t));this.notes.forEach((a,r,h)=>{var c,l,d,u;s=!s;const g=a.getAbsoluteX(),m=o.get(a.checkStave());if(g<e)throw new p("InvalidConfiguration","The notes provided must be in order of ascending x positions");const f=h[r+1]===a,S=h[r-1]===a;let T=0;if(s)T=S?5:0,this.type!==di.type.MIXED||S?(t.beginPath(),t.moveTo(g,m-this.renderOptions.bracketHeight),t.lineTo(g+T,m),t.stroke(),t.closePath()):(n=t.measureText(this.depressText).width,t.fillText(this.depressText,g,m),T=n+this.renderOptions.textMarginRight);else{const s=a.getVoice().getTickables().indexOf(a),n=s+1<a.getVoice().getTickables().length?a.getVoice().getTickables()[s+1].getAbsoluteX():(null!==(l=null===(c=a.getStave())||void 0===c?void 0:c.getX())&&void 0!==l?l:0)+(null!==(u=null===(d=a.getStave())||void 0===d?void 0:d.getWidth())&&void 0!==u?u:0);t.beginPath(),t.moveTo(e,i),t.lineTo(f?g-5:n-5,m),t.lineTo(f?g:n-5,m-this.renderOptions.bracketHeight),t.stroke(),t.closePath()}e=g+T,i=m})}drawText(){const t=this.checkContext();let e=!1,i=0;const s=new Map(this.notes.map(t=>[t.checkStave(),0]));for(const t of s.keys())s.set(t,this.getYForStave(t));this.notes.forEach(n=>{var o,a,r,h;e=!e;const c=n.checkStave(),l=n.getAbsoluteX(),d=s.get(c);if(e)i=t.measureText(this.depressText).width,t.fillText(this.depressText,l,d);else{const e=n.getVoice().getTickables().indexOf(n),s=e+1<n.getVoice().getTickables().length?n.getVoice().getTickables()[e+1].getAbsoluteX():(null!==(a=null===(o=n.getStave())||void 0===o?void 0:o.getX())&&void 0!==a?a:0)+(null!==(h=null===(r=n.getStave())||void 0===r?void 0:r.getWidth())&&void 0!==h?h:0);i=t.measureText(this.releaseText).width,t.fillText(this.releaseText,s-i,d)}})}draw(){const t=this.checkContext();this.setRendered(),void 0!==this.renderOptions.color&&(t.setStrokeStyle(this.renderOptions.color),t.setFillStyle(this.renderOptions.color)),this.applyStyle(t),t.setFont(this.font),function(...t){di.DEBUG&&S("VexFlow.PedalMarking",t)}("Rendering Pedal Marking"),this.type===di.type.BRACKET||this.type===di.type.MIXED?(t.setLineWidth(this.renderOptions.bracketLineWidth),this.drawBracketed()):this.type===di.type.TEXT&&this.drawText()}}di.DEBUG=!1,di.GLYPHS={pedalDepress:I.keyboardPedalPed,pedalRelease:I.keyboardPedalUp},di.type={TEXT:1,BRACKET:2,MIXED:3},di.typeString={text:di.type.TEXT,bracket:di.type.BRACKET,mixed:di.type.MIXED};const ui={1:I.repeat1Bar,2:I.repeat2Bars,4:I.repeat4Bars,slash:I.repeatBarSlash};class gi extends ri{static get CATEGORY(){return"RepeatNote"}constructor(t,e,i){super(ui[t]||"",Object.assign({duration:"q",alignCenter:"slash"!==t},e),i)}}class pi{constructor(t){this.systems=[],this.rows=[],this.options=Object.assign({width:500,x:10,y:10,rowGap:40,measureGap:0,measurePadding:20,justify:!0},t),this.setWidth(this.options.width);for(const t of["x","y","rowGap","measureGap","measurePadding"])if(!Number.isFinite(this.options[t])||this.options[t]<0)throw new p("BadArgument",`Sheet ${t} must be a nonnegative finite number.`)}addSystem(t={}){const e=this.options.factory.System(Object.assign(Object.assign({},t),{autoWidth:!0,noJustification:!1}));return this.systems.push(e),e}setWidth(t){if(!Number.isFinite(t)||t<=0)throw new p("BadArgument","Sheet width must be a positive finite number.");return this.options.width=t,this}getSystems(){return this.systems.slice()}getRows(){return this.rows.map(t=>Object.assign(Object.assign({},t),{systems:t.systems.slice()}))}getHeight(){const t=this.rows[this.rows.length-1];return t?t.y+t.height:this.options.y}format(){const t=this.measureSystems();this.rows=[];let e=this.options.y;for(const i of this.packRows(t)){const s=this.formatRow(i,t,e);this.rows.push(s),e+=s.height+this.options.rowGap}return this}measureSystems(){return this.systems.map(t=>(t.setX(0).setY(0).setWidth(),t.format(),t.getWidth()+this.options.measurePadding))}packRows(t){const e=[];let i=[],s=0;return t.forEach((t,n)=>{const o=i.length?this.options.measureGap:0;i.length&&s+o+t>this.options.width&&(e.push(i),i=[],s=0),s+=(i.length?this.options.measureGap:0)+t,i.push(n)}),i.length&&e.push(i),e}verticalBounds(t){let e=0,i=t.getBoundingBox().getH();for(const s of t.getVoices())for(const t of s.getTickables()){const s=t.getBoundingBox();e=Math.min(e,s.getY()),i=Math.max(i,s.getY()+s.getH())}return{top:e,bottom:i}}formatRow(t,e,i){const s=t.reduce((t,i)=>t+e[i],0)+this.options.measureGap*(t.length-1),n=this.options.justify?Math.max(0,this.options.width-s)/t.length:0;let o=this.options.x,a=0,r=0;const h=t.map(t=>this.systems[t]);t.forEach(t=>{const i=this.systems[t];i.setX(o).setY(0).setWidth(e[t]+n),i.format();const s=this.verticalBounds(i);a=Math.min(a,s.top),r=Math.max(r,s.bottom),o+=i.getWidth()+this.options.measureGap});for(const t of h)t.setY(i-a),t.format();const c=o-this.options.x-this.options.measureGap;return{systems:h,x:this.options.x,y:i,width:c,height:r-a,overflow:Math.max(0,c-this.options.width)}}}function mi(t,e,i,s,n,o,a){t.beginPath(),t.moveTo(e,i),t.lineTo(s,n),t.lineTo(o,a),t.lineTo(e,i),t.closePath(),t.fill()}class fi extends P{static get CATEGORY(){return"StaveLine"}constructor(t){super(),this.setNotes(t),this.text="",this.renderOptions={paddingLeft:4,paddingRight:3,lineWidth:1,lineDash:void 0,roundedEnd:!0,color:void 0,drawStartArrow:!1,drawEndArrow:!1,arrowheadLength:10,arrowheadAngle:Math.PI/8,textPositionVertical:fi.TextVerticalPosition.TOP,textJustification:fi.TextJustification.CENTER}}setText(t){return this.text=t,this}setNotes(t){if(!t.firstNote&&!t.lastNote)throw new p("BadArguments","Notes needs to have either firstNote or lastNote set.");if(t.firstIndexes||(t.firstIndexes=[0]),t.lastIndexes||(t.lastIndexes=[0]),t.firstIndexes.length!==t.lastIndexes.length)throw new p("BadArguments","Connected notes must have same number of indexes.");return this.notes=t,this.firstNote=t.firstNote,this.firstIndexes=t.firstIndexes,this.lastNote=t.lastNote,this.lastIndexes=t.lastIndexes,this}applyLineStyle(){const t=this.checkContext(),e=this.renderOptions;e.lineDash&&t.setLineDash(e.lineDash),e.lineWidth&&t.setLineWidth(e.lineWidth),e.roundedEnd?t.setLineCap("round"):t.setLineCap("square")}drawArrowLine(t,e,i){const s=this.renderOptions.drawStartArrow&&this.renderOptions.drawEndArrow,n=e.x,o=e.y,a=i.x,r=i.y,h=Math.sqrt((a-n)*(a-n)+(r-o)*(r-o)),c=(h-this.renderOptions.arrowheadLength/3)/h;let l,d,u,g;this.renderOptions.drawEndArrow||s?(l=Math.round(n+(a-n)*c),d=Math.round(o+(r-o)*c)):(l=a,d=r),this.renderOptions.drawStartArrow||s?(u=n+(a-n)*(1-c),g=o+(r-o)*(1-c)):(u=n,g=o),this.renderOptions.color&&(t.setStrokeStyle(this.renderOptions.color),t.setFillStyle(this.renderOptions.color)),this.applyStyle(t),t.beginPath(),t.moveTo(u,g),t.lineTo(l,d),t.stroke(),t.closePath();const p=Math.atan2(r-o,a-n),m=Math.abs(this.renderOptions.arrowheadLength/Math.cos(this.renderOptions.arrowheadAngle));let f,S,T,x,w,b;(this.renderOptions.drawEndArrow||s)&&(f=p+Math.PI+this.renderOptions.arrowheadAngle,T=a+Math.cos(f)*m,x=r+Math.sin(f)*m,S=p+Math.PI-this.renderOptions.arrowheadAngle,w=a+Math.cos(S)*m,b=r+Math.sin(S)*m,mi(t,T,x,a,r,w,b)),(this.renderOptions.drawStartArrow||s)&&(f=p+this.renderOptions.arrowheadAngle,T=n+Math.cos(f)*m,x=o+Math.sin(f)*m,S=p-this.renderOptions.arrowheadAngle,w=n+Math.cos(S)*m,b=o+Math.sin(S)*m,mi(t,T,x,n,o,w,b))}draw(){const t=this.checkContext();this.setRendered();const e=this.firstNote,i=this.lastNote,s=this.renderOptions;this.applyLineStyle();let n={x:0,y:0},o={x:0,y:0};this.firstIndexes.forEach((a,r)=>{const h=this.lastIndexes[r];n=e.getModifierStartXY(2,a),o=i.getModifierStartXY(1,h);const c=n.y>o.y;n.x+=e.getMetrics().modRightPx+s.paddingLeft,o.x-=i.getMetrics().modLeftPx+s.paddingRight;const l=e.getGlyphWidth();e.getKeyProps()[a].displaced&&1===e.getStemDirection()&&(n.x+=l+s.paddingLeft);i.getKeyProps()[h].displaced&&-1===i.getStemDirection()&&(o.x-=l+s.paddingRight),n.y+=c?-3:1,o.y+=c?2:0,this.drawArrowLine(t,n,o)});const a=this.width,r=s.textJustification;let h=0;if(r===fi.TextJustification.LEFT)h=n.x;else if(r===fi.TextJustification.CENTER){h=(o.x-n.x)/2+n.x-a/2}else r===fi.TextJustification.RIGHT&&(h=o.x-a);let c=0;const l=s.textPositionVertical;l===fi.TextVerticalPosition.TOP?c=e.checkStave().getYForTopText():l===fi.TextVerticalPosition.BOTTOM&&(c=e.checkStave().getYForBottomText(K.TEXT_HEIGHT_OFFSET_HACK));const d=s.color;this.applyStyle(t,{fillStyle:d,strokeStyle:d}),this.applyStyle(t),this.renderText(t,h,c)}}fi.TextVerticalPosition={TOP:1,BOTTOM:2},fi.TextJustification=Me;class Si extends P{static get CATEGORY(){return"System"}constructor(t={}){super(),this.setOptions(t),this.partStaves=[],this.partStaveInfos=[],this.partVoices=[]}setOptions(t={}){if(!t.factory)throw new p("NoFactory","System.setOptions(options) requires a factory.");this.factory=t.factory,this.options=Object.assign(Object.assign({factory:this.factory,x:10,y:10,width:500,spaceBetweenStaves:12,autoWidth:!1,noJustification:!1,debugFormatter:!1,formatIterations:0,noPadding:!1},t),{details:Object.assign({alpha:.5},t.details),formatOptions:Object.assign({},t.formatOptions)}),!1===this.options.noJustification&&void 0===t.width&&(this.options.autoWidth=!0)}getX(){return this.options.x}setX(t){return this.options.x=t,this.partStaves.forEach(e=>{e.setX(t)}),this}getY(){return this.options.y}setY(t){return this.options.y=t,this.partStaves.forEach(e=>{e.setY(t)}),this}getStaves(){return this.partStaves}getVoices(){return this.partVoices}setWidth(t){if(void 0!==t&&(!Number.isFinite(t)||t<=0))throw new p("BadArgument","System width must be a positive finite number.");return this.options.autoWidth=void 0===t,void 0!==t&&(this.options.width=t,this.partStaves.forEach(e=>e.setWidth(t))),this}getWidth(){return this.options.width}setContext(t){return super.setContext(t),this.factory.setContext(t),this}addConnector(t="double"){return this.connector=this.factory.StaveConnector({topStave:this.partStaves[0],bottomStave:this.partStaves[this.partStaves.length-1],type:t}),this.connector}addStave(t){var e;const i=Object.assign({leftBar:!1},t.options),s=null!==(e=t.stave)&&void 0!==e?e:this.factory.Stave({x:this.options.x,y:this.options.y,width:this.options.width,options:i}),n=Object.assign(Object.assign({spaceAbove:0,spaceBelow:0,debugNoteMetrics:!1,noJustification:!1},t),{options:i}),o=this.getContext();return n.voices.forEach(t=>{t.setContext(o).setStave(s).getTickables().forEach(t=>t.setStave(s)),this.partVoices.push(t)}),this.partStaves.push(s),this.partStaveInfos.push(n),s}addVoices(t){const e=this.getContext();t.forEach(t=>{t.setContext(e),this.partVoices.push(t)})}format(){const t=this.options.details;let e=0;const i=new ni(t);this.formatter=i;let s=this.options.y,n=0;const o=[];this.partStaves.forEach((t,e)=>{s+=t.space(this.partStaveInfos[e].spaceAbove),t.setY(s),s+=t.space(this.partStaveInfos[e].spaceBelow),s+=t.space(this.options.spaceBetweenStaves),this.partStaveInfos[e].debugNoteMetrics&&(o.push({y:s,stave:t}),s+=15),n=Math.max(n,t.getNoteStartX())}),this.partVoices.forEach(t=>{t.getTickables().forEach(t=>{const e=t.getStave();e&&t.setStave(e)})}),i.joinVoices(this.partVoices),this.partStaves.forEach(t=>t.setNoteStartX(n)),this.options.autoWidth&&this.partVoices.length>0?(e=i.preCalculateMinTotalWidth(this.partVoices),this.options.width=e+ti.rightPadding+(n-this.options.x),this.partStaves.forEach(t=>{t.setWidth(this.options.width)})):e=this.options.noPadding?this.options.width-(n-this.options.x):this.options.width-(n-this.options.x)-ti.defaultPadding,this.partVoices.length>0&&i.format(this.partVoices,this.options.noJustification?0:e,this.options.formatOptions),i.postFormat();for(let e=0;e<this.options.formatIterations;e++)i.tune(t);this.startX=n,this.debugNoteMetricsYs=o,this.lastY=s,ti.formatBegModifiers(this.partStaves)}getBoundingBox(){var t;return new D(this.options.x,this.options.y,this.options.width,(null!==(t=this.lastY)&&void 0!==t?t:0)-this.options.y)}draw(){const t=this.checkContext();if(!(this.formatter&&this.startX&&this.lastY&&this.debugNoteMetricsYs))throw new p("NoFormatter","format() must be called before draw()");this.setRendered(),this.options.debugFormatter&&ni.plotDebugging(t,this.formatter,this.startX,this.options.y,this.lastY),this.debugNoteMetricsYs.forEach(e=>{this.partVoices.forEach(i=>{i.getTickables().forEach(i=>{i.getStave()===e.stave&&yt.plotMetrics(t,i,e.y)})})})}}class Ti extends Se{static get CATEGORY(){return"TabNote"}constructor(t,e=!1){super(t),this.fretElement=[],this.greatestString=()=>this.positions.map(t=>t.str).reduce((t,e)=>t>e?t:e),this.leastString=()=>this.positions.map(t=>t.str).reduce((t,e)=>t<e?t:e),this.ghost=!1,this.positions=t.positions||[],this.renderOptions=Object.assign(Object.assign({},this.renderOptions),{drawStem:e,drawDots:e,drawStemThroughStave:!1,yShift:0}),this.glyphProps=yt.getGlyphProps(this.duration,this.noteType),f(this.glyphProps,"BadArguments",`No glyph found for duration '${this.duration}' and type '${this.noteType}'`),this.buildStem(),t.stemDirection?this.setStemDirection(t.stemDirection):this.setStemDirection(at.UP),this.ghost=!1,this.updateWidth()}reset(){return super.reset(),this.stave&&this.setStave(this.stave),this}setGhost(t){return this.ghost=t,this.updateWidth(),this}hasStem(){return!!this.renderOptions.drawStem}getStemExtension(){return void 0!==this.stemExtensionOverride?this.stemExtensionOverride:this.flag.getHeight()>at.HEIGHT?this.flag.getHeight()-at.HEIGHT:0}static tabToElement(t){let e;return"X"===t.toUpperCase()?(e=new P("TabNote"),e.setText(I.accidentalDoubleSharp)):(e=new P("TabNote.text"),e.setText(t),e.setYShift(e.getHeight()/2)),e}setFontSize(t){return super.setFontSize(t),this.fretFontSize=t,this.positions&&this.updateWidth(),this.preFormatted=!1,this}updateWidth(){this.fretElement=[],this.width=0;for(let t=0;t<this.positions.length;++t){let e=this.positions[t].fret;this.ghost&&(e="("+e+")");const i=Ti.tabToElement(e.toString()),s=A.convertSizeToPointValue(B.getFontInfo("TabNote.text").size),n=void 0===this.fretFontSize?s*this.getFontScale():A.convertSizeToPointValue(this.fretFontSize);i.setFontSize(A.convertSizeToPointValue(i.fontInfo.size)*n/s);const o=i.getTextMetrics();i.setYShift((o.actualBoundingBoxAscent-o.actualBoundingBoxDescent)/2),this.fretElement.push(i),this.width=Math.max(i.getWidth(),this.width)}}setStave(t){super.setStave(t);const e=t.getContext();this.setContext(e);const i=this.positions.map(({str:e})=>t.getYForLine(Number(e)-1));return this.setYs(i),this.stem&&this.stem.setYBounds(this.getStemY(),this.getStemY()),this}getPositions(){return this.positions}getModifierStartXY(t,e){if(!this.preFormatted)throw new p("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(0===this.ys.length)throw new p("NoYValues","No Y-Values calculated for this note.");let i=0;if(t===W.Position.LEFT)i=-2;else if(t===W.Position.RIGHT)i=this.width+2;else if(t===W.Position.BELOW||t===W.Position.ABOVE){i=this.width/2}return{x:this.getAbsoluteX()+i,y:this.ys[e]}}getLineForRest(){return Number(this.positions[0].str)}preFormat(){this.preFormatted||(this.modifierContext&&this.modifierContext.preFormat(),this.preFormatted=!0)}getStemX(){return this.getCenterGlyphX()}getStemY(){const t=this.checkStave().getNumLines()-.5,e=at.UP===this.stemDirection?-.5:t;return this.checkStave().getYForLine(e)}getStemExtents(){return this.checkStem().getExtents()}drawFlag(){const{beam:t,glyphProps:e,renderOptions:{drawStem:i}}=this,s=this.checkContext(),n=void 0===t&&i;if(e.codeFlagUp&&n){const t=this.getStemX(),e=this.getStemDirection()===at.DOWN?this.getStemY()-this.checkStem().getHeight()-this.getStemExtension():this.getStemY()-this.checkStem().getHeight()+this.getStemExtension();this.flag.setContext(s).setX(t).setY(e).drawWithStyle()}}drawModifiers(){this.modifiers.forEach(t=>{$(t,"Dot")&&!this.renderOptions.drawDots||(t.setContext(this.getContext()),t.drawWithStyle())})}drawStemThrough(){const t=this.getStemX(),e=this.getStemY(),i=this.checkContext(),s=this.renderOptions.drawStem,n=this.renderOptions.drawStemThroughStave;if(s&&n){const s=function(t,e){const i=[];let s=[];for(let n=1;n<=t;n++)e.indexOf(n)>-1?(i.push(s),s=[]):s.push(n);return s.length>0&&i.push(s),i}(this.checkStave().getNumLines(),this.positions.map(t=>Number(t.str))),n=function(t,e,i,s){const n=1!==s,o=-1!==s,a=i.getSpacingBetweenLines(),r=i.getNumLines(),h=[];return e.forEach(e=>{const c=e.indexOf(r)>-1,l=e.indexOf(1)>-1;if(n&&l||o&&c)return;1===e.length&&e.push(e[0]);const d=[];e.forEach((e,n,o)=>{const h=1===e,c=e===r;let l=i.getYForLine(e-1);0!==n||h?n!==o.length-1||c||(l+=a/2-1):l-=a/2-1,d.push(l),1===s&&h?d.push(t-2):-1===s&&c&&d.push(t+2)}),h.push(d.sort((t,e)=>t-e))}),h}(e,s,this.checkStave(),this.getStemDirection());i.setLineWidth(at.WIDTH),n.forEach(e=>{0!==e.length&&(i.beginPath(),i.moveTo(t,e[0]),i.lineTo(t,e[e.length-1]),i.stroke(),i.closePath())})}}drawPositions(){const t=this.checkContext(),e=this.getAbsoluteX(),i=this.ys;for(let s=0;s<this.positions.length;++s){const n=i[s]+this.renderOptions.yShift,o=this.fretElement[s],a=e-o.getWidth()/2;t.clearRect(a-2,n-3,o.getWidth()+4,6),o.renderText(t,a,n)}}draw(){const t=this.checkContext();if(0===this.ys.length)throw new p("NoYValues","Can't draw note without Y values.");this.setRendered();const e=void 0===this.beam&&this.renderOptions.drawStem,i=this.getAttribute("class");if(t.openGroup("tabnote"+(i?" "+i:""),this.getAttribute("id")),this.drawPositions(),this.drawStemThrough(),this.stem&&e){const e=this.getStemX();this.stem.setNoteHeadXBounds(e,e),this.stem.setContext(t).drawWithStyle()}this.drawFlag(),this.drawModifiers(),this.drawPointerRect(),t.closeGroup()}}class xi extends ti{static get CATEGORY(){return"TabStave"}constructor(t,e,i,s){super(t,e,i,Object.assign({spacingBetweenLinesPx:13,numLines:6,topTextPosition:1},s))}getYForGlyphs(){return this.getYForLine(2.5)}addTabGlyph(){return this.addClef("tab"),this}}var wi;!function(t){t[t.TOP=1]="TOP",t[t.BOTTOM=-1]="BOTTOM"}(wi||(wi={}));class bi extends P{static get CATEGORY(){return"TextBracket"}static get Position(){return wi}static get PositionString(){return{top:wi.TOP,bottom:wi.BOTTOM}}constructor({start:t,stop:e,text:i="",superscript:s="",position:n=wi.TOP}){super(),this.start=t,this.stop=e,this.textElement=new P("TextBracket"),this.textElement.setText(i),this.superscriptElement=new P("TextBracket"),this.superscriptElement.setText(s);const o=A.scaleSize(this.fontInfo.size,.714286);this.superscriptElement.setFontSize(o),this.position="string"==typeof n?bi.PositionString[n]:n,this.line=1,this.renderOptions={dashed:!0,dash:[5],lineWidth:1,showBracket:!0,bracketHeight:8,underlineSuperscript:!0}}applyStyle(t){this.textElement.setFont(this.fontInfo);const{family:e,size:i,weight:s,style:n}=this.fontInfo,o=A.scaleSize(i,.714286);this.superscriptElement.setFont(e,o,s,n);const a=this.renderOptions;return void 0!==a.color&&(t.setStrokeStyle(a.color),t.setFillStyle(a.color)),t.setLineWidth(a.lineWidth),super.applyStyle(t)}setDashed(t,e){return this.renderOptions.dashed=t,e&&(this.renderOptions.dash=e),this}setLine(t){return this.line=t,this}draw(){const t=this.checkContext();this.setRendered();let e=0;switch(this.position){case wi.TOP:e=this.start.checkStave().getYForTopText(this.line);break;case wi.BOTTOM:e=this.start.checkStave().getYForBottomText(this.line+K.TEXT_HEIGHT_OFFSET_HACK);break;default:throw new p("InvalidPosition",`The position ${this.position} is invalid.`)}const i={x:this.start.getAbsoluteX(),y:e},s={x:this.stop.getAbsoluteX(),y:e};!function(...t){bi.DEBUG&&S("VexFlow.TextBracket",t)}("Rendering TextBracket: start:",i,"stop:",s,"y:",e);const n=this.renderOptions.bracketHeight*this.position;this.textElement.renderText(t,i.x,i.y);const o=this.textElement.getWidth(),a=this.textElement.getHeight(),r=i.y-a/2.5;this.superscriptElement.renderText(t,i.x+o+1,r);const h=this.superscriptElement.getWidth(),c=this.superscriptElement.getHeight();let l=i.x,d=r;const u=s.x+this.stop.getGlyphWidth();this.position===wi.TOP?(l+=o+h+5,d-=c/2.7):this.position===wi.BOTTOM&&(d+=c/2.7,l+=o+2,this.renderOptions.underlineSuperscript||(l+=h)),this.renderOptions.dashed?(We.drawDashedLine(t,l,d,u,d,this.renderOptions.dash),this.renderOptions.showBracket&&We.drawDashedLine(t,u,d+1*this.position,u,d+n,this.renderOptions.dash)):(t.beginPath(),t.moveTo(l,d),t.lineTo(u,d),this.renderOptions.showBracket&&t.lineTo(u,d+n),t.stroke(),t.closePath())}}function yi(...t){ki.DEBUG&&S("VexFlow.TextDynamics",t)}bi.DEBUG=!1;class ki extends yt{static get CATEGORY(){return"TextDynamics"}static get GLYPHS(){return{f:I.dynamicForte,p:I.dynamicPiano,m:I.dynamicMezzo,s:I.dynamicSforzando,z:I.dynamicZ,r:I.dynamicRinforzando}}constructor(t){var e,i;super(t),this.sequence=(null!==(e=t.text)&&void 0!==e?e:"").toLowerCase(),this.line=null!==(i=t.line)&&void 0!==i?i:0,this.text="",yi("New Dynamics Text: ",this.sequence)}setLine(t){return this.line=t,this}preFormat(){return this.text="",this.sequence.split("").forEach(t=>{const e=ki.GLYPHS[t];if(!e)throw new p("Invalid dynamics character: "+t);this.text+=e}),this.preFormatted=!0,this}getBoundingBox(){const t=this.getTextMetrics();return new D(this.getAbsoluteX()+this.x+this.xShift,this.checkStave().getYForLine(this.line-3)+this.y+this.yShift-t.actualBoundingBoxAscent,this.getWidth(),this.getHeight())}draw(){this.setRendered();const t=this.getAbsoluteX(),e=this.checkStave().getYForLine(this.line+-3);yi("Rendering Dynamics: ",this.sequence),this.renderText(this.checkContext(),t,e)}}ki.DEBUG=!1;class vi extends yt{static get CATEGORY(){return"TimeSigNote"}constructor(t,e){super({duration:"b"}),this.timeSig=new Qe(t,e),this.setWidth(this.timeSig.getWidth()),this.ignoreTicks=!0}addToModifierContext(t){return this}preFormat(){return this.preFormatted=!0,this}draw(){const t=this.checkStave(),e=this.checkContext();this.setRendered();const i=this.getAttribute("class");e.openGroup("timesignote"+(i?" "+i:""),this.getAttribute("id")),this.timeSig.drawAt(e,t,this.getAbsoluteX()),this.drawPointerRect(),e.closeGroup()}}class Bi extends P{static get CATEGORY(){return"Tuplet"}static get LOCATION_TOP(){return 1}static get LOCATION_BOTTOM(){return-1}static get NESTING_OFFSET(){return 15}constructor(t,e={}){if(super(),!t||!t.length)throw new p("BadArguments","No notes provided for tuplet.");this.notes=t;const i=void 0!==e.numNotes?e.numNotes:t.length,s=e.notesOccupied||2,n=void 0!==e.bracketed?e.bracketed:t.some(t=>!t.hasBeam()),o=void 0!==e.ratioed?e.ratioed:Math.abs(s-i)>1,a=e.location||Bi.LOCATION_TOP,r=e.yOffset||B.get("Tuplet.yOffset"),h=e.textYOffset||B.get("Tuplet.textYOffset"),c=e.suffix||"";this.options={bracketed:n,location:a,notesOccupied:s,numNotes:i,ratioed:o,yOffset:r,textYOffset:h,suffix:c},this.textElement=new P("Tuplet"),this.suffixElement=new P("Tuplet.suffix"),this.setTupletLocation(a||Bi.LOCATION_TOP),ni.AlignRestsToNotes(t,!0,!0),this.resolveGlyphs(),this.attach()}attach(){for(let t=0;t<this.notes.length;t++){const e=this.notes[t];e.getTupletStack().includes(this)||e.addTuplet(this)}}detach(){for(let t=0;t<this.notes.length;t++){this.notes[t].removeTuplet(this)}}setBracketed(t){return this.options.bracketed=t,this}setRatioed(t){return this.options.ratioed=t,this}setTupletLocation(t){return t!==Bi.LOCATION_TOP&&t!==Bi.LOCATION_BOTTOM&&(console.warn(`Invalid tuplet location [${t}]. Using Tuplet.LOCATION_TOP.`),t=Bi.LOCATION_TOP),this.options.location=t,this}getNotes(){return this.notes}getNoteCount(){return this.options.numNotes}getNotesOccupied(){return this.options.notesOccupied}setNotesOccupied(t){this.detach(),this.options.notesOccupied=t,this.resolveGlyphs(),this.attach()}resolveGlyphs(){let t="",e="",i=this.options.numNotes;for(;i>=1;)t=String.fromCharCode(59520+i%10)+t,i=Math.floor(i/10);if(this.options.ratioed){for(i=this.options.notesOccupied;i>=1;)e=String.fromCharCode(59520+i%10)+e,i=Math.floor(i/10);e=I.tupletColon+e}this.textElement.setText(t+e),this.options.suffix&&this.suffixElement.setText(this.options.suffix)}getNestedTupletCount(){const{location:t}=this.options;let e=0;for(const i of this.notes){const s=i.getTupletStack().filter(e=>e.options.location===t).indexOf(this);s>=0&&s>e&&(e=s)}return e}getYPosition(){var t;const e=this.getNestedTupletCount()*Bi.NESTING_OFFSET*-this.options.location,i=null!==(t=this.options.yOffset)&&void 0!==t?t:0,s=this.notes[0];let n;if(this.options.location===Bi.LOCATION_TOP){n=s.checkStave().getYForLine(0)-1.5*K.STAVE_LINE_DISTANCE;for(let t=0;t<this.notes.length;++t){const e=this.notes[t];let i=0;const s=e.getModifierContext();s&&(i=Math.max(i,s.getState().topTextLine));const o=e.getYForTopText(i)-2*K.STAVE_LINE_DISTANCE;if(e.hasStem()||e.isRest()){const t=e.getStemDirection()===at.UP?e.getStemExtents().topY-K.STAVE_LINE_DISTANCE:e.getStemExtents().baseY-2*K.STAVE_LINE_DISTANCE;n=Math.min(t,n),i>0&&(n=Math.min(o,n))}}}else{let t=4;this.notes.forEach(e=>{const i=e.getModifierContext();i&&(t=Math.max(t,i.getState().textLine+1))}),n=s.checkStave().getYForLine(t)+2*K.STAVE_LINE_DISTANCE;for(let t=0;t<this.notes.length;++t)if(this.notes[t].hasStem()||this.notes[t].isRest()){const e=this.notes[t].getStemDirection()===at.UP?this.notes[t].getStemExtents().baseY+2*K.STAVE_LINE_DISTANCE:this.notes[t].getStemExtents().topY+K.STAVE_LINE_DISTANCE;e>n&&(n=e)}}return n+e+i}draw(){const{location:t,bracketed:e,textYOffset:i,suffix:s}=this.options,n=B.get("Tuplet.bracket.padding"),o=B.get("Tuplet.bracket.lineWidth"),a=B.get("Tuplet.bracket.legLength"),r=B.get("Tuplet.suffix.extraSpacing"),h=B.get("Tuplet.suffix.suffixOffsetY"),c=this.checkContext();let l=0,d=0;const u=this.notes[0],g=this.notes[this.notes.length-1];let p=0;e?(l=u.getTieLeftX()-n,p=g.getTieRightX()-l+n,this.setWidth(p+o)):(l=u.getStemX(),p=g.getStemX()-l,this.setWidth(p)),this.setX(l),d=this.getYPosition(),this.setY(1===t?d:d-a+o),this.height=a;const m=this.textElement.getWidth();let f=m,S=0;s&&(S=this.suffixElement.getWidth(),f=m+r+S);const T=l+p/2-f/2,x=d+this.textElement.getHeight()/2+(t===Bi.LOCATION_TOP?-1:1)*i,w=this.getAttribute("class");if(c.openGroup("tuplet"+(w?" "+w:""),this.getAttribute("id")),e){const e=p/2-f/2-n,i=t===Bi.LOCATION_BOTTOM;e>0&&(c.fillRect(l,d,e,o),c.fillRect(l+p/2+f/2+n,d,e,o),c.fillRect(l,d+(i?1:0),o,t*a),c.fillRect(l+p,d+(i?1:0),o,t*a))}let b=T;if(this.textElement.setX(b),this.textElement.setY(x),this.textElement.renderText(c,0,0),b+=m+r,s){const t=x+h;this.suffixElement.setX(b),this.suffixElement.setY(t),this.suffixElement.renderText(c,0,0),b+=S}this.drawPointerRect(),c.closeGroup(),this.setRendered()}getBoundingBox(){const{bracketed:t,suffix:e}=this.options,i=this.textElement.getBoundingBox(),s=this.suffixElement.getBoundingBox(),n=e?i.mergeWith(s):i;if(!t)return n;return new D(this.x,this.y,this.width,this.height).mergeWith(n)}}class Ci extends P{static get CATEGORY(){return"VibratoBracket"}constructor(t){super(),this.vibrato=new Ue,t.start&&(this.start=t.start),t.stop&&(this.stop=t.stop),this.line=1}setLine(t){return this.line=t,this}setVibratoCode(t){return this.vibrato.setVibratoCode(t),this}draw(){const t=this.checkContext();this.setRendered();const e=this.start&&this.start.checkStave().getYForTopText(this.line)||this.stop&&this.stop.checkStave().getYForTopText(this.line)||0,i=this.start&&this.start.getAbsoluteX()||this.stop&&this.stop.checkStave().getTieStartX()||0,s=this.stop&&this.stop.getAbsoluteX()-this.stop.getWidth()-5||this.start&&this.start.checkStave().getTieEndX()-10||0;this.vibrato.setVibratoWidth(s-i),function(...t){Ci.DEBUG&&S("VexFlow.VibratoBracket",t)}("Rendering VibratoBracket: startX:",i,"stopX:",s,"y:",e),this.vibrato.renderText(t,i,e)}}function Di(...t){Ei.DEBUG&&S("VexFlow.Factory",t)}Ci.DEBUG=!1;class Ei{static newFromElementId(t,e=500,i=200){return new Ei({renderer:{elementId:t,width:e,height:i}})}constructor(t={}){this.retained=!1,this.style={},Di("New factory: ",t),this.options={stave:{space:10},renderer:{elementId:"",width:500,height:200,background:"#FFF"}},this.setOptions(t)}reset(){this.sheets=[],this.retained=!1,this.renderQ=[],this.systems=[],this.staves=[],this.voices=[],this.stave=void 0}setOptions(t){this.options=Object.assign(Object.assign({},this.options),t),this.initRenderer(),this.reset()}initRenderer(){const{elementId:t,width:e,height:i,background:s}=this.options.renderer;if(null===t)return;if(""===t)throw Di(this),new p("renderer.elementId not set in FactoryOptions");let n=this.options.renderer.backend;if(void 0===n){n=Rt(document.getElementById(t))?We.Backends.CANVAS:We.Backends.SVG}this.context=We.buildContext(t,n,e,i,s)}getContext(){return this.context}setContext(t){return this.context=t,this}getStave(){return this.stave}getVoices(){return this.voices}setStyle(t){return this.style=Object.assign({},t),this}Sheet(t={}){const e=new pi(Object.assign(Object.assign({},t),{factory:this}));return this.sheets.push(e),e}Stave(t){const e=this.options.stave.space,i=Object.assign({x:0,y:0,width:this.options.renderer.width-1*e,options:{spacingBetweenLinesPx:1*e}},t),s=new ti(i.x,i.y,i.width,i.options);return this.staves.push(s),s.setContext(this.context),this.stave=s,s}TabStave(t){const e=this.options.stave.space,i=Object.assign({x:0,y:0,width:this.options.renderer.width-1*e,options:{spacingBetweenLinesPx:1.3*e}},t),s=new xi(i.x,i.y,i.width,i.options);return this.staves.push(s),s.setContext(this.context),this.stave=s,s}StaveNote(t){const e=new xe(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}GlyphNote(t,e,i){const s=new ri(t,e,i);return this.stave&&s.setStave(this.stave),s.setContext(this.context),this.renderQ.push(s),s}RepeatNote(t,e,i){const s=new gi(t,e,i);return this.stave&&s.setStave(this.stave),s.setContext(this.context),this.renderQ.push(s),s}GhostNote(t){const e=new ai(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}TextNote(t){const e=new qe(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}BarNote(t={}){const e=new Et(t.type);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}ClefNote(t){const e=Object.assign({type:"treble",options:{size:"default",annotation:void 0}},t),i=new Qt(e.type,e.options.size,e.options.annotation);return this.stave&&i.setStave(this.stave),i.setContext(this.context),this.renderQ.push(i),i}TimeSigNote(t){const e=Object.assign({time:"4/4"},t),i=new vi(e.time);return this.stave&&i.setStave(this.stave),i.setContext(this.context),this.renderQ.push(i),i}KeySigNote(t){const e=new ci(t.key,t.cancelKey,t.alterKey);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}TabNote(t){const e=new Ti(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}GraceNote(t){const e=new hi(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),e}GraceNoteGroup(t){const e=new ve(t.notes,t.slur);return e.setContext(this.context),e}Accidental(t){const e=new ot(t.type);return e.setContext(this.context),e}Annotation(t){const e=Object.assign({text:"p",hJustify:rt.CENTER,vJustify:ht.BOTTOM},t),i=new ct(e.text);return i.setJustification(e.hJustify),i.setVerticalJustification(e.vJustify),i.setFont(e.font),i.setContext(this.context),i}ChordSymbol(t){const e=Object.assign({vJustify:"top",hJustify:"center"},t),i=new Kt;return i.setHorizontal(e.hJustify),i.setVertical(e.vJustify),"string"==typeof e.fontFamily&&"number"==typeof e.fontSize?"string"==typeof e.fontWeight?i.setFont(e.fontFamily,e.fontSize,e.fontWeight):i.setFont(e.fontFamily,e.fontSize,""):"number"==typeof e.fontSize&&i.setFontSize(e.fontSize),i.setContext(this.context),i}Articulation(t){var e;const i=new xt(null!==(e=null==t?void 0:t.type)&&void 0!==e?e:"a.");return void 0!==(null==t?void 0:t.position)&&i.setPosition(t.position),void 0!==(null==t?void 0:t.betweenLines)&&i.setBetweenLines(t.betweenLines),i.setContext(this.context),i}Ornament(t,e){const i=Object.assign({type:t,accidental:""},e),s=new Ce(t);return void 0!==(null==e?void 0:e.position)&&s.setPosition(e.position),i.upperAccidental&&s.setUpperAccidental(i.upperAccidental),i.lowerAccidental&&s.setLowerAccidental(i.lowerAccidental),void 0!==i.delayed&&s.setDelayed(i.delayed),s.setContext(this.context),s}TextDynamics(t){const e=Object.assign({text:"p",duration:"q",dots:0,line:0},t),i=new ki({text:e.text,line:e.line,duration:e.duration,dots:e.dots});return this.stave&&i.setStave(this.stave),i.setContext(this.context),this.renderQ.push(i),i}Fingering(t){const e=Object.assign({number:"0",position:"left"},t),i=new se(e.number);return i.setPosition(e.position),i.setContext(this.context),i}StringNumber(t,e=!0){const i=new He(t.number);return i.setPosition(t.position),i.setContext(this.context),i.setDrawCircle(e),i}TickContext(){return new Jt}ModifierContext(){return new Xe}MultiMeasureRest(t){const e=f(t.numberOfMeasures,"NoNumberOfMeasures"),i=new li(e,t);return i.setContext(this.context),this.renderQ.push(i),i}Voice(t){const e=Object.assign({time:"4/4"},t),i=new ke(e.time);return this.voices.push(i),i}StaveConnector(t){const e=new ii(t.topStave,t.bottomStave);return e.setType(t.type).setContext(this.context),this.renderQ.push(e),e}Formatter(t){return new ni(t)}Tuplet(t){const e=Object.assign({notes:[],options:{}},t),i=new Bi(e.notes,e.options).setContext(this.context);return this.renderQ.push(i),i}Beam(t){var e,i,s,n,o;const a=new At(t.notes,null===(e=t.options)||void 0===e?void 0:e.autoStem).setContext(this.context);return a.breakSecondaryAt(null!==(s=null===(i=t.options)||void 0===i?void 0:i.secondaryBeamBreaks)&&void 0!==s?s:[]),(null===(n=t.options)||void 0===n?void 0:n.partialBeamDirections)&&Object.entries(null===(o=t.options)||void 0===o?void 0:o.partialBeamDirections).forEach(([t,e])=>{a.setPartialBeamSideAt(Number(t),e)}),this.renderQ.push(a),a}Curve(t){const e=new ee(t.from,t.to,t.options).setContext(this.context);return this.renderQ.push(e),e}StaveTie(t){var e;const i=new we({firstNote:t.from,lastNote:t.to,firstIndexes:t.firstIndexes,lastIndexes:t.lastIndexes},t.text);return(null===(e=t.options)||void 0===e?void 0:e.direction)&&i.setDirection(t.options.direction),i.setContext(this.context),this.renderQ.push(i),i}StaveLine(t){var e,i;const s=new fi({firstNote:t.from,lastNote:t.to,firstIndexes:t.firstIndexes,lastIndexes:t.lastIndexes});return(null===(e=t.options)||void 0===e?void 0:e.text)&&s.setText(t.options.text),(null===(i=t.options)||void 0===i?void 0:i.font)&&s.setFont(t.options.font),s.setContext(this.context),this.renderQ.push(s),s}VibratoBracket(t){const e=new Ci({start:t.from,stop:t.to});return t.options.line&&e.setLine(t.options.line),t.options.code&&e.setVibratoCode(t.options.code),e.setContext(this.context),this.renderQ.push(e),e}TextBracket(t){const e=new bi({start:t.from,stop:t.to,text:t.text,superscript:t.options.superscript,position:t.options.position});return t.options.line&&e.setLine(t.options.line),t.options.font&&e.setFont(t.options.font),e.setContext(this.context),this.renderQ.push(e),e}System(t={}){t.factory=this;const e=new Si(t).setContext(this.context);return this.systems.push(e),e}EasyScore(t={}){return t.factory=this,new pe(t)}PedalMarking(t){const e=Object.assign({notes:[],options:{style:"mixed"}},t),i=new di(e.notes);return i.setType(di.typeString[e.options.style]),i.setContext(this.context),this.renderQ.push(i),i}NoteSubGroup(t){const e=Object.assign({notes:[]},t),i=new Be(e.notes);return i.setContext(this.context),i}draw(t={}){var e;const i=this.context;this.sheets.forEach(t=>t.format());const s=new Set(this.sheets.flatMap(t=>t.getSystems()));this.systems.forEach(t=>{s.has(t)||t.setContext(i).format()});const n=i.getDefaultStyle();i.save(),i.setDefaultStyle(this.style),void 0!==this.style.fillStyle&&i.setFillStyle(this.style.fillStyle),void 0!==this.style.strokeStyle&&i.setStrokeStyle(this.style.strokeStyle),this.retained&&this.renderQ.forEach(t=>t.setRendered(!1));try{this.staves.forEach(t=>t.setContext(i).drawWithStyle()),this.voices.forEach(t=>t.setContext(i).drawWithStyle()),this.renderQ.forEach(t=>{t.isRendered()||t.setContext(i).drawWithStyle()}),this.systems.forEach(t=>t.setContext(i).drawWithStyle())}finally{i.setDefaultStyle(n),i.restore()}this.retained=null!==(e=t.retain)&&void 0!==e&&e,t.retain||this.reset()}}Ei.DEBUG=!1;class Li extends P{static get CATEGORY(){return"StaveHairpin"}static FormatByTicksAndDraw(t,e,i,s,n,o){var a,r;const h=e.pixelsPerTick;if(null===h)throw new p("BadArguments","A valid Formatter must be provide to draw offsets by ticks.");const c=h*(null!==(a=o.leftShiftTicks)&&void 0!==a?a:0),l=h*(null!==(r=o.rightShiftTicks)&&void 0!==r?r:0),d={height:o.height,yShift:o.yShift,leftShiftPx:c,rightShiftPx:l,rightShiftTicks:0,leftShiftTicks:0};new Li({firstNote:i.firstNote,lastNote:i.lastNote},s).setContext(t).setRenderOptions(d).setPosition(n).drawWithStyle()}constructor(t,e){super(),this.setNotes(t),this.hairpin=e,this.position=W.Position.BELOW,this.renderOptions={height:10,yShift:0,leftShiftPx:0,rightShiftPx:0,rightShiftTicks:0,leftShiftTicks:0}}setPosition(t){return t!==W.Position.ABOVE&&t!==W.Position.BELOW||(this.position=t),this}setRenderOptions(t){return this.renderOptions=t,this}setNotes(t){if(!t.firstNote&&!t.lastNote)throw new p("BadArguments","Hairpin needs to have either firstNote or lastNote set.");return this.notes=t,this.firstNote=t.firstNote,this.lastNote=t.lastNote,this}renderHairpin(t){const e=this.checkContext();let i=this.renderOptions.yShift+20,s=t.firstY;this.position===W.Position.ABOVE&&(i=30-i,s=t.firstY-t.staffHeight);const n=this.renderOptions.leftShiftPx,o=this.renderOptions.rightShiftPx;switch(e.beginPath(),this.hairpin){case Li.type.CRESC:e.moveTo(t.lastX+o,s+i),e.lineTo(t.firstX+n,s+this.renderOptions.height/2+i),e.lineTo(t.lastX+o,s+this.renderOptions.height+i);break;case Li.type.DECRESC:e.moveTo(t.firstX+n,s+i),e.lineTo(t.lastX+o,s+this.renderOptions.height/2+i),e.lineTo(t.firstX+n,s+this.renderOptions.height+i)}e.stroke(),e.closePath()}draw(){this.checkContext(),this.setRendered();const t=this.firstNote,e=this.lastNote;if(!t||!e)throw new p("NoNote","Notes required to draw");const i=t.getModifierStartXY(this.position,0),s=e.getModifierStartXY(this.position,0);this.renderHairpin({firstX:i.x,lastX:s.x,firstY:t.checkStave().getY()+t.checkStave().getHeight(),lastY:e.checkStave().getY()+e.checkStave().getHeight(),staffHeight:t.checkStave().getHeight()})}}Li.type={CRESC:1,DECRESC:2};class Ni extends be{static get CATEGORY(){return"TabSlide"}static get SLIDE_UP(){return 1}static get SLIDE_DOWN(){return-1}static createSlideUp(t){return new Ni(t,Ni.SLIDE_UP)}static createSlideDown(t){return new Ni(t,Ni.SLIDE_DOWN)}constructor(t,e){if(super(t,"sl."),!e){let i=t.firstNote.getPositions()[0].fret;"string"==typeof i&&(i=parseInt(i,10));let s=t.lastNote.getPositions()[0].fret;"string"==typeof s&&(s=parseInt(s,10)),e=isNaN(i)||isNaN(s)?Ni.SLIDE_UP:i>s?Ni.SLIDE_DOWN:Ni.SLIDE_UP}this.direction=e,this.renderOptions.cp1=11,this.renderOptions.cp2=14,this.renderOptions.yShift=.5}renderTie(t){if(0===t.firstYs.length||0===t.lastYs.length)throw new p("BadArguments","No Y-values to render");const e=this.checkContext(),i=t.firstX,s=t.firstYs,n=t.lastX,o=t.direction;if(o!==Ni.SLIDE_UP&&o!==Ni.SLIDE_DOWN)throw new p("BadSlide","Invalid slide direction");const a=this.notes.firstIndexes;for(let t=0;t<a.length;++t){const r=s[a[t]]+this.renderOptions.yShift;if(isNaN(r))throw new p("BadArguments","Bad indexes for slide rendering.");e.beginPath(),e.moveTo(i,r+3*o),e.lineTo(n,r-3*o),e.closePath(),e.stroke()}this.setRendered()}}class Fi{static get names(){return{standard:"E/5,B/4,G/4,D/4,A/3,E/3",dagdad:"D/5,A/4,G/4,D/4,A/3,D/3",dropd:"E/5,B/4,G/4,D/4,A/3,D/3",eb:"Eb/5,Bb/4,Gb/4,Db/4,Ab/3,Db/3",standardBanjo:"D/5,B/4,G/4,D/4,G/5"}}constructor(t="E/5,B/4,G/4,D/4,A/3,E/3,B/2,E/2"){this.tuningValues=[],this.setTuning(t)}noteToInteger(t){var e;return null!==(e=K.keyProperties(t).intValue)&&void 0!==e?e:-1}setTuning(t){Object.prototype.hasOwnProperty.call(Fi.names,t)&&(t=Fi.names[t]),this.tuningValues=[];const e=t.split(",").map(t=>t.trim());if(0===e.length)throw new p("BadArguments",`Invalid tuning string: ${t}`);for(let t=0;t<e.length;++t)this.tuningValues[t]=this.noteToInteger(e[t])}getValueForString(t){const e=Number(t);if(e<1||e>this.tuningValues.length)throw new p("BadArguments",`String number must be between 1 and ${this.tuningValues.length}:${t}`);return this.tuningValues[e-1]}getValueForFret(t,e){const i=this.getValueForString(e),s=Number(t);if(s<0)throw new p("BadArguments",`Fret number must be 0 or higher: ${t}`);return i+s}getNoteForFret(t,e){const i=this.getValueForFret(t,e),s=Math.floor(i/12),n=i%12;return`${K.integerToNote(n)}/${s}`}}var Ai=function(t,e,i,s){return new(i||(i=Promise))(function(n,o){function a(t){try{h(s.next(t))}catch(t){o(t)}}function r(t){try{h(s.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(a,r)}h((s=s.apply(t,e||[])).next())})};class Oi{static loadFonts(...t){return Ai(this,void 0,void 0,function*(){t||(t=Object.keys(A.FILES));const e=[];for(const i of t)e.push(A.load(i));yield Promise.all(e)})}static setFonts(...t){const e=t.flatMap(t=>t.split(",").map(t=>t.trim())).filter(Boolean);C.fontFamily=e.join(",");const i=e.filter(t=>A.TEXT_FONT_NAMES.includes(t));Oi.setTextFonts(...i.length?i:["Academico"])}static setTextFonts(...t){C.textFontFamily=[...new Set([...t,...Oi.getFonts()])].join(","),B.clear()}static getTextFonts(){return B.get("textFontFamily").split(",")}static getFonts(){return B.get("fontFamily").split(",")}static get RENDER_PRECISION_PLACES(){return K.RENDER_PRECISION_PLACES}static set RENDER_PRECISION_PLACES(t){K.RENDER_PRECISION_PLACES=t}static get SOFTMAX_FACTOR(){return K.SOFTMAX_FACTOR}static set SOFTMAX_FACTOR(t){K.SOFTMAX_FACTOR=t}static get UNISON(){return K.UNISON}static set UNISON(t){K.UNISON=t}static get NOTATION_FONT_SCALE(){return K.NOTATION_FONT_SCALE}static set NOTATION_FONT_SCALE(t){K.NOTATION_FONT_SCALE=t}static get TABLATURE_FONT_SCALE(){return K.TABLATURE_FONT_SCALE}static set TABLATURE_FONT_SCALE(t){K.TABLATURE_FONT_SCALE=t}static get RESOLUTION(){return K.RESOLUTION}static set RESOLUTION(t){K.RESOLUTION=t}static get SLASH_NOTEHEAD_WIDTH(){return K.SLASH_NOTEHEAD_WIDTH}static set SLASH_NOTEHEAD_WIDTH(t){K.SLASH_NOTEHEAD_WIDTH=t}static get STAVE_LINE_DISTANCE(){return K.STAVE_LINE_DISTANCE}static set STAVE_LINE_DISTANCE(t){K.STAVE_LINE_DISTANCE=t}static get STAVE_LINE_THICKNESS(){return C.Stave.lineWidth}static set STAVE_LINE_THICKNESS(t){C.Stave.lineWidth=t,C.TabStave.lineWidth=t,B.clear("Stave"),B.clear("TabStave")}static get STEM_HEIGHT(){return K.STEM_HEIGHT}static set STEM_HEIGHT(t){K.STEM_HEIGHT=t}static get STEM_WIDTH(){return K.STEM_WIDTH}static set STEM_WIDTH(t){K.STEM_WIDTH=t}static get TIME4_4(){return K.TIME4_4}static get unicode(){return K.unicode}static keySignature(t){return K.keySignature(t)}static hasKeySignature(t){return K.hasKeySignature(t)}static getKeySignatures(){return K.getKeySignatures()}static clefProperties(t){return K.clefProperties(t)}static keyProperties(t,e,i){return K.keyProperties(t,e,i)}static durationToTicks(t){return K.durationToTicks(t)}}Oi.BUILD={VERSION:"5.1.2",ID:"419436ad3c5fb5efeb2590a6a88b2a403cbdae64",DATE:"2026-11-16T14:50:27.719Z",INFO:""},Oi.Accidental=ot,Oi.Annotation=ct,Oi.Articulation=xt,Oi.Barline=Dt,Oi.BarNote=Et,Oi.Beam=At,Oi.Bend=Ot,Oi.BoundingBox=D,Oi.CanvasContext=Pt,Oi.ChordSymbol=Kt,Oi.Clef=$t,Oi.ClefNote=Qt,Oi.Crescendo=Zt,Oi.Curve=ee,Oi.Dot=ie,Oi.EasyScore=pe,Oi.Element=P,Oi.Factory=Ei,Oi.Font=A,Oi.Formatter=ni,Oi.Fraction=y,Oi.FretHandFinger=se,Oi.GhostNote=ai,Oi.GlyphNote=ri,Oi.GraceNote=hi,Oi.GraceNoteGroup=ve,Oi.GraceTabNote=class extends Ti{static get CATEGORY(){return"GraceTabNote"}constructor(t){super(t,!1),this.renderOptions=Object.assign(Object.assign({},this.renderOptions),{yShift:.3}),this.updateWidth()}},Oi.KeyManager=class{constructor(t){this.music=new H,this.setKey(t)}setKey(t){return this.key=t,this.reset(),this}getKey(){return this.key}reset(){this.keyParts=this.music.getKeyParts(this.key),this.keyString=this.keyParts.root,this.keyParts.accidental&&(this.keyString+=this.keyParts.accidental);if(!H.scaleTypes[this.keyParts.type])throw new p("BadArguments",`Unsupported key type: ${this.key}`);this.scale=this.music.getScaleTones(this.music.getNoteValue(this.keyString),H.scaleTypes[this.keyParts.type]),this.scaleMap={},this.scaleMapByValue={},this.originalScaleMapByValue={};const t=H.rootIndexes[this.keyParts.root];for(let e=0;e<H.roots.length;++e){const i=(t+e)%H.roots.length,s=H.roots[i],n=this.music.getRelativeNoteName(s,this.scale[e]);this.scaleMap[s]=n,this.scaleMapByValue[this.scale[e]]=n,this.originalScaleMapByValue[this.scale[e]]=n}return this}getAccidental(t){const e=this.music.getKeyParts(t).root,i=this.music.getNoteParts(this.scaleMap[e]);return{note:this.scaleMap[e],accidental:i.accidental}}selectNote(t){t=t.toLowerCase();const e=this.music.getNoteParts(t),i=this.scaleMap[e.root],s=this.music.getNoteParts(i);if(i===t)return{note:i,accidental:e.accidental,change:!1};const n=this.scaleMapByValue[this.music.getNoteValue(t)];if(void 0!==n)return{note:n,accidental:this.music.getNoteParts(n).accidental,change:!1};const o=this.originalScaleMapByValue[this.music.getNoteValue(t)];return void 0!==o?(this.scaleMap[s.root]=o,delete this.scaleMapByValue[this.music.getNoteValue(i)],this.scaleMapByValue[this.music.getNoteValue(t)]=o,{note:o,accidental:this.music.getNoteParts(o).accidental,change:!0}):s.root===t?(delete this.scaleMapByValue[this.music.getNoteValue(this.scaleMap[e.root])],this.scaleMapByValue[this.music.getNoteValue(s.root)]=s.root,this.scaleMap[s.root]=s.root,{note:s.root,accidental:void 0,change:!0}):(delete this.scaleMapByValue[this.music.getNoteValue(this.scaleMap[e.root])],this.scaleMapByValue[this.music.getNoteValue(t)]=t,delete this.scaleMap[s.root],this.scaleMap[s.root]=t,{note:t,accidental:e.accidental,change:!0})}},Oi.KeySignature=Ye,Oi.KeySigNote=ci,Oi.Modifier=W,Oi.ModifierContext=Xe,Oi.MultiMeasureRest=li,Oi.Music=H,Oi.Note=yt,Oi.NoteHead=me,Oi.NoteSubGroup=Be,Oi.Ornament=Ce,Oi.Parenthesis=De,Oi.Parser=ae,Oi.PedalMarking=di,Oi.Registry=R,Oi.RenderContext=wt,Oi.Renderer=We,Oi.RepeatNote=gi,Oi.Repetition=_e,Oi.Stave=ti,Oi.StaveConnector=ii,Oi.StaveHairpin=Li,Oi.StaveLine=fi,Oi.StaveModifier=Ct,Oi.StaveNote=xe,Oi.StaveTempo=je,Oi.StaveText=Ke,Oi.StaveTie=we,Oi.Stem=at,Oi.StringNumber=He,Oi.Stroke=Ge,Oi.SVGContext=Oe,Oi.System=Si,Oi.Sheet=pi,Oi.TabNote=Ti,Oi.TabSlide=Ni,Oi.TabStave=xi,Oi.TabTie=be,Oi.TextBracket=bi,Oi.TextDynamics=ki,Oi.TextNote=qe,Oi.TickContext=Jt,Oi.TimeSignature=Qe,Oi.TimeSigNote=vi,Oi.Tremolo=class extends W{static get CATEGORY(){return"Tremolo"}constructor(t){super(),this.num=t,this.position=W.Position.CENTER,this.text=I.tremolo1}draw(){const t=this.checkContext(),e=this.checkAttachedNote();this.setRendered();const i=e.getStemDirection(),s=e.getFontScale(),n=B.get("Tremolo.spacing")*i*s,o=e.getAbsoluteX()+(i===at.UP?e.getGlyphWidth()-at.WIDTH/2:at.WIDTH/2);let a=e.getStemExtents().topY+(this.num<=3?n:0);this.fontInfo.size=B.get("Tremolo.fontSize")*s;for(let e=0;e<this.num;++e)this.renderText(t,o,a),a+=n}},Oi.Tuning=Fi,Oi.Tuplet=Bi,Oi.Vibrato=Ue,Oi.VibratoBracket=Ci,Oi.Voice=ke,Oi.Volta=$e,Oi.RuntimeError=p,Oi.Test=void 0,Oi.AnnotationHorizontalJustify=rt,Oi.AnnotationVerticalJustify=ht,Oi.ChordSymbolHorizontalJustify=_t,Oi.ChordSymbolVerticalJustify=zt,Oi.SymbolModifiers=jt,Oi.CurvePosition=qt,Oi.FontWeight=E,Oi.FontStyle=L,Oi.Glyphs=I,Oi.ModifierPosition=M,Oi.RendererBackends=Re,Oi.RendererLineEndType=Pe,Oi.BarlineType=vt,Oi.RepeatBracketType=Bt,Oi.StaveModifierPosition=kt,Oi.VoltaType=Ie,Oi.TextBracketPosition=wi,Oi.TextJustification=Me,Oi.VoiceMode=ye,Oi.BUILD.INFO="vexflow-core";const Ri=Oi;return e=e.default,e})());
6
6
  //# sourceMappingURL=vexflow-core.js.map