vendor.e484ff32.js 1.2 MB

123456789
  1. var t=Object.assign;function e(t,e){const i=Object.create(null),n=t.split(",");for(let s=0;s<n.length;s++)i[n[s]]=!0;return e?t=>!!i[t.toLowerCase()]:t=>!!i[t]}const i=e("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt"),n=e("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function s(t){if(E(t)){const e={};for(let i=0;i<t.length;i++){const n=t[i],r=s(T(n)?a(n):n);if(r)for(const t in r)e[t]=r[t]}return e}if(P(t))return t}const r=/;(?![^(]*\))/g,o=/:(.+)/;function a(t){const e={};return t.split(r).forEach((t=>{if(t){const i=t.split(o);i.length>1&&(e[i[0].trim()]=i[1].trim())}})),e}function l(t){let e="";if(T(t))e=t;else if(E(t))for(let i=0;i<t.length;i++){const n=l(t[i]);n&&(e+=n+" ")}else if(P(t))for(const i in t)t[i]&&(e+=i+" ");return e.trim()}const h=e("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"),c=e("svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"),u=Object.freeze({}),d=Object.freeze([]),f=()=>{},p=()=>!1,m=/^on[^a-z]/,b=t=>m.test(t),g=t=>t.startsWith("onUpdate:"),y=Object.assign,S=(t,e)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)},v=Object.prototype.hasOwnProperty,x=(t,e)=>v.call(t,e),E=Array.isArray,_=t=>"[object Map]"===C(t),w=t=>"function"==typeof t,T=t=>"string"==typeof t,M=t=>"symbol"==typeof t,P=t=>null!==t&&"object"==typeof t,L=t=>P(t)&&w(t.then)&&w(t.catch),A=Object.prototype.toString,C=t=>A.call(t),I=t=>C(t).slice(8,-1),R=t=>T(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,N=e(",key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),F=t=>{const e=Object.create(null);return i=>e[i]||(e[i]=t(i))},B=/-(\w)/g,O=F((t=>t.replace(B,((t,e)=>e?e.toUpperCase():"")))),D=/\B([A-Z])/g,k=F((t=>t.replace(D,"-$1").toLowerCase())),V=F((t=>t.charAt(0).toUpperCase()+t.slice(1))),G=F((t=>t?`on${V(t)}`:"")),W=(t,e)=>t!==e&&(t==t||e==e),U=(t,e)=>{for(let i=0;i<t.length;i++)t[i](e)},z=(t,e,i)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:i})},j=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let H;const X=new WeakMap,Y=[];let K;const q=Symbol("iterate"),$=Symbol("Map key iterate");function J(t,e=u){(function(t){return t&&!0===t._isEffect})(t)&&(t=t.raw);const i=function(t,e){const i=function(){if(!i.active)return e.scheduler?void 0:t();if(!Y.includes(i)){tt(i);try{return it.push(et),et=!0,Y.push(i),K=i,t()}finally{Y.pop(),st(),K=Y[Y.length-1]}}};return i.id=Q++,i.allowRecurse=!!e.allowRecurse,i._isEffect=!0,i.active=!0,i.raw=t,i.deps=[],i.options=e,i}(t,e);return e.lazy||i(),i}function Z(t){t.active&&(tt(t),t.options.onStop&&t.options.onStop(),t.active=!1)}let Q=0;function tt(t){const{deps:e}=t;if(e.length){for(let i=0;i<e.length;i++)e[i].delete(t);e.length=0}}let et=!0;const it=[];function nt(){it.push(et),et=!1}function st(){const t=it.pop();et=void 0===t||t}function rt(t,e,i){if(!et||void 0===K)return;let n=X.get(t);n||X.set(t,n=new Map);let s=n.get(i);s||n.set(i,s=new Set),s.has(K)||(s.add(K),K.deps.push(s),K.options.onTrack&&K.options.onTrack({effect:K,target:t,type:e,key:i}))}function ot(t,e,i,n,s,r){const o=X.get(t);if(!o)return;const a=new Set,l=t=>{t&&t.forEach((t=>{(t!==K||t.allowRecurse)&&a.add(t)}))};if("clear"===e)o.forEach(l);else if("length"===i&&E(t))o.forEach(((t,e)=>{("length"===e||e>=n)&&l(t)}));else switch(void 0!==i&&l(o.get(i)),e){case"add":E(t)?R(i)&&l(o.get("length")):(l(o.get(q)),_(t)&&l(o.get($)));break;case"delete":E(t)||(l(o.get(q)),_(t)&&l(o.get($)));break;case"set":_(t)&&l(o.get(q))}a.forEach((o=>{o.options.onTrigger&&o.options.onTrigger({effect:o,target:t,key:i,type:e,newValue:n,oldValue:s,oldTarget:r}),o.options.scheduler?o.options.scheduler(o):o()}))}const at=e("__proto__,__v_isRef,__isVue"),lt=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter(M)),ht=pt(),ct=pt(!1,!0),ut=pt(!0),dt=pt(!0,!0),ft={};function pt(t=!1,e=!1){return function(i,n,s){if("__v_isReactive"===n)return!t;if("__v_isReadonly"===n)return t;if("__v_raw"===n&&s===(t?zt:Ut).get(i))return i;const r=E(i);if(!t&&r&&x(ft,n))return Reflect.get(ft,n,s);const o=Reflect.get(i,n,s);if(M(n)?lt.has(n):at(n))return o;if(t||rt(i,"get",n),e)return o;if(Qt(o)){return!r||!R(n)?o.value:o}return P(o)?t?Ht(o):jt(o):o}}["includes","indexOf","lastIndexOf"].forEach((t=>{const e=Array.prototype[t];ft[t]=function(...t){const i=Jt(this);for(let e=0,s=this.length;e<s;e++)rt(i,"get",e+"");const n=e.apply(i,t);return-1===n||!1===n?e.apply(i,t.map(Jt)):n}})),["push","pop","shift","unshift","splice"].forEach((t=>{const e=Array.prototype[t];ft[t]=function(...t){nt();const i=e.apply(this,t);return st(),i}}));function mt(t=!1){return function(e,i,n,s){const r=e[i];if(!t&&(n=Jt(n),!E(e)&&Qt(r)&&!Qt(n)))return r.value=n,!0;const o=E(e)&&R(i)?Number(i)<e.length:x(e,i),a=Reflect.set(e,i,n,s);return e===Jt(s)&&(o?W(n,r)&&ot(e,"set",i,n,r):ot(e,"add",i,n)),a}}const bt={get:ht,set:mt(),deleteProperty:function(t,e){const i=x(t,e),n=t[e],s=Reflect.deleteProperty(t,e);return s&&i&&ot(t,"delete",e,void 0,n),s},has:function(t,e){const i=Reflect.has(t,e);return M(e)&&lt.has(e)||rt(t,"has",e),i},ownKeys:function(t){return rt(t,"iterate",E(t)?"length":q),Reflect.ownKeys(t)}},gt={get:ut,set:(t,e)=>(console.warn(`Set operation on key "${String(e)}" failed: target is readonly.`,t),!0),deleteProperty:(t,e)=>(console.warn(`Delete operation on key "${String(e)}" failed: target is readonly.`,t),!0)},yt=y({},bt,{get:ct,set:mt(!0)}),St=y({},gt,{get:dt}),vt=t=>P(t)?jt(t):t,xt=t=>P(t)?Ht(t):t,Et=t=>t,_t=t=>Reflect.getPrototypeOf(t);function wt(t,e,i=!1,n=!1){const s=Jt(t=t.__v_raw),r=Jt(e);e!==r&&!i&&rt(s,"get",e),!i&&rt(s,"get",r);const{has:o}=_t(s),a=i?xt:n?Et:vt;return o.call(s,e)?a(t.get(e)):o.call(s,r)?a(t.get(r)):void 0}function Tt(t,e=!1){const i=this.__v_raw,n=Jt(i),s=Jt(t);return t!==s&&!e&&rt(n,"has",t),!e&&rt(n,"has",s),t===s?i.has(t):i.has(t)||i.has(s)}function Mt(t,e=!1){return t=t.__v_raw,!e&&rt(Jt(t),"iterate",q),Reflect.get(t,"size",t)}function Pt(t){t=Jt(t);const e=Jt(this),i=_t(e).has.call(e,t);return e.add(t),i||ot(e,"add",t,t),this}function Lt(t,e){e=Jt(e);const i=Jt(this),{has:n,get:s}=_t(i);let r=n.call(i,t);r?Wt(i,n,t):(t=Jt(t),r=n.call(i,t));const o=s.call(i,t);return i.set(t,e),r?W(e,o)&&ot(i,"set",t,e,o):ot(i,"add",t,e),this}function At(t){const e=Jt(this),{has:i,get:n}=_t(e);let s=i.call(e,t);s?Wt(e,i,t):(t=Jt(t),s=i.call(e,t));const r=n?n.call(e,t):void 0,o=e.delete(t);return s&&ot(e,"delete",t,void 0,r),o}function Ct(){const t=Jt(this),e=0!==t.size,i=_(t)?new Map(t):new Set(t),n=t.clear();return e&&ot(t,"clear",void 0,void 0,i),n}function It(t,e){return function(i,n){const s=this,r=s.__v_raw,o=Jt(r),a=t?xt:e?Et:vt;return!t&&rt(o,"iterate",q),r.forEach(((t,e)=>i.call(n,a(t),a(e),s)))}}function Rt(t,e,i){return function(...n){const s=this.__v_raw,r=Jt(s),o=_(r),a="entries"===t||t===Symbol.iterator&&o,l="keys"===t&&o,h=s[t](...n),c=e?xt:i?Et:vt;return!e&&rt(r,"iterate",l?$:q),{next(){const{value:t,done:e}=h.next();return e?{value:t,done:e}:{value:a?[c(t[0]),c(t[1])]:c(t),done:e}},[Symbol.iterator](){return this}}}}function Nt(t){return function(...e){{const i=e[0]?`on key "${e[0]}" `:"";console.warn(`${V(t)} operation ${i}failed: target is readonly.`,Jt(this))}return"delete"!==t&&this}}const Ft={get(t){return wt(this,t)},get size(){return Mt(this)},has:Tt,add:Pt,set:Lt,delete:At,clear:Ct,forEach:It(!1,!1)},Bt={get(t){return wt(this,t,!1,!0)},get size(){return Mt(this)},has:Tt,add:Pt,set:Lt,delete:At,clear:Ct,forEach:It(!1,!0)},Ot={get(t){return wt(this,t,!0)},get size(){return Mt(this,!0)},has(t){return Tt.call(this,t,!0)},add:Nt("add"),set:Nt("set"),delete:Nt("delete"),clear:Nt("clear"),forEach:It(!0,!1)};function Dt(t,e){const i=e?Bt:t?Ot:Ft;return(e,n,s)=>"__v_isReactive"===n?!t:"__v_isReadonly"===n?t:"__v_raw"===n?e:Reflect.get(x(i,n)&&n in e?i:e,n,s)}["keys","values","entries",Symbol.iterator].forEach((t=>{Ft[t]=Rt(t,!1,!1),Ot[t]=Rt(t,!0,!1),Bt[t]=Rt(t,!1,!0)}));const kt={get:Dt(!1,!1)},Vt={get:Dt(!1,!0)},Gt={get:Dt(!0,!1)};function Wt(t,e,i){const n=Jt(i);if(n!==i&&e.call(t,n)){const e=I(t);console.warn(`Reactive ${e} contains both the raw and reactive versions of the same object${"Map"===e?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Ut=new WeakMap,zt=new WeakMap;function jt(t){return t&&t.__v_isReadonly?t:Yt(t,!1,bt,kt)}function Ht(t){return Yt(t,!0,gt,Gt)}function Xt(t){return Yt(t,!0,St,Gt)}function Yt(t,e,i,n){if(!P(t))return console.warn(`value cannot be made reactive: ${String(t)}`),t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const s=e?zt:Ut,r=s.get(t);if(r)return r;const o=(a=t).__v_skip||!Object.isExtensible(a)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(I(a));var a;if(0===o)return t;const l=new Proxy(t,2===o?n:i);return s.set(t,l),l}function Kt(t){return qt(t)?Kt(t.__v_raw):!(!t||!t.__v_isReactive)}function qt(t){return!(!t||!t.__v_isReadonly)}function $t(t){return Kt(t)||qt(t)}function Jt(t){return t&&Jt(t.__v_raw)||t}const Zt=t=>P(t)?jt(t):t;function Qt(t){return Boolean(t&&!0===t.__v_isRef)}function te(t){return function(t,e=!1){if(Qt(t))return t;return new ee(t,e)}(t)}class ee{constructor(t,e=!1){this._rawValue=t,this._shallow=e,this.__v_isRef=!0,this._value=e?t:Zt(t)}get value(){return rt(Jt(this),"get","value"),this._value}set value(t){W(Jt(t),this._rawValue)&&(this._rawValue=t,this._value=this._shallow?t:Zt(t),ot(Jt(this),"set","value",t))}}function ie(t){return Qt(t)?t.value:t}const ne={get:(t,e,i)=>ie(Reflect.get(t,e,i)),set:(t,e,i,n)=>{const s=t[e];return Qt(s)&&!Qt(i)?(s.value=i,!0):Reflect.set(t,e,i,n)}};function se(t){return Kt(t)?t:new Proxy(t,ne)}class re{constructor(t,e){this._object=t,this._key=e,this.__v_isRef=!0}get value(){return this._object[this._key]}set value(t){this._object[this._key]=t}}class oe{constructor(t,e,i){this._setter=e,this._dirty=!0,this.__v_isRef=!0,this.effect=J(t,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,ot(Jt(this),"set","value"))}}),this.__v_isReadonly=i}get value(){return this._dirty&&(this._value=this.effect(),this._dirty=!1),rt(Jt(this),"get","value"),this._value}set value(t){this._setter(t)}}const ae=[];function le(t){ae.push(t)}function he(){ae.pop()}function ce(t,...e){nt();const i=ae.length?ae[ae.length-1].component:null,n=i&&i.appContext.config.warnHandler,s=function(){let t=ae[ae.length-1];if(!t)return[];const e=[];for(;t;){const i=e[0];i&&i.vnode===t?i.recurseCount++:e.push({vnode:t,recurseCount:0});const n=t.component&&t.component.parent;t=n&&n.vnode}return e}();if(n)pe(n,i,11,[t+e.join(""),i&&i.proxy,s.map((({vnode:t})=>`at <${Ts(i,t.type)}>`)).join("\n"),s]);else{const i=[`[Vue warn]: ${t}`,...e];s.length&&i.push("\n",...function(t){const e=[];return t.forEach(((t,i)=>{e.push(...0===i?[]:["\n"],...function({vnode:t,recurseCount:e}){const i=e>0?`... (${e} recursive calls)`:"",n=!!t.component&&null==t.component.parent,s=` at <${Ts(t.component,t.type,n)}`,r=">"+i;return t.props?[s,...ue(t.props),r]:[s+r]}(t))})),e}(s)),console.warn(...i)}st()}function ue(t){const e=[],i=Object.keys(t);return i.slice(0,3).forEach((i=>{e.push(...de(i,t[i]))})),i.length>3&&e.push(" ..."),e}function de(t,e,i){return T(e)?(e=JSON.stringify(e),i?e:[`${t}=${e}`]):"number"==typeof e||"boolean"==typeof e||null==e?i?e:[`${t}=${e}`]:Qt(e)?(e=de(t,Jt(e.value),!0),i?e:[`${t}=Ref<`,e,">"]):w(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=Jt(e),i?e:[`${t}=`,e])}const fe={bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next"};function pe(t,e,i,n){let s;try{s=n?t(...n):t()}catch(r){be(r,e,i)}return s}function me(t,e,i,n){if(w(t)){const s=pe(t,e,i,n);return s&&L(s)&&s.catch((t=>{be(t,e,i)})),s}const s=[];for(let r=0;r<t.length;r++)s.push(me(t[r],e,i,n));return s}function be(t,e,i,n=!0){const s=e?e.vnode:null;if(e){let n=e.parent;const s=e.proxy,r=fe[i];for(;n;){const e=n.ec;if(e)for(let i=0;i<e.length;i++)if(!1===e[i](t,s,r))return;n=n.parent}const o=e.appContext.config.errorHandler;if(o)return void pe(o,null,10,[t,s,r])}!function(t,e,i,n=!0){{const s=fe[e];if(i&&le(i),ce("Unhandled error"+(s?` during execution of ${s}`:"")),i&&he(),n)throw t;console.error(t)}}(t,i,s,n)}let ge=!1,ye=!1;const Se=[];let ve=0;const xe=[];let Ee=null,_e=0;const we=[];let Te=null,Me=0;const Pe=Promise.resolve();let Le=null,Ae=null;function Ce(t){const e=Le||Pe;return t?e.then(this?t.bind(this):t):e}function Ie(t){Se.length&&Se.includes(t,ge&&t.allowRecurse?ve+1:ve)||t===Ae||(Se.push(t),Re())}function Re(){ge||ye||(ye=!0,Le=Pe.then(ke))}function Ne(t,e,i,n){E(t)?i.push(...t):e&&e.includes(t,t.allowRecurse?n+1:n)||i.push(t),Re()}function Fe(t){Ne(t,Te,we,Me)}function Be(t,e=null){if(xe.length){for(Ae=e,Ee=[...new Set(xe)],xe.length=0,t=t||new Map,_e=0;_e<Ee.length;_e++)Ve(t,Ee[_e]),Ee[_e]();Ee=null,_e=0,Ae=null,Be(t,e)}}function Oe(t){if(we.length){const e=[...new Set(we)];if(we.length=0,Te)return void Te.push(...e);for(Te=e,t=t||new Map,Te.sort(((t,e)=>De(t)-De(e))),Me=0;Me<Te.length;Me++)Ve(t,Te[Me]),Te[Me]();Te=null,Me=0}}const De=t=>null==t.id?1/0:t.id;function ke(t){ye=!1,ge=!0,Be(t=t||new Map),Se.sort(((t,e)=>De(t)-De(e)));try{for(ve=0;ve<Se.length;ve++){const e=Se[ve];e&&(Ve(t,e),pe(e,null,14))}}finally{ve=0,Se.length=0,Oe(t),ge=!1,Le=null,(Se.length||we.length)&&ke(t)}}function Ve(t,e){if(t.has(e)){const i=t.get(e);if(i>100)throw new Error("Maximum recursive updates exceeded. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.");t.set(e,i+1)}else t.set(e,1)}let Ge=!1;const We=new Set;("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}).__VUE_HMR_RUNTIME__={createRecord:je(ze),rerender:je((function(t,e){const i=Ue.get(t);if(!i)return;e&&(i.component.render=e);Array.from(i.instances).forEach((t=>{e&&(t.render=e),t.renderCache=[],Ge=!0,t.update(),Ge=!1}))})),reload:je((function(t,e){const i=Ue.get(t);if(!i)return;const{component:n,instances:s}=i;if(!We.has(n)){e=Ms(e)?e.__vccOpts:e,y(n,e);for(const t in n)t in e||delete n[t];We.add(n),Fe((()=>{We.delete(n)}))}Array.from(s).forEach((t=>{t.parent?Ie(t.parent.update):t.appContext.reload?t.appContext.reload():"undefined"!=typeof window?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}))}))};const Ue=new Map;function ze(t,e){return e||(ce("HMR API usage is out of date.\nPlease upgrade vue-loader/vite/rollup-plugin-vue or other relevant dependency that handles Vue SFC compilation."),e={}),!Ue.has(t)&&(Ue.set(t,{component:Ms(e)?e.__vccOpts:e,instances:new Set}),!0)}function je(t){return(e,i)=>{try{return t(e,i)}catch(n){console.error(n),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let He;const Xe=qe("component:added"),Ye=qe("component:updated"),Ke=qe("component:removed");function qe(t){return e=>{He&&He.emit(t,e.appContext.app,e.uid,e.parent?e.parent.uid:void 0,e)}}function $e(t,e,...i){const n=t.vnode.props||u;{const{emitsOptions:n,propsOptions:[s]}=t;if(n)if(e in n){const t=n[e];if(w(t)){t(...i)||ce(`Invalid event arguments: event validation failed for event "${e}".`)}}else s&&G(e)in s||ce(`Component emitted event "${e}" but it is neither declared in the emits option nor as an "${G(e)}" prop.`)}let s=i;const r=e.startsWith("update:"),o=r&&e.slice(7);if(o&&o in n){const t=`${"modelValue"===o?"model":o}Modifiers`,{number:e,trim:r}=n[t]||u;r?s=i.map((t=>t.trim())):e&&(s=i.map(j))}!function(t,e,i){He&&He.emit("component:emit",t.appContext.app,t,e,i)}(t,e,s);{const i=e.toLowerCase();i!==e&&n[G(i)]&&ce(`Event "${i}" is emitted in component ${Ts(t,t.type)} but the handler is registered for "${e}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${k(e)}" instead of "${e}".`)}let a=G(O(e)),l=n[a];!l&&r&&(a=G(k(e)),l=n[a]),l&&me(l,t,6,s);const h=n[a+"Once"];if(h){if(t.emitted){if(t.emitted[a])return}else(t.emitted={})[a]=!0;me(h,t,6,s)}}function Je(t,e,i=!1){if(!e.deopt&&void 0!==t.__emits)return t.__emits;const n=t.emits;let s={},r=!1;if(!w(t)){const n=t=>{r=!0,y(s,Je(t,e,!0))};!i&&e.mixins.length&&e.mixins.forEach(n),t.extends&&n(t.extends),t.mixins&&t.mixins.forEach(n)}return n||r?(E(n)?n.forEach((t=>s[t]=null)):y(s,n),t.__emits=s):t.__emits=null}function Ze(t,e){return!(!t||!b(e))&&(e=e.slice(2).replace(/Once$/,""),x(t,e[0].toLowerCase()+e.slice(1))||x(t,k(e))||x(t,e))}let Qe=null;function ti(t){Qe=t}let ei=!1;function ii(){ei=!0}function ni(t){const{type:e,vnode:i,proxy:n,withProxy:s,props:r,propsOptions:[o],slots:a,attrs:l,emit:h,render:c,renderCache:u,data:d,setupState:f,ctx:p}=t;let m;Qe=t,ei=!1;try{let t;if(4&i.shapeFlag){const e=s||n;m=Yn(c.call(e,e,u,r,f,d,p)),t=l}else{const i=e;l===r&&ii(),m=Yn(i.length>1?i(r,{get attrs(){return ii(),l},slots:a,emit:h}):i(r,null)),t=e.props?l:oi(l)}let y,S=m;if(m.patchFlag>0&&2048&m.patchFlag&&([S,y]=si(m)),!1!==e.inheritAttrs&&t){const e=Object.keys(t),{shapeFlag:i}=S;if(e.length)if(1&i||6&i)o&&e.some(g)&&(t=ai(t,o)),S=jn(S,t);else if(!ei&&S.type!==Fn){const t=Object.keys(l),e=[],i=[];for(let n=0,s=t.length;n<s;n++){const s=t[n];b(s)?g(s)||e.push(s[2].toLowerCase()+s.slice(3)):i.push(s)}i.length&&ce(`Extraneous non-props attributes (${i.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`),e.length&&ce(`Extraneous non-emits event listeners (${e.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}}i.dirs&&(li(S)||ce("Runtime directive used on component with non-element root node. The directives will not function as intended."),S.dirs=S.dirs?S.dirs.concat(i.dirs):i.dirs),i.transition&&(li(S)||ce("Component inside <Transition> renders non-element root node that cannot be animated."),S.transition=i.transition),y?y(S):m=S}catch(y){be(y,t,1),m=zn(Fn)}return Qe=null,m}const si=t=>{const e=t.children,i=t.dynamicChildren,n=ri(e);if(!n)return[t,void 0];const s=e.indexOf(n),r=i?i.indexOf(n):-1;return[Yn(n),n=>{e[s]=n,i&&(r>-1?i[r]=n:n.patchFlag>0&&(t.dynamicChildren=[...i,n]))}]};function ri(t){let e;for(let i=0;i<t.length;i++){const n=t[i];if(!kn(n))return;if(n.type!==Fn||"v-if"===n.children){if(e)return;e=n}}return e}const oi=t=>{let e;for(const i in t)("class"===i||"style"===i||b(i))&&((e||(e={}))[i]=t[i]);return e},ai=(t,e)=>{const i={};for(const n in t)g(n)&&n.slice(9)in e||(i[n]=t[n]);return i},li=t=>6&t.shapeFlag||1&t.shapeFlag||t.type===Fn;function hi(t,e,i){const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!0;for(let s=0;s<n.length;s++){const r=n[s];if(e[r]!==t[r]&&!Ze(i,r))return!0}return!1}function ci(t){if(w(t)&&(t=t()),E(t)){const e=ri(t);e||ce("<Suspense> slots expect a single root node."),t=e}return Yn(t)}let ui=0;const di=t=>ui+=t;function fi(t,e=Qe){if(!e)return t;const i=(...i)=>{ui||function(t=!1){On.push(Dn=t?null:[])}(!0);const n=Qe;ti(e);const s=t(...i);return ti(n),ui||(On.pop(),Dn=On[On.length-1]||null),s};return i._c=!0,i}function pi(t,e,i,n=!1){const s={},r={};z(r,Gn,1),mi(t,e,s,r),Ei(s,t),i?t.props=n?s:Yt(s,!1,yt,Vt):t.type.props?t.props=s:t.props=r,t.attrs=r}function mi(t,e,i,n){const[s,r]=t.propsOptions;if(e)for(const o in e){const r=e[o];if(N(o))continue;let a;s&&x(s,a=O(o))?i[a]=r:Ze(t.emitsOptions,o)||(n[o]=r)}if(r){const e=Jt(i);for(let n=0;n<r.length;n++){const o=r[n];i[o]=bi(s,e,o,e[o],t)}}}function bi(t,e,i,n,s){const r=t[i];if(null!=r){const t=x(r,"default");if(t&&void 0===n){const t=r.default;r.type!==Function&&w(t)?(ms(s),n=t(e),ms(null)):n=t}r[0]&&(x(e,i)||t?!r[1]||""!==n&&n!==k(i)||(n=!0):n=!1)}return n}function gi(t,e,i=!1){if(!e.deopt&&t.__props)return t.__props;const n=t.props,s={},r=[];let o=!1;if(!w(t)){const n=t=>{o=!0;const[i,n]=gi(t,e,!0);y(s,i),n&&r.push(...n)};!i&&e.mixins.length&&e.mixins.forEach(n),t.extends&&n(t.extends),t.mixins&&t.mixins.forEach(n)}if(!n&&!o)return t.__props=d;if(E(n))for(let a=0;a<n.length;a++){T(n[a])||ce("props must be strings when using array syntax.",n[a]);const t=O(n[a]);yi(t)&&(s[t]=u)}else if(n){P(n)||ce("invalid props options",n);for(const t in n){const e=O(t);if(yi(e)){const i=n[t],o=s[e]=E(i)||w(i)?{type:i}:i;if(o){const t=xi(Boolean,o.type),i=xi(String,o.type);o[0]=t>-1,o[1]=i<0||t<i,(t>-1||x(o,"default"))&&r.push(e)}}}}return t.__props=[s,r]}function yi(t){return"$"!==t[0]||(ce(`Invalid prop name: "${t}" is a reserved property.`),!1)}function Si(t){const e=t&&t.toString().match(/^\s*function (\w+)/);return e?e[1]:""}function vi(t,e){return Si(t)===Si(e)}function xi(t,e){if(E(e)){for(let i=0,n=e.length;i<n;i++)if(vi(e[i],t))return i}else if(w(e))return vi(e,t)?0:-1;return-1}function Ei(t,e){const i=Jt(t),n=e.propsOptions[0];for(const s in n){let t=n[s];null!=t&&_i(s,i[s],t,!x(i,s))}}function _i(t,e,i,n){const{type:s,required:r,validator:o}=i;if(r&&n)ce('Missing required prop: "'+t+'"');else if(null!=e||i.required){if(null!=s&&!0!==s){let i=!1;const n=E(s)?s:[s],r=[];for(let t=0;t<n.length&&!i;t++){const{valid:s,expectedType:o}=Ti(e,n[t]);r.push(o||""),i=s}if(!i)return void ce(function(t,e,i){let n=`Invalid prop: type check failed for prop "${t}". Expected ${i.map(V).join(", ")}`;const s=i[0],r=I(e),o=Mi(e,s),a=Mi(e,r);1===i.length&&Pi(s)&&!function(...t){return t.some((t=>"boolean"===t.toLowerCase()))}(s,r)&&(n+=` with value ${o}`);n+=`, got ${r} `,Pi(r)&&(n+=`with value ${a}.`);return n}(t,e,r))}o&&!o(e)&&ce('Invalid prop: custom validator check failed for prop "'+t+'".')}}const wi=e("String,Number,Boolean,Function,Symbol,BigInt");function Ti(t,e){let i;const n=Si(e);if(wi(n)){const s=typeof t;i=s===n.toLowerCase(),i||"object"!==s||(i=t instanceof e)}else i="Object"===n?P(t):"Array"===n?E(t):t instanceof e;return{valid:i,expectedType:n}}function Mi(t,e){return"String"===e?`"${t}"`:"Number"===e?`${Number(t)}`:`${t}`}function Pi(t){return["string","number","boolean"].some((e=>t.toLowerCase()===e))}function Li(t,e,i=fs,n=!1){if(i){const s=i[t]||(i[t]=[]),r=e.__weh||(e.__weh=(...n)=>{if(i.isUnmounted)return;nt(),ms(i);const s=me(e,i,t,n);return ms(null),st(),s});return n?s.unshift(r):s.push(r),r}ce(`${G(fe[t].replace(/ hook$/,""))} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}const Ai=t=>(e,i=fs)=>!Ss&&Li(t,e,i),Ci=Ai("bm"),Ii=Ai("m"),Ri=Ai("bu"),Ni=Ai("u"),Fi=Ai("bum"),Bi=Ai("um"),Oi=Ai("rtg"),Di=Ai("rtc"),ki={};function Vi(t,e,i){return w(e)||ce("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),Gi(t,e,i)}function Gi(t,e,{immediate:i,deep:n,flush:s,onTrack:r,onTrigger:o}=u,a=fs){e||(void 0!==i&&ce('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),void 0!==n&&ce('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));const l=t=>{ce("Invalid watch source: ",t,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")};let h,c,d=!1;if(Qt(t)?(h=()=>t.value,d=!!t._shallow):Kt(t)?(h=()=>t,n=!0):E(t)?h=()=>t.map((t=>Qt(t)?t.value:Kt(t)?Ui(t):w(t)?pe(t,a,2,[a&&a.proxy]):void l(t))):w(t)?h=e?()=>pe(t,a,2,[a&&a.proxy]):()=>{if(!a||!a.isUnmounted)return c&&c(),pe(t,a,3,[p])}:(h=f,l(t)),e&&n){const t=h;h=()=>Ui(t())}const p=t=>{c=y.options.onStop=()=>{pe(t,a,4)}};let m=E(t)?[]:ki;const b=()=>{if(y.active)if(e){const t=y();(n||d||W(t,m))&&(c&&c(),me(e,a,3,[t,m===ki?void 0:m,p]),m=t)}else y()};let g;b.allowRecurse=!!e,g="sync"===s?b:"post"===s?()=>xn(b,a&&a.suspense):()=>{!a||a.isMounted?function(t){Ne(t,Ee,xe,_e)}(b):b()};const y=J(h,{lazy:!0,onTrack:r,onTrigger:o,scheduler:g});return _s(y,a),e?i?b():m=y():"post"===s?xn(y,a&&a.suspense):y(),()=>{Z(y),a&&S(a.effects,y)}}function Wi(t,e,i){const n=this.proxy;return Gi(T(t)?()=>n[t]:t.bind(n),e.bind(n),i,this)}function Ui(t,e=new Set){if(!P(t)||e.has(t))return t;if(e.add(t),Qt(t))Ui(t.value,e);else if(E(t))for(let i=0;i<t.length;i++)Ui(t[i],e);else if("[object Set]"===C(t)||_(t))t.forEach((t=>{Ui(t,e)}));else for(const i in t)Ui(t[i],e);return t}const zi=[Function,Array],ji={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:zi,onEnter:zi,onAfterEnter:zi,onEnterCancelled:zi,onBeforeLeave:zi,onLeave:zi,onAfterLeave:zi,onLeaveCancelled:zi,onBeforeAppear:zi,onAppear:zi,onAfterAppear:zi,onAppearCancelled:zi},setup(t,{slots:e}){const i=ps(),n=function(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ii((()=>{t.isMounted=!0})),Fi((()=>{t.isUnmounting=!0})),t}();let s;return()=>{const r=e.default&&$i(e.default(),!0);if(!r||!r.length)return;r.length>1&&ce("<transition> can only be used on a single element or component. Use <transition-group> for lists.");const o=Jt(t),{mode:a}=o;a&&!["in-out","out-in","default"].includes(a)&&ce(`invalid <transition> mode: ${a}`);const l=r[0];if(n.isLeaving)return Yi(l);const h=Ki(l);if(!h)return Yi(l);const c=Xi(h,o,n,i);qi(h,c);const u=i.subTree,d=u&&Ki(u);let f=!1;const{getTransitionKey:p}=h.type;if(p){const t=p();void 0===s?s=t:t!==s&&(s=t,f=!0)}if(d&&d.type!==Fn&&(!Vn(h,d)||f)){const t=Xi(d,o,n,i);if(qi(d,t),"out-in"===a)return n.isLeaving=!0,t.afterLeave=()=>{n.isLeaving=!1,i.update()},Yi(l);"in-out"===a&&(t.delayLeave=(t,e,i)=>{Hi(n,d)[String(d.key)]=d,t._leaveCb=()=>{e(),t._leaveCb=void 0,delete c.delayedLeave},c.delayedLeave=i})}return l}}};function Hi(t,e){const{leavingVNodes:i}=t;let n=i.get(e.type);return n||(n=Object.create(null),i.set(e.type,n)),n}function Xi(t,e,i,n){const{appear:s,mode:r,persisted:o=!1,onBeforeEnter:a,onEnter:l,onAfterEnter:h,onEnterCancelled:c,onBeforeLeave:u,onLeave:d,onAfterLeave:f,onLeaveCancelled:p,onBeforeAppear:m,onAppear:b,onAfterAppear:g,onAppearCancelled:y}=e,S=String(t.key),v=Hi(i,t),x=(t,e)=>{t&&me(t,n,9,e)},E={mode:r,persisted:o,beforeEnter(e){let n=a;if(!i.isMounted){if(!s)return;n=m||a}e._leaveCb&&e._leaveCb(!0);const r=v[S];r&&Vn(t,r)&&r.el._leaveCb&&r.el._leaveCb(),x(n,[e])},enter(t){let e=l,n=h,r=c;if(!i.isMounted){if(!s)return;e=b||l,n=g||h,r=y||c}let o=!1;const a=t._enterCb=e=>{o||(o=!0,x(e?r:n,[t]),E.delayedLeave&&E.delayedLeave(),t._enterCb=void 0)};e?(e(t,a),e.length<=1&&a()):a()},leave(e,n){const s=String(t.key);if(e._enterCb&&e._enterCb(!0),i.isUnmounting)return n();x(u,[e]);let r=!1;const o=e._leaveCb=i=>{r||(r=!0,n(),x(i?p:f,[e]),e._leaveCb=void 0,v[s]===t&&delete v[s])};v[s]=t,d?(d(e,o),d.length<=1&&o()):o()},clone:t=>Xi(t,e,i,n)};return E}function Yi(t){if(Ji(t))return(t=jn(t)).children=null,t}function Ki(t){return Ji(t)?t.children?t.children[0]:void 0:t}function qi(t,e){6&t.shapeFlag&&t.component?qi(t.component.subTree,e):128&t.shapeFlag?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function $i(t,e=!1){let i=[],n=0;for(let s=0;s<t.length;s++){const r=t[s];r.type===Rn?(128&r.patchFlag&&n++,i=i.concat($i(r.children,e))):(e||r.type!==Fn)&&i.push(r)}if(n>1)for(let s=0;s<i.length;s++)i[s].patchFlag=-2;return i}const Ji=t=>t.type.__isKeepAlive;function Zi(t,e){tn(t,"a",e)}function Qi(t,e){tn(t,"da",e)}function tn(t,e,i=fs){const n=t.__wdc||(t.__wdc=()=>{let e=i;for(;e;){if(e.isDeactivated)return;e=e.parent}t()});if(Li(e,n,i),i){let t=i.parent;for(;t&&t.parent;)Ji(t.parent.vnode)&&en(n,e,i,t),t=t.parent}}function en(t,e,i,n){const s=Li(e,t,n,!0);Bi((()=>{S(n[e],s)}),i)}const nn=t=>"_"===t[0]||"$stable"===t,sn=t=>E(t)?t.map(Yn):[Yn(t)],rn=(t,e,i)=>fi((i=>(fs&&ce(`Slot "${t}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`),sn(e(i)))),i),on=(t,e)=>{const i=t._ctx;for(const n in t){if(nn(n))continue;const s=t[n];if(w(s))e[n]=rn(n,s,i);else if(null!=s){ce(`Non-function value encountered for slot "${n}". Prefer function slots for better performance.`);const t=sn(s);e[n]=()=>t}}},an=(t,e)=>{Ji(t.vnode)||ce("Non-function value encountered for default slot. Prefer function slots for better performance.");const i=sn(e);t.slots.default=()=>i},ln=e("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text");function hn(t){ln(t)&&ce("Do not use built-in directive ids as custom directive id: "+t)}function cn(t,e){const i=Qe;if(null===i)return ce("withDirectives can only be used inside render functions."),t;const n=i.proxy,s=t.dirs||(t.dirs=[]);for(let r=0;r<e.length;r++){let[t,i,o,a=u]=e[r];w(t)&&(t={mounted:t,updated:t}),s.push({dir:t,instance:n,value:i,oldValue:void 0,arg:o,modifiers:a})}return t}function un(t,e,i,n){const s=t.dirs,r=e&&e.dirs;for(let o=0;o<s.length;o++){const a=s[o];r&&(a.oldValue=r[o].value);const l=a.dir[n];l&&me(l,i,8,[t.el,a,t,e])}}function dn(){return{app:null,config:{isNativeTag:p,performance:!1,globalProperties:{},optionMergeStrategies:{},isCustomElement:p,errorHandler:void 0,warnHandler:void 0},mixins:[],components:{},directives:{},provides:Object.create(null)}}let fn,pn,mn=0;function bn(t,e){return function(i,n=null){null==n||P(n)||(ce("root props passed to app.mount() must be an object."),n=null);const s=dn(),r=new Set;let o=!1;const a=s.app={_uid:mn++,_component:i,_props:n,_container:null,_context:s,version:Ls,get config(){return s.config},set config(t){ce("app.config cannot be replaced. Modify individual options instead.")},use:(t,...e)=>(r.has(t)?ce("Plugin has already been applied to target app."):t&&w(t.install)?(r.add(t),t.install(a,...e)):w(t)?(r.add(t),t(a,...e)):ce('A plugin must either be a function or an object with an "install" function.'),a),mixin:t=>(s.mixins.includes(t)?ce("Mixin has already been applied to target app"+(t.name?`: ${t.name}`:"")):(s.mixins.push(t),(t.props||t.emits)&&(s.deopt=!0)),a),component:(t,e)=>(gs(t,s.config),e?(s.components[t]&&ce(`Component "${t}" has already been registered in target app.`),s.components[t]=e,a):s.components[t]),directive:(t,e)=>(hn(t),e?(s.directives[t]&&ce(`Directive "${t}" has already been registered in target app.`),s.directives[t]=e,a):s.directives[t]),mount(r,l){if(!o){const h=zn(i,n);return h.appContext=s,s.reload=()=>{t(jn(h),r)},l&&e?e(h,r):t(h,r),o=!0,a._container=r,r.__vue_app__=a,function(t,e){He&&He.emit("app:init",t,e,{Fragment:Rn,Text:Nn,Comment:Fn,Static:Bn})}(a,Ls),h.component.proxy}ce("App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. `const createMyApp = () => createApp(App)`")},unmount(){o?(t(null,a._container),function(t){He&&He.emit("app:unmount",t)}(a),delete a._container.__vue_app__):ce("Cannot unmount an app that is not mounted.")},provide:(t,e)=>(t in s.provides&&ce(`App already provides property with key "${String(t)}". It will be overwritten with the new value.`),s.provides[t]=e,a)};return a}}function gn(t,e){t.appContext.config.performance&&Sn()&&pn.mark(`vue-${e}-${t.uid}`)}function yn(t,e){if(t.appContext.config.performance&&Sn()){const i=`vue-${e}-${t.uid}`,n=i+":end";pn.mark(n),pn.measure(`<${Ts(t,t.type)}> ${e}`,i,n),pn.clearMarks(i),pn.clearMarks(n)}}function Sn(){return void 0!==fn||("undefined"!=typeof window&&window.performance?(fn=!0,pn=window.performance):fn=!1),fn}function vn(t){return w(t)?{setup:t,name:t.name}:t}const xn=function(t,e){e&&e.pendingBranch?E(t)?e.effects.push(...t):e.effects.push(t):Fe(t)},En=(t,e,i,n)=>{if(E(t))return void t.forEach(((t,s)=>En(t,e&&(E(e)?e[s]:e),i,n)));let s;s=!n||(t=>!!t.type.__asyncLoader)(n)?null:4&n.shapeFlag?n.component.exposed||n.component.proxy:n.el;const{i:r,r:o}=t;if(!r)return void ce("Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.");const a=e&&e.r,l=r.refs===u?r.refs={}:r.refs,h=r.setupState;if(null!=a&&a!==o&&(T(a)?(l[a]=null,x(h,a)&&(h[a]=null)):Qt(a)&&(a.value=null)),T(o)){const t=()=>{l[o]=s,x(h,o)&&(h[o]=s)};s?(t.id=-1,xn(t,i)):t()}else if(Qt(o)){const t=()=>{o.value=s};s?(t.id=-1,xn(t,i)):t()}else w(o)?pe(o,r,12,[s,l]):ce("Invalid template ref type:",s,`(${typeof s})`)};function _n(t){return function(t,e){const{insert:i,remove:n,patchProp:s,forcePatchProp:r,createElement:o,createText:a,createComment:l,setText:h,setElementText:c,parentNode:p,nextSibling:m,setScopeId:b=f,cloneNode:g,insertStaticContent:S}=t,v=(t,e,i,n=null,s=null,r=null,o=!1,a=!1)=>{t&&!Vn(t,e)&&(n=at(t),Q(t,s,r,!0),t=null),-2===e.patchFlag&&(a=!1,e.dynamicChildren=null);const{type:l,ref:h,shapeFlag:c}=e;switch(l){case Nn:E(t,e,i,n);break;case Fn:_(t,e,i,n);break;case Bn:null==t?w(e,i,n,o):T(t,e,i,o);break;case Rn:V(t,e,i,n,s,r,o,a);break;default:1&c?A(t,e,i,n,s,r,o,a):6&c?G(t,e,i,n,s,r,o,a):64&c||128&c?l.process(t,e,i,n,s,r,o,a,ht):ce("Invalid VNode type:",l,`(${typeof l})`)}null!=h&&s&&En(h,t&&t.ref,r,e)},E=(t,e,n,s)=>{if(null==t)i(e.el=a(e.children),n,s);else{const i=e.el=t.el;e.children!==t.children&&h(i,e.children)}},_=(t,e,n,s)=>{null==t?i(e.el=l(e.children||""),n,s):e.el=t.el},w=(t,e,i,n)=>{[t.el,t.anchor]=S(t.children,e,i,n)},T=(t,e,i,n)=>{if(e.children!==t.children){const s=m(t.anchor);P(t),[e.el,e.anchor]=S(e.children,i,s,n)}else e.el=t.el,e.anchor=t.anchor},M=({el:t,anchor:e},n,s)=>{let r;for(;t&&t!==e;)r=m(t),i(t,n,s),t=r;i(e,n,s)},P=({el:t,anchor:e})=>{let i;for(;t&&t!==e;)i=m(t),n(t),t=i;n(e)},A=(t,e,i,n,s,r,o,a)=>{o=o||"svg"===e.type,null==t?C(e,i,n,s,r,o,a):F(t,e,s,r,o,a)},C=(t,e,n,r,a,l,h)=>{let u,d;const{type:f,props:p,shapeFlag:m,transition:b,scopeId:g,patchFlag:y,dirs:S}=t;if(u=t.el=o(t.type,l,p&&p.is),8&m?c(u,t.children):16&m&&R(t.children,u,null,r,a,l&&"foreignObject"!==f,h||!!t.dynamicChildren),S&&un(t,null,r,"created"),p){for(const e in p)N(e)||s(u,e,null,p[e],l,t.children,r,a,rt);(d=p.onVnodeBeforeMount)&&wn(d,r,t)}I(u,g,t,r),Object.defineProperty(u,"__vnode",{value:t,enumerable:!1}),Object.defineProperty(u,"__vueParentComponent",{value:r,enumerable:!1}),S&&un(t,null,r,"beforeMount");const v=(!a||a&&!a.pendingBranch)&&b&&!b.persisted;v&&b.beforeEnter(u),i(u,e,n),((d=p&&p.onVnodeMounted)||v||S)&&xn((()=>{d&&wn(d,r,t),v&&b.enter(u),S&&un(t,null,r,"mounted")}),a)},I=(t,e,i,n)=>{if(e&&b(t,e),n){const s=n.type.__scopeId;s&&s!==e&&b(t,s+"-s");let r=n.subTree;r.type===Rn&&(r=ri(r.children)||r),i===r&&I(t,n.vnode.scopeId,n.vnode,n.parent)}},R=(t,e,i,n,s,r,o,a=0)=>{for(let l=a;l<t.length;l++){const a=t[l]=o?Kn(t[l]):Yn(t[l]);v(null,a,e,i,n,s,r,o)}},F=(t,e,i,n,o,a)=>{const l=e.el=t.el;let{patchFlag:h,dynamicChildren:d,dirs:f}=e;h|=16&t.patchFlag;const p=t.props||u,m=e.props||u;let b;if((b=m.onVnodeBeforeUpdate)&&wn(b,i,e,t),f&&un(e,t,i,"beforeUpdate"),Ge&&(h=0,a=!1,d=null),h>0){if(16&h)D(l,e,p,m,i,n,o);else if(2&h&&p.class!==m.class&&s(l,"class",null,m.class,o),4&h&&s(l,"style",p.style,m.style,o),8&h){const a=e.dynamicProps;for(let e=0;e<a.length;e++){const h=a[e],c=p[h],u=m[h];(u!==c||r&&r(l,h))&&s(l,h,c,u,o,t.children,i,n,rt)}}1&h&&t.children!==e.children&&c(l,e.children)}else a||null!=d||D(l,e,p,m,i,n,o);const g=o&&"foreignObject"!==e.type;d?(B(t.dynamicChildren,d,l,i,n,g),i&&i.type.__hmrId&&Tn(t,e)):a||Y(t,e,l,null,i,n,g),((b=m.onVnodeUpdated)||f)&&xn((()=>{b&&wn(b,i,e,t),f&&un(e,t,i,"updated")}),n)},B=(t,e,i,n,s,r)=>{for(let o=0;o<e.length;o++){const a=t[o],l=e[o],h=a.type===Rn||!Vn(a,l)||6&a.shapeFlag||64&a.shapeFlag?p(a.el):i;v(a,l,h,null,n,s,r,!0)}},D=(t,e,i,n,o,a,l)=>{if(i!==n){for(const h in n){if(N(h))continue;const c=n[h],u=i[h];(c!==u||r&&r(t,h))&&s(t,h,u,c,l,e.children,o,a,rt)}if(i!==u)for(const r in i)N(r)||r in n||s(t,r,i[r],null,l,e.children,o,a,rt)}},V=(t,e,n,s,r,o,l,h)=>{const c=e.el=t?t.el:a(""),u=e.anchor=t?t.anchor:a("");let{patchFlag:d,dynamicChildren:f}=e;d>0&&(h=!0),Ge&&(d=0,h=!1,f=null),null==t?(i(c,n,s),i(u,n,s),R(e.children,n,u,r,o,l,h)):d>0&&64&d&&f&&t.dynamicChildren?(B(t.dynamicChildren,f,n,r,o,l),r&&r.type.__hmrId?Tn(t,e):(null!=e.key||r&&e===r.subTree)&&Tn(t,e,!0)):Y(t,e,n,u,r,o,l,h)},G=(t,e,i,n,s,r,o,a)=>{null==t?512&e.shapeFlag?s.ctx.activate(e,i,n,o,a):W(e,i,n,s,r,o,a):j(t,e,a)},W=(t,e,i,n,s,r,o)=>{const a=t.component=function(t,e,i){const n=t.type,s=(e?e.appContext:t.appContext)||us,r={uid:ds++,vnode:t,type:n,parent:e,appContext:s,root:null,next:null,subTree:null,update:null,render:null,proxy:null,exposed:null,withProxy:null,effects:null,provides:e?e.provides:Object.create(s.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:gi(n,s),emitsOptions:Je(n,s),emit:null,emitted:null,ctx:u,data:u,props:u,attrs:u,slots:u,refs:u,setupState:u,setupContext:null,suspense:i,suspenseId:i?i.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null};return r.ctx=function(t){const e={};Object.defineProperty(e,"_",{configurable:!0,enumerable:!1,get:()=>t}),Object.keys(ls).forEach((i=>{Object.defineProperty(e,i,{configurable:!0,enumerable:!1,get:()=>ls[i](t),set:f})}));const{globalProperties:i}=t.appContext.config;return Object.keys(i).forEach((t=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get:()=>i[t],set:f})})),e}(r),r.root=e?e.root:r,r.emit=$e.bind(null,r),r}(t,n,s);if(a.type.__hmrId&&function(t){const e=t.type.__hmrId;let i=Ue.get(e);i||(ze(e,t.type),i=Ue.get(e)),i.instances.add(t)}(a),le(t),gn(a,"mount"),Ji(t)&&(a.ctx.renderer=ht),gn(a,"init"),function(t,e=!1){Ss=e;const{props:i,children:n}=t.vnode,s=ys(t);pi(t,i,s,e),((t,e)=>{if(32&t.vnode.shapeFlag){const i=e._;i?(t.slots=e,z(e,"_",i)):on(e,t.slots={})}else t.slots={},e&&an(t,e);z(t.slots,Gn,1)})(t,n);const r=s?function(t,e){const i=t.type;i.name&&gs(i.name,t.appContext.config);if(i.components){const e=Object.keys(i.components);for(let i=0;i<e.length;i++)gs(e[i],t.appContext.config)}if(i.directives){const t=Object.keys(i.directives);for(let e=0;e<t.length;e++)hn(t[e])}t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,hs),function(t){const{ctx:e,propsOptions:[i]}=t;i&&Object.keys(i).forEach((i=>{Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>t.props[i],set:f})}))}(t);const{setup:n}=i;if(n){const i=t.setupContext=n.length>1?function(t){const e=e=>{t.exposed&&ce("expose() should be called only once per setup()."),t.exposed=se(e)};return Object.freeze({get props(){return t.props},get attrs(){return new Proxy(t.attrs,Es)},get slots(){return Xt(t.slots)},get emit(){return(e,...i)=>t.emit(e,...i)},expose:e})}(t):null;fs=t,nt();const s=pe(n,t,0,[Xt(t.props),i]);if(st(),fs=null,L(s)){if(e)return s.then((e=>{vs(t,e)}));t.asyncDep=s}else vs(t,s)}else xs(t)}(t,e):void 0;Ss=!1}(a),yn(a,"init"),a.asyncDep){if(s&&s.registerDep(a,H),!t.el){const t=a.subTree=zn(Fn);_(null,t,e,i)}}else H(a,t,e,i,s,r,o),he(),yn(a,"mount")},j=(t,e,i)=>{const n=e.component=t.component;if(function(t,e,i){const{props:n,children:s,component:r}=t,{props:o,children:a,patchFlag:l}=e,h=r.emitsOptions;if((s||a)&&Ge)return!0;if(e.dirs||e.transition)return!0;if(!(i&&l>=0))return!(!s&&!a||a&&a.$stable)||n!==o&&(n?!o||hi(n,o,h):!!o);if(1024&l)return!0;if(16&l)return n?hi(n,o,h):!!o;if(8&l){const t=e.dynamicProps;for(let e=0;e<t.length;e++){const i=t[e];if(o[i]!==n[i]&&!Ze(h,i))return!0}}return!1}(t,e,i)){if(n.asyncDep&&!n.asyncResolved)return le(e),X(n,e,i),void he();n.next=e,function(t){const e=Se.indexOf(t);e>-1&&Se.splice(e,1)}(n.update),n.update()}else e.component=t.component,e.el=t.el,n.vnode=e},H=(t,e,i,n,s,r,o)=>{t.update=J((function(){if(t.isMounted){let e,{next:i,bu:n,u:a,parent:l,vnode:h}=t,c=i;le(i||t.vnode),i?(i.el=h.el,X(t,i,o)):i=h,n&&U(n),(e=i.props&&i.props.onVnodeBeforeUpdate)&&wn(e,l,i,h),gn(t,"render");const u=ni(t);yn(t,"render");const d=t.subTree;t.subTree=u,gn(t,"patch"),v(d,u,p(d.el),at(d),t,s,r),yn(t,"patch"),i.el=u.el,null===c&&function({vnode:t,parent:e},i){for(;e&&e.subTree===t;)(t=e.vnode).el=i,e=e.parent}(t,u.el),a&&xn(a,s),(e=i.props&&i.props.onVnodeUpdated)&&xn((()=>{wn(e,l,i,h)}),s),Ye(t),he()}else{let o;const{el:a,props:l}=e,{bm:h,m:c,parent:u}=t;h&&U(h),(o=l&&l.onVnodeBeforeMount)&&wn(o,u,e),gn(t,"render");const d=t.subTree=ni(t);if(yn(t,"render"),a&&ut?(gn(t,"hydrate"),ut(e.el,d,t,s),yn(t,"hydrate")):(gn(t,"patch"),v(null,d,i,n,t,s,r),yn(t,"patch"),e.el=d.el),c&&xn(c,s),o=l&&l.onVnodeMounted){const t=e;xn((()=>{wn(o,u,t)}),s)}const{a:f}=t;f&&256&e.shapeFlag&&xn(f,s),t.isMounted=!0,Xe(t),e=i=n=null}}),function(t){return{scheduler:Ie,allowRecurse:!0,onTrack:t.rtc?e=>U(t.rtc,e):void 0,onTrigger:t.rtg?e=>U(t.rtg,e):void 0}}(t))},X=(t,e,i)=>{e.component=t;const n=t.vnode.props;t.vnode=e,t.next=null,function(t,e,i,n){const{props:s,attrs:r,vnode:{patchFlag:o}}=t,a=Jt(s),[l]=t.propsOptions;if(t.type.__hmrId||t.parent&&t.parent.type.__hmrId||!(n||o>0)||16&o){let n;mi(t,e,s,r);for(const r in a)e&&(x(e,r)||(n=k(r))!==r&&x(e,n))||(l?!i||void 0===i[r]&&void 0===i[n]||(s[r]=bi(l,e||u,r,void 0,t)):delete s[r]);if(r!==a)for(const t in r)e&&x(e,t)||delete r[t]}else if(8&o){const i=t.vnode.dynamicProps;for(let n=0;n<i.length;n++){const o=i[n],h=e[o];if(l)if(x(r,o))r[o]=h;else{const e=O(o);s[e]=bi(l,a,e,h,t)}else r[o]=h}}ot(t,"set","$attrs"),e&&Ei(s,t)}(t,e.props,n,i),((t,e)=>{const{vnode:i,slots:n}=t;let s=!0,r=u;if(32&i.shapeFlag){const t=e._;t?Ge?y(n,e):1===t?s=!1:y(n,e):(s=!e.$stable,on(e,n)),r=e}else e&&(an(t,e),r={default:1});if(s)for(const o in n)nn(o)||o in r||delete n[o]})(t,e.children),Be(void 0,t.update)},Y=(t,e,i,n,s,r,o,a=!1)=>{const l=t&&t.children,h=t?t.shapeFlag:0,u=e.children,{patchFlag:d,shapeFlag:f}=e;if(d>0){if(128&d)return void q(l,u,i,n,s,r,o,a);if(256&d)return void K(l,u,i,n,s,r,o,a)}8&f?(16&h&&rt(l,s,r),u!==l&&c(i,u)):16&h?16&f?q(l,u,i,n,s,r,o,a):rt(l,s,r,!0):(8&h&&c(i,""),16&f&&R(u,i,n,s,r,o,a))},K=(t,e,i,n,s,r,o,a)=>{e=e||d;const l=(t=t||d).length,h=e.length,c=Math.min(l,h);let u;for(u=0;u<c;u++){const n=e[u]=a?Kn(e[u]):Yn(e[u]);v(t[u],n,i,null,s,r,o,a)}l>h?rt(t,s,r,!0,!1,c):R(e,i,n,s,r,o,a,c)},q=(t,e,i,n,s,r,o,a)=>{let l=0;const h=e.length;let c=t.length-1,u=h-1;for(;l<=c&&l<=u;){const n=t[l],h=e[l]=a?Kn(e[l]):Yn(e[l]);if(!Vn(n,h))break;v(n,h,i,null,s,r,o,a),l++}for(;l<=c&&l<=u;){const n=t[c],l=e[u]=a?Kn(e[u]):Yn(e[u]);if(!Vn(n,l))break;v(n,l,i,null,s,r,o,a),c--,u--}if(l>c){if(l<=u){const t=u+1,c=t<h?e[t].el:n;for(;l<=u;)v(null,e[l]=a?Kn(e[l]):Yn(e[l]),i,c,s,r,o),l++}}else if(l>u)for(;l<=c;)Q(t[l],s,r,!0),l++;else{const f=l,p=l,m=new Map;for(l=p;l<=u;l++){const t=e[l]=a?Kn(e[l]):Yn(e[l]);null!=t.key&&(m.has(t.key)&&ce("Duplicate keys found during update:",JSON.stringify(t.key),"Make sure keys are unique."),m.set(t.key,l))}let b,g=0;const y=u-p+1;let S=!1,x=0;const E=new Array(y);for(l=0;l<y;l++)E[l]=0;for(l=f;l<=c;l++){const n=t[l];if(g>=y){Q(n,s,r,!0);continue}let h;if(null!=n.key)h=m.get(n.key);else for(b=p;b<=u;b++)if(0===E[b-p]&&Vn(n,e[b])){h=b;break}void 0===h?Q(n,s,r,!0):(E[h-p]=l+1,h>=x?x=h:S=!0,v(n,e[h],i,null,s,r,o,a),g++)}const _=S?function(t){const e=t.slice(),i=[0];let n,s,r,o,a;const l=t.length;for(n=0;n<l;n++){const l=t[n];if(0!==l){if(s=i[i.length-1],t[s]<l){e[n]=s,i.push(n);continue}for(r=0,o=i.length-1;r<o;)a=(r+o)/2|0,t[i[a]]<l?r=a+1:o=a;l<t[i[r]]&&(r>0&&(e[n]=i[r-1]),i[r]=n)}}r=i.length,o=i[r-1];for(;r-- >0;)i[r]=o,o=e[o];return i}(E):d;for(b=_.length-1,l=y-1;l>=0;l--){const t=p+l,a=e[t],c=t+1<h?e[t+1].el:n;0===E[l]?v(null,a,i,c,s,r,o):S&&(b<0||l!==_[b]?$(a,i,c,2):b--)}}},$=(t,e,n,s,r=null)=>{const{el:o,type:a,transition:l,children:h,shapeFlag:c}=t;if(6&c)return void $(t.component.subTree,e,n,s);if(128&c)return void t.suspense.move(e,n,s);if(64&c)return void a.move(t,e,n,ht);if(a===Rn){i(o,e,n);for(let t=0;t<h.length;t++)$(h[t],e,n,s);return void i(t.anchor,e,n)}if(a===Bn)return void M(t,e,n);if(2!==s&&1&c&&l)if(0===s)l.beforeEnter(o),i(o,e,n),xn((()=>l.enter(o)),r);else{const{leave:t,delayLeave:s,afterLeave:r}=l,a=()=>i(o,e,n),h=()=>{t(o,(()=>{a(),r&&r()}))};s?s(o,a,h):h()}else i(o,e,n)},Q=(t,e,i,n=!1,s=!1)=>{const{type:r,props:o,ref:a,children:l,dynamicChildren:h,shapeFlag:c,patchFlag:u,dirs:d}=t;if(null!=a&&En(a,null,i,null),256&c)return void e.ctx.deactivate(t);const f=1&c&&d;let p;if((p=o&&o.onVnodeBeforeUnmount)&&wn(p,e,t),6&c)it(t.component,i,n);else{if(128&c)return void t.suspense.unmount(i,n);f&&un(t,null,e,"beforeUnmount"),h&&(r!==Rn||u>0&&64&u)?rt(h,e,i,!1,!0):(r===Rn&&(128&u||256&u)||!s&&16&c)&&rt(l,e,i),64&c&&(n||!Mn(t.props))&&t.type.remove(t,ht),n&&tt(t)}((p=o&&o.onVnodeUnmounted)||f)&&xn((()=>{p&&wn(p,e,t),f&&un(t,null,e,"unmounted")}),i)},tt=t=>{const{type:e,el:i,anchor:s,transition:r}=t;if(e===Rn)return void et(i,s);if(e===Bn)return void P(t);const o=()=>{n(i),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&t.shapeFlag&&r&&!r.persisted){const{leave:e,delayLeave:n}=r,s=()=>e(i,o);n?n(t.el,o,s):s()}else o()},et=(t,e)=>{let i;for(;t!==e;)i=m(t),n(t),t=i;n(e)},it=(t,e,i)=>{t.type.__hmrId&&function(t){Ue.get(t.type.__hmrId).instances.delete(t)}(t);const{bum:n,effects:s,update:r,subTree:o,um:a}=t;if(n&&U(n),s)for(let l=0;l<s.length;l++)Z(s[l]);r&&(Z(r),Q(o,t,e,i)),a&&xn(a,e),xn((()=>{t.isUnmounted=!0}),e),e&&e.pendingBranch&&!e.isUnmounted&&t.asyncDep&&!t.asyncResolved&&t.suspenseId===e.pendingId&&(e.deps--,0===e.deps&&e.resolve()),Ke(t)},rt=(t,e,i,n=!1,s=!1,r=0)=>{for(let o=r;o<t.length;o++)Q(t[o],e,i,n,s)},at=t=>6&t.shapeFlag?at(t.component.subTree):128&t.shapeFlag?t.suspense.next():m(t.anchor||t.el),lt=(t,e)=>{null==t?e._vnode&&Q(e._vnode,null,null,!0):v(e._vnode||null,t,e),Oe(),e._vnode=t},ht={p:v,um:Q,m:$,r:tt,mt:W,mc:R,pc:Y,pbc:B,n:at,o:t};let ct,ut;e&&([ct,ut]=e(ht));return{render:lt,hydrate:ct,createApp:bn(lt,ct)}}(t)}function wn(t,e,i,n=null){me(t,e,7,[i,n])}function Tn(t,e,i=!1){const n=t.children,s=e.children;if(E(n)&&E(s))for(let r=0;r<n.length;r++){const t=n[r];let e=s[r];1&e.shapeFlag&&!e.dynamicChildren&&((e.patchFlag<=0||32===e.patchFlag)&&(e=s[r]=Kn(s[r]),e.el=t.el),i||Tn(t,e)),e.type!==Fn||e.el||(e.el=t.el)}}const Mn=t=>t&&(t.disabled||""===t.disabled),Pn=t=>"undefined"!=typeof SVGElement&&t instanceof SVGElement,Ln=(t,e)=>{const i=t&&t.to;if(T(i)){if(e){const t=e(i);return t||ce(`Failed to locate Teleport target with selector "${i}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`),t}return ce("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"),null}return i||Mn(t)||ce(`Invalid Teleport target: ${i}`),i};function An(t,e,i,{o:{insert:n},m:s},r=2){0===r&&n(t.targetAnchor,e,i);const{el:o,anchor:a,shapeFlag:l,children:h,props:c}=t,u=2===r;if(u&&n(o,e,i),(!u||Mn(c))&&16&l)for(let d=0;d<h.length;d++)s(h[d],e,i,2);u&&n(a,e,i)}const Cn={__isTeleport:!0,process(t,e,i,n,s,r,o,a,l){const{mc:h,pc:c,pbc:u,o:{insert:d,querySelector:f,createText:p,createComment:m}}=l,b=Mn(e.props),{shapeFlag:g,children:y}=e;if(null==t){const t=e.el=m("teleport start"),l=e.anchor=m("teleport end");d(t,i,n),d(l,i,n);const c=e.target=Ln(e.props,f),u=e.targetAnchor=p("");c?(d(u,c),o=o||Pn(c)):b||ce("Invalid Teleport target on mount:",c,`(${typeof c})`);const S=(t,e)=>{16&g&&h(y,t,e,s,r,o,a)};b?S(i,l):c&&S(c,u)}else{e.el=t.el;const n=e.anchor=t.anchor,h=e.target=t.target,d=e.targetAnchor=t.targetAnchor,p=Mn(t.props),m=p?i:h,g=p?n:d;if(o=o||Pn(h),e.dynamicChildren?(u(t.dynamicChildren,e.dynamicChildren,m,s,r,o),Tn(t,e,!0)):a||c(t,e,m,g,s,r,o),b)p||An(e,i,n,l,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const t=e.target=Ln(e.props,f);t?An(e,t,null,l,0):ce("Invalid Teleport target on update:",h,`(${typeof h})`)}else p&&An(e,h,d,l,1)}},remove(t,{r:e,o:{remove:i}}){const{shapeFlag:n,children:s,anchor:r}=t;if(i(r),16&n)for(let o=0;o<s.length;o++)e(s[o])},move:An,hydrate:function(t,e,i,n,s,{o:{nextSibling:r,parentNode:o,querySelector:a}},l){const h=e.target=Ln(e.props,a);if(h){const a=h._lpa||h.firstChild;16&e.shapeFlag&&(Mn(e.props)?(e.anchor=l(r(t),e,o(t),i,n,s),e.targetAnchor=a):(e.anchor=r(t),e.targetAnchor=l(a,e,h,i,n,s)),h._lpa=e.targetAnchor&&r(e.targetAnchor))}return e.anchor&&r(e.anchor)}},In=Symbol(),Rn=Symbol("Fragment"),Nn=Symbol("Text"),Fn=Symbol("Comment"),Bn=Symbol("Static"),On=[];let Dn=null;function kn(t){return!!t&&!0===t.__v_isVNode}function Vn(t,e){return!(6&e.shapeFlag&&We.has(e.type))&&(t.type===e.type&&t.key===e.key)}const Gn="__vInternal",Wn=({key:t})=>null!=t?t:null,Un=({ref:t})=>null!=t?T(t)||Qt(t)||w(t)?{i:Qe,r:t}:t:null,zn=(...t)=>function(t,e=null,i=null,n=0,r=null,o=!1){t&&t!==In||(t||ce(`Invalid vnode type when creating vnode: ${t}.`),t=Fn);if(kn(t)){const n=jn(t,e,!0);return i&&qn(n,i),n}Ms(t)&&(t=t.__vccOpts);if(e){($t(e)||Gn in e)&&(e=y({},e));let{class:t,style:i}=e;t&&!T(t)&&(e.class=l(t)),P(i)&&($t(i)&&!E(i)&&(i=y({},i)),e.style=s(i))}const a=T(t)?1:(t=>t.__isSuspense)(t)?128:(t=>t.__isTeleport)(t)?64:P(t)?4:w(t)?2:0;4&a&&$t(t)&&ce("Vue received a Component which was made a reactive object. This can lead to unnecessary performance overhead, and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.","\nComponent that was made reactive: ",t=Jt(t));const h={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Wn(e),ref:e&&Un(e),scopeId:null,children:null,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:n,dynamicProps:r,dynamicChildren:null,appContext:null};h.key!=h.key&&ce("VNode created with invalid key (NaN). VNode type:",h.type);if(qn(h,i),128&a){const{content:t,fallback:e}=function(t){const{shapeFlag:e,children:i}=t;let n,s;return 32&e?(n=ci(i.default),s=ci(i.fallback)):(n=ci(i),s=Yn(null)),{content:n,fallback:s}}(h);h.ssContent=t,h.ssFallback=e}!o&&Dn&&(n>0||6&a)&&32!==n&&Dn.push(h);return h}(...t);function jn(t,e,i=!1){const{props:n,ref:s,patchFlag:r,children:o}=t,a=e?$n(n||{},e):n;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:a,key:a&&Wn(a),ref:e&&e.ref?i&&s?E(s)?s.concat(Un(e)):[s,Un(e)]:Un(e):s,scopeId:t.scopeId,children:-1===r&&E(o)?o.map(Hn):o,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Rn?-1===r?16:16|r:r,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&jn(t.ssContent),ssFallback:t.ssFallback&&jn(t.ssFallback),el:t.el,anchor:t.anchor}}function Hn(t){const e=jn(t);return E(t.children)&&(e.children=t.children.map(Hn)),e}function Xn(t=" ",e=0){return zn(Nn,null,t,e)}function Yn(t){return null==t||"boolean"==typeof t?zn(Fn):E(t)?zn(Rn,null,t):"object"==typeof t?null===t.el?t:jn(t):zn(Nn,null,String(t))}function Kn(t){return null===t.el?t:jn(t)}function qn(t,e){let i=0;const{shapeFlag:n}=t;if(null==e)e=null;else if(E(e))i=16;else if("object"==typeof e){if(1&n||64&n){const i=e.default;return void(i&&(i._c&&di(1),qn(t,i()),i._c&&di(-1)))}{i=32;const n=e._;n||Gn in e?3===n&&Qe&&(1024&Qe.vnode.patchFlag?(e._=2,t.patchFlag|=1024):e._=1):e._ctx=Qe}}else w(e)?(e={default:e,_ctx:Qe},i=32):(e=String(e),64&n?(i=16,e=[Xn(e)]):i=8);t.children=e,t.shapeFlag|=i}function $n(...t){const e=y({},t[0]);for(let i=1;i<t.length;i++){const n=t[i];for(const t in n)if("class"===t)e.class!==n.class&&(e.class=l([e.class,n.class]));else if("style"===t)e.style=s([e.style,n.style]);else if(b(t)){const i=e[t],s=n[t];i!==s&&(e[t]=i?[].concat(i,n[t]):s)}else""!==t&&(e[t]=n[t])}return e}function Jn(t,e,i=!1){const n=fs||Qe;if(n){const s=null==n.parent?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides;if(s&&t in s)return s[t];if(arguments.length>1)return i&&w(e)?e():e;ce(`injection "${String(t)}" not found.`)}else ce("inject() can only be used inside setup() or functional components.")}let Zn=!1;function Qn(t,e,i=[],n=[],s=[],r=!1){const{mixins:o,extends:a,data:l,computed:h,methods:c,watch:d,provide:p,inject:m,components:b,directives:g,beforeMount:S,mounted:v,beforeUpdate:x,updated:_,activated:T,deactivated:M,beforeDestroy:L,beforeUnmount:A,destroyed:C,unmounted:I,render:R,renderTracked:N,renderTriggered:F,errorCaptured:B,expose:O}=e,D=t.proxy,k=t.ctx,V=t.appContext.mixins;r&&R&&t.render===f&&(t.render=R),r||(Zn=!0,ts("beforeCreate","bc",e,t,V),Zn=!1,ns(t,V,i,n,s)),a&&Qn(t,a,i,n,s,!0),o&&ns(t,o,i,n,s);const G=function(){const t=Object.create(null);return(e,i)=>{t[i]?ce(`${e} property "${i}" is already defined in ${t[i]}.`):t[i]=e}}();{const[e]=t.propsOptions;if(e)for(const t in e)G("Props",t)}if(m)if(E(m))for(let u=0;u<m.length;u++){const t=m[u];k[t]=Jn(t),G("Inject",t)}else for(const u in m){const t=m[u];P(t)?k[u]=Jn(t.from||u,t.default,!0):k[u]=Jn(t),G("Inject",u)}if(c)for(const u in c){const t=c[u];w(t)?(Object.defineProperty(k,u,{value:t.bind(D),configurable:!0,enumerable:!1}),G("Methods",u)):ce(`Method "${u}" has type "${typeof t}" in the component definition. Did you reference the function correctly?`)}if(r)l&&i.push(l);else{i.length&&i.forEach((e=>ss(t,e,D))),l&&ss(t,l,D);{const e=Jt(t.data);for(const t in e)G("Data",t),"$"!==t[0]&&"_"!==t[0]&&Object.defineProperty(k,t,{configurable:!0,enumerable:!0,get:()=>e[t],set:f})}}if(h)for(const u in h){const t=h[u],e=w(t)?t.bind(D,D):w(t.get)?t.get.bind(D,D):f;e===f&&ce(`Computed property "${u}" has no getter.`);const i=Ps({get:e,set:!w(t)&&w(t.set)?t.set.bind(D):()=>{ce(`Write operation failed: computed property "${u}" is readonly.`)}});Object.defineProperty(k,u,{enumerable:!0,configurable:!0,get:()=>i.value,set:t=>i.value=t}),G("Computed",u)}if(d&&n.push(d),!r&&n.length&&n.forEach((t=>{for(const e in t)rs(t[e],k,D,e)})),p&&s.push(p),!r&&s.length&&s.forEach((t=>{const e=w(t)?t.call(D):t;Reflect.ownKeys(e).forEach((t=>{!function(t,e){if(fs){let i=fs.provides;const n=fs.parent&&fs.parent.provides;n===i&&(i=fs.provides=Object.create(n)),i[t]=e}else ce("provide() can only be used inside setup().")}(t,e[t])}))})),r&&(b&&y(t.components||(t.components=y({},t.type.components)),b),g&&y(t.directives||(t.directives=y({},t.type.directives)),g)),r||ts("created","c",e,t,V),S&&Ci(S.bind(D)),v&&Ii(v.bind(D)),x&&Ri(x.bind(D)),_&&Ni(_.bind(D)),T&&Zi(T.bind(D)),M&&Qi(M.bind(D)),B&&((t,e=fs)=>{Li("ec",t,e)})(B.bind(D)),N&&Di(N.bind(D)),F&&Oi(F.bind(D)),L&&ce("`beforeDestroy` has been renamed to `beforeUnmount`."),A&&Fi(A.bind(D)),C&&ce("`destroyed` has been renamed to `unmounted`."),I&&Bi(I.bind(D)),E(O))if(r)ce("The `expose` option is ignored when used in mixins.");else if(O.length){const e=t.exposed||(t.exposed=se({}));O.forEach((t=>{e[t]=function(t,e){return Qt(t[e])?t[e]:new re(t,e)}(D,t)}))}else t.exposed||(t.exposed=u)}function ts(t,e,i,n,s){is(t,e,s,n);const{extends:r,mixins:o}=i;r&&es(t,e,r,n),o&&is(t,e,o,n);const a=i[t];a&&me(a.bind(n.proxy),n,e)}function es(t,e,i,n){i.extends&&es(t,e,i.extends,n);const s=i[t];s&&me(s.bind(n.proxy),n,e)}function is(t,e,i,n){for(let s=0;s<i.length;s++){const r=i[s].mixins;r&&is(t,e,r,n);const o=i[s][t];o&&me(o.bind(n.proxy),n,e)}}function ns(t,e,i,n,s){for(let r=0;r<e.length;r++)Qn(t,e[r],i,n,s,!0)}function ss(t,e,i){w(e)||ce("The data option must be a function. Plain object usage is no longer supported.");const n=e.call(i,i);L(n)&&ce("data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>."),P(n)?t.data===u?t.data=jt(n):y(t.data,n):ce("data() should return an object.")}function rs(t,e,i,n){const s=n.includes(".")?function(t,e){const i=e.split(".");return()=>{let e=t;for(let t=0;t<i.length&&e;t++)e=e[i[t]];return e}}(i,n):()=>i[n];if(T(t)){const i=e[t];w(i)?Vi(s,i):ce(`Invalid watch handler specified by key "${t}"`,i)}else if(w(t))Vi(s,t.bind(i));else if(P(t))if(E(t))t.forEach((t=>rs(t,e,i,n)));else{const n=w(t.handler)?t.handler.bind(i):e[t.handler];w(n)?Vi(s,n,t):ce(`Invalid watch handler specified by key "${t.handler}"`,n)}else ce(`Invalid watch option: "${n}"`,t)}function os(t,e,i){const n=i.appContext.config.optionMergeStrategies,{mixins:s,extends:r}=e;r&&os(t,r,i),s&&s.forEach((e=>os(t,e,i)));for(const o in e)n&&x(n,o)?t[o]=n[o](t[o],e[o],i.proxy,o):t[o]=e[o]}const as=t=>t?ys(t)?t.exposed?t.exposed:t.proxy:as(t.parent):null,ls=y(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>Xt(t.props),$attrs:t=>Xt(t.attrs),$slots:t=>Xt(t.slots),$refs:t=>Xt(t.refs),$parent:t=>as(t.parent),$root:t=>as(t.root),$emit:t=>t.emit,$options:t=>function(t){const e=t.type,{__merged:i,mixins:n,extends:s}=e;if(i)return i;const r=t.appContext.mixins;if(!r.length&&!n&&!s)return e;const o={};return r.forEach((e=>os(o,e,t))),os(o,e,t),e.__merged=o}(t),$forceUpdate:t=>()=>Ie(t.update),$nextTick:t=>Ce.bind(t.proxy),$watch:t=>Wi.bind(t)}),hs={get({_:t},e){const{ctx:i,setupState:n,data:s,props:r,accessCache:o,type:a,appContext:l}=t;if("__v_skip"===e)return!0;if("__isVue"===e)return!0;let h;if("$"!==e[0]){const a=o[e];if(void 0!==a)switch(a){case 0:return n[e];case 1:return s[e];case 3:return i[e];case 2:return r[e]}else{if(n!==u&&x(n,e))return o[e]=0,n[e];if(s!==u&&x(s,e))return o[e]=1,s[e];if((h=t.propsOptions[0])&&x(h,e))return o[e]=2,r[e];if(i!==u&&x(i,e))return o[e]=3,i[e];Zn||(o[e]=4)}}const c=ls[e];let d,f;return c?("$attrs"===e&&(rt(t,"get",e),ii()),c(t)):(d=a.__cssModules)&&(d=d[e])?d:i!==u&&x(i,e)?(o[e]=3,i[e]):(f=l.config.globalProperties,x(f,e)?f[e]:void(!Qe||T(e)&&0===e.indexOf("__v")||(s===u||"$"!==e[0]&&"_"!==e[0]||!x(s,e)?t===Qe&&ce(`Property ${JSON.stringify(e)} was accessed during render but is not defined on instance.`):ce(`Property ${JSON.stringify(e)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`))))},set({_:t},e,i){const{data:n,setupState:s,ctx:r}=t;if(s!==u&&x(s,e))s[e]=i;else if(n!==u&&x(n,e))n[e]=i;else if(x(t.props,e))return ce(`Attempting to mutate prop "${e}". Props are readonly.`,t),!1;return"$"===e[0]&&e.slice(1)in t?(ce(`Attempting to mutate public property "${e}". Properties starting with $ are reserved and readonly.`,t),!1):(e in t.appContext.config.globalProperties?Object.defineProperty(r,e,{enumerable:!0,configurable:!0,value:i}):r[e]=i,!0)},has({_:{data:t,setupState:e,accessCache:i,ctx:n,appContext:s,propsOptions:r}},o){let a;return void 0!==i[o]||t!==u&&x(t,o)||e!==u&&x(e,o)||(a=r[0])&&x(a,o)||x(n,o)||x(ls,o)||x(s.config.globalProperties,o)},ownKeys:t=>(ce("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(t))},cs=y({},hs,{get(t,e){if(e!==Symbol.unscopables)return hs.get(t,e,t)},has(t,e){const n="_"!==e[0]&&!i(e);return!n&&hs.has(t,e)&&ce(`Property ${JSON.stringify(e)} should not start with _ which is a reserved prefix for Vue internals.`),n}});const us=dn();let ds=0;let fs=null;const ps=()=>fs||Qe,ms=t=>{fs=t},bs=e("slot,component");function gs(t,e){const i=e.isNativeTag||p;(bs(t)||i(t))&&ce("Do not use built-in or reserved HTML elements as component id: "+t)}function ys(t){return 4&t.vnode.shapeFlag}let Ss=!1;function vs(t,e,i){w(e)?t.render=e:P(e)?(kn(e)&&ce("setup() should not return VNodes directly - return a render function instead."),t.devtoolsRawSetupState=e,t.setupState=se(e),function(t){const{ctx:e,setupState:i}=t;Object.keys(Jt(i)).forEach((t=>{"$"!==t[0]&&"_"!==t[0]?Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:()=>i[t],set:f}):ce(`setup() return property ${JSON.stringify(t)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`)}))}(t)):void 0!==e&&ce("setup() should return an object. Received: "+(null===e?"null":typeof e)),xs(t)}function xs(t,e){const i=t.type;t.render||(t.render=i.render||f,t.render._rc&&(t.withProxy=new Proxy(t.ctx,cs))),fs=t,nt(),Qn(t,i),st(),fs=null,i.render||t.render!==f||(i.template?ce('Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".'):ce("Component is missing template or render function."))}const Es={get:(t,e)=>(ii(),t[e]),set:()=>(ce("setupContext.attrs is readonly."),!1),deleteProperty:()=>(ce("setupContext.attrs is readonly."),!1)};function _s(t,e=fs){e&&(e.effects||(e.effects=[])).push(t)}const ws=/(?:^|[-_])(\w)/g;function Ts(t,e,i=!1){let n=function(t){return w(t)&&t.displayName||t.name}(e);if(!n&&e.__file){const t=e.__file.match(/([^/\\]+)\.\w+$/);t&&(n=t[1])}if(!n&&t&&t.parent){const i=t=>{for(const i in t)if(t[i]===e)return i};n=i(t.components||t.parent.type.components)||i(t.appContext.components)}return n?n.replace(ws,(t=>t.toUpperCase())).replace(/[-_]/g,""):i?"App":"Anonymous"}function Ms(t){return w(t)&&"__vccOpts"in t}function Ps(t){const e=function(t){let e,i;return w(t)?(e=t,i=()=>{console.warn("Write operation failed: computed value is readonly")}):(e=t.get,i=t.set),new oe(e,i,w(t)||!t.set)}(t);return _s(e.effect),e}const Ls="3.0.6",As="http://www.w3.org/2000/svg",Cs="undefined"!=typeof document?document:null;let Is,Rs;const Ns={insert:(t,e,i)=>{e.insertBefore(t,i||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,i)=>e?Cs.createElementNS(As,t):Cs.createElement(t,i?{is:i}:void 0),createText:t=>Cs.createTextNode(t),createComment:t=>Cs.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Cs.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},cloneNode:t=>t.cloneNode(!0),insertStaticContent(t,e,i,n){const s=n?Rs||(Rs=Cs.createElementNS(As,"svg")):Is||(Is=Cs.createElement("div"));s.innerHTML=t;const r=s.firstChild;let o=r,a=o;for(;o;)a=o,Ns.insert(o,e,i),o=s.firstChild;return[r,a]}};const Fs=/\s*!important$/;function Bs(t,e,i){if(E(i))i.forEach((i=>Bs(t,e,i)));else if(e.startsWith("--"))t.setProperty(e,i);else{const n=function(t,e){const i=Ds[e];if(i)return i;let n=O(e);if("filter"!==n&&n in t)return Ds[e]=n;n=V(n);for(let s=0;s<Os.length;s++){const i=Os[s]+n;if(i in t)return Ds[e]=i}return e}(t,e);Fs.test(i)?t.setProperty(k(n),i.replace(Fs,""),"important"):t[n]=i}}const Os=["Webkit","Moz","ms"],Ds={};const ks="http://www.w3.org/1999/xlink";let Vs=Date.now;"undefined"!=typeof document&&Vs()>document.createEvent("Event").timeStamp&&(Vs=()=>performance.now());let Gs=0;const Ws=Promise.resolve(),Us=()=>{Gs=0};function zs(t,e,i,n,s=null){const r=t._vei||(t._vei={}),o=r[e];if(n&&o)o.value=n;else{const[i,a]=function(t){let e;if(js.test(t)){let i;for(e={};i=t.match(js);)t=t.slice(0,t.length-i[0].length),e[i[0].toLowerCase()]=!0}return[k(t.slice(2)),e]}(e);if(n){!function(t,e,i,n){t.addEventListener(e,i,n)}(t,i,r[e]=function(t,e){const i=t=>{(t.timeStamp||Vs())>=i.attached-1&&me(function(t,e){if(E(e)){const i=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{i.call(t),t._stopped=!0},e.map((t=>e=>!e._stopped&&t(e)))}return e}(t,i.value),e,5,[t])};return i.value=t,i.attached=(()=>Gs||(Ws.then(Us),Gs=Vs()))(),i}(n,s),a)}else o&&(!function(t,e,i,n){t.removeEventListener(e,i,n)}(t,i,o,a),r[e]=void 0)}}const js=/(?:Once|Passive|Capture)$/;const Hs=/^on[a-z]/;const Xs="transition",Ys=(t,{slots:e})=>function(t,e,i){const n=arguments.length;return 2===n?P(e)&&!E(e)?kn(e)?zn(t,null,[e]):zn(t,e):zn(t,null,e):(n>3?i=Array.prototype.slice.call(arguments,2):3===n&&kn(i)&&(i=[i]),zn(t,e,i))}(ji,function(t){let{name:e="v",type:i,css:n=!0,duration:s,enterFromClass:r=`${e}-enter-from`,enterActiveClass:o=`${e}-enter-active`,enterToClass:a=`${e}-enter-to`,appearFromClass:l=r,appearActiveClass:h=o,appearToClass:c=a,leaveFromClass:u=`${e}-leave-from`,leaveActiveClass:d=`${e}-leave-active`,leaveToClass:f=`${e}-leave-to`}=t;const p={};for(const y in t)y in Ks||(p[y]=t[y]);if(!n)return p;const m=function(t){if(null==t)return null;if(P(t))return[qs(t.enter),qs(t.leave)];{const e=qs(t);return[e,e]}}(s),b=m&&m[0],g=m&&m[1],{onBeforeEnter:S,onEnter:v,onEnterCancelled:x,onLeave:E,onLeaveCancelled:_,onBeforeAppear:w=S,onAppear:T=v,onAppearCancelled:M=x}=p,L=(t,e,i)=>{Js(t,e?c:a),Js(t,e?h:o),i&&i()},A=(t,e)=>{Js(t,f),Js(t,d),e&&e()},C=t=>(e,n)=>{const s=t?T:v,o=()=>L(e,t,n);s&&s(e,o),Zs((()=>{Js(e,t?l:r),$s(e,t?c:a),s&&s.length>1||tr(e,i,b,o)}))};return y(p,{onBeforeEnter(t){S&&S(t),$s(t,r),$s(t,o)},onBeforeAppear(t){w&&w(t),$s(t,l),$s(t,h)},onEnter:C(!1),onAppear:C(!0),onLeave(t,e){const n=()=>A(t,e);$s(t,u),document.body.offsetHeight,$s(t,d),Zs((()=>{Js(t,u),$s(t,f),E&&E.length>1||tr(t,i,g,n)})),E&&E(t,n)},onEnterCancelled(t){L(t,!1),x&&x(t)},onAppearCancelled(t){L(t,!0),M&&M(t)},onLeaveCancelled(t){A(t),_&&_(t)}})}(t),e);Ys.displayName="Transition";const Ks={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};function qs(t){const e=j(t);return function(t){"number"!=typeof t?ce(`<transition> explicit duration is not a valid number - got ${JSON.stringify(t)}.`):isNaN(t)&&ce("<transition> explicit duration is NaN - the duration expression might be incorrect.")}(e),e}function $s(t,e){e.split(/\s+/).forEach((e=>e&&t.classList.add(e))),(t._vtc||(t._vtc=new Set)).add(e)}function Js(t,e){e.split(/\s+/).forEach((e=>e&&t.classList.remove(e)));const{_vtc:i}=t;i&&(i.delete(e),i.size||(t._vtc=void 0))}function Zs(t){requestAnimationFrame((()=>{requestAnimationFrame(t)}))}Ys.props=y({},ji.props,Ks);let Qs=0;function tr(t,e,i,n){const s=t._endId=++Qs,r=()=>{s===t._endId&&n()};if(i)return setTimeout(r,i);const{type:o,timeout:a,propCount:l}=function(t,e){const i=window.getComputedStyle(t),n=t=>(i[t]||"").split(", "),s=n("transitionDelay"),r=n("transitionDuration"),o=er(s,r),a=n("animationDelay"),l=n("animationDuration"),h=er(a,l);let c=null,u=0,d=0;e===Xs?o>0&&(c=Xs,u=o,d=r.length):"animation"===e?h>0&&(c="animation",u=h,d=l.length):(u=Math.max(o,h),c=u>0?o>h?Xs:"animation":null,d=c?c===Xs?r.length:l.length:0);const f=c===Xs&&/\b(transform|all)(,|$)/.test(i.transitionProperty);return{type:c,timeout:u,propCount:d,hasTransform:f}}(t,e);if(!o)return n();const h=o+"end";let c=0;const u=()=>{t.removeEventListener(h,d),r()},d=e=>{e.target===t&&++c>=l&&u()};setTimeout((()=>{c<l&&u()}),a+1),t.addEventListener(h,d)}function er(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map(((e,i)=>ir(e)+ir(t[i]))))}function ir(t){return 1e3*Number(t.slice(0,-1).replace(",","."))}const nr={beforeMount(t,{value:e},{transition:i}){t._vod="none"===t.style.display?"":t.style.display,i&&e?i.beforeEnter(t):sr(t,e)},mounted(t,{value:e},{transition:i}){i&&e&&i.enter(t)},updated(t,{value:e,oldValue:i},{transition:n}){n&&e!==i?e?(n.beforeEnter(t),sr(t,!0),n.enter(t)):n.leave(t,(()=>{sr(t,!1)})):sr(t,e)},beforeUnmount(t,{value:e}){sr(t,e)}};function sr(t,e){t.style.display=e?t._vod:"none"}const rr=y({patchProp:(t,e,i,s,r=!1,o,a,l,h)=>{switch(e){case"class":!function(t,e,i){if(null==e&&(e=""),i)t.setAttribute("class",e);else{const i=t._vtc;i&&(e=(e?[e,...i]:[...i]).join(" ")),t.className=e}}(t,s,r);break;case"style":!function(t,e,i){const n=t.style;if(i)if(T(i))e!==i&&(n.cssText=i);else{for(const t in i)Bs(n,t,i[t]);if(e&&!T(e))for(const t in e)null==i[t]&&Bs(n,t,"")}else t.removeAttribute("style")}(t,i,s);break;default:b(e)?g(e)||zs(t,e,0,s,a):function(t,e,i,n){if(n)return"innerHTML"===e||!!(e in t&&Hs.test(e)&&w(i));if("spellcheck"===e||"draggable"===e)return!1;if("form"===e)return!1;if("list"===e&&"INPUT"===t.tagName)return!1;if("type"===e&&"TEXTAREA"===t.tagName)return!1;if(Hs.test(e)&&T(i))return!1;return e in t}(t,e,s,r)?function(t,e,i,n,s,r,o){if("innerHTML"===e||"textContent"===e)return n&&o(n,s,r),void(t[e]=null==i?"":i);if("value"!==e||"PROGRESS"===t.tagName){if(""===i||null==i){const n=typeof t[e];if(""===i&&"boolean"===n)return void(t[e]=!0);if(null==i&&"string"===n)return t[e]="",void t.removeAttribute(e);if("number"===n)return t[e]=0,void t.removeAttribute(e)}try{t[e]=i}catch(a){ce(`Failed setting prop "${e}" on <${t.tagName.toLowerCase()}>: value ${i} is invalid.`,a)}}else{t._value=i;const e=null==i?"":i;t.value!==e&&(t.value=e)}}(t,e,s,o,a,l,h):("true-value"===e?t._trueValue=s:"false-value"===e&&(t._falseValue=s),function(t,e,i,s){if(s&&e.startsWith("xlink:"))null==i?t.removeAttributeNS(ks,e.slice(6,e.length)):t.setAttributeNS(ks,e,i);else{const s=n(e);null==i||s&&!1===i?t.removeAttribute(e):t.setAttribute(e,s?"":i)}}(t,e,s,r))}},forcePatchProp:(t,e)=>"value"===e},Ns);let or;const ar=(...t)=>{const e=(or||(or=_n(rr))).createApp(...t);!function(t){Object.defineProperty(t.config,"isNativeTag",{value:t=>h(t)||c(t),writable:!1})}(e);const{mount:i}=e;return e.mount=t=>{const n=function(t){if(T(t)){const e=document.querySelector(t);return e||ce(`Failed to mount app: mount target selector "${t}" returned null.`),e}t instanceof window.ShadowRoot&&"closed"===t.mode&&ce('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs');return t}(t);if(!n)return;const s=e._component;w(s)||s.render||s.template||(s.template=n.innerHTML),n.innerHTML="";const r=i(n);return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),r},e};function lr(t){var e={exports:{}};return t(e,e.exports),e.exports}!function(){const t=H||(H="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});var e;t.__VUE__=!0,e=t.__VUE_DEVTOOLS_GLOBAL_HOOK__,He=e,function(){if("undefined"==typeof window)return;const t={style:"color:#3ba776"},e={style:"color:#0b1bc9"},i={style:"color:#b62e24"},n={style:"color:#9d288c"},s={header:e=>P(e)?e.__isVue?["div",t,"VueInstance"]:Qt(e)?["div",{},["span",t,c(e)],"<",a(e.value),">"]:Kt(e)?["div",{},["span",t,"Reactive"],"<",a(e),">"+(qt(e)?" (readonly)":"")]:qt(e)?["div",{},["span",t,"Readonly"],"<",a(e),">"]:null:null,hasBody:t=>t&&t.__isVue,body(t){if(t&&t.__isVue)return["div",{},...r(t.$)]}};function r(t){const e=[];t.type.props&&t.props&&e.push(o("props",Jt(t.props))),t.setupState!==u&&e.push(o("setup",t.setupState)),t.data!==u&&e.push(o("data",Jt(t.data)));const i=l(t,"computed");i&&e.push(o("computed",i));const s=l(t,"inject");return s&&e.push(o("injected",s)),e.push(["div",{},["span",{style:n.style+";opacity:0.66"},"$ (internal): "],["object",{object:t}]]),e}function o(t,e){return e=y({},e),Object.keys(e).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},t],["div",{style:"padding-left:1.25em"},...Object.keys(e).map((t=>["div",{},["span",n,t+": "],a(e[t],!1)]))]]:["span",{}]}function a(t,s=!0){return"number"==typeof t?["span",e,t]:"string"==typeof t?["span",i,JSON.stringify(t)]:"boolean"==typeof t?["span",n,t]:P(t)?["object",{object:s?Jt(t):t}]:["span",i,String(t)]}function l(t,e){const i=t.type;if(w(i))return;const n={};for(const s in t.ctx)h(i,s,e)&&(n[s]=t.ctx[s]);return n}function h(t,e,i){const n=t[i];return!!(E(n)&&n.includes(e)||P(n)&&e in n)||!(!t.extends||!h(t.extends,e,i))||!(!t.mixins||!t.mixins.some((t=>h(t,e,i))))||void 0}function c(t){return t._shallow?"ShallowRef":t.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(s):window.devtoolsFormatters=[s]}()}(),function(t,e){var i,n=t.document,s=n.documentElement,r=n.querySelector('meta[name="viewport"]'),o=n.querySelector('meta[name="flexible"]'),a=0,l=0,h=e.flexible||(e.flexible={});if(r){console.warn("将根据已有的meta标签来设置缩放比例");var c=r.getAttribute("content").match(/initial\-scale=([\d\.]+)/);c&&(l=parseFloat(c[1]),a=parseInt(1/l))}else if(o){var u=o.getAttribute("content");if(u){var d=u.match(/initial\-dpr=([\d\.]+)/),f=u.match(/maximum\-dpr=([\d\.]+)/);d&&(a=parseFloat(d[1]),l=parseFloat((1/a).toFixed(2))),f&&(a=parseFloat(f[1]),l=parseFloat((1/a).toFixed(2)))}}if(!a&&!l){t.navigator.appVersion.match(/android/gi);var p=t.navigator.appVersion.match(/iphone/gi),m=t.devicePixelRatio;l=1/(a=p?m>=3&&(!a||a>=3)?3:m>=2&&(!a||a>=2)?2:1:1)}if(s.setAttribute("data-dpr",a),!r)if((r=n.createElement("meta")).setAttribute("name","viewport"),r.setAttribute("content","initial-scale="+l+", maximum-scale="+l+", minimum-scale="+l+", user-scalable=no"),s.firstElementChild)s.firstElementChild.appendChild(r);else{var b=n.createElement("div");b.appendChild(r),n.write(b.innerHTML)}function g(){var e=s.getBoundingClientRect().width;e/a>540&&(e=540*a);var i=e/10;s.style.fontSize=i+"px",h.rem=t.rem=i}t.addEventListener("resize",(function(){clearTimeout(i),i=setTimeout(g,300)}),!1),t.addEventListener("pageshow",(function(t){t.persisted&&(clearTimeout(i),i=setTimeout(g,300))}),!1),"complete"===n.readyState?n.body.style.fontSize=12*a+"px":n.addEventListener("DOMContentLoaded",(function(t){n.body.style.fontSize=12*a+"px"}),!1),g(),h.dpr=t.dpr=a,h.refreshRem=g,h.rem2px=function(t){var e=parseFloat(t)*this.rem;return"string"==typeof t&&t.match(/rem$/)&&(e+="px"),e},h.px2rem=function(t){var e=parseFloat(t)/this.rem;return"string"==typeof t&&t.match(/px$/)&&(e+="rem"),e}}(window,window.lib||(window.lib={}));var hr=lr((function(e,i){window,e.exports=function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=184)}([function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.Fraction=void 0;class n{constructor(t=0,e=1,i=0,n=!0){this.numerator=0,this.denominator=1,this.wholeValue=0,this.numerator=t,this.denominator=e,this.wholeValue=i,n&&this.simplify(),this.setRealValue()}static max(t,e){return t.RealValue>e.RealValue?t:e}static Equal(t,e){return t.wholeValue===e.wholeValue&&t.Denominator===e.Denominator&&t.Numerator===e.Numerator}static createFromFraction(t){return new n(t.numerator,t.denominator,t.wholeValue,!1)}static plus(t,e){const i=t.clone();return i.Add(e),i}static minus(t,e){const i=t.clone();return i.Sub(e),i}static multiply(t,e){return new n((t.wholeValue*t.denominator+t.numerator)*(e.wholeValue*e.denominator+e.numerator),t.denominator*e.denominator)}static greatestCommonDenominator(t,e){if(0===t)return e;if(1===e)return 1;for(;Math.abs(e)>1e-8;)t>e?t-=e:e-=t;return Math.round(t)}toString(){let t=this.numerator+"/"+this.denominator;return 0!==this.wholeValue&&(t=this.wholeValue+" "+t),t}clone(){return new n(this.numerator,this.denominator,this.wholeValue,!1)}get Numerator(){return this.numerator}set Numerator(t){this.numerator!==t&&(this.numerator=t,this.simplify(),this.setRealValue())}get Denominator(){return this.denominator}set Denominator(t){this.denominator!==t&&(this.denominator=t,0!==this.numerator&&this.simplify(),this.setRealValue())}get WholeValue(){return this.wholeValue}set WholeValue(t){this.wholeValue!==t&&(this.wholeValue=t,this.setRealValue())}GetExpandedNumerator(){return this.wholeValue*this.denominator+this.numerator}IsNegative(){return this.realValue<0}get RealValue(){return this.realValue}expand(t){this.numerator*=t,this.denominator*=t,0!==this.wholeValue&&(this.numerator+=this.wholeValue*this.denominator,this.wholeValue=0)}Add(t){return this.numerator=(this.wholeValue*this.denominator+this.numerator)*t.denominator+(t.wholeValue*t.denominator+t.numerator)*this.denominator,this.denominator=this.denominator*t.denominator,this.wholeValue=0,this.simplify(),this.setRealValue(),this}Sub(t){return this.numerator=(this.wholeValue*this.denominator+this.numerator)*t.denominator-(t.wholeValue*t.denominator+t.numerator)*this.denominator,this.denominator=this.denominator*t.denominator,this.wholeValue=0,this.simplify(),this.setRealValue(),this}Quantize(t){if(this.denominator<=t)return this;const e=new n(this.numerator+1,this.denominator,this.wholeValue);for(;e.Denominator>t;)e.Numerator++;if(this.numerator>this.denominator){const i=new n(this.numerator-1,this.denominator,this.wholeValue);for(;i.Denominator>t;)i.Numerator--;if(i.Denominator<e.Denominator)return i}return e}Equals(t){return this.realValue===(null==t?void 0:t.realValue)}CompareTo(t){const e=this.realValue-t.realValue;return e?e<0?-1:1:0}lt(t){return this.realValue<t.realValue}lte(t){return this.realValue<=t.realValue}gt(t){return!this.lte(t)}gte(t){return!this.lt(t)}setRealValue(){this.realValue=this.wholeValue+this.numerator/this.denominator}simplify(){if(0===this.numerator)return void(this.denominator=1);const t=n.greatestCommonDenominator(Math.abs(this.numerator),Math.abs(this.denominator));this.numerator/=t,this.denominator/=t;const e=Math.floor(this.numerator/this.denominator);if(0!==e&&(this.wholeValue+=e,this.numerator-=e*this.denominator,0===this.numerator&&(this.denominator=1)),this.denominator>n.maximumAllowedNumber){const t=this.denominator/n.maximumAllowedNumber;this.numerator=Math.round(this.numerator/t),this.denominator=Math.round(this.denominator/t)}if(this.numerator>n.maximumAllowedNumber){const t=this.numerator/n.maximumAllowedNumber;this.numerator=Math.round(this.numerator/t),this.denominator=Math.round(this.denominator/t)}}isOnBeat(t){const e=this.distanceFromBeat(t);return Math.abs(e)<n.FloatInaccuracyTolerance}distanceFromBeat(t){const e=new n(1,t.Denominator);return this.RealValue%e.RealValue}}e.Fraction=n,n.maximumAllowedNumber=46340,n.FloatInaccuracyTolerance=1e-4},function(t,e,i){var n,s;void 0===(s="function"==typeof(n=function(){var t=function(){},e="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function n(t,e){var i=t[e];if("function"==typeof i.bind)return i.bind(t);try{return Function.prototype.bind.call(i,t)}catch(n){return function(){return Function.prototype.apply.apply(i,[t,arguments])}}}function s(){ &&( .apply? .apply(console,arguments):Function.prototype.apply.apply( ,[console,arguments])),console.trace&&console.trace()}function r(i){return"debug"===i&&(i="log"),"undefined"!=typeof console&&("trace"===i&&e?s:void 0!==console[i]?n(console,i):void 0!== ?n(console,"log"):t)}function o(e,n){for(var s=0;s<i.length;s++){var r=i[s];this[r]=s<e?t:this.methodFactory(r,e,n)}this.log=this.debug}function a(t,e,i){return function(){"undefined"!=typeof console&&(o.call(this,e,i),this[t].apply(this,arguments))}}function l(t,e,i){return r(t)||a.apply(this,arguments)}function h(t,e,n){var s,r=this,a="loglevel";function h(){var t;if("undefined"!=typeof window){try{t=window.localStorage[a]}catch(n){}if(void 0===t)try{var e=window.document.cookie,i=e.indexOf(encodeURIComponent(a)+"=");-1!==i&&(t=/^([^;]+)/.exec(e.slice(i))[1])}catch(n){}return void 0===r.levels[t]&&(t=void 0),t}}t&&(a+=":"+t),r.name=t,r.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},r.methodFactory=n||l,r.getLevel=function(){return s},r.setLevel=function(e,n){if("string"==typeof e&&void 0!==r.levels[e.toUpperCase()]&&(e=r.levels[e.toUpperCase()]),!("number"==typeof e&&e>=0&&e<=r.levels.SILENT))throw"log.setLevel() called with invalid level: "+e;if(s=e,!1!==n&&function(t){var e=(i[t]||"silent").toUpperCase();if("undefined"!=typeof window){try{return void(window.localStorage[a]=e)}catch(n){}try{window.document.cookie=encodeURIComponent(a)+"="+e+";"}catch(n){}}}(e),o.call(r,e,t),"undefined"==typeof console&&e<r.levels.SILENT)return"No console available for logging"},r.setDefaultLevel=function(t){h()||r.setLevel(t,!1)},r.enableAll=function(t){r.setLevel(r.levels.TRACE,t)},r.disableAll=function(t){r.setLevel(r.levels.SILENT,t)};var c=h();null==c&&(c=null==e?"WARN":e),r.setLevel(c,!1)}var c=new h,u={};c.getLogger=function(t){if("string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=u[t];return e||(e=u[t]=new h(t,c.getLevel(),c.methodFactory)),e};var d="undefined"!=typeof window?window.log:void 0;return c.noConflict=function(){return"undefined"!=typeof window&&window.log===c&&(window.log=d),c},c.getLoggers=function(){return u},c})?n.call(e,i,e,t):n)||(t.exports=s)},function(t,e,i){var n,s,r;Object.defineProperty(e,"__esModule",{value:!0}),e.Pitch=e.AccidentalEnum=e.NoteEnum=void 0,(r=n=e.NoteEnum||(e.NoteEnum={}))[r.C=0]="C",r[r.D=2]="D",r[r.E=4]="E",r[r.F=5]="F",r[r.G=7]="G",r[r.A=9]="A",r[r.B=11]="B",function(t){t[t.SHARP=0]="SHARP",t[t.FLAT=1]="FLAT",t[t.NONE=2]="NONE",t[t.NATURAL=3]="NATURAL",t[t.DOUBLESHARP=4]="DOUBLESHARP",t[t.DOUBLEFLAT=5]="DOUBLEFLAT",t[t.TRIPLESHARP=6]="TRIPLESHARP",t[t.TRIPLEFLAT=7]="TRIPLEFLAT",t[t.QUARTERTONESHARP=8]="QUARTERTONESHARP",t[t.QUARTERTONEFLAT=9]="QUARTERTONEFLAT"}(s=e.AccidentalEnum||(e.AccidentalEnum={}));class o{constructor(t,e,i){this.accidental=s.NONE,this.fundamentalNote=t,this.octave=e,this.accidental=i,this.halfTone=t+12*(e+o.octXmlDiff)+o.HalfTonesFromAccidental(i),this.frequency=o.calcFrequency(this)}static getNoteEnumString(t){switch(t){case n.C:return"C";case n.D:return"D";case n.E:return"E";case n.F:return"F";case n.G:return"G";case n.A:return"A";case n.B:return"B";default:return""}}static stepFromNoteEnum(t,e){const i=o.pitchEnumValues,n=i.indexOf(t);let s=0,r=n+e%i.length;return n+e>i.length-1&&(s=1),r<0&&(r=i.length+r,s=-1),[i[r],s]}static CalculateTransposedHalfTone(t,e){const i=t.fundamentalNote+t.AccidentalHalfTones+e;return o.WrapAroundCheck(i,12)}static WrapAroundCheck(t,e){let i=0;for(;t<0;)t+=e,i--;for(;t>=e;)t-=e,i++;return{overflow:i,halftone:t}}static calcFrequency(t){let e,i=0;if(t instanceof o){const s=t;i=s.octave-1,e=s.fundamentalNote-n.A+s.AccidentalHalfTones}else"number"==typeof t&&(e=t-57);return 440*Math.pow(2,i)*Math.pow(2,e/12)}static calcFractionalKey(t){return Math.log(t/440)/Math.LN10*o.halftoneFactor+57}static fromFrequency(t){const e=o.calcFractionalKey(t)+.5,i=Math.floor(e/12)-o.octXmlDiff,n=Math.floor(e)%12;let r=n,a=s.NONE;return-1===this.pitchEnumValues.indexOf(r)&&(r=n-1,a=s.SHARP),new o(r,i,a)}static fromHalftone(t){const e=Math.floor(t/12)-o.octXmlDiff,i=t%12;let n=i,r=s.NONE;return-1===this.pitchEnumValues.indexOf(n)&&(n=i-1,r=s.SHARP),new o(n,e,r)}static ceiling(t){let e=t%=12;return-1===this.pitchEnumValues.indexOf(e)&&(e=t+1),e}static floor(t){let e=t%=12;return-1===this.pitchEnumValues.indexOf(e)&&(e=t-1),e}static HalfTonesFromAccidental(t){switch(t){case s.NONE:return 0;case s.SHARP:return 1;case s.FLAT:return-1;case s.NATURAL:return 0;case s.DOUBLESHARP:return 2;case s.DOUBLEFLAT:return-2;case s.QUARTERTONESHARP:return.5;case s.QUARTERTONEFLAT:return-.5;case s.TRIPLESHARP:return 3;case s.TRIPLEFLAT:return-3;default:throw new Error("Unhandled AccidentalEnum value")}}static AccidentalFromHalfTones(t){switch(t){case 0:return s.NONE;case 1:return s.SHARP;case-1:return s.FLAT;case 2:return s.DOUBLESHARP;case-2:return s.DOUBLEFLAT;case.5:return s.QUARTERTONESHARP;case-.5:return s.QUARTERTONEFLAT;case 3:return s.TRIPLESHARP;case-3:return s.TRIPLEFLAT;default:return t>0&&t<1?s.QUARTERTONESHARP:t<0&&t>-1?s.QUARTERTONEFLAT:s.QUARTERTONESHARP}}static accidentalVexflow(t){let e;switch(t){case s.NATURAL:e="n";break;case s.FLAT:e="b";break;case s.SHARP:e="#";break;case s.DOUBLESHARP:e="##";break;case s.TRIPLESHARP:e="++";break;case s.DOUBLEFLAT:e="bb";break;case s.TRIPLEFLAT:e="bbs";break;case s.QUARTERTONESHARP:e="+";break;case s.QUARTERTONEFLAT:e="d"}return e}get AccidentalHalfTones(){return o.HalfTonesFromAccidental(this.accidental)}get Octave(){return this.octave}get FundamentalNote(){return this.fundamentalNote}get Accidental(){return this.accidental}get Frequency(){return this.frequency}static get OctaveXmlDifference(){return o.octXmlDiff}getHalfTone(){return this.halfTone}getTransposedPitch(t){if(t>12)throw new Error("rewrite this method to handle bigger octave changes or don't use is with bigger octave changes!");return t>0?this.getHigherPitchByTransposeFactor(t):t<0?this.getLowerPitchByTransposeFactor(-t):this}DoEnharmonicChange(){switch(this.accidental){case s.FLAT:case s.DOUBLEFLAT:this.fundamentalNote=this.getPreviousFundamentalNote(this.fundamentalNote),this.accidental=o.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+o.octXmlDiff)));break;case s.SHARP:case s.DOUBLESHARP:this.fundamentalNote=this.getNextFundamentalNote(this.fundamentalNote),this.accidental=o.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+12*(this.octave+o.octXmlDiff)));break;default:return}}ToString(){let t=o.accidentalVexflow(this.accidental);return t||(t=""),"Key: "+o.getNoteEnumString(this.fundamentalNote)+t+", Note: "+this.fundamentalNote+", octave: "+this.octave.toString()}OperatorEquals(t){return!(!this||!t)&&this.FundamentalNote===t.FundamentalNote&&this.Octave===t.Octave&&this.Accidental===t.Accidental}OperatorNotEqual(t){return!(this===t)}OperatorFundamentalGreaterThan(t){const e=this;return e.Octave===t.Octave?e.FundamentalNote>t.FundamentalNote:e.Octave>t.Octave}OperatorFundamentalLessThan(t){const e=this;return e.Octave===t.Octave?e.FundamentalNote<t.FundamentalNote:e.Octave<t.Octave}getHigherPitchByTransposeFactor(t){const e=o.pitchEnumValues.indexOf(this.fundamentalNote);let i,n=this.octave;return e+t>o.pitchEnumValues.length-1?(i=o.pitchEnumValues[e+t-o.pitchEnumValues.length],n++):i=o.pitchEnumValues[e+t],new o(i,n,s.NONE)}getLowerPitchByTransposeFactor(t){const e=o.pitchEnumValues.indexOf(this.fundamentalNote);let i,n=this.octave;return e-t<0?(i=o.pitchEnumValues[o.pitchEnumValues.length+e-t],n--):i=o.pitchEnumValues[e-t],new o(i,n,s.NONE)}getNextFundamentalNote(t){let e=o.pitchEnumValues.indexOf(t);return e=(e+1)%o.pitchEnumValues.length,o.pitchEnumValues[e]}getPreviousFundamentalNote(t){const e=o.pitchEnumValues.indexOf(t);return e>0?o.pitchEnumValues[e-1]:o.pitchEnumValues[o.pitchEnumValues.length-1]}}e.Pitch=o,o.pitchEnumValues=[n.C,n.D,n.E,n.F,n.G,n.A,n.B],o.halftoneFactor=12/(Math.LN2/Math.LN10),o.octXmlDiff=3},function(t,e,i){var n,s;Object.defineProperty(e,"__esModule",{value:!0}),e.PlacementEnum=e.AbstractExpression=void 0,e.AbstractExpression=class{constructor(t){this.placement=t}static isStringInStringList(t,e){for(let i=0,n=t.length;i<n;++i){const n=t[i];if(e.toLowerCase()===n.toLowerCase().trim())return!0}return!1}get Placement(){return this.placement}static PlacementEnumFromString(t){switch(t.toLowerCase()){case"above":return n.Above;case"below":return n.Below;case"left":return n.Left;case"right":return n.Right;case"auto":default:return n.NotYetDefined}}},(s=n=e.PlacementEnum||(e.PlacementEnum={}))[s.Above=0]="Above",s[s.Below=1]="Below",s[s.Left=2]="Left",s[s.Right=3]="Right",s[s.NotYetDefined=4]="NotYetDefined"},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.PointF2D=void 0;class n{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}static get Empty(){return new n}static pointsAreEqual(t,e){return t.x===e.x&&t.y===e.y}ToString(){return"["+this.x+", "+this.y+"]"}}e.PointF2D=n},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ColDirEnum=e.BoundingBox=void 0;const s=n(i(1)),r=i(11),o=i(4),a=i(66),l=i(46),h=i(47),c=i(26),u=i(6);var d,f;e.BoundingBox=class{constructor(t,e,i=!1){this.isSymbol=!1,this.relativePositionHasBeenSet=!1,this.xBordersHaveBeenSet=!1,this.yBordersHaveBeenSet=!1,this.absolutePosition=new o.PointF2D,this.relativePosition=new o.PointF2D,this.size=new a.SizeF2D,this.marginSize=new a.SizeF2D,this.upperLeftCorner=new o.PointF2D,this.upperLeftMarginCorner=new o.PointF2D,this.borderLeft=0,this.borderRight=0,this.borderTop=0,this.borderBottom=0,this.borderMarginLeft=0,this.borderMarginRight=0,this.borderMarginTop=0,this.borderMarginBottom=0,this.childElements=[],this.parent=e,this.dataObject=t,this.isSymbol=i,this.xBordersHaveBeenSet=!1,this.yBordersHaveBeenSet=!1,e&&(this.Parent=e)}get RelativePositionHasBeenSet(){return this.relativePositionHasBeenSet}get XBordersHaveBeenSet(){return this.xBordersHaveBeenSet}set XBordersHaveBeenSet(t){this.xBordersHaveBeenSet=t}get YBordersHaveBeenSet(){return this.yBordersHaveBeenSet}set YBordersHaveBeenSet(t){this.yBordersHaveBeenSet=t}get AbsolutePosition(){return this.absolutePosition}set AbsolutePosition(t){this.absolutePosition=t}get RelativePosition(){return this.relativePosition}set RelativePosition(t){this.relativePosition=t,this.relativePositionHasBeenSet=!0}get Size(){return this.size}set Size(t){this.size=t}get MarginSize(){return this.marginSize}get UpperLeftCorner(){return this.upperLeftCorner}get UpperLeftMarginCorner(){return this.upperLeftMarginCorner}get BorderLeft(){return this.borderLeft}set BorderLeft(t){this.borderLeft=t,this.calculateRectangle()}get BorderRight(){return this.borderRight}set BorderRight(t){this.borderRight=t,this.calculateRectangle()}get BorderTop(){return this.borderTop}set BorderTop(t){this.borderTop=t,this.calculateRectangle()}get BorderBottom(){return this.borderBottom}set BorderBottom(t){this.borderBottom=t,this.calculateRectangle()}get BorderMarginLeft(){return this.borderMarginLeft>this.borderLeft?this.borderLeft:this.borderMarginLeft}set BorderMarginLeft(t){this.borderMarginLeft=t,this.calculateMarginRectangle()}get BorderMarginRight(){return this.borderMarginRight<this.borderRight?this.borderRight:this.borderMarginRight}set BorderMarginRight(t){this.borderMarginRight=t,this.calculateMarginRectangle()}get BorderMarginTop(){return this.borderMarginTop>this.borderTop?this.borderTop:this.borderMarginTop}set BorderMarginTop(t){this.borderMarginTop=t,this.calculateMarginRectangle()}get BorderMarginBottom(){return this.borderMarginBottom<this.borderBottom?this.borderBottom:this.borderMarginBottom}set BorderMarginBottom(t){this.borderMarginBottom=t,this.calculateMarginRectangle()}get BoundingRectangle(){return this.boundingRectangle}get BoundingMarginRectangle(){return this.boundingMarginRectangle}get ChildElements(){return this.childElements}set ChildElements(t){this.childElements=t}get Parent(){return this.parent}set Parent(t){if(this.parent){const t=this.parent.ChildElements.indexOf(this,0);t>-1&&this.parent.ChildElements.splice(t,1)}this.parent=t,this.parent.ChildElements.indexOf(this)>-1?s.default.error("BoundingBox of "+this.dataObject.constructor.name+" already in children list of "+this.parent.dataObject.constructor.name+"'s BoundingBox"):this.parent.ChildElements.push(this)}get DataObject(){return this.dataObject}get Center(){return new o.PointF2D(this.RelativePosition.x+(this.BorderMarginRight+this.BorderMarginLeft),this.RelativePosition.y+(this.BorderMarginBottom+this.BorderMarginTop))}setAbsolutePositionFromParent(){this.parent?(this.absolutePosition.x=this.parent.AbsolutePosition.x+this.relativePosition.x,this.absolutePosition.y=this.parent.AbsolutePosition.y+this.relativePosition.y):this.absolutePosition=this.relativePosition}calculateAbsolutePosition(){this.absolutePosition.x=this.relativePosition.x,this.absolutePosition.y=this.relativePosition.y;let t=this.parent;for(;t;)this.absolutePosition.x+=t.relativePosition.x,this.absolutePosition.y+=t.relativePosition.y,t=t.parent}calculateAbsolutePositionsRecursiveWithoutTopelement(){this.absolutePosition.x=0,this.absolutePosition.y=0;for(let t=0,e=this.ChildElements.length;t<e;++t)this.ChildElements[t].calculateAbsolutePositionsRecursive(this.absolutePosition.x,this.absolutePosition.y)}calculateAbsolutePositionsRecursive(t,e){this.absolutePosition.x=this.relativePosition.x+t,this.absolutePosition.y=this.relativePosition.y+e;for(let i=0,n=this.ChildElements.length;i<n;++i)this.ChildElements[i].calculateAbsolutePositionsRecursive(this.absolutePosition.x,this.absolutePosition.y)}calculateAbsolutePositionsOfChildren(){for(let t=0,e=this.ChildElements.length;t<e;++t)this.ChildElements[t].calculateAbsolutePositionsRecursive(this.absolutePosition.x,this.absolutePosition.y)}calculateBoundingBox(){if(0===this.childElements.length)return;for(let l=0,h=this.ChildElements.length;l<h;++l)this.ChildElements[l].calculateBoundingBox();let t=Number.MAX_VALUE,e=Number.MIN_VALUE,i=Number.MAX_VALUE,n=Number.MIN_VALUE,s=Number.MAX_VALUE,r=Number.MIN_VALUE,o=Number.MAX_VALUE,a=Number.MIN_VALUE;this.isSymbol&&(t=this.borderLeft,e=this.borderRight,i=this.borderTop,n=this.borderBottom,s=this.borderMarginLeft,r=this.borderMarginRight,o=this.borderMarginTop,a=this.borderMarginBottom);for(let l=0,h=this.ChildElements.length;l<h;++l){const h=this.ChildElements[l];t=Math.min(t,h.relativePosition.x+h.borderLeft),e=Math.max(e,h.relativePosition.x+h.borderRight),i=Math.min(i,h.relativePosition.y+h.borderTop),n=Math.max(n,h.relativePosition.y+h.borderBottom),s=Math.min(s,h.relativePosition.x+h.borderMarginLeft),r=Math.max(r,h.relativePosition.x+h.borderMarginRight),o=Math.min(o,h.relativePosition.y+h.borderMarginTop),a=Math.max(a,h.relativePosition.y+h.borderMarginBottom)}this.borderLeft=t,this.borderRight=e,this.borderTop=i,this.borderBottom=n,this.borderMarginLeft=s,this.borderMarginRight=r,this.borderMarginTop=o,this.borderMarginBottom=a,this.calculateRectangle(),this.calculateMarginRectangle(),this.xBordersHaveBeenSet=!0,this.yBordersHaveBeenSet=!0}calculateTopBottomBorders(){if(0===this.childElements.length)return;for(let s=0,r=this.ChildElements.length;s<r;++s)this.ChildElements[s].calculateTopBottomBorders();let t=Number.MAX_VALUE,e=Number.MIN_VALUE,i=Number.MAX_VALUE,n=Number.MIN_VALUE;this.yBordersHaveBeenSet&&(t=this.borderTop,e=this.borderBottom,i=this.borderMarginTop,n=this.borderMarginBottom);for(let s=0,r=this.ChildElements.length;s<r;++s){const r=this.ChildElements[s];t=Math.min(t,r.relativePosition.y+r.borderTop),c.EngravingRules.FixStafflineBoundingBox&&r.dataObject instanceof h.StaffLineActivitySymbol||(e=Math.max(e,r.relativePosition.y+r.borderBottom)),i=Math.min(i,r.relativePosition.y+r.borderMarginTop),n=Math.max(n,r.relativePosition.y+r.borderMarginBottom)}this.borderTop=t,this.borderBottom=e,this.borderMarginTop=i,this.borderMarginBottom=n,this.calculateRectangle(),this.calculateMarginRectangle()}computeNonOverlappingPositionWithMargin(t,e,i){this.RelativePosition=new o.PointF2D(i.x,i.y),this.setAbsolutePositionFromParent();let n=0,s=!1;do{switch(e){case d.Left:case d.Right:n=this.relativePosition.x,t.calculateMarginPositionAlongDirection(this,e),s=Math.abs(n-this.relativePosition.x)>.001;break;case d.Up:case d.Down:n=this.relativePosition.y,t.calculateMarginPositionAlongDirection(this,e),s=Math.abs(n-this.relativePosition.y)>.001;break;default:throw new r.ArgumentOutOfRangeException("direction")}}while(s)}collisionDetection(t){const e=Math.min(this.AbsolutePosition.x+this.borderRight,t.absolutePosition.x+t.borderRight)-Math.max(this.AbsolutePosition.x+this.borderLeft,t.absolutePosition.x+t.borderLeft),i=Math.min(this.AbsolutePosition.y+this.borderBottom,t.absolutePosition.y+t.borderBottom)-Math.max(this.AbsolutePosition.y+this.borderTop,t.absolutePosition.y+t.borderTop);return e>0&&i>0}liesInsideBorders(t){const e=this.AbsolutePosition.x+this.borderLeft<=t.absolutePosition.x+t.borderLeft&&t.absolutePosition.x+t.borderLeft<=this.AbsolutePosition.x+this.borderRight,i=this.AbsolutePosition.x+this.borderLeft<=t.absolutePosition.x+t.borderRight&&t.absolutePosition.x+t.borderRight<=this.AbsolutePosition.x+this.borderRight;if(e&&i){const e=this.AbsolutePosition.y+this.borderTop<=t.absolutePosition.y+t.borderTop&&t.absolutePosition.y+t.borderTop<=this.AbsolutePosition.y+this.borderBottom,i=this.AbsolutePosition.y+this.borderTop<=t.absolutePosition.y+t.borderBottom&&t.absolutePosition.y+t.borderBottom<=this.AbsolutePosition.y+this.borderBottom;if(e&&i)return!0}return!1}pointLiesInsideBorders(t){return this.AbsolutePosition.x+this.borderLeft<=t.x&&t.x<=this.AbsolutePosition.x+this.borderRight&&this.AbsolutePosition.y+this.borderTop<=t.y&&t.y<=this.AbsolutePosition.y+this.borderBottom}marginCollisionDetection(t){const e=Math.min(this.AbsolutePosition.x+this.borderMarginRight,t.absolutePosition.x+t.borderMarginRight)-Math.max(this.AbsolutePosition.x+this.borderMarginLeft,t.absolutePosition.x+t.borderMarginLeft),i=Math.min(this.AbsolutePosition.y+this.borderMarginBottom,t.absolutePosition.y+t.borderMarginBottom)-Math.max(this.AbsolutePosition.y+this.borderMarginTop,t.absolutePosition.y+t.borderMarginTop);return e>0&&i>0}liesInsideMargins(t){const e=this.AbsolutePosition.x+this.borderMarginLeft<=t.absolutePosition.x+t.borderMarginLeft&&t.absolutePosition.x+t.borderMarginLeft<=this.AbsolutePosition.x+this.borderMarginRight,i=this.AbsolutePosition.x+this.borderMarginLeft<=t.absolutePosition.x+t.borderMarginRight&&t.absolutePosition.x+t.borderMarginRight<=this.AbsolutePosition.x+this.borderMarginRight;if(e&&i){const e=this.AbsolutePosition.y+this.borderMarginTop<=t.absolutePosition.y+t.borderMarginTop&&t.absolutePosition.y+t.borderMarginTop<=this.AbsolutePosition.y+this.borderMarginBottom,i=this.AbsolutePosition.y+this.borderMarginTop<=t.absolutePosition.y+t.borderMarginBottom&&t.absolutePosition.y+t.borderMarginBottom<=this.AbsolutePosition.y+this.borderMarginBottom;if(e&&i)return!0}return!1}pointLiesInsideMargins(t){return this.AbsolutePosition.x+this.borderMarginLeft<=t.x&&t.x<=this.AbsolutePosition.x+this.borderMarginRight&&this.AbsolutePosition.y+this.borderMarginTop<=t.y&&t.y<=this.AbsolutePosition.y+this.borderMarginBottom}computeNonOverlappingPosition(t,e,i){this.RelativePosition=new o.PointF2D(i.x,i.y),this.setAbsolutePositionFromParent();let n=0,s=!1;do{switch(e){case d.Left:case d.Right:n=this.relativePosition.x,t.calculatePositionAlongDirection(this,e),s=Math.abs(n-this.relativePosition.x)>1e-4;break;case d.Up:case d.Down:n=this.relativePosition.y,t.calculatePositionAlongDirection(this,e),s=Math.abs(n-this.relativePosition.y)>1e-4;break;default:throw new r.ArgumentOutOfRangeException("direction")}}while(s)}getClickedObjectOfType(t){const e=this.dataObject;if(this.pointLiesInsideBorders(t)&&e)return e;for(let i=0,n=this.childElements.length;i<n;++i){const e=this.childElements[i].getClickedObjectOfType(t);if(e)return e}}getObjectsInRegion(t,e=!0,i=u.GraphicalObject.name){let n=[];for(const s of this.childElements)n=n.concat(s.getObjectsInRegion(t,e,i));return this.dataObject&&this.dataObject.isInstanceOfClass(i)&&(e?t.liesInsideBorders(this)&&n.push(this.dataObject):t.collisionDetection(this)&&n.push(this.dataObject)),n}calculateRectangle(){this.upperLeftCorner=new o.PointF2D(this.BorderLeft,this.BorderTop),this.size=new a.SizeF2D(this.BorderRight-this.BorderLeft,this.BorderBottom-this.BorderTop),this.boundingRectangle=l.RectangleF2D.createFromLocationAndSize(this.upperLeftCorner,this.size)}calculateMarginRectangle(){this.upperLeftMarginCorner=new o.PointF2D(this.BorderMarginLeft,this.BorderMarginTop),this.marginSize=new a.SizeF2D(this.BorderMarginRight-this.BorderMarginLeft,this.BorderMarginBottom-this.BorderMarginTop),this.boundingMarginRectangle=l.RectangleF2D.createFromLocationAndSize(this.upperLeftMarginCorner,this.marginSize)}calculateMarginPositionAlongDirection(t,e){if(this!==t){if(this.isSymbol&&this.marginCollisionDetection(t)){let i=0;switch(e){case d.Left:return i=this.absolutePosition.x+this.borderMarginLeft-(t.absolutePosition.x+t.borderMarginRight),t.relativePosition.x+=i,void(t.absolutePosition.x+=i);case d.Right:return i=this.absolutePosition.x+this.borderMarginRight-(t.absolutePosition.x+t.borderMarginLeft),t.relativePosition.x+=i,void(t.absolutePosition.x+=i);case d.Up:return i=this.absolutePosition.y+this.borderMarginTop-(t.absolutePosition.y+t.borderMarginBottom),t.relativePosition.y+=i,void(t.absolutePosition.y+=i);case d.Down:return i=this.absolutePosition.y+this.borderMarginBottom-(t.absolutePosition.y+t.borderMarginTop),t.relativePosition.y+=i,void(t.absolutePosition.y+=i);default:throw new r.ArgumentOutOfRangeException("direction")}}for(let i=0,n=this.ChildElements.length;i<n;++i)this.ChildElements[i].calculateMarginPositionAlongDirection(t,e)}}calculatePositionAlongDirection(t,e){if(this!==t){if(this.isSymbol&&this.collisionDetection(t)){let i;switch(e){case d.Left:return i=this.absolutePosition.x+this.borderLeft-(t.absolutePosition.x+t.borderRight),t.relativePosition.x+=i,void(t.absolutePosition.x+=i);case d.Right:return i=this.absolutePosition.x+this.borderRight-(t.absolutePosition.x+t.borderLeft),t.relativePosition.x+=i,void(t.absolutePosition.x+=i);case d.Up:return i=this.absolutePosition.y+this.borderTop-(t.absolutePosition.y+t.borderBottom),t.relativePosition.y+=i,void(t.absolutePosition.y+=i);case d.Down:return i=this.absolutePosition.y+this.borderBottom-(t.absolutePosition.y+t.borderTop),t.relativePosition.y+=i,void(t.absolutePosition.y+=i);default:throw new r.ArgumentOutOfRangeException("direction")}}for(let i=0,n=this.ChildElements.length;i<n;++i)this.ChildElements[i].calculatePositionAlongDirection(t,e)}}},(f=d=e.ColDirEnum||(e.ColDirEnum={}))[f.Left=0]="Left",f[f.Right=1]="Right",f[f.Up=2]="Up",f[f.Down=3]="Down"},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalObject=void 0;const n=i(111);class s extends n.AClassHierarchyTrackable{get PositionAndShape(){return this.boundingBox}set PositionAndShape(t){this.boundingBox=t}}e.GraphicalObject=s},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.MidiInstrument=e.ClefEnum=e.ClefInstruction=void 0;const n=i(2),s=i(49),r=i(2),o=i(2),a=i(11);class l extends s.AbstractNotationInstruction{constructor(t=h.G,e=0,i=2){super(void 0),this.clefType=h.G,this.line=2,this.octaveOffset=0,this.line=i,this.clefType=t,this.octaveOffset=e,this.calcParameters()}static getDefaultClefFromMidiInstrument(t){switch(t){case c.Acoustic_Grand_Piano:case c.Electric_Bass_finger:case c.Electric_Bass_pick:case c.Fretless_Bass:case c.Slap_Bass_1:case c.Slap_Bass_2:case c.Synth_Bass_1:case c.Synth_Bass_2:case c.Contrabass:return new l(h.F,0,4);default:return new l(h.G,0,2)}}static getAllPossibleClefs(){const t=[];for(let e=0;e<=2;e++){const i=new l(h.G,e,2);t.push(i)}for(let e=-2;e<=0;e++){const i=new l(h.F,e,4);t.push(i)}return t}static isSupportedClef(t){switch(t){case h.G:case h.F:case h.C:case h.percussion:case h.TAB:return!0;default:return!1}}get ClefType(){return this.clefType}set ClefType(t){this.clefType=t}get Line(){return this.line}set Line(t){this.line=t}get OctaveOffset(){return this.octaveOffset}set OctaveOffset(t){this.octaveOffset=t}get ClefPitch(){return this.clefPitch}set ClefPitch(t){this.clefPitch=t}get ReferenceCyPosition(){return this.referenceCyPosition}set ReferenceCyPosition(t){this.referenceCyPosition=t}Equals(t){return this===t||!(!this||!t)&&this.clefPitch===t.clefPitch&&this.Line===t.Line}NotEqual(t){return!this.Equals(t)}ToString(){return"ClefType: "+this.clefType}calcParameters(){switch(this.clefType){case h.G:this.clefPitch=new n.Pitch(r.NoteEnum.G,1+this.octaveOffset,o.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+2;break;case h.F:this.clefPitch=new n.Pitch(r.NoteEnum.F,0+this.octaveOffset,o.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+1.5;break;case h.C:this.clefPitch=new n.Pitch(r.NoteEnum.C,1+this.octaveOffset,o.AccidentalEnum.NONE),this.referenceCyPosition=5-this.line;break;case h.percussion:this.clefPitch=new n.Pitch(r.NoteEnum.C,2,o.AccidentalEnum.NONE),this.referenceCyPosition=2;break;case h.TAB:this.clefPitch=new n.Pitch(r.NoteEnum.G,0,o.AccidentalEnum.NONE),this.referenceCyPosition=0;break;default:throw new a.ArgumentOutOfRangeException("clefType")}}}var h,c,u;e.ClefInstruction=l,(u=h=e.ClefEnum||(e.ClefEnum={}))[u.G=0]="G",u[u.F=1]="F",u[u.C=2]="C",u[u.percussion=3]="percussion",u[u.TAB=4]="TAB",function(t){t[t.None=-1]="None",t[t.Acoustic_Grand_Piano=0]="Acoustic_Grand_Piano",t[t.Bright_Acoustic_Piano=1]="Bright_Acoustic_Piano",t[t.Electric_Grand_Piano=2]="Electric_Grand_Piano",t[t.Honky_tonk_Piano=3]="Honky_tonk_Piano",t[t.Electric_Piano_1=4]="Electric_Piano_1",t[t.Electric_Piano_2=5]="Electric_Piano_2",t[t.Harpsichord=6]="Harpsichord",t[t.Clavinet=7]="Clavinet",t[t.Celesta=8]="Celesta",t[t.Glockenspiel=9]="Glockenspiel",t[t.Music_Box=10]="Music_Box",t[t.Vibraphone=11]="Vibraphone",t[t.Marimba=12]="Marimba",t[t.Xylophone=13]="Xylophone",t[t.Tubular_Bells=14]="Tubular_Bells",t[t.Dulcimer=15]="Dulcimer",t[t.Drawbar_Organ=16]="Drawbar_Organ",t[t.Percussive_Organ=17]="Percussive_Organ",t[t.Rock_Organ=18]="Rock_Organ",t[t.Church_Organ=19]="Church_Organ",t[t.Reed_Organ=20]="Reed_Organ",t[t.Accordion=21]="Accordion",t[t.Harmonica=22]="Harmonica",t[t.Tango_Accordion=23]="Tango_Accordion",t[t.Acoustic_Guitar_nylon=24]="Acoustic_Guitar_nylon",t[t.Acoustic_Guitar_steel=25]="Acoustic_Guitar_steel",t[t.Electric_Guitar_jazz=26]="Electric_Guitar_jazz",t[t.Electric_Guitar_clean=27]="Electric_Guitar_clean",t[t.Electric_Guitar_muted=28]="Electric_Guitar_muted",t[t.Overdriven_Guitar=29]="Overdriven_Guitar",t[t.Distortion_Guitar=30]="Distortion_Guitar",t[t.Guitar_harmonics=31]="Guitar_harmonics",t[t.Acoustic_Bass=32]="Acoustic_Bass",t[t.Electric_Bass_finger=33]="Electric_Bass_finger",t[t.Electric_Bass_pick=34]="Electric_Bass_pick",t[t.Fretless_Bass=35]="Fretless_Bass",t[t.Slap_Bass_1=36]="Slap_Bass_1",t[t.Slap_Bass_2=37]="Slap_Bass_2",t[t.Synth_Bass_1=38]="Synth_Bass_1",t[t.Synth_Bass_2=39]="Synth_Bass_2",t[t.Violin=40]="Violin",t[t.Viola=41]="Viola",t[t.Cello=42]="Cello",t[t.Contrabass=43]="Contrabass",t[t.Tremolo_Strings=44]="Tremolo_Strings",t[t.Pizzicato_Strings=45]="Pizzicato_Strings",t[t.Orchestral_Harp=46]="Orchestral_Harp",t[t.Timpani=47]="Timpani",t[t.String_Ensemble_1=48]="String_Ensemble_1",t[t.String_Ensemble_2=49]="String_Ensemble_2",t[t.Synth_Strings_1=50]="Synth_Strings_1",t[t.Synth_Strings_2=51]="Synth_Strings_2",t[t.Choir_Aahs=52]="Choir_Aahs",t[t.Voice_Oohs=53]="Voice_Oohs",t[t.Synth_Voice=54]="Synth_Voice",t[t.Orchestra_Hit=55]="Orchestra_Hit",t[t.Trumpet=56]="Trumpet",t[t.Trombone=57]="Trombone",t[t.Tuba=58]="Tuba",t[t.Muted_Trumpet=59]="Muted_Trumpet",t[t.French_Horn=60]="French_Horn",t[t.Brass_Section=61]="Brass_Section",t[t.Synth_Brass_1=62]="Synth_Brass_1",t[t.Synth_Brass_2=63]="Synth_Brass_2",t[t.Soprano_Sax=64]="Soprano_Sax",t[t.Alto_Sax=65]="Alto_Sax",t[t.Tenor_Sax=66]="Tenor_Sax",t[t.Baritone_Sax=67]="Baritone_Sax",t[t.Oboe=68]="Oboe",t[t.English_Horn=69]="English_Horn",t[t.Bassoon=70]="Bassoon",t[t.Clarinet=71]="Clarinet",t[t.Piccolo=72]="Piccolo",t[t.Flute=73]="Flute",t[t.Recorder=74]="Recorder",t[t.Pan_Flute=75]="Pan_Flute",t[t.Blown_Bottle=76]="Blown_Bottle",t[t.Shakuhachi=77]="Shakuhachi",t[t.Whistle=78]="Whistle",t[t.Ocarina=79]="Ocarina",t[t.Lead_1_square=80]="Lead_1_square",t[t.Lead_2_sawtooth=81]="Lead_2_sawtooth",t[t.Lead_3_calliope=82]="Lead_3_calliope",t[t.Lead_4_chiff=83]="Lead_4_chiff",t[t.Lead_5_charang=84]="Lead_5_charang",t[t.Lead_6_voice=85]="Lead_6_voice",t[t.Lead_7_fifths=86]="Lead_7_fifths",t[t.Lead_8_bass_lead=87]="Lead_8_bass_lead",t[t.Pad_1_new_age=88]="Pad_1_new_age",t[t.Pad_2_warm=89]="Pad_2_warm",t[t.Pad_3_polysynth=90]="Pad_3_polysynth",t[t.Pad_4_choir=91]="Pad_4_choir",t[t.Pad_5_bowed=92]="Pad_5_bowed",t[t.Pad_6_metallic=93]="Pad_6_metallic",t[t.Pad_7_halo=94]="Pad_7_halo",t[t.Pad_8_sweep=95]="Pad_8_sweep",t[t.FX_1_rain=96]="FX_1_rain",t[t.FX_2_soundtrack=97]="FX_2_soundtrack",t[t.FX_3_crystal=98]="FX_3_crystal",t[t.FX_4_atmosphere=99]="FX_4_atmosphere",t[t.FX_5_brightness=100]="FX_5_brightness",t[t.FX_6_goblins=101]="FX_6_goblins",t[t.FX_7_echoes=102]="FX_7_echoes",t[t.FX_8_scifi=103]="FX_8_scifi",t[t.Sitar=104]="Sitar",t[t.Banjo=105]="Banjo",t[t.Shamisen=106]="Shamisen",t[t.Koto=107]="Koto",t[t.Kalimba=108]="Kalimba",t[t.Bag_pipe=109]="Bag_pipe",t[t.Fiddle=110]="Fiddle",t[t.Shanai=111]="Shanai",t[t.Tinkle_Bell=112]="Tinkle_Bell",t[t.Agogo=113]="Agogo",t[t.Steel_Drums=114]="Steel_Drums",t[t.Woodblock=115]="Woodblock",t[t.Taiko_Drum=116]="Taiko_Drum",t[t.Melodic_Tom=117]="Melodic_Tom",t[t.Synth_Drum=118]="Synth_Drum",t[t.Reverse_Cymbal=119]="Reverse_Cymbal",t[t.Guitar_Fret_Noise=120]="Guitar_Fret_Noise",t[t.Breath_Noise=121]="Breath_Noise",t[t.Seashore=122]="Seashore",t[t.Bird_Tweet=123]="Bird_Tweet",t[t.Telephone_Ring=124]="Telephone_Ring",t[t.Helicopter=125]="Helicopter",t[t.Applause=126]="Applause",t[t.Gunshot=127]="Gunshot",t[t.Percussion=128]="Percussion"}(c=e.MidiInstrument||(e.MidiInstrument={}))},function(e,i,n){n.r(i);const s=()=>{};s.L=(t,e)=>{if(!e)return;const i=Array.prototype.slice.call(e).join(" ");window. (t+": "+i)},s.MakeException=t=>class extends Error{constructor(e,i){super(e),this.name=t,this.message=e,this.data=i}},s.RERR=s.RuntimeError=class{constructor(t,e){this.code=t,this.message=e}toString(){return"[RuntimeError] "+this.code+":"+this.message}},s.Merge=(t,e)=>{for(const i in e)t[i]=e[i];return t},s.Min=Math.min,s.Max=Math.max,s.forEach=(t,e)=>{for(let i=0;i<t.length;i++)e(t[i],i)},s.RoundN=(t,e)=>t%e>=e/2?parseInt(t/e,10)*e+e:parseInt(t/e,10)*e,s.MidLine=(t,e)=>{let i=e+(t-e)/2;return i%2>0&&(i=s.RoundN(10*i,5)/10),i},s.SortAndUnique=(t,e,i)=>{if(t.length>1){const n=[];let s;t.sort(e);for(let e=0;e<t.length;++e)0!==e&&i(t[e],s)||n.push(t[e]),s=t[e];return n}return t},s.Contains=(t,e)=>{let i=t.length;for(;i--;)if(t[i]===e)return!0;return!1},s.getCanvasContext=t=>{if(!t)throw new s.RERR("BadArgument","Invalid canvas selector: "+t);const e=document.getElementById(t);if(!e||!e.getContext)throw new s.RERR("UnsupportedBrowserError","This browser does not support HTML5 Canvas");return e.getContext("2d")},s.drawDot=(t,e,i,n="#55")=>{t.save(),t.setFillStyle(n),t.beginPath(),t.arc(e,i,3,0,2*Math.PI,!0),t.closePath(),t.fill(),t.restore()},s.BM=(t,e)=>{const i=(new Date).getTime();e();const n=(new Date).getTime()-i;s.L(t+n+"ms")},s.StackTrace=()=>(new Error).stack,s.W=(...t)=>{const e=t.join(" ");window. ("Warning: ",e,s.StackTrace())},(s.Prefix=t=>s.Prefix.prefix+t).prefix="vf-";class r{static GCD(t,e){if("number"!=typeof t||"number"!=typeof e)throw new s.RERR("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/r.GCD(t,e)}static LCMM(t){if(0===t.length)return 0;if(1===t.length)return t[0];if(2===t.length)return r.LCM(t[0],t[1]);{const e=t[0];return t.shift(),r.LCM(e,r.LCMM(t))}}constructor(t,e){this.set(t,e)}set(t,e){return this.numerator=void 0===t?1:t,this.denominator=void 0===e?1:e,this}value(){return this.numerator/this.denominator}simplify(){let t=this.numerator,e=this.denominator;const i=r.GCD(t,e);return t/=i,e/=i,e<0&&(e=-e,t=-t),this.set(t,e)}add(t,e){let i,n;t instanceof r?(i=t.numerator,n=t.denominator):(i=void 0!==t?t:0,n=void 0!==e?e:1);const s=r.LCM(this.denominator,n),o=s/this.denominator,a=s/n,l=this.numerator*o+i*a;return this.set(l,s)}subtract(t,e){let i,n;t instanceof r?(i=t.numerator,n=t.denominator):(i=void 0!==t?t:0,n=void 0!==e?e:1);const s=r.LCM(this.denominator,n),o=s/this.denominator,a=s/n,l=this.numerator*o-i*a;return this.set(l,s)}multiply(t,e){let i,n;return t instanceof r?(i=t.numerator,n=t.denominator):(i=void 0!==t?t:1,n=void 0!==e?e:1),this.set(this.numerator*i,this.denominator*n)}divide(t,e){let i,n;return t instanceof r?(i=t.numerator,n=t.denominator):(i=void 0!==t?t:1,n=void 0!==e?e:1),this.set(this.numerator*n,this.denominator*i)}equals(t){const e=r.__compareA.copy(t).simplify(),i=r.__compareB.copy(this).simplify();return e.numerator===i.numerator&&e.denominator===i.denominator}greaterThan(t){const e=r.__compareB.copy(this);return e.subtract(t),e.numerator>0}greaterThanEquals(t){const e=r.__compareB.copy(this);return e.subtract(t),e.numerator>=0}lessThan(t){return!this.greaterThanEquals(t)}lessThanEquals(t){return!this.greaterThan(t)}clone(){return new r(this.numerator,this.denominator)}copy(t){return"number"==typeof t?this.set(t||0,1):this.set(t.numerator,t.denominator)}quotient(){return Math.floor(this.numerator/this.denominator)}fraction(){return this.numerator%this.denominator}abs(){return this.denominator=Math.abs(this.denominator),this.numerator=Math.abs(this.numerator),this}toString(){return this.numerator+"/"+this.denominator}toSimplifiedString(){return r.__tmp.copy(this).simplify().toString()}toMixedString(){let t="";const e=this.quotient(),i=r.__tmp.copy(this);return e<0?i.abs().fraction():i.fraction(),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),n=e[1]?parseInt(e[1],10):1;return this.set(i,n)}}r.__compareA=new r,r.__compareB=new r,r.__tmp=new r;const o=s.MakeException("RegistryError");function a(t,e,i,n,s){t[e][i]||(t[e][i]={}),t[e][i][n]=s}class l{static get INDEXES(){return["type"]}constructor(){this.clear()}static enableDefaultRegistry(t){l.defaultRegistry=t}static getDefaultRegistry(){return l.defaultRegistry}static disableDefaultRegistry(){l.defaultRegistry=null}clear(){return this.index={id:{},type:{},class:{}},this}updateIndex({id:t,name:e,value:i,oldValue:n}){const s=this.getElementById(t);null!==n&&this.index[e][n]&&delete this.index[e][n][t],null!==i&&a(this.index,e,i,s.getAttribute("id"),s)}register(t,e){if(!(e=e||t.getAttribute("id")))throw new o("Can't add element without `id` attribute to registry",t);return t.setAttribute("id",e),a(this.index,"id",e,e,t),l.INDEXES.forEach((i=>{this.updateIndex({id:e,name:i,value:t.getAttribute(i),oldValue:null})})),t.onRegister(this),this}getElementById(t){return this.index.id[t]?this.index.id[t][t]:null}getElementsByAttribute(t,e){const i=this.index[t];return i&&i[e]?Object.keys(i[e]).map((t=>i[e][t])):[]}getElementsByType(t){return this.getElementsByAttribute("type",t)}getElementsByClass(t){return this.getElementsByAttribute("class",t)}onUpdate({id:t,name:e,value:i,oldValue:n}){return s=l.INDEXES.concat(["id","class"]),r=e,s.filter((t=>t===r)).length>0?(this.updateIndex({id:t,name:e,value:i,oldValue:n}),this):this;var s,r}}l.defaultRegistry=null;class h{static newID(){return"auto"+h.ID++}constructor({type:t}={}){this.attrs={id:h.newID(),el:null,type:t||"Base",classes:{}},this.boundingBox=null,this.context=null,this.rendered=!1,l.getDefaultRegistry()&&l.getDefaultRegistry().register(this)}setStyle(t){return this.style=t,this}getStyle(){return this.style}applyStyle(t=this.context,e=this.getStyle()){return e?(t.save(),e.shadowColor&&t.setShadowColor(e.shadowColor),e.shadowBlur&&t.setShadowBlur(e.shadowBlur),e.fillStyle&&t.setFillStyle(e.fillStyle),e.strokeStyle&&t.setStrokeStyle(e.strokeStyle),e.lineWidth&&t.setLineWidth(e.lineWidth),this):this}restoreStyle(t=this.context,e=this.getStyle()){return e?(t.restore(),this):this}drawWithStyle(){this.checkContext(),this.applyStyle(),this.draw(),this.restoreStyle()}hasClass(t){return!0===this.attrs.classes[t]}addClass(t){return this.attrs.classes[t]=!0,this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:t,oldValue:null}),this}removeClass(t){return delete this.attrs.classes[t],this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:null,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]}setAttribute(t,e){const i=this.attrs.id,n=this.attrs[t];return this.attrs[t]=e,this.registry&&this.registry.onUpdate({id:i,name:t,value:e,oldValue:n}),this}getContext(){return this.context}setContext(t){return this.context=t,this}getBoundingBox(){return this.boundingBox}checkContext(){if(!this.context)throw new s.RERR("NoContext","No rendering context attached to instance");return this.context}}h.ID=1e3;class c{constructor(t,e,i,n){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN,this.addPoint(t,e),this.addPoint(i,n)}width(){return this.x2-this.x1}height(){return this.y2-this.y1}addPoint(t,e){null!=t&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),null!=e&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))}addX(t){this.addPoint(t,null)}addY(t){this.addPoint(null,t)}addQuadraticCurve(t,e,i,n,s,r){const o=t+2/3*(i-t),a=e+2/3*(n-e),l=o+1/3*(s-t),h=a+1/3*(r-e);this.addBezierCurve(t,e,o,a,l,h,s,r)}addBezierCurve(t,e,i,n,s,r,o,a){const l=[t,e],h=[i,n],c=[s,r],u=[o,a];let d;this.addPoint(l[0],l[1]),this.addPoint(u[0],u[1]);const f=(t,e)=>Math.pow(1-t,3)*l[e]+3*Math.pow(1-t,2)*t*h[e]+3*(1-t)*Math.pow(t,2)*c[e]+Math.pow(t,3)*u[e];for(d=0;d<=1;d++){const t=6*l[d]-12*h[d]+6*c[d],e=-3*l[d]+9*h[d]-9*c[d]+3*u[d],i=3*h[d]-3*l[d];if(0===e){if(0===t)continue;const e=-i/t;0<e&&e<1&&(0===d&&this.addX(f(e,d)),1===d&&this.addY(f(e,d)));continue}const n=Math.pow(t,2)-4*i*e;if(n<0)continue;const s=(-t+Math.sqrt(n))/(2*e);0<s&&s<1&&(0===d&&this.addX(f(s,d)),1===d&&this.addY(f(s,d)));const r=(-t-Math.sqrt(n))/(2*e);0<r&&r<1&&(0===d&&this.addX(f(r,d)),1===d&&this.addY(f(r,d)))}}}class u{static copy(t){return new u(t.x,t.y,t.w,t.h)}constructor(t,e,i,n){this.x=t,this.y=e,this.w=i,this.h=n}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){this.x+=t,this.y+=e}clone(){return u.copy(this)}mergeWith(t,e){const i=t,n=this.x<i.x?this.x:i.x,s=this.y<i.y?this.y:i.y,r=Math.max(this.x+this.w,i.x+i.w)-n,o=Math.max(this.y+this.h,i.y+i.h)-s;return this.x=n,this.y=s,this.w=r,this.h=o,e&&this.draw(e),this}draw(t,e,i){e||(e=0),i||(i=0),t.rect(this.x+e,this.y+i,this.w,this.h),t.stroke()}}const d={glyphs:{v0:{x_min:0,x_max:514.5,ha:525,o:"m 236 648 b 246 648 238 648 242 648 b 288 646 261 648 283 648 b 472 513 364 634 428 587 b 514 347 502 464 514 413 b 462 163 514 272 499 217 b 257 44 409 83 333 44 b 50 163 181 44 103 83 b 0 347 14 217 0 272 b 40 513 0 413 12 464 b 236 648 87 591 155 638 m 277 614 b 253 616 273 616 261 616 b 242 616 247 616 243 616 b 170 499 193 609 181 589 b 159 348 163 446 159 398 b 166 222 159 308 161 266 b 201 91 174 138 183 106 b 257 76 215 81 235 76 b 311 91 277 76 299 81 b 347 222 330 106 338 138 b 353 348 352 266 353 308 b 344 499 353 398 351 446 b 277 614 333 587 322 606 m 257 -1 l 258 -1 l 255 -1 l 257 -1 m 257 673 l 258 673 l 255 673 l 257 673 "},v1:{x_min:-1.359375,x_max:344.359375,ha:351,o:"m 126 637 l 129 638 l 198 638 l 266 638 l 269 635 b 274 631 272 634 273 632 l 277 627 l 277 395 b 279 156 277 230 277 161 b 329 88 281 123 295 106 b 344 69 341 81 344 79 b 337 55 344 62 343 59 l 333 54 l 197 54 l 61 54 l 58 55 b 50 69 53 59 50 62 b 65 88 50 79 53 81 b 80 97 72 91 74 93 b 117 156 103 113 112 129 b 117 345 117 161 117 222 l 117 528 l 100 503 l 38 406 b 14 383 24 384 23 383 b -1 398 5 383 -1 390 b 4 415 -1 403 1 409 b 16 437 5 416 10 426 l 72 539 l 100 596 b 121 632 119 631 119 631 b 126 637 122 634 125 635 m 171 -1 l 172 -1 l 170 -1 l 171 -1 m 171 673 l 172 673 l 170 673 l 171 673 "},v2:{x_min:-1.359375,x_max:458.6875,ha:468,o:"m 197 648 b 216 648 201 648 208 648 b 258 646 232 648 253 648 b 419 546 333 637 393 599 b 432 489 428 528 432 509 b 356 342 432 440 405 384 b 235 278 322 313 288 295 b 69 170 166 256 107 217 b 69 169 69 170 69 169 b 69 169 69 169 69 169 b 74 173 69 169 72 170 b 209 222 112 204 163 222 b 310 195 247 222 274 215 b 371 179 332 184 352 179 b 396 181 379 179 387 179 b 428 202 409 184 423 194 b 442 212 431 209 436 212 b 458 197 450 212 458 206 b 441 148 458 190 449 165 b 299 44 409 84 353 44 b 288 45 295 44 292 44 b 250 61 274 45 268 49 b 122 99 212 86 164 99 b 73 91 104 99 88 97 b 28 63 53 84 34 72 b 14 54 25 56 20 54 b 1 62 9 54 4 56 l -1 65 l -1 79 b 0 99 -1 91 0 95 b 2 113 1 102 2 108 b 164 309 20 197 81 272 b 285 470 232 341 277 398 b 287 487 287 476 287 481 b 171 595 287 551 239 595 b 155 595 166 595 160 595 b 142 592 145 594 142 594 b 145 589 142 592 142 591 b 179 527 168 576 179 551 b 132 455 179 496 163 467 b 104 451 122 452 112 451 b 27 530 62 451 27 487 b 29 555 27 538 27 546 b 197 648 44 601 115 639 m 228 -1 l 230 -1 l 227 -1 l 228 -1 m 228 673 l 230 673 l 227 673 l 228 673 "},v3:{x_min:-1.359375,x_max:409.6875,ha:418,o:"m 174 648 b 191 648 176 648 183 648 b 225 648 204 648 220 648 b 402 523 317 638 389 588 b 404 503 404 517 404 510 b 402 484 404 495 404 488 b 264 373 389 437 334 394 b 257 370 259 371 257 371 b 257 370 257 370 257 370 b 264 369 258 370 261 369 b 409 202 359 334 409 267 b 318 72 409 152 381 104 b 200 43 281 52 240 43 b 23 113 134 43 69 68 b 0 169 6 129 0 149 b 77 249 0 210 29 249 l 77 249 b 152 174 125 249 152 212 b 103 102 152 145 137 116 b 103 102 103 102 103 102 b 147 94 103 101 132 95 b 153 94 149 94 151 94 b 265 206 219 94 265 141 b 264 226 265 213 265 219 b 147 355 253 299 204 353 b 126 371 133 356 126 362 b 147 388 126 383 132 388 b 254 474 196 391 238 424 b 259 502 258 484 259 494 b 182 592 259 544 228 582 b 156 595 175 595 166 595 b 115 592 142 595 129 594 l 111 591 l 115 588 b 152 524 141 574 152 549 b 92 449 152 491 130 458 b 76 448 87 448 81 448 b -1 530 32 448 -1 488 b 20 581 -1 548 5 566 b 174 648 55 619 108 641 m 204 -1 l 205 -1 l 202 -1 l 204 -1 m 204 673 l 205 673 l 202 673 l 204 673 "},v4:{x_min:0,x_max:468.21875,ha:478,o:"m 174 637 b 232 638 175 638 189 638 b 277 638 245 638 259 638 l 378 638 l 381 635 b 389 623 386 632 389 627 b 382 609 389 617 386 613 b 366 589 381 606 372 598 l 313 528 l 245 451 l 209 410 l 155 348 l 84 267 b 59 240 72 252 59 240 b 59 240 59 240 59 240 b 151 238 59 238 68 238 l 242 238 l 242 303 b 243 371 242 369 242 370 b 289 426 245 374 254 385 l 303 441 l 317 456 l 338 483 l 360 506 l 371 520 b 386 527 375 526 381 527 b 400 519 392 527 397 524 b 401 440 401 516 401 514 b 401 377 401 423 401 402 l 401 238 l 426 238 b 453 237 449 238 450 238 b 465 217 461 234 465 226 b 460 202 465 212 464 206 b 426 197 454 197 453 197 l 401 197 l 401 180 b 451 88 402 129 412 109 b 468 69 465 81 468 79 b 461 55 468 62 466 59 l 458 54 l 321 54 l 185 54 l 182 55 b 175 69 176 59 175 62 b 191 88 175 79 176 81 b 240 180 230 109 240 129 l 240 197 l 125 197 b 73 195 104 195 87 195 b 8 197 10 195 9 197 b 0 212 2 199 0 205 b 0 212 0 212 0 212 b 20 242 0 219 0 219 b 163 610 104 344 163 492 b 174 637 163 628 166 634 m 234 -1 l 235 -1 l 232 -1 l 234 -1 m 234 673 l 235 673 l 232 673 l 234 673 "},v5:{x_min:0,x_max:409.6875,ha:418,o:"m 47 637 b 53 638 49 638 50 638 b 69 634 55 638 61 637 b 210 610 114 619 161 610 b 363 634 259 610 311 619 b 382 638 372 637 378 638 b 392 634 386 638 389 637 b 397 623 396 630 397 627 b 393 610 397 620 396 616 b 298 505 368 552 338 520 b 212 494 277 498 246 494 b 65 517 163 494 106 502 b 61 517 62 517 61 517 b 61 517 61 517 61 517 b 51 408 61 517 51 412 b 51 408 51 408 51 408 b 51 408 51 408 51 408 b 61 412 53 408 55 409 b 125 434 80 421 103 430 b 185 441 145 440 166 441 b 409 244 310 441 409 353 b 401 191 409 227 406 209 b 197 43 375 105 287 43 b 159 47 183 43 171 44 b 23 123 112 56 61 86 b 0 180 6 140 0 159 b 76 260 0 220 31 260 b 92 259 81 260 87 259 b 152 183 132 251 152 216 b 100 112 152 152 134 122 b 95 111 98 112 95 111 b 95 111 95 111 95 111 b 129 98 95 109 119 101 b 148 97 136 97 141 97 b 264 235 206 97 261 158 b 265 248 265 240 265 244 b 210 398 265 312 243 373 b 179 408 201 406 194 408 b 174 408 178 408 176 408 b 53 369 130 408 88 394 b 34 359 39 359 38 359 b 17 374 24 359 17 365 b 39 628 17 384 38 625 b 47 637 40 631 43 635 m 204 -1 l 205 -1 l 202 -1 l 204 -1 m 204 673 l 205 673 l 202 673 l 204 673 "},v6:{x_min:0,x_max:475.03125,ha:485,o:"m 255 648 b 274 648 259 648 266 648 b 314 646 288 648 307 648 b 450 555 374 637 438 594 b 454 530 453 546 454 538 b 375 451 454 485 416 451 b 328 467 359 451 343 455 b 300 526 310 483 300 503 b 352 598 300 557 319 589 b 356 599 355 598 356 599 b 352 602 356 599 355 601 b 288 616 330 612 308 616 b 210 584 257 616 230 605 b 164 433 189 559 174 508 b 160 374 163 415 160 381 b 160 374 160 374 160 374 b 160 374 160 374 160 374 b 168 377 160 374 164 376 b 258 395 200 390 228 395 b 366 367 294 395 328 387 b 475 223 436 333 475 283 b 472 197 475 215 473 206 b 349 65 462 141 419 95 b 259 43 317 51 288 43 b 167 69 230 43 200 52 b 4 290 80 113 20 195 b 0 349 1 309 0 328 b 20 467 0 391 6 433 b 255 648 58 563 155 637 m 269 363 b 257 363 265 363 261 363 b 210 345 236 363 220 356 b 186 226 196 324 186 272 b 187 198 186 216 186 206 b 213 95 191 151 202 112 b 257 76 221 83 238 76 b 270 77 261 76 266 76 b 321 156 299 81 310 99 b 329 229 326 183 329 206 b 321 301 329 252 326 274 b 269 363 311 342 298 359 m 236 -1 l 238 -1 l 235 -1 l 236 -1 m 236 673 l 238 673 l 235 673 l 236 673 "},v7:{x_min:0,x_max:442.359375,ha:451,o:"m 147 648 b 166 649 153 649 160 649 b 313 598 217 649 273 630 b 340 587 323 588 328 587 l 341 587 b 412 628 367 587 390 601 b 427 638 416 635 421 638 b 439 632 431 638 435 637 b 442 623 441 630 442 628 b 430 569 442 616 439 603 b 352 369 408 492 377 410 b 300 259 325 324 313 298 b 273 84 283 205 273 140 b 265 55 273 65 272 59 l 261 54 l 181 54 l 99 54 l 96 55 b 91 61 95 56 92 59 l 89 63 l 89 77 b 147 263 89 133 111 202 b 261 401 176 313 212 355 b 378 541 315 449 349 489 l 382 548 l 375 544 b 240 495 333 512 285 495 b 129 535 198 495 160 509 b 84 560 108 552 95 560 b 76 559 81 560 78 560 b 31 487 59 555 43 530 b 14 470 27 473 24 470 b 1 477 8 470 4 471 l 0 480 l 0 553 l 0 627 l 1 630 b 16 638 4 635 9 638 b 23 635 17 638 20 637 b 49 626 36 626 39 626 b 96 638 59 626 80 630 b 104 639 99 638 102 639 b 117 644 107 641 112 642 b 147 648 125 645 137 648 m 220 -1 l 221 -1 l 219 -1 l 220 -1 m 220 673 l 221 673 l 219 673 l 220 673 "},v8:{x_min:0,x_max:488.640625,ha:499,o:"m 217 648 b 245 649 225 648 235 649 b 453 516 343 649 430 595 b 458 478 455 503 458 491 b 412 370 458 440 441 398 b 411 369 412 369 411 369 b 415 365 411 367 412 367 b 488 231 462 331 488 281 b 472 165 488 208 483 186 b 243 43 434 86 338 43 b 63 104 178 43 112 62 b 0 233 20 140 0 186 b 73 365 0 283 24 331 l 77 369 l 72 374 b 29 476 42 406 29 441 b 217 648 29 557 103 635 m 258 605 b 242 606 253 605 247 606 b 157 552 198 606 157 580 b 160 541 157 548 159 544 b 319 413 176 503 242 452 l 337 403 l 338 406 b 359 476 352 428 359 452 b 258 605 359 537 318 595 m 138 326 b 130 330 134 328 130 330 b 130 330 130 330 130 330 b 107 305 127 330 112 313 b 84 231 91 281 84 256 b 243 86 84 156 151 86 b 249 87 245 86 246 87 b 347 156 303 88 347 120 b 344 172 347 162 345 167 b 156 319 325 227 257 281 b 138 326 151 322 144 324 m 243 -1 l 245 -1 l 242 -1 l 243 -1 m 243 673 l 245 673 l 242 673 l 243 673 "},v9:{x_min:0,x_max:475.03125,ha:485,o:"m 191 646 b 212 649 198 648 205 649 b 255 644 227 649 243 646 b 458 448 348 616 428 539 b 475 342 469 415 475 378 b 460 244 475 308 469 274 b 193 44 421 124 303 44 b 91 69 157 44 122 51 b 19 161 43 97 19 126 b 21 181 19 167 20 174 b 98 241 32 220 65 241 b 170 186 129 241 160 223 b 172 166 171 179 172 173 b 121 94 172 134 152 102 b 117 93 118 94 117 93 b 121 90 117 93 118 91 b 185 76 142 80 164 76 b 270 119 220 76 251 91 b 308 259 287 145 300 194 b 313 317 310 277 313 310 b 313 317 313 317 313 317 b 313 317 313 317 313 317 b 304 315 313 317 308 316 b 216 295 273 302 245 295 b 145 308 193 295 170 299 b 19 398 88 327 42 360 b 0 469 5 420 0 444 b 24 551 0 496 8 526 b 191 646 54 596 125 637 m 227 614 b 215 616 224 616 220 616 b 202 614 210 616 206 616 b 152 535 174 610 163 592 b 144 463 147 509 144 485 b 152 391 144 440 147 417 b 216 328 163 344 179 328 b 280 391 253 328 269 344 b 288 463 285 417 288 440 b 280 535 288 485 285 509 b 227 614 269 594 258 610 m 236 -1 l 238 -1 l 235 -1 l 236 -1 m 236 673 l 238 673 l 235 673 l 236 673 "},va:{x_min:-149.71875,x_max:148.359375,ha:151,o:"m -8 -1 b -1 0 -5 -1 -4 0 b 16 -11 5 0 13 -4 b 83 -186 17 -12 47 -90 l 148 -358 l 148 -363 b 127 -385 148 -376 138 -385 b 112 -378 122 -385 118 -383 b 54 -226 110 -374 114 -385 b 0 -81 24 -147 0 -81 b -55 -226 -1 -81 -25 -147 b -114 -378 -115 -385 -111 -374 b -129 -385 -119 -383 -123 -385 b -149 -363 -140 -385 -149 -376 l -149 -358 l -84 -186 b -19 -11 -49 -90 -19 -12 b -8 -1 -17 -8 -12 -4 "},vb:{x_min:0,x_max:428.75,ha:438,o:"m 262 186 b 273 186 266 186 272 186 b 274 186 273 186 274 186 b 285 186 274 186 280 186 b 428 48 375 181 428 122 b 386 -68 428 12 416 -29 b 155 -187 329 -145 236 -187 b 12 -111 92 -187 38 -162 b 0 -51 4 -91 0 -72 b 262 186 0 58 122 179 "},vc:{x_min:0,x_max:447.8125,ha:457,o:"m 0 86 l 0 173 l 223 173 l 447 173 l 447 86 l 447 0 l 223 0 l 0 0 l 0 86 "},vf:{x_min:0,x_max:370.21875,ha:378,o:"m 0 0 l 0 277 l 61 277 l 122 277 l 122 0 l 122 -278 l 61 -278 l 0 -278 l 0 0 m 246 -1 l 246 277 l 308 277 l 370 277 l 370 -1 l 370 -278 l 308 -278 l 246 -278 l 246 -1 "},v10:{x_min:0,x_max:559.421875,ha:571,o:"m 5 127 b 14 127 6 127 9 127 b 51 126 25 127 43 127 b 175 98 93 122 138 112 l 186 94 b 279 51 210 86 255 65 b 285 47 280 51 283 48 b 319 27 291 44 311 31 l 326 22 b 359 0 332 19 352 4 l 367 -6 b 371 -9 368 -6 370 -8 l 379 -15 b 387 -22 383 -18 386 -20 l 398 -30 l 411 -40 l 417 -47 l 427 -55 l 434 -61 b 441 -66 436 -62 439 -65 l 446 -72 l 453 -77 l 462 -87 b 558 -188 490 -113 549 -176 b 559 -195 559 -191 559 -194 b 548 -205 559 -201 555 -205 b 541 -204 547 -205 544 -205 b 534 -198 539 -201 536 -199 l 525 -191 b 481 -162 518 -187 490 -167 b 472 -155 477 -159 472 -156 b 468 -152 470 -155 469 -154 b 461 -149 466 -152 464 -151 b 428 -130 454 -145 441 -137 b 371 -99 413 -122 372 -99 b 363 -95 371 -99 367 -98 b 353 -91 357 -94 353 -91 b 348 -90 353 -91 352 -91 b 332 -81 343 -87 341 -86 b 27 -12 230 -37 127 -13 b 0 -5 4 -11 2 -11 b 0 58 0 -2 0 27 b 0 122 0 88 0 120 b 5 127 1 124 4 126 "},v11:{x_min:-155.171875,x_max:153.8125,ha:157,o:"m -137 353 b -130 353 -136 353 -133 353 b -112 349 -125 353 -119 352 b -100 342 -110 347 -104 344 b 0 317 -69 326 -35 317 b 111 349 38 317 76 328 b 129 353 117 352 123 353 b 153 327 142 353 153 344 b 144 302 153 320 153 317 b 27 6 93 226 50 113 b 21 -13 24 -11 24 -11 b 0 -26 17 -22 8 -26 b -24 -12 -9 -26 -19 -22 b -28 5 -24 -9 -27 -2 b -145 302 -53 117 -95 224 b -155 327 -155 317 -155 320 b -137 353 -155 340 -148 349 "},v18:{x_min:0,x_max:323.9375,ha:331,o:"m 217 535 b 225 537 220 537 221 537 b 245 524 235 537 242 533 l 246 521 l 247 390 l 247 258 l 273 265 b 306 270 288 269 299 270 b 322 259 315 270 319 267 b 323 208 323 256 323 233 b 322 158 323 184 323 159 b 288 140 318 148 315 147 b 247 130 254 131 247 130 b 247 65 247 130 247 104 b 247 20 247 51 247 36 l 247 -88 l 273 -81 b 306 -76 289 -77 299 -76 b 318 -81 311 -76 315 -77 b 323 -123 323 -87 323 -86 l 323 -138 l 323 -154 b 318 -195 323 -191 323 -190 b 269 -210 314 -199 315 -199 b 249 -216 259 -213 250 -216 l 247 -216 l 247 -349 l 246 -483 l 245 -487 b 225 -499 242 -495 234 -499 b 206 -487 219 -499 210 -495 l 205 -483 l 205 -355 l 205 -227 l 204 -227 l 181 -233 l 138 -244 b 117 -249 127 -247 117 -249 b 115 -385 115 -249 115 -256 l 115 -523 l 114 -526 b 95 -538 110 -534 102 -538 b 74 -526 87 -538 78 -534 l 73 -523 l 73 -391 b 72 -260 73 -269 73 -260 b 72 -260 72 -260 72 -260 b 19 -273 61 -263 23 -273 b 0 -260 10 -273 4 -267 b 0 -209 0 -256 0 -256 l 0 -162 l 1 -158 b 61 -134 5 -148 5 -148 l 73 -131 l 73 -22 b 72 86 73 79 73 86 b 72 86 72 86 72 86 b 19 74 61 83 23 74 b 0 86 10 74 4 79 b 0 137 0 90 0 90 l 0 184 l 1 188 b 61 212 5 198 5 198 l 73 215 l 73 348 l 73 481 l 74 485 b 95 498 78 492 87 498 b 103 495 98 498 100 496 b 114 485 107 494 111 489 l 115 481 l 115 353 l 115 226 l 121 226 b 159 235 123 227 141 231 l 198 247 l 205 248 l 205 384 l 205 521 l 206 524 b 217 535 209 528 212 533 m 205 9 b 205 119 205 70 205 119 l 205 119 b 182 113 204 119 194 116 l 138 102 b 117 97 127 99 117 97 b 115 -12 115 97 115 91 l 115 -122 l 121 -120 b 159 -111 123 -119 141 -115 l 198 -101 l 205 -98 l 205 9 "},v1b:{x_min:0,x_max:559.421875,ha:571,o:"m 544 204 b 548 204 545 204 547 204 b 559 194 555 204 559 199 b 559 190 559 192 559 191 b 530 156 559 188 556 184 b 462 86 510 134 481 104 b 453 76 458 81 454 77 l 446 70 l 441 65 b 434 59 439 63 436 61 l 427 54 b 409 37 426 51 416 44 b 392 23 398 29 394 26 b 387 19 389 22 387 20 b 379 13 386 19 383 16 l 371 8 l 367 5 l 359 -1 l 337 -16 b 285 -48 319 -29 298 -41 l 279 -52 b 186 -95 255 -66 210 -87 l 175 -99 b 23 -129 127 -117 68 -129 b 17 -129 20 -129 19 -129 b 1 -123 2 -129 2 -129 b 0 -49 0 -122 0 -83 b 0 4 0 -22 0 1 b 27 11 2 9 4 9 b 185 31 78 12 145 20 b 198 34 186 31 193 33 b 314 73 234 44 277 58 b 349 88 328 79 340 84 b 353 90 352 90 353 90 b 363 94 353 90 357 93 b 371 98 367 97 371 98 b 428 129 372 98 413 120 b 461 148 441 136 454 144 b 468 151 464 149 466 151 b 472 154 469 152 470 154 b 481 161 473 155 477 158 b 525 190 490 166 518 186 l 534 197 b 540 201 536 198 539 199 b 544 204 541 202 544 204 "},v1d:{x_min:0,x_max:619.3125,ha:632,o:"m 274 184 b 307 186 285 186 296 186 b 616 22 465 186 597 116 b 619 -1 617 13 619 5 b 308 -187 619 -104 483 -187 b 0 -1 133 -187 0 -102 b 5 36 0 11 1 23 b 274 184 29 115 141 176 m 289 161 b 272 162 284 162 277 162 b 171 41 209 162 171 108 b 205 -73 171 5 182 -34 b 345 -163 243 -133 298 -163 b 436 -98 385 -163 420 -142 b 446 -43 443 -80 446 -62 b 289 161 446 47 377 147 "},v1e:{x_min:-402.890625,x_max:401.53125,ha:410,o:"m -219 173 b -213 174 -217 174 -215 174 b -202 173 -209 174 -205 173 b -114 86 -200 172 -179 151 b -28 0 -66 37 -28 0 b 40 84 -28 0 2 37 b 117 174 111 173 110 172 b 122 174 118 174 119 174 b 132 173 125 174 129 173 b 295 11 134 172 171 134 l 307 -1 l 336 34 b 374 76 366 72 368 74 b 381 77 375 77 378 77 b 401 56 392 77 401 68 b 400 48 401 54 401 51 b 223 -172 397 41 230 -166 b 210 -176 220 -174 215 -176 b 201 -174 206 -176 204 -176 b 112 -87 198 -173 178 -152 b 27 0 65 -38 27 0 b -42 -86 27 0 -4 -38 b -118 -174 -112 -174 -111 -173 b -123 -176 -119 -176 -121 -176 b -133 -174 -126 -176 -130 -174 b -296 -12 -136 -173 -172 -137 l -308 0 l -337 -34 b -375 -77 -367 -73 -370 -76 b -382 -79 -377 -79 -379 -79 b -402 -58 -393 -79 -402 -69 b -401 -49 -402 -55 -402 -52 b -224 172 -398 -43 -228 167 b -219 173 -223 172 -220 173 "},v1f:{x_min:-340.28125,x_max:338.921875,ha:346,o:"m -32 520 b -29 521 -31 520 -31 521 b -23 519 -27 521 -24 520 b -20 513 -21 517 -20 516 b -21 506 -20 512 -20 509 b -31 474 -23 502 -27 488 l -53 402 l -66 352 l -68 349 l -57 349 b -32 351 -51 349 -40 351 b 123 370 19 352 74 359 b 137 371 127 370 133 371 b 170 356 152 371 164 366 b 171 355 170 355 170 355 b 216 366 174 355 183 358 b 280 378 268 377 266 377 b 287 378 283 378 284 378 b 332 349 307 378 322 369 b 338 319 336 341 338 330 b 332 301 338 310 336 302 b 242 280 329 299 246 280 b 242 280 242 280 242 280 b 235 288 236 280 235 283 b 235 292 235 290 235 291 b 236 302 236 297 236 299 b 220 337 236 316 230 330 l 216 340 l 210 335 b 159 276 189 322 172 301 b 118 149 152 265 156 274 b 81 34 84 36 85 36 b -8 13 78 33 -4 13 b -8 13 -8 13 -8 13 b -14 20 -12 15 -14 15 b -8 44 -14 24 -12 31 b -2 66 -5 55 -2 65 b -2 66 -2 66 -2 66 l -2 66 b -43 41 -2 66 -21 55 b -114 4 -98 8 -98 8 b -144 0 -123 0 -134 0 b -242 99 -197 0 -242 43 b -242 109 -242 102 -242 105 b -212 219 -240 122 -242 116 b -185 312 -197 270 -185 312 l -185 312 b -189 312 -185 312 -186 312 b -259 312 -200 312 -227 312 b -321 310 -291 312 -310 310 b -334 312 -330 310 -334 312 b -340 319 -338 313 -340 316 b -336 326 -340 322 -338 324 b -291 337 -334 326 -314 331 l -247 347 l -210 348 b -172 348 -190 348 -172 348 b -168 363 -172 348 -171 355 b -145 442 -151 424 -145 441 b -133 452 -144 444 -140 446 l -77 489 b -32 520 -53 506 -32 520 m 57 334 b 53 335 55 335 54 335 b 44 334 50 335 49 335 b -70 316 8 326 -28 320 b -78 309 -78 316 -78 316 b -108 202 -80 305 -88 274 b -141 81 -136 112 -141 93 b -140 74 -141 79 -141 77 b -117 49 -137 59 -127 49 b -107 52 -114 49 -110 51 b 16 127 -106 54 14 126 b 42 217 16 127 42 215 b 49 241 42 222 44 229 b 73 320 53 251 73 317 b 57 334 73 327 65 333 "},v20:{x_min:-571.671875,x_max:570.3125,ha:582,o:"m -559 351 b -551 352 -556 352 -553 352 b -530 338 -543 352 -533 348 b -529 169 -530 337 -529 291 l -529 1 l -507 27 l -441 112 b -382 174 -394 169 -390 174 b -378 174 -381 174 -379 174 b -281 86 -370 174 -375 179 b -196 0 -234 37 -196 0 b -126 84 -196 0 -164 37 b -50 174 -55 173 -57 172 b -44 174 -49 174 -47 174 b -35 173 -42 174 -38 173 b 53 86 -32 172 -12 151 b 138 0 100 37 138 0 b 208 84 140 0 170 37 b 284 174 279 173 279 172 b 289 174 285 174 288 174 b 300 173 294 174 298 173 b 462 11 303 172 340 134 l 475 -1 l 503 34 b 541 76 534 72 536 74 b 548 77 544 77 545 77 b 570 56 560 77 570 68 b 567 48 570 54 568 51 b 392 -172 564 41 397 -166 b 378 -176 387 -174 382 -176 b 368 -174 375 -176 371 -176 b 280 -87 367 -173 347 -152 b 194 0 234 -38 194 0 b 126 -86 194 0 163 -38 b 49 -174 54 -174 55 -173 b 44 -176 47 -176 46 -176 b 34 -174 40 -176 36 -174 b -54 -87 31 -173 10 -152 b -140 0 -102 -38 -140 0 b -209 -86 -140 0 -171 -38 b -285 -174 -280 -174 -279 -173 b -291 -176 -287 -176 -288 -176 b -300 -174 -294 -176 -298 -174 b -464 -11 -303 -173 -374 -102 l -476 0 l -506 -37 b -539 -76 -528 -65 -537 -74 b -551 -80 -543 -79 -547 -80 b -570 -68 -558 -80 -566 -76 l -571 -65 l -571 136 b -570 340 -571 331 -571 337 b -559 351 -568 344 -564 348 "},v22:{x_min:0,x_max:432.828125,ha:442,o:"m 209 186 b 213 187 210 187 212 187 b 216 187 215 187 216 187 b 224 174 216 186 220 180 b 420 -1 269 105 338 43 b 432 -12 431 -8 432 -9 b 421 -23 432 -15 432 -16 b 228 -180 345 -70 264 -137 b 219 -188 221 -188 221 -188 l 219 -188 b 208 -177 215 -188 215 -188 b 10 1 163 -106 93 -44 b 0 11 0 6 0 8 b 10 22 0 13 0 15 b 202 179 87 69 167 136 b 209 186 206 183 209 186 "},v23:{x_min:0,x_max:133.390625,ha:136,o:"m 54 66 b 65 68 58 68 61 68 b 122 37 88 68 110 56 b 133 -1 130 26 133 12 b 104 -58 133 -23 123 -44 b 66 -69 92 -65 78 -69 b 10 -38 44 -69 23 -58 b 0 -1 2 -27 0 -13 b 54 66 0 30 20 61 "},v25:{x_min:0,x_max:318.5,ha:325,o:"m 20 376 b 167 377 23 377 96 377 b 296 376 231 377 294 377 b 318 347 311 371 318 359 b 296 316 318 333 311 320 b 159 315 294 315 227 315 b 21 316 91 315 24 315 b 0 345 6 320 0 333 b 20 376 0 359 6 371 "},v26:{x_min:-21.78125,x_max:483.1875,ha:493,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 383 20 616 20 616 l 20 148 l 21 151 b 140 199 59 183 102 199 b 206 179 164 199 187 192 l 210 176 l 210 396 l 210 617 l 212 621 b 231 632 216 628 223 632 b 250 620 239 632 247 628 b 251 383 251 616 251 616 l 251 148 l 254 151 b 370 199 291 183 332 199 b 415 191 385 199 400 197 b 483 84 458 176 483 134 b 461 0 483 58 476 29 b 332 -142 439 -40 411 -72 l 255 -215 b 231 -229 240 -229 239 -229 b 216 -223 224 -229 220 -227 b 210 -158 210 -217 210 -223 b 210 -120 210 -148 210 -136 l 210 -29 l 205 -34 b 100 -142 182 -65 159 -88 l 23 -215 b -1 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 l -21 -212 l -21 201 l -21 616 l -20 620 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 m 341 131 b 328 133 337 133 332 133 b 322 133 326 133 323 133 b 257 87 296 129 273 113 l 251 80 l 251 -37 l 251 -156 l 255 -152 b 375 81 328 -72 375 20 l 375 83 b 341 131 375 113 367 126 "},v27:{x_min:0,x_max:432.828125,ha:442,o:"m 208 184 b 213 187 209 186 212 187 b 224 176 217 187 221 183 b 245 147 225 172 235 159 b 419 -1 288 90 347 38 b 431 -8 424 -4 431 -8 b 432 -12 432 -9 432 -11 b 430 -18 432 -13 432 -16 b 364 -61 424 -20 383 -47 b 225 -183 307 -102 250 -152 b 223 -187 224 -184 223 -187 b 220 -188 221 -188 220 -188 b 208 -176 216 -188 210 -184 b 187 -148 205 -173 197 -159 b 12 0 144 -90 84 -38 b 0 11 4 5 0 8 b 16 24 0 13 4 18 b 183 158 83 69 141 115 b 208 184 194 169 198 173 m 183 105 b 176 113 181 109 176 113 b 172 109 176 113 175 112 b 92 45 149 90 117 62 l 88 41 l 102 31 b 247 -105 160 -6 210 -55 l 254 -115 l 257 -112 l 269 -102 b 340 -45 287 -87 319 -61 l 344 -43 l 330 -33 b 183 105 272 6 221 54 "},v28:{x_min:-73.5,x_max:72.140625,ha:74,o:"m -72 252 l -73 254 l 0 254 l 72 254 l 70 252 b 0 -1 70 248 0 -1 b -72 252 -1 -1 -72 248 "},v29:{x_min:-590.71875,x_max:589.359375,ha:601,o:"m 175 273 b 182 274 178 273 181 274 b 202 262 190 274 198 269 b 204 158 204 259 204 259 l 204 56 l 250 112 b 303 174 296 172 298 172 b 308 174 304 174 307 174 b 318 173 313 174 317 173 b 481 11 322 172 357 134 l 494 -1 l 522 34 b 560 76 553 72 555 74 b 567 77 563 77 564 77 b 589 56 579 77 589 68 b 586 48 589 54 588 51 b 411 -172 583 41 416 -166 b 397 -176 406 -174 401 -176 b 387 -174 393 -176 390 -176 b 299 -87 386 -173 366 -152 b 213 0 253 -38 213 0 b 208 -6 213 0 210 -2 l 204 -12 l 204 -147 b 204 -210 204 -173 204 -194 b 198 -292 204 -297 204 -287 b 183 -299 194 -297 189 -299 b 164 -287 175 -299 167 -295 b 163 -174 163 -284 163 -284 l 161 -63 l 119 -117 b 65 -176 76 -170 73 -176 b 61 -176 63 -176 62 -176 b -35 -87 51 -174 57 -180 b -121 0 -83 -38 -121 0 b -190 -86 -122 0 -152 -38 b -266 -174 -261 -174 -259 -173 b -272 -176 -268 -176 -270 -176 b -281 -174 -276 -176 -280 -174 b -371 -86 -284 -173 -304 -152 b -457 0 -417 -38 -457 0 l -457 0 b -477 -26 -457 0 -470 -16 b -548 -227 -524 -88 -548 -161 b -536 -303 -548 -254 -544 -280 b -533 -317 -534 -309 -533 -313 b -553 -338 -533 -330 -541 -338 b -577 -315 -566 -338 -571 -333 b -590 -227 -586 -287 -590 -258 b -518 -9 -590 -154 -564 -77 b -465 56 -509 2 -504 8 l -402 134 b -363 174 -374 170 -371 174 b -359 174 -362 174 -360 174 b -262 86 -351 174 -356 179 b -176 0 -216 37 -176 0 b -107 84 -176 0 -145 37 b -31 174 -36 173 -38 172 b -25 174 -29 174 -28 174 b -16 173 -23 174 -19 173 b 147 11 -13 172 35 123 l 157 -1 l 160 1 l 163 4 l 163 130 b 164 260 163 256 163 258 b 175 273 166 266 170 270 "},v2a:{x_min:-21.78125,x_max:366.140625,ha:374,o:"m 276 1378 b 284 1379 279 1379 281 1379 b 306 1360 292 1379 298 1374 b 352 1247 326 1326 343 1286 b 366 1139 362 1213 366 1175 b 347 1009 366 1093 359 1049 l 344 1002 l 347 992 b 352 971 348 986 351 977 b 366 863 362 936 366 899 b 347 732 366 818 359 773 l 344 725 l 347 716 b 352 695 348 710 351 700 b 366 588 362 659 366 623 b 223 262 366 464 314 345 b 189 233 212 252 212 252 b 35 76 126 183 73 129 b -1 16 20 56 2 27 b -19 4 -4 9 -12 4 l -21 4 l -21 137 l -21 270 l -17 270 b 186 344 59 281 134 308 b 319 606 270 399 319 499 b 317 650 319 620 319 635 l 315 659 l 314 655 b 223 537 288 607 258 570 b 189 509 212 528 212 528 b 35 352 126 459 73 405 b -1 292 20 333 2 303 b -19 280 -4 285 -12 280 l -21 280 l -21 413 l -21 546 l -17 546 b 186 620 59 557 134 584 b 319 882 270 675 319 775 b 317 925 319 896 319 911 l 315 935 l 314 931 b 223 813 288 884 258 846 b 189 785 212 805 212 805 b 35 628 126 735 73 681 b -1 569 20 609 2 580 b -19 556 -4 562 -12 556 l -21 556 l -21 689 l -21 823 l -17 823 b 202 907 68 835 152 867 b 319 1157 280 968 319 1061 b 270 1338 319 1218 303 1281 b 262 1358 264 1349 262 1353 b 262 1364 262 1360 262 1363 b 276 1378 265 1371 269 1376 "},v2c:{x_min:-597.53125,x_max:596.171875,ha:608,o:"m -413 173 b -408 174 -412 174 -409 174 b -397 173 -404 174 -400 173 b -308 86 -394 172 -374 151 b -223 0 -261 37 -223 0 b -153 84 -223 0 -191 37 b -77 174 -83 173 -84 172 b -72 174 -76 174 -74 174 b -62 173 -68 174 -63 173 b 25 86 -59 172 -39 151 b 112 0 73 37 111 0 b 181 84 112 0 144 37 b 257 174 251 173 251 172 b 262 174 258 174 261 174 b 273 173 266 174 270 173 b 436 9 276 172 347 101 l 447 -1 l 477 36 b 522 79 511 79 513 79 l 522 79 b 552 51 533 79 539 73 b 596 -112 582 6 596 -51 b 567 -262 596 -161 586 -213 b 539 -322 558 -287 544 -316 b 524 -327 534 -326 529 -327 b 504 -315 515 -327 507 -323 b 503 -308 503 -312 503 -309 b 511 -285 503 -302 504 -297 b 555 -113 540 -227 555 -169 b 544 -34 555 -86 551 -59 b 522 19 540 -16 530 8 l 521 22 l 481 -26 l 405 -122 b 353 -176 366 -172 362 -176 b 349 -176 352 -176 351 -176 b 253 -87 341 -176 347 -180 b 167 0 206 -38 167 0 b 99 -86 167 0 136 -38 b 21 -174 27 -174 28 -173 b 17 -176 20 -176 19 -176 b 6 -174 13 -176 9 -174 b -81 -87 4 -173 -14 -152 b -167 0 -129 -38 -167 0 b -236 -86 -167 0 -198 -38 b -313 -174 -307 -174 -306 -173 b -318 -176 -314 -176 -315 -176 b -328 -174 -321 -176 -325 -174 b -491 -12 -330 -173 -367 -137 l -503 0 l -530 -34 b -570 -77 -562 -73 -564 -76 b -577 -79 -571 -79 -574 -79 b -597 -58 -588 -79 -597 -69 b -596 -49 -597 -55 -597 -52 b -417 172 -593 -43 -423 167 b -413 173 -417 172 -415 173 "},v2d:{x_min:0,x_max:438.28125,ha:447,o:"m 212 190 b 219 191 213 191 216 191 b 236 176 225 191 228 190 b 419 18 277 105 341 49 b 436 5 431 13 434 11 b 438 -1 438 4 438 1 b 424 -16 438 -8 432 -13 b 356 -49 409 -20 379 -36 b 234 -180 306 -83 258 -133 b 219 -192 230 -188 224 -192 b 200 -176 213 -192 206 -187 b 9 -15 157 -102 89 -45 b 0 0 2 -12 0 -6 b 16 18 0 9 2 12 b 200 176 93 48 159 104 b 212 190 205 186 208 188 m 239 113 b 236 117 238 116 238 117 b 230 108 235 117 234 115 b 92 -15 196 58 140 8 b 88 -18 91 -16 88 -18 b 92 -20 88 -18 91 -19 b 198 -116 130 -43 166 -74 b 200 -117 200 -117 200 -117 b 201 -117 200 -117 201 -117 b 264 -43 212 -98 242 -62 b 345 15 288 -19 321 4 b 348 18 347 16 348 16 b 344 20 348 18 347 19 b 239 113 307 41 266 79 "},v2f:{x_min:-1.359375,x_max:680.5625,ha:694,o:"m 597 1042 b 604 1042 600 1042 602 1042 b 642 1002 627 1042 642 1022 b 619 966 642 988 635 974 b 439 927 574 942 503 927 l 426 927 l 426 921 b 430 838 428 893 430 866 b 345 480 430 696 398 560 b 179 391 307 423 249 391 b 156 392 171 391 164 392 b 138 394 149 394 142 394 b 103 434 115 396 103 416 b 129 471 103 451 111 466 b 141 474 133 473 137 474 b 172 459 153 474 164 469 b 181 455 175 456 176 455 b 187 456 182 455 185 455 b 253 520 212 460 234 483 b 315 836 294 605 315 714 b 311 928 315 867 314 898 b 302 945 310 943 311 942 b 245 953 283 950 262 953 b 130 891 193 953 149 931 b 84 860 119 870 102 860 b 36 905 61 860 39 877 b 36 910 36 907 36 909 b 80 970 36 931 50 949 b 249 1017 125 1000 187 1017 b 322 1009 273 1017 299 1014 l 341 1003 b 436 991 372 995 406 991 b 577 1031 495 991 545 1004 b 597 1042 583 1038 590 1041 m 416 360 b 424 360 419 360 421 360 b 481 309 454 360 479 338 b 503 145 484 280 495 199 b 585 -185 525 16 555 -106 b 630 -245 596 -213 613 -237 l 634 -247 l 638 -245 b 647 -244 641 -245 645 -244 b 680 -278 666 -244 680 -262 b 664 -308 680 -290 675 -301 b 638 -312 658 -310 650 -312 b 613 -309 631 -312 623 -310 b 477 -201 555 -303 502 -260 b 417 -2 460 -159 434 -72 b 416 5 417 1 416 5 b 416 5 416 5 416 5 b 411 -5 415 5 413 0 b 359 -97 397 -33 377 -70 b 353 -106 355 -102 353 -105 b 359 -112 353 -108 355 -109 b 409 -130 375 -123 390 -129 b 426 -134 420 -130 421 -131 b 431 -147 428 -137 431 -141 b 420 -162 431 -152 427 -159 b 382 -169 409 -166 396 -169 b 323 -155 363 -169 341 -165 l 317 -152 l 314 -155 b 62 -303 240 -240 148 -295 b 36 -305 55 -305 44 -305 b 23 -303 29 -305 24 -305 b -1 -273 6 -299 -1 -287 b 31 -240 -1 -256 10 -240 b 36 -240 32 -240 34 -240 b 42 -241 38 -241 39 -241 b 134 -204 63 -241 99 -226 b 367 288 265 -115 357 81 b 375 330 368 313 370 320 b 416 360 383 347 400 358 m 360 -359 b 379 -359 363 -359 371 -359 b 424 -360 396 -359 416 -359 b 646 -502 536 -373 624 -430 b 649 -527 649 -510 649 -519 b 530 -673 649 -578 604 -635 l 521 -677 l 529 -681 b 653 -811 592 -714 637 -762 b 660 -853 658 -827 660 -839 b 645 -911 660 -873 656 -892 b 426 -1021 608 -981 519 -1021 b 283 -989 377 -1021 328 -1011 b 235 -949 249 -972 239 -964 b 234 -936 234 -946 234 -941 b 234 -928 234 -934 234 -931 l 235 -925 l 234 -927 l 225 -934 b 87 -982 186 -966 138 -982 b 80 -982 85 -982 83 -982 b 55 -981 70 -981 58 -981 b 17 -943 32 -981 17 -964 b 54 -904 17 -921 35 -904 b 78 -914 62 -904 72 -909 l 83 -918 l 88 -918 b 190 -831 122 -918 166 -881 b 269 -506 242 -727 269 -612 b 268 -462 269 -492 269 -477 b 266 -449 266 -458 266 -452 b 265 -444 266 -445 266 -444 b 257 -446 264 -444 261 -445 b 132 -545 196 -470 152 -505 b 88 -573 122 -563 104 -573 b 39 -523 63 -573 39 -553 b 63 -476 39 -505 44 -494 b 360 -359 136 -408 235 -369 m 419 -424 b 393 -423 411 -423 406 -423 l 375 -423 l 377 -426 b 379 -439 377 -427 378 -434 b 383 -510 382 -463 383 -487 b 314 -811 383 -609 360 -710 b 266 -893 296 -850 285 -870 b 264 -898 265 -896 264 -898 l 264 -898 b 264 -898 264 -898 264 -898 b 268 -898 264 -898 266 -898 b 273 -898 270 -898 272 -898 b 300 -909 283 -898 291 -900 b 426 -957 340 -941 385 -957 b 476 -949 443 -957 460 -954 b 547 -853 522 -931 547 -893 b 485 -745 547 -816 526 -775 b 397 -707 460 -727 432 -714 b 366 -675 375 -703 366 -692 b 396 -642 366 -657 377 -645 b 530 -557 455 -637 511 -601 b 536 -527 534 -548 536 -537 b 419 -424 536 -480 490 -437 "},v30:{x_min:-21.78125,x_max:367.5,ha:375,o:"m 276 1900 b 284 1901 279 1900 281 1901 b 306 1883 291 1901 298 1896 b 367 1686 347 1825 367 1757 b 343 1558 367 1643 359 1600 l 338 1549 l 343 1537 b 367 1411 359 1497 367 1454 b 343 1282 367 1367 359 1324 l 338 1272 l 343 1261 b 367 1135 359 1221 367 1178 b 343 1007 367 1090 359 1047 l 338 996 l 343 985 b 367 859 359 945 367 902 b 343 731 367 814 359 771 l 338 720 l 343 709 b 367 582 359 667 367 626 b 289 362 367 503 340 426 b 239 312 276 345 259 330 b 29 77 152 237 76 152 b -1 18 14 54 2 30 b -19 4 -4 11 -12 4 l -21 4 l -21 133 l -20 260 l -13 262 b 98 299 17 269 62 284 b 111 305 103 302 110 305 b 167 334 123 310 156 327 b 319 595 264 391 319 491 b 313 659 319 616 318 638 b 310 667 311 664 311 667 b 307 663 310 667 308 666 b 240 588 289 637 269 614 b 16 331 141 505 62 413 b -1 294 8 316 1 302 b -19 280 -4 287 -12 280 l -21 280 l -21 408 l -20 537 l -13 538 b 98 576 17 545 62 560 b 111 581 103 578 110 581 b 167 610 123 587 156 603 b 319 871 264 667 319 767 b 313 935 319 892 318 913 b 310 942 311 941 311 942 b 307 939 310 942 308 941 b 240 864 289 913 269 889 b 16 607 141 781 62 689 b -1 570 8 592 1 578 b -19 556 -4 563 -12 556 l -21 556 l -21 684 l -20 813 l -13 814 b 98 852 17 821 62 836 b 111 857 103 855 110 857 b 167 886 123 863 156 880 b 319 1147 264 943 319 1043 b 313 1211 319 1168 318 1189 b 310 1218 311 1217 311 1218 b 307 1215 310 1218 308 1217 b 240 1140 289 1188 269 1165 b 16 884 141 1057 62 966 b -1 846 8 868 1 855 b -19 832 -4 839 -12 832 l -21 832 l -21 960 l -20 1089 l -13 1090 b 98 1128 17 1097 62 1111 b 111 1134 103 1131 110 1134 b 167 1163 123 1139 156 1156 b 319 1424 264 1220 319 1320 b 313 1486 319 1444 318 1465 b 310 1494 311 1493 311 1494 b 307 1492 310 1494 308 1493 b 240 1417 289 1464 269 1442 b 16 1160 141 1333 62 1242 b -1 1121 8 1145 1 1131 b -19 1109 -4 1115 -12 1109 l -21 1109 l -21 1236 l -20 1365 l -13 1367 b 98 1404 17 1374 62 1388 b 111 1410 103 1407 110 1410 b 250 1508 172 1437 215 1467 b 319 1701 296 1564 319 1633 b 270 1859 319 1757 303 1814 b 262 1882 265 1868 262 1875 b 276 1900 262 1890 266 1896 "},v31:{x_min:0,x_max:386.5625,ha:394,o:"m 0 173 l 0 347 l 193 347 l 386 347 l 386 173 l 386 0 l 193 0 l 0 0 l 0 173 "},v33:{x_min:-423.3125,x_max:421.9375,ha:431,o:"m -10 276 b -2 277 -8 277 -5 277 b 17 265 5 277 13 273 b 19 163 19 260 19 260 l 19 68 l 39 45 b 277 -95 122 -34 200 -81 b 289 -97 281 -97 285 -97 b 378 0 332 -97 371 -54 b 378 11 378 4 378 6 b 302 83 378 55 345 83 b 242 66 283 83 262 77 b 208 56 231 59 219 56 b 148 120 175 56 148 81 b 200 186 148 151 164 172 b 261 198 220 194 240 198 b 420 45 341 198 411 137 b 421 22 421 37 421 29 b 257 -198 421 -86 347 -188 b 242 -198 251 -198 247 -198 b 20 -105 181 -198 95 -163 l 19 -104 l 19 -183 b 19 -216 19 -195 19 -206 b 12 -273 19 -272 17 -267 b -2 -278 8 -277 2 -278 b -21 -266 -10 -278 -19 -274 b -23 -165 -23 -263 -23 -262 l -23 -69 l -44 -47 b -250 86 -117 23 -183 66 b -295 94 -270 93 -284 94 b -315 91 -302 94 -308 94 b -381 5 -356 81 -381 43 b -355 -56 -381 -16 -372 -40 b -299 -81 -338 -73 -319 -81 b -246 -68 -283 -81 -265 -77 b -212 -58 -234 -61 -223 -58 b -168 -77 -196 -58 -179 -65 b -151 -122 -156 -90 -151 -105 b -179 -174 -151 -141 -160 -162 b -239 -195 -194 -184 -217 -192 b -257 -197 -245 -195 -250 -197 b -423 -5 -349 -197 -423 -113 b -423 0 -423 -4 -423 -1 b -277 194 -420 97 -362 173 b -247 197 -268 197 -258 197 b -24 104 -185 197 -100 162 l -23 102 l -23 181 b -21 265 -23 260 -23 260 b -10 276 -20 269 -14 274 "},v34:{x_min:0,x_max:622.03125,ha:635,o:"m 398 417 b 406 419 401 419 404 419 b 427 398 417 419 427 409 b 427 391 427 395 427 392 b 34 -274 424 385 38 -272 b 20 -280 29 -278 25 -280 b 0 -259 9 -280 0 -270 b 0 -252 0 -256 0 -254 b 393 413 2 -247 389 410 b 398 417 394 415 397 416 m 592 417 b 600 419 594 419 597 419 b 622 398 611 419 622 409 b 620 391 622 395 620 392 b 227 -274 617 385 231 -272 b 213 -280 223 -278 219 -280 b 193 -259 202 -280 193 -270 b 194 -252 193 -256 193 -254 b 586 413 196 -247 582 410 b 592 417 588 415 590 416 "},v36:{x_min:-1.359375,x_max:1064.390625,ha:1086,o:"m 296 692 b 314 694 302 694 307 694 b 386 685 337 694 366 689 b 548 498 480 660 548 580 b 548 481 548 492 548 487 b 455 395 541 426 499 395 b 370 462 420 395 383 417 b 362 496 364 477 362 488 b 377 514 362 509 367 514 b 393 501 386 514 390 510 b 432 474 397 484 413 474 b 470 487 445 474 458 478 b 491 530 484 496 491 510 b 490 544 491 534 491 539 b 333 660 479 606 411 657 l 323 662 l 315 646 b 269 524 285 591 269 556 b 321 431 269 492 287 466 b 349 395 338 413 343 408 b 363 342 359 378 363 362 b 359 312 363 333 362 322 b 285 158 348 266 318 206 b 281 152 283 155 281 152 b 281 152 281 152 281 152 b 287 154 283 152 284 152 b 318 155 298 154 308 155 b 461 98 371 155 419 136 l 464 97 l 483 112 b 503 129 494 120 503 127 b 504 130 503 129 504 129 b 503 138 504 131 503 134 b 500 180 500 152 500 166 b 553 326 500 238 518 288 b 604 366 560 331 592 358 b 649 381 617 376 632 381 b 696 362 665 381 681 374 b 724 302 714 347 724 324 b 695 238 724 278 714 255 b 660 210 691 234 662 212 b 579 148 658 209 582 151 b 579 148 579 148 579 148 b 596 106 579 144 589 119 b 622 77 604 88 609 83 b 657 69 632 72 645 69 b 748 112 688 69 721 84 b 755 123 754 117 755 120 b 755 127 755 124 755 126 b 751 165 752 137 751 151 b 758 219 751 183 754 202 b 894 387 774 290 820 347 b 896 390 896 388 896 388 b 891 398 896 391 895 392 b 622 560 827 477 730 535 b 600 580 605 564 600 569 b 617 596 600 591 607 596 b 628 595 622 596 624 596 b 1057 248 846 552 1020 412 b 1064 191 1061 229 1064 209 b 922 0 1064 94 1005 9 b 902 -1 916 -1 909 -1 b 774 76 847 -1 800 26 b 769 83 770 81 770 83 b 769 81 769 83 769 83 b 627 -1 733 29 677 -1 b 548 27 597 -1 570 8 b 515 88 537 37 525 61 l 513 95 l 510 93 l 453 45 b 390 0 396 0 396 0 b 390 0 390 0 390 0 b 374 15 381 0 377 4 b 268 105 359 69 314 105 b 250 104 262 105 257 105 l 243 102 l 234 90 b 155 1 201 49 159 2 b 147 -1 152 0 149 -1 b 130 15 138 -1 130 6 b 132 20 130 18 132 19 b 136 31 133 22 134 27 b 220 131 149 74 178 109 b 231 137 225 134 230 136 b 302 278 280 202 302 244 b 265 335 302 299 295 309 b 209 442 234 363 213 402 b 209 455 209 446 209 451 b 279 648 209 502 232 564 l 285 659 l 283 659 b 176 627 238 653 210 645 b 57 477 111 594 66 538 b 55 459 55 471 55 464 b 72 409 55 437 61 415 b 93 403 78 405 87 403 b 152 467 123 403 151 431 b 168 488 153 483 157 488 b 185 462 181 488 185 483 l 185 460 b 137 344 183 409 168 369 b 78 322 119 328 98 322 b 13 360 50 322 25 335 b -1 426 4 380 -1 402 b 89 610 -1 488 32 559 b 296 692 147 659 210 685 m 926 348 b 921 353 924 351 922 353 b 914 348 920 353 918 351 b 823 167 857 306 823 237 b 828 124 823 154 826 138 b 890 31 837 79 862 40 b 896 31 892 31 894 31 b 956 104 916 31 940 59 b 970 191 965 129 970 159 b 966 241 970 208 969 224 b 926 348 959 277 945 313 m 627 326 b 619 326 624 326 622 326 b 598 316 611 326 604 323 b 568 215 579 288 568 255 b 568 208 568 213 568 210 b 571 183 570 195 570 184 l 571 183 b 594 201 571 183 582 191 l 634 231 b 660 259 653 247 656 248 b 664 278 662 266 664 272 b 627 326 664 299 649 320 "},v38:{x_min:-1.359375,x_max:651.96875,ha:665,o:"m 389 644 b 405 645 394 645 400 645 b 504 566 450 645 492 613 b 507 541 506 557 507 549 b 480 471 507 514 498 489 l 477 467 l 483 470 b 609 591 539 485 586 531 b 613 601 611 595 613 599 b 631 609 619 607 624 609 b 651 588 641 609 651 602 b 200 -946 651 584 204 -941 b 182 -957 197 -953 190 -957 b 163 -945 174 -957 166 -953 b 161 -939 161 -942 161 -942 b 217 -743 161 -931 170 -904 b 272 -555 247 -639 272 -555 b 272 -555 272 -555 272 -555 b 264 -560 272 -555 268 -557 b 140 -603 227 -589 182 -603 b 36 -567 102 -603 65 -592 b -1 -487 12 -548 -1 -517 b 17 -427 -1 -466 5 -445 b 103 -380 38 -395 70 -380 b 191 -433 137 -380 172 -398 b 205 -484 201 -448 205 -466 b 178 -553 205 -509 196 -535 l 175 -557 l 182 -555 b 307 -435 236 -539 284 -494 b 372 -213 308 -430 372 -215 b 372 -213 372 -213 372 -213 b 364 -219 372 -213 368 -216 b 240 -262 328 -247 283 -262 b 137 -226 202 -262 166 -249 b 99 -145 112 -206 99 -176 b 118 -84 99 -124 106 -104 b 204 -38 138 -54 171 -38 b 292 -91 238 -38 273 -56 b 306 -141 302 -106 306 -124 b 279 -212 306 -167 296 -194 l 276 -215 l 281 -213 b 408 -93 336 -198 385 -151 b 473 129 409 -88 473 127 b 473 129 473 129 473 129 b 465 122 473 129 469 126 b 341 80 428 94 383 80 b 236 115 303 80 266 91 b 200 195 213 136 200 165 b 217 256 200 217 206 238 b 304 303 239 287 272 303 b 393 249 338 303 374 285 b 406 199 402 234 406 217 b 379 129 406 173 397 148 l 377 126 l 382 127 b 509 248 436 142 485 190 b 574 470 510 254 574 469 b 574 470 574 470 574 470 b 566 464 574 470 570 467 b 442 421 529 435 484 421 b 337 458 404 421 367 433 b 300 537 313 478 300 508 b 389 644 300 585 334 635 "},v39:{x_min:-171.5,x_max:251.8125,ha:257,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 553 20 616 20 614 b 20 491 20 503 20 491 l 20 491 b 153 535 47 501 149 535 b 174 514 167 535 174 524 b 164 496 174 508 171 501 b 92 470 164 495 132 484 l 20 445 l 20 390 b 20 363 20 378 20 370 b 20 333 20 340 20 333 l 20 333 b 153 377 47 344 149 377 b 174 356 167 377 174 367 b 164 338 174 349 171 342 b 92 312 164 338 132 326 l 20 288 l 20 219 l 20 148 l 21 151 b 137 199 59 183 99 199 b 182 191 152 199 167 197 b 251 84 227 176 251 134 b 228 0 251 58 243 29 b 100 -142 206 -40 178 -72 l 23 -215 b -1 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 b -21 30 -21 -212 -21 -212 b -21 273 -21 163 -21 273 b -84 252 -21 273 -50 263 b -152 230 -133 234 -145 230 b -157 231 -155 230 -156 231 b -171 252 -166 234 -171 244 b -160 270 -171 259 -167 266 b -27 316 -159 270 -93 294 l -21 319 l -21 374 b -21 431 -21 406 -21 431 b -84 409 -21 431 -50 421 b -152 388 -133 392 -145 388 b -157 390 -155 388 -156 388 b -171 409 -166 392 -171 401 b -160 428 -171 417 -167 424 b -27 474 -159 428 -93 451 l -21 476 l -21 546 b -20 620 -21 614 -21 616 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 "},v3b:{x_min:0,x_max:484.5625,ha:494,o:"m 228 245 b 239 247 234 247 239 247 b 243 247 240 247 242 247 b 303 238 257 247 287 242 b 484 -2 417 208 484 104 b 412 -177 484 -65 461 -127 b 243 -248 363 -226 303 -248 b 6 -63 138 -248 36 -180 b 0 -1 1 -41 0 -20 b 228 245 0 127 98 240 m 255 181 b 240 183 247 183 245 183 b 232 181 238 183 235 183 b 142 152 200 180 168 170 l 138 149 l 190 97 l 242 44 l 294 97 l 345 149 l 340 152 b 255 181 315 169 284 180 m 147 -54 l 197 -1 l 147 51 l 95 104 l 91 99 b 62 -1 72 70 62 34 b 66 -43 62 -15 63 -29 b 91 -101 72 -63 80 -84 l 95 -106 l 147 -54 m 393 99 b 389 104 390 102 389 104 b 337 51 389 104 366 80 l 285 -1 l 337 -54 l 389 -106 l 393 -101 b 421 -1 412 -72 421 -36 b 393 99 421 34 412 69 m 294 -98 b 242 -45 265 -69 242 -45 b 190 -98 242 -45 219 -69 l 138 -151 l 142 -154 b 242 -184 172 -174 206 -184 b 340 -154 276 -184 311 -174 l 345 -151 l 294 -98 "},v3c:{x_min:0,x_max:450.53125,ha:460,o:"m 189 302 b 204 303 193 302 198 303 b 303 224 250 303 292 270 b 306 199 304 216 306 208 b 279 129 306 173 296 147 l 276 126 l 281 127 b 408 249 337 142 385 190 b 412 259 409 254 412 258 b 430 267 417 265 423 267 b 450 247 441 267 450 259 b 200 -605 450 242 204 -599 b 182 -616 197 -612 190 -616 b 163 -602 174 -616 166 -610 b 161 -598 161 -601 161 -601 b 217 -402 161 -589 170 -562 b 272 -213 247 -298 272 -213 b 272 -213 272 -213 272 -213 b 264 -219 272 -213 268 -216 b 140 -262 227 -247 182 -262 b 36 -226 102 -262 65 -249 b 0 -145 12 -206 0 -176 b 17 -84 0 -124 5 -104 b 103 -38 38 -54 70 -38 b 191 -91 137 -38 172 -56 b 205 -141 201 -106 205 -124 b 178 -212 205 -167 196 -194 l 175 -215 l 182 -213 b 307 -93 236 -198 284 -151 b 372 129 308 -88 372 127 b 372 129 372 129 372 129 b 364 122 372 129 368 126 b 240 80 328 94 283 80 b 137 115 202 80 166 91 b 99 194 111 136 99 165 b 189 302 99 244 133 292 "},v3e:{x_min:0,x_max:406.96875,ha:415,o:"m 21 183 b 28 183 24 183 25 183 b 42 181 34 183 39 183 b 127 108 47 179 47 179 b 202 41 168 72 202 41 b 279 108 204 41 238 72 b 357 177 321 145 356 176 b 375 183 363 181 370 183 b 406 151 392 183 406 169 b 404 137 406 147 405 141 b 322 62 401 131 398 129 b 251 0 284 27 251 0 b 322 -63 251 -1 284 -29 b 404 -138 398 -130 401 -133 b 406 -152 405 -142 406 -148 b 375 -184 406 -170 392 -184 b 357 -179 370 -184 363 -183 b 279 -109 356 -177 321 -147 b 202 -43 238 -73 204 -43 b 127 -109 202 -43 168 -73 b 49 -179 85 -147 50 -177 b 31 -184 43 -183 36 -184 b 0 -152 13 -184 0 -170 b 2 -138 0 -148 0 -142 b 83 -63 5 -133 8 -130 b 155 0 122 -29 155 -1 b 83 62 155 0 122 27 b 8 129 43 97 10 127 b 0 151 2 136 0 144 b 21 183 0 165 8 177 "},v3f:{x_min:-24.5,x_max:317.140625,ha:324,o:"m -24 -147 l -24 -5 l -20 -5 b -1 -19 -12 -5 -4 -11 b 58 -123 6 -43 31 -86 b 196 -278 93 -173 134 -219 b 317 -570 274 -356 317 -460 b 294 -713 317 -617 308 -666 l 289 -724 l 294 -735 b 317 -873 308 -780 317 -827 b 235 -1132 317 -963 288 -1054 b 209 -1165 228 -1140 224 -1146 b 189 -1177 204 -1172 196 -1177 b 171 -1164 182 -1177 175 -1172 b 168 -1154 170 -1161 168 -1159 b 181 -1132 168 -1149 172 -1142 b 269 -891 238 -1064 269 -975 b 269 -881 269 -886 269 -884 b 262 -814 269 -857 265 -827 b 258 -800 261 -811 259 -806 b 142 -628 240 -731 198 -667 b -8 -589 112 -606 47 -589 b -20 -589 -13 -589 -19 -589 l -24 -589 l -24 -449 l -24 -308 l -20 -308 b -1 -322 -12 -308 -4 -313 b 58 -424 6 -345 31 -388 b 194 -580 93 -476 136 -523 b 259 -660 221 -606 245 -635 b 261 -663 259 -662 261 -663 b 264 -656 262 -663 262 -660 b 269 -587 268 -632 269 -610 b 264 -521 269 -566 268 -544 b 262 -512 264 -517 262 -513 b 258 -498 261 -509 259 -503 b 142 -326 240 -428 198 -365 b -8 -287 112 -303 47 -288 b -20 -287 -13 -287 -19 -287 l -24 -287 l -24 -147 "},v40:{x_min:-1.359375,x_max:436.921875,ha:446,o:"m 213 205 b 217 205 215 205 216 205 b 234 194 224 205 234 199 b 236 187 234 194 235 190 l 245 167 l 261 129 l 270 106 b 355 -61 294 54 329 -13 b 420 -163 381 -105 402 -138 b 436 -188 435 -184 436 -184 b 436 -191 436 -190 436 -190 b 421 -206 436 -201 431 -206 l 421 -206 l 416 -206 l 405 -201 b 217 -158 347 -172 283 -158 b 31 -201 153 -158 88 -172 l 20 -206 l 14 -206 l 14 -206 b 0 -191 5 -206 0 -201 b -1 -188 0 -190 -1 -190 b 14 -163 -1 -186 0 -184 b 95 -34 36 -136 72 -77 b 166 106 119 8 148 68 l 175 129 l 183 148 l 200 188 b 213 205 205 199 208 202 "},v41:{x_min:-1.359375,x_max:556.6875,ha:568,o:"m 294 322 b 318 323 299 322 308 323 b 360 320 334 323 352 322 b 526 217 430 310 490 273 b 543 166 537 202 543 184 b 447 70 543 117 503 70 b 445 70 447 70 446 70 b 359 159 394 72 359 113 b 368 201 359 173 362 187 b 442 245 382 229 412 245 b 455 244 446 245 451 245 b 460 244 458 244 460 244 b 460 244 460 244 460 244 b 454 248 460 244 458 245 b 325 291 417 276 372 291 b 285 287 313 291 299 290 b 144 -2 183 269 144 190 b 281 -290 144 -208 179 -280 b 304 -291 289 -291 298 -291 b 524 -105 412 -291 506 -212 b 541 -84 526 -88 530 -84 b 556 -101 551 -84 556 -90 b 549 -138 556 -111 553 -122 b 334 -322 521 -237 435 -310 b 302 -324 323 -323 313 -324 b 13 -101 172 -324 54 -234 b -1 -1 4 -68 -1 -34 b 294 322 -1 161 121 303 "},v42:{x_min:-348.4375,x_max:24.5,ha:25,o:"m -330 155 b -322 156 -329 156 -326 156 b -315 156 -319 156 -317 156 b -298 147 -311 155 -308 154 b -19 30 -224 98 -122 55 l 2 26 b 24 -1 17 22 24 13 b 2 -27 24 -15 17 -23 l -19 -31 b -298 -148 -122 -56 -224 -99 b -322 -158 -313 -158 -315 -158 b -348 -131 -338 -158 -348 -145 b -344 -117 -348 -127 -347 -122 b -328 -104 -341 -112 -338 -111 b -127 -8 -269 -65 -202 -33 b -106 0 -115 -4 -106 -1 b -127 6 -106 0 -115 2 b -328 102 -202 31 -269 63 b -344 116 -338 109 -341 111 b -348 130 -347 120 -348 124 b -330 155 -348 141 -341 152 "},v43:{x_min:-442.359375,x_max:441,ha:450,o:"m -31 487 b -1 488 -21 488 -10 488 b 434 104 216 488 397 330 b 441 27 438 79 441 47 b 439 12 441 20 439 15 b 419 0 435 4 427 0 b 404 5 413 0 408 1 b 398 30 400 11 398 13 b 0 351 390 213 213 351 b -59 348 -20 351 -39 349 b -400 30 -251 324 -393 191 b -405 5 -400 13 -401 11 b -420 0 -409 1 -415 0 b -441 12 -428 0 -436 4 b -442 27 -441 15 -442 20 b -435 104 -442 47 -439 79 b -31 487 -401 316 -235 474 m -13 131 b -1 133 -9 133 -5 133 b 51 105 19 133 39 123 b 61 70 58 95 61 83 b 51 34 61 58 58 45 b -1 6 39 16 19 6 b -46 27 -17 6 -34 13 b -62 69 -57 38 -62 54 b -13 131 -62 98 -44 124 "},v44:{x_min:-21.78125,x_max:251.8125,ha:257,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 383 20 616 20 616 l 20 148 l 21 151 b 137 199 59 183 99 199 b 182 191 152 199 167 197 b 251 84 227 176 251 134 b 228 0 251 58 243 29 b 100 -142 206 -40 178 -72 l 23 -215 b 0 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 l -21 -212 l -21 201 l -21 616 l -20 620 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 "},v45:{x_min:-402.890625,x_max:401.53125,ha:410,o:"m -10 273 b -4 274 -9 273 -6 274 b 16 262 4 274 12 269 b 17 158 17 259 17 259 l 17 56 l 62 112 b 117 174 110 172 110 172 b 122 174 118 174 119 174 b 132 173 125 174 129 173 b 295 11 134 172 171 134 l 307 -1 l 336 34 b 374 76 366 72 368 74 b 381 77 375 77 378 77 b 401 56 392 77 401 68 b 400 48 401 54 401 51 b 223 -172 397 41 230 -166 b 210 -176 220 -174 215 -176 b 201 -174 206 -176 204 -176 b 112 -87 198 -173 178 -152 b 27 0 65 -38 27 0 b 21 -6 27 0 24 -2 l 17 -12 l 17 -147 b 17 -210 17 -173 17 -194 b 10 -292 17 -297 16 -287 b -2 -299 6 -297 2 -299 b -21 -287 -10 -299 -19 -295 b -24 -174 -23 -284 -23 -284 l -24 -63 l -66 -117 b -121 -176 -110 -170 -114 -176 b -125 -176 -122 -176 -123 -176 b -296 -12 -134 -174 -125 -184 l -308 0 l -337 -34 b -375 -77 -367 -73 -370 -76 b -382 -79 -377 -79 -379 -79 b -402 -58 -393 -79 -402 -69 b -401 -49 -402 -55 -402 -52 b -224 170 -398 -43 -231 165 b -212 174 -221 173 -216 174 b -202 173 -208 174 -205 174 b -39 11 -200 172 -151 122 l -28 -1 l -25 1 l -24 4 l -24 130 b -23 260 -24 256 -24 258 b -10 273 -20 266 -16 270 "},v46:{x_min:0,x_max:627.46875,ha:640,o:"m 306 190 b 314 191 308 191 311 191 b 326 184 318 191 322 190 l 336 173 b 510 52 377 127 442 80 b 515 49 513 51 515 49 b 611 16 537 40 579 24 b 627 0 624 13 627 9 b 607 -18 627 -11 624 -13 b 330 -181 490 -49 389 -109 b 314 -192 323 -190 319 -192 b 306 -191 311 -192 308 -192 b 294 -177 302 -188 302 -188 b 257 -140 287 -170 265 -148 b 19 -18 193 -84 114 -44 b 0 0 2 -13 0 -11 b 16 16 0 9 2 13 b 110 49 47 24 89 40 b 117 52 111 49 114 51 b 145 65 126 56 130 58 b 281 163 200 93 245 124 b 300 186 288 170 291 174 b 306 190 300 187 303 188 m 317 137 b 313 142 315 141 314 142 b 308 137 313 142 311 141 b 161 4 276 84 220 33 b 155 0 159 1 155 0 b 163 -4 155 0 159 -2 b 308 -138 220 -34 276 -84 b 313 -142 311 -141 313 -142 b 317 -138 314 -142 315 -141 b 464 -4 351 -84 406 -34 b 470 0 468 -2 470 0 b 464 4 470 0 468 1 b 317 137 406 33 351 84 "},v47:{x_min:-24.5,x_max:315.78125,ha:322,o:"m -24 -145 l -24 -5 l -20 -5 b 1 -26 -10 -5 -6 -9 b 175 -241 31 -86 96 -166 b 314 -548 259 -323 304 -420 b 315 -589 315 -555 315 -571 b 314 -630 315 -606 315 -623 b 298 -730 311 -664 306 -699 l 295 -742 l 296 -748 b 314 -850 304 -778 311 -813 b 315 -892 315 -857 315 -874 b 314 -932 315 -909 315 -925 b 298 -1032 311 -967 306 -1002 l 295 -1045 l 296 -1050 b 314 -1153 304 -1081 311 -1115 b 315 -1193 315 -1160 315 -1177 b 314 -1235 315 -1211 315 -1228 b 217 -1526 306 -1338 270 -1444 b 201 -1533 213 -1532 208 -1533 b 182 -1522 193 -1533 185 -1529 b 179 -1514 181 -1518 179 -1517 b 189 -1489 179 -1508 182 -1501 b 266 -1217 240 -1403 266 -1308 b 262 -1156 266 -1196 265 -1177 b 110 -907 247 -1043 190 -950 b 0 -889 87 -895 50 -889 l -1 -889 l -24 -889 l -24 -749 l -24 -610 l -20 -610 b 1 -631 -10 -610 -6 -614 b 175 -846 31 -691 96 -771 b 259 -956 213 -884 236 -914 b 265 -966 262 -961 264 -966 b 265 -966 265 -966 265 -966 b 265 -953 265 -964 265 -959 b 266 -920 266 -943 266 -932 b 262 -853 266 -898 265 -873 b 110 -605 247 -741 190 -648 b 0 -587 87 -592 50 -587 l -1 -587 l -24 -587 l -24 -448 l -24 -308 l -20 -308 b 1 -328 -10 -308 -6 -312 b 175 -544 31 -388 96 -469 b 259 -655 213 -581 236 -612 b 265 -663 262 -659 264 -663 b 265 -663 265 -663 265 -663 b 265 -650 265 -663 265 -657 b 266 -617 266 -641 266 -630 b 262 -551 266 -595 265 -570 b 110 -303 247 -438 190 -345 b 0 -284 87 -290 50 -284 l -1 -284 l -24 -284 l -24 -145 "},v49:{x_min:0,x_max:630.203125,ha:643,o:"m 308 204 b 314 205 310 205 313 205 b 326 201 319 205 323 204 b 355 154 328 199 338 180 b 401 83 362 142 392 95 l 409 72 b 431 41 412 66 424 49 b 619 -174 498 -51 570 -134 b 630 -192 626 -180 630 -186 b 626 -202 630 -195 628 -199 b 616 -206 623 -205 620 -206 b 552 -188 608 -206 592 -202 b 310 -155 488 -169 392 -155 b 268 -156 295 -155 281 -155 b 77 -188 197 -161 126 -173 b 13 -206 35 -202 20 -206 b 9 -206 12 -206 10 -206 b 0 -191 2 -202 0 -197 b 8 -176 0 -186 2 -180 b 204 49 58 -136 138 -43 l 220 72 l 227 83 b 295 188 245 108 281 166 b 308 204 299 197 304 202 m 315 147 b 314 147 315 147 314 147 b 314 147 314 147 314 147 b 306 129 314 145 310 138 l 296 105 b 281 72 292 97 284 77 l 274 56 b 181 -123 247 -4 212 -72 l 174 -134 l 176 -133 b 314 -123 215 -127 272 -123 b 451 -133 356 -123 413 -127 l 454 -134 l 449 -123 b 353 56 417 -72 381 -4 l 347 72 b 332 105 344 77 336 97 l 322 129 b 315 147 318 138 315 145 "},v4a:{x_min:70.78125,x_max:378.390625,ha:315,o:"m 246 373 b 254 373 249 373 251 373 b 372 324 303 373 360 351 b 378 302 377 317 378 309 b 338 251 378 278 362 255 b 328 249 334 249 332 249 b 283 294 303 249 283 270 b 288 315 283 301 284 308 b 289 319 289 317 289 319 b 289 319 289 319 289 319 b 283 320 289 320 287 320 b 270 322 279 322 274 322 b 206 288 242 322 215 308 b 206 283 206 287 206 285 b 257 223 206 267 230 238 b 284 206 272 213 277 210 b 351 90 328 173 351 130 b 340 47 351 74 348 59 b 205 -30 314 -2 264 -30 b 182 -29 198 -30 190 -30 b 84 15 147 -24 103 -5 b 70 48 74 24 70 36 b 108 99 70 70 85 94 b 121 102 112 101 117 102 b 167 56 147 102 167 80 b 159 31 167 48 164 40 l 156 26 l 157 26 b 190 20 167 22 178 20 b 220 26 201 20 212 22 b 258 65 243 34 258 51 b 257 70 258 66 258 69 b 204 126 249 94 234 109 b 114 258 148 158 114 209 b 125 302 114 273 118 288 b 246 373 147 342 193 370 "},v4b:{x_min:0,x_max:503.609375,ha:514,o:"m 274 430 b 277 430 276 430 277 430 b 310 394 296 430 310 415 b 308 383 310 391 308 387 b 306 367 307 381 307 374 b 236 120 298 305 272 210 b 40 -273 189 -5 125 -134 b 20 -287 35 -283 27 -287 b 5 -281 14 -287 9 -285 b 0 -267 1 -277 0 -273 b 9 -242 0 -262 2 -255 b 246 395 137 -12 232 242 b 274 430 249 416 257 427 m 468 430 b 472 430 469 430 470 430 b 503 394 490 430 503 415 b 502 383 503 391 503 387 b 499 367 502 381 500 374 b 431 120 491 305 465 210 b 234 -273 382 -5 318 -134 b 213 -287 228 -283 220 -287 b 198 -281 208 -287 202 -285 b 193 -267 194 -277 193 -273 b 202 -242 193 -262 196 -255 b 439 395 330 -12 426 242 b 468 430 442 416 451 427 "},v4d:{x_min:-311.6875,x_max:310.328125,ha:317,o:"m -9 388 b -2 390 -8 390 -5 390 b 5 388 1 390 4 390 b 19 378 10 387 16 383 b 23 333 23 371 23 371 b 24 298 23 299 24 298 b 81 276 34 298 65 285 b 213 91 145 240 190 177 b 224 24 217 76 224 36 b 257 24 224 24 235 24 b 299 19 292 24 292 24 b 310 -1 306 15 310 6 b 299 -23 310 -11 306 -19 b 257 -27 292 -27 292 -27 b 224 -29 235 -27 224 -29 b 213 -95 224 -40 217 -80 b 81 -280 190 -181 145 -244 b 24 -301 65 -290 34 -301 b 23 -335 24 -301 23 -303 l 23 -340 b 17 -381 23 -374 23 -374 b -1 -391 13 -388 5 -391 b -21 -381 -9 -391 -17 -388 b -27 -340 -27 -374 -27 -374 l -27 -335 b -28 -301 -27 -303 -27 -301 b -85 -280 -38 -301 -69 -290 b -217 -95 -149 -244 -194 -181 b -228 -29 -221 -80 -228 -40 b -259 -27 -228 -29 -238 -27 b -300 -23 -294 -27 -294 -27 b -311 -2 -307 -19 -311 -11 b -294 23 -311 8 -304 19 b -259 24 -291 23 -284 24 b -228 24 -239 24 -228 24 b -217 91 -228 36 -221 76 b -85 276 -194 177 -149 240 b -28 298 -69 285 -38 298 b -27 333 -27 298 -27 299 b -27 371 -27 362 -27 369 b -9 388 -24 378 -17 385 m -27 136 b -28 247 -27 197 -28 247 b -61 216 -31 247 -53 226 b -123 33 -95 172 -121 98 l -125 24 l -76 24 l -27 24 l -27 136 m 29 242 b 24 247 27 245 24 247 b 23 136 24 247 23 197 l 23 24 l 72 24 l 121 24 l 119 33 b 29 242 115 116 77 206 m -27 -140 l -27 -27 l -76 -27 l -125 -27 l -123 -36 b -61 -220 -121 -102 -95 -176 b -28 -251 -53 -230 -31 -251 b -27 -140 -28 -251 -27 -201 m 119 -36 l 121 -27 l 72 -27 l 23 -27 l 23 -140 b 24 -251 23 -201 24 -251 b 57 -220 27 -251 49 -230 b 119 -36 91 -176 117 -102 "},v4e:{x_min:0,x_max:239.5625,ha:244,o:"m 10 460 b 20 462 13 462 14 462 b 39 449 28 462 35 458 l 40 446 l 40 326 b 40 205 40 259 40 205 b 127 227 40 205 80 215 b 220 249 196 244 213 249 b 227 247 224 249 225 248 b 238 237 231 245 235 241 l 239 233 l 239 -106 l 239 -448 l 238 -451 b 219 -463 234 -459 225 -463 b 198 -451 210 -463 202 -459 l 197 -448 l 197 -324 b 197 -201 197 -248 197 -201 b 110 -223 196 -201 157 -210 b 17 -245 42 -240 24 -245 b 10 -242 13 -245 13 -244 b 0 -233 6 -241 2 -237 l 0 -230 l 0 108 l 0 446 l 0 449 b 10 460 2 453 6 458 m 197 22 b 197 70 197 41 197 58 b 196 116 197 113 197 116 l 196 116 b 118 97 196 116 160 106 l 40 77 l 40 -18 b 40 -112 40 -69 40 -112 l 119 -93 l 197 -73 l 197 22 "},v51:{x_min:-1.359375,x_max:455.96875,ha:465,o:"m 352 541 b 357 542 353 542 355 542 b 377 530 364 542 372 537 l 378 526 l 378 394 l 379 262 l 404 266 b 436 270 420 269 430 270 b 450 265 443 270 446 269 b 455 220 455 259 455 260 l 455 208 l 455 161 l 454 156 b 411 140 449 147 447 147 b 378 133 393 137 379 134 b 378 68 378 133 378 106 b 378 22 378 54 378 38 l 379 -87 l 404 -83 b 436 -79 420 -80 430 -79 b 450 -84 443 -79 446 -80 b 455 -129 455 -90 455 -88 l 455 -141 l 455 -188 l 454 -192 b 413 -209 449 -202 447 -202 b 382 -215 398 -212 383 -215 l 378 -215 l 378 -345 l 378 -380 b 375 -485 378 -484 378 -480 b 357 -494 371 -491 364 -494 b 340 -485 351 -494 344 -491 b 336 -383 337 -480 336 -484 l 336 -349 l 336 -223 l 334 -223 b 291 -231 334 -223 314 -227 l 247 -240 l 247 -371 l 246 -503 l 245 -506 b 225 -519 242 -514 234 -519 b 206 -506 219 -519 210 -514 l 205 -503 l 205 -376 l 205 -248 l 160 -256 l 115 -265 l 115 -396 l 115 -527 l 114 -531 b 95 -544 110 -539 102 -544 b 76 -531 87 -544 78 -539 l 73 -527 l 73 -399 b 73 -273 73 -330 73 -273 b 49 -277 73 -273 61 -274 b 17 -281 32 -280 24 -281 b 4 -276 10 -281 8 -280 b -1 -234 0 -269 -1 -272 b 0 -219 -1 -229 0 -224 l 0 -170 l 1 -167 b 10 -158 2 -163 6 -159 b 49 -149 13 -156 16 -155 l 73 -145 l 73 -34 b 73 76 73 26 73 76 b 49 72 73 76 61 74 b 17 68 32 69 24 68 b 4 73 10 68 8 69 b -1 115 0 80 -1 77 b 0 130 -1 120 0 124 l 0 179 l 1 181 b 10 191 2 186 6 190 b 49 199 13 192 16 194 l 73 204 l 73 338 b 73 374 73 352 73 365 b 77 483 73 484 73 477 b 95 492 81 489 88 492 b 111 483 100 492 107 489 b 115 378 115 477 115 483 l 115 342 b 117 212 115 223 115 212 b 204 229 117 212 200 227 l 205 229 l 205 365 l 205 502 l 206 505 b 225 517 210 513 219 517 b 245 505 234 517 242 513 l 246 502 l 247 369 l 247 237 l 249 237 b 336 254 253 238 336 254 b 337 390 336 254 337 302 l 337 526 l 338 530 b 352 541 341 535 347 539 m 336 15 b 336 126 336 102 336 126 l 336 126 b 291 117 336 126 315 122 l 247 109 l 247 -1 l 247 -112 l 249 -112 b 336 -95 253 -111 336 -95 b 336 15 336 -95 336 -56 m 205 -120 b 205 -55 205 -120 205 -93 b 205 -9 205 -41 205 -24 l 205 101 l 160 93 l 115 84 l 115 -26 b 115 -83 115 -49 115 -69 b 117 -137 115 -133 115 -137 b 205 -120 118 -137 204 -120 "},v52:{x_min:-10.890625,x_max:298.078125,ha:294,o:"m 138 473 b 142 474 140 473 141 474 b 164 459 148 474 153 470 b 191 402 183 442 191 423 b 181 353 191 388 187 371 b 178 349 179 352 178 349 b 179 348 178 348 179 348 b 185 349 181 348 182 348 b 255 376 210 355 234 363 b 272 381 264 381 266 381 b 298 355 287 381 298 370 b 288 330 298 348 298 345 b 171 34 238 254 194 141 b 166 13 168 16 168 16 b 144 1 161 5 152 1 b 121 15 134 1 125 5 b 115 33 119 18 117 24 b 0 330 91 145 49 252 b -10 355 -9 345 -10 348 b 13 381 -10 371 0 381 b 31 376 19 381 25 380 b 132 345 61 358 103 345 l 136 345 l 137 355 b 145 378 138 359 142 370 b 152 415 149 394 152 405 b 137 452 152 427 148 438 b 133 464 134 458 133 460 b 138 473 133 467 134 470 "},v53:{x_min:0,x_max:902.421875,ha:921,o:"m 17 240 b 24 241 19 241 21 241 b 32 240 28 241 31 241 b 46 229 38 238 43 234 b 50 88 50 223 50 237 b 50 -1 50 63 50 34 b 50 -90 50 -36 50 -65 b 46 -231 50 -238 50 -224 b 25 -242 42 -238 34 -242 b 0 -224 14 -242 4 -235 b 0 2 0 -222 0 -108 b 0 223 0 112 0 220 b 17 240 2 230 9 237 m 110 240 b 118 241 111 241 114 241 b 126 240 121 241 123 241 b 142 223 133 237 140 230 b 144 123 144 220 144 205 b 144 29 144 45 144 29 b 144 29 144 29 144 29 b 393 183 166 106 264 167 b 450 186 412 184 431 186 b 756 29 600 186 732 120 b 756 29 756 29 756 29 b 758 123 758 29 758 45 b 760 227 758 226 758 223 b 784 241 766 237 774 241 b 804 229 792 241 800 237 b 809 88 808 223 809 237 l 809 -1 l 809 -90 b 804 -231 809 -238 808 -224 b 784 -242 800 -238 792 -242 b 762 -231 775 -242 766 -238 b 758 -124 756 -224 758 -231 b 756 -30 758 -47 758 -30 b 756 -30 756 -30 756 -30 b 509 -184 736 -108 637 -169 b 450 -187 488 -187 469 -187 b 144 -30 300 -187 168 -122 b 144 -30 144 -30 144 -30 b 144 -124 144 -30 144 -47 b 140 -231 144 -231 144 -224 b 118 -242 134 -238 126 -242 b 92 -224 107 -242 96 -235 b 92 2 92 -222 92 -108 b 92 223 92 112 92 220 b 110 240 95 230 102 237 m 432 161 b 413 162 426 162 420 162 b 313 41 351 162 313 109 b 347 -73 313 5 323 -34 b 487 -163 385 -133 439 -163 b 578 -97 526 -163 562 -142 b 588 -43 585 -80 588 -62 b 432 161 588 47 518 147 m 868 240 b 876 241 869 241 872 241 b 884 240 879 241 882 241 b 898 229 890 238 894 234 b 902 88 902 223 902 237 l 902 -1 l 902 -90 b 898 -231 902 -238 902 -224 b 876 -242 892 -238 884 -242 b 852 -224 865 -242 854 -235 b 850 2 850 -222 850 -108 b 852 223 850 112 850 220 b 868 240 853 230 860 237 "},v54:{x_min:-24.5,x_max:317.140625,ha:324,o:"m -24 -161 l -24 -5 l -20 -5 b 0 -24 -9 -5 -2 -12 b 171 -315 21 -124 84 -233 b 317 -660 268 -406 317 -531 b 187 -1014 317 -782 274 -909 b 161 -1034 172 -1034 171 -1034 b 141 -1013 149 -1034 141 -1025 b 152 -991 141 -1004 142 -1002 b 266 -682 228 -899 266 -788 b 174 -430 266 -588 236 -498 b -23 -317 136 -388 66 -348 b -24 -161 -23 -316 -24 -285 "},v55:{x_min:0,x_max:551.25,ha:563,o:"m 289 644 b 304 645 294 645 299 645 b 404 566 349 645 392 613 b 406 541 405 557 406 549 b 379 471 406 514 397 489 l 377 467 l 382 470 b 509 591 438 485 485 531 b 513 601 510 595 513 599 b 530 609 518 607 524 609 b 551 588 540 609 551 602 b 200 -605 551 584 204 -599 b 182 -616 197 -612 190 -616 b 163 -602 174 -616 166 -610 b 161 -598 161 -601 161 -601 b 217 -402 161 -589 170 -562 b 272 -213 247 -298 272 -213 b 272 -213 272 -213 272 -213 b 264 -219 272 -213 268 -216 b 140 -262 227 -247 182 -262 b 36 -226 102 -262 65 -249 b 0 -145 12 -206 0 -176 b 17 -84 0 -124 5 -104 b 103 -38 38 -54 70 -38 b 191 -91 137 -38 172 -56 b 205 -141 201 -106 205 -124 b 178 -212 205 -167 196 -194 l 175 -215 l 182 -213 b 307 -93 236 -198 284 -151 b 372 129 308 -88 372 127 b 372 129 372 129 372 129 b 364 122 372 129 368 126 b 240 80 328 94 283 80 b 137 115 202 80 166 91 b 99 195 112 136 99 165 b 118 256 99 217 106 238 b 204 303 138 287 171 303 b 292 249 238 303 273 285 b 306 199 302 234 306 217 b 279 129 306 173 296 148 l 276 126 l 281 127 b 408 248 336 142 385 190 b 473 470 409 254 473 469 b 473 470 473 470 473 470 b 465 464 473 470 469 467 b 341 421 428 435 383 421 b 236 458 303 421 266 433 b 200 537 212 478 200 508 b 289 644 200 585 234 635 "},v58:{x_min:-21.78125,x_max:367.5,ha:375,o:"m 259 1553 b 265 1553 261 1553 264 1553 b 288 1540 272 1553 277 1550 b 367 1351 340 1493 367 1424 b 336 1221 367 1308 357 1263 l 332 1211 l 333 1208 b 367 1077 356 1170 367 1124 b 336 945 367 1032 357 986 l 332 935 l 333 932 b 367 800 356 893 367 848 b 336 669 367 756 357 710 l 332 659 l 333 656 b 367 523 356 617 367 571 b 345 412 367 485 360 446 b 231 273 322 356 284 310 b -1 19 121 195 27 93 b -17 4 -4 11 -10 5 l -21 4 l -21 134 l -21 265 l -17 265 b 133 291 20 265 96 278 b 318 537 245 328 318 433 b 307 603 318 559 315 582 b 303 614 304 612 304 614 b 298 609 302 614 300 613 b 231 549 281 589 258 567 b -1 295 121 471 27 369 b -17 280 -4 287 -10 281 l -21 280 l -21 410 l -21 541 l -17 541 b 133 567 20 541 96 555 b 318 813 245 605 318 709 b 307 880 318 835 315 859 b 303 891 304 888 304 891 b 298 885 302 891 300 888 b 231 825 281 866 258 843 b -1 571 121 748 27 645 b -17 556 -4 563 -10 557 l -21 556 l -21 687 l -21 817 l -17 817 b 133 843 20 817 96 830 b 318 1089 245 881 318 985 b 307 1156 318 1111 315 1134 b 303 1167 304 1164 304 1167 b 298 1161 302 1167 300 1164 b 231 1102 281 1140 258 1120 b -1 848 121 1024 27 921 b -17 832 -4 839 -10 834 l -21 832 l -21 963 l -21 1093 l -17 1093 b 114 1113 12 1093 78 1103 b 313 1314 215 1142 289 1218 b 318 1364 317 1331 318 1347 b 255 1511 318 1422 295 1478 b 243 1532 247 1519 243 1525 b 259 1553 243 1540 250 1550 "},v59:{x_min:0,x_max:464.140625,ha:474,o:"m 0 0 l 0 347 l 76 347 l 153 347 l 153 0 l 153 -348 l 76 -348 l 0 -348 l 0 0 m 308 -1 l 308 347 l 386 347 l 464 347 l 464 -1 l 464 -348 l 386 -348 l 308 -348 l 308 -1 "},v5a:{x_min:-171.5,x_max:170.140625,ha:174,o:"m -6 566 b 0 567 -5 567 -2 567 b 14 556 6 567 12 563 b 92 285 14 555 50 433 b 170 13 166 33 170 19 b 168 13 170 13 170 13 b 161 1 168 8 167 4 l 159 0 l 122 0 l 84 0 l 81 1 b 21 195 76 5 78 -5 b -32 381 -8 297 -32 381 b -87 197 -32 381 -57 298 b -141 8 -115 94 -140 9 b -155 0 -142 2 -149 0 b -171 15 -163 0 -171 5 b -14 556 -171 18 -24 528 b -6 566 -14 560 -10 564 "},v5b:{x_min:-441,x_max:439.640625,ha:449,o:"m -428 -2 b -421 0 -427 -1 -424 0 b -406 -6 -416 0 -409 -2 b -400 -31 -401 -12 -400 -15 b -1 -352 -392 -215 -215 -352 b 58 -349 19 -352 38 -351 b 398 -31 250 -326 392 -192 b 404 -6 398 -15 400 -12 b 419 -1 408 -2 413 -1 b 439 -13 427 -1 435 -5 b 439 -29 439 -16 439 -22 b 434 -105 439 -48 438 -80 b 0 -489 397 -333 213 -489 b -68 -484 -23 -489 -44 -488 b -441 -36 -280 -452 -436 -263 b -441 -30 -441 -34 -441 -31 b -428 -2 -441 -11 -439 -5 m -13 -9 b -1 -8 -9 -8 -5 -8 b 50 -36 19 -8 39 -19 b 61 -72 57 -47 61 -59 b 50 -106 61 -84 57 -97 b -1 -134 39 -124 19 -134 b -46 -115 -17 -134 -34 -129 b -62 -72 -57 -102 -62 -87 b -13 -9 -62 -44 -44 -16 "},v5c:{x_min:0,x_max:447.8125,ha:457,o:"m 0 -87 l 0 0 l 223 0 l 447 0 l 447 -87 l 447 -174 l 223 -174 l 0 -174 l 0 -87 "},v5d:{x_min:-1.359375,x_max:592.078125,ha:604,o:"m 280 692 b 295 694 283 692 289 694 b 310 692 300 694 307 692 b 357 630 340 684 357 657 b 336 580 357 612 351 594 b 311 538 321 566 311 549 b 352 492 311 512 330 492 b 366 495 357 492 362 492 b 397 553 390 503 397 517 b 415 603 397 576 402 591 b 460 623 427 617 443 623 b 509 599 479 623 498 614 b 522 559 518 587 522 573 b 494 506 522 538 513 519 b 451 495 481 498 473 496 b 415 488 432 495 426 494 b 394 449 404 483 394 464 b 394 448 394 448 394 448 l 394 440 l 397 433 b 428 409 404 420 413 413 b 438 408 431 408 435 408 b 479 431 450 408 462 415 b 528 455 495 448 510 455 b 548 452 534 455 541 453 b 592 391 577 442 592 416 b 549 331 592 365 577 340 b 528 327 541 328 534 327 b 479 351 510 327 495 335 b 438 374 464 367 450 374 b 417 369 431 374 424 373 b 394 333 402 360 394 348 b 400 312 394 326 396 319 b 451 287 408 294 420 288 b 513 258 484 285 499 278 b 522 223 519 247 522 234 b 461 159 522 190 496 159 b 449 161 457 159 453 159 b 397 229 416 167 397 191 b 366 288 397 265 390 278 b 352 290 362 290 357 290 b 315 262 336 290 321 280 b 311 245 313 256 311 251 b 334 204 311 233 318 220 b 355 170 348 190 351 184 b 357 152 356 166 357 159 b 355 136 357 147 356 140 b 295 88 345 104 321 88 b 232 152 264 88 232 112 b 255 204 232 174 238 186 b 279 244 273 222 279 231 l 279 245 b 238 290 279 270 259 290 b 224 288 234 290 228 290 b 193 229 200 278 193 265 b 141 161 193 191 174 167 b 129 159 137 159 133 159 b 68 223 93 159 68 190 b 77 258 68 234 70 247 b 138 287 91 278 106 285 b 185 302 166 287 175 291 b 196 333 193 312 196 323 b 174 369 196 347 187 360 b 152 374 166 373 159 374 b 111 351 140 374 126 367 b 62 327 95 335 80 327 b 51 328 58 327 54 327 b -1 391 16 334 -1 363 b 53 455 -1 420 17 449 b 62 455 57 455 59 455 b 111 431 80 455 95 448 b 152 408 127 415 140 408 b 161 409 155 408 159 408 b 193 433 176 413 186 420 l 196 440 l 196 448 b 196 451 196 449 196 449 b 190 471 196 459 194 463 b 137 495 182 489 167 495 l 134 495 l 134 495 b 68 560 95 495 68 521 b 129 623 68 596 95 623 b 144 621 134 623 138 623 b 193 553 175 614 193 589 b 224 495 193 517 200 503 b 238 492 228 492 234 492 b 279 538 259 492 279 512 b 254 580 279 549 269 566 b 232 630 239 594 232 612 b 280 692 232 657 250 684 m 307 456 b 295 458 303 458 299 458 b 230 391 258 458 230 426 b 236 360 230 381 231 371 b 295 324 249 337 272 324 b 353 360 318 324 341 337 b 360 391 357 370 360 381 b 307 456 360 421 340 451 "},v60:{x_min:-590.71875,x_max:589.359375,ha:601,o:"m -367 173 b -362 174 -366 174 -364 174 b -351 173 -357 174 -353 173 b -262 86 -348 172 -328 151 b -176 0 -216 37 -176 0 b -107 84 -176 0 -145 37 b -31 174 -36 173 -38 172 b -25 174 -29 174 -28 174 b -16 173 -23 174 -19 173 b 72 86 -13 172 6 151 b 157 0 119 37 157 0 b 227 84 159 0 189 37 b 303 174 298 173 296 172 b 308 174 304 174 307 174 b 318 173 313 174 317 173 b 481 11 322 172 357 134 l 494 -1 l 522 34 b 560 76 553 72 555 74 b 567 77 563 77 564 77 b 589 56 579 77 589 68 b 586 48 589 54 588 51 b 411 -172 583 41 416 -166 b 397 -176 406 -174 401 -176 b 387 -174 393 -176 390 -176 b 299 -87 386 -173 366 -152 b 213 0 253 -38 213 0 b 144 -86 213 0 182 -38 b 68 -174 73 -174 74 -173 b 62 -176 66 -176 65 -176 b 53 -174 59 -176 55 -174 b -35 -87 50 -173 29 -152 b -121 0 -83 -38 -121 0 b -190 -86 -122 0 -152 -38 b -266 -174 -261 -174 -259 -173 b -272 -176 -268 -176 -270 -176 b -281 -174 -276 -176 -280 -174 b -371 -86 -284 -173 -304 -152 b -457 0 -417 -38 -457 0 l -457 0 b -477 -26 -457 0 -470 -16 b -548 -227 -524 -88 -548 -161 b -536 -303 -548 -254 -544 -280 b -533 -317 -534 -309 -533 -313 b -553 -338 -533 -330 -541 -338 b -577 -315 -566 -338 -571 -333 b -590 -227 -586 -287 -590 -258 b -518 -9 -590 -154 -564 -77 b -465 56 -509 2 -504 8 l -402 134 b -367 173 -375 169 -372 172 "},v62:{x_min:46.28125,x_max:669.671875,ha:563,o:"m 183 376 b 189 376 185 376 187 376 b 212 374 197 376 208 376 b 265 337 234 369 253 355 b 274 317 268 331 273 320 b 274 316 274 317 274 316 b 280 323 276 316 276 319 b 311 358 288 337 299 348 b 319 366 315 360 318 365 b 356 376 326 373 340 376 b 382 371 364 376 374 374 b 428 337 400 366 417 352 b 436 317 431 331 436 320 b 438 316 436 317 436 316 b 442 323 438 316 439 319 b 475 358 451 337 462 348 b 483 366 477 360 481 365 b 518 376 488 373 503 376 b 544 373 528 376 536 376 b 604 285 579 360 604 326 b 597 249 604 273 601 258 b 543 63 596 247 544 70 b 541 54 543 61 541 55 b 540 44 540 51 540 47 b 552 23 540 33 545 23 b 552 23 552 23 552 23 b 647 126 586 29 627 72 b 658 138 651 136 653 138 b 660 138 660 138 660 138 b 669 129 666 137 669 136 b 654 88 669 122 665 109 b 562 -12 631 43 602 9 l 549 -19 b 521 -27 540 -24 530 -27 b 447 30 490 -27 458 -4 b 443 58 445 38 443 48 b 450 93 443 72 446 84 b 504 278 453 97 504 272 b 507 288 506 283 506 287 b 509 298 507 292 509 295 b 491 326 509 310 502 320 b 487 327 490 327 488 327 b 479 324 484 327 483 326 b 441 270 462 316 443 288 b 435 249 441 265 436 254 b 398 127 434 248 419 195 b 362 4 379 61 362 5 b 328 -1 359 -1 362 -1 b 314 -1 323 -1 319 -1 b 302 -1 310 -1 306 -1 b 266 4 266 -1 269 -1 b 265 6 265 5 265 5 b 303 144 265 13 272 34 b 343 278 325 216 343 276 b 344 288 343 281 344 285 b 345 298 345 291 345 295 b 330 326 345 310 340 320 b 323 327 328 327 325 327 b 317 324 322 327 321 326 b 279 270 300 316 281 288 b 273 249 279 265 274 254 b 236 127 272 248 255 195 b 200 4 216 61 200 5 b 164 -1 197 -1 198 -1 b 151 -1 161 -1 156 -1 b 140 -1 147 -1 142 -1 b 103 4 104 -1 106 -1 b 103 6 103 5 103 5 b 141 144 103 13 108 34 b 181 278 161 216 179 276 b 182 288 181 281 181 285 b 183 298 182 291 183 295 b 168 324 183 310 178 320 b 160 327 166 326 163 327 b 141 320 156 327 151 324 b 69 230 112 305 85 272 b 57 215 65 217 62 215 b 55 215 57 215 55 215 b 46 224 49 215 46 217 b 59 260 46 231 50 242 b 151 363 81 306 112 341 b 161 369 155 365 160 367 b 183 376 166 371 174 374 "},v68:{x_min:-597.53125,x_max:596.171875,ha:608,o:"m -533 324 b -525 327 -530 326 -528 327 b -504 305 -514 327 -504 317 b -504 305 -504 305 -504 305 b -513 284 -504 299 -504 299 b -556 112 -541 226 -556 167 b -545 33 -556 84 -552 58 b -524 -20 -541 15 -532 -9 l -522 -23 l -491 15 l -413 111 b -355 174 -367 169 -363 174 b -351 174 -353 174 -352 174 b -254 86 -343 174 -348 179 b -168 -1 -208 37 -168 -1 b -100 84 -168 -1 -137 37 b -23 173 -28 173 -29 172 b -19 174 -21 174 -20 174 b -8 173 -14 174 -10 173 b 155 11 -5 172 43 123 l 166 -1 l 168 1 l 170 4 l 170 130 b 171 260 170 256 170 258 b 191 274 175 269 183 274 b 205 267 196 274 201 272 b 212 158 212 262 210 273 l 212 56 l 257 112 b 311 173 304 172 304 172 b 317 174 313 174 314 174 b 326 173 319 174 323 173 b 490 11 329 172 366 134 l 502 -1 l 530 34 b 568 76 560 72 563 74 b 575 77 570 77 573 77 b 596 56 586 77 596 68 b 594 48 596 54 596 51 b 417 -172 592 41 424 -166 b 405 -176 415 -174 409 -176 b 396 -174 401 -176 398 -176 b 307 -87 393 -173 372 -152 b 221 -1 259 -38 221 -1 b 216 -6 221 -1 219 -2 l 212 -12 l 212 -147 b 212 -210 212 -173 212 -194 b 205 -292 212 -297 210 -287 b 191 -299 201 -297 196 -299 b 172 -287 183 -299 175 -295 b 170 -174 171 -284 171 -284 l 170 -63 l 127 -117 b 73 -176 84 -170 80 -176 b 68 -176 72 -176 70 -176 b -27 -87 59 -174 65 -180 b -114 0 -74 -38 -112 0 b -182 -86 -114 0 -145 -38 b -258 -174 -253 -174 -253 -173 b -264 -176 -259 -176 -262 -176 b -274 -174 -268 -176 -272 -174 b -438 -11 -277 -173 -348 -102 l -449 0 l -479 -37 b -524 -80 -513 -80 -514 -80 l -524 -80 b -553 -52 -534 -80 -540 -74 b -597 109 -583 -8 -597 48 b -560 280 -597 165 -585 224 b -533 324 -548 310 -540 322 "},v6c:{x_min:-1.359375,x_max:193.28125,ha:197,o:"m 78 233 b 87 233 81 233 84 233 b 187 140 132 233 174 195 b 193 102 190 127 193 115 b 43 -113 193 22 136 -62 b 27 -119 36 -116 31 -119 b 19 -108 21 -119 19 -115 b 29 -97 19 -102 20 -101 b 102 13 73 -72 102 -27 b 92 51 102 26 98 40 l 91 54 l 84 54 b 8 104 53 54 21 74 b -1 142 1 116 -1 130 b 78 233 -1 187 31 227 "},v6d:{x_min:-590.71875,x_max:589.359375,ha:601,o:"m 544 335 b 553 337 548 337 551 337 b 575 313 563 337 570 330 b 589 226 583 285 589 256 b 517 8 589 152 563 76 b 464 -58 507 -4 503 -9 l 401 -136 b 362 -176 372 -172 370 -176 b 357 -176 360 -176 359 -176 b 261 -87 349 -174 355 -180 b 175 0 215 -38 175 0 b 106 -86 175 0 144 -38 b 29 -174 35 -174 36 -173 b 24 -176 28 -176 27 -176 b 14 -174 21 -176 17 -174 b -73 -87 12 -173 -8 -152 b -159 0 -121 -38 -159 0 b -228 -86 -160 0 -190 -38 b -304 -174 -299 -174 -298 -173 b -310 -176 -306 -176 -308 -176 b -319 -174 -314 -176 -318 -174 b -483 -12 -323 -173 -359 -137 l -495 0 l -524 -34 b -562 -77 -553 -73 -556 -76 b -568 -79 -564 -79 -566 -79 b -590 -58 -581 -79 -590 -69 b -588 -49 -590 -55 -589 -52 b -412 170 -585 -43 -417 165 b -398 174 -408 173 -402 174 b -389 173 -394 174 -392 174 b -300 86 -387 172 -366 151 b -215 -1 -254 37 -215 -1 b -145 84 -215 -1 -183 37 b -69 173 -74 173 -76 172 b -63 174 -68 174 -66 174 b -54 173 -61 174 -57 173 b 34 86 -51 172 -31 151 b 119 -1 81 37 119 -1 b 189 84 121 -1 151 37 b 265 173 259 173 258 172 b 270 174 266 174 269 174 b 280 173 274 174 279 173 b 370 84 283 172 303 151 b 455 -1 416 37 455 -1 l 455 -1 b 476 24 455 -1 469 15 b 547 226 522 87 547 159 b 534 302 547 252 543 278 b 532 317 533 308 532 313 b 544 335 532 326 536 333 "},v6f:{x_min:-80.3125,x_max:78.9375,ha:81,o:"m 63 191 b 69 192 65 192 66 192 b 77 188 72 192 76 191 b 78 183 78 187 78 186 b 74 158 78 179 77 172 l 66 115 b 9 -161 49 30 10 -158 b -10 -187 6 -172 -1 -181 b -34 -194 -17 -191 -25 -194 b -80 -147 -58 -194 -80 -174 b -80 -141 -80 -144 -80 -142 b 9 70 -80 -134 -73 -117 l 49 163 b 63 191 59 188 61 190 "},v70:{x_min:0,x_max:436.921875,ha:446,o:"m 213 190 b 217 191 215 191 216 191 b 231 184 223 191 228 188 b 249 154 240 167 246 159 b 419 18 292 91 348 45 b 436 -1 435 11 436 8 b 424 -16 436 -9 434 -13 b 308 -87 394 -26 340 -59 b 231 -186 276 -117 257 -142 b 219 -192 228 -191 225 -192 b 198 -174 209 -192 208 -191 b 47 -33 161 -113 110 -63 b 10 -16 34 -26 17 -19 b 0 -1 2 -13 0 -9 b 17 18 0 8 1 11 b 198 173 95 48 156 101 b 213 190 206 187 208 188 "},v72:{x_min:-423.3125,x_max:421.9375,ha:431,o:"m -262 197 b -247 197 -257 197 -253 197 b -118 162 -210 197 -163 184 b 40 45 -61 134 -13 98 b 277 -95 119 -33 200 -81 b 289 -97 281 -97 285 -97 b 378 0 332 -97 371 -55 b 378 11 378 4 378 6 b 302 83 378 55 345 83 b 242 66 283 83 262 77 b 208 56 231 59 219 56 b 148 120 175 56 148 81 b 201 186 148 151 164 172 b 261 198 220 194 240 198 b 420 45 341 198 411 136 b 421 22 421 37 421 29 b 245 -199 421 -93 338 -199 b 238 -198 243 -199 240 -199 b -44 -47 148 -194 50 -141 b -250 86 -114 22 -183 66 b -295 94 -270 91 -283 94 b -315 91 -302 94 -307 94 b -381 4 -356 81 -381 43 b -355 -56 -381 -18 -372 -40 b -298 -81 -338 -73 -319 -81 b -246 -68 -283 -81 -265 -77 b -212 -58 -234 -61 -223 -58 b -178 -69 -200 -58 -189 -62 b -151 -122 -160 -81 -151 -101 b -171 -167 -151 -138 -157 -155 b -239 -195 -185 -181 -213 -192 b -257 -197 -245 -197 -250 -197 b -423 -5 -352 -197 -423 -109 b -412 65 -423 16 -419 40 b -262 197 -389 137 -329 188 "},v74:{x_min:-206.890625,x_max:428.75,ha:438,o:"m 389 -351 b 394 -351 390 -351 393 -351 b 428 -385 413 -351 428 -367 b 428 -394 428 -388 428 -391 b 394 -428 426 -406 421 -410 l 332 -473 l 269 -516 l 205 -560 l 141 -603 l 77 -648 l 13 -692 l -50 -737 l -114 -780 l -145 -802 b -171 -813 -157 -810 -163 -813 b -175 -813 -172 -813 -174 -813 b -206 -777 -194 -811 -206 -795 b -202 -760 -206 -771 -205 -766 b -87 -675 -197 -752 -206 -757 l -34 -639 l 83 -557 l 145 -514 l 209 -470 l 272 -427 b 389 -351 375 -356 381 -352 "},v75:{x_min:-149.71875,x_max:148.359375,ha:151,o:"m -137 381 b -130 383 -134 383 -133 383 b -111 371 -122 383 -114 378 b -55 224 -110 370 -85 305 b 0 80 -25 145 -1 80 b 54 224 0 80 24 145 b 112 377 114 384 110 373 b 127 384 118 381 122 384 b 148 362 138 384 148 374 l 148 356 l 83 183 b 16 9 47 88 17 11 b -1 0 12 2 5 0 b -14 5 -5 0 -10 1 b -84 183 -19 9 -13 -6 l -149 356 l -149 362 b -137 381 -149 371 -145 378 "},v78:{x_min:0,x_max:193.28125,ha:197,o:"m 85 514 b 95 517 88 517 89 517 b 114 505 103 517 110 513 l 115 502 l 115 376 b 115 249 115 306 115 249 b 141 258 117 249 127 252 l 167 266 l 172 266 b 190 254 181 265 187 262 l 193 251 l 193 202 l 193 188 b 187 147 193 149 191 152 b 147 130 183 142 182 141 l 115 119 l 115 9 b 115 -99 115 -51 115 -99 b 141 -91 115 -99 127 -95 b 171 -81 166 -81 167 -81 l 171 -81 b 191 -94 181 -81 189 -87 b 193 -142 191 -97 193 -120 b 191 -195 193 -167 191 -194 b 125 -227 187 -205 187 -204 l 115 -230 l 115 -366 l 115 -503 l 114 -506 b 95 -519 110 -514 102 -519 b 74 -506 87 -519 78 -514 l 73 -503 l 73 -374 b 73 -245 73 -260 73 -245 b 73 -245 73 -245 73 -245 b 55 -252 72 -245 63 -249 l 32 -260 b 19 -263 27 -262 23 -263 b 4 -256 13 -263 8 -260 b 0 -215 0 -251 0 -254 b 0 -199 0 -210 0 -206 l 0 -152 l 1 -149 b 8 -140 2 -145 5 -141 b 42 -127 9 -140 24 -133 l 73 -116 l 73 -5 b 73 23 73 4 73 15 b 73 105 73 70 73 105 b 49 97 73 105 61 101 b 17 88 32 91 23 88 b 4 95 10 88 8 91 b 0 137 0 101 0 98 b 0 151 0 141 0 145 l 0 199 l 1 202 b 43 224 5 212 5 212 l 73 234 l 73 367 l 73 502 l 74 505 b 85 514 77 509 81 513 "},v79:{x_min:-1.359375,x_max:899.703125,ha:918,o:"m 307 349 b 332 351 315 351 323 351 b 443 340 367 351 408 347 b 741 47 607 306 720 195 b 744 0 743 31 744 16 b 660 -303 744 -90 713 -206 b 28 -755 534 -531 304 -695 b 14 -756 23 -755 19 -756 b -1 -741 4 -756 -1 -750 b 21 -720 -1 -731 1 -728 b 567 -56 337 -601 548 -344 b 568 -11 568 -41 568 -24 b 442 285 568 129 525 233 b 325 319 406 308 367 319 b 93 177 232 319 137 266 b 84 154 91 170 84 155 b 84 154 84 154 84 154 b 88 156 84 154 85 155 b 159 177 110 170 134 177 b 257 134 194 177 231 162 b 294 41 281 108 294 73 b 171 -97 294 -24 246 -90 b 156 -98 166 -97 161 -98 b 6 74 73 -98 6 -22 b 6 80 6 76 6 79 b 307 349 10 223 141 340 m 839 215 b 845 216 841 216 842 216 b 862 213 852 216 860 215 b 899 163 887 206 899 184 b 872 117 899 145 890 127 b 847 111 865 112 856 111 b 808 130 833 111 818 117 b 796 162 800 140 796 151 b 839 215 796 187 812 212 m 839 -112 b 845 -112 841 -112 842 -112 b 862 -115 852 -112 860 -113 b 899 -165 887 -122 899 -144 b 872 -210 899 -183 890 -201 b 847 -217 865 -215 856 -217 b 808 -198 833 -217 818 -210 b 796 -165 800 -188 796 -177 b 839 -112 796 -140 812 -116 "},v7a:{x_min:-1.359375,x_max:386.5625,ha:394,o:"m 249 535 b 257 537 251 537 253 537 b 276 524 266 537 273 533 l 277 521 l 279 419 l 279 316 l 304 323 b 337 328 319 326 330 328 b 353 316 347 328 349 324 b 355 266 355 315 355 290 b 353 215 355 241 355 217 b 319 198 349 206 347 205 b 279 187 284 190 279 188 b 279 156 279 187 279 174 b 279 136 279 151 279 144 l 279 84 l 289 87 l 330 98 b 367 105 352 102 362 105 b 378 101 372 105 375 104 b 386 61 385 95 386 94 b 386 40 386 55 386 48 l 386 -5 l 385 -8 b 374 -19 383 -12 378 -18 b 291 -40 372 -19 347 -26 b 279 -43 284 -41 279 -43 b 279 -83 279 -43 279 -59 b 279 -95 279 -87 279 -91 l 279 -145 l 304 -140 b 337 -133 321 -136 330 -133 b 349 -140 343 -133 347 -136 b 355 -181 355 -145 355 -142 l 355 -197 l 355 -210 b 349 -252 355 -249 355 -247 b 300 -269 345 -258 347 -258 b 280 -274 291 -272 281 -273 l 279 -274 l 277 -378 l 277 -483 l 276 -487 b 257 -499 273 -495 265 -499 b 238 -487 249 -499 242 -495 l 236 -483 l 236 -384 l 236 -285 l 235 -285 l 212 -291 l 170 -301 b 148 -308 159 -305 148 -306 b 147 -415 147 -308 147 -313 l 147 -523 l 145 -526 b 126 -538 141 -534 133 -538 b 106 -526 118 -538 110 -534 l 104 -523 l 104 -420 b 103 -317 104 -326 104 -317 b 103 -317 103 -317 103 -317 b 50 -330 92 -322 54 -330 b 31 -317 42 -330 35 -326 b 29 -267 29 -315 29 -315 l 29 -219 l 32 -216 b 92 -192 36 -206 36 -206 l 104 -190 l 104 -138 b 103 -87 104 -91 104 -87 b 103 -87 103 -87 103 -87 b 88 -91 103 -87 96 -88 l 49 -101 b 17 -106 32 -105 23 -106 b 6 -102 13 -106 10 -105 b -1 -62 0 -97 -1 -95 b 0 -41 -1 -56 0 -49 l 0 4 l 1 6 b 10 16 2 11 6 15 b 91 37 12 18 38 24 l 104 41 l 104 93 b 103 144 104 140 104 144 b 103 144 103 144 103 144 b 50 131 92 141 54 131 b 31 144 42 131 35 137 b 29 195 29 147 29 148 l 29 242 l 32 245 b 92 269 36 255 36 255 l 104 273 l 104 377 l 104 481 l 106 485 b 126 498 110 492 118 498 b 134 495 129 498 132 496 b 145 485 138 494 142 489 l 147 481 l 147 383 l 147 283 l 152 284 b 190 294 155 285 171 290 l 230 303 l 236 305 l 236 413 l 236 521 l 238 524 b 249 535 240 528 243 533 m 236 126 b 235 177 236 154 236 177 l 235 177 b 213 172 235 177 225 174 l 170 161 b 147 155 157 158 147 155 b 147 124 147 155 147 142 b 147 102 147 117 147 111 l 147 52 l 153 54 l 228 72 l 236 74 l 236 126 m 236 -105 b 235 -54 236 -65 236 -54 l 235 -54 b 231 -55 235 -54 234 -54 b 172 -69 227 -55 204 -62 l 149 -76 l 147 -76 l 147 -127 l 147 -179 l 152 -177 b 190 -167 155 -177 171 -173 l 230 -158 l 236 -156 l 236 -105 "},v7c:{x_min:0,x_max:300.8125,ha:307,o:"m 49 505 b 53 506 50 505 51 506 b 70 496 58 506 62 503 b 81 485 73 492 78 488 l 96 473 l 111 459 l 122 449 l 134 438 l 182 396 l 255 330 b 292 291 292 298 292 298 l 292 290 l 292 284 l 283 270 b 209 36 234 197 209 113 b 288 -170 209 -44 235 -119 b 299 -184 295 -179 299 -181 b 300 -191 300 -187 300 -188 b 285 -206 300 -199 294 -206 b 280 -206 283 -206 281 -206 b 247 -201 270 -202 259 -201 b 176 -222 223 -201 197 -208 b 114 -340 136 -249 114 -292 b 172 -471 114 -384 134 -433 b 185 -492 182 -481 185 -487 b 181 -502 185 -496 183 -499 b 171 -508 176 -505 174 -508 b 152 -498 166 -508 160 -503 b 0 -284 65 -428 12 -352 b 0 -260 0 -278 0 -270 b 1 -238 0 -252 0 -242 b 148 -140 16 -177 73 -140 b 209 -148 167 -140 189 -142 b 215 -149 212 -148 215 -149 b 215 -149 215 -149 215 -149 l 215 -149 b 201 -136 215 -148 209 -142 l 157 -97 l 96 -41 b 17 34 21 24 17 29 b 17 37 17 36 17 36 b 17 38 17 37 17 38 b 25 56 17 44 17 44 b 110 298 81 131 110 219 b 46 474 110 367 88 431 b 38 491 40 480 38 487 b 49 505 38 498 42 502 "},v7d:{x_min:-1.359375,x_max:436.921875,ha:446,o:"m 213 205 b 217 205 215 205 216 205 b 234 194 224 205 234 199 b 236 187 234 194 235 190 l 245 167 l 261 129 l 270 106 b 355 -61 294 54 329 -13 b 420 -163 381 -105 402 -138 b 436 -188 435 -184 436 -184 b 436 -191 436 -190 436 -190 b 421 -206 436 -201 431 -206 l 421 -206 l 416 -206 l 405 -201 b 217 -158 347 -172 283 -158 b 31 -201 153 -158 88 -172 l 20 -206 l 14 -206 l 14 -206 b 0 -191 5 -206 0 -201 b -1 -188 0 -190 -1 -190 b 14 -163 -1 -186 0 -184 b 95 -34 36 -136 72 -77 b 166 106 119 8 148 68 l 175 129 l 183 148 l 200 188 b 213 205 205 199 208 202 "},v7f:{x_min:0,x_max:367.5,ha:375,o:"m 0 124 l 0 187 l 61 187 l 122 187 l 122 138 l 122 91 l 153 61 l 183 30 l 213 61 l 243 91 l 243 138 l 243 187 l 306 187 l 367 187 l 367 124 l 367 61 l 321 61 l 274 61 l 243 30 l 213 0 l 243 -31 l 274 -62 l 321 -62 l 367 -62 l 367 -124 l 367 -188 l 306 -188 l 243 -188 l 243 -140 l 243 -93 l 213 -62 l 183 -31 l 153 -62 l 122 -93 l 122 -140 l 122 -188 l 61 -188 l 0 -188 l 0 -124 l 0 -62 l 46 -62 l 92 -62 l 123 -31 l 153 0 l 123 30 l 92 61 l 46 61 l 0 61 l 0 124 "},v80:{x_min:29.9375,x_max:420.578125,ha:371,o:"m 115 345 b 221 347 117 345 166 347 b 411 345 306 347 409 345 b 420 330 416 342 420 335 b 415 319 420 326 419 321 b 178 118 397 303 179 118 b 178 117 178 118 178 117 b 181 117 178 117 178 117 b 189 117 182 117 185 117 b 193 117 190 117 191 117 b 247 98 215 117 232 111 b 296 75 266 83 280 76 b 302 75 299 75 300 75 b 322 91 311 75 315 79 b 322 91 322 91 322 91 b 322 91 322 91 322 91 b 319 91 322 91 321 91 b 313 90 318 90 315 90 b 283 107 300 90 288 97 b 277 126 279 114 277 121 b 319 167 277 149 295 167 b 319 167 319 167 319 167 b 362 118 347 167 362 147 b 355 82 362 108 359 96 b 311 33 349 65 340 55 b 224 1 284 12 253 1 b 194 5 213 1 204 2 b 168 18 183 8 178 11 b 110 36 151 30 130 36 b 57 15 88 36 68 29 b 47 11 54 12 51 11 b 31 20 40 11 34 13 b 29 26 31 22 29 25 b 68 66 29 36 39 45 b 285 250 73 71 281 248 b 285 250 285 250 285 250 b 231 252 285 252 261 252 b 137 250 190 252 141 250 b 93 227 122 248 110 241 b 78 220 88 222 83 220 b 66 227 74 220 70 222 b 63 234 65 229 63 231 b 85 291 63 241 69 252 b 115 345 108 342 108 344 "},v81:{x_min:0,x_max:428.75,ha:438,o:"m 262 186 b 273 186 266 186 272 186 b 274 186 273 186 274 186 b 285 186 274 186 280 186 b 428 48 375 181 428 122 b 386 -68 428 12 416 -29 b 155 -187 329 -145 236 -187 b 12 -111 92 -187 38 -162 b 0 -51 4 -91 0 -72 b 262 186 0 58 122 179 m 366 131 b 352 134 362 133 357 134 b 219 81 321 134 269 115 b 47 -111 126 23 50 -62 b 47 -112 47 -111 47 -112 b 77 -136 47 -129 58 -136 b 264 -45 118 -136 194 -101 b 382 109 336 12 382 76 b 366 131 382 120 377 129 "},v83:{x_min:-1.359375,x_max:847.96875,ha:865,o:"m 488 1499 b 495 1500 490 1500 492 1500 b 541 1465 507 1500 521 1490 b 679 1078 622 1372 679 1210 b 677 1050 679 1068 677 1060 b 477 642 668 893 604 764 l 443 609 l 431 596 l 431 592 l 438 562 l 449 508 l 460 458 b 481 355 475 390 481 355 b 481 355 481 355 481 355 b 490 356 481 355 485 355 b 528 358 495 356 511 358 b 558 356 540 358 552 356 b 839 95 699 338 808 237 b 847 22 845 72 847 47 b 631 -303 847 -113 766 -242 b 620 -309 623 -308 620 -309 l 620 -310 b 631 -359 620 -310 626 -333 l 646 -435 l 660 -496 b 672 -588 668 -535 672 -563 b 664 -653 672 -610 669 -630 b 383 -875 630 -792 509 -875 b 201 -810 321 -875 257 -855 b 129 -680 151 -768 129 -730 b 274 -530 129 -592 200 -530 b 351 -553 300 -530 326 -538 b 412 -669 393 -582 412 -626 b 287 -805 412 -735 366 -800 l 279 -805 l 285 -809 b 383 -830 318 -823 351 -830 b 586 -718 464 -830 540 -789 b 626 -584 612 -678 626 -631 b 619 -528 626 -566 623 -548 b 612 -495 619 -526 616 -510 b 577 -324 590 -387 577 -324 b 577 -324 577 -324 577 -324 b 568 -326 575 -324 571 -324 b 528 -334 558 -328 537 -333 b 465 -338 506 -337 485 -338 b 24 -11 269 -338 87 -206 b -1 145 8 41 -1 93 b 96 442 -1 249 32 351 b 322 714 166 541 236 626 l 352 745 l 345 782 l 332 843 l 315 921 b 303 984 310 950 304 978 b 295 1082 298 1017 295 1049 b 413 1426 295 1208 336 1329 b 488 1499 436 1456 477 1496 m 549 1301 b 541 1301 547 1301 544 1301 b 411 1207 500 1301 447 1263 b 355 1004 374 1152 355 1079 b 359 942 355 984 356 963 b 371 881 362 927 363 917 l 385 818 b 392 782 389 799 392 784 l 392 782 b 434 828 393 782 424 816 b 607 1165 534 941 594 1060 b 608 1193 608 1175 608 1183 b 597 1270 608 1224 604 1254 b 549 1301 589 1286 571 1299 m 398 528 b 393 555 396 542 393 553 b 392 555 393 555 393 555 b 317 470 390 555 347 505 b 190 298 266 408 212 334 b 127 70 148 227 127 148 b 155 -77 127 19 137 -30 b 468 -303 209 -216 333 -303 b 519 -299 484 -303 502 -302 b 568 -284 541 -295 568 -287 l 568 -284 b 563 -263 568 -284 566 -274 l 534 -120 l 511 -13 l 496 61 l 480 133 b 469 187 472 176 469 187 b 468 188 469 187 469 188 b 416 162 462 188 430 172 b 337 13 364 126 337 69 b 413 -124 337 -40 363 -93 b 428 -144 424 -131 428 -137 b 428 -149 428 -145 428 -148 b 409 -166 426 -161 419 -166 b 394 -162 405 -166 400 -165 b 240 77 302 -122 240 -27 l 240 77 b 430 342 240 197 315 301 l 436 344 l 426 394 l 398 528 m 548 194 b 526 195 540 195 532 195 b 519 195 524 195 521 195 l 514 195 l 518 177 l 539 79 l 552 15 l 566 -48 l 594 -187 l 605 -240 b 612 -266 609 -254 611 -266 b 612 -266 612 -266 612 -266 b 641 -248 613 -266 630 -256 b 744 -98 692 -212 730 -156 b 751 -40 749 -79 751 -59 b 548 194 751 76 665 181 "},v84:{x_min:25.859375,x_max:164.6875,ha:168,o:"m 34 369 b 40 370 35 370 38 370 b 59 353 49 370 50 367 b 164 40 122 254 155 158 b 164 0 164 33 164 16 b 164 -40 164 -16 164 -34 b 59 -353 155 -158 122 -254 b 40 -371 53 -366 47 -371 b 34 -370 38 -371 36 -370 b 25 -358 28 -367 25 -363 b 31 -337 25 -352 27 -347 b 92 0 72 -234 92 -117 b 31 335 92 116 72 233 b 25 356 27 345 25 352 b 34 369 25 363 28 366 "},v86:{x_min:-571.671875,x_max:570.3125,ha:582,o:"m -386 173 b -381 174 -385 174 -383 174 b -370 173 -377 174 -372 173 b -281 86 -367 172 -347 151 b -196 0 -235 37 -196 0 b -126 84 -196 0 -164 37 b -50 174 -55 173 -57 172 b -44 174 -49 174 -47 174 b -35 173 -42 174 -38 173 b 53 86 -32 172 -12 151 b 138 0 100 37 138 0 b 208 84 140 0 170 37 b 284 174 279 173 277 172 b 289 174 285 174 288 174 b 299 173 294 174 298 173 b 462 11 303 172 338 134 l 475 -1 l 503 34 b 541 76 534 72 536 74 b 548 77 544 77 545 77 b 570 56 560 77 570 68 b 567 48 570 54 568 51 b 392 -172 564 41 397 -166 b 378 -176 387 -174 382 -176 b 368 -174 374 -176 371 -176 b 280 -87 367 -173 345 -152 b 194 0 234 -38 194 0 b 125 -86 194 0 163 -38 b 49 -174 54 -174 55 -173 b 43 -176 47 -176 46 -176 b 34 -174 40 -176 36 -174 b -54 -87 31 -173 10 -152 b -140 0 -102 -38 -140 0 b -209 -86 -141 0 -171 -38 b -285 -174 -280 -174 -279 -173 b -291 -176 -287 -176 -289 -176 b -300 -174 -295 -176 -299 -174 b -464 -12 -304 -173 -340 -137 l -476 0 l -504 -34 b -543 -77 -534 -73 -537 -76 b -549 -79 -545 -79 -547 -79 b -571 -58 -562 -79 -571 -69 b -568 -49 -571 -55 -570 -52 b -392 172 -566 -43 -396 167 b -386 173 -390 172 -387 173 "},v8a:{x_min:-170.140625,x_max:168.78125,ha:172,o:"m -160 567 b -122 567 -159 567 -149 567 l -87 567 l -84 566 b -74 553 -78 563 -77 560 b -20 366 -73 551 -49 466 b 31 186 8 267 31 186 b 85 371 31 186 55 269 b 140 559 114 473 138 557 b 153 567 141 564 148 567 b 168 559 159 567 166 564 b 168 555 168 557 168 557 b 92 281 168 548 159 513 b 14 13 50 134 14 13 b 0 0 14 6 6 0 b -17 15 -8 0 -17 8 b -93 283 -17 15 -51 136 b -170 552 -166 533 -170 548 b -170 553 -170 552 -170 552 b -160 567 -170 560 -167 564 "},v8b:{x_min:0,x_max:319.859375,ha:326,o:"m 149 508 b 159 509 152 509 155 509 b 186 494 170 509 181 503 b 190 440 190 487 190 488 l 190 430 l 190 377 l 242 377 l 251 377 b 303 373 298 377 296 377 b 319 345 314 367 319 356 b 304 319 319 335 314 324 b 250 315 296 315 299 315 l 242 315 l 190 315 l 190 262 l 190 252 b 186 198 190 204 190 205 b 159 183 179 188 170 183 b 132 198 148 183 138 188 b 127 252 127 205 127 204 l 127 262 l 127 315 l 76 315 l 68 315 b 14 319 20 315 21 315 b 0 347 4 324 0 335 b 14 373 0 356 4 367 b 68 377 21 377 20 377 l 76 377 l 127 377 l 127 430 l 127 440 b 132 494 127 488 127 487 b 149 508 136 501 142 505 "},v8c:{x_min:-330.75,x_max:329.390625,ha:336,o:"m -133 483 b -117 484 -127 484 -122 484 b 31 373 -51 484 9 440 b 35 348 34 365 35 356 b -25 285 35 313 10 285 b -87 331 -55 285 -76 302 b -167 402 -100 376 -133 402 b -191 398 -175 402 -183 401 b -227 341 -215 388 -227 369 b -225 320 -227 334 -227 327 b -13 74 -209 230 -125 133 b 6 65 -4 70 5 66 l 9 63 l 10 65 b 117 231 12 68 40 112 l 189 341 l 242 424 b 268 460 262 456 264 458 b 283 464 273 463 277 464 b 308 438 296 464 308 453 l 308 437 b 287 396 308 430 308 428 l 95 98 l 59 43 l 58 41 l 65 37 b 253 -156 151 -8 217 -77 b 281 -285 272 -199 281 -244 b 148 -481 281 -381 231 -463 b 115 -485 137 -484 126 -485 b -32 -376 51 -485 -9 -442 b -36 -349 -35 -366 -36 -358 b 25 -287 -36 -315 -12 -287 b 85 -333 54 -287 74 -302 b 166 -403 99 -377 133 -403 b 190 -399 174 -403 182 -402 b 225 -342 215 -390 225 -370 b 224 -322 225 -335 225 -328 b 12 -76 208 -231 125 -134 b -8 -66 2 -72 -6 -68 l -10 -65 l -12 -66 b -118 -231 -13 -68 -42 -113 l -190 -342 l -243 -426 b -269 -462 -264 -458 -265 -458 b -284 -466 -274 -464 -279 -466 b -310 -440 -298 -466 -310 -455 l -310 -438 b -288 -398 -310 -430 -308 -430 l -96 -99 l -59 -44 l -59 -43 l -66 -38 b -281 284 -198 33 -281 158 l -281 284 b -133 483 -281 392 -220 474 m 254 177 b 266 179 258 177 262 179 b 319 149 287 179 307 167 b 329 115 326 140 329 127 b 319 79 329 102 326 90 b 268 51 307 61 287 51 b 221 72 250 51 234 58 b 205 115 210 84 205 99 b 254 177 205 142 223 170 m -281 -54 b -269 -52 -277 -52 -273 -52 b -223 -73 -253 -52 -235 -59 b -206 -116 -212 -84 -206 -101 b -216 -151 -206 -129 -209 -141 b -269 -179 -228 -170 -249 -179 b -314 -159 -285 -179 -302 -173 b -330 -116 -325 -147 -330 -131 b -281 -54 -330 -88 -313 -61 "},v8d:{x_min:-1.359375,x_max:255.890625,ha:261,o:"m 118 514 b 127 517 121 517 122 517 b 147 505 136 517 142 513 l 148 502 l 148 403 b 148 306 148 351 148 306 b 174 315 149 306 160 310 l 200 324 l 205 323 b 223 312 213 323 220 319 l 225 308 l 225 260 b 225 245 225 255 225 249 b 220 204 225 208 224 209 b 179 188 216 199 215 199 l 148 177 l 148 124 l 148 70 l 189 84 b 236 98 219 94 230 98 b 247 94 240 98 243 97 b 255 52 254 88 255 87 b 255 33 255 47 255 40 l 254 -12 l 253 -15 b 249 -22 253 -18 250 -20 l 245 -24 l 196 -41 l 148 -58 l 148 -108 b 148 -158 148 -136 148 -158 b 174 -148 148 -158 160 -154 b 204 -140 198 -140 200 -140 l 204 -140 b 224 -152 213 -140 221 -145 b 225 -201 224 -155 225 -177 b 224 -254 225 -226 224 -251 b 157 -284 220 -262 220 -262 l 148 -288 l 148 -395 l 148 -503 l 147 -506 b 127 -519 142 -514 134 -519 b 107 -506 119 -519 111 -514 l 106 -503 l 106 -403 b 106 -303 106 -316 106 -303 b 104 -303 104 -303 104 -303 b 88 -310 104 -303 96 -306 l 63 -319 b 51 -322 59 -320 55 -322 b 36 -315 46 -322 40 -319 b 31 -273 32 -309 31 -312 b 31 -258 31 -269 31 -263 l 31 -210 l 34 -206 b 40 -198 35 -204 38 -199 b 74 -186 42 -197 57 -191 l 106 -173 l 106 -123 b 106 -97 106 -112 106 -104 b 106 -72 106 -76 106 -72 b 104 -72 106 -72 106 -72 b 20 -99 89 -79 23 -99 b 0 -84 10 -99 2 -93 b -1 -37 0 -81 -1 -59 b 0 11 -1 -15 0 9 b 58 40 4 22 2 22 l 106 56 l 106 109 b 106 123 106 115 106 119 b 106 162 106 147 106 162 b 81 155 106 162 93 159 b 50 147 65 149 55 147 b 36 152 43 147 40 148 b 31 194 32 158 31 156 b 31 209 31 198 31 204 l 31 256 l 34 260 b 76 281 38 269 38 269 l 106 292 l 106 396 l 106 502 l 107 505 b 118 514 110 509 114 513 "},v8f:{x_min:-21.78125,x_max:362.0625,ha:369,o:"m 302 1031 b 308 1032 304 1032 307 1032 b 330 1016 318 1032 325 1027 b 362 867 351 970 362 920 b 340 738 362 824 353 780 l 336 727 l 340 717 b 362 591 355 677 362 634 b 257 323 362 496 325 401 b 204 272 243 306 227 290 b 20 56 129 206 66 133 b -1 18 12 44 0 22 b -19 4 -4 9 -12 4 l -21 4 l -21 140 l -21 276 l -12 277 b 167 333 61 288 127 309 b 319 598 262 388 319 491 b 311 664 319 620 317 642 l 310 673 l 304 664 b 204 548 279 620 250 587 b 20 333 129 483 66 409 b -1 292 12 320 0 298 b -19 280 -4 285 -12 280 l -21 280 l -21 416 l -21 552 l -12 553 b 167 609 61 564 127 585 b 319 874 264 666 319 770 b 294 992 319 914 311 954 b 288 1011 288 1004 288 1007 b 302 1031 288 1021 294 1028 "},v90:{x_min:-171.5,x_max:483.1875,ha:493,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 495 20 616 20 616 b 20 373 20 427 20 373 b 115 410 20 373 63 390 l 210 448 l 210 531 b 212 620 210 614 210 616 b 231 632 215 628 223 632 b 246 627 236 632 242 631 b 251 541 251 620 251 628 l 251 463 l 315 489 b 387 514 368 509 381 514 b 393 513 390 514 392 514 b 406 494 402 510 406 502 b 397 476 406 487 404 480 b 323 446 396 474 363 462 l 251 417 l 251 283 l 251 148 l 254 151 b 370 199 291 183 332 199 b 415 191 385 199 400 197 b 483 84 458 176 483 134 b 461 0 483 58 476 29 b 332 -142 439 -40 411 -72 l 255 -215 b 231 -229 240 -229 239 -229 b 216 -223 224 -229 220 -227 b 210 -158 210 -217 210 -223 b 210 -120 210 -148 210 -136 l 210 -29 l 205 -34 b 100 -142 182 -65 159 -88 l 23 -215 b -1 -229 9 -229 6 -229 b -19 -217 -9 -229 -16 -224 l -20 -215 l -21 48 l -21 310 l -83 287 b -152 262 -133 266 -145 262 b -157 263 -153 262 -155 262 b -171 283 -166 266 -171 274 b -161 301 -171 290 -167 297 b -91 328 -160 302 -129 315 l -21 356 l -21 487 l -20 617 l -19 621 b -8 631 -17 626 -12 630 m 210 288 b 210 401 210 351 210 401 b 114 365 209 401 167 384 l 20 327 l 20 238 l 20 148 l 21 151 b 140 199 59 183 102 199 b 206 180 164 199 187 192 l 209 177 b 209 177 209 177 209 177 b 210 288 210 177 210 199 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 m 341 131 b 328 133 337 133 332 133 b 322 133 326 133 323 133 b 257 87 296 129 273 113 l 251 80 l 251 -37 l 251 -156 l 255 -152 b 375 81 328 -72 375 20 l 375 83 b 341 131 375 113 367 126 "},v92:{x_min:0,x_max:598.890625,ha:611,o:"m 62 181 b 77 183 66 183 72 183 b 91 181 83 183 88 183 b 202 131 100 180 106 177 l 299 87 l 394 131 b 517 183 499 181 502 183 b 519 183 517 183 518 183 b 598 104 567 183 598 144 b 577 49 598 84 592 65 b 518 15 567 38 563 37 b 484 0 499 6 484 0 b 518 -16 484 -1 499 -8 b 577 -51 563 -38 567 -40 b 598 -105 592 -66 598 -86 b 519 -184 598 -145 567 -184 b 517 -184 518 -184 517 -184 b 394 -133 502 -184 499 -183 l 299 -88 l 202 -133 b 81 -184 99 -183 95 -184 b 77 -184 80 -184 78 -184 b 0 -105 29 -184 0 -145 b 20 -51 0 -86 5 -66 b 80 -16 29 -40 34 -38 b 114 -1 98 -8 114 -1 b 80 15 114 0 98 6 b 20 49 34 37 29 38 b 0 104 6 65 0 84 b 62 181 0 140 23 174 m 88 134 b 74 136 85 134 80 136 b 68 134 72 136 69 136 b 46 104 54 130 46 117 b 55 81 46 95 49 88 b 149 34 59 76 53 80 b 224 -1 190 15 224 0 b 144 -38 224 -1 187 -18 b 54 -84 59 -79 58 -79 b 46 -105 49 -90 46 -98 b 76 -137 46 -122 58 -137 b 78 -137 77 -137 77 -137 b 194 -86 87 -137 76 -141 b 298 -36 250 -58 298 -36 b 298 -36 298 -36 298 -36 b 402 -84 299 -36 345 -58 b 518 -137 522 -141 510 -137 b 521 -137 519 -137 519 -137 b 551 -105 539 -137 551 -122 b 541 -83 551 -98 548 -90 b 447 -36 537 -77 544 -81 b 374 -1 406 -16 374 -1 b 447 34 374 0 406 15 b 541 81 544 80 537 76 b 551 104 548 88 551 97 b 521 136 551 120 539 136 b 518 136 519 136 519 136 b 517 136 518 136 517 136 l 517 136 b 402 83 511 136 511 136 b 298 34 345 56 299 34 b 298 34 298 34 298 34 b 194 84 298 34 250 56 b 88 134 137 111 89 133 "},v93:{x_min:0,x_max:438.28125,ha:447,o:"m 212 205 b 219 205 213 205 216 205 b 239 183 228 205 231 204 b 421 -163 298 40 363 -83 b 438 -191 434 -180 438 -186 b 436 -197 438 -192 438 -195 b 424 -206 434 -204 431 -206 b 406 -201 420 -206 415 -205 b 216 -156 347 -172 281 -156 b 23 -205 148 -156 80 -173 b 14 -206 20 -206 17 -206 b 0 -191 6 -206 0 -201 b 6 -176 0 -187 1 -183 b 202 192 63 -104 142 45 b 212 205 205 199 208 202 m 264 48 l 249 81 l 243 94 l 242 91 b 89 -126 208 36 137 -66 b 81 -138 85 -133 81 -138 b 81 -138 81 -138 81 -138 b 81 -138 81 -138 81 -138 b 95 -133 81 -138 87 -136 b 280 -94 156 -108 221 -94 b 334 -98 299 -94 317 -95 b 343 -99 338 -99 343 -99 b 343 -99 343 -99 343 -99 b 338 -94 343 -99 341 -97 b 264 48 318 -58 287 1 "},v94:{x_min:-149.71875,x_max:148.359375,ha:151,o:"m -9 215 b 0 217 -6 217 -4 217 b 19 205 8 217 14 213 b 20 142 20 202 20 201 l 20 84 l 23 84 b 144 -27 81 74 129 30 b 148 -66 147 -40 148 -54 b 36 -213 148 -134 103 -197 b 0 -219 24 -217 12 -219 b -145 -104 -68 -219 -129 -173 b -149 -68 -148 -91 -149 -79 b -24 84 -149 6 -98 74 l -21 84 l -21 142 b -19 205 -20 201 -20 202 b -9 215 -17 209 -13 213 m -21 -15 b -23 41 -21 37 -21 41 b -23 41 -23 41 -23 41 b -76 11 -35 40 -62 26 b -108 -65 -98 -11 -108 -38 b -1 -176 -108 -122 -65 -176 b 107 -65 63 -176 107 -122 b 74 11 107 -38 96 -11 b 20 41 61 26 32 41 b 20 -15 20 41 20 15 b 19 -74 20 -72 20 -72 b 0 -87 14 -83 6 -87 b -19 -74 -8 -87 -16 -83 b -21 -15 -20 -72 -20 -72 "},v95:{x_min:0,x_max:406.96875,ha:415,o:"m 55 181 b 70 183 61 183 66 183 b 111 170 85 183 99 179 b 160 130 115 167 137 149 l 202 95 l 245 130 b 319 181 299 176 302 179 b 334 183 325 183 330 183 b 406 109 375 183 406 148 b 401 81 406 99 405 91 b 348 24 394 65 390 59 b 318 -1 332 11 318 0 b 348 -26 318 -1 332 -12 b 401 -83 390 -61 394 -66 b 406 -111 405 -93 406 -101 b 334 -184 406 -149 375 -184 b 319 -183 330 -184 325 -184 b 245 -131 302 -180 299 -177 l 202 -97 l 160 -131 b 85 -183 107 -177 103 -180 b 70 -184 80 -184 76 -184 b 0 -111 31 -184 0 -149 b 4 -83 0 -101 1 -93 b 58 -26 10 -66 16 -61 b 88 -1 74 -12 88 -1 b 58 24 88 0 74 11 b 10 69 23 54 17 59 b 0 109 2 81 0 95 b 55 181 0 142 21 173 m 83 133 b 72 136 78 136 76 136 b 57 131 66 136 61 134 b 46 109 49 126 46 117 b 50 93 46 104 47 98 b 107 45 51 91 77 70 b 160 0 137 20 160 0 b 107 -47 160 -1 137 -22 b 50 -94 77 -72 51 -93 b 46 -111 47 -99 46 -105 b 59 -134 46 -120 50 -130 b 72 -137 62 -136 68 -137 b 83 -136 76 -137 80 -136 b 144 -84 84 -134 107 -116 b 202 -36 176 -58 202 -36 b 261 -84 202 -36 230 -58 b 323 -136 299 -116 321 -134 b 334 -137 326 -136 330 -137 b 345 -134 338 -137 343 -136 b 360 -111 355 -130 360 -120 b 355 -94 360 -105 359 -99 b 299 -47 353 -93 329 -72 b 245 0 269 -22 245 -1 b 299 45 245 0 269 20 b 355 93 329 70 353 91 b 360 109 359 98 360 104 b 345 133 360 119 355 129 b 334 136 343 134 338 136 b 323 134 330 136 326 134 b 261 83 321 133 299 115 b 202 34 230 56 202 34 b 144 83 202 34 176 56 b 83 133 106 115 84 133 "},v97:{x_min:-228.671875,x_max:227.3125,ha:232,o:"m -217 487 l -213 488 l 0 488 l 212 488 l 216 487 b 225 476 220 484 224 480 l 227 473 l 227 244 l 227 15 l 225 12 b 206 0 223 4 215 0 b 197 1 204 0 200 0 b 187 12 193 4 189 6 l 186 15 l 186 138 l 186 262 l -1 262 l -187 262 l -187 138 l -187 15 l -189 12 b -208 0 -193 4 -200 0 b -227 12 -216 0 -223 4 l -228 15 l -228 244 l -228 473 l -227 476 b -217 487 -225 480 -221 484 "},v9a:{x_min:-21.78125,x_max:367.5,ha:375,o:"m 230 1031 b 238 1032 232 1032 235 1032 b 259 1014 245 1032 251 1027 b 367 662 330 906 367 782 b 364 602 367 641 367 621 b 232 317 352 488 304 384 b 57 120 155 245 103 187 b -1 18 31 84 6 40 b -19 4 -4 11 -12 4 l -21 4 l -21 159 l -21 315 l -16 315 b 96 335 10 315 62 324 b 315 695 227 380 315 527 b 313 738 315 709 314 724 b 224 991 304 825 273 916 b 216 1013 219 999 216 1007 b 230 1031 216 1021 220 1028 "},v9b:{x_min:-24.5,x_max:313.0625,ha:319,o:"m -24 -133 l -24 -5 l -20 -5 b -1 -19 -12 -5 -4 -11 b 142 -213 13 -61 74 -144 b 258 -376 196 -269 230 -315 b 313 -605 295 -449 313 -528 b 292 -742 313 -652 306 -699 b 288 -752 289 -748 288 -752 b 288 -752 288 -752 288 -752 b 292 -764 289 -753 291 -757 b 313 -907 306 -811 313 -860 b 292 -1045 313 -954 306 -1002 b 288 -1054 289 -1050 288 -1054 b 288 -1054 288 -1054 288 -1054 b 292 -1067 289 -1054 291 -1060 b 313 -1210 306 -1113 313 -1161 b 292 -1346 313 -1257 306 -1304 b 288 -1357 289 -1353 288 -1357 b 288 -1357 288 -1357 288 -1357 b 292 -1368 289 -1357 291 -1363 b 313 -1512 306 -1415 313 -1464 b 292 -1648 313 -1560 306 -1605 b 288 -1660 289 -1654 288 -1660 b 288 -1660 288 -1660 288 -1660 b 292 -1671 289 -1660 291 -1665 b 313 -1814 306 -1719 313 -1766 b 250 -2040 313 -1897 291 -1977 b 232 -2062 238 -2057 236 -2059 b 221 -2065 230 -2063 225 -2065 b 200 -2045 210 -2065 201 -2057 b 200 -2043 200 -2044 200 -2044 b 208 -2026 200 -2037 202 -2034 b 269 -1826 249 -1966 269 -1897 b 153 -1544 269 -1726 230 -1625 b -9 -1472 115 -1506 58 -1481 b -21 -1471 -14 -1471 -19 -1471 l -24 -1471 l -24 -1343 l -24 -1215 l -20 -1215 b -1 -1229 -12 -1215 -4 -1221 b 142 -1424 13 -1270 74 -1353 b 257 -1582 196 -1478 228 -1524 b 264 -1594 261 -1589 264 -1594 l 264 -1594 b 265 -1582 264 -1594 264 -1589 b 270 -1525 268 -1562 270 -1544 b 153 -1243 270 -1424 228 -1321 b -9 -1170 115 -1203 58 -1178 b -21 -1168 -14 -1170 -19 -1168 l -24 -1168 l -24 -1041 l -24 -913 l -20 -913 b -1 -927 -12 -913 -4 -918 b 142 -1121 13 -967 74 -1050 b 257 -1281 196 -1175 228 -1221 b 264 -1292 261 -1286 264 -1292 l 264 -1292 b 265 -1279 264 -1292 264 -1286 b 270 -1222 268 -1261 270 -1242 b 153 -941 270 -1121 228 -1018 b -9 -867 115 -900 58 -875 b -21 -866 -14 -867 -19 -866 l -24 -866 l -24 -738 l -24 -610 l -20 -610 b -1 -624 -12 -610 -4 -616 b 142 -818 13 -664 74 -749 b 257 -978 196 -873 228 -918 b 264 -989 261 -984 264 -989 l 264 -989 b 265 -977 264 -989 264 -984 b 270 -920 268 -959 270 -939 b 153 -638 270 -818 228 -716 b -9 -564 115 -598 58 -573 b -21 -563 -14 -564 -19 -563 l -24 -563 l -24 -435 l -24 -308 l -20 -308 b -1 -322 -12 -308 -4 -313 b 142 -516 13 -363 74 -446 b 257 -675 196 -571 228 -616 b 264 -687 261 -681 264 -687 l 264 -687 b 265 -674 264 -687 264 -681 b 270 -617 268 -656 270 -637 b 153 -335 270 -516 228 -413 b -9 -262 115 -295 58 -270 b -21 -260 -14 -262 -19 -260 l -24 -260 l -24 -133 "},v9c:{x_min:-166.0625,x_max:-25.859375,ha:0,o:"m -49 369 b -42 370 -46 369 -44 370 b -27 360 -36 370 -29 366 b -25 355 -27 359 -25 358 b -32 335 -25 351 -28 347 b -92 52 -66 248 -87 159 b -93 -1 -93 43 -93 20 b -92 -54 -93 -23 -93 -45 b -32 -337 -85 -162 -66 -251 b -25 -355 -27 -349 -25 -352 b -42 -371 -25 -365 -32 -371 b -61 -353 -50 -371 -51 -369 b -163 -63 -119 -262 -153 -165 b -166 -1 -166 -37 -166 -31 b -163 62 -166 30 -166 36 b -61 352 -153 163 -119 260 b -49 369 -54 365 -51 366 "},v9e:{x_min:0,x_max:607.0625,ha:619,o:"m 243 631 b 250 632 246 632 249 632 b 270 620 259 632 268 628 l 272 616 l 272 201 l 272 -212 l 270 -216 b 251 -229 268 -224 259 -229 b 227 -215 243 -229 240 -229 l 151 -142 b 32 -16 81 -80 53 -49 b 0 84 9 18 0 52 b 111 199 0 149 42 199 b 137 197 119 199 127 198 b 228 151 168 191 197 177 l 231 148 l 231 383 b 232 620 231 616 231 616 b 243 631 234 624 238 630 m 168 131 b 152 133 163 133 157 133 b 107 102 130 133 111 120 b 106 86 107 97 106 91 b 111 41 106 73 108 56 b 227 -152 125 -13 171 -90 l 231 -156 l 231 -37 l 231 80 l 225 87 b 168 131 210 111 190 126 m 347 631 b 353 632 348 632 351 632 b 374 620 363 632 371 628 b 375 383 375 616 375 616 l 375 148 l 377 151 b 492 199 415 183 454 199 b 537 191 507 199 522 197 b 607 84 582 176 607 134 b 583 0 607 58 598 29 b 455 -142 562 -40 533 -72 l 378 -215 b 355 -229 364 -229 362 -229 b 334 -216 345 -229 337 -224 l 333 -212 l 333 201 l 333 616 l 334 620 b 347 631 337 624 341 630 m 465 131 b 451 133 461 133 455 133 b 445 133 449 133 446 133 b 379 87 419 129 396 113 l 375 80 l 375 -37 l 375 -156 l 378 -152 b 499 81 451 -72 499 20 l 499 83 b 465 131 499 113 490 126 "},va3:{x_min:58.53125,x_max:228.671875,ha:294,o:"m 138 371 b 142 373 140 371 141 373 b 178 342 149 373 156 366 b 228 251 217 297 228 278 b 228 244 228 248 228 247 b 176 147 227 212 212 184 b 123 73 152 122 132 93 b 121 62 122 70 121 66 b 145 13 121 48 129 31 b 153 -2 151 6 153 1 b 149 -9 153 -5 152 -6 b 144 -11 148 -11 145 -11 b 129 -1 140 -11 136 -8 b 61 87 89 37 68 68 b 58 113 59 95 58 105 b 110 215 58 144 74 177 b 163 287 134 240 155 269 b 166 299 166 291 166 295 b 141 348 166 313 157 330 b 133 360 134 356 133 358 b 133 363 133 362 133 362 b 138 371 133 367 136 370 "},va5:{x_min:0,x_max:349.8125,ha:357,o:"m 88 302 b 103 303 93 302 98 303 b 202 224 149 303 191 270 b 205 199 204 216 205 208 b 178 129 205 173 196 147 l 175 126 l 182 127 b 307 249 236 142 284 190 b 313 259 308 254 311 258 b 329 267 317 265 323 267 b 349 247 340 267 349 259 b 201 -263 349 242 204 -258 b 182 -273 197 -270 190 -273 b 163 -260 174 -273 166 -269 b 161 -256 161 -259 161 -258 b 217 -59 161 -248 170 -220 b 272 129 247 43 272 127 b 272 129 272 129 272 129 b 264 122 272 129 268 126 b 140 80 227 94 183 80 b 36 115 102 80 65 91 b 0 194 10 136 0 165 b 88 302 0 244 32 292 "},va9:{x_min:-24.5,x_max:314.421875,ha:321,o:"m -24 -145 l -24 -5 l -20 -5 b 0 -23 -9 -5 -2 -12 b 27 -87 4 -38 14 -66 b 138 -220 53 -136 88 -177 b 235 -328 179 -255 208 -288 b 314 -592 287 -409 314 -501 b 292 -732 314 -639 307 -687 l 289 -742 l 294 -756 b 314 -896 307 -802 314 -849 b 292 -1035 314 -943 307 -991 l 289 -1045 l 294 -1057 b 314 -1197 307 -1104 314 -1152 b 292 -1338 314 -1246 307 -1292 l 289 -1347 l 294 -1360 b 314 -1500 307 -1407 314 -1454 b 273 -1689 314 -1565 300 -1628 b 250 -1712 265 -1710 261 -1712 b 228 -1691 236 -1712 228 -1704 l 228 -1685 l 234 -1675 b 270 -1507 258 -1621 270 -1564 b 98 -1193 270 -1381 209 -1261 b 40 -1174 76 -1179 58 -1174 b -10 -1189 24 -1174 8 -1178 b -20 -1192 -14 -1192 -16 -1192 l -24 -1192 l -24 -1052 l -24 -913 l -20 -913 b 0 -931 -9 -913 -2 -920 b 27 -995 4 -946 14 -974 b 138 -1128 53 -1043 88 -1085 b 257 -1275 190 -1172 228 -1220 b 262 -1283 259 -1279 262 -1283 l 262 -1283 b 269 -1249 264 -1282 268 -1260 b 270 -1206 270 -1233 270 -1220 b 98 -891 270 -1075 206 -957 b 40 -871 76 -877 58 -871 b -10 -886 24 -871 8 -875 b -20 -889 -14 -889 -16 -889 l -24 -889 l -24 -749 l -24 -610 l -20 -610 b 0 -628 -9 -610 -2 -617 b 27 -692 4 -644 14 -671 b 138 -825 53 -741 88 -782 b 257 -973 190 -870 228 -917 b 262 -981 259 -977 262 -981 l 262 -981 b 269 -946 264 -979 268 -957 b 270 -903 270 -931 270 -917 b 98 -588 270 -774 206 -655 b 40 -569 76 -574 58 -569 b -10 -584 24 -569 8 -574 b -20 -587 -14 -587 -16 -587 l -24 -587 l -24 -448 l -24 -308 l -20 -308 b 0 -326 -9 -308 -2 -315 b 27 -390 4 -341 14 -369 b 138 -523 53 -438 88 -480 b 257 -670 190 -567 228 -614 b 262 -678 259 -674 262 -678 b 262 -678 262 -678 262 -678 b 269 -644 264 -677 268 -656 b 270 -601 270 -628 270 -614 b 98 -285 270 -471 206 -352 b 40 -266 76 -273 58 -266 b -10 -281 24 -266 8 -272 b -20 -284 -14 -284 -16 -284 l -24 -284 l -24 -145 "},vaa:{x_min:-1.359375,x_max:752.703125,ha:768,o:"m 490 985 b 504 986 495 986 500 986 b 604 907 551 986 593 954 b 607 884 607 900 607 892 b 581 813 607 857 597 831 l 578 810 l 583 811 b 710 932 638 827 687 873 b 714 943 711 936 713 942 b 730 952 720 949 725 952 b 752 931 741 952 752 943 b 200 -946 752 927 204 -941 b 182 -957 197 -953 190 -957 b 163 -945 174 -957 166 -953 b 161 -939 161 -942 161 -942 b 217 -743 161 -931 170 -904 b 272 -555 247 -639 272 -555 b 272 -555 272 -555 272 -555 b 264 -560 272 -555 268 -557 b 140 -603 227 -589 182 -603 b 36 -567 102 -603 65 -592 b -1 -487 12 -548 -1 -517 b 17 -427 -1 -466 5 -445 b 103 -380 38 -395 70 -380 b 191 -433 137 -380 172 -398 b 205 -484 201 -448 205 -466 b 178 -553 205 -509 196 -535 l 175 -557 l 182 -555 b 307 -435 236 -539 284 -494 b 372 -213 308 -430 372 -215 b 372 -213 372 -213 372 -213 b 364 -219 372 -213 368 -216 b 240 -262 328 -247 283 -262 b 137 -226 202 -262 166 -249 b 99 -145 112 -206 99 -176 b 118 -84 99 -124 106 -104 b 204 -38 138 -54 171 -38 b 292 -91 238 -38 273 -56 b 306 -141 302 -106 306 -124 b 279 -212 306 -167 296 -194 l 276 -215 l 281 -213 b 408 -93 336 -198 385 -151 b 473 129 409 -88 473 127 b 473 129 473 129 473 129 b 465 122 473 129 469 126 b 341 80 428 94 383 80 b 236 115 303 80 266 91 b 200 195 213 136 200 165 b 217 256 200 217 206 238 b 304 303 239 287 272 303 b 393 249 338 303 374 285 b 406 199 402 234 406 217 b 379 129 406 173 397 148 l 377 126 l 382 127 b 509 248 436 142 485 190 b 574 470 510 254 574 469 b 574 470 574 470 574 470 b 566 464 574 470 570 467 b 442 421 529 435 484 421 b 337 458 404 421 367 433 b 300 538 314 477 300 508 b 318 598 300 559 306 580 b 404 645 340 630 372 645 b 494 592 439 645 475 627 b 507 541 502 577 507 559 b 480 471 507 516 498 489 l 477 467 l 483 470 b 608 589 537 485 586 531 b 675 811 611 595 675 810 b 675 811 675 811 675 811 b 666 806 675 811 671 809 b 543 763 628 777 585 763 b 438 799 504 763 468 775 b 401 878 412 820 401 849 b 490 985 401 928 434 977 "},vab:{x_min:0,x_max:272.21875,ha:278,o:"m 243 631 b 250 632 246 632 249 632 b 270 620 259 632 268 628 l 272 616 l 272 201 l 272 -212 l 270 -216 b 251 -229 268 -224 259 -229 b 227 -215 243 -229 240 -229 l 151 -142 b 32 -16 81 -80 53 -49 b 0 84 9 18 0 52 b 111 199 0 149 42 199 b 137 197 119 199 127 198 b 228 151 168 191 197 177 l 231 148 l 231 383 b 232 620 231 616 231 616 b 243 631 234 624 238 630 m 168 131 b 152 133 163 133 157 133 b 107 102 130 133 111 120 b 106 86 107 97 106 91 b 111 41 106 73 108 56 b 227 -152 125 -13 171 -90 l 231 -156 l 231 -37 l 231 80 l 225 87 b 168 131 210 111 190 126 "},vad:{x_min:0,x_max:873.828125,ha:892,o:"m 0 0 l 0 703 l 81 703 l 164 703 l 164 0 l 164 -705 l 81 -705 l 0 -705 l 0 0 m 225 0 l 225 703 l 246 703 l 268 703 l 268 366 l 268 30 l 274 36 b 314 79 284 44 302 63 b 413 302 357 137 392 213 b 432 327 419 324 421 327 b 449 306 443 327 447 322 b 611 115 457 195 529 115 b 651 122 624 115 638 117 b 728 316 705 140 724 188 b 729 388 728 342 729 366 b 671 635 729 533 711 602 b 581 662 649 652 616 662 b 477 637 545 662 510 653 l 475 635 l 477 634 b 503 627 488 632 495 631 b 545 556 532 612 545 584 b 491 480 545 524 526 491 b 465 474 481 476 473 474 b 379 563 417 474 379 516 b 389 602 379 576 382 588 b 541 691 409 641 479 681 b 582 694 555 692 568 694 b 865 462 714 694 834 598 b 873 392 871 440 873 416 b 865 317 873 367 871 341 b 639 84 839 194 748 101 b 612 83 630 83 620 83 b 511 116 577 83 543 94 b 504 120 509 119 506 120 b 504 120 504 120 504 120 b 469 59 504 120 488 93 l 432 -1 l 469 -61 b 504 -122 488 -94 504 -122 b 504 -122 504 -122 504 -122 b 511 -117 506 -122 509 -120 b 612 -84 543 -95 577 -84 b 665 -91 630 -84 647 -87 b 869 -338 771 -122 850 -216 b 873 -392 872 -356 873 -374 b 798 -595 873 -469 847 -539 b 581 -695 741 -662 660 -695 b 406 -626 517 -695 454 -671 b 381 -563 389 -607 381 -585 b 465 -477 381 -519 413 -477 b 545 -559 514 -477 545 -519 b 503 -628 545 -587 532 -613 b 477 -635 495 -632 488 -634 l 475 -637 l 477 -638 b 581 -663 510 -655 545 -663 b 671 -637 616 -663 649 -653 b 729 -391 711 -603 729 -534 b 728 -317 729 -367 728 -344 b 623 -117 722 -173 698 -124 b 611 -116 619 -116 615 -116 b 449 -308 528 -116 457 -198 b 432 -328 447 -323 443 -328 b 413 -303 421 -328 419 -326 b 314 -80 392 -215 357 -138 b 274 -37 302 -65 284 -45 l 268 -31 l 268 -367 l 268 -705 l 246 -705 l 225 -705 l 225 0 "},vb1:{x_min:78.9375,x_max:485.921875,ha:417,o:"m 362 378 b 378 380 367 380 372 380 b 472 348 415 380 453 367 b 485 315 481 338 485 327 b 462 273 485 298 477 281 b 439 267 454 269 446 267 b 398 290 424 267 409 274 b 344 319 385 309 364 319 b 281 269 315 319 289 301 b 279 262 280 266 279 262 b 276 256 279 260 277 258 b 274 249 276 254 274 251 b 238 127 273 248 257 192 b 201 4 217 61 201 5 b 166 -1 198 -1 200 -1 b 153 -1 163 -1 157 -1 b 141 -1 148 -1 144 -1 b 104 4 106 -1 107 -1 b 104 6 104 5 104 5 b 142 144 104 13 110 34 b 182 278 164 219 181 276 b 183 288 182 281 182 285 b 185 302 185 292 185 298 b 164 330 185 317 176 328 b 159 330 163 330 161 330 b 102 302 140 330 119 320 b 91 294 95 295 93 294 b 88 294 91 294 89 294 b 78 303 83 294 78 298 b 81 312 78 306 78 309 b 200 373 106 347 160 373 b 215 371 205 373 209 371 b 266 335 235 367 254 353 b 269 331 268 333 269 331 b 269 331 269 331 269 331 b 273 335 269 331 270 334 b 362 378 298 359 330 376 "},vb3:{x_min:0,x_max:227.3125,ha:232,o:"m 91 213 b 100 215 93 215 96 215 b 227 58 167 215 224 144 b 227 52 227 56 227 54 b 61 -201 227 -43 164 -138 b 29 -216 44 -212 36 -216 b 23 -210 27 -216 24 -213 b 21 -205 21 -208 21 -206 b 34 -192 21 -201 25 -197 b 122 -55 89 -161 122 -106 b 104 6 122 -33 117 -12 l 103 9 l 96 9 b 4 79 57 9 17 38 b 0 112 1 90 0 101 b 91 213 0 163 36 209 "},vb4:{x_min:-597.53125,x_max:596.171875,ha:608,o:"m -533 324 b -525 327 -530 326 -528 327 b -504 305 -514 327 -504 317 b -504 305 -504 305 -504 305 b -513 284 -504 299 -504 299 b -556 112 -541 226 -556 167 b -545 33 -556 84 -552 58 b -524 -20 -541 15 -532 -9 l -522 -23 l -491 15 l -413 111 b -355 174 -367 169 -363 174 b -351 174 -353 174 -352 174 b -254 86 -343 174 -348 179 b -168 -1 -208 37 -168 -1 b -100 84 -168 -1 -137 37 b -23 173 -28 173 -29 172 b -19 174 -21 174 -20 174 b -8 173 -14 174 -10 173 b 80 86 -5 172 13 151 b 166 -1 127 37 166 -1 b 235 84 166 -1 197 37 b 311 173 306 173 304 172 b 317 174 313 174 314 174 b 326 173 319 174 323 173 b 490 11 329 172 366 134 l 502 -1 l 530 34 b 568 76 560 72 563 74 b 575 77 570 77 573 77 b 596 56 586 77 596 68 b 594 48 596 54 596 51 b 417 -172 592 41 424 -166 b 405 -176 415 -174 409 -176 b 396 -174 401 -176 398 -176 b 307 -87 393 -173 372 -152 b 221 -1 259 -38 221 -1 b 152 -86 221 -1 190 -38 b 76 -176 81 -174 83 -173 b 70 -176 74 -176 73 -176 b 61 -174 66 -176 62 -174 b -27 -87 58 -173 38 -152 b -114 -1 -74 -38 -112 -1 b -182 -86 -114 -1 -145 -38 b -258 -176 -253 -174 -253 -173 b -264 -176 -259 -176 -262 -176 b -274 -174 -268 -176 -272 -174 b -438 -11 -277 -173 -348 -102 l -449 0 l -479 -37 b -524 -80 -513 -80 -514 -80 l -524 -80 b -553 -52 -534 -80 -540 -74 b -597 109 -583 -8 -597 48 b -560 280 -597 165 -585 224 b -533 324 -548 310 -540 322 "},vb6:{x_min:0,x_max:556.6875,ha:568,o:"m 289 545 b 298 546 292 545 295 546 b 318 533 306 546 315 541 b 319 428 319 530 319 528 l 319 327 l 334 327 b 526 223 412 326 485 285 b 543 172 537 206 543 190 b 447 76 543 122 503 76 b 445 76 446 76 446 76 b 359 165 394 77 359 119 b 368 205 359 179 362 192 b 441 251 382 233 412 251 b 455 249 446 251 451 251 b 460 248 458 249 460 248 b 460 248 460 248 460 248 b 454 254 460 249 458 251 b 334 295 419 280 378 294 l 319 295 l 319 4 l 319 -287 l 321 -285 b 328 -285 322 -285 325 -285 b 524 -99 424 -277 507 -198 b 541 -79 526 -84 530 -79 b 556 -97 551 -79 556 -84 b 548 -133 556 -105 553 -117 b 334 -317 521 -233 434 -306 b 322 -319 329 -317 323 -317 l 319 -319 l 319 -424 b 319 -471 319 -444 319 -459 b 313 -541 319 -544 318 -535 b 298 -548 308 -545 303 -548 b 279 -534 289 -548 281 -542 b 277 -424 277 -531 277 -530 l 277 -317 l 273 -317 b 13 -95 153 -305 51 -217 b 0 2 4 -62 0 -29 b 182 295 0 126 66 238 b 274 324 210 309 249 320 l 277 324 l 277 427 b 279 533 277 528 277 530 b 289 545 281 538 285 542 m 277 2 b 277 291 277 161 277 291 b 268 288 277 291 273 290 b 144 1 179 265 144 184 b 276 -284 144 -199 175 -267 l 277 -285 l 277 2 "},vb7:{x_min:-176.9375,x_max:251.8125,ha:257,o:"m -8 631 b -1 632 -6 632 -4 632 b 19 620 8 632 16 628 b 20 503 20 616 20 614 b 20 391 20 442 20 391 b 84 424 20 391 49 406 l 147 456 l 152 456 b 153 456 153 456 153 456 b 175 435 166 456 175 446 b 172 427 175 433 174 430 b 92 380 170 420 172 421 l 20 342 l 20 245 l 20 148 l 21 151 b 137 199 59 183 99 199 b 182 191 152 199 167 197 b 251 84 227 176 251 134 b 228 0 251 58 243 29 b 100 -142 206 -40 178 -72 l 23 -215 b 0 -229 9 -229 6 -229 b -20 -216 -9 -229 -17 -224 b -21 54 -21 -212 -21 -212 b -21 322 -21 201 -21 322 b -85 290 -21 322 -50 308 l -148 256 l -153 256 b -155 256 -155 256 -155 256 b -176 277 -167 256 -176 266 b -174 285 -176 280 -175 283 b -93 333 -171 294 -174 292 l -21 370 l -21 494 b -20 620 -21 616 -21 616 b -8 631 -17 624 -13 630 m 110 131 b 96 133 106 133 100 133 b 89 133 93 133 91 133 b 24 87 63 129 40 113 l 20 80 l 20 -37 l 20 -156 l 23 -152 b 144 81 96 -72 144 20 l 144 83 b 110 131 144 113 134 126 "},vb9:{x_min:-122.5,x_max:121.140625,ha:124,o:"m -16 145 b 0 147 -10 147 -5 147 b 121 -1 66 147 121 77 b 114 -49 121 -16 118 -33 b -1 -148 95 -112 47 -148 b -85 -106 -31 -148 -61 -134 b -122 -1 -110 -76 -122 -38 b -16 145 -122 68 -81 134 m 12 111 b 0 113 8 113 4 113 b -68 22 -29 113 -61 73 b -70 0 -69 15 -70 6 b -13 -113 -70 -49 -47 -98 b -1 -115 -9 -115 -5 -115 b 63 -40 24 -115 53 -83 b 68 -1 66 -27 68 -15 b 12 111 68 48 46 97 "},vba:{x_min:-118.421875,x_max:597.53125,ha:381,o:"m 460 574 b 464 574 461 574 462 574 b 488 574 470 574 481 574 b 500 573 491 574 498 574 b 594 503 543 570 588 538 b 597 488 596 498 597 494 b 528 417 597 449 564 417 b 502 423 519 417 510 419 b 465 481 477 434 465 458 b 488 528 465 499 472 516 b 490 530 490 530 490 530 b 490 530 490 530 490 530 b 468 517 488 530 475 523 b 349 340 419 485 377 420 b 347 330 348 334 347 330 b 383 328 347 328 363 328 b 428 326 423 328 424 328 b 442 302 438 320 442 312 b 430 281 442 294 438 285 b 385 276 424 277 426 276 l 377 276 l 332 276 l 330 269 b 178 -117 303 126 250 -9 b 1 -249 129 -194 69 -237 b -20 -251 -6 -251 -13 -251 b -114 -187 -65 -251 -100 -227 b -118 -156 -117 -177 -118 -166 b -51 -84 -118 -116 -91 -84 b -31 -87 -46 -84 -39 -86 b 16 -152 0 -95 16 -124 b -12 -205 16 -173 8 -194 b -16 -208 -14 -206 -16 -208 b -14 -208 -16 -208 -14 -208 b -9 -206 -14 -208 -12 -208 b 74 -124 23 -197 54 -166 b 172 224 98 -79 125 22 b 185 276 178 252 183 274 b 185 276 185 276 185 276 b 141 276 185 276 181 276 b 91 280 96 276 96 276 b 77 302 83 285 77 294 b 91 326 77 312 83 320 b 148 328 95 328 96 328 l 198 330 l 202 341 b 460 574 249 473 351 566 "},vbf:{x_min:-53.078125,x_max:513.140625,ha:485,o:"m 185 383 b 196 384 187 383 191 384 b 277 334 230 384 259 365 b 288 301 281 324 288 306 b 288 297 288 298 288 297 b 294 302 289 297 291 299 b 394 370 323 338 367 367 b 404 371 398 370 401 371 b 510 272 453 371 498 328 b 513 237 513 262 513 251 b 507 172 513 217 511 192 b 326 -34 487 59 412 -26 b 314 -36 322 -36 318 -36 b 274 -24 298 -36 283 -31 l 265 -16 b 224 44 246 -1 232 20 b 223 49 224 47 223 49 b 223 49 223 49 223 49 b 149 -197 221 48 149 -194 b 149 -198 149 -197 149 -198 b 170 -210 149 -202 155 -205 b 187 -215 174 -210 175 -212 b 204 -231 201 -219 204 -222 b 197 -245 204 -240 202 -242 l 194 -248 l 76 -248 l -42 -248 l -46 -245 b -53 -231 -51 -242 -53 -240 b -35 -215 -53 -222 -49 -217 b -13 -210 -21 -212 -20 -212 b -6 -208 -10 -209 -8 -208 b 0 -206 -6 -208 -2 -206 b 25 -188 13 -201 21 -195 b 163 280 28 -183 163 276 b 166 291 163 283 164 287 b 167 302 167 295 167 299 b 155 324 167 315 161 324 b 155 324 155 324 155 324 b 65 230 125 322 85 280 b 53 215 61 217 58 215 b 51 215 53 215 51 215 b 42 224 46 215 42 217 b 57 263 42 231 47 244 b 140 360 77 305 104 337 b 152 370 144 365 149 369 b 185 383 157 376 172 381 m 374 306 b 366 308 371 308 368 308 b 300 273 348 308 321 294 b 284 254 288 262 287 259 b 280 242 283 249 281 245 b 257 169 279 240 270 213 l 236 98 l 236 93 b 251 48 238 77 243 61 b 279 27 258 37 272 27 b 281 27 279 27 280 27 b 291 31 281 27 287 30 b 396 170 334 52 378 109 b 406 247 402 197 406 224 b 401 277 406 259 405 270 b 374 306 397 290 383 303 "},vc3:{x_min:-10.890625,x_max:299.4375,ha:294,o:"m 136 460 b 142 462 137 462 140 462 b 166 449 152 462 161 456 b 171 428 168 446 168 445 b 288 131 194 322 238 209 b 298 115 295 120 296 117 b 299 106 298 112 299 109 b 273 81 299 91 287 81 b 255 86 268 81 261 83 b 155 116 225 104 183 116 l 152 116 l 149 108 b 141 83 148 102 144 91 b 134 48 137 69 134 58 b 149 9 134 34 140 24 b 153 -1 152 5 153 1 b 149 -9 153 -5 152 -6 b 144 -11 148 -11 147 -11 b 122 2 138 -11 133 -6 b 95 61 104 20 95 38 b 107 108 95 74 99 90 b 108 113 107 111 108 112 b 107 113 108 113 108 113 b 102 113 106 113 104 113 b 31 86 76 108 53 98 b 14 80 24 81 20 80 b -10 106 0 80 -10 91 b 0 131 -10 115 -9 116 b 115 430 49 209 91 317 b 136 460 119 451 123 456 "},vd0:{x_min:-10.890625,x_max:299.4375,ha:294,o:"m 44 174 b 51 174 47 174 49 174 b 68 173 55 174 61 174 l 287 112 l 551 40 b 615 20 617 22 609 23 b 626 0 622 16 626 8 b 615 -22 626 -9 622 -18 b 613 -23 613 -23 613 -23 b 613 -23 613 -23 613 -23 b 287 -113 613 -24 597 -29 l 68 -174 b 53 -176 61 -176 57 -176 b 39 -172 47 -176 43 -174 b 27 -151 31 -167 27 -159 b 39 -129 27 -141 31 -133 b 230 -74 43 -124 20 -131 l 370 -36 l 468 -9 b 498 0 484 -4 498 -1 b 468 8 498 0 484 2 l 370 34 l 230 73 b 40 126 28 129 43 124 b 27 149 31 131 27 140 b 44 174 27 161 34 170 m 205 110 l 205 300 b 205 330 245 330 245 300 l 245 300 l 245 -300 b 245 -330 205 -330 205 -300 l 205 -300 l 205 110 l 345 90 m 345 90 l 345 330 b 345 360 385 360 385 330 l 385 330 l 385 -270 b 385 -300 345 -300 345 -270 l 345 -270 l 345 90 "},vd1:{x_min:-20,x_max:320,ha:257,o:"m -8 200 b -8 210 8 200 16 200 l 20 148 -199 l 23 -615 b 0 -629 9 -629 6 -629 l -21 -612 l -21 -201 l -21 216 l -20 200 m 16 200 l 310 0 l 240 0 l 16 140 l 16 -120 l 240 0 l 310 0 l 16 -200 "},vd2:{x_min:0,x_max:430.75,ha:386,o:"m 0 200 l 0 -200 l 430 -200 l 430 200 l 0 200 "},vd3:{x_min:0,x_max:430.75,ha:386,o:"m 0 200 l 0 -200 l 430 -200 l 430 200 l 0 200 l 50 150 l 380 150 l 380 -150 l 50 -150 l 50 150 "},vd4:{x_min:0,x_max:430.75,ha:360,o:"m 0 150 l 0 -150 l 430 -150 l 430 150 l 0 150 "},vd5:{x_min:0,x_max:430.75,ha:360,o:"m 0 150 l 0 -150 l 430 -150 l 430 150 l 0 150 l 50 100 l 380 100 l 380 -100 l 50 -100 l 50 100"},vd6:{x_min:0,x_max:430.75,ha:360,o:"m -146 537 b -138 538 -143 538 -141 538 b -118 525 -129 538 -121 533 b -117 390 -117 522 -117 521 b -115 259 -117 268 -117 259 b -115 259 -115 259 -115 259 b -59 272 -104 263 -62 272 b -39 259 -50 272 -42 267 b -37 209 -38 257 -37 233 b -39 159 -37 185 -38 162 b -85 138 -43 149 -44 149 l -117 131 l -117 21 b -115 -88 -117 -80 -117 -88 b -115 -88 -115 -88 -115 -88 b -59 -75 -104 -84 -62 -75 b -44 -81 -52 -75 -48 -77 b -38 -124 -38 -87 -38 -85 b -38 -138 -38 -124 -38 -138 b -38 -152 -38 -138 -38 -152 b -44 -195 -38 -191 -38 -190 b -85 -209 -48 -200 -48 -200 l -117 -217 l -117 -349 b -118 -486 -117 -481 -117 -482 b -138 -499 -121 -494 -129 -499 b -153 -493 -143 -499 -149 -497 b -159 -415 -158 -487 -159 -496 b -159 -355 -159 -398 -159 -379 b -159 -227 -159 -284 -159 -227 b -205 -238 -159 -227 -180 -232 b -250 -249 -230 -244 -250 -249 b -251 -386 -251 -249 -251 -311 b -252 -525 -251 -521 -251 -522 b -272 -538 -255 -534 -264 -538 b -287 -532 -277 -538 -283 -536 b -293 -452 -292 -527 -293 -536 b -293 -391 -293 -436 -293 -415 b -294 -260 -293 -269 -293 -260 b -294 -260 -294 -260 -294 -260 b -348 -272 -306 -264 -345 -272 b -368 -259 -357 -272 -365 -267 b -369 -209 -369 -257 -369 -233 b -368 -159 -369 -185 -369 -162 b -323 -139 -364 -149 -362 -148 l -293 -131 l -293 -22 b -294 87 -293 80 -293 87 b -294 87 -294 87 -294 87 b -348 75 -306 84 -345 75 b -368 88 -357 75 -365 80 b -369 138 -369 91 -369 114 b -368 188 -369 162 -369 186 b -323 209 -364 198 -362 199 l -293 216 l -293 349 b -292 486 -293 481 -293 482 b -272 499 -288 494 -280 499 b -257 493 -266 499 -261 497 b -251 414 -251 487 -251 496 b -251 354 -251 398 -251 378 b -251 226 -251 284 -251 226 b -205 238 -250 226 -230 231 b -159 249 -180 244 -159 249 b -159 385 -159 249 -159 310 b -157 525 -159 521 -159 522 b -146 537 -156 530 -151 535 z m -159 11 b -159 120 -159 98 -159 120 l -159 120 b -175 116 -160 120 -167 119 b -221 105 -184 114 -204 109 l -251 98 l -251 -12 b -251 -121 -251 -72 -251 -121 b -205 -110 -250 -121 -230 -116 b -159 -99 -180 -104 -159 -99 b -159 11 -159 -99 -159 -49 z m 89 517 b 97 519 92 518 94 519 b 117 505 106 519 114 513 b 119 376 119 502 119 501 l 119 249 l 145 258 b 176 267 169 266 172 267 b 177 267 176 267 177 267 b 196 255 186 267 192 263 l 197 252 l 197 205 b 197 181 197 195 197 187 b 193 149 197 153 197 153 b 152 131 190 144 187 143 l 119 120 l 119 10 b 119 -100 119 -62 119 -100 b 145 -91 120 -100 131 -96 b 173 -82 159 -86 171 -82 b 176 -81 174 -81 175 -81 b 196 -94 185 -81 193 -87 b 198 -151 197 -97 198 -125 b 197 -194 198 -172 197 -192 b 153 -218 193 -203 192 -204 l 119 -230 l 119 -367 l 118 -504 l 117 -507 b 97 -519 113 -514 105 -519 b 82 -512 92 -519 87 -517 b 76 -434 77 -507 76 -516 b 76 -374 76 -418 76 -398 b 76 -245 76 -303 76 -245 b 52 -254 76 -245 65 -249 b 19 -263 34 -260 25 -263 b 6 -257 13 -263 10 -261 b 0 -214 0 -251 0 -253 b 0 -200 0 -210 0 -205 b 0 -188 0 -196 0 -192 b 6 -143 0 -147 0 -149 b 46 -126 10 -139 10 -139 l 76 -115 l 76 -5 b 76 106 76 56 76 106 b 51 98 76 106 64 102 b 18 89 34 92 25 89 b 6 95 13 89 10 91 b 0 139 0 101 0 99 b 0 153 0 143 0 148 b 0 179 0 163 0 172 b 44 225 0 215 3 211 l 76 236 l 76 369 b 78 505 76 501 76 502 b 89 517 80 510 85 515 z "},vd7:{x_min:0,x_max:430.75,ha:360,o:"m 283 633 b 291 634 286 634 289 634 b 311 621 300 634 308 629 b 313 505 313 618 313 617 b 313 393 313 443 313 393 b 378 425 313 393 343 407 l 443 458 l 448 458 b 449 458 449 458 449 458 b 471 437 462 458 471 448 b 469 429 471 434 470 432 b 387 382 466 421 469 423 l 313 344 l 313 247 l 313 150 l 315 152 b 433 201 353 184 394 201 b 479 193 448 201 464 198 b 549 86 524 177 549 135 b 526 1 549 59 541 29 b 395 -143 504 -39 475 -71 b 316 -214 351 -182 341 -191 b 292 -229 302 -228 300 -229 b 272 -216 283 -229 275 -224 b 271 55 271 -212 271 -212 b 270 323 271 203 270 323 b 205 291 270 323 241 308 l 140 258 l 135 258 b 134 258 135 258 134 258 b 112 279 121 258 112 267 b 114 287 112 281 113 284 b 196 334 117 295 114 293 l 271 371 l 271 495 b 272 621 271 617 271 618 b 283 633 274 626 279 631 z m 404 133 b 391 134 400 134 395 134 b 384 134 388 134 386 134 b 318 88 358 130 335 114 l 313 81 l 313 -37 l 313 -156 l 316 -152 b 439 83 391 -71 439 22 l 439 84 b 404 133 439 115 430 128 z m -8 633 l -8 633 b 0 634 -6 634 -3 634 b 20 621 8 634 17 629 b 21 384 21 618 21 617 l 21 150 l 24 152 b 141 201 62 184 102 201 b 187 193 157 201 172 198 b 257 86 232 177 257 135 b 234 1 257 59 250 29 b 103 -143 212 -39 183 -71 b 24 -214 60 -182 49 -191 b 0 -229 10 -228 8 -229 b -20 -216 -9 -229 -17 -224 l -21 -212 l -21 203 l -21 618 l -20 621 b -8 633 -18 626 -13 631 z m 113 133 l 113 133 b 99 134 109 134 103 134 b 93 134 97 134 94 134 b 26 88 66 130 43 114 l 21 81 l 21 -37 l 21 -156 l 25 -152 b 148 83 99 -71 148 22 l 148 84 b 113 133 148 115 138 128 z "}},cssFontWeight:"normal",ascender:1903,underlinePosition:-125,cssFontStyle:"normal",boundingBox:{yMin:-2065.375,xMin:-695.53125,yMax:1901.578125,xMax:1159.671875},resolution:1e3,descender:-2066,familyName:"VexFlow-18",lineHeight:4093,underlineThickness:50};function f(t,e,i,n,s,r){let o,a,l,h=0;function c(){return e+t[h++]*n}function u(){return i+t[h++]*s}for(;h<t.length;)switch(o=t[h++],o){case"m":case"l":r[o](c(),u());break;case"q":a=c(),l=u(),r.q(c(),u(),a,l);break;case"b":a=c(),l=u(),r.b(c(),u(),c(),u(),a,l)}}class p extends h{static loadMetrics(t,e,i){const n=t.glyphs[e];if(!n)throw new s.RERR("BadGlyph",`Glyph ${e} does not exist in font.`);const r=n.x_min,o=n.x_max,a=n.ha;let l;if(n.o)return i?n.cached_outline?l=n.cached_outline:(l=n.o.split(" "),n.cached_outline=l):(n.cached_outline&&delete n.cached_outline,l=n.o.split(" ")),{x_min:r,x_max:o,ha:a,outline:l};throw new s.RERR("BadGlyph",`Glyph ${e} has no outline defined.`)}static renderGlyph(t,e,i,n,s,r){const o=72*n/(100*d.resolution),a=p.loadMetrics(d,s,!r);p.renderOutline(t,a.outline,o,e,i)}static renderOutline(t,e,i,n,s){t.beginPath(),t.moveTo(n,s),f(e,n,s,i,-i,{m:t.moveTo.bind(t),l:t.lineTo.bind(t),q:t.quadraticCurveTo.bind(t),b:t.bezierCurveTo.bind(t)}),t.fill()}static getOutlineBoundingBox(t,e,i,n){const s=new c;return f(t,i,n,e,-e,{m:s.addPoint.bind(s),l:s.addPoint.bind(s),q:s.addQuadraticCurve.bind(s),b:s.addBezierCurve.bind(s)}),new u(s.x1,s.y1,s.width(),s.height())}constructor(t,e,i){super(),this.setAttribute("type","Glyph"),this.code=t,this.point=e,this.options={cache:!0,font:d},this.metrics=null,this.x_shift=0,this.y_shift=0,this.originShift={x:0,y:0},i?this.setOptions(i):this.reset()}setOptions(t){s.Merge(this.options,t),this.reset()}setPoint(t){return this.point=t,this}setStave(t){return this.stave=t,this}setXShift(t){return this.x_shift=t,this}setYShift(t){return this.y_shift=t,this}reset(){this.scale=72*this.point/(100*this.options.font.resolution),this.metrics=p.loadMetrics(this.options.font,this.code,this.options.cache),this.bbox=p.getOutlineBoundingBox(this.metrics.outline,this.scale,0,0)}getMetrics(){if(!this.metrics)throw new s.RuntimeError("BadGlyph",`Glyph ${this.code} is not initialized.`);return{x_min:this.metrics.x_min*this.scale,x_max:this.metrics.x_max*this.scale,width:this.bbox.getW(),height:this.bbox.getH()}}setOriginX(t){const{bbox:e}=this,i=(t-Math.abs(e.getX()/e.getW()))*e.getW();this.originShift.x=-i}setOriginY(t){const{bbox:e}=this,i=(t-Math.abs(e.getY()/e.getH()))*e.getH();this.originShift.y=-i}setOrigin(t,e){this.setOriginX(t),this.setOriginY(e)}render(t,e,i){if(!this.metrics)throw new s.RuntimeError("BadGlyph",`Glyph ${this.code} is not initialized.`);const n=this.metrics.outline,r=this.scale;this.setRendered(),this.applyStyle(t),p.renderOutline(t,n,r,e+this.originShift.x,i+this.originShift.y),this.restoreStyle(t)}renderToStave(t){if(this.checkContext(),!this.metrics)throw new s.RuntimeError("BadGlyph",`Glyph ${this.code} is not initialized.`);if(!this.stave)throw new s.RuntimeError("GlyphError","No valid stave");const e=this.metrics.outline,i=this.scale;this.setRendered(),this.applyStyle(),p.renderOutline(this.context,e,i,t+this.x_shift,this.stave.getYForGlyphs()+this.y_shift),this.restoreStyle()}}const m={STEM_WIDTH:1.5,STEM_HEIGHT:35,STAVE_LINE_THICKNESS:1,RESOLUTION:16384,DEFAULT_NOTATION_FONT_SCALE:39,DEFAULT_TABLATURE_FONT_SCALE:39,SLASH_NOTEHEAD_WIDTH:15,TEXT_HEIGHT_OFFSET_HACK:1,IsKerned:!0,clefProperties:t=>{if(!t)throw new s.RERR("BadArgument","Invalid clef: "+t);const e=m.clefProperties.values[t];if(!e)throw new s.RERR("BadArgument","Invalid clef: "+t);return e}};m.clefProperties.values={treble:{line_shift:0},bass:{line_shift:6},tenor:{line_shift:4},alto:{line_shift:3},soprano:{line_shift:1},percussion:{line_shift:0},"mezzo-soprano":{line_shift:2},"baritone-c":{line_shift:5},"baritone-f":{line_shift:5},subbass:{line_shift:7},french:{line_shift:-1}},m.keyProperties=(e,i,n)=>{void 0===i&&(i="treble");const r={octave_shift:0};"object"==typeof n&&s.Merge(r,n);const o=e.split("/");if(o.length<2)throw new s.RERR("BadArguments",`Key must have note + octave and an optional glyph: ${e}`);const a=o[0].toUpperCase(),l=m.keyProperties.note_values[a];if(!l)throw new s.RERR("BadArguments","Invalid key name: "+a);l.octave&&(o[1]=l.octave);let h=parseInt(o[1],10);h+=-1*r.octave_shift;let c=(7*h-28+l.index)/2;c+=m.clefProperties(i).line_shift;let u=0;c<=0&&2*c%2==0&&(u=1),c>=6&&2*c%2==0&&(u=-1);const d=void 0!==l.int_val?12*h+l.int_val:null,f=l.code,p=l.shift_right;let b={};if(o.length>2&&o[2]){const t=o[2].toUpperCase();b=m.keyProperties.customNoteHeads[t]||{}}return t({key:a,octave:h,line:c,int_value:d,accidental:l.accidental,code:f,stroke:u,shift_right:p,displaced:!1},b)},m.keyProperties.note_values={C:{index:0,int_val:0,accidental:null},CN:{index:0,int_val:0,accidental:"n"},"C#":{index:0,int_val:1,accidental:"#"},"C##":{index:0,int_val:2,accidental:"##"},CB:{index:0,int_val:-1,accidental:"b"},CBB:{index:0,int_val:-2,accidental:"bb"},D:{index:1,int_val:2,accidental:null},DN:{index:1,int_val:2,accidental:"n"},"D#":{index:1,int_val:3,accidental:"#"},"D##":{index:1,int_val:4,accidental:"##"},DB:{index:1,int_val:1,accidental:"b"},DBB:{index:1,int_val:0,accidental:"bb"},E:{index:2,int_val:4,accidental:null},EN:{index:2,int_val:4,accidental:"n"},"E#":{index:2,int_val:5,accidental:"#"},"E##":{index:2,int_val:6,accidental:"##"},EB:{index:2,int_val:3,accidental:"b"},EBB:{index:2,int_val:2,accidental:"bb"},F:{index:3,int_val:5,accidental:null},FN:{index:3,int_val:5,accidental:"n"},"F#":{index:3,int_val:6,accidental:"#"},"F##":{index:3,int_val:7,accidental:"##"},FB:{index:3,int_val:4,accidental:"b"},FBB:{index:3,int_val:3,accidental:"bb"},G:{index:4,int_val:7,accidental:null},GN:{index:4,int_val:7,accidental:"n"},"G#":{index:4,int_val:8,accidental:"#"},"G##":{index:4,int_val:9,accidental:"##"},GB:{index:4,int_val:6,accidental:"b"},GBB:{index:4,int_val:5,accidental:"bb"},A:{index:5,int_val:9,accidental:null},AN:{index:5,int_val:9,accidental:"n"},"A#":{index:5,int_val:10,accidental:"#"},"A##":{index:5,int_val:11,accidental:"##"},AB:{index:5,int_val:8,accidental:"b"},ABB:{index:5,int_val:7,accidental:"bb"},B:{index:6,int_val:11,accidental:null},BN:{index:6,int_val:11,accidental:"n"},"B#":{index:6,int_val:12,accidental:"#"},"B##":{index:6,int_val:13,accidental:"##"},BB:{index:6,int_val:10,accidental:"b"},BBB:{index:6,int_val:9,accidental:"bb"},R:{index:6,int_val:9,rest:!0},X:{index:6,accidental:"",octave:4,code:"v3e",shift_right:5.5}},m.keyProperties.customNoteHeads={D0:{code:"v27",shift_right:0,stem_up_x_offset:0,stem_down_x_offset:0,stem_up_y_offset:-1,stem_down_y_offset:0},D1:{code:"v2d",shift_right:-.5},D2:{code:"v22",shift_right:-.5},D3:{code:"v70",shift_right:-.5},T0:{code:"v49",shift_right:-2,stem_up_y_offset:-4,stem_down_y_offset:4},T1:{code:"v93",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},T2:{code:"v40",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},T3:{code:"v7d",shift_right:.5,stem_up_y_offset:-4,stem_down_y_offset:4},X0:{code:"v92",stem_up_x_offset:-2,stem_down_x_offset:0,stem_up_y_offset:4,stem_down_y_offset:4},X1:{code:"v95",shift_right:-.5,stem_up_y_offset:4,stem_down_y_offset:4},X2:{code:"v3e",shift_right:.5,stem_up_y_offset:4,stem_down_y_offset:4},X3:{code:"v3b",shift_right:0,stem_up_x_offset:-1.2,stem_down_x_offset:0,stem_up_y_offset:-1,stem_down_y_offset:2},S1:{code:"vd3",shift_right:0},S2:{code:"vd2",shift_right:0},R1:{code:"vd5",shift_right:0},R2:{code:"vd4",shift_right:0}},m.integerToNote=t=>{if(void 0===t)throw new s.RERR("BadArguments","Undefined integer for integerToNote");if(t<-2)throw new s.RERR("BadArguments",`integerToNote requires integer > -2: ${t}`);const e=m.integerToNote.table[t];if(!e)throw new s.RERR("BadArguments",`Unknown note value for integer: ${t}`);return e},m.integerToNote.table={0:"C",1:"C#",2:"D",3:"D#",4:"E",5:"F",6:"F#",7:"G",8:"G#",9:"A",10:"A#",11:"B"},m.tabToGlyph=(t,e=1)=>{let i=null,n=0,s=0;if("X"===t.toString().toUpperCase()){const t=new p("v7f",m.DEFAULT_TABLATURE_FONT_SCALE).getMetrics();i="v7f",n=t.width,s=-t.height/2}else n=m.textWidth(t.toString());return{text:t,code:i,getWidth:()=>n*e,shift_y:s}},m.textWidth=t=>7*t.toString().length,m.articulationCodes=t=>m.articulationCodes.articulations[t],m.articulationCodes.articulations={"a.":{code:"v23",between_lines:!0},av:{code:"v28",between_lines:!0},"a>":{code:"v42",between_lines:!0},"a-":{code:"v25",between_lines:!0},"a^":{code:"va",between_lines:!1},"a+":{code:"v8b",between_lines:!1},ao:{code:"v94",between_lines:!1},ah:{code:"vb9",between_lines:!1},"a@a":{code:"v43",between_lines:!1},"a@u":{code:"v5b",between_lines:!1},"a|":{code:"v75",between_lines:!1},am:{code:"v97",between_lines:!1},"a,":{code:"vb3",between_lines:!1}},m.accidentalCodes=t=>m.accidentalCodes.accidentals[t],m.accidentalCodes.accidentals={"#":{code:"v18",parenRightPaddingAdjustment:-1},"##":{code:"v7f",parenRightPaddingAdjustment:-1},b:{code:"v44",parenRightPaddingAdjustment:-2},bb:{code:"v26",parenRightPaddingAdjustment:-2},n:{code:"v4e",parenRightPaddingAdjustment:-1},"{":{code:"v9c",parenRightPaddingAdjustment:-1},"}":{code:"v84",parenRightPaddingAdjustment:-1},db:{code:"v9e",parenRightPaddingAdjustment:-1},d:{code:"vab",parenRightPaddingAdjustment:0},bbs:{code:"v90",parenRightPaddingAdjustment:-1},"++":{code:"v51",parenRightPaddingAdjustment:-1},"+":{code:"v78",parenRightPaddingAdjustment:-1},"+-":{code:"v8d",parenRightPaddingAdjustment:-1},"++-":{code:"v7a",parenRightPaddingAdjustment:-1},bs:{code:"vb7",parenRightPaddingAdjustment:-1},bss:{code:"v39",parenRightPaddingAdjustment:-1},o:{code:"vd0",parenRightPaddingAdjustment:-1},k:{code:"vd1",parenRightPaddingAdjustment:-1},ashs:{code:"vd6",parenRightPaddingAdjustment:-1},afhf:{code:"vd7",parenRightPaddingAdjustment:-1}},m.accidentalColumnsTable={1:{a:[1],b:[1]},2:{a:[1,2]},3:{a:[1,3,2],b:[1,2,1],second_on_bottom:[1,2,3]},4:{a:[1,3,4,2],b:[1,2,3,1],spaced_out_tetrachord:[1,2,1,2]},5:{a:[1,3,5,4,2],b:[1,2,4,3,1],spaced_out_pentachord:[1,2,3,2,1],very_spaced_out_pentachord:[1,2,1,2,1]},6:{a:[1,3,5,6,4,2],b:[1,2,4,5,3,1],spaced_out_hexachord:[1,3,2,1,3,2],very_spaced_out_hexachord:[1,2,1,2,1,2]}},m.ornamentCodes=t=>m.ornamentCodes.ornaments[t],m.ornamentCodes.ornaments={mordent:{code:"v1e"},mordent_inverted:{code:"v45"},turn:{code:"v72"},turn_inverted:{code:"v33"},tr:{code:"v1f"},upprall:{code:"v60"},downprall:{code:"vb4"},prallup:{code:"v6d"},pralldown:{code:"v2c"},upmordent:{code:"v29"},downmordent:{code:"v68"},lineprall:{code:"v20"},prallprall:{code:"v86"}},m.keySignature=t=>{const e=m.keySignature.keySpecs[t];if(!e)throw new s.RERR("BadKeySignature",`Bad key signature spec: '${t}'`);if(!e.acc)return[];const i=m.keySignature.accidentalList(e.acc),n=[];for(let s=0;s<e.num;++s){const t=i[s];n.push({type:e.acc,line:t})}return n},m.keySignature.keySpecs={C:{acc:null,num:0},Am:{acc:null,num:0},F:{acc:"b",num:1},Dm:{acc:"b",num:1},Bb:{acc:"b",num:2},Gm:{acc:"b",num:2},Eb:{acc:"b",num:3},Cm:{acc:"b",num:3},Ab:{acc:"b",num:4},Fm:{acc:"b",num:4},Db:{acc:"b",num:5},Bbm:{acc:"b",num:5},Gb:{acc:"b",num:6},Ebm:{acc:"b",num:6},Cb:{acc:"b",num:7},Abm:{acc:"b",num:7},G:{acc:"#",num:1},Em:{acc:"#",num:1},D:{acc:"#",num:2},Bm:{acc:"#",num:2},A:{acc:"#",num:3},"F#m":{acc:"#",num:3},E:{acc:"#",num:4},"C#m":{acc:"#",num:4},B:{acc:"#",num:5},"G#m":{acc:"#",num:5},"F#":{acc:"#",num:6},"D#m":{acc:"#",num:6},"C#":{acc:"#",num:7},"A#m":{acc:"#",num:7}},m.unicode={sharp:String.fromCharCode(parseInt("266F",16)),flat:String.fromCharCode(parseInt("266D",16)),natural:String.fromCharCode(parseInt("266E",16)),triangle:String.fromCharCode(parseInt("25B3",16)),"o-with-slash":String.fromCharCode(parseInt("00F8",16)),degrees:String.fromCharCode(parseInt("00B0",16)),circle:String.fromCharCode(parseInt("25CB",16))},m.keySignature.accidentalList=t=>({b:[2,.5,2.5,1,3,1.5,3.5],"#":[0,1.5,-.5,1,2.5,.5,2]}[t]),m.parseNoteDurationString=t=>{if("string"!=typeof t)return null;const e=/(\d*\/?\d+|[a-z])(d*)([nrhms]|$)/.exec(t);if(!e)return null;const i=e[1],n=e[2].length;let s=e[3];return 0===s.length&&(s="n"),{duration:i,dots:n,type:s}},m.parseNoteStruct=t=>{const e=t.duration,i=m.parseNoteDurationString(e);if(!i)return null;let n=m.durationToTicks(i.duration);if(null==n)return null;let s=t.type;const r=[];if(s){if(!m.getGlyphProps.validTypes[s])return null}else s=i.type||"n",void 0!==t.keys&&t.keys.forEach(((t,e)=>{const i=t.split("/");i&&3===i.length&&(r[e]=i[2])}));const o=t.dots?t.dots:i.dots;if("number"!=typeof o)return null;let a=n;for(let l=0;l<o;l++){if(a<=1)return null;a/=2,n+=a}return{duration:i.duration,type:s,customTypes:r,dots:o,ticks:n}},m.sanitizeDuration=t=>{const e=m.durationAliases[t];if(void 0!==e&&(t=e),void 0===m.durationToTicks.durations[t])throw new s.RERR("BadArguments",`The provided duration is not valid: ${t}`);return t},m.durationToFraction=t=>(new r).parse(m.sanitizeDuration(t)),m.durationToNumber=t=>m.durationToFraction(t).value(),m.durationToTicks=t=>{t=m.sanitizeDuration(t);const e=m.durationToTicks.durations[t];return void 0===e?null:e},m.durationToTicks.durations={"1/2":2*m.RESOLUTION,1:m.RESOLUTION/1,2:m.RESOLUTION/2,4:m.RESOLUTION/4,8:m.RESOLUTION/8,16:m.RESOLUTION/16,32:m.RESOLUTION/32,64:m.RESOLUTION/64,128:m.RESOLUTION/128,256:m.RESOLUTION/256},m.durationAliases={w:"1",h:"2",q:"4",b:"256"},m.getGlyphProps=(e,i)=>{e=m.sanitizeDuration(e);const n=m.getGlyphProps.duration_codes[e];if(void 0===n)return null;i||(i="n");let s=n.type[i];if(void 0===s){const e=m.keyProperties.customNoteHeads[i.toUpperCase()];if(void 0===e)return null;s=t({code_head:e.code},e)}return t(t({},n.common),s)},m.getGlyphProps.validTypes={n:{name:"note"},r:{name:"rest"},h:{name:"harmonic"},m:{name:"muted"},s:{name:"slash"}},m.getGlyphProps.duration_codes={"1/2":{common:{getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new p(this.code_head||"v53",t).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-m.STEM_HEIGHT,stem_down_extension:-m.STEM_HEIGHT,tabnote_stem_up_extension:-m.STEM_HEIGHT,tabnote_stem_down_extension:-m.STEM_HEIGHT,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v53"},h:{code_head:"v59"},m:{code_head:"vf",stem_offset:0},r:{code_head:"v31",rest:!0,position:"B/5",dot_shiftY:.5},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},1:{common:{getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new p(this.code_head||"v1d",t).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-m.STEM_HEIGHT,stem_down_extension:-m.STEM_HEIGHT,tabnote_stem_up_extension:-m.STEM_HEIGHT,tabnote_stem_down_extension:-m.STEM_HEIGHT,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v1d"},h:{code_head:"v46"},m:{code_head:"v92",stem_offset:-3},r:{code_head:"v5c",rest:!0,position:"D/5",dot_shiftY:.5},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},2:{common:{getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new p(this.code_head||"v81",t).getMetrics().width},stem:!0,stem_offset:0,flag:!1,stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"v81"},h:{code_head:"v2d"},m:{code_head:"v95",stem_offset:-3},r:{code_head:"vc",stem:!1,rest:!0,position:"B/4",dot_shiftY:-.5},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},4:{common:{getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new p(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!1,stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e",stem_offset:-3},r:{code_head:"v7c",stem:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1.5,line_below:1.5},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},8:{common:{getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new p(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!0,beam_count:1,code_flag_upstem:"v54",code_flag_downstem:"v9a",stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"va5",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1,line_below:1},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},16:{common:{beam_count:2,getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new p(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v3f",code_flag_downstem:"v8f",stem_up_extension:0,stem_down_extension:0,tabnote_stem_up_extension:0,tabnote_stem_down_extension:0,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v3c",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-.5,line_above:1,line_below:2},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},32:{common:{beam_count:3,getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new p(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v47",code_flag_downstem:"v2a",stem_up_extension:9,stem_down_extension:9,tabnote_stem_up_extension:8,tabnote_stem_down_extension:5,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v55",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-1.5,line_above:2,line_below:2},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},64:{common:{beam_count:4,getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new p(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"va9",code_flag_downstem:"v58",stem_up_extension:13,stem_down_extension:13,tabnote_stem_up_extension:12,tabnote_stem_down_extension:9,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"v38",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:-1.5,line_above:2,line_below:3},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},128:{common:{beam_count:5,getWidth(t=m.DEFAULT_NOTATION_FONT_SCALE){return new p(this.code_head||"vb",t).getMetrics().width},stem:!0,stem_offset:0,flag:!0,code_flag_upstem:"v9b",code_flag_downstem:"v30",stem_up_extension:22,stem_down_extension:22,tabnote_stem_up_extension:21,tabnote_stem_down_extension:18,dot_shiftY:0,line_above:0,line_below:0},type:{n:{code_head:"vb"},h:{code_head:"v22"},m:{code_head:"v3e"},r:{code_head:"vaa",stem:!1,flag:!1,rest:!0,position:"B/4",dot_shiftY:1.5,line_above:3,line_below:3},s:{getWidth:()=>m.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}}},m.smufl={},m.smufl.to_code_points={bracketTop:"v1b",bracketBottom:"v10",barlineTick:"v6f",segno:"v8c",coda:"v4d",gClef:"v83",cClef:"vad",fClef:"v79",unpitchedPercussionClef1:"v59","6stringTabClef":"v2f",timeSig0:"v0",timeSig1:"v1",timeSig2:"v2",timeSig3:"v3",timeSig4:"v4",timeSig5:"v5",timeSig6:"v6",timeSig7:"v7",timeSig8:"v8",timeSig9:"v9",timeSigCommon:"v41",timeSigCutCommon:"vb6",noteheadDoubleWhole:"v53",noteheadWhole:"v1d",noteheadHalf:"v81",noteheadBlack:"vb",noteheadXWhole:"v92",noteheadXHalf:"v95",noteheadXBlack:"v3e",noteheadCircleX:"v3b",noteheadTriangleUpWhole:"v49",noteheadTriangleUpHalf:"v93",noteheadTriangleUpBlack:"v40",noteheadDiamondWhole:"v46",noteheadDiamondHalf:"v2d",noteheadDiamondBlack:"v22",augmentationDot:"v23",tremolo1:"v74",flag8thUp:"v54",flag8thDown:"v9a",flag16thUp:"v3f",flag16thDown:"v8f",flag32ndUp:"v47",flag32ndDown:"v2a",flag64thUp:"va9",flag64thDown:"v58",flag128thUp:"v9b",flag128thDown:"v30",accidentalFlat:"v44",accidentalNatural:"v4e",accidentalSharp:"v18",accidentalDoubleSharp:"v7f",accidentalDoubleFlat:"v26",accidentalParensLeft:"v9c",accidentalParensRight:"v84",accidentalQuarterToneFlatStein:"vab",accidentalThreeQuarterTonesFlatZimmermann:"v9e",accidentalQuarterToneSharpStein:"v78",accidentalThreeQuarterTonesSharpStein:"v51",accidentalBuyukMucennebFlat:"v39",accidentalBakiyeFlat:"vb7",accidentalKomaSharp:"v51",accidentalKucukMucennebSharp:"v8d",accidentalKoron:"vd1",accidentalSori:"vd0",articAccentAbove:"v42",articAccentBelow:"v42",articTenutoAbove:"v25",articTenutoBelow:"v25",articStaccatoAbove:"v23",articStaccatoBelow:"v23",articStaccatissimoAbove:"v28",articMarcatoAbove:"va",fermataAbove:"v43",fermataBelow:"v5b",breathMarkComma:"v6c",breathMarkUpbow:"v8a",caesura:"v34",caesuraCurved:"v4b",restMaxima:"v59",restDoubleWhole:"v31",restWhole:"v5c",restHalf:"vc",restQuarter:"v7c",rest8th:"va5",rest16th:"v3c",rest32nd:"v55",rest64th:"v38",rest128th:"vaa",dynamicPiano:"vbf",dynamicMezzo:"v62",dynamicForte:"vba",dynamicRinforzando:"vba",dynamicSforzando:"v4a",dynamicZ:"v80",ornamentTrill:"v1f",ornamentTurn:"v72",ornamentTurnSlash:"v33",ornamentMordent:"v45",ornamentMordentInverted:"v1e",ornamentTremblement:"v86",ornamentPrecompAppoggTrill:"v20",ornamentPrecompSlideTrillDAnglebert:"v60",ornamentPrecompSlideTrillBach:"v29",ornamentPrecompTrillSuffixDandrieu:"v6d",ornamentPrecompDoubleCadenceUpperPrefix:"vb4",ornamentPrecompDoubleCadenceUpperPrefixTurn:"v68",ornamentPrecompTrillLowerSuffix:"v2c",stringsDownBow:"v94",stringsUpBow:"v75",stringsHarmonic:"vb9",pluckedSnapPizzicatoAbove:"v94",pluckedLeftHandPizzicato:"v8b",keyboardPedalPed:"v36",keyboardPedalUp:"v5d",pictChokeCymbal:"vb3",wiggleArpeggiatoUp:"va3",arrowheadBlackUp:"vc3",arrowheadBlackDown:"v52"},m.TIME4_4={num_beats:4,beat_value:4,resolution:m.RESOLUTION};class b{static get WIDTH(){return 600}static get HEIGHT(){return 400}static get CANVAS_BROWSER_SIZE_LIMIT(){return 32767}static SanitizeCanvasDims(t,e){return Math.max(t,e)>this.CANVAS_BROWSER_SIZE_LIMIT&&(s.W("Canvas dimensions exceed browser limit. Cropping to "+this.CANVAS_BROWSER_SIZE_LIMIT),t>this.CANVAS_BROWSER_SIZE_LIMIT&&(t=this.CANVAS_BROWSER_SIZE_LIMIT),e>this.CANVAS_BROWSER_SIZE_LIMIT&&(e=this.CANVAS_BROWSER_SIZE_LIMIT)),[t,e]}constructor(t){this.vexFlowCanvasContext=t,t.canvas?this.canvas=t.canvas:this.canvas={width:b.WIDTH,height:b.HEIGHT}}clear(){this.vexFlowCanvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}openGroup(){}closeGroup(){}add(){}setFont(t,e,i){return this.vexFlowCanvasContext.font=(i||"")+" "+e+"pt "+t,this}setRawFont(t){return this.vexFlowCanvasContext.font=t,this}setFillStyle(t){return this.vexFlowCanvasContext.fillStyle=t,this}setBackgroundFillStyle(t){return this.background_fillStyle=t,this}setStrokeStyle(t){return this.vexFlowCanvasContext.strokeStyle=t,this}setShadowColor(t){return this.vexFlowCanvasContext.shadowColor=t,this}setShadowBlur(t){return this.vexFlowCanvasContext.shadowBlur=t,this}setLineWidth(t){return this.vexFlowCanvasContext.lineWidth=t,this}setLineCap(t){return this.vexFlowCanvasContext.lineCap=t,this}setLineDash(t){return this.vexFlowCanvasContext.lineDash=t,this}scale(t,e){return this.vexFlowCanvasContext.scale(parseFloat(t),parseFloat(e))}resize(t,e){return[t,e]=this.SanitizeCanvasDims(parseInt(t,10),parseInt(e,10)),this.vexFlowCanvasContext.resize(t,e)}rect(t,e,i,n){return this.vexFlowCanvasContext.rect(t,e,i,n)}fillRect(t,e,i,n){return this.vexFlowCanvasContext.fillRect(t,e,i,n)}clearRect(t,e,i,n){return this.vexFlowCanvasContext.clearRect(t,e,i,n)}beginPath(){return this.vexFlowCanvasContext.beginPath()}moveTo(t,e){return this.vexFlowCanvasContext.moveTo(t,e)}lineTo(t,e){return this.vexFlowCanvasContext.lineTo(t,e)}bezierCurveTo(t,e,i,n,s,r){return this.vexFlowCanvasContext.bezierCurveTo(t,e,i,n,s,r)}quadraticCurveTo(t,e,i,n){return this.vexFlowCanvasContext.quadraticCurveTo(t,e,i,n)}arc(t,e,i,n,s,r){return this.vexFlowCanvasContext.arc(t,e,i,n,s,r)}glow(){return this.vexFlowCanvasContext.glow()}fill(){return this.vexFlowCanvasContext.fill()}stroke(){return this.vexFlowCanvasContext.stroke()}closePath(){return this.vexFlowCanvasContext.closePath()}measureText(t){return this.vexFlowCanvasContext.measureText(t)}fillText(t,e,i){return this.vexFlowCanvasContext.fillText(t,e,i)}save(){return this.vexFlowCanvasContext.save()}restore(){return this.vexFlowCanvasContext.restore()}}class g{constructor(t){this.element=t,this.paper=Raphael(t),this.path="",this.pen={x:0,y:0},this.lineWidth=1,this.state={scale:{x:1,y:1},font_family:"Arial",font_size:8,font_weight:800},this.attributes={"stroke-width":.3,fill:"black",stroke:"black",font:"10pt Arial"},this.background_attributes={"stroke-width":0,fill:"white",stroke:"white",font:"10pt Arial"},this.shadow_attributes={width:0,color:"black"},this.state_stack=[]}openGroup(){}closeGroup(){}add(){}setFont(t,e,i){return this.state.font_family=t,this.state.font_size=e,this.state.font_weight=i,this.attributes.font=(this.state.font_weight||"")+" "+this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}setRawFont(t){return this.attributes.font=t,this}setFillStyle(t){return this.attributes.fill=t,this}setBackgroundFillStyle(t){return this.background_attributes.fill=t,this.background_attributes.stroke=t,this}setStrokeStyle(t){return this.attributes.stroke=t,this}setShadowColor(t){return this.shadow_attributes.color=t,this}setShadowBlur(t){return this.shadow_attributes.width=t,this}setLineWidth(t){this.attributes["stroke-width"]=t,this.lineWidth=t}setLineDash(){return this}setLineCap(){return this}scale(t,e){return this.state.scale={x:t,y:e},this.attributes.transform="S"+t+","+e+",0,0",this.attributes.scale=t+","+e+",0,0",this.attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this.background_attributes.transform="S"+t+","+e+",0,0",this.background_attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}clear(){this.paper.clear()}resize(t,e){return this.element.style.width=t,this.paper.setSize(t,e),this}setViewBox(t){this.paper.canvas.setAttribute("viewBox",t)}rect(t,e,i,n){return n<0&&(e+=n,n=-n),this.paper.rect(t,e,i-.5,n-.5).attr(this.attributes).attr("fill","none").attr("stroke-width",this.lineWidth),this}fillRect(t,e,i,n){return n<0&&(e+=n,n=-n),this.paper.rect(t,e,i-.5,n-.5).attr(this.attributes),this}clearRect(t,e,i,n){return n<0&&(e+=n,n=-n),this.paper.rect(t,e,i-.5,n-.5).attr(this.background_attributes),this}beginPath(){return this.path="",this.pen.x=0,this.pen.y=0,this}moveTo(t,e){return this.path+="M"+t+","+e,this.pen.x=t,this.pen.y=e,this}lineTo(t,e){return this.path+="L"+t+","+e,this.pen.x=t,this.pen.y=e,this}bezierCurveTo(t,e,i,n,s,r){return this.path+="C"+t+","+e+","+i+","+n+","+s+","+r,this.pen.x=s,this.pen.y=r,this}quadraticCurveTo(t,e,i,n){return this.path+="Q"+t+","+e+","+i+","+n,this.pen.x=i,this.pen.y=n,this}arc(t,e,i,n,s,r){function o(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t}if((n=o(n))>(s=o(s))){const t=n;n=s,s=t,r=!r}const a=s-n;return a>Math.PI?(this.arcHelper(t,e,i,n,n+a/2,r),this.arcHelper(t,e,i,n+a/2,s,r)):this.arcHelper(t,e,i,n,s,r),this}arcHelper(t,e,i,n,s,r){const o=t+i*Math.cos(n),a=e+i*Math.sin(n),l=t+i*Math.cos(s),h=e+i*Math.sin(s);let c=0,u=0;r?(u=1,s-n<Math.PI&&(c=1)):s-n>Math.PI&&(c=1),this.path+="M"+o+","+a+",A"+i+","+i+",0,"+c+","+u+","+l+","+h+"M"+this.pen.x+","+this.pen.y}glow(){const t=this.paper.set();if(this.shadow_attributes.width>0){const e=this.shadow_attributes,i=e.width/2;for(let n=1;n<=i;n++)t.push(this.paper.path(this.path).attr({stroke:e.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(e.width/i*n).toFixed(3),opacity:+((e.opacity||.3)/i).toFixed(3),transform:this.attributes.transform,scale:this.attributes.scale}))}return t}fill(){const t=this.paper.path(this.path).attr(this.attributes).attr("stroke-width",0);return this.glow(t),this}stroke(){const t=this.lineWidth*(this.state.scale.x+this.state.scale.y)/2,e=this.paper.path(this.path).attr(this.attributes).attr("fill","none").attr("stroke-width",t);return this.glow(e),this}closePath(){return this.path+="Z",this}measureText(t){const e=this.paper.text(0,0,t).attr(this.attributes).attr("fill","none").attr("stroke","none"),i=e.getBBox();return e.remove(),{width:i.width,height:i.height}}fillText(t,e,i){return this.paper.text(e+this.measureText(t).width/2,i-this.state.font_size/(2.25*this.state.scale.y),t).attr(this.attributes),this}save(){return this.state_stack.push({state:{font_family:this.state.font_family},attributes:{font:this.attributes.font,fill:this.attributes.fill,stroke:this.attributes.stroke,"stroke-width":this.attributes["stroke-width"]},shadow_attributes:{width:this.shadow_attributes.width,color:this.shadow_attributes.color}}),this}restore(){const t=this.state_stack.pop();return this.state.font_family=t.state.font_family,this.attributes.font=t.attributes.font,this.attributes.fill=t.attributes.fill,this.attributes.stroke=t.attributes.stroke,this.attributes["stroke-width"]=t.attributes["stroke-width"],this.shadow_attributes.width=t.shadow_attributes.width,this.shadow_attributes.color=t.shadow_attributes.color,this}}const y={path:{x:!0,y:!0,width:!0,height:!0},rect:{},text:{width:!0,height:!0}};{const t={"font-family":!0,"font-weight":!0,"font-style":!0,"font-size":!0};s.Merge(y.rect,t),s.Merge(y.path,t)}class S{constructor(t){this.element=t,this.svgNS="http://www.w3.org/2000/svg";const e=this.create("svg");this.element.appendChild(e),this.svg=e,this.groups=[this.svg],this.parent=this.svg,this.path="",this.pen={x:NaN,y:NaN},this.lineWidth=1,this.state={scale:{x:1,y:1},"font-family":"Arial","font-size":"8pt","font-weight":"normal"},this.attributes={"stroke-width":.3,fill:"black",stroke:"black","stroke-dasharray":"none","font-family":"Arial","font-size":"10pt","font-weight":"normal","font-style":"normal"},this.background_attributes={"stroke-width":0,fill:"white",stroke:"white","stroke-dasharray":"none","font-family":"Arial","font-size":"10pt","font-weight":"normal","font-style":"normal"},this.shadow_attributes={width:0,color:"black"},this.state_stack=[],this.iePolyfill()}create(t){return document.createElementNS(this.svgNS,t)}openGroup(t,e,i){const n=this.create("g");return this.groups.push(n),this.parent.appendChild(n),this.parent=n,t&&n.setAttribute("class",s.Prefix(t)),e&&n.setAttribute("id",s.Prefix(e)),i&&i.pointerBBox&&n.setAttribute("pointer-events","bounding-box"),n}closeGroup(){this.groups.pop(),this.parent=this.groups[this.groups.length-1]}add(t){this.parent.appendChild(t)}iePolyfill(){"undefined"!=typeof navigator&&(this.ie=/MSIE 9/i.test(navigator.userAgent)||/MSIE 10/i.test(navigator.userAgent)||/rv:11\.0/i.test(navigator.userAgent)||/Trident/i.test(navigator.userAgent))}setFont(t,e,i){let n=!1,r=!1,o="normal";"string"==typeof i&&(-1!==i.indexOf("italic")&&(i=i.replace(/italic/g,""),r=!0),-1!==i.indexOf("bold")&&(i=i.replace(/bold/g,""),n=!0),i=i.replace(/ /g,"")),o=r?"italic":o;const a={"font-family":t,"font-size":e+"pt","font-weight":i=void 0===(i=n?"bold":i)||""===i?"normal":i,"font-style":o};return this.fontSize=Number(e),s.Merge(this.attributes,a),s.Merge(this.state,a),this}setRawFont(t){const e=(t=t.trim()).split(" ");return this.attributes["font-family"]=e[1],this.state["font-family"]=e[1],this.attributes["font-size"]=e[0],this.state["font-size"]=e[0],this.fontSize=Number(e[0].match(/\d+/)),this}setFillStyle(t){return this.attributes.fill=t,this}setBackgroundFillStyle(t){return this.background_attributes.fill=t,this.background_attributes.stroke=t,this}setStrokeStyle(t){return this.attributes.stroke=t,this}setShadowColor(t){return this.shadow_attributes.color=t,this}setShadowBlur(t){return this.shadow_attributes.width=t,this}setLineWidth(t){this.attributes["stroke-width"]=t,this.lineWidth=t}setLineDash(t){if("[object Array]"===Object.prototype.toString.call(t))return t=t.join(", "),this.attributes["stroke-dasharray"]=t,this;throw new s.RERR("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;const i={width:t,height:e};return this.applyAttributes(this.svg,i),this.scale(this.state.scale.x,this.state.scale.y),this}scale(t,e){this.state.scale={x:t,y:e};const i=this.width/t,n=this.height/e;return this.setViewBox(0,0,i,n),this}setViewBox(...t){if(1===t.length){const[e]=t;this.svg.setAttribute("viewBox",e)}else{const[e,i,n,s]=t,r=e+" "+i+" "+n+" "+s;this.svg.setAttribute("viewBox",r)}}applyAttributes(t,e){const i=y[t.nodeName];return Object.keys(e).forEach((n=>{i&&i[n]||t.setAttributeNS(null,n,e[n])})),t}clear(){for(;this.svg.lastChild;)this.svg.removeChild(this.svg.lastChild);this.scale(this.state.scale.x,this.state.scale.y)}rect(t,e,i,n,r){n<0&&(e+=n,n*=-1);const o=this.create("rect");return void 0===r&&(r={fill:"none","stroke-width":this.lineWidth,stroke:"black"}),s.Merge(r,{x:t,y:e,width:i,height:n}),this.applyAttributes(o,r),this.add(o),this}fillRect(t,e,i,n){return n<0&&(e+=n,n*=-1),this.rect(t,e,i,n,this.attributes),this}clearRect(t,e,i,n){return this.rect(t,e,i,n,this.background_attributes),this}beginPath(){return this.path="",this.pen.x=NaN,this.pen.y=NaN,this}moveTo(t,e){return this.path+="M"+t+" "+e,this.pen.x=t,this.pen.y=e,this}lineTo(t,e){return this.path+="L"+t+" "+e,this.pen.x=t,this.pen.y=e,this}bezierCurveTo(t,e,i,n,s,r){return this.path+="C"+t+" "+e+","+i+" "+n+","+s+" "+r,this.pen.x=s,this.pen.y=r,this}quadraticCurveTo(t,e,i,n){return this.path+="Q"+t+" "+e+","+i+" "+n,this.pen.x=i,this.pen.y=n,this}arc(t,e,i,n,s,r){function o(t){for(;t<0;)t+=2*Math.PI;for(;t>2*Math.PI;)t-=2*Math.PI;return t}if((n=o(n))>(s=o(s))){const t=n;n=s,s=t,r=!r}const a=s-n;return a>Math.PI?(this.arcHelper(t,e,i,n,n+a/2,r),this.arcHelper(t,e,i,n+a/2,s,r)):this.arcHelper(t,e,i,n,s,r),this}arcHelper(t,e,i,n,s,r){const o=t+i*Math.cos(n),a=e+i*Math.sin(n),l=t+i*Math.cos(s),h=e+i*Math.sin(s);let c=0,u=0;r?(u=1,s-n<Math.PI&&(c=1)):s-n>Math.PI&&(c=1),this.path+="M"+o+" "+a+" A"+i+" "+i+" 0 "+c+" "+u+" "+l+" "+h,isNaN(this.pen.x)||isNaN(this.pen.y)||(this.peth+="M"+this.pen.x+" "+this.pen.y)}closePath(){return this.path+="Z",this}glow(){if(this.shadow_attributes.width>0){const t=this.shadow_attributes,e=t.width/2;for(let i=1;i<=e;i++){const n={stroke:t.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(.4*t.width/e*i).toFixed(3),opacity:+((t.opacity||.3)/e).toFixed(3)},s=this.create("path");n.d=this.path,this.applyAttributes(s,n),this.add(s)}}return this}fill(t){this.glow();const e=this.create("path");return void 0===t&&(s.Merge(t={},this.attributes),t.stroke="none"),t.d=this.path,this.applyAttributes(e,t),this.add(e),this}stroke(){this.glow();const t=this.create("path"),e={};return s.Merge(e,this.attributes),e.fill="none",e["stroke-width"]=this.lineWidth,e.d=this.path,this.applyAttributes(t,e),this.add(t),this}measureText(t){const e=this.create("text");if("function"!=typeof e.getBBox)return{x:0,y:0,width:0,height:0};e.textContent=t,this.applyAttributes(e,this.attributes),this.svg.appendChild(e);let i=e.getBBox();return this.ie&&""!==t&&"italic"===this.attributes["font-style"]&&(i=this.ieMeasureTextFix(i,t)),this.svg.removeChild(e),i}ieMeasureTextFix(t){const e=1.196*Number(this.fontSize)+1.9598,i=t.width-e,n=t.height-1.5;return{x:t.x,y:t.y,width:i,height:n}}fillText(t,e,i){if(!t||t.length<=0)return;const n={};s.Merge(n,this.attributes),n.stroke="none",n.x=e,n.y=i;const r=this.create("text");r.textContent=t,this.applyAttributes(r,n),this.add(r)}save(){return this.state_stack.push({state:{"font-family":this.state["font-family"],"font-weight":this.state["font-weight"],"font-style":this.state["font-style"],"font-size":this.state["font-size"],scale:this.state.scale},attributes:{"font-family":this.attributes["font-family"],"font-weight":this.attributes["font-weight"],"font-style":this.attributes["font-style"],"font-size":this.attributes["font-size"],fill:this.attributes.fill,stroke:this.attributes.stroke,"stroke-width":this.attributes["stroke-width"],"stroke-dasharray":this.attributes["stroke-dasharray"]},shadow_attributes:{width:this.shadow_attributes.width,color:this.shadow_attributes.color},lineWidth:this.lineWidth}),this}restore(){const t=this.state_stack.pop();return this.state["font-family"]=t.state["font-family"],this.state["font-weight"]=t.state["font-weight"],this.state["font-style"]=t.state["font-style"],this.state["font-size"]=t.state["font-size"],this.state.scale=t.state.scale,this.attributes["font-family"]=t.attributes["font-family"],this.attributes["font-weight"]=t.attributes["font-weight"],this.attributes["font-style"]=t.attributes["font-style"],this.attributes["font-size"]=t.attributes["font-size"],this.attributes.fill=t.attributes.fill,this.attributes.stroke=t.attributes.stroke,this.attributes["stroke-width"]=t.attributes["stroke-width"],this.attributes["stroke-dasharray"]=t.attributes["stroke-dasharray"],this.shadow_attributes.width=t.shadow_attributes.width,this.shadow_attributes.color=t.shadow_attributes.color,this.lineWidth=t.lineWidth,this}}let v=null;class x{static get Backends(){return{CANVAS:1,RAPHAEL:2,SVG:3,VML:4}}static get LineEndType(){return{NONE:1,UP:2,DOWN:3}}static get USE_CANVAS_PROXY(){return!1}static get lastContext(){return v}static set lastContext(t){v=t}static buildContext(t,e,i,n,s){const r=new x(t,e);i&&n&&r.resize(i,n),s||(s="#FFF");const o=r.getContext();return o.setBackgroundFillStyle(s),x.lastContext=o,o}static getCanvasContext(t,e,i,n){return x.buildContext(t,x.Backends.CANVAS,e,i,n)}static getRaphaelContext(t,e,i,n){return x.buildContext(t,x.Backends.RAPHAEL,e,i,n)}static getSVGContext(t,e,i,n){return x.buildContext(t,x.Backends.SVG,e,i,n)}static bolsterCanvasContext(t){return x.USE_CANVAS_PROXY?new b(t):(t.vexFlowCanvasContext=t,["clear","setFont","setRawFont","setFillStyle","setBackgroundFillStyle","setStrokeStyle","setShadowColor","setShadowBlur","setLineWidth","setLineCap","setLineDash","openGroup","closeGroup","getGroup"].forEach((e=>{t[e]=t[e]||b.prototype[e]})),t)}static drawDashedLine(t,e,i,n,s,r){t.beginPath();const o=n-e,a=s-i,l=Math.atan2(a,o);let h=e,c=i;t.moveTo(e,i);let u=0,d=!0;for(;!(o<0?h<=n:h>=n)||!(a<0?c<=s:c>=s);){const e=r[u++%r.length],i=h+Math.cos(l)*e;h=o<0?Math.max(n,i):Math.min(n,i);const f=c+Math.sin(l)*e;c=a<0?Math.max(s,f):Math.min(s,f),d?t.lineTo(h,c):t.moveTo(h,c),d=!d}t.closePath(),t.stroke()}constructor(t,e){if(this.elementId=t,!this.elementId)throw new s.RERR("BadArgument","Invalid id for renderer.");if(this.element=document.getElementById(t),this.element||(this.element=t),this.ctx=null,this.paper=null,this.backend=e,this.backend===x.Backends.CANVAS){if(!this.element.getContext)throw new s.RERR("BadElement",`Can't get canvas context from element: ${t}`);this.ctx=x.bolsterCanvasContext(this.element.getContext("2d"))}else if(this.backend===x.Backends.RAPHAEL)this.ctx=new g(this.element);else{if(this.backend!==x.Backends.SVG)throw new s.RERR("InvalidBackend",`No support for backend: ${this.backend}`);this.ctx=new S(this.element)}}resize(t,e){if(this.backend===x.Backends.CANVAS){if(!this.element.getContext)throw new s.RERR("BadElement",`Can't get canvas context from element: ${this.elementId}`);[t,e]=b.SanitizeCanvasDims(t,e);const i=window.devicePixelRatio||1;this.element.width=t*i,this.element.height=e*i,this.element.style.width=t+"px",this.element.style.height=e+"px",this.ctx=x.bolsterCanvasContext(this.element.getContext("2d")),this.ctx.scale(i,i)}else this.ctx.resize(t,e);return this}getContext(){return this.ctx}}class E extends h{static get CATEGORY(){return"stem"}static get UP(){return 1}static get DOWN(){return-1}static get WIDTH(){return m.STEM_WIDTH}static get HEIGHT(){return m.STEM_HEIGHT}constructor(t={}){super(),this.setAttribute("type","Stem"),this.x_begin=t.x_begin||0,this.x_end=t.x_end||0,this.y_top=t.y_top||0,this.y_bottom=t.y_bottom||0,this.stem_extension=t.stem_extension||0,this.stem_direction=t.stem_direction||0,this.hide=t.hide||!1,this.isStemlet=t.isStemlet||!1,this.stemletHeight=t.stemletHeight||0,this.renderHeightAdjustment=0,this.setOptions(t)}setOptions(t){this.stem_up_y_offset=t.stem_up_y_offset||0,this.stem_down_y_offset=t.stem_down_y_offset||0}setNoteHeadXBounds(t,e){return this.x_begin=t,this.x_end=e,this}setDirection(t){this.stem_direction=t}setExtension(t){this.stem_extension=t}getExtension(){return this.stem_extension}setYBounds(t,e){this.y_top=t,this.y_bottom=e}getCategory(){return E.CATEGORY}getHeight(){const t=this.stem_direction===E.UP?this.stem_up_y_offset:this.stem_down_y_offset;return(this.y_bottom-this.y_top)*this.stem_direction+(E.HEIGHT-t+this.stem_extension)*this.stem_direction}getBoundingBox(){throw new s.RERR("NotImplemented","getBoundingBox() not implemented.")}getExtents(){const t=this.stem_direction===E.UP,e=[this.y_top,this.y_bottom],i=E.HEIGHT+this.stem_extension,n=(t?Math.min:Math.max)(...e),s=(t?Math.max:Math.min)(...e);return{topY:n+i*-this.stem_direction,baseY:s}}setVisibility(t){return this.hide=!t,this}setStemlet(t,e){return this.isStemlet=t,this.stemletHeight=e,this}draw(){if(this.setRendered(),this.hide)return;const t=this.checkContext();let e,i;const n=this.stem_direction;n===E.DOWN?(e=this.x_begin,i=this.y_top+this.stem_down_y_offset):(e=this.x_end,i=this.y_bottom-this.stem_up_y_offset);const r=this.getHeight();!function(...t){E.DEBUG&&s.L("Vex.Flow.Stem",t)}("Rendering stem - ","Top Y: ",this.y_top,"Bottom Y: ",this.y_bottom);const o=this.isStemlet?r-this.stemletHeight*this.stem_direction:0;t.save(),this.applyStyle(t),t.beginPath(),t.setLineWidth(E.WIDTH),t.moveTo(e,i-o),t.lineTo(e,i-r-this.renderHeightAdjustment*n),t.stroke(),this.restoreStyle(t),t.restore()}}class _ extends h{static get LOCATION_TOP(){return 1}static get LOCATION_BOTTOM(){return-1}static get NESTING_OFFSET(){return 15}constructor(t,e){if(super(),this.setAttribute("type","Tuplet"),!t||!t.length)throw new s.RuntimeError("BadArguments","No notes provided for tuplet.");this.options=s.Merge({},e),this.notes=t,this.num_notes="num_notes"in this.options?this.options.num_notes:t.length,this.options.beats_occupied&&this.beatsOccupiedDeprecationWarning(),this.notes_occupied=this.options.notes_occupied||this.options.beats_occupied||2,"bracketed"in this.options?this.bracketed=this.options.bracketed:this.bracketed=t.some((t=>null===t.beam)),this.ratioed="ratioed"in this.options?this.options.ratioed:Math.abs(this.notes_occupied-this.num_notes)>1,this.point=28,this.y_pos=16,this.x_pos=100,this.width=200,this.location=this.options.location||_.LOCATION_TOP,dt.AlignRestsToNotes(t,!0,!0),this.resolveGlyphs(),this.attach()}attach(){for(let t=0;t<this.notes.length;t++)this.notes[t].setTuplet(this)}detach(){for(let t=0;t<this.notes.length;t++)this.notes[t].resetTuplet(this)}setBracketed(t){return this.bracketed=!!t,this}setRatioed(t){return this.ratioed=!!t,this}setTupletLocation(t){if(t){if(t!==_.LOCATION_TOP&&t!==_.LOCATION_BOTTOM)throw new s.RERR("BadArgument","Invalid tuplet location: "+t)}else t=_.LOCATION_TOP;return this.location=t,this}getNotes(){return this.notes}getNoteCount(){return this.num_notes}beatsOccupiedDeprecationWarning(){const t=["beats_occupied has been deprecated as an ","option for tuplets. Please use notes_occupied ","instead. Calls to getBeatsOccupied and ","setBeatsOccupied should now be routed to ","getNotesOccupied and setNotesOccupied instead"].join("");console&&console.warn?console.warn(t):console&& (t)}getBeatsOccupied(){return this.beatsOccupiedDeprecationWarning(),this.getNotesOccupied()}setBeatsOccupied(t){return this.beatsOccupiedDeprecationWarning(),this.setNotesOccupied(t)}getNotesOccupied(){return this.notes_occupied}setNotesOccupied(t){this.detach(),this.notes_occupied=t,this.resolveGlyphs(),this.attach()}resolveGlyphs(){this.numerator_glyphs=[];let t=this.num_notes;for(;t>=1;)this.numerator_glyphs.unshift(new p("v"+t%10,this.point)),t=parseInt(t/10,10);for(this.denom_glyphs=[],t=this.notes_occupied;t>=1;)this.denom_glyphs.unshift(new p("v"+t%10,this.point)),t=parseInt(t/10,10)}getNestedTupletCount(){const t=this.location,e=this.notes[0];let i=s(e,t),n=s(e,t);function s(t,e){return t.tupletStack.filter((t=>t.location===e)).length}return this.notes.forEach((e=>{const r=s(e,t);i=r>i?r:i,n=r<n?r:n})),i-n}getYPosition(){const t=this.getNestedTupletCount()*_.NESTING_OFFSET*-this.location,e=this.options.y_offset||0,i=this.notes[0];let n;if(this.location===_.LOCATION_TOP){n=i.getStave().getYForLine(0)-15;for(let t=0;t<this.notes.length;++t){const e=this.notes[t].getStemDirection()===E.UP?this.notes[t].getStemExtents().topY-10:this.notes[t].getStemExtents().baseY-20;e<n&&(n=e)}}else{n=i.getStave().getYForLine(4)+20;for(let t=0;t<this.notes.length;++t){const e=this.notes[t].getStemDirection()===E.UP?this.notes[t].getStemExtents().baseY+20:this.notes[t].getStemExtents().topY+10;e>n&&(n=e)}}return n+t+e}draw(){this.checkContext(),this.setRendered();const t=this.notes[0],e=this.notes[this.notes.length-1];this.bracketed?(this.x_pos=t.getTieLeftX()-5,this.width=e.getTieRightX()-this.x_pos+5):(this.x_pos=t.getStemX(),this.width=e.getStemX()-this.x_pos),this.y_pos=this.getYPosition();const i=(t,e)=>t+e.getMetrics().width;let n=this.numerator_glyphs.reduce(i,0);this.ratioed&&(n=this.denom_glyphs.reduce(i,n),n+=.32*this.point);const s=this.x_pos+this.width/2-n/2;if(this.bracketed){const t=this.width/2-n/2-5;t>0&&(this.context.fillRect(this.x_pos,this.y_pos,t,1),this.context.fillRect(this.x_pos+this.width/2+n/2+5,this.y_pos,t,1),this.context.fillRect(this.x_pos,this.y_pos+(this.location===_.LOCATION_BOTTOM),1,10*this.location),this.context.fillRect(this.x_pos+this.width,this.y_pos+(this.location===_.LOCATION_BOTTOM),1,10*this.location))}let r=0;if(this.numerator_glyphs.forEach((t=>{t.render(this.context,s+r,this.y_pos+this.point/3-2),r+=t.getMetrics().width})),this.ratioed){const t=s+r+.16*this.point,e=.06*this.point;this.context.beginPath(),this.context.arc(t,this.y_pos-.08*this.point,e,0,2*Math.PI,!0),this.context.closePath(),this.context.fill(),this.context.beginPath(),this.context.arc(t,this.y_pos+.12*this.point,e,0,2*Math.PI,!0),this.context.closePath(),this.context.fill(),r+=.32*this.point,this.denom_glyphs.forEach((t=>{t.render(this.context,s+r,this.y_pos+this.point/3-2),r+=t.getMetrics().width}))}}}function w(t){let e=0;return t.forEach((t=>{t.keyProps&&t.keyProps.forEach((t=>{e+=t.line-3}))})),e>=0?E.DOWN:E.UP}const T="L",M="B";class P extends h{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 r).parse(t)));{const e=parseInt(t.split("/")[0],10),i=parseInt(t.split("/")[1],10);if(e%3==0)return[new r(3,i)];if(i>4)return[new r(2,i)];if(i<=4)return[new r(1,i)]}return[new r(1,4)]}static applyAndGetBeams(t,e,i){return P.generateBeams(t.getTickables(),{groups:i,stem_direction:e})}static generateBeams(t,e){e||(e={}),e.groups&&e.groups.length||(e.groups=[new r(2,8)]);const i=e.groups.map((t=>{if(!t.multiply)throw new s.RuntimeError("InvalidBeamGroups","The beam groups must be an array of Vex.Flow.Fractions");return t.clone().multiply(m.RESOLUTION,1)})),n=t;let o=0,a=[],l=[];function h(){i.length-1>o?o+=1:o=0}!function(){let t=[];n.forEach((e=>{if(t=[],e.shouldIgnoreTicks())return a.push(l),void(l=t);l.push(e);const n=i[o].clone(),s=l.reduce(((t,e)=>e.getTicks().clone().add(t)),new r(0,1)),c=m.durationToNumber(e.duration)<8;c&&e.tuplet&&(n.numerator*=2),s.greaterThan(n)?(c||t.push(l.pop()),a.push(l),l=t,h()):s.equals(n)&&(a.push(l),l=t,h())})),l.length>0&&a.push(l)}(),function(){const t=[];a.forEach((i=>{let n=[];i.forEach(((i,s,r)=>{const o=0===s||s===r.length-1,a=r[s-1],l=!e.beam_rests&&i.isRest(),h=e.beam_rests&&e.beam_middle_only&&i.isRest()&&o;let c=!1;if(e.maintain_stem_directions&&a&&!i.isRest()&&!a.isRest()){const t=a.getStemDirection();c=i.getStemDirection()!==t}const u=parseInt(i.duration,10)<8;l||h||c||u?(n.length>0&&t.push(n),n=c?[i]:[]):n.push(i)})),n.length>0&&t.push(n)})),a=t}(),a.forEach((t=>{let i;if(e.maintain_stem_directions){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():E.UP}else i=e.stem_direction?e.stem_direction:w(t);var n;n=i,t.forEach((t=>{t.setStemDirection(n)}))}));const c=a.filter((t=>{if(t.length>1){let e=!0;return t.forEach((t=>{t.getIntrinsicTicks()>=m.durationToTicks("4")&&(e=!1)})),e}return!1})),u=function(){const t=[];return a.forEach((e=>{let i=null;e.forEach((e=>{e.tuplet&&i!==e.tuplet&&(i=e.tuplet,t.push(i))}))})),t}(),d=[];return c.forEach((t=>{const i=new P(t);e.show_stemlets&&(i.render_options.show_stemlets=!0),e.secondary_breaks&&(i.render_options.secondary_break_ticks=m.durationToTicks(e.secondary_breaks)),!0===e.flat_beams&&(i.render_options.flat_beams=!0,i.render_options.flat_beam_offset=e.flat_beam_offset),d.push(i)})),u.forEach((t=>{const e=t.notes[0].stem_direction===E.DOWN?_.LOCATION_BOTTOM:_.LOCATION_TOP;t.setTupletLocation(e);let i=!1;for(let n=0;n<t.notes.length;n++)if(null===t.notes[n].beam){i=!0;break}t.setBracketed(i)})),d}constructor(t,e){if(super(),this.setAttribute("type","Beam"),!t||t===[])throw new s.RuntimeError("BadArguments","No notes provided for beam.");if(1===t.length)throw new s.RuntimeError("BadArguments","Too few notes for beam.");if(this.ticks=t[0].getIntrinsicTicks(),this.ticks>=m.durationToTicks("4"))throw new s.RuntimeError("BadArguments","Beams can only be applied to notes shorter than a quarter note.");let i,n;for(this.stem_direction=E.UP,i=0;i<t.length;++i)if(n=t[i],n.hasStem()){this.stem_direction=n.getStemDirection();break}let r=this.stem_direction;for(e&&"stavenotes"===t[0].getCategory()?r=w(t):e&&"tabnotes"===t[0].getCategory()&&(r=t.reduce(((t,e)=>t+e.stem_direction),0)>-1?E.UP:E.DOWN),i=0;i<t.length;++i)n=t[i],e&&(n.setStemDirection(r),this.stem_direction=r),n.setBeam(this);this.postFormatted=!1,this.notes=t,this.beam_count=this.getBeamCount(),this.break_on_indices=[],this.render_options={beam_width:5,max_slope:.25,min_slope:-.25,slope_iterations:20,slope_cost:100,show_stemlets:!1,stemlet_extension:7,partial_beam_length:10,flat_beams:!1,min_flat_beam_offset:15}}getNotes(){return this.notes}getBeamCount(){return this.notes.map((t=>t.getGlyph().beam_count)).reduce(((t,e)=>e>t?e:t))}breakSecondaryAt(t){return this.break_on_indices=t,this}getSlopeY(t,e,i,n){return i+(t-e)*n}calculateSlope(){const{notes:t,stem_direction:e,render_options:{max_slope:i,min_slope:n,slope_iterations:s,slope_cost:r}}=this,o=t[0],a=((t,e)=>{const i=t.getStemExtents().topY,n=t.getStemX();return(e.getStemExtents().topY-i)/(e.getStemX()-n)})(o,t[t.length-1]),l=(i-n)/s;let h=Number.MAX_VALUE,c=0,u=0;for(let d=n;d<=i;d+=l){let i=0,n=0;for(let r=1;r<t.length;++r){const s=t[r],a=this.getSlopeY(s.getStemX(),o.getStemX(),o.getStemExtents().topY,d)+n,l=s.getStemExtents().topY;if(l*e<a*e){const t=Math.abs(l-a);n+=t*-e,i+=t*r}else i+=(l-a)*e}const s=a/2,l=r*Math.abs(s-d)+Math.abs(i);l<h&&(h=l,c=d,u=n)}this.slope=c,this.y_shift=u}calculateFlatSlope(){const{notes:t,stem_direction:e,render_options:{beam_width:i,min_flat_beam_offset:n,flat_beam_offset:s}}=this;let r=0,o=0,a=0,l=0;for(let d=0;d<t.length;d++){const i=t[d],n=i.getStemExtents().topY;r+=n,e===E.DOWN&&l<n?(l=n,o=Math.max(...i.getYs()),a=i.getBeamCount()):e===E.UP&&(0===l||l>n)&&(l=n,o=Math.min(...i.getYs()),a=i.getBeamCount())}let h=r/t.length;const c=n+a*(1.5*i),u=o+c*-e;e===E.DOWN&&h<u?h=o+c:e===E.UP&&h>u&&(h=o-c),s+this.render_options.flat_beam_offset_per_beam>0?(e===E.DOWN&&h>s&&!this.render_options.flat_beams||e===E.UP&&h<s&&!this.render_options.flat_beams)&&(this.render_options.flat_beam_offset=h):this.render_options.flat_beam_offset=h,this.slope=0,this.y_shift=0}getBeamYToDraw(){let t=this.notes[0].getStemExtents().topY;if(this.render_options.flat_beams&&this.render_options.flat_beam_offset+this.render_options.flat_beam_offset_per_beam>0){let e=this.render_options.flat_beam_offset;this.render_options.flat_beam_offset_per_beam&&(e+=this.render_options.flat_beam_offset_per_beam*this.getBeamCount());let i=this.notes[0].note_heads[0].y;const n=this.stem_direction>0?Math.min:Math.max;for(const t of this.notes)for(const e of t.note_heads)i=n(i,e.y);t=i+e*-this.stem_direction}return t}applyStemExtensions(){const{notes:t,slope:e,y_shift:i,stem_direction:n,beam_count:s,render_options:{show_stemlets:r,stemlet_extension:o,beam_width:a}}=this,l=t[0],h=this.getBeamYToDraw(),c=l.getStemX();for(let u=0;u<t.length;++u){const l=t[u],d=l.getStemX(),{topY:f}=l.getStemExtents(),p=this.getSlopeY(d,c,h,e)+i,m=l.getStem().getExtension(),b=n===E.UP?f-p:p-f;if(l.stem.setExtension(m+b),l.stem.renderHeightAdjustment=-E.WIDTH/2,l.isRest()&&r){const t=(s-1)*a*1.5+a;l.stem.setVisibility(!0).setStemlet(!0,t+o)}}}lookupBeamDirection(t,e,i,n){if("4"===t)return T;const s=""+m.durationToNumber(t)/2,r=e<m.durationToTicks(s),o=n<m.durationToTicks(s),a=i<m.durationToTicks(s);return r&&o&&a?M:r&&!o&&a?T:!r&&o&&a?"R":this.lookupBeamDirection(s,e,i,n)}getBeamLines(t){const e=m.durationToTicks(t),i=[];let n=!1,s=null;const r=this.render_options.partial_beam_length;let o=!1,a=0;for(let h=0;h<this.notes.length;++h){const l=this.notes[h];a+=l.ticks.value();let c=!1;parseInt(t,10)>=8&&(c=-1!==this.break_on_indices.indexOf(h),this.render_options.secondary_break_ticks&&a>=this.render_options.secondary_break_ticks&&(a=0,c=!0));const u=l.getIntrinsicTicks()<e,d=l.getStemX()-E.WIDTH/2,f=this.notes[h-1],p=this.notes[h+1],m=p&&p.getIntrinsicTicks()<e,b=f&&f.getIntrinsicTicks()<e,g=f&&p&&u&&!b&&!m;if(u)if(n)s=i[i.length-1],s.end=d,c&&(n=!1,p&&!m&&null===s.end&&(s.end=s.start-r));else{if(s={start:d,end:null},n=!0,g){const e=f.getIntrinsicTicks(),i=p.getIntrinsicTicks(),n=l.getIntrinsicTicks(),o=this.lookupBeamDirection(t,e,n,i);[T,M].includes(o)?s.end=s.start-r:s.end=s.start+r}else m?c&&(s.end=s.start-r,n=!1):s.end=(o||0===h)&&p?s.start+r:s.start-r;i.push(s)}else n=!1;o=c}const l=i[i.length-1];return l&&null===l.end&&(l.end=l.start-r),i}drawStems(){this.notes.forEach((t=>{t.getStem()&&t.getStem().setContext(this.context).draw()}),this)}drawBeamLines(){this.checkContext();const t=["4","8","16","32","64"],e=this.notes[0];let i=this.getBeamYToDraw();const n=e.getStemX(),s=this.render_options.beam_width*this.stem_direction;for(let r=0;r<t.length;++r){const e=t[r],o=this.getBeamLines(e);for(let t=0;t<o.length;++t){const e=o[t],r=e.start,a=this.getSlopeY(r,n,i,this.slope),l=e.end,h=this.getSlopeY(l,n,i,this.slope);this.context.beginPath(),this.context.moveTo(r,a),this.context.lineTo(r,a+s),this.context.lineTo(l+1,h+s),this.context.lineTo(l+1,h),this.context.closePath(),this.context.fill()}i+=1.5*s}}preFormat(){return this}postFormat(){this.postFormatted||("tabnotes"===this.notes[0].getCategory()||this.render_options.flat_beams?this.calculateFlatSlope():this.calculateSlope(),this.applyStemExtensions(),this.postFormatted=!0)}draw(){this.checkContext(),this.setRendered(),this.unbeamable||(this.postFormatted||this.postFormat(),this.drawStems(),this.applyStyle(),this.drawBeamLines(),this.restoreStyle())}}class L extends h{static get Mode(){return{STRICT:1,SOFT:2,FULL:3}}constructor(t){if(super(),this.setAttribute("type","Voice"),"string"==typeof t){const e=t.match(/(\d+)\/(\d+)/);e&&(t={num_beats:e[1],beat_value:e[2],resolution:m.RESOLUTION})}this.time=s.Merge({num_beats:4,beat_value:4,resolution:m.RESOLUTION},t),this.totalTicks=new r(this.time.num_beats*(this.time.resolution/this.time.beat_value),1),this.resolutionMultiplier=1,this.tickables=[],this.ticksUsed=new r(0,1),this.smallestTickCount=this.totalTicks.clone(),this.largestTickWidth=0,this.stave=null,this.mode=L.Mode.STRICT,this.voiceGroup=null}getTotalTicks(){return this.totalTicks}getTicksUsed(){return this.ticksUsed}getLargestTickWidth(){return this.largestTickWidth}getSmallestTickCount(){return this.smallestTickCount}getTickables(){return this.tickables}getMode(){return this.mode}setMode(t){return this.mode=t,this}getResolutionMultiplier(){return this.resolutionMultiplier}getActualResolution(){return this.resolutionMultiplier*this.time.resolution}setStave(t){return this.stave=t,this.boundingBox=null,this}getBoundingBox(){let t,e,i,n;if(!this.boundingBox){if(!this.stave)throw new s.RERR("NoStave","Can't get bounding box without stave.");for(t=this.stave,e=null,n=0;n<this.tickables.length;++n)this.tickables[n].setStave(t),i=this.tickables[n].getBoundingBox(),i&&(e=e?e.mergeWith(i):i);this.boundingBox=e}return this.boundingBox}getVoiceGroup(){if(!this.voiceGroup)throw new s.RERR("NoVoiceGroup","No voice group for voice.");return this.voiceGroup}setVoiceGroup(t){return this.voiceGroup=t,this}setStrict(t){return this.mode=t?L.Mode.STRICT:L.Mode.SOFT,this}isComplete(){return this.mode!==L.Mode.STRICT&&this.mode!==L.Mode.FULL||this.ticksUsed.equals(this.totalTicks)}addTickable(t){if(!t.shouldIgnoreTicks()){const e=t.getTicks();if(this.ticksUsed.add(e),(this.mode===L.Mode.STRICT||this.mode===L.Mode.FULL)&&this.ticksUsed.greaterThan(this.totalTicks))throw this.ticksUsed.subtract(e),new s.RERR("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(){return this.preFormatted||(this.tickables.forEach((t=>{t.getStave()||t.setStave(this.stave)})),this.preFormatted=!0),this}draw(t=this.context,e=this.stave){this.setRendered();let i=null;for(let n=0;n<this.tickables.length;++n){const r=this.tickables[n];if(e&&r.setStave(e),!r.getStave())throw new s.RuntimeError("MissingStave","The voice cannot draw tickables without staves.");if(0===n&&(i=r.getBoundingBox()),n>0&&i){const t=r.getBoundingBox();t&&i.mergeWith(t)}r.setContext(t),r.drawWithStyle()}this.boundingBox=i}}function A(t,e,i,n,r){if(e!==C.type.BOLD_DOUBLE_LEFT&&e!==C.type.BOLD_DOUBLE_RIGHT)throw new s.RERR("InvalidConnector","A REPEAT_BEGIN or REPEAT_END type must be provided.");let o=3,a=3.5;e===C.type.BOLD_DOUBLE_RIGHT&&(o=-5,a=3),t.fillRect(i+o,n,1,r-n),t.fillRect(i-2,n,a,r-n)}class C extends h{static get type(){return{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}}static get typeString(){return{singleRight:C.type.SINGLE_RIGHT,singleLeft:C.type.SINGLE_LEFT,single:C.type.SINGLE,double:C.type.DOUBLE,brace:C.type.BRACE,bracket:C.type.BRACKET,boldDoubleLeft:C.type.BOLD_DOUBLE_LEFT,boldDoubleRight:C.type.BOLD_DOUBLE_RIGHT,thinDouble:C.type.THIN_DOUBLE,none:C.type.NONE}}constructor(t,e){super(),this.setAttribute("type","StaveConnector"),this.thickness=m.STAVE_LINE_THICKNESS,this.width=3,this.top_stave=t,this.bottom_stave=e,this.type=C.type.DOUBLE,this.font={family:"times",size:16,weight:"normal"},this.x_shift=0,this.texts=[]}setType(t){return(t="string"==typeof t?C.typeString[t]:t)>=C.type.SINGLE_RIGHT&&t<=C.type.NONE&&(this.type=t),this}setText(t,e){return this.texts.push({content:t,options:s.Merge({shift_x:0,shift_y:0},e)}),this}setFont(t){s.Merge(this.font,t)}setXShift(t){if("number"!=typeof t)throw s.RERR("InvalidType","x_shift must be a Number");return this.x_shift=t,this}draw(){const t=this.checkContext();this.setRendered();let e=this.top_stave.getYForLine(0),i=this.bottom_stave.getYForLine(this.bottom_stave.getNumLines()-1)+this.thickness,n=this.width,r=this.top_stave.getX();(this.type===C.type.SINGLE_RIGHT||this.type===C.type.BOLD_DOUBLE_RIGHT||this.type===C.type.THIN_DOUBLE)&&(r=this.top_stave.getX()+this.top_stave.width);let o=i-e;switch(this.type){case C.type.SINGLE:case C.type.SINGLE_LEFT:case C.type.SINGLE_RIGHT:n=1;break;case C.type.DOUBLE:r-=this.width+2;break;case C.type.BRACE:{n=12;const s=this.top_stave.getX()-2+this.x_shift,r=e,a=s,l=i,h=s-n,c=r+o/2,u=h-.9*n,d=r+.2*o,f=s+1.1*n,p=c-.135*o,m=f,b=c+.135*o,g=u,y=l-.2*o,S=h-n,v=y,x=s+.4*n,E=c+.135*o,_=x,w=c-.135*o,T=S,M=d;t.beginPath(),t.moveTo(s,r),t.bezierCurveTo(u,d,f,p,h,c),t.bezierCurveTo(m,b,g,y,a,l),t.bezierCurveTo(S,v,x,E,h,c),t.bezierCurveTo(_,w,T,M,s,r),t.fill(),t.stroke();break}case C.type.BRACKET:e-=4,i+=4,o=i-e,p.renderGlyph(t,r-5,e-3,40,"v1b",!0),p.renderGlyph(t,r-5,i+3,40,"v10",!0),r-=this.width+2;break;case C.type.BOLD_DOUBLE_LEFT:A(t,this.type,r+this.x_shift,e,i);break;case C.type.BOLD_DOUBLE_RIGHT:A(t,this.type,r,e,i);break;case C.type.THIN_DOUBLE:n=1;break;case C.type.NONE:break;default:throw new s.RERR("InvalidType",`The provided StaveConnector.type (${this.type}) is invalid`)}this.type!==C.type.BRACE&&this.type!==C.type.BOLD_DOUBLE_LEFT&&this.type!==C.type.BOLD_DOUBLE_RIGHT&&this.type!==C.type.NONE&&t.fillRect(r,e,n,o),this.type===C.type.THIN_DOUBLE&&t.fillRect(r-3,e,n,o),t.save(),t.lineWidth=2,t.setFont(this.font.family,this.font.size,this.font.weight);for(let s=0;s<this.texts.length;s++){const e=this.texts[s],i=t.measureText(""+e.content).width,n=this.top_stave.getX()-i-24+e.options.shift_x,r=(this.top_stave.getYForLine(0)+this.bottom_stave.getBottomLineY())/2+e.options.shift_y;t.fillText(""+e.content,n,r+4)}t.restore()}}class I extends h{constructor(){super(),this.setAttribute("type","Tickable"),this.ticks=new r(0,1),this.intrinsicTicks=0,this.tickMultiplier=new r(1,1),this.width=0,this.x_shift=0,this.voice=null,this.tickContext=null,this.modifierContext=null,this.modifiers=[],this.preFormatted=!1,this.postFormatted=!1,this.tuplet=null,this.tupletStack=[],this.align_center=!1,this.center_x_shift=0,this.ignore_ticks=!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.ignore_ticks}getWidth(){return this.width}getFormatterMetrics(){return this.formatterMetrics}setXShift(t){this.x_shift=t}getCenterXShift(){return this.isCenterAligned()?this.center_x_shift:0}isCenterAligned(){return this.align_center}setCenterAlignment(t){return this.align_center=t,this}getVoice(){if(!this.voice)throw new s.RERR("NoVoice","Tickable has no voice.");return this.voice}setVoice(t){this.voice=t}getTuplet(){return this.tuplet}resetTuplet(t){let e,i;if(t){const n=this.tupletStack.indexOf(t);return-1!==n&&(this.tupletStack.splice(n,1),e=t.getNoteCount(),i=t.getNotesOccupied(),this.applyTickMultiplier(e,i)),this}for(;this.tupletStack.length;)e=(t=this.tupletStack.pop()).getNoteCount(),i=t.getNotesOccupied(),this.applyTickMultiplier(e,i);return this}setTuplet(t){if(t){this.tupletStack.push(t);const e=t.getNoteCount(),i=t.getNotesOccupied();this.applyTickMultiplier(i,e)}return this.tuplet=t,this}addToModifierContext(t){this.modifierContext=t,this.preFormatted=!1}addModifier(t){return this.modifiers.push(t),this.preFormatted=!1,this}getModifiers(){return this.modifiers}setTickContext(t){this.tickContext=t,this.preFormatted=!1}preFormat(){this.preFormatted||(this.width=0,this.modifierContext&&(this.modifierContext.preFormat(),this.width+=this.modifierContext.getWidth()))}postFormat(){return this.postFormatted||(this.postFormatted=!0),this}getIntrinsicTicks(){return this.intrinsicTicks}setIntrinsicTicks(t){this.intrinsicTicks=t,this.ticks=this.tickMultiplier.clone().multiply(this.intrinsicTicks)}getTickMultiplier(){return this.tickMultiplier}applyTickMultiplier(t,e){this.tickMultiplier.multiply(t,e),this.ticks=this.tickMultiplier.clone().multiply(this.intrinsicTicks)}setDuration(t){const e=t.numerator*(m.RESOLUTION/t.denominator);this.ticks=this.tickMultiplier.clone().multiply(e),this.intrinsicTicks=this.ticks.value()}}class R extends I{static get CATEGORY(){return"note"}static get STAVEPADDING(){return 12}static plotMetrics(t,e,i){const n=e.getMetrics(),r=e.getAbsoluteX()-n.modLeftPx-n.extraLeftPx,o=e.getAbsoluteX()-n.extraLeftPx,a=e.getAbsoluteX(),l=e.getAbsoluteX()+n.noteWidth,h=e.getAbsoluteX()+n.noteWidth+n.extraRightPx,c=e.getAbsoluteX()+n.noteWidth+n.extraRightPx+n.modRightPx,u=c+e.getFormatterMetrics().freedom.right,d=c-r;t.save(),t.setFont("Arial",8,""),t.fillText(Math.round(d)+"px",r+e.getXShift(),i);const f=i+7;function p(i,n,s,r=f){t.beginPath(),t.setStrokeStyle(s),t.setFillStyle(s),t.setLineWidth(3),t.moveTo(i+e.getXShift(),r),t.lineTo(n+e.getXShift(),r),t.stroke()}p(r,o,"red"),p(o,a,"#999"),p(a,l,"green"),p(l,h,"#999"),p(h,c,"red"),p(c,u,"#DD0"),p(r-e.getXShift(),r,"#BBB"),s.drawDot(t,a+e.getXShift(),f,"blue");const m=e.getFormatterMetrics();if(m.iterations>0){const n=m.space.deviation,s=n>=0?"+":"";t.setFillStyle("red"),t.fillText(s+Math.round(n),a+e.getXShift(),i-10)}t.restore()}constructor(t){if(super(),this.setAttribute("type","Note"),!t)throw new s.RuntimeError("BadArguments","Note must have valid initialization data to identify duration and type.");const e=m.parseNoteStruct(t);if(!e)throw new s.RuntimeError("BadArguments",`Invalid note initialization object: ${JSON.stringify(t)}`);if(this.duration=e.duration,this.dots=e.dots,this.noteType=e.type,this.customTypes=e.customTypes,t.duration_override?this.setDuration(t.duration_override):this.setIntrinsicTicks(e.ticks),this.modifiers=[],this.glyph=m.getGlyphProps(this.duration,this.noteType),this.customGlyphs=this.customTypes.map((t=>m.getGlyphProps(this.duration,t))),this.positions&&("object"!=typeof this.positions||!this.positions.length))throw new s.RuntimeError("BadArguments","Note keys must be array type.");this.playNote=null,this.tickContext=null,this.modifierContext=null,this.ignore_ticks=!1,this.width=0,this.extraLeftPx=0,this.extraRightPx=0,this.x_shift=0,this.left_modPx=0,this.right_modPx=0,this.voice=null,this.preFormatted=!1,this.ys=[],t.align_center&&this.setCenterAlignment(t.align_center),this.stave=null,this.render_options={annotation_spacing:5,stave_padding:R.STAVEPADDING}}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.setPreFormatted(!1),this}getStave(){return this.stave}setStave(t){return this.stave=t,this.setYs([t.getYForLine(0)]),this.context=this.stave.context,this}getCategory(){return R.CATEGORY}setContext(t){return this.context=t,this}getExtraLeftPx(){return this.extraLeftPx}getExtraRightPx(){return this.extraRightPx}setExtraLeftPx(t){return this.extraLeftPx=t,this}setExtraRightPx(t){return this.extraRightPx=t,this}shouldIgnoreTicks(){return this.ignore_ticks}getLineNumber(){return 0}getLineForRest(){return 0}getGlyph(){return this.glyph}getGlyphWidth(){return this.glyph.getWidth(this.render_options.glyph_font_scale)}setYs(t){return this.ys=t,this}getYs(){if(0===this.ys.length)throw new s.RERR("NoYValues","No Y-values calculated for this note.");return this.ys}getYForTopText(t){if(!this.stave)throw new s.RERR("NoStave","No stave attached to this note.");return this.stave.getYForTopText(t)}getBoundingBox(){return null}getVoice(){if(!this.voice)throw new s.RERR("NoVoice","Note has no voice.");return this.voice}setVoice(t){return this.voice=t,this.preFormatted=!1,this}getTickContext(){return this.tickContext}setTickContext(t){return this.tickContext=t,this.preFormatted=!1,this}getDuration(){return this.duration}isDotted(){return this.dots>0}hasStem(){return!1}getDots(){return this.dots}getNoteType(){return this.noteType}setBeam(){return this}setModifierContext(t){return this.modifierContext=t,this}addModifier(t,e=0){return t.setNote(this),t.setIndex(e),this.modifiers.push(t),this.setPreFormatted(!1),this}getModifierStartXY(){if(!this.preFormatted)throw new s.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");return{x:this.getAbsoluteX(),y:this.ys[0]}}getMetrics(){if(!this.preFormatted)throw new s.RERR("UnformattedNote","Can't call getMetrics on an unformatted note.");let t=0,e=0;null!=this.modifierContext&&(t=this.modifierContext.state.left_shift,e=this.modifierContext.state.right_shift);const i=this.getWidth();return{width:i,noteWidth:i-t-e-this.extraLeftPx-this.extraRightPx,left_shift:this.x_shift,modLeftPx:t,modRightPx:e,extraLeftPx:this.extraLeftPx,extraRightPx:this.extraRightPx}}setWidth(t){this.width=t}getWidth(){if(!this.preFormatted)throw new s.RERR("UnformattedNote","Can't call GetWidth on an unformatted note.");return this.width+(this.modifierContext?this.modifierContext.getWidth():0)}setXShift(t){return this.x_shift=t,this}getXShift(){return this.x_shift}getX(){if(!this.tickContext)throw new s.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");return this.tickContext.getX()+this.x_shift}getAbsoluteX(){if(!this.tickContext)throw new s.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");let t=this.tickContext.getX();return this.stave&&(t+=this.stave.getNoteStartX()+this.render_options.stave_padding),this.isCenterAligned()&&(t+=this.getCenterXShift()),t}setPreFormatted(t){if(this.preFormatted=t,this.preFormatted){const t=this.tickContext.getExtraPx();this.left_modPx=Math.max(this.left_modPx,t.left),this.right_modPx=Math.max(this.right_modPx,t.right)}}}class N extends R{static get CATEGORY(){return"notehead"}constructor(t){if(super(t),this.setAttribute("type","NoteHead"),this.index=t.index,this.x=t.x||0,this.y=t.y||0,this.note_type=t.note_type,this.duration=t.duration,this.displaced=t.displaced||!1,this.stem_direction=t.stem_direction||k.STEM_UP,this.line=t.line,this.glyph=m.getGlyphProps(this.duration,this.note_type),!this.glyph)throw new s.RuntimeError("BadArguments",`No glyph found for duration '${this.duration}' and type '${this.note_type}'`);this.glyph_code=this.glyph.code_head,this.x_shift=t.x_shift||0,t.custom_glyph_code&&(this.custom_glyph=!0,this.glyph_code=t.custom_glyph_code,this.stem_up_x_offset=t.stem_up_x_offset||0,this.stem_down_x_offset=t.stem_down_x_offset||0),this.style=t.style,this.slashed=t.slashed,s.Merge(this.render_options,{glyph_font_scale:t.glyph_font_scale||m.DEFAULT_NOTATION_FONT_SCALE,stroke_px:3}),this.setWidth(this.glyph.getWidth(this.render_options.glyph_font_scale))}getCategory(){return N.CATEGORY}getWidth(){return this.width}isDisplaced(){return!0===this.displaced}getGlyph(){return this.glyph}setX(t){return this.x=t,this}getY(){return this.y}setY(t){return this.y=t,this}getLine(){return this.line}setLine(t){return this.line=t,this}getAbsoluteX(){const t=this.preFormatted?super.getAbsoluteX():this.x,e=E.WIDTH/2;return t+(this.displaced?(this.width-e)*this.stem_direction:0)}getBoundingBox(){if(!this.preFormatted)throw new s.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const t=this.stave.getSpacingBetweenLines(),e=t/2,i=this.y-e;return new m.BoundingBox(this.getAbsoluteX(),i,this.width,t)}setStave(t){const e=this.getLine();return this.stave=t,this.setY(t.getYForNote(e)),this.context=this.stave.context,this}preFormat(){if(this.preFormatted)return this;const t=this.getWidth()+this.extraLeftPx+this.extraRightPx;return this.setWidth(t),this.setPreFormatted(!0),this}draw(){this.checkContext(),this.setRendered();const t=this.context;let e=this.getAbsoluteX();this.custom_glyph&&(e+=this.stem_direction===E.UP?this.stem_up_x_offset:this.stem_down_x_offset);const i=this.y;!function(...t){N.DEBUG&&s.L("Vex.Flow.NoteHead",t)}("Drawing note head '",this.note_type,this.duration,"' at",e,i);const n=this.stem_direction,r=this.render_options.glyph_font_scale;if(this.style&&this.applyStyle(t),"s"===this.note_type){const s=this.stave.getSpacingBetweenLines();!function(t,e,i,n,s,r){const o=m.SLASH_NOTEHEAD_WIDTH;t.save(),t.setLineWidth(m.STEM_WIDTH);let a=!1;if(m.durationToNumber(e)>2&&(a=!0),a||(i-=m.STEM_WIDTH/2*s),t.beginPath(),t.moveTo(i,n+r),t.lineTo(i,n+1),t.lineTo(i+o,n-r),t.lineTo(i+o,n),t.lineTo(i,n+r),t.closePath(),a?t.fill():t.stroke(),m.durationToFraction(e).equals(.5)){const e=[-3,-1,o+1,o+3];for(let s=0;s<e.length;s++)t.beginPath(),t.moveTo(i+e[s],n-10),t.lineTo(i+e[s],n+11),t.stroke()}t.restore()}(t,this.duration,e,i,n,s)}else p.renderGlyph(t,e,i,r,this.glyph_code);this.style&&this.restoreStyle(t)}}class F extends R{constructor(t){super(t),this.setAttribute("type","StemmableNote"),this.stem=null,this.stemExtensionOverride=null,this.beam=null}getStem(){return this.stem}setStem(t){return this.stem=t,this}buildStem(){const t=new E;return this.setStem(t),this}buildFlag(){const{glyph:t,beam:e}=this,i=null===e;if(t&&t.flag&&i){const e=this.getStemDirection()===E.DOWN?t.code_flag_downstem:t.code_flag_upstem;this.flag=new p(e,this.render_options.glyph_font_scale)}}getTopGlyph(){return this.getStemDirection()===E.DOWN?this.customGlyphs[this.customGlyphs.length-1]:this.customGlyphs[0]}getStemLength(){return E.HEIGHT+this.getStemExtension()}getBeamCount(){const t=this.getGlyph();return t?t.beam_count:0}getStemMinumumLength(){let t=m.durationToFraction(this.duration).value()<=1?0:20;switch(this.duration){case"8":null==this.beam&&(t=35);break;case"16":t=null==this.beam?35:25;break;case"32":t=null==this.beam?45:35;break;case"64":t=null==this.beam?50:40;break;case"128":t=null==this.beam?55:45}return t}getStemDirection(){return this.stem_direction}setStemDirection(t){if(t||(t=E.UP),t!==E.UP&&t!==E.DOWN)throw new s.RERR("BadArgument",`Invalid stem direction: ${t}`);if(this.stem_direction=t,this.stem){this.stem.setDirection(t),this.stem.setExtension(this.getStemExtension());const e=this.getTopGlyph()||this.getGlyph();this.stem.setOptions({stem_up_y_offset:e.stem_up_y_offset,stem_down_y_offset:e.stem_down_y_offset})}return this.reset(),this.flag&&this.buildFlag(),this.beam=null,this.preFormatted&&this.preFormat(),this}getStemX(){const t=this.getAbsoluteX()+this.x_shift,e=this.getAbsoluteX()+this.x_shift+this.getGlyphWidth();return this.stem_direction===E.DOWN?t:e}getCenterGlyphX(){return this.getAbsoluteX()+this.x_shift+this.getGlyphWidth()/2}getStemExtension(){const t=this.getGlyph();return null!=this.stemExtensionOverride?this.stemExtensionOverride:t?1===this.getStemDirection()?t.stem_up_extension:t.stem_down_extension:0}setStemLength(t){return this.stemExtensionOverride=t-E.HEIGHT,this}getStemExtents(){return this.stem.getExtents()}setBeam(t){return this.beam=t,this}getYForTopText(t){const e=this.getStemExtents();return this.hasStem()?Math.min(this.stave.getYForTopText(t),e.topY-this.render_options.annotation_spacing*(t+1)):this.stave.getYForTopText(t)}getYForBottomText(t){const e=this.getStemExtents();return this.hasStem()?Math.max(this.stave.getYForTopText(t),e.baseY+this.render_options.annotation_spacing*t):this.stave.getYForBottomText(t)}hasFlag(){return m.getGlyphProps(this.duration).flag&&!this.beam}postFormat(){return this.beam&&this.beam.postFormat(),this.postFormatted=!0,this}drawStem(t){this.checkContext(),this.setRendered(),this.setStem(new E(t)),this.stem.setContext(this.context).draw()}}class B extends h{static get CATEGORY(){return"none"}static get Position(){return{LEFT:1,RIGHT:2,ABOVE:3,BELOW:4}}static get PositionString(){return{above:B.Position.ABOVE,below:B.Position.BELOW,left:B.Position.LEFT,right:B.Position.RIGHT}}constructor(){super(),this.setAttribute("type","Modifier"),this.width=0,this.note=null,this.index=null,this.text_line=0,this.position=B.Position.LEFT,this.modifier_context=null,this.x_shift=0,this.y_shift=0,this.spacingFromNextModifier=0}getCategory(){return B.CATEGORY}getWidth(){return this.width}setWidth(t){return this.width=t,this}getNote(){return this.note}setNote(t){return this.note=t,this}getIndex(){return this.index}setIndex(t){return this.index=t,this}getModifierContext(){return this.modifier_context}setModifierContext(t){return this.modifier_context=t,this}getPosition(){return this.position}setPosition(t){return this.position="string"==typeof t?B.PositionString[t]:t,this}setTextLine(t){return this.text_line=t,this}setYShift(t){return this.y_shift=t,this}setSpacingFromNextModifier(t){this.spacingFromNextModifier=t}getSpacingFromNextModifier(){return this.spacingFromNextModifier}setXShift(t){this.x_shift=0,this.position===B.Position.LEFT?this.x_shift-=t:this.x_shift+=t}getXShift(){return this.x_shift}draw(){throw this.checkContext(),new s.RERR("MethodNotImplemented","draw() not implemented for this modifier.")}alignSubNotesWithNote(t,e){const i=e.getTickContext(),n=i.getExtraPx(),s=i.getX()-n.left-n.extraLeft+this.getSpacingFromNextModifier();t.forEach((t=>{const i=t.getTickContext();t.setStave(e.stave),i.setXOffset(s)}))}}class O extends B{static get CATEGORY(){return"dots"}static format(t,e){const i=e.right_shift;if(!t||0===t.length)return!1;const n=[],s={};for(let u=0;u<t.length;++u){const e=t[u],i=e.getNote();let r,o;"function"==typeof i.getKeyProps?(r=i.getKeyProps()[e.getIndex()],o=r.displaced?i.getExtraRightPx():0):(r={line:.5},o=0);const a=i.getAttribute("id");n.push({line:r.line,note:i,note_id:a,dot:e}),s[a]=Math.max(s[a]||o,o)}n.sort(((t,e)=>e.line-t.line));let r=i,o=0,a=null,l=null,h=null,c=0;for(let u=0;u<n.length;++u){const{dot:t,note:e,note_id:i,line:d}=n[u];d===a&&e===l||(r=s[i]),e.isRest()||d===a||(.5===Math.abs(d%1)?c=0:(c=.5,null==l||l.isRest()||a-d!=.5?d+c===h&&(c=-.5):c=-.5)),e.isRest()?t.dot_shiftY+=-c:t.dot_shiftY=-c,h=d+c,t.setXShift(r),r+=t.getWidth()+1,o=r>o?r:o,a=d,l=e}return e.right_shift+=o,!0}constructor(){super(),this.setAttribute("type","Dot"),this.note=null,this.index=null,this.position=B.Position.RIGHT,this.radius=2,this.setWidth(5),this.dot_shiftY=0}getCategory(){return O.CATEGORY}setNote(t){this.note=t,"gracenotes"===this.note.getCategory()&&(this.radius*=.5,this.setWidth(3))}setDotShiftY(t){return this.dot_shiftY=t,this}draw(){if(this.checkContext(),this.setRendered(),!this.note||null===this.index)throw new s.RERR("NoAttachedNote","Can't draw dot without a note and index.");const t=this.note.stave.options.spacing_between_lines_px,e=this.note.getModifierStartXY(this.position,this.index,{forceFlagRight:!0});"tabnotes"===this.note.getCategory()&&(e.y=this.note.getStemExtents().baseY);const i=e.x+this.x_shift+this.width-this.radius,n=e.y+this.y_shift+this.dot_shiftY*t,r=this.context;r.beginPath(),r.arc(i,n,this.radius,0,2*Math.PI,!1),r.fill()}}function D(t,e,i){const n=(e.isrest?0:1)*i;t.line+=n,t.maxLine+=n,t.minLine+=n,t.note.setKeyLine(0,t.note.getKeyLine(0)+n)}class k extends F{static get CATEGORY(){return"stavenotes"}static get STEM_UP(){return E.UP}static get STEM_DOWN(){return E.DOWN}static get DEFAULT_LEDGER_LINE_OFFSET(){return 3}static format(t,e){if(!t||t.length<2)return!1;if(t[0].getStave())return k.formatByY(t,e);const i=[];for(let s=0;s<t.length;s++){const e=t[s].getKeyProps(),n=e[0].line;let r=e[e.length-1].line;const o=t[s].getStemDirection(),a=t[s].getStemLength()/10,l=t[s].getStemMinumumLength()/10;let h;t[s].isRest()?(h=n+t[s].glyph.line_above,r=n-t[s].glyph.line_below):(h=1===o?e[e.length-1].line+a:e[e.length-1].line,r=1===o?e[0].line:e[0].line-a),i.push({line:e[0].line,maxLine:h,minLine:r,isrest:t[s].isRest(),stemDirection:o,stemMax:a,stemMin:l,voice_shift:t[s].getVoiceShiftWidth(),is_displaced:t[s].isDisplaced(),note:t[s]})}const n=i.length;let r=i[0];const o=n>2?i[1]:null;let a=n>2?i[2]:i[1];2===n&&-1===r.stemDirection&&1===a.stemDirection&&(r=i[1],a=i[0]);const l=Math.max(r.voice_shift,a.voice_shift);let h,c=0;if(2===n){const t=r.stemDirection===a.stemDirection?0:.5;return r.stemDirection===a.stemDirection&&r.minLine<=a.maxLine&&(r.isrest||(h=Math.abs(r.line-(a.maxLine+.5)),h=Math.max(h,r.stemMin),r.minLine=r.line-h,r.note.setStemLength(10*h))),r.minLine<=a.maxLine+t&&(r.isrest?D(r,a,1):a.isrest?D(a,r,-1):(c=l,r.stemDirection===a.stemDirection?r.note.setXShift(c+3):a.note.setXShift(c))),!0}return null!==o&&o.minLine<a.maxLine+.5&&(o.isrest||(h=Math.abs(o.line-(a.maxLine+.5)),h=Math.max(h,o.stemMin),o.minLine=o.line-h,o.note.setStemLength(10*h))),o.isrest&&!r.isrest&&!a.isrest&&(r.minLine<=o.maxLine||o.minLine<=a.maxLine)?(o.maxLine-o.minLine<r.minLine-a.maxLine?function(t,e,i){const n=t.line-s.MidLine(e.minLine,i.maxLine);t.note.setKeyLine(0,t.note.getKeyLine(0)-n),t.line-=n,t.maxLine-=n,t.minLine-=n}(o,r,a):(c=l+3,o.note.setXShift(c)),!0):r.isrest&&o.isrest&&a.isrest?(D(r,o,1),D(a,o,-1),!0):(o.isrest&&r.isrest&&o.minLine<=a.maxLine&&D(o,a,1),o.isrest&&a.isrest&&r.minLine<=o.maxLine&&D(o,r,-1),r.isrest&&r.minLine<=o.maxLine&&D(r,o,1),a.isrest&&o.minLine<=a.maxLine&&D(a,o,-1),(!r.isrest&&!o.isrest&&r.minLine<=o.maxLine+.5||!o.isrest&&!a.isrest&&o.minLine<=a.maxLine)&&(c=l+3,o.note.setXShift(c)),!0)}static formatByY(t,e){let i=!0;for(let s=0;s<t.length;s++)i=i&&null!=t[s].getStave();if(!i)throw new s.RERR("Stave Missing","All notes must have a stave - Vex.Flow.ModifierContext.formatMultiVoice!");let n=0;for(let s=0;s<t.length-1;s++){let e=t[s],i=t[s+1];e.getStemDirection()===E.DOWN&&(e=t[s+1],i=t[s]);const r=e.getKeyProps(),o=i.getKeyProps(),a=.5,l=e.getStave().getYForLine(5-r[0].line+a);i.getStave().getYForLine(5-o[o.length-1].line-a)-l<0&&(n=e.getVoiceShiftWidth()+2,i.setXShift(n))}e.right_shift+=n}static postFormat(t){return!!t&&(t.forEach((t=>t.postFormat())),!0)}constructor(t){if(super(t),this.setAttribute("type","StaveNote"),this.keys=t.keys,this.clef=t.clef,this.octave_shift=t.octave_shift,this.beam=null,this.glyph=m.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new s.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(t)}`);this.displaced=!1,this.dot_shiftY=0,this.keyProps=[],this.use_default_head_x=!1,this.note_heads=[],this.modifiers=[],s.Merge(this.render_options,{glyph_font_scale:t.glyph_font_scale||m.DEFAULT_NOTATION_FONT_SCALE,stroke_px:t.stroke_px||k.DEFAULT_LEDGER_LINE_OFFSET}),this.calculateKeyProps(),this.buildStem(),t.auto_stem?this.autoStem():this.setStemDirection(t.stem_direction),this.reset(),this.buildFlag()}reset(){super.reset();const t=this.note_heads.map((t=>t.getStyle()));this.buildNoteHeads(),this.note_heads.forEach(((e,i)=>e.setStyle(t[i]))),this.stave&&this.note_heads.forEach((t=>t.setStave(this.stave))),this.calcExtraPx()}setBeam(t){return this.beam=t,this.calcExtraPx(),this}getCategory(){return k.CATEGORY}buildStem(){this.setStem(new E({hide:!!this.isRest()}))}buildNoteHeads(){this.note_heads=[];const t=this.getStemDirection(),e=this.getKeys();let i,n,s,r=null,o=null,a=!1;t===E.UP?(i=0,n=e.length,s=1):t===E.DOWN&&(i=e.length-1,n=-1,s=-1);for(let l=i;l!==n;l+=s){const e=this.keyProps[l],i=e.line;null===r?r=i:(o=Math.abs(r-i),0===o||.5===o?a=!a:(a=!1,this.use_default_head_x=!0)),r=i;const n=new N({duration:this.duration,note_type:this.noteType,displaced:a,stem_direction:t,custom_glyph_code:e.code,glyph_font_scale:this.render_options.glyph_font_scale,x_shift:e.shift_right,stem_up_x_offset:e.stem_up_x_offset,stem_down_x_offset:e.stem_down_x_offset,line:e.line});this.note_heads[l]=n}}autoStem(){this.minLine=this.keyProps[0].line,this.maxLine=this.keyProps[this.keyProps.length-1].line;const t=(this.minLine+this.maxLine)/2<3?E.UP:E.DOWN;this.setStemDirection(t)}calculateKeyProps(){let t=null;for(let e=0;e<this.keys.length;++e){const i=this.keys[e];this.glyph.rest&&(this.glyph.position=i);const n={octave_shift:this.octave_shift||0},r=m.keyProperties(i,this.clef,n);if(!r)throw new s.RuntimeError("BadArguments",`Invalid key for note properties: ${i}`);"R"===r.key&&("1"===this.duration||"w"===this.duration?r.line=4:r.line=3);const o=r.line;null===t?t=o:.5===Math.abs(t-o)&&(this.displaced=!0,r.displaced=!0,this.keyProps.length>0&&(this.keyProps[e-1].displaced=!0)),t=o,this.keyProps.push(r)}t=-1/0,this.keyProps.forEach((e=>{e.line<t&&s.W("Unsorted keys in note will be sorted. See https://github.com/0xfe/vexflow/issues/104 for details."),t=e.line})),this.keyProps.sort(((t,e)=>t.line-e.line))}getBoundingBox(){if(!this.preFormatted)throw new s.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const{width:t,modLeftPx:e,extraLeftPx:i}=this.getMetrics(),n=this.getAbsoluteX()-e-i;let r=0,o=0;const a=this.getStave().getSpacingBetweenLines()/2,l=2*a;if(this.isRest()){const t=this.ys[0],e=m.durationToFraction(this.duration);e.equals(1)||e.equals(2)?(r=t-a,o=t+a):(r=t-this.glyph.line_above*l,o=t+this.glyph.line_below*l)}else if(this.glyph.stem){const t=this.getStemExtents();t.baseY+=a*this.stem_direction,r=Math.min(t.topY,t.baseY),o=Math.max(t.topY,t.baseY)}else{r=null,o=null;for(let t=0;t<this.ys.length;++t){const e=this.ys[t];0===t?(r=e,o=e):(r=Math.min(e,r),o=Math.max(e,o))}r-=a,o+=a}return new u(n,r,t,o-r)}getLineNumber(t){if(!this.keyProps.length)throw new s.RERR("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 n=this.keyProps[i].line;t?n>e&&(e=n):n<e&&(e=n)}return e}isRest(){return this.glyph.rest}isChord(){return!this.isRest()&&this.keys.length>1}hasStem(){return this.glyph.stem}hasFlag(){return super.hasFlag()&&!this.isRest()}getStemX(){return"r"===this.noteType?this.getCenterGlyphX():super.getStemX()+(t=this,E.WIDTH/(2*-t.getStemDirection()));var t}getYForTopText(t){const e=this.getStemExtents();return Math.min(this.stave.getYForTopText(t),e.topY-this.render_options.annotation_spacing*(t+1))}getYForBottomText(t){const e=this.getStemExtents();return Math.max(this.stave.getYForTopText(t),e.baseY+this.render_options.annotation_spacing*t)}setStave(t){super.setStave(t);const e=this.note_heads.map((e=>(e.setStave(t),e.getY())));if(this.setYs(e),this.stem){const{y_top:t,y_bottom:e}=this.getNoteHeadBounds();this.stem.setYBounds(t,e)}return this}getKeys(){return this.keys}getKeyProps(){return this.keyProps}isDisplaced(){return this.displaced}setNoteDisplaced(t){return this.displaced=t,this}getTieRightX(){let t=this.getAbsoluteX();return t+=this.getGlyphWidth()+this.x_shift+this.extraRightPx,this.modifierContext&&(t+=this.modifierContext.getExtraRightPx()),t}getTieLeftX(){let t=this.getAbsoluteX();return t+=this.x_shift-this.extraLeftPx,t}getLineForRest(){let t=this.keyProps[0].line;if(this.keyProps.length>1){const e=this.keyProps[this.keyProps.length-1].line,i=Math.max(t,e),n=Math.min(t,e);t=s.MidLine(i,n)}return t}getModifierStartXY(t,e,i){if(i=i||{},!this.preFormatted)throw new s.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(0===this.ys.length)throw new s.RERR("NoYValues","No Y-Values calculated for this note.");const{ABOVE:n,BELOW:r,LEFT:o,RIGHT:a}=B.Position;let l=0;return t===o?l=-2:t===a?(l=this.getGlyphWidth()+this.x_shift+2,this.stem_direction===E.UP&&this.hasFlag()&&(i.forceFlagRight||e===((h=this).getStemDirection()===E.UP?h.keyProps.length-1:0))&&(l+=this.flag.getMetrics().width)):t!==r&&t!==n||(l=this.getGlyphWidth()/2),{x:this.getAbsoluteX()+l,y:this.ys[e]};var h}setStyle(t){super.setStyle(t),this.note_heads.forEach((e=>e.setStyle(t))),this.stem.setStyle(t)}setStemStyle(t){this.getStem().setStyle(t)}getStemStyle(){return this.stem.getStyle()}setLedgerLineStyle(t){this.ledgerLineStyle=t}getLedgerLineStyle(){return this.ledgerLineStyle}setFlagStyle(t){this.flagStyle=t}getFlagStyle(){return this.flagStyle}setKeyStyle(t,e){return this.note_heads[t].setStyle(e),this}setKeyLine(t,e){return this.keyProps[t].line=e,this.reset(),this}getKeyLine(t){return this.keyProps[t].line}addToModifierContext(t){this.setModifierContext(t);for(let e=0;e<this.modifiers.length;++e)this.modifierContext.addModifier(this.modifiers[e]);return this.modifierContext.addModifier(this),this.setPreFormatted(!1),this}addModifier(t,e){return e.setNote(this),e.setIndex(t),this.modifiers.push(e),this.setPreFormatted(!1),this}addAccidental(t,e){return this.addModifier(t,e)}addArticulation(t,e){return this.addModifier(t,e)}addAnnotation(t,e){return this.addModifier(t,e)}addDot(t){const e=new O;return e.setDotShiftY(this.glyph.dot_shiftY),this.dots++,this.addModifier(t,e)}addDotToAll(){for(let t=0;t<this.keys.length;++t)this.addDot(t);return this}getAccidentals(){return this.modifierContext.getModifiers("accidentals")}getDots(){return this.modifierContext.getModifiers("dots")}getVoiceShiftWidth(){return this.getGlyphWidth()*(this.displaced?2:1)}calcExtraPx(){this.setExtraLeftPx(this.displaced&&this.stem_direction===E.DOWN?this.getGlyphWidth():0),this.setExtraRightPx(!this.hasFlag()&&this.displaced&&this.stem_direction===E.UP?this.getGlyphWidth():0)}preFormat(){if(this.preFormatted)return;this.modifierContext&&this.modifierContext.preFormat();let t=this.getGlyphWidth()+this.extraLeftPx+this.extraRightPx;this.glyph.flag&&null===this.beam&&this.stem_direction===E.UP&&(t+=this.getGlyphWidth()),this.setWidth(t),this.setPreFormatted(!0)}getNoteHeadBounds(){let t=null,e=null,i=null,n=null,s=this.stave.getNumLines(),r=1,o=!1,a=!1,l=s,h=r;return this.note_heads.forEach((c=>{const u=c.getLine(),d=c.getY();(null===t||d<t)&&(t=d),(null===e||d>e)&&(e=d),null===n&&c.isDisplaced()&&(n=c.getAbsoluteX()),null!==i||c.isDisplaced()||(i=c.getAbsoluteX()),s=u>s?u:s,r=u<r?u:r,c.isDisplaced()?(o=!1===o?u:Math.max(u,o),a=!1===a?u:Math.min(u,a)):(l=Math.max(u,l),h=Math.min(u,h))}),this),{y_top:t,y_bottom:e,displaced_x:n,non_displaced_x:i,highest_line:s,lowest_line:r,highest_displaced_line:o,lowest_displaced_line:a,highest_non_displaced_line:l,lowest_non_displaced_line:h}}getNoteHeadBeginX(){return this.getAbsoluteX()+this.x_shift}getNoteHeadEndX(){return this.getNoteHeadBeginX()+this.getGlyphWidth()}drawLedgerLines(){const{stave:e,glyph:i,render_options:{stroke_px:n},context:r}=this,o=i.getWidth()+2*n,a=2*(i.getWidth()+n)-E.WIDTH/2;if(this.isRest())return;if(!r)throw new s.RERR("NoCanvasContext","Can't draw without a canvas context.");const{highest_line:l,lowest_line:h,highest_displaced_line:c,highest_non_displaced_line:u,lowest_displaced_line:d,lowest_non_displaced_line:f,displaced_x:p,non_displaced_x:m}=this.getNoteHeadBounds(),b=Math.min(p,m),g=(t,e,i)=>{let s;s=i&&e?b-n:e?m-n:p-n;const l=e&&i?a:o;r.beginPath(),r.moveTo(s,t),r.lineTo(s+l,t),r.stroke()},y=t(t({},e.getStyle()||{}),this.getLedgerLineStyle()||{});this.applyStyle(r,y);for(let t=6;t<=l;++t){const i=null!==m&&t<=u,n=null!==p&&t<=c;g(e.getYForNote(t),i,n)}for(let t=0;t>=h;--t){const i=null!==m&&t>=f,n=null!==p&&t>=d;g(e.getYForNote(t),i,n)}this.restoreStyle(r,y)}drawModifiers(){if(!this.context)throw new s.RERR("NoCanvasContext","Can't draw without a canvas context.");const t=this.context;t.openGroup("modifiers");for(let e=0;e<this.modifiers.length;e++){const i=this.modifiers[e],n=this.note_heads[i.getIndex()],s=n.getStyle();n.applyStyle(t,s),i.setContext(t),i.drawWithStyle(),n.restoreStyle(t,s)}t.closeGroup()}drawFlag(){const{stem:t,beam:e,context:i}=this;if(!i)throw new s.RERR("NoCanvasContext","Can't draw without a canvas context.");const n=null===e;if(this.getGlyph().flag&&n){const{y_top:e,y_bottom:n}=this.getNoteHeadBounds(),s=t.getHeight(),r=this.getStemX(),o=this.getStemDirection()===E.DOWN?e-s+2:n-s-2;i.openGroup("flag",null,{pointerBBox:!0}),this.applyStyle(i,this.getFlagStyle()||!1),this.flag.render(i,r,o),this.restoreStyle(i,this.getFlagStyle()||!1),i.closeGroup()}}drawNoteHeads(){this.note_heads.forEach((t=>{this.context.openGroup("notehead",null,{pointerBBox:!0}),t.setContext(this.context).draw(),this.context.closeGroup()}))}drawStem(t){if(!this.context)throw new s.RERR("NoCanvasContext","Can't draw without a canvas context.");t&&this.setStem(new E(t)),this.context.openGroup("stem",null,{pointerBBox:!0}),this.stem.setContext(this.context).draw(),this.context.closeGroup()}draw(){if(!this.context)throw new s.RERR("NoCanvasContext","Can't draw without a canvas context.");if(!this.stave)throw new s.RERR("NoStave","Can't draw without a stave.");if(0===this.ys.length)throw new s.RERR("NoYValues","Can't draw note without Y values.");const t=this.getNoteHeadBeginX(),e=this.hasStem()&&!this.beam;this.note_heads.forEach((e=>e.setX(t)));const i=this.getStemX();this.stem.setNoteHeadXBounds(i,i),function(...t){k.DEBUG&&s.L("Vex.Flow.StaveNote",t)}("Rendering ",this.isChord()?"chord :":"note :",this.keys),this.drawLedgerLines(),this.applyStyle(),this.setAttribute("el",this.context.openGroup("stavenote",this.getAttribute("id"))),this.context.openGroup("note",null,{pointerBBox:!0}),e&&this.drawStem(),this.drawNoteHeads(),this.drawFlag(),this.context.closeGroup(),this.drawModifiers(),this.context.closeGroup(),this.restoreStyle(),this.setRendered()}}class V extends B{static get CATEGORY(){return"frethandfinger"}static format(t,e){const{left_shift:i,right_shift:n}=e;if(!t||0===t.length)return!1;const s=[];let r=null,o=0,a=0;for(let p=0;p<t.length;++p){const e=t[p],l=e.getNote(),h=e.getPosition(),c=l.getKeyProps()[e.getIndex()];if(l!==r){for(let t=0;t<l.keys.length;++t){const e=l.getKeyProps()[t];0===i&&(o=e.displaced?l.getExtraLeftPx():o),0===n&&(a=e.displaced?l.getExtraRightPx():a)}r=l}s.push({note:l,num:e,pos:h,line:c.line,shiftL:o,shiftR:a})}s.sort(((t,e)=>e.line-t.line));let l=0,h=0,c=0,u=0,d=null,f=null;for(let p=0;p<s.length;++p){let t=0;const{note:e,pos:r,num:o,line:m,shiftL:b,shiftR:g}=s[p];m===d&&e===f||(l=i+b,h=n+g);const y=o.getWidth()+1;r===B.Position.LEFT?(o.setXShift(i+l),t=i+y,c=t>c?t:c):r===B.Position.RIGHT&&(o.setXShift(h),t=a+y,u=t>u?t:u),d=m,f=e}return e.left_shift+=c,e.right_shift+=u,!0}constructor(t){super(),this.setAttribute("type","FretHandFinger"),this.note=null,this.index=null,this.finger=t,this.width=7,this.position=B.Position.LEFT,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.font={family:"sans-serif",size:9,weight:"bold"}}getCategory(){return V.CATEGORY}setFretHandFinger(t){return this.finger=t,this}setOffsetX(t){return this.x_offset=t,this}setOffsetY(t){return this.y_offset=t,this}draw(){if(this.checkContext(),!this.note||null==this.index)throw new s.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const t=this.context,e=this.note.getModifierStartXY(this.position,this.index);let i=e.x+this.x_shift+this.x_offset,n=e.y+this.y_shift+this.y_offset+5;switch(this.position){case B.Position.ABOVE:i-=4,n-=12;break;case B.Position.BELOW:i-=2,n+=10;break;case B.Position.LEFT:i-=this.width;break;case B.Position.RIGHT:i+=1;break;default:throw new s.RERR("InvalidPostion",`The position ${this.position} does not exist`)}t.save(),t.setFont(this.font.family,this.font.size,this.font.weight),t.fillText(""+this.finger,i,n),t.restore()}}class G{static get NUM_TONES(){return 12}static get roots(){return["c","d","e","f","g","a","b"]}static get root_values(){return[0,2,4,5,7,9,11]}static get root_indices(){return{c:0,d:1,e:2,f:3,g:4,a:5,b:6}}static get canonical_notes(){return["c","c#","d","d#","e","f","f#","g","g#","a","a#","b"]}static get diatonic_intervals(){return["unison","m2","M2","m3","M3","p4","dim5","p5","m6","M6","b7","M7","octave"]}static get diatonic_accidentals(){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],dorian:[2,1,2,2,2,1,2],mixolydian:[2,2,1,2,2,1,2],minor:[2,1,2,2,1,2,2]}}static get scaleTypes(){return{M:G.scales.major,m:G.scales.minor}}static get accidentals(){return["bb","b","n","#","##"]}static get noteValues(){return{c:{root_index:0,int_val:0},cn:{root_index:0,int_val:0},"c#":{root_index:0,int_val:1},"c##":{root_index:0,int_val:2},cb:{root_index:0,int_val:11},cbb:{root_index:0,int_val:10},d:{root_index:1,int_val:2},dn:{root_index:1,int_val:2},"d#":{root_index:1,int_val:3},"d##":{root_index:1,int_val:4},db:{root_index:1,int_val:1},dbb:{root_index:1,int_val:0},e:{root_index:2,int_val:4},en:{root_index:2,int_val:4},"e#":{root_index:2,int_val:5},"e##":{root_index:2,int_val:6},eb:{root_index:2,int_val:3},ebb:{root_index:2,int_val:2},f:{root_index:3,int_val:5},fn:{root_index:3,int_val:5},"f#":{root_index:3,int_val:6},"f##":{root_index:3,int_val:7},fb:{root_index:3,int_val:4},fbb:{root_index:3,int_val:3},g:{root_index:4,int_val:7},gn:{root_index:4,int_val:7},"g#":{root_index:4,int_val:8},"g##":{root_index:4,int_val:9},gb:{root_index:4,int_val:6},gbb:{root_index:4,int_val:5},a:{root_index:5,int_val:9},an:{root_index:5,int_val:9},"a#":{root_index:5,int_val:10},"a##":{root_index:5,int_val:11},ab:{root_index:5,int_val:8},abb:{root_index:5,int_val:7},b:{root_index:6,int_val:11},bn:{root_index:6,int_val:11},"b#":{root_index:6,int_val:0},"b##":{root_index:6,int_val:1},bb:{root_index:6,int_val:10},bbb:{root_index:6,int_val:9}}}isValidNoteValue(t){return!(null==t||t<0||t>=G.NUM_TONES)}isValidIntervalValue(t){return this.isValidNoteValue(t)}getNoteParts(t){if(!t||t.length<1)throw new s.RERR("BadArguments","Invalid note name: "+t);if(t.length>3)throw new s.RERR("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 s.RERR("BadArguments","Invalid note name: "+t)}getKeyParts(t){if(!t||t.length<1)throw new s.RERR("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 n=i[3];return n||(n="M"),{root:t,accidental:e,type:n}}throw new s.RERR("BadArguments",`Invalid key: ${t}`)}getNoteValue(t){const e=G.noteValues[t];if(null==e)throw new s.RERR("BadArguments",`Invalid note name: ${t}`);return e.int_val}getIntervalValue(t){const e=G.intervals[t];if(null==e)throw new s.RERR("BadArguments",`Invalid interval name: ${t}`);return e}getCanonicalNoteName(t){if(!this.isValidNoteValue(t))throw new s.RERR("BadArguments",`Invalid note value: ${t}`);return G.canonical_notes[t]}getCanonicalIntervalName(t){if(!this.isValidIntervalValue(t))throw new s.RERR("BadArguments",`Invalid interval value: ${t}`);return G.diatonic_intervals[t]}getRelativeNoteValue(t,e,i){if(null==i&&(i=1),1!==i&&-1!==i)throw new s.RERR("BadArguments",`Invalid direction: ${i}`);let n=(t+i*e)%G.NUM_TONES;return n<0&&(n+=G.NUM_TONES),n}getRelativeNoteName(t,e){const i=this.getNoteParts(t),n=this.getNoteValue(i.root);let r=e-n;if(Math.abs(r)>G.NUM_TONES-3){let i=1;r>0&&(i=-1);const o=(e+1+(n+1))%G.NUM_TONES*i;if(Math.abs(o)>2)throw new s.RERR("BadArguments",`Notes not related: ${t}, ${e})`);r=o}if(Math.abs(r)>2)throw new s.RERR("BadArguments",`Notes not related: ${t}, ${e})`);let o=i.root;if(r>0)for(let s=1;s<=r;++s)o+="#";else if(r<0)for(let s=-1;s>=r;--s)o+="b";return o}getScaleTones(t,e){const i=[t];let n=t;for(let s=0;s<e.length;s+=1)n=this.getRelativeNoteValue(n,e[s]),n!==t&&i.push(n);return i}getIntervalBetween(t,e,i){if(null==i&&(i=1),1!==i&&-1!==i)throw new s.RERR("BadArguments",`Invalid direction: ${i}`);if(!this.isValidNoteValue(t)||!this.isValidNoteValue(e))throw new s.RERR("BadArguments",`Invalid notes: ${t}, ${e}`);let n=1===i?e-t:t-e;return n<0&&(n+=G.NUM_TONES),n}createScaleMap(t){const e=this.getKeyParts(t),i=G.scaleTypes[e.type];let n=e.root;if(e.accidental&&(n+=e.accidental),!i)throw new s.RERR("BadArguments","Unsupported key type: "+t);const r=this.getScaleTones(this.getNoteValue(n),i),o=G.root_indices[e.root],a={};for(let s=0;s<G.roots.length;++s){const t=(o+s)%G.roots.length,e=G.roots[t];let i=this.getRelativeNoteName(e,r[s]);1===i.length&&(i+="n"),a[e]=i}return a}}function W(...t){z.DEBUG&&s.L("Vex.Flow.Accidental",t)}const U=t=>t.getMetrics().width;class z extends B{static get CATEGORY(){return"accidentals"}static format(t,e){const i=e.left_shift+1;if(!t||0===t.length)return;const n=[];let s,r=null,o=0;for(let m=0;m<t.length;++m){const e=t[m],i=e.getNote(),a=i.getStave(),l=i.getKeyProps()[e.getIndex()];if(i!==r){for(let t=0;t<i.keys.length;++t)s=i.getKeyProps()[t],o=s.displaced?i.getExtraLeftPx():o;r=i}if(null!==a){const t=a.options.spacing_between_lines_px,i=a.getYForLine(l.line),s=Math.round(i/t*2)/2;n.push({y:i,line:s,shift:o,acc:e,lineSpace:t})}else n.push({line:l.line,shift:o,acc:e})}n.sort(((t,e)=>e.line-t.line));const a=[];let l=0,h=null;for(let m=0;m<n.length;m++){const t=n[m];null!==h&&h===t.line||a.push({line:t.line,flatLine:!0,dblSharpLine:!0,numAcc:0,width:0}),"b"!==t.acc.type&&"bb"!==t.acc.type&&(a[a.length-1].flatLine=!1),"##"!==t.acc.type&&(a[a.length-1].dblSharpLine=!1),a[a.length-1].numAcc++,a[a.length-1].width+=t.acc.getWidth()+3,l=t.shift>l?t.shift:l,h=t.line}let c=0;for(let b=0;b<a.length;b++){let t=!1;const e=b;let i=b;for(;i+1<a.length&&!t;)this.checkCollision(a[i],a[i+1])?i++:t=!0;const n=t=>a[e+t],s=t=>t.map(n),r=(t,e)=>{const[i,n]=s([t,e]).map((t=>t.line));return i-n},o=(...t)=>t.map(s).every((t=>!this.checkCollision(...t))),l=i-e+1;let h,u,d=this.checkCollision(a[e],a[i])?"a":"b";switch(l){case 3:"a"===d&&.5===r(1,2)&&.5!==r(0,1)&&(d="second_on_bottom");break;case 4:o([0,2],[1,3])&&(d="spaced_out_tetrachord");break;case 5:"b"===d&&o([1,3])&&(d="spaced_out_pentachord",o([0,2],[2,4])&&(d="very_spaced_out_pentachord"));break;case 6:o([0,3],[1,4],[2,5])&&(d="spaced_out_hexachord"),o([0,2],[2,4],[1,3],[3,5])&&(d="very_spaced_out_hexachord")}if(l>=7){let t=2,e=!0;for(;!0===e;){e=!1;for(let i=0;i+t<a.length;i++)if(this.checkCollision(a[i],a[i+t])){e=!0,t++;break}}for(h=b;h<=i;h++)u=(h-b)%t+1,a[h].column=u,c=c>u?c:u}else for(h=b;h<=i;h++)u=m.accidentalColumnsTable[l][d][h-b],a[h].column=u,c=c>u?c:u;b=i}const u=[],d=[];for(let m=0;m<=c;m++)u[m]=0,d[m]=0;u[0]=l+i,d[0]=l+i,a.forEach((t=>{t.width>u[t.column]&&(u[t.column]=t.width)}));for(let m=1;m<u.length;m++)d[m]=u[m]+d[m-1];const f=d[d.length-1];let p=0;a.forEach((t=>{let e=0;const i=p+t.numAcc;for(;p<i;p++){const i=d[t.column-1]+e;n[p].acc.setXShift(i),e+=n[p].acc.getWidth()+3,W("Line, accCount, shift: ",t.line,p,i)}})),e.left_shift+=f}static checkCollision(t,e){let i=e.line-t.line,n=3;i>0?(n=e.flatLine||e.dblSharpLine?2.5:3,t.dblSharpLine&&(i-=.5)):(n=t.flatLine||t.dblSharpLine?2.5:3,e.dblSharpLine&&(i-=.5));const s=Math.abs(i)<n;return W("Line_1, Line_2, Collision: ",t.line,e.line,s),s}static applyAccidentals(t,e){const i=[],n={};t.forEach((t=>{const e=new r(0,1);t.getTickables().forEach((t=>{if(t.shouldIgnoreTicks())return;const s=n[e.value()];s?s.push(t):(i.push(e.value()),n[e.value()]=[t]),e.add(t.getTicks())}))}));const s=new G;e||(e="C");const o=s.createScaleMap(e);i.forEach((t=>{const e=n[t],i=[],r=t=>{t.isRest()||t.shouldIgnoreTicks()||(t.keys.forEach(((e,n)=>{const r=s.getNoteParts(e.split("/")[0]),a=r.accidental||"n",l=r.root+a,h=o[r.root]===l,c=i.indexOf(l)>-1;if(!h||h&&c){o[r.root]=l;const e=new z(a);t.addAccidental(n,e),i.push(l)}})),t.getModifiers().forEach((t=>{"gracenotegroups"===t.getCategory()&&t.getGraceNotes().forEach(r)})))};e.forEach(r)}))}constructor(t=null){if(super(),this.setAttribute("type","Accidental"),W("New accidental: ",t),this.note=null,this.index=null,this.type=t,this.position=B.Position.LEFT,this.render_options={font_scale:38,stroke_px:3,parenLeftPadding:2,parenRightPadding:2},this.accidental=m.accidentalCodes(this.type),!this.accidental)throw new s.RERR("ArgumentError",`Unknown accidental type: ${t}`);this.cautionary=!1,this.parenLeft=null,this.parenRight=null,this.reset()}reset(){const t=this.render_options.font_scale;this.glyph=new p(this.accidental.code,t),this.glyph.setOriginX(1),this.cautionary&&(this.parenLeft=new p(m.accidentalCodes("{").code,t),this.parenRight=new p(m.accidentalCodes("}").code,t),this.parenLeft.setOriginX(1),this.parenRight.setOriginX(1))}getCategory(){return z.CATEGORY}getWidth(){const t=this.cautionary?U(this.parenLeft)+U(this.parenRight)+this.render_options.parenLeftPadding+this.render_options.parenRightPadding:0;return U(this.glyph)+t}setNote(t){if(!t)throw new s.RERR("ArgumentError",`Bad note value: ${t}`);this.note=t,"gracenotes"===this.note.getCategory()&&(this.render_options.font_scale=25,this.reset())}setAsCautionary(){return this.cautionary=!0,this.render_options.font_scale=28,this.reset(),this}draw(){const{context:t,type:e,position:i,note:n,index:r,cautionary:o,x_shift:a,y_shift:l,glyph:h,parenLeft:c,parenRight:u,render_options:{parenLeftPadding:d,parenRightPadding:f}}=this;if(this.checkContext(),!n||null==r)throw new s.RERR("NoAttachedNote","Can't draw accidental without a note and index.");const p=n.getModifierStartXY(i,r);let m=p.x+a;const b=p.y+l;W("Rendering: ",e,m,b),o?(u.render(t,m,b),m-=U(u),m-=f,m-=this.accidental.parenRightPaddingAdjustment,h.render(t,m,b),m-=U(h),m-=d,c.render(t,m,b)):h.render(t,m,b),this.setRendered()}}class j extends B{static get CATEGORY(){return"notesubgroup"}static format(t,e){if(!t||0===t.length)return!1;let i=0;for(let n=0;n<t.length;++n){const e=t[n];e.preFormat(),i+=e.getWidth()}return e.left_shift+=i,!0}constructor(t){return super(),this.setAttribute("type","NoteSubGroup"),this.note=null,this.index=null,this.position=B.Position.LEFT,this.subNotes=t,this.subNotes.forEach((t=>{t.ignore_ticks=!1})),this.width=0,this.preFormatted=!1,this.formatter=new dt,this.voice=new L({num_beats:4,beat_value:4,resolution:m.RESOLUTION}).setStrict(!1),this.voice.addTickables(this.subNotes),this}getCategory(){return j.CATEGORY}preFormat(){this.preFormatted||(this.formatter.joinVoices([this.voice]).format([this.voice],0),this.setWidth(this.formatter.getMinTotalWidth()),this.preFormatted=!0)}setNote(t){this.note=t}setWidth(t){this.width=t}getWidth(){return this.width}draw(){this.checkContext();const t=this.getNote();if(!t||null===this.index)throw new s.RuntimeError("NoAttachedNote","Can't draw notes without a parent note and parent note index.");this.setRendered(),this.alignSubNotesWithNote(this.subNotes,t),this.subNotes.forEach((t=>t.setContext(this.context).drawWithStyle()))}}class H extends h{constructor(t,e){super(),this.setAttribute("type","StaveTie"),this.notes=t,this.context=null,this.text=e,this.direction=null,this.render_options={cp1:8,cp2:12,text_shift_x:0,first_x_shift:0,last_x_shift:0,y_shift:7,tie_spacing:0,font:{family:"Arial",size:10,style:""}},this.font=this.render_options.font,this.setNotes(t)}setFont(t){return this.font=t,this}setDirection(t){return this.direction=t,this}setNotes(t){if(!t.first_note&&!t.last_note)throw new s.RuntimeError("BadArguments","Tie needs to have either first_note or last_note set.");if(t.first_indices||(t.first_indices=[0]),t.last_indices||(t.last_indices=[0]),t.first_indices.length!==t.last_indices.length)throw new s.RuntimeError("BadArguments","Tied notes must have similar index sizes");return this.first_note=t.first_note,this.first_indices=t.first_indices,this.last_note=t.last_note,this.last_indices=t.last_indices,this}isPartial(){return!this.first_note||!this.last_note}renderTie(t){if(0===t.first_ys.length||0===t.last_ys.length)throw new s.RERR("BadArguments","No Y-values to render");const e=this.context;let i=this.render_options.cp1,n=this.render_options.cp2;Math.abs(t.last_x_px-t.first_x_px)<10&&(i=2,n=8);const r=this.render_options.first_x_shift,o=this.render_options.last_x_shift,a=this.render_options.y_shift*t.direction;for(let l=0;l<this.first_indices.length;++l){const h=(t.last_x_px+o+(t.first_x_px+r))/2,c=t.first_ys[this.first_indices[l]]+a,u=t.last_ys[this.last_indices[l]]+a;if(isNaN(c)||isNaN(u))throw new s.RERR("BadArguments","Bad indices for tie rendering.");const d=(c+u)/2+i*t.direction,f=(c+u)/2+n*t.direction;e.beginPath(),e.moveTo(t.first_x_px+r,c),e.quadraticCurveTo(h,d,t.last_x_px+o,u),e.quadraticCurveTo(h,f,t.first_x_px+r,c),e.closePath(),e.fill()}}renderText(t,e){if(!this.text)return;let i=(t+e)/2;i-=this.context.measureText(this.text).width/2,this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.style),this.context.fillText(this.text,i+this.render_options.text_shift_x,(this.first_note||this.last_note).getStave().getYForTopText()-1),this.context.restore()}draw(){this.checkContext(),this.setRendered();const t=this.first_note,e=this.last_note;let i,n,s,r,o;return t?(i=t.getTieRightX()+this.render_options.tie_spacing,o=t.getStemDirection(),s=t.getYs()):(i=e.getStave().getTieStartX(),s=e.getYs(),this.first_indices=this.last_indices),e?(n=e.getTieLeftX()+this.render_options.tie_spacing,o=e.getStemDirection(),r=e.getYs()):(n=t.getStave().getTieEndX(),r=t.getYs(),this.last_indices=this.first_indices),this.direction&&(o=this.direction),this.renderTie({first_x_px:i,last_x_px:n,first_ys:s,last_ys:r,direction:o}),this.renderText(i,n),!0}}class X extends H{static createHammeron(t){return new X(t,"H")}static createPulloff(t){return new X(t,"P")}constructor(t,e){super(t,e),this.setAttribute("type","TabTie"),this.render_options.cp1=9,this.render_options.cp2=11,this.render_options.y_shift=3,this.setNotes(t)}draw(){this.checkContext(),this.setRendered();const t=this.first_note,e=this.last_note;let i,n,s,r;return t?(i=t.getTieRightX()+this.render_options.tie_spacing,s=t.getYs()):(i=e.getStave().getTieStartX(),s=e.getYs(),this.first_indices=this.last_indices),e?(n=e.getTieLeftX()+this.render_options.tie_spacing,r=e.getYs()):(n=t.getStave().getTieEndX(),r=t.getYs(),this.last_indices=this.first_indices),this.renderTie({first_x_px:i,last_x_px:n,first_ys:s,last_ys:r,direction:-1}),this.renderText(i,n),!0}}class Y extends B{static get CATEGORY(){return"gracenotegroups"}static format(t,e){if(!t||0===t.length)return!1;const i=[];let n=null,s=0;for(let a=0;a<t.length;++a){const e=t[a],r=e.getNote(),o=r.getCategory()===k.CATEGORY,l=o?4:0;if(o&&r!==n){for(let t=0;t<r.keys.length;++t)s=r.getKeyProps()[t].displaced?r.getExtraLeftPx():s;n=r}i.push({shift:s,gracenote_group:e,spacing:l})}let r,o=i[0].shift;for(let a=0;a<i.length;++a){const t=i[a].gracenote_group;t.preFormat(),r=t.getWidth()+i[a].spacing,o=Math.max(r,o)}for(let a=0;a<i.length;++a){const t=i[a].gracenote_group;r=t.getWidth()+i[a].spacing,t.setSpacingFromNextModifier(o-Math.min(r,o))}return e.left_shift+=o,!0}constructor(t,e){return super(),this.setAttribute("type","GraceNoteGroup"),this.note=null,this.index=null,this.position=B.Position.LEFT,this.grace_notes=t,this.width=0,this.preFormatted=!1,this.show_slur=e,this.slur=null,this.formatter=new dt,this.voice=new L({num_beats:4,beat_value:4,resolution:m.RESOLUTION}).setStrict(!1),this.render_options={slur_y_shift:0},this.beams=[],this.voice.addTickables(this.grace_notes),this}getCategory(){return Y.CATEGORY}preFormat(){this.preFormatted||(this.formatter.joinVoices([this.voice]).format([this.voice],0),this.setWidth(this.formatter.getMinTotalWidth()),this.preFormatted=!0)}beamNotes(t){if((t=t||this.grace_notes).length>1){const e=new P(t);e.render_options.beam_width=3,e.render_options.partial_beam_length=4,this.beams.push(e)}return this}setNote(t){this.note=t}setWidth(t){this.width=t}getWidth(){return this.width}getGraceNotes(){return this.grace_notes}draw(){this.checkContext();const t=this.getNote();if(function(...t){Y.DEBUG&&s.L("Vex.Flow.GraceNoteGroup",t)}("Drawing grace note group for:",t),!t||null===this.index)throw new s.RuntimeError("NoAttachedNote","Can't draw grace note without a parent note and parent note index.");if(this.setRendered(),this.alignSubNotesWithNote(this.getGraceNotes(),t),this.grace_notes.forEach((t=>{t.setContext(this.context).draw()})),this.beams.forEach((t=>{t.setContext(this.context).draw()})),this.show_slur){const e=this.getNote().getCategory()===k.CATEGORY,i=e?H:X;this.slur=new i({last_note:this.grace_notes[0],first_note:t,first_indices:[0],last_indices:[0]}),this.slur.render_options.cp2=12,this.slur.render_options.y_shift=(e?7:5)+this.render_options.slur_y_shift,this.slur.setContext(this.context).draw()}}}class K extends B{static get CATEGORY(){return"strokes"}static get Type(){return{BRUSH_DOWN:1,BRUSH_UP:2,ROLL_DOWN:3,ROLL_UP:4,RASQUEDO_DOWN:5,RASQUEDO_UP:6,ARPEGGIO_DIRECTIONLESS:7}}static format(t,e){const i=e.left_shift;if(!t||0===t.length)return this;const n=t.map((t=>{const e=t.getNote();if(e instanceof k){const{line:i,displaced:n}=e.getKeyProps()[t.getIndex()];return{line:i,shift:n?e.getExtraLeftPx():0,stroke:t}}{const{str:i}=e.getPositions()[t.getIndex()];return{line:i,shift:0,stroke:t}}})),s=i,r=n.reduce(((t,{stroke:e,shift:i})=>(e.setXShift(s+i),Math.max(e.getWidth()+0,t))),0);return e.left_shift+=r,!0}constructor(t,e){super(),this.setAttribute("type","Stroke"),this.note=null,this.options=s.Merge({},e),this.all_voices=!("all_voices"in this.options)||this.options.all_voices,this.note_end=null,this.index=null,this.type=t,this.position=B.Position.LEFT,this.render_options={font_scale:38,stroke_px:3,stroke_spacing:10},this.font={family:"serif",size:10,weight:"bold italic"},this.setXShift(0),this.setWidth(10)}getCategory(){return K.CATEGORY}getPosition(){return this.position}addEndNote(t){return this.note_end=t,this}draw(){if(this.checkContext(),this.setRendered(),!this.note||null==this.index)throw new s.RERR("NoAttachedNote","Can't draw stroke without a note and index.");const t=this.note.getModifierStartXY(this.position,this.index);let e=this.note.getYs(),i=t.y,n=t.y;const r=t.x-5,o=this.note.stave.options.spacing_between_lines_px,a=this.getModifierContext().getModifiers(this.note.getCategory());for(let f=0;f<a.length;f++){e=a[f].getYs();for(let t=0;t<e.length;t++)(this.note===a[f]||this.all_voices)&&(i=s.Min(i,e[t]),n=s.Max(n,e[t]))}let l,h,c,u,d;switch(this.type){case K.Type.BRUSH_DOWN:l="vc3",h=-3,c=i-o/2+10,n+=o/2;break;case K.Type.BRUSH_UP:l="v11",h=.5,c=n+o/2,i-=o/2;break;case K.Type.ROLL_DOWN:case K.Type.RASQUEDO_DOWN:l="vc3",h=-3,u=this.x_shift+h-2,this.note instanceof k?(i+=1.5*o,n+=(n-i)%2!=0?.5*o:o,c=i-o,d=n+o+2):(i+=1.5*o,n+=o,c=i-.75*o,d=n+.25*o);break;case K.Type.ROLL_UP:case K.Type.RASQUEDO_UP:l="v52",h=-4,u=this.x_shift+h-1,this.note instanceof k?(c=o/2,i+=.5*o,(n-i)%2==0&&(n+=o/2),c=n+.5*o,d=i-1.25*o):(i+=.25*o,n+=.5*o,c=n+.25*o,d=i-o);break;case K.Type.ARPEGGIO_DIRECTIONLESS:i+=.5*o,n+=o;break;default:throw new s.RERR("InvalidType",`The stroke type ${this.type} does not exist`)}if(this.type===K.Type.BRUSH_DOWN||this.type===K.Type.BRUSH_UP)this.context.fillRect(r+this.x_shift,i,1,n-i);else if(this.note instanceof k)for(let s=i;s<=n;s+=o)p.renderGlyph(this.context,r+this.x_shift-4,s,this.render_options.font_scale,"va3");else{let t;for(t=i;t<=n;t+=10)p.renderGlyph(this.context,r+this.x_shift-4,t,this.render_options.font_scale,"va3");this.type===K.Type.RASQUEDO_DOWN&&(d=t+.25*o)}this.type!==K.Type.ARPEGGIO_DIRECTIONLESS&&(p.renderGlyph(this.context,r+this.x_shift+h,c,this.render_options.font_scale,l),this.type!==K.Type.RASQUEDO_DOWN&&this.type!==K.Type.RASQUEDO_UP||(this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.weight),this.context.fillText("R",r+u,d),this.context.restore()))}}class q extends B{static get CATEGORY(){return"stringnumber"}static format(t,e){const i=e.left_shift,n=e.right_shift;if(!t||0===t.length)return this;const s=[];let r,o,a,l,h,c=null,u=0,d=0;for(r=0;r<t.length;++r)for(o=t[r],a=o.getNote(),r=0;r<t.length;++r){o=t[r],a=o.getNote(),l=o.getPosition();const e=a.getKeyProps()[o.getIndex()];if(a!==c){for(let t=0;t<a.keys.length;++t)h=a.getKeyProps()[t],0===i&&(u=h.displaced?a.getExtraLeftPx():u),0===n&&(d=h.displaced?a.getExtraRightPx():d);c=a}s.push({pos:l,note:a,num:o,line:e.line,shiftL:u,shiftR:d})}s.sort(((t,e)=>e.line-t.line));let f=0,p=0,m=0,b=null,g=null;for(r=0;r<s.length;++r){let t=0;a=s[r].note,l=s[r].pos,o=s[r].num;const e=s[r].line;s[r].shiftL;const h=s[r].shiftR;e===b&&a===g||(f=n+h);const c=o.getWidth()+1;l===B.Position.LEFT?(o.setXShift(i),t=u+c,p=t>p?t:p):l===B.Position.RIGHT&&(o.setXShift(f),t+=c,m=t>m?t:m),b=e,g=a}return e.left_shift+=p,e.right_shift+=m,!0}constructor(t){super(),this.setAttribute("type","StringNumber"),this.note=null,this.last_note=null,this.index=null,this.string_number=t,this.setWidth(20),this.position=B.Position.ABOVE,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.dashed=!0,this.leg=x.LineEndType.NONE,this.radius=8,this.font={family:"sans-serif",size:10,weight:"bold"}}getCategory(){return q.CATEGORY}getNote(){return this.note}setNote(t){return this.note=t,this}getIndex(){return this.index}setIndex(t){return this.index=t,this}setLineEndType(t){return t>=x.LineEndType.NONE&&t<=x.LineEndType.DOWN&&(this.leg=t),this}setStringNumber(t){return this.string_number=t,this}setOffsetX(t){return this.x_offset=t,this}setOffsetY(t){return this.y_offset=t,this}setLastNote(t){return this.last_note=t,this}setDashed(t){return this.dashed=t,this}draw(){const t=this.checkContext();if(!this.note||null==this.index)throw new s.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const e=this.note.stave.options.spacing_between_lines_px,i=this.note.getModifierStartXY(this.position,this.index);let n=i.x+this.x_shift+this.x_offset,r=i.y+this.y_shift+this.y_offset;switch(this.position){case B.Position.ABOVE:case B.Position.BELOW:{const t=this.note.getStemExtents();let n=t.topY,s=t.baseY+2;this.note.stem_direction===k.STEM_DOWN&&(n=t.baseY,s=t.topY-2),r=this.position===B.Position.ABOVE?this.note.hasStem()?n-1.75*e:i.y-1.75*e:this.note.hasStem()?s+1.5*e:i.y+1.75*e,r+=this.y_shift+this.y_offset;break}case B.Position.LEFT:n-=this.radius/2+5;break;case B.Position.RIGHT:n+=this.radius/2+6;break;default:throw new s.RERR("InvalidPosition",`The position ${this.position} is invalid`)}t.save(),t.beginPath(),t.arc(n,r,this.radius,0,2*Math.PI,!1),t.lineWidth=1.5,t.stroke(),t.setFont(this.font.family,this.font.size,this.font.weight);const o=n-t.measureText(this.string_number).width/2;if(t.fillText(""+this.string_number,o,r+4.5),null!=this.last_note){const e=this.last_note.getStemX()-this.note.getX()+5;let i,s;switch(t.strokeStyle="#000000",t.lineCap="round",t.lineWidth=.6,this.dashed?x.drawDashedLine(t,n+10,r,n+e,r,[3,3]):x.drawDashedLine(t,n+10,r,n+e,r,[3,0]),this.leg){case x.LineEndType.UP:i=-10,s=this.dashed?[3,3]:[3,0],x.drawDashedLine(t,n+e,r,n+e,r+i,s);break;case x.LineEndType.DOWN:i=10,s=this.dashed?[3,3]:[3,0],x.drawDashedLine(t,n+e,r,n+e,r+i,s)}}t.restore()}}const{ABOVE:$,BELOW:J}=B.Position,Z=(t,e)=>.5*t(e/.5),Q=(t,e)=>e===$?t<=5:t>=1,tt=(t,e)=>Q(t,e)?e===$?Math.ceil:Math.floor:Math.round,et=t=>{const e=t.getCategory();return"stavenotes"===e||"gracenotes"===e};class it extends B{static get CATEGORY(){return"articulations"}static get INITIAL_OFFSET(){return-.5}static format(t,e){if(!t||0===t.length)return!1;const i=(t,e,i)=>Z(tt(e,i),t.glyph.getMetrics().height/10+.5);t.filter((t=>t.getPosition()===$)).forEach((t=>{t.setTextLine(e.top_text_line),e.top_text_line+=i(t,e.top_text_line,$)})),t.filter((t=>t.getPosition()===J)).forEach((t=>{t.setTextLine(e.text_line),e.text_line+=i(t,e.text_line,J)}));const n=t.map((t=>t.getWidth())).reduce(((t,e)=>Math.max(e,t)));return e.left_shift+=n/2,e.right_shift+=n/2,!0}static easyScoreHook({articulations:t},e,i){if(!t)return;const n={staccato:"a.",tenuto:"a-"};t.split(",").map((t=>t.trim().split("."))).map((([t,e])=>{const s={type:n[t]};return e&&(s.position=B.PositionString[e]),i.getFactory().Articulation(s)})).map((t=>e.addModifier(0,t)))}constructor(t){if(super(),this.setAttribute("type","Articulation"),this.note=null,this.index=null,this.type=t,this.position=J,this.render_options={font_scale:38},this.articulation=m.articulationCodes(this.type),!this.articulation)throw new s.RERR("ArgumentError",`Articulation not found: ${this.type}`);this.glyph=new p(this.articulation.code,this.render_options.font_scale),this.setWidth(this.glyph.getMetrics().width)}getCategory(){return it.CATEGORY}draw(){const{note:t,index:e,position:i,glyph:n,articulation:{between_lines:r},text_line:o,context:a}=this;if(this.checkContext(),!t||null==e)throw new s.RERR("NoAttachedNote","Can't draw Articulation without a note and index.");this.setRendered();const l=t.getStave(),h=l.getSpacingBetweenLines(),c="tabnotes"===t.getCategory(),{x:u}=t.getModifierStartXY(i,e),d=!r||c,f=((t,e)=>{const i=e===$&&t.getStemDirection()===E.UP||e===J&&t.getStemDirection()===E.DOWN;return et(t)?t.hasStem()&&i?.5:1:t.hasStem()&&i?1:0})(t,i);let p={[$]:()=>{n.setOrigin(.5,1);const e=((t,e)=>{const i=t.getStave(),n=t.getStemDirection(),{topY:r,baseY:o}=t.getStemExtents();if(et(t))return t.hasStem()?n===E.UP?r:o:Math.min(...t.getYs());if("tabnotes"===t.getCategory())return t.hasStem()&&n===E.UP?r:i.getYForTopText(e);throw new s.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")})(t,o)-(o+f)*h;return d?Math.min(l.getYForTopText(it.INITIAL_OFFSET),e):e},[J]:()=>{n.setOrigin(.5,0);const e=((t,e)=>{const i=t.getStave(),n=t.getStemDirection(),{topY:r,baseY:o}=t.getStemExtents();if(et(t))return t.hasStem()?n===E.UP?o:r:Math.max(...t.getYs());if("tabnotes"===t.getCategory())return t.hasStem()?n===E.UP?i.getYForBottomText(e):r:i.getYForBottomText(e);throw new s.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")})(t,o)+(o+f)*h;return d?Math.max(l.getYForBottomText(it.INITIAL_OFFSET),e):e}}[i]();if(!c){const s=i===$?-1:1,o=c?t.positions[e].str:t.getKeyProps()[e].line,a=(t.getYs()[e]-p)/h+o,l=((t,e,i,n)=>{const s=Z(tt(e,i),e);return t&&Q(s,i)&&s%1==0?s+.5*-n:s})(r,a,i,s);Q(l,i)&&n.setOrigin(.5,.5),p+=Math.abs(l-a)*h*s}!function(...t){it.DEBUG&&s.L("Vex.Flow.Articulation",t)}(`Rendering articulation at (x: ${u}, y: ${p})`),n.render(a,u,p)}}class nt extends I{static getNextContext(t){const e=t.tContexts,i=e.indexOf(t);return e[i+1]}constructor(){super(),this.setAttribute("type","TickContext"),this.currentTick=new r(0,1),this.maxTicks=new r(0,1),this.minTicks=null,this.padding=3,this.x=0,this.xBase=0,this.xOffset=0,this.tickables=[],this.notePx=0,this.extraLeftPx=0,this.extraRightPx=0,this.tContexts=[]}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}getTickables(){return this.tickables}getCenterAlignedTickables(){return this.tickables.filter((t=>t.isCenterAligned()))}getMetrics(){const{width:t,notePx:e,extraLeftPx:i,extraRightPx:n}=this;return{width:t,notePx:e,extraLeftPx:i,extraRightPx:n}}getCurrentTick(){return this.currentTick}setCurrentTick(t){this.currentTick=t,this.preFormatted=!1}getExtraPx(){let t=0,e=0,i=0,n=0;for(let s=0;s<this.tickables.length;s++){i=Math.max(this.tickables[s].extraLeftPx||0,i),n=Math.max(this.tickables[s].extraRightPx||0,n);const r=this.tickables[s].modifierContext;r&&null!=r&&(t=Math.max(t,r.state.left_shift),e=Math.max(e,r.state.right_shift))}return{left:t,right:e,extraLeft:i,extraRight:n}}addTickable(t){if(!t)throw new s.RERR("BadArgument","Invalid tickable added.");if(!t.shouldIgnoreTicks()){this.ignore_ticks=!1;const e=t.getTicks();e.greaterThan(this.maxTicks)&&(this.maxTicks=e.clone()),(null==this.minTicks||e.lessThan(this.minTicks))&&(this.minTicks=e.clone())}return t.setTickContext(this),this.tickables.push(t),this.preFormatted=!1,this}preFormat(){if(this.preFormatted)return this;for(let t=0;t<this.tickables.length;++t){const e=this.tickables[t];e.preFormat();const i=e.getMetrics();this.extraLeftPx=Math.max(this.extraLeftPx,i.extraLeftPx+i.modLeftPx),this.extraRightPx=Math.max(this.extraRightPx,i.extraRightPx+i.modRightPx),this.notePx=Math.max(this.notePx,i.noteWidth),this.width=this.notePx+this.extraLeftPx+this.extraRightPx}return this}postFormat(){return this.postFormatted||(this.postFormatted=!0),this}}class st extends B{static get CATEGORY(){return"ornaments"}static format(t,e){if(!t||0===t.length)return!1;let i=0;for(let n=0;n<t.length;++n){const s=t[n],r=2;i=Math.max(s.getWidth(),i),s.getPosition()===B.Position.ABOVE?(s.setTextLine(e.top_text_line),e.top_text_line+=r):(s.setTextLine(e.text_line),e.text_line+=r)}return e.left_shift+=i/2,e.right_shift+=i/2,!0}constructor(t){if(super(),this.setAttribute("type","Ornament"),this.note=null,this.index=null,this.type=t,this.position=B.Position.ABOVE,this.delayed=!1,this.accidentalUpper=null,this.accidentalLower=null,this.render_options={font_scale:38,accidentalLowerPadding:3,accidentalUpperPadding:3},this.ornament=m.ornamentCodes(this.type),!this.ornament)throw new s.RERR("ArgumentError",`Ornament not found: '${this.type}'`);this.glyph=new p(this.ornament.code,this.render_options.font_scale),this.glyph.setOrigin(.5,1)}getCategory(){return st.CATEGORY}setDelayed(t){return this.delayed=t,this}setUpperAccidental(t){const e=this.render_options.font_scale/1.3;return this.accidentalUpper=new p(m.accidentalCodes(t).code,e),this.accidentalUpper.setOrigin(.5,1),this}setLowerAccidental(t){const e=this.render_options.font_scale/1.3;return this.accidentalLower=new p(m.accidentalCodes(t).code,e),this.accidentalLower.setOrigin(.5,1),this}draw(){if(this.checkContext(),!this.note||null==this.index)throw new s.RERR("NoAttachedNote","Can't draw Ornament without a note and index.");this.setRendered();const t=this.context,e=this.note.getStemDirection(),i=this.note.getStave(),n=this.note.getStem().getExtents();let r=e===k.STEM_DOWN?n.baseY:n.topY;"tabnotes"===this.note.getCategory()&&(this.note.hasStem()?e===k.STEM_DOWN&&(r=i.getYForTopText(this.text_line)):r=i.getYForTopText(this.text_line));const o=e===k.STEM_DOWN,a=i.getSpacingBetweenLines();let l=1;!o&&this.note.beam&&(l+=.5);const h=r-a*(this.text_line+l);let c=this.note.getModifierStartXY(this.position,this.index).x,u=Math.min(i.getYForTopText(this.text_line),h);if(u+=this.y_shift,this.delayed){let t=0;if(void 0!==this.delayXShift)t=this.delayXShift;else{t+=this.glyph.getMetrics().width/2;const e=nt.getNextContext(this.note.getTickContext());t+=e?.5*(e.getX()-c):.5*(i.x+i.width-c),this.delayXShift=t}c+=t}!function(...t){st.DEBUG&&s.L("Vex.Flow.Ornament",t)}("Rendering ornament: ",this.ornament,c,u),this.accidentalLower&&(this.accidentalLower.render(t,c,u),u-=this.accidentalLower.getMetrics().height,u-=this.render_options.accidentalLowerPadding),this.glyph.render(t,c,u),u-=this.glyph.getMetrics().height,this.accidentalUpper&&(u-=this.render_options.accidentalUpperPadding,this.accidentalUpper.render(t,c,u))}}class rt extends B{static get CATEGORY(){return"annotations"}static get Justify(){return{LEFT:1,CENTER:2,RIGHT:3,CENTER_STEM:4}}static get JustifyString(){return{left:rt.Justify.LEFT,right:rt.Justify.RIGHT,center:rt.Justify.CENTER,centerStem:rt.Justify.CENTER_STEM}}static get VerticalJustify(){return{TOP:1,CENTER:2,BOTTOM:3,CENTER_STEM:4}}static get VerticalJustifyString(){return{above:rt.VerticalJustify.TOP,top:rt.VerticalJustify.TOP,below:rt.VerticalJustify.BOTTOM,bottom:rt.VerticalJustify.BOTTOM,center:rt.VerticalJustify.CENTER,centerStem:rt.VerticalJustify.CENTER_STEM}}static format(t,e){if(!t||0===t.length)return!1;let i=0;for(let n=0;n<t.length;++n){const s=t[n];i=Math.max(s.getWidth(),i),s.getPosition()===B.Position.ABOVE?(s.setTextLine(e.top_text_line),e.top_text_line++):(s.setTextLine(e.text_line),e.text_line++)}return e.left_shift+=i/2,e.right_shift+=i/2,!0}constructor(t){super(),this.setAttribute("type","Annotation"),this.note=null,this.index=null,this.text=t,this.justification=rt.Justify.CENTER,this.vert_justification=rt.VerticalJustify.TOP,this.font={family:"Arial",size:10,weight:""},this.setWidth(m.textWidth(t))}getCategory(){return rt.CATEGORY}setFont(t,e,i){return this.font={family:t,size:e,weight:i},this}setVerticalJustification(t){return this.vert_justification="string"==typeof t?rt.VerticalJustifyString[t]:t,this}getJustification(){return this.justification}setJustification(t){return this.justification="string"==typeof t?rt.JustifyString[t]:t,this}draw(){if(this.checkContext(),!this.note)throw new s.RERR("NoNoteForAnnotation","Can't draw text annotation without an attached note.");this.setRendered();const t=this.note.getModifierStartXY(B.Position.ABOVE,this.index);this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.weight);const e=this.context.measureText(this.text).width,i=this.context.measureText("m").width;let n,r,o,a;n=this.justification===rt.Justify.LEFT?t.x:this.justification===rt.Justify.RIGHT?t.x-e:this.justification===rt.Justify.CENTER?t.x-e/2:this.note.getStemX()-e/2;const l=this.note.hasStem(),h=this.note.getStave();if(l&&(o=this.note.getStem().getExtents(),a=h.getSpacingBetweenLines()),this.vert_justification===rt.VerticalJustify.BOTTOM){if(r=h.getYForBottomText(this.text_line+m.TEXT_HEIGHT_OFFSET_HACK),l){const t=1===this.note.getStemDirection()?o.baseY:o.topY;r=Math.max(r,t+a*(this.text_line+2))}}else if(this.vert_justification===rt.VerticalJustify.CENTER){const t=this.note.getYForTopText(this.text_line)-1;r=t+(h.getYForBottomText(this.text_line)-t)/2+i/2}else if(this.vert_justification===rt.VerticalJustify.TOP)r=Math.min(h.getYForTopText(this.text_line),this.note.getYs()[0]-10),l&&(r=Math.min(r,o.topY-5-a*this.text_line));else{const t=this.note.getStemExtents();r=t.topY+(t.baseY-t.topY)/2+i/2}!function(...t){rt.DEBUG&&s.L("Vex.Flow.Annotation",t)}("Rendering annotation: ",this.text,n,r),this.context.fillText(this.text,n,r),this.context.restore()}}class ot extends B{static get CATEGORY(){return"bends"}static get UP(){return 0}static get DOWN(){return 1}static format(t,e){if(!t||0===t.length)return!1;let i=0;const n=e.top_text_line;for(let s=0;s<t.length;++s){const e=t[s];e.setXShift(i),i=e.getWidth(),e.setTextLine(n)}return e.right_shift+=i,e.top_text_line+=1,!0}constructor(t,e,i){super(),this.setAttribute("type","Bend"),this.text=t,this.x_shift=0,this.release=e||!1,this.font="10pt Arial",this.render_options={line_width:1.5,line_style:"#777777",bend_width:8,release_width:8},i?this.phrase=i:(this.phrase=[{type:ot.UP,text:this.text}],this.release&&this.phrase.push({type:ot.DOWN,text:""})),this.updateWidth()}getCategory(){return ot.CATEGORY}setXShift(t){this.x_shift=t,this.updateWidth()}setFont(t){return this.font=t,this}getText(){return this.text}updateWidth(){const t=this;function e(e){let i;return i=t.context?t.context.measureText(e).width:m.textWidth(e),i}let i=0;for(let n=0;n<this.phrase.length;++n){const t=this.phrase[n];if("width"in t)i+=t.width;else{const n=t.type===ot.UP?this.render_options.bend_width:this.render_options.release_width;t.width=s.Max(n,e(t.text))+3,t.draw_width=t.width/2,i+=t.width}}return this.setWidth(i+this.x_shift),this}draw(){if(this.checkContext(),!this.note||null==this.index)throw new s.RERR("NoNoteForBend","Can't draw bend without a note or index.");this.setRendered();const t=this.note.getModifierStartXY(B.Position.RIGHT,this.index);t.x+=3,t.y+=.5;const e=this.x_shift,i=this.context,n=this.note.getStave().getYForTopText(this.text_line)+3,r=this.note.getStave().getYForTopText(this.text_line)-1,o=this;function a(t,e,n,s){const r=t+n,a=e;i.save(),i.beginPath(),i.setLineWidth(o.render_options.line_width),i.setStrokeStyle(o.render_options.line_style),i.setFillStyle(o.render_options.line_style),i.moveTo(t,e),i.quadraticCurveTo(r,a,t+n,s),i.stroke(),i.restore()}function l(t,e,n,s){i.save(),i.beginPath(),i.setLineWidth(o.render_options.line_width),i.setStrokeStyle(o.render_options.line_style),i.setFillStyle(o.render_options.line_style),i.moveTo(t,s),i.quadraticCurveTo(t+n,s,t+n,e),i.stroke(),i.restore()}function h(t,e,n){const s=n||1;i.beginPath(),i.moveTo(t,e),i.lineTo(t-4,e+4*s),i.lineTo(t+4,e+4*s),i.closePath(),i.fill()}function c(t,e){i.save(),i.setRawFont(o.font);const n=t-i.measureText(e).width/2;i.fillText(e,n,r),i.restore()}let u=null,d=0;for(let s=0;s<this.phrase.length;++s){const i=this.phrase[s];0===s&&(i.draw_width+=e),d=i.draw_width+(u?u.draw_width:0)-(1===s?e:0),i.type===ot.UP&&(u&&u.type===ot.UP&&h(t.x,n),a(t.x,t.y,d,n)),i.type===ot.DOWN&&(u&&u.type===ot.UP&&l(t.x,t.y,d,n),u&&u.type===ot.DOWN&&(h(t.x,t.y,-1),l(t.x,t.y,d,n)),null===u&&(d=i.draw_width,l(t.x,t.y,d,n))),c(t.x+d,i.text),u=i,u.x=t.x,t.x+=d}u.type===ot.UP?h(u.x+d,n):u.type===ot.DOWN&&h(u.x+d,t.y,-1)}}class at extends B{static get CATEGORY(){return"vibratos"}static format(t,e,i){if(!t||0===t.length)return!1;let n=e.top_text_line,s=0,r=e.right_shift-7;const o=i.getModifiers(ot.CATEGORY);o&&o.length>0&&n--;for(let a=0;a<t.length;++a){const e=t[a];e.setXShift(r),e.setTextLine(n),s+=e.getWidth(),r+=s}return e.right_shift+=s,e.top_text_line+=1,!0}constructor(){super(),this.setAttribute("type","Vibrato"),this.position=B.Position.RIGHT,this.render_options={harsh:!1,vibrato_width:20,wave_height:6,wave_width:4,wave_girth:2},this.setVibratoWidth(this.render_options.vibrato_width)}getCategory(){return at.CATEGORY}setHarsh(t){return this.render_options.harsh=t,this}setVibratoWidth(t){return this.render_options.vibrato_width=t,this.setWidth(t),this}draw(){const t=this.checkContext();if(!this.note)throw new s.RERR("NoNoteForVibrato","Can't draw vibrato without an attached note.");this.setRendered();const e=this.note.getModifierStartXY(B.Position.RIGHT,this.index).x+this.x_shift,i=this.note.getYForTopText(this.text_line)+2;at.renderVibrato(t,e,i,this.render_options)}static renderVibrato(t,e,i,n){const{harsh:s,vibrato_width:r,wave_width:o,wave_girth:a,wave_height:l}=n,h=r/o;let c;if(t.beginPath(),s){for(t.moveTo(e,i+a+1),c=0;c<h/2;++c)t.lineTo(e+o,i-l/2),e+=o,t.lineTo(e+o,i+l/2),e+=o;for(c=0;c<h/2;++c)t.lineTo(e-o,i-l/2+a+1),e-=o,t.lineTo(e-o,i+l/2+a+1),e-=o;t.fill()}else{for(t.moveTo(e,i+a),c=0;c<h/2;++c)t.quadraticCurveTo(e+o/2,i-l/2,e+o,i),e+=o,t.quadraticCurveTo(e+o/2,i+l/2,e+o,i),e+=o;for(c=0;c<h/2;++c)t.quadraticCurveTo(e-o/2,i+l/2+a,e-o,i+a),e-=o,t.quadraticCurveTo(e-o/2,i-l/2+a,e-o,i+a),e-=o;t.fill()}}}function lt(...t){ht.DEBUG&&s.L("Vex.Flow.ModifierContext",t)}class ht{constructor(){this.modifiers={},this.preFormatted=!1,this.postFormatted=!1,this.width=0,this.spacing=0,this.state={left_shift:0,right_shift:0,text_line:0,top_text_line:0},this.PREFORMAT=[k,O,V,z,K,Y,j,q,it,st,rt,ot,at],this.POSTFORMAT=[k]}addModifier(t){const e=t.getCategory();return this.modifiers[e]||(this.modifiers[e]=[]),this.modifiers[e].push(t),t.setModifierContext(this),this.preFormatted=!1,this}getModifiers(t){return this.modifiers[t]}getWidth(){return this.width}getExtraLeftPx(){return this.state.left_shift}getExtraRightPx(){return this.state.right_shift}getState(){return this.state}getMetrics(){if(!this.formatted)throw new s.RERR("UnformattedModifier","Unformatted modifier has no metrics.");return{width:this.state.left_shift+this.state.right_shift+this.spacing,spacing:this.spacing,extra_left_px:this.state.left_shift,extra_right_px:this.state.right_shift}}preFormat(){this.preFormatted||(this.PREFORMAT.forEach((t=>{lt("Preformatting ModifierContext: ",t.CATEGORY),t.format(this.getModifiers(t.CATEGORY),this.state,this)})),this.width=this.state.left_shift+this.state.right_shift,this.preFormatted=!0)}postFormat(){this.postFormatted||this.POSTFORMAT.forEach((t=>{lt("Postformatting ModifierContext: ",t.CATEGORY),t.postFormat(this.getModifiers(t.CATEGORY),this)}))}}function ct(t,e,i,n){let r=e;for(i+=1;i<t.length;i+=1){const e=t[i];if(!e.isRest()&&!e.shouldIgnoreTicks()){r=e.getLineForRest();break}}if(n&&e!==r){const t=Math.max(e,r),i=Math.min(e,r);r=s.MidLine(t,i)}return r}function ut(t,e,i){if(!t||!t.length)throw new s.RERR("BadArgument","No voices to format");const n=t[0].getTotalTicks(),o=t.reduce(((t,e)=>{if(!e.getTotalTicks().equals(n))throw new s.RERR("TickMismatch","Voices should have same total note duration in ticks.");if(e.getMode()===L.Mode.STRICT&&!e.isComplete())throw new s.RERR("IncompleteVoice","Voice does not have enough notes.");return Math.max(t,r.LCM(t,e.getResolutionMultiplier()))}),1),a={},l=[],h=[];return t.forEach((t=>{const n=new r(0,o);t.getTickables().forEach((t=>{const s=n.numerator;if(!a[s]){const t=new e;h.push(t),a[s]=t}i(t,a[s]),l.push(s),n.add(t.getTicks())}))})),{map:a,array:h,list:s.SortAndUnique(l,((t,e)=>t-e),((t,e)=>t===e)),resolutionMultiplier:o}}class dt{static SimpleFormat(t,e=0,{paddingBetween:i=10}={}){t.reduce(((t,e)=>{e.addToModifierContext(new ht);const n=(new nt).addTickable(e).preFormat(),s=n.getExtraPx();return n.setX(t+s.left),t+n.getWidth()+s.right+i}),e)}static plotDebugging(t,e,i,n,s){const r=i+R.STAVEPADDING,o=e.contextGaps;t.save(),t.setFont("Arial",8,""),o.gaps.forEach((e=>{var i,o,a;i=r+e.x1,o=r+e.x2,a="#aaa",t.beginPath(),t.setStrokeStyle(a),t.setFillStyle(a),t.setLineWidth(1),t.fillRect(i,n,o-i,s-n),t.fillText(Math.round(e.x2-e.x1),r+e.x1,s+12)})),t.fillText(Math.round(o.total)+"px",r-20,s+12),t.setFillStyle("red"),t.fillText("Loss: "+e.lossHistory.map((t=>Math.round(t))),r-20,s+22),t.restore()}static FormatAndDraw(t,e,i,n){const r={auto_beam:!1,align_rests:!1};"object"==typeof n?s.Merge(r,n):"boolean"==typeof n&&(r.auto_beam=n);const o=new L(m.TIME4_4).setMode(L.Mode.SOFT).addTickables(i),a=r.auto_beam?P.applyAndGetBeams(o):[];return(new dt).joinVoices([o],{align_rests:r.align_rests}).formatToStave([o],e,{align_rests:r.align_rests,stave:e}),o.setStave(e).draw(t,e),a.forEach((e=>e.setContext(t).draw())),o.getBoundingBox()}static FormatAndDrawTab(t,e,i,n,r,o,a){const l={auto_beam:o,align_rests:!1};"object"==typeof a?s.Merge(l,a):"boolean"==typeof a&&(l.auto_beam=a);const h=new L(m.TIME4_4).setMode(L.Mode.SOFT).addTickables(r),c=new L(m.TIME4_4).setMode(L.Mode.SOFT).addTickables(n),u=l.auto_beam?P.applyAndGetBeams(h):[];(new dt).joinVoices([h],{align_rests:l.align_rests}).joinVoices([c]).formatToStave([h,c],i,{align_rests:l.align_rests}),h.draw(t,i),c.draw(t,e),u.forEach((e=>e.setContext(t).draw())),new C(i,e).setContext(t).draw()}static AlignRestsToNotes(t,e,i){return t.forEach(((n,s)=>{if(n instanceof k&&n.isRest()){if(n.tuplet&&!i)return;const r=n.getGlyph().position.toUpperCase();if("R/4"!==r&&"B/4"!==r)return;if(e||null!=n.beam){const e=n.getKeyProps()[0];if(0===s)e.line=ct(t,e.line,s,!1),n.setKeyLine(0,e.line);else if(s>0&&s<t.length){let i;t[s-1].isRest()?(i=t[s-1].getKeyProps()[0].line,e.line=i):(i=t[s-1].getLineForRest(),e.line=ct(t,i,s,!0)),n.setKeyLine(0,e.line)}}}})),this}constructor(){this.minTotalWidth=0,this.hasMinTotalWidth=!1,this.totalTicks=new r(0,1),this.tickContexts=null,this.modiferContexts=null,this.contextGaps={total:0,gaps:[]},this.voices=[]}alignRests(t,e){if(!t||!t.length)throw new s.RERR("BadArgument","No voices to format rests");t.forEach((t=>dt.AlignRestsToNotes(t.getTickables(),e)))}preCalculateMinTotalWidth(t){if(this.hasMinTotalWidth)return this.minTotalWidth;if(!this.tickContexts){if(!t)throw new s.RERR("BadArgument","'voices' required to run preCalculateMinTotalWidth");this.createTickContexts(t)}const{list:e,map:i}=this.tickContexts;return this.minTotalWidth=e.map((t=>{const e=i[t];return e.preFormat(),e.getWidth()})).reduce(((t,e)=>t+e),0),this.hasMinTotalWidth=!0,this.minTotalWidth}getMinTotalWidth(){if(!this.hasMinTotalWidth)throw new s.RERR("NoMinTotalWidth","Call 'preCalculateMinTotalWidth' or 'preFormat' before calling 'getMinTotalWidth'");return this.minTotalWidth}createModifierContexts(t){const e=ut(t,ht,((t,e)=>t.addToModifierContext(e)));return this.modiferContexts=e,e}createTickContexts(t){const e=ut(t,nt,((t,e)=>e.addTickable(t)));return e.array.forEach((t=>{t.tContexts=e.array})),this.totalTicks=t[0].getTicksUsed().clone(),this.tickContexts=e,e}preFormat(t=0,e,i,n){const s=this.tickContexts,{list:r,map:o,resolutionMultiplier:a}=s;i&&n&&i.forEach((t=>t.setStave(n).preFormat()));let l=0,h=0;const c=t/2;if(this.minTotalWidth=0,r.forEach((t=>{const i=o[t];e&&i.setContext(e),i.preFormat();const n=i.getWidth();this.minTotalWidth+=n;const s=i.getMetrics();l=l+h+s.extraLeftPx,i.setX(l),h=n-s.extraLeftPx})),this.minTotalWidth=l+h,this.hasMinTotalWidth=!0,t<=0)return;const u=(t-this.minTotalWidth)/(this.totalTicks.value()*a);let d=0;r.forEach(((t,e)=>{const i=r[e-1]||0,n=o[t];d+=(t-i)*u,n.setX(n.getX()+d),n.getCenterAlignedTickables().forEach((t=>{t.center_x_shift=c-n.getX()}))})),1!==r.length&&(this.justifyWidth=t,this.lossHistory=[],this.evaluate())}evaluate(){const t=this.justifyWidth;this.contextGaps={total:0,gaps:[]},this.tickContexts.list.forEach(((t,e)=>{if(0===e)return;const i=this.tickContexts.list[e-1],n=this.tickContexts.map[i],s=this.tickContexts.map[t],r=n.getMetrics(),o=n.getX()+r.width,a=s.getX(),l=a-o;this.contextGaps.total+=l,this.contextGaps.gaps.push({x1:o,x2:a}),s.getFormatterMetrics().freedom.left=l,n.getFormatterMetrics().freedom.right=l}));const e=this.durationStats={};this.voices.forEach((i=>{i.getTickables().forEach(((i,n,s)=>{const r=i.getTicks().clone().simplify().toString(),o=i.getMetrics(),a=i.getFormatterMetrics(),l=i.getX()+o.noteWidth+o.modRightPx+o.extraRightPx;let h=0;if(n<s.length-1){const t=s[n+1],e=t.getMetrics();h=t.getX()-e.modLeftPx-e.extraLeftPx-l,a.space.used=t.getX()-i.getX(),t.getFormatterMetrics().freedom.left=h}else h=t-l,a.space.used=t-i.getX();a.freedom.right=h,function(t,i){const n=e[t];void 0===n?e[t]={mean:i,count:1}:(n.count+=1,n.mean=(n.mean+i)/2)}(r,a.space.used)}))}));let i=0;return this.voices.forEach((t=>{t.getTickables().forEach((t=>{const n=t.getTicks().clone().simplify().toString(),s=t.getFormatterMetrics();s.iterations+=1,s.space.deviation=s.space.used-e[n].mean,s.duration=n,s.space.mean=e[n].mean,i+=Math.pow(e[n].mean,2)}))})),this.totalCost=Math.sqrt(i),this.lossHistory.push(this.totalCost),this}tune(){let t=0;return this.tickContexts.list.forEach(((e,i,n)=>{const s=this.tickContexts.map[e],r=i>0?this.tickContexts.map[n[i-1]]:null,o=i<n.length-1?this.tickContexts.map[n[i+1]]:null;var a,l,h,c;l=r,h=o,c=t,(a=s).setX(a.getX()+c),a.getFormatterMetrics().freedom.left+=c,a.getFormatterMetrics().freedom.right-=c,l&&(l.getFormatterMetrics().freedom.right+=c),h&&(h.getFormatterMetrics().freedom.left-=c);const u=-s.getTickables().map((t=>t.getFormatterMetrics().space.deviation)).reduce(((t,e)=>t+e));u>0?t=-Math.min(s.getFormatterMetrics().freedom.right,Math.abs(u)):u<0&&(t=o?Math.min(o.getFormatterMetrics().freedom.right,Math.abs(u)):0);const d=Math.min(5,Math.abs(t));t=t>0?d:-d})),this.evaluate()}postFormat(){const t=t=>t.list.forEach((e=>t.map[e].postFormat()));return t(this.modiferContexts),t(this.tickContexts),this}joinVoices(t){return this.createModifierContexts(t),this.hasMinTotalWidth=!1,this}format(t,e,i){const n={align_rests:!1,context:null,stave:null};return s.Merge(n,i),this.voices=t,this.alignRests(t,n.align_rests),this.createTickContexts(t),this.preFormat(e,n.context,t,n.stave),n.stave&&this.postFormat(),this}formatToStave(t,e,i){const n=e.getNoteEndX()-e.getNoteStartX()-10;!function(...t){dt.DEBUG&&s.L("Vex.Flow.Formatter",t)}("Formatting voices to width: ",n);const r={context:e.getContext()};return s.Merge(r,i),this.format(t,n,r)}}class ft extends h{static get Position(){return{LEFT:1,RIGHT:2,ABOVE:3,BELOW:4,BEGIN:5,END:6}}constructor(){super(),this.setAttribute("type","StaveModifier"),this.padding=10,this.position=ft.Position.ABOVE,this.layoutMetrics=null}getPosition(){return this.position}setPosition(t){return this.position=t,this}getStave(){return this.stave}setStave(t){return this.stave=t,this}getWidth(){return this.width}setWidth(t){return this.width=t,this}getX(){return this.x}setX(t){return this.x=t,this}getCategory(){return""}makeSpacer(t){return{getContext:()=>!0,setStave(){},renderToStave(){},getMetrics:()=>({width:t})}}placeGlyphOnLine(t,e,i){t.setYShift(e.getYForLine(i)-e.getYForGlyphs())}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}}class pt extends ft{static get CATEGORY(){return"barlines"}static get type(){return{SINGLE:1,DOUBLE:2,END:3,REPEAT_BEGIN:4,REPEAT_END:5,REPEAT_BOTH:6,NONE:7}}static get typeString(){return{single:pt.type.SINGLE,double:pt.type.DOUBLE,end:pt.type.END,repeatBegin:pt.type.REPEAT_BEGIN,repeatEnd:pt.type.REPEAT_END,repeatBoth:pt.type.REPEAT_BOTH,none:pt.type.NONE}}constructor(t){super(),this.setAttribute("type","Barline"),this.thickness=m.STAVE_LINE_THICKNESS;const e=pt.type;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(ft.Position.BEGIN),this.setType(t)}getCategory(){return pt.CATEGORY}getType(){return this.type}setType(t){return this.type="string"==typeof t?pt.typeString[t]:t,this.setWidth(this.widths[this.type]),this.setPadding(this.paddings[this.type]),this.setLayoutMetrics(this.layoutMetricsMap[this.type]),this}draw(t){switch(t.checkContext(),this.setRendered(),this.type){case pt.type.SINGLE:this.drawVerticalBar(t,this.x,!1);break;case pt.type.DOUBLE:this.drawVerticalBar(t,this.x,!0);break;case pt.type.END:this.drawVerticalEndBar(t,this.x);break;case pt.type.REPEAT_BEGIN:this.drawRepeatBar(t,this.x,!0),t.getX()!==this.x&&this.drawVerticalBar(t,t.getX());break;case pt.type.REPEAT_END:this.drawRepeatBar(t,this.x,!1);break;case pt.type.REPEAT_BOTH:this.drawRepeatBar(t,this.x,!1),this.drawRepeatBar(t,this.x,!0)}}drawVerticalBar(t,e,i){t.checkContext();const n=t.getTopLineTopY(),s=t.getBottomLineBottomY();i&&t.context.fillRect(e-3,n,1,s-n),t.context.fillRect(e,n,1,s-n)}drawVerticalEndBar(t,e){t.checkContext();const i=t.getTopLineTopY(),n=t.getBottomLineBottomY();t.context.fillRect(e-5,i,1,n-i),t.context.fillRect(e-2,i,3,n-i)}drawRepeatBar(t,e,i){t.checkContext();const n=t.getTopLineTopY(),s=t.getBottomLineBottomY();let r=3;i||(r=-5),t.context.fillRect(e+r,n,1,s-n),t.context.fillRect(e-2,n,3,s-n),i?r+=4:r-=4;const o=e+r+1;let a=(t.getNumLines()-1)*t.getSpacingBetweenLines();a=a/2-t.getSpacingBetweenLines()/2;let l=n+a+1;t.context.beginPath(),t.context.arc(o,l,2,0,2*Math.PI,!1),t.context.fill(),l+=t.getSpacingBetweenLines(),t.context.beginPath(),t.context.arc(o,l,2,0,2*Math.PI,!1),t.context.fill()}}class mt extends ft{static get CATEGORY(){return"repetitions"}static get type(){return{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}}constructor(t,e,i){super(),this.setAttribute("type","Repetition"),this.symbol_type=t,this.x=e,this.x_shift=0,this.y_shift=i,this.font={family:"times",size:12,weight:"bold italic"}}getCategory(){return mt.CATEGORY}setShiftX(t){return this.x_shift=t,this}setShiftY(t){return this.y_shift=t,this}setX(t){return this.x=t,this}draw(t,e){switch(this.setRendered(),this.symbol_type){case mt.type.CODA_RIGHT:this.drawCodaFixed(t,e+t.width);break;case mt.type.CODA_LEFT:this.drawSymbolText(t,e,"Coda",!0);break;case mt.type.SEGNO_LEFT:this.drawSignoFixed(t,e);break;case mt.type.SEGNO_RIGHT:this.drawSignoFixed(t,e+t.width);break;case mt.type.DC:this.drawSymbolText(t,e,"D.C.",!1);break;case mt.type.DC_AL_CODA:this.drawSymbolText(t,e,"D.C. al",!0);break;case mt.type.DC_AL_FINE:this.drawSymbolText(t,e,"D.C. al Fine",!1);break;case mt.type.DS:this.drawSymbolText(t,e,"D.S.",!1);break;case mt.type.DS_AL_CODA:this.drawSymbolText(t,e,"D.S. al",!0);break;case mt.type.DS_AL_FINE:this.drawSymbolText(t,e,"D.S. al Fine",!1);break;case mt.type.FINE:this.drawSymbolText(t,e,"Fine",!1);break;case mt.type.TO_CODA:this.drawSymbolText(t,e,"To",!0)}return this}drawCodaFixed(t,e){const i=t.getYForTopText(t.options.num_lines)+this.y_shift;return p.renderGlyph(t.context,this.x+e+this.x_shift,i+25,40,"v4d",!0),this}drawSignoFixed(t,e){const i=t.getYForTopText(t.options.num_lines)+this.y_shift;return p.renderGlyph(t.context,this.x+e+this.x_shift,i+25,30,"v8c",!0),this}drawSymbolText(t,e,i,n){const s=t.checkContext();s.save(),s.setFont(this.font.family,this.font.size,this.font.weight);let r=0+this.x_shift,o=e+this.x_shift;this.symbol_type===mt.type.CODA_LEFT?(r=this.x+t.options.vertical_bar_width,o=r+s.measureText(i).width+12):this.symbol_type===mt.type.TO_CODA||this.symbol_type===mt.type.DS_AL_CODA?(this.x_shift=-(r+s.measureText(i).width+12+t.options.vertical_bar_width+12),r=this.x+this.x_shift+t.options.vertical_bar_width,o=r+s.measureText(i).width+12):(o=this.x+e+t.width-5+this.x_shift,r=o-+s.measureText(i).width-12);const a=t.getYForTopText(t.options.num_lines)+this.y_shift+25;return n&&p.renderGlyph(s,o,a,40,"v4d",!0),s.fillText(i,r,a+5),s.restore(),this}}class bt extends ft{static get CATEGORY(){return"stavesection"}constructor(t,e,i){super(),this.setAttribute("type","StaveSection"),this.setWidth(16),this.section=t,this.x=e,this.shift_x=0,this.shift_y=i,this.font={family:"sans-serif",size:12,weight:"bold"}}getCategory(){return bt.CATEGORY}setStaveSection(t){return this.section=t,this}setShiftX(t){return this.shift_x=t,this}setShiftY(t){return this.shift_y=t,this}draw(t,e){const i=t.checkContext();this.setRendered(),i.save(),i.lineWidth=2,i.setFont(this.font.family,this.font.size,this.font.weight);const n=i.measureText(""+this.section),s=n.width,r=n.height;let o=s+6;o<18&&(o=18);const a=r,l=t.getYForTopText(3)+this.shift_y;let h=this.x+e;return i.beginPath(),i.lineWidth=2,i.rect(h,l+r/4,o,a),i.stroke(),h+=(o-s)/2,i.fillText(""+this.section,h,l+16),i.restore(),this}}class gt extends ft{static get CATEGORY(){return"stavetempo"}constructor(t,e,i){super(),this.setAttribute("type","StaveTempo"),this.tempo=t,this.position=B.Position.ABOVE,this.x=e,this.shift_x=10,this.shift_y=i,this.font={family:"times",size:14,weight:"bold"},this.render_options={glyph_font_scale:30}}getCategory(){return gt.CATEGORY}setTempo(t){return this.tempo=t,this}setShiftX(t){return this.shift_x=t,this}setShiftY(t){return this.shift_y=t,this}draw(t,e){const i=t.checkContext();this.setRendered();const n=this.render_options,s=n.glyph_font_scale/38,r=this.tempo.name,o=this.tempo.duration,a=this.tempo.dots,l=this.tempo.bpm,h=this.font;let c=this.x+this.shift_x+e;const u=t.getYForTopText(1)+this.shift_y;if(i.save(),r&&(i.setFont(h.family,h.size,h.weight),i.fillText(r,c,u),c+=i.measureText(r).width),o&&l){i.setFont(h.family,h.size,"normal"),r&&(c+=i.measureText(" ").width,i.fillText("(",c,u),c+=i.measureText("(").width);const t=m.getGlyphProps(o);if(c+=3*s,p.renderGlyph(i,c,u,n.glyph_font_scale,t.code_head),c+=t.getWidth()*s,t.stem){let e=30;t.beam_count&&(e+=3*(t.beam_count-1)),e*=s;const r=u-e;i.fillRect(c-s,r,s,e),t.flag&&(p.renderGlyph(i,c,r,n.glyph_font_scale,t.code_flag_upstem),a||(c+=6*s))}for(let e=0;e<a;e++)c+=6*s,i.beginPath(),i.arc(c,u+2*s,2*s,0,2*Math.PI,!1),i.fill();i.fillText(" = "+l+(r?")":""),c+3*s,u)}return i.restore(),this}}class yt extends R{static get Justification(){return{LEFT:1,CENTER:2,RIGHT:3}}static get GLYPHS(){return{segno:{code:"v8c",point:40,x_shift:0,y_shift:-10},tr:{code:"v1f",point:40,x_shift:0,y_shift:0},mordent_upper:{code:"v1e",point:40,x_shift:0,y_shift:0},mordent_lower:{code:"v45",point:40,x_shift:0,y_shift:0},f:{code:"vba",point:40,x_shift:0,y_shift:0},p:{code:"vbf",point:40,x_shift:0,y_shift:0},m:{code:"v62",point:40,x_shift:0,y_shift:0},s:{code:"v4a",point:40,x_shift:0,y_shift:0},z:{code:"v80",point:40,x_shift:0,y_shift:0},coda:{code:"v4d",point:40,x_shift:0,y_shift:-8},pedal_open:{code:"v36",point:40,x_shift:0,y_shift:0},pedal_close:{code:"v5d",point:40,x_shift:0,y_shift:3},caesura_straight:{code:"v34",point:40,x_shift:0,y_shift:2},caesura_curved:{code:"v4b",point:40,x_shift:0,y_shift:2},breath:{code:"v6c",point:40,x_shift:0,y_shift:0},tick:{code:"v6f",point:50,x_shift:0,y_shift:0},turn:{code:"v72",point:40,x_shift:0,y_shift:0},turn_inverted:{code:"v33",point:40,x_shift:0,y_shift:0},mordent:{code:"v1e",point:40,x_shift:0,y_shift:0}}}constructor(t){if(super(t),this.setAttribute("type","TextNote"),this.text=t.text,this.superscript=t.superscript,this.subscript=t.subscript,this.glyph_type=t.glyph,this.glyph=null,this.font={family:"Arial",size:12,weight:""},t.font&&(this.font=t.font),this.glyph_type){const t=yt.GLYPHS[this.glyph_type];if(!t)throw new s.RERR("Invalid glyph type: "+this.glyph_type);this.glyph=new p(t.code,t.point,{cache:!1}),t.width?this.setWidth(t.width):this.setWidth(this.glyph.getMetrics().width),this.glyph_struct=t}else this.setWidth(m.textWidth(this.text));this.line=t.line||0,this.smooth=t.smooth||!1,this.ignore_ticks=t.ignore_ticks||!1,this.justification=yt.Justification.LEFT}setJustification(t){return this.justification=t,this}setLine(t){return this.line=t,this}preFormat(){this.checkContext(),this.preFormatted||(this.smooth?this.setWidth(0):this.glyph||this.setWidth(this.context.measureText(this.text).width),this.justification===yt.Justification.CENTER?this.extraLeftPx=this.width/2:this.justification===yt.Justification.RIGHT&&(this.extraLeftPx=this.width),this.setPreFormatted(!0))}draw(){if(this.checkContext(),!this.stave)throw new s.RERR("NoStave","Can't draw without a stave.");this.setRendered();const t=this.context;let e,i=this.getAbsoluteX();if(this.justification===yt.Justification.CENTER?i-=this.getWidth()/2:this.justification===yt.Justification.RIGHT&&(i-=this.getWidth()),this.glyph)e=this.stave.getYForLine(this.line+-3),this.glyph.render(this.context,i+this.glyph_struct.x_shift,e+this.glyph_struct.y_shift);else{e=this.stave.getYForLine(this.line+-3),this.applyStyle(t),t.setFont(this.font.family,this.font.size,this.font.weight),t.fillText(this.text,i,e);const n=t.measureText("M").width,s=t.measureText(this.text).width;this.superscript&&(t.setFont(this.font.family,this.font.size/1.3,this.font.weight),t.fillText(this.superscript,i+s+2,e-n/2.2)),this.subscript&&(t.setFont(this.font.family,this.font.size/1.3,this.font.weight),t.fillText(this.subscript,i+s+2,e+n/2.2-1)),this.restoreStyle(t)}}}class St extends ft{static get CATEGORY(){return"stavetext"}constructor(t,e,i){super(),this.setAttribute("type","StaveText"),this.setWidth(16),this.text=t,this.position=e,this.options={shift_x:0,shift_y:0,justification:yt.Justification.CENTER},s.Merge(this.options,i),this.font={family:"times",size:16,weight:"normal"}}getCategory(){return St.CATEGORY}setStaveText(t){return this.text=t,this}setShiftX(t){return this.shift_x=t,this}setShiftY(t){return this.shift_y=t,this}setFont(t){s.Merge(this.font,t)}setText(t){this.text=t}draw(t){const e=t.checkContext();this.setRendered(),e.save(),e.lineWidth=2,e.setFont(this.font.family,this.font.size,this.font.weight);const i=e.measureText(""+this.text).width;let n,r;const o=ft.Position,a=yt.Justification;switch(this.position){case o.LEFT:case o.RIGHT:r=(t.getYForLine(0)+t.getBottomLineY())/2+this.options.shift_y,n=this.position===o.LEFT?t.getX()-i-24+this.options.shift_x:t.getX()+t.getWidth()+24+this.options.shift_x;break;case o.ABOVE:case o.BELOW:n=t.getX()+this.options.shift_x,this.options.justification===a.CENTER?n+=t.getWidth()/2-i/2:this.options.justification===a.RIGHT&&(n+=t.getWidth()-i),r=this.position===o.ABOVE?t.getYForTopText(2)+this.options.shift_y:t.getYForBottomText(2)+this.options.shift_y;break;default:throw new s.RERR("InvalidPosition","Value Must be in Modifier.Position.")}return e.fillText(""+this.text,n,r+4),e.restore(),this}}class vt extends ft{static get CATEGORY(){return"clefs"}static get types(){return{treble:{code:"v83",line:3},bass:{code:"v79",line:1},alto:{code:"vad",line:2},tenor:{code:"vad",line:1},percussion:{code:"v59",line:2},soprano:{code:"vad",line:4},"mezzo-soprano":{code:"vad",line:3},"baritone-c":{code:"vad",line:0},"baritone-f":{code:"v79",line:2},subbass:{code:"v79",line:0},french:{code:"v83",line:4},tab:{code:"v2f"}}}static get sizes(){return{default:{point:40,width:26},small:{point:32,width:20}}}static get annotations(){return{"8va":{code:"v8",sizes:{default:{point:20,attachments:{treble:{line:-1.2,x_shift:11}}},small:{point:18,attachments:{treble:{line:-.4,x_shift:8}}}}},"8vb":{code:"v8",sizes:{default:{point:20,attachments:{treble:{line:6.3,x_shift:10},bass:{line:4,x_shift:1}}},small:{point:18,attachments:{treble:{line:5.8,x_shift:6},bass:{line:3.5,x_shift:.5}}}}}}}constructor(t,e,i){super(),this.setAttribute("type","Clef"),this.setPosition(ft.Position.BEGIN),this.setType(t,e,i),this.setWidth(vt.sizes[this.size].width),function(...t){vt.DEBUG&&s.L("Vex.Flow.Clef",t)}("Creating clef:",t)}getCategory(){return vt.CATEGORY}setType(t,e,i){if(this.type=t,this.clef=vt.types[t],this.size=void 0===e?"default":e,this.clef.point=vt.sizes[this.size].point,this.glyph=new p(this.clef.code,this.clef.point),void 0!==i){const t=vt.annotations[i];this.annotation={code:t.code,point:t.sizes[this.size].point,line:t.sizes[this.size].attachments[this.type].line,x_shift:t.sizes[this.size].attachments[this.type].x_shift},this.attachment=new p(this.annotation.code,this.annotation.point),this.attachment.metrics.x_max=0,this.attachment.setXShift(this.annotation.x_shift)}else this.annotation=void 0;return this}getWidth(){if("tab"===this.type&&!this.stave)throw new s.RERR("ClefError","Can't get width without stave.");return this.width}setStave(t){if(this.stave=t,"tab"!==this.type)return this;let e,i;const n=this.stave.getOptions().num_lines;switch(n){case 8:e=55,i=14;break;case 7:e=47,i=8;break;case 6:e=40,i=1;break;case 5:e=30,i=-6;break;case 4:e=23,i=-12;break;default:throw new s.RERR("ClefError",`Invalid number of lines: ${n}`)}return this.glyph.setPoint(e),this.glyph.setYShift(i),this}draw(){if(!this.x)throw new s.RERR("ClefError","Can't draw clef without x.");if(!this.stave)throw new s.RERR("ClefError","Can't draw clef without stave.");this.setRendered(),this.glyph.setStave(this.stave),this.glyph.setContext(this.stave.context),void 0!==this.clef.line&&this.placeGlyphOnLine(this.glyph,this.stave,this.clef.line),this.glyph.renderToStave(this.x),void 0!==this.annotation&&(this.placeGlyphOnLine(this.attachment,this.stave,this.annotation.line),this.attachment.setStave(this.stave),this.attachment.setContext(this.stave.context),this.attachment.renderToStave(this.x))}}class xt extends ft{static get CATEGORY(){return"keysignatures"}static get accidentalSpacing(){return{"#":{above:6,below:4},b:{above:4,below:7},n:{above:4,below:1},"##":{above:6,below:4},bb:{above:4,below:7},db:{above:4,below:7},d:{above:4,below:7},bbs:{above:4,below:7},"++":{above:6,below:4},"+":{above:6,below:4},"+-":{above:6,below:4},"++-":{above:6,below:4},bs:{above:4,below:10},bss:{above:4,below:10}}}constructor(t,e,i){super(),this.setAttribute("type","KeySignature"),this.setKeySig(t,e,i),this.setPosition(ft.Position.BEGIN),this.glyphFontScale=38,this.glyphs=[],this.xPositions=[],this.paddingForced=!1}getCategory(){return xt.CATEGORY}convertToGlyph(t,e){const i=m.accidentalCodes(t.type),n=new p(i.code,this.glyphFontScale);let s=1;if("n"===t.type&&e){const i=xt.accidentalSpacing[e.type];i&&(s=e.line>=t.line?i.above:i.below)}this.placeGlyphOnLine(n,this.stave,t.line),this.glyphs.push(n);const r=this.xPositions[this.xPositions.length-1],o=n.getMetrics().width+s;this.xPositions.push(r+o),this.width+=o}cancelKey(t){return this.formatted=!1,this.cancelKeySpec=t,this}convertToCancelAccList(t){const e=m.keySignature(t),i=this.accList.length>0&&e.length>0&&e[0].type!==this.accList[0].type,n=i?e.length:e.length-this.accList.length;if(n<1)return;const s=[];for(let r=0;r<n;r++){let t=r;i||(t=e.length-n+r);const o=e[t];s.push({type:"n",line:o.line})}return this.accList=s.concat(this.accList),{accList:s,type:e[0].type}}addToStave(t){return this.paddingForced=!0,t.addModifier(this),this}convertAccLines(t,e,i=this.accList){let n,s,r=0;switch(t){case"soprano":"#"===e?n=[2.5,.5,2,0,1.5,-.5,1]:r=-1;break;case"mezzo-soprano":"b"===e?n=[0,2,.5,2.5,1,3,1.5]:r=1.5;break;case"alto":r=.5;break;case"tenor":"#"===e?n=[3,1,2.5,.5,2,0,1.5]:r=-.5;break;case"baritone-f":case"baritone-c":"b"===e?n=[.5,2.5,1,3,1.5,3.5,2]:r=2;break;case"bass":case"french":r=1}if(void 0!==n)for(s=0;s<i.length;++s)i[s].line=n[s];else if(0!==r)for(s=0;s<i.length;++s)i[s].line+=r}getPadding(t){return this.formatted||this.format(),0===this.glyphs.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(){if(!this.stave)throw new s.RERR("KeySignatureError","Can't draw key signature without stave.");this.width=0,this.glyphs=[],this.xPositions=[0],this.accList=m.keySignature(this.keySpec);const t=this.accList,e=t.length>0?t[0].type:null;let i;if(this.cancelKeySpec&&(i=this.convertToCancelAccList(this.cancelKeySpec)),this.alterKeySpec&&this.convertToAlterAccList(this.alterKeySpec),this.accList.length>0){const n=(this.position===ft.Position.END?this.stave.endClef:this.stave.clef)||this.stave.clef;i&&this.convertAccLines(n,i.type,i.accList),this.convertAccLines(n,e,t);for(let t=0;t<this.accList.length;++t)this.convertToGlyph(this.accList[t],this.accList[t+1])}this.formatted=!0}draw(){if(!this.x)throw new s.RERR("KeySignatureError","Can't draw key signature without x.");if(!this.stave)throw new s.RERR("KeySignatureError","Can't draw key signature without stave.");this.formatted||this.format(),this.setRendered();for(let t=0;t<this.glyphs.length;t++){const e=this.glyphs[t],i=this.x+this.xPositions[t];e.setStave(this.stave),e.setContext(this.stave.context),e.renderToStave(i)}}}class Et extends ft{static get CATEGORY(){return"timesignatures"}static get glyphs(){return{C:{code:"v41",point:40,line:2},"C|":{code:"vb6",point:40,line:2}}}constructor(t=null,e=15,i=!0){if(super(),this.setAttribute("type","TimeSignature"),this.validate_args=i,null===t)return;const n=e;this.point=40,this.topLine=2,this.bottomLine=4,this.setPosition(ft.Position.BEGIN),this.setTimeSig(t),this.setWidth(this.timeSig.glyph.getMetrics().width),this.setPadding(n)}getCategory(){return Et.CATEGORY}parseTimeSpec(t){if("C"===t||"C|"===t){const{line:e,code:i,point:n}=Et.glyphs[t];return{line:e,num:!1,glyph:new p(i,n)}}this.validate_args&&(t=>{const e=t.split("/").filter((t=>""!==t));if(2!==e.length)throw new s.RERR("BadTimeSignature",`Invalid time spec: ${t}. Must be in the form "<numerator>/<denominator>"`);e.forEach((e=>{if(isNaN(Number(e)))throw new s.RERR("BadTimeSignature",`Invalid time spec: ${t}. Must contain two valid numbers.`)}))})(t);const[e,i]=t.split("/").map((t=>t.split("")));return{num:!0,glyph:this.makeTimeSignatureGlyph(e,i)}}makeTimeSignatureGlyph(t,e){const i=new p("v0",this.point);i.topGlyphs=[],i.botGlyphs=[];let n=0;for(let c=0;c<t.length;++c){const e=t[c],s=new p("v"+e,this.point);i.topGlyphs.push(s),n+=s.getMetrics().width}let s=0;for(let c=0;c<e.length;++c){const t=e[c],n=new p("v"+t,this.point);i.botGlyphs.push(n),s+=n.getMetrics().width}const r=n>s?n:s,o=i.getMetrics().x_min;i.getMetrics=()=>({x_min:o,x_max:o+r,width:r});const a=(r-n)/2,l=(r-s)/2,h=this;return i.renderToStave=function(t){let e=t+a;for(let i=0;i<this.topGlyphs.length;++i){const t=this.topGlyphs[i];p.renderOutline(this.context,t.metrics.outline,t.scale,e+t.x_shift,this.stave.getYForLine(h.topLine)),e+=t.getMetrics().width}e=t+l;for(let i=0;i<this.botGlyphs.length;++i){const t=this.botGlyphs[i];h.placeGlyphOnLine(t,this.stave,t.line),p.renderOutline(this.context,t.metrics.outline,t.scale,e+t.x_shift,this.stave.getYForLine(h.bottomLine)),e+=t.getMetrics().width}},i}getTimeSig(){return this.timeSig}setTimeSig(t){return this.timeSig=this.parseTimeSpec(t),this}draw(){if(!this.x)throw new s.RERR("TimeSignatureError","Can't draw time signature without x.");if(!this.stave)throw new s.RERR("TimeSignatureError","Can't draw time signature without stave.");this.setRendered(),this.timeSig.glyph.setStave(this.stave),this.timeSig.glyph.setContext(this.stave.context),this.placeGlyphOnLine(this.timeSig.glyph,this.stave,this.timeSig.line),this.timeSig.glyph.renderToStave(this.x)}}class _t extends ft{static get CATEGORY(){return"voltas"}static get type(){return{NONE:1,BEGIN:2,MID:3,END:4,BEGIN_END:5}}constructor(t,e,i,n){super(),this.setAttribute("type","Volta"),this.volta=t,this.x=i,this.y_shift=n,this.number=e,this.font={family:"sans-serif",size:9,weight:"bold"}}getCategory(){return _t.CATEGORY}setShiftY(t){return this.y_shift=t,this}draw(t,e){const i=t.checkContext();this.setRendered();let n=t.width-e;const s=t.getYForTopText(t.options.num_lines)+this.y_shift,r=1.5*t.options.spacing_between_lines_px;switch(this.volta){case _t.type.BEGIN:i.fillRect(this.x+e,s,1,r);break;case _t.type.END:n-=5,i.fillRect(this.x+e+n,s,1,r);break;case _t.type.BEGIN_END:n-=3,i.fillRect(this.x+e,s,1,r),i.fillRect(this.x+e+n,s,1,r)}return this.volta!==_t.type.BEGIN&&this.volta!==_t.type.BEGIN_END||(i.save(),i.setFont(this.font.family,this.font.size,this.font.weight),i.fillText(this.number,this.x+e+5,s+15),i.restore()),i.fillRect(this.x+e,s,n,1),this}}class wt extends h{constructor(t,e,i,n){super(),this.setAttribute("type","Stave"),this.x=t,this.y=e,this.width=i,this.formatted=!1,this.setStartX(t+5),this.end_x=t+i,this.modifiers=[],this.measure=0,this.clef="treble",this.endClef=void 0,this.font={family:"sans-serif",size:8,weight:""},this.options={vertical_bar_width:10,glyph_spacing_px:10,num_lines:5,fill_style:"#999999",left_bar:!0,right_bar:!0,spacing_between_lines_px:10,space_above_staff_ln:4,space_below_staff_ln:4,top_text_position:1},this.bounds={x:this.x,y:this.y,w:this.width,h:0},s.Merge(this.options,n),this.resetLines();const r=pt.type;this.addModifier(new pt(this.options.left_bar?r.SINGLE:r.NONE)),this.addEndModifier(new pt(this.options.right_bar?r.SINGLE:r.NONE))}space(t){return this.options.spacing_between_lines_px*t}resetLines(){this.options.line_config=[];for(let t=0;t<this.options.num_lines;t++)this.options.line_config.push({visible:!0});this.height=(this.options.num_lines+this.options.space_above_staff_ln)*this.options.spacing_between_lines_px,this.options.bottom_text_position=this.options.num_lines}getOptions(){return this.options}setNoteStartX(t){this.formatted||this.format(),this.setStartX(t);const e=this.modifiers[0];return e.setX(this.start_x-e.getWidth()),this}setStartX(t){this.start_x=t}getNoteStartX(){return this.formatted||this.format(),this.start_x}getNoteEndX(){return this.formatted||this.format(),this.end_x}getTieStartX(){return this.start_x}getTieEndX(){return this.x+this.width}getX(){return this.x}getNumLines(){return this.options.num_lines}setNumLines(t){return this.options.num_lines=parseInt(t,10),this.resetLines(),this}setY(t){return this.y=t,this}getTopLineTopY(){return this.getYForLine(0)-m.STAVE_LINE_THICKNESS/2}getBottomLineBottomY(){return this.getYForLine(this.getNumLines()-1)+m.STAVE_LINE_THICKNESS/2}setX(t){const e=t-this.x;this.formatted=!1,this.x=t,this.start_x+=e,this.end_x+=e;for(let i=0;i<this.modifiers.length;i++){const t=this.modifiers[i];void 0!==t.x&&(t.x+=e)}return this}setWidth(t){return this.formatted=!1,this.width=t,this.end_x=this.x+t,this}getWidth(){return this.width}getStyle(){return t({fillStyle:this.options.fill_style,strokeStyle:this.options.fill_style,lineWidth:m.STAVE_LINE_THICKNESS},this.style||{})}setMeasure(t){return this.measure=t,this}getModifierXShift(t=0){if("number"!=typeof t)throw new s.RERR("InvalidIndex","Must be of number type");if(this.formatted||this.format(),1===this.getModifiers(ft.Position.BEGIN).length)return 0;let e=this.start_x-this.x;const i=this.modifiers[0];return i.getType()===pt.type.REPEAT_BEGIN&&e>i.getWidth()&&(e-=i.getWidth()),e}setRepetitionTypeLeft(t,e){return this.modifiers.push(new mt(t,this.x,e)),this}setRepetitionTypeRight(t,e){return this.modifiers.push(new mt(t,this.x,e)),this}setVoltaType(t,e,i){return this.modifiers.push(new _t(t,e,this.x,i)),this}setSection(t,e,i=0,n=12){const s=new bt(t,this.x+i,e);return s.font.size=n,this.modifiers.push(s),this}setTempo(t,e){return this.modifiers.push(new gt(t,this.x,e)),this}setText(t,e,i){return this.modifiers.push(new St(t,e,i)),this}getHeight(){return this.height}getSpacingBetweenLines(){return this.options.spacing_between_lines_px}getBoundingBox(){return new u(this.x,this.y,this.width,this.getBottomY()-this.y)}getBottomY(){const t=this.options,e=t.spacing_between_lines_px;return this.getYForLine(t.num_lines)+t.space_below_staff_ln*e}getBottomLineY(){return this.getYForLine(this.options.num_lines)}getYForLine(t){const e=this.options,i=e.spacing_between_lines_px,n=e.space_above_staff_ln;return this.y+t*i+n*i}getLineForY(t){const e=this.options,i=e.spacing_between_lines_px,n=e.space_above_staff_ln;return(t-this.y)/i-n}getYForTopText(t){const e=t||0;return this.getYForLine(-e-this.options.top_text_position)}getYForBottomText(t){const e=t||0;return this.getYForLine(this.options.bottom_text_position+e)}getYForNote(t){const e=this.options,i=e.spacing_between_lines_px,n=e.space_above_staff_ln;return this.y+n*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,ft.Position.END),this}setBegBarType(t){const{SINGLE:e,REPEAT_BEGIN:i,NONE:n}=pt.type;return t!==e&&t!==i&&t!==n||(this.modifiers[0].setType(t),this.formatted=!1),this}setEndBarType(t){return t!==pt.type.REPEAT_BEGIN&&(this.modifiers[1].setType(t),this.formatted=!1),this}setClef(t,e,i,n){void 0===n&&(n=ft.Position.BEGIN),n===ft.Position.END?this.endClef=t:this.clef=t;const s=this.getModifiers(n,vt.CATEGORY);return 0===s.length?this.addClef(t,e,i,n):s[0].setType(t,e,i),this}setEndClef(t,e,i){return this.setClef(t,e,i,ft.Position.END),this}setKeySignature(t,e,i){void 0===i&&(i=ft.Position.BEGIN);const n=this.getModifiers(i,xt.CATEGORY);return 0===n.length?this.addKeySignature(t,e,i):n[0].setKeySig(t,e),this}setEndKeySignature(t,e){return this.setKeySignature(t,e,ft.Position.END),this}setTimeSignature(t,e,i){void 0===i&&(i=ft.Position.BEGIN);const n=this.getModifiers(i,Et.CATEGORY);return 0===n.length?this.addTimeSignature(t,e,i):n[0].setTimeSig(t),this}setEndTimeSignature(t,e){return this.setTimeSignature(t,e,ft.Position.END),this}addKeySignature(t,e,i){return void 0===i&&(i=ft.Position.BEGIN),this.addModifier(new xt(t,e).setPosition(i),i),this}addClef(t,e,i,n){return void 0===n||n===ft.Position.BEGIN?this.clef=t:n===ft.Position.END&&(this.endClef=t),this.addModifier(new vt(t,e,i),n),this}addEndClef(t,e,i){return this.addClef(t,e,i,ft.Position.END),this}addTimeSignature(t,e,i){return this.addModifier(new Et(t,e),i),this}addEndTimeSignature(t,e){return this.addTimeSignature(t,e,ft.Position.END),this}addTrebleGlyph(){return this.addClef("treble"),this}getModifiers(t,e){return void 0===t&&void 0===e?this.modifiers:this.modifiers.filter((i=>!(void 0!==t&&t!==i.getPosition()||void 0!==e&&e!==i.getCategory())))}sortByCategory(t,e){for(let i=t.length-1;i>=0;i--)for(let n=0;n<i;n++)if(e[t[n].getCategory()]>e[t[n+1].getCategory()]){const e=t[n];t[n]=t[n+1],t[n+1]=e}}format(){const t=this.modifiers[0],e=this.modifiers[1],i=this.getModifiers(ft.Position.BEGIN),n=this.getModifiers(ft.Position.END);let s,r,o;this.sortByCategory(i,{barlines:0,clefs:1,keysignatures:2,timesignatures:3}),this.sortByCategory(n,{timesignatures:0,keysignatures:1,barlines:2,clefs:3}),i.length>1&&t.getType()===pt.type.REPEAT_BEGIN&&(i.push(i.splice(0,1)[0]),i.splice(0,0,new pt(pt.type.SINGLE))),n.indexOf(e)>0&&n.splice(0,0,new pt(pt.type.NONE));let a=0,l=this.x;for(let u=0;u<i.length;u++)o=i[u],r=o.getPadding(u+a),s=o.getWidth(),isNaN(s)&&(o.setWidth(10),s=10),l+=r,o.setX(l),l+=s,r+s===0&&a--;this.setStartX(l),l=this.x+this.width;const h={left:0,right:0,paddingRight:0,paddingLeft:0};let c=0;for(let u=0;u<n.length;u++){o=n[u],c="barlines"===o.getCategory()?u:c,h.right=0,h.left=0,h.paddingRight=0,h.paddingLeft=0;const t=o.getLayoutMetrics();t?(0!==u&&(h.right=t.xMax||0,h.paddingRight=t.paddingRight||0),h.left=-t.xMin||0,h.paddingLeft=t.paddingLeft||0,u===n.length-1&&(h.paddingLeft=0)):(h.paddingRight=o.getPadding(u-c)||0,0!==u&&(h.right=o.getWidth()||0),0===u&&(h.left=o.getWidth()||0)),l-=h.paddingRight,l-=h.right,o.setX(l),l-=h.left,l-=h.paddingLeft}this.end_x=1===n.length?this.x+this.width:l,this.formatted=!0}draw(){this.checkContext(),this.setRendered(),this.formatted||this.format();const t=this.options.num_lines,e=this.width,i=this.x;let n;for(let s=0;s<t;s++)n=this.getYForLine(s),this.applyStyle(),this.options.line_config[s].visible&&(this.context.beginPath(),this.context.moveTo(i,n),this.context.lineTo(i+e,n),this.context.stroke()),this.restoreStyle();for(let s=0;s<this.modifiers.length;s++)"function"==typeof this.modifiers[s].draw&&(this.modifiers[s].applyStyle(this.context),this.modifiers[s].draw(this,this.getModifierXShift(s)),this.modifiers[s].restoreStyle(this.context));if(this.measure>0){this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.weight);const t=this.context.measureText(""+this.measure).width;n=this.getYForTopText(0)+3,this.context.fillText(""+this.measure,this.x-t/2,n),this.context.restore()}return this}drawVertical(t,e){this.drawVerticalFixed(this.x+t,e)}drawVerticalFixed(t,e){this.checkContext();const i=this.getYForLine(0),n=this.getYForLine(this.options.num_lines-1);e&&this.context.fillRect(t-3,i,1,n-i+1),this.context.fillRect(t,i,1,n-i+1)}drawVerticalBar(t){this.drawVerticalBarFixed(this.x+t,!1)}drawVerticalBarFixed(t){this.checkContext();const e=this.getYForLine(0),i=this.getYForLine(this.options.num_lines-1);this.context.fillRect(t,e,1,i-e+1)}getConfigForLines(){return this.options.line_config}setConfigForLine(t,e){if(t>=this.options.num_lines||t<0)throw new s.RERR("StaveConfigError","The line number must be within the range of the number of lines in the Stave.");if(void 0===e.visible)throw new s.RERR("StaveConfigError","The line configuration object is missing the 'visible' property.");if("boolean"!=typeof e.visible)throw new s.RERR("StaveConfigError","The line configuration objects 'visible' property must be true or false.");return this.options.line_config[t]=e,this}setConfigForLines(t){if(t.length!==this.options.num_lines)throw new s.RERR("StaveConfigError","The length of the lines configuration array must match the number of lines in the Stave");for(const e in t)t[e]||(t[e]=this.options.line_config[e]),s.Merge(this.options.line_config[e],t[e]);return this.options.line_config=t,this}}class Tt extends wt{constructor(t,e,i,n){const r={spacing_between_lines_px:13,num_lines:6,top_text_position:1};s.Merge(r,n),super(t,e,i,r),this.setAttribute("type","TabStave")}getYForGlyphs(){return this.getYForLine(2.5)}addTabGlyph(){return this.addClef("tab"),this}}class Mt extends F{static get CATEGORY(){return"tabnotes"}constructor(t,e){if(super(t),this.setAttribute("type","TabNote"),this.ghost=!1,this.positions=t.positions,s.Merge(this.render_options,{glyph_font_scale:m.DEFAULT_TABLATURE_FONT_SCALE,draw_stem:e,draw_dots:e,draw_stem_through_stave:!1,y_shift:0,scale:1,font:"10pt Arial"}),this.glyph=m.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new s.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(t)}`);this.buildStem(),t.stem_direction?this.setStemDirection(t.stem_direction):this.setStemDirection(E.UP),this.ghost=!1,this.updateWidth()}reset(){this.stave&&this.setStave(this.stave)}getCategory(){return Mt.CATEGORY}setGhost(t){return this.ghost=t,this.updateWidth(),this}hasStem(){return this.render_options.draw_stem}getStemExtension(){const t=this.getGlyph();return null!=this.stem_extension_override?this.stem_extension_override:t?1===this.getStemDirection()?t.tabnote_stem_up_extension:t.tabnote_stem_down_extension:0}addDot(){const t=new O;return this.dots+=1,this.addModifier(t,0)}updateWidth(){this.glyphs=[],this.width=0;for(let t=0;t<this.positions.length;++t){let e=this.positions[t].fret;this.ghost&&(e="("+e+")");const i=m.tabToGlyph(e,this.render_options.scale);this.glyphs.push(i),this.width=Math.max(i.getWidth(),this.width)}this.glyph.getWidth=()=>this.width}setStave(t){let e;if(super.setStave(t),this.context=t.context,this.context){const t=this.context;for(this.width=0,e=0;e<this.glyphs.length;++e){const i=this.glyphs[e],n=""+i.text;"X"!==n.toUpperCase()&&(t.save(),t.setRawFont(this.render_options.font),i.width=t.measureText(n).width,t.restore(),i.getWidth=()=>i.width),this.width=Math.max(i.getWidth(),this.width)}this.glyph.getWidth=()=>this.width}const i=this.positions.map((({str:e})=>t.getYForLine(e-1)));return this.setYs(i),this.stem&&this.stem.setYBounds(this.getStemY(),this.getStemY()),this}getPositions(){return this.positions}addToModifierContext(t){this.setModifierContext(t);for(let e=0;e<this.modifiers.length;++e)this.modifierContext.addModifier(this.modifiers[e]);return this.modifierContext.addModifier(this),this.preFormatted=!1,this}getTieRightX(){let t=this.getAbsoluteX();return t+=this.glyph.getWidth()/2,t+=-this.width/2+this.width+2,t}getTieLeftX(){let t=this.getAbsoluteX();return t+=this.glyph.getWidth()/2,t-=this.width/2+2,t}getModifierStartXY(t,e){if(!this.preFormatted)throw new s.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(0===this.ys.length)throw new s.RERR("NoYValues","No Y-Values calculated for this note.");let i=0;return t===B.Position.LEFT?i=-2:t===B.Position.RIGHT?i=this.width+2:t!==B.Position.BELOW&&t!==B.Position.ABOVE||(i=this.glyph.getWidth()/2),{x:this.getAbsoluteX()+i,y:this.ys[e]}}getLineForRest(){return this.positions[0].str}preFormat(){this.preFormatted||(this.modifierContext&&this.modifierContext.preFormat(),this.setPreFormatted(!0))}getStemX(){return this.getCenterGlyphX()}getStemY(){const t=this.stave.getNumLines()-.5,e=E.UP===this.stem_direction?-.5:t;return this.stave.getYForLine(e)}getStemExtents(){return this.stem.getExtents()}drawFlag(){const{beam:t,glyph:e,context:i,stem:n,stem_direction:s,render_options:{draw_stem:r,glyph_font_scale:o}}=this,a=null==t&&r;if(e.flag&&a){const t=this.getStemX()+1,r=this.getStemY()-n.getHeight(),a=s===E.DOWN?e.code_flag_downstem:e.code_flag_upstem;p.renderGlyph(i,t,r,o,a)}}drawModifiers(){this.modifiers.forEach((t=>{("dots"!==t.getCategory()||this.render_options.draw_dots)&&(t.setContext(this.context),t.drawWithStyle())}))}drawStemThrough(){const t=this.getStemX(),e=this.getStemY(),i=this.context,n=this.render_options.draw_stem_through_stave;if(this.render_options.draw_stem&&n){const n=function(t,e,i,n){const s=1!==n,r=-1!==n,o=i.getSpacingBetweenLines(),a=i.getNumLines(),l=[];return e.forEach((e=>{const h=e.indexOf(a)>-1,c=e.indexOf(1)>-1;if(s&&c||r&&h)return;1===e.length&&e.push(e[0]);const u=[];e.forEach(((e,s,r)=>{const l=1===e,h=e===a;let c=i.getYForLine(e-1);0!==s||l?s!==r.length-1||h||(c+=o/2-1):c-=o/2-1,u.push(c),1===n&&l?u.push(t-2):-1===n&&h&&u.push(t+2)})),l.push(u.sort(((t,e)=>t-e)))})),l}(e,function(t,e){const i=[];let n=[];for(let s=1;s<=t;s++)e.indexOf(s)>-1?(i.push(n),n=[]):n.push(s);return n.length>0&&i.push(n),i}(this.stave.getNumLines(),this.positions.map((t=>t.str))),this.getStave(),this.getStemDirection());i.save(),i.setLineWidth(E.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())})),i.restore()}}drawPositions(){const t=this.context,e=this.getAbsoluteX(),i=this.ys;for(let n=0;n<this.positions.length;++n){const s=i[n]+this.render_options.y_shift,r=this.glyphs[n],o=e+this.glyph.getWidth()/2-r.getWidth()/2;if(t.clearRect(o-2,s-3,r.getWidth()+4,6),r.code)p.renderGlyph(t,o,s,this.render_options.glyph_font_scale*this.render_options.scale,r.code);else{t.save(),t.setRawFont(this.render_options.font);const e=r.text.toString();t.fillText(e,o,s+5*this.render_options.scale),t.restore()}}}draw(){if(this.checkContext(),!this.stave)throw new s.RERR("NoStave","Can't draw without a stave.");if(0===this.ys.length)throw new s.RERR("NoYValues","Can't draw note without Y values.");this.setRendered();const t=null==this.beam&&this.render_options.draw_stem;this.context.openGroup("tabnote",null,{pointerBBox:!0}),this.drawPositions(),this.drawStemThrough();const e=this.getStemX();this.stem.setNoteHeadXBounds(e,e),t&&(this.context.openGroup("stem",null,{pointerBBox:!0}),this.stem.setContext(this.context).draw(),this.context.closeGroup()),this.drawFlag(),this.drawModifiers(),this.context.closeGroup()}}class Pt extends h{constructor(t){super(),this.setAttribute("type","VibratoBracket"),this.start=t.start,this.stop=t.stop,this.line=1,this.render_options={harsh:!1,wave_height:6,wave_width:4,wave_girth:2}}setLine(t){return this.line=t,this}setHarsh(t){return this.render_options.harsh=t,this}draw(){const t=this.context;this.setRendered();const e=this.start?this.start.getStave().getYForTopText(this.line):this.stop.getStave().getYForTopText(this.line),i=this.start?this.start.getAbsoluteX():this.stop.getStave().getTieStartX(),n=this.stop?this.stop.getAbsoluteX()-this.stop.getWidth()-5:this.start.getStave().getTieEndX()-10;this.render_options.vibrato_width=n-i,function(...t){Pt.DEBUG&&s.L("Vex.Flow.VibratoBracket",t)}("Rendering VibratoBracket: start_x:",i,"stop_x:",n,"y:",e),at.renderVibrato(t,i,e,this.render_options)}}let Lt;class At extends h{constructor(t,e){super(),this.setAttribute("type","MultiMeasureRest"),this.render_options={show_number:!0,number_line:-.5,number_glyph_point:40,padding_left:void 0,padding_right:void 0,line:2,spacing_between_lines_px:10,line_thickness:void 0,serif_thickness:2,use_symbols:!1,symbol_spacing:void 0,semibrave_rest_glyph_scale:m.DEFAULT_NOTATION_FONT_SCALE},s.Merge(this.render_options,e),this.number_of_measures=t,this.xs={left:NaN,right:NaN}}getXs(){return this.xs}setStave(t){return this.stave=t,this}getStave(){return this.stave}drawLine(t,e,i,n){const s=this.stave.getYForLine(this.render_options.line),r=.1*(i-e);e+=r,i-=r;const o=this.render_options.serif_thickness;let a=.25*n;isNaN(this.render_options.line_thickness)||(a=.5*this.render_options.line_thickness),t.save(),t.beginPath(),t.moveTo(e,s-n),t.lineTo(e+o,s-n),t.lineTo(e+o,s-a),t.lineTo(i-o,s-a),t.lineTo(i-o,s-n),t.lineTo(i,s-n),t.lineTo(i,s+n),t.lineTo(i-o,s+n),t.lineTo(i-o,s+a),t.lineTo(e+o,s+a),t.lineTo(e+o,s+n),t.lineTo(e,s+n),t.closePath(),t.fill()}drawSymbols(t,e,i,n){const s=Math.floor(this.number_of_measures/4),r=this.number_of_measures%4,o=Math.floor(r/2),a=r%2,l=function(){if(!Lt){const t=new N({duration:"w",note_type:"r"});Lt={glyph_font_scale:t.render_options.glyph_font_scale,glyph_code:t.glyph_code,width:t.getWidth()}}return Lt}(),h=l.width*(this.render_options.semibrave_rest_glyph_scale/l.glyph_font_scale),c={2:{width:.5*h,height:n},1:{width:h}};let u=1.35*h;isNaN(this.render_options.symbol_spacing)||(u=this.render_options.symbol_spacing);let d=e+.5*(i-e)-.5*(s*c[2].width+o*c[2].width+a*c[1].width+(s+o+a-1)*u);const f=this.stave.getYForLine(this.render_options.line-1),m=this.stave.getYForLine(this.render_options.line),b=this.stave.getYForLine(this.render_options.line+1);t.save(),t.setStrokeStyle("none"),t.setLineWidth(0);for(let p=0;p<s;++p)t.fillRect(d,m-c[2].height,c[2].width,c[2].height),t.fillRect(d,b-c[2].height,c[2].width,c[2].height),d+=c[2].width+u;for(let p=0;p<o;++p)t.fillRect(d,m-c[2].height,c[2].width,c[2].height),d+=c[2].width+u;for(let g=0;g<a;++g)p.renderGlyph(t,d,f,this.render_options.semibrave_rest_glyph_scale,l.glyph_code),d+=c[1].width+u;t.restore()}draw(){this.checkContext(),this.setRendered();const t=this.context,e=this.stave,i=this.render_options.spacing_between_lines_px;let n=e.getNoteStartX(),s=e.getNoteEndX();const r=e.getModifiers(ft.Position.BEGIN);if(1===r.length&&"barlines"===r[0].getCategory()&&(n-=r[0].getWidth()),isNaN(this.render_options.padding_left)||(n=e.getX()+this.render_options.padding_left),isNaN(this.render_options.padding_right)||(s=e.getX()+e.getWidth()-this.render_options.padding_right),this.xs.left=n,this.xs.right=s,this.render_options.use_symbols?this.drawSymbols(t,n,s,i):this.drawLine(t,n,s,i),this.render_options.show_number){const i="/"+this.number_of_measures,r=new Et(null,void 0,!1);r.point=this.render_options.number_glyph_point,r.setTimeSig(i),r.setStave(e),r.x=n+.5*(s-n)-.5*r.timeSig.glyph.getMetrics().width,r.bottomLine=this.render_options.number_line,r.setContext(t).draw()}}}class Ct extends R{static get CATEGORY(){return"clefnote"}constructor(t,e,i){super({duration:"b"}),this.setAttribute("type","ClefNote"),this.setType(t,e,i),this.ignore_ticks=!0}setType(t,e,i){return this.type=t,this.clef_obj=new vt(t,e,i),this.clef=this.clef_obj.clef,this.glyph=new p(this.clef.code,this.clef.point),this.setWidth(this.glyph.getMetrics().width),this}getClef(){return this.clef}setContext(t){return this.context=t,this.glyph.setContext(this.context),this}getBoundingBox(){return super.getBoundingBox()}addToModifierContext(){return this}getCategory(){return Ct.CATEGORY}preFormat(){return this.setPreFormatted(!0),this}draw(){if(!this.stave)throw new s.RERR("NoStave","Can't draw without a stave.");this.glyph.getContext()||this.glyph.setContext(this.context),this.setRendered();const t=this.getAbsoluteX();if(this.glyph.setStave(this.stave),this.glyph.setYShift(this.stave.getYForLine(this.clef.line)-this.stave.getYForGlyphs()),this.glyph.renderToStave(t),void 0!==this.clef_obj.annotation){const e=new p(this.clef_obj.annotation.code,this.clef_obj.annotation.point);e.getContext()||e.setContext(this.context),e.setStave(this.stave),e.setYShift(this.stave.getYForLine(this.clef_obj.annotation.line)-this.stave.getYForGlyphs()),e.setXShift(this.clef_obj.annotation.x_shift),e.renderToStave(t)}}}class It extends R{constructor(t,e,i){super({duration:"b"}),this.setAttribute("type","KeySigNote"),this.keySignature=new xt(t,e,i),this.ignore_ticks=!0}getBoundingBox(){return super.getBoundingBox()}addToModifierContext(){return this}preFormat(){return this.setPreFormatted(!0),this.keySignature.setStave(this.stave),this.keySignature.format(),this.setWidth(this.keySignature.width),this}draw(){this.stave.checkContext(),this.setRendered(),this.keySignature.x=this.getAbsoluteX(),this.keySignature.setContext(this.context),this.keySignature.draw()}}class Rt extends R{constructor(t,e){super({duration:"b"}),this.setAttribute("type","TimeSigNote");const i=new Et(t,e);this.timeSig=i.getTimeSig(),this.setWidth(this.timeSig.glyph.getMetrics().width),this.ignore_ticks=!0}getBoundingBox(){return super.getBoundingBox()}addToModifierContext(){return this}preFormat(){return this.setPreFormatted(!0),this}draw(){this.stave.checkContext(),this.setRendered(),this.timeSig.glyph.getContext()||this.timeSig.glyph.setContext(this.context),this.timeSig.glyph.setStave(this.stave),this.timeSig.glyph.setYShift(this.stave.getYForLine(this.timeSig.line)-this.stave.getYForGlyphs()),this.timeSig.glyph.renderToStave(this.getAbsoluteX())}}class Nt extends X{static get SLIDE_UP(){return 1}static get SLIDE_DOWN(){return-1}static createSlideUp(t){return new Nt(t,Nt.SLIDE_UP)}static createSlideDown(t){return new Nt(t,Nt.SLIDE_DOWN)}constructor(t,e){if(super(t,"sl."),this.setAttribute("type","TabSlide"),!e){const i=t.first_note.getPositions()[0].fret,n=t.last_note.getPositions()[0].fret;e=parseInt(i,10)>parseInt(n,10)?Nt.SLIDE_DOWN:Nt.SLIDE_UP}this.slide_direction=e,this.render_options.cp1=11,this.render_options.cp2=14,this.render_options.y_shift=.5,this.setFont({font:"Times",size:10,style:"bold italic"}),this.setNotes(t)}renderTie(t){if(0===t.first_ys.length||0===t.last_ys.length)throw new s.RERR("BadArguments","No Y-values to render");const e=this.context,i=t.first_x_px,n=t.first_ys,r=t.last_x_px,o=this.slide_direction;if(o!==Nt.SLIDE_UP&&o!==Nt.SLIDE_DOWN)throw new s.RERR("BadSlide","Invalid slide direction");for(let a=0;a<this.first_indices.length;++a){const t=n[this.first_indices[a]]+this.render_options.y_shift;if(isNaN(t))throw new s.RERR("BadArguments","Bad indices for slide rendering.");e.beginPath(),e.moveTo(i,t+3*o),e.lineTo(r,t-3*o),e.closePath(),e.stroke()}this.setRendered()}}class Ft extends k{static get CATEGORY(){return"gracenotes"}static get LEDGER_LINE_OFFSET(){return 2}static get SCALE(){return.66}constructor(t){super(Object.assign(t,{glyph_font_scale:m.DEFAULT_NOTATION_FONT_SCALE*Ft.SCALE,stroke_px:Ft.LEDGER_LINE_OFFSET})),this.setAttribute("type","GraceNote"),this.slash=t.slash,this.slur=!0,this.buildNoteHeads(),this.width=3}getStemExtension(){if(null!=this.stem_extension_override)return this.stem_extension_override;const t=this.getGlyph();if(t){let e=super.getStemExtension();if(t.stem){const t=this.getStaveNoteScale();e=(E.HEIGHT+e)*t-E.HEIGHT}return e}return 0}getCategory(){return Ft.CATEGORY}getStaveNoteScale(){return this.render_options.glyph_font_scale/m.DEFAULT_NOTATION_FONT_SCALE}draw(){super.draw(),this.setRendered();const t=this.stem;if(this.slash&&t){const e=this.getStaveNoteScale(),i=e/.66;let n;const s=this.beam;if(s)s.postFormatted||s.postFormat(),n=this.calcBeamedNotesSlashBBox(8*i,8*i,{stem:6*i,beam:5*i});else{const s=this.getStemDirection(),r=this.getNoteHeadBounds(),o=t.getHeight();let a=this.getAbsoluteX(),l=s===m.Stem.DOWN?r.y_top-o:r.y_bottom-o;const h=s===m.Stem.DOWN?this.glyph.stem_down_extension:this.glyph.stem_up_extension;let c=m.STEM_HEIGHT;c-=c/2.8,c+=h,l+=c*e*s;const u=s===m.Stem.UP?{x1:1,y1:0,x2:13,y2:-9}:{x1:-4,y1:1,x2:13,y2:9};a+=u.x1*i,l+=u.y1*i,n={x1:a,y1:l,x2:a+u.x2*i,y2:l+u.y2*i}}const r=this.context;r.save(),r.setLineWidth(1*i),r.beginPath(),r.moveTo(n.x1,n.y1),r.lineTo(n.x2,n.y2),r.closePath(),r.stroke(),r.restore()}}calcBeamedNotesSlashBBox(t,e,i){const n=this.beam,s=n.slope,r=n.notes[n.notes.length-1]===this?-1:1,o=Math.atan(s*r),a=Math.cos(o)*e,l=Math.sin(o)*e;t*=this.getStemDirection();const h=Math.atan((l-t)/a),c=Math.cos(h)*i.stem*r,u=Math.sin(h)*i.stem,d=Math.cos(h)*i.beam*r,f=Math.sin(h)*i.beam,p=this.getStemX(),m=n.notes[0].getStemX(),b=this.beam.getBeamYToDraw()+(p-m)*s;return{x1:p-c,y1:b+t-u,x2:p+a*r+d,y2:b+l+f}}}class Bt extends Mt{static get CATEGORY(){return"gracetabnotes"}constructor(t){super(t,!1),this.setAttribute("type","GraceTabNote"),s.Merge(this.render_options,{y_shift:.3,scale:.6,font:"7.5pt Arial"}),this.updateWidth()}getCategory(){return Bt.CATEGORY}draw(){super.draw(),this.setRendered()}}class Ot{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.setTuning(t)}noteToInteger(t){return m.keyProperties(t).int_value}setTuning(t){Ot.names[t]&&(t=Ot.names[t]),this.tuningString=t,this.tuningValues=[],this.numStrings=0;const e=t.split(/\s*,\s*/);if(0===e.length)throw new s.RERR("BadArguments","Invalid tuning string: "+t);this.numStrings=e.length;for(let i=0;i<this.numStrings;++i)this.tuningValues[i]=this.noteToInteger(e[i])}getValueForString(t){const e=parseInt(t,10);if(e<1||e>this.numStrings)throw new s.RERR("BadArguments",`String number must be between 1 and ${this.numStrings}:${t}`);return this.tuningValues[e-1]}getValueForFret(t,e){const i=this.getValueForString(e),n=parseInt(t,10);if(n<0)throw new s.RERR("BadArguments","Fret number must be 0 or higher: "+t);return i+n}getNoteForFret(t,e){const i=this.getValueForFret(t,e),n=Math.floor(i/12),s=i%12;return m.integerToNote(s)+"/"+n}}class Dt extends h{static get type(){return{CRESC:1,DECRESC:2}}static FormatByTicksAndDraw(t,e,i,n,r,o){const a=e.pixelsPerTick;if(null==a)throw new s.RuntimeError("BadArguments","A valid Formatter must be provide to draw offsets by ticks.");const l=a*o.left_shift_ticks,h=a*o.right_shift_ticks,c={height:o.height,y_shift:o.y_shift,left_shift_px:l,right_shift_px:h};new Dt({first_note:i.first_note,last_note:i.last_note},n).setContext(t).setRenderOptions(c).setPosition(r).draw()}constructor(t,e){super(),this.setAttribute("type","StaveHairpin"),this.notes=t,this.hairpin=e,this.position=B.Position.BELOW,this.render_options={height:10,y_shift:0,left_shift_px:0,right_shift_px:0},this.setNotes(t)}setPosition(t){return t!==B.Position.ABOVE&&t!==B.Position.BELOW||(this.position=t),this}setRenderOptions(t){return null!=t.height&&null!=t.y_shift&&null!=t.left_shift_px&&null!=t.right_shift_px&&(this.render_options=t),this}setNotes(t){if(!t.first_note&&!t.last_note)throw new s.RuntimeError("BadArguments","Hairpin needs to have either first_note or last_note set.");return this.first_note=t.first_note,this.last_note=t.last_note,this}renderHairpin(t){const e=this.checkContext();let i=this.render_options.y_shift+20,n=t.first_y;this.position===B.Position.ABOVE&&(i=30-i,n=t.first_y-t.staff_height);const s=this.render_options.left_shift_px,r=this.render_options.right_shift_px;switch(e.beginPath(),this.hairpin){case Dt.type.CRESC:e.moveTo(t.last_x+r,n+i),e.lineTo(t.first_x+s,n+this.render_options.height/2+i),e.lineTo(t.last_x+r,n+this.render_options.height+i);break;case Dt.type.DECRESC:e.moveTo(t.first_x+s,n+i),e.lineTo(t.last_x+r,n+this.render_options.height/2+i),e.lineTo(t.first_x+s,n+this.render_options.height+i)}e.stroke(),e.closePath()}draw(){this.checkContext(),this.setRendered();const t=this.first_note,e=this.last_note,i=t.getModifierStartXY(this.position,0),n=e.getModifierStartXY(this.position,0);return this.renderHairpin({first_x:i.x,last_x:n.x,first_y:t.getStave().y+t.getStave().height,last_y:e.getStave().y+e.getStave().height,staff_height:t.getStave().height}),!0}}class kt extends h{static get Position(){return{NEAR_HEAD:1,NEAR_TOP:2}}static get PositionString(){return{nearHead:kt.Position.NEAR_HEAD,nearTop:kt.Position.NEAR_TOP}}constructor(t,e,i){super(),this.setAttribute("type","Curve"),this.render_options={spacing:2,thickness:2,x_shift:0,y_shift:10,position:kt.Position.NEAR_HEAD,position_end:kt.Position.NEAR_HEAD,invert:!1,cps:[{x:0,y:10},{x:0,y:10}]},s.Merge(this.render_options,i),this.setNotes(t,e)}setNotes(t,e){if(!t&&!e)throw new s.RuntimeError("BadArguments","Curve needs to have either first_note or last_note set.");return this.from=t,this.to=e,this}isPartial(){return!this.from||!this.to}renderCurve(t){const e=this.context,i=this.render_options.cps,n=this.render_options.x_shift,s=this.render_options.y_shift*t.direction,r=t.first_x+n,o=t.first_y+s,a=t.last_x-n,l=t.last_y+s,h=this.render_options.thickness,c=(a-r)/(i.length+2);e.beginPath(),e.moveTo(r,o),e.bezierCurveTo(r+c+i[0].x,o+i[0].y*t.direction,a-c+i[1].x,l+i[1].y*t.direction,a,l),e.bezierCurveTo(a-c+i[1].x,l+(i[1].y+h)*t.direction,r+c+i[0].x,o+(i[0].y+h)*t.direction,r,o),e.stroke(),e.closePath(),e.fill()}draw(){this.checkContext(),this.setRendered();const t=this.from,e=this.to;let i,n,s,r,o,a="baseY",l="baseY";function h(t){return"string"==typeof t?kt.PositionString[t]:t}const c=h(this.render_options.position),u=h(this.render_options.position_end);return c===kt.Position.NEAR_TOP&&(a="topY",l="topY"),u===kt.Position.NEAR_HEAD?l="baseY":u===kt.Position.NEAR_TOP&&(l="topY"),t?(i=t.getTieRightX(),o=t.getStemDirection(),s=t.getStemExtents()[a]):(i=e.getStave().getTieStartX(),s=e.getStemExtents()[a]),e?(n=e.getTieLeftX(),o=e.getStemDirection(),r=e.getStemExtents()[l]):(n=t.getStave().getTieEndX(),r=t.getStemExtents()[l]),this.renderCurve({first_x:i,last_x:n,first_y:s,last_y:r,direction:o*(!0===this.render_options.invert?-1:1)}),!0}}function Vt(...t){Gt.DEBUG&&s.L("Vex.Flow.TextDynamics",t)}class Gt extends R{static get GLYPHS(){return{f:{code:"vba",width:12},p:{code:"vbf",width:14},m:{code:"v62",width:17},s:{code:"v4a",width:10},z:{code:"v80",width:12},r:{code:"vb1",width:12}}}constructor(t){super(t),this.setAttribute("type","TextDynamics"),this.sequence=t.text.toLowerCase(),this.line=t.line||0,this.glyphs=[],s.Merge(this.render_options,{glyph_font_size:40}),Vt("New Dynamics Text: ",this.sequence)}setLine(t){return this.line=t,this}preFormat(){let t=0;return this.sequence.split("").forEach((e=>{const i=Gt.GLYPHS[e];if(!i)throw new s.RERR("Invalid dynamics character: "+e);const n=this.render_options.glyph_font_size,r=new p(i.code,n);this.glyphs.push(r),t+=i.width})),this.setWidth(t),this.preFormatted=!0,this}draw(){this.setRendered();const t=this.getAbsoluteX(),e=this.stave.getYForLine(this.line+-3);Vt("Rendering Dynamics: ",this.sequence);let i=t;this.glyphs.forEach(((t,n)=>{const s=this.sequence[n];t.render(this.context,i,e),i+=Gt.GLYPHS[s].width}))}}function Wt(t,e,i,n,s,r,o){t.beginPath(),t.moveTo(e,i),t.lineTo(n,s),t.lineTo(r,o),t.lineTo(e,i),t.closePath(),t.fill()}class Ut extends h{static get TextVerticalPosition(){return{TOP:1,BOTTOM:2}}static get TextJustification(){return{LEFT:1,CENTER:2,RIGHT:3}}constructor(t){super(),this.setAttribute("type","StaveLine"),this.notes=t,this.text="",this.font={family:"Arial",size:10,weight:""},this.render_options={padding_left:4,padding_right:3,line_width:1,line_dash:null,rounded_end:!0,color:null,draw_start_arrow:!1,draw_end_arrow:!1,arrowhead_length:10,arrowhead_angle:Math.PI/8,text_position_vertical:Ut.TextVerticalPosition.TOP,text_justification:Ut.TextJustification.CENTER},this.setNotes(t)}setFont(t){return this.font=t,this}setText(t){return this.text=t,this}setNotes(t){if(!t.first_note&&!t.last_note)throw new s.RuntimeError("BadArguments","Notes needs to have either first_note or last_note set.");if(t.first_indices||(t.first_indices=[0]),t.last_indices||(t.last_indices=[0]),t.first_indices.length!==t.last_indices.length)throw new s.RuntimeError("BadArguments","Connected notes must have similar index sizes");return this.first_note=t.first_note,this.first_indices=t.first_indices,this.last_note=t.last_note,this.last_indices=t.last_indices,this}applyLineStyle(){const t=this.checkContext(),e=this.render_options;e.line_dash&&t.setLineDash(e.line_dash),e.line_width&&t.setLineWidth(e.line_width),e.rounded_end?t.setLineCap("round"):t.setLineCap("square")}applyFontStyle(){const t=this.checkContext();this.font&&t.setFont(this.font.family,this.font.size,this.font.weight),this.render_options.color&&(t.setStrokeStyle(this.render_options.color),t.setFillStyle(this.render_options.color))}draw(){const t=this.checkContext();this.setRendered();const e=this.first_note,i=this.last_note,n=this.render_options;let s,r;t.save(),this.applyLineStyle(),this.first_indices.forEach(((o,a)=>{const l=this.last_indices[a];s=e.getModifierStartXY(2,o),r=i.getModifierStartXY(1,l);const h=s.y>r.y;s.x+=e.getMetrics().modRightPx+n.padding_left,r.x-=i.getMetrics().modLeftPx+n.padding_right;const c=e.getGlyph().getWidth();e.getKeyProps()[o].displaced&&1===e.getStemDirection()&&(s.x+=c+n.padding_left),i.getKeyProps()[l].displaced&&-1===i.getStemDirection()&&(r.x-=c+n.padding_right),s.y+=h?-3:1,r.y+=h?2:0,function(t,e,i,n){const s=n.draw_start_arrow&&n.draw_end_arrow,r=e.x,o=e.y,a=i.x,l=i.y,h=Math.sqrt((a-r)*(a-r)+(l-o)*(l-o)),c=(h-n.arrowhead_length/3)/h;let u,d,f,p;n.draw_end_arrow||s?(u=Math.round(r+(a-r)*c),d=Math.round(o+(l-o)*c)):(u=a,d=l),n.draw_start_arrow||s?(f=r+(a-r)*(1-c),p=o+(l-o)*(1-c)):(f=r,p=o),n.color&&(t.setStrokeStyle(n.color),t.setFillStyle(n.color)),t.beginPath(),t.moveTo(f,p),t.lineTo(u,d),t.stroke(),t.closePath();const m=Math.atan2(l-o,a-r),b=Math.abs(n.arrowhead_length/Math.cos(n.arrowhead_angle));let g,y,S,v,x,E;(n.draw_end_arrow||s)&&(g=m+Math.PI+n.arrowhead_angle,S=a+Math.cos(g)*b,v=l+Math.sin(g)*b,y=m+Math.PI-n.arrowhead_angle,x=a+Math.cos(y)*b,E=l+Math.sin(y)*b,Wt(t,S,v,a,l,x,E)),(n.draw_start_arrow||s)&&(g=m+n.arrowhead_angle,S=r+Math.cos(g)*b,v=o+Math.sin(g)*b,y=m-n.arrowhead_angle,x=r+Math.cos(y)*b,E=o+Math.sin(y)*b,Wt(t,S,v,r,o,x,E))}(t,s,r,this.render_options)})),t.restore();const o=t.measureText(this.text).width,a=n.text_justification;let l,h=0;a===Ut.TextJustification.LEFT?h=s.x:a===Ut.TextJustification.CENTER?h=(r.x-s.x)/2+s.x-o/2:a===Ut.TextJustification.RIGHT&&(h=r.x-o);const c=n.text_position_vertical;return c===Ut.TextVerticalPosition.TOP?l=e.getStave().getYForTopText():c===Ut.TextVerticalPosition.BOTTOM&&(l=e.getStave().getYForBottomText(m.TEXT_HEIGHT_OFFSET_HACK)),t.save(),this.applyFontStyle(),t.fillText(this.text,h,l),t.restore(),this}}function zt(t,e,i,n,s){const r=jt.GLYPHS[t];new p(r.code,s).render(e,i+r.x_shift,n+r.y_shift)}class jt extends h{static get GLYPHS(){return{pedal_depress:{code:"v36",x_shift:-10,y_shift:0},pedal_release:{code:"v5d",x_shift:-2,y_shift:3}}}static get Styles(){return{TEXT:1,BRACKET:2,MIXED:3}}static get StylesString(){return{text:jt.Styles.TEXT,bracket:jt.Styles.BRACKET,mixed:jt.Styles.MIXED}}static createSustain(t){return new jt(t)}static createSostenuto(t){const e=new jt(t);return e.setStyle(jt.Styles.MIXED),e.setCustomText("Sost. Ped."),e}static createUnaCorda(t){const e=new jt(t);return e.setStyle(jt.Styles.TEXT),e.setCustomText("una corda","tre corda"),e}constructor(t){super(),this.setAttribute("type","PedalMarking"),this.notes=t,this.style=jt.TEXT,this.line=0,this.custom_depress_text="",this.custom_release_text="",this.font={family:"Times New Roman",size:12,weight:"italic bold"},this.render_options={bracket_height:10,text_margin_right:6,bracket_line_width:1,glyph_point_size:40,color:"black"}}setCustomText(t,e){return this.custom_depress_text=t||"",this.custom_release_text=e||"",this}setStyle(t){if(t<1&&t>3)throw new s.RERR("InvalidParameter","The style must be one found in PedalMarking.Styles");return this.style=t,this}setLine(t){return this.line=t,this}drawBracketed(){const t=this.context;let e,i,n=!1;const r=this;this.notes.forEach(((o,a,l)=>{n=!n;const h=o.getAbsoluteX(),c=o.getStave().getYForBottomText(r.line+3);if(h<e)throw new s.RERR("InvalidConfiguration","The notes provided must be in order of ascending x positions");const u=l[a+1]===o,d=l[a-1]===o;let f=0;if(n)if(f=d?5:0,r.style!==jt.Styles.MIXED||d)t.beginPath(),t.moveTo(h,c-r.render_options.bracket_height),t.lineTo(h+f,c),t.stroke(),t.closePath();else if(r.custom_depress_text){const e=t.measureText(r.custom_depress_text).width;t.fillText(r.custom_depress_text,h-e/2,c),f=e/2+r.render_options.text_margin_right}else zt("pedal_depress",t,h,c,r.render_options.glyph_point_size),f=20+r.render_options.text_margin_right;else f=u?-5:0,t.beginPath(),t.moveTo(e,i),t.lineTo(h+f,c),t.lineTo(h,c-r.render_options.bracket_height),t.stroke(),t.closePath();e=h+f,i=c}))}drawText(){const t=this.context;let e=!1;const i=this,n=i.render_options.glyph_point_size;this.notes.forEach((s=>{e=!e;const r=s.getStave(),o=s.getAbsoluteX(),a=r.getYForBottomText(i.line+3);let l=0;e?i.custom_depress_text?(l=t.measureText(i.custom_depress_text).width,t.fillText(i.custom_depress_text,o-l/2,a)):zt("pedal_depress",t,o,a,n):i.custom_release_text?(l=t.measureText(i.custom_release_text).width,t.fillText(i.custom_release_text,o-l/2,a)):zt("pedal_release",t,o,a,n)}))}draw(){const t=this.checkContext();this.setRendered(),t.save(),t.setStrokeStyle(this.render_options.color),t.setFillStyle(this.render_options.color),t.setFont(this.font.family,this.font.size,this.font.weight),function(...t){jt.DEBUG&&s.L("Vex.Flow.PedalMarking",t)}("Rendering Pedal Marking"),this.style===jt.Styles.BRACKET||this.style===jt.Styles.MIXED?(t.setLineWidth(this.render_options.bracket_line_width),this.drawBracketed()):this.style===jt.Styles.TEXT&&this.drawText(),t.restore()}}class Ht extends h{static get Positions(){return{TOP:1,BOTTOM:-1}}static get PositionString(){return{top:Ht.Positions.TOP,bottom:Ht.Positions.BOTTOM}}constructor({start:t,stop:e,text:i="",superscript:n="",position:s=Ht.Positions.TOP}){super(),this.setAttribute("type","TextBracket"),this.start=t,this.stop=e,this.text=i,this.superscript=n,this.position="string"==typeof s?Ht.PositionString[s]:s,this.line=1,this.font={family:"Serif",size:15,weight:"italic"},this.render_options={dashed:!0,dash:[5],color:"black",line_width:1,show_bracket:!0,bracket_height:8,underline_superscript:!0}}applyStyle(t){return t.setFont(this.font.family,this.font.size,this.font.weight),t.setStrokeStyle(this.render_options.color),t.setFillStyle(this.render_options.color),t.setLineWidth(this.render_options.line_width),this}setDashed(t,e){return this.render_options.dashed=t,e&&(this.render_options.dash=e),this}setFont(e){return this.font=t(t({},this.font),e),this}setLine(t){return this.line=t,this}draw(){const t=this.context;this.setRendered();let e=0;switch(this.position){case Ht.Positions.TOP:e=this.start.getStave().getYForTopText(this.line);break;case Ht.Positions.BOTTOM:e=this.start.getStave().getYForBottomText(this.line+m.TEXT_HEIGHT_OFFSET_HACK);break;default:throw new s.RERR("InvalidPosition",`The position ${this.position} is invalid`)}const i={x:this.start.getAbsoluteX(),y:e},n={x:this.stop.getAbsoluteX(),y:e};!function(...t){Ht.DEBUG&&s.L("Vex.Flow.TextBracket",t)}("Rendering TextBracket: start:",i,"stop:",n,"y:",e);const r=this.render_options.bracket_height*this.position;t.save(),this.applyStyle(t),t.fillText(this.text,i.x,i.y);const o=t.measureText(this.text).width,a=t.measureText("M").width,l=i.y-a/2.5;t.setFont(this.font.family,this.font.size/1.4,this.font.weight),t.fillText(this.superscript,i.x+o+1,l);const h=t.measureText(this.superscript).width,c=t.measureText("M").width;let u=i.x,d=l;const f=n.x+this.stop.getGlyph().getWidth();this.position===Ht.Positions.TOP?(u+=o+h+5,d-=c/2.7):this.position===Ht.Positions.BOTTOM&&(d+=c/2.7,u+=o+2,this.render_options.underline_superscript||(u+=h)),this.render_options.dashed?(x.drawDashedLine(t,u,d,f,d,this.render_options.dash),this.render_options.show_bracket&&x.drawDashedLine(t,f,d+1*this.position,f,d+r,this.render_options.dash)):(t.beginPath(),t.moveTo(u,d),t.lineTo(f,d),this.render_options.show_bracket&&t.lineTo(f,d+r),t.stroke(),t.closePath()),t.restore()}}class Xt extends R{constructor(t=pt.type.SINGLE){super({duration:"b"}),this.setAttribute("type","BarNote"),this.metrics={widths:{}};const e=pt.type;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.ignore_ticks=!0,this.setType(t)}getType(){return this.type}setType(t){return this.type="string"==typeof t?pt.typeString[t]:t,this.setWidth(this.metrics.widths[this.type]),this}getBoundingBox(){return super.getBoundingBox()}addToModifierContext(){return this}preFormat(){return this.setPreFormatted(!0),this}draw(){if(this.checkContext(),!this.stave)throw new s.RERR("NoStave","Can't draw without a stave.");!function(...t){Xt.DEBUG&&s.L("Vex.Flow.BarNote",t)}("Rendering bar line at: ",this.getAbsoluteX());const t=new pt(this.type);t.setX(this.getAbsoluteX()),t.draw(this.stave),this.setRendered()}}class Yt extends F{constructor(t){if(!t)throw new s.RuntimeError("BadArguments","Ghost note must have valid initialization data to identify duration.");let e;if("string"==typeof t)e={duration:t};else{if("object"!=typeof t)throw new s.RuntimeError("BadArguments","Ghost note must have valid initialization data to identify duration.");e=t}super(e),this.setAttribute("type","GhostNote"),this.setWidth(0)}isRest(){return!0}setStave(t){super.setStave(t)}addToModifierContext(){return this}preFormat(){return this.setPreFormatted(!0),this}draw(){if(!this.stave)throw new s.RERR("NoStave","Can't draw without a stave.");this.setRendered();for(let t=0;t<this.modifiers.length;++t){const e=this.modifiers[t];e.setContext(this.context),e.drawWithStyle()}}}class Kt extends B{static get CATEGORY(){return"tremolo"}static get YOFFSETSTEMUP(){return-9}static get YOFFSETSTEMDOWN(){return-21}static get XOFFSETSTEMUP(){return 6}static get XOFFSETSTEMDOWN(){return-2}constructor(t){super(),this.setAttribute("type","Tremolo"),this.num=t,this.note=null,this.index=null,this.position=B.Position.CENTER,this.code="v74",this.y_spacing_scale=1,this.extra_stroke_scale=1}getCategory(){return Kt.CATEGORY}draw(){if(this.checkContext(),!this.note||null==this.index)throw new s.RERR("NoAttachedNote","Can't draw Tremolo without a note and index.");this.setRendered();const t=this.note.getStemDirection();this.y_spacing=4*t*this.y_spacing_scale;let e=this.note.getModifierStartXY(this.position,this.index).x,i=this.note.stem.getExtents().topY,n="gracenotes"===this.note.getCategory()?Ft.SCALE:1;n*=this.extra_stroke_scale,i+=t<0?Kt.YOFFSETSTEMDOWN*n:Kt.YOFFSETSTEMUP*n,this.font={family:"Arial",size:16*n,weight:""},this.render_options={font_scale:35*n,stroke_px:3,stroke_spacing:10*n},e+=t<0?Kt.XOFFSETSTEMDOWN:Kt.XOFFSETSTEMUP;for(let s=0;s<this.num;++s)p.renderGlyph(this.context,e,i,this.render_options.font_scale,this.code),i+=this.y_spacing}}class qt extends R{constructor(t){super(t),this.setAttribute("type","Crescendo"),this.decrescendo=!1,this.line=t.line||0,this.height=15,s.Merge(this.render_options,{extend_left:0,extend_right:0,y_shift:0})}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(){this.checkContext(),this.setRendered();const t=this.getTickContext(),e=nt.getNextContext(t),i=this.getAbsoluteX(),n=e?e.getX():this.stave.x+this.stave.width,r=this.stave.getYForLine(this.line+-3)+1;!function(...t){qt.DEBUG&&s.L("Vex.Flow.Crescendo",t)}("Drawing ",this.decrescendo?"decrescendo ":"crescendo ",this.height,"x",i-n),function(t,e){const i=e.begin_x,n=e.end_x,s=e.y,r=e.height/2;t.beginPath(),e.reverse?(t.moveTo(i,s-r),t.lineTo(n,s),t.lineTo(i,s+r)):(t.moveTo(n,s-r),t.lineTo(i,s),t.lineTo(n,s+r)),t.stroke(),t.closePath()}(this.context,{begin_x:i-this.render_options.extend_left,end_x:n+this.render_options.extend_right,y:r+this.render_options.y_shift,height:this.height,reverse:this.decrescendo})}}const $t=s.MakeException("ParserError");function Jt(t){return void 0!==t.matchedString?t.matchedString:t.results?Jt(t.results):1===t.length?Jt(t[0]):0===t.length?null:t.map(Jt)}class Zt{constructor(t){this.grammar=t}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*)"),n=this.line.slice(this.pos).match(i);return null!==n?{success:!0,matchedString:n[2],incrementPos:n[1].length,pos:this.pos}:{success:!1,pos:this.pos}}expectOne(t,e=!1){const i=[],n=this.pos;let s=!0,r=!1;e=!0===e||!0===t.maybe;for(let l=0;l<t.expect.length;l++){const e=t.expect[l],n=this.pos,o=this.expect(e);if(o.success){if(i.push(o),r=!0,t.or)break}else if(s=!1,!t.or){this.pos=n;break}}const o=t.or&&r||s,a=o||!0===e;return e&&!o&&(this.pos=n),a?this.matchSuccess():this.matchFail(n),{success:a,results:i,numMatches:o?1:0}}expectOneOrMore(t,e=!1){const i=[],n=this.pos;let s=0,r=!0;do{const e=this.expectOne(t);e.success?(s++,i.push(e.results)):r=!1}while(r);const o=s>0||!0===e;return!e||s>0||(this.pos=n),o?this.matchSuccess():this.matchFail(n),{success:o,results:i,numMatches:s}}expectZeroOrMore(t){return this.expectOneOrMore(t,!0)}expect(t){let e;if(function(...t){Zt.DEBUG&&s.L("Vex.Flow.Parser",t)}("Evaluating rules:",t),!t)throw new $t("Invalid Rule: "+t,t);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 new $t("Bad grammar! No `token` or `expect` property",i);e=i.oneOrMore?this.expectOneOrMore(i):i.zeroOrMore?this.expectZeroOrMore(i):this.expectOne(i)}return e.matches=[],e.results&&e.results.forEach((t=>e.matches.push(Jt(t)))),i.run&&e.success&&i.run(e),e}}function Qt(...t){re.DEBUG&&s.L("Vex.Flow.EasyScore",t)}const te=s.MakeException("EasyScoreError");class ee{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=>this.builder.addSingleNote(t.matches[0],t.matches[1],t.matches[2])}}ACCIDENTAL(){return{expect:[this.ACCIDENTALS],maybe:!0}}DOTS(){return{expect:[this.DOT],zeroOrMore:!0,run:t=>this.builder.setNoteDots(t.matches[0])}}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:"bbs|bb|bss|bs|b|db|d|##|#|n|\\+\\+-|\\+-|\\+\\+|\\+|k|o"}}DURATIONS(){return{token:"[0-9whq]+"}}TYPES(){return{token:"[rRsSxX]"}}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 ie{constructor(t){this.factory=t,this.commitHooks=[],this.reset()}reset(t={}){this.options={stem:"auto",clef:"treble"},this.elements={notes:[],accidentals:[]},this.rollingDuration="8",this.resetPiece(),Object.assign(this.options,t)}getFactory(){return this.factory}getElements(){return this.elements}addCommitHook(t){this.commitHooks.push(t)}resetPiece(){Qt("resetPiece"),this.piece={chord:[],duration:this.rollingDuration,dots:0,type:void 0,options:{}}}setNoteDots(t){Qt("setNoteDots:",t),t&&(this.piece.dots=t.length)}setNoteDuration(t){Qt("setNoteDuration:",t),this.rollingDuration=this.piece.duration=t||this.rollingDuration}setNoteType(t){Qt("setNoteType:",t),t&&(this.piece.type=t)}addNoteOption(t,e){Qt("addNoteOption: key:",t,"value:",e),this.piece.options[t]=e}addNote(t,e,i){Qt("addNote:",t,e,i),this.piece.chord.push({key:t,accid:e,octave:i})}addSingleNote(t,e,i){Qt("addSingleNote:",t,e,i),this.addNote(t,e,i)}addChord(t){Qt("startChord"),"object"!=typeof t[0]?this.addSingleNote(t[0]):t.forEach((t=>{t&&this.addNote(...t)})),Qt("endChord")}commitPiece(){Qt("commitPiece");const{factory:e}=this;if(!e)return;const i=t(t({},this.options),this.piece.options),{stem:n,clef:s}=i,r="auto"===n.toLowerCase(),o=r||"up"!==n.toLowerCase()?k.STEM_DOWN:k.STEM_UP,{chord:a,duration:l,dots:h,type:c}=this.piece,u=a.map((t=>t.key+"/"+t.octave)),d=e.StaveNote({keys:u,duration:l,dots:h,type:c,clef:s,auto_stem:r});r||d.setStemDirection(o);const f=a.map((t=>t.accid||null));f.forEach(((t,i)=>{t&&d.addAccidental(i,e.Accidental({type:t}))}));for(let t=0;t<h;t++)d.addDotToAll();this.commitHooks.forEach((t=>t(i,d,this))),this.elements.notes.push(d),this.elements.accidentals.concat(f),this.resetPiece()}}function ne({id:t},e){void 0!==t&&e.setAttribute("id",t)}function se(t,e){t.class&&t.class.split(/\s*,\s*/).forEach((t=>e.addClass(t)))}class re{constructor(t={}){this.setOptions(t),this.defaults={clef:"treble",time:"4/4",stem:"auto"}}set(t){return Object.assign(this.defaults,t),this}setOptions(e){return this.options=t({factory:null,builder:null,commitHooks:[ne,se,it.easyScoreHook],throwOnError:!1},e),this.factory=this.options.factory,this.builder=this.options.builder||new ie(this.factory),this.grammar=new ee(this.builder),this.parser=new Zt(this.grammar),this.options.commitHooks.forEach((t=>this.addCommitHook(t))),this}setContext(t){return this.factory&&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 new te("Error parsing line: "+t,i);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(e,i={}){return i=t({clef:this.defaults.clef,stem:this.defaults.stem},i),this.parse(e,i),this.builder.getElements().notes}voice(e,i){return i=t({time:this.defaults.time},i),this.factory.Voice(i).addTickables(e)}addCommitHook(t){return this.builder.addCommitHook(t)}}const oe=s.MakeException("FactoryError");function ae(t={},e){const i=e.options;return(t=Object.assign(e,t)).options=Object.assign(i,t.options),t}class le{constructor(t){!function(...t){le.DEBUG&&s.L("Vex.Flow.Factory",t)}("New factory: ",t);const e={stave:{space:10},renderer:{context:null,elementId:"",backend:x.Backends.SVG,width:500,height:200,background:"#FFF"},font:{face:"Arial",point:10,style:""}};this.options=e,this.setOptions(t)}static newFromElementId(t,e=500,i=200){return new le({renderer:{elementId:t,width:e,height:i}})}reset(){this.renderQ=[],this.systems=[],this.staves=[],this.voices=[],this.stave=null}getOptions(){return this.options}setOptions(t){for(const e of["stave","renderer","font"])Object.assign(this.options[e],t[e]);(null!==this.options.renderer.elementId||this.options.renderer.context)&&this.initRenderer(),this.reset()}initRenderer(){const{elementId:t,backend:e,width:i,height:n,background:s}=this.options.renderer;if(""===t)throw new oe("HTML DOM element not set in Factory");this.context=x.buildContext(t,e,i,n,s)}getContext(){return this.context}setContext(t){return this.context=t,this}getStave(){return this.stave}getVoices(){return this.voices}space(t){return this.options.stave.space*t}Stave(t){t=ae(t,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:this.options.stave.space}});const e=new wt(t.x,t.y,t.width,t.options);return this.staves.push(e),e.setContext(this.context),this.stave=e,e}TabStave(t){t=ae(t,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:1.3*this.options.stave.space}});const e=new Tt(t.x,t.y,t.width,t.options);return this.staves.push(e),e.setContext(this.context),this.stave=e,e}StaveNote(t){const e=new k(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}GhostNote(t){const e=new Yt(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}TextNote(t){const e=new yt(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}BarNote(t){t=ae(t,{type:"single",options:{}});const e=new Xt(t.type);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}ClefNote(t){t=ae(t,{type:"treble",options:{size:"default"}});const e=new Ct(t.type,t.options.size,t.options.annotation);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}TimeSigNote(t){t=ae(t,{time:"4/4",options:{}});const e=new Rt(t.time);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}KeySigNote(t){const e=new It(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 Mt(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}GraceNote(t){const e=new Ft(t);return this.stave&&e.setStave(this.stave),e.setContext(this.context),e}GraceNoteGroup(t){const e=new Y(t.notes,t.slur);return e.setContext(this.context),e}Accidental(t){t=ae(t,{type:null,options:{}});const e=new z(t.type);return e.setContext(this.context),e}Annotation(t){t=ae(t,{text:"p",vJustify:"below",hJustify:"center",fontFamily:"Times",fontSize:14,fontWeight:"bold italic",options:{}});const e=new rt(t.text);return e.setJustification(t.hJustify),e.setVerticalJustification(t.vJustify),e.setFont(t.fontFamily,t.fontSize,t.fontWeight),e.setContext(this.context),e}Articulation(t){t=ae(t,{type:"a.",position:"above",options:{}});const e=new it(t.type);return e.setPosition(t.position),e.setContext(this.context),e}TextDynamics(t){t=ae(t,{text:"p",duration:"q",dots:0,line:0,options:{}});const e=new Gt({text:t.text,line:t.line,duration:t.duration,dots:t.dots});return this.stave&&e.setStave(this.stave),e.setContext(this.context),this.renderQ.push(e),e}Fingering(t){t=ae(t,{number:"0",position:"left",options:{}});const e=new V(t.number);return e.setPosition(t.position),e.setContext(this.context),e}StringNumber(t){t=ae(t,{number:"0",position:"left",options:{}});const e=new q(t.number);return e.setPosition(t.position),e.setContext(this.context),e}TickContext(){return(new nt).setContext(this.context)}ModifierContext(){return new ht}MultiMeasureRest(t){const e=new At(t.number_of_measures,t);return e.setContext(this.context),this.renderQ.push(e),e}Voice(t){t=ae(t,{time:"4/4",options:{}});const e=new L(t.time);return this.voices.push(e),e}StaveConnector(t){t=ae(t,{top_stave:null,bottom_stave:null,type:"double",options:{}});const e=new C(t.top_stave,t.bottom_stave);return e.setType(t.type).setContext(this.context),this.renderQ.push(e),e}Formatter(){return new dt}Tuplet(t){t=ae(t,{notes:[],options:{}});const e=new _(t.notes,t.options).setContext(this.context);return this.renderQ.push(e),e}Beam(t){t=ae(t,{notes:[],options:{autoStem:!1,secondaryBeamBreaks:[]}});const e=new P(t.notes,t.options.autoStem).setContext(this.context);return e.breakSecondaryAt(t.options.secondaryBeamBreaks),this.renderQ.push(e),e}Curve(t){t=ae(t,{from:null,to:null,options:{}});const e=new kt(t.from,t.to,t.options).setContext(this.context);return this.renderQ.push(e),e}StaveTie(t){t=ae(t,{from:null,to:null,first_indices:[0],last_indices:[0],text:null,options:{direction:void 0}});const e=new H({first_note:t.from,last_note:t.to,first_indices:t.first_indices,last_indices:t.last_indices},t.text);return t.options.direction&&e.setDirection(t.options.direction),e.setContext(this.context),this.renderQ.push(e),e}StaveLine(t){t=ae(t,{from:null,to:null,first_indices:[0],last_indices:[0],options:{}});const e=new Ut({first_note:t.from,last_note:t.to,first_indices:t.first_indices,last_indices:t.last_indices});return t.options.text&&e.setText(t.options.text),t.options.font&&e.setFont(t.options.font),e.setContext(this.context),this.renderQ.push(e),e}VibratoBracket(t){t=ae(t,{from:null,to:null,options:{harsh:!1}});const e=new Pt({start:t.from,stop:t.to});return t.options.line&&e.setLine(t.options.line),t.options.harsh&&e.setHarsh(t.options.harsh),e.setContext(this.context),this.renderQ.push(e),e}TextBracket(t){t=ae(t,{from:null,to:null,text:"",options:{superscript:"",position:1}});const e=new Ht({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 ce(t).setContext(this.context);return this.systems.push(e),e}EasyScore(t={}){return t.factory=this,new re(t)}PedalMarking(t={}){t=ae(t,{notes:[],options:{style:"mixed"}});const e=new jt(t.notes);return e.setStyle(jt.StylesString[t.options.style]),e.setContext(this.context),this.renderQ.push(e),e}NoteSubGroup(t={}){t=ae(t,{notes:[],options:{}});const e=new j(t.notes);return e.setContext(this.context),e}draw(){this.systems.forEach((t=>t.setContext(this.context).format())),this.staves.forEach((t=>t.setContext(this.context).draw())),this.voices.forEach((t=>t.setContext(this.context).draw())),this.renderQ.forEach((t=>{t.isRendered()||t.setContext(this.context).draw()})),this.systems.forEach((t=>t.setContext(this.context).draw())),this.reset()}}function he(t,e){const i=e.options;return(t=Object.assign(e,t)).options=Object.assign(i,t.options),t}class ce extends h{constructor(t={}){super(),this.setAttribute("type","System"),this.setOptions(t),this.parts=[]}setOptions(t={}){this.options=he(t,{x:10,y:10,width:500,connector:null,spaceBetweenStaves:12,factory:null,debugFormatter:!1,formatIterations:0,options:{}}),this.factory=this.options.factory||new le({renderer:{el:null}})}setContext(t){return super.setContext(t),this.factory.setContext(t),this}addConnector(t="double"){return this.connector=this.factory.StaveConnector({top_stave:this.parts[0].stave,bottom_stave:this.parts[this.parts.length-1].stave,type:t}),this.connector}addStave(t){return(t=he(t,{stave:null,voices:[],spaceAbove:0,spaceBelow:0,debugNoteMetrics:!1,options:{left_bar:!1}})).stave||(t.stave=this.factory.Stave({x:this.options.x,y:this.options.y,width:this.options.width,options:t.options})),t.voices.forEach((e=>e.setContext(this.context).setStave(t.stave).getTickables().forEach((e=>e.setStave(t.stave))))),this.parts.push(t),t.stave}format(){const t=new dt;this.formatter=t;let e=this.options.y,i=0,n=[];const s=[];this.parts.forEach((r=>{e+=r.stave.space(r.spaceAbove),r.stave.setY(e),t.joinVoices(r.voices),e+=r.stave.space(r.spaceBelow),e+=r.stave.space(this.options.spaceBetweenStaves),r.debugNoteMetrics&&(s.push({y:e,voice:r.voices[0]}),e+=15),n=n.concat(r.voices),i=Math.max(i,r.stave.getNoteStartX())})),this.parts.forEach((t=>t.stave.setNoteStartX(i)));const r=this.options.width-(i-this.options.x)-R.STAVEPADDING;t.format(n,r);for(let o=0;o<this.options.formatIterations;o++)t.tune();this.startX=i,this.debugNoteMetricsYs=s,this.lastY=e}draw(){const t=this.checkContext();this.setRendered(),this.options.debugFormatter&&dt.plotDebugging(t,this.formatter,this.startX,this.options.y,this.lastY),this.debugNoteMetricsYs.forEach((e=>{e.voice.getTickables().forEach((i=>R.plotMetrics(t,i,e.y)))}))}}(s.Flow=m).Element=h,s.Flow.Fraction=r,s.Flow.Renderer=x,s.Flow.Formatter=dt,s.Flow.Music=G,s.Flow.Glyph=p,s.Flow.Stave=wt,s.Flow.StaveNote=k,s.Flow.StaveModifier=ft,s.Flow.StaveTempo=gt,s.Flow.Voice=L,s.Flow.Accidental=z,s.Flow.Beam=P,s.Flow.StaveTie=H,s.Flow.TabStave=Tt,s.Flow.TabNote=Mt,s.Flow.Bend=ot,s.Flow.Vibrato=at,s.Flow.VibratoBracket=Pt,s.Flow.Note=R,s.Flow.ModifierContext=ht,s.Flow.MultiMeasureRest=At,s.Flow.TickContext=nt,s.Flow.Articulation=it,s.Flow.Annotation=rt,s.Flow.Barline=pt,s.Flow.NoteHead=N,s.Flow.StaveConnector=C,s.Flow.ClefNote=Ct,s.Flow.KeySignature=xt,s.Flow.KeySigNote=It,s.Flow.TimeSignature=Et,s.Flow.TimeSigNote=Rt,s.Flow.Stem=E,s.Flow.TabTie=X,s.Flow.Clef=vt,s.Flow.Dot=O,s.Flow.Modifier=B,s.Flow.TabSlide=Nt,s.Flow.Tuplet=_,s.Flow.GraceNote=Ft,s.Flow.GraceTabNote=Bt,s.Flow.Tuning=Ot,s.Flow.KeyManager=class{constructor(t){this.music=new G,this.setKey(t)}setKey(t){return this.key=t,this.reset(),this}getKey(){return this.key}reset(){if(this.keyParts=this.music.getKeyParts(this.key),this.keyString=this.keyParts.root,this.keyParts.accidental&&(this.keyString+=this.keyParts.accidental),!G.scaleTypes[this.keyParts.type])throw new s.RERR("BadArguments",`Unsupported key type: ${this.key}`);this.scale=this.music.getScaleTones(this.music.getNoteValue(this.keyString),G.scaleTypes[this.keyParts.type]),this.scaleMap={},this.scaleMapByValue={},this.originalScaleMapByValue={};const t=G.root_indices[this.keyParts.root];for(let e=0;e<G.roots.length;++e){const i=(t+e)%G.roots.length,n=G.roots[i],s=this.music.getRelativeNoteName(n,this.scale[e]);this.scaleMap[n]=s,this.scaleMapByValue[this.scale[e]]=s,this.originalScaleMapByValue[this.scale[e]]=s}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],n=this.music.getNoteParts(i);if(i===t)return{note:i,accidental:e.accidental,change:!1};const s=this.scaleMapByValue[this.music.getNoteValue(t)];if(null!=s)return{note:s,accidental:this.music.getNoteParts(s).accidental,change:!1};const r=this.originalScaleMapByValue[this.music.getNoteValue(t)];return null!=r?(this.scaleMap[n.root]=r,delete this.scaleMapByValue[this.music.getNoteValue(i)],this.scaleMapByValue[this.music.getNoteValue(t)]=r,{note:r,accidental:this.music.getNoteParts(r).accidental,change:!0}):n.root===t?(delete this.scaleMapByValue[this.music.getNoteValue(this.scaleMap[e.root])],this.scaleMapByValue[this.music.getNoteValue(n.root)]=n.root,this.scaleMap[n.root]=n.root,{note:n.root,accidental:null,change:!0}):(delete this.scaleMapByValue[this.music.getNoteValue(this.scaleMap[e.root])],this.scaleMapByValue[this.music.getNoteValue(t)]=t,delete this.scaleMap[n.root],this.scaleMap[n.root]=t,{note:t,accidental:e.accidental,change:!0})}},s.Flow.StaveHairpin=Dt,s.Flow.BoundingBox=u,s.Flow.Stroke=K,s.Flow.TextNote=yt,s.Flow.Curve=kt,s.Flow.TextDynamics=Gt,s.Flow.StaveLine=Ut,s.Flow.Ornament=st,s.Flow.PedalMarking=jt,s.Flow.TextBracket=Ht,s.Flow.FretHandFinger=V,s.Flow.Repetition=mt,s.Flow.BarNote=Xt,s.Flow.GhostNote=Yt,s.Flow.NoteSubGroup=j,s.Flow.GraceNoteGroup=Y,s.Flow.Tremolo=Kt,s.Flow.StringNumber=q,s.Flow.Crescendo=qt,s.Flow.Volta=_t,s.Flow.Font=d,s.Flow.System=ce,s.Flow.Factory=le,s.Flow.Parser=Zt,s.Flow.EasyScore=re,s.Flow.Registry=l,i.default=s},function(t,e,i){var n,s;Object.defineProperty(e,"__esModule",{value:!0}),e.TextAlignment=e.TextAlignmentEnum=void 0,(s=n=e.TextAlignmentEnum||(e.TextAlignmentEnum={}))[s.LeftTop=0]="LeftTop",s[s.LeftCenter=1]="LeftCenter",s[s.LeftBottom=2]="LeftBottom",s[s.CenterTop=3]="CenterTop",s[s.CenterCenter=4]="CenterCenter",s[s.CenterBottom=5]="CenterBottom",s[s.RightTop=6]="RightTop",s[s.RightCenter=7]="RightCenter",s[s.RightBottom=8]="RightBottom",e.TextAlignment=class{static IsLeft(t){return t===n.LeftTop||t===n.LeftCenter||t===n.LeftBottom}static IsCenterAligned(t){return t===n.CenterTop||t===n.CenterCenter||t===n.CenterBottom}static IsRight(t){return t===n.RightTop||t===n.RightCenter||t===n.RightBottom}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=Object.prototype.hasOwnProperty;function s(t){return"function"==typeof t}function r(t){return void 0===t}function o(t){return"[object String]"===Object.prototype.toString.call(t)}e.has=function(t,e){return n.call(t,e)},e.defaultCompare=function(t,e){return t<e?-1:t===e?0:1},e.defaultEquals=function(t,e){return t===e},e.defaultToString=function(t){return null===t?"COLLECTION_NULL":r(t)?"COLLECTION_UNDEFINED":o(t)?"$s"+t:"$o"+t.toString()},e.makeString=function(t,i){if(void 0===i&&(i=","),null===t)return"COLLECTION_NULL";if(r(t))return"COLLECTION_UNDEFINED";if(o(t))return t.toString();var n="{",s=!0;for(var a in t)e.has(t,a)&&(s?s=!1:n+=i,n=n+a+":"+t[a]);return n+"}"},e.isFunction=s,e.isUndefined=r,e.isString=o,e.reverseCompareFunction=function(t){return r(t)||!s(t)?function(t,e){return t<e?1:t===e?0:-1}:function(e,i){return-1*t(e,i)}},e.compareToEquals=function(t){return function(e,i){return 0===t(e,i)}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidEnumArgumentException=e.ArgumentOutOfRangeException=e.MusicSheetReadingException=void 0,e.MusicSheetReadingException=class{constructor(t,e){this.message=t,e&&(this.message+=" "+e.toString())}},e.ArgumentOutOfRangeException=class{constructor(t){this.message=t}},e.InvalidEnumArgumentException=class{constructor(t){this.message=t}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.Label=void 0;const n=i(9);e.Label=class{constructor(t="",e=n.TextAlignmentEnum.CenterBottom,i,s=!0){this.IsCreditLabel=!1,this.text=t,this.print=s,this.textAlignment=e,this.font=i,this.fontFamily=void 0}ToString(){return this.text}}},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowConverter=void 0;const s=n(i(8)),r=i(7),o=i(2),a=i(19),l=i(18),h=i(2),c=i(2),u=i(23),d=i(21),f=i(87),p=i(22),m=n(i(1)),b=i(14),g=i(40),y=i(50),S=i(76),v=i(16),x=i(80),E=i(3);class _{static duration(t,e){const i=t.RealValue;return 2===i?"1/2":i>=1?"w":i<1&&i>=.5?e&&i>.5?"w":"h":i<.5&&i>=.25?e&&i>.25?"h":"q":i<.25&&i>=.125?e&&i>.125?"q":"8":i<.125&&i>=.0625?e&&i>.0625?"8":"16":i<.0625&&i>=.03125?e&&i>.03125?"16":"32":i<.03125&&i>=.015625?e&&i>.015625?"32":"64":e?"64":"128"}static pitch(t,e,i,n){let s=3;e&&(s=0,i.ClefType===r.ClefEnum.F&&(s=2),i.ClefType===r.ClefEnum.C&&(s=2));const a=c.NoteEnum[t.FundamentalNote].toLowerCase(),l=o.Pitch.accidentalVexflow(t.Accidental),h=t.Octave-i.OctaveOffset+s;let u="";return n&&(u=this.NoteHeadCode(n)),[a+"n/"+h+u,l,i]}static restToNotePitch(t,e){let i=t.Octave;switch(e){case r.ClefEnum.C:case r.ClefEnum.F:i+=2;break;case r.ClefEnum.G:}return new o.Pitch(t.FundamentalNote,i,h.AccidentalEnum.NONE)}static NoteHeadCode(t){const e=t.Filled?"2":"1";switch(t.Shape){case S.NoteHeadShape.NORMAL:return"";case S.NoteHeadShape.DIAMOND:return"/D"+e;case S.NoteHeadShape.TRIANGLE:return"/T"+e;case S.NoteHeadShape.X:return"/X"+e;case S.NoteHeadShape.CIRCLEX:return"/X3";case S.NoteHeadShape.RECTANGLE:return"/R"+e;case S.NoteHeadShape.SQUARE:return"/S"+e;case S.NoteHeadShape.SLASH:default:return""}}static GhostNote(t){return new s.default.Flow.GhostNote({duration:_.duration(t,!1)})}static StaveNote(t){var e,i,n,r,o,a,l,h,c,u;t.sortForVexflow();const d=t.notes,f=t.parentStaffEntry.parentMeasure.parentSourceMeasure.Rules,p=d[0];let m=[];const g=[],y=p.graphicalNoteLength,x=void 0!==p.sourceNote.NoteTuplet;let E=_.duration(y,x);void 0!==p.sourceNote.TypeLength&&p.sourceNote.TypeLength!==y&&(E=_.duration(p.sourceNote.TypeLength,x));let w,T,M=p.numberOfDots,P=!1,L=0,A=!1,C=!1;for(const s of d){if(M<s.numberOfDots&&(M=s.numberOfDots),s.sourceNote.isRest()){if(C=!0,s.sourceNote.Pitch){m=[s.vfpitch[0]];break}{m=["b/4"];const t=null===(e=s.parentVoiceEntry)||void 0===e?void 0:e.parentVoiceEntry;if(t){const e=null===(i=s.parentVoiceEntry)||void 0===i?void 0:i.parentStaffEntry.parentMeasure.staffEntries;let c,u,d=-1;for(let i=0;i<e.length;i++)if((null===(n=e[i])||void 0===n?void 0:n.graphicalVoiceEntries[0].parentVoiceEntry)===t){d=i;break}if(d>=1&&e.length-1>=d+1&&(c=null===(o=null===(r=e[d-1])||void 0===r?void 0:r.graphicalVoiceEntries[0])||void 0===o?void 0:o.parentVoiceEntry,u=null===(l=null===(a=e[d+1])||void 0===a?void 0:a.graphicalVoiceEntries[0])||void 0===l?void 0:l.parentVoiceEntry,c&&u)){const t=c.Notes[0],e=u.Notes[0];if(null===(h=t.NoteBeam)||void 0===h?void 0:h.Notes.includes(e)){const t=c.Notes.last().Pitch,e=s.Clef();m=[_.pitch(_.restToNotePitch(t.getTransposedPitch(-2),e.ClefType),!1,e,void 0)[0]]}}}}if(y.RealValue===s.sourceNote.SourceMeasure.ActiveTimeSignature.RealValue&&(m=["d/5"],E="w",M=0,P=!0,L=f.WholeRestXShiftVexflow*v.unitInPixels),s.sourceNote.ParentStaff.Voices.length>1){let t=0;for(let e=0;e<s.sourceNote.ParentStaffEntry.VoiceEntries.length;e++)s.sourceNote.ParentStaffEntry.VoiceEntries[e].Notes[0].PrintObject&&t++;if(t>1)switch(null===(u=null===(c=s.sourceNote.ParentVoiceEntry)||void 0===c?void 0:c.ParentVoice)||void 0===u?void 0:u.VoiceId){case 1:m=["e/5"];break;case 2:m=["f/4"]}}break}s.sourceNote.Notehead&&s.sourceNote.Notehead.Shape===S.NoteHeadShape.SLASH&&(A=!0);const t=s.vfpitch;m.push(t[0]),g.push(t[1]),T||(T=_.Clef(t[2]).type)}for(let s=0,b=M;s<b;++s)E+="d";A&&(E+="s"),C&&(E+="r");const I={align_center:P,auto_stem:!0,clef:T,duration:E,keys:m,slash:t.parentVoiceEntry.GraceNoteSlash},R=t.notes[0].sourceNote;if(R.IsCueNote&&(I.glyph_font_scale=s.default.Flow.DEFAULT_NOTATION_FONT_SCALE*s.default.Flow.GraceNote.SCALE,I.stroke_px=s.default.Flow.GraceNote.LEDGER_LINE_OFFSET),w=t.parentVoiceEntry.IsGrace||t.notes[0].sourceNote.IsCueNote?new s.default.Flow.GraceNote(I):new s.default.Flow.StaveNote(I),w.getKeyProps().forEach((({line:e},i)=>t.notes[i].staffLine=e)),(f.LedgerLineWidth||f.LedgerLineStrokeStyle)&&(w.ledgerLineStyle||(w.ledgerLineStyle={}),f.LedgerLineWidth&&(w.ledgerLineStyle.lineWidth=f.LedgerLineWidth),f.LedgerLineStrokeStyle&&(w.ledgerLineStyle.strokeStyle=f.LedgerLineStrokeStyle)),f.ColoringEnabled){const e=f.DefaultColorStem;let i=t.parentVoiceEntry.StemColor;!i&&e&&(i=e);const n={fillStyle:i,strokeStyle:i};i&&(t.parentVoiceEntry.StemColor=i,w.setStemStyle(n),w.flag&&f.ColorFlags&&w.setFlagStyle(n))}if(w.x_shift=L,t.parentVoiceEntry.IsGrace&&t.notes[0].sourceNote.NoteBeam&&(t.parentVoiceEntry.WantedStemDirection=t.notes[0].sourceNote.NoteBeam.Notes[0].ParentVoiceEntry.WantedStemDirection),t.parentVoiceEntry)switch(t.parentVoiceEntry.WantedStemDirection){case b.StemDirectionType.Up:w.setStemDirection(s.default.Flow.Stem.UP),t.parentVoiceEntry.StemDirection=b.StemDirectionType.Up;break;case b.StemDirectionType.Down:w.setStemDirection(s.default.Flow.Stem.DOWN),t.parentVoiceEntry.StemDirection=b.StemDirectionType.Down}for(let b=0,S=d.length;b<S;b+=1){if(d[b].setIndex(w,b),g[b]){if("++"===g[b]){w.addAccidental(b,new s.default.Flow.Accidental("##")),w.addAccidental(b,new s.default.Flow.Accidental("#"));continue}if("bbs"===g[b]){w.addAccidental(b,new s.default.Flow.Accidental("bb")),w.addAccidental(b,new s.default.Flow.Accidental("b"));continue}w.addAccidental(b,new s.default.Flow.Accidental(g[b]))}const t=d[b].sourceNote.TremoloStrokes;if(t>0){const e=new s.default.Flow.Tremolo(t);e.extra_stroke_scale=f.TremoloStrokeScale,e.y_spacing_scale=f.TremoloYSpacingScale,w.addModifier(b,e)}}if(.25===R.Length.RealValue&&R.Notehead&&!1===R.Notehead.Filled){const t=w.getKeyProps();for(let e=0;e<t.length;e++)t[e].code="v81"}for(let s=0,b=M;s<b;++s)w.addDotToAll();return w}static generateArticulations(t,e,i){if(t&&"GhostNote"!==t.getAttribute("type"))for(const n of e){let e,r=s.default.Flow.Modifier.Position.ABOVE;t.getStemDirection()===s.default.Flow.Stem.UP&&(r=s.default.Flow.Modifier.Position.BELOW);const o=n.articulationEnum;switch(i.ArticulationPlacementFromXML&&(n.placement===E.PlacementEnum.Above?r=s.default.Flow.Modifier.Position.ABOVE:n.placement===E.PlacementEnum.Below&&(r=s.default.Flow.Modifier.Position.BELOW)),o){case b.ArticulationEnum.accent:e=new s.default.Flow.Articulation("a>");break;case b.ArticulationEnum.downbow:e=new s.default.Flow.Articulation("am"),void 0===n.placement&&(r=s.default.Flow.Modifier.Position.ABOVE);break;case b.ArticulationEnum.fermata:e=new s.default.Flow.Articulation("a@a"),r=s.default.Flow.Modifier.Position.ABOVE;break;case b.ArticulationEnum.marcatodown:e=new s.default.Flow.Articulation("a|");break;case b.ArticulationEnum.marcatoup:e=new s.default.Flow.Articulation("a^");break;case b.ArticulationEnum.invertedfermata:e=new s.default.Flow.Articulation("a@u"),r=s.default.Flow.Modifier.Position.BELOW;break;case b.ArticulationEnum.lefthandpizzicato:e=new s.default.Flow.Articulation("a+");break;case b.ArticulationEnum.naturalharmonic:e=new s.default.Flow.Articulation("ah");break;case b.ArticulationEnum.snappizzicato:e=new s.default.Flow.Articulation("ao");break;case b.ArticulationEnum.staccatissimo:e=new s.default.Flow.Articulation("av");break;case b.ArticulationEnum.staccato:e=new s.default.Flow.Articulation("a.");break;case b.ArticulationEnum.tenuto:e=new s.default.Flow.Articulation("a-");break;case b.ArticulationEnum.upbow:e=new s.default.Flow.Articulation("a|"),void 0===n.placement&&(r=s.default.Flow.Modifier.Position.ABOVE);break;case b.ArticulationEnum.strongaccent:e=new s.default.Flow.Articulation("a^")}e&&(e.setPosition(r),t.addModifier(0,e))}}static generateOrnaments(t,e){let i,n=s.default.Flow.Modifier.Position.ABOVE;switch(e.placement===E.PlacementEnum.Below&&(n=s.default.Flow.Modifier.Position.BELOW),e.GetOrnament){case y.OrnamentEnum.DelayedInvertedTurn:i=new s.default.Flow.Ornament("turn_inverted"),i.setDelayed(!0);break;case y.OrnamentEnum.DelayedTurn:i=new s.default.Flow.Ornament("turn"),i.setDelayed(!0);break;case y.OrnamentEnum.InvertedMordent:i=new s.default.Flow.Ornament("mordent"),i.setDelayed(!1);break;case y.OrnamentEnum.InvertedTurn:i=new s.default.Flow.Ornament("turn_inverted"),i.setDelayed(!1);break;case y.OrnamentEnum.Mordent:i=new s.default.Flow.Ornament("mordent_inverted"),i.setDelayed(!1);break;case y.OrnamentEnum.Trill:i=new s.default.Flow.Ornament("tr"),i.setDelayed(!1);break;case y.OrnamentEnum.Turn:i=new s.default.Flow.Ornament("turn"),i.setDelayed(!1);break;default:return void m.default.warn("unhandled OrnamentEnum type: "+e.GetOrnament)}i&&(e.AccidentalBelow!==h.AccidentalEnum.NONE&&i.setLowerAccidental(o.Pitch.accidentalVexflow(e.AccidentalBelow)),e.AccidentalAbove!==h.AccidentalEnum.NONE&&i.setUpperAccidental(o.Pitch.accidentalVexflow(e.AccidentalAbove)),i.setPosition(n),t.addModifier(0,i))}static StrokeTypeFromArpeggioType(t){switch(t){case x.ArpeggioType.ARPEGGIO_DIRECTIONLESS:return s.default.Flow.Stroke.Type.ARPEGGIO_DIRECTIONLESS;case x.ArpeggioType.BRUSH_DOWN:return s.default.Flow.Stroke.Type.BRUSH_UP;case x.ArpeggioType.BRUSH_UP:return s.default.Flow.Stroke.Type.BRUSH_DOWN;case x.ArpeggioType.RASQUEDO_DOWN:return s.default.Flow.Stroke.Type.RASQUEDO_UP;case x.ArpeggioType.RASQUEDO_UP:return s.default.Flow.Stroke.Type.RASQUEDO_DOWN;case x.ArpeggioType.ROLL_DOWN:return s.default.Flow.Stroke.Type.ROLL_UP;case x.ArpeggioType.ROLL_UP:return s.default.Flow.Stroke.Type.ROLL_DOWN;default:return s.default.Flow.Stroke.Type.ARPEGGIO_DIRECTIONLESS}}static CreateTabNote(t){const e=[],i=t.notes.reverse(),n=[],r=t.notes[0].graphicalNoteLength,o=void 0!==t.notes[0].sourceNote.NoteTuplet;let a=_.duration(r,o),l=0,h=!1;for(const u of t.notes){const t=u.sourceNote,i={str:t.StringNumberTab,fret:t.FretNumber};e.push(i),t.BendArray&&t.BendArray.forEach((function(t){let e;const r=t.bendalter-i.fret;e=r>1?"Full":1===r?"1/2":"1/4","up"===t.direction?n.push({type:s.default.Flow.Bend.UP,text:e,width:10}):n.push({type:s.default.Flow.Bend.DOWN,text:e,width:10})})),t.VibratoStroke&&(h=!0),l<u.numberOfDots&&(l=u.numberOfDots)}for(let s=0,u=l;s<u;++s)a+="d";const c=new s.default.Flow.TabNote({duration:a,positions:e});for(let s=0,u=i.length;s<u;s+=1)i[s].setIndex(c,s);return n.forEach((function(t){t.type===s.default.Flow.Bend.UP?c.addModifier(new s.default.Flow.Bend(t.text,!1)):c.addModifier(new s.default.Flow.Bend(t.text,!0))})),h&&c.addModifier(new s.default.Flow.Vibrato),c}static Clef(t,e="default"){let i,n;switch("default"!==e&&"small"!==e&&(m.default.warn(`Invalid VexFlow clef size "${e}" specified. Using "default".`),e="default"),t.ClefType){case r.ClefEnum.G:switch(t.Line){case 1:i="french";break;case 2:i="treble";break;default:i="treble",m.default.error(`Clef ${r.ClefEnum[t.ClefType]} on line ${t.Line} not supported by VexFlow. Using default value "${i}".`)}break;case r.ClefEnum.F:switch(t.Line){case 4:i="bass";break;case 3:i="baritone-f";break;case 5:i="subbass";break;default:i="bass",m.default.error(`Clef ${r.ClefEnum[t.ClefType]} on line ${t.Line} not supported by VexFlow. Using default value "${i}".`)}break;case r.ClefEnum.C:switch(t.Line){case 3:i="alto";break;case 4:i="tenor";break;case 1:i="soprano";break;case 2:i="mezzo-soprano";break;default:i="alto",m.default.error(`Clef ${r.ClefEnum[t.ClefType]} on line ${t.Line} not supported by VexFlow. Using default value "${i}".`)}break;case r.ClefEnum.percussion:i="percussion";break;case r.ClefEnum.TAB:i="treble";break;default:m.default.info("bad clef type: "+t.ClefType),i="treble"}return 1===t.OctaveOffset&&"bass"!==i?n="8va":-1===t.OctaveOffset&&(n="8vb"),{type:i,size:e,annotation:n}}static TimeSignature(t){let e;switch(t.SymbolEnum){case a.RhythmSymbolEnum.NONE:e=t.Rhythm.Numerator+"/"+t.Rhythm.Denominator;break;case a.RhythmSymbolEnum.COMMON:e="C";break;case a.RhythmSymbolEnum.CUT:e="C|"}return new s.default.Flow.TimeSignature(e)}static keySignature(t){if(!t)return;let e;switch(t.Mode){case l.KeyEnum.minor:e=_.minorMap[t.Key]+"m";break;case l.KeyEnum.major:case l.KeyEnum.none:e=_.majorMap[t.Key];break;default:e="C"}return e}static line(t,e){switch(t){case u.SystemLinesEnum.SingleThin:return e===g.SystemLinePosition.MeasureBegin?s.default.Flow.StaveConnector.type.SINGLE:s.default.Flow.StaveConnector.type.SINGLE_RIGHT;case u.SystemLinesEnum.DoubleThin:return s.default.Flow.StaveConnector.type.DOUBLE;case u.SystemLinesEnum.ThinBold:return s.default.Flow.StaveConnector.type.BOLD_DOUBLE_RIGHT;case u.SystemLinesEnum.BoldThinDots:return s.default.Flow.StaveConnector.type.BOLD_DOUBLE_LEFT;case u.SystemLinesEnum.DotsThinBold:case u.SystemLinesEnum.DotsBoldBoldDots:return s.default.Flow.StaveConnector.type.BOLD_DOUBLE_RIGHT;case u.SystemLinesEnum.None:return s.default.Flow.StaveConnector.type.NONE}}static font(t,e=d.FontStyles.Regular,i=f.Fonts.TimesNewRoman,n,s){let r="normal",o="normal",a=`'${n.DefaultFontFamily}'`;switch(e){case d.FontStyles.Bold:o="bold";break;case d.FontStyles.Italic:r="italic";break;case d.FontStyles.BoldItalic:r="italic",o="bold";break;case d.FontStyles.Underlined:}switch(i){case f.Fonts.Kokila:}return s&&"default"!==s&&(a=`'${s}'`),r+" "+o+" "+Math.floor(t)+"px "+a}static fontStyle(t){switch(t){case d.FontStyles.Bold:return"bold";case d.FontStyles.Italic:return"italic";case d.FontStyles.BoldItalic:return"italic bold";default:return"normal"}}static style(t){return p.OUTLINE_AND_FILL_STYLE_DICT.getValue(t)}}e.VexFlowConverter=_,_.majorMap={"-1":"F","-2":"Bb","-3":"Eb","-4":"Ab","-5":"Db","-6":"Gb","-7":"Cb","-8":"Fb",0:"C",1:"G",2:"D",3:"A",4:"E",5:"B",6:"F#",7:"C#",8:"G#"},_.minorMap={"-1":"D","-2":"G","-3":"C","-4":"F","-5":"Bb","-6":"Eb","-7":"Ab","-8":"Db",0:"A",1:"E",2:"B",3:"F#",4:"C#",5:"G#",6:"D#",7:"A#",8:"E#"}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.StemDirectionType=e.ArticulationEnum=e.VoiceEntry=void 0;const n=i(0),s=i(36),r=i(2),o=i(50),a=i(2),l=i(15);class h{constructor(t,e,i,n=!1,s=!1,r=!1){if(this.notes=[],this.articulations=[],this.technicalInstructions=[],this.lyricsEntries=new l.Dictionary,this.wantedStemDirection=u.Undefined,this.stemDirectionXml=u.Undefined,this.stemDirection=u.Undefined,this.timestamp=t,this.parentVoice=e,this.parentSourceStaffEntry=i,this.isGrace=n,this.graceAfterMainNote=!1,this.graceNoteSlash=s,this.graceSlur=r,void 0!==i){const t=i.VoiceEntries;-1===t.indexOf(this)&&t.push(this)}}get ParentSourceStaffEntry(){return this.parentSourceStaffEntry}get ParentVoice(){return this.parentVoice}get Timestamp(){return this.timestamp}set Timestamp(t){this.timestamp=t}get Notes(){return this.notes}get IsGrace(){return this.isGrace}set IsGrace(t){this.isGrace=t}get GraceAfterMainNote(){return this.graceAfterMainNote}set GraceAfterMainNote(t){this.graceAfterMainNote=t}get GraceNoteSlash(){return this.graceNoteSlash}set GraceNoteSlash(t){this.graceNoteSlash=t}get GraceSlur(){return this.graceSlur}set GraceSlur(t){this.graceSlur=t}get Articulations(){return this.articulations}get TechnicalInstructions(){return this.technicalInstructions}get LyricsEntries(){return this.lyricsEntries}get Arpeggio(){return this.arpeggio}set Arpeggio(t){this.arpeggio=t}get OrnamentContainer(){return this.ornamentContainer}set OrnamentContainer(t){this.ornamentContainer=t}set WantedStemDirection(t){this.wantedStemDirection=t}get WantedStemDirection(){return this.wantedStemDirection}set StemDirectionXml(t){this.stemDirectionXml=t}get StemDirectionXml(){return this.stemDirectionXml}set StemDirection(t){this.stemDirection=t}get StemDirection(){return this.stemDirection}get StemColorXml(){return this.stemColorXml}set StemColorXml(t){this.stemColorXml=t}get StemColor(){return this.stemColor}set StemColor(t){this.stemColor=t}hasArticulation(t){for(const e of this.articulations)if(e.Equals(t))return!0;return!1}static isSupportedArticulation(t){switch(t){case c.accent:case c.strongaccent:case c.invertedstrongaccent:case c.staccato:case c.staccatissimo:case c.spiccato:case c.tenuto:case c.fermata:case c.invertedfermata:case c.breathmark:case c.caesura:case c.lefthandpizzicato:case c.naturalharmonic:case c.snappizzicato:case c.upbow:case c.downbow:case c.bend:return!0;default:return!1}}hasTie(){for(let t=0,e=this.Notes.length;t<e;++t)if(this.Notes[t].NoteTie)return!0;return!1}hasSlur(){for(let t=0,e=this.Notes.length;t<e;++t)if(this.Notes[t].NoteSlurs.length>0)return!0;return!1}isStaccato(){for(const t of this.Articulations)if(t.articulationEnum===c.staccato)return!0;return!1}isAccent(){for(const t of this.Articulations)if(t.articulationEnum===c.accent||t.articulationEnum===c.strongaccent)return!0;return!1}getVerseNumberForLyricEntry(t){let e=1;return this.lyricsEntries.forEach(((i,n)=>{t===n&&(e=i)})),e}createVoiceEntriesForOrnament(t,e){t||(t=this);const i=[];if(!t.ornamentContainer)return;const s=this.notes[0],r=s.Length,l=t.ParentVoice,h=t.Timestamp;let c=n.Fraction.createFromFraction(h);switch(t.ornamentContainer.GetOrnament){case o.OrnamentEnum.Trill:{const o=new n.Fraction(r.Numerator,8*r.Denominator),u=s.Pitch.getTransposedPitch(1);let d=e.getAlterationForPitch(u);t.OrnamentContainer.AccidentalAbove!==a.AccidentalEnum.NONE&&(d=t.ornamentContainer.AccidentalAbove);for(let t=0;t<8;t++)c=n.Fraction.plus(h,new n.Fraction(t*o.Numerator,o.Denominator)),t%2==0?this.createBaseVoiceEntry(c,o,l,s,i):this.createAlteratedVoiceEntry(c,o,l,s.SourceMeasure,u,d,i);break}case o.OrnamentEnum.Turn:{const t=new n.Fraction(r.Numerator,4*r.Denominator),o=s.Pitch.getTransposedPitch(-1),a=e.getAlterationForPitch(o),h=s.Pitch.getTransposedPitch(1),u=e.getAlterationForPitch(h);this.createAlteratedVoiceEntry(c,t,l,s.SourceMeasure,h,u,i),c.Add(t),this.createBaseVoiceEntry(c,t,l,s,i),c.Add(t),this.createAlteratedVoiceEntry(c,t,l,s.SourceMeasure,o,a,i),c.Add(t),this.createBaseVoiceEntry(c,t,l,s,i);break}case o.OrnamentEnum.InvertedTurn:{const t=new n.Fraction(r.Numerator,4*r.Denominator),o=s.Pitch.getTransposedPitch(-1),a=e.getAlterationForPitch(o),h=s.Pitch.getTransposedPitch(1),u=e.getAlterationForPitch(h);this.createAlteratedVoiceEntry(c,t,l,s.SourceMeasure,o,a,i),c.Add(t),this.createBaseVoiceEntry(c,t,l,s,i),c.Add(t),this.createAlteratedVoiceEntry(c,t,l,s.SourceMeasure,h,u,i),c.Add(t),this.createBaseVoiceEntry(c,t,l,s,i);break}case o.OrnamentEnum.DelayedTurn:{const t=new n.Fraction(r.Numerator,2*r.Denominator),o=s.Pitch.getTransposedPitch(-1),a=e.getAlterationForPitch(o),u=s.Pitch.getTransposedPitch(1),d=e.getAlterationForPitch(u);this.createBaseVoiceEntry(c,t,l,s,i),c=n.Fraction.plus(h,t),t.Denominator=8*r.Denominator,this.createAlteratedVoiceEntry(c,t,l,s.SourceMeasure,u,d,i),c.Add(t),this.createBaseVoiceEntry(c,t,l,s,i),c.Add(t),this.createAlteratedVoiceEntry(c,t,l,s.SourceMeasure,o,a,i),c.Add(t),this.createBaseVoiceEntry(c,t,l,s,i);break}case o.OrnamentEnum.DelayedInvertedTurn:{const t=new n.Fraction(r.Numerator,2*r.Denominator),o=s.Pitch.getTransposedPitch(-1),a=e.getAlterationForPitch(o),u=s.Pitch.getTransposedPitch(1),d=e.getAlterationForPitch(u);this.createBaseVoiceEntry(c,t,l,s,i),c=n.Fraction.plus(h,t),t.Denominator=8*r.Denominator,this.createAlteratedVoiceEntry(c,t,l,s.SourceMeasure,o,a,i),c.Add(t),this.createBaseVoiceEntry(c,t,l,s,i),c.Add(t),this.createAlteratedVoiceEntry(c,t,l,s.SourceMeasure,u,d,i),c.Add(t),this.createBaseVoiceEntry(c,t,l,s,i);break}case o.OrnamentEnum.Mordent:{const t=new n.Fraction(r.Numerator,4*r.Denominator),o=s.Pitch.getTransposedPitch(1),a=e.getAlterationForPitch(o);this.createBaseVoiceEntry(c,t,l,s,i),c.Add(t),this.createAlteratedVoiceEntry(c,t,l,s.SourceMeasure,o,a,i),t.Denominator=2*r.Denominator,c=n.Fraction.plus(h,t),this.createBaseVoiceEntry(c,t,l,s,i);break}case o.OrnamentEnum.InvertedMordent:{const t=new n.Fraction(r.Numerator,4*r.Denominator),o=s.Pitch.getTransposedPitch(-1),a=e.getAlterationForPitch(o);this.createBaseVoiceEntry(c,t,l,s,i),c.Add(t),this.createAlteratedVoiceEntry(c,t,l,s.SourceMeasure,o,a,i),t.Denominator=2*r.Denominator,c=n.Fraction.plus(h,t),this.createBaseVoiceEntry(c,t,l,s,i);break}default:throw new RangeError}return i}createBaseVoiceEntry(t,e,i,n,o){const a=new h(t,i,n.ParentStaffEntry),l=new r.Pitch(n.Pitch.FundamentalNote,n.Pitch.Octave,n.Pitch.Accidental),c=new s.Note(a,void 0,e,l,n.SourceMeasure);a.Notes.push(c),o.push(a)}createAlteratedVoiceEntry(t,e,i,n,o,a,l){const c=new h(t,i,void 0),u=new r.Pitch(o.FundamentalNote,o.Octave,a),d=new s.Note(c,void 0,e,u,n);c.Notes.push(d),l.push(c)}}var c,u,d;e.VoiceEntry=h,(d=c=e.ArticulationEnum||(e.ArticulationEnum={}))[d.accent=0]="accent",d[d.strongaccent=1]="strongaccent",d[d.marcatoup=2]="marcatoup",d[d.marcatodown=3]="marcatodown",d[d.invertedstrongaccent=4]="invertedstrongaccent",d[d.staccato=5]="staccato",d[d.staccatissimo=6]="staccatissimo",d[d.spiccato=7]="spiccato",d[d.tenuto=8]="tenuto",d[d.fermata=9]="fermata",d[d.invertedfermata=10]="invertedfermata",d[d.breathmark=11]="breathmark",d[d.caesura=12]="caesura",d[d.lefthandpizzicato=13]="lefthandpizzicato",d[d.naturalharmonic=14]="naturalharmonic",d[d.snappizzicato=15]="snappizzicato",d[d.upbow=16]="upbow",d[d.downbow=17]="downbow",d[d.scoop=18]="scoop",d[d.plop=19]="plop",d[d.doit=20]="doit",d[d.falloff=21]="falloff",d[d.stress=22]="stress",d[d.unstress=23]="unstress",d[d.detachedlegato=24]="detachedlegato",d[d.otherarticulation=25]="otherarticulation",d[d.bend=26]="bend",function(t){t[t.Undefined=-1]="Undefined",t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.None=2]="None",t[t.Double=3]="Double"}(u=e.StemDirectionType||(e.StemDirectionType={}))},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(35);e.arrays=n;var s=i(157);e.Bag=s.default;var r=i(158);e.BSTree=r.default;var o=i(83);e.BSTreeKV=o.default;var a=i(29);e.Dictionary=a.default;var l=i(85);e.Heap=l.default;var h=i(159);e.LinkedDictionary=h.default;var c=i(53);e.LinkedList=c.default;var u=i(160);e.MultiDictionary=u.default;var d=i(86);e.FactoryDictionary=d.default;var f=i(86);e.DefaultDictionary=f.default;var p=i(84);e.Queue=p.default;var m=i(161);e.PriorityQueue=m.default;var b=i(82);e.Set=b.default;var g=i(162);e.Stack=g.default;var y=i(163);e.MultiRootTree=y.default;var S=i(10);e.util=S},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowMusicSheetDrawer=e.unitInPixels=void 0;const s=n(i(8)),r=i(119),o=i(46),a=i(4),l=i(63),h=i(22),c=i(3),u=i(70),d=i(79),f=n(i(1)),p=i(52),m=i(33),b=i(88);e.unitInPixels=10;class g extends r.MusicSheetDrawer{constructor(t=new m.DrawingParameters){super(new l.VexFlowTextMeasurer(t.Rules),t),this.backends=[],this.zoom=1,this.pageIdx=0}get Backends(){return this.backends}drawSheet(t){var i,n,r;"gonville"===this.rules.DefaultVexFlowNoteFont&&(s.default.Flow.DEFAULT_FONT_STACK=[null===(i=s.default.Flow.Fonts)||void 0===i?void 0:i.Gonville,null===(n=s.default.Flow.Fonts)||void 0===n?void 0:n.Bravura,null===(r=s.default.Flow.Fonts)||void 0===r?void 0:r.Custom]),s.default.Flow.STAVE_LINE_THICKNESS=this.rules.StaffLineWidth*e.unitInPixels,s.default.Flow.STEM_WIDTH=this.rules.StemWidth*e.unitInPixels,s.default.Flow.DEFAULT_NOTATION_FONT_SCALE=this.rules.VexFlowDefaultNotationFontScale,s.default.Flow.DEFAULT_TAB_FONT_SCALE=this.rules.VexFlowDefaultTabFontScale,this.pageIdx=0;for(const e of t.MusicPages){if(e.PageNumber>this.rules.MaxPageToDrawNumber)break;const t=this.backends[this.pageIdx];t.graphicalMusicPage=e,t.scale(this.zoom),this.pageIdx+=1}this.pageIdx=0,this.backend=this.backends[0],super.drawSheet(t)}drawPage(t){t&&(this.backend=this.backends[t.PageNumber-1],super.drawPage(t),this.pageIdx+=1)}clear(){for(const t of this.backends)t.clear()}setZoom(t){this.zoom=t}calculatePixelDistance(t){return t*e.unitInPixels}drawStaffLine(t){super.drawStaffLine(t);const e=t.PositionAndShape.AbsolutePosition;this.rules.RenderSlurs&&this.drawSlurs(t,e)}drawSlurs(t,e){for(const i of t.GraphicalSlurs)i.slur.isCrossed()||this.drawSlur(i,e)}drawSlur(t,e){const i=[],n=new a.PointF2D(t.bezierStartPt.x+e.x,t.bezierStartPt.y+e.y),s=new a.PointF2D(t.bezierStartControlPt.x+e.x,t.bezierStartControlPt.y+e.y),r=new a.PointF2D(t.bezierEndControlPt.x+e.x,t.bezierEndControlPt.y+e.y),o=new a.PointF2D(t.bezierEndPt.x+e.x,t.bezierEndPt.y+e.y);i.push(this.applyScreenTransformation(n)),i.push(this.applyScreenTransformation(s)),i.push(this.applyScreenTransformation(r)),i.push(this.applyScreenTransformation(o)),t.placement===c.PlacementEnum.Above?(n.y-=.05,s.y-=.3,r.y-=.3,o.y-=.05):(n.y+=.05,s.y+=.3,r.y+=.3,o.y+=.05),i.push(this.applyScreenTransformation(n)),i.push(this.applyScreenTransformation(s)),i.push(this.applyScreenTransformation(r)),i.push(this.applyScreenTransformation(o)),this.backend.renderCurve(i)}drawMeasure(t){t.setAbsoluteCoordinates(t.PositionAndShape.AbsolutePosition.x*e.unitInPixels,t.PositionAndShape.AbsolutePosition.y*e.unitInPixels);try{t.draw(this.backend.getContext())}catch(i){f.default.warn("VexFlowMusicSheetDrawer.drawMeasure",i)}for(const e of t.staffEntries)this.drawStaffEntry(e)}drawLine(t,i,n="#FF0000FF",s=.2){return t=this.applyScreenTransformation(t),i=this.applyScreenTransformation(i),this.backend.renderLine(t,i,n,s*e.unitInPixels)}DrawOverlayLine(t,i,n,s="#FF0000FF",r=.2){if(!n.PageNumber||n.PageNumber>this.backends.length||n.PageNumber<1)return void ("VexFlowMusicSheetDrawer.drawOverlayLine: invalid page number / music page number doesn't correspond to an existing backend.");const o=n.PageNumber-1,a=this.backends[o];return t=this.applyScreenTransformation(t),i=this.applyScreenTransformation(i),a.renderLine(t,i,s,r*e.unitInPixels)}drawSkyLine(t){const e=t.PositionAndShape.AbsolutePosition,i=t.PositionAndShape.Size.width;this.drawSampledLine(t.SkyLine,e,i)}drawBottomLine(t){const e=new a.PointF2D(t.PositionAndShape.AbsolutePosition.x,t.PositionAndShape.AbsolutePosition.y),i=t.PositionAndShape.Size.width;this.drawSampledLine(t.BottomLine,e,i,"#0000FFFF")}drawSampledLine(t,e,i,n="#FF0000FF"){const s=[];let r=0;for(let a=0;a<t.length;a++)t[a]!==r&&(s.push(a),r=t[a]);const o=e;if(s.length>0){const e=this.rules.SamplingUnit;let r,l,h=new a.PointF2D(o.x,o.y),c=new a.PointF2D(s[0]/e+o.x,o.y);this.drawLine(h,c,n),t[0]>=0&&(r=new a.PointF2D(s[0]/e+o.x,o.y),l=new a.PointF2D(s[0]/e+o.x,o.y+t[s[0]]),this.drawLine(r,l,n));for(let i=1;i<s.length;i++)h=new a.PointF2D(s[i-1]/e+o.x,o.y+t[s[i-1]]),c=new a.PointF2D(s[i]/e+o.x,o.y+t[s[i-1]]),this.drawLine(h,c,n),r=new a.PointF2D(s[i]/e+o.x,o.y+t[s[i-1]]),l=new a.PointF2D(s[i]/e+o.x,o.y+t[s[i]]),this.drawLine(r,l,n);s[s.length-1]<t.length?(h=new a.PointF2D(s[s.length-1]/e+o.x,o.y+t[s[s.length-1]]),c=new a.PointF2D(o.x+i,o.y+t[s[s.length-1]]),this.drawLine(h,c,n)):(h=new a.PointF2D(s[s.length-1]/e+o.x,o.y),c=new a.PointF2D(o.x+i,o.y),this.drawLine(h,c,n))}else{const t=new a.PointF2D(o.x,o.y),e=new a.PointF2D(o.x+i,o.y);this.drawLine(t,e,n)}}drawStaffEntry(t){if(void 0!==t.graphicalChordContainers&&t.graphicalChordContainers.length>0)for(const e of t.graphicalChordContainers)this.drawLabel(e.GraphicalLabel,h.GraphicalLayers.Notes);this.rules.RenderLyrics&&t.LyricsEntries.length>0&&this.drawLyrics(t.LyricsEntries,h.GraphicalLayers.Notes)}drawLyrics(t,e){t.forEach((t=>this.drawLabel(t.GraphicalLabel,e)))}drawInstrumentBrace(t,e){t.draw(this.backend.getContext())}drawGroupBracket(t,e){t.draw(this.backend.getContext())}drawOctaveShifts(t){for(const e of t.OctaveShifts)if(e){const t=e,i=this.backend.getContext(),n=t.getTextBracket();n.setContext(i),n.draw()}}drawExpressions(t){for(const e of t.AbstractExpressions)e instanceof d.GraphicalInstantaneousDynamicExpression?this.drawInstantaneousDynamic(e):e instanceof u.GraphicalInstantaneousTempoExpression?this.drawLabel(e.GraphicalLabel,h.GraphicalLayers.Notes):e instanceof p.GraphicalContinuousDynamicExpression?this.drawContinuousDynamic(e):e instanceof b.GraphicalUnknownExpression?this.drawLabel(e.Label,h.GraphicalLayers.Notes):f.default.warn("Unkown type of expression!")}drawInstantaneousDynamic(t){this.drawLabel(t.Label,h.GraphicalLayers.Notes)}drawContinuousDynamic(t){if(t.IsVerbal)this.drawLabel(t.Label,h.GraphicalLayers.Notes);else for(const e of t.Lines){const i=new a.PointF2D(t.ParentStaffLine.PositionAndShape.AbsolutePosition.x+e.Start.x,t.ParentStaffLine.PositionAndShape.AbsolutePosition.y+e.Start.y),n=new a.PointF2D(t.ParentStaffLine.PositionAndShape.AbsolutePosition.x+e.End.x,t.ParentStaffLine.PositionAndShape.AbsolutePosition.y+e.End.y);this.drawLine(i,n,"black",e.Width)}}renderLabel(t,i,n,s,r,o){var l;if(!t.Label.print)return[];const h=[],c=t.Label.fontHeight*e.unitInPixels,{font:u}=t.Label;let d;this.rules.ColoringEnabled&&(d=t.Label.colorDefault,d||(d=this.rules.DefaultColorLabel));let{fontStyle:f,fontFamily:p}=t.Label;f||(f=this.rules.DefaultFontStyle),p||(p=this.rules.DefaultFontFamily);for(let e=0;e<(null===(l=t.TextLines)||void 0===l?void 0:l.length);e++){const i=t.TextLines[e],n=this.calculatePixelDistance(i.xOffset),s=new a.PointF2D(o.x+n,o.y);h.push(this.backend.renderText(c,f,u,i.text,r,s,d,t.Label.fontFamily)),o.y=o.y+r,t.TextLines.length>1&&(o.y+=this.rules.SpacingBetweenTextLines)}return h}renderRectangle(t,e,i,n,s){return this.backend.renderRectangle(t,i,n,s)}applyScreenTransformation(t){return new a.PointF2D(t.x*e.unitInPixels,t.y*e.unitInPixels)}applyScreenTransformationForRect(t){return new o.RectangleF2D(t.x*e.unitInPixels,t.y*e.unitInPixels,t.width*e.unitInPixels,t.height*e.unitInPixels)}}e.VexFlowMusicSheetDrawer=g},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSheetCalculator=void 0;const s=i(68),r=i(0),o=i(36),a=i(7),l=i(30),h=i(14),c=i(113),u=i(4),d=i(31),f=i(24),p=i(9),m=i(18),b=i(41),g=i(5),y=i(115),S=i(116),v=i(7),x=n(i(1)),E=i(15),_=i(27),w=i(12),T=i(54),M=i(3),P=i(70),L=i(37),A=i(56),C=i(32),I=i(52),R=i(25),N=i(88);class F{constructor(){this.staffEntriesWithGraphicalTies=[],this.staffEntriesWithOrnaments=[],this.staffEntriesWithChordSymbols=[],this.staffLinesWithLyricWords=[],this.graphicalLyricWords=[],this.abstractNotImplementedErrorMessage="abstract, not implemented"}static get TextMeasurer(){return F.textMeasurer}static set TextMeasurer(t){F.textMeasurer=t}get leadSheet(){return this.graphicalMusicSheet.LeadSheet}static setMeasuresMinStaffEntriesWidth(t,e){for(let i=0,n=t.length;i<n;++i){const n=t[i];n&&(n.minimumStaffEntriesWidth=e)}}initialize(t){this.graphicalMusicSheet=t,this.rules=t.ParentMusicSheet.Rules,this.rules.clearMusicSheetObjects(),this.prepareGraphicalMusicSheet()}prepareGraphicalMusicSheet(){const t=this.graphicalMusicSheet.ParentMusicSheet;this.staffEntriesWithGraphicalTies=[],this.staffEntriesWithOrnaments=[],this.staffEntriesWithChordSymbols=[],this.staffLinesWithLyricWords=[],this.graphicalMusicSheet.Initialize();const e=this.graphicalMusicSheet.MeasureList,i=this.createAccidentalCalculators(),n=this.graphicalMusicSheet.initializeActiveClefs(),s=[],r=t.getCompleteNumberOfStaves(),o=[];for(let a=0;a<r;a++)o.push(void 0);for(let a=0,h=t.SourceMeasures.length;a<h;++a){const r=t.SourceMeasures[a],l=this.createGraphicalMeasuresForSourceMeasure(r,i,s,o,n);if(e.push(l),r.multipleRestMeasures>0&&this.rules.RenderMultipleRestMeasures){r.isReducedToMultiRest=!0,r.multipleRestMeasureNumber=1;const i=r.multipleRestMeasures-1;a+=i;for(let n=1;n<=i;n++){const i=t.SourceMeasures[r.MeasureNumber-1+n];i.multipleRestMeasureNumber=n+1,i.isReducedToMultiRest=!0,e.push([void 0])}}}if(this.rules.AutoGenerateMutipleRestMeasuresFromRestMeasures&&this.rules.RenderMultipleRestMeasures){let r,a=0;for(let l=0,h=t.SourceMeasures.length;l<h;++l){const h=t.SourceMeasures[l];if(!h.isReducedToMultiRest&&h.canBeReducedToMultiRest())if(a>0){r.isReducedToMultiRest=!0,r.multipleRestMeasureNumber=1,a++,h.multipleRestMeasureNumber=a,h.isReducedToMultiRest=!0;for(let t=0;t<e[l].length;t++)e[l][t]=void 0}else r=h,a=1;else if(a>1){r.multipleRestMeasures=a;const t=this.createGraphicalMeasuresForSourceMeasure(r,i,s,o,n);e[r.measureListIndex]=t,a=0,r=void 0}else a=0,r=void 0}if(a>1){r.multipleRestMeasures=a,r.isReducedToMultiRest=!0;const t=this.createGraphicalMeasuresForSourceMeasure(r,i,s,o,n);e[r.measureListIndex]=t,a=0,r=void 0}}const l=n.map((t=>t.ClefType===a.ClefEnum.percussion));this.handleStaffEntries(l),this.calculateVerticalContainersList(),this.setIndicesToVerticalGraphicalContainers()}calculate(){this.musicSystems=[],this.clearSystemsAndMeasures(),this.clearRecreatedObjects(),this.createGraphicalTies(),this.calculateSheetLabelBoundingBoxes(),this.calculateXLayout(this.graphicalMusicSheet,this.maxInstrNameLabelLength()),this.graphicalMusicSheet.MusicPages.length=0,this.calculateMusicSystems(),s.GraphicalMusicSheet.transformRelativeToAbsolutePosition(this.graphicalMusicSheet)}calculateXLayout(t,e){if(this.graphicalMusicSheet.MeasureList.length>0){let t=this.graphicalMusicSheet.MeasureList[0],e=this.calculateMeasureXLayout(t);e=this.calculateMeasureWidthFromStaffEntries(t,e),F.setMeasuresMinStaffEntriesWidth(t,e);for(let i=1;i<this.graphicalMusicSheet.MeasureList.length;i++)t=this.graphicalMusicSheet.MeasureList[i],e=this.calculateMeasureXLayout(t),e=this.calculateMeasureWidthFromStaffEntries(t,e),F.setMeasuresMinStaffEntriesWidth(t,e)}}calculateMeasureWidthFromStaffEntries(t,e){throw new Error(this.abstractNotImplementedErrorMessage)}formatMeasures(){throw new Error(this.abstractNotImplementedErrorMessage)}calculateMeasureXLayout(t){throw new Error(this.abstractNotImplementedErrorMessage)}initGraphicalMeasuresCreation(){throw new Error(this.abstractNotImplementedErrorMessage)}handleBeam(t,e,i){throw new Error(this.abstractNotImplementedErrorMessage)}handleTiedGraphicalNote(t,e,i,n,s,r,o,a){throw new Error(this.abstractNotImplementedErrorMessage)}handleVoiceEntryLyrics(t,e,i){throw new Error(this.abstractNotImplementedErrorMessage)}handleVoiceEntryOrnaments(t,e,i){throw new Error(this.abstractNotImplementedErrorMessage)}handleVoiceEntryArticulations(t,e,i){throw new Error(this.abstractNotImplementedErrorMessage)}handleVoiceEntryTechnicalInstructions(t,e,i){throw new Error(this.abstractNotImplementedErrorMessage)}handleTuplet(t,e,i){throw new Error(this.abstractNotImplementedErrorMessage)}layoutVoiceEntry(t,e,i,n){throw new Error(this.abstractNotImplementedErrorMessage)}layoutStaffEntry(t){throw new Error(this.abstractNotImplementedErrorMessage)}createGraphicalTie(t,e,i,n,s){throw new Error(this.abstractNotImplementedErrorMessage)}updateStaffLineBorders(t){throw new Error(this.abstractNotImplementedErrorMessage)}calculateMeasureNumberPlacement(t){const e=t.StaffLines[0];if(!e||!e.Measures[0])return void x.default.warn("calculateMeasureNumberPlacement: measure undefined for system.Id "+t.Id);let i=e.Measures[0].MeasureNumber,n=0;for(let s=0;s<e.Measures.length;s++){if(this.rules.RenderMeasureNumbersOnlyAtSystemStart&&s>0)return;const r=e.Measures[s];0!==r.MeasureNumber&&1!==r.MeasureNumber||(i=r.MeasureNumber),n=r!==e.Measures[0]&&this.rules.MeasureNumberLabelXOffset?this.rules.MeasureNumberLabelXOffset:0;const o=this.rules.UseXMLMeasureNumbers&&1===r.MeasureNumber&&1!==r.parentSourceMeasure.getPrintedMeasureNumber();((r.MeasureNumber===i||r.MeasureNumber>=i+this.rules.MeasureNumberLabelOffset)&&!r.parentSourceMeasure.ImplicitMeasure||o)&&((1!==r.MeasureNumber||1===r.MeasureNumber&&r!==e.Measures[0]||o)&&this.calculateSingleMeasureNumberPlacement(r,e,t,n),i=r.MeasureNumber)}}calculateSingleMeasureNumberPlacement(t,e,i,n=0){const s=t.parentSourceMeasure.getPrintedMeasureNumber().toString(),r=new w.Label(s),o=new f.GraphicalLabel(r,this.rules.MeasureNumberLabelHeight,p.TextAlignmentEnum.LeftBottom,this.rules),a=e.SkyBottomLineCalculator;o.setLabelPositionAndShapeBorders(),o.PositionAndShape.Parent=i.PositionAndShape;const l=e.PositionAndShape.RelativePosition.x+t.PositionAndShape.RelativePosition.x-o.PositionAndShape.BorderMarginLeft+n;let h,c=l,d=l-o.PositionAndShape.BorderLeft+o.PositionAndShape.BorderRight;c-=e.PositionAndShape.RelativePosition.x,d-=e.PositionAndShape.RelativePosition.x;const m=c+.5,b=d-.5,g=a.getSkyLineMinInRange(m,b);if(t===e.Measures[0]){let t=0;if(i.GroupBrackets.length>0)for(const e of i.GroupBrackets)t=Math.min(t,e.PositionAndShape.BorderTop);h=Math.min(g,t)}else h=g;h=Math.min(0,h),o.PositionAndShape.RelativePosition=new u.PointF2D(l,h),a.updateSkyLineInRange(c,d,h+o.PositionAndShape.BorderMarginTop),i.MeasureNumberLabels.push(o)}layoutGraphicalTie(t,e,i){throw new Error(this.abstractNotImplementedErrorMessage)}calculateSingleStaffLineLyricsPosition(t,e){let i=0,n=this.rules.StaffHeight;const s=[],r=t.SkyBottomLineCalculator;let o=t.Measures.length;for(let l=0;l<o;++l){const e=t.Measures[l],o=e.PositionAndShape.RelativePosition,a=e.staffEntries.length;for(let t=0;t<a;++t){const a=e.staffEntries[t];if(a.LyricsEntries.length>0){s.push(a),i=Math.max(i,a.LyricsEntries.length);const t=a.PositionAndShape.RelativePosition.x+o.x;let e=Number.MAX_VALUE,l=Number.MIN_VALUE;for(let i=0;i<a.LyricsEntries.length;i++){const n=a.LyricsEntries[i].GraphicalLabel;e=Math.min(e,t+n.PositionAndShape.BorderMarginLeft),l=Math.max(l,t+n.PositionAndShape.BorderMarginRight)}const h=r.getBottomLineMaxInRange(e,l);n=Math.max(n,h)}}}let a=0;o=s.length;for(const l of s)for(let t=0;t<l.LyricsEntries.length;t++){const i=l.LyricsEntries[t],s=i.GraphicalLabel,r=i.LyricsEntry.VerseNumber,o=e.indexOf(r);let h=n+this.rules.LyricsHeight+this.rules.VerticalBetweenLyricsDistance+this.rules.LyricsYOffsetToStaffHeight+(this.rules.VerticalBetweenLyricsDistance+this.rules.LyricsHeight)*o;this.leadSheet&&(h=3.4+(this.rules.VerticalBetweenLyricsDistance+this.rules.LyricsHeight)*o);const c=s.PositionAndShape.RelativePosition.x;s.PositionAndShape.RelativePosition=new u.PointF2D(c,h),a=Math.max(a,h)}if(s.length>0){const e=t.PositionAndShape.Size.width;let i=s[0].PositionAndShape.RelativePosition.x+s[0].PositionAndShape.BorderMarginLeft+s[0].parentMeasure.PositionAndShape.RelativePosition.x;i=i>e?e:i,r.updateBottomLineInRange(i,e,a)}return s}calculateLyricsExtendsAndDashes(t){for(let e=0,i=t.length;e<i;++e){const i=t[e];for(let t=0;t<i.LyricsEntries.length;t++){const e=i.LyricsEntries[t];e.ParentLyricWord&&e.ParentLyricWord.GraphicalLyricsEntries[e.ParentLyricWord.GraphicalLyricsEntries.length-1]!==e&&this.calculateSingleLyricWord(e),e.LyricsEntry.extend&&this.calculateLyricExtend(e)}}}calculateSingleOctaveShift(t,e,i,n){throw new Error(this.abstractNotImplementedErrorMessage)}calculateWordRepetitionInstruction(t,e){throw new Error(this.abstractNotImplementedErrorMessage)}calculateMoodAndUnknownExpression(t,e,i){var n;const s=t.AbsoluteTimestamp,r=this.graphicalMusicSheet.MeasureList[e];let o=new u.PointF2D;if(t.MoodList.length>0||t.UnknownList.length>0){let e="";for(let i=0,n=t.EntriesList.length;i<n;++i){const n=t.EntriesList[i];""!==n.prefix&&(e+=""===e?n.prefix:" "+n.prefix),e+=""===e?n.label:" "+n.label}const a=r[i].ParentStaffLine;if(!a)return void x.default.debug("MusicSheetCalculator.calculateMoodAndUnknownExpression: staffLine undefined. Returning.");o=this.getRelativePositionInStaffLineFromTimestamp(s,i,a,null==a?void 0:a.isPartOfMultiStaffInstrument()),Math.abs(o.x-0)<1e-4&&(o.x=r[i].beginInstructionsWidth+this.rules.RhythmRightMargin);const l=this.rules.UnknownTextHeight,h=t.getPlacementOfFirstEntry(),c=this.calculateLabel(a,o,e,t.getFontstyleOfFirstEntry(),h,l),u=new N.GraphicalUnknownExpression(a,c,h,null===(n=r[i])||void 0===n?void 0:n.parentSourceMeasure,t);a.AbstractExpressions.push(u)}}clearRecreatedObjects(){for(let t=0,e=this.staffEntriesWithGraphicalTies.length;t<e;++t)this.staffEntriesWithGraphicalTies[t].GraphicalTies.length=0;this.staffEntriesWithGraphicalTies.length=0}handleStaffEntryLink(t,e){x.default.debug("handleStaffEntryLink not implemented")}calculateMusicSystems(){if(!this.graphicalMusicSheet.MeasureList)return;const t=this.graphicalMusicSheet.MeasureList;if(!t)return;this.rules.MinMeasureToDrawIndex>t.length-1&&(x.default.debug("minimum measure to draw index out of range. resetting min measure index to limit."),this.rules.MinMeasureToDrawIndex=t.length-1);const e=[];for(let s=this.rules.MinMeasureToDrawIndex,r=t.length;s<r&&s<=this.rules.MaxMeasureToDrawIndex;++s){const i=[];for(let e=0,n=t[s].length;e<n;++e){const n=t[s][e];if((null==n?void 0:n.isVisible())&&(i.push(n),this.rules.ColoringEnabled))for(const t of n.staffEntries)for(const e of t.graphicalVoiceEntries)e.color()}e.push(i)}let i=0;for(let s=0,r=e.length;s<r;++s){const t=e[s];i=Math.max(t.length,i);break}if(0===i)return;const n=new c.MusicSystemBuilder;if(n.initialize(this.graphicalMusicSheet,e,i),this.musicSystems=n.buildMusicSystems(),this.formatMeasures(),this.leadSheet||(this.optimizeRestPlacement(),this.calculateStaffEntryArticulationMarks(),this.rules.RenderSlurs&&this.calculateTieCurves()),this.calculateSkyBottomLines(),this.calculateTupletNumbers(),this.rules.RenderMeasureNumbers)for(let s=0,r=this.musicSystems.length;s<r;++s){const t=this.musicSystems[s];this.calculateMeasureNumberPlacement(t)}!this.leadSheet&&this.rules.RenderSlurs&&this.calculateSlurs(),this.leadSheet||this.calculateOrnaments(),this.calculateChordSymbols(),this.leadSheet||(this.calculateDynamicExpressions(),this.calculateMoodAndUnknownExpressions(),this.calculateExpressionAlignements(),this.calculateOctaveShifts(),this.calculateWordRepetitionInstructions()),this.calculateRepetitionEndings(),this.leadSheet||this.calculateTempoExpressions(),this.calculateRehearsalMarks(),this.calculateLyricsPosition();for(let s=0,r=this.musicSystems.length;s<r;++s){const t=this.musicSystems[s];for(let e=0,i=t.StaffLines.length;e<i;++e){const i=t.StaffLines[e];this.updateStaffLineBorders(i)}}n.calculateSystemYLayout(),this.calculateComments(),this.calculateMarkedAreas();for(let s=0,r=this.graphicalMusicSheet.MusicPages.length;s<r;++s){const t=this.graphicalMusicSheet.MusicPages[s];for(let i=0,n=t.MusicSystems.length;i<n;++i){const e=0===s&&0===i,n=t.MusicSystems[i];n.setMusicSystemLabelsYPosition(),this.leadSheet?n===n.Parent.MusicSystems[0]&&n.createSystemLeftLine(this.rules.SystemThinLineWidth,this.rules.SystemLabelsRightMargin,e):(n.setYPositionsToVerticalLineObjectsAndCreateLines(this.rules),n.createSystemLeftLine(this.rules.SystemThinLineWidth,this.rules.SystemLabelsRightMargin,e),n.createInstrumentBrackets(this.graphicalMusicSheet.ParentMusicSheet.Instruments,this.rules.StaffHeight),n.createGroupBrackets(this.graphicalMusicSheet.ParentMusicSheet.InstrumentalGroups,this.rules.StaffHeight,0),n.alignBeginInstructions()),n.calculateBorders(this.rules)}const e=t.MusicSystems[0].PositionAndShape.BorderTop;for(let i=0,n=t.MusicSystems.length;i<n;++i){const n=t.MusicSystems[i];n.PositionAndShape.RelativePosition=new u.PointF2D(n.PositionAndShape.RelativePosition.x,n.PositionAndShape.RelativePosition.y-e)}for(let i=0,n=t.MusicSystems.length;i<n;++i){const e=t.MusicSystems[i];for(let t=0,i=e.StaffLines.length;t<i;++t)e.StaffLines[t].addActivitySymbolClickArea()}t.PositionAndShape.calculateTopBottomBorders(),t===this.graphicalMusicSheet.MusicPages[0]&&this.calculatePageLabels(t),t.PositionAndShape.calculateTopBottomBorders()}}calculateMarkedAreas(){}calculateComments(){}calculateChordSymbols(){for(const t of this.musicSystems)for(const e of t.StaffLines){const t=e.SkyBottomLineCalculator;for(const i of e.Measures)for(const e of i.staffEntries)if(e.graphicalChordContainers&&0!==e.graphicalChordContainers.length)for(const i of e.graphicalChordContainers){const n=e.PositionAndShape,s=i.PositionAndShape,r=s.BorderMarginLeft+n.AbsolutePosition.x,o=s.BorderMarginRight+n.AbsolutePosition.x;t.updateSkyLineInRange(r,o,n.BorderMarginTop)}}}layoutMeasureWithWholeRest(t,e,i){}layoutBeams(t){}layoutArticulationMarks(t,e,i){}layoutOrnament(t,e,i){}calculateRestNotePlacementWithinGraphicalBeam(t,e,i,n,s){}calculateTupletNumbers(){}calculateSlurs(){}calculateDynamicExpressionsForMultiExpression(t,e,i){}calculateGraphicalVerbalContinuousDynamic(t,e){const i=t.Label,n=e.x+i.PositionAndShape.BorderMarginLeft,s=e.x+i.PositionAndShape.BorderMarginRight,r=t.ContinuousDynamic.Placement,o=t.ParentStaffLine.SkyBottomLineCalculator;let a;r===M.PlacementEnum.Below?(a=o.getBottomLineMaxInRange(n,s),i.PositionAndShape.RelativePosition=new u.PointF2D(e.x,a-i.PositionAndShape.BorderMarginTop)):(a=o.getSkyLineMinInRange(n,s),i.PositionAndShape.RelativePosition=new u.PointF2D(e.x,a-i.PositionAndShape.BorderMarginBottom))}calculateGraphicalContinuousDynamic(t,e){const i=t.ParentStaffLine.ParentStaff.idInMusicSheet,n=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(t.ContinuousDynamic.EndMultiExpression.SourceMeasureParent,i);if(!n)return void x.default.warn("MusicSheetCalculator.calculateGraphicalContinuousDynamic: No endMeasure found");t.EndMeasure=n;const s=t.ParentStaffLine,o=n.ParentStaffLine,a=o&&s===o;let l=!1;o?l=null==o?void 0:o.isPartOfMultiStaffInstrument():s&&(l=null==s?void 0:s.isPartOfMultiStaffInstrument());const h=r.Fraction.createFromFraction(t.ContinuousDynamic.EndMultiExpression.AbsoluteTimestamp),c=this.getRelativePositionInStaffLineFromTimestamp(h,i,o,l,0),u=s.ParentMusicSystem,d=u.StaffLines.indexOf(s),f=s.SkyBottomLineCalculator,p=t.ContinuousDynamic.Placement;let m;a&&c.x-e.x<this.rules.WedgeMinLength&&(c.x=e.x+this.rules.WedgeMinLength);const b=e.x,g=o.Measures[0].beginInstructionsWidth-this.rules.WedgeHorizontalMargin-2;let y=0,S=0;a?y=c.x:(y=s.PositionAndShape.Size.width,S=c.x,m=new I.GraphicalContinuousDynamicExpression(t.ContinuousDynamic,o,n.parentSourceMeasure),m.IsSplittedPart=!0,t.IsSplittedPart=!0);let v=0,E=0;if(p===M.PlacementEnum.Below){let t=0;if(d<u.StaffLines.length-1&&(t=d+1),t>d){const e=u.StaffLines[t].PositionAndShape.RelativePosition.y-s.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;v=this.rules.StaffHeight+e/2}else v=this.rules.WedgePlacementBelowY;v-=this.rules.WedgeOpeningLength/2,a||(E=v);let e=f.getBottomLineMaxInRange(b,y);if(e>v&&(v=e),d<u.StaffLines.length-1){const t=s.findClosestStaffEntry(y),e=s.findClosestStaffEntry(b);e&&t&&e.parentVerticalContainer}a||(e=o.SkyBottomLineCalculator.getBottomLineMaxInRange(g,S),e>E&&(E=e),E+=this.rules.WedgeOpeningLength/2,E+=this.rules.WedgeVerticalMargin),v+=this.rules.WedgeOpeningLength/2,v+=this.rules.WedgeVerticalMargin}else if(p===M.PlacementEnum.Above){if(1===s.ParentStaff.ParentInstrument.Staves.length)v=this.rules.WedgePlacementAboveY;else{let t=0;d>0&&(t=d-1);const e=u.StaffLines[t];v=-(s.PositionAndShape.RelativePosition.y-e.PositionAndShape.RelativePosition.y-this.rules.StaffHeight)/2}v+=this.rules.WedgeOpeningLength/2,a||(E=v);let t=f.getSkyLineMinInRange(b,y);if(t<v&&(v=t),s.ParentStaff.ParentInstrument.Staves.length>1&&d>0){const t=s.findClosestStaffEntry(b),e=s.findClosestStaffEntry(y);t&&e&&t.parentVerticalContainer}a||(t=o.SkyBottomLineCalculator.getSkyLineMinInRange(g,S),t<E&&(E=t),E-=this.rules.WedgeOpeningLength/2),v-=this.rules.WedgeOpeningLength/2,v-=this.rules.WedgeVerticalMargin,a||(E-=this.rules.WedgeVerticalMargin)}t.Lines.clear(),t.ContinuousDynamic.DynamicType===C.ContDynamicEnum.crescendo?a?(t.createCrescendoLines(b,y,v),t.calcPsi()):(t.createFirstHalfCrescendoLines(b,y,v),t.calcPsi(),m.createSecondHalfCrescendoLines(g,S,E),m.calcPsi()):t.ContinuousDynamic.DynamicType===C.ContDynamicEnum.diminuendo&&(a?(t.createDiminuendoLines(b,y,v),t.calcPsi()):(t.createFirstHalfDiminuendoLines(b,y,v),t.calcPsi(),m.createSecondHalfDiminuendoLines(g,S,E),m.calcPsi()))}calculateGraphicalInstantaneousDynamicExpression(t,e){const i=t.ParentStaffLine;if(!i)return;const n=e.x+t.PositionAndShape.BorderMarginLeft,s=e.x+t.PositionAndShape.BorderMarginRight,r=i.SkyBottomLineCalculator;let o=0;if(t.Placement===M.PlacementEnum.Above){const a=r.getSkyLineMinInRange(n,s);if(i.isPartOfMultiStaffInstrument()&&i.ParentStaff!==i.ParentStaff.ParentInstrument.Staves[0]){const e=i.ParentMusicSystem.StaffLines[i.ParentMusicSystem.StaffLines.indexOf(i)-1],n=i.PositionAndShape.RelativePosition.y-e.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;o=a>-n/2?-n/2:a-t.PositionAndShape.BorderMarginBottom}else o=a-t.PositionAndShape.BorderMarginBottom;t.PositionAndShape.RelativePosition=new u.PointF2D(e.x,o)}else if(t.Placement===M.PlacementEnum.Below){const a=r.getBottomLineMaxInRange(n,s),l=i.ParentStaff.ParentInstrument.Staves[i.ParentStaff.ParentInstrument.Staves.length-1];if(i.isPartOfMultiStaffInstrument()&&i.ParentStaff!==l){const e=i.ParentMusicSystem.StaffLines[i.ParentMusicSystem.StaffLines.indexOf(i)+1].PositionAndShape.RelativePosition.y-i.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;o=a+t.PositionAndShape.BorderMarginBottom<this.rules.StaffHeight+e/2?this.rules.StaffHeight+e/2:a-t.PositionAndShape.BorderMarginTop}else o=a-t.PositionAndShape.BorderMarginTop;t.PositionAndShape.RelativePosition=new u.PointF2D(e.x,o)}t.updateSkyBottomLine()}calcGraphicalRepetitionEndingsRecursively(t){}layoutSingleRepetitionEnding(t,e,i,n,s,r){}calculateLabel(t,e,i,n,s,r,o=p.TextAlignmentEnum.CenterBottom){const a=new w.Label(i,o);a.fontStyle=n,a.fontHeight=r;const l=new f.GraphicalLabel(a,r,a.textAlignment,this.rules,t.PositionAndShape);s===M.PlacementEnum.Below&&(l.Label.textAlignment=p.TextAlignmentEnum.LeftTop),l.setLabelPositionAndShapeBorders(),l.PositionAndShape.BorderMarginBottom*=1.1,l.PositionAndShape.BorderMarginTop*=1.1,l.PositionAndShape.BorderMarginLeft*=1.1,l.PositionAndShape.BorderMarginRight*=1.1;let h,c=e.x+l.PositionAndShape.BorderMarginLeft,d=e.x+l.PositionAndShape.BorderMarginRight;d>t.PositionAndShape.Size.width&&(d=t.PositionAndShape.Size.width-this.rules.MeasureRightMargin,c=d-l.PositionAndShape.MarginSize.width,e.x=c-l.PositionAndShape.BorderMarginLeft);const m=t.SkyBottomLineCalculator;return h=s===M.PlacementEnum.Below?m.getBottomLineMaxInRange(c,d):m.getSkyLineMinInRange(c,d),l.PositionAndShape.RelativePosition=new u.PointF2D(e.x,h),s===M.PlacementEnum.Below?m.updateBottomLineInRange(c,d,l.PositionAndShape.BorderMarginBottom+h):m.updateSkyLineInRange(c,d,l.PositionAndShape.BorderMarginTop+h),l}calculateTempoExpressionsForMultiTempoExpression(t,e,i){const n=r.Fraction.plus(t.AbsoluteTimestamp,e.Timestamp),s=this.graphicalMusicSheet.MeasureList[i];let o=new u.PointF2D;if(e.ContinuousTempo||e.InstantaneousTempo){if(this.rules.MinMeasureToDrawIndex>0)return;if(!s[0])return;let t=s[0].ParentStaffLine,i=s[0].PositionAndShape.RelativePosition.x,r=0;for(let e=0;e<s.length;e++)if(s[e].ParentStaffLine&&0!==s[e].ParentStaffLine.Measures.length&&s[e].ParentStaffLine.Measures.length>0){t=s[e].ParentStaffLine,i=s[e].PositionAndShape.RelativePosition.x,r=e;break}if(o=this.getRelativePositionInStaffLineFromTimestamp(n,r,t,t.isPartOfMultiStaffInstrument(),i),e.EntriesList.length>0&&e.EntriesList[0].Expression instanceof L.InstantaneousTempoExpression&&(e.EntriesList[0].Expression.Placement=M.PlacementEnum.Above,t.Measures[0].staffEntries.length>0&&0===Math.abs(o.x-t.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x)&&t.ParentMusicSystem===this.musicSystems[0])){const e=t.Measures[0].FirstInstructionStaffEntry;if(e){const t=e.GraphicalInstructions.last();o.x=t.PositionAndShape.RelativePosition.x}this.rules.CompactMode&&(o.x=t.PositionAndShape.RelativePosition.x+t.Measures[0].PositionAndShape.RelativePosition.x)}for(const n of e.EntriesList){let i=p.TextAlignmentEnum.CenterBottom;this.rules.CompactMode&&(i=p.TextAlignmentEnum.LeftBottom);const s=this.calculateLabel(t,o,n.label,e.getFontstyleOfFirstEntry(),n.Expression.Placement,this.rules.UnknownTextHeight,i);if(n.Expression instanceof L.InstantaneousTempoExpression){for(const e of t.AbstractExpressions)e instanceof P.GraphicalInstantaneousTempoExpression&&(e.SourceExpression.Label,n.Expression.Label);if(new P.GraphicalInstantaneousTempoExpression(n.Expression,s).ParentStaffLine||x.default.warn("Adding staffline didn't work"),this.rules.MetronomeMarksDrawn&&n.Expression.Enum===L.TempoEnum.metronomeMark){this.createMetronomeMark(n.Expression);continue}}else n.Expression,A.ContinuousTempoExpression}}}createMetronomeMark(t){throw new Error(this.abstractNotImplementedErrorMessage)}graphicalMeasureCreatedCalculations(t){}clearSystemsAndMeasures(){for(let t=0,e=this.graphicalMusicSheet.MusicPages.length;t<e;++t){const e=this.graphicalMusicSheet.MusicPages[t];for(let t=0,i=e.MusicSystems.length;t<i;++t){const i=e.MusicSystems[t];for(let t=0,e=i.StaffLines.length;t<e;++t){const e=i.StaffLines[t];for(let t=0,i=e.Measures.length;t<i;++t){const i=e.Measures[t];if(i.FirstInstructionStaffEntry){const t=i.PositionAndShape.ChildElements.indexOf(i.FirstInstructionStaffEntry.PositionAndShape);t>-1&&i.PositionAndShape.ChildElements.splice(t,1),i.FirstInstructionStaffEntry=void 0,i.beginInstructionsWidth=0}if(i.LastInstructionStaffEntry){const t=i.PositionAndShape.ChildElements.indexOf(i.LastInstructionStaffEntry.PositionAndShape);t>-1&&i.PositionAndShape.ChildElements.splice(t,1),i.LastInstructionStaffEntry=void 0,i.endInstructionsWidth=0}}e.Measures=[],e.PositionAndShape.ChildElements=[]}i.StaffLines.length=0,i.PositionAndShape.ChildElements=[]}e.MusicSystems=[],e.PositionAndShape.ChildElements=[]}this.graphicalMusicSheet.MusicPages=[]}handleVoiceEntry(t,e,i,n,s,r,o,a,l,c,u){t.StemDirectionXml!==h.StemDirectionType.Undefined&&this.rules.SetWantedStemDirectionByXml&&void 0!==t.StemDirectionXml?t.WantedStemDirection=t.StemDirectionXml:this.calculateStemDirectionFromVoices(t);const d=e.findOrCreateGraphicalVoiceEntry(t);d.octaveShiftValue=a;const f=e.tabStaffEntry;let p;f&&(p=f.findOrCreateGraphicalVoiceEntry(t));for(let h=0,m=t.Notes.length;h<m;++h){const n=t.Notes[h];if(!n)continue;if(void 0!==u&&void 0!==u.Link&&void 0!==c&&c.indexOf(n)>-1)continue;let l;if(t.IsGrace?l=F.symbolFactory.createGraceNote(n,d,s,this.rules,a):(l=F.symbolFactory.createNote(n,d,s,a,this.rules,void 0),F.stafflineNoteCalculator.trackNote(l)),n.Pitch&&this.checkNoteForAccidental(l,i,s,a),this.resetYPositionForLeadSheet(l.PositionAndShape),e.addGraphicalNoteToListAtCorrectYPosition(d,l),l.PositionAndShape.calculateBoundingBox(),this.leadSheet||(void 0!==n.NoteBeam&&n.PrintObject&&this.handleBeam(l,n.NoteBeam,o),void 0!==n.NoteTuplet&&n.PrintObject&&this.handleTuplet(l,n.NoteTuplet,r)),p){const t=F.symbolFactory.createNote(n,p,s,a,this.rules,void 0);f.addGraphicalNoteToListAtCorrectYPosition(p,t),t.PositionAndShape.calculateBoundingBox(),this.leadSheet||n.NoteTuplet&&this.handleTuplet(t,n.NoteTuplet,r)}}return t.Articulations.length>0&&this.handleVoiceEntryArticulations(t.Articulations,t,e),t.TechnicalInstructions.length>0&&this.handleVoiceEntryTechnicalInstructions(t.TechnicalInstructions,t,e),t.LyricsEntries.size()>0&&this.handleVoiceEntryLyrics(t,e,n),t.OrnamentContainer&&this.handleVoiceEntryOrnaments(t.OrnamentContainer,t,e),a}resetYPositionForLeadSheet(t){this.leadSheet&&(t.RelativePosition=new u.PointF2D(t.RelativePosition.x,0))}layoutVoiceEntries(t,e){if(t.PositionAndShape.RelativePosition=new u.PointF2D(0,0),!this.leadSheet)for(const i of t.graphicalVoiceEntries){const e=i.notes;if(0===e.length)continue;const n=e[0].sourceNote.ParentVoiceEntry,s=void 0!==e[0].sourceNote.Pitch;this.layoutVoiceEntry(n,e,t,s)}}maxInstrNameLabelLength(){var t;let e=0;for(const i of this.graphicalMusicSheet.ParentMusicSheet.Instruments)if((null===(t=i.NameLabel)||void 0===t?void 0:t.print)&&i.Voices.length>0&&i.Voices[0].Visible){let t=i.NameLabel;this.rules.RenderPartNames||(t=new w.Label("",t.textAlignment,t.font));const n=new f.GraphicalLabel(t,this.rules.InstrumentLabelTextHeight,p.TextAlignmentEnum.LeftCenter,this.rules);n.setLabelPositionAndShapeBorders(),e=Math.max(e,n.PositionAndShape.MarginSize.width)}return this.rules.RenderPartNames?e:0}calculateSheetLabelBoundingBoxes(){const t=this.graphicalMusicSheet.ParentMusicSheet,e=this.rules.DefaultColorTitle;if(void 0!==t.Title&&this.rules.RenderTitle){const i=new f.GraphicalLabel(t.Title,this.rules.SheetTitleHeight,p.TextAlignmentEnum.CenterBottom,this.rules);i.Label.IsCreditLabel=!0,i.Label.colorDefault=e,this.graphicalMusicSheet.Title=i,i.setLabelPositionAndShapeBorders()}else this.rules.RenderTitle||(this.graphicalMusicSheet.Title=void 0);if(void 0!==t.Subtitle&&this.rules.RenderSubtitle){const i=new f.GraphicalLabel(t.Subtitle,this.rules.SheetSubtitleHeight,p.TextAlignmentEnum.CenterCenter,this.rules);i.Label.IsCreditLabel=!0,i.Label.colorDefault=e,this.graphicalMusicSheet.Subtitle=i,i.setLabelPositionAndShapeBorders()}else this.rules.RenderSubtitle||(this.graphicalMusicSheet.Subtitle=void 0);if(void 0!==t.Composer&&this.rules.RenderComposer){const i=new f.GraphicalLabel(t.Composer,this.rules.SheetComposerHeight,p.TextAlignmentEnum.RightCenter,this.rules);i.Label.IsCreditLabel=!0,i.Label.colorDefault=e,this.graphicalMusicSheet.Composer=i,i.setLabelPositionAndShapeBorders()}else this.rules.RenderComposer||(this.graphicalMusicSheet.Composer=void 0);if(void 0!==t.Lyricist&&this.rules.RenderLyricist){const i=new f.GraphicalLabel(t.Lyricist,this.rules.SheetAuthorHeight,p.TextAlignmentEnum.LeftCenter,this.rules);i.Label.IsCreditLabel=!0,i.Label.colorDefault=e,this.graphicalMusicSheet.Lyricist=i,i.setLabelPositionAndShapeBorders()}else this.rules.RenderLyricist||(this.graphicalMusicSheet.Lyricist=void 0)}checkMeasuresForWholeRestNotes(){for(let t=0,e=this.musicSystems.length;t<e;++t){const e=this.musicSystems[t];for(let t=0,i=e.StaffLines.length;t<i;++t){const i=e.StaffLines[t];for(let t=0,e=i.Measures.length;t<e;++t){const e=i.Measures[t];if(1===e.staffEntries.length){const t=e.staffEntries[0];if(t.graphicalVoiceEntries.length>0&&1===t.graphicalVoiceEntries[0].notes.length){const i=t.graphicalVoiceEntries[0].notes[0];!i.sourceNote.Pitch&&new r.Fraction(1,2).lt(i.sourceNote.Length)&&this.layoutMeasureWithWholeRest(i,t,e)}}}}}}optimizeRestNotePlacement(t,e){if(0===t.graphicalVoiceEntries.length)return;const i=t.graphicalVoiceEntries[0].notes;if(0===i.length)return;const n=i[0],s=n.sourceNote.isRest();if(2===t.graphicalVoiceEntries.length){let e=!1;const i=t.graphicalVoiceEntries[1].notes;i.length>0&&(e=i[0].sourceNote.isRest()),s&&e?this.calculateTwoRestNotesPlacementWithCollisionDetection(t):(s||e)&&this.calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(t)}else if(s&&t!==e.staffEntries[0]&&t!==e.staffEntries[e.staffEntries.length-1]){const i=e.staffEntries.indexOf(t),s=e.staffEntries[i-1],r=e.staffEntries[i+1];if(1===s.graphicalVoiceEntries.length){const e=s.graphicalVoiceEntries[0].notes[0];if(void 0!==e.sourceNote.NoteBeam&&1===r.graphicalVoiceEntries.length){const i=r.graphicalVoiceEntries[0].notes[0];void 0!==i.sourceNote.NoteBeam&&e.sourceNote.NoteBeam===i.sourceNote.NoteBeam&&(this.calculateRestNotePlacementWithinGraphicalBeam(t,n,e,r,i),t.PositionAndShape.calculateBoundingBox())}}}}getRelativePositionInStaffLineFromTimestamp(t,e,i,n,s=0){let o,a,l=new u.PointF2D;const h=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,c=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(t),d=Math.min(Math.floor(c),h-1),f=Math.min(Math.ceil(c),h-1);if(d<0||e<0)return l;if(o=this.getFirstLeftNotNullStaffEntryFromContainer(d,e,n),a=this.getFirstRightNotNullStaffEntryFromContainer(f,e,n),o&&a){let e=o.parentMeasure.PositionAndShape.RelativePosition.x;s>0&&(e=s);let n=o.PositionAndShape.RelativePosition.x+e,h=a.PositionAndShape.RelativePosition.x+a.parentMeasure.PositionAndShape.RelativePosition.x;s>0&&(h=a.PositionAndShape.RelativePosition.x+e);let c=0;if(o!==a){const e=o.getAbsoluteTimestamp(),i=a.getAbsoluteTimestamp();c=r.Fraction.minus(t,e).RealValue/r.Fraction.minus(i,e).RealValue}o.parentMeasure.ParentStaffLine!==a.parentMeasure.ParentStaffLine&&(o.parentMeasure.ParentStaffLine===i?h=i.PositionAndShape.Size.width:n=i.PositionAndShape.RelativePosition.x),l=new u.PointF2D(n+(h-n)*c,0)}return l}getRelativeXPositionFromTimestamp(t){const e=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,i=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(t),n=Math.max(0,Math.min(Math.round(i),e-1)),s=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[n].getFirstNonNullStaffEntry();return s.PositionAndShape.RelativePosition.x+s.parentMeasure.PositionAndShape.RelativePosition.x}calculatePageLabels(t){var e;this.rules.RenderSingleHorizontalStaffline&&(t.PositionAndShape.BorderRight=t.PositionAndShape.Size.width,t.PositionAndShape.calculateBoundingBox(),this.graphicalMusicSheet.ParentMusicSheet.pageWidth=t.PositionAndShape.Size.width);let i=10;if(t.MusicSystems.length>0){const e=t.MusicSystems[0];i=e.PositionAndShape.RelativePosition.y+e.PositionAndShape.BorderTop}if(this.graphicalMusicSheet.Title){const e=this.graphicalMusicSheet.Title;e.PositionAndShape.Parent=t.PositionAndShape;const i=new u.PointF2D;i.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,i.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight,e.PositionAndShape.RelativePosition=i,t.Labels.push(e)}if(this.graphicalMusicSheet.Subtitle){const e=this.graphicalMusicSheet.Subtitle;e.PositionAndShape.Parent=t.PositionAndShape;const i=new u.PointF2D;i.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,i.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight+this.rules.SheetMinimumDistanceBetweenTitleAndSubtitle,e.PositionAndShape.RelativePosition=i,t.Labels.push(e)}const n=this.graphicalMusicSheet.Composer;let s;if(n){n.PositionAndShape.Parent=t.PositionAndShape,n.setLabelPositionAndShapeBorders();const r=new u.PointF2D;r.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth-this.rules.PageRightMargin,r.y=i,r.y-=this.rules.SystemComposerDistance;const o=null===(e=n.TextLines)||void 0===e?void 0:e.length;o>1&&(r.y-=n.PositionAndShape.BorderBottom*(o-1)/o),s=r.y,n.PositionAndShape.RelativePosition=r,t.Labels.push(n)}const r=this.graphicalMusicSheet.Lyricist;if(r){r.PositionAndShape.Parent=t.PositionAndShape,r.setLabelPositionAndShapeBorders();const e=new u.PointF2D;e.x=this.rules.PageLeftMargin,e.y=i,e.y+=r.PositionAndShape.BorderBottom,e.y=Math.min(e.y,s),r.PositionAndShape.RelativePosition=e,t.Labels.push(r)}}createGraphicalTies(){for(let t=0;t<this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length;t++){const e=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[t];for(let i=0;i<e.CompleteNumberOfStaves;i++)for(let n=0;n<e.VerticalSourceStaffEntryContainers.length;n++){const s=e.VerticalSourceStaffEntryContainers[n].StaffEntries[i];if(s){const e=this.graphicalMusicSheet.findGraphicalStaffEntryFromMeasureList(i,t,s);for(let n=0,r=s.VoiceEntries.length;n<r;++n){const r=s.VoiceEntries[n];for(let n=0,s=r.Notes.length;n<s;++n){const s=r.Notes[n];if(s.NoteTie){const n=s.NoteTie;this.handleTie(n,e,i,t)}}}}}}}handleTie(t,e,i,n){if(!e)return;let s,r,o,a=e;for(let l=1;l<t.Notes.length;l++)if(s=a.findTieGraphicalNoteFromNote(t.Notes[l-1]),r=this.graphicalMusicSheet.GetGraphicalFromSourceStaffEntry(t.Notes[l].ParentStaffEntry),r){if(o=r.findTieGraphicalNoteFromNote(t.Notes[l]),void 0!==s&&void 0!==o&&r){if(!s.sourceNote.PrintObject||!o.sourceNote.PrintObject)continue;const e=this.createGraphicalTie(t,a,r,s,o);a.GraphicalTies.push(e),this.staffEntriesWithGraphicalTies.indexOf(a)>=0&&this.staffEntriesWithGraphicalTies.push(a)}a=r}}createAccidentalCalculators(){const t=[],e=this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();if(e)for(let i=0;i<e.CompleteNumberOfStaves;i++){const n=new S.AccidentalCalculator;if(t.push(n),e.FirstInstructionsStaffEntries[i])for(let t=0,s=e.FirstInstructionsStaffEntries[i].Instructions.length;t<s;++t){const s=e.FirstInstructionsStaffEntries[i].Instructions[t];if(s instanceof m.KeyInstruction){const t=s;n.ActiveKeyInstruction=t}}}return t}calculateVerticalContainersList(){const t=this.graphicalMusicSheet.MeasureList[0].length;for(let e=0;e<this.graphicalMusicSheet.MeasureList.length;e++)for(let i=0;i<t;i++){const t=this.graphicalMusicSheet.MeasureList[e][i];if(t)for(let e=0,n=t.staffEntries.length;e<n;++e){const n=t.staffEntries[e],s=this.graphicalMusicSheet.getOrCreateVerticalContainer(n.getAbsoluteTimestamp());s&&(s.StaffEntries[i]=n,n.parentVerticalContainer=s)}}}setIndicesToVerticalGraphicalContainers(){for(let t=0;t<this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length;t++)this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[t].Index=t}createGraphicalMeasuresForSourceMeasure(t,e,i,n,s){this.initGraphicalMeasuresCreation();const r=[],o=[],a=[],l=[];let h=!0;for(let c=0;c<t.CompleteNumberOfStaves;c++){const u=this.createGraphicalMeasure(t,a,o,e[c],s,n,i,c,l);h=h&&u.hasOnlyRests,r.push(u)}return t.allRests=h,t.VerticalMeasureList=r,r}createGraphicalMeasure(t,e,i,n,s,c,u,f,p){var b,g;const S=this.graphicalMusicSheet.ParentMusicSheet.getStaffFromIndex(f);let x;if(s[f].ClefType===a.ClefEnum.TAB)S.isTab=!0,x=F.symbolFactory.createTabStaffMeasure(t,S);else if(t.multipleRestMeasures&&this.rules.RenderMultipleRestMeasures)x=F.symbolFactory.createMultiRestMeasure(t,S);else{if(t.multipleRestMeasureNumber>1)return;x=F.symbolFactory.createGraphicalMeasure(t,S)}if(x.hasError=t.getErrorInMeasure(f),t.FirstInstructionsStaffEntries[f])for(let r=0,o=t.FirstInstructionsStaffEntries[f].Instructions.length;r<o;++r){const e=t.FirstInstructionsStaffEntries[f].Instructions[r];if(e instanceof m.KeyInstruction){const t=m.KeyInstruction.copy(e);0!==this.graphicalMusicSheet.ParentMusicSheet.Transpose&&x.ParentStaff.ParentInstrument.MidiInstrumentId!==v.MidiInstrument.Percussion&&F.transposeCalculator&&F.transposeCalculator.transposeKey(t,this.graphicalMusicSheet.ParentMusicSheet.Transpose),n.ActiveKeyInstruction=t}}for(let o=0,a=t.StaffLinkedExpressions[f].length;o<a;++o){const e=t.StaffLinkedExpressions[f][o];if(e.OctaveShiftStart){const i=e.OctaveShiftStart;let n=null===(b=null==i?void 0:i.ParentEndMultiExpression)||void 0===b?void 0:b.AbsoluteTimestamp;(null==i?void 0:i.ParentEndMultiExpression)||(n=r.Fraction.plus(t.AbsoluteTimestamp,t.Duration)),c[f]=new y.OctaveShiftParams(i,null==e?void 0:e.AbsoluteTimestamp,n)}}for(let r=0;r<t.VerticalSourceStaffEntryContainers.length;r++){const o=t.VerticalSourceStaffEntryContainers[r].StaffEntries[f];if(o){for(let e=0,i=o.Instructions.length;e<i;++e){const t=o.Instructions[e];t instanceof a.ClefInstruction&&(s[f]=t)}const t=F.symbolFactory.createStaffEntry(o,x);r<x.staffEntries.length?x.addGraphicalStaffEntryAtTimestamp(t):x.addGraphicalStaffEntry(t);const h=[];o.Link&&(o.findLinkedNotes(h),this.handleStaffEntryLink(t,p));let d=l.OctaveEnum.NONE;c[f]&&c[f].getAbsoluteStartTimestamp.lte(o.AbsoluteTimestamp)&&o.AbsoluteTimestamp.lte(c[f].getAbsoluteEndTimestamp)&&(d=c[f].getOpenOctaveShift.Type);for(let r=0,a=o.VoiceEntries.length;r<a;++r){const a=o.VoiceEntries[r];d=this.handleVoiceEntry(a,t,n,u,s[f],e,i,d,f,h,o)}if(o.Instructions.length>0){const e=o.Instructions[0];F.symbolFactory.createInStaffClef(t,e)}this.rules.RenderChordSymbols&&(null===(g=o.ChordContainers)||void 0===g?void 0:g.length)>0&&(o.ParentStaff.ParentInstrument.HasChordSymbols=!0,F.symbolFactory.createChordSymbols(o,t,n.ActiveKeyInstruction,this.graphicalMusicSheet.ParentMusicSheet.Transpose))}}if(n.doCalculationsAtEndOfMeasure(),t.LastInstructionsStaffEntries[f]){const e=t.LastInstructionsStaffEntries[f];for(let t=0,i=e.Instructions.length;t<i;++t){const i=e.Instructions[t];i instanceof a.ClefInstruction&&(s[f]=i)}}for(let r=0,o=t.StaffLinkedExpressions[f].length;r<o;++r){const e=t.StaffLinkedExpressions[f][r];void 0!==e.OctaveShiftEnd&&void 0!==c[f]&&e.OctaveShiftEnd===c[f].getOpenOctaveShift&&(c[f]=void 0)}for(const r of x.staffEntries)for(const t of r.graphicalVoiceEntries)this.setBeamNotesWantedStemDirections(t.parentVoiceEntry);if(this.rules.FillEmptyMeasuresWithWholeRest>=1&&0===x.staffEntries.length){const e=new d.SourceStaffEntry(new T.VerticalSourceStaffEntryContainer(x.parentSourceMeasure,x.parentSourceMeasure.AbsoluteTimestamp,x.parentSourceMeasure.CompleteNumberOfStaves),S),i=new h.VoiceEntry(new r.Fraction(0,1),S.Voices[0],e),n=new o.Note(i,e,r.Fraction.createFromFraction(t.Duration),void 0,t);n.PrintObject=this.rules.FillEmptyMeasuresWithWholeRest===R.FillEmptyMeasuresWithWholeRests.YesVisible,i.Notes.push(n);const s=F.symbolFactory.createStaffEntry(e,x);x.addGraphicalStaffEntry(s),s.relInMeasureTimestamp=i.Timestamp;const c=F.symbolFactory.createVoiceEntry(i,s);s.graphicalVoiceEntries.push(c);const u=F.symbolFactory.createNote(n,c,new a.ClefInstruction,l.OctaveEnum.NONE,void 0);F.stafflineNoteCalculator.trackNote(u),c.notes.push(u)}x.hasOnlyRests=!0;for(const r of x.staffEntries)if(x.hasOnlyRests=r.hasOnlyRests(),!x.hasOnlyRests)break;return x}checkNoteForAccidental(t,e,i,n){let s=t.sourceNote.Pitch;const r=this.graphicalMusicSheet.ParentMusicSheet.Transpose;0!==r&&t.sourceNote.ParentStaffEntry.ParentStaff.ParentInstrument.MidiInstrumentId!==v.MidiInstrument.Percussion&&(s=t.Transpose(e.ActiveKeyInstruction,i,r,n)),t.sourceNote.halfTone=s.getHalfTone(),e.checkAccidental(t,s)}handleStaffEntries(t){for(let e=0,i=this.graphicalMusicSheet.MeasureList.length;e<i;++e){const i=this.graphicalMusicSheet.MeasureList[e];for(let e=0,n=i.length;e<n;++e){const n=i[e];if(n){void 0!==this.rules.PercussionOneLineCutoff&&0!==this.rules.PercussionOneLineCutoff&&t[e]&&(-1===this.rules.PercussionOneLineCutoff||F.stafflineNoteCalculator.getStafflineUniquePositionCount(e)<this.rules.PercussionOneLineCutoff)&&(n.ParentStaff.StafflineCount=1);for(const t of n.staffEntries)void 0!==t.parentMeasure&&t.graphicalVoiceEntries.length>0&&t.graphicalVoiceEntries[0].notes.length>0&&(this.layoutVoiceEntries(t,e),this.layoutStaffEntry(t));this.graphicalMeasureCreatedCalculations(n)}}}}calculateSkyBottomLines(){for(const t of this.musicSystems)for(const e of t.StaffLines)e.SkyBottomLineCalculator.calculateLines()}calculateExpressionAlignements(){}calculateStaffEntryArticulationMarks(){for(let t=0,e=this.musicSystems.length;t<e;++t){const e=this.musicSystems[t];for(let t=0,i=e.StaffLines.length;t<i;++t){const i=e.StaffLines[t];for(let t=0,e=i.Measures.length;t<e;++t){const e=i.Measures[t];for(let t=0,i=e.staffEntries.length;t<i;++t){const i=e.staffEntries[t];for(let t=0,e=i.sourceStaffEntry.VoiceEntries.length;t<e;++t){const e=i.sourceStaffEntry.VoiceEntries[t];e.Articulations.length>0&&this.layoutArticulationMarks(e.Articulations,e,i)}}}}}}calculateOrnaments(){for(let t=0,e=this.musicSystems.length;t<e;++t){const e=this.musicSystems[t];for(let t=0,i=e.StaffLines.length;t<i;++t){const i=e.StaffLines[t];for(let t=0,e=i.Measures.length;t<e;++t){const e=i.Measures[t];for(let t=0,i=e.staffEntries.length;t<i;++t){const i=e.staffEntries[t];for(let t=0,e=i.sourceStaffEntry.VoiceEntries.length;t<e;++t){const e=i.sourceStaffEntry.VoiceEntries[t];if(e.OrnamentContainer){if(e.hasTie()&&!i.relInMeasureTimestamp.Equals(e.Timestamp))continue;this.layoutOrnament(e.OrnamentContainer,e,i),-1===this.staffEntriesWithOrnaments.indexOf(i)&&this.staffEntriesWithOrnaments.push(i)}}}}}}}optimizeRestPlacement(){for(let t=0,e=this.musicSystems.length;t<e;++t){const e=this.musicSystems[t];for(let t=0,i=e.StaffLines.length;t<i;++t){const i=e.StaffLines[t];for(let t=0,e=i.Measures.length;t<e;++t){const e=i.Measures[t];for(let t=0,i=e.staffEntries.length;t<i;++t){const i=e.staffEntries[t];this.optimizeRestNotePlacement(i,e)}}}}}calculateTwoRestNotesPlacementWithCollisionDetection(t){const e=t.graphicalVoiceEntries[0].notes[0],i=t.graphicalVoiceEntries[1].notes[0];i.PositionAndShape.RelativePosition=new u.PointF2D(0,2.5),t.PositionAndShape.calculateAbsolutePositionsRecursiveWithoutTopelement(),e.PositionAndShape.computeNonOverlappingPositionWithMargin(t.PositionAndShape,g.ColDirEnum.Up,new u.PointF2D(0,i.PositionAndShape.RelativePosition.y));const n=e.PositionAndShape.RelativePosition;n.y-=1,e.PositionAndShape.RelativePosition=n,t.PositionAndShape.calculateBoundingBox()}calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(t){let e,i;t.graphicalVoiceEntries[0].notes[0].sourceNote.isRest()?(e=t.graphicalVoiceEntries[0].notes[0],i=t.graphicalVoiceEntries[1].notes):(i=t.graphicalVoiceEntries[0].notes,e=t.graphicalVoiceEntries[1].notes[0]);let n=!1;t.PositionAndShape.calculateAbsolutePositionsRecursiveWithoutTopelement();for(let s=0,r=i.length;s<r;++s){const t=i[s];if(e.PositionAndShape.marginCollisionDetection(t.PositionAndShape)){n=!0;break}}if(n)if(e.sourceNote.ParentVoiceEntry.ParentVoice instanceof b.LinkedVoice){const t=i[0].PositionAndShape.BorderMarginBottom+i[0].PositionAndShape.RelativePosition.y;e.PositionAndShape.RelativePosition=new u.PointF2D(0,t-e.PositionAndShape.BorderMarginTop+.5)}else{const t=i[i.length-1],n=t.PositionAndShape.BorderMarginTop+t.PositionAndShape.RelativePosition.y;if(i[0].sourceNote.ParentVoiceEntry.ParentVoice instanceof b.LinkedVoice)e.PositionAndShape.RelativePosition=new u.PointF2D(0,n-e.PositionAndShape.BorderMarginBottom-.5);else{const t=i[0].PositionAndShape.BorderMarginBottom+i[0].PositionAndShape.RelativePosition.y;e.PositionAndShape.RelativePosition=t<2?new u.PointF2D(0,t-e.PositionAndShape.BorderMarginTop+.5):new u.PointF2D(0,n-e.PositionAndShape.BorderMarginBottom-0)}}t.PositionAndShape.calculateBoundingBox()}calculateTieCurves(){for(const t of this.musicSystems)for(const e of t.StaffLines)for(const t of e.Measures)for(const e of t.staffEntries)for(const i of e.GraphicalTies)if(void 0!==i.StartNote&&i.StartNote.parentVoiceEntry.parentStaffEntry===e){const e=i.StartNote.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentStaffLine!==i.EndNote.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentStaffLine;this.layoutGraphicalTie(i,e,t.ParentStaff.isTab)}}calculateLyricsPosition(){const t=new E.Dictionary;for(let e=0,i=this.graphicalMusicSheet.ParentMusicSheet.Instruments.length;e<i;++e){const t=this.graphicalMusicSheet.ParentMusicSheet.Instruments[e];t.HasLyrics&&t.LyricVersesNumbers.length>0&&t.LyricVersesNumbers.sort()}for(let e=0,i=this.musicSystems.length;e<i;++e){const i=this.musicSystems[e];for(let e=0,n=i.StaffLines.length;e<n;++e){const n=i.StaffLines[e],s=this.calculateSingleStaffLineLyricsPosition(n,n.ParentStaff.ParentInstrument.LyricVersesNumbers);t.setValue(n,s),this.calculateLyricsExtendsAndDashes(t.getValue(n))}}for(let e=0,i=this.musicSystems.length;e<i;++e){const i=this.musicSystems[e];for(let e=0,n=i.StaffLines.length;e<n;++e){const n=i.StaffLines[e];this.calculateLyricsExtendsAndDashes(t.getValue(n))}}}calculateSingleLyricWord(t){const e=t.ParentLyricWord,i=e.GraphicalLyricsEntries.indexOf(t);let n;if(i>=0&&(n=e.GraphicalLyricsEntries[i+1]),!n)return;const s=t.StaffEntryParent.parentMeasure.ParentStaffLine,r=n.StaffEntryParent.parentMeasure.ParentStaffLine,o=t.StaffEntryParent,a=n.StaffEntryParent;if(t.StaffEntryParent.parentMeasure.ParentStaffLine===n.StaffEntryParent.parentMeasure.ParentStaffLine){const e=o.parentMeasure.PositionAndShape.RelativePosition.x+o.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.BorderMarginRight,i=a.parentMeasure.PositionAndShape.RelativePosition.x+a.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.RelativePosition.x+n.GraphicalLabel.PositionAndShape.BorderMarginLeft,r=t.GraphicalLabel.PositionAndShape.RelativePosition.y;let l=1;i-e>3*this.rules.MinimumDistanceBetweenDashes&&(l=Math.floor((i-e)/this.rules.MinimumDistanceBetweenDashes)-1),1===l?this.calculateSingleDashForLyricWord(s,e,i,r):this.calculateDashes(s,e,i,r)}else{const e=o.parentMeasure.PositionAndShape.RelativePosition.x+o.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.BorderMarginRight,i=s.Measures[s.Measures.length-1],l=i.PositionAndShape.RelativePosition.x+i.PositionAndShape.Size.width;let h=t.GraphicalLabel.PositionAndShape.RelativePosition.y;if(this.calculateDashes(s,e,l,h),r&&r.Measures[0]&&a.parentMeasure.ParentStaffLine&&(a!==a.parentMeasure.staffEntries[0]||a.parentMeasure!==a.parentMeasure.ParentStaffLine.Measures[0])){const t=r.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,e=a.parentMeasure.PositionAndShape.RelativePosition.x+a.PositionAndShape.RelativePosition.x+n.GraphicalLabel.PositionAndShape.BorderMarginLeft;h=n.GraphicalLabel.PositionAndShape.RelativePosition.y,this.calculateDashes(r,t,e,h)}}}calculateDashes(t,e,i,n){let s=i-e;if(s<3*this.rules.MinimumDistanceBetweenDashes)this.calculateSingleDashForLyricWord(t,e,i,n);else{const r=Math.floor(s/this.rules.MinimumDistanceBetweenDashes)-1,o=s/(r+1);let a=0;for(e+=o,i-=o;a<=Math.floor(r/2)&&i>e;)s=this.calculateRightAndLeftDashesForLyricWord(t,e,i,n),e+=o,i-=o,a++;s>2*o&&this.calculateSingleDashForLyricWord(t,e,i,n)}}calculateSingleDashForLyricWord(t,e,i,n){const s=new w.Label("-"),r=new f.GraphicalLabel(s,this.rules.LyricsHeight,p.TextAlignmentEnum.CenterBottom,this.rules);r.setLabelPositionAndShapeBorders(),t.LyricsDashes.push(r),-1===this.staffLinesWithLyricWords.indexOf(t)&&this.staffLinesWithLyricWords.push(t),r.PositionAndShape.Parent=t.PositionAndShape;const o=new u.PointF2D(e+(i-e)/2,n);r.PositionAndShape.RelativePosition=o}calculateLyricExtend(t){let e=t.GraphicalLabel.PositionAndShape.RelativePosition.y;const i=t.StaffEntryParent,n=i.parentMeasure.ParentStaffLine;let s,r;const o=i.parentMeasure.ParentStaff.idInMusicSheet;for(let a=i.parentVerticalContainer.Index+1;a<this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length;++a){const t=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[a].StaffEntries[o];if(t){if(t.hasOnlyRests())break;if(t.LyricsEntries.length>0)break;s=t,r=s.parentMeasure.ParentStaffLine,r||(r=i.parentMeasure.ParentStaffLine)}}if(s&&r)if(n===r&&s.parentMeasure.ParentStaffLine){const r=i.parentMeasure.PositionAndShape.RelativePosition.x+i.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.BorderMarginRight,o=s.parentMeasure.PositionAndShape.RelativePosition.x+s.PositionAndShape.RelativePosition.x+s.PositionAndShape.BorderMarginRight;e-=t.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(n,r,o,e)}else{const o=n.Measures[n.Measures.length-1].PositionAndShape,a=i.parentMeasure.PositionAndShape.RelativePosition.x+i.PositionAndShape.RelativePosition.x+t.GraphicalLabel.PositionAndShape.BorderMarginRight,l=o.RelativePosition.x+o.Size.width;if(e-=t.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(n,a,l,e),!s)return;if(s.parentMeasure.ParentStaffLine&&s.parentMeasure.staffEntries&&(s!==s.parentMeasure.staffEntries[0]||s.parentMeasure!==s.parentMeasure.ParentStaffLine.Measures[0])){const t=r.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,i=s.parentMeasure.PositionAndShape.RelativePosition.x+s.PositionAndShape.RelativePosition.x+s.PositionAndShape.BorderMarginRight;this.calculateSingleLyricWordWithUnderscore(r,t,i,e)}}}calculateSingleLyricWordWithUnderscore(t,e,i,n){const s=new u.PointF2D(e,n),r=new u.PointF2D(i,n),o=new _.GraphicalLine(s,r,this.rules.LyricUnderscoreLineWidth);t.LyricLines.push(o),-1===this.staffLinesWithLyricWords.indexOf(t)&&this.staffLinesWithLyricWords.push(t)}calculateRightAndLeftDashesForLyricWord(t,e,i,n){const s=new w.Label("-"),r=new f.GraphicalLabel(s,this.rules.LyricsHeight,p.TextAlignmentEnum.CenterBottom,this.rules);r.setLabelPositionAndShapeBorders(),t.LyricsDashes.push(r),-1===this.staffLinesWithLyricWords.indexOf(t)&&this.staffLinesWithLyricWords.push(t),r.PositionAndShape.Parent=t.PositionAndShape;const o=new u.PointF2D(e,n);r.PositionAndShape.RelativePosition=o;const a=new w.Label("-"),l=new f.GraphicalLabel(a,this.rules.LyricsHeight,p.TextAlignmentEnum.CenterBottom,this.rules);l.setLabelPositionAndShapeBorders(),t.LyricsDashes.push(l),l.PositionAndShape.Parent=t.PositionAndShape;const h=new u.PointF2D(i,n);return l.PositionAndShape.RelativePosition=h,l.PositionAndShape.RelativePosition.x-r.PositionAndShape.RelativePosition.x}calculateDynamicExpressions(){const t=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,this.rules.MaxMeasureToDrawIndex);for(let e=Math.min(this.rules.MinMeasureToDrawIndex,this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length);e<=t;e++){const t=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[e];for(let i=0;i<t.StaffLinkedExpressions.length;i++)if(this.graphicalMusicSheet.MeasureList[e]&&this.graphicalMusicSheet.MeasureList[e][i]&&this.graphicalMusicSheet.MeasureList[e][i].ParentStaff.ParentInstrument.Visible)for(let n=0;n<t.StaffLinkedExpressions[i].length;n++)(void 0!==t.StaffLinkedExpressions[i][n].InstantaneousDynamic||void 0!==t.StaffLinkedExpressions[i][n].StartingContinuousDynamic&&t.StaffLinkedExpressions[i][n].StartingContinuousDynamic.StartMultiExpression===t.StaffLinkedExpressions[i][n]&&0===t.StaffLinkedExpressions[i][n].UnknownList.length)&&this.calculateDynamicExpressionsForMultiExpression(t.StaffLinkedExpressions[i][n],e,i)}}calculateOctaveShifts(){for(let t=0;t<this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length;t++){const e=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[t];for(let i=0;i<e.StaffLinkedExpressions.length;i++)if(this.graphicalMusicSheet.MeasureList[t]&&this.graphicalMusicSheet.MeasureList[t][i]&&this.graphicalMusicSheet.MeasureList[t][i].ParentStaff.ParentInstrument.Visible)for(let n=0;n<e.StaffLinkedExpressions[i].length;n++)e.StaffLinkedExpressions[i][n].OctaveShiftStart&&this.calculateSingleOctaveShift(e,e.StaffLinkedExpressions[i][n],t,i)}}getFirstLeftNotNullStaffEntryFromContainer(t,e,i){if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[t].StaffEntries[e])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[t].StaffEntries[e];for(let n=t-1;n>=0;n--)if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[n].StaffEntries[e])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[n].StaffEntries[e]}getFirstRightNotNullStaffEntryFromContainer(t,e,i){if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[t].StaffEntries[e])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[t].StaffEntries[e];for(let n=t+1;n<this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length;n++)if(this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[n].StaffEntries[e])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[n].StaffEntries[e]}calculateWordRepetitionInstructions(){for(let t=0;t<this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length;t++){const e=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[t];for(let i=0,n=e.FirstRepetitionInstructions.length;i<n;++i){const n=e.FirstRepetitionInstructions[i];this.calculateWordRepetitionInstruction(n,t)}for(let i=0,n=e.LastRepetitionInstructions.length;i<n;++i){const n=e.LastRepetitionInstructions[i];this.calculateWordRepetitionInstruction(n,t)}}}calculateRepetitionEndings(){const t=this.graphicalMusicSheet.ParentMusicSheet;for(let e=0,i=t.Repetitions.length;e<i;++e){const i=t.Repetitions[e];this.calcGraphicalRepetitionEndingsRecursively(i)}}calculateTempoExpressions(){const t=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,this.rules.MaxMeasureToDrawIndex);for(let e=this.rules.MinMeasureToDrawIndex;e<=t;e++){const t=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[e];for(let i=0;i<t.TempoExpressions.length;i++)this.calculateTempoExpressionsForMultiTempoExpression(t,t.TempoExpressions[i],e)}}calculateRehearsalMarks(){if(this.rules.RenderRehearsalMarks)for(const t of this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures)this.calculateRehearsalMark(t)}calculateRehearsalMark(t){throw new Error(this.abstractNotImplementedErrorMessage)}calculateMoodAndUnknownExpressions(){for(let t=0;t<this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length;t++){const e=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[t];for(let i=0;i<e.StaffLinkedExpressions.length;i++)if(this.graphicalMusicSheet.MeasureList[t]&&this.graphicalMusicSheet.MeasureList[t][i]&&this.graphicalMusicSheet.MeasureList[t][i].ParentStaff.ParentInstrument.Visible)for(let n=0;n<e.StaffLinkedExpressions[i].length;n++)(e.StaffLinkedExpressions[i][n].MoodList.length>0||e.StaffLinkedExpressions[i][n].UnknownList.length>0)&&this.calculateMoodAndUnknownExpression(e.StaffLinkedExpressions[i][n],t,i)}}calculateStemDirectionFromVoices(t){if(void 0!==t.ParentSourceStaffEntry.Link)return t===t.ParentSourceStaffEntry.VoiceEntries[0]?void(t.WantedStemDirection=h.StemDirectionType.Up):void(t.WantedStemDirection=h.StemDirectionType.Down);t.ParentVoice instanceof b.LinkedVoice?t.WantedStemDirection=h.StemDirectionType.Down:t.ParentSourceStaffEntry.VoiceEntries.length>1&&(t.WantedStemDirection=h.StemDirectionType.Up)}setBeamNotesWantedStemDirections(t){if(!(t.Notes.length>0))return;const e=t.Notes[0].NoteBeam;if(e)for(const i of e.Notes)if(i.ParentVoiceEntry.WantedStemDirection!==h.StemDirectionType.Undefined&&i.ParentVoiceEntry.ParentSourceStaffEntry.ParentStaff.Id===t.ParentSourceStaffEntry.ParentStaff.Id){t.WantedStemDirection=i.ParentVoiceEntry.WantedStemDirection;break}}}e.MusicSheetCalculator=F},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.KeyEnum=e.NoteEnumToHalfToneLink=e.KeyInstruction=void 0;const n=i(49),s=i(2),r=i(2);class o extends n.AbstractNotationInstruction{constructor(t,e=0,i=a.major){super(t),this.isTransposedBy=0,this.Key=e,this.keyTypeOriginal=e,this.mode=i,this.alteratedNotes=this.calcAlteratedNotes()}static copy(t){const e=new o(t.parent,t.Key,t.Mode);return e.keyTypeOriginal=t.keyTypeOriginal,e}static getAllPossibleMajorKeyInstructions(){const t=[];for(let e=-7;e<7;e++){const i=new o(void 0,e,a.major);t.push(i)}return t}get Key(){return this.keyType}set Key(t){this.keyType=t,this.alteratedNotes=this.calcAlteratedNotes()}get Mode(){return this.mode}set Mode(t){this.mode=t}get AlteratedNotes(){return this.alteratedNotes}calcAlteratedNotes(){const t=[];if(this.keyType>0)for(let e=0;e<this.keyType;e++)t.push(o.sharpPositionList[e]);else if(this.keyType<0)for(let e=0;e<-this.keyType;e++)t.push(o.flatPositionList[e]);return t}willAlterateNote(t){return this.alteratedNotes.indexOf(t)>=0}getAlterationForPitch(t){return this.keyType>0&&this.alteratedNotes.indexOf(t.FundamentalNote)<=this.keyType?r.AccidentalEnum.SHARP:this.keyType<0&&this.alteratedNotes.indexOf(t.FundamentalNote)<=Math.abs(this.keyType)?r.AccidentalEnum.FLAT:r.AccidentalEnum.NONE}ToString(){return"Key: "+this.keyType+this.mode}OperatorEquals(t){return this===t||!(!this||!t)&&this.Key===t.Key&&this.Mode===t.Mode}OperatorNotEqual(t){return!this.OperatorEquals(t)}}var a,l;e.KeyInstruction=o,o.sharpPositionList=[s.NoteEnum.F,s.NoteEnum.C,s.NoteEnum.G,s.NoteEnum.D,s.NoteEnum.A,s.NoteEnum.E,s.NoteEnum.B],o.flatPositionList=[s.NoteEnum.B,s.NoteEnum.E,s.NoteEnum.A,s.NoteEnum.D,s.NoteEnum.G,s.NoteEnum.C,s.NoteEnum.F],e.NoteEnumToHalfToneLink=class{constructor(t,e){this.note=t,this.halfTone=e}},(l=a=e.KeyEnum||(e.KeyEnum={}))[l.major=0]="major",l[l.minor=1]="minor",l[l.none=2]="none",l[l.dorian=3]="dorian",l[l.phrygian=4]="phrygian",l[l.lydian=5]="lydian",l[l.mixolydian=6]="mixolydian",l[l.aeolian=7]="aeolian",l[l.ionian=8]="ionian",l[l.locrian=9]="locrian"},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.RhythmSymbolEnum=e.RhythmInstruction=void 0;const n=i(49);class s extends n.AbstractNotationInstruction{constructor(t,e){super(void 0),this.rhythm=t,this.numerator=t.Numerator,this.denominator=t.Denominator,this.symbolEnum=e}get Rhythm(){return this.rhythm}set Rhythm(t){this.rhythm=t}get SymbolEnum(){return this.symbolEnum}set SymbolEnum(t){this.symbolEnum=t}clone(){return new s(this.rhythm.clone(),this.symbolEnum)}OperatorEquals(t){return this===t||!(!this||!t)&&this.numerator===t.numerator&&this.denominator===t.denominator}OperatorNotEqual(t){return!(this===t)}ToString(){return"Rhythm: "+this.rhythm.toString()}}var r;e.RhythmInstruction=s,(r=e.RhythmSymbolEnum||(e.RhythmSymbolEnum={}))[r.NONE=0]="NONE",r[r.COMMON=1]="COMMON",r[r.CUT=2]="CUT"},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.ITextTranslation=void 0,e.ITextTranslation=class{static translateText(t,e){if(!this.defaultTextTranslation)return e}}},function(t,e,i){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.FontStyles=void 0,(n=e.FontStyles||(e.FontStyles={}))[n.Regular=0]="Regular",n[n.Bold=1]="Bold",n[n.Italic=2]="Italic",n[n.BoldItalic=3]="BoldItalic",n[n.Underlined=4]="Underlined"},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AutoColorSet=e.NoteState=e.GraphicalLayers=e.StyleSets=e.OUTLINE_AND_FILL_STYLE_DICT=e.OutlineAndFillStyleEnum=void 0;const n=i(15);var s,r;(r=s=e.OutlineAndFillStyleEnum||(e.OutlineAndFillStyleEnum={}))[r.BaseWritingColor=0]="BaseWritingColor",r[r.FollowingCursor=1]="FollowingCursor",r[r.AlternativeFollowingCursor=2]="AlternativeFollowingCursor",r[r.PlaybackCursor=3]="PlaybackCursor",r[r.Highlighted=4]="Highlighted",r[r.ErrorUnderlay=5]="ErrorUnderlay",r[r.Selected=6]="Selected",r[r.SelectionSymbol=7]="SelectionSymbol",r[r.DebugColor1=8]="DebugColor1",r[r.DebugColor2=9]="DebugColor2",r[r.DebugColor3=10]="DebugColor3",r[r.SplitScreenDivision=11]="SplitScreenDivision",r[r.GreyTransparentOverlay=12]="GreyTransparentOverlay",r[r.MarkedArea1=13]="MarkedArea1",r[r.MarkedArea2=14]="MarkedArea2",r[r.MarkedArea3=15]="MarkedArea3",r[r.MarkedArea4=16]="MarkedArea4",r[r.MarkedArea5=17]="MarkedArea5",r[r.MarkedArea6=18]="MarkedArea6",r[r.MarkedArea7=19]="MarkedArea7",r[r.MarkedArea8=20]="MarkedArea8",r[r.MarkedArea9=21]="MarkedArea9",r[r.MarkedArea10=22]="MarkedArea10",r[r.Comment1=23]="Comment1",r[r.Comment2=24]="Comment2",r[r.Comment3=25]="Comment3",r[r.Comment4=26]="Comment4",r[r.Comment5=27]="Comment5",r[r.Comment6=28]="Comment6",r[r.Comment7=29]="Comment7",r[r.Comment8=30]="Comment8",r[r.Comment9=31]="Comment9",r[r.Comment10=32]="Comment10",e.OUTLINE_AND_FILL_STYLE_DICT=new n.Dictionary,e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.BaseWritingColor,"Thistle"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.FollowingCursor,"Aqua"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.AlternativeFollowingCursor,"Azure"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.PlaybackCursor,"Bisque"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Highlighted,"CadetBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.ErrorUnderlay,"DarkBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Selected,"DarkGoldenRod"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.SelectionSymbol,"BlanchedAlmond"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.DebugColor1,"Chartreuse"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.DebugColor2,"DarkGreen"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.DebugColor3,"DarkOrange"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.SplitScreenDivision,"FireBrick"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.GreyTransparentOverlay,"DarkSalmon"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea1,"DarkSeaGreen"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea2,"DarkOrchid"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea3,"Aquamarine"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea4,"DarkKhaki"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea5,"ForestGreen"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea6,"AliceBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea7,"DeepPink"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea8,"Coral"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea9,"DarkOliveGreen"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.MarkedArea10,"Chocolate"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment1,"DodgerBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment2,"Blue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment3,"Beige"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment4,"Crimson"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment5,"Fuchsia"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment6,"Brown"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment7,"BlanchedAlmond"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment8,"CornflowerBlue"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment9,"Cornsilk"),e.OUTLINE_AND_FILL_STYLE_DICT.setValue(s.Comment10,"DarkGrey"),function(t){t[t.MarkedArea=0]="MarkedArea",t[t.Comment=1]="Comment"}(e.StyleSets||(e.StyleSets={})),function(t){t[t.Background=0]="Background",t[t.Highlight=1]="Highlight",t[t.MeasureError=2]="MeasureError",t[t.SelectionSymbol=3]="SelectionSymbol",t[t.Cursor=4]="Cursor",t[t.PSI_Debug=5]="PSI_Debug",t[t.Notes=6]="Notes",t[t.Comment=7]="Comment",t[t.Debug_above=8]="Debug_above"}(e.GraphicalLayers||(e.GraphicalLayers={})),function(t){t[t.Normal=0]="Normal",t[t.Selected=1]="Selected",t[t.Follow_Confirmed=2]="Follow_Confirmed",t[t.QFeedback_NotFound=3]="QFeedback_NotFound",t[t.QFeedback_OK=4]="QFeedback_OK",t[t.QFeedback_Perfect=5]="QFeedback_Perfect",t[t.Debug1=6]="Debug1",t[t.Debug2=7]="Debug2",t[t.Debug3=8]="Debug3"}(e.NoteState||(e.NoteState={})),function(t){t.C="#d82c6b",t.D="#F89D15",t.E="#FFE21A",t.F="#4dbd5c",t.G="#009D96",t.A="#43469d",t.B="#76429c",t.Rest="#000000"}(e.AutoColorSet||(e.AutoColorSet={}))},function(t,e,i){var n,s;Object.defineProperty(e,"__esModule",{value:!0}),e.SystemLinesEnumHelper=e.SystemLinesEnum=void 0,(s=n=e.SystemLinesEnum||(e.SystemLinesEnum={}))[s.SingleThin=0]="SingleThin",s[s.DoubleThin=1]="DoubleThin",s[s.ThinBold=2]="ThinBold",s[s.BoldThinDots=3]="BoldThinDots",s[s.DotsThinBold=4]="DotsThinBold",s[s.DotsBoldBoldDots=5]="DotsBoldBoldDots",s[s.None=6]="None",s[s.Dotted=7]="Dotted",s[s.Dashed=8]="Dashed",s[s.Bold=9]="Bold",s[s.BoldThin=10]="BoldThin",s[s.DoubleBold=11]="DoubleBold",s[s.Tick=12]="Tick",s[s.Short=13]="Short",e.SystemLinesEnumHelper=class{static xmlBarlineStyleToSystemLinesEnum(t){return"regular"===t?n.SingleThin:"dotted"===t?n.Dotted:"dashed"===t?n.Dashed:"heavy"===t?n.Bold:"light-light"===t?n.DoubleThin:"light-heavy"===t?n.ThinBold:"heavy-light"===t?n.BoldThin:"heavy-heavy"===t?n.DoubleBold:"tick"===t?n.Tick:"short"===t?n.Short:"none"===t?n.None:n.SingleThin}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalLabel=void 0;const n=i(9),s=i(5),r=i(114),o=i(17);class a extends r.Clickable{constructor(t,e,i,n,r){super(),this.label=t,this.boundingBox=new s.BoundingBox(this,r),this.label.fontHeight=e,this.label.textAlignment=i,this.rules=n}get Label(){return this.label}toString(){return`${this.label.text} (${this.boundingBox.RelativePosition.x},${this.boundingBox.RelativePosition.y})`}setLabelPositionAndShapeBorders(){var t,e;if(""===this.Label.text.trim())return;this.TextLines=[];const i=null!==(e=null===(t=this.rules)||void 0===t?void 0:t.LabelMarginBorderFactor)&&void 0!==e?e:.1,s=this.Label.text.split(/[\n\r]+/g),r=s.length;let a=0;for(let n=0;n<r;n++){const t=s[n].trim(),e=o.MusicSheetCalculator.TextMeasurer.computeTextWidthToHeightRatio(t,this.Label.font,this.Label.fontStyle,this.label.fontFamily),i=this.Label.fontHeight*e;a=Math.max(a,i),this.TextLines.push({text:t,xOffset:0,width:i})}for(const o of this.TextLines){let t=0;switch(this.Label.textAlignment){case n.TextAlignmentEnum.RightBottom:case n.TextAlignmentEnum.RightCenter:case n.TextAlignmentEnum.RightTop:t=a-o.width;break;case n.TextAlignmentEnum.CenterBottom:case n.TextAlignmentEnum.CenterCenter:case n.TextAlignmentEnum.CenterTop:t=(a-o.width)/2}o.xOffset=t}let l=this.Label.fontHeight*r;this.rules.SpacingBetweenTextLines>0&&this.TextLines.length>1&&(l+=this.rules.SpacingBetweenTextLines*r/10);const h=this.PositionAndShape;switch(this.Label.textAlignment){case n.TextAlignmentEnum.CenterBottom:h.BorderTop=-l,h.BorderLeft=-a/2,h.BorderBottom=0,h.BorderRight=a/2;break;case n.TextAlignmentEnum.CenterCenter:h.BorderTop=-l/2,h.BorderLeft=-a/2,h.BorderBottom=l/2,h.BorderRight=a/2;break;case n.TextAlignmentEnum.CenterTop:h.BorderTop=0,h.BorderLeft=-a/2,h.BorderBottom=l,h.BorderRight=a/2;break;case n.TextAlignmentEnum.LeftBottom:h.BorderTop=-l,h.BorderLeft=0,h.BorderBottom=0,h.BorderRight=a;break;case n.TextAlignmentEnum.LeftCenter:h.BorderTop=-l/2,h.BorderLeft=0,h.BorderBottom=l/2,h.BorderRight=a;break;case n.TextAlignmentEnum.LeftTop:h.BorderTop=0,h.BorderLeft=0,h.BorderBottom=l,h.BorderRight=a;break;case n.TextAlignmentEnum.RightBottom:h.BorderTop=-l,h.BorderLeft=-a,h.BorderBottom=0,h.BorderRight=0;break;case n.TextAlignmentEnum.RightCenter:h.BorderTop=-l/2,h.BorderLeft=-a,h.BorderBottom=l/2,h.BorderRight=0;break;case n.TextAlignmentEnum.RightTop:h.BorderTop=0,h.BorderLeft=-a,h.BorderBottom=l,h.BorderRight=0}h.BorderMarginTop=h.BorderTop-l*i,h.BorderMarginLeft=h.BorderLeft-l*i,h.BorderMarginBottom=h.BorderBottom+l*i,h.BorderMarginRight=h.BorderRight+l*i}}e.GraphicalLabel=a},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.OSMDOptions=e.BackendType=e.FillEmptyMeasuresWithWholeRests=e.AlignRestOption=void 0;const n=i(33);var s,r;(r=e.AlignRestOption||(e.AlignRestOption={}))[r.Never=0]="Never",r[r.Always=1]="Always",r[r.Auto=2]="Auto",function(t){t[t.No=0]="No",t[t.YesVisible=1]="YesVisible",t[t.YesInvisible=2]="YesInvisible"}(e.FillEmptyMeasuresWithWholeRests||(e.FillEmptyMeasuresWithWholeRests={})),function(t){t[t.SVG=0]="SVG",t[t.Canvas=1]="Canvas"}(s=e.BackendType||(e.BackendType={})),e.OSMDOptions=class{static OSMDOptionsStandard(){return{autoResize:!0,backend:"svg",drawingParameters:n.DrawingParametersEnum.default}}static BackendTypeFromString(t){return t&&"canvas"===t.toLowerCase()?s.Canvas:s.SVG}}},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.PageFormat=e.EngravingRules=void 0;const s=i(45),r=n(i(1)),o=i(9),a=i(3),l=i(25),h=i(33),c=i(15),u=i(67),d=i(48),f=i(71);class p{constructor(){this.NoteDistances=[1,1,1.3,1.6,2,2.5,3,4],this.NoteDistancesScalingFactors=[1,2,4,8,16,32,64,128],this.DurationDistanceDict={},this.DurationScalingDistanceDict={},this.NoteToGraphicalNoteMapObjectCount=0,this.loadDefaultValues()}loadDefaultValues(){this.SamplingUnit=3*p.unit,this.SheetTitleHeight=4,this.SheetSubtitleHeight=2,this.SheetMinimumDistanceBetweenTitleAndSubtitle=1,this.SheetComposerHeight=2,this.SheetAuthorHeight=2,this.CompactMode=!1,this.PagePlacementEnum=s.PagePlacementEnum.Down,this.PageHeight=100001,this.PageTopMargin=5,this.PageTopMarginNarrow=0,this.PageBottomMargin=5,this.PageLeftMargin=5,this.PageRightMargin=5,this.TitleTopDistance=5,this.TitleBottomDistance=1,this.StaffDistance=7,this.BetweenStaffDistance=5,this.MinimumStaffLineDistance=4,this.MinSkyBottomDistBetweenStaves=1,this.StaffHeight=4,this.TabStaffInterlineHeight=1.1111,this.BetweenStaffLinesDistance=p.unit,this.SystemLeftMargin=0,this.SystemRightMargin=0,this.SystemLabelsRightMargin=2,this.SystemComposerDistance=2,this.InstrumentLabelTextHeight=2,this.MinimumDistanceBetweenSystems=7,this.MinSkyBottomDistBetweenSystems=5,this.LastSystemMaxScalingFactor=1.4,this.AutoBeamNotes=!1,this.AutoBeamOptions={beam_middle_rests_only:!1,beam_rests:!1,maintain_stem_directions:!1},this.BeamWidth=p.unit/2,this.BeamSpaceWidth=p.unit/3,this.BeamForwardLength=1.25*p.unit,this.FlatBeams=!1,this.FlatBeamOffset=20,this.FlatBeamOffsetPerBeam=10,this.ClefLeftMargin=.5,this.ClefRightMargin=.75,this.PercussionOneLineCutoff=3,this.PercussionForceVoicesOneLineCutoff=1,this.PercussionOneLineUseXMLDisplayStep=!0,this.PercussionOneLineXMLDisplayStepOctaveOffset=0,this.BetweenKeySymbolsDistance=.2,this.KeyRightMargin=.75,this.RhythmRightMargin=1.25,this.ShowRhythmAgainAfterPartEndOrFinalBarline=!0,this.NewPartAndSystemAfterFinalBarline=!1,this.InStaffClefScalingFactor=.8,this.DistanceBetweenNaturalAndSymbolWhenCancelling=.4,this.NoteHelperLinesOffset=.25,this.MeasureLeftMargin=.7,this.MeasureRightMargin=0,this.DistanceBetweenLastInstructionAndRepetitionBarline=1,this.ArpeggioDistance=.6,this.StaccatoShorteningFactor=2,this.IdealStemLength=3,this.StemNoteHeadBorderYOffset=.2,this.StemMargin=.2,this.StemMinLength=2.5,this.StemMaxLength=4.5,this.BeamSlopeMaxAngle=10,this.StemMinAllowedDistanceBetweenNoteHeadAndBeamLine=1,this.SetWantedStemDirectionByXml=!0,this.GraceNoteScalingFactor=.6,this.GraceNoteXOffset=.2,this.WedgeOpeningLength=1.2,this.WedgeMeasureEndOpeningLength=.75,this.WedgeMeasureBeginOpeningLength=.75,this.WedgePlacementAboveY=-1.5,this.WedgePlacementBelowY=1.5,this.WedgeHorizontalMargin=.6,this.WedgeVerticalMargin=.5,this.DistanceOffsetBetweenTwoHorizontallyCrossedWedges=.3,this.WedgeMinLength=2,this.DistanceBetweenAdjacentDynamics=.75,this.TempoChangeMeasureValidity=4,this.TempoContinousFactor=.7,this.StaccatoScalingFactor=.8,this.BetweenDotsDistance=.8,this.OrnamentAccidentalScalingFactor=.65,this.ChordSymbolTextHeight=2,this.ChordSymbolTextAlignment=o.TextAlignmentEnum.LeftBottom,this.ChordSymbolRelativeXOffset=-1,this.ChordSymbolXSpacing=1,this.ChordOverlapAllowedIntoNextMeasure=0,this.ChordSymbolYOffset=2,this.ChordSymbolLabelTexts=new c.Dictionary,this.resetChordSymbolLabelTexts(this.ChordSymbolLabelTexts),this.CustomChords=[],this.resetChordNames(),this.RepetitionSymbolsYOffset=0,this.RehearsalMarkXOffsetDefault=10,this.RehearsalMarkXOffset=0,this.RehearsalMarkXOffsetSystemStartMeasure=-20,this.RehearsalMarkYOffsetDefault=-15,this.RehearsalMarkYOffset=0,this.RehearsalMarkFontSize=10,this.MeasureNumberLabelHeight=1.5*p.unit,this.MeasureNumberLabelOffset=2,this.MeasureNumberLabelXOffset=-.5,this.TupletsRatioed=!1,this.TupletsBracketed=!1,this.TripletsBracketed=!1,this.TupletNumberLabelHeight=1.5*p.unit,this.TupletNumberYOffset=.5,this.LabelMarginBorderFactor=.1,this.TupletVerticalLineLength=.5,this.TupletNumbersInTabs=!1,this.SlurPlacementFromXML=!0,this.BezierCurveStepSize=1e3,this.calculateCurveParametersArrays(),this.TieGhostObjectWidth=.75,this.TieYPositionOffsetFactor=.3,this.MinimumNeededXspaceForTieGhostObject=1,this.TieHeightMinimum=.28,this.TieHeightMaximum=1.2,this.TieHeightInterpolationK=.0288,this.TieHeightInterpolationD=.136,this.SlurNoteHeadYOffset=.5,this.SlurStemXOffset=.3,this.SlurSlopeMaxAngle=15,this.SlurTangentMinAngle=30,this.SlurTangentMaxAngle=80,this.SlurHeightFactor=1,this.SlurHeightFlattenLongSlursFactorByWidth=.24,this.SlurHeightFlattenLongSlursFactorByAngle=.36,this.SlurHeightFlattenLongSlursCutoffAngle=47,this.SlurHeightFlattenLongSlursCutoffWidth=16,this.SlursStartingAtSameStaffEntryYOffset=.8,this.RepetitionEndingLabelHeight=2,this.RepetitionEndingLabelXOffset=.5,this.RepetitionEndingLabelYOffset=.3,this.RepetitionEndingLineYLowerOffset=.5,this.RepetitionEndingLineYUpperOffset=.3,this.VoltaOffset=2.5,this.LyricsAlignmentStandard=o.TextAlignmentEnum.LeftBottom,this.LyricsHeight=2,this.LyricsYOffsetToStaffHeight=0,this.VerticalBetweenLyricsDistance=.5,this.HorizontalBetweenLyricsDistance=.2,this.BetweenSyllableMaximumDistance=10,this.BetweenSyllableMinimumDistance=.5,this.LyricOverlapAllowedIntoNextMeasure=3.4,this.MinimumDistanceBetweenDashes=10,this.MaximumLyricsElongationFactor=2.5,this.InstantaneousTempoTextHeight=2.3,this.ContinuousDynamicTextHeight=2.3,this.MoodTextHeight=2.3,this.UnknownTextHeight=2,this.ContinuousTempoTextHeight=2.3,this.DynamicExpressionMaxDistance=2,this.DynamicExpressionSpacer=.5,this.VexFlowDefaultNotationFontScale=39,this.VexFlowDefaultTabFontScale=39,this.TremoloStrokeScale=1,this.TremoloYSpacingScale=1,this.StemWidth=.15,this.StaffLineWidth=.1,this.StaffLineColor=void 0,this.LedgerLineWidth=1,this.LedgerLineStrokeStyle=void 0,this.LedgerLineColorDefault="#000000",this.WedgeLineWidth=.12,this.TupletLineWidth=.12,this.LyricUnderscoreLineWidth=.12,this.SystemThinLineWidth=.12,this.SystemBoldLineWidth=p.unit/2,this.SystemRepetitionEndingLineWidth=.12,this.SystemDotWidth=p.unit/5,this.DistanceBetweenVerticalSystemLines=.35,this.DistanceBetweenDotAndLine=.7,this.OctaveShiftLineWidth=.12,this.OctaveShiftVerticalLineLength=p.unit,this.GraceLineWidth=this.StaffLineWidth*this.GraceNoteScalingFactor,this.MultipleRestMeasureDefaultWidth=4,this.MinimumCrossedBeamDifferenceMargin=1e-4,this.VoiceSpacingMultiplierVexflow=.85,this.VoiceSpacingAddendVexflow=3,this.PickupMeasureWidthMultiplier=1,this.DisplacedNoteMargin=.1,this.MinNoteDistance=2,this.SubMeasureXSpacingThreshold=35,this.MeasureDynamicsMaxScalingFactor=2.5,this.WholeRestXShiftVexflow=-1.5,this.MetronomeMarksDrawn=!0,this.MetronomeMarkXShift=-6,this.MetronomeMarkYShift=-.5,this.SoftmaxFactorVexFlow=15,this.AlignRests=l.AlignRestOption.Never,this.FillEmptyMeasuresWithWholeRest=l.FillEmptyMeasuresWithWholeRests.No,this.ArpeggiosGoAcrossVoices=!1,this.RenderArpeggios=!0,this.RenderSlurs=!0,this.ColoringMode=h.ColoringModes.XML,this.ColoringEnabled=!0,this.ColorStemsLikeNoteheads=!1,this.ColorBeams=!0,this.ColorFlags=!0,this.DefaultColorNotehead="#000000",this.DefaultColorRest=this.DefaultColorNotehead,this.DefaultColorStem=this.DefaultColorNotehead,this.DefaultColorLabel=this.DefaultColorNotehead,this.DefaultColorTitle=this.DefaultColorNotehead,this.DefaultColorCursor="#33e02f",this.DefaultFontFamily="Times New Roman",this.DefaultFontStyle=u.FontStyles.Regular,this.DefaultVexFlowNoteFont="gonville",this.MaxMeasureToDrawIndex=Number.MAX_VALUE,this.MinMeasureToDrawIndex=0,this.MaxSystemToDrawNumber=Number.MAX_VALUE,this.MaxPageToDrawNumber=Number.MAX_VALUE,this.RenderComposer=!0,this.RenderTitle=!0,this.RenderSubtitle=!0,this.RenderLyricist=!0,this.RenderPartNames=!0,this.RenderPartAbbreviations=!0,this.RenderFingerings=!0,this.RenderMeasureNumbers=!0,this.RenderMeasureNumbersOnlyAtSystemStart=!1,this.UseXMLMeasureNumbers=!0,this.RenderLyrics=!0,this.RenderChordSymbols=!0,this.RenderMultipleRestMeasures=!0,this.AutoGenerateMutipleRestMeasuresFromRestMeasures=!0,this.RenderRehearsalMarks=!0,this.RenderKeySignatures=!0,this.RenderTimeSignatures=!0,this.ArticulationPlacementFromXML=!0,this.FingeringPosition=a.PlacementEnum.Left,this.FingeringInsideStafflines=!1,this.FingeringLabelFontHeight=1.7,this.FingeringOffsetX=0,this.RenderStringNumbersClassical=!0,this.StringNumberOffsetY=0,this.NewSystemAtXMLNewSystemAttribute=!1,this.NewPageAtXMLNewPageAttribute=!1,this.RestoreCursorAfterRerender=!0,this.StretchLastSystemLine=!1,p.FixStafflineBoundingBox=!1,this.PageFormat=m.UndefinedPageFormat,this.PageBackgroundColor=void 0,this.RenderSingleHorizontalStaffline=!1,this.SpacingBetweenTextLines=0,this.NoteToGraphicalNoteMap=new c.Dictionary,this.NoteToGraphicalNoteMapObjectCount=0;try{this.MaxInstructionsConstValue=this.ClefLeftMargin+this.ClefRightMargin+this.KeyRightMargin+this.RhythmRightMargin+11}catch(t){r.default.info("EngravingRules()",t)}}addGraphicalNoteToNoteMap(t,e){t.NoteToGraphicalNoteObjectId=this.NoteToGraphicalNoteMapObjectCount,this.NoteToGraphicalNoteMap.setValue(t.NoteToGraphicalNoteObjectId,e),this.NoteToGraphicalNoteMapObjectCount++}GNote(t){return f.GraphicalNote.FromNote(t,this)}clearMusicSheetObjects(){this.NoteToGraphicalNoteMap=new c.Dictionary,this.NoteToGraphicalNoteMapObjectCount=0}setChordSymbolLabelText(t,e){this.ChordSymbolLabelTexts.setValue(t,e)}resetChordSymbolLabelTexts(t){return t.setValue(d.ChordSymbolEnum.minor,"m"),t.setValue(d.ChordSymbolEnum.augmented,"aug"),t.setValue(d.ChordSymbolEnum.diminished,"dim"),t.setValue(d.ChordSymbolEnum.dominant,"7"),t.setValue(d.ChordSymbolEnum.majorseventh,"maj7"),t.setValue(d.ChordSymbolEnum.minorseventh,"m7"),t.setValue(d.ChordSymbolEnum.diminishedseventh,"dim7"),t.setValue(d.ChordSymbolEnum.augmentedseventh,"aug7"),t.setValue(d.ChordSymbolEnum.halfdiminished,"m7b5"),t.setValue(d.ChordSymbolEnum.majorminor,"m(maj7)"),t.setValue(d.ChordSymbolEnum.majorsixth,"maj6"),t.setValue(d.ChordSymbolEnum.minorsixth,"m6"),t.setValue(d.ChordSymbolEnum.dominantninth,"9"),t.setValue(d.ChordSymbolEnum.majorninth,"maj9"),t.setValue(d.ChordSymbolEnum.minorninth,"m9"),t.setValue(d.ChordSymbolEnum.dominant11th,"11"),t.setValue(d.ChordSymbolEnum.major11th,"maj11"),t.setValue(d.ChordSymbolEnum.minor11th,"m11"),t.setValue(d.ChordSymbolEnum.dominant13th,"13"),t.setValue(d.ChordSymbolEnum.major13th,"maj13"),t.setValue(d.ChordSymbolEnum.minor13th,"m13"),t.setValue(d.ChordSymbolEnum.suspendedsecond,"sus2"),t.setValue(d.ChordSymbolEnum.suspendedfourth,"sus4"),t.setValue(d.ChordSymbolEnum.power,"5"),t.setValue(d.ChordSymbolEnum.none,"N.C."),t}addChordName(t,e,i,n,s){if(void 0!==d.ChordSymbolEnum[e]){const r={adds:i,alts:n,subs:s};this.CustomChords.push(d.CustomChord.createCustomChord(t,d.ChordSymbolEnum[e],r))}}renameChord(t,e){d.CustomChord.renameCustomChord(t,e,this.CustomChords)}resetChordNames(){this.addChordName("alt","major",["#5","b9","#9"],["b5"],[]),this.addChordName("7alt","dominant",["#5","b9","#9"],["b5"],[]),this.addChordName("7sus4","dominant",["4"],[],["3"]),this.addChordName("7sus4","suspendedfourth",["7"],[],[]),this.addChordName("9sus4","dominantninth",["4"],[],["3"]),this.addChordName("9sus4","suspendedfourth",["9"],[],[]),this.addChordName("11sus4","dominant11th",["4"],[],["3"]),this.addChordName("11sus4","suspendedfourth",["11"],[],[]),this.addChordName("13sus4","dominant13th",["4"],[],["3"]),this.addChordName("13sus4","suspendedfourth",["13"],[],[]),this.addChordName("7sus2","dominant",["2"],[],["3"]),this.addChordName("7sus2","suspendedsecond",["7"],[],[]),this.addChordName("m7b5","minorseventh",[],["b5"],[]),this.addChordName("9sus2","dominantninth",["2"],[],["3"]),this.addChordName("9sus2","suspendedsecond",["9"],[],[]),this.addChordName("11sus2","dominant11th",["2"],[],["3"]),this.addChordName("11sus2","suspendedsecond",["11"],[],[]),this.addChordName("13sus2","dominant13th",["2"],[],["3"]),this.addChordName("13sus2","suspendedsecond",["13"],[],[]),this.addChordName("m(maj9)","majorminor",["9"],[],[]),this.addChordName("m(maj11)","majorminor",["11"],[],[]),this.addChordName("m(maj13)","majorminor",["13"],[],[]),this.addChordName("69","majorsixth",["9"],[],[]),this.addChordName("mi69","minorsixth",["9"],[],[])}calculateCurveParametersArrays(){this.TPower3=new Array(this.BezierCurveStepSize),this.OneMinusTPower3=new Array(this.BezierCurveStepSize),this.FactorOne=new Array(this.BezierCurveStepSize),this.FactorTwo=new Array(this.BezierCurveStepSize);for(let t=0;t<this.BezierCurveStepSize;t++){const e=t/this.BezierCurveStepSize;this.TPower3[t]=Math.pow(e,3),this.OneMinusTPower3[t]=Math.pow(1-e,3),this.FactorOne[t]=3*Math.pow(1-e,2)*e,this.FactorTwo[t]=3*(1-e)*Math.pow(e,2)}}}e.EngravingRules=p,p.unit=1;class m{constructor(t,e,i="noIdStringGiven"){this.width=t,this.height=e,this.idString=i}get aspectRatio(){return this.IsUndefined?0:this.width/this.height}get IsUndefined(){return void 0===this.width||void 0===this.height||0===this.height||0===this.width}static get UndefinedPageFormat(){return new m(0,0)}Equals(t){return!!t&&t.width===this.width&&t.height===this.height}}e.PageFormat=m},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalLine=void 0;const n=i(22);e.GraphicalLine=class{constructor(t,e,i=0,s=n.OutlineAndFillStyleEnum.BaseWritingColor,r){this.start=t,this.end=e,this.width=i,this.styleId=s,this.colorHex=r}get Start(){return this.start}set Start(t){this.start=t}get End(){return this.end}set End(t){this.end=t}get Width(){return this.width}set Width(t){this.width=t}}},function(t,e,i){var n,s,r;Object.defineProperty(e,"__esModule",{value:!0}),e.AlignmentType=e.RepetitionInstructionEnum=e.RepetitionInstruction=e.RepetitionInstructionComparer=void 0,e.RepetitionInstructionComparer=class{static Compare(t,e){if(void 0!==t.parentRepetition&&e.parentRepetition){if(t.alignment===s.End&&e.alignment===s.End){if(t.parentRepetition.StartIndex<e.parentRepetition.StartIndex)return 1;if(t.parentRepetition.StartIndex>e.parentRepetition.StartIndex)return-1}if(t.alignment===s.Begin&&e.alignment===s.Begin){if(t.parentRepetition.EndIndex<e.parentRepetition.EndIndex)return 1;if(t.parentRepetition.EndIndex>e.parentRepetition.EndIndex)return-1}}return 0}},e.RepetitionInstruction=class{constructor(t,e,i=s.End,n,r){this.endingIndices=void 0,this.measureIndex=t,r&&(this.endingIndices=r.slice()),this.type=e,this.alignment=i,this.parentRepetition=n}CompareTo(t){const e=t;if(this.measureIndex>e.measureIndex)return 1;if(this.measureIndex<e.measureIndex)return-1;if(this.alignment===s.Begin){if(e.alignment===s.End)return-1;switch(this.type){case n.Ending:return 1;case n.StartLine:return e.type===n.Ending?-1:1;case n.Coda:case n.Segno:return e.type===n.Coda?1:-1}}else{if(e.alignment===s.Begin)return 1;switch(this.type){case n.Ending:return-1;case n.Fine:case n.ToCoda:return e.type===n.Ending?1:-1;case n.ForwardJump:switch(e.type){case n.Ending:case n.Fine:case n.ToCoda:return 1}return-1;case n.DalSegnoAlFine:case n.DaCapoAlFine:case n.DalSegnoAlCoda:case n.DaCapoAlCoda:case n.DaCapo:case n.DalSegno:case n.BackJumpLine:return 1}}return 0}equals(t){if(this.measureIndex!==t.measureIndex||this.type!==t.type||this.alignment!==t.alignment)return!1;if(this.endingIndices===t.endingIndices)return!0;if(!this.endingIndices||!t.endingIndices||this.endingIndices.length!==t.endingIndices.length)return!1;for(let e=0;e<this.endingIndices.length;e++)if(this.endingIndices[e]!==t.endingIndices[e])return!1;return!0}},(r=n=e.RepetitionInstructionEnum||(e.RepetitionInstructionEnum={}))[r.StartLine=0]="StartLine",r[r.ForwardJump=1]="ForwardJump",r[r.BackJumpLine=2]="BackJumpLine",r[r.Ending=3]="Ending",r[r.DaCapo=4]="DaCapo",r[r.DalSegno=5]="DalSegno",r[r.Fine=6]="Fine",r[r.ToCoda=7]="ToCoda",r[r.DalSegnoAlFine=8]="DalSegnoAlFine",r[r.DaCapoAlFine=9]="DaCapoAlFine",r[r.DalSegnoAlCoda=10]="DalSegnoAlCoda",r[r.DaCapoAlCoda=11]="DaCapoAlCoda",r[r.Coda=12]="Coda",r[r.Segno=13]="Segno",r[r.None=14]="None",function(t){t[t.Begin=0]="Begin",t[t.End=1]="End"}(s=e.AlignmentType||(e.AlignmentType={}))},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(10),s=function(){function t(t){this.table={},this.nElements=0,this.toStr=t||n.defaultToString}return t.prototype.getValue=function(t){var e=this.table["$"+this.toStr(t)];if(!n.isUndefined(e))return e.value},t.prototype.setValue=function(t,e){if(!n.isUndefined(t)&&!n.isUndefined(e)){var i,s="$"+this.toStr(t),r=this.table[s];return n.isUndefined(r)?(this.nElements++,i=void 0):i=r.value,this.table[s]={key:t,value:e},i}},t.prototype.remove=function(t){var e="$"+this.toStr(t),i=this.table[e];if(!n.isUndefined(i))return delete this.table[e],this.nElements--,i.value},t.prototype.keys=function(){var t=[];for(var e in this.table)if(n.has(this.table,e)){var i=this.table[e];t.push(i.key)}return t},t.prototype.values=function(){var t=[];for(var e in this.table)if(n.has(this.table,e)){var i=this.table[e];t.push(i.value)}return t},t.prototype.forEach=function(t){for(var e in this.table)if(n.has(this.table,e)){var i=this.table[e];if(!1===t(i.key,i.value))return}},t.prototype.containsKey=function(t){return!n.isUndefined(this.getValue(t))},t.prototype.clear=function(){this.table={},this.nElements=0},t.prototype.size=function(){return this.nElements},t.prototype.isEmpty=function(){return this.nElements<=0},t.prototype.toString=function(){var t="{";return this.forEach((function(e,i){t+="\n\t"+e+" : "+i})),t+"\n}"},t}();e.default=s},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.OctaveEnum=e.OctaveShift=void 0;const n=i(2);var s,r;e.OctaveShift=class{constructor(t,e){this.setOctaveShiftValue(t,e)}get Type(){return this.octaveValue}set Type(t){this.octaveValue=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get ParentStartMultiExpression(){return this.startMultiExpression}set ParentStartMultiExpression(t){this.startMultiExpression=t}get ParentEndMultiExpression(){return this.endMultiExpression}set ParentEndMultiExpression(t){this.endMultiExpression=t}setOctaveShiftValue(t,e){this.octaveValue=1===e&&"down"===t?s.VA8:1===e&&"up"===t?s.VB8:2===e&&"down"===t?s.MA15:2===e&&"up"===t?s.MB15:s.NONE}static getPitchFromOctaveShift(t,e){if(!t)return;let i=t.Octave;switch(e){case s.VA8:i-=1;break;case s.VB8:i+=1;break;case s.MA15:i-=2;break;case s.MB15:i+=2;break;case s.NONE:default:i+=0}return new n.Pitch(t.FundamentalNote,i,t.Accidental)}},(r=s=e.OctaveEnum||(e.OctaveEnum={}))[r.VA8=0]="VA8",r[r.VB8=1]="VB8",r[r.MA15=2]="MA15",r[r.MB15=3]="MB15",r[r.NONE=4]="NONE"},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SourceStaffEntry=void 0;const n=i(0),s=i(7),r=i(18),o=i(19);e.SourceStaffEntry=class{constructor(t,e){this.voiceEntries=[],this.instructions=[],this.chordSymbolContainers=[],this.verticalContainerParent=t,this.parentStaff=e}get ParentStaff(){return this.parentStaff}get VerticalContainerParent(){return this.verticalContainerParent}get Timestamp(){if(this.VerticalContainerParent)return this.VerticalContainerParent.Timestamp}get AbsoluteTimestamp(){if(this.VerticalContainerParent)return n.Fraction.plus(this.VerticalContainerParent.ParentMeasure.AbsoluteTimestamp,this.VerticalContainerParent.Timestamp)}get VoiceEntries(){return this.voiceEntries}set VoiceEntries(t){this.voiceEntries=t}get Link(){return this.staffEntryLink}set Link(t){this.staffEntryLink=t}get Instructions(){return this.instructions}set Instructions(t){this.instructions=t}get ChordContainers(){return this.chordSymbolContainers}set ChordContainers(t){this.chordSymbolContainers=t}removeAllInstructionsOfTypeClefInstruction(){let t=0,e=0;for(;t<this.instructions.length;)this.instructions[t]instanceof s.ClefInstruction?(this.instructions.splice(t,1),e++):t++;return e}removeFirstInstructionOfTypeClefInstruction(){for(let t=0;t<this.instructions.length;t++)if(this.instructions[t]instanceof s.ClefInstruction)return this.instructions.splice(t,1),!0;return!1}removeAllInstructionsOfTypeKeyInstruction(){let t=0,e=0;for(;t<this.instructions.length;)this.instructions[t]instanceof r.KeyInstruction?(this.instructions.splice(t,1),e++):t++;return e}removeFirstInstructionOfTypeKeyInstruction(){for(let t=0;t<this.instructions.length;t++)if(this.instructions[t]instanceof r.KeyInstruction)return this.instructions.splice(t,1),!0;return!1}removeAllInstructionsOfTypeRhythmInstruction(){let t=0,e=0;for(;t<this.instructions.length;)this.instructions[t]instanceof o.RhythmInstruction?(this.instructions.splice(t,1),e++):t++;return e}removeFirstInstructionOfTypeRhythmInstruction(){for(let t=0;t<this.instructions.length;t++)if(this.instructions[t]instanceof o.RhythmInstruction)return this.instructions.splice(t,1),!0;return!1}calculateMinNoteLength(){let t=new n.Fraction(Number.MAX_VALUE,1);for(let e=0,i=this.VoiceEntries.length;e<i;++e){const i=this.VoiceEntries[e];for(let e=0,n=i.Notes.length;e<n;++e){const n=i.Notes[e];n.Length.lt(t)&&(t=n.Length)}}return t}calculateMaxNoteLength(){let t=new n.Fraction(0,1);for(let e=0,i=this.VoiceEntries.length;e<i;++e){const i=this.VoiceEntries[e];for(let e=0,s=i.Notes.length;e<s;++e){const s=i.Notes[e];if(s.NoteTie){const e=n.Fraction.createFromFraction(s.Length);let i=!1;for(const t of s.NoteTie.Notes)t!==s?i&&e.Add(t.Length):i=!0;t.lt(e)&&(t=e)}else t.lt(s.Length)&&(t=s.Length)}}return t}hasNotes(){for(let t=0,e=this.VoiceEntries.length;t<e;++t)if(this.VoiceEntries[t].Notes.length>0)return!0;return!1}hasTie(){for(let t=0,e=this.VoiceEntries.length;t<e;++t)if(this.VoiceEntries[t].hasTie())return!0;return!1}findLinkedNotes(t){for(let e=0,i=this.voiceEntries.length;e<i;++e){const i=this.voiceEntries[e];for(let e=0,n=i.Notes.length;e<n;++e){const n=i.Notes[e];n.ParentStaffEntry===this&&t.push(n)}}}get hasOnlyRests(){for(const t of this.voiceEntries)for(const e of t.Notes)if(!e.isRest)return!1;return!0}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.ContDynamicEnum=e.ContinuousDynamicExpression=void 0;const n=i(3),s=i(0);class r extends n.AbstractExpression{constructor(t,e,i,n,s=""){super(e),super.parentMeasure=n,this.dynamicType=t,this.label=s,this.staffNumber=i,this.startVolume=-1,this.endVolume=-1,""!==s&&this.setType()}get DynamicType(){return this.dynamicType}set DynamicType(t){this.dynamicType=t}get StartMultiExpression(){return this.startMultiExpression}set StartMultiExpression(t){this.startMultiExpression=t}get EndMultiExpression(){return this.endMultiExpression}set EndMultiExpression(t){this.endMultiExpression=t}get Placement(){return this.placement}set Placement(t){this.placement=t}get StartVolume(){return this.startVolume}set StartVolume(t){this.startVolume=t}get EndVolume(){return this.endVolume}set EndVolume(t){this.endVolume=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get Label(){return this.label}set Label(t){this.label=t,this.setType()}static isInputStringContinuousDynamic(t){return!!t&&(r.isStringInStringList(r.listContinuousDynamicIncreasing,t)||r.isStringInStringList(r.listContinuousDynamicDecreasing,t))}getInterpolatedDynamic(t){const e=this.StartMultiExpression.AbsoluteTimestamp;let i;if(i=this.EndMultiExpression?this.EndMultiExpression.AbsoluteTimestamp:s.Fraction.plus(this.startMultiExpression.SourceMeasureParent.AbsoluteTimestamp,this.startMultiExpression.SourceMeasureParent.Duration),t.lt(e))return-1;if(i.lt(t))return-2;const n=s.Fraction.minus(t,e).RealValue/s.Fraction.minus(i,e).RealValue;return Math.max(0,Math.min(99.9,this.startVolume+(this.endVolume-this.startVolume)*n))}isWedge(){return!this.label}setType(){r.isStringInStringList(r.listContinuousDynamicIncreasing,this.label)?this.dynamicType=o.crescendo:r.isStringInStringList(r.listContinuousDynamicDecreasing,this.label)&&(this.dynamicType=o.diminuendo)}}var o,a;e.ContinuousDynamicExpression=r,r.listContinuousDynamicIncreasing=["crescendo","cresc","cresc.","cres."],r.listContinuousDynamicDecreasing=["decrescendo","decresc","decr.","diminuendo","dim.","dim"],(a=o=e.ContDynamicEnum||(e.ContDynamicEnum={}))[a.crescendo=0]="crescendo",a[a.diminuendo=1]="diminuendo"},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.DrawingParameters=e.DrawingParametersEnum=e.ColoringModes=void 0;const n=i(26),s=i(3);var r,o;(o=e.ColoringModes||(e.ColoringModes={}))[o.XML=0]="XML",o[o.AutoColoring=1]="AutoColoring",o[o.CustomColorSet=2]="CustomColorSet",function(t){t.allon="allon",t.compact="compact",t.compacttight="compacttight",t.default="default",t.leadsheet="leadsheet",t.preview="preview",t.thumbnail="thumbnail"}(r=e.DrawingParametersEnum||(e.DrawingParametersEnum={})),e.DrawingParameters=class{constructor(t=r.default){this.rules=new n.EngravingRules,this.drawTitle=!0,this.drawSubtitle=!0,this.drawLyricist=!0,this.drawComposer=!0,this.drawCredits=!0,this.drawPartNames=!0,this.fingeringPosition=s.PlacementEnum.Left,this.drawHiddenNotes=!1,this.DrawingParametersEnum=t}set DrawingParametersEnum(t){switch(this.drawingParametersEnum=t,t){case r.allon:this.setForAllOn();break;case r.thumbnail:this.setForThumbnail();break;case r.leadsheet:this.setForLeadsheet();break;case r.compact:this.setForCompactMode();break;case r.compacttight:this.setForCompactTightMode();break;case r.default:default:this.setForDefault()}}get DrawingParametersEnum(){return this.drawingParametersEnum}setForAllOn(){this.drawHighlights=!0,this.drawErrors=!0,this.drawSelectionStartSymbol=!0,this.drawSelectionEndSymbol=!0,this.drawCursors=!0,this.drawActivitySymbols=!0,this.drawScrollIndicator=!0,this.drawComments=!0,this.drawMarkedAreas=!0,this.DrawTitle=!0,this.DrawSubtitle=!0,this.DrawComposer=!0,this.DrawLyricist=!0,this.drawCredits=!0,this.DrawPartNames=!0,this.drawHiddenNotes=!0,this.rules.CompactMode=!1}setForDefault(){this.rules.loadDefaultValues(),this.setForAllOn(),this.drawHiddenNotes=!1}setForThumbnail(){this.drawHighlights=!1,this.drawErrors=!1,this.drawSelectionStartSymbol=!1,this.drawSelectionStartSymbol=!1,this.drawCursors=!1,this.drawActivitySymbols=!1,this.drawScrollIndicator=!1,this.drawComments=!0,this.drawMarkedAreas=!0,this.drawHiddenNotes=!1}setForCompactMode(){this.rules.CompactMode=!0,this.DrawCredits=!1,this.drawHiddenNotes=!1}setForCompactTightMode(){this.setForCompactMode(),this.DrawPartNames=!1,this.rules.VoiceSpacingMultiplierVexflow=.65,this.rules.VoiceSpacingAddendVexflow=2,this.rules.MinSkyBottomDistBetweenStaves=1,this.rules.MinSkyBottomDistBetweenSystems=1,this.rules.BetweenStaffDistance=2.5,this.rules.StaffDistance=3.5,this.rules.MinimumDistanceBetweenSystems=1,this.rules.PageBottomMargin=0,this.rules.PageLeftMargin=2,this.rules.PageRightMargin=2}setForLeadsheet(){this.drawHighlights=!1,this.drawErrors=!1,this.drawSelectionStartSymbol=!0,this.drawSelectionEndSymbol=!0,this.drawCursors=!0,this.drawActivitySymbols=!1,this.drawScrollIndicator=!0,this.drawComments=!0,this.drawMarkedAreas=!0}get DrawCredits(){return this.drawCredits}set DrawCredits(t){this.drawCredits=t,this.DrawComposer=t,this.DrawTitle=t,this.DrawSubtitle=t,this.DrawLyricist=t}get DrawTitle(){return this.drawTitle}set DrawTitle(t){this.drawTitle=t,this.rules.RenderTitle=t,t||(this.DrawSubtitle=!1)}get DrawSubtitle(){return this.drawSubtitle}set DrawSubtitle(t){this.drawSubtitle=t,this.rules.RenderSubtitle=t,t&&(this.DrawTitle=!0)}get DrawComposer(){return this.drawComposer}set DrawComposer(t){this.drawComposer=t,this.rules.RenderComposer=t}get DrawLyricist(){return this.drawLyricist}set DrawLyricist(t){this.drawLyricist=t,this.rules.RenderLyricist=t}get DrawPartNames(){return this.drawPartNames}set DrawPartNames(t){this.drawPartNames=t,this.rules.RenderPartNames=t,this.rules.RenderPartNames||(this.rules.RenderPartAbbreviations=!1)}get FingeringPosition(){return this.fingeringPosition}set FingeringPosition(t){this.fingeringPosition=t,this.rules.FingeringPosition=t}get Rules(){return this.rules}set Rules(t){this.rules=t}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.CollectionUtil=void 0,Array.prototype.last||(Array.prototype.last=function(){return this[this.length-1]}),Array.prototype.clear||(Array.prototype.clear=function(){this.length=0}),Array.prototype.contains||(Array.prototype.contains=function(t){return-1!==this.indexOf(t)}),e.CollectionUtil=class{static contains2(t,e){for(let i=0;i<t.length;i++)if(t[i]===e)return!0;return!1}static last(t){return t[t.length-1]}static removeDictElementIfTrue(t,e,i){const n=[];e.forEach((function(e,s){i(t,e,s)&&n.push(e)}));for(let s=0;s<n.length;s++)e.remove(n[s])}static getLastElement(t){return t[t.length-1]}static binarySearch(t,e,i,n=0,s=t.length-1){let r=1;for(;n<s;){r=Math.floor((n+s)/2);const o=i(t[r],e);if(0===o)return r;o<0&&(n=r+1),0<o&&(s=r)}return-r}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(10);function s(t,e,i){for(var s=i||n.defaultEquals,r=t.length,o=0;o<r;o++)if(s(t[o],e))return o;return-1}e.indexOf=s,e.lastIndexOf=function(t,e,i){for(var s=i||n.defaultEquals,r=t.length-1;r>=0;r--)if(s(t[r],e))return r;return-1},e.contains=function(t,e,i){return s(t,e,i)>=0},e.remove=function(t,e,i){var n=s(t,e,i);return!(n<0||(t.splice(n,1),0))},e.frequency=function(t,e,i){for(var s=i||n.defaultEquals,r=t.length,o=0,a=0;a<r;a++)s(t[a],e)&&o++;return o},e.equals=function(t,e,i){var s=i||n.defaultEquals;if(t.length!==e.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!s(t[o],e[o]))return!1;return!0},e.copy=function(t){return t.concat()},e.swap=function(t,e,i){if(e<0||e>=t.length||i<0||i>=t.length)return!1;var n=t[e];return t[e]=t[i],t[i]=n,!0},e.toString=function(t){return"["+t.toString()+"]"},e.forEach=function(t,e){for(var i=0,n=t;i<n.length;i++)if(!1===e(n[i]))return}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.Appearance=e.Note=void 0;const n=i(0);var s;e.Note=class{constructor(t,e,i,n,s,r){this.slurs=[],this.playbackInstrumentId=void 0,this.notehead=void 0,this.printObject=!0,this.voiceEntry=t,this.parentStaffEntry=e,this.length=i,this.pitch=n,this.sourceMeasure=s,this.isRestFlag=null!=r&&r,this.halfTone=n?n.getHalfTone():0}get NoteAsString(){return this.pitch.toString()}get ParentVoiceEntry(){return this.voiceEntry}set ParentVoiceEntry(t){this.voiceEntry=t}get ParentStaffEntry(){return this.parentStaffEntry}get ParentStaff(){return this.parentStaffEntry.ParentStaff}get Length(){return this.length}set Length(t){this.length=t}get SourceMeasure(){return this.sourceMeasure}get TypeLength(){return this.typeLength}set TypeLength(t){this.typeLength=t}get NoteTypeXml(){return this.noteTypeXml}set NoteTypeXml(t){this.noteTypeXml=t}get NormalNotes(){return this.normalNotes}set NormalNotes(t){this.normalNotes=t}get Pitch(){return this.pitch}get NoteBeam(){return this.beam}set NoteBeam(t){this.beam=t}set Notehead(t){this.notehead=t}get Notehead(){return this.notehead}get NoteTuplet(){return this.tuplet}set NoteTuplet(t){this.tuplet=t}get NoteTie(){return this.tie}set NoteTie(t){this.tie=t}get NoteSlurs(){return this.slurs}set NoteSlurs(t){this.slurs=t}get PlaybackInstrumentId(){return this.playbackInstrumentId}set PlaybackInstrumentId(t){this.playbackInstrumentId=t}get PrintObject(){return this.printObject}set PrintObject(t){this.printObject=t}get Arpeggio(){return this.arpeggio}set Arpeggio(t){this.arpeggio=t}get IsCueNote(){return this.isCueNote}set IsCueNote(t){this.isCueNote=t}get StemDirectionXml(){return this.stemDirectionXml}set StemDirectionXml(t){this.stemDirectionXml=t}get TremoloStrokes(){return this.tremoloStrokes}set TremoloStrokes(t){this.tremoloStrokes=t}get StemColorXml(){return this.stemColorXml}set StemColorXml(t){this.stemColorXml=t}get NoteheadColorXml(){return this.noteheadColorXml}set NoteheadColorXml(t){this.noteheadColorXml=t}get NoteheadColor(){return this.noteheadColor}set NoteheadColor(t){this.noteheadColor=t}get NoteheadColorCurrentlyRendered(){return this.noteheadColorCurrentlyRendered}set NoteheadColorCurrentlyRendered(t){this.noteheadColorCurrentlyRendered=t}isRest(){return this.isRestFlag}isWholeRest(){return this.isRest()&&this.Length.RealValue===this.sourceMeasure.ActiveTimeSignature.RealValue}ToString(){return this.pitch?this.Pitch.ToString()+", length: "+this.length.toString():"rest note, length: "+this.length.toString()}getAbsoluteTimestamp(){return n.Fraction.plus(this.voiceEntry.Timestamp,this.sourceMeasure.AbsoluteTimestamp)}checkForDoubleSlur(t){for(let e=0,i=this.slurs.length;e<i;++e){const i=this.slurs[e];if(void 0!==i.StartNote&&void 0!==i.EndNote&&void 0!==t.StartNote&&t.StartNote===i.StartNote&&i.EndNote===this)return!0}return!1}},(s=e.Appearance||(e.Appearance={}))[s.Normal=0]="Normal",s[s.Grace=1]="Grace",s[s.Cue=2]="Cue"},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.TempoEnum=e.InstantaneousTempoExpression=void 0;const n=i(55),s=i(11),r=i(0);class o extends n.AbstractTempoExpression{constructor(t,e,i,n,s,r=!1){super(t,e,i,s),this.setTempoAndTempoType(n)}static getDefaultValueForTempoType(t){switch(t){case a.larghissimo:return 20;case a.grave:return 30;case a.lento:return 48;case a.largo:return 52;case a.larghetto:return 63;case a.adagio:return 70;case a.adagietto:return 75;case a.andanteModerato:return 88;case a.andante:return 92;case a.andantino:return 96;case a.moderato:return 106;case a.allegretto:return 112;case a.allegroModerato:return 118;case a.allegro:return 130;case a.vivace:return 140;case a.vivacissimo:return 155;case a.allegrissimo:return 170;case a.presto:return 184;case a.prestissimo:return 200;default:throw new s.ArgumentOutOfRangeException("tempoEnum")}}static isInputStringInstantaneousTempo(t){return!!t&&(o.isStringInStringList(o.listInstantaneousTempoLarghissimo,t)||o.isStringInStringList(o.listInstantaneousTempoGrave,t)||o.isStringInStringList(o.listInstantaneousTempoLento,t)||o.isStringInStringList(o.listInstantaneousTempoLargo,t)||o.isStringInStringList(o.listInstantaneousTempoLarghetto,t)||o.isStringInStringList(o.listInstantaneousTempoAdagio,t)||o.isStringInStringList(o.listInstantaneousTempoAdagietto,t)||o.isStringInStringList(o.listInstantaneousTempoAndanteModerato,t)||o.isStringInStringList(o.listInstantaneousTempoAndante,t)||o.isStringInStringList(o.listInstantaneousTempoAndantino,t)||o.isStringInStringList(o.listInstantaneousTempoModerato,t)||o.isStringInStringList(o.listInstantaneousTempoAllegretto,t)||o.isStringInStringList(o.listInstantaneousTempoAllegroModerato,t)||o.isStringInStringList(o.listInstantaneousTempoAllegro,t)||o.isStringInStringList(o.listInstantaneousTempoVivace,t)||o.isStringInStringList(o.listInstantaneousTempoVivacissimo,t)||o.isStringInStringList(o.listInstantaneousTempoAllegrissimo,t)||o.isStringInStringList(o.listInstantaneousTempoPresto,t)||o.isStringInStringList(o.listInstantaneousTempoPrestissimo,t)||o.isStringInStringList(o.listInstantaneousTempoChangesGeneral,t))}get Label(){return this.label}set Label(t){this.label=t}get Placement(){return this.placement}set Placement(t){this.placement=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get Enum(){return this.tempoEnum}get TempoInBpm(){return this.tempoInBpm}set TempoInBpm(t){this.tempoInBpm=t}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}getAbsoluteTimestamp(){return r.Fraction.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp)}getAbsoluteFloatTimestamp(){return r.Fraction.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp).RealValue}setTempoAndTempoType(t){return this.label?o.isStringInStringList(o.listInstantaneousTempoLarghissimo,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.larghissimo)),this.tempoInBpm=t,void(this.tempoEnum=a.larghissimo)):o.isStringInStringList(o.listInstantaneousTempoGrave,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.grave)),this.tempoInBpm=t,void(this.tempoEnum=a.grave)):o.isStringInStringList(o.listInstantaneousTempoLento,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.lento)),this.tempoInBpm=t,void(this.tempoEnum=a.lento)):o.isStringInStringList(o.listInstantaneousTempoLargo,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.largo)),this.tempoInBpm=t,void(this.tempoEnum=a.largo)):o.isStringInStringList(o.listInstantaneousTempoLarghetto,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.larghetto)),this.tempoInBpm=t,void(this.tempoEnum=a.larghetto)):o.isStringInStringList(o.listInstantaneousTempoAdagio,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.adagio)),this.tempoInBpm=t,void(this.tempoEnum=a.adagio)):o.isStringInStringList(o.listInstantaneousTempoAdagietto,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.adagietto)),this.tempoInBpm=t,void(this.tempoEnum=a.adagietto)):o.isStringInStringList(o.listInstantaneousTempoAndanteModerato,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.andanteModerato)),this.tempoInBpm=t,void(this.tempoEnum=a.andanteModerato)):o.isStringInStringList(o.listInstantaneousTempoAndante,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.andante)),this.tempoInBpm=t,void(this.tempoEnum=a.andante)):o.isStringInStringList(o.listInstantaneousTempoAndantino,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.andantino)),this.tempoInBpm=t,void(this.tempoEnum=a.andantino)):o.isStringInStringList(o.listInstantaneousTempoModerato,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.moderato)),this.tempoInBpm=t,void(this.tempoEnum=a.moderato)):o.isStringInStringList(o.listInstantaneousTempoAllegretto,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.allegretto)),this.tempoInBpm=t,void(this.tempoEnum=a.allegretto)):o.isStringInStringList(o.listInstantaneousTempoAllegroModerato,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.allegroModerato)),this.tempoInBpm=t,void(this.tempoEnum=a.allegroModerato)):o.isStringInStringList(o.listInstantaneousTempoAllegro,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.allegro)),this.tempoInBpm=t,void(this.tempoEnum=a.allegro)):o.isStringInStringList(o.listInstantaneousTempoVivace,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.vivace)),this.tempoInBpm=t,void(this.tempoEnum=a.vivace)):o.isStringInStringList(o.listInstantaneousTempoVivacissimo,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.vivacissimo)),this.tempoInBpm=t,void(this.tempoEnum=a.vivacissimo)):o.isStringInStringList(o.listInstantaneousTempoAllegrissimo,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.allegrissimo)),this.tempoInBpm=t,void(this.tempoEnum=a.allegrissimo)):o.isStringInStringList(o.listInstantaneousTempoPresto,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.presto)),this.tempoInBpm=t,void(this.tempoEnum=a.presto)):o.isStringInStringList(o.listInstantaneousTempoPrestissimo,this.label)?(0===t&&(t=o.getDefaultValueForTempoType(a.prestissimo)),this.tempoInBpm=t,void(this.tempoEnum=a.prestissimo)):o.isStringInStringList(o.listInstantaneousTempoAddons,this.label)?(this.tempoInBpm=0,void(this.tempoEnum=a.addon)):o.isStringInStringList(o.listInstantaneousTempoChangesGeneral,this.label)?(this.tempoInBpm=0,void(this.tempoEnum=a.changes)):void 0:(this.tempoInBpm=t,void(this.tempoEnum=a.metronomeMark))}}var a,l;e.InstantaneousTempoExpression=o,o.listInstantaneousTempoLarghissimo=["Larghissimo","Sehr breit","very, very slow"],o.listInstantaneousTempoGrave=["Grave","Schwer","slow and solemn"],o.listInstantaneousTempoLento=["Lento","Lent","Langsam","slowly"],o.listInstantaneousTempoLargo=["Largo","Breit","broadly"],o.listInstantaneousTempoLarghetto=["Larghetto","Etwas breit","rather broadly"],o.listInstantaneousTempoAdagio=["Adagio","Langsam","Ruhig","slow and stately"],o.listInstantaneousTempoAdagietto=["Adagietto","Ziemlich ruhig","Ziemlich langsam","rather slow"],o.listInstantaneousTempoAndanteModerato=["Andante moderato"],o.listInstantaneousTempoAndante=["Andante","Gehend","Schreitend","at a walking pace"],o.listInstantaneousTempoAndantino=["Andantino"],o.listInstantaneousTempoModerato=["Moderato","Mäßig","Mod�r�","moderately"],o.listInstantaneousTempoAllegretto=["Allegretto","fast"],o.listInstantaneousTempoAllegroModerato=["Allegro moderato"],o.listInstantaneousTempoAllegro=["Allegro","Rapide","Vite","Rasch","Schnell","Fr�hlich"],o.listInstantaneousTempoVivace=["Vivace","Lebhaft","Lebendig","lively and fast"],o.listInstantaneousTempoVivacissimo=["Vivacissimo","Sehr lebhaft","Sehr lebendig"],o.listInstantaneousTempoAllegrissimo=["Allegrissimo","very fast"],o.listInstantaneousTempoPresto=["Presto","Sehr schnell","Geschwind"],o.listInstantaneousTempoPrestissimo=["Prestissimo","äußerst schnell"],o.listInstantaneousTempoChangesGeneral=["tempo primo","a tempo","tempo i","rubato","doppio movimento"],o.listInstantaneousTempoAddons=["assai","amoroso","cantabile","con brio","con dolore","con espressione","con fuoco","con moto","con spirito","spiritoso","espressivo","giocoso","giusto","grazioso","lesto","lugubre","maestoso","ma non troppo","marcato","molto","morendo","mosso","non tanto","piu","un poco","poco","quasi","risoluto","scherzando","sostenuto","teneramente","tempo giusto","tranquillo","sehr","lieblich","liebevoll","mit Leidenschaft","mit Liebe","amourös","gesanglich","mit Schwung","mit Feuer","mit Schmerz","mit Ausdruck","mit Bewegung","geistvoll","ausdrucksvoll","freudig","verspielt","angemessen","graziös","mit Grazie","flink","behände","traurig","klagend","majestätisch","aber nicht zu sehr","markant","gemäßigt","viel","sehr","ersterbend","bewegt","nicht zu sehr","mehr","ein wenig","gleichsam","entschlossen","zupackend","heiter","nachdrücklich","getragen","gewichtig","zart","zärtlich","im angemessenen Zeitmaß","ruhig","ein wenig","alla marcia","ad libitum","alla breve"],(l=a=e.TempoEnum||(e.TempoEnum={}))[l.none=0]="none",l[l.larghissimo=1]="larghissimo",l[l.grave=2]="grave",l[l.lento=3]="lento",l[l.largo=4]="largo",l[l.larghetto=5]="larghetto",l[l.adagio=6]="adagio",l[l.adagietto=7]="adagietto",l[l.andanteModerato=8]="andanteModerato",l[l.andante=9]="andante",l[l.andantino=10]="andantino",l[l.moderato=11]="moderato",l[l.allegretto=12]="allegretto",l[l.allegroModerato=13]="allegroModerato",l[l.allegro=14]="allegro",l[l.vivace=15]="vivace",l[l.vivacissimo=16]="vivacissimo",l[l.allegrissimo=17]="allegrissimo",l[l.presto=18]="presto",l[l.prestissimo=19]="prestissimo",l[l.lastRealTempo=20]="lastRealTempo",l[l.addon=21]="addon",l[l.changes=22]="changes",l[l.metronomeMark=23]="metronomeMark"},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.DynamicEnum=e.InstantaneousDynamicExpression=void 0;const s=i(3),r=i(94),o=i(11),a=n(i(1)),l=i(15);class h extends s.AbstractExpression{constructor(t,e,i,n,s){super(i),super.parentMeasure=s,this.dynamicEnum=c[t.toLowerCase()],this.soundDynamic=e,this.staffNumber=n}static staticConstructor(){h.dynamicToRelativeVolumeDict.setValue(c.ffffff,1),h.dynamicToRelativeVolumeDict.setValue(c.fffff,126/127),h.dynamicToRelativeVolumeDict.setValue(c.ffff,125/127),h.dynamicToRelativeVolumeDict.setValue(c.fff,124/127),h.dynamicToRelativeVolumeDict.setValue(c.ff,122/127),h.dynamicToRelativeVolumeDict.setValue(c.f,108/127),h.dynamicToRelativeVolumeDict.setValue(c.mf,76/127),h.dynamicToRelativeVolumeDict.setValue(c.sf,.5),h.dynamicToRelativeVolumeDict.setValue(c.sfp,.5),h.dynamicToRelativeVolumeDict.setValue(c.sfpp,.5),h.dynamicToRelativeVolumeDict.setValue(c.fp,.5),h.dynamicToRelativeVolumeDict.setValue(c.rf,.5),h.dynamicToRelativeVolumeDict.setValue(c.rfz,.5),h.dynamicToRelativeVolumeDict.setValue(c.sfz,.5),h.dynamicToRelativeVolumeDict.setValue(c.sffz,.5),h.dynamicToRelativeVolumeDict.setValue(c.fz,.5),h.dynamicToRelativeVolumeDict.setValue(c.mp,60/127),h.dynamicToRelativeVolumeDict.setValue(c.p,28/127),h.dynamicToRelativeVolumeDict.setValue(c.pp,12/127),h.dynamicToRelativeVolumeDict.setValue(c.ppp,10/127),h.dynamicToRelativeVolumeDict.setValue(c.pppp,7/127),h.dynamicToRelativeVolumeDict.setValue(c.ppppp,5/127),h.dynamicToRelativeVolumeDict.setValue(c.pppppp,4/127)}get ParentMultiExpression(){return this.multiExpression}set ParentMultiExpression(t){this.multiExpression=t}get DynEnum(){return this.dynamicEnum}set DynEnum(t){this.dynamicEnum=t}get SoundDynamic(){return this.soundDynamic}set SoundDynamic(t){this.soundDynamic=t}get Placement(){return this.placement}set Placement(t){this.placement=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get Length(){return Math.abs(this.length)<1e-4&&(this.length=this.calculateLength()),this.length}get MidiVolume(){return 127*this.Volume}get Volume(){return h.dynamicToRelativeVolumeDict.getValue(this.dynamicEnum)}static isInputStringInstantaneousDynamic(t){return!!t&&h.isStringInStringList(h.listInstantaneousDynamics,t)}getDynamicExpressionSymbol(t){switch(t){case"p":return r.DynamicExpressionSymbolEnum.p;case"f":return r.DynamicExpressionSymbolEnum.f;case"s":return r.DynamicExpressionSymbolEnum.s;case"z":return r.DynamicExpressionSymbolEnum.z;case"m":return r.DynamicExpressionSymbolEnum.m;case"r":return r.DynamicExpressionSymbolEnum.r;default:throw new o.InvalidEnumArgumentException("unknown DynamicExpressionSymbolEnum: "+t)}}calculateLength(){return a.default.debug("[Andrea] instantaneousDynamicExpression: not implemented: calculateLength!"),0}}var c,u;e.InstantaneousDynamicExpression=h,h.dynamicToRelativeVolumeDict=new l.Dictionary,h.listInstantaneousDynamics=["pppppp","ppppp","pppp","ppp","pp","p","ffffff","fffff","ffff","fff","ff","f","mf","mp","sf","sff","sp","spp","fp","rf","rfz","sfz","sffz","fz"],(u=c=e.DynamicEnum||(e.DynamicEnum={}))[u.pppppp=0]="pppppp",u[u.ppppp=1]="ppppp",u[u.pppp=2]="pppp",u[u.ppp=3]="ppp",u[u.pp=4]="pp",u[u.p=5]="p",u[u.mp=6]="mp",u[u.mf=7]="mf",u[u.f=8]="f",u[u.ff=9]="ff",u[u.fff=10]="fff",u[u.ffff=11]="ffff",u[u.fffff=12]="fffff",u[u.ffffff=13]="ffffff",u[u.sf=14]="sf",u[u.sff=15]="sff",u[u.sfp=16]="sfp",u[u.sfpp=17]="sfpp",u[u.fp=18]="fp",u[u.rf=19]="rf",u[u.rfz=20]="rfz",u[u.sfz=21]="sfz",u[u.sffz=22]="sffz",u[u.fz=23]="fz",u[u.other=24]="other",h.staticConstructor()},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.NoteTypeHandler=e.NoteType=void 0;const n=i(0),s=i(20),r=i(11);var o,a;(a=o=e.NoteType||(e.NoteType={}))[a.UNDEFINED=0]="UNDEFINED",a[a._1024th=1]="_1024th",a[a._512th=2]="_512th",a[a._256th=3]="_256th",a[a._128th=4]="_128th",a[a._64th=5]="_64th",a[a._32nd=6]="_32nd",a[a._16th=7]="_16th",a[a.EIGTH=8]="EIGTH",a[a.QUARTER=9]="QUARTER",a[a.HALF=10]="HALF",a[a.WHOLE=11]="WHOLE",a[a.BREVE=12]="BREVE",a[a.LONG=13]="LONG",a[a.MAXIMA=14]="MAXIMA";class l{static NoteTypeToString(t){return this.NoteTypeXmlValues[t]}static StringToNoteType(t){const e=this.NoteTypeXmlValues.indexOf(t);return-1!==e?e:o.UNDEFINED}static getNoteDurationFromType(t){switch(t){case"1024th":return new n.Fraction(1,1024);case"512th":return new n.Fraction(1,512);case"256th":return new n.Fraction(1,256);case"128th":return new n.Fraction(1,128);case"64th":return new n.Fraction(1,64);case"32th":case"32nd":return new n.Fraction(1,32);case"16th":return new n.Fraction(1,16);case"eighth":return new n.Fraction(1,8);case"quarter":return new n.Fraction(1,4);case"half":return new n.Fraction(1,2);case"whole":return new n.Fraction(1,1);case"breve":return new n.Fraction(2,1);case"long":return new n.Fraction(4,1);case"maxima":return new n.Fraction(8,1);default:{const t=s.ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid note duration.");throw new r.MusicSheetReadingException(t)}}}}e.NoteTypeHandler=l,l.NoteTypeXmlValues=["","1024th","512th","256th","128th","64th","32nd","16th","eigth","quarter","half","whole","breve","long","maxima"]},function(t,e,i){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.SystemLinePosition=void 0,(n=e.SystemLinePosition||(e.SystemLinePosition={}))[n.MeasureBegin=0]="MeasureBegin",n[n.MeasureEnd=1]="MeasureEnd"},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedVoice=void 0;const n=i(51);class s extends n.Voice{constructor(t,e,i){super(t,e),this.master=i}get Master(){return this.master}}e.LinkedVoice=s},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractGraphicalExpression=void 0;const n=i(6),s=i(5);class r extends n.GraphicalObject{constructor(t,e,i){super(),this.expression=e,this.parentMeasure=i,this.boundingBox=new s.BoundingBox(this,t.PositionAndShape),this.parentStaffLine=t,this.parentStaffLine.AbstractExpressions.push(this),this.rules=t.ParentMusicSystem.rules}get Label(){return this.label}get ParentStaffLine(){return this.parentStaffLine}get SourceExpression(){return this.expression}get Placement(){return this.expression.Placement}}e.AbstractGraphicalExpression=r},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(n){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.StavePositionEnum=e.VexFlowMeasure=void 0;const s=n(i(8)),r=i(122),o=i(23),a=i(7),l=i(13);var h=s.default.Flow.NoteSubGroup;const c=n(i(1)),u=i(16),d=i(28),f=i(40),p=i(14),m=i(62),b=i(0),g=i(41),y=i(3),S=i(39);class v extends r.GraphicalMeasure{constructor(t,e,i){super(t,e,i),this.isTabMeasure=!1,this.octaveOffset=3,this.vfVoices={},this.vfTies=[],this.vfRepetitionWords=[],this.connectors=[],this.beams={},this.tuplets={},this.vftuplets={},this.minimumStaffEntriesWidth=-1,i?this.rules=i.ParentMusicSystem.rules:e&&(this.rules=e.Rules),this.resetLayout()}setAbsoluteCoordinates(t,e){this.stave.setX(t).setY(e)}resetLayout(){this.stave=new s.default.Flow.Stave(0,0,0,{fill_style:this.rules.StaffLineColor,space_above_staff_ln:0,space_below_staff_ln:0}),this.stave.MeasureNumber=this.MeasureNumber,this.ParentStaff&&this.setLineNumber(this.ParentStaff.StafflineCount),this.stave.setBegBarType(s.default.Flow.Barline.type.NONE),this.parentSourceMeasure&&this.parentSourceMeasure.endingBarStyleEnum===o.SystemLinesEnum.None&&this.stave.setEndBarType(s.default.Flow.Barline.type.NONE),this.updateInstructionWidth()}clean(){this.vfTies.length=0,this.connectors=[],this.resetLayout()}getLineWidth(t){switch(t){case o.SystemLinesEnum.BoldThinDots:case o.SystemLinesEnum.DotsThinBold:case o.SystemLinesEnum.DotsBoldBoldDots:return 10/u.unitInPixels;default:return 0}}addClefAtBegin(t){if(this.octaveOffset=t.OctaveOffset,t.ClefType===a.ClefEnum.TAB)this.stave.addClef("tab",void 0,void 0,void 0);else{const e=l.VexFlowConverter.Clef(t,"default");this.stave.addClef(e.type,e.size,e.annotation,s.default.Flow.StaveModifier.Position.BEGIN)}this.updateInstructionWidth()}setLineNumber(t){5!==t&&(0===t?(this.stave.setNumLines(0),this.stave.getBottomLineY=function(){return this.getYForLine(this.options.num_lines)}):1===t?(this.stave.options.line_config=[{visible:!1},{visible:!1},{visible:!0},{visible:!1},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(2)}):2===t?(this.stave.options.line_config=[{visible:!1},{visible:!1},{visible:!0},{visible:!0},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(3)}):3===t?(this.stave.options.line_config=[{visible:!1},{visible:!0},{visible:!0},{visible:!0},{visible:!1}],this.stave.getBottomLineY=function(){return this.getYForLine(2)}):(this.stave.setNumLines(t),this.stave.getBottomLineY=function(){return this.getYForLine(this.options.num_lines)}))}addKeyAtBegin(t,e,i){this.rules.RenderKeySignatures&&(this.stave.setKeySignature(l.VexFlowConverter.keySignature(t),l.VexFlowConverter.keySignature(e),void 0),this.updateInstructionWidth())}addRhythmAtBegin(t){const e=l.VexFlowConverter.TimeSignature(t);this.stave.addModifier(e,s.default.Flow.StaveModifier.Position.BEGIN),this.updateInstructionWidth()}addClefAtEnd(t,e=!0){const i=l.VexFlowConverter.Clef(t,"small");if(e||!this.stave.endClef){this.stave.setEndClef(i.type,i.size,i.annotation);for(const t of this.stave.getModifiers())if(e){const e=t.originalStrokeStyle,i=t.originalFillStyle;t.getStyle()&&(e&&i?(t.getStyle().strokeStyle=e,t.getStyle().fillStyle=i):(t.getStyle().strokeStyle=null,t.getStyle().fillStyle=null))}else if("clefs"===t.getCategory()&&t.getPosition()===s.default.Flow.StaveModifier.Position.END&&t.type===i.type){const e="#12345600",i=t.getStyle();i&&(t.originalStrokeStyle=i.strokeStyle,t.originalFillStyle=i.fillStyle),t.setStyle({strokeStyle:e,fillStyle:e})}return this.parentSourceMeasure.hasEndClef=!0,this.updateInstructionWidth()}}addMeasureLine(t,e,i=!0){switch(e){case f.SystemLinePosition.MeasureBegin:switch(t){case o.SystemLinesEnum.BoldThinDots:i||(this.stave.modifiers[0].draw=function(t){switch(t.checkContext(),this.setRendered(),this.type){case s.default.Flow.Barline.type.SINGLE:this.drawVerticalBar(t,this.x,!1);break;case s.default.Flow.Barline.type.DOUBLE:this.drawVerticalBar(t,this.x,!0);break;case s.default.Flow.Barline.type.END:this.drawVerticalEndBar(t,this.x);break;case s.default.Flow.Barline.type.REPEAT_BEGIN:this.drawRepeatBar(t,this.x,!0);break;case s.default.Flow.Barline.type.REPEAT_END:this.drawRepeatBar(t,this.x,!1);break;case s.default.Flow.Barline.type.REPEAT_BOTH:this.drawRepeatBar(t,this.x,!1),this.drawRepeatBar(t,this.x,!0)}}),this.stave.setBegBarType(s.default.Flow.Barline.type.REPEAT_BEGIN)}break;case f.SystemLinePosition.MeasureEnd:switch(t){case o.SystemLinesEnum.DotsBoldBoldDots:this.stave.setEndBarType(s.default.Flow.Barline.type.REPEAT_BOTH);break;case o.SystemLinesEnum.DotsThinBold:this.stave.setEndBarType(s.default.Flow.Barline.type.REPEAT_END);break;case o.SystemLinesEnum.DoubleThin:this.stave.setEndBarType(s.default.Flow.Barline.type.DOUBLE);break;case o.SystemLinesEnum.ThinBold:this.stave.setEndBarType(s.default.Flow.Barline.type.END);break;case o.SystemLinesEnum.None:this.stave.setEndBarType(s.default.Flow.Barline.type.NONE)}}}addMeasureNumber(){const t=this.MeasureNumber.toString(),e=x.ABOVE;this.stave.setText(t,e,{justification:1,shift_x:0,shift_y:0})}addWordRepetition(t){let e,i=s.default.Flow.StaveModifier.Position.END;const n=this.beginInstructionsWidth;switch(t.type){case d.RepetitionInstructionEnum.Segno:e=s.default.Flow.Repetition.type.SEGNO_LEFT,i=s.default.Flow.StaveModifier.Position.LEFT;break;case d.RepetitionInstructionEnum.Coda:e=s.default.Flow.Repetition.type.CODA_LEFT,i=s.default.Flow.StaveModifier.Position.LEFT;break;case d.RepetitionInstructionEnum.DaCapo:e=s.default.Flow.Repetition.type.DC;break;case d.RepetitionInstructionEnum.DalSegno:e=s.default.Flow.Repetition.type.DS;break;case d.RepetitionInstructionEnum.Fine:e=s.default.Flow.Repetition.type.FINE;break;case d.RepetitionInstructionEnum.ToCoda:e=s.default.Flow.Repetition.type.TO_CODA;break;case d.RepetitionInstructionEnum.DaCapoAlFine:e=s.default.Flow.Repetition.type.DC_AL_FINE;break;case d.RepetitionInstructionEnum.DaCapoAlCoda:e=s.default.Flow.Repetition.type.DC_AL_CODA;break;case d.RepetitionInstructionEnum.DalSegnoAlFine:e=s.default.Flow.Repetition.type.DS_AL_FINE;break;case d.RepetitionInstructionEnum.DalSegnoAlCoda:e=s.default.Flow.Repetition.type.DS_AL_CODA}if(e){const t=new s.default.Flow.Repetition(e,n,-this.rules.RepetitionSymbolsYOffset);this.stave.addModifier(t,i)}else this.addVolta(t)}addVolta(t){var e;let i=s.default.Flow.Volta.type.BEGIN;if(t.type===d.RepetitionInstructionEnum.Ending){switch(t.alignment){case d.AlignmentType.Begin:i=this.parentSourceMeasure.endsRepetitionEnding()?s.default.Flow.Volta.type.BEGIN_END:s.default.Flow.Volta.type.BEGIN;break;case d.AlignmentType.End:if(this.parentSourceMeasure.beginsRepetitionEnding())return;i=s.default.Flow.Volta.type.END}const n=this.ParentStaffLine.SkyBottomLineCalculator,r=this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginLeft+.4,o=Math.max(this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginRight,r+.4),a=n.getSkyLineMinInRange(r,o)-2;let l,h=-6.1+this.rules.VoltaOffset,c=this.rules.VoltaOffset;a<h&&(c+=a-h,h=a);const f=this.parentSourceMeasure.MeasureNumber;for(let t=0;t<this.ParentStaffLine.Measures.length;t++){const i=this.ParentStaffLine.Measures[t];i instanceof v&&(i.MeasureNumber!==f-1&&i.MeasureNumber+(null===(e=i.parentSourceMeasure)||void 0===e?void 0:e.multipleRestMeasures)!==f||(l=i))}if(l){const t=l.stave.getModifiers();for(let e=0;e<t.length;e++){const i=t[e];if(i.hasOwnProperty("volta")){const t=l.ParentStaffLine.SkyBottomLineCalculator,e=l.PositionAndShape.AbsolutePosition.x+l.PositionAndShape.BorderMarginLeft+.4,n=Math.max(l.PositionAndShape.AbsolutePosition.x+l.PositionAndShape.BorderMarginRight,e+.4),s=t.getSkyLineMinInRange(e,n);s<=h?(c+=s-h,h=s):(i.y_shift=c*u.unitInPixels,l.ParentStaffLine.SkyBottomLineCalculator.updateSkyLineInRange(e,n,h))}}}c*=10,this.stave.setVoltaType(i,t.endingIndices[0],c),n.updateSkyLineInRange(r,o,h)}}setWidth(t){super.setWidth(t),this.stave.setWidth(t*u.unitInPixels)}layoutSymbols(){}draw(t){this.stave.setContext(t).draw();for(const e in this.vfVoices)this.vfVoices.hasOwnProperty(e)&&(t.save(),this.vfVoices[e].draw(t,this.stave),t.restore());for(const e in this.vfbeams)if(this.vfbeams.hasOwnProperty(e))for(const i of this.vfbeams[e])i.setContext(t).draw();if(this.autoVfBeams)for(const e of this.autoVfBeams)e.setContext(t).draw();if(!this.isTabMeasure||this.rules.TupletNumbersInTabs){if(this.autoTupletVfBeams)for(const e of this.autoTupletVfBeams)e.setContext(t).draw();for(const e in this.vftuplets)if(this.vftuplets.hasOwnProperty(e))for(const i of this.vftuplets[e])i.setContext(t).draw()}for(const e of this.vfTies)e.setContext(t).draw();for(const e of this.connectors)e.setContext(t).draw();this.correctNotePositions()}format(){this.formatVoices&&this.formatVoices((this.PositionAndShape.Size.width-this.beginInstructionsWidth-this.endInstructionsWidth)*u.unitInPixels,this)}correctNotePositions(){if(!this.isTabMeasure)for(const t of this.getVoicesWithinMeasure())for(const e of t.VoiceEntries)for(const t of e.Notes){const e=this.rules.GNote(t),i=e.vfnote[0];let n=0;e.parentVoiceEntry.parentVoiceEntry.StemDirection===p.StemDirectionType.Up?n+=3.5:n+=.5,n+=-e.notehead(i).line+e.parentVoiceEntry.notes.last().notehead().line,e.PositionAndShape.RelativePosition.y=n}}getVoicesWithinMeasure(){const t=[];for(const e of this.staffEntries)for(const i of e.graphicalVoiceEntries)-1===t.indexOf(i.parentVoiceEntry.ParentVoice)&&t.push(i.parentVoiceEntry.ParentVoice);return t}getGraphicalVoiceEntriesPerVoice(t){const e=[];for(const i of this.staffEntries)for(const n of i.graphicalVoiceEntries)n.parentVoiceEntry.ParentVoice===t&&e.push(n);return e}getRestFilledVexFlowStaveNotesPerVoice(t){let e;const i=this.getGraphicalVoiceEntriesPerVoice(t);for(let r=0,o=i.length;r<o;++r){const t=i[r],n=t.notes[0].sourceNote.getAbsoluteTimestamp();let s=new b.Fraction;for(const e of t.notes){const t=b.Fraction.plus(e.sourceNote.getAbsoluteTimestamp(),e.sourceNote.Length);s.lt(t)&&(s=t)}if(e){const t=b.Fraction.minus(n,e);if(t.RealValue>0){c.default.trace(`Ghost Found in between (measure ${this.MeasureNumber})`);const e=l.VexFlowConverter.GhostNote(t),n=new m.VexFlowVoiceEntry(void 0,void 0);n.vfStaveNote=e,i.splice(r,0,n),r++}}else{const t=b.Fraction.minus(n,this.parentSourceMeasure.AbsoluteTimestamp);if(t.RealValue>0){c.default.trace(`Ghost Found at start (measure ${this.MeasureNumber})`);const e=l.VexFlowConverter.GhostNote(t),n=new m.VexFlowVoiceEntry(void 0,void 0);n.vfStaveNote=e,i.splice(0,0,n),r++}}e=s}const n=b.Fraction.plus(this.parentSourceMeasure.AbsoluteTimestamp,this.parentSourceMeasure.Duration),s=b.Fraction.minus(n,e);if(s.RealValue>0){c.default.trace(`Ghost Found at end (measure ${this.MeasureNumber})`);const t=l.VexFlowConverter.GhostNote(s),e=new m.VexFlowVoiceEntry(void 0,void 0);e.vfStaveNote=t,i.push(e)}return i}handleBeam(t,e){const i=t.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;let n,s=this.beams[i];s||(s=this.beams[i]=[]);for(const o of s)o[0]===e&&(n=o);n||(n=[e,[]],s.push(n));const r=t.parentVoiceEntry;n[1].indexOf(r)<0&&n[1].push(r)}handleTuplet(t,e){const i=t.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;e=t.sourceNote.NoteTuplet;let n,s=this.tuplets[i];s||(s=this.tuplets[i]=[]);for(const o of s)o[0]===e&&(n=o);n||(n=[e,[]],s.push(n));const r=t.parentVoiceEntry;n[1].indexOf(r)<0&&n[1].push(r)}finalizeBeams(){this.vfbeams={};const t=[];for(const e in this.beams)if(this.beams.hasOwnProperty(e)){let i=this.vfbeams[e];i||(i=this.vfbeams[e]=[]);for(const n of this.beams[e]){let e=!1;for(const t of n[0].Notes)if(t.Length.RealValue>=new b.Fraction(1,4).RealValue&&(!t.TypeLength||t.TypeLength.RealValue>.125)){e=!0;break}if(e){c.default.debug("Beam between note >= quarter, likely tremolo, currently unsupported. continuing.");continue}const r=[],o=n[0],a=n[1];let l=!0;for(const t of a)t.parentVoiceEntry.ParentVoice===o.Notes[0].ParentVoiceEntry.ParentVoice&&(l=t.parentVoiceEntry.WantedStemDirection===p.StemDirectionType.Undefined);let h,u=!1;const d=[];for(const i of a){const e=i.vfStaveNote;e&&(r.push(e),t.push(e)),i.parentVoiceEntry.IsGrace&&(u=!0),i.parentVoiceEntry.StemColor&&this.rules.ColoringEnabled&&d.push(i.parentVoiceEntry.StemColor)}if(r.length>1){const t=new s.default.Flow.Beam(r,l);if(u&&(t.render_options.beam_width=3,t.render_options.partial_beam_length=4),d.length>=2&&this.rules.ColorBeams){h=d[0];for(const t of d)if(t!==h){h=void 0;break}t.setStyle({fillStyle:h,strokeStyle:h})}this.rules.FlatBeams&&(t.render_options.flat_beams=!0,t.render_options.flat_beam_offset=this.rules.FlatBeamOffset,t.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),i.push(t)}else c.default.debug("Warning! Beam with no notes!")}}this.rules.AutoBeamNotes&&this.autoBeamNotes(t)}autoBeamNotes(t){let e,i=[],n=[],r=[];this.autoTupletVfBeams=[];const o=[];this.autoVfBeams=[];let a=this.parentSourceMeasure.ActiveTimeSignature;a||(a=this.parentSourceMeasure.Duration);for(const c of this.staffEntries)for(const l of c.graphicalVoiceEntries){const h=l.vfStaveNote,u=l.notes[0],d=c.relInMeasureTimestamp.isOnBeat(a),f=n.length>=2,p=u.sourceNote.Length.RealValue-new b.Fraction(1,4).RealValue>-b.Fraction.FloatInaccuracyTolerance,m=l.parentVoiceEntry.IsGrace||p||t.contains(h);if(m||d){if(f){for(const t of n)i.push(t);o.push(i.slice()),i=[]}if(n=[],m)continue}const g=l.notes[0].sourceNote.NoteTuplet;if(g){let t=!1;for(const e of g.Notes){for(const i of e)if(i.NoteTypeXml>=S.NoteType.QUARTER||i.ParentVoiceEntry.IsGrace||i.isRest()&&!this.rules.AutoBeamOptions.beam_rests){t=!0;break}if(t)break}if(e){if(e!==g){if(r.length>1){const t=new s.default.Flow.Beam(r,!0);this.rules.FlatBeams&&(t.render_options.flat_beams=!0,t.render_options.flat_beam_offset=this.rules.FlatBeamOffset,t.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(t)}r=[],e=g}}else e=g;t||r.push(h)}else e=void 0,n.push(h)}if(r.length>=2){const t=new s.default.Flow.Beam(r,!0);this.rules.FlatBeams&&(t.render_options.flat_beams=!0,t.render_options.flat_beam_offset=this.rules.FlatBeamOffset,t.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(t)}if(n.length>=2){for(const t of n)i.push(t);o.push(i)}const l=this.rules.AutoBeamOptions,h={beam_middle_only:l.beam_middle_rests_only,beam_rests:l.beam_rests,maintain_stem_directions:l.maintain_stem_directions};if(l.groups&&l.groups.length){const t=[];for(const e of l.groups)t.push(new s.default.Flow.Fraction(e[0],e[1]));h.groups=t}for(const c of o){const t=s.default.Flow.Beam.generateBeams(c,h);for(const e of t)this.rules.FlatBeams&&(e.render_options.flat_beams=!0,e.render_options.flat_beam_offset=this.rules.FlatBeamOffset,e.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoVfBeams.push(e)}}finalizeTuplets(){this.vftuplets={};for(const t in this.tuplets)if(this.tuplets.hasOwnProperty(t)){let e=this.vftuplets[t];e||(e=this.vftuplets[t]=[]);for(const i of this.tuplets[t]){const t=[],n=i[1];for(const e of n)t.push(e.vfStaveNote);if(t.length>1){const n=i[0],r=n.Notes[0][0].NormalNotes,o=n.Bracket||3===n.TupletLabelNumber&&this.rules.TripletsBracketed||3!==n.TupletLabelNumber&&this.rules.TupletsBracketed;let a=s.default.Flow.Tuplet.LOCATION_TOP;n.tupletLabelNumberPlacement===y.PlacementEnum.Below&&(a=s.default.Flow.Tuplet.LOCATION_BOTTOM),e.push(new s.default.Flow.Tuplet(t,{bracketed:o,location:a,notes_occupied:r,num_notes:n.TupletLabelNumber,ratioed:this.rules.TupletsRatioed}))}else c.default.debug("Warning! Tuplet with no notes! Trying to ignore, but this is a serious problem.")}}}layoutStaffEntry(t){}graphicalMeasureCreatedCalculations(){let t,e=[];const i=[];for(const r of this.staffEntries){t=!1,e=[];for(const n of r.graphicalVoiceEntries)if(n.parentVoiceEntry.IsGrace)e.push(n),i.push(n),t||(t=n.parentVoiceEntry.GraceSlur);else if(n.notes[0].sourceNote.PrintObject,n.vfStaveNote=l.VexFlowConverter.StaveNote(n),e.length>0){const i=[];for(let t=0;t<e.length;t++){const n=e[t],s=l.VexFlowConverter.StaveNote(n);n.vfStaveNote=s,i.push(s)}const r=new s.default.Flow.GraceNoteGroup(i,t);n.vfStaveNote.addModifier(0,r),e=[]}}if(e.length>0)for(const s of e)s.vfStaveNote=l.VexFlowConverter.StaveNote(s),s.parentVoiceEntry.GraceAfterMainNote=!0;this.finalizeBeams(),this.finalizeTuplets();const n=this.getVoicesWithinMeasure();if(this.rules.RenderFingerings)for(const s of this.staffEntries)s.setModifierXOffsets();for(const r of n){if(!r)continue;const t=!(r instanceof g.LinkedVoice);this.vfVoices[r.VoiceId]=new s.default.Flow.Voice({beat_value:this.parentSourceMeasure.Duration.Denominator,num_beats:this.parentSourceMeasure.Duration.Numerator,resolution:s.default.Flow.RESOLUTION}).setMode(s.default.Flow.Voice.Mode.SOFT);const e=this.getRestFilledVexFlowStaveNotesPerVoice(r);for(const i of e){if(i.parentVoiceEntry&&i.parentVoiceEntry.IsGrace&&!i.parentVoiceEntry.GraceAfterMainNote)continue;const e=i;if(0!==i.notes.length&&i.notes[0]&&i.notes[0].sourceNote.PrintObject){if(t){const t=e.parentStaffEntry;if(t&&t.vfClefBefore){const i=new h([t.vfClefBefore]);e.vfStaveNote.getCategory&&"stavenotes"===e.vfStaveNote.getCategory()&&e.vfStaveNote.addModifier(0,i)}}i.parentVoiceEntry&&this.rules.RenderFingerings&&(this.createFingerings(i),this.createStringNumber(i)),this.createArpeggio(i),this.vfVoices[r.VoiceId].addTickable(e.vfStaveNote)}else this.vfVoices[r.VoiceId].addTickable(e.vfStaveNote)}}for(const s of i)this.createFingerings(s),this.createStringNumber(s),this.createArpeggio(s);this.createArticulations(),this.createOrnaments(),this.setStemDirectionFromVexFlow()}createArpeggio(t){if(t.parentVoiceEntry&&t.parentVoiceEntry.Arpeggio){const e=t.parentVoiceEntry.Arpeggio;if(t.notes&&t.notes.length>1){const i=l.VexFlowConverter.StrokeTypeFromArpeggioType(e.type),n=new s.default.Flow.Stroke(i,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&t.vfStaveNote.addStroke(0,n)}else c.default.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn.\n voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`)}}setStemDirectionFromVexFlow(){for(const t of this.staffEntries)for(const e of t.graphicalVoiceEntries)for(const t of e.notes){const i=t.vfnote;if(i&&i[0])switch(i[0].getStemDirection()){case s.default.Flow.Stem.UP:e.parentVoiceEntry.StemDirection=p.StemDirectionType.Up;break;case s.default.Flow.Stem.DOWN:e.parentVoiceEntry.StemDirection=p.StemDirectionType.Down}}}createArticulations(){for(let t=0,e=this.staffEntries.length;t<e;++t){const e=this.staffEntries[t].graphicalVoiceEntries;for(const t of e){const e=t.vfStaveNote;l.VexFlowConverter.generateArticulations(e,t.notes[0].sourceNote.ParentVoiceEntry.Articulations,this.rules)}}}createOrnaments(){for(let t=0,e=this.staffEntries.length;t<e;++t){const e=this.staffEntries[t].graphicalVoiceEntries;for(const t in e)if(e.hasOwnProperty(t)){const i=e[t].vfStaveNote,n=e[t].notes[0].sourceNote.ParentVoiceEntry.OrnamentContainer;n&&l.VexFlowConverter.generateOrnaments(i,n)}}}createFingerings(t){const e=t;let i=0;for(const s of t.notes)s.sourceNote.Fingering&&i++;let n=-1;for(const r of t.notes){const o=r.sourceNote.Fingering;if(!o){n++;continue}n++;let a=this.rules.FingeringPosition;o.placement!==y.PlacementEnum.NotYetDefined&&(a=o.placement);let l,h=this.rules.FingeringOffsetX;switch(a){default:case y.PlacementEnum.Left:l=s.default.Flow.StaveModifier.Position.LEFT,h-=r.baseFingeringXOffset*u.unitInPixels;break;case y.PlacementEnum.Right:l=s.default.Flow.StaveModifier.Position.RIGHT,h+=r.baseFingeringXOffset*u.unitInPixels;break;case y.PlacementEnum.Above:l=s.default.Flow.StaveModifier.Position.ABOVE;break;case y.PlacementEnum.Below:l=s.default.Flow.StaveModifier.Position.BELOW;break;case y.PlacementEnum.NotYetDefined:const e=t.parentStaffEntry.sourceStaffEntry.ParentStaff;t.notes.length>1||t.parentStaffEntry.graphicalVoiceEntries.length>1?l=s.default.Flow.StaveModifier.Position.LEFT:0===e.idInMusicSheet?(l=s.default.Flow.StaveModifier.Position.ABOVE,a=y.PlacementEnum.Above):(l=s.default.Flow.StaveModifier.Position.BELOW,a=y.PlacementEnum.Below)}const c=new s.default.Flow.FretHandFinger(o.value);if(c.setPosition(l),c.setOffsetX(h),a===y.PlacementEnum.Above||a===y.PlacementEnum.Below){const t=a===y.PlacementEnum.Above?-1:1,r=a===y.PlacementEnum.Above?n:i-1-n;if(this.rules.FingeringInsideStafflines&&i>1){const e=c.getWidth()/2,n=2.5*i;c.setOffsetY(t*(r+n)*e)}else if(!this.rules.FingeringInsideStafflines){const i=new s.default.Flow.StringNumber(o.value);i.radius=0,i.setPosition(l),i.setOffsetY(t*r*i.getWidth()*2/3),e.vfStaveNote.addModifier(n,i);continue}}e.vfStaveNote.addModifier(n,c)}}createStringNumber(t){if(!this.rules.RenderStringNumbersClassical)return;const e=t;t.notes.forEach(((i,n)=>{const r=i.sourceNote.StringInstruction;if(r){let o=r.value;switch(o){case"1":o="I";break;case"2":o="II";break;case"3":o="III";break;case"4":o="IV";break;case"5":o="V";break;case"6":o="VI"}const a=new s.default.Flow.StringNumber(o);a.radius=0;const l=-this.rules.StringNumberOffsetY;t.notes.length>1||t.parentStaffEntry.graphicalVoiceEntries.length>1?(a.setOffsetX(13*i.baseStringNumberXOffset),a.setPosition(s.default.Flow.Modifier.Position.RIGHT)):a.setPosition(s.default.Flow.Modifier.Position.ABOVE),a.setOffsetY(l),e.vfStaveNote.addModifier(n,a)}}))}lineTo(t,e){const i=new s.default.Flow.StaveConnector(t.getVFStave(),this.stave);i.setType(e),this.connectors.push(i)}getVFStave(){return this.stave}updateInstructionWidth(){let t=0,e=0;const i=this.stave.getModifiers();for(const n of i)n.getPosition()===x.BEGIN?t+=n.getWidth()+n.getPadding(void 0):n.getPosition()===x.END&&(e+=n.getWidth()+n.getPadding(void 0));this.beginInstructionsWidth=(null!=t?t:0)/u.unitInPixels,this.endInstructionsWidth=(null!=e?e:0)/u.unitInPixels}}var x,E;e.VexFlowMeasure=v,(E=x=e.StavePositionEnum||(e.StavePositionEnum={}))[E.LEFT=1]="LEFT",E[E.RIGHT=2]="RIGHT",E[E.ABOVE=3]="ABOVE",E[E.BELOW=4]="BELOW",E[E.BEGIN=5]="BEGIN",E[E.END=6]="END"},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.PagePlacementEnum=e.GraphicalMusicPage=void 0;const n=i(5),s=i(6),r=i(4);class o extends s.GraphicalObject{constructor(t){super(),this.musicSystems=[],this.labels=[],this.parent=t,this.boundingBox=new n.BoundingBox(this,void 0)}get MusicSystems(){return this.musicSystems}set MusicSystems(t){this.musicSystems=t}get Labels(){return this.labels}set Labels(t){this.labels=t}get Parent(){return this.parent}set Parent(t){this.parent=t}get PageNumber(){return this.pageNumber}set PageNumber(t){this.pageNumber=t}setMusicPageAbsolutePosition(t,e){return new r.PointF2D(0,0)}}var a;e.GraphicalMusicPage=o,(a=e.PagePlacementEnum||(e.PagePlacementEnum={}))[a.Down=0]="Down",a[a.Right=1]="Right",a[a.RightDown=2]="RightDown"},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.RectangleF2D=void 0;const n=i(66),s=i(4);class r{constructor(t,e,i,n){this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=i,this.height=n}static createFromLocationAndSize(t,e){return new r(t.x,t.y,e.width,e.height)}get Location(){return new s.PointF2D(this.x,this.y)}get Size(){return new n.SizeF2D(this.width,this.height)}}e.RectangleF2D=r},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.StaffLineActivitySymbol=void 0;const n=i(6),s=i(5);class r extends n.GraphicalObject{constructor(t){super(),this.parentStaffLine=t;const e=t.PositionAndShape;this.boundingBox=new s.BoundingBox(this,e),this.boundingBox.BorderRight=6,this.boundingBox.BorderBottom=4.5,this.boundingBox.BorderLeft=-1.5,this.boundingBox.BorderTop=-1.5}}e.StaffLineActivitySymbol=r},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.ChordSymbolEnum=e.ChordDegreeText=e.CustomChord=e.Degree=e.ChordSymbolContainer=void 0;const n=i(2),s=i(17),r=i(2);e.ChordSymbolContainer=class{constructor(t,e,i,n,s){this.rootPitch=t,this.chordKind=e,this.bassPitch=i,this.degrees=n,this.rules=s}get RootPitch(){return this.rootPitch}get ChordKind(){return this.chordKind}get BassPitch(){return this.bassPitch}get ChordDegrees(){return this.degrees}static calculateChordText(t,e,i){let o=t.RootPitch;if(s.MusicSheetCalculator.transposeCalculator&&(o=s.MusicSheetCalculator.transposeCalculator.transposePitch(t.RootPitch,i,e)),t.ChordKind===l.none)return t.getTextFromChordKindEnum(t.ChordKind);let h=n.Pitch.getNoteEnumString(o.FundamentalNote);o.Accidental!==r.AccidentalEnum.NONE&&(h+=this.getTextForAccidental(o.Accidental));const c={adds:[],alts:[],subs:[]};for(const n of t.ChordDegrees)if(n){let t="";switch(n.alteration!==r.AccidentalEnum.NONE&&(t+=this.getTextForAccidental(n.alteration)),t+=n.value,n.text){case a.add:c.adds.push(t);break;case a.alter:c.alts.push(t);break;case a.subtract:c.subs.push(t)}}let u=t.getTextFromChordKindEnum(t.ChordKind);const d=["adds","alts","subs"],f=t.rules.CustomChords;for(const n of f){if(n.chordKind!==t.chordKind)continue;let e=!0;for(const t of d){for(const i of n.degrees[t]||[])if(c[t].indexOf(i)<0){e=!1;break}if(!e)break}if(e){for(const t of d)for(const e of n.degrees[t]||[])c[t].splice(c[t].indexOf(e),1);u=n.alternateName}}if(h+=u,c.adds.length>0&&(h+="("+c.adds.join(",")+")"),c.alts.length>0&&(h+="(alt "+c.alts.join(",")+")"),c.subs.length>0&&(h+="(omit "+c.subs.join(",")+")"),t.BassPitch){let r=t.BassPitch;s.MusicSheetCalculator.transposeCalculator&&(r=s.MusicSheetCalculator.transposeCalculator.transposePitch(t.BassPitch,i,e)),h+="/",h+=n.Pitch.getNoteEnumString(r.FundamentalNote),h+=this.getTextForAccidental(r.Accidental)}return h}static getTextForAccidental(t){let e="";switch(t){case r.AccidentalEnum.DOUBLEFLAT:e+="bb";break;case r.AccidentalEnum.FLAT:e+="b";break;case r.AccidentalEnum.SHARP:e+="#";break;case r.AccidentalEnum.DOUBLESHARP:e+="x"}return e}getTextFromChordKindEnum(t){var e;return null!==(e=this.rules.ChordSymbolLabelTexts.getValue(t))&&void 0!==e?e:""}},e.Degree=class{constructor(t,e,i){this.value=t,this.alteration=e,this.text=i}};class o{constructor(t,e,i){this.alternateName=t,this.chordKind=e,this.degrees=i}static createCustomChord(t,e,i){return new o(t,e,i)}static renameCustomChord(t,e,i){for(const n of i)n.alternateName===t&&(n.alternateName=e)}}var a,l,h;e.CustomChord=o,(h=a=e.ChordDegreeText||(e.ChordDegreeText={}))[h.add=0]="add",h[h.alter=1]="alter",h[h.subtract=2]="subtract",function(t){t[t.major=0]="major",t[t.minor=1]="minor",t[t.augmented=2]="augmented",t[t.diminished=3]="diminished",t[t.dominant=4]="dominant",t[t.majorseventh=5]="majorseventh",t[t.minorseventh=6]="minorseventh",t[t.diminishedseventh=7]="diminishedseventh",t[t.augmentedseventh=8]="augmentedseventh",t[t.halfdiminished=9]="halfdiminished",t[t.majorminor=10]="majorminor",t[t.majorsixth=11]="majorsixth",t[t.minorsixth=12]="minorsixth",t[t.dominantninth=13]="dominantninth",t[t.majorninth=14]="majorninth",t[t.minorninth=15]="minorninth",t[t.dominant11th=16]="dominant11th",t[t.major11th=17]="major11th",t[t.minor11th=18]="minor11th",t[t.dominant13th=19]="dominant13th",t[t.major13th=20]="major13th",t[t.minor13th=21]="minor13th",t[t.suspendedsecond=22]="suspendedsecond",t[t.suspendedfourth=23]="suspendedfourth",t[t.Neapolitan=24]="Neapolitan",t[t.Italian=25]="Italian",t[t.French=26]="French",t[t.German=27]="German",t[t.pedal=28]="pedal",t[t.power=29]="power",t[t.Tristan=30]="Tristan",t[t.none=31]="none"}(l=e.ChordSymbolEnum||(e.ChordSymbolEnum={}))},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractNotationInstruction=void 0,e.AbstractNotationInstruction=class{constructor(t){this.printObject=!0,this.parent=t}get Parent(){return this.parent}set Parent(t){this.parent=t}get PrintObject(){return this.printObject}set PrintObject(t){this.printObject=t}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.OrnamentEnum=e.OrnamentContainer=void 0;const n=i(2),s=i(3);var r;e.OrnamentContainer=class{constructor(t){this.placement=s.PlacementEnum.Above,this.accidentalAbove=n.AccidentalEnum.NONE,this.accidentalBelow=n.AccidentalEnum.NONE,this.ornament=t}get GetOrnament(){return this.ornament}get AccidentalAbove(){return this.accidentalAbove}set AccidentalAbove(t){this.accidentalAbove=t}get AccidentalBelow(){return this.accidentalBelow}set AccidentalBelow(t){this.accidentalBelow=t}},(r=e.OrnamentEnum||(e.OrnamentEnum={}))[r.Trill=0]="Trill",r[r.Turn=1]="Turn",r[r.InvertedTurn=2]="InvertedTurn",r[r.DelayedTurn=3]="DelayedTurn",r[r.DelayedInvertedTurn=4]="DelayedInvertedTurn",r[r.Mordent=5]="Mordent",r[r.InvertedMordent=6]="InvertedMordent"},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.Voice=void 0,e.Voice=class{constructor(t,e){this.voiceEntries=[],this.volume=1,this.parent=t,this.visible=!0,this.audible=!0,this.following=!0,this.voiceId=e}get VoiceEntries(){return this.voiceEntries}get Parent(){return this.parent}get Visible(){return this.visible}set Visible(t){this.visible=t}get Audible(){return this.audible}set Audible(t){this.audible=t}get Following(){return this.following}set Following(t){this.following=t}get VoiceId(){return this.voiceId}get Volume(){return this.volume}set Volume(t){this.volume=t}}},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalContinuousDynamicExpression=void 0;const s=i(27),r=i(32),o=i(4),a=i(42),l=i(3),h=n(i(1));class c extends a.AbstractGraphicalExpression{constructor(t,e,i){super(e,t,i),this.lines=[],this.isSplittedPart=!1,this.notToBeRemoved=!1}get StartMeasure(){return this.startMeasure}set StartMeasure(t){this.startMeasure=t}get EndMeasure(){return this.endMeasure}set EndMeasure(t){this.endMeasure=t}get EndStaffLine(){return this.endMeasure?this.endMeasure.ParentStaffLine:void 0}get IsSplittedPart(){return this.isSplittedPart}set IsSplittedPart(t){this.isSplittedPart=t}get IsVerbal(){return this.ContinuousDynamic.Label&&this.ContinuousDynamic.Label.length>0}get NotToBeRemoved(){return this.notToBeRemoved}set NotToBeRemoved(t){this.notToBeRemoved=t}get Lines(){return this.lines}get ContinuousDynamic(){return this.SourceExpression}updateSkyBottomLine(){var t;const e=this.parentStaffLine.SkyBottomLineCalculator,i=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft:0,n=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight:0;switch(!this.IsVerbal&&this.lines.length<2&&h.default.warn("Not enough lines for SkyBottomLine calculation"),this.IsVerbal||this.ContinuousDynamic.DynamicType!==r.ContDynamicEnum.crescendo&&this.ContinuousDynamic.DynamicType!==r.ContDynamicEnum.diminuendo&&h.default.warn("GraphicalContinuousDynamicExpression.updateSkyBottomLine(): unhandled continuous dynamic type. start measure: "+(null===(t=this.startMeasure)||void 0===t?void 0:t.MeasureNumber)),this.Placement){case l.PlacementEnum.Above:if(this.IsVerbal){const t=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;e.updateSkyLineInRange(i,n,t)}else this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.crescendo?e.updateSkyLineWithWedge(this.lines[0].Start,this.lines[0].End):this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.diminuendo&&e.updateSkyLineWithWedge(this.lines[0].End,this.lines[0].Start);break;case l.PlacementEnum.Below:if(this.IsVerbal){const t=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;e.updateBottomLineInRange(i,n,t)}else this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.crescendo?e.updateBottomLineWithWedge(this.lines[1].Start,this.lines[1].End):this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.diminuendo&&e.updateBottomLineWithWedge(this.lines[1].End,this.lines[1].Start);break;default:h.default.error("Placement for GraphicalContinuousDynamicExpression is unknown")}}createCrescendoLines(t,e,i,n=this.rules.WedgeOpeningLength,s=this.rules.WedgeLineWidth){const r=new o.PointF2D(t,i),a=new o.PointF2D(e,i-n/2),l=new o.PointF2D(e,i+n/2);this.addWedgeLines(r,a,l,s)}createFirstHalfCrescendoLines(t,e,i,n=this.rules.WedgeMeasureEndOpeningLength,s=this.rules.WedgeLineWidth){const r=new o.PointF2D(t,i),a=new o.PointF2D(e,i-n/2),l=new o.PointF2D(e,i+n/2);this.addWedgeLines(r,a,l,s)}createSecondHalfCrescendoLines(t,e,i,n=this.rules.WedgeMeasureBeginOpeningLength,s=this.rules.WedgeOpeningLength,r=this.rules.WedgeLineWidth){const a=new o.PointF2D(t,i-n/2),l=new o.PointF2D(t,i+n/2),h=new o.PointF2D(e,i-s/2),c=new o.PointF2D(e,i+s/2);this.addDoubleLines(a,h,l,c,r)}recalculateCrescendoLines(t,e,i){const n=Math.abs(this.lines[0].Start.y-this.lines[1].Start.y)>1e-4;this.lines.clear(),n?this.createSecondHalfCrescendoLines(t,e,i):this.isSplittedPart?this.createFirstHalfCrescendoLines(t,e,i):this.createCrescendoLines(t,e,i)}createDiminuendoLines(t,e,i,n=this.rules.WedgeOpeningLength,s=this.rules.WedgeLineWidth){const r=new o.PointF2D(t,i-n/2),a=new o.PointF2D(t,i+n/2),l=new o.PointF2D(e,i);this.addWedgeLines(l,r,a,s)}createFirstHalfDiminuendoLines(t,e,i,n=this.rules.WedgeOpeningLength,s=this.rules.WedgeMeasureEndOpeningLength,r=this.rules.WedgeLineWidth){const a=new o.PointF2D(t,i-n/2),l=new o.PointF2D(t,i+n/2),h=new o.PointF2D(e,i-s/2),c=new o.PointF2D(e,i+s/2);this.addDoubleLines(a,h,l,c,r)}createSecondHalfDiminuendoLines(t,e,i,n=this.rules.WedgeMeasureBeginOpeningLength,s=this.rules.WedgeLineWidth){const r=new o.PointF2D(t,i-n/2),a=new o.PointF2D(t,i+n/2),l=new o.PointF2D(e,i);this.addWedgeLines(l,r,a,s)}recalculateDiminuendoLines(t,e,i){const n=Math.abs(this.lines[0].End.y-this.lines[1].End.y)>1e-4;this.lines.clear(),n?this.createFirstHalfDiminuendoLines(t,e,i):this.isSplittedPart?this.createSecondHalfDiminuendoLines(t,e,i):this.createDiminuendoLines(t,e,i)}calcPsi(){this.IsVerbal?this.PositionAndShape.calculateBoundingBox():(this.PositionAndShape.RelativePosition=this.lines[0].Start,this.PositionAndShape.BorderMarginTop=this.lines[0].End.y-this.lines[0].Start.y,this.PositionAndShape.BorderMarginBottom=this.lines[1].End.y-this.lines[1].Start.y,this.PositionAndShape.Center.y=(this.PositionAndShape.BorderMarginTop+this.PositionAndShape.BorderMarginBottom)/2,this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.crescendo?(this.PositionAndShape.BorderMarginLeft=0,this.PositionAndShape.BorderMarginRight=this.lines[0].End.x-this.lines[0].Start.x):(this.PositionAndShape.BorderMarginLeft=this.lines[0].End.x-this.lines[0].Start.x,this.PositionAndShape.BorderMarginRight=0))}cleanUp(){this.lines.clear()}shiftYPosition(t){this.IsVerbal?(this.PositionAndShape.RelativePosition.y+=t,this.PositionAndShape.calculateBoundingBox()):(this.lines[0].Start.y+=t,this.lines[0].End.y+=t,this.lines[1].End.y+=t)}squeeze(t){this.IsVerbal||Math.abs(this.lines[0].End.x-this.lines[0].Start.x)<Math.abs(t)||(this.ContinuousDynamic.DynamicType===r.ContDynamicEnum.crescendo?t>0?this.lines[0].Start.x+=t:(this.lines[0].End.x+=t,this.lines[1].End.x+=t):t<0?this.lines[0].Start.x+=t:(this.lines[0].End.x+=t,this.lines[1].End.x+=t),this.calcPsi())}addWedgeLines(t,e,i,n){const r=new s.GraphicalLine(t,e,n),o=new s.GraphicalLine(t,i,n);this.lines.push(r),this.lines.push(o)}addDoubleLines(t,e,i,n,r){const o=new s.GraphicalLine(t,e,r),a=new s.GraphicalLine(i,n,r);this.lines.push(o),this.lines.push(a)}}e.GraphicalContinuousDynamicExpression=c},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(10),s=i(35),r=function(){function t(){this.firstNode=null,this.lastNode=null,this.nElements=0}return t.prototype.add=function(t,e){if(n.isUndefined(e)&&(e=this.nElements),e<0||e>this.nElements||n.isUndefined(t))return!1;var i=this.createNode(t);if(0===this.nElements||null===this.lastNode)this.firstNode=i,this.lastNode=i;else if(e===this.nElements)this.lastNode.next=i,this.lastNode=i;else if(0===e)i.next=this.firstNode,this.firstNode=i;else{var s=this.nodeAtIndex(e-1);if(null===s)return!1;i.next=s.next,s.next=i}return this.nElements++,!0},t.prototype.first=function(){if(null!==this.firstNode)return this.firstNode.element},t.prototype.last=function(){if(null!==this.lastNode)return this.lastNode.element},t.prototype.elementAtIndex=function(t){var e=this.nodeAtIndex(t);if(null!==e)return e.element},t.prototype.indexOf=function(t,e){var i=e||n.defaultEquals;if(n.isUndefined(t))return-1;for(var s=this.firstNode,r=0;null!==s;){if(i(s.element,t))return r;r++,s=s.next}return-1},t.prototype.contains=function(t,e){return this.indexOf(t,e)>=0},t.prototype.remove=function(t,e){var i=e||n.defaultEquals;if(this.nElements<1||n.isUndefined(t))return!1;for(var s=null,r=this.firstNode;null!==r;){if(i(r.element,t))return null===s?(this.firstNode=r.next,r===this.lastNode&&(this.lastNode=null)):r===this.lastNode?(this.lastNode=s,s.next=r.next,r.next=null):(s.next=r.next,r.next=null),this.nElements--,!0;s=r,r=r.next}return!1},t.prototype.clear=function(){this.firstNode=null,this.lastNode=null,this.nElements=0},t.prototype.equals=function(e,i){var s=i||n.defaultEquals;return e instanceof t&&this.size()===e.size()&&this.equalsAux(this.firstNode,e.firstNode,s)},t.prototype.equalsAux=function(t,e,i){for(;null!==t&&null!==e;){if(!i(t.element,e.element))return!1;t=t.next,e=e.next}return!0},t.prototype.removeElementAtIndex=function(t){if(!(t<0||t>=this.nElements||null===this.firstNode||null===this.lastNode)){var e;if(1===this.nElements)e=this.firstNode.element,this.firstNode=null,this.lastNode=null;else{var i=this.nodeAtIndex(t-1);null===i?(e=this.firstNode.element,this.firstNode=this.firstNode.next):i.next===this.lastNode&&(e=this.lastNode.element,this.lastNode=i),null!==i&&null!==i.next&&(e=i.next.element,i.next=i.next.next)}return this.nElements--,e}},t.prototype.forEach=function(t){for(var e=this.firstNode;null!==e&&!1!==t(e.element);)e=e.next},t.prototype.reverse=function(){for(var t=null,e=this.firstNode,i=null;null!==e;)i=e.next,e.next=t,t=e,e=i;i=this.firstNode,this.firstNode=this.lastNode,this.lastNode=i},t.prototype.toArray=function(){for(var t=[],e=this.firstNode;null!==e;)t.push(e.element),e=e.next;return t},t.prototype.size=function(){return this.nElements},t.prototype.isEmpty=function(){return this.nElements<=0},t.prototype.toString=function(){return s.toString(this.toArray())},t.prototype.nodeAtIndex=function(t){if(t<0||t>=this.nElements)return null;if(t===this.nElements-1)return this.lastNode;for(var e=this.firstNode,i=0;i<t&&null!==e;i++)e=e.next;return e},t.prototype.createNode=function(t){return{element:t,next:null}},t}();e.default=r},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.VerticalSourceStaffEntryContainer=void 0;const n=i(0);e.VerticalSourceStaffEntryContainer=class{constructor(t,e,i){this.staffEntries=[],this.comments=[],this.timestamp=e,this.staffEntries=new Array(i),this.parentMeasure=t}$get$(t){return this.staffEntries[t]}$set$(t,e){this.staffEntries[t]=e}get Timestamp(){return this.timestamp}set Timestamp(t){this.timestamp=t}get StaffEntries(){return this.staffEntries}set StaffEntries(t){this.staffEntries=t}get Comments(){return this.comments}set Comments(t){this.comments=t}get ParentMeasure(){return this.parentMeasure}set ParentMeasure(t){this.parentMeasure=t}getAbsoluteTimestamp(){return n.Fraction.plus(this.timestamp,this.parentMeasure.AbsoluteTimestamp)}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractTempoExpression=void 0;const n=i(3);class s extends n.AbstractExpression{constructor(t,e,i,n){super(e),this.label=t,this.staffNumber=i,this.parentMultiTempoExpression=n}get Label(){return this.label}set Label(t){this.label=t}get Placement(){return this.placement}set Placement(t){this.placement=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}static isStringInStringList(t,e){for(const i of t)if(s.stringContainsSeparatedWord(e.toLowerCase().trim(),i.toLowerCase().trim()))return!0;return!1}static stringContainsSeparatedWord(t,e){return t===e||-1!==t.indexOf(" "+e)||-1!==t.indexOf(e+" ")}}e.AbstractTempoExpression=s},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.ContinuousTempoType=e.ContinuousTempoExpression=void 0;const n=i(0),s=i(55);class r extends s.AbstractTempoExpression{constructor(t,e,i,n){super(t,e,i,n),this.setTempoType()}static isInputStringContinuousTempo(t){return!!t&&(r.isStringInStringList(r.listContinuousTempoFaster,t)||r.isStringInStringList(r.listContinuousTempoSlower,t))}static isIncreasingTempo(t){return t<=o.piuMosso}static isDecreasingTempo(t){return t>=o.allargando&&t<=o.ritenuto}get TempoType(){return this.tempoType}set TempoType(t){this.tempoType=t}get StartTempo(){return this.startTempo}set StartTempo(t){this.startTempo=t}get EndTempo(){return this.endTempo}set EndTempo(t){this.endTempo=t}get AbsoluteEndTimestamp(){return this.absoluteEndTimestamp}set AbsoluteEndTimestamp(t){this.absoluteEndTimestamp=t}get AbsoluteTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp}getAbsoluteFloatTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp.RealValue}getInterpolatedTempo(t){const e=n.Fraction.plus(this.parentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.parentMultiTempoExpression.Timestamp);if(t.lt(e))return-1;if(this.absoluteEndTimestamp.lt(t))return-2;const i=n.Fraction.minus(t,e).RealValue/n.Fraction.minus(this.absoluteEndTimestamp,e).RealValue;return Math.max(0,Math.min(250,this.startTempo+(this.endTempo-this.startTempo)*i))}setTempoType(){r.isStringInStringList(r.listContinuousTempoFaster,this.label)?this.tempoType=o.accelerando:r.isStringInStringList(r.listContinuousTempoSlower,this.label)&&(this.tempoType=o.ritardando)}}var o,a;e.ContinuousTempoExpression=r,r.listContinuousTempoFaster=["accelerando","piu mosso","poco piu","stretto"],r.listContinuousTempoSlower=["poco meno","meno mosso","piu lento","calando","allargando","rallentando","ritardando","ritenuto","ritard.","ritard","rit.","rit","riten.","riten"],(a=o=e.ContinuousTempoType||(e.ContinuousTempoType={}))[a.accelerando=0]="accelerando",a[a.stretto=1]="stretto",a[a.stringendo=2]="stringendo",a[a.mosso=3]="mosso",a[a.piuMosso=4]="piuMosso",a[a.allargando=5]="allargando",a[a.calando=6]="calando",a[a.menoMosso=7]="menoMosso",a[a.rallentando=8]="rallentando",a[a.ritardando=9]="ritardando",a[a.ritard=10]="ritard",a[a.rit=11]="rit",a[a.ritenuto=12]="ritenuto",a[a.rubato=13]="rubato",a[a.precipitando=14]="precipitando"},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowContinuousDynamicExpression=void 0;const n=i(52),s=i(24),r=i(12),o=i(9),a=i(21);class l extends n.GraphicalContinuousDynamicExpression{constructor(t,e,i,n){if(super(t,e,i),this.IsVerbal){const e=new r.Label(t.Label);this.label=new s.GraphicalLabel(e,n||this.rules.ContinuousDynamicTextHeight,o.TextAlignmentEnum.LeftCenter,this.rules,this.PositionAndShape),this.label.Label.fontStyle=a.FontStyles.Italic,this.label.setLabelPositionAndShapeBorders(),this.PositionAndShape.calculateBoundingBox()}}}e.VexFlowContinuousDynamicExpression=l},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasVexFlowBackend=void 0;const s=n(i(8)),r=i(59),o=i(13),a=i(25),l=i(45);class h extends r.VexFlowBackend{constructor(t){super(),this.rules=t}getVexflowBackendType(){return s.default.Flow.Renderer.Backends.CANVAS}getOSMDBackendType(){return a.BackendType.Canvas}getCanvasSize(){var t;return null===(t=document.getElementById("osmdCanvasPage"+this.graphicalMusicPage.PageNumber))||void 0===t?void 0:t.offsetHeight}initialize(t,e){this.zoom=e,this.canvas=document.createElement("canvas"),this.graphicalMusicPage||(this.graphicalMusicPage=new l.GraphicalMusicPage(void 0),this.graphicalMusicPage.PageNumber=1),this.canvas.id="osmdCanvasVexFlowBackendCanvas"+this.graphicalMusicPage.PageNumber,this.inner=document.createElement("div"),this.inner.id="osmdCanvasPage"+this.graphicalMusicPage.PageNumber,this.inner.style.position="relative",this.canvas.style.zIndex="0",this.inner.appendChild(this.canvas),t.appendChild(this.inner),this.renderer=new s.default.Flow.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext()}initializeHeadless(t=300,e=300){this.graphicalMusicPage||(this.graphicalMusicPage=new l.GraphicalMusicPage(void 0),this.graphicalMusicPage.PageNumber=1),this.canvas=document.createElement("canvas"),this.canvas.width=t,this.canvas.height=e,this.renderer=new s.default.Flow.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext()}getContext(){return this.ctx}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.rules.PageBackgroundColor&&(this.ctx.save(),this.ctx.setFillStyle(this.rules.PageBackgroundColor),this.zoom=1,this.ctx.fillRect(0,0,this.canvas.width/this.zoom,this.canvas.height/this.zoom),this.ctx.restore())}scale(t){this.ctx.scale(t,t)}translate(t,e){this.CanvasRenderingCtx.translate(t,e)}renderText(t,e,i,n,s,r,a,l){const h=this.CanvasRenderingCtx.font;this.CanvasRenderingCtx.save(),this.CanvasRenderingCtx.font=o.VexFlowConverter.font(t,e,i,this.rules,l),this.CanvasRenderingCtx.fillStyle=a,this.CanvasRenderingCtx.strokeStyle=a,this.CanvasRenderingCtx.fillText(n,r.x,r.y+s),this.CanvasRenderingCtx.restore(),this.CanvasRenderingCtx.font=h}renderRectangle(t,e,i,n=1){const s=this.CanvasRenderingCtx.fillStyle;this.CanvasRenderingCtx.fillStyle=i||o.VexFlowConverter.style(e),this.CanvasRenderingCtx.globalAlpha=n,this.ctx.fillRect(t.x,t.y,t.width,t.height),this.CanvasRenderingCtx.fillStyle=s,this.CanvasRenderingCtx.globalAlpha=1}renderLine(t,e,i="#FF0000FF",n=2){const s=this.CanvasRenderingCtx.strokeStyle;this.CanvasRenderingCtx.strokeStyle=i,this.CanvasRenderingCtx.beginPath(),this.CanvasRenderingCtx.moveTo(t.x,t.y),this.CanvasRenderingCtx.lineTo(e.x,e.y),this.CanvasRenderingCtx.stroke(),this.CanvasRenderingCtx.strokeStyle=s}renderCurve(t){this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.bezierCurveTo(t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y),this.ctx.lineTo(t[7].x,t[7].y),this.ctx.bezierCurveTo(t[6].x,t[6].y,t[5].x,t[5].y,t[4].x,t[4].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.closePath(),this.ctx.fill()}get CanvasRenderingCtx(){return this.ctx.vexFlowCanvasContext}}e.CanvasVexFlowBackend=h},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowBackend=e.VexFlowBackends=void 0;const s=n(i(8));e.VexFlowBackends=class{},e.VexFlowBackend=class{getInnerElement(){return this.inner}getCanvas(){return this.canvas}getRenderElement(){let t=this.canvas;return this.getVexflowBackendType()===s.default.Flow.Renderer.Backends.CANVAS&&(t=this.inner),t}getRenderer(){return this.renderer}removeAllChildrenFromContainer(t){for(;0!==t.children.length;)t.removeChild(t.children.item(0))}removeFromContainer(t){const e=this.getRenderElement();for(let i=0;i<t.children.length;i++)if(t.children.item(i)===e){t.removeChild(e);break}}resize(t,e){this.renderer.resize(t,e),this.width=t,this.height=e}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowGraphicalNote=void 0;const n=i(71),s=i(13),r=i(30);class o extends n.GraphicalNote{constructor(t,e,i,n=r.OctaveEnum.NONE,o,a){if(super(t,e,o,a),this.clef=i,this.octaveShift=n,t.Pitch){const e=t.isRest()?t.Pitch:r.OctaveShift.getPitchFromOctaveShift(t.Pitch,n);this.vfpitch=s.VexFlowConverter.pitch(e,t.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0}}setAccidental(t){const e=this.drawPitch(t);this.vfpitch=s.VexFlowConverter.pitch(e,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.DrawnAccidental=e.Accidental}drawPitch(t){return r.OctaveShift.getPitchFromOctaveShift(t,this.octaveShift)}Transpose(t,e,i,n){const o=super.Transpose(t,e,i,n),a=r.OctaveShift.getPitchFromOctaveShift(o,this.octaveShift);return this.vfpitch=s.VexFlowConverter.pitch(a,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0,a}setIndex(t,e){this.vfnote=[t,e],this.vfnoteIndex=e}notehead(t){let e=t;e||(e=this.vfnote[0]);const i=e.note_heads;return i&&i.length>this.vfnoteIndex&&i[this.vfnoteIndex]?e.note_heads[this.vfnoteIndex]:{line:0}}Clef(){return this.clef}getSVGId(){return this.vfnote[0].getAttribute("id")}getSVGGElement(){return this.vfnote[0].getAttribute("el")}}e.VexFlowGraphicalNote=o},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowInstrumentBracket=void 0;const s=n(i(8)),r=i(6),o=i(5),a=i(16);class l extends r.GraphicalObject{constructor(t,e,i=0){super(),this.PositionAndShape=new o.BoundingBox(this,t.ParentMusicSystem.PositionAndShape);const n=t.Measures[0],r=e.Measures[0];this.addConnector(n.getVFStave(),r.getVFStave(),s.default.Flow.StaveConnector.type.BRACKET,i)}draw(t){this.vexflowConnector.setContext(t).draw();const e=this.vexflowConnector,i=e.top_stave.getYForLine(0),n=e.bottom_stave.getYForLine(e.bottom_stave.getNumLines()-1)+e.thickness;this.PositionAndShape.AbsolutePosition.x=(e.top_stave.getX()-2+e.x_shift)/a.unitInPixels,this.PositionAndShape.AbsolutePosition.y=i/a.unitInPixels,this.PositionAndShape.Size.height=(n-i)/a.unitInPixels,this.PositionAndShape.Size.width=12/a.unitInPixels}addConnector(t,e,i,n){this.vexflowConnector=new s.default.Flow.StaveConnector(t,e).setType(i).setXShift(-5*n)}}e.VexFlowInstrumentBracket=l},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowVoiceEntry=void 0;const n=i(69),s=i(16),r=i(33);class o extends n.GraphicalVoiceEntry{constructor(t,e){super(t,e)}applyBordersFromVexflow(){const t=this.vfStaveNote;if(!t.getNoteHeadBeginX)return;const e=t.getBoundingBox(),i=t.getNoteHeadBeginX()-e.x;this.PositionAndShape.RelativePosition.y=e.y/s.unitInPixels,this.PositionAndShape.BorderTop=0,this.PositionAndShape.BorderBottom=e.h/s.unitInPixels,this.PositionAndShape.BorderLeft=-(i+t.width/2)/s.unitInPixels,this.PositionAndShape.BorderRight=(e.w-i)/s.unitInPixels}set vfStaveNote(t){this.mVexFlowStaveNote=t}get vfStaveNote(){return this.mVexFlowStaveNote}color(){var t;const e=this.rules.DefaultColorNotehead,i=this.rules.DefaultColorRest,n=this.rules.DefaultColorStem;let s,o;const a=this.vfStaveNote;for(let u=0;u<this.notes.length;u++){const n=this.notes[u];if(o=n.sourceNote.NoteheadColor,s=o,this.rules.ColoringMode===r.ColoringModes.AutoColoring||this.rules.ColoringMode===r.ColoringModes.CustomColorSet)if(n.sourceNote.isRest())s=this.rules.ColoringSetCurrent.getValue(-1);else{const t=n.sourceNote.Pitch.FundamentalNote;s=this.rules.ColoringSetCurrent.getValue(t)}if(n.sourceNote.PrintObject?s&&"#000000"!==s||(s=this.rules.DefaultColorNotehead):s="#00000000",!o&&this.rules.ColoringMode===r.ColoringModes.XML&&n.sourceNote.PrintObject&&(!n.sourceNote.isRest()&&e?s=e:n.sourceNote.isRest()&&i&&(s=i)),s&&n.sourceNote.PrintObject)n.sourceNote.NoteheadColorCurrentlyRendered=s;else if(!s)continue;if(this.rules.ColoringEnabled&&n.sourceNote.NoteBeam&&this.rules.ColorBeams){const e=n.sourceNote.NoteBeam.Notes;let i=!0;for(let t=0;t<e.length;t++)e[t].NoteheadColorCurrentlyRendered!==s&&(i=!1);i&&(null===(t=a.beam)||void 0===t?void 0:t.setStyle)&&a.beam.setStyle({fillStyle:s,strokeStyle:s})}if(a){if(a.note_heads){const t=a.note_heads[u];t&&t.setStyle({fillStyle:s,strokeStyle:s})}a.setLedgerLineStyle&&("#00000000"===s?a.setLedgerLineStyle({fillStyle:s,strokeStyle:s,lineWidth:this.rules.LedgerLineWidth}):a.setLedgerLineStyle({fillStyle:this.rules.LedgerLineColorDefault,lineWidth:this.rules.LedgerLineWidth,strokeStyle:this.rules.LedgerLineColorDefault}))}}let l=n;this.rules.ColoringEnabled&&(l=this.parentVoiceEntry.StemColor,l&&"#000000"!==l||(l=n),this.rules.ColorStemsLikeNoteheads&&s&&(l=s));let h=!0;for(const r of this.parentVoiceEntry.Notes)if(r.PrintObject){h=!1;break}h&&(l="#00000000");const c={fillStyle:l,strokeStyle:l};a&&a.setStemStyle&&(h||(this.parentVoiceEntry.StemColor=l),a.setStemStyle(c),a.flag&&a.setFlagStyle&&this.rules.ColorFlags&&a.setFlagStyle(c))}}e.VexFlowVoiceEntry=o},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowTextMeasurer=void 0;const n=i(13);e.VexFlowTextMeasurer=class{constructor(t){this.fontSize=20,this.fontSizeStandard=this.fontSize;const e=document.createElement("canvas");this.context=e.getContext("2d"),this.rules=t}computeTextWidthToHeightRatio(t,e,i,s,r=this.fontSize){return this.context.font=n.VexFlowConverter.font(r,i,e,this.rules,s),this.context.measureText(t).width/r}setFontSize(t=this.fontSizeStandard){return this.fontSize=t,t}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.MoodEnum=e.MoodExpression=void 0;const n=i(3);class s extends n.AbstractExpression{constructor(t,e,i){super(e),this.label=t,this.staffNumber=i,this.setMoodType()}static isInputStringMood(t){return!!t&&(s.isStringInStringList(s.listMoodAffettuoso,t)||s.isStringInStringList(s.listMoodAgitato,t)||s.isStringInStringList(s.listMoodAnimato,t)||s.isStringInStringList(s.listMoodAppassionato,t)||s.isStringInStringList(s.listMoodBrillante,t)||s.isStringInStringList(s.listMoodCantabile,t)||s.isStringInStringList(s.listMoodDolce,t)||s.isStringInStringList(s.listMoodEnergico,t)||s.isStringInStringList(s.listMoodEroico,t)||s.isStringInStringList(s.listMoodEspressivo,t)||s.isStringInStringList(s.listMoodFurioso,t)||s.isStringInStringList(s.listMoodGiocoso,t)||s.isStringInStringList(s.listMoodGioioso,t)||s.isStringInStringList(s.listMoodGrandioso,t)||s.isStringInStringList(s.listMoodGrazioso,t)||s.isStringInStringList(s.listMoodLacrimoso,t)||s.isStringInStringList(s.listMoodLeggiero,t)||s.isStringInStringList(s.listMoodMaestoso,t)||s.isStringInStringList(s.listMoodMalinconico,t)||s.isStringInStringList(s.listMoodMarcato,t)||s.isStringInStringList(s.listMoodMarziale,t)||s.isStringInStringList(s.listMoodMesto,t)||s.isStringInStringList(s.listMoodMorendo,t)||s.isStringInStringList(s.listMoodNobilmente,t)||s.isStringInStringList(s.listMoodPatetico,t)||s.isStringInStringList(s.listMoodPesante,t)||s.isStringInStringList(s.listMoodSaltando,t)||s.isStringInStringList(s.listMoodSautille,t)||s.isStringInStringList(s.listMoodScherzando,t)||s.isStringInStringList(s.listMoodSostenuto,t)||s.isStringInStringList(s.listMoodSpiccato,t)||s.isStringInStringList(s.listMoodTenerezza,t)||s.isStringInStringList(s.listMoodTranquillamente,t)||s.isStringInStringList(s.listMoodTrionfante,t))}get Label(){return this.label}set Label(t){this.label=t}get Mood(){return this.moodType}set Mood(t){this.moodType=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get Placement(){return this.placement}set Placement(t){this.placement=t}setMoodType(){s.isStringInStringList(s.listMoodAffettuoso,this.label)?this.moodType=r.Affettuoso:s.isStringInStringList(s.listMoodAgitato,this.label)?this.moodType=r.Agitato:s.isStringInStringList(s.listMoodAnimato,this.label)?this.moodType=r.Animato:s.isStringInStringList(s.listMoodAppassionato,this.label)?this.moodType=r.Appassionato:s.isStringInStringList(s.listMoodBrillante,this.label)?this.moodType=r.Brillante:s.isStringInStringList(s.listMoodCantabile,this.label)?this.moodType=r.Cantabile:s.isStringInStringList(s.listMoodDolce,this.label)?this.moodType=r.Dolce:s.isStringInStringList(s.listMoodEnergico,this.label)?this.moodType=r.Energico:s.isStringInStringList(s.listMoodEroico,this.label)?this.moodType=r.Eroico:s.isStringInStringList(s.listMoodEspressivo,this.label)?this.moodType=r.Espressivo:s.isStringInStringList(s.listMoodFurioso,this.label)?this.moodType=r.Furioso:s.isStringInStringList(s.listMoodGiocoso,this.label)?this.moodType=r.Giocoso:s.isStringInStringList(s.listMoodGioioso,this.label)?this.moodType=r.Gioioso:s.isStringInStringList(s.listMoodGrandioso,this.label)?this.moodType=r.Grandioso:s.isStringInStringList(s.listMoodGrazioso,this.label)?this.moodType=r.Grazioso:s.isStringInStringList(s.listMoodLacrimoso,this.label)?this.moodType=r.Lacrimoso:s.isStringInStringList(s.listMoodLeggiero,this.label)?this.moodType=r.Leggiero:s.isStringInStringList(s.listMoodMaestoso,this.label)?this.moodType=r.Maestoso:s.isStringInStringList(s.listMoodMalinconico,this.label)?this.moodType=r.Malinconico:s.isStringInStringList(s.listMoodMarcato,this.label)?this.moodType=r.Marcato:s.isStringInStringList(s.listMoodMarziale,this.label)?this.moodType=r.Marziale:s.isStringInStringList(s.listMoodMesto,this.label)?this.moodType=r.Mesto:s.isStringInStringList(s.listMoodMorendo,this.label)?this.moodType=r.Morendo:s.isStringInStringList(s.listMoodNobilmente,this.label)?this.moodType=r.Nobilmente:s.isStringInStringList(s.listMoodPatetico,this.label)?this.moodType=r.Patetico:s.isStringInStringList(s.listMoodPesante,this.label)?this.moodType=r.Pesante:s.isStringInStringList(s.listMoodSaltando,this.label)?this.moodType=r.Saltando:s.isStringInStringList(s.listMoodSautille,this.label)?this.moodType=r.Sautille:s.isStringInStringList(s.listMoodScherzando,this.label)?this.moodType=r.Scherzando:s.isStringInStringList(s.listMoodSostenuto,this.label)?this.moodType=r.Sostenuto:s.isStringInStringList(s.listMoodSpiccato,this.label)?this.moodType=r.Spiccato:s.isStringInStringList(s.listMoodTenerezza,this.label)?this.moodType=r.Tenerezza:s.isStringInStringList(s.listMoodTranquillamente,this.label)?this.moodType=r.Tranquillamente:s.isStringInStringList(s.listMoodTrionfante,this.label)&&(this.moodType=r.Trionfante)}}var r,o;e.MoodExpression=s,s.listMoodAffettuoso=["affettuoso"],s.listMoodAgitato=["agitato"],s.listMoodAppassionato=["appassionato"],s.listMoodAnimato=["animato","lively"],s.listMoodBrillante=["brillante"],s.listMoodCantabile=["cantabile"],s.listMoodDolce=["dolce"],s.listMoodEnergico=["energico"],s.listMoodEroico=["eroico"],s.listMoodEspressivo=["espressivo"],s.listMoodFurioso=["furioso"],s.listMoodGiocoso=["giocoso"],s.listMoodGioioso=["gioioso"],s.listMoodLacrimoso=["lacrimoso"],s.listMoodGrandioso=["grandioso"],s.listMoodGrazioso=["grazioso"],s.listMoodLeggiero=["leggiero"],s.listMoodMaestoso=["maestoso"],s.listMoodMalinconico=["malinconico"],s.listMoodMarcato=["marcato"],s.listMoodMarziale=["marziale"],s.listMoodMesto=["mesto"],s.listMoodMorendo=["morendo"],s.listMoodNobilmente=["nobilmente"],s.listMoodPatetico=["patetico"],s.listMoodPesante=["pesante"],s.listMoodSautille=["sautille"],s.listMoodSaltando=["saltando"],s.listMoodScherzando=["scherzando"],s.listMoodSostenuto=["sostenuto"],s.listMoodSpiccato=["spiccato"],s.listMoodTenerezza=["tenerezza"],s.listMoodTranquillamente=["tranquillamente"],s.listMoodTrionfante=["trionfante"],(o=r=e.MoodEnum||(e.MoodEnum={}))[o.Affettuoso=0]="Affettuoso",o[o.Agitato=1]="Agitato",o[o.Appassionato=2]="Appassionato",o[o.Animato=3]="Animato",o[o.Brillante=4]="Brillante",o[o.Cantabile=5]="Cantabile",o[o.Dolce=6]="Dolce",o[o.Energico=7]="Energico",o[o.Eroico=8]="Eroico",o[o.Espressivo=9]="Espressivo",o[o.Furioso=10]="Furioso",o[o.Giocoso=11]="Giocoso",o[o.Gioioso=12]="Gioioso",o[o.Lacrimoso=13]="Lacrimoso",o[o.Grandioso=14]="Grandioso",o[o.Grazioso=15]="Grazioso",o[o.Leggiero=16]="Leggiero",o[o.Maestoso=17]="Maestoso",o[o.Malinconico=18]="Malinconico",o[o.Marcato=19]="Marcato",o[o.Marziale=20]="Marziale",o[o.Mesto=21]="Mesto",o[o.Morendo=22]="Morendo",o[o.Nobilmente=23]="Nobilmente",o[o.Patetico=24]="Patetico",o[o.Pesante=25]="Pesante",o[o.Sautille=26]="Sautille",o[o.Saltando=27]="Saltando",o[o.Scherzando=28]="Scherzando",o[o.Sostenuto=29]="Sostenuto",o[o.Spiccato=30]="Spiccato",o[o.Tenerezza=31]="Tenerezza",o[o.Tranquillamente=32]="Tranquillamente",o[o.Trionfante=33]="Trionfante",o[o.Vivace=34]="Vivace"},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.UnknownExpression=void 0;const n=i(3),s=i(9);class r extends n.AbstractExpression{constructor(t,e,i,n){super(e),this.label=t,this.staffNumber=n,void 0===i&&(i=s.TextAlignmentEnum.LeftBottom),this.textAlignment=i}get Label(){return this.label}get Placement(){return this.placement}set Placement(t){this.placement=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get TextAlignment(){return this.textAlignment}}e.UnknownExpression=r},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SizeF2D=void 0,e.SizeF2D=class{constructor(t=0,e=0){this.width=t,this.height=e}}},function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(21),e),s(i(87),e),s(i(9),e),s(i(164),e)},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SystemImageProperties=e.GraphicalMusicSheet=void 0;const s=i(112),r=i(27),o=i(4),a=i(7),l=i(18),h=i(0),c=i(5),u=n(i(1)),d=i(34),f=i(69),p=i(6);e.GraphicalMusicSheet=class{constructor(t,e){this.musicPages=[],this.measureList=[],this.verticalGraphicalStaffEntryContainers=[],this.cursors=[],this.leadSheet=!1,this.musicSheet=t,this.numberOfStaves=this.musicSheet.Staves.length,this.calculator=e,this.calculator.initialize(this)}get ParentMusicSheet(){return this.musicSheet}get GetCalculator(){return this.calculator}get MusicPages(){return this.musicPages}set MusicPages(t){this.musicPages=t}get MeasureList(){return this.measureList}set MeasureList(t){this.measureList=t}get VerticalGraphicalStaffEntryContainers(){return this.verticalGraphicalStaffEntryContainers}set VerticalGraphicalStaffEntryContainers(t){this.verticalGraphicalStaffEntryContainers=t}get Title(){return this.title}set Title(t){this.title=t}get Subtitle(){return this.subtitle}set Subtitle(t){this.subtitle=t}get Composer(){return this.composer}set Composer(t){this.composer=t}get Lyricist(){return this.lyricist}set Lyricist(t){this.lyricist=t}get Cursors(){return this.cursors}get SelectionStartSymbol(){return this.selectionStartSymbol}get SelectionEndSymbol(){return this.selectionEndSymbol}get MinAllowedSystemWidth(){return this.minAllowedSystemWidth}set MinAllowedSystemWidth(t){this.minAllowedSystemWidth=t}get NumberOfStaves(){return this.numberOfStaves}get LeadSheet(){return this.leadSheet}set LeadSheet(t){this.leadSheet=t}static transformRelativeToAbsolutePosition(t){for(let e=0;e<t.MusicPages.length;e++){const i=t.MusicPages[e].setMusicPageAbsolutePosition(e,t.ParentMusicSheet.Rules);t.MusicPages[e].PositionAndShape.calculateAbsolutePositionsRecursive(i.x,i.y)}}Initialize(){this.verticalGraphicalStaffEntryContainers=[],this.musicPages=[],this.measureList=[]}reCalculate(){this.calculator.calculate()}EnforceRedrawOfMusicSystems(){for(let t=0,e=this.musicPages.length;t<e;++t){const e=this.musicPages[t];for(let t=0,i=e.MusicSystems.length;t<i;++t)e.MusicSystems[t].needsToBeRedrawn=!0}}getClickedObject(t){for(let e=0,i=this.MusicPages.length;e<i;++e)return this.MusicPages[e].PositionAndShape.getClickedObjectOfType(t)}findGraphicalMeasure(t,e){for(let i=t;i>=0;i--){const t=this.measureList[i][e];if(t)return t}}findGraphicalStaffEntryFromMeasureList(t,e,i){for(let n=e;n<this.measureList.length;n++){const e=this.measureList[n][t];if(e)for(let t=0,n=e.staffEntries.length;t<n;++t){const n=e.staffEntries[t];if(n.sourceStaffEntry===i)return n}}}findNextGraphicalStaffEntry(t,e,i){const n=i.parentMeasure,s=n.staffEntries.indexOf(i);if(s<n.staffEntries.length-1)return n.staffEntries[s+1];if(e<this.measureList.length-1){const i=this.measureList[e+1][t];if(i.staffEntries.length>0)return i.staffEntries[0]}}getFirstVisibleMeasuresListFromIndices(t,e){const i=[],n=this.measureList[0].length;for(let s=t;s<=e;s++)for(let t=0;t<n;t++)if(this.measureList[s][t].isVisible()){i.push(this.measureList[s][t]);break}return i}orderMeasuresByStaffLine(t){const e=[];let i=[];e.push(i);for(let n=0;n<t.length;n++)0===n?i.push(t[0]):(t[n].ParentStaffLine===t[n-1].ParentStaffLine||(-1===e.indexOf(i)&&e.push(i),i=[],e.push(i)),i.push(t[n]));return e}initializeActiveClefs(){const t=[],e=this.musicSheet.getFirstSourceMeasure();if(e)for(let i=0;i<e.CompleteNumberOfStaves;i++){let n=new a.ClefInstruction;if(e.FirstInstructionsStaffEntries[i])for(let t=0,s=e.FirstInstructionsStaffEntries[i].Instructions.length;t<s;++t){const s=e.FirstInstructionsStaffEntries[i].Instructions[t];s instanceof a.ClefInstruction&&(n=s)}t.push(n)}return t}GetMainKey(){const t=this.musicSheet.getFirstSourceMeasure();if(t)for(let e=0;e<t.CompleteNumberOfStaves;e++)for(let i=0,n=t.FirstInstructionsStaffEntries[e].Instructions.length;i<n;++i){const n=t.FirstInstructionsStaffEntries[e].Instructions[i];if(n instanceof l.KeyInstruction)return n}}getOrCreateVerticalContainer(t){if(0===this.verticalGraphicalStaffEntryContainers.length||d.CollectionUtil.getLastElement(this.verticalGraphicalStaffEntryContainers).AbsoluteTimestamp.lt(t)){const e=new s.VerticalGraphicalStaffEntryContainer(this.numberOfStaves,t);return this.verticalGraphicalStaffEntryContainers.push(e),e}for(let e=this.verticalGraphicalStaffEntryContainers.length-1;e>=0;e--){if(this.verticalGraphicalStaffEntryContainers[e].AbsoluteTimestamp.lt(t)){const i=new s.VerticalGraphicalStaffEntryContainer(this.numberOfStaves,t);return this.verticalGraphicalStaffEntryContainers.splice(e+1,0,i),i}if(this.verticalGraphicalStaffEntryContainers[e].AbsoluteTimestamp.Equals(t))return this.verticalGraphicalStaffEntryContainers[e]}}GetVerticalContainerFromTimestamp(t,e=0){const i=d.CollectionUtil.binarySearch(this.verticalGraphicalStaffEntryContainers,new s.VerticalGraphicalStaffEntryContainer(0,t),s.VerticalGraphicalStaffEntryContainer.compareByTimestamp,e);if(i>=0)return this.verticalGraphicalStaffEntryContainers[i]}GetInterpolatedIndexInVerticalContainers(t){const e=this.verticalGraphicalStaffEntryContainers;let i,n,s=0,r=e.length-1;if(t.lte(e[e.length-1].AbsoluteTimestamp)){for(;r-s>1;){const i=Math.floor((r+s)/2);if(e[s].AbsoluteTimestamp.Equals(t)){r=s;break}if(e[r].AbsoluteTimestamp.Equals(t)){s=r;break}if(e[i].AbsoluteTimestamp.Equals(t))return this.verticalGraphicalStaffEntryContainers.indexOf(e[i]);t.lt(e[i].AbsoluteTimestamp)?r=i:s=i}if(s===r)return this.verticalGraphicalStaffEntryContainers.indexOf(e[s]);i=e[s].AbsoluteTimestamp,n=e[r].AbsoluteTimestamp}else i=e[e.length-1].AbsoluteTimestamp,n=h.Fraction.plus(this.getLongestStaffEntryDuration(e.length-1),i),r=e.length;const o=n.RealValue-i.RealValue,a=r-(n.RealValue-t.RealValue)/o;return Math.min(a,this.verticalGraphicalStaffEntryContainers.length)}getVisibleStavesIndicesFromSourceMeasure(t){const e=[],i=[];for(let n=0,s=t.length;n<s;++n){const i=t[n].ParentStaff.ParentInstrument;-1===e.indexOf(i)&&e.push(i)}for(let n=0,s=e.length;n<s;++n){const t=e[n],s=this.musicSheet.getGlobalStaffIndexOfFirstStaff(t);for(let e=0;e<t.Staves.length;e++)i.push(s+e)}return i}getGraphicalMeasureFromSourceMeasureAndIndex(t,e){var i;for(let n=0;n<this.measureList.length;n++)if((null===(i=this.measureList[n][0])||void 0===i?void 0:i.parentSourceMeasure)===t)return this.measureList[n][e]}getLastGraphicalMeasureFromIndex(t,e=!0){let i=this.measureList.length-1;return e&&(i=Math.min(i,this.musicSheet.Rules.MaxMeasureToDrawIndex)),this.measureList[i][t]}getMeasureIndex(t,e,i){for(e=0;e<this.measureList.length;e++)for(let i=0,n=this.measureList[e].length;i<n;++i)if(this.measureList[e][i]===t)return!0;return!1}GetNearestGraphicalObject(t,e=p.GraphicalObject.name,i=5,n=20,s=5,r){const a=[];for(;0===a.length&&i<=n;){const n=new c.BoundingBox(void 0);n.BorderLeft=t.x-i,n.BorderTop=t.y-i,n.BorderRight=t.x+i,n.BorderBottom=t.y+i,n.AbsolutePosition=new o.PointF2D(t.x,t.y),n.calculateAbsolutePosition();for(let t=0,i=this.MusicPages.length;t<i;++t){const i=this.MusicPages[t].PositionAndShape.getObjectsInRegion(n,!1,e);if(i&&0!==i.length)for(let t=0,e=i.length;t<e;++t)r?r(i[t])&&a.push(i[t]):a.push(i[t])}i+=s}let l;for(let o=0,h=a.length;o<h;++o){const e=a[o];(void 0===l||this.CalculateDistance(e.PositionAndShape.AbsolutePosition,t)<this.CalculateDistance(l.PositionAndShape.AbsolutePosition,t))&&(l=e)}if(l)return l}GetNearestVoiceEntry(t){return this.GetNearestGraphicalObject(t,f.GraphicalVoiceEntry.name,5,20,5,(t=>void 0!==t.parentStaffEntry.relInMeasureTimestamp))}GetNearestNote(t,e){const i=this.GetNearestVoiceEntry(t);if(!i)return;let n,s=Number.MAX_SAFE_INTEGER;for(const r of i.notes){const e=r.PositionAndShape.AbsolutePosition.y,i=Math.abs(r.PositionAndShape.AbsolutePosition.x-t.x),o=Math.abs(e-t.y);i+o<s&&(n=r,s=i+o)}return n}domToSvg(t){return this.domToSvgTransform(t,!0)}svgToDom(t){return this.domToSvgTransform(t,!1)}svgToOsmd(t){const e=new o.PointF2D(t.x,t.y);return e.x/=10,e.y/=10,e}domToSvgTransform(t,e){const i=this.drawer.Backends[0].getSvgElement(),n=i.createSVGPoint();n.x=t.x,n.y=t.y;let s=i.getScreenCTM();e&&(s=s.inverse());const r=n.matrixTransform(s);return new o.PointF2D(r.x,r.y)}GetClickableLabel(t){const e=new c.BoundingBox;e.BorderLeft=t.x-4,e.BorderTop=t.y-4,e.BorderRight=t.x+4,e.BorderBottom=t.y+4,e.AbsolutePosition=new o.PointF2D(0,0);for(let i=0,n=this.MusicPages.length;i<n;++i){const t=this.MusicPages[i].PositionAndShape.getObjectsInRegion(e);if(1===t.length)for(let e=0,i=t.length;e<i;++e)return t[e]}}GetNearestStaffEntry(t){const e=[],i=new c.BoundingBox(void 0);i.BorderLeft=t.x-10,i.BorderTop=t.y-10,i.BorderRight=t.x+10,i.BorderBottom=t.y+10,i.AbsolutePosition=new o.PointF2D(0,0);for(let s=0,r=this.MusicPages.length;s<r;++s){const t=this.MusicPages[s].PositionAndShape.getObjectsInRegion(i,!1);if(t&&0!==t.length)for(let i=0,n=t.length;i<n;++i){const n=t[i];e.push(n)}}let n;for(let s=0,r=e.length;s<r;++s){const i=e[s];if(void 0===n)n=i;else{if(!i.relInMeasureTimestamp)continue;this.CalculateDistance(i.PositionAndShape.AbsolutePosition,t)<this.CalculateDistance(n.PositionAndShape.AbsolutePosition,t)&&(n=i)}}if(n)return n}GetPossibleCommentAnchor(t){const e=this.GetNearestStaffEntry(t);if(e)return e.sourceStaffEntry}getClickedObjectOfType(t){for(let e=0,i=this.musicPages.length;e<i;++e){const i=this.musicPages[e].PositionAndShape.getClickedObjectOfType(t);if(i)return i}}tryGetTimestampFromPosition(t){const e=this.getClickedObjectOfType(t);if(e)return e.getAbsoluteTimestamp()}tryGetClickableLabel(t){try{return this.GetClickableLabel(t)}catch(e){u.default.info("GraphicalMusicSheet.tryGetClickableObject","positionOnMusicSheet: "+t,e)}}tryGetTimeStampFromPosition(t){try{const e=this.GetNearestStaffEntry(t);if(!e)return;return e.getAbsoluteTimestamp()}catch(e){u.default.info("GraphicalMusicSheet.tryGetTimeStampFromPosition","positionOnMusicSheet: "+t,e)}}getStaffEntry(t){const e=this.VerticalGraphicalStaffEntryContainers[t];let i;try{for(let t=0,n=e.StaffEntries.length;t<n;++t){const n=e.StaffEntries[t];n&&n.sourceStaffEntry.ParentStaff.ParentInstrument.Visible&&(i?n.PositionAndShape&&i.PositionAndShape&&i.PositionAndShape.RelativePosition.x>n.PositionAndShape.RelativePosition.x&&(i=n):i=n)}}catch(n){u.default.info("GraphicalMusicSheet.getStaffEntry",n)}return i}GetPreviousVisibleContainerIndex(t){for(let e=t-1;e>=0;e--){const t=this.verticalGraphicalStaffEntryContainers[e].StaffEntries;for(let i=0,n=t.length;i<n;++i){const n=t[i];if(n&&n.sourceStaffEntry.ParentStaff.ParentInstrument.Visible)return e}}return-1}GetNextVisibleContainerIndex(t){for(let e=t+1;e<this.verticalGraphicalStaffEntryContainers.length;++e){const t=this.verticalGraphicalStaffEntryContainers[e].StaffEntries;for(let i=0,n=t.length;i<n;++i){const n=t[i];if(n&&n.sourceStaffEntry.ParentStaff.ParentInstrument.Visible)return e}}return-1}findClosestLeftStaffEntry(t,e){let i,n=Math.floor(t);n=Math.min(this.VerticalGraphicalStaffEntryContainers.length-1,n);for(let s=n;s>=0;s--)if(i=this.getStaffEntry(s),i){if(!e)return i;if(i.sourceStaffEntry.ParentStaff.ParentInstrument.Visible)return i}}findClosestRightStaffEntry(t,e){let i;for(let n=Math.max(0,Math.ceil(t));n<this.VerticalGraphicalStaffEntryContainers.length;n++)if(i=this.getStaffEntry(n),i){if(!e)return i;if(i.sourceStaffEntry.ParentStaff.ParentInstrument.Visible)return i}}calculateCursorLineAtTimestamp(t,e){const i=this.calculateXPositionFromTimestamp(t),n=i[0],s=i[1];if(!s||0===s.StaffLines.length)return;const a=s.PositionAndShape.AbsolutePosition.y,l=d.CollectionUtil.last(s.StaffLines).PositionAndShape.RelativePosition.y+4;return new r.GraphicalLine(new o.PointF2D(n,a),new o.PointF2D(n,a+l),3,e)}calculateXPositionFromTimestamp(t){var e,i,n,s;let r;const o=this.GetInterpolatedIndexInVerticalContainers(t),a=this.findClosestLeftStaffEntry(o,!0),l=this.findClosestRightStaffEntry(o,!0),c=t.RealValue;if(!a&&!l)return[0,void 0];let u,d;if(u=a?null===(e=a.parentMeasure.ParentStaffLine)||void 0===e?void 0:e.ParentMusicSystem:null===(i=l.parentMeasure.ParentStaffLine)||void 0===i?void 0:i.ParentMusicSystem,d=l?null===(n=l.parentMeasure.ParentStaffLine)||void 0===n?void 0:n.ParentMusicSystem:null===(s=a.parentMeasure.ParentStaffLine)||void 0===s?void 0:s.ParentMusicSystem,u===d){let t,e,i;if(r=u,a)if(l)e=a.PositionAndShape.AbsolutePosition.x,i=l.PositionAndShape.AbsolutePosition.x,t=a===l?0:(c-a.getAbsoluteTimestamp().RealValue)/(l.getAbsoluteTimestamp().RealValue-a.getAbsoluteTimestamp().RealValue);else{e=a.PositionAndShape.AbsolutePosition.x,i=r.GetRightBorderAbsoluteXPosition();const n=a.parentMeasure.parentSourceMeasure;t=(c-a.getAbsoluteTimestamp().RealValue)/(h.Fraction.plus(n.AbsoluteTimestamp,n.Duration).RealValue-a.getAbsoluteTimestamp().RealValue)}else e=i=l.PositionAndShape.AbsolutePosition.x,t=0;return t=Math.min(1,Math.max(0,t)),[e+t*(i-e),r]}{const t=l.parentMeasure.parentSourceMeasure.AbsoluteTimestamp.RealValue;let e,i;if(c<t){r=u;const n=a.PositionAndShape.AbsolutePosition.x,s=r.GetRightBorderAbsoluteXPosition();e=(c-a.getAbsoluteTimestamp().RealValue)/(t-a.getAbsoluteTimestamp().RealValue),e=Math.min(1,Math.max(0,e)),i=n+e*(s-n)}else{r=d;const n=l.PositionAndShape.AbsolutePosition.x,s=r.GetLeftBorderAbsoluteXPosition();e=(c-t)/(l.getAbsoluteTimestamp().RealValue-t),e=Math.min(1,Math.max(0,e)),i=s+e*(n-s)}return[i,r]}}GetNumberOfVisibleInstruments(){let t=0;for(let e=0,i=this.musicSheet.Instruments.length;e<i;++e)!0===this.musicSheet.Instruments[e].Visible&&t++;return t}GetNumberOfFollowedInstruments(){let t=0;for(let e=0,i=this.musicSheet.Instruments.length;e<i;++e)!0===this.musicSheet.Instruments[e].Following&&t++;return t}GetGraphicalFromSourceStaffEntry(t){return t.VerticalContainerParent.ParentMeasure.VerticalMeasureList[t.ParentStaff.idInMusicSheet].findGraphicalStaffEntryFromTimestamp(t.Timestamp)}CalculateDistance(t,e){const i=t.x-e.x,n=t.y-e.y;return i*i+n*n}getLongestStaffEntryDuration(t){let e=new h.Fraction(0,1);for(const i of this.verticalGraphicalStaffEntryContainers[t].StaffEntries){if(!i)continue;const t=i.findStaffEntryMaxNoteLength();e.lt(t)&&(e=t)}return e}},e.SystemImageProperties=class{}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalVoiceEntry=void 0;const n=i(6),s=i(5),r=i(26);class o extends n.GraphicalObject{constructor(t,e){super(),this.parentVoiceEntry=t,this.parentStaffEntry=e,this.PositionAndShape=new s.BoundingBox(this,e?e.PositionAndShape:void 0,!0),this.notes=[],this.rules=e?e.parentMeasure.parentSourceMeasure.Rules:new r.EngravingRules}sort(){return this.notes.sort(((t,e)=>e.sourceNote.Pitch.getHalfTone()-t.sourceNote.Pitch.getHalfTone())),this.notes}sortForVexflow(){return this.notes.sort(((t,e)=>t.sourceNote.Pitch.getHalfTone()-e.sourceNote.Pitch.getHalfTone())),this.notes}color(){}}e.GraphicalVoiceEntry=o},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalInstantaneousTempoExpression=void 0;const n=i(42);class s extends n.AbstractGraphicalExpression{constructor(t,e){super(e.PositionAndShape.Parent.DataObject,t,t.parentMeasure),this.label=e}get GraphicalLabel(){return this.label}updateSkyBottomLine(){}}e.GraphicalInstantaneousTempoExpression=s},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalNote=void 0;const n=i(2),s=i(6),r=i(17),o=i(5);class a extends s.GraphicalObject{constructor(t,e,i,s){super(),this.DrawnAccidental=n.AccidentalEnum.NONE,this.sourceNote=t,this.parentVoiceEntry=e,this.PositionAndShape=new o.BoundingBox(this,e.PositionAndShape),this.graphicalNoteLength=s||t.Length,this.numberOfDots=this.calculateNumberOfNeededDots(this.graphicalNoteLength),this.rules=i,this.rules.addGraphicalNoteToNoteMap(t,this)}Transpose(t,e,i,n){let s=this.sourceNote.Pitch;return r.MusicSheetCalculator.transposeCalculator&&(s=r.MusicSheetCalculator.transposeCalculator.transposePitch(this.sourceNote.Pitch,t,i)),s}calculateNumberOfNeededDots(t){let e=1,i=2;const n=t.GetExpandedNumerator();if(!this.sourceNote||!this.sourceNote.NoteTuplet)for(;i<n;)e++,i=Math.pow(2,e);return Math.min(3,e-1)}get ParentMusicPage(){return this.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentMusicSystem.Parent}static FromNote(t,e){return e.NoteToGraphicalNoteMap.getValue(t.NoteToGraphicalNoteObjectId)}}e.GraphicalNote=a},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.IXmlElement=void 0;class n{constructor(t){if(this.hasAttributes=!1,!t)throw new Error("IXmlElement: expected Element, got undefined");this.elem=t,this.name=t.nodeName.toLowerCase(),t.hasAttributes()&&(this.hasAttributes=!0,this.firstAttribute=t.attributes[0]),this.hasElements=t.hasChildNodes(),1===t.childNodes.length&&t.childNodes[0].nodeType===Node.TEXT_NODE?this.value=t.childNodes[0].nodeValue:this.value=""}attribute(t){return this.elem.attributes.getNamedItem(t)}attributes(){if(!this.attrs){const t=this.elem.attributes,e=[];for(let i=0;i<t.length;i+=1)e.push(t[i]);this.attrs=e}return this.attrs}element(t){const e=this.elem.childNodes;for(let i=0,s=e.length;i<s;i+=1){const s=e[i];if(s.nodeType===Node.ELEMENT_NODE&&s.nodeName.toLowerCase()===t)return new n(s)}}elements(t){const e=this.elem.childNodes,i=[],s=!t;s||(t=t.toLowerCase());for(let r=0;r<e.length;r+=1){const o=e[r];o.nodeType!==Node.ELEMENT_NODE||!s&&o.nodeName.toLowerCase()!==t||i.push(new n(o))}return i}}e.IXmlElement=n},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.Instrument=void 0;const n=i(74),s=i(12),r=i(118);class o extends n.InstrumentalGroup{constructor(t,e,i,n){super(void 0,i,n),this.transpose=0,this.voices=[],this.staves=[],this.hasLyrics=!1,this.hasChordSymbols=!1,this.lyricVersesNumbers=[],this.subInstruments=[],this.id=t,this.idString=e,this.nameLabel=new s.Label(e)}get Voices(){return this.voices}get Staves(){return this.staves}get NameLabel(){return this.nameLabel}get HasLyrics(){return this.hasLyrics}set HasLyrics(t){this.hasLyrics=t}get HasChordSymbols(){return this.hasChordSymbols}set HasChordSymbols(t){this.hasChordSymbols=t}get LyricVersesNumbers(){return this.lyricVersesNumbers}set LyricVersesNumbers(t){this.lyricVersesNumbers=t}get Name(){return this.nameLabel.text}set Name(t){this.nameLabel.text=t}get IdString(){return this.idString}get Id(){return this.id}get MidiInstrumentId(){return this.subInstruments[0].midiInstrumentID}set MidiInstrumentId(t){this.subInstruments[0].midiInstrumentID=t}get Volume(){return this.subInstruments[0].volume}set Volume(t){for(let e=0,i=this.subInstruments.length;e<i;++e)this.subInstruments[e].volume=t}get PlaybackTranspose(){return this.playbackTranspose}set PlaybackTranspose(t){this.playbackTranspose=t}get SubInstruments(){return this.subInstruments}getSubInstrument(t){for(let e=0,i=this.subInstruments.length;e<i;++e){const i=this.subInstruments[e];if(i.idString===t)return i}}get PartAbbreviation(){return this.partAbbreviation}set PartAbbreviation(t){this.partAbbreviation=t}get Visible(){return this.voices.length>0&&this.Voices[0].Visible}set Visible(t){for(let e=0,i=this.Voices.length;e<i;++e)this.Voices[e].Visible=t}get Audible(){let t=!1;for(let e=0,i=this.Voices.length;e<i;++e){const i=this.Voices[e];t=t||i.Audible}return t}set Audible(t){for(let e=0,i=this.Voices.length;e<i;++e)this.Voices[e].Audible=t;for(let e=0,i=this.staves.length;e<i;++e)this.staves[e].audible=t}get Following(){let t=!1;for(let e=0,i=this.Voices.length;e<i;++e){const i=this.Voices[e];t=t||i.Following}return t}set Following(t){for(let e=0,i=this.Voices.length;e<i;++e)this.Voices[e].Following=t;for(let e=0,i=this.staves.length;e<i;++e)this.staves[e].following=t}SetVoiceAudible(t,e){for(let i=0,n=this.Voices.length;i<n;++i){const n=this.Voices[i];if(n.VoiceId===t){n.Audible=e;break}}}SetVoiceFollowing(t,e){for(let i=0,n=this.Voices.length;i<n;++i){const n=this.Voices[i];if(n.VoiceId===t){n.Following=e;break}}}SetStaffAudible(t,e){const i=this.staves[t-1];if(i.audible=e,e)for(let n=0,s=i.Voices.length;n<s;++n)i.Voices[n].Audible=!0;else for(let n=0,s=i.Voices.length;n<s;++n){const e=i.Voices[n];let s=!1;for(let i=0,n=this.Staves.length;i<n;++i){const n=this.Staves[i];if(n.Id!==t&&n.audible)for(let t=0,i=n.Voices.length;t<i;++t)n.Voices[t]===e&&(s=!0)}s||(e.Audible=!1)}}SetStaffFollow(t,e){const i=this.staves[t-1];if(i.following=e,e)for(let n=0,s=i.Voices.length;n<s;++n)i.Voices[n].Following=!0;else for(let n=0,s=i.Voices.length;n<s;++n){const e=i.Voices[n];let s=!1;for(let i=0,n=this.Staves.length;i<n;++i){const n=this.Staves[i];if(n.Id!==t&&n.following)for(let t=0,i=n.Voices.length;t<i;++t)n.Voices[t]===e&&(s=!0)}s||(e.Following=!1)}}areAllVoiceVisible(){for(const t of this.Voices)if(!t.Visible)return!1;return!0}createStaves(t){for(let e=0;e<t;e++)this.staves.push(new r.Staff(this,e+1))}toString(){return`${this.Name} , id: ${this.id}, idstring: ${this.idString}`}}e.Instrument=o},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.InstrumentalGroup=void 0,e.InstrumentalGroup=class{constructor(t,e,i){this.instrumentalGroups=[],this.name=t,this.musicSheet=e,this.parent=i}get InstrumentalGroups(){return this.instrumentalGroups}get Parent(){return this.parent}get Name(){return this.name}set Name(t){this.name=t}get GetMusicSheet(){return this.musicSheet}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SystemLine=void 0;const n=i(23),s=i(5),r=i(6);class o extends r.GraphicalObject{constructor(t,e,i,n,r){super(),this.lineType=t,this.linePosition=e,this.parentMusicSystem=i,this.topMeasure=n,this.bottomMeasure=r,this.parentTopStaffLine=null==n?void 0:n.ParentStaffLine,this.boundingBox=new s.BoundingBox(this,i.PositionAndShape)}static getObjectWidthForLineType(t,e){switch(e){case n.SystemLinesEnum.SingleThin:return t.SystemThinLineWidth;case n.SystemLinesEnum.DoubleThin:return 2*t.SystemThinLineWidth+t.DistanceBetweenVerticalSystemLines;case n.SystemLinesEnum.ThinBold:return t.SystemThinLineWidth+t.SystemBoldLineWidth+t.DistanceBetweenVerticalSystemLines;case n.SystemLinesEnum.BoldThinDots:case n.SystemLinesEnum.DotsThinBold:return t.SystemThinLineWidth+t.SystemBoldLineWidth+t.DistanceBetweenVerticalSystemLines+t.SystemDotWidth+t.DistanceBetweenDotAndLine;case n.SystemLinesEnum.DotsBoldBoldDots:return 2*t.SystemBoldLineWidth+2*t.SystemDotWidth+2*t.DistanceBetweenDotAndLine+t.DistanceBetweenVerticalSystemLines;default:return 0}}}e.SystemLine=o},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.NoteHeadShape=e.Notehead=void 0;const s=n(i(1));class r{constructor(t,e,i){this.sourceNote=t,this.setShapeFromXml(e,i)}setShapeFromXml(t,e){this.shape=r.ShapeTypeXmlToShape(t);let i=e;void 0===i&&(this.sourceNote?i=this.sourceNote.Length.Denominator>2:(s.default.warn("notehead: sourceNote and filledXmlAttribute undefined."),i=!0)),this.filled=i}get SourceNote(){return this.sourceNote}get Shape(){return this.shape}get Filled(){return this.filled}static ShapeTypeXmlToShape(t){switch(t.toLowerCase()){case"normal":return o.NORMAL;case"x":return o.X;case"slash":return o.SLASH;case"diamond":return o.DIAMOND;case"square":case"la":return o.SQUARE;case"do":case"triangle":return o.TRIANGLE;case"rectangle":return o.RECTANGLE;case"circle-x":return o.CIRCLEX;default:return s.default.info("unsupported/unhandled xml notehead '"+t+"'. Using normal notehead."),o.NORMAL}}}var o,a;e.Notehead=r,(a=o=e.NoteHeadShape||(e.NoteHeadShape={}))[a.CIRCLEX=0]="CIRCLEX",a[a.DIAMOND=1]="DIAMOND",a[a.NORMAL=2]="NORMAL",a[a.RECTANGLE=3]="RECTANGLE",a[a.SLASH=4]="SLASH",a[a.SQUARE=5]="SQUARE",a[a.TRIANGLE=6]="TRIANGLE",a[a.X=7]="X"},function(t,e,i){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSymbol=void 0,(n=e.MusicSymbol||(e.MusicSymbol={}))[n.Unused_first_Symbol=0]="Unused_first_Symbol",n[n.BLACK_HEAD=1]="BLACK_HEAD",n[n.UPWARDS_TAIL=2]="UPWARDS_TAIL",n[n.DOWNWARDS_TAIL=3]="DOWNWARDS_TAIL",n[n.UPWARDS_DOUBLE_TAIL=4]="UPWARDS_DOUBLE_TAIL",n[n.DOWNWARDS_DOUBLE_TAIL=5]="DOWNWARDS_DOUBLE_TAIL",n[n.UPWARDS_TRIPLE_TAIL=6]="UPWARDS_TRIPLE_TAIL",n[n.DOWNWARDS_TRIPLE_TAIL=7]="DOWNWARDS_TRIPLE_TAIL",n[n.UPWARDS_QUAD_TAIL=8]="UPWARDS_QUAD_TAIL",n[n.DOWNWARDS_QUAD_TAIL=9]="DOWNWARDS_QUAD_TAIL",n[n.ROUND_HEAD=10]="ROUND_HEAD",n[n.WHITE_HEAD=11]="WHITE_HEAD",n[n.G_CLEF=12]="G_CLEF",n[n.F_CLEF=13]="F_CLEF",n[n.C_CLEF=14]="C_CLEF",n[n.BREVE=15]="BREVE",n[n.BREVE_REST=16]="BREVE_REST",n[n.COMMON_TIME=17]="COMMON_TIME",n[n.CUT_TIME=18]="CUT_TIME",n[n.WHOLE_REST=19]="WHOLE_REST",n[n.HALF_REST=20]="HALF_REST",n[n.QUARTER_REST=21]="QUARTER_REST",n[n.EIGHTH_REST=22]="EIGHTH_REST",n[n.SIXTEENTH_REST=23]="SIXTEENTH_REST",n[n.THIRTYSECOND_REST=24]="THIRTYSECOND_REST",n[n.SIXTYFOURTH_REST=25]="SIXTYFOURTH_REST",n[n.FLAT=26]="FLAT",n[n.SHARP=27]="SHARP",n[n.NATURAL=28]="NATURAL",n[n.DOUBLE_FLAT=29]="DOUBLE_FLAT",n[n.DOUBLE_SHARP=30]="DOUBLE_SHARP",n[n.ZERO=31]="ZERO",n[n.ONE=32]="ONE",n[n.TWO=33]="TWO",n[n.THREE=34]="THREE",n[n.FOUR=35]="FOUR",n[n.FIVE=36]="FIVE",n[n.SIX=37]="SIX",n[n.SEVEN=38]="SEVEN",n[n.EIGHT=39]="EIGHT",n[n.NINE=40]="NINE",n[n.DOT=41]="DOT",n[n.FERMATA=42]="FERMATA",n[n.INVERTED_FERMATA=43]="INVERTED_FERMATA",n[n.SPICCATO=44]="SPICCATO",n[n.TENUTO=45]="TENUTO",n[n.MARCATO=46]="MARCATO",n[n.MARCATISSIMO=47]="MARCATISSIMO",n[n.INVERTED_MARCATISSIMO=48]="INVERTED_MARCATISSIMO",n[n.P=49]="P",n[n.F=50]="F",n[n.S=51]="S",n[n.Z=52]="Z",n[n.M=53]="M",n[n.R=54]="R",n[n.SEGNO=55]="SEGNO",n[n.CODA=56]="CODA",n[n.DRUM_CLEF=57]="DRUM_CLEF",n[n.G_CLEF_SUB8=58]="G_CLEF_SUB8",n[n.G_CLEF_SUPER8=59]="G_CLEF_SUPER8",n[n.G_CLEF_SUB15=60]="G_CLEF_SUB15",n[n.G_CLEF_SUPER15=61]="G_CLEF_SUPER15",n[n.F_CLEF_SUB8=62]="F_CLEF_SUB8",n[n.F_CLEF_SUPER8=63]="F_CLEF_SUPER8",n[n.F_CLEF_SUB15=64]="F_CLEF_SUB15",n[n.F_CLEF_SUPER15=65]="F_CLEF_SUPER15",n[n.DOWN_BOW=66]="DOWN_BOW",n[n.MORDENT=67]="MORDENT",n[n.INVERTED_MORDENT=68]="INVERTED_MORDENT",n[n.TURN=69]="TURN",n[n.INVERTED_TURN=70]="INVERTED_TURN",n[n.LEFTHAND_PIZZICATO=71]="LEFTHAND_PIZZICATO",n[n.RELEASE_PED=72]="RELEASE_PED",n[n.ENGAGE_PED=73]="ENGAGE_PED",n[n.VA8=74]="VA8",n[n.VB8=75]="VB8",n[n.TRILL=76]="TRILL",n[n.MA15=77]="MA15",n[n.MB15=78]="MB15",n[n.HIGH=79]="HIGH",n[n.PLAY=80]="PLAY",n[n.MIC=81]="MIC",n[n.SNAP_PIZZICATO=82]="SNAP_PIZZICATO",n[n.NATURAL_HARMONIC=83]="NATURAL_HARMONIC",n[n.EditPen=84]="EditPen"},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AlignmentManager=void 0;const n=i(57),s=i(4);e.AlignmentManager=class{constructor(t){this.parentStaffline=t,this.rules=this.parentStaffline.ParentMusicSystem.rules}alignDynamicExpressions(){var t,e;const i=[];let s=new Array;for(let n=0;n<this.parentStaffline.AbstractExpressions.length-1;n++){const r=this.parentStaffline.AbstractExpressions[n],o=this.parentStaffline.AbstractExpressions[n+1];if((null===(t=null==r?void 0:r.SourceExpression)||void 0===t?void 0:t.Placement)===(null===(e=null==o?void 0:o.SourceExpression)||void 0===e?void 0:e.Placement)){const t=this.getDistance(r.PositionAndShape,o.PositionAndShape);Math.abs(t.x)<this.rules.DynamicExpressionMaxDistance?(-1===s.indexOf(r)&&s.push(r),s.push(o)):(i.push(s),s=new Array)}}i.push(s);for(const r of i)if(r.length>0){const t=r.map((t=>t.PositionAndShape.Center.y)),e=Math.max(...t);for(let i=0;i<r.length;i++){const s=r[i],o=t[i]-e;if(s instanceof n.VexFlowContinuousDynamicExpression?(s.shiftYPosition(-o),s.calcPsi()):(s.PositionAndShape.RelativePosition.y-=.8*o,s.PositionAndShape.calculateBoundingBox()),s.squeeze){const t=i<r.length-1?r[i+1]:void 0,e=i>0?r[i-1]:void 0;if(t){const e=this.getOverlap(s.PositionAndShape,t.PositionAndShape);s.squeeze(-(e.x+this.rules.DynamicExpressionSpacer))}if(e){const t=this.getOverlap(e.PositionAndShape,s.PositionAndShape);s.squeeze(t.x+this.rules.DynamicExpressionSpacer)}}}}}getDistance(t,e){const i=t.RelativePosition.x+t.BorderMarginRight,n=e.RelativePosition.x+e.BorderMarginLeft,r=t.RelativePosition.y+t.BorderMarginBottom,o=e.RelativePosition.y+e.BorderMarginTop;return new s.PointF2D(n-i,o-r)}getOverlap(t,e){return new s.PointF2D(t.RelativePosition.x+t.BorderMarginRight-(e.RelativePosition.x+e.BorderMarginLeft),t.RelativePosition.y+t.BorderMarginBottom-(e.RelativePosition.y+e.BorderMarginTop))}}},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalInstantaneousDynamicExpression=void 0;const s=i(42),r=i(3),o=n(i(1));class a extends s.AbstractGraphicalExpression{constructor(t,e,i){super(e,t,i.parentSourceMeasure),this.mInstantaneousDynamicExpression=t,this.mMeasure=i}updateSkyBottomLine(){const t=this.parentStaffLine.SkyBottomLineCalculator,e=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginLeft,i=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginRight;let n=0;switch(this.Placement){case r.PlacementEnum.Above:n=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginTop,t.updateSkyLineInRange(e,i,n);break;case r.PlacementEnum.Below:n=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginBottom,t.updateBottomLineInRange(e,i,n);break;default:o.default.error("Placement for GraphicalInstantaneousDynamicExpression is unknown")}}}e.GraphicalInstantaneousDynamicExpression=a},function(t,e,i){var n,s;Object.defineProperty(e,"__esModule",{value:!0}),e.ArpeggioType=e.Arpeggio=void 0,e.Arpeggio=class{constructor(t,e=n.ARPEGGIO_DIRECTIONLESS){this.parentVoiceEntry=t,this.type=e,this.notes=[]}addNote(t){this.notes.push(t),t.Arpeggio=this}},(s=n=e.ArpeggioType||(e.ArpeggioType={}))[s.BRUSH_DOWN=1]="BRUSH_DOWN",s[s.BRUSH_UP=2]="BRUSH_UP",s[s.ROLL_DOWN=3]="ROLL_DOWN",s[s.ROLL_UP=4]="ROLL_UP",s[s.RASQUEDO_DOWN=5]="RASQUEDO_DOWN",s[s.RASQUEDO_UP=6]="RASQUEDO_UP",s[s.ARPEGGIO_DIRECTIONLESS=7]="ARPEGGIO_DIRECTIONLESS"},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.PartListEntry=void 0,e.PartListEntry=class{constructor(t){this.enrolledTimestamps=[],this.visible=!0,this.musicSheet=t}get Visible(){return this.visible}set Visible(t){this.visible=t}getFirstSourceMeasure(){return this.musicSheet.SourceMeasures[this.startIndex]}getLastSourceMeasure(){return this.musicSheet.SourceMeasures[this.endIndex]}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(10),s=i(35),r=i(29),o=function(){function t(t){this.dictionary=new r.default(t)}return t.prototype.contains=function(t){return this.dictionary.containsKey(t)},t.prototype.add=function(t){return!this.contains(t)&&!n.isUndefined(t)&&(this.dictionary.setValue(t,t),!0)},t.prototype.intersection=function(t){var e=this;this.forEach((function(i){return t.contains(i)||e.remove(i),!0}))},t.prototype.union=function(t){var e=this;t.forEach((function(t){return e.add(t),!0}))},t.prototype.difference=function(t){var e=this;t.forEach((function(t){return e.remove(t),!0}))},t.prototype.isSubsetOf=function(t){if(this.size()>t.size())return!1;var e=!0;return this.forEach((function(i){return!!t.contains(i)||(e=!1,!1)})),e},t.prototype.remove=function(t){return!!this.contains(t)&&(this.dictionary.remove(t),!0)},t.prototype.forEach=function(t){this.dictionary.forEach((function(e,i){return t(i)}))},t.prototype.toArray=function(){return this.dictionary.values()},t.prototype.isEmpty=function(){return this.dictionary.isEmpty()},t.prototype.size=function(){return this.dictionary.size()},t.prototype.clear=function(){this.dictionary.clear()},t.prototype.toString=function(){return s.toString(this.toArray())},t}();e.default=o},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(10),s=i(84),r=function(){function t(t){this.root=null,this.compare=t||n.defaultCompare,this.nElements=0}return t.prototype.add=function(t){return!n.isUndefined(t)&&null!==this.insertNode(this.createNode(t))&&(this.nElements++,!0)},t.prototype.clear=function(){this.root=null,this.nElements=0},t.prototype.isEmpty=function(){return 0===this.nElements},t.prototype.size=function(){return this.nElements},t.prototype.contains=function(t){return!n.isUndefined(t)&&null!==this.searchNode(this.root,t)},t.prototype.search=function(t){var e=this.searchNode(this.root,t);if(null!==e)return e.element},t.prototype.remove=function(t){var e=this.searchNode(this.root,t);return null!==e&&(this.removeNode(e),this.nElements--,!0)},t.prototype.inorderTraversal=function(t){this.inorderTraversalAux(this.root,t,{stop:!1})},t.prototype.preorderTraversal=function(t){this.preorderTraversalAux(this.root,t,{stop:!1})},t.prototype.postorderTraversal=function(t){this.postorderTraversalAux(this.root,t,{stop:!1})},t.prototype.levelTraversal=function(t){this.levelTraversalAux(this.root,t)},t.prototype.minimum=function(){if(!this.isEmpty()&&null!==this.root)return this.minimumAux(this.root).element},t.prototype.maximum=function(){if(!this.isEmpty()&&null!==this.root)return this.maximumAux(this.root).element},t.prototype.forEach=function(t){this.inorderTraversal(t)},t.prototype.toArray=function(){var t=[];return this.inorderTraversal((function(e){return t.push(e),!0})),t},t.prototype.height=function(){return this.heightAux(this.root)},t.prototype.searchNode=function(t,e){for(var i=1;null!==t&&0!==i;)(i=this.compare(e,t.element))<0?t=t.leftCh:i>0&&(t=t.rightCh);return t},t.prototype.transplant=function(t,e){null===t.parent?this.root=e:t===t.parent.leftCh?t.parent.leftCh=e:t.parent.rightCh=e,null!==e&&(e.parent=t.parent)},t.prototype.removeNode=function(t){if(null===t.leftCh)this.transplant(t,t.rightCh);else if(null===t.rightCh)this.transplant(t,t.leftCh);else{var e=this.minimumAux(t.rightCh);e.parent!==t&&(this.transplant(e,e.rightCh),e.rightCh=t.rightCh,e.rightCh.parent=e),this.transplant(t,e),e.leftCh=t.leftCh,e.leftCh.parent=e}},t.prototype.inorderTraversalAux=function(t,e,i){null===t||i.stop||(this.inorderTraversalAux(t.leftCh,e,i),i.stop||(i.stop=!1===e(t.element),i.stop||this.inorderTraversalAux(t.rightCh,e,i)))},t.prototype.levelTraversalAux=function(t,e){var i=new s.default;for(null!==t&&i.enqueue(t),t=i.dequeue()||null;null!=t;){if(!1===e(t.element))return;null!==t.leftCh&&i.enqueue(t.leftCh),null!==t.rightCh&&i.enqueue(t.rightCh),t=i.dequeue()||null}},t.prototype.preorderTraversalAux=function(t,e,i){null===t||i.stop||(i.stop=!1===e(t.element),i.stop||(this.preorderTraversalAux(t.leftCh,e,i),i.stop||this.preorderTraversalAux(t.rightCh,e,i)))},t.prototype.postorderTraversalAux=function(t,e,i){null===t||i.stop||(this.postorderTraversalAux(t.leftCh,e,i),i.stop||(this.postorderTraversalAux(t.rightCh,e,i),i.stop||(i.stop=!1===e(t.element))))},t.prototype.minimumAux=function(t){for(;null!=t&&null!==t.leftCh;)t=t.leftCh;return t},t.prototype.maximumAux=function(t){for(;null!=t&&null!==t.rightCh;)t=t.rightCh;return t},t.prototype.heightAux=function(t){return null===t?-1:Math.max(this.heightAux(t.leftCh),this.heightAux(t.rightCh))+1},t.prototype.insertNode=function(t){for(var e=null,i=this.root;null!==i;){var n=this.compare(t.element,i.element);if(0===n)return null;n<0?(e=i,i=i.leftCh):(e=i,i=i.rightCh)}return t.parent=e,null===e?this.root=t:this.compare(t.element,e.element)<0?e.leftCh=t:e.rightCh=t,t},t.prototype.createNode=function(t){return{element:t,leftCh:null,rightCh:null,parent:null}},t}();e.default=r},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(53),s=function(){function t(){this.list=new n.default}return t.prototype.enqueue=function(t){return this.list.add(t)},t.prototype.add=function(t){return this.list.add(t)},t.prototype.dequeue=function(){if(0!==this.list.size()){var t=this.list.first();return this.list.removeElementAtIndex(0),t}},t.prototype.peek=function(){if(0!==this.list.size())return this.list.first()},t.prototype.size=function(){return this.list.size()},t.prototype.contains=function(t,e){return this.list.contains(t,e)},t.prototype.isEmpty=function(){return this.list.size()<=0},t.prototype.clear=function(){this.list.clear()},t.prototype.forEach=function(t){this.list.forEach(t)},t}();e.default=s},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(10),s=i(35),r=function(){function t(t){this.data=[],this.compare=t||n.defaultCompare}return t.prototype.leftChildIndex=function(t){return 2*t+1},t.prototype.rightChildIndex=function(t){return 2*t+2},t.prototype.parentIndex=function(t){return Math.floor((t-1)/2)},t.prototype.minIndex=function(t,e){return e>=this.data.length?t>=this.data.length?-1:t:this.compare(this.data[t],this.data[e])<=0?t:e},t.prototype.siftUp=function(t){for(var e=this.parentIndex(t);t>0&&this.compare(this.data[e],this.data[t])>0;)s.swap(this.data,e,t),t=e,e=this.parentIndex(t)},t.prototype.siftDown=function(t){for(var e=this.minIndex(this.leftChildIndex(t),this.rightChildIndex(t));e>=0&&this.compare(this.data[t],this.data[e])>0;)s.swap(this.data,e,t),t=e,e=this.minIndex(this.leftChildIndex(t),this.rightChildIndex(t))},t.prototype.peek=function(){return this.data.length>0?this.data[0]:void 0},t.prototype.add=function(t){return!n.isUndefined(t)&&(this.data.push(t),this.siftUp(this.data.length-1),!0)},t.prototype.removeRoot=function(){if(this.data.length>0){var t=this.data[0];return this.data[0]=this.data[this.data.length-1],this.data.splice(this.data.length-1,1),this.data.length>0&&this.siftDown(0),t}},t.prototype.contains=function(t){var e=n.compareToEquals(this.compare);return s.contains(this.data,t,e)},t.prototype.size=function(){return this.data.length},t.prototype.isEmpty=function(){return this.data.length<=0},t.prototype.clear=function(){this.data.length=0},t.prototype.forEach=function(t){s.forEach(this.data,t)},t}();e.default=r},function(t,e,i){var n,s=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(29),o=i(10),a=function(t){function e(e,i){var n=t.call(this,i)||this;return n.defaultFactoryFunction=e,n}return s(e,t),e.prototype.setDefault=function(e,i){var n=t.prototype.getValue.call(this,e);return o.isUndefined(n)?(this.setValue(e,i),i):n},e.prototype.getValue=function(t){return this.setDefault(t,this.defaultFactoryFunction())},e}(r.default);e.default=a},function(t,e,i){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.Fonts=void 0,(n=e.Fonts||(e.Fonts={}))[n.TimesNewRoman=0]="TimesNewRoman",n[n.Kokila=1]="Kokila"},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalUnknownExpression=void 0;const s=i(42),r=i(3),o=n(i(1));class a extends s.AbstractGraphicalExpression{constructor(t,e,i,n,s){super(t,new r.AbstractExpression(i),n),this.label=e,this.sourceMultiExpression=s}updateSkyBottomLine(){const t=this.parentStaffLine.SkyBottomLineCalculator,e=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft,i=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight;switch(this.Placement){case r.PlacementEnum.Above:const n=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;t.updateSkyLineInRange(e,i,n);break;case r.PlacementEnum.Below:const s=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;t.updateBottomLineInRange(e,i,s);break;default:o.default.error("Placement for GraphicalUnknownExpression is unknown")}}}e.GraphicalUnknownExpression=a},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowMusicSheetCalculator=void 0;const s=i(17),r=i(90),o=i(128),a=i(63),l=n(i(8)),h=n(i(1)),c=i(16),u=i(129),d=i(130),f=i(97),p=i(93),m=i(9),b=i(131),g=i(57),y=i(37),S=i(25),v=i(100),x=i(39),E=i(13),_=i(102);class w extends s.MusicSheetCalculator{constructor(t){var e,i,n,o,h,c,u,d;super(),this.beamsNeedUpdate=!1,this.rules=t,s.MusicSheetCalculator.symbolFactory=new r.VexFlowGraphicalSymbolFactory,s.MusicSheetCalculator.TextMeasurer=new a.VexFlowTextMeasurer(this.rules),s.MusicSheetCalculator.stafflineNoteCalculator=new v.VexflowStafflineNoteCalculator(this.rules),"gonville"===(null===(e=this.rules.DefaultVexFlowNoteFont)||void 0===e?void 0:e.toLowerCase())?l.default.Flow.DEFAULT_FONT_STACK=[null===(i=l.default.Flow.Fonts)||void 0===i?void 0:i.Gonville,null===(n=l.default.Flow.Fonts)||void 0===n?void 0:n.Bravura,null===(o=l.default.Flow.Fonts)||void 0===o?void 0:o.Custom]:"petaluma"===(null===(h=this.rules.DefaultVexFlowNoteFont)||void 0===h?void 0:h.toLowerCase())&&(l.default.Flow.DEFAULT_FONT_STACK=[null===(c=l.default.Flow.Fonts)||void 0===c?void 0:c.Petaluma,null===(u=l.default.Flow.Fonts)||void 0===u?void 0:u.Gonville,null===(d=l.default.Flow.Fonts)||void 0===d?void 0:d.Bravura])}clearRecreatedObjects(){var t;super.clearRecreatedObjects(),s.MusicSheetCalculator.stafflineNoteCalculator=new v.VexflowStafflineNoteCalculator(this.rules);for(const e of this.graphicalMusicSheet.MeasureList)for(const i of e)null===(t=i)||void 0===t||t.clean()}formatMeasures(){for(const t of this.graphicalMusicSheet.MeasureList)if(t&&t[0]){t[0].format();for(const e of t){for(const t of e.staffEntries)t.calculateXPosition();e.finalizeBeams()}}this.beamsNeedUpdate=!1}calculateMeasureXLayout(t){const e=[];for(const s of t)s&&e.push(s);if(0===e.length)return 0;t=e;const i=[],n=new l.default.Flow.Formatter({softmaxFactor:this.rules.SoftmaxFactorVexFlow});let r=t[0].staffEntries.length,o=1;for(const s of t){if(!s)continue;let t=0;for(const i of s.staffEntries)t+=i.setMaxAccidentals();s.parentSourceMeasure.ImplicitMeasure&&(r=Math.max(s.staffEntries.length,r),o=Math.max(s.staffEntries.length+t,o));const e=s.vfVoices,a=[];for(const n in e)e.hasOwnProperty(n)&&(a.push(e[n]),i.push(e[n]));0!==a.length?n.joinVoices(a):h.default.debug("Found a measure with no voices. Continuing anyway.",e)}let a=12;const u=t[0].parentSourceMeasure;if(i.length>0){const e=.3;a=n.preCalculateMinTotalWidth(i)/c.unitInPixels*this.rules.VoiceSpacingMultiplierVexflow+this.rules.VoiceSpacingAddendVexflow+r*e,(null==u?void 0:u.ImplicitMeasure)&&(a=u.Duration.RealValue/u.ActiveTimeSignature.RealValue*a,r>1&&(a+=o*e*1.5),a*=this.rules.PickupMeasureWidthMultiplier),s.MusicSheetCalculator.setMeasuresMinStaffEntriesWidth(t,a);const l=(t,e)=>{n.formatToStave(i,e.getVFStave())},h=(t,e)=>{n.formatToStave(i,e.getVFStave(),{align_rests:!0,context:void 0})};for(const i of t){if(this.rules.AlignRests===S.AlignRestOption.Never)i.formatVoices=l;else if(this.rules.AlignRests===S.AlignRestOption.Always)i.formatVoices=h;else if(this.rules.AlignRests===S.AlignRestOption.Auto){let t=!1;for(const e of i.staffEntries){let i=0,n=0;for(const s of e.graphicalVoiceEntries)if(s.parentVoiceEntry.IsGrace||s&&s.notes&&s.notes[0]&&s.notes[0].sourceNote&&s.notes[0].sourceNote.PrintObject&&i++,s&&s.notes&&s.notes[0]&&s.notes[0].sourceNote&&s.notes[0].sourceNote.isRest()&&s.notes[0].sourceNote.PrintObject&&n++,i>1&&n>=1){t=!0;break}if(t)break}i.formatVoices=t?h:l}if(i===t[0]){const t=i;t.formatVoices(a*c.unitInPixels,t)}}}for(const s of t)if(s)for(const t of s.staffEntries)t.calculateXPosition();return a}calculateElongationFactor(t,e,i,n,s,r,o,a){let l=s,h=0;for(const c of t){const t=c.GraphicalLabel.Label.textAlignment;let d=o,f=a;if(c instanceof u.GraphicalLyricEntry&&c.ParentLyricWord){c.LyricsEntry.SyllableIndex>0&&(d=this.rules.BetweenSyllableMinimumDistance,m.TextAlignment.IsCenterAligned(t)&&(d+=1));const e=c.ParentLyricWord.GetLyricWord.Syllables;e.length>1&&c.LyricsEntry.SyllableIndex<e.length-1&&(void 0===this.dashSpace&&(this.dashSpace=1.5),f-=this.dashSpace)}const p=c instanceof u.GraphicalLyricEntry?c.GraphicalLabel.PositionAndShape:c.PositionAndShape,b=p.Size.width,g=e.PositionAndShape.RelativePosition.x+p.BorderMarginLeft;let y,S,v,x;void 0!==i[h]&&i[h].extend,i[h]&&(S=g-i[h].xPosition);const E=n*s;m.TextAlignment.IsCenterAligned(t)?(f/=4,v=E-g,x=b/2-f,i[h]&&(y=i[h].labelWidth/2+b/2+d)):m.TextAlignment.IsLeft(t)&&(v=E-g,x=b-f,i[h]&&(y=i[h].labelWidth+d));let _=1;const w=x/v;let T=1;if(c instanceof u.GraphicalLyricEntry&&c.LyricsEntry){if(i[h]){const t=i[h].sourceNoteDuration;T=y/S,t.Denominator>4&&(T*=1.1)}}else i[h]&&(T=y/S);_=Math.max(w,T),l=Math.max(l,_);let M=Math.max(y-S||0,0);i[h]&&(M+=i[h].cumulativeOverlap),i[h]={cumulativeOverlap:M,extend:c instanceof u.GraphicalLyricEntry&&c.LyricsEntry.extend,labelWidth:b,measureNumber:r,sourceNoteDuration:c instanceof u.GraphicalLyricEntry&&c.LyricsEntry&&c.LyricsEntry.Parent.Notes[0].Length,text:c instanceof u.GraphicalLyricEntry?c.LyricsEntry.Text:c.GraphicalLabel.Label.text,xPosition:g},h++}return l}calculateElongationFactorFromStaffEntries(t,e,i,n){let s=i;const r={},o={};for(const a of t)a.LyricsEntries.length>0&&(s=this.calculateElongationFactor(a.LyricsEntries,a,r,e,s,n,this.rules.HorizontalBetweenLyricsDistance,this.rules.LyricOverlapAllowedIntoNextMeasure)),a.graphicalChordContainers.length>0&&(s=this.calculateElongationFactor(a.graphicalChordContainers,a,o,e,s,n,this.rules.ChordSymbolXSpacing,this.rules.ChordOverlapAllowedIntoNextMeasure));return s}calculateMeasureWidthFromStaffEntries(t,e){let i=1;for(const n of t)n&&0!==n.staffEntries.length&&(i=this.calculateElongationFactorFromStaffEntries(n.staffEntries,e,i,n.MeasureNumber));return i=Math.min(i,this.rules.MaximumLyricsElongationFactor),e*i}createGraphicalTie(t,e,i,n,s){return new o.GraphicalTie(t,n,s)}updateStaffLineBorders(t){t.SkyBottomLineCalculator.updateStaffLineBorders()}graphicalMeasureCreatedCalculations(t){t.rules=this.rules,t.graphicalMeasureCreatedCalculations()}layoutVoiceEntry(t,e,i,n){for(let r=0;r<e.length;r++)e[r]=s.MusicSheetCalculator.stafflineNoteCalculator.positionNote(e[r])}layoutStaffEntry(t){t.parentMeasure.layoutStaffEntry(t)}initGraphicalMeasuresCreation(){}layoutArticulationMarks(t,e,i){}layoutGraphicalTie(t,e,i){const n=t.StartNote,s=t.EndNote;let r,o=0;n&&n.vfnote&&n.vfnote.length>=2&&(r=n.vfnote[0],o=n.vfnote[1]);let a,h=0;if(s&&s.vfnote&&s.vfnote.length>=2&&(a=s.vfnote[0],h=s.vfnote[1]),e){if(r){const t=new l.default.Flow.StaveTie({first_indices:[o],first_note:r});n.parentVoiceEntry.parentStaffEntry.parentMeasure.vfTies.push(t)}if(a){const t=new l.default.Flow.StaveTie({last_indices:[h],last_note:a});s.parentVoiceEntry.parentStaffEntry.parentMeasure.vfTies.push(t)}}else if(r||a){let e;if(i)if("S"===t.Tie.Type){const i=t.StartNote.sourceNote,n=t.EndNote.sourceNote;let s=1;i.FretNumber>n.FretNumber&&(s=-1),e=new l.default.Flow.TabSlide({first_indices:[o],first_note:r,last_indices:[h],last_note:a},s)}else e=new l.default.Flow.TabTie({first_indices:[o],first_note:r,last_indices:[h],last_note:a},t.Tie.Type);else e=new l.default.Flow.StaveTie({first_indices:[o],first_note:r,last_indices:[h],last_note:a});s.parentVoiceEntry.parentStaffEntry.parentMeasure.vfTies.push(e)}}calculateDynamicExpressionsForMultiExpression(t,e,i){if(e<this.rules.MinMeasureToDrawIndex||e>this.rules.MaxMeasureToDrawIndex)return;const n=t.AbsoluteTimestamp,s=this.graphicalMusicSheet.MeasureList[e],r=s[i].ParentStaffLine,o=s[i],a=this.getRelativePositionInStaffLineFromTimestamp(n,i,r,null==r?void 0:r.isPartOfMultiStaffInstrument()),l=a;if(a.x<=0&&(l.x=o.beginInstructionsWidth+this.rules.RhythmRightMargin),t.InstantaneousDynamic){const e=new p.VexFlowInstantaneousDynamicExpression(t.InstantaneousDynamic,r,o);this.calculateGraphicalInstantaneousDynamicExpression(e,l)}if(t.StartingContinuousDynamic){const e=t.StartingContinuousDynamic,i=new g.VexFlowContinuousDynamicExpression(t.StartingContinuousDynamic,r,o.parentSourceMeasure);if(i.StartMeasure=o,!i.IsVerbal&&e.EndMultiExpression)try{this.calculateGraphicalContinuousDynamic(i,l)}catch(c){}else i.IsVerbal?this.calculateGraphicalVerbalContinuousDynamic(i,l):h.default.warn("This continuous dynamic is not covered")}}createMetronomeMark(t){var e;const i=Math.max(t.ParentMultiTempoExpression.SourceMeasureParent.MeasureNumber-1,0),n=Math.max(t.StaffNumber-1,0),s=0===i&&0===n,r=this.graphicalMusicSheet.MeasureList[i][n].getVFStave();let o="q";if(t.beatUnit){const e=x.NoteTypeHandler.getNoteDurationFromType(t.beatUnit);o=E.VexFlowConverter.duration(e,!1)}let a=this.rules.MetronomeMarkYShift,l=!1;for(const c of t.parentMeasure.TempoExpressions){const t=(null===(e=c.InstantaneousTempo)||void 0===e?void 0:e.Enum)===y.TempoEnum.metronomeMark;if(c.getPlacementOfFirstEntry()===_.PlacementEnum.Above&&!t){l=!0;break}}l&&(a-=1.4);const h=this.graphicalMusicSheet.MeasureList[0][0].ParentStaffLine.SkyLine;r.setTempo({bpm:t.TempoInBpm,dots:t.dotted,duration:o},a*c.unitInPixels);const u=s?this.rules.MetronomeMarkXShift*c.unitInPixels:0;r.getModifiers()[r.getModifiers().length-1].setShiftX(u),h[0]=Math.min(h[0],-4.5+a)}calculateRehearsalMark(t){const e=t.rehearsalExpression;if(!e)return;const i=Math.max(t.MeasureNumber-1,0),n=this.graphicalMusicSheet.MeasureList[i][0].getVFStave(),s=-this.rules.RehearsalMarkYOffsetDefault-this.rules.RehearsalMarkYOffset;let r=this.rules.RehearsalMarkXOffsetDefault+this.rules.RehearsalMarkXOffset;t.IsSystemStartMeasure&&(r+=this.rules.RehearsalMarkXOffsetSystemStartMeasure);const o=this.rules.RehearsalMarkFontSize;n.setSection(e.label,s,r,o)}calculateSingleOctaveShift(t,e,i,n){var s;const r=e.OctaveShiftStart,o=r.ParentStartMultiExpression.Timestamp,a=null===(s=r.ParentEndMultiExpression)||void 0===s?void 0:s.Timestamp,l=this.rules.MinMeasureToDrawIndex,c=this.rules.MaxMeasureToDrawIndex;let u,d,p=this.graphicalMusicSheet.MeasureList[i][n].ParentStaffLine;if(p||(p=this.graphicalMusicSheet.MeasureList[l][n].ParentStaffLine),u=r.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentEndMultiExpression.SourceMeasureParent,n):this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(n,!0),u.MeasureNumber>c+1&&(u=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(n,!0)),d=r.ParentEndMultiExpression?this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(r.ParentStartMultiExpression.SourceMeasureParent,n):this.graphicalMusicSheet.MeasureList[l][n],d.MeasureNumber<l+1&&(d=this.graphicalMusicSheet.MeasureList[l][n]),d.MeasureNumber<l+1||d.MeasureNumber>c+1||u.MeasureNumber<l+1||u.MeasureNumber>c+1)return;let m=u.ParentStaffLine;if(m||(m=p),u&&p&&m){const t=new f.VexFlowOctaveShift(r,p.PositionAndShape);if(!t.startNote){let e;for(const t of d.staffEntries)if(t){e=t;break}if(!e)return;if(t.setStartNote(e),!t.startNote)return}if(!t.endNote){let e;for(let t=u.staffEntries.length-1;t>=0;t++)if(u.staffEntries[t]){e=u.staffEntries[t];break}if(t.setEndNote(e),!t.endNote)return}let e=d.findGraphicalStaffEntryFromTimestamp(o);e||(e=d.staffEntries[0]);let i=u.findGraphicalStaffEntryFromTimestamp(a);if(i||(i=u.staffEntries[u.staffEntries.length-1]),t.setStartNote(e),m!==p){t.endsOnDifferentStaffLine=!0;let s=p.Measures[p.Measures.length-1];void 0===s&&(s=u);const o=s.staffEntries[s.staffEntries.length-1];t.setEndNote(o);const a=m.ParentMusicSystem.Id-p.ParentMusicSystem.Id;if(a>0)for(let t=p.ParentMusicSystem.Id;t<m.ParentMusicSystem.Id;t++){const e=t+1,s=this.musicSystems[e].StaffLines[n],o=s.Measures[0],l=new f.VexFlowOctaveShift(r,o.PositionAndShape);t<a&&(l.endsOnDifferentStaffLine=!0);let h=s.Measures[s.Measures.length-1];const c=o.staffEntries[0];let d=h.staffEntries[h.staffEntries.length-1];u.ParentStaffLine===s&&(h=u,d=i),l.setStartNote(c),l.setEndNote(d),s.OctaveShifts.push(l),this.calculateOctaveShiftSkyBottomLine(c,d,l,s)}this.calculateOctaveShiftSkyBottomLine(e,o,t,p)}else t.setEndNote(i),this.calculateOctaveShiftSkyBottomLine(e,i,t,p);p.OctaveShifts.push(t)}else h.default.warn("End measure or staffLines for octave shift are undefined! This should not happen!")}calculateOctaveShiftSkyBottomLine(t,e,i,n){let s=t.PositionAndShape.Size.width,r=e.PositionAndShape.Size.width;t.hasOnlyRests()?s=-s:s/=2,e.hasOnlyRests()?r*=2:r/=2,t===e&&(r*=2);const o=t.PositionAndShape.AbsolutePosition.x-s,a=e.PositionAndShape.AbsolutePosition.x+r;i.PositionAndShape.Size.width=o-a;const h=i.getTextBracket(),c=h.font.size/10;if(h.position===l.default.Flow.TextBracket.Positions.TOP){const t=Math.ceil(n.SkyBottomLineCalculator.getSkyLineMinInRange(o,a));if(t===1/0)return;h.start.getStave().options.top_text_position=Math.abs(t),n.SkyBottomLineCalculator.updateSkyLineInRange(o,a,t-2*c)}else{const t=n.SkyBottomLineCalculator.getBottomLineMaxInRange(o,a);if(t===1/0)return;h.start.getStave().options.bottom_text_position=t,n.SkyBottomLineCalculator.updateBottomLineInRange(o,a,t+1.5*c)}}calculateWordRepetitionInstruction(t,e){let i;const n=this.graphicalMusicSheet.MeasureList[e];for(let s=0,r=n.length;s<r;++s){const t=n[s];if(t&&t.ParentStaffLine&&t.ParentStaff.ParentInstrument.Visible){i=t;break}}i&&i.addWordRepetition(t)}calculateExpressionAlignements(){for(const e of this.musicSystems)for(const i of e.StaffLines)try{i.AlignmentManager.alignDynamicExpressions(),i.AbstractExpressions.forEach((t=>{t.updateSkyBottomLine()}))}catch(t){}}handleTiedGraphicalNote(t,e,i,n,s,r,o,a){}handleBeam(t,e,i){t.parentVoiceEntry.parentStaffEntry.parentMeasure.handleBeam(t,e)}handleVoiceEntryLyrics(t,e,i){t.LyricsEntries.forEach(((t,n)=>{const s=new u.GraphicalLyricEntry(n,e,this.rules.LyricsHeight,this.rules.StaffHeight);if(e.LyricsEntries.push(s),s.GraphicalLabel.setLabelPositionAndShapeBorders(),n.Word){const t=n.Word.Syllables.indexOf(n);let e=i.indexOf(n.Word);if(-1===e&&(i.push(n.Word),e=i.indexOf(n.Word)),0===this.graphicalLyricWords.length||e>this.graphicalLyricWords.length-1){const e=new d.GraphicalLyricWord(n.Word);s.ParentLyricWord=e,e.GraphicalLyricsEntries[t]=s,this.graphicalLyricWords.push(e)}else{const n=this.graphicalLyricWords[e];s.ParentLyricWord=n,n.GraphicalLyricsEntries[t]=s,n.isFilled()&&(i.splice(e,1),this.graphicalLyricWords.splice(this.graphicalLyricWords.indexOf(n),1))}}}))}handleVoiceEntryOrnaments(t,e,i){}handleVoiceEntryArticulations(t,e,i){}handleVoiceEntryTechnicalInstructions(t,e,i){}handleTuplet(t,e,i){t.parentVoiceEntry.parentStaffEntry.parentMeasure.handleTuplet(t,e)}findIndexGraphicalSlurFromSlur(t,e){for(let i=0;i<t.length;i++)if(t[i].slur===e)return i;return-1}calculateSlurs(){const t={};for(const e of this.graphicalMusicSheet.MeasureList[0])t[e.ParentStaff.idInMusicSheet]=[];for(const e of this.musicSystems)for(const i of e.StaffLines){const e=t[i.ParentStaff.idInMusicSheet];for(let t=0;t<e.length;t++){const n=e[t],s=new b.GraphicalSlur(n.slur,this.rules);i.addSlurToStaffline(s),e[t]=s}for(const t of i.Measures)for(const n of t.staffEntries){for(const t of n.graphicalVoiceEntries)for(const s of t.notes)for(const t of s.sourceNote.NoteSlurs)if(t.EndNote&&t.StartNote){if(t.StartNote===s.sourceNote){if(s.sourceNote.NoteTie&&s.parentVoiceEntry.parentStaffEntry.getAbsoluteTimestamp()!==s.sourceNote.NoteTie.StartNote.getAbsoluteTimestamp())break;const n=new b.GraphicalSlur(t,this.rules);e.push(n),i.addSlurToStaffline(n)}if(t.EndNote===s.sourceNote){const i=this.findIndexGraphicalSlurFromSlur(e,t);if(i>=0){const t=e[i];-1===t.staffEntries.indexOf(n)&&t.staffEntries.push(n),e.splice(i,1)}}}for(const t of e)-1===t.staffEntries.indexOf(n)&&t.staffEntries.push(n)}}for(const e of this.musicSystems)for(const t of e.StaffLines){const e=t.GraphicalSlurs.sort(b.GraphicalSlur.Compare);for(const t of e)t.slur.isCrossed()||t.calculateCurve(this.rules)}}}e.VexFlowMusicSheetCalculator=w},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowGraphicalSymbolFactory=void 0;const s=n(i(8)),r=i(91),o=i(44),a=i(98),l=i(30),h=i(60),c=i(127),u=i(62),d=i(13),f=i(101),p=i(99),m=i(96);e.VexFlowGraphicalSymbolFactory=class{createMusicSystem(t,e){return new r.VexFlowMusicSystem(t,e)}createStaffLine(t,e){return new p.VexFlowStaffLine(t,e)}createGraphicalMeasure(t,e,i=!1){return new o.VexFlowMeasure(e,t,void 0)}createMultiRestMeasure(t,e,i){return new m.VexFlowMultiRestMeasure(e,t,i)}createTabStaffMeasure(t,e){return new f.VexFlowTabMeasure(e,t)}createExtraGraphicalMeasure(t){return new o.VexFlowMeasure(t.ParentStaff,void 0,t)}createStaffEntry(t,e){return new a.VexFlowStaffEntry(e,t,void 0)}createVoiceEntry(t,e){return new u.VexFlowVoiceEntry(t,e)}createNote(t,e,i,n=l.OctaveEnum.NONE,s,r){return new h.VexFlowGraphicalNote(t,e,i,n,s,r)}createGraceNote(t,e,i,n,s=l.OctaveEnum.NONE){return new h.VexFlowGraphicalNote(t,e,i,s,n)}addGraphicalAccidental(t,e){t.setAccidental(e)}addFermataAtTiedEndNote(t,e){}createInStaffClef(t,e){const i=t,n=d.VexFlowConverter.Clef(e,"small");i.vfClefBefore=new s.default.Flow.ClefNote(n.type,n.size,n.annotation)}createChordSymbols(t,e,i,n){const s=e.parentMeasure.parentSourceMeasure.Rules;let r=0;const o=s.ChordSymbolXSpacing;for(const a of t.ChordContainers){const t=new c.GraphicalChordSymbolContainer(a,e.PositionAndShape,s.ChordSymbolTextHeight,i,n,e.parentMeasure.parentSourceMeasure.Rules),l=t.GraphicalLabel;l.PositionAndShape.RelativePosition.y-=s.ChordSymbolYOffset,l.PositionAndShape.RelativePosition.x+=r,l.setLabelPositionAndShapeBorders(),t.PositionAndShape.calculateBoundingBox(),e.graphicalChordContainers.push(t),r+=l.PositionAndShape.Size.width+o}}createGraphicalTechnicalInstruction(t,e){}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowMusicSystem=void 0;const n=i(117),s=i(75),r=i(13),o=i(61),a=i(95);class l extends n.MusicSystem{constructor(t,e){super(t),this.rules=e}calculateBorders(t){if(0===this.staffLines.length)return;const e=this.calcBracketsWidth();this.boundingBox.BorderLeft=-e,this.boundingBox.BorderMarginLeft=-e,this.boundingBox.XBordersHaveBeenSet=!0;const i=this.staffLines[0].SkyBottomLineCalculator.getSkyLineMin();this.boundingBox.BorderTop=i,this.boundingBox.BorderMarginTop=i;const n=this.staffLines[this.staffLines.length-1],s=n.SkyBottomLineCalculator.getBottomLineMax()+n.PositionAndShape.RelativePosition.y;this.boundingBox.BorderBottom=s,this.boundingBox.BorderMarginBottom=s,this.boundingBox.XBordersHaveBeenSet=!0,this.boundingBox.YBordersHaveBeenSet=!0}createSystemLine(t,e,i,n,o,a,l){const h=a;let c=!1;return l&&(c=!0,l.lineTo(a,r.VexFlowConverter.line(i,n)),l.addMeasureLine(i,n)),h&&h.addMeasureLine(i,n,c),new s.SystemLine(i,n,this,a,l)}createInstrumentBracket(t,e){const i=t,n=e,s=new a.VexFlowInstrumentBrace(i,n);this.InstrumentBrackets.push(s)}createGroupBracket(t,e,i){const n=t,s=e;if(0===i){const t=new o.VexFlowInstrumentBracket(n,s,i);this.GroupBrackets.push(t)}else{const t=new a.VexFlowInstrumentBrace(n,s,i);this.GroupBrackets.push(t)}}}e.VexFlowMusicSystem=l},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SvgVexFlowBackend=void 0;const s=n(i(8)),r=i(59),o=i(13),a=i(21),l=i(25),h=n(i(1));class c extends r.VexFlowBackend{constructor(t){super(),this.rules=t}getVexflowBackendType(){return s.default.Flow.Renderer.Backends.SVG}getOSMDBackendType(){return l.BackendType.SVG}getCanvasSize(){var t;return null===(t=document.getElementById("osmdCanvasPage"+this.graphicalMusicPage.PageNumber))||void 0===t?void 0:t.offsetHeight}initialize(t,e){this.zoom=e,this.canvas=document.createElement("div"),this.canvas.id="osmdCanvasPage"+this.graphicalMusicPage.PageNumber,this.inner=this.canvas,this.inner.style.position="relative",this.canvas.style.zIndex="0",t.appendChild(this.inner),this.renderer=new s.default.Flow.Renderer(this.canvas,this.getVexflowBackendType()),this.ctx=this.renderer.getContext(),this.ctx.svg.id="osmdSvgPage"+this.graphicalMusicPage.PageNumber}getContext(){return this.ctx}getSvgElement(){return this.ctx.svg}removeNode(t){var e;const i=null===(e=this.ctx)||void 0===e?void 0:e.svg;if(!i)return!1;try{i.removeChild(t)}catch(n){return h.default.error(n),!1}return!0}clear(){if(!this.ctx)return;const t=this.ctx.svg;for(;t.lastChild;)t.removeChild(t.lastChild);this.rules.PageBackgroundColor&&(this.ctx.save(),this.ctx.setFillStyle(this.rules.PageBackgroundColor),this.ctx.setStrokeStyle("#12345600"),this.ctx.fillRect(0,0,this.canvas.offsetWidth/this.zoom,this.canvas.offsetHeight/this.zoom),this.ctx.restore())}scale(t){this.ctx.scale(t,t)}translate(t,e){}renderText(t,e,i,n,s,r,l,h){this.ctx.save();const c=this.ctx.openGroup();l&&(this.ctx.attributes.fill=l,this.ctx.attributes.stroke=l);let u=h;h&&"default"!==h||(u=this.rules.DefaultFontFamily),this.ctx.setFont(u,t,o.VexFlowConverter.fontStyle(e)),this.ctx.attributes["font-size"]=`${t}px`,this.ctx.state["font-size"]=`${t}px`;let d="normal",f="normal";switch(e){case a.FontStyles.Bold:d="bold";break;case a.FontStyles.Italic:f="italic";break;case a.FontStyles.BoldItalic:d="bold",f="italic";break;default:d="normal"}return this.ctx.attributes["font-weight"]=d,this.ctx.state["font-weight"]=d,this.ctx.attributes["font-style"]=f,this.ctx.state["font-style"]=f,this.ctx.fillText(n,r.x,r.y+s),this.ctx.closeGroup(),this.ctx.restore(),c}renderRectangle(t,e,i,n=1){this.ctx.save();const s=this.ctx.openGroup();return this.ctx.attributes.fill=i||o.VexFlowConverter.style(e),this.ctx.attributes["fill-opacity"]=n,this.ctx.fillRect(t.x,t.y,t.width,t.height),this.ctx.restore(),this.ctx.attributes["fill-opacity"]=1,this.ctx.closeGroup(),s}renderLine(t,e,i="#FF0000FF",n=2){this.ctx.save();const s=this.ctx.openGroup();return this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(e.x,e.y),this.ctx.attributes.stroke=i,this.ctx.lineWidth=n,this.ctx.stroke(),this.ctx.closeGroup(),this.ctx.restore(),s}renderCurve(t){this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.bezierCurveTo(t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y),this.ctx.lineTo(t[7].x,t[7].y),this.ctx.bezierCurveTo(t[6].x,t[6].y,t[5].x,t[5].y,t[4].x,t[4].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.closePath(),this.ctx.fill()}export(){const t=this.ctx.svg.cloneNode(!0),e=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),i=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",e);i.replaceChild(t,i.documentElement);const n=(new XMLSerializer).serializeToString(i),s=document.createElement("a");s.href="data:image/svg+xml; charset=utf8, "+encodeURIComponent(n.replace(/></g,">\n\r<")),s.download="opensheetmusicdisplay_download.svg",s.innerHTML=window.location.href+"/download",document.body.appendChild(s)}}e.SvgVexFlowBackend=c},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowInstantaneousDynamicExpression=void 0;const n=i(79),s=i(38),r=i(24),o=i(12),a=i(9),l=i(21);class h extends n.GraphicalInstantaneousDynamicExpression{constructor(t,e,i){super(t,e,i);const n=new o.Label(this.Expression);this.label=new r.GraphicalLabel(n,this.rules.ContinuousDynamicTextHeight,a.TextAlignmentEnum.CenterCenter,this.rules,this.PositionAndShape),this.label.Label.fontStyle=l.FontStyles.BoldItalic,this.label.setLabelPositionAndShapeBorders(),this.PositionAndShape.calculateBoundingBox()}get InstantaneousDynamic(){return this.mInstantaneousDynamicExpression}get Expression(){return s.DynamicEnum[this.mInstantaneousDynamicExpression.DynEnum]}}e.VexFlowInstantaneousDynamicExpression=h},function(t,e,i){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.DynamicExpressionSymbolEnum=void 0,(n=e.DynamicExpressionSymbolEnum||(e.DynamicExpressionSymbolEnum={}))[n.p=0]="p",n[n.f=1]="f",n[n.s=2]="s",n[n.z=3]="z",n[n.m=4]="m",n[n.r=5]="r"},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowInstrumentBrace=void 0;const s=n(i(8)),r=i(61);class o extends r.VexFlowInstrumentBracket{constructor(t,e,i=0){super(t,e,i),this.vexflowConnector.setType(s.default.Flow.StaveConnector.type.BRACE)}}e.VexFlowInstrumentBrace=o},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowMultiRestMeasure=void 0;const s=n(i(8)),r=i(44);class o extends r.VexFlowMeasure{constructor(t,e,i){super(t,e,i),this.minimumStaffEntriesWidth=-1,i?this.rules=i.ParentMusicSystem.rules:e&&(this.rules=e.Rules),this.resetLayout(),this.multiRestElement=new s.default.Flow.MultiMeasureRest(e.multipleRestMeasures,{})}draw(t){this.stave.setContext(t).draw(),this.multiRestElement.setStave(this.stave),this.multiRestElement.setContext(t),this.multiRestElement.draw();for(const e of this.connectors)e.setContext(t).draw()}format(){}getVoicesWithinMeasure(){return[]}getGraphicalVoiceEntriesPerVoice(t){return[]}getRestFilledVexFlowStaveNotesPerVoice(t){return[]}handleBeam(t,e){}handleTuplet(t,e){}finalizeBeams(){}finalizeTuplets(){}layoutStaffEntry(t){}graphicalMeasureCreatedCalculations(){}createArticulations(){}createOrnaments(){}createFingerings(t){}getVFStave(){return this.stave}}e.VexFlowMultiRestMeasure=o},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowOctaveShift=void 0;const s=n(i(8)),r=i(123),o=i(30),a=n(i(1));class l extends r.GraphicalOctaveShift{constructor(t,e){switch(super(t,e),t.Type){case o.OctaveEnum.VA8:this.position=s.default.Flow.TextBracket.Positions.TOP,this.supscript="va",this.text="8";break;case o.OctaveEnum.MA15:this.position=s.default.Flow.TextBracket.Positions.TOP,this.supscript="ma",this.text="15";break;case o.OctaveEnum.VB8:this.position=s.default.Flow.TextBracket.Positions.BOTTOM,this.supscript="vb",this.text="8";break;case o.OctaveEnum.MB15:this.position=s.default.Flow.TextBracket.Positions.BOTTOM,this.supscript="mb",this.text="15";break;default:a.default.error("Unknown or NONE octaveshift. This should not be called!")}}setStartNote(t){for(const e of t.graphicalVoiceEntries){const t=e;if(null==t?void 0:t.vfStaveNote)return this.startNote=t.vfStaveNote,!0}return!1}setEndNote(t){for(const e of t.graphicalVoiceEntries){const t=e;if(null==t?void 0:t.vfStaveNote)return this.endNote=t.vfStaveNote,!0}return!1}getTextBracket(){return new s.default.Flow.TextBracket({position:this.position,start:this.startNote,stop:this.endNote,superscript:this.supscript,text:this.text})}}e.VexFlowOctaveShift=l},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowStaffEntry=void 0;const n=i(124),s=i(16),r=i(2);class o extends n.GraphicalStaffEntry{constructor(t,e,i){super(t,e,i)}calculateXPosition(){const t=this.parentMeasure.getVFStave();let e=0;for(const i of this.graphicalVoiceEntries)if(i.vfStaveNote){if(i.vfStaveNote.setStave(t),!i.vfStaveNote.preFormatted)continue;i.applyBordersFromVexflow(),this.parentMeasure.ParentStaff.isTab?this.PositionAndShape.RelativePosition.x=(i.vfStaveNote.getAbsoluteX()+i.vfStaveNote.glyph.getWidth())/s.unitInPixels:this.PositionAndShape.RelativePosition.x=i.vfStaveNote.getBoundingBox().getX()/s.unitInPixels;const n=i.notes[0].sourceNote;n.isRest()&&n.Length.RealValue===this.parentMeasure.parentSourceMeasure.ActiveTimeSignature.RealValue&&(this.PositionAndShape.RelativePosition.x+=this.parentMeasure.parentSourceMeasure.Rules.WholeRestXShiftVexflow-.1,i.PositionAndShape.BorderLeft=-.7,i.PositionAndShape.BorderRight=.7),i.PositionAndShape.BorderLeft<e&&(e=i.PositionAndShape.BorderLeft)}this.PositionAndShape.RelativePosition.x-=e,this.PositionAndShape.calculateBoundingBox()}setMaxAccidentals(){for(const t of this.graphicalVoiceEntries)for(const e of t.notes)if(e.DrawnAccidental!==r.AccidentalEnum.NONE)return this.MaxAccidentals=1;return this.MaxAccidentals=0}setModifierXOffsets(){let t=[];for(const s of this.graphicalVoiceEntries)t=t.concat(s.notes);const e=t.map((t=>t.staffLine)),i=this.calculateModifierXOffsets(e,1),n=this.calculateModifierXOffsets(e,.5);t.forEach(((t,e)=>{t.baseFingeringXOffset=n[e],t.baseStringNumberXOffset=i[e]}))}calculateModifierXOffsets(t,e){const i=[];for(let n=0;n<t.length;n++){let s=0,r=!0;for(;r;)for(let o=n;o>=0;o--){if(Math.abs(t[n]-t[o])<=e&&s===i[o]){s++,r=!0;break}r=!1}i.push(s)}return i}}e.VexFlowStaffEntry=o},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowStaffLine=void 0;const n=i(125),s=i(78);class r extends n.StaffLine{constructor(t,e){super(t,e),this.slursInVFStaffLine=[],this.alignmentManager=new s.AlignmentManager(this)}get SlursInVFStaffLine(){return this.slursInVFStaffLine}addVFSlurToVFStaffline(t){this.slursInVFStaffLine.push(t)}get AlignmentManager(){return this.alignmentManager}}e.VexFlowStaffLine=r},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.VexflowStafflineNoteCalculator=void 0;const n=i(2),s=i(60),r=i(15),o=i(7),a=i(14);class l{constructor(t){this.staffPitchListMapping=new r.Dictionary,this.baseLineNote=n.NoteEnum.B,this.baseLineOctave=1,this.rules=t}trackNote(t){if(!(t instanceof s.VexFlowGraphicalNote)||t.Clef().ClefType!==o.ClefEnum.percussion||t.sourceNote.isRest()||0===this.rules.PercussionOneLineCutoff||-1===this.rules.PercussionForceVoicesOneLineCutoff)return;const e=t.parentVoiceEntry.parentStaffEntry.sourceStaffEntry.ParentStaff.idInMusicSheet;let i;this.staffPitchListMapping.containsKey(e)||this.staffPitchListMapping.setValue(e,new Array),i=this.staffPitchListMapping.getValue(e);const n=t.sourceNote.Pitch;l.findOrInsert(i,n)}static PitchIndexOf(t,e,i=0){if(i>t.length-1)return-1;for(let n=i;n<t.length;n++){const i=t[n];if(e.OperatorEquals(i))return n}return-1}static findOrInsert(t,e){for(let i=0;i<t.length;i++){const n=t[i];if(e.OperatorEquals(n))return i;if(e.OperatorFundamentalLessThan(n))return t.splice(i,0,e),i}return t.push(e),t.length-1}positionNote(t){const e=t.parentVoiceEntry.parentStaffEntry.sourceStaffEntry.ParentStaff.idInMusicSheet;if(!(t instanceof s.VexFlowGraphicalNote)||t.sourceNote.isRest()||!this.staffPitchListMapping.containsKey(e))return t;const i=this.staffPitchListMapping.getValue(e),r=1===t.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentStaff.StafflineCount,o=this.rules.PercussionOneLineUseXMLDisplayStep&&void 0!==t.sourceNote.displayStepUnpitched&&r;if(i.length>this.rules.PercussionOneLineCutoff&&!o)return t;const h=t,c=t.sourceNote.Pitch;let u=this.baseLineNote,d=this.baseLineOctave;if(this.rules.PercussionOneLineUseXMLDisplayStep&&void 0!==t.sourceNote.displayStepUnpitched&&r&&(u=t.sourceNote.displayStepUnpitched,d=t.sourceNote.displayOctaveUnpitched+this.rules.PercussionOneLineXMLDisplayStepOctaveOffset),i.length<=this.rules.PercussionForceVoicesOneLineCutoff)h.setAccidental(new n.Pitch(u,d,c.Accidental));else{const t=l.PitchIndexOf(i,c);if(t>-1){const e=Math.ceil(i.length/2);if(!this.rules.PercussionOneLineUseXMLDisplayStep)if(t>=e)switch(d=2,(t-e)%5){case 1:u=n.NoteEnum.E;break;case 2:u=n.NoteEnum.G;break;case 3:u=n.NoteEnum.B;break;case 4:u=n.NoteEnum.D,d=3;break;default:u=n.NoteEnum.C}else switch(t%5){case 1:u=n.NoteEnum.F;break;case 2:u=n.NoteEnum.D;break;case 3:u=n.NoteEnum.B,d=0;break;case 4:u=n.NoteEnum.G,d=0;break;default:u=n.NoteEnum.A}const s=new n.Pitch(u,d,c.Accidental);h.setAccidental(s);const r=h.parentVoiceEntry.parentVoiceEntry;!this.rules.SetWantedStemDirectionByXml&&r.Notes.length<2&&(s.Octave>this.baseLineOctave||s.FundamentalNote===this.baseLineNote&&s.Octave===this.baseLineOctave?h.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=a.StemDirectionType.Up:h.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=a.StemDirectionType.Down)}}return h}getStafflineUniquePositionCount(t){return this.staffPitchListMapping.containsKey(t)?this.staffPitchListMapping.getValue(t).length:0}}e.VexflowStafflineNoteCalculator=l},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowTabMeasure=void 0;const s=n(i(8)),r=i(44),o=i(13),a=n(i(1));class l extends r.VexFlowMeasure{constructor(t,e,i){super(t,e,i),this.isTabMeasure=!0}resetLayout(){this.stave=new s.default.Flow.TabStave(0,0,0,{space_above_staff_ln:0,space_below_staff_ln:0}),this.updateInstructionWidth()}graphicalMeasureCreatedCalculations(){for(let e=0,i=this.staffEntries.length;e<i;++e){const t=this.staffEntries[e];for(const e of t.graphicalVoiceEntries)e.notes[0].sourceNote.isRest()?e.vfStaveNote=o.VexFlowConverter.GhostNote(e.notes[0].sourceNote.Length):e.vfStaveNote=o.VexFlowConverter.CreateTabNote(e)}this.rules.TupletNumbersInTabs&&this.finalizeTuplets();const t=this.getVoicesWithinMeasure();for(const e of t){if(!e)continue;this.vfVoices[e.VoiceId]=new s.default.Flow.Voice({beat_value:this.parentSourceMeasure.Duration.Denominator,num_beats:this.parentSourceMeasure.Duration.Numerator,resolution:s.default.Flow.RESOLUTION}).setMode(s.default.Flow.Voice.Mode.SOFT);const t=this.getRestFilledVexFlowStaveNotesPerVoice(e);for(const i of t){if(i.parentVoiceEntry&&i.parentVoiceEntry.IsGrace&&!i.parentVoiceEntry.GraceAfterMainNote)continue;const t=i;if(0!==i.notes.length&&i.notes[0]&&i.notes[0].sourceNote.PrintObject){if(i.parentVoiceEntry&&i.parentVoiceEntry.Arpeggio){const e=i.parentVoiceEntry.Arpeggio;if(i.notes&&i.notes.length>1){const i=o.VexFlowConverter.StrokeTypeFromArpeggioType(e.type),n=new s.default.Flow.Stroke(i,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&t.vfStaveNote.addStroke(0,n)}else a.default.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn.\n voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`)}this.vfVoices[e.VoiceId].addTickable(t.vfStaveNote)}else this.vfVoices[e.VoiceId].addTickable(t.vfStaveNote)}}}}e.VexFlowTabMeasure=l},function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(3),e),s(i(55),e),s(i(94),e),s(i(38),e),s(i(37),e),s(i(64),e),s(i(103),e),s(i(104),e),s(i(105),e),s(i(65),e)},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.MultiExpressionEntry=e.MultiExpression=void 0;const n=i(0),s=i(38),r=i(32),o=i(64),a=i(65),l=i(3),h=i(21);e.MultiExpression=class{constructor(t,e){this.unknownList=[],this.moodList=[],this.expressions=[],this.sourceMeasure=t,this.timestamp=e}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(t){this.sourceMeasure=t}get StaffNumber(){return this.staffNumber}set StaffNumber(t){this.staffNumber=t}get Timestamp(){return this.timestamp}set Timestamp(t){this.timestamp=t}get AbsoluteTimestamp(){return n.Fraction.plus(this.timestamp,this.sourceMeasure.AbsoluteTimestamp)}get InstantaneousDynamic(){return this.instantaneousDynamic}set InstantaneousDynamic(t){this.instantaneousDynamic=t}get EndingContinuousDynamic(){return this.endingContinuousDynamic}set EndingContinuousDynamic(t){this.endingContinuousDynamic=t}get StartingContinuousDynamic(){return this.startingContinuousDynamic}set StartingContinuousDynamic(t){this.startingContinuousDynamic=t}get MoodList(){return this.moodList}get UnknownList(){return this.unknownList}get EntriesList(){return this.expressions}get OctaveShiftStart(){return this.octaveShiftStart}set OctaveShiftStart(t){this.octaveShiftStart=t}get OctaveShiftEnd(){return this.octaveShiftEnd}set OctaveShiftEnd(t){this.octaveShiftEnd=t}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(t){this.combinedExpressionsText=t}getPlacementOfFirstEntry(){let t=l.PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].expression instanceof s.InstantaneousDynamicExpression||this.expressions[0].expression instanceof r.ContinuousDynamicExpression||this.expressions[0].expression instanceof o.MoodExpression||this.expressions[0].expression instanceof a.UnknownExpression)&&(t=this.expressions[0].expression.Placement),t}getFontstyleOfFirstEntry(){var t;let e=h.FontStyles.Regular;return this.expressions.length>0&&(this.expressions[0].expression instanceof r.ContinuousDynamicExpression||this.expressions[0].expression instanceof o.MoodExpression?e=h.FontStyles.Italic:this.expressions[0].expression instanceof a.UnknownExpression&&(e=null!==(t=this.expressions[0].expression.fontStyle)&&void 0!==t?t:h.FontStyles.Regular)),e}addExpression(t,e){t instanceof s.InstantaneousDynamicExpression?(this.instantaneousDynamic&&this.removeExpressionFromEntryList(this.InstantaneousDynamic),this.instantaneousDynamic=t,this.instantaneousDynamic.ParentMultiExpression=this):t instanceof r.ContinuousDynamicExpression?this.startingContinuousDynamic=t:t instanceof o.MoodExpression?this.moodList.push(t):t instanceof a.UnknownExpression&&this.unknownList.push(t),this.addExpressionToEntryList(t,e)}CompareTo(t){return this.Timestamp.RealValue>t.Timestamp.RealValue?1:this.Timestamp.RealValue<t.Timestamp.RealValue?-1:0}addExpressionToEntryList(t,e){const i=new c;i.prefix=e,i.expression=t,t instanceof r.ContinuousDynamicExpression||t instanceof o.MoodExpression||t instanceof a.UnknownExpression?i.label=t.Label:i.label="",this.expressions.push(i)}removeExpressionFromEntryList(t){for(let e=0,i=this.expressions.length;e<i;++e)if(this.expressions[e].expression===t){this.expressions.splice(e,1);break}}};class c{}e.MultiExpressionEntry=c},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.TempoExpressionEntry=e.MultiTempoExpression=void 0;const n=i(0),s=i(37),r=i(3),o=i(21),a=i(56);e.MultiTempoExpression=class{constructor(t,e){this.expressions=[],this.sourceMeasure=t,this.timestamp=e}get Timestamp(){return this.timestamp}get AbsoluteTimestamp(){return n.Fraction.plus(this.sourceMeasure.AbsoluteTimestamp,this.timestamp)}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(t){this.sourceMeasure=t}get InstantaneousTempo(){return this.instantaneousTempo}get ContinuousTempo(){return this.continuousTempo}get EntriesList(){return this.expressions}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(t){this.combinedExpressionsText=t}getPlacementOfFirstEntry(){let t=r.PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].Expression instanceof s.InstantaneousTempoExpression||this.expressions[0].Expression instanceof a.ContinuousTempoExpression)&&(t=this.expressions[0].Expression.Placement),t}getFontstyleOfFirstEntry(){let t=o.FontStyles.Regular;return this.expressions[0].Expression instanceof s.InstantaneousTempoExpression?t=o.FontStyles.Bold:this.expressions[0].Expression instanceof a.ContinuousTempoExpression&&(t=o.FontStyles.Italic),t}addExpression(t,e){if(this.checkIfAlreadyExists(t))return;t instanceof s.InstantaneousTempoExpression?this.instantaneousTempo=t:t instanceof a.ContinuousTempoExpression&&(this.continuousTempo=t);const i=new l;i.prefix=e,i.Expression=t,i.label=t.Label,this.expressions.push(i)}CompareTo(t){return this.Timestamp.RealValue>t.Timestamp.RealValue?1:this.Timestamp.RealValue<t.Timestamp.RealValue?-1:0}checkIfAlreadyExists(t){for(const e of this.expressions)if(e.label===t.Label)return!0;return!1}};class l{get Expression(){return this.expression}set Expression(t){this.expression=t}}e.TempoExpressionEntry=l},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.RehearsalExpression=void 0;const n=i(3);class s extends n.AbstractExpression{constructor(t,e){super(e),this.label=t}}e.RehearsalExpression=s},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SourceMeasure=void 0;const n=i(0),s=i(54),r=i(31),o=i(28),a=i(14),l=i(7),h=i(18),c=i(23);e.SourceMeasure=class{constructor(t,e){this.printNewSystemXml=!1,this.printNewPageXml=!1,this.IsSystemStartMeasure=!1,this.RhythmPrinted=!1,this.hasLyrics=!1,this.hasMoodExpressions=!1,this.allRests=!1,this.isReducedToMultiRest=!1,this.multipleRestMeasureNumber=0,this.staffLinkedExpressions=[],this.tempoExpressions=[],this.verticalSourceStaffEntryContainers=[],this.graphicalMeasureErrors=[],this.firstRepetitionInstructions=[],this.lastRepetitionInstructions=[],this.completeNumberOfStaves=t,this.implicitMeasure=!1,this.hasEndLine=!1,this.endingBarStyleXml="",this.endingBarStyleEnum=c.SystemLinesEnum.SingleThin,this.firstInstructionsStaffEntries=new Array(t),this.lastInstructionsStaffEntries=new Array(t),this.rules=e,this.TempoInBPM=0;for(let i=0;i<t;i++)this.graphicalMeasureErrors.push(!1),this.staffLinkedExpressions.push([])}get MeasureNumber(){return this.measureNumber}set MeasureNumber(t){this.measureNumber=t}getPrintedMeasureNumber(){return this.rules.UseXMLMeasureNumbers&&Number.isInteger(this.MeasureNumberXML)?(this.MeasureNumberPrinted=this.MeasureNumberXML,this.MeasureNumberPrinted):(this.MeasureNumberPrinted=this.MeasureNumber,this.MeasureNumberPrinted)}get AbsoluteTimestamp(){return this.absoluteTimestamp}set AbsoluteTimestamp(t){this.absoluteTimestamp=t}get CompleteNumberOfStaves(){return this.completeNumberOfStaves}get Duration(){return this.duration}set Duration(t){this.duration=t}get ActiveTimeSignature(){return this.activeTimeSignature}set ActiveTimeSignature(t){this.activeTimeSignature=t}get ImplicitMeasure(){return this.implicitMeasure}set ImplicitMeasure(t){this.implicitMeasure=t}get HasEndLine(){return this.hasEndLine}set HasEndLine(t){this.hasEndLine=t}get StaffLinkedExpressions(){return this.staffLinkedExpressions}get TempoExpressions(){return this.tempoExpressions}get VerticalSourceStaffEntryContainers(){return this.verticalSourceStaffEntryContainers}get FirstInstructionsStaffEntries(){return this.firstInstructionsStaffEntries}get LastInstructionsStaffEntries(){return this.lastInstructionsStaffEntries}get FirstRepetitionInstructions(){return this.firstRepetitionInstructions}get LastRepetitionInstructions(){return this.lastRepetitionInstructions}getErrorInMeasure(t){return this.graphicalMeasureErrors[t]}setErrorInGraphicalMeasure(t,e){this.graphicalMeasureErrors[t]=e}getNextMeasure(t){return t[this.measureListIndex+1]}getPreviousMeasure(t){if(this.measureListIndex>1)return t[this.measureListIndex-1]}get Rules(){return this.rules}get VerticalMeasureList(){return this.verticalMeasureList}set VerticalMeasureList(t){this.verticalMeasureList=t}get TempoInBPM(){return this.tempoInBPM}set TempoInBPM(t){this.tempoInBPM=t}findOrCreateStaffEntry(t,e,i){let n,o;for(const s of this.verticalSourceStaffEntryContainers)if(s.Timestamp.Equals(t)){n=s;break}if(n)return n.StaffEntries[e]?o=n.StaffEntries[e]:(o=new r.SourceStaffEntry(n,i),n.StaffEntries[e]=o),{createdNewContainer:!1,staffEntry:o};const a=this.verticalSourceStaffEntryContainers[this.verticalSourceStaffEntryContainers.length-1];if(0===this.verticalSourceStaffEntryContainers.length||a.Timestamp.lt(t)){const n=new s.VerticalSourceStaffEntryContainer(this,t.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.push(n),o=new r.SourceStaffEntry(n,i),n.StaffEntries[e]=o}else for(let l=this.verticalSourceStaffEntryContainers.length-1;l>=0;l--){if(this.verticalSourceStaffEntryContainers[l].Timestamp.lt(t)){const n=new s.VerticalSourceStaffEntryContainer(this,t.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(l+1,0,n),o=new r.SourceStaffEntry(n,i),n.StaffEntries[e]=o;break}if(0===l){const n=new s.VerticalSourceStaffEntryContainer(this,t.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(l,0,n),o=new r.SourceStaffEntry(n,i),n.StaffEntries[e]=o;break}}return{createdNewContainer:!0,staffEntry:o}}findOrCreateVoiceEntry(t,e){let i,n=!1;for(const s of t.VoiceEntries)if(s.ParentVoice===e){i=s;break}return i||(i=new a.VoiceEntry(t.Timestamp,e,t),n=!0),{createdVoiceEntry:n,voiceEntry:i}}getPreviousSourceStaffEntryFromIndex(t,e){for(let i=e-1;i>=0;i--)if(this.verticalSourceStaffEntryContainers[i][t])return this.verticalSourceStaffEntryContainers[i][t]}getVerticalContainerIndexByTimestamp(t){for(let e=0,i=this.VerticalSourceStaffEntryContainers.length;e<i;++e)if(this.VerticalSourceStaffEntryContainers[e].Timestamp.Equals(t))return e;return-1}getVerticalContainerByTimestamp(t){for(let e=0,i=this.VerticalSourceStaffEntryContainers.length;e<i;++e){const i=this.VerticalSourceStaffEntryContainers[e];if(i.Timestamp.Equals(t))return i}}checkForEmptyVerticalContainer(t){let e=0;for(let i=0;i<this.completeNumberOfStaves;i++)this.verticalSourceStaffEntryContainers[t][i]||e++;e===this.completeNumberOfStaves&&this.verticalSourceStaffEntryContainers.splice(t,1)}reverseCheck(t,e){let i=new n.Fraction(0,1);const s=[];for(let r=0;r<t.Instruments.length;r++){let e=new n.Fraction(0,1);const i=t.getGlobalStaffIndexOfFirstStaff(t.Instruments[r]);for(let s=0;s<t.Instruments[r].Staves.length;s++){const t=this.getLastSourceStaffEntryForInstrument(i+s);if(void 0!==t&&!t.hasTie())for(let r=this.verticalSourceStaffEntryContainers.indexOf(t.VerticalContainerParent)-1;r>=0;r--){const t=this.verticalSourceStaffEntryContainers[r][i+s];if(void 0!==t&&t.hasTie()&&e.lt(n.Fraction.plus(t.Timestamp,t.calculateMaxNoteLength()))){e=n.Fraction.plus(t.Timestamp,t.calculateMaxNoteLength());break}}}s.push(e)}for(let n=0,r=s.length;n<r;++n){const t=s[n];i.lt(t)&&(i=t)}return n.Fraction.max(i,e)}calculateInstrumentsDuration(t,e){const i=[];for(let s=0;s<t.Instruments.length;s++){let r=new n.Fraction(0,1);const o=t.getGlobalStaffIndexOfFirstStaff(t.Instruments[s]);for(let e=0;e<t.Instruments[s].Staves.length;e++){const t=this.getLastSourceStaffEntryForInstrument(o+e);void 0!==t&&t.Timestamp&&r.lt(n.Fraction.plus(t.Timestamp,t.calculateMaxNoteLength()))&&(r=n.Fraction.plus(t.Timestamp,t.calculateMaxNoteLength()))}r.lt(e[s])&&(r=e[s]),i.push(r)}return i}getEntriesPerStaff(t){const e=[];for(const i of this.VerticalSourceStaffEntryContainers){const n=i.StaffEntries[t];n&&e.push(n)}return e}hasBeginInstructions(){for(let t=0,e=this.FirstInstructionsStaffEntries.length;t<e;t++){const e=this.FirstInstructionsStaffEntries[t];if(void 0!==e&&e.Instructions.length>0)return!0}return!1}beginsWithLineRepetition(){for(let t=0,e=this.FirstRepetitionInstructions.length;t<e;++t){const e=this.FirstRepetitionInstructions[t];if(e.type===o.RepetitionInstructionEnum.StartLine)return!0;if(void 0!==e.parentRepetition&&e===e.parentRepetition.startMarker&&!e.parentRepetition.FromWords)return!0}return!1}endsWithLineRepetition(){for(let t=0,e=this.LastRepetitionInstructions.length;t<e;++t){const e=this.LastRepetitionInstructions[t];if(e.type===o.RepetitionInstructionEnum.BackJumpLine)return!0;const i=e.parentRepetition;if(i&&!i.FromWords)for(let t=0,n=i.BackwardJumpInstructions.length;t<n;++t)if(e===i.BackwardJumpInstructions[t])return!0}return!1}beginsWithWordRepetition(){for(let t=0,e=this.FirstRepetitionInstructions.length;t<e;++t){const e=this.FirstRepetitionInstructions[t];if(void 0!==e.parentRepetition&&e===e.parentRepetition.startMarker&&e.parentRepetition.FromWords)return!0}return!1}endsWithWordRepetition(){for(let t=0,e=this.LastRepetitionInstructions.length;t<e;++t){const e=this.LastRepetitionInstructions[t],i=e.parentRepetition;if(i&&i.FromWords){for(let t=0,n=i.BackwardJumpInstructions.length;t<n;++t)if(e===i.BackwardJumpInstructions[t])return!0;if(e===i.forwardJumpInstruction)return!0}}return!1}beginsRepetitionEnding(){for(const t of this.FirstRepetitionInstructions)if(t.type===o.RepetitionInstructionEnum.Ending&&t.alignment===o.AlignmentType.Begin)return!0;return!1}endsRepetitionEnding(){for(const t of this.LastRepetitionInstructions)if(t.type===o.RepetitionInstructionEnum.Ending&&t.alignment===o.AlignmentType.End)return!0;return!1}getKeyInstruction(t){if(this.FirstInstructionsStaffEntries[t]){const e=this.FirstInstructionsStaffEntries[t];for(let t=0,i=e.Instructions.length;t<i;++t){const i=e.Instructions[t];if(i instanceof h.KeyInstruction)return i}}}getLastSourceStaffEntryForInstrument(t){let e;for(let i=this.verticalSourceStaffEntryContainers.length-1;i>=0&&(e=this.verticalSourceStaffEntryContainers[i].StaffEntries[t],!e);i--);return e}canBeReducedToMultiRest(){var t,e;if(!this.allRests||this.hasLyrics||this.hasMoodExpressions||this.tempoExpressions.length>0)return!1;for(const i of this.staffLinkedExpressions)if(i.length>0)return!1;for(const i of this.lastInstructionsStaffEntries)for(let t=0,e=null==i?void 0:i.Instructions.length;t<e;++t)if(i.Instructions[t]instanceof l.ClefInstruction)return!1;return(null===(t=this.Duration)||void 0===t?void 0:t.RealValue)===(null===(e=this.ActiveTimeSignature)||void 0===e?void 0:e.RealValue)}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.Tie=void 0;const n=i(0);e.Tie=class{constructor(t,e){this.notes=[],this.AddNote(t),this.type=e}get Notes(){return this.notes}get Type(){return this.type}get StartNote(){return this.notes[0]}get Duration(){const t=new n.Fraction;for(const e of this.notes)t.Add(e.Length);return t}get Pitch(){return this.StartNote.Pitch}AddNote(t){this.notes.push(t),t.NoteTie=this}}},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.OpenSheetMusicDisplay=void 0;const s=i(72),r=i(89),o=i(134),a=i(68),l=i(17),h=i(16),c=i(92),u=i(58),d=i(110),f=i(155),p=i(109),m=n(i(1)),b=i(33),g=i(25),y=i(26),S=i(3),v=i(15),x=i(22),E=i(2);class _{constructor(t,e=g.OSMDOptions.OSMDOptionsStandard()){if(this.version="0.9.4-release",this.zoom=1,this.zoomUpdated=!1,this.loadUrlTimeout=5e3,"string"==typeof t?this.container=document.getElementById(t):t&&"appendChild"in t&&(this.container=t),!this.container)throw new Error("Please pass a valid div container to OpenSheetMusicDisplay");void 0===e.autoResize&&(e.autoResize=!0),this.backendType=g.BackendType.SVG,this.setOptions(e)}load(t){if(this.reset(),"string"==typeof t){const e=t,i=this;if("PK"===e.substr(0,4))return m.default.debug("[OSMD] This is a zip file, unpack it first: "+e),f.MXLHelper.MXLtoXMLstring(e).then((t=>i.load(t)),(t=>{throw m.default.debug(t),new Error("OpenSheetMusicDisplay: Invalid MXL file")}));if(""===e.substr(0,3))return m.default.debug("[OSMD] UTF with BOM detected, truncate first three bytes and pass along: "+e),i.load(e.substr(3));let n=e;if(/^\s/.test(n)&&(n=n.trim()),n.substr(0,6).includes("<?xml"))m.default.debug("[OSMD] Finally parsing XML content, length: "+n.length),t=(new DOMParser).parseFromString(n,"application/xml");else{if(n.length<2083)return m.default.debug("[OSMD] Retrieve the file at the given URL: "+n),p.AJAX.ajax(n,this.loadUrlTimeout).then((t=>i.load(t)),(t=>{throw t}));console.error("[OSMD] osmd.load(string): Could not process string. Did not find <?xml at beginning.")}}if(!t||!t.nodeName)return Promise.reject(new Error("OpenSheetMusicDisplay: The document which was provided is invalid"));const e=t,i=e.childNodes;let n;m.default.debug("[OSMD] load(), Document url: "+e.URL);for(let s=0,o=i.length;s<o;s+=1){const t=i[s];if(t.nodeType===Node.ELEMENT_NODE&&"score-partwise"===t.nodeName.toLowerCase()){n=t;break}}if(!n)return console.error("Could not parse MusicXML, no valid partwise element found"),Promise.reject(new Error("OpenSheetMusicDisplay: Document is not a valid 'partwise' MusicXML"));const r=new s.IXmlElement(n),a=new o.MusicSheetReader(void 0,this.rules);return this.sheet=a.createMusicSheet(r,"Untitled Score"),void 0===this.sheet?Promise.reject(new Error("given music sheet was incomplete or could not be loaded.")):(m.default.info(`[OSMD] Loaded sheet ${this.sheet.TitleString} successfully.`),this.needBackendUpdate=!0,this.updateGraphic(),Promise.resolve({}))}updateGraphic(){const t=new r.VexFlowMusicSheetCalculator(this.rules);this.graphic=new a.GraphicalMusicSheet(this.sheet,t),this.drawingParameters.drawCursors&&this.cursor&&this.cursor.init(this.sheet.MusicPartManager,this.graphic)}render(){var t;if(!this.graphic)throw new Error("OpenSheetMusicDisplay: Before rendering a music sheet, please load a MusicXML file");null===(t=this.drawer)||void 0===t||t.clear();let e=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(e=32767),this.sheet.pageWidth=e/this.zoom/10,this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?(this.rules.PageHeight=this.sheet.pageWidth/this.rules.PageFormat.aspectRatio,m.default.debug("[OSMD] PageHeight: "+this.rules.PageHeight)):(m.default.debug("[OSMD] endless/undefined pageformat, id: "+this.rules.PageFormat.idString),this.rules.PageHeight=100001),this.graphic.reCalculate(),this.drawingParameters.drawCursors&&(this.graphic.Cursors.length=0),this.createOrRefreshRenderBackend(),this.needBackendUpdate=!1,this.drawer.setZoom(this.zoom),this.drawer.drawSheet(this.graphic),this.enableOrDisableCursor(this.drawingParameters.drawCursors),this.drawingParameters.drawCursors&&this.cursor&&this.cursor.update(),this.zoomUpdated=!1}createOrRefreshRenderBackend(){this.drawer&&this.drawer.Backends&&(this.drawer.Backends[0]&&this.drawer.Backends[0].removeAllChildrenFromContainer(this.container),this.drawer.Backends.clear()),this.drawingParameters.Rules=this.rules,this.drawer=new h.VexFlowMusicSheetDrawer(this.drawingParameters),this.drawer.drawableBoundingBoxElement=this.DrawBoundingBox,this.drawer.bottomLineVisible=this.drawBottomLine,this.drawer.skyLineVisible=this.drawSkyLine;let t,e=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(e=10*this.graphic.MusicPages[0].PositionAndShape.Size.width*this.zoom);for(const i of this.graphic.MusicPages){if(i.PageNumber>this.rules.MaxPageToDrawNumber)break;const n=this.createBackend(this.backendType,i),s=" exceeds CanvasBackend limit of 32767. Cutting off score.";n.getOSMDBackendType()===g.BackendType.Canvas&&e>32767&&(m.default.warn("[OSMD] Warning: width of "+e+s),e=32767),this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?t=e/this.rules.PageFormat.aspectRatio:(t=i.PositionAndShape.Size.height,t+=this.rules.PageBottomMargin,t+=this.rules.CompactMode?this.rules.PageTopMarginNarrow:this.rules.PageTopMargin,this.rules.RenderTitle&&(t+=this.rules.TitleTopDistance),t*=10*this.zoom),n.getOSMDBackendType()===g.BackendType.Canvas&&t>32767&&(m.default.warn("[OSMD] Warning: height of "+t+s),t=Math.min(t,32767)),n.resize(e,t),n.clear(),this.drawer.Backends.push(n),this.graphic.drawer=this.drawer}}exportSVG(){var t;for(const e of null===(t=this.drawer)||void 0===t?void 0:t.Backends)e instanceof c.SvgVexFlowBackend&&e.export()}IsReadyToRender(){return void 0!==this.graphic}clear(){this.drawer.clear(),this.reset()}setOptions(t){if(this.rules||(this.rules=new y.EngravingRules),this.drawingParameters||(this.drawingParameters=new b.DrawingParameters,this.drawingParameters.Rules=this.rules),null==t)return void m.default.warn("warning: osmd.setOptions() called without an options parameter, has no effect.\nexample usage: osmd.setOptions({drawCredits: false, drawPartNames: false})");t.drawingParameters&&(this.drawingParameters.DrawingParametersEnum=b.DrawingParametersEnum[t.drawingParameters.toLowerCase()]);let e=!this.drawer||!this.drawer.Backends||this.drawer.Backends.length<1;if(void 0!==t.backend){const i=g.OSMDOptions.BackendTypeFromString(t.backend);e=e||this.backendType!==i,this.backendType=i}this.needBackendUpdate=e,void 0!==t.autoBeam&&(this.rules.AutoBeamNotes=t.autoBeam);const i=t.autoBeamOptions;if(i&&(void 0===i.maintain_stem_directions&&(i.maintain_stem_directions=!1),this.rules.AutoBeamOptions=i,i.groups&&i.groups.length))for(const n of i.groups)if(2!==n.length)throw new Error("Each fraction in autoBeamOptions.groups must be of length 2, e.g. [3,4] for beaming three fourths");void 0!==t.percussionOneLineCutoff&&(this.rules.PercussionOneLineCutoff=t.percussionOneLineCutoff),0!==this.rules.PercussionOneLineCutoff&&void 0!==t.percussionForceVoicesOneLineCutoff&&(this.rules.PercussionForceVoicesOneLineCutoff=t.percussionForceVoicesOneLineCutoff),void 0!==t.alignRests&&(this.rules.AlignRests=t.alignRests),void 0!==t.coloringMode&&this.setColoringMode(t),void 0!==t.coloringEnabled&&(this.rules.ColoringEnabled=t.coloringEnabled),void 0!==t.colorStemsLikeNoteheads&&(this.rules.ColorStemsLikeNoteheads=t.colorStemsLikeNoteheads),t.disableCursor&&(this.drawingParameters.drawCursors=!1),t.drawHiddenNotes&&(this.drawingParameters.drawHiddenNotes=!0),void 0!==t.drawCredits&&(this.drawingParameters.DrawCredits=t.drawCredits),void 0!==t.drawComposer&&(this.drawingParameters.DrawComposer=t.drawComposer),void 0!==t.drawTitle&&(this.drawingParameters.DrawTitle=t.drawTitle),void 0!==t.drawSubtitle&&(this.drawingParameters.DrawSubtitle=t.drawSubtitle),void 0!==t.drawLyricist&&(this.drawingParameters.DrawLyricist=t.drawLyricist),void 0!==t.drawMetronomeMarks&&(this.rules.MetronomeMarksDrawn=t.drawMetronomeMarks),void 0!==t.drawPartNames&&(this.drawingParameters.DrawPartNames=t.drawPartNames,t.drawPartAbbreviations||(this.rules.RenderPartAbbreviations=t.drawPartNames)),void 0!==t.drawPartAbbreviations&&(this.rules.RenderPartAbbreviations=t.drawPartAbbreviations),!1===t.drawFingerings&&(this.rules.RenderFingerings=!1),void 0!==t.drawMeasureNumbers&&(this.rules.RenderMeasureNumbers=t.drawMeasureNumbers),t.drawMeasureNumbersOnlyAtSystemStart&&(this.rules.RenderMeasureNumbersOnlyAtSystemStart=t.drawMeasureNumbersOnlyAtSystemStart),void 0!==t.drawLyrics&&(this.rules.RenderLyrics=t.drawLyrics),void 0!==t.drawTimeSignatures&&(this.rules.RenderTimeSignatures=t.drawTimeSignatures),void 0!==t.drawSlurs&&(this.rules.RenderSlurs=t.drawSlurs),void 0!==t.measureNumberInterval&&(this.rules.MeasureNumberLabelOffset=t.measureNumberInterval),void 0!==t.useXMLMeasureNumbers&&(this.rules.UseXMLMeasureNumbers=t.useXMLMeasureNumbers),void 0!==t.fingeringPosition&&(this.rules.FingeringPosition=S.AbstractExpression.PlacementEnumFromString(t.fingeringPosition)),void 0!==t.fingeringInsideStafflines&&(this.rules.FingeringInsideStafflines=t.fingeringInsideStafflines),void 0!==t.newSystemFromXML&&(this.rules.NewSystemAtXMLNewSystemAttribute=t.newSystemFromXML),void 0!==t.newPageFromXML&&(this.rules.NewPageAtXMLNewPageAttribute=t.newPageFromXML),void 0!==t.fillEmptyMeasuresWithWholeRest&&(this.rules.FillEmptyMeasuresWithWholeRest=t.fillEmptyMeasuresWithWholeRest),void 0!==t.followCursor&&(this.FollowCursor=t.followCursor),void 0!==t.setWantedStemDirectionByXml&&(this.rules.SetWantedStemDirectionByXml=t.setWantedStemDirectionByXml),t.defaultColorNotehead&&(this.rules.DefaultColorNotehead=t.defaultColorNotehead),t.defaultColorRest&&(this.rules.DefaultColorRest=t.defaultColorRest),t.defaultColorStem&&(this.rules.DefaultColorStem=t.defaultColorStem),t.defaultColorLabel&&(this.rules.DefaultColorLabel=t.defaultColorLabel),t.defaultColorTitle&&(this.rules.DefaultColorTitle=t.defaultColorTitle),t.defaultFontFamily&&(this.rules.DefaultFontFamily=t.defaultFontFamily),t.defaultFontStyle&&(this.rules.DefaultFontStyle=t.defaultFontStyle),t.drawUpToMeasureNumber&&(this.rules.MaxMeasureToDrawIndex=t.drawUpToMeasureNumber-1),t.drawFromMeasureNumber&&(this.rules.MinMeasureToDrawIndex=t.drawFromMeasureNumber-1),t.drawUpToPageNumber&&(this.rules.MaxPageToDrawNumber=t.drawUpToPageNumber),t.drawUpToSystemNumber&&(this.rules.MaxSystemToDrawNumber=t.drawUpToSystemNumber),t.tupletsRatioed&&(this.rules.TupletsRatioed=!0),t.tupletsBracketed&&(this.rules.TupletsBracketed=!0),t.tripletsBracketed&&(this.rules.TripletsBracketed=!0),t.autoResize?(this.resizeHandlerAttached||this.autoResize(),this.autoResizeEnabled=!0):!1===t.autoResize&&(this.autoResizeEnabled=!1),void 0!==t.pageFormat&&this.setPageFormat(t.pageFormat),void 0!==t.pageBackgroundColor&&(this.rules.PageBackgroundColor=t.pageBackgroundColor),void 0!==t.renderSingleHorizontalStaffline&&(this.rules.RenderSingleHorizontalStaffline=t.renderSingleHorizontalStaffline),void 0!==t.spacingFactorSoftmax&&(this.rules.SoftmaxFactorVexFlow=t.spacingFactorSoftmax),void 0!==t.spacingBetweenTextLines&&(this.rules.SpacingBetweenTextLines=t.spacingBetweenTextLines),void 0!==t.stretchLastSystemLine&&(this.rules.StretchLastSystemLine=t.stretchLastSystemLine),void 0!==t.autoGenerateMutipleRestMeasuresFromRestMeasures&&(this.rules.AutoGenerateMutipleRestMeasuresFromRestMeasures=t.autoGenerateMutipleRestMeasuresFromRestMeasures)}setColoringMode(t){if(t.coloringMode===b.ColoringModes.XML)return void(this.rules.ColoringMode=b.ColoringModes.XML);const e=[E.NoteEnum.C,E.NoteEnum.D,E.NoteEnum.E,E.NoteEnum.F,E.NoteEnum.G,E.NoteEnum.A,E.NoteEnum.B,-1];let i;if(t.coloringMode===b.ColoringModes.CustomColorSet){if(!t.coloringSetCustom||8!==t.coloringSetCustom.length)throw new Error("Invalid amount of colors: With coloringModes.customColorSet, you have to provide a coloringSetCustom parameter with 8 strings (C to B, rest note).");for(const e of t.coloringSetCustom)if(!/^\#[0-9a-fA-F]{6}$/.test(e))throw new Error("One of the color strings in options.coloringSetCustom was not a valid HTML Hex color:\n"+e);i=t.coloringSetCustom}else if(t.coloringMode===b.ColoringModes.AutoColoring){i=[];const t=Object.keys(x.AutoColorSet);for(let e=0;e<t.length;e++)i.push(x.AutoColorSet[t[e]])}const n=new v.Dictionary;for(let s=0;s<e.length;s++)n.setValue(e[s],i[s]);n.setValue(-1,i[7]),this.rules.ColoringSetCurrent=n,this.rules.ColoringMode=t.coloringMode}setLogLevel(t){switch(t){case"trace":m.default.setLevel(m.default.levels.TRACE);break;case"debug":m.default.setLevel(m.default.levels.DEBUG);break;case"info":m.default.setLevel(m.default.levels.INFO);break;case"warn":m.default.setLevel(m.default.levels.WARN);break;case"error":m.default.setLevel(m.default.levels.ERROR);break;case"silent":m.default.setLevel(m.default.levels.SILENT);break;default:m.default.warn(`Could not set log level to ${t}. Using warn instead.`),m.default.setLevel(m.default.levels.WARN)}}getLogLevel(){return m.default.getLevel()}reset(){this.drawingParameters.drawCursors&&this.cursor&&this.cursor.hide(),this.sheet=void 0,this.graphic=void 0,this.zoom=1}autoResize(){const t=this;this.handleResize((()=>{}),(()=>{var e;(null===(e=this.graphic)||void 0===e?void 0:e.GetCalculator)instanceof r.VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=!0),t.IsReadyToRender()&&t.render()}))}handleResize(t,e){let i,n;const s=this;function r(){s.AutoResizeEnabled&&(i=(new Date).getTime(),n||(t(),i=(new Date).getTime(),n=window.setTimeout(o,200)))}function o(){n=void 0,window.clearTimeout(n),(new Date).getTime()-i<200?n=window.setTimeout(o,200):e()}window.attachEvent?window.attachEvent("onresize",r):window.addEventListener("resize",r),this.resizeHandlerAttached=!0,window.setTimeout(t,0),window.setTimeout(e,1)}enableOrDisableCursor(t){var e,i,n,s;if(this.drawingParameters.drawCursors=t,t){const t=null===(e=this.cursor)||void 0===e?void 0:e.Hidden,r=null===(i=this.cursor)||void 0===i?void 0:i.Iterator;null===(n=this.cursor)||void 0===n||n.hide();let o=null===(s=this.drawer)||void 0===s?void 0:s.Backends[0];if(o&&this.rules.RestoreCursorAfterRerender&&this.cursor){const t=this.cursor.updateCurrentPage();o=this.drawer.Backends[t-1]}o&&o.getRenderElement()&&(this.cursor=new d.Cursor(o.getRenderElement(),this)),this.sheet&&this.graphic&&this.cursor&&this.cursor.init(this.sheet.MusicPartManager,this.graphic),this.rules.RestoreCursorAfterRerender&&(this.cursor.hidden=t,r&&(this.cursor.iterator=r,this.cursor.update()))}else{if(!this.cursor)return;this.cursor.hide()}}createBackend(t,e){let i;return i=void 0===t||t===g.BackendType.SVG?new c.SvgVexFlowBackend(this.rules):new u.CanvasVexFlowBackend(this.rules),i.graphicalMusicPage=e,i.initialize(this.container,this.zoom),i}static StringToPageFormat(t){let e=y.PageFormat.UndefinedPageFormat;if(t.match("^[0-9]+x[0-9]+$")){const i=t.split("x"),n=Number.parseInt(i[0],10),s=Number.parseInt(i[1],10);n>0&&n<32768&&s>0&&s<32768&&(e=new y.PageFormat(n,s,`customPageFormat${t}`))}return t=(t=(t=t.replace(" ","_")).replace("Landscape","L")).replace("Portrait","P"),_.PageFormatStandards.hasOwnProperty(t)?(e=_.PageFormatStandards[t],e):e}setPageFormat(t){const e=_.StringToPageFormat(t);this.needBackendUpdate=!e.Equals(this.rules.PageFormat),this.rules.PageFormat=e}setCustomPageFormat(t,e){if(t>0&&e>0){const i=new y.PageFormat(t,e);this.rules.PageFormat=i}}set DrawSkyLine(t){this.drawSkyLine=t,this.drawer&&(this.drawer.skyLineVisible=t)}get DrawSkyLine(){return this.drawer.skyLineVisible}set DrawBottomLine(t){this.drawBottomLine=t,this.drawer&&(this.drawer.bottomLineVisible=t)}get DrawBottomLine(){return this.drawer.bottomLineVisible}set DrawBoundingBox(t){this.setDrawBoundingBox(t,!0)}get DrawBoundingBox(){return this.drawBoundingBox}setDrawBoundingBox(t,e=!1){this.drawBoundingBox=t,this.drawer&&(this.drawer.drawableBoundingBoxElement=t),e&&this.render()}get AutoResizeEnabled(){return this.autoResizeEnabled}set AutoResizeEnabled(t){this.autoResizeEnabled=t}get Zoom(){return this.zoom}set Zoom(t){var e;this.zoom=t,this.zoomUpdated=!0,(null===(e=this.graphic)||void 0===e?void 0:e.GetCalculator)instanceof r.VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=this.zoomUpdated)}set FollowCursor(t){this.followCursor=t}get FollowCursor(){return this.followCursor}set TransposeCalculator(t){l.MusicSheetCalculator.transposeCalculator=t}get TransposeCalculator(){return l.MusicSheetCalculator.transposeCalculator}get Sheet(){return this.sheet}get Drawer(){return this.drawer}get GraphicSheet(){return this.graphic}get DrawingParameters(){return this.drawingParameters}get EngravingRules(){return this.rules}get Version(){return this.version}}e.OpenSheetMusicDisplay=_,_.PageFormatStandards={A3_L:new y.PageFormat(420,297,"A3_L"),A3_P:new y.PageFormat(297,420,"A3_P"),A4_L:new y.PageFormat(297,210,"A4_L"),A4_P:new y.PageFormat(210,297,"A4_P"),A5_L:new y.PageFormat(210,148,"A5_L"),A5_P:new y.PageFormat(148,210,"A5_P"),A6_L:new y.PageFormat(148,105,"A6_L"),A6_P:new y.PageFormat(105,148,"A6_P"),Endless:y.PageFormat.UndefinedPageFormat,Letter_L:new y.PageFormat(279.4,215.9,"Letter_L"),Letter_P:new y.PageFormat(215.9,279.4,"Letter_P")}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AJAX=void 0,e.AJAX=class{static ajax(t,e=9e3){let i;const n=t.indexOf(".mxl")>-1?"text/plain; charset=x-user-defined":"application/xml";if(XMLHttpRequest)i=new XMLHttpRequest;else{if(!ActiveXObject)return Promise.reject(new Error("XMLHttp not supported."));i=new ActiveXObject("Microsoft.XMLHTTP")}return i.timeout=e,new Promise(((e,s)=>{i.onreadystatechange=()=>{i.readyState===XMLHttpRequest.DONE&&(200===i.status||0===i.status&&i.responseText?e(i.responseText):s(new Error("Could not retrieve requested URL "+i.status)))},i.ontimeout=t=>{s(new Error("Server request Timeout"))},i.overrideMimeType(n),i.open("GET",t,!0),i.send()}))}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.Cursor=void 0;const n=i(0);e.Cursor=class{constructor(t,e){this.hidden=!0,this.currentPageNumber=1,this.container=t,this.openSheetMusicDisplay=e,this.rules=this.openSheetMusicDisplay.EngravingRules;let i=0;for(this.cursorElementId="cursorImg-0";document.getElementById(this.cursorElementId);)i++,this.cursorElementId=`cursorImg-${i}`;const n=document.createElement("img");n.id=this.cursorElementId,n.style.position="absolute",n.style.zIndex="-1",this.cursorElement=n,this.container.appendChild(n)}init(t,e){this.manager=t,this.graphic=e,this.reset(),this.hidden=!0,this.hide()}show(){this.hidden=!1,this.resetIterator(),this.update()}resetIterator(){if(!this.openSheetMusicDisplay.Sheet||!this.openSheetMusicDisplay.Sheet.SourceMeasures)return void ("OSMD.Cursor.resetIterator(): sheet or measures were null/undefined.");const t=this.openSheetMusicDisplay.Sheet.SourceMeasures.length-1;let e=this.rules.MinMeasureToDrawIndex;e=Math.min(e,t);let i=this.rules.MaxMeasureToDrawIndex;if(i=Math.min(i,t),this.openSheetMusicDisplay.Sheet&&this.openSheetMusicDisplay.Sheet.SourceMeasures.length>e&&(this.openSheetMusicDisplay.Sheet.SelectionStart=this.openSheetMusicDisplay.Sheet.SourceMeasures[e].AbsoluteTimestamp),this.openSheetMusicDisplay.Sheet&&this.openSheetMusicDisplay.Sheet.SourceMeasures.length>i){const t=this.openSheetMusicDisplay.Sheet.SourceMeasures[i];this.openSheetMusicDisplay.Sheet.SelectionEnd=n.Fraction.plus(t.AbsoluteTimestamp,t.Duration)}this.iterator=this.manager.getIterator()}getStaffEntryFromVoiceEntry(t){const e=t.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.measureListIndex,i=t.ParentSourceStaffEntry.ParentStaff.idInMusicSheet;return this.graphic.findGraphicalStaffEntryFromMeasureList(i,e,t.ParentSourceStaffEntry)}update(){if(this.hidden||void 0===this.hidden||null===this.hidden)return;this.updateCurrentPage();const t=this.iterator,e=t.CurrentVisibleVoiceEntries();if(t.EndReached||!t.CurrentVoiceEntries||0===e.length)return;let i,n=0,s=0,r=0;if(t.CurrentMeasure.isReducedToMultiRest){const e=this.graphic.findGraphicalMeasure(t.CurrentMeasureIndex,0),s=e.parentSourceMeasure.multipleRestMeasures,r=t.CurrentMeasure.multipleRestMeasureNumber/(s+1),o=e.PositionAndShape.Size.width-e.beginInstructionsWidth;n=e.PositionAndShape.AbsolutePosition.x+e.beginInstructionsWidth+r*o,i=e.ParentMusicSystem}else{const t=e.map((t=>this.getStaffEntryFromVoiceEntry(t))).sort(((t,e)=>{var i,n,s,r;return(null===(n=null===(i=null==t?void 0:t.PositionAndShape)||void 0===i?void 0:i.AbsolutePosition)||void 0===n?void 0:n.x)<=(null===(r=null===(s=null==e?void 0:e.PositionAndShape)||void 0===s?void 0:s.AbsolutePosition)||void 0===r?void 0:r.x)?-1:1}))[0];n=t.PositionAndShape.AbsolutePosition.x,i=t.parentMeasure.ParentMusicSystem}if(!i)return;s=i.PositionAndShape.AbsolutePosition.y+i.StaffLines[0].PositionAndShape.RelativePosition.y;const o=i.StaffLines[i.StaffLines.length-1];r=i.PositionAndShape.AbsolutePosition.y+o.PositionAndShape.RelativePosition.y+o.StaffHeight-s;const a=this.cursorElement;a.style.top=10*s*this.openSheetMusicDisplay.zoom+"px",a.style.left=10*(n-1.5)*this.openSheetMusicDisplay.zoom+"px",a.height=10*r*this.openSheetMusicDisplay.zoom;const l=30*this.openSheetMusicDisplay.zoom;if(l!==a.width&&(a.width=l,this.updateStyle(l)),this.openSheetMusicDisplay.FollowCursor){const t=this.cursorElement.getBoundingClientRect().top;this.cursorElement.scrollIntoView({behavior:t<1e3?"smooth":"auto",block:"center"})}this.cursorElement.style.display=""}hide(){this.cursorElement.style.display="none",this.hidden=!0}next(){this.iterator.moveToNextVisibleVoiceEntry(!1),this.update()}reset(){this.resetIterator(),this.update()}updateStyle(t,e){e||(e=this.rules.DefaultColorCursor);const i=document.createElement("canvas");i.width=this.cursorElement.width,i.height=1;const n=i.getContext("2d");n.globalAlpha=.5;const s=n.createLinearGradient(0,0,this.cursorElement.width,0);s.addColorStop(0,"white"),s.addColorStop(.2,e),s.addColorStop(.8,e),s.addColorStop(1,"white"),n.fillStyle=s,n.fillRect(0,0,t,1),this.cursorElement.src=i.toDataURL("image/png")}get Iterator(){return this.iterator}get Hidden(){return this.hidden}VoicesUnderCursor(t){return this.iterator.CurrentVisibleVoiceEntries(t)}NotesUnderCursor(t){const e=this.VoicesUnderCursor(t),i=[];return e.forEach((t=>{i.push.apply(i,t.Notes)})),i}updateCurrentPage(){const t=this.iterator.currentTimeStamp;for(const e of this.graphic.MusicPages)if(e.MusicSystems.last().GetSystemsLastTimeStamp().gt(t)){const t=e.PageNumber;return t!==this.currentPageNumber&&(this.container.removeChild(this.cursorElement),this.container=document.getElementById("osmdCanvasPage"+t),this.container.appendChild(this.cursorElement)),this.currentPageNumber=t}return 1}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AClassHierarchyTrackable=void 0,e.AClassHierarchyTrackable=class{isInstanceOfClass(t){let e=this.constructor.prototype;for(;e;){if(t===e.constructor.name)return!0;e=e.__proto__}return!1}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.VerticalGraphicalStaffEntryContainer=void 0,e.VerticalGraphicalStaffEntryContainer=class{constructor(t,e){this.staffEntries=[],this.absoluteTimestamp=e,this.staffEntries=new Array(t)}get Index(){return this.index}set Index(t){this.index=t}get AbsoluteTimestamp(){return this.absoluteTimestamp}get StaffEntries(){return this.staffEntries}set StaffEntries(t){this.staffEntries=t}static compareByTimestamp(t,e){const i=t.absoluteTimestamp.RealValue,n=e.absoluteTimestamp.RealValue;return i<n?-1:i>n?1:0}getFirstNonNullStaffEntry(){for(let t=0,e=this.staffEntries.length;t<e;++t){const e=this.staffEntries[t];if(e)return e}}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.MeasureBuildParameters=e.SystemBuildParameters=e.MusicSystemBuilder=void 0;const n=i(45),s=i(19),r=i(18),o=i(7),a=i(4),l=i(27),h=i(23),c=i(17),u=i(7),d=i(34),f=i(40);e.MusicSystemBuilder=class{constructor(){this.musicSystems=[],this.globalSystemIndex=0,this.leadSheet=!1}initialize(t,e,i){this.leadSheet=t.LeadSheet,this.graphicalMusicSheet=t,this.rules=this.graphicalMusicSheet.ParentMusicSheet.Rules,this.measureList=e,this.numberOfVisibleStaffLines=i,this.activeRhythm=new Array(this.numberOfVisibleStaffLines),this.activeKeys=new Array(this.numberOfVisibleStaffLines),this.activeClefs=new Array(this.numberOfVisibleStaffLines),this.initializeActiveInstructions(this.measureList[0])}buildMusicSystems(){var t,e,i;const n=this.getFullPageSystemWidth();let s=!1;for(this.measureListIndex=0,this.currentSystemParams=new p,this.currentSystemParams.currentSystem=this.initMusicSystem();this.measureListIndex<this.measureList.length;){const r=this.measureList[this.measureListIndex];if(!r||!r[0]){this.measureListIndex++;continue}for(let t=0,e=r.length;t<e;++t)r[t].resetLayout();const o=r[0].parentSourceMeasure,a=o.HasEndLine,l=a&&this.rules.NewPartAndSystemAfterFinalBarline,h=this.currentSystemParams.IsSystemStartMeasure();o.IsSystemStartMeasure=h;const c=o===this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();let u=this.rules.MeasureLeftMargin,d=0;const f=this.getMeasureStartLine();if(u+=this.getLineWidth(r[0],f,h),!this.leadSheet){let t=!1;s&&this.rules.ShowRhythmAgainAfterPartEndOrFinalBarline&&(t=!0),u+=this.addBeginInstructions(r,h,c||t),d+=this.addEndInstructions(r)}let p=0;for(let t=0;t<this.numberOfVisibleStaffLines;t++)p=Math.max(p,r[t].minimumStaffEntriesWidth);const m=this.getMeasureEndLine();d+=this.getLineWidth(r[0],m,h);let b,g=this.rules.MeasureLeftMargin;if(this.measureListIndex+1<this.measureList.length){const e=this.measureList[this.measureListIndex+1];b=null===(t=e[0])||void 0===t?void 0:t.parentSourceMeasure,(null==b?void 0:b.hasBeginInstructions())&&(g+=this.addBeginInstructions(e,!1,!1))}let y=u+d+p;(null===(i=null===(e=r[0])||void 0===e?void 0:e.parentSourceMeasure)||void 0===i?void 0:i.multipleRestMeasures)&&(y=this.rules.MultipleRestMeasureDefaultWidth);const S=this.currentSystemParams.currentWidth+y+g<n,v=this.rules.NewPageAtXMLNewPageAttribute&&o.printNewPageXml,x=v||this.rules.NewSystemAtXMLNewSystemAttribute&&o.printNewSystemXml;if(h||S&&!x){if(this.addMeasureToSystem(r,f,m,y,u,p,d),this.updateActiveClefs(o,r),this.measureListIndex++,l){if(this.rules.MaxSystemToDrawNumber===this.musicSystems.length)return this.finalizeCurrentSystem(r,!this.rules.StretchLastSystemLine,!1),this.musicSystems;this.finalizeCurrentAndCreateNewSystem(r,!this.rules.StretchLastSystemLine,!1)}s=a}else{if(this.rules.MaxSystemToDrawNumber===this.musicSystems.length)return this.finalizeCurrentSystem(r,!1,!0,v),this.musicSystems;this.finalizeCurrentAndCreateNewSystem(r,!1,!0,v)}}if(this.currentSystemParams.systemMeasures.length>0){if(this.rules.MaxSystemToDrawNumber===this.musicSystems.length)return this.finalizeCurrentSystem(this.measureList[this.measureList.length-1],!this.rules.StretchLastSystemLine,!1),this.musicSystems;this.finalizeCurrentAndCreateNewSystem(this.measureList[this.measureList.length-1],!this.rules.StretchLastSystemLine,!1)}return this.musicSystems}calculateSystemYLayout(){for(const t of this.musicSystems)this.optimizeDistanceBetweenStaffLines(t);this.calculateMusicSystemsRelativePositions()}setMeasureWidth(t,e,i,n){for(let s=0,r=t.length;s<r;++s){const r=t[s];r.setWidth(e),i>0&&(r.beginInstructionsWidth=i),n>0&&(r.endInstructionsWidth=n)}}finalizeCurrentAndCreateNewSystem(t,e=!1,i=!0,n=!1){this.finalizeCurrentSystem(t,e,i,n),this.currentSystemParams=new p,void 0!==t&&this.measureListIndex<this.measureList.length&&(this.currentSystemParams.currentSystem=this.initMusicSystem())}finalizeCurrentSystem(t,e=!1,i=!0,n=!1){this.currentSystemParams.currentSystem.breaksPage=n,this.adaptRepetitionLineWithIfNeeded(),void 0!==t&&i&&this.checkAndCreateExtraInstructionMeasure(t),this.stretchMusicSystem(e)}adaptRepetitionLineWithIfNeeded(){const t=this.currentSystemParams.systemMeasures;if(t.length>=1){const e=this.currentSystemParams.currentSystem.GraphicalMeasures[this.currentSystemParams.currentSystem.GraphicalMeasures.length-1],i=t[t.length-1];let n=0;i.endLine===h.SystemLinesEnum.DotsBoldBoldDots&&(i.endLine=h.SystemLinesEnum.DotsThinBold,n=e[0].getLineWidth(h.SystemLinesEnum.DotsBoldBoldDots)/2-e[0].getLineWidth(h.SystemLinesEnum.DotsThinBold)),this.currentSystemParams.currentSystemFixWidth-=n;for(let t=0,s=e.length;t<s;++t)e[t].endInstructionsWidth-=n}}addMeasureToSystem(t,e,i,n,s,r,o){this.currentSystemParams.systemMeasures.push({beginLine:e,endLine:i}),this.setMeasureWidth(t,n,s,o),this.addStaveMeasuresToSystem(t),this.currentSystemParams.currentWidth+=n,this.currentSystemParams.currentSystemFixWidth+=s+o,this.currentSystemParams.currentSystemVarWidth+=r,this.currentSystemParams.systemMeasureIndex++}initMusicSystem(){const t=c.MusicSheetCalculator.symbolFactory.createMusicSystem(this.globalSystemIndex++,this.rules);return this.musicSystems.push(t),this.layoutSystemStaves(t),t.createMusicSystemLabel(this.rules.InstrumentLabelTextHeight,this.rules.SystemLabelsRightMargin,this.rules.LabelMarginBorderFactor,1===this.musicSystems.length),t}getFullPageSystemWidth(){return this.graphicalMusicSheet.ParentMusicSheet.pageWidth-this.rules.PageLeftMargin-this.rules.PageRightMargin-this.rules.SystemLeftMargin-this.rules.SystemRightMargin}layoutSystemStaves(t){const e=this.getFullPageSystemWidth(),i=t.PositionAndShape;i.BorderLeft=0,i.BorderRight=e,i.BorderTop=0;const n=[],s=this.graphicalMusicSheet.ParentMusicSheet.Instruments;for(let a=0,l=s.length;a<l;++a){const t=s[a];if(t.Visible&&0!==t.Voices.length)for(let e=0,i=t.Staves.length;e<i;++e){const i=t.Staves[e];n.push(i)}}let r=!1;if(this.leadSheet)for(let a=0,l=n.length;a<l;++a)if(n[a].ParentInstrument.LyricVersesNumbers.length>1){r=!0;break}let o=0;for(let a=0;a<n.length;a++)if(this.addStaffLineToMusicSystem(t,o,n[a]),o+=this.rules.StaffHeight,a+1<n.length){let t=0;t=this.leadSheet&&!r?2.5:n[a].ParentInstrument===n[a+1].ParentInstrument?this.rules.BetweenStaffDistance:this.rules.StaffDistance,o+=t}i.BorderBottom=o}addStaffLineToMusicSystem(t,e,i){if(t){const n=c.MusicSheetCalculator.symbolFactory.createStaffLine(t,i);t.StaffLines.push(n);const s=n.PositionAndShape,r=new a.PointF2D;r.x=0,s.BorderRight=t.PositionAndShape.Size.width,r.y=e,s.RelativePosition=r,s.BorderLeft=0,s.BorderTop=0,s.BorderBottom=this.rules.StaffHeight;for(let t=0;t<5;t++){const e=new a.PointF2D;e.x=0,e.y=t*this.rules.StaffHeight/4;const i=new a.PointF2D;i.x=n.PositionAndShape.Size.width,i.y=t*this.rules.StaffHeight/4,this.leadSheet&&(e.y=i.y=0),n.StaffLines[t]=new l.GraphicalLine(e,i,this.rules.StaffLineWidth)}}}initializeActiveInstructions(t){const e=this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();if(e){this.visibleStaffIndices=this.graphicalMusicSheet.getVisibleStavesIndicesFromSourceMeasure(t);for(let t=0,i=this.visibleStaffIndices.length;t<i;t++){const i=this.visibleStaffIndices[t],n=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(e,i);this.activeClefs[t]=e.FirstInstructionsStaffEntries[i].Instructions[0];const s=e.FirstInstructionsStaffEntries[i].Instructions[1];if(s){let e=r.KeyInstruction.copy(s);e=this.transposeKeyInstruction(e,n),this.activeKeys[t]=e}const o=e.FirstInstructionsStaffEntries[i].Instructions[2];this.activeRhythm[t]=o}}}transposeKeyInstruction(t,e){return this.graphicalMusicSheet.ParentMusicSheet.Transpose!==t.isTransposedBy&&e.ParentStaff.ParentInstrument.MidiInstrumentId!==u.MidiInstrument.Percussion&&void 0!==c.MusicSheetCalculator.transposeCalculator&&c.MusicSheetCalculator.transposeCalculator.transposeKey(t,this.graphicalMusicSheet.ParentMusicSheet.Transpose),t}addBeginInstructions(t,e,i){const n=t.length;if(0===n)return 0;let s=0;const r=t[0].parentSourceMeasure;for(let o=0;o<n;++o){const n=t[o],a=this.visibleStaffIndices[o],l=r.FirstInstructionsStaffEntries[a],h=this.AddInstructionsAtMeasureBegin(l,n,o,i,e);s=Math.max(s,h)}return s}addEndInstructions(t){const e=t.length;if(0===e)return 0;let i=.5;const n=t[0].parentSourceMeasure;for(let s=0;s<e;s++){const e=t[s],r=this.visibleStaffIndices[s],o=n.LastInstructionsStaffEntries[r],a=this.addInstructionsAtMeasureEnd(o,e,t);i=Math.max(i,a)}return i}AddInstructionsAtMeasureBegin(t,e,i,n,a){var l;let h,c,u,d=0;if(t)for(let b=0,g=t.Instructions.length;b<g;++b){const e=t.Instructions[b];e instanceof o.ClefInstruction?h=e:e instanceof r.KeyInstruction?c=e:e instanceof s.RhythmInstruction&&(u=e)}a&&(h||(h=this.activeClefs[i]),c||(c=r.KeyInstruction.copy(this.activeKeys[i])),n&&!u&&(u=this.activeRhythm[i]));let f=!1,p=!1,m=!1;if(h?(e.addClefAtBegin(h),f=!0):h=this.activeClefs[i],c){c=this.transposeKeyInstruction(c,e);const t=a?void 0:this.activeKeys[i];e.addKeyAtBegin(c,t,h),p=!0}if(void 0!==u&&u.PrintObject&&this.rules.RenderTimeSignatures){let t=!0;const i=e.MeasureNumber-1;if(e.MeasureNumber-1>=0){const e=null===(l=this.measureList[i][0])||void 0===l?void 0:l.parentSourceMeasure;(null==e?void 0:e.ImplicitMeasure)&&(null==e?void 0:e.RhythmPrinted)&&(t=!1)}t&&(e.addRhythmAtBegin(u),e.parentSourceMeasure.RhythmPrinted=!0,m=!0)}return(f||p||m)&&(d+=e.beginInstructionsWidth,m&&(d+=this.rules.RhythmRightMargin)),d}addInstructionsAtMeasureEnd(t,e,i){if(!t||!t.Instructions||0===t.Instructions.length)return 0;for(let n=0,s=t.Instructions.length;n<s;++n){const s=t.Instructions[n];if(s instanceof o.ClefInstruction){const t=s;e.addClefAtEnd(t);for(const n of i)n!==e&&n.addClefAtEnd(t,!1)}}return this.rules.MeasureRightMargin+e.endInstructionsWidth}updateActiveClefs(t,e){for(let i=0,n=e.length;i<n;i++){const e=this.visibleStaffIndices[i],n=t.FirstInstructionsStaffEntries[e];if(n)for(let t=0,h=n.Instructions.length;t<h;++t){const e=n.Instructions[t];e instanceof o.ClefInstruction?this.activeClefs[i]=e:e instanceof r.KeyInstruction?this.activeKeys[i]=e:e instanceof s.RhythmInstruction&&(this.activeRhythm[i]=e)}const a=t.getEntriesPerStaff(e);for(let t=0,s=a.length;t<s;++t){const e=a[t];if(e.Instructions)for(let t=0,n=e.Instructions.length;t<n;++t){const n=e.Instructions[t];n instanceof o.ClefInstruction&&(this.activeClefs[i]=n)}}const l=t.LastInstructionsStaffEntries[e];if(l){const t=l.Instructions;for(let e=0,n=t.length;e<n;++e){const n=t[e];n instanceof o.ClefInstruction&&(this.activeClefs[i]=n)}}}}checkAndCreateExtraInstructionMeasure(t){const e=t[0].parentSourceMeasure.FirstInstructionsStaffEntries,i=[];for(let s=0,r=t.length;s<r;++s){const n=t[s];i.push(e[n.ParentStaff.idInMusicSheet])}let n=0;for(let o=0,a=i.length;o<a;++o){const t=i[o];if(!t)continue;const e=t.Instructions;let a,l;for(let i=0,n=e.length;i<n;++i){const t=e[i];t instanceof r.KeyInstruction&&t.Key!==this.activeKeys[o].Key&&(a=t),t instanceof s.RhythmInstruction&&t!==this.activeRhythm[o]&&(l=t)}if(void 0!==a||l){const t=this.addExtraInstructionMeasure(o,a,l);n=Math.max(n,t)}}n>0&&(this.currentSystemParams.systemMeasures.push({beginLine:h.SystemLinesEnum.None,endLine:h.SystemLinesEnum.None}),this.currentSystemParams.currentWidth+=n,this.currentSystemParams.currentSystemFixWidth+=n)}addExtraInstructionMeasure(t,e,i){const n=this.currentSystemParams.currentSystem,s=c.MusicSheetCalculator.symbolFactory.createExtraGraphicalMeasure(n.StaffLines[t]);e&&s.addKeyAtBegin(e,this.activeKeys[t],this.activeClefs[t]),void 0!==i&&i.PrintObject&&s.addRhythmAtBegin(i),s.PositionAndShape.BorderLeft=0,s.PositionAndShape.BorderTop=0,s.PositionAndShape.BorderBottom=this.rules.StaffHeight;const r=this.rules.MeasureLeftMargin+s.beginInstructionsWidth+this.rules.MeasureRightMargin;return s.PositionAndShape.BorderRight=r,n.StaffLines[t].Measures.push(s),r}addStaveMeasuresToSystem(t){if(t[0]){const e=[];for(let n=0;n<t.length;n++)e.push(t[n]);const i=this.currentSystemParams.currentSystem;for(let t=0;t<this.numberOfVisibleStaffLines;t++){const n=e[t];i.StaffLines[t].Measures.push(n),n.ParentStaffLine=i.StaffLines[t]}i.AddGraphicalMeasures(e)}}getMeasureStartLine(){if(this.thisMeasureBeginsLineRepetition()){const t=this.currentSystemParams.IsSystemStartMeasure(),e=0===this.measureListIndex;if(this.previousMeasureEndsLineRepetition()&&!t)return h.SystemLinesEnum.DotsBoldBoldDots;if(!e)return h.SystemLinesEnum.BoldThinDots}return h.SystemLinesEnum.None}getMeasureEndLine(){let t;try{if(t=this.measureList[this.measureListIndex][0].parentSourceMeasure,this.rules.RenderMultipleRestMeasures&&t.multipleRestMeasures>1){const e=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,t.measureListIndex+t.multipleRestMeasures-1);t=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[e]}}finally{}return this.nextMeasureBeginsLineRepetition()&&this.thisMeasureEndsLineRepetition()?h.SystemLinesEnum.DotsBoldBoldDots:this.thisMeasureEndsLineRepetition()?h.SystemLinesEnum.DotsThinBold:this.nextMeasureHasKeyInstructionChange()||this.thisMeasureEndsWordRepetition()||this.nextMeasureBeginsWordRepetition()?h.SystemLinesEnum.DoubleThin:t&&void 0!==t.endingBarStyleEnum?t.endingBarStyleEnum:h.SystemLinesEnum.SingleThin}getLineWidth(t,e,i){let n=t.getLineWidth(e);return e===h.SystemLinesEnum.DotsBoldBoldDots&&(n/=2),i&&e===h.SystemLinesEnum.BoldThinDots&&(n+=this.rules.DistanceBetweenLastInstructionAndRepetitionBarline),n}previousMeasureEndsLineRepetition(){if(0===this.measureListIndex)return!1;for(let t=0,e=this.measureList[this.measureListIndex-1].length;t<e;++t)if(this.measureList[this.measureListIndex-1][t].endsWithLineRepetition())return!0;return!1}thisMeasureBeginsLineRepetition(){for(let t=0,e=this.measureList[this.measureListIndex].length;t<e;++t)if(this.measureList[this.measureListIndex][t].beginsWithLineRepetition())return!0;return!1}nextMeasureBeginsLineRepetition(){const t=this.measureListIndex+1;if(t>=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||!this.measureList[t])return!1;for(let e=0,i=this.measureList[t].length;e<i;++e)if(this.measureList[t][e].beginsWithLineRepetition())return!0;return!1}thisMeasureEndsLineRepetition(){for(let t=0,e=this.measureList[this.measureListIndex].length;t<e;++t)if(this.measureList[this.measureListIndex][t].endsWithLineRepetition())return!0;return!1}nextMeasureBeginsWordRepetition(){const t=this.measureListIndex+1;if(t>=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||t>this.measureList.length-1)return!1;for(let e=0,i=this.measureList[t].length;e<i;++e)if(this.measureList[t][e].beginsWithWordRepetition())return!0;return!1}thisMeasureEndsWordRepetition(){for(let t=0,e=this.measureList[this.measureListIndex].length;t<e;++t)if(this.measureList[this.measureListIndex][t].endsWithWordRepetition())return!0;return!1}nextMeasureHasKeyInstructionChange(){return void 0!==this.getNextMeasureKeyInstruction()}getNextMeasureKeyInstruction(){var t;if(this.measureListIndex<this.measureList.length-1)for(let e=0;e<this.measureList[this.measureListIndex].length;e++){const i=null===(t=this.measureList[this.measureListIndex+1][e])||void 0===t?void 0:t.parentSourceMeasure;if(!i)return;return i.getKeyInstruction(this.visibleStaffIndices[e])}}calculateXScalingFactor(t,e){return Math.abs(e-0)<1e-5||Math.abs(t-0)<1e-5?1:(this.currentSystemParams.currentSystem.StaffLines[0].PositionAndShape.Size.width-t)/e}stretchMusicSystem(t){let e=this.calculateXScalingFactor(this.currentSystemParams.currentSystemFixWidth,this.currentSystemParams.currentSystemVarWidth);t&&(e=Math.min(e,this.rules.LastSystemMaxScalingFactor));const i=this.currentSystemParams.currentSystem;for(let n=0,s=i.StaffLines.length;n<s;++n){const t=i.StaffLines[n];let s=0;for(let n=0;n<t.Measures.length;n++){const r=t.Measures[n];r.setPositionInStaffline(s);const o=r.beginInstructionsWidth;if(r.setWidth(o+r.minimumStaffEntriesWidth*e+r.endInstructionsWidth),n<this.currentSystemParams.systemMeasures.length){const t=this.currentSystemParams.systemMeasures[n].beginLine,e=r.getLineWidth(h.SystemLinesEnum.BoldThinDots);switch(t){case h.SystemLinesEnum.BoldThinDots:let o=s;0===n&&(o=s+r.beginInstructionsWidth-e),i.createVerticalLineForMeasure(o,e,t,f.SystemLinePosition.MeasureBegin,n,r)}}if(r.staffEntriesScaleFactor=e,r.layoutSymbols(),!(n+1<this.currentSystemParams.systemMeasures.length&&this.currentSystemParams.systemMeasures[n+1].beginLine===h.SystemLinesEnum.BoldThinDots)){let t=h.SystemLinesEnum.SingleThin;n<this.currentSystemParams.systemMeasures.length&&(t=this.currentSystemParams.systemMeasures[n].endLine);const e=r.getLineWidth(t);let s=r.PositionAndShape.RelativePosition.x+r.PositionAndShape.BorderRight-e;t===h.SystemLinesEnum.DotsBoldBoldDots&&(s-=e/2),i.createVerticalLineForMeasure(s,e,t,f.SystemLinePosition.MeasureEnd,n,r)}s=r.PositionAndShape.RelativePosition.x+r.PositionAndShape.BorderRight}}t&&this.decreaseMusicSystemBorders()}decreaseMusicSystemBorders(){const t=this.currentSystemParams.currentSystem,e=d.CollectionUtil.last(t.StaffLines[0].Measures).PositionAndShape,i=e.RelativePosition.x+e.Size.width;for(let n=0,s=t.StaffLines.length;n<s;++n){const e=t.StaffLines[n];e.PositionAndShape.BorderRight=i;for(let t=0,n=e.StaffLines.length;t<n;++t){const n=e.StaffLines[t];n.End=new a.PointF2D(i,n.End.y)}}t.PositionAndShape.BorderRight=i+this.currentSystemParams.maxLabelLength+this.rules.SystemLabelsRightMargin}updateStaffLinesRelativePosition(t,e,i){for(let n=e;n<t.StaffLines.length;n++)t.StaffLines[n].PositionAndShape.RelativePosition.y=i;t.PositionAndShape.BorderBottom+=i}createMusicPage(){const t=new n.GraphicalMusicPage(this.graphicalMusicSheet);return this.graphicalMusicSheet.MusicPages.push(t),t.PageNumber=this.graphicalMusicSheet.MusicPages.length,t.PositionAndShape.BorderLeft=0,t.PositionAndShape.BorderRight=this.graphicalMusicSheet.ParentMusicSheet.pageWidth,t.PositionAndShape.BorderTop=0,t.PositionAndShape.BorderBottom=this.rules.PageHeight,t.PositionAndShape.RelativePosition=new a.PointF2D(0,0),t}addSystemToPage(t,e){t.MusicSystems.push(e),e.Parent=t}optimizeDistanceBetweenStaffLines(t){if(!t.checkStaffEntriesForStaffEntryLink())for(let n=0;n<t.StaffLines.length-1;n++){const e=t.StaffLines[n].BottomLine,i=t.StaffLines[n+1].SkyLine;let s=0;for(let t=0;t<e.length;t++){const n=e[t],r=Math.max(0,t-6),o=Math.min(i.length-1,t+6);let a=0;for(let t=r;t<=o;t++)a=Math.min(a,i[t]);const l=n-a;s=Math.max(l,s)}s+=this.rules.MinSkyBottomDistBetweenStaves,s=Math.max(s,this.rules.StaffHeight+this.rules.MinimumStaffLineDistance);const r=s+t.StaffLines[n].PositionAndShape.RelativePosition.y;this.updateStaffLinesRelativePosition(t,n+1,r)}const e=t.StaffLines[0];t.PositionAndShape.BorderTop=e.PositionAndShape.RelativePosition.y+e.PositionAndShape.BorderTop;const i=t.StaffLines[t.StaffLines.length-1];t.PositionAndShape.BorderBottom=i.PositionAndShape.RelativePosition.y+i.PositionAndShape.BorderBottom}calculateMusicSystemsRelativePositions(){let t=this.createMusicPage(),e=0,i=this.musicSystems[0],n=0;for(let s=0;s<this.musicSystems.length;s++)if(i=this.musicSystems[s],0===t.MusicSystems.length){this.addSystemToPage(t,i),e=this.rules.CompactMode?this.rules.PageTopMarginNarrow:this.rules.PageTopMargin,1===this.graphicalMusicSheet.MusicPages.length&&this.rules.RenderTitle&&(e+=this.rules.TitleTopDistance+this.rules.SheetTitleHeight+this.rules.TitleBottomDistance);const s=new a.PointF2D(this.rules.PageLeftMargin+this.rules.SystemLeftMargin,e);i.PositionAndShape.RelativePosition=s,e+i.PositionAndShape.BorderBottom>this.rules.PageHeight-this.rules.PageBottomMargin&&(n++,n<=4&& (`warning: could not fit a single system on page ${t.PageNumber} and measure number ${i.GraphicalMeasures[0][0].MeasureNumber}.\n The PageFormat may be too small for this sheet."\n Will not give further warnings for all pages, only total.`))}else{const n=this.musicSystems[s-1],r=n.StaffLines[n.StaffLines.length-1],o=r.PositionAndShape;let l=this.findRequiredDistanceWithSkyBottomLine(n,i);l+=this.rules.MinSkyBottomDistBetweenSystems,l=Math.max(l,this.rules.MinimumDistanceBetweenSystems+r.StaffHeight);const h=e+o.RelativePosition.y+l,c=h+i.PositionAndShape.BorderMarginBottom;if(this.rules.NewPageAtXMLNewPageAttribute&&n.breaksPage||!(c<this.rules.PageHeight-this.rules.PageBottomMargin)){t=this.createMusicPage(),s-=1;continue}{this.addSystemToPage(t,i),e=h;const n=new a.PointF2D(this.rules.PageLeftMargin+this.rules.SystemLeftMargin,e);i.PositionAndShape.RelativePosition=n}}n>0&& (`total amount of pages that couldn't fit a single music system: ${n} of ${t.PageNumber}`)}findRequiredDistanceWithSkyBottomLine(t,e){const i=t.StaffLines[t.StaffLines.length-1],n=e.StaffLines[0],s=i.BottomLine,r=n.SkyLine,o=i.PositionAndShape,a=n.PositionAndShape,l=1/this.rules.SamplingUnit;let h=0;for(let c=0;c<s.length;c++){const t=s[c],e=c+Math.round((o.RelativePosition.x-a.RelativePosition.x)*l);if(e<0)continue;if(e>=r.length)break;const i=Math.max(0,e-6),n=Math.min(r.length-1,e+6);let u=0;for(let s=i;s<=n;s++)u=Math.min(u,r[s]);const d=t-u;h=Math.max(d,h)}return 0===h&&(h=o.BorderBottom-a.BorderTop),h}};class p{constructor(){this.systemMeasures=[],this.systemMeasureIndex=0,this.currentWidth=0,this.currentSystemFixWidth=0,this.currentSystemVarWidth=0,this.maxLabelLength=0}IsSystemStartMeasure(){return 0===this.systemMeasureIndex}}e.SystemBuildParameters=p,e.MeasureBuildParameters=class{}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.Clickable=void 0;const n=i(6);class s extends n.GraphicalObject{}e.Clickable=s},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.OctaveShiftParams=void 0,e.OctaveShiftParams=class{constructor(t,e,i){this.getOpenOctaveShift=t,this.getAbsoluteStartTimestamp=e,this.getAbsoluteEndTimestamp=i}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AccidentalCalculator=void 0;const n=i(2),s=i(2),r=i(15),o=i(17);e.AccidentalCalculator=class{constructor(){this.keySignatureNoteAlterationsDict=new r.Dictionary,this.currentAlterationsComparedToKeyInstructionList=[],this.currentInMeasureNoteAlterationsDict=new r.Dictionary}get ActiveKeyInstruction(){return this.activeKeyInstruction}set ActiveKeyInstruction(t){this.activeKeyInstruction=t,this.reactOnKeyInstructionChange()}doCalculationsAtEndOfMeasure(){this.currentInMeasureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.clear();for(const t of this.keySignatureNoteAlterationsDict.keys())this.currentInMeasureNoteAlterationsDict.setValue(t,this.keySignatureNoteAlterationsDict.getValue(t))}checkAccidental(t,e){if(!e)return;const i=e.FundamentalNote+12*e.Octave,r=this.currentAlterationsComparedToKeyInstructionList.indexOf(i)>=0;if(this.currentInMeasureNoteAlterationsDict.containsKey(i)){if(r&&this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(i),1),this.currentInMeasureNoteAlterationsDict.getValue(i)!==e.AccidentalHalfTones){this.keySignatureNoteAlterationsDict.containsKey(i)&&this.keySignatureNoteAlterationsDict.getValue(i)!==e.AccidentalHalfTones?(this.currentAlterationsComparedToKeyInstructionList.push(i),this.currentInMeasureNoteAlterationsDict.setValue(i,e.AccidentalHalfTones)):e.Accidental!==n.AccidentalEnum.NONE&&this.currentInMeasureNoteAlterationsDict.remove(i);const r=this.currentInMeasureNoteAlterationsDict.getValue(i);e.Accidental===n.AccidentalEnum.NONE&&(e=.5===Math.abs(r)?new s.Pitch(e.FundamentalNote,e.Octave,n.AccidentalEnum.NONE):new s.Pitch(e.FundamentalNote,e.Octave,n.AccidentalEnum.NATURAL)),o.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(t,e)}}else e.Accidental!==n.AccidentalEnum.NONE?(r||this.currentAlterationsComparedToKeyInstructionList.push(i),this.currentInMeasureNoteAlterationsDict.setValue(i,e.AccidentalHalfTones),o.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(t,e)):r&&(e=new s.Pitch(e.FundamentalNote,e.Octave,n.AccidentalEnum.NATURAL),this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(i),1),o.MusicSheetCalculator.symbolFactory.addGraphicalAccidental(t,e))}reactOnKeyInstructionChange(){const t=this.activeKeyInstruction.AlteratedNotes;let e;e=this.activeKeyInstruction.Key>0?n.AccidentalEnum.SHARP:n.AccidentalEnum.FLAT,this.keySignatureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.length=0;for(let i=-9;i<9;i++)for(let n=0;n<t.length;n++)this.keySignatureNoteAlterationsDict.setValue(t[n]+12*i,s.Pitch.HalfTonesFromAccidental(e));this.doCalculationsAtEndOfMeasure()}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSystem=void 0;const n=i(73),s=i(5),r=i(0),o=i(9),a=i(24),l=i(6),h=i(4),c=i(23),u=i(15),d=i(40),f=i(12);class p extends l.GraphicalObject{constructor(t){super(),this.needsToBeRedrawn=!0,this.staffLines=[],this.graphicalMeasures=[],this.labels=new u.Dictionary,this.measureNumberLabels=[],this.objectsToRedraw=[],this.instrumentBrackets=[],this.groupBrackets=[],this.graphicalMarkedAreas=[],this.graphicalComments=[],this.systemLines=[],this.breaksPage=!1,this.id=t,this.boundingBox=new s.BoundingBox(this),this.maxLabelLength=0}get Parent(){return this.parent}set Parent(t){if(this.parent){const t=this.parent.MusicSystems.indexOf(this,0);t>-1&&this.parent.MusicSystems.splice(t,1)}this.parent=t,this.boundingBox.Parent=t.PositionAndShape}get NextSystem(){const t=this.Parent.MusicSystems.indexOf(this);return t!==this.Parent.MusicSystems.length?this.Parent.MusicSystems[t+1]:void 0}get StaffLines(){return this.staffLines}get GraphicalMeasures(){return this.graphicalMeasures}get MeasureNumberLabels(){return this.measureNumberLabels}get Labels(){return this.labels.values()}get ObjectsToRedraw(){return this.objectsToRedraw}get InstrumentBrackets(){return this.instrumentBrackets}get GroupBrackets(){return this.groupBrackets}get GraphicalMarkedAreas(){return this.graphicalMarkedAreas}get GraphicalComments(){return this.graphicalComments}get SystemLines(){return this.systemLines}get Id(){return this.id}createSystemLeftLine(t,e,i){let n=-t/2;i&&(n=this.maxLabelLength+e-t/2);const s=this.staffLines[0].Measures[0];let r;this.staffLines.length>1&&(r=this.staffLines[this.staffLines.length-1].Measures[0]);const o=this.createSystemLine(n,t,c.SystemLinesEnum.SingleThin,d.SystemLinePosition.MeasureBegin,this,s,r);this.SystemLines.push(o),o.PositionAndShape.RelativePosition=new h.PointF2D(n,0),o.PositionAndShape.BorderLeft=0,o.PositionAndShape.BorderRight=t,o.PositionAndShape.BorderTop=0,o.PositionAndShape.BorderBottom=this.boundingBox.Size.height,this.createLinesForSystemLine(o)}createVerticalLineForMeasure(t,e,i,n,s,r){const o=r.ParentStaffLine,a=new h.PointF2D(o.PositionAndShape.RelativePosition.x,o.PositionAndShape.RelativePosition.y),l=o.ParentStaff.ParentInstrument.Staves;if(o.ParentStaff===l[0]){let c;l.length>1&&(c=this.getBottomStaffLine(o).Measures[s]);const u=this.createSystemLine(t,e,i,n,this,r,c),d=a.x+t;u.PositionAndShape.RelativePosition=new h.PointF2D(d,0),u.PositionAndShape.BorderLeft=0,u.PositionAndShape.BorderRight=e,this.SystemLines.push(u)}}setYPositionsToVerticalLineObjectsAndCreateLines(t){}calculateBorders(t){}alignBeginInstructions(){}GetLeftBorderAbsoluteXPosition(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].Measures[0].beginInstructionsWidth}GetRightBorderAbsoluteXPosition(){return this.StaffLines[0].PositionAndShape.AbsolutePosition.x+this.StaffLines[0].StaffLines[0].End.x}AddGraphicalMeasures(t){for(let e=0,i=t.length;e<i;++e)t[e].ParentMusicSystem=this;this.graphicalMeasures.push(t)}GetSystemsFirstTimeStamp(){return this.graphicalMeasures[0][0].parentSourceMeasure.AbsoluteTimestamp}GetSystemsLastTimeStamp(){const t=this.graphicalMeasures[this.graphicalMeasures.length-1][0].parentSourceMeasure;return r.Fraction.plus(t.AbsoluteTimestamp,t.Duration)}createInstrumentBrackets(t,e){for(let i=0,n=t.length;i<n;++i){const e=t[i];if(e.Staves.length>1){let t,i;for(let n=0,s=this.staffLines.length;n<s;++n){const s=this.staffLines[n];s.ParentStaff===e.Staves[0]&&(t=s),s.ParentStaff===e.Staves[e.Staves.length-1]&&(i=s)}t&&i&&this.createInstrumentBracket(t,i)}}}createGroupBrackets(t,e,i){for(let n=0,s=t.length;n<s;++n){const s=t[n];if(s.InstrumentalGroups.length<1)continue;const r=this.findFirstVisibleInstrumentInInstrumentalGroup(s),o=this.findLastVisibleInstrumentInInstrumentalGroup(s);if(!r||!o)continue;let a,l;for(let t=0,e=this.staffLines.length;t<e;++t){const e=this.staffLines[t];e.ParentStaff===r.Staves[0]&&(a=e),e.ParentStaff===o.Staves[0]&&(l=e)}a&&l&&this.createGroupBracket(a,l,i),s.InstrumentalGroups.length<1||this.createGroupBrackets(s.InstrumentalGroups,e,i+1)}}createMusicSystemLabel(t,e,i,n=!1){var s;const r=e;for(let h=0,c=this.staffLines.length;h<c;++h){const i=this.staffLines[h].ParentStaff.ParentInstrument;let r;if(n)r=i.NameLabel,this.rules.RenderPartNames&&(null==r?void 0:r.print)||(r=new f.Label("",i.NameLabel.textAlignment,i.NameLabel.font),e=0);else{if(!this.rules.RenderPartAbbreviations||!this.rules.RenderPartNames||1===this.staffLines.length||!i.PartAbbreviation||""===i.PartAbbreviation)return;const t=i.PartAbbreviation;r=new f.Label(t,i.NameLabel.textAlignment,i.NameLabel.font)}if(null===(s=null==i?void 0:i.NameLabel)||void 0===s?void 0:s.print){const e=new a.GraphicalLabel(r,t,o.TextAlignmentEnum.LeftCenter,this.rules,this.boundingBox);e.setLabelPositionAndShapeBorders(),this.labels.setValue(i,e)}else e=0}this.maxLabelLength=0;const l=this.labels.values();for(let o=0,a=l.length;o<a;++o){const t=l[o];t.Label.print&&t.PositionAndShape.Size.width>this.maxLabelLength&&(this.maxLabelLength=t.PositionAndShape.Size.width,e=r)}this.updateMusicSystemStaffLineXPosition(e)}setMusicSystemLabelsYPosition(){this.labels.forEach(((t,e)=>{let i=0,n=0;for(let s=0;s<this.staffLines.length;s++)if(this.staffLines[s].ParentStaff.ParentInstrument===t){for(let e=s;e<this.staffLines.length;e++){const s=this.staffLines[e];if(s.ParentStaff.ParentInstrument!==t)break;i+=s.PositionAndShape.RelativePosition.y,n++}break}n>0&&(e.PositionAndShape.RelativePosition=new h.PointF2D(0,i/n+2))}))}checkStaffEntriesForStaffEntryLink(){let t=!1,e=!1;for(let i=0;i<this.staffLines.length-1;i++){for(let e=0,n=this.staffLines[i].Measures.length;e<n;++e){const n=this.staffLines[i].Measures[e];for(let e=0,i=n.staffEntries.length;e<i;++e)n.staffEntries[e].sourceStaffEntry.Link&&(t=!0)}for(let t=0,n=this.staffLines[i+1].Measures.length;t<n;++t){const n=this.staffLines[i+1].Measures[t];for(let t=0,i=n.staffEntries.length;t<i;++t)n.staffEntries[t].sourceStaffEntry.Link&&(e=!0)}}return!(!t||!e)}getBottomStaffLine(t){const e=t.ParentStaff.ParentInstrument.Staves,i=e[e.length-1];for(const n of t.ParentMusicSystem.staffLines)if(n.ParentStaff===i)return n}createSystemLine(t,e,i,n,s,r,o){throw new Error("not implemented")}createLinesForSystemLine(t){}calcBracketsWidth(){let t=0;for(let e=0,i=this.GroupBrackets.length;e<i;++e){const i=this.GroupBrackets[e];t=Math.max(t,i.PositionAndShape.Size.width)}for(let e=0,i=this.InstrumentBrackets.length;e<i;++e){const i=this.InstrumentBrackets[e];t=Math.max(t,i.PositionAndShape.Size.width)}return t}createInstrumentBracket(t,e){}createGroupBracket(t,e,i){}findFirstVisibleInstrumentInInstrumentalGroup(t){for(let e=0,i=t.InstrumentalGroups.length;e<i;++e){const i=t.InstrumentalGroups[e];if(!(i instanceof n.Instrument))return this.findFirstVisibleInstrumentInInstrumentalGroup(i);if(!0===i.Visible)return i}}findLastVisibleInstrumentInInstrumentalGroup(t){let e;for(let i=t.InstrumentalGroups.length-1;i>=0;i--){if(e=t.InstrumentalGroups[i],!(e instanceof n.Instrument))return this.findLastVisibleInstrumentInInstrumentalGroup(e);if(!0===e.Visible)return e}}updateMusicSystemStaffLineXPosition(t){for(let e=0,i=this.StaffLines.length;e<i;++e){const i=this.StaffLines[e],n=i.PositionAndShape.RelativePosition;n.x=this.maxLabelLength+t,i.PositionAndShape.RelativePosition=n,i.PositionAndShape.BorderRight=this.boundingBox.Size.width-this.maxLabelLength-t;for(let t=0;t<i.StaffLines.length;t++){const e=new h.PointF2D(i.PositionAndShape.Size.width,i.StaffLines[t].End.y);i.StaffLines[t].End=e}}}}e.MusicSystem=p},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.Staff=void 0,e.Staff=class{constructor(t,e){this.isTab=!1,this.voices=[],this.volume=1,this.stafflineCount=5,this.parentInstrument=t,this.id=e,this.audible=!0,this.following=!0}get ParentInstrument(){return this.parentInstrument}set ParentInstrument(t){this.parentInstrument=t}get Voices(){return this.voices}get Id(){return this.id}get Volume(){return this.volume}set Volume(t){this.volume=t}get StafflineCount(){return this.stafflineCount}set StafflineCount(t){this.stafflineCount=t}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSheetDrawer=void 0;const n=i(5),s=i(22),r=i(27),o=i(46),a=i(4),l=i(24),h=i(12),c=i(9),u=i(11),d=i(75),f=i(77),p=i(120),m=i(121),b=i(47);e.MusicSheetDrawer=class{constructor(t,e){this.drawableBoundingBoxElement=!1,this.skyLineVisible=!1,this.bottomLineVisible=!1,this.phonicScoreMode=p.PhonicScoreModes.Manual,this.textMeasurer=t,this.splitScreenLineColor=-1,this.drawingParameters=e,this.rules=e.Rules}set Mode(t){this.phonicScoreMode=t}drawSheet(t){if(this.graphicalMusicSheet=t,this.rules=t.ParentMusicSheet.Rules,this.drawSplitScreenLine(),this.drawingParameters.drawCursors)for(const i of t.Cursors){if(!i)continue;const t=new n.BoundingBox(i);t.AbsolutePosition=i.Start,t.BorderBottom=i.End.y-i.Start.y,t.BorderRight=i.Width/2,t.BorderLeft=-i.Width/2,this.isVisible(t)&&this.drawLineAsVerticalRectangle(i,s.GraphicalLayers.Cursor)}this.drawingParameters.drawScrollIndicator&&this.drawScrollIndicator();const e=Math.min(this.graphicalMusicSheet.MusicPages.length,this.rules.MaxPageToDrawNumber);for(let i=0;i<e;i++){const t=this.graphicalMusicSheet.MusicPages[i];this.drawPage(t)}}drawLineAsHorizontalRectangle(t,e){let i=new o.RectangleF2D(t.Start.x,t.End.y-t.Width/2,t.End.x-t.Start.x,t.Width);i=this.applyScreenTransformationForRect(i),this.renderRectangle(i,e,t.styleId,t.colorHex)}drawLineAsVerticalRectangle(t,e){const i=t.Start,n=t.Width;let s=new o.RectangleF2D(i.x-n/2,i.y,n,t.End.y-i.y);s=this.applyScreenTransformationForRect(s),this.renderRectangle(s,e,t.styleId)}drawLineAsHorizontalRectangleWithOffset(t,e,i){const n=new a.PointF2D(t.Start.x+e.x,t.Start.y+e.y),s=new a.PointF2D(t.End.x+e.x,t.End.y+e.y),r=t.Width;let l=new o.RectangleF2D(n.x,s.y-r/2,s.x-n.x,r);l=this.applyScreenTransformationForRect(l),this.renderRectangle(l,i,t.styleId)}drawLineAsVerticalRectangleWithOffset(t,e,i){const n=new a.PointF2D(t.Start.x+e.x,t.Start.y+e.y),s=new a.PointF2D(t.End.x+e.x,t.End.y+e.y),r=t.Width;let l=new o.RectangleF2D(n.x,n.y,r,s.y-n.y);l=this.applyScreenTransformationForRect(l),this.renderRectangle(l,i,t.styleId)}drawRectangle(t,e){const i=t.PositionAndShape;let n=new o.RectangleF2D(i.AbsolutePosition.x,i.AbsolutePosition.y,i.BorderRight,i.BorderBottom);n=this.applyScreenTransformationForRect(n),this.renderRectangle(n,e,t.style)}calculatePixelDistance(t){throw new Error("not implemented")}drawLabel(t,e){if(!this.isVisible(t.PositionAndShape))return[];const i=t.Label;if(""===i.text.trim())return[];const n=this.applyScreenTransformation(t.PositionAndShape.AbsolutePosition),s=this.calculatePixelDistance(i.fontHeight),r=this.calculatePixelDistance(t.PositionAndShape.Size.width),o=Math.ceil(r),a=Math.ceil(s*(.2+t.TextLines.length));switch(i.textAlignment){case c.TextAlignmentEnum.LeftTop:break;case c.TextAlignmentEnum.LeftCenter:n.y-=a/2;break;case c.TextAlignmentEnum.LeftBottom:n.y-=a;break;case c.TextAlignmentEnum.CenterTop:n.x-=o/2;break;case c.TextAlignmentEnum.CenterCenter:n.x-=o/2,n.y-=a/2;break;case c.TextAlignmentEnum.CenterBottom:n.x-=o/2,n.y-=a;break;case c.TextAlignmentEnum.RightTop:n.x-=o;break;case c.TextAlignmentEnum.RightCenter:n.x-=o,n.y-=a/2;break;case c.TextAlignmentEnum.RightBottom:n.x-=o,n.y-=a;break;default:throw new u.ArgumentOutOfRangeException("")}return this.renderLabel(t,e,o,a,s,n)}applyScreenTransformation(t){throw new Error("not implemented")}applyScreenTransformations(t){const e=[];for(const i of t)e.push(this.applyScreenTransformation(i));return e}applyScreenTransformationForRect(t){throw new Error("not implemented")}drawSplitScreenLine(){}renderRectangle(t,e,i,n,s=1){throw new Error("not implemented")}drawScrollIndicator(){}drawSelectionStartSymbol(t){}drawSelectionEndSymbol(t){}renderLabel(t,e,i,n,s,r){throw new Error("not implemented")}renderSystemToScreen(t,e,i){}drawMeasure(t){throw new Error("not implemented")}drawSkyLine(t){}drawBottomLine(t){}drawInstrumentBrace(t,e){}drawGroupBracket(t,e){}isVisible(t){return!0}drawMusicSystem(t){const e=this.getSystemAbsBoundingRect(t),i=this.getSytemBoundingBoxInPixels(e);this.drawMusicSystemComponents(t,i,e)}getSytemBoundingBoxInPixels(t){const e=this.applyScreenTransformationForRect(t);return e.x=Math.round(e.x),e.y=Math.round(e.y),e}getSystemAbsBoundingRect(t){const e=t.PositionAndShape.BoundingRectangle;return new o.RectangleF2D(t.PositionAndShape.AbsolutePosition.x+t.PositionAndShape.BorderLeft-1,t.PositionAndShape.AbsolutePosition.y+t.PositionAndShape.BorderTop-1,e.width+6,e.height+2)}drawMusicSystemComponents(t,e,i){const n=this.graphicalMusicSheet.SelectionStartSymbol,r=this.graphicalMusicSheet.SelectionEndSymbol;this.drawingParameters.drawSelectionStartSymbol&&void 0!==n&&this.isVisible(n.PositionAndShape)&&this.drawSelectionStartSymbol(n),this.drawingParameters.drawSelectionEndSymbol&&void 0!==r&&this.isVisible(r.PositionAndShape)&&this.drawSelectionEndSymbol(r);for(const s of t.StaffLines)this.drawStaffLine(s),this.rules.RenderLyrics&&(s.LyricsDashes.length>0&&this.drawDashes(s.LyricsDashes),s.LyricLines.length>0&&this.drawLyricLines(s.LyricLines,s));for(const s of t.SystemLines)this.drawSystemLineObject(s);if(t.Parent===t.Parent.Parent.MusicPages[0])for(const o of t.Labels)this.drawLabel(o,s.GraphicalLayers.Notes);for(const s of t.InstrumentBrackets)this.drawInstrumentBrace(s,t);for(const s of t.GroupBrackets)this.drawGroupBracket(s,t);if(!this.leadSheet)for(const o of t.MeasureNumberLabels)this.drawLabel(o,s.GraphicalLayers.Notes);for(const s of t.StaffLines)this.drawStaffLineSymbols(s);this.drawingParameters.drawMarkedAreas&&this.drawMarkedAreas(t),this.drawingParameters.drawComments&&this.drawComment(t)}activateSystemRendering(t,e,i,n){return!0}drawSystemLineObject(t){}drawStaffLine(t){for(const e of t.Measures)this.drawMeasure(e);this.rules.RenderLyrics&&t.LyricsDashes.length>0&&this.drawDashes(t.LyricsDashes),this.drawOctaveShifts(t),this.drawExpressions(t),this.skyLineVisible&&this.drawSkyLine(t),this.bottomLineVisible&&this.drawBottomLine(t)}drawLyricLines(t,e){e.LyricLines.forEach((t=>{t.Start.y+=e.PositionAndShape.AbsolutePosition.y,t.End.y+=e.PositionAndShape.AbsolutePosition.y,t.Start.x+=e.PositionAndShape.AbsolutePosition.x,t.End.x+=e.PositionAndShape.AbsolutePosition.x,this.drawGraphicalLine(t,this.rules.LyricUnderscoreLineWidth)}))}drawExpressions(t){}drawGraphicalLine(t,e,i="black"){return this.drawLine(t.Start,t.End,i,e)}drawLine(t,e,i="#FF0000FF",n){}drawDashes(t){t.forEach((t=>this.drawLabel(t,s.GraphicalLayers.Notes)))}drawOctaveShifts(t){}drawStaffLines(t){if(t.StaffLines){const e=t.PositionAndShape.AbsolutePosition;for(let i=0;i<5;i++)this.drawLineAsHorizontalRectangleWithOffset(t.StaffLines[i],e,s.GraphicalLayers.Notes)}}drawInstantaneousDynamic(t){throw new Error("not implemented")}drawContinuousDynamic(t){throw new Error("not implemented")}drawSymbol(t,e,i,n=1,r=s.GraphicalLayers.Notes){}get leadSheet(){return this.graphicalMusicSheet.LeadSheet}set leadSheet(t){this.graphicalMusicSheet.LeadSheet=t}drawPage(t){if(this.isVisible(t.PositionAndShape)){for(const e of t.MusicSystems)this.isVisible(e.PositionAndShape)&&this.drawMusicSystem(e);if(t===t.Parent.MusicPages[0])for(const e of t.Labels)this.drawLabel(e,s.GraphicalLayers.Notes);this.drawableBoundingBoxElement&&this.drawBoundingBoxes(t.PositionAndShape,0,this.drawableBoundingBoxElement)}}drawBoundingBoxes(t,e=0,i="all"){const n=t.DataObject.constructor.name;let s=!1;"all"===i?s=!0:"VexFlowStaffEntry"===i?s=t.DataObject instanceof m.VexFlowStaffEntry:"VexFlowMeasure"===i?s=t.DataObject instanceof m.VexFlowMeasure:"VexFlowGraphicalNote"===i?s=t.DataObject instanceof m.VexFlowGraphicalNote:"VexFlowVoiceEntry"===i?s=t.DataObject instanceof m.VexFlowVoiceEntry:"GraphicalLabel"===i?s=t.DataObject instanceof l.GraphicalLabel:"VexFlowStaffLine"===i?s=t.DataObject instanceof m.VexFlowStaffLine:"SystemLine"===i?s=t.DataObject instanceof d.SystemLine:"StaffLineActivitySymbol"===i?s=t.DataObject instanceof b.StaffLineActivitySymbol:"VexFlowContinuousDynamicExpression"===i&&(s=t.DataObject instanceof m.VexFlowContinuousDynamicExpression),(s||n===i)&&this.drawBoundingBox(t,void 0,!0,n,e),e++,t.ChildElements.forEach((t=>this.drawBoundingBoxes(t,e,i)))}drawBoundingBox(t,e,i=!1,n,u=0){let d=new o.RectangleF2D(t.AbsolutePosition.x+t.BorderMarginLeft,t.AbsolutePosition.y+t.BorderMarginTop,t.BorderMarginRight-t.BorderMarginLeft,t.BorderMarginBottom-t.BorderMarginTop);i&&(this.drawLineAsHorizontalRectangle(new r.GraphicalLine(new a.PointF2D(t.AbsolutePosition.x-1,t.AbsolutePosition.y),new a.PointF2D(t.AbsolutePosition.x+1,t.AbsolutePosition.y),.1,s.OutlineAndFillStyleEnum.BaseWritingColor,e),u-1),this.drawLineAsVerticalRectangle(new r.GraphicalLine(new a.PointF2D(t.AbsolutePosition.x,t.AbsolutePosition.y-1),new a.PointF2D(t.AbsolutePosition.x,t.AbsolutePosition.y+1),.1,s.OutlineAndFillStyleEnum.BaseWritingColor,e),u-1)),d=this.applyScreenTransformationForRect(d);const f=this.renderRectangle(d,s.GraphicalLayers.Background,u,e,.5);if(n){const t=new h.Label(n);this.renderLabel(new l.GraphicalLabel(t,.8,c.TextAlignmentEnum.CenterCenter,this.rules),u,d.width,d.height,d.height,new a.PointF2D(d.x,d.y+12))}return f}drawMarkedAreas(t){for(const e of t.GraphicalMarkedAreas)e&&(e.systemRectangle&&this.drawRectangle(e.systemRectangle,s.GraphicalLayers.Background),e.settings&&this.drawLabel(e.settings,s.GraphicalLayers.Comment),e.labelRectangle&&this.drawRectangle(e.labelRectangle,s.GraphicalLayers.Background),e.label&&this.drawLabel(e.label,s.GraphicalLayers.Comment))}drawComment(t){for(const e of t.GraphicalComments)e&&(e.settings&&this.drawLabel(e.settings,s.GraphicalLayers.Comment),e.label&&this.drawLabel(e.label,s.GraphicalLayers.Comment))}drawStaffLineSymbols(t){const e=t.ParentStaff.ParentInstrument,i=t.PositionAndShape.AbsolutePosition.x,n=t.PositionAndShape.AbsolutePosition.y+2,o=t.PositionAndShape.BorderRight;e.highlight&&this.drawingParameters.drawHighlights&&this.drawLineAsHorizontalRectangle(new r.GraphicalLine(new a.PointF2D(i,n),new a.PointF2D(i+o,n),4,s.OutlineAndFillStyleEnum.Highlighted),s.GraphicalLayers.Highlight);let l=p.MusicSymbolDrawingStyle.Disabled,h=f.MusicSymbol.PLAY,c=this.drawingParameters.drawActivitySymbols;switch(this.phonicScoreMode){case p.PhonicScoreModes.Midi:h=f.MusicSymbol.PLAY,this.midiPlaybackAvailable&&t.ParentStaff.audible&&(l=p.MusicSymbolDrawingStyle.PlaybackSymbols);break;case p.PhonicScoreModes.Following:h=f.MusicSymbol.MIC,t.ParentStaff.following&&(l=p.MusicSymbolDrawingStyle.FollowSymbols);break;default:c=!1}if(c){const t=new a.PointF2D(i+o+2,n);this.drawSymbol(h,l,t)}if(this.drawingParameters.drawErrors)for(const u of t.Measures){const t=u.PositionAndShape,e=t.AbsolutePosition.x,i=t.AbsolutePosition.y+2;u.hasError&&this.graphicalMusicSheet.ParentMusicSheet.DrawErroneousMeasures&&this.drawLineAsHorizontalRectangle(new r.GraphicalLine(new a.PointF2D(e,i),new a.PointF2D(e+t.BorderRight,i),4,s.OutlineAndFillStyleEnum.ErrorUnderlay),s.GraphicalLayers.MeasureError)}}}},function(t,e,i){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.PhonicScoreModes=e.MusicSymbolDrawingStyle=e.DrawingMode=void 0,(n=e.DrawingMode||(e.DrawingMode={}))[n.All=0]="All",n[n.NoOverlays=1]="NoOverlays",n[n.Leadsheet=2]="Leadsheet",function(t){t[t.Normal=0]="Normal",t[t.Disabled=1]="Disabled",t[t.Selected=2]="Selected",t[t.Clickable=3]="Clickable",t[t.PlaybackSymbols=4]="PlaybackSymbols",t[t.FollowSymbols=5]="FollowSymbols",t[t.QFeedbackNotFound=6]="QFeedbackNotFound",t[t.QFeedbackOk=7]="QFeedbackOk",t[t.QFeedbackPerfect=8]="QFeedbackPerfect",t[t.Debug1=9]="Debug1",t[t.Debug2=10]="Debug2",t[t.Debug3=11]="Debug3"}(e.MusicSymbolDrawingStyle||(e.MusicSymbolDrawingStyle={})),function(t){t[t.Following=0]="Following",t[t.Midi=1]="Midi",t[t.Manual=2]="Manual"}(e.PhonicScoreModes||(e.PhonicScoreModes={}))},function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(78),e),s(i(58),e),s(i(92),e),s(i(59),e),s(i(57),e),s(i(13),e),s(i(60),e),s(i(90),e),s(i(93),e),s(i(95),e),s(i(61),e),s(i(44),e),s(i(96),e),s(i(89),e),s(i(16),e),s(i(91),e),s(i(97),e),s(i(165),e),s(i(98),e),s(i(99),e),s(i(100),e),s(i(101),e),s(i(63),e),s(i(62),e)},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalMeasure=void 0;const n=i(6),s=i(0),r=i(5),o=i(4);class a extends n.GraphicalObject{constructor(t,e,i){super(),this.hasOnlyRests=!1,this.measureNumber=-1,this.parentStaff=t,this.parentSourceMeasure=e,this.parentStaffLine=i,i?(this.parentStaff=i.ParentStaff,this.PositionAndShape=new r.BoundingBox(this,i.PositionAndShape)):this.PositionAndShape=new r.BoundingBox(this),this.PositionAndShape.BorderBottom=4,this.parentSourceMeasure&&(this.measureNumber=this.parentSourceMeasure.MeasureNumber),this.staffEntries=[]}get ParentStaff(){return this.parentStaff}get ParentMusicSystem(){return this.parentMusicSystem}set ParentMusicSystem(t){this.parentMusicSystem=t}get MeasureNumber(){return this.measureNumber}get FirstInstructionStaffEntry(){return this.firstInstructionStaffEntry}set FirstInstructionStaffEntry(t){this.firstInstructionStaffEntry=t}get LastInstructionStaffEntry(){return this.lastInstructionStaffEntry}set LastInstructionStaffEntry(t){this.lastInstructionStaffEntry=t}get ParentStaffLine(){return this.parentStaffLine}set ParentStaffLine(t){this.parentStaffLine=t,this.parentStaffLine&&(this.PositionAndShape.Parent=this.parentStaffLine.PositionAndShape)}resetLayout(){throw new Error("not implemented")}getLineWidth(t){throw new Error("not implemented")}addClefAtBegin(t){throw new Error("not implemented")}addKeyAtBegin(t,e,i){throw new Error("not implemented")}addRhythmAtBegin(t){throw new Error("not implemented")}addClefAtEnd(t,e=!0){throw new Error("not implemented")}setPositionInStaffline(t){this.PositionAndShape.RelativePosition=new o.PointF2D(t,0)}setWidth(t){this.PositionAndShape.BorderRight=t}layoutSymbols(){throw new Error("not implemented")}findGraphicalStaffEntryFromTimestamp(t){var e;for(let i=0,n=this.staffEntries.length;i<n;++i){const n=this.staffEntries[i];if(null===(e=n.relInMeasureTimestamp)||void 0===e?void 0:e.Equals(t))return n}}findGraphicalStaffEntryFromVerticalContainerTimestamp(t){for(let e=0,i=this.staffEntries.length;e<i;++e){const i=this.staffEntries[e];if(i.sourceStaffEntry.VerticalContainerParent.getAbsoluteTimestamp().Equals(t))return i}}hasSameDurationWithSourceMeasureParent(){const t=new s.Fraction(0,1);for(let e=0,i=this.staffEntries.length;e<i;++e){const i=this.staffEntries[e];t.Add(i.findStaffEntryMinNoteLength())}return t.Equals(this.parentSourceMeasure.Duration)}hasMultipleVoices(){if(0===this.staffEntries.length)return!1;const t=[];for(let e=0,i=this.staffEntries.length;e<i;++e){const i=this.staffEntries[e];for(let e=0,n=i.sourceStaffEntry.VoiceEntries.length;e<n;++e){const n=i.sourceStaffEntry.VoiceEntries[e];t.indexOf(n.ParentVoice)<0&&t.push(n.ParentVoice)}}return t.length>1}isVisible(){return this.ParentStaff.ParentInstrument.Visible}getGraphicalMeasureDurationFromStaffEntries(){let t=new s.Fraction(0,1);const e=[];for(let i=0,n=this.staffEntries.length;i<n;++i){const t=this.staffEntries[i];for(let i=0,n=t.sourceStaffEntry.VoiceEntries.length;i<n;++i){const n=t.sourceStaffEntry.VoiceEntries[i];e.indexOf(n.ParentVoice)<0&&e.push(n.ParentVoice)}}for(let i=0,n=e.length;i<n;++i){const n=e[i],r=new s.Fraction(0,1);for(const t of this.staffEntries)for(const e of t.graphicalVoiceEntries)e.parentVoiceEntry.ParentVoice===n&&e.notes.length>0&&r.Add(e.notes[0].graphicalNoteLength);t.lt(r)&&(t=s.Fraction.createFromFraction(r))}return t}addGraphicalStaffEntry(t){this.staffEntries.push(t)}addGraphicalStaffEntryAtTimestamp(t){if(t)if(0===this.staffEntries.length||this.staffEntries[this.staffEntries.length-1].relInMeasureTimestamp.lt(t.relInMeasureTimestamp))this.staffEntries.push(t);else for(let e=this.staffEntries.length-1;e>=0;e--){if(this.staffEntries[e].relInMeasureTimestamp.lt(t.relInMeasureTimestamp)){this.staffEntries.splice(e+1,0,t);break}0===e&&this.staffEntries.splice(e,0,t)}}beginsWithLineRepetition(){const t=this.parentSourceMeasure;return!!t&&t.beginsWithLineRepetition()}endsWithLineRepetition(){const t=this.parentSourceMeasure;return!!t&&t.endsWithLineRepetition()}beginsWithWordRepetition(){const t=this.parentSourceMeasure;return!!t&&t.beginsWithWordRepetition()}endsWithWordRepetition(){const t=this.parentSourceMeasure;return!!t&&t.endsWithWordRepetition()}}e.GraphicalMeasure=a},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalOctaveShift=void 0;const n=i(6),s=i(30),r=i(5),o=i(77),a=i(11);class l extends n.GraphicalObject{constructor(t,e){super(),this.getOctaveShift=t,this.setSymbol(),this.PositionAndShape=new r.BoundingBox(this,e)}setSymbol(){switch(this.getOctaveShift.Type){case s.OctaveEnum.VA8:this.octaveSymbol=o.MusicSymbol.VA8;break;case s.OctaveEnum.VB8:this.octaveSymbol=o.MusicSymbol.VB8;break;case s.OctaveEnum.MA15:this.octaveSymbol=o.MusicSymbol.MA15;break;case s.OctaveEnum.MB15:this.octaveSymbol=o.MusicSymbol.MB15;break;default:throw new a.ArgumentOutOfRangeException("")}}}e.GraphicalOctaveShift=l},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalStaffEntry=void 0;const n=i(5),s=i(0),r=i(6),o=i(34),a=i(17);class l extends r.GraphicalObject{constructor(t,e,i){super(),this.graphicalChordContainers=[],this.tabStaffEntry=void 0,this.MaxAccidentals=0,this.graphicalInstructions=[],this.graphicalTies=[],this.lyricsEntries=[],this.parentMeasure=t,this.graphicalVoiceEntries=[],this.sourceStaffEntry=e,i?(this.staffEntryParent=i,this.parentVerticalContainer=i.parentVerticalContainer,this.PositionAndShape=new n.BoundingBox(this,i.PositionAndShape)):this.PositionAndShape=new n.BoundingBox(this,t.PositionAndShape),e&&(this.relInMeasureTimestamp=e.Timestamp)}get GraphicalInstructions(){return this.graphicalInstructions}get GraphicalTies(){return this.graphicalTies}get LyricsEntries(){return this.lyricsEntries}set LyricsEntries(t){this.lyricsEntries=t}getAbsoluteTimestamp(){const t=this.parentMeasure.parentSourceMeasure.AbsoluteTimestamp.clone();return this.relInMeasureTimestamp&&t.Add(this.relInMeasureTimestamp),t}findTieGraphicalNoteFromNote(t){for(const e of this.graphicalVoiceEntries)for(const i of e.notes){const e=i.sourceNote;if(!e.isRest()&&e.Pitch.FundamentalNote===t.Pitch.FundamentalNote&&e.Pitch.Octave===t.Pitch.Octave&&e.getAbsoluteTimestamp().Equals(t.getAbsoluteTimestamp()))return i}}findEndTieGraphicalNoteFromNoteWithStartingSlur(t,e){if(t)for(const i of this.graphicalVoiceEntries)if(i.parentVoiceEntry===t.ParentVoiceEntry)for(const t of i.notes){const i=t.sourceNote;if(i.NoteTie&&-1!==i.NoteSlurs.indexOf(e))return t}}findGraphicalNoteFromGraceNote(t){if(t)for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry===t.ParentVoiceEntry)for(const i of e.notes)if(i.sourceNote===t)return i}findGraphicalNoteFromNote(t){if(t)for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry===t.ParentVoiceEntry)for(const i of e.notes)if(i.sourceNote===t&&this.getAbsoluteTimestamp().Equals(t.getAbsoluteTimestamp()))return i}getGraphicalNoteDurationFromVoice(t){for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry.ParentVoice===t)return e.notes[0].graphicalNoteLength;return new s.Fraction(0,1)}findVoiceEntryGraphicalNotes(t){for(const e of this.graphicalVoiceEntries)if(e.parentVoiceEntry===t)return e.notes}isVoiceEntryPartOfLinkedVoiceEntry(t){if(this.sourceStaffEntry.Link)for(let e=0,i=this.sourceStaffEntry.Link.LinkStaffEntries.length;e<i;++e){const i=this.sourceStaffEntry.Link.LinkStaffEntries[e];if(-1!==i.VoiceEntries.indexOf(t)&&i!==this.sourceStaffEntry)return!0}return!1}findStaffEntryMinNoteLength(){let t=new s.Fraction(Number.MAX_VALUE,1);for(const e of this.graphicalVoiceEntries)for(const i of e.notes){const e=i.graphicalNoteLength;e.lt(t)&&e.GetExpandedNumerator()>0&&(t=e)}return t}findStaffEntryMaxNoteLength(){let t=new s.Fraction(0,1);for(const e of this.graphicalVoiceEntries)for(const i of e.notes){const e=i.graphicalNoteLength;t.lt(e)&&e.GetExpandedNumerator()>0&&(t=e)}return t}findOrCreateGraphicalVoiceEntry(t){for(const i of this.graphicalVoiceEntries)if(i.parentVoiceEntry===t)return i;const e=a.MusicSheetCalculator.symbolFactory.createVoiceEntry(t,this);return this.graphicalVoiceEntries.push(e),e}findOrCreateGraphicalVoiceEntryFromGraphicalNote(t){for(const i of this.graphicalVoiceEntries)if(i===t.parentVoiceEntry)return i;const e=a.MusicSheetCalculator.symbolFactory.createVoiceEntry(t.sourceNote.ParentVoiceEntry,this);return this.graphicalVoiceEntries.push(e),e}addGraphicalNoteToListAtCorrectYPosition(t,e){const i=t.notes;if(0===i.length||e.PositionAndShape.RelativePosition.y<o.CollectionUtil.last(i).PositionAndShape.RelativePosition.y)i.push(e);else for(let n=i.length-1;n>=0;n--){if(i[n].PositionAndShape.RelativePosition.y>e.PositionAndShape.RelativePosition.y){i.splice(n+1,0,e);break}if(0===n){i.splice(0,0,e);break}}}hasOnlyRests(){for(const t of this.graphicalVoiceEntries)for(const e of t.notes)if(!e.sourceNote.isRest())return!1;return!0}}e.GraphicalStaffEntry=l},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.StaffLine=void 0;const n=i(5),s=i(6),r=i(47),o=i(4),a=i(126);class l extends s.GraphicalObject{constructor(t,e){super(),this.measures=[],this.staffLines=new Array(5),this.octaveShifts=[],this.lyricLines=[],this.lyricsDashes=[],this.abstractExpressions=[],this.graphicalSlurs=[],this.parentMusicSystem=t,this.parentStaff=e,this.boundingBox=new n.BoundingBox(this,t.PositionAndShape),this.skyBottomLine=new a.SkyBottomLineCalculator(this),this.staffHeight=this.parentMusicSystem.rules.StaffHeight,this.topLineOffset=0,this.bottomLineOffset=4,this.calculateStaffLineOffsets()}calculateStaffLineOffsets(){if(this.ParentStaff.isTab)switch(this.ParentStaff.StafflineCount){case 5:this.staffHeight=this.bottomLineOffset=6*this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight;break;default:this.staffHeight=this.bottomLineOffset=this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight*this.ParentStaff.StafflineCount}else switch(this.ParentStaff.StafflineCount){case 4:this.bottomLineOffset=1;break;case 3:this.topLineOffset=1,this.bottomLineOffset=1;break;case 2:this.topLineOffset=2,this.bottomLineOffset=1;break;case 1:this.topLineOffset=2,this.bottomLineOffset=2}}get Measures(){return this.measures}set Measures(t){this.measures=t}get StaffLines(){return this.staffLines}set StaffLines(t){this.staffLines=t}get NextStaffLine(){const t=this.parentMusicSystem.StaffLines.indexOf(this);return t!==this.parentMusicSystem.StaffLines.length?this.parentMusicSystem.StaffLines[t+1]:void 0}get LyricLines(){return this.lyricLines}get AbstractExpressions(){return this.abstractExpressions}set AbstractExpressions(t){this.abstractExpressions=t}set LyricLines(t){this.lyricLines=t}get LyricsDashes(){return this.lyricsDashes}set LyricsDashes(t){this.lyricsDashes=t}get ParentMusicSystem(){return this.parentMusicSystem}set ParentMusicSystem(t){this.parentMusicSystem=t}get ParentStaff(){return this.parentStaff}set ParentStaff(t){this.parentStaff=t}get SkyBottomLineCalculator(){return this.skyBottomLine}get SkyLine(){return this.skyBottomLine.SkyLine}get BottomLine(){return this.skyBottomLine.BottomLine}get OctaveShifts(){return this.octaveShifts}set OctaveShifts(t){this.octaveShifts=t}get StaffHeight(){return this.staffHeight}get TopLineOffset(){return this.topLineOffset}get BottomLineOffset(){return this.bottomLineOffset}get GraphicalSlurs(){return this.graphicalSlurs}addSlurToStaffline(t){this.graphicalSlurs.push(t)}addActivitySymbolClickArea(){const t=new r.StaffLineActivitySymbol(this),e=this.PositionAndShape;t.PositionAndShape.RelativePosition=new o.PointF2D(e.RelativePosition.x+e.BorderRight+.5,e.RelativePosition.y+.5),t.PositionAndShape.Parent=this.parentMusicSystem.PositionAndShape}isPartOfMultiStaffInstrument(){return this.parentStaff.ParentInstrument.Staves.length>1}findClosestStaffEntry(t){let e;for(let i=0,n=this.Measures.length;i<n;++i){const n=this.Measures[i];for(let i=0,s=n.staffEntries.length;i<s;++i){const s=n.staffEntries[i];Math.abs(s.PositionAndShape.RelativePosition.x-t+n.PositionAndShape.RelativePosition.x)<5&&(e=s)}}return e}}e.StaffLine=l},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SkyBottomLineCalculator=void 0,i(4);const s=i(58),r=i(16),o=n(i(1));e.SkyBottomLineCalculator=class{constructor(t){this.mStaffLineParent=t,this.mRules=t.ParentMusicSystem.rules}calculateLines(){const t=Math.max(Math.ceil(this.StaffLineParent.PositionAndShape.Size.width*this.SamplingUnit),1);this.mSkyLine=[],this.mBottomLine=[];const e=new s.CanvasVexFlowBackend(this.StaffLineParent.ParentMusicSystem.rules);for(const s of this.StaffLineParent.Measures){s.PositionAndShape.calculateAbsolutePositionsRecursive(0,0);const t=s.getVFStave();let i=t.getWidth();i>0||(o.default.warn("SkyBottomLineCalculator: width not > 0 in measure "+s.MeasureNumber),i=50),e.initializeHeadless(i);const n=e.getContext(),r=e.getCanvas();i=r.width;const a=r.height;t.setY(t.y+100);const h=t.getWidth();t.setWidth(i),s.format(),t.setWidth(h);try{s.draw(n)}catch(l){o.default.warn("SkyBottomLineCalculator.calculateLines.draw",l)}const c=n.getImageData(0,0,i,a),u=4,d=Math.max(Math.ceil(s.PositionAndShape.Size.width*this.mRules.SamplingUnit),1),f=new Array(d),p=new Array(d);for(let e=0;e<i;e++){for(let t=0;t<a;t++){const n=t*i*u+e*u;if(c.data[n+3]>0){f[e]=t;break}}for(let t=a;t>0;t--){const n=t*i*u+e*u;if(c.data[n+3]>0){p[e]=t;break}}}for(let e=0;e<f.length;e++)void 0===f[e]&&(f[e]=Math.max(this.findPreviousValidNumber(e,f),this.findNextValidNumber(e,f)));this.mSkyLine.push(...f),this.mBottomLine.push(...p),e.clear()}const i=this.mSkyLine.length/t,n=[],a=[];for(let s=0;s<this.mSkyLine.length&&n.length!==t;s+=i){const t=Math.min(this.mSkyLine.length,s+i);let e=this.mSkyLine.slice(s,t+1);n.push(Math.min(...e)),e=this.mBottomLine.slice(s,t+1),a.push(Math.max(...e))}this.mSkyLine=n,this.mBottomLine=a,this.mSkyLine.length!==t&&o.default.debug(`SkyLine calculation was not correct (${this.mSkyLine.length} instead of ${t})`),this.mSkyLine=this.mSkyLine.map((t=>(t-Math.max(...this.mSkyLine))/r.unitInPixels+this.StaffLineParent.TopLineOffset)),this.mBottomLine=this.mBottomLine.map((t=>(t-Math.min(...this.mBottomLine))/r.unitInPixels+this.StaffLineParent.BottomLineOffset))}findPreviousValidNumber(t,e){for(let i=t;i>=0;i--)if(!isNaN(e[i]))return e[i];return 0}findNextValidNumber(t,e){if(t>=e.length)return e[t-1];for(let i=t;i<e.length;i++)if(!isNaN(e[i]))return e[i];return 0}drawPixel(t,e,i="#FF0000FF"){const n=e.getContext(),s=n.fillStyle;n.fillStyle=i,n.fillRect(t.x,t.y,2,2),n.fillStyle=s}updateSkyLineWithWedge(t,e){let i=Math.floor(t.x*this.SamplingUnit),n=Math.ceil(e.x*this.SamplingUnit),s=(e.y-t.y)/(e.x-t.x);n-i<=1&&(n++,s=0),i<0&&(i=0),i>=this.BottomLine.length&&(i=this.BottomLine.length-1),n<0&&(n=0),n>=this.BottomLine.length&&(n=this.BottomLine.length),this.SkyLine[i]=t.y;for(let r=i+1;r<Math.min(n,this.SkyLine.length);r++)this.SkyLine[r]=this.SkyLine[r-1]+s/this.SamplingUnit}updateBottomLineWithWedge(t,e){let i=Math.floor(t.x*this.SamplingUnit),n=Math.ceil(e.x*this.SamplingUnit),s=(e.y-t.y)/(e.x-t.x);n-i<=1&&(n++,s=0),i<0&&(i=0),i>=this.BottomLine.length&&(i=this.BottomLine.length-1),n<0&&(n=0),n>=this.BottomLine.length&&(n=this.BottomLine.length),this.BottomLine[i]=t.y;for(let r=i+1;r<n;r++)this.BottomLine[r]=this.BottomLine[r-1]+s/this.SamplingUnit}updateSkyLineInRange(t,e,i){this.updateInRange(this.mSkyLine,t,e,i)}updateBottomLineInRange(t,e,i){this.updateInRange(this.BottomLine,t,e,i)}resetSkyLineInRange(t,e){this.updateInRange(this.SkyLine,t,e)}resetBottomLineInRange(t,e){this.setInRange(this.BottomLine,t,e)}setSkyLineWithValue(t){this.SkyLine.forEach((e=>t))}setBottomLineWithValue(t){this.BottomLine.forEach((e=>t))}getLeftIndexForPointX(t,e){const i=Math.floor(t*this.SamplingUnit);return i<0?0:i>=e?e-1:i}getRightIndexForPointX(t,e){const i=Math.ceil(t*this.SamplingUnit);return i<0?0:i>=e?e-1:i}updateStaffLineBorders(){this.mStaffLineParent.PositionAndShape.BorderTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderMarginTop=this.getSkyLineMin(),this.mStaffLineParent.PositionAndShape.BorderBottom=this.getBottomLineMax(),this.mStaffLineParent.PositionAndShape.BorderMarginBottom=this.getBottomLineMax()}getSkyLineMin(){return Math.min(...this.SkyLine.filter((t=>!isNaN(t))))}getSkyLineMinAtPoint(t){const e=Math.round(t*this.SamplingUnit);return this.mSkyLine[e]}getSkyLineMinInRange(t,e){return this.getMinInRange(this.SkyLine,t,e)}getBottomLineMax(){return Math.max(...this.BottomLine.filter((t=>!isNaN(t))))}getBottomLineMaxAtPoint(t){const e=Math.round(t*this.SamplingUnit);return this.mBottomLine[e]}getBottomLineMaxInRange(t,e){return this.getMaxInRange(this.BottomLine,t,e)}getBottomLineMaxInBoundingBox(t){const e=Math.floor(t.AbsolutePosition.x+t.BorderLeft),i=Math.ceil(t.AbsolutePosition.x+t.BorderRight);return this.getMaxInRange(this.mBottomLine,e,i)}updateWithBoundingBoxRecursively(t){if(t.ChildElements&&t.ChildElements.length>0)this.updateWithBoundingBoxRecursively(t);else{const e=t.BorderTop+t.AbsolutePosition.y,i=t.BorderBottom+t.AbsolutePosition.y;if(e<0){const i=Math.floor(t.AbsolutePosition.x+t.BorderLeft),n=Math.ceil(t.AbsolutePosition.x+t.BorderRight);this.updateInRange(this.mSkyLine,i,n,e)}else if(i>this.StaffLineParent.StaffHeight){const e=Math.floor(t.AbsolutePosition.x+t.BorderLeft),n=Math.ceil(t.AbsolutePosition.x+t.BorderRight);this.updateInRange(this.mBottomLine,e,n,i)}}}updateInRange(t,e=0,i=t.length,n=0){if(e=Math.floor(e*this.SamplingUnit),(i=Math.ceil(i*this.SamplingUnit))<e)throw new Error("start index of line is greater than the end index");e<0&&(e=0),i>t.length&&(i=t.length);for(let s=e;s<i;s++)t[s]=Math.abs(n)>Math.abs(t[s])?n:t[s]}setInRange(t,e=0,i=t.length,n=0){if(e=Math.floor(e*this.SamplingUnit),(i=Math.ceil(i*this.SamplingUnit))<e)throw new Error("start index of line is greater then the end index");e<0&&(e=0),i>t.length&&(i=t.length);for(let s=e;s<i;s++)t[s]=n}getMinInRange(t,e,i){return e=Math.floor(e*this.SamplingUnit),i=Math.ceil(i*this.SamplingUnit),t?(e<0&&(e=0),e>=t.length&&(e=t.length-1),i<0&&(i=0),i>=t.length&&(i=t.length),e>=0&&i<=t.length?Math.min(...t.slice(e,i+1)):void 0):Number.MAX_VALUE}getMaxInRange(t,e,i){return e=Math.floor(e*this.SamplingUnit),i=Math.ceil(i*this.SamplingUnit),t?(e<0&&(e=0),e>=t.length&&(e=t.length-1),i<0&&(i=0),i>=t.length&&(i=t.length),e>=0&&i<=t.length?Math.max(...t.slice(e,i+1)):void 0):Number.MIN_VALUE}get SamplingUnit(){return this.mRules.SamplingUnit}get StaffLineParent(){return this.mStaffLineParent}get SkyLine(){return this.mSkyLine}get BottomLine(){return this.mBottomLine}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalChordSymbolContainer=void 0;const n=i(12),s=i(24),r=i(48),o=i(5),a=i(6),l=i(4);class h extends a.GraphicalObject{constructor(t,e,i,n,s,r){super(),this.chordSymbolContainer=t,this.boundingBox=new o.BoundingBox(this,e),this.rules=r,this.calculateLabel(i,s,n)}get GetChordSymbolContainer(){return this.chordSymbolContainer}get GraphicalLabel(){return this.graphicalLabel}calculateLabel(t,e,i){const o=r.ChordSymbolContainer.calculateChordText(this.chordSymbolContainer,e,i);this.graphicalLabel=new s.GraphicalLabel(new n.Label(o),t,this.rules.ChordSymbolTextAlignment,this.rules,this.boundingBox),this.graphicalLabel.PositionAndShape.RelativePosition=new l.PointF2D(this.rules.ChordSymbolRelativeXOffset,0)}}e.GraphicalChordSymbolContainer=h},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalTie=void 0,e.GraphicalTie=class{constructor(t,e,i){this.tie=t,this.startNote=e,this.endNote=i}get GetTie(){return this.tie}get StartNote(){return this.startNote}get Tie(){return this.tie}set StartNote(t){this.startNote=t}get EndNote(){return this.endNote}set EndNote(t){this.endNote=t}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalLyricEntry=void 0;const n=i(24),s=i(12),r=i(4),o=i(9);e.GraphicalLyricEntry=class{constructor(t,e,i,a){this.lyricsEntry=t,this.graphicalStaffEntry=e;const l=e.parentMeasure.parentSourceMeasure.Rules.LyricsAlignmentStandard;t.Text.length>=4&&t.Parent.Notes[0].Length.Denominator>4&&o.TextAlignmentEnum.LeftBottom;const h=new s.Label(t.Text);this.graphicalLabel=new n.GraphicalLabel(h,i,l,this.graphicalStaffEntry.parentMeasure.parentSourceMeasure.Rules,e.PositionAndShape),this.graphicalLabel.PositionAndShape.RelativePosition=new r.PointF2D(0,a),l===o.TextAlignmentEnum.LeftBottom&&(this.graphicalLabel.PositionAndShape.RelativePosition.x-=1)}get LyricsEntry(){return this.lyricsEntry}get ParentLyricWord(){return this.graphicalLyricWord}set ParentLyricWord(t){this.graphicalLyricWord=t}get GraphicalLabel(){return this.graphicalLabel}set GraphicalLabel(t){this.graphicalLabel=t}get StaffEntryParent(){return this.graphicalStaffEntry}set StaffEntryParent(t){this.graphicalStaffEntry=t}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalLyricWord=void 0,e.GraphicalLyricWord=class{constructor(t){this.graphicalLyricsEntries=[],this.lyricWord=t,this.initialize()}get GetLyricWord(){return this.lyricWord}get GraphicalLyricsEntries(){return this.graphicalLyricsEntries}set GraphicalLyricsEntries(t){this.graphicalLyricsEntries=t}isFilled(){for(let t=0;t<this.graphicalLyricsEntries.length;t++)if(!this.graphicalLyricsEntries[t])return!1;return!0}initialize(){for(let t=0;t<this.lyricWord.Syllables.length;t++)this.graphicalLyricsEntries.push(void 0)}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalSlur=void 0;const n=i(4),s=i(132),r=i(3),o=i(133),a=i(41),l=i(0),h=i(14);class c extends s.GraphicalCurve{constructor(t,e){super(),this.staffEntries=[],this.slur=t,this.rules=e}static Compare(t,e){if(t.staffEntries.length<1)return-1;if(e.staffEntries.length<1)return 1;const i=l.Fraction.minus(t.staffEntries[t.staffEntries.length-1].getAbsoluteTimestamp(),t.staffEntries[0].getAbsoluteTimestamp()),n=l.Fraction.minus(e.staffEntries[e.staffEntries.length-1].getAbsoluteTimestamp(),e.staffEntries[0].getAbsoluteTimestamp());return i.RealValue>n.RealValue?1:n.RealValue>i.RealValue?-1:0}calculateCurve(t){const e=this.staffEntries[0],i=this.staffEntries[this.staffEntries.length-1];let s=e.findGraphicalNoteFromNote(this.slur.StartNote);!s&&this.graceStart&&(s=e.findGraphicalNoteFromGraceNote(this.slur.StartNote)),s||(s=e.findEndTieGraphicalNoteFromNoteWithStartingSlur(this.slur.StartNote,this.slur));let a=i.findGraphicalNoteFromNote(this.slur.EndNote);!a&&this.graceEnd&&(a=i.findGraphicalNoteFromGraceNote(this.slur.EndNote));const l=e.parentMeasure.ParentStaffLine,h=l.SkyBottomLineCalculator;this.calculatePlacement(h,l);const c=this.calculateStartAndEnd(s,a,l,t,h),u=c.startX,d=c.endX;let f=c.startY,p=c.endY;const m=t.SlurTangentMinAngle,b=t.SlurTangentMaxAngle;let g;if(this.placement===r.PlacementEnum.Above){f-=t.SlurNoteHeadYOffset,p-=t.SlurNoteHeadYOffset;const e=new n.PointF2D(this.staffEntries[0].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[0].PositionAndShape.RelativePosition.x,f);s?e.x+=this.staffEntries[0].PositionAndShape.BorderRight:e.x=this.staffEntries[0].parentMeasure.beginInstructionsWidth,this.graceStart&&(e.x+=i.PositionAndShape.RelativePosition.x);const r=new n.PointF2D(this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].PositionAndShape.RelativePosition.x,p);if(a?r.x+=this.staffEntries[this.staffEntries.length-1].PositionAndShape.BorderLeft:r.x=this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.Size.width,this.graceEnd&&(r.x+=i.staffEntryParent.PositionAndShape.RelativePosition.x),g=this.calculateTopPoints(e,r,l,h),0===g.length){const t=new n.PointF2D((r.x-e.x)/2+e.x,(r.y-e.y)/2+e.y);g.push(t)}const c=Math.atan((p-f)/(d-u)),y=new n.PointF2D(0,0);let S=new n.PointF2D(d-u,-(p-f));const v=o.Matrix2D.getRotationMatrix(c),x=v.getTransposeMatrix();S=v.vectorMultiplication(S);const E=this.calculateTranslatedAndRotatedPointListAbove(g,u,f,v),_=this.calculateMaxLeftSlope(E,y,S),w=this.calculateMaxRightSlope(E,y,S),T=y.y-y.x*_,M=S.y-S.x*w,P=new n.PointF2D;let L=!1;Math.abs(Math.abs(_)-Math.abs(w))<1e-4?(P.x=S.x/2,P.y=0,L=!0):(P.x=(M-T)/(_-w),P.y=_*P.x+T);const A=this.calculateHeightWidthRatio(S.x,E),C=0,I=0;let R=m,N=-m;if(!L){const t=this.calculateAngles(m,_,w,b);R=t.startAngle,N=t.endAngle}const F=this.calculateControlPoints(S.x,R,N,E,A);let B=F.startControlPoint,O=F.endControlPoint;B=x.vectorMultiplication(B),B.x+=u,B.y=-B.y+f,O=x.vectorMultiplication(O),O.x+=u,O.y=-O.y+f,this.bezierStartPt=new n.PointF2D(u,f-C),this.bezierStartControlPt=new n.PointF2D(B.x,B.y-C),this.bezierEndControlPt=new n.PointF2D(O.x,O.y-I),this.bezierEndPt=new n.PointF2D(d,p-I);const D=l.SkyLine.length,k=h.getLeftIndexForPointX(this.bezierStartPt.x,D),V=h.getLeftIndexForPointX(this.bezierEndPt.x,D),G=this.bezierEndPt.x-this.bezierStartPt.x,W=h.SamplingUnit;for(let t=k;t<V;t++){const e=t/W-this.bezierStartPt.x,i=this.calculateCurvePointAtIndex(Math.abs(e)/G);let n=h.getLeftIndexForPointX(i.x,D);n>=k&&(l.SkyLine[n]=Math.min(l.SkyLine[n],i.y)),n++,n<D&&(l.SkyLine[n]=Math.min(l.SkyLine[n],i.y))}}else{f+=t.SlurNoteHeadYOffset,p+=t.SlurNoteHeadYOffset;const e=new n.PointF2D(this.staffEntries[0].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[0].PositionAndShape.RelativePosition.x,f);s?e.x+=this.staffEntries[0].PositionAndShape.BorderRight:e.x=this.staffEntries[0].parentMeasure.beginInstructionsWidth,this.graceStart&&(e.x+=i.PositionAndShape.RelativePosition.x);const r=new n.PointF2D(this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].PositionAndShape.RelativePosition.x,p);if(a?r.x+=this.staffEntries[this.staffEntries.length-1].PositionAndShape.BorderLeft:r.x=this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.Size.width,this.graceEnd&&(r.x+=i.staffEntryParent.PositionAndShape.RelativePosition.x),g=this.calculateBottomPoints(e,r,l,h),0===g.length){const t=new n.PointF2D((r.x-e.x)/2+e.x,(r.y-e.y)/2+e.y);g.push(t)}const c=Math.atan((p-f)/(d-u)),y=new n.PointF2D(0,0);let S=new n.PointF2D(d-u,p-f);const v=o.Matrix2D.getRotationMatrix(-c),x=v.getTransposeMatrix();S=v.vectorMultiplication(S);const E=this.calculateTranslatedAndRotatedPointListBelow(g,u,f,v),_=this.calculateMaxLeftSlope(E,y,S),w=this.calculateMaxRightSlope(E,y,S),T=y.y-y.x*_,M=S.y-S.x*w,P=new n.PointF2D;let L=!1;Math.abs(Math.abs(_)-Math.abs(w))<1e-4?(P.x=S.x/2,P.y=0,L=!0):(P.x=(M-T)/(_-w),P.y=_*P.x+T);const A=this.calculateHeightWidthRatio(S.x,E),C=0,I=0;let R=m,N=-m;if(!L){const t=this.calculateAngles(m,_,w,b);R=t.startAngle,N=t.endAngle}const F=this.calculateControlPoints(S.x,R,N,E,A);let B=F.startControlPoint,O=F.endControlPoint;B=x.vectorMultiplication(B),B.x+=u,B.y+=f,O=x.vectorMultiplication(O),O.x+=u,O.y+=f,this.bezierStartPt=new n.PointF2D(u,f+C),this.bezierStartControlPt=new n.PointF2D(B.x,B.y+C),this.bezierEndControlPt=new n.PointF2D(O.x,O.y+I),this.bezierEndPt=new n.PointF2D(d,p+I);const D=l.BottomLine.length,k=h.getLeftIndexForPointX(this.bezierStartPt.x,D),V=h.getLeftIndexForPointX(this.bezierEndPt.x,D),G=this.bezierEndPt.x-this.bezierStartPt.x,W=h.SamplingUnit;for(let t=k;t<V;t++){const e=t/W-this.bezierStartPt.x,i=this.calculateCurvePointAtIndex(Math.abs(e)/G);let n=h.getLeftIndexForPointX(i.x,D);n>=k&&(l.BottomLine[n]=Math.max(l.BottomLine[n],i.y)),n++,n<D&&(l.BottomLine[n]=Math.max(l.BottomLine[n],i.y))}}}calculateStartAndEnd(t,e,i,n,s){let o=0,a=0,l=0,c=0;if(t){o=t.PositionAndShape.RelativePosition.x+t.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+t.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x,this.graceStart&&(o+=t.parentVoiceEntry.parentStaffEntry.staffEntryParent.PositionAndShape.RelativePosition.x);const e=t.parentVoiceEntry;a=this.placement===r.PlacementEnum.Above?e.PositionAndShape.RelativePosition.y+e.PositionAndShape.BorderTop:e.PositionAndShape.RelativePosition.y+e.PositionAndShape.BorderBottom,e.parentVoiceEntry.StemDirection===h.StemDirectionType.Down&&this.placement===r.PlacementEnum.Below&&(o-=.5),e.parentVoiceEntry.StemDirection===h.StemDirectionType.Up&&this.placement===r.PlacementEnum.Above&&(o+=.5)}else o=i.Measures[0].beginInstructionsWidth;if(e){l=e.PositionAndShape.RelativePosition.x+e.parentVoiceEntry.parentStaffEntry.PositionAndShape.RelativePosition.x+e.parentVoiceEntry.parentStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x,this.graceEnd&&(l+=e.parentVoiceEntry.parentStaffEntry.staffEntryParent.PositionAndShape.RelativePosition.x);const t=e.parentVoiceEntry;c=this.placement===r.PlacementEnum.Above?t.PositionAndShape.RelativePosition.y+t.PositionAndShape.BorderTop:t.PositionAndShape.RelativePosition.y+t.PositionAndShape.BorderBottom,t.parentVoiceEntry.StemDirection===h.StemDirectionType.Down&&this.placement===r.PlacementEnum.Below&&(l-=.5),t.parentVoiceEntry.StemDirection===h.StemDirectionType.Up&&this.placement===r.PlacementEnum.Above&&(l+=.5)}else l=i.PositionAndShape.Size.width;return t||e||(a=0,c=0),t||(a=c),e||(c=a),this.slur.startNoteHasMoreStartingSlurs()&&this.slur.isSlurLonger()&&(this.placement===r.PlacementEnum.Above?a-=n.SlursStartingAtSameStaffEntryYOffset:a+=n.SlursStartingAtSameStaffEntryYOffset),this.slur.endNoteHasMoreEndingSlurs()&&this.slur.isSlurLonger()&&(this.placement===r.PlacementEnum.Above?c-=n.SlursStartingAtSameStaffEntryYOffset:c+=n.SlursStartingAtSameStaffEntryYOffset),this.placement===r.PlacementEnum.Above?(a=Math.min(a,1.5),c=Math.min(c,1.5)):(a=Math.max(a,i.StaffHeight-1.5),c=Math.max(c,i.StaffHeight-1.5)),{startX:o,startY:a,endX:l,endY:c}}calculatePlacement(t,e){if(this.rules.SlurPlacementFromXML)return void(this.placement=this.slur.PlacementXml);for(let o=0,l=this.staffEntries.length;o<l;++o)if(this.staffEntries[o].parentMeasure.hasMultipleVoices())return void(this.slur.StartNote.ParentVoiceEntry.ParentVoice instanceof a.LinkedVoice||this.slur.EndNote.ParentVoiceEntry.ParentVoice instanceof a.LinkedVoice?this.placement=r.PlacementEnum.Below:this.placement=r.PlacementEnum.Above);for(let o=0,a=this.staffEntries.length;o<a;++o)if(this.staffEntries[o].LyricsEntries.length>0)return void(this.placement=r.PlacementEnum.Above);const i=this.staffEntries[0],n=this.staffEntries[this.staffEntries.length-1],s=i.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection;if(s===n.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection)this.placement=s===h.StemDirectionType.Up?r.PlacementEnum.Below:r.PlacementEnum.Above;else{let s=i.PositionAndShape.BorderLeft+i.PositionAndShape.RelativePosition.x+i.parentMeasure.PositionAndShape.RelativePosition.x,o=n.PositionAndShape.BorderRight+n.PositionAndShape.RelativePosition.x+n.parentMeasure.PositionAndShape.RelativePosition.x;this.graceStart&&(s+=n.PositionAndShape.RelativePosition.x),this.graceEnd&&(o+=n.staffEntryParent.PositionAndShape.RelativePosition.x);const a=-1*t.getSkyLineMinInRange(s,o),l=t.getBottomLineMaxInRange(s,o)-e.StaffHeight;this.placement=l>a?r.PlacementEnum.Above:r.PlacementEnum.Below}}calculateTopPoints(t,e,i,s){const r=[];let o=s.getRightIndexForPointX(t.x,i.SkyLine.length),a=s.getLeftIndexForPointX(e.x,i.SkyLine.length);o<0&&(o=0),a>=i.SkyLine.length&&(a=i.SkyLine.length-1);for(let l=o;l<a;l++){const t=i.SkyLine[l];if(0!==t){const e=new n.PointF2D((.5+l)/s.SamplingUnit,t);r.push(e)}}return r}calculateBottomPoints(t,e,i,s){const r=[];let o=s.getRightIndexForPointX(t.x,i.BottomLine.length),a=s.getLeftIndexForPointX(e.x,i.BottomLine.length);o<0&&(o=0),a>=i.BottomLine.length&&(a=i.BottomLine.length-1);for(let l=o;l<a;l++){const t=i.BottomLine[l];if(0!==t){const e=new n.PointF2D((.5+l)/s.SamplingUnit,t);r.push(e)}}return r}calculateMaxLeftSlope(t,e,i){let n=-Number.MAX_VALUE;const s=e.x,r=e.y;for(let o=0;o<t.length;o++)Math.abs(t[o].y-Number.MAX_VALUE)<1e-4||Math.abs(t[o].y- -Number.MAX_VALUE)<1e-4||(n=Math.max(n,(t[o].y-r)/(t[o].x-s)));return n=Math.max(n,Math.abs(i.y-r)/(i.x-s)),n=Math.min(n,5.6713),n}calculateMaxRightSlope(t,e,i){let n=Number.MAX_VALUE;const s=i.x,r=i.y;for(let o=0;o<t.length;o++)Math.abs(t[o].y-Number.MAX_VALUE)<1e-4||Math.abs(t[o].y- -Number.MAX_VALUE)<1e-4||(n=Math.min(n,(r-t[o].y)/(s-t[o].x)));return n=Math.min(n,(r-e.y)/(s-e.x)),n=Math.max(n,-5.6713),n}getPointListMaxY(t){let e=-Number.MAX_VALUE;for(let i=0,n=t.length;i<n;++i){const n=t[i];Math.abs(n.y- -Number.MAX_VALUE)<1e-4||Math.abs(n.y-Number.MAX_VALUE)<1e-4||(e=Math.max(e,n.y))}return e}calculateTranslatedAndRotatedPointListAbove(t,e,i,s){const r=[];for(let o=0;o<t.length;o++){if(Math.abs(t[o].y-Number.MAX_VALUE)<1e-4||Math.abs(t[o].y- -Number.MAX_VALUE)<1e-4)continue;let a=new n.PointF2D(t[o].x-e,-(t[o].y-i));a=s.vectorMultiplication(a),r.push(a)}return r}calculateTranslatedAndRotatedPointListBelow(t,e,i,s){const r=[];for(let o=0;o<t.length;o++){if(Math.abs(t[o].y-Number.MAX_VALUE)<1e-4||Math.abs(t[o].y- -Number.MAX_VALUE)<1e-4)continue;let a=new n.PointF2D(t[o].x-e,t[o].y-i);a=s.vectorMultiplication(a),r.push(a)}return r}calculateHeightWidthRatio(t,e){return 0===e.length?0:Math.max(0,this.getPointListMaxY(e))/t}calculateControlPoints(t,e,i,s,r){let o=this.rules.SlurHeightFactor,a=1;const l=this.rules.SlurHeightFlattenLongSlursCutoffAngle,h=this.rules.SlurHeightFlattenLongSlursCutoffWidth;e>l&&t>h&&(a+=t/70*this.rules.SlurHeightFlattenLongSlursFactorByWidth,a*=1+e/30*this.rules.SlurHeightFlattenLongSlursFactorByAngle,o/=a);const u=Math.min(.5,Math.max(.1,1.7*e/80*o*Math.pow(Math.max(r,.05),.4))),d=Math.min(.5,Math.max(.1,1.7*-i/80*o*Math.pow(Math.max(r,.05),.4))),f=new n.PointF2D;f.x=t*u*Math.cos(e*c.degreesToRadiansFactor),f.y=t*u*Math.sin(e*c.degreesToRadiansFactor);const p=new n.PointF2D;return p.x=t-t*d*Math.cos(i*c.degreesToRadiansFactor),p.y=-t*d*Math.sin(i*c.degreesToRadiansFactor),{startControlPoint:f,endControlPoint:p}}calculateAngles(t,e,i,n){let s=Math.atan(e)/c.degreesToRadiansFactor;e>0?s+=20:s-=20;let r=Math.atan(i)/c.degreesToRadiansFactor;return i<0?r-=20:r+=20,{startAngle:Math.min(Math.max(t,s),n),endAngle:Math.max(Math.min(-t,r),-n)}}}e.GraphicalSlur=c,c.degreesToRadiansFactor=Math.PI/180},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalCurve=void 0;const n=i(4);class s{constructor(){s.tPow3=new Array(s.bezierCurveStepSize),s.oneMinusTPow3=new Array(s.bezierCurveStepSize),s.bezierFactorOne=new Array(s.bezierCurveStepSize),s.bezierFactorTwo=new Array(s.bezierCurveStepSize);for(let t=0;t<s.bezierCurveStepSize;t++){const e=t/s.bezierCurveStepSize;s.tPow3[t]=Math.pow(e,3),s.oneMinusTPow3[t]=Math.pow(1-e,3),s.bezierFactorOne[t]=3*Math.pow(1-e,2)*e,s.bezierFactorTwo[t]=3*(1-e)*Math.pow(e,2)}}calculateCurvePointAtIndex(t){const e=Math.round(t*s.bezierCurveStepSize);return e<0||e>=s.bezierCurveStepSize?new n.PointF2D:new n.PointF2D(s.oneMinusTPow3[e]*this.bezierStartPt.x+s.bezierFactorOne[e]*this.bezierStartControlPt.x+s.bezierFactorTwo[e]*this.bezierEndControlPt.x+s.tPow3[e]*this.bezierEndPt.x,s.oneMinusTPow3[e]*this.bezierStartPt.y+s.bezierFactorOne[e]*this.bezierStartControlPt.y+s.bezierFactorTwo[e]*this.bezierEndControlPt.y+s.tPow3[e]*this.bezierEndPt.y)}}e.GraphicalCurve=s,s.bezierCurveStepSize=1e3},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.Matrix2D=void 0;const n=i(4);class s{constructor(){this.matrix=[];for(let t=0;t<2;t++){this.matrix[t]=[];for(let e=0;e<2;e++)this.matrix[t][e]=0}}static getRotationMatrix(t){const e=new s,i=Math.cos(t),n=Math.sin(t);return e.matrix[0][0]=i,e.matrix[0][1]=-n,e.matrix[1][0]=n,e.matrix[1][1]=i,e}scalarMultiplication(t){for(let e=0;e<2;e++)for(let i=0;i<2;i++)this.matrix[e][i]*=t}getTransposeMatrix(){const t=new s;for(let e=0;e<2;e++)for(let i=0;i<2;i++)t.matrix[e][i]=this.matrix[i][e];return t}vectorMultiplication(t){const e=new n.PointF2D;return e.x=t.x*this.matrix[0][0]+t.y*this.matrix[0][1],e.y=t.x*this.matrix[1][0]+t.y*this.matrix[1][1],e}}e.Matrix2D=s},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSheetReader=void 0;const s=i(135),r=i(106),o=i(0),a=i(139),l=i(73),h=i(20),c=i(11),u=n(i(1)),d=i(19),f=i(19),p=i(31),m=i(74),b=i(150),g=i(7),y=i(12),S=i(151),v=i(26),x=i(154);class E{constructor(t,e=new v.EngravingRules){this.completeNumberOfStaves=0,this.pluginManager=new x.ReaderPluginManager,this.afterSheetReadingModules=t||[],this.repetitionInstructionReader=S.MusicSymbolModuleFactory.createRepetitionInstructionReader(),this.repetitionCalculator=S.MusicSymbolModuleFactory.createRepetitionCalculator(),this.rules=e}get PluginManager(){return this.pluginManager}get CompleteNumberOfStaves(){return this.completeNumberOfStaves}static doCalculationsAfterDurationHasBeenSet(t){for(const e of t)e.doCalculationsAfterDurationHasBeenSet()}createMusicSheet(t,e){try{return this._createMusicSheet(t,e)}catch(i){return void u.default.error("MusicSheetReader.CreateMusicSheet",i)}}_removeFromArray(t,e){const i=t.indexOf(e);-1!==i&&t.splice(i,1)}trimString(t){return t.replace(/^\s+|\s+$/g,"")}_lastElement(t){return t[t.length-1]}_createMusicSheet(t,e){const i=[];let n=0;if(this.musicSheet=new s.MusicSheet,this.musicSheet.Path=e,this.musicSheet.Rules=this.rules,!t)throw new c.MusicSheetReadingException("Undefined root element");this.pushSheetLabels(t,e);const a=t.element("part-list");if(!a)throw new c.MusicSheetReadingException("Undefined partListNode");const l=t.elements("part"),u=a.elements();this.initializeReading(u,l,i);let d=!0;this.currentFraction=new o.Fraction(0,1);let f=!1,p=t.element("identification");for(p&&(p=p.element("encoding")),p&&(p=p.element("software")),void 0!==p&&"Guitar Pro 5"===p.value&&(f=!0);d;){void 0!==this.currentMeasure&&this.currentMeasure.HasEndLine&&this.rules.NewPartAndSystemAfterFinalBarline&&(n=0),this.currentMeasure=new r.SourceMeasure(this.completeNumberOfStaves,this.musicSheet.Rules);for(const t of i)try{d=d&&t.readNextXmlMeasure(this.currentMeasure,this.currentFraction,f)}catch(m){const t=h.ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading instruments.");throw new c.MusicSheetReadingException(t,m)}d&&(this.musicSheet.addMeasure(this.currentMeasure),this.checkIfRhythmInstructionsAreSetAndEqual(i),this.checkSourceMeasureForNullEntries(),n=this.setSourceMeasureDuration(i,n),E.doCalculationsAfterDurationHasBeenSet(i),this.currentMeasure.AbsoluteTimestamp=this.currentFraction.clone(),this.musicSheet.SheetErrors.finalizeMeasure(this.currentMeasure.MeasureNumber),this.currentFraction.Add(this.currentMeasure.Duration),this.previousMeasure=this.currentMeasure)}this.repetitionInstructionReader&&(this.repetitionInstructionReader.removeRedundantInstructions(),this.repetitionCalculator&&this.repetitionCalculator.calculateRepetitions(this.musicSheet,this.repetitionInstructionReader.repetitionInstructions)),this.musicSheet.checkForInstrumentWithNoVoice(),this.musicSheet.fillStaffList();for(let s=0,r=this.afterSheetReadingModules.length;s<r;++s)this.afterSheetReadingModules[s].calculate(this.musicSheet);return this.musicSheet.userStartTempoInBPM=this.musicSheet.userStartTempoInBPM||this.musicSheet.DefaultStartTempoInBpm,this.musicSheet}initializeReading(t,e,i){const n=this.createInstrumentGroups(t);this.completeNumberOfStaves=this.getCompleteNumberOfStavesFromXml(e),0!==e.length&&(this.repetitionInstructionReader.MusicSheet=this.musicSheet,this.currentFraction=new o.Fraction(0,1),this.currentMeasure=void 0,this.previousMeasure=void 0);let s=0;for(const o of e){const t=o.attribute("id");if(t){const e=n[t.value],l=o.elements("measure");let c=1;try{c=this.getInstrumentNumberOfStavesFromXml(o)}catch(r){const t=h.ITextTranslation.translateText("ReaderErrorMessages/InstrumentStavesNumberError","Invalid number of staves at instrument: ");this.musicSheet.SheetErrors.push(t+e.Name);continue}e.createStaves(c),i.push(new a.InstrumentReader(this.pluginManager,this.repetitionInstructionReader,l,e)),this.repetitionInstructionReader&&(this.repetitionInstructionReader.xmlMeasureList[s]=l),s++}}}checkIfRhythmInstructionsAreSetAndEqual(t){const e=[];for(let s=0;s<this.completeNumberOfStaves;s++)if(this.currentMeasure.FirstInstructionsStaffEntries[s]){const t=this.currentMeasure.FirstInstructionsStaffEntries[s].Instructions[this.currentMeasure.FirstInstructionsStaffEntries[s].Instructions.length-1];t instanceof d.RhythmInstruction&&e.push(t)}let i=0,n=-1;for(let s=0,r=e.length;s<r;++s){const t=e[s];if(t.Rhythm.RealValue>i){if(this.areRhythmInstructionsMixed(e)&&t.SymbolEnum!==f.RhythmSymbolEnum.NONE)continue;i=t.Rhythm.RealValue,n=e.indexOf(t)}}if(e.length>0&&e.length<this.completeNumberOfStaves){const i=e[n].clone();for(let t=0;t<this.completeNumberOfStaves;t++)void 0===this.currentMeasure.FirstInstructionsStaffEntries[t]||this._lastElement(this.currentMeasure.FirstInstructionsStaffEntries[t].Instructions)instanceof d.RhythmInstruction||(this.currentMeasure.FirstInstructionsStaffEntries[t].removeAllInstructionsOfTypeRhythmInstruction(),this.currentMeasure.FirstInstructionsStaffEntries[t].Instructions.push(i.clone())),this.currentMeasure.FirstInstructionsStaffEntries[t]||(this.currentMeasure.FirstInstructionsStaffEntries[t]=new p.SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[t].Instructions.push(i.clone()));for(let e=0,n=t.length;e<n;++e)t[e].ActiveRhythm=i}if(0===e.length&&this.currentMeasure===this.musicSheet.SourceMeasures[0]){const e=new d.RhythmInstruction(new o.Fraction(4,4,0,!1),f.RhythmSymbolEnum.NONE);for(let t=0;t<this.completeNumberOfStaves;t++)this.currentMeasure.FirstInstructionsStaffEntries[t]?this.currentMeasure.FirstInstructionsStaffEntries[t].removeAllInstructionsOfTypeRhythmInstruction():this.currentMeasure.FirstInstructionsStaffEntries[t]=new p.SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[t].Instructions.push(e);for(let i=0,n=t.length;i<n;++i)t[i].ActiveRhythm=e}for(let s=0,r=e.length;s<r;++s){const t=e[s];if(t.Rhythm.RealValue<i&&this._lastElement(this.currentMeasure.FirstInstructionsStaffEntries[e.indexOf(t)].Instructions)instanceof d.RhythmInstruction){const i=this.currentMeasure.FirstInstructionsStaffEntries[e.indexOf(t)].Instructions;i[i.length-1]=e[n].clone()}Math.abs(t.Rhythm.RealValue-i)<1e-6&&t.SymbolEnum!==f.RhythmSymbolEnum.NONE&&this.areRhythmInstructionsMixed(e)&&(t.SymbolEnum=f.RhythmSymbolEnum.NONE)}}areRhythmInstructionsMixed(t){for(let e=1;e<t.length;e++)if(Math.abs(t[e].Rhythm.RealValue-t[0].Rhythm.RealValue)<1e-6&&t[e].SymbolEnum!==t[0].SymbolEnum)return!0;return!1}setSourceMeasureDuration(t,e){let i=new o.Fraction(0,1);const n=[];for(const a of t){n.push(a.MaxTieNoteFraction);const t=a.ActiveRhythm.Rhythm;i.lt(t)&&(i=new o.Fraction(t.Numerator,t.Denominator,0,!1))}const s=this.currentMeasure.calculateInstrumentsDuration(this.musicSheet,n);let r=new o.Fraction(0,1);for(const o of s)r.lt(o)&&(r=o);o.Fraction.Equal(r,i)?this.checkFractionsForEquivalence(r,i):r.lt(i)&&(r=this.currentMeasure.reverseCheck(this.musicSheet,r),this.checkFractionsForEquivalence(r,i)),this.currentMeasure.ImplicitMeasure=this.checkIfMeasureIsImplicit(r,i),this.currentMeasure.ImplicitMeasure||e++,this.currentMeasure.Duration=r,this.currentMeasure.ActiveTimeSignature=i,this.currentMeasure.MeasureNumber=e;for(let a=0;a<s.length;a++){const t=s[a];if(this.currentMeasure.ImplicitMeasure&&t!==r||!o.Fraction.Equal(t,i)&&!this.allInstrumentsHaveSameDuration(s,r)){const t=this.musicSheet.getGlobalStaffIndexOfFirstStaff(this.musicSheet.Instruments[a]);for(let e=0;e<this.musicSheet.Instruments[a].Staves.length;e++)if(!this.graphicalMeasureIsEmpty(t+e)){this.currentMeasure.setErrorInGraphicalMeasure(t+e,!0);const i=h.ITextTranslation.translateText("ReaderErrorMessages/MissingNotesError","Given Notes don't correspond to measure duration.");this.musicSheet.SheetErrors.pushMeasureError(i)}}}return e}checkFractionsForEquivalence(t,e){if(e.Denominator>t.Denominator){const i=e.Denominator/t.Denominator;t.expand(i)}}checkIfMeasureIsImplicit(t,e){return!(this.previousMeasure||!t.lt(e))||!!this.previousMeasure&&o.Fraction.plus(this.previousMeasure.Duration,t).Equals(e)}allInstrumentsHaveSameDuration(t,e){let i=0;for(let n=0,s=t.length;n<s;++n)t[n].Equals(e)&&i++;return i===t.length&&e!==new o.Fraction(0,1)}graphicalMeasureIsEmpty(t){let e=0;for(let i=0;i<this.currentMeasure.VerticalSourceStaffEntryContainers.length;i++)this.currentMeasure.VerticalSourceStaffEntryContainers[i].StaffEntries[t]||e++;return e===this.currentMeasure.VerticalSourceStaffEntryContainers.length}checkSourceMeasureForNullEntries(){for(let t=this.currentMeasure.VerticalSourceStaffEntryContainers.length-1;t>=0;t--)for(let e=this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries.length-1;e>=0;e--){const i=this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries[e];if(i)for(let t=i.VoiceEntries.length-1;t>=0;t--){const e=i.VoiceEntries[t];0===e.Notes.length&&(this._removeFromArray(e.ParentVoice.VoiceEntries,e),this._removeFromArray(i.VoiceEntries,e))}void 0!==i&&0===i.VoiceEntries.length&&(this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries[e]=void 0)}for(let t=this.currentMeasure.VerticalSourceStaffEntryContainers.length-1;t>=0;t--){let e=0;for(let i=0,n=this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries.length;i<n;++i)this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries[i]||e++;e===this.currentMeasure.VerticalSourceStaffEntryContainers[t].StaffEntries.length&&this._removeFromArray(this.currentMeasure.VerticalSourceStaffEntryContainers,this.currentMeasure.VerticalSourceStaffEntryContainers[t])}}pushSheetLabels(t,e){this.readComposer(t),this.readTitle(t);try{this.musicSheet.Title&&this.musicSheet.Composer||this.readTitleAndComposerFromCredits(t)}catch(i){u.default.info("MusicSheetReader.pushSheetLabels","readTitleAndComposerFromCredits",i)}try{if(!this.musicSheet.Title){const t=Math.max(0,e.lastIndexOf("/"),e.lastIndexOf("\\")),i=e.substr(t).split(".",1);this.musicSheet.Title=new y.Label(i[0])}}catch(i){u.default.info("MusicSheetReader.pushSheetLabels","read title from file name",i)}}presentAttrsWithValue(t,e){for(const i of t.attributes())if(i.value===e)return!0;return!1}readComposer(t){const e=t.element("identification");if(e){const t=e.elements("creator");for(let e=0,i=t.length;e<i;++e){const i=t[e];if(i.hasAttributes){if(this.presentAttrsWithValue(i,"composer")){this.musicSheet.Composer=new y.Label(this.trimString(i.value));continue}(this.presentAttrsWithValue(i,"lyricist")||this.presentAttrsWithValue(i,"poet"))&&(this.musicSheet.Lyricist=new y.Label(this.trimString(i.value)))}}}}readTitleAndComposerFromCredits(t){var e,i;const n=this.computeSystemYCoordinates(t);if(0===n)return;let s,r,o,a=1,l=0;const h=t.elements("credit");for(let c=0,u=h.length;c<u;++c){const t=h[c];if(!t.attribute("page"))return;if("1"===t.attribute("page").value){let h;if(t){if(h=t.element("credit-words"),!h.attribute("justify"))break;const c=null===(e=h.attribute("justify"))||void 0===e?void 0:e.value,u=null===(i=h.attribute("default-y"))||void 0===i?void 0:i.value,d=null!=u,f=d?parseFloat(u):Number.MIN_VALUE;if(d&&f>n){if(!this.musicSheet.Title){const t=h.attribute("font-size").value,e=parseFloat(t);a<e&&(a=e,s=h.value)}if(this.musicSheet.Subtitle||"right"!==c&&"left"!==c&&l<f&&(l=f,o?(r=o,o=h.value):o=h.value),void 0===this.musicSheet.Composer||!this.musicSheet.Lyricist)switch(c){case"right":this.musicSheet.Composer=new y.Label(this.trimString(h.value));break;case"left":this.musicSheet.Lyricist=new y.Label(this.trimString(h.value))}}}}}!this.musicSheet.Title&&s&&(this.musicSheet.Title=new y.Label(this.trimString(s))),!this.musicSheet.Subtitle&&r&&(this.musicSheet.Subtitle=new y.Label(this.trimString(r)))}computeSystemYCoordinates(t){if(!t.element("defaults"))return 0;let e=0,i=0;try{const i=t.element("defaults").element("page-layout").element("page-height").value;e=parseFloat(i)}catch(r){return u.default.info("MusicSheetReader.computeSystemYCoordinates(): couldn't find page height, not reading title/composer."),0}let n=!1;const s=t.elements("part");for(let o=0,a=s.length;o<a;++o){const t=s[o].elements("measure");for(let e=0,s=t.length;e<s;++e){const s=t[e];if(s.element("print")){const t=s.element("print").elements("system-layout");for(let e=0,s=t.length;e<s;++e){const s=t[e];if(s.element("top-system-distance")){const t=s.element("top-system-distance").value;i=parseFloat(t),n=!0;break}}break}}if(n)break}if(t.element("defaults").element("system-layout")&&t.element("defaults").element("system-layout").element("top-system-distance")){const e=t.element("defaults").element("system-layout").element("top-system-distance").value;i=parseFloat(e)}return 0===i?0:e-i}readTitle(t){const e=t.element("work");let i;e&&(i=e.element("work-title"),i&&i.value&&(this.musicSheet.Title=new y.Label(this.trimString(i.value))));const n=t.element("movement-title");let s="";if(n&&(this.musicSheet.Title?s=this.trimString(n.value):this.musicSheet.Title=new y.Label(this.trimString(n.value))),e){const t=e.element("work-number");if(t){const e=t.value;e&&(s=""===s?e:s+", "+e)}}s&&(this.musicSheet.Subtitle=new y.Label(s))}createInstrumentGroups(t){let e=0;const i={};let n;try{const o=t;for(let t=0,a=o.length;t<a;++t){const a=o[t];if("score-part"===a.name){const t=a.attribute("id").value,o=new l.Instrument(e,t,this.musicSheet,n);e++;const h=a.elements();for(let e=0,i=h.length;e<i;++e){const t=h[e];try{if("part-name"===t.name)o.Name=t.value,t.attribute("print-object")&&"no"===t.attribute("print-object").value&&(o.NameLabel.print=!1);else if("part-abbreviation"===t.name)o.PartAbbreviation=t.value;else if("score-instrument"===t.name){const e=new b.SubInstrument(o);e.idString=t.firstAttribute.value,o.SubInstruments.push(e);const i=t.element("instrument-name");i&&(e.name=i.value,e.setMidiInstrument(i.value))}else if("midi-instrument"===t.name){let e=o.getSubInstrument(t.firstAttribute.value);for(let n=0,s=o.SubInstruments.length;n<s;++n){const i=o.SubInstruments[n];if(i.idString===t.value){e=i;break}}const i=t.elements();for(let t=0,n=i.length;t<n;++t){const n=i[t];try{if("midi-channel"===n.name)10===parseInt(n.value,10)&&(o.MidiInstrumentId=g.MidiInstrument.Percussion);else if("midi-program"===n.name)o.SubInstruments.length>0&&o.MidiInstrumentId!==g.MidiInstrument.Percussion&&(e.midiInstrumentID=Math.max(0,parseInt(n.value,10)-1));else if("midi-unpitched"===n.name)e.fixedKey=Math.max(0,parseInt(n.value,10));else if("volume"===n.name)try{const t=parseFloat(n.value);e.volume=t/127}catch(s){u.default.debug("ExpressionReader.readExpressionParameters","read volume",s)}else if("pan"===n.name)try{const t=parseFloat(n.value);e.pan=t/64}catch(s){u.default.debug("ExpressionReader.readExpressionParameters","read pan",s)}}catch(s){u.default.info("MusicSheetReader.createInstrumentGroups midi settings: ",s)}}}}catch(r){u.default.info("MusicSheetReader.createInstrumentGroups: ",r)}}if(0===o.SubInstruments.length){const t=new b.SubInstrument(o);o.SubInstruments.push(t)}i[t]=o,n?(n.InstrumentalGroups.push(o),this.musicSheet.Instruments.push(o)):(this.musicSheet.InstrumentalGroups.push(o),this.musicSheet.Instruments.push(o))}else if("part-group"===a.name&&"start"===a.attribute("type").value){const t=new m.InstrumentalGroup("group",this.musicSheet,n);n?n.InstrumentalGroups.push(t):this.musicSheet.InstrumentalGroups.push(t),n=t}else if("part-group"===a.name&&"stop"===a.attribute("type").value&&n){if(1===n.InstrumentalGroups.length){const t=n.InstrumentalGroups[0];n.Parent?(n.Parent.InstrumentalGroups.push(t),this._removeFromArray(n.Parent.InstrumentalGroups,n)):(this.musicSheet.InstrumentalGroups.push(t),this._removeFromArray(this.musicSheet.InstrumentalGroups,n))}n=n.Parent}}}catch(o){const t=h.ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading Instruments");throw new c.MusicSheetReadingException(t,o)}for(let a=0,l=this.musicSheet.Instruments.length;a<l;++a){const t=this.musicSheet.Instruments[a];t.Name||(t.Name="Instr. "+t.IdString)}return i}getCompleteNumberOfStavesFromXml(t){let e=0;for(const i of t){const t=i.elements("measure");if(t.length>0){const i=t[0];if(i){let t=i.element("attributes");t&&(t=t.element("staves")),t?e+=parseInt(t.value,10):e++}}}if(isNaN(e)||e<=0){const t=h.ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of staves.");throw new c.MusicSheetReadingException(t)}return e}getInstrumentNumberOfStavesFromXml(t){let e=0;const i=t.element("measure");if(i){const t=i.element("attributes");let n;t&&(n=t.element("staves")),e=t&&n?parseInt(n.value,10):1}if(isNaN(e)||e<=0){const t=h.ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of Staves.");throw new c.MusicSheetReadingException(t)}return e}}e.MusicSheetReader=E},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSheet=e.PlaybackSettings=void 0;const s=i(0),r=i(166),o=i(136),a=i(12),l=i(51),h=i(138),c=i(26),u=i(22),d=n(i(1));class f{}e.PlaybackSettings=f;class p{constructor(){this.idString="random idString, not initialized",this.sourceMeasures=[],this.repetitions=[],this.dynListStaves=[],this.timestampSortedDynamicExpressionsList=[],this.timestampSortedTempoExpressionsList=[],this.instrumentalGroups=[],this.instruments=[],this.musicPartManager=void 0,this.musicSheetErrors=new h.MusicSheetErrors,this.staves=[],this.transpose=0,this.defaultStartTempoInBpm=0,this.drawErroneousMeasures=!1,this.hasBeenOpenedForTheFirstTime=!1,this.currentEnrolledPosition=new s.Fraction(0,1),this.playbackSettings=new f,this.playbackSettings.rhythm=new s.Fraction(4,4,0,!1),this.userStartTempoInBPM=100,this.pageWidth=120,this.MusicPartManager=new r.MusicPartManager(this),this.hasBPMInfo=!1}static getIndexFromStaff(t){return t.idInMusicSheet}get SourceMeasures(){return this.sourceMeasures}set SourceMeasures(t){this.sourceMeasures=t}get Repetitions(){return this.repetitions}set Repetitions(t){this.repetitions=t}get DynListStaves(){return this.dynListStaves}get TimestampSortedTempoExpressionsList(){return this.timestampSortedTempoExpressionsList}get TimestampSortedDynamicExpressionsList(){return this.timestampSortedDynamicExpressionsList}get InstrumentalGroups(){return this.instrumentalGroups}get Parts(){return this.instruments}get Instruments(){return this.instruments}get SheetPlaybackSetting(){return this.playbackSettings}set SheetPlaybackSetting(t){this.playbackSettings=t}get DrawErroneousMeasures(){return this.drawErroneousMeasures}set DrawErroneousMeasures(t){this.drawErroneousMeasures=t}get HasBeenOpenedForTheFirstTime(){return this.hasBeenOpenedForTheFirstTime}set HasBeenOpenedForTheFirstTime(t){this.hasBeenOpenedForTheFirstTime=t}InitializeStartTempoInBPM(t){this.userStartTempoInBPM=t}get DefaultStartTempoInBpm(){return this.defaultStartTempoInBpm}set DefaultStartTempoInBpm(t){this.defaultStartTempoInBpm=t,this.InitializeStartTempoInBPM(t)}get Path(){return this.path}set Path(t){this.path=t}get Staves(){return this.staves}get TitleString(){return this.title?this.title.text:""}set TitleString(t){this.Title=new a.Label(t)}get SubtitleString(){return this.subtitle?this.subtitle.text:""}set SubtitleString(t){this.Subtitle=new a.Label(t)}get ComposerString(){return this.composer?this.composer.text:""}set ComposerString(t){this.Composer=new a.Label(t)}get LyricistString(){return this.lyricist?this.lyricist.text:""}set LyricistString(t){this.Lyricist=new a.Label(t)}get Title(){return this.title}set Title(t){this.title=t}get Subtitle(){return this.subtitle}set Subtitle(t){this.subtitle=t}get Composer(){return this.composer}set Composer(t){this.composer=t}get Lyricist(){return this.lyricist}set Lyricist(t){this.lyricist=t}get Rules(){return this.rules||(d.default.debug("warning: sheet.Rules was undefined. Creating new EngravingRules."),this.rules=new c.EngravingRules),this.rules}set Rules(t){this.rules=t}get SheetErrors(){return this.musicSheetErrors}get SelectionStart(){return this.selectionStart}set SelectionStart(t){this.selectionStart=t.clone(),this.currentEnrolledPosition=t.clone()}get SelectionEnd(){return this.selectionEnd}set SelectionEnd(t){this.selectionEnd=t}set HasBPMInfo(t){this.hasBPMInfo=t}get HasBPMInfo(){return this.hasBPMInfo}addMeasure(t){this.sourceMeasures.push(t),t.measureListIndex=this.sourceMeasures.length-1}checkForInstrumentWithNoVoice(){for(let t=0,e=this.instruments.length;t<e;++t){const e=this.instruments[t];if(0===e.Voices.length){const t=new l.Voice(e,1);e.Voices.push(t)}}}getStaffFromIndex(t){return this.staves[t]}fillStaffList(){let t=0;for(let e=0,i=this.instruments.length;e<i;++e){const i=this.instruments[e];for(let e=0,n=i.Staves.length;e<n;++e){const n=i.Staves[e];n.idInMusicSheet=t,this.staves.push(n),t++}}}get MusicPartManager(){return this.musicPartManager}set MusicPartManager(t){this.musicPartManager=t}getCompleteNumberOfStaves(){let t=0;for(let e=0,i=this.instruments.length;e<i;++e)t+=this.instruments[e].Staves.length;return t}getListOfMeasuresFromIndeces(t,e){const i=[];for(let n=t;n<=e;n++)i.push(this.sourceMeasures[n]);return i}getNextSourceMeasure(t){const e=this.sourceMeasures.indexOf(t);return e===this.sourceMeasures.length-1?t:this.sourceMeasures[e+1]}getFirstSourceMeasure(){return this.sourceMeasures[0]}getLastSourceMeasure(){return this.sourceMeasures[this.sourceMeasures.length-1]}resetAllNoteStates(){const t=this.MusicPartManager.getIterator();for(;!t.EndReached&&t.CurrentVoiceEntries;){for(let e=0,i=t.CurrentVoiceEntries.length;e<i;++e){const i=t.CurrentVoiceEntries[e];for(let t=0,e=i.Notes.length;t<e;++t)i.Notes[t].state=u.NoteState.Normal}t.moveToNext()}}getMusicSheetInstrumentIndex(t){return this.Instruments.indexOf(t)}getGlobalStaffIndexOfFirstStaff(t){const e=this.getMusicSheetInstrumentIndex(t);let i=0;for(let n=0;n<e;n++)i+=this.Instruments[n].Staves.length;return i}setRepetitionNewUserNumberOfRepetitions(t,e){let i=0;for(let n=0;n<this.repetitions.length;n++)if(this.repetitions[n]instanceof o.Repetition){if(t===i){this.repetitions[n].UserNumberOfRepetitions=e;break}i++}}getRepetitionByIndex(t){let e=0;for(let i=0;i<this.repetitions.length;i++)if(this.repetitions[i]instanceof o.Repetition){if(t===e)return this.repetitions[i];e++}}CompareTo(t){return this.Title.text.localeCompare(t.Title.text)}getExpressionsStartTempoInBPM(){if(this.TimestampSortedTempoExpressionsList.length>0){const t=this.TimestampSortedTempoExpressionsList[0];if(t.InstantaneousTempo)return t.InstantaneousTempo.TempoInBpm;if(t.ContinuousTempo)return t.ContinuousTempo.StartTempo}return this.userStartTempoInBPM}get Errors(){return this.musicSheetErrors.measureErrors}get FirstMeasureNumber(){try{return this.getFirstSourceMeasure().MeasureNumber}catch(t){return d.default.info("MusicSheet.FirstMeasureNumber: ",t),0}}get LastMeasureNumber(){try{return this.getLastSourceMeasure().MeasureNumber}catch(t){return d.default.info("MusicSheet.LastMeasureNumber: ",t),0}}get CurrentEnrolledPosition(){return this.currentEnrolledPosition.clone()}set CurrentEnrolledPosition(t){this.currentEnrolledPosition=t.clone()}get Transpose(){return this.transpose}set Transpose(t){this.transpose=t}get FullNameString(){return this.ComposerString+" "+this.TitleString}get IdString(){return this.idString}set IdString(t){this.idString=t}getEnrolledSelectionStartTimeStampWorkaround(){const t=this.MusicPartManager.getIterator(this.SelectionStart);return s.Fraction.createFromFraction(t.CurrentEnrolledTimestamp)}get SheetEndTimestamp(){const t=this.getLastSourceMeasure();return s.Fraction.plus(t.AbsoluteTimestamp,t.Duration)}getSourceMeasureFromTimeStamp(t){for(let e=0,i=this.sourceMeasures.length;e<i;++e){const i=this.sourceMeasures[e];for(let e=0,n=i.VerticalSourceStaffEntryContainers.length;e<n;++e){const n=i.VerticalSourceStaffEntryContainers[e];if(t.Equals(n.getAbsoluteTimestamp()))return i}}return this.findSourceMeasureFromTimeStamp(t)}findSourceMeasureFromTimeStamp(t){for(const e of this.sourceMeasures)if(e.AbsoluteTimestamp.lte(t)&&t.lt(s.Fraction.plus(e.AbsoluteTimestamp,e.Duration)))return e}getVisibleInstruments(){const t=[];for(let e=0,i=this.Instruments.length;e<i;++e){const i=this.Instruments[e];i.Voices.length>0&&i.Voices[0].Visible&&t.push(i)}return t}}e.MusicSheet=p,p.defaultTitle="[no title given]"},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.RepetitionEndingPart=e.Repetition=void 0;const s=i(137),r=i(0),o=i(81),a=n(i(1));class l extends o.PartListEntry{constructor(t,e){super(t),this.backwardJumpInstructions=[],this.endingParts=[],this.endingIndexDict={},this.userNumberOfRepetitions=0,this.visibles=[],this.fromWords=!1,this.repetitonIterationOrder=[],this.numberOfEndings=1,this.musicSheet2=t,this.virtualOverallRepetition=e}get BackwardJumpInstructions(){return this.backwardJumpInstructions}get EndingIndexDict(){return this.endingIndexDict}get EndingParts(){return this.endingParts}get Visibles(){return this.visibles}set Visibles(t){this.visibles=t}get DefaultNumberOfRepetitions(){let t=2;return this.virtualOverallRepetition&&(t=1),Math.max(t,Object.keys(this.endingIndexDict).length,this.checkRepetitionForMultipleLyricVerses())}get UserNumberOfRepetitions(){return this.userNumberOfRepetitions}set UserNumberOfRepetitions(t){this.userNumberOfRepetitions=t,this.repetitonIterationOrder=[];const e=this.userNumberOfRepetitions-this.NumberOfEndings;for(let i=1;i<=this.userNumberOfRepetitions;i++)i<=e?this.repetitonIterationOrder.push(1):this.repetitonIterationOrder.push(i-e)}getForwardJumpTargetForIteration(t){const e=this.repetitonIterationOrder[t-1];return this.endingIndexDict[e]?this.endingIndexDict[e].part.StartIndex:-1}getBackwardJumpTarget(){return this.startMarker.measureIndex}SetEndingStartIndex(t,e){const i=new h(new s.SourceMusicPart(this.musicSheet2,e,e));this.endingParts.push(i);for(const s of t)try{this.endingIndexDict[s]=i,i.endingIndices.push(s),this.numberOfEndings<s&&(this.numberOfEndings=s)}catch(n){a.default.error("Repetition: Exception.",n)}}setEndingEndIndex(t,e){this.endingIndexDict[t]&&this.endingIndexDict[t].part.setEndIndex(e)}get NumberOfEndings(){return this.numberOfEndings}get FromWords(){return this.fromWords}set FromWords(t){this.fromWords=t}get AbsoluteTimestamp(){return r.Fraction.createFromFraction(this.musicSheet2.SourceMeasures[this.startMarker.measureIndex].AbsoluteTimestamp)}get StartIndex(){return this.startMarker.measureIndex}get EndIndex(){if(0===this.BackwardJumpInstructions.length)return this.StartIndex;let t=this.backwardJumpInstructions[this.backwardJumpInstructions.length-1].measureIndex;return this.endingIndexDict[this.NumberOfEndings]&&(t=Math.max(this.endingIndexDict[this.NumberOfEndings].part.EndIndex,t)),t}checkRepetitionForMultipleLyricVerses(){let t=0;const e=this.StartIndex,i=this.EndIndex;for(let n=e;n<=i;n++){const e=this.musicSheet2.SourceMeasures[n];for(let i=0;i<e.CompleteNumberOfStaves;i++)for(const n of e.VerticalSourceStaffEntryContainers[i].StaffEntries)if(n){let e=0;for(const t of n.VoiceEntries)e+=Object.keys(t.LyricsEntries).length;t=Math.max(t,e)}}return t}get FirstSourceMeasureNumber(){return this.getFirstSourceMeasure().MeasureNumber}get LastSourceMeasureNumber(){return this.getLastSourceMeasure().MeasureNumber}}e.Repetition=l;class h{constructor(t){this.endingIndices=[],this.part=t}ToString(){return this.endingIndices.join(", ")}}e.RepetitionEndingPart=h},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SourceMusicPart=void 0;const n=i(81),s=i(0);class r extends n.PartListEntry{constructor(t,e,i){super(t),this.musicSheet=t,this.startIndex=e,this.endIndex=i}get MeasuresCount(){return this.endIndex-this.startIndex+1}get StartIndex(){return this.startIndex}get EndIndex(){return this.endIndex}get ParentRepetition(){return this.parentRepetition}set ParentRepetition(t){this.parentRepetition=t}get AbsoluteTimestamp(){return s.Fraction.createFromFraction(this.musicSheet.SourceMeasures[this.startIndex].AbsoluteTimestamp)}setStartIndex(t){this.startIndex=t}setEndIndex(t){this.endIndex=t}}e.SourceMusicPart=r},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSheetErrors=void 0,e.MusicSheetErrors=class{constructor(){this.measureErrors={},this.errors=[],this.tempErrors=[]}finalizeMeasure(t){let e=this.measureErrors[t];e||(e=[]),this.measureErrors[t]=e.concat(this.tempErrors),this.tempErrors=[]}pushMeasureError(t){this.tempErrors.push(t)}push(t){this.errors.push(t)}}},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.InstrumentReader=void 0;const s=i(140),r=i(31),o=i(7),a=i(18),l=i(19),h=i(0),c=i(20),u=i(11),d=i(7),f=i(19),p=i(18),m=n(i(1)),b=i(7),g=i(147),y=i(148),S=i(149),v=i(14),x=i(39),E=i(23);e.InstrumentReader=class{constructor(t,e,i,n){this.voiceGeneratorsDict={},this.staffMainVoiceGeneratorDict={},this.divisions=0,this.currentClefNumber=1,this.currentXmlMeasureIndex=0,this.activeKeyHasBeenInitialized=!1,this.abstractInstructions=[],this.openChordSymbolContainers=[],this.repetitionInstructionReader=e,this.xmlMeasureList=i,this.musicSheet=n.GetMusicSheet,this.instrument=n,this.activeClefs=new Array(n.Staves.length),this.activeClefsHaveBeenInitialized=new Array(n.Staves.length);for(let s=0;s<n.Staves.length;s++)this.activeClefsHaveBeenInitialized[s]=!1;this.createExpressionGenerators(n.Staves.length),this.slurReader=new S.SlurReader(this.musicSheet),this.pluginManager=t}get ActiveKey(){return this.activeKey}get MaxTieNoteFraction(){return this.maxTieNoteFraction}get ActiveRhythm(){return this.activeRhythm}set ActiveRhythm(t){this.activeRhythm=t}readNextXmlMeasure(t,e,i){var n,s,r;if(this.currentXmlMeasureIndex>=this.xmlMeasureList.length)return!1;this.currentMeasure=t,this.inSourceMeasureInstrumentIndex=this.musicSheet.getGlobalStaffIndexOfFirstStaff(this.instrument),this.repetitionInstructionReader&&this.repetitionInstructionReader.prepareReadingMeasure(t,this.currentXmlMeasureIndex);let o=new h.Fraction(0,1),a=new h.Fraction(0,1),l=!1;this.maxTieNoteFraction=new h.Fraction(0,1);let d=!1;try{const p=this.xmlMeasureList[this.currentXmlMeasureIndex],b=p.elements();if(t.Rules.UseXMLMeasureNumbers&&!Number.isInteger(t.MeasureNumberXML)){const e=parseInt(null===(n=p.attribute("number"))||void 0===n?void 0:n.value,10);Number.isInteger(e)&&(t.MeasureNumberXML=e)}let y;for(let n=0;n<b.length;n++){const p=b[n];if(n>0&&(y=b[n-1]),"print"===p.name){const e=p.attribute("new-system");"yes"===(null==e?void 0:e.value)&&(t.printNewSystemXml=!0);const i=p.attribute("new-page");"yes"===(null==i?void 0:i.value)&&(t.printNewPageXml=!0)}else if("note"===p.name){let t=!0;"no"===(null===(s=p.attribute("print-object"))||void 0===s?void 0:s.value)&&(t=!1);let n=1;this.instrument.Staves.length>1&&p.element("staff")&&(n=parseInt(p.element("staff").value,10),isNaN(n)&&(m.default.debug("InstrumentReader.readNextXmlMeasure.get staff number"),n=1)),this.currentStaff=this.instrument.Staves[n-1];const r=void 0!==p.element("chord");if(p.element("voice")){const t=parseInt(p.element("voice").value,10);this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(t,n-1)}else r&&this.currentVoiceGenerator||(this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(1,n-1));let l,u=0,f=new h.Fraction(0,1),b=2,g=!1;if(p.element("duration")){if(u=parseInt(p.element("duration").value,10),isNaN(u)){const t=c.ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid Note Duration.");this.musicSheet.SheetErrors.pushMeasureError(t),m.default.debug("InstrumentReader.readNextXmlMeasure",t);continue}if(f=new h.Fraction(u,4*this.divisions),0===u?f=this.getNoteDurationFromTypeNode(p):l=this.getNoteDurationFromTypeNode(p),p.element("time-modification")){f=this.getNoteDurationForTuplet(p);const t=p.element("time-modification");(null==t?void 0:t.element("normal-notes"))&&(b=parseInt(t.element("normal-notes").value,10)),g=!0}}const y=void 0!==p.element("rest"),S=p.element("notations"),E=void 0!==p.element("grace")||0===u||r&&d;let _=!1,w=!1;if(E){const t=p.element("grace");t&&t.attributes()&&t.attribute("slash")&&"yes"===t.attribute("slash").value&&(_=!0),f=this.getNoteDurationFromTypeNode(p);const e=p.element("notations");e&&e.element("slur")&&(w=!0)}let T=!1;p.element("cue")&&(T=!0);const M=p.element("type");let P=x.NoteType.UNDEFINED;if(M){const t=M.attribute("size");"cue"===(null==t?void 0:t.value)&&(T=!0),P=x.NoteTypeHandler.StringToNoteType(M.value)}let L,A=v.StemDirectionType.Undefined;const C=p.element("stem");if(C){switch(C.value){case"down":A=v.StemDirectionType.Down;break;case"up":A=v.StemDirectionType.Up;break;case"double":A=v.StemDirectionType.Double;break;case"none":A=v.StemDirectionType.None;break;default:A=v.StemDirectionType.Undefined}const t=C.attribute("color");t&&(L=this.parseXmlColor(t.value))}let I,R=0,N=!1;if(S){const t=S.element("ornaments");if(t){const e=t.element("tremolo");if(e){const t=e.attribute("type");if(t&&"single"===t.value){const t=parseInt(e.value,10);t>0&&(R=t)}}const i=t.element("wavy-line");if(void 0!==i){const t=i.attribute("type");t&&"start"===t.value&&(N=!0)}}}const F=p.element("notehead");if(F){const t=F.attribute("color");t&&(I=this.parseXmlColor(t.value))}let B;const O=p.attribute("color");O&&(B=this.parseXmlColor(O.value),I||(I=B),L||(L=B));let D=o.clone();r&&(D=a.clone()),this.currentStaffEntry=this.currentMeasure.findOrCreateStaffEntry(D,this.inSourceMeasureInstrumentIndex+n-1,this.currentStaff).staffEntry,(!this.currentVoiceGenerator.hasVoiceEntry()||!r&&!E&&!d||E&&!d||E&&!r||!E&&d)&&this.currentVoiceGenerator.createVoiceEntry(D,this.currentStaffEntry,!y&&!E,E,_,w),E||r||(a=o.clone(),o.Add(f)),r&&void 0!==this.currentStaffEntry&&this.currentStaffEntry.ParentStaff!==this.currentStaff&&(this.currentStaffEntry=this.currentVoiceGenerator.checkForStaffEntryLink(this.inSourceMeasureInstrumentIndex+n-1,this.currentStaff,this.currentStaffEntry,this.currentMeasure));const k=void 0!==this.currentStaffEntry&&void 0!==this.currentStaffEntry.Timestamp&&this.currentStaffEntry.Timestamp.Equals(new h.Fraction(0,1))&&!this.currentStaffEntry.hasNotes();if(this.saveAbstractInstructionList(this.instrument.Staves.length,k),0!==this.openChordSymbolContainers.length&&(this.currentStaffEntry.ChordContainers=this.openChordSymbolContainers,this.openChordSymbolContainers=[]),this.activeRhythm,g||E||(f=new h.Fraction(u,4*this.divisions)),this.currentVoiceGenerator.read(p,f,l,P,b,y,this.currentStaffEntry,this.currentMeasure,e,this.maxTieNoteFraction,r,i,t,T,E,A,R,L,I,N),void 0!==S&&S.element("dynamics")){const t=this.expressionReaders[this.readExpressionStaffNumber(p)-1];t&&(t.readExpressionParameters(p,this.instrument,this.divisions,o,a,this.currentMeasure.MeasureNumber,!1),t.read(p,this.currentMeasure,a))}d=E}else if("attributes"===p.name){const e=p.element("divisions");if(e&&(this.divisions=parseInt(e.value,10),isNaN(this.divisions))){const t=c.ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(m.default.debug("InstrumentReader.readNextXmlMeasure",t),this.divisions=this.readDivisionsFromNotes(),!(this.divisions>0))throw l=!0,new u.MusicSheetReadingException(t+this.instrument.Name);this.musicSheet.SheetErrors.push(t+this.instrument.Name)}if(!p.element("divisions")&&0===this.divisions&&0===this.currentXmlMeasureIndex){const t=c.ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(this.divisions=this.readDivisionsFromNotes(),!(this.divisions>0))throw l=!0,new u.MusicSheetReadingException(t+this.instrument.Name);this.musicSheet.SheetErrors.push(t+this.instrument.Name)}this.addAbstractInstruction(p,i,y),o.Equals(new h.Fraction(0,1))&&this.isAttributesNodeAtBeginOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],p)&&this.saveAbstractInstructionList(this.instrument.Staves.length,!0),this.isAttributesNodeAtEndOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],p)&&this.saveClefInstructionAtEndOfMeasure();const n=p.element("staff-details");if(n){const t=n.element("staff-lines");if(t){let e=1;const i=n.attribute("number");i&&(e=parseInt(i.value,10)),this.instrument.Staves[e-1].StafflineCount=parseInt(t.value,10)}}const s=p.element("measure-style");if(s){const e=s.element("multiple-rest");if(e){const i=e.value;let n=0;try{n=Number.parseInt(i,10),void 0!==t.multipleRestMeasures&&n!==t.multipleRestMeasures?t.multipleRestMeasures=0:t.multipleRestMeasures=n}catch(f){ ("multirest parse error: "+f)}}}}else if("forward"===p.name){const t=parseInt(p.element("duration").value,10);o.Add(new h.Fraction(t,4*this.divisions))}else if("backup"===p.name){const t=parseInt(p.element("duration").value,10);o.Sub(new h.Fraction(t,4*this.divisions)),o.IsNegative()&&(o=new h.Fraction(0,1)),a.Sub(new h.Fraction(t,4*this.divisions)),a.IsNegative()&&(a=new h.Fraction(0,1))}else if("direction"===p.name){const t=p.element("direction-type");let e=Math.min(1,o.RealValue);void 0!==this.activeRhythm&&this.activeRhythm.Rhythm&&(e/=this.activeRhythm.Rhythm.RealValue);let i=!1;if(this.repetitionInstructionReader&&(i=this.repetitionInstructionReader.handleRepetitionInstructionsFromWordsOrSymbols(t,e)),!i){let e=this.expressionReaders[0];const i=this.readExpressionStaffNumber(p)-1;i<this.expressionReaders.length&&(e=this.expressionReaders[i]),e&&(t.element("octave-shift")&&(e.readExpressionParameters(p,this.instrument,this.divisions,o,a,this.currentMeasure.MeasureNumber,!0),e.addOctaveShift(p,this.currentMeasure,a.clone())),e.readExpressionParameters(p,this.instrument,this.divisions,o,a,this.currentMeasure.MeasureNumber,!1),e.read(p,this.currentMeasure,o))}}else if("barline"===p.name){this.repetitionInstructionReader&&this.repetitionInstructionReader.handleLineRepetitionInstructions(p)&&(this.currentMeasure.HasEndLine=!0);const t=p.attribute("location");if(n===b.length-1||t&&"right"===t.value){const t=null===(r=p.element("bar-style"))||void 0===r?void 0:r.value;t&&(this.currentMeasure.endingBarStyleXml=t,this.currentMeasure.endingBarStyleEnum=E.SystemLinesEnumHelper.xmlBarlineStyleToSystemLinesEnum(t))}}else if("sound"===p.name)try{if(p.attribute("tempo")){const t=parseFloat(p.attribute("tempo").value);0===this.currentXmlMeasureIndex&&(this.musicSheet.DefaultStartTempoInBpm=t,this.musicSheet.HasBPMInfo=!0)}}catch(f){m.default.debug("InstrumentReader.readTempoInstruction",f)}else"harmony"===p.name&&this.openChordSymbolContainers.push(g.ChordSymbolReader.readChordSymbol(p,this.musicSheet,this.activeKey))}for(const t in this.voiceGeneratorsDict)this.voiceGeneratorsDict.hasOwnProperty(t)&&this.voiceGeneratorsDict[t].checkForOpenBeam();if(this.currentXmlMeasureIndex===this.xmlMeasureList.length-1){for(let t=0;t<this.instrument.Staves.length;t++)this.activeClefsHaveBeenInitialized[t]||this.createDefaultClefInstruction(this.musicSheet.getGlobalStaffIndexOfFirstStaff(this.instrument)+t);this.activeKeyHasBeenInitialized||this.createDefaultKeyInstruction();for(let t=0;t<this.expressionReaders.length;t++){const e=this.expressionReaders[t];e&&e.checkForOpenExpressions(this.currentMeasure,o)}}this.musicSheet.HasBPMInfo?0===t.TempoInBPM&&this.previousMeasure&&(this.currentMeasure.TempoInBPM=this.previousMeasure.TempoInBPM):this.currentMeasure.TempoInBPM=120}catch(f){if(l)throw new u.MusicSheetReadingException(f.Message);const t=c.ITextTranslation.translateText("ReaderErrorMessages/MeasureError","Error while reading Measure.");this.musicSheet.SheetErrors.pushMeasureError(t),m.default.debug("InstrumentReader.readNextXmlMeasure",t,f)}return this.previousMeasure=this.currentMeasure,this.currentXmlMeasureIndex+=1,!0}parseXmlColor(t){if(t)return 7===t.length?t:9===t.length?"#"+t.substr(3):void 0}doCalculationsAfterDurationHasBeenSet(){for(const t in this.voiceGeneratorsDict)this.voiceGeneratorsDict.hasOwnProperty(t)&&this.voiceGeneratorsDict[t].checkOpenTies()}getOrCreateVoiceGenerator(t,e){const i=this.instrument.Staves[e];let n=this.voiceGeneratorsDict[t];if(n)-1===i.Voices.indexOf(n.GetVoice)&&i.Voices.push(n.GetVoice);else{const r=this.staffMainVoiceGeneratorDict[e];r?(n=new s.VoiceGenerator(this.pluginManager,i,t,this.slurReader,r.GetVoice),i.Voices.push(n.GetVoice),this.voiceGeneratorsDict[t]=n):(n=new s.VoiceGenerator(this.pluginManager,i,t,this.slurReader),i.Voices.push(n.GetVoice),this.voiceGeneratorsDict[t]=n,this.staffMainVoiceGeneratorDict[e]=n)}return n}createExpressionGenerators(t){this.expressionReaders=new Array(t);for(let e=0;e<t;e++)this.expressionReaders[e]=new y.ExpressionReader(this.musicSheet,this.instrument,e+1)}createDefaultClefInstruction(t){let e;e=this.musicSheet.SourceMeasures.length>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure;const i=new o.ClefInstruction(d.ClefEnum.G,0,2);let n;e.FirstInstructionsStaffEntries[t]?(n=e.FirstInstructionsStaffEntries[t],n.removeFirstInstructionOfTypeClefInstruction()):(n=new r.SourceStaffEntry(void 0,void 0),e.FirstInstructionsStaffEntries[t]=n),i.Parent=n,n.Instructions.splice(0,0,i)}createDefaultKeyInstruction(){let t;t=this.musicSheet.SourceMeasures.length>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure;const e=new a.KeyInstruction(void 0,0,p.KeyEnum.major);for(let i=this.inSourceMeasureInstrumentIndex;i<this.inSourceMeasureInstrumentIndex+this.instrument.Staves.length;i++)if(t.FirstInstructionsStaffEntries[i]){const n=t.FirstInstructionsStaffEntries[i];e.Parent=n,n.removeFirstInstructionOfTypeKeyInstruction(),n.Instructions[0]instanceof o.ClefInstruction?n.Instructions.splice(1,0,e):n.Instructions.splice(0,0,e)}else{const n=new r.SourceStaffEntry(void 0,void 0);t.FirstInstructionsStaffEntries[i]=n,e.Parent=n,n.Instructions.push(e)}}isAttributesNodeAtBeginOfMeasure(t,e){const i=t.elements(),n=i.indexOf(e);if(n>0&&"backup"===i[n-1].name)return!0;let s=-1;for(let r=0;r<i.length;r++)if("note"===i[r].name){s=r;break}return n<s&&s>0||s<0}isAttributesNodeAtEndOfMeasure(t,e){const i=t.elements().slice();let n=0;for(let r=0;r<i.length;r++)if(i[r]===e){n=r;break}let s=0;for(let r=n;r<i.length;r++)if("note"===i[r].name){s=r;break}return n>s}getNoteDurationFromTypeNode(t){const e=t.element("type");if(e){const t=e.value;return x.NoteTypeHandler.getNoteDurationFromType(t)}return new h.Fraction(0,4*this.divisions)}addAbstractInstruction(t,e,i){if(t.element("divisions")&&1===t.elements().length)return;const n=t.element("transpose");if(n){const t=n.element("chromatic");t&&(this.instrument.PlaybackTranspose=parseInt(t.value,10))}const s=t.elements("clef");let r;if(s.length>0)for(let a=0,l=s.length;a<l;++a){const t=s[a];let e=d.ClefEnum.G,n=2,l=1,h=0;const f=t.element("line");if(f)try{n=parseInt(f.value,10)}catch(u){r=c.ITextTranslation.translateText("ReaderErrorMessages/ClefLineError","Invalid clef line given -> using default clef line."),this.musicSheet.SheetErrors.pushMeasureError(r),n=2,m.default.debug("InstrumentReader.addAbstractInstruction",r,u)}const p=t.element("sign");if(p)try{e=d.ClefEnum[p.value],o.ClefInstruction.isSupportedClef(e)||(r=c.ITextTranslation.translateText("ReaderErrorMessages/ClefError","Unsupported clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(r),e=d.ClefEnum.G,n=2),e===d.ClefEnum.TAB&&(h=-1)}catch(u){r=c.ITextTranslation.translateText("ReaderErrorMessages/ClefError","Invalid clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(r),e=d.ClefEnum.G,n=2,m.default.debug("InstrumentReader.addAbstractInstruction",r,u)}const b=t.element("clef-octave-change");if(b)try{h=parseInt(b.value,10)}catch(u){r=c.ITextTranslation.translateText("ReaderErrorMessages/ClefOctaveError","Invalid clef octave found -> using default clef octave."),this.musicSheet.SheetErrors.pushMeasureError(r),h=0}if(t.hasAttributes&&"number"===t.attributes()[0].name)try{l=parseInt(t.attributes()[0].value,10),l>this.currentClefNumber&&(l=this.currentClefNumber),this.currentClefNumber=l+1}catch(u){r=c.ITextTranslation.translateText("ReaderErrorMessages/ClefError","Invalid clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(r),l=1,this.currentClefNumber=l+1}if("forward"!==(null==i?void 0:i.name)){const t=new o.ClefInstruction(e,h,n);this.abstractInstructions.push([l,t])}}if(void 0!==t.element("key")&&this.instrument.MidiInstrumentId!==b.MidiInstrument.Percussion){let e=0;const i=t.element("key").element("fifths");if(i)try{e=parseInt(i.value,10)}catch(g){r=c.ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key found -> set to default."),this.musicSheet.SheetErrors.pushMeasureError(r),e=0,m.default.debug("InstrumentReader.addAbstractInstruction",r,g)}let n=p.KeyEnum.none,s=t.element("key");if(s&&(s=s.element("mode")),s)try{n=p.KeyEnum[s.value]}catch(g){r=c.ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key found -> set to default."),this.musicSheet.SheetErrors.pushMeasureError(r),n=p.KeyEnum.major,m.default.debug("InstrumentReader.addAbstractInstruction",r,g)}const o=new a.KeyInstruction(void 0,e,n);this.abstractInstructions.push([1,o])}if(t.element("time")){const e=t.element("time");let i=f.RhythmSymbolEnum.NONE,n=!0;if(void 0!==e&&e.hasAttributes){const t=e.attribute("symbol");t&&("common"===t.value?i=f.RhythmSymbolEnum.COMMON:"cut"===t.value&&(i=f.RhythmSymbolEnum.CUT));const s=e.attribute("print-object");s&&"no"===s.value&&(n=!1)}let s=0,o=0;const a=e&&void 0!==e.element("senza-misura"),u=t.elements("time"),d=[],p=[];for(let t=0,r=u.length;t<r;++t){const e=u[t];d.push.apply(d,e.elements("beats")),p.push.apply(p,e.elements("beat-type"))}if(a)this.abstractInstructions.push([1,new l.RhythmInstruction(new h.Fraction(4,4,0,!1),f.RhythmSymbolEnum.NONE)]);else{try{if(void 0!==d&&d.length>0&&void 0!==p&&d.length===p.length){const t=d.length,e=new Array(t);let i=0;for(let n=0;n<t;n++){const t=d[n].value;let s=0,r=0;if(-1!==t.indexOf("+")){const e=t.split("+");for(let t=0,i=e.length;t<i;++t)s+=parseInt(e[t],10)}else s=parseInt(t,10);r=parseInt(p[n].value,10),i=Math.max(i,r),e[n]=new h.Fraction(s,r,0,!1)}for(let n=0;n<t;n++)e[n].Denominator===i?s+=e[n].Numerator:s+=i/e[n].Denominator*e[n].Numerator;o=i}else s=parseInt(t.element("time").element("beats").value,10),o=parseInt(t.element("time").element("beat-type").value,10)}catch(g){r=c.ITextTranslation.translateText("ReaderErrorMessages/RhythmError","Invalid rhythm found -> set to default."),this.musicSheet.SheetErrors.pushMeasureError(r),s=4,o=4,m.default.debug("InstrumentReader.addAbstractInstruction",r,g)}const e=new l.RhythmInstruction(new h.Fraction(s,o,0,!1),i);e.PrintObject=n,this.abstractInstructions.push([1,e])}}}saveAbstractInstructionList(t,e){for(let i=this.abstractInstructions.length-1;i>=0;i--){const n=this.abstractInstructions[i],s=n[0],h=n[1];if(h instanceof o.ClefInstruction){const t=h;if(0===this.currentXmlMeasureIndex||s<=this.activeClefs.length&&t!==this.activeClefs[s-1])if(e||void 0===this.currentStaffEntry||this.currentStaffEntry.hasNotes()||s-1!==this.instrument.Staves.indexOf(this.currentStaffEntry.ParentStaff)){if(e){let e;if(this.currentMeasure){const n=t,a=this.inSourceMeasureInstrumentIndex+s-1,l=this.currentMeasure.FirstInstructionsStaffEntries[a];if(0===this.currentXmlMeasureIndex)if(l)if(void 0===this.currentMeasure.FirstInstructionsStaffEntries[a]||l.Instructions[0]instanceof o.ClefInstruction){const t=new r.SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[a]=t,n.Parent=t,t.Instructions.push(n)}else e=l,n.Parent=e,e.removeFirstInstructionOfTypeClefInstruction(),e.Instructions.splice(0,0,n),this.activeClefsHaveBeenInitialized[s-1]=!0;else e=new r.SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[a]=e,n.Parent=e,e.Instructions.push(n),this.activeClefsHaveBeenInitialized[s-1]=!0;else if(this.activeClefsHaveBeenInitialized[s-1]){const t=new r.SourceStaffEntry(void 0,void 0);this.previousMeasure.LastInstructionsStaffEntries[a]=t,n.Parent=t,t.Instructions.push(n)}else{const t=this.musicSheet.SourceMeasures[0];t.FirstInstructionsStaffEntries[a]?(e=t.FirstInstructionsStaffEntries[a],e.removeFirstInstructionOfTypeClefInstruction()):e=new r.SourceStaffEntry(void 0,void 0),n.Parent=e,e.Instructions.splice(0,0,n),this.activeClefsHaveBeenInitialized[s-1]=!0}this.activeClefs[s-1]=t,this.abstractInstructions.splice(i,1)}}}else{const e=t;e.Parent=this.currentStaffEntry,this.currentStaffEntry.removeFirstInstructionOfTypeClefInstruction(),this.currentStaffEntry.Instructions.push(e),this.activeClefs[s-1]=t,this.abstractInstructions.splice(i,1)}else s<=this.activeClefs.length&&t===this.activeClefs[s-1]&&this.abstractInstructions.splice(i,1)}if(h instanceof a.KeyInstruction){const e=h;if(this.activeKey&&this.activeKey.Key===e.Key)this.abstractInstructions.splice(i,1);else{let n;if(this.activeKey=e,this.abstractInstructions.splice(i,1),this.activeKeyHasBeenInitialized?n=this.currentMeasure:(this.activeKeyHasBeenInitialized=!0,n=this.currentXmlMeasureIndex>0?this.musicSheet.SourceMeasures[0]:this.currentMeasure),n)for(let i=this.inSourceMeasureInstrumentIndex;i<this.inSourceMeasureInstrumentIndex+t;i++){const t=e;if(n.FirstInstructionsStaffEntries[i]){const e=n.FirstInstructionsStaffEntries[i];t.Parent=e,e.removeFirstInstructionOfTypeKeyInstruction(),0===e.Instructions.length?e.Instructions.push(t):e.Instructions[0]instanceof o.ClefInstruction?e.Instructions.splice(1,0,t):e.Instructions.splice(0,0,t)}else{const e=new r.SourceStaffEntry(void 0,void 0);n.FirstInstructionsStaffEntries[i]=e,t.Parent=e,e.Instructions.push(t)}}}}if(h instanceof l.RhythmInstruction){const e=h;if(this.activeRhythm&&this.activeRhythm===e)this.abstractInstructions.splice(i,1);else if(this.activeRhythm=e,this.abstractInstructions.splice(i,1),this.currentMeasure)for(let i=this.inSourceMeasureInstrumentIndex;i<this.inSourceMeasureInstrumentIndex+t;i++){const t=e;let n;this.currentMeasure.FirstInstructionsStaffEntries[i]?(n=this.currentMeasure.FirstInstructionsStaffEntries[i],n.removeFirstInstructionOfTypeRhythmInstruction()):(n=new r.SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[i]=n),t.Parent=n,n.Instructions.push(t)}}}}saveClefInstructionAtEndOfMeasure(){for(let t=this.abstractInstructions.length-1;t>=0;t--){const e=this.abstractInstructions[t][0],i=this.abstractInstructions[t][1];if(i instanceof o.ClefInstruction){const n=i;if(!this.activeClefs[e-1]||n.ClefType!==this.activeClefs[e-1].ClefType||n.ClefType===this.activeClefs[e-1].ClefType&&n.Line!==this.activeClefs[e-1].Line){const i=new r.SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex+e-1]=i;const s=n;s.Parent=i,i.Instructions.push(s),this.activeClefs[e-1]=n,this.abstractInstructions.splice(t,1)}}}}getNoteDurationForTuplet(t){let e=new h.Fraction(0,1);const i=this.getNoteDurationFromTypeNode(t);if(t.element("time-modification")){const n=t.element("time-modification");if(n&&void 0!==n.element("actual-notes")&&n.element("normal-notes")){const t=n.element("actual-notes"),s=n.element("normal-notes");if(void 0!==t&&s){const n=parseInt(t.value,10),r=parseInt(s.value,10);e=new h.Fraction(r*i.Numerator,n*i.Denominator)}}}return e}readExpressionStaffNumber(t){let e=1;if(t.element("staff")){const n=t.element("staff");if(n)try{e=parseInt(n.value,10)}catch(i){const t=c.ITextTranslation.translateText("ReaderErrorMessages/ExpressionStaffError","Invalid Expression staff number -> set to default.");this.musicSheet.SheetErrors.pushMeasureError(t),e=1,m.default.debug("InstrumentReader.readExpressionStaffNumber",t,i)}}return e}readDivisionsFromNotes(){let t=0,e=this.currentXmlMeasureIndex,i=!1;for(;!i;){const s=this.xmlMeasureList[e].elements();for(let e=0,r=s.length;e<r;++e){const r=s[e];if("note"===r.name&&!r.element("time-modification")){const e=r.element("duration"),i=r.element("type");if(void 0!==e&&i){const s=i.value;let r=0;try{r=parseInt(e.value,10)}catch(n){m.default.debug("InstrumentReader.readDivisionsFromNotes",n);continue}switch(s){case"1024th":t=r/4*1024;break;case"512th":t=r/4*512;break;case"256th":t=r/4*256;break;case"128th":t=r/4*128;break;case"64th":t=r/4*64;break;case"32nd":t=r/4*32;break;case"16th":t=r/4*16;break;case"eighth":t=r/4*8;break;case"quarter":t=r/4*4;break;case"half":t=r/4*2;break;case"whole":t=r/4;break;case"breve":t=r/4/2;break;case"long":t=r/4/4;break;case"maxima":t=r/4/8}}}if(t>0){i=!0;break}}if(0===t&&(e++,e===this.xmlMeasureList.length)){const t=c.ITextTranslation.translateText("ReaderErrorMEssages/DivisionsError","Invalid divisions value at Instrument: ");throw new u.MusicSheetReadingException(t+this.instrument.Name)}}return t}}},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VoiceGenerator=void 0;const s=i(41),r=i(51),o=i(14),a=i(36),l=i(31),h=i(141),c=i(107),u=i(67),d=i(142),f=i(0),p=i(20),m=i(143),b=i(11),g=i(2),y=i(2),S=i(144),v=n(i(1)),x=i(2),E=i(34),_=i(145),w=i(76),T=i(80),M=i(39),P=i(172),L=i(3);e.VoiceGenerator=class{constructor(t,e,i,n,o){this.openBeams=[],this.beamNumberOffset=0,this.openTieDict={},this.currentOctaveShift=0,this.tupletDict={},this.openTupletNumber=0,this.staff=e,this.instrument=e.ParentInstrument,this.musicSheet=this.instrument.GetMusicSheet,this.slurReader=n,this.pluginManager=t,this.voice=o?new s.LinkedVoice(this.instrument,i,o):new r.Voice(this.instrument,i),this.instrument.Voices.push(this.voice),this.staff.Voices.push(this.voice),this.lyricsReader=new m.LyricsReader(this.musicSheet),this.articulationReader=new _.ArticulationReader}get GetVoice(){return this.voice}get OctaveShift(){return this.currentOctaveShift}set OctaveShift(t){this.currentOctaveShift=t}createVoiceEntry(t,e,i,n=!1,s=!1,r=!1){this.currentVoiceEntry=new o.VoiceEntry(t.clone(),this.voice,e,n,s,r),i&&this.voice.VoiceEntries.push(this.currentVoiceEntry)}read(t,e,i,n,s,r,o,a,l,h,c,d,m,b,g,y,S,v,x,E){this.currentStaffEntry=o,this.currentMeasure=a;try{this.currentNote=r?this.addRestNote(t.element("rest"),e,n,s,m,b,x):this.addSingleNote(t,e,n,i,s,c,d,m,b,g,y,S,v,x,E);const o=t.elements("lyric");void 0!==this.lyricsReader&&o&&(this.lyricsReader.addLyricEntry(o,this.currentVoiceEntry),this.voice.Parent.HasLyrics=!0);let a=!1;const p=t.element("notations");if(p){this.articulationReader&&this.readArticulations(p,this.currentVoiceEntry,this.currentNote);const e=p.elements("slur");void 0!==this.slurReader&&e.length>0&&!this.currentNote.ParentVoiceEntry.IsGrace&&this.slurReader.addSlur(e,this.currentNote);const i=p.elements("tuplet");i.length>0&&(this.openTupletNumber=this.addTuplet(t,i),a=!0);const n=p.element("arpeggiate");if(void 0!==n){let t;if(this.currentVoiceEntry.Arpeggio)t=this.currentVoiceEntry.Arpeggio;else{let e=!1;for(const i of this.currentStaffEntry.VoiceEntries)if(i.Arpeggio){e=!0,t=i.Arpeggio;break}if(!e){let e=T.ArpeggioType.ARPEGGIO_DIRECTIONLESS;const i=n.attribute("direction");if(i)switch(i.value){case"up":e=T.ArpeggioType.ROLL_UP;break;case"down":e=T.ArpeggioType.ROLL_DOWN;break;default:e=T.ArpeggioType.ARPEGGIO_DIRECTIONLESS}t=new T.Arpeggio(this.currentVoiceEntry,e),this.currentVoiceEntry.Arpeggio=t}}t.addNote(this.currentNote)}const s=p.elements("tied");s.length>0&&this.addTie(s,l,h,u.TieTypes.SIMPLE);const r=p.elements("slide");r.length>0&&this.addTie(r,l,h,u.TieTypes.SLIDE);const o=p.element("technical");if(o){const t=o.elements("hammer-on");t.length>0&&this.addTie(t,l,h,u.TieTypes.HAMMERON);const e=o.elements("pull-off");e.length>0&&this.addTie(e,l,h,u.TieTypes.PULLOFF)}const c=this.openTieDict;for(const t in c)if(c.hasOwnProperty(t)){const e=c[t];f.Fraction.plus(e.StartNote.ParentStaffEntry.Timestamp,e.Duration).lt(this.currentStaffEntry.Timestamp)&&delete c[t]}}void 0===t.element("time-modification")||a||this.handleTimeModificationNode(t)}catch(_){const t=p.ITextTranslation.translateText("ReaderErrorMessages/NoteError","Ignored erroneous Note.");this.musicSheet.SheetErrors.pushMeasureError(t)}return this.currentNote}checkForStaffEntryLink(t,e,i,n){const s=new S.StaffEntryLink(this.currentVoiceEntry);s.LinkStaffEntries.push(i),i.Link=s;const r=this.currentVoiceEntry.Timestamp.clone(),o=n.getVerticalContainerByTimestamp(r);return(i=o.StaffEntries[t])||(i=new l.SourceStaffEntry(o,e),o.StaffEntries[t]=i),i.VoiceEntries.push(this.currentVoiceEntry),s.LinkStaffEntries.push(i),i.Link=s,i}checkForOpenBeam(){this.openBeams.length>0&&this.currentNote&&this.handleOpenBeam()}checkOpenTies(){const t=this.openTieDict;for(const e in t)if(t.hasOwnProperty(e)){const i=t[e];f.Fraction.plus(i.StartNote.ParentStaffEntry.Timestamp,i.Duration).lt(i.StartNote.SourceMeasure.Duration)&&delete t[e]}}hasVoiceEntry(){return void 0!==this.currentVoiceEntry}readArticulations(t,e,i){const n=t.element("articulations");n&&this.articulationReader.addArticulationExpression(n,e);const s=t.element("fermata");s&&this.articulationReader.addFermata(s,e);const r=t.element("technical");r&&this.articulationReader.addTechnicalArticulations(r,e,i);const o=t.element("ornaments");o&&this.articulationReader.addOrnament(o,e)}addSingleNote(t,e,i,n,s,r,l,h,c,u,d,m,S,E,_){let T,M,L,A=0,C=g.AccidentalEnum.NONE,I=y.NoteEnum.C,R=y.NoteEnum.C,N=0,F=0;const B=t.elements();for(let o=0,a=B.length;o<a;++o){const t=B[o];try{if("pitch"===t.name){const e=t.elements();for(let t=0,i=e.length;t<i;++t){const i=e[t];M=void 0,L=void 0;try{if("step"===i.name){if(I=y.NoteEnum[i.value],void 0===I){const t=p.ITextTranslation.translateText("ReaderErrorMessages/NotePitchError","Invalid pitch while reading note.");throw this.musicSheet.SheetErrors.pushMeasureError(t),new b.MusicSheetReadingException(t,void 0)}}else if("alter"===i.name){if(A=parseFloat(i.value),isNaN(A)){const t=p.ITextTranslation.translateText("ReaderErrorMessages/NoteAlterationError","Invalid alteration while reading note.");throw this.musicSheet.SheetErrors.pushMeasureError(t),new b.MusicSheetReadingException(t,void 0)}C=x.Pitch.AccidentalFromHalfTones(A)}else if("octave"===i.name&&(N=parseInt(i.value,10),isNaN(N))){const t=p.ITextTranslation.translateText("ReaderErrorMessages/NoteOctaveError","Invalid octave value while reading note.");throw this.musicSheet.SheetErrors.pushMeasureError(t),new b.MusicSheetReadingException(t,void 0)}}catch(z){v.default.info("VoiceGenerator.addSingleNote read Step: ",z.message)}}}else if("accidental"===t.name)"natural"===t.value&&(C=g.AccidentalEnum.NATURAL);else if("unpitched"===t.name){const e=t.element("display-step"),i=t.element("display-octave");if(i&&(N=parseInt(i.value,10),F=N-3,l&&(N+=1),1===this.instrument.Staves[0].StafflineCount&&(F+=1)),e){I=y.NoteEnum[e.value.toUpperCase()];let t=0;[R,t]=x.Pitch.stepFromNoteEnum(I,-3),F+=t}}else"instrument"===t.name?t.firstAttribute&&(T=t.firstAttribute.value):"notehead"===t.name&&(M=t.value,t.attribute("filled")&&(L="yes"===t.attribute("filled").value))}catch(j){v.default.info("VoiceGenerator.addSingleNote: ",j)}}N-=x.Pitch.OctaveXmlDifference;const O=new x.Pitch(I,N,C),D=f.Fraction.createFromFraction(e);let k,V=-1,G=-1;const W=[],U=t.element("notations");if(U){const t=U.element("technical");if(t){const e=t.element("string");e&&(V=parseInt(e.value,10));const i=t.element("fret");i&&(G=parseInt(i.value,10)),t.elements("bend").forEach((function(t){const e=t.element("bend-alter");void 0!==t.element("release")?W.push({bendalter:parseInt(e.value,10),direction:"down"}):W.push({bendalter:parseInt(e.value,10),direction:"up"})}))}}return k=V<0||G<0?new a.Note(this.currentVoiceEntry,this.currentStaffEntry,D,O,this.currentMeasure):new P.TabNote(this.currentVoiceEntry,this.currentStaffEntry,D,O,this.currentMeasure,V,G,W,_),this.addNoteInfo(k,i,h,c,s,R,F,E,E),k.TypeLength=n,k.IsGraceNote=u,k.StemDirectionXml=d,k.TremoloStrokes=m,k.PlaybackInstrumentId=T,(void 0!==M&&"normal"!==M||void 0!==L)&&(k.Notehead=new w.Notehead(k,M,L)),d===o.StemDirectionType.None&&(S="#00000000"),this.currentVoiceEntry.Notes.push(k),this.currentVoiceEntry.StemDirectionXml=d,S&&(this.currentVoiceEntry.StemColorXml=S,this.currentVoiceEntry.StemColor=S,k.StemColorXml=S),t.elements("beam")&&!r&&this.createBeam(t,k),k}addRestNote(t,e,i,n,s,r,o){const l=f.Fraction.createFromFraction(e),h=t.element("display-step"),c=t.element("display-octave");let u,d,p;h&&c&&(u=y.NoteEnum[h.value.toUpperCase()],d=parseInt(c.value,10),p=new x.Pitch(u,d,g.AccidentalEnum.NONE));const m=new a.Note(this.currentVoiceEntry,this.currentStaffEntry,l,p,this.currentMeasure,!0);return this.addNoteInfo(m,i,s,r,n,u,d,o,o),this.currentVoiceEntry.Notes.push(m),this.openBeams.length>0&&this.openBeams.last().ExtendedNoteList.push(m),m}addNoteInfo(t,e,i,n,s,r,o,a,l){t.NoteTypeXml=e,t.PrintObject=i,t.IsCueNote=n,t.NormalNotes=s,t.displayStepUnpitched=r,t.displayOctaveUnpitched=o,t.NoteheadColorXml=a,t.NoteheadColor=a}createBeam(t,e){var i;try{const n=t.element("beam");let s;if(void 0!==n&&n.hasAttributes&&(s=n.attribute("number")),s){let n=parseInt(s.value,10);const r=t.elements("beam"),o=r[0].value;r&&("begin"===o?(n===(null===(i=this.openBeams.last())||void 0===i?void 0:i.BeamNumber)?(this.beamNumberOffset++,n+=this.beamNumberOffset):this.openBeams.last()&&this.handleOpenBeam(),this.openBeams.push(new h.Beam(n,this.beamNumberOffset))):n+=this.beamNumberOffset);let a=!1;if(!(n>0&&n<=this.openBeams.length&&this.openBeams[n-1]))return void v.default.debug("[OSMD] invalid beamnumber");for(let t=0,e=this.openBeams[n-1].Notes.length;t<e;++t){const e=this.openBeams[n-1].Notes[t];this.currentVoiceEntry===e.ParentVoiceEntry&&(a=!0)}a||(this.openBeams[n-1].addNoteToBeam(e),"end"===o&&this.endBeam())}}catch(n){const t=p.ITextTranslation.translateText("ReaderErrorMessages/BeamError","Error while reading beam.");throw this.musicSheet.SheetErrors.pushMeasureError(t),new b.MusicSheetReadingException("",n)}}endBeam(){this.openBeams.pop(),this.beamNumberOffset=Math.max(0,this.beamNumberOffset-1)}handleOpenBeam(){const t=this.openBeams.last();if(1===t.Notes.length)return t.Notes[0].NoteBeam=void 0,void this.endBeam();if(this.currentNote===E.CollectionUtil.last(t.Notes))this.endBeam();else{const e=E.CollectionUtil.last(t.Notes).ParentStaffEntry,i=this.currentMeasure.getVerticalContainerIndexByTimestamp(e.Timestamp),n=e.VerticalContainerParent.StaffEntries.indexOf(e);if(i<this.currentMeasure.VerticalSourceStaffEntryContainers.length-1){const t=this.currentMeasure.VerticalSourceStaffEntryContainers[i+1].StaffEntries[n];if(t)for(let e=0,i=t.VoiceEntries.length;e<i;++e){const i=t.VoiceEntries[e];if(i.ParentVoice===this.voice){const t=i.Notes[0];t.Length.lte(new f.Fraction(1,8))?(this.openBeams.last().addNoteToBeam(t),this.endBeam()):this.endBeam()}}}else this.endBeam()}}addTuplet(t,e){let i=!1;if(void 0!==e&&e.length>1){let n=t.element("time-modification");n&&(n=n.element("actual-notes"));const s=e;for(let e=0,r=s.length;e<r;++e){const r=s[e];if(void 0!==r&&r.attributes()){const e=r.attribute("bracket");e&&"yes"===e.value&&(i=!0);const s=r.attribute("placement"),o=s&&"below"===s.value,a=r.attribute("type");if(a&&"start"===a.value){let e=1;r.attribute("number")&&(e=parseInt(r.attribute("number").value,10));let s=0;if(n&&(s=parseInt(n.value,10),isNaN(s))){const t=p.ITextTranslation.translateText("ReaderErrorMessages/TupletNoteDurationError","Invalid tuplet note duration.");throw this.musicSheet.SheetErrors.pushMeasureError(t),new b.MusicSheetReadingException(t,void 0)}const a=new d.Tuplet(s,i);a.tupletLabelNumberPlacement=o?L.PlacementEnum.Below:L.PlacementEnum.Above,this.tupletDict[e]&&(delete this.tupletDict[e],0===Object.keys(this.tupletDict).length?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--),this.tupletDict[e]=a;const l=[];l.push(this.currentNote),a.Notes.push(l),a.Fractions.push(this.getTupletNoteDurationFromType(t)),this.currentNote.NoteTuplet=a,this.openTupletNumber=e}else if("stop"===a.value){let e=1;r.attribute("number")&&(e=parseInt(r.attribute("number").value,10));const i=this.tupletDict[e];if(i){const n=[];n.push(this.currentNote),i.Notes.push(n),i.Fractions.push(this.getTupletNoteDurationFromType(t)),this.currentNote.NoteTuplet=i,delete this.tupletDict[e],0===Object.keys(this.tupletDict).length?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--}}}}}else if(e[0]){const n=e[0];if(n.hasAttributes){const e=n.attribute("type").value;let s=1;n.attribute("number")&&(s=parseInt(n.attribute("number").value,10));const r=isNaN(s),o=n.attribute("bracket");o&&"yes"===o.value&&(i=!0);const a=n.attribute("placement"),l=a&&"below"===a.value;if("start"===e){let e=0,n=t.element("time-modification");if(n&&(n=n.element("actual-notes")),n&&(e=parseInt(n.value,10),isNaN(e))){const t=p.ITextTranslation.translateText("ReaderErrorMessages/TupletNoteDurationError","Invalid tuplet note duration.");throw this.musicSheet.SheetErrors.pushMeasureError(t),new b.MusicSheetReadingException(t)}r&&(this.openTupletNumber++,s=this.openTupletNumber);let o=this.tupletDict[s];o||(o=this.tupletDict[s]=new d.Tuplet(e,i),o.tupletLabelNumberPlacement=l?L.PlacementEnum.Below:L.PlacementEnum.Above);const a=[];a.push(this.currentNote),o.Notes.push(a),o.Fractions.push(this.getTupletNoteDurationFromType(t)),this.currentNote.NoteTuplet=o,this.openTupletNumber=s}else if("stop"===e){r&&(s=this.openTupletNumber);const e=this.tupletDict[this.openTupletNumber];if(e){const i=[];i.push(this.currentNote),e.Notes.push(i),e.Fractions.push(this.getTupletNoteDurationFromType(t)),this.currentNote.NoteTuplet=e,0===Object.keys(this.tupletDict).length?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--,delete this.tupletDict[s]}}}}return this.openTupletNumber}handleTimeModificationNode(t){if(this.tupletDict[this.openTupletNumber])try{const e=this.tupletDict[this.openTupletNumber],i=E.CollectionUtil.last(e.Notes);let n;i[0].ParentVoiceEntry.Timestamp.Equals(this.currentVoiceEntry.Timestamp)?n=i:(n=[],e.Notes.push(n),e.Fractions.push(this.getTupletNoteDurationFromType(t))),n.push(this.currentNote),this.currentNote.NoteTuplet=e}catch(e){const t=p.ITextTranslation.translateText("ReaderErrorMessages/TupletNumberError","Invalid tuplet number.");throw this.musicSheet.SheetErrors.pushMeasureError(t),e}else if(this.currentVoiceEntry.Notes.length>0){const t=this.currentVoiceEntry.Notes[0];if(t.NoteTuplet){const e=t.NoteTuplet;E.CollectionUtil.last(e.Notes).push(this.currentNote),this.currentNote.NoteTuplet=e}}}addTie(t,e,i,n){if(t)if(1===t.length){const e=t[0];if(void 0!==e&&e.attributes()){const t=e.attribute("type").value;try{if("start"===t){const t=this.findCurrentNoteInTieDict(this.currentNote);t<0&&delete this.openTieDict[t];const e=this.getNextAvailableNumberForTie(),i=new c.Tie(this.currentNote,n);this.openTieDict[e]=i}else if("stop"===t){const t=this.findCurrentNoteInTieDict(this.currentNote),e=this.openTieDict[t];e&&(e.AddNote(this.currentNote),delete this.openTieDict[t])}}catch(s){const t=p.ITextTranslation.translateText("ReaderErrorMessages/TieError","Error while reading tie.");this.musicSheet.SheetErrors.pushMeasureError(t)}}}else if(2===t.length){const t=this.findCurrentNoteInTieDict(this.currentNote);t>=0&&this.openTieDict[t].AddNote(this.currentNote)}}getNextAvailableNumberForTie(){const t=Object.keys(this.openTieDict);if(0===t.length)return 1;t.sort(((t,e)=>+t-+e));for(let e=0;e<t.length;e++)if(""+(e+1)!==t[e])return e+1;return+t[t.length-1]+1}findCurrentNoteInTieDict(t){const e=this.openTieDict;for(const i in e)if(e.hasOwnProperty(i)){const n=e[i],s=n.Notes[0],r=t;if(n.Pitch.FundamentalNote===t.Pitch.FundamentalNote&&n.Pitch.Octave===t.Pitch.Octave)return parseInt(i,10);if(void 0!==s.StringNumberTab&&s.StringNumberTab===r.StringNumberTab)return parseInt(i,10)}return-1}getTupletNoteDurationFromType(t){if(t.element("type")){const i=t.element("type");if(i){const t=i.value;try{return M.NoteTypeHandler.getNoteDurationFromType(t)}catch(e){const t=p.ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid note duration.");throw this.musicSheet.SheetErrors.pushMeasureError(t),new b.MusicSheetReadingException("",e)}}}}}},function(t,e,i){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.BeamEnum=e.Beam=void 0,e.Beam=class{constructor(t=1,e=0){this.notes=[],this.extendedNoteList=[],this.BeamNumberOffsetToXML=0,this.BeamNumber=t,this.BeamNumberOffsetToXML=e}get Notes(){return this.notes}set Notes(t){this.notes=t}get ExtendedNoteList(){return this.extendedNoteList}set ExtendedNoteList(t){this.extendedNoteList=t}addNoteToBeam(t){t&&(t.NoteBeam=this,this.notes.push(t),this.extendedNoteList.push(t))}},(n=e.BeamEnum||(e.BeamEnum={}))[n.BeamNone=-1]="BeamNone",n[n.BeamBegin=0]="BeamBegin",n[n.BeamContinue=1]="BeamContinue",n[n.BeamEnd=2]="BeamEnd",n[n.BeamForward=3]="BeamForward",n[n.BeamBackward=4]="BeamBackward"},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.Tuplet=void 0,e.Tuplet=class{constructor(t,e=!1){this.notes=[],this.fractions=[],this.tupletLabelNumber=t,this.bracket=e}get TupletLabelNumber(){return this.tupletLabelNumber}set TupletLabelNumber(t){this.tupletLabelNumber=t}get Notes(){return this.notes}set Notes(t){this.notes=t}get Fractions(){return this.fractions}set Fractions(t){this.fractions=t}get Bracket(){return this.bracket}set Bracket(t){this.bracket=t}getNoteIndex(t){for(let e=this.notes.length-1;e>=0;e--)for(let i=0;i<this.notes[e].length;i++)if(t===this.notes[e][i])return e;return 0}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.LyricsReader=void 0;const n=i(169),s=i(170),r=i(20);e.LyricsReader=class{constructor(t){this.openLyricWords={},this.musicSheet=t}addLyricEntry(t,e){var i,o;if(t){const h=t;for(let t=0,c=h.length;t<c;++t){const c=h[t];try{let t="single";if(c.element("text")){let l=c.element("text");if(c.element("syllabic")&&(t=c.element("syllabic").value),l){let h="";const u=c.elements();for(const t of u)"text"!==t.name&&"elision"!==t.name||(h+=t.value);if(h=h.replace(" "," "),void 0!==c.element("elision")&&"-"===h){const e=c.elements();let i,n,s=0;for(let t=0;t<e.length;t++)if("elision"===e[t].name){s=t;break}if(s>0)for(let t=s;t<e.length;t++){const s=e[t];"text"===s.name&&(i=s),"syllabic"===s.name&&(n=s)}void 0!==i&&n&&(l=i,t="middle")}let d,f=1,p=!1;if(void 0!==c.attributes()&&c.attribute("number")){try{f=parseInt(c.attribute("number").value,10)}catch(a){p=!0}if(p=p||isNaN(f),p)try{const t=c.attribute("number").value.toLowerCase().split("verse");t.length>1&&(f=parseInt(t[1],10))}catch(a){const t=r.ITextTranslation.translateText("ReaderErrorMessages/LyricVerseNumberError","Invalid lyric verse number");this.musicSheet.SheetErrors.pushMeasureError(t);continue}}if("single"===t||"end"===t){if(this.openLyricWords[f]){this.currentLyricWord=this.openLyricWords[f];const t=this.currentLyricWord.Syllables.length;d=new s.LyricsEntry(h,f,this.currentLyricWord,e,t),this.currentLyricWord.Syllables.push(d),delete this.openLyricWords[f],this.currentLyricWord=void 0}else d=new s.LyricsEntry(h,f,void 0,e);d.extend=void 0!==c.element("extend")}else if("begin"===t)this.openLyricWords[f]&&(delete this.openLyricWords[f],this.currentLyricWord=void 0),this.currentLyricWord=new n.LyricWord,this.openLyricWords[f]=this.currentLyricWord,d=new s.LyricsEntry(h,f,this.currentLyricWord,e,0),this.currentLyricWord.Syllables.push(d);else if("middle"===t)if(this.openLyricWords[f]){this.currentLyricWord=this.openLyricWords[f];const t=this.currentLyricWord.Syllables.length;d=new s.LyricsEntry(h,f,this.currentLyricWord,e,t),this.currentLyricWord.Syllables.push(d)}else d=new s.LyricsEntry(h,f,void 0,e);d&&(e.LyricsEntries[f]||(e.LyricsEntries.setValue(f,d),(null===(o=null===(i=e.ParentSourceStaffEntry)||void 0===i?void 0:i.VerticalContainerParent)||void 0===o?void 0:o.ParentMeasure)&&(e.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.hasLyrics=!0)),e.ParentVoice.Parent.LyricVersesNumbers[f]||e.ParentVoice.Parent.LyricVersesNumbers.push(f))}}}catch(l){const t=r.ITextTranslation.translateText("ReaderErrorMessages/LyricError","Error while reading lyric entry.");this.musicSheet.SheetErrors.pushMeasureError(t);continue}}e.ParentVoice.Parent.LyricVersesNumbers=e.ParentVoice.Parent.LyricVersesNumbers.filter(((t,e,i)=>i.indexOf(t)===e))}}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.StaffEntryLink=void 0,e.StaffEntryLink=class{constructor(t){this.linkStaffEntries=[],this.voiceEntry=t}get GetVoiceEntry(){return this.voiceEntry}get LinkStaffEntries(){return this.linkStaffEntries}set LinkStaffEntries(t){this.linkStaffEntries=t}}},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ArticulationReader=void 0;const s=i(14),r=n(i(1)),o=i(146),a=i(50),l=i(3),h=i(2),c=i(171);e.ArticulationReader=class{getAccEnumFromString(t){switch(t){case"sharp":return h.AccidentalEnum.SHARP;case"flat":return h.AccidentalEnum.FLAT;case"natural":return h.AccidentalEnum.NATURAL;case"double-sharp":case"sharp-sharp":return h.AccidentalEnum.DOUBLESHARP;case"double-flat":case"flat-flat":return h.AccidentalEnum.DOUBLEFLAT;case"quarter-sharp":return h.AccidentalEnum.QUARTERTONESHARP;case"quarter-flat":return h.AccidentalEnum.QUARTERTONEFLAT;case"triple-sharp":return h.AccidentalEnum.TRIPLESHARP;case"triple-flat":return h.AccidentalEnum.TRIPLEFLAT;default:return h.AccidentalEnum.NONE}}addArticulationExpression(t,e){var i,n;if(void 0!==t&&t.elements().length>0){const a=t.elements();for(let t=0,h=a.length;t<h;++t){const h=a[t];let u=h.name;try{u=u.replace("-","");const t=s.ArticulationEnum[u];if(s.VoiceEntry.isSupportedArticulation(t)){let r=l.PlacementEnum.NotYetDefined;const o=null===(i=h.attribute("placement"))||void 0===i?void 0:i.value;"above"===o?r=l.PlacementEnum.Above:"below"===o&&(r=l.PlacementEnum.Below);const a=new c.Articulation(t,r);if("staccato"===u&&e.Articulations.length>0&&e.Articulations[0].articulationEnum!==s.ArticulationEnum.staccato&&e.Articulations.splice(0,0,a),"strongaccent"===u){const t=null===(n=null==h?void 0:h.attribute("type"))||void 0===n?void 0:n.value;"up"===t?a.articulationEnum=s.ArticulationEnum.marcatoup:"down"===t&&(a.articulationEnum=s.ArticulationEnum.marcatodown)}e.hasArticulation(a)||e.Articulations.push(a)}}catch(o){const t="Invalid note articulation.";return void r.default.debug("addArticulationExpression",t,o)}}}}addFermata(t,e){var i;let n=s.ArticulationEnum.fermata;t.attributes().length>0&&t.attribute("type")&&"inverted"===t.attribute("type").value&&(n=s.ArticulationEnum.invertedfermata);let r=l.PlacementEnum.Above;"below"===(null===(i=t.attribute("placement"))||void 0===i?void 0:i.value)&&(r=l.PlacementEnum.Below),e.Articulations.push(new c.Articulation(n,r))}addTechnicalArticulations(t,e,i){var n,r;const a={bend:s.ArticulationEnum.bend,"down-bow":s.ArticulationEnum.downbow,"open-string":s.ArticulationEnum.naturalharmonic,"snap-pizzicato":s.ArticulationEnum.snappizzicato,stopped:s.ArticulationEnum.lefthandpizzicato,"up-bow":s.ArticulationEnum.upbow};for(const s in a){if(!a.hasOwnProperty(s))continue;const i=a[s],o=t.element(s);if(o){let t;"above"===(null===(n=o.attribute("placement"))||void 0===n?void 0:n.value)&&(t=l.PlacementEnum.Above),"below"===(null===(r=o.attribute("placement"))||void 0===r?void 0:r.value)&&(t=l.PlacementEnum.Below);const s=new c.Articulation(i,t);e.hasArticulation(s)||e.Articulations.push(s)}}const h=t.element("fingering");if(h){const t=this.createTechnicalInstruction(h,i);t.type=o.TechnicalInstructionType.Fingering,i.Fingering=t,e.TechnicalInstructions.push(t)}const u=t.element("string");if(u){const t=this.createTechnicalInstruction(u,i);t.type=o.TechnicalInstructionType.String,i.StringInstruction=t,e.TechnicalInstructions.push(t)}}createTechnicalInstruction(t,e){const i=new o.TechnicalInstruction;i.sourceNote=e,i.value=t.value;const n=t.attribute("placement");return i.placement=this.getPlacement(n),i}getPlacement(t,e=l.PlacementEnum.NotYetDefined){if(e!==l.PlacementEnum.NotYetDefined)return e;if(!t)return l.PlacementEnum.NotYetDefined;switch(t.value){case"above":return l.PlacementEnum.Above;case"below":return l.PlacementEnum.Below;case"left":return l.PlacementEnum.Left;case"right":return l.PlacementEnum.Right;default:return l.PlacementEnum.NotYetDefined}}addOrnament(t,e){if(t){let i;const n={"delayed-inverted-turn":a.OrnamentEnum.DelayedInvertedTurn,"delayed-turn":a.OrnamentEnum.DelayedTurn,"inverted-mordent":a.OrnamentEnum.InvertedMordent,"inverted-turn":a.OrnamentEnum.InvertedTurn,mordent:a.OrnamentEnum.Mordent,"trill-mark":a.OrnamentEnum.Trill,turn:a.OrnamentEnum.Turn};for(const e in n){if(!n.hasOwnProperty(e))continue;const s=t.element(e);if(s){i=new a.OrnamentContainer(n[e]);const t=s.attribute("placement");t&&"below"===t.value&&(i.placement=l.PlacementEnum.Below)}}if(i){const n=t.elements("accidental-mark");if(n){let t=l.PlacementEnum.Below,e=h.AccidentalEnum.NONE;const s=n;for(let n=0,r=s.length;n<r;++n){const r=s[n];let o=r.value;e=this.getAccEnumFromString(o);const a=r.attribute("placement");r.hasAttributes&&a&&(o=a.value,"above"===o?t=l.PlacementEnum.Above:"below"===o&&(t=l.PlacementEnum.Below)),t===l.PlacementEnum.Above?i.AccidentalAbove=e:t===l.PlacementEnum.Below&&(i.AccidentalBelow=e)}}e.OrnamentContainer=i}}}}},function(t,e,i){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.TechnicalInstruction=e.TechnicalInstructionType=void 0,(n=e.TechnicalInstructionType||(e.TechnicalInstructionType={}))[n.Fingering=0]="Fingering",n[n.String=1]="String",e.TechnicalInstruction=class{}},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ChordSymbolReader=void 0;const s=i(48),r=i(2),o=i(20),a=n(i(1));e.ChordSymbolReader=class{static readChordSymbol(t,e,i){const n=t.element("root"),l=t.element("kind"),h=l.attribute("text");if(!n||!l)return;const c=n.element("root-step"),u=n.element("root-alter");if(!c)return;let d;try{d=r.NoteEnum[c.value.trim()]}catch(x){const t=o.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return e.SheetErrors.pushMeasureError(t),void a.default.debug("InstrumentReader.readChordSymbol",t,x)}let f=r.AccidentalEnum.NONE;if(u)try{f=r.Pitch.AccidentalFromHalfTones(parseInt(u.value,10))}catch(x){const t=o.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");e.SheetErrors.pushMeasureError(t),a.default.debug("InstrumentReader.readChordSymbol",t,x)}const p=new r.Pitch(d,1,f);let m,b,g=l.value.trim().replace("-","");if(h)switch(h.value){case"aug":g="augmented";break;case"dim":g="diminished"}try{m=s.ChordSymbolEnum[g]}catch(x){const t=o.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return e.SheetErrors.pushMeasureError(t),void a.default.debug("InstrumentReader.readChordSymbol",t,x)}const y=t.element("bass");if(y){const t=y.element("bass-step"),i=y.element("bass-alter");let n=r.NoteEnum.C;if(t)try{n=r.NoteEnum[t.value.trim()]}catch(E){const t=o.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return e.SheetErrors.pushMeasureError(t),void a.default.debug("InstrumentReader.readChordSymbol",t,E)}let s=r.AccidentalEnum.NONE;if(i)try{s=r.Pitch.AccidentalFromHalfTones(parseInt(i.value,10))}catch(E){const t=o.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");e.SheetErrors.pushMeasureError(t),a.default.debug("InstrumentReader.readChordSymbol",t,E)}b=new r.Pitch(n,1,s)}const S=[],v=t.elements("degree");for(const _ of v)if(_){const t=_.element("degree-value"),i=_.element("degree-alter"),n=_.element("degree-type");if(!t||!i||!n)return;let l,h,c;try{l=parseInt(t.value.trim(),10)}catch(E){const t=o.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return e.SheetErrors.pushMeasureError(t),void a.default.debug("InstrumentReader.readChordSymbol",t,E)}try{h=r.Pitch.AccidentalFromHalfTones(parseInt(i.value,10))}catch(E){const t=o.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return e.SheetErrors.pushMeasureError(t),void a.default.debug("InstrumentReader.readChordSymbol",t,E)}try{c=s.ChordDegreeText[n.value.trim().toLowerCase()]}catch(E){const t=o.ITextTranslation.translateText("ReaderErrorMessages/ChordSymbolError","Invalid chord symbol");return e.SheetErrors.pushMeasureError(t),void a.default.debug("InstrumentReader.readChordSymbol",t,E)}S.push(new s.Degree(l,h,c))}return new s.ChordSymbolContainer(p,m,b,S,e.Rules)}}},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ExpressionReader=void 0;const s=i(0),r=i(104),o=i(32),a=i(56),l=i(38),h=i(30),c=i(103),u=i(37),d=i(64),f=i(65),p=i(3),m=i(9),b=i(20),g=n(i(1)),y=i(21),S=i(105);e.ExpressionReader=class{constructor(t,e,i){this.musicSheet=t,this.staffNumber=i,this.globalStaffIndex=t.getGlobalStaffIndexOfFirstStaff(e)+(i-1),this.initialize()}readExpressionParameters(t,e,i,n,r,o,a){this.initialize();const l=t.element("offset");if(void 0!==l&&!a)try{this.offsetDivisions=parseInt(l.value,10)}catch(u){const t="ReaderErrorMessages/ExpressionOffsetError, Invalid expression offset -> set to default.";g.default.debug("ExpressionReader.readExpressionParameters",t,u),this.musicSheet.SheetErrors.pushMeasureError(t),this.offsetDivisions=0}this.directionTimestamp=s.Fraction.createFromFraction(n);let h=new s.Fraction(Math.abs(this.offsetDivisions),4*i);this.offsetDivisions>0?n.RealValue>0?(h=s.Fraction.multiply(s.Fraction.minus(n,r),h),this.directionTimestamp=s.Fraction.plus(h,n)):this.directionTimestamp=s.Fraction.createFromFraction(h):this.offsetDivisions<0&&(n.RealValue>0?(h=s.Fraction.multiply(s.Fraction.minus(n,r),h),this.directionTimestamp=s.Fraction.minus(n,h)):this.directionTimestamp=s.Fraction.createFromFraction(h));const c=t.attribute("placement");if(c)try{const t=c.value;"below"===t?this.placement=p.PlacementEnum.Below:"above"===t&&(this.placement=p.PlacementEnum.Above)}catch(u){const t=b.ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement -> set to default.");g.default.debug("ExpressionReader.readExpressionParameters",t,u),this.musicSheet.SheetErrors.pushMeasureError(t),this.placement=p.PlacementEnum.Below}if(this.placement===p.PlacementEnum.NotYetDefined)try{const e=t.element("direction-type");if(e){const t=e.element("dynamics");if(t){const e=t.attribute("default-y");e&&this.readExpressionPlacement(e,"read dynamics y pos")}const i=e.element("wedge");if(i){const t=i.attribute("default-y");t&&this.readExpressionPlacement(t,"read wedge y pos")}const n=e.element("words");if(n){const t=n.attribute("default-y");t&&this.readExpressionPlacement(t,"read words y pos")}const s=e.element("rehearsal");if(s){const t=s.attribute("default-y");t&&this.readExpressionPlacement(t,"read rehearsal pos")}}}catch(u){const t=b.ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement -> set to default.");g.default.debug("ExpressionReader.readExpressionParameters",t,u),this.musicSheet.SheetErrors.pushMeasureError(t),this.placement=p.PlacementEnum.Below}this.placement===p.PlacementEnum.NotYetDefined&&(e.Staves.length>1?this.placement=p.PlacementEnum.Below:e.HasLyrics?this.placement=p.PlacementEnum.Above:this.placement=p.PlacementEnum.Below)}read(t,e,i){let n=!1,r=!1;const o=t.element("sound");if(o){const t=o.attribute("tempo"),i=o.attribute("dynamics");if(t){const i=t.value.match(/\d+/);this.soundTempo=void 0!==i?parseInt(i[0],10):100,e.TempoInBPM=this.soundTempo,0===this.musicSheet.DefaultStartTempoInBpm&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,n=!0}if(i){const t=i.value.match(/\d+/);this.soundDynamic=void 0!==t?parseInt(t[0],10):100,r=!0}}const a=t.element("direction-type");if(!a)return;let l=a.element("metronome");if(l){const t=l.element("beat-unit"),n=void 0!==l.element("beat-unit-dot"),r=l.element("per-minute");if(void 0!==t&&r){l.hasAttributes&&void 0!==l.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(i));const o=parseInt(r.value,10);this.createNewTempoExpressionIfNeeded(e);const a=new u.InstantaneousTempoExpression(void 0,this.placement,this.staffNumber,o,this.currentMultiTempoExpression,!0);a.parentMeasure=e,this.soundTempo=o,e.TempoInBPM=this.soundTempo,0===this.musicSheet.DefaultStartTempoInBpm&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,a.dotted=n,a.beatUnit=t.value,this.currentMultiTempoExpression.addExpression(a,""),this.currentMultiTempoExpression.CombinedExpressionsText="test"}}else if(l=a.element("dynamics"),l){const n=void 0!==t.element("notations");this.interpretInstantaneousDynamics(l,e,i,n)}else if(l=a.element("words"),l)if(n){this.createNewTempoExpressionIfNeeded(e),this.currentMultiTempoExpression.CombinedExpressionsText=l.value;const t=new u.InstantaneousTempoExpression(l.value,this.placement,this.staffNumber,this.soundTempo,this.currentMultiTempoExpression);this.currentMultiTempoExpression.addExpression(t,"")}else r||this.interpretWords(l,e,i);else l=a.element("wedge"),l?this.interpretWedge(l,e,i,e.MeasureNumber):(l=a.element("rehearsal"),l&&this.interpretRehearsalMark(l,e,i,e.MeasureNumber))}checkForOpenExpressions(t,e){this.openContinuousDynamicExpression&&(this.createNewMultiExpressionIfNeeded(t,e),this.closeOpenContinuousDynamic()),this.openContinuousTempoExpression&&this.closeOpenContinuousTempo(s.Fraction.plus(t.AbsoluteTimestamp,e))}addOctaveShift(t,e,i){let n=1;const s=t.element("staff");if(s)try{n=parseInt(s.value,10)}catch(o){const t=b.ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftStaffError","Invalid octave shift staff number -> set to default");this.musicSheet.SheetErrors.pushMeasureError(t),n=1,g.default.debug("ExpressionReader.addOctaveShift",t,o)}const r=t.element("direction-type");if(r){const t=r.element("octave-shift");if(void 0!==t&&t.hasAttributes)try{if(t.attribute("size")){const s=parseInt(t.attribute("size").value,10);let r=0;if(8===s?r=1:15===s&&(r=2),t.attribute("type")){const s=t.attribute("type").value;if("up"===s||"down"===s){const t=new h.OctaveShift(s,r);t.StaffNumber=n,this.createNewMultiExpressionIfNeeded(e),this.getMultiExpression.OctaveShiftStart=t,t.ParentStartMultiExpression=this.getMultiExpression,this.openOctaveShift=t}else"stop"===s&&this.openOctaveShift&&(this.createNewMultiExpressionIfNeeded(e,i),this.getMultiExpression.OctaveShiftEnd=this.openOctaveShift,this.openOctaveShift.ParentEndMultiExpression=this.getMultiExpression,this.openOctaveShift=void 0)}}}catch(a){const t=b.ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftError","Error while reading octave shift.");this.musicSheet.SheetErrors.pushMeasureError(t),g.default.debug("ExpressionReader.addOctaveShift",t,a)}}}initialize(){this.placement=p.PlacementEnum.NotYetDefined,this.soundTempo=0,this.soundDynamic=0,this.offsetDivisions=0}readExpressionPlacement(t,e){try{const e=parseInt(t.value,10);e<0?this.placement=p.PlacementEnum.Below:e>0&&(this.placement=p.PlacementEnum.Above)}catch(i){g.default.debug("ExpressionReader.readExpressionParameters",e,i)}}interpretInstantaneousDynamics(t,e,i,n){if(t.hasElements){t.hasAttributes&&t.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(i));let r=t.elements()[0].name;if("other-dynamics"===r&&(r=t.elements()[0].value),r){n?this.createNewMultiExpressionIfNeeded(e,s.Fraction.createFromFraction(i)):this.createNewMultiExpressionIfNeeded(e),void 0!==this.openContinuousDynamicExpression&&this.openContinuousDynamicExpression.StartMultiExpression!==this.getMultiExpression&&this.closeOpenContinuousDynamic();const t=new l.InstantaneousDynamicExpression(r,this.soundDynamic,this.placement,this.staffNumber,e);this.getMultiExpression.addExpression(t,""),this.initialize(),this.activeInstantaneousDynamic?this.activeInstantaneousDynamic.DynEnum=t.DynEnum:this.activeInstantaneousDynamic=new l.InstantaneousDynamicExpression(r,0,p.PlacementEnum.NotYetDefined,1,e)}}}interpretWords(t,e,i){const n=t.value;let r;const o=t.attribute("font-style");if(o&&"italic"===o.value&&(r=y.FontStyles.Italic),n.length>0){if(t.hasAttributes&&t.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(i)),this.checkIfWordsNodeIsRepetitionInstruction(n))return;this.fillMultiOrTempoExpression(n,e,r),this.initialize()}}interpretWedge(t,e,i,n){void 0!==t&&t.hasAttributes&&t.attribute("default-x")&&(this.directionTimestamp=s.Fraction.createFromFraction(i)),this.createNewMultiExpressionIfNeeded(e),this.addWedge(t,e),this.initialize()}interpretRehearsalMark(t,e,i,n){e.rehearsalExpression=new S.RehearsalExpression(t.value,this.placement)}createNewMultiExpressionIfNeeded(t,e){e||(e=this.directionTimestamp),(!this.getMultiExpression||this.getMultiExpression&&(this.getMultiExpression.SourceMeasureParent!==t||this.getMultiExpression.SourceMeasureParent===t&&this.getMultiExpression.Timestamp!==e))&&(this.getMultiExpression=new c.MultiExpression(t,s.Fraction.createFromFraction(e)),t.StaffLinkedExpressions[this.globalStaffIndex].push(this.getMultiExpression))}createNewTempoExpressionIfNeeded(t){this.currentMultiTempoExpression&&this.currentMultiTempoExpression.SourceMeasureParent===t&&this.currentMultiTempoExpression.Timestamp===this.directionTimestamp||(this.currentMultiTempoExpression=new r.MultiTempoExpression(t,s.Fraction.createFromFraction(this.directionTimestamp)),t.TempoExpressions.push(this.currentMultiTempoExpression))}addWedge(t,e){if(void 0!==t&&t.hasAttributes){const n=t.attribute("type").value.toLowerCase();try{if("crescendo"===n||"diminuendo"===n){const t=new o.ContinuousDynamicExpression(o.ContDynamicEnum[n],this.placement,this.staffNumber,e);this.openContinuousDynamicExpression&&this.closeOpenContinuousDynamic(),this.openContinuousDynamicExpression=t,this.getMultiExpression.StartingContinuousDynamic=t,t.StartMultiExpression=this.getMultiExpression,void 0!==this.activeInstantaneousDynamic&&this.activeInstantaneousDynamic.StaffNumber===t.StaffNumber&&(this.activeInstantaneousDynamic=void 0)}else"stop"===n&&this.openContinuousDynamicExpression&&this.closeOpenContinuousDynamic()}catch(i){const t="ReaderErrorMessages/WedgeError, Error while reading Crescendo / Diminuendo.";this.musicSheet.SheetErrors.pushMeasureError(t),g.default.debug("ExpressionReader.addWedge",t,i)}}}fillMultiOrTempoExpression(t,e,i){if(!t)return;const n=t.trim();this.createExpressionFromString("",n,e,t,i)}createExpressionFromString(t,e,i,n,s){if(u.InstantaneousTempoExpression.isInputStringInstantaneousTempo(e)||a.ContinuousTempoExpression.isInputStringContinuousTempo(e)){if(i.TempoExpressions.length>0)for(let t=0,n=i.TempoExpressions.length;t<n;++t){const n=i.TempoExpressions[t];if(n.Timestamp===this.directionTimestamp&&void 0!==n.InstantaneousTempo&&-1!==n.InstantaneousTempo.Label.indexOf(e))return!1}if(this.createNewTempoExpressionIfNeeded(i),this.currentMultiTempoExpression.CombinedExpressionsText=n,u.InstantaneousTempoExpression.isInputStringInstantaneousTempo(e)){const i=new u.InstantaneousTempoExpression(e,this.placement,this.staffNumber,this.soundTempo,this.currentMultiTempoExpression);return this.currentMultiTempoExpression.addExpression(i,t),!0}if(a.ContinuousTempoExpression.isInputStringContinuousTempo(e)){const i=new a.ContinuousTempoExpression(e,this.placement,this.staffNumber,this.currentMultiTempoExpression);return this.currentMultiTempoExpression.addExpression(i,t),!0}}if(l.InstantaneousDynamicExpression.isInputStringInstantaneousDynamic(e)||o.ContinuousDynamicExpression.isInputStringContinuousDynamic(e)){if(this.createNewMultiExpressionIfNeeded(i),l.InstantaneousDynamicExpression.isInputStringInstantaneousDynamic(e)){void 0===this.openContinuousDynamicExpression||this.openContinuousDynamicExpression.EndMultiExpression||this.closeOpenContinuousDynamic();const n=new l.InstantaneousDynamicExpression(e,this.soundDynamic,this.placement,this.staffNumber,i);return this.getMultiExpression.addExpression(n,t),!0}if(o.ContinuousDynamicExpression.isInputStringContinuousDynamic(e)){const n=new o.ContinuousDynamicExpression(void 0,this.placement,this.staffNumber,i,e);return void 0===this.openContinuousDynamicExpression||this.openContinuousDynamicExpression.EndMultiExpression||this.closeOpenContinuousDynamic(),void 0!==this.activeInstantaneousDynamic&&this.activeInstantaneousDynamic.StaffNumber===n.StaffNumber&&(this.activeInstantaneousDynamic=void 0),this.openContinuousDynamicExpression=n,n.StartMultiExpression=this.getMultiExpression,this.getMultiExpression.addExpression(n,t),!0}}if(d.MoodExpression.isInputStringMood(e)){this.createNewMultiExpressionIfNeeded(i),i.hasMoodExpressions=!0;const n=new d.MoodExpression(e,this.placement,this.staffNumber);return n.fontStyle=s,this.getMultiExpression.addExpression(n,t),!0}if(this.createNewMultiExpressionIfNeeded(i),i.TempoExpressions.length>0)for(let o=0,a=i.TempoExpressions.length;o<a;++o){const t=i.TempoExpressions[o];if(t.Timestamp===this.directionTimestamp&&void 0!==t.InstantaneousTempo&&t.EntriesList.length>0&&!this.hasDigit(e)&&this.globalStaffIndex>0){if(t.EntriesList[0].label.indexOf(e)>=0)return!1;break}}let r=m.TextAlignmentEnum.CenterBottom;this.musicSheet.Rules.CompactMode&&(r=m.TextAlignmentEnum.LeftBottom);const h=new f.UnknownExpression(e,this.placement,r,this.staffNumber);return h.fontStyle=s,this.getMultiExpression.addExpression(h,t),!1}closeOpenContinuousDynamic(){this.openContinuousDynamicExpression.EndMultiExpression=this.getMultiExpression,this.getMultiExpression.EndingContinuousDynamic=this.openContinuousDynamicExpression,this.openContinuousDynamicExpression=void 0}closeOpenContinuousTempo(t){this.openContinuousTempoExpression.AbsoluteEndTimestamp=t,this.openContinuousTempoExpression=void 0}checkIfWordsNodeIsRepetitionInstruction(t){return"coda"===(t=t.trim().toLowerCase())||"tocoda"===t||"to coda"===t||"fine"===t||"d.c."===t||"dacapo"===t||"da capo"===t||"d.s."===t||"dalsegno"===t||"dal segno"===t||"d.c. al fine"===t||"d.s. al fine"===t||"d.c. al coda"===t||"d.s. al coda"===t}hasDigit(t){return/\d/.test(t)}}},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SlurReader=void 0;const s=i(173),r=n(i(1)),o=i(20),a=i(102);e.SlurReader=class{constructor(t){this.openSlurDict={},this.musicSheet=t}addSlur(t,e){try{if(t)for(const n of t)if(n.attributes().length>0){const t=n.attribute("type").value;let o=1;try{n.attribute("number")&&(o=parseInt(n.attribute("number").value,10))}catch(i){r.default.debug("VoiceGenerator.addSlur number: ",i)}let l=a.PlacementEnum.NotYetDefined;const h=n.attribute("placement");h&&h.value&&("above"===h.value?l=a.PlacementEnum.Above:"below"===h.value&&(l=a.PlacementEnum.Below));const c=n.attribute("orientation");if(c&&c.value&&("over"===c.value?l=a.PlacementEnum.Above:"under"===c.value&&(l=a.PlacementEnum.Below)),"start"===t){let t=this.openSlurDict[o];t||(t=new s.Slur,this.openSlurDict[o]=t),t.StartNote=e,t.PlacementXml=l}else if("stop"===t){const t=this.openSlurDict[o];t&&(t.EndNote=e,e.checkForDoubleSlur(t)||(e.NoteSlurs.push(t),t.StartNote.NoteSlurs.push(t)),delete this.openSlurDict[o])}}}catch(n){const t=o.ITextTranslation.translateText("ReaderErrorMessages/SlurError","Error while reading slur.");this.musicSheet.SheetErrors.pushMeasureError(t)}}}},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.SubInstrument=void 0;const s=i(7),r=n(i(1));class o{constructor(t){this.parentInstrument=t,this.fixedKey=-1,this.name=this.parseMidiInstrument(this.parentInstrument.Name),this.midiInstrumentID=o.midiInstrument[this.name],this.volume=1}get ParentInstrument(){return this.parentInstrument}static isPianoInstrument(t){return t===s.MidiInstrument.Acoustic_Grand_Piano||t===s.MidiInstrument.Bright_Acoustic_Piano||t===s.MidiInstrument.Electric_Grand_Piano||t===s.MidiInstrument.Electric_Piano_1||t===s.MidiInstrument.Electric_Piano_2}setMidiInstrument(t){this.midiInstrumentID=o.midiInstrument[this.parseMidiInstrument(t)]}parseMidiInstrument(t){try{if(t){const e=t.toLowerCase().trim();for(const t in o.midiInstrument)if(-1!==e.indexOf(t))return t}if(this.parentInstrument.Name){const t=this.parentInstrument.Name.toLowerCase().trim();for(const e in o.midiInstrument)if(-1!==t.indexOf(e))return e}}catch(e){r.default.error("Error parsing MIDI Instrument. Default to Grand Piano.")}return"unnamed"}}e.SubInstrument=o,o.midiInstrument={alt:s.MidiInstrument.Synth_Voice,alto:s.MidiInstrument.Synth_Voice,banjo:s.MidiInstrument.Banjo,bariton:s.MidiInstrument.Synth_Voice,baritone:s.MidiInstrument.Synth_Voice,bass:s.MidiInstrument.Synth_Voice,"blockflöte":s.MidiInstrument.Recorder,brass:s.MidiInstrument.Trombone,bratsche:s.MidiInstrument.Viola,cello:s.MidiInstrument.Cello,clarinet:s.MidiInstrument.Clarinet,contrabass:s.MidiInstrument.Contrabass,drums:s.MidiInstrument.Percussion,flute:s.MidiInstrument.Flute,"flöte":s.MidiInstrument.Flute,frenchhorn:s.MidiInstrument.French_Horn,gitarre:s.MidiInstrument.Acoustic_Guitar_nylon,guitar:s.MidiInstrument.Acoustic_Guitar_nylon,harfe:s.MidiInstrument.Orchestral_Harp,harp:s.MidiInstrument.Orchestral_Harp,klarinette:s.MidiInstrument.Clarinet,klavier:s.MidiInstrument.Acoustic_Grand_Piano,kontrabass:s.MidiInstrument.Contrabass,oboe:s.MidiInstrument.Oboe,organ:s.MidiInstrument.Church_Organ,orgel:s.MidiInstrument.Church_Organ,orgue:s.MidiInstrument.Church_Organ,percussion:s.MidiInstrument.Percussion,piano:s.MidiInstrument.Acoustic_Grand_Piano,piccolo:s.MidiInstrument.Piccolo,posaune:s.MidiInstrument.Trombone,recorder:s.MidiInstrument.Recorder,sax:s.MidiInstrument.Tenor_Sax,schlagwerk:s.MidiInstrument.Percussion,schlagzeug:s.MidiInstrument.Percussion,sopran:s.MidiInstrument.Synth_Voice,steeldrum:s.MidiInstrument.Steel_Drums,streicher:s.MidiInstrument.String_Ensemble_1,strings:s.MidiInstrument.String_Ensemble_1,tenor:s.MidiInstrument.Synth_Voice,tpt:s.MidiInstrument.Trumpet,trombone:s.MidiInstrument.Trombone,trompete:s.MidiInstrument.Trumpet,trumpet:s.MidiInstrument.Trumpet,tuba:s.MidiInstrument.Tuba,unnamed:s.MidiInstrument.Acoustic_Grand_Piano,viola:s.MidiInstrument.Viola,violin:s.MidiInstrument.Violin,"violon-c":s.MidiInstrument.Cello,"violon.":s.MidiInstrument.Violin,voice:s.MidiInstrument.Synth_Voice,woodblock:s.MidiInstrument.Woodblock}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.MusicSymbolModuleFactory=void 0;const n=i(152),s=i(153);e.MusicSymbolModuleFactory=class{static createRepetitionInstructionReader(){return new n.RepetitionInstructionReader}static createRepetitionCalculator(){return new s.RepetitionCalculator}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.RepetitionInstructionReader=void 0;const n=i(28),s=i(28),r=i(174);e.RepetitionInstructionReader=class{set MusicSheet(t){this.musicSheet=t,this.xmlMeasureList=new Array(this.musicSheet.Instruments.length),this.repetitionInstructions=[]}prepareReadingMeasure(t,e){this.currentMeasureIndex=e}handleLineRepetitionInstructions(t){let e=!1;if(t.elements().length>0){let i="",s=!1,r="",o="",a="";const l=[],h=t.element("bar-style");h&&(a=h.value),i=t.attributes().length>0&&t.attribute("location")?t.attribute("location").value:"right";const c=t.elements();for(let t=0,e=c.length;t<e;++t){const e=c[t];if("repeat"===e.name&&e.hasAttributes)s=!0,r=e.attribute("direction").value;else if("ending"===e.name&&e.hasAttributes&&void 0!==e.attribute("type")&&e.attribute("number")){o=e.attribute("type").value;const t=e.attribute("number").value.split("[,+]");for(let e=0,i=t.length;e<i;++e){const i=t[e],n=i.match("[0-9]");if(-1!==i.search("-")&&2===n.length){const t=parseInt(n[0],10),e=parseInt(n[1],10);for(let i=t;i<=e;i++)l.push(i)}else for(let t=0,e=n.length;t<e;++t){const e=n[t];l.push(parseInt(e,10))}}}}if("light-heavy"!==a||0!==l.length||s||(e=!0),s||l.length>0)if("left"===i){if("start"===o){const t=new n.RepetitionInstruction(this.currentMeasureIndex,n.RepetitionInstructionEnum.Ending,n.AlignmentType.Begin,void 0,l);this.addInstruction(this.repetitionInstructions,t)}if("forward"===r){const t=new n.RepetitionInstruction(this.currentMeasureIndex,n.RepetitionInstructionEnum.StartLine);this.addInstruction(this.repetitionInstructions,t)}}else{if("stop"===o){const t=new n.RepetitionInstruction(this.currentMeasureIndex,n.RepetitionInstructionEnum.Ending,n.AlignmentType.End,void 0,l);this.addInstruction(this.repetitionInstructions,t)}if("backward"===r){const t=new n.RepetitionInstruction(this.currentMeasureIndex,n.RepetitionInstructionEnum.BackJumpLine);this.addInstruction(this.repetitionInstructions,t)}}}return e}handleRepetitionInstructionsFromWordsOrSymbols(t,e){const i=t.element("words"),s=this.currentMeasureIndex;if(i){const t="d\\s?\\.s\\.",e=i.value.trim().toLowerCase();if(r.StringUtil.StringContainsSeparatedWord(e,t+" al fine",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.DalSegnoAlFine);return this.addInstruction(this.repetitionInstructions,t),!0}const o="d\\.\\s?c\\.";if(r.StringUtil.StringContainsSeparatedWord(e,o+" al coda",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.DalSegnoAlCoda);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,o+" al fine",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.DaCapoAlFine);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,o+" al coda",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.DaCapoAlCoda);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,o)||r.StringUtil.StringContainsSeparatedWord(e,"da\\s?capo",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.DaCapo);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,t,!0)||r.StringUtil.StringContainsSeparatedWord(e,"dal\\s?segno",!0)){let t;return t=r.StringUtil.StringContainsSeparatedWord(e,"al\\s?coda",!0)?new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.DalSegnoAlCoda):new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.DalSegno),this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,"to\\s?coda",!0)||r.StringUtil.StringContainsSeparatedWord(e,"a (la )?coda",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.ToCoda);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,"fine",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.Fine);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,"coda",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,t),!0}if(r.StringUtil.StringContainsSeparatedWord(e,"segno",!0)){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,t),!0}}else{if(t.element("segno")){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,t),!0}if(t.element("coda")){const t=new n.RepetitionInstruction(s,n.RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,t),!0}}return!1}removeRedundantInstructions(){let t=0,e=0,i=0,r=0;for(let s=0;s<this.repetitionInstructions.length;s++){const o=this.repetitionInstructions[s];switch(o.type){case n.RepetitionInstructionEnum.Coda:i>0&&this.findInstructionInPreviousMeasure(s,o.measureIndex,n.RepetitionInstructionEnum.ToCoda)&&(o.type=n.RepetitionInstructionEnum.None),0===e&&0===i&&(o.type=n.RepetitionInstructionEnum.ToCoda,o.alignment=n.AlignmentType.End,o.measureIndex--);break;case n.RepetitionInstructionEnum.Segno:if(t-r>0){let t=!1;for(let s=0,r=this.repetitionInstructions.length;s<r;++s){const r=this.repetitionInstructions[s];if(o.measureIndex-r.measureIndex==1)switch(r.type){case n.RepetitionInstructionEnum.BackJumpLine:r.type=i-e>0?n.RepetitionInstructionEnum.DalSegnoAlCoda:n.RepetitionInstructionEnum.DalSegno,o.type=n.RepetitionInstructionEnum.None,t=!0;break;case n.RepetitionInstructionEnum.DalSegno:case n.RepetitionInstructionEnum.DalSegnoAlFine:case n.RepetitionInstructionEnum.DalSegnoAlCoda:o.type=n.RepetitionInstructionEnum.None,t=!0}if(t)break}if(t)break;o.type=i-e>0?n.RepetitionInstructionEnum.DalSegnoAlCoda:n.RepetitionInstructionEnum.DalSegno,o.alignment=n.AlignmentType.End,o.measureIndex--}}if(this.backwardSearchForPreviousIdenticalInstruction(s,o)||o.type===n.RepetitionInstructionEnum.None)this.repetitionInstructions.splice(s,1),s--;else switch(o.type){case n.RepetitionInstructionEnum.Fine:break;case n.RepetitionInstructionEnum.ToCoda:i++;break;case n.RepetitionInstructionEnum.Coda:e++;break;case n.RepetitionInstructionEnum.Segno:t++;break;case n.RepetitionInstructionEnum.DalSegnoAlFine:case n.RepetitionInstructionEnum.DalSegnoAlCoda:r++}}this.repetitionInstructions.sort(s.RepetitionInstructionComparer.Compare)}findInstructionInPreviousMeasure(t,e,i){for(let n=t-1;n>=0;n--){const t=this.repetitionInstructions[n];if(e-t.measureIndex==1&&t.type===i)return!0}return!1}backwardSearchForPreviousIdenticalInstruction(t,e){for(let i=t-1;i>=0;i--)if(this.repetitionInstructions[i].equals(e))return!0;return!1}addInstruction(t,e){let i=!0;for(let n=0,s=t.length;n<s;++n){const s=t[n];if(e.equals(s)){i=!1;break}}i&&t.push(e)}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.RepetitionCalculator=void 0;const n=i(28),s=i(28),r=i(11);e.RepetitionCalculator=class{constructor(){this.repetitionInstructions=[]}calculateRepetitions(t,e){this.musicSheet=t,this.repetitionInstructions=e;const i=this.musicSheet.SourceMeasures;for(let n=0,s=this.repetitionInstructions.length;n<s;++n){const t=this.repetitionInstructions[n];this.currentMeasureIndex=t.measureIndex,this.currentMeasure=i[this.currentMeasureIndex],this.handleRepetitionInstructions(t)}for(let n=0,r=this.musicSheet.SourceMeasures.length;n<r;++n){const t=this.musicSheet.SourceMeasures[n];t.FirstRepetitionInstructions.length>1&&t.FirstRepetitionInstructions.sort(s.RepetitionInstructionComparer.Compare),t.LastRepetitionInstructions.length>1&&t.LastRepetitionInstructions.sort(s.RepetitionInstructionComparer.Compare)}}handleRepetitionInstructions(t){if(!this.currentMeasure)return!1;switch(t.type){case n.RepetitionInstructionEnum.StartLine:this.currentMeasure.FirstRepetitionInstructions.push(t);break;case n.RepetitionInstructionEnum.BackJumpLine:this.currentMeasure.LastRepetitionInstructions.push(t);break;case n.RepetitionInstructionEnum.Ending:if(t.alignment===n.AlignmentType.Begin)this.currentMeasure.FirstRepetitionInstructions.push(t);else for(let e=0,i=t.endingIndices.length;e<i;++e)this.currentMeasure.LastRepetitionInstructions.push(t);break;case n.RepetitionInstructionEnum.Segno:this.currentMeasure.FirstRepetitionInstructions.push(t);break;case n.RepetitionInstructionEnum.Fine:case n.RepetitionInstructionEnum.ToCoda:case n.RepetitionInstructionEnum.Coda:case n.RepetitionInstructionEnum.DaCapo:case n.RepetitionInstructionEnum.DalSegno:case n.RepetitionInstructionEnum.DalSegnoAlFine:case n.RepetitionInstructionEnum.DaCapoAlFine:case n.RepetitionInstructionEnum.DalSegnoAlCoda:case n.RepetitionInstructionEnum.DaCapoAlCoda:this.currentMeasure.LastRepetitionInstructions.push(t);break;case n.RepetitionInstructionEnum.None:break;default:throw new r.ArgumentOutOfRangeException("currentRepetitionInstruction")}return!0}}},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ReaderPluginManager=void 0;const s=n(i(1));e.ReaderPluginManager=class{constructor(){this.voiceMeasureReadPlugins=[]}addVoiceMeasureReadPlugin(t){this.voiceMeasureReadPlugins.push(t)}processVoiceMeasureReadPlugins(t,e,i){for(const r of this.voiceMeasureReadPlugins)try{r.measureReadCalculations(t,e,i)}catch(n){s.default.info("VoiceGenerator.addSingleNote: ",n)}}}},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MXLHelper=void 0;const s=i(72),r=n(i(175));e.MXLHelper=class{static MXLtoIXmlElement(t){const e=new r.default;return e.loadAsync(t).then((t=>e.file("META-INF/container.xml").async("text")),(t=>{throw t})).then((t=>{const i=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return e.file(i).async("text")}),(t=>{throw t})).then((t=>{const e=(new DOMParser).parseFromString(t,"text/xml"),i=new s.IXmlElement(e.documentElement);return Promise.resolve(i)}),(t=>{throw t})).then((t=>t),(t=>{throw new Error("extractSheetFromMxl: "+t.message)}))}static MXLtoXMLstring(t){const e=new r.default;return e.loadAsync(t).then((t=>e.file("META-INF/container.xml").async("text")),(t=>{throw t})).then((t=>{const i=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return e.file(i).async("text")}),(t=>{throw t}))}}},function(t,e){var i,n,s=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(i===setTimeout)return setTimeout(t,0);if((i===r||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(n){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:r}catch(t){i=r}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var l,h=[],c=!1,u=-1;function d(){c&&l&&(c=!1,l.length?h=l.concat(h):u=-1,h.length&&f())}function f(){if(!c){var t=a(d);c=!0;for(var e=h.length;e;){for(l=h,h=[];++u<e;)l&&l[u].run();u=-1,e=h.length}l=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(i){return n.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function m(){}s.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];h.push(new p(t,e)),1!==h.length||c||a(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=m,s.addListener=m,s.once=m,s.off=m,s.removeListener=m,s.removeAllListeners=m,s.emit=m,s.prependListener=m,s.prependOnceListener=m,s.listeners=function(t){return[]},s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(10),s=i(29),r=i(82),o=function(){function t(t){this.toStrF=t||n.defaultToString,this.dictionary=new s.default(this.toStrF),this.nElements=0}return t.prototype.add=function(t,e){if(void 0===e&&(e=1),n.isUndefined(t)||e<=0)return!1;if(this.contains(t))this.dictionary.getValue(t).copies+=e;else{var i={value:t,copies:e};this.dictionary.setValue(t,i)}return this.nElements+=e,!0},t.prototype.count=function(t){return this.contains(t)?this.dictionary.getValue(t).copies:0},t.prototype.contains=function(t){return this.dictionary.containsKey(t)},t.prototype.remove=function(t,e){if(void 0===e&&(e=1),n.isUndefined(t)||e<=0)return!1;if(this.contains(t)){var i=this.dictionary.getValue(t);return e>i.copies?this.nElements-=i.copies:this.nElements-=e,i.copies-=e,i.copies<=0&&this.dictionary.remove(t),!0}return!1},t.prototype.toArray=function(){for(var t=[],e=0,i=this.dictionary.values();e<i.length;e++)for(var n=i[e],s=n.value,r=n.copies,o=0;o<r;o++)t.push(s);return t},t.prototype.toSet=function(){for(var t=new r.default(this.toStrF),e=0,i=this.dictionary.values();e<i.length;e++){var n=i[e].value;t.add(n)}return t},t.prototype.forEach=function(t){this.dictionary.forEach((function(e,i){for(var n=i.value,s=i.copies,r=0;r<s;r++)if(!1===t(n))return!1;return!0}))},t.prototype.size=function(){return this.nElements},t.prototype.isEmpty=function(){return 0===this.nElements},t.prototype.clear=function(){this.nElements=0,this.dictionary.clear()},t}();e.default=o},function(t,e,i){var n,s=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e}(i(83).default);e.default=r},function(t,e,i){var n,s=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var r=i(29),o=i(10),a=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},t}(),l=function(){function t(){this.key=null,this.value=null}return t.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},t}(),h=function(t){function e(e){var i=t.call(this,e)||this;return i.head=new l,i.tail=new l,i.head.next=i.tail,i.tail.prev=i.head,i}return s(e,t),e.prototype.appendToTail=function(t){var e=this.tail.prev;e.next=t,t.prev=e,t.next=this.tail,this.tail.prev=t},e.prototype.getLinkedDictionaryPair=function(t){if(!o.isUndefined(t)){var e="$"+this.toStr(t);return this.table[e]}},e.prototype.getValue=function(t){var e=this.getLinkedDictionaryPair(t);if(!o.isUndefined(e))return e.value},e.prototype.remove=function(e){var i=this.getLinkedDictionaryPair(e);if(!o.isUndefined(i))return t.prototype.remove.call(this,e),i.unlink(),i.value},e.prototype.clear=function(){t.prototype.clear.call(this),this.head.next=this.tail,this.tail.prev=this.head},e.prototype.replace=function(t,e){var i="$"+this.toStr(e.key);e.next=t.next,e.prev=t.prev,this.remove(t.key),e.prev.next=e,e.next.prev=e,this.table[i]=e,++this.nElements},e.prototype.setValue=function(t,e){if(!o.isUndefined(t)&&!o.isUndefined(e)){var i=this.getLinkedDictionaryPair(t),n=new a(t,e),s="$"+this.toStr(t);return o.isUndefined(i)?(this.appendToTail(n),this.table[s]=n,void++this.nElements):(this.replace(i,n),i.value)}},e.prototype.keys=function(){var t=[];return this.forEach((function(e,i){t.push(e)})),t},e.prototype.values=function(){var t=[];return this.forEach((function(e,i){t.push(i)})),t},e.prototype.forEach=function(t){for(var e=this.head.next;e.next;){if(!1===t(e.key,e.value))return;e=e.next}},e}(r.default);e.default=h},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(10),s=i(29),r=i(35),o=function(){function t(t,e,i){void 0===i&&(i=!1),this.dict=new s.default(t),this.equalsF=e||n.defaultEquals,this.allowDuplicate=i}return t.prototype.getValue=function(t){var e=this.dict.getValue(t);return n.isUndefined(e)?[]:r.copy(e)},t.prototype.setValue=function(t,e){if(n.isUndefined(t)||n.isUndefined(e))return!1;var i=this.dict.getValue(t);return n.isUndefined(i)?(this.dict.setValue(t,[e]),!0):!(!this.allowDuplicate&&r.contains(i,e,this.equalsF)||(i.push(e),0))},t.prototype.remove=function(t,e){if(n.isUndefined(e)){var i=this.dict.remove(t);return!n.isUndefined(i)}var s=this.dict.getValue(t);return!(n.isUndefined(s)||!r.remove(s,e,this.equalsF)||(0===s.length&&this.dict.remove(t),0))},t.prototype.keys=function(){return this.dict.keys()},t.prototype.values=function(){for(var t=[],e=0,i=this.dict.values();e<i.length;e++)for(var n=0,s=i[e];n<s.length;n++){var r=s[n];t.push(r)}return t},t.prototype.containsKey=function(t){return this.dict.containsKey(t)},t.prototype.clear=function(){this.dict.clear()},t.prototype.size=function(){return this.dict.size()},t.prototype.isEmpty=function(){return this.dict.isEmpty()},t}();e.default=o},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(10),s=i(85),r=function(){function t(t){this.heap=new s.default(n.reverseCompareFunction(t))}return t.prototype.enqueue=function(t){return this.heap.add(t)},t.prototype.add=function(t){return this.heap.add(t)},t.prototype.dequeue=function(){if(0!==this.heap.size()){var t=this.heap.peek();return this.heap.removeRoot(),t}},t.prototype.peek=function(){return this.heap.peek()},t.prototype.contains=function(t){return this.heap.contains(t)},t.prototype.isEmpty=function(){return this.heap.isEmpty()},t.prototype.size=function(){return this.heap.size()},t.prototype.clear=function(){this.heap.clear()},t.prototype.forEach=function(t){this.heap.forEach(t)},t}();e.default=r},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0});var n=i(53),s=function(){function t(){this.list=new n.default}return t.prototype.push=function(t){return this.list.add(t,0)},t.prototype.add=function(t){return this.list.add(t,0)},t.prototype.pop=function(){return this.list.removeElementAtIndex(0)},t.prototype.peek=function(){return this.list.first()},t.prototype.size=function(){return this.list.size()},t.prototype.contains=function(t,e){return this.list.contains(t,e)},t.prototype.isEmpty=function(){return this.list.isEmpty()},t.prototype.clear=function(){this.list.clear()},t.prototype.forEach=function(t){this.list.forEach(t)},t}();e.default=s},function(t,e,i){var n,s;Object.defineProperty(e,"__esModule",{value:!0}),(s=n||(n={}))[s.BEFORE=0]="BEFORE",s[s.AFTER=1]="AFTER",s[s.INSIDE_AT_END=2]="INSIDE_AT_END",s[s.INSIDE_AT_START=3]="INSIDE_AT_START";var r=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.rootIds=t,this.nodes=e,this.initRootIds(),this.initNodes()}return t.prototype.initRootIds=function(){for(var t=0,e=this.rootIds;t<e.length;t++){var i=e[t];this.createEmptyNodeIfNotExist(i)}},t.prototype.initNodes=function(){for(var t in this.nodes)if(this.nodes.hasOwnProperty(t))for(var e=0,i=this.nodes[t];e<i.length;e++){var n=i[e];this.createEmptyNodeIfNotExist(n)}},t.prototype.createEmptyNodeIfNotExist=function(t){this.nodes[t]||(this.nodes[t]=[])},t.prototype.getRootIds=function(){return this.rootIds.slice()},t.prototype.getNodes=function(){var t={};for(var e in this.nodes)this.nodes.hasOwnProperty(e)&&(t[e]=this.nodes[e].slice());return t},t.prototype.getObject=function(){return{rootIds:this.getRootIds(),nodes:this.getNodes()}},t.prototype.toObject=function(){return this.getObject()},t.prototype.flatten=function(){for(var t=this,e=[],i=0;i<this.rootIds.length;i++){var n=this.rootIds[i];e.push({id:n,level:0,hasParent:!1,childrenCount:0}),l(n,this.nodes,e,0)}for(var s=0,r=e;s<r.length;s++){var o=r[s];o.childrenCount=a(o.id)}return e;function a(e){return t.nodes[e]?t.nodes[e].length:0}function l(t,e,i,n){if(void 0===n&&(n=0),t&&e&&i&&e[t]){n++;for(var s=e[t],r=0;r<s.length;r++){var o=s[r];i.push({id:o,level:n,hasParent:!0}),l(o,e,i,n)}n--}}},t.prototype.moveIdBeforeId=function(t,e){return this.moveId(t,e,n.BEFORE)},t.prototype.moveIdAfterId=function(t,e){return this.moveId(t,e,n.AFTER)},t.prototype.moveIdIntoId=function(t,e,i){return void 0===i&&(i=!0),i?this.moveId(t,e,n.INSIDE_AT_START):this.moveId(t,e,n.INSIDE_AT_END)},t.prototype.swapRootIdWithRootId=function(t,e){var i=this.findRootId(t),n=this.findRootId(e);this.swapRootPositionWithRootPosition(i,n)},t.prototype.swapRootPositionWithRootPosition=function(t,e){var i=this.rootIds[e];this.rootIds[e]=this.rootIds[t],this.rootIds[t]=i},t.prototype.deleteId=function(t){this.rootDeleteId(t),this.nodeAndSubNodesDelete(t),this.nodeRefrencesDelete(t)},t.prototype.insertIdBeforeId=function(t,e){var i=this.findRootId(t);for(var n in i>-1&&this.insertIdIntoRoot(e,i),this.nodes)if(this.nodes.hasOwnProperty(n)){var s=this.findNodeId(n,t);s>-1&&this.insertIdIntoNode(n,e,s)}},t.prototype.insertIdAfterId=function(t,e){var i=this.findRootId(t);for(var n in i>-1&&this.insertIdIntoRoot(e,i+1),this.nodes)if(this.nodes.hasOwnProperty(n)){var s=this.findNodeId(n,t);s>-1&&this.insertIdIntoNode(n,e,s+1)}},t.prototype.insertIdIntoId=function(t,e){this.nodeInsertAtEnd(t,e),this.nodes[e]=[]},t.prototype.insertIdIntoRoot=function(t,e){if(void 0===e)this.rootInsertAtEnd(t);else if(e<0){var i=this.rootIds.length;this.rootIds.splice(e+i+1,0,t)}else this.rootIds.splice(e,0,t);this.nodes[t]=this.nodes[t]||[]},t.prototype.insertIdIntoNode=function(t,e,i){if(this.nodes[t]=this.nodes[t]||[],this.nodes[e]=this.nodes[e]||[],void 0===i)this.nodeInsertAtEnd(t,e);else if(i<0){var n=this.nodes[t].length;this.nodes[t].splice(i+n+1,0,e)}else this.nodes[t].splice(i,0,e)},t.prototype.moveId=function(t,e,i){var s=t,r=this.findRootId(s);for(var o in this.nodes[e],this.nodes)if(this.nodes.hasOwnProperty(o)){this.findNodeId(o,e);break}var a=e,l=this.findRootId(a);for(var o in this.nodes[e],this.nodes)if(this.nodes.hasOwnProperty(o)){this.findNodeId(o,e);break}if(r>-1){if(l>-1)switch(this.rootDelete(r),l>r&&l--,i){case n.BEFORE:this.insertIdIntoRoot(s,l);break;case n.AFTER:this.insertIdIntoRoot(s,l+1);break;case n.INSIDE_AT_START:this.nodeInsertAtStart(a,s);break;case n.INSIDE_AT_END:this.nodeInsertAtEnd(a,s)}else for(var o in this.rootDelete(r),this.nodes)if(this.nodes.hasOwnProperty(o)&&(h=this.findNodeId(o,a))>-1){switch(i){case n.BEFORE:this.insertIdIntoNode(o,s,h);break;case n.AFTER:this.insertIdIntoNode(o,s,h+1);break;case n.INSIDE_AT_START:this.nodeInsertAtStart(a,s);break;case n.INSIDE_AT_END:this.nodeInsertAtEnd(a,s)}break}}else if(l>-1){for(var o in this.nodes)if(this.nodes.hasOwnProperty(o)&&(h=this.findNodeId(o,s))>-1){this.nodeDeleteAtIndex(o,h);break}switch(i){case n.BEFORE:this.insertIdIntoRoot(s,l);break;case n.AFTER:this.insertIdIntoRoot(s,l+1);break;case n.INSIDE_AT_START:this.nodeInsertAtStart(a,s);break;case n.INSIDE_AT_END:this.nodeInsertAtEnd(a,s)}}else{for(var o in this.nodes)if(this.nodes.hasOwnProperty(o)&&(h=this.findNodeId(o,s))>-1){this.nodeDeleteAtIndex(o,h);break}for(var o in this.nodes){var h;if(this.nodes.hasOwnProperty(o)&&(h=this.findNodeId(o,a))>-1){switch(i){case n.BEFORE:this.insertIdIntoNode(o,s,h);break;case n.AFTER:this.insertIdIntoNode(o,s,h+1);break;case n.INSIDE_AT_START:this.nodeInsertAtStart(a,s);break;case n.INSIDE_AT_END:this.nodeInsertAtEnd(a,s)}break}}}},t.prototype.swapArrayElements=function(t,e,i){var n=t[e];return t[e]=t[i],t[i]=n,t},t.prototype.rootDeleteId=function(t){var e=this.findRootId(t);e>-1&&this.rootDelete(e)},t.prototype.nodeAndSubNodesDelete=function(t){for(var e=[],i=0;i<this.nodes[t].length;i++){var n=this.nodes[t][i];this.nodeAndSubNodesDelete(n),e.push(t)}for(this.nodeDelete(t),i=0;i<e.length;i++)this.nodeDelete(e[i])},t.prototype.nodeRefrencesDelete=function(t){for(var e in this.nodes)if(this.nodes.hasOwnProperty(e))for(var i=0;i<this.nodes[e].length;i++)this.nodes[e][i]===t&&this.nodeDeleteAtIndex(e,i)},t.prototype.nodeDelete=function(t){delete this.nodes[t]},t.prototype.findRootId=function(t){return this.rootIds.indexOf(t)},t.prototype.findNodeId=function(t,e){return this.nodes[t].indexOf(e)},t.prototype.findNode=function(t){return this.nodes[t]},t.prototype.nodeInsertAtStart=function(t,e){this.nodes[t].unshift(e)},t.prototype.nodeInsertAtEnd=function(t,e){this.nodes[t].push(e)},t.prototype.rootDelete=function(t){this.rootIds.splice(t,1)},t.prototype.nodeDeleteAtIndex=function(t,e){this.nodes[t].splice(e,1)},t.prototype.rootInsertAtStart=function(t){this.rootIds.unshift(t)},t.prototype.rootInsertAtEnd=function(t){this.rootIds.push(t)},t}();e.default=r},function(t,e,i){var n;Object.defineProperty(e,"__esModule",{value:!0}),e.TieTypes=void 0,(n=e.TieTypes||(e.TieTypes={})).SIMPLE="",n.HAMMERON="H",n.PULLOFF="P",n.SLIDE="S",n.TAPPING="T"},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.VexFlowSlur=e.CurvePositionEnum=void 0;const s=n(i(8));var r,o;(o=r=e.CurvePositionEnum||(e.CurvePositionEnum={}))[o.NEAR_HEAD=1]="NEAR_HEAD",o[o.NEAR_TOP=2]="NEAR_TOP";class a{constructor(t){this.vfStartNote=void 0,this.vfEndNote=void 0,this.parentSlur=t}static createFromVexflowSlur(t){return new a(t.parentSlur)}get vfSlur(){return this.parentSlur}curve_Options(){return{cps:[{x:0,y:10},{x:0,y:10}],invert:!1,position:r.NEAR_TOP,position_end:r.NEAR_TOP,spacing:2,thickness:2,x_shift:0,y_shift:10}}createVexFlowCurve(){this.vfCurve=new s.default.Flow.Curve(this.vfStartNote,this.vfEndNote,void 0)}}e.VexFlowSlur=a},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.TimestampTransform=e.MusicPartManager=void 0;const n=i(0),s=i(167);e.MusicPartManager=class{constructor(t){this.musicSheet=t}reInit(){this.init()}init(){this.parts=this.musicSheet.Repetitions.slice(),this.sheetStart=this.musicSheet.SelectionStart=new n.Fraction(0,1),this.sheetEnd=this.musicSheet.SelectionEnd=this.musicSheet.SheetEndTimestamp,this.calcMapping()}getCurrentRepetitionTimestampTransform(t){let e;for(let i=this.timestamps.length-1;i>=0;i--)if(e=this.timestamps[i],t.gte(e.$from))return e;return this.timestamps[0]}absoluteEnrolledToSheetTimestamp(t){if(0===this.timestamps.length)return t;const e=this.getCurrentRepetitionTimestampTransform(t);return n.Fraction.plus(t,n.Fraction.minus(e.to,e.$from))}get Parts(){return this.parts}get MusicSheet(){return this.musicSheet}getIterator(t){return t?new s.MusicPartManagerIterator(this.musicSheet,t,void 0):new s.MusicPartManagerIterator(this.musicSheet,this.musicSheet.SelectionStart,this.musicSheet.SelectionEnd)}setSelectionStart(t){this.musicSheet.SelectionStart=t,this.musicSheet.SelectionEnd=void 0}setSelectionRange(t,e){this.musicSheet.SelectionStart=null!=t?t:this.sheetStart,this.musicSheet.SelectionEnd=null!=e?e:this.sheetEnd}calcMapping(){const t=[],e=this.getIterator();let i=e.CurrentRepetition,n=new r(e.CurrentEnrolledTimestamp.clone(),e.CurrentSourceTimestamp.clone(),void 0,0);for(t.push(n);!e.EndReached;){if(e.JumpOccurred||i!==e.CurrentRepetition){if(i=e.CurrentRepetition,e.backJumpOccurred){const i=e.JumpResponsibleRepetition;n.nextBackJump=e.CurrentEnrolledTimestamp,n.curRepetition=i,n.curRepetitionIteration=e.CurrentJumpResponsibleRepetitionIterationBeforeJump;for(let e=this.timestamps.length-2;e>=0&&!t[e].to.lt(i.AbsoluteTimestamp)&&!t[e].curRepetition;e--)t[e].nextBackJump=n.nextBackJump,t[e].curRepetition=i,t[e].curRepetitionIteration=n.curRepetitionIteration}n=new r(e.CurrentEnrolledTimestamp.clone(),e.CurrentSourceTimestamp.clone(),void 0,0),t.push(n)}e.moveToNext()}this.timestamps=t}};class r{constructor(t,e,i,n){this.$from=t,this.to=e,this.curRepetition=i,this.curRepetitionIteration=n,this.nextBackJump=void 0,this.nextForwardJump=void 0}}e.TimestampTransform=r},function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.MusicPartManagerIterator=void 0;const s=i(0),r=i(168),o=i(19),a=i(32),l=n(i(1));class h{constructor(t,e,i){this.currentMeasureIndex=0,this.currentPartIndex=0,this.currentVoiceEntryIndex=-1,this.currentDynamicEntryIndex=0,this.currentTempoEntryIndex=0,this.currentDynamicChangingExpressions=[],this.currentRepetition=void 0,this.endReached=!1,this.frontReached=!1,this.currentTimeStamp=new s.Fraction(0,1),this.currentEnrolledMeasureTimestamp=new s.Fraction(0,1),this.currentRelativeInMeasureTimestamp=new s.Fraction(0,1),this.currentVerticalContainerInMeasureTimestamp=new s.Fraction(0,1),this.jumpResponsibleRepetition=void 0,this.activeDynamicExpressions=[];try{this.frontReached=!0,this.musicSheet=t,this.currentVoiceEntries=void 0,this.frontReached=!1;for(const t of this.musicSheet.Repetitions)this.setRepetitionIterationCount(t,1);if(this.activeDynamicExpressions=new Array(this.musicSheet.getCompleteNumberOfStaves()),this.currentMeasure=this.musicSheet.SourceMeasures[0],!e)return;do{this.moveToNext()}while((!this.currentVoiceEntries||this.currentTimeStamp.lt(e))&&!this.endReached);for(let t=0;t<this.activeDynamicExpressions.length;t++)if(this.activeDynamicExpressions[t])if(this.activeDynamicExpressions[t]instanceof a.ContinuousDynamicExpression){const e=this.activeDynamicExpressions[t];this.currentDynamicChangingExpressions.push(new r.DynamicsContainer(e,t))}else{const e=this.activeDynamicExpressions[t];this.currentDynamicChangingExpressions.push(new r.DynamicsContainer(e,t))}this.currentTempoChangingExpression=this.activeTempoExpression}catch(n){l.default.info("MusicPartManagerIterator: "+n)}}get EndReached(){return this.endReached}get FrontReached(){return this.frontReached}get CurrentMeasure(){return this.currentMeasure}get CurrentRepetition(){return this.currentRepetition}get CurrentRepetitionIteration(){return this.CurrentRepetition?this.getRepetitionIterationCount(this.CurrentRepetition):0}get CurrentJumpResponsibleRepetitionIterationBeforeJump(){return this.jumpResponsibleRepetition?this.getRepetitionIterationCount(this.jumpResponsibleRepetition)-1:0}get CurrentBpm(){return this.currentBpm}get CurrentVoiceEntries(){return this.currentVoiceEntries}get CurrentMeasureIndex(){return this.currentMeasureIndex}get CurrentEnrolledTimestamp(){return s.Fraction.plus(this.currentEnrolledMeasureTimestamp,this.currentVerticalContainerInMeasureTimestamp)}get CurrentSourceTimestamp(){return this.currentTimeStamp}get CurrentRelativeInMeasureTimestamp(){return this.currentRelativeInMeasureTimestamp}get JumpOccurred(){return this.backJumpOccurred||this.forwardJumpOccurred}get ActiveTempoExpression(){return this.activeTempoExpression}get ActiveDynamicExpressions(){return this.activeDynamicExpressions}get CurrentTempoChangingExpression(){return this.currentTempoChangingExpression}get JumpResponsibleRepetition(){return this.jumpResponsibleRepetition}clone(t,e){const i=new h(this.musicSheet,null!=t?t:this.currentTimeStamp,e);return i.currentVoiceEntryIndex=this.currentVoiceEntryIndex,i.currentMappingPart=this.currentMappingPart,i.currentPartIndex=this.currentPartIndex,i.currentVoiceEntries=this.currentVoiceEntries,i.endReached=this.endReached,i.frontReached=this.frontReached,i}CurrentVisibleVoiceEntries(t){const e=[];if(!this.currentVoiceEntries)return e;if(t){for(const i of this.currentVoiceEntries)if(i.ParentVoice.Parent.IdString===t.IdString)return this.getVisibleEntries(i,e),e}else for(const i of this.currentVoiceEntries)this.getVisibleEntries(i,e);return e}CurrentAudibleVoiceEntries(t){const e=[];if(!this.currentVoiceEntries)return e;if(t){for(const i of this.currentVoiceEntries)if(i.ParentVoice.Parent.IdString===t.IdString)return this.getAudibleEntries(i,e),e}else for(const i of this.currentVoiceEntries)this.getAudibleEntries(i,e);return e}getCurrentDynamicChangingExpressions(){return this.currentDynamicChangingExpressions}CurrentScoreFollowingVoiceEntries(t){const e=[];if(!this.currentVoiceEntries)return e;if(t){for(const i of this.currentVoiceEntries)if(i.ParentVoice.Parent.IdString===t.IdString)return this.getScoreFollowingEntries(i,e),e}else for(const i of this.currentVoiceEntries)this.getScoreFollowingEntries(i,e);return e}moveToNext(){this.forwardJumpOccurred=this.backJumpOccurred=!1,this.endReached||(this.currentVoiceEntries&&(this.currentVoiceEntries=[]),this.recursiveMove(),this.currentMeasure||(this.currentTimeStamp=new s.Fraction(99999,1)))}moveToNextVisibleVoiceEntry(t){for(;!this.endReached;)if(this.moveToNext(),this.checkEntries(t))return}resetRepetitionIterationCount(t){return this.setRepetitionIterationCount(t,1),1}incrementRepetitionIterationCount(t){return-1===this.repetitionIterationCountDictKeys.indexOf(t)?this.setRepetitionIterationCount(t,1):this.setRepetitionIterationCount(t,this.getRepetitionIterationCount(t)+1)}setRepetitionIterationCount(t,e){const i=this.repetitionIterationCountDictKeys.indexOf(t);return-1===i?(this.repetitionIterationCountDictKeys.push(t),this.repetitionIterationCountDictValues.push(e)):this.repetitionIterationCountDictValues[i]=e,e}getRepetitionIterationCount(t){const e=this.repetitionIterationCountDictKeys.indexOf(t);if(-1!==e)return this.repetitionIterationCountDictValues[e]}handleRepetitionsAtMeasureBegin(){for(let t=0,e=this.currentMeasure.FirstRepetitionInstructions.length;t<e;++t){const e=this.currentMeasure.FirstRepetitionInstructions[t];if(!e.parentRepetition)continue;const i=e.parentRepetition;this.currentRepetition=i,i.StartIndex===this.currentMeasureIndex&&void 0!==this.JumpResponsibleRepetition&&i!==this.JumpResponsibleRepetition&&i.StartIndex>=this.JumpResponsibleRepetition.StartIndex&&i.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(i)}}handleRepetitionsAtMeasureEnd(){for(let t=0,e=this.currentMeasure.LastRepetitionInstructions.length;t<e;++t){const e=this.currentMeasure.LastRepetitionInstructions[t],i=e.parentRepetition;if(i){if(i.BackwardJumpInstructions.indexOf(e)>-1&&this.getRepetitionIterationCount(i)<i.UserNumberOfRepetitions)return this.doBackJump(i),void(this.backJumpOccurred=!0);if(e===i.forwardJumpInstruction){void 0!==this.JumpResponsibleRepetition&&i!==this.JumpResponsibleRepetition&&i.StartIndex>=this.JumpResponsibleRepetition.StartIndex&&i.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(i);const t=i.getForwardJumpTargetForIteration(this.getRepetitionIterationCount(i));if(t>=0)return this.currentMeasureIndex=t,this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.jumpResponsibleRepetition=i,void(this.forwardJumpOccurred=!0);-2===t&&(this.endReached=!0)}}}this.currentMeasureIndex++,void 0!==this.JumpResponsibleRepetition&&this.currentMeasureIndex>this.JumpResponsibleRepetition.EndIndex&&(this.jumpResponsibleRepetition=void 0)}doBackJump(t){this.currentMeasureIndex=t.getBackwardJumpTarget(),this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.incrementRepetitionIterationCount(t),this.jumpResponsibleRepetition=t}activateCurrentRhythmInstructions(){if(void 0!==this.currentMeasure&&this.currentMeasure.FirstInstructionsStaffEntries.length>0&&void 0!==this.currentMeasure.FirstInstructionsStaffEntries[0]){const t=this.currentMeasure.FirstInstructionsStaffEntries[0].Instructions;for(let e=0,i=t.length;e<i;++e){const i=t[e];i instanceof o.RhythmInstruction&&(this.musicSheet.SheetPlaybackSetting.rhythm=i.Rhythm)}}}activateCurrentDynamicOrTempoInstructions(){const t=this.musicSheet.TimestampSortedDynamicExpressionsList;for(;this.currentDynamicEntryIndex>0&&(this.currentDynamicEntryIndex>=t.length||this.CurrentSourceTimestamp.lte(t[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp));)this.currentDynamicEntryIndex--;for(;this.currentDynamicEntryIndex<t.length&&t[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp.lt(this.CurrentSourceTimestamp);)this.currentDynamicEntryIndex++;for(;this.currentDynamicEntryIndex<t.length&&t[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp.Equals(this.CurrentSourceTimestamp);){const e=t[this.currentDynamicEntryIndex],i=e.staffNumber;this.CurrentSourceTimestamp.Equals(e.parMultiExpression().AbsoluteTimestamp)&&(e.continuousDynamicExpression?this.activeDynamicExpressions[i]=e.continuousDynamicExpression:e.instantaneousDynamicExpression&&(this.activeDynamicExpressions[i]=e.instantaneousDynamicExpression)),this.currentDynamicEntryIndex++}this.currentDynamicChangingExpressions=[];for(let i=0;i<this.activeDynamicExpressions.length;i++)if(this.activeDynamicExpressions[i]){let t,e;if(this.activeDynamicExpressions[i]instanceof a.ContinuousDynamicExpression){const n=this.activeDynamicExpressions[i];t=n.StartMultiExpression.AbsoluteTimestamp,e=n.EndMultiExpression.AbsoluteTimestamp,t.lte(this.CurrentSourceTimestamp)&&this.CurrentSourceTimestamp.lte(e)&&this.currentDynamicChangingExpressions.push(new r.DynamicsContainer(n,i))}else{const t=this.activeDynamicExpressions[i];this.CurrentSourceTimestamp.Equals(t.ParentMultiExpression.AbsoluteTimestamp)&&this.currentDynamicChangingExpressions.push(new r.DynamicsContainer(t,i))}}const e=this.musicSheet.TimestampSortedTempoExpressionsList;for(;this.currentTempoEntryIndex>0&&(this.currentTempoEntryIndex>=e.length||this.CurrentSourceTimestamp.lte(e[this.currentTempoEntryIndex].AbsoluteTimestamp));)this.currentTempoEntryIndex--;for(;this.currentTempoEntryIndex<e.length&&e[this.currentTempoEntryIndex].AbsoluteTimestamp.lt(this.CurrentSourceTimestamp);)this.currentTempoEntryIndex++;for(;this.currentTempoEntryIndex<e.length&&e[this.currentTempoEntryIndex].AbsoluteTimestamp.Equals(this.CurrentSourceTimestamp);)this.activeTempoExpression=e[this.currentTempoEntryIndex],this.currentTempoEntryIndex++;if(this.currentTempoChangingExpression=void 0,this.activeTempoExpression){let t=this.activeTempoExpression.AbsoluteTimestamp;this.activeTempoExpression.ContinuousTempo&&(t=this.activeTempoExpression.ContinuousTempo.AbsoluteEndTimestamp),(this.activeTempoExpression.AbsoluteTimestamp.lte(this.CurrentSourceTimestamp)||this.CurrentSourceTimestamp.lte(t))&&(this.currentTempoChangingExpression=this.activeTempoExpression)}}recursiveMove(){if(this.currentVoiceEntryIndex++,0===this.currentVoiceEntryIndex&&(this.handleRepetitionsAtMeasureBegin(),this.activateCurrentRhythmInstructions()),this.currentVoiceEntryIndex>=0&&this.currentVoiceEntryIndex<this.currentMeasure.VerticalSourceStaffEntryContainers.length){const t=this.currentMeasure.VerticalSourceStaffEntryContainers[this.currentVoiceEntryIndex];this.currentVoiceEntries=this.getVoiceEntries(t),this.currentVerticalContainerInMeasureTimestamp=t.Timestamp,this.currentTimeStamp=s.Fraction.plus(this.currentMeasure.AbsoluteTimestamp,this.currentVerticalContainerInMeasureTimestamp);const e=this.musicSheet.SelectionEnd;return e&&this.currentTimeStamp.gte(e)&&(this.endReached=!0),void this.activateCurrentDynamicOrTempoInstructions()}if(this.currentEnrolledMeasureTimestamp.Add(this.currentMeasure.Duration),this.handleRepetitionsAtMeasureEnd(),this.currentMeasureIndex>=0&&this.currentMeasureIndex<this.musicSheet.SourceMeasures.length)return this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentTimeStamp=s.Fraction.plus(this.currentMeasure.AbsoluteTimestamp,this.currentVerticalContainerInMeasureTimestamp),this.currentVoiceEntryIndex=-1,void this.recursiveMove();this.currentVerticalContainerInMeasureTimestamp=new s.Fraction,this.currentMeasure=void 0,this.currentVoiceEntries=void 0,this.endReached=!0}checkEntries(t){const e=this.CurrentVisibleVoiceEntries();if(e.length>0){if(!t)return!0;for(let t=0,i=e.length;t<i;++t)if(e[t].Notes[0].Pitch)return!0}return!1}getVisibleEntries(t,e){t.ParentVoice.Visible&&e.push(t)}getAudibleEntries(t,e){t.ParentVoice.Audible&&e.push(t)}getScoreFollowingEntries(t,e){t.ParentVoice.Following&&t.ParentVoice.Parent.Following&&e.push(t)}getVoiceEntries(t){const e=[];for(const i of t.StaffEntries)if(i)for(const t of i.VoiceEntries)e.push(t);return e}}e.MusicPartManagerIterator=h},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.DynamicsContainer=void 0;const n=i(32),s=i(38);e.DynamicsContainer=class{constructor(t,e){t instanceof n.ContinuousDynamicExpression?this.continuousDynamicExpression=t:t instanceof s.InstantaneousDynamicExpression&&(this.instantaneousDynamicExpression=t),this.staffNumber=e}parMultiExpression(){return this.continuousDynamicExpression?this.continuousDynamicExpression.StartMultiExpression:this.instantaneousDynamicExpression?this.instantaneousDynamicExpression.ParentMultiExpression:void 0}CompareTo(t){return this.parMultiExpression().AbsoluteTimestamp.CompareTo(t.parMultiExpression().AbsoluteTimestamp)}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.LyricWord=void 0,e.LyricWord=class{constructor(){this.syllables=[]}get Syllables(){return this.syllables}containsVoiceEntry(t){for(let e=0,i=this.Syllables.length;e<i;++e)if(this.Syllables[e].Parent===t)return!0;return!1}findLyricEntryInVoiceEntry(t){for(let e=0,i=this.Syllables.length;e<i;++e){const i=this.Syllables[e];if(i.Parent===t)return i}}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.LyricsEntry=void 0,e.LyricsEntry=class{constructor(t,e,i,n,s=-1){this.text=t,this.word=i,this.parent=n,this.verseNumber=e,s>=0&&(this.syllableIndex=s)}get Text(){return this.text}set Text(t){this.text=t}get Word(){return this.word}get Parent(){return this.parent}set Parent(t){this.parent=t}get VerseNumber(){return this.verseNumber}get SyllableIndex(){return this.syllableIndex}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.Articulation=void 0,e.Articulation=class{constructor(t,e){this.articulationEnum=t,this.placement=e}Equals(t){return t.articulationEnum===this.articulationEnum&&t.placement===this.placement}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.TabNote=void 0;const n=i(36);class s extends n.Note{constructor(t,e,i,n,s,r,o,a,l){super(t,e,i,n,s),this.stringNumberTab=r,this.fretNumber=o,this.bendArray=a,this.vibratoStroke=l}get StringNumberTab(){return this.stringNumberTab}get FretNumber(){return this.fretNumber}get BendArray(){return this.bendArray}get VibratoStroke(){return this.vibratoStroke}}e.TabNote=s},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.Slur=void 0;const n=i(0);e.Slur=class{constructor(){}get StartNote(){return this.startNote}set StartNote(t){this.startNote=t}get EndNote(){return this.endNote}set EndNote(t){this.endNote=t}startNoteHasMoreStartingSlurs(){if(!this.startNote)return!1;for(let t=0,e=this.startNote.NoteSlurs.length;t<e;++t){const e=this.startNote.NoteSlurs[t];if(e!==this&&e.StartNote===this.startNote)return!0}return!1}endNoteHasMoreEndingSlurs(){if(!this.endNote)return!1;for(let t=0,e=this.endNote.NoteSlurs.length;t<e;++t){const e=this.endNote.NoteSlurs[t];if(e!==this&&e.EndNote===this.endNote)return!0}return!1}isCrossed(){return this.startNote.ParentStaffEntry.ParentStaff!==this.endNote.ParentStaffEntry.ParentStaff}isSlurLonger(){if(!this.endNote||!this.startNote)return!1;const t=n.Fraction.minus(this.endNote.getAbsoluteTimestamp(),this.startNote.getAbsoluteTimestamp());for(let e=0,i=this.startNote.NoteSlurs.length;e<i;++e){const i=this.startNote.NoteSlurs[e];if(i!==this&&void 0!==i.EndNote&&void 0!==i.StartNote&&-1===n.Fraction.minus(i.EndNote.getAbsoluteTimestamp(),i.StartNote.getAbsoluteTimestamp()).CompareTo(t))return!0}for(let e=0,i=this.endNote.NoteSlurs.length;e<i;++e){const i=this.endNote.NoteSlurs[e];if(i!==this&&void 0!==i.EndNote&&void 0!==i.StartNote&&n.Fraction.minus(i.EndNote.getAbsoluteTimestamp(),i.StartNote.getAbsoluteTimestamp()).CompareTo(t))return!0}return!1}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.StringUtil=void 0,e.StringUtil=class{static StringContainsSeparatedWord(t,e,i=!1){return new RegExp("( |^)"+e+"([ .]|$)",i?"i":void 0).test(t)}}},function(t,e,i){(function(e,i,n){t.exports=function t(e,i,n){function s(o,a){if(!i[o]){if(!e[o]){if(r)return r(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var h=i[o]={exports:{}};e[o][0].call(h.exports,(function(t){return s(e[o][1][t]||t)}),h,h.exports,t,e,i,n)}return i[o].exports}for(var r=!1,o=0;o<n.length;o++)s(n[o]);return s}({1:[function(t,e,i){var n=t("./utils"),s=t("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(t){for(var e,i,s,o,a,l,h,c=[],u=0,d=t.length,f=d,p="string"!==n.getTypeOf(t);u<t.length;)f=d-u,s=p?(e=t[u++],i=u<d?t[u++]:0,u<d?t[u++]:0):(e=t.charCodeAt(u++),i=u<d?t.charCodeAt(u++):0,u<d?t.charCodeAt(u++):0),o=e>>2,a=(3&e)<<4|i>>4,l=1<f?(15&i)<<2|s>>6:64,h=2<f?63&s:64,c.push(r.charAt(o)+r.charAt(a)+r.charAt(l)+r.charAt(h));return c.join("")},i.decode=function(t){var e,i,n,o,a,l,h=0,c=0,u="data:";if(t.substr(0,u.length)===u)throw new Error("Invalid base64 input, it looks like a data url.");var d,f=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(t.charAt(t.length-1)===r.charAt(64)&&f--,t.charAt(t.length-2)===r.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=s.uint8array?new Uint8Array(0|f):new Array(0|f);h<t.length;)e=r.indexOf(t.charAt(h++))<<2|(o=r.indexOf(t.charAt(h++)))>>4,i=(15&o)<<4|(a=r.indexOf(t.charAt(h++)))>>2,n=(3&a)<<6|(l=r.indexOf(t.charAt(h++))),d[c++]=e,64!==a&&(d[c++]=i),64!==l&&(d[c++]=n);return d}},{"./support":30,"./utils":32}],2:[function(t,e,i){var n=t("./external"),s=t("./stream/DataWorker"),r=t("./stream/DataLengthProbe"),o=t("./stream/Crc32Probe");function a(t,e,i,n,s){this.compressedSize=t,this.uncompressedSize=e,this.crc32=i,this.compression=n,this.compressedContent=s}r=t("./stream/DataLengthProbe"),a.prototype={getContentWorker:function(){var t=new s(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new r("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new s(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,i){return t.pipe(new o).pipe(new r("uncompressedSize")).pipe(e.compressWorker(i)).pipe(new r("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,i){var n=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(t){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,i){var n=t("./utils"),s=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==n.getTypeOf(t)?function(t,e,i,n){var r=s,o=0+i;t^=-1;for(var a=0;a<o;a++)t=t>>>8^r[255&(t^e[a])];return-1^t}(0|e,t,t.length):function(t,e,i,n){var r=s,o=0+i;t^=-1;for(var a=0;a<o;a++)t=t>>>8^r[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,e,i){var n;n="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:n}},{lie:37}],7:[function(t,e,i){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,s=t("pako"),r=t("./utils"),o=t("./stream/GenericWorker"),a=n?"uint8array":"array";function l(t,e){o.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}i.magic="\b\0",r.inherits(l,o),l.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(r.transformTo(a,t.data),!1)},l.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},i.compressWorker=function(t){return new l("Deflate",t)},i.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,i){function n(t,e){var i,n="";for(i=0;i<e;i++)n+=String.fromCharCode(255&t),t>>>=8;return n}function s(t,e,i,s,o,c){var u,d,f=t.file,p=t.compression,m=c!==a.utf8encode,b=r.transformTo("string",c(f.name)),g=r.transformTo("string",a.utf8encode(f.name)),y=f.comment,S=r.transformTo("string",c(y)),v=r.transformTo("string",a.utf8encode(y)),x=g.length!==f.name.length,E=v.length!==y.length,_="",w="",T="",M=f.dir,P=f.date,L={crc32:0,compressedSize:0,uncompressedSize:0};e&&!i||(L.crc32=t.crc32,L.compressedSize=t.compressedSize,L.uncompressedSize=t.uncompressedSize);var A=0;e&&(A|=8),m||!x&&!E||(A|=2048);var C,I,R,N=0,F=0;M&&(N|=16),"UNIX"===o?(F=798,N|=(C=f.unixPermissions,I=M,R=C,C||(R=I?16893:33204),(65535&R)<<16)):(F=20,N|=function(t){return 63&(t||0)}(f.dosPermissions)),u=P.getUTCHours(),u<<=6,u|=P.getUTCMinutes(),u<<=5,u|=P.getUTCSeconds()/2,d=P.getUTCFullYear()-1980,d<<=4,d|=P.getUTCMonth()+1,d<<=5,d|=P.getUTCDate(),x&&(w=n(1,1)+n(l(b),4)+g,_+="up"+n(w.length,2)+w),E&&(T=n(1,1)+n(l(S),4)+v,_+="uc"+n(T.length,2)+T);var B="";return B+="\n\0",B+=n(A,2),B+=p.magic,B+=n(u,2),B+=n(d,2),B+=n(L.crc32,4),B+=n(L.compressedSize,4),B+=n(L.uncompressedSize,4),B+=n(b.length,2),B+=n(_.length,2),{fileRecord:h.LOCAL_FILE_HEADER+B+b+_,dirRecord:h.CENTRAL_FILE_HEADER+n(F,2)+B+n(S.length,2)+"\0\0\0\0"+n(N,4)+n(s,4)+b+_+S}}var r=t("../utils"),o=t("../stream/GenericWorker"),a=t("../utf8"),l=t("../crc32"),h=t("../signature");function c(t,e,i,n){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=i,this.encodeFileName=n,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(c,o),c.prototype.push=function(t){var e=t.meta.percent||0,i=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,o.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:i?(e+100*(i-n-1))/i:100}}))},c.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var i=s(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0},c.prototype.closedSource=function(t){this.accumulate=!1;var e,i=this.streamFiles&&!t.file.dir,r=s(t,i,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),i)this.push({data:(e=t,h.DATA_DESCRIPTOR+n(e.crc32,4)+n(e.compressedSize,4)+n(e.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},c.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var i,s,o,a,l,c,u=this.bytesWritten-t,d=(i=this.dirRecords.length,s=u,o=t,a=this.zipComment,l=this.encodeFileName,c=r.transformTo("string",l(a)),h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(i,2)+n(i,2)+n(s,4)+n(o,4)+n(c.length,2)+c);this.push({data:d,meta:{percent:100}})},c.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},c.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()})),t.on("error",(function(t){e.error(t)})),this},c.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},c.prototype.error=function(t){var e=this._sources;if(!o.prototype.error.call(this,t))return!1;for(var i=0;i<e.length;i++)try{e[i].error(t)}catch(n){}return!0},c.prototype.lock=function(){o.prototype.lock.call(this);for(var t=this._sources,e=0;e<t.length;e++)t[e].lock()},e.exports=c},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,e,i){var n=t("../compressions"),s=t("./ZipFileWorker");i.generateWorker=function(t,e,i){var r=new s(e.streamFiles,i,e.platform,e.encodeFileName),o=0;try{t.forEach((function(t,i){o++;var s=function(t,e){var i=t||e,s=n[i];if(!s)throw new Error(i+" is not a valid compression method !");return s}(i.options.compression,e.compression),a=i.options.compressionOptions||e.compressionOptions||{},l=i.dir,h=i.date;i._compressWorker(s,a).withStreamInfo("file",{name:t,dir:l,date:h,comment:i.comment||"",unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions}).pipe(r)})),r.entriesCount=o}catch(a){r.error(a)}return r}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,e,i){function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var t=new n;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}(n.prototype=t("./object")).loadAsync=t("./load"),n.support=t("./support"),n.defaults=t("./defaults"),n.version="3.4.0",n.loadAsync=function(t,e){return(new n).loadAsync(t,e)},n.external=t("./external"),e.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,e,i){var n=t("./utils"),s=t("./external"),r=t("./utf8"),o=(n=t("./utils"),t("./zipEntries")),a=t("./stream/Crc32Probe"),l=t("./nodejsUtils");function h(t){return new s.Promise((function(e,i){var n=t.decompressed.getContentWorker().pipe(new a);n.on("error",(function(t){i(t)})).on("end",(function(){n.streamInfo.crc32!==t.decompressed.crc32?i(new Error("Corrupted zip : CRC32 mismatch")):e()})).resume()}))}e.exports=function(t,e){var i=this;return e=n.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),l.isNode&&l.isStream(t)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then((function(t){var i=new o(e);return i.load(t),i})).then((function(t){var i=[s.Promise.resolve(t)],n=t.files;if(e.checkCRC32)for(var r=0;r<n.length;r++)i.push(h(n[r]));return s.Promise.all(i)})).then((function(t){for(var n=t.shift(),s=n.files,r=0;r<s.length;r++){var o=s[r];i.file(o.fileNameStr,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileCommentStr.length?o.fileCommentStr:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:e.createFolders})}return n.zipComment.length&&(i.comment=n.zipComment),i}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,e,i){var n=t("../utils"),s=t("../stream/GenericWorker");function r(t,e){s.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}n.inherits(r,s),r.prototype._bindStream=function(t){var e=this;(this._stream=t).pause(),t.on("data",(function(t){e.push({data:t,meta:{percent:0}})})).on("error",(function(t){e.isPaused?this.generatedError=t:e.error(t)})).on("end",(function(){e.isPaused?e._upstreamEnded=!0:e.end()}))},r.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,e,i){var n=t("readable-stream").Readable;function s(t,e,i){n.call(this,e),this._helper=t;var s=this;t.on("data",(function(t,e){s.push(t)||s._helper.pause(),i&&i(e)})).on("error",(function(t){s.emit("error",t)})).on("end",(function(){s.push(null)}))}t("../utils").inherits(s,n),s.prototype._read=function(){this._helper.resume()},e.exports=s},{"../utils":32,"readable-stream":16}],14:[function(t,i,n){i.exports={isNode:void 0!==e,newBufferFrom:function(t,i){if(e.from&&e.from!==Uint8Array.from)return e.from(t,i);if("number"==typeof t)throw new Error('The "data" argument must not be a number');return new e(t,i)},allocBuffer:function(t){if(e.alloc)return e.alloc(t);var i=new e(t);return i.fill(0),i},isBuffer:function(t){return e.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},{}],15:[function(t,e,i){function n(t,e,i){var n,s=r.getTypeOf(e),a=r.extend(i||{},l);a.date=a.date||new Date,null!==a.compression&&(a.compression=a.compression.toUpperCase()),"string"==typeof a.unixPermissions&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&16384&a.unixPermissions&&(a.dir=!0),a.dosPermissions&&16&a.dosPermissions&&(a.dir=!0),a.dir&&(t=m(t)),a.createFolders&&(n=p(t))&&b.call(this,n,!0);var u,g="string"===s&&!1===a.binary&&!1===a.base64;i&&void 0!==i.binary||(a.binary=!g),(e instanceof h&&0===e.uncompressedSize||a.dir||!e||0===e.length)&&(a.base64=!1,a.binary=!0,e="",a.compression="STORE",s="string"),u=e instanceof h||e instanceof o?e:d.isNode&&d.isStream(e)?new f(t,e):r.prepareContent(t,e,a.binary,a.optimizedBinaryString,a.base64);var y=new c(t,u,a);this.files[t]=y}var s=t("./utf8"),r=t("./utils"),o=t("./stream/GenericWorker"),a=t("./stream/StreamHelper"),l=t("./defaults"),h=t("./compressedObject"),c=t("./zipObject"),u=t("./generate"),d=t("./nodejsUtils"),f=t("./nodejs/NodejsStreamInputAdapter"),p=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return 0<e?t.substring(0,e):""},m=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},b=function(t,e){return e=void 0!==e?e:l.createFolders,t=m(t),this.files[t]||n.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function g(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var y={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,i,n;for(e in this.files)this.files.hasOwnProperty(e)&&(n=this.files[e],(i=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(i,n))},filter:function(t){var e=[];return this.forEach((function(i,n){t(i,n)&&e.push(n)})),e},file:function(t,e,i){if(1!==arguments.length)return t=this.root+t,n.call(this,t,e,i),this;if(g(t)){var s=t;return this.filter((function(t,e){return!e.dir&&s.test(t)}))}var r=this.files[this.root+t];return r&&!r.dir?r:null},folder:function(t){if(!t)return this;if(g(t))return this.filter((function(e,i){return i.dir&&t.test(e)}));var e=this.root+t,i=b.call(this,e),n=this.clone();return n.root=i.name,n},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var i=this.filter((function(e,i){return i.name.slice(0,t.length)===t})),n=0;n<i.length;n++)delete this.files[i[n].name];return this},generate:function(t){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var e,i={};try{if((i=r.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=i.type.toLowerCase(),i.compression=i.compression.toUpperCase(),"binarystring"===i.type&&(i.type="string"),!i.type)throw new Error("No output type specified.");r.checkSupport(i.type),"darwin"!==i.platform&&"freebsd"!==i.platform&&"linux"!==i.platform&&"sunos"!==i.platform||(i.platform="UNIX"),"win32"===i.platform&&(i.platform="DOS");var n=i.comment||this.comment||"";e=u.generateWorker(this,i,n)}catch(l){(e=new o("error")).error(l)}return new a(e,i.type||"string",i.mimeType)},generateAsync:function(t,e){return this.generateInternalStream(t).accumulate(e)},generateNodeStream:function(t,e){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(e)}};e.exports=y},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,e,i){e.exports=t("stream")},{stream:void 0}],17:[function(t,e,i){var n=t("./DataReader");function s(t){n.call(this,t);for(var e=0;e<this.data.length;e++)t[e]=255&t[e]}t("../utils").inherits(s,n),s.prototype.byteAt=function(t){return this.data[this.zero+t]},s.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),i=t.charCodeAt(1),n=t.charCodeAt(2),s=t.charCodeAt(3),r=this.length-4;0<=r;--r)if(this.data[r]===e&&this.data[r+1]===i&&this.data[r+2]===n&&this.data[r+3]===s)return r-this.zero;return-1},s.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),i=t.charCodeAt(1),n=t.charCodeAt(2),s=t.charCodeAt(3),r=this.readData(4);return e===r[0]&&i===r[1]&&n===r[2]&&s===r[3]},s.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./DataReader":18}],18:[function(t,e,i){var n=t("../utils");function s(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(t){},readInt:function(t){var e,i=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)i=(i<<8)+this.byteAt(e);return this.index+=t,i},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=s},{"../utils":32}],19:[function(t,e,i){var n=t("./Uint8ArrayReader");function s(t){n.call(this,t)}t("../utils").inherits(s,n),s.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,i){var n=t("./DataReader");function s(t){n.call(this,t)}t("../utils").inherits(s,n),s.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},s.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},s.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},s.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./DataReader":18}],21:[function(t,e,i){var n=t("./ArrayReader");function s(t){n.call(this,t)}t("../utils").inherits(s,n),s.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,i){var n=t("../utils"),s=t("../support"),r=t("./ArrayReader"),o=t("./StringReader"),a=t("./NodeBufferReader"),l=t("./Uint8ArrayReader");e.exports=function(t){var e=n.getTypeOf(t);return n.checkSupport(e),"string"!==e||s.uint8array?"nodebuffer"===e?new a(t):s.uint8array?new l(n.transformTo("uint8array",t)):new r(n.transformTo("array",t)):new o(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,i){var n=t("./GenericWorker"),s=t("../utils");function r(t){n.call(this,"ConvertWorker to "+t),this.destType=t}s.inherits(r,n),r.prototype.processChunk=function(t){this.push({data:s.transformTo(this.destType,t.data),meta:t.meta})},e.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,i){var n=t("./GenericWorker"),s=t("../crc32");function r(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(r,n),r.prototype.processChunk=function(t){this.streamInfo.crc32=s(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,i){var n=t("../utils"),s=t("./GenericWorker");function r(t){s.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}n.inherits(r,s),r.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}s.prototype.processChunk.call(this,t)},e.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,i){var n=t("../utils"),s=t("./GenericWorker");function r(t){s.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}n.inherits(r,s),r.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,i){function n(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var i=0;i<this._listeners[t].length;i++)this._listeners[t][i].call(this,e)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.end()})),t.on("error",(function(t){e.error(t)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var t=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}},e.exports=n},{}],29:[function(t,i,n){var s=t("../utils"),r=t("./ConvertWorker"),o=t("./GenericWorker"),a=t("../base64"),l=t("../support"),h=t("../external"),c=null;if(l.nodestream)try{c=t("../nodejs/NodejsStreamOutputAdapter")}catch(d){}function u(t,e,i){var n=e;switch(e){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=e,this._mimeType=i,s.checkSupport(n),this._worker=t.pipe(new r(n)),t.lock()}catch(a){this._worker=new o("error"),this._worker.error(a)}}u.prototype={accumulate:function(t){return i=this,n=t,new h.Promise((function(t,r){var o=[],l=i._internalType,h=i._outputType,c=i._mimeType;i.on("data",(function(t,e){o.push(t),n&&n(e)})).on("error",(function(t){o=[],r(t)})).on("end",(function(){try{var i=function(t,e,i){switch(t){case"blob":return s.newBlob(s.transformTo("arraybuffer",e),i);case"base64":return a.encode(e);default:return s.transformTo(t,e)}}(h,function(t,i){var n,s=0,r=null,o=0;for(n=0;n<i.length;n++)o+=i[n].length;switch(t){case"string":return i.join("");case"array":return Array.prototype.concat.apply([],i);case"uint8array":for(r=new Uint8Array(o),n=0;n<i.length;n++)r.set(i[n],s),s+=i[n].length;return r;case"nodebuffer":return e.concat(i);default:throw new Error("concat : unsupported type '"+t+"'")}}(l,o),c);t(i)}catch(n){r(n)}o=[]})).resume()}));var i,n},on:function(t,e){var i=this;return"data"===t?this._worker.on(t,(function(t){e.call(i,t.data,t.meta)})):this._worker.on(t,(function(){s.delay(e,arguments,i)})),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(s.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new c(this,{objectMode:"nodebuffer"!==this._outputType},t)}},i.exports=u},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,i,n){if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,n.nodebuffer=void 0!==e,n.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)n.blob=!1;else{var s=new ArrayBuffer(0);try{n.blob=0===new Blob([s],{type:"application/zip"}).size}catch(o){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);r.append(s),n.blob=0===r.getBlob("application/zip").size}catch(a){n.blob=!1}}}try{n.nodestream=!!t("readable-stream").Readable}catch(o){n.nodestream=!1}},{"readable-stream":16}],31:[function(t,e,i){for(var n=t("./utils"),s=t("./support"),r=t("./nodejsUtils"),o=t("./stream/GenericWorker"),a=new Array(256),l=0;l<256;l++)a[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function h(){o.call(this,"utf-8 decode"),this.leftOver=null}function c(){o.call(this,"utf-8 encode")}a[254]=a[254]=1,i.utf8encode=function(t){return s.nodebuffer?r.newBufferFrom(t,"utf-8"):function(t){var e,i,n,r,o,a=t.length,l=0;for(r=0;r<a;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<a&&56320==(64512&(n=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(n-56320),r++),l+=i<128?1:i<2048?2:i<65536?3:4;for(e=s.uint8array?new Uint8Array(l):new Array(l),r=o=0;o<l;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<a&&56320==(64512&(n=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(n-56320),r++),i<128?e[o++]=i:(i<2048?e[o++]=192|i>>>6:(i<65536?e[o++]=224|i>>>12:(e[o++]=240|i>>>18,e[o++]=128|i>>>12&63),e[o++]=128|i>>>6&63),e[o++]=128|63&i);return e}(t)},i.utf8decode=function(t){return s.nodebuffer?n.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,i,s,r,o=t.length,l=new Array(2*o);for(e=i=0;e<o;)if((s=t[e++])<128)l[i++]=s;else if(4<(r=a[s]))l[i++]=65533,e+=r-1;else{for(s&=2===r?31:3===r?15:7;1<r&&e<o;)s=s<<6|63&t[e++],r--;1<r?l[i++]=65533:s<65536?l[i++]=s:(s-=65536,l[i++]=55296|s>>10&1023,l[i++]=56320|1023&s)}return l.length!==i&&(l.subarray?l=l.subarray(0,i):l.length=i),n.applyFromCharCode(l)}(t=n.transformTo(s.uint8array?"uint8array":"array",t))},n.inherits(h,o),h.prototype.processChunk=function(t){var e=n.transformTo(s.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var r=e;(e=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),e.set(r,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var o=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+a[t[i]]>e?i:e}(e),l=e;o!==e.length&&(s.uint8array?(l=e.subarray(0,o),this.leftOver=e.subarray(o,e.length)):(l=e.slice(0,o),this.leftOver=e.slice(o,e.length))),this.push({data:i.utf8decode(l),meta:t.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=h,n.inherits(c,o),c.prototype.processChunk=function(t){this.push({data:i.utf8encode(t.data),meta:t.meta})},i.Utf8EncodeWorker=c},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,i){var n=t("./support"),s=t("./base64"),r=t("./nodejsUtils"),o=t("set-immediate-shim"),a=t("./external");function l(t){return t}function h(t,e){for(var i=0;i<t.length;++i)e[i]=255&t.charCodeAt(i);return e}i.newBlob=function(t,e){i.checkSupport("blob");try{return new Blob([t],{type:e})}catch(s){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(t),n.getBlob(e)}catch(r){throw new Error("Bug : can't construct the Blob.")}}};var c={stringifyByChunk:function(t,e,i){var n=[],s=0,r=t.length;if(r<=i)return String.fromCharCode.apply(null,t);for(;s<r;)"array"===e||"nodebuffer"===e?n.push(String.fromCharCode.apply(null,t.slice(s,Math.min(s+i,r)))):n.push(String.fromCharCode.apply(null,t.subarray(s,Math.min(s+i,r)))),s+=i;return n.join("")},stringifyByChar:function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},applyCanBeUsed:{uint8array:function(){try{return n.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return n.nodebuffer&&1===String.fromCharCode.apply(null,r.allocBuffer(1)).length}catch(t){return!1}}()}};function u(t){var e=65536,n=i.getTypeOf(t),s=!0;if("uint8array"===n?s=c.applyCanBeUsed.uint8array:"nodebuffer"===n&&(s=c.applyCanBeUsed.nodebuffer),s)for(;1<e;)try{return c.stringifyByChunk(t,n,e)}catch(r){e=Math.floor(e/2)}return c.stringifyByChar(t)}function d(t,e){for(var i=0;i<t.length;i++)e[i]=t[i];return e}i.applyFromCharCode=u;var f={};f.string={string:l,array:function(t){return h(t,new Array(t.length))},arraybuffer:function(t){return f.string.uint8array(t).buffer},uint8array:function(t){return h(t,new Uint8Array(t.length))},nodebuffer:function(t){return h(t,r.allocBuffer(t.length))}},f.array={string:u,array:l,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return r.newBufferFrom(t)}},f.arraybuffer={string:function(t){return u(new Uint8Array(t))},array:function(t){return d(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:l,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return r.newBufferFrom(new Uint8Array(t))}},f.uint8array={string:u,array:function(t){return d(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:l,nodebuffer:function(t){return r.newBufferFrom(t)}},f.nodebuffer={string:u,array:function(t){return d(t,new Array(t.length))},arraybuffer:function(t){return f.nodebuffer.uint8array(t).buffer},uint8array:function(t){return d(t,new Uint8Array(t.length))},nodebuffer:l},i.transformTo=function(t,e){if(e=e||"",!t)return e;i.checkSupport(t);var n=i.getTypeOf(e);return f[n][t](e)},i.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":n.nodebuffer&&r.isBuffer(t)?"nodebuffer":n.uint8array&&t instanceof Uint8Array?"uint8array":n.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(t){if(!n[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(t){var e,i,n="";for(i=0;i<(t||"").length;i++)n+="\\x"+((e=t.charCodeAt(i))<16?"0":"")+e.toString(16).toUpperCase();return n},i.delay=function(t,e,i){o((function(){t.apply(i||null,e||[])}))},i.inherits=function(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i},i.extend=function(){var t,e,i={};for(t=0;t<arguments.length;t++)for(e in arguments[t])arguments[t].hasOwnProperty(e)&&void 0===i[e]&&(i[e]=arguments[t][e]);return i},i.prepareContent=function(t,e,r,o,l){return a.Promise.resolve(e).then((function(t){return n.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new a.Promise((function(e,i){var n=new FileReader;n.onload=function(t){e(t.target.result)},n.onerror=function(t){i(t.target.error)},n.readAsArrayBuffer(t)})):t})).then((function(e){var c,u=i.getTypeOf(e);return u?("arraybuffer"===u?e=i.transformTo("uint8array",e):"string"===u&&(l?e=s.decode(e):r&&!0!==o&&(e=h(c=e,n.uint8array?new Uint8Array(c.length):new Array(c.length)))),e):a.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,"set-immediate-shim":54}],33:[function(t,e,i){var n=t("./reader/readerFor"),s=t("./utils"),r=t("./signature"),o=t("./zipEntry"),a=(t("./utf8"),t("./support"));function l(t){this.files=[],this.loadOptions=t}l.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(e)+", expected "+s.pretty(t)+")")}},isSignature:function(t,e){var i=this.reader.index;this.reader.setIndex(t);var n=this.reader.readString(4)===e;return this.reader.setIndex(i),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=a.uint8array?"uint8array":"array",i=s.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(i)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,i,n=this.zip64EndOfCentralSize-44;0<n;)t=this.reader.readInt(2),e=this.reader.readInt(4),i=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:i}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(t=new o({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(t<0)throw this.isSignature(0,r.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(t);var e=t;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var n=e-i;if(0<n)this.isSignature(e,r.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(t){this.reader=n(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=l},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(t,e,i){var n=t("./reader/readerFor"),s=t("./utils"),r=t("./compressedObject"),o=t("./crc32"),a=t("./utf8"),l=t("./compressions"),h=t("./support");function c(t,e){this.options=t,this.loadOptions=e}c.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(t){var e,i;if(t.skip(22),this.fileNameLength=t.readInt(2),i=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(i),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in l)if(l.hasOwnProperty(e)&&l[e].magic===t)return l[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,i,n,s=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index<s;)e=t.readInt(2),i=t.readInt(2),n=t.readData(i),this.extraFields[e]={id:e,length:i,value:n}},handleUTF8:function(){var t=h.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=a.utf8decode(this.fileName),this.fileCommentStr=a.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var i=s.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(i)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var r=s.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(r)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=n(t.value);return 1!==e.readInt(1)||o(this.fileName)!==e.readInt(4)?null:a.utf8decode(e.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=n(t.value);return 1!==e.readInt(1)||o(this.fileComment)!==e.readInt(4)?null:a.utf8decode(e.readData(t.length-5))}return null}},e.exports=c},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,e,i){function n(t,e,i){this.name=t,this.dir=i.dir,this.date=i.date,this.comment=i.comment,this.unixPermissions=i.unixPermissions,this.dosPermissions=i.dosPermissions,this._data=e,this._dataBinary=i.binary,this.options={compression:i.compression,compressionOptions:i.compressionOptions}}var s=t("./stream/StreamHelper"),r=t("./stream/DataWorker"),o=t("./utf8"),a=t("./compressedObject"),l=t("./stream/GenericWorker");n.prototype={internalStream:function(t){var e=null,i="string";try{if(!t)throw new Error("No output type specified.");var n="string"===(i=t.toLowerCase())||"text"===i;"binarystring"!==i&&"text"!==i||(i="string"),e=this._decompressWorker();var r=!this._dataBinary;r&&!n&&(e=e.pipe(new o.Utf8EncodeWorker)),!r&&n&&(e=e.pipe(new o.Utf8DecodeWorker))}catch(a){(e=new l("error")).error(a)}return new s(e,i,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof a&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var i=this._decompressWorker();return this._dataBinary||(i=i.pipe(new o.Utf8EncodeWorker)),a.createWorkerFrom(i,t,e)},_decompressWorker:function(){return this._data instanceof a?this._data.getContentWorker():this._data instanceof l?this._data:new r(this._data)}};for(var h=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],c=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},u=0;u<h.length;u++)n.prototype[h[u]]=c;e.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,e,n){(function(t){var i,n,s=t.MutationObserver||t.WebKitMutationObserver;if(s){var r=0,o=new s(c),a=t.document.createTextNode("");o.observe(a,{characterData:!0}),i=function(){a.data=r=++r%2}}else if(t.setImmediate||void 0===t.MessageChannel)i="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){c(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(c,0)};else{var l=new t.MessageChannel;l.port1.onmessage=c,i=function(){l.port2.postMessage(0)}}var h=[];function c(){var t,e;n=!0;for(var i=h.length;i;){for(e=h,h=[],t=-1;++t<i;)e[t]();i=h.length}n=!1}e.exports=function(t){1!==h.push(t)||n||i()}}).call(this,void 0!==i?i:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(t,e,i){var n=t("immediate");function s(){}var r={},o=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function h(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,t!==s&&f(this,t)}function c(t,e,i){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof i&&(this.onRejected=i,this.callRejected=this.otherCallRejected)}function u(t,e,i){n((function(){var n;try{n=e(i)}catch(s){return r.reject(t,s)}n===t?r.reject(t,new TypeError("Cannot resolve promise with itself")):r.resolve(t,n)}))}function d(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function f(t,e){var i=!1;function n(e){i||(i=!0,r.reject(t,e))}function s(e){i||(i=!0,r.resolve(t,e))}var o=p((function(){e(s,n)}));"error"===o.status&&n(o.value)}function p(t,e){var i={};try{i.value=t(e),i.status="success"}catch(n){i.status="error",i.value=n}return i}(e.exports=h).prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then((function(i){return e.resolve(t()).then((function(){return i}))}),(function(i){return e.resolve(t()).then((function(){throw i}))}))},h.prototype.catch=function(t){return this.then(null,t)},h.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===o)return this;var i=new this.constructor(s);return this.state!==l?u(i,this.state===a?t:e,this.outcome):this.queue.push(new c(i,t,e)),i},c.prototype.callFulfilled=function(t){r.resolve(this.promise,t)},c.prototype.otherCallFulfilled=function(t){u(this.promise,this.onFulfilled,t)},c.prototype.callRejected=function(t){r.reject(this.promise,t)},c.prototype.otherCallRejected=function(t){u(this.promise,this.onRejected,t)},r.resolve=function(t,e){var i=p(d,e);if("error"===i.status)return r.reject(t,i.value);var n=i.value;if(n)f(t,n);else{t.state=a,t.outcome=e;for(var s=-1,o=t.queue.length;++s<o;)t.queue[s].callFulfilled(e)}return t},r.reject=function(t,e){t.state=o,t.outcome=e;for(var i=-1,n=t.queue.length;++i<n;)t.queue[i].callRejected(e);return t},h.resolve=function(t){return t instanceof this?t:r.resolve(new this(s),t)},h.reject=function(t){var e=new this(s);return r.reject(e,t)},h.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,n=!1;if(!i)return this.resolve([]);for(var o=new Array(i),a=0,l=-1,h=new this(s);++l<i;)c(t[l],l);return h;function c(t,s){e.resolve(t).then((function(t){o[s]=t,++a!==i||n||(n=!0,r.resolve(h,o))}),(function(t){n||(n=!0,r.reject(h,t))}))}},h.race=function(t){if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var e=t.length,i=!1;if(!e)return this.resolve([]);for(var n,o=-1,a=new this(s);++o<e;)n=t[o],this.resolve(n).then((function(t){i||(i=!0,r.resolve(a,t))}),(function(t){i||(i=!0,r.reject(a,t))}));return a}},{immediate:36}],38:[function(t,e,i){var n={};(0,t("./lib/utils/common").assign)(n,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,e,i){var n=t("./zlib/deflate"),s=t("./utils/common"),r=t("./utils/strings"),o=t("./zlib/messages"),a=t("./zlib/zstream"),l=Object.prototype.toString;function h(t){if(!(this instanceof h))return new h(t);this.options=s.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var i=n.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==i)throw new Error(o[i]);if(e.header&&n.deflateSetHeader(this.strm,e.header),e.dictionary){var c;if(c="string"==typeof e.dictionary?r.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(i=n.deflateSetDictionary(this.strm,c)))throw new Error(o[i]);this._dict_set=!0}}function c(t,e){var i=new h(e);if(i.push(t,!0),i.err)throw i.msg||o[i.err];return i.result}h.prototype.push=function(t,e){var i,o,a=this.strm,h=this.options.chunkSize;if(this.ended)return!1;o=e===~~e?e:!0===e?4:0,"string"==typeof t?a.input=r.string2buf(t):"[object ArrayBuffer]"===l.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new s.Buf8(h),a.next_out=0,a.avail_out=h),1!==(i=n.deflate(a,o))&&0!==i)return this.onEnd(i),!(this.ended=!0);0!==a.avail_out&&(0!==a.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(r.buf2binstring(s.shrinkBuf(a.output,a.next_out))):this.onData(s.shrinkBuf(a.output,a.next_out)))}while((0<a.avail_in||0===a.avail_out)&&1!==i);return 4===o?(i=n.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,0===i):2!==o||(this.onEnd(0),!(a.avail_out=0))},h.prototype.onData=function(t){this.chunks.push(t)},h.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},i.Deflate=h,i.deflate=c,i.deflateRaw=function(t,e){return(e=e||{}).raw=!0,c(t,e)},i.gzip=function(t,e){return(e=e||{}).gzip=!0,c(t,e)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,e,i){var n=t("./zlib/inflate"),s=t("./utils/common"),r=t("./utils/strings"),o=t("./zlib/constants"),a=t("./zlib/messages"),l=t("./zlib/zstream"),h=t("./zlib/gzheader"),c=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var i=n.inflateInit2(this.strm,e.windowBits);if(i!==o.Z_OK)throw new Error(a[i]);this.header=new h,n.inflateGetHeader(this.strm,this.header)}function d(t,e){var i=new u(e);if(i.push(t,!0),i.err)throw i.msg||a[i.err];return i.result}u.prototype.push=function(t,e){var i,a,l,h,u,d,f=this.strm,p=this.options.chunkSize,m=this.options.dictionary,b=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof t?f.input=r.binstring2buf(t):"[object ArrayBuffer]"===c.call(t)?f.input=new Uint8Array(t):f.input=t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new s.Buf8(p),f.next_out=0,f.avail_out=p),(i=n.inflate(f,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&m&&(d="string"==typeof m?r.string2buf(m):"[object ArrayBuffer]"===c.call(m)?new Uint8Array(m):m,i=n.inflateSetDictionary(this.strm,d)),i===o.Z_BUF_ERROR&&!0===b&&(i=o.Z_OK,b=!1),i!==o.Z_STREAM_END&&i!==o.Z_OK)return this.onEnd(i),!(this.ended=!0);f.next_out&&(0!==f.avail_out&&i!==o.Z_STREAM_END&&(0!==f.avail_in||a!==o.Z_FINISH&&a!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=r.utf8border(f.output,f.next_out),h=f.next_out-l,u=r.buf2string(f.output,l),f.next_out=h,f.avail_out=p-h,h&&s.arraySet(f.output,f.output,l,h,0),this.onData(u)):this.onData(s.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(b=!0)}while((0<f.avail_in||0===f.avail_out)&&i!==o.Z_STREAM_END);return i===o.Z_STREAM_END&&(a=o.Z_FINISH),a===o.Z_FINISH?(i=n.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===o.Z_OK):a!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(f.avail_out=0))},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){t===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},i.Inflate=u,i.inflate=d,i.inflateRaw=function(t,e){return(e=e||{}).raw=!0,d(t,e)},i.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,e,i){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;i.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])}}return t},i.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var s={arraySet:function(t,e,i,n,s){if(e.subarray&&t.subarray)t.set(e.subarray(i,i+n),s);else for(var r=0;r<n;r++)t[s+r]=e[i+r]},flattenChunks:function(t){var e,i,n,s,r,o;for(e=n=0,i=t.length;e<i;e++)n+=t[e].length;for(o=new Uint8Array(n),e=s=0,i=t.length;e<i;e++)r=t[e],o.set(r,s),s+=r.length;return o}},r={arraySet:function(t,e,i,n,s){for(var r=0;r<n;r++)t[s+r]=e[i+r]},flattenChunks:function(t){return[].concat.apply([],t)}};i.setTyped=function(t){t?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,s)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,r))},i.setTyped(n)},{}],42:[function(t,e,i){var n=t("./common"),s=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch(h){s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(h){r=!1}for(var o=new n.Buf8(256),a=0;a<256;a++)o[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;function l(t,e){if(e<65537&&(t.subarray&&r||!t.subarray&&s))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var i="",o=0;o<e;o++)i+=String.fromCharCode(t[o]);return i}o[254]=o[254]=1,i.string2buf=function(t){var e,i,s,r,o,a=t.length,l=0;for(r=0;r<a;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<a&&56320==(64512&(s=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(s-56320),r++),l+=i<128?1:i<2048?2:i<65536?3:4;for(e=new n.Buf8(l),r=o=0;o<l;r++)55296==(64512&(i=t.charCodeAt(r)))&&r+1<a&&56320==(64512&(s=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(s-56320),r++),i<128?e[o++]=i:(i<2048?e[o++]=192|i>>>6:(i<65536?e[o++]=224|i>>>12:(e[o++]=240|i>>>18,e[o++]=128|i>>>12&63),e[o++]=128|i>>>6&63),e[o++]=128|63&i);return e},i.buf2binstring=function(t){return l(t,t.length)},i.binstring2buf=function(t){for(var e=new n.Buf8(t.length),i=0,s=e.length;i<s;i++)e[i]=t.charCodeAt(i);return e},i.buf2string=function(t,e){var i,n,s,r,a=e||t.length,h=new Array(2*a);for(i=n=0;i<a;)if((s=t[i++])<128)h[n++]=s;else if(4<(r=o[s]))h[n++]=65533,i+=r-1;else{for(s&=2===r?31:3===r?15:7;1<r&&i<a;)s=s<<6|63&t[i++],r--;1<r?h[n++]=65533:s<65536?h[n++]=s:(s-=65536,h[n++]=55296|s>>10&1023,h[n++]=56320|1023&s)}return l(h,n)},i.utf8border=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;0<=i&&128==(192&t[i]);)i--;return i<0||0===i?e:i+o[t[i]]>e?i:e}},{"./common":41}],43:[function(t,e,i){e.exports=function(t,e,i,n){for(var s=65535&t|0,r=t>>>16&65535|0,o=0;0!==i;){for(i-=o=2e3<i?2e3:i;r=r+(s=s+e[n++]|0)|0,--o;);s%=65521,r%=65521}return s|r<<16|0}},{}],44:[function(t,e,i){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,e,i){var n=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();e.exports=function(t,e,i,s){var r=n,o=s+i;t^=-1;for(var a=s;a<o;a++)t=t>>>8^r[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,i){var n,s=t("../utils/common"),r=t("./trees"),o=t("./adler32"),a=t("./crc32"),l=t("./messages"),h=-2,c=258,u=262,d=113;function f(t,e){return t.msg=l[e],e}function p(t){return(t<<1)-(4<t?9:0)}function m(t){for(var e=t.length;0<=--e;)t[e]=0}function b(t){var e=t.state,i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(s.arraySet(t.output,e.pending_buf,e.pending_out,i,t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))}function g(t,e){r._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,b(t.strm)}function y(t,e){t.pending_buf[t.pending++]=e}function S(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function v(t,e){var i,n,s=t.max_chain_length,r=t.strstart,o=t.prev_length,a=t.nice_match,l=t.strstart>t.w_size-u?t.strstart-(t.w_size-u):0,h=t.window,d=t.w_mask,f=t.prev,p=t.strstart+c,m=h[r+o-1],b=h[r+o];t.prev_length>=t.good_match&&(s>>=2),a>t.lookahead&&(a=t.lookahead);do{if(h[(i=e)+o]===b&&h[i+o-1]===m&&h[i]===h[r]&&h[++i]===h[r+1]){r+=2,i++;do{}while(h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&r<p);if(n=c-(p-r),r=p-c,o<n){if(t.match_start=e,a<=(o=n))break;m=h[r+o-1],b=h[r+o]}}}while((e=f[e&d])>l&&0!=--s);return o<=t.lookahead?o:t.lookahead}function x(t){var e,i,n,r,l,h,c,d,f,p,m=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=m+(m-u)){for(s.arraySet(t.window,t.window,m,m,0),t.match_start-=m,t.strstart-=m,t.block_start-=m,e=i=t.hash_size;n=t.head[--e],t.head[e]=m<=n?n-m:0,--i;);for(e=i=m;n=t.prev[--e],t.prev[e]=m<=n?n-m:0,--i;);r+=m}if(0===t.strm.avail_in)break;if(h=t.strm,c=t.window,d=t.strstart+t.lookahead,p=void 0,(f=r)<(p=h.avail_in)&&(p=f),i=0===p?0:(h.avail_in-=p,s.arraySet(c,h.input,h.next_in,p,d),1===h.state.wrap?h.adler=o(h.adler,c,p,d):2===h.state.wrap&&(h.adler=a(h.adler,c,p,d)),h.next_in+=p,h.total_in+=p,p),t.lookahead+=i,t.lookahead+t.insert>=3)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[l+3-1])&t.hash_mask,t.prev[l&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=l,l++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<u&&0!==t.strm.avail_in)}function E(t,e){for(var i,n;;){if(t.lookahead<u){if(x(t),t.lookahead<u&&0===e)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==i&&t.strstart-i<=t.w_size-u&&(t.match_length=v(t,i)),t.match_length>=3)if(n=r._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,0!=--t.match_length;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(g(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(g(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(g(t,!1),0===t.strm.avail_out)?1:2}function _(t,e){for(var i,n,s;;){if(t.lookahead<u){if(x(t),t.lookahead<u&&0===e)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==i&&t.prev_length<t.max_lazy_match&&t.strstart-i<=t.w_size-u&&(t.match_length=v(t,i),t.match_length<=5&&(1===t.strategy||3===t.match_length&&4096<t.strstart-t.match_start)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){for(s=t.strstart+t.lookahead-3,n=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=s&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!=--t.prev_length;);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(g(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=r._tr_tally(t,0,t.window[t.strstart-1]))&&g(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=r._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(g(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(g(t,!1),0===t.strm.avail_out)?1:2}function w(t,e,i,n,s){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=n,this.func=s}function T(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(1146),this.dyn_dtree=new s.Buf16(122),this.bl_tree=new s.Buf16(78),m(this.dyn_ltree),m(this.dyn_dtree),m(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(16),this.heap=new s.Buf16(573),m(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(573),m(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function M(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:d,t.adler=2===e.wrap?0:1,e.last_flush=0,r._tr_init(e),0):f(t,h)}function P(t){var e,i=M(t);return 0===i&&((e=t.state).window_size=2*e.w_size,m(e.head),e.max_lazy_match=n[e.level].max_lazy,e.good_match=n[e.level].good_length,e.nice_match=n[e.level].nice_length,e.max_chain_length=n[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i}function L(t,e,i,n,r,o){if(!t)return h;var a=1;if(-1===e&&(e=6),n<0?(a=0,n=-n):15<n&&(a=2,n-=16),r<1||9<r||8!==i||n<8||15<n||e<0||9<e||o<0||4<o)return f(t,h);8===n&&(n=9);var l=new T;return(t.state=l).strm=t,l.wrap=a,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=r+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new s.Buf8(2*l.w_size),l.head=new s.Buf16(l.hash_size),l.prev=new s.Buf16(l.w_size),l.lit_bufsize=1<<r+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new s.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=o,l.method=i,P(t)}n=[new w(0,0,0,0,(function(t,e){var i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(x(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+i;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,g(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-u&&(g(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(g(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(g(t,!1),t.strm.avail_out),1)})),new w(4,4,8,4,E),new w(4,5,16,8,E),new w(4,6,32,32,E),new w(4,4,16,16,_),new w(8,16,32,32,_),new w(8,16,128,128,_),new w(8,32,128,256,_),new w(32,128,258,1024,_),new w(32,258,258,4096,_)],i.deflateInit=function(t,e){return L(t,e,8,15,8,0)},i.deflateInit2=L,i.deflateReset=P,i.deflateResetKeep=M,i.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?h:(t.state.gzhead=e,0):h},i.deflate=function(t,e){var i,s,o,l;if(!t||!t.state||5<e||e<0)return t?f(t,h):h;if(s=t.state,!t.output||!t.input&&0!==t.avail_in||666===s.status&&4!==e)return f(t,0===t.avail_out?-5:h);if(s.strm=t,i=s.last_flush,s.last_flush=e,42===s.status)if(2===s.wrap)t.adler=0,y(s,31),y(s,139),y(s,8),s.gzhead?(y(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),y(s,255&s.gzhead.time),y(s,s.gzhead.time>>8&255),y(s,s.gzhead.time>>16&255),y(s,s.gzhead.time>>24&255),y(s,9===s.level?2:2<=s.strategy||s.level<2?4:0),y(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(y(s,255&s.gzhead.extra.length),y(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(t.adler=a(t.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=69):(y(s,0),y(s,0),y(s,0),y(s,0),y(s,0),y(s,9===s.level?2:2<=s.strategy||s.level<2?4:0),y(s,3),s.status=d);else{var u=8+(s.w_bits-8<<4)<<8;u|=(2<=s.strategy||s.level<2?0:s.level<6?1:6===s.level?2:3)<<6,0!==s.strstart&&(u|=32),u+=31-u%31,s.status=d,S(s,u),0!==s.strstart&&(S(s,t.adler>>>16),S(s,65535&t.adler)),t.adler=1}if(69===s.status)if(s.gzhead.extra){for(o=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>o&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),b(t),o=s.pending,s.pending!==s.pending_buf_size));)y(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>o&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=73)}else s.status=73;if(73===s.status)if(s.gzhead.name){o=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>o&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),b(t),o=s.pending,s.pending===s.pending_buf_size)){l=1;break}l=s.gzindex<s.gzhead.name.length?255&s.gzhead.name.charCodeAt(s.gzindex++):0,y(s,l)}while(0!==l);s.gzhead.hcrc&&s.pending>o&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),0===l&&(s.gzindex=0,s.status=91)}else s.status=91;if(91===s.status)if(s.gzhead.comment){o=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>o&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),b(t),o=s.pending,s.pending===s.pending_buf_size)){l=1;break}l=s.gzindex<s.gzhead.comment.length?255&s.gzhead.comment.charCodeAt(s.gzindex++):0,y(s,l)}while(0!==l);s.gzhead.hcrc&&s.pending>o&&(t.adler=a(t.adler,s.pending_buf,s.pending-o,o)),0===l&&(s.status=103)}else s.status=103;if(103===s.status&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&b(t),s.pending+2<=s.pending_buf_size&&(y(s,255&t.adler),y(s,t.adler>>8&255),t.adler=0,s.status=d)):s.status=d),0!==s.pending){if(b(t),0===t.avail_out)return s.last_flush=-1,0}else if(0===t.avail_in&&p(e)<=p(i)&&4!==e)return f(t,-5);if(666===s.status&&0!==t.avail_in)return f(t,-5);if(0!==t.avail_in||0!==s.lookahead||0!==e&&666!==s.status){var v=2===s.strategy?function(t,e){for(var i;;){if(0===t.lookahead&&(x(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,i=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(g(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(g(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(g(t,!1),0===t.strm.avail_out)?1:2}(s,e):3===s.strategy?function(t,e){for(var i,n,s,o,a=t.window;;){if(t.lookahead<=c){if(x(t),t.lookahead<=c&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0<t.strstart&&(n=a[s=t.strstart-1])===a[++s]&&n===a[++s]&&n===a[++s]){o=t.strstart+c;do{}while(n===a[++s]&&n===a[++s]&&n===a[++s]&&n===a[++s]&&n===a[++s]&&n===a[++s]&&n===a[++s]&&n===a[++s]&&s<o);t.match_length=c-(o-s),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(i=r._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(g(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(g(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(g(t,!1),0===t.strm.avail_out)?1:2}(s,e):n[s.level].func(s,e);if(3!==v&&4!==v||(s.status=666),1===v||3===v)return 0===t.avail_out&&(s.last_flush=-1),0;if(2===v&&(1===e?r._tr_align(s):5!==e&&(r._tr_stored_block(s,0,0,!1),3===e&&(m(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),b(t),0===t.avail_out))return s.last_flush=-1,0}return 4!==e?0:s.wrap<=0?1:(2===s.wrap?(y(s,255&t.adler),y(s,t.adler>>8&255),y(s,t.adler>>16&255),y(s,t.adler>>24&255),y(s,255&t.total_in),y(s,t.total_in>>8&255),y(s,t.total_in>>16&255),y(s,t.total_in>>24&255)):(S(s,t.adler>>>16),S(s,65535&t.adler)),b(t),0<s.wrap&&(s.wrap=-s.wrap),0!==s.pending?0:1)},i.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&e!==d&&666!==e?f(t,h):(t.state=null,e===d?f(t,-3):0):h},i.deflateSetDictionary=function(t,e){var i,n,r,a,l,c,u,d,f=e.length;if(!t||!t.state)return h;if(2===(a=(i=t.state).wrap)||1===a&&42!==i.status||i.lookahead)return h;for(1===a&&(t.adler=o(t.adler,e,f,0)),i.wrap=0,f>=i.w_size&&(0===a&&(m(i.head),i.strstart=0,i.block_start=0,i.insert=0),d=new s.Buf8(i.w_size),s.arraySet(d,e,f-i.w_size,i.w_size,0),e=d,f=i.w_size),l=t.avail_in,c=t.next_in,u=t.input,t.avail_in=f,t.next_in=0,t.input=e,x(i);i.lookahead>=3;){for(n=i.strstart,r=i.lookahead-2;i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+3-1])&i.hash_mask,i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++,--r;);i.strstart=n,i.lookahead=2,x(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=c,t.input=u,t.avail_in=l,i.wrap=a,0},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,e,i){e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,e,i){e.exports=function(t,e){var i,n,s,r,o,a,l,h,c,u,d,f,p,m,b,g,y,S,v,x,E,_,w,T,M;i=t.state,n=t.next_in,T=t.input,s=n+(t.avail_in-5),r=t.next_out,M=t.output,o=r-(e-t.avail_out),a=r+(t.avail_out-257),l=i.dmax,h=i.wsize,c=i.whave,u=i.wnext,d=i.window,f=i.hold,p=i.bits,m=i.lencode,b=i.distcode,g=(1<<i.lenbits)-1,y=(1<<i.distbits)-1;t:do{p<15&&(f+=T[n++]<<p,p+=8,f+=T[n++]<<p,p+=8),S=m[f&g];e:for(;;){if(f>>>=v=S>>>24,p-=v,0==(v=S>>>16&255))M[r++]=65535&S;else{if(!(16&v)){if(0==(64&v)){S=m[(65535&S)+(f&(1<<v)-1)];continue e}if(32&v){i.mode=12;break t}t.msg="invalid literal/length code",i.mode=30;break t}x=65535&S,(v&=15)&&(p<v&&(f+=T[n++]<<p,p+=8),x+=f&(1<<v)-1,f>>>=v,p-=v),p<15&&(f+=T[n++]<<p,p+=8,f+=T[n++]<<p,p+=8),S=b[f&y];i:for(;;){if(f>>>=v=S>>>24,p-=v,!(16&(v=S>>>16&255))){if(0==(64&v)){S=b[(65535&S)+(f&(1<<v)-1)];continue i}t.msg="invalid distance code",i.mode=30;break t}if(E=65535&S,p<(v&=15)&&(f+=T[n++]<<p,(p+=8)<v&&(f+=T[n++]<<p,p+=8)),l<(E+=f&(1<<v)-1)){t.msg="invalid distance too far back",i.mode=30;break t}if(f>>>=v,p-=v,(v=r-o)<E){if(c<(v=E-v)&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(w=d,(_=0)===u){if(_+=h-v,v<x){for(x-=v;M[r++]=d[_++],--v;);_=r-E,w=M}}else if(u<v){if(_+=h+u-v,(v-=u)<x){for(x-=v;M[r++]=d[_++],--v;);if(_=0,u<x){for(x-=v=u;M[r++]=d[_++],--v;);_=r-E,w=M}}}else if(_+=u-v,v<x){for(x-=v;M[r++]=d[_++],--v;);_=r-E,w=M}for(;2<x;)M[r++]=w[_++],M[r++]=w[_++],M[r++]=w[_++],x-=3;x&&(M[r++]=w[_++],1<x&&(M[r++]=w[_++]))}else{for(_=r-E;M[r++]=M[_++],M[r++]=M[_++],M[r++]=M[_++],2<(x-=3););x&&(M[r++]=M[_++],1<x&&(M[r++]=M[_++]))}break}}break}}while(n<s&&r<a);n-=x=p>>3,f&=(1<<(p-=x<<3))-1,t.next_in=n,t.next_out=r,t.avail_in=n<s?s-n+5:5-(n-s),t.avail_out=r<a?a-r+257:257-(r-a),i.hold=f,i.bits=p}},{}],49:[function(t,e,i){var n=t("../utils/common"),s=t("./adler32"),r=t("./crc32"),o=t("./inffast"),a=t("./inftrees"),l=-2;function h(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function u(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):l}function d(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,u(t)):l}function f(t,e){var i,n;return t&&t.state?(n=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15<e)?l:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=i,n.wbits=e,d(t))):l}function p(t,e){var i,n;return t?(n=new c,(t.state=n).window=null,0!==(i=f(t,e))&&(t.state=null),i):l}var m,b,g=!0;function y(t){if(g){var e;for(m=new n.Buf32(512),b=new n.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(1,t.lens,0,288,m,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(2,t.lens,0,32,b,0,t.work,{bits:5}),g=!1}t.lencode=m,t.lenbits=9,t.distcode=b,t.distbits=5}function S(t,e,i,s){var r,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new n.Buf8(o.wsize)),s>=o.wsize?(n.arraySet(o.window,e,i-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(s<(r=o.wsize-o.wnext)&&(r=s),n.arraySet(o.window,e,i-s,r,o.wnext),(s-=r)?(n.arraySet(o.window,e,i-s,s,0),o.wnext=s,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=r))),0}i.inflateReset=d,i.inflateReset2=f,i.inflateResetKeep=u,i.inflateInit=function(t){return p(t,15)},i.inflateInit2=p,i.inflate=function(t,e){var i,c,u,d,f,p,m,b,g,v,x,E,_,w,T,M,P,L,A,C,I,R,N,F,B=0,O=new n.Buf8(4),D=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return l;12===(i=t.state).mode&&(i.mode=13),f=t.next_out,u=t.output,m=t.avail_out,d=t.next_in,c=t.input,p=t.avail_in,b=i.hold,g=i.bits,v=p,x=m,R=0;t:for(;;)switch(i.mode){case 1:if(0===i.wrap){i.mode=13;break}for(;g<16;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(2&i.wrap&&35615===b){O[i.check=0]=255&b,O[1]=b>>>8&255,i.check=r(i.check,O,2,0),g=b=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&b)<<8)+(b>>8))%31){t.msg="incorrect header check",i.mode=30;break}if(8!=(15&b)){t.msg="unknown compression method",i.mode=30;break}if(g-=4,I=8+(15&(b>>>=4)),0===i.wbits)i.wbits=I;else if(I>i.wbits){t.msg="invalid window size",i.mode=30;break}i.dmax=1<<I,t.adler=i.check=1,i.mode=512&b?10:12,g=b=0;break;case 2:for(;g<16;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(i.flags=b,8!=(255&i.flags)){t.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=b>>8&1),512&i.flags&&(O[0]=255&b,O[1]=b>>>8&255,i.check=r(i.check,O,2,0)),g=b=0,i.mode=3;case 3:for(;g<32;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}i.head&&(i.head.time=b),512&i.flags&&(O[0]=255&b,O[1]=b>>>8&255,O[2]=b>>>16&255,O[3]=b>>>24&255,i.check=r(i.check,O,4,0)),g=b=0,i.mode=4;case 4:for(;g<16;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}i.head&&(i.head.xflags=255&b,i.head.os=b>>8),512&i.flags&&(O[0]=255&b,O[1]=b>>>8&255,i.check=r(i.check,O,2,0)),g=b=0,i.mode=5;case 5:if(1024&i.flags){for(;g<16;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}i.length=b,i.head&&(i.head.extra_len=b),512&i.flags&&(O[0]=255&b,O[1]=b>>>8&255,i.check=r(i.check,O,2,0)),g=b=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(p<(E=i.length)&&(E=p),E&&(i.head&&(I=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),n.arraySet(i.head.extra,c,d,E,I)),512&i.flags&&(i.check=r(i.check,c,E,d)),p-=E,d+=E,i.length-=E),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===p)break t;for(E=0;I=c[d+E++],i.head&&I&&i.length<65536&&(i.head.name+=String.fromCharCode(I)),I&&E<p;);if(512&i.flags&&(i.check=r(i.check,c,E,d)),p-=E,d+=E,I)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===p)break t;for(E=0;I=c[d+E++],i.head&&I&&i.length<65536&&(i.head.comment+=String.fromCharCode(I)),I&&E<p;);if(512&i.flags&&(i.check=r(i.check,c,E,d)),p-=E,d+=E,I)break t}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;g<16;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(b!==(65535&i.check)){t.msg="header crc mismatch",i.mode=30;break}g=b=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=12;break;case 10:for(;g<32;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}t.adler=i.check=h(b),g=b=0,i.mode=11;case 11:if(0===i.havedict)return t.next_out=f,t.avail_out=m,t.next_in=d,t.avail_in=p,i.hold=b,i.bits=g,2;t.adler=i.check=1,i.mode=12;case 12:if(5===e||6===e)break t;case 13:if(i.last){b>>>=7&g,g-=7&g,i.mode=27;break}for(;g<3;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}switch(i.last=1&b,g-=1,3&(b>>>=1)){case 0:i.mode=14;break;case 1:if(y(i),i.mode=20,6!==e)break;b>>>=2,g-=2;break t;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=30}b>>>=2,g-=2;break;case 14:for(b>>>=7&g,g-=7&g;g<32;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if((65535&b)!=(b>>>16^65535)){t.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&b,g=b=0,i.mode=15,6===e)break t;case 15:i.mode=16;case 16:if(E=i.length){if(p<E&&(E=p),m<E&&(E=m),0===E)break t;n.arraySet(u,c,d,E,f),p-=E,d+=E,m-=E,f+=E,i.length-=E;break}i.mode=12;break;case 17:for(;g<14;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(i.nlen=257+(31&b),b>>>=5,g-=5,i.ndist=1+(31&b),b>>>=5,g-=5,i.ncode=4+(15&b),b>>>=4,g-=4,286<i.nlen||30<i.ndist){t.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;g<3;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}i.lens[D[i.have++]]=7&b,b>>>=3,g-=3}for(;i.have<19;)i.lens[D[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,N={bits:i.lenbits},R=a(0,i.lens,0,19,i.lencode,0,i.work,N),i.lenbits=N.bits,R){t.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;M=(B=i.lencode[b&(1<<i.lenbits)-1])>>>16&255,P=65535&B,!((T=B>>>24)<=g);){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(P<16)b>>>=T,g-=T,i.lens[i.have++]=P;else{if(16===P){for(F=T+2;g<F;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(b>>>=T,g-=T,0===i.have){t.msg="invalid bit length repeat",i.mode=30;break}I=i.lens[i.have-1],E=3+(3&b),b>>>=2,g-=2}else if(17===P){for(F=T+3;g<F;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}g-=T,I=0,E=3+(7&(b>>>=T)),b>>>=3,g-=3}else{for(F=T+7;g<F;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}g-=T,I=0,E=11+(127&(b>>>=T)),b>>>=7,g-=7}if(i.have+E>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=30;break}for(;E--;)i.lens[i.have++]=I}}if(30===i.mode)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,N={bits:i.lenbits},R=a(1,i.lens,0,i.nlen,i.lencode,0,i.work,N),i.lenbits=N.bits,R){t.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,N={bits:i.distbits},R=a(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,N),i.distbits=N.bits,R){t.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===e)break t;case 20:i.mode=21;case 21:if(6<=p&&258<=m){t.next_out=f,t.avail_out=m,t.next_in=d,t.avail_in=p,i.hold=b,i.bits=g,o(t,x),f=t.next_out,u=t.output,m=t.avail_out,d=t.next_in,c=t.input,p=t.avail_in,b=i.hold,g=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;M=(B=i.lencode[b&(1<<i.lenbits)-1])>>>16&255,P=65535&B,!((T=B>>>24)<=g);){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(M&&0==(240&M)){for(L=T,A=M,C=P;M=(B=i.lencode[C+((b&(1<<L+A)-1)>>L)])>>>16&255,P=65535&B,!(L+(T=B>>>24)<=g);){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}b>>>=L,g-=L,i.back+=L}if(b>>>=T,g-=T,i.back+=T,i.length=P,0===M){i.mode=26;break}if(32&M){i.back=-1,i.mode=12;break}if(64&M){t.msg="invalid literal/length code",i.mode=30;break}i.extra=15&M,i.mode=22;case 22:if(i.extra){for(F=i.extra;g<F;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}i.length+=b&(1<<i.extra)-1,b>>>=i.extra,g-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;M=(B=i.distcode[b&(1<<i.distbits)-1])>>>16&255,P=65535&B,!((T=B>>>24)<=g);){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(0==(240&M)){for(L=T,A=M,C=P;M=(B=i.distcode[C+((b&(1<<L+A)-1)>>L)])>>>16&255,P=65535&B,!(L+(T=B>>>24)<=g);){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}b>>>=L,g-=L,i.back+=L}if(b>>>=T,g-=T,i.back+=T,64&M){t.msg="invalid distance code",i.mode=30;break}i.offset=P,i.extra=15&M,i.mode=24;case 24:if(i.extra){for(F=i.extra;g<F;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}i.offset+=b&(1<<i.extra)-1,b>>>=i.extra,g-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===m)break t;if(E=x-m,i.offset>E){if((E=i.offset-E)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=30;break}_=E>i.wnext?(E-=i.wnext,i.wsize-E):i.wnext-E,E>i.length&&(E=i.length),w=i.window}else w=u,_=f-i.offset,E=i.length;for(m<E&&(E=m),m-=E,i.length-=E;u[f++]=w[_++],--E;);0===i.length&&(i.mode=21);break;case 26:if(0===m)break t;u[f++]=i.length,m--,i.mode=21;break;case 27:if(i.wrap){for(;g<32;){if(0===p)break t;p--,b|=c[d++]<<g,g+=8}if(x-=m,t.total_out+=x,i.total+=x,x&&(t.adler=i.check=i.flags?r(i.check,u,x,f-x):s(i.check,u,x,f-x)),x=m,(i.flags?b:h(b))!==i.check){t.msg="incorrect data check",i.mode=30;break}g=b=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;g<32;){if(0===p)break t;p--,b+=c[d++]<<g,g+=8}if(b!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=30;break}g=b=0}i.mode=29;case 29:R=1;break t;case 30:R=-3;break t;case 31:return-4;case 32:default:return l}return t.next_out=f,t.avail_out=m,t.next_in=d,t.avail_in=p,i.hold=b,i.bits=g,(i.wsize||x!==t.avail_out&&i.mode<30&&(i.mode<27||4!==e))&&S(t,t.output,t.next_out,x-t.avail_out)?(i.mode=31,-4):(v-=t.avail_in,x-=t.avail_out,t.total_in+=v,t.total_out+=x,i.total+=x,i.wrap&&x&&(t.adler=i.check=i.flags?r(i.check,u,x,t.next_out-x):s(i.check,u,x,t.next_out-x)),t.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),(0==v&&0===x||4===e)&&0===R&&(R=-5),R)},i.inflateEnd=function(t){if(!t||!t.state)return l;var e=t.state;return e.window&&(e.window=null),t.state=null,0},i.inflateGetHeader=function(t,e){var i;return t&&t.state?0==(2&(i=t.state).wrap)?l:((i.head=e).done=!1,0):l},i.inflateSetDictionary=function(t,e){var i,n=e.length;return t&&t.state?0!==(i=t.state).wrap&&11!==i.mode?l:11===i.mode&&s(1,e,n,0)!==i.check?-3:S(t,e,n,n)?(i.mode=31,-4):(i.havedict=1,0):l},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,e,i){var n=t("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,i,l,h,c,u,d){var f,p,m,b,g,y,S,v,x,E=d.bits,_=0,w=0,T=0,M=0,P=0,L=0,A=0,C=0,I=0,R=0,N=null,F=0,B=new n.Buf16(16),O=new n.Buf16(16),D=null,k=0;for(_=0;_<=15;_++)B[_]=0;for(w=0;w<l;w++)B[e[i+w]]++;for(P=E,M=15;1<=M&&0===B[M];M--);if(M<P&&(P=M),0===M)return h[c++]=20971520,h[c++]=20971520,d.bits=1,0;for(T=1;T<M&&0===B[T];T++);for(P<T&&(P=T),_=C=1;_<=15;_++)if(C<<=1,(C-=B[_])<0)return-1;if(0<C&&(0===t||1!==M))return-1;for(O[1]=0,_=1;_<15;_++)O[_+1]=O[_]+B[_];for(w=0;w<l;w++)0!==e[i+w]&&(u[O[e[i+w]]++]=w);if(y=0===t?(N=D=u,19):1===t?(N=s,F-=257,D=r,k-=257,256):(N=o,D=a,-1),_=T,g=c,A=w=R=0,m=-1,b=(I=1<<(L=P))-1,1===t&&852<I||2===t&&592<I)return 1;for(;;){for(S=_-A,x=u[w]<y?(v=0,u[w]):u[w]>y?(v=D[k+u[w]],N[F+u[w]]):(v=96,0),f=1<<_-A,T=p=1<<L;h[g+(R>>A)+(p-=f)]=S<<24|v<<16|x|0,0!==p;);for(f=1<<_-1;R&f;)f>>=1;if(0!==f?(R&=f-1,R+=f):R=0,w++,0==--B[_]){if(_===M)break;_=e[i+u[w]]}if(P<_&&(R&b)!==m){for(0===A&&(A=P),g+=T,C=1<<(L=_-A);L+A<M&&!((C-=B[L+A])<=0);)L++,C<<=1;if(I+=1<<L,1===t&&852<I||2===t&&592<I)return 1;h[m=R&b]=P<<24|L<<16|g-c|0}}return 0!==R&&(h[g+R]=_-A<<24|64<<16|0),d.bits=P,0}},{"../utils/common":41}],51:[function(t,e,i){e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,e,i){var n=t("../utils/common");function s(t){for(var e=t.length;0<=--e;)t[e]=0}var r=256,o=286,a=30,l=15,h=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],c=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],d=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],f=new Array(576);s(f);var p=new Array(60);s(p);var m=new Array(512);s(m);var b=new Array(256);s(b);var g=new Array(29);s(g);var y,S,v,x=new Array(a);function E(t,e,i,n,s){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=n,this.max_length=s,this.has_stree=t&&t.length}function _(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function w(t){return t<256?m[t]:m[256+(t>>>7)]}function T(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function M(t,e,i){t.bi_valid>16-i?(t.bi_buf|=e<<t.bi_valid&65535,T(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=i-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)}function P(t,e,i){M(t,i[2*e],i[2*e+1])}function L(t,e){for(var i=0;i|=1&t,t>>>=1,i<<=1,0<--e;);return i>>>1}function A(t,e,i){var n,s,r=new Array(16),o=0;for(n=1;n<=l;n++)r[n]=o=o+i[n-1]<<1;for(s=0;s<=e;s++){var a=t[2*s+1];0!==a&&(t[2*s]=L(r[a]++,a))}}function C(t){var e;for(e=0;e<o;e++)t.dyn_ltree[2*e]=0;for(e=0;e<a;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function I(t){8<t.bi_valid?T(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function R(t,e,i,n){var s=2*e,r=2*i;return t[s]<t[r]||t[s]===t[r]&&n[e]<=n[i]}function N(t,e,i){for(var n=t.heap[i],s=i<<1;s<=t.heap_len&&(s<t.heap_len&&R(e,t.heap[s+1],t.heap[s],t.depth)&&s++,!R(e,n,t.heap[s],t.depth));)t.heap[i]=t.heap[s],i=s,s<<=1;t.heap[i]=n}function F(t,e,i){var n,s,o,a,l=0;if(0!==t.last_lit)for(;n=t.pending_buf[t.d_buf+2*l]<<8|t.pending_buf[t.d_buf+2*l+1],s=t.pending_buf[t.l_buf+l],l++,0===n?P(t,s,e):(P(t,(o=b[s])+r+1,e),0!==(a=h[o])&&M(t,s-=g[o],a),P(t,o=w(--n),i),0!==(a=c[o])&&M(t,n-=x[o],a)),l<t.last_lit;);P(t,256,e)}function B(t,e){var i,n,s,r=e.dyn_tree,o=e.stat_desc.static_tree,a=e.stat_desc.has_stree,h=e.stat_desc.elems,c=-1;for(t.heap_len=0,t.heap_max=573,i=0;i<h;i++)0!==r[2*i]?(t.heap[++t.heap_len]=c=i,t.depth[i]=0):r[2*i+1]=0;for(;t.heap_len<2;)r[2*(s=t.heap[++t.heap_len]=c<2?++c:0)]=1,t.depth[s]=0,t.opt_len--,a&&(t.static_len-=o[2*s+1]);for(e.max_code=c,i=t.heap_len>>1;1<=i;i--)N(t,r,i);for(s=h;i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],N(t,r,1),n=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=n,r[2*s]=r[2*i]+r[2*n],t.depth[s]=(t.depth[i]>=t.depth[n]?t.depth[i]:t.depth[n])+1,r[2*i+1]=r[2*n+1]=s,t.heap[1]=s++,N(t,r,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var i,n,s,r,o,a,h=e.dyn_tree,c=e.max_code,u=e.stat_desc.static_tree,d=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,m=e.stat_desc.max_length,b=0;for(r=0;r<=l;r++)t.bl_count[r]=0;for(h[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;i<573;i++)m<(r=h[2*h[2*(n=t.heap[i])+1]+1]+1)&&(r=m,b++),h[2*n+1]=r,c<n||(t.bl_count[r]++,o=0,p<=n&&(o=f[n-p]),a=h[2*n],t.opt_len+=a*(r+o),d&&(t.static_len+=a*(u[2*n+1]+o)));if(0!==b){do{for(r=m-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[m]--,b-=2}while(0<b);for(r=m;0!==r;r--)for(n=t.bl_count[r];0!==n;)c<(s=t.heap[--i])||(h[2*s+1]!==r&&(t.opt_len+=(r-h[2*s+1])*h[2*s],h[2*s+1]=r),n--)}}(t,e),A(r,c,t.bl_count)}function O(t,e,i){var n,s,r=-1,o=e[1],a=0,l=7,h=4;for(0===o&&(l=138,h=3),e[2*(i+1)+1]=65535,n=0;n<=i;n++)s=o,o=e[2*(n+1)+1],++a<l&&s===o||(a<h?t.bl_tree[2*s]+=a:0!==s?(s!==r&&t.bl_tree[2*s]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,r=s,h=(a=0)===o?(l=138,3):s===o?(l=6,3):(l=7,4))}function D(t,e,i){var n,s,r=-1,o=e[1],a=0,l=7,h=4;for(0===o&&(l=138,h=3),n=0;n<=i;n++)if(s=o,o=e[2*(n+1)+1],!(++a<l&&s===o)){if(a<h)for(;P(t,s,t.bl_tree),0!=--a;);else 0!==s?(s!==r&&(P(t,s,t.bl_tree),a--),P(t,16,t.bl_tree),M(t,a-3,2)):a<=10?(P(t,17,t.bl_tree),M(t,a-3,3)):(P(t,18,t.bl_tree),M(t,a-11,7));r=s,h=(a=0)===o?(l=138,3):s===o?(l=6,3):(l=7,4)}}s(x);var k=!1;function V(t,e,i,s){var r,o,a;M(t,0+(s?1:0),3),o=e,a=i,I(r=t),T(r,a),T(r,~a),n.arraySet(r.pending_buf,r.window,o,a,r.pending),r.pending+=a}i._tr_init=function(t){k||(function(){var t,e,i,n,s,r=new Array(16);for(n=i=0;n<28;n++)for(g[n]=i,t=0;t<1<<h[n];t++)b[i++]=n;for(b[i-1]=n,n=s=0;n<16;n++)for(x[n]=s,t=0;t<1<<c[n];t++)m[s++]=n;for(s>>=7;n<a;n++)for(x[n]=s<<7,t=0;t<1<<c[n]-7;t++)m[256+s++]=n;for(e=0;e<=l;e++)r[e]=0;for(t=0;t<=143;)f[2*t+1]=8,t++,r[8]++;for(;t<=255;)f[2*t+1]=9,t++,r[9]++;for(;t<=279;)f[2*t+1]=7,t++,r[7]++;for(;t<=287;)f[2*t+1]=8,t++,r[8]++;for(A(f,287,r),t=0;t<a;t++)p[2*t+1]=5,p[2*t]=L(t,5);y=new E(f,h,257,o,l),S=new E(p,c,0,a,l),v=new E(new Array(0),u,0,19,7)}(),k=!0),t.l_desc=new _(t.dyn_ltree,y),t.d_desc=new _(t.dyn_dtree,S),t.bl_desc=new _(t.bl_tree,v),t.bi_buf=0,t.bi_valid=0,C(t)},i._tr_stored_block=V,i._tr_flush_block=function(t,e,i,n){var s,o,a=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<r;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),B(t,t.l_desc),B(t,t.d_desc),a=function(t){var e;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),B(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*d[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),s=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=s&&(s=o)):s=o=i+5,i+4<=s&&-1!==e?V(t,e,i,n):4===t.strategy||o===s?(M(t,2+(n?1:0),3),F(t,f,p)):(M(t,4+(n?1:0),3),function(t,e,i,n){var s;for(M(t,e-257,5),M(t,i-1,5),M(t,n-4,4),s=0;s<n;s++)M(t,t.bl_tree[2*d[s]+1],3);D(t,t.dyn_ltree,e-1),D(t,t.dyn_dtree,i-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),F(t,t.dyn_ltree,t.dyn_dtree)),C(t),n&&I(t)},i._tr_tally=function(t,e,i){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(b[i]+r+1)]++,t.dyn_dtree[2*w(e)]++),t.last_lit===t.lit_bufsize-1},i._tr_align=function(t){var e;M(t,2,3),P(t,256,f),16===(e=t).bi_valid?(T(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":41}],53:[function(t,e,i){e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,i){e.exports="function"==typeof n?n:function(){var t=[].slice.apply(arguments);t.splice(1,0,0),setTimeout.apply(null,t)}},{}]},{},[10])(10)}).call(this,i(176).Buffer,i(43),i(180).setImmediate)},function(t,e,i){(function(t){
  2. /*!
  3. * The buffer module from node.js, for the browser.
  4. *
  5. * @author Feross Aboukhadijeh <http://feross.org>
  6. * @license MIT
  7. */
  8. var n=i(177),s=i(178),r=i(179);function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(o()<e)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=l.prototype:(null===t&&(t=new l(e)),t.length=e),t}function l(t,e,i){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(t,e,i);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return u(this,t)}return h(this,t,e,i)}function h(t,e,i,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,i,n){if(e.byteLength,i<0||e.byteLength<i)throw new RangeError("'offset' is out of bounds");if(e.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===i&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,i):new Uint8Array(e,i,n),l.TYPED_ARRAY_SUPPORT?(t=e).__proto__=l.prototype:t=d(t,e),t}(t,e,i,n):"string"==typeof e?function(t,e,i){if("string"==typeof i&&""!==i||(i="utf8"),!l.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,i),s=(t=a(t,n)).write(e,i);return s!==n&&(t=t.slice(0,s)),t}(t,e,i):function(t,e){if(l.isBuffer(e)){var i=0|f(e.length);return 0===(t=a(t,i)).length||e.copy(t,0,0,i),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?a(t,0):d(t,e);if("Buffer"===e.type&&r(e.data))return d(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function u(t,e){if(c(e),t=a(t,e<0?0:0|f(e)),!l.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function d(t,e){var i=e.length<0?0:0|f(e.length);t=a(t,i);for(var n=0;n<i;n+=1)t[n]=255&e[n];return t}function f(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function p(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var i=t.length;if(0===i)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return W(t).length;default:if(n)return G(t).length;e=(""+e).toLowerCase(),n=!0}}function m(t,e,i){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return A(this,e,i);case"utf8":case"utf-8":return M(this,e,i);case"ascii":return P(this,e,i);case"latin1":case"binary":return L(this,e,i);case"base64":return T(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function g(t,e,i,n,s){if(0===t.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=s?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(s)return-1;i=t.length-1}else if(i<0){if(!s)return-1;i=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:y(t,e,i,n,s);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):y(t,[e],i,n,s);throw new TypeError("val must be string, number or Buffer")}function y(t,e,i,n,s){var r,o=1,a=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,i/=2}function h(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(s){var c=-1;for(r=i;r<a;r++)if(h(t,r)===h(e,-1===c?0:r-c)){if(-1===c&&(c=r),r-c+1===l)return c*o}else-1!==c&&(r-=r-c),c=-1}else for(i+l>a&&(i=a-l),r=i;r>=0;r--){for(var u=!0,d=0;d<l;d++)if(h(t,r+d)!==h(e,d)){u=!1;break}if(u)return r}return-1}function S(t,e,i,n){i=Number(i)||0;var s=t.length-i;n?(n=Number(n))>s&&(n=s):n=s;var r=e.length;if(r%2!=0)throw new TypeError("Invalid hex string");n>r/2&&(n=r/2);for(var o=0;o<n;++o){var a=parseInt(e.substr(2*o,2),16);if(isNaN(a))return o;t[i+o]=a}return o}function v(t,e,i,n){return U(G(e,t.length-i),t,i,n)}function x(t,e,i,n){return U(function(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,n)}function E(t,e,i,n){return x(t,e,i,n)}function _(t,e,i,n){return U(W(e),t,i,n)}function w(t,e,i,n){return U(function(t,e){for(var i,n,s,r=[],o=0;o<t.length&&!((e-=2)<0);++o)n=(i=t.charCodeAt(o))>>8,s=i%256,r.push(s),r.push(n);return r}(e,t.length-i),t,i,n)}function T(t,e,i){return 0===e&&i===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,i))}function M(t,e,i){i=Math.min(t.length,i);for(var n=[],s=e;s<i;){var r,o,a,l,h=t[s],c=null,u=h>239?4:h>223?3:h>191?2:1;if(s+u<=i)switch(u){case 1:h<128&&(c=h);break;case 2:128==(192&(r=t[s+1]))&&(l=(31&h)<<6|63&r)>127&&(c=l);break;case 3:r=t[s+1],o=t[s+2],128==(192&r)&&128==(192&o)&&(l=(15&h)<<12|(63&r)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:r=t[s+1],o=t[s+2],a=t[s+3],128==(192&r)&&128==(192&o)&&128==(192&a)&&(l=(15&h)<<18|(63&r)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(c=l)}null===c?(c=65533,u=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),s+=u}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var i="",n=0;n<e;)i+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return i}(n)}function P(t,e,i){var n="";i=Math.min(t.length,i);for(var s=e;s<i;++s)n+=String.fromCharCode(127&t[s]);return n}function L(t,e,i){var n="";i=Math.min(t.length,i);for(var s=e;s<i;++s)n+=String.fromCharCode(t[s]);return n}function A(t,e,i){var n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);for(var s="",r=e;r<i;++r)s+=V(t[r]);return s}function C(t,e,i){for(var n=t.slice(e,i),s="",r=0;r<n.length;r+=2)s+=String.fromCharCode(n[r]+256*n[r+1]);return s}function I(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,i,n,s,r){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>s||e<r)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}function N(t,e,i,n){e<0&&(e=65535+e+1);for(var s=0,r=Math.min(t.length-i,2);s<r;++s)t[i+s]=(e&255<<8*(n?s:1-s))>>>8*(n?s:1-s)}function F(t,e,i,n){e<0&&(e=4294967295+e+1);for(var s=0,r=Math.min(t.length-i,4);s<r;++s)t[i+s]=e>>>8*(n?s:3-s)&255}function B(t,e,i,n,s,r){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function O(t,e,i,n,r){return r||B(t,0,i,4),s.write(t,e,i,n,23,4),i+4}function D(t,e,i,n,r){return r||B(t,0,i,8),s.write(t,e,i,n,52,8),i+8}e.Buffer=l,e.SlowBuffer=function(t){return+t!=t&&(t=0),l.alloc(+t)},e.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}(),e.kMaxLength=o(),l.poolSize=8192,l._augment=function(t){return t.__proto__=l.prototype,t},l.from=function(t,e,i){return h(null,t,e,i)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(t,e,i){return n=null,r=e,o=i,c(s=t),s<=0?a(n,s):void 0!==r?"string"==typeof o?a(n,s).fill(r,o):a(n,s).fill(r):a(n,s);var n,s,r,o},l.allocUnsafe=function(t){return u(null,t)},l.allocUnsafeSlow=function(t){return u(null,t)},l.isBuffer=function(t){return!(null==t||!t._isBuffer)},l.compare=function(t,e){if(!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,n=e.length,s=0,r=Math.min(i,n);s<r;++s)if(t[s]!==e[s]){i=t[s],n=e[s];break}return i<n?-1:n<i?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!r(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);var i;if(void 0===e)for(e=0,i=0;i<t.length;++i)e+=t[i].length;var n=l.allocUnsafe(e),s=0;for(i=0;i<t.length;++i){var o=t[i];if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n},l.byteLength=p,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)b(this,e,e+1);return this},l.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)b(this,e,e+3),b(this,e+1,e+2);return this},l.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},l.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?M(this,0,t):m.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",i=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(t+=" ... ")),"<Buffer "+t+">"},l.prototype.compare=function(t,e,i,n,s){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),e<0||i>t.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&e>=i)return 0;if(n>=s)return-1;if(e>=i)return 1;if(this===t)return 0;for(var r=(s>>>=0)-(n>>>=0),o=(i>>>=0)-(e>>>=0),a=Math.min(r,o),h=this.slice(n,s),c=t.slice(e,i),u=0;u<a;++u)if(h[u]!==c[u]){r=h[u],o=c[u];break}return r<o?-1:o<r?1:0},l.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},l.prototype.indexOf=function(t,e,i){return g(this,t,e,i,!0)},l.prototype.lastIndexOf=function(t,e,i){return g(this,t,e,i,!1)},l.prototype.write=function(t,e,i,n){if(void 0===e)n="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)n=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var s=this.length-e;if((void 0===i||i>s)&&(i=s),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var r=!1;;)switch(n){case"hex":return S(this,t,e,i);case"utf8":case"utf-8":return v(this,t,e,i);case"ascii":return x(this,t,e,i);case"latin1":case"binary":return E(this,t,e,i);case"base64":return _(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,i);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),r=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},l.prototype.slice=function(t,e){var i,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),l.TYPED_ARRAY_SUPPORT)(i=this.subarray(t,e)).__proto__=l.prototype;else{var s=e-t;i=new l(s,void 0);for(var r=0;r<s;++r)i[r]=this[r+t]}return i},l.prototype.readUIntLE=function(t,e,i){t|=0,e|=0,i||I(t,e,this.length);for(var n=this[t],s=1,r=0;++r<e&&(s*=256);)n+=this[t+r]*s;return n},l.prototype.readUIntBE=function(t,e,i){t|=0,e|=0,i||I(t,e,this.length);for(var n=this[t+--e],s=1;e>0&&(s*=256);)n+=this[t+--e]*s;return n},l.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,i){t|=0,e|=0,i||I(t,e,this.length);for(var n=this[t],s=1,r=0;++r<e&&(s*=256);)n+=this[t+r]*s;return n>=(s*=128)&&(n-=Math.pow(2,8*e)),n},l.prototype.readIntBE=function(t,e,i){t|=0,e|=0,i||I(t,e,this.length);for(var n=e,s=1,r=this[t+--n];n>0&&(s*=256);)r+=this[t+--n]*s;return r>=(s*=128)&&(r-=Math.pow(2,8*e)),r},l.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),s.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),s.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),s.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),s.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,i,n){t=+t,e|=0,i|=0,n||R(this,t,e,i,Math.pow(2,8*i)-1,0);var s=1,r=0;for(this[e]=255&t;++r<i&&(s*=256);)this[e+r]=t/s&255;return e+i},l.prototype.writeUIntBE=function(t,e,i,n){t=+t,e|=0,i|=0,n||R(this,t,e,i,Math.pow(2,8*i)-1,0);var s=i-1,r=1;for(this[e+s]=255&t;--s>=0&&(r*=256);)this[e+s]=t/r&255;return e+i},l.prototype.writeUInt8=function(t,e,i){return t=+t,e|=0,i||R(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,i){return t=+t,e|=0,i||R(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,i){return t=+t,e|=0,i||R(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,i){return t=+t,e|=0,i||R(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):F(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,i){return t=+t,e|=0,i||R(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):F(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,i,n){if(t=+t,e|=0,!n){var s=Math.pow(2,8*i-1);R(this,t,e,i,s-1,-s)}var r=0,o=1,a=0;for(this[e]=255&t;++r<i&&(o*=256);)t<0&&0===a&&0!==this[e+r-1]&&(a=1),this[e+r]=(t/o>>0)-a&255;return e+i},l.prototype.writeIntBE=function(t,e,i,n){if(t=+t,e|=0,!n){var s=Math.pow(2,8*i-1);R(this,t,e,i,s-1,-s)}var r=i-1,o=1,a=0;for(this[e+r]=255&t;--r>=0&&(o*=256);)t<0&&0===a&&0!==this[e+r+1]&&(a=1),this[e+r]=(t/o>>0)-a&255;return e+i},l.prototype.writeInt8=function(t,e,i){return t=+t,e|=0,i||R(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,i){return t=+t,e|=0,i||R(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,i){return t=+t,e|=0,i||R(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,i){return t=+t,e|=0,i||R(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):F(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,i){return t=+t,e|=0,i||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):F(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,i){return O(this,t,e,!0,i)},l.prototype.writeFloatBE=function(t,e,i){return O(this,t,e,!1,i)},l.prototype.writeDoubleLE=function(t,e,i){return D(this,t,e,!0,i)},l.prototype.writeDoubleBE=function(t,e,i){return D(this,t,e,!1,i)},l.prototype.copy=function(t,e,i,n){if(i||(i=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-i&&(n=t.length-e+i);var s,r=n-i;if(this===t&&i<e&&e<n)for(s=r-1;s>=0;--s)t[s+e]=this[s+i];else if(r<1e3||!l.TYPED_ARRAY_SUPPORT)for(s=0;s<r;++s)t[s+e]=this[s+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+r),e);return r},l.prototype.fill=function(t,e,i,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1===t.length){var s=t.charCodeAt(0);s<256&&(t=s)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;var r;if(e>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(r=e;r<i;++r)this[r]=t;else{var o=l.isBuffer(t)?t:G(new l(t,n).toString()),a=o.length;for(r=0;r<i-e;++r)this[r+e]=o[r%a]}return this};var k=/[^+\/0-9A-Za-z-_]/g;function V(t){return t<16?"0"+t.toString(16):t.toString(16)}function G(t,e){var i;e=e||1/0;for(var n=t.length,s=null,r=[],o=0;o<n;++o){if((i=t.charCodeAt(o))>55295&&i<57344){if(!s){if(i>56319){(e-=3)>-1&&r.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&r.push(239,191,189);continue}s=i;continue}if(i<56320){(e-=3)>-1&&r.push(239,191,189),s=i;continue}i=65536+(s-55296<<10|i-56320)}else s&&(e-=3)>-1&&r.push(239,191,189);if(s=null,i<128){if((e-=1)<0)break;r.push(i)}else if(i<2048){if((e-=2)<0)break;r.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;r.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;r.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return r}function W(t){return n.toByteArray(function(t){if((t=(e=t,e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")).replace(k,"")).length<2)return"";for(var e;t.length%4!=0;)t+="=";return t}(t))}function U(t,e,i,n){for(var s=0;s<n&&!(s+i>=e.length||s>=t.length);++s)e[s+i]=t[s];return s}}).call(this,i(43))},function(t,e,i){e.byteLength=function(t){var e=h(t),i=e[0],n=e[1];return 3*(i+n)/4-n},e.toByteArray=function(t){var e,i,n,o=h(t),a=o[0],l=o[1],c=new r(3*(a+(n=l))/4-n),u=0,d=l>0?a-4:a;for(i=0;i<d;i+=4)e=s[t.charCodeAt(i)]<<18|s[t.charCodeAt(i+1)]<<12|s[t.charCodeAt(i+2)]<<6|s[t.charCodeAt(i+3)],c[u++]=e>>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===l&&(e=s[t.charCodeAt(i)]<<2|s[t.charCodeAt(i+1)]>>4,c[u++]=255&e),1===l&&(e=s[t.charCodeAt(i)]<<10|s[t.charCodeAt(i+1)]<<4|s[t.charCodeAt(i+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},e.fromByteArray=function(t){for(var e,i=t.length,s=i%3,r=[],o=0,a=i-s;o<a;o+=16383)r.push(c(t,o,o+16383>a?a:o+16383));return 1===s?(e=t[i-1],r.push(n[e>>2]+n[e<<4&63]+"==")):2===s&&(e=(t[i-2]<<8)+t[i-1],r.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),r.join("")};for(var n=[],s=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=o.length;a<l;++a)n[a]=o[a],s[o.charCodeAt(a)]=a;function h(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}function c(t,e,i){for(var s,r,o=[],a=e;a<i;a+=3)s=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(n[(r=s)>>18&63]+n[r>>12&63]+n[r>>6&63]+n[63&r]);return o.join("")}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,i,n,s){var r,o,a=8*s-n-1,l=(1<<a)-1,h=l>>1,c=-7,u=i?s-1:0,d=i?-1:1,f=t[e+u];for(u+=d,r=f&(1<<-c)-1,f>>=-c,c+=a;c>0;r=256*r+t[e+u],u+=d,c-=8);for(o=r&(1<<-c)-1,r>>=-c,c+=n;c>0;o=256*o+t[e+u],u+=d,c-=8);if(0===r)r=1-h;else{if(r===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),r-=h}return(f?-1:1)*o*Math.pow(2,r-n)},e.write=function(t,e,i,n,s,r){var o,a,l,h=8*r-s-1,c=(1<<h)-1,u=c>>1,d=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:r-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=c?(a=0,o=c):o+u>=1?(a=(e*l-1)*Math.pow(2,s),o+=u):(a=e*Math.pow(2,u-1)*Math.pow(2,s),o=0));s>=8;t[i+f]=255&a,f+=p,a/=256,s-=8);for(o=o<<s|a,h+=s;h>0;t[i+f]=255&o,f+=p,o/=256,h-=8);t[i+f-p]|=128*m}},function(t,e){var i={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},function(t,e,i){(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,s=Function.prototype.apply;function r(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new r(s.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new r(s.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},i(181),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,i(43))},function(t,e,i){(function(t,e){!function(t,i){if(!t.setImmediate){var n,s,r,o,a,l=1,h={},c=!1,u=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){p(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,i=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=i,e}}()?(o="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(o)&&p(+e.data.slice(o.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),n=function(e){t.postMessage(o+e,"*")}):t.MessageChannel?((r=new MessageChannel).port1.onmessage=function(t){p(t.data)},n=function(t){r.port2.postMessage(t)}):u&&"onreadystatechange"in u.createElement("script")?(s=u.documentElement,n=function(t){var e=u.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,s.removeChild(e),e=null},s.appendChild(e)}):n=function(t){setTimeout(p,0,t)},d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),i=0;i<e.length;i++)e[i]=arguments[i+1];var s={callback:t,args:e};return h[l]=s,n(l),l++},d.clearImmediate=f}function f(t){delete h[t]}function p(t){if(c)setTimeout(p,0,t);else{var e=h[t];if(e){c=!0;try{!function(t){var e=t.callback,i=t.args;switch(i.length){case 0:e();break;case 1:e(i[0]);break;case 2:e(i[0],i[1]);break;case 3:e(i[0],i[1],i[2]);break;default:e.apply(void 0,i)}}(e)}finally{f(t),c=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,i(43),i(156))},,,function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(185),e),s(i(186),e),s(i(210),e),s(i(212),e)},function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(109),e),s(i(110),e),s(i(25),e),s(i(108),e)},function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(11),e),s(i(73),e),s(i(74),e),s(i(12),e),s(i(135),e),s(i(150),e),s(i(187),e),s(i(189),e),s(i(191),e),s(i(193),e),s(i(202),e)},function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(80),e),s(i(141),e),s(i(48),e),s(i(41),e),s(i(36),e),s(i(76),e),s(i(39),e),s(i(50),e),s(i(106),e),s(i(31),e),s(i(118),e),s(i(144),e),s(i(107),e),s(i(142),e),s(i(54),e),s(i(51),e),s(i(14),e),s(i(188),e),s(i(36),e),s(i(39),e),s(i(106),e),s(i(31),e),s(i(54),e),s(i(107),e)},function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(49),e),s(i(7),e),s(i(18),e),s(i(28),e),s(i(19),e),s(i(146),e)},function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(190),e),s(i(81),e),s(i(136),e),s(i(137),e)},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.MappingSourceMusicPart=void 0,e.MappingSourceMusicPart=class{constructor(t,e,i,n=-1,s=!1){this.repetitionRun=-1,this.sourceMusicPart=t,this.parentPartListEntry=i,this.startTimestamp=e.clone(),this.repetitionRun=n,this.parentRepetition=i,this.isEnding=s}get IsRepetition(){return void 0!==this.parentRepetition}get IsEnding(){return this.isEnding}get IsLastRepetitionRun(){return this.IsRepetition&&this.repetitionRun+1===this.parentRepetition.UserNumberOfRepetitions}get RepetitionRun(){return this.repetitionRun}get ParentPartListEntry(){return this.parentPartListEntry}get SourceMusicPart(){return this.sourceMusicPart}get StartTimestamp(){return this.startTimestamp}CompareTo(t){return t?this.startTimestamp.CompareTo(t.startTimestamp):1}}},function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(139),e),s(i(134),e),s(i(151),e),s(i(140),e),s(i(192),e),s(i(154),e)},function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(145),e),s(i(147),e),s(i(148),e),s(i(143),e),s(i(153),e),s(i(152),e),s(i(149),e)},function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(42),e),s(i(194),e),s(i(116),e),s(i(78),e),s(i(5),e),s(i(114),e),s(i(22),e),s(i(120),e),s(i(33),e),s(i(26),e),s(i(127),e),s(i(195),e),s(i(52),e),s(i(132),e),s(i(79),e),s(i(70),e),s(i(24),e),s(i(27),e),s(i(129),e),s(i(130),e),s(i(196),e),s(i(122),e),s(i(45),e),s(i(68),e),s(i(71),e),s(i(6),e),s(i(123),e),s(i(197),e),s(i(131),e),s(i(124),e),s(i(198),e),s(i(128),e),s(i(69),e),s(i(199),e),s(i(17),e),s(i(119),e),s(i(77),e),s(i(117),e),s(i(113),e),s(i(115),e),s(i(200),e),s(i(201),e),s(i(126),e),s(i(125),e),s(i(47),e),s(i(75),e),s(i(40),e),s(i(23),e),s(i(112),e),s(i(121),e)},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractGraphicalInstruction=void 0;const n=i(6);class s extends n.GraphicalObject{constructor(t){super(),this.parent=t}get Parent(){return this.parent}set Parent(t){this.parent=t}}e.AbstractGraphicalInstruction=s},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalComment=void 0,e.GraphicalComment=class{constructor(t,e){this.label=t,this.settings=e}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalMarkedArea=void 0,e.GraphicalMarkedArea=class{constructor(t,e,i,n){this.systemRectangle=t,this.labelRectangle=e,this.label=i,this.settings=n}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalRectangle=void 0;const n=i(5),s=i(6);class r extends s.GraphicalObject{constructor(t,e,i,s){super(),this.boundingBox=new n.BoundingBox(i),this.boundingBox.RelativePosition=t,this.boundingBox.BorderRight=e.x-t.x,this.boundingBox.BorderBottom=e.y-t.y,this.style=s}}e.GraphicalRectangle=r},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicalStaffEntryLink=void 0,e.GraphicalStaffEntryLink=class{constructor(t){this.graphicalLinkedStaffEntries=[],this.staffEntryLink=t,this.initialize()}get GetStaffEntryLink(){return this.staffEntryLink}get GraphicalLinkedStaffEntries(){return this.graphicalLinkedStaffEntries}set GraphicalLinkedStaffEntries(t){this.graphicalLinkedStaffEntries=t}isFilled(){for(let t=0;t<this.graphicalLinkedStaffEntries.length;t++)if(!this.graphicalLinkedStaffEntries[t])return!1;return!0}getLinkedStaffEntriesGraphicalNotes(t){if(-1!==this.graphicalLinkedStaffEntries.indexOf(t)){const t=[];for(let e=0,i=this.graphicalLinkedStaffEntries.length;e<i;++e){const i=this.graphicalLinkedStaffEntries[e];for(const e of i.graphicalVoiceEntries)for(const i of e.notes)i.sourceNote.ParentStaffEntry.Link&&i.sourceNote.ParentVoiceEntry===this.staffEntryLink.GetVoiceEntry&&t.push(i)}return t}}initialize(){for(let t=0,e=this.staffEntryLink.LinkStaffEntries.length;t<e;++t)this.graphicalLinkedStaffEntries.push(void 0)}}},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionEndSymbol=void 0;const n=i(6),s=i(22),r=i(4),o=i(5),a=i(27),l=i(34);class h extends n.GraphicalObject{constructor(t,e){super();const i=e,n=t.PositionAndShape.AbsolutePosition.y,h=l.CollectionUtil.last(t.StaffLines).PositionAndShape.RelativePosition.y+4;this.verticalLine=new a.GraphicalLine(new r.PointF2D(i,n),new r.PointF2D(i,n+h),.4,s.OutlineAndFillStyleEnum.SelectionSymbol);for(let s=0,o=t.StaffLines.length;s<o;++s){const e=t.StaffLines[s],o=new r.PointF2D(i,n+e.PositionAndShape.RelativePosition.y),a=new Array(3);o.y-=.2,a[0].x=o.x-3,a[0].y=o.y+1.2,a[1].x=o.x-2,a[1].y=o.y+.4,a[2].x=o.x-2,a[2].y=o.y+2,this.arrows.push(a);const l=new Array(8),h=.8;o.x-=.1,o.y+=.3;const c=.2;l[0].x=o.x-2,l[0].y=o.y+1.5-c,l[1].x=o.x-1,l[1].y=o.y+1.5-c,l[2].x=o.x-1,l[2].y=o.y+2.5,l[3].x=o.x-2,l[3].y=o.y+2.5,l[4].x=l[0].x,l[4].y=l[0].y-h,l[5].x=l[4].x+h+1,l[5].y=l[4].y,l[6].x=l[5].x,l[6].y=l[3].y+h,l[7].x=l[3].x,l[7].y=l[6].y,this.arrowlines.push(l)}this.boundingBox=new o.BoundingBox(this),this.boundingBox.AbsolutePosition=new r.PointF2D(i,n),this.boundingBox.BorderLeft=-.4,this.boundingBox.BorderRight=4,this.boundingBox.BorderBottom=h}}e.SelectionEndSymbol=h},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionStartSymbol=void 0;const n=i(4),s=i(22),r=i(27),o=i(6),a=i(5),l=i(34);class h extends o.GraphicalObject{constructor(t,e){super();const i=e,o=t.PositionAndShape.AbsolutePosition.y,h=l.CollectionUtil.last(t.StaffLines).PositionAndShape.RelativePosition.y+4;this.verticalLine=new r.GraphicalLine(new n.PointF2D(i,o),new n.PointF2D(i,o+h),.4,s.OutlineAndFillStyleEnum.SelectionSymbol);for(let s=0,r=t.StaffLines.length;s<r;++s){const e=t.StaffLines[s],r=new n.PointF2D(i,o+e.PositionAndShape.RelativePosition.y),a=new Array(7);a[0].x=r.x+4,a[0].y=r.y+2,a[1].x=r.x+2.5,a[1].y=r.y+.5,a[2].x=r.x+2.5,a[2].y=r.y+1.3,a[3].x=r.x+1,a[3].y=r.y+1.3,a[4].x=r.x+1,a[4].y=r.y+2.7,a[5].x=r.x+2.5,a[5].y=r.y+2.7,a[6].x=r.x+2.5,a[6].y=r.y+3.5,this.arrows.push(a)}this.boundingBox=new a.BoundingBox(this),this.boundingBox.AbsolutePosition=new n.PointF2D(i,o),this.boundingBox.BorderLeft=-.4,this.boundingBox.BorderRight=4,this.boundingBox.BorderBottom=h}}e.SelectionStartSymbol=h},function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(203),e),s(i(204),e),s(i(205),e),s(i(206),e),s(i(20),e),s(i(207),e),s(i(208),e),s(i(111),e),s(i(209),e)},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(34),e),s(i(211),e)},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.PSMath=void 0;class n{static log(t,e){return Math.log(e)/Math.log(t)}static log10(t){return n.log(10,t)}static meanSimple(t){let e=0;for(let i=0;i<t.length;i++)e+=t[i];return e/t.length}static meanWeighted(t,e){if(t.length!==e.length||0===t.length)return 0;let i=0,n=0;for(let s=0;s<t.length;s++){const r=e[s];i+=t[s]*r,n+=r}return i/n}}e.PSMath=n},function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(213),e),s(i(67),e),s(i(215),e)},function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(0),e),s(i(133),e),s(i(138),e),s(i(214),e),s(i(2),e),s(i(4),e),s(i(46),e),s(i(66),e)},function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.OSMDColor=void 0;class n{constructor(t,e,i){this.alpha=255,this.red=t,this.green=e,this.blue=i}static get Black(){return new n(0,0,0)}static get DeepSkyBlue(){return new n(0,191,255)}static get Green(){return new n(20,160,20)}static get Magenta(){return new n(255,0,255)}static get Orange(){return new n(255,128,0)}static get Red(){return new n(240,20,20)}static get Disabled(){return new n(225,225,225)}static get DarkBlue(){return new n(0,0,140)}static get Debug1(){return new n(200,0,140)}static get Debug2(){return new n(100,100,200)}static get Debug3(){return new n(0,50,140)}toString(){return"rgb("+this.red+","+this.green+","+this.blue+","+this.alpha+")"}}e.OSMDColor=n},function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),s(i(155),e),s(i(72),e)}])}));function cr(){}function ur(t){return null!=t}function dr(t){return"function"==typeof t}function fr(t,e){var i=e.split("."),n=t;return i.forEach((function(t){var e;n=null!=(e=n[t])?e:""})),n}function pr(t,e){return e?"string"==typeof e?" "+t+"--"+e:Array.isArray(e)?e.reduce((function(e,i){return e+pr(t,i)}),""):Object.keys(e).reduce((function(i,n){return i+(e[n]?pr(t,n):"")}),""):""}function mr(t){return function(e,i){return e&&"string"!=typeof e&&(i=e,e=""),""+(e=e?t+"__"+e:t)+pr(e,i)}}var br=/-(\w)/g;function gr(t){return t.replace(br,(function(t,e){return e.toUpperCase()}))}function yr(t){return function(e){return e.name=t,e.install=function(i){i.component(t,e),i.component(gr("-"+t),e)},vn(e)}}Object.prototype.hasOwnProperty;var Sr=te("zh-CN"),vr=jt({"zh-CN":{name:"姓名",tel:"电话",save:"保存",confirm:"确认",cancel:"取消",delete:"删除",complete:"完成",loading:"加载中...",telEmpty:"请填写电话",nameEmpty:"请填写姓名",nameInvalid:"请输入正确的姓名",confirmDelete:"确定要删除吗",telInvalid:"请输入正确的手机号",vanCalendar:{end:"结束",start:"开始",title:"日期选择",confirm:"确定",startEnd:"开始/结束",weekdays:["日","一","二","三","四","五","六"],monthTitle:function(t,e){return t+"年"+e+"月"},rangePrompt:function(t){return"选择天数不能超过 "+t+" 天"}},vanCascader:{select:"请选择"},vanContactCard:{addText:"添加联系人"},vanContactList:{addText:"新建联系人"},vanPagination:{prev:"上一页",next:"下一页"},vanPullRefresh:{pulling:"下拉即可刷新...",loosing:"释放即可刷新..."},vanSubmitBar:{label:"合计:"},vanCoupon:{unlimited:"无使用门槛",discount:function(t){return t+"折"},condition:function(t){return"满"+t+"元可用"}},vanCouponCell:{title:"优惠券",tips:"暂无可用",count:function(t){return t+"张可用"}},vanCouponList:{empty:"暂无优惠券",exchange:"兑换",close:"不使用优惠券",enable:"可用",disabled:"不可用",placeholder:"请输入优惠码"},vanAddressEdit:{area:"地区",postal:"邮政编码",areaEmpty:"请选择地区",addressEmpty:"请填写详细地址",postalEmpty:"邮政编码格式不正确",defaultAddress:"设为默认收货地址",telPlaceholder:"收货人手机号",namePlaceholder:"收货人姓名",areaPlaceholder:"选择省 / 市 / 区"},vanAddressEditDetail:{label:"详细地址",placeholder:"街道门牌、楼层房间号等信息"},vanAddressList:{add:"新增地址"}}}),xr=function(){return vr[Sr.value]};function Er(t){var e=gr(t)+".";return function(t){for(var i=xr(),n=fr(i,e+t)||fr(i,t),s=arguments.length,r=new Array(s>1?s-1:0),o=1;o<s;o++)r[o-1]=arguments[o];return dr(n)?n.apply(void 0,r):n}}function _r(t){return[yr(t="van-"+t),mr(t),Er(t)]}function wr(t){return"number"==typeof t||/^\d+(\.\d+)?$/.test(t)}function Tr(t){if(ur(t))return wr(t)?t+"px":String(t)}function Mr(t){if(ur(t)){var e=Tr(t);return{width:e,height:e}}}function Pr(t){t.stopPropagation()}function Lr(t,e){("boolean"!=typeof t.cancelable||t.cancelable)&&t.preventDefault(),e&&Pr(t)}var Ar="undefined"!=typeof window;function Cr(t,e){return{top:0,left:0,right:t,bottom:e,width:t,height:e}}var Ir=function(t){var e=ie(t);return e===window?Cr(e.innerWidth,e.innerHeight):e&&e.getBoundingClientRect?e.getBoundingClientRect():Cr(0,0)};function Rr(){return(Rr=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t}).apply(this,arguments)}var Nr=!1;if(Ar)try{var Fr={};Object.defineProperty(Fr,"passive",{get:function(){Nr=!0}}),window.addEventListener("test-passive",null,Fr)}catch(xl){}function Br(t,e,i){if(void 0===i&&(i={}),Ar){var n,s,r,o=i,a=o.target,l=void 0===a?window:a,h=o.passive,c=void 0!==h&&h,u=o.capture,d=void 0!==u&&u,f=function(){var i=ie(l);i&&n&&(i.removeEventListener(t,e,d),n=!1)};Bi(f),Qi(f),s=function(){var i=ie(l);i&&!n&&(i.addEventListener(t,e,Nr?{capture:d,passive:c}:d),n=!0)},Ii((function(){s(),Ce((function(){r=!0}))})),Zi((function(){r&&s()}))}}var Or=/scroll|auto/i;function Dr(t){return"HTML"!==t.tagName&&"BODY"!==t.tagName&&1===t.nodeType}var kr={to:[String,Object],url:String,replace:Boolean};function Vr(){var t=ps().proxy;return function(){!function(t){var e=t.$router,i=t.to,n=t.url,s=t.replace;i&&e?e[s?"replace":"push"](i):n&&(s?location.replace(n):location.href=n)}(t)}}var Gr=_r("badge"),Wr=Gr[0],Ur=Gr[1],zr=Wr({props:{dot:Boolean,max:[Number,String],color:String,offset:Array,content:[Number,String],tag:{type:String,default:"div"}},setup:function(t,e){var i=e.slots,n=function(){return!!(i.content||ur(t.content)&&""!==t.content)},s=function(){var e=t.dot,s=t.max,r=t.content;if(!e&&n())return i.content?i.content():ur(s)&&wr(r)&&+r>s?s+"+":r},r=function(){if(n()||t.dot){var e={background:t.color};if(t.offset){var r=t.offset,o=r[0],a=r[1];i.default?(e.top=a+"px",e.right=-o+"px"):(e.marginTop=a+"px",e.marginLeft=o+"px")}return zn("div",{class:Ur({dot:t.dot,fixed:!!i.default}),style:e},[s()])}};return function(){if(i.default){var e=t.tag;return zn(e,{class:Ur("wrapper")},{default:function(){return[i.default(),r()]}})}return r()}}}),jr=_r("icon"),Hr=jr[0],Xr=jr[1];for(var Yr=Hr({props:{dot:Boolean,name:String,size:[Number,String],badge:[Number,String],color:String,tag:{type:String,default:"i"},classPrefix:{type:String,default:Xr()}},setup:function(t,e){var i=e.slots;return function(){var e=t.tag,n=t.dot,s=t.name,r=t.size,o=t.badge,a=t.color,l=t.classPrefix,h=function(t){return!!t&&-1!==t.indexOf("/")}(s);return zn(zr,{dot:n,tag:e,content:o,class:[l,h?"":l+"-"+s],style:{color:a,fontSize:Tr(r)}},{default:function(){return[null==i.default?void 0:i.default(),h&&zn("img",{class:Xr("image"),src:s},null)]}})}}}),Kr=_r("loading"),qr=Kr[0],$r=Kr[1],Jr=[],Zr=0;Zr<12;Zr++)Jr.push(zn("i",null,null));var Qr=zn("svg",{class:$r("circular"),viewBox:"25 25 50 50"},[zn("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),to=qr({props:{size:[Number,String],color:String,vertical:Boolean,textSize:[Number,String],textColor:String,type:{type:String,default:"circular"}},setup:function(t,e){var i=e.slots,n=Ps((function(){return Rr({color:t.color},Mr(t.size))})),s=function(){var e;if(i.default)return zn("span",{class:$r("text"),style:{fontSize:Tr(t.textSize),color:null!=(e=t.textColor)?e:t.color}},[i.default()])};return function(){var e=t.type,i=t.vertical;return zn("div",{class:$r([e,{vertical:i}])},[zn("span",{class:$r("spinner",e),style:n.value},["spinner"===e?Jr:Qr]),s()])}}});function eo(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!kn(t)}var io=_r("button"),no=io[0],so=io[1],ro=no({props:Rr({},kr,{text:String,icon:String,color:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,hairline:Boolean,disabled:Boolean,iconPrefix:String,loadingText:String,loadingType:String,tag:{type:String,default:"button"},type:{type:String,default:"default"},size:{type:String,default:"normal"},nativeType:{type:String,default:"button"},loadingSize:{type:String,default:"20px"},iconPosition:{type:String,default:"left"}}),emits:["click"],setup:function(t,e){var i=e.emit,n=e.slots,s=Vr(),r=function(){return t.loading?n.loading?n.loading():zn(to,{class:so("loading"),size:t.loadingSize,type:t.loadingType,color:"currentColor"},null):t.icon?zn(Yr,{name:t.icon,class:so("icon"),classPrefix:t.iconPrefix},null):void 0},o=function(){var e;if(e=t.loading?t.loadingText:n.default?n.default():t.text)return zn("span",{class:so("text")},eo(e)?e:{default:function(){return[e]}})},a=function(){var e=t.color,i=t.plain;if(e){var n={};return n.color=i?e:"white",i||(n.background=e),-1!==e.indexOf("gradient")?n.border=0:n.borderColor=e,n}},l=function(e){t.loading&&e.preventDefault(),t.loading||t.disabled||(i("click",e),s())};return function(){var e,i,n=t.tag,s=t.type,h=t.size,c=t.block,u=t.round,d=t.plain,f=t.square,p=t.loading,m=t.disabled,b=t.hairline,g=t.nativeType,y=t.iconPosition,S=[so([s,h,{plain:d,block:c,round:u,square:f,loading:p,disabled:m,hairline:b}]),(i={},i["van-hairline--surround"]=b,i)];return zn(n,{type:g,class:S,style:a(),disabled:m,onClick:l},eo(e=zn("div",{class:so("content")},["left"===y&&r(),o(),"right"===y&&r()]))?e:{default:function(){return[e]}})}}});function oo(){var t=te(0),e=te(0),i=te(0),n=te(0),s=te(0),r=te(0),o=te(""),a=function(){i.value=0,n.value=0,s.value=0,r.value=0,o.value=""};return{move:function(a){var l,h,c=a.touches[0];i.value=c.clientX-t.value,n.value=c.clientY-e.value,s.value=Math.abs(i.value),r.value=Math.abs(n.value),o.value||(o.value=(l=s.value,h=r.value,l>h&&l>10?"horizontal":h>l&&h>10?"vertical":""))},start:function(i){a(),t.value=i.touches[0].clientX,e.value=i.touches[0].clientY},reset:a,startX:t,startY:e,deltaX:i,deltaY:n,offsetX:s,offsetY:r,direction:o,isVertical:function(){return"vertical"===o.value},isHorizontal:function(){return"horizontal"===o.value}}}var ao=0;function lo(t,e){var i=oo(),n=function(e){i.move(e);var n=i.deltaY.value>0?"10":"01",s=function(t,e){void 0===e&&(e=window);for(var i=t;i&&i!==e&&Dr(i);){var n=window.getComputedStyle(i).overflowY;if(Or.test(n))return i;i=i.parentNode}return e}(e.target,t.value),r=s.scrollHeight,o=s.offsetHeight,a=s.scrollTop,l="11";0===a?l=o>=r?"00":"01":a+o>=r&&(l="10"),"11"===l||!i.isVertical()||parseInt(l,2)&parseInt(n,2)||Lr(e,!0)};return[function(){e()&&(document.addEventListener("touchstart",i.start),document.addEventListener("touchmove",n,!!Nr&&{passive:!1}),ao||document.body.classList.add("van-overflow-hidden"),ao++)},function(){e()&&ao&&(document.removeEventListener("touchstart",i.start),document.removeEventListener("touchmove",n),--ao||document.body.classList.remove("van-overflow-hidden"))}]}function ho(t){var e=te(!1);return Vi(t,(function(t){t&&(e.value=t)}),{immediate:!0}),function(t){return function(){return e.value?t():null}}}var co=_r("overlay"),uo=co[0],fo=co[1],po=uo({props:{show:Boolean,zIndex:[Number,String],duration:[Number,String],className:null,customStyle:Object,lockScroll:{type:Boolean,default:!0}},setup:function(t,e){var i=e.slots,n=ho((function(){return t.show})),s=function(t){Lr(t,!0)},r=n((function(){var e=Rr({zIndex:void 0!==t.zIndex?+t.zIndex:void 0},t.customStyle);return ur(t.duration)&&(e.animationDuration=t.duration+"s"),cn(zn("div",{style:e,class:[fo(),t.className],onTouchmove:t.lockScroll?s:cr},[null==i.default?void 0:i.default()]),[[nr,t.show]])}));return function(){var t,e;return zn(Ys,{name:"van-fade"},"function"==typeof(e=t=r())||"[object Object]"===Object.prototype.toString.call(e)&&!kn(e)?t:{default:function(){return[t]}})}}});var mo=_r("popup"),bo=mo[0],go=mo[1],yo={zIndex:2e3,lockCount:0,stack:[],find:function(t){return this.stack.filter((function(e){return e.vm===t}))[0]}},So=bo({inheritAttrs:!1,props:Rr({},{show:Boolean,zIndex:[Number,String],duration:[Number,String],teleport:[String,Object],overlayStyle:Object,overlayClass:null,transitionAppear:Boolean,overlay:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},lazyRender:{type:Boolean,default:!0},closeOnClickOverlay:{type:Boolean,default:!0}},{round:Boolean,closeable:Boolean,transition:String,closeOnPopstate:Boolean,safeAreaInsetBottom:Boolean,position:{type:String,default:"center"},closeIcon:{type:String,default:"cross"},closeIconPosition:{type:String,default:"top-right"}}),emits:["open","close","click","opened","closed","update:show","click-overlay","click-close-icon"],setup:function(t,e){var i,n,s,r,o=e.emit,a=e.attrs,l=e.slots,h=te(),c=te(),u=lo(c,(function(){return t.lockScroll})),d=u[0],f=u[1],p=ho((function(){return t.show||!t.lazyRender})),m=Ps((function(){var e={zIndex:h.value};ur(t.duration)&&(e["center"===t.position?"animationDuration":"transitionDuration"]=t.duration+"s");return e})),b=function(){i||(void 0!==t.zIndex&&(yo.zIndex=t.zIndex),i=!0,d(),h.value=++yo.zIndex)},g=function(){i&&(i=!1,f(),o("update:show",!1))},y=function(){o("click-overlay"),t.closeOnClickOverlay&&g()},S=function(){if(t.overlay)return zn(po,{show:t.show,class:t.overlayClass,zIndex:h.value,duration:t.duration,customStyle:t.overlayStyle,onClick:y},null)},v=function(t){o("click-close-icon",t),g()},x=function(){if(t.closeable)return zn(Yr,{role:"button",tabindex:"0",name:t.closeIcon,class:go("close-icon",t.closeIconPosition),onClick:v},null)},E=function(t){return o("click",t)},_=function(){return o("opened")},w=function(){return o("closed")},T=p((function(){var e,i=t.round,n=t.position,s=t.safeAreaInsetBottom;return cn(zn("div",$n({ref:c,style:m.value,class:go((e={round:i},e[n]=n,e["safe-area-inset-bottom"]=s,e)),onClick:E},a),[null==l.default?void 0:l.default(),x()]),[[nr,t.show]])})),M=function(){var e,i,n=t.position,s=t.transition,r=t.transitionAppear;return zn(Ys,{name:s||("center"===n?"van-fade":"van-popup-slide-"+n),appear:r,onAfterEnter:_,onAfterLeave:w},"function"==typeof(i=e=T())||"[object Object]"===Object.prototype.toString.call(i)&&!kn(i)?e:{default:function(){return[e]}})};return Vi((function(){return t.show}),(function(t){t?(b(),o("open")):(g(),o("close"))})),s={popupRef:c},(r=ps())&&Rr(r.proxy,s),Br("popstate",(function(){t.closeOnPopstate&&(g(),n=!1)})),Ii((function(){t.show&&b()})),Zi((function(){n&&(o("update:show",!0),n=!1)})),Qi((function(){t.show&&(g(),n=!0)})),Fi((function(){i&&f()})),function(){return t.teleport?zn(Cn,{to:t.teleport},{default:function(){return[S(),M()]}}):zn(Rn,null,[S(),M()])}}});var vo=_r("skeleton"),xo=vo[0],Eo=vo[1],_o=xo({props:{title:Boolean,round:Boolean,avatar:Boolean,avatarSize:[Number,String],titleWidth:[Number,String],row:{type:[Number,String],default:0},loading:{type:Boolean,default:!0},animate:{type:Boolean,default:!0},avatarShape:{type:String,default:"round"},rowWidth:{type:[Number,String,Array],default:"100%"}},setup:function(t,e){var i=e.slots,n=function(){if(t.avatar)return zn("div",{class:Eo("avatar",t.avatarShape),style:Mr(t.avatarSize)},null)},s=function(){if(t.title)return zn("h3",{class:Eo("title"),style:{width:Tr(t.titleWidth)}},null)},r=function(){for(var e,i,n=[],s=0;s<t.row;s++)n.push(zn("div",{class:Eo("row"),style:{width:Tr((e=s,i=void 0,i=t.rowWidth,"100%"===i&&e===+t.row-1?"60%":Array.isArray(i)?i[e]:i))}},null));return n};return function(){return t.loading?zn("div",{class:Eo({animate:t.animate,round:t.round})},[n(),zn("div",{class:Eo("content")},[s(),r()])]):null==i.default?void 0:i.default()}}}),wo=_r("slider"),To=wo[0],Mo=wo[1],Po=To({props:{range:Boolean,disabled:Boolean,readonly:Boolean,vertical:Boolean,barHeight:[Number,String],buttonSize:[Number,String],activeColor:String,inactiveColor:String,min:{type:[Number,String],default:0},max:{type:[Number,String],default:100},step:{type:[Number,String],default:1},modelValue:{type:[Number,Array],default:0}},emits:["change","drag-end","drag-start","update:modelValue"],setup:function(t,e){var i,n,s,r,o,a=e.emit,l=e.slots,h=te(),c=te(),u=oo(),d=Ps((function(){return Number(t.max)-Number(t.min)})),f=Ps((function(){var e,i=t.vertical?"width":"height";return(e={background:t.inactiveColor})[i]=Tr(t.barHeight),e})),p=function(e){return!!t.range&&Array.isArray(e)},m=function(){var e=t.modelValue,i=t.min;return p(e)?100*(e[0]-Number(i))/d.value+"%":"0%"},b=Ps((function(){var e,i,n;return(e={})[t.vertical?"height":"width"]=(i=t.modelValue,n=t.min,p(i)?100*(i[1]-i[0])/d.value+"%":100*(i-Number(n))/d.value+"%"),e.left=t.vertical?void 0:m(),e.top=t.vertical?m():void 0,e.background=t.activeColor,e.transition=c.value?"none":void 0,e})),g=function(e){var i=t.min,n=t.max,s=t.step;return e=Math.max(+i,Math.min(e,+n)),Math.round(e/+s)*+s},y=function(t,e){return JSON.stringify(t)===JSON.stringify(e)},S=function(e,i){e=p(e)?function(t){return t[0]>t[1]?t.slice(0).reverse():t}(e).map(g):g(e),y(e,t.modelValue)||a("update:modelValue",e),i&&!y(e,n)&&a("change",e)},v=function(e){if(e.stopPropagation(),!t.disabled&&!t.readonly){var i=t.min,n=t.vertical,s=t.modelValue,r=Ir(h),o=n?e.clientY-r.top:e.clientX-r.left,a=n?r.height:r.width,l=Number(i)+o/a*d.value;if(p(s)){var c=s[0],u=s[1];S(l<=(c+u)/2?[l,u]:[c,l],!0)}else S(l,!0)}},x=function(e){if(!t.disabled&&!t.readonly){"start"===c.value&&a("drag-start"),Lr(e,!0),u.move(e),c.value="draging";var r=Ir(h),o=(t.vertical?u.deltaY.value:u.deltaX.value)/(t.vertical?r.height:r.width)*d.value;p(n)?s[i]=n[i]+o:s=n+o,S(s)}},E=function(){t.disabled||t.readonly||("draging"===c.value&&(S(s,!0),a("drag-end")),c.value="")},_=function(e){var r="number"==typeof e?t.modelValue[e]:t.modelValue;return zn("div",{role:"slider",class:Mo(function(){if("number"==typeof e){return"button-wrapper-"+["left","right"][e]}return"button-wrapper"}()),tabindex:t.disabled||t.readonly?-1:0,"aria-valuemin":+t.min,"aria-valuenow":r,"aria-valuemax":+t.max,"aria-orientation":t.vertical?"vertical":"horizontal",onTouchstart:function(r){var o;"number"==typeof e&&(i=e),o=r,t.disabled||t.readonly||(u.start(o),s=t.modelValue,n=p(s)?s.map(g):g(s),c.value="start")},onTouchmove:x,onTouchend:E,onTouchcancel:E,onClick:Pr},[l.button?l.button():zn("div",{class:Mo("button"),style:Mr(t.buttonSize)},null)])};return S(t.modelValue),r=function(){return t.modelValue},(o=Jn("vanField",null))&&!o.childFieldValue.value&&(o.childFieldValue.value=r,Vi(r,(function(){o.resetValidation(),o.validateWithTrigger("onChange")}))),function(){return zn("div",{ref:h,style:f.value,class:Mo({vertical:t.vertical,disabled:t.disabled}),onClick:v},[zn("div",{class:Mo("bar"),style:b.value},[t.range?[_(0),_(1)]:_()])])}}}),Lo=String.prototype.replace,Ao=/%20/g,Co="RFC3986",Io={default:Co,formatters:{RFC1738:function(t){return Lo.call(t,Ao,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:Co},Ro=Object.prototype.hasOwnProperty,No=Array.isArray,Fo=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Bo=function(t,e){for(var i=e&&e.plainObjects?Object.create(null):{},n=0;n<t.length;++n)void 0!==t[n]&&(i[n]=t[n]);return i},Oo={arrayToObject:Bo,assign:function(t,e){return Object.keys(e).reduce((function(t,i){return t[i]=e[i],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],i=[],n=0;n<e.length;++n)for(var s=e[n],r=s.obj[s.prop],o=Object.keys(r),a=0;a<o.length;++a){var l=o[a],h=r[l];"object"==typeof h&&null!==h&&-1===i.indexOf(h)&&(e.push({obj:r,prop:l}),i.push(h))}return function(t){for(;t.length>1;){var e=t.pop(),i=e.obj[e.prop];if(No(i)){for(var n=[],s=0;s<i.length;++s)void 0!==i[s]&&n.push(i[s]);e.obj[e.prop]=n}}}(e),t},decode:function(t,e,i){var n=t.replace(/\+/g," ");if("iso-8859-1"===i)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(xl){return n}},encode:function(t,e,i,n,s){if(0===t.length)return t;var r=t;if("symbol"==typeof t?r=Symbol.prototype.toString.call(t):"string"!=typeof t&&(r=String(t)),"iso-8859-1"===i)return escape(r).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var o="",a=0;a<r.length;++a){var l=r.charCodeAt(a);45===l||46===l||95===l||126===l||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||s===Io.RFC1738&&(40===l||41===l)?o+=r.charAt(a):l<128?o+=Fo[l]:l<2048?o+=Fo[192|l>>6]+Fo[128|63&l]:l<55296||l>=57344?o+=Fo[224|l>>12]+Fo[128|l>>6&63]+Fo[128|63&l]:(a+=1,l=65536+((1023&l)<<10|1023&r.charCodeAt(a)),o+=Fo[240|l>>18]+Fo[128|l>>12&63]+Fo[128|l>>6&63]+Fo[128|63&l])}return o},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(No(t)){for(var i=[],n=0;n<t.length;n+=1)i.push(e(t[n]));return i}return e(t)},merge:function t(e,i,n){if(!i)return e;if("object"!=typeof i){if(No(e))e.push(i);else{if(!e||"object"!=typeof e)return[e,i];(n&&(n.plainObjects||n.allowPrototypes)||!Ro.call(Object.prototype,i))&&(e[i]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(i);var s=e;return No(e)&&!No(i)&&(s=Bo(e,n)),No(e)&&No(i)?(i.forEach((function(i,s){if(Ro.call(e,s)){var r=e[s];r&&"object"==typeof r&&i&&"object"==typeof i?e[s]=t(r,i,n):e.push(i)}else e[s]=i})),e):Object.keys(i).reduce((function(e,s){var r=i[s];return Ro.call(e,s)?e[s]=t(e[s],r,n):e[s]=r,e}),s)}},Do=Object.prototype.hasOwnProperty,ko={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},Vo=Array.isArray,Go=Array.prototype.push,Wo=function(t,e){Go.apply(t,Vo(e)?e:[e])},Uo=Date.prototype.toISOString,zo=Io.default,jo={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Oo.encode,encodeValuesOnly:!1,format:zo,formatter:Io.formatters[zo],indices:!1,serializeDate:function(t){return Uo.call(t)},skipNulls:!1,strictNullHandling:!1},Ho=function t(e,i,n,s,r,o,a,l,h,c,u,d,f,p){var m,b=e;if("function"==typeof a?b=a(i,b):b instanceof Date?b=c(b):"comma"===n&&Vo(b)&&(b=Oo.maybeMap(b,(function(t){return t instanceof Date?c(t):t}))),null===b){if(s)return o&&!f?o(i,jo.encoder,p,"key",u):i;b=""}if("string"==typeof(m=b)||"number"==typeof m||"boolean"==typeof m||"symbol"==typeof m||"bigint"==typeof m||Oo.isBuffer(b))return o?[d(f?i:o(i,jo.encoder,p,"key",u))+"="+d(o(b,jo.encoder,p,"value",u))]:[d(i)+"="+d(String(b))];var g,y=[];if(void 0===b)return y;if("comma"===n&&Vo(b))g=[{value:b.length>0?b.join(",")||null:void 0}];else if(Vo(a))g=a;else{var S=Object.keys(b);g=l?S.sort(l):S}for(var v=0;v<g.length;++v){var x=g[v],E="object"==typeof x&&void 0!==x.value?x.value:b[x];if(!r||null!==E){var _=Vo(b)?"function"==typeof n?n(i,x):i:i+(h?"."+x:"["+x+"]");Wo(y,t(E,_,n,s,r,o,a,l,h,c,u,d,f,p))}}return y},Xo=Object.prototype.hasOwnProperty,Yo=Array.isArray,Ko={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Oo.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},qo=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},$o=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Jo=function(t,e,i,n){if(t){var s=i.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,r=/(\[[^[\]]*])/g,o=i.depth>0&&/(\[[^[\]]*])/.exec(s),a=o?s.slice(0,o.index):s,l=[];if(a){if(!i.plainObjects&&Xo.call(Object.prototype,a)&&!i.allowPrototypes)return;l.push(a)}for(var h=0;i.depth>0&&null!==(o=r.exec(s))&&h<i.depth;){if(h+=1,!i.plainObjects&&Xo.call(Object.prototype,o[1].slice(1,-1))&&!i.allowPrototypes)return;l.push(o[1])}return o&&l.push("["+s.slice(o.index)+"]"),function(t,e,i,n){for(var s=n?e:$o(e,i),r=t.length-1;r>=0;--r){var o,a=t[r];if("[]"===a&&i.parseArrays)o=[].concat(s);else{o=i.plainObjects?Object.create(null):{};var l="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,h=parseInt(l,10);i.parseArrays||""!==l?!isNaN(h)&&a!==l&&String(h)===l&&h>=0&&i.parseArrays&&h<=i.arrayLimit?(o=[])[h]=s:o[l]=s:o={0:s}}s=o}return s}(l,e,i,n)}},Zo=function(t,e){var i=function(t){if(!t)return Ko;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?Ko.charset:t.charset;return{allowDots:void 0===t.allowDots?Ko.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:Ko.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:Ko.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:Ko.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:Ko.comma,decoder:"function"==typeof t.decoder?t.decoder:Ko.decoder,delimiter:"string"==typeof t.delimiter||Oo.isRegExp(t.delimiter)?t.delimiter:Ko.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:Ko.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:Ko.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:Ko.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:Ko.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:Ko.strictNullHandling}}(e);if(""===t||null==t)return i.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){var i,n={},s=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,r=e.parameterLimit===1/0?void 0:e.parameterLimit,o=s.split(e.delimiter,r),a=-1,l=e.charset;if(e.charsetSentinel)for(i=0;i<o.length;++i)0===o[i].indexOf("utf8=")&&("utf8=%E2%9C%93"===o[i]?l="utf-8":"utf8=%26%2310003%3B"===o[i]&&(l="iso-8859-1"),a=i,i=o.length);for(i=0;i<o.length;++i)if(i!==a){var h,c,u=o[i],d=u.indexOf("]="),f=-1===d?u.indexOf("="):d+1;-1===f?(h=e.decoder(u,Ko.decoder,l,"key"),c=e.strictNullHandling?null:""):(h=e.decoder(u.slice(0,f),Ko.decoder,l,"key"),c=Oo.maybeMap($o(u.slice(f+1),e),(function(t){return e.decoder(t,Ko.decoder,l,"value")}))),c&&e.interpretNumericEntities&&"iso-8859-1"===l&&(c=qo(c)),u.indexOf("[]=")>-1&&(c=Yo(c)?[c]:c),Xo.call(n,h)?n[h]=Oo.combine(n[h],c):n[h]=c}return n}(t,i):t,s=i.plainObjects?Object.create(null):{},r=Object.keys(n),o=0;o<r.length;++o){var a=r[o],l=Jo(a,n[a],i,"string"==typeof t);s=Oo.merge(s,l,i)}return Oo.compact(s)},Qo=function(t,e){var i,n=t,s=function(t){if(!t)return jo;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||jo.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=Io.default;if(void 0!==t.format){if(!Do.call(Io.formatters,t.format))throw new TypeError("Unknown format option provided.");i=t.format}var n=Io.formatters[i],s=jo.filter;return("function"==typeof t.filter||Vo(t.filter))&&(s=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:jo.addQueryPrefix,allowDots:void 0===t.allowDots?jo.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:jo.charsetSentinel,delimiter:void 0===t.delimiter?jo.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:jo.encode,encoder:"function"==typeof t.encoder?t.encoder:jo.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:jo.encodeValuesOnly,filter:s,format:i,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:jo.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:jo.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:jo.strictNullHandling}}(e);"function"==typeof s.filter?n=(0,s.filter)("",n):Vo(s.filter)&&(i=s.filter);var r,o=[];if("object"!=typeof n||null===n)return"";r=e&&e.arrayFormat in ko?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var a=ko[r];i||(i=Object.keys(n)),s.sort&&i.sort(s.sort);for(var l=0;l<i.length;++l){var h=i[l];s.skipNulls&&null===n[h]||Wo(o,Ho(n[h],h,a,s.strictNullHandling,s.skipNulls,s.encode?s.encoder:null,s.filter,s.sort,s.allowDots,s.serializeDate,s.format,s.formatter,s.encodeValuesOnly,s.charset))}var c=o.join(s.delimiter),u=!0===s.addQueryPrefix?"?":"";return s.charsetSentinel&&("iso-8859-1"===s.charset?u+="utf8=%26%2310003%3B&":u+="utf8=%E2%9C%93&"),c.length>0?u+c:""},ta="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==ta&&ta,ea="URLSearchParams"in ta,ia="Symbol"in ta&&"iterator"in Symbol,na="FileReader"in ta&&"Blob"in ta&&function(){try{return new Blob,!0}catch(xl){return!1}}(),sa="FormData"in ta,ra="ArrayBuffer"in ta;if(ra)var oa=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],aa=ArrayBuffer.isView||function(t){return t&&oa.indexOf(Object.prototype.toString.call(t))>-1};function la(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function ha(t){return"string"!=typeof t&&(t=String(t)),t}function ca(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return ia&&(e[Symbol.iterator]=function(){return e}),e}function ua(t){this.map={},t instanceof ua?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function da(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function fa(t){return new Promise((function(e,i){t.onload=function(){e(t.result)},t.onerror=function(){i(t.error)}}))}function pa(t){var e=new FileReader,i=fa(e);return e.readAsArrayBuffer(t),i}function ma(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function ba(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:na&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:sa&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:ea&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():ra&&na&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=ma(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):ra&&(ArrayBuffer.prototype.isPrototypeOf(t)||aa(t))?this._bodyArrayBuffer=ma(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="";var i=this.headers.get("content-type");i?i.indexOf("json")>=0&&"string"!=typeof this._bodyInit&&(this._bodyInit=this._bodyText):"string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):ea&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8")},na&&(this.blob=function(){var t=da(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=da(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(pa)}),this.text=function(){var t,e,i,n=da(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,i=fa(e),e.readAsText(t),i;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),i=new Array(e.length),n=0;n<e.length;n++)i[n]=String.fromCharCode(e[n]);return i.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},sa&&(this.formData=function(){return this.text().then(Sa)}),this.json=function(){return this.text().then(JSON.parse)},this}ua.prototype.append=function(t,e){t=la(t),e=ha(e);var i=this.map[t];this.map[t]=i?i+", "+e:e},ua.prototype.delete=function(t){delete this.map[la(t)]},ua.prototype.get=function(t){return t=la(t),this.has(t)?this.map[t]:null},ua.prototype.has=function(t){return this.map.hasOwnProperty(la(t))},ua.prototype.set=function(t,e){this.map[la(t)]=ha(e)},ua.prototype.forEach=function(t,e){for(var i in this.map)this.map.hasOwnProperty(i)&&t.call(e,this.map[i],i,this)},ua.prototype.keys=function(){var t=[];return this.forEach((function(e,i){t.push(i)})),ca(t)},ua.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),ca(t)},ua.prototype.entries=function(){var t=[];return this.forEach((function(e,i){t.push([i,e])})),ca(t)},ia&&(ua.prototype[Symbol.iterator]=ua.prototype.entries);var ga=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function ya(t,e){if(!(this instanceof ya))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var i,n,s=(e=e||{}).body;if(t instanceof ya){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new ua(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,s||null==t._bodyInit||(s=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new ua(e.headers)),this.method=(i=e.method||this.method||"GET",n=i.toUpperCase(),ga.indexOf(n)>-1?n:i),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(s),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function Sa(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var i=t.split("="),n=i.shift().replace(/\+/g," "),s=i.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(s))}})),e}function va(t,e){if(!(this instanceof va))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new ua(e.headers),this.url=e.url||"",this._initBody(t)}ya.prototype.clone=function(){return new ya(this,{body:this._bodyInit})},ba.call(ya.prototype),ba.call(va.prototype),va.prototype.clone=function(){return new va(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new ua(this.headers),url:this.url})},va.error=function(){var t=new va(null,{status:0,statusText:""});return t.type="error",t};var xa=[301,302,303,307,308];va.redirect=function(t,e){if(-1===xa.indexOf(e))throw new RangeError("Invalid status code");return new va(null,{status:e,headers:{location:t}})};var Ea=ta.DOMException;try{new Ea}catch(El){(Ea=function(t,e){this.message=t,this.name=e;var i=Error(t);this.stack=i.stack}).prototype=Object.create(Error.prototype),Ea.prototype.constructor=Ea}function _a(t,e){return new Promise((function(i,n){var s=new ya(t,e);if(s.signal&&s.signal.aborted)return n(new Ea("Aborted","AbortError"));var r=new XMLHttpRequest;function o(){r.abort()}r.onload=function(){var t,e,n={status:r.status,statusText:r.statusText,headers:(t=r.getAllResponseHeaders()||"",e=new ua,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var i=t.split(":"),n=i.shift().trim();if(n){var s=i.join(":").trim();e.append(n,s)}})),e)};n.url="responseURL"in r?r.responseURL:n.headers.get("X-Request-URL");var s="response"in r?r.response:r.responseText;setTimeout((function(){i(new va(s,n))}),0)},r.onerror=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},r.ontimeout=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},r.onabort=function(){setTimeout((function(){n(new Ea("Aborted","AbortError"))}),0)},r.open(s.method,function(t){try{return""===t&&ta.location.href?ta.location.href:t}catch(xl){return t}}(s.url),!0),"include"===s.credentials?r.withCredentials=!0:"omit"===s.credentials&&(r.withCredentials=!1),"responseType"in r&&(na?r.responseType="blob":ra&&s.headers.get("Content-Type")&&-1!==s.headers.get("Content-Type").indexOf("application/octet-stream")&&(r.responseType="arraybuffer")),!e||"object"!=typeof e.headers||e.headers instanceof ua?s.headers.forEach((function(t,e){r.setRequestHeader(e,t)})):Object.getOwnPropertyNames(e.headers).forEach((function(t){r.setRequestHeader(t,ha(e.headers[t]))})),s.signal&&(s.signal.addEventListener("abort",o),r.onreadystatechange=function(){4===r.readyState&&s.signal.removeEventListener("abort",o)}),r.send(void 0===s._bodyInit?null:s._bodyInit)}))}_a.polyfill=!0,ta.fetch||(ta.fetch=_a,ta.Headers=ua,ta.Request=ya,ta.Response=va),self.fetch.bind(self);var wa=function(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t};var Ta=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter((function(t){return Object.getOwnPropertyDescriptor(i,t).enumerable})))),n.forEach((function(e){wa(t,e,i[e])}))}return t};var Ma=function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}};var Pa=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var La=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var Aa=function(t){return Ma(t)||Pa(t)||La()};var Ca=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function Ia(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Ra=function(t,e,i){return e&&Ia(t.prototype,e),i&&Ia(t,i),t};function Na(t,e){return t(e={exports:{}},e.exports),e.exports}var Fa=Na((function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(n){return"function"==typeof Symbol&&"symbol"===e(Symbol.iterator)?t.exports=i=function(t){return e(t)}:t.exports=i=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":e(t)},i(n)}t.exports=i}));function Ba(t){if(!Array.isArray(t))throw new TypeError("Middlewares must be an array!");for(var e=t.length,i=0;i<e;i++)if("function"!=typeof t[i])throw new TypeError("Middleware must be componsed of function");return function(e,i){var n=-1;return function s(r){if(r<=n)return Promise.reject(new Error("next() should not be called multiple times in one middleware!"));n=r;var o=t[r]||i;if(!o)return Promise.resolve();try{return Promise.resolve(o(e,(function(){return s(r+1)})))}catch(El){return Promise.reject(El)}}(0)}}var Oa=function(){function t(e){if(Ca(this,t),!Array.isArray(e))throw new TypeError("Default middlewares must be an array!");this.defaultMiddlewares=Aa(e),this.middlewares=[]}return Ra(t,[{key:"use",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{global:!1,core:!1,defaultInstance:!1},n=!1,s=!1,r=!1;"number"==typeof i?(process&&process.env&&console.warn('use() options should be object, number property would be deprecated in future,please update use() options to "{ core: true }".'),n=!0,s=!1):"object"===Fa(i)&&i&&(s=i.global||!1,n=i.core||!1,r=i.defaultInstance||!1),s?t.globalMiddlewares.splice(t.globalMiddlewares.length-t.defaultGlobalMiddlewaresLength,0,e):n?t.coreMiddlewares.splice(t.coreMiddlewares.length-t.defaultCoreMiddlewaresLength,0,e):r?this.defaultMiddlewares.push(e):this.middlewares.push(e)}},{key:"execute",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=Ba([].concat(Aa(this.middlewares),Aa(this.defaultMiddlewares),Aa(t.globalMiddlewares),Aa(t.coreMiddlewares)));return i(e)}}]),t}();Oa.globalMiddlewares=[],Oa.defaultGlobalMiddlewaresLength=0,Oa.coreMiddlewares=[],Oa.defaultCoreMiddlewaresLength=0;var Da=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var ka=function(t,e){return!e||"object"!==Fa(e)&&"function"!=typeof e?Da(t):e},Va=Na((function(t){function e(i){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(i)}t.exports=e})),Ga=Na((function(t){function e(i,n){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(i,n)}t.exports=e}));var Wa=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ga(t,e)};var Ua=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")},za=Na((function(t){function e(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(xl){return!1}}function i(n,s,r){return e()?t.exports=i=Reflect.construct:t.exports=i=function(t,e,i){var n=[null];n.push.apply(n,e);var s=new(Function.bind.apply(t,n));return i&&Ga(s,i.prototype),s},i.apply(null,arguments)}t.exports=i})),ja=Na((function(t){function e(i){var n="function"==typeof Map?new Map:void 0;return t.exports=e=function(t){if(null===t||!Ua(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return za(t,arguments,Va(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Ga(e,t)},e(i)}t.exports=e})),Ha=function(){function t(e){Ca(this,t),this.cache=new Map,this.timer={},this.extendOptions(e)}return Ra(t,[{key:"extendOptions",value:function(t){this.maxCache=t.maxCache||0}},{key:"get",value:function(t){return this.cache.get(JSON.stringify(t))}},{key:"set",value:function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6e4;if(this.maxCache>0&&this.cache.size>=this.maxCache){var s=Aa(this.cache.keys())[0];this.cache.delete(s),this.timer[s]&&clearTimeout(this.timer[s])}var r=JSON.stringify(t);this.cache.set(r,e),n>0&&(this.timer[r]=setTimeout((function(){i.cache.delete(r),delete i.timer[r]}),n))}},{key:"delete",value:function(t){var e=JSON.stringify(t);return delete this.timer[e],this.cache.delete(e)}},{key:"clear",value:function(){return this.timer={},this.cache.clear()}}]),t}(),Xa=function(t){function e(t,i){var n,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"RequestError";return Ca(this,e),(n=ka(this,Va(e).call(this,t))).name="RequestError",n.request=i,n.type=s,n}return Wa(e,t),e}(ja(Error)),Ya=function(t){function e(t,i,n,s){var r,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"ResponseError";return Ca(this,e),(r=ka(this,Va(e).call(this,i||t.statusText))).name="ResponseError",r.data=n,r.response=t,r.request=s,r.type=o,r}return Wa(e,t),e}(ja(Error));function Ka(t){return new Promise((function(e,i){var n=new FileReader;n.onload=function(){e(n.result)},n.onerror=i,n.readAsText(t,"GBK")}))}function qa(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;try{return JSON.parse(t)}catch(xl){if(e)throw new Ya(i,"JSON.parse fail",t,n,"ParseError")}return t}function $a(t){return new Promise((function(e,i){t.cancelToken&&t.cancelToken.promise.then((function(t){i(t)}))}))}var Ja=Object.prototype.toString;function Za(){var t;return"undefined"!=typeof process&&"[object process]"===Ja.call(process)&&(t="NODE"),"undefined"!=typeof XMLHttpRequest&&(t="BROWSER"),t}function Qa(t){return"object"===Fa(t)&&"[object Array]"===Object.prototype.toString.call(t)}function tl(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams}function el(t){return null!==t&&"object"===Fa(t)}function il(t,e){if(t)if("object"!==Fa(t)&&(t=[t]),Qa(t))for(var i=0;i<t.length;i++)e.call(null,t[i],i,t);else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.call(null,t[n],n,t)}function nl(t){return tl(t)?Zo(t.toString(),{strictNullHandling:!0}):"string"==typeof t?[t]:t}function sl(t){return Qo(t,{arrayFormat:"repeat",strictNullHandling:!0})}function rl(t,e){return Ta({},t,e,{headers:Ta({},t.headers,e.headers),params:Ta({},nl(t.params),nl(e.params)),method:(e.method||t.method||"get").toLowerCase()})}var ol=!1;function al(t,e){var i=e.method;return"get"===(void 0===i?"get":i).toLowerCase()}function ll(t,e){var i,n;if(t)if(e)i=e(t);else if(tl(t))i=t.toString();else{if(Qa(t))n=[],il(t,(function(t){null==t?n.push(t):n.push(el(t)?JSON.stringify(t):t)})),i=sl(n);else n={},il(t,(function(t,e){var i,s=t;null==t?n[e]=t:"object"===Fa(i=t)&&"[object Date]"===Object.prototype.toString.call(i)?s=t.toISOString():Qa(t)?s=t:el(t)&&(s=JSON.stringify(t)),n[e]=s})),i=sl(n)}return i}var hl=[function(t,e){if(!t)return e();var i=t.req,n=(i=void 0===i?{}:i).options,s=void 0===n?{}:n,r=s.method;if(-1===["post","put","patch","delete"].indexOf((void 0===r?"get":r).toLowerCase()))return e();var o=s.requestType,a=void 0===o?"json":o,l=s.data;if(l){var h=Object.prototype.toString.call(l);"[object Object]"===h||"[object Array]"===h?"json"===a?(s.headers=Ta({Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},s.headers),s.body=JSON.stringify(l)):"form"===a&&(s.headers=Ta({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},s.headers),s.body=sl(l)):(s.headers=Ta({Accept:"application/json"},s.headers),s.body=l)}return t.req.options=s,e()},function(t,e){if(!t)return e();var i=t.req,n=(i=void 0===i?{}:i).options,s=void 0===n?{}:n,r=s.paramsSerializer,o=s.params,a=t.req,l=(a=void 0===a?{}:a).url,h=void 0===l?"":l;s.method=s.method?s.method.toUpperCase():"GET",s.credentials=s.credentials||"same-origin";var c=ll(o,r);if(t.req.originUrl=h,c){var u=-1!==h.indexOf("?")?"&":"?";t.req.url="".concat(h).concat(u).concat(c)}return t.req.options=s,e()},function(t,e){var i;return e().then((function(){if(t){var e=t.res,n=void 0===e?{}:e,s=t.req,r=void 0===s?{}:s,o=(r||{}).options,a=(o=void 0===o?{}:o).responseType,l=void 0===a?"json":a,h=o.charset,c=void 0===h?"utf8":h;o.getResponse;var u=o.throwErrIfParseFail,d=void 0!==u&&u,f=o.parseResponse;if((void 0===f||f)&&n&&n.clone){if((i="BROWSER"===Za()?n.clone():n).useCache=n.useCache||!1,"gbk"===c)try{return n.blob().then(Ka).then((function(t){return qa(t,!1,i,r)}))}catch(xl){throw new Ya(i,xl.message,null,r,"ParseError")}else if("json"===l)return n.text().then((function(t){return qa(t,d,i,r)}));try{return n[l]()}catch(xl){throw new Ya(i,"responseType not support",null,r,"ParseError")}}}})).then((function(e){if(t){t.res;var n=t.req,s=void 0===n?{}:n,r=(s||{}).options,o=(r=void 0===r?{}:r).getResponse,a=void 0!==o&&o;if(i){if(i.status>=200&&i.status<300)return a?void(t.res={data:e,response:i}):void(t.res=e);throw new Ya(i,"http error",e,s,"HttpError")}}})).catch((function(e){if(e instanceof Xa||e instanceof Ya)throw e;var i=t.req,n=t.res;throw e.request=e.request||i,e.response=e.response||n,e.type=e.type||e.name,e.data=e.data||void 0,e}))}],cl=[function(t,e){if(!t)return e();var i=t.req,n=(i=void 0===i?{}:i).options,s=void 0===n?{}:n,r=i.url,o=void 0===r?"":r,a=t.cache,l=t.responseInterceptors,h=s.timeout,c=void 0===h?0:h,u=s.__umiRequestCoreType__,d=void 0===u?"normal":u,f=s.useCache,p=void 0!==f&&f,m=s.method,b=void 0===m?"get":m,g=s.params,y=s.ttl,S=s.validateCache,v=void 0===S?al:S;if("normal"!==d)return process&&process.env&&!1===ol&&(ol=!0,console.warn("__umiRequestCoreType__ is a internal property that use in umi-request, change its value would affect the behavior of request! It only use when you want to extend or use request core.")),e();var x=fetch;if(!x)throw new Error("Global fetch not exist!");var E,_,w,T="BROWSER"===Za(),M=v(o,s)&&p&&T;if(M){var P=a.get({url:o,params:g,method:b});if(P)return(P=P.clone()).useCache=!0,t.res=P,e()}return E=c>0?Promise.race([$a(s),x(o,s),(_=c,w=t.req,new Promise((function(t,e){setTimeout((function(){e(new Xa("timeout of ".concat(_,"ms exceeded"),w,"Timeout"))}),_)})))]):Promise.race([$a(s),x(o,s)]),l.forEach((function(t){E=E.then((function(e){var i="function"==typeof e.clone?e.clone():e;return t(i,s)}))})),E.then((function(i){if(M&&200===i.status){var n=i.clone();n.useCache=!0,a.set({url:o,params:g,method:b},n,y)}return t.res=i,e()}))}];Oa.globalMiddlewares=hl,Oa.defaultGlobalMiddlewaresLength=hl.length,Oa.coreMiddlewares=cl,Oa.defaultCoreMiddlewaresLength=cl.length;var ul=function(){function t(e){Ca(this,t),this.onion=new Oa([]),this.fetchIndex=0,this.mapCache=new Ha(e),this.initOptions=e,this.instanceRequestInterceptors=[],this.instanceResponseInterceptors=[]}return Ra(t,[{key:"use",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{global:!1,core:!1};return this.onion.use(t,e),this}},{key:"extendOptions",value:function(t){this.initOptions=rl(this.initOptions,t),this.mapCache.extendOptions(t)}},{key:"dealRequestInterceptors",value:function(e){return[].concat(Aa(t.requestInterceptors),Aa(this.instanceRequestInterceptors)).reduce((function(t,i){return t.then((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.req.url=t.url||e.req.url,e.req.options=t.options||e.req.options,i(e.req.url,e.req.options)}))}),Promise.resolve()).then((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.req.url=t.url||e.req.url,e.req.options=t.options||e.req.options,Promise.resolve()}))}},{key:"request",value:function(e,i){var n=this,s=this.onion,r={req:{url:e,options:i},res:null,cache:this.mapCache,responseInterceptors:[].concat(Aa(t.responseInterceptors),Aa(this.instanceResponseInterceptors))};if("string"!=typeof e)throw new Error("url MUST be a string");return new Promise((function(t,e){n.dealRequestInterceptors(r).then((function(){return s.execute(r)})).then((function(){t(r.res)})).catch((function(i){var n=r.req.options.errorHandler;if(n)try{var s=n(i);t(s)}catch(xl){e(xl)}else e(i)}))}))}}],[{key:"requestUse",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{global:!0};if("function"!=typeof e)throw new TypeError("Interceptor must be function!");i.global?t.requestInterceptors.push(e):this.instanceRequestInterceptors.push(e)}},{key:"responseUse",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{global:!0};if("function"!=typeof e)throw new TypeError("Interceptor must be function!");i.global?t.responseInterceptors.push(e):this.instanceResponseInterceptors.push(e)}}]),t}();function dl(t){this.message=t}function fl(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var i=this;t((function(t){i.reason||(i.reason=new dl(t),e(i.reason))}))}function pl(t){return!(!t||!t.__CANCEL__)}ul.requestInterceptors=[function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.prefix,n=e.suffix;return i&&(t="".concat(i).concat(t)),n&&(t="".concat(t).concat(n)),{url:t,options:e}}],ul.responseInterceptors=[],dl.prototype.toString=function(){return this.message?"Cancel: ".concat(this.message):"Cancel"},dl.prototype.__CANCEL__=!0,fl.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},fl.source=function(){var t;return{token:new fl((function(e){t=e})),cancel:t}};var ml=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new ul(t),i=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=rl(e.initOptions,i);return e.request(t,n)};i.use=e.use.bind(e),i.fetchIndex=e.fetchIndex,i.interceptors={request:{use:ul.requestUse.bind(e)},response:{use:ul.responseUse.bind(e)}};var n=["get","post","delete","put","patch","head","options","rpc"];return n.forEach((function(t){i[t]=function(e,n){return i(e,Ta({},n,{method:t}))}})),i.Cancel=dl,i.CancelToken=fl,i.isCancel=pl,i.extendOptions=e.extendOptions.bind(e),i.middlewares={instance:e.onion.middlewares,defaultInstance:e.onion.defaultMiddlewares,global:Oa.globalMiddlewares,core:Oa.coreMiddlewares},i};ml({parseResponse:!1});var bl=ml({}),gl=lr((function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,r||t,o),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],a]:t._events[l].push(a):(t._events[l]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,n,s=[];if(0===this._eventsCount)return s;for(n in t=this._events)e.call(t,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},a.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,o=new Array(r);s<r;s++)o[s]=n[s].fn;return o},a.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,s,r,o){var a=i?i+t:t;if(!this._events[a])return!1;var l,h,c=this._events[a],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,s),!0;case 5:return c.fn.call(c.context,e,n,s,r),!0;case 6:return c.fn.call(c.context,e,n,s,r,o),!0}for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c.fn.apply(c.context,l)}else{var d,f=c.length;for(h=0;h<f;h++)switch(c[h].once&&this.removeListener(t,c[h].fn,void 0,!0),u){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,e);break;case 3:c[h].fn.call(c[h].context,e,n);break;case 4:c[h].fn.call(c[h].context,e,n,s);break;default:if(!l)for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c[h].fn.apply(c[h].context,l)}}return!0},a.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,n,s){var r=i?i+t:t;if(!this._events[r])return this;if(!e)return o(this,r),this;var a=this._events[r];if(a.fn)a.fn!==e||s&&!a.once||n&&a.context!==n||o(this,r);else{for(var l=0,h=[],c=a.length;l<c;l++)(a[l].fn!==e||s&&!a[l].once||n&&a[l].context!==n)&&h.push(a[l]);h.length?this._events[r]=1===h.length?h[0]:h:o(this,r)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a}));const yl=async(e,i,n)=>{let s;(n=t({delayRejection:!0},n)).delayRejection&&(e=e.catch((t=>{s=t})));const[r]=await Promise.all([e,(o=i,new Promise((t=>setTimeout(t,o))))]);var o;return s?Promise.reject(s):r};var Sl=yl,vl=yl;Sl.default=vl;export{ro as B,So as P,Po as S,Xn as a,te as b,zn as c,vn as d,gl as e,_o as f,bl as g,ar as h,hr as o,Sl as p,jt as r};