const p$3=function(){const R=document.createElement("link").relList;if(R&&R.supports&&R.supports("modulepreload"))return;for(const G of document.querySelectorAll('link[rel="modulepreload"]'))D(G);new MutationObserver(G=>{for(const U of G)if(U.type==="childList")for(const W of U.addedNodes)W.tagName==="LINK"&&W.rel==="modulepreload"&&D(W)}).observe(document,{childList:!0,subtree:!0});function F(G){const U={};return G.integrity&&(U.integrity=G.integrity),G.referrerpolicy&&(U.referrerPolicy=G.referrerpolicy),G.crossorigin==="use-credentials"?U.credentials="include":G.crossorigin==="anonymous"?U.credentials="omit":U.credentials="same-origin",U}function D(G){if(G.ep)return;G.ep=!0;const U=F(G);fetch(G.href,U)}};p$3();function makeMap(B,R){const F=Object.create(null),D=B.split(",");for(let G=0;G!!F[G.toLowerCase()]:G=>!!F[G]}const specialBooleanAttrs="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",isSpecialBooleanAttr=makeMap(specialBooleanAttrs);function includeBooleanAttr(B){return!!B||B===""}function normalizeStyle(B){if(isArray$5(B)){const R={};for(let F=0;F{if(F){const D=F.split(propertyDelimiterRE);D.length>1&&(R[D[0].trim()]=D[1].trim())}}),R}function normalizeClass(B){let R="";if(isString(B))R=B;else if(isArray$5(B))for(let F=0;F{},NO=()=>!1,onRE=/^on[^a-z]/,isOn=B=>onRE.test(B),isModelListener=B=>B.startsWith("onUpdate:"),extend$3=Object.assign,remove$7=(B,R)=>{const F=B.indexOf(R);F>-1&&B.splice(F,1)},hasOwnProperty$2=Object.prototype.hasOwnProperty,hasOwn=(B,R)=>hasOwnProperty$2.call(B,R),isArray$5=Array.isArray,isMap=B=>toTypeString(B)==="[object Map]",isSet=B=>toTypeString(B)==="[object Set]",isFunction$4=B=>typeof B=="function",isString=B=>typeof B=="string",isSymbol=B=>typeof B=="symbol",isObject$4=B=>B!==null&&typeof B=="object",isPromise$1=B=>isObject$4(B)&&isFunction$4(B.then)&&isFunction$4(B.catch),objectToString$1=Object.prototype.toString,toTypeString=B=>objectToString$1.call(B),toRawType=B=>toTypeString(B).slice(8,-1),isPlainObject$2=B=>toTypeString(B)==="[object Object]",isIntegerKey=B=>isString(B)&&B!=="NaN"&&B[0]!=="-"&&""+parseInt(B,10)===B,isReservedProp=makeMap(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),cacheStringFunction=B=>{const R=Object.create(null);return F=>R[F]||(R[F]=B(F))},camelizeRE$1=/-(\w)/g,camelize$1=cacheStringFunction(B=>B.replace(camelizeRE$1,(R,F)=>F?F.toUpperCase():"")),hyphenateRE=/\B([A-Z])/g,hyphenate=cacheStringFunction(B=>B.replace(hyphenateRE,"-$1").toLowerCase()),capitalize=cacheStringFunction(B=>B.charAt(0).toUpperCase()+B.slice(1)),toHandlerKey=cacheStringFunction(B=>B?`on${capitalize(B)}`:""),hasChanged=(B,R)=>!Object.is(B,R),invokeArrayFns=(B,R)=>{for(let F=0;F{Object.defineProperty(B,R,{configurable:!0,enumerable:!1,value:F})},toNumber=B=>{const R=parseFloat(B);return isNaN(R)?B:R};let _globalThis;const getGlobalThis=()=>_globalThis||(_globalThis=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});let activeEffectScope;class EffectScope{constructor(R=!1){this.active=!0,this.effects=[],this.cleanups=[],!R&&activeEffectScope&&(this.parent=activeEffectScope,this.index=(activeEffectScope.scopes||(activeEffectScope.scopes=[])).push(this)-1)}run(R){if(this.active){const F=activeEffectScope;try{return activeEffectScope=this,R()}finally{activeEffectScope=F}}}on(){activeEffectScope=this}off(){activeEffectScope=this.parent}stop(R){if(this.active){let F,D;for(F=0,D=this.effects.length;F{const R=new Set(B);return R.w=0,R.n=0,R},wasTracked=B=>(B.w&trackOpBit)>0,newTracked=B=>(B.n&trackOpBit)>0,initDepMarkers=({deps:B})=>{if(B.length)for(let R=0;R{const{deps:R}=B;if(R.length){let F=0;for(let D=0;D{(J==="length"||J>=D)&&q.push(Y)});else switch(F!==void 0&&q.push(W.get(F)),R){case"add":isArray$5(B)?isIntegerKey(F)&&q.push(W.get("length")):(q.push(W.get(ITERATE_KEY)),isMap(B)&&q.push(W.get(MAP_KEY_ITERATE_KEY)));break;case"delete":isArray$5(B)||(q.push(W.get(ITERATE_KEY)),isMap(B)&&q.push(W.get(MAP_KEY_ITERATE_KEY)));break;case"set":isMap(B)&&q.push(W.get(ITERATE_KEY));break}if(q.length===1)q[0]&&triggerEffects(q[0]);else{const Y=[];for(const J of q)J&&Y.push(...J);triggerEffects(createDep(Y))}}function triggerEffects(B,R){for(const F of isArray$5(B)?B:[...B])(F!==activeEffect||F.allowRecurse)&&(F.scheduler?F.scheduler():F.run())}const isNonTrackableKeys=makeMap("__proto__,__v_isRef,__isVue"),builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).map(B=>Symbol[B]).filter(isSymbol)),get$1=createGetter(),shallowGet=createGetter(!1,!0),readonlyGet=createGetter(!0),arrayInstrumentations=createArrayInstrumentations();function createArrayInstrumentations(){const B={};return["includes","indexOf","lastIndexOf"].forEach(R=>{B[R]=function(...F){const D=toRaw(this);for(let U=0,W=this.length;U{B[R]=function(...F){pauseTracking();const D=toRaw(this)[R].apply(this,F);return resetTracking(),D}}),B}function createGetter(B=!1,R=!1){return function(D,G,U){if(G==="__v_isReactive")return!B;if(G==="__v_isReadonly")return B;if(G==="__v_isShallow")return R;if(G==="__v_raw"&&U===(B?R?shallowReadonlyMap:readonlyMap:R?shallowReactiveMap:reactiveMap).get(D))return D;const W=isArray$5(D);if(!B&&W&&hasOwn(arrayInstrumentations,G))return Reflect.get(arrayInstrumentations,G,U);const q=Reflect.get(D,G,U);return(isSymbol(G)?builtInSymbols.has(G):isNonTrackableKeys(G))||(B||track(D,"get",G),R)?q:isRef(q)?!W||!isIntegerKey(G)?q.value:q:isObject$4(q)?B?readonly(q):reactive(q):q}}const set=createSetter(),shallowSet=createSetter(!0);function createSetter(B=!1){return function(F,D,G,U){let W=F[D];if(isReadonly(W)&&isRef(W)&&!isRef(G))return!1;if(!B&&!isReadonly(G)&&(isShallow(G)||(G=toRaw(G),W=toRaw(W)),!isArray$5(F)&&isRef(W)&&!isRef(G)))return W.value=G,!0;const q=isArray$5(F)&&isIntegerKey(D)?Number(D)B,getProto=B=>Reflect.getPrototypeOf(B);function get$1$1(B,R,F=!1,D=!1){B=B.__v_raw;const G=toRaw(B),U=toRaw(R);R!==U&&!F&&track(G,"get",R),!F&&track(G,"get",U);const{has:W}=getProto(G),q=D?toShallow:F?toReadonly:toReactive;if(W.call(G,R))return q(B.get(R));if(W.call(G,U))return q(B.get(U));B!==G&&B.get(R)}function has$1$1(B,R=!1){const F=this.__v_raw,D=toRaw(F),G=toRaw(B);return B!==G&&!R&&track(D,"has",B),!R&&track(D,"has",G),B===G?F.has(B):F.has(B)||F.has(G)}function size(B,R=!1){return B=B.__v_raw,!R&&track(toRaw(B),"iterate",ITERATE_KEY),Reflect.get(B,"size",B)}function add(B){B=toRaw(B);const R=toRaw(this);return getProto(R).has.call(R,B)||(R.add(B),trigger$1(R,"add",B,B)),this}function set$1(B,R){R=toRaw(R);const F=toRaw(this),{has:D,get:G}=getProto(F);let U=D.call(F,B);U||(B=toRaw(B),U=D.call(F,B));const W=G.call(F,B);return F.set(B,R),U?hasChanged(R,W)&&trigger$1(F,"set",B,R):trigger$1(F,"add",B,R),this}function deleteEntry(B){const R=toRaw(this),{has:F,get:D}=getProto(R);let G=F.call(R,B);G||(B=toRaw(B),G=F.call(R,B)),D&&D.call(R,B);const U=R.delete(B);return G&&trigger$1(R,"delete",B,void 0),U}function clear(){const B=toRaw(this),R=B.size!==0,F=B.clear();return R&&trigger$1(B,"clear",void 0,void 0),F}function createForEach(B,R){return function(D,G){const U=this,W=U.__v_raw,q=toRaw(W),Y=R?toShallow:B?toReadonly:toReactive;return!B&&track(q,"iterate",ITERATE_KEY),W.forEach((J,Z)=>D.call(G,Y(J),Y(Z),U))}}function createIterableMethod(B,R,F){return function(...D){const G=this.__v_raw,U=toRaw(G),W=isMap(U),q=B==="entries"||B===Symbol.iterator&&W,Y=B==="keys"&&W,J=G[B](...D),Z=F?toShallow:R?toReadonly:toReactive;return!R&&track(U,"iterate",Y?MAP_KEY_ITERATE_KEY:ITERATE_KEY),{next(){const{value:K,done:te}=J.next();return te?{value:K,done:te}:{value:q?[Z(K[0]),Z(K[1])]:Z(K),done:te}},[Symbol.iterator](){return this}}}}function createReadonlyMethod(B){return function(...R){return B==="delete"?!1:this}}function createInstrumentations(){const B={get(U){return get$1$1(this,U)},get size(){return size(this)},has:has$1$1,add,set:set$1,delete:deleteEntry,clear,forEach:createForEach(!1,!1)},R={get(U){return get$1$1(this,U,!1,!0)},get size(){return size(this)},has:has$1$1,add,set:set$1,delete:deleteEntry,clear,forEach:createForEach(!1,!0)},F={get(U){return get$1$1(this,U,!0)},get size(){return size(this,!0)},has(U){return has$1$1.call(this,U,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!1)},D={get(U){return get$1$1(this,U,!0,!0)},get size(){return size(this,!0)},has(U){return has$1$1.call(this,U,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(U=>{B[U]=createIterableMethod(U,!1,!1),F[U]=createIterableMethod(U,!0,!1),R[U]=createIterableMethod(U,!1,!0),D[U]=createIterableMethod(U,!0,!0)}),[B,F,R,D]}const[mutableInstrumentations,readonlyInstrumentations,shallowInstrumentations,shallowReadonlyInstrumentations]=createInstrumentations();function createInstrumentationGetter(B,R){const F=R?B?shallowReadonlyInstrumentations:shallowInstrumentations:B?readonlyInstrumentations:mutableInstrumentations;return(D,G,U)=>G==="__v_isReactive"?!B:G==="__v_isReadonly"?B:G==="__v_raw"?D:Reflect.get(hasOwn(F,G)&&G in D?F:D,G,U)}const mutableCollectionHandlers={get:createInstrumentationGetter(!1,!1)},shallowCollectionHandlers={get:createInstrumentationGetter(!1,!0)},readonlyCollectionHandlers={get:createInstrumentationGetter(!0,!1)},reactiveMap=new WeakMap,shallowReactiveMap=new WeakMap,readonlyMap=new WeakMap,shallowReadonlyMap=new WeakMap;function targetTypeMap(B){switch(B){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function getTargetType(B){return B.__v_skip||!Object.isExtensible(B)?0:targetTypeMap(toRawType(B))}function reactive(B){return isReadonly(B)?B:createReactiveObject(B,!1,mutableHandlers,mutableCollectionHandlers,reactiveMap)}function shallowReactive(B){return createReactiveObject(B,!1,shallowReactiveHandlers,shallowCollectionHandlers,shallowReactiveMap)}function readonly(B){return createReactiveObject(B,!0,readonlyHandlers,readonlyCollectionHandlers,readonlyMap)}function createReactiveObject(B,R,F,D,G){if(!isObject$4(B)||B.__v_raw&&!(R&&B.__v_isReactive))return B;const U=G.get(B);if(U)return U;const W=getTargetType(B);if(W===0)return B;const q=new Proxy(B,W===2?D:F);return G.set(B,q),q}function isReactive(B){return isReadonly(B)?isReactive(B.__v_raw):!!(B&&B.__v_isReactive)}function isReadonly(B){return!!(B&&B.__v_isReadonly)}function isShallow(B){return!!(B&&B.__v_isShallow)}function isProxy(B){return isReactive(B)||isReadonly(B)}function toRaw(B){const R=B&&B.__v_raw;return R?toRaw(R):B}function markRaw(B){return def(B,"__v_skip",!0),B}const toReactive=B=>isObject$4(B)?reactive(B):B,toReadonly=B=>isObject$4(B)?readonly(B):B;function trackRefValue(B){shouldTrack&&activeEffect&&(B=toRaw(B),trackEffects(B.dep||(B.dep=createDep())))}function triggerRefValue(B,R){B=toRaw(B),B.dep&&triggerEffects(B.dep)}function isRef(B){return!!(B&&B.__v_isRef===!0)}function ref(B){return createRef(B,!1)}function shallowRef(B){return createRef(B,!0)}function createRef(B,R){return isRef(B)?B:new RefImpl(B,R)}class RefImpl{constructor(R,F){this.__v_isShallow=F,this.dep=void 0,this.__v_isRef=!0,this._rawValue=F?R:toRaw(R),this._value=F?R:toReactive(R)}get value(){return trackRefValue(this),this._value}set value(R){R=this.__v_isShallow?R:toRaw(R),hasChanged(R,this._rawValue)&&(this._rawValue=R,this._value=this.__v_isShallow?R:toReactive(R),triggerRefValue(this))}}function unref(B){return isRef(B)?B.value:B}const shallowUnwrapHandlers={get:(B,R,F)=>unref(Reflect.get(B,R,F)),set:(B,R,F,D)=>{const G=B[R];return isRef(G)&&!isRef(F)?(G.value=F,!0):Reflect.set(B,R,F,D)}};function proxyRefs(B){return isReactive(B)?B:new Proxy(B,shallowUnwrapHandlers)}function toRefs(B){const R=isArray$5(B)?new Array(B.length):{};for(const F in B)R[F]=toRef(B,F);return R}class ObjectRefImpl{constructor(R,F,D){this._object=R,this._key=F,this._defaultValue=D,this.__v_isRef=!0}get value(){const R=this._object[this._key];return R===void 0?this._defaultValue:R}set value(R){this._object[this._key]=R}}function toRef(B,R,F){const D=B[R];return isRef(D)?D:new ObjectRefImpl(B,R,F)}class ComputedRefImpl{constructor(R,F,D,G){this._setter=F,this.dep=void 0,this.__v_isRef=!0,this._dirty=!0,this.effect=new ReactiveEffect(R,()=>{this._dirty||(this._dirty=!0,triggerRefValue(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!G,this.__v_isReadonly=D}get value(){const R=toRaw(this);return trackRefValue(R),(R._dirty||!R._cacheable)&&(R._dirty=!1,R._value=R.effect.run()),R._value}set value(R){this._setter(R)}}function computed$1(B,R,F=!1){let D,G;const U=isFunction$4(B);return U?(D=B,G=NOOP):(D=B.get,G=B.set),new ComputedRefImpl(D,G,U||!G,F)}function callWithErrorHandling(B,R,F,D){let G;try{G=D?B(...D):B()}catch(U){handleError(U,R,F)}return G}function callWithAsyncErrorHandling(B,R,F,D){if(isFunction$4(B)){const U=callWithErrorHandling(B,R,F,D);return U&&isPromise$1(U)&&U.catch(W=>{handleError(W,R,F)}),U}const G=[];for(let U=0;U>>1;getId(queue$2[D])flushIndex&&queue$2.splice(R,1)}function queueCb(B,R,F,D){isArray$5(B)?F.push(...B):(!R||!R.includes(B,B.allowRecurse?D+1:D))&&F.push(B),queueFlush()}function queuePreFlushCb(B){queueCb(B,activePreFlushCbs,pendingPreFlushCbs,preFlushIndex)}function queuePostFlushCb(B){queueCb(B,activePostFlushCbs,pendingPostFlushCbs,postFlushIndex)}function flushPreFlushCbs(B,R=null){if(pendingPreFlushCbs.length){for(currentPreFlushParentJob=R,activePreFlushCbs=[...new Set(pendingPreFlushCbs)],pendingPreFlushCbs.length=0,preFlushIndex=0;preFlushIndexgetId(F)-getId(D)),postFlushIndex=0;postFlushIndexB.id==null?1/0:B.id;function flushJobs(B){isFlushPending=!1,isFlushing=!0,flushPreFlushCbs(B),queue$2.sort((F,D)=>getId(F)-getId(D));const R=NOOP;try{for(flushIndex=0;flushIndexQ.trim()):K&&(G=F.map(toNumber))}let q,Y=D[q=toHandlerKey(R)]||D[q=toHandlerKey(camelize$1(R))];!Y&&U&&(Y=D[q=toHandlerKey(hyphenate(R))]),Y&&callWithAsyncErrorHandling(Y,B,6,G);const J=D[q+"Once"];if(J){if(!B.emitted)B.emitted={};else if(B.emitted[q])return;B.emitted[q]=!0,callWithAsyncErrorHandling(J,B,6,G)}}function normalizeEmitsOptions(B,R,F=!1){const D=R.emitsCache,G=D.get(B);if(G!==void 0)return G;const U=B.emits;let W={},q=!1;if(!isFunction$4(B)){const Y=J=>{const Z=normalizeEmitsOptions(J,R,!0);Z&&(q=!0,extend$3(W,Z))};!F&&R.mixins.length&&R.mixins.forEach(Y),B.extends&&Y(B.extends),B.mixins&&B.mixins.forEach(Y)}return!U&&!q?(D.set(B,null),null):(isArray$5(U)?U.forEach(Y=>W[Y]=null):extend$3(W,U),D.set(B,W),W)}function isEmitListener(B,R){return!B||!isOn(R)?!1:(R=R.slice(2).replace(/Once$/,""),hasOwn(B,R[0].toLowerCase()+R.slice(1))||hasOwn(B,hyphenate(R))||hasOwn(B,R))}let currentRenderingInstance=null,currentScopeId=null;function setCurrentRenderingInstance(B){const R=currentRenderingInstance;return currentRenderingInstance=B,currentScopeId=B&&B.type.__scopeId||null,R}function withCtx(B,R=currentRenderingInstance,F){if(!R||B._n)return B;const D=(...G)=>{D._d&&setBlockTracking(-1);const U=setCurrentRenderingInstance(R),W=B(...G);return setCurrentRenderingInstance(U),D._d&&setBlockTracking(1),W};return D._n=!0,D._c=!0,D._d=!0,D}function markAttrsAccessed(){}function renderComponentRoot(B){const{type:R,vnode:F,proxy:D,withProxy:G,props:U,propsOptions:[W],slots:q,attrs:Y,emit:J,render:Z,renderCache:K,data:te,setupState:Q,ctx:ie,inheritAttrs:se}=B;let ne,re;const ae=setCurrentRenderingInstance(B);try{if(F.shapeFlag&4){const he=G||D;ne=normalizeVNode(Z.call(he,he,K,U,Q,te,ie)),re=Y}else{const he=R;ne=normalizeVNode(he.length>1?he(U,{attrs:Y,slots:q,emit:J}):he(U,null)),re=R.props?Y:getFunctionalFallthrough(Y)}}catch(he){handleError(he,B,1),ne=createVNode(Comment)}let ce=ne;if(re&&se!==!1){const he=Object.keys(re),{shapeFlag:fe}=ce;he.length&&fe&7&&(W&&he.some(isModelListener)&&(re=filterModelListeners(re,W)),ce=cloneVNode(ce,re))}return F.dirs&&(ce.dirs=ce.dirs?ce.dirs.concat(F.dirs):F.dirs),F.transition&&(ce.transition=F.transition),ne=ce,setCurrentRenderingInstance(ae),ne}const getFunctionalFallthrough=B=>{let R;for(const F in B)(F==="class"||F==="style"||isOn(F))&&((R||(R={}))[F]=B[F]);return R},filterModelListeners=(B,R)=>{const F={};for(const D in B)(!isModelListener(D)||!(D.slice(9)in R))&&(F[D]=B[D]);return F};function shouldUpdateComponent(B,R,F){const{props:D,children:G,component:U}=B,{props:W,children:q,patchFlag:Y}=R,J=U.emitsOptions;if(R.dirs||R.transition)return!0;if(F&&Y>=0){if(Y&1024)return!0;if(Y&16)return D?hasPropsChanged(D,W,J):!!W;if(Y&8){const Z=R.dynamicProps;for(let K=0;KB.__isSuspense;function queueEffectWithSuspense(B,R){R&&R.pendingBranch?isArray$5(B)?R.effects.push(...B):R.effects.push(B):queuePostFlushCb(B)}function provide(B,R){if(currentInstance){let F=currentInstance.provides;const D=currentInstance.parent&¤tInstance.parent.provides;D===F&&(F=currentInstance.provides=Object.create(D)),F[B]=R}}function inject(B,R,F=!1){const D=currentInstance||currentRenderingInstance;if(D){const G=D.parent==null?D.vnode.appContext&&D.vnode.appContext.provides:D.parent.provides;if(G&&B in G)return G[B];if(arguments.length>1)return F&&isFunction$4(R)?R.call(D.proxy):R}}function watchEffect(B,R){return doWatch(B,null,R)}const INITIAL_WATCHER_VALUE={};function watch(B,R,F){return doWatch(B,R,F)}function doWatch(B,R,{immediate:F,deep:D,flush:G,onTrack:U,onTrigger:W}=EMPTY_OBJ){const q=currentInstance;let Y,J=!1,Z=!1;if(isRef(B)?(Y=()=>B.value,J=isShallow(B)):isReactive(B)?(Y=()=>B,D=!0):isArray$5(B)?(Z=!0,J=B.some(isReactive),Y=()=>B.map(re=>{if(isRef(re))return re.value;if(isReactive(re))return traverse(re);if(isFunction$4(re))return callWithErrorHandling(re,q,2)})):isFunction$4(B)?R?Y=()=>callWithErrorHandling(B,q,2):Y=()=>{if(!(q&&q.isUnmounted))return K&&K(),callWithAsyncErrorHandling(B,q,3,[te])}:Y=NOOP,R&&D){const re=Y;Y=()=>traverse(re())}let K,te=re=>{K=ne.onStop=()=>{callWithErrorHandling(re,q,4)}};if(isInSSRComponentSetup)return te=NOOP,R?F&&callWithAsyncErrorHandling(R,q,3,[Y(),Z?[]:void 0,te]):Y(),NOOP;let Q=Z?[]:INITIAL_WATCHER_VALUE;const ie=()=>{if(!!ne.active)if(R){const re=ne.run();(D||J||(Z?re.some((ae,ce)=>hasChanged(ae,Q[ce])):hasChanged(re,Q)))&&(K&&K(),callWithAsyncErrorHandling(R,q,3,[re,Q===INITIAL_WATCHER_VALUE?void 0:Q,te]),Q=re)}else ne.run()};ie.allowRecurse=!!R;let se;G==="sync"?se=ie:G==="post"?se=()=>queuePostRenderEffect(ie,q&&q.suspense):se=()=>{!q||q.isMounted?queuePreFlushCb(ie):ie()};const ne=new ReactiveEffect(Y,se);return R?F?ie():Q=ne.run():G==="post"?queuePostRenderEffect(ne.run.bind(ne),q&&q.suspense):ne.run(),()=>{ne.stop(),q&&q.scope&&remove$7(q.scope.effects,ne)}}function instanceWatch(B,R,F){const D=this.proxy,G=isString(B)?B.includes(".")?createPathGetter(D,B):()=>D[B]:B.bind(D,D);let U;isFunction$4(R)?U=R:(U=R.handler,F=R);const W=currentInstance;setCurrentInstance(this);const q=doWatch(G,U.bind(D),F);return W?setCurrentInstance(W):unsetCurrentInstance(),q}function createPathGetter(B,R){const F=R.split(".");return()=>{let D=B;for(let G=0;G{traverse(F,R)});else if(isPlainObject$2(B))for(const F in B)traverse(B[F],R);return B}function useTransitionState(){const B={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return onMounted(()=>{B.isMounted=!0}),onBeforeUnmount(()=>{B.isUnmounting=!0}),B}const TransitionHookValidator=[Function,Array],BaseTransitionImpl={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:TransitionHookValidator,onEnter:TransitionHookValidator,onAfterEnter:TransitionHookValidator,onEnterCancelled:TransitionHookValidator,onBeforeLeave:TransitionHookValidator,onLeave:TransitionHookValidator,onAfterLeave:TransitionHookValidator,onLeaveCancelled:TransitionHookValidator,onBeforeAppear:TransitionHookValidator,onAppear:TransitionHookValidator,onAfterAppear:TransitionHookValidator,onAppearCancelled:TransitionHookValidator},setup(B,{slots:R}){const F=getCurrentInstance(),D=useTransitionState();let G;return()=>{const U=R.default&&getTransitionRawChildren(R.default(),!0);if(!U||!U.length)return;let W=U[0];if(U.length>1){for(const se of U)if(se.type!==Comment){W=se;break}}const q=toRaw(B),{mode:Y}=q;if(D.isLeaving)return emptyPlaceholder(W);const J=getKeepAliveChild(W);if(!J)return emptyPlaceholder(W);const Z=resolveTransitionHooks(J,q,D,F);setTransitionHooks(J,Z);const K=F.subTree,te=K&&getKeepAliveChild(K);let Q=!1;const{getTransitionKey:ie}=J.type;if(ie){const se=ie();G===void 0?G=se:se!==G&&(G=se,Q=!0)}if(te&&te.type!==Comment&&(!isSameVNodeType(J,te)||Q)){const se=resolveTransitionHooks(te,q,D,F);if(setTransitionHooks(te,se),Y==="out-in")return D.isLeaving=!0,se.afterLeave=()=>{D.isLeaving=!1,F.update()},emptyPlaceholder(W);Y==="in-out"&&J.type!==Comment&&(se.delayLeave=(ne,re,ae)=>{const ce=getLeavingNodesForType(D,te);ce[String(te.key)]=te,ne._leaveCb=()=>{re(),ne._leaveCb=void 0,delete Z.delayedLeave},Z.delayedLeave=ae})}return W}}},BaseTransition=BaseTransitionImpl;function getLeavingNodesForType(B,R){const{leavingVNodes:F}=B;let D=F.get(R.type);return D||(D=Object.create(null),F.set(R.type,D)),D}function resolveTransitionHooks(B,R,F,D){const{appear:G,mode:U,persisted:W=!1,onBeforeEnter:q,onEnter:Y,onAfterEnter:J,onEnterCancelled:Z,onBeforeLeave:K,onLeave:te,onAfterLeave:Q,onLeaveCancelled:ie,onBeforeAppear:se,onAppear:ne,onAfterAppear:re,onAppearCancelled:ae}=R,ce=String(B.key),he=getLeavingNodesForType(F,B),fe=(ue,ge)=>{ue&&callWithAsyncErrorHandling(ue,D,9,ge)},be={mode:U,persisted:W,beforeEnter(ue){let ge=q;if(!F.isMounted)if(G)ge=se||q;else return;ue._leaveCb&&ue._leaveCb(!0);const ve=he[ce];ve&&isSameVNodeType(B,ve)&&ve.el._leaveCb&&ve.el._leaveCb(),fe(ge,[ue])},enter(ue){let ge=Y,ve=J,Se=Z;if(!F.isMounted)if(G)ge=ne||Y,ve=re||J,Se=ae||Z;else return;let pe=!1;const ye=ue._enterCb=Ee=>{pe||(pe=!0,Ee?fe(Se,[ue]):fe(ve,[ue]),be.delayedLeave&&be.delayedLeave(),ue._enterCb=void 0)};ge?(ge(ue,ye),ge.length<=1&&ye()):ye()},leave(ue,ge){const ve=String(B.key);if(ue._enterCb&&ue._enterCb(!0),F.isUnmounting)return ge();fe(K,[ue]);let Se=!1;const pe=ue._leaveCb=ye=>{Se||(Se=!0,ge(),ye?fe(ie,[ue]):fe(Q,[ue]),ue._leaveCb=void 0,he[ve]===B&&delete he[ve])};he[ve]=B,te?(te(ue,pe),te.length<=1&&pe()):pe()},clone(ue){return resolveTransitionHooks(ue,R,F,D)}};return be}function emptyPlaceholder(B){if(isKeepAlive(B))return B=cloneVNode(B),B.children=null,B}function getKeepAliveChild(B){return isKeepAlive(B)?B.children?B.children[0]:void 0:B}function setTransitionHooks(B,R){B.shapeFlag&6&&B.component?setTransitionHooks(B.component.subTree,R):B.shapeFlag&128?(B.ssContent.transition=R.clone(B.ssContent),B.ssFallback.transition=R.clone(B.ssFallback)):B.transition=R}function getTransitionRawChildren(B,R=!1,F){let D=[],G=0;for(let U=0;U1)for(let U=0;U!!B.type.__asyncLoader,isKeepAlive=B=>B.type.__isKeepAlive;function onActivated(B,R){registerKeepAliveHook(B,"a",R)}function onDeactivated(B,R){registerKeepAliveHook(B,"da",R)}function registerKeepAliveHook(B,R,F=currentInstance){const D=B.__wdc||(B.__wdc=()=>{let G=F;for(;G;){if(G.isDeactivated)return;G=G.parent}return B()});if(injectHook(R,D,F),F){let G=F.parent;for(;G&&G.parent;)isKeepAlive(G.parent.vnode)&&injectToKeepAliveRoot(D,R,F,G),G=G.parent}}function injectToKeepAliveRoot(B,R,F,D){const G=injectHook(R,B,D,!0);onUnmounted(()=>{remove$7(D[R],G)},F)}function injectHook(B,R,F=currentInstance,D=!1){if(F){const G=F[B]||(F[B]=[]),U=R.__weh||(R.__weh=(...W)=>{if(F.isUnmounted)return;pauseTracking(),setCurrentInstance(F);const q=callWithAsyncErrorHandling(R,F,B,W);return unsetCurrentInstance(),resetTracking(),q});return D?G.unshift(U):G.push(U),U}}const createHook=B=>(R,F=currentInstance)=>(!isInSSRComponentSetup||B==="sp")&&injectHook(B,R,F),onBeforeMount=createHook("bm"),onMounted=createHook("m"),onBeforeUpdate=createHook("bu"),onUpdated=createHook("u"),onBeforeUnmount=createHook("bum"),onUnmounted=createHook("um"),onServerPrefetch=createHook("sp"),onRenderTriggered=createHook("rtg"),onRenderTracked=createHook("rtc");function onErrorCaptured(B,R=currentInstance){injectHook("ec",B,R)}let shouldCacheAccess=!0;function applyOptions(B){const R=resolveMergedOptions(B),F=B.proxy,D=B.ctx;shouldCacheAccess=!1,R.beforeCreate&&callHook$1(R.beforeCreate,B,"bc");const{data:G,computed:U,methods:W,watch:q,provide:Y,inject:J,created:Z,beforeMount:K,mounted:te,beforeUpdate:Q,updated:ie,activated:se,deactivated:ne,beforeDestroy:re,beforeUnmount:ae,destroyed:ce,unmounted:he,render:fe,renderTracked:be,renderTriggered:ue,errorCaptured:ge,serverPrefetch:ve,expose:Se,inheritAttrs:pe,components:ye,directives:Ee,filters:de}=R;if(J&&resolveInjections(J,D,null,B.appContext.config.unwrapInjectedRef),W)for(const Me in W){const Pe=W[Me];isFunction$4(Pe)&&(D[Me]=Pe.bind(F))}if(G){const Me=G.call(F,F);isObject$4(Me)&&(B.data=reactive(Me))}if(shouldCacheAccess=!0,U)for(const Me in U){const Pe=U[Me],Ne=isFunction$4(Pe)?Pe.bind(F,F):isFunction$4(Pe.get)?Pe.get.bind(F,F):NOOP,ke=!isFunction$4(Pe)&&isFunction$4(Pe.set)?Pe.set.bind(F):NOOP,Ae=computed({get:Ne,set:ke});Object.defineProperty(D,Me,{enumerable:!0,configurable:!0,get:()=>Ae.value,set:_e=>Ae.value=_e})}if(q)for(const Me in q)createWatcher(q[Me],D,F,Me);if(Y){const Me=isFunction$4(Y)?Y.call(F):Y;Reflect.ownKeys(Me).forEach(Pe=>{provide(Pe,Me[Pe])})}Z&&callHook$1(Z,B,"c");function Oe(Me,Pe){isArray$5(Pe)?Pe.forEach(Ne=>Me(Ne.bind(F))):Pe&&Me(Pe.bind(F))}if(Oe(onBeforeMount,K),Oe(onMounted,te),Oe(onBeforeUpdate,Q),Oe(onUpdated,ie),Oe(onActivated,se),Oe(onDeactivated,ne),Oe(onErrorCaptured,ge),Oe(onRenderTracked,be),Oe(onRenderTriggered,ue),Oe(onBeforeUnmount,ae),Oe(onUnmounted,he),Oe(onServerPrefetch,ve),isArray$5(Se))if(Se.length){const Me=B.exposed||(B.exposed={});Se.forEach(Pe=>{Object.defineProperty(Me,Pe,{get:()=>F[Pe],set:Ne=>F[Pe]=Ne})})}else B.exposed||(B.exposed={});fe&&B.render===NOOP&&(B.render=fe),pe!=null&&(B.inheritAttrs=pe),ye&&(B.components=ye),Ee&&(B.directives=Ee)}function resolveInjections(B,R,F=NOOP,D=!1){isArray$5(B)&&(B=normalizeInject(B));for(const G in B){const U=B[G];let W;isObject$4(U)?"default"in U?W=inject(U.from||G,U.default,!0):W=inject(U.from||G):W=inject(U),isRef(W)&&D?Object.defineProperty(R,G,{enumerable:!0,configurable:!0,get:()=>W.value,set:q=>W.value=q}):R[G]=W}}function callHook$1(B,R,F){callWithAsyncErrorHandling(isArray$5(B)?B.map(D=>D.bind(R.proxy)):B.bind(R.proxy),R,F)}function createWatcher(B,R,F,D){const G=D.includes(".")?createPathGetter(F,D):()=>F[D];if(isString(B)){const U=R[B];isFunction$4(U)&&watch(G,U)}else if(isFunction$4(B))watch(G,B.bind(F));else if(isObject$4(B))if(isArray$5(B))B.forEach(U=>createWatcher(U,R,F,D));else{const U=isFunction$4(B.handler)?B.handler.bind(F):R[B.handler];isFunction$4(U)&&watch(G,U,B)}}function resolveMergedOptions(B){const R=B.type,{mixins:F,extends:D}=R,{mixins:G,optionsCache:U,config:{optionMergeStrategies:W}}=B.appContext,q=U.get(R);let Y;return q?Y=q:!G.length&&!F&&!D?Y=R:(Y={},G.length&&G.forEach(J=>mergeOptions$1(Y,J,W,!0)),mergeOptions$1(Y,R,W)),U.set(R,Y),Y}function mergeOptions$1(B,R,F,D=!1){const{mixins:G,extends:U}=R;U&&mergeOptions$1(B,U,F,!0),G&&G.forEach(W=>mergeOptions$1(B,W,F,!0));for(const W in R)if(!(D&&W==="expose")){const q=internalOptionMergeStrats[W]||F&&F[W];B[W]=q?q(B[W],R[W]):R[W]}return B}const internalOptionMergeStrats={data:mergeDataFn,props:mergeObjectOptions,emits:mergeObjectOptions,methods:mergeObjectOptions,computed:mergeObjectOptions,beforeCreate:mergeAsArray,created:mergeAsArray,beforeMount:mergeAsArray,mounted:mergeAsArray,beforeUpdate:mergeAsArray,updated:mergeAsArray,beforeDestroy:mergeAsArray,beforeUnmount:mergeAsArray,destroyed:mergeAsArray,unmounted:mergeAsArray,activated:mergeAsArray,deactivated:mergeAsArray,errorCaptured:mergeAsArray,serverPrefetch:mergeAsArray,components:mergeObjectOptions,directives:mergeObjectOptions,watch:mergeWatchOptions,provide:mergeDataFn,inject:mergeInject};function mergeDataFn(B,R){return R?B?function(){return extend$3(isFunction$4(B)?B.call(this,this):B,isFunction$4(R)?R.call(this,this):R)}:R:B}function mergeInject(B,R){return mergeObjectOptions(normalizeInject(B),normalizeInject(R))}function normalizeInject(B){if(isArray$5(B)){const R={};for(let F=0;F0)&&!(W&16)){if(W&8){const Z=B.vnode.dynamicProps;for(let K=0;K{Y=!0;const[te,Q]=normalizePropsOptions(K,R,!0);extend$3(W,te),Q&&q.push(...Q)};!F&&R.mixins.length&&R.mixins.forEach(Z),B.extends&&Z(B.extends),B.mixins&&B.mixins.forEach(Z)}if(!U&&!Y)return D.set(B,EMPTY_ARR),EMPTY_ARR;if(isArray$5(U))for(let Z=0;Z-1,Q[1]=se<0||ie-1||hasOwn(Q,"default"))&&q.push(K)}}}const J=[W,q];return D.set(B,J),J}function validatePropName(B){return B[0]!=="$"}function getType(B){const R=B&&B.toString().match(/^\s*function (\w+)/);return R?R[1]:B===null?"null":""}function isSameType(B,R){return getType(B)===getType(R)}function getTypeIndex(B,R){return isArray$5(R)?R.findIndex(F=>isSameType(F,B)):isFunction$4(R)&&isSameType(R,B)?0:-1}const isInternalKey=B=>B[0]==="_"||B==="$stable",normalizeSlotValue=B=>isArray$5(B)?B.map(normalizeVNode):[normalizeVNode(B)],normalizeSlot$1=(B,R,F)=>{const D=withCtx((...G)=>normalizeSlotValue(R(...G)),F);return D._c=!1,D},normalizeObjectSlots=(B,R,F)=>{const D=B._ctx;for(const G in B){if(isInternalKey(G))continue;const U=B[G];if(isFunction$4(U))R[G]=normalizeSlot$1(G,U,D);else if(U!=null){const W=normalizeSlotValue(U);R[G]=()=>W}}},normalizeVNodeSlots=(B,R)=>{const F=normalizeSlotValue(R);B.slots.default=()=>F},initSlots=(B,R)=>{if(B.vnode.shapeFlag&32){const F=R._;F?(B.slots=toRaw(R),def(R,"_",F)):normalizeObjectSlots(R,B.slots={})}else B.slots={},R&&normalizeVNodeSlots(B,R);def(B.slots,InternalObjectKey,1)},updateSlots=(B,R,F)=>{const{vnode:D,slots:G}=B;let U=!0,W=EMPTY_OBJ;if(D.shapeFlag&32){const q=R._;q?F&&q===1?U=!1:(extend$3(G,R),!F&&q===1&&delete G._):(U=!R.$stable,normalizeObjectSlots(R,G)),W=R}else R&&(normalizeVNodeSlots(B,R),W={default:1});if(U)for(const q in G)!isInternalKey(q)&&!(q in W)&&delete G[q]};function withDirectives(B,R){const F=currentRenderingInstance;if(F===null)return B;const D=getExposeProxy(F)||F.proxy,G=B.dirs||(B.dirs=[]);for(let U=0;UsetRef(te,R&&(isArray$5(R)?R[Q]:R),F,D,G));return}if(isAsyncWrapper(D)&&!G)return;const U=D.shapeFlag&4?getExposeProxy(D.component)||D.component.proxy:D.el,W=G?null:U,{i:q,r:Y}=B,J=R&&R.r,Z=q.refs===EMPTY_OBJ?q.refs={}:q.refs,K=q.setupState;if(J!=null&&J!==Y&&(isString(J)?(Z[J]=null,hasOwn(K,J)&&(K[J]=null)):isRef(J)&&(J.value=null)),isFunction$4(Y))callWithErrorHandling(Y,q,12,[W,Z]);else{const te=isString(Y),Q=isRef(Y);if(te||Q){const ie=()=>{if(B.f){const se=te?Z[Y]:Y.value;G?isArray$5(se)&&remove$7(se,U):isArray$5(se)?se.includes(U)||se.push(U):te?(Z[Y]=[U],hasOwn(K,Y)&&(K[Y]=Z[Y])):(Y.value=[U],B.k&&(Z[B.k]=Y.value))}else te?(Z[Y]=W,hasOwn(K,Y)&&(K[Y]=W)):isRef(Y)&&(Y.value=W,B.k&&(Z[B.k]=W))};W?(ie.id=-1,queuePostRenderEffect(ie,F)):ie()}}}const queuePostRenderEffect=queueEffectWithSuspense;function createRenderer(B){return baseCreateRenderer(B)}function baseCreateRenderer(B,R){const F=getGlobalThis();F.__VUE__=!0;const{insert:D,remove:G,patchProp:U,createElement:W,createText:q,createComment:Y,setText:J,setElementText:Z,parentNode:K,nextSibling:te,setScopeId:Q=NOOP,cloneNode:ie,insertStaticContent:se}=B,ne=(De,xe,ze,qe=null,Re=null,Le=null,je=!1,Xe=null,Qe=!!xe.dynamicChildren)=>{if(De===xe)return;De&&!isSameVNodeType(De,xe)&&(qe=Ve(De),Fe(De,Re,Le,!0),De=null),xe.patchFlag===-2&&(Qe=!1,xe.dynamicChildren=null);const{type:He,ref:tt,shapeFlag:ot}=xe;switch(He){case Text:re(De,xe,ze,qe);break;case Comment:ae(De,xe,ze,qe);break;case Static:De==null&&ce(xe,ze,qe,je);break;case Fragment:Ee(De,xe,ze,qe,Re,Le,je,Xe,Qe);break;default:ot&1?be(De,xe,ze,qe,Re,Le,je,Xe,Qe):ot&6?de(De,xe,ze,qe,Re,Le,je,Xe,Qe):(ot&64||ot&128)&&He.process(De,xe,ze,qe,Re,Le,je,Xe,Qe,nt)}tt!=null&&Re&&setRef(tt,De&&De.ref,Le,xe||De,!xe)},re=(De,xe,ze,qe)=>{if(De==null)D(xe.el=q(xe.children),ze,qe);else{const Re=xe.el=De.el;xe.children!==De.children&&J(Re,xe.children)}},ae=(De,xe,ze,qe)=>{De==null?D(xe.el=Y(xe.children||""),ze,qe):xe.el=De.el},ce=(De,xe,ze,qe)=>{[De.el,De.anchor]=se(De.children,xe,ze,qe,De.el,De.anchor)},he=({el:De,anchor:xe},ze,qe)=>{let Re;for(;De&&De!==xe;)Re=te(De),D(De,ze,qe),De=Re;D(xe,ze,qe)},fe=({el:De,anchor:xe})=>{let ze;for(;De&&De!==xe;)ze=te(De),G(De),De=ze;G(xe)},be=(De,xe,ze,qe,Re,Le,je,Xe,Qe)=>{je=je||xe.type==="svg",De==null?ue(xe,ze,qe,Re,Le,je,Xe,Qe):Se(De,xe,Re,Le,je,Xe,Qe)},ue=(De,xe,ze,qe,Re,Le,je,Xe)=>{let Qe,He;const{type:tt,props:ot,shapeFlag:rt,transition:ft,patchFlag:St,dirs:lt}=De;if(De.el&&ie!==void 0&&St===-1)Qe=De.el=ie(De.el);else{if(Qe=De.el=W(De.type,Le,ot&&ot.is,ot),rt&8?Z(Qe,De.children):rt&16&&ve(De.children,Qe,null,qe,Re,Le&&tt!=="foreignObject",je,Xe),lt&&invokeDirectiveHook(De,null,qe,"created"),ot){for(const Et in ot)Et!=="value"&&!isReservedProp(Et)&&U(Qe,Et,null,ot[Et],Le,De.children,qe,Re,We);"value"in ot&&U(Qe,"value",null,ot.value),(He=ot.onVnodeBeforeMount)&&invokeVNodeHook(He,qe,De)}ge(Qe,De,De.scopeId,je,qe)}lt&&invokeDirectiveHook(De,null,qe,"beforeMount");const vt=(!Re||Re&&!Re.pendingBranch)&&ft&&!ft.persisted;vt&&ft.beforeEnter(Qe),D(Qe,xe,ze),((He=ot&&ot.onVnodeMounted)||vt||lt)&&queuePostRenderEffect(()=>{He&&invokeVNodeHook(He,qe,De),vt&&ft.enter(Qe),lt&&invokeDirectiveHook(De,null,qe,"mounted")},Re)},ge=(De,xe,ze,qe,Re)=>{if(ze&&Q(De,ze),qe)for(let Le=0;Le{for(let He=Qe;He{const Xe=xe.el=De.el;let{patchFlag:Qe,dynamicChildren:He,dirs:tt}=xe;Qe|=De.patchFlag&16;const ot=De.props||EMPTY_OBJ,rt=xe.props||EMPTY_OBJ;let ft;ze&&toggleRecurse(ze,!1),(ft=rt.onVnodeBeforeUpdate)&&invokeVNodeHook(ft,ze,xe,De),tt&&invokeDirectiveHook(xe,De,ze,"beforeUpdate"),ze&&toggleRecurse(ze,!0);const St=Re&&xe.type!=="foreignObject";if(He?pe(De.dynamicChildren,He,Xe,ze,qe,St,Le):je||Ne(De,xe,Xe,null,ze,qe,St,Le,!1),Qe>0){if(Qe&16)ye(Xe,xe,ot,rt,ze,qe,Re);else if(Qe&2&&ot.class!==rt.class&&U(Xe,"class",null,rt.class,Re),Qe&4&&U(Xe,"style",ot.style,rt.style,Re),Qe&8){const lt=xe.dynamicProps;for(let vt=0;vt{ft&&invokeVNodeHook(ft,ze,xe,De),tt&&invokeDirectiveHook(xe,De,ze,"updated")},qe)},pe=(De,xe,ze,qe,Re,Le,je)=>{for(let Xe=0;Xe{if(ze!==qe){for(const Xe in qe){if(isReservedProp(Xe))continue;const Qe=qe[Xe],He=ze[Xe];Qe!==He&&Xe!=="value"&&U(De,Xe,He,Qe,je,xe.children,Re,Le,We)}if(ze!==EMPTY_OBJ)for(const Xe in ze)!isReservedProp(Xe)&&!(Xe in qe)&&U(De,Xe,ze[Xe],null,je,xe.children,Re,Le,We);"value"in qe&&U(De,"value",ze.value,qe.value)}},Ee=(De,xe,ze,qe,Re,Le,je,Xe,Qe)=>{const He=xe.el=De?De.el:q(""),tt=xe.anchor=De?De.anchor:q("");let{patchFlag:ot,dynamicChildren:rt,slotScopeIds:ft}=xe;ft&&(Xe=Xe?Xe.concat(ft):ft),De==null?(D(He,ze,qe),D(tt,ze,qe),ve(xe.children,ze,tt,Re,Le,je,Xe,Qe)):ot>0&&ot&64&&rt&&De.dynamicChildren?(pe(De.dynamicChildren,rt,ze,Re,Le,je,Xe),(xe.key!=null||Re&&xe===Re.subTree)&&traverseStaticChildren(De,xe,!0)):Ne(De,xe,ze,tt,Re,Le,je,Xe,Qe)},de=(De,xe,ze,qe,Re,Le,je,Xe,Qe)=>{xe.slotScopeIds=Xe,De==null?xe.shapeFlag&512?Re.ctx.activate(xe,ze,qe,je,Qe):we(xe,ze,qe,Re,Le,je,Qe):Oe(De,xe,Qe)},we=(De,xe,ze,qe,Re,Le,je)=>{const Xe=De.component=createComponentInstance(De,qe,Re);if(isKeepAlive(De)&&(Xe.ctx.renderer=nt),setupComponent(Xe),Xe.asyncDep){if(Re&&Re.registerDep(Xe,Me),!De.el){const Qe=Xe.subTree=createVNode(Comment);ae(null,Qe,xe,ze)}return}Me(Xe,De,xe,ze,Re,Le,je)},Oe=(De,xe,ze)=>{const qe=xe.component=De.component;if(shouldUpdateComponent(De,xe,ze))if(qe.asyncDep&&!qe.asyncResolved){Pe(qe,xe,ze);return}else qe.next=xe,invalidateJob(qe.update),qe.update();else xe.component=De.component,xe.el=De.el,qe.vnode=xe},Me=(De,xe,ze,qe,Re,Le,je)=>{const Xe=()=>{if(De.isMounted){let{next:tt,bu:ot,u:rt,parent:ft,vnode:St}=De,lt=tt,vt;toggleRecurse(De,!1),tt?(tt.el=St.el,Pe(De,tt,je)):tt=St,ot&&invokeArrayFns(ot),(vt=tt.props&&tt.props.onVnodeBeforeUpdate)&&invokeVNodeHook(vt,ft,tt,St),toggleRecurse(De,!0);const Et=renderComponentRoot(De),Lt=De.subTree;De.subTree=Et,ne(Lt,Et,K(Lt.el),Ve(Lt),De,Re,Le),tt.el=Et.el,lt===null&&updateHOCHostEl(De,Et.el),rt&&queuePostRenderEffect(rt,Re),(vt=tt.props&&tt.props.onVnodeUpdated)&&queuePostRenderEffect(()=>invokeVNodeHook(vt,ft,tt,St),Re)}else{let tt;const{el:ot,props:rt}=xe,{bm:ft,m:St,parent:lt}=De,vt=isAsyncWrapper(xe);if(toggleRecurse(De,!1),ft&&invokeArrayFns(ft),!vt&&(tt=rt&&rt.onVnodeBeforeMount)&&invokeVNodeHook(tt,lt,xe),toggleRecurse(De,!0),ot&&ct){const Et=()=>{De.subTree=renderComponentRoot(De),ct(ot,De.subTree,De,Re,null)};vt?xe.type.__asyncLoader().then(()=>!De.isUnmounted&&Et()):Et()}else{const Et=De.subTree=renderComponentRoot(De);ne(null,Et,ze,qe,De,Re,Le),xe.el=Et.el}if(St&&queuePostRenderEffect(St,Re),!vt&&(tt=rt&&rt.onVnodeMounted)){const Et=xe;queuePostRenderEffect(()=>invokeVNodeHook(tt,lt,Et),Re)}xe.shapeFlag&256&&De.a&&queuePostRenderEffect(De.a,Re),De.isMounted=!0,xe=ze=qe=null}},Qe=De.effect=new ReactiveEffect(Xe,()=>queueJob(De.update),De.scope),He=De.update=Qe.run.bind(Qe);He.id=De.uid,toggleRecurse(De,!0),He()},Pe=(De,xe,ze)=>{xe.component=De;const qe=De.vnode.props;De.vnode=xe,De.next=null,updateProps(De,xe.props,qe,ze),updateSlots(De,xe.children,ze),pauseTracking(),flushPreFlushCbs(void 0,De.update),resetTracking()},Ne=(De,xe,ze,qe,Re,Le,je,Xe,Qe=!1)=>{const He=De&&De.children,tt=De?De.shapeFlag:0,ot=xe.children,{patchFlag:rt,shapeFlag:ft}=xe;if(rt>0){if(rt&128){Ae(He,ot,ze,qe,Re,Le,je,Xe,Qe);return}else if(rt&256){ke(He,ot,ze,qe,Re,Le,je,Xe,Qe);return}}ft&8?(tt&16&&We(He,Re,Le),ot!==He&&Z(ze,ot)):tt&16?ft&16?Ae(He,ot,ze,qe,Re,Le,je,Xe,Qe):We(He,Re,Le,!0):(tt&8&&Z(ze,""),ft&16&&ve(ot,ze,qe,Re,Le,je,Xe,Qe))},ke=(De,xe,ze,qe,Re,Le,je,Xe,Qe)=>{De=De||EMPTY_ARR,xe=xe||EMPTY_ARR;const He=De.length,tt=xe.length,ot=Math.min(He,tt);let rt;for(rt=0;rttt?We(De,Re,Le,!0,!1,ot):ve(xe,ze,qe,Re,Le,je,Xe,Qe,ot)},Ae=(De,xe,ze,qe,Re,Le,je,Xe,Qe)=>{let He=0;const tt=xe.length;let ot=De.length-1,rt=tt-1;for(;He<=ot&&He<=rt;){const ft=De[He],St=xe[He]=Qe?cloneIfMounted(xe[He]):normalizeVNode(xe[He]);if(isSameVNodeType(ft,St))ne(ft,St,ze,null,Re,Le,je,Xe,Qe);else break;He++}for(;He<=ot&&He<=rt;){const ft=De[ot],St=xe[rt]=Qe?cloneIfMounted(xe[rt]):normalizeVNode(xe[rt]);if(isSameVNodeType(ft,St))ne(ft,St,ze,null,Re,Le,je,Xe,Qe);else break;ot--,rt--}if(He>ot){if(He<=rt){const ft=rt+1,St=ftrt)for(;He<=ot;)Fe(De[He],Re,Le,!0),He++;else{const ft=He,St=He,lt=new Map;for(He=St;He<=rt;He++){const gt=xe[He]=Qe?cloneIfMounted(xe[He]):normalizeVNode(xe[He]);gt.key!=null&<.set(gt.key,He)}let vt,Et=0;const Lt=rt-St+1;let Qt=!1,Dt=0;const qt=new Array(Lt);for(He=0;He=Lt){Fe(gt,Re,Le,!0);continue}let Wt;if(gt.key!=null)Wt=lt.get(gt.key);else for(vt=St;vt<=rt;vt++)if(qt[vt-St]===0&&isSameVNodeType(gt,xe[vt])){Wt=vt;break}Wt===void 0?Fe(gt,Re,Le,!0):(qt[Wt-St]=He+1,Wt>=Dt?Dt=Wt:Qt=!0,ne(gt,xe[Wt],ze,null,Re,Le,je,Xe,Qe),Et++)}const ei=Qt?getSequence(qt):EMPTY_ARR;for(vt=ei.length-1,He=Lt-1;He>=0;He--){const gt=St+He,Wt=xe[gt],ri=gt+1{const{el:Le,type:je,transition:Xe,children:Qe,shapeFlag:He}=De;if(He&6){_e(De.component.subTree,xe,ze,qe);return}if(He&128){De.suspense.move(xe,ze,qe);return}if(He&64){je.move(De,xe,ze,nt);return}if(je===Fragment){D(Le,xe,ze);for(let ot=0;otXe.enter(Le),Re);else{const{leave:ot,delayLeave:rt,afterLeave:ft}=Xe,St=()=>D(Le,xe,ze),lt=()=>{ot(Le,()=>{St(),ft&&ft()})};rt?rt(Le,St,lt):lt()}else D(Le,xe,ze)},Fe=(De,xe,ze,qe=!1,Re=!1)=>{const{type:Le,props:je,ref:Xe,children:Qe,dynamicChildren:He,shapeFlag:tt,patchFlag:ot,dirs:rt}=De;if(Xe!=null&&setRef(Xe,null,ze,De,!0),tt&256){xe.ctx.deactivate(De);return}const ft=tt&1&&rt,St=!isAsyncWrapper(De);let lt;if(St&&(lt=je&&je.onVnodeBeforeUnmount)&&invokeVNodeHook(lt,xe,De),tt&6)Ge(De.component,ze,qe);else{if(tt&128){De.suspense.unmount(ze,qe);return}ft&&invokeDirectiveHook(De,null,xe,"beforeUnmount"),tt&64?De.type.remove(De,xe,ze,Re,nt,qe):He&&(Le!==Fragment||ot>0&&ot&64)?We(He,xe,ze,!1,!0):(Le===Fragment&&ot&384||!Re&&tt&16)&&We(Qe,xe,ze),qe&&Ye(De)}(St&&(lt=je&&je.onVnodeUnmounted)||ft)&&queuePostRenderEffect(()=>{lt&&invokeVNodeHook(lt,xe,De),ft&&invokeDirectiveHook(De,null,xe,"unmounted")},ze)},Ye=De=>{const{type:xe,el:ze,anchor:qe,transition:Re}=De;if(xe===Fragment){Ce(ze,qe);return}if(xe===Static){fe(De);return}const Le=()=>{G(ze),Re&&!Re.persisted&&Re.afterLeave&&Re.afterLeave()};if(De.shapeFlag&1&&Re&&!Re.persisted){const{leave:je,delayLeave:Xe}=Re,Qe=()=>je(ze,Le);Xe?Xe(De.el,Le,Qe):Qe()}else Le()},Ce=(De,xe)=>{let ze;for(;De!==xe;)ze=te(De),G(De),De=ze;G(xe)},Ge=(De,xe,ze)=>{const{bum:qe,scope:Re,update:Le,subTree:je,um:Xe}=De;qe&&invokeArrayFns(qe),Re.stop(),Le&&(Le.active=!1,Fe(je,De,xe,ze)),Xe&&queuePostRenderEffect(Xe,xe),queuePostRenderEffect(()=>{De.isUnmounted=!0},xe),xe&&xe.pendingBranch&&!xe.isUnmounted&&De.asyncDep&&!De.asyncResolved&&De.suspenseId===xe.pendingId&&(xe.deps--,xe.deps===0&&xe.resolve())},We=(De,xe,ze,qe=!1,Re=!1,Le=0)=>{for(let je=Le;jeDe.shapeFlag&6?Ve(De.component.subTree):De.shapeFlag&128?De.suspense.next():te(De.anchor||De.el),Ze=(De,xe,ze)=>{De==null?xe._vnode&&Fe(xe._vnode,null,null,!0):ne(xe._vnode||null,De,xe,null,null,null,ze),flushPostFlushCbs(),xe._vnode=De},nt={p:ne,um:Fe,m:_e,r:Ye,mt:we,mc:ve,pc:Ne,pbc:pe,n:Ve,o:B};let at,ct;return R&&([at,ct]=R(nt)),{render:Ze,hydrate:at,createApp:createAppAPI(Ze,at)}}function toggleRecurse({effect:B,update:R},F){B.allowRecurse=R.allowRecurse=F}function traverseStaticChildren(B,R,F=!1){const D=B.children,G=R.children;if(isArray$5(D)&&isArray$5(G))for(let U=0;U>1,B[F[q]]0&&(R[D]=F[U-1]),F[U]=D)}}for(U=F.length,W=F[U-1];U-- >0;)F[U]=W,W=R[W];return F}const isTeleport=B=>B.__isTeleport,isTeleportDisabled=B=>B&&(B.disabled||B.disabled===""),isTargetSVG=B=>typeof SVGElement!="undefined"&&B instanceof SVGElement,resolveTarget=(B,R)=>{const F=B&&B.to;return isString(F)?R?R(F):null:F},TeleportImpl={__isTeleport:!0,process(B,R,F,D,G,U,W,q,Y,J){const{mc:Z,pc:K,pbc:te,o:{insert:Q,querySelector:ie,createText:se,createComment:ne}}=J,re=isTeleportDisabled(R.props);let{shapeFlag:ae,children:ce,dynamicChildren:he}=R;if(B==null){const fe=R.el=se(""),be=R.anchor=se("");Q(fe,F,D),Q(be,F,D);const ue=R.target=resolveTarget(R.props,ie),ge=R.targetAnchor=se("");ue&&(Q(ge,ue),W=W||isTargetSVG(ue));const ve=(Se,pe)=>{ae&16&&Z(ce,Se,pe,G,U,W,q,Y)};re?ve(F,be):ue&&ve(ue,ge)}else{R.el=B.el;const fe=R.anchor=B.anchor,be=R.target=B.target,ue=R.targetAnchor=B.targetAnchor,ge=isTeleportDisabled(B.props),ve=ge?F:be,Se=ge?fe:ue;if(W=W||isTargetSVG(be),he?(te(B.dynamicChildren,he,ve,G,U,W,q),traverseStaticChildren(B,R,!0)):Y||K(B,R,ve,Se,G,U,W,q,!1),re)ge||moveTeleport(R,F,fe,J,1);else if((R.props&&R.props.to)!==(B.props&&B.props.to)){const pe=R.target=resolveTarget(R.props,ie);pe&&moveTeleport(R,pe,null,J,0)}else ge&&moveTeleport(R,be,ue,J,1)}},remove(B,R,F,D,{um:G,o:{remove:U}},W){const{shapeFlag:q,children:Y,anchor:J,targetAnchor:Z,target:K,props:te}=B;if(K&&U(Z),(W||!isTeleportDisabled(te))&&(U(J),q&16))for(let Q=0;QB!=null?B:null,normalizeRef=({ref:B,ref_key:R,ref_for:F})=>B!=null?isString(B)||isRef(B)||isFunction$4(B)?{i:currentRenderingInstance,r:B,k:R,f:!!F}:B:null;function createBaseVNode(B,R=null,F=null,D=0,G=null,U=B===Fragment?0:1,W=!1,q=!1){const Y={__v_isVNode:!0,__v_skip:!0,type:B,props:R,key:R&&normalizeKey(R),ref:R&&normalizeRef(R),scopeId:currentScopeId,slotScopeIds:null,children:F,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:U,patchFlag:D,dynamicProps:G,dynamicChildren:null,appContext:null};return q?(normalizeChildren(Y,F),U&128&&B.normalize(Y)):F&&(Y.shapeFlag|=isString(F)?8:16),isBlockTreeEnabled>0&&!W&¤tBlock&&(Y.patchFlag>0||U&6)&&Y.patchFlag!==32&¤tBlock.push(Y),Y}const createVNode=_createVNode;function _createVNode(B,R=null,F=null,D=0,G=null,U=!1){if((!B||B===NULL_DYNAMIC_COMPONENT)&&(B=Comment),isVNode(B)){const q=cloneVNode(B,R,!0);return F&&normalizeChildren(q,F),q}if(isClassComponent(B)&&(B=B.__vccOpts),R){R=guardReactiveProps(R);let{class:q,style:Y}=R;q&&!isString(q)&&(R.class=normalizeClass(q)),isObject$4(Y)&&(isProxy(Y)&&!isArray$5(Y)&&(Y=extend$3({},Y)),R.style=normalizeStyle(Y))}const W=isString(B)?1:isSuspense(B)?128:isTeleport(B)?64:isObject$4(B)?4:isFunction$4(B)?2:0;return createBaseVNode(B,R,F,D,G,W,U,!0)}function guardReactiveProps(B){return B?isProxy(B)||InternalObjectKey in B?extend$3({},B):B:null}function cloneVNode(B,R,F=!1){const{props:D,ref:G,patchFlag:U,children:W}=B,q=R?mergeProps(D||{},R):D;return{__v_isVNode:!0,__v_skip:!0,type:B.type,props:q,key:q&&normalizeKey(q),ref:R&&R.ref?F&&G?isArray$5(G)?G.concat(normalizeRef(R)):[G,normalizeRef(R)]:normalizeRef(R):G,scopeId:B.scopeId,slotScopeIds:B.slotScopeIds,children:W,target:B.target,targetAnchor:B.targetAnchor,staticCount:B.staticCount,shapeFlag:B.shapeFlag,patchFlag:R&&B.type!==Fragment?U===-1?16:U|16:U,dynamicProps:B.dynamicProps,dynamicChildren:B.dynamicChildren,appContext:B.appContext,dirs:B.dirs,transition:B.transition,component:B.component,suspense:B.suspense,ssContent:B.ssContent&&cloneVNode(B.ssContent),ssFallback:B.ssFallback&&cloneVNode(B.ssFallback),el:B.el,anchor:B.anchor}}function createTextVNode(B=" ",R=0){return createVNode(Text,null,B,R)}function normalizeVNode(B){return B==null||typeof B=="boolean"?createVNode(Comment):isArray$5(B)?createVNode(Fragment,null,B.slice()):typeof B=="object"?cloneIfMounted(B):createVNode(Text,null,String(B))}function cloneIfMounted(B){return B.el===null||B.memo?B:cloneVNode(B)}function normalizeChildren(B,R){let F=0;const{shapeFlag:D}=B;if(R==null)R=null;else if(isArray$5(R))F=16;else if(typeof R=="object")if(D&65){const G=R.default;G&&(G._c&&(G._d=!1),normalizeChildren(B,G()),G._c&&(G._d=!0));return}else{F=32;const G=R._;!G&&!(InternalObjectKey in R)?R._ctx=currentRenderingInstance:G===3&¤tRenderingInstance&&(currentRenderingInstance.slots._===1?R._=1:(R._=2,B.patchFlag|=1024))}else isFunction$4(R)?(R={default:R,_ctx:currentRenderingInstance},F=32):(R=String(R),D&64?(F=16,R=[createTextVNode(R)]):F=8);B.children=R,B.shapeFlag|=F}function mergeProps(...B){const R={};for(let F=0;FB?isStatefulComponent(B)?getExposeProxy(B)||B.proxy:getPublicInstance(B.parent):null,publicPropertiesMap=extend$3(Object.create(null),{$:B=>B,$el:B=>B.vnode.el,$data:B=>B.data,$props:B=>B.props,$attrs:B=>B.attrs,$slots:B=>B.slots,$refs:B=>B.refs,$parent:B=>getPublicInstance(B.parent),$root:B=>getPublicInstance(B.root),$emit:B=>B.emit,$options:B=>resolveMergedOptions(B),$forceUpdate:B=>()=>queueJob(B.update),$nextTick:B=>nextTick.bind(B.proxy),$watch:B=>instanceWatch.bind(B)}),PublicInstanceProxyHandlers={get({_:B},R){const{ctx:F,setupState:D,data:G,props:U,accessCache:W,type:q,appContext:Y}=B;let J;if(R[0]!=="$"){const Q=W[R];if(Q!==void 0)switch(Q){case 1:return D[R];case 2:return G[R];case 4:return F[R];case 3:return U[R]}else{if(D!==EMPTY_OBJ&&hasOwn(D,R))return W[R]=1,D[R];if(G!==EMPTY_OBJ&&hasOwn(G,R))return W[R]=2,G[R];if((J=B.propsOptions[0])&&hasOwn(J,R))return W[R]=3,U[R];if(F!==EMPTY_OBJ&&hasOwn(F,R))return W[R]=4,F[R];shouldCacheAccess&&(W[R]=0)}}const Z=publicPropertiesMap[R];let K,te;if(Z)return R==="$attrs"&&track(B,"get",R),Z(B);if((K=q.__cssModules)&&(K=K[R]))return K;if(F!==EMPTY_OBJ&&hasOwn(F,R))return W[R]=4,F[R];if(te=Y.config.globalProperties,hasOwn(te,R))return te[R]},set({_:B},R,F){const{data:D,setupState:G,ctx:U}=B;return G!==EMPTY_OBJ&&hasOwn(G,R)?(G[R]=F,!0):D!==EMPTY_OBJ&&hasOwn(D,R)?(D[R]=F,!0):hasOwn(B.props,R)||R[0]==="$"&&R.slice(1)in B?!1:(U[R]=F,!0)},has({_:{data:B,setupState:R,accessCache:F,ctx:D,appContext:G,propsOptions:U}},W){let q;return!!F[W]||B!==EMPTY_OBJ&&hasOwn(B,W)||R!==EMPTY_OBJ&&hasOwn(R,W)||(q=U[0])&&hasOwn(q,W)||hasOwn(D,W)||hasOwn(publicPropertiesMap,W)||hasOwn(G.config.globalProperties,W)},defineProperty(B,R,F){return F.get!=null?B._.accessCache[R]=0:hasOwn(F,"value")&&this.set(B,R,F.value,null),Reflect.defineProperty(B,R,F)}},emptyAppContext=createAppContext();let uid$1=0;function createComponentInstance(B,R,F){const D=B.type,G=(R?R.appContext:B.appContext)||emptyAppContext,U={uid:uid$1++,vnode:B,type:D,parent:R,appContext:G,root:null,next:null,subTree:null,effect:null,update:null,scope:new EffectScope(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:R?R.provides:Object.create(G.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:normalizePropsOptions(D,G),emitsOptions:normalizeEmitsOptions(D,G),emit:null,emitted:null,propsDefaults:EMPTY_OBJ,inheritAttrs:D.inheritAttrs,ctx:EMPTY_OBJ,data:EMPTY_OBJ,props:EMPTY_OBJ,attrs:EMPTY_OBJ,slots:EMPTY_OBJ,refs:EMPTY_OBJ,setupState:EMPTY_OBJ,setupContext:null,suspense:F,suspenseId:F?F.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,sp:null};return U.ctx={_:U},U.root=R?R.root:U,U.emit=emit$1.bind(null,U),B.ce&&B.ce(U),U}let currentInstance=null;const getCurrentInstance=()=>currentInstance||currentRenderingInstance,setCurrentInstance=B=>{currentInstance=B,B.scope.on()},unsetCurrentInstance=()=>{currentInstance&¤tInstance.scope.off(),currentInstance=null};function isStatefulComponent(B){return B.vnode.shapeFlag&4}let isInSSRComponentSetup=!1;function setupComponent(B,R=!1){isInSSRComponentSetup=R;const{props:F,children:D}=B.vnode,G=isStatefulComponent(B);initProps(B,F,G,R),initSlots(B,D);const U=G?setupStatefulComponent(B,R):void 0;return isInSSRComponentSetup=!1,U}function setupStatefulComponent(B,R){const F=B.type;B.accessCache=Object.create(null),B.proxy=markRaw(new Proxy(B.ctx,PublicInstanceProxyHandlers));const{setup:D}=F;if(D){const G=B.setupContext=D.length>1?createSetupContext(B):null;setCurrentInstance(B),pauseTracking();const U=callWithErrorHandling(D,B,0,[B.props,G]);if(resetTracking(),unsetCurrentInstance(),isPromise$1(U)){if(U.then(unsetCurrentInstance,unsetCurrentInstance),R)return U.then(W=>{handleSetupResult(B,W,R)}).catch(W=>{handleError(W,B,0)});B.asyncDep=U}else handleSetupResult(B,U,R)}else finishComponentSetup(B,R)}function handleSetupResult(B,R,F){isFunction$4(R)?B.type.__ssrInlineRender?B.ssrRender=R:B.render=R:isObject$4(R)&&(B.setupState=proxyRefs(R)),finishComponentSetup(B,F)}let compile$1;function finishComponentSetup(B,R,F){const D=B.type;if(!B.render){if(!R&&compile$1&&!D.render){const G=D.template;if(G){const{isCustomElement:U,compilerOptions:W}=B.appContext.config,{delimiters:q,compilerOptions:Y}=D,J=extend$3(extend$3({isCustomElement:U,delimiters:q},W),Y);D.render=compile$1(G,J)}}B.render=D.render||NOOP}setCurrentInstance(B),pauseTracking(),applyOptions(B),resetTracking(),unsetCurrentInstance()}function createAttrsProxy(B){return new Proxy(B.attrs,{get(R,F){return track(B,"get","$attrs"),R[F]}})}function createSetupContext(B){const R=D=>{B.exposed=D||{}};let F;return{get attrs(){return F||(F=createAttrsProxy(B))},slots:B.slots,emit:B.emit,expose:R}}function getExposeProxy(B){if(B.exposed)return B.exposeProxy||(B.exposeProxy=new Proxy(proxyRefs(markRaw(B.exposed)),{get(R,F){if(F in R)return R[F];if(F in publicPropertiesMap)return publicPropertiesMap[F](B)}}))}function getComponentName(B){return isFunction$4(B)&&B.displayName||B.name}function isClassComponent(B){return isFunction$4(B)&&"__vccOpts"in B}const computed=(B,R)=>computed$1(B,R,isInSSRComponentSetup);function h$3(B,R,F){const D=arguments.length;return D===2?isObject$4(R)&&!isArray$5(R)?isVNode(R)?createVNode(B,null,[R]):createVNode(B,R):createVNode(B,null,R):(D>3?F=Array.prototype.slice.call(arguments,2):D===3&&isVNode(F)&&(F=[F]),createVNode(B,R,F))}const version="3.2.33",svgNS="http://www.w3.org/2000/svg",doc$2=typeof document!="undefined"?document:null,templateContainer=doc$2&&doc$2.createElement("template"),nodeOps={insert:(B,R,F)=>{R.insertBefore(B,F||null)},remove:B=>{const R=B.parentNode;R&&R.removeChild(B)},createElement:(B,R,F,D)=>{const G=R?doc$2.createElementNS(svgNS,B):doc$2.createElement(B,F?{is:F}:void 0);return B==="select"&&D&&D.multiple!=null&&G.setAttribute("multiple",D.multiple),G},createText:B=>doc$2.createTextNode(B),createComment:B=>doc$2.createComment(B),setText:(B,R)=>{B.nodeValue=R},setElementText:(B,R)=>{B.textContent=R},parentNode:B=>B.parentNode,nextSibling:B=>B.nextSibling,querySelector:B=>doc$2.querySelector(B),setScopeId(B,R){B.setAttribute(R,"")},cloneNode(B){const R=B.cloneNode(!0);return"_value"in B&&(R._value=B._value),R},insertStaticContent(B,R,F,D,G,U){const W=F?F.previousSibling:R.lastChild;if(G&&(G===U||G.nextSibling))for(;R.insertBefore(G.cloneNode(!0),F),!(G===U||!(G=G.nextSibling)););else{templateContainer.innerHTML=D?`${B}`:B;const q=templateContainer.content;if(D){const Y=q.firstChild;for(;Y.firstChild;)q.appendChild(Y.firstChild);q.removeChild(Y)}R.insertBefore(q,F)}return[W?W.nextSibling:R.firstChild,F?F.previousSibling:R.lastChild]}};function patchClass(B,R,F){const D=B._vtc;D&&(R=(R?[R,...D]:[...D]).join(" ")),R==null?B.removeAttribute("class"):F?B.setAttribute("class",R):B.className=R}function patchStyle(B,R,F){const D=B.style,G=isString(F);if(F&&!G){for(const U in F)setStyle(D,U,F[U]);if(R&&!isString(R))for(const U in R)F[U]==null&&setStyle(D,U,"")}else{const U=D.display;G?R!==F&&(D.cssText=F):R&&B.removeAttribute("style"),"_vod"in B&&(D.display=U)}}const importantRE=/\s*!important$/;function setStyle(B,R,F){if(isArray$5(F))F.forEach(D=>setStyle(B,R,D));else if(F==null&&(F=""),R.startsWith("--"))B.setProperty(R,F);else{const D=autoPrefix(B,R);importantRE.test(F)?B.setProperty(hyphenate(D),F.replace(importantRE,""),"important"):B[D]=F}}const prefixes=["Webkit","Moz","ms"],prefixCache={};function autoPrefix(B,R){const F=prefixCache[R];if(F)return F;let D=camelize$1(R);if(D!=="filter"&&D in B)return prefixCache[R]=D;D=capitalize(D);for(let G=0;G{let B=Date.now,R=!1;if(typeof window!="undefined"){Date.now()>document.createEvent("Event").timeStamp&&(B=()=>performance.now());const F=navigator.userAgent.match(/firefox\/(\d+)/i);R=!!(F&&Number(F[1])<=53)}return[B,R]})();let cachedNow=0;const p$2=Promise.resolve(),reset$1=()=>{cachedNow=0},getNow=()=>cachedNow||(p$2.then(reset$1),cachedNow=_getNow());function addEventListener(B,R,F,D){B.addEventListener(R,F,D)}function removeEventListener(B,R,F,D){B.removeEventListener(R,F,D)}function patchEvent(B,R,F,D,G=null){const U=B._vei||(B._vei={}),W=U[R];if(D&&W)W.value=D;else{const[q,Y]=parseName(R);if(D){const J=U[R]=createInvoker(D,G);addEventListener(B,q,J,Y)}else W&&(removeEventListener(B,q,W,Y),U[R]=void 0)}}const optionsModifierRE=/(?:Once|Passive|Capture)$/;function parseName(B){let R;if(optionsModifierRE.test(B)){R={};let F;for(;F=B.match(optionsModifierRE);)B=B.slice(0,B.length-F[0].length),R[F[0].toLowerCase()]=!0}return[hyphenate(B.slice(2)),R]}function createInvoker(B,R){const F=D=>{const G=D.timeStamp||_getNow();(skipTimestampCheck||G>=F.attached-1)&&callWithAsyncErrorHandling(patchStopImmediatePropagation(D,F.value),R,5,[D])};return F.value=B,F.attached=getNow(),F}function patchStopImmediatePropagation(B,R){if(isArray$5(R)){const F=B.stopImmediatePropagation;return B.stopImmediatePropagation=()=>{F.call(B),B._stopped=!0},R.map(D=>G=>!G._stopped&&D&&D(G))}else return R}const nativeOnRE=/^on[a-z]/,patchProp=(B,R,F,D,G=!1,U,W,q,Y)=>{R==="class"?patchClass(B,D,G):R==="style"?patchStyle(B,F,D):isOn(R)?isModelListener(R)||patchEvent(B,R,F,D,W):(R[0]==="."?(R=R.slice(1),!0):R[0]==="^"?(R=R.slice(1),!1):shouldSetAsProp(B,R,D,G))?patchDOMProp(B,R,D,U,W,q,Y):(R==="true-value"?B._trueValue=D:R==="false-value"&&(B._falseValue=D),patchAttr(B,R,D,G))};function shouldSetAsProp(B,R,F,D){return D?!!(R==="innerHTML"||R==="textContent"||R in B&&nativeOnRE.test(R)&&isFunction$4(F)):R==="spellcheck"||R==="draggable"||R==="translate"||R==="form"||R==="list"&&B.tagName==="INPUT"||R==="type"&&B.tagName==="TEXTAREA"||nativeOnRE.test(R)&&isString(F)?!1:R in B}const TRANSITION="transition",ANIMATION="animation",Transition=(B,{slots:R})=>h$3(BaseTransition,resolveTransitionProps(B),R);Transition.displayName="Transition";const DOMTransitionPropsValidators={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},TransitionPropsValidators=Transition.props=extend$3({},BaseTransition.props,DOMTransitionPropsValidators),callHook=(B,R=[])=>{isArray$5(B)?B.forEach(F=>F(...R)):B&&B(...R)},hasExplicitCallback=B=>B?isArray$5(B)?B.some(R=>R.length>1):B.length>1:!1;function resolveTransitionProps(B){const R={};for(const ye in B)ye in DOMTransitionPropsValidators||(R[ye]=B[ye]);if(B.css===!1)return R;const{name:F="v",type:D,duration:G,enterFromClass:U=`${F}-enter-from`,enterActiveClass:W=`${F}-enter-active`,enterToClass:q=`${F}-enter-to`,appearFromClass:Y=U,appearActiveClass:J=W,appearToClass:Z=q,leaveFromClass:K=`${F}-leave-from`,leaveActiveClass:te=`${F}-leave-active`,leaveToClass:Q=`${F}-leave-to`}=B,ie=normalizeDuration(G),se=ie&&ie[0],ne=ie&&ie[1],{onBeforeEnter:re,onEnter:ae,onEnterCancelled:ce,onLeave:he,onLeaveCancelled:fe,onBeforeAppear:be=re,onAppear:ue=ae,onAppearCancelled:ge=ce}=R,ve=(ye,Ee,de)=>{removeTransitionClass(ye,Ee?Z:q),removeTransitionClass(ye,Ee?J:W),de&&de()},Se=(ye,Ee)=>{removeTransitionClass(ye,Q),removeTransitionClass(ye,te),Ee&&Ee()},pe=ye=>(Ee,de)=>{const we=ye?ue:ae,Oe=()=>ve(Ee,ye,de);callHook(we,[Ee,Oe]),nextFrame(()=>{removeTransitionClass(Ee,ye?Y:U),addTransitionClass(Ee,ye?Z:q),hasExplicitCallback(we)||whenTransitionEnds(Ee,D,se,Oe)})};return extend$3(R,{onBeforeEnter(ye){callHook(re,[ye]),addTransitionClass(ye,U),addTransitionClass(ye,W)},onBeforeAppear(ye){callHook(be,[ye]),addTransitionClass(ye,Y),addTransitionClass(ye,J)},onEnter:pe(!1),onAppear:pe(!0),onLeave(ye,Ee){const de=()=>Se(ye,Ee);addTransitionClass(ye,K),forceReflow(),addTransitionClass(ye,te),nextFrame(()=>{removeTransitionClass(ye,K),addTransitionClass(ye,Q),hasExplicitCallback(he)||whenTransitionEnds(ye,D,ne,de)}),callHook(he,[ye,de])},onEnterCancelled(ye){ve(ye,!1),callHook(ce,[ye])},onAppearCancelled(ye){ve(ye,!0),callHook(ge,[ye])},onLeaveCancelled(ye){Se(ye),callHook(fe,[ye])}})}function normalizeDuration(B){if(B==null)return null;if(isObject$4(B))return[NumberOf(B.enter),NumberOf(B.leave)];{const R=NumberOf(B);return[R,R]}}function NumberOf(B){return toNumber(B)}function addTransitionClass(B,R){R.split(/\s+/).forEach(F=>F&&B.classList.add(F)),(B._vtc||(B._vtc=new Set)).add(R)}function removeTransitionClass(B,R){R.split(/\s+/).forEach(D=>D&&B.classList.remove(D));const{_vtc:F}=B;F&&(F.delete(R),F.size||(B._vtc=void 0))}function nextFrame(B){requestAnimationFrame(()=>{requestAnimationFrame(B)})}let endId=0;function whenTransitionEnds(B,R,F,D){const G=B._endId=++endId,U=()=>{G===B._endId&&D()};if(F)return setTimeout(U,F);const{type:W,timeout:q,propCount:Y}=getTransitionInfo(B,R);if(!W)return D();const J=W+"end";let Z=0;const K=()=>{B.removeEventListener(J,te),U()},te=Q=>{Q.target===B&&++Z>=Y&&K()};setTimeout(()=>{Z(F[ie]||"").split(", "),G=D(TRANSITION+"Delay"),U=D(TRANSITION+"Duration"),W=getTimeout(G,U),q=D(ANIMATION+"Delay"),Y=D(ANIMATION+"Duration"),J=getTimeout(q,Y);let Z=null,K=0,te=0;R===TRANSITION?W>0&&(Z=TRANSITION,K=W,te=U.length):R===ANIMATION?J>0&&(Z=ANIMATION,K=J,te=Y.length):(K=Math.max(W,J),Z=K>0?W>J?TRANSITION:ANIMATION:null,te=Z?Z===TRANSITION?U.length:Y.length:0);const Q=Z===TRANSITION&&/\b(transform|all)(,|$)/.test(F[TRANSITION+"Property"]);return{type:Z,timeout:K,propCount:te,hasTransform:Q}}function getTimeout(B,R){for(;B.lengthtoMs(F)+toMs(B[D])))}function toMs(B){return Number(B.slice(0,-1).replace(",","."))*1e3}function forceReflow(){return document.body.offsetHeight}const positionMap=new WeakMap,newPositionMap=new WeakMap,TransitionGroupImpl={name:"TransitionGroup",props:extend$3({},TransitionPropsValidators,{tag:String,moveClass:String}),setup(B,{slots:R}){const F=getCurrentInstance(),D=useTransitionState();let G,U;return onUpdated(()=>{if(!G.length)return;const W=B.moveClass||`${B.name||"v"}-move`;if(!hasCSSTransform(G[0].el,F.vnode.el,W))return;G.forEach(callPendingCbs),G.forEach(recordPosition);const q=G.filter(applyTranslation);forceReflow(),q.forEach(Y=>{const J=Y.el,Z=J.style;addTransitionClass(J,W),Z.transform=Z.webkitTransform=Z.transitionDuration="";const K=J._moveCb=te=>{te&&te.target!==J||(!te||/transform$/.test(te.propertyName))&&(J.removeEventListener("transitionend",K),J._moveCb=null,removeTransitionClass(J,W))};J.addEventListener("transitionend",K)})}),()=>{const W=toRaw(B),q=resolveTransitionProps(W);let Y=W.tag||Fragment;G=U,U=R.default?getTransitionRawChildren(R.default()):[];for(let J=0;J{W.split(/\s+/).forEach(q=>q&&D.classList.remove(q))}),F.split(/\s+/).forEach(W=>W&&D.classList.add(W)),D.style.display="none";const G=R.nodeType===1?R:R.parentNode;G.appendChild(D);const{hasTransform:U}=getTransitionInfo(D);return G.removeChild(D),U}const vShow={beforeMount(B,{value:R},{transition:F}){B._vod=B.style.display==="none"?"":B.style.display,F&&R?F.beforeEnter(B):setDisplay(B,R)},mounted(B,{value:R},{transition:F}){F&&R&&F.enter(B)},updated(B,{value:R,oldValue:F},{transition:D}){!R!=!F&&(D?R?(D.beforeEnter(B),setDisplay(B,!0),D.enter(B)):D.leave(B,()=>{setDisplay(B,!1)}):setDisplay(B,R))},beforeUnmount(B,{value:R}){setDisplay(B,R)}};function setDisplay(B,R){B.style.display=R?B._vod:"none"}const rendererOptions=extend$3({patchProp},nodeOps);let renderer;function ensureRenderer(){return renderer||(renderer=createRenderer(rendererOptions))}const createApp=(...B)=>{const R=ensureRenderer().createApp(...B),{mount:F}=R;return R.mount=D=>{const G=normalizeContainer(D);if(!G)return;const U=R._component;!isFunction$4(U)&&!U.render&&!U.template&&(U.template=G.innerHTML),G.innerHTML="";const W=F(G,!1,G instanceof SVGElement);return G instanceof Element&&(G.removeAttribute("v-cloak"),G.setAttribute("data-v-app","")),W},R};function normalizeContainer(B){return isString(B)?document.querySelector(B):B}var commonjsGlobal$1=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function getAugmentedNamespace(B){if(B.__esModule)return B;var R=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(B).forEach(function(F){var D=Object.getOwnPropertyDescriptor(B,F);Object.defineProperty(R,F,D.get?D:{enumerable:!0,get:function(){return B[F]}})}),R}function commonjsRequire$1(B){throw new Error('Could not dynamically require "'+B+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pMinDelay$2={exports:{}},yoctodelay=B=>new Promise(R=>setTimeout(R,B));const delay=yoctodelay,pMinDelay=async(B,R,F)=>{F={delayRejection:!0,...F};let D;F.delayRejection&&(B=B.catch(U=>{D=U}));const[G]=await Promise.all([B,delay(R)]);return D?Promise.reject(D):G};pMinDelay$2.exports=pMinDelay;pMinDelay$2.exports.default=pMinDelay;var pMinDelay$1=pMinDelay$2.exports;const el=document.getElementById("loading"),close$1=async()=>{var B;await pMinDelay$1(Promise.resolve(),300),el==null||el.classList.remove("show"),(B=document.getElementById("update"))==null||B.classList.remove("show")},open$1=()=>{el==null||el.classList.add("show")};var queryString={},strictUriEncode=B=>encodeURIComponent(B).replace(/[!'()*]/g,R=>`%${R.charCodeAt(0).toString(16).toUpperCase()}`),token="%[a-f0-9]{2}",singleMatcher=new RegExp(token,"gi"),multiMatcher=new RegExp("("+token+")+","gi");function decodeComponents(B,R){try{return decodeURIComponent(B.join(""))}catch{}if(B.length===1)return B;R=R||1;var F=B.slice(0,R),D=B.slice(R);return Array.prototype.concat.call([],decodeComponents(F),decodeComponents(D))}function decode$4(B){try{return decodeURIComponent(B)}catch{for(var R=B.match(singleMatcher),F=1;F{if(!(typeof B=="string"&&typeof R=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(R==="")return[B];const F=B.indexOf(R);return F===-1?[B]:[B.slice(0,F),B.slice(F+R.length)]},filterObj=function(B,R){for(var F={},D=Object.keys(B),G=Array.isArray(R),U=0;Ure==null;function W(re){switch(re.arrayFormat){case"index":return ae=>(ce,he)=>{const fe=ce.length;return he===void 0||re.skipNull&&he===null||re.skipEmptyString&&he===""?ce:he===null?[...ce,[J(ae,re),"[",fe,"]"].join("")]:[...ce,[J(ae,re),"[",J(fe,re),"]=",J(he,re)].join("")]};case"bracket":return ae=>(ce,he)=>he===void 0||re.skipNull&&he===null||re.skipEmptyString&&he===""?ce:he===null?[...ce,[J(ae,re),"[]"].join("")]:[...ce,[J(ae,re),"[]=",J(he,re)].join("")];case"comma":case"separator":return ae=>(ce,he)=>he==null||he.length===0?ce:ce.length===0?[[J(ae,re),"=",J(he,re)].join("")]:[[ce,J(he,re)].join(re.arrayFormatSeparator)];default:return ae=>(ce,he)=>he===void 0||re.skipNull&&he===null||re.skipEmptyString&&he===""?ce:he===null?[...ce,J(ae,re)]:[...ce,[J(ae,re),"=",J(he,re)].join("")]}}function q(re){let ae;switch(re.arrayFormat){case"index":return(ce,he,fe)=>{if(ae=/\[(\d*)\]$/.exec(ce),ce=ce.replace(/\[\d*\]$/,""),!ae){fe[ce]=he;return}fe[ce]===void 0&&(fe[ce]={}),fe[ce][ae[1]]=he};case"bracket":return(ce,he,fe)=>{if(ae=/(\[\])$/.exec(ce),ce=ce.replace(/\[\]$/,""),!ae){fe[ce]=he;return}if(fe[ce]===void 0){fe[ce]=[he];return}fe[ce]=[].concat(fe[ce],he)};case"comma":case"separator":return(ce,he,fe)=>{const be=typeof he=="string"&&he.includes(re.arrayFormatSeparator),ue=typeof he=="string"&&!be&&Z(he,re).includes(re.arrayFormatSeparator);he=ue?Z(he,re):he;const ge=be||ue?he.split(re.arrayFormatSeparator).map(ve=>Z(ve,re)):he===null?he:Z(he,re);fe[ce]=ge};default:return(ce,he,fe)=>{if(fe[ce]===void 0){fe[ce]=he;return}fe[ce]=[].concat(fe[ce],he)}}}function Y(re){if(typeof re!="string"||re.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function J(re,ae){return ae.encode?ae.strict?R(re):encodeURIComponent(re):re}function Z(re,ae){return ae.decode?F(re):re}function K(re){return Array.isArray(re)?re.sort():typeof re=="object"?K(Object.keys(re)).sort((ae,ce)=>Number(ae)-Number(ce)).map(ae=>re[ae]):re}function te(re){const ae=re.indexOf("#");return ae!==-1&&(re=re.slice(0,ae)),re}function Q(re){let ae="";const ce=re.indexOf("#");return ce!==-1&&(ae=re.slice(ce)),ae}function ie(re){re=te(re);const ae=re.indexOf("?");return ae===-1?"":re.slice(ae+1)}function se(re,ae){return ae.parseNumbers&&!Number.isNaN(Number(re))&&typeof re=="string"&&re.trim()!==""?re=Number(re):ae.parseBooleans&&re!==null&&(re.toLowerCase()==="true"||re.toLowerCase()==="false")&&(re=re.toLowerCase()==="true"),re}function ne(re,ae){ae=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},ae),Y(ae.arrayFormatSeparator);const ce=q(ae),he=Object.create(null);if(typeof re!="string"||(re=re.trim().replace(/^[?#&]/,""),!re))return he;for(const fe of re.split("&")){if(fe==="")continue;let[be,ue]=D(ae.decode?fe.replace(/\+/g," "):fe,"=");ue=ue===void 0?null:["comma","separator"].includes(ae.arrayFormat)?ue:Z(ue,ae),ce(Z(be,ae),ue,he)}for(const fe of Object.keys(he)){const be=he[fe];if(typeof be=="object"&&be!==null)for(const ue of Object.keys(be))be[ue]=se(be[ue],ae);else he[fe]=se(be,ae)}return ae.sort===!1?he:(ae.sort===!0?Object.keys(he).sort():Object.keys(he).sort(ae.sort)).reduce((fe,be)=>{const ue=he[be];return Boolean(ue)&&typeof ue=="object"&&!Array.isArray(ue)?fe[be]=K(ue):fe[be]=ue,fe},Object.create(null))}B.extract=ie,B.parse=ne,B.stringify=(re,ae)=>{if(!re)return"";ae=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},ae),Y(ae.arrayFormatSeparator);const ce=ue=>ae.skipNull&&U(re[ue])||ae.skipEmptyString&&re[ue]==="",he=W(ae),fe={};for(const ue of Object.keys(re))ce(ue)||(fe[ue]=re[ue]);const be=Object.keys(fe);return ae.sort!==!1&&be.sort(ae.sort),be.map(ue=>{const ge=re[ue];return ge===void 0?"":ge===null?J(ue,ae):Array.isArray(ge)?ge.reduce(he(ue),[]).join("&"):J(ue,ae)+"="+J(ge,ae)}).filter(ue=>ue.length>0).join("&")},B.parseUrl=(re,ae)=>{ae=Object.assign({decode:!0},ae);const[ce,he]=D(re,"#");return Object.assign({url:ce.split("?")[0]||"",query:ne(ie(re),ae)},ae&&ae.parseFragmentIdentifier&&he?{fragmentIdentifier:Z(he,ae)}:{})},B.stringifyUrl=(re,ae)=>{ae=Object.assign({encode:!0,strict:!0},ae);const ce=te(re.url).split("?")[0]||"",he=B.extract(re.url),fe=B.parse(he,{sort:!1}),be=Object.assign(fe,re.query);let ue=B.stringify(be,ae);ue&&(ue=`?${ue}`);let ge=Q(re.url);return re.fragmentIdentifier&&(ge=`#${J(re.fragmentIdentifier,ae)}`),`${ce}${ue}${ge}`},B.pick=(re,ae,ce)=>{ce=Object.assign({parseFragmentIdentifier:!0},ce);const{url:he,query:fe,fragmentIdentifier:be}=B.parseUrl(re,ce);return B.stringifyUrl({url:he,query:G(fe,ae),fragmentIdentifier:be},ce)},B.exclude=(re,ae,ce)=>{const he=Array.isArray(ae)?fe=>!ae.includes(fe):(fe,be)=>!ae(fe,be);return B.pick(re,he,ce)}})(queryString);const state$4=reactive({modular:{teaching:!1,follow:!1,fingering:!1,switch:!1,speed:!1,evaluating:!1,excerpts:!1,recording:!1},modularDetail:{teaching:{name:"\u5927\u96C5\u91D1\u5510\u6559\u6750",desc:"\u540C\u6B65\u4E50\u56E2\u5B66\u4E60\u6559\u6750\uFF0C\u8BA9\u5B69\u5B50\u5728\u4E13\u4E1A\u7CFB\u7EDF\u7684\u8BAD\u7EC3\u4E0B\u63D0\u5347\u6F14\u594F\u6C34\u5E73",images:["./static/teaching/1.jpg","./static/teaching/2.jpg","./static/teaching/3.jpg"]},follow:{name:"\u4E94\u7EBF\u8C31\u8DDF\u64AD",desc:"\u5C06\u6559\u6750\u8F6C\u5316\u6210\u4E94\u7EBF\u8C31\uFF0C\u5E76\u652F\u6301\u97F3\u7B26\u6839\u636E\u64AD\u653E\u8FDB\u5EA6\u9AD8\u4EAE\u663E\u793A\uFF0C\u589E\u5F3A\u5B69\u5B50\u6F14\u594F\u4E50\u611F",images:["./static/follow/1.jpg"]},fingering:{name:"\u6F14\u594F\u6307\u6CD5\u8DDF\u64AD",desc:"\u6839\u636E\u97F3\u7B26\u65F6\u503C\u5C55\u73B0\u6F14\u594F\u6307\u6CD5\uFF0C\u57F9\u517B\u5B69\u5B50\u826F\u597D\u7684\u6F14\u594F\u4E60\u60EF",images:["./static/fingering/1.jpg","./static/fingering/2.jpg","./static/fingering/3.jpg"]},switch:{name:"\u539F\u58F0/\u4F34\u594F\u5207\u6362",desc:"\u4E3A\u4E0D\u540C\u58F0\u90E8\u5B66\u5458\u63D0\u4F9B\u4E13\u4E1A\u4F34\u594F\uFF0C\u652F\u6301\u4F34\u594F\u4E0E\u539F\u97F3\u5207\u6362\uFF0C\u58F0\u4E34\u5176\u5883\u7684\u611F\u53D7\u4E50\u66F2",images:["./static/switch/1.jpg","./static/switch/2.jpg"]},speed:{name:"\u64AD\u653E\u901F\u5EA6\u8C03\u6574",desc:"\u64AD\u653E\u901F\u5EA6\u8BFE\u6839\u636E\u4E2A\u4EBA\u7EC3\u4E60\u60C5\u51B5\u8C03\u6574\uFF0C\u5FAA\u5E8F\u6E10\u8FDB\u7684\u638C\u63E1\u6BCF\u9996\u66F2\u76EE\u7684\u6F14\u594F",images:["./static/speed/1.jpg","./static/speed/2.jpg"]},evaluating:{name:"\u667A\u80FD\u8BC4\u6D4B",desc:"\u4E3A\u5B69\u5B50\u7684\u6F14\u594F\u63D0\u4F9B\u4E13\u4E1A\u3001\u6807\u51C6\u7684\u70B9\u8BC4",images:["./static/evaluating/1.jpg","./static/evaluating/2.jpg","./static/evaluating/3.jpg"]},excerpts:{name:"\u4E94\u7EBF\u8C31\u9009\u6BB5\u64AD\u653E",desc:"\u6839\u636E\u7EC3\u4E60\u60C5\u51B5\u9009\u62E9\u91CD\u96BE\u70B9\u5C0F\u8282\u5FAA\u73AF\u7EC3\u4E60\uFF0C\u5E2E\u52A9\u5B69\u5B50\u7A81\u7834\u96BE\u5173",images:["./static/excerpts/1.jpg"]},recording:{name:"\u8FB9\u5F55\u8FB9\u64AD",desc:"\u6253\u5F00\u6444\u50CF\u5934\uFF0C\u53EF\u4EE5\u5728\u7EC3\u4E60\u65F6\u770B\u5230\u81EA\u5DF1\u7684\u6F14\u594F\u72B6\u6001\uFF0C\u8FD8\u53EF\u4EE5\u5F55\u5236\u6F14\u594F\u7684\u89C6\u9891\u6216\u97F3\u9891",images:[]}},openKey:"",user:null,subjectId:0,subjectLoading:!1,origanSubjectId:0,subjectOptions:[{value:0,text:"\u5168\u90E8\u58F0\u90E8"}],chinesePartName:{},MusicalInstrumentClassification:{},tenantId:null,organId:null,extSubjectIds:[],clintNmae:"orchestra"});var assign$2=make_assign(),create$1=make_create(),trim$1=make_trim(),Global$5=typeof window!="undefined"?window:commonjsGlobal$1,util$h={assign:assign$2,create:create$1,trim:trim$1,bind:bind$1,slice:slice$2,each:each$8,map,pluck:pluck$1,isList:isList$1,isFunction:isFunction$3,isObject:isObject$3,Global:Global$5};function make_assign(){return Object.assign?Object.assign:function(R,F,D,G){for(var U=1;U=0;R--){var F=localStorage$1().key(R);B(read$6(F),F)}}function remove$6(B){return localStorage$1().removeItem(B)}function clearAll$5(){return localStorage$1().clear()}var util$e=util$h,Global$3=util$e.Global,oldFFGlobalStorage={name:"oldFF-globalStorage",read:read$5,write:write$5,each:each$5,remove:remove$5,clearAll:clearAll$4},globalStorage=Global$3.globalStorage;function read$5(B){return globalStorage[B]}function write$5(B,R){globalStorage[B]=R}function each$5(B){for(var R=globalStorage.length-1;R>=0;R--){var F=globalStorage.key(R);B(globalStorage[F],F)}}function remove$5(B){return globalStorage.removeItem(B)}function clearAll$4(){each$5(function(B,R){delete globalStorage[B]})}var util$d=util$h,Global$2=util$d.Global,oldIEUserDataStorage={name:"oldIE-userDataStorage",write:write$4,read:read$4,each:each$4,remove:remove$4,clearAll:clearAll$3},storageName="storejs",doc$1=Global$2.document,_withStorageEl=_makeIEStorageElFunction(),disable=(Global$2.navigator?Global$2.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function write$4(B,R){if(!disable){var F=fixKey(B);_withStorageEl(function(D){D.setAttribute(F,R),D.save(storageName)})}}function read$4(B){if(!disable){var R=fixKey(B),F=null;return _withStorageEl(function(D){F=D.getAttribute(R)}),F}}function each$4(B){_withStorageEl(function(R){for(var F=R.XMLDocument.documentElement.attributes,D=F.length-1;D>=0;D--){var G=F[D];B(R.getAttribute(G.name),G.name)}})}function remove$4(B){var R=fixKey(B);_withStorageEl(function(F){F.removeAttribute(R),F.save(storageName)})}function clearAll$3(){_withStorageEl(function(B){var R=B.XMLDocument.documentElement.attributes;B.load(storageName);for(var F=R.length-1;F>=0;F--)B.removeAttribute(R[F].name);B.save(storageName)})}var forbiddenCharsRegex=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function fixKey(B){return B.replace(/^\d/,"___$&").replace(forbiddenCharsRegex,"___")}function _makeIEStorageElFunction(){if(!doc$1||!doc$1.documentElement||!doc$1.documentElement.addBehavior)return null;var B="script",R,F,D;try{F=new ActiveXObject("htmlfile"),F.open(),F.write("<"+B+">document.w=window'),F.close(),R=F.w.frames[0].document,D=R.createElement("div")}catch{D=doc$1.createElement("div"),R=doc$1.body}return function(G){var U=[].slice.call(arguments,0);U.unshift(D),R.appendChild(D),D.addBehavior("#default#userData"),D.load(storageName),G.apply(this,U),R.removeChild(D)}}var util$c=util$h,Global$1=util$c.Global,trim=util$c.trim,cookieStorage={name:"cookieStorage",read:read$3,write:write$3,each:each$3,remove:remove$3,clearAll:clearAll$2},doc=Global$1.document;function read$3(B){if(!B||!_has(B))return null;var R="(?:^|.*;\\s*)"+escape(B).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(doc.cookie.replace(new RegExp(R),"$1"))}function each$3(B){for(var R=doc.cookie.split(/; ?/g),F=R.length-1;F>=0;F--)if(!!trim(R[F])){var D=R[F].split("="),G=unescape(D[0]),U=unescape(D[1]);B(U,G)}}function write$3(B,R){!B||(doc.cookie=escape(B)+"="+escape(R)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")}function remove$3(B){!B||!_has(B)||(doc.cookie=escape(B)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function clearAll$2(){each$3(function(B,R){remove$3(R)})}function _has(B){return new RegExp("(?:^|;\\s*)"+escape(B).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(doc.cookie)}var util$b=util$h,Global=util$b.Global,sessionStorage_1={name:"sessionStorage",read:read$2,write:write$2,each:each$2,remove:remove$2,clearAll:clearAll$1};function sessionStorage$1(){return Global.sessionStorage}function read$2(B){return sessionStorage$1().getItem(B)}function write$2(B,R){return sessionStorage$1().setItem(B,R)}function each$2(B){for(var R=sessionStorage$1().length-1;R>=0;R--){var F=sessionStorage$1().key(R);B(read$2(F),F)}}function remove$2(B){return sessionStorage$1().removeItem(B)}function clearAll$1(){return sessionStorage$1().clear()}var memoryStorage_1={name:"memoryStorage",read:read$1,write:write$1,each:each$1,remove:remove$1,clearAll},memoryStorage={};function read$1(B){return memoryStorage[B]}function write$1(B,R){memoryStorage[B]=R}function each$1(B){for(var R in memoryStorage)memoryStorage.hasOwnProperty(R)&&B(memoryStorage[R],R)}function remove$1(B){delete memoryStorage[B]}function clearAll(B){memoryStorage={}}var all=[localStorage_1,oldFFGlobalStorage,oldIEUserDataStorage,cookieStorage,sessionStorage_1,memoryStorage_1];typeof JSON!="object"&&(JSON={});(function(){var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(B){return B<10?"0"+B:B}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(B){return rx_escapable.lastIndex=0,rx_escapable.test(B)?'"'+B.replace(rx_escapable,function(R){var F=meta[R];return typeof F=="string"?F:"\\u"+("0000"+R.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+B+'"'}function str(B,R){var F,D,G,U,W=gap,q,Y=R[B];switch(Y&&typeof Y=="object"&&typeof Y.toJSON=="function"&&(Y=Y.toJSON(B)),typeof rep=="function"&&(Y=rep.call(R,B,Y)),typeof Y){case"string":return quote(Y);case"number":return isFinite(Y)?String(Y):"null";case"boolean":case"null":return String(Y);case"object":if(!Y)return"null";if(gap+=indent,q=[],Object.prototype.toString.apply(Y)==="[object Array]"){for(U=Y.length,F=0;F{store_legacy.set("setting",state$3)});const addZero=B=>B<10?"0"+B:B,formatTime=B=>{const R=B%60,F=B/60;return addZero(Math.floor(F))+":"+addZero(Math.floor(R))},browser=()=>{var B=navigator.userAgent;return{trident:B.indexOf("Trident")>-1,presto:B.indexOf("Presto")>-1,webKit:B.indexOf("AppleWebKit")>-1,gecko:B.indexOf("Gecko")>-1&&B.indexOf("KHTML")==-1,mobile:!!B.match(/AppleWebKit.*Mobile.*/),ios:!!B.match(/Mac OS X/),android:B.indexOf("ORCHESTRAAPPA")>-1||B.indexOf("Adr")>-1,iPhone:B.indexOf("ORCHESTRAAPPI")>-1,isApp:B.indexOf("ORCHESTRAAPPI")>-1||B.indexOf("ORCHESTRAAPPA")>-1,isTeacher:B.indexOf("ORCHESTRATEACHER")>-1,isStudent:B.indexOf("ORCHESTRASTUDENT")>-1,isSchool:B.indexOf("ORCHESTRASCHOOL")>-1,iPad:B.indexOf("iPad")>-1,webApp:B.indexOf("Safari")==-1,weixin:B.indexOf("MicroMessenger")>-1,huawei:!!B.match(/huawei/i)||!!B.match(/honor/i),xiaomi:!!B.match(/mi\s/i)||!!B.match(/redmi/i)||!!B.match(/mix/i)}},getRequestHostname=()=>{let B="";try{B=queryString.parse(location.search)}catch{}if(B!=null&&B.client)return B.client==="student"?"/api-student":B.client==="teacher"?"/api-teacher":"/api-backend";const R=browser();return R.isStudent?"/api-student":R.isTeacher?"/api-teacher":"/api-backend"},getRandomKey=()=>""+new Date().getTime()+Math.floor(Math.random()*1e6),toNext=(B,R)=>{const F=W=>W?"?"+W:"",D=queryString.stringify({...queryString.parse(location.search),_t:new Date().getTime()}),G=queryString.stringify(R);return location.origin+location.pathname+F(D)+B+F(G)},noop$4=()=>{},setTongjiTag=B=>{window._czc&&window._czc.push(B)},getPlatform=()=>{const B=browser();return B.ios?"IOS":B.android?"ANDROID":"WEB"},formatZoom=(B=1)=>{const F={small:.5,middle:.7,large:1}[state$3.sett.scoreSize];return B*F},getVoiceChinesName=B=>{let R=B||"";if(B){const F=state$4.chinesePartName[B];if(F)R=F;else{const D=Object.keys(state$4.chinesePartName);for(const G of D)if(B.match(G)){R=B.replace(G,state$4.chinesePartName[G]);break}}}return R?B+(B!==R?" ("+R+")":""):""};var animate$2="",app="",base$3="";/*! * vue-router v4.0.4 * (c) 2021 Eduardo San Martin Morote * @license MIT */const hasSymbol=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",PolySymbol=B=>hasSymbol?Symbol(B):"_vr_"+B,matchedRouteKey=PolySymbol("rvlm"),viewDepthKey=PolySymbol("rvd"),routerKey=PolySymbol("r"),routeLocationKey=PolySymbol("rl"),routerViewLocationKey=PolySymbol("rvl"),isBrowser=typeof window!="undefined";function isESModule(B){return B.__esModule||hasSymbol&&B[Symbol.toStringTag]==="Module"}const assign$1=Object.assign;function applyToParams(B,R){const F={};for(const D in R){const G=R[D];F[D]=Array.isArray(G)?G.map(B):B(G)}return F}let noop$3=()=>{};const TRAILING_SLASH_RE=/\/$/,removeTrailingSlash=B=>B.replace(TRAILING_SLASH_RE,"");function parseURL(B,R,F="/"){let D,G={},U="",W="";const q=R.indexOf("?"),Y=R.indexOf("#",q>-1?q:0);return q>-1&&(D=R.slice(0,q),U=R.slice(q+1,Y>-1?Y:R.length),G=B(U)),Y>-1&&(D=D||R.slice(0,Y),W=R.slice(Y,R.length)),D=resolveRelativePath(D!=null?D:R,F),{fullPath:D+(U&&"?")+U+W,path:D,query:G,hash:W}}function stringifyURL(B,R){let F=R.query?B(R.query):"";return R.path+(F&&"?")+F+(R.hash||"")}function stripBase(B,R){return!R||B.toLowerCase().indexOf(R.toLowerCase())?B:B.slice(R.length)||"/"}function isSameRouteLocation(B,R,F){let D=R.matched.length-1,G=F.matched.length-1;return D>-1&&D===G&&isSameRouteRecord(R.matched[D],F.matched[G])&&isSameRouteLocationParams(R.params,F.params)&&B(R.query)===B(F.query)&&R.hash===F.hash}function isSameRouteRecord(B,R){return(B.aliasOf||B)===(R.aliasOf||R)}function isSameRouteLocationParams(B,R){if(Object.keys(B).length!==Object.keys(R).length)return!1;for(let F in B)if(!isSameRouteLocationParamsValue(B[F],R[F]))return!1;return!0}function isSameRouteLocationParamsValue(B,R){return Array.isArray(B)?isEquivalentArray(B,R):Array.isArray(R)?isEquivalentArray(R,B):B===R}function isEquivalentArray(B,R){return Array.isArray(R)?B.length===R.length&&B.every((F,D)=>F===R[D]):B.length===1&&B[0]===R}function resolveRelativePath(B,R){if(B.startsWith("/"))return B;if(!B)return R;const F=R.split("/"),D=B.split("/");let G=F.length-1,U,W;for(U=0;U({left:window.pageXOffset,top:window.pageYOffset});function scrollToPosition(B){let R;if("el"in B){let F=B.el;const D=typeof F=="string"&&F.startsWith("#"),G=typeof F=="string"?D?document.getElementById(F.slice(1)):document.querySelector(F):F;if(!G)return;R=getElementPosition(G,B)}else R=B;"scrollBehavior"in document.documentElement.style?window.scrollTo(R):window.scrollTo(R.left!=null?R.left:window.pageXOffset,R.top!=null?R.top:window.pageYOffset)}function getScrollKey(B,R){return(history.state?history.state.position-R:-1)+B}const scrollPositions=new Map;function saveScrollPosition(B,R){scrollPositions.set(B,R)}function getSavedScrollPosition(B){const R=scrollPositions.get(B);return scrollPositions.delete(B),R}let createBaseLocation=()=>location.protocol+"//"+location.host;function createCurrentLocation(B,R){const{pathname:F,search:D,hash:G}=R;if(B.indexOf("#")>-1){let q=G.slice(1);return q[0]!=="/"&&(q="/"+q),stripBase(q,"")}return stripBase(F,B)+D+G}function useHistoryListeners(B,R,F,D){let G=[],U=[],W=null;const q=({state:te})=>{const Q=createCurrentLocation(B,location),ie=F.value,se=R.value;let ne=0;if(te){if(F.value=Q,R.value=te,W&&W===ie){W=null;return}ne=se?te.position-se.position:0}else D(Q);G.forEach(re=>{re(F.value,ie,{delta:ne,type:NavigationType.pop,direction:ne?ne>0?NavigationDirection.forward:NavigationDirection.back:NavigationDirection.unknown})})};function Y(){W=F.value}function J(te){G.push(te);const Q=()=>{const ie=G.indexOf(te);ie>-1&&G.splice(ie,1)};return U.push(Q),Q}function Z(){const{history:te}=window;!te.state||te.replaceState(assign$1({},te.state,{scroll:computeScrollPosition()}),"")}function K(){for(const te of U)te();U=[],window.removeEventListener("popstate",q),window.removeEventListener("beforeunload",Z)}return window.addEventListener("popstate",q),window.addEventListener("beforeunload",Z),{pauseListeners:Y,listen:J,destroy:K}}function buildState(B,R,F,D=!1,G=!1){return{back:B,current:R,forward:F,replaced:D,position:window.history.length,scroll:G?computeScrollPosition():null}}function useHistoryStateNavigation(B){const{history:R,location:F}=window;let D={value:createCurrentLocation(B,F)},G={value:R.state};G.value||U(D.value,{back:null,current:D.value,forward:null,position:R.length-1,replaced:!0,scroll:null},!0);function U(Y,J,Z){const K=B.indexOf("#"),te=K>-1?(F.host&&document.querySelector("base")?B:B.slice(K))+Y:createBaseLocation()+B+Y;try{R[Z?"replaceState":"pushState"](J,"",te),G.value=J}catch(Q){console.error(Q),F[Z?"replace":"assign"](te)}}function W(Y,J){const Z=assign$1({},R.state,buildState(G.value.back,Y,G.value.forward,!0),J,{position:G.value.position});U(Y,Z,!0),D.value=Y}function q(Y,J){const Z=assign$1({},G.value,R.state,{forward:Y,scroll:computeScrollPosition()});U(Z.current,Z,!0);const K=assign$1({},buildState(D.value,Y,null),{position:Z.position+1},J);U(Y,K,!1),D.value=Y}return{location:D,state:G,push:q,replace:W}}function createWebHistory(B){B=normalizeBase(B);const R=useHistoryStateNavigation(B),F=useHistoryListeners(B,R.state,R.location,R.replace);function D(U,W=!0){W||F.pauseListeners(),history.go(U)}const G=assign$1({location:"",base:B,go:D,createHref:createHref.bind(null,B)},R,F);return Object.defineProperty(G,"location",{get:()=>R.location.value}),Object.defineProperty(G,"state",{get:()=>R.state.value}),G}function createWebHashHistory(B){return B=location.host?B||location.pathname+location.search:"",B.indexOf("#")<0&&(B+="#"),createWebHistory(B)}function isRouteLocation(B){return typeof B=="string"||B&&typeof B=="object"}function isRouteName(B){return typeof B=="string"||typeof B=="symbol"}const START_LOCATION_NORMALIZED={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},NavigationFailureSymbol=PolySymbol("nf");var NavigationFailureType;(function(B){B[B.aborted=4]="aborted",B[B.cancelled=8]="cancelled",B[B.duplicated=16]="duplicated"})(NavigationFailureType||(NavigationFailureType={}));function createRouterError(B,R){return assign$1(new Error,{type:B,[NavigationFailureSymbol]:!0},R)}function isNavigationFailure(B,R){return B instanceof Error&&NavigationFailureSymbol in B&&(R==null||!!(B.type&R))}const BASE_PARAM_PATTERN="[^/]+?",BASE_PATH_PARSER_OPTIONS={sensitive:!1,strict:!1,start:!0,end:!0},REGEX_CHARS_RE=/[.+*?^${}()[\]/\\]/g;function tokensToParser(B,R){const F=assign$1({},BASE_PATH_PARSER_OPTIONS,R);let D=[],G=F.start?"^":"";const U=[];for(const J of B){const Z=J.length?[]:[90];F.strict&&!J.length&&(G+="/");for(let K=0;KR.length?R.length===1&&R[0]===40+40?1:-1:0}function comparePathParserScore(B,R){let F=0;const D=B.score,G=R.score;for(;F1&&(Y==="*"||Y==="+")&&R(`A repeatable param (${J}) must be alone in its segment. eg: '/:ids+.`),U.push({type:1,value:J,regexp:Z,repeatable:Y==="*"||Y==="+",optional:Y==="*"||Y==="?"})):R("Invalid state to consume buffer"),J="")}function te(){J+=Y}for(;q{W(ae)}:noop$3}function W(Z){if(isRouteName(Z)){const K=D.get(Z);K&&(D.delete(Z),F.splice(F.indexOf(K),1),K.children.forEach(W),K.alias.forEach(W))}else{let K=F.indexOf(Z);K>-1&&(F.splice(K,1),Z.record.name&&D.delete(Z.record.name),Z.children.forEach(W),Z.alias.forEach(W))}}function q(){return F}function Y(Z){let K=0;for(;K=0;)K++;F.splice(K,0,Z),Z.record.name&&!isAliasRecord(Z)&&D.set(Z.record.name,Z)}function J(Z,K){let te,Q={},ie,se;if("name"in Z&&Z.name){if(te=D.get(Z.name),!te)throw createRouterError(1,{location:Z});se=te.record.name,Q=assign$1(paramsFromLocation(K.params,te.keys.filter(ae=>!ae.optional).map(ae=>ae.name)),Z.params),ie=te.stringify(Q)}else if("path"in Z)ie=Z.path,te=F.find(ae=>ae.re.test(ie)),te&&(Q=te.parse(ie),se=te.record.name);else{if(te=K.name?D.get(K.name):F.find(ae=>ae.re.test(K.path)),!te)throw createRouterError(1,{location:Z,currentLocation:K});se=te.record.name,Q=assign$1({},K.params,Z.params),ie=te.stringify(Q)}const ne=[];let re=te;for(;re;)ne.unshift(re.record),re=re.parent;return{name:se,path:ie,params:Q,matched:ne,meta:mergeMetaFields(ne)}}return B.forEach(Z=>U(Z)),{addRoute:U,resolve:J,removeRoute:W,getRoutes:q,getRecordMatcher:G}}function paramsFromLocation(B,R){let F={};for(let D of R)D in B&&(F[D]=B[D]);return F}function normalizeRouteRecord(B){return{path:B.path,redirect:B.redirect,name:B.name,meta:B.meta||{},aliasOf:void 0,beforeEnter:B.beforeEnter,props:normalizeRecordProps(B),children:B.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in B?B.components||{}:{default:B.component}}}function normalizeRecordProps(B){const R={},F=B.props||!1;if("component"in B)R.default=F;else for(let D in B.components)R[D]=typeof F=="boolean"?F:F[D];return R}function isAliasRecord(B){for(;B;){if(B.record.aliasOf)return!0;B=B.parent}return!1}function mergeMetaFields(B){return B.reduce((R,F)=>assign$1(R,F.meta),{})}function mergeOptions(B,R){let F={};for(let D in B)F[D]=D in R?R[D]:B[D];return F}const HASH_RE=/#/g,AMPERSAND_RE=/&/g,SLASH_RE=/\//g,EQUAL_RE=/=/g,IM_RE=/\?/g,PLUS_RE=/\+/g,ENC_BRACKET_OPEN_RE=/%5B/g,ENC_BRACKET_CLOSE_RE=/%5D/g,ENC_CARET_RE=/%5E/g,ENC_BACKTICK_RE=/%60/g,ENC_CURLY_OPEN_RE=/%7B/g,ENC_PIPE_RE=/%7C/g,ENC_CURLY_CLOSE_RE=/%7D/g,ENC_SPACE_RE=/%20/g;function commonEncode(B){return encodeURI(""+B).replace(ENC_PIPE_RE,"|").replace(ENC_BRACKET_OPEN_RE,"[").replace(ENC_BRACKET_CLOSE_RE,"]")}function encodeHash(B){return commonEncode(B).replace(ENC_CURLY_OPEN_RE,"{").replace(ENC_CURLY_CLOSE_RE,"}").replace(ENC_CARET_RE,"^")}function encodeQueryValue(B){return commonEncode(B).replace(PLUS_RE,"%2B").replace(ENC_SPACE_RE,"+").replace(HASH_RE,"%23").replace(AMPERSAND_RE,"%26").replace(ENC_BACKTICK_RE,"`").replace(ENC_CURLY_OPEN_RE,"{").replace(ENC_CURLY_CLOSE_RE,"}").replace(ENC_CARET_RE,"^")}function encodeQueryKey(B){return encodeQueryValue(B).replace(EQUAL_RE,"%3D")}function encodePath(B){return commonEncode(B).replace(HASH_RE,"%23").replace(IM_RE,"%3F")}function encodeParam(B){return encodePath(B).replace(SLASH_RE,"%2F")}function decode$3(B){try{return decodeURIComponent(""+B)}catch{}return""+B}function parseQuery(B){const R={};if(B===""||B==="?")return R;const D=(B[0]==="?"?B.slice(1):B).split("&");for(let G=0;GU&&encodeQueryValue(U)):[D&&encodeQueryValue(D)];for(let U=0;UG==null?null:""+G):D==null?D:""+D)}return R}function useCallbacks(){let B=[];function R(D){return B.push(D),()=>{const G=B.indexOf(D);G>-1&&B.splice(G,1)}}function F(){B=[]}return{add:R,list:()=>B,reset:F}}function guardToPromiseFn(B,R,F,D,G){const U=D&&(D.enterCallbacks[G]=D.enterCallbacks[G]||[]);return()=>new Promise((W,q)=>{const Y=K=>{K===!1?q(createRouterError(4,{from:F,to:R})):K instanceof Error?q(K):isRouteLocation(K)?q(createRouterError(2,{from:R,to:K})):(U&&D.enterCallbacks[G]===U&&typeof K=="function"&&U.push(K),W())},J=B.call(D&&D.instances[G],R,F,Y);let Z=Promise.resolve(J);B.length<3&&(Z=Z.then(Y)),Z.catch(K=>q(K))})}function extractComponentsGuards(B,R,F,D){const G=[];for(const U of B)for(const W in U.components){let q=U.components[W];if(!(R!=="beforeRouteEnter"&&!U.instances[W]))if(isRouteComponent(q)){const J=(q.__vccOpts||q)[R];J&&G.push(guardToPromiseFn(J,F,D,U,W))}else{let Y=q();Y=Y.catch(console.error),G.push(()=>Y.then(J=>{if(!J)return Promise.reject(new Error(`Couldn't resolve component "${W}" at "${U.path}"`));const Z=isESModule(J)?J.default:J;U.components[W]=Z;const te=(Z.__vccOpts||Z)[R];return te&&guardToPromiseFn(te,F,D,U,W)()}))}}return G}function isRouteComponent(B){return typeof B=="object"||"displayName"in B||"props"in B||"__vccOpts"in B}function useLink(B){const R=inject(routerKey),F=inject(routeLocationKey),D=computed(()=>R.resolve(unref(B.to))),G=computed(()=>{let{matched:Y}=D.value,{length:J}=Y;const Z=Y[J-1];let K=F.matched;if(!Z||!K.length)return-1;let te=K.findIndex(isSameRouteRecord.bind(null,Z));if(te>-1)return te;let Q=getOriginalPath(Y[J-2]);return J>1&&getOriginalPath(Z)===Q&&K[K.length-1].path!==Q?K.findIndex(isSameRouteRecord.bind(null,Y[J-2])):te}),U=computed(()=>G.value>-1&&includesParams(F.params,D.value.params)),W=computed(()=>G.value>-1&&G.value===F.matched.length-1&&isSameRouteLocationParams(F.params,D.value.params));function q(Y={}){return guardEvent(Y)?R[unref(B.replace)?"replace":"push"](unref(B.to)):Promise.resolve()}return{route:D,href:computed(()=>D.value.href),isActive:U,isExactActive:W,navigate:q}}const RouterLinkImpl=defineComponent({name:"RouterLink",props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},setup(B,{slots:R,attrs:F}){const D=reactive(useLink(B)),{options:G}=inject(routerKey),U=computed(()=>({[getLinkClass(B.activeClass,G.linkActiveClass,"router-link-active")]:D.isActive,[getLinkClass(B.exactActiveClass,G.linkExactActiveClass,"router-link-exact-active")]:D.isExactActive}));return()=>{const W=R.default&&R.default(D);return B.custom?W:h$3("a",assign$1({"aria-current":D.isExactActive?B.ariaCurrentValue:null,onClick:D.navigate,href:D.href},F,{class:U.value}),W)}}}),RouterLink=RouterLinkImpl;function guardEvent(B){if(!(B.metaKey||B.altKey||B.ctrlKey||B.shiftKey)&&!B.defaultPrevented&&!(B.button!==void 0&&B.button!==0)){if(B.currentTarget&&B.currentTarget.getAttribute){const R=B.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(R))return}return B.preventDefault&&B.preventDefault(),!0}}function includesParams(B,R){for(let F in R){let D=R[F],G=B[F];if(typeof D=="string"){if(D!==G)return!1}else if(!Array.isArray(G)||G.length!==D.length||D.some((U,W)=>U!==G[W]))return!1}return!0}function getOriginalPath(B){return B?B.aliasOf?B.aliasOf.path:B.path:""}const getLinkClass=(B,R,F)=>B!=null?B:R!=null?R:F,RouterViewImpl=defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},setup(B,{attrs:R,slots:F}){const D=inject(routerViewLocationKey),G=computed(()=>B.route||D.value),U=inject(viewDepthKey,0),W=computed(()=>G.value.matched[U]);provide(viewDepthKey,U+1),provide(matchedRouteKey,W),provide(routerViewLocationKey,G);const q=ref();return watch(()=>[q.value,W.value,B.name],([Y,J,Z],[K,te,Q])=>{J&&(J.instances[Z]=Y,te&&te!==J&&Y&&Y===K&&(J.leaveGuards=te.leaveGuards,J.updateGuards=te.updateGuards)),Y&&J&&(!te||!isSameRouteRecord(J,te)||!K)&&(J.enterCallbacks[Z]||[]).forEach(ie=>ie(Y))},{flush:"post"}),()=>{const Y=G.value,J=W.value,Z=J&&J.components[B.name],K=B.name;if(!Z)return normalizeSlot(F.default,{Component:Z,route:Y});const te=J.props[B.name],Q=te?te===!0?Y.params:typeof te=="function"?te(Y):te:null,se=h$3(Z,assign$1({},Q,R,{onVnodeUnmounted:ne=>{ne.component.isUnmounted&&(J.instances[K]=null)},ref:q}));return normalizeSlot(F.default,{Component:se,route:Y})||se}}});function normalizeSlot(B,R){if(!B)return null;const F=B(R);return F.length===1?F[0]:F}const RouterView=RouterViewImpl;function createRouter(B){const R=createRouterMatcher(B.routes,B);let F=B.parseQuery||parseQuery,D=B.stringifyQuery||stringifyQuery,G=B.history;const U=useCallbacks(),W=useCallbacks(),q=useCallbacks(),Y=shallowRef(START_LOCATION_NORMALIZED);let J=START_LOCATION_NORMALIZED;isBrowser&&B.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const Z=applyToParams.bind(null,Ce=>""+Ce),K=applyToParams.bind(null,encodeParam),te=applyToParams.bind(null,decode$3);function Q(Ce,Ge){let We,Ve;return isRouteName(Ce)?(We=R.getRecordMatcher(Ce),Ve=Ge):Ve=Ce,R.addRoute(Ve,We)}function ie(Ce){let Ge=R.getRecordMatcher(Ce);Ge&&R.removeRoute(Ge)}function se(){return R.getRoutes().map(Ce=>Ce.record)}function ne(Ce){return!!R.getRecordMatcher(Ce)}function re(Ce,Ge){if(Ge=assign$1({},Ge||Y.value),typeof Ce=="string"){let ct=parseURL(F,Ce,Ge.path),De=R.resolve({path:ct.path},Ge),xe=G.createHref(ct.fullPath);return assign$1(ct,De,{params:te(De.params),hash:decode$3(ct.hash),redirectedFrom:void 0,href:xe})}let We;"path"in Ce?We=assign$1({},Ce,{path:parseURL(F,Ce.path,Ge.path).path}):(We=assign$1({},Ce,{params:K(Ce.params)}),Ge.params=K(Ge.params));let Ve=R.resolve(We,Ge);const Ze=Ce.hash||"";Ve.params=Z(te(Ve.params));const nt=stringifyURL(D,assign$1({},Ce,{hash:encodeHash(Ze),path:Ve.path}));let at=G.createHref(nt);return assign$1({fullPath:nt,hash:Ze,query:D===stringifyQuery?normalizeQuery(Ce.query):Ce.query},Ve,{redirectedFrom:void 0,href:at})}function ae(Ce){return typeof Ce=="string"?parseURL(F,Ce,Y.value.path):assign$1({},Ce)}function ce(Ce,Ge){if(J!==Ce)return createRouterError(8,{from:Ge,to:Ce})}function he(Ce){return ue(Ce)}function fe(Ce){return he(assign$1(ae(Ce),{replace:!0}))}function be(Ce){const Ge=Ce.matched[Ce.matched.length-1];if(Ge&&Ge.redirect){const{redirect:We}=Ge;let Ve=typeof We=="function"?We(Ce):We;return typeof Ve=="string"&&(Ve=Ve.indexOf("?")>-1||Ve.indexOf("#")>-1?Ve=ae(Ve):{path:Ve}),assign$1({query:Ce.query,hash:Ce.hash,params:Ce.params},Ve)}}function ue(Ce,Ge){const We=J=re(Ce),Ve=Y.value,Ze=Ce.state,nt=Ce.force,at=Ce.replace===!0,ct=be(We);if(ct)return ue(assign$1(ae(ct),{state:Ze,force:nt,replace:at}),Ge||We);const De=We;De.redirectedFrom=Ge;let xe;return!nt&&isSameRouteLocation(D,Ve,We)&&(xe=createRouterError(16,{to:De,from:Ve}),ke(Ve,Ve,!0,!1)),(xe?Promise.resolve(xe):ve(De,Ve)).catch(ze=>isNavigationFailure(ze)?ze:Me(ze)).then(ze=>{if(ze){if(isNavigationFailure(ze,2))return ue(assign$1(ae(ze.to),{state:Ze,force:nt,replace:at}),Ge||De)}else ze=pe(De,Ve,!0,at,Ze);return Se(De,Ve,ze),ze})}function ge(Ce,Ge){const We=ce(Ce,Ge);return We?Promise.reject(We):Promise.resolve()}function ve(Ce,Ge){let We;const[Ve,Ze,nt]=extractChangingRecords(Ce,Ge);We=extractComponentsGuards(Ve.reverse(),"beforeRouteLeave",Ce,Ge);for(const ct of Ve)ct.leaveGuards.forEach(De=>{We.push(guardToPromiseFn(De,Ce,Ge))});const at=ge.bind(null,Ce,Ge);return We.push(at),runGuardQueue(We).then(()=>{We=[];for(const ct of U.list())We.push(guardToPromiseFn(ct,Ce,Ge));return We.push(at),runGuardQueue(We)}).then(()=>{We=extractComponentsGuards(Ze,"beforeRouteUpdate",Ce,Ge);for(const ct of Ze)ct.updateGuards.forEach(De=>{We.push(guardToPromiseFn(De,Ce,Ge))});return We.push(at),runGuardQueue(We)}).then(()=>{We=[];for(const ct of Ce.matched)if(ct.beforeEnter&&Ge.matched.indexOf(ct)<0)if(Array.isArray(ct.beforeEnter))for(const De of ct.beforeEnter)We.push(guardToPromiseFn(De,Ce,Ge));else We.push(guardToPromiseFn(ct.beforeEnter,Ce,Ge));return We.push(at),runGuardQueue(We)}).then(()=>(Ce.matched.forEach(ct=>ct.enterCallbacks={}),We=extractComponentsGuards(nt,"beforeRouteEnter",Ce,Ge),We.push(at),runGuardQueue(We))).then(()=>{We=[];for(const ct of W.list())We.push(guardToPromiseFn(ct,Ce,Ge));return We.push(at),runGuardQueue(We)}).catch(ct=>isNavigationFailure(ct,8)?ct:Promise.reject(ct))}function Se(Ce,Ge,We){for(const Ve of q.list())Ve(Ce,Ge,We)}function pe(Ce,Ge,We,Ve,Ze){const nt=ce(Ce,Ge);if(nt)return nt;const at=Ge===START_LOCATION_NORMALIZED,ct=isBrowser?history.state:{};We&&(Ve||at?G.replace(Ce.fullPath,assign$1({scroll:at&&ct&&ct.scroll},Ze)):G.push(Ce.fullPath,Ze)),Y.value=Ce,ke(Ce,Ge,We,at),Ne()}let ye;function Ee(){ye=G.listen((Ce,Ge,We)=>{let Ve=re(Ce);const Ze=be(Ve);if(Ze){ue(assign$1(Ze,{replace:!0}),Ve).catch(noop$3);return}J=Ve;const nt=Y.value;isBrowser&&saveScrollPosition(getScrollKey(nt.fullPath,We.delta),computeScrollPosition()),ve(Ve,nt).catch(at=>isNavigationFailure(at,12)?at:isNavigationFailure(at,2)?(ue(at.to,Ve).catch(noop$3),Promise.reject()):(We.delta&&G.go(-We.delta,!1),Me(at))).then(at=>{at=at||pe(Ve,nt,!1),at&&We.delta&&G.go(-We.delta,!1),Se(Ve,nt,at)}).catch(noop$3)})}let de=useCallbacks(),we=useCallbacks(),Oe;function Me(Ce){return Ne(Ce),we.list().forEach(Ge=>Ge(Ce)),Promise.reject(Ce)}function Pe(){return Oe&&Y.value!==START_LOCATION_NORMALIZED?Promise.resolve():new Promise((Ce,Ge)=>{de.add([Ce,Ge])})}function Ne(Ce){Oe||(Oe=!0,Ee(),de.list().forEach(([Ge,We])=>Ce?We(Ce):Ge()),de.reset())}function ke(Ce,Ge,We,Ve){const{scrollBehavior:Ze}=B;if(!isBrowser||!Ze)return Promise.resolve();let nt=!We&&getSavedScrollPosition(getScrollKey(Ce.fullPath,0))||(Ve||!We)&&history.state&&history.state.scroll||null;return nextTick().then(()=>Ze(Ce,Ge,nt)).then(at=>at&&scrollToPosition(at)).catch(Me)}const Ae=Ce=>G.go(Ce);let _e;const Fe=new Set;return{currentRoute:Y,addRoute:Q,removeRoute:ie,hasRoute:ne,getRoutes:se,resolve:re,options:B,push:he,replace:fe,go:Ae,back:()=>Ae(-1),forward:()=>Ae(1),beforeEach:U.add,beforeResolve:W.add,afterEach:q.add,onError:we.add,isReady:Pe,install(Ce){const Ge=this;Ce.component("RouterLink",RouterLink),Ce.component("RouterView",RouterView),Ce.config.globalProperties.$router=Ge,Object.defineProperty(Ce.config.globalProperties,"$route",{get:()=>unref(Y)}),isBrowser&&!_e&&Y.value===START_LOCATION_NORMALIZED&&(_e=!0,he(G.location).catch(Ze=>{}));const We={};for(let Ze in START_LOCATION_NORMALIZED)We[Ze]=computed(()=>Y.value[Ze]);Ce.provide(routerKey,Ge),Ce.provide(routeLocationKey,reactive(We)),Ce.provide(routerViewLocationKey,Y);let Ve=Ce.unmount;Fe.add(Ce),Ce.unmount=function(){Fe.delete(Ce),Fe.size<1&&(ye(),Y.value=START_LOCATION_NORMALIZED,_e=!1,Oe=!1),Ve.call(this,arguments)}}}}function runGuardQueue(B){return B.reduce((R,F)=>R.then(()=>F()),Promise.resolve())}function extractChangingRecords(B,R){const F=[],D=[],G=[],U=Math.max(R.matched.length,B.matched.length);for(let W=0;W{var U;D=(U=D[G])!=null?U:""}),D}function pick(B,R,F){return R.reduce((D,G)=>((!F||B[G]!==void 0)&&(D[G]=B[G]),D),{})}function gen(B,R){return R?typeof R=="string"?" "+B+"--"+R:Array.isArray(R)?R.reduce((F,D)=>F+gen(B,D),""):Object.keys(R).reduce((F,D)=>F+(R[D]?gen(B,D):""),""):""}function createBEM(B){return function(R,F){return R&&typeof R!="string"&&(F=R,R=""),R=R?B+"__"+R:B,""+R+gen(R,F)}}var camelizeRE=/-(\w)/g;function camelize(B){return B.replace(camelizeRE,(R,F)=>F.toUpperCase())}function isDef$1(B){return B!=null}function isFunction$1(B){return typeof B=="function"}function isObject$1(B){return B!==null&&typeof B=="object"}function isPromise(B){return isObject$1(B)&&isFunction$1(B.then)&&isFunction$1(B.catch)}function isNumeric(B){return typeof B=="number"||/^\d+(\.\d+)?$/.test(B)}function isIOS$1(){return inBrowser$1?/ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()):!1}var{hasOwnProperty:hasOwnProperty$1}=Object.prototype;function assignKey(B,R,F){var D=R[F];!isDef$1(D)||(!hasOwnProperty$1.call(B,F)||!isObject$1(D)?B[F]=D:B[F]=deepAssign(Object(B[F]),R[F]))}function deepAssign(B,R){return Object.keys(R).forEach(F=>{assignKey(B,R,F)}),B}var defaultMessages={name:"\u59D3\u540D",tel:"\u7535\u8BDD",save:"\u4FDD\u5B58",confirm:"\u786E\u8BA4",cancel:"\u53D6\u6D88",delete:"\u5220\u9664",complete:"\u5B8C\u6210",loading:"\u52A0\u8F7D\u4E2D...",telEmpty:"\u8BF7\u586B\u5199\u7535\u8BDD",nameEmpty:"\u8BF7\u586B\u5199\u59D3\u540D",nameInvalid:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u59D3\u540D",confirmDelete:"\u786E\u5B9A\u8981\u5220\u9664\u5417",telInvalid:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7",vanCalendar:{end:"\u7ED3\u675F",start:"\u5F00\u59CB",title:"\u65E5\u671F\u9009\u62E9",confirm:"\u786E\u5B9A",startEnd:"\u5F00\u59CB/\u7ED3\u675F",weekdays:["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"],monthTitle:(B,R)=>B+"\u5E74"+R+"\u6708",rangePrompt:B=>"\u9009\u62E9\u5929\u6570\u4E0D\u80FD\u8D85\u8FC7 "+B+" \u5929"},vanCascader:{select:"\u8BF7\u9009\u62E9"},vanContactCard:{addText:"\u6DFB\u52A0\u8054\u7CFB\u4EBA"},vanContactList:{addText:"\u65B0\u5EFA\u8054\u7CFB\u4EBA"},vanPagination:{prev:"\u4E0A\u4E00\u9875",next:"\u4E0B\u4E00\u9875"},vanPullRefresh:{pulling:"\u4E0B\u62C9\u5373\u53EF\u5237\u65B0...",loosing:"\u91CA\u653E\u5373\u53EF\u5237\u65B0..."},vanSubmitBar:{label:"\u5408\u8BA1\uFF1A"},vanCoupon:{unlimited:"\u65E0\u4F7F\u7528\u95E8\u69DB",discount:B=>B+"\u6298",condition:B=>"\u6EE1"+B+"\u5143\u53EF\u7528"},vanCouponCell:{title:"\u4F18\u60E0\u5238",tips:"\u6682\u65E0\u53EF\u7528",count:B=>B+"\u5F20\u53EF\u7528"},vanCouponList:{empty:"\u6682\u65E0\u4F18\u60E0\u5238",exchange:"\u5151\u6362",close:"\u4E0D\u4F7F\u7528\u4F18\u60E0\u5238",enable:"\u53EF\u7528",disabled:"\u4E0D\u53EF\u7528",placeholder:"\u8BF7\u8F93\u5165\u4F18\u60E0\u7801"},vanAddressEdit:{area:"\u5730\u533A",postal:"\u90AE\u653F\u7F16\u7801",areaEmpty:"\u8BF7\u9009\u62E9\u5730\u533A",addressEmpty:"\u8BF7\u586B\u5199\u8BE6\u7EC6\u5730\u5740",postalEmpty:"\u90AE\u653F\u7F16\u7801\u683C\u5F0F\u4E0D\u6B63\u786E",defaultAddress:"\u8BBE\u4E3A\u9ED8\u8BA4\u6536\u8D27\u5730\u5740",telPlaceholder:"\u6536\u8D27\u4EBA\u624B\u673A\u53F7",namePlaceholder:"\u6536\u8D27\u4EBA\u59D3\u540D",areaPlaceholder:"\u9009\u62E9\u7701 / \u5E02 / \u533A"},vanAddressEditDetail:{label:"\u8BE6\u7EC6\u5730\u5740",placeholder:"\u8857\u9053\u95E8\u724C\u3001\u697C\u5C42\u623F\u95F4\u53F7\u7B49\u4FE1\u606F"},vanAddressList:{add:"\u65B0\u589E\u5730\u5740"}},lang=ref("zh-CN"),messages=reactive({"zh-CN":defaultMessages}),Locale={messages(){return messages[lang.value]},use(B,R){lang.value=B,this.add({[B]:R})},add(B={}){deepAssign(messages,B)}},locale=Locale;function createTranslate(B){var R=camelize(B)+".";return function(F,...D){var G=locale.messages(),U=get(G,R+F)||get(G,F);return isFunction$1(U)?U(...D):U}}function createNamespace(B){var R="van-"+B;return[R,createBEM(R),createTranslate(R)]}function withInstall(B){return B.install=R=>{var{name:F}=B;R.component(F,B),R.component(camelize("-"+F),B)},B}function addUnit(B){if(!!isDef$1(B))return isNumeric(B)?B+"px":String(B)}function getSizeStyle(B){if(isDef$1(B)){var R=addUnit(B);return{width:R,height:R}}}function getZIndexStyle(B){var R={};return B!==void 0&&(R.zIndex=+B),R}var rootFontSize;function getRootFontSize(){if(!rootFontSize){var B=document.documentElement,R=B.style.fontSize||window.getComputedStyle(B).fontSize;rootFontSize=parseFloat(R)}return rootFontSize}function convertRem(B){return B=B.replace(/rem/g,""),+B*getRootFontSize()}function convertVw(B){return B=B.replace(/vw/g,""),+B*window.innerWidth/100}function convertVh(B){return B=B.replace(/vh/g,""),+B*window.innerHeight/100}function unitToPx(B){if(typeof B=="number")return B;if(inBrowser$1){if(B.includes("rem"))return convertRem(B);if(B.includes("vw"))return convertVw(B);if(B.includes("vh"))return convertVh(B)}return parseFloat(B)}function clamp(B,R,F){return Math.min(Math.max(B,R),F)}function trimExtraChar(B,R,F){var D=B.indexOf(R);return D===-1?B:R==="-"&&D!==0?B.slice(0,D):B.slice(0,D+1)+B.slice(D).replace(F,"")}function formatNumber(B,R=!0,F=!0){R?B=trimExtraChar(B,".",/\./g):B=B.split(".")[0],F?B=trimExtraChar(B,"-",/-/g):B=B.replace(/-/,"");var D=R?/[^-0-9.]/g:/[^-0-9]/g;return B.replace(D,"")}function addNumber(B,R){var F=Math.pow(10,10);return Math.round((B+R)*F)/F}function isHidden(B){var R=unref(B);if(!R)return!1;var F=window.getComputedStyle(R),D=F.display==="none",G=R.offsetParent===null&&F.position!=="fixed";return D||G}function stopPropagation(B){B.stopPropagation()}function preventDefault(B,R){(typeof B.cancelable!="boolean"||B.cancelable)&&B.preventDefault(),R&&stopPropagation(B)}function trigger(B,R){var F=document.createEvent("HTMLEvents");F.initEvent(R,!0,!0),B.dispatchEvent(F)}function isWindow$1(B){return B===window}function getScrollTop(B){var R="scrollTop"in B?B.scrollTop:B.pageYOffset;return Math.max(R,0)}function setScrollTop(B,R){"scrollTop"in B?B.scrollTop=R:B.scrollTo(B.scrollX,R)}function getRootScrollTop(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0}function setRootScrollTop(B){setScrollTop(window,B),setScrollTop(document.body,B)}function getElementTop(B,R){if(isWindow$1(B))return 0;var F=R?getScrollTop(R):getRootScrollTop();return B.getBoundingClientRect().top+F}function getVisibleHeight(B){return isWindow$1(B)?B.innerHeight:B.getBoundingClientRect().height}function getVisibleTop(B){return isWindow$1(B)?0:B.getBoundingClientRect().top}var isIOS=isIOS$1();function resetScroll(){isIOS&&setRootScrollTop(getRootScrollTop())}const inBrowser=typeof window!="undefined";function raf$2(B){return inBrowser?requestAnimationFrame(B):-1}function cancelRaf(B){inBrowser&&cancelAnimationFrame(B)}function doubleRaf(B){raf$2(()=>raf$2(B))}const isWindow=B=>B===window,makeDOMRect=(B,R)=>({top:0,left:0,right:B,bottom:R,width:B,height:R}),useRect=B=>{const R=unref(B);if(isWindow(R)){const F=R.innerWidth,D=R.innerHeight;return makeDOMRect(F,D)}return R!=null&&R.getBoundingClientRect?R.getBoundingClientRect():makeDOMRect(0,0)};function useToggle(B=!1){const R=ref(B);return[R,(D=!R.value)=>{R.value=D}]}function useParent(B){const R=inject(B,null);if(R){const F=getCurrentInstance(),{link:D,unlink:G,internalChildren:U}=R;D(F),onUnmounted(()=>G(F));const W=computed(()=>U.indexOf(F));return{parent:R,index:W}}return{parent:null,index:ref(-1)}}function flattenVNodes(B){const R=[],F=D=>{Array.isArray(D)&&D.forEach(G=>{var U;isVNode(G)&&(R.push(G),(U=G.component)!=null&&U.subTree&&F(G.component.subTree.children),G.children&&F(G.children))})};return F(B),R}function sortChildren(B,R,F){const D=flattenVNodes(B.subTree.children);F.sort((U,W)=>D.indexOf(U.vnode)-D.indexOf(W.vnode));const G=F.map(U=>U.proxy);R.sort((U,W)=>{const q=G.indexOf(U),Y=G.indexOf(W);return q-Y})}function useChildren(B){const R=reactive([]),F=reactive([]),D=getCurrentInstance();return{children:R,linkChildren:U=>{provide(B,Object.assign({link:Y=>{Y.proxy&&(F.push(Y),R.push(Y.proxy),sortChildren(D,R,F))},unlink:Y=>{const J=F.indexOf(Y);R.splice(J,1),F.splice(J,1)},children:R,internalChildren:F},U))}}}function onMountedOrActivated(B){let R;onMounted(()=>{B(),nextTick(()=>{R=!0})}),onActivated(()=>{R&&B()})}function useEventListener(B,R,F={}){if(!inBrowser)return;const{target:D=window,passive:G=!1,capture:U=!1}=F;let W;const q=J=>{const Z=unref(J);Z&&!W&&(Z.addEventListener(B,R,{capture:U,passive:G}),W=!0)},Y=J=>{const Z=unref(J);Z&&W&&(Z.removeEventListener(B,R,U),W=!1)};onUnmounted(()=>Y(D)),onDeactivated(()=>Y(D)),onMountedOrActivated(()=>q(D)),isRef(D)&&watch(D,(J,Z)=>{Y(Z),q(J)})}function useClickAway(B,R,F={}){if(!inBrowser)return;const{eventName:D="click"}=F;useEventListener(D,U=>{const W=unref(B);W&&!W.contains(U.target)&&R(U)},{target:document})}let width,height;function useWindowSize(){if(!width&&(width=ref(0),height=ref(0),inBrowser)){const B=()=>{width.value=window.innerWidth,height.value=window.innerHeight};B(),window.addEventListener("resize",B,{passive:!0}),window.addEventListener("orientationchange",B,{passive:!0})}return{width,height}}const overflowScrollReg=/scroll|auto/i,defaultRoot=inBrowser?window:void 0;function isElement$1(B){return B.tagName!=="HTML"&&B.tagName!=="BODY"&&B.nodeType===1}function getScrollParent$1(B,R=defaultRoot){let F=B;for(;F&&F!==R&&isElement$1(F);){const{overflowY:D}=window.getComputedStyle(F);if(overflowScrollReg.test(D))return F;F=F.parentNode}return R}function useScrollParent(B,R=defaultRoot){const F=ref();return onMounted(()=>{B.value&&(F.value=getScrollParent$1(B.value,R))}),F}let visibility;function usePageVisibility(){if(!visibility&&(visibility=ref("visible"),inBrowser)){const B=()=>{visibility.value=document.hidden?"hidden":"visible"};B(),window.addEventListener("visibilitychange",B)}return visibility}var[name$u,bem$u]=createNamespace("action-bar"),ACTION_BAR_KEY=Symbol(name$u),_ActionBar=defineComponent({name:name$u,props:{safeAreaInsetBottom:truthProp},setup(B,{slots:R}){var{linkChildren:F}=useChildren(ACTION_BAR_KEY);return F(),()=>createVNode("div",{class:bem$u({unfit:!B.safeAreaInsetBottom})},[R.default==null?void 0:R.default()])}}),ActionBar=withInstall(_ActionBar);function useExpose(B){var R=getCurrentInstance();R&&extend$2(R.proxy,B)}var routeProps={to:[String,Object],url:String,replace:Boolean};function route(B){var R=B.$router,{to:F,url:D,replace:G}=B;F&&R?R[G?"replace":"push"](F):D&&(G?location.replace(D):location.href=D)}function useRoute(){var B=getCurrentInstance().proxy;return()=>route(B)}var BORDER="van-hairline",BORDER_TOP=BORDER+"--top",BORDER_LEFT=BORDER+"--left",BORDER_BOTTOM=BORDER+"--bottom",BORDER_SURROUND=BORDER+"--surround",BORDER_TOP_BOTTOM=BORDER+"--top-bottom",BORDER_UNSET_TOP_BOTTOM=BORDER+"-unset--top-bottom",[name$t,bem$t]=createNamespace("badge"),_Badge=defineComponent({name:name$t,props:{dot:Boolean,max:[Number,String],color:String,offset:Array,content:[Number,String],showZero:truthProp,tag:{type:String,default:"div"}},setup(B,{slots:R}){var F=()=>{if(R.content)return!0;var{content:U,showZero:W}=B;return isDef$1(U)&&U!==""&&(W||U!==0)},D=()=>{var{dot:U,max:W,content:q}=B;if(!U&&F())return R.content?R.content():isDef$1(W)&&isNumeric(q)&&+q>W?W+"+":q},G=()=>{if(F()||B.dot){var U={background:B.color};if(B.offset){var[W,q]=B.offset;R.default?(U.top=addUnit(q),U.right="-"+addUnit(W)):(U.marginTop=addUnit(q),U.marginLeft=addUnit(W))}return createVNode("div",{class:bem$t({dot:B.dot,fixed:!!R.default}),style:U},[D()])}};return()=>{if(R.default){var{tag:U}=B;return createVNode(U,{class:bem$t("wrapper")},{default:()=>[R.default(),G()]})}return G()}}}),Badge=withInstall(_Badge),[name$s,bem$s]=createNamespace("icon");function isImage(B){return B?B.includes("/"):!1}var _Icon=defineComponent({name:name$s,props:{dot:Boolean,name:String,size:[Number,String],badge:[Number,String],color:String,tag:{type:String,default:"i"},classPrefix:{type:String,default:bem$s()}},setup(B,{slots:R}){return()=>{var{tag:F,dot:D,name:G,size:U,badge:W,color:q,classPrefix:Y}=B,J=isImage(G);return createVNode(Badge,{dot:D,tag:F,content:W,class:[Y,J?"":Y+"-"+G],style:{color:q,fontSize:addUnit(U)}},{default:()=>[R.default==null?void 0:R.default(),J&&createVNode("img",{class:bem$s("image"),src:G},null)]})}}}),Icon=withInstall(_Icon),[name$r,bem$r]=createNamespace("loading"),SpinIcon=Array(12).fill(createVNode("i",null,null)),CircularIcon=createVNode("svg",{class:bem$r("circular"),viewBox:"25 25 50 50"},[createVNode("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),_Loading=defineComponent({name:name$r,props:{size:[Number,String],color:String,vertical:Boolean,textSize:[Number,String],textColor:String,type:{type:String,default:"circular"}},setup(B,{slots:R}){var F=computed(()=>extend$2({color:B.color},getSizeStyle(B.size))),D=()=>{if(R.default){var G;return createVNode("span",{class:bem$r("text"),style:{fontSize:addUnit(B.textSize),color:(G=B.textColor)!=null?G:B.color}},[R.default()])}};return()=>{var{type:G,vertical:U}=B;return createVNode("div",{class:bem$r([G,{vertical:U}])},[createVNode("span",{class:bem$r("spinner",G),style:F.value},[G==="spinner"?SpinIcon:CircularIcon]),D()])}}}),Loading=withInstall(_Loading),[name$q,bem$q]=createNamespace("button"),_Button=defineComponent({name:name$q,props:extend$2({},routeProps,{text:String,icon:String,color:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,hairline:Boolean,disabled:Boolean,iconPrefix:String,loadingSize: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"},iconPosition:{type:String,default:"left"}}),emits:["click"],setup(B,{emit:R,slots:F}){var D=useRoute(),G=()=>F.loading?F.loading():createVNode(Loading,{size:B.loadingSize,type:B.loadingType,class:bem$q("loading")},null),U=()=>{if(B.loading)return G();if(F.icon)return createVNode("div",{class:bem$q("icon")},[F.icon()]);if(B.icon)return createVNode(Icon,{name:B.icon,class:bem$q("icon"),classPrefix:B.iconPrefix},null)},W=()=>{var J;if(B.loading?J=B.loadingText:J=F.default?F.default():B.text,J)return createVNode("span",{class:bem$q("text")},[J])},q=()=>{var{color:J,plain:Z}=B;if(J){var K={color:Z?J:"white"};return Z||(K.background=J),J.includes("gradient")?K.border=0:K.borderColor=J,K}},Y=J=>{B.loading?J.preventDefault():B.disabled||(R("click",J),D())};return()=>{var{tag:J,type:Z,size:K,block:te,round:Q,plain:ie,square:se,loading:ne,disabled:re,hairline:ae,nativeType:ce,iconPosition:he}=B,fe=[bem$q([Z,K,{plain:ie,block:te,round:Q,square:se,loading:ne,disabled:re,hairline:ae}]),{[BORDER_SURROUND]:ae}];return createVNode(J,{type:ce,class:fe,style:q(),disabled:re,onClick:Y},{default:()=>[createVNode("div",{class:bem$q("content")},[he==="left"&&U(),W(),he==="right"&&U()])]})}}}),Button=withInstall(_Button),[name$p,bem$p]=createNamespace("action-bar-button"),_ActionBarButton=defineComponent({name:name$p,props:extend$2({},routeProps,{type:String,text:String,icon:String,color:String,loading:Boolean,disabled:Boolean}),setup(B,{slots:R}){var F=useRoute(),{parent:D,index:G}=useParent(ACTION_BAR_KEY),U=computed(()=>{if(D){var q=D.children[G.value-1];return!(q&&"isButton"in q)}}),W=computed(()=>{if(D){var q=D.children[G.value+1];return!(q&&"isButton"in q)}});return useExpose({isButton:!0}),()=>{var{type:q,icon:Y,text:J,color:Z,loading:K,disabled:te}=B;return createVNode(Button,{class:bem$p([q,{last:W.value,first:U.value}]),size:"large",type:q,icon:Y,color:Z,loading:K,disabled:te,onClick:F},{default:()=>[R.default?R.default():J]})}}}),ActionBarButton=withInstall(_ActionBarButton),popupSharedProps={show:Boolean,zIndex:[Number,String],overlay:truthProp,duration:[Number,String],teleport:[String,Object],lockScroll:truthProp,lazyRender:truthProp,overlayStyle:Object,overlayClass:unknownProp,transitionAppear:Boolean,closeOnClickOverlay:truthProp},popupSharedPropKeys=Object.keys(popupSharedProps),MIN_DISTANCE=10;function getDirection(B,R){return B>R&&B>MIN_DISTANCE?"horizontal":R>B&&R>MIN_DISTANCE?"vertical":""}function useTouch(){var B=ref(0),R=ref(0),F=ref(0),D=ref(0),G=ref(0),U=ref(0),W=ref(""),q=()=>W.value==="vertical",Y=()=>W.value==="horizontal",J=()=>{F.value=0,D.value=0,G.value=0,U.value=0,W.value=""},Z=te=>{J(),B.value=te.touches[0].clientX,R.value=te.touches[0].clientY},K=te=>{var Q=te.touches[0];F.value=Q.clientX<0?0:Q.clientX-B.value,D.value=Q.clientY-R.value,G.value=Math.abs(F.value),U.value=Math.abs(D.value),W.value||(W.value=getDirection(G.value,U.value))};return{move:K,start:Z,reset:J,startX:B,startY:R,deltaX:F,deltaY:D,offsetX:G,offsetY:U,direction:W,isVertical:q,isHorizontal:Y}}var totalLockCount=0,BODY_LOCK_CLASS="van-overflow-hidden";function useLockScroll(B,R){var F=useTouch(),D=Y=>{F.move(Y);var J=F.deltaY.value>0?"10":"01",Z=getScrollParent$1(Y.target,B.value),{scrollHeight:K,offsetHeight:te,scrollTop:Q}=Z,ie="11";Q===0?ie=te>=K?"00":"01":Q+te>=K&&(ie="10"),ie!=="11"&&F.isVertical()&&!(parseInt(ie,2)&parseInt(J,2))&&preventDefault(Y,!0)},G=()=>{document.addEventListener("touchstart",F.start),document.addEventListener("touchmove",D,{passive:!1}),totalLockCount||document.body.classList.add(BODY_LOCK_CLASS),totalLockCount++},U=()=>{totalLockCount&&(document.removeEventListener("touchstart",F.start),document.removeEventListener("touchmove",D),totalLockCount--,totalLockCount||document.body.classList.remove(BODY_LOCK_CLASS))},W=()=>{R()&&G()},q=()=>{R()&&U()};onMountedOrActivated(W),onDeactivated(q),onBeforeUnmount(q),watch(R,Y=>{Y?G():U()})}function useLazyRender(B){var R=ref(!1);return watch(B,F=>{F&&(R.value=F)},{immediate:!0}),F=>()=>R.value?F():null}var POPUP_TOGGLE_KEY=Symbol();function onPopupReopen(B){var R=inject(POPUP_TOGGLE_KEY,null);R&&watch(R,F=>{F&&B()})}var[name$o,bem$o]=createNamespace("overlay"),_Overlay=defineComponent({name:name$o,props:{show:Boolean,zIndex:[Number,String],duration:[Number,String],className:unknownProp,lockScroll:truthProp,customStyle:Object},setup(B,{slots:R}){var F=useLazyRender(()=>B.show),D=U=>{preventDefault(U,!0)},G=F(()=>{var U=extend$2(getZIndexStyle(B.zIndex),B.customStyle);return isDef$1(B.duration)&&(U.animationDuration=B.duration+"s"),withDirectives(createVNode("div",{style:U,class:[bem$o(),B.className],onTouchmove:B.lockScroll?D:noop$2},[R.default==null?void 0:R.default()]),[[vShow,B.show]])});return()=>createVNode(Transition,{name:"van-fade"},{default:()=>[G()]})}}),Overlay=withInstall(_Overlay),[name$n,bem$n]=createNamespace("popup"),globalZIndex=2e3,_Popup=defineComponent({name:name$n,inheritAttrs:!1,props:extend$2({},popupSharedProps,{round:Boolean,closeable:Boolean,transition:String,iconPrefix: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(B,{emit:R,attrs:F,slots:D}){var G,U,W=ref(),q=ref(),Y=useLazyRender(()=>B.show||!B.lazyRender),J=computed(()=>{var fe={zIndex:W.value};if(isDef$1(B.duration)){var be=B.position==="center"?"animationDuration":"transitionDuration";fe[be]=B.duration+"s"}return fe}),Z=()=>{G||(B.zIndex!==void 0&&(globalZIndex=+B.zIndex),G=!0,W.value=++globalZIndex)},K=()=>{G&&(G=!1,R("update:show",!1))},te=fe=>{R("click-overlay",fe),B.closeOnClickOverlay&&K()},Q=()=>{if(B.overlay)return createVNode(Overlay,{show:B.show,class:B.overlayClass,zIndex:W.value,duration:B.duration,customStyle:B.overlayStyle,onClick:te},{default:D["overlay-content"]})},ie=fe=>{R("click-close-icon",fe),K()},se=()=>{if(B.closeable)return createVNode(Icon,{role:"button",tabindex:0,name:B.closeIcon,class:bem$n("close-icon",B.closeIconPosition),classPrefix:B.iconPrefix,onClick:ie},null)},ne=fe=>R("click",fe),re=()=>R("opened"),ae=()=>R("closed"),ce=Y(()=>{var{round:fe,position:be,safeAreaInsetBottom:ue}=B;return withDirectives(createVNode("div",mergeProps({ref:q,style:J.value,class:bem$n({round:fe,[be]:be,"safe-area-inset-bottom":ue}),onClick:ne},F),[D.default==null?void 0:D.default(),se()]),[[vShow,B.show]])}),he=()=>{var{position:fe,transition:be,transitionAppear:ue}=B,ge=fe==="center"?"van-fade":"van-popup-slide-"+fe;return createVNode(Transition,{name:be||ge,appear:ue,onAfterEnter:re,onAfterLeave:ae},{default:()=>[ce()]})};return watch(()=>B.show,fe=>{fe?(Z(),R("open")):(K(),R("close"))}),useExpose({popupRef:q}),useLockScroll(q,()=>B.show&&B.lockScroll),useEventListener("popstate",()=>{B.closeOnPopstate&&(K(),U=!1)}),onMounted(()=>{B.show&&Z()}),onActivated(()=>{U&&(R("update:show",!0),U=!1)}),onDeactivated(()=>{B.show&&(K(),U=!0)}),provide(POPUP_TOGGLE_KEY,()=>B.show),()=>B.teleport?createVNode(Teleport,{to:B.teleport},{default:()=>[Q(),he()]}):createVNode(Fragment,null,[Q(),he()])}}),Popup=withInstall(_Popup),[name$m,bem$m]=createNamespace("cell"),cellProps={icon:String,size:String,title:[Number,String],value:[Number,String],label:[Number,String],center:Boolean,isLink:Boolean,border:truthProp,required:Boolean,iconPrefix:String,valueClass:unknownProp,labelClass:unknownProp,titleClass:unknownProp,titleStyle:null,arrowDirection:String,clickable:{type:Boolean,default:null}},_Cell=defineComponent({name:name$m,props:extend$2({},cellProps,routeProps),setup(B,{slots:R}){var F=useRoute(),D=()=>{var Y=R.label||isDef$1(B.label);if(Y)return createVNode("div",{class:[bem$m("label"),B.labelClass]},[R.label?R.label():B.label])},G=()=>{if(R.title||isDef$1(B.title))return createVNode("div",{class:[bem$m("title"),B.titleClass],style:B.titleStyle},[R.title?R.title():createVNode("span",null,[B.title]),D()])},U=()=>{var Y=R.default||isDef$1(B.value);if(Y){var J=R.title||isDef$1(B.title);return createVNode("div",{class:[bem$m("value",{alone:!J}),B.valueClass]},[R.default?R.default():createVNode("span",null,[B.value])])}},W=()=>{if(R.icon)return R.icon();if(B.icon)return createVNode(Icon,{name:B.icon,class:bem$m("left-icon"),classPrefix:B.iconPrefix},null)},q=()=>{if(R["right-icon"])return R["right-icon"]();if(B.isLink){var Y=B.arrowDirection?"arrow-"+B.arrowDirection:"arrow";return createVNode(Icon,{name:Y,class:bem$m("right-icon")},null)}};return()=>{var Y,{size:J,center:Z,border:K,isLink:te,required:Q}=B,ie=(Y=B.clickable)!=null?Y:te,se={center:Z,required:Q,clickable:ie,borderless:!K};return J&&(se[J]=!!J),createVNode("div",{class:bem$m(se),role:ie?"button":void 0,tabindex:ie?0:void 0,onClick:F},[W(),G(),U(),q(),R.extra==null?void 0:R.extra()])}}}),Cell=withInstall(_Cell);function isEmptyValue(B){return Array.isArray(B)?!B.length:B===0?!1:!B}function runSyncRule(B,R){return!(R.required&&isEmptyValue(B)||R.pattern&&!R.pattern.test(String(B)))}function runRuleValidator(B,R){return new Promise(F=>{var D=R.validator(B,R);if(isPromise(D))return D.then(F);F(D)})}function getRuleMessage(B,R){var{message:F}=R;return isFunction$1(F)?F(B,R):F||""}function startComposing(B){B.target.composing=!0}function endComposing(B){var{target:R}=B;R.composing&&(R.composing=!1,trigger(R,"input"))}function resizeTextarea(B,R){B.style.height="auto";var F=B.scrollHeight;if(isObject$1(R)){var{maxHeight:D,minHeight:G}=R;D!==void 0&&(F=Math.min(F,D)),G!==void 0&&(F=Math.max(F,G))}F&&(B.style.height=F+"px")}function mapInputType(B){return B==="number"?{type:"text",inputmode:"decimal"}:B==="digit"?{type:"tel",inputmode:"numeric"}:{type:B}}var FORM_KEY=Symbol("van-form"),FIELD_KEY=Symbol("van-field");function useLinkField(B){var R=inject(FIELD_KEY,null);R&&!R.childFieldValue.value&&(R.childFieldValue.value=B,watch(B,()=>{R.resetValidation(),R.validateWithTrigger("onChange")}))}var[name$l,bem$l]=createNamespace("field"),fieldProps={formatter:Function,leftIcon:String,rightIcon:String,autofocus:Boolean,clearable:Boolean,maxlength:[Number,String],inputAlign:String,placeholder:String,errorMessage:String,error:{type:Boolean,default:null},disabled:{type:Boolean,default:null},readonly:{type:Boolean,default:null},clearIcon:{type:String,default:"clear"},modelValue:{type:[Number,String],default:""},clearTrigger:{type:String,default:"focus"},formatTrigger:{type:String,default:"onChange"}},_Field=defineComponent({name:name$l,props:extend$2({},cellProps,fieldProps,{rows:[Number,String],name:String,rules:Array,autosize:[Boolean,Object],labelWidth:[Number,String],labelClass:unknownProp,labelAlign:String,autocomplete:String,showWordLimit:Boolean,errorMessageAlign:String,type:{type:String,default:"text"},colon:{type:Boolean,default:null}}),emits:["blur","focus","clear","keypress","click-input","click-left-icon","click-right-icon","update:modelValue"],setup(B,{emit:R,slots:F}){var D=reactive({focused:!1,validateFailed:!1,validateMessage:""}),G=ref(),U=ref(),{parent:W}=useParent(FORM_KEY),q=()=>{var ke;return String((ke=B.modelValue)!=null?ke:"")},Y=ke=>{if(isDef$1(B[ke]))return B[ke];if(W&&isDef$1(W.props[ke]))return W.props[ke]},J=computed(()=>{var ke=Y("readonly");if(B.clearable&&!ke){var Ae=q()!=="",_e=B.clearTrigger==="always"||B.clearTrigger==="focus"&&D.focused;return Ae&&_e}return!1}),Z=computed(()=>U.value&&F.input?U.value():B.modelValue),K=ke=>ke.reduce((Ae,_e)=>Ae.then(()=>{if(!D.validateFailed){var{value:Fe}=Z;if(_e.formatter&&(Fe=_e.formatter(Fe,_e)),!runSyncRule(Fe,_e)){D.validateFailed=!0,D.validateMessage=getRuleMessage(Fe,_e);return}if(_e.validator)return runRuleValidator(Fe,_e).then(Ye=>{Ye&&typeof Ye=="string"?(D.validateFailed=!0,D.validateMessage=Ye):Ye===!1&&(D.validateFailed=!0,D.validateMessage=getRuleMessage(Fe,_e))})}}),Promise.resolve()),te=()=>{D.validateFailed&&(D.validateFailed=!1,D.validateMessage="")},Q=(ke=B.rules)=>new Promise(Ae=>{te(),ke?K(ke).then(()=>{D.validateFailed?Ae({name:B.name,message:D.validateMessage}):Ae()}):Ae()}),ie=ke=>{if(W&&B.rules){var Ae=W.props.validateTrigger===ke,_e=B.rules.filter(Fe=>Fe.trigger?Fe.trigger===ke:Ae);_e.length&&Q(_e)}},se=ke=>{var{maxlength:Ae}=B;if(isDef$1(Ae)&&ke.length>Ae){var _e=q();return _e&&_e.length===+Ae?_e:ke.slice(0,+Ae)}return ke},ne=(ke,Ae="onChange")=>{if(ke=se(ke),B.type==="number"||B.type==="digit"){var _e=B.type==="number";ke=formatNumber(ke,_e,_e)}B.formatter&&Ae===B.formatTrigger&&(ke=B.formatter(ke)),G.value&&G.value.value!==ke&&(G.value.value=ke),ke!==B.modelValue&&R("update:modelValue",ke)},re=ke=>{ke.target.composing||ne(ke.target.value)},ae=()=>{var ke;return(ke=G.value)==null?void 0:ke.blur()},ce=()=>{var ke;return(ke=G.value)==null?void 0:ke.focus()},he=ke=>{D.focused=!0,R("focus",ke);var Ae=Y("readonly");Ae&&ae()},fe=ke=>{D.focused=!1,ne(q(),"onBlur"),R("blur",ke),ie("onBlur"),resetScroll()},be=ke=>R("click-input",ke),ue=ke=>R("click-left-icon",ke),ge=ke=>R("click-right-icon",ke),ve=ke=>{preventDefault(ke),R("update:modelValue",""),R("clear",ke)},Se=computed(()=>{if(typeof B.error=="boolean")return B.error;if(W&&W.props.showError&&D.validateFailed)return!0}),pe=computed(()=>{var ke=Y("labelWidth");if(ke)return{width:addUnit(ke)}}),ye=ke=>{var Ae=13;if(ke.keyCode===Ae){var _e=W&&W.props.submitOnEnter;!_e&&B.type!=="textarea"&&preventDefault(ke),B.type==="search"&&ae()}R("keypress",ke)},Ee=()=>{var ke=G.value;B.type==="textarea"&&B.autosize&&ke&&resizeTextarea(ke,B.autosize)},de=()=>{var ke=Y("inputAlign");if(F.input)return createVNode("div",{class:bem$l("control",[ke,"custom"]),onClick:be},[F.input()]);var Ae={ref:G,name:B.name,rows:B.rows!==void 0?+B.rows:void 0,class:bem$l("control",ke),value:B.modelValue,disabled:Y("disabled"),readonly:Y("readonly"),autofocus:B.autofocus,placeholder:B.placeholder,autocomplete:B.autocomplete,onBlur:fe,onFocus:he,onInput:re,onClick:be,onChange:endComposing,onKeypress:ye,onCompositionend:endComposing,onCompositionstart:startComposing};return B.type==="textarea"?createVNode("textarea",Ae,null):createVNode("input",mergeProps(mapInputType(B.type),Ae),null)},we=()=>{var ke=F["left-icon"];if(B.leftIcon||ke)return createVNode("div",{class:bem$l("left-icon"),onClick:ue},[ke?ke():createVNode(Icon,{name:B.leftIcon,classPrefix:B.iconPrefix},null)])},Oe=()=>{var ke=F["right-icon"];if(B.rightIcon||ke)return createVNode("div",{class:bem$l("right-icon"),onClick:ge},[ke?ke():createVNode(Icon,{name:B.rightIcon,classPrefix:B.iconPrefix},null)])},Me=()=>{if(B.showWordLimit&&B.maxlength){var ke=q().length;return createVNode("div",{class:bem$l("word-limit")},[createVNode("span",{class:bem$l("word-num")},[ke]),createTextVNode("/"),B.maxlength])}},Pe=()=>{if(!(W&&W.props.showErrorMessage===!1)){var ke=B.errorMessage||D.validateMessage;if(ke){var Ae=Y("errorMessageAlign");return createVNode("div",{class:bem$l("error-message",Ae)},[ke])}}},Ne=()=>{var ke=Y("colon")?":":"";if(F.label)return[F.label(),ke];if(B.label)return createVNode("span",null,[B.label+ke])};return useExpose({blur:ae,focus:ce,validate:Q,formValue:Z,resetValidation:te}),provide(FIELD_KEY,{childFieldValue:U,resetValidation:te,validateWithTrigger:ie}),watch(()=>B.modelValue,()=>{ne(q()),te(),ie("onChange"),nextTick(Ee)}),onMounted(()=>{ne(q(),B.formatTrigger),nextTick(Ee)}),()=>{var ke=Y("disabled"),Ae=Y("labelAlign"),_e=Ne(),Fe=we();return createVNode(Cell,{size:B.size,icon:B.leftIcon,class:bem$l({error:Se.value,disabled:ke,["label-"+Ae]:Ae,"min-height":B.type==="textarea"&&!B.autosize}),center:B.center,border:B.border,isLink:B.isLink,required:B.required,clickable:B.clickable,titleStyle:pe.value,valueClass:bem$l("value"),titleClass:[bem$l("label",Ae),B.labelClass],arrowDirection:B.arrowDirection},{default:()=>[createVNode("div",{class:bem$l("body")},[de(),J.value&&createVNode(Icon,{name:B.clearIcon,class:bem$l("clear"),onTouchstart:ve},null),Oe(),F.button&&createVNode("div",{class:bem$l("button")},[F.button()])]),Me(),Pe()],icon:Fe?()=>Fe:null,title:_e?()=>_e:null,extra:F.extra})}}}),Field=withInstall(_Field);function usePopupState(){var B=reactive({show:!1}),R=G=>{B.show=G},F=G=>{extend$2(B,G),nextTick(()=>R(!0))},D=()=>R(!1);return useExpose({open:F,close:D,toggle:R}),{open:F,close:D,state:B,toggle:R}}function mountComponent(B){var R=createApp(B),F=document.createElement("div");return document.body.appendChild(F),{instance:R.mount(F),unmount(){R.unmount(),document.body.removeChild(F)}}}var lockCount=0;function lockClick(B){B?(lockCount||document.body.classList.add("van-toast--unclickable"),lockCount++):lockCount&&(lockCount--,lockCount||document.body.classList.remove("van-toast--unclickable"))}var[name$k,bem$k]=createNamespace("toast"),VanToast=defineComponent({name:name$k,props:{icon:String,show:Boolean,overlay:Boolean,message:[Number,String],iconSize:[Number,String],className:unknownProp,iconPrefix:String,loadingType:String,forbidClick:Boolean,overlayClass:unknownProp,overlayStyle:Object,closeOnClick:Boolean,closeOnClickOverlay:Boolean,type:{type:String,default:"text"},duration:{type:Number,default:2e3},position:{type:String,default:"middle"},transition:{type:String,default:"van-fade"}},emits:["update:show"],setup(B,{emit:R}){var F,D=!1,G=()=>{var Z=B.show&&B.forbidClick;D!==Z&&(D=Z,lockClick(D))},U=Z=>R("update:show",Z),W=()=>{B.closeOnClick&&U(!1)},q=()=>{clearTimeout(F)},Y=()=>{var{icon:Z,type:K,iconSize:te,iconPrefix:Q,loadingType:ie}=B,se=Z||K==="success"||K==="fail";if(se)return createVNode(Icon,{name:Z||K,size:te,class:bem$k("icon"),classPrefix:Q},null);if(K==="loading")return createVNode(Loading,{class:bem$k("loading"),size:te,type:ie},null)},J=()=>{var{type:Z,message:K}=B;if(isDef$1(K)&&K!=="")return Z==="html"?createVNode("div",{class:bem$k("text"),innerHTML:String(K)},null):createVNode("div",{class:bem$k("text")},[K])};return watch(()=>[B.show,B.forbidClick],G),watch(()=>[B.show,B.type,B.message,B.duration],()=>{q(),B.show&&B.duration>0&&(F=setTimeout(()=>{U(!1)},B.duration))}),onMounted(G),onUnmounted(G),()=>createVNode(Popup,mergeProps({show:B.show,class:[bem$k([B.position,{[B.type]:!B.icon}]),B.className],overlay:B.overlay,lockScroll:!1,transition:B.transition,overlayClass:B.overlayClass,overlayStyle:B.overlayStyle,closeOnClickOverlay:B.closeOnClickOverlay,onClick:W,onClosed:q},{"onUpdate:show":U}),{default:()=>[Y(),J()]})}}),defaultOptions={icon:"",type:"text",message:"",className:"",overlay:!1,onClose:void 0,onOpened:void 0,duration:2e3,teleport:"body",iconSize:void 0,iconPrefix:void 0,position:"middle",transition:"van-fade",forbidClick:!1,loadingType:void 0,overlayClass:"",overlayStyle:void 0,closeOnClick:!1,closeOnClickOverlay:!1},queue$1=[],allowMultiple=!1,currentOptions=extend$2({},defaultOptions),defaultOptionsMap={};function parseOptions(B){return isObject$1(B)?B:{message:B}}function createInstance(){var{instance:B,unmount:R}=mountComponent({setup(){var F=ref(""),{open:D,state:G,close:U,toggle:W}=usePopupState(),q=()=>{allowMultiple&&(queue$1=queue$1.filter(J=>J!==B),R())},Y=()=>{var J={onClosed:q,"onUpdate:show":W};return F.value&&(J.message=F.value),createVNode(VanToast,mergeProps(G,J),null)};return getCurrentInstance().render=Y,{open:D,clear:U,message:F}}});return B}function getInstance(){if(!queue$1.length||allowMultiple){var B=createInstance();queue$1.push(B)}return queue$1[queue$1.length-1]}function Toast(B={}){if(!inBrowser$1)return{};var R=getInstance(),F=parseOptions(B);return R.open(extend$2({},currentOptions,defaultOptionsMap[F.type||currentOptions.type],F)),R}var createMethod=B=>R=>Toast(extend$2({type:B},parseOptions(R)));Toast.loading=createMethod("loading");Toast.success=createMethod("success");Toast.fail=createMethod("fail");Toast.clear=B=>{queue$1.length&&(B?(queue$1.forEach(R=>{R.clear()}),queue$1=[]):allowMultiple?queue$1.shift().clear():queue$1[0].clear())};function setDefaultOptions(B,R){typeof B=="string"?defaultOptionsMap[B]=R:extend$2(currentOptions,B)}Toast.setDefaultOptions=setDefaultOptions;Toast.resetDefaultOptions=B=>{typeof B=="string"?defaultOptionsMap[B]=null:(currentOptions=extend$2({},defaultOptions),defaultOptionsMap={})};Toast.allowMultiple=(B=!0)=>{allowMultiple=B};Toast.install=B=>{B.use(withInstall(VanToast)),B.config.globalProperties.$toast=Toast};function callInterceptor(B){var{interceptor:R,args:F,done:D,canceled:G}=B;if(R){var U=R.apply(null,F||[]);isPromise(U)?U.then(W=>{W?D():G&&G()}).catch(noop$2):U?D():G&&G()}else D()}var[name$j,bem$j,t$1]=createNamespace("dialog"),popupKeys=[...popupSharedPropKeys,"transition","closeOnPopstate"],VanDialog=defineComponent({name:name$j,props:extend$2({},popupSharedProps,{title:String,theme:String,width:[Number,String],message:[String,Function],callback:Function,allowHtml:Boolean,className:unknownProp,beforeClose:Function,messageAlign:String,closeOnPopstate:truthProp,showCancelButton:Boolean,cancelButtonText:String,cancelButtonColor:String,confirmButtonText:String,confirmButtonColor:String,showConfirmButton:truthProp,closeOnClickOverlay:Boolean,transition:{type:String,default:"van-dialog-bounce"}}),emits:["confirm","cancel","update:show"],setup(B,{emit:R,slots:F}){var D=reactive({confirm:!1,cancel:!1}),G=se=>R("update:show",se),U=se=>{G(!1),B.callback&&B.callback(se)},W=se=>()=>{!B.show||(R(se),B.beforeClose?(D[se]=!0,callInterceptor({interceptor:B.beforeClose,args:[se],done(){U(se),D[se]=!1},canceled(){D[se]=!1}})):U(se))},q=W("cancel"),Y=W("confirm"),J=()=>{var se=F.title?F.title():B.title;if(se)return createVNode("div",{class:bem$j("header",{isolated:!B.message&&!F.default})},[se])},Z=se=>{var{message:ne,allowHtml:re,messageAlign:ae}=B,ce=bem$j("message",{"has-title":se,[ae]:ae}),he=isFunction$1(ne)?ne():ne;return re&&typeof he=="string"?createVNode("div",{class:ce,innerHTML:he},null):createVNode("div",{class:ce},[he])},K=()=>{if(F.default)return createVNode("div",{class:bem$j("content")},[F.default()]);var{title:se,message:ne,allowHtml:re}=B;if(ne){var ae=!!(se||F.title);return createVNode("div",{key:re?1:0,class:bem$j("content",{isolated:!ae})},[Z(ae)])}},te=()=>createVNode("div",{class:[BORDER_TOP,bem$j("footer")]},[B.showCancelButton&&createVNode(Button,{size:"large",text:B.cancelButtonText||t$1("cancel"),class:bem$j("cancel"),style:{color:B.cancelButtonColor},loading:D.cancel,onClick:q},null),B.showConfirmButton&&createVNode(Button,{size:"large",text:B.confirmButtonText||t$1("confirm"),class:[bem$j("confirm"),{[BORDER_LEFT]:B.showCancelButton}],style:{color:B.confirmButtonColor},loading:D.confirm,onClick:Y},null)]),Q=()=>createVNode(ActionBar,{class:bem$j("footer")},{default:()=>[B.showCancelButton&&createVNode(ActionBarButton,{type:"warning",text:B.cancelButtonText||t$1("cancel"),class:bem$j("cancel"),color:B.cancelButtonColor,loading:D.cancel,onClick:q},null),B.showConfirmButton&&createVNode(ActionBarButton,{type:"danger",text:B.confirmButtonText||t$1("confirm"),class:bem$j("confirm"),color:B.confirmButtonColor,loading:D.confirm,onClick:Y},null)]}),ie=()=>F.footer?F.footer():B.theme==="round-button"?Q():te();return()=>{var{width:se,title:ne,theme:re,message:ae,className:ce}=B;return createVNode(Popup,mergeProps({role:"dialog",class:[bem$j([re]),ce],style:{width:addUnit(se)},"aria-labelledby":ne||ae},pick(B,popupKeys),{"onUpdate:show":G}),{default:()=>[J(),K(),ie()]})}}}),instance$1;function initInstance(){var B={setup(){var{state:R,toggle:F}=usePopupState();return()=>createVNode(VanDialog,mergeProps(R,{"onUpdate:show":F}),null)}};({instance:instance$1}=mountComponent(B))}function Dialog(B){return inBrowser$1?new Promise((R,F)=>{instance$1||initInstance(),instance$1.open(extend$2({},Dialog.currentOptions,B,{callback:D=>{(D==="confirm"?R:F)(D)}}))}):Promise.resolve()}Dialog.defaultOptions={title:"",width:"",theme:null,message:"",overlay:!0,callback:null,teleport:"body",className:"",allowHtml:!1,lockScroll:!0,transition:"van-dialog-bounce",beforeClose:null,overlayClass:"",overlayStyle:void 0,messageAlign:"",cancelButtonText:"",cancelButtonColor:null,confirmButtonText:"",confirmButtonColor:null,showConfirmButton:!0,showCancelButton:!1,closeOnPopstate:!0,closeOnClickOverlay:!1};Dialog.currentOptions=extend$2({},Dialog.defaultOptions);Dialog.alert=Dialog;Dialog.confirm=B=>Dialog(extend$2({showCancelButton:!0},B));Dialog.close=()=>{instance$1&&instance$1.toggle(!1)};Dialog.setDefaultOptions=B=>{extend$2(Dialog.currentOptions,B)};Dialog.resetDefaultOptions=()=>{Dialog.currentOptions=extend$2({},Dialog.defaultOptions)};Dialog.install=B=>{B.use(withInstall(VanDialog)),B.config.globalProperties.$dialog=Dialog};Dialog.Component=withInstall(VanDialog);var[name$i,bem$i]=createNamespace("switch"),_Switch=defineComponent({name:name$i,props:{size:[Number,String],loading:Boolean,disabled:Boolean,modelValue:unknownProp,activeColor:String,inactiveColor:String,activeValue:{type:unknownProp,default:!0},inactiveValue:{type:unknownProp,default:!1}},emits:["change","update:modelValue"],setup(B,{emit:R}){var F=()=>B.modelValue===B.activeValue,D=()=>{if(!B.disabled&&!B.loading){var U=F()?B.inactiveValue:B.activeValue;R("update:modelValue",U),R("change",U)}},G=()=>{if(B.loading){var U=F()?B.activeColor:B.inactiveColor;return createVNode(Loading,{class:bem$i("loading"),color:U},null)}};return useLinkField(()=>B.modelValue),()=>{var{size:U,loading:W,disabled:q,activeColor:Y,inactiveColor:J}=B,Z=F(),K={fontSize:addUnit(U),backgroundColor:Z?Y:J};return createVNode("div",{role:"switch",class:bem$i({on:Z,loading:W,disabled:q}),style:K,"aria-checked":Z,onClick:D},[createVNode("div",{class:bem$i("node")},[G()])])}}}),Switch=withInstall(_Switch),[name$h,bem$h]=createNamespace("radio-group"),RADIO_KEY=Symbol(name$h),props$4={disabled:Boolean,iconSize:[Number,String],direction:String,modelValue:unknownProp,checkedColor:String},_RadioGroup=defineComponent({name:name$h,props:props$4,emits:["change","update:modelValue"],setup(B,{emit:R,slots:F}){var{linkChildren:D}=useChildren(RADIO_KEY),G=U=>R("update:modelValue",U);return watch(()=>B.modelValue,U=>R("change",U)),D({props:B,updateValue:G}),useLinkField(()=>B.modelValue),()=>createVNode("div",{class:bem$h([B.direction]),role:"radiogroup"},[F.default==null?void 0:F.default()])}}),RadioGroup=withInstall(_RadioGroup),checkerProps={name:unknownProp,disabled:Boolean,iconSize:[Number,String],modelValue:unknownProp,checkedColor:String,labelPosition:String,labelDisabled:Boolean,shape:{type:String,default:"round"}},Checker=defineComponent({props:extend$2({},checkerProps,{role:String,parent:Object,checked:Boolean,bindGroup:truthProp,bem:{type:Function,required:!0}}),emits:["click","toggle"],setup(B,{emit:R,slots:F}){var D=ref(),G=K=>{if(B.parent&&B.bindGroup)return B.parent.props[K]},U=computed(()=>G("disabled")||B.disabled),W=computed(()=>G("direction")),q=computed(()=>{var K=B.checkedColor||G("checkedColor");if(K&&B.checked&&!U.value)return{borderColor:K,backgroundColor:K}}),Y=K=>{var{target:te}=K,Q=D.value,ie=Q===te||Q.contains(te);!U.value&&(ie||!B.labelDisabled)&&R("toggle"),R("click",K)},J=()=>{var{bem:K,shape:te,checked:Q}=B,ie=B.iconSize||G("iconSize");return createVNode("div",{ref:D,class:K("icon",[te,{disabled:U.value,checked:Q}]),style:{fontSize:addUnit(ie)}},[F.icon?F.icon({checked:Q,disabled:U.value}):createVNode(Icon,{name:"success",style:q.value},null)])},Z=()=>{if(F.default)return createVNode("span",{class:B.bem("label",[B.labelPosition,{disabled:U.value}])},[F.default()])};return()=>{var K=[J()];return B.labelPosition==="left"?K.unshift(Z()):K.push(Z()),createVNode("div",{role:B.role,class:B.bem([{disabled:U.value,"label-disabled":B.labelDisabled},W.value]),tabindex:U.value?-1:0,"aria-checked":B.checked,onClick:Y},[K])}}}),[name$g,bem$g]=createNamespace("radio"),_Radio=defineComponent({name:name$g,props:checkerProps,emits:["update:modelValue"],setup(B,{emit:R,slots:F}){var{parent:D}=useParent(RADIO_KEY),G=()=>{var W=D?D.props.modelValue:B.modelValue;return W===B.name},U=()=>{D?D.updateValue(B.name):R("update:modelValue",B.name)};return()=>createVNode(Checker,mergeProps({bem:bem$g,role:"radio",parent:D,checked:G(),onToggle:U},B),pick(F,["default","icon"]))}}),Radio=withInstall(_Radio);function useRefs(){var B=ref([]);onBeforeUpdate(()=>{B.value=[]});var R=F=>D=>{B.value[F]=D};return[B,R]}var rafId;function scrollLeftTo(B,R,F){cancelRaf(rafId);var D=0,G=B.scrollLeft,U=F===0?1:Math.round(F*1e3/16);function W(){B.scrollLeft+=(R-G)/U,++DR||!U&&GR?raf$2(Y):D&&raf$2(D)}Y()}function useVisibilityChange(B,R){if(!(!inBrowser$1||!window.IntersectionObserver)){var F=new IntersectionObserver(U=>{R(U[0].intersectionRatio>0)},{root:document.body}),D=()=>{B.value&&F.observe(B.value)},G=()=>{B.value&&F.unobserve(B.value)};onDeactivated(G),onBeforeUnmount(G),onMountedOrActivated(D)}}var[name$f,bem$f]=createNamespace("sticky"),_Sticky=defineComponent({name:name$f,props:{zIndex:[Number,String],container:Object,offsetTop:{type:[Number,String],default:0},offsetBottom:{type:[Number,String],default:0},position:{type:String,default:"top"}},emits:["scroll","change"],setup(B,{emit:R,slots:F}){var D=ref(),G=useScrollParent(D),U=reactive({fixed:!1,width:0,height:0,transform:0}),W=computed(()=>unitToPx(B.position==="top"?B.offsetTop:B.offsetBottom)),q=computed(()=>{var{fixed:K,height:te,width:Q}=U;if(K)return{width:Q+"px",height:te+"px"}}),Y=computed(()=>{if(!!U.fixed){var K=extend$2(getZIndexStyle(B.zIndex),{width:U.width+"px",height:U.height+"px",[B.position]:W.value+"px"});return U.transform&&(K.transform="translate3d(0, "+U.transform+"px, 0)"),K}}),J=K=>R("scroll",{scrollTop:K,isFixed:U.fixed}),Z=()=>{if(!(!D.value||isHidden(D))){var{container:K,position:te}=B,Q=useRect(D),ie=getScrollTop(window);if(U.width=Q.width,U.height=Q.height,te==="top")if(K){var se=useRect(K),ne=se.bottom-W.value-U.height;U.fixed=W.value>Q.top&&se.bottom>0,U.transform=ne<0?ne:0}else U.fixed=W.value>Q.top;else{var{clientHeight:re}=document.documentElement;if(K){var ae=useRect(K),ce=re-ae.top-W.value-U.height;U.fixed=re-W.valueae.top,U.transform=ce<0?-ce:0}else U.fixed=re-W.valueU.fixed,K=>R("change",K)),useEventListener("scroll",Z,{target:G}),useVisibilityChange(D,Z),()=>createVNode("div",{ref:D,style:q.value},[createVNode("div",{class:bem$f({fixed:U.fixed}),style:Y.value},[F.default==null?void 0:F.default()])])}}),Sticky=withInstall(_Sticky),[name$e,bem$e]=createNamespace("tab"),TabsTitle=defineComponent({name:name$e,props:{dot:Boolean,type:String,color:String,title:String,badge:[Number,String],isActive:Boolean,disabled:Boolean,scrollable:Boolean,activeColor:String,renderTitle:Function,inactiveColor:String},setup(B){var R=computed(()=>{var D={},{type:G,color:U,disabled:W,isActive:q,activeColor:Y,inactiveColor:J}=B,Z=G==="card";U&&Z&&(D.borderColor=U,W||(q?D.backgroundColor=U:D.color=U));var K=q?Y:J;return K&&(D.color=K),D}),F=()=>{var D=createVNode("span",{class:bem$e("text",{ellipsis:!B.scrollable})},[B.renderTitle?B.renderTitle():B.title]);return B.dot||isDef$1(B.badge)&&B.badge!==""?createVNode(Badge,{dot:B.dot,content:B.badge},{default:()=>[D]}):D};return()=>createVNode("div",{role:"tab",class:[bem$e({active:B.isActive,disabled:B.disabled})],style:R.value,"aria-selected":B.isActive},[F()])}}),[name$d,bem$d]=createNamespace("swipe"),SWIPE_KEY=Symbol(name$d),props$3={loop:truthProp,width:[Number,String],height:[Number,String],vertical:Boolean,touchable:truthProp,lazyRender:Boolean,indicatorColor:String,showIndicators:truthProp,stopPropagation:truthProp,autoplay:{type:[Number,String],default:0},duration:{type:[Number,String],default:500},initialSwipe:{type:[Number,String],default:0}},_Swipe=defineComponent({name:name$d,props:props$3,emits:["change"],setup(B,{emit:R,slots:F}){var D=ref(),G=reactive({rect:null,width:0,height:0,offset:0,active:0,swiping:!1}),U=useTouch(),W=useWindowSize(),{children:q,linkChildren:Y}=useChildren(SWIPE_KEY),J=computed(()=>q.length),Z=computed(()=>G[B.vertical?"height":"width"]),K=computed(()=>B.vertical?U.deltaY.value:U.deltaX.value),te=computed(()=>{if(G.rect){var ke=B.vertical?G.rect.height:G.rect.width;return ke-Z.value*J.value}return 0}),Q=computed(()=>Math.ceil(Math.abs(te.value)/Z.value)),ie=computed(()=>J.value*Z.value),se=computed(()=>(G.active+J.value)%J.value),ne=computed(()=>{var ke=B.vertical?"vertical":"horizontal";return U.direction.value===ke}),re=computed(()=>{var ke={transitionDuration:(G.swiping?0:B.duration)+"ms",transform:"translate"+(B.vertical?"Y":"X")+"("+G.offset+"px)"};if(Z.value){var Ae=B.vertical?"height":"width",_e=B.vertical?"width":"height";ke[Ae]=ie.value+"px",ke[_e]=B[_e]?B[_e]+"px":""}return ke}),ae=ke=>{var{active:Ae}=G;return ke?B.loop?clamp(Ae+ke,-1,J.value):clamp(Ae+ke,0,Q.value):Ae},ce=(ke,Ae=0)=>{var _e=ke*Z.value;B.loop||(_e=Math.min(_e,-te.value));var Fe=Ae-_e;return B.loop||(Fe=clamp(Fe,te.value,0)),Fe},he=({pace:ke=0,offset:Ae=0,emitChange:_e})=>{if(!(J.value<=1)){var{active:Fe}=G,Ye=ae(ke),Ce=ce(Ye,Ae);if(B.loop){if(q[0]&&Ce!==te.value){var Ge=Ce0;q[J.value-1].setOffset(We?-ie.value:0)}}G.active=Ye,G.offset=Ce,_e&&Ye!==Fe&&R("change",se.value)}},fe=()=>{G.swiping=!0,G.active<=-1?he({pace:J.value}):G.active>=J.value&&he({pace:-J.value})},be=()=>{fe(),U.reset(),doubleRaf(()=>{G.swiping=!1,he({pace:-1,emitChange:!0})})},ue=()=>{fe(),U.reset(),doubleRaf(()=>{G.swiping=!1,he({pace:1,emitChange:!0})})},ge,ve=()=>clearTimeout(ge),Se=()=>{ve(),B.autoplay>0&&J.value>1&&(ge=setTimeout(()=>{ue(),Se()},+B.autoplay))},pe=(ke=+B.initialSwipe)=>{if(!!D.value){if(!isHidden(D)){var Ae,_e,Fe={width:D.value.offsetWidth,height:D.value.offsetHeight};G.rect=Fe,G.width=+((Ae=B.width)!=null?Ae:Fe.width),G.height=+((_e=B.height)!=null?_e:Fe.height)}J.value&&(ke=Math.min(J.value-1,ke)),G.active=ke,G.swiping=!0,G.offset=ce(ke),q.forEach(Ye=>{Ye.setOffset(0)})}},ye=()=>pe(G.active),Ee,de=ke=>{!B.touchable||(U.start(ke),Ee=Date.now(),ve(),fe())},we=ke=>{B.touchable&&G.swiping&&(U.move(ke),ne.value&&(preventDefault(ke,B.stopPropagation),he({offset:K.value})))},Oe=()=>{if(!(!B.touchable||!G.swiping)){var ke=Date.now()-Ee,Ae=K.value/ke,_e=Math.abs(Ae)>.25||Math.abs(K.value)>Z.value/2;if(_e&&ne.value){var Fe=B.vertical?U.offsetY.value:U.offsetX.value,Ye=0;B.loop?Ye=Fe>0?K.value>0?-1:1:0:Ye=-Math[K.value>0?"ceil":"floor"](K.value/Z.value),he({pace:Ye,emitChange:!0})}else K.value&&he({pace:0});G.swiping=!1,Se()}},Me=(ke,Ae={})=>{fe(),U.reset(),doubleRaf(()=>{var _e;B.loop&&ke===J.value?_e=G.active===0?0:ke:_e=ke%J.value,Ae.immediate?doubleRaf(()=>{G.swiping=!1}):G.swiping=!1,he({pace:_e-G.active,emitChange:!0})})},Pe=(ke,Ae)=>{var _e=Ae===se.value,Fe=_e?{backgroundColor:B.indicatorColor}:void 0;return createVNode("i",{style:Fe,class:bem$d("indicator",{active:_e})},null)},Ne=()=>{if(F.indicator)return F.indicator({active:se.value});if(B.showIndicators&&J.value>1)return createVNode("div",{class:bem$d("indicators",{vertical:B.vertical})},[Array(J.value).fill("").map(Pe)])};return useExpose({prev:be,next:ue,state:G,resize:ye,swipeTo:Me}),Y({size:Z,props:B,count:J,activeIndicator:se}),watch(()=>B.initialSwipe,ke=>pe(+ke)),watch(J,()=>pe(G.active)),watch([J,()=>B.autoplay],Se),watch([W.width,W.height],ye),watch(usePageVisibility(),ke=>{ke==="visible"?Se():ve()}),onMounted(pe),onActivated(()=>pe(G.active)),onPopupReopen(()=>pe(G.active)),onDeactivated(ve),onBeforeUnmount(ve),()=>createVNode("div",{ref:D,class:bem$d()},[createVNode("div",{style:re.value,class:bem$d("track",{vertical:B.vertical}),onTouchstart:de,onTouchmove:we,onTouchend:Oe,onTouchcancel:Oe},[F.default==null?void 0:F.default()]),Ne()])}}),Swipe=withInstall(_Swipe),[name$c,bem$c]=createNamespace("tabs"),TabsContent=defineComponent({name:name$c,props:{inited:Boolean,animated:Boolean,swipeable:Boolean,lazyRender:Boolean,count:{type:Number,required:!0},duration:{type:[Number,String],required:!0},currentIndex:{type:Number,required:!0}},emits:["change"],setup(B,{emit:R,slots:F}){var D=ref(),G=q=>R("change",q),U=()=>{var q=F.default==null?void 0:F.default();return B.animated||B.swipeable?createVNode(Swipe,{ref:D,loop:!1,class:bem$c("track"),duration:+B.duration*1e3,touchable:B.swipeable,lazyRender:B.lazyRender,showIndicators:!1,onChange:G},{default:()=>[q]}):q},W=q=>{var Y=D.value;Y&&Y.state.active!==q&&Y.swipeTo(q,{immediate:!B.inited})};return watch(()=>B.currentIndex,W),onMounted(()=>{W(B.currentIndex)}),()=>createVNode("div",{class:bem$c("content",{animated:B.animated||B.swipeable})},[U()])}}),[name$b,bem$b]=createNamespace("tabs"),TABS_KEY=Symbol(name$b),props$2={color:String,border:Boolean,sticky:Boolean,animated:Boolean,ellipsis:truthProp,swipeable:Boolean,scrollspy:Boolean,background:String,lazyRender:truthProp,lineWidth:[Number,String],lineHeight:[Number,String],beforeChange:Function,titleActiveColor:String,titleInactiveColor:String,type:{type:String,default:"line"},active:{type:[Number,String],default:0},duration:{type:[Number,String],default:.3},offsetTop:{type:[Number,String],default:0},swipeThreshold:{type:[Number,String],default:5}},_Tabs=defineComponent({name:name$b,props:props$2,emits:["click","change","scroll","disabled","rendered","update:active"],setup(B,{emit:R,slots:F}){var D,G,U,W=ref(),q=ref(),Y=ref(),J=useWindowSize(),Z=useScrollParent(W),[K,te]=useRefs(),{children:Q,linkChildren:ie}=useChildren(TABS_KEY),se=reactive({inited:!1,position:"",lineStyle:{},currentIndex:-1}),ne=computed(()=>Q.length>B.swipeThreshold||!B.ellipsis),re=computed(()=>({borderColor:B.color,background:B.background})),ae=(Ae,_e)=>{var Fe;return(Fe=Ae.name)!=null?Fe:_e},ce=computed(()=>{var Ae=Q[se.currentIndex];if(Ae)return ae(Ae,se.currentIndex)}),he=computed(()=>unitToPx(B.offsetTop)),fe=computed(()=>B.sticky?he.value+D:0),be=Ae=>{var _e=q.value,Fe=K.value;if(!(!ne.value||!_e||!Fe||!Fe[se.currentIndex])){var Ye=Fe[se.currentIndex].$el,Ce=Ye.offsetLeft-(_e.offsetWidth-Ye.offsetWidth)/2;scrollLeftTo(_e,Ce,Ae?0:+B.duration)}},ue=()=>{var Ae=se.inited;nextTick(()=>{var _e=K.value;if(!(!_e||!_e[se.currentIndex]||B.type!=="line"||isHidden(W.value))){var Fe=_e[se.currentIndex].$el,{lineWidth:Ye,lineHeight:Ce}=B,Ge=Fe.offsetLeft+Fe.offsetWidth/2,We={width:addUnit(Ye),backgroundColor:B.color,transform:"translateX("+Ge+"px) translateX(-50%)"};if(Ae&&(We.transitionDuration=B.duration+"s"),isDef$1(Ce)){var Ve=addUnit(Ce);We.height=Ve,We.borderRadius=Ve}se.lineStyle=We}})},ge=Ae=>{for(var _e=Ae=0&&Ae{var _e=ge(Ae);if(!!isDef$1(_e)){var Fe=Q[_e],Ye=ae(Fe,_e),Ce=se.currentIndex!==null;se.currentIndex=_e,Ye!==B.active&&(R("update:active",Ye),Ce&&R("change",Ye,Fe.title))}},Se=Ae=>{var _e=Q.find((Ye,Ce)=>ae(Ye,Ce)===Ae),Fe=_e?Q.indexOf(_e):0;ve(Fe)},pe=(Ae=!1)=>{if(B.scrollspy){var _e=Q[se.currentIndex].$el;if(_e&&Z.value){var Fe=getElementTop(_e,Z.value)-fe.value;G=!0,scrollTopTo(Z.value,Fe,Ae?0:+B.duration,()=>{G=!1})}}},ye=(Ae,_e)=>{var{title:Fe,disabled:Ye}=Q[_e],Ce=ae(Q[_e],_e);Ye?R("disabled",Ce,Fe):(callInterceptor({interceptor:B.beforeChange,args:[Ce],done:()=>{ve(_e),pe()}}),R("click",Ce,Fe),route(Ae))},Ee=Ae=>{U=Ae.isFixed,R("scroll",Ae)},de=Ae=>{nextTick(()=>{Se(Ae),pe(!0)})},we=()=>{for(var Ae=0;Aefe.value)return Ae===0?0:Ae-1}return Q.length-1},Oe=()=>{if(B.scrollspy&&!G){var Ae=we();ve(Ae)}},Me=()=>Q.map((Ae,_e)=>createVNode(TabsTitle,{ref:te(_e),dot:Ae.dot,type:B.type,badge:Ae.badge,title:Ae.title,color:B.color,style:Ae.titleStyle,class:Ae.titleClass,isActive:_e===se.currentIndex,disabled:Ae.disabled,scrollable:ne.value,renderTitle:Ae.$slots.title,activeColor:B.titleActiveColor,inactiveColor:B.titleInactiveColor,onClick:()=>{ye(Ae,_e)}},null)),Pe=()=>{var Ae,_e,{type:Fe,border:Ye}=B;return createVNode("div",{ref:Y,class:[bem$b("wrap",{scrollable:ne.value}),{[BORDER_TOP_BOTTOM]:Fe==="line"&&Ye}]},[createVNode("div",{ref:q,role:"tablist",class:bem$b("nav",[Fe,{complete:ne.value}]),style:re.value},[(Ae=F["nav-left"])==null?void 0:Ae.call(F),Me(),Fe==="line"&&createVNode("div",{class:bem$b("line"),style:se.lineStyle},null),(_e=F["nav-right"])==null?void 0:_e.call(F)])])};watch([()=>B.color,J.width],ue),watch(()=>B.active,Ae=>{Ae!==ce.value&&Se(Ae)}),watch(()=>Q.length,()=>{se.inited&&(Se(B.active),ue(),nextTick(()=>{be(!0)}))}),watch(()=>se.currentIndex,()=>{be(),ue(),U&&!B.scrollspy&&setRootScrollTop(Math.ceil(getElementTop(W.value)-he.value))});var Ne=()=>{Se(B.active),nextTick(()=>{se.inited=!0,D=getVisibleHeight(Y.value),be(!0)})},ke=(Ae,_e)=>R("rendered",Ae,_e);return useExpose({resize:ue,scrollTo:de}),onActivated(ue),onPopupReopen(ue),onMountedOrActivated(Ne),useEventListener("scroll",Oe,{target:Z}),ie({props:B,setLine:ue,onRendered:ke,currentName:ce,scrollIntoView:be}),()=>createVNode("div",{ref:W,class:bem$b([B.type])},[B.sticky?createVNode(Sticky,{container:W.value,offsetTop:he.value,onScroll:Ee},{default:()=>[Pe()]}):Pe(),createVNode(TabsContent,{count:Q.length,inited:se.inited,animated:B.animated,duration:B.duration,swipeable:B.swipeable,lazyRender:B.lazyRender,currentIndex:se.currentIndex,onChange:ve},{default:()=>[F.default==null?void 0:F.default()]})])}}),TAB_STATUS_KEY=Symbol();function useTabStatus(){return inject(TAB_STATUS_KEY,null)}var[name$a,bem$a]=createNamespace("swipe-item"),_SwipeItem=defineComponent({name:name$a,setup(B,{slots:R}){var F,D=reactive({offset:0,inited:!1,mounted:!1}),{parent:G,index:U}=useParent(SWIPE_KEY);if(!!G){var W=computed(()=>{var J={},{vertical:Z}=G.props;return G.size.value&&(J[Z?"height":"width"]=G.size.value+"px"),D.offset&&(J.transform="translate"+(Z?"Y":"X")+"("+D.offset+"px)"),J}),q=computed(()=>{var{loop:J,lazyRender:Z}=G.props;if(!Z||F)return!0;if(!D.mounted)return!1;var K=G.activeIndicator.value,te=G.count.value-1,Q=K===0&&J?te:K-1,ie=K===te&&J?0:K+1;return F=U.value===K||U.value===Q||U.value===ie,F}),Y=J=>{D.offset=J};return onMounted(()=>{nextTick(()=>{D.mounted=!0})}),useExpose({setOffset:Y}),()=>createVNode("div",{class:bem$a(),style:W.value},[q.value?R.default==null?void 0:R.default():null])}}}),SwipeItem=withInstall(_SwipeItem),[name$9,bem$9]=createNamespace("tab"),_Tab=defineComponent({name:name$9,props:extend$2({},routeProps,{dot:Boolean,name:[Number,String],badge:[Number,String],title:String,disabled:Boolean,titleClass:unknownProp,titleStyle:[String,Object]}),setup(B,{slots:R}){var F=ref(!1),{parent:D,index:G}=useParent(TABS_KEY);if(!!D){var U=()=>{var Y;return(Y=B.name)!=null?Y:G.value},W=()=>{F.value=!0,D.props.lazyRender&&nextTick(()=>{D.onRendered(U(),B.title)})},q=computed(()=>{var Y=U()===D.currentName.value;return Y&&!F.value&&W(),Y});return watch(()=>B.title,()=>{D.setLine(),D.scrollIntoView()}),provide(TAB_STATUS_KEY,q),()=>{var{animated:Y,swipeable:J,scrollspy:Z,lazyRender:K}=D.props;if(!(!R.default&&!Y)){var te=Z||q.value;if(Y||J)return createVNode(SwipeItem,{role:"tabpanel","aria-hidden":!q.value,class:bem$9("pane-wrapper",{inactive:!q.value})},{default:()=>[createVNode("div",{class:bem$9("pane")},[R.default==null?void 0:R.default()])]});var Q=F.value||Z||!K,ie=Q?R.default==null?void 0:R.default():null;return withDirectives(createVNode("div",{role:"tabpanel",class:bem$9("pane")},[ie]),[[vShow,te]])}}}}}),Tab=withInstall(_Tab),Tabs=withInstall(_Tabs),[name$8,bem$8]=createNamespace("cell-group"),_CellGroup=defineComponent({name:name$8,inheritAttrs:!1,props:{title:String,inset:Boolean,border:truthProp},setup(B,{slots:R,attrs:F}){var D=()=>createVNode("div",mergeProps({class:[bem$8({inset:B.inset}),{[BORDER_TOP_BOTTOM]:B.border&&!B.inset}]},F),[R.default==null?void 0:R.default()]),G=()=>createVNode("div",{class:bem$8("title",{inset:B.inset})},[R.title?R.title():B.title]);return()=>B.title||R.title?createVNode(Fragment,null,[G(),D()]):D()}}),CellGroup=withInstall(_CellGroup),[name$7,bem$7]=createNamespace("row"),ROW_KEY=Symbol(name$7),_Row=defineComponent({name:name$7,props:{wrap:truthProp,align:String,justify:String,tag:{type:String,default:"div"},gutter:{type:[Number,String],default:0}},setup(B,{slots:R}){var{children:F,linkChildren:D}=useChildren(ROW_KEY),G=computed(()=>{var W=[[]],q=0;return F.forEach((Y,J)=>{q+=Number(Y.span),q>24?(W.push([J]),q-=24):W[W.length-1].push(J)}),W}),U=computed(()=>{var W=Number(B.gutter),q=[];return W&&G.value.forEach(Y=>{var J=W*(Y.length-1)/Y.length;Y.forEach((Z,K)=>{if(K===0)q.push({right:J});else{var te=W-q[Z-1].right,Q=J-te;q.push({left:te,right:Q})}})}),q});return D({spaces:U}),()=>{var{tag:W,wrap:q,align:Y,justify:J}=B;return createVNode(W,{class:bem$7({["align-"+Y]:Y,["justify-"+J]:J,nowrap:!q})},{default:()=>[R.default==null?void 0:R.default()]})}}}),[name$6,bem$6]=createNamespace("col"),_Col=defineComponent({name:name$6,props:{offset:[Number,String],tag:{type:String,default:"div"},span:{type:[Number,String],default:0}},setup(B,{slots:R}){var{parent:F,index:D}=useParent(ROW_KEY),G=computed(()=>{if(!!F){var{spaces:U}=F;if(U&&U.value&&U.value[D.value]){var{left:W,right:q}=U.value[D.value];return{paddingLeft:W?W+"px":null,paddingRight:q?q+"px":null}}}});return()=>{var{tag:U,span:W,offset:q}=B;return createVNode(U,{style:G.value,class:bem$6({[W]:W,["offset-"+q]:q})},{default:()=>[R.default==null?void 0:R.default()]})}}}),Col=withInstall(_Col),[name$5,bem$5]=createNamespace("divider"),_Divider=defineComponent({name:name$5,props:{dashed:Boolean,hairline:truthProp,contentPosition:{type:String,default:"center"}},setup(B,{slots:R}){return()=>createVNode("div",{role:"separator",class:bem$5({dashed:B.dashed,hairline:B.hairline,["content-"+B.contentPosition]:!!R.default})},[R.default==null?void 0:R.default()])}}),Divider=withInstall(_Divider),[name$4,bem$4]=createNamespace("grid"),GRID_KEY=Symbol(name$4),props$1={square:Boolean,center:truthProp,border:truthProp,gutter:[Number,String],reverse:Boolean,iconSize:[Number,String],direction:String,clickable:Boolean,columnNum:{type:[Number,String],default:4}},_Grid=defineComponent({name:name$4,props:props$1,setup(B,{slots:R}){var{linkChildren:F}=useChildren(GRID_KEY);return F({props:B}),()=>createVNode("div",{style:{paddingLeft:addUnit(B.gutter)},class:[bem$4(),{[BORDER_TOP]:B.border&&!B.gutter}]},[R.default==null?void 0:R.default()])}}),Grid=withInstall(_Grid),[name$3,bem$3]=createNamespace("grid-item"),_GridItem=defineComponent({name:name$3,props:extend$2({},routeProps,{dot:Boolean,text:String,icon:String,badge:[Number,String],iconPrefix:String,iconColor:String}),setup(B,{slots:R}){var{parent:F,index:D}=useParent(GRID_KEY),G=useRoute();if(!!F){var U=computed(()=>{var{square:Z,gutter:K,columnNum:te}=F.props,Q=100/+te+"%",ie={flexBasis:Q};if(Z)ie.paddingTop=Q;else if(K){var se=addUnit(K);ie.paddingRight=se,D.value>=te&&(ie.marginTop=se)}return ie}),W=computed(()=>{var{square:Z,gutter:K}=F.props;if(Z&&K){var te=addUnit(K);return{right:te,bottom:te,height:"auto"}}}),q=()=>{if(R.icon)return createVNode(Badge,{dot:B.dot,content:B.badge},{default:()=>[R.icon()]});if(B.icon)return createVNode(Icon,{dot:B.dot,name:B.icon,size:F.props.iconSize,badge:B.badge,class:bem$3("icon"),classPrefix:B.iconPrefix,color:B.iconColor},null)},Y=()=>{if(R.text)return R.text();if(B.text)return createVNode("span",{class:bem$3("text")},[B.text])},J=()=>R.default?R.default():[q(),Y()];return()=>{var{center:Z,border:K,square:te,gutter:Q,reverse:ie,direction:se,clickable:ne}=F.props,re=[bem$3("content",[se,{center:Z,square:te,reverse:ie,clickable:ne,surround:K&&Q}]),{[BORDER]:K}];return createVNode("div",{class:[bem$3({square:te})],style:U.value},[createVNode("div",{role:ne?"button":void 0,class:re,style:W.value,tabindex:ne?0:void 0,onClick:G},[J()])])}}}}),GridItem=withInstall(_GridItem),[name$2,bem$2]=createNamespace("notice-bar"),_NoticeBar=defineComponent({name:name$2,props:{text:String,mode:String,color:String,leftIcon:String,wrapable:Boolean,background:String,scrollable:{type:Boolean,default:null},delay:{type:[Number,String],default:1},speed:{type:[Number,String],default:60}},emits:["close","replay"],setup(B,{emit:R,slots:F}){var D=0,G=0,U,W=ref(),q=ref(),Y=reactive({show:!0,offset:0,duration:0}),J=()=>{if(F["left-icon"])return F["left-icon"]();if(B.leftIcon)return createVNode(Icon,{class:bem$2("left-icon"),name:B.leftIcon},null)},Z=()=>{if(B.mode==="closeable")return"cross";if(B.mode==="link")return"arrow"},K=re=>{B.mode==="closeable"&&(Y.show=!1,R("close",re))},te=()=>{if(F["right-icon"])return F["right-icon"]();var re=Z();if(re)return createVNode(Icon,{name:re,class:bem$2("right-icon"),onClick:K},null)},Q=()=>{Y.offset=D,Y.duration=0,raf$2(()=>{doubleRaf(()=>{Y.offset=-G,Y.duration=(G+D)/+B.speed,R("replay")})})},ie=()=>{var re=B.scrollable===!1&&!B.wrapable,ae={transform:Y.offset?"translateX("+Y.offset+"px)":"",transitionDuration:Y.duration+"s"};return createVNode("div",{ref:W,role:"marquee",class:bem$2("wrap")},[createVNode("div",{ref:q,style:ae,class:[bem$2("content"),{"van-ellipsis":re}],onTransitionend:Q},[F.default?F.default():B.text])])},se=()=>{D=0,G=0,Y.offset=0,Y.duration=0},ne=()=>{var{delay:re,speed:ae,scrollable:ce}=B,he=isDef$1(re)?+re*1e3:0;se(),clearTimeout(U),U=setTimeout(()=>{if(!(!W.value||!q.value||ce===!1)){var fe=useRect(W).width,be=useRect(q).width;(ce||be>fe)&&doubleRaf(()=>{D=fe,G=be,Y.offset=-G,Y.duration=G/+ae})}},he)};return onPopupReopen(ne),onMountedOrActivated(ne),useEventListener("pageshow",ne),watch(()=>[B.text,B.scrollable],ne),()=>{var{color:re,wrapable:ae,background:ce}=B;return withDirectives(createVNode("div",{role:"alert",class:bem$2({wrapable:ae}),style:{color:re,background:ce}},[J(),ie(),te()]),[[vShow,Y.show]])}}}),NoticeBar=withInstall(_NoticeBar);function getBoundingClientRect(B){var R=B.getBoundingClientRect();return{width:R.width,height:R.height,top:R.top,right:R.right,bottom:R.bottom,left:R.left,x:R.left,y:R.top}}function getWindow(B){if(B==null)return window;if(B.toString()!=="[object Window]"){var R=B.ownerDocument;return R&&R.defaultView||window}return B}function getWindowScroll(B){var R=getWindow(B),F=R.pageXOffset,D=R.pageYOffset;return{scrollLeft:F,scrollTop:D}}function isElement(B){var R=getWindow(B).Element;return B instanceof R||B instanceof Element}function isHTMLElement(B){var R=getWindow(B).HTMLElement;return B instanceof R||B instanceof HTMLElement}function isShadowRoot(B){if(typeof ShadowRoot=="undefined")return!1;var R=getWindow(B).ShadowRoot;return B instanceof R||B instanceof ShadowRoot}function getHTMLElementScroll(B){return{scrollLeft:B.scrollLeft,scrollTop:B.scrollTop}}function getNodeScroll(B){return B===getWindow(B)||!isHTMLElement(B)?getWindowScroll(B):getHTMLElementScroll(B)}function getNodeName(B){return B?(B.nodeName||"").toLowerCase():null}function getDocumentElement(B){return((isElement(B)?B.ownerDocument:B.document)||window.document).documentElement}function getWindowScrollBarX(B){return getBoundingClientRect(getDocumentElement(B)).left+getWindowScroll(B).scrollLeft}function getComputedStyle(B){return getWindow(B).getComputedStyle(B)}function isScrollParent(B){var R=getComputedStyle(B),F=R.overflow,D=R.overflowX,G=R.overflowY;return/auto|scroll|overlay|hidden/.test(F+G+D)}function getCompositeRect(B,R,F){F===void 0&&(F=!1);var D=getDocumentElement(R),G=getBoundingClientRect(B),U=isHTMLElement(R),W={scrollLeft:0,scrollTop:0},q={x:0,y:0};return(U||!U&&!F)&&((getNodeName(R)!=="body"||isScrollParent(D))&&(W=getNodeScroll(R)),isHTMLElement(R)?(q=getBoundingClientRect(R),q.x+=R.clientLeft,q.y+=R.clientTop):D&&(q.x=getWindowScrollBarX(D))),{x:G.left+W.scrollLeft-q.x,y:G.top+W.scrollTop-q.y,width:G.width,height:G.height}}function getLayoutRect(B){var R=getBoundingClientRect(B),F=B.offsetWidth,D=B.offsetHeight;return Math.abs(R.width-F)<=1&&(F=R.width),Math.abs(R.height-D)<=1&&(D=R.height),{x:B.offsetLeft,y:B.offsetTop,width:F,height:D}}function getParentNode(B){return getNodeName(B)==="html"?B:B.assignedSlot||B.parentNode||(isShadowRoot(B)?B.host:null)||getDocumentElement(B)}function getScrollParent(B){return["html","body","#document"].indexOf(getNodeName(B))>=0?B.ownerDocument.body:isHTMLElement(B)&&isScrollParent(B)?B:getScrollParent(getParentNode(B))}function listScrollParents(B,R){var F;R===void 0&&(R=[]);var D=getScrollParent(B),G=D===((F=B.ownerDocument)==null?void 0:F.body),U=getWindow(D),W=G?[U].concat(U.visualViewport||[],isScrollParent(D)?D:[]):D,q=R.concat(W);return G?q:q.concat(listScrollParents(getParentNode(W)))}function isTableElement(B){return["table","td","th"].indexOf(getNodeName(B))>=0}function getTrueOffsetParent(B){return!isHTMLElement(B)||getComputedStyle(B).position==="fixed"?null:B.offsetParent}function getContainingBlock(B){var R=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,F=navigator.userAgent.indexOf("Trident")!==-1;if(F&&isHTMLElement(B)){var D=getComputedStyle(B);if(D.position==="fixed")return null}for(var G=getParentNode(B);isHTMLElement(G)&&["html","body"].indexOf(getNodeName(G))<0;){var U=getComputedStyle(G);if(U.transform!=="none"||U.perspective!=="none"||U.contain==="paint"||["transform","perspective"].indexOf(U.willChange)!==-1||R&&U.willChange==="filter"||R&&U.filter&&U.filter!=="none")return G;G=G.parentNode}return null}function getOffsetParent(B){for(var R=getWindow(B),F=getTrueOffsetParent(B);F&&isTableElement(F)&&getComputedStyle(F).position==="static";)F=getTrueOffsetParent(F);return F&&(getNodeName(F)==="html"||getNodeName(F)==="body"&&getComputedStyle(F).position==="static")?R:F||getContainingBlock(B)||R}var top$1="top",bottom$1="bottom",right="right",left$1="left",auto="auto",basePlacements=[top$1,bottom$1,right,left$1],start$4="start",end="end",placements=[].concat(basePlacements,[auto]).reduce(function(B,R){return B.concat([R,R+"-"+start$4,R+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function order(B){var R=new Map,F=new Set,D=[];B.forEach(function(U){R.set(U.name,U)});function G(U){F.add(U.name);var W=[].concat(U.requires||[],U.requiresIfExists||[]);W.forEach(function(q){if(!F.has(q)){var Y=R.get(q);Y&&G(Y)}}),D.push(U)}return B.forEach(function(U){F.has(U.name)||G(U)}),D}function orderModifiers(B){var R=order(B);return modifierPhases.reduce(function(F,D){return F.concat(R.filter(function(G){return G.phase===D}))},[])}function debounce(B){var R;return function(){return R||(R=new Promise(function(F){Promise.resolve().then(function(){R=void 0,F(B())})})),R}}function getBasePlacement(B){return B.split("-")[0]}function mergeByName(B){var R=B.reduce(function(F,D){var G=F[D.name];return F[D.name]=G?Object.assign({},G,D,{options:Object.assign({},G.options,D.options),data:Object.assign({},G.data,D.data)}):D,F},{});return Object.keys(R).map(function(F){return R[F]})}var round=Math.round;function getVariation(B){return B.split("-")[1]}function getMainAxisFromPlacement(B){return["top","bottom"].indexOf(B)>=0?"x":"y"}function computeOffsets(B){var R=B.reference,F=B.element,D=B.placement,G=D?getBasePlacement(D):null,U=D?getVariation(D):null,W=R.x+R.width/2-F.width/2,q=R.y+R.height/2-F.height/2,Y;switch(G){case top$1:Y={x:W,y:R.y-F.height};break;case bottom$1:Y={x:W,y:R.y+R.height};break;case right:Y={x:R.x+R.width,y:q};break;case left$1:Y={x:R.x-F.width,y:q};break;default:Y={x:R.x,y:R.y}}var J=G?getMainAxisFromPlacement(G):null;if(J!=null){var Z=J==="y"?"height":"width";switch(U){case start$4:Y[J]=Y[J]-(R[Z]/2-F[Z]/2);break;case end:Y[J]=Y[J]+(R[Z]/2-F[Z]/2);break}}return Y}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var B=arguments.length,R=new Array(B),F=0;F=0?-1:1,U=typeof F=="function"?F(Object.assign({},R,{placement:B})):F,W=U[0],q=U[1];return W=W||0,q=(q||0)*G,[left$1,right].indexOf(D)>=0?{x:q,y:W}:{x:W,y:q}}function offset(B){var R=B.state,F=B.options,D=B.name,G=F.offset,U=G===void 0?[0,0]:G,W=placements.reduce(function(Z,K){return Z[K]=distanceAndSkiddingToXY(K,R.rects,U),Z},{}),q=W[R.placement],Y=q.x,J=q.y;R.modifiersData.popperOffsets!=null&&(R.modifiersData.popperOffsets.x+=Y,R.modifiersData.popperOffsets.y+=J),R.modifiersData[D]=W}var offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset},[name$1,bem$1]=createNamespace("popover"),popupProps=["show","overlay","duration","teleport","overlayStyle","overlayClass","closeOnClickOverlay"],_Popover=defineComponent({name:name$1,props:{show:Boolean,overlay:Boolean,duration:[Number,String],iconPrefix:String,overlayClass:unknownProp,overlayStyle:Object,closeOnClickAction:truthProp,closeOnClickOverlay:truthProp,closeOnClickOutside:truthProp,offset:{type:Array,default:()=>[0,8]},theme:{type:String,default:"light"},trigger:{type:String,default:"click"},actions:{type:Array,default:()=>[]},placement:{type:String,default:"bottom"},teleport:{type:[String,Object],default:"body"}},emits:["select","touchstart","update:show"],setup(B,{emit:R,slots:F,attrs:D}){var G,U=ref(),W=ref(),q=()=>createPopper(U.value,W.value.popupRef.value,{placement:B.placement,modifiers:[{name:"computeStyles",options:{adaptive:!1,gpuAcceleration:!1}},extend$2({},offset$1,{options:{offset:B.offset}})]}),Y=()=>{nextTick(()=>{!B.show||(G?G.setOptions({placement:B.placement}):G=q())})},J=se=>R("update:show",se),Z=()=>{B.trigger==="click"&&J(!B.show)},K=se=>{se.stopPropagation(),R("touchstart",se)},te=(se,ne)=>{se.disabled||(R("select",se,ne),B.closeOnClickAction&&J(!1))},Q=()=>{B.closeOnClickOutside&&(!B.overlay||B.closeOnClickOverlay)&&J(!1)},ie=(se,ne)=>{var{icon:re,text:ae,color:ce,disabled:he,className:fe}=se;return createVNode("div",{role:"menuitem",class:[bem$1("action",{disabled:he,"with-icon":re}),fe],style:{color:ce},onClick:()=>te(se,ne)},[re&&createVNode(Icon,{name:re,classPrefix:B.iconPrefix,class:bem$1("action-icon")},null),createVNode("div",{class:[bem$1("action-text"),BORDER_BOTTOM]},[ae])])};return onMounted(Y),onBeforeUnmount(()=>{G&&(G.destroy(),G=null)}),watch(()=>[B.show,B.placement],Y),useClickAway(U,Q,{eventName:"touchstart"}),()=>createVNode(Fragment,null,[createVNode("span",{ref:U,class:bem$1("wrapper"),onClick:Z},[F.reference==null?void 0:F.reference()]),createVNode(Popup,mergeProps({ref:W,class:bem$1([B.theme]),position:"",transition:"van-popover-zoom",lockScroll:!1,onTouchstart:K},D,pick(B,popupProps),{"onUpdate:show":J}),{default:()=>[createVNode("div",{class:bem$1("arrow")},null),createVNode("div",{role:"menu",class:bem$1("content")},[F.default?F.default():B.actions.map(ie)])]})])}}),Popover=withInstall(_Popover),Row=withInstall(_Row),[name,bem]=createNamespace("slider"),_Slider=defineComponent({name,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(B,{emit:R,slots:F}){var D,G,U,W=ref(),q=ref(),Y=useTouch(),J=computed(()=>Number(B.max)-Number(B.min)),Z=computed(()=>{var ge=B.vertical?"width":"height";return{background:B.inactiveColor,[ge]:addUnit(B.barHeight)}}),K=ge=>!!B.range&&Array.isArray(ge),te=()=>{var{modelValue:ge,min:ve}=B;return K(ge)?(ge[1]-ge[0])*100/J.value+"%":(ge-Number(ve))*100/J.value+"%"},Q=()=>{var{modelValue:ge,min:ve}=B;return K(ge)?(ge[0]-Number(ve))*100/J.value+"%":"0%"},ie=computed(()=>{var ge=B.vertical?"height":"width";return{[ge]:te(),left:B.vertical?void 0:Q(),top:B.vertical?Q():void 0,background:B.activeColor,transition:q.value?"none":void 0}}),se=ge=>{var ve=+B.min,Se=+B.max,pe=+B.step;ge=clamp(ge,ve,Se);var ye=Math.round((ge-ve)/pe)*pe;return addNumber(ve,ye)},ne=(ge,ve)=>JSON.stringify(ge)===JSON.stringify(ve),re=ge=>ge[0]>ge[1]?ge.slice(0).reverse():ge,ae=(ge,ve)=>{K(ge)?ge=re(ge).map(se):ge=se(ge),ne(ge,B.modelValue)||R("update:modelValue",ge),ve&&!ne(ge,G)&&R("change",ge)},ce=ge=>{if(ge.stopPropagation(),!(B.disabled||B.readonly)){var{min:ve,vertical:Se,modelValue:pe}=B,ye=useRect(W),Ee=Se?ge.clientY-ye.top:ge.clientX-ye.left,de=Se?ye.height:ye.width,we=Number(ve)+Ee/de*J.value;if(K(pe)){var[Oe,Me]=pe,Pe=(Oe+Me)/2;we<=Pe?ae([we,Me],!0):ae([Oe,we],!0)}else ae(we,!0)}},he=ge=>{B.disabled||B.readonly||(Y.start(ge),U=B.modelValue,K(U)?G=U.map(se):G=se(U),q.value="start")},fe=ge=>{if(!(B.disabled||B.readonly)){q.value==="start"&&R("drag-start"),preventDefault(ge,!0),Y.move(ge),q.value="draging";var ve=useRect(W),Se=B.vertical?Y.deltaY.value:Y.deltaX.value,pe=B.vertical?ve.height:ve.width,ye=Se/pe*J.value;K(G)?U[D]=G[D]+ye:U=G+ye,ae(U)}},be=()=>{B.disabled||B.readonly||(q.value==="draging"&&(ae(U,!0),R("drag-end")),q.value="")},ue=ge=>{var ve=()=>{if(typeof ge=="number"){var pe=["left","right"];return"button-wrapper-"+pe[ge]}return"button-wrapper"},Se=typeof ge=="number"?B.modelValue[ge]:B.modelValue;return createVNode("div",{role:"slider",class:bem(ve()),tabindex:B.disabled||B.readonly?-1:0,"aria-valuemin":+B.min,"aria-valuenow":Se,"aria-valuemax":+B.max,"aria-orientation":B.vertical?"vertical":"horizontal",onTouchstart:pe=>{typeof ge=="number"&&(D=ge),he(pe)},onTouchmove:fe,onTouchend:be,onTouchcancel:be,onClick:stopPropagation},[F.button?F.button():createVNode("div",{class:bem("button"),style:getSizeStyle(B.buttonSize)},null)])};return ae(B.modelValue),useLinkField(()=>B.modelValue),()=>createVNode("div",{ref:W,style:Z.value,class:bem({vertical:B.vertical,disabled:B.disabled}),onClick:ce},[createVNode("div",{class:bem("bar"),style:ie.value},[B.range?[ue(0),ue(1)]:ue()])])}}),Slider=withInstall(_Slider);const state$2=reactive({sectionStatus:!1,maskStatus:!1,section:[],times:[],timesById:{},sectionBoundingBoxs:[],activeTick:-1,activeTickRepeat:1,showTick:!1,isSpecialShapedScreen:!1,notchHeight:0,fixedKey:0,renderLoading:!1,evaluatings:{},isPauseRecording:!1,feeShow:!1,vipShow:!1,mode:"contact",subjectId:0,activeSpeed:90,baseSpeed:90,activeDetail:null,needTick:!1,skipTick:!1,repeatedBeats:!0,sectionFlash:!1,befireSection:null,isPercussion:!1,enableEvaluation:!0,isAppPlay:!1,partListNames:[],partIndex:0,midiPlayIniting:!1,isSpecialBookCategory:!1,code:"",frozenMode:!1,initRendered:!1,setting:null,activeNote:"",freeRate:.1,zoom:1,renderType:"native"});let toastItem=null;watchEffect(()=>{const B={};for(const R of state$2.times)R.id&&(B[R.id]=R);state$2.timesById=B,state$2.subjectId>0&&(state$2.isPercussion=state$2.subjectId==23||state$2.subjectId==113),state$2.renderLoading?toastItem=Toast({duration:0,message:"\u52A0\u8F7D\u4E2D..."}):toastItem&&(toastItem.close(),toastItem=null)});var lodash={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */(function(B,R){(function(){var F,D="4.17.21",G=200,U="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",W="Expected a function",q="Invalid `variable` option passed into `_.template`",Y="__lodash_hash_undefined__",J=500,Z="__lodash_placeholder__",K=1,te=2,Q=4,ie=1,se=2,ne=1,re=2,ae=4,ce=8,he=16,fe=32,be=64,ue=128,ge=256,ve=512,Se=30,pe="...",ye=800,Ee=16,de=1,we=2,Oe=3,Me=1/0,Pe=9007199254740991,Ne=17976931348623157e292,ke=0/0,Ae=4294967295,_e=Ae-1,Fe=Ae>>>1,Ye=[["ary",ue],["bind",ne],["bindKey",re],["curry",ce],["curryRight",he],["flip",ve],["partial",fe],["partialRight",be],["rearg",ge]],Ce="[object Arguments]",Ge="[object Array]",We="[object AsyncFunction]",Ve="[object Boolean]",Ze="[object Date]",nt="[object DOMException]",at="[object Error]",ct="[object Function]",De="[object GeneratorFunction]",xe="[object Map]",ze="[object Number]",qe="[object Null]",Re="[object Object]",Le="[object Promise]",je="[object Proxy]",Xe="[object RegExp]",Qe="[object Set]",He="[object String]",tt="[object Symbol]",ot="[object Undefined]",rt="[object WeakMap]",ft="[object WeakSet]",St="[object ArrayBuffer]",lt="[object DataView]",vt="[object Float32Array]",Et="[object Float64Array]",Lt="[object Int8Array]",Qt="[object Int16Array]",Dt="[object Int32Array]",qt="[object Uint8Array]",ei="[object Uint8ClampedArray]",gt="[object Uint16Array]",Wt="[object Uint32Array]",ri=/\b__p \+= '';/g,ti=/\b(__p \+=) '' \+/g,zi=/(__e\(.*?\)|\b__t\)) \+\n'';/g,vi=/&(?:amp|lt|gt|quot|#39);/g,jt=/[&<>"']/g,Ji=RegExp(vi.source),ln=RegExp(jt.source),cn=/<%-([\s\S]+?)%>/g,es=/<%([\s\S]+?)%>/g,Zi=/<%=([\s\S]+?)%>/g,Ui=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,mn=/^\w*$/,Pi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,un=/[\\^$.*+?()[\]{}|]/g,ws=RegExp(un.source),Pn=/^\s+/,ts=/\s/,gi=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Si=/\{\n\/\* \[wrapped with (.+)\] \*/,is=/,? & /,Wi=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Gt=/[()=,{}\[\]\/\s]/,ns=/\\(\\)?/g,Bn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ss=/\w*$/,Ts=/^[-+]0x[0-9a-f]+$/i,Bi=/^0b[01]+$/i,Ps=/^\[object .+?Constructor\]$/,no=/^0o[0-7]+$/i,so=/^(?:0|[1-9]\d*)$/,ro=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,rs=/($^)/,Qi=/['\n\r\u2028\u2029\\]/g,os="\\ud800-\\udfff",oo="\\u0300-\\u036f",ao="\\ufe20-\\ufe2f",lo="\\u20d0-\\u20ff",Ys=oo+ao+lo,Dn="\\u2700-\\u27bf",Xs="a-z\\xdf-\\xf6\\xf8-\\xff",co="\\xac\\xb1\\xd7\\xf7",en="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",uo="\\u2000-\\u206f",ho=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ks="A-Z\\xc0-\\xd6\\xd8-\\xde",Js="\\ufe0e\\ufe0f",Zs=co+en+uo+ho,As="['\u2019]",as="["+os+"]",Qs="["+Zs+"]",ls="["+Ys+"]",er="\\d+",tr="["+Dn+"]",ir="["+Xs+"]",nr="[^"+os+Zs+er+Dn+Xs+Ks+"]",On="\\ud83c[\\udffb-\\udfff]",fo="(?:"+ls+"|"+On+")",sr="[^"+os+"]",Ms="(?:\\ud83c[\\udde6-\\uddff]){2}",Cs="[\\ud800-\\udbff][\\udc00-\\udfff]",An="["+Ks+"]",rr="\\u200d",or="(?:"+ir+"|"+nr+")",po="(?:"+An+"|"+nr+")",ar="(?:"+As+"(?:d|ll|m|re|s|t|ve))?",lr="(?:"+As+"(?:D|LL|M|RE|S|T|VE))?",Is=fo+"?",cr="["+Js+"]?",ur="(?:"+rr+"(?:"+[sr,Ms,Cs].join("|")+")"+cr+Is+")*",mo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",go="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Vn=cr+Is+ur,bo="(?:"+[tr,Ms,Cs].join("|")+")"+Vn,Mn="(?:"+[sr+ls+"?",ls,Ms,Cs,as].join("|")+")",hn=RegExp(As,"g"),yo=RegExp(ls,"g"),cs=RegExp(On+"(?="+On+")|"+Mn+Vn,"g"),us=RegExp([An+"?"+ir+"+"+ar+"(?="+[Qs,An,"$"].join("|")+")",po+"+"+lr+"(?="+[Qs,An+or,"$"].join("|")+")",An+"?"+or+"+"+ar,An+"+"+lr,go,mo,er,bo].join("|"),"g"),vo=RegExp("["+rr+os+Ys+Js+"]"),So=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,xo=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],hr=-1,Kt={};Kt[vt]=Kt[Et]=Kt[Lt]=Kt[Qt]=Kt[Dt]=Kt[qt]=Kt[ei]=Kt[gt]=Kt[Wt]=!0,Kt[Ce]=Kt[Ge]=Kt[St]=Kt[Ve]=Kt[lt]=Kt[Ze]=Kt[at]=Kt[ct]=Kt[xe]=Kt[ze]=Kt[Re]=Kt[Xe]=Kt[Qe]=Kt[He]=Kt[rt]=!1;var Jt={};Jt[Ce]=Jt[Ge]=Jt[St]=Jt[lt]=Jt[Ve]=Jt[Ze]=Jt[vt]=Jt[Et]=Jt[Lt]=Jt[Qt]=Jt[Dt]=Jt[xe]=Jt[ze]=Jt[Re]=Jt[Xe]=Jt[Qe]=Jt[He]=Jt[tt]=Jt[qt]=Jt[ei]=Jt[gt]=Jt[Wt]=!0,Jt[at]=Jt[ct]=Jt[rt]=!1;var hs={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},gn={"&":"&","<":"<",">":">",'"':""","'":"'"},Ls={"&":"&","<":"<",">":">",""":'"',"'":"'"},fr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},dr=parseFloat,tn=parseInt,Ns=typeof commonjsGlobal$1=="object"&&commonjsGlobal$1&&commonjsGlobal$1.Object===Object&&commonjsGlobal$1,_o=typeof self=="object"&&self&&self.Object===Object&&self,oi=Ns||_o||Function("return this")(),$n=R&&!R.nodeType&&R,Ai=$n&&!0&&B&&!B.nodeType&&B,Gn=Ai&&Ai.exports===$n,zn=Gn&&Ns.process,xi=function(){try{var it=Ai&&Ai.require&&Ai.require("util").types;return it||zn&&zn.binding&&zn.binding("util")}catch{}}(),pr=xi&&xi.isArrayBuffer,mr=xi&&xi.isDate,gr=xi&&xi.isMap,Un=xi&&xi.isRegExp,br=xi&&xi.isSet,yr=xi&&xi.isTypedArray;function _i(it,dt,ut){switch(ut.length){case 0:return it.call(dt);case 1:return it.call(dt,ut[0]);case 2:return it.call(dt,ut[0],ut[1]);case 3:return it.call(dt,ut[0],ut[1],ut[2])}return it.apply(dt,ut)}function Be(it,dt,ut,_t){for(var Nt=-1,Ht=it==null?0:it.length;++Nt-1}function Vt(it,dt,ut){for(var _t=-1,Nt=it==null?0:it.length;++_t-1;);return ut}function Pa(it,dt){for(var ut=it.length;ut--&&Li(dt,it[ut],0)>-1;);return ut}function wc(it,dt){for(var ut=it.length,_t=0;ut--;)it[ut]===dt&&++_t;return _t}var Tc=wo(hs),Pc=wo(gn);function Ac(it){return"\\"+fr[it]}function Mc(it,dt){return it==null?F:it[dt]}function fs(it){return vo.test(it)}function Cc(it){return So.test(it)}function Ic(it){for(var dt,ut=[];!(dt=it.next()).done;)ut.push(dt.value);return ut}function Mo(it){var dt=-1,ut=Array(it.size);return it.forEach(function(_t,Nt){ut[++dt]=[Nt,_t]}),ut}function Aa(it,dt){return function(ut){return it(dt(ut))}}function Cn(it,dt){for(var ut=-1,_t=it.length,Nt=0,Ht=[];++ut<_t;){var ui=it[ut];(ui===dt||ui===Z)&&(it[ut]=Z,Ht[Nt++]=ut)}return Ht}function Sr(it){var dt=-1,ut=Array(it.size);return it.forEach(function(_t){ut[++dt]=_t}),ut}function Lc(it){var dt=-1,ut=Array(it.size);return it.forEach(function(_t){ut[++dt]=[_t,_t]}),ut}function Nc(it,dt,ut){for(var _t=ut-1,Nt=it.length;++_t-1}function bu(oe,le){var me=this.__data__,Te=Fr(me,oe);return Te<0?(++this.size,me.push([oe,le])):me[Te][1]=le,this}bn.prototype.clear=du,bn.prototype.delete=pu,bn.prototype.get=mu,bn.prototype.has=gu,bn.prototype.set=bu;function yn(oe){var le=-1,me=oe==null?0:oe.length;for(this.clear();++le=le?oe:le)),oe}function ji(oe,le,me,Te,Ie,Ue){var Je,et=le&K,st=le&te,pt=le&Q;if(me&&(Je=Ie?me(oe,Te,Ie,Ue):me(oe)),Je!==F)return Je;if(!ii(oe))return oe;var mt=Rt(oe);if(mt){if(Je=xh(oe),!et)return Ni(oe,Je)}else{var bt=yi(oe),xt=bt==ct||bt==De;if(Fn(oe))return ul(oe,et);if(bt==Re||bt==Ce||xt&&!Ie){if(Je=st||xt?{}:Cl(oe),!et)return st?uh(oe,Ru(Je,oe)):ch(oe,Va(Je,oe))}else{if(!Jt[bt])return Ie?oe:{};Je=_h(oe,bt,et)}}Ue||(Ue=new rn);var Tt=Ue.get(oe);if(Tt)return Tt;Ue.set(oe,Je),sc(oe)?oe.forEach(function(It){Je.add(ji(It,le,me,It,oe,Ue))}):ic(oe)&&oe.forEach(function(It,Ot){Je.set(Ot,ji(It,le,me,Ot,oe,Ue))});var Ct=pt?st?ea:Qo:st?ki:di,Ft=mt?F:Ct(oe);return Ke(Ft||oe,function(It,Ot){Ft&&(Ot=It,It=oe[Ot]),Vs(Je,Ot,ji(It,le,me,Ot,oe,Ue))}),Je}function ku(oe){var le=di(oe);return function(me){return $a(me,oe,le)}}function $a(oe,le,me){var Te=me.length;if(oe==null)return!Te;for(oe=Zt(oe);Te--;){var Ie=me[Te],Ue=le[Ie],Je=oe[Ie];if(Je===F&&!(Ie in oe)||!Ue(Je))return!1}return!0}function Ga(oe,le,me){if(typeof oe!="function")throw new Hi(W);return qs(function(){oe.apply(F,me)},le)}function $s(oe,le,me,Te){var Ie=-1,Ue=wt,Je=!0,et=oe.length,st=[],pt=le.length;if(!et)return st;me&&(le=At(le,Di(me))),Te?(Ue=Vt,Je=!1):le.length>=G&&(Ue=Rs,Je=!1,le=new Yn(le));e:for(;++IeIe?0:Ie+me),Te=Te===F||Te>Ie?Ie:kt(Te),Te<0&&(Te+=Ie),Te=me>Te?0:oc(Te);me0&&me(et)?le>1?mi(et,le-1,me,Te,Ie):Ut(Ie,et):Te||(Ie[Ie.length]=et)}return Ie}var Fo=gl(),Wa=gl(!0);function fn(oe,le){return oe&&Fo(oe,le,di)}function Bo(oe,le){return oe&&Wa(oe,le,di)}function Dr(oe,le){return Pt(le,function(me){return En(oe[me])})}function Kn(oe,le){le=Rn(le,oe);for(var me=0,Te=le.length;oe!=null&&mele}function Du(oe,le){return oe!=null&&Xt.call(oe,le)}function Ou(oe,le){return oe!=null&&le in Zt(oe)}function Vu(oe,le,me){return oe>=bi(le,me)&&oe=120&&mt.length>=120)?new Yn(Je&&mt):F}mt=oe[0];var bt=-1,xt=et[0];e:for(;++bt-1;)et!==oe&&Mr.call(et,st,1),Mr.call(oe,st,1);return oe}function il(oe,le){for(var me=oe?le.length:0,Te=me-1;me--;){var Ie=le[me];if(me==Te||Ie!==Ue){var Ue=Ie;_n(Ie)?Mr.call(oe,Ie,1):qo(oe,Ie)}}return oe}function Uo(oe,le){return oe+Lr(Fa()*(le-oe+1))}function Zu(oe,le,me,Te){for(var Ie=-1,Ue=hi(Ir((le-oe)/(me||1)),0),Je=ut(Ue);Ue--;)Je[Te?Ue:++Ie]=oe,oe+=me;return Je}function Wo(oe,le){var me="";if(!oe||le<1||le>Pe)return me;do le%2&&(me+=oe),le=Lr(le/2),le&&(oe+=oe);while(le);return me}function Bt(oe,le){return aa(Nl(oe,le,Fi),oe+"")}function Qu(oe){return Oa(Es(oe))}function eh(oe,le){var me=Es(oe);return Yr(me,Xn(le,0,me.length))}function Us(oe,le,me,Te){if(!ii(oe))return oe;le=Rn(le,oe);for(var Ie=-1,Ue=le.length,Je=Ue-1,et=oe;et!=null&&++IeIe?0:Ie+le),me=me>Ie?Ie:me,me<0&&(me+=Ie),Ie=le>me?0:me-le>>>0,le>>>=0;for(var Ue=ut(Ie);++Te>>1,Je=oe[Ue];Je!==null&&!Vi(Je)&&(me?Je<=le:Je=G){var pt=le?null:ph(oe);if(pt)return Sr(pt);Je=!1,Ie=Rs,st=new Yn}else st=le?[]:et;e:for(;++Te=Te?oe:Yi(oe,le,me)}var cl=Hc||function(oe){return oi.clearTimeout(oe)};function ul(oe,le){if(le)return oe.slice();var me=oe.length,Te=Ia?Ia(me):new oe.constructor(me);return oe.copy(Te),Te}function Ko(oe){var le=new oe.constructor(oe.byteLength);return new Pr(le).set(new Pr(oe)),le}function rh(oe,le){var me=le?Ko(oe.buffer):oe.buffer;return new oe.constructor(me,oe.byteOffset,oe.byteLength)}function oh(oe){var le=new oe.constructor(oe.source,ss.exec(oe));return le.lastIndex=oe.lastIndex,le}function ah(oe){return Os?Zt(Os.call(oe)):{}}function hl(oe,le){var me=le?Ko(oe.buffer):oe.buffer;return new oe.constructor(me,oe.byteOffset,oe.length)}function fl(oe,le){if(oe!==le){var me=oe!==F,Te=oe===null,Ie=oe===oe,Ue=Vi(oe),Je=le!==F,et=le===null,st=le===le,pt=Vi(le);if(!et&&!pt&&!Ue&&oe>le||Ue&&Je&&st&&!et&&!pt||Te&&Je&&st||!me&&st||!Ie)return 1;if(!Te&&!Ue&&!pt&&oe=et)return st;var pt=me[Te];return st*(pt=="desc"?-1:1)}}return oe.index-le.index}function dl(oe,le,me,Te){for(var Ie=-1,Ue=oe.length,Je=me.length,et=-1,st=le.length,pt=hi(Ue-Je,0),mt=ut(st+pt),bt=!Te;++et1?me[Ie-1]:F,Je=Ie>2?me[2]:F;for(Ue=oe.length>3&&typeof Ue=="function"?(Ie--,Ue):F,Je&&wi(me[0],me[1],Je)&&(Ue=Ie<3?F:Ue,Ie=1),le=Zt(le);++Te-1?Ie[Ue?le[Je]:Je]:F}}function vl(oe){return xn(function(le){var me=le.length,Te=me,Ie=qi.prototype.thru;for(oe&&le.reverse();Te--;){var Ue=le[Te];if(typeof Ue!="function")throw new Hi(W);if(Ie&&!Je&&qr(Ue)=="wrapper")var Je=new qi([],!0)}for(Te=Je?Te:me;++Te1&&zt.reverse(),mt&&stet))return!1;var pt=Ue.get(oe),mt=Ue.get(le);if(pt&&mt)return pt==le&&mt==oe;var bt=-1,xt=!0,Tt=me&se?new Yn:F;for(Ue.set(oe,le),Ue.set(le,oe);++bt1?"& ":"")+le[Te],le=le.join(me>2?", ":" "),oe.replace(gi,`{ /* [wrapped with `+le+`] */ `)}function wh(oe){return Rt(oe)||Qn(oe)||!!(Ra&&oe&&oe[Ra])}function _n(oe,le){var me=typeof oe;return le=le==null?Pe:le,!!le&&(me=="number"||me!="symbol"&&so.test(oe))&&oe>-1&&oe%1==0&&oe0){if(++le>=ye)return arguments[0]}else le=0;return oe.apply(F,arguments)}}function Yr(oe,le){var me=-1,Te=oe.length,Ie=Te-1;for(le=le===F?Te:le;++me1?oe[le-1]:F;return me=typeof me=="function"?(oe.pop(),me):F,Wl(oe,me)});function Hl(oe){var le=$e(oe);return le.__chain__=!0,le}function Bf(oe,le){return le(oe),oe}function Xr(oe,le){return le(oe)}var Df=xn(function(oe){var le=oe.length,me=le?oe[0]:0,Te=this.__wrapped__,Ie=function(Ue){return ko(Ue,oe)};return le>1||this.__actions__.length||!(Te instanceof $t)||!_n(me)?this.thru(Ie):(Te=Te.slice(me,+me+(le?1:0)),Te.__actions__.push({func:Xr,args:[Ie],thisArg:F}),new qi(Te,this.__chain__).thru(function(Ue){return le&&!Ue.length&&Ue.push(F),Ue}))});function Of(){return Hl(this)}function Vf(){return new qi(this.value(),this.__chain__)}function $f(){this.__values__===F&&(this.__values__=rc(this.value()));var oe=this.__index__>=this.__values__.length,le=oe?F:this.__values__[this.__index__++];return{done:oe,value:le}}function Gf(){return this}function zf(oe){for(var le,me=this;me instanceof kr;){var Te=Ol(me);Te.__index__=0,Te.__values__=F,le?Ie.__wrapped__=Te:le=Te;var Ie=Te;me=me.__wrapped__}return Ie.__wrapped__=oe,le}function Uf(){var oe=this.__wrapped__;if(oe instanceof $t){var le=oe;return this.__actions__.length&&(le=new $t(this)),le=le.reverse(),le.__actions__.push({func:Xr,args:[la],thisArg:F}),new qi(le,this.__chain__)}return this.thru(la)}function Wf(){return al(this.__wrapped__,this.__actions__)}var Hf=Gr(function(oe,le,me){Xt.call(oe,me)?++oe[me]:vn(oe,me,1)});function qf(oe,le,me){var Te=Rt(oe)?yt:Fu;return me&&wi(oe,le,me)&&(le=F),Te(oe,Mt(le,3))}function jf(oe,le){var me=Rt(oe)?Pt:Ua;return me(oe,Mt(le,3))}var Yf=yl(Vl),Xf=yl($l);function Kf(oe,le){return mi(Kr(oe,le),1)}function Jf(oe,le){return mi(Kr(oe,le),Me)}function Zf(oe,le,me){return me=me===F?1:kt(me),mi(Kr(oe,le),me)}function ql(oe,le){var me=Rt(oe)?Ke:Ln;return me(oe,Mt(le,3))}function jl(oe,le){var me=Rt(oe)?ht:za;return me(oe,Mt(le,3))}var Qf=Gr(function(oe,le,me){Xt.call(oe,me)?oe[me].push(le):vn(oe,me,[le])});function ed(oe,le,me,Te){oe=Ri(oe)?oe:Es(oe),me=me&&!Te?kt(me):0;var Ie=oe.length;return me<0&&(me=hi(Ie+me,0)),to(oe)?me<=Ie&&oe.indexOf(le,me)>-1:!!Ie&&Li(oe,le,me)>-1}var td=Bt(function(oe,le,me){var Te=-1,Ie=typeof le=="function",Ue=Ri(oe)?ut(oe.length):[];return Ln(oe,function(Je){Ue[++Te]=Ie?_i(le,Je,me):Gs(Je,le,me)}),Ue}),nd=Gr(function(oe,le,me){vn(oe,me,le)});function Kr(oe,le){var me=Rt(oe)?At:Xa;return me(oe,Mt(le,3))}function sd(oe,le,me,Te){return oe==null?[]:(Rt(le)||(le=le==null?[]:[le]),me=Te?F:me,Rt(me)||(me=me==null?[]:[me]),Qa(oe,le,me))}var rd=Gr(function(oe,le,me){oe[me?0:1].push(le)},function(){return[[],[]]});function od(oe,le,me){var Te=Rt(oe)?ni:Ea,Ie=arguments.length<3;return Te(oe,Mt(le,4),me,Ie,Ln)}function ad(oe,le,me){var Te=Rt(oe)?pi:Ea,Ie=arguments.length<3;return Te(oe,Mt(le,4),me,Ie,za)}function ld(oe,le){var me=Rt(oe)?Pt:Ua;return me(oe,Qr(Mt(le,3)))}function cd(oe){var le=Rt(oe)?Oa:Qu;return le(oe)}function ud(oe,le,me){(me?wi(oe,le,me):le===F)?le=1:le=kt(le);var Te=Rt(oe)?Iu:eh;return Te(oe,le)}function hd(oe){var le=Rt(oe)?Lu:ih;return le(oe)}function fd(oe){if(oe==null)return 0;if(Ri(oe))return to(oe)?ds(oe):oe.length;var le=yi(oe);return le==xe||le==Qe?oe.size:$o(oe).length}function dd(oe,le,me){var Te=Rt(oe)?fi:nh;return me&&wi(oe,le,me)&&(le=F),Te(oe,Mt(le,3))}var pd=Bt(function(oe,le){if(oe==null)return[];var me=le.length;return me>1&&wi(oe,le[0],le[1])?le=[]:me>2&&wi(le[0],le[1],le[2])&&(le=[le[0]]),Qa(oe,mi(le,1),[])}),Jr=qc||function(){return oi.Date.now()};function md(oe,le){if(typeof le!="function")throw new Hi(W);return oe=kt(oe),function(){if(--oe<1)return le.apply(this,arguments)}}function Yl(oe,le,me){return le=me?F:le,le=oe&&le==null?oe.length:le,Sn(oe,ue,F,F,F,F,le)}function Xl(oe,le){var me;if(typeof le!="function")throw new Hi(W);return oe=kt(oe),function(){return--oe>0&&(me=le.apply(this,arguments)),oe<=1&&(le=F),me}}var ua=Bt(function(oe,le,me){var Te=ne;if(me.length){var Ie=Cn(me,xs(ua));Te|=fe}return Sn(oe,Te,le,me,Ie)}),Kl=Bt(function(oe,le,me){var Te=ne|re;if(me.length){var Ie=Cn(me,xs(Kl));Te|=fe}return Sn(le,Te,oe,me,Ie)});function Jl(oe,le,me){le=me?F:le;var Te=Sn(oe,ce,F,F,F,F,F,le);return Te.placeholder=Jl.placeholder,Te}function Zl(oe,le,me){le=me?F:le;var Te=Sn(oe,he,F,F,F,F,F,le);return Te.placeholder=Zl.placeholder,Te}function Ql(oe,le,me){var Te,Ie,Ue,Je,et,st,pt=0,mt=!1,bt=!1,xt=!0;if(typeof oe!="function")throw new Hi(W);le=Ki(le)||0,ii(me)&&(mt=!!me.leading,bt="maxWait"in me,Ue=bt?hi(Ki(me.maxWait)||0,le):Ue,xt="trailing"in me?!!me.trailing:xt);function Tt(li){var an=Te,Tn=Ie;return Te=Ie=F,pt=li,Je=oe.apply(Tn,an),Je}function Ct(li){return pt=li,et=qs(Ot,le),mt?Tt(li):Je}function Ft(li){var an=li-st,Tn=li-pt,vc=le-an;return bt?bi(vc,Ue-Tn):vc}function It(li){var an=li-st,Tn=li-pt;return st===F||an>=le||an<0||bt&&Tn>=Ue}function Ot(){var li=Jr();if(It(li))return zt(li);et=qs(Ot,Ft(li))}function zt(li){return et=F,xt&&Te?Tt(li):(Te=Ie=F,Je)}function $i(){et!==F&&cl(et),pt=0,Te=st=Ie=et=F}function Ti(){return et===F?Je:zt(Jr())}function Gi(){var li=Jr(),an=It(li);if(Te=arguments,Ie=this,st=li,an){if(et===F)return Ct(st);if(bt)return cl(et),et=qs(Ot,le),Tt(st)}return et===F&&(et=qs(Ot,le)),Je}return Gi.cancel=$i,Gi.flush=Ti,Gi}var gd=Bt(function(oe,le){return Ga(oe,1,le)}),bd=Bt(function(oe,le,me){return Ga(oe,Ki(le)||0,me)});function yd(oe){return Sn(oe,ve)}function Zr(oe,le){if(typeof oe!="function"||le!=null&&typeof le!="function")throw new Hi(W);var me=function(){var Te=arguments,Ie=le?le.apply(this,Te):Te[0],Ue=me.cache;if(Ue.has(Ie))return Ue.get(Ie);var Je=oe.apply(this,Te);return me.cache=Ue.set(Ie,Je)||Ue,Je};return me.cache=new(Zr.Cache||yn),me}Zr.Cache=yn;function Qr(oe){if(typeof oe!="function")throw new Hi(W);return function(){var le=arguments;switch(le.length){case 0:return!oe.call(this);case 1:return!oe.call(this,le[0]);case 2:return!oe.call(this,le[0],le[1]);case 3:return!oe.call(this,le[0],le[1],le[2])}return!oe.apply(this,le)}}function vd(oe){return Xl(2,oe)}var Sd=sh(function(oe,le){le=le.length==1&&Rt(le[0])?At(le[0],Di(Mt())):At(mi(le,1),Di(Mt()));var me=le.length;return Bt(function(Te){for(var Ie=-1,Ue=bi(Te.length,me);++Ie=le}),Qn=qa(function(){return arguments}())?qa:function(oe){return si(oe)&&Xt.call(oe,"callee")&&!Na.call(oe,"callee")},Rt=ut.isArray,Fd=pr?Di(pr):Gu;function Ri(oe){return oe!=null&&eo(oe.length)&&!En(oe)}function ai(oe){return si(oe)&&Ri(oe)}function Bd(oe){return oe===!0||oe===!1||si(oe)&&Ei(oe)==Ve}var Fn=Yc||_a,Dd=mr?Di(mr):zu;function Od(oe){return si(oe)&&oe.nodeType===1&&!js(oe)}function Vd(oe){if(oe==null)return!0;if(Ri(oe)&&(Rt(oe)||typeof oe=="string"||typeof oe.splice=="function"||Fn(oe)||_s(oe)||Qn(oe)))return!oe.length;var le=yi(oe);if(le==xe||le==Qe)return!oe.size;if(Hs(oe))return!$o(oe).length;for(var me in oe)if(Xt.call(oe,me))return!1;return!0}function $d(oe,le){return zs(oe,le)}function Gd(oe,le,me){me=typeof me=="function"?me:F;var Te=me?me(oe,le):F;return Te===F?zs(oe,le,F,me):!!Te}function fa(oe){if(!si(oe))return!1;var le=Ei(oe);return le==at||le==nt||typeof oe.message=="string"&&typeof oe.name=="string"&&!js(oe)}function zd(oe){return typeof oe=="number"&&ka(oe)}function En(oe){if(!ii(oe))return!1;var le=Ei(oe);return le==ct||le==De||le==We||le==je}function tc(oe){return typeof oe=="number"&&oe==kt(oe)}function eo(oe){return typeof oe=="number"&&oe>-1&&oe%1==0&&oe<=Pe}function ii(oe){var le=typeof oe;return oe!=null&&(le=="object"||le=="function")}function si(oe){return oe!=null&&typeof oe=="object"}var ic=gr?Di(gr):Wu;function Ud(oe,le){return oe===le||Vo(oe,le,ia(le))}function Wd(oe,le,me){return me=typeof me=="function"?me:F,Vo(oe,le,ia(le),me)}function Hd(oe){return nc(oe)&&oe!=+oe}function qd(oe){if(Ah(oe))throw new Nt(U);return ja(oe)}function jd(oe){return oe===null}function Yd(oe){return oe==null}function nc(oe){return typeof oe=="number"||si(oe)&&Ei(oe)==ze}function js(oe){if(!si(oe)||Ei(oe)!=Re)return!1;var le=Ar(oe);if(le===null)return!0;var me=Xt.call(le,"constructor")&&le.constructor;return typeof me=="function"&&me instanceof me&&Er.call(me)==zc}var da=Un?Di(Un):Hu;function Xd(oe){return tc(oe)&&oe>=-Pe&&oe<=Pe}var sc=br?Di(br):qu;function to(oe){return typeof oe=="string"||!Rt(oe)&&si(oe)&&Ei(oe)==He}function Vi(oe){return typeof oe=="symbol"||si(oe)&&Ei(oe)==tt}var _s=yr?Di(yr):ju;function Kd(oe){return oe===F}function Jd(oe){return si(oe)&&yi(oe)==rt}function Zd(oe){return si(oe)&&Ei(oe)==ft}var Qd=Hr(Go),ep=Hr(function(oe,le){return oe<=le});function rc(oe){if(!oe)return[];if(Ri(oe))return to(oe)?sn(oe):Ni(oe);if(ks&&oe[ks])return Ic(oe[ks]());var le=yi(oe),me=le==xe?Mo:le==Qe?Sr:Es;return me(oe)}function wn(oe){if(!oe)return oe===0?oe:0;if(oe=Ki(oe),oe===Me||oe===-Me){var le=oe<0?-1:1;return le*Ne}return oe===oe?oe:0}function kt(oe){var le=wn(oe),me=le%1;return le===le?me?le-me:le:0}function oc(oe){return oe?Xn(kt(oe),0,Ae):0}function Ki(oe){if(typeof oe=="number")return oe;if(Vi(oe))return ke;if(ii(oe)){var le=typeof oe.valueOf=="function"?oe.valueOf():oe;oe=ii(le)?le+"":le}if(typeof oe!="string")return oe===0?oe:+oe;oe=wa(oe);var me=Bi.test(oe);return me||no.test(oe)?tn(oe.slice(2),me?2:8):Ts.test(oe)?ke:+oe}function ac(oe){return dn(oe,ki(oe))}function tp(oe){return oe?Xn(kt(oe),-Pe,Pe):oe===0?oe:0}function Yt(oe){return oe==null?"":Oi(oe)}var ip=vs(function(oe,le){if(Hs(le)||Ri(le)){dn(le,di(le),oe);return}for(var me in le)Xt.call(le,me)&&Vs(oe,me,le[me])}),lc=vs(function(oe,le){dn(le,ki(le),oe)}),io=vs(function(oe,le,me,Te){dn(le,ki(le),oe,Te)}),np=vs(function(oe,le,me,Te){dn(le,di(le),oe,Te)}),sp=xn(ko);function rp(oe,le){var me=ys(oe);return le==null?me:Va(me,le)}var op=Bt(function(oe,le){oe=Zt(oe);var me=-1,Te=le.length,Ie=Te>2?le[2]:F;for(Ie&&wi(le[0],le[1],Ie)&&(Te=1);++me1),Ue}),dn(oe,ea(oe),me),Te&&(me=ji(me,K|te|Q,mh));for(var Ie=le.length;Ie--;)qo(me,le[Ie]);return me});function wp(oe,le){return uc(oe,Qr(Mt(le)))}var Tp=xn(function(oe,le){return oe==null?{}:Ku(oe,le)});function uc(oe,le){if(oe==null)return{};var me=At(ea(oe),function(Te){return[Te]});return le=Mt(le),tl(oe,me,function(Te,Ie){return le(Te,Ie[0])})}function Pp(oe,le,me){le=Rn(le,oe);var Te=-1,Ie=le.length;for(Ie||(Ie=1,oe=F);++Tele){var Te=oe;oe=le,le=Te}if(me||oe%1||le%1){var Ie=Fa();return bi(oe+Ie*(le-oe+dr("1e-"+((Ie+"").length-1))),le)}return Uo(oe,le)}var Dp=Ss(function(oe,le,me){return le=le.toLowerCase(),oe+(me?dc(le):le)});function dc(oe){return ga(Yt(oe).toLowerCase())}function mc(oe){return oe=Yt(oe),oe&&oe.replace(ro,Tc).replace(yo,"")}function Op(oe,le,me){oe=Yt(oe),le=Oi(le);var Te=oe.length;me=me===F?Te:Xn(kt(me),0,Te);var Ie=me;return me-=le.length,me>=0&&oe.slice(me,Ie)==le}function Vp(oe){return oe=Yt(oe),oe&&ln.test(oe)?oe.replace(jt,Pc):oe}function $p(oe){return oe=Yt(oe),oe&&ws.test(oe)?oe.replace(un,"\\$&"):oe}var Gp=Ss(function(oe,le,me){return oe+(me?"-":"")+le.toLowerCase()}),zp=Ss(function(oe,le,me){return oe+(me?" ":"")+le.toLowerCase()}),Up=bl("toLowerCase");function Wp(oe,le,me){oe=Yt(oe),le=kt(le);var Te=le?ds(oe):0;if(!le||Te>=le)return oe;var Ie=(le-Te)/2;return Wr(Lr(Ie),me)+oe+Wr(Ir(Ie),me)}function Hp(oe,le,me){oe=Yt(oe),le=kt(le);var Te=le?ds(oe):0;return le&&Te>>0,me?(oe=Yt(oe),oe&&(typeof le=="string"||le!=null&&!da(le))&&(le=Oi(le),!le&&fs(oe))?kn(sn(oe),0,me):oe.split(le,me)):[]}var Zp=Ss(function(oe,le,me){return oe+(me?" ":"")+ga(le)});function Qp(oe,le,me){return oe=Yt(oe),me=me==null?0:Xn(kt(me),0,oe.length),le=Oi(le),oe.slice(me,me+le.length)==le}function em(oe,le,me){var Te=$e.templateSettings;me&&wi(oe,le,me)&&(le=F),oe=Yt(oe),le=io({},le,Te,wl);var Ie=io({},le.imports,Te.imports,wl),Ue=di(Ie),Je=Ao(Ie,Ue),et,st,pt=0,mt=le.interpolate||rs,bt="__p += '",xt=Co((le.escape||rs).source+"|"+mt.source+"|"+(mt===Zi?Bn:rs).source+"|"+(le.evaluate||rs).source+"|$","g"),Tt="//# sourceURL="+(Xt.call(le,"sourceURL")?(le.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++hr+"]")+` `;oe.replace(xt,function(It,Ot,zt,$i,Ti,Gi){return zt||(zt=$i),bt+=oe.slice(pt,Gi).replace(Qi,Ac),Ot&&(et=!0,bt+=`' + __e(`+Ot+`) + '`),Ti&&(st=!0,bt+=`'; `+Ti+`; __p += '`),zt&&(bt+=`' + ((__t = (`+zt+`)) == null ? '' : __t) + '`),pt=Gi+It.length,It}),bt+=`'; `;var Ct=Xt.call(le,"variable")&&le.variable;if(!Ct)bt=`with (obj) { `+bt+` } `;else if(Gt.test(Ct))throw new Nt(q);bt=(st?bt.replace(ri,""):bt).replace(ti,"$1").replace(zi,"$1;"),bt="function("+(Ct||"obj")+`) { `+(Ct?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(et?", __e = _.escape":"")+(st?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+bt+`return __p }`;var Ft=bc(function(){return Ht(Ue,Tt+"return "+bt).apply(F,Je)});if(Ft.source=bt,fa(Ft))throw Ft;return Ft}function tm(oe){return Yt(oe).toLowerCase()}function im(oe){return Yt(oe).toUpperCase()}function nm(oe,le,me){if(oe=Yt(oe),oe&&(me||le===F))return wa(oe);if(!oe||!(le=Oi(le)))return oe;var Te=sn(oe),Ie=sn(le),Ue=Ta(Te,Ie),Je=Pa(Te,Ie)+1;return kn(Te,Ue,Je).join("")}function sm(oe,le,me){if(oe=Yt(oe),oe&&(me||le===F))return oe.slice(0,Ma(oe)+1);if(!oe||!(le=Oi(le)))return oe;var Te=sn(oe),Ie=Pa(Te,sn(le))+1;return kn(Te,0,Ie).join("")}function rm(oe,le,me){if(oe=Yt(oe),oe&&(me||le===F))return oe.replace(Pn,"");if(!oe||!(le=Oi(le)))return oe;var Te=sn(oe),Ie=Ta(Te,sn(le));return kn(Te,Ie).join("")}function om(oe,le){var me=Se,Te=pe;if(ii(le)){var Ie="separator"in le?le.separator:Ie;me="length"in le?kt(le.length):me,Te="omission"in le?Oi(le.omission):Te}oe=Yt(oe);var Ue=oe.length;if(fs(oe)){var Je=sn(oe);Ue=Je.length}if(me>=Ue)return oe;var et=me-ds(Te);if(et<1)return Te;var st=Je?kn(Je,0,et).join(""):oe.slice(0,et);if(Ie===F)return st+Te;if(Je&&(et+=st.length-et),da(Ie)){if(oe.slice(et).search(Ie)){var pt,mt=st;for(Ie.global||(Ie=Co(Ie.source,Yt(ss.exec(Ie))+"g")),Ie.lastIndex=0;pt=Ie.exec(mt);)var bt=pt.index;st=st.slice(0,bt===F?et:bt)}}else if(oe.indexOf(Oi(Ie),et)!=et){var xt=st.lastIndexOf(Ie);xt>-1&&(st=st.slice(0,xt))}return st+Te}function am(oe){return oe=Yt(oe),oe&&Ji.test(oe)?oe.replace(vi,kc):oe}var lm=Ss(function(oe,le,me){return oe+(me?" ":"")+le.toUpperCase()}),ga=bl("toUpperCase");function gc(oe,le,me){return oe=Yt(oe),le=me?F:le,le===F?Cc(oe)?Dc(oe):Ci(oe):oe.match(le)||[]}var bc=Bt(function(oe,le){try{return _i(oe,F,le)}catch(me){return fa(me)?me:new Nt(me)}}),cm=xn(function(oe,le){return Ke(le,function(me){me=pn(me),vn(oe,me,ua(oe[me],oe))}),oe});function um(oe){var le=oe==null?0:oe.length,me=Mt();return oe=le?At(oe,function(Te){if(typeof Te[1]!="function")throw new Hi(W);return[me(Te[0]),Te[1]]}):[],Bt(function(Te){for(var Ie=-1;++IePe)return[];var me=Ae,Te=bi(oe,Ae);le=Mt(le),oe-=Ae;for(var Ie=Po(Te,le);++me0||le<0)?new $t(me):(oe<0?me=me.takeRight(-oe):oe&&(me=me.drop(oe)),le!==F&&(le=kt(le),me=le<0?me.dropRight(-le):me.take(le-oe)),me)},$t.prototype.takeRightWhile=function(oe){return this.reverse().takeWhile(oe).reverse()},$t.prototype.toArray=function(){return this.take(Ae)},fn($t.prototype,function(oe,le){var me=/^(?:filter|find|map|reject)|While$/.test(le),Te=/^(?:head|last)$/.test(le),Ie=$e[Te?"take"+(le=="last"?"Right":""):le],Ue=Te||/^find/.test(le);!Ie||($e.prototype[le]=function(){var Je=this.__wrapped__,et=Te?[1]:arguments,st=Je instanceof $t,pt=et[0],mt=st||Rt(Je),bt=function(Ot){var zt=Ie.apply($e,Ut([Ot],et));return Te&&xt?zt[0]:zt};mt&&me&&typeof pt=="function"&&pt.length!=1&&(st=mt=!1);var xt=this.__chain__,Tt=!!this.__actions__.length,Ct=Ue&&!xt,Ft=st&&!Tt;if(!Ue&&mt){Je=Ft?Je:new $t(this);var It=oe.apply(Je,et);return It.__actions__.push({func:Xr,args:[bt],thisArg:F}),new qi(It,xt)}return Ct&&Ft?oe.apply(this,et):(It=this.thru(bt),Ct?Te?It.value()[0]:It.value():It)})}),Ke(["pop","push","shift","sort","splice","unshift"],function(oe){var le=xr[oe],me=/^(?:push|sort|unshift)$/.test(oe)?"tap":"thru",Te=/^(?:pop|shift)$/.test(oe);$e.prototype[oe]=function(){var Ie=arguments;if(Te&&!this.__chain__){var Ue=this.value();return le.apply(Rt(Ue)?Ue:[],Ie)}return this[me](function(Je){return le.apply(Rt(Je)?Je:[],Ie)})}}),fn($t.prototype,function(oe,le){var me=$e[le];if(me){var Te=me.name+"";Xt.call(bs,Te)||(bs[Te]=[]),bs[Te].push({name:le,func:me})}}),bs[zr(F,re).name]=[{name:"wrapper",func:F}],$t.prototype.clone=ru,$t.prototype.reverse=ou,$t.prototype.value=au,$e.prototype.at=Df,$e.prototype.chain=Of,$e.prototype.commit=Vf,$e.prototype.next=$f,$e.prototype.plant=zf,$e.prototype.reverse=Uf,$e.prototype.toJSON=$e.prototype.valueOf=$e.prototype.value=Wf,$e.prototype.first=$e.prototype.head,ks&&($e.prototype[ks]=Gf),$e},ps=Oc();Ai?((Ai.exports=ps)._=ps,$n._=ps):oi._=ps}).call(commonjsGlobal$1)})(lodash,lodash.exports);class SectionHint{constructor(){this.currentNote=null,this.el=document.createElement("div"),this.span=document.createElement("span"),this.init()}init(){this.el.id="section-hint"+Math.floor(Math.random()*1e5),this.hide()}showForElement(R){var G;if(this.currentNote===R)return;this.el||(this.el=document.createElement("div"),this.init(),this.show()),this.currentNote=R;const F=getBoundingBoxByverticalNote(R),D=document.querySelector("#osmdSvgPage1");if(F){const{x:U,y:W,width:q,height:Y}=F;this.el.id="custom-cursor-bg-hint",this.el.style.position="absolute",this.el.style.top=formatZoom(W)+"px",this.el.style.left=formatZoom(U)+"px",this.el.style.width=formatZoom(q)+"px",this.el.style.height=formatZoom(Y)+"px",this.el.style.zIndex="-1",(G=D==null?void 0:D.parentNode)==null||G.appendChild(this.el)}}hide(){this.el.style.display="none"}show(){this.el.style.display=""}destroy(){this.currentNote=null,this.hide()}}const scriptRel="modulepreload",seen={},base$2="/orchestra-music-score/",__vitePreload=function B(R,F){return!F||F.length===0?R():Promise.all(F.map(D=>{if(D=`${base$2}${D}`,D in seen)return;seen[D]=!0;const G=D.endsWith(".css"),U=G?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${D}"]${U}`))return;const W=document.createElement("link");if(W.rel=G?"stylesheet":scriptRel,G||(W.as="script",W.crossOrigin=""),W.href=D,document.head.appendChild(W),G)return new Promise((q,Y)=>{W.addEventListener("load",q),W.addEventListener("error",()=>Y(new Error(`Unable to preload CSS for ${D}`)))})})).then(()=>R())};function __variableDynamicImportRuntime0__(B){switch(B){case"../src/pages/baseClass/index.tsx":return __vitePreload(()=>import("./index.aa53990f.js"),["assets/index.aa53990f.js","assets/index.4b7cbd62.css","assets/index.35492d34.js","assets/index.0c958b36.js"]);case"../src/pages/classify/index.tsx":return __vitePreload(()=>import("./index.100e14d5.js"),["assets/index.100e14d5.js","assets/index.f442919d.css","assets/index.35492d34.js"]);case"../src/pages/detail/index.tsx":return __vitePreload(()=>import("./index.20640ba3.js"),["assets/index.20640ba3.js","assets/index.b8ab8b80.css","assets/index.1876c5d7.js","assets/index.35492d34.js","assets/index.c653856b.js","assets/index.93438080.css","assets/index.40188b28.js","assets/index.06f6a16d.css","assets/music.b35eb5be.js","assets/state.c5b2dac7.js","assets/vip.7c2dee76.js","assets/vip.838f4afe.css","assets/index.96bd1576.js","assets/index.d561e8e6.js","assets/index.0c958b36.js"]);case"../src/pages/list/index.tsx":return __vitePreload(()=>import("./index.9e8d7f2e.js"),["assets/index.9e8d7f2e.js","assets/index.be7ceb5d.css","assets/state.c5b2dac7.js","assets/vip.7c2dee76.js","assets/vip.838f4afe.css","assets/music.b35eb5be.js","assets/index.96bd1576.js","assets/index.0c958b36.js"]);case"../src/pages/notfund/index.tsx":return __vitePreload(()=>import("./index.afd8e481.js"),["assets/index.afd8e481.js","assets/index.0c958b36.js"]);case"../src/pages/render-test/index.tsx":return __vitePreload(()=>import("./index.48244a3d.js"),[]);case"../src/pages/report/index.tsx":return __vitePreload(()=>import("./index.f083c37e.js").then(function(R){return R.i}),["assets/index.f083c37e.js","assets/index.007e2b62.css","assets/index.40188b28.js","assets/index.06f6a16d.css","assets/music.b35eb5be.js","assets/index.67c8b21b.js","assets/index.fba0bdd7.css","assets/index.1876c5d7.js","assets/index.0c958b36.js","assets/index.d561e8e6.js"]);default:return new Promise(function(R,F){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(F.bind(null,new Error("Unknown variable dynamic import: "+B)))})}}const getRouterComponent=B=>async()=>{const R=setTimeout(()=>{open$1()},300);let F=Promise.resolve(null);try{F=await __variableDynamicImportRuntime0__(`../src/pages/${B}/index.tsx`)}catch{F=Promise.reject()}return clearTimeout(R),close$1(),F};var routes=[{path:"/",component:getRouterComponent("baseClass")},{path:"/classify",component:getRouterComponent("classify")},{path:"/list/:id",component:getRouterComponent("list"),meta:{keepAlive:!0}},{path:"/detail/:id",component:getRouterComponent("detail")},{path:"/evaluating/:id",component:getRouterComponent("detail")},{path:"/report",component:getRouterComponent("report")},{path:"/report/:id",component:getRouterComponent("report")},{path:"/render-test",component:getRouterComponent("render-test")},{path:"/vexflow-test",component:__vitePreload(()=>import("./index.2854b3e8.js"),[])},{path:"/:pathMatch(.*)*",component:getRouterComponent("notfund"),meta:{title:"404 Not Fund"}}];createRouter({history:createWebHashHistory(),routes});const tock="SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA//tQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAAGAAAKmwA6Ojo6Ojo6Ojo6Ojo6Ojo6YmJiYmJiYmJiYmJiYmJiYmKJiYmJiYmJiYmJiYmJiYmJsbGxsbGxsbGxsbGxsbGxsbHY2NjY2NjY2NjY2NjY2NjY2P////////////////////8AAAAATGF2YzU4LjU0AAAAAAAAAAAAAAAAJAQUAAAAAAAACpv9GcQ9AAAAAAAAAAAAAAAAAAAAAP/7kGQAAALJHFAdPeAAMs13wKAUABOVWUYZ2gAA1UIigwBQAAAAUlDQQxklOcnZOydj1iYIxFj1oWbgRwYhdwAgBMLA1q+Ech0QS2HREhx5GBklTjJq98QImWB5q9/SmXkQa8gJAxrBDlDn/l/D5d9cH9pd/D/Ln+H+XP8P////////////kIQhCf6EIz////5z8hCf//////85CEqc5zkqcPh8Ph8DgAAAABwOBwUIYigkYzAOBgVYUoT0xxC8ypKoLAmYGA34OAo4Ukoel04PoEw+AY5KXwIIcD4SwNeeCwQnPAyAEDKEQAQwphNGfC10AQCF6hESOSROeGNRFBPYnkVxbUW+KTH8ZQZcmyCUWWj/HPJ8iBBy2SxPrRrRr/lYqlcnidNieLpsuvXr/5eMTIvHThkdMDIz///8wUmYIJoIHzRj6ALf/8Ahz/////////////09fPP/f++v91/qp///0FCCor/MeqOQV9OtjKwvETiP///4gLFJ///+PYKZAAAJSMgAAwRYCBMBIAIRYAFgJiRgCoBwYDiBGGAvgP/7kmQPjfQJHkZXfqAANq14YOAUAE0JqxIN/oiIvTZhgACj2SxgDYAkYBOAeGAtgzRh5IwEZAKX5HH4nhRqcw/qYc4EGmBlAeBgu4K8BuRvgZYEQGQRwBjkZDiS0cxRbUuZOZHpixkiipJJ1OpaqzJIe4kJfb////////6heitNxprnDpIJ//////////+/r+tfuy37W7+d1rTu37oi36V//p/RGntSvLdowxnDgeONKh1jhpihwTMDCAwcPO8CRICfmLS0OAAxDCIU1kuNRoDAEATswDwKMME9IWzYyOJsxDwZfMBUCPDAYwSEwHACiA8jwD2hwLkAGpwxG//9///t/q//////7+////+r/////99mu7qqdT6Dp6KtS3WmpaJso5oG//zU/y9j4VkE5l+sBkvmkX+v///acWnV2trA0mrZlJKphkD4zD4UYeaLigSkDKVVAAAABoOjRLAYlW2pbW0TjAQPMMiYxoNTLhlNAqA29QTCARHAylZ+yMpzCeDB0ANUwLUBKIgHkGugOHwNbgAFkXS1+v/V/p/6/9f+3/7/+5JkJojzkmvFa5+akiqtWGAAJfZPNa0MDn6KSMy2IUAAm6HV66am7/9qv9JO3S/1f/7dPr7V1/1/QrqtqWt9StPTTTSQrNUm/8ud1+NUvMOdbX4+j4aaz6f//rVfa9U1dtasIILnUYQ4o4wTDo87xIDzyBiBbaW9wIQKKCAVG5gEUGSwkaiBx005mGcAmRt6ItsZhME5GFGgZpglAD8YFGA6gce2BpnwGLRgAECDP//6////////11dkWu1S67La+tnr2t1UPo9f1vt//71alvXrqRmSlo60EkkVLTdzxdQLhmeLyRqo+ZmhaOQf9f/FXojkaky22YJvJz9bAcF9zk0p8v/+X752Zmbu+7Tqr5l8j+aexVdmLCHIEz0WejhSGgDmLY5Yp0A4ATFgDgwCcAEMAVATgCBZmAuAwRgoIoKaUNEAmBeh/5rCvGZViZSMxjwUGPQOGEgiDcJ////3/////+/9P0k8taNNRqKfI7qhlYqGY7/ZPyVb9v+vfVDEkVkKZHrOwgVhUUQa6iRRrChlDwrFFDwkOFwoTKKEfr/5//uSZECP8/BswoP8KyAurYhgACb2TnWxCg38qoi3NiGAAJvZyyeZe+GTlsyDkIzns5w///+v+3z/7fmPsPpsRc5J09lTsJmEllkDIC0CMKkQLax/q7iyphogZAOmcI5pr0cF/mCYhxRiJDJgY4CESGCQAW5gMoCIYAgAAg0AAMAMABzABwAAtiH///////////911rt5im0a6NR1t6satH2VVWyp1///+nofRUZHQimYpSmHWZw8cYoTYCDxgmIi6CqIv/TvkZdRYEQDg7m7Uuyzf0qz//////63ds8PL1uNTm7nWYRtHt0hJrgT3SKaqWg5c/2AGAUAwBgATARAbMDQCwwIASzEfGVMWUpU75zHTcSLAMIYFQweADDBFAnA4/AWYG2ABAMv//////////9er32U7V2vruldDdWvVZaqkEXe9f7W/+/f60ek6DpqVRQSRSpsiipA4UCfNjExMjxoXlLSNCZMhf//////////9P/17cln97tv9GIhOVro9PTf//9U19ao0qO5FTUGEDmO4CcoYUgyiwoZVQEcAAABCv/7kmRYgAPBbEKFemACNK14YKAIAB2aEQc56gAB1UIgwwLQAAgAAAABq3tm9gKW2Bgcic+KisAoBQwGBTT7kslMXcNU7Q9oDDGDANzjkkwCwpVFWbApcBEnr8DMCgNMCE59VTQbwB2hOINj//cBpGKiDY+IJl7q/XKgLABYguYC9hbW6aCaDKrUggkLIHoiIpcLljtEEzdNEwm6RspVN3OJUxcZeMBMCJCCAcYbjMGiZcVUZou6LGa1F51prqLxBSDh9yqKXGTYzGwRJSqjk1L54rn0Cbm2szRPolE4R5Ml0dBDyDi4BPh8cDonxH5OiAZLmQ5pOE2RcZwfJc////LY1Y2////xzRDBpCyP1/////////79v9F0GWupdNNadM2SZSe7TWdQOJUETFkEzdRmgYWTc6by8q9lsaGi2UZLWihMzVdaJ916OiZFBiSYpmJwiDHFxdJB0zp4vmRgiS8fmR0UWXJpqRROx6l00HsO4Lr///+PY6MUMf///5ONCIOekEgAFo2Hw+Gw1EYYCAHPFMMT2N4KpAjHDGwyfhUkKHP/+5JkEAAEs0PYbkMkhDDs+DDAHAAAAAGkHAAAIAAANIOAAARJeX/IDTYPBUSlUNQD/+eBQG8NtczGGFOFF6L//zBYBCY0cDrhKStLnRiNT///LXqrpGMbRVUuksRopVlS////p8LMTDUAXkvl1pqtnzWVX////5dRRunlFeU005/7///9f/////3reGruVrlsHP/iUgZCDTTzlv//////zf/+qt//+x1HNHnGv//6OOqz0Op////ORzh4qUHiTiMM/////kABRAf/+qpMQU1FMy4xMDCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",tick="SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA//tQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAAGAAAKmwA6Ojo6Ojo6Ojo6Ojo6Ojo6YmJiYmJiYmJiYmJiYmJiYmKJiYmJiYmJiYmJiYmJiYmJsbGxsbGxsbGxsbGxsbGxsbHY2NjY2NjY2NjY2NjY2NjY2P////////////////////8AAAAATGF2YzU4LjU0AAAAAAAAAAAAAAAAJAQUAAAAAAAACpsJoXZ7AAAAAAAAAAAAAAAAAAAAAP/7kGQAAALmINEVPeAAOA1nwKAUAFJpV1I5moAAxMIiwwAgAAAJdWKyJljOc0zrZ9UpVjOc0ydibhICwL5OzLXhuEsSYKQMBGN7PInFA1lsOiJDj4ePJU4yavfFKXVjzWb+msvIg0/EgY4If/D/E58P7S7+H+X8H+X8H+XeUDH+U///////////////+d/oQjZCEIQjZCEJ85zv/////8hCEI1CEIQhCHExc7oIBwOAGAYBgGAYfD48ACQIWDrWCzEHeEXm6Qvl/frHQSfa7Wyi4qArEA3m2QMdkQDHnDAyqJQROEFN0BhgEgYaCoAIEAWABAi+FrGF/QbVDIQppKJLOeHoisC1jGjOWr/HLJUgBAzMnK2Wv+Rc3KhPny0V1rrXX/KxqfLxqbF4xS169f/LxiZF46cMjpgcT///8wUmggmgg6DHwRPf/6AW//////////////317pa6/09U///7//ndTuIUN/ldtifykKtKygv///41n////DBRxSpwEjjYIBpwgmIASlzATXqOy+0WbkkUn6YKEJjwqmVBma4nxv/7kmQRhvRLLEe/cuAALs14cOAIAE0lqRIPgFVIsjYhgACb2aAtG1x8BggIP4Bg7YQ+BrcLKgBiv4oEBiIYYEBg5oIEBgPYAWBgNQDaBgKACSBgFIBMBgD4AQKTGRrZ1mKB9jFB0mUkkl3S2LyToGyXq6q0FqelU9VR9SYlO/6vXV//2//yvh3ubf/////////////5P/N+V6fauunX+v31//67c+Z2P6ldBAIyshGO5jAhgqiAhHFyGBSAA6Iz801nLGtGX9dpgKAoCADZgD4EgYICFfmCmAjZgcYHAYLCDOGGCDeZ0W0QOY54C9mDtgUxgbgCqYDuASAIB9DAC8VAA0QmU03un0/Ru30/////t6//r/a3UYivlU12BHnIolcGP+p/9YNArFgyKNS7cofI88/////P28923u73DxbZ0lFImJUdrVhd6t8DsRiWCALVe0ttc7rdNLoy5S5QaABGALAKJgJgRkYIKBSGBVASpgcwJ+YOSK7G9ZqIBiYoLgYJQBKmBBgJBgIQBCYA6ABIwqdLCu9Z//bb/v6/pe1q/Zv/+5JkKY/zZWrEA+AVQjHNqFAARvYN8bEOD4C1CL22YUAAm9j/t//+n/tNRX0Y6tRxaOo9DBJFa7WHABUQuuuiX+37brMiv9QRXvqfsaTl7d/X///8/2t147te2ihqbNj6UUiJ7XI3TrhLAVDlhRuiQCzA1nL/3ljS00Ou8iqYAeARGADA1JgYACmYDuAtGBGgcxgeQgqaxkVzmF+Am5gVYDsYCIAbmANgCxgAgACzp/WvQ7l/9Pv/XtW+tNUZ3qzdtG27////678qXQx9dEsIB8p0I4mUcqIZFIIioYcsXg/7rKY4sEx/yskQCv1sODfXqX/fk3bfrN/u97+wUUxZrxqMvrRBxjrHQcDMzkIqHgIZ7H//96ysz0VacYAgApgZiYGEKA4YJgGJgmBPmDGXUfuKWRjeh4GCkCuYDIEhgAAFoCnpk8Cz3P/t7y3vfL1yEvXoldaK/0/N//9fru/QrGFio7EGIRmKzDzlY7g4kHR4sOHD3D5Rhx39lwVz0WozDO36Ye8RGSizLItOzh/+P/1V78uv/F++XnVXODau4y+V//uSZEmP81dsQwPALUIyzZhQACn2C6GzDA8AVQC4NiGAAKPZWbabe2ImyAcS6WJ42uf//+/7eo4SmsYFgWIYEaYEYBhgMgqAAb05CgQTDCCXMBMC4GAGohM9gCckV7v/b3VS6sk6I3Kpcy/k3pXei/p//3//u+y5lkXUOimYQIMHiqoKdzmIEFiVCDf/znuaM4Q1fF52ict/xk/y/////8172vq6sNjqCmui3ZhonD5BHUYMDLiEaeitExf/ZM0JMTADBeIIFgxgDAlAwBA5AwEFKA9IoNAwph4AcCEGoBA8otA5ZPlo+3///////v+pwNTH8GyDFIyKIfORswWXNnSIIDnbM9++/zvHfPFvmHrVupOT56+1XG6XRMNOjlFhkVyQIyMMvy6nrD2uJnhq6JZSI2Nll5SuVhL/v/WH7z3n+eof23Ocu7SuuSyl/Ol3zNs9SB1pxgZNUBASDtc/99+vSbzvsojBvbkVpvmgYKAnAQGOBtCPoBgXBKBgoBUGkiCAYDHwK3Efm6kGTL5fNGWm6jBAzHMJxk01FwuMgg30C//7kmR0BfNla8ICwV3yMw2oUAAp9hRBsQkVmwAIvLYhwoBQAOnQZaaai+n6aboVvUhWaGFNakEGZkLu1SZ+gqmkp3SdGnSUzr2agpV1MhQQUmrst9Vb3W77prrWtearQRubpqRTdZupM0MEDdFZsznETcrEWLRfNDI6mWjYl////////////76/ttT9NE9F+7f27/0///r0rpQt2ucqMVqq6WEkFkERykEwkPItGggAAASKvjNixlEu4N8A55LwruB3AB+uOSUMLDgDjBsI/l05xH44xcgy5ZMWfxySBEsO0idEySX8cwoEecIsTqlOjV+T5XJwmyiUjVaPZX8qlsnDAzMC8XTdVSvX/z5oXzpxE1PmiBmv1alf/mBkYnz5obnTizU2NEDPr/1f//QSm//9YAEAAACRVvkHHeYo4YgA30vCu4GXAAaAuOSUMLDgDgwbCP5dOcQDHGLkGXLJiz+OSQIlh2kTomSS/jmFAjzhFidUp0avyfK5OE2USkarR7K/lUtk4YGZwvF03VUr1/8+XC+dOImp80QM1+rUr/8wMkT/+5JEeoAEI2hHLk5gAIZNCOXJUAAAAAGkHAAAIAAANIOAAAT580L504iamxogn1/Vq//+cSLqf/9aTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",b64toBlob=(B,R="",F=512)=>{const D=atob(B),G=[];for(let W=0;W=0&&K<=1){if(te._volume=K,te._muted)return te;te.usingWebAudio&&te.masterGain.gain.setValueAtTime(K,F.ctx.currentTime);for(var Q=0;Q=0;te--)K._howls[te].unload();return K.usingWebAudio&&K.ctx&&typeof K.ctx.close!="undefined"&&(K.ctx.close(),K.ctx=null,Z()),K},codecs:function(K){return(this||F)._codecs[K.replace(/^x-/,"")]},_setup:function(){var K=this||F;if(K.state=K.ctx&&K.ctx.state||"suspended",K._autoSuspend(),!K.usingWebAudio)if(typeof Audio!="undefined")try{var te=new Audio;typeof te.oncanplaythrough=="undefined"&&(K._canPlayEvent="canplay")}catch{K.noAudio=!0}else K.noAudio=!0;try{var te=new Audio;te.muted&&(K.noAudio=!0)}catch{}return K.noAudio||K._setupCodecs(),K},_setupCodecs:function(){var K=this||F,te=null;try{te=typeof Audio!="undefined"?new Audio:null}catch{return K}if(!te||typeof te.canPlayType!="function")return K;var Q=te.canPlayType("audio/mpeg;").replace(/^no$/,""),ie=K._navigator?K._navigator.userAgent:"",se=ie.match(/OPR\/([0-6].)/g),ne=se&&parseInt(se[0].split("/")[1],10)<33,re=ie.indexOf("Safari")!==-1&&ie.indexOf("Chrome")===-1,ae=ie.match(/Version\/(.*?) /),ce=re&&ae&&parseInt(ae[1],10)<15;return K._codecs={mp3:!!(!ne&&(Q||te.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!Q,opus:!!te.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!te.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!te.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(te.canPlayType('audio/wav; codecs="1"')||te.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!te.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!te.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(te.canPlayType("audio/x-m4a;")||te.canPlayType("audio/m4a;")||te.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(te.canPlayType("audio/x-m4b;")||te.canPlayType("audio/m4b;")||te.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(te.canPlayType("audio/x-mp4;")||te.canPlayType("audio/mp4;")||te.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!ce&&te.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!ce&&te.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!te.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(te.canPlayType("audio/x-flac;")||te.canPlayType("audio/flac;")).replace(/^no$/,"")},K},_unlockAudio:function(){var K=this||F;if(!(K._audioUnlocked||!K.ctx)){K._audioUnlocked=!1,K.autoUnlock=!1,!K._mobileUnloaded&&K.ctx.sampleRate!==44100&&(K._mobileUnloaded=!0,K.unload()),K._scratchBuffer=K.ctx.createBuffer(1,1,22050);var te=function(Q){for(;K._html5AudioPool.length0?re._seek:Q._sprite[K][0]/1e3),he=Math.max(0,(Q._sprite[K][0]+Q._sprite[K][1])/1e3-ce),fe=he*1e3/Math.abs(re._rate),be=Q._sprite[K][0]/1e3,ue=(Q._sprite[K][0]+Q._sprite[K][1])/1e3;re._sprite=K,re._ended=!1;var ge=function(){re._paused=!1,re._seek=ce,re._start=be,re._stop=ue,re._loop=!!(re._loop||Q._sprite[K][2])};if(ce>=ue){Q._ended(re);return}var ve=re._node;if(Q._webAudio){var Se=function(){Q._playLock=!1,ge(),Q._refreshBuffer(re);var de=re._muted||Q._muted?0:re._volume;ve.gain.setValueAtTime(de,F.ctx.currentTime),re._playStart=F.ctx.currentTime,typeof ve.bufferSource.start=="undefined"?re._loop?ve.bufferSource.noteGrainOn(0,ce,86400):ve.bufferSource.noteGrainOn(0,ce,he):re._loop?ve.bufferSource.start(0,ce,86400):ve.bufferSource.start(0,ce,he),fe!==1/0&&(Q._endTimers[re._id]=setTimeout(Q._ended.bind(Q,re),fe)),te||setTimeout(function(){Q._emit("play",re._id),Q._loadQueue()},0)};F.state==="running"&&F.ctx.state!=="interrupted"?Se():(Q._playLock=!0,Q.once("resume",Se),Q._clearTimer(re._id))}else{var pe=function(){ve.currentTime=ce,ve.muted=re._muted||Q._muted||F._muted||ve.muted,ve.volume=re._volume*F.volume(),ve.playbackRate=re._rate;try{var de=ve.play();if(de&&typeof Promise!="undefined"&&(de instanceof Promise||typeof de.then=="function")?(Q._playLock=!0,ge(),de.then(function(){Q._playLock=!1,ve._unlocked=!0,te?Q._loadQueue():Q._emit("play",re._id)}).catch(function(){Q._playLock=!1,Q._emit("playerror",re._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),re._ended=!0,re._paused=!0})):te||(Q._playLock=!1,ge(),Q._emit("play",re._id)),ve.playbackRate=re._rate,ve.paused){Q._emit("playerror",re._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}K!=="__default"||re._loop?Q._endTimers[re._id]=setTimeout(Q._ended.bind(Q,re),fe):(Q._endTimers[re._id]=function(){Q._ended(re),ve.removeEventListener("ended",Q._endTimers[re._id],!1)},ve.addEventListener("ended",Q._endTimers[re._id],!1))}catch(we){Q._emit("playerror",re._id,we)}};ve.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(ve.src=Q._src,ve.load());var ye=window&&window.ejecta||!ve.readyState&&F._navigator.isCocoonJS;if(ve.readyState>=3||ye)pe();else{Q._playLock=!0,Q._state="loading";var Ee=function(){Q._state="loaded",pe(),ve.removeEventListener(F._canPlayEvent,Ee,!1)};ve.addEventListener(F._canPlayEvent,Ee,!1),Q._clearTimer(re._id)}}return re._id},pause:function(K){var te=this;if(te._state!=="loaded"||te._playLock)return te._queue.push({event:"pause",action:function(){te.pause(K)}}),te;for(var Q=te._getSoundIds(K),ie=0;ie=0?ie=parseInt(te[0],10):Q=parseFloat(te[0])}else te.length>=2&&(Q=parseFloat(te[0]),ie=parseInt(te[1],10));var re;if(typeof Q!="undefined"&&Q>=0&&Q<=1){if(K._state!=="loaded"||K._playLock)return K._queue.push({event:"volume",action:function(){K.volume.apply(K,te)}}),K;typeof ie=="undefined"&&(K._volume=Q),ie=K._getSoundIds(ie);for(var ae=0;ae0?ie/he:ie),be=Date.now();K._fadeTo=Q,K._interval=setInterval(function(){var ue=(Date.now()-be)/ie;be=Date.now(),ae+=ce*ue,ae=Math.round(ae*100)/100,ce<0?ae=Math.max(Q,ae):ae=Math.min(Q,ae),re._webAudio?K._volume=ae:re.volume(ae,K._id,!0),ne&&(re._volume=ae),(Qte&&ae>=Q)&&(clearInterval(K._interval),K._interval=null,K._fadeTo=null,re.volume(Q,K._id),re._emit("fade",K._id))},fe)},_stopFade:function(K){var te=this,Q=te._soundById(K);return Q&&Q._interval&&(te._webAudio&&Q._node.gain.cancelScheduledValues(F.ctx.currentTime),clearInterval(Q._interval),Q._interval=null,te.volume(Q._fadeTo,K),Q._fadeTo=null,te._emit("fade",K)),te},loop:function(){var K=this,te=arguments,Q,ie,se;if(te.length===0)return K._loop;if(te.length===1)if(typeof te[0]=="boolean")Q=te[0],K._loop=Q;else return se=K._soundById(parseInt(te[0],10)),se?se._loop:!1;else te.length===2&&(Q=te[0],ie=parseInt(te[1],10));for(var ne=K._getSoundIds(ie),re=0;re=0?ie=parseInt(te[0],10):Q=parseFloat(te[0])}else te.length===2&&(Q=parseFloat(te[0]),ie=parseInt(te[1],10));var re;if(typeof Q=="number"){if(K._state!=="loaded"||K._playLock)return K._queue.push({event:"rate",action:function(){K.rate.apply(K,te)}}),K;typeof ie=="undefined"&&(K._rate=Q),ie=K._getSoundIds(ie);for(var ae=0;ae=0?ie=parseInt(te[0],10):K._sounds.length&&(ie=K._sounds[0]._id,Q=parseFloat(te[0]))}else te.length===2&&(Q=parseFloat(te[0]),ie=parseInt(te[1],10));if(typeof ie=="undefined")return 0;if(typeof Q=="number"&&(K._state!=="loaded"||K._playLock))return K._queue.push({event:"seek",action:function(){K.seek.apply(K,te)}}),K;var re=K._soundById(ie);if(re)if(typeof Q=="number"&&Q>=0){var ae=K.playing(ie);ae&&K.pause(ie,!0),re._seek=Q,re._ended=!1,K._clearTimer(ie),!K._webAudio&&re._node&&!isNaN(re._node.duration)&&(re._node.currentTime=Q);var ce=function(){ae&&K.play(ie,!0),K._emit("seek",ie)};if(ae&&!K._webAudio){var he=function(){K._playLock?setTimeout(he,0):ce()};setTimeout(he,0)}else ce()}else if(K._webAudio){var fe=K.playing(ie)?F.ctx.currentTime-re._playStart:0,be=re._rateSeek?re._rateSeek-re._seek:0;return re._seek+(be+fe*Math.abs(re._rate))}else return re._node.currentTime;return K},playing:function(K){var te=this;if(typeof K=="number"){var Q=te._soundById(K);return Q?!Q._paused:!1}for(var ie=0;ie=0&&F._howls.splice(ie,1);var se=!0;for(Q=0;Q=0){se=!1;break}return U&&se&&delete U[K._src],F.noAudio=!1,K._state="unloaded",K._sounds=[],K=null,null},on:function(K,te,Q,ie){var se=this,ne=se["_on"+K];return typeof te=="function"&&ne.push(ie?{id:Q,fn:te,once:ie}:{id:Q,fn:te}),se},off:function(K,te,Q){var ie=this,se=ie["_on"+K],ne=0;if(typeof te=="number"&&(Q=te,te=null),te||Q)for(ne=0;ne=0;ne--)(!se[ne].id||se[ne].id===te||K==="load")&&(setTimeout(function(re){re.call(this,te,Q)}.bind(ie,se[ne].fn),0),se[ne].once&&ie.off(K,se[ne].fn,se[ne].id));return ie._loadQueue(K),ie},_loadQueue:function(K){var te=this;if(te._queue.length>0){var Q=te._queue[0];Q.event===K&&(te._queue.shift(),te._loadQueue()),K||Q.action()}return te},_ended:function(K){var te=this,Q=K._sprite;if(!te._webAudio&&K._node&&!K._node.paused&&!K._node.ended&&K._node.currentTime=0;ie--){if(Q<=te)return;K._sounds[ie]._ended&&(K._webAudio&&K._sounds[ie]._node&&K._sounds[ie]._node.disconnect(0),K._sounds.splice(ie,1),Q--)}}},_getSoundIds:function(K){var te=this;if(typeof K=="undefined"){for(var Q=[],ie=0;ie=0;if(F._scratchBuffer&&K.bufferSource&&(K.bufferSource.onended=null,K.bufferSource.disconnect(0),Q))try{K.bufferSource.buffer=F._scratchBuffer}catch{}return K.bufferSource=null,te},_clearSound:function(K){var te=/MSIE |Trident\//.test(F._navigator&&F._navigator.userAgent);te||(K.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var G=function(K){this._parent=K,this.init()};G.prototype={init:function(){var K=this,te=K._parent;return K._muted=te._muted,K._loop=te._loop,K._volume=te._volume,K._rate=te._rate,K._seek=0,K._paused=!0,K._ended=!0,K._sprite="__default",K._id=++F._counter,te._sounds.push(K),K.create(),K},create:function(){var K=this,te=K._parent,Q=F._muted||K._muted||K._parent._muted?0:K._volume;return te._webAudio?(K._node=typeof F.ctx.createGain=="undefined"?F.ctx.createGainNode():F.ctx.createGain(),K._node.gain.setValueAtTime(Q,F.ctx.currentTime),K._node.paused=!0,K._node.connect(F.masterGain)):F.noAudio||(K._node=F._obtainHtml5Audio(),K._errorFn=K._errorListener.bind(K),K._node.addEventListener("error",K._errorFn,!1),K._loadFn=K._loadListener.bind(K),K._node.addEventListener(F._canPlayEvent,K._loadFn,!1),K._endFn=K._endListener.bind(K),K._node.addEventListener("ended",K._endFn,!1),K._node.src=te._src,K._node.preload=te._preload===!0?"auto":te._preload,K._node.volume=Q*F.volume(),K._node.load()),K},reset:function(){var K=this,te=K._parent;return K._muted=te._muted,K._loop=te._loop,K._volume=te._volume,K._rate=te._rate,K._seek=0,K._rateSeek=0,K._paused=!0,K._ended=!0,K._sprite="__default",K._id=++F._counter,K},_errorListener:function(){var K=this;K._parent._emit("loaderror",K._id,K._node.error?K._node.error.code:0),K._node.removeEventListener("error",K._errorFn,!1)},_loadListener:function(){var K=this,te=K._parent;te._duration=Math.ceil(K._node.duration*10)/10,Object.keys(te._sprite).length===0&&(te._sprite={__default:[0,te._duration*1e3]}),te._state!=="loaded"&&(te._state="loaded",te._emit("load"),te._loadQueue()),K._node.removeEventListener(F._canPlayEvent,K._loadFn,!1)},_endListener:function(){var K=this,te=K._parent;te._duration===1/0&&(te._duration=Math.ceil(K._node.duration*10)/10,te._sprite.__default[1]===1/0&&(te._sprite.__default[1]=te._duration*1e3),te._ended(K)),K._node.removeEventListener("ended",K._endFn,!1)}};var U={},W=function(K){var te=K._src;if(U[te]){K._duration=U[te].duration,J(K);return}if(/^data:[^;]+;base64,/.test(te)){for(var Q=atob(te.split(",")[1]),ie=new Uint8Array(Q.length),se=0;se0?(U[te._src]=se,J(te,se)):Q()};typeof Promise!="undefined"&&F.ctx.decodeAudioData.length===1?F.ctx.decodeAudioData(K).then(ie).catch(Q):F.ctx.decodeAudioData(K,ie,Q)},J=function(K,te){te&&!K._duration&&(K._duration=te.duration),Object.keys(K._sprite).length===0&&(K._sprite={__default:[0,K._duration*1e3]}),K._state!=="loaded"&&(K._state="loaded",K._emit("load"),K._loadQueue())},Z=function(){if(!!F.usingWebAudio){try{typeof AudioContext!="undefined"?F.ctx=new AudioContext:typeof webkitAudioContext!="undefined"?F.ctx=new webkitAudioContext:F.usingWebAudio=!1}catch{F.usingWebAudio=!1}F.ctx||(F.usingWebAudio=!1);var K=/iP(hone|od|ad)/.test(F._navigator&&F._navigator.platform),te=F._navigator&&F._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),Q=te?parseInt(te[1],10):null;if(K&&Q&&Q<9){var ie=/safari/.test(F._navigator&&F._navigator.userAgent.toLowerCase());F._navigator&&!ie&&(F.usingWebAudio=!1)}F.usingWebAudio&&(F.masterGain=typeof F.ctx.createGain=="undefined"?F.ctx.createGainNode():F.ctx.createGain(),F.masterGain.gain.setValueAtTime(F._muted?0:F._volume,F.ctx.currentTime),F.masterGain.connect(F.ctx.destination)),F._setup()}};B.Howler=F,B.Howl=D,typeof commonjsGlobal$1!="undefined"?(commonjsGlobal$1.HowlerGlobal=R,commonjsGlobal$1.Howler=F,commonjsGlobal$1.Howl=D,commonjsGlobal$1.Sound=G):typeof window!="undefined"&&(window.HowlerGlobal=R,window.Howler=F,window.Howl=D,window.Sound=G)})();/*! * Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported. * * howler.js v2.2.3 * howlerjs.com * * (c) 2013-2020, James Simpson of GoldFire Studios * goldfirestudios.com * * MIT License */(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(F){var D=this;if(!D.ctx||!D.ctx.listener)return D;for(var G=D._howls.length-1;G>=0;G--)D._howls[G].stereo(F);return D},HowlerGlobal.prototype.pos=function(F,D,G){var U=this;if(!U.ctx||!U.ctx.listener)return U;if(D=typeof D!="number"?U._pos[1]:D,G=typeof G!="number"?U._pos[2]:G,typeof F=="number")U._pos=[F,D,G],typeof U.ctx.listener.positionX!="undefined"?(U.ctx.listener.positionX.setTargetAtTime(U._pos[0],Howler.ctx.currentTime,.1),U.ctx.listener.positionY.setTargetAtTime(U._pos[1],Howler.ctx.currentTime,.1),U.ctx.listener.positionZ.setTargetAtTime(U._pos[2],Howler.ctx.currentTime,.1)):U.ctx.listener.setPosition(U._pos[0],U._pos[1],U._pos[2]);else return U._pos;return U},HowlerGlobal.prototype.orientation=function(F,D,G,U,W,q){var Y=this;if(!Y.ctx||!Y.ctx.listener)return Y;var J=Y._orientation;if(D=typeof D!="number"?J[1]:D,G=typeof G!="number"?J[2]:G,U=typeof U!="number"?J[3]:U,W=typeof W!="number"?J[4]:W,q=typeof q!="number"?J[5]:q,typeof F=="number")Y._orientation=[F,D,G,U,W,q],typeof Y.ctx.listener.forwardX!="undefined"?(Y.ctx.listener.forwardX.setTargetAtTime(F,Howler.ctx.currentTime,.1),Y.ctx.listener.forwardY.setTargetAtTime(D,Howler.ctx.currentTime,.1),Y.ctx.listener.forwardZ.setTargetAtTime(G,Howler.ctx.currentTime,.1),Y.ctx.listener.upX.setTargetAtTime(U,Howler.ctx.currentTime,.1),Y.ctx.listener.upY.setTargetAtTime(W,Howler.ctx.currentTime,.1),Y.ctx.listener.upZ.setTargetAtTime(q,Howler.ctx.currentTime,.1)):Y.ctx.listener.setOrientation(F,D,G,U,W,q);else return J;return Y},Howl.prototype.init=function(F){return function(D){var G=this;return G._orientation=D.orientation||[1,0,0],G._stereo=D.stereo||null,G._pos=D.pos||null,G._pannerAttr={coneInnerAngle:typeof D.coneInnerAngle!="undefined"?D.coneInnerAngle:360,coneOuterAngle:typeof D.coneOuterAngle!="undefined"?D.coneOuterAngle:360,coneOuterGain:typeof D.coneOuterGain!="undefined"?D.coneOuterGain:0,distanceModel:typeof D.distanceModel!="undefined"?D.distanceModel:"inverse",maxDistance:typeof D.maxDistance!="undefined"?D.maxDistance:1e4,panningModel:typeof D.panningModel!="undefined"?D.panningModel:"HRTF",refDistance:typeof D.refDistance!="undefined"?D.refDistance:1,rolloffFactor:typeof D.rolloffFactor!="undefined"?D.rolloffFactor:1},G._onstereo=D.onstereo?[{fn:D.onstereo}]:[],G._onpos=D.onpos?[{fn:D.onpos}]:[],G._onorientation=D.onorientation?[{fn:D.onorientation}]:[],F.call(this,D)}}(Howl.prototype.init),Howl.prototype.stereo=function(F,D){var G=this;if(!G._webAudio)return G;if(G._state!=="loaded")return G._queue.push({event:"stereo",action:function(){G.stereo(F,D)}}),G;var U=typeof Howler.ctx.createStereoPanner=="undefined"?"spatial":"stereo";if(typeof D=="undefined")if(typeof F=="number")G._stereo=F,G._pos=[F,0,0];else return G._stereo;for(var W=G._getSoundIds(D),q=0;q(browserInfo$6.huawei?.2:.1)/B*1e3;let htick=new howler.Howl({src:tickUrl,format:["mp3"]}),htock=new howler.Howl({src:tockUrl,format:["mp3"]});class Player{constructor(R,F){this.ticks=[],this.event=new EventEmitter,this.isRuning=!1,this.isNeedStop=!1,this.getTickByDots=(D,G)=>Array.from(Array(D)).map((U,W)=>({time:`0:${(G+W)*1.4}`,note:W===0?"C5":"c4",velocity:1,index:W+G})),this.formatTick=(D,G)=>{const U=[];for(let W=0;W{const Y=U%R.length===0?htick:htock;this.isNeedStop||(Y.play(),console.log(Y)),U{var J;this.isRuning=!1,this.event.emit("stop"),console.log("tick stop"),(J=this.part)==null||J.clear()},450/F),U++},q=()=>{this.isNeedStop||setTimeout(()=>{try{W()}catch(Y){console.log("timeTickError",Y)}},700/F)};W()}async setAudioMode(R,F,D=1){if(await nextTick(),this.isRuning)return;this.isRuning=!0;const G=this.formatTick(R,D);this.startTick(G,F,R,D)}async start(R,F,D=1){this.isNeedStop=!1,this.setAudioMode(R,F,D)}destroy(){this.ticks=[],this.event.emit("destroy"),console.log("destroy"),state$2.activeTick=-1,state$2.activeTickRepeat=1,this.event.removeAllListeners(),this.isRuning=!1,this.isNeedStop=!0,this.part&&(this.part.clear(),this.part=null)}}const originalPostMessage=window.postMessage;window.postMessage=B=>{originalPostMessage(B,"*")};const loop=()=>{},calls={},browserInfo$5=browser();browserInfo$5.isApp&&window.addEventListener("message",B=>{var R,F,D;try{console.log("message",B.data);const G=B.data?typeof B.data=="object"?B.data:JSON.parse(B.data):{},U=((R=G.content)==null?void 0:R.uuid)||G.uuid;try{G.content&&(G.content=JSON.parse(G.content))}catch{}if((F=G==null?void 0:G.content)!=null&&F.uuid,!U){const Y=Object.keys(calls).filter(J=>J.indexOf(G.api)===0);for(const J of Y){const Z=calls[J]||loop;typeof Z=="function"&&Z(G),Array.isArray(Z)&&Z.forEach(K=>{typeof K=="function"&&K(G)})}return}const W=((D=G.content)==null?void 0:D.uuid)||G.uuid||G.api+G.uuid,q=calls[W]||loop;typeof q=="function"&&q(G)}catch{}});var Sc,xc;const instance=window.ORCHESTRA||((xc=(Sc=window.webkit)==null?void 0:Sc.messageHandlers)==null?void 0:xc.ORCHESTRA),postMessage=(B,R)=>{if(browserInfo$5.isApp){const F=getRandomKey();calls[F]=R||loop,B.content=B.content?{...B.content,uuid:F}:{uuid:F},console.log("send:",JSON.stringify(B)),instance.postMessage(JSON.stringify(B))}},listenerMessage=(B,R)=>{if(browserInfo$5.isApp){const F=B;calls[F]||(calls[F]=[]),calls[F].push(R||loop)}},removeListenerMessage=(B,R)=>{if(browserInfo$5.isApp){const F=B;if(Array.isArray(calls[F])){const D=calls[F].indexOf(R);calls[F].splice(D,1)}}},promisefiyPostMessage=B=>new Promise(R=>{postMessage(B,F=>R(F))});function _taggedTemplateLiteral(B,R){return R||(R=B.slice(0)),Object.freeze(Object.defineProperties(B,{raw:{value:Object.freeze(R)}}))}function __decorate(B,R,F,D){var G,U=arguments.length,W=U<3?R:D===null?D=Object.getOwnPropertyDescriptor(R,F):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(B,R,F,D);else for(var q=B.length-1;q>=0;q--)(G=B[q])&&(W=(U<3?G(W):U>3?G(R,F,W):G(R,F))||W);return U>3&&W&&Object.defineProperty(R,F,W),W}/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const t$3=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,e$8=Symbol(),n$5=new Map;class s$3{constructor(R,F){if(this._$cssResult$=!0,F!==e$8)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=R}get styleSheet(){let R=n$5.get(this.cssText);return t$3&&R===void 0&&(n$5.set(this.cssText,R=new CSSStyleSheet),R.replaceSync(this.cssText)),R}toString(){return this.cssText}}const o$5=B=>new s$3(typeof B=="string"?B:B+"",e$8),r$3=(B,...R)=>{const F=B.length===1?B[0]:R.reduce((D,G,U)=>D+(W=>{if(W._$cssResult$===!0)return W.cssText;if(typeof W=="number")return W;throw Error("Value passed to 'css' function must be a 'css' function result: "+W+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(G)+B[U+1],B[0]);return new s$3(F,e$8)},i$3=(B,R)=>{t$3?B.adoptedStyleSheets=R.map(F=>F instanceof CSSStyleSheet?F:F.styleSheet):R.forEach(F=>{const D=document.createElement("style"),G=window.litNonce;G!==void 0&&D.setAttribute("nonce",G),D.textContent=F.cssText,B.appendChild(D)})},S$1=t$3?B=>B:B=>B instanceof CSSStyleSheet?(R=>{let F="";for(const D of R.cssRules)F+=D.cssText;return o$5(F)})(B):B;var s$2;const e$7=window.trustedTypes,r$2=e$7?e$7.emptyScript:"",h$2=window.reactiveElementPolyfillSupport,o$4={toAttribute(B,R){switch(R){case Boolean:B=B?r$2:null;break;case Object:case Array:B=B==null?B:JSON.stringify(B)}return B},fromAttribute(B,R){let F=B;switch(R){case Boolean:F=B!==null;break;case Number:F=B===null?null:Number(B);break;case Object:case Array:try{F=JSON.parse(B)}catch{F=null}}return F}},n$4=(B,R)=>R!==B&&(R==R||B==B),l$3={attribute:!0,type:String,converter:o$4,reflect:!1,hasChanged:n$4};class a$1 extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(R){var F;(F=this.l)!==null&&F!==void 0||(this.l=[]),this.l.push(R)}static get observedAttributes(){this.finalize();const R=[];return this.elementProperties.forEach((F,D)=>{const G=this._$Eh(D,F);G!==void 0&&(this._$Eu.set(G,D),R.push(G))}),R}static createProperty(R,F=l$3){if(F.state&&(F.attribute=!1),this.finalize(),this.elementProperties.set(R,F),!F.noAccessor&&!this.prototype.hasOwnProperty(R)){const D=typeof R=="symbol"?Symbol():"__"+R,G=this.getPropertyDescriptor(R,D,F);G!==void 0&&Object.defineProperty(this.prototype,R,G)}}static getPropertyDescriptor(R,F,D){return{get(){return this[F]},set(G){const U=this[R];this[F]=G,this.requestUpdate(R,U,D)},configurable:!0,enumerable:!0}}static getPropertyOptions(R){return this.elementProperties.get(R)||l$3}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const R=Object.getPrototypeOf(this);if(R.finalize(),this.elementProperties=new Map(R.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const F=this.properties,D=[...Object.getOwnPropertyNames(F),...Object.getOwnPropertySymbols(F)];for(const G of D)this.createProperty(G,F[G])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(R){const F=[];if(Array.isArray(R)){const D=new Set(R.flat(1/0).reverse());for(const G of D)F.unshift(S$1(G))}else R!==void 0&&F.push(S$1(R));return F}static _$Eh(R,F){const D=F.attribute;return D===!1?void 0:typeof D=="string"?D:typeof R=="string"?R.toLowerCase():void 0}o(){var R;this._$Ep=new Promise(F=>this.enableUpdating=F),this._$AL=new Map,this._$Em(),this.requestUpdate(),(R=this.constructor.l)===null||R===void 0||R.forEach(F=>F(this))}addController(R){var F,D;((F=this._$Eg)!==null&&F!==void 0?F:this._$Eg=[]).push(R),this.renderRoot!==void 0&&this.isConnected&&((D=R.hostConnected)===null||D===void 0||D.call(R))}removeController(R){var F;(F=this._$Eg)===null||F===void 0||F.splice(this._$Eg.indexOf(R)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach((R,F)=>{this.hasOwnProperty(F)&&(this._$Et.set(F,this[F]),delete this[F])})}createRenderRoot(){var R;const F=(R=this.shadowRoot)!==null&&R!==void 0?R:this.attachShadow(this.constructor.shadowRootOptions);return i$3(F,this.constructor.elementStyles),F}connectedCallback(){var R;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(R=this._$Eg)===null||R===void 0||R.forEach(F=>{var D;return(D=F.hostConnected)===null||D===void 0?void 0:D.call(F)})}enableUpdating(R){}disconnectedCallback(){var R;(R=this._$Eg)===null||R===void 0||R.forEach(F=>{var D;return(D=F.hostDisconnected)===null||D===void 0?void 0:D.call(F)})}attributeChangedCallback(R,F,D){this._$AK(R,D)}_$ES(R,F,D=l$3){var G,U;const W=this.constructor._$Eh(R,D);if(W!==void 0&&D.reflect===!0){const q=((U=(G=D.converter)===null||G===void 0?void 0:G.toAttribute)!==null&&U!==void 0?U:o$4.toAttribute)(F,D.type);this._$Ei=R,q==null?this.removeAttribute(W):this.setAttribute(W,q),this._$Ei=null}}_$AK(R,F){var D,G,U;const W=this.constructor,q=W._$Eu.get(R);if(q!==void 0&&this._$Ei!==q){const Y=W.getPropertyOptions(q),J=Y.converter,Z=(U=(G=(D=J)===null||D===void 0?void 0:D.fromAttribute)!==null&&G!==void 0?G:typeof J=="function"?J:null)!==null&&U!==void 0?U:o$4.fromAttribute;this._$Ei=q,this[q]=Z(F,Y.type),this._$Ei=null}}requestUpdate(R,F,D){let G=!0;R!==void 0&&(((D=D||this.constructor.getPropertyOptions(R)).hasChanged||n$4)(this[R],F)?(this._$AL.has(R)||this._$AL.set(R,F),D.reflect===!0&&this._$Ei!==R&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(R,D))):G=!1),!this.isUpdatePending&&G&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(F){Promise.reject(F)}const R=this.scheduleUpdate();return R!=null&&await R,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var R;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach((G,U)=>this[U]=G),this._$Et=void 0);let F=!1;const D=this._$AL;try{F=this.shouldUpdate(D),F?(this.willUpdate(D),(R=this._$Eg)===null||R===void 0||R.forEach(G=>{var U;return(U=G.hostUpdate)===null||U===void 0?void 0:U.call(G)}),this.update(D)):this._$EU()}catch(G){throw F=!1,this._$EU(),G}F&&this._$AE(D)}willUpdate(R){}_$AE(R){var F;(F=this._$Eg)===null||F===void 0||F.forEach(D=>{var G;return(G=D.hostUpdated)===null||G===void 0?void 0:G.call(D)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(R)),this.updated(R)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(R){return!0}update(R){this._$EC!==void 0&&(this._$EC.forEach((F,D)=>this._$ES(D,this[D],F)),this._$EC=void 0),this._$EU()}updated(R){}firstUpdated(R){}}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */var t$2;a$1.finalized=!0,a$1.elementProperties=new Map,a$1.elementStyles=[],a$1.shadowRootOptions={mode:"open"},h$2==null||h$2({ReactiveElement:a$1}),((s$2=globalThis.reactiveElementVersions)!==null&&s$2!==void 0?s$2:globalThis.reactiveElementVersions=[]).push("1.3.1");const i$2=globalThis.trustedTypes,s$1=i$2?i$2.createPolicy("lit-html",{createHTML:B=>B}):void 0,e$6=`lit$${(Math.random()+"").slice(9)}$`,o$3="?"+e$6,n$3=`<${o$3}>`,l$2=document,h$1=(B="")=>l$2.createComment(B),r$1=B=>B===null||typeof B!="object"&&typeof B!="function",d=Array.isArray,u$1=B=>{var R;return d(B)||typeof((R=B)===null||R===void 0?void 0:R[Symbol.iterator])=="function"},c$2=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v$1=/-->/g,a$2=/>/g,f$1=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,_$1=/'/g,m$2=/"/g,g=/^(?:script|style|textarea|title)$/i,p$1=B=>(R,...F)=>({_$litType$:B,strings:R,values:F}),$=p$1(1),b=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),T$1=new WeakMap,x=(B,R,F)=>{var D,G;const U=(D=F==null?void 0:F.renderBefore)!==null&&D!==void 0?D:R;let W=U._$litPart$;if(W===void 0){const q=(G=F==null?void 0:F.renderBefore)!==null&&G!==void 0?G:null;U._$litPart$=W=new N$1(R.insertBefore(h$1(),q),q,void 0,F!=null?F:{})}return W._$AI(B),W},A=l$2.createTreeWalker(l$2,129,null,!1),C=(B,R)=>{const F=B.length-1,D=[];let G,U=R===2?"":"",W=c$2;for(let Y=0;Y"?(W=G!=null?G:c$2,te=-1):K[1]===void 0?te=-2:(te=W.lastIndex-K[2].length,Z=K[1],W=K[3]===void 0?f$1:K[3]==='"'?m$2:_$1):W===m$2||W===_$1?W=f$1:W===v$1||W===a$2?W=c$2:(W=f$1,G=void 0);const ie=W===f$1&&B[Y+1].startsWith("/>")?" ":"";U+=W===c$2?J+n$3:te>=0?(D.push(Z),J.slice(0,te)+"$lit$"+J.slice(te)+e$6+ie):J+e$6+(te===-2?(D.push(void 0),Y):ie)}const q=U+(B[F]||"")+(R===2?"":"");if(!Array.isArray(B)||!B.hasOwnProperty("raw"))throw Error("invalid template strings array");return[s$1!==void 0?s$1.createHTML(q):q,D]};class E{constructor({strings:R,_$litType$:F},D){let G;this.parts=[];let U=0,W=0;const q=R.length-1,Y=this.parts,[J,Z]=C(R,F);if(this.el=E.createElement(J,D),A.currentNode=this.el.content,F===2){const K=this.el.content,te=K.firstChild;te.remove(),K.append(...te.childNodes)}for(;(G=A.nextNode())!==null&&Y.length0){G.textContent=i$2?i$2.emptyScript:"";for(let Q=0;Q2||D[0]!==""||D[1]!==""?(this._$AH=Array(D.length-1).fill(new String),this.strings=D):this._$AH=w}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(R,F=this,D,G){const U=this.strings;let W=!1;if(U===void 0)R=P(this,R,F,0),W=!r$1(R)||R!==this._$AH&&R!==b,W&&(this._$AH=R);else{const q=R;let Y,J;for(R=U[0],Y=0;YR=>typeof R=="function"?((F,D)=>(window.customElements.define(F,D),D))(B,R):((F,D)=>{const{kind:G,elements:U}=D;return{kind:G,elements:U,finisher(W){window.customElements.define(F,W)}}})(B,R),i$1$1=(B,R)=>R.kind==="method"&&R.descriptor&&!("value"in R.descriptor)?{...R,finisher(F){F.createProperty(R.key,B)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:R.key,initializer(){typeof R.initializer=="function"&&(this[R.key]=R.initializer.call(this))},finisher(F){F.createProperty(R.key,B)}};function e$5(B){return(R,F)=>F!==void 0?((D,G,U)=>{G.constructor.createProperty(U,D)})(B,R,F):i$1$1(B,R);/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const o$1=({finisher:B,descriptor:R})=>(F,D)=>{var G;if(D===void 0){const U=(G=F.originalKey)!==null&&G!==void 0?G:F.key,W=R!=null?{kind:"method",placement:"prototype",key:U,descriptor:R(F.key)}:{...F,key:U};return B!=null&&(W.finisher=function(q){B(q,U)}),W}{const U=F.constructor;R!==void 0&&Object.defineProperty(F,D,R(D)),B==null||B(U,D)}};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */function i$4(B,R){return o$1({descriptor:F=>{const D={get(){var G,U;return(U=(G=this.renderRoot)===null||G===void 0?void 0:G.querySelector(B))!==null&&U!==void 0?U:null},enumerable:!0,configurable:!0};if(R){const G=typeof F=="symbol"?Symbol():"__"+F;D.get=function(){var U,W;return this[G]===void 0&&(this[G]=(W=(U=this.renderRoot)===null||U===void 0?void 0:U.querySelector(B))!==null&&W!==void 0?W:null),this[G]}}return D}})}/** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */var n$6;((n$6=window.HTMLSlotElement)===null||n$6===void 0?void 0:n$6.prototype.assignedElements)!=null;var commonjsGlobal=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function createCommonjsModule$1(B,R,F){return B(F={path:R,exports:{},require:function(D,G){return commonjsRequire(D,G==null?F.path:G)}},F.exports),F.exports}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var lottie_svg=createCommonjsModule$1(function(module,exports){typeof navigator!="undefined"&&function(B,R){module.exports=R()}(0,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(B){_useWebWorker=!!B},getWebWorker=function(){return _useWebWorker},setLocationHref=function(B){locationHref=B},getLocationHref=function(){return locationHref};function createTag(B){return document.createElement(B)}function extendPrototype(B,R){var F,D,G=B.length;for(F=0;F1?F[1]=1:F[1]<=0&&(F[1]=0),HSVtoRGB(F[0],F[1],F[2])}function addBrightnessToRGB(B,R){var F=RGBtoHSV(255*B[0],255*B[1],255*B[2]);return F[2]+=R,F[2]>1?F[2]=1:F[2]<0&&(F[2]=0),HSVtoRGB(F[0],F[1],F[2])}function addHueToRGB(B,R){var F=RGBtoHSV(255*B[0],255*B[1],255*B[2]);return F[0]+=R/360,F[0]>1?F[0]-=1:F[0]<0&&(F[0]+=1),HSVtoRGB(F[0],F[1],F[2])}var rgbToHex=function(){var B,R,F=[];for(B=0;B<256;B+=1)R=B.toString(16),F[B]=R.length===1?"0"+R:R;return function(D,G,U){return D<0&&(D=0),G<0&&(G=0),U<0&&(U=0),"#"+F[D]+F[G]+F[U]}}(),setSubframeEnabled=function(B){subframeEnabled=!!B},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(B){expressionsPlugin=B},getExpressionsPlugin=function(){return expressionsPlugin},setDefaultCurveSegments=function(B){defaultCurveSegments=B},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(B){idPrefix=B};function createNS(B){return document.createElementNS(svgNS,B)}function _typeof$5(B){return(_typeof$5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R})(B)}var dataManager=function(){var B,R,F=1,D=[],G={onmessage:function(){},postMessage:function(Y){B({data:Y})}},U={postMessage:function(Y){G.onmessage({data:Y})}};function W(){R||((R=function(Y){if(window.Worker&&window.Blob&&getWebWorker()){var J=new Blob(["var _workerSelf = self; self.onmessage = ",Y.toString()],{type:"text/javascript"}),Z=URL.createObjectURL(J);return new Worker(Z)}return B=Y,G}(function(Y){if(U.dataManager||(U.dataManager=function(){function Z(ue,ge){var ve,Se,pe,ye,Ee,de,we=ue.length;for(Se=0;Se=0;ge-=1)if(ue[ge].ty==="sh")if(ue[ge].ks.k.i)Q(ue[ge].ks.k);else for(Se=ue[ge].ks.k.length,ve=0;veve[0]||!(ve[0]>ue[0])&&(ue[1]>ve[1]||!(ve[1]>ue[1])&&(ue[2]>ve[2]||!(ve[2]>ue[2])&&null))}var se,ne=function(){var ue=[4,4,14];function ge(ve){var Se,pe,ye,Ee=ve.length;for(Se=0;Se=0;pe-=1)if(Se[pe].ty==="sh")if(Se[pe].ks.k.i)Se[pe].ks.k.c=Se[pe].closed;else for(Ee=Se[pe].ks.k.length,ye=0;ye500)&&(this._imageLoaded(),clearInterval(J)),Y+=1}.bind(this),50)}function U(q){var Y={assetData:q},J=D(q,this.assetsPath,this.path);return dataManager.loadData(J,function(Z){Y.img=Z,this._footageLoaded()}.bind(this),function(){Y.img={},this._footageLoaded()}.bind(this)),Y}function W(){this._imageLoaded=R.bind(this),this._footageLoaded=F.bind(this),this.testImageLoaded=G.bind(this),this.createFootageData=U.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return W.prototype={loadAssets:function(q,Y){var J;this.imagesLoadedCb=Y;var Z=q.length;for(J=0;Jthis.animationData.op&&(this.animationData.op=B.op,this.totalFrames=Math.floor(B.op-this.animationData.ip));var R,F,D=this.animationData.layers,G=D.length,U=B.layers,W=U.length;for(F=0;Fthis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(this.isLoaded!==!1&&this.renderer)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(B){this.triggerRenderFrameError(B)}},AnimationItem.prototype.play=function(B){B&&this.name!==B||this.isPaused===!0&&(this.isPaused=!1,this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(B){B&&this.name!==B||this.isPaused===!1&&(this.isPaused=!0,this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(B){B&&this.name!==B||(this.isPaused===!0?this.play():this.pause())},AnimationItem.prototype.stop=function(B){B&&this.name!==B||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(B){for(var R,F=0;F=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?R>=this.totalFrames?(this.playCount+=1,this.checkSegments(R%this.totalFrames)||(this.setCurrentRawFrameValue(R%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(R):this.checkSegments(R>this.totalFrames?R%this.totalFrames:0)||(F=!0,R=this.totalFrames-1):R<0?this.checkSegments(R%this.totalFrames)||(!this.loop||this.playCount--<=0&&this.loop!==!0?(F=!0,R=0):(this.setCurrentRawFrameValue(this.totalFrames+R%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(R),F&&(this.setCurrentRawFrameValue(R),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(B,R){this.playCount=0,B[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=B[0]-B[1],this.timeCompleted=this.totalFrames,this.firstFrame=B[1],this.setCurrentRawFrameValue(this.totalFrames-.001-R)):B[1]>B[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=B[1]-B[0],this.timeCompleted=this.totalFrames,this.firstFrame=B[0],this.setCurrentRawFrameValue(.001+R)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(B,R){var F=-1;this.isPaused&&(this.currentRawFrame+this.firstFrameR&&(F=R-B)),this.firstFrame=B,this.totalFrames=R-B,this.timeCompleted=this.totalFrames,F!==-1&&this.goToAndStop(F,!0)},AnimationItem.prototype.playSegments=function(B,R){if(R&&(this.segments.length=0),_typeof$4(B[0])==="object"){var F,D=B.length;for(F=0;F=0;ne-=1)R[ne].animation.destroy(se)},B.freeze=function(){W=!0},B.unfreeze=function(){W=!1,ie()},B.setVolume=function(se,ne){var re;for(re=0;re=.001?function(re,ae,ce,he){for(var fe=0;fe<4;++fe){var be=q(ae,ce,he);if(be===0)return ae;ae-=(W(ae,ce,he)-re)/be}return ae}(J,se,Z,K):ne===0?se:function(re,ae,ce,he,fe){var be,ue,ge=0;do(be=W(ue=ae+(ce-ae)/2,he,fe)-re)>0?ce=ue:ae=ue;while(Math.abs(be)>1e-7&&++ge<10);return ue}(J,Q,Q+.1,Z,K)}},B}(),pooling={double:function(B){return B.concat(createSizedArray(B.length))}},poolFactory=function(B,R,F){var D=0,G=B,U=createSizedArray(G);return{newElement:function(){return D?U[D-=1]:R()},release:function(W){D===G&&(U=pooling.double(U),G*=2),F&&F(W),U[D]=W,D+=1}}},bezierLengthPool=poolFactory(8,function(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}),segmentsLengthPool=poolFactory(8,function(){return{lengths:[],totalLength:0}},function(B){var R,F=B.lengths.length;for(R=0;R-.001&&se<.001}var F=function(J,Z,K,te){var Q,ie,se,ne,re,ae,ce=getDefaultCurveSegments(),he=0,fe=[],be=[],ue=bezierLengthPool.newElement();for(se=K.length,Q=0;Qse?-1:1,ae=!0;ae;)if(te[ie]<=se&&te[ie+1]>se?(ne=(se-te[ie])/(te[ie+1]-te[ie]),ae=!1):ie+=re,ie<0||ie>=Q-1){if(ie===Q-1)return K[ie];ae=!1}return K[ie]+(K[ie+1]-K[ie])*ne}var Y=createTypedArray("float32",8);return{getSegmentsLength:function(J){var Z,K=segmentsLengthPool.newElement(),te=J.c,Q=J.v,ie=J.o,se=J.i,ne=J._length,re=K.lengths,ae=0;for(Z=0;Z1&&(Q=1);var ne,re=q(Q,se),ae=q(ie=ie>1?1:ie,se),ce=J.length,he=1-re,fe=1-ae,be=he*he*he,ue=re*he*he*3,ge=re*re*he*3,ve=re*re*re,Se=he*he*fe,pe=re*he*fe+he*re*fe+he*he*ae,ye=re*re*fe+he*re*ae+re*he*ae,Ee=re*re*ae,de=he*fe*fe,we=re*fe*fe+he*ae*fe+he*fe*ae,Oe=re*ae*fe+he*ae*ae+re*fe*ae,Me=re*ae*ae,Pe=fe*fe*fe,Ne=ae*fe*fe+fe*ae*fe+fe*fe*ae,ke=ae*ae*fe+fe*ae*ae+ae*fe*ae,Ae=ae*ae*ae;for(ne=0;nehe?ce>fe?ce-he-fe:fe-he-ce:fe>he?fe-he-ce:he-ce-fe)>-1e-4&&ae<1e-4}}}var bez=bezFunction(),PropertyFactory=function(){var B=initialDefaultFrame,R=Math.abs;function F(te,Q){var ie,se=this.offsetTime;this.propType==="multidimensional"&&(ie=createTypedArray("float32",this.pv.length));for(var ne,re,ae,ce,he,fe,be,ue,ge,ve=Q.lastIndex,Se=ve,pe=this.keyframes.length-1,ye=!0;ye;){if(ne=this.keyframes[Se],re=this.keyframes[Se+1],Se===pe-1&&te>=re.t-se){ne.h&&(ne=re),ve=0;break}if(re.t-se>te){ve=Se;break}Se=de||te=de?Oe.points.length-1:0;for(he=Oe.points[Me].point.length,ce=0;ce=ke&&Ne=de?(ie[0]=Ee[0],ie[1]=Ee[1],ie[2]=Ee[2]):te<=we?(ie[0]=ne.s[0],ie[1]=ne.s[1],ie[2]=ne.s[2]):function(Ge,We){var Ve=We[0],Ze=We[1],nt=We[2],at=We[3],ct=Math.atan2(2*Ze*at-2*Ve*nt,1-2*Ze*Ze-2*nt*nt),De=Math.asin(2*Ve*Ze+2*nt*at),xe=Math.atan2(2*Ve*at-2*Ze*nt,1-2*Ve*Ve-2*nt*nt);Ge[0]=ct/degToRads,Ge[1]=De/degToRads,Ge[2]=xe/degToRads}(ie,function(Ge,We,Ve){var Ze,nt,at,ct,De,xe=[],ze=Ge[0],qe=Ge[1],Re=Ge[2],Le=Ge[3],je=We[0],Xe=We[1],Qe=We[2],He=We[3];return(nt=ze*je+qe*Xe+Re*Qe+Le*He)<0&&(nt=-nt,je=-je,Xe=-Xe,Qe=-Qe,He=-He),1-nt>1e-6?(Ze=Math.acos(nt),at=Math.sin(Ze),ct=Math.sin((1-Ve)*Ze)/at,De=Math.sin(Ve*Ze)/at):(ct=1-Ve,De=Ve),xe[0]=ct*ze+De*je,xe[1]=ct*qe+De*Xe,xe[2]=ct*Re+De*Qe,xe[3]=ct*Le+De*He,xe}(D(ne.s),D(Ee),(te-we)/(de-we)));else for(Se=0;Se=de?fe=1:te=ie&&te>=ie||this._caching.lastFrame=te&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var se=this.interpolateValue(te,this._caching);this.pv=se}return this._caching.lastFrame=te,this.pv}function U(te){var Q;if(this.propType==="unidimensional")Q=te*this.mult,R(this.v-Q)>1e-5&&(this.v=Q,this._mdf=!0);else for(var ie=0,se=this.v.length;ie1e-5&&(this.v[ie]=Q,this._mdf=!0),ie+=1}function W(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var te;this.lock=!0,this._mdf=this._isFirstFrame;var Q=this.effectsSequence.length,ie=this.kf?this.pv:this.data.k;for(te=0;te=this._maxLength&&this.doubleArrayLength(),F){case"v":U=this.v;break;case"i":U=this.i;break;case"o":U=this.o;break;default:U=[]}(!U[D]||U[D]&&!G)&&(U[D]=pointPool.newElement()),U[D][0]=B,U[D][1]=R},ShapePath.prototype.setTripleAt=function(B,R,F,D,G,U,W,q){this.setXYAt(B,R,"v",W,q),this.setXYAt(F,D,"o",W,q),this.setXYAt(G,U,"i",W,q)},ShapePath.prototype.reverse=function(){var B=new ShapePath;B.setPathData(this.c,this._length);var R=this.v,F=this.o,D=this.i,G=0;this.c&&(B.setTripleAt(R[0][0],R[0][1],D[0][0],D[0][1],F[0][0],F[0][1],0,!1),G=1);var U,W=this._length-1,q=this._length;for(U=G;U=ve[ve.length-1].t-this.offsetTime)se=ve[ve.length-1].s?ve[ve.length-1].s[0]:ve[ve.length-2].e[0],re=!0;else{for(var Se,pe,ye,Ee=ge,de=ve.length-1,we=!0;we&&(Se=ve[Ee],!((pe=ve[Ee+1]).t-this.offsetTime>te));)Ee=pe.t-this.offsetTime)be=1;else if(teie&&te>ie)||(this._caching.lastIndex=se0||Me>-1e-6&&Me<0?D(1e4*Me)/1e4:Me}function Oe(){var Me=this.props;return"matrix("+we(Me[0])+","+we(Me[1])+","+we(Me[4])+","+we(Me[5])+","+we(Me[12])+","+we(Me[13])+")"}return function(){this.reset=G,this.rotate=U,this.rotateX=W,this.rotateY=q,this.rotateZ=Y,this.skew=Z,this.skewFromAxis=K,this.shear=J,this.scale=te,this.setTransform=Q,this.translate=ie,this.transform=se,this.applyToPoint=he,this.applyToX=fe,this.applyToY=be,this.applyToZ=ue,this.applyToPointArray=ye,this.applyToTriplePoints=pe,this.applyToPointStringified=Ee,this.toCSS=de,this.to2dCSS=Oe,this.clone=ae,this.cloneFromProps=ce,this.equals=re,this.inversePoints=Se,this.inversePoint=ve,this.getInverseMatrix=ge,this._t=this.transform,this.isIdentity=ne,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(B){return(_typeof$3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R})(B)}var lottie={},standalone="__[STANDALONE]__",queryString;function setLocation(B){setLocationHref(B)}function searchAnimations(){animationManager.searchAnimations()}function setSubframeRendering(B){setSubframeEnabled(B)}function setPrefix(B){setIdPrefix(B)}function loadAnimation(B){return animationManager.loadAnimation(B)}function setQuality(B){if(typeof B=="string")switch(B){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10)}else!isNaN(B)&&B>1&&setDefaultCurveSegments(B)}function inBrowser(){return typeof navigator!="undefined"}function installPlugin(B,R){B==="expressions"&&setExpressionsPlugin(R)}function getFactory(B){switch(B){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(B){for(var R=queryString.split("&"),F=0;F=1?U.push({s:B-1,e:R-1}):(U.push({s:B,e:1}),U.push({s:0,e:R-1}));var W,q,Y=[],J=U.length;for(W=0;WD+F||(Z=q.s*G<=D?0:(q.s*G-D)/F,K=q.e*G>=D+F?1:(q.e*G-D)/F,Y.push([Z,K]))}return Y.length||Y.push([0,0]),Y},TrimModifier.prototype.releasePathsData=function(B){var R,F=B.length;for(R=0;R1?1+U:this.s.v<0?0+U:this.s.v+U)>(F=this.e.v>1?1+U:this.e.v<0?0+U:this.e.v+U)){var W=R;R=F,F=W}R=1e-4*Math.round(1e4*R),F=1e-4*Math.round(1e4*F),this.sValue=R,this.eValue=F}else R=this.sValue,F=this.eValue;var q,Y,J,Z,K,te=this.shapes.length,Q=0;if(F===R)for(G=0;G=0;G-=1)if((ie=this.shapes[G]).shape._mdf){for((se=ie.localShapeCollection).releaseShapes(),this.m===2&&te>1?(re=this.calculateShapeEdges(R,F,ie.totalShapeLength,he,Q),he+=ie.totalShapeLength):re=[[ae,ce]],Y=re.length,q=0;q=1?ne.push({s:ie.totalShapeLength*(ae-1),e:ie.totalShapeLength*(ce-1)}):(ne.push({s:ie.totalShapeLength*ae,e:ie.totalShapeLength}),ne.push({s:0,e:ie.totalShapeLength*(ce-1)}));var fe=this.addShapes(ie,ne[0]);if(ne[0].s!==ne[0].e){if(ne.length>1)if(ie.shape.paths.shapes[ie.shape.paths._length-1].c){var be=fe.pop();this.addPaths(fe,se),fe=this.addShapes(ie,ne[1],be)}else this.addPaths(fe,se),fe=this.addShapes(ie,ne[1]);this.addPaths(fe,se)}}ie.shape.paths=se}}},TrimModifier.prototype.addPaths=function(B,R){var F,D=B.length;for(F=0;FR.e){F.c=!1;break}R.s<=ie&&R.e>=ie+W.addedLength?(this.addSegment(te[D].v[G-1],te[D].o[G-1],te[D].i[G],te[D].v[G],F,q,ne),ne=!1):(J=bez.getNewSegment(te[D].v[G-1],te[D].v[G],te[D].o[G-1],te[D].i[G],(R.s-ie)/W.addedLength,(R.e-ie)/W.addedLength,Y[G-1]),this.addSegmentFromArray(J,F,q,ne),ne=!1,F.c=!1),ie+=W.addedLength,q+=1}if(te[D].c&&Y.length){if(W=Y[G-1],ie<=R.e){var re=Y[G-1].addedLength;R.s<=ie&&R.e>=ie+re?(this.addSegment(te[D].v[G-1],te[D].o[G-1],te[D].i[0],te[D].v[0],F,q,ne),ne=!1):(J=bez.getNewSegment(te[D].v[G-1],te[D].v[0],te[D].o[G-1],te[D].i[0],(R.s-ie)/re,(R.e-ie)/re,Y[G-1]),this.addSegmentFromArray(J,F,q,ne),ne=!1,F.c=!1)}else F.c=!1;ie+=W.addedLength,q+=1}if(F._length&&(F.setXYAt(F.v[Z][0],F.v[Z][1],"i",Z),F.setXYAt(F.v[F._length-1][0],F.v[F._length-1][1],"o",F._length-1)),ie>R.e)break;D=this.p.keyframes[this.p.keyframes.length-1].t?(G=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/D,0),U=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/D,0)):(G=this.p.pv,U=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/D,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){G=[],U=[];var W=this.px,q=this.py;W._caching.lastFrame+W.offsetTime<=W.keyframes[0].t?(G[0]=W.getValueAtTime((W.keyframes[0].t+.01)/D,0),G[1]=q.getValueAtTime((q.keyframes[0].t+.01)/D,0),U[0]=W.getValueAtTime(W.keyframes[0].t/D,0),U[1]=q.getValueAtTime(q.keyframes[0].t/D,0)):W._caching.lastFrame+W.offsetTime>=W.keyframes[W.keyframes.length-1].t?(G[0]=W.getValueAtTime(W.keyframes[W.keyframes.length-1].t/D,0),G[1]=q.getValueAtTime(q.keyframes[q.keyframes.length-1].t/D,0),U[0]=W.getValueAtTime((W.keyframes[W.keyframes.length-1].t-.01)/D,0),U[1]=q.getValueAtTime((q.keyframes[q.keyframes.length-1].t-.01)/D,0)):(G=[W.pv,q.pv],U[0]=W.getValueAtTime((W._caching.lastFrame+W.offsetTime-.01)/D,W.offsetTime),U[1]=q.getValueAtTime((q._caching.lastFrame+q.offsetTime-.01)/D,q.offsetTime))}else G=U=B;this.v.rotate(-Math.atan2(G[1]-U[1],G[0]-U[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],R),R.prototype.addDynamicProperty=function(F){this._addDynamicProperty(F),this.elem.addDynamicProperty(F),this._isDirty=!0},R.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(F,D,G){return new R(F,D,G)}}}();function RepeaterModifier(){}function RoundCornersModifier(){}function getFontProperties(B){for(var R=B.fStyle?B.fStyle.split(" "):[],F="normal",D="normal",G=R.length,U=0;U0;)F-=1,this._elements.unshift(R[F]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(B){var R,F=B.length;for(R=0;R0?Math.floor(te):Math.ceil(te),se=this.pMatrix.props,ne=this.rMatrix.props,re=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var ae,ce,he=0;if(te>0){for(;heie;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),he-=1;Q&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-Q,!0),he-=Q)}for(D=this.data.m===1?0:this._currentCopies-1,G=this.data.m===1?1:-1,U=this._currentCopies;U;){if(ce=(F=(R=this.elemsData[D].it)[R.length-1].transform.mProps.v.props).length,R[R.length-1].transform.mProps._mdf=!0,R[R.length-1].transform.op._mdf=!0,R[R.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(D/(this._currentCopies-1)),he!==0){for((D!==0&&G===1||D!==this._currentCopies-1&&G===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(ne[0],ne[1],ne[2],ne[3],ne[4],ne[5],ne[6],ne[7],ne[8],ne[9],ne[10],ne[11],ne[12],ne[13],ne[14],ne[15]),this.matrix.transform(re[0],re[1],re[2],re[3],re[4],re[5],re[6],re[7],re[8],re[9],re[10],re[11],re[12],re[13],re[14],re[15]),this.matrix.transform(se[0],se[1],se[2],se[3],se[4],se[5],se[6],se[7],se[8],se[9],se[10],se[11],se[12],se[13],se[14],se[15]),ae=0;ae0&&(se=!1),se){var ne=createTag("style");ne.setAttribute("f-forigin",Z[J].fOrigin),ne.setAttribute("f-origin",Z[J].origin),ne.setAttribute("f-family",Z[J].fFamily),ne.type="text/css",ne.innerText="@font-face {font-family: "+Z[J].fFamily+"; font-style: normal; src: url('"+Z[J].fPath+"');}",Y.appendChild(ne)}}else if(Z[J].fOrigin==="g"||Z[J].origin===1){for(Q=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),ie=0;ieB?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var B,R=this.renderableComponents.length;for(B=0;B0&&(this.maskElement.setAttribute("id",ne),this.element.maskedElement.setAttribute(ae,"url("+getLocationHref()+"#"+ne+")"),U.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}FootageElement.prototype.prepareFrame=function(){},extendPrototype([RenderableElement,BaseElement,FrameElement],FootageElement),FootageElement.prototype.getBaseElement=function(){return null},FootageElement.prototype.renderFrame=function(){},FootageElement.prototype.destroy=function(){},FootageElement.prototype.initExpressions=function(){this.layerInterface=FootageInterface(this)},FootageElement.prototype.getFootageData=function(){return this.footageData},AudioElement.prototype.prepareFrame=function(B){if(this.prepareRenderableFrame(B,!0),this.prepareProperties(B,!0),this.tm._placeholder)this._currentTime=B/this.data.sr;else{var R=this.tm.v;this._currentTime=R}},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(B){this.audio.rate(B)},AudioElement.prototype.volume=function(B){this.audio.volume(B)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},BaseRenderer.prototype.checkLayers=function(B){var R,F,D=this.layers.length;for(this.completeLayers=!0,R=D-1;R>=0;R-=1)this.elements[R]||(F=this.layers[R]).ip-F.st<=B-this.layers[R].st&&F.op-F.st>B-this.layers[R].st&&this.buildItem(R),this.completeLayers=!!this.elements[R]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(B){switch(B.ty){case 2:return this.createImage(B);case 0:return this.createComp(B);case 1:return this.createSolid(B);case 3:return this.createNull(B);case 4:return this.createShape(B);case 5:return this.createText(B);case 6:return this.createAudio(B);case 13:return this.createCamera(B);case 15:return this.createFootage(B);default:return this.createNull(B)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(B){return new AudioElement(B,this.globalData,this)},BaseRenderer.prototype.createFootage=function(B){return new FootageElement(B,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var B,R=this.layers.length;for(B=0;B1&&(U+=" C"+R.o[D-1][0]+","+R.o[D-1][1]+" "+R.i[0][0]+","+R.i[0][1]+" "+R.v[0][0]+","+R.v[0][1]),F.lastPath!==U){var W="";F.elem&&(R.c&&(W=B.inv?this.solidPath+U:U),F.elem.setAttribute("d",W)),F.lastPath=U}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var B={};return B.createFilter=function(R,F){var D=createNS("filter");return D.setAttribute("id",R),F!==!0&&(D.setAttribute("filterUnits","objectBoundingBox"),D.setAttribute("x","0%"),D.setAttribute("y","0%"),D.setAttribute("width","100%"),D.setAttribute("height","100%")),D},B.createAlphaToLuminanceFilter=function(){var R=createNS("feColorMatrix");return R.setAttribute("type","matrix"),R.setAttribute("color-interpolation-filters","sRGB"),R.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),R},B}(),featureSupport=function(){var B={maskType:!0};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(B.maskType=!1),B}();function SVGTintFilter(B,R){this.filterManager=R;var F=createNS("feColorMatrix");if(F.setAttribute("type","matrix"),F.setAttribute("color-interpolation-filters","linearRGB"),F.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),F.setAttribute("result","f1"),B.appendChild(F),(F=createNS("feColorMatrix")).setAttribute("type","matrix"),F.setAttribute("color-interpolation-filters","sRGB"),F.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),F.setAttribute("result","f2"),B.appendChild(F),this.matrixFilter=F,R.effectElements[2].p.v!==100||R.effectElements[2].p.k){var D,G=createNS("feMerge");B.appendChild(G),(D=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),G.appendChild(D),(D=createNS("feMergeNode")).setAttribute("in","f2"),G.appendChild(D)}}function SVGFillFilter(B,R){this.filterManager=R;var F=createNS("feColorMatrix");F.setAttribute("type","matrix"),F.setAttribute("color-interpolation-filters","sRGB"),F.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),B.appendChild(F),this.matrixFilter=F}function SVGStrokeEffect(B,R){this.initialized=!1,this.filterManager=R,this.elem=B,this.paths=[]}function SVGTritoneFilter(B,R){this.filterManager=R;var F=createNS("feColorMatrix");F.setAttribute("type","matrix"),F.setAttribute("color-interpolation-filters","linearRGB"),F.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),F.setAttribute("result","f1"),B.appendChild(F);var D=createNS("feComponentTransfer");D.setAttribute("color-interpolation-filters","sRGB"),B.appendChild(D),this.matrixFilter=D;var G=createNS("feFuncR");G.setAttribute("type","table"),D.appendChild(G),this.feFuncR=G;var U=createNS("feFuncG");U.setAttribute("type","table"),D.appendChild(U),this.feFuncG=U;var W=createNS("feFuncB");W.setAttribute("type","table"),D.appendChild(W),this.feFuncB=W}function SVGProLevelsFilter(B,R){this.filterManager=R;var F=this.filterManager.effectElements,D=createNS("feComponentTransfer");(F[10].p.k||F[10].p.v!==0||F[11].p.k||F[11].p.v!==1||F[12].p.k||F[12].p.v!==1||F[13].p.k||F[13].p.v!==0||F[14].p.k||F[14].p.v!==1)&&(this.feFuncR=this.createFeFunc("feFuncR",D)),(F[17].p.k||F[17].p.v!==0||F[18].p.k||F[18].p.v!==1||F[19].p.k||F[19].p.v!==1||F[20].p.k||F[20].p.v!==0||F[21].p.k||F[21].p.v!==1)&&(this.feFuncG=this.createFeFunc("feFuncG",D)),(F[24].p.k||F[24].p.v!==0||F[25].p.k||F[25].p.v!==1||F[26].p.k||F[26].p.v!==1||F[27].p.k||F[27].p.v!==0||F[28].p.k||F[28].p.v!==1)&&(this.feFuncB=this.createFeFunc("feFuncB",D)),(F[31].p.k||F[31].p.v!==0||F[32].p.k||F[32].p.v!==1||F[33].p.k||F[33].p.v!==1||F[34].p.k||F[34].p.v!==0||F[35].p.k||F[35].p.v!==1)&&(this.feFuncA=this.createFeFunc("feFuncA",D)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(D.setAttribute("color-interpolation-filters","sRGB"),B.appendChild(D),D=createNS("feComponentTransfer")),(F[3].p.k||F[3].p.v!==0||F[4].p.k||F[4].p.v!==1||F[5].p.k||F[5].p.v!==1||F[6].p.k||F[6].p.v!==0||F[7].p.k||F[7].p.v!==1)&&(D.setAttribute("color-interpolation-filters","sRGB"),B.appendChild(D),this.feFuncRComposed=this.createFeFunc("feFuncR",D),this.feFuncGComposed=this.createFeFunc("feFuncG",D),this.feFuncBComposed=this.createFeFunc("feFuncB",D))}function SVGDropShadowEffect(B,R){var F=R.container.globalData.renderConfig.filterSize;B.setAttribute("x",F.x),B.setAttribute("y",F.y),B.setAttribute("width",F.width),B.setAttribute("height",F.height),this.filterManager=R;var D=createNS("feGaussianBlur");D.setAttribute("in","SourceAlpha"),D.setAttribute("result","drop_shadow_1"),D.setAttribute("stdDeviation","0"),this.feGaussianBlur=D,B.appendChild(D);var G=createNS("feOffset");G.setAttribute("dx","25"),G.setAttribute("dy","0"),G.setAttribute("in","drop_shadow_1"),G.setAttribute("result","drop_shadow_2"),this.feOffset=G,B.appendChild(G);var U=createNS("feFlood");U.setAttribute("flood-color","#00ff00"),U.setAttribute("flood-opacity","1"),U.setAttribute("result","drop_shadow_3"),this.feFlood=U,B.appendChild(U);var W=createNS("feComposite");W.setAttribute("in","drop_shadow_3"),W.setAttribute("in2","drop_shadow_2"),W.setAttribute("operator","in"),W.setAttribute("result","drop_shadow_4"),B.appendChild(W);var q,Y=createNS("feMerge");B.appendChild(Y),q=createNS("feMergeNode"),Y.appendChild(q),(q=createNS("feMergeNode")).setAttribute("in","SourceGraphic"),this.feMergeNode=q,this.feMerge=Y,this.originalNodeAdded=!1,Y.appendChild(q)}SVGTintFilter.prototype.renderFrame=function(B){if(B||this.filterManager._mdf){var R=this.filterManager.effectElements[0].p.v,F=this.filterManager.effectElements[1].p.v,D=this.filterManager.effectElements[2].p.v/100;this.matrixFilter.setAttribute("values",F[0]-R[0]+" 0 0 0 "+R[0]+" "+(F[1]-R[1])+" 0 0 0 "+R[1]+" "+(F[2]-R[2])+" 0 0 0 "+R[2]+" 0 0 0 "+D+" 0")}},SVGFillFilter.prototype.renderFrame=function(B){if(B||this.filterManager._mdf){var R=this.filterManager.effectElements[2].p.v,F=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+R[0]+" 0 0 0 0 "+R[1]+" 0 0 0 0 "+R[2]+" 0 0 0 "+F+" 0")}},SVGStrokeEffect.prototype.initialize=function(){var B,R,F,D,G=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(this.filterManager.effectElements[1].p.v===1?(D=this.elem.maskManager.masksProperties.length,F=0):D=(F=this.filterManager.effectElements[0].p.v-1)+1,(R=createNS("g")).setAttribute("fill","none"),R.setAttribute("stroke-linecap","round"),R.setAttribute("stroke-dashoffset",1);F=J?Q<0?D:G:D+te*Math.pow((U-B)/Q,1/F),Z[K]=W,K+=1,q+=256/255;return Z.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(B){if(B||this.filterManager._mdf){var R,F=this.filterManager.effectElements;this.feFuncRComposed&&(B||F[3].p._mdf||F[4].p._mdf||F[5].p._mdf||F[6].p._mdf||F[7].p._mdf)&&(R=this.getTableValue(F[3].p.v,F[4].p.v,F[5].p.v,F[6].p.v,F[7].p.v),this.feFuncRComposed.setAttribute("tableValues",R),this.feFuncGComposed.setAttribute("tableValues",R),this.feFuncBComposed.setAttribute("tableValues",R)),this.feFuncR&&(B||F[10].p._mdf||F[11].p._mdf||F[12].p._mdf||F[13].p._mdf||F[14].p._mdf)&&(R=this.getTableValue(F[10].p.v,F[11].p.v,F[12].p.v,F[13].p.v,F[14].p.v),this.feFuncR.setAttribute("tableValues",R)),this.feFuncG&&(B||F[17].p._mdf||F[18].p._mdf||F[19].p._mdf||F[20].p._mdf||F[21].p._mdf)&&(R=this.getTableValue(F[17].p.v,F[18].p.v,F[19].p.v,F[20].p.v,F[21].p.v),this.feFuncG.setAttribute("tableValues",R)),this.feFuncB&&(B||F[24].p._mdf||F[25].p._mdf||F[26].p._mdf||F[27].p._mdf||F[28].p._mdf)&&(R=this.getTableValue(F[24].p.v,F[25].p.v,F[26].p.v,F[27].p.v,F[28].p.v),this.feFuncB.setAttribute("tableValues",R)),this.feFuncA&&(B||F[31].p._mdf||F[32].p._mdf||F[33].p._mdf||F[34].p._mdf||F[35].p._mdf)&&(R=this.getTableValue(F[31].p.v,F[32].p.v,F[33].p.v,F[34].p.v,F[35].p.v),this.feFuncA.setAttribute("tableValues",R))}},SVGDropShadowEffect.prototype.renderFrame=function(B){if(B||this.filterManager._mdf){if((B||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),B||this.filterManager.effectElements[0].p._mdf){var R=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*R[0]),Math.round(255*R[1]),Math.round(255*R[2])))}if((B||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),B||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var F=this.filterManager.effectElements[3].p.v,D=(this.filterManager.effectElements[2].p.v-90)*degToRads,G=F*Math.cos(D),U=F*Math.sin(D);this.feOffset.setAttribute("dx",G),this.feOffset.setAttribute("dy",U)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(B,R,F){this.initialized=!1,this.filterManager=R,this.filterElem=B,this.elem=F,F.matteElement=createNS("g"),F.matteElement.appendChild(F.layerElement),F.matteElement.appendChild(F.transformedElement),F.baseElement=F.matteElement}function SVGGaussianBlurEffect(B,R){B.setAttribute("x","-100%"),B.setAttribute("y","-100%"),B.setAttribute("width","300%"),B.setAttribute("height","300%"),this.filterManager=R;var F=createNS("feGaussianBlur");B.appendChild(F),this.feGaussianBlur=F}SVGMatte3Effect.prototype.findSymbol=function(B){for(var R=0,F=_svgMatteSymbols.length;R=0&&!this.shapeModifiers[B].processShapes(this._isFirstFrame);B-=1);}},searchProcessedElement:function(B){for(var R=this.processedElements,F=0,D=R.length;F.01)return!1;F+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var B=0,R=this.data.k.k.length;B0;)se=Z.transformers[be].mProps._mdf||se,fe-=1,be-=1;if(se)for(fe=ge-Z.styles[re].lvl,be=Z.transformers.length-1;fe>0;)he=Z.transformers[be].mProps.v.props,ce.transform(he[0],he[1],he[2],he[3],he[4],he[5],he[6],he[7],he[8],he[9],he[10],he[11],he[12],he[13],he[14],he[15]),fe-=1,be-=1}else ce=B;if(Q=(ae=Z.sh.paths)._length,se){for(ie="",te=0;te=1?pe=.99:pe<=-1&&(pe=-.99);var ye=ne*pe,Ee=Math.cos(Se+Z.a.v)*ye+ce[0],de=Math.sin(Se+Z.a.v)*ye+ce[1];re.setAttribute("fx",Ee),re.setAttribute("fy",de),ae&&!Z.g._collapsable&&(Z.of.setAttribute("fx",Ee),Z.of.setAttribute("fy",de))}}function Y(J,Z,K){var te=Z.style,Q=Z.d;Q&&(Q._mdf||K)&&Q.dashStr&&(te.pElem.setAttribute("stroke-dasharray",Q.dashStr),te.pElem.setAttribute("stroke-dashoffset",Q.dashoffset[0])),Z.c&&(Z.c._mdf||K)&&te.pElem.setAttribute("stroke","rgb("+bmFloor(Z.c.v[0])+","+bmFloor(Z.c.v[1])+","+bmFloor(Z.c.v[2])+")"),(Z.o._mdf||K)&&te.pElem.setAttribute("stroke-opacity",Z.o.v),(Z.w._mdf||K)&&(te.pElem.setAttribute("stroke-width",Z.w.v),te.msElem&&te.msElem.setAttribute("stroke-width",Z.w.v))}return{createRenderFunction:function(J){switch(J.ty){case"fl":return U;case"gf":return q;case"gs":return W;case"st":return Y;case"sh":case"el":case"rc":case"sr":return G;case"tr":return F;case"no":return D;default:return null}}}}();function SVGShapeElement(B,R,F){this.shapes=[],this.shapesData=B.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(B,R,F),this.prevViewData=[]}function LetterProps(B,R,F,D,G,U){this.o=B,this.sw=R,this.sc=F,this.fc=D,this.m=G,this.p=U,this._mdf={o:!0,sw:!!R,sc:!!F,fc:!!D,m:!0,p:!0}}function TextProperty(B,R){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,this.data=R,this.elem=B,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var B,R,F,D,G=this.shapes.length,U=this.stylesList.length,W=[],q=!1;for(F=0;F1&&q&&this.setShapesAsAnimated(W)}},SVGShapeElement.prototype.setShapesAsAnimated=function(B){var R,F=B.length;for(R=0;R=0;q-=1){if((te=this.searchProcessedElement(B[q]))?R[q]=F[te-1]:B[q]._render=W,B[q].ty==="fl"||B[q].ty==="st"||B[q].ty==="gf"||B[q].ty==="gs"||B[q].ty==="no")te?R[q].style.closed=!1:R[q]=this.createStyleElement(B[q],G),B[q]._render&&R[q].style.pElem.parentNode!==D&&D.appendChild(R[q].style.pElem),se.push(R[q].style);else if(B[q].ty==="gr"){if(te)for(J=R[q].it.length,Y=0;Y1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(B){this.effectsSequence.push(B),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(B){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||B){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var R=this.currentData,F=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var D;this.lock=!0,this._mdf=!1;var G=this.effectsSequence.length,U=B||this.data.d.k[this.keysIndex].s;for(D=0;DR);)F+=1;return this.keysIndex!==F&&(this.keysIndex=F),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(B){for(var R,F,D=[],G=0,U=B.length,W=!1;G=55296&&R<=56319?(F=B.charCodeAt(G+1))>=56320&&F<=57343?(W||FontManager.isModifier(R,F)?(D[D.length-1]+=B.substr(G,2),W=!1):D.push(B.substr(G,2)),G+=1):D.push(B.charAt(G)):R>56319?(F=B.charCodeAt(G+1),FontManager.isZeroWidthJoiner(R,F)?(W=!0,D[D.length-1]+=B.substr(G,2),G+=1):D.push(B.charAt(G))):FontManager.isZeroWidthJoiner(R)?(D[D.length-1]+=B.charAt(G),W=!0):D.push(B.charAt(G)),G+=1;return D},TextProperty.prototype.completeTextData=function(B){B.__complete=!0;var R,F,D,G,U,W,q,Y=this.elem.globalData.fontManager,J=this.data,Z=[],K=0,te=J.m.g,Q=0,ie=0,se=0,ne=[],re=0,ae=0,ce=Y.getFontByName(B.f),he=0,fe=getFontProperties(ce);B.fWeight=fe.weight,B.fStyle=fe.style,B.finalSize=B.s,B.finalText=this.buildFinalText(B.t),F=B.finalText.length,B.finalLineHeight=B.lh;var be,ue=B.tr/1e3*B.finalSize;if(B.sz)for(var ge,ve,Se=!0,pe=B.sz[0],ye=B.sz[1];Se;){ge=0,re=0,F=(ve=this.buildFinalText(B.t)).length,ue=B.tr/1e3*B.finalSize;var Ee=-1;for(R=0;Rpe&&ve[R]!==" "?(Ee===-1?F+=1:R=Ee,ge+=B.finalLineHeight||1.2*B.finalSize,ve.splice(R,Ee===R?1:0,"\r"),Ee=-1,re=0):(re+=he,re+=ue);ge+=ce.ascent*B.finalSize/100,this.canResize&&B.finalSize>this.minimumFontSize&&yeae?re:ae,re=-2*ue,G="",D=!0,se+=1):G=de,Y.chars?(q=Y.getCharData(de,ce.fStyle,Y.getFontByName(B.f).fFamily),he=D?0:q.w*B.finalSize/100):he=Y.measureText(G,B.f,B.finalSize),de===" "?we+=he+ue:(re+=he+ue+we,we=0),Z.push({l:he,an:he,add:Q,n:D,anIndexes:[],val:G,line:se,animatorJustifyOffset:0}),te==2){if(Q+=he,G===""||G===" "||R===F-1){for(G!==""&&G!==" "||(Q-=he);ie<=R;)Z[ie].an=Q,Z[ie].ind=K,Z[ie].extra=he,ie+=1;K+=1,Q=0}}else if(te==3){if(Q+=he,G===""||R===F-1){for(G===""&&(Q-=he);ie<=R;)Z[ie].an=Q,Z[ie].ind=K,Z[ie].extra=he,ie+=1;Q=0,K+=1}}else Z[K].ind=K,Z[K].extra=0,K+=1;if(B.l=Z,ae=re>ae?re:ae,ne.push(re),B.sz)B.boxWidth=B.sz[0],B.justifyOffset=0;else switch(B.boxWidth=ae,B.j){case 1:B.justifyOffset=-B.boxWidth;break;case 2:B.justifyOffset=-B.boxWidth/2;break;default:B.justifyOffset=0}B.lineWidths=ne;var Oe,Me,Pe,Ne,ke=J.a;W=ke.length;var Ae=[];for(U=0;U0?U=this.ne.v/100:W=-this.ne.v/100,this.xe.v>0?q=1-this.xe.v/100:Y=1+this.xe.v/100;var J=BezierFactory.getBezierEasing(U,W,q,Y).get,Z=0,K=this.finalS,te=this.finalE,Q=this.data.sh;if(Q===2)Z=J(Z=te===K?G>=te?1:0:B(0,R(.5/(te-K)+(G-K)/(te-K),1)));else if(Q===3)Z=J(Z=te===K?G>=te?0:1:1-B(0,R(.5/(te-K)+(G-K)/(te-K),1)));else if(Q===4)te===K?Z=0:(Z=B(0,R(.5/(te-K)+(G-K)/(te-K),1)))<.5?Z*=2:Z=1-2*(Z-.5),Z=J(Z);else if(Q===5){if(te===K)Z=0;else{var ie=te-K,se=-ie/2+(G=R(B(0,G+.5-K),te-K)),ne=ie/2;Z=Math.sqrt(1-se*se/(ne*ne))}Z=J(Z)}else Q===6?(te===K?Z=0:(G=R(B(0,G+.5-K),te-K),Z=(1+Math.cos(Math.PI+2*Math.PI*G/(te-K)))/2),Z=J(Z)):(G>=F(K)&&(Z=B(0,R(G-K<0?R(te,1)-(K-G):te-G,1))),Z=J(Z));if(this.sm.v!==100){var re=.01*this.sm.v;re===0&&(re=1e-8);var ae=.5-.5*re;Z1&&(Z=1)}return Z*this.a.v},getValue:function(G){this.iterateDynamicProperties(),this._mdf=G||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,G&&this.data.r===2&&(this.e.v=this._currentTextLength);var U=this.data.r===2?1:100/this.data.totalChars,W=this.o.v/U,q=this.s.v/U+W,Y=this.e.v/U+W;if(q>Y){var J=q;q=Y,Y=J}this.finalS=q,this.finalE=Y}},extendPrototype([DynamicPropertyContainer],D),{getTextSelectorProp:function(G,U,W){return new D(G,U)}}}();function TextAnimatorDataProperty(B,R,F){var D={propType:!1},G=PropertyFactory.getProp,U=R.a;this.a={r:U.r?G(B,U.r,0,degToRads,F):D,rx:U.rx?G(B,U.rx,0,degToRads,F):D,ry:U.ry?G(B,U.ry,0,degToRads,F):D,sk:U.sk?G(B,U.sk,0,degToRads,F):D,sa:U.sa?G(B,U.sa,0,degToRads,F):D,s:U.s?G(B,U.s,1,.01,F):D,a:U.a?G(B,U.a,1,0,F):D,o:U.o?G(B,U.o,0,.01,F):D,p:U.p?G(B,U.p,1,0,F):D,sw:U.sw?G(B,U.sw,0,0,F):D,sc:U.sc?G(B,U.sc,1,0,F):D,fc:U.fc?G(B,U.fc,1,0,F):D,fh:U.fh?G(B,U.fh,0,0,F):D,fs:U.fs?G(B,U.fs,0,.01,F):D,fb:U.fb?G(B,U.fb,0,.01,F):D,t:U.t?G(B,U.t,0,0,F):D},this.s=TextSelectorProp.getTextSelectorProp(B,R.s,F),this.s.t=R.s.t}function TextAnimatorProperty(B,R,F){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=B,this._renderType=R,this._elem=F,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(F)}function ITextElement(){}TextAnimatorProperty.prototype.searchProperties=function(){var B,R,F=this._textData.a.length,D=PropertyFactory.getProp;for(B=0;B=q+rt||!ie?(ae=(q+rt-J)/Y.partialLength,_e=Q.point[0]+(Y.point[0]-Q.point[0])*ae,Fe=Q.point[1]+(Y.point[1]-Q.point[1])*ae,ge.translate(-fe[0]*pe[G].an*.005,-fe[1]*Ne*.01),Z=!1):ie&&(J+=Y.partialLength,(K+=1)>=ie.length&&(K=0,se[te+=1]?ie=se[te].points:he.v.c?(K=0,ie=se[te=0].points):(J-=Y.partialLength,ie=null)),ie&&(Q=Y,ne=(Y=ie[K]).partialLength));Ae=pe[G].an/2-pe[G].add,ge.translate(-Ae,0,0)}else Ae=pe[G].an/2-pe[G].add,ge.translate(-Ae,0,0),ge.translate(-fe[0]*pe[G].an*.005,-fe[1]*Ne*.01,0);for(we=0;weB?this.textSpans[B].span:createNS(Y?"g":"text"),ne<=B){if(W.setAttribute("stroke-linecap","butt"),W.setAttribute("stroke-linejoin","round"),W.setAttribute("stroke-miterlimit","4"),this.textSpans[B].span=W,Y){var re=createNS("g");W.appendChild(re),this.textSpans[B].childSpan=re}this.textSpans[B].span=W,this.layerElement.appendChild(W)}W.style.display="inherit"}if(J.reset(),J.scale(F.finalSize/100,F.finalSize/100),Z&&(q[B].n&&(K=-ie,te+=F.yOffset,te+=Q?1:0,Q=!1),this.applyTextPropertiesToMatrix(F,J,q[B].line,K,te),K+=q[B].l||0,K+=ie),Y){var ae;if((se=this.globalData.fontManager.getCharData(F.finalText[B],D.fStyle,this.globalData.fontManager.getFontByName(F.f).fFamily)).t===1)ae=new SVGCompElement(se.data,this.globalData,this);else{var ce=emptyShapeData;se.data&&se.data.shapes&&(ce=se.data),ae=new SVGShapeElement(ce,this.globalData,this)}this.textSpans[B].glyph=ae,ae._debug=!0,ae.prepareFrame(0),ae.renderFrame(),this.textSpans[B].childSpan.appendChild(ae.layerElement),this.textSpans[B].childSpan.setAttribute("transform","scale("+F.finalSize/100+","+F.finalSize/100+")")}else Z&&W.setAttribute("transform","translate("+J.props[12]+","+J.props[13]+")"),W.textContent=q[B].val,W.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}Z&&W&&W.setAttribute("d","")}else{var he=this.textContainer,fe="start";switch(F.j){case 1:fe="end";break;case 2:fe="middle";break;default:fe="start"}he.setAttribute("text-anchor",fe),he.setAttribute("letter-spacing",ie);var be=this.buildTextContents(F.finalText);for(R=be.length,te=F.ps?F.ps[1]+F.ascent:0,B=0;B=0;R-=1)(this.completeLayers||this.elements[R])&&this.elements[R].prepareFrame(B-this.layers[R].st);if(this.globalData._mdf)for(R=0;R=0;F-=1)(this.completeLayers||this.elements[F])&&(this.elements[F].prepareFrame(this.renderedFrame-this.layers[F].st),this.elements[F]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var B,R=this.layers.length;for(B=0;B=U;)re/=2,ae/=2,ce>>>=1;return(re+ce)/ae};return ne.int32=function(){return 0|se.g(4)},ne.quick=function(){return se.g(4)/4294967296},ne.double=ne,Y(J(se.S),B),(K.pass||te||function(re,ae,ce,he){return he&&(he.S&&q(he,se),re.state=function(){return q(se,{})}),ce?(R.random=re,ae):re})(ne,ie,"global"in K?K.global:this==R,K.state)},Y(R.random(),B)}function initialize$2(B){seedRandom([],B)}var propTypes={SHAPE:"shape"};function _typeof(B){return(_typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R})(B)}var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null,XMLHttpRequest=null,fetch=null,frames=null;function $bm_isInstanceOfArray(B){return B.constructor===Array||B.constructor===Float32Array}function isNumerable(B,R){return B==="number"||B==="boolean"||B==="string"||R instanceof Number}function $bm_neg(B){var R=_typeof(B);if(R==="number"||R==="boolean"||B instanceof Number)return-B;if($bm_isInstanceOfArray(B)){var F,D=B.length,G=[];for(F=0;FF){var D=F;F=R,R=D}return Math.min(Math.max(B,R),F)}function radiansToDegrees(B){return B/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(B){return B*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(B,R){if(typeof B=="number"||B instanceof Number)return R=R||0,Math.abs(B-R);var F;R||(R=helperLengthArray);var D=Math.min(B.length,R.length),G=0;for(F=0;F.5?J/(2-W-q):J/(W+q),W){case D:R=(G-U)/J+(G1&&(F-=1),F<1/6?B+6*(R-B)*F:F<.5?R:F<2/3?B+(R-B)*(2/3-F)*6:B}function hslToRgb(B){var R,F,D,G=B[0],U=B[1],W=B[2];if(U===0)R=W,D=W,F=W;else{var q=W<.5?W*(1+U):W+U-W*U,Y=2*W-q;R=hue2rgb(Y,q,G+1/3),F=hue2rgb(Y,q,G),D=hue2rgb(Y,q,G-1/3)}return[R,F,D,B[3]]}function linear(B,R,F,D,G){if(D!==void 0&&G!==void 0||(D=R,G=F,R=0,F=1),F=F)return G;var W,q=F===R?0:(B-R)/(F-R);if(!D.length)return D+(G-D)*q;var Y=D.length,J=createTypedArray("float32",Y);for(W=0;W1){for(D=0;D1?R=1:R<0&&(R=0);var W=B(R);if($bm_isInstanceOfArray(G)){var q,Y=G.length,J=createTypedArray("float32",Y);for(q=0;qdata.k[R].t&&Bdata.k[R+1].t-B?(F=R+2,D=data.k[R+1].t):(F=R+1,D=data.k[R].t);break}}F===-1&&(F=R+1,D=data.k[R].t)}else F=0,D=0;var U={};return U.index=F,U.time=D/elem.comp.globalData.frameRate,U}function key(B){var R,F,D;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+B);B-=1,R={time:data.k[B].t/elem.comp.globalData.frameRate,value:[]};var G=Object.prototype.hasOwnProperty.call(data.k[B],"s")?data.k[B].s:data.k[B-1].e;for(D=G.length,F=0;Fhe.length-1)&&(te=he.length-1),ie=fe-(se=he[he.length-1-te].t)),K==="pingpong"){if(Math.floor((ce-se)/ie)%2!=0)return this.getValueAtTime((ie-(ce-se)%ie+se)/this.comp.globalData.frameRate,0)}else{if(K==="offset"){var be=this.getValueAtTime(se/this.comp.globalData.frameRate,0),ue=this.getValueAtTime(fe/this.comp.globalData.frameRate,0),ge=this.getValueAtTime(((ce-se)%ie+se)/this.comp.globalData.frameRate,0),ve=Math.floor((ce-se)/ie);if(this.pv.length){for(re=(ae=new Array(be.length)).length,ne=0;ne=fe)return this.pv;if(Q?se=fe+(ie=te?Math.abs(this.elem.comp.globalData.frameRate*te):Math.max(0,this.elem.data.op-fe)):((!te||te>he.length-1)&&(te=he.length-1),ie=(se=he[te].t)-fe),K==="pingpong"){if(Math.floor((fe-ce)/ie)%2==0)return this.getValueAtTime(((fe-ce)%ie+fe)/this.comp.globalData.frameRate,0)}else{if(K==="offset"){var be=this.getValueAtTime(fe/this.comp.globalData.frameRate,0),ue=this.getValueAtTime(se/this.comp.globalData.frameRate,0),ge=this.getValueAtTime((ie-(fe-ce)%ie+fe)/this.comp.globalData.frameRate,0),ve=Math.floor((fe-ce)/ie)+1;if(this.pv.length){for(re=(ae=new Array(be.length)).length,ne=0;ne1?(se+K-ne)/(te-1):1,ae=0,ce=0;for(Q=this.pv.length?createTypedArray("float32",this.pv.length):0;aere){var fe=ae,be=Q.c&&ae===ce-1?0:ae+1,ue=(re-he)/ne[ae].addedLength;ie=bez.getPointInSegment(Q.v[fe],Q.v[be],Q.o[fe],Q.i[be],ue,ne[ae]);break}he+=ne[ae].addedLength,ae+=1}return ie||(ie=Q.c?[Q.v[0][0],Q.v[0][1]]:[Q.v[Q._length-1][0],Q.v[Q._length-1][1]]),ie},vectorOnPath:function(K,te,Q){K==1?K=this.v.c:K==0&&(K=.999);var ie=this.pointOnPath(K,te),se=this.pointOnPath(K+.001,te),ne=se[0]-ie[0],re=se[1]-ie[1],ae=Math.sqrt(Math.pow(ne,2)+Math.pow(re,2));return ae===0?[0,0]:Q==="tangent"?[ne/ae,re/ae]:[-re/ae,ne/ae]},tangentOnPath:function(K,te){return this.vectorOnPath(K,te,"tangent")},normalOnPath:function(K,te){return this.vectorOnPath(K,te,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([J],q),extendPrototype([J],Y),Y.prototype.getValueAtTime=function(K){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),K*=this.elem.globalData.frameRate,(K-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime (c) 2009-2016 Stuart Knightley Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/main/LICENSE */(function(F){B.exports=F()})(function(){return function F(D,G,U){function W(J,Z){if(!G[J]){if(!D[J]){var K=typeof commonjsRequire=="function"&&commonjsRequire;if(!Z&&K)return K(J,!0);if(q)return q(J,!0);var te=new Error("Cannot find module '"+J+"'");throw te.code="MODULE_NOT_FOUND",te}var Q=G[J]={exports:{}};D[J][0].call(Q.exports,function(ie){var se=D[J][1][ie];return W(se||ie)},Q,Q.exports,F,D,G,U)}return G[J].exports}for(var q=typeof commonjsRequire=="function"&&commonjsRequire,Y=0;Y>2,Q=(3&J)<<4|Z>>4,ie=ce>1?(15&Z)<<2|K>>6:64,se=ce>2?63&K:64,ne.push(q.charAt(te)+q.charAt(Q)+q.charAt(ie)+q.charAt(se));return ne.join("")},G.decode=function(Y){var J,Z,K,te,Q,ie,se=0,ne=0;if(Y.substr(0,5)==="data:")throw new Error("Invalid base64 input, it looks like a data url.");var re,ae=3*(Y=Y.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(Y.charAt(Y.length-1)===q.charAt(64)&&ae--,Y.charAt(Y.length-2)===q.charAt(64)&&ae--,ae%1!=0)throw new Error("Invalid base64 input, bad content length.");for(re=W.uint8array?new Uint8Array(0|ae):new Array(0|ae);se>4,Z=(15&te)<<4|(Q=q.indexOf(Y.charAt(se++)))>>2,K=(3&Q)<<6|(ie=q.indexOf(Y.charAt(se++))),re[ne++]=J,Q!==64&&(re[ne++]=Z),ie!==64&&(re[ne++]=K);return re}},{"./support":30,"./utils":32}],2:[function(F,D,G){var U=F("./external"),W=F("./stream/DataWorker"),q=F("./stream/Crc32Probe"),Y=F("./stream/DataLengthProbe");function J(Z,K,te,Q,ie){this.compressedSize=Z,this.uncompressedSize=K,this.crc32=te,this.compression=Q,this.compressedContent=ie}J.prototype={getContentWorker:function(){var Z=new W(U.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new Y("data_length")),K=this;return Z.on("end",function(){if(this.streamInfo.data_length!==K.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),Z},getCompressedWorker:function(){return new W(U.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},J.createWorkerFrom=function(Z,K,te){return Z.pipe(new q).pipe(new Y("uncompressedSize")).pipe(K.compressWorker(te)).pipe(new Y("compressedSize")).withStreamInfo("compression",K)},D.exports=J},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(F,D,G){var U=F("./stream/GenericWorker");G.STORE={magic:"\0\0",compressWorker:function(W){return new U("STORE compression")},uncompressWorker:function(){return new U("STORE decompression")}},G.DEFLATE=F("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(F,D,G){var U=F("./utils"),W=function(){for(var q,Y=[],J=0;J<256;J++){q=J;for(var Z=0;Z<8;Z++)q=1&q?3988292384^q>>>1:q>>>1;Y[J]=q}return Y}();D.exports=function(q,Y){return q!==void 0&&q.length?U.getTypeOf(q)!=="string"?function(J,Z,K,te){var Q=W,ie=te+K;J^=-1;for(var se=te;se>>8^Q[255&(J^Z[se])];return-1^J}(0|Y,q,q.length,0):function(J,Z,K,te){var Q=W,ie=te+K;J^=-1;for(var se=te;se>>8^Q[255&(J^Z.charCodeAt(se))];return-1^J}(0|Y,q,q.length,0):0}},{"./utils":32}],5:[function(F,D,G){G.base64=!1,G.binary=!1,G.dir=!1,G.createFolders=!0,G.date=null,G.compression=null,G.compressionOptions=null,G.comment=null,G.unixPermissions=null,G.dosPermissions=null},{}],6:[function(F,D,G){var U=null;U=typeof Promise!="undefined"?Promise:F("lie"),D.exports={Promise:U}},{lie:37}],7:[function(F,D,G){var U=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Uint32Array!="undefined",W=F("pako"),q=F("./utils"),Y=F("./stream/GenericWorker"),J=U?"uint8array":"array";function Z(K,te){Y.call(this,"FlateWorker/"+K),this._pako=null,this._pakoAction=K,this._pakoOptions=te,this.meta={}}G.magic="\b\0",q.inherits(Z,Y),Z.prototype.processChunk=function(K){this.meta=K.meta,this._pako===null&&this._createPako(),this._pako.push(q.transformTo(J,K.data),!1)},Z.prototype.flush=function(){Y.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},Z.prototype.cleanUp=function(){Y.prototype.cleanUp.call(this),this._pako=null},Z.prototype._createPako=function(){this._pako=new W[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var K=this;this._pako.onData=function(te){K.push({data:te,meta:K.meta})}},G.compressWorker=function(K){return new Z("Deflate",K)},G.uncompressWorker=function(){return new Z("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(F,D,G){var U=F("../utils"),W=F("../stream/GenericWorker"),q=F("../utf8"),Y=F("../crc32"),J=F("../signature"),Z=function(ie,se){var ne,re="";for(ne=0;ne>>=8;return re},K=function(ie,se,ne,re,ae,ce){var he,fe,be=ie.file,ue=ie.compression,ge=ce!==q.utf8encode,ve=U.transformTo("string",ce(be.name)),Se=U.transformTo("string",q.utf8encode(be.name)),pe=be.comment,ye=U.transformTo("string",ce(pe)),Ee=U.transformTo("string",q.utf8encode(pe)),de=Se.length!==be.name.length,we=Ee.length!==pe.length,Oe="",Me="",Pe="",Ne=be.dir,ke=be.date,Ae={crc32:0,compressedSize:0,uncompressedSize:0};se&&!ne||(Ae.crc32=ie.crc32,Ae.compressedSize=ie.compressedSize,Ae.uncompressedSize=ie.uncompressedSize);var _e=0;se&&(_e|=8),ge||!de&&!we||(_e|=2048);var Fe,Ye,Ce,Ge=0,We=0;Ne&&(Ge|=16),ae==="UNIX"?(We=798,Ge|=(Fe=be.unixPermissions,Ye=Ne,Ce=Fe,Fe||(Ce=Ye?16893:33204),(65535&Ce)<<16)):(We=20,Ge|=63&(be.dosPermissions||0)),he=ke.getUTCHours(),he<<=6,he|=ke.getUTCMinutes(),he<<=5,he|=ke.getUTCSeconds()/2,fe=ke.getUTCFullYear()-1980,fe<<=4,fe|=ke.getUTCMonth()+1,fe<<=5,fe|=ke.getUTCDate(),de&&(Me=Z(1,1)+Z(Y(ve),4)+Se,Oe+="up"+Z(Me.length,2)+Me),we&&(Pe=Z(1,1)+Z(Y(ye),4)+Ee,Oe+="uc"+Z(Pe.length,2)+Pe);var Ve="";return Ve+=` \0`,Ve+=Z(_e,2),Ve+=ue.magic,Ve+=Z(he,2),Ve+=Z(fe,2),Ve+=Z(Ae.crc32,4),Ve+=Z(Ae.compressedSize,4),Ve+=Z(Ae.uncompressedSize,4),Ve+=Z(ve.length,2),Ve+=Z(Oe.length,2),{fileRecord:J.LOCAL_FILE_HEADER+Ve+ve+Oe,dirRecord:J.CENTRAL_FILE_HEADER+Z(We,2)+Ve+Z(ye.length,2)+"\0\0\0\0"+Z(Ge,4)+Z(re,4)+ve+Oe+ye}},te=function(ie){return J.DATA_DESCRIPTOR+Z(ie.crc32,4)+Z(ie.compressedSize,4)+Z(ie.uncompressedSize,4)};function Q(ie,se,ne,re){W.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=se,this.zipPlatform=ne,this.encodeFileName=re,this.streamFiles=ie,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}U.inherits(Q,W),Q.prototype.push=function(ie){var se=ie.meta.percent||0,ne=this.entriesCount,re=this._sources.length;this.accumulate?this.contentBuffer.push(ie):(this.bytesWritten+=ie.data.length,W.prototype.push.call(this,{data:ie.data,meta:{currentFile:this.currentFile,percent:ne?(se+100*(ne-re-1))/ne:100}}))},Q.prototype.openedSource=function(ie){this.currentSourceOffset=this.bytesWritten,this.currentFile=ie.file.name;var se=this.streamFiles&&!ie.file.dir;if(se){var ne=K(ie,se,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:ne.fileRecord,meta:{percent:0}})}else this.accumulate=!0},Q.prototype.closedSource=function(ie){this.accumulate=!1;var se=this.streamFiles&&!ie.file.dir,ne=K(ie,se,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(ne.dirRecord),se)this.push({data:te(ie),meta:{percent:100}});else for(this.push({data:ne.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},Q.prototype.flush=function(){for(var ie=this.bytesWritten,se=0;se0?fe.substring(0,be):""},re=function(fe){return fe.slice(-1)!=="/"&&(fe+="/"),fe},ae=function(fe,be){return be=be!==void 0?be:J.createFolders,fe=re(fe),this.files[fe]||se.call(this,fe,null,{dir:!0,createFolders:be}),this.files[fe]};function ce(fe){return Object.prototype.toString.call(fe)==="[object RegExp]"}var he={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(fe){var be,ue,ge;for(be in this.files)ge=this.files[be],(ue=be.slice(this.root.length,be.length))&&be.slice(0,this.root.length)===this.root&&fe(ue,ge)},filter:function(fe){var be=[];return this.forEach(function(ue,ge){fe(ue,ge)&&be.push(ge)}),be},file:function(fe,be,ue){if(arguments.length===1){if(ce(fe)){var ge=fe;return this.filter(function(Se,pe){return!pe.dir&&ge.test(Se)})}var ve=this.files[this.root+fe];return ve&&!ve.dir?ve:null}return fe=this.root+fe,se.call(this,fe,be,ue),this},folder:function(fe){if(!fe)return this;if(ce(fe))return this.filter(function(ve,Se){return Se.dir&&fe.test(ve)});var be=this.root+fe,ue=ae.call(this,be),ge=this.clone();return ge.root=ue.name,ge},remove:function(fe){fe=this.root+fe;var be=this.files[fe];if(be||(fe.slice(-1)!=="/"&&(fe+="/"),be=this.files[fe]),be&&!be.dir)delete this.files[fe];else for(var ue=this.filter(function(ve,Se){return Se.name.slice(0,fe.length)===fe}),ge=0;ge=0;--te)if(this.data[te]===Y&&this.data[te+1]===J&&this.data[te+2]===Z&&this.data[te+3]===K)return te-this.zero;return-1},W.prototype.readAndCheckSignature=function(q){var Y=q.charCodeAt(0),J=q.charCodeAt(1),Z=q.charCodeAt(2),K=q.charCodeAt(3),te=this.readData(4);return Y===te[0]&&J===te[1]&&Z===te[2]&&K===te[3]},W.prototype.readData=function(q){if(this.checkOffset(q),q===0)return[];var Y=this.data.slice(this.zero+this.index,this.zero+this.index+q);return this.index+=q,Y},D.exports=W},{"../utils":32,"./DataReader":18}],18:[function(F,D,G){var U=F("../utils");function W(q){this.data=q,this.length=q.length,this.index=0,this.zero=0}W.prototype={checkOffset:function(q){this.checkIndex(this.index+q)},checkIndex:function(q){if(this.length=this.index;Y--)J=(J<<8)+this.byteAt(Y);return this.index+=q,J},readString:function(q){return U.transformTo("string",this.readData(q))},readData:function(q){},lastIndexOfSignature:function(q){},readAndCheckSignature:function(q){},readDate:function(){var q=this.readInt(4);return new Date(Date.UTC(1980+(q>>25&127),(q>>21&15)-1,q>>16&31,q>>11&31,q>>5&63,(31&q)<<1))}},D.exports=W},{"../utils":32}],19:[function(F,D,G){var U=F("./Uint8ArrayReader");function W(q){U.call(this,q)}F("../utils").inherits(W,U),W.prototype.readData=function(q){this.checkOffset(q);var Y=this.data.slice(this.zero+this.index,this.zero+this.index+q);return this.index+=q,Y},D.exports=W},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(F,D,G){var U=F("./DataReader");function W(q){U.call(this,q)}F("../utils").inherits(W,U),W.prototype.byteAt=function(q){return this.data.charCodeAt(this.zero+q)},W.prototype.lastIndexOfSignature=function(q){return this.data.lastIndexOf(q)-this.zero},W.prototype.readAndCheckSignature=function(q){return q===this.readData(4)},W.prototype.readData=function(q){this.checkOffset(q);var Y=this.data.slice(this.zero+this.index,this.zero+this.index+q);return this.index+=q,Y},D.exports=W},{"../utils":32,"./DataReader":18}],21:[function(F,D,G){var U=F("./ArrayReader");function W(q){U.call(this,q)}F("../utils").inherits(W,U),W.prototype.readData=function(q){if(this.checkOffset(q),q===0)return new Uint8Array(0);var Y=this.data.subarray(this.zero+this.index,this.zero+this.index+q);return this.index+=q,Y},D.exports=W},{"../utils":32,"./ArrayReader":17}],22:[function(F,D,G){var U=F("../utils"),W=F("../support"),q=F("./ArrayReader"),Y=F("./StringReader"),J=F("./NodeBufferReader"),Z=F("./Uint8ArrayReader");D.exports=function(K){var te=U.getTypeOf(K);return U.checkSupport(te),te!=="string"||W.uint8array?te==="nodebuffer"?new J(K):W.uint8array?new Z(U.transformTo("uint8array",K)):new q(U.transformTo("array",K)):new Y(K)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(F,D,G){G.LOCAL_FILE_HEADER="PK",G.CENTRAL_FILE_HEADER="PK",G.CENTRAL_DIRECTORY_END="PK",G.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",G.ZIP64_CENTRAL_DIRECTORY_END="PK",G.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(F,D,G){var U=F("./GenericWorker"),W=F("../utils");function q(Y){U.call(this,"ConvertWorker to "+Y),this.destType=Y}W.inherits(q,U),q.prototype.processChunk=function(Y){this.push({data:W.transformTo(this.destType,Y.data),meta:Y.meta})},D.exports=q},{"../utils":32,"./GenericWorker":28}],25:[function(F,D,G){var U=F("./GenericWorker"),W=F("../crc32");function q(){U.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}F("../utils").inherits(q,U),q.prototype.processChunk=function(Y){this.streamInfo.crc32=W(Y.data,this.streamInfo.crc32||0),this.push(Y)},D.exports=q},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(F,D,G){var U=F("../utils"),W=F("./GenericWorker");function q(Y){W.call(this,"DataLengthProbe for "+Y),this.propName=Y,this.withStreamInfo(Y,0)}U.inherits(q,W),q.prototype.processChunk=function(Y){if(Y){var J=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=J+Y.data.length}W.prototype.processChunk.call(this,Y)},D.exports=q},{"../utils":32,"./GenericWorker":28}],27:[function(F,D,G){var U=F("../utils"),W=F("./GenericWorker");function q(Y){W.call(this,"DataWorker");var J=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,Y.then(function(Z){J.dataIsReady=!0,J.data=Z,J.max=Z&&Z.length||0,J.type=U.getTypeOf(Z),J.isPaused||J._tickAndRepeat()},function(Z){J.error(Z)})}U.inherits(q,W),q.prototype.cleanUp=function(){W.prototype.cleanUp.call(this),this.data=null},q.prototype.resume=function(){return!!W.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,U.delay(this._tickAndRepeat,[],this)),!0)},q.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(U.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},q.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var Y=null,J=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":Y=this.data.substring(this.index,J);break;case"uint8array":Y=this.data.subarray(this.index,J);break;case"array":case"nodebuffer":Y=this.data.slice(this.index,J)}return this.index=J,this.push({data:Y,meta:{percent:this.max?this.index/this.max*100:0}})},D.exports=q},{"../utils":32,"./GenericWorker":28}],28:[function(F,D,G){function U(W){this.name=W||"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}U.prototype={push:function(W){this.emit("data",W)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(W){this.emit("error",W)}return!0},error:function(W){return!this.isFinished&&(this.isPaused?this.generatedError=W:(this.isFinished=!0,this.emit("error",W),this.previous&&this.previous.error(W),this.cleanUp()),!0)},on:function(W,q){return this._listeners[W].push(q),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(W,q){if(this._listeners[W])for(var Y=0;Y "+W:W}},D.exports=U},{}],29:[function(F,D,G){var U=F("../utils"),W=F("./ConvertWorker"),q=F("./GenericWorker"),Y=F("../base64"),J=F("../support"),Z=F("../external"),K=null;if(J.nodestream)try{K=F("../nodejs/NodejsStreamOutputAdapter")}catch{}function te(ie,se){return new Z.Promise(function(ne,re){var ae=[],ce=ie._internalType,he=ie._outputType,fe=ie._mimeType;ie.on("data",function(be,ue){ae.push(be),se&&se(ue)}).on("error",function(be){ae=[],re(be)}).on("end",function(){try{var be=function(ue,ge,ve){switch(ue){case"blob":return U.newBlob(U.transformTo("arraybuffer",ge),ve);case"base64":return Y.encode(ge);default:return U.transformTo(ue,ge)}}(he,function(ue,ge){var ve,Se=0,pe=null,ye=0;for(ve=0;ve=252?6:Z>=248?5:Z>=240?4:Z>=224?3:Z>=192?2:1;J[254]=J[254]=1;function K(){Y.call(this,"utf-8 decode"),this.leftOver=null}function te(){Y.call(this,"utf-8 encode")}G.utf8encode=function(Q){return W.nodebuffer?q.newBufferFrom(Q,"utf-8"):function(ie){var se,ne,re,ae,ce,he=ie.length,fe=0;for(ae=0;ae>>6,se[ce++]=128|63&ne):ne<65536?(se[ce++]=224|ne>>>12,se[ce++]=128|ne>>>6&63,se[ce++]=128|63&ne):(se[ce++]=240|ne>>>18,se[ce++]=128|ne>>>12&63,se[ce++]=128|ne>>>6&63,se[ce++]=128|63&ne);return se}(Q)},G.utf8decode=function(Q){return W.nodebuffer?U.transformTo("nodebuffer",Q).toString("utf-8"):function(ie){var se,ne,re,ae,ce=ie.length,he=new Array(2*ce);for(ne=0,se=0;se4)he[ne++]=65533,se+=ae-1;else{for(re&=ae===2?31:ae===3?15:7;ae>1&&se1?he[ne++]=65533:re<65536?he[ne++]=re:(re-=65536,he[ne++]=55296|re>>10&1023,he[ne++]=56320|1023&re)}return he.length!==ne&&(he.subarray?he=he.subarray(0,ne):he.length=ne),U.applyFromCharCode(he)}(Q=U.transformTo(W.uint8array?"uint8array":"array",Q))},U.inherits(K,Y),K.prototype.processChunk=function(Q){var ie=U.transformTo(W.uint8array?"uint8array":"array",Q.data);if(this.leftOver&&this.leftOver.length){if(W.uint8array){var se=ie;(ie=new Uint8Array(se.length+this.leftOver.length)).set(this.leftOver,0),ie.set(se,this.leftOver.length)}else ie=this.leftOver.concat(ie);this.leftOver=null}var ne=function(ae,ce){var he;for((ce=ce||ae.length)>ae.length&&(ce=ae.length),he=ce-1;he>=0&&(192&ae[he])==128;)he--;return he<0||he===0?ce:he+J[ae[he]]>ce?he:ce}(ie),re=ie;ne!==ie.length&&(W.uint8array?(re=ie.subarray(0,ne),this.leftOver=ie.subarray(ne,ie.length)):(re=ie.slice(0,ne),this.leftOver=ie.slice(ne,ie.length))),this.push({data:G.utf8decode(re),meta:Q.meta})},K.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:G.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},G.Utf8DecodeWorker=K,U.inherits(te,Y),te.prototype.processChunk=function(Q){this.push({data:G.utf8encode(Q.data),meta:Q.meta})},G.Utf8EncodeWorker=te},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(F,D,G){var U=F("./support"),W=F("./base64"),q=F("./nodejsUtils"),Y=F("./external");function J(se){return se}function Z(se,ne){for(var re=0;re1;)try{return K.stringifyByChunk(se,re,ne)}catch{ne=Math.floor(ne/2)}return K.stringifyByChar(se)}function Q(se,ne){for(var re=0;re1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var K,te;for(K=0;K0)this.isSignature(te,q.CENTRAL_FILE_HEADER)||(this.reader.zero=ie);else if(ie<0)throw new Error("Corrupted zip: missing "+Math.abs(ie)+" bytes.")},prepareReader:function(K){this.reader=U(K)},load:function(K){this.prepareReader(K),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},D.exports=Z},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(F,D,G){var U=F("./reader/readerFor"),W=F("./utils"),q=F("./compressedObject"),Y=F("./crc32"),J=F("./utf8"),Z=F("./compressions"),K=F("./support");function te(Q,ie){this.options=Q,this.loadOptions=ie}te.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(Q){var ie,se;if(Q.skip(22),this.fileNameLength=Q.readInt(2),se=Q.readInt(2),this.fileName=Q.readData(this.fileNameLength),Q.skip(se),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((ie=function(ne){for(var re in Z)if(Z.hasOwnProperty(re)&&Z[re].magic===ne)return Z[re];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+W.pretty(this.compressionMethod)+" unknown (inner file : "+W.transformTo("string",this.fileName)+")");this.decompressed=new q(this.compressedSize,this.uncompressedSize,this.crc32,ie,Q.readData(this.compressedSize))},readCentralPart:function(Q){this.versionMadeBy=Q.readInt(2),Q.skip(2),this.bitFlag=Q.readInt(2),this.compressionMethod=Q.readString(2),this.date=Q.readDate(),this.crc32=Q.readInt(4),this.compressedSize=Q.readInt(4),this.uncompressedSize=Q.readInt(4);var ie=Q.readInt(2);if(this.extraFieldsLength=Q.readInt(2),this.fileCommentLength=Q.readInt(2),this.diskNumberStart=Q.readInt(2),this.internalFileAttributes=Q.readInt(2),this.externalFileAttributes=Q.readInt(4),this.localHeaderOffset=Q.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");Q.skip(ie),this.readExtraFields(Q),this.parseZIP64ExtraField(Q),this.fileComment=Q.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var Q=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),Q===0&&(this.dosPermissions=63&this.externalFileAttributes),Q===3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(Q){if(this.extraFields[1]){var ie=U(this.extraFields[1].value);this.uncompressedSize===W.MAX_VALUE_32BITS&&(this.uncompressedSize=ie.readInt(8)),this.compressedSize===W.MAX_VALUE_32BITS&&(this.compressedSize=ie.readInt(8)),this.localHeaderOffset===W.MAX_VALUE_32BITS&&(this.localHeaderOffset=ie.readInt(8)),this.diskNumberStart===W.MAX_VALUE_32BITS&&(this.diskNumberStart=ie.readInt(4))}},readExtraFields:function(Q){var ie,se,ne,re=Q.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});Q.index+40?ie.windowBits=-ie.windowBits:ie.gzip&&ie.windowBits>0&&ie.windowBits<16&&(ie.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new J,this.strm.avail_out=0;var se=U.deflateInit2(this.strm,ie.level,ie.method,ie.windowBits,ie.memLevel,ie.strategy);if(se!==0)throw new Error(Y[se]);if(ie.header&&U.deflateSetHeader(this.strm,ie.header),ie.dictionary){var ne;if(ne=typeof ie.dictionary=="string"?q.string2buf(ie.dictionary):Z.call(ie.dictionary)==="[object ArrayBuffer]"?new Uint8Array(ie.dictionary):ie.dictionary,(se=U.deflateSetDictionary(this.strm,ne))!==0)throw new Error(Y[se]);this._dict_set=!0}}function te(Q,ie){var se=new K(ie);if(se.push(Q,!0),se.err)throw se.msg||Y[se.err];return se.result}K.prototype.push=function(Q,ie){var se,ne,re=this.strm,ae=this.options.chunkSize;if(this.ended)return!1;ne=ie===~~ie?ie:ie===!0?4:0,typeof Q=="string"?re.input=q.string2buf(Q):Z.call(Q)==="[object ArrayBuffer]"?re.input=new Uint8Array(Q):re.input=Q,re.next_in=0,re.avail_in=re.input.length;do{if(re.avail_out===0&&(re.output=new W.Buf8(ae),re.next_out=0,re.avail_out=ae),(se=U.deflate(re,ne))!==1&&se!==0)return this.onEnd(se),this.ended=!0,!1;re.avail_out!==0&&(re.avail_in!==0||ne!==4&&ne!==2)||(this.options.to==="string"?this.onData(q.buf2binstring(W.shrinkBuf(re.output,re.next_out))):this.onData(W.shrinkBuf(re.output,re.next_out)))}while((re.avail_in>0||re.avail_out===0)&&se!==1);return ne===4?(se=U.deflateEnd(this.strm),this.onEnd(se),this.ended=!0,se===0):ne!==2||(this.onEnd(0),re.avail_out=0,!0)},K.prototype.onData=function(Q){this.chunks.push(Q)},K.prototype.onEnd=function(Q){Q===0&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=W.flattenChunks(this.chunks)),this.chunks=[],this.err=Q,this.msg=this.strm.msg},G.Deflate=K,G.deflate=te,G.deflateRaw=function(Q,ie){return(ie=ie||{}).raw=!0,te(Q,ie)},G.gzip=function(Q,ie){return(ie=ie||{}).gzip=!0,te(Q,ie)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(F,D,G){var U=F("./zlib/inflate"),W=F("./utils/common"),q=F("./utils/strings"),Y=F("./zlib/constants"),J=F("./zlib/messages"),Z=F("./zlib/zstream"),K=F("./zlib/gzheader"),te=Object.prototype.toString;function Q(se){if(!(this instanceof Q))return new Q(se);this.options=W.assign({chunkSize:16384,windowBits:0,to:""},se||{});var ne=this.options;ne.raw&&ne.windowBits>=0&&ne.windowBits<16&&(ne.windowBits=-ne.windowBits,ne.windowBits===0&&(ne.windowBits=-15)),!(ne.windowBits>=0&&ne.windowBits<16)||se&&se.windowBits||(ne.windowBits+=32),ne.windowBits>15&&ne.windowBits<48&&(15&ne.windowBits)==0&&(ne.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Z,this.strm.avail_out=0;var re=U.inflateInit2(this.strm,ne.windowBits);if(re!==Y.Z_OK)throw new Error(J[re]);this.header=new K,U.inflateGetHeader(this.strm,this.header)}function ie(se,ne){var re=new Q(ne);if(re.push(se,!0),re.err)throw re.msg||J[re.err];return re.result}Q.prototype.push=function(se,ne){var re,ae,ce,he,fe,be,ue=this.strm,ge=this.options.chunkSize,ve=this.options.dictionary,Se=!1;if(this.ended)return!1;ae=ne===~~ne?ne:ne===!0?Y.Z_FINISH:Y.Z_NO_FLUSH,typeof se=="string"?ue.input=q.binstring2buf(se):te.call(se)==="[object ArrayBuffer]"?ue.input=new Uint8Array(se):ue.input=se,ue.next_in=0,ue.avail_in=ue.input.length;do{if(ue.avail_out===0&&(ue.output=new W.Buf8(ge),ue.next_out=0,ue.avail_out=ge),(re=U.inflate(ue,Y.Z_NO_FLUSH))===Y.Z_NEED_DICT&&ve&&(be=typeof ve=="string"?q.string2buf(ve):te.call(ve)==="[object ArrayBuffer]"?new Uint8Array(ve):ve,re=U.inflateSetDictionary(this.strm,be)),re===Y.Z_BUF_ERROR&&Se===!0&&(re=Y.Z_OK,Se=!1),re!==Y.Z_STREAM_END&&re!==Y.Z_OK)return this.onEnd(re),this.ended=!0,!1;ue.next_out&&(ue.avail_out!==0&&re!==Y.Z_STREAM_END&&(ue.avail_in!==0||ae!==Y.Z_FINISH&&ae!==Y.Z_SYNC_FLUSH)||(this.options.to==="string"?(ce=q.utf8border(ue.output,ue.next_out),he=ue.next_out-ce,fe=q.buf2string(ue.output,ce),ue.next_out=he,ue.avail_out=ge-he,he&&W.arraySet(ue.output,ue.output,ce,he,0),this.onData(fe)):this.onData(W.shrinkBuf(ue.output,ue.next_out)))),ue.avail_in===0&&ue.avail_out===0&&(Se=!0)}while((ue.avail_in>0||ue.avail_out===0)&&re!==Y.Z_STREAM_END);return re===Y.Z_STREAM_END&&(ae=Y.Z_FINISH),ae===Y.Z_FINISH?(re=U.inflateEnd(this.strm),this.onEnd(re),this.ended=!0,re===Y.Z_OK):ae!==Y.Z_SYNC_FLUSH||(this.onEnd(Y.Z_OK),ue.avail_out=0,!0)},Q.prototype.onData=function(se){this.chunks.push(se)},Q.prototype.onEnd=function(se){se===Y.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=W.flattenChunks(this.chunks)),this.chunks=[],this.err=se,this.msg=this.strm.msg},G.Inflate=Q,G.inflate=ie,G.inflateRaw=function(se,ne){return(ne=ne||{}).raw=!0,ie(se,ne)},G.ungzip=ie},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(F,D,G){var U=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";G.assign=function(Y){for(var J=Array.prototype.slice.call(arguments,1);J.length;){var Z=J.shift();if(Z){if(typeof Z!="object")throw new TypeError(Z+"must be non-object");for(var K in Z)Z.hasOwnProperty(K)&&(Y[K]=Z[K])}}return Y},G.shrinkBuf=function(Y,J){return Y.length===J?Y:Y.subarray?Y.subarray(0,J):(Y.length=J,Y)};var W={arraySet:function(Y,J,Z,K,te){if(J.subarray&&Y.subarray)Y.set(J.subarray(Z,Z+K),te);else for(var Q=0;Q=252?6:J>=248?5:J>=240?4:J>=224?3:J>=192?2:1;function Z(K,te){if(te<65537&&(K.subarray&&q||!K.subarray&&W))return String.fromCharCode.apply(null,U.shrinkBuf(K,te));for(var Q="",ie=0;ie>>6,te[ne++]=128|63&Q):Q<65536?(te[ne++]=224|Q>>>12,te[ne++]=128|Q>>>6&63,te[ne++]=128|63&Q):(te[ne++]=240|Q>>>18,te[ne++]=128|Q>>>12&63,te[ne++]=128|Q>>>6&63,te[ne++]=128|63&Q);return te},G.buf2binstring=function(K){return Z(K,K.length)},G.binstring2buf=function(K){for(var te=new U.Buf8(K.length),Q=0,ie=te.length;Q4)ae[ie++]=65533,Q+=ne-1;else{for(se&=ne===2?31:ne===3?15:7;ne>1&&Q1?ae[ie++]=65533:se<65536?ae[ie++]=se:(se-=65536,ae[ie++]=55296|se>>10&1023,ae[ie++]=56320|1023&se)}return Z(ae,ie)},G.utf8border=function(K,te){var Q;for((te=te||K.length)>K.length&&(te=K.length),Q=te-1;Q>=0&&(192&K[Q])==128;)Q--;return Q<0||Q===0?te:Q+Y[K[Q]]>te?Q:te}},{"./common":41}],43:[function(F,D,G){D.exports=function(U,W,q,Y){for(var J=65535&U|0,Z=U>>>16&65535|0,K=0;q!==0;){q-=K=q>2e3?2e3:q;do Z=Z+(J=J+W[Y++]|0)|0;while(--K);J%=65521,Z%=65521}return J|Z<<16|0}},{}],44:[function(F,D,G){D.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(F,D,G){var U=function(){for(var W,q=[],Y=0;Y<256;Y++){W=Y;for(var J=0;J<8;J++)W=1&W?3988292384^W>>>1:W>>>1;q[Y]=W}return q}();D.exports=function(W,q,Y,J){var Z=U,K=J+Y;W^=-1;for(var te=J;te>>8^Z[255&(W^q[te])];return-1^W}},{}],46:[function(F,D,G){var U,W=F("../utils/common"),q=F("./trees"),Y=F("./adler32"),J=F("./crc32"),Z=F("./messages");function K(pe,ye){return pe.msg=Z[ye],ye}function te(pe){return(pe<<1)-(pe>4?9:0)}function Q(pe){for(var ye=pe.length;--ye>=0;)pe[ye]=0}function ie(pe){var ye=pe.state,Ee=ye.pending;Ee>pe.avail_out&&(Ee=pe.avail_out),Ee!==0&&(W.arraySet(pe.output,ye.pending_buf,ye.pending_out,Ee,pe.next_out),pe.next_out+=Ee,ye.pending_out+=Ee,pe.total_out+=Ee,pe.avail_out-=Ee,ye.pending-=Ee,ye.pending===0&&(ye.pending_out=0))}function se(pe,ye){q._tr_flush_block(pe,pe.block_start>=0?pe.block_start:-1,pe.strstart-pe.block_start,ye),pe.block_start=pe.strstart,ie(pe.strm)}function ne(pe,ye){pe.pending_buf[pe.pending++]=ye}function re(pe,ye){pe.pending_buf[pe.pending++]=ye>>>8&255,pe.pending_buf[pe.pending++]=255&ye}function ae(pe,ye){var Ee,de,we=pe.max_chain_length,Oe=pe.strstart,Me=pe.prev_length,Pe=pe.nice_match,Ne=pe.strstart>pe.w_size-262?pe.strstart-(pe.w_size-262):0,ke=pe.window,Ae=pe.w_mask,_e=pe.prev,Fe=pe.strstart+258,Ye=ke[Oe+Me-1],Ce=ke[Oe+Me];pe.prev_length>=pe.good_match&&(we>>=2),Pe>pe.lookahead&&(Pe=pe.lookahead);do if(ke[(Ee=ye)+Me]===Ce&&ke[Ee+Me-1]===Ye&&ke[Ee]===ke[Oe]&&ke[++Ee]===ke[Oe+1]){Oe+=2,Ee++;do;while(ke[++Oe]===ke[++Ee]&&ke[++Oe]===ke[++Ee]&&ke[++Oe]===ke[++Ee]&&ke[++Oe]===ke[++Ee]&&ke[++Oe]===ke[++Ee]&&ke[++Oe]===ke[++Ee]&&ke[++Oe]===ke[++Ee]&&ke[++Oe]===ke[++Ee]&&OeMe){if(pe.match_start=ye,Me=de,de>=Pe)break;Ye=ke[Oe+Me-1],Ce=ke[Oe+Me]}}while((ye=_e[ye&Ae])>Ne&&--we!=0);return Me<=pe.lookahead?Me:pe.lookahead}function ce(pe){var ye,Ee,de,we,Oe,Me,Pe,Ne,ke,Ae,_e=pe.w_size;do{if(we=pe.window_size-pe.lookahead-pe.strstart,pe.strstart>=_e+(_e-262)){W.arraySet(pe.window,pe.window,_e,_e,0),pe.match_start-=_e,pe.strstart-=_e,pe.block_start-=_e,ye=Ee=pe.hash_size;do de=pe.head[--ye],pe.head[ye]=de>=_e?de-_e:0;while(--Ee);ye=Ee=_e;do de=pe.prev[--ye],pe.prev[ye]=de>=_e?de-_e:0;while(--Ee);we+=_e}if(pe.strm.avail_in===0)break;if(Me=pe.strm,Pe=pe.window,Ne=pe.strstart+pe.lookahead,ke=we,Ae=void 0,(Ae=Me.avail_in)>ke&&(Ae=ke),Ee=Ae===0?0:(Me.avail_in-=Ae,W.arraySet(Pe,Me.input,Me.next_in,Ae,Ne),Me.state.wrap===1?Me.adler=Y(Me.adler,Pe,Ae,Ne):Me.state.wrap===2&&(Me.adler=J(Me.adler,Pe,Ae,Ne)),Me.next_in+=Ae,Me.total_in+=Ae,Ae),pe.lookahead+=Ee,pe.lookahead+pe.insert>=3)for(Oe=pe.strstart-pe.insert,pe.ins_h=pe.window[Oe],pe.ins_h=(pe.ins_h<=3&&(pe.ins_h=(pe.ins_h<=3)if(de=q._tr_tally(pe,pe.strstart-pe.match_start,pe.match_length-3),pe.lookahead-=pe.match_length,pe.match_length<=pe.max_lazy_match&&pe.lookahead>=3){pe.match_length--;do pe.strstart++,pe.ins_h=(pe.ins_h<=3&&(pe.ins_h=(pe.ins_h<4096)&&(pe.match_length=2)),pe.prev_length>=3&&pe.match_length<=pe.prev_length){we=pe.strstart+pe.lookahead-3,de=q._tr_tally(pe,pe.strstart-1-pe.prev_match,pe.prev_length-3),pe.lookahead-=pe.prev_length-1,pe.prev_length-=2;do++pe.strstart<=we&&(pe.ins_h=(pe.ins_h<15&&(Me=2,de-=16),we<1||we>9||Ee!==8||de<8||de>15||ye<0||ye>9||Oe<0||Oe>4)return K(pe,-2);de===8&&(de=9);var Pe=new ue;return pe.state=Pe,Pe.strm=pe,Pe.wrap=Me,Pe.gzhead=null,Pe.w_bits=de,Pe.w_size=1<pe.pending_buf_size-5&&(Ee=pe.pending_buf_size-5);;){if(pe.lookahead<=1){if(ce(pe),pe.lookahead===0&&ye===0)return 1;if(pe.lookahead===0)break}pe.strstart+=pe.lookahead,pe.lookahead=0;var de=pe.block_start+Ee;if((pe.strstart===0||pe.strstart>=de)&&(pe.lookahead=pe.strstart-de,pe.strstart=de,se(pe,!1),pe.strm.avail_out===0)||pe.strstart-pe.block_start>=pe.w_size-262&&(se(pe,!1),pe.strm.avail_out===0))return 1}return pe.insert=0,ye===4?(se(pe,!0),pe.strm.avail_out===0?3:4):(pe.strstart>pe.block_start&&(se(pe,!1),pe.strm.avail_out),1)}),new be(4,4,8,4,he),new be(4,5,16,8,he),new be(4,6,32,32,he),new be(4,4,16,16,fe),new be(8,16,32,32,fe),new be(8,16,128,128,fe),new be(8,32,128,256,fe),new be(32,128,258,1024,fe),new be(32,258,258,4096,fe)],G.deflateInit=function(pe,ye){return Se(pe,ye,8,15,8,0)},G.deflateInit2=Se,G.deflateReset=ve,G.deflateResetKeep=ge,G.deflateSetHeader=function(pe,ye){return pe&&pe.state?pe.state.wrap!==2?-2:(pe.state.gzhead=ye,0):-2},G.deflate=function(pe,ye){var Ee,de,we,Oe;if(!pe||!pe.state||ye>5||ye<0)return pe?K(pe,-2):-2;if(de=pe.state,!pe.output||!pe.input&&pe.avail_in!==0||de.status===666&&ye!==4)return K(pe,pe.avail_out===0?-5:-2);if(de.strm=pe,Ee=de.last_flush,de.last_flush=ye,de.status===42)if(de.wrap===2)pe.adler=0,ne(de,31),ne(de,139),ne(de,8),de.gzhead?(ne(de,(de.gzhead.text?1:0)+(de.gzhead.hcrc?2:0)+(de.gzhead.extra?4:0)+(de.gzhead.name?8:0)+(de.gzhead.comment?16:0)),ne(de,255&de.gzhead.time),ne(de,de.gzhead.time>>8&255),ne(de,de.gzhead.time>>16&255),ne(de,de.gzhead.time>>24&255),ne(de,de.level===9?2:de.strategy>=2||de.level<2?4:0),ne(de,255&de.gzhead.os),de.gzhead.extra&&de.gzhead.extra.length&&(ne(de,255&de.gzhead.extra.length),ne(de,de.gzhead.extra.length>>8&255)),de.gzhead.hcrc&&(pe.adler=J(pe.adler,de.pending_buf,de.pending,0)),de.gzindex=0,de.status=69):(ne(de,0),ne(de,0),ne(de,0),ne(de,0),ne(de,0),ne(de,de.level===9?2:de.strategy>=2||de.level<2?4:0),ne(de,3),de.status=113);else{var Me=8+(de.w_bits-8<<4)<<8;Me|=(de.strategy>=2||de.level<2?0:de.level<6?1:de.level===6?2:3)<<6,de.strstart!==0&&(Me|=32),Me+=31-Me%31,de.status=113,re(de,Me),de.strstart!==0&&(re(de,pe.adler>>>16),re(de,65535&pe.adler)),pe.adler=1}if(de.status===69)if(de.gzhead.extra){for(we=de.pending;de.gzindex<(65535&de.gzhead.extra.length)&&(de.pending!==de.pending_buf_size||(de.gzhead.hcrc&&de.pending>we&&(pe.adler=J(pe.adler,de.pending_buf,de.pending-we,we)),ie(pe),we=de.pending,de.pending!==de.pending_buf_size));)ne(de,255&de.gzhead.extra[de.gzindex]),de.gzindex++;de.gzhead.hcrc&&de.pending>we&&(pe.adler=J(pe.adler,de.pending_buf,de.pending-we,we)),de.gzindex===de.gzhead.extra.length&&(de.gzindex=0,de.status=73)}else de.status=73;if(de.status===73)if(de.gzhead.name){we=de.pending;do{if(de.pending===de.pending_buf_size&&(de.gzhead.hcrc&&de.pending>we&&(pe.adler=J(pe.adler,de.pending_buf,de.pending-we,we)),ie(pe),we=de.pending,de.pending===de.pending_buf_size)){Oe=1;break}Oe=de.gzindexwe&&(pe.adler=J(pe.adler,de.pending_buf,de.pending-we,we)),Oe===0&&(de.gzindex=0,de.status=91)}else de.status=91;if(de.status===91)if(de.gzhead.comment){we=de.pending;do{if(de.pending===de.pending_buf_size&&(de.gzhead.hcrc&&de.pending>we&&(pe.adler=J(pe.adler,de.pending_buf,de.pending-we,we)),ie(pe),we=de.pending,de.pending===de.pending_buf_size)){Oe=1;break}Oe=de.gzindexwe&&(pe.adler=J(pe.adler,de.pending_buf,de.pending-we,we)),Oe===0&&(de.status=103)}else de.status=103;if(de.status===103&&(de.gzhead.hcrc?(de.pending+2>de.pending_buf_size&&ie(pe),de.pending+2<=de.pending_buf_size&&(ne(de,255&pe.adler),ne(de,pe.adler>>8&255),pe.adler=0,de.status=113)):de.status=113),de.pending!==0){if(ie(pe),pe.avail_out===0)return de.last_flush=-1,0}else if(pe.avail_in===0&&te(ye)<=te(Ee)&&ye!==4)return K(pe,-5);if(de.status===666&&pe.avail_in!==0)return K(pe,-5);if(pe.avail_in!==0||de.lookahead!==0||ye!==0&&de.status!==666){var Pe=de.strategy===2?function(Ne,ke){for(var Ae;;){if(Ne.lookahead===0&&(ce(Ne),Ne.lookahead===0)){if(ke===0)return 1;break}if(Ne.match_length=0,Ae=q._tr_tally(Ne,0,Ne.window[Ne.strstart]),Ne.lookahead--,Ne.strstart++,Ae&&(se(Ne,!1),Ne.strm.avail_out===0))return 1}return Ne.insert=0,ke===4?(se(Ne,!0),Ne.strm.avail_out===0?3:4):Ne.last_lit&&(se(Ne,!1),Ne.strm.avail_out===0)?1:2}(de,ye):de.strategy===3?function(Ne,ke){for(var Ae,_e,Fe,Ye,Ce=Ne.window;;){if(Ne.lookahead<=258){if(ce(Ne),Ne.lookahead<=258&&ke===0)return 1;if(Ne.lookahead===0)break}if(Ne.match_length=0,Ne.lookahead>=3&&Ne.strstart>0&&(_e=Ce[Fe=Ne.strstart-1])===Ce[++Fe]&&_e===Ce[++Fe]&&_e===Ce[++Fe]){Ye=Ne.strstart+258;do;while(_e===Ce[++Fe]&&_e===Ce[++Fe]&&_e===Ce[++Fe]&&_e===Ce[++Fe]&&_e===Ce[++Fe]&&_e===Ce[++Fe]&&_e===Ce[++Fe]&&_e===Ce[++Fe]&&FeNe.lookahead&&(Ne.match_length=Ne.lookahead)}if(Ne.match_length>=3?(Ae=q._tr_tally(Ne,1,Ne.match_length-3),Ne.lookahead-=Ne.match_length,Ne.strstart+=Ne.match_length,Ne.match_length=0):(Ae=q._tr_tally(Ne,0,Ne.window[Ne.strstart]),Ne.lookahead--,Ne.strstart++),Ae&&(se(Ne,!1),Ne.strm.avail_out===0))return 1}return Ne.insert=0,ke===4?(se(Ne,!0),Ne.strm.avail_out===0?3:4):Ne.last_lit&&(se(Ne,!1),Ne.strm.avail_out===0)?1:2}(de,ye):U[de.level].func(de,ye);if(Pe!==3&&Pe!==4||(de.status=666),Pe===1||Pe===3)return pe.avail_out===0&&(de.last_flush=-1),0;if(Pe===2&&(ye===1?q._tr_align(de):ye!==5&&(q._tr_stored_block(de,0,0,!1),ye===3&&(Q(de.head),de.lookahead===0&&(de.strstart=0,de.block_start=0,de.insert=0))),ie(pe),pe.avail_out===0))return de.last_flush=-1,0}return ye!==4?0:de.wrap<=0?1:(de.wrap===2?(ne(de,255&pe.adler),ne(de,pe.adler>>8&255),ne(de,pe.adler>>16&255),ne(de,pe.adler>>24&255),ne(de,255&pe.total_in),ne(de,pe.total_in>>8&255),ne(de,pe.total_in>>16&255),ne(de,pe.total_in>>24&255)):(re(de,pe.adler>>>16),re(de,65535&pe.adler)),ie(pe),de.wrap>0&&(de.wrap=-de.wrap),de.pending!==0?0:1)},G.deflateEnd=function(pe){var ye;return pe&&pe.state?(ye=pe.state.status)!==42&&ye!==69&&ye!==73&&ye!==91&&ye!==103&&ye!==113&&ye!==666?K(pe,-2):(pe.state=null,ye===113?K(pe,-3):0):-2},G.deflateSetDictionary=function(pe,ye){var Ee,de,we,Oe,Me,Pe,Ne,ke,Ae=ye.length;if(!pe||!pe.state||(Oe=(Ee=pe.state).wrap)===2||Oe===1&&Ee.status!==42||Ee.lookahead)return-2;for(Oe===1&&(pe.adler=Y(pe.adler,ye,Ae,0)),Ee.wrap=0,Ae>=Ee.w_size&&(Oe===0&&(Q(Ee.head),Ee.strstart=0,Ee.block_start=0,Ee.insert=0),ke=new W.Buf8(Ee.w_size),W.arraySet(ke,ye,Ae-Ee.w_size,Ee.w_size,0),ye=ke,Ae=Ee.w_size),Me=pe.avail_in,Pe=pe.next_in,Ne=pe.input,pe.avail_in=Ae,pe.next_in=0,pe.input=ye,ce(Ee);Ee.lookahead>=3;){de=Ee.strstart,we=Ee.lookahead-2;do Ee.ins_h=(Ee.ins_h<>>=ve=ge>>>24,ce-=ve,(ve=ge>>>16&255)===0)we[Z++]=65535≥else{if(!(16&ve)){if((64&ve)==0){ge=he[(65535&ge)+(ae&(1<>>=ve,ce-=ve),ce<15&&(ae+=de[Y++]<>>=ve=ge>>>24,ce-=ve,!(16&(ve=ge>>>16&255))){if((64&ve)==0){ge=fe[(65535&ge)+(ae&(1<Q){U.msg="invalid distance too far back",q.mode=30;break e}if(ae>>>=ve,ce-=ve,pe>(ve=Z-K)){if((ve=pe-ve)>se&&q.sane){U.msg="invalid distance too far back",q.mode=30;break e}if(ye=0,Ee=re,ne===0){if(ye+=ie-ve,ve2;)we[Z++]=Ee[ye++],we[Z++]=Ee[ye++],we[Z++]=Ee[ye++],Se-=3;Se&&(we[Z++]=Ee[ye++],Se>1&&(we[Z++]=Ee[ye++]))}else{ye=Z-pe;do we[Z++]=we[ye++],we[Z++]=we[ye++],we[Z++]=we[ye++],Se-=3;while(Se>2);Se&&(we[Z++]=we[ye++],Se>1&&(we[Z++]=we[ye++]))}break}}break}}while(Y>3,ae&=(1<<(ce-=Se<<3))-1,U.next_in=Y,U.next_out=Z,U.avail_in=Y>>24&255)+(fe>>>8&65280)+((65280&fe)<<8)+((255&fe)<<24)}function K(){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 U.Buf16(320),this.work=new U.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function te(fe){var be;return fe&&fe.state?(be=fe.state,fe.total_in=fe.total_out=be.total=0,fe.msg="",be.wrap&&(fe.adler=1&be.wrap),be.mode=1,be.last=0,be.havedict=0,be.dmax=32768,be.head=null,be.hold=0,be.bits=0,be.lencode=be.lendyn=new U.Buf32(852),be.distcode=be.distdyn=new U.Buf32(592),be.sane=1,be.back=-1,0):-2}function Q(fe){var be;return fe&&fe.state?((be=fe.state).wsize=0,be.whave=0,be.wnext=0,te(fe)):-2}function ie(fe,be){var ue,ge;return fe&&fe.state?(ge=fe.state,be<0?(ue=0,be=-be):(ue=1+(be>>4),be<48&&(be&=15)),be&&(be<8||be>15)?-2:(ge.window!==null&&ge.wbits!==be&&(ge.window=null),ge.wrap=ue,ge.wbits=be,Q(fe))):-2}function se(fe,be){var ue,ge;return fe?(ge=new K,fe.state=ge,ge.window=null,(ue=ie(fe,be))!==0&&(fe.state=null),ue):-2}var ne,re,ae=!0;function ce(fe){if(ae){var be;for(ne=new U.Buf32(512),re=new U.Buf32(32),be=0;be<144;)fe.lens[be++]=8;for(;be<256;)fe.lens[be++]=9;for(;be<280;)fe.lens[be++]=7;for(;be<288;)fe.lens[be++]=8;for(J(1,fe.lens,0,288,ne,0,fe.work,{bits:9}),be=0;be<32;)fe.lens[be++]=5;J(2,fe.lens,0,32,re,0,fe.work,{bits:5}),ae=!1}fe.lencode=ne,fe.lenbits=9,fe.distcode=re,fe.distbits=5}function he(fe,be,ue,ge){var ve,Se=fe.state;return Se.window===null&&(Se.wsize=1<=Se.wsize?(U.arraySet(Se.window,be,ue-Se.wsize,Se.wsize,0),Se.wnext=0,Se.whave=Se.wsize):((ve=Se.wsize-Se.wnext)>ge&&(ve=ge),U.arraySet(Se.window,be,ue-ge,ve,Se.wnext),(ge-=ve)?(U.arraySet(Se.window,be,ue-ge,ge,0),Se.wnext=ge,Se.whave=Se.wsize):(Se.wnext+=ve,Se.wnext===Se.wsize&&(Se.wnext=0),Se.whave>>8&255,ue.check=q(ue.check,ct,2,0),de=0,we=0,ue.mode=2;break}if(ue.flags=0,ue.head&&(ue.head.done=!1),!(1&ue.wrap)||(((255&de)<<8)+(de>>8))%31){fe.msg="incorrect header check",ue.mode=30;break}if((15&de)!=8){fe.msg="unknown compression method",ue.mode=30;break}if(we-=4,We=8+(15&(de>>>=4)),ue.wbits===0)ue.wbits=We;else if(We>ue.wbits){fe.msg="invalid window size",ue.mode=30;break}ue.dmax=1<>8&1),512&ue.flags&&(ct[0]=255&de,ct[1]=de>>>8&255,ue.check=q(ue.check,ct,2,0)),de=0,we=0,ue.mode=3;case 3:for(;we<32;){if(ye===0)break e;ye--,de+=ge[Se++]<>>8&255,ct[2]=de>>>16&255,ct[3]=de>>>24&255,ue.check=q(ue.check,ct,4,0)),de=0,we=0,ue.mode=4;case 4:for(;we<16;){if(ye===0)break e;ye--,de+=ge[Se++]<>8),512&ue.flags&&(ct[0]=255&de,ct[1]=de>>>8&255,ue.check=q(ue.check,ct,2,0)),de=0,we=0,ue.mode=5;case 5:if(1024&ue.flags){for(;we<16;){if(ye===0)break e;ye--,de+=ge[Se++]<>>8&255,ue.check=q(ue.check,ct,2,0)),de=0,we=0}else ue.head&&(ue.head.extra=null);ue.mode=6;case 6:if(1024&ue.flags&&((Pe=ue.length)>ye&&(Pe=ye),Pe&&(ue.head&&(We=ue.head.extra_len-ue.length,ue.head.extra||(ue.head.extra=new Array(ue.head.extra_len)),U.arraySet(ue.head.extra,ge,Se,Pe,We)),512&ue.flags&&(ue.check=q(ue.check,ge,Pe,Se)),ye-=Pe,Se+=Pe,ue.length-=Pe),ue.length))break e;ue.length=0,ue.mode=7;case 7:if(2048&ue.flags){if(ye===0)break e;Pe=0;do We=ge[Se+Pe++],ue.head&&We&&ue.length<65536&&(ue.head.name+=String.fromCharCode(We));while(We&&Pe>9&1,ue.head.done=!0),fe.adler=ue.check=0,ue.mode=12;break;case 10:for(;we<32;){if(ye===0)break e;ye--,de+=ge[Se++]<>>=7&we,we-=7&we,ue.mode=27;break}for(;we<3;){if(ye===0)break e;ye--,de+=ge[Se++]<>>=1)){case 0:ue.mode=14;break;case 1:if(ce(ue),ue.mode=20,be===6){de>>>=2,we-=2;break e}break;case 2:ue.mode=17;break;case 3:fe.msg="invalid block type",ue.mode=30}de>>>=2,we-=2;break;case 14:for(de>>>=7&we,we-=7&we;we<32;){if(ye===0)break e;ye--,de+=ge[Se++]<>>16^65535)){fe.msg="invalid stored block lengths",ue.mode=30;break}if(ue.length=65535&de,de=0,we=0,ue.mode=15,be===6)break e;case 15:ue.mode=16;case 16:if(Pe=ue.length){if(Pe>ye&&(Pe=ye),Pe>Ee&&(Pe=Ee),Pe===0)break e;U.arraySet(ve,ge,Se,Pe,pe),ye-=Pe,Se+=Pe,Ee-=Pe,pe+=Pe,ue.length-=Pe;break}ue.mode=12;break;case 17:for(;we<14;){if(ye===0)break e;ye--,de+=ge[Se++]<>>=5,we-=5,ue.ndist=1+(31&de),de>>>=5,we-=5,ue.ncode=4+(15&de),de>>>=4,we-=4,ue.nlen>286||ue.ndist>30){fe.msg="too many length or distance symbols",ue.mode=30;break}ue.have=0,ue.mode=18;case 18:for(;ue.have>>=3,we-=3}for(;ue.have<19;)ue.lens[De[ue.have++]]=0;if(ue.lencode=ue.lendyn,ue.lenbits=7,Ze={bits:ue.lenbits},Ve=J(0,ue.lens,0,19,ue.lencode,0,ue.work,Ze),ue.lenbits=Ze.bits,Ve){fe.msg="invalid code lengths set",ue.mode=30;break}ue.have=0,ue.mode=19;case 19:for(;ue.have>>16&255,Fe=65535&at,!((Ae=at>>>24)<=we);){if(ye===0)break e;ye--,de+=ge[Se++]<>>=Ae,we-=Ae,ue.lens[ue.have++]=Fe;else{if(Fe===16){for(nt=Ae+2;we>>=Ae,we-=Ae,ue.have===0){fe.msg="invalid bit length repeat",ue.mode=30;break}We=ue.lens[ue.have-1],Pe=3+(3&de),de>>>=2,we-=2}else if(Fe===17){for(nt=Ae+3;we>>=Ae)),de>>>=3,we-=3}else{for(nt=Ae+7;we>>=Ae)),de>>>=7,we-=7}if(ue.have+Pe>ue.nlen+ue.ndist){fe.msg="invalid bit length repeat",ue.mode=30;break}for(;Pe--;)ue.lens[ue.have++]=We}}if(ue.mode===30)break;if(ue.lens[256]===0){fe.msg="invalid code -- missing end-of-block",ue.mode=30;break}if(ue.lenbits=9,Ze={bits:ue.lenbits},Ve=J(1,ue.lens,0,ue.nlen,ue.lencode,0,ue.work,Ze),ue.lenbits=Ze.bits,Ve){fe.msg="invalid literal/lengths set",ue.mode=30;break}if(ue.distbits=6,ue.distcode=ue.distdyn,Ze={bits:ue.distbits},Ve=J(2,ue.lens,ue.nlen,ue.ndist,ue.distcode,0,ue.work,Ze),ue.distbits=Ze.bits,Ve){fe.msg="invalid distances set",ue.mode=30;break}if(ue.mode=20,be===6)break e;case 20:ue.mode=21;case 21:if(ye>=6&&Ee>=258){fe.next_out=pe,fe.avail_out=Ee,fe.next_in=Se,fe.avail_in=ye,ue.hold=de,ue.bits=we,Y(fe,Me),pe=fe.next_out,ve=fe.output,Ee=fe.avail_out,Se=fe.next_in,ge=fe.input,ye=fe.avail_in,de=ue.hold,we=ue.bits,ue.mode===12&&(ue.back=-1);break}for(ue.back=0;_e=(at=ue.lencode[de&(1<>>16&255,Fe=65535&at,!((Ae=at>>>24)<=we);){if(ye===0)break e;ye--,de+=ge[Se++]<>Ye)])>>>16&255,Fe=65535&at,!(Ye+(Ae=at>>>24)<=we);){if(ye===0)break e;ye--,de+=ge[Se++]<>>=Ye,we-=Ye,ue.back+=Ye}if(de>>>=Ae,we-=Ae,ue.back+=Ae,ue.length=Fe,_e===0){ue.mode=26;break}if(32&_e){ue.back=-1,ue.mode=12;break}if(64&_e){fe.msg="invalid literal/length code",ue.mode=30;break}ue.extra=15&_e,ue.mode=22;case 22:if(ue.extra){for(nt=ue.extra;we>>=ue.extra,we-=ue.extra,ue.back+=ue.extra}ue.was=ue.length,ue.mode=23;case 23:for(;_e=(at=ue.distcode[de&(1<>>16&255,Fe=65535&at,!((Ae=at>>>24)<=we);){if(ye===0)break e;ye--,de+=ge[Se++]<>Ye)])>>>16&255,Fe=65535&at,!(Ye+(Ae=at>>>24)<=we);){if(ye===0)break e;ye--,de+=ge[Se++]<>>=Ye,we-=Ye,ue.back+=Ye}if(de>>>=Ae,we-=Ae,ue.back+=Ae,64&_e){fe.msg="invalid distance code",ue.mode=30;break}ue.offset=Fe,ue.extra=15&_e,ue.mode=24;case 24:if(ue.extra){for(nt=ue.extra;we>>=ue.extra,we-=ue.extra,ue.back+=ue.extra}if(ue.offset>ue.dmax){fe.msg="invalid distance too far back",ue.mode=30;break}ue.mode=25;case 25:if(Ee===0)break e;if(Pe=Me-Ee,ue.offset>Pe){if((Pe=ue.offset-Pe)>ue.whave&&ue.sane){fe.msg="invalid distance too far back",ue.mode=30;break}Pe>ue.wnext?(Pe-=ue.wnext,Ne=ue.wsize-Pe):Ne=ue.wnext-Pe,Pe>ue.length&&(Pe=ue.length),ke=ue.window}else ke=ve,Ne=pe-ue.offset,Pe=ue.length;Pe>Ee&&(Pe=Ee),Ee-=Pe,ue.length-=Pe;do ve[pe++]=ke[Ne++];while(--Pe);ue.length===0&&(ue.mode=21);break;case 26:if(Ee===0)break e;ve[pe++]=ue.length,Ee--,ue.mode=21;break;case 27:if(ue.wrap){for(;we<32;){if(ye===0)break e;ye--,de|=ge[Se++]<=1&&Ye[we]===0;we--);if(Oe>we&&(Oe=we),we===0)return ie[se++]=20971520,ie[se++]=20971520,re.bits=1,0;for(de=1;de0&&(Z===0||we!==1))return-1;for(Ce[1]=0,ye=1;ye<15;ye++)Ce[ye+1]=Ce[ye]+Ye[ye];for(Ee=0;Ee852||Z===2&&ke>592)return 1;for(;;){ge=ye-Pe,ne[Ee]ue?(ve=Ge[We+ne[Ee]],Se=_e[Fe+ne[Ee]]):(ve=96,Se=0),ae=1<>Pe)+(ce-=ae)]=ge<<24|ve<<16|Se|0;while(ce!==0);for(ae=1<>=1;if(ae!==0?(Ae&=ae-1,Ae+=ae):Ae=0,Ee++,--Ye[ye]==0){if(ye===we)break;ye=K[te+ne[Ee]]}if(ye>Oe&&(Ae&fe)!==he){for(Pe===0&&(Pe=Oe),be+=de,Ne=1<<(Me=ye-Pe);Me+Pe852||Z===2&&ke>592)return 1;ie[he=Ae&fe]=Oe<<24|Me<<16|be-se|0}}return Ae!==0&&(ie[be+Ae]=ye-Pe<<24|64<<16|0),re.bits=Oe,0}},{"../utils/common":41}],51:[function(F,D,G){D.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(F,D,G){var U=F("../utils/common");function W(_e){for(var Fe=_e.length;--Fe>=0;)_e[Fe]=0}var q=[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],Y=[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],J=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],K=new Array(576);W(K);var te=new Array(60);W(te);var Q=new Array(512);W(Q);var ie=new Array(256);W(ie);var se=new Array(29);W(se);var ne,re,ae,ce=new Array(30);function he(_e,Fe,Ye,Ce,Ge){this.static_tree=_e,this.extra_bits=Fe,this.extra_base=Ye,this.elems=Ce,this.max_length=Ge,this.has_stree=_e&&_e.length}function fe(_e,Fe){this.dyn_tree=_e,this.max_code=0,this.stat_desc=Fe}function be(_e){return _e<256?Q[_e]:Q[256+(_e>>>7)]}function ue(_e,Fe){_e.pending_buf[_e.pending++]=255&Fe,_e.pending_buf[_e.pending++]=Fe>>>8&255}function ge(_e,Fe,Ye){_e.bi_valid>16-Ye?(_e.bi_buf|=Fe<<_e.bi_valid&65535,ue(_e,_e.bi_buf),_e.bi_buf=Fe>>16-_e.bi_valid,_e.bi_valid+=Ye-16):(_e.bi_buf|=Fe<<_e.bi_valid&65535,_e.bi_valid+=Ye)}function ve(_e,Fe,Ye){ge(_e,Ye[2*Fe],Ye[2*Fe+1])}function Se(_e,Fe){var Ye=0;do Ye|=1&_e,_e>>>=1,Ye<<=1;while(--Fe>0);return Ye>>>1}function pe(_e,Fe,Ye){var Ce,Ge,We=new Array(16),Ve=0;for(Ce=1;Ce<=15;Ce++)We[Ce]=Ve=Ve+Ye[Ce-1]<<1;for(Ge=0;Ge<=Fe;Ge++){var Ze=_e[2*Ge+1];Ze!==0&&(_e[2*Ge]=Se(We[Ze]++,Ze))}}function ye(_e){var Fe;for(Fe=0;Fe<286;Fe++)_e.dyn_ltree[2*Fe]=0;for(Fe=0;Fe<30;Fe++)_e.dyn_dtree[2*Fe]=0;for(Fe=0;Fe<19;Fe++)_e.bl_tree[2*Fe]=0;_e.dyn_ltree[512]=1,_e.opt_len=_e.static_len=0,_e.last_lit=_e.matches=0}function Ee(_e){_e.bi_valid>8?ue(_e,_e.bi_buf):_e.bi_valid>0&&(_e.pending_buf[_e.pending++]=_e.bi_buf),_e.bi_buf=0,_e.bi_valid=0}function de(_e,Fe,Ye,Ce){var Ge=2*Fe,We=2*Ye;return _e[Ge]<_e[We]||_e[Ge]===_e[We]&&Ce[Fe]<=Ce[Ye]}function we(_e,Fe,Ye){for(var Ce=_e.heap[Ye],Ge=Ye<<1;Ge<=_e.heap_len&&(Ge<_e.heap_len&&de(Fe,_e.heap[Ge+1],_e.heap[Ge],_e.depth)&&Ge++,!de(Fe,Ce,_e.heap[Ge],_e.depth));)_e.heap[Ye]=_e.heap[Ge],Ye=Ge,Ge<<=1;_e.heap[Ye]=Ce}function Oe(_e,Fe,Ye){var Ce,Ge,We,Ve,Ze=0;if(_e.last_lit!==0)do Ce=_e.pending_buf[_e.d_buf+2*Ze]<<8|_e.pending_buf[_e.d_buf+2*Ze+1],Ge=_e.pending_buf[_e.l_buf+Ze],Ze++,Ce===0?ve(_e,Ge,Fe):(ve(_e,(We=ie[Ge])+256+1,Fe),(Ve=q[We])!==0&&ge(_e,Ge-=se[We],Ve),ve(_e,We=be(--Ce),Ye),(Ve=Y[We])!==0&&ge(_e,Ce-=ce[We],Ve));while(Ze<_e.last_lit);ve(_e,256,Fe)}function Me(_e,Fe){var Ye,Ce,Ge,We=Fe.dyn_tree,Ve=Fe.stat_desc.static_tree,Ze=Fe.stat_desc.has_stree,nt=Fe.stat_desc.elems,at=-1;for(_e.heap_len=0,_e.heap_max=573,Ye=0;Ye>1;Ye>=1;Ye--)we(_e,We,Ye);Ge=nt;do Ye=_e.heap[1],_e.heap[1]=_e.heap[_e.heap_len--],we(_e,We,1),Ce=_e.heap[1],_e.heap[--_e.heap_max]=Ye,_e.heap[--_e.heap_max]=Ce,We[2*Ge]=We[2*Ye]+We[2*Ce],_e.depth[Ge]=(_e.depth[Ye]>=_e.depth[Ce]?_e.depth[Ye]:_e.depth[Ce])+1,We[2*Ye+1]=We[2*Ce+1]=Ge,_e.heap[1]=Ge++,we(_e,We,1);while(_e.heap_len>=2);_e.heap[--_e.heap_max]=_e.heap[1],function(ct,De){var xe,ze,qe,Re,Le,je,Xe=De.dyn_tree,Qe=De.max_code,He=De.stat_desc.static_tree,tt=De.stat_desc.has_stree,ot=De.stat_desc.extra_bits,rt=De.stat_desc.extra_base,ft=De.stat_desc.max_length,St=0;for(Re=0;Re<=15;Re++)ct.bl_count[Re]=0;for(Xe[2*ct.heap[ct.heap_max]+1]=0,xe=ct.heap_max+1;xe<573;xe++)(Re=Xe[2*Xe[2*(ze=ct.heap[xe])+1]+1]+1)>ft&&(Re=ft,St++),Xe[2*ze+1]=Re,ze>Qe||(ct.bl_count[Re]++,Le=0,ze>=rt&&(Le=ot[ze-rt]),je=Xe[2*ze],ct.opt_len+=je*(Re+Le),tt&&(ct.static_len+=je*(He[2*ze+1]+Le)));if(St!==0){do{for(Re=ft-1;ct.bl_count[Re]===0;)Re--;ct.bl_count[Re]--,ct.bl_count[Re+1]+=2,ct.bl_count[ft]--,St-=2}while(St>0);for(Re=ft;Re!==0;Re--)for(ze=ct.bl_count[Re];ze!==0;)(qe=ct.heap[--xe])>Qe||(Xe[2*qe+1]!==Re&&(ct.opt_len+=(Re-Xe[2*qe+1])*Xe[2*qe],Xe[2*qe+1]=Re),ze--)}}(_e,Fe),pe(We,at,_e.bl_count)}function Pe(_e,Fe,Ye){var Ce,Ge,We=-1,Ve=Fe[1],Ze=0,nt=7,at=4;for(Ve===0&&(nt=138,at=3),Fe[2*(Ye+1)+1]=65535,Ce=0;Ce<=Ye;Ce++)Ge=Ve,Ve=Fe[2*(Ce+1)+1],++Ze>=7;Ge<30;Ge++)for(ce[Ge]=We<<7,Fe=0;Fe<1<0?(_e.strm.data_type===2&&(_e.strm.data_type=function(Ze){var nt,at=4093624447;for(nt=0;nt<=31;nt++,at>>>=1)if(1&at&&Ze.dyn_ltree[2*nt]!==0)return 0;if(Ze.dyn_ltree[18]!==0||Ze.dyn_ltree[20]!==0||Ze.dyn_ltree[26]!==0)return 1;for(nt=32;nt<256;nt++)if(Ze.dyn_ltree[2*nt]!==0)return 1;return 0}(_e)),Me(_e,_e.l_desc),Me(_e,_e.d_desc),Ve=function(Ze){var nt;for(Pe(Ze,Ze.dyn_ltree,Ze.l_desc.max_code),Pe(Ze,Ze.dyn_dtree,Ze.d_desc.max_code),Me(Ze,Ze.bl_desc),nt=18;nt>=3&&Ze.bl_tree[2*Z[nt]+1]===0;nt--);return Ze.opt_len+=3*(nt+1)+5+5+4,nt}(_e),Ge=_e.opt_len+3+7>>>3,(We=_e.static_len+3+7>>>3)<=Ge&&(Ge=We)):Ge=We=Ye+5,Ye+4<=Ge&&Fe!==-1?Ae(_e,Fe,Ye,Ce):_e.strategy===4||We===Ge?(ge(_e,2+(Ce?1:0),3),Oe(_e,K,te)):(ge(_e,4+(Ce?1:0),3),function(Ze,nt,at,ct){var De;for(ge(Ze,nt-257,5),ge(Ze,at-1,5),ge(Ze,ct-4,4),De=0;De>>8&255,_e.pending_buf[_e.d_buf+2*_e.last_lit+1]=255&Fe,_e.pending_buf[_e.l_buf+_e.last_lit]=255&Ye,_e.last_lit++,Fe===0?_e.dyn_ltree[2*Ye]++:(_e.matches++,Fe--,_e.dyn_ltree[2*(ie[Ye]+256+1)]++,_e.dyn_dtree[2*be(Fe)]++),_e.last_lit===_e.lit_bufsize-1},G._tr_align=function(_e){ge(_e,2,3),ve(_e,256,K),function(Fe){Fe.bi_valid===16?(ue(Fe,Fe.bi_buf),Fe.bi_buf=0,Fe.bi_valid=0):Fe.bi_valid>=8&&(Fe.pending_buf[Fe.pending++]=255&Fe.bi_buf,Fe.bi_buf>>=8,Fe.bi_valid-=8)}(_e)}},{"../utils/common":41}],53:[function(F,D,G){D.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(F,D,G){(function(U){(function(W,q){if(!W.setImmediate){var Y,J,Z,K,te,Q=1,ie={},se=!1,ne=W.document,re=Object.getPrototypeOf&&Object.getPrototypeOf(W);re=re&&re.setTimeout?re:W,{}.toString.call(W.process)==="[object process]"?Y=function(he){process.nextTick(function(){ce(he)})}:function(){if(W.postMessage&&!W.importScripts){var he=!0,fe=W.onmessage;return W.onmessage=function(){he=!1},W.postMessage("","*"),W.onmessage=fe,he}}()?(K="setImmediate$"+Math.random()+"$",te=function(he){he.source===W&&typeof he.data=="string"&&he.data.indexOf(K)===0&&ce(+he.data.slice(K.length))},W.addEventListener?W.addEventListener("message",te,!1):W.attachEvent("onmessage",te),Y=function(he){W.postMessage(K+he,"*")}):W.MessageChannel?((Z=new MessageChannel).port1.onmessage=function(he){ce(he.data)},Y=function(he){Z.port2.postMessage(he)}):ne&&"onreadystatechange"in ne.createElement("script")?(J=ne.documentElement,Y=function(he){var fe=ne.createElement("script");fe.onreadystatechange=function(){ce(he),fe.onreadystatechange=null,J.removeChild(fe),fe=null},J.appendChild(fe)}):Y=function(he){setTimeout(ce,0,he)},re.setImmediate=function(he){typeof he!="function"&&(he=new Function(""+he));for(var fe=new Array(arguments.length-1),be=0;be{const D=new XMLHttpRequest;D.open("GET",B,!0),D.responseType="arraybuffer",D.send(),D.onreadystatechange=function(){D.readyState==4&&D.status==200&&jszip.loadAsync(D.response).then(G=>{G.file("manifest.json").async("string").then(U=>{const W=JSON.parse(U);if(!("animations"in W))throw new Error("Manifest not found");if(W.animations.length===0)throw new Error("No animations listed in the manifest");const q=W.animations[0];G.file("animations/".concat(q.id,".json")).async("string").then(Y=>{const J=JSON.parse(Y);"assets"in J&&Promise.all(J.assets.map(Z=>{if(Z.p&&G.file("images/".concat(Z.p))!=null)return new Promise(K=>{const te=Z.p.split(".").pop();G.file("images/".concat(Z.p)).async("base64").then(Q=>{Z.p=te==="svg"||te==="svg+xml"?"data:image/svg+xml;base64,"+Q:"data:;base64,"+Q,Z.e=1,K()})})})).then(()=>{R(J)})})})}).catch(G=>{F(G)})}})}(function(B){B.Loading="loading",B.Playing="playing",B.Paused="paused",B.Stopped="stopped",B.Frozen="frozen",B.Error="error"})(PlayerState||(PlayerState={})),function(B){B.Normal="normal",B.Bounce="bounce"}(PlayMode||(PlayMode={})),function(B){B.Load="load",B.Error="error",B.Ready="ready",B.Play="play",B.Pause="pause",B.Stop="stop",B.Freeze="freeze",B.Loop="loop",B.Complete="complete",B.Frame="frame"}(PlayerEvents||(PlayerEvents={}));let DotLottiePlayer=class extends s$4{constructor(){super(...arguments),this.mode=PlayMode.Normal,this.autoplay=!1,this.background="transparent",this.controls=!1,this.direction=1,this.hover=!1,this.loop=!1,this.renderer="svg",this.speed=1,this.currentState=PlayerState.Loading,this.intermission=1,this._counter=0}_onVisibilityChange(){document.hidden&&this.currentState===PlayerState.Playing?this.freeze():this.currentState===PlayerState.Frozen&&this.play()}_handleSeekChange(B){if(!this._lottie||isNaN(B.target.value))return;const R=B.target.value/100*this._lottie.totalFrames;this.seek(R)}async load(B){if(!this.shadowRoot)return;const R={container:this.container,loop:!1,autoplay:!1,renderer:this.renderer,rendererSettings:{scaleMode:"noScale",clearCanvas:!1,progressiveLoad:!0,hideOnTransparent:!0}};try{const F=await fetchPath(B);this._lottie&&this._lottie.destroy(),this._lottie=lottie_svg.loadAnimation(Object.assign(Object.assign({},R),{animationData:F}))}catch{return this.currentState=PlayerState.Error,void this.dispatchEvent(new CustomEvent(PlayerEvents.Error))}this._lottie&&(this._lottie.addEventListener("enterFrame",()=>{this.seeker=this._lottie.currentFrame/this._lottie.totalFrames*100,this.dispatchEvent(new CustomEvent(PlayerEvents.Frame,{detail:{frame:this._lottie.currentFrame,seeker:this.seeker}}))}),this._lottie.addEventListener("complete",()=>{this.currentState===PlayerState.Playing?!this.loop||this.count&&this._counter>=this.count?this.dispatchEvent(new CustomEvent(PlayerEvents.Complete)):this.mode===PlayMode.Bounce?(this.count&&(this._counter+=.5),setTimeout(()=>{this.dispatchEvent(new CustomEvent(PlayerEvents.Loop)),this.currentState===PlayerState.Playing&&(this._lottie.setDirection(-1*this._lottie.playDirection),this._lottie.play())},this.intermission)):(this.count&&(this._counter+=1),window.setTimeout(()=>{this.dispatchEvent(new CustomEvent(PlayerEvents.Loop)),this.currentState===PlayerState.Playing&&(this._lottie.stop(),this._lottie.play())},this.intermission)):this.dispatchEvent(new CustomEvent(PlayerEvents.Complete))}),this._lottie.addEventListener("DOMLoaded",()=>{this.dispatchEvent(new CustomEvent(PlayerEvents.Ready))}),this._lottie.addEventListener("data_ready",()=>{this.dispatchEvent(new CustomEvent(PlayerEvents.Load))}),this._lottie.addEventListener("data_failed",()=>{this.currentState=PlayerState.Error,this.dispatchEvent(new CustomEvent(PlayerEvents.Error))}),this.container.addEventListener("mouseenter",()=>{this.hover&&this.currentState!==PlayerState.Playing&&this.play()}),this.container.addEventListener("mouseleave",()=>{this.hover&&this.currentState===PlayerState.Playing&&this.stop()}),this.setSpeed(this.speed),this.setDirection(this.direction),this.autoplay&&this.play())}getLottie(){return this._lottie}play(){this._lottie&&(this._lottie.play(),this.currentState=PlayerState.Playing,this.dispatchEvent(new CustomEvent(PlayerEvents.Play)))}pause(){this._lottie&&(this._lottie.pause(),this.currentState=PlayerState.Paused,this.dispatchEvent(new CustomEvent(PlayerEvents.Pause)))}stop(){this._lottie&&(this._counter=0,this._lottie.stop(),this.currentState=PlayerState.Stopped,this.dispatchEvent(new CustomEvent(PlayerEvents.Stop)))}seek(B){if(!this._lottie)return;const R=B.toString().match(/^([0-9]+)(%?)$/);if(!R)return;const F=R[2]==="%"?this._lottie.totalFrames*Number(R[1])/100:R[1];this.seeker=F,this.currentState===PlayerState.Playing?this._lottie.goToAndPlay(F,!0):(this._lottie.goToAndStop(F,!0),this._lottie.pause())}snapshot(){let B=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];if(!this.shadowRoot)return;const R=this.shadowRoot.querySelector(".animation svg"),F=new XMLSerializer().serializeToString(R);if(B){const D=document.createElement("a");D.href="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(F),D.download="download_"+this.seeker+".svg",document.body.appendChild(D),D.click(),document.body.removeChild(D)}return F}freeze(){this._lottie&&(this._lottie.pause(),this.currentState=PlayerState.Frozen,this.dispatchEvent(new CustomEvent(PlayerEvents.Freeze)))}setSpeed(){let B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this._lottie&&this._lottie.setSpeed(B)}setDirection(B){this._lottie&&this._lottie.setDirection(B)}setLooping(B){this._lottie&&(this.loop=B,this._lottie.loop=B)}togglePlay(){return this.currentState===PlayerState.Playing?this.pause():this.play()}toggleLooping(){this.setLooping(!this.loop)}static get styles(){return styles$g}async firstUpdated(){"IntersectionObserver"in window&&(this._io=new IntersectionObserver(B=>{B[0].isIntersecting?this.currentState===PlayerState.Frozen&&this.play():this.currentState===PlayerState.Playing&&this.freeze()}),this._io.observe(this.container)),document.hidden!==void 0&&document.addEventListener("visibilitychange",()=>this._onVisibilityChange()),this.src&&await this.load(this.src)}disconnectedCallback(){this._io&&(this._io.disconnect(),this._io=void 0),document.removeEventListener("visibilitychange",()=>this._onVisibilityChange())}renderControls(){const B=this.currentState===PlayerState.Playing,R=this.currentState===PlayerState.Paused,F=this.currentState===PlayerState.Stopped;return $(_templateObject||(_templateObject=_taggedTemplateLiteral([`
`])),this.togglePlay,B||R?"active":"",$(B?_templateObject2||(_templateObject2=_taggedTemplateLiteral([` `])):_templateObject3||(_templateObject3=_taggedTemplateLiteral([` `]))),this.stop,F?"active":"",this.seeker,this._handleSeekChange,()=>{this._prevState=this.currentState,this.freeze()},()=>{this._prevState===PlayerState.Playing&&this.play()},this.seeker,this.toggleLooping,this.loop?"active":"")}render(){const B=this.controls?"main controls":"main",R=this.controls?"animation controls":"animation";return $(_templateObject4||(_templateObject4=_taggedTemplateLiteral([` `])),B,R,this.background,this.currentState===PlayerState.Error?$(_templateObject5||(_templateObject5=_taggedTemplateLiteral([`
\u26A0\uFE0F
`]))):void 0,this.controls?this.renderControls():void 0)}};__decorate([i$4(".animation")],DotLottiePlayer.prototype,"container",void 0),__decorate([e$5()],DotLottiePlayer.prototype,"mode",void 0),__decorate([e$5({type:Boolean})],DotLottiePlayer.prototype,"autoplay",void 0),__decorate([e$5({type:String,reflect:!0})],DotLottiePlayer.prototype,"background",void 0),__decorate([e$5({type:Boolean})],DotLottiePlayer.prototype,"controls",void 0),__decorate([e$5({type:Number})],DotLottiePlayer.prototype,"count",void 0),__decorate([e$5({type:Number})],DotLottiePlayer.prototype,"direction",void 0),__decorate([e$5({type:Boolean})],DotLottiePlayer.prototype,"hover",void 0),__decorate([e$5({type:Boolean,reflect:!0})],DotLottiePlayer.prototype,"loop",void 0),__decorate([e$5({type:String})],DotLottiePlayer.prototype,"renderer",void 0),__decorate([e$5({type:Number})],DotLottiePlayer.prototype,"speed",void 0),__decorate([e$5({type:String})],DotLottiePlayer.prototype,"src",void 0),__decorate([e$5({type:String})],DotLottiePlayer.prototype,"currentState",void 0),__decorate([e$5()],DotLottiePlayer.prototype,"seeker",void 0),__decorate([e$5()],DotLottiePlayer.prototype,"intermission",void 0),DotLottiePlayer=__decorate([n$1("dotlottie-player")],DotLottiePlayer);var accompaniment="/orchestra-music-score/assets/accompaniment.b83f0e6e.svg",__glob_2_0=Object.freeze(Object.defineProperty({__proto__:null,default:accompaniment},Symbol.toStringTag,{value:"Module"})),back$1="/orchestra-music-score/assets/back.0e8784e6.svg",__glob_2_1=Object.freeze(Object.defineProperty({__proto__:null,default:back$1},Symbol.toStringTag,{value:"Module"})),backgroundClose="/orchestra-music-score/assets/background-close.292949ba.svg",__glob_2_2=Object.freeze(Object.defineProperty({__proto__:null,default:backgroundClose},Symbol.toStringTag,{value:"Module"})),background$1="/orchestra-music-score/assets/background.66e3a94f.svg",__glob_2_3=Object.freeze(Object.defineProperty({__proto__:null,default:background$1},Symbol.toStringTag,{value:"Module"})),camera="/orchestra-music-score/assets/camera.6735691d.svg",__glob_2_4=Object.freeze(Object.defineProperty({__proto__:null,default:camera},Symbol.toStringTag,{value:"Module"})),equilibrium="/orchestra-music-score/assets/equilibrium.f9043cf5.svg",__glob_2_5=Object.freeze(Object.defineProperty({__proto__:null,default:equilibrium},Symbol.toStringTag,{value:"Module"})),evaluating$1="/orchestra-music-score/assets/evaluating.9eb5cfac.svg",__glob_2_6=Object.freeze(Object.defineProperty({__proto__:null,default:evaluating$1},Symbol.toStringTag,{value:"Module"})),fingeringOff="/orchestra-music-score/assets/fingeringOff.b63542d4.svg",__glob_2_7=Object.freeze(Object.defineProperty({__proto__:null,default:fingeringOff},Symbol.toStringTag,{value:"Module"})),fingeringOn="/orchestra-music-score/assets/fingeringOn.32644085.svg",__glob_2_8=Object.freeze(Object.defineProperty({__proto__:null,default:fingeringOn},Symbol.toStringTag,{value:"Module"})),gudingActive="/orchestra-music-score/assets/guding-active.ffb42216.svg",__glob_2_9=Object.freeze(Object.defineProperty({__proto__:null,default:gudingActive},Symbol.toStringTag,{value:"Module"})),guding="/orchestra-music-score/assets/guding.a3ea7233.svg",__glob_2_10=Object.freeze(Object.defineProperty({__proto__:null,default:guding},Symbol.toStringTag,{value:"Module"})),iconBack$1="/orchestra-music-score/assets/icon-back.f7c9eb40.svg",__glob_2_11=Object.freeze(Object.defineProperty({__proto__:null,default:iconBack$1},Symbol.toStringTag,{value:"Module"})),iconStaffActive="/orchestra-music-score/assets/icon-staff-active.c1d6b682.svg",__glob_2_12=Object.freeze(Object.defineProperty({__proto__:null,default:iconStaffActive},Symbol.toStringTag,{value:"Module"})),iconStaff="/orchestra-music-score/assets/icon-staff.5a2b7c94.svg",__glob_2_13=Object.freeze(Object.defineProperty({__proto__:null,default:iconStaff},Symbol.toStringTag,{value:"Module"})),iconZhuanpu="/orchestra-music-score/assets/icon-zhuanpu.1a6e0bcb.svg",__glob_2_14=Object.freeze(Object.defineProperty({__proto__:null,default:iconZhuanpu},Symbol.toStringTag,{value:"Module"})),jia="/orchestra-music-score/assets/jia.362e133d.svg",__glob_2_15=Object.freeze(Object.defineProperty({__proto__:null,default:jia},Symbol.toStringTag,{value:"Module"})),jian="/orchestra-music-score/assets/jian.ce0820a8.svg",__glob_2_16=Object.freeze(Object.defineProperty({__proto__:null,default:jian},Symbol.toStringTag,{value:"Module"})),jianpu="/orchestra-music-score/assets/jianpu.70310e35.svg",__glob_2_17=Object.freeze(Object.defineProperty({__proto__:null,default:jianpu},Symbol.toStringTag,{value:"Module"})),model1$1="/orchestra-music-score/assets/model-1.5cdc3b59.svg",__glob_2_18=Object.freeze(Object.defineProperty({__proto__:null,default:model1$1},Symbol.toStringTag,{value:"Module"})),model2$1="/orchestra-music-score/assets/model-2.aedda1e7.svg",__glob_2_19=Object.freeze(Object.defineProperty({__proto__:null,default:model2$1},Symbol.toStringTag,{value:"Module"})),model3$1="/orchestra-music-score/assets/model-3.f6cc2e96.svg",__glob_2_20=Object.freeze(Object.defineProperty({__proto__:null,default:model3$1},Symbol.toStringTag,{value:"Module"})),modelType$1="/orchestra-music-score/assets/modelType.7dff5016.svg",__glob_2_21=Object.freeze(Object.defineProperty({__proto__:null,default:modelType$1},Symbol.toStringTag,{value:"Module"})),modelType1="/orchestra-music-score/assets/modelType1.e616d5d5.svg",__glob_2_22=Object.freeze(Object.defineProperty({__proto__:null,default:modelType1},Symbol.toStringTag,{value:"Module"})),modelType2="/orchestra-music-score/assets/modelType2.4364a0ba.svg",__glob_2_23=Object.freeze(Object.defineProperty({__proto__:null,default:modelType2},Symbol.toStringTag,{value:"Module"})),musicList="/orchestra-music-score/assets/music-list.8ad9f128.svg",__glob_2_24=Object.freeze(Object.defineProperty({__proto__:null,default:musicList},Symbol.toStringTag,{value:"Module"})),musicList1="/orchestra-music-score/assets/music-list1.16180b5c.svg",__glob_2_25=Object.freeze(Object.defineProperty({__proto__:null,default:musicList1},Symbol.toStringTag,{value:"Module"})),music="/orchestra-music-score/assets/music.855d26de.svg",__glob_2_26=Object.freeze(Object.defineProperty({__proto__:null,default:music},Symbol.toStringTag,{value:"Module"})),part="/orchestra-music-score/assets/part.7184ecd4.svg",__glob_2_27=Object.freeze(Object.defineProperty({__proto__:null,default:part},Symbol.toStringTag,{value:"Module"})),pause$1="/orchestra-music-score/assets/pause.1f3a158e.svg",__glob_2_28=Object.freeze(Object.defineProperty({__proto__:null,default:pause$1},Symbol.toStringTag,{value:"Module"})),play$1="/orchestra-music-score/assets/play.4cb46bbb.svg",__glob_2_29=Object.freeze(Object.defineProperty({__proto__:null,default:play$1},Symbol.toStringTag,{value:"Module"})),practice="/orchestra-music-score/assets/practice.a1fec217.svg",__glob_2_30=Object.freeze(Object.defineProperty({__proto__:null,default:practice},Symbol.toStringTag,{value:"Module"})),practise="/orchestra-music-score/assets/practise.cdd135b3.svg",__glob_2_31=Object.freeze(Object.defineProperty({__proto__:null,default:practise},Symbol.toStringTag,{value:"Module"})),record="/orchestra-music-score/assets/record.214e6a6d.svg",__glob_2_32=Object.freeze(Object.defineProperty({__proto__:null,default:record},Symbol.toStringTag,{value:"Module"})),resetShengyin="/orchestra-music-score/assets/reset-shengyin.af688c9a.svg",__glob_2_33=Object.freeze(Object.defineProperty({__proto__:null,default:resetShengyin},Symbol.toStringTag,{value:"Module"})),reset="/orchestra-music-score/assets/reset.8f0314cd.svg",__glob_2_34=Object.freeze(Object.defineProperty({__proto__:null,default:reset},Symbol.toStringTag,{value:"Module"})),restore="/orchestra-music-score/assets/restore.3a4a6db3.svg",__glob_2_35=Object.freeze(Object.defineProperty({__proto__:null,default:restore},Symbol.toStringTag,{value:"Module"})),section$1="/orchestra-music-score/assets/section.f9765b45.svg",__glob_2_36=Object.freeze(Object.defineProperty({__proto__:null,default:section$1},Symbol.toStringTag,{value:"Module"})),section1="/orchestra-music-score/assets/section1.8f6086dd.svg",__glob_2_37=Object.freeze(Object.defineProperty({__proto__:null,default:section1},Symbol.toStringTag,{value:"Module"})),section2="/orchestra-music-score/assets/section2.7715197f.svg",__glob_2_38=Object.freeze(Object.defineProperty({__proto__:null,default:section2},Symbol.toStringTag,{value:"Module"})),setting$1="/orchestra-music-score/assets/setting.d2c48eac.svg",__glob_2_39=Object.freeze(Object.defineProperty({__proto__:null,default:setting$1},Symbol.toStringTag,{value:"Module"})),shuodiaoActive="/orchestra-music-score/assets/shuodiao-active.6b157b93.svg",__glob_2_40=Object.freeze(Object.defineProperty({__proto__:null,default:shuodiaoActive},Symbol.toStringTag,{value:"Module"})),shuodiao="/orchestra-music-score/assets/shuodiao.da855d30.svg",__glob_2_41=Object.freeze(Object.defineProperty({__proto__:null,default:shuodiao},Symbol.toStringTag,{value:"Module"})),speed$2="/orchestra-music-score/assets/speed.256b84ef.svg",__glob_2_42=Object.freeze(Object.defineProperty({__proto__:null,default:speed$2},Symbol.toStringTag,{value:"Module"})),staff$1="/orchestra-music-score/assets/staff.f226ff22.svg",__glob_2_43=Object.freeze(Object.defineProperty({__proto__:null,default:staff$1},Symbol.toStringTag,{value:"Module"})),start$3="/orchestra-music-score/assets/start.7b27072b.svg",__glob_2_44=Object.freeze(Object.defineProperty({__proto__:null,default:start$3},Symbol.toStringTag,{value:"Module"})),stop="/orchestra-music-score/assets/stop.e36ceb44.svg",__glob_2_45=Object.freeze(Object.defineProperty({__proto__:null,default:stop},Symbol.toStringTag,{value:"Module"})),taskBg="/orchestra-music-score/assets/task-bg.9304b5bf.svg",__glob_2_46=Object.freeze(Object.defineProperty({__proto__:null,default:taskBg},Symbol.toStringTag,{value:"Module"})),tuning="/orchestra-music-score/assets/tuning.4b86afaf.svg",__glob_2_47=Object.freeze(Object.defineProperty({__proto__:null,default:tuning},Symbol.toStringTag,{value:"Module"})),volPlus="/orchestra-music-score/assets/vol-plus.8301fc70.svg",__glob_2_48=Object.freeze(Object.defineProperty({__proto__:null,default:volPlus},Symbol.toStringTag,{value:"Module"})),vol="/orchestra-music-score/assets/vol.4b3b0407.svg",__glob_2_49=Object.freeze(Object.defineProperty({__proto__:null,default:vol},Symbol.toStringTag,{value:"Module"})),____="/orchestra-music-score/assets/\u8BC4\u6D4B\u8BB0\u5F55.5949e468.svg",__glob_2_50=Object.freeze(Object.defineProperty({__proto__:null,default:____},Symbol.toStringTag,{value:"Module"}));const getAssetsHomeFile=B=>{var D;const R=`./icons/${B}.svg`;return(D={"./icons/accompaniment.svg":__glob_2_0,"./icons/back.svg":__glob_2_1,"./icons/background-close.svg":__glob_2_2,"./icons/background.svg":__glob_2_3,"./icons/camera.svg":__glob_2_4,"./icons/equilibrium.svg":__glob_2_5,"./icons/evaluating.svg":__glob_2_6,"./icons/fingeringOff.svg":__glob_2_7,"./icons/fingeringOn.svg":__glob_2_8,"./icons/guding-active.svg":__glob_2_9,"./icons/guding.svg":__glob_2_10,"./icons/icon-back.svg":__glob_2_11,"./icons/icon-staff-active.svg":__glob_2_12,"./icons/icon-staff.svg":__glob_2_13,"./icons/icon-zhuanpu.svg":__glob_2_14,"./icons/jia.svg":__glob_2_15,"./icons/jian.svg":__glob_2_16,"./icons/jianpu.svg":__glob_2_17,"./icons/model-1.svg":__glob_2_18,"./icons/model-2.svg":__glob_2_19,"./icons/model-3.svg":__glob_2_20,"./icons/modelType.svg":__glob_2_21,"./icons/modelType1.svg":__glob_2_22,"./icons/modelType2.svg":__glob_2_23,"./icons/music-list.svg":__glob_2_24,"./icons/music-list1.svg":__glob_2_25,"./icons/music.svg":__glob_2_26,"./icons/part.svg":__glob_2_27,"./icons/pause.svg":__glob_2_28,"./icons/play.svg":__glob_2_29,"./icons/practice.svg":__glob_2_30,"./icons/practise.svg":__glob_2_31,"./icons/record.svg":__glob_2_32,"./icons/reset-shengyin.svg":__glob_2_33,"./icons/reset.svg":__glob_2_34,"./icons/restore.svg":__glob_2_35,"./icons/section.svg":__glob_2_36,"./icons/section1.svg":__glob_2_37,"./icons/section2.svg":__glob_2_38,"./icons/setting.svg":__glob_2_39,"./icons/shuodiao-active.svg":__glob_2_40,"./icons/shuodiao.svg":__glob_2_41,"./icons/speed.svg":__glob_2_42,"./icons/staff.svg":__glob_2_43,"./icons/start.svg":__glob_2_44,"./icons/stop.svg":__glob_2_45,"./icons/task-bg.svg":__glob_2_46,"./icons/tuning.svg":__glob_2_47,"./icons/vol-plus.svg":__glob_2_48,"./icons/vol.svg":__glob_2_49,"./icons/\u8BC4\u6D4B\u8BB0\u5F55.svg":__glob_2_50}[R])==null?void 0:D.default};var ButtonIcon=defineComponent({name:"ButtonIcon",props:{name:{type:String}},setup(B){return()=>B.name?createVNode("img",{src:getAssetsHomeFile(B.name)},null):null}}),classnames={exports:{}};/*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(B){(function(){var R={}.hasOwnProperty;function F(){for(var D=[],G=0;G{}},updateSpeed:{type:Function,default:B=>{}},mode:{type:String},changeMode:{type:Function,default:B=>{}},lib:{type:Object}},setup(B){var Y;const{lib:R}=toRefs(B);state$1.speed=(Y=R.value)==null?void 0:Y.speed;const F=()=>{state$1.showHint=!0},D=()=>{state$1.showHint=!1},G=J=>{state$1.speed=J,B.changed(state$1.speed)},U=J=>{state$1.speed=J,B.updateSpeed(state$1.speed)},W=()=>{state$1.speed=Math.max(state$1.speed-1,45),B.changed(state$1.speed)},q=()=>{state$1.speed=Math.min(state$1.speed+1,270),B.changed(state$1.speed)};return()=>createVNode("div",{class:styles$f["speed-change"]},[createVNode("div",{class:styles$f.speed},[createVNode("div",null,[createVNode(Button,{color:"#01C1B5",icon:iconPlus,type:"primary",size:"mini",round:!0,disabled:state$1.speed==270,onClick:q},null),createVNode(Slider,{class:styles$f.slider,max:270,min:45,barHeight:"3px",buttonSize:"18px",modelValue:315-state$1.speed,"onUpdate:modelValue":J=>U(315-J),step:"1",vertical:!0,activeColor:"#ebedf0",onChange:J=>G(315-J),onDragStart:F,onDragEnd:D},{button:()=>createVNode("div",{class:styles$f["custom-button"]},[createVNode("span",null,[state$1.speed]),createVNode("div",{class:classNames(styles$f.title)},[createVNode("span",{class:styles$f.strong},[state$1.speed])])])}),createVNode(Button,{class:styles$f.min,color:"#01C1B5",icon:iconMinus,type:"primary",size:"mini",round:!0,disabled:state$1.speed==45,onClick:W},null),createVNode(Button,{class:styles$f.reset,color:"#01C1B5",icon:iconresetMinus,type:"primary",size:"mini",round:!0,onClick:()=>{var J;state$2.activeDetail&&G((J=state$2.activeDetail)==null?void 0:J.originalSpeed)}},null)])])])},methods:{resetSpeed(){var B,R;state$1.speed=(B=this.lib)==null?void 0:B.speed,this.changed((R=this.lib)==null?void 0:R.speed)},refUpdateSpeed(B){state$1.speed=B,this.updateSpeed(state$1.speed)}}});const close="_close_1xean_1",bg$2="_bg_1xean_12";var styles$e={close,bg:bg$2},iconColse="/orchestra-music-score/assets/close.c15efc4b.svg",Popups=defineComponent({name:"ColexiuPopup",props:{data:{type:Object,default:()=>null},zIndex:{type:Number,default:void 0},closeable:{type:Boolean,default:!0},overlay:{type:Boolean,default:!0},style:{type:Object}},setup(B,{slots:R,expose:F}){const D=ref(!1),G=ref(!1),U=()=>{D.value=!0,G.value=!0},W=()=>{D.value=!1},q=()=>{G.value=!1};return F({show:D,close:()=>{D.value=!1},onShow:U,onClose:W,onClosed:q}),()=>createVNode(Popup,{show:D.value,zIndex:B.zIndex,onClose:W,onClosed:q,teleport:"body",onClickOverlay:W,overlay:B.overlay,round:!0,closeable:!1,style:{...B.style},class:styles$e.bg,lockScroll:!0},{default:()=>[G.value&&R.default&&R.default(B),B.closeable&&createVNode(Icon,{class:styles$e.close,name:iconColse,onClick:W},null)]})}});const title$5="_title_184ej_1",wrap$5="_wrap_184ej_8",item="_item_184ej_14",label$1="_label_184ej_18";var styles$d={title:title$5,wrap:wrap$5,item,label:label$1};const sliderClass={"active-color":"#FFB871","inactive-color":"#EAEAEA","button-size":"14"};var Equalizer=defineComponent({name:"ColexiuEqualizer",setup(){const B=ref(10);return()=>createVNode("div",{class:"containerPopups"},[createVNode("div",{class:styles$d.title},[createTextVNode("\u5747\u8861\u5668")]),createVNode("div",{class:styles$d.wrap},[createVNode("div",{class:styles$d.item},[createVNode("span",{class:styles$d.label},[createTextVNode("\u8282\u62CD\u5668")]),createVNode(Slider,mergeProps({modelValue:B.value,"onUpdate:modelValue":R=>B.value=R},sliderClass),null)]),createVNode(Divider,null,null),createVNode("div",{class:styles$d.item},[createVNode("span",{class:styles$d.label},[createTextVNode("\u4F34\u594F")]),createVNode(Slider,mergeProps({modelValue:B.value,"onUpdate:modelValue":R=>B.value=R},sliderClass),null)]),createVNode(Divider,null,null),createVNode("div",{class:styles$d.item},[createVNode("span",{class:styles$d.label},[createTextVNode("\u957F\u7B1B")]),createVNode(Slider,mergeProps({modelValue:B.value,"onUpdate:modelValue":R=>B.value=R},sliderClass),null)]),createVNode(Divider,null,null),createVNode("div",{class:styles$d.item},[createVNode("span",{class:styles$d.label},[createTextVNode("\u8428\u514B\u65AF")]),createVNode(Slider,mergeProps({modelValue:B.value,"onUpdate:modelValue":R=>B.value=R},sliderClass),null)]),createVNode(Divider,null,null),createVNode("div",{class:styles$d.item},[createVNode("span",{class:styles$d.label},[createTextVNode("\u5355\u7C27\u7BA1")]),createVNode(Slider,mergeProps({modelValue:B.value,"onUpdate:modelValue":R=>B.value=R},sliderClass),null)]),createVNode(Divider,null,null),createVNode("div",{class:styles$d.item},[createVNode("span",{class:styles$d.label},[createTextVNode("\u957F\u53F7")]),createVNode(Slider,mergeProps({modelValue:B.value,"onUpdate:modelValue":R=>B.value=R},sliderClass),null)])])])}});const container$3="_container_la5im_1",title$4="_title_la5im_5",practiseBtn="_practiseBtn_la5im_12",wrap$4="_wrap_la5im_21";var styles$c={container:container$3,title:title$4,practiseBtn,wrap:wrap$4};function _isSlot$2(B){return typeof B=="function"||Object.prototype.toString.call(B)==="[object Object]"&&!isVNode(B)}var Part=defineComponent({name:"ColexiuPart",setup(){const B=useOriginSearch(),R=Number(B["part-index"])||0,F=ref(state$2.partListNames[R]),D=()=>{const G=state$2.partListNames.indexOf(F.value);F.value=state$2.partListNames[G];const U=queryString.stringify({...B,"part-index":G});location.search=U};return()=>{let G;return createVNode("div",{class:["containerPopups",styles$c.container]},[createVNode("div",{class:styles$c.title},[createTextVNode("\u58F0\u90E8\u9009\u62E9")]),createVNode("div",{class:styles$c.wrap},[createVNode(RadioGroup,{modelValue:F.value,"onUpdate:modelValue":U=>F.value=U},_isSlot$2(G=state$2.partListNames.map(U=>createVNode(Radio,{name:U},_isSlot$2(U)?U:{default:()=>[U]})))?G:{default:()=>[G]})]),createVNode("div",{style:{display:"flex",justifyContent:"center"}},[createVNode(Button,{class:styles$c.practiseBtn,onClick:D},null)])])}}});const partPopup=ref(null),equalizerPopup=ref(null);var FloatWraper=defineComponent({name:"ColuxiuFloatWraper",setup(){return()=>createVNode(Fragment,null,[createVNode(Popups,{ref:partPopup,style:{borderRadius:"8px"}},{default:()=>[createVNode(Part,null,null)]}),createVNode(Popups,{ref:equalizerPopup,style:{borderRadius:"8px"}},{default:()=>[createVNode(Equalizer,null,null)]})])}}),iconTitle$1="/orchestra-music-score/assets/title.26d31e69.svg",iconCancel="/orchestra-music-score/assets/cancel.79fe3f5e.svg",iconConfirm="/orchestra-music-score/assets/confirm.8050789e.svg";const permissionPopup=reactive({active:"earphone",show:!1});var InfoIcon="/orchestra-music-score/assets/info.df4a2cca.svg",iconTv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAAXNSR0IArs4c6QAAB+ZJREFUWEftmHtsHEcdx7+/3T3nzja2UwmqChAxUAmaIhW1EVUQIU7dRLiNktRxKPSRxsZ2apRHjcmjoeRawjNJbTfFrh0gJLZJaycN0LqRm6hNCgk0lUAq/QdC4yBo1fJIHNfnx93O/NDs7u3jfHt2EG5VKSud7m73NzOf+c73NzszhPfZRe8zXlwBnukRu6Lwe6Ywv/jgDSBUg6kc4I+CuZB9NAQCw7vjDZX65Y9M/7PvB+PSFap4Ggbx3wAMgPWf0KIdf87W+UmW4BfjUcjxPWBUM6BZLTCcLweEFG4Qy6rIeWx9OTUH4tx6nOfpfpEbnmY0wWiFHt1CZXHTDx4A5t4HYlySdxzE8yfrZBcLux9mhcuKz+wA4VlcGFxOq/pEuv4g8LFNP2Mp12QfiqAFMmMyLRLaASIwBy2Ty/dE+CEt3rVlEjAf/cY8Jn4ZUDU6amr0GkBbkZc4QWVtIzOZUHxsczGEWALi77PEx11AQhJSu44qdr7ucxrAzz3QyUCtL/BVRCc+P9OgmSLwc+s+CDLOMGOOpyp/lypavhUAlv0bz4P5Y26Qpi2hiubnZ1LVsLr5aOPdLESX+5zojHZby+dcYI7HNb7xwgSDDeemoDcnYlTfmXpPgA9vvEZGxJsWC1lp+5a2dM81HvBAU4EcH3c9SkBCW/Z4YRr21R6ebQLtkvFJla4qZ6QABNszmRCABCAZ48z40eI6+nV/B39GprBDauhb1kDd2TretZubpMBNQuDB6q10Lh3DA00F7OOBj8eePlXA6OiIm7uEhL68zQX+4y94o2Q0S2lBeR/1XwGn70urA+eX1FNpfxsfEhKVEkgJDZ+qbPCAVJs9u7nMlHhB1ceMg9Wb6at+YDk6GhRwhc1jAx+4p0AWFo5Y0lkXJfTKdhf4Twf5pgmJl6REzAX2w0tbbefZoS+tpar+dt5uCsQtIGDfHeuo2q9y105+STK+oMqBsL16Ez3iAiueggIbWFmC4fJ4wPkxp0eWZxL6yk4XWJX7fTcXRQx8OJm0AK4XAr2OOq+QxOokAIOQWvgPnKM4yWfbeLYpMSgliiXDlAKfXtVIf7XU3cnlAjhmdVDi0jijtGErXQwAxxwe+03h8njA0ah/nk3oq/YGgP3qnNrH8wTjjNUgcHJRDS3M5tEje/gRyXjIUf7AlzfSahXXtYtPScZ8y2ISD9dspbi/vDXiITwe8Kw8D1gNwZ0/DQU+sY/nkQJWnqUcwM1cInUMCokSZpgsMdckzJECA04nhmgMpWviNJQJLPJsHnuS8Hg84EhkxLecSehf2ZcTGNJWmBknb6nNrrBqsK+VlY+3W51j9AjGJyTjZqezAe8GLBGJuJMAKYs6PC6w0HWfJThh3LU/JzA7wFLi5K114cC9HVzMYxgUArNV/4QEOepeTDFK67fQpUw7KUsIXRtR2egsdhL6XT8PzhKCKDCN6PccyAkshadwLmAF8+Sj/G3BeNg/wzDhoepNtCOb9y0Pa+RTGAn9bpvHUxgcSDrj3u7cwCbOOC+Ok4tzKKwa6X6MiyhlefkqB/rCyBhK18dpOAxYhPB4wFJ6HiZKGKt7QoEH9nKpDpxzPHx4ST2tzNaw/173bt4mJHY4M8u2mk30vbAyliUsHvdKGPfZPB6waToTtT3vGWsOhgKrgON7uU5KzDeB71TUk7X0y3V11HEkei1+oJJtzhg2l8UpsJPInCVMM2XPEgqRPB4POJX0eYYSRs2TOYFD1XlhW6VkeZtGOI/8WS10czzrsOfqnFLYTCUdYEfAmqd8CvdW6WKYJpih21nJpl6MqH9rMpWCVqnjm1uYeUM6lkB/wXhyES1tfmM65dMx3L7iQ6ZhvO3Vg38atX1Xu5ZQP8zOlX9nxkfcijUsiNQe+s10G+Kjja0MrLfirfd/ekfKZ0mg7HKgzc7KSgYd8trmP0TqDt+YAXzHfpa41xZYbcfptP62XkbxPrVMyHnxMxtamRzYzEgb/CwhWUZLn5hSaf5xVaGpmy+DcZ39mrMwd0XWHv5mAJjbVnzRBJ9w27NXSb81DGqkuqdfCSMWv2xoJdD6bNtK+61qPyHGWUrJMlqVHVppZLavWABwM4DPuqNEavVKN8y6/8hrAWD1J9W27AgYy71lpruvTwDwTTP2QQIVFc2iWH7JVCPgOkSICXnxP0MwRdA2ajw1+gAz56dH2PUvUYfx9V+t9fnZ55SO8mIzGTvFwNypziW0wkJQvl2/5SIfdfipkEpnAR66aC3TJpVN+945qAHRaePfw7dQ/MR4VmCr4eblJaZmdjH49swhSENpBQVALOYe71zWYYnqmhCQly4FoANA9tFFT0Tk11Fj35h/BCcdVaUfploqbiXC15i5nIGrLA8oo+Xng6IK1juOClgiKPXk86z0cykgh4ddaM0+p/mXJHo+QtROG/pPZ7NaKLA/mHcuLkAkWigL85tYQ1PgmQ/QTWo3IOzA0O4HgV/XJybKMfHOGOToMDX+LqDm/wxsWYVBYm/VEIOLfAmR9dhJbc2zH0dNNg8R3WnU9j01VeKGejisIMcXGubVs98BELWzLKe0vkzOHUeM+4yGI/v/78CqwuTjt7eB6f7Myv2+mq6FnRR4azSVnFvcOHBhRoC5t0pPvTG6jkguAFHe9BvJOPlktRWk8yldezS27pnB6dYTlueXU/5dj53WLPGuU+Vo8ArwTI/GfwFJHAtpqisYAwAAAABJRU5ErkJggg==",iconYijian="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAAXNSR0IArs4c6QAABThJREFUWEftmH9oVWUYx7/PuXebGjYUocQgWGE/IIIiKTKoRLNs4syZMjV/NOdm2qSa2gRXlOZCJKekA39srqWbWc4fKzJEDf9RsSQLpDL6o8CYmT+7u+d9vvGee852tXT3znNZgoeN97znfe97P+d7nvt9nvcIbrBDbjBe3ATO9BO7qfCVCnNf5UwY8zjIwzJsWc31PoGMKsw9FWVUrAYJgBBiGyKR6TJ82V/dBc8YMD8vf4h0DoLMSQBbZtpf+c8Q86KMWnW4O9AZAWbTzFz07nVEybsC0EBlEBAwJsAbUvBh2iGSEWD9tHQriRdsGNg/DzZQOemaQ31OJqxvTUfp0IHdpuLJAOr9mAW9MKDP64MHNyEyKlq0cXePAnPlszk6YOASUMsJOh0KJ6sNLyx+cMR5RKZsutAjwFZIsVL6BzdNGm6UdSAHJlS2UWGdglbvS1HKEHl5y3fpwNq5oYUEv1rYCPA4nn5vSQDOtRMHmIhZR3J0chw7YEmkZFtturChAXNPxUtUbPTiVmQXTHyKjFxxOgAyawpmqepyEH1EsDlatn1id2BDAebOeXmIOkdJ3tphYcAvEnHGyTPLj3SESE3+vS713Sh0msxtPdsjwGwqjLDPoAMAH+sA8+3LAf9Wg/LImJq13YX7r89dVwxzx9zFSlb9y2P9rJZQHPVOllsq+bUXwwDvNjBb5jyqqgdARpNTbweUXz9Y33BEPpBxa8t7DJjbp/elm/0NwbxOWD+j+bJ2GhxOOVnRB2TsmlM9Bmy2Fm+AcmoCqjOLBV6b5MaIODJGJmzYHgZst1yCm2cUGmpTIOTlaTfIGn45KbI+Mql+RliwaQOzoegOlaxvSe2fZGGJAidIvX4rgpOOm/OgzFh/rseAtX5yi5L5V8IlgPzKzCYPwDiCp2Ta5gNhwqatsKkrqqbqayQd8fg6a4TLFAfezypurggbNm1gT8d1hUNVpVbJ+/xY6Kx1rZWJHIvGLg6Rua2x/wWwB91UmO22mTcFXECgcwsExqLgEClrOWbn7a1itHceRriKfqqQuELaDZy4C3EVEjNwXBeiRNvJC9hRVSVuVzeZcuLgnvmzoTwrI6o3BYtydcF9BqaWyqGeHwvmZ83ZWR2MH2nglrhifNwArgHabauA7QfX4gq4LhAn6koWytTwgHeV76fqEyD2x2HKckavPu6pTYiufL5EqcOjZ3YXShU0+NJDH7HNddE/APQgk4A7oBPXf5pVKXeHAswvXr+F58+dJpHt17VxUFc4sfa3r7VjONTAd9pdVFp1PWgf1oO2qnb2jeuivHSRrAoHuHHqSEO0JqyLgHp1b5MDLZfJDb9f60sO1nGQa5AbM6Aq6Mahl+y5AS+6oCNe/3TJAknpXUVKMWw2Fi1TNRXe9oY4AeorWcXNX3alRibGUwJ214xtATmM5NLogKxqGd/cngmYVNZMCdjU5M9rV3zS+9Udv6ayaCbnpAT89Tr27dML41WR69rkZq1IISZwCb9vQV0DsTZh56kCVL9vEhte418Pxm2fQJuJoX52lZzv6mZTAj76MfcaxZMWQAkYv73qeRfjyZ+3a5pEGfJZWaUUhAPcyDNGkWsXDqC7gr3aXAtrjSYY99rE/4nZi+SeUICPNLKciqWG6NWh8tXgfcU8iCvOr/F02kiUli2S5lCAg7qg78PIxm9Ae79EBRy7kGgv3QbiR+DO2+2bFCDvT9Du7wcPBrEP+OP+xLzC78G3ACxenOiL2PBN70gphtNbMrOzbwJnVt8QXwZmGjRY/4YLiX8Az9RfWpuTLy8AAAAASUVORK5CYII=";const setting="_setting_1xoyi_1",sliderWrap="_sliderWrap_1xoyi_44",slider$1="_slider_1xoyi_44",noticebar="_noticebar_1xoyi_67",groupBox="_groupBox_1xoyi_73",btnsbar="_btnsbar_1xoyi_92",btn="_btn_1xoyi_92",iconBtn="_iconBtn_1xoyi_114",radioGroup="_radioGroup_1xoyi_119";var styles$b={setting,sliderWrap,slider:slider$1,noticebar,groupBox,btnsbar,btn,iconBtn,radioGroup};const box$1="_box_a7vlt_1",bg$1="_bg_a7vlt_9",button$3="_button_a7vlt_16",iconSound$2="_iconSound_a7vlt_33",skepBtn$1="_skepBtn_a7vlt_39",wrap$3="_wrap_a7vlt_53",wrapContainer="_wrapContainer_a7vlt_59",top="_top_a7vlt_65",title$3="_title_a7vlt_72",num="_num_a7vlt_82",txt="_txt_a7vlt_86",iconLeft="_iconLeft_a7vlt_89",iconTop="_iconTop_a7vlt_93",evaluatWrap="_evaluatWrap_a7vlt_98",evaluatTitle="_evaluatTitle_a7vlt_129",evaluatIcon="_evaluatIcon_a7vlt_134",fraction="_fraction_a7vlt_140",line="_line_a7vlt_147",tips="_tips_a7vlt_152",btns="_btns_a7vlt_165",btnIcon="_btnIcon_a7vlt_178",rigthBtns="_rigthBtns_a7vlt_183",confirm="_confirm_a7vlt_193",iconTitle="_iconTitle_a7vlt_199",footer="_footer_a7vlt_204",sbtn="_sbtn_a7vlt_233";var styles$a={box:box$1,bg:bg$1,button:button$3,iconSound:iconSound$2,skepBtn:skepBtn$1,wrap:wrap$3,wrapContainer,top,title:title$3,num,txt,iconLeft,iconTop,evaluatWrap,evaluatTitle,evaluatIcon,fraction,line,tips,btns,btnIcon,rigthBtns,confirm,iconTitle,footer,sbtn};const tabs="_tabs_e40bs_1";var styles$9={tabs};const show=ref(!1);var HelperPopup=defineComponent({name:"HelperPopup",setup(){return()=>createVNode(Popup,{show:show.value,position:"right",round:!0,teleport:"body",onClickOverlay:()=>show.value=!1,style:{height:"100vh",width:"40vw",overflow:"hidden"}},{default:()=>[createVNode(Tabs,{class:styles$9.tabs},{default:()=>[createVNode(Tab,{title:"\u6295\u5C4F"},{default:()=>[createVNode("iframe",{src:location.origin+"/student/#/guide"},null)]}),createVNode(Tab,{title:"\u5E2E\u52A9"},{default:()=>[createVNode("iframe",{src:location.origin+"/student/#/helpCenter?platformType=ANALYSIS"},null)]})]})]})}}),raf$1={exports:{}},performanceNow={exports:{}};(function(){var B,R,F,D,G,U;typeof performance!="undefined"&&performance!==null&&performance.now?performanceNow.exports=function(){return performance.now()}:typeof process!="undefined"&&process!==null&&process.hrtime?(performanceNow.exports=function(){return(B()-G)/1e6},R=process.hrtime,B=function(){var W;return W=R(),W[0]*1e9+W[1]},D=B(),U=process.uptime()*1e9,G=D-U):Date.now?(performanceNow.exports=function(){return Date.now()-F},F=Date.now()):(performanceNow.exports=function(){return new Date().getTime()-F},F=new Date().getTime())}).call(commonjsGlobal$1);var now=performanceNow.exports,root=typeof window=="undefined"?commonjsGlobal$1:window,vendors=["moz","webkit"],suffix="AnimationFrame",raf=root["request"+suffix],caf=root["cancel"+suffix]||root["cancelRequest"+suffix];for(var i$1=0;!raf&&i$13&&(this.alpha=q[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var Y=this.r.toString(16),J=this.g.toString(16),Z=this.b.toString(16);return Y.length==1&&(Y="0"+Y),J.length==1&&(J="0"+J),Z.length==1&&(Z="0"+Z),"#"+Y+J+Z},this.getHelpXML=function(){for(var Y=new Array,J=0;J "+se.toRGB()+" -> "+se.toHex());ie.appendChild(ne),ie.appendChild(re),Q.appendChild(ie)}catch{}return Q}};/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var t=function(B,R){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,D){F.__proto__=D}||function(F,D){for(var G in D)Object.prototype.hasOwnProperty.call(D,G)&&(F[G]=D[G])})(B,R)};function r(B,R){if(typeof R!="function"&&R!==null)throw new TypeError("Class extends value "+String(R)+" is not a constructor or null");function F(){this.constructor=B}t(B,R),B.prototype=R===null?Object.create(R):(F.prototype=R.prototype,new F)}function e(B){var R="";Array.isArray(B)||(B=[B]);for(var F=0;FB.phi1&&(B.phi2-=2*n),B.sweepFlag===1&&B.phi2D)return[];if(D===0)return[[B*F/(B*B+R*R),R*F/(B*B+R*R)]];var G=Math.sqrt(D);return[[(B*F+R*G)/(B*B+R*R),(R*F-B*G)/(B*B+R*R)],[(B*F-R*G)/(B*B+R*R),(R*F+B*G)/(B*B+R*R)]]}var u,h=Math.PI/180;function c$1(B,R,F){return(1-F)*B+F*R}function y(B,R,F,D){return B+Math.cos(D/180*n)*R+Math.sin(D/180*n)*F}function p(B,R,F,D){var G=1e-6,U=R-B,W=F-R,q=3*U+3*(D-F)-6*W,Y=6*(W-U),J=3*U;return Math.abs(q)ue&&(Q.sweepFlag=+!Q.sweepFlag),Q})}function W(){return function(q){var Y={};for(var J in q)Y[J]=q[J];return Y}}B.ROUND=function(q){function Y(J){return Math.round(J*q)/q}return q===void 0&&(q=1e13),a(q),function(J){return J.x1!==void 0&&(J.x1=Y(J.x1)),J.y1!==void 0&&(J.y1=Y(J.y1)),J.x2!==void 0&&(J.x2=Y(J.x2)),J.y2!==void 0&&(J.y2=Y(J.y2)),J.x!==void 0&&(J.x=Y(J.x)),J.y!==void 0&&(J.y=Y(J.y)),J.rX!==void 0&&(J.rX=Y(J.rX)),J.rY!==void 0&&(J.rY=Y(J.rY)),J}},B.TO_ABS=R,B.TO_REL=function(){return G(function(q,Y,J){return q.relative||(q.x1!==void 0&&(q.x1-=Y),q.y1!==void 0&&(q.y1-=J),q.x2!==void 0&&(q.x2-=Y),q.y2!==void 0&&(q.y2-=J),q.x!==void 0&&(q.x-=Y),q.y!==void 0&&(q.y-=J),q.relative=!0),q})},B.NORMALIZE_HVZ=function(q,Y,J){return q===void 0&&(q=!0),Y===void 0&&(Y=!0),J===void 0&&(J=!0),G(function(Z,K,te,Q,ie){if(isNaN(Q)&&!(Z.type&_.MOVE_TO))throw new Error("path must start with moveto");return Y&&Z.type&_.HORIZ_LINE_TO&&(Z.type=_.LINE_TO,Z.y=Z.relative?0:te),J&&Z.type&_.VERT_LINE_TO&&(Z.type=_.LINE_TO,Z.x=Z.relative?0:K),q&&Z.type&_.CLOSE_PATH&&(Z.type=_.LINE_TO,Z.x=Z.relative?Q-K:Q,Z.y=Z.relative?ie-te:ie),Z.type&_.ARC&&(Z.rX===0||Z.rY===0)&&(Z.type=_.LINE_TO,delete Z.rX,delete Z.rY,delete Z.xRot,delete Z.lArcFlag,delete Z.sweepFlag),Z})},B.NORMALIZE_ST=F,B.QT_TO_C=D,B.INFO=G,B.SANITIZE=function(q){q===void 0&&(q=0),a(q);var Y=NaN,J=NaN,Z=NaN,K=NaN;return G(function(te,Q,ie,se,ne){var re=Math.abs,ae=!1,ce=0,he=0;if(te.type&_.SMOOTH_CURVE_TO&&(ce=isNaN(Y)?0:Q-Y,he=isNaN(J)?0:ie-J),te.type&(_.CURVE_TO|_.SMOOTH_CURVE_TO)?(Y=te.relative?Q+te.x2:te.x2,J=te.relative?ie+te.y2:te.y2):(Y=NaN,J=NaN),te.type&_.SMOOTH_QUAD_TO?(Z=isNaN(Z)?Q:2*Q-Z,K=isNaN(K)?ie:2*ie-K):te.type&_.QUAD_TO?(Z=te.relative?Q+te.x1:te.x1,K=te.relative?ie+te.y1:te.y2):(Z=NaN,K=NaN),te.type&_.LINE_COMMANDS||te.type&_.ARC&&(te.rX===0||te.rY===0||!te.lArcFlag)||te.type&_.CURVE_TO||te.type&_.SMOOTH_CURVE_TO||te.type&_.QUAD_TO||te.type&_.SMOOTH_QUAD_TO){var fe=te.x===void 0?0:te.relative?te.x:te.x-Q,be=te.y===void 0?0:te.relative?te.y:te.y-ie;ce=isNaN(Z)?te.x1===void 0?ce:te.relative?te.x:te.x1-Q:Z-Q,he=isNaN(K)?te.y1===void 0?he:te.relative?te.y:te.y1-ie:K-ie;var ue=te.x2===void 0?0:te.relative?te.x:te.x2-Q,ge=te.y2===void 0?0:te.relative?te.y:te.y2-ie;re(fe)<=q&&re(be)<=q&&re(ce)<=q&&re(he)<=q&&re(ue)<=q&&re(ge)<=q&&(ae=!0)}return te.type&_.CLOSE_PATH&&re(Q-se)<=q&&re(ie-ne)<=q&&(ae=!0),ae?[]:te})},B.MATRIX=U,B.ROTATE=function(q,Y,J){Y===void 0&&(Y=0),J===void 0&&(J=0),a(q,Y,J);var Z=Math.sin(q),K=Math.cos(q);return U(K,Z,-Z,K,Y-Y*K+J*Z,J-Y*Z-J*K)},B.TRANSLATE=function(q,Y){return Y===void 0&&(Y=0),a(q,Y),U(1,0,0,1,q,Y)},B.SCALE=function(q,Y){return Y===void 0&&(Y=q),a(q,Y),U(q,0,0,Y,0,0)},B.SKEW_X=function(q){return a(q),U(1,0,Math.atan(q),1,0,0)},B.SKEW_Y=function(q){return a(q),U(1,Math.atan(q),0,1,0,0)},B.X_AXIS_SYMMETRY=function(q){return q===void 0&&(q=0),a(q),U(-1,0,0,1,q,0)},B.Y_AXIS_SYMMETRY=function(q){return q===void 0&&(q=0),a(q),U(1,0,0,-1,0,q)},B.A_TO_C=function(){return G(function(q,Y,J){return _.ARC===q.type?function(Z,K,te){var Q,ie,se,ne;Z.cX||o(Z,K,te);for(var re=Math.min(Z.phi1,Z.phi2),ae=Math.max(Z.phi1,Z.phi2)-re,ce=Math.ceil(ae/90),he=new Array(ce),fe=K,be=te,ue=0;ueK.maxX&&(K.maxX=ke),keK.maxY&&(K.maxY=ke),keNe&&ne(m$1(Q,se.x1,se.x2,se.x,Ne));for(var he=0,fe=p(ie,se.y1,se.y2,se.y);heNe&&re(m$1(ie,se.y1,se.y2,se.y,Ne))}if(se.type&_.ARC){ne(se.x),re(se.y),o(se,Q,ie);for(var be=se.xRot/180*Math.PI,ue=Math.cos(be)*se.rX,ge=Math.sin(be)*se.rX,ve=-Math.sin(be)*se.rY,Se=Math.cos(be)*se.rY,pe=se.phi1se.phi2?[se.phi2+360,se.phi1+360]:[se.phi2,se.phi1],ye=pe[0],Ee=pe[1],de=function(ke){var Ae=ke[0],_e=ke[1],Fe=180*Math.atan2(_e,Ae)/Math.PI;return Feye&&Neye&&NeZ)throw new SyntaxError('Expected positive number, got "'+Z+'" at index "'+W+'"')}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+W+'"')}this.curArgs.push(Z),this.curArgs.length===N[this.curCommandType]&&(_.HORIZ_LINE_TO===this.curCommandType?U({type:_.HORIZ_LINE_TO,relative:this.curCommandRelative,x:Z}):_.VERT_LINE_TO===this.curCommandType?U({type:_.VERT_LINE_TO,relative:this.curCommandRelative,y:Z}):this.curCommandType===_.MOVE_TO||this.curCommandType===_.LINE_TO||this.curCommandType===_.SMOOTH_QUAD_TO?(U({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),_.MOVE_TO===this.curCommandType&&(this.curCommandType=_.LINE_TO)):this.curCommandType===_.CURVE_TO?U({type:_.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===_.SMOOTH_CURVE_TO?U({type:_.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_.QUAD_TO?U({type:_.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_.ARC&&U({type:_.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!T(q))if(q===","&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if(q!=="+"&&q!=="-"&&q!==".")if(J)this.curNumber=q,this.curNumberHasDecimal=!1;else{if(this.curArgs.length!==0)throw new SyntaxError("Unterminated command at index "+W+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+q+'" at index '+W+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,q!=="z"&&q!=="Z")if(q==="h"||q==="H")this.curCommandType=_.HORIZ_LINE_TO,this.curCommandRelative=q==="h";else if(q==="v"||q==="V")this.curCommandType=_.VERT_LINE_TO,this.curCommandRelative=q==="v";else if(q==="m"||q==="M")this.curCommandType=_.MOVE_TO,this.curCommandRelative=q==="m";else if(q==="l"||q==="L")this.curCommandType=_.LINE_TO,this.curCommandRelative=q==="l";else if(q==="c"||q==="C")this.curCommandType=_.CURVE_TO,this.curCommandRelative=q==="c";else if(q==="s"||q==="S")this.curCommandType=_.SMOOTH_CURVE_TO,this.curCommandRelative=q==="s";else if(q==="q"||q==="Q")this.curCommandType=_.QUAD_TO,this.curCommandRelative=q==="q";else if(q==="t"||q==="T")this.curCommandType=_.SMOOTH_QUAD_TO,this.curCommandRelative=q==="t";else{if(q!=="a"&&q!=="A")throw new SyntaxError('Unexpected character "'+q+'" at index '+W+".");this.curCommandType=_.ARC,this.curCommandRelative=q==="a"}else D.push({type:_.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=q,this.curNumberHasDecimal=q==="."}else this.curNumber+=q,this.curNumberHasDecimal=!0;else this.curNumber+=q;else this.curNumber+=q,this.curNumberHasExp=!0;else this.curNumber+=q,this.curNumberHasExpDigits=this.curNumberHasExp}return D},R.prototype.transform=function(F){return Object.create(this,{parse:{value:function(D,G){G===void 0&&(G=[]);for(var U=0,W=Object.getPrototypeOf(this).parse.call(this,D);U>fe;if(W[ce+3]=ct,ct!==0){var De=255/ct;W[ce]=(ke*he>>fe)*De,W[ce+1]=(Ae*he>>fe)*De,W[ce+2]=(_e*he>>fe)*De}else W[ce]=W[ce+1]=W[ce+2]=0;ke-=Oe,Ae-=Me,_e-=Pe,Fe-=Ne,Oe-=ne.r,Me-=ne.g,Pe-=ne.b,Ne-=ne.a;var xe=at+U+1;xe=ae+(xe>fe,ot>0?(ot=255/ot,W[jt]=(vt*he>>fe)*ot,W[jt+1]=(Et*he>>fe)*ot,W[jt+2]=(Lt*he>>fe)*ot):W[jt]=W[jt+1]=W[jt+2]=0,vt-=rt,Et-=ft,Lt-=St,Qt-=lt,rt-=ne.r,ft-=ne.g,St-=ne.b,lt-=ne.a,jt=Xe+((jt=vi+Z)0&&arguments[0]!==void 0?arguments[0]:{};const R={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:B,createCanvas(F,D){return new OffscreenCanvas(F,D)},async createImage(F){const G=await(await fetch(F)).blob();return await createImageBitmap(G)}};return(typeof globalThis.DOMParser!="undefined"||typeof B=="undefined")&&Reflect.deleteProperty(R,"DOMParser"),R}function node(B){let{DOMParser:R,canvas:F,fetch:D}=B;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:R,fetch:D,createCanvas:F.createCanvas,createImage:F.loadImage}}var index=Object.freeze({__proto__:null,offscreen,node});function compressSpaces(B){return B.replace(/(?!\u3000)\s+/gm," ")}function trimLeft(B){return B.replace(/^[\n \t]+/,"")}function trimRight(B){return B.replace(/[\n \t]+$/,"")}function toNumbers(B){const R=B.match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm);return R?R.map(parseFloat):[]}function toMatrixValue(B){const R=toNumbers(B);return[R[0]||0,R[1]||0,R[2]||0,R[3]||0,R[4]||0,R[5]||0]}const allUppercase=/^[A-Z-]+$/;function normalizeAttributeName(B){return allUppercase.test(B)?B.toLowerCase():B}function parseExternalUrl(B){const R=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(B);return R&&(R[2]||R[3]||R[4])||""}function normalizeColor(B){if(!B.startsWith("rgb"))return B;let R=3;return B.replace(/\d+(\.\d+)?/g,(D,G)=>R--&&G?String(Math.round(parseFloat(D))):D)}const attributeRegex=/(\[[^\]]+\])/g,idRegex=/(#[^\s+>~.[:]+)/g,classRegex=/(\.[^\s+>~.[:]+)/g,pseudoElementRegex=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,pseudoClassWithBracketsRegex=/(:[\w-]+\([^)]*\))/gi,pseudoClassRegex=/(:[^\s+>~.[:]+)/g,elementRegex=/([^\s+>~.[:]+)/g;function findSelectorMatch(B,R){const F=R.exec(B);return F?[B.replace(R," "),F.length]:[B,0]}function getSelectorSpecificity(B){const R=[0,0,0];let F=B.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),D=0;return[F,D]=findSelectorMatch(F,attributeRegex),R[1]+=D,[F,D]=findSelectorMatch(F,idRegex),R[0]+=D,[F,D]=findSelectorMatch(F,classRegex),R[1]+=D,[F,D]=findSelectorMatch(F,pseudoElementRegex),R[2]+=D,[F,D]=findSelectorMatch(F,pseudoClassWithBracketsRegex),R[1]+=D,[F,D]=findSelectorMatch(F,pseudoClassRegex),R[1]+=D,F=F.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[F,D]=findSelectorMatch(F,elementRegex),R[2]+=D,R.join("")}const PSEUDO_ZERO=1e-8;function vectorMagnitude(B){return Math.sqrt(Math.pow(B[0],2)+Math.pow(B[1],2))}function vectorsRatio(B,R){return(B[0]*R[0]+B[1]*R[1])/(vectorMagnitude(B)*vectorMagnitude(R))}function vectorsAngle(B,R){return(B[0]*R[1]0&&arguments[0]!==void 0?arguments[0]:" ";const{document:F,name:D}=this;return compressSpaces(this.getString()).trim().split(R).map(G=>new Property(F,D,G))}hasValue(R){const F=this.value;return F!==null&&F!==""&&(R||F!==0)&&typeof F!="undefined"}isString(R){const{value:F}=this,D=typeof F=="string";return!D||!R?D:R.test(F)}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;const R=this.getString();switch(!0){case R.endsWith("px"):case/^[0-9]+$/.test(R):return!0;default:return!1}}setValue(R){return this.value=R,this}getValue(R){return typeof R=="undefined"||this.hasValue()?this.value:R}getNumber(R){if(!this.hasValue())return typeof R=="undefined"?0:parseFloat(R);const{value:F}=this;let D=parseFloat(F);return this.isString(/%$/)&&(D/=100),D}getString(R){return typeof R=="undefined"||this.hasValue()?typeof this.value=="undefined"?"":String(this.value):String(R)}getColor(R){let F=this.getString(R);return this.isNormalizedColor||(this.isNormalizedColor=!0,F=normalizeColor(F),this.value=F),F}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(R){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!this.hasValue())return 0;const[D,G]=typeof R=="boolean"?[void 0,R]:[R],{viewPort:U}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(U.computeSize("x"),U.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(U.computeSize("x"),U.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*U.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*U.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return this.getNumber()*15;case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case(this.isString(/%$/)&&G):return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*U.computeSize(D);default:{const W=this.getNumber();return F&&W<1?W*U.computeSize(D):W}}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():this.getNumber()*1e3:0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){const R=this.getString(),F=/#([^)'"]+)/.exec(R),D=(F==null?void 0:F[1])||R;return this.document.definitions[D]}getFillStyleDefinition(R,F){let D=this.getDefinition();if(!D)return null;if(typeof D.createGradient=="function"&&"getBoundingBox"in R)return D.createGradient(this.document.ctx,R,F);if(typeof D.createPattern=="function"){if(D.getHrefAttribute().hasValue()){const G=D.getAttribute("patternTransform");D=D.getHrefAttribute().getDefinition(),D&&G.hasValue()&&D.getAttribute("patternTransform",!0).setValue(G.value)}if(D)return D.createPattern(this.document.ctx,R,F)}return null}getTextBaseline(){if(!this.hasValue())return null;const R=this.getString();return Property.textBaselineMapping[R]||null}addOpacity(R){let F=this.getColor();const D=F.length;let G=0;for(let U=0;U1&&arguments[1]!==void 0?arguments[1]:0;const[D=F,G=F]=toNumbers(R);return new Point(D,G)}static parseScale(R){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;const[D=F,G=D]=toNumbers(R);return new Point(D,G)}static parsePath(R){const F=toNumbers(R),D=F.length,G=[];for(let U=0;U0}runEvents(){if(!this.working)return;const{screen:R,events:F,eventElements:D}=this,{style:G}=R.ctx.canvas;let U;G&&(G.cursor=""),F.forEach((W,q)=>{let{run:Y}=W;for(U=D[q];U;)Y(U),U=U.parent}),this.events=[],this.eventElements=[]}checkPath(R,F){if(!this.working||!F)return;const{events:D,eventElements:G}=this;D.forEach((U,W)=>{let{x:q,y:Y}=U;!G[W]&&F.isPointInPath&&F.isPointInPath(q,Y)&&(G[W]=R)})}checkBoundingBox(R,F){if(!this.working||!F)return;const{events:D,eventElements:G}=this;D.forEach((U,W)=>{let{x:q,y:Y}=U;!G[W]&&F.isPointInBox(q,Y)&&(G[W]=R)})}mapXY(R,F){const{window:D,ctx:G}=this.screen,U=new Point(R,F);let W=G.canvas;for(;W;)U.x-=W.offsetLeft,U.y-=W.offsetTop,W=W.offsetParent;return D!=null&&D.scrollX&&(U.x+=D.scrollX),D!=null&&D.scrollY&&(U.y+=D.scrollY),U}onClick(R){const{x:F,y:D}=this.mapXY(R.clientX,R.clientY);this.events.push({type:"onclick",x:F,y:D,run(G){G.onClick&&G.onClick()}})}onMouseMove(R){const{x:F,y:D}=this.mapXY(R.clientX,R.clientY);this.events.push({type:"onmousemove",x:F,y:D,run(G){G.onMouseMove&&G.onMouseMove()}})}constructor(R){this.screen=R,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}}const defaultWindow=typeof window!="undefined"?window:null,defaultFetch$1=typeof fetch!="undefined"?fetch.bind(void 0):void 0;class Screen{wait(R){this.waits.push(R)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;const R=this.waits.every(F=>F());return R&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=R,R}setDefaults(R){R.strokeStyle="rgba(0,0,0,0)",R.lineCap="butt",R.lineJoin="miter",R.miterLimit=4}setViewBox(R){let{document:F,ctx:D,aspectRatio:G,width:U,desiredWidth:W,height:q,desiredHeight:Y,minX:J=0,minY:Z=0,refX:K,refY:te,clip:Q=!1,clipX:ie=0,clipY:se=0}=R;const ne=compressSpaces(G).replace(/^defer\s/,""),[re,ae]=ne.split(" "),ce=re||"xMidYMid",he=ae||"meet",fe=U/W,be=q/Y,ue=Math.min(fe,be),ge=Math.max(fe,be);let ve=W,Se=Y;he==="meet"&&(ve*=ue,Se*=ue),he==="slice"&&(ve*=ge,Se*=ge);const pe=new Property(F,"refX",K),ye=new Property(F,"refY",te),Ee=pe.hasValue()&&ye.hasValue();if(Ee&&D.translate(-ue*pe.getPixels("x"),-ue*ye.getPixels("y")),Q){const de=ue*ie,we=ue*se;D.beginPath(),D.moveTo(de,we),D.lineTo(U,we),D.lineTo(U,q),D.lineTo(de,q),D.closePath(),D.clip()}if(!Ee){const de=he==="meet"&&ue===be,we=he==="slice"&&ge===be,Oe=he==="meet"&&ue===fe,Me=he==="slice"&&ge===fe;ce.startsWith("xMid")&&(de||we)&&D.translate(U/2-ve/2,0),ce.endsWith("YMid")&&(Oe||Me)&&D.translate(0,q/2-Se/2),ce.startsWith("xMax")&&(de||we)&&D.translate(U-ve,0),ce.endsWith("YMax")&&(Oe||Me)&&D.translate(0,q-Se)}switch(!0){case ce==="none":D.scale(fe,be);break;case he==="meet":D.scale(ue,ue);break;case he==="slice":D.scale(ge,ge);break}D.translate(-J,-Z)}start(R){let{enableRedraw:F=!1,ignoreMouse:D=!1,ignoreAnimation:G=!1,ignoreDimensions:U=!1,ignoreClear:W=!1,forceRedraw:q,scaleWidth:Y,scaleHeight:J,offsetX:Z,offsetY:K}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{mouse:te}=this,Q=1e3/Screen.FRAMERATE;if(this.frameDuration=Q,this.readyPromise=new Promise(ae=>{this.resolveReady=ae}),this.isReady()&&this.render(R,U,W,Y,J,Z,K),!F)return;let ie=Date.now(),se=ie,ne=0;const re=()=>{ie=Date.now(),ne=ie-se,ne>=Q&&(se=ie-ne%Q,this.shouldUpdate(G,q)&&(this.render(R,U,W,Y,J,Z,K),te.runEvents())),this.intervalId=requestAnimationFrame$1(re)};D||te.start(),this.intervalId=requestAnimationFrame$1(re)}stop(){this.intervalId&&(requestAnimationFrame$1.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(R,F){if(!R){const{frameDuration:D}=this;if(this.animations.reduce((U,W)=>W.update(D)||U,!1))return!0}return!!(typeof F=="function"&&F()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(R,F,D,G,U,W,q){const{viewPort:Y,ctx:J,isFirstRender:Z}=this,K=J.canvas;Y.clear(),K.width&&K.height&&Y.setCurrent(K.width,K.height);const te=R.getStyle("width"),Q=R.getStyle("height");!F&&(Z||typeof G!="number"&&typeof U!="number")&&(te.hasValue()&&(K.width=te.getPixels("x"),K.style&&(K.style.width="".concat(K.width,"px"))),Q.hasValue()&&(K.height=Q.getPixels("y"),K.style&&(K.style.height="".concat(K.height,"px"))));let ie=K.clientWidth||K.width,se=K.clientHeight||K.height;if(F&&te.hasValue()&&Q.hasValue()&&(ie=te.getPixels("x"),se=Q.getPixels("y")),Y.setCurrent(ie,se),typeof W=="number"&&R.getAttribute("x",!0).setValue(W),typeof q=="number"&&R.getAttribute("y",!0).setValue(q),typeof G=="number"||typeof U=="number"){const ne=toNumbers(R.getAttribute("viewBox").getString());let re=0,ae=0;if(typeof G=="number"){const he=R.getStyle("width");he.hasValue()?re=he.getPixels("x")/G:ne[2]&&!isNaN(ne[2])&&(re=ne[2]/G)}if(typeof U=="number"){const he=R.getStyle("height");he.hasValue()?ae=he.getPixels("y")/U:ne[3]&&!isNaN(ne[3])&&(ae=ne[3]/U)}re||(re=ae),ae||(ae=re),R.getAttribute("width",!0).setValue(G),R.getAttribute("height",!0).setValue(U);const ce=R.getStyle("transform",!0,!0);ce.setValue("".concat(ce.getString()," scale(").concat(1/re,", ").concat(1/ae,")"))}D||J.clearRect(0,0,ie,se),R.render(J),Z&&(this.isFirstRender=!1)}constructor(R,{fetch:F=defaultFetch$1,window:D=defaultWindow}={}){if(this.ctx=R,this.viewPort=new ViewPort,this.mouse=new Mouse(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=D,!F)throw new Error("Can't find 'fetch' in 'globalThis', please provide it via options");this.fetch=F}}Screen.defaultWindow=defaultWindow;Screen.defaultFetch=defaultFetch$1;Screen.FRAMERATE=30;Screen.MAX_VIRTUAL_PIXELS=3e4;const{defaultFetch}=Screen,DefaultDOMParser=typeof DOMParser!="undefined"?DOMParser:void 0;class Parser$1{async parse(R){return R.startsWith("<")?this.parseFromString(R):this.load(R)}parseFromString(R){const F=new this.DOMParser;try{return this.checkDocument(F.parseFromString(R,"image/svg+xml"))}catch{return this.checkDocument(F.parseFromString(R,"text/xml"))}}checkDocument(R){const F=R.getElementsByTagName("parsererror")[0];if(F)throw new Error(F.textContent||"Unknown parse error");return R}async load(R){const D=await(await this.fetch(R)).text();return this.parseFromString(D)}constructor({fetch:R=defaultFetch,DOMParser:F=DefaultDOMParser}={}){if(!R)throw new Error("Can't find 'fetch' in 'globalThis', please provide it via options");if(!F)throw new Error("Can't find 'DOMParser' in 'globalThis', please provide it via options");this.fetch=R,this.DOMParser=F}}class Translate{apply(R){const{x:F,y:D}=this.point;R.translate(F||0,D||0)}unapply(R){const{x:F,y:D}=this.point;R.translate(-1*F||0,-1*D||0)}applyToPoint(R){const{x:F,y:D}=this.point;R.applyTransform([1,0,0,1,F||0,D||0])}constructor(R,F){this.type="translate",this.point=Point.parse(F)}}class Rotate{apply(R){const{cx:F,cy:D,originX:G,originY:U,angle:W}=this,q=F+G.getPixels("x"),Y=D+U.getPixels("y");R.translate(q,Y),R.rotate(W.getRadians()),R.translate(-q,-Y)}unapply(R){const{cx:F,cy:D,originX:G,originY:U,angle:W}=this,q=F+G.getPixels("x"),Y=D+U.getPixels("y");R.translate(q,Y),R.rotate(-1*W.getRadians()),R.translate(-q,-Y)}applyToPoint(R){const{cx:F,cy:D,angle:G}=this,U=G.getRadians();R.applyTransform([1,0,0,1,F||0,D||0]),R.applyTransform([Math.cos(U),Math.sin(U),-Math.sin(U),Math.cos(U),0,0]),R.applyTransform([1,0,0,1,-F||0,-D||0])}constructor(R,F,D){this.type="rotate";const G=toNumbers(F);this.angle=new Property(R,"angle",G[0]),this.originX=D[0],this.originY=D[1],this.cx=G[1]||0,this.cy=G[2]||0}}class Scale{apply(R){const{scale:{x:F,y:D},originX:G,originY:U}=this,W=G.getPixels("x"),q=U.getPixels("y");R.translate(W,q),R.scale(F,D||F),R.translate(-W,-q)}unapply(R){const{scale:{x:F,y:D},originX:G,originY:U}=this,W=G.getPixels("x"),q=U.getPixels("y");R.translate(W,q),R.scale(1/F,1/D||F),R.translate(-W,-q)}applyToPoint(R){const{x:F,y:D}=this.scale;R.applyTransform([F||0,0,0,D||0,0,0])}constructor(R,F,D){this.type="scale";const G=Point.parseScale(F);(G.x===0||G.y===0)&&(G.x=PSEUDO_ZERO,G.y=PSEUDO_ZERO),this.scale=G,this.originX=D[0],this.originY=D[1]}}class Matrix{apply(R){const{originX:F,originY:D,matrix:G}=this,U=F.getPixels("x"),W=D.getPixels("y");R.translate(U,W),R.transform(G[0],G[1],G[2],G[3],G[4],G[5]),R.translate(-U,-W)}unapply(R){const{originX:F,originY:D,matrix:G}=this,U=G[0],W=G[2],q=G[4],Y=G[1],J=G[3],Z=G[5],K=0,te=0,Q=1,ie=1/(U*(J*Q-Z*te)-W*(Y*Q-Z*K)+q*(Y*te-J*K)),se=F.getPixels("x"),ne=D.getPixels("y");R.translate(se,ne),R.transform(ie*(J*Q-Z*te),ie*(Z*K-Y*Q),ie*(q*te-W*Q),ie*(U*Q-q*K),ie*(W*Z-q*J),ie*(q*Y-U*Z)),R.translate(-se,-ne)}applyToPoint(R){R.applyTransform(this.matrix)}constructor(R,F,D){this.type="matrix",this.matrix=toMatrixValue(F),this.originX=D[0],this.originY=D[1]}}class Skew extends Matrix{constructor(R,F,D){super(R,F,D),this.type="skew",this.angle=new Property(R,"angle",F)}}class SkewX extends Skew{constructor(R,F,D){super(R,F,D),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class SkewY extends Skew{constructor(R,F,D){super(R,F,D),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}function parseTransforms(B){return compressSpaces(B).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function parseTransform(B){const[R="",F=""]=B.split("(");return[R.trim(),F.trim().replace(")","")]}class Transform{static fromElement(R,F){const D=F.getStyle("transform",!1,!0);if(D.hasValue()){const[G,U=G]=F.getStyle("transform-origin",!1,!0).split();if(G&&U){const W=[G,U];return new Transform(R,D.getString(),W)}}return null}apply(R){this.transforms.forEach(F=>F.apply(R))}unapply(R){this.transforms.forEach(F=>F.unapply(R))}applyToPoint(R){this.transforms.forEach(F=>F.applyToPoint(R))}constructor(R,F,D){this.document=R,this.transforms=[],parseTransforms(F).forEach(U=>{if(U==="none")return;const[W,q]=parseTransform(U),Y=Transform.transformTypes[W];Y&&this.transforms.push(new Y(this.document,q,D))})}}Transform.transformTypes={translate:Translate,rotate:Rotate,scale:Scale,matrix:Matrix,skewX:SkewX,skewY:SkewY};class Element$2{getAttribute(R){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const D=this.attributes[R];if(!D&&F){const G=new Property(this.document,R,"");return this.attributes[R]=G,G}return D||Property.empty(this.document)}getHrefAttribute(){let R;for(const F in this.attributes)if(F==="href"||F.endsWith(":href")){R=this.attributes[F];break}return R||Property.empty(this.document)}getStyle(R){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const G=this.styles[R];if(G)return G;const U=this.getAttribute(R);if(U.hasValue())return this.styles[R]=U,U;if(!D){const{parent:W}=this;if(W){const q=W.getStyle(R);if(q.hasValue())return q}}if(F){const W=new Property(this.document,R,"");return this.styles[R]=W,W}return Property.empty(this.document)}render(R){if(!(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden")){if(R.save(),this.getStyle("mask").hasValue()){const F=this.getStyle("mask").getDefinition();F&&(this.applyEffects(R),F.apply(R,this))}else if(this.getStyle("filter").getValue("none")!=="none"){const F=this.getStyle("filter").getDefinition();F&&(this.applyEffects(R),F.apply(R,this))}else this.setContext(R),this.renderChildren(R),this.clearContext(R);R.restore()}}setContext(R){}applyEffects(R){const F=Transform.fromElement(this.document,this);F&&F.apply(R);const D=this.getStyle("clip-path",!1,!0);if(D.hasValue()){const G=D.getDefinition();G&&G.apply(R)}}clearContext(R){}renderChildren(R){this.children.forEach(F=>{F.render(R)})}addChild(R){const F=R instanceof Element$2?R:this.document.createElement(R);F.parent=this,Element$2.ignoreChildTypes.includes(F.type)||this.children.push(F)}matchesSelector(R){var F;const{node:D}=this;if(typeof D.matches=="function")return D.matches(R);const G=(F=D.getAttribute)===null||F===void 0?void 0:F.call(D,"class");return!G||G===""?!1:G.split(" ").some(U=>".".concat(U)===R)}addStylesFromStyleDefinition(){const{styles:R,stylesSpecificity:F}=this.document;let D;for(const G in R)if(!G.startsWith("@")&&this.matchesSelector(G)){const U=R[G],W=F[G];if(U)for(const q in U){let Y=this.stylesSpecificity[q];typeof Y=="undefined"&&(Y="000"),W&&W>=Y&&(D=U[q],D&&(this.styles[q]=D),this.stylesSpecificity[q]=W)}}}removeStyles(R,F){return F.reduce((G,U)=>{const W=R.getStyle(U);if(!W.hasValue())return G;const q=W.getString();return W.setValue(""),[...G,[U,q]]},[])}restoreStyles(R,F){F.forEach(D=>{let[G,U]=D;R.getStyle(G,!0).setValue(U)})}isFirstChild(){var R;return((R=this.parent)===null||R===void 0?void 0:R.children.indexOf(this))===0}constructor(R,F,D=!1){if(this.document=R,this.node=F,this.captureTextNodes=D,this.type="",this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],!F||F.nodeType!==1)return;Array.from(F.attributes).forEach(W=>{const q=normalizeAttributeName(W.nodeName);this.attributes[q]=new Property(R,q,W.value)}),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()&&this.getAttribute("style").getString().split(";").map(q=>q.trim()).forEach(q=>{if(!q)return;const[Y,J]=q.split(":").map(Z=>Z.trim());Y&&(this.styles[Y]=new Property(R,Y,J))});const{definitions:G}=R,U=this.getAttribute("id");U.hasValue()&&(G[U.getString()]||(G[U.getString()]=this)),Array.from(F.childNodes).forEach(W=>{if(W.nodeType===1)this.addChild(W);else if(D&&(W.nodeType===3||W.nodeType===4)){const q=R.createTextNode(W);q.getText().length>0&&this.addChild(q)}})}}Element$2.ignoreChildTypes=["title"];class UnknownElement extends Element$2{constructor(R,F,D){super(R,F,D)}}function wrapFontFamily(B){const R=B.trim();return/^('|")/.test(R)?R:'"'.concat(R,'"')}function prepareFontFamily(B){return typeof process=="undefined"?B:B.trim().split(",").map(wrapFontFamily).join(",")}function prepareFontStyle(B){if(!B)return"";const R=B.trim().toLowerCase();switch(R){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return R;default:return/^oblique\s+(-|)\d+deg$/.test(R)?R:""}}function prepareFontWeight(B){if(!B)return"";const R=B.trim().toLowerCase();switch(R){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return R;default:return/^[\d.]+$/.test(R)?R:""}}class Font$1{static parse(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",F=arguments.length>1?arguments[1]:void 0,D="",G="",U="",W="",q="";const Y=compressSpaces(R).trim().split(" "),J={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return Y.forEach(Z=>{switch(!0){case(!J.fontStyle&&Font$1.styles.includes(Z)):Z!=="inherit"&&(D=Z),J.fontStyle=!0;break;case(!J.fontVariant&&Font$1.variants.includes(Z)):Z!=="inherit"&&(G=Z),J.fontStyle=!0,J.fontVariant=!0;break;case(!J.fontWeight&&Font$1.weights.includes(Z)):Z!=="inherit"&&(U=Z),J.fontStyle=!0,J.fontVariant=!0,J.fontWeight=!0;break;case!J.fontSize:Z!=="inherit"&&(W=Z.split("/")[0]||""),J.fontStyle=!0,J.fontVariant=!0,J.fontWeight=!0,J.fontSize=!0;break;default:Z!=="inherit"&&(q+=Z)}}),new Font$1(D,G,U,W,q,F)}toString(){return[prepareFontStyle(this.fontStyle),this.fontVariant,prepareFontWeight(this.fontWeight),this.fontSize,prepareFontFamily(this.fontFamily)].join(" ").trim()}constructor(R,F,D,G,U,W){const q=W?typeof W=="string"?Font$1.parse(W):W:{};this.fontFamily=U||q.fontFamily,this.fontSize=G||q.fontSize,this.fontStyle=R||q.fontStyle,this.fontWeight=D||q.fontWeight,this.fontVariant=F||q.fontVariant}}Font$1.styles="normal|italic|oblique|inherit";Font$1.variants="normal|small-caps|inherit";Font$1.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class BoundingBox$2{get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(R,F){typeof R!="undefined"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=R,this.x2=R),Rthis.x2&&(this.x2=R)),typeof F!="undefined"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=F,this.y2=F),Fthis.y2&&(this.y2=F))}addX(R){this.addPoint(R,0)}addY(R){this.addPoint(0,R)}addBoundingBox(R){if(!R)return;const{x1:F,y1:D,x2:G,y2:U}=R;this.addPoint(F,D),this.addPoint(G,U)}sumCubic(R,F,D,G,U){return Math.pow(1-R,3)*F+3*Math.pow(1-R,2)*R*D+3*(1-R)*Math.pow(R,2)*G+Math.pow(R,3)*U}bezierCurveAdd(R,F,D,G,U){const W=6*F-12*D+6*G,q=-3*F+9*D-9*G+3*U,Y=3*D-3*F;if(q===0){if(W===0)return;const te=-Y/W;01&&arguments[1]!==void 0?arguments[1]:!1;if(!F){const D=this.getStyle("fill"),G=this.getStyle("fill-opacity"),U=this.getStyle("stroke"),W=this.getStyle("stroke-opacity");if(D.isUrlDefinition()){const Q=D.getFillStyleDefinition(this,G);Q&&(R.fillStyle=Q)}else if(D.hasValue()){D.getString()==="currentColor"&&D.setValue(this.getStyle("color").getColor());const Q=D.getColor();Q!=="inherit"&&(R.fillStyle=Q==="none"?"rgba(0,0,0,0)":Q)}if(G.hasValue()){const Q=new Property(this.document,"fill",R.fillStyle).addOpacity(G).getColor();R.fillStyle=Q}if(U.isUrlDefinition()){const Q=U.getFillStyleDefinition(this,W);Q&&(R.strokeStyle=Q)}else if(U.hasValue()){U.getString()==="currentColor"&&U.setValue(this.getStyle("color").getColor());const Q=U.getString();Q!=="inherit"&&(R.strokeStyle=Q==="none"?"rgba(0,0,0,0)":Q)}if(W.hasValue()){const Q=new Property(this.document,"stroke",R.strokeStyle).addOpacity(W).getString();R.strokeStyle=Q}const q=this.getStyle("stroke-width");if(q.hasValue()){const Q=q.getPixels();R.lineWidth=Q||PSEUDO_ZERO}const Y=this.getStyle("stroke-linecap"),J=this.getStyle("stroke-linejoin"),Z=this.getStyle("stroke-miterlimit"),K=this.getStyle("stroke-dasharray"),te=this.getStyle("stroke-dashoffset");if(Y.hasValue()&&(R.lineCap=Y.getString()),J.hasValue()&&(R.lineJoin=J.getString()),Z.hasValue()&&(R.miterLimit=Z.getNumber()),K.hasValue()&&K.getString()!=="none"){const Q=toNumbers(K.getString());typeof R.setLineDash!="undefined"?R.setLineDash(Q):typeof R.webkitLineDash!="undefined"?R.webkitLineDash=Q:typeof R.mozDash!="undefined"&&!(Q.length===1&&Q[0]===0)&&(R.mozDash=Q);const ie=te.getPixels();typeof R.lineDashOffset!="undefined"?R.lineDashOffset=ie:typeof R.webkitLineDashOffset!="undefined"?R.webkitLineDashOffset=ie:typeof R.mozDashOffset!="undefined"&&(R.mozDashOffset=ie)}}if(this.modifiedEmSizeStack=!1,typeof R.font!="undefined"){const D=this.getStyle("font"),G=this.getStyle("font-style"),U=this.getStyle("font-variant"),W=this.getStyle("font-weight"),q=this.getStyle("font-size"),Y=this.getStyle("font-family"),J=new Font$1(G.getString(),U.getString(),W.getString(),q.hasValue()?"".concat(q.getPixels(!0),"px"):"",Y.getString(),Font$1.parse(D.getString(),R.font));G.setValue(J.fontStyle),U.setValue(J.fontVariant),W.setValue(J.fontWeight),q.setValue(J.fontSize),Y.setValue(J.fontFamily),R.font=J.toString(),q.isPixels()&&(this.document.emSize=q.getPixels(),this.modifiedEmSizeStack=!0)}F||(this.applyEffects(R),R.globalAlpha=this.calculateOpacity())}clearContext(R){super.clearContext(R),this.modifiedEmSizeStack&&this.document.popEmSize()}constructor(...R){super(...R),this.modifiedEmSizeStack=!1}}class TextElement extends RenderedElement{setContext(R){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.setContext(R,F);const D=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();D&&(R.textBaseline=D)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(R){if(this.type!=="text")return this.getTElementBoundingBox(R);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(R);let F=null;return this.children.forEach((D,G)=>{const U=this.getChildBoundingBox(R,this,this,G);F?F.addBoundingBox(U):F=U}),F}getFontSize(){const{document:R,parent:F}=this,D=Font$1.parse(R.ctx.font).fontSize;return F.getStyle("font-size").getNumber(D)}getTElementBoundingBox(R){const F=this.getFontSize();return new BoundingBox$2(this.x,this.y-F,this.x+this.measureText(R),this.y)}getGlyph(R,F,D){const G=F[D];let U;if(R.isArabic){var W;const q=F.length,Y=F[D-1],J=F[D+1];let Z="isolated";(D===0||Y===" ")&&D0&&Y!==" "&&D0&&Y!==" "&&(D===q-1||J===" ")&&(Z="initial"),U=((W=R.arabicGlyphs[G])===null||W===void 0?void 0:W[Z])||R.glyphs[G]}else U=R.glyphs[G];return U||(U=R.missingGlyph),U}getText(){return""}getTextFromNode(R){const F=R||this.node,D=Array.from(F.parentNode.childNodes),G=D.indexOf(F),U=D.length-1;let W=compressSpaces(F.textContent||"");return G===0&&(W=trimLeft(W)),G===U&&(W=trimRight(W)),W}renderChildren(R){if(this.type!=="text"){this.renderTElementChildren(R);return}this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(R),this.children.forEach((D,G)=>{this.renderChild(R,this,this,G)});const{mouse:F}=this.document.screen;F.isWorking()&&F.checkBoundingBox(this,this.getBoundingBox(R))}renderTElementChildren(R){const{document:F,parent:D}=this,G=this.getText(),U=D.getStyle("font-family").getDefinition();if(U){const{unitsPerEm:Y}=U.fontFace,J=Font$1.parse(F.ctx.font),Z=D.getStyle("font-size").getNumber(J.fontSize),K=D.getStyle("font-style").getString(J.fontStyle),te=Z/Y,Q=U.isRTL?G.split("").reverse().join(""):G,ie=toNumbers(D.getAttribute("dx").getString()),se=Q.length;for(let ne=0;ne=this.leafTexts.length)return;const R=this.leafTexts[this.textChunkStart],F=R.getStyle("text-anchor").getString("start"),D=!1;let G=0;F==="start"&&!D||F==="end"&&D?G=R.x-this.minX:F==="end"&&!D||F==="start"&&D?G=R.x-this.maxX:G=R.x-(this.minX+this.maxX)/2;for(let U=this.textChunkStart;U{this.adjustChildCoordinatesRecursiveCore(R,this,this,D)}),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(R,F,D,G){const U=D.children[G];U.children.length>0?U.children.forEach((W,q)=>{F.adjustChildCoordinatesRecursiveCore(R,F,U,q)}):this.adjustChildCoordinates(R,F,D,G)}adjustChildCoordinates(R,F,D,G){const U=D.children[G];if(typeof U.measureText!="function")return U;R.save(),U.setContext(R,!0);const W=U.getAttribute("x"),q=U.getAttribute("y"),Y=U.getAttribute("dx"),J=U.getAttribute("dy"),Z=U.getStyle("font-family").getDefinition(),K=Boolean(Z==null?void 0:Z.isRTL);G===0&&(W.hasValue()||W.setValue(U.getInheritedAttribute("x")),q.hasValue()||q.setValue(U.getInheritedAttribute("y")),Y.hasValue()||Y.setValue(U.getInheritedAttribute("dx")),J.hasValue()||J.setValue(U.getInheritedAttribute("dy")));const te=U.measureText(R);return K&&(F.x-=te),W.hasValue()?(F.applyAnchoring(),U.x=W.getPixels("x"),Y.hasValue()&&(U.x+=Y.getPixels("x"))):(Y.hasValue()&&(F.x+=Y.getPixels("x")),U.x=F.x),F.x=U.x,K||(F.x+=te),q.hasValue()?(U.y=q.getPixels("y"),J.hasValue()&&(U.y+=J.getPixels("y"))):(J.hasValue()&&(F.y+=J.getPixels("y")),U.y=F.y),F.y=U.y,F.leafTexts.push(U),F.minX=Math.min(F.minX,U.x,U.x+te),F.maxX=Math.max(F.maxX,U.x,U.x+te),U.clearContext(R),R.restore(),U}getChildBoundingBox(R,F,D,G){const U=D.children[G];if(typeof U.getBoundingBox!="function")return null;const W=U.getBoundingBox(R);return W&&U.children.forEach((q,Y)=>{const J=F.getChildBoundingBox(R,F,U,Y);W.addBoundingBox(J)}),W}renderChild(R,F,D,G){const U=D.children[G];U.render(R),U.children.forEach((W,q)=>{F.renderChild(R,F,U,q)})}measureText(R){const{measureCache:F}=this;if(~F)return F;const D=this.getText(),G=this.measureTargetText(R,D);return this.measureCache=G,G}measureTargetText(R,F){if(!F.length)return 0;const{parent:D}=this,G=D.getStyle("font-family").getDefinition();if(G){const W=this.getFontSize(),q=G.isRTL?F.split("").reverse().join(""):F,Y=toNumbers(D.getAttribute("dx").getString()),J=q.length;let Z=0;for(let K=0;K0?"":this.getTextFromNode()}}class TextNode extends TSpanElement{constructor(...R){super(...R),this.type="textNode"}}class PathParser extends _{reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new Point(0,0),this.control=new Point(0,0),this.current=new Point(0,0),this.points=[],this.angles=[]}isEnd(){const{i:R,commands:F}=this;return R>=F.length-1}next(){const R=this.commands[++this.i];return this.previousCommand=this.command,this.command=R,R}getPoint(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"x",F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y";const D=new Point(this.command[R],this.command[F]);return this.makeAbsolute(D)}getAsControlPoint(R,F){const D=this.getPoint(R,F);return this.control=D,D}getAsCurrentPoint(R,F){const D=this.getPoint(R,F);return this.current=D,D}getReflectedControlPoint(){const R=this.previousCommand.type;if(R!==_.CURVE_TO&&R!==_.SMOOTH_CURVE_TO&&R!==_.QUAD_TO&&R!==_.SMOOTH_QUAD_TO)return this.current;const{current:{x:F,y:D},control:{x:G,y:U}}=this;return new Point(2*F-G,2*D-U)}makeAbsolute(R){if(this.command.relative){const{x:F,y:D}=this.current;R.x+=F,R.y+=D}return R}addMarker(R,F,D){const{points:G,angles:U}=this;D&&U.length>0&&!U[U.length-1]&&(U[U.length-1]=G[G.length-1].angleTo(D)),this.addMarkerAngle(R,F?F.angleTo(R):null)}addMarkerAngle(R,F){this.points.push(R),this.angles.push(F)}getMarkerPoints(){return this.points}getMarkerAngles(){const{angles:R}=this,F=R.length;for(let D=0;D[U,D[W]])}renderChildren(R){this.path(R),this.document.screen.mouse.checkPath(this,R);const F=this.getStyle("fill-rule");R.fillStyle!==""&&(F.getString("inherit")!=="inherit"?R.fill(F.getString()):R.fill()),R.strokeStyle!==""&&(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"?(R.save(),R.setTransform(1,0,0,1,0,0),R.stroke(),R.restore()):R.stroke());const D=this.getMarkers();if(D){const G=D.length-1,U=this.getStyle("marker-start"),W=this.getStyle("marker-mid"),q=this.getStyle("marker-end");if(U.isUrlDefinition()){const Y=U.getDefinition(),[J,Z]=D[0];Y.render(R,J,Z)}if(W.isUrlDefinition()){const Y=W.getDefinition();for(let J=1;J1&&(G*=Math.sqrt(te),U*=Math.sqrt(te));let Q=(q===Y?-1:1)*Math.sqrt((Math.pow(G,2)*Math.pow(U,2)-Math.pow(G,2)*Math.pow(K.y,2)-Math.pow(U,2)*Math.pow(K.x,2))/(Math.pow(G,2)*Math.pow(K.y,2)+Math.pow(U,2)*Math.pow(K.x,2)));isNaN(Q)&&(Q=0);const ie=new Point(Q*G*K.y/U,Q*-U*K.x/G),se=new Point((F.x+Z.x)/2+Math.cos(J)*ie.x-Math.sin(J)*ie.y,(F.y+Z.y)/2+Math.sin(J)*ie.x+Math.cos(J)*ie.y),ne=vectorsAngle([1,0],[(K.x-ie.x)/G,(K.y-ie.y)/U]),re=[(K.x-ie.x)/G,(K.y-ie.y)/U],ae=[(-K.x-ie.x)/G,(-K.y-ie.y)/U];let ce=vectorsAngle(re,ae);return vectorsRatio(re,ae)<=-1&&(ce=Math.PI),vectorsRatio(re,ae)>=1&&(ce=0),{currentPoint:Z,rX:G,rY:U,sweepFlag:Y,xAxisRotation:J,centp:se,a1:ne,ad:ce}}pathA(R,F){const{pathParser:D}=this,{currentPoint:G,rX:U,rY:W,sweepFlag:q,xAxisRotation:Y,centp:J,a1:Z,ad:K}=PathElement.pathA(D),te=1-q?1:-1,Q=Z+te*(K/2),ie=new Point(J.x+U*Math.cos(Q),J.y+W*Math.sin(Q));if(D.addMarkerAngle(ie,Q-te*Math.PI/2),D.addMarkerAngle(G,Q-te*Math.PI),F.addPoint(G.x,G.y),R&&!isNaN(Z)&&!isNaN(K)){const se=U>W?U:W,ne=U>W?1:U/W,re=U>W?W/U:1;R.translate(J.x,J.y),R.rotate(Y),R.scale(ne,re),R.arc(0,0,se,Z,Z+K,Boolean(1-q)),R.scale(1/ne,1/re),R.rotate(-Y),R.translate(-J.x,-J.y)}}static pathZ(R){R.current=R.start}pathZ(R,F){PathElement.pathZ(this.pathParser),R&&F.x1!==F.x2&&F.y1!==F.y2&&R.closePath()}constructor(R,F,D){super(R,F,D),this.type="path",this.pathParser=new PathParser(this.getAttribute("d").getString())}}class SVGElement$1 extends RenderedElement{setContext(R){var F;const{document:D}=this,{screen:G,window:U}=D,W=R.canvas;if(G.setDefaults(R),"style"in W&&typeof R.font!="undefined"&&U&&typeof U.getComputedStyle!="undefined"){R.font=U.getComputedStyle(W).getPropertyValue("font");const ae=new Property(D,"fontSize",Font$1.parse(R.font).fontSize);ae.hasValue()&&(D.rootEmSize=ae.getPixels("y"),D.emSize=D.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);let{width:q,height:Y}=G.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");const J=this.getAttribute("refX"),Z=this.getAttribute("refY"),K=this.getAttribute("viewBox"),te=K.hasValue()?toNumbers(K.getString()):null,Q=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible";let ie=0,se=0,ne=0,re=0;te&&(ie=te[0],se=te[1]),this.root||(q=this.getStyle("width").getPixels("x"),Y=this.getStyle("height").getPixels("y"),this.type==="marker"&&(ne=ie,re=se,ie=0,se=0)),G.viewPort.setCurrent(q,Y),this.node&&(!this.parent||((F=this.node.parentNode)===null||F===void 0?void 0:F.nodeName)==="foreignObject")&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(R),R.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),te&&(q=te[2],Y=te[3]),D.setViewBox({ctx:R,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:G.viewPort.width,desiredWidth:q,height:G.viewPort.height,desiredHeight:Y,minX:ie,minY:se,refX:J.getValue(),refY:Z.getValue(),clip:Q,clipX:ne,clipY:re}),te&&(G.viewPort.removeCurrent(),G.viewPort.setCurrent(q,Y))}clearContext(R){super.clearContext(R),this.document.screen.viewPort.removeCurrent()}resize(R){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:R,D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const G=this.getAttribute("width",!0),U=this.getAttribute("height",!0),W=this.getAttribute("viewBox"),q=this.getAttribute("style"),Y=G.getNumber(0),J=U.getNumber(0);if(D)if(typeof D=="string")this.getAttribute("preserveAspectRatio",!0).setValue(D);else{const Z=this.getAttribute("preserveAspectRatio");Z.hasValue()&&Z.setValue(Z.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(G.setValue(R),U.setValue(F),W.hasValue()||W.setValue("0 0 ".concat(Y||R," ").concat(J||F)),q.hasValue()){const Z=this.getStyle("width"),K=this.getStyle("height");Z.hasValue()&&Z.setValue("".concat(R,"px")),K.hasValue()&&K.setValue("".concat(F,"px"))}}constructor(...R){super(...R),this.type="svg",this.root=!1}}class RectElement extends PathElement{path(R){const F=this.getAttribute("x").getPixels("x"),D=this.getAttribute("y").getPixels("y"),G=this.getStyle("width",!1,!0).getPixels("x"),U=this.getStyle("height",!1,!0).getPixels("y"),W=this.getAttribute("rx"),q=this.getAttribute("ry");let Y=W.getPixels("x"),J=q.getPixels("y");if(W.hasValue()&&!q.hasValue()&&(J=Y),q.hasValue()&&!W.hasValue()&&(Y=J),Y=Math.min(Y,G/2),J=Math.min(J,U/2),R){const Z=4*((Math.sqrt(2)-1)/3);R.beginPath(),U>0&&G>0&&(R.moveTo(F+Y,D),R.lineTo(F+G-Y,D),R.bezierCurveTo(F+G-Y+Z*Y,D,F+G,D+J-Z*J,F+G,D+J),R.lineTo(F+G,D+U-J),R.bezierCurveTo(F+G,D+U-J+Z*J,F+G-Y+Z*Y,D+U,F+G-Y,D+U),R.lineTo(F+Y,D+U),R.bezierCurveTo(F+Y-Z*Y,D+U,F,D+U-J+Z*J,F,D+U-J),R.lineTo(F,D+J),R.bezierCurveTo(F,D+J-Z*J,F+Y-Z*Y,D,F+Y,D),R.closePath())}return new BoundingBox$2(F,D,F+G,D+U)}getMarkers(){return null}constructor(...R){super(...R),this.type="rect"}}class CircleElement extends PathElement{path(R){const F=this.getAttribute("cx").getPixels("x"),D=this.getAttribute("cy").getPixels("y"),G=this.getAttribute("r").getPixels();return R&&G>0&&(R.beginPath(),R.arc(F,D,G,0,Math.PI*2,!1),R.closePath()),new BoundingBox$2(F-G,D-G,F+G,D+G)}getMarkers(){return null}constructor(...R){super(...R),this.type="circle"}}class EllipseElement extends PathElement{path(R){const F=4*((Math.sqrt(2)-1)/3),D=this.getAttribute("rx").getPixels("x"),G=this.getAttribute("ry").getPixels("y"),U=this.getAttribute("cx").getPixels("x"),W=this.getAttribute("cy").getPixels("y");return R&&D>0&&G>0&&(R.beginPath(),R.moveTo(U+D,W),R.bezierCurveTo(U+D,W+F*G,U+F*D,W+G,U,W+G),R.bezierCurveTo(U-F*D,W+G,U-D,W+F*G,U-D,W),R.bezierCurveTo(U-D,W-F*G,U-F*D,W-G,U,W-G),R.bezierCurveTo(U+F*D,W-G,U+D,W-F*G,U+D,W),R.closePath()),new BoundingBox$2(U-D,W-G,U+D,W+G)}getMarkers(){return null}constructor(...R){super(...R),this.type="ellipse"}}class LineElement extends PathElement{getPoints(){return[new Point(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new Point(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(R){const[{x:F,y:D},{x:G,y:U}]=this.getPoints();return R&&(R.beginPath(),R.moveTo(F,D),R.lineTo(G,U)),new BoundingBox$2(F,D,G,U)}getMarkers(){const[R,F]=this.getPoints(),D=R.angleTo(F);return[[R,D],[F,D]]}constructor(...R){super(...R),this.type="line"}}class PolylineElement extends PathElement{path(R){const{points:F}=this,[{x:D,y:G}]=F,U=new BoundingBox$2(D,G);return R&&(R.beginPath(),R.moveTo(D,G)),F.forEach(W=>{let{x:q,y:Y}=W;U.addPoint(q,Y),R&&R.lineTo(q,Y)}),U}getMarkers(){const{points:R}=this,F=R.length-1,D=[];return R.forEach((G,U)=>{U!==F&&D.push([G,G.angleTo(R[U+1])])}),D.length>0&&D.push([R[R.length-1],D[D.length-1][1]]),D}constructor(R,F,D){super(R,F,D),this.type="polyline",this.points=[],this.points=Point.parsePath(this.getAttribute("points").getString())}}class PolygonElement extends PolylineElement{path(R){const F=super.path(R),[{x:D,y:G}]=this.points;return R&&(R.lineTo(D,G),R.closePath()),F}constructor(...R){super(...R),this.type="polygon"}}class PatternElement extends Element$2{createPattern(R,F,D){const G=this.getStyle("width").getPixels("x",!0),U=this.getStyle("height").getPixels("y",!0),W=new SVGElement$1(this.document,null);W.attributes.viewBox=new Property(this.document,"viewBox",this.getAttribute("viewBox").getValue()),W.attributes.width=new Property(this.document,"width","".concat(G,"px")),W.attributes.height=new Property(this.document,"height","".concat(U,"px")),W.attributes.transform=new Property(this.document,"transform",this.getAttribute("patternTransform").getValue()),W.children=this.children;const q=this.document.createCanvas(G,U),Y=q.getContext("2d"),J=this.getAttribute("x"),Z=this.getAttribute("y");J.hasValue()&&Z.hasValue()&&Y.translate(J.getPixels("x",!0),Z.getPixels("y",!0)),D.hasValue()?this.styles["fill-opacity"]=D:Reflect.deleteProperty(this.styles,"fill-opacity");for(let te=-1;te<=1;te++)for(let Q=-1;Q<=1;Q++)Y.save(),W.attributes.x=new Property(this.document,"x",te*q.width),W.attributes.y=new Property(this.document,"y",Q*q.height),W.render(Y),Y.restore();return R.createPattern(q,"repeat")}constructor(...R){super(...R),this.type="pattern"}}class MarkerElement extends Element$2{render(R,F,D){if(!F)return;const{x:G,y:U}=F,W=this.getAttribute("orient").getString("auto"),q=this.getAttribute("markerUnits").getString("strokeWidth");R.translate(G,U),W==="auto"&&R.rotate(D),q==="strokeWidth"&&R.scale(R.lineWidth,R.lineWidth),R.save();const Y=new SVGElement$1(this.document);Y.type=this.type,Y.attributes.viewBox=new Property(this.document,"viewBox",this.getAttribute("viewBox").getValue()),Y.attributes.refX=new Property(this.document,"refX",this.getAttribute("refX").getValue()),Y.attributes.refY=new Property(this.document,"refY",this.getAttribute("refY").getValue()),Y.attributes.width=new Property(this.document,"width",this.getAttribute("markerWidth").getValue()),Y.attributes.height=new Property(this.document,"height",this.getAttribute("markerHeight").getValue()),Y.attributes.overflow=new Property(this.document,"overflow",this.getAttribute("overflow").getValue()),Y.attributes.fill=new Property(this.document,"fill",this.getAttribute("fill").getColor("black")),Y.attributes.stroke=new Property(this.document,"stroke",this.getAttribute("stroke").getValue("none")),Y.children=this.children,Y.render(R),R.restore(),q==="strokeWidth"&&R.scale(1/R.lineWidth,1/R.lineWidth),W==="auto"&&R.rotate(-D),R.translate(-G,-U)}constructor(...R){super(...R),this.type="marker"}}class DefsElement extends Element$2{render(){}constructor(...R){super(...R),this.type="defs"}}class GElement extends RenderedElement{getBoundingBox(R){const F=new BoundingBox$2;return this.children.forEach(D=>{F.addBoundingBox(D.getBoundingBox(R))}),F}constructor(...R){super(...R),this.type="g"}}class GradientElement extends Element$2{getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(R,F,D){let G=this;this.getHrefAttribute().hasValue()&&(G=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(G));const{stops:U}=G,W=this.getGradient(R,F);if(!W)return this.addParentOpacity(D,U[U.length-1].color);if(U.forEach(q=>{W.addColorStop(q.offset,this.addParentOpacity(D,q.color))}),this.getAttribute("gradientTransform").hasValue()){const{document:q}=this,{MAX_VIRTUAL_PIXELS:Y}=Screen,{viewPort:J}=q.screen,Z=J.getRoot(),K=new RectElement(q);K.attributes.x=new Property(q,"x",-Y/3),K.attributes.y=new Property(q,"y",-Y/3),K.attributes.width=new Property(q,"width",Y),K.attributes.height=new Property(q,"height",Y);const te=new GElement(q);te.attributes.transform=new Property(q,"transform",this.getAttribute("gradientTransform").getValue()),te.children=[K];const Q=new SVGElement$1(q);Q.attributes.x=new Property(q,"x",0),Q.attributes.y=new Property(q,"y",0),Q.attributes.width=new Property(q,"width",Z.width),Q.attributes.height=new Property(q,"height",Z.height),Q.children=[te];const ie=q.createCanvas(Z.width,Z.height),se=ie.getContext("2d");return se.fillStyle=W,Q.render(se),se.createPattern(ie,"no-repeat")}return W}inheritStopContainer(R){this.attributesToInherit.forEach(F=>{!this.getAttribute(F).hasValue()&&R.getAttribute(F).hasValue()&&this.getAttribute(F,!0).setValue(R.getAttribute(F).getValue())})}addParentOpacity(R,F){return R.hasValue()?new Property(this.document,"color",F).addOpacity(R).getColor():F}constructor(R,F,D){super(R,F,D),this.attributesToInherit=["gradientUnits"],this.stops=[];const{stops:G,children:U}=this;U.forEach(W=>{W.type==="stop"&&G.push(W)})}}class LinearGradientElement extends GradientElement{getGradient(R,F){const D=this.getGradientUnits()==="objectBoundingBox",G=D?F.getBoundingBox(R):null;if(D&&!G)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));const U=D?G.x+G.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),W=D?G.y+G.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),q=D?G.x+G.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),Y=D?G.y+G.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return U===q&&W===Y?null:R.createLinearGradient(U,W,q,Y)}constructor(R,F,D){super(R,F,D),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}}class RadialGradientElement extends GradientElement{getGradient(R,F){const D=this.getGradientUnits()==="objectBoundingBox",G=F.getBoundingBox(R);if(D&&!G)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");const U=D?G.x+G.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),W=D?G.y+G.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y");let q=U,Y=W;this.getAttribute("fx").hasValue()&&(q=D?G.x+G.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(Y=D?G.y+G.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));const J=D?(G.width+G.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),Z=this.getAttribute("fr").getPixels();return R.createRadialGradient(q,Y,Z,U,W,J)}constructor(R,F,D){super(R,F,D),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}}class StopElement extends Element$2{constructor(R,F,D){super(R,F,D),this.type="stop";const G=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),U=this.getStyle("stop-opacity");let W=this.getStyle("stop-color",!0);W.getString()===""&&W.setValue("#000"),U.hasValue()&&(W=W.addOpacity(U)),this.offset=G,this.color=W.getColor()}}class AnimateElement extends Element$2{getProperty(){const R=this.getAttribute("attributeType").getString(),F=this.getAttribute("attributeName").getString();return R==="CSS"?this.parent.getStyle(F,!0):this.parent.getAttribute(F,!0)}calcValue(){const{initialUnits:R}=this,{progress:F,from:D,to:G}=this.getProgress();let U=D.getNumber()+(G.getNumber()-D.getNumber())*F;return R==="%"&&(U*=100),"".concat(U).concat(R)}update(R){const{parent:F}=this,D=this.getProperty();if(this.initialValue||(this.initialValue=D.getString(),this.initialUnits=D.getUnits()),this.duration>this.maxDuration){const U=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite")this.duration=0;else if(U==="freeze"&&!this.frozen)this.frozen=!0,F&&D&&(F.animationFrozen=!0,F.animationFrozenValue=D.getString());else if(U==="remove"&&!this.removed)return this.removed=!0,F&&D&&D.setValue(F.animationFrozen?F.animationFrozenValue:this.initialValue),!0;return!1}this.duration+=R;let G=!1;if(this.begin{const J=U[Y];return q+(J-q)*R}).join(" ")}constructor(...R){super(...R),this.type="animateTransform"}}class FontFaceElement extends Element$2{constructor(R,F,D){super(R,F,D),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}}class GlyphElement extends PathElement{constructor(R,F,D){super(R,F,D),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class MissingGlyphElement extends GlyphElement{constructor(...R){super(...R),this.type="missing-glyph",this.horizAdvX=0}}class FontElement extends Element$2{render(){}constructor(R,F,D){super(R,F,D),this.type="font",this.isArabic=!1,this.glyphs={},this.arabicGlyphs={},this.isRTL=!1,this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();const{definitions:G}=R,{children:U}=this;for(const W of U)if(W instanceof FontFaceElement){this.fontFace=W;const q=W.getStyle("font-family");q.hasValue()&&(G[q.getString()]=this)}else if(W instanceof MissingGlyphElement)this.missingGlyph=W;else if(W instanceof GlyphElement)if(W.arabicForm){this.isRTL=!0,this.isArabic=!0;const q=this.arabicGlyphs[W.unicode];typeof q=="undefined"?this.arabicGlyphs[W.unicode]={[W.arabicForm]:W}:q[W.arabicForm]=W}else this.glyphs[W.unicode]=W}}class TRefElement extends TextElement{getText(){const R=this.getHrefAttribute().getDefinition();if(R){const F=R.children[0];if(F)return F.getText()}return""}constructor(...R){super(...R),this.type="tref"}}class AElement extends TextElement{getText(){return this.text}renderChildren(R){if(this.hasText){super.renderChildren(R);const{document:F,x:D,y:G}=this,{mouse:U}=F.screen,W=new Property(F,"fontSize",Font$1.parse(F.ctx.font).fontSize);U.isWorking()&&U.checkBoundingBox(this,new BoundingBox$2(D,G-W.getPixels("y"),D+this.measureText(R),G))}else if(this.children.length>0){const F=new GElement(this.document);F.children=this.children,F.parent=this,F.render(R)}}onClick(){const{window:R}=this.document;R&&R.open(this.getHrefAttribute().getString())}onMouseMove(){const R=this.document.ctx;R.canvas.style.cursor="pointer"}constructor(R,F,D){super(R,F,D),this.type="a";const{childNodes:G}=F,U=G[0],W=G.length>0&&Array.from(G).every(q=>q.nodeType===3);this.hasText=W,this.text=W?this.getTextFromNode(U):""}}class TextPathElement extends TextElement{getText(){return this.text}path(R){const{dataArray:F}=this;R&&R.beginPath(),F.forEach(D=>{let{type:G,points:U}=D;switch(G){case PathParser.LINE_TO:R&&R.lineTo(U[0],U[1]);break;case PathParser.MOVE_TO:R&&R.moveTo(U[0],U[1]);break;case PathParser.CURVE_TO:R&&R.bezierCurveTo(U[0],U[1],U[2],U[3],U[4],U[5]);break;case PathParser.QUAD_TO:R&&R.quadraticCurveTo(U[0],U[1],U[2],U[3]);break;case PathParser.ARC:{const[W,q,Y,J,Z,K,te,Q]=U,ie=Y>J?Y:J,se=Y>J?1:Y/J,ne=Y>J?J/Y:1;R&&(R.translate(W,q),R.rotate(te),R.scale(se,ne),R.arc(0,0,ie,Z,Z+K,Boolean(1-Q)),R.scale(1/se,1/ne),R.rotate(-te),R.translate(-W,-q));break}case PathParser.CLOSE_PATH:R&&R.closePath();break}})}renderChildren(R){this.setTextData(R),R.save();const F=this.parent.getStyle("text-decoration").getString(),D=this.getFontSize(),{glyphInfo:G}=this,U=R.fillStyle;F==="underline"&&R.beginPath(),G.forEach((W,q)=>{const{p0:Y,p1:J,rotation:Z,text:K}=W;R.save(),R.translate(Y.x,Y.y),R.rotate(Z),R.fillStyle&&R.fillText(K,0,0),R.strokeStyle&&R.strokeText(K,0,0),R.restore(),F==="underline"&&(q===0&&R.moveTo(Y.x,Y.y+D/8),R.lineTo(J.x,J.y+D/5))}),F==="underline"&&(R.lineWidth=D/20,R.strokeStyle=U,R.stroke(),R.closePath()),R.restore()}getLetterSpacingAt(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.letterSpacingCache[R]||0}findSegmentToFitChar(R,F,D,G,U,W,q,Y,J){let Z=W,K=this.measureText(R,Y);Y===" "&&F==="justify"&&D-1&&(Z+=this.getLetterSpacingAt(J));const te=this.textHeight/20,Q=this.getEquidistantPointOnPath(Z,te,0),ie=this.getEquidistantPointOnPath(Z+K,te,0),se={p0:Q,p1:ie},ne=Q&&ie?Math.atan2(ie.y-Q.y,ie.x-Q.x):0;if(q){const re=Math.cos(Math.PI/2+ne)*q,ae=Math.cos(-ne)*q;se.p0={...Q,x:Q.x+re,y:Q.y+ae},se.p1={...ie,x:ie.x+re,y:ie.y+ae}}return Z+=K,{offset:Z,segment:se,rotation:ne}}measureText(R,F){const{measuresCache:D}=this,G=F||this.getText();if(D.has(G))return D.get(G);const U=this.measureTargetText(R,G);return D.set(G,U),U}setTextData(R){if(this.glyphInfo)return;const F=this.getText(),D=F.split(""),G=F.split(" ").length-1,U=this.parent.getAttribute("dx").split().map(ce=>ce.getPixels("x")),W=this.parent.getAttribute("dy").getPixels("y"),q=this.parent.getStyle("text-anchor").getString("start"),Y=this.getStyle("letter-spacing"),J=this.parent.getStyle("letter-spacing");let Z=0;!Y.hasValue()||Y.getValue()==="inherit"?Z=J.getPixels():Y.hasValue()&&Y.getValue()!=="initial"&&Y.getValue()!=="unset"&&(Z=Y.getPixels());const K=[],te=F.length;this.letterSpacingCache=K;for(let ce=0;cefe===0?0:ce+he||0,0),ie=this.measureText(R),se=Math.max(ie+Q,0);this.textWidth=ie,this.textHeight=this.getFontSize(),this.glyphInfo=[];const ne=this.getPathLength(),re=this.getStyle("startOffset").getNumber(0)*ne;let ae=0;(q==="middle"||q==="center")&&(ae=-se/2),(q==="end"||q==="right")&&(ae=-se),ae+=re,D.forEach((ce,he)=>{const{offset:fe,segment:be,rotation:ue}=this.findSegmentToFitChar(R,q,se,ne,G,ae,W,ce,he);ae=fe,!(!be.p0||!be.p1)&&this.glyphInfo.push({text:D[he],p0:be.p0,p1:be.p1,rotation:ue})})}parsePathData(R){if(this.pathLength=-1,!R)return[];const F=[],{pathParser:D}=R;for(D.reset();!D.isEnd();){const{current:G}=D,U=G?G.x:0,W=G?G.y:0,q=D.next();let Y=q.type,J=[];switch(q.type){case PathParser.MOVE_TO:this.pathM(D,J);break;case PathParser.LINE_TO:Y=this.pathL(D,J);break;case PathParser.HORIZ_LINE_TO:Y=this.pathH(D,J);break;case PathParser.VERT_LINE_TO:Y=this.pathV(D,J);break;case PathParser.CURVE_TO:this.pathC(D,J);break;case PathParser.SMOOTH_CURVE_TO:Y=this.pathS(D,J);break;case PathParser.QUAD_TO:this.pathQ(D,J);break;case PathParser.SMOOTH_QUAD_TO:Y=this.pathT(D,J);break;case PathParser.ARC:J=this.pathA(D);break;case PathParser.CLOSE_PATH:PathElement.pathZ(D);break}q.type!==PathParser.CLOSE_PATH?F.push({type:Y,points:J,start:{x:U,y:W},pathLength:this.calcLength(U,W,Y,J)}):F.push({type:PathParser.CLOSE_PATH,points:[],pathLength:0})}return F}pathM(R,F){const{x:D,y:G}=PathElement.pathM(R).point;F.push(D,G)}pathL(R,F){const{x:D,y:G}=PathElement.pathL(R).point;return F.push(D,G),PathParser.LINE_TO}pathH(R,F){const{x:D,y:G}=PathElement.pathH(R).point;return F.push(D,G),PathParser.LINE_TO}pathV(R,F){const{x:D,y:G}=PathElement.pathV(R).point;return F.push(D,G),PathParser.LINE_TO}pathC(R,F){const{point:D,controlPoint:G,currentPoint:U}=PathElement.pathC(R);F.push(D.x,D.y,G.x,G.y,U.x,U.y)}pathS(R,F){const{point:D,controlPoint:G,currentPoint:U}=PathElement.pathS(R);return F.push(D.x,D.y,G.x,G.y,U.x,U.y),PathParser.CURVE_TO}pathQ(R,F){const{controlPoint:D,currentPoint:G}=PathElement.pathQ(R);F.push(D.x,D.y,G.x,G.y)}pathT(R,F){const{controlPoint:D,currentPoint:G}=PathElement.pathT(R);return F.push(D.x,D.y,G.x,G.y),PathParser.QUAD_TO}pathA(R){let{rX:F,rY:D,sweepFlag:G,xAxisRotation:U,centp:W,a1:q,ad:Y}=PathElement.pathA(R);return G===0&&Y>0&&(Y-=2*Math.PI),G===1&&Y<0&&(Y+=2*Math.PI),[W.x,W.y,F,D,q,Y,U,G]}calcLength(R,F,D,G){let U=0,W=null,q=null,Y=0;switch(D){case PathParser.LINE_TO:return this.getLineLength(R,F,G[0],G[1]);case PathParser.CURVE_TO:for(U=0,W=this.getPointOnCubicBezier(0,R,F,G[0],G[1],G[2],G[3],G[4],G[5]),Y=.01;Y<=1;Y+=.01)q=this.getPointOnCubicBezier(Y,R,F,G[0],G[1],G[2],G[3],G[4],G[5]),U+=this.getLineLength(W.x,W.y,q.x,q.y),W=q;return U;case PathParser.QUAD_TO:for(U=0,W=this.getPointOnQuadraticBezier(0,R,F,G[0],G[1],G[2],G[3]),Y=.01;Y<=1;Y+=.01)q=this.getPointOnQuadraticBezier(Y,R,F,G[0],G[1],G[2],G[3]),U+=this.getLineLength(W.x,W.y,q.x,q.y),W=q;return U;case PathParser.ARC:{U=0;const J=G[4],Z=G[5],K=G[4]+Z;let te=Math.PI/180;if(Math.abs(J-K)K;Y-=te)q=this.getPointOnEllipticalArc(G[0],G[1],G[2],G[3],Y,0),U+=this.getLineLength(W.x,W.y,q.x,q.y),W=q;else for(Y=J+te;Y5&&arguments[5]!==void 0?arguments[5]:F,q=arguments.length>6&&arguments[6]!==void 0?arguments[6]:D;const Y=(U-D)/(G-F+PSEUDO_ZERO);let J=Math.sqrt(R*R/(1+Y*Y));GF)return null;const{dataArray:U}=this;for(const W of U){if(W&&(W.pathLength<5e-5||D+W.pathLength+5e-5=0&&Y>K)break;G=this.getPointOnEllipticalArc(W.points[0],W.points[1],W.points[2],W.points[3],Y,W.points[6]);break}case PathParser.CURVE_TO:Y=q/W.pathLength,Y>1&&(Y=1),G=this.getPointOnCubicBezier(Y,W.start.x,W.start.y,W.points[0],W.points[1],W.points[2],W.points[3],W.points[4],W.points[5]);break;case PathParser.QUAD_TO:Y=q/W.pathLength,Y>1&&(Y=1),G=this.getPointOnQuadraticBezier(Y,W.start.x,W.start.y,W.points[0],W.points[1],W.points[2],W.points[3]);break}if(G)return G;break}return null}getLineLength(R,F,D,G){return Math.sqrt((D-R)*(D-R)+(G-F)*(G-F))}getPathLength(){return this.pathLength===-1&&(this.pathLength=this.dataArray.reduce((R,F)=>F.pathLength>0?R+F.pathLength:R,0)),this.pathLength}getPointOnCubicBezier(R,F,D,G,U,W,q,Y,J){const Z=Y*CB1(R)+W*CB2(R)+G*CB3(R)+F*CB4(R),K=J*CB1(R)+q*CB2(R)+U*CB3(R)+D*CB4(R);return{x:Z,y:K}}getPointOnQuadraticBezier(R,F,D,G,U,W,q){const Y=W*QB1(R)+G*QB2(R)+F*QB3(R),J=q*QB1(R)+U*QB2(R)+D*QB3(R);return{x:Y,y:J}}getPointOnEllipticalArc(R,F,D,G,U,W){const q=Math.cos(W),Y=Math.sin(W),J={x:D*Math.cos(U),y:G*Math.sin(U)};return{x:R+(J.x*q-J.y*Y),y:F+(J.x*Y+J.y*q)}}buildEquidistantCache(R,F){const D=this.getPathLength(),G=F||.25,U=R||D/100;if(!this.equidistantCache||this.equidistantCache.step!==U||this.equidistantCache.precision!==G){this.equidistantCache={step:U,precision:G,points:[]};let W=0;for(let q=0;q<=D;q+=G){const Y=this.getPointOnPath(q),J=this.getPointOnPath(q+G);!Y||!J||(W+=this.getLineLength(Y.x,Y.y,J.x,J.y),W>=U&&(this.equidistantCache.points.push({x:Y.x,y:Y.y,distance:q}),W-=U))}}}getEquidistantPointOnPath(R,F,D){if(this.buildEquidistantCache(F,D),R<0||R-this.getPathLength()>5e-5)return null;const G=Math.round(R/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[G]||null}constructor(R,F,D){super(R,F,D),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);const G=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(G)}}const dataUriRegex=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;class ImageElement extends RenderedElement{async loadImage(R){try{const F=await this.document.createImage(R);this.image=F}catch(F){console.error('Error while loading image "'.concat(R,'":'),F)}this.loaded=!0}async loadSvg(R){const F=dataUriRegex.exec(R);if(F){const D=F[5];D&&(F[4]==="base64"?this.image=atob(D):this.image=decodeURIComponent(D))}else try{const G=await(await this.document.fetch(R)).text();this.image=G}catch(D){console.error('Error while loading image "'.concat(R,'":'),D)}this.loaded=!0}renderChildren(R){const{document:F,image:D,loaded:G}=this,U=this.getAttribute("x").getPixels("x"),W=this.getAttribute("y").getPixels("y"),q=this.getStyle("width").getPixels("x"),Y=this.getStyle("height").getPixels("y");if(!(!G||!D||!q||!Y)){if(R.save(),R.translate(U,W),typeof D=="string"){const J=F.canvg.forkString(R,D,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:q,scaleHeight:Y}),{documentElement:Z}=J.document;Z&&(Z.parent=this),J.render()}else F.setViewBox({ctx:R,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:q,desiredWidth:D.width,height:Y,desiredHeight:D.height}),this.loaded&&(!("complete"in D)||D.complete)&&R.drawImage(D,0,0);R.restore()}}getBoundingBox(){const R=this.getAttribute("x").getPixels("x"),F=this.getAttribute("y").getPixels("y"),D=this.getStyle("width").getPixels("x"),G=this.getStyle("height").getPixels("y");return new BoundingBox$2(R,F,R+D,F+G)}constructor(R,F,D){super(R,F,D),this.type="image",this.loaded=!1;const G=this.getHrefAttribute().getString();if(!G)return;const U=G.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(G);R.images.push(this),U?this.loadSvg(G):this.loadImage(G)}}class SymbolElement extends RenderedElement{render(R){}constructor(...R){super(...R),this.type="symbol"}}class SVGFontLoader{async load(R,F){try{const{document:D}=this,U=(await D.canvg.parser.load(F)).getElementsByTagName("font");Array.from(U).forEach(W=>{const q=D.createElement(W);D.definitions[R]=q})}catch(D){console.error('Error while loading font "'.concat(F,'":'),D)}this.loaded=!0}constructor(R){this.document=R,this.loaded=!1,R.fonts.push(this)}}class StyleElement extends Element$2{constructor(R,F,D){super(R,F,D),this.type="style",compressSpaces(Array.from(F.childNodes).map(W=>W.textContent).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")).split("}").forEach(W=>{const q=W.trim();if(!q)return;const Y=q.split("{"),J=Y[0].split(","),Z=Y[1].split(";");J.forEach(K=>{const te=K.trim();if(!te)return;const Q=R.styles[te]||{};if(Z.forEach(ie=>{const se=ie.indexOf(":"),ne=ie.substr(0,se).trim(),re=ie.substr(se+1,ie.length-se).trim();ne&&re&&(Q[ne]=new Property(R,ne,re))}),R.styles[te]=Q,R.stylesSpecificity[te]=getSelectorSpecificity(te),te==="@font-face"){const ie=Q["font-family"].getString().replace(/"|'/g,"");Q.src.getString().split(",").forEach(ne=>{if(ne.indexOf('format("svg")')>0){const re=parseExternalUrl(ne);re&&new SVGFontLoader(R).load(ie,re)}})}})})}}StyleElement.parseExternalUrl=parseExternalUrl;class UseElement extends RenderedElement{setContext(R){super.setContext(R);const F=this.getAttribute("x"),D=this.getAttribute("y");F.hasValue()&&R.translate(F.getPixels("x"),0),D.hasValue()&&R.translate(0,D.getPixels("y"))}path(R){const{element:F}=this;F&&F.path(R)}renderChildren(R){const{document:F,element:D}=this;if(D){let G=D;if(D.type==="symbol"&&(G=new SVGElement$1(F),G.attributes.viewBox=new Property(F,"viewBox",D.getAttribute("viewBox").getString()),G.attributes.preserveAspectRatio=new Property(F,"preserveAspectRatio",D.getAttribute("preserveAspectRatio").getString()),G.attributes.overflow=new Property(F,"overflow",D.getAttribute("overflow").getString()),G.children=D.children,D.styles.opacity=new Property(F,"opacity",this.calculateOpacity())),G.type==="svg"){const W=this.getStyle("width",!1,!0),q=this.getStyle("height",!1,!0);W.hasValue()&&(G.attributes.width=new Property(F,"width",W.getString())),q.hasValue()&&(G.attributes.height=new Property(F,"height",q.getString()))}const U=G.parent;G.parent=this,G.render(R),G.parent=U}}getBoundingBox(R){const{element:F}=this;return F?F.getBoundingBox(R):null}elementTransform(){const{document:R,element:F}=this;return F?Transform.fromElement(R,F):null}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}constructor(...R){super(...R),this.type="use"}}function imGet(B,R,F,D,G,U){return B[F*D*4+R*4+U]}function imSet(B,R,F,D,G,U,W){B[F*D*4+R*4+U]=W}function m(B,R,F){return B[R]*F}function c(B,R,F,D){return R+Math.cos(B)*F+Math.sin(B)*D}class FeColorMatrixElement extends Element$2{apply(R,F,D,G,U){const{includeOpacity:W,matrix:q}=this,Y=R.getImageData(0,0,G,U);for(let J=0;J{Q.addBoundingBox(ie.getBoundingBox(R))}),G=Math.floor(Q.x1),U=Math.floor(Q.y1),W=Math.floor(Q.width),q=Math.floor(Q.height)}const Y=this.removeStyles(F,MaskElement.ignoreStyles),J=D.createCanvas(G+W,U+q),Z=J.getContext("2d");D.screen.setDefaults(Z),this.renderChildren(Z),new FeColorMatrixElement(D,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(Z,0,0,G+W,U+q);const K=D.createCanvas(G+W,U+q),te=K.getContext("2d");D.screen.setDefaults(te),F.render(te),te.globalCompositeOperation="destination-in",te.fillStyle=Z.createPattern(J,"no-repeat"),te.fillRect(0,0,G+W,U+q),R.fillStyle=te.createPattern(K,"no-repeat"),R.fillRect(0,0,G+W,U+q),this.restoreStyles(F,Y)}render(R){}constructor(...R){super(...R),this.type="mask"}}MaskElement.ignoreStyles=["mask","transform","clip-path"];const noop$1=()=>{};class ClipPathElement extends Element$2{apply(R){const{document:F}=this,D=Reflect.getPrototypeOf(R),{beginPath:G,closePath:U}=R;D&&(D.beginPath=noop$1,D.closePath=noop$1),Reflect.apply(G,R,[]),this.children.forEach(W=>{if(!("path"in W))return;let q="elementTransform"in W?W.elementTransform():null;q||(q=Transform.fromElement(F,W)),q&&q.apply(R),W.path(R),D&&(D.closePath=U),q&&q.unapply(R)}),Reflect.apply(U,R,[]),R.clip(),D&&(D.beginPath=G,D.closePath=U)}render(R){}constructor(...R){super(...R),this.type="clipPath"}}class FilterElement extends Element$2{apply(R,F){const{document:D,children:G}=this,U="getBoundingBox"in F?F.getBoundingBox(R):null;if(!U)return;let W=0,q=0;G.forEach(re=>{const ae=re.extraFilterDistance||0;W=Math.max(W,ae),q=Math.max(q,ae)});const Y=Math.floor(U.width),J=Math.floor(U.height),Z=Y+2*W,K=J+2*q;if(Z<1||K<1)return;const te=Math.floor(U.x),Q=Math.floor(U.y),ie=this.removeStyles(F,FilterElement.ignoreStyles),se=D.createCanvas(Z,K),ne=se.getContext("2d");D.screen.setDefaults(ne),ne.translate(-te+W,-Q+q),F.render(ne),G.forEach(re=>{typeof re.apply=="function"&&re.apply(ne,0,0,Z,K)}),R.drawImage(se,0,0,Z,K,te-W,Q-q,Z,K),this.restoreStyles(F,ie)}render(R){}constructor(...R){super(...R),this.type="filter"}}FilterElement.ignoreStyles=["filter","transform","clip-path"];class FeDropShadowElement extends Element$2{apply(R,F,D,G,U){}constructor(R,F,D){super(R,F,D),this.type="feDropShadow",this.addStylesFromStyleDefinition()}}class FeMorphologyElement extends Element$2{apply(R,F,D,G,U){}constructor(...R){super(...R),this.type="feMorphology"}}class FeCompositeElement extends Element$2{apply(R,F,D,G,U){}constructor(...R){super(...R),this.type="feComposite"}}class FeGaussianBlurElement extends Element$2{apply(R,F,D,G,U){const{document:W,blurRadius:q}=this,Y=W.window?W.window.document.body:null,J=R.canvas;J.id=W.getUniqueId(),Y&&(J.style.display="none",Y.appendChild(J)),processCanvasRGBA(J,F,D,G,U,q),Y&&Y.removeChild(J)}constructor(R,F,D){super(R,F,D),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}}class TitleElement extends Element$2{constructor(...R){super(...R),this.type="title"}}class DescElement extends Element$2{constructor(...R){super(...R),this.type="desc"}}const elements={svg:SVGElement$1,rect:RectElement,circle:CircleElement,ellipse:EllipseElement,line:LineElement,polyline:PolylineElement,polygon:PolygonElement,path:PathElement,pattern:PatternElement,marker:MarkerElement,defs:DefsElement,linearGradient:LinearGradientElement,radialGradient:RadialGradientElement,stop:StopElement,animate:AnimateElement,animateColor:AnimateColorElement,animateTransform:AnimateTransformElement,font:FontElement,"font-face":FontFaceElement,"missing-glyph":MissingGlyphElement,glyph:GlyphElement,text:TextElement,tspan:TSpanElement,tref:TRefElement,a:AElement,textPath:TextPathElement,image:ImageElement,g:GElement,symbol:SymbolElement,style:StyleElement,use:UseElement,mask:MaskElement,clipPath:ClipPathElement,filter:FilterElement,feDropShadow:FeDropShadowElement,feMorphology:FeMorphologyElement,feComposite:FeCompositeElement,feColorMatrix:FeColorMatrixElement,feGaussianBlur:FeGaussianBlurElement,title:TitleElement,desc:DescElement};function createCanvas(B,R){const F=document.createElement("canvas");return F.width=B,F.height=R,F}async function createImage(B){let R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const F=document.createElement("img");return R&&(F.crossOrigin="Anonymous"),new Promise((D,G)=>{F.onload=()=>{D(F)},F.onerror=(U,W,q,Y,J)=>{G(J)},F.src=B})}const DEFAULT_EM_SIZE=12;class Document$1{bindCreateImage(R,F){return typeof F=="boolean"?(D,G)=>R(D,typeof G=="boolean"?G:F):R}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){const{emSizeStack:R}=this;return R[R.length-1]||DEFAULT_EM_SIZE}set emSize(R){const{emSizeStack:F}=this;F.push(R)}popEmSize(){const{emSizeStack:R}=this;R.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every(R=>R.loaded)}isFontsLoaded(){return this.fonts.every(R=>R.loaded)}createDocumentElement(R){const F=this.createElement(R.documentElement);return F.root=!0,F.addStylesFromStyleDefinition(),this.documentElement=F,F}createElement(R){const F=R.nodeName.replace(/^[^:]+:/,""),D=Document$1.elementTypes[F];return D?new D(this,R):new UnknownElement(this,R)}createTextNode(R){return new TextNode(this,R)}setViewBox(R){this.screen.setViewBox({document:this,...R})}constructor(R,{rootEmSize:F=DEFAULT_EM_SIZE,emSize:D=DEFAULT_EM_SIZE,createCanvas:G=Document$1.createCanvas,createImage:U=Document$1.createImage,anonymousCrossOrigin:W}={}){this.canvg=R,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=R.screen,this.rootEmSize=F,this.emSize=D,this.createCanvas=G,this.createImage=this.bindCreateImage(U,W),this.screen.wait(()=>this.isImagesLoaded()),this.screen.wait(()=>this.isFontsLoaded())}}Document$1.createCanvas=createCanvas;Document$1.createImage=createImage;Document$1.elementTypes=elements;class Canvg{static async from(R,F){let D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const U=await new Parser$1(D).parse(F);return new Canvg(R,U,D)}static fromString(R,F){let D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const U=new Parser$1(D).parseFromString(F);return new Canvg(R,U,D)}fork(R,F){let D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Canvg.from(R,F,{...this.options,...D})}forkString(R,F){let D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Canvg.fromString(R,F,{...this.options,...D})}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}async render(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.start({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0,...R}),await this.ready(),this.stop()}start(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{documentElement:F,screen:D,options:G}=this;D.start(F,{enableRedraw:!0,...G,...R})}stop(){this.screen.stop()}resize(R){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:R,D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.documentElement.resize(R,F,D)}constructor(R,F,D={}){this.parser=new Parser$1(D),this.screen=new Screen(R,D),this.options=D;const G=new Document$1(this,D),U=G.createDocumentElement(F);this.document=G,this.documentElement=U}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__awaiter;globalThis&&globalThis.__awaiter;globalThis&&globalThis.__awaiter;globalThis&&globalThis.__awaiter;globalThis&&globalThis.__awaiter;const bg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbwAAACNCAYAAADM4c9jAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABvKADAAQAAAABAAAAjQAAAADzprXxAABAAElEQVR4Ae2dd3Ndx3n/0UkUkiCIRoINJEWKtOXEtib515q0iTNOMsnIM7El9yLbif/IG7D1BpIZZyzZcpMcSeNYk+IUj1McyxlPEmtk/2JLIsUOkAAJgOgEQHT8Pt/l3aNT7z3nFtQ9M/eec7Y8++yzu0/bcqqr8lxra2vVo6OjLTU1Na08N6+srDTwXEeW6jzZdkrUWm1t7dLq6upSdXX1TFtb2yQVn+V5bacQwNXTUcBRwFFgK1EgVnBJ0E1PT++/d+9eD0y9YStVaCNxRSFY4Bo8duzYxEbi4cp2FHAUcBRwFIhSICLwXn311XoY9gmStviTY7nM1tXVLcDUlxCIO96KgR7VKAP1y8vLuyFHk59WvE+/8cYb1x955JFlf7h7dhRwFHAUcBTYOAoEBN7Nmzcbm5ubT8l1KZRw14lhDxE+/vDDDy9tHJqbu2QEXP2dO3cOgGW35KCwlbXX1dV1mfeFzY29w85RwFHAUWBnUMATeLLsTpw48aAVdvX19eP79u27AcNe2RmkKL2WCL66qampY0tLS62ClhN6FxwNS6etg+Ao4CjgKFAqBYzAg1FrccppgBk3Jgx6qL29fbBU4Dsxv2g5Pj5+GOu4U/VvaGiYQnG4shNp4ersKOAo4CiwmShQI2S0QIWbEXay7JywK76JUBbWWLE5gOCbEpTFxcV9CMB9xUN0OR0FHAUcBRwFykGBGlkkWo0pYJqzkxuzHIB3MgwJvY6Ojj5ouyo6sHLz8E6mh6u7o4CjgKPAZqBAjfbZ+bYeDLn5pvI0C3Rc5jckaKxujazkLE8pDoqjgKOAo4CjQFoKsI+8xiywUAatxkyb0aUrTIHJyUmPnigWHp0L53QpHAUcBRwFHAXKTYEa3G12ocqs23pQXvI+8MADC+zTm89BDexrLG9JDpqjgKOAo4CjQCEK1GjztBLBmN1+sULUKiIe+hq6YkkbOhcBwmVxFHAUcBRwFCgDBeTS1NmYVazOdBvLy0DQMAhLV/bkOYEXJo57dxRwFHAUWEcKaFuC3Yu3448LqwTdWalp6ept8q9EOQ6mo4CjgKOAo0B+Cph9ePmTuFhHAUcBRwFHAUeBrU8B487c7NX47ne/28jVxvL+FjZy7wLfWlyx1cw7VuMy1LL/NVyG2vO2gkGl8z8XCGN74b17HPM19/73v39xs9fR4eco4CjgKOAoUFkKbFqB96Mf/agV4dbNr0mCjZ8W1hhqSMjpx0HXVQg0hVUj4HRocy3vOvhaefYrja5//Md/nOeaRGhOvO9975szge5vU1Pgi1/8Yg0n1tR3d3evPfroo/rmoHUNb2q8HXJbgwIo0bUowu6c4K3RXGXDsppT/t8taNokvdFHimGdVf/nf/7nUbZKtPGLuFubmpqMoPPXPifwvKBC71iC85wocxsmOrEeTJRjxY5SZgd1W+3s7Px/HqIVfhAtn3322X3c132xDCtTV48ePToV93kkCbJf+7Vfq//d3/1dCTFzEk2YFE899dR+ziA9Du6mD2DNL+/Zs+cqDGomnNa9Owrko4D627lz53ZxfGIjCnAjTp8m+mcjeerpV7c//vGP38qX38VtLwpsGgvvhz/8Yc8///M/d8maC5NYgk4/e4WFmg1Pc0fY7SZd79/8zd90Pf/884OPPfbYdJp8Wy3NM888c4QB3bEReCPgq65evbqAwHrDr1R861vf2k37nh4cHKz/+te/XsVvgbaceOKJJ27508GQDlthJ/xpszo27uv4u4sbUZ+tVCZ0q37hhRf24NHQ+bh7oN0i+0GvxSkfaeulKYXZ2VlNJWyqi35Wox9XLfWs2b17dw31rkWw1dGvGgiXt6eeL5gYvPEWVdG3vDrQ53QYhBN4HkW2/8OGC7z//u//bhwbGzuNBhbBRS5JzvYMtEJY2ClNOCyQwffiT8dgaKLDP/Cd73znLs99222ej7rt8VV93R9hvLteeuklWZfe/CnMqYt3z+JUGlzR3ViiY4TbDfrC1UujF12ki/SP+zE7+1+uORh5MwKpGWbe/LWvfa2Ftve4Os+7Ll26dAgq3SiGUhKgKE9nGSMRRbQYeOXOA14GpO4SaLpL4bLh+cojXSNTJ3WlKAP54Lu4zUeBDWUiP/jBD9qGh4d748hihV0hgeYXYmE44bg4WHT6PaQ7++1vf/vKhz70odkwDPdePAWGhoYCTBJa741jRMzFBlybMG747Fogb/FYZM/51a9+tZ4+sRc8PMGRHUp5cyDvq2XF6Ec/ruO+C1o2YL0Yy0t0hWaamogruB3BOFSMUvfkk09W9/T0xAKNK2irhV24cEGK4cRWw9vhWxwFNkzg/cd//EcX/nTzlYY41OXClMDST4LKXnFCy8aF72nTwizEQM7gCrr+wQ9+cFt0fhikVq6GSbKu71pwYguE4Yo5y8UUvpbCjBi8q+MEYzhjJd5xc+/FLXaS8iNzyJUoLwtMoaSfFWy6p7nIUw3t9X3GgTTpd1IaFATNlWyLMb+T2q3Yum6YwPuN3/iNETrbsBD/3//9372ao0G4eRN11u9uKybXZloBpjx+ISmhqcvezQt/fnhiCsSfwCU08MlPftLgZdNtxTvMcBK8NTm/IRflz2t1pS0c5SbJxXrXptkMd1yDx+gLm07YlUobFKD7S5xLBbQN8sN3VvnNoeTOHjhw4M42qJKrQkoKbKpVmt/73ve66ISJ346LE3oSYhJcrDA1P6XxL3CxdFA6CVEEq/ndvn07IgCtQGSF6JVPf/rT92e6LYAi7xu1SlPo4qZtxloy5jECx7ilRB/7TJI9CKb2cNVYWDLGAgAJTC0yiVjh5NG856jyYQ0F3F2spqxCaKzSHtNYbp6JiSLRS/I25fFfwJmhjHt4Dw0c3Xk/4E+jZ8pcgWmP0UZeeTaPwoCzun///nHKLHolZ84KfShc9lZ+V1vxG6c/m/bKWhfyVrO46F1Z822G9PT9ZfrIIv1jYdeuXfPUZZ73uY985CMLCLx05vFmqIjDoWwU2FQCT7VipeaJubk5s4dOAshvqSleDNteEmwsf686ePCgDUp9F+wbN25Uvfnmm0YQKqPCdDEwVrq6ui68973vLflA7Y0UeKYyef6ee+65A0z0Hw8nQbAMfvSjHx1iLqsJQXI2HI9ScgcGmnoRhJjmN7/5zXeQr6IeBeCvsZ3hPLj7F8CE0U98//KXv9xC/jOJCbZGxBJ0mGXcTNOfJ2knz8ouFn36wT76gVY3V+RCCEkx06rSwIVQmiI8cV5dSg7XCvlXSSeFaBVlaeXIkSMrr7zyyhJbEgJzwwHg7mVHUqCiDCgrRWGMNQg84/qywkcw9CzBZ4WdniXo9Cv2EoyTJ0+an6y9n/70p57gY6DVDgwMnELjf9NvpRRb1k7Px766ZgRJxfsaDLCaPqT+U5TAwwpoIP+WaS6Y/SJ9VVs77rW2ts7Qp2fD86HlqEzO21EWj0ccPgjUdtouIvAIm/rEJz7hXI5xRHNhRVGg4kwoLVayAjgR5e24EwM4+YWdhJR+Dz30UKzbMm1Z4XSyEP/wD/+w6rXXXjM/lQkj2Y0LVKbjQDi9e89GAYTdun38lv7juTyzYckxPbW1DVgIkWzgP0Rf2NC5RlayrtH3V3E1y2pZcafPRJrJBTgKFKRAQLgUTF3BBGxROA2zems5pq8sWXZW2L3rXe+KuDl9SUt6lCCV1fhv//ZvVbhVteG580tf+tKdz3/+8yW7NktCbItnho770dbXpRYoTkW78HDvarNyBE8E4V36wLY8oCBSWRfgKLCNKbApBB6bP7s54iz2i+BW2KkNJJAk+Cp5qTxZexJ6uDqrOX9Tm3avV7LM7Qz7G9/4hk77iNuOUPZqa87nM5/5zORnP/vZomDLwotzaWLxe5vniwK8BTNpPlMu3nVCvTmB7o2aP1wPHFjwtIg7+N56lOXK2DgKbLjA00kHCLueOBJIuNkVl5pvs89xacsZpnJ/7/d+r+pf/uVfJPTaGHTDzGO4Q6eLIDLCLrIKVGAQTqNY0UNxIHHbnSU+sOkbOIswpYtx6RV2/vz5VRYpLDPnk5SkYDjuzAaEXiQdq/oWWQgTCd+uAdCxTot34oTQetYZa1tH463L8XgTExNUd+3/6Hduoct6NvI6l7XhAg+mdyKpznaRigRdMSsxBVdbEfyCM6msuPDf/u3frvqHf/iHKo4906Drj0uzmcMYwDWsjuzGVbwHGkR8dWwpqItz4cH4O9lGsF/54+rHarj9xDeH4ySUtJ3hwx/+8JjipMxwrFWsO5NFdYmuYqzCNWCFwVdVYkGGvxBoEbFoCFveaUyQsVb0PKifnlvpmXaufvnll9Xfox1vK1XE4ZqXArEMLW+OMka+8cYbDezZMqsyw2D9QqoYYac5OAkrznOsevHFF421Fi6j0Ltw4Jw9zeWJ+W85JoBlehLcD1IPuYu1qT/wi2PwOZrIb6yzRmOXogNTilIAlt6Bp086Hc/tudOWjzYxkhxM74awu7fZLGZW5NaGrUohTF13nDvTayj34CiwzSiwoRZef3//kSR6WvelhE4xAu8nP/mJ2WBu4dutB7/+679ug1LdZWV2dHTUPsundsigzdhb4vr+97+/i68S7N0gZOUGHkfYRaxA4YPyUNQm6ArXJWLdqbxyCzztfUTg72Ne0GyWh0ajfKJmQ1eAVpiuDryjwKahwIYKPE78SJyQ9rszi6GWBFz4igvzp1G8fnKD2p+2KOQu7RPaMgKPesQycFuZSt9h5FqsohNZAqeryD3IcU7G5VlpHLLAZw4ndoUmMLwOkAVeXFo+j2QsYMVBF5ME9/F+VgK/sZlWAp8+fXrtypUrcVXY1mGsJdg6mzC3dUtUrnKZBd6rr77a9PDDD5e8gENwLl68aNxdsuL8l//dCj5/fJpnWYgSWv7LWo3+MD3z7baqn//852Yrgj/OJ+z0tfVYa8Wf3j2/RQHoVceKyVEsPTF3rXQ1jczzwGbczE+fa8DyeqsCuSfqUTaXJnWP9CHCqpkTlXt402x90edyaLcrokmEIKEAcK9Gce2iHnnTovyskXYIhSeiQEB3udwDilGumHEWEcUeFUceLYYS3QpelDuGV8Gc2OLfp8nexir7TpqFzdgvC1bOJchEgUwC75/+6Z+a6Nxnf/azny3RgWTtTL373e++K609U6kkRqM2q/ck3KxgsYLOL5hsWFb4cl1qa4H/0h6+8CVBp+PFCl3Ud5fmebbDoLDtBdOQWy0yxybmBKPR1xZi40WrQjAsPZmrG4V2Yzptpbe3d6kcx7VZ2OW8a0sC9Y2AZGl+2QQe85sRWqvAYpW6CLJlDMidrpIXoixW+IE+NFxI2C2yveda0ue3EK5rwIgIPHkIOMg91v1Nnxql/HYUkh76YnRprQ9z0hzgJ8VrECUsInB9Sd3jNqdAJoEHLdpzwqmeTmaWDP/iF79YxVqbJk7m1BTWX6oORQc0J/n7hZ3/uVS6awO59tPJetP14IMPRhiLPUszbVm4PIRzrMaZFsYmSDfM0v0B4ZF0liZL0m99lLM0dfg0GvCDYZxpuzEYR5/Cc18xf1s4jf+dviJX0aammzad+3G2z9S/bALPwtzqdxS/Rs6IPUw/iP2+Yah+42wnuVFuRTHXp+6wEngChfUwFlrkwHE/HopHSLY+/fTTt5544ok7ufz+JO55B1Agk8BDIDVr9aNfI0UrrqHz6OioVgms//mf/5nDKjPWXz7XJ2kDZVthV06a2y8oJMHUUWL2SlO+rDzSb2rGbevj7tkoICsFiyKSiQVLTuDlqIIlVo8lfIipgnbuEVr5AxgrK9D0BsrVuD+83M9yvwKzj43yo+B0lF/iJ7HgU7UIviPUo530Nz73uc+5sVzuBtnk8AJCpxCu7NuSZZc3GfFNaH7yrR/6r//6ryU6/SRuj6nf/M3fDLg+YS6ptkRIwFbiElz/HJ/ftary0gjASuC1HWHC/Kr15ey0dZMrtVA/SwsrbTr6bOyiFf83/dLC2m7ptJ8Sb0gXY6KTtiw4bmm7KcZ3P8IulbenHPSS8AK3C1/5ylc6JJTBIVEiSyjyO4N3YgzLfhD37brhWY66OhjFUyCTwFMnyieAwkKD9PV0wg42I3cg/FZ/+MMfTiMAp/hm2tTQ0JA0s1g3kr86+crzp8v67Bd2yusXcAzWNXAH9eDgpn6pmXZWfDYiPYM9tv2pd3Qyq0gE2UR+6Jlnnunu6ekpiXaywNjf9+40aAh/NPnBj33sY3dSptc33yJ9kX6grxHs2JV7EnTXrl3rxGXYBT0LCjraaJl0A/bggTS0L2eaXFuNYMFNMFZ7UGLyujkVT55WXPe3Hn/8cefmLGdjbFJYsQwvCVc6SDVWnve5nnA6v9AIx1nXJ8yolZNLtOghkan64Ugw6V3CtJyXvwwLF5xWCe/n00CTX/jCF9bYtN5M+UeIN6vBqEMizhbGFrvHEhU6lE3jpb21gq8kYZeVpuBfS1PpSxepBB7tHEsHmPe6uDMZVzVaEJW1nmnSY6Hq696ZhDa4NDBf3cX8dzvtVwMdChaFxTSCFXhbx7sVTFzhBDmLrY96jM7MzBylL+R1czJP69ycFW6TzQK+cE+OwVRfDS9mM7gFJWHDIEoc4LLq/POEpZZny/XfwwJU7zAeb86BgavkcpO8+eyzz8qd08OcoFna7IezlZ/FCGBUkSpA/7IxLTHMSAHrEJCx3Ih1JxSx8FrSWpWlVAlL+zi/UkAk5sW6XsPKHmJz+63ERL6IF154YT8rqHtZuCQXhy8m/pE0d/kW300WpZRy8HLSvEVSeDwyoVBwMm5OrPdOxvYheE5iX8y5OU8A4pchMO51G1EgsQPE1VGuPoWH3YFxafOFWWFj7+G0Enh+C0yrKct9hctW3a5fvz4RLkfasVYsEn6NAVQZrhQudB3eZVFQt8ixbqID2n1JjGYd0C9rEXgcYgVeWQvZIGCyrmnTg2xu14KrghfWjs5XLWiRA3MRAXL1U5/61KUShV0VFtkc8PolPLnP6o7A7VN4QYQLJND4ZWvDMHV6naSFFtAUii9Qmove7BTIZOEhJFbQRGskkCT0/FZYlopaYRa3OdzCEXytstSl9NpeoC8mlOvy7/UTTAbZIlZddJlerkA+ORMRhuXCZSPgoMXrUOcIYxOzyUeHrLhSxjJMLFM/y1pGXHoYXeqN3NQ51qUZB3erhmHBqI4FadLS0jI+OTmZb2+b3N3DnORzp5z9BOGm/Xaxe+7KQfOcm/M61u4ono2j9I/AObES4AjvWwjHchTnYGxSCmRiRDAvdXbDHHQEV1jgyWqywixNfZU+KY8EnoSS4nWpPD1rf105LsHWT8JbFx2+sP+mHAVvAhiy7qDvoThUYP7B42niEmUIw5XUB3PpAm4mb0KGIiJJYe7LWAjRs+UiKe8HgJ8OUkiI3R7BLBRLVUGstRXcuBI8Xf6aSyAw/obwtoyVU9D5y1iPZ51bSlufl5uTdj9k+yX95SbviQrveuDmyqg8BTIJPDr8XVAyCzgkKDS3Zq2wLKhKcFnBKKEj4RZ3hefu5NpUvnJZehLYVuDFlb9dw8bGxrpxR93XJHyV1IAfHh4uq1sHzdocSOArZtM9wgQnWNnXrXmcTYdcGRCCqa+wUno+LSjGxQhj0gg8FJYFxuhtTkkZp3+kEpppy9modLl6DKP4TTAWDiHMV7Dstsw5uRtFt+1QbiaBhytAh/56mp+18iTAdFkhZl7y/PnTKa/f0vJnUzoJQ78lKaGnsLhjwvx50zxLWKsOumB2mWiRBv5mTMPg3oWlHntot9oX7b1sC1Y2Y/3jcBID5HoTrV+nBzXR7yKu3rh8WcMopwlFIzKXRnvMMHdWtpWxfrxk7XLSyR1Zbv7wfM+aq2aP2lX2z1brC/KiD1sNAlnkJWDu8zB0S3WeZSDzOr/kvDdy5dzOuTYNBqonD33mxf3tCApkYvJ0kHscR7WqeTxRRwLJzq1ZoWep5hdqNizurnTKq19cnrDAEwyFlePyW6cw+zoGL2N7e2ixSfSBuepUnMglpgBj1OKcghfnSzbh9jqshNAtuswzAYLoy6rBRtxHZV8kAmNfYs/YvWLdbbS73FnDCaiXJZiP8R6BXp1hYLTJMHPEm8rCYKGWwQe8wuiad+aAe8D7/iR7bIrNEwieQkYHd7fSP87vRKVu87TGxmKSSeAJVZjiJG4v76BXuQRldYXdjEkCLFxdmy6fa9MKPSsQlaccl99yFDyYsehREU27HPhWEgaWx1BO4y1YDExbrj/j/kOIFUyvBPo+H1bDSZhPI26yVHmyJBLMw4cPL2B5XJViliWvS5udAvSXRpSk7Bk3Nkf9iRMnxLtGNhYNV/pGUSDzQgIE22BY4Egg2UOa01QknL9QHmvR2Xz2XihfoXgJWXsJJsI8swJg82/lO9bNAqeSpLLuiq0nruPjOUFZLIiC+RC+u1hheKJgQpdgx1IAN21gdeaOJcQOrXhmBv+2t71t8e/+7u/uMtkb2MNlhZ5WURYSSNZSC9Pcb+UJhnV3Kp3/OZyvlHdbTg5+avdcKWVuprxy5e3du/dqzqUXQA3moM+2BMKKecmtCm0pJm/WPNRjt/acVeKDqhw43II7V8dRLXHwwthGfeqIpfUae4ekQCDkx1lOrxWG6UztrARNSI91tyX3pGKZlt+9kEAjF7z5KFAUN9NS8zihJvemLL1yrHy0QlF3/6/cJPRbeXfv3q3IYoVy41xmeP1JLkCssnkYaurFDnnwWldFAqFU9vL0GSSY5Wno0Q6zPzg4OPh2Frkcy1PnikQh7LSq8DS/FoRcLQpJx7OcBFSRwvIARRm6BQ6z/NbCv6Rs4XTlfk8q1x8O3yrPAgA/UPe8ZSiQ2cJTzTTXw8dgOf95qDtcUwknzelpfky/OMEYzmPf86WVENUiEysIbZ5y3VU2wm9dteRy4Z4FDkx7GoVF82/13IdYhZe4DUELQJ5//vlrnEfYu1NWsSbRkoVaWqQRUIgk/KDPxGOPPabvQVb80mHOV65c0RmhgQvcDjFHOrGeFmfOgo58ORlrvoEFLW8P00rC7fTp07/Mfc4ngH85XthW0oTF+0C+fkrfH0z6CG05cHAwNj8FirLwVK33ve99g2xmjT25QUJJe+gk+HQPC6l8gi0NycLw0uRJSmNh6c7B2Nte4MEcF/hsy+soI68h7AaT6GLDxcxZyv1LvnbwOgzjjZjfVZt2u95h4i0w8NjVrWwnWLc+w5FvWkYcWSki4cKB5+tubca1N8KuOyzslA6BN14pYYfSsRf4Z/IJO+JusPK0ovPUcfRwYZuLAkVZeLYKfDbkPFrb22dnZxOXTWpuTz+5DvUrVthJIPmFk56LhWXxD9+xIHeEfz/HNFPPweTmh2KVG4RBtV1UFKZnoXcYo+idekN0GB59YHc+JhdOX8w7Vlw17syjCXnnWOwzw8b1hOjyBuNZWcGSGYJukVNyaKM9+oL9Rn2aRzXNWXexWxWam5tTfbkiK8VwK7fBf46jiAWsbwtHliW7YK7ZbRY23N13JgVKEnhyedHJ38DSezvzX3lhySVp5/YkqPzCyj5bIWYFW7hJlM7GCVZ4W0E4fZp3C09pX3nllR25JSENnSqRBmY0zQkX14uF/fTTTx8nb95vnhUL2+bTEVQ8my0YNszesZbXfbEIC1SG2APZhoCLrDbUZ25we05VypKy9U6669SSBMEzVwlXInTQkXWHUQBiUSJuhZXXV1AUZmITuMAdR4G8QioNNaR10rFef/HFFx9CCEUWC1gh5oelML+g8cclPfuFndLIqihV4PnxwP+/LAGeVL4L33kU0EIV+oXOW4yr/Li+sh0XUckwWdusFu3HajkTLoe4Wub4jhBetBIRhpn2HVq1Miccq3yA13BaOGnS0R7VTz311GHSRjbx2/yUuYrw7eMw7CWt2u3u7jaNiMvV3PFMrb3nPe/RtwLdmLdE2wH3kgWeaESnWUGzfJ2Va2dZveWdopFVqOWjtwSeX+hpbrDUg6StxalyYSBFu9by4b3Z4mACjdKMy4UX7V2WPlQufMoFR0yVgwiOYz1EzAcxSbZyFJz/LBcuYTgStLg274CajkILX23MaY2t10IaFQ4u9Vjrx8KI5N7ndFYp88YJ0dmDZXUzXhOFnSDSfjUI4JPwpKrGxkbvdCbbnCgGVfqJjsxR38iOhcuxFSkQGczFVkJuFAbZa21tbaMSTP4rreAL5/PD8As7hcvC8wssf9q0z/78MLFt9XHXJBrAmLQfTtpxWX649SIrdZPK3krhz7LUH+ao46giF1Zf6lNpIpnLFICrTgI31gXPnNYxMfwyFZUXjBQDhM9x+lWs4oOwGWRsGasqL6AMkZS1P0PyvEmlNGj1a95ELnLbUKDsg+KP//iP+zs7O7UKMPPxToUEXpjqWgVayiUr0V47ReDZ+rp7MgW0wRzroCchxZzm0RLi1i1YUwlY67EDACbegBUUWdhSCeRwLXZBq71xsFF0K7Jlg7EamTqJKz9tGKtfy84H05bt0q0vBSrS0NoPxIA8j9/8AoJvJmydZa2i8tufP6++dJDWevTns89W4AkGe83WfT7G4uHuxVGAT94UlzFPLmn7WCwn4pJgWazRn/V9v7JaLHFlpQnTykNwSjp0ugt33Vtn56UBmDENh2F3QKskxWDp7NmzsQI5YzEuuaNA2ShQEYFnsWOv3hyC7yJLpX8Oo7jB4JhFcCWe3JEkvMhrQQbuSs/WiEBY2hfltZ8GgnHe9X82JC0Ml257UUDuuYsXL/ZSq6BPPldNLKdB+nNmz0WFqXQDvGPHFPgeU50qUb6EHa7dpO0a2nfXX6nVoliU2s7iLkeBzBRYF991TiPWPhxvLw6a9G5cCbvw8dcjfBiXa41sbeiSIJI157/s8V+KC18SWhKIWRew+N2hDM7E00bC5bn37UsBju06yr6+WPccfXiKxRcjbKPYVASQoobwGUwQPk25bRVlXSWZQtjdAq+KHeHFftkbrLbsYNxmUthRAPbI3bupGtAhs64UWBeBF1cjtD+tivRWRn7nO995uxVoVujpLmEWFoBheLLyJBT937cLpwm/W8sQRrb0J3/yJ+Mf+MAHwkm25XvOBfbW5GWJtQTeLuaStBR+3S8U/bJZL7kzKmM3TVPHRZaxbxpXZpjQuDZHEUJt4Bk5oJv+fYhl+ZPlOkwbN2l7gnA1aDFmJ/iG3v2vKocRLdN7zsrO7C6FRifA3Qm8MrXDVgSzYQLPT6x///d/39fX1xf4ErQVemmF2M9//vOqhx56qIpT7P2gY59l3dnTQThO7DZMYcfsxUHDXcBKKZv2Xel5otgGLHMgG9g7ERaxHYfwNbwQ1yrlnitHVei/a+yD60cBOEf7BpQAPCc1TCXI9Xi5lLLYo1qDF6UHgZG4HQBazY6MjPSVUo7L6yhQSQpkcglUChEGieZNIpeEXSHrzp9JQu+1117Lu5BFglTpdOG+WpB27IfhnncWBV544YX9BSzUG5U4JaTcVKYfz1OP2NWjctPi2vQ+2py1bH28l7NUz+QTdsCcY6vEZXd4Q1bquvTrSYENF3h8deFo3AktcmUmLVbJRyBZbz/5yU+8BSnhtD/96U89gcim6QFpx+E07j09BbAqNqwPYb0EJ3tzaMN4U7WpviunL0Ek1RYBMshcVNkUIpStgPWVVG6x4Tdv3hyCJt40gR8O7aRjxzJ7dCQob926dQ5YiSs+ZdkxVi/haoxdPOPHwz07CmwkBTIPgHIi+4Mf/KCNQRo5LULzcVqEImusmEsbymXFyTrkC+3GzSmYsv7sykxcPyNoxUlLuospdkvkgSHu46SVWEFRTAVQGJqBGcmKsCi4ko422ItL9MFI5hQBlFvLL3ZfQkdHR6qOw6b5Y+AZK4SwitQ/Yi2mOPSgQQ3CoYN8sXNECIUafrEbpumvBWkVV2Y4TNZV0rFj4FXHvLUOG+gL50t6p58cpl55T+WhDWcQdjqvsmLCDhx06s0BXLPaHxnbXkl18IfDT5rB1x9knu1xY5EIF7DtKLBhAu9f//Vfm7HGItq1FXbloLQEn4ScfhJ+etfFoJllocoAv3IUs6Vg5IRErKAopiJxwk5wECQF9zUiAOpgQGXtgzD2e2nn28Axyv3uE2EcYTfAlxBSkwSGrEOMtVQ/MQ+0j8RBgzUEdNm2OuQ7doz6HmCub0juzwgioQAUESlFeYUd9RmFRje4RzWeELxSXiXsoO0xxm0pYKrihB1hy8xpp1KQSircZd4UFEga8BVF7u///u9bEXYRzV4uTFlkWebtLKKFrEEbTwdfYuBfq/QgtXjtxDtCcL6/v39dPooapi/tPBgOS3qnDwyE4+gb05z7WMyKzESXX7gM/zsCb7zc1lG+Y8dQ+lIpGMAAtdV8gmwAOvWvxziSZeenWTmfqWNqK76c5TpYG0OBdRd4fE6omxNOToarq9WVEnbFXmEhaQWchad3NMQl9vppriH1t+Bs/q12p67JpkaFK8NG/j7/4oXz588vF2CeZcGIOo9l2f8Fw9b+S0/o0Udm+G7beipDSyhgqQV0WiJJgCK4b4TTI5ym2DKQ6sxYwWBMeftmLSxgLOAKvohVVNa9fRZ+3J12jZrGcQkzhkH7GfrASMZsLvkWpsC6CTwYYA3C7gzbAXrC9LLzbGEhFU6X7z2cNywAybvY2tp6MY07J185WyWOucp5hMy6CnYsuxUY4vXwqkYJP1yNY5WkHVbA0PDwcITJFypTjBvPwmvQ6gJfgC9l4UVWt9gcQumSNo4XwrGYePq5jh27RXtwW12EPn0w9yu857PaAkXhhbmtvDaQvKN8JeLCen8Wib5Tmi/TVsB3p6/e5Tuemejhy+4etygFqjnt5N3Cnc48xDaAsmubli5aIQYTPsVJ7s0STn6BpGctUpFL0y+4/M+Ck+89HOdPz7zKLAP32kZYduPj40cpv4MBtsqh2v/P0mM97tojR7v28ivbnF0c3hJ0tOEkmr9WNcYycCk8R44c6QaXVtJpfqikCya4JkbIR0/n0NRHKPf+BG1JUIvPLFqDxykg5K0b1soCgu6OLAtokVr4FI9ZaTlRUmunp6f30YfnN4rG+p4dc/sP0M8Ce3Wz1gweAIi1eeg+wgHgY1uB/lnr6NLnp8C6CTyLhjaZDwwM9LIloNYv9BQvt6Z/o3lYiBXzTie/9Ud/9EdDG9W5N1LgWZprAQKCoSLWPJv9V/iQpiy7Tc+8LT0qdYeZVr/00kv1Q0NDERccB6mLPityFVaq/O0MNx9t09Rb9H/00UeXXD9NQ63tm2bdBZ4l5fe+972uycnJQ1h8hhFL+EmgaZWmBF/Y2lO+LAIPTfoeJ2T0/87v/E6qOQuLV7nvm0HglbtODp6jgKOAo8BWpECqFVuVqNgf/MEfaNJ7+G//9m8PsnKsk8UkBhcJNW0el+CT0NMvzeUThnJtDQF/0mlzaSjn0jgKOAo4CuwMCmyYwLPk5YOxOmj2NhbfHqy9Hs62bOJXrT1zOu9Slp+EngSgfnEX1pzcRNO7du0a+63f+q2ynRMZV5YLcxRwFHAUcBTYmhSQwNPcAsZQzK7YdawTFtldintTRT7//PN7cUe2M8+nBS61HP9Ug/Az8yItLS2rCLYlhN88wvAecdO///u/P7NZrTkfXXf8HNc6didXlKOAo4CjQIQCdSzqWGZ1WT0r3vKuLovkrGDAY489pk3LG7JxudzVQmDXS5eAvrGrF8tdnoPnKOAo4CjgKBBPgRoYsdlng1uwpCW/8eBdKMu5DV1RLJzAc93BUcBRwFFgAylQg/VhVjGy7Lf51Vdf3TRW3gbSpGxFX758WR9HtXvgCp4tWbaCHSBHAUcBRwFHgQgFdIK798UANgYX/c2sCGQXUMXJLh492V/o0dmRxlHAUcBRwFFg/SlQAyOewe1mjw/qxtKrXX80tl+J0LGOX7dqhrtYpzts6Ekg24/CrkaOAo4CjgLZKCCX5horIgeVjcUrdayGPJoNhEsdpgCCThv6j0Nbs6meVaUD4TTu3VHAUcBRwFFgfSlgGDIHwk5QrJljYlVhG18z6FlfNLZPaRJ2nK5yGGFndsxzaO9UW1ub2xu4fZrY1cRRwFFgi1LACDxZeXy/7JpdsSlXHMd+9XJ37s0MDQu9ZCGfYF60U9lwFS+gTFzPAMIldRRwFHAUcBSoEAUCh9zevHmzke+BnYJRN6g87dHjNkT4+MMPP+yW1Sc0AoKuHhfmAaL1NQCjJEjYdXV1XeZ9ISGbC3YUcBRwFHAUWEcKBASeytXWhGPHjp3gMfCVYRj3LIsvFjjdZAkGv+NPDYEe1dqsD012Q47AmWe8T7/xxhvXH3nkkbJ/x2sd+4YrylHAUcBRYFtRICLwVDsYdjXfwNrP0V49MHVj7W2rWleoMrLquAZRGDQn6i5HAUcBRwFHgU1EgViBZ/GT4GMBSwurN1t5bparUys5ic+bz+bf5nd9gHRJJ6hg7M2wMEX77GZ53vHW7zZvd1c9RwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBRwFHAUcBR4H7FCj5u3Zf/epX65ubmxsFbnZ29t6nP/3ppc1O3Oeff37v0tJSDXjOf/SjH53fTPh+97vfrT1//vzaF7/4xdWNxku4DA0N1X3+859fWE9cvvGNb+zh+4ttKpNvDg4XaqNvfetbu/lWY5fS8z3C8Y9//ON39eyujafAl7/85Za6urpV+MLcemOjfrG4uLif6y5jam6jxxTjqWFiYuKA6NDQ0DAR7tff/va3m/no9l7Ff+pTnxqmL1eUB/jLO3369J1HHnlkWWXb60tf+tIuLjMO4/C16bLc9Y3VLN8MRb407d69u/HDH/7wWL5yvv/97+/i2637oN9EPhmkj7mWdLVwzc3NnRAQHq9x21Rf+6aTSRgvvv/9718RjrpmZmZ6YaSMw7pBXodM4Ab9SagwKPVx3T3z8/N7pqammru6uoSTcKv4pfJRVOq5Grg30Ll2oQw0gk8juDTQ4ddI8zr0W6w4MrkCoEcjbdOuVz6wO84tr1JCmnoGkkkP7vdIn0ngaRCqrFKuLIO4lHK2Ut6nnnpqP+Osl49GV3/ta18b/8QnPtG3XnRSvx4bGztFP9pFP646derUZWg3vZH0u3PnDnKj4VAOB/XTQL9eWFjQx7ZN/Msvv3yH+IoKPH95fX194tsBgcdHrXchQAw+3IVrAF/eM11qk2eeeeYB+sLEJz/5yeFCmb/5zW92wIeOwg+qyDsHDxLNYq/BwUHh2cZYPohi81qSclOywIstvcRADRQ66rFiwbS2tr5mBdz4+PhpCTdgXvvsZz+77sJYzJRGrkPLrKPh6vntol67Gfi7l5eXJVTqbT3p7OYR4dNJA99JK2SkyQomg6majllN/mo6Sg0duho6VlNOHbBr9aNc8yNebV9P+bUqlDRVKl+dS5fFhXs1aXoIum4ituEfFuWv0k73iV9k/dBEL5TLitFAR3AfKRKVkrI1NjYOfOhDHxopCQiZYWqyuA9bOPTN6fUSdhpztMcJCTuVj0J057HHHqu4sJPn6O7du8YisvX23xmXdeBmgmjfzqeffrrVHw+eu+24u3LlyhHi7yf2J8o9P/HEE/3rRc+Y4osKmpycPEn9msncTB9vwMIdyFeHGzdujB06dKiTNLunp6fFg67EFSz+B/8ydIfXDyUJO+XdlAJPjJuOYRhxXAULheG+MBo7QkMCxdSRgZyoHRSCFxfPgO4Fx3oG1TKdtxpCV9Nha+yduBre677+9a9L2FSBRxwYf9gSeWeAN4PQmnn00UdTu4YlRCnjpISWLiu0gGXe7V0vGnD60YlMnP8PfDXAlohbIM89WUuiG1ZfSZqdvww9QzsxQk/Qh+N5lwA3F4L5IOmN9WbDwnfS1Nv6gPcB0mtQJV1LaJcDSZHFhlNuLQMt83j6whe+sALuEcZGe0YbqFjkMuSTkpQheSSpxhyMTcJ6j42kX45Rn0W5qm1Y3H3Pnj0LaZW8uPw2DOX2MDzEuAah7Sr94y4CcJ+NL3RHOZ2xCnOhtP54CSz1P3+Y/1njzl7gtYe09jXu3pYv/sknn7xBprcAxkHYZGHUXwLuFGjV0yadGAINjJnr/GItWYXTn/rhnWfIu0/9J266gjhjhUL/xdu3b8syTrwCFCdjzV/91V/lY0QRQEheMX0Trmf5fSOJ8gQ89NBDK2HfMYx/jkEy4M+mCquTUKlJBs8MBNtLur2ETREXdmEZAspFKBikXYbJlZVp58qv426sIXAwQgT8DNrgpfknfxUkaORWXQL/BZ7niTf3uIGOtRDIm+8Ff/80nUGwJGTXgGsGgp7BY5XyVhFeq3omTsqEGfzgPk3Zo9wXEbKLwFkmTcUHkcqnHE+o5asb6fIySeUljR9EEy/6xV6iOxGBvgVtBunD1dCpFpodVEbupp+FgSSlIX1vT09PprEj2C+99NJr3O6b1bnCmBqYYZAHcMxF5b2JptTPKAc8j+bqmjdPOJJ6hMdSOEns+49+9KM6FM2D4C2NPJAG2h4AbqIgsIlzdS7o6rLp4+4ItnbaqNPGQYMaLCsz5WLDUtzPkyazgox1N0fZmo5IusQrDR0YhxMoF4G5ccKaoZ3t78PwwMBYJK6JNEaQJxWwmcPlAUGAvYlC9AB1kTXbevDgQRkO13jntlaNgeC1nepCn9D4Fm/TVMsRlNkxfx3pVzXwr/0KI808Y7CDNF4SpmRm8FjM2oD7kir3hsTdg0Z/ykZmvdOYR/TLku/SpUuSyNJWvAtTV0wpIKAw7wFdJ4F3F8KN0LHlgtpLn5n53Oc+FztIsHSsljfjAS/DgwY3LgdDO3CaRrCqoxvBQoeUUFklfJUGWGFeTGbXUiWFiToLZbyepmo5898IPPCb++AHP+i5ebMI2TRlJaWh3LvQKzDY/Wlp410aEArjeRZ63jdd/Yl8z3R4WdHGqlOnLwA7IFwE5jOf+Yxx4TEYGxhgVuCZfuYrxjwmpfnKV75yADwzC7wwfL1jXYjZZma4smKouxF40GSS9izoVogrP20YtK7GNdVCG7UzjvfLM5M2b1w6zRfHhacN0wIZ0h5Nmz4pHQpHrMWRlN6Gw4fEZxJ5TQ4/I/Do3+P0u0mbV3cYdRc3I/CYcxwKGwLwQAmDLSvwVEdZ8BJ6KAen6Deas2xFyB2nL/URrf4j70/gIs68M760HiMQT34vLfGiTYA+yAcpjvECz8u5DR40GGFCxm0gQvD8K7ZavBthBVM4SLg6WeBCWE0ywd4fCPS9oMlqvsyE0GhDdNyCWvF6CRMfmpv2EVoEFJwwohrYtIFRnLgPxrkx/Hnk6qAdTiuMNr2DclHyHJQffppnFMXhnIJl5hLA51ZYQ7dwSNsEnkYr7ejoKIq5WljrfYdZ1bLSUIxqD3RvZZwZj45lPNxnqPeQ3IKFcNNiKWj2AHkapMXjOg9o74Xy++MR9k3gojkiK3QHaINxf5q4Z/CsxjN1lLxGCVS7vfe9701UxuJg+MPAQ0pPrOKjBWF2ugEe1CCc/Xn9+a5du9ZIvDxC3kV+0ct7L/Qg+LTFWxIhlEE40A9NKPcmBLLhizYZtPC8MKTdnRPYNjpwl4LPuJ4LBCa8yF1MP7rC+oozwJUQa3vhhRfGMCJmuru7YxU94O+ijWTNGQPCgs7ll2K8SHyAXkrDWAsoy4EK0vj3RkZG+iywNPcmLpAwZiiFj7BiM1WlLey9e/cGLDkbXuqdwaiFL6axRShwizR8UjiDJuiLDCEDXK8jnDhxIraBbBbK0KIVo9WRb6EQ87b5Ct1lZaJV55urigXBgKmnfiYO3HYxKMxAj02cECgXas6qTEix84K1bJpBvICFaBctTKHxx44FNHmrpS6Ftfgw5exy63B43Dtt20ibmij6eyvLzlNNL2jOuBCz0hJ2tOWj1K/J1388NOAB07gOh9L2b+Zn6mBuJ8CzAWa1Bu+5KkboAczwYBf5AMsIO+D1U5/RQiA0NlF4jzEuzRhAOIyhvN4ulC9fPLRR29o+EEjqF1bQ8oilYyBR7oU6nA7H+/PH5QmHkf8Uinms8FVa2szLAi16rRJvA8HRPmra5lA43ou8/6A1B78MhSW+qq3hPZfhI5qf8y8qOq9Mahs/j4GHnuZdHshRxtqgBQyMd4Gb2v0GC3k8j4bGTZziEhB4MjfJGNCyKNhwRwqL1USRzKvIOCPw5C/92Mc+NmGR8d9xpbXSIZf8/lR/fPhZDJ2lsnJRmIvGNkKGQdUoWHRO84683a13m449gXdFTPDtAHc16j3KDdSJuEOqF/e4+b8qfMV5hbBPUyvIsJijoT1qjgk/6iA8ClqDti757izDFeM5lS9NoThoKSvDWBqF0vrjqdP/8f7WaPFHluH52LFjU7S9WbRz9uzZvAqFipPSceHChWt6Pn78uCdkGAz1ML7Ui3+Uv8TLU7/pc+qfHi5+uPS9Jvqecdf6w+Oeh4eHG+nrR+Li8oVRRrufYeVLC3wxkFhcbb7HH398DkGtMWODzNiiD02SfxJmM0eZ1Tdv3qxJWoRgM+asxFP0X2n3VYynfsZswXa2+e1dYxh32DHGeBuwRE/NX/fR5gUtO+H67LPPSthZF+OUVj4i8Cz4ou7ANW0LnbRYJmBdgKOIZwSQ4pTGXwjvZgW1wqiL15f8abbTs8YmfeGC+LWtF2tA9sLDDyLg1B9u2PAsd2A23Lp16xz9dR46XvHzgIDA8wOl09YwodgF0+ikEaUteVLVny7Ns2BR8DEGRh1IzLGA5EKhfDm34UmbTh1aF7i0A8fMU+idZ3VY02n1znWeCmuy0whLyr1NRw4IYbS6bgaGrL4Z5guH72dL/8+cnVk+TAfNyyTSQ9yZKSWQaJ/9MJmAC1KaGW24hqvpIHuXPP97EpXk/qEtjHvolVdeuav+1tvbe5B2Uv+9TYcvSWtPKjccrpW1DNQ1MTaUJsPMw2n0Tr9rpN56zNR/qKMm7z3mIAD+SwyTeGPVFUoLDtq6koijH66egbeGS6sfpbab+k0xzzWVU5CNNk6Sdrwq3SwjX4T+V/gFmLmFp7bxLU8XXGnsAYXUps1311w0vOQk+Y3iCz3XsECuMZ4D82JxMKCRFkccJ85YYtBCm8Cvq45x6dOGAVcC2OADzNtMiwz582Ic7Ld7llHUr4SVf+rTRXpj/bMR/EIh698PO98z7TxNu0VWLxK+D5wNLwXfG9Q/oByioDfS1ocEG9oOQePIWESp6iBvYN4sHy7hOL+wUxywKMbM7bUwdkcZu5nGiGCwz/qw2oIxuMpWtECd8gm8VZb37kWDqwOBLhhQ6n1hKtR/HT169ADENWVBuGl/XKFnygb3tXmZ07kBusRdmlM9xNEqSaMZ8uwNXhhlZw7uEsx0kkoXKiZrvGGuENSUnTVzOdJfwd/NxtDXC8FCg22CdpoUVgeYQEEYxS3wgPJB2zto17N07ON6h4YjdJaA8FF4+GIgxzKzcLp87/SnRuaCToFfAwO9GYu13zJJ4mrB4xQ4N9KWbX/xF3/x5p//+Z8n0po66TSPbpV37ty5OwieFRhPgwQPQYdgjmswtADzyYeb4oB3hAFnmI8/LYrUWyaOP4JnMUzmHxcpd5c8EaFo80rdtDDGjrtMgxn4/dA+0UMAvlq0ckoFMS5uwiw8F08YF9LKtf2OcHi+99yijCvhNKo38DSHpsVGu/wr7/xp5YlBCTmsNArnPjUwMHDTnybNM23bRv2Okf++Fnw/k1Z2t9CXPK9QEixwbaSvGyYNDPXlJWD2kDc2C+NEC5gSaWkzwS811swr8CPtRN29PnHkyJG3/IUWQIXu1HGB/h9RBKivaQcVS5q7pAl4tthXuIq722DFfOscfDQCA1oWLeziqqs+xhgaY/wdACeNv0tx6ZLCZCHSN4zXqr29PWIh2oEXmx/G2A8zPCfGwSDtIdH12IR5AhkE8pN3UQHjcgBmRNPIk12+Y20pkNVWCw6/SqfWIpGR5557rgcG3on1dl75abx3WzhoHavqeOQdhWglaW0Wpr3nVmiaXi1hYcPX+54TDnkHjTRKOqwRdtBiRvOzuAsboKFBl4G8Iu2aORBNBh/l14nmWSMmZIVPXL04aiwuOGvYCn3DWittMIAGaHv1xz/+8aosANrNMAfS3Mkn7OIKVZtz9WFtUe0aub97qOMK7vasfS9RuMWVqzA06TnoKEZiNP1wOhiHUZZy4ZkEXhjWZnpnXvcmLsIaaH1ANNfcGPj1CUcpN9qbR5xZRCYlljSDCO9hxWe56JfyFh2kjY2wA84M79zub2hOAwth5CWjn6jvWwXZC/c/MM7FQwoKPLb4NFk3MuPuBMLAD0aWsMdvmX8/GxMvl6bJExcfAMaL6g5vzMyTw3Aq+U4dm1D+YtcaiP/QB8bD5VOvQWjVCi32oETsR9AGPHTh9PadPDrR54jeaeORODe5X0Oy+by7JD5I2U7ZJuS9yJQPDIJ9CDujSVCRCesGSZm9qGRoCTf37dt3kQGWicGlKcy/UARf86ZkWNoLicZ6Su4TDWjacJZ5rqtJQiwnCAZUf9K3Hz58+BxtbSby09CkmDTqB1ioF8HNaI3cWy5fvnxG1oE6umDSb8YYEAVd6aTzBBNWo1FwgLHGJtTr1Mdo2ihHR3C5Gbgp8R1n0NwI/ygrLz4wPLM6kXLNqrJwWdTTjqElrIaAuyWcdiu9i94f+chH+m17QqcD9KGj9MNjKKrnbJsyJqWkvQmjtnwlUzXVh+mfsjKXUMYH6buXgG3oSNlr/BaTfgi2+5oemfWclM6GZ0KMxLS9x9jhdfIwBH70CY/fhuP0Tj08SRwXHw4DTw9eVlzXMf0+aC1lOvIDB+MuDeOicUH6W9BDW7xiFcdwHr2j4OokG1mpS7jcb8Wl8TSOuEiFHThwYAjtrEONwS+ziUmjdAkOd/nYb+u5mIvl27IypdWkcqfBUA3jKaasAnk8hrUewrsALoFouctwBXbB3LVgxwgB6K5l+jdpOyMIAhl8L2JACIQ58mrlnE5uOQWzmmIQD+VcWb7U5XmEfrLyrrEC8BDMqxsczZFrgs7zlBhoIbyVVgKP/HoMXGKOMF3NzZylPnLhiSFFXE2BTLkXGPMsNIkoTDmXpLwdsRdleP3ur//6r2WlBrwA1Nf0H3DKrCyRpxV3j2AmXX7msI+0RtFMSOwx14T4zMFqK+hzi3EqOoveZuGYBQRNx+AnN9XuNqyYu+Z4advX1b70zSr6qQGDJTGPADyfBJO+0E7cMcXDUK8W6tfAfSftlVqoMNYGWG0aUYhwZdbz02Zr0XyJPWiXEdoRGhDeDoyDwo/7BWB5Alph9iJdL/EtjNPYeJtuK9/x3N1hcdxYlr6SUyCl2NcxdiP0FT0KCjwVSEfRyd2H+O3ReXFpz6XLLWU2PnU6452wjzhLg7D6ywxemFteN55gYtZ20VETLRTizGCn07ejFcT6oHFjDIYnlXP4GoalzsaAiF1+7K8Xrg3P+qBcWV4F8/jzQ/Oljxc4/V/7Y1AmOmA0BjaMRpbaCvcbdIJxfn6Qic8qh7Y+D12OU7+9oiFw90HPOfAYZguJFirEdqREoAUigKv5Hx2pJo3b9EfK11c3zOkLBbKbaISdR2Mm+wOCXYOAfniV9qwGd08YpYFbTBqUi3so2tTHywAAHhpJREFUDpp41pyp+qAn8BSGq8+49ah3ZoEHXbQ/MRVaEjbqB5W4qEc1zKhehyFzbm09StZu+otOCWmmD4YRXKIPjdG2YzAhM0eEUNQc7THgzOMGHC6mT0nYZa0bOEiRM9nS8JGs8NXXwnk0NilLB2gbnsOUTh90iJ2PZpx5Y4t+vBi3aEW0h4cYXkh/iGp5YQQ2+B2hPYLXRYsevYu+orYP8Gf1Cfblvd0mgieYR8aLuZPeuHsZU52ESXExF3Q1Y5++10u4N/ZtPiVimqEf2WM8SeHOeR9K6F9Io1WIAd7hZI67CLxQivhXNDpj3ZFvpbe393Z8qnShMDXTyDqGq1AOytVp+4nuK4hjQICXmWSPg2c7aEycEXh0NmnavTHxgSC/5YHQb6HMgpPqfgDgKiZ90R+mZ61SYwDrdHD9DG0UTtialAsOXr0NU8isAeYG7WUpNjClw3RO1VMLEnrlLqQjThE2Eed7V/lZLhajNDJneBha7wVvLyt1FnPwOq8iECKx7g/FkddraxbzdEvgKNxeDBJtNRGMvfQfudVjGY5NX8od3NdgSLIitQJOCojnWqH8Vvql4biyILOWI0UAWiW2KbC1iMtYgLTRPcpITAtugLp/Ok0WPGThoiS+nbzVCLIqbbvlWQqW+VlY0EH9ZBQrfUo0seHKD2M7letXWk2tvnvdxlfyDuPbBX3MGEExWaavV6w4Kfsou1rR2moLoZ/eSmss2Dy6M9a7pdQBS18b0Kb/eoVD/wndN/OVU2Y8QS5cmU/Xlo0I2vSJgvJI/ZZ0EU1OPIMrAlMBlOWl9wrA/dEJo4x1l7BSTvmknel0hT0MaL2bi0l4CQ373EGcsZhgMFr2bFbLELl09erVHn+++7nv/5Nuls4X0AL88XomzS4qtAoBC2o1dAgJiftIhQGlfKczRbQ1mL3cNPeXYaWEU6lk0ENWrKfpqBzoMwHPu4U2YzTpuLL7+/uXmc+7qTgGUaKVoYEJ/AsMXK2I6+KnJcqiqQaw7pHJZsJSXblN84eA12Ez0IdWcZ+OQvdO0ThneXsLBWAWB23aAvcuv/AMp6UvizYVE3gqD/fVBLxVAm+XNHzrOqN9DuRkkI6am87KcBmfN/NZ+/RPb5Um428Q+B79wnRQXybsHeHwQu8af1giYrTGmwCttUPYHDZOfef1o69oVaMZP/RFDyTCrgVhdxI6GL5DXx2T2xqLx0tTyQfwMooh5S+CsyeEy1Em9dY5xC200R5+++nLnjUJ/CVZdsUIO+HGOG1mTBjByV3ufp2NO2gt5nLgv9EwWFm9ypjvrwQeLIjzlEtP4NFIxoWVtUCI72XhWR/utAsO/OE61NY/v+DF6QEmJyB5BR5pWuhEAeuODlwtUzinRXgwc8IzLzwvcYYHmNQKjXIhQxbtE6wB9zPKA32mwNnT+NPA4TDUqCpExpMnTw5evHixlQEA2OpRFuloVVJBZSBn9Y2kKRu4Ygpj+lm3KQxuP4P3dpr8cWkk7FicIgvBU8dgfNN4EG7oQ7MwU1nAsqIlzD2GTf+JpYPKAE8PFs+gaL76oKjIRVkB6y+SIBdAm9XFHYSOG6+euKRsJryzs3NS1rDaBsF3gMAZWTZYM0YZpE+M5WibF07WSPoWRd5XZllQVVaG7scFy+UWdJykH9xDYC0Uqou8ETDtHuqvwycMKNrzLu2kFcItKNF+8IFn5uRmCsEPZMjzQplGOafcguMkD5jYKOpwAnoYNx3lmDTgvYBgGmHeMtVcFHiN0zcMc37Pe97j9Xf6m+YFx6ChTqRZRDiI5qn6sRChrRpl0BikfH+UJ2vRhPDcRpqARwBjxvtcEeVpTthYlj4QBjZ5/UFFPefauOw8O4yMJ/BomGUqn6UjyNoRdzEDW4DtsxqDwRcgXrhg/zuNnDetrEqS7KXh/YxahwRXw1jO4a/1Oocfbrmfc50s0SqKK08CmYFuokRjtlRkyh8HU2Hy7wP7kr/zY0FL6z6WlCdLOFsTfuGfJ8lZKWLcN8IKRha4whs8J2AK7fzmUbQGP+rbI0QfukO7HuPXKiFhhTjKxv8llYMS8jbaxihUMNTIht+kfPnCweMgDCytVRkAJfrI9UtgK3D2Q8ebMA9jESkh/aAiAxshVwNTNLgwVkrnQgZS9E+KCaFG+aTtoglyIVIYaN+DjF1tVQiko710/qnnig5E+l5o21/yGvG2+JJ4j5Sj7+BFmLISQI9a4o20RQAsJ6XzgGV8YMM9ywxu6ustsnanVWd4oL5Q0o5V2+6fU0oCLUFpFQLwq7J5/Ho+/E7C7moSjLhw6Kx5RCmSiZf6O2kS44mT4qZf4CJf4H2zv3g1hBH3pUVWGhuNeZafLJhbdKaeXN7bIhwNskYjXcoNjLRgE9NRRg8EX9a8lE2E22iazqF5Ag0a78OKNn6r3TUArRsoLe4w1oBrDuai1YpBzpIWmC8dA2+F77Stwah9ofcfSxF2FhjCdLC3t1ef7RhXX7Hhubtn1TG4NcC8Ng+lM6+5fZGe94C+sp+Iobi06xnGmBgDF+0lqn3ggQf2IfC0kVbzXHeLHReqGxawmUOOqwvj0VsWjyWqtN57OD0CSEdahINLfs9Zc/ulsAAsEde0BYUXIeXLB321yjfWTQvtvKzQSfipn+S9JIDSXrnTgX5hxwfCqg3eFDtFlBZmXDrqUfL4joO72cJQdH6VdnrLfZgRQdpXUwYRxcATeGnh0Ql0GPJxANYghG6z32FBE9e6eJ5nocNtOt0htOMTMMyL/EodVbIk62loncTh9dqccLhi8WZwv9s+6y7LCiZzwh+W5hmBsQDsG2nS5mhxBvy0+XU4q8BSGbJixsbGDvHYxkKRK8X6+QULms+Bh9wf3gWO3sn8xEk5SRzF1F3zapp7naQNE9N5wIt8yLXjGJveAxByc3snbSACvCDD0L5IcLZZdG+SZVGsUPEBGsYdGVkUgDtPnyI65UsX+4irbwqmJ21/F3l6oOcuJcQKi2x1iAUQE0i53pxnTLTmub1g2jniwvIieSiHsJOShmLbSDvJ9SVhI0+M5wZTeZQzS7xcuHe7uroK9ilO3DFjQXnJMxq3UlFxm/Gyws6PG0LvHmNw0h9WzDMwAovTssAQHVEyb4bz6NtxhB1WOO10gX2rgbl/9sTusX0dGNeBEakH2yuOgFtgLUG4nGLeKa+WsVNMVpOHsRBgChZQZogIO608kua4hH996MUXXzR+awsQ19MQwqcNhJsgmIiZSnjY/DF3fQlcbqoxBEpMdHyQvnpOg5o5k/gU8aHULbXLEVerNEXRopnGkWDPND8nDFAS5JbV4bfVKA7qPOehXUHGoLzhK2fxBaw+5kiOKB0dehH6JVpLMC8dRm0sdVYyjodhV/pdp5uzsOkBcDCCQeXh+ss/WUYathu0WDee6kj+BgS/rIthwSj2gnEvsijAm+y2cKSgWBe1DYu7qw2h/TADT5+eMXXiefkDH/jAJCud47LEhjG3uUodA4woNiGBKkf9CDqYhSRJ6cLh9F1PkQzHxb1jxbXSNsfFlKB1JAk4LOOBGWfv7GiuT0bSxAUAt5tw4/qF/gvsxbrJuI9LGggDj2GEakQ5sYnE/NQOepcA4qdPOQnxrlzYCGGJ4566BMaU8qS9KPce/SiRL2jcab8dUxNL+cY9ylMzOHpjI235SgcO8tZEDA/4tAcGBWk1nAYFfA1lzaSBXrEwwF9TWh6cCjwM0z9TTwGAp4yxRM9GJoHHAO6AeNLAxIy0mXmV46sCdVSjsbKvD0LJ8ulAKCyzsiyxwQOZE14QrHf4JcQWDgYPTXwv5UtJfWQpFGSwFgbMpZq6GVrwvKL9RDYuy12uEODoYFa5gndzMo0GYdlccjAOzSto6bhWriZedCrNN8lFrRVgi3ELNv7sz/5MgzIycBKBpoxAiLTgrj7JgDb9EXrepRxpl3nbgwGqOSszrwDuxpIQYyOvNjyPcC9KcUiJdsFk1Gmsu7v7kK0X98yLVbBUpynoDRUmr0WcFaE49UcY2K/wqHmqKRTPiDtH6cpxyXpF8Z2HvoaxqP+L/rxrP6W+mJJ5oQm4d9H3jMIFrDUsYR0YkKqv5Vu5qvpqwQZ4marTt0fAb0zbbuBRRuAh0GbSHl9VDvpZGLKQ6eNnpUBBzzuEl2ocWNDb5k67LTNPnErhU6WhY94+k1rg5YTdUQGlQ97K10G0YZsz0K7TmCdIe5DOXIOWM6C8WS86fS0dw5SbNa9NDx7DEC1ijtt43RkU0gwik7L+NP5ntFEtujAaF/eiNs9aeAzAIRpKE/v6IONBGNs4jG3Rxhd714CCfnYxR16BR7n7SatVVzoP8W1xmjs4yoXszbEVi5fNl7OWtHpP8x1i2ivsy7sGA9KcrOZm67mDVrzgYh5wPwLPLFKQ2wwBM4FXQd8Z26X2Ib+YSMUv4ciS9IY4Nyq4yHoy44x6JFoRhZCUVYW1d4z7nF3R6s/D+GwBvlmUwZi7648r97PaAzz6aKe91G8G4XrP30Yofw3g00Xb7Dlz5sylQm7JHG+RN0i8xXz1IOHQh8xVkeJG3zKKKbAXcdutu/ciCWnGnLdKkv5btBWZBN+FRymQSuBJ+6JxTIeEGab6SKIEIkLkJgxULjV9pqWGgVHwiKswijATxlT+uYtwnkq/y7KQYFI5YmjaElBKmTALfZliAFjm7EsEgDTd66XAVF4GUTd4GjCUkcgEYV67aVdv4UdSubRlXu0pKV84XJYKTLsLV67c42ZiWswI184VucBy2rfJphM9eIgV/swf6TgyzfWs4hoep11WYJ6T1Hm/2oe+I4uqLDiH66B3GGkrSkArFnozglr0lULgXXLpU75HV/A5DI7T/CQEU1/qb7SPFlnoyyV7Kesc9RxAifMOR1c8tDQwsVwS2zp1oQUS5rRuo3mHpxoQhK3Qv1NKDHOsp8D/Er9IO6he7JFSH/VWw9KO13H55lVOC6DmRQs+itsJAowiwP1GHB5ehjwPUmq4yuoxYHx6rjfgp7Zi8qC5ZaPEg+jbbVjrAW8g/bpRB0inrRg8SocvJCbPK/ByiwiOkVtzItL+p/Gpp/5Ior5qgLCUW6qLwdgBc2iC2V3LYr2IYfEr6C6EWN6gEa6VvJib0IIAY1lQr5KsO4unFAToY1x5hLXhFh4pRcuFCe8R0xF86DeaY1C2uMAdTVw9JMCsbQLo6n16h7rmdQvbPIXuMORu4ErYmaTCj9V4g9YSIM7rsTDPWIGnLRgwCSNMYBzag2jy4LIaAq4GSD30lMvqdiF88sVrDOh7e+CkFYdNnCtrPvCpPOBtltWDh54DYBjA+kqDWWRCnDlqjAT1zCsf4Z5Jmckx6evUeQo85O2opW2PolC2MffZx3sVS+LNwgHiZ7N+XUL5y3nRb0cQyDrVRIcINPN5sOPQSC5KT2CIPsQfBl/jJRGNEE59CLvEubgsOFKejuAS77IrRXXE3lQWGP60OgSf/tSDEJ/Q9IXtb/40WZ9FG+pvFDbaLzJfnBXeVk2PTGhk64a+aC6lKCDweG9jfHtbegrVkT6VN0miwBPD5JgmnQFnGLsaGt99n7/T5oWci5Qrk87N2F/uUQPDMM7x3gcDTqXF0XH1CYkwESJFI1jXReCpcbBMjIsE4i6D2wh1ieBTTADnEt7EujunvDB6WXmXioEDjrXgKBetsUA5WWUwHxwYgQRZLDNgw7m3KoF5lbIIPBjbEPXTQp1lVkLeCAt2+oi3GALh6DFJWwfq10AazdVpQn5Z8GwcdZmD0Y3SbyQA5B6+C3PK685V3pxyp9NkDCj6ewdeiS7GgBQ271KZ/ot09xCyM1ibXn/O4XfcpmXRyVWUinZwlSBuQ2PVNxozM3b62jg4acP2ccrVtypb9GVnxtYC7wYx2qjgWPHjX6lnxsQAAkJfC5Bg20+byEoXL9gNrfSpIG9BGW01jzJ9FWFXFitHbYnAPUl5Zu+Z2gj3981S6ko9dJajrJCDQ0NDY8DKz1kLFEYfaWGs271x+mhxxAIuAGJbROsINsbyA7SRscLVdlbxVQXVN6D9QtrK0kZSIhLlWiRCBV6/fv0gndRYByoIALcQXLeLXThC5x9ShwemmLA2gJ4UUzrJaSH+yqWt1Ealg/g1CNYT1MEwFwapWbhTLnxgzPdgaJPAN9+CktKBiZ/JPSVmy0A6CQzDqKF1STTGfSZ3pxEs5dBqRSvBAc+LSSvToKt1QSl5QMjSBtUws146tknD6rJbYbzoZ7fos23AqdFRVpR1gTSxblENOITvAwi2Wmim8swl5sbPvpo7cJcJWyCdcUUhrG/KmvEnkhttdHS0F2Fk8CPtbW01YVzNUYYYXD35joLTbBJOfnjh55xychkadFBH82VneIVRSqDNCm0vaxI037KmwjDW413lc8kqPUN5srI0rbELwb8PfD3Ckm4UQV62cUQZTaz21dSAsRyh0eypU6eulMpngGMUf9GOPhXokwoLX9QxoqjZNLR9LUfcHbfvpDWrEKFVG/154fHHH9dh7YH89GXRU270QLiFsRXv0LROY4+6SpnQp4Cuh9uJcTQm+ZG2fihZshSN5yUujzfCNVA1V6djn6ywExIQ+iqDrCS3kAqWdsoczSUazWhG3NtVllZQ8ewNgDgkN0sYAugINDFuNBqnLAcox9TNozWCpicmPjFIc1/MjZ0lgXHjgOso86bSRou+6AtGC4VJF73gIq5wMXvwix28hHvMBfwD810w+oMMFIMT/UZfaTbMwl+GhAJ431AY7VQnBUD925/GPmvJP+X5BaxxMRGvL2iLdgNYmZcp85csk/8Fffiazcs+T/to7uBTw6rMk7K8FCD8UBJNe2ogy2WncA109queEuPTezEX43IOYRrQfFUPGOYZmP47tAhLcx+llFEMXjaPxrQ+jwQNtcrUXOBrjsLTC/hPQ4cL8IV+8C7ZupGiTr2PUsZZyjbCTvSnvS6Hmeh9bN76Zw7+rZfkJzPupfSkscYwEH7J72f8rvtBii7su9X2I4MjcXP04UmNXcJ6sX4fhA//Cv1cH5Bt52fGAnS6IniMB7Ni1w9zqz3TJ4yhpf6qH/hrvF4UHSpdF1OwiI2kNfuFQMCUSceZ4dcPEmVxMwgoTE5HU53HhJW7Z48qS8c/QgN3aCtD2LWlPGIOxPfqudgLYu4DfsA1FYYFUzMdOhxu38U86JBmnoSwJVwkhqHa+Dz3TEwt55KboiwdBNxMh99HWKy70ZYJTWXVdVIHs8xa4dBVR3YNMVBsssx3ytZXEszApB2C3D0ztPQZqLfR0MRc6COeUMQd1s1gMa5r8Flk3u+aP95fwp/+6Z+O0W9k+Ygm2hN6mvpIeQto5/TJFdINU+YqzOYeQinV+ZD+svQswQKT0lcAjLAjaAnaBeatZOmRZoR6dfJrRDnRgo7LaRioyiBdDed06pNNB8DV49KUadyq0EL7X3k12zsOkOUAru016HaX8T2F63UqbiWpYJd6qf6UpfneZuqm8zGbqb8OpwiA5n0ahWC4lAMW/ABFE+YID6A8a8rEjDX6hvrMbYTDUFL/gIarjBcDiv2vstgTXcwqg35nXLCUcT+TH4kUz9CiWvOA9MFD0MCzyJnG6FN2cNZ5w1K+5FnQHK13Ggx78O5Bs0kUrLFi2o/ykk7d8RRL+sZJxkFA8aB/epu/oVcP8d3hqkKPBnAPBye+i6dQP78FpsMyroTHZSKAEiNMb8RE1ykdhrFRAdp2eRBtIqI5l1iWyS7Nnoa9jPbXQYfTp2F0soeW48f6xBVPxtSTlnE4Ul47DCIuygujHO857oFO02HDaaD+sNaoDv3yyy/X/vjHP/Y2cBJWg5vCcw0DI2CtWHjhO53rtmVo4KX5wliBB5NpZBBotaPZuC444LYGw9Mcaarl1xrM586dq8a9KCZhhMuTTz5ZjRuohfbxLEz6RNm1L9GMyxNowl9uXMKl7Upoe2UyUHQmo2hh6sjtargNFOe/EPaDwBMjMcoDtHkQmpmVoP509PUB/zu0878WfJZ1gbvyARIay5q7+cgni0cCwlWAgD0A45ObWJ9EakEQ94JfRHATZr45hwtwN22sTceamzBbD0QbXWprfsOcTnKbdlS/G+DkC+2nbLdMReNHZUFL/Y5Aj2WY2xLPmmKQm3cJK3cR+Ape1DytlABTgO9Prl/6pLauiBnX6U455i4Bi8JFUTXCSRayrFsvN2EqZxRrS4co67nki3ZsgCG3g7P2BgsPAxMctBewHzrPw0TzlePhAX6dMHPtiYswCWDpuD4pD0Y4UFYqxY/+Wg8ttdhJbd2C0NoHLH3axuAEvgt4Ta5DDyNAc67xEW2jYKWq+oa+FK5tH9JgBAcW3XgQxXsGuKM8T8a1U1yFySs+H9Q8QgnBJ6Lwg6+Xiva0FqkXpgdgB96zvJB3EqVESmEiEGjXIyUhLVxg3e8ICRlMjbS5FS1wDC2w6sEHHxwoxEgSYKUOBieNhhHKnKYzHWfADamDxgEQMWj4obg4fxgdI5EoEFaM4a0R6M+Ye1bH0i8mygSxOOAKK+wOAacmzuKSkIB5vYM02gBs3GL4kwMwqUsqt6AsXQSlVuTp5IxhMb8czTz0xIBgMg8qgDQmHDpNk24QRp+qHGUSgwROL+UZGPqjDlVW+9U7eExS59QwlSfN9Zd/+Ze7odU56rcC3mpnnRLijTLezT46ub2po2lfpWPAX8VCKIiPaIYQuCahQn650/QtttOU95rgpMExTZrr168fJZ11I+uovcsIuwjzFCzhBLO+Bh5nxMiEF+NAngNTV30jkPrpa/OeR4I0RoCQVyB0LRE2Cq3usBLaE6oSesRJ0RmXQEAR0sKWvRJ45LXWT50EFDTwFugwBgXTXPSFqueee26IY98GbZjutIWEoD5J5fU3y7wV5r/AjSKXZyhb/VFu59ix7c+T5RnaHKNu2rcqYWCyUs4CKMqjkWpzvwQv49MecCDCtkHPCBp+2iiSLx9EFEnqr+MWT4CPrB31XwnPav8YssKD+EWex7T3FpwjBeYsOPWFO7RnzbFjx/ZK4AKvVeVDU50s1IKgX2VcTOBm7wdOsAGU0HepTOhUlGXqAxP7CM3Vj7y+GpvIFyg+gtKloxhnEXaDhXBXVtHSB6KkR4+5sAKzIOFKKikmc24gvBkT5QXRmVYg0m0vIOEBxpko8LCYrlGWZy3EgdCcB4SVJhd75ZjJQGwkgYoHB3Uqw/jAG3BvWY10DB1mqnm/JBCBcBb09L2HT4SoQ8TlkVBE8zELXCjrLgPglv3uWgBQgZeBgYFpCbi4i7INA6Vj3gT3uCQlhWn5PMxLgkHaI2PyPvPKAdXZpEaoQccJBkgX+NQy2K9Aj4KrLi1iahfocw2hcpg26ESrVj+PMBqbvpg7GvkAgkIf99WJIzo03RNCcfCkmcvSlMIiZoSF5s2ziia0q/IHmIgYBIxS82GaFyx4kokYOmnlpdGKVc2nNSGEmugn+jhyoxiV6El85FJZ4UCN1ZyCqhNwllVX/WgzfWUF429hgeX684y1+aTFSGGYxb7TB+QWNdMLwpW6DCP4zfmvWfop+F/np9W+ZnolCR/K0GC+x10LpCKCg/z66K9oIqUqAIYwKQpz9LtZrLIpaKMTadZYjBZIF/eS4zniW5OyGLmrzu2U0QBcbjWrghWXNxQ2xZi5EQoryyt4HQWQ5/1KA5RV48Y7g2elYHL60xDjJLW3EWXxOO1kpxUi8D2Bl5JwEQB0PHVyY4HpOZKgyAD2ui2iIWn5eirmZHFA8zNuQ077X2WAjqh4iBCrbftRA/dpOhBjx7h5/FGpnzUgYCrGP28z0cnFGOZp3LtoYza44D2NlY2L6CZunZGsKzn9hTOo9KmUK9Rb7hZZT7KGV1hpuMpKsgUNujiB64dRyvPevXv7aLPd0N9ocfRDuQPv+ecqYGJL7De7xF6lWoR6QcsujE+ub99EyGQ62zEMR++c0bqKVWwGIH3OMD8JFyyzy+985zuX0rSb4CgP+Fymny9Rv0Afp10HoIn2Uc63t7fPU6ZpB+XTlYZZ3k95/z9XfwmxgCDLMVEx0nq8LHUIkjr6bx2LOO7689tnlOIrxfIJC6Mcd23pAPd+cJ23Sh5hmUGrX5HpqjIyRqvlpYkDoi+HFKo3nwcaon/qlBid57oEbou4ohf9/TgOdtqwHK63wVOnMsnluR9rM2CFh2GR5g7tWsM90O7hdKW8U1/DN9PyaZWVZoxAbzPG4EmZvi6C0SHFZ57V5RHFpJR6uryOAo4CjgKOAo4CjgKOAo4CjgKOAo4CjgKbjQL/H0U4I+33KKiUAAAAAElFTkSuQmCC",bgImg=new Image;bgImg.src=bg;async function imgToCanvas(B){const R=document.createElement("img");R.src=B,R.setAttribute("crossOrigin","anonymous"),await new Promise(D=>R.onload=D);const F=document.createElement("canvas");return F.width=R.width,F.height=R.height,F.getContext("2d").drawImage(R,0,0),F}function addWatermark(B,R){const G=Math.max(B.width,B.height),U=Math.floor(G/600)*5,W=Math.floor(G/500)*5,q=B.getContext("2d");q.rotate(-30*Math.PI/180),console.log(q);for(let Y=0;Ynew Promise(D=>{this.canvas.toBlob(D)}),this.canvas}});const preset=index.offscreen();function blobToBase64(B){return new Promise((R,F)=>{const D=new FileReader;D.onloadend=()=>R(D.result),D.readAsDataURL(B)})}async function svgtopng(B,R,F){const D=new OffscreenCanvas(R,F),G=D.getContext("2d"),U=await Canvg.fromString(G,B,preset);U.resize(R*2,F*2,"xMidYMid meet"),await U.start();const W=await D.convertToBlob();return await blobToBase64(W)}const feedback="_feedback_1x8ma_1",title$2="_title_1x8ma_7",wrap$2="_wrap_1x8ma_14",sub="_sub_1x8ma_17",group$1="_group_1x8ma_23",text="_text_1x8ma_51",submit="_submit_1x8ma_72";var styles$8={feedback,title:title$2,wrap:wrap$2,sub,group:group$1,text,submit},bgSubmit="/orchestra-music-score/assets/submit.a571df10.png",BackIcon="/orchestra-music-score/assets/back.0e8784e6.svg",__glob_10_1="/orchestra-music-score/assets/setting.39685e69.svg";const header="_header_1l0s0_1",left="_left_1l0s0_10";var styles$7={header,left};function getImageUrl(B){return new URL({"./icons/back.svg":BackIcon,"./icons/setting.svg":__glob_10_1}[`./icons/${B}.svg`],self.location).href}const settingPopup$1=ref(null),suggestPopup$1=ref(null);defineComponent({name:"ColexiuHeader",setup(){const[B]=useMenu();return()=>createVNode("div",{class:[styles$7.header,B.value?"animate__animated animate__fadeInDown":"animate__animated animate__fadeOutUp"]},[createVNode("div",{class:styles$7.left},[createVNode(Button,{icon:getImageUrl("back"),onClick:()=>postMessage({api:"back"})},null)]),createVNode(Button,{icon:getImageUrl("setting"),onClick:()=>{var R;console.log(settingPopup$1.value),(R=settingPopup$1.value)==null||R.onShow()},disabled:state.evaluatingStatus},null),createVNode(Popups,{ref:settingPopup$1,style:{borderRadius:"8px"}},{default:()=>[createVNode(Setting,null,null)]}),createVNode(Popups,{ref:suggestPopup$1,overlay:!1,style:{borderRadius:"8px"}},{default:()=>[createVNode(Feedback,null,null)]})])}});var replace=String.prototype.replace,percentTwenties=/%20/g,Format={RFC1738:"RFC1738",RFC3986:"RFC3986"},formats$3={default:Format.RFC3986,formatters:{RFC1738:function(B){return replace.call(B,percentTwenties,"+")},RFC3986:function(B){return String(B)}},RFC1738:Format.RFC1738,RFC3986:Format.RFC3986},formats$2=formats$3,has$2=Object.prototype.hasOwnProperty,isArray$4=Array.isArray,hexTable=function(){for(var B=[],R=0;R<256;++R)B.push("%"+((R<16?"0":"")+R.toString(16)).toUpperCase());return B}(),compactQueue=function B(R){for(;R.length>1;){var F=R.pop(),D=F.obj[F.prop];if(isArray$4(D)){for(var G=[],U=0;U=48&&J<=57||J>=65&&J<=90||J>=97&&J<=122||U===formats$2.RFC1738&&(J===40||J===41)){q+=W.charAt(Y);continue}if(J<128){q=q+hexTable[J];continue}if(J<2048){q=q+(hexTable[192|J>>6]+hexTable[128|J&63]);continue}if(J<55296||J>=57344){q=q+(hexTable[224|J>>12]+hexTable[128|J>>6&63]+hexTable[128|J&63]);continue}Y+=1,J=65536+((J&1023)<<10|W.charCodeAt(Y)&1023),q+=hexTable[240|J>>18]+hexTable[128|J>>12&63]+hexTable[128|J>>6&63]+hexTable[128|J&63]}return q},compact=function B(R){for(var F=[{obj:{o:R},prop:"o"}],D=[],G=0;G0?se.join(",")||null:void 0}];else if(isArray$3(q))ae=q;else{var ce=Object.keys(se);ae=Y?ce.sort(Y):ce}for(var he=0;he0?te+K:""},utils$1=utils$3,has=Object.prototype.hasOwnProperty,isArray$2=Array.isArray,defaults={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:utils$1.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},interpretNumericEntities=function(B){return B.replace(/&#(\d+);/g,function(R,F){return String.fromCharCode(parseInt(F,10))})},parseArrayValue=function(B,R){return B&&typeof B=="string"&&R.comma&&B.indexOf(",")>-1?B.split(","):B},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function B(R,F){var D={},G=F.ignoreQueryPrefix?R.replace(/^\?/,""):R,U=F.parameterLimit===1/0?void 0:F.parameterLimit,W=G.split(F.delimiter,U),q=-1,Y,J=F.charset;if(F.charsetSentinel)for(Y=0;Y-1&&(ie=isArray$2(ie)?[ie]:ie),has.call(D,Q)?D[Q]=utils$1.combine(D[Q],ie):D[Q]=ie}return D},parseObject=function(B,R,F,D){for(var G=D?R:parseArrayValue(R,F),U=B.length-1;U>=0;--U){var W,q=B[U];if(q==="[]"&&F.parseArrays)W=[].concat(G);else{W=F.plainObjects?Object.create(null):{};var Y=q.charAt(0)==="["&&q.charAt(q.length-1)==="]"?q.slice(1,-1):q,J=parseInt(Y,10);!F.parseArrays&&Y===""?W={0:G}:!isNaN(J)&&q!==Y&&String(J)===Y&&J>=0&&F.parseArrays&&J<=F.arrayLimit?(W=[],W[J]=G):W[Y]=G}G=W}return G},parseKeys=function B(R,F,D,G){if(!!R){var U=D.allowDots?R.replace(/\.([^.[]+)/g,"[$1]"):R,W=/(\[[^[\]]*])/,q=/(\[[^[\]]*])/g,Y=D.depth>0&&W.exec(U),J=Y?U.slice(0,Y.index):U,Z=[];if(J){if(!D.plainObjects&&has.call(Object.prototype,J)&&!D.allowPrototypes)return;Z.push(J)}for(var K=0;D.depth>0&&(Y=q.exec(U))!==null&&K-1};function normalizeName(B){if(typeof B!="string"&&(B=String(B)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(B)||B==="")throw new TypeError('Invalid character in header field name: "'+B+'"');return B.toLowerCase()}function normalizeValue(B){return typeof B!="string"&&(B=String(B)),B}function iteratorFor(B){var R={next:function(){var F=B.shift();return{done:F===void 0,value:F}}};return support.iterable&&(R[Symbol.iterator]=function(){return R}),R}function Headers(B){this.map={},B instanceof Headers?B.forEach(function(R,F){this.append(F,R)},this):Array.isArray(B)?B.forEach(function(R){this.append(R[0],R[1])},this):B&&Object.getOwnPropertyNames(B).forEach(function(R){this.append(R,B[R])},this)}Headers.prototype.append=function(B,R){B=normalizeName(B),R=normalizeValue(R);var F=this.map[B];this.map[B]=F?F+", "+R:R};Headers.prototype.delete=function(B){delete this.map[normalizeName(B)]};Headers.prototype.get=function(B){return B=normalizeName(B),this.has(B)?this.map[B]:null};Headers.prototype.has=function(B){return this.map.hasOwnProperty(normalizeName(B))};Headers.prototype.set=function(B,R){this.map[normalizeName(B)]=normalizeValue(R)};Headers.prototype.forEach=function(B,R){for(var F in this.map)this.map.hasOwnProperty(F)&&B.call(R,this.map[F],F,this)};Headers.prototype.keys=function(){var B=[];return this.forEach(function(R,F){B.push(F)}),iteratorFor(B)};Headers.prototype.values=function(){var B=[];return this.forEach(function(R){B.push(R)}),iteratorFor(B)};Headers.prototype.entries=function(){var B=[];return this.forEach(function(R,F){B.push([F,R])}),iteratorFor(B)};support.iterable&&(Headers.prototype[Symbol.iterator]=Headers.prototype.entries);function consumed(B){if(B.bodyUsed)return Promise.reject(new TypeError("Already read"));B.bodyUsed=!0}function fileReaderReady(B){return new Promise(function(R,F){B.onload=function(){R(B.result)},B.onerror=function(){F(B.error)}})}function readBlobAsArrayBuffer(B){var R=new FileReader,F=fileReaderReady(R);return R.readAsArrayBuffer(B),F}function readBlobAsText(B){var R=new FileReader,F=fileReaderReady(R);return R.readAsText(B),F}function readArrayBufferAsText(B){for(var R=new Uint8Array(B),F=new Array(R.length),D=0;D=0&&typeof this._bodyInit!="string"&&(this._bodyInit=this._bodyText):typeof B=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):support.searchParams&&URLSearchParams.prototype.isPrototypeOf(B)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8")},support.blob&&(this.blob=function(){var B=consumed(this);if(B)return B;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 B=consumed(this);return B||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(readBlobAsArrayBuffer)}),this.text=function(){var B=consumed(this);if(B)return B;if(this._bodyBlob)return readBlobAsText(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},support.formData&&(this.formData=function(){return this.text().then(decode$1)}),this.json=function(){return this.text().then(JSON.parse)},this}var methods=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function normalizeMethod(B){var R=B.toUpperCase();return methods.indexOf(R)>-1?R:B}function Request(B,R){if(!(this instanceof Request))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');R=R||{};var F=R.body;if(B instanceof Request){if(B.bodyUsed)throw new TypeError("Already read");this.url=B.url,this.credentials=B.credentials,R.headers||(this.headers=new Headers(B.headers)),this.method=B.method,this.mode=B.mode,this.signal=B.signal,!F&&B._bodyInit!=null&&(F=B._bodyInit,B.bodyUsed=!0)}else this.url=String(B);if(this.credentials=R.credentials||this.credentials||"same-origin",(R.headers||!this.headers)&&(this.headers=new Headers(R.headers)),this.method=normalizeMethod(R.method||this.method||"GET"),this.mode=R.mode||this.mode||null,this.signal=R.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&F)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(F),(this.method==="GET"||this.method==="HEAD")&&(R.cache==="no-store"||R.cache==="no-cache")){var D=/([?&])_=[^&]*/;if(D.test(this.url))this.url=this.url.replace(D,"$1_="+new Date().getTime());else{var G=/\?/;this.url+=(G.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}Request.prototype.clone=function(){return new Request(this,{body:this._bodyInit})};function decode$1(B){var R=new FormData;return B.trim().split("&").forEach(function(F){if(F){var D=F.split("="),G=D.shift().replace(/\+/g," "),U=D.join("=").replace(/\+/g," ");R.append(decodeURIComponent(G),decodeURIComponent(U))}}),R}function parseHeaders(B){var R=new Headers,F=B.replace(/\r?\n[\t ]+/g," ");return F.split("\r").map(function(D){return D.indexOf(` `)===0?D.substr(1,D.length):D}).forEach(function(D){var G=D.split(":"),U=G.shift().trim();if(U){var W=G.join(":").trim();R.append(U,W)}}),R}Body.call(Request.prototype);function Response(B,R){if(!(this instanceof Response))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');R||(R={}),this.type="default",this.status=R.status===void 0?200:R.status,this.ok=this.status>=200&&this.status<300,this.statusText=R.statusText===void 0?"":""+R.statusText,this.headers=new Headers(R.headers),this.url=R.url||"",this._initBody(B)}Body.call(Response.prototype);Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers(this.headers),url:this.url})};Response.error=function(){var B=new Response(null,{status:0,statusText:""});return B.type="error",B};var redirectStatuses=[301,302,303,307,308];Response.redirect=function(B,R){if(redirectStatuses.indexOf(R)===-1)throw new RangeError("Invalid status code");return new Response(null,{status:R,headers:{location:B}})};var DOMException=global$1.DOMException;try{new DOMException}catch(B){DOMException=function(R,F){this.message=R,this.name=F;var D=Error(R);this.stack=D.stack},DOMException.prototype=Object.create(Error.prototype),DOMException.prototype.constructor=DOMException}function fetch$2(B,R){return new Promise(function(F,D){var G=new Request(B,R);if(G.signal&&G.signal.aborted)return D(new DOMException("Aborted","AbortError"));var U=new XMLHttpRequest;function W(){U.abort()}U.onload=function(){var Y={status:U.status,statusText:U.statusText,headers:parseHeaders(U.getAllResponseHeaders()||"")};Y.url="responseURL"in U?U.responseURL:Y.headers.get("X-Request-URL");var J="response"in U?U.response:U.responseText;setTimeout(function(){F(new Response(J,Y))},0)},U.onerror=function(){setTimeout(function(){D(new TypeError("Network request failed"))},0)},U.ontimeout=function(){setTimeout(function(){D(new TypeError("Network request failed"))},0)},U.onabort=function(){setTimeout(function(){D(new DOMException("Aborted","AbortError"))},0)};function q(Y){try{return Y===""&&global$1.location.href?global$1.location.href:Y}catch{return Y}}U.open(G.method,q(G.url),!0),G.credentials==="include"?U.withCredentials=!0:G.credentials==="omit"&&(U.withCredentials=!1),"responseType"in U&&(support.blob?U.responseType="blob":support.arrayBuffer&&G.headers.get("Content-Type")&&G.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(U.responseType="arraybuffer")),R&&typeof R.headers=="object"&&!(R.headers instanceof Headers)?Object.getOwnPropertyNames(R.headers).forEach(function(Y){U.setRequestHeader(Y,normalizeValue(R.headers[Y]))}):G.headers.forEach(function(Y,J){U.setRequestHeader(J,Y)}),G.signal&&(G.signal.addEventListener("abort",W),U.onreadystatechange=function(){U.readyState===4&&G.signal.removeEventListener("abort",W)}),U.send(typeof G._bodyInit=="undefined"?null:G._bodyInit)})}fetch$2.polyfill=!0;global$1.fetch||(global$1.fetch=fetch$2,global$1.Headers=Headers,global$1.Request=Request,global$1.Response=Response);self.fetch.bind(self);function _defineProperty(B,R,F){return R in B?Object.defineProperty(B,R,{value:F,enumerable:!0,configurable:!0,writable:!0}):B[R]=F,B}var defineProperty=_defineProperty;function _objectSpread(B){for(var R=1;R1&&arguments[1]!==void 0?arguments[1]:{global:!1,core:!1,defaultInstance:!1},G=!1,U=!1,W=!1;if(typeof D=="number"?(process&&process.env,G=!0,U=!1):_typeof_1(D)==="object"&&D&&(U=D.global||!1,G=D.core||!1,W=D.defaultInstance||!1),U){B.globalMiddlewares.splice(B.globalMiddlewares.length-B.defaultGlobalMiddlewaresLength,0,F);return}if(G){B.coreMiddlewares.splice(B.coreMiddlewares.length-B.defaultCoreMiddlewaresLength,0,F);return}if(W){this.defaultMiddlewares.push(F);return}this.middlewares.push(F)}},{key:"execute",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,D=compose([].concat(toConsumableArray(this.middlewares),toConsumableArray(this.defaultMiddlewares),toConsumableArray(B.globalMiddlewares),toConsumableArray(B.coreMiddlewares)));return D(F)}}]),B}();Onion.globalMiddlewares=[];Onion.defaultGlobalMiddlewaresLength=0;Onion.coreMiddlewares=[];Onion.defaultCoreMiddlewaresLength=0;function _assertThisInitialized(B){if(B===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return B}var assertThisInitialized=_assertThisInitialized;function _possibleConstructorReturn(B,R){return R&&(_typeof_1(R)==="object"||typeof R=="function")?R:assertThisInitialized(B)}var possibleConstructorReturn=_possibleConstructorReturn,getPrototypeOf=createCommonjsModule(function(B){function R(F){return B.exports=R=Object.setPrototypeOf?Object.getPrototypeOf:function(G){return G.__proto__||Object.getPrototypeOf(G)},R(F)}B.exports=R}),setPrototypeOf=createCommonjsModule(function(B){function R(F,D){return B.exports=R=Object.setPrototypeOf||function(U,W){return U.__proto__=W,U},R(F,D)}B.exports=R});function _inherits(B,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function");B.prototype=Object.create(R&&R.prototype,{constructor:{value:B,writable:!0,configurable:!0}}),R&&setPrototypeOf(B,R)}var inherits=_inherits;function _isNativeFunction(B){return Function.toString.call(B).indexOf("[native code]")!==-1}var isNativeFunction=_isNativeFunction,construct=createCommonjsModule(function(B){function R(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function F(D,G,U){return R()?B.exports=F=Reflect.construct:B.exports=F=function(q,Y,J){var Z=[null];Z.push.apply(Z,Y);var K=Function.bind.apply(q,Z),te=new K;return J&&setPrototypeOf(te,J.prototype),te},F.apply(null,arguments)}B.exports=F}),wrapNativeSuper=createCommonjsModule(function(B){function R(F){var D=typeof Map=="function"?new Map:void 0;return B.exports=R=function(U){if(U===null||!isNativeFunction(U))return U;if(typeof U!="function")throw new TypeError("Super expression must either be null or a function");if(typeof D!="undefined"){if(D.has(U))return D.get(U);D.set(U,W)}function W(){return construct(U,arguments,getPrototypeOf(this).constructor)}return W.prototype=Object.create(U.prototype,{constructor:{value:W,enumerable:!1,writable:!0,configurable:!0}}),setPrototypeOf(W,U)},R(F)}B.exports=R}),MapCache=function(){function B(R){classCallCheck(this,B),this.cache=new Map,this.timer={},this.extendOptions(R)}return createClass(B,[{key:"extendOptions",value:function(F){this.maxCache=F.maxCache||0}},{key:"get",value:function(F){return this.cache.get(JSON.stringify(F))}},{key:"set",value:function(F,D){var G=this,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:6e4;if(this.maxCache>0&&this.cache.size>=this.maxCache){var W=toConsumableArray(this.cache.keys())[0];this.cache.delete(W),this.timer[W]&&clearTimeout(this.timer[W])}var q=JSON.stringify(F);this.cache.set(q,D),U>0&&(this.timer[q]=setTimeout(function(){G.cache.delete(q),delete G.timer[q]},U))}},{key:"delete",value:function(F){var D=JSON.stringify(F);return delete this.timer[D],this.cache.delete(D)}},{key:"clear",value:function(){return this.timer={},this.cache.clear()}}]),B}(),RequestError=function(B){inherits(R,B);function R(F,D){var G,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"RequestError";return classCallCheck(this,R),G=possibleConstructorReturn(this,getPrototypeOf(R).call(this,F)),G.name="RequestError",G.request=D,G.type=U,G}return R}(wrapNativeSuper(Error)),ResponseError=function(B){inherits(R,B);function R(F,D,G,U){var W,q=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"ResponseError";return classCallCheck(this,R),W=possibleConstructorReturn(this,getPrototypeOf(R).call(this,D||F.statusText)),W.name="ResponseError",W.data=G,W.response=F,W.request=U,W.type=q,W}return R}(wrapNativeSuper(Error));function readerGBK(B){return new Promise(function(R,F){var D=new FileReader;D.onload=function(){R(D.result)},D.onerror=F,D.readAsText(B,"GBK")})}function safeJsonParse(B){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,D=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;try{return JSON.parse(B)}catch{if(R)throw new ResponseError(F,"JSON.parse fail",B,D,"ParseError")}return B}function timeout2Throw(B,R){return new Promise(function(F,D){setTimeout(function(){D(new RequestError("timeout of ".concat(B,"ms exceeded"),R,"Timeout"))},B)})}function cancel2Throw(B){return new Promise(function(R,F){B.cancelToken&&B.cancelToken.promise.then(function(D){F(D)})})}var toString$2=Object.prototype.toString;function getEnv(){var B;return typeof process!="undefined"&&toString$2.call(process)==="[object process]"&&(B="NODE"),typeof XMLHttpRequest!="undefined"&&(B="BROWSER"),B}function isArray$1(B){return _typeof_1(B)==="object"&&Object.prototype.toString.call(B)==="[object Array]"}function isURLSearchParams(B){return typeof URLSearchParams!="undefined"&&B instanceof URLSearchParams}function isDate(B){return _typeof_1(B)==="object"&&Object.prototype.toString.call(B)==="[object Date]"}function isObject(B){return B!==null&&_typeof_1(B)==="object"}function forEach2ObjArr(B,R){if(!!B)if(_typeof_1(B)!=="object"&&(B=[B]),isArray$1(B))for(var F=0;F1&&arguments[1]!==void 0?arguments[1]:{},D=F.prefix,G=F.suffix;return D&&(R="".concat(D).concat(R)),G&&(R="".concat(R).concat(G)),{url:R,options:F}},warnedCoreType=!1;function __defaultValidateCache(B,R){var F=R.method,D=F===void 0?"get":F;return D.toLowerCase()==="get"}function fetchMiddleware(B,R){if(!B)return R();var F=B.req;F=F===void 0?{}:F;var D=F.options,G=D===void 0?{}:D,U=F.url,W=U===void 0?"":U,q=B.cache,Y=B.responseInterceptors,J=G.timeout,Z=J===void 0?0:J,K=G.__umiRequestCoreType__,te=K===void 0?"normal":K,Q=G.useCache,ie=Q===void 0?!1:Q,se=G.method,ne=se===void 0?"get":se,re=G.params,ae=G.ttl,ce=G.validateCache,he=ce===void 0?__defaultValidateCache:ce;if(te!=="normal")return process&&process.env,R();var fe=fetch;if(!fe)throw new Error("Global fetch not exist!");var be=getEnv()==="BROWSER",ue=he(W,G)&&ie&&be;if(ue){var ge=q.get({url:W,params:re,method:ne});if(ge)return ge=ge.clone(),ge.useCache=!0,B.res=ge,R()}var ve;return Z>0?ve=Promise.race([cancel2Throw(G),fe(W,G),timeout2Throw(Z,B.req)]):ve=Promise.race([cancel2Throw(G),fe(W,G)]),Y.forEach(function(Se){ve=ve.then(function(pe){var ye=typeof pe.clone=="function"?pe.clone():pe;return Se(ye,G)})}),ve.then(function(Se){if(ue&&Se.status===200){var pe=Se.clone();pe.useCache=!0,q.set({url:W,params:re,method:ne},pe,ae)}return B.res=Se,R()})}function parseResponseMiddleware(B,R){var F;return R().then(function(){if(!!B){var D=B.res,G=D===void 0?{}:D,U=B.req,W=U===void 0?{}:U,q=W||{},Y=q.options;Y=Y===void 0?{}:Y;var J=Y.responseType,Z=J===void 0?"json":J,K=Y.charset,te=K===void 0?"utf8":K;Y.getResponse;var Q=Y.throwErrIfParseFail,ie=Q===void 0?!1:Q,se=Y.parseResponse,ne=se===void 0?!0:se;if(!!ne&&!(!G||!G.clone)){if(F=getEnv()==="BROWSER"?G.clone():G,F.useCache=G.useCache||!1,te==="gbk")try{return G.blob().then(readerGBK).then(function(re){return safeJsonParse(re,!1,F,W)})}catch(re){throw new ResponseError(F,re.message,null,W,"ParseError")}else if(Z==="json")return G.text().then(function(re){return safeJsonParse(re,ie,F,W)});try{return G[Z]()}catch{throw new ResponseError(F,"responseType not support",null,W,"ParseError")}}}}).then(function(D){if(!!B){B.res;var G=B.req,U=G===void 0?{}:G,W=U||{},q=W.options;q=q===void 0?{}:q;var Y=q.getResponse,J=Y===void 0?!1:Y;if(!!F){if(F.status>=200&&F.status<300){if(J){B.res={data:D,response:F};return}B.res=D;return}throw new ResponseError(F,"http error",D,U,"HttpError")}}}).catch(function(D){if(D instanceof RequestError||D instanceof ResponseError)throw D;var G=B.req,U=B.res;throw D.request=D.request||G,D.response=D.response||U,D.type=D.type||D.name,D.data=D.data||void 0,D})}function simplePostMiddleware(B,R){if(!B)return R();var F=B.req;F=F===void 0?{}:F;var D=F.options,G=D===void 0?{}:D,U=G.method,W=U===void 0?"get":U;if(["post","put","patch","delete"].indexOf(W.toLowerCase())===-1)return R();var q=G.requestType,Y=q===void 0?"json":q,J=G.data;if(J){var Z=Object.prototype.toString.call(J);Z==="[object Object]"||Z==="[object Array]"?Y==="json"?(G.headers=objectSpread({Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},G.headers),G.body=JSON.stringify(J)):Y==="form"&&(G.headers=objectSpread({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},G.headers),G.body=reqStringify(J)):(G.headers=objectSpread({Accept:"application/json"},G.headers),G.body=J)}return B.req.options=G,R()}function paramsSerialize(B,R){var F,D;if(B)if(R)F=R(B);else if(isURLSearchParams(B))F=B.toString();else if(isArray$1(B))D=[],forEach2ObjArr(B,function(U){U===null||typeof U=="undefined"?D.push(U):D.push(isObject(U)?JSON.stringify(U):U)}),F=reqStringify(D);else{D={},forEach2ObjArr(B,function(U,W){var q=U;U===null||typeof U=="undefined"?D[W]=U:isDate(U)?q=U.toISOString():isArray$1(U)?q=U:isObject(U)&&(q=JSON.stringify(U)),D[W]=q});var G=reqStringify(D);F=G}return F}function simpleGetMiddleware(B,R){if(!B)return R();var F=B.req;F=F===void 0?{}:F;var D=F.options,G=D===void 0?{}:D,U=G.paramsSerializer,W=G.params,q=B.req;q=q===void 0?{}:q;var Y=q.url,J=Y===void 0?"":Y;G.method=G.method?G.method.toUpperCase():"GET",G.credentials=G.credentials||"same-origin";var Z=paramsSerialize(W,U);if(B.req.originUrl=J,Z){var K=J.indexOf("?")!==-1?"&":"?";B.req.url="".concat(J).concat(K).concat(Z)}return B.req.options=G,R()}var globalMiddlewares=[simplePostMiddleware,simpleGetMiddleware,parseResponseMiddleware],coreMiddlewares=[fetchMiddleware];Onion.globalMiddlewares=globalMiddlewares;Onion.defaultGlobalMiddlewaresLength=globalMiddlewares.length;Onion.coreMiddlewares=coreMiddlewares;Onion.defaultCoreMiddlewaresLength=coreMiddlewares.length;var Core=function(){function B(R){classCallCheck(this,B),this.onion=new Onion([]),this.fetchIndex=0,this.mapCache=new MapCache(R),this.initOptions=R,this.instanceRequestInterceptors=[],this.instanceResponseInterceptors=[]}return createClass(B,[{key:"use",value:function(F){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!1,core:!1};return this.onion.use(F,D),this}},{key:"extendOptions",value:function(F){this.initOptions=mergeRequestOptions(this.initOptions,F),this.mapCache.extendOptions(F)}},{key:"dealRequestInterceptors",value:function(F){var D=function(W,q){return W.then(function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return F.req.url=Y.url||F.req.url,F.req.options=Y.options||F.req.options,q(F.req.url,F.req.options)})},G=[].concat(toConsumableArray(B.requestInterceptors),toConsumableArray(this.instanceRequestInterceptors));return G.reduce(D,Promise.resolve()).then(function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return F.req.url=U.url||F.req.url,F.req.options=U.options||F.req.options,Promise.resolve()})}},{key:"request",value:function(F,D){var G=this,U=this.onion,W={req:{url:F,options:D},res:null,cache:this.mapCache,responseInterceptors:[].concat(toConsumableArray(B.responseInterceptors),toConsumableArray(this.instanceResponseInterceptors))};if(typeof F!="string")throw new Error("url MUST be a string");return new Promise(function(q,Y){G.dealRequestInterceptors(W).then(function(){return U.execute(W)}).then(function(){q(W.res)}).catch(function(J){var Z=W.req.options.errorHandler;if(Z)try{var K=Z(J);q(K)}catch(te){Y(te)}else Y(J)})})}}],[{key:"requestUse",value:function(F){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!0};if(typeof F!="function")throw new TypeError("Interceptor must be function!");D.global?B.requestInterceptors.push(F):this.instanceRequestInterceptors.push(F)}},{key:"responseUse",value:function(F){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{global:!0};if(typeof F!="function")throw new TypeError("Interceptor must be function!");D.global?B.responseInterceptors.push(F):this.instanceResponseInterceptors.push(F)}}]),B}();Core.requestInterceptors=[addfix];Core.responseInterceptors=[];function Cancel(B){this.message=B}Cancel.prototype.toString=function B(){return this.message?"Cancel: ".concat(this.message):"Cancel"};Cancel.prototype.__CANCEL__=!0;function CancelToken(B){if(typeof B!="function")throw new TypeError("executor must be a function.");var R;this.promise=new Promise(function(G){R=G});var F=this;B(function(G){F.reason||(F.reason=new Cancel(G),R(F.reason))})}CancelToken.prototype.throwIfRequested=function B(){if(this.reason)throw this.reason};CancelToken.source=function B(){var R,F=new CancelToken(function(G){R=G});return{token:F,cancel:R}};function isCancel(B){return!!(B&&B.__CANCEL__)}var request$1=function B(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},F=new Core(R),D=function(W){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=mergeRequestOptions(F.initOptions,q);return F.request(W,Y)};D.use=F.use.bind(F),D.fetchIndex=F.fetchIndex,D.interceptors={request:{use:Core.requestUse.bind(F)},response:{use:Core.responseUse.bind(F)}};var G=["get","post","delete","put","patch","head","options","rpc"];return G.forEach(function(U){D[U]=function(W,q){return D(W,objectSpread({},q,{method:U}))}}),D.Cancel=Cancel,D.CancelToken=CancelToken,D.isCancel=isCancel,D.extendOptions=F.extendOptions.bind(F),D.middlewares={instance:F.onion.middlewares,defaultInstance:F.onion.defaultMiddlewares,global:Onion.globalMiddlewares,core:Onion.coreMiddlewares},D},extend$1=function B(R){return request$1(R)};request$1({parseResponse:!1});var request$1$1=request$1({}),lodash_isempty={exports:{}};(function(B,R){var F=9007199254740991,D="[object Arguments]",G="[object Function]",U="[object GeneratorFunction]",W="[object Map]",q="[object Object]",Y="[object Promise]",J="[object Set]",Z="[object WeakMap]",K="[object DataView]",te=/[\\^$.*+?()[\]{}|]/g,Q=/^\[object .+?Constructor\]$/,ie=typeof commonjsGlobal$1=="object"&&commonjsGlobal$1&&commonjsGlobal$1.Object===Object&&commonjsGlobal$1,se=typeof self=="object"&&self&&self.Object===Object&&self,ne=ie||se||Function("return this")(),re=R&&!R.nodeType&&R,ae=re&&!0&&B&&!B.nodeType&&B,ce=ae&&ae.exports===re;function he(lt,vt){return lt==null?void 0:lt[vt]}function fe(lt){var vt=!1;if(lt!=null&&typeof lt.toString!="function")try{vt=!!(lt+"")}catch{}return vt}function be(lt,vt){return function(Et){return lt(vt(Et))}}var ue=Function.prototype,ge=Object.prototype,ve=ne["__core-js_shared__"],Se=function(){var lt=/[^.]+$/.exec(ve&&ve.keys&&ve.keys.IE_PROTO||"");return lt?"Symbol(src)_1."+lt:""}(),pe=ue.toString,ye=ge.hasOwnProperty,Ee=ge.toString,de=RegExp("^"+pe.call(ye).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),we=ce?ne.Buffer:void 0,Oe=ge.propertyIsEnumerable,Me=we?we.isBuffer:void 0,Pe=be(Object.keys,Object),Ne=ct(ne,"DataView"),ke=ct(ne,"Map"),Ae=ct(ne,"Promise"),_e=ct(ne,"Set"),Fe=ct(ne,"WeakMap"),Ye=!Oe.call({valueOf:1},"valueOf"),Ce=qe(Ne),Ge=qe(ke),We=qe(Ae),Ve=qe(_e),Ze=qe(Fe);function nt(lt){return Ee.call(lt)}function at(lt){if(!rt(lt)||xe(lt))return!1;var vt=tt(lt)||fe(lt)?de:Q;return vt.test(qe(lt))}function ct(lt,vt){var Et=he(lt,vt);return at(Et)?Et:void 0}var De=nt;(Ne&&De(new Ne(new ArrayBuffer(1)))!=K||ke&&De(new ke)!=W||Ae&&De(Ae.resolve())!=Y||_e&&De(new _e)!=J||Fe&&De(new Fe)!=Z)&&(De=function(lt){var vt=Ee.call(lt),Et=vt==q?lt.constructor:void 0,Lt=Et?qe(Et):void 0;if(Lt)switch(Lt){case Ce:return K;case Ge:return W;case We:return Y;case Ve:return J;case Ze:return Z}return vt});function xe(lt){return!!Se&&Se in lt}function ze(lt){var vt=lt&<.constructor,Et=typeof vt=="function"&&vt.prototype||ge;return lt===Et}function qe(lt){if(lt!=null){try{return pe.call(lt)}catch{}try{return lt+""}catch{}}return""}function Re(lt){return Xe(lt)&&ye.call(lt,"callee")&&(!Oe.call(lt,"callee")||Ee.call(lt)==D)}var Le=Array.isArray;function je(lt){return lt!=null&&ot(lt.length)&&!tt(lt)}function Xe(lt){return ft(lt)&&je(lt)}var Qe=Me||St;function He(lt){if(je(lt)&&(Le(lt)||typeof lt=="string"||typeof lt.splice=="function"||Qe(lt)||Re(lt)))return!lt.length;var vt=De(lt);if(vt==W||vt==J)return!lt.size;if(Ye||ze(lt))return!Pe(lt).length;for(var Et in lt)if(ye.call(lt,Et))return!1;return!0}function tt(lt){var vt=rt(lt)?Ee.call(lt):"";return vt==G||vt==U}function ot(lt){return typeof lt=="number"&<>-1&<%1==0&<<=F}function rt(lt){var vt=typeof lt;return!!lt&&(vt=="object"||vt=="function")}function ft(lt){return!!lt&&typeof lt=="object"}function St(){return!1}B.exports=He})(lodash_isempty,lodash_isempty.exports);var objectTag="[object Object]";function isHostObject(B){var R=!1;if(B!=null&&typeof B.toString!="function")try{R=!!(B+"")}catch{}return R}function overArg(B,R){return function(F){return B(R(F))}}var funcProto=Function.prototype,objectProto=Object.prototype,funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectCtorString=funcToString.call(Object),objectToString=objectProto.toString,getPrototype=overArg(Object.getPrototypeOf,Object);function isObjectLike(B){return!!B&&typeof B=="object"}function isPlainObject$1(B){if(!isObjectLike(B)||objectToString.call(B)!=objectTag||isHostObject(B))return!1;var R=getPrototype(B);if(R===null)return!0;var F=hasOwnProperty.call(R,"constructor")&&R.constructor;return typeof F=="function"&&F instanceof F&&funcToString.call(F)==objectCtorString}var lodash_isplainobject=isPlainObject$1,lodash_transform={exports:{}};(function(B,R){var F=200,D="Expected a function",G="__lodash_hash_undefined__",U=1,W=2,q=1/0,Y=9007199254740991,J="[object Arguments]",Z="[object Array]",K="[object Boolean]",te="[object Date]",Q="[object Error]",ie="[object Function]",se="[object GeneratorFunction]",ne="[object Map]",re="[object Number]",ae="[object Object]",ce="[object Promise]",he="[object RegExp]",fe="[object Set]",be="[object String]",ue="[object Symbol]",ge="[object WeakMap]",ve="[object ArrayBuffer]",Se="[object DataView]",pe="[object Float32Array]",ye="[object Float64Array]",Ee="[object Int8Array]",de="[object Int16Array]",we="[object Int32Array]",Oe="[object Uint8Array]",Me="[object Uint8ClampedArray]",Pe="[object Uint16Array]",Ne="[object Uint32Array]",ke=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ae=/^\w*$/,_e=/^\./,Fe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ye=/[\\^$.*+?()[\]{}|]/g,Ce=/\\(\\)?/g,Ge=/^\[object .+?Constructor\]$/,We=/^(?:0|[1-9]\d*)$/,Ve={};Ve[pe]=Ve[ye]=Ve[Ee]=Ve[de]=Ve[we]=Ve[Oe]=Ve[Me]=Ve[Pe]=Ve[Ne]=!0,Ve[J]=Ve[Z]=Ve[ve]=Ve[K]=Ve[Se]=Ve[te]=Ve[Q]=Ve[ie]=Ve[ne]=Ve[re]=Ve[ae]=Ve[he]=Ve[fe]=Ve[be]=Ve[ge]=!1;var Ze=typeof commonjsGlobal$1=="object"&&commonjsGlobal$1&&commonjsGlobal$1.Object===Object&&commonjsGlobal$1,nt=typeof self=="object"&&self&&self.Object===Object&&self,at=Ze||nt||Function("return this")(),ct=R&&!R.nodeType&&R,De=ct&&!0&&B&&!B.nodeType&&B,xe=De&&De.exports===ct,ze=xe&&Ze.process,qe=function(){try{return ze&&ze.binding("util")}catch{}}(),Re=qe&&qe.isTypedArray;function Le(Be,Ke){for(var ht=-1,yt=Be?Be.length:0;++ht-1}function rs(Be,Ke){var ht=this.__data__,yt=as(ht,Be);return yt<0?ht.push([Be,Ke]):ht[yt][1]=Ke,this}Bi.prototype.clear=Ps,Bi.prototype.delete=no,Bi.prototype.get=so,Bi.prototype.has=ro,Bi.prototype.set=rs;function Qi(Be){var Ke=-1,ht=Be?Be.length:0;for(this.clear();++KeAt))return!1;var ni=wt.get(Be);if(ni&&wt.get(Ke))return ni==Ke;var pi=-1,fi=!0,ci=Pt&U?new Dn:void 0;for(wt.set(Be,Ke),wt.set(Ke,Be);++pi-1&&Be%1==0&&Be-1&&Be%1==0&&Be<=Y}function Ai(Be){var Ke=typeof Be;return!!Be&&(Ke=="object"||Ke=="function")}function Gn(Be){return!!Be&&typeof Be=="object"}function zn(Be){return typeof Be=="symbol"||Gn(Be)&&ei.call(Be)==ue}var xi=Re?He(Re):Cs;function pr(Be){return Be==null?"":lr(Be)}function mr(Be,Ke,ht){var yt=Be==null?void 0:tr(Be,Ke);return yt===void 0?ht:yt}function gr(Be,Ke){return Be!=null&&yo(Be,Ke,nr)}function Un(Be){return Ns(Be)?As(Be):rr(Be)}function br(Be,Ke,ht){var yt=tn(Be)||xi(Be);if(Ke=An(Ke),ht==null)if(yt||Ai(Be)){var Pt=Be.constructor;yt?ht=tn(Be)?new Pt:[]:ht=oi(Pt)?Qs(ti(Be)):{}}else ht={};return(yt?Le:er)(Be,function(wt,Vt,At){return Ke(ht,wt,Vt,At)}),ht}function yr(Be){return Be}function _i(Be){return us(Be)?Xe(hs(Be)):ar(Be)}B.exports=br})(lodash_transform,lodash_transform.exports);const isEmpty$1=lodash_isempty.exports,isPlainObject=lodash_isplainobject,transform=lodash_transform.exports;var src=function B(R,{cleanKeys:F=[],cleanValues:D=[],emptyArrays:G=!0,emptyObjects:U=!0,emptyStrings:W=!0,NaNValues:q=!1,nullValues:Y=!0,undefinedValues:J=!0}={}){return transform(R,(Z,K,te)=>{if(!F.includes(te)&&((Array.isArray(K)||isPlainObject(K))&&(K=B(K,{NaNValues:q,cleanKeys:F,cleanValues:D,emptyArrays:G,emptyObjects:U,emptyStrings:W,nullValues:Y,undefinedValues:J})),!D.includes(K)&&!(U&&isPlainObject(K)&&isEmpty$1(K))&&!(G&&Array.isArray(K)&&!K.length)&&!(W&&K==="")&&!(q&&Number.isNaN(K))&&!(Y&&K===null)&&!(J&&K===void 0))){if(Array.isArray(Z))return Z.push(K);Z[te]=K}})};let isOpenLogin=!1;const request=extend$1({requestType:"json",timeout:1e4,prefix:getRequestHostname()});request.use(async(B,R)=>{B.req,await R()});request.interceptors.request.use((B,R)=>{const F=sessionStorage.getItem("Authorization")||"",D={};return F&&!["/api-auth/usernameLogin","/api-auth/smsLogin","/api-auth/code/sendSms"].includes(B)&&(D.Authorization=F),{url:B,options:{...R,params:src(R.params),headers:{...R.headers,...D}}}},{global:!1});request.interceptors.response.use(async(B,R)=>{if(new URL(B.url),B.status>299||B.status<200){const D="\u670D\u52A1\u5668\u9519\u8BEF\uFF0C\u72B6\u6001\u7801"+B.status;throw Toast(D),new Error(D)}const F=await B.clone().json();if(F.code!==200&&F.errCode!==0){const D=F.msg||F.message||"\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5";F.code===403||F.code===401||Toast(D);const G=browser();throw F.code===403&&G.isApp&&!isOpenLogin&&(G.android?(postMessage({api:"login"}),window.DAYA.postMessage(JSON.stringify({api:"login"}))):G.iPhone&&window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api:"login"}))),new Error(D)}return B},{global:!1});function _isSlot$1(B){return typeof B=="function"||Object.prototype.toString.call(B)==="[object Object]"&&!isVNode(B)}var Feedback=defineComponent({name:"ColexiuFeedBack",setup(){const B=ref("\u8BC6\u522B\u4E0D\u51C6"),R=ref(""),F=ref(!1),D=[{name:"\u8BC6\u522B\u4E0D\u51C6"},{name:"\u65E0\u6CD5\u8BC4\u6D4B"},{name:"\u4E0D\u51FA\u8BC4\u6D4B\u7ED3\u679C"},{name:"\u66F2\u8C31\u4E0D\u4E00\u81F4"},{name:"\u6307\u6CD5\u9519\u8BEF"},{name:"\u5176\u4ED6"}],G=()=>{var U;try{if(!R.value)return Toast("\u8BF7\u5148\u586B\u5199\u610F\u89C1\u53CD\u9988");F.value=!0,request.post("/sysParamConfig/add",{data:{content:R.value+"#"+B.value,type:"SMART_PRACTICE"}}),(U=suggestPopup$1.value)==null||U.close(),Toast("\u610F\u89C1\u53CD\u9988\u5DF2\u63D0\u4EA4")}catch{}F.value=!1};return()=>{let U;return createVNode("div",{class:styles$8.feedback},[createVNode("div",{class:styles$8.title},[createTextVNode("\u610F\u89C1\u53CD\u9988")]),createVNode("div",{class:styles$8.wrap},[createVNode("div",{class:styles$8.sub},[createTextVNode("\u8BF7\u9009\u62E9\u95EE\u9898\u7C7B\u578B\u5907\u4EFD")]),createVNode(RadioGroup,{class:styles$8.group,modelValue:B.value,"onUpdate:modelValue":W=>B.value=W},{default:()=>[createVNode(Row,{gutter:4},_isSlot$1(U=D.map(W=>createVNode(Col,{span:8},{default:()=>[createVNode(Radio,{name:W.name},{default:()=>[W.name]})]})))?U:{default:()=>[U]})]}),createVNode(Field,{type:"textarea",class:styles$8.text,placeholder:"\u8BF7\u8BE6\u7EC6\u63CF\u8FF0\u60A8\u9047\u5230\u7684\u95EE\u9898\uFF0C\u4EE5\u4FBF\u6211\u4EEC\u5C3D\u5FEB\u4E3A\u60A8\u89E3\u51B3\uFF01",maxlength:200,rows:"2",autosize:!0,"show-word-limit":!0,modelValue:R.value,"onUpdate:modelValue":W=>R.value=W},null),createVNode("div",{style:{display:"flex",justifyContent:"center"}},[createVNode(Button,{onClick:G,class:styles$8.submit},{default:()=>[createVNode("img",{style:{width:"100%"},src:bgSubmit,alt:"\u63D0\u4EA4"},null)]})])])])}}});const suggestPopup=ref(null),confirmShow$1=ref(!1),switchProps$2={"active-color":"#2dc7aa","inactive-color":"#CCCCCC",size:"20px"};var Seet=defineComponent({name:"ColexiuSettingSett",setup(){return()=>createVNode(Fragment,null,[createVNode("div",null,[createVNode(NoticeBar,{class:styles$b.noticebar,"left-icon":InfoIcon,background:"#FFF6E8",color:"var(--van-primary-color)",text:"\u5168\u5C40\u8BBE\u7F6E\u4F1A\u66F4\u6539\u6240\u6709\u4E50\u8C31\u7EC3\u4E60\u53CA\u8BC4\u6D4B"},null),createVNode("div",{class:styles$b.groupBox,style:{height:"auto"}},[createVNode(Cell,{center:!0,border:!1,title:"\u62A4\u773C\u6A21\u5F0F"},{default:()=>[createVNode(Switch,mergeProps({modelValue:state$3.sett.eyeProtection,"onUpdate:modelValue":B=>state$3.sett.eyeProtection=B},switchProps$2),null)]}),createVNode(Divider,null,null)]),createVNode("div",{class:styles$b.btnsbar},[createVNode("div",{class:styles$b.btn,onClick:()=>show.value=!0},[createVNode("img",{class:styles$b.iconBtn,src:iconTv},null),createTextVNode("\u6295\u5C4F\u5E2E\u52A9")]),createVNode("div",{class:styles$b.btn,onClick:()=>{var B;(B=suggestPopup.value)==null||B.onShow()}},[createVNode("img",{class:styles$b.iconBtn,src:iconYijian},null),createTextVNode("\u610F\u89C1\u53CD\u9988")])])]),createVNode(Popups,{ref:suggestPopup,overlay:!1,style:{borderRadius:"8px"}},{default:()=>[createVNode(Feedback,null,null)]}),createVNode(Dialog.Component,{teleport:"body",class:styles$a.confirm,style:{overflow:"initial"},show:confirmShow$1.value,"onUpdate:show":B=>confirmShow$1.value=B,message:"\u8BBE\u7F6E\u6210\u529F\uFF0C\u662F\u5426\u7ACB\u5373\u91CD\u65B0\u52A0\u8F7D\uFF1F"},{title:()=>createVNode("img",{class:styles$a.iconTitle,src:iconTitle$1},null),footer:()=>createVNode("div",{class:styles$a.footer},[createVNode("img",{src:iconCancel,onClick:()=>confirmShow$1.value=!1},null),createVNode("img",{src:iconConfirm,onClick:useReload},null)])})])}});ref(!1);const switchProps$1={"active-color":"#2dc7aa","inactive-color":"#CCCCCC",size:"20px"};var Practise=defineComponent({name:"ColexiuSettingPractise",setup(){return()=>createVNode("div",null,[createVNode("div",{class:styles$b.groupBox},[createVNode(Cell,{center:!0,border:!1,title:"\u5FAA\u73AF\u64AD\u653E"},{default:()=>[createVNode(Switch,mergeProps({modelValue:state$3.sett.loop,"onUpdate:modelValue":B=>state$3.sett.loop=B},switchProps$1),{default:()=>[createTextVNode("off")]})]}),createVNode(Divider,null,null),createVNode(Cell,{center:!0,border:!1,title:"\u663E\u793A\u6307\u6CD5"},{default:()=>[createVNode(Switch,mergeProps({modelValue:state$3.sett.fingering,"onUpdate:modelValue":B=>state$3.sett.fingering=B},switchProps$1,{onChange:B=>{state$3.sett.fingering=B,event$1.emit("settingFingeringChange")}}),{default:()=>[createTextVNode("off")]})]})])])}});const switchProps={"active-color":"#2dc7aa","inactive-color":"#CCCCCC",size:"20px"};var Evaluat=defineComponent({name:"ColexiuSettingPractise",setup(){return()=>createVNode("div",null,[createVNode("div",{class:styles$b.groupBox},[createVNode(Cell,{center:!0,border:!1,title:"\u8BC4\u6D4B\u96BE\u5EA6"},{default:()=>[createVNode(RadioGroup,{iconSize:20,class:styles$b.radioGroup,modelValue:state$3.eva.difficulty,"onUpdate:modelValue":B=>state$3.eva.difficulty=B},{default:()=>[createVNode(Radio,{name:"BEGINNER"},{default:()=>[createTextVNode("\u5165\u95E8")]}),createVNode(Radio,{name:"ADVANCED"},{default:()=>[createTextVNode("\u8FDB\u9636")]}),createVNode(Radio,{name:"PERFORMER"},{default:()=>[createTextVNode("\u5927\u5E08")]})]})]}),createVNode(Divider,null,null),createVNode(Cell,{center:!0,border:!1,title:"\u6821\u97F3\u63D0\u9192"},{default:()=>[createVNode(Switch,mergeProps({modelValue:state$3.sett.tuning,"onUpdate:modelValue":B=>state$3.sett.tuning=B},switchProps),{default:()=>[createTextVNode("off")]})]}),createVNode(Divider,null,null),createVNode(Cell,{center:!0,border:!1,title:"\u6444\u50CF\u5934"},{default:()=>[createVNode(Switch,mergeProps({modelValue:state$3.sett.camera,"onUpdate:modelValue":B=>state$3.sett.camera=B},switchProps),{default:()=>[createTextVNode("off")]})]}),state$3.sett.camera&&createVNode(Fragment,null,[createVNode(Divider,null,null),createVNode("div",{class:styles$b.sliderWrap},[createVNode("div",{class:"cell__title"},[createTextVNode("\u900F\u660E\u5EA6")]),createVNode(Slider,{min:0,max:100,modelValue:state$3.sett.opacity,"onUpdate:modelValue":B=>state$3.sett.opacity=B},{button:()=>createVNode("div",{class:styles$b.slider},[state$3.sett.opacity])})])]),createVNode(Divider,null,null),createVNode(Cell,{center:!0,border:!1,title:"\u4FDD\u5B58\u5230\u76F8\u518C"},{default:()=>[createVNode(Switch,mergeProps({modelValue:state$3.eva.save,"onUpdate:modelValue":B=>state$3.eva.save=B},switchProps),{default:()=>[createTextVNode("off")]})]}),createVNode(Divider,null,null),createVNode(Cell,{center:!0,border:!1,title:"\u8BC4\u6D4B\u4F34\u594F"},{default:()=>[createVNode(Switch,mergeProps({modelValue:state$3.eva.mute,"onUpdate:modelValue":B=>state$3.eva.mute=B},switchProps),{default:()=>[createTextVNode("off")]})]}),createVNode(Divider,null,null),createVNode(Cell,{center:!0,border:!1,title:"\u6807\u51C6\u97F3\u9AD8"},{default:()=>[createVNode("div",{style:{display:"flex"}},[createVNode(RadioGroup,{iconSize:20,class:styles$b.radioGroup,modelValue:state$3.sett.hertz,"onUpdate:modelValue":B=>state$3.sett.hertz=B},{default:()=>[createVNode(Radio,{name:440},{default:()=>[createTextVNode("440")]}),createVNode(Radio,{name:442},{default:()=>[createTextVNode("442")]})]})])]}),createVNode(Divider,null,null),createVNode(Cell,{center:!0,border:!1,title:"\u53CD\u5E94\u65F6\u95F4(\u6BEB\u79D2)"},{default:()=>[createVNode(Field,{modelValue:state$3.eva.reactionTimeMs,"onUpdate:modelValue":B=>state$3.eva.reactionTimeMs=B,inputAlign:"right",onBlur:()=>{state$3.eva.reactionTimeMs=Math.max(-300,Math.min(300,state$3.eva.reactionTimeMs))||0}},null)]})])])}}),Setting=defineComponent({name:"ColexiuSetting",props:{active:{type:String,default:"1"}},setup(B){return()=>createVNode("div",{class:styles$b.setting},[createVNode(Tabs,{active:B.active},{default:()=>[createVNode(Tab,{title:"\u5168\u5C40\u8BBE\u7F6E",name:"1"},{default:()=>[createVNode(Seet,null,null)]}),createVNode(Tab,{title:"\u7EC3\u4E60\u8BBE\u7F6E",name:"2"},{default:()=>[createVNode(Practise,null,null)]}),createVNode(Tab,{title:"\u8BC4\u6D4B\u8BBE\u7F6E",name:"3"},{default:()=>[createVNode(Evaluat,null,null)]})]})])}});const modelWraper="_modelWraper_c5u6u_1",wrap$1="_wrap_c5u6u_8";var styles$6={modelWraper,wrap:wrap$1},model1="/orchestra-music-score/assets/model-1.1ac5f313.png",model2="/orchestra-music-score/assets/model-2.b78c0c58.png",model3="/orchestra-music-score/assets/model-3.a2cf2c61.png",ModelWraper=defineComponent({name:"modelWraper",props:{show:{type:Boolean,default:!1},onChangeModelType:{type:Function,default:()=>{}}},setup(B,R){return()=>createVNode(Teleport,{to:"body"},{default:()=>[createVNode(Transition,{name:"van-fade"},{default:()=>[B.show&&createVNode("div",{class:styles$6.modelWraper},[createVNode("div",{class:styles$6.wrap},[createVNode("img",{"data-step":"step0",onClick:()=>B.onChangeModelType("practice"),src:model1},null),createVNode("img",{"data-step":"step1",onClick:()=>B.onChangeModelType("follow"),src:model3},null),createVNode("img",{"data-step":"step2",onClick:()=>B.onChangeModelType("evaluation"),src:model2},null)])])]})]})}});const follow="_follow_1izp1_4",title$1="_title_1izp1_12",endBtns="_endBtns_1izp1_16",button$2="_button_1izp1_21",hasText$1="_hasText_1izp1_29",bigIcon$1="_bigIcon_1izp1_52",start$2="_start_1izp1_59";var styles$5={follow,title:title$1,endBtns,button:button$2,hasText:hasText$1,bigIcon:bigIcon$1,start:start$2},iconFollwBtn="/orchestra-music-score/assets/icon-follwBtn.9fb45e5d.png";const togglePlayer=(B=!1)=>{let R=document.querySelector("#globalPlayer");R&&(R.style.display=B?"":"none")},data=reactive({list:[],index:0,start:!1});useToggle(!0);const noteFrequency=ref(0),audioFrequency=ref(0),followTime=ref(0),openToggleRecord=(B=!0)=>{if(postMessage({api:"cloudToggleFollow",content:{state:B?"start":"end"}}),B)followTime.value=Date.now();else{const R=Date.now()-followTime.value;followTime.value!==0&&R>0&&(followTime.value=0)}};""+new Date().valueOf();const onClear=()=>{state$2.times.forEach(B=>{const R=document.querySelector(`div[data-vf=vf${B.id}]`);R&&(R.classList.remove("follow-error"),R.classList.remove("follow-success"))})},handleStart=()=>{onClear(),data.start=!0,openToggleRecord(!0),data.index=0,data.list=[],state.osmd.cursor.reset(),getNoteIndex(),refreshView()},handleEnd=()=>{data.start=!1,openToggleRecord(!1),data.index=0,state.osmd.cursor.reset(),getNoteIndex()},next=()=>{state.osmd.product?state.osmd.cursor.setPosition(state$2.times[data.index].cursorBox):state.osmd.cursor.next(),refreshView()},getNoteIndex=()=>{const B=state$2.times[data.index];return B.frequency?(noteFrequency.value=B.frequency,state$2.fixedKey=B.realKey,{id:B.id,min:B.frequency-(B.frequency-B.noteElement.pitch.prevFrequency)*.1,max:B.frequency+(B.noteElement.pitch.nextFrequency-B.frequency)*.1}):(data.index=data.index+1,next(),getNoteIndex())};let checking=!1;const onFollowTime=B=>{var F;const R=(F=B==null?void 0:B.content)==null?void 0:F.frequency;audioFrequency.value=R,data.list.push(R),checked()},checked=()=>{if(checking)return;checking=!0;const B=getNoteIndex();for(let R=0;RB.min&&F{const F=document.querySelector(`div[data-vf=vf${B.id}]`);F&&(R?(F.classList.remove("follow-error"),F.classList.add("follow-success")):(F.classList.remove("follow-success"),F.classList.add("follow-error")))};var Follow=defineComponent({name:"follow",setup(B,{expose:R}){return onMounted(()=>{togglePlayer(),console.log("\u5F00\u59CB\u76D1\u542C"),listenerMessage("cloudFollowTime",onFollowTime)}),onUnmounted(()=>{removeListenerMessage("cloudFollowTime",onFollowTime),togglePlayer(!0),onClear()}),R({data,handleEnd}),()=>createVNode(Teleport,{to:"#colexiu-detail-music-sheet"},{default:()=>[createVNode("div",{class:styles$5.follow},[createVNode(Transition,{name:"start",duration:300},{default:()=>[!data.start&&createVNode(Button,{style:{backgroundImage:`url(${iconFollwBtn})`},class:[styles$5.button,styles$5.start,styles$5.followBtn],onClick:()=>handleStart()},null)]})])]})}}),iconFollowEndBtn="/orchestra-music-score/assets/icon-followEndBtn.e0a26c1c.png",iconEvaluatingEnd="/orchestra-music-score/assets/icon-evaluatingEnd.51749d64.png";const container$2="_container_ggxgn_1",moreButton="_moreButton_ggxgn_19",centerButton="_centerButton_ggxgn_23",leftButton="_leftButton_ggxgn_29",titleWrap="_titleWrap_ggxgn_33",title="_title_ggxgn_33",album="_album_ggxgn_44",button$1="_button_ggxgn_48",hasText="_hasText_ggxgn_56",bigIcon="_bigIcon_ggxgn_79",evaluatBtn="_evaluatBtn_ggxgn_86",start$1="_start_ggxgn_89",icon="_icon_ggxgn_104",onShow="_onShow_ggxgn_107",popover="_popover_ggxgn_110",backbtn="_backbtn_ggxgn_117",speed="_speed_ggxgn_123",schedule="_schedule_ggxgn_162",ring="_ring_ggxgn_168",speedButton="_speedButton_ggxgn_178",label="_label_ggxgn_181",player$1="_player_ggxgn_192",fullbtn="_fullbtn_ggxgn_200",finish="_finish_ggxgn_209",dialogueBox="_dialogueBox_ggxgn_259",dialogue="_dialogue_ggxgn_259",dialogueIcon="_dialogueIcon_ggxgn_285",inRadioIcon="_inRadioIcon_ggxgn_290",inRadio="_inRadio_ggxgn_290",animation="_animation_ggxgn_311",btnMusicList="_btnMusicList_ggxgn_316",toggleMusicType="_toggleMusicType_ggxgn_328",slider="_slider_ggxgn_361",followEndBtn="_followEndBtn_ggxgn_388";var styles$4={container:container$2,moreButton,centerButton,leftButton,titleWrap,title,album,button:button$1,hasText,bigIcon,evaluatBtn,start:start$1,icon,onShow,popover,backbtn,speed,schedule,ring,speedButton,label,player:player$1,fullbtn,finish,dialogueBox,dialogue,dialogueIcon,inRadioIcon,inRadio,animation,btnMusicList,toggleMusicType,slider,followEndBtn};const confirmShow=ref(!1),startButtonShow=ref(!0),evaluatingRef=ref({}),settingPopup=ref(null);ref(null);const followRef=ref(null),animate$1={mounted:B=>{B.addEventListener("click",R=>{R.target.classList.add("animate__animated","animate__tada")}),B.addEventListener("animationend",R=>{R.target.classList.remove("animate__animated","animate__tada")})}},back=()=>{postMessage({api:"back"})},startEvaluat=()=>{console.log("\u5F00\u59CB\u8BC4\u6D4B"),state.evaluatingStatus=!0,setCurrentTime(0)},modelType=ref("init"),modelWraperShow=ref(!0),onChangeModelType=B=>{var R;if(modelWraperShow.value=!1,B!==modelType.value){if(B==="evaluation")changeSpeed((R=state$2.activeDetail)==null?void 0:R.originalSpeed,!1),startEvaluat();else{const F=store_legacy.get("speeds")||{},D=useOriginSearch();F[D.id]&&changeSpeed(F[D.id])}nextTick(()=>{modelType.value=B})}};var Buttons=defineComponent({name:"Colexiu-Buttons",directives:{animate:animate$1},props:{onSetMusicScoreType:{type:Function,default:B=>{}}},emits:["setMusicScoreType"],setup(B,{emit:R}){const F=useOriginSearch(),D={query:F},[G]=useWiredHeadsetCheck(),U=ref(),[W]=useMenu(),q=ref(!1),Y=()=>{D.query.modelType};onMounted(()=>{Y()});const J=ref(!1),Z=ref(""),K=ie=>{Z.value=ie.text,confirmShow.value=!0},te=()=>{Z.value==="\u4E94\u7EBF\u8C31"?state$3.sett.type="staff":Z.value==="\u7B80\u8C31"?(state$3.sett.type="jianpu",state$3.sett.keySignature=!1):Z.value==="\u56FA\u5B9A\u8C03"&&(state$3.sett.type="jianpu",state$3.sett.keySignature=!0)},Q=ie=>{if(ie==="staff")return state$3.sett.type===ie;if(ie==="shoudiao")return state$3.sett.type==="jianpu"&&!state$3.sett.keySignature;if(ie==="guding")return state$3.sett.type==="jianpu"&&state$3.sett.keySignature};return()=>{var se,ne,re,ae,ce,he,fe,be,ue;const ie=((se=state$2.activeDetail)!=null&&se.isAppPlay?((ne=state$2.activeDetail)==null?void 0:ne.midiUrl)==="":state.isFirstPlay||((re=state.audiosInstance)==null?void 0:re.length)==1)||state.evaluatingStatus||((ae=state$2.activeDetail)==null?void 0:ae.isAppPlay)&&state$2.midiPlayIniting;return createVNode("div",{class:[styles$4.container,W.value?"animate__animated animate__fadeInDown":"animate__animated animate__fadeOutUp"],style:D.query.headerHeight?{paddingTop:D.query.headerHeight+"px"}:{}},[createVNode("div",{class:styles$4.leftButton},[!((ce=D.query)!=null&&ce.modelType)&&createVNode(Button,{class:[styles$4.button,styles$4.backbtn],onClick:back},{default:()=>[createVNode(ButtonIcon,{name:"icon-back"},null)]}),createVNode("div",{class:styles$4.titleWrap},[createVNode("div",{class:styles$4.title},[(he=state$2.activeDetail)==null?void 0:he.musicSheetName]),F.albumName&&createVNode("div",{class:styles$4.album},[F.albumName])])]),createVNode("div",{class:styles$4.centerButton},[createVNode(Transition,{name:"finish"},{default:()=>{var ge,ve;return[G.value&&!((ge=evaluatingRef.value)!=null&&ge.connentLoading)&&!startButtonShow.value&&createVNode(Button,{style:{backgroundImage:`url(${iconEvaluatingEnd})`},class:[styles$4.button,styles$4.finish],onClick:()=>{var Se,pe;(pe=(Se=evaluatingRef.value)==null?void 0:Se.playerStop)==null||pe.call(Se)}},null),((ve=followRef==null?void 0:followRef.value)==null?void 0:ve.data.start)&&createVNode(Button,{style:{backgroundImage:`url(${iconFollowEndBtn})`},class:[styles$4.button,styles$4.finish,styles$4.followEndBtn],onClick:()=>{var Se,pe;(pe=(Se=followRef.value)==null?void 0:Se.handleEnd)==null||pe.call(Se)}},null)]}})]),createVNode("div",{class:[styles$4.moreButton],style:{opacity:state$2.initRendered?1:0}},[((fe=D.query)==null?void 0:fe.modelType)=="practice"&&modelType.value!=="init"&&!state$2.frozenMode&&createVNode(Button,{"data-step":"m1",class:[styles$4.button,styles$4.hasText],disabled:state.evaluatingStatus&&!startButtonShow.value||((be=followRef.value)==null?void 0:be.data.start),onClick:()=>{var ge,ve,Se;modelType.value==="practice"&&(resetPlayStatus(),setCurrentTime(0)),modelType.value==="evaluation"&&(state.evaluatingStatus=!1,(((ge=evaluatingRef.value)==null?void 0:ge.playStatus.value)==="play"||((ve=evaluatingRef.value)==null?void 0:ve.playStatus.value)==="connecting")&&((Se=evaluatingRef.value)==null||Se.cancelTheEvaluation())),modelType.value="init",modelWraperShow.value=!0}},{default:()=>[createVNode(ButtonIcon,{key:"modelType",name:["init","practice"].includes(modelType.value)?"modelType":["follow"].includes(modelType.value)?"modelType1":"modelType2"},null),createVNode("span",null,[createTextVNode("\u6A21\u5F0F")])]}),modelType.value==="evaluation"&&createVNode(Fragment,null,[createVNode(Popover,{show:q.value,"onUpdate:show":ge=>q.value=ge,overlay:!1,placement:"bottom-end",class:"cameraPopover","show-arrow":!1},{default:()=>[createVNode(CellGroup,{border:!1},{default:()=>[createVNode(Cell,{center:!0,title:"\u6444\u50CF\u5934"},{default:()=>[createVNode("div",{style:"display:flex;justify-content: flex-end;"},[createVNode(Switch,mergeProps({disabled:!startButtonShow.value,modelValue:state$3.sett.camera,"onUpdate:modelValue":ge=>state$3.sett.camera=ge},switchProps),{default:()=>[createTextVNode("off")]})])]}),state$3.sett.camera&&createVNode(Cell,{class:"cameraOpacity",center:!0,title:"\u900F\u660E\u5EA6"},{default:()=>[createVNode(Slider,{min:0,max:100,modelValue:state$3.sett.opacity,"onUpdate:modelValue":ge=>state$3.sett.opacity=ge},{button:()=>createVNode("div",{class:styles$4.slider},[state$3.sett.opacity])})]})]})],reference:()=>createVNode("div",null,[createVNode(Button,{class:[styles$4.button,styles$4.hasText]},{default:()=>[createVNode(ButtonIcon,{key:"camera",name:"camera"},null),createVNode("span",null,[createTextVNode("\u6444\u50CF\u5934")])]})])}),createVNode("div",{style:{display:"none"}},[state.evaluatingStatus?createVNode(Evaluating,{ref:evaluatingRef,key:"lianxi"},null):createVNode(Button,{class:[styles$4.button,styles$4.hasText],onClick:startEvaluat},{default:()=>[createVNode(ButtonIcon,{key:"evaluating",name:"evaluating"},null),createVNode("span",null,[createTextVNode("\u8BC4\u6D4B")])]})])]),modelType.value==="practice"&&createVNode(Fragment,null,[createVNode(Button,{"data-step":"m2",class:[styles$4.button,styles$4.hasText],onClick:()=>changeMode(state.mode==="background"?"music":"background"),disabled:ie},{default:()=>[createVNode(ButtonIcon,{key:"music",name:state.mode==="music"?"music":"accompaniment"},null),createVNode("span",null,[state.mode==="background"?"\u4F34\u594F":"\u539F\u58F0"])]}),createVNode(Button,{"data-step":"m3",class:[styles$4.button,styles$4.hasText],onClick:sectionChange,disabled:state.evaluatingStatus},{default:()=>[createVNode(ButtonIcon,{key:"section",name:"section"+(state$2.section.length&&state$2.section.length<=2?state$2.section.length:"")},null),createVNode("span",null,[createTextVNode("\u9009\u6BB5")])]}),createVNode(Button,{"data-step":"m4",class:[styles$4.button,styles$4.hasText],onClick:()=>{state$3.sett.fingering=!state$3.sett.fingering,event$1.emit("settingFingeringChange")}},{default:()=>[createVNode(ButtonIcon,{key:"music",name:state$3.sett.fingering?"fingeringOn":"fingeringOff"},null),createVNode("span",null,[createTextVNode("\u6307\u6CD5")])]})]),["practice","evaluation"].includes(modelType.value)&&createVNode(Popover,{trigger:"manual",overlay:!1,placement:"bottom",class:styles$4.popover,show:W.value&&state.speedShow&&!(state.evaluatingStatus||state.playState==="play"),"onUpdate:show":ge=>state.speedShow=ge},{default:()=>[createVNode(Speed,{ref:U,updateSpeed:ge=>state.speed=ge,changed:changeSpeed,mode:state.mode,changeMode,lib:{speed:state.speed},class:styles$4.speed},null)],reference:()=>createVNode(Button,{"data-step":"m5",class:[styles$4.button,styles$4.hasText,styles$4.speedButton],disabled:state.evaluatingStatus||state.playState==="play",onClick:()=>{var ge;(ge=U.value)==null||ge.refUpdateSpeed(state.speed),state.speedShow=!state.speedShow}},{default:()=>[createVNode(ButtonIcon,{name:"speed"},null),createVNode("span",null,[createTextVNode("\u901F\u5EA6")]),createVNode("span",{class:styles$4.label},[state.speed])]})}),(ue=state$2.activeDetail)!=null&&ue.notation?createVNode(Popover,{class:styles$4.toggleMusicType,placement:"bottom-end",show:J.value,"onUpdate:show":ge=>{var ve;state.playState==="play"||state.evaluatingStatus&&!startButtonShow.value||((ve=followRef.value)==null?void 0:ve.data.start)||(J.value=ge)}},{reference:()=>{var ge;return createVNode(Button,{disabled:state.playState==="play"||state.evaluatingStatus&&!startButtonShow.value||((ge=followRef.value)==null?void 0:ge.data.start),class:[styles$4.button,styles$4.hasText,styles$4.speedButton]},{default:()=>[createVNode(ButtonIcon,{name:"icon-zhuanpu"},null),createVNode("span",null,[Q("staff")?"\u8F6C\u7B80\u8C31":"\u8F6C\u4E94\u7EBF\u8C31"])]})},default:()=>createVNode(Fragment,null,[createVNode("div",{role:"menuitem",class:"van-popover__action",onClick:()=>K({text:"\u4E94\u7EBF\u8C31"})},[createVNode(ButtonIcon,{key:"type",name:Q("staff")?"icon-staff-active":"icon-staff"},null),createVNode("div",{class:["action-text",Q("staff")&&"action-active"]},[createTextVNode("\u4E94\u7EBF\u8C31")])]),createVNode("div",{role:"menuitem",class:"van-popover__action",onClick:()=>K({text:"\u7B80\u8C31"})},[createVNode(ButtonIcon,{key:"type",name:Q("shoudiao")?"shuodiao-active":"shuodiao"},null),createVNode("div",{class:["action-text",Q("shoudiao")&&"action-active"]},[createTextVNode("\u9996\u8C03")])]),createVNode("div",{role:"menuitem",class:"van-popover__action",onClick:()=>K({text:"\u56FA\u5B9A\u8C03"})},[createVNode(ButtonIcon,{key:"type",name:Q("guding")?"guding-active":"guding"},null),createVNode("div",{class:["action-text",Q("guding")&&"action-active"]},[createTextVNode("\u56FA\u5B9A\u8C03")])])])}):null,state$2.initRendered&&createVNode(Fragment,null,[createVNode(Button,{class:[styles$4.button,styles$4.hasText],onClick:()=>{var ge;(ge=settingPopup.value)==null||ge.onShow()},disabled:state.evaluatingStatus&&!startButtonShow.value},{default:()=>[createVNode(ButtonIcon,{name:"setting"},null),createVNode("span",null,[createTextVNode("\u8BBE\u7F6E")])]}),createVNode(Popups,{ref:settingPopup,style:{borderRadius:"8px"}},{default:()=>[createVNode(Setting,{active:modelType.value=="practice"?"2":modelType.value=="evaluation"?"3":"1"},null)]})]),modelType.value==="follow"&&createVNode(Fragment,null,[createVNode(Follow,{ref:followRef},null)])]),state$2.initRendered&&!state$2.frozenMode&&createVNode(ModelWraper,{show:modelWraperShow.value,onChangeModelType},null),createVNode(FloatWraper,null,null),createVNode(Dialog.Component,{teleport:"body",class:styles$a.confirm,style:{overflow:"initial"},show:confirmShow.value,"onUpdate:show":ge=>confirmShow.value=ge,message:"\u8BBE\u7F6E\u6210\u529F\uFF0C\u662F\u5426\u7ACB\u5373\u91CD\u65B0\u52A0\u8F7D\uFF1F"},{title:()=>createVNode("img",{class:styles$a.iconTitle,src:iconTitle$1},null),footer:()=>createVNode("div",{class:styles$a.footer},[createVNode("img",{src:iconCancel,onClick:()=>confirmShow.value=!1},null),createVNode("img",{src:iconConfirm,onClick:()=>{te(),useReload()}},null)])})])}}}),Image1$1="/orchestra-music-score/assets/5.d8bfbf51.png",Image2$1="/orchestra-music-score/assets/4.cfa387c7.png",Image3$1="/orchestra-music-score/assets/3.d02c685a.png",Image4$1="/orchestra-music-score/assets/2.5c4c2ef5.png",Image5$1="/orchestra-music-score/assets/1.a0d5037d.png",IconBad="/orchestra-music-score/assets/bad.d9395829.png",IconGood="/orchestra-music-score/assets/good.b0fbfb32.png",IconGreat="/orchestra-music-score/assets/great.55272f0a.png",IconPerfect="/orchestra-music-score/assets/perfect.ab44b0e5.png";const icons={1:{icon:IconBad,text:"bad"},2:{icon:IconGood,text:"good"},3:{icon:IconGreat,text:"great"},4:{icon:IconPerfect,text:"perfect"}};var constant={1:{img:Image1$1,tips:"\u4F60\u7684\u6F14\u594F\u4E0D\u592A\u597D\uFF0C\u518D\u7EC3\u4E00\u7EC3\u5427\uFF5E",mome:"\u6562\u4E8E\u5C1D\u8BD5"},2:{img:Image2$1,tips:"\u4F60\u7684\u6F14\u594F\u8FD8\u4E0D\u719F\u7EC3\uFF0C\u52A0\u7D27\u8BAD\u7EC3\u624D\u80FD\u6709\u597D\u6210\u7EE9\u54E6\uFF5E",mome:"\u8FD8\u8981\u52A0\u6CB9\u54E6\uFF5E"},3:{img:Image3$1,tips:"\u4F60\u7684\u6F14\u594F\u8FD8\u4E0D\u6D41\u7545\uFF0C\u79D1\u5B66\u7684\u7EC3\u4E60\u624D\u80FD\u66F4\u5B8C\u7F8E\u54E6\uFF5E",mome:"\u7A81\u7834\u81EA\u6211"},4:{img:Image4$1,tips:"\u4F60\u7684\u6F14\u594F\u8FD8\u4E0D\u9519\uFF0C\u7EE7\u7EED\u52A0\u6CB9\u5427\uFF0C\u79BB\u5B8C\u7F8E\u5C31\u5DEE\u4E00\u6B65\u5566\uFF5E",mome:"\u5D2D\u9732\u5934\u89D2"},5:{img:Image5$1,tips:"\u4F60\u7684\u6F14\u594F\u5B8C\u7F8E\u65E0\u7F3A\uFF0C\u7EE7\u7EED\u52AA\u529B\u5427\uFF5E",mome:"\u4F60\u5F88\u68D2"}};const getLeveByScoreId=B=>{if(!B&&typeof B!="number")return{};let R=1;return B>20&&B<=40?R=2:B>40&&B<=60?R=3:B>60&&B<=80?R=4:B>80&&(R=5),R},getLeveByScore=B=>{if(!B&&typeof B!="number")return{};let R=getLeveByScoreId(B);return constant[R]},getLeveByScoreMeasure=B=>{if(!B&&typeof B!="number")return{};let R=1;return B>=40&&B<70?R=2:B>=70&&B<90?R=3:B>=90&&(R=4),icons[R]};var iconBack="/orchestra-music-score/assets/back.64a0fc99.svg",iconLianxi="/orchestra-music-score/assets/icon-lianxi.104eeb83.svg",iconReport="/orchestra-music-score/assets/icon-report.7c7e9fcf.svg",TryIcon="/orchestra-music-score/assets/try.8a1d0eec.svg",IntegrityIcon="/orchestra-music-score/assets/integrity.f311836f.svg",IntonationIcon="/orchestra-music-score/assets/intonation.64e00f66.svg",CadenceIcon="/orchestra-music-score/assets/cadence.18a7a60b.svg",Image1="/orchestra-music-score/assets/5.a95933dd.svg",Image2="/orchestra-music-score/assets/4.49f14e1f.svg",Image3="/orchestra-music-score/assets/3.240ee5fd.svg",Image4="/orchestra-music-score/assets/2.ce512136.svg",Image5="/orchestra-music-score/assets/1.4f4ca226.png",iconShare="/orchestra-music-score/assets/icon-share.9f124616.svg",iconUpload="/orchestra-music-score/assets/icon-upload.53f774c1.svg";const scoreInfos={1:{img:Image1,tips:"\u4F60\u7684\u6F14\u594F\u4E0D\u592A\u597D\uFF0C\u97F3\u51C6\u548C\u5B8C\u6574\u6027\u8FD8\u9700\u52A0\u5F3A\uFF0C\u518D\u7EC3\u4E00\u7EC3\u5427\uFF5E",mome:"\u6562\u4E8E\u5C1D\u8BD5"},2:{img:Image2,tips:"\u4F60\u7684\u6F14\u594F\u8FD8\u4E0D\u719F\u7EC3\uFF0C\u97F3\u51C6\u548C\u5B8C\u6574\u6027\u8FD8\u9700\u52A0\u5F3A\uFF0C\u52A0\u7D27\u8BAD\u7EC3\u624D\u80FD\u6709\u597D\u6210\u7EE9\u54E6\uFF5E",mome:"\u8FD8\u8981\u52A0\u6CB9\u54E6"},3:{img:Image3,tips:"\u4F60\u7684\u6F14\u594F\u8FD8\u4E0D\u6D41\u7545\uFF0C\u97F3\u51C6\u548C\u8282\u594F\u8FD8\u9700\u52A0\u5F3A\uFF0C\u79D1\u5B66\u7684\u7EC3\u4E60\u624D\u80FD\u66F4\u5B8C\u7F8E\u54E6\uFF5E",mome:"\u7A81\u7834\u81EA\u6211"},4:{img:Image4,tips:"\u4F60\u7684\u6F14\u594F\u8FD8\u4E0D\u9519\uFF0C\u7EE7\u7EED\u52A0\u6CB9\u5427\uFF0C\u52A0\u5F3A\u97F3\u51C6\uFF0C\u79BB\u5B8C\u7F8E\u5C31\u5DEE\u4E00\u6B65\u5566\uFF5E",mome:"\u5D2D\u9732\u5934\u89D2"},5:{img:Image5,tips:"\u4F60\u7684\u6F14\u594F\u975E\u5E38\u4E0D\u9519\uFF0C\u97F3\u51C6\u7684\u628A\u63E1\u548C\u8282\u594F\u7A0D\u6709\u7455\u75B5\uFF0C\u5B8C\u6574\u6027\u628A\u63E1\u7684\u5F88\u597D~",mome:"\u4F60\u5F88\u68D2"}};ref(!1);var Content=defineComponent({name:"ColexiuEvaluatingContent",props:{data:{type:Object,default:()=>null}},emits:["restart","upload"],setup(B,{emit:R}){const F=useOriginSearch(),D=ref(!1),G=ref(""),{data:U}=toRefs(B),W=location.origin.indexOf("localhost")>-1||location.origin.indexOf("192.168")>-1?"":"/orchestra-music-score",q=()=>{var te,Q,ie,se,ne,re,ae,ce,he;const K={id:(te=U.value)==null?void 0:te.recordId,musicId:F.id,name:((Q=state$4.user)==null?void 0:Q.username)||"",subjectName:(((ie=state$4.user)==null?void 0:ie.subjectName)||"").split(",")[0]||"",avatar:encodeURIComponent(((se=state$4.user)==null?void 0:se.avatar)||""),score:((ne=U.value)==null?void 0:ne.score)||0,examSongName:((re=state$2.activeDetail)==null?void 0:re.examSongName)||""};return state$2.isPercussion||(K.intonation=(ae=U.value)==null?void 0:ae.intonation,K.cadence=(ce=U.value)==null?void 0:ce.cadence,K.integrity=(he=U.value)==null?void 0:he.integrity),`${location.origin}${W}/share-colexiu-evaluating/index.html?${queryString.stringify(K)}`},Y=K=>{const te=K.target;te&&(te.contentWindow.setPng=Q=>{G.value=Q})},J=()=>{!G.value||postMessage({api:"shareAchievements",content:{title:"\u5206\u4EAB\u6211\u7684\u4E50\u5668\u7EC3\u4E60\u8FDB\u5EA6\uFF0C\u4E00\u8D77\u89C1\u8BC1\u6211\u7684\u6210\u957F\uFF01",desc:"\u6652\u4E00\u4E0B\u6211\u7684\u8BC4\u6D4B\u5206\u6570\uFF0C\u5FEB\u6765\u201C\u5C0F\u9177AI\u201D\u4E0A\u548C\u6211PK\u4E00\u4E0B\u5427\uFF01",image:G.value,video:"",type:"image",button:["copy"],url:q()}},K=>{var te,Q,ie;(te=K==null?void 0:K.content)!=null&&te.status&&(D.value=!1),(Q=K==null?void 0:K.content)!=null&&Q.message&&Toast((ie=K==null?void 0:K.content)==null?void 0:ie.message)})},Z=()=>{var K;postMessage({api:"openWebView",content:{url:location.origin+W+"/colexiu-report.html?source=evaluation&musicId="+F.id+"&id="+((K=U.value)==null?void 0:K.recordId)||"",orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}})};return()=>{var te,Q;const K=getLeveByScoreId((te=U.value)==null?void 0:te.score);return createVNode("div",null,[createVNode("div",{class:styles$a.box},[createVNode("div",{class:styles$a.wrap},[createVNode("div",{class:styles$a.wrapContainer},[createVNode("div",{class:styles$a.top},[createVNode("div",{class:styles$a.title},[createVNode("div",{style:{position:"relative",zIndex:1,"white-space":"nowrap"}},[createVNode("span",{class:styles$a.num},[(Q=U.value)==null?void 0:Q.score]),createVNode("span",{class:styles$a.txt},[createTextVNode("\u5206 "),scoreInfos[K].mome])]),createVNode("div",{class:styles$a.line},null)]),createVNode("img",{class:styles$a.iconTop,src:scoreInfos[K].img},null)]),createVNode("div",{class:styles$a.evaluatWrap},[createVNode(Grid,null,{default:()=>[createVNode(GridItem,null,{icon:()=>createVNode("div",null,[createVNode("img",{class:styles$a.evaluatIcon,src:IntonationIcon},null),createVNode("span",{class:styles$a.evaluatTitle},[createTextVNode("\u97F3\u51C6")])]),text:()=>{var ie;return createVNode("span",{class:styles$a.fraction},[(ie=U.value)==null?void 0:ie.intonation,createVNode("span",null,[createTextVNode("\u5206")])])}}),createVNode("div",{class:styles$a.line},null),createVNode(GridItem,null,{icon:()=>createVNode("div",null,[createVNode("img",{class:styles$a.evaluatIcon,src:CadenceIcon},null),createVNode("span",{class:styles$a.evaluatTitle},[createTextVNode("\u8282\u594F")])]),text:()=>{var ie;return createVNode("span",{class:styles$a.fraction},[(ie=U.value)==null?void 0:ie.cadence,createVNode("span",null,[createTextVNode("\u5206")])])}}),createVNode("div",{class:styles$a.line},null),createVNode(GridItem,null,{icon:()=>createVNode("div",null,[createVNode("img",{class:styles$a.evaluatIcon,src:IntegrityIcon},null),createVNode("span",{class:styles$a.evaluatTitle},[createTextVNode("\u5B8C\u6574\u6027")])]),text:()=>{var ie;return createVNode("span",{class:styles$a.fraction},[(ie=U.value)==null?void 0:ie.integrity,createVNode("span",null,[createTextVNode("\u5206")])])}})]})]),createVNode("div",{class:styles$a.tips},[scoreInfos[K].tips])]),createVNode("div",{class:styles$a.btns},[state$2.frozenMode?null:createVNode(Button,{onClick:()=>{state.evaluatingStatus=!1,onChangeModelType("practice")}},{default:()=>[createVNode("img",{class:styles$a.btnIcon,src:iconLianxi},null)]}),createVNode(Button,{style:{margin:"0 4px"},onClick:()=>R("restart")},{default:()=>[createVNode("img",{class:styles$a.btnIcon,src:TryIcon},null)]}),createVNode(Button,{onClick:Z},{default:()=>[createVNode("img",{class:styles$a.btnIcon,src:iconReport,alt:"\u67E5\u770B\u62A5\u544A"},null)]})]),createVNode("div",{class:styles$a.rigthBtns},[createVNode("div",{class:styles$a.skepBtn,onClick:()=>R("upload")},[createVNode("img",{src:iconUpload},null),createTextVNode("\u4E0A\u4F20")]),createVNode("div",{class:styles$a.skepBtn,onClick:()=>D.value=!0},[createVNode("img",{src:iconShare},null),createTextVNode("\u5206\u4EAB")])])]),createVNode(Popup,{teleport:"body",show:D.value,style:{background:"transparent"}},{default:()=>[createVNode("div",{style:{textAlign:"right"}},[createVNode(Button,{class:styles$a.sbtn,onClick:J,round:!0,type:"primary",color:"#2DC7AA"},{default:()=>[createTextVNode("\u5206\u4EAB")]}),createVNode(Button,{class:styles$a.sbtn,onClick:()=>D.value=!1,round:!0},{default:()=>[createTextVNode("\u5173\u95ED")]})]),createVNode("iframe",{style:{width:"50vw",border:"none",height:"70vh",marginTop:"1vh"},src:q(),onLoad:Y},null)]}),createVNode(Button,{class:styles$a.button,icon:iconBack,onClick:()=>R("restart")},null)])])}}});const evaluatingShow=ref(!1),open=ref(!1);var Evaluating$1=defineComponent({name:"ColexiuEvaluating",props:{data:{type:Object,default:()=>null}},emits:["restart"],setup(B){const R=ref(!1),F=state$3.sett.camera&&state$3.eva.save;console.log(state$3.sett.camera,state$3.eva.save);const D=U=>{var W,q;postMessage({api:"proxyServiceMessage",content:{header:{commond:"videoUpload",status:200,type:"SOUND_COMPARE"},body:{filePath:(W=U==null?void 0:U.content)==null?void 0:W.filePath,recordId:(q=B.data)==null?void 0:q.recordId}}})},G=()=>{F?postMessage({api:"videoUpdate"},U=>{if(R.value=!1,U!=null&&U.content){if(U.content.type==="error"){Toast(U.content.message);return}D(U)}}):(R.value=!1,D(),Toast.success("\u4E0A\u4F20\u6210\u529F"))};return()=>createVNode("div",null,[createVNode(Popup,{position:"bottom",show:evaluatingShow.value,"onUpdate:show":U=>evaluatingShow.value=U,onOpen:()=>open.value=!0,onClosed:()=>open.value=!1,teleport:"body",style:{backgroundColor:"transparent"}},{default:()=>[open&&createVNode(Content,{data:B.data,onUpload:()=>R.value=!0,onRestart:()=>evaluatingShow.value=!1},null)]}),createVNode(Dialog.Component,{teleport:"body",class:styles$a.confirm,style:{overflow:"initial"},show:R.value,"onUpdate:show":U=>R.value=U,message:`\u8BC4\u6D4B${F?"\u97F3\u89C6\u9891":"\u97F3\u9891"}\u662F\u5426\u4FDD\u5B58\u6F14\u594F\uFF1F`},{title:()=>createVNode("img",{class:styles$a.iconTitle,src:iconTitle$1},null),footer:()=>createVNode("div",{class:styles$a.footer},[createVNode("img",{src:iconCancel,onClick:()=>R.value=!1},null),createVNode("img",{src:iconConfirm,onClick:G},null)])})])}}),iconStartEvaluating="/orchestra-music-score/assets/StartEvaluating.58f34e8e.png",iconRecord="/orchestra-music-score/assets/iconRecord.e27c3778.png";let backtime=0;const initBehaviorId$1=""+new Date().valueOf(),evaluating=ref(!1),playStatus=ref("stop"),endloading=ref(!1),connentLoading=ref(!1),playUrl=ref(""),endResult=ref(null),animate={mounted:B=>{B.addEventListener("click",R=>{R.target.classList.add("animate__animated","animate__tada")}),B.addEventListener("animationend",R=>{R.target.classList.remove("animate__animated","animate__tada")})}},browserInfo$4=browser(),formatPitch=B=>B?state$3.sett.hertz&&state$3.sett.hertz!==442?B/442*state$3.sett.hertz:B:-1,formatTimes=()=>{var U,W,q,Y,J,Z,K,te,Q,ie;const B=((W=(U=state$2.times)==null?void 0:U[0])==null?void 0:W.difftime)||0;let R=!1,F=!1,D=!1;const G=[];for(let se=0;se{var W,q,Y,J;const B=useOriginSearch();connentLoading.value=!0;const R=sessionStorage.getItem("behaviorId")||B.behaviorId||initBehaviorId$1,F=state.speed/state$2.baseSpeed,D={musicXmlInfos:formatTimes(),subjectId:state$2.subjectId,detailId:(W=state$2.activeDetail)==null?void 0:W.id,examSongId:B.id,xmlUrl:(q=state$2==null?void 0:state$2.activeDetail)==null?void 0:q.xmlUrl,partIndex:state$2.partIndex,behaviorId:R,platform:"WEB",clientId:"STUDENT",hertz:state$3.sett.hertz,feature:"EVALUATION",practiceSource:B.unitId?"UNIT_TEST":"PRACTICE",reactionTimeMs:parseFloat(""+state$3.eva.reactionTimeMs)||0,speed:state.speed,heardLevel:state$3.eva.difficulty,beatLength:Math.round(getFixTime(state$2.times[0].beatSpeed)*1e3/F)},G=useClientType();G==="student"?D.clientId="STUDENT":G==="teacher"?D.clientId="TEACHER":D.clientId="BACKEND",browserInfo$4.android&&(D.platform="ANDROID"),browserInfo$4.ios&&(D.platform="IOS");const U=await promisefiyPostMessage({api:"startEvaluating",content:D});if((Y=U==null?void 0:U.content)!=null&&Y.reson)throw Toast.fail({message:(J=U==null?void 0:U.content)==null?void 0:J.reson}),connentLoading.value=!1,U;connentLoading.value=!1},sendOffsetTime=B=>{postMessage({api:"proxyServiceMessage",content:{header:{commond:"audioPlayStart",type:"SOUND_COMPARE"},body:{offsetTime:B}}},()=>{backtime=0})},cancelTheEvaluation=()=>{const B=useOriginSearch();resetPlayStatus(),clearIntervalTimeline(),setCurrentTime(0),playStatus.value="stop",postMessage({api:"endEvaluating",content:{musicScoreId:B.id}},R=>{evaluating.value=!1,Toast.clear()})},stopPlay=(B=!0)=>{console.log("\u8C03\u7528stopPlay"),startButtonShow.value=!0,cancelTheEvaluation()},evaluatStopPlay=stopPlay,startPlay=()=>{console.log("\u8FDE\u63A5\u670D\u52A1\u6210\u529F,\u5F00\u59CB\u64AD\u653E",new Date().getTime()-state.clickTime),state$3.eva.mute?changeMode("background"):changeAllMode(),startButtonShow.value=!1,setPlayState()},setPlayer=async()=>{if(console.log("\u8C03\u7528setPlayer"),state.clickTime=new Date().getTime(),resetPlayStatus(),state.evaluatingTips=!1,state$2.isPauseRecording){evaluating.value=!1,startPlay();return}state$2.evaluatings={},setCurrentTime(0);const B=Toast({duration:0,message:"\u670D\u52A1\u8FDE\u63A5\u4E2D...",type:"loading"});try{await connect(),startPlay(),setTimeout(()=>{Toast.clear(),B.close()},100)}catch{state.evaluatingStatus=!1,Toast.clear()}},togglePlay=()=>{if(state$2.isPauseRecording){evaluating.value=!1,startPlay();return}evaluating.value?stopPlay():setPlayer()},cancelEvaluating=B=>{B!=null&&B.content.reson&&stopPlay()},timeupdate=()=>{var B;if(console.log("\u64AD\u653E\u4E8B\u4EF6\u88AB\u89E6\u53D1",playUrl.value,evaluating.value),playUrl.value){const R=new Date().getTime();console.log("\u7B2C\u4E00\u6B21\u64AD\u653E\u65F6\u95F4",R);const F=(B=state.audiosInstance)==null?void 0:B.audios[playUrl.value].currentTime;console.log("\u5DF2\u64AD\u653E\u65F6\u957F: ",F*1e3),console.log("\u4E0D\u51CF\u6389\u5DF2\u64AD\u653E\u65F6\u95F4: ",R-backtime);const D=R-backtime-F*1e3;console.log("\u771F\u6B63\u64AD\u653E\u5EF6\u8FDF",D),setTimeout(()=>{sendOffsetTime(D)},220)}},playerStop=()=>{console.log("playerStop\u64AD\u653E\u5668\u505C\u6B62\u4E8B\u4EF6",endloading.value),!endloading.value&&(playStatus.value="stop",endloading.value=!0,startButtonShow.value=!0,resetPlayStatus(),clearIntervalTimeline(),setCurrentTime(0),Toast({duration:0,message:"\u8BC4\u5206\u4E2D...",type:"loading"}),postMessage({api:"endEvaluating",content:{musicScoreId:useOriginSearch().id}},B=>{console.log("\u8C03\u7528endEvaluating\u7ED3\u675F",B),endloading.value=!1,evaluating.value=!1}))},evaluatPlayerStop=playerStop,endevent=B=>{var R;((R=B.target)==null?void 0:R.src)===playUrl.value&&playStatus.value==="play"&&(playerStop(),canSubmit.value=!0),state$2.isAppPlay&&(playerStop(),canSubmit.value=!0)},start=()=>{if(playStatus.value="play",state$2.isPauseRecording){postMessage({api:"resumeRecording"},()=>{evaluating.value=!0,state$2.isPauseRecording=!1,setCaptureMode()});return}console.log("\u5F00\u59CB\u5F55\u97F3",new Date().getTime()),postMessage({api:"startRecording"},()=>{var B,R;console.log("\u5F00\u59CB\u5F55\u97F3\u56DE\u8C03\u65F6\u95F4",new Date().getTime()),backtime=new Date().getTime(),evaluating.value=!0,console.log("midiUrl",(B=state$2.activeDetail)==null?void 0:B.midiUrl),(R=state$2.activeDetail)!=null&&R.midiUrl&&setTimeout(()=>{sendOffsetTime(0)},220)})},submitEvaluationScore=async B=>{if(state$2.setting&&state$2.setting.mode==="EVALUATING"){if(!canSubmit.value){Toast("\u8BF7\u5B8C\u6210\u6574\u9996\u66F2\u76EE\u8BC4\u6D4B\uFF01");return}try{await request.post("/activity/evaluationScore",{requestType:"json",data:{userId:state$4.user.userId,score:B.score,...state$2.setting.submitData}})}catch{}canSubmit.value=!1}},canSubmit=ref(!1),sendResult=B=>{var R,F;if(console.log("\u8BC4\u6D4B\u8FD4\u56DE",B==null?void 0:B.content),B!=null&&B.content){const D=(R=B==null?void 0:B.content)==null?void 0:R.body;if((B==null?void 0:B.content.header.commond)==="overall")Toast.clear(),endResult.value=D,evaluatingShow.value=!0,submitEvaluationScore(D);else if((B==null?void 0:B.content.header.commond)!=="checkDone"){if((B==null?void 0:B.content.header.commond)!=="checking"){const G=W=>{for(;W>=0;){const q=state$2.times[W];if(q.stave)return q;W--}},U=(W,q,Y=!1)=>{const J=getBoundingBoxByverticalNote(W);console.log(state$2.evaluatings,J),state$2.evaluatings={...state$2.evaluatings,[J.measureIndex]:{...J,...getLeveByScoreMeasure(q.score),score:q.score,dontTransition:Y}}};for(let W=0;W{var B;state.currentTimeNum>=((B=state$2.times[state$2.times.length-1])==null?void 0:B.time)-2&&(canSubmit.value=!0)},cloudMetronome=B=>{startButtonShow.value=!0};var Evaluating=defineComponent({name:"ColexiuButtonEvaluating",directives:{animate},setup(B,{expose:R}){return onMounted(async()=>{var F,D,G,U;state.evaluatingTips=!0,state$2.section=[],state$2.sectionStatus=!1,changeAllMode(),playUrl.value=state.songs.background||state.songs.music,(D=(F=state.audiosInstance)==null?void 0:F.audios[playUrl.value])==null||D.addEventListener("play",timeupdate),(U=(G=state.audiosInstance)==null?void 0:G.audios[playUrl.value])==null||U.addEventListener("timeupdate",onProgress),event$1.on("next-click",playerStop),event$1.on("ended",endevent),listenerMessage("sendResult",sendResult),listenerMessage("cancelEvaluating",cancelEvaluating),listenerMessage("cloudTimeUpdae",onProgress),event$1.on("tickDestroy",cloudMetronome),event$1.on("tickEnd",start),await pause(),setCurrentTime(0)}),onBeforeUnmount(()=>{var D,G,U,W,q;(G=(D=state.audiosInstance)==null?void 0:D.audios[playUrl.value])==null||G.removeEventListener("play",timeupdate),(W=(U=state.audiosInstance)==null?void 0:U.audios[playUrl.value])==null||W.removeEventListener("timeupdate",onProgress),event$1.off("next-click",playerStop),event$1.off("ended",endevent),event$1.off("tickDestroy",cloudMetronome),removeListenerMessage("sendResult",sendResult),removeListenerMessage("cancelEvaluating",cancelEvaluating),removeListenerMessage("cloudTimeUpdae",onProgress),event$1.off("tickEnd",start),useOriginSearch().unitId&&postMessage({api:"setCache",content:{key:"h5-orchestra-unit",value:((q=endResult.value)==null?void 0:q.score)||0}})}),R({setPlayer,startPlay,stopPlay,togglePlay,playerStop,evaluating,connentLoading,playStatus,cancelTheEvaluation}),()=>createVNode(Fragment,null,[withDirectives(createVNode(Button,{class:[styles$4.button,styles$4.hasText],style:{display:state$2.frozenMode?"none":""},onClick:()=>{state.evaluatingStatus=!1,(playStatus.value==="play"||playStatus.value==="connecting")&&cancelTheEvaluation()}},{default:()=>[createVNode(ButtonIcon,{name:"practise"},null),createVNode("span",null,[createTextVNode("\u7EC3\u4E60")])]}),[[resolveDirective("animate")]]),createVNode(Evaluating$1,{data:endResult.value},null),evaluating.value?createVNode(Teleport,{to:"body",key:"Recording"},{default:()=>[createVNode("div",{class:styles$4.dialogueBox},[createVNode("div",{class:styles$4.inRadio},[createTextVNode("\u6536\u97F3\u4E2D...")]),createVNode("img",{class:styles$4.inRadioIcon,src:iconRecord},null)])]}):createVNode(Teleport,{to:"body",key:"StartEvaluating"},{default:()=>[createVNode("div",{class:styles$4.dialogueBox},[createVNode("div",{class:styles$4.dialogue},[createVNode("div",null,[createTextVNode("\u6F14\u594F\u524D\u8BF7\u8C03\u6574\u597D\u4E50\u5668\uFF0C\u4FDD\u8BC1\u6700\u4F73\u6F14\u594F\u72B6\u6001\u3002"),createVNode("span",{class:styles$4.triangle},null)])]),createVNode("img",{class:styles$4.dialogueIcon,src:iconStartEvaluating},null)])]})])}});const event$1=new EventEmitter,browserInfo$3=browser(),initBehaviorId=""+new Date().valueOf(),getLinkId$1=()=>{const B=useOriginSearch().id;return location.hash.split("?")[0].split("/").pop()||B||""},getFixTime=B=>{const R=getDuration(state.osmd);let F=R.numerator||0,D=R.denominator||4;return state$2.repeatedBeats&&(F=F===2?4:F),!state$2.needTick&&!state$2.skipTick?D*60/B/D*F:0};let prevIndex=0;const state=reactive({songs:{},playState:"init",sectionHint:new SectionHint,audiosInstance:null,mode:"music",isFirstPlay:!0,metro:null,metroing:!1,duration:"0:00",durationNum:0,currentTime:"0:00",currentTimeNum:0,loading:!1,speed:90,browser:browser(),speedShow:!1,progressShow:!1,touched:!1,osmd:null,tickPlayer:null,evaluatingStatus:!1,evaluatingTips:!1,clickTime:0,evaluatingFixTime:0,cameraStatus:!1,captureStatus:!1,ticking:!1,partIndex:0,activeIndex:0}),syncStepIndex=B=>{var R;state.osmd.hidden!==!1&&state.osmd.cursor.show(),prevIndex=B,setStepIndex(state.osmd,B),refreshIndex((R=state$2.times[B])==null?void 0:R.time)};watchEffect(()=>{state$2.maskStatus=state.playState==="play"});const syncPlayState=async()=>{if(state$2.activeDetail.isAppPlay){const B=await promisefiyPostMessage({api:"cloudGetMediaStatus"}),R=B==null?void 0:B.content.status;state.playState=R}else state.playState=state.audiosInstance.getStatus()},setCurrentTime=B=>{console.log("setCurrentTime",B);const R=B;state$2.fixedKey=0,state.currentTimeNum=R,state.currentTime=formatTime(R),state$2.activeDetail.isAppPlay?promisefiyPostMessage({api:"cloudSetCurrentTime",content:{currentTime:B*1e3,songID:state$2.activeDetail.examSongId}}):state.audiosInstance.setCurrentTime(R),refreshView(),syncPlayState();const F=getIndex(state$2.times,state.currentTimeNum);syncStepIndex(F)},getActiveMidiId=()=>{var B,R,F,D,G,U,W;return(W=(U=(G=(D=(F=(R=(B=state.osmd)==null?void 0:B.sheet)==null?void 0:R.instruments)==null?void 0:F[0])==null?void 0:D.subInstruments)==null?void 0:G[0])==null?void 0:U.midiInstrumentID)!=null?W:0},changeMode=async B=>{var F,D;const R=B==="background"?"music":"background";if(console.log(!state.songs[B],B,R),state$2.activeDetail.isAppPlay){const G=new Map;for(const U of state$2.partListNames)G.set(U,60);for(const U of getVoicePartInfo().partListNames)G.set(U,R==="background"?100:0);promisefiyPostMessage({api:"cloudVolume",content:{activeMidiId:getActiveMidiId(),activeMidiVolume:R==="background"?100:0,parts:Array.from(G.keys()).map(U=>({name:U,volume:G.get(U)}))}})}state.mode=B,(F=state.audiosInstance)==null||F.setMute(!0,state.songs[R]),(D=state.audiosInstance)==null||D.setMute(!1,state.songs[B])},changeAllMode=()=>{var B,R;if((B=state$2.activeDetail)!=null&&B.isAppPlay){const F=new Map;for(const D of state$2.partListNames)F.set(D,1);promisefiyPostMessage({api:"cloudVolume",content:{activeMidiId:getActiveMidiId(),activeMidiVolume:100,parts:Array.from(F.keys()).map(D=>({name:D,volume:F.get(D)}))}})}else state.mode="background",(R=state.audiosInstance)==null||R.setMute(!0)},changeSpeed=(B,R=!0)=>{var D;const F=store_legacy.get("speeds")||{};R&&(F[getLinkId$1()]=B,store_legacy.set("speeds",F)),state.speed=B,state$2.activeDetail&&((D=state.audiosInstance)==null||D.setSpeed(B/state$2.baseSpeed),promisefiyPostMessage({api:"cloudChangeSpeed",content:{speed:B,originalSpeed:state$2.activeDetail.originalSpeed,songID:state$2.activeDetail.examSongId}}),state.playState==="play"&&syncStepIndex(getIndex(state$2.times,state.currentTimeNum)))},resetCursor=()=>{state.osmd&&(state.osmd.product?state.osmd.cursor.setPosition({...state$2.times[0].cursorBox}):state.osmd.cursor.reset(),state.osmd.cursor.hide(),state$2.fixedKey=0)},refreshIndexBase=B=>{if(B<0)return;const{osmd:R}=state;R&&state$2.times[B]&&(state$2.sectionStatus||state.sectionHint.show(),state$2.times[B]&&state$2.times[B].noteElement&&state.sectionHint.showForElement(state$2.times[B]),R.product||R.cursor.hidden!==!1&&(R.cursor.reset(),R.cursor.show(),state$2.fixedKey=0),prevIndex!==B&&(setStepIndex(state.osmd,state$2.times[B].i,prevIndex),prevIndex=B),state$2.fixedKey=state$2.times[B].realKey,state$2.activeNote=state$2.times[B])},refreshIndex=B=>{const{osmd:R}=state;if(R&&(B||state.audiosInstance.audio)){const F=B||state.audiosInstance.audio.currentTime,D=getIndex(state$2.times,F);state.activeIndex=D,removeRepateBackground(D);const G=state$2.times[state$2.times.length-1],U=(G==null?void 0:G.sourceEndTime)||(G==null?void 0:G.endtime);F>U?(state.osmd.cursor.hide(),state.sectionHint.destroy()):state$2.times[D]&&refreshIndexBase(D)}},removeRepateBackground=B=>{var R,F;if(state.evaluatingStatus&&B){const D=state$2.times[B],G=state$2.times[B+1]||D,U=(F=(R=G==null?void 0:G.noteElement)==null?void 0:R.sourceMeasure)==null?void 0:F.measureListIndex;G&&state$2.evaluatings[U]&&B>0&&(state$2.evaluatings={...state$2.evaluatings,[U]:void 0})}},refreshPlayer=async B=>{var F,D;const{osmd:R}=state;if(R&&(B||state.audiosInstance.audio)){const G=B||state.audiosInstance.audio.currentTime,U=0;if(G+1{if(state$2.sectionStatus&&state$2.section.length===2){G>=state$2.section[0].time&&(state$2.sectionFlash=!1);const Y=state$2.times[state$2.section[1].i+1],J=Y?Y.halfTone===0?state$2.section[1].endtime:Y.time:state.durationNum;return G+(browserInfo$3.xiaomi?.2:.08)>=J}return!1})()){state.audiosInstance.setMute(!0),state.osmd.cursor.hide(),(F=state$2.activeDetail)!=null&&F.isAppPlay?pause():await state.audiosInstance.pause(),setSectionModeCurrentTime(),clearAccelerateRefreshPlayer(),setTimeout(()=>setPlayState(),1e3),state.loading=!1;return}((D=state$2.activeDetail)==null?void 0:D.isAppPlay)&&state.durationNum+3{try{prevIndex=0,state.osmd.cursor.reset(),state.osmd.cursor.hide(),state$2.fixedKey=0,state$2.sectionFlash=!1,state.sectionHint&&state.sectionHint.destroy(),B||(state$2.activeDetail.isAppPlay?(await promisefiyPostMessage({api:"cloudSuspend",content:{songID:state$2.activeDetail.examSongId}}),endCapture()):(console.log("resetPlayStatus\u8C03\u7528\u6682\u505C"),state.audiosInstance.pause())),syncPlayState()}catch(R){console.log("resetPlayStatus\u9519\u8BEF",R)}},play=async()=>{state.isFirstPlay&&(resetPlayStatus(),state$2.fixedKey=0),state$2.activeDetail.isAppPlay?(await syncPlayState(),promisefiyPostMessage({api:"cloudSuspend",content:{songID:state$2.activeDetail.examSongId}}),startCapture()):(state.playState=state.audiosInstance.getStatus(),clearAccelerateRefreshPlayer(),accelerateRefreshPlayer(),startCapture())},setDelayTime=async B=>new Promise(R=>{setTimeout(()=>{R(B)},B)}),pause=async()=>{state$2.sectionStatus&&state.osmd.cursor.hide(),state$2.activeDetail.isAppPlay?(await syncPlayState(),await promisefiyPostMessage({api:"cloudSuspend"}),await setDelayTime(200),endCapture()):(state.playState=state.audiosInstance.getStatus(),clearAccelerateRefreshPlayer(),state.audiosInstance.pause(),setTimeout(()=>{endCapture()},200))},waiting=()=>{state.loading=!0},playing=()=>{state.loading=!1},ended=lodash.exports.debounce(async B=>{resetPlayStatus(),state$2.fixedKey=0,state.evaluatingStatus||(refreshPlayer(0),state$3.sett.loop&&await setPlayState()),setCurrentTime(0),event$1.emit("ended",B)},300,{leading:!0,trailing:!1});let timer=null;const accelerateRefreshPlayer=()=>{timer||!state.audiosInstance||(timer=setInterval(()=>{requestAnimationFrame(()=>{refreshPlayer(),state.audiosInstance.getStatus()==="play"&&refreshIndex()})},16.7))},clearAccelerateRefreshPlayer=()=>{clearInterval(timer),timer=null},sectionChange=()=>{state$2.sectionStatus=!state$2.sectionStatus,clearAccelerateRefreshPlayer(),resetPlayStatus(),state$2.sectionStatus||(setCurrentTime(0),state$2.fixedKey=0),state$2.sectionStatus&&state$2.section.length!=2&&resetCursor()},getFirsrNoteByMeasureListIndex=(B,R=!0)=>{var F,D,G;for(const U of state$2.times)if(((D=(F=U==null?void 0:U.noteElement)==null?void 0:F.sourceMeasure)==null?void 0:D.measureListIndex)===B){let W=null;for(const q of U.measures)getSlursNote(q)&&(W=getSlursNote(q));if(W&&((G=W.sourceMeasure)==null?void 0:G.measureListIndex)!==B){for(const q of state$2.times)if(q.noteElement.NoteToGraphicalNoteObjectId===W.NoteToGraphicalNoteObjectId)return q}return U}return null},setSectionModeCurrentTime=()=>{var B,R;if(console.log(state$2.needTick,"setSectionModeCurrentTime"),state$2.needTick)setCurrentTime(state$2.section[0].sourceStartTime||state$2.section[0].time);else{const F=(R=(B=state$2.section[0].noteElement)==null?void 0:B.sourceMeasure)==null?void 0:R.measureListIndex;F>0?(setCurrentTime(getFirsrNoteByMeasureListIndex(F-1).time),state$2.sectionFlash=!0):setCurrentTime(0)}},setPlayerView=()=>{console.log(state$2.sectionStatus,"detailState.sectionStatus"),console.log(state$2.needTick),state$2.sectionStatus&&(syncStepIndex(getIndex(state$2.times,state.currentTimeNum)),state$2.section.length===2?setSectionModeCurrentTime():(state$2.section=[],state$2.sectionBoundingBoxs=[],state$2.sectionStatus=!1,Toast.clear()))},cloudToggleState=async()=>{const B=await promisefiyPostMessage({api:"cloudGetMediaStatus"}),R=B==null?void 0:B.content.status;if(R==="init")return;R==="suspend"?(await promisefiyPostMessage({api:"cloudPlay",content:{songID:state$2.activeDetail.examSongId,startTime:state.currentTimeNum*1e3,originalSpeed:state$2.activeDetail.originalSpeed,speed:state.speed,hertz:440}}),startCapture()):(await promisefiyPostMessage({api:"cloudSuspend"}),endCapture());const F=await promisefiyPostMessage({api:"cloudGetMediaStatus"});state.playState=F==null?void 0:F.content.status,console.log(F,"cloudGetMediaStatused")},toggleState=async B=>{state$2.activeDetail.isAppPlay?await cloudToggleState():(console.log(state$2.activeDetail),console.log("delay",B),state.isFirstPlay=!1,setPlayerView(),await state.audiosInstance.togglePlay(B),state.evaluatingStatus||changeMode(state.mode),state.playState=state.audiosInstance.getStatus())},setActiveKey=B=>{state$2.activeTick=B},setTickStop=()=>{console.log("\u8282\u62CD\u5668\u7ED3\u675F",new Date().getTime()-state.clickTime),state$2.activeTick=-1,state$2.activeTickRepeat=1,toggleState(getTickTime(state.speed/state$2.baseSpeed))};let timeliner=-1;const clearIntervalTimeline=()=>{clearInterval(timeliner)},onTickDestroy=()=>{event$1.emit("tickDestroy")},setTick=(B,R)=>{var D,G,U,W,q,Y,J;console.log("ticking");const F=()=>{B(),event$1.emit("tickEnd")};if(state$2.needTick){let{numerator:Z,denominator:K}=getDuration(state.osmd);if(state.osmd.numerator&&state.osmd.denominator&&(Z=state.osmd.numerator,K=state.osmd.denominator),state$2.activeDetail.isAppPlay)state.ticking=!0,postMessage({api:"cloudMetronome",content:{repeat:Z===2?2:1,denominator:K,numerator:Z}},te=>{state.ticking=!1,(te==null?void 0:te.content.status)==="finish"?F():(te==null?void 0:te.content.status)==="cancel"&&event$1.emit("tickDestroy")});else{const te=Z===2?2:1;state$2.activeTickRepeat=te,console.log("ticking"),state.tickPlayer=new Player(Z,(R||state.speed)/90),(D=state.tickPlayer)==null||D.start(Z,(R||state.speed)/90,te),(G=state.tickPlayer)==null||G.event.off("tick",setActiveKey),(U=state.tickPlayer)==null||U.event.off("stop",F),(W=state.tickPlayer)==null||W.event.off("destroy",onTickDestroy),(q=state.tickPlayer)==null||q.event.on("tick",setActiveKey),(Y=state.tickPlayer)==null||Y.event.on("stop",F),(J=state.tickPlayer)==null||J.event.on("destroy",onTickDestroy)}}else F()},setPlayState=async()=>{if(!(state$2.activeTick>-1||state.ticking)){if(await syncPlayState(),console.table({playState:state.playState,currentTime:state.currentTimeNum}),state.playState!=="pause"&&state.playState!=="suspend"){await toggleState();return}console.log("\u8BBE\u7F6E\u64AD\u653E"),setPlayerView(),setTick(setTickStop)}},stopTick=()=>{state.tickPlayer&&state.tickPlayer.destroy(),event$1.emit("stopTick"),state$2.activeTickRepeat=1,state$2.activeTick=-1},windowResize=()=>{const B=getIndex(state$2.times,state.currentTimeNum);setTimeout(()=>{var R,F;(F=state.sectionHint)==null||F.showForElement((R=state$2.times[B])==null?void 0:R.noteElement)},200)},loadedmetadata=()=>{state.duration=formatTime(state.audiosInstance.duration),state.durationNum=state.audiosInstance.duration};let prevDiff=0,viewing=!1;const refreshView=()=>{var D;let B,R;(D=state==null?void 0:state.osmd)!=null&&D.product&&(B=state.osmd.cursor.img,R=document.querySelector("#colexiu-detail-music-sheet"));const F=Math.max(parseFloat((B||state.osmd.cursor.cursorElement).style.top),0);Math.abs(prevDiff-F)>10&&!viewing&&(viewing=!0,setTimeout(()=>{viewing=!1,(R||(state$4.clintNmae==="colexiu"?state.osmd.container.parentElement.parentElement:state.osmd.container.parentElement)).scrollTo({top:F,left:0,behavior:"smooth"}),prevDiff=F},100))},updatePlayTime=async B=>{const R=useOriginSearch();sessionStorage.getItem("behaviorId")||R.behaviorId,getRequestHostname(),useClientType()},setAudioInit=()=>{state.audiosInstance.event.on("loadedmetadata",loadedmetadata),state.audiosInstance.event.on("waiting",waiting),state.audiosInstance.event.on("playing",playing),state.audiosInstance.event.on("play",play,!1),state.audiosInstance.event.on("pause",pause,!1),state.audiosInstance.event.on("ended",ended,!1),state.audiosInstance.event.on("updatePlayTime",updatePlayTime,!1),listenerMessage("cloudplayed",async()=>{await syncPlayState(),state.currentTimeNum=0,state.currentTime="00:00",state.audiosInstance.event.emit("ended",new Event("ended"))}),listenerMessage("cloudTimeUpdae",B=>{const R=(B==null?void 0:B.content.currentTime)/1e3;state.playState==="play"&&(state.currentTimeNum=R,state.currentTime=formatTime(R),refreshPlayer(R),refreshIndex(R)),refreshView()}),state.audiosInstance.event.on("timeupdate",()=>{state.currentTimeNum=state.audiosInstance.currentTime,state.currentTime=formatTime(state.audiosInstance.currentTime),requestAnimationFrame(()=>{state.audiosInstance.getStatus()==="play"&&refreshPlayer(),refreshView()})}),window.addEventListener("resize",windowResize)},setStepView=(B,R)=>{prevIndex=Math.max(B.i,0),syncStepIndex(B.i),R&&refreshPlayer(R),refreshView()},noteClick=B=>{if(state.isFirstPlay){Toast("\u5F00\u59CB\u64AD\u653E\u540E\u624D\u80FD\u8C03\u6574\u8FDB\u5EA6");return}let R=getNoteBySlursStart(getActtiveNoteByTimes(B));if(R){const F=R.sourceStartTime||R.time;setCurrentTime(F),setStepView(R.i,F),state$2.fixedKey=R.realKey,state$2.activeNote=R}};let playStartTime$1=0;const startCapture=async()=>{var B;(B=state$2.activeDetail)!=null&&B.isAppPlay&&(playStartTime$1=new Date().getTime(),console.log("startCapture",playStartTime$1)),state$3.sett.camera&&browserInfo$3.isApp&&!state.captureStatus&&state.evaluatingStatus&&state$3.eva.save&&(state.captureStatus=!0,postMessage({api:"startCapture"},()=>{postMessage({api:"setCaptureMode",content:{mode:"evaluating"}})}))},endCapture=async()=>{var B,R;if((B=state$2.activeDetail)!=null&&B.isAppPlay){const F=new Date().getTime()-playStartTime$1;playStartTime$1!==0&&F>0&&((R=state.audiosInstance)==null||R.event.emit("updatePlayTime",F/1e3),playStartTime$1=0)}browserInfo$3.isApp&&state.evaluatingStatus&&state$3.sett.camera&&state.captureStatus&&(postMessage({api:"endCapture"},()=>{state.captureStatus=!1}),evaluatPlayerStop())},setCaptureMode=async()=>{browserInfo$3.isApp&&state$3.sett.camera&&postMessage({api:"setCaptureMode",content:{mode:state.evaluatingStatus?"evaluating":"practice"}})};class AJAX{static ajax(R,F=9e3){let D;const G=R.indexOf(".mxl")>-1?"text/plain; charset=x-user-defined":"application/xml";if(XMLHttpRequest)D=new XMLHttpRequest;else if(ActiveXObject)D=new ActiveXObject("Microsoft.XMLHTTP");else return Promise.reject(new Error("XMLHttp not supported."));return D.timeout=F,new Promise((U,W)=>{D.onreadystatechange=()=>{D.readyState===XMLHttpRequest.DONE&&(D.status===200||D.status===0&&D.responseText?U(D.responseText):W(new Error("Could not retrieve requested URL "+D.status)))},D.ontimeout=q=>{W(new Error("Server request Timeout"))},D.overrideMimeType(G),D.open("GET",R,!0),D.send()})}}const _Fraction=class{constructor(B=0,R=1,F=0,D=!0){this.numerator=0,this.denominator=1,this.wholeValue=0,this.numerator=B,this.denominator=R,this.wholeValue=F,D&&this.simplify(),this.setRealValue()}static max(B,R){return B.RealValue>R.RealValue?B:R}static Equal(B,R){return B.wholeValue===R.wholeValue&&B.Denominator===R.Denominator&&B.Numerator===R.Numerator}static createFromFraction(B){return new _Fraction(B.numerator,B.denominator,B.wholeValue,!1)}static plus(B,R){const F=B.clone();return F.Add(R),F}static minus(B,R){const F=B.clone();return F.Sub(R),F}static multiply(B,R){return new _Fraction((B.wholeValue*B.denominator+B.numerator)*(R.wholeValue*R.denominator+R.numerator),B.denominator*R.denominator)}static greatestCommonDenominator(B,R){if(B===0)return R;if(R===1)return 1;for(;Math.abs(R)>1e-8;)B>R?B-=R:R-=B;return Math.round(B)}toString(){let B=this.numerator+"/"+this.denominator;return this.wholeValue!==0&&(B=this.wholeValue+" "+B),B}clone(){return new _Fraction(this.numerator,this.denominator,this.wholeValue,!1)}get Numerator(){return this.numerator}set Numerator(B){this.numerator!==B&&(this.numerator=B,this.simplify(),this.setRealValue())}get Denominator(){return this.denominator}set Denominator(B){this.denominator!==B&&(this.denominator=B,this.numerator!==0&&this.simplify(),this.setRealValue())}get WholeValue(){return this.wholeValue}set WholeValue(B){this.wholeValue!==B&&(this.wholeValue=B,this.setRealValue())}GetExpandedNumerator(){return this.wholeValue*this.denominator+this.numerator}calculateNumberOfNeededDots(){let B=1,R=2;const F=this.GetExpandedNumerator();for(;RB;)R.Numerator++;if(this.numerator>this.denominator){const F=new _Fraction(this.numerator-1,this.denominator,this.wholeValue);for(;F.Denominator>B;)F.Numerator--;if(F.Denominator_Fraction.maximumAllowedNumber){const F=this.denominator/_Fraction.maximumAllowedNumber;this.numerator=Math.round(this.numerator/F),this.denominator=Math.round(this.denominator/F)}if(this.numerator>_Fraction.maximumAllowedNumber){const F=this.numerator/_Fraction.maximumAllowedNumber;this.numerator=Math.round(this.numerator/F),this.denominator=Math.round(this.denominator/F)}}isOnBeat(B){const R=this.distanceFromBeat(B);return Math.abs(R)<_Fraction.FloatInaccuracyTolerance}distanceFromBeat(B){const R=new _Fraction(1,B.Denominator);return this.RealValue%R.RealValue}};let Fraction$1=_Fraction;Fraction$1.maximumAllowedNumber=46340;Fraction$1.FloatInaccuracyTolerance=1e-4;class AbstractExpression{constructor(R){this.placement=R}static isStringInStringList(R,F){for(let D=0,G=R.length;D(B[B.Above=0]="Above",B[B.Below=1]="Below",B[B.Left=2]="Left",B[B.Right=3]="Right",B[B.NotYetDefined=4]="NotYetDefined",B[B.AboveOrBelow=5]="AboveOrBelow",B))(PlacementEnum||{});const _ContinuousDynamicExpression=class extends AbstractExpression{constructor(B,R,F,D,G,U,W=""){super(R),super.parentMeasure=D,this.NumberXml=U,this.dynamicType=B,this.label=W,this.staffNumber=F,this.activeInstantaneousDynamic=G,this.startVolume=1,this.endVolume=1,this.setStartAndEndVolume(),W!==""&&this.setType()}setStartAndEndVolume(){this.activeInstantaneousDynamic&&(this.dynamicType===ContDynamicEnum.crescendo&&(this.startVolume=this.activeInstantaneousDynamic.Volume,this.endVolume=this.activeInstantaneousDynamic.Volume*1.2),this.dynamicType===ContDynamicEnum.diminuendo&&(this.startVolume=this.activeInstantaneousDynamic.Volume,this.endVolume=this.activeInstantaneousDynamic.Volume*.8))}get DynamicType(){return this.dynamicType}set DynamicType(B){this.dynamicType=B}get StartMultiExpression(){return this.startMultiExpression}set StartMultiExpression(B){this.startMultiExpression=B}get EndMultiExpression(){return this.endMultiExpression}set EndMultiExpression(B){this.endMultiExpression=B}get Placement(){return this.placement}set Placement(B){this.placement=B}get StartVolume(){return this.startVolume}set StartVolume(B){this.startVolume=B}get EndVolume(){return this.endVolume}set EndVolume(B){this.endVolume=B}get StaffNumber(){return this.staffNumber}set StaffNumber(B){this.staffNumber=B}get Label(){return this.label}set Label(B){this.label=B,this.setType()}static isInputStringContinuousDynamic(B){return B?_ContinuousDynamicExpression.isStringInStringList(_ContinuousDynamicExpression.listContinuousDynamicIncreasing,B)||_ContinuousDynamicExpression.isStringInStringList(_ContinuousDynamicExpression.listContinuousDynamicDecreasing,B):!1}getInterpolatedDynamic(B){const R=this.StartMultiExpression.AbsoluteTimestamp;let F;if(this.EndMultiExpression?F=this.EndMultiExpression.AbsoluteTimestamp:F=Fraction$1.plus(this.startMultiExpression.SourceMeasureParent.AbsoluteTimestamp,this.startMultiExpression.SourceMeasureParent.Duration),B.lt(R))return-1;if(F.lt(B))return-2;const D=Fraction$1.minus(B,R).RealValue/Fraction$1.minus(F,R).RealValue;return Math.max(0,Math.min(99.9,this.startVolume+(this.endVolume-this.startVolume)*D))}isWedge(){return!this.label}setType(){_ContinuousDynamicExpression.isStringInStringList(_ContinuousDynamicExpression.listContinuousDynamicIncreasing,this.label)?this.dynamicType=ContDynamicEnum.crescendo:_ContinuousDynamicExpression.isStringInStringList(_ContinuousDynamicExpression.listContinuousDynamicDecreasing,this.label)&&(this.dynamicType=ContDynamicEnum.diminuendo)}};let ContinuousDynamicExpression=_ContinuousDynamicExpression;ContinuousDynamicExpression.listContinuousDynamicIncreasing=["crescendo","cresc","cresc.","cres."];ContinuousDynamicExpression.listContinuousDynamicDecreasing=["decrescendo","decresc","decr.","diminuendo","dim.","dim"];var ContDynamicEnum=(B=>(B[B.crescendo=0]="crescendo",B[B.diminuendo=1]="diminuendo",B))(ContDynamicEnum||{}),DynamicExpressionSymbolEnum=(B=>(B[B.p=0]="p",B[B.f=1]="f",B[B.s=2]="s",B[B.z=3]="z",B[B.m=4]="m",B[B.r=5]="r",B))(DynamicExpressionSymbolEnum||{});class MusicSheetReadingException{constructor(R,F){this.message=R,F&&(this.message+=" "+F.toString())}}class ArgumentOutOfRangeException{constructor(R){this.message=R}}class InvalidEnumArgumentException{constructor(R){this.message=R}}var loglevel={exports:{}};(function(B){(function(R,F){B.exports?B.exports=F():R.log=F()})(commonjsGlobal$1,function(){var R=function(){},F="undefined",D=typeof window!==F&&typeof window.navigator!==F&&/Trident\/|MSIE /.test(window.navigator.userAgent),G=["trace","debug","info","warn","error"];function U(se,ne){var re=se[ne];if(typeof re.bind=="function")return re.bind(se);try{return Function.prototype.bind.call(re,se)}catch{return function(){return Function.prototype.apply.apply(re,[se,arguments])}}}function W(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function q(se){return se==="debug"&&(se="log"),typeof console===F?!1:se==="trace"&&D?W:console[se]!==void 0?U(console,se):console.log!==void 0?U(console,"log"):R}function Y(se,ne){for(var re=0;re=0&&ve<=ae.levels.SILENT){if(ce=ve,Se!==!1&&fe(ve),Y.call(ae,ve,se),typeof console===F&&ve=0;U--)if(D(B[U],R))return U;return-1}arrays$4.lastIndexOf=lastIndexOf;function contains(B,R,F){return indexOf$1(B,R,F)>=0}arrays$4.contains=contains;function remove(B,R,F){var D=indexOf$1(B,R,F);return D<0?!1:(B.splice(D,1),!0)}arrays$4.remove=remove;function frequency(B,R,F){for(var D=F||util$9.defaultEquals,G=B.length,U=0,W=0;W=B.length||F<0||F>=B.length)return!1;var D=B[R];return B[R]=B[F],B[F]=D,!0}arrays$4.swap=swap;function toString$1(B){return"["+B.toString()+"]"}arrays$4.toString=toString$1;function forEach(B,R){for(var F=0,D=B;FR.size())return!1;var F=!0;return this.forEach(function(D){return R.contains(D)?!0:(F=!1,!1)}),F},B.prototype.remove=function(R){return this.contains(R)?(this.dictionary.remove(R),!0):!1},B.prototype.forEach=function(R){this.dictionary.forEach(function(F,D){return R(D)})},B.prototype.toArray=function(){return this.dictionary.values()},B.prototype.isEmpty=function(){return this.dictionary.isEmpty()},B.prototype.size=function(){return this.dictionary.size()},B.prototype.clear=function(){this.dictionary.clear()},B.prototype.toString=function(){return arrays$3.toString(this.toArray())},B}();_Set.default=Set$1;Object.defineProperty(Bag$1,"__esModule",{value:!0});var util$6=util$a,Dictionary_1$4=Dictionary$2,Set_1$1=_Set,Bag=function(){function B(R){this.toStrF=R||util$6.defaultToString,this.dictionary=new Dictionary_1$4.default(this.toStrF),this.nElements=0}return B.prototype.add=function(R,F){if(F===void 0&&(F=1),util$6.isUndefined(R)||F<=0)return!1;if(this.contains(R))this.dictionary.getValue(R).copies+=F;else{var D={value:R,copies:F};this.dictionary.setValue(R,D)}return this.nElements+=F,!0},B.prototype.count=function(R){return this.contains(R)?this.dictionary.getValue(R).copies:0},B.prototype.contains=function(R){return this.dictionary.containsKey(R)},B.prototype.remove=function(R,F){if(F===void 0&&(F=1),util$6.isUndefined(R)||F<=0)return!1;if(this.contains(R)){var D=this.dictionary.getValue(R);return F>D.copies?this.nElements-=D.copies:this.nElements-=F,D.copies-=F,D.copies<=0&&this.dictionary.remove(R),!0}else return!1},B.prototype.toArray=function(){for(var R=[],F=this.dictionary.values(),D=0,G=F;Dthis.nElements||util$5.isUndefined(R))return!1;var D=this.createNode(R);if(this.nElements===0||this.lastNode===null)this.firstNode=D,this.lastNode=D;else if(F===this.nElements)this.lastNode.next=D,this.lastNode=D;else if(F===0)D.next=this.firstNode,this.firstNode=D;else{var G=this.nodeAtIndex(F-1);if(G===null)return!1;D.next=G.next,G.next=D}return this.nElements++,!0},B.prototype.first=function(){if(this.firstNode!==null)return this.firstNode.element},B.prototype.last=function(){if(this.lastNode!==null)return this.lastNode.element},B.prototype.elementAtIndex=function(R){var F=this.nodeAtIndex(R);if(F!==null)return F.element},B.prototype.indexOf=function(R,F){var D=F||util$5.defaultEquals;if(util$5.isUndefined(R))return-1;for(var G=this.firstNode,U=0;G!==null;){if(D(G.element,R))return U;U++,G=G.next}return-1},B.prototype.contains=function(R,F){return this.indexOf(R,F)>=0},B.prototype.remove=function(R,F){var D=F||util$5.defaultEquals;if(this.nElements<1||util$5.isUndefined(R))return!1;for(var G=null,U=this.firstNode;U!==null;){if(D(U.element,R))return G===null?(this.firstNode=U.next,U===this.lastNode&&(this.lastNode=null)):U===this.lastNode?(this.lastNode=G,G.next=U.next,U.next=null):(G.next=U.next,U.next=null),this.nElements--,!0;G=U,U=U.next}return!1},B.prototype.clear=function(){this.firstNode=null,this.lastNode=null,this.nElements=0},B.prototype.equals=function(R,F){var D=F||util$5.defaultEquals;return!(R instanceof B)||this.size()!==R.size()?!1:this.equalsAux(this.firstNode,R.firstNode,D)},B.prototype.equalsAux=function(R,F,D){for(;R!==null&&F!==null;){if(!D(R.element,F.element))return!1;R=R.next,F=F.next}return!0},B.prototype.removeElementAtIndex=function(R){if(!(R<0||R>=this.nElements||this.firstNode===null||this.lastNode===null)){var F;if(this.nElements===1)F=this.firstNode.element,this.firstNode=null,this.lastNode=null;else{var D=this.nodeAtIndex(R-1);D===null?(F=this.firstNode.element,this.firstNode=this.firstNode.next):D.next===this.lastNode&&(F=this.lastNode.element,this.lastNode=D),D!==null&&D.next!==null&&(F=D.next.element,D.next=D.next.next)}return this.nElements--,F}},B.prototype.forEach=function(R){for(var F=this.firstNode;F!==null&&R(F.element)!==!1;)F=F.next},B.prototype.reverse=function(){for(var R=null,F=this.firstNode,D=null;F!==null;)D=F.next,F.next=R,R=F,F=D;D=this.firstNode,this.firstNode=this.lastNode,this.lastNode=D},B.prototype.toArray=function(){for(var R=[],F=this.firstNode;F!==null;)R.push(F.element),F=F.next;return R},B.prototype.size=function(){return this.nElements},B.prototype.isEmpty=function(){return this.nElements<=0},B.prototype.toString=function(){return arrays$2.toString(this.toArray())},B.prototype.nodeAtIndex=function(R){if(R<0||R>=this.nElements)return null;if(R===this.nElements-1)return this.lastNode;for(var F=this.firstNode,D=0;D0&&(R=R.rightCh);return R},B.prototype.transplant=function(R,F){R.parent===null?this.root=F:R===R.parent.leftCh?R.parent.leftCh=F:R.parent.rightCh=F,F!==null&&(F.parent=R.parent)},B.prototype.removeNode=function(R){if(R.leftCh===null)this.transplant(R,R.rightCh);else if(R.rightCh===null)this.transplant(R,R.leftCh);else{var F=this.minimumAux(R.rightCh);F.parent!==R&&(this.transplant(F,F.rightCh),F.rightCh=R.rightCh,F.rightCh.parent=F),this.transplant(R,F),F.leftCh=R.leftCh,F.leftCh.parent=F}},B.prototype.inorderTraversalAux=function(R,F,D){R===null||D.stop||(this.inorderTraversalAux(R.leftCh,F,D),!D.stop&&(D.stop=F(R.element)===!1,!D.stop&&this.inorderTraversalAux(R.rightCh,F,D)))},B.prototype.levelTraversalAux=function(R,F){var D=new Queue_1$1.default;for(R!==null&&D.enqueue(R),R=D.dequeue()||null;R!=null;){if(F(R.element)===!1)return;R.leftCh!==null&&D.enqueue(R.leftCh),R.rightCh!==null&&D.enqueue(R.rightCh),R=D.dequeue()||null}},B.prototype.preorderTraversalAux=function(R,F,D){R===null||D.stop||(D.stop=F(R.element)===!1,!D.stop&&(this.preorderTraversalAux(R.leftCh,F,D),!D.stop&&this.preorderTraversalAux(R.rightCh,F,D)))},B.prototype.postorderTraversalAux=function(R,F,D){R===null||D.stop||(this.postorderTraversalAux(R.leftCh,F,D),!D.stop&&(this.postorderTraversalAux(R.rightCh,F,D),!D.stop&&(D.stop=F(R.element)===!1)))},B.prototype.minimumAux=function(R){for(;R!=null&&R.leftCh!==null;)R=R.leftCh;return R},B.prototype.maximumAux=function(R){for(;R!=null&&R.rightCh!==null;)R=R.rightCh;return R},B.prototype.heightAux=function(R){return R===null?-1:Math.max(this.heightAux(R.leftCh),this.heightAux(R.rightCh))+1},B.prototype.insertNode=function(R){for(var F=null,D=this.root;D!==null;){var G=this.compare(R.element,D.element);if(G===0)return null;G<0?(F=D,D=D.leftCh):(F=D,D=D.rightCh)}return R.parent=F,F===null?this.root=R:this.compare(R.element,F.element)<0?F.leftCh=R:F.rightCh=R,R},B.prototype.createNode=function(R){return{element:R,leftCh:null,rightCh:null,parent:null}},B}();BSTreeKV$1.default=BSTreeKV;var __extends$2=commonjsGlobal$1&&commonjsGlobal$1.__extends||function(){var B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,F){R.__proto__=F}||function(R,F){for(var D in F)F.hasOwnProperty(D)&&(R[D]=F[D])};return function(R,F){B(R,F);function D(){this.constructor=R}R.prototype=F===null?Object.create(F):(D.prototype=F.prototype,new D)}}();Object.defineProperty(BSTree$1,"__esModule",{value:!0});var BSTreeKV_1$1=BSTreeKV$1,BSTree=function(B){__extends$2(R,B);function R(){return B!==null&&B.apply(this,arguments)||this}return R}(BSTreeKV_1$1.default);BSTree$1.default=BSTree;var Heap$1={};Object.defineProperty(Heap$1,"__esModule",{value:!0});var collections=util$a,arrays$1=arrays$4,Heap=function(){function B(R){this.data=[],this.compare=R||collections.defaultCompare}return B.prototype.leftChildIndex=function(R){return 2*R+1},B.prototype.rightChildIndex=function(R){return 2*R+2},B.prototype.parentIndex=function(R){return Math.floor((R-1)/2)},B.prototype.minIndex=function(R,F){return F>=this.data.length?R>=this.data.length?-1:R:this.compare(this.data[R],this.data[F])<=0?R:F},B.prototype.siftUp=function(R){for(var F=this.parentIndex(R);R>0&&this.compare(this.data[F],this.data[R])>0;)arrays$1.swap(this.data,F,R),R=F,F=this.parentIndex(R)},B.prototype.siftDown=function(R){for(var F=this.minIndex(this.leftChildIndex(R),this.rightChildIndex(R));F>=0&&this.compare(this.data[R],this.data[F])>0;)arrays$1.swap(this.data,F,R),R=F,F=this.minIndex(this.leftChildIndex(R),this.rightChildIndex(R))},B.prototype.peek=function(){if(this.data.length>0)return this.data[0]},B.prototype.add=function(R){return collections.isUndefined(R)?!1:(this.data.push(R),this.siftUp(this.data.length-1),!0)},B.prototype.removeRoot=function(){if(this.data.length>0){var R=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),R}},B.prototype.contains=function(R){var F=collections.compareToEquals(this.compare);return arrays$1.contains(this.data,R,F)},B.prototype.size=function(){return this.data.length},B.prototype.isEmpty=function(){return this.data.length<=0},B.prototype.clear=function(){this.data.length=0},B.prototype.forEach=function(R){arrays$1.forEach(this.data,R)},B}();Heap$1.default=Heap;var LinkedDictionary$1={},__extends$1=commonjsGlobal$1&&commonjsGlobal$1.__extends||function(){var B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,F){R.__proto__=F}||function(R,F){for(var D in F)F.hasOwnProperty(D)&&(R[D]=F[D])};return function(R,F){B(R,F);function D(){this.constructor=R}R.prototype=F===null?Object.create(F):(D.prototype=F.prototype,new D)}}();Object.defineProperty(LinkedDictionary$1,"__esModule",{value:!0});var Dictionary_1$3=Dictionary$2,util$3=util$a,LinkedDictionaryPair=function(){function B(R,F){this.key=R,this.value=F}return B.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},B}(),HeadOrTailLinkedDictionaryPair=function(){function B(){this.key=null,this.value=null}return B.prototype.unlink=function(){this.prev.next=this.next,this.next.prev=this.prev},B}();function isHeadOrTailLinkedDictionaryPair(B){return!B.next}var LinkedDictionary=function(B){__extends$1(R,B);function R(F){var D=B.call(this,F)||this;return D.head=new HeadOrTailLinkedDictionaryPair,D.tail=new HeadOrTailLinkedDictionaryPair,D.head.next=D.tail,D.tail.prev=D.head,D}return R.prototype.appendToTail=function(F){var D=this.tail.prev;D.next=F,F.prev=D,F.next=this.tail,this.tail.prev=F},R.prototype.getLinkedDictionaryPair=function(F){if(!util$3.isUndefined(F)){var D="$"+this.toStr(F),G=this.table[D];return G}},R.prototype.getValue=function(F){var D=this.getLinkedDictionaryPair(F);if(!util$3.isUndefined(D))return D.value},R.prototype.remove=function(F){var D=this.getLinkedDictionaryPair(F);if(!util$3.isUndefined(D))return B.prototype.remove.call(this,F),D.unlink(),D.value},R.prototype.clear=function(){B.prototype.clear.call(this),this.head.next=this.tail,this.tail.prev=this.head},R.prototype.replace=function(F,D){var G="$"+this.toStr(D.key);D.next=F.next,D.prev=F.prev,this.remove(F.key),D.prev.next=D,D.next.prev=D,this.table[G]=D,++this.nElements},R.prototype.setValue=function(F,D){if(!(util$3.isUndefined(F)||util$3.isUndefined(D))){var G=this.getLinkedDictionaryPair(F),U=new LinkedDictionaryPair(F,D),W="$"+this.toStr(F);if(util$3.isUndefined(G)){this.appendToTail(U),this.table[W]=U,++this.nElements;return}else return this.replace(G,U),G.value}},R.prototype.keys=function(){var F=[];return this.forEach(function(D,G){F.push(D)}),F},R.prototype.values=function(){var F=[];return this.forEach(function(D,G){F.push(G)}),F},R.prototype.forEach=function(F){for(var D=this.head.next;!isHeadOrTailLinkedDictionaryPair(D);){var G=F(D.key,D.value);if(G===!1)return;D=D.next}},R}(Dictionary_1$3.default);LinkedDictionary$1.default=LinkedDictionary;var MultiDictionary$1={};Object.defineProperty(MultiDictionary$1,"__esModule",{value:!0});var util$2=util$a,Dictionary_1$2=Dictionary$2,arrays=arrays$4,MultiDictionary=function(){function B(R,F,D){D===void 0&&(D=!1),this.dict=new Dictionary_1$2.default(R),this.equalsF=F||util$2.defaultEquals,this.allowDuplicate=D}return B.prototype.getValue=function(R){var F=this.dict.getValue(R);return util$2.isUndefined(F)?[]:arrays.copy(F)},B.prototype.setValue=function(R,F){if(util$2.isUndefined(R)||util$2.isUndefined(F))return!1;var D=this.dict.getValue(R);return util$2.isUndefined(D)?(this.dict.setValue(R,[F]),!0):!this.allowDuplicate&&arrays.contains(D,F,this.equalsF)?!1:(D.push(F),!0)},B.prototype.remove=function(R,F){if(util$2.isUndefined(F)){var D=this.dict.remove(R);return!util$2.isUndefined(D)}var G=this.dict.getValue(R);return!util$2.isUndefined(G)&&arrays.remove(G,F,this.equalsF)?(G.length===0&&this.dict.remove(R),!0):!1},B.prototype.keys=function(){return this.dict.keys()},B.prototype.values=function(){for(var R=this.dict.values(),F=[],D=0,G=R;D-1&&this.insertIdIntoRoot(F,D);for(var G in this.nodes)if(this.nodes.hasOwnProperty(G)){var U=this.findNodeId(G,R);U>-1&&this.insertIdIntoNode(G,F,U)}},B.prototype.insertIdAfterId=function(R,F){var D=this.findRootId(R);D>-1&&this.insertIdIntoRoot(F,D+1);for(var G in this.nodes)if(this.nodes.hasOwnProperty(G)){var U=this.findNodeId(G,R);U>-1&&this.insertIdIntoNode(G,F,U+1)}},B.prototype.insertIdIntoId=function(R,F){this.nodeInsertAtEnd(R,F),this.nodes[F]=[]},B.prototype.insertIdIntoRoot=function(R,F){if(F===void 0)this.rootInsertAtEnd(R);else if(F<0){var D=this.rootIds.length;this.rootIds.splice(F+D+1,0,R)}else this.rootIds.splice(F,0,R);this.nodes[R]=this.nodes[R]||[]},B.prototype.insertIdIntoNode=function(R,F,D){if(this.nodes[R]=this.nodes[R]||[],this.nodes[F]=this.nodes[F]||[],D===void 0)this.nodeInsertAtEnd(R,F);else if(D<0){var G=this.nodes[R].length;this.nodes[R].splice(D+G+1,0,F)}else this.nodes[R].splice(D,0,F)},B.prototype.moveId=function(R,F,D){var G=R,U=this.findRootId(G);this.nodes[F];for(var W in this.nodes)if(this.nodes.hasOwnProperty(W)){this.findNodeId(W,F);break}var q=F,Y=this.findRootId(q);this.nodes[F];for(var W in this.nodes)if(this.nodes.hasOwnProperty(W)){this.findNodeId(W,F);break}if(U>-1)if(Y>-1)switch(this.rootDelete(U),Y>U&&Y--,D){case Direction.BEFORE:this.insertIdIntoRoot(G,Y);break;case Direction.AFTER:this.insertIdIntoRoot(G,Y+1);break;case Direction.INSIDE_AT_START:this.nodeInsertAtStart(q,G);break;case Direction.INSIDE_AT_END:this.nodeInsertAtEnd(q,G);break}else{this.rootDelete(U);for(var W in this.nodes)if(this.nodes.hasOwnProperty(W)){var J=this.findNodeId(W,q);if(J>-1){switch(D){case Direction.BEFORE:this.insertIdIntoNode(W,G,J);break;case Direction.AFTER:this.insertIdIntoNode(W,G,J+1);break;case Direction.INSIDE_AT_START:this.nodeInsertAtStart(q,G);break;case Direction.INSIDE_AT_END:this.nodeInsertAtEnd(q,G);break}break}}}else if(Y>-1){for(var W in this.nodes)if(this.nodes.hasOwnProperty(W)){var J=this.findNodeId(W,G);if(J>-1){this.nodeDeleteAtIndex(W,J);break}}switch(D){case Direction.BEFORE:this.insertIdIntoRoot(G,Y);break;case Direction.AFTER:this.insertIdIntoRoot(G,Y+1);break;case Direction.INSIDE_AT_START:this.nodeInsertAtStart(q,G);break;case Direction.INSIDE_AT_END:this.nodeInsertAtEnd(q,G);break}}else{for(var W in this.nodes)if(this.nodes.hasOwnProperty(W)){var J=this.findNodeId(W,G);if(J>-1){this.nodeDeleteAtIndex(W,J);break}}for(var W in this.nodes)if(this.nodes.hasOwnProperty(W)){var J=this.findNodeId(W,q);if(J>-1){switch(D){case Direction.BEFORE:this.insertIdIntoNode(W,G,J);break;case Direction.AFTER:this.insertIdIntoNode(W,G,J+1);break;case Direction.INSIDE_AT_START:this.nodeInsertAtStart(q,G);break;case Direction.INSIDE_AT_END:this.nodeInsertAtEnd(q,G);break}break}}}},B.prototype.swapArrayElements=function(R,F,D){var G=R[F];return R[F]=R[D],R[D]=G,R},B.prototype.rootDeleteId=function(R){var F=this.findRootId(R);F>-1&&this.rootDelete(F)},B.prototype.nodeAndSubNodesDelete=function(R){for(var F=[],D=0;D(B[B.pppppp=0]="pppppp",B[B.ppppp=1]="ppppp",B[B.pppp=2]="pppp",B[B.ppp=3]="ppp",B[B.pp=4]="pp",B[B.p=5]="p",B[B.mp=6]="mp",B[B.mf=7]="mf",B[B.f=8]="f",B[B.ff=9]="ff",B[B.fff=10]="fff",B[B.ffff=11]="ffff",B[B.fffff=12]="fffff",B[B.ffffff=13]="ffffff",B[B.sf=14]="sf",B[B.sff=15]="sff",B[B.sfp=16]="sfp",B[B.sfpp=17]="sfpp",B[B.fp=18]="fp",B[B.rf=19]="rf",B[B.rfz=20]="rfz",B[B.sfz=21]="sfz",B[B.sffz=22]="sffz",B[B.fz=23]="fz",B[B.other=24]="other",B))(DynamicEnum||{});InstantaneousDynamicExpression.staticConstructor();class DynamicsContainer{constructor(R,F){R instanceof ContinuousDynamicExpression?this.continuousDynamicExpression=R:R instanceof InstantaneousDynamicExpression&&(this.instantaneousDynamicExpression=R),this.staffNumber=F}static Compare(R,F){return R.parMultiExpression().AbsoluteTimestamp.CompareTo(F.parMultiExpression().AbsoluteTimestamp)}parMultiExpression(){if(this.continuousDynamicExpression)return this.continuousDynamicExpression.StartMultiExpression;if(this.instantaneousDynamicExpression)return this.instantaneousDynamicExpression.ParentMultiExpression}}class AbstractNotationInstruction{constructor(R){this.printObject=!0,this.parent=R}get Parent(){return this.parent}set Parent(R){this.parent=R}get PrintObject(){return this.printObject}set PrintObject(R){this.printObject=R}}class RhythmInstruction extends AbstractNotationInstruction{constructor(R,F){super(void 0),this.rhythm=R,this.numerator=R.Numerator,this.denominator=R.Denominator,this.symbolEnum=F}get Rhythm(){return this.rhythm}set Rhythm(R){this.rhythm=R}get SymbolEnum(){return this.symbolEnum}set SymbolEnum(R){this.symbolEnum=R}clone(){return new RhythmInstruction(this.rhythm.clone(),this.symbolEnum)}OperatorEquals(R){const F=this;return F===R?!0:!F||!R?!1:F.numerator===R.numerator&&F.denominator===R.denominator}OperatorNotEqual(R){return this!==R}ToString(){return"Rhythm: "+this.rhythm.toString()}}var RhythmSymbolEnum=(B=>(B[B.NONE=0]="NONE",B[B.COMMON=1]="COMMON",B[B.CUT=2]="CUT",B))(RhythmSymbolEnum||{});class MusicPartManagerIterator{constructor(R,F,D){this.currentMeasureIndex=0,this.currentPartIndex=0,this.currentVoiceEntryIndex=-1,this.currentDynamicEntryIndex=0,this.currentTempoEntryIndex=0,this.currentDynamicChangingExpressions=[],this.repetitionIterationCountDictKeys=[],this.repetitionIterationCountDictValues=[],this.currentRepetition=void 0,this.endReached=!1,this.frontReached=!1,this.currentTimeStamp=new Fraction$1(0,1),this.currentEnrolledMeasureTimestamp=new Fraction$1(0,1),this.currentRelativeInMeasureTimestamp=new Fraction$1(0,1),this.currentVerticalContainerInMeasureTimestamp=new Fraction$1(0,1),this.jumpResponsibleRepetition=void 0,this.activeDynamicExpressions=[];try{this.frontReached=!0,this.musicSheet=R,this.currentBpm=R.userStartTempoInBPM,this.currentVoiceEntries=void 0,this.frontReached=!1;for(const G of this.musicSheet.Repetitions)this.setRepetitionIterationCount(G,1);for(let G=0;G=this.JumpResponsibleRepetition.StartIndex&&G.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(G)}}handleRepetitionsAtMeasureEnd(){for(let R=0,F=this.currentMeasure.LastRepetitionInstructions.length;R-1&&this.getRepetitionIterationCount(G)=this.JumpResponsibleRepetition.StartIndex&&G.EndIndex<=this.JumpResponsibleRepetition.EndIndex&&this.resetRepetitionIterationCount(G),this.repetitionIterationCountDictKeys.contains(G))){const U=G.getForwardJumpTargetForIteration(this.getRepetitionIterationCount(G));if(U>=0){this.currentMeasureIndex=U,this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.jumpResponsibleRepetition=G,this.forwardJumpOccurred=!0;return}U===-2&&(this.endReached=!0)}}}this.currentMeasureIndex++,this.JumpResponsibleRepetition!==void 0&&this.currentMeasureIndex>this.JumpResponsibleRepetition.EndIndex&&(this.jumpResponsibleRepetition=void 0)}doBackJump(R){this.currentMeasureIndex=R.getBackwardJumpTarget(),this.currentMeasure=this.musicSheet.SourceMeasures[this.currentMeasureIndex],this.currentVoiceEntryIndex=-1,this.incrementRepetitionIterationCount(R),this.jumpResponsibleRepetition=R,this.backJumpOccurred=!0}activateCurrentRhythmInstructions(){if(this.currentMeasure!==void 0&&this.currentMeasure.FirstInstructionsStaffEntries.length>0&&this.currentMeasure.FirstInstructionsStaffEntries[0]!==void 0){const R=this.currentMeasure.FirstInstructionsStaffEntries[0].Instructions;for(let F=0,D=R.length;F0&&(this.currentDynamicEntryIndex>=R.length||R[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp.gte(this.CurrentSourceTimestamp));)this.currentDynamicEntryIndex--;for(;this.currentDynamicEntryIndex0&&(this.currentTempoEntryIndex>=F.length||F[this.currentTempoEntryIndex].AbsoluteTimestamp.gte(this.CurrentSourceTimestamp));)this.currentTempoEntryIndex--;for(;this.currentTempoEntryIndex=0&&this.currentVoiceEntryIndex=0&&this.currentMeasureIndex0){if(!R)return!0;for(let D=0,G=F.length;DF&&(this.openSheetMusicDisplay.Sheet.SelectionStart=this.openSheetMusicDisplay.Sheet.SourceMeasures[F].AbsoluteTimestamp),this.openSheetMusicDisplay.Sheet&&this.openSheetMusicDisplay.Sheet.SourceMeasures.length>D){const U=this.openSheetMusicDisplay.Sheet.SourceMeasures[D];this.openSheetMusicDisplay.Sheet.SelectionEnd=Fraction$1.plus(U.AbsoluteTimestamp,U.Duration)}this.iterator=this.manager.getIterator()}getStaffEntryFromVoiceEntry(R){const F=R.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.measureListIndex,D=R.ParentSourceStaffEntry.ParentStaff.idInMusicSheet;return this.graphic.findGraphicalStaffEntryFromMeasureList(D,F,R.ParentSourceStaffEntry)}updateWithTimestamp(R){const F=this.manager.absoluteEnrolledToSheetTimestamp(R),D=this.graphic.calculateXPositionFromTimestamp(F),G=D[0],U=D[1];this.updateCurrentPageFromSystem(U);const W=D[2];if(!W)return;const q=Math.max(W.parentMeasure.MeasureNumber,1);let Y;for(const te of this.graphic.MeasureList[q-1])if(te){Y=te;break}const J=this.graphic.calculateCursorPoints(G,U),Z=J[0].y,K=J[1].y-Z;if(!!Y){if(this.updateWidthAndStyle(Y.PositionAndShape,G,Z,K),this.openSheetMusicDisplay.FollowCursor){const te=this.cursorElement.getBoundingClientRect().top;this.cursorElement.scrollIntoView({behavior:te<1e3?"smooth":"auto",block:"center"})}this.cursorElement.style.display=""}}update(){if(this.hidden||this.hidden===void 0||this.hidden===null)return;this.updateCurrentPage();const R=this.Iterator,F=R.CurrentVisibleVoiceEntries();if(R.EndReached||!R.CurrentVoiceEntries||F.length===0)return;let D=0,G=0,U=0,W;if(R.CurrentMeasure.isReducedToMultiRest){const Z=this.graphic.findGraphicalMeasure(R.CurrentMeasureIndex,0),K=Z.parentSourceMeasure.multipleRestMeasures,Q=R.CurrentMeasure.multipleRestMeasureNumber/(K+1),ie=Z.PositionAndShape.Size.width-Z.beginInstructionsWidth;D=Z.PositionAndShape.AbsolutePosition.x+Z.beginInstructionsWidth+Q*ie,W=Z.ParentMusicSystem}else{const K=F.map(te=>this.getStaffEntryFromVoiceEntry(te)).sort((te,Q)=>{var ie,se,ne,re;return((se=(ie=te==null?void 0:te.PositionAndShape)==null?void 0:ie.AbsolutePosition)==null?void 0:se.x)<=((re=(ne=Q==null?void 0:Q.PositionAndShape)==null?void 0:ne.AbsolutePosition)==null?void 0:re.x)?-1:1})[0];K&&(D=K.PositionAndShape.AbsolutePosition.x,W=K.parentMeasure.ParentMusicSystem)}if(!W)return;G=W.PositionAndShape.AbsolutePosition.y+W.StaffLines[0].PositionAndShape.RelativePosition.y;const q=W.StaffLines[W.StaffLines.length-1];U=W.PositionAndShape.AbsolutePosition.y+q.PositionAndShape.RelativePosition.y+q.StaffHeight-G;const J=this.graphic.findGraphicalMeasure(R.CurrentMeasureIndex,0).PositionAndShape;if(this.updateWidthAndStyle(J,D,G,U),this.openSheetMusicDisplay.FollowCursor&&this.cursorOptions.follow)if(this.openSheetMusicDisplay.EngravingRules.RenderSingleHorizontalStaffline)this.cursorElement.scrollIntoView({behavior:"smooth",inline:"center"});else{const Z=this.cursorElement.getBoundingClientRect().top;this.cursorElement.scrollIntoView({behavior:Z<1e3?"smooth":"auto",block:"center"})}this.cursorElement.style.display=""}updateWidthAndStyle(R,F,D,G){const U=this.cursorElement;let W=0,q=G;switch(this.cursorOptions.type){case 1:U.style.top=D*10*this.openSheetMusicDisplay.zoom+"px",U.style.left=(F-1.5)*10*this.openSheetMusicDisplay.zoom+"px",q=G*10*this.openSheetMusicDisplay.zoom,U.height=q,U.style.height=q+"px",W=5*this.openSheetMusicDisplay.zoom;break;case 2:U.style.top=(D-2.5)*10*this.openSheetMusicDisplay.zoom+"px",U.style.left=F*10*this.openSheetMusicDisplay.zoom+"px",q=1.5*10*this.openSheetMusicDisplay.zoom,U.height=q,U.style.height=q+"px",W=5*this.openSheetMusicDisplay.zoom;break;case 3:U.style.top=R.AbsolutePosition.y*10*this.openSheetMusicDisplay.zoom+"px",U.style.left=R.AbsolutePosition.x*10*this.openSheetMusicDisplay.zoom+"px",q=G*10*this.openSheetMusicDisplay.zoom,U.height=q,U.style.height=q+"px",W=R.Size.width*10*this.openSheetMusicDisplay.zoom;break;case 4:U.style.top=R.AbsolutePosition.y*10*this.openSheetMusicDisplay.zoom+"px",U.style.left=R.AbsolutePosition.x*10*this.openSheetMusicDisplay.zoom+"px",q=G*10*this.openSheetMusicDisplay.zoom,U.height=q,U.style.height=q+"px",W=(F-R.AbsolutePosition.x)*10*this.openSheetMusicDisplay.zoom;break;default:U.style.top=D*10*this.openSheetMusicDisplay.zoom+"px",U.style.left=(F-1.5)*10*this.openSheetMusicDisplay.zoom+"px",q=G*10*this.openSheetMusicDisplay.zoom,U.height=q,U.style.height=q+"px",W=3*10*this.openSheetMusicDisplay.zoom;break}W!==U.width&&(U.width=W,this.updateStyle(W,this.cursorOptions))}hide(){this.cursorElement.style.display="none",this.hidden=!0}next(){this.Iterator.moveToNextVisibleVoiceEntry(!1),this.update()}reset(){this.resetIterator();const R=this.manager.getIterator(this.graphic.ParentMusicSheet.SelectionStart);this.updateWithTimestamp(R.CurrentEnrolledTimestamp)}updateStyle(R,F=void 0){F!==void 0&&(this.cursorOptions=F);const D=document.createElement("canvas");D.width=this.cursorElement.width,D.height=1;const G=D.getContext("2d");G.globalAlpha=this.cursorOptions.alpha;const U=G.createLinearGradient(0,0,this.cursorElement.width,0);switch(this.cursorOptions.type){case 1:case 2:case 3:case 4:U.addColorStop(1,this.cursorOptions.color);break;default:U.addColorStop(0,"white"),U.addColorStop(.2,this.cursorOptions.color),U.addColorStop(.8,this.cursorOptions.color),U.addColorStop(1,"white");break}G.fillStyle=U,G.fillRect(0,0,R,1),this.cursorElement.src=D.toDataURL("image/png")}get Iterator(){return this.iterator}get Hidden(){return this.hidden}VoicesUnderCursor(R){return this.Iterator.CurrentVisibleVoiceEntries(R)}NotesUnderCursor(R){const F=this.VoicesUnderCursor(R),D=[];return F.forEach(G=>{D.push.apply(D,G.Notes)}),D}GNotesUnderCursor(R){const F=this.VoicesUnderCursor(R),D=[];return F.forEach(G=>{D.push(...G.Notes.map(U=>this.rules.GNote(U)))}),D}updateCurrentPage(){const R=this.Iterator.currentTimeStamp;for(const F of this.graphic.MusicPages)if(F.MusicSystems.last().GetSystemsLastTimeStamp().gt(R)){const G=F.PageNumber;return G!==this.currentPageNumber&&(this.container.removeChild(this.cursorElement),this.container=document.getElementById(this.rules.DYContainerId+G),this.container.appendChild(this.cursorElement)),this.currentPageNumber=G}return 1}updateCurrentPageFromSystem(R){if(R!=null&&R.Parent){const F=R.Parent.PageNumber;return F!==this.currentPageNumber&&(this.container.removeChild(this.cursorElement),this.container=document.getElementById(this.rules.DYContainerId+F),this.container.appendChild(this.cursorElement)),this.currentPageNumber=F}return 1}}class PointF2D{constructor(R=0,F=0){this.x=0,this.y=0,this.x=R,this.y=F}static get Empty(){return new PointF2D}static pointsAreEqual(R,F){return R.x===F.x&&R.y===F.y}ToString(){return"["+this.x+", "+this.y+"]"}}class SizeF2D{constructor(R=0,F=0){this.width=R,this.height=F}}class RectangleF2D{constructor(R,F,D,G){this.x=0,this.y=0,this.width=0,this.height=0,this.x=R,this.y=F,this.width=D,this.height=G}static createFromLocationAndSize(R,F){return new RectangleF2D(R.x,R.y,F.width,F.height)}get Location(){return new PointF2D(this.x,this.y)}get Size(){return new SizeF2D(this.width,this.height)}}class AClassHierarchyTrackable{isInstanceOfClass(R){let F=this.constructor.prototype;for(;F;){if(R===F.constructor.name)return!0;F=F.__proto__}return!1}}class GraphicalObject extends AClassHierarchyTrackable{get PositionAndShape(){return this.boundingBox}set PositionAndShape(R){this.boundingBox=R}}class StaffLineActivitySymbol extends GraphicalObject{constructor(R){super(),this.parentStaffLine=R;const F=R.PositionAndShape;this.boundingBox=new BoundingBox$1(this,F),this.boundingBox.BorderRight=6,this.boundingBox.BorderBottom=4.5,this.boundingBox.BorderLeft=-1.5,this.boundingBox.BorderTop=-1.5}}class Clickable extends GraphicalObject{}class BoundingBox$1{constructor(R=void 0,F=void 0,D=!1){this.isSymbol=!1,this.relativePositionHasBeenSet=!1,this.xBordersHaveBeenSet=!1,this.yBordersHaveBeenSet=!1,this.absolutePosition=new PointF2D,this.relativePosition=new PointF2D,this.size=new SizeF2D,this.marginSize=new SizeF2D,this.upperLeftCorner=new PointF2D,this.upperLeftMarginCorner=new 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=F,this.dataObject=R,this.isSymbol=D,this.xBordersHaveBeenSet=!1,this.yBordersHaveBeenSet=!1,F&&(this.Parent=F)}get RelativePositionHasBeenSet(){return this.relativePositionHasBeenSet}get XBordersHaveBeenSet(){return this.xBordersHaveBeenSet}set XBordersHaveBeenSet(R){this.xBordersHaveBeenSet=R}get YBordersHaveBeenSet(){return this.yBordersHaveBeenSet}set YBordersHaveBeenSet(R){this.yBordersHaveBeenSet=R}get AbsolutePosition(){return this.absolutePosition}set AbsolutePosition(R){this.absolutePosition=R}get RelativePosition(){return this.relativePosition}set RelativePosition(R){this.relativePosition=R,this.relativePositionHasBeenSet=!0}get Size(){return this.size}set Size(R){this.size=R}get MarginSize(){return this.marginSize}get UpperLeftCorner(){return this.upperLeftCorner}get UpperLeftMarginCorner(){return this.upperLeftMarginCorner}get BorderLeft(){return this.borderLeft}set BorderLeft(R){this.borderLeft=R,this.calculateRectangle()}get BorderRight(){return this.borderRight}set BorderRight(R){this.borderRight=R,this.calculateRectangle()}get BorderTop(){return this.borderTop}set BorderTop(R){this.borderTop=R,this.calculateRectangle()}get BorderBottom(){return this.borderBottom}set BorderBottom(R){this.borderBottom=R,this.calculateRectangle()}get BorderMarginLeft(){return this.borderMarginLeft>this.borderLeft?this.borderLeft:this.borderMarginLeft}set BorderMarginLeft(R){this.borderMarginLeft=R,this.calculateMarginRectangle()}get BorderMarginRight(){return this.borderMarginRightthis.borderTop?this.borderTop:this.borderMarginTop}set BorderMarginTop(R){this.borderMarginTop=R,this.calculateMarginRectangle()}get BorderMarginBottom(){return this.borderMarginBottom-1&&this.parent.ChildElements.splice(W,1)}this.parent=R,((D=(F=this.parent)==null?void 0:F.ChildElements)==null?void 0:D.indexOf(this))>-1?log$2.error("BoundingBox of "+this.dataObject.constructor.name+" already in children list of "+this.parent.dataObject.constructor.name+"'s BoundingBox"):(U=(G=this.parent)==null?void 0:G.ChildElements)==null||U.push(this)}get DataObject(){return this.dataObject}get Center(){return new 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 R=this.parent;for(;R;)this.absolutePosition.x+=R.relativePosition.x,this.absolutePosition.y+=R.relativePosition.y,R=R.parent}calculateAbsolutePositionsRecursiveWithoutTopelement(){this.absolutePosition.x=0,this.absolutePosition.y=0;for(let R=0,F=this.ChildElements.length;R.001;break;case ColDirEnum.Up:case ColDirEnum.Down:G=this.relativePosition.y,R.calculateMarginPositionAlongDirection(this,F),U=Math.abs(G-this.relativePosition.y)>.001;break;default:throw new ArgumentOutOfRangeException("direction")}while(U)}collisionDetection(R){const F=Math.min(this.AbsolutePosition.x+this.borderRight,R.absolutePosition.x+R.borderRight)-Math.max(this.AbsolutePosition.x+this.borderLeft,R.absolutePosition.x+R.borderLeft),D=Math.min(this.AbsolutePosition.y+this.borderBottom,R.absolutePosition.y+R.borderBottom)-Math.max(this.AbsolutePosition.y+this.borderTop,R.absolutePosition.y+R.borderTop);return F>0&&D>0}liesInsideBorders(R){const F=this.AbsolutePosition.x+this.borderLeft<=R.absolutePosition.x+R.borderLeft&&R.absolutePosition.x+R.borderLeft<=this.AbsolutePosition.x+this.borderRight,D=this.AbsolutePosition.x+this.borderLeft<=R.absolutePosition.x+R.borderRight&&R.absolutePosition.x+R.borderRight<=this.AbsolutePosition.x+this.borderRight;if(F&&D){const G=this.AbsolutePosition.y+this.borderTop<=R.absolutePosition.y+R.borderTop&&R.absolutePosition.y+R.borderTop<=this.AbsolutePosition.y+this.borderBottom,U=this.AbsolutePosition.y+this.borderTop<=R.absolutePosition.y+R.borderBottom&&R.absolutePosition.y+R.borderBottom<=this.AbsolutePosition.y+this.borderBottom;if(G&&U)return!0}return!1}pointLiesInsideBorders(R){return this.AbsolutePosition.x+this.borderLeft<=R.x&&R.x<=this.AbsolutePosition.x+this.borderRight&&this.AbsolutePosition.y+this.borderTop<=R.y&&R.y<=this.AbsolutePosition.y+this.borderBottom}marginCollisionDetection(R){const F=Math.min(this.AbsolutePosition.x+this.borderMarginRight,R.absolutePosition.x+R.borderMarginRight)-Math.max(this.AbsolutePosition.x+this.borderMarginLeft,R.absolutePosition.x+R.borderMarginLeft),D=Math.min(this.AbsolutePosition.y+this.borderMarginBottom,R.absolutePosition.y+R.borderMarginBottom)-Math.max(this.AbsolutePosition.y+this.borderMarginTop,R.absolutePosition.y+R.borderMarginTop);return F>0&&D>0}liesInsideMargins(R){const F=this.AbsolutePosition.x+this.borderMarginLeft<=R.absolutePosition.x+R.borderMarginLeft&&R.absolutePosition.x+R.borderMarginLeft<=this.AbsolutePosition.x+this.borderMarginRight,D=this.AbsolutePosition.x+this.borderMarginLeft<=R.absolutePosition.x+R.borderMarginRight&&R.absolutePosition.x+R.borderMarginRight<=this.AbsolutePosition.x+this.borderMarginRight;if(F&&D){const G=this.AbsolutePosition.y+this.borderMarginTop<=R.absolutePosition.y+R.borderMarginTop&&R.absolutePosition.y+R.borderMarginTop<=this.AbsolutePosition.y+this.borderMarginBottom,U=this.AbsolutePosition.y+this.borderMarginTop<=R.absolutePosition.y+R.borderMarginBottom&&R.absolutePosition.y+R.borderMarginBottom<=this.AbsolutePosition.y+this.borderMarginBottom;if(G&&U)return!0}return!1}pointLiesInsideMargins(R){return this.AbsolutePosition.x+this.borderMarginLeft<=R.x&&R.x<=this.AbsolutePosition.x+this.borderMarginRight&&this.AbsolutePosition.y+this.borderMarginTop<=R.y&&R.y<=this.AbsolutePosition.y+this.borderMarginBottom}computeNonOverlappingPosition(R,F,D){this.RelativePosition=new PointF2D(D.x,D.y),this.setAbsolutePositionFromParent();let G=0,U=!1;do switch(F){case ColDirEnum.Left:case ColDirEnum.Right:G=this.relativePosition.x,R.calculatePositionAlongDirection(this,F),U=Math.abs(G-this.relativePosition.x)>1e-4;break;case ColDirEnum.Up:case ColDirEnum.Down:G=this.relativePosition.y,R.calculatePositionAlongDirection(this,F),U=Math.abs(G-this.relativePosition.y)>1e-4;break;default:throw new ArgumentOutOfRangeException("direction")}while(U)}getClickedObjectOfType(R){const F=this.dataObject;if(this.pointLiesInsideBorders(R)&&F)return F;for(let D=0,G=this.childElements.length;D(B[B.Left=0]="Left",B[B.Right=1]="Right",B[B.Up=2]="Up",B[B.Down=3]="Down",B))(ColDirEnum||{});class GraphicalMusicPage extends GraphicalObject{constructor(R){super(),this.musicSystems=[],this.labels=[],this.parent=R,this.boundingBox=new BoundingBox$1(this,void 0)}get MusicSystems(){return this.musicSystems}set MusicSystems(R){this.musicSystems=R}get Labels(){return this.labels}set Labels(R){this.labels=R}get Parent(){return this.parent}set Parent(R){this.parent=R}get PageNumber(){return this.pageNumber}set PageNumber(R){this.pageNumber=R}setMusicPageAbsolutePosition(R,F){return new PointF2D(0,0)}}var PagePlacementEnum=(B=>(B[B.Down=0]="Down",B[B.Right=1]="Right",B[B.RightDown=2]="RightDown",B))(PagePlacementEnum||{}),TextAlignmentEnum=(B=>(B[B.LeftTop=0]="LeftTop",B[B.LeftCenter=1]="LeftCenter",B[B.LeftBottom=2]="LeftBottom",B[B.CenterTop=3]="CenterTop",B[B.CenterCenter=4]="CenterCenter",B[B.CenterBottom=5]="CenterBottom",B[B.RightTop=6]="RightTop",B[B.RightCenter=7]="RightCenter",B[B.RightBottom=8]="RightBottom",B))(TextAlignmentEnum||{});class TextAlignment{static IsLeft(R){return R===0||R===1||R===2}static IsCenterAligned(R){return R===3||R===4||R===5}static IsRight(R){return R===6||R===7||R===8}}var FontStyles=(B=>(B[B.Regular=0]="Regular",B[B.Bold=1]="Bold",B[B.Italic=2]="Italic",B[B.BoldItalic=3]="BoldItalic",B[B.Underlined=4]="Underlined",B))(FontStyles||{}),Fonts=(B=>(B[B.TimesNewRoman=0]="TimesNewRoman",B[B.Kokila=1]="Kokila",B[B.Gonville=2]="Gonville",B))(Fonts||{});const FontStringNames={0:"Times New Roman",1:"Kokila",2:"Gonville"};var TieTypes=(B=>(B.SIMPLE="",B.HAMMERON="H",B.PULLOFF="P",B.SLIDE="S",B.TAPPING="T",B))(TieTypes||{});const Additional={"-2":[4,12,23],"-7":[13],"-9":[6]};var NoteEnum=(B=>(B[B.C=0]="C",B[B.D=2]="D",B[B.E=4]="E",B[B.F=5]="F",B[B.G=7]="G",B[B.A=9]="A",B[B.B=11]="B",B))(NoteEnum||{}),AccidentalEnum=(B=>(B[B.SHARP=0]="SHARP",B[B.FLAT=1]="FLAT",B[B.NONE=2]="NONE",B[B.NATURAL=3]="NATURAL",B[B.DOUBLESHARP=4]="DOUBLESHARP",B[B.DOUBLEFLAT=5]="DOUBLEFLAT",B[B.TRIPLESHARP=6]="TRIPLESHARP",B[B.TRIPLEFLAT=7]="TRIPLEFLAT",B[B.QUARTERTONESHARP=8]="QUARTERTONESHARP",B[B.QUARTERTONEFLAT=9]="QUARTERTONEFLAT",B[B.SLASHFLAT=10]="SLASHFLAT",B[B.THREEQUARTERSSHARP=11]="THREEQUARTERSSHARP",B[B.THREEQUARTERSFLAT=12]="THREEQUARTERSFLAT",B[B.SLASHQUARTERSHARP=13]="SLASHQUARTERSHARP",B[B.SLASHSHARP=14]="SLASHSHARP",B[B.DOUBLESLASHFLAT=15]="DOUBLESLASHFLAT",B[B.SORI=16]="SORI",B[B.KORON=17]="KORON",B))(AccidentalEnum||{});const _Pitch=class{constructor(B,R,F,D=void 0){this.accidental=2,this.fundamentalNote=B,this.octave=R,this.accidental=F,this.accidentalXml=D,this.halfTone=B+(R+_Pitch.octXmlDiff)*12+_Pitch.HalfTonesFromAccidental(F),this.frequency=_Pitch.calcFrequency(this),this.nextFrequency=_Pitch.calcFrequency(this,"next"),this.prevFrequency=_Pitch.calcFrequency(this,"prev")}static getNoteEnumString(B){switch(B){case 0:return"C";case 2:return"D";case 4:return"E";case 5:return"F";case 7:return"G";case 9:return"A";case 11:return"B";default:return""}}static lineShiftFromNoteEnum(B,R){if(R===0)return[B,0];const F=_Pitch.pitchEnumValues,D=F.indexOf(B);let G=0,U=(D+R)%F.length;return D+R>F.length-1&&(G=1),U<0&&(U=F.length+U,G=-1),[F[U],G]}static CalculateTransposedHalfTone(B,R){const F=B.fundamentalNote+B.AccidentalHalfTones+R;return _Pitch.WrapAroundCheck(F,12)}static WrapAroundCheck(B,R){let F=0;for(;B<0;)B+=R,F--;for(;B>=R;)B-=R,F++;return{overflow:F,halftone:B}}static calcFrequency(B,R){let F=0,D;if(B instanceof _Pitch){const q=B;F=q.octave-1,D=q.fundamentalNote-9+q.AccidentalHalfTones}else typeof B=="number"&&(D=B-57);const G=window.DYSubjectId;let U=0;window.DYEnvironment==="COLEXIU"&&(Additional[12]=[120]);for(const q in Additional)if(Object.prototype.hasOwnProperty.call(Additional,q)&&Additional[q].includes(G)){U=parseFloat(q);break}let W=D+U;return R==="next"&&W++,R==="prev"&&W--,442*Math.pow(2,F)*Math.pow(2,W/12)}static calcFractionalKey(B){return Math.log(B/440)/Math.LN10*_Pitch.halftoneFactor+57}static fromFrequency(B){const R=_Pitch.calcFractionalKey(B)+.5,F=Math.floor(R/12)-_Pitch.octXmlDiff,D=Math.floor(R)%12;let G=D,U=2;return this.pitchEnumValues.indexOf(G)===-1&&(G=D-1,U=0),new _Pitch(G,F,U)}static fromHalftone(B){const R=Math.floor(B/12)-_Pitch.octXmlDiff,F=B%12;let D=F,G=2;return this.pitchEnumValues.indexOf(D)===-1&&(D=F-1,G=0),new _Pitch(D,R,G)}static ceiling(B){B=B%12;let R=B;return this.pitchEnumValues.indexOf(R)===-1&&(R=B+1),R}static floor(B){B=B%12;let R=B;return this.pitchEnumValues.indexOf(R)===-1&&(R=B-1),R}static HalfTonesFromAccidental(B){switch(B){case 2:return 0;case 0:return 1;case 1:return-1;case 3:return 0;case 4:return 2;case 5:return-2;case 6:return 3;case 7:return-3;case 8:return .5;case 9:return-.5;case 10:return-.51;case 11:return 1.5;case 12:return-1.5;case 13:return .0013;case 14:return .0014;case 15:return-.0015;case 16:return .0016;case 17:return .0017;default:throw new Error("Unhandled AccidentalEnum value")}}static AccidentalFromHalfTones(B){switch(B){case 0:return 2;case 1:return 0;case-1:return 1;case 2:return 4;case-2:return 5;case 3:return 6;case-3:return 7;case .5:return 8;case-.5:return 9;case 1.5:return 11;case-1.5:return 12;default:return B>0&&B<1?8:B<0&&B>-1?9:8}}static accidentalVexflow(B){let R;switch(B){case 3:R="n";break;case 1:R="b";break;case 0:R="#";break;case 4:R="##";break;case 6:R="###";break;case 5:R="bb";break;case 7:R="bbs";break;case 8:R="+";break;case 9:R="d";break;case 10:R="bs";break;case 11:R="++";break;case 12:R="db";break;case 13:R="+-";break;case 14:R="++-";break;case 15:R="bss";break;case 16:R="o";break;case 17:R="k";break}return R}get AccidentalHalfTones(){return _Pitch.HalfTonesFromAccidental(this.accidental)}get Octave(){return this.octave}get FundamentalNote(){return this.fundamentalNote}get Accidental(){return this.accidental}get AccidentalXml(){return this.accidentalXml}get Frequency(){return this.frequency}static get OctaveXmlDifference(){return _Pitch.octXmlDiff}getHalfTone(){return this.halfTone}getTransposedPitch(B){if(B>12)throw new Error("rewrite this method to handle bigger octave changes or don't use is with bigger octave changes!");return B>0?this.getHigherPitchByTransposeFactor(B):B<0?this.getLowerPitchByTransposeFactor(-B):this}DoEnharmonicChange(){switch(this.accidental){case 1:case 5:this.fundamentalNote=this.getPreviousFundamentalNote(this.fundamentalNote),this.accidental=_Pitch.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+(this.octave+_Pitch.octXmlDiff)*12));break;case 0:case 4:this.fundamentalNote=this.getNextFundamentalNote(this.fundamentalNote),this.accidental=_Pitch.AccidentalFromHalfTones(this.halfTone-(this.fundamentalNote+(this.octave+_Pitch.octXmlDiff)*12));break;default:return}}ToString(){let B=_Pitch.accidentalVexflow(this.accidental);return B||(B=""),"Key: "+_Pitch.getNoteEnumString(this.fundamentalNote)+B+", Note: "+this.fundamentalNote+", octave: "+this.octave.toString()}OperatorEquals(B){const R=this;return!R||!B?!1:R.FundamentalNote===B.FundamentalNote&&R.Octave===B.Octave&&R.Accidental===B.Accidental}OperatorNotEqual(B){return this!==B}OperatorFundamentalGreaterThan(B){const R=this;return R.Octave===B.Octave?R.FundamentalNote>B.FundamentalNote:R.Octave>B.Octave}OperatorFundamentalLessThan(B){const R=this;return R.Octave===B.Octave?R.FundamentalNote_Pitch.pitchEnumValues.length-1?(D=_Pitch.pitchEnumValues[R+B-_Pitch.pitchEnumValues.length],F++):D=_Pitch.pitchEnumValues[R+B],new _Pitch(D,F,2)}getLowerPitchByTransposeFactor(B){const R=_Pitch.pitchEnumValues.indexOf(this.fundamentalNote);let F=this.octave,D;return R-B<0?(D=_Pitch.pitchEnumValues[_Pitch.pitchEnumValues.length+R-B],F--):D=_Pitch.pitchEnumValues[R-B],new _Pitch(D,F,2)}getNextFundamentalNote(B){let R=_Pitch.pitchEnumValues.indexOf(B);return R=(R+1)%_Pitch.pitchEnumValues.length,_Pitch.pitchEnumValues[R]}getPreviousFundamentalNote(B){const R=_Pitch.pitchEnumValues.indexOf(B);return R>0?_Pitch.pitchEnumValues[R-1]:_Pitch.pitchEnumValues[_Pitch.pitchEnumValues.length-1]}};let Pitch=_Pitch;Pitch.pitchEnumValues=[0,2,4,5,7,9,11];Pitch.halftoneFactor=12/(Math.LN2/Math.LN10);Pitch.octXmlDiff=3;class VerticalGraphicalStaffEntryContainer{constructor(R,F){this.staffEntries=[],this.absoluteTimestamp=F,this.staffEntries=new Array(R)}get Index(){return this.index}set Index(R){this.index=R}get AbsoluteTimestamp(){return this.absoluteTimestamp}get StaffEntries(){return this.staffEntries}set StaffEntries(R){this.staffEntries=R}static compareByTimestamp(R,F){const D=R.absoluteTimestamp.RealValue,G=F.absoluteTimestamp.RealValue;return DG?1:0}getFirstNonNullStaffEntry(){for(let R=0,F=this.staffEntries.length;R(B[B.BaseWritingColor=0]="BaseWritingColor",B[B.FollowingCursor=1]="FollowingCursor",B[B.AlternativeFollowingCursor=2]="AlternativeFollowingCursor",B[B.PlaybackCursor=3]="PlaybackCursor",B[B.Highlighted=4]="Highlighted",B[B.ErrorUnderlay=5]="ErrorUnderlay",B[B.Selected=6]="Selected",B[B.SelectionSymbol=7]="SelectionSymbol",B[B.DebugColor1=8]="DebugColor1",B[B.DebugColor2=9]="DebugColor2",B[B.DebugColor3=10]="DebugColor3",B[B.SplitScreenDivision=11]="SplitScreenDivision",B[B.GreyTransparentOverlay=12]="GreyTransparentOverlay",B[B.MarkedArea1=13]="MarkedArea1",B[B.MarkedArea2=14]="MarkedArea2",B[B.MarkedArea3=15]="MarkedArea3",B[B.MarkedArea4=16]="MarkedArea4",B[B.MarkedArea5=17]="MarkedArea5",B[B.MarkedArea6=18]="MarkedArea6",B[B.MarkedArea7=19]="MarkedArea7",B[B.MarkedArea8=20]="MarkedArea8",B[B.MarkedArea9=21]="MarkedArea9",B[B.MarkedArea10=22]="MarkedArea10",B[B.Comment1=23]="Comment1",B[B.Comment2=24]="Comment2",B[B.Comment3=25]="Comment3",B[B.Comment4=26]="Comment4",B[B.Comment5=27]="Comment5",B[B.Comment6=28]="Comment6",B[B.Comment7=29]="Comment7",B[B.Comment8=30]="Comment8",B[B.Comment9=31]="Comment9",B[B.Comment10=32]="Comment10",B))(OutlineAndFillStyleEnum||{});const OUTLINE_AND_FILL_STYLE_DICT=new Dictionary;OUTLINE_AND_FILL_STYLE_DICT.setValue(0,"Thistle");OUTLINE_AND_FILL_STYLE_DICT.setValue(1,"Aqua");OUTLINE_AND_FILL_STYLE_DICT.setValue(2,"Azure");OUTLINE_AND_FILL_STYLE_DICT.setValue(3,"Bisque");OUTLINE_AND_FILL_STYLE_DICT.setValue(4,"CadetBlue");OUTLINE_AND_FILL_STYLE_DICT.setValue(5,"DarkBlue");OUTLINE_AND_FILL_STYLE_DICT.setValue(6,"DarkGoldenRod");OUTLINE_AND_FILL_STYLE_DICT.setValue(7,"BlanchedAlmond");OUTLINE_AND_FILL_STYLE_DICT.setValue(8,"Chartreuse");OUTLINE_AND_FILL_STYLE_DICT.setValue(9,"DarkGreen");OUTLINE_AND_FILL_STYLE_DICT.setValue(10,"DarkOrange");OUTLINE_AND_FILL_STYLE_DICT.setValue(11,"FireBrick");OUTLINE_AND_FILL_STYLE_DICT.setValue(12,"DarkSalmon");OUTLINE_AND_FILL_STYLE_DICT.setValue(13,"DarkSeaGreen");OUTLINE_AND_FILL_STYLE_DICT.setValue(14,"DarkOrchid");OUTLINE_AND_FILL_STYLE_DICT.setValue(15,"Aquamarine");OUTLINE_AND_FILL_STYLE_DICT.setValue(16,"DarkKhaki");OUTLINE_AND_FILL_STYLE_DICT.setValue(17,"ForestGreen");OUTLINE_AND_FILL_STYLE_DICT.setValue(18,"AliceBlue");OUTLINE_AND_FILL_STYLE_DICT.setValue(19,"DeepPink");OUTLINE_AND_FILL_STYLE_DICT.setValue(20,"Coral");OUTLINE_AND_FILL_STYLE_DICT.setValue(21,"DarkOliveGreen");OUTLINE_AND_FILL_STYLE_DICT.setValue(22,"Chocolate");OUTLINE_AND_FILL_STYLE_DICT.setValue(23,"DodgerBlue");OUTLINE_AND_FILL_STYLE_DICT.setValue(24,"Blue");OUTLINE_AND_FILL_STYLE_DICT.setValue(25,"Beige");OUTLINE_AND_FILL_STYLE_DICT.setValue(26,"Crimson");OUTLINE_AND_FILL_STYLE_DICT.setValue(27,"Fuchsia");OUTLINE_AND_FILL_STYLE_DICT.setValue(28,"Brown");OUTLINE_AND_FILL_STYLE_DICT.setValue(29,"BlanchedAlmond");OUTLINE_AND_FILL_STYLE_DICT.setValue(30,"CornflowerBlue");OUTLINE_AND_FILL_STYLE_DICT.setValue(31,"Cornsilk");OUTLINE_AND_FILL_STYLE_DICT.setValue(32,"DarkGrey");var GraphicalLayers=(B=>(B[B.Background=0]="Background",B[B.Highlight=1]="Highlight",B[B.MeasureError=2]="MeasureError",B[B.SelectionSymbol=3]="SelectionSymbol",B[B.Cursor=4]="Cursor",B[B.PSI_Debug=5]="PSI_Debug",B[B.Notes=6]="Notes",B[B.Comment=7]="Comment",B[B.Debug_above=8]="Debug_above",B))(GraphicalLayers||{}),NoteState=(B=>(B[B.Normal=0]="Normal",B[B.Selected=1]="Selected",B[B.Follow_Confirmed=2]="Follow_Confirmed",B[B.QFeedback_NotFound=3]="QFeedback_NotFound",B[B.QFeedback_OK=4]="QFeedback_OK",B[B.QFeedback_Perfect=5]="QFeedback_Perfect",B[B.Debug1=6]="Debug1",B[B.Debug2=7]="Debug2",B[B.Debug3=8]="Debug3",B))(NoteState||{}),AutoColorSet=(B=>(B.C="#d82c6b",B.D="#F89D15",B.E="#FFE21A",B.F="#4dbd5c",B.G="#009D96",B.A="#43469d",B.B="#76429c",B.Rest="#000000",B))(AutoColorSet||{});class GraphicalLine{constructor(R,F,D=0,G=OutlineAndFillStyleEnum.BaseWritingColor,U=void 0){this.start=R,this.end=F,this.width=D,this.styleId=G,this.colorHex=U}get Start(){return this.start}set Start(R){this.start=R}get End(){return this.end}set End(R){this.end=R}get Width(){return this.width}set Width(R){this.width=R}}class ClefInstruction extends AbstractNotationInstruction{constructor(R=ClefEnum.G,F=0,D=2){super(void 0),this.clefType=ClefEnum.G,this.line=2,this.octaveOffset=0,this.line=D,this.clefType=R,this.octaveOffset=F,this.calcParameters()}static getDefaultClefFromMidiInstrument(R){switch(R){case MidiInstrument.Acoustic_Grand_Piano:return new ClefInstruction(ClefEnum.F,0,4);case MidiInstrument.Electric_Bass_finger:return new ClefInstruction(ClefEnum.F,0,4);case MidiInstrument.Electric_Bass_pick:return new ClefInstruction(ClefEnum.F,0,4);case MidiInstrument.Fretless_Bass:return new ClefInstruction(ClefEnum.F,0,4);case MidiInstrument.Slap_Bass_1:return new ClefInstruction(ClefEnum.F,0,4);case MidiInstrument.Slap_Bass_2:return new ClefInstruction(ClefEnum.F,0,4);case MidiInstrument.Synth_Bass_1:return new ClefInstruction(ClefEnum.F,0,4);case MidiInstrument.Synth_Bass_2:return new ClefInstruction(ClefEnum.F,0,4);case MidiInstrument.Contrabass:return new ClefInstruction(ClefEnum.F,0,4);default:return new ClefInstruction(ClefEnum.G,0,2)}}static getAllPossibleClefs(){const R=[];for(let F=0;F<=2;F++){const D=new ClefInstruction(ClefEnum.G,F,2);R.push(D)}for(let F=-2;F<=0;F++){const D=new ClefInstruction(ClefEnum.F,F,4);R.push(D)}return R}static isSupportedClef(R){switch(R){case ClefEnum.G:case ClefEnum.F:case ClefEnum.C:case ClefEnum.percussion:case ClefEnum.TAB:return!0;default:return!1}}get ClefType(){return this.clefType}set ClefType(R){this.clefType=R}get Line(){return this.line}set Line(R){this.line=R}get OctaveOffset(){return this.octaveOffset}set OctaveOffset(R){this.octaveOffset=R}get ClefPitch(){return this.clefPitch}set ClefPitch(R){this.clefPitch=R}get ReferenceCyPosition(){return this.referenceCyPosition}set ReferenceCyPosition(R){this.referenceCyPosition=R}Equals(R){return this===R?!0:!this||!R?!1:this.clefPitch===R.clefPitch&&this.Line===R.Line}NotEqual(R){return!this.Equals(R)}ToString(){return"ClefType: "+this.clefType}calcParameters(){switch(this.clefType){case ClefEnum.G:this.clefPitch=new Pitch(NoteEnum.G,1+this.octaveOffset,AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+2;break;case ClefEnum.F:this.clefPitch=new Pitch(NoteEnum.F,0+this.octaveOffset,AccidentalEnum.NONE),this.referenceCyPosition=5-this.line+1.5;break;case ClefEnum.C:this.clefPitch=new Pitch(NoteEnum.C,1+this.octaveOffset,AccidentalEnum.NONE),this.referenceCyPosition=5-this.line;break;case ClefEnum.percussion:this.clefPitch=new Pitch(NoteEnum.C,2,AccidentalEnum.NONE),this.referenceCyPosition=2;break;case ClefEnum.TAB:this.clefPitch=new Pitch(NoteEnum.G,0,AccidentalEnum.NONE),this.referenceCyPosition=0;break;default:throw new ArgumentOutOfRangeException("clefType")}}}var ClefEnum=(B=>(B[B.G=0]="G",B[B.F=1]="F",B[B.C=2]="C",B[B.percussion=3]="percussion",B[B.TAB=4]="TAB",B))(ClefEnum||{}),MidiInstrument=(B=>(B[B.None=-1]="None",B[B.Acoustic_Grand_Piano=0]="Acoustic_Grand_Piano",B[B.Bright_Acoustic_Piano=1]="Bright_Acoustic_Piano",B[B.Electric_Grand_Piano=2]="Electric_Grand_Piano",B[B.Honky_tonk_Piano=3]="Honky_tonk_Piano",B[B.Electric_Piano_1=4]="Electric_Piano_1",B[B.Electric_Piano_2=5]="Electric_Piano_2",B[B.Harpsichord=6]="Harpsichord",B[B.Clavinet=7]="Clavinet",B[B.Celesta=8]="Celesta",B[B.Glockenspiel=9]="Glockenspiel",B[B.Music_Box=10]="Music_Box",B[B.Vibraphone=11]="Vibraphone",B[B.Marimba=12]="Marimba",B[B.Xylophone=13]="Xylophone",B[B.Tubular_Bells=14]="Tubular_Bells",B[B.Dulcimer=15]="Dulcimer",B[B.Drawbar_Organ=16]="Drawbar_Organ",B[B.Percussive_Organ=17]="Percussive_Organ",B[B.Rock_Organ=18]="Rock_Organ",B[B.Church_Organ=19]="Church_Organ",B[B.Reed_Organ=20]="Reed_Organ",B[B.Accordion=21]="Accordion",B[B.Harmonica=22]="Harmonica",B[B.Tango_Accordion=23]="Tango_Accordion",B[B.Acoustic_Guitar_nylon=24]="Acoustic_Guitar_nylon",B[B.Acoustic_Guitar_steel=25]="Acoustic_Guitar_steel",B[B.Electric_Guitar_jazz=26]="Electric_Guitar_jazz",B[B.Electric_Guitar_clean=27]="Electric_Guitar_clean",B[B.Electric_Guitar_muted=28]="Electric_Guitar_muted",B[B.Overdriven_Guitar=29]="Overdriven_Guitar",B[B.Distortion_Guitar=30]="Distortion_Guitar",B[B.Guitar_harmonics=31]="Guitar_harmonics",B[B.Acoustic_Bass=32]="Acoustic_Bass",B[B.Electric_Bass_finger=33]="Electric_Bass_finger",B[B.Electric_Bass_pick=34]="Electric_Bass_pick",B[B.Fretless_Bass=35]="Fretless_Bass",B[B.Slap_Bass_1=36]="Slap_Bass_1",B[B.Slap_Bass_2=37]="Slap_Bass_2",B[B.Synth_Bass_1=38]="Synth_Bass_1",B[B.Synth_Bass_2=39]="Synth_Bass_2",B[B.Violin=40]="Violin",B[B.Viola=41]="Viola",B[B.Cello=42]="Cello",B[B.Contrabass=43]="Contrabass",B[B.Tremolo_Strings=44]="Tremolo_Strings",B[B.Pizzicato_Strings=45]="Pizzicato_Strings",B[B.Orchestral_Harp=46]="Orchestral_Harp",B[B.Timpani=47]="Timpani",B[B.String_Ensemble_1=48]="String_Ensemble_1",B[B.String_Ensemble_2=49]="String_Ensemble_2",B[B.Synth_Strings_1=50]="Synth_Strings_1",B[B.Synth_Strings_2=51]="Synth_Strings_2",B[B.Choir_Aahs=52]="Choir_Aahs",B[B.Voice_Oohs=53]="Voice_Oohs",B[B.Synth_Voice=54]="Synth_Voice",B[B.Orchestra_Hit=55]="Orchestra_Hit",B[B.Trumpet=56]="Trumpet",B[B.Trombone=57]="Trombone",B[B.Tuba=58]="Tuba",B[B.Muted_Trumpet=59]="Muted_Trumpet",B[B.French_Horn=60]="French_Horn",B[B.Brass_Section=61]="Brass_Section",B[B.Synth_Brass_1=62]="Synth_Brass_1",B[B.Synth_Brass_2=63]="Synth_Brass_2",B[B.Soprano_Sax=64]="Soprano_Sax",B[B.Alto_Sax=65]="Alto_Sax",B[B.Tenor_Sax=66]="Tenor_Sax",B[B.Baritone_Sax=67]="Baritone_Sax",B[B.Oboe=68]="Oboe",B[B.English_Horn=69]="English_Horn",B[B.Bassoon=70]="Bassoon",B[B.Clarinet=71]="Clarinet",B[B.Piccolo=72]="Piccolo",B[B.Flute=73]="Flute",B[B.Recorder=74]="Recorder",B[B.Pan_Flute=75]="Pan_Flute",B[B.Blown_Bottle=76]="Blown_Bottle",B[B.Shakuhachi=77]="Shakuhachi",B[B.Whistle=78]="Whistle",B[B.Ocarina=79]="Ocarina",B[B.Lead_1_square=80]="Lead_1_square",B[B.Lead_2_sawtooth=81]="Lead_2_sawtooth",B[B.Lead_3_calliope=82]="Lead_3_calliope",B[B.Lead_4_chiff=83]="Lead_4_chiff",B[B.Lead_5_charang=84]="Lead_5_charang",B[B.Lead_6_voice=85]="Lead_6_voice",B[B.Lead_7_fifths=86]="Lead_7_fifths",B[B.Lead_8_bass_lead=87]="Lead_8_bass_lead",B[B.Pad_1_new_age=88]="Pad_1_new_age",B[B.Pad_2_warm=89]="Pad_2_warm",B[B.Pad_3_polysynth=90]="Pad_3_polysynth",B[B.Pad_4_choir=91]="Pad_4_choir",B[B.Pad_5_bowed=92]="Pad_5_bowed",B[B.Pad_6_metallic=93]="Pad_6_metallic",B[B.Pad_7_halo=94]="Pad_7_halo",B[B.Pad_8_sweep=95]="Pad_8_sweep",B[B.FX_1_rain=96]="FX_1_rain",B[B.FX_2_soundtrack=97]="FX_2_soundtrack",B[B.FX_3_crystal=98]="FX_3_crystal",B[B.FX_4_atmosphere=99]="FX_4_atmosphere",B[B.FX_5_brightness=100]="FX_5_brightness",B[B.FX_6_goblins=101]="FX_6_goblins",B[B.FX_7_echoes=102]="FX_7_echoes",B[B.FX_8_scifi=103]="FX_8_scifi",B[B.Sitar=104]="Sitar",B[B.Banjo=105]="Banjo",B[B.Shamisen=106]="Shamisen",B[B.Koto=107]="Koto",B[B.Kalimba=108]="Kalimba",B[B.Bag_pipe=109]="Bag_pipe",B[B.Fiddle=110]="Fiddle",B[B.Shanai=111]="Shanai",B[B.Tinkle_Bell=112]="Tinkle_Bell",B[B.Agogo=113]="Agogo",B[B.Steel_Drums=114]="Steel_Drums",B[B.Woodblock=115]="Woodblock",B[B.Taiko_Drum=116]="Taiko_Drum",B[B.Melodic_Tom=117]="Melodic_Tom",B[B.Synth_Drum=118]="Synth_Drum",B[B.Reverse_Cymbal=119]="Reverse_Cymbal",B[B.Guitar_Fret_Noise=120]="Guitar_Fret_Noise",B[B.Breath_Noise=121]="Breath_Noise",B[B.Seashore=122]="Seashore",B[B.Bird_Tweet=123]="Bird_Tweet",B[B.Telephone_Ring=124]="Telephone_Ring",B[B.Helicopter=125]="Helicopter",B[B.Applause=126]="Applause",B[B.Gunshot=127]="Gunshot",B[B.euphonium=128]="euphonium",B[B.AltoClarinetInEb=200]="AltoClarinetInEb",B[B.TrumpetInBb=201]="TrumpetInBb",B[B.BaritoneSaxophone=202]="BaritoneSaxophone",B[B.TenorSaxophone=203]="TenorSaxophone",B[B.ClarinetInEb=204]="ClarinetInEb",B[B.Euphonium=205]="Euphonium",B[B.Alto_Clarinet=206]="Alto_Clarinet",B[B.Bass_Clarinet=207]="Bass_Clarinet",B[B.Bass_Trombone=208]="Bass_Trombone",B[B.clarinet_in_bb=209]="clarinet_in_bb",B[B.clarinet_in_eb=210]="clarinet_in_eb",B[B.Percussion=135]="Percussion",B))(MidiInstrument||{});const _KeyInstruction=class extends AbstractNotationInstruction{constructor(B=void 0,R=0,F=KeyEnum.major){super(B),this.isTransposedBy=0,this.Key=R,this.keyTypeOriginal=R,this.mode=F,this.alteratedNotes=this.calcAlteratedNotes()}static copy(B){const R=new _KeyInstruction(B.parent,B.Key,B.Mode);return R.keyTypeOriginal=B.keyTypeOriginal,R}static getAllPossibleMajorKeyInstructions(){const B=[];for(let R=-7;R<7;R++){const F=new _KeyInstruction(void 0,R,KeyEnum.major);B.push(F)}return B}get Key(){return this.keyType}set Key(B){this.keyType=B,this.alteratedNotes=this.calcAlteratedNotes()}get Mode(){return this.mode}set Mode(B){this.mode=B}get AlteratedNotes(){return this.alteratedNotes}calcAlteratedNotes(){const B=[];if(this.keyType>0)for(let R=0;R=0}getAlterationForPitch(B){return this.keyType>0&&this.alteratedNotes.indexOf(B.FundamentalNote)<=this.keyType?AccidentalEnum.SHARP:this.keyType<0&&this.alteratedNotes.indexOf(B.FundamentalNote)<=Math.abs(this.keyType)?AccidentalEnum.FLAT:AccidentalEnum.NONE}ToString(){return"Key: "+this.keyType+this.mode}OperatorEquals(B){const R=this;return R===B?!0:!R||!B?!1:R.Key===B.Key&&R.Mode===B.Mode}OperatorNotEqual(B){return!this.OperatorEquals(B)}};let KeyInstruction=_KeyInstruction;KeyInstruction.sharpPositionList=[NoteEnum.F,NoteEnum.C,NoteEnum.G,NoteEnum.D,NoteEnum.A,NoteEnum.E,NoteEnum.B];KeyInstruction.flatPositionList=[NoteEnum.B,NoteEnum.E,NoteEnum.A,NoteEnum.D,NoteEnum.G,NoteEnum.C,NoteEnum.F];var KeyEnum=(B=>(B[B.major=0]="major",B[B.minor=1]="minor",B[B.none=2]="none",B[B.dorian=3]="dorian",B[B.phrygian=4]="phrygian",B[B.lydian=5]="lydian",B[B.mixolydian=6]="mixolydian",B[B.aeolian=7]="aeolian",B[B.ionian=8]="ionian",B[B.locrian=9]="locrian",B))(KeyEnum||{});Array.prototype.last||Object.defineProperty(Array.prototype,"last",{enumerable:!1,value:function(){return this[this.length-1]}});Array.prototype.clear||Object.defineProperty(Array.prototype,"clear",{enumerable:!1,value:function(){this.length=0}});Array.prototype.contains||Object.defineProperty(Array.prototype,"contains",{enumerable:!1,value:function(B){return this.indexOf(B)!==-1}});class CollectionUtil{static contains2(R,F){for(let D=0;D{var D,G,U,W;return((G=(D=F.sourceNote.Pitch)==null?void 0:D.getHalfTone())!=null?G:0)-((W=(U=R.sourceNote.Pitch)==null?void 0:U.getHalfTone())!=null?W:0)}),this.notes}sortForVexflow(){return this.notes.sort((R,F)=>{var D,G,U;return((G=(D=R.sourceNote.Pitch)==null?void 0:D.getHalfTone())!=null?G:0)-((U=F.sourceNote.Pitch.getHalfTone())!=null?U:0)}),this.notes}color(){}}class GraphicalMusicSheet{constructor(R,F){this.musicPages=[],this.measureList=[],this.verticalGraphicalStaffEntryContainers=[],this.cursors=[],this.leadSheet=!1,this.musicSheet=R,this.numberOfStaves=this.musicSheet.Staves.length,this.calculator=F,this.calculator.initialize(this)}get ParentMusicSheet(){return this.musicSheet}get GetCalculator(){return this.calculator}get JianpuKeySignature(){return this.jianpuKeySignature}set JianpuKeySignature(R){this.jianpuKeySignature=R}get MusicPages(){return this.musicPages}set MusicPages(R){this.musicPages=R}get MeasureList(){return this.measureList}set MeasureList(R){this.measureList=R}get VerticalGraphicalStaffEntryContainers(){return this.verticalGraphicalStaffEntryContainers}set VerticalGraphicalStaffEntryContainers(R){this.verticalGraphicalStaffEntryContainers=R}get Title(){return this.title}set Title(R){this.title=R}get Subtitle(){return this.subtitle}set Subtitle(R){this.subtitle=R}get Composer(){return this.composer}set Composer(R){this.composer=R}get Lyricist(){return this.lyricist}set Lyricist(R){this.lyricist=R}get Cursors(){return this.cursors}get SelectionStartSymbol(){return this.selectionStartSymbol}get SelectionEndSymbol(){return this.selectionEndSymbol}get MinAllowedSystemWidth(){return this.minAllowedSystemWidth}set MinAllowedSystemWidth(R){this.minAllowedSystemWidth=R}get NumberOfStaves(){return this.numberOfStaves}get LeadSheet(){return this.leadSheet}set LeadSheet(R){this.leadSheet=R}static transformRelativeToAbsolutePosition(R){for(let F=0;F=0;D--){const G=this.measureList[D][F];if(G)return G}}findGraphicalStaffEntryFromMeasureList(R,F,D){for(let G=F;G0)return W.staffEntries[0]}}getFirstVisibleMeasuresListFromIndices(R,F){const D=[],G=this.measureList[0].length;for(let U=R;U<=F;U++)for(let W=0;W=0;F--){if(this.verticalGraphicalStaffEntryContainers[F].AbsoluteTimestamp.lt(R)){const D=new VerticalGraphicalStaffEntryContainer(this.numberOfStaves,R);return this.verticalGraphicalStaffEntryContainers.splice(F+1,0,D),D}if(this.verticalGraphicalStaffEntryContainers[F].AbsoluteTimestamp.Equals(R))return this.verticalGraphicalStaffEntryContainers[F]}}GetVerticalContainerFromTimestamp(R,F=0){const D=CollectionUtil.binarySearch(this.verticalGraphicalStaffEntryContainers,new VerticalGraphicalStaffEntryContainer(0,R),VerticalGraphicalStaffEntryContainer.compareByTimestamp,F);if(D>=0)return this.verticalGraphicalStaffEntryContainers[D]}GetInterpolatedIndexInVerticalContainers(R){const F=this.verticalGraphicalStaffEntryContainers;let D=0,G=F.length-1,U,W;if(R.lte(F[F.length-1].AbsoluteTimestamp)){for(;G-D>1;){const Z=Math.floor((G+D)/2);if(F[D].AbsoluteTimestamp.Equals(R)){G=D;break}else if(F[G].AbsoluteTimestamp.Equals(R)){D=G;break}else{if(F[Z].AbsoluteTimestamp.Equals(R))return this.verticalGraphicalStaffEntryContainers.indexOf(F[Z]);R.lt(F[Z].AbsoluteTimestamp)?G=Z:D=Z}}if(D===G)return this.verticalGraphicalStaffEntryContainers.indexOf(F[D]);U=F[D].AbsoluteTimestamp,W=F[G].AbsoluteTimestamp}else U=F[F.length-1].AbsoluteTimestamp,W=Fraction$1.plus(this.getLongestStaffEntryDuration(F.length-1),U),G=F.length;const q=W.RealValue-U.RealValue,Y=W.RealValue-R.RealValue,J=G-Y/q;return Math.min(J,this.verticalGraphicalStaffEntryContainers.length)}getVisibleStavesIndicesFromSourceMeasure(R){const F=[],D=[];for(let G=0,U=R.length;G{var D;return((D=F.parentStaffEntry)==null?void 0:D.relInMeasureTimestamp)!==void 0})}GetNearestNote(R,F){const D=this.GetNearestVoiceEntry(R);if(!D)return;let G,U=Number.MAX_SAFE_INTEGER;for(const W of D.notes){const q=W.PositionAndShape.AbsolutePosition.y,Y=Math.abs(W.PositionAndShape.AbsolutePosition.x-R.x),J=Math.abs(q-R.y);Y+JW.PositionAndShape.RelativePosition.x&&(D=W):D=W)}}catch(G){log$2.info("GraphicalMusicSheet.getStaffEntry",G)}return D}GetPreviousVisibleContainerIndex(R){for(let F=R-1;F>=0;F--){const D=this.verticalGraphicalStaffEntryContainers[F].StaffEntries;for(let G=0,U=D.length;G=0;U--)if(D=this.getStaffEntry(U),D)if(F){if(D.sourceStaffEntry.ParentStaff.ParentInstrument.Visible)return D}else return D}findClosestRightStaffEntry(R,F){let D;const G=Math.max(0,Math.ceil(R));for(let U=G;U{};Vex.L=(B,R)=>{if(!R)return;const F=Array.prototype.slice.call(R).join(" ");window.console.log(B+": "+F)};Vex.MakeException=B=>class extends Error{constructor(F,D){super(F),this.name=B,this.message=F,this.data=D}};class RuntimeError{constructor(R,F){this.code=R,this.message=F}toString(){return"[RuntimeError] "+this.code+":"+this.message}}Vex.RuntimeError=RuntimeError;Vex.RERR=Vex.RuntimeError;Vex.Merge=(B,R)=>{for(const F in R)B[F]=R[F];return B};Vex.Min=Math.min;Vex.Max=Math.max;Vex.forEach=(B,R)=>{for(let F=0;FB%R>=R/2?parseInt(B/R,10)*R+R:parseInt(B/R,10)*R;Vex.MidLine=(B,R)=>{let F=R+(B-R)/2;return F%2>0&&(F=Vex.RoundN(F*10,5)/10),F};Vex.SortAndUnique=(B,R,F)=>{if(B.length>1){const D=[];let G;B.sort(R);for(let U=0;U{let F=B.length;for(;F--;)if(B[F]===R)return!0;return!1};Vex.getCanvasContext=B=>{if(!B)throw new Vex.RERR("BadArgument","Invalid canvas selector: "+B);const R=document.getElementById(B);if(!(R&&R.getContext))throw new Vex.RERR("UnsupportedBrowserError","This browser does not support HTML5 Canvas");return R.getContext("2d")};Vex.drawDot=(B,R,F,D="#55")=>{B.save(),B.setFillStyle(D),B.beginPath(),B.arc(R,F,3,0,Math.PI*2,!0),B.closePath(),B.fill(),B.restore()};Vex.BM=(B,R)=>{const F=new Date().getTime();R();const D=new Date().getTime()-F;Vex.L(B+D+"ms")};Vex.StackTrace=()=>new Error().stack;Vex.W=(...B)=>{const R=B.join(" ");window.console.log("Warning: ",R,Vex.StackTrace())};Vex.Prefix=B=>Vex.Prefix.prefix+B;Vex.Prefix.prefix="vf-";class Fraction{static GCD(R,F){if(typeof R!="number"||typeof F!="number")throw new Vex.RERR("BadArgument",`Invalid numbers: ${R}, ${F}`);let D;for(;F!==0;)D=F,F=R%F,R=D;return R}static LCM(R,F){return R*F/Fraction.GCD(R,F)}static LCMM(R){if(R.length===0)return 0;if(R.length===1)return R[0];if(R.length===2)return Fraction.LCM(R[0],R[1]);{const F=R[0];return R.shift(),Fraction.LCM(F,Fraction.LCMM(R))}}constructor(R,F){this.set(R,F)}set(R,F){return this.numerator=R===void 0?1:R,this.denominator=F===void 0?1:F,this}value(){return this.numerator/this.denominator}simplify(){let R=this.numerator,F=this.denominator;const D=Fraction.GCD(R,F);return R/=D,F/=D,F<0&&(F=-F,R=-R),this.set(R,F)}add(R,F){let D,G;R instanceof Fraction?(D=R.numerator,G=R.denominator):(R!==void 0?D=R:D=0,F!==void 0?G=F:G=1);const U=Fraction.LCM(this.denominator,G),W=U/this.denominator,q=U/G,Y=this.numerator*W+D*q;return this.set(Y,U)}subtract(R,F){let D,G;R instanceof Fraction?(D=R.numerator,G=R.denominator):(R!==void 0?D=R:D=0,F!==void 0?G=F:G=1);const U=Fraction.LCM(this.denominator,G),W=U/this.denominator,q=U/G,Y=this.numerator*W-D*q;return this.set(Y,U)}multiply(R,F){let D,G;return R instanceof Fraction?(D=R.numerator,G=R.denominator):(R!==void 0?D=R:D=1,F!==void 0?G=F:G=1),this.set(this.numerator*D,this.denominator*G)}divide(R,F){let D,G;return R instanceof Fraction?(D=R.numerator,G=R.denominator):(R!==void 0?D=R:D=1,F!==void 0?G=F:G=1),this.set(this.numerator*G,this.denominator*D)}equals(R){const F=Fraction.__compareA.copy(R).simplify(),D=Fraction.__compareB.copy(this).simplify();return F.numerator===D.numerator&&F.denominator===D.denominator}greaterThan(R){const F=Fraction.__compareB.copy(this);return F.subtract(R),F.numerator>0}greaterThanEquals(R){const F=Fraction.__compareB.copy(this);return F.subtract(R),F.numerator>=0}lessThan(R){return!this.greaterThanEquals(R)}lessThanEquals(R){return!this.greaterThan(R)}clone(){return new Fraction(this.numerator,this.denominator)}copy(R){return typeof R=="number"?this.set(R||0,1):this.set(R.numerator,R.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 Fraction.__tmp.copy(this).simplify().toString()}toMixedString(){let R="";const F=this.quotient(),D=Fraction.__tmp.copy(this);return F<0?D.abs().fraction():D.fraction(),F!==0?(R+=F,D.numerator!==0&&(R+=" "+D.toSimplifiedString())):D.numerator===0?R="0":R=D.toSimplifiedString(),R}parse(R){const F=R.split("/"),D=parseInt(F[0],10),G=F[1]?parseInt(F[1],10):1;return this.set(D,G)}}Fraction.__compareA=new Fraction;Fraction.__compareB=new Fraction;Fraction.__tmp=new Fraction;const X$3=Vex.MakeException("RegistryError");function setIndexValue(B,R,F,D,G){B[R][F]||(B[R][F]={}),B[R][F][D]=G}class Registry{static get INDEXES(){return["type"]}constructor(){this.clear()}static enableDefaultRegistry(R){Registry.defaultRegistry=R}static getDefaultRegistry(){return Registry.defaultRegistry}static disableDefaultRegistry(){Registry.defaultRegistry=null}clear(){return this.index={id:{},type:{},class:{}},this}updateIndex({id:R,name:F,value:D,oldValue:G}){const U=this.getElementById(R);G!==null&&this.index[F][G]&&delete this.index[F][G][R],D!==null&&setIndexValue(this.index,F,D,U.getAttribute("id"),U)}register(R,F){if(F=F||R.getAttribute("id"),!F)throw new X$3("Can't add element without `id` attribute to registry",R);return R.setAttribute("id",F),setIndexValue(this.index,"id",F,F,R),Registry.INDEXES.forEach(D=>{this.updateIndex({id:F,name:D,value:R.getAttribute(D),oldValue:null})}),R.onRegister(this),this}getElementById(R){return this.index.id[R]?this.index.id[R][R]:null}getElementsByAttribute(R,F){const D=this.index[R];return D&&D[F]?Object.keys(D[F]).map(G=>D[F][G]):[]}getElementsByType(R){return this.getElementsByAttribute("type",R)}getElementsByClass(R){return this.getElementsByAttribute("class",R)}onUpdate({id:R,name:F,value:D,oldValue:G}){function U(W,q){return W.filter(Y=>Y===q).length>0}return U(Registry.INDEXES.concat(["id","class"]),F)?(this.updateIndex({id:R,name:F,value:D,oldValue:G}),this):this}}Registry.defaultRegistry=null;class Element$1{static newID(){return"auto"+Element$1.ID++}constructor({type:R}={}){this.attrs={id:Element$1.newID(),el:null,type:R||"Base",classes:{}},this.boundingBox=null,this.context=null,this.rendered=!1,Registry.getDefaultRegistry()&&Registry.getDefaultRegistry().register(this)}setStyle(R){return this.style=R,this}getStyle(){return this.style}applyStyle(R=this.context,F=this.getStyle()){return F?(R.save(),F.shadowColor&&R.setShadowColor(F.shadowColor),F.shadowBlur&&R.setShadowBlur(F.shadowBlur),F.fillStyle&&R.setFillStyle(F.fillStyle),F.strokeStyle&&R.setStrokeStyle(F.strokeStyle),F.lineWidth&&R.setLineWidth(F.lineWidth),this):this}restoreStyle(R=this.context,F=this.getStyle()){return F?(R.restore(),this):this}drawWithStyle(){this.checkContext(),this.applyStyle(),this.draw(),this.restoreStyle()}hasClass(R){return this.attrs.classes[R]===!0}addClass(R){return this.attrs.classes[R]=!0,this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:R,oldValue:null}),this}removeClass(R){return delete this.attrs.classes[R],this.registry&&this.registry.onUpdate({id:this.getAttribute("id"),name:"class",value:null,oldValue:R}),this}onRegister(R){return this.registry=R,this}isRendered(){return this.rendered}setRendered(R=!0){return this.rendered=R,this}getAttributes(){return this.attrs}getAttribute(R){return this.attrs[R]}setAttribute(R,F){const D=this.attrs.id,G=this.attrs[R];return this.attrs[R]=F,this.registry&&this.registry.onUpdate({id:D,name:R,value:F,oldValue:G}),this}getContext(){return this.context}setContext(R){return this.context=R,this}getBoundingBox(){return this.boundingBox}checkContext(){if(!this.context)throw new Vex.RERR("NoContext","No rendering context attached to instance");return this.context}}Element$1.ID=1e3;class BoundingBoxComputation{constructor(R,F,D,G){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN,this.addPoint(R,F),this.addPoint(D,G)}width(){return this.x2-this.x1}height(){return this.y2-this.y1}addPoint(R,F){R!=null&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=R,this.x2=R),Rthis.x2&&(this.x2=R)),F!=null&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=F,this.y2=F),Fthis.y2&&(this.y2=F))}addX(R){this.addPoint(R,null)}addY(R){this.addPoint(null,R)}addQuadraticCurve(R,F,D,G,U,W){const q=R+.6666666666666666*(D-R),Y=F+2/3*(G-F),J=q+1/3*(U-R),Z=Y+1/3*(W-F);this.addBezierCurve(R,F,q,Y,J,Z,U,W)}addBezierCurve(R,F,D,G,U,W,q,Y){const J=[R,F],Z=[D,G],K=[U,W],te=[q,Y];let Q;this.addPoint(J[0],J[1]),this.addPoint(te[0],te[1]);const ie=(se,ne)=>Math.pow(1-se,3)*J[ne]+3*Math.pow(1-se,2)*se*Z[ne]+3*(1-se)*Math.pow(se,2)*K[ne]+Math.pow(se,3)*te[ne];for(Q=0;Q<=1;Q++){const se=6*J[Q]-12*Z[Q]+6*K[Q],ne=-3*J[Q]+9*Z[Q]-9*K[Q]+3*te[Q],re=3*Z[Q]-3*J[Q];if(ne===0){if(se===0)continue;const fe=-re/se;0{if(!B)throw new Vex.RERR("BadArgument","Invalid clef: "+B);const R=Flow.clefProperties.values[B];if(!R)throw new Vex.RERR("BadArgument","Invalid clef: "+B);return R};Flow.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}};Flow.keyProperties=(B,R,F)=>{R===void 0&&(R="treble");const D={octave_shift:0};typeof F=="object"&&Vex.Merge(D,F);const G=B.split("/");if(G.length<2)throw new Vex.RERR("BadArguments",`Key must have note + octave and an optional glyph: ${B}`);const U=G[0].toUpperCase(),W=Flow.keyProperties.note_values[U];if(!W)throw new Vex.RERR("BadArguments","Invalid key name: "+U);W.octave&&(G[1]=W.octave);let q=parseInt(G[1],10);q+=-1*D.octave_shift;let J=(q*7-4*7+W.index)/2;J+=Flow.clefProperties(R).line_shift;let Z=0;J<=0&&J*2%2===0&&(Z=1),J>=6&&J*2%2===0&&(Z=-1);const K=typeof W.int_val!="undefined"?q*12+W.int_val:null,te=W.code,Q=W.shift_right;let ie={};if(G.length>2&&G[2]){const se=G[2].toUpperCase();ie=Flow.keyProperties.customNoteHeads[se]||{}}return{key:U,octave:q,line:J,int_value:K,accidental:W.accidental,code:te,stroke:Z,shift_right:Q,displaced:!1,...ie}};Flow.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}};Flow.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}};Flow.integerToNote=B=>{if(typeof B=="undefined")throw new Vex.RERR("BadArguments","Undefined integer for integerToNote");if(B<-2)throw new Vex.RERR("BadArguments",`integerToNote requires integer > -2: ${B}`);const R=Flow.integerToNote.table[B];if(!R)throw new Vex.RERR("BadArguments",`Unknown note value for integer: ${B}`);return R};Flow.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"};Flow.tabToGlyph=(B,R=1)=>{let F=null,D=0,G=0;if(B.toString().toUpperCase()==="X"){const U=new Glyph("v7f",Flow.DEFAULT_TABLATURE_FONT_SCALE).getMetrics();F="v7f",D=U.width,G=-U.height/2}else D=Flow.textWidth(B.toString());return{text:B,code:F,getWidth:()=>D*R,shift_y:G}};Flow.textWidth=B=>7*B.toString().length;Flow.articulationCodes=B=>Flow.articulationCodes.articulations[B];Flow.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}};Flow.accidentalCodes=B=>Flow.accidentalCodes.accidentals[B];Flow.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}};Flow.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]}};Flow.ornamentCodes=B=>Flow.ornamentCodes.ornaments[B];Flow.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"}};Flow.keySignature=B=>{const R=Flow.keySignature.keySpecs[B];if(!R)throw new Vex.RERR("BadKeySignature",`Bad key signature spec: '${B}'`);if(!R.acc)return[];const F=Flow.keySignature.accidentalList(R.acc),D=[];for(let G=0;G({b:[2,.5,2.5,1,3,1.5,3.5],"#":[0,1.5,-.5,1,2.5,.5,2]})[B];Flow.parseNoteDurationString=B=>{if(typeof B!="string")return null;const F=/(\d*\/?\d+|[a-z])(d*)([nrhms]|$)/.exec(B);if(!F)return null;const D=F[1],G=F[2].length;let U=F[3];return U.length===0&&(U="n"),{duration:D,dots:G,type:U}};Flow.parseNoteStruct=B=>{const R=B.duration,F=Flow.parseNoteDurationString(R);if(!F)return null;let D=Flow.durationToTicks(F.duration);if(D==null)return null;let G=B.type;const U=[];if(G){if(!Flow.getGlyphProps.validTypes[G])return null}else G=F.type||"n",B.keys!==void 0&&B.keys.forEach((Y,J)=>{const Z=Y.split("/");Z&&Z.length===3&&(U[J]=Z[2])});const W=B.dots?B.dots:F.dots;if(typeof W!="number")return null;let q=D;for(let Y=0;Y{const R=Flow.durationAliases[B];if(R!==void 0&&(B=R),Flow.durationToTicks.durations[B]===void 0)throw new Vex.RERR("BadArguments",`The provided duration is not valid: ${B}`);return B};Flow.durationToFraction=B=>new Fraction().parse(Flow.sanitizeDuration(B));Flow.durationToNumber=B=>Flow.durationToFraction(B).value();Flow.durationToTicks=B=>{B=Flow.sanitizeDuration(B);const R=Flow.durationToTicks.durations[B];return R===void 0?null:R};Flow.durationToTicks.durations={"1/2":Flow.RESOLUTION*2,1:Flow.RESOLUTION/1,2:Flow.RESOLUTION/2,4:Flow.RESOLUTION/4,8:Flow.RESOLUTION/8,16:Flow.RESOLUTION/16,32:Flow.RESOLUTION/32,64:Flow.RESOLUTION/64,128:Flow.RESOLUTION/128,256:Flow.RESOLUTION/256};Flow.durationAliases={w:"1",h:"2",q:"4",b:"256"};Flow.getGlyphProps=(B,R)=>{B=Flow.sanitizeDuration(B);const F=Flow.getGlyphProps.duration_codes[B];if(F===void 0)return null;R||(R="n");let D=F.type[R];if(D===void 0){const G=Flow.keyProperties.customNoteHeads[R.toUpperCase()];if(G===void 0)return null;D={code_head:G.code,...G}}return{...F.common,...D}};Flow.getGlyphProps.validTypes={n:{name:"note"},r:{name:"rest"},h:{name:"harmonic"},m:{name:"muted"},s:{name:"slash"}};Flow.getGlyphProps.duration_codes={"1/2":{common:{getWidth(B=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"v53",B).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-Flow.STEM_HEIGHT,stem_down_extension:-Flow.STEM_HEIGHT,tabnote_stem_up_extension:-Flow.STEM_HEIGHT,tabnote_stem_down_extension:-Flow.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:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},1:{common:{getWidth(B=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"v1d",B).getMetrics().width},stem:!1,stem_offset:0,flag:!1,stem_up_extension:-Flow.STEM_HEIGHT,stem_down_extension:-Flow.STEM_HEIGHT,tabnote_stem_up_extension:-Flow.STEM_HEIGHT,tabnote_stem_down_extension:-Flow.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:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},2:{common:{getWidth(B=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"v81",B).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:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},4:{common:{getWidth(B=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"vb",B).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:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},8:{common:{getWidth(B=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"vb",B).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:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},16:{common:{beam_count:2,getWidth(B=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"vb",B).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:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},32:{common:{beam_count:3,getWidth(B=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"vb",B).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:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},64:{common:{beam_count:4,getWidth(B=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"vb",B).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:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}},128:{common:{beam_count:5,getWidth(B=Flow.DEFAULT_NOTATION_FONT_SCALE){return new Glyph(this.code_head||"vb",B).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:()=>Flow.SLASH_NOTEHEAD_WIDTH,position:"B/4"}}}};Flow.smufl={};Flow.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"};Flow.TIME4_4={num_beats:4,beat_value:4,resolution:Flow.RESOLUTION};class CanvasContext{static get WIDTH(){return 600}static get HEIGHT(){return 400}static get CANVAS_BROWSER_SIZE_LIMIT(){return 32767}static SanitizeCanvasDims(R,F){return Math.max(R,F)>this.CANVAS_BROWSER_SIZE_LIMIT&&(Vex.W("Canvas dimensions exceed browser limit. Cropping to "+this.CANVAS_BROWSER_SIZE_LIMIT),R>this.CANVAS_BROWSER_SIZE_LIMIT&&(R=this.CANVAS_BROWSER_SIZE_LIMIT),F>this.CANVAS_BROWSER_SIZE_LIMIT&&(F=this.CANVAS_BROWSER_SIZE_LIMIT)),[R,F]}constructor(R){this.vexFlowCanvasContext=R,R.canvas?this.canvas=R.canvas:this.canvas={width:CanvasContext.WIDTH,height:CanvasContext.HEIGHT}}clear(){this.vexFlowCanvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}openGroup(){}closeGroup(){}add(){}setFont(R,F,D){return this.vexFlowCanvasContext.font=(D||"")+" "+F+"pt "+R,this}setRawFont(R){return this.vexFlowCanvasContext.font=R,this}setFillStyle(R){return this.vexFlowCanvasContext.fillStyle=R,this}setBackgroundFillStyle(R){return this.background_fillStyle=R,this}setStrokeStyle(R){return this.vexFlowCanvasContext.strokeStyle=R,this}setShadowColor(R){return this.vexFlowCanvasContext.shadowColor=R,this}setShadowBlur(R){return this.vexFlowCanvasContext.shadowBlur=R,this}setLineWidth(R){return this.vexFlowCanvasContext.lineWidth=R,this}setLineCap(R){return this.vexFlowCanvasContext.lineCap=R,this}setLineDash(R){return this.vexFlowCanvasContext.lineDash=R,this}scale(R,F){return this.vexFlowCanvasContext.scale(parseFloat(R),parseFloat(F))}resize(R,F){return[R,F]=this.SanitizeCanvasDims(parseInt(R,10),parseInt(F,10)),this.vexFlowCanvasContext.resize(R,F)}rect(R,F,D,G){return this.vexFlowCanvasContext.rect(R,F,D,G)}fillRect(R,F,D,G){return this.vexFlowCanvasContext.fillRect(R,F,D,G)}clearRect(R,F,D,G){return this.vexFlowCanvasContext.clearRect(R,F,D,G)}beginPath(){return this.vexFlowCanvasContext.beginPath()}moveTo(R,F){return this.vexFlowCanvasContext.moveTo(R,F)}lineTo(R,F){return this.vexFlowCanvasContext.lineTo(R,F)}bezierCurveTo(R,F,D,G,U,W){return this.vexFlowCanvasContext.bezierCurveTo(R,F,D,G,U,W)}quadraticCurveTo(R,F,D,G){return this.vexFlowCanvasContext.quadraticCurveTo(R,F,D,G)}arc(R,F,D,G,U,W){return this.vexFlowCanvasContext.arc(R,F,D,G,U,W)}glow(){return this.vexFlowCanvasContext.glow()}fill(){return this.vexFlowCanvasContext.fill()}stroke(){return this.vexFlowCanvasContext.stroke()}closePath(){return this.vexFlowCanvasContext.closePath()}measureText(R){return this.vexFlowCanvasContext.measureText(R)}fillText(R,F,D){return this.vexFlowCanvasContext.fillText(R,F,D)}save(){return this.vexFlowCanvasContext.save()}restore(){return this.vexFlowCanvasContext.restore()}}class RaphaelContext{constructor(R){this.element=R,this.paper=Raphael(R),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(R,F,D){return this.state.font_family=R,this.state.font_size=F,this.state.font_weight=D,this.attributes.font=(this.state.font_weight||"")+" "+this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this}setRawFont(R){return this.attributes.font=R,this}setFillStyle(R){return this.attributes.fill=R,this}setBackgroundFillStyle(R){return this.background_attributes.fill=R,this.background_attributes.stroke=R,this}setStrokeStyle(R){return this.attributes.stroke=R,this}setShadowColor(R){return this.shadow_attributes.color=R,this}setShadowBlur(R){return this.shadow_attributes.width=R,this}setLineWidth(R){this.attributes["stroke-width"]=R,this.lineWidth=R}setLineDash(){return this}setLineCap(){return this}scale(R,F){return this.state.scale={x:R,y:F},this.attributes.transform="S"+R+","+F+",0,0",this.attributes.scale=R+","+F+",0,0",this.attributes.font=this.state.font_size*this.state.scale.x+"pt "+this.state.font_family,this.background_attributes.transform="S"+R+","+F+",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(R,F){return this.element.style.width=R,this.paper.setSize(R,F),this}setViewBox(R){this.paper.canvas.setAttribute("viewBox",R)}rect(R,F,D,G){return G<0&&(F+=G,G=-G),this.paper.rect(R,F,D-.5,G-.5).attr(this.attributes).attr("fill","none").attr("stroke-width",this.lineWidth),this}fillRect(R,F,D,G){return G<0&&(F+=G,G=-G),this.paper.rect(R,F,D-.5,G-.5).attr(this.attributes),this}clearRect(R,F,D,G){return G<0&&(F+=G,G=-G),this.paper.rect(R,F,D-.5,G-.5).attr(this.background_attributes),this}beginPath(){return this.path="",this.pen.x=0,this.pen.y=0,this}moveTo(R,F){return this.path+="M"+R+","+F,this.pen.x=R,this.pen.y=F,this}lineTo(R,F){return this.path+="L"+R+","+F,this.pen.x=R,this.pen.y=F,this}bezierCurveTo(R,F,D,G,U,W){return this.path+="C"+R+","+F+","+D+","+G+","+U+","+W,this.pen.x=U,this.pen.y=W,this}quadraticCurveTo(R,F,D,G){return this.path+="Q"+R+","+F+","+D+","+G,this.pen.x=D,this.pen.y=G,this}arc(R,F,D,G,U,W){function q(J){for(;J<0;)J+=Math.PI*2;for(;J>Math.PI*2;)J-=Math.PI*2;return J}if(G=q(G),U=q(U),G>U){const J=G;G=U,U=J,W=!W}const Y=U-G;return Y>Math.PI?(this.arcHelper(R,F,D,G,G+Y/2,W),this.arcHelper(R,F,D,G+Y/2,U,W)):this.arcHelper(R,F,D,G,U,W),this}arcHelper(R,F,D,G,U,W){const q=R+D*Math.cos(G),Y=F+D*Math.sin(G),J=R+D*Math.cos(U),Z=F+D*Math.sin(U);let K=0,te=0;W?(te=1,U-GMath.PI&&(K=1),this.path+="M"+q+","+Y+",A"+D+","+D+",0,"+K+","+te+","+J+","+Z+"M"+this.pen.x+","+this.pen.y}glow(){const R=this.paper.set();if(this.shadow_attributes.width>0){const F=this.shadow_attributes,D=F.width/2;for(let G=1;G<=D;G++)R.push(this.paper.path(this.path).attr({stroke:F.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(F.width/D*G).toFixed(3),opacity:+((F.opacity||.3)/D).toFixed(3),transform:this.attributes.transform,scale:this.attributes.scale}))}return R}fill(){const R=this.paper.path(this.path).attr(this.attributes).attr("stroke-width",0);return this.glow(R),this}stroke(){const R=this.lineWidth*(this.state.scale.x+this.state.scale.y)/2,F=this.paper.path(this.path).attr(this.attributes).attr("fill","none").attr("stroke-width",R);return this.glow(F),this}closePath(){return this.path+="Z",this}measureText(R){const F=this.paper.text(0,0,R).attr(this.attributes).attr("fill","none").attr("stroke","none"),D=F.getBBox();return F.remove(),{width:D.width,height:D.height}}fillText(R,F,D){return this.paper.text(F+this.measureText(R).width/2,D-this.state.font_size/(2.25*this.state.scale.y),R).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 R=this.state_stack.pop();return this.state.font_family=R.state.font_family,this.attributes.font=R.attributes.font,this.attributes.fill=R.attributes.fill,this.attributes.stroke=R.attributes.stroke,this.attributes["stroke-width"]=R.attributes["stroke-width"],this.shadow_attributes.width=R.shadow_attributes.width,this.shadow_attributes.color=R.shadow_attributes.color,this}}const attrNamesToIgnoreMap={path:{x:!0,y:!0,width:!0,height:!0},rect:{},text:{width:!0,height:!0}};{const B={"font-family":!0,"font-weight":!0,"font-style":!0,"font-size":!0};Vex.Merge(attrNamesToIgnoreMap.rect,B),Vex.Merge(attrNamesToIgnoreMap.path,B)}class SVGContext{constructor(R){this.element=R,this.svgNS="http://www.w3.org/2000/svg";const F=this.create("svg");this.element.appendChild(F),this.svg=F,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(R){return document.createElementNS(this.svgNS,R)}openGroup(R,F,D){const G=this.create("g");return this.groups.push(G),this.parent.appendChild(G),this.parent=G,R&&G.setAttribute("class",Vex.Prefix(R)),F&&G.setAttribute("id",Vex.Prefix(F)),D&&D.pointerBBox&&G.setAttribute("pointer-events","bounding-box"),G}closeGroup(){this.groups.pop(),this.parent=this.groups[this.groups.length-1]}add(R){this.parent.appendChild(R)}iePolyfill(){typeof navigator!="undefined"&&(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(R,F,D){let G=!1,U=!1,W="normal";typeof D=="string"&&(D.indexOf("italic")!==-1&&(D=D.replace(/italic/g,""),U=!0),D.indexOf("bold")!==-1&&(D=D.replace(/bold/g,""),G=!0),D=D.replace(/ /g,"")),D=G?"bold":D,D=typeof D=="undefined"||D===""?"normal":D,W=U?"italic":W;const q={"font-family":R,"font-size":F+"pt","font-weight":D,"font-style":W};return this.fontSize=Number(F),Vex.Merge(this.attributes,q),Vex.Merge(this.state,q),this}setRawFont(R){R=R.trim();const F=R.split(" ");return this.attributes["font-family"]=F[1],this.state["font-family"]=F[1],this.attributes["font-size"]=F[0],this.state["font-size"]=F[0],this.fontSize=Number(F[0].match(/\d+/)),this}setFillStyle(R){return this.attributes.fill=R,this}setBackgroundFillStyle(R){return this.background_attributes.fill=R,this.background_attributes.stroke=R,this}setStrokeStyle(R){return this.attributes.stroke=R,this}setShadowColor(R){return this.shadow_attributes.color=R,this}setShadowBlur(R){return this.shadow_attributes.width=R,this}setLineWidth(R){this.attributes["stroke-width"]=R,this.lineWidth=R}setLineDash(R){if(Object.prototype.toString.call(R)==="[object Array]")return R=R.join(", "),this.attributes["stroke-dasharray"]=R,this;throw new Vex.RERR("ArgumentError","lineDash must be an array of integers.")}setLineCap(R){return this.attributes["stroke-linecap"]=R,this}resize(R,F){this.width=R,this.height=F,this.element.style.width=R;const D={width:R,height:F};return this.applyAttributes(this.svg,D),this.scale(this.state.scale.x,this.state.scale.y),this}scale(R,F){this.state.scale={x:R,y:F};const D=this.width/R,G=this.height/F;return this.setViewBox(0,0,D,G),this}setViewBox(...R){if(R.length===1){const[F]=R;this.svg.setAttribute("viewBox",F)}else{const[F,D,G,U]=R,W=F+" "+D+" "+G+" "+U;this.svg.setAttribute("viewBox",W)}}applyAttributes(R,F){const D=attrNamesToIgnoreMap[R.nodeName];return Object.keys(F).forEach(G=>{var U;D&&D[G]||!G||!F[G]||G==="d"&&((U=F[G])==null?void 0:U.indexOf("NaN"))>-1||R.setAttributeNS(null,G,F[G])}),R}clear(){for(;this.svg.lastChild;)this.svg.removeChild(this.svg.lastChild);this.scale(this.state.scale.x,this.state.scale.y)}rect(R,F,D,G,U){G<0&&(F+=G,G*=-1);const W=this.create("rect");return typeof U=="undefined"&&(U={fill:"none","stroke-width":this.lineWidth,stroke:"black"}),Vex.Merge(U,{x:R,y:F,width:D,height:G}),this.applyAttributes(W,U),this.add(W),this}fillRect(R,F,D,G){return G<0&&(F+=G,G*=-1),this.rect(R,F,D,G,this.attributes),this}clearRect(R,F,D,G){return this.rect(R,F,D,G,this.background_attributes),this}beginPath(){return this.path="",this.pen.x=NaN,this.pen.y=NaN,this}moveTo(R,F){return this.path+="M"+R+" "+F,this.pen.x=R,this.pen.y=F,this}lineTo(R,F){return this.path+="L"+R+" "+F,this.pen.x=R,this.pen.y=F,this}bezierCurveTo(R,F,D,G,U,W){return this.path+="C"+R+" "+F+","+D+" "+G+","+U+" "+W,this.pen.x=U,this.pen.y=W,this}quadraticCurveTo(R,F,D,G){return this.path+="Q"+R+" "+F+","+D+" "+G,this.pen.x=D,this.pen.y=G,this}arc(R,F,D,G,U,W){function q(J){for(;J<0;)J+=Math.PI*2;for(;J>Math.PI*2;)J-=Math.PI*2;return J}if(G=q(G),U=q(U),G>U){const J=G;G=U,U=J,W=!W}const Y=U-G;return Y>Math.PI?(this.arcHelper(R,F,D,G,G+Y/2,W),this.arcHelper(R,F,D,G+Y/2,U,W)):this.arcHelper(R,F,D,G,U,W),this}arcHelper(R,F,D,G,U,W){const q=R+D*Math.cos(G),Y=F+D*Math.sin(G),J=R+D*Math.cos(U),Z=F+D*Math.sin(U);let K=0,te=0;W?(te=1,U-GMath.PI&&(K=1),this.path+="M"+q+" "+Y+" A"+D+" "+D+" 0 "+K+" "+te+" "+J+" "+Z,!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 R=this.shadow_attributes,F=R.width/2;for(let D=1;D<=F;D++){const G={stroke:R.color,"stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(R.width*.4/F*D).toFixed(3),opacity:+((R.opacity||.3)/F).toFixed(3)},U=this.create("path");G.d=this.path,this.applyAttributes(U,G),this.add(U)}}return this}fill(R){this.glow();const F=this.create("path");let D=R;return typeof R=="undefined"?(R={},Vex.Merge(R,this.attributes),R.stroke="none",D=R):(D=R,Vex.Merge(D,this.attributes),R.class&&(D.class=R.class),R.id&&(D.id=R.id)),R.d=this.path,this.applyAttributes(F,R),this.add(F),this}stroke(R=void 0){this.glow();const F=this.create("path"),D={};return Vex.Merge(D,this.attributes),R&&Vex.Merge(D,R),D.fill="none",D["stroke-width"]=this.lineWidth,D.d=this.path,this.applyAttributes(F,D),this.add(F),this}measureText(R){const F=this.create("text");if(typeof F.getBBox!="function")return{x:0,y:0,width:0,height:0};F.textContent=R,this.applyAttributes(F,this.attributes),this.svg.appendChild(F);let D=F.getBBox();return this.ie&&R!==""&&this.attributes["font-style"]==="italic"&&(D=this.ieMeasureTextFix(D,R)),this.svg.removeChild(F),D}ieMeasureTextFix(R){const F=Number(this.fontSize),D=1.196,G=1.9598,U=D*F+G,W=R.width-U,q=R.height-1.5;return{x:R.x,y:R.y,width:W,height:q}}fillText(R,F,D){if(!R||R.length<=0)return;const G={};Vex.Merge(G,this.attributes),G.stroke="none",G.x=F,G.y=D;const U=this.create("text");U.textContent=R,this.applyAttributes(U,G),this.add(U)}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 R=this.state_stack.pop();return this.state["font-family"]=R.state["font-family"],this.state["font-weight"]=R.state["font-weight"],this.state["font-style"]=R.state["font-style"],this.state["font-size"]=R.state["font-size"],this.state.scale=R.state.scale,this.attributes["font-family"]=R.attributes["font-family"],this.attributes["font-weight"]=R.attributes["font-weight"],this.attributes["font-style"]=R.attributes["font-style"],this.attributes["font-size"]=R.attributes["font-size"],this.attributes.fill=R.attributes.fill,this.attributes.stroke=R.attributes.stroke,this.attributes["stroke-width"]=R.attributes["stroke-width"],this.attributes["stroke-dasharray"]=R.attributes["stroke-dasharray"],this.shadow_attributes.width=R.shadow_attributes.width,this.shadow_attributes.color=R.shadow_attributes.color,this.lineWidth=R.lineWidth,this}}let lastContext=null;class Renderer{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 lastContext}static set lastContext(R){lastContext=R}static buildContext(R,F,D,G,U){const W=new Renderer(R,F);D&&G&&W.resize(D,G),U||(U="#FFF");const q=W.getContext();return q.setBackgroundFillStyle(U),Renderer.lastContext=q,q}static getCanvasContext(R,F,D,G){return Renderer.buildContext(R,Renderer.Backends.CANVAS,F,D,G)}static getRaphaelContext(R,F,D,G){return Renderer.buildContext(R,Renderer.Backends.RAPHAEL,F,D,G)}static getSVGContext(R,F,D,G){return Renderer.buildContext(R,Renderer.Backends.SVG,F,D,G)}static bolsterCanvasContext(R){if(Renderer.USE_CANVAS_PROXY)return new CanvasContext(R);const F=["clear","setFont","setRawFont","setFillStyle","setBackgroundFillStyle","setStrokeStyle","setShadowColor","setShadowBlur","setLineWidth","setLineCap","setLineDash","openGroup","closeGroup","getGroup"];return R.vexFlowCanvasContext=R,F.forEach(D=>{R[D]=R[D]||CanvasContext.prototype[D]}),R}static drawDashedLine(R,F,D,G,U,W){R.beginPath();const q=G-F,Y=U-D,J=Math.atan2(Y,q);let Z=F,K=D;R.moveTo(F,D);let te=0,Q=!0;for(;!((q<0?Z<=G:Z>=G)&&(Y<0?K<=U:K>=U));){const ie=W[te++%W.length],se=Z+Math.cos(J)*ie;Z=q<0?Math.max(G,se):Math.min(G,se);const ne=K+Math.sin(J)*ie;K=Y<0?Math.max(U,ne):Math.min(U,ne),Q?R.lineTo(Z,K):R.moveTo(Z,K),Q=!Q}R.closePath(),R.stroke()}constructor(R,F){if(this.elementId=R,!this.elementId)throw new Vex.RERR("BadArgument","Invalid id for renderer.");if(this.element=document.getElementById(R),this.element||(this.element=R),this.ctx=null,this.paper=null,this.backend=F,this.backend===Renderer.Backends.CANVAS){if(!this.element.getContext)throw new Vex.RERR("BadElement",`Can't get canvas context from element: ${R}`);this.ctx=Renderer.bolsterCanvasContext(this.element.getContext("2d"))}else if(this.backend===Renderer.Backends.RAPHAEL)this.ctx=new RaphaelContext(this.element);else if(this.backend===Renderer.Backends.SVG)this.ctx=new SVGContext(this.element);else throw new Vex.RERR("InvalidBackend",`No support for backend: ${this.backend}`)}resize(R,F){if(this.backend===Renderer.Backends.CANVAS){if(!this.element.getContext)throw new Vex.RERR("BadElement",`Can't get canvas context from element: ${this.elementId}`);[R,F]=CanvasContext.SanitizeCanvasDims(R,F);const D=window.devicePixelRatio||1;this.element.width=R*D,this.element.height=F*D,this.element.style.width=R+"px",this.element.style.height=F+"px",this.ctx=Renderer.bolsterCanvasContext(this.element.getContext("2d")),this.ctx.scale(D,D)}else this.ctx.resize(R,F);return this}getContext(){return this.ctx}}function L$j(...B){Stem.DEBUG&&Vex.L("Vex.Flow.Stem",B)}class Stem extends Element$1{static get CATEGORY(){return"stem"}static get UP(){return 1}static get DOWN(){return-1}static get WIDTH(){return Flow.STEM_WIDTH}static get HEIGHT(){return Flow.STEM_HEIGHT}constructor(R={}){super(),this.setAttribute("type","Stem"),this.x_begin=R.x_begin||0,this.x_end=R.x_end||0,this.y_top=R.y_top||0,this.y_bottom=R.y_bottom||0,this.stem_extension=R.stem_extension||0,this.stem_direction=R.stem_direction||0,this.hide=R.hide||!1,this.isStemlet=R.isStemlet||!1,this.stemletHeight=R.stemletHeight||0,this.resetHeight=0,this.renderHeightAdjustment=0,this.setOptions(R)}setResetHeight(R){this.resetHeight=R}setOptions(R){this.stem_up_y_offset=R.stem_up_y_offset||0,this.stem_down_y_offset=R.stem_down_y_offset||0}setNoteHeadXBounds(R,F){return this.x_begin=R,this.x_end=F,this}setDirection(R){this.stem_direction=R}setExtension(R){this.stem_extension=R}getExtension(){return this.stem_extension}setYBounds(R,F){this.y_top=R,this.y_bottom=F}getCategory(){return Stem.CATEGORY}getHeight(){const R=this.stem_direction===Stem.UP?this.stem_up_y_offset:this.stem_down_y_offset;return(this.y_bottom-this.y_top)*this.stem_direction+(Stem.HEIGHT-R+this.stem_extension)*this.stem_direction}getBoundingBox(){throw new Vex.RERR("NotImplemented","getBoundingBox() not implemented.")}getExtents(){const R=this.stem_direction===Stem.UP,F=[this.y_top,this.y_bottom],D=Stem.HEIGHT+this.stem_extension,G=(R?Math.min:Math.max)(...F),U=(R?Math.max:Math.min)(...F);return{topY:G+D*-this.stem_direction+this.resetHeight*-this.stem_direction,baseY:U}}setVisibility(R){return this.hide=!R,this}setStemlet(R,F){return this.isStemlet=R,this.stemletHeight=F,this}draw(){if(this.setRendered(),this.hide)return;const R=this.checkContext();let F,D;const G=this.stem_direction;G===Stem.DOWN?(F=this.x_begin,D=this.y_top+this.stem_down_y_offset):(F=this.x_end,D=this.y_bottom-this.stem_up_y_offset);const U=this.getHeight();L$j("Rendering stem - ","Top Y: ",this.y_top,"Bottom Y: ",this.y_bottom);const W=this.isStemlet?U-this.stemletHeight*this.stem_direction:0;if(R.save(),this.applyStyle(R),R.beginPath(),R.setLineWidth(Stem.WIDTH),R.moveTo(F,D-W),R.lineTo(F,D-U-this.renderHeightAdjustment*G-this.resetHeight*G),R.svg){const q={class:Vex.Prefix("stem")};this.id&&(q.id=this.id),R.stroke(q)}else R.stroke();this.restoreStyle(R),R.restore()}}class Tuplet$1 extends Element$1{static get LOCATION_TOP(){return 1}static get LOCATION_BOTTOM(){return-1}static get NESTING_OFFSET(){return 15}constructor(R,F){if(super(),this.setAttribute("type","Tuplet"),!R||!R.length)throw new Vex.RuntimeError("BadArguments","No notes provided for tuplet.");this.options=Vex.Merge({},F),this.notes=R,this.num_notes="num_notes"in this.options?this.options.num_notes:R.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=R.some(D=>D.beam===null),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||Tuplet$1.LOCATION_TOP,Formatter.AlignRestsToNotes(R,!0,!0),this.resolveGlyphs(),this.attach()}attach(){for(let R=0;R=1;)this.numerator_glyphs.unshift(new Glyph("v"+R%10,this.point)),R=parseInt(R/10,10);for(this.denom_glyphs=[],R=this.notes_occupied;R>=1;)this.denom_glyphs.unshift(new Glyph("v"+R%10,this.point)),R=parseInt(R/10,10)}getNestedTupletCount(){const R=this.location,F=this.notes[0];let D=U(F,R),G=U(F,R);function U(W,q){return W.tupletStack.filter(Y=>Y.location===q).length}return this.notes.forEach(W=>{const q=U(W,R);D=q>D?q:D,G=qG&&(G=W)}}return G+R+F}draw(){this.checkContext(),this.setRendered();const R=this.notes[0],F=this.notes[this.notes.length-1];this.bracketed?(this.x_pos=R.getTieLeftX()-5,this.width=F.getTieRightX()-this.x_pos+5):(this.x_pos=R.getStemX(),this.width=F.getStemX()-this.x_pos),this.y_pos=this.getYPosition();const D=(Y,J)=>Y+J.getMetrics().width;let G=this.numerator_glyphs.reduce(D,0);this.ratioed&&(G=this.denom_glyphs.reduce(D,G),G+=this.point*.32);const W=this.x_pos+this.width/2-G/2;if(this.bracketed){const Y=this.width/2-G/2-5;Y>0&&(this.context.fillRect(this.x_pos,this.y_pos,Y,1),this.context.fillRect(this.x_pos+this.width/2+G/2+5,this.y_pos,Y,1),this.context.fillRect(this.x_pos,this.y_pos+(this.location===Tuplet$1.LOCATION_BOTTOM),1,this.location*10),this.context.fillRect(this.x_pos+this.width,this.y_pos+(this.location===Tuplet$1.LOCATION_BOTTOM),1,this.location*10))}let q=0;if(this.numerator_glyphs.forEach(Y=>{Y.render(this.context,W+q,this.y_pos+this.point/3-2),q+=Y.getMetrics().width}),this.ratioed){const Y=W+q+this.point*.16,J=this.point*.06;this.context.beginPath(),this.context.arc(Y,this.y_pos-this.point*.08,J,0,Math.PI*2,!0),this.context.closePath(),this.context.fill(),this.context.beginPath(),this.context.arc(Y,this.y_pos+this.point*.12,J,0,Math.PI*2,!0),this.context.closePath(),this.context.fill(),q+=this.point*.32,this.denom_glyphs.forEach(Z=>{Z.render(this.context,W+q,this.y_pos+this.point/3-2),q+=Z.getMetrics().width})}}}function calculateStemDirection(B){let R=0;return B.forEach(F=>{F.keyProps&&F.keyProps.forEach(D=>{R+=D.line-3})}),R>=0?Stem.DOWN:Stem.UP}const getStemSlope=(B,R)=>{const F=B.getStemExtents().topY,D=B.getStemX(),G=R.getStemExtents().topY,U=R.getStemX();return(G-F)/(U-D)},BEAM_LEFT="L",BEAM_RIGHT="R",BEAM_BOTH="B";class Beam$1 extends Element$1{static getDefaultBeamGroups(R){(!R||R==="c")&&(R="4/4");const D={"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"]}[R];if(D===void 0){const G=parseInt(R.split("/")[0],10),U=parseInt(R.split("/")[1],10);if(G%3===0)return[new Fraction(3,U)];if(U>4)return[new Fraction(2,U)];if(U<=4)return[new Fraction(1,U)]}else return D.map(G=>new Fraction().parse(G));return[new Fraction(1,4)]}static applyAndGetBeams(R,F,D){return Beam$1.generateBeams(R.getTickables(),{groups:D,stem_direction:F})}static generateBeams(R,F){F||(F={}),(!F.groups||!F.groups.length)&&(F.groups=[new Fraction(2,8)]);const D=F.groups.map(he=>{if(!he.multiply)throw new Vex.RuntimeError("InvalidBeamGroups","The beam groups must be an array of Vex.Flow.Fractions");return he.clone().multiply(Flow.RESOLUTION,1)}),G=R;let U=0,W=[],q=[];function Y(he){return he.reduce((fe,be)=>be.getTicks().clone().add(fe),new Fraction(0,1))}function J(){D.length-1>U?U+=1:U=0}function Z(){let he=[];G.forEach(fe=>{if(he=[],fe.shouldIgnoreTicks()){W.push(q),q=he;return}q.push(fe);const be=D[U].clone(),ue=Y(q),ge=Flow.durationToNumber(fe.duration)<8;ge&&fe.tuplet&&(be.numerator*=2),ue.greaterThan(be)?(ge||he.push(q.pop()),W.push(q),q=he,J()):ue.equals(be)&&(W.push(q),q=he,J())}),q.length>0&&W.push(q)}function K(){return W.filter(he=>{if(he.length>1){let fe=!0;return he.forEach(be=>{be.getIntrinsicTicks()>=Flow.durationToTicks("4")&&(fe=!1)}),fe}return!1})}function te(){const he=[];W.forEach(fe=>{let be=[];fe.forEach((ue,ge,ve)=>{const Se=ge===0||ge===ve.length-1,pe=ve[ge-1],ye=!F.beam_rests&&ue.isRest(),Ee=F.beam_rests&&F.beam_middle_only&&ue.isRest()&&Se;let de=!1;if(F.maintain_stem_directions&&pe&&!ue.isRest()&&!pe.isRest()){const Me=pe.getStemDirection();de=ue.getStemDirection()!==Me}const we=parseInt(ue.duration,10)<8;ye||Ee||de||we?(be.length>0&&he.push(be),be=de?[ue]:[]):be.push(ue)}),be.length>0&&he.push(be)}),W=he}function Q(){W.forEach(he=>{let fe;if(F.maintain_stem_directions){const be=ie(he);fe=be?be.getStemDirection():Stem.UP}else F.stem_direction?fe=F.stem_direction:fe=calculateStemDirection(he);se(he,fe)})}function ie(he){for(let fe=0;fe{be.setStemDirection(fe)})}function ne(){const he=[];return W.forEach(fe=>{let be=null;fe.forEach(ue=>{ue.tuplet&&be!==ue.tuplet&&(be=ue.tuplet,he.push(be))})}),he}Z(),te(),Q();const re=K(),ae=ne(),ce=[];return re.forEach(he=>{const fe=new Beam$1(he);F.show_stemlets&&(fe.render_options.show_stemlets=!0),F.secondary_breaks&&(fe.render_options.secondary_break_ticks=Flow.durationToTicks(F.secondary_breaks)),F.flat_beams===!0&&(fe.render_options.flat_beams=!0,fe.render_options.flat_beam_offset=F.flat_beam_offset),ce.push(fe)}),ae.forEach(he=>{const fe=he.notes[0].stem_direction===Stem.DOWN?Tuplet$1.LOCATION_BOTTOM:Tuplet$1.LOCATION_TOP;he.setTupletLocation(fe);let be=!1;for(let ue=0;ue=Flow.durationToTicks("4"))throw new Vex.RuntimeError("BadArguments","Beams can only be applied to notes shorter than a quarter note.");let D,G;for(this.stem_direction=Stem.UP,D=0;Dq+Y.stem_direction,0)>-1?Stem.UP:Stem.DOWN),D=0;DD.getGlyph().beam_count).reduce((D,G)=>G>D?G:D)}breakSecondaryAt(R){return this.break_on_indices=R,this}getSlopeY(R,F,D,G){return D+(R-F)*G}calculateSlope(){const{notes:R,stem_direction:F,render_options:{max_slope:D,min_slope:G,slope_iterations:U,slope_cost:W}}=this,q=R[0],Y=getStemSlope(q,R[R.length-1]),J=(D-G)/U;let Z=Number.MAX_VALUE,K=0,te=0;for(let Q=G;Q<=D;Q+=J){let ie=0,se=0;for(let ce=1;cene)&&(J=ne,q=Math.min(...se.getYs()),Y=se.getBeamCount())}let Z=W/R.length;const K=D*1.5,te=G+Y*K,Q=q+te*-F;F===Stem.DOWN&&ZQ&&(Z=q-te),U+this.render_options.flat_beam_offset_per_beam>0?F===Stem.DOWN&&Z>U&&!this.render_options.flat_beams?this.render_options.flat_beam_offset=Z:F===Stem.UP&&Z0){let G=this.render_options.flat_beam_offset;this.render_options.flat_beam_offset_per_beam&&(G+=this.render_options.flat_beam_offset_per_beam*this.getBeamCount());let U=this.notes[0].note_heads[0].y;const W=this.stem_direction>0?Math.min:Math.max;for(const q of this.notes)for(const Y of q.note_heads)U=W(U,Y.y);D=U+G*-this.stem_direction}return D}applyStemExtensions(){const{notes:R,slope:F,y_shift:D,stem_direction:G,beam_count:U,render_options:{show_stemlets:W,stemlet_extension:q,beam_width:Y}}=this,J=R[0],Z=this.getBeamYToDraw(),K=J.getStemX();for(let te=0;te=8&&(Q=this.break_on_indices.indexOf(Z)!==-1,this.render_options.secondary_break_ticks&&Y>=this.render_options.secondary_break_ticks&&(Y=0,Q=!0));const ie=K.getIntrinsicTicks(){R.getStem()&&(this.context.openGroup("stem",R.getAttribute("id")+"-stem"),R.getStem().setContext(this.context).draw(),this.context.closeGroup())},this)}drawBeamLines(){this.checkContext();const R=["4","8","16","32","64"],F=this.notes[0];let D=this.getBeamYToDraw();const G=F.getStemX(),U=this.render_options.beam_width*this.stem_direction,W={};for(const q of this.notes)W[q.getAttribute("id")]=0;for(let q=0;q{R.getStave()||R.setStave(this.stave)}),this.preFormatted=!0,this)}draw(R=this.context,F=this.stave){this.setRendered();let D=null;for(let G=0;G0&&D){const W=U.getBoundingBox();W&&D.mergeWith(W)}U.setContext(R),U.drawWithStyle()}this.boundingBox=D}}function drawBoldDoubleLine(B,R,F,D,G){if(R!==StaveConnector.type.BOLD_DOUBLE_LEFT&&R!==StaveConnector.type.BOLD_DOUBLE_RIGHT)throw new Vex.RERR("InvalidConnector","A REPEAT_BEGIN or REPEAT_END type must be provided.");let U=3,W=3.5;const q=2;R===StaveConnector.type.BOLD_DOUBLE_RIGHT&&(U=-5,W=3),B.fillRect(F+U,D,1,G-D),B.fillRect(F-q,D,W,G-D)}class StaveConnector extends Element$1{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:StaveConnector.type.SINGLE_RIGHT,singleLeft:StaveConnector.type.SINGLE_LEFT,single:StaveConnector.type.SINGLE,double:StaveConnector.type.DOUBLE,brace:StaveConnector.type.BRACE,bracket:StaveConnector.type.BRACKET,boldDoubleLeft:StaveConnector.type.BOLD_DOUBLE_LEFT,boldDoubleRight:StaveConnector.type.BOLD_DOUBLE_RIGHT,thinDouble:StaveConnector.type.THIN_DOUBLE,none:StaveConnector.type.NONE}}constructor(R,F){super(),this.setAttribute("type","StaveConnector"),this.thickness=Flow.STAVE_LINE_THICKNESS,this.width=3,this.top_stave=R,this.bottom_stave=F,this.type=StaveConnector.type.DOUBLE,this.font={family:"times",size:16,weight:"normal"},this.x_shift=0,this.texts=[]}setType(R){return R=typeof R=="string"?StaveConnector.typeString[R]:R,R>=StaveConnector.type.SINGLE_RIGHT&&R<=StaveConnector.type.NONE&&(this.type=R),this}setText(R,F){return this.texts.push({content:R,options:Vex.Merge({shift_x:0,shift_y:0},F)}),this}setFont(R){Vex.Merge(this.font,R)}setXShift(R){if(typeof R!="number")throw Vex.RERR("InvalidType","x_shift must be a Number");return this.x_shift=R,this}draw(){const R=this.checkContext();this.setRendered();let F=this.top_stave.getYForLine(0),D=this.bottom_stave.getYForLine(this.bottom_stave.getNumLines()-1)+this.thickness,G=this.width,U=this.top_stave.getX();(this.type===StaveConnector.type.SINGLE_RIGHT||this.type===StaveConnector.type.BOLD_DOUBLE_RIGHT||this.type===StaveConnector.type.THIN_DOUBLE)&&(U=this.top_stave.getX()+this.top_stave.width);let q=D-F;switch(this.type){case StaveConnector.type.SINGLE:G=1;break;case StaveConnector.type.SINGLE_LEFT:G=1;break;case StaveConnector.type.SINGLE_RIGHT:G=1;break;case StaveConnector.type.DOUBLE:U-=this.width+2;break;case StaveConnector.type.BRACE:{G=12;const Y=this.top_stave.getX()-2+this.x_shift,J=F,Z=Y,K=D,te=Y-G,Q=J+q/2,ie=te-.9*G,se=J+.2*q,ne=Y+1.1*G,re=Q-.135*q,ae=ne,ce=Q+.135*q,he=ie,fe=K-.2*q,be=te-G,ue=fe,ge=Y+.4*G,ve=Q+.135*q,Se=ge,pe=Q-.135*q,ye=be,Ee=se;R.beginPath(),R.moveTo(Y,J),R.bezierCurveTo(ie,se,ne,re,te,Q),R.bezierCurveTo(ae,ce,he,fe,Z,K),R.bezierCurveTo(be,ue,ge,ve,te,Q),R.bezierCurveTo(Se,pe,ye,Ee,Y,J),R.fill(),R.stroke();break}case StaveConnector.type.BRACKET:F-=4,D+=4,q=D-F,Glyph.renderGlyph(R,U-5,F-3,40,"v1b",!0),Glyph.renderGlyph(R,U-5,D+3,40,"v10",!0),U-=this.width+2;break;case StaveConnector.type.BOLD_DOUBLE_LEFT:drawBoldDoubleLine(R,this.type,U+this.x_shift,F,D);break;case StaveConnector.type.BOLD_DOUBLE_RIGHT:drawBoldDoubleLine(R,this.type,U,F,D);break;case StaveConnector.type.THIN_DOUBLE:G=1;break;case StaveConnector.type.NONE:break;default:throw new Vex.RERR("InvalidType",`The provided StaveConnector.type (${this.type}) is invalid`)}this.type!==StaveConnector.type.BRACE&&this.type!==StaveConnector.type.BOLD_DOUBLE_LEFT&&this.type!==StaveConnector.type.BOLD_DOUBLE_RIGHT&&this.type!==StaveConnector.type.NONE&&R.fillRect(U,F,G,q),this.type===StaveConnector.type.THIN_DOUBLE&&R.fillRect(U-3,F,G,q),R.save(),R.lineWidth=2,R.setFont(this.font.family,this.font.size,this.font.weight);for(let Y=0;Y0){const ne=se.space.deviation,re=ne>=0?"+":"";R.setFillStyle("red"),R.fillText(re+Math.round(ne),q+F.getXShift(),D-10)}R.restore()}constructor(R){if(super(),this.setAttribute("type","Note"),!R)throw new Vex.RuntimeError("BadArguments","Note must have valid initialization data to identify duration and type.");const F=Flow.parseNoteStruct(R);if(!F)throw new Vex.RuntimeError("BadArguments",`Invalid note initialization object: ${JSON.stringify(R)}`);if(this.duration=F.duration,this.dots=F.dots,this.noteType=F.type,this.customTypes=F.customTypes,this.DYMusicScoreType=R.DYMusicScoreType,R.duration_override?this.setDuration(R.duration_override):this.setIntrinsicTicks(F.ticks),this.modifiers=[],this.glyph=Flow.getGlyphProps(this.duration,this.noteType),this.customGlyphs=this.customTypes.map(D=>Flow.getGlyphProps(this.duration,D)),this.positions&&(typeof this.positions!="object"||!this.positions.length))throw new Vex.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=[],R.align_center&&this.setCenterAlignment(R.align_center),this.stave=null,this.render_options={annotation_spacing:5,stave_padding:Note.STAVEPADDING}}getPlayNote(){return this.playNote}setPlayNote(R){return this.playNote=R,this}isRest(){return!1}addStroke(R,F){return F.setNote(this),F.setIndex(R),this.modifiers.push(F),this.setPreFormatted(!1),this}getStave(){return this.stave}setStave(R){return this.stave=R,this.setYs([R.getYForLine(0)]),this.context=this.stave.context,this}getCategory(){return Note.CATEGORY}setContext(R){return this.context=R,this}getExtraLeftPx(){return this.extraLeftPx}getExtraRightPx(){return this.extraRightPx}setExtraLeftPx(R){return this.extraLeftPx=R,this}setExtraRightPx(R){return this.extraRightPx=R,this}shouldIgnoreTicks(){return this.ignore_ticks}getLineNumber(){return 0}getLineForRest(){return 0}getGlyph(){return this.glyph}getGlyphWidth(){return this.glyph.getWidth?this.glyph.getWidth(this.render_options.glyph_font_scale):15}setYs(R){return this.ys=R,this}getYs(){if(this.ys.length===0)throw new Vex.RERR("NoYValues","No Y-values calculated for this note.");return this.ys}getYForTopText(R){if(!this.stave)throw new Vex.RERR("NoStave","No stave attached to this note.");return this.stave.getYForTopText(R)}getBoundingBox(){return null}getVoice(){if(!this.voice)throw new Vex.RERR("NoVoice","Note has no voice.");return this.voice}setVoice(R){return this.voice=R,this.preFormatted=!1,this}getTickContext(){return this.tickContext}setTickContext(R){return this.tickContext=R,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(R){return this.modifierContext=R,this}addModifier(R,F=0){return R.setNote(this),R.setIndex(F),this.modifiers.push(R),this.setPreFormatted(!1),this}getModifierStartXY(){if(!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");return{x:this.getAbsoluteX(),y:this.ys[0]}}getMetrics(){if(!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call getMetrics on an unformatted note.");let R=0,F=0;this.modifierContext!=null&&(R=this.modifierContext.state.left_shift,F=this.modifierContext.state.right_shift);const D=this.getWidth();return{width:D,noteWidth:D-R-F-this.extraLeftPx-this.extraRightPx,left_shift:this.x_shift,modLeftPx:R,modRightPx:F,extraLeftPx:this.extraLeftPx,extraRightPx:this.extraRightPx}}setWidth(R){this.width=R}getWidth(){if(!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call GetWidth on an unformatted note.");return this.width+(this.modifierContext?this.modifierContext.getWidth():0)}setXShift(R){return this.x_shift=R,this}getXShift(){return this.x_shift}getX(){if(!this.tickContext)throw new Vex.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");return this.tickContext.getX()+this.x_shift}getAbsoluteX(){if(!this.tickContext)throw new Vex.RERR("NoTickContext","Note needs a TickContext assigned for an X-Value");let R=this.tickContext.getX();return this.stave&&(R+=this.stave.getNoteStartX()+this.render_options.stave_padding),this.isCenterAligned()&&(this.DYMusicScoreType==="jianpu"||(R+=this.getCenterXShift())),R}setPreFormatted(R){if(this.preFormatted=R,this.preFormatted){const F=this.tickContext.getExtraPx();this.left_modPx=Math.max(this.left_modPx,F.left),this.right_modPx=Math.max(this.right_modPx,F.right)}}}function L$i(...B){NoteHead.DEBUG&&Vex.L("Vex.Flow.NoteHead",B)}function drawSlashNoteHead(B,R,F,D,G,U){const W=Flow.SLASH_NOTEHEAD_WIDTH;B.save(),B.setLineWidth(Flow.STEM_WIDTH);let q=!1;if(Flow.durationToNumber(R)>2&&(q=!0),q||(F-=Flow.STEM_WIDTH/2*G),B.beginPath(),B.moveTo(F,D+U),B.lineTo(F,D+1),B.lineTo(F+W,D-U),B.lineTo(F+W,D),B.lineTo(F,D+U),B.closePath(),q?B.fill():B.stroke(),Flow.durationToFraction(R).equals(.5)){const Y=[-3,-1,W+1,W+3];for(let J=0;J{const q=W.getTickContext();W.setStave(F.stave),q.setXOffset(U)})}}class Dot extends Modifier{static get CATEGORY(){return"dots"}static format(R,F){const D=F.right_shift,G=1;if(!R||R.length===0)return!1;const U=[],W={};for(let Q=0;Qie.line-Q.line);let q=D,Y=0,J=null,Z=null,K=null,te=0;for(let Q=0;QY?q:Y,J=re,Z=se}return F.right_shift+=Y,!0}constructor(){super(),this.setAttribute("type","Dot"),this.note=null,this.index=null,this.position=Modifier.Position.RIGHT,this.radius=2,this.setWidth(5),this.dot_shiftY=0}getCategory(){return Dot.CATEGORY}setNote(R){this.note=R,this.note.getCategory()==="gracenotes"&&(this.radius*=.5,this.setWidth(3))}setDotShiftY(R){return this.dot_shiftY=R,this}draw(){if(this.checkContext(),this.setRendered(),!this.note||this.index===null)throw new Vex.RERR("NoAttachedNote","Can't draw dot without a note and index.");const R=this.note.stave.options.spacing_between_lines_px,F=this.note.getModifierStartXY(this.position,this.index,{forceFlagRight:!0});this.note.getCategory()==="tabnotes"&&(F.y=this.note.getStemExtents().baseY+1);const D=F.x+this.x_shift+this.width-this.radius,G=F.y+this.y_shift+this.dot_shiftY*R,U=this.context;U.beginPath(),U.arc(D,G,this.radius,0,Math.PI*2,!1),U.fill()}}function L$h(...B){StaveNote.DEBUG&&Vex.L("Vex.Flow.StaveNote",B)}const getStemAdjustment=B=>Stem.WIDTH/(2*-B.getStemDirection()),isInnerNoteIndex=(B,R)=>R===(B.getStemDirection()===Stem.UP?B.keyProps.length-1:0);function shiftRestVertical(B,R,F){const D=(R.isrest?0:1)*F;B.line+=D,B.maxLine+=D,B.minLine+=D,B.note.setKeyLine(0,B.note.getKeyLine(0)+D)}function centerRest(B,R,F){const D=B.line-Vex.MidLine(R.minLine,F.maxLine);B.note.setKeyLine(0,B.note.getKeyLine(0)-D),B.line-=D,B.maxLine-=D,B.minLine-=D}class StaveNote extends StemmableNote{static get CATEGORY(){return"stavenotes"}static get STEM_UP(){return Stem.UP}static get STEM_DOWN(){return Stem.DOWN}static get DEFAULT_LEDGER_LINE_OFFSET(){return 3}static renderVibrato(R,F,D,G,U){const{vibrato_width:W,wave_width:q,wave_girth:Y,wave_height:J}=G,Z=W/q,K=Math.abs(U-D)/Z+2;R.beginPath();let te;for(R.moveTo(F,D+Y),te=0;te2?D[1]:null;let Y=U>2?D[2]:D[1];U===2&&W.stemDirection===-1&&Y.stemDirection===1&&(W=D[1],Y=D[0]);const J=Math.max(W.voice_shift,Y.voice_shift);let Z=0,K;if(U===2){const te=W.stemDirection===Y.stemDirection?0:.5;if(W.stemDirection===Y.stemDirection&&W.minLine<=Y.maxLine&&(W.isrest||(K=Math.abs(W.line-(Y.maxLine+.5)),K=Math.max(K,W.stemMin),W.minLine=W.line-K,W.note.setStemLength(K*10))),W.minLine<=Y.maxLine+te)if(W.isrest)shiftRestVertical(W,Y,1);else if(Y.isrest)shiftRestVertical(Y,W,-1);else{Z=J;const Q=Math.abs(W.line-Y.line);let ie=0,se=0;W.note.duration==="h"?ie++:W.note.duration==="w"&&se++,Y.note.duration==="h"?ie++:Y.note.duration==="w"&&se++;let ne=ie===1||se===1||W.note.dots!==Y.note.dots;if(G&&(ne=ne||se===2),Q===0&&ne){if(Y.note.setXShift(Z),W.note.dots>0){let re=0;for(const ae of W.note.modifiers)if(ae instanceof Dot&&(re++,ae.setYShift(-10*(Y.maxLine-W.line+1)),re===W.note.dots))break}}else Q<1&&Q>0?Y.note.setXShift(Z):W.note.voice!==Y.note.voice&&W.stemDirection===Y.stemDirection&&(W.line>Y.line?W.stemDirection===1?Y.note.renderFlag=!1:W.note.renderFlag=!1:Y.line>W.line?Y.stemDirection===1?W.note.renderFlag=!1:Y.note.renderFlag=!1:Y.stemDirection===1&&(Y.stemDirection=-1,Y.note.setStemDirection(-1)))}return!0}if(q!==null&&q.minLineF.postFormat()),!0):!1}constructor(R){if(super(R),this.setAttribute("type","StaveNote"),this.keys=R.keys,this.clef=R.clef,this.octave_shift=R.octave_shift,this.beam=null,this.vibrato=null,this.glyph=Flow.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new Vex.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(R)}`);this.displaced=!1,this.dot_shiftY=0,this.addDotsCount=0,this.keyProps=[],this.use_default_head_x=!1,this.note_heads=[],this.modifiers=[],Vex.Merge(this.render_options,{glyph_font_scale:R.glyph_font_scale||Flow.DEFAULT_NOTATION_FONT_SCALE,stroke_px:R.stroke_px||StaveNote.DEFAULT_LEDGER_LINE_OFFSET}),this.calculateKeyProps(),this.buildStem(),R.auto_stem?this.autoStem():this.setStemDirection(R.stem_direction),this.reset(),this.buildFlag()}reset(){super.reset();const R=this.note_heads.map(F=>F.getStyle());this.buildNoteHeads(),this.note_heads.forEach((F,D)=>F.setStyle(R[D])),this.stave&&this.note_heads.forEach(F=>F.setStave(this.stave)),this.calcExtraPx()}setBeam(R){return this.beam=R,this.calcExtraPx(),this}setVibrato(R){this.vibrato=R}getCategory(){return StaveNote.CATEGORY}buildStem(){this.setStem(new Stem({hide:!!this.isRest()})),this.stem.id=Vex.Prefix(`${this.getAttribute("id")}-stem`)}buildNoteHeads(){this.note_heads=[];const R=this.getStemDirection(),F=this.getKeys();let D=null,G=null,U=!1,W,q,Y;R===Stem.UP?(W=0,q=F.length,Y=1):R===Stem.DOWN&&(W=F.length-1,q=-1,Y=-1);for(let J=W;J!==q;J+=Y){const Z=this.keyProps[J],K=Z.line;D===null?D=K:(G=Math.abs(D-K),G===0||G===.5?U=!U:(U=!1,this.use_default_head_x=!0)),D=K;const te=new NoteHead({duration:this.duration,note_type:this.noteType,displaced:U,stem_direction:R,custom_glyph_code:Z.code,glyph_font_scale:this.render_options.glyph_font_scale,x_shift:Z.shift_right,stem_up_x_offset:Z.stem_up_x_offset,stem_down_x_offset:Z.stem_down_x_offset,line:Z.line});this.note_heads[J]=te}}autoStem(){this.minLine=this.keyProps[0].line,this.maxLine=this.keyProps[this.keyProps.length-1].line;const R=3,D=(this.minLine+this.maxLine)/20&&(this.keyProps[F-1].displaced=!0)),R=W,this.keyProps.push(U)}R=-1/0,this.keyProps.forEach(F=>{F.lineF.line-D.line)}getBoundingBox(){if(!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call getBoundingBox on an unformatted note.");const{width:R,modLeftPx:F,extraLeftPx:D}=this.getMetrics(),G=this.getAbsoluteX()-F-D;let U=0,W=0;const q=this.getStave().getSpacingBetweenLines()/2,Y=q*2;if(this.isRest()){const J=this.ys[0],Z=Flow.durationToFraction(this.duration);Z.equals(1)||Z.equals(2)?(U=J-q,W=J+q):(U=J-this.glyph.line_above*Y,W=J+this.glyph.line_below*Y)}else if(this.glyph.stem){const J=this.getStemExtents();J.baseY+=q*this.stem_direction,U=Math.min(J.topY,J.baseY),W=Math.max(J.topY,J.baseY)}else{U=null,W=null;for(let J=0;JF&&(F=G):G1}hasStem(){return this.glyph.stem}hasFlag(){return super.hasFlag()&&!this.isRest()&&this.renderFlag}getStemX(){return this.noteType==="r"?this.getCenterGlyphX():super.getStemX()+getStemAdjustment(this)}getYForTopText(R){const F=this.getStemExtents();return Math.min(this.stave.getYForTopText(R),F.topY-this.render_options.annotation_spacing*(R+1))}getYForBottomText(R){const F=this.getStemExtents();return Math.max(this.stave.getYForTopText(R),F.baseY+this.render_options.annotation_spacing*R)}setStave(R){super.setStave(R);const F=this.note_heads.map(D=>(D.setStave(R),D.getY()));if(this.setYs(F),this.stem){const{y_top:D,y_bottom:G}=this.getNoteHeadBounds();this.stem.setYBounds(D,G)}return this}getKeys(){return this.keys}getKeyProps(){return this.keyProps}isDisplaced(){return this.displaced}setNoteDisplaced(R){return this.displaced=R,this}getTieRightX(){let R=this.getAbsoluteX();return R+=this.getGlyphWidth()+this.x_shift+this.extraRightPx,this.modifierContext&&(R+=this.modifierContext.getExtraRightPx()),R}getTieLeftX(){let R=this.getAbsoluteX();return R+=this.x_shift-this.extraLeftPx,R}getLineForRest(){let R=this.keyProps[0].line;if(this.keyProps.length>1){const F=this.keyProps[this.keyProps.length-1].line,D=Math.max(R,F),G=Math.min(R,F);R=Vex.MidLine(D,G)}return R}getModifierStartXY(R,F,D){if(D=D||{},!this.preFormatted)throw new Vex.RERR("UnformattedNote","Can't call GetModifierStartXY on an unformatted note");if(this.ys.length===0)throw new Vex.RERR("NoYValues","No Y-Values calculated for this note.");const{ABOVE:G,BELOW:U,LEFT:W,RIGHT:q}=Modifier.Position;let Y=0;return R===W?Y=-1*2:R===q?(Y=this.getGlyphWidth()+this.x_shift+2,this.stem_direction===Stem.UP&&this.hasFlag()&&(D.forceFlagRight||isInnerNoteIndex(this,F))&&(Y+=this.flag.getMetrics().width)):(R===U||R===G)&&(Y=this.getGlyphWidth()/2),{x:this.getAbsoluteX()+Y,y:this.ys[F]}}setStyle(R){super.setStyle(R),this.note_heads.forEach(F=>F.setStyle(R)),this.stem&&this.stem.setStyle(R)}setStemStyle(R){this.stem&&this.getStem().setStyle(R)}getStemStyle(){return this.stem.getStyle()}setLedgerLineStyle(R){this.ledgerLineStyle=R}getLedgerLineStyle(){return this.ledgerLineStyle}setFlagStyle(R){this.flagStyle=R}getFlagStyle(){return this.flagStyle}setKeyStyle(R,F){return this.note_heads[R].setStyle(F),this}setKeyLine(R,F){return(this.glyph.code_head=="va5"||this.glyph.code_head=="v3c")&&(F=3),this.keyProps[R].line=F,this.reset(),this}getKeyLine(R){return this.keyProps[R].line}addToModifierContext(R){this.setModifierContext(R);for(let F=0;F{const te=K.getLine(),Q=K.getY();(R===null||QF)&&(F=Q),G===null&&K.isDisplaced()&&(G=K.getAbsoluteX()),D===null&&!K.isDisplaced()&&(D=K.getAbsoluteX()),U=te>U?te:U,W=te{let fe;he&&ce?fe=se-D:ce?fe=ie-D:fe=Q-D;const be=ce&&he?W:U;G.beginPath(),G.moveTo(fe,ae),G.lineTo(fe+be,ae),G.stroke()},re={...R.getStyle()||{},...this.getLedgerLineStyle()||{}};this.applyStyle(G,re);for(let ae=6;ae<=q;++ae){const ce=ie!==null&&ae<=Z,he=Q!==null&&ae<=J;ne(R.getYForNote(ae),ce,he)}for(let ae=0;ae>=Y;--ae){const ce=ie!==null&&ae>=te,he=Q!==null&&ae>=K;ne(R.getYForNote(ae),ce,he)}this.restoreStyle(G,re)}drawVibrato(){if(this.vibrato){const R=this.context;R.openGroup("vibrato");const F=this.vibrato.getNoteHeadEndX()+2,{y_top:D}=this.vibrato.getNoteHeadBounds();let{y_bottom:G}=this.getNoteHeadBounds(),U=Math.abs(this.getNoteHeadBeginX()-F)-10;this.vibrato.stave.y!==this.stave.y&&(U=30,G=D+10),StaveNote.renderVibrato(this.context,F,D,{harsh:!0,vibrato_width:U,wave_height:6,wave_width:4,wave_girth:2},G),R.closeGroup()}}drawModifiers(){if(!this.context)throw new Vex.RERR("NoCanvasContext","Can't draw without a canvas context.");const R=this.context;R.openGroup("modifiers");for(let F=0;F6.5||K<-.5)&&(Z=Z+(K>6.5?(K-6.5)*10:(K+.5)*10))}D.openGroup("flag",null,{pointerBBox:!0}),this.applyStyle(D,this.getFlagStyle()||!1),this.flag.render(D,J,Z),this.restoreStyle(D,this.getFlagStyle()||!1),D.closeGroup()}}drawNoteHeads(){this.note_heads.forEach(R=>{this.context.openGroup("notehead",null,{pointerBBox:!0});try{if(this.isRest()&&this.duration==="w"){const F=this.stave.options.line_config.filter(G=>G.visible).length;this.keyProps[0].line===4&&F<5&&R.setY(R.getY()+10),F===1&&R.setLine(3)}}catch{}R.setContext(this.context).draw(),this.context.closeGroup()})}drawStem(R){if(!this.context)throw new Vex.RERR("NoCanvasContext","Can't draw without a canvas context.");R&&this.setStem(new Stem(R)),this.stem.id=Vex.Prefix(`${this.getAttribute("id")}-stem`),this.stem&&(this.context.openGroup("stem",null,{pointerBBox:!0}),this.stem.setContext(this.context).draw(),this.context.closeGroup())}draw(){if(!this.context)throw new Vex.RERR("NoCanvasContext","Can't draw without a canvas context.");if(!this.stave)throw new Vex.RERR("NoStave","Can't draw without a stave.");if(this.ys.length===0)throw new Vex.RERR("NoYValues","Can't draw note without Y values.");const R=this.stave.getLines();if(R===2||R===3||R===4)for(let G=0;GG.setX(F)),this.stem){let G=this.getStemX();const U=this.keyProps[0].line;(U>6.5||U<-.5)&&(this.beam||(this.stem.renderHeightAdjustment=U>6.5?(U-6.5)*10:Math.abs(U+.5)*10)),this.stem.setNoteHeadXBounds(G,G)}L$h("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}),D&&this.drawStem(),this.drawNoteHeads(),this.drawFlag(),this.context.closeGroup(),this.drawModifiers(),this.context.closeGroup(),this.restoreStyle(),this.setRendered()}}class FretHandFinger extends Modifier{static get CATEGORY(){return"frethandfinger"}static format(R,F){const{left_shift:D,right_shift:G}=F,U=1;if(!R||R.length===0)return!1;const W=[];let q=null,Y=0,J=0;for(let ne=0;nere.line-ne.line);let Z=0,K=0,te=0,Q=0,ie=null,se=null;for(let ne=0;nete?re:te):ce===Modifier.Position.RIGHT&&(he.setXShift(K),re=J+ge,Q=re>Q?re:Q),ie=fe,se=ae}return F.left_shift+=te,F.right_shift+=Q,!0}constructor(R){super(),this.setAttribute("type","FretHandFinger"),this.note=null,this.index=null,this.finger=R,this.width=7,this.position=Modifier.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 FretHandFinger.CATEGORY}setFretHandFinger(R){return this.finger=R,this}setOffsetX(R){return this.x_offset=R,this}setOffsetY(R){return this.y_offset=R,this}draw(){if(this.checkContext(),!this.note||this.index==null)throw new Vex.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const R=this.context,F=this.note.getModifierStartXY(this.position,this.index);let D=F.x+this.x_shift+this.x_offset,G=F.y+this.y_shift+this.y_offset+5;switch(this.position){case Modifier.Position.ABOVE:D-=4,G-=12;break;case Modifier.Position.BELOW:D-=2,G+=10;break;case Modifier.Position.LEFT:D-=this.width;break;case Modifier.Position.RIGHT:D+=1;break;default:throw new Vex.RERR("InvalidPostion",`The position ${this.position} does not exist`)}R.save(),R.setFont(this.font.family,this.font.size,this.font.weight),R.fillText(""+this.finger,D,G),R.restore()}}class Music{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:Music.scales.major,m:Music.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(R){return!(R==null||R<0||R>=Music.NUM_TONES)}isValidIntervalValue(R){return this.isValidNoteValue(R)}getNoteParts(R){if(!R||R.length<1)throw new Vex.RERR("BadArguments","Invalid note name: "+R);if(R.length>3)throw new Vex.RERR("BadArguments","Invalid note name: "+R);const F=R.toLowerCase(),G=/^([cdefgab])(b|bb|n|#|##)?$/.exec(F);if(G!=null){const U=G[1],W=G[2];return{root:U,accidental:W}}else throw new Vex.RERR("BadArguments","Invalid note name: "+R)}getKeyParts(R){if(!R||R.length<1)throw new Vex.RERR("BadArguments","Invalid key: "+R);const F=R.toLowerCase(),G=/^([cdefgab])(b|#)?(mel|harm|m|M)?$/.exec(F);if(G!=null){const U=G[1],W=G[2];let q=G[3];return q||(q="M"),{root:U,accidental:W,type:q}}else throw new Vex.RERR("BadArguments",`Invalid key: ${R}`)}getNoteValue(R){const F=Music.noteValues[R];if(F==null)throw new Vex.RERR("BadArguments",`Invalid note name: ${R}`);return F.int_val}getIntervalValue(R){const F=Music.intervals[R];if(F==null)throw new Vex.RERR("BadArguments",`Invalid interval name: ${R}`);return F}getCanonicalNoteName(R){if(!this.isValidNoteValue(R))throw new Vex.RERR("BadArguments",`Invalid note value: ${R}`);return Music.canonical_notes[R]}getCanonicalIntervalName(R){if(!this.isValidIntervalValue(R))throw new Vex.RERR("BadArguments",`Invalid interval value: ${R}`);return Music.diatonic_intervals[R]}getRelativeNoteValue(R,F,D){if(D==null&&(D=1),D!==1&&D!==-1)throw new Vex.RERR("BadArguments",`Invalid direction: ${D}`);let G=(R+D*F)%Music.NUM_TONES;return G<0&&(G+=Music.NUM_TONES),G}getRelativeNoteName(R,F){const D=this.getNoteParts(R),G=this.getNoteValue(D.root);let U=F-G;if(Math.abs(U)>Music.NUM_TONES-3){let q=1;U>0&&(q=-1);const Y=(F+1+(G+1))%Music.NUM_TONES*q;if(Math.abs(Y)>2)throw new Vex.RERR("BadArguments",`Notes not related: ${R}, ${F})`);U=Y}if(Math.abs(U)>2)throw new Vex.RERR("BadArguments",`Notes not related: ${R}, ${F})`);let W=D.root;if(U>0)for(let q=1;q<=U;++q)W+="#";else if(U<0)for(let q=-1;q>=U;--q)W+="b";return W}getScaleTones(R,F){const D=[R];let G=R;for(let U=0;UB.getMetrics().width;class Accidental extends Modifier{static get CATEGORY(){return"accidentals"}static format(R,F){const G=F.left_shift+1,U=3;if(!R||R.length===0)return;const W=[];let q=null,Y=0,J;for(let ae=0;aece.line-ae.line);const Z=[];let K=0,te=null;for(let ae=0;aeK?ce.shift:K,te=ce.line}let Q=0;for(let ae=0;aeZ[he+de],ue=de=>de.map(be),ge=(de,we)=>{const[Oe,Me]=ue([de,we]).map(Pe=>Pe.line);return Oe-Me},ve=(...de)=>de.map(ue).every(we=>!this.checkCollision(...we)),Se=fe-he+1;let pe=this.checkCollision(Z[he],Z[fe])?"a":"b";switch(Se){case 3:pe==="a"&&ge(1,2)===.5&&ge(0,1)!==.5&&(pe="second_on_bottom");break;case 4:ve([0,2],[1,3])&&(pe="spaced_out_tetrachord");break;case 5:pe==="b"&&ve([1,3])&&(pe="spaced_out_pentachord",ve([0,2],[2,4])&&(pe="very_spaced_out_pentachord"));break;case 6:ve([0,3],[1,4],[2,5])&&(pe="spaced_out_hexachord"),ve([0,2],[2,4],[1,3],[3,5])&&(pe="very_spaced_out_hexachord");break}let ye,Ee;if(Se>=7){let de=2,we=!0;for(;we===!0;){we=!1;for(let Oe=0;Oe+deEe?Q:Ee}else for(ye=ae;ye<=fe;ye++)Ee=Flow.accidentalColumnsTable[Se][pe][ye-ae],Z[ye].column=Ee,Q=Q>Ee?Q:Ee;ae=fe}const ie=[],se=[];for(let ae=0;ae<=Q;ae++)ie[ae]=0,se[ae]=0;ie[0]=K+G,se[0]=K+G,Z.forEach(ae=>{ae.width>ie[ae.column]&&(ie[ae.column]=ae.width)});for(let ae=1;ae{let ce=0;const he=re+ae.numAcc;for(re;re0?(G=F.flatLine||F.dblSharpLine?2.5:3,R.dblSharpLine&&(D-=.5)):(G=R.flatLine||R.dblSharpLine?2.5:3,F.dblSharpLine&&(D-=.5));const U=Math.abs(D){const Y=new Fraction(0,1);q.getTickables().forEach(Z=>{if(Z.shouldIgnoreTicks())return;const K=G[Y.value()];K?K.push(Z):(D.push(Y.value()),G[Y.value()]=[Z]),Y.add(Z.getTicks())})});const U=new Music;F||(F="C");const W=U.createScaleMap(F);D.forEach(q=>{const Y=G[q],J=[],Z=K=>{K.isRest()||K.shouldIgnoreTicks()||(K.keys.forEach((te,Q)=>{const ie=U.getNoteParts(te.split("/")[0]),se=ie.accidental||"n",ne=ie.root+se,re=W[ie.root]===ne,ae=J.indexOf(ne)>-1;if(!re||re&&ae){W[ie.root]=ne;const ce=new Accidental(se);K.addAccidental(Q,ce),J.push(ne)}}),K.getModifiers().forEach(te=>{te.getCategory()==="gracenotegroups"&&te.getGraceNotes().forEach(Z)}))};Y.forEach(Z)})}constructor(R=null){if(super(),this.setAttribute("type","Accidental"),L$g("New accidental: ",R),this.note=null,this.index=null,this.type=R,this.position=Modifier.Position.LEFT,this.render_options={font_scale:38,stroke_px:3,parenLeftPadding:2,parenRightPadding:2},this.accidental=Flow.accidentalCodes(this.type),!this.accidental)throw new Vex.RERR("ArgumentError",`Unknown accidental type: ${R}`);this.cautionary=!1,this.parenLeft=null,this.parenRight=null,this.reset()}reset(){const R=this.render_options.font_scale;this.glyph=new Glyph(this.accidental.code,R),this.glyph.setOriginX(1),this.cautionary&&(this.parenLeft=new Glyph(Flow.accidentalCodes("{").code,R),this.parenRight=new Glyph(Flow.accidentalCodes("}").code,R),this.parenLeft.setOriginX(1),this.parenRight.setOriginX(1))}getCategory(){return Accidental.CATEGORY}getWidth(){const R=this.cautionary?getGlyphWidth(this.parenLeft)+getGlyphWidth(this.parenRight)+this.render_options.parenLeftPadding+this.render_options.parenRightPadding:0;return getGlyphWidth(this.glyph)+R}setNote(R){if(!R)throw new Vex.RERR("ArgumentError",`Bad note value: ${R}`);this.note=R,this.note.getCategory()==="gracenotes"&&(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:R,type:F,position:D,note:G,index:U,cautionary:W,x_shift:q,y_shift:Y,glyph:J,parenLeft:Z,parenRight:K,render_options:{parenLeftPadding:te,parenRightPadding:Q}}=this;if(this.checkContext(),!(G&&U!=null))throw new Vex.RERR("NoAttachedNote","Can't draw accidental without a note and index.");const ie=G.getModifierStartXY(D,U);let se=ie.x+q;const ne=ie.y+Y;L$g("Rendering: ",F,se,ne),W?(K.render(R,se,ne),se-=getGlyphWidth(K),se-=Q,se-=this.accidental.parenRightPaddingAdjustment,J.render(R,se,ne),se-=getGlyphWidth(J),se-=te,Z.render(R,se,ne)):J.render(R,se,ne),this.setRendered()}}class NoteSubGroup$1 extends Modifier{static get CATEGORY(){return"notesubgroup"}static format(R,F){if(!R||R.length===0)return!1;let D=0;for(let G=0;G{F.ignore_ticks=!1}),this.width=0,this.preFormatted=!1,this.formatter=new Formatter,this.voice=new Voice$1({num_beats:4,beat_value:4,resolution:Flow.RESOLUTION}).setStrict(!1),this.voice.addTickables(this.subNotes),this}getCategory(){return NoteSubGroup$1.CATEGORY}preFormat(){this.preFormatted||(this.formatter.joinVoices([this.voice]).format([this.voice],0),this.setWidth(this.formatter.getMinTotalWidth()),this.preFormatted=!0)}setNote(R){this.note=R}setWidth(R){this.width=R}getWidth(){return this.width}draw(){this.checkContext();const R=this.getNote();if(!(R&&this.index!==null))throw new Vex.RuntimeError("NoAttachedNote","Can't draw notes without a parent note and parent note index.");this.setRendered(),this.alignSubNotesWithNote(this.subNotes,R),this.subNotes.forEach(F=>F.setContext(this.context).drawWithStyle())}}class StaveTie extends Element$1{constructor(R,F){super(),this.setAttribute("type","StaveTie"),this.notes=R,this.context=null,this.text=F,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:15,style:""}},this.font=this.render_options.font,this.setNotes(R)}setFont(R){return this.font=R,this}setDirection(R){return this.direction=R,this}setNotes(R){if(!R.first_note&&!R.last_note)throw new Vex.RuntimeError("BadArguments","Tie needs to have either first_note or last_note set.");if(R.first_indices||(R.first_indices=[0]),R.last_indices||(R.last_indices=[0]),R.first_indices.length!==R.last_indices.length)throw new Vex.RuntimeError("BadArguments","Tied notes must have similar index sizes");return this.first_note=R.first_note,this.first_indices=R.first_indices,this.last_note=R.last_note,this.last_indices=R.last_indices,this}isPartial(){return!this.first_note||!this.last_note}renderTie(R){if(R.first_ys.length===0||R.last_ys.length===0)throw new Vex.RERR("BadArguments","No Y-values to render");const F=this.context;let D=this.render_options.cp1,G=this.render_options.cp2;Math.abs(R.last_x_px-R.first_x_px)<10&&(D=2,G=8);const U=this.render_options.first_x_shift,W=this.render_options.last_x_shift,q=this.render_options.y_shift*R.direction;for(let Y=0;Yte&&Math.abs(Z-te)<10?-6:0;if(this.first_note&&this.first_note.DYMusicScoreType==="jianpu"){if(this.getAttribute("type")==="TabTie")continue;Z1){const F=new Beam$1(R);F.render_options.beam_width=3,F.render_options.partial_beam_length=4,this.beams.push(F)}return this}setNote(R){this.note=R}setWidth(R){this.width=R}getWidth(){return this.width}getGraceNotes(){return this.grace_notes}draw(){this.checkContext();const R=this.getNote();if(L$f("Drawing grace note group for:",R),!(R&&this.index!==null))throw new Vex.RuntimeError("NoAttachedNote","Can't draw grace note without a parent note and parent note index.");if(this.setRendered(),this.alignSubNotesWithNote(this.getGraceNotes(),R),this.grace_notes.forEach(F=>{F.setContext(this.context).draw()}),this.beams.forEach(F=>{F.setContext(this.context).draw()}),this.show_slur){const F=this.getNote().getCategory()===StaveNote.CATEGORY,D=F?StaveTie:TabTie;this.slur=new D({last_note:this.grace_notes[0],first_note:R,first_indices:[0],last_indices:[0]}),this.slur.render_options.cp2=12,this.slur.render_options.y_shift=(F?7:5)+this.render_options.slur_y_shift,this.slur.setContext(this.context).draw()}}}class Stroke extends Modifier{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(R,F){const D=F.left_shift,G=0;if(!R||R.length===0)return this;const U=R.map(Y=>{const J=Y.getNote();if(J instanceof StaveNote){const{line:Z,displaced:K}=J.getKeyProps()[Y.getIndex()],te=K?J.getExtraLeftPx():0;return{line:Z,shift:te,stroke:Y}}else{const{str:Z}=J.getPositions()[Y.getIndex()];return{line:Z,shift:0,stroke:Y}}}),W=D,q=U.reduce((Y,{stroke:J,shift:Z})=>(J.setXShift(W+Z),Math.max(J.getWidth()+G,Y)),0);return F.left_shift+=q,!0}constructor(R,F){super(),this.setAttribute("type","Stroke"),this.note=null,this.options=Vex.Merge({},F),this.all_voices="all_voices"in this.options?this.options.all_voices:!0,this.note_end=null,this.index=null,this.type=R,this.position=Modifier.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 Stroke.CATEGORY}getPosition(){return this.position}addEndNote(R){return this.note_end=R,this}draw(){if(this.checkContext(),this.setRendered(),!(this.note&&this.index!=null))throw new Vex.RERR("NoAttachedNote","Can't draw stroke without a note and index.");const R=this.note.getModifierStartXY(this.position,this.index);let F=this.note.getYs(),D=R.y,G=R.y;const U=R.x-5,W=this.note.stave.options.spacing_between_lines_px,q=this.getModifierContext().getModifiers(this.note.getCategory());for(let Q=0;Qfe.line-he.line);let se=0,ne=0,re=0,ae=null,ce=null;for(Z=0;Zne?he:ne):Q===Modifier.Position.RIGHT&&(K.setXShift(se),he+=ue,re=he>re?he:re),ae=fe,ce=te}return F.left_shift+=ne,F.right_shift+=re,!0}constructor(R){super(),this.setAttribute("type","StringNumber"),this.note=null,this.last_note=null,this.index=null,this.string_number=R,this.setWidth(20),this.position=Modifier.Position.ABOVE,this.x_shift=0,this.y_shift=0,this.x_offset=0,this.y_offset=0,this.dashed=!0,this.leg=Renderer.LineEndType.NONE,this.radius=8,this.font={family:"sans-serif",size:10,weight:"bold"}}getCategory(){return StringNumber.CATEGORY}getNote(){return this.note}setNote(R){return this.note=R,this}getIndex(){return this.index}setIndex(R){return this.index=R,this}setLineEndType(R){return R>=Renderer.LineEndType.NONE&&R<=Renderer.LineEndType.DOWN&&(this.leg=R),this}setStringNumber(R){return this.string_number=R,this}setOffsetX(R){return this.x_offset=R,this}setOffsetY(R){return this.y_offset=R,this}setLastNote(R){return this.last_note=R,this}setDashed(R){return this.dashed=R,this}draw(){const R=this.checkContext();if(!(this.note&&this.index!=null))throw new Vex.RERR("NoAttachedNote","Can't draw string number without a note and index.");this.setRendered();const F=this.note.stave.options.spacing_between_lines_px,D=this.note.getModifierStartXY(this.position,this.index);let G=D.x+this.x_shift+this.x_offset,U=D.y+this.y_shift+this.y_offset;switch(this.position){case Modifier.Position.ABOVE:case Modifier.Position.BELOW:{const q=this.note.getStemExtents();let Y=q.topY,J=q.baseY+2;this.note.stem_direction===StaveNote.STEM_DOWN&&(Y=q.baseY,J=q.topY-2),this.position===Modifier.Position.ABOVE?U=this.note.hasStem()?Y-F*1.75:D.y-F*1.75:U=this.note.hasStem()?J+F*1.5:D.y+F*1.75,U+=this.y_shift+this.y_offset;break}case Modifier.Position.LEFT:G-=this.radius/2+5;break;case Modifier.Position.RIGHT:G+=this.radius/2+6;break;default:throw new Vex.RERR("InvalidPosition",`The position ${this.position} is invalid`)}R.save(),R.beginPath(),R.arc(G,U,this.radius,0,Math.PI*2,!1),R.lineWidth=1.5,R.stroke(),R.setFont(this.font.family,this.font.size,this.font.weight);const W=G-R.measureText(this.string_number).width/2;if(R.fillText(""+this.string_number,W,U+4.5),this.last_note!=null){const q=this.last_note.getStemX()-this.note.getX()+5;R.strokeStyle="#000000",R.lineCap="round",R.lineWidth=.6,this.dashed?Renderer.drawDashedLine(R,G+10,U,G+q,U,[3,3]):Renderer.drawDashedLine(R,G+10,U,G+q,U,[3,0]);let Y,J;switch(this.leg){case Renderer.LineEndType.UP:Y=-10,J=this.dashed?[3,3]:[3,0],Renderer.drawDashedLine(R,G+q,U,G+q,U+Y,J);break;case Renderer.LineEndType.DOWN:Y=10,J=this.dashed?[3,3]:[3,0],Renderer.drawDashedLine(R,G+q,U,G+q,U+Y,J);break}}R.restore()}}function L$e(...B){Articulation$1.DEBUG&&Vex.L("Vex.Flow.Articulation",B)}const{ABOVE,BELOW}=Modifier.Position,roundToNearestHalf=(B,R)=>B(R/.5)*.5,isWithinLines=(B,R)=>R===ABOVE?B<=5:B>=1,getRoundingFunction=(B,R)=>isWithinLines(B,R)?R===ABOVE?Math.ceil:Math.floor:Math.round,snapLineToStaff=(B,R,F,D)=>{const G=roundToNearestHalf(getRoundingFunction(R,F),R),U=B&&isWithinLines(G,F),W=G%1===0;return U&&W?G+.5*-D:G},isStaveNote=B=>{const R=B.getCategory();return R==="stavenotes"||R==="gracenotes"},isTabNote=B=>{const R=B.getCategory();return R==="tabnotes"||R==="numberednotes"},getTopY=(B,R)=>{const F=B.getStave(),D=B.getStemDirection(),{topY:G,baseY:U}=B.getStemExtents();if(isStaveNote(B))return B.hasStem()?D===Stem.UP?G:U:Math.min(...B.getYs());if(isTabNote(B))return B.hasStem()&&D===Stem.UP?G:F.getYForTopText(R);throw new Vex.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")},getBottomY=(B,R)=>{const F=B.getStave(),D=B.getStemDirection(),{topY:G,baseY:U}=B.getStemExtents();if(isStaveNote(B))return B.hasStem()?D===Stem.UP?U:G:Math.max(...B.getYs());if(isTabNote(B))return B.hasStem()?D===Stem.UP?F.getYForBottomText(R):G:F.getYForBottomText(R);throw new Vex.RERR("UnknownCategory","Only can get the top and bottom ys of stavenotes and tabnotes")},getInitialOffset=(B,R)=>{const F=R===ABOVE&&B.getStemDirection()===Stem.UP||R===BELOW&&B.getStemDirection()===Stem.DOWN;return isStaveNote(B)?B.hasStem()&&F?.5:1:B.hasStem()&&F?1:0};class Articulation$1 extends Modifier{static get CATEGORY(){return"articulations"}static get INITIAL_OFFSET(){return-.5}static format(R,F){if(!R||R.length===0)return!1;const D=Y=>Y.getPosition()===ABOVE,G=Y=>Y.getPosition()===BELOW,U=.5,W=(Y,J,Z)=>roundToNearestHalf(getRoundingFunction(J,Z),Y.glyph.getMetrics().height/10+U);R.filter(D).forEach(Y=>{Y.setTextLine(F.top_text_line),F.top_text_line+=W(Y,F.top_text_line,ABOVE)}),R.filter(G).forEach(Y=>{Y.setTextLine(F.text_line),F.text_line+=W(Y,F.text_line,BELOW)});const q=R.map(Y=>Y.getWidth()).reduce((Y,J)=>Math.max(J,Y));return F.left_shift+=q/2,F.right_shift+=q/2,!0}static easyScoreHook({articulations:R},F,D){if(!R)return;const G={staccato:"a.",tenuto:"a-"};R.split(",").map(U=>U.trim().split(".")).map(([U,W])=>{const q={type:G[U]};return W&&(q.position=Modifier.PositionString[W]),D.getFactory().Articulation(q)}).map(U=>F.addModifier(0,U))}constructor(R){if(super(),this.setAttribute("type","Articulation"),this.note=null,this.index=null,this.type=R,this.position=BELOW,this.render_options={font_scale:38},this.articulation=Flow.articulationCodes(this.type),!this.articulation)throw new Vex.RERR("ArgumentError",`Articulation not found: ${this.type}`);this.glyph=new Glyph(this.articulation.code,this.render_options.font_scale),this.setWidth(this.glyph.getMetrics().width)}getCategory(){return Articulation$1.CATEGORY}draw(){const{note:R,index:F,position:D,glyph:G,articulation:{between_lines:U},text_line:W,context:q}=this;if(this.checkContext(),!R||F==null)throw new Vex.RERR("NoAttachedNote","Can't draw Articulation without a note and index.");this.setRendered();const Y=R.getStave(),J=Y.getSpacingBetweenLines(),Z=R.getCategory()==="tabnotes",{x:K}=R.getModifierStartXY(D,F),te=!U||Z,Q=getInitialOffset(R,D);let ie={[ABOVE]:()=>{G.setOrigin(.5,1);const se=getTopY(R,W)-(W+Q)*J+(this.y_shift||0);return te?Math.min(Y.getYForTopText(Articulation$1.INITIAL_OFFSET),se):se},[BELOW]:()=>{G.setOrigin(.5,0);const se=getBottomY(R,W)+(W+Q)*J;return te?Math.max(Y.getYForBottomText(Articulation$1.INITIAL_OFFSET),se):se}}[D]();if(!Z){const se=D===ABOVE?-1:1,ne=Z?R.positions[F].str:R.getKeyProps()[F].line,ae=(R.getYs()[F]-ie)/J+ne,ce=snapLineToStaff(U,ae,D,se);isWithinLines(ce,D)&&G.setOrigin(.5,.5),ie+=Math.abs(ce-ae)*J*se}L$e(`Rendering articulation at (x: ${K}, y: ${ie})`),G.render(q,K,ie)}}class TickContext extends Tickable{static getNextContext(R){const F=R.tContexts,D=F.indexOf(R);return F[D+1]}constructor(){super(),this.setAttribute("type","TickContext"),this.currentTick=new Fraction(0,1),this.maxTicks=new Fraction(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(R){return this.x=R,this.xBase=R,this.xOffset=0,this}getXBase(){return this.xBase}setXBase(R){this.xBase=R,this.x=R+this.xOffset}getXOffset(){return this.xOffset}setXOffset(R){this.xOffset=R,this.x=this.xBase+R}getWidth(){return this.width+this.padding*2}setPadding(R){return this.padding=R,this}getMaxTicks(){return this.maxTicks}getMinTicks(){return this.minTicks}getTickables(){return this.tickables}getCenterAlignedTickables(){return this.tickables.filter(R=>R.isCenterAligned())}getMetrics(){const{width:R,notePx:F,extraLeftPx:D,extraRightPx:G}=this;return{width:R,notePx:F,extraLeftPx:D,extraRightPx:G}}getCurrentTick(){return this.currentTick}setCurrentTick(R){this.currentTick=R,this.preFormatted=!1}getExtraPx(){let R=0,F=0,D=0,G=0;for(let U=0;U0&&G--;for(let Y=0;Y{L$b("Preformatting ModifierContext: ",R.CATEGORY),R.format(this.getModifiers(R.CATEGORY),this.state,this)}),this.width=this.state.left_shift+this.state.right_shift,this.preFormatted=!0)}postFormat(){this.postFormatted||this.POSTFORMAT.forEach(R=>{L$b("Postformatting ModifierContext: ",R.CATEGORY),R.postFormat(this.getModifiers(R.CATEGORY),this)})}}function L$a(...B){Formatter.DEBUG&&Vex.L("Vex.Flow.Formatter",B)}function getNext(B,R){var D,G;const F=B[R+1];return F&&((D=F==null?void 0:F.keys)==null?void 0:D.includes("b/4"))||((G=F==null?void 0:F.keys)==null?void 0:G.includes("r/4"))?getNext(B,R+1):F}function lookAhead(B,R,F,D,G=0){let U=R;for(F+=1;F4.5||U<1.5)){const q=B[F].stem;if(q)if(q.stem_direction>0){const Y=U<1.5?Math.abs(U-1.5)*G:0;q.setResetHeight(Y)}else{const Y=U>4.5?Math.abs(U-4.5)*G:0;q.setResetHeight(Y)}}return U}function createContexts(B,R,F){if(!B||!B.length)throw new Vex.RERR("BadArgument","No voices to format");const D=B[0].getTotalTicks(),G=B.reduce((Y,J)=>{if(!J.getTotalTicks().equals(D))throw new Vex.RERR("TickMismatch","Voices should have same total note duration in ticks.");if(J.getMode()===Voice$1.Mode.STRICT&&!J.isComplete())throw new Vex.RERR("IncompleteVoice","Voice does not have enough notes.");return Math.max(Y,Fraction.LCM(Y,J.getResolutionMultiplier()))},1),U={},W=[],q=[];return B.forEach(Y=>{const J=new Fraction(0,G);Y.getTickables().forEach(Z=>{const K=J.numerator;if(!U[K]){const te=new R;q.push(te),U[K]=te}F(Z,U[K]),W.push(K),J.add(Z.getTicks())})}),{map:U,array:q,list:Vex.SortAndUnique(W,(Y,J)=>Y-J,(Y,J)=>Y===J),resolutionMultiplier:G}}class Formatter{static SimpleFormat(R,F=0,{paddingBetween:D=10}={}){R.reduce((G,U)=>{U.addToModifierContext(new ModifierContext);const W=new TickContext().addTickable(U).preFormat(),q=W.getExtraPx();return W.setX(G+q.left),G+W.getWidth()+q.right+D},F)}static plotDebugging(R,F,D,G,U){const W=D+Note.STAVEPADDING,q=F.contextGaps;function Y(J,Z,K){R.beginPath(),R.setStrokeStyle(K),R.setFillStyle(K),R.setLineWidth(1),R.fillRect(J,G,Z-J,U-G)}R.save(),R.setFont("Arial",8,""),q.gaps.forEach(J=>{Y(W+J.x1,W+J.x2,"#aaa"),R.fillText(Math.round(J.x2-J.x1),W+J.x1,U+12)}),R.fillText(Math.round(q.total)+"px",W-20,U+12),R.setFillStyle("red"),R.fillText("Loss: "+F.lossHistory.map(J=>Math.round(J)),W-20,U+22),R.restore()}static FormatAndDraw(R,F,D,G){const U={auto_beam:!1,align_rests:!1};typeof G=="object"?Vex.Merge(U,G):typeof G=="boolean"&&(U.auto_beam=G);const W=new Voice$1(Flow.TIME4_4).setMode(Voice$1.Mode.SOFT).addTickables(D),q=U.auto_beam?Beam$1.applyAndGetBeams(W):[];return new Formatter().joinVoices([W],{align_rests:U.align_rests}).formatToStave([W],F,{align_rests:U.align_rests,stave:F}),W.setStave(F).draw(R,F),q.forEach(Y=>Y.setContext(R).draw()),W.getBoundingBox()}static FormatAndDrawTab(R,F,D,G,U,W,q){const Y={auto_beam:W,align_rests:!1};typeof q=="object"?Vex.Merge(Y,q):typeof q=="boolean"&&(Y.auto_beam=q);const J=new Voice$1(Flow.TIME4_4).setMode(Voice$1.Mode.SOFT).addTickables(U),Z=new Voice$1(Flow.TIME4_4).setMode(Voice$1.Mode.SOFT).addTickables(G),K=Y.auto_beam?Beam$1.applyAndGetBeams(J):[];new Formatter().joinVoices([J],{align_rests:Y.align_rests}).joinVoices([Z]).formatToStave([J,Z],D,{align_rests:Y.align_rests}),J.draw(R,D),Z.draw(R,F),K.forEach(te=>te.setContext(R).draw()),new StaveConnector(D,F).setContext(R).draw()}static AlignRestsToNotes(R,F,D){return R.forEach((G,U)=>{if(G instanceof StaveNote&&G.isRest()){if(G.tuplet&&!D)return;if(G.getGlyph().position.toUpperCase(),G.glyph.code_head==="va5"||G.glyph.code_head==="v3c"){const W=G.glyph.code_head==="va5"?10:20,q=R[U-1],Y=getNext(R,U);let J=!1;if(q&&Y&&q.beam&&Y.beam&&(J=q.beam.notes.includes(Y)),F||G.beam!=null||J){const Z=G.getKeyProps()[0];if(U===0)Z.line=lookAhead(R,Z.line,U,!1,W),G.setKeyLine(0,Z.line);else if(U>0&&UFormatter.AlignRestsToNotes(D.getTickables(),F))}preCalculateMinTotalWidth(R){if(this.hasMinTotalWidth)return this.minTotalWidth;if(!this.tickContexts){if(!R)throw new Vex.RERR("BadArgument","'voices' required to run preCalculateMinTotalWidth");this.createTickContexts(R)}const{list:F,map:D}=this.tickContexts;return this.minTotalWidth=F.map(G=>{const U=D[G];return U.preFormat(),U.getWidth()}).reduce((G,U)=>G+U,0),this.hasMinTotalWidth=!0,this.minTotalWidth}getMinTotalWidth(){if(!this.hasMinTotalWidth)throw new Vex.RERR("NoMinTotalWidth","Call 'preCalculateMinTotalWidth' or 'preFormat' before calling 'getMinTotalWidth'");return this.minTotalWidth}createModifierContexts(R){const F=createContexts(R,ModifierContext,(D,G)=>D.addToModifierContext(G));return this.modiferContexts=F,F}createTickContexts(R){const F=createContexts(R,TickContext,(D,G)=>G.addTickable(D));return F.array.forEach(D=>{D.tContexts=F.array}),this.totalTicks=R[0].getTicksUsed().clone(),this.tickContexts=F,F}preFormat(R=0,F,D,G){const U=this.tickContexts,{list:W,map:q,resolutionMultiplier:Y}=U;D&&G&&D.forEach(se=>se.setStave(G).preFormat());let J=0,Z=0;const K=R/2;if(this.minTotalWidth=0,W.forEach(se=>{const ne=q[se];F&&ne.setContext(F),ne.preFormat();const re=ne.getWidth();this.minTotalWidth+=re;const ae=ne.getMetrics();J=J+Z+ae.extraLeftPx,ne.setX(J),Z=re-ae.extraLeftPx}),this.minTotalWidth=J+Z,this.hasMinTotalWidth=!0,R<=0)return;const Q=(R-this.minTotalWidth)/(this.totalTicks.value()*Y);let ie=0;W.forEach((se,ne)=>{const re=W[ne-1]||0,ae=q[se];ie+=(se-re)*Q,ae.setX(ae.getX()+ie),ae.getCenterAlignedTickables().forEach(he=>{he.center_x_shift=K-ae.getX()})}),W.length!==1&&(this.justifyWidth=R,this.lossHistory=[],this.evaluate())}evaluate(){const R=this.justifyWidth;this.contextGaps={total:0,gaps:[]},this.tickContexts.list.forEach((U,W)=>{if(W===0)return;const q=this.tickContexts.list[W-1],Y=this.tickContexts.map[q],J=this.tickContexts.map[U],Z=Y.getMetrics(),K=Y.getX()+Z.width,te=J.getX(),Q=te-K;this.contextGaps.total+=Q,this.contextGaps.gaps.push({x1:K,x2:te}),J.getFormatterMetrics().freedom.left=Q,Y.getFormatterMetrics().freedom.right=Q});const F=this.durationStats={};function D(U,W){const q=F[U];q===void 0?F[U]={mean:W,count:1}:(q.count+=1,q.mean=(q.mean+W)/2)}this.voices.forEach(U=>{U.getTickables().forEach((W,q,Y)=>{const J=W.getTicks().clone().simplify().toString(),Z=W.getMetrics(),K=W.getFormatterMetrics(),te=W.getX()+Z.noteWidth+Z.modRightPx+Z.extraRightPx;let Q=0;if(q{U.getTickables().forEach(W=>{const q=W.getTicks().clone().simplify().toString(),Y=W.getFormatterMetrics();Y.iterations+=1,Y.space.deviation=Y.space.used-F[q].mean,Y.duration=q,Y.space.mean=F[q].mean,G+=Math.pow(F[q].mean,2)})}),this.totalCost=Math.sqrt(G),this.lossHistory.push(this.totalCost),this}tune(){const R=G=>G.reduce((U,W)=>U+W);function F(G,U,W,q){G.setX(G.getX()+q),G.getFormatterMetrics().freedom.left+=q,G.getFormatterMetrics().freedom.right-=q,U&&(U.getFormatterMetrics().freedom.right+=q),W&&(W.getFormatterMetrics().freedom.left-=q)}let D=0;return this.tickContexts.list.forEach((G,U,W)=>{const q=this.tickContexts.map[G],Y=U>0?this.tickContexts.map[W[U-1]]:null,J=Ute.getFormatterMetrics().space.deviation));Z>0?D=-Math.min(q.getFormatterMetrics().freedom.right,Math.abs(Z)):Z<0&&(J?D=Math.min(J.getFormatterMetrics().freedom.right,Math.abs(Z)):D=0);const K=Math.min(5,Math.abs(D));D=D>0?K:-K}),this.evaluate()}postFormat(){const R=F=>F.list.forEach(D=>F.map[D].postFormat());return R(this.modiferContexts),R(this.tickContexts),this}joinVoices(R){return this.createModifierContexts(R),this.hasMinTotalWidth=!1,this}format(R,F,D){const G={align_rests:!1,context:null,stave:null};return Vex.Merge(G,D),this.voices=R,this.alignRests(R,G.align_rests),this.createTickContexts(R),this.preFormat(F,G.context,R,G.stave),G.stave&&this.postFormat(),this}formatToStave(R,F,D){const G=F.getNoteEndX()-F.getNoteStartX()-10;L$a("Formatting voices to width: ",G);const U={context:F.getContext()};return Vex.Merge(U,D),this.format(R,G,U)}}class StaveModifier extends Element$1{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=StaveModifier.Position.ABOVE,this.layoutMetrics=null}getPosition(){return this.position}setPosition(R){return this.position=R,this}getStave(){return this.stave}setStave(R){return this.stave=R,this}getWidth(){return this.width}setWidth(R){return this.width=R,this}getX(){return this.x}setX(R){return this.x=R,this}getCategory(){return""}makeSpacer(R){return{getContext(){return!0},setStave(){},renderToStave(){},getMetrics(){return{width:R}}}}placeGlyphOnLine(R,F,D){R.setYShift(F.getYForLine(D)-F.getYForGlyphs())}getPadding(R){return R!==void 0&&R<2?0:this.padding}setPadding(R){return this.padding=R,this}setLayoutMetrics(R){return this.layoutMetrics=R,this}getLayoutMetrics(){return this.layoutMetrics}}class Barline extends StaveModifier{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:Barline.type.SINGLE,double:Barline.type.DOUBLE,end:Barline.type.END,repeatBegin:Barline.type.REPEAT_BEGIN,repeatEnd:Barline.type.REPEAT_END,repeatBoth:Barline.type.REPEAT_BOTH,none:Barline.type.NONE}}constructor(R){super(),this.setAttribute("type","Barline"),this.thickness=Flow.STAVE_LINE_THICKNESS;const F=Barline.type;this.widths={},this.widths[F.SINGLE]=5,this.widths[F.DOUBLE]=5,this.widths[F.END]=5,this.widths[F.REPEAT_BEGIN]=5,this.widths[F.REPEAT_END]=5,this.widths[F.REPEAT_BOTH]=5,this.widths[F.NONE]=5,this.paddings={},this.paddings[F.SINGLE]=0,this.paddings[F.DOUBLE]=0,this.paddings[F.END]=0,this.paddings[F.REPEAT_BEGIN]=15,this.paddings[F.REPEAT_END]=15,this.paddings[F.REPEAT_BOTH]=15,this.paddings[F.NONE]=0,this.layoutMetricsMap={},this.layoutMetricsMap[F.SINGLE]={xMin:0,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[F.DOUBLE]={xMin:-3,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[F.END]={xMin:-5,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[F.REPEAT_END]={xMin:-10,xMax:1,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[F.REPEAT_BEGIN]={xMin:-2,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[F.REPEAT_BOTH]={xMin:-10,xMax:10,paddingLeft:5,paddingRight:5},this.layoutMetricsMap[F.NONE]={xMin:0,xMax:0,paddingLeft:5,paddingRight:5},this.setPosition(StaveModifier.Position.BEGIN),this.setType(R)}getCategory(){return Barline.CATEGORY}getType(){return this.type}setType(R){return this.type=typeof R=="string"?Barline.typeString[R]:R,this.setWidth(this.widths[this.type]),this.setPadding(this.paddings[this.type]),this.setLayoutMetrics(this.layoutMetricsMap[this.type]),this}draw(R){switch(R.checkContext(),this.setRendered(),this.type){case Barline.type.SINGLE:this.drawVerticalBar(R,this.x,!1);break;case Barline.type.DOUBLE:this.drawVerticalBar(R,this.x,!0);break;case Barline.type.END:this.drawVerticalEndBar(R,this.x);break;case Barline.type.REPEAT_BEGIN:this.drawRepeatBar(R,this.x,!0),R.getX()!==this.x&&this.drawVerticalBar(R,R.getX());break;case Barline.type.REPEAT_END:this.drawRepeatBar(R,this.x,!1);break;case Barline.type.REPEAT_BOTH:this.drawRepeatBar(R,this.x,!1),this.drawRepeatBar(R,this.x,!0);break}}drawVerticalBar(R,F,D){R.checkContext();const G=R.getTopLineTopY(),U=R.getBottomLineBottomY();D&&R.context.fillRect(F-3,G,1,U-G),R.context.fillRect(F,G,1,U-G)}drawVerticalEndBar(R,F){R.checkContext();const D=R.getTopLineTopY(),G=R.getBottomLineBottomY();R.context.fillRect(F-5,D,1,G-D),R.context.fillRect(F-2,D,3,G-D)}drawRepeatBar(R,F,D){R.checkContext();const G=R.getTopLineTopY(),U=R.getBottomLineBottomY();let W=3;D||(W=-5),R.context.fillRect(F+W,G,1,U-G),R.context.fillRect(F-2,G,3,U-G);const q=2;D?W+=4:W-=4;const Y=F+W+q/2;let J=(R.getNumLines()-1)*R.getSpacingBetweenLines();J=J/2-R.getSpacingBetweenLines()/2;let Z=G+J+q/2;R.context.beginPath(),R.context.arc(Y,Z,q,0,Math.PI*2,!1),R.context.fill(),Z+=R.getSpacingBetweenLines(),R.context.beginPath(),R.context.arc(Y,Z,q,0,Math.PI*2,!1),R.context.fill()}}class Repetition$1 extends StaveModifier{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(R,F,D){super(),this.setAttribute("type","Repetition"),this.symbol_type=R,this.x=F,this.x_shift=0,this.y_shift=D,this.font={family:"times",size:12,weight:"bold italic"}}getCategory(){return Repetition$1.CATEGORY}setShiftX(R){return this.x_shift=R,this}setShiftY(R){return this.y_shift=R,this}setX(R){return this.x=R,this}draw(R,F){switch(this.setRendered(),this.symbol_type){case Repetition$1.type.CODA_RIGHT:this.drawCodaFixed(R,F+R.width);break;case Repetition$1.type.CODA_LEFT:this.drawSymbolText(R,F,"Coda",!1);break;case Repetition$1.type.SEGNO_LEFT:this.drawSignoFixed(R,F);break;case Repetition$1.type.SEGNO_RIGHT:this.drawSignoFixed(R,F+R.width);break;case Repetition$1.type.DC:this.drawSymbolText(R,F,"D.C.",!1);break;case Repetition$1.type.DC_AL_CODA:this.drawSymbolText(R,F,"D.C. al Coda",!0);break;case Repetition$1.type.DC_AL_FINE:this.drawSymbolText(R,F,"D.C. al Fine",!1);break;case Repetition$1.type.DS:this.drawSymbolText(R,F,"D.S.",!1);break;case Repetition$1.type.DS_AL_CODA:this.drawSymbolText(R,F,"D.S. al Coda",!0);break;case Repetition$1.type.DS_AL_FINE:this.drawSymbolText(R,F,"D.S. al Fine",!1);break;case Repetition$1.type.FINE:this.drawSymbolText(R,F,"Fine",!1);break;case Repetition$1.type.TO_CODA:this.drawSymbolText(R,F,"To Coda",!0);break}return this}drawCodaFixed(R,F){const D=R.getYForTopText(R.options.num_lines)+this.y_shift;return Glyph.renderGlyph(R.context,this.x+F+this.x_shift,D+25,40,"v4d",!0),this}drawSignoFixed(R,F){const D=R.getYForTopText(R.options.num_lines)+this.y_shift;return Glyph.renderGlyph(R.context,this.x+F+this.x_shift,D+25,30,"v8c",!0),this}drawSymbolText(R,F,D,G){const U=R.checkContext();U.save(),U.setFont(this.font.family,this.font.size,this.font.weight);let W=0+this.x_shift,q=F+this.x_shift;this.symbol_type===Repetition$1.type.CODA_LEFT?(W=this.x+R.options.vertical_bar_width,q=W+U.measureText(D).width+12):(this.x_shift=-(W+U.measureText(D).width+12+R.options.vertical_bar_width+12),W=this.x+this.x_shift+R.options.vertical_bar_width,q=W+U.measureText(D).width+12);const Y=R.getYForTopText(R.options.num_lines)+this.y_shift+25;return G&&Glyph.renderGlyph(U,q,Y,40,"v4d",!0),U.fillText(D,W,Y+5),U.restore(),this}}class StaveSection extends StaveModifier{static get CATEGORY(){return"stavesection"}constructor(R,F,D){super(),this.setAttribute("type","StaveSection"),this.setWidth(16),this.section=R,this.x=F,this.shift_x=0,this.shift_y=D,this.font={family:"sans-serif",size:12,weight:"bold"}}getCategory(){return StaveSection.CATEGORY}setStaveSection(R){return this.section=R,this}setShiftX(R){return this.shift_x=R,this}setShiftY(R){return this.shift_y=R,this}draw(R,F){const D=R.checkContext();this.setRendered(),D.save(),D.lineWidth=2,D.setFont(this.font.family,this.font.size,this.font.weight);const G=D.measureText(""+this.section),U=G.width,W=G.height;let q=U+6;q<18&&(q=18);const Y=W,J=R.getYForTopText(3)+this.shift_y;let Z=this.x+F;return D.beginPath(),D.lineWidth=2,D.rect(Z,J+W/4,q,Y),D.stroke(),Z+=(q-U)/2,D.fillText(""+this.section,Z,J+16),D.restore(),this}}class StaveTempo extends StaveModifier{static get CATEGORY(){return"stavetempo"}constructor(R,F,D){super(),this.setAttribute("type","StaveTempo"),this.tempo=R,this.position=Modifier.Position.ABOVE,this.x=F,this.shift_x=10,this.shift_y=D,this.font={family:"times",size:14,weight:"bold"},this.render_options={glyph_font_scale:30}}getCategory(){return StaveTempo.CATEGORY}setTempo(R){return this.tempo=R,this}setShiftX(R){return this.shift_x=R,this}setShiftY(R){return this.shift_y=R,this}draw(R,F){const D=R.checkContext();this.setRendered();const G=this.render_options,U=G.glyph_font_scale/38,W=this.tempo.name,q=this.tempo.duration,Y=this.tempo.dots,J=this.tempo.bpm,Z=this.font;let K=this.x+this.shift_x+F;const te=R.getYForTopText(1)+this.shift_y;if(D.save(),D.openGroup("stavetempo",null,{}),W&&(D.setFont(Z.family,Z.size,Z.weight),D.fillText(W,K,te),K+=D.measureText(W).width),q&&J){D.setFont(Z.family,Z.size,"normal"),W&&(K+=D.measureText(" ").width,D.fillText("(",K,te),K+=D.measureText("(").width);const Q=Flow.getGlyphProps(q);if(K+=3*U,Glyph.renderGlyph(D,K,te,G.glyph_font_scale,Q.code_head),K+=Q.getWidth()*U,Q.stem){let ie=30;Q.beam_count&&(ie+=3*(Q.beam_count-1)),ie*=U;const se=te-ie;D.fillRect(K-U,se,U,ie),Q.flag&&(Glyph.renderGlyph(D,K,se,G.glyph_font_scale,Q.code_flag_upstem),Y||(K+=6*U))}for(let ie=0;ie=R.line?Y.above:Y.below)}this.placeGlyphOnLine(G,this.stave,R.line),this.glyphs.push(G);const W=this.xPositions[this.xPositions.length-1],q=G.getMetrics().width+U;this.xPositions.push(W+q),this.width+=q}cancelKey(R){return this.formatted=!1,this.cancelKeySpec=R,this}convertToCancelAccList(R){const F=Flow.keySignature(R),D=this.accList.length>0&&F.length>0&&F[0].type!==this.accList[0].type,G=D?F.length:F.length-this.accList.length;if(G<1)return;const U=[];for(let W=0;W0?R[0].type:null;let D;if(this.cancelKeySpec&&(D=this.convertToCancelAccList(this.cancelKeySpec)),this.alterKeySpec&&this.convertToAlterAccList(this.alterKeySpec),this.accList.length>0){const G=(this.position===StaveModifier.Position.END?this.stave.endClef:this.stave.clef)||this.stave.clef;D&&this.convertAccLines(G,D.type,D.accList),this.convertAccLines(G,F,R);for(let U=0;U0){this.stave.context.openGroup("keysignature");for(let R=0;R{const R=B.split("/").filter(F=>F!=="");if(R.length!==2)throw new Vex.RERR("BadTimeSignature",`Invalid time spec: ${B}. Must be in the form "/"`);R.forEach(F=>{if(isNaN(Number(F)))throw new Vex.RERR("BadTimeSignature",`Invalid time spec: ${B}. Must contain two valid numbers.`)})};class TimeSignature extends StaveModifier{static get CATEGORY(){return"timesignatures"}static get glyphs(){return{C:{code:"v41",point:40,line:2},"C|":{code:"vb6",point:40,line:2}}}constructor(R=null,F=15,D=!0){if(super(),this.setAttribute("type","TimeSignature"),this.validate_args=D,R===null)return;const G=F;this.point=40,this.topLine=2,this.bottomLine=4,this.setPosition(StaveModifier.Position.BEGIN),this.setTimeSig(R),this.setWidth(this.timeSig.glyph.getMetrics().width),this.setPadding(G)}getCategory(){return TimeSignature.CATEGORY}parseTimeSpec(R){if(R==="C"||R==="C|"){const{line:G,code:U,point:W}=TimeSignature.glyphs[R];return{line:G,num:!1,glyph:new Glyph(U,W)}}this.validate_args&&assertIsValidFraction(R);const[F,D]=R.split("/").map(G=>G.split(""));return{num:!0,glyph:this.makeTimeSignatureGlyph(F,D)}}makeTimeSignatureGlyph(R,F){const D=new Glyph("v0",this.point);D.topGlyphs=[],D.botGlyphs=[];let G=0;for(let K=0;KU?G:U,q=D.getMetrics().x_min;D.getMetrics=()=>({x_min:q,x_max:q+W,width:W});const Y=(W-G)/2,J=(W-U)/2,Z=this;return D.renderToStave=function(te){let Q=te+Y;for(let ie=0;ieF.visible).filter(Boolean).length}getOptions(){return this.options}setNoteStartX(R){this.formatted||this.format(),this.setStartX(R);const F=this.modifiers[0];return F.setX(this.start_x-F.getWidth()),this}setStartX(R){this.start_x=R}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(R){return this.options.num_lines=parseInt(R,10),this.resetLines(),this}setY(R){return this.y=R,this}getTopLineTopY(){return this.getYForLine(0)-Flow.STAVE_LINE_THICKNESS/2}getBottomLineBottomY(){return this.getLines()===2?this.getYForLine(6)+Flow.STAVE_LINE_THICKNESS/2:this.getYForLine(this.getNumLines()-1)+Flow.STAVE_LINE_THICKNESS/2}setX(R){const F=R-this.x;this.formatted=!1,this.x=R,this.start_x+=F,this.end_x+=F;for(let D=0;DD.getWidth()&&(F-=D.getWidth()),F}setRepetitionTypeLeft(R,F){return this.modifiers.push(new Repetition$1(R,this.x,F)),this}setRepetitionTypeRight(R,F){return this.modifiers.push(new Repetition$1(R,this.x,F)),this}setVoltaType(R,F,D){if(R===2)volta.type===2&&volta.stave.modifiers.push(new Volta(volta.type,volta.number_t,volta.x,volta.y)),volta={stave:this,type:R,number_t:F,MeasureNumber:this.MeasureNumber,y:D,x:this.x};else if(R===4){let G=this.MeasureNumber-volta.MeasureNumber,U=Math.max(volta.y,D);for(let W=0;W<=G;W++)voltaMeasureNumber[volta.MeasureNumber+W]={type:W===0?2:W===G?4:0,number_t:F,y:U};volta={}}else this.modifiers.push(new Volta(R,F,this.x,D));return this}drawVolta(){let R=voltaMeasureNumber[this.MeasureNumber];R&&(this.modifiers.push(new Volta(R.type,R.number_t,this.x,R.y)),delete voltaMeasureNumber[this.MeasureNumber]),volta.type&&volta.MeasureNumber==this.MeasureNumber&&(this.modifiers.push(new Volta(volta.type,volta.number_t,this.x,volta.y)),volta={})}setSection(R,F,D=0,G=12){const U=new StaveSection(R,this.x+D,F);return U.font.size=G,this.modifiers.push(U),this}setTempo(R,F){return this.modifiers.push(new StaveTempo(R,this.x,F)),this}setText(R,F,D){let G=new StaveText(R,F,D);return G.setFont({family:"Arial",size:14,weight:"normal"}),this.modifiers.push(G),this}getHeight(){return this.height}getSpacingBetweenLines(){return this.options.spacing_between_lines_px}getBoundingBox(){return new BoundingBox(this.x,this.y,this.width,this.getBottomY()-this.y)}getBottomY(){const R=this.options,F=R.spacing_between_lines_px;return this.getYForLine(R.num_lines)+R.space_below_staff_ln*F}getBottomLineY(){return this.getYForLine(this.options.num_lines)}getYForLine(R){const F=this.options,D=F.spacing_between_lines_px,G=F.space_above_staff_ln;return this.y+R*D+G*D}getLineForY(R){const F=this.options,D=F.spacing_between_lines_px,G=F.space_above_staff_ln;return(R-this.y)/D-G}getYForTopText(R){const F=R||0;return this.getYForLine(-F-this.options.top_text_position)}getYForBottomText(R){const F=R||0;return this.getYForLine(this.options.bottom_text_position+F)}getYForNote(R){const F=this.options,D=F.spacing_between_lines_px,G=F.space_above_staff_ln;return this.y+G*D+5*D-R*D}getYForGlyphs(){return this.getYForLine(3)}addModifier(R,F,D){return F!==void 0&&R.setPosition(F),D&&(this.timeSignature.numerator=D.numerator,this.timeSignature.denominator=D.denominator),R.setStave(this),this.formatted=!1,this.modifiers.push(R),this}addEndModifier(R){return this.addModifier(R,StaveModifier.Position.END),this}setBegBarType(R){const{SINGLE:F,REPEAT_BEGIN:D,NONE:G}=Barline.type;return(R===F||R===D||R===G)&&(this.modifiers[0].setType(R),this.formatted=!1),this}setEndBarType(R){return R!==Barline.type.REPEAT_BEGIN&&(this.modifiers[1].setType(R),this.formatted=!1),this}setClef(R,F,D,G){G===void 0&&(G=StaveModifier.Position.BEGIN),G===StaveModifier.Position.END?this.endClef=R:this.clef=R;const U=this.getModifiers(G,Clef.CATEGORY);return U.length===0?this.addClef(R,F,D,G):U[0].setType(R,F,D),this}setEndClef(R,F,D){return this.setClef(R,F,D,StaveModifier.Position.END),this}setKeySignature(R,F,D){this.options.keySignature=R,D===void 0&&(D=StaveModifier.Position.BEGIN);const G=this.getModifiers(D,KeySignature.CATEGORY);return G.length===0?this.options.DYMusicScoreType!=="jianpu"&&this.addKeySignature(R,F,D):G[0].setKeySig(R,F),this}setEndKeySignature(R,F){return this.setKeySignature(R,F,StaveModifier.Position.END),this}setTimeSignature(R,F,D){D===void 0&&(D=StaveModifier.Position.BEGIN);const G=this.getModifiers(D,TimeSignature.CATEGORY);return G.length===0?this.addTimeSignature(R,F,D):G[0].setTimeSig(R),this}setEndTimeSignature(R,F){return this.setTimeSignature(R,F,StaveModifier.Position.END),this}addKeySignature(R,F,D){return D===void 0&&(D=StaveModifier.Position.BEGIN),this.addModifier(new KeySignature(R,F).setPosition(D),D),this}addClef(R,F,D,G){return G===void 0||G===StaveModifier.Position.BEGIN?this.clef=R:G===StaveModifier.Position.END&&(this.endClef=R),this.addModifier(new Clef(R,F,D),G),this}addEndClef(R,F,D){return this.addClef(R,F,D,StaveModifier.Position.END),this}addTimeSignature(R,F,D){return this.addModifier(new TimeSignature(R,F),D),this}addEndTimeSignature(R,F){return this.addTimeSignature(R,F,StaveModifier.Position.END),this}addTrebleGlyph(){return this.addClef("treble"),this}getModifiers(R,F){return R===void 0&&F===void 0?this.modifiers:this.modifiers.filter(D=>(R===void 0||R===D.getPosition())&&(F===void 0||F===D.getCategory()))}sortByCategory(R,F){for(let D=R.length-1;D>=0;D--)for(let G=0;GF[R[G+1].getCategory()]){const U=R[G];R[G]=R[G+1],R[G+1]=U}}format(){const R=this.modifiers[0],F=this.modifiers[1],D=this.getModifiers(StaveModifier.Position.BEGIN),G=this.getModifiers(StaveModifier.Position.END);this.sortByCategory(D,{barlines:0,clefs:1,keysignatures:2,timesignatures:3}),this.sortByCategory(G,{timesignatures:0,keysignatures:1,barlines:2,clefs:3}),D.length>1&&R.getType()===Barline.type.REPEAT_BEGIN&&(D.push(D.splice(0,1)[0]),D.splice(0,0,new Barline(Barline.type.SINGLE))),G.indexOf(F)>0&&G.splice(0,0,new Barline(Barline.type.NONE));let U,W,q,Y=0,J=this.x;for(let te=0;te{W.includes(Y)?q.visible=!0:q.visible=!1})}for(let W=0;Wthis.drawStaveTempo()),this.measure>0){this.context.save(),this.context.setFont(this.font.family,this.font.size,this.font.weight);const W=this.context.measureText(""+this.measure).width;G=this.getYForTopText(0)+3,this.context.fillText(""+this.measure,this.x-W/2,G),this.context.restore()}return this}drawStaveTempo(){if(!this.staveTempos.length)return;const R=document.querySelector(`#${this.attrs.id}`);if(!R)return;const F=R.parentElement.getBBox(),D=this.getYForLine(0),G=R.parentElement.parentElement.querySelectorAll(".vf-curve");if(G.length){const U=this.x+this.staveTempos[0].shift_x+this.getModifierXShift(0),W=this.getYForTopText(1)+F.y-D+5;G.forEach(q=>{const Y=q.getBBox();Y.x-10U&&Y.y-10W&&(F.y=Y.y+5)})}for(let U=0;U=0&&this.timeSignature.numerator){let R=40,F=0;this.MeasureNumber<2&&(R=70,F=-72),this.setText(`${this.timeSignature.numerator}`,1,{justification:1,shift_x:R,shift_y:F-13}),this.setText("\u1173",1,{justification:1,shift_x:R+3,shift_y:F-2}),this.setText(`${this.timeSignature.denominator}`,1,{justification:1,shift_x:R,shift_y:F+8})}}drawVertical(R,F){this.drawVerticalFixed(this.x+R,F)}drawVerticalFixed(R,F){this.checkContext();const D=this.getYForLine(0),G=this.getYForLine(this.options.num_lines-1);F&&this.context.fillRect(R-3,D,1,G-D+1),this.context.fillRect(R,D,1,G-D+1)}drawVerticalBar(R){this.drawVerticalBarFixed(this.x+R,!1)}drawVerticalBarFixed(R){this.checkContext();const F=this.getYForLine(0),D=this.getYForLine(this.options.num_lines-1);this.context.fillRect(R,F,1,D-F+1)}getConfigForLines(){return this.options.line_config}setConfigForLine(R,F){if(R>=this.options.num_lines||R<0)throw new Vex.RERR("StaveConfigError","The line number must be within the range of the number of lines in the Stave.");if(F.visible===void 0)throw new Vex.RERR("StaveConfigError","The line configuration object is missing the 'visible' property.");if(typeof F.visible!="boolean")throw new Vex.RERR("StaveConfigError","The line configuration objects 'visible' property must be true or false.");return this.options.line_config[R]=F,this}setConfigForLines(R){if(R.length!==this.options.num_lines)throw new Vex.RERR("StaveConfigError","The length of the lines configuration array must match the number of lines in the Stave");for(const F in R)R[F]||(R[F]=this.options.line_config[F]),Vex.Merge(this.options.line_config[F],R[F]);return this.options.line_config=R,this}}class TabStave extends Stave{constructor(R,F,D,G){const U={spacing_between_lines_px:13,num_lines:6,top_text_position:1};Vex.Merge(U,G),super(R,F,D,U),this.setAttribute("type","TabStave")}getYForGlyphs(){return this.getYForLine(2.5)}addTabGlyph(){return this.addClef("tab"),this}}function getUnusedStringGroups(B,R){const F=[];let D=[];for(let G=1;G<=B;G++)R.indexOf(G)>-1?(F.push(D),D=[]):D.push(G);return D.length>0&&F.push(D),F}function getPartialStemLines(B,R,F,D){const G=D!==1,U=D!==-1,W=F.getSpacingBetweenLines(),q=F.getNumLines(),Y=[];return R.forEach(J=>{const Z=J.indexOf(q)>-1,K=J.indexOf(1)>-1;if(G&&K||U&&Z)return;J.length===1&&J.push(J[0]);const te=[];J.forEach((Q,ie,se)=>{const ne=Q===1,re=Q===q;let ae=F.getYForLine(Q-1);ie===0&&!ne?ae-=W/2-1:ie===se.length-1&&!re&&(ae+=W/2-1),te.push(ae),D===1&&ne?te.push(B-2):D===-1&&re&&te.push(B+2)}),Y.push(te.sort((Q,ie)=>Q-ie))}),Y}class TabNote$1 extends StemmableNote{static get CATEGORY(){return"tabnotes"}constructor(R,F){if(super(R),this.setAttribute("type","TabNote"),this.ghost=!1,this.positions=R.positions,Vex.Merge(this.render_options,{glyph_font_scale:Flow.DEFAULT_TABLATURE_FONT_SCALE,draw_stem:F,draw_dots:F,draw_stem_through_stave:!1,y_shift:0,scale:1,font:"10pt Arial"}),this.glyph=Flow.getGlyphProps(this.duration,this.noteType),!this.glyph)throw new Vex.RuntimeError("BadArguments",`Invalid note initialization data (No glyph found): ${JSON.stringify(R)}`);this.buildStem(),R.stem_direction?this.setStemDirection(R.stem_direction):this.setStemDirection(Stem.UP),this.ghost=!1,this.updateWidth()}reset(){this.stave&&this.setStave(this.stave)}getCategory(){return TabNote$1.CATEGORY}setGhost(R){return this.ghost=R,this.updateWidth(),this}hasStem(){return this.render_options.draw_stem}getStemExtension(){const R=this.getGlyph();return this.stem_extension_override!=null?this.stem_extension_override:R?this.getStemDirection()===1?R.tabnote_stem_up_extension:R.tabnote_stem_down_extension:0}addDot(){const R=new Dot;return this.dots+=1,this.addModifier(R,0)}updateWidth(){this.glyphs=[],this.width=0;for(let R=0;Rthis.width}setStave(R){super.setStave(R),this.context=R.context;let F;if(this.context){const G=this.context;for(this.width=0,F=0;FU.width),this.width=Math.max(U.getWidth(),this.width)}this.glyph.getWidth=()=>this.width}const D=this.positions.map(({str:G})=>R.getYForLine(G-1));return this.setYs(D),this.stem&&this.stem.setYBounds(this.getStemY(),this.getStemY()),this}getPositions(){return this.positions}addToModifierContext(R){this.setModifierContext(R);for(let F=0;F{R.getCategory()==="dots"&&!this.render_options.draw_dots||(R.setContext(this.context),R.drawWithStyle())})}drawStemThrough(){const R=this.getStemX(),F=this.getStemY(),D=this.context,G=this.render_options.draw_stem_through_stave;if(this.render_options.draw_stem&&G){const W=this.stave.getNumLines(),q=this.positions.map(Z=>Z.str),Y=getUnusedStringGroups(W,q),J=getPartialStemLines(F,Y,this.getStave(),this.getStemDirection());D.save(),D.setLineWidth(Stem.WIDTH),J.forEach(Z=>{Z.length!==0&&(D.beginPath(),D.moveTo(R,Z[0]),D.lineTo(R,Z[Z.length-1]),D.stroke(),D.closePath())}),D.restore()}}drawPositions(){const R=this.context,F=this.getAbsoluteX(),D=this.ys;for(let G=0;GparseInt(G,10)?TabSlide.SLIDE_DOWN:TabSlide.SLIDE_UP}this.slide_direction=F,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(R)}renderTie(R){if(R.first_ys.length===0||R.last_ys.length===0)throw new Vex.RERR("BadArguments","No Y-values to render");const F=this.context,D=R.first_x_px,G=R.first_ys,U=R.last_x_px,W=this.slide_direction;if(W!==TabSlide.SLIDE_UP&&W!==TabSlide.SLIDE_DOWN)throw new Vex.RERR("BadSlide","Invalid slide direction");for(let q=0;qthis.numStrings)throw new Vex.RERR("BadArguments",`String number must be between 1 and ${this.numStrings}:${R}`);return this.tuningValues[F-1]}getValueForFret(R,F){const D=this.getValueForString(F),G=parseInt(R,10);if(G<0)throw new Vex.RERR("BadArguments","Fret number must be 0 or higher: "+R);return D+G}getNoteForFret(R,F){const D=this.getValueForFret(R,F),G=Math.floor(D/12),U=D%12;return Flow.integerToNote(U)+"/"+G}}class KeyManager{constructor(R){this.music=new Music,this.setKey(R)}setKey(R){return this.key=R,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),!Music.scaleTypes[this.keyParts.type])throw new Vex.RERR("BadArguments",`Unsupported key type: ${this.key}`);this.scale=this.music.getScaleTones(this.music.getNoteValue(this.keyString),Music.scaleTypes[this.keyParts.type]),this.scaleMap={},this.scaleMapByValue={},this.originalScaleMapByValue={};const F=Music.root_indices[this.keyParts.root];for(let D=0;D{const D=TextDynamics.GLYPHS[F];if(!D)throw new Vex.RERR("Invalid dynamics character: "+F);const G=this.render_options.glyph_font_size,U=new Glyph(D.code,G);this.glyphs.push(U),R+=D.width}),this.setWidth(R),this.preFormatted=!0,this}draw(){this.setRendered();const R=this.getAbsoluteX(),F=this.stave.getYForLine(this.line+-3);L$7("Rendering Dynamics: ",this.sequence);let D=R;this.glyphs.forEach((G,U)=>{const W=this.sequence[U];G.render(this.context,D,F),D+=TextDynamics.GLYPHS[W].width})}}function drawArrowHead(B,R,F,D,G,U,W){B.beginPath(),B.moveTo(R,F),B.lineTo(D,G),B.lineTo(U,W),B.lineTo(R,F),B.closePath(),B.fill()}function drawArrowLine(B,R,F,D){const G=D.draw_start_arrow&&D.draw_end_arrow,U=R.x,W=R.y,q=F.x,Y=F.y,J=Math.sqrt((q-U)*(q-U)+(Y-W)*(Y-W)),Z=(J-D.arrowhead_length/3)/J;let K,te,Q,ie;D.draw_end_arrow||G?(K=Math.round(U+(q-U)*Z),te=Math.round(W+(Y-W)*Z)):(K=q,te=Y),D.draw_start_arrow||G?(Q=U+(q-U)*(1-Z),ie=W+(Y-W)*(1-Z)):(Q=U,ie=W),D.color&&(B.setStrokeStyle(D.color),B.setFillStyle(D.color)),B.beginPath(),B.moveTo(Q,ie),B.lineTo(K,te),B.stroke(),B.closePath();const se=Math.atan2(Y-W,q-U),ne=Math.abs(D.arrowhead_length/Math.cos(D.arrowhead_angle));let re,ae,ce,he,fe,be;(D.draw_end_arrow||G)&&(re=se+Math.PI+D.arrowhead_angle,ce=q+Math.cos(re)*ne,he=Y+Math.sin(re)*ne,ae=se+Math.PI-D.arrowhead_angle,fe=q+Math.cos(ae)*ne,be=Y+Math.sin(ae)*ne,drawArrowHead(B,ce,he,q,Y,fe,be)),(D.draw_start_arrow||G)&&(re=se+D.arrowhead_angle,ce=U+Math.cos(re)*ne,he=W+Math.sin(re)*ne,ae=se-D.arrowhead_angle,fe=U+Math.cos(ae)*ne,be=W+Math.sin(ae)*ne,drawArrowHead(B,ce,he,U,W,fe,be))}class StaveLine extends Element$1{static get TextVerticalPosition(){return{TOP:1,BOTTOM:2}}static get TextJustification(){return{LEFT:1,CENTER:2,RIGHT:3}}constructor(R){super(),this.setAttribute("type","StaveLine"),this.notes=R,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:StaveLine.TextVerticalPosition.TOP,text_justification:StaveLine.TextJustification.CENTER},this.setNotes(R)}setFont(R){return this.font=R,this}setText(R){return this.text=R,this}setNotes(R){if(!R.first_note&&!R.last_note)throw new Vex.RuntimeError("BadArguments","Notes needs to have either first_note or last_note set.");if(R.first_indices||(R.first_indices=[0]),R.last_indices||(R.last_indices=[0]),R.first_indices.length!==R.last_indices.length)throw new Vex.RuntimeError("BadArguments","Connected notes must have similar index sizes");return this.first_note=R.first_note,this.first_indices=R.first_indices,this.last_note=R.last_note,this.last_indices=R.last_indices,this}applyLineStyle(){const R=this.checkContext(),F=this.render_options;F.line_dash&&R.setLineDash(F.line_dash),F.line_width&&R.setLineWidth(F.line_width),F.rounded_end?R.setLineCap("round"):R.setLineCap("square")}applyFontStyle(){const R=this.checkContext();this.font&&R.setFont(this.font.family,this.font.size,this.font.weight),this.render_options.color&&(R.setStrokeStyle(this.render_options.color),R.setFillStyle(this.render_options.color))}draw(){const R=this.checkContext();this.setRendered();const F=this.first_note,D=this.last_note,G=this.render_options;R.save(),this.applyLineStyle();let U,W;this.first_indices.forEach((te,Q)=>{const ie=this.last_indices[Q];U=F.getModifierStartXY(2,te),W=D.getModifierStartXY(1,ie);const se=U.y>W.y;U.x+=F.getMetrics().modRightPx+G.padding_left,W.x-=D.getMetrics().modLeftPx+G.padding_right;const ne=F.getGlyph().getWidth();F.getKeyProps()[te].displaced&&F.getStemDirection()===1&&(U.x+=ne+G.padding_left),D.getKeyProps()[ie].displaced&&D.getStemDirection()===-1&&(W.x-=ne+G.padding_right),U.y+=se?-3:1,W.y+=se?2:0,drawArrowLine(R,U,W,this.render_options)}),R.restore();const q=R.measureText(this.text).width,Y=G.text_justification;let J=0;Y===StaveLine.TextJustification.LEFT?J=U.x:Y===StaveLine.TextJustification.CENTER?J=(W.x-U.x)/2+U.x-q/2:Y===StaveLine.TextJustification.RIGHT&&(J=W.x-q);let Z;const K=G.text_position_vertical;return K===StaveLine.TextVerticalPosition.TOP?Z=F.getStave().getYForTopText():K===StaveLine.TextVerticalPosition.BOTTOM&&(Z=F.getStave().getYForBottomText(Flow.TEXT_HEIGHT_OFFSET_HACK)),R.save(),this.applyFontStyle(),R.fillText(this.text,J,Z),R.restore(),this}}function L$6(...B){PedalMarking.DEBUG&&Vex.L("Vex.Flow.PedalMarking",B)}function drawPedalGlyph(B,R,F,D,G){const U=PedalMarking.GLYPHS[B];new Glyph(U.code,G).render(R,F+U.x_shift,D+U.y_shift)}class PedalMarking extends Element$1{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,MIXED_OPEN_END:4,BRACKET_OPEN_BEGIN:5,BRACKET_OPEN_END:6,BRACKET_OPEN_BOTH:7}}static get StylesString(){return{text:PedalMarking.Styles.TEXT,bracket:PedalMarking.Styles.BRACKET,mixed:PedalMarking.Styles.MIXED,mixed_open_end:PedalMarking.Styles.MIXED_OPEN_END,bracket_open_begin:PedalMarking.Styles.BRACKET_OPEN_BEGIN,bracket_open_end:PedalMarking.Styles.BRACKET_OPEN_END,bracket_open_both:PedalMarking.Styles.BRACKET_OPEN_BOTH}}static createSustain(R){return new PedalMarking(R)}static createSostenuto(R){const F=new PedalMarking(R);return F.setStyle(PedalMarking.Styles.MIXED),F.setCustomText("Sost. Ped."),F}static createUnaCorda(R){const F=new PedalMarking(R);return F.setStyle(PedalMarking.Styles.TEXT),F.setCustomText("una corda","tre corda"),F}constructor(R){super(),this.setAttribute("type","PedalMarking"),this.EndsStave=!1,this.ChangeBegin=!1,this.ChangeEnd=!1,this.notes=R,this.style=PedalMarking.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"}}setEndStave(R){if(this.endStave=R,this.endStaveAddedWidth=0,this.startMargin=0,this.endMargin=0,Array.isArray(this.endStave.modifiers))for(let F=0;F3)throw new Vex.RERR("InvalidParameter","The style must be one found in PedalMarking.Styles");return this.style=R,this}setLine(R){return this.line=R,this}drawBracketed(){const R=this.context;let F=!1,D,G;const U=this;this.notes.forEach((W,q,Y)=>{F=!F;let J=0;if(W?J=W.getNoteHeadBeginX():J=this.endStave.end_x+this.endStaveAddedWidth,this.EndsStave)F?this.ChangeBegin&&(J=W.getAbsoluteX()):(W?this.ChangeEnd?J=W.getAbsoluteX():J=W.getStave().end_x+this.endStaveAddedWidth-U.render_options.text_margin_right:J=this.endStave.end_x+this.endStaveAddedWidth-U.render_options.text_margin_right,this.endMargin=-U.render_options.text_margin_right);else if(W)if(F)this.ChangeBegin&&(J=W.getAbsoluteX());else switch(U.style){case PedalMarking.Styles.BRACKET_OPEN_END:case PedalMarking.Styles.BRACKET_OPEN_BOTH:case PedalMarking.Styles.MIXED_OPEN_END:J=W.getNoteHeadEndX();break;default:this.ChangeEnd?J=W.getAbsoluteX():(J=W.getNoteHeadBeginX()-U.render_options.text_margin_right,this.startMargin=-U.render_options.text_margin_right);break}let Z=this.endStave;W&&(Z=W.getStave());let K=Z.getYForBottomText(U.line+3);G&&G>K&&(K=G);const te=Y[q+1]===W,Q=Y[q-1]===W;let ie=0;if(F)if(ie=Q?5:0,(U.style===PedalMarking.Styles.MIXED||U.style===PedalMarking.Styles.MIXED_OPEN_END)&&!Q)if(U.custom_depress_text){const se=R.measureText(U.custom_depress_text).width;R.fillText(U.custom_depress_text,J-se/2,K),ie=se/2+U.render_options.text_margin_right}else drawPedalGlyph("pedal_depress",R,J,K,U.render_options.glyph_point_size),ie=20+U.render_options.text_margin_right;else R.beginPath(),U.style===PedalMarking.Styles.BRACKET_OPEN_BEGIN||U.style===PedalMarking.Styles.BRACKET_OPEN_BOTH?R.moveTo(J+ie,K):(this.ChangeBegin&&(J+=5),R.moveTo(J,K-U.render_options.bracket_height),this.ChangeBegin&&(J+=5),R.lineTo(J+ie,K)),R.stroke(),R.closePath();else ie=te&&!this.EndsStave?-5:0,R.beginPath(),R.moveTo(D,G),R.lineTo(J+ie,K),U.style!==PedalMarking.Styles.BRACKET_OPEN_END&&U.style!==PedalMarking.Styles.MIXED_OPEN_END&&U.style!==PedalMarking.Styles.BRACKET_OPEN_BOTH&&(this.ChangeEnd&&(J+=5),R.lineTo(J,K-U.render_options.bracket_height)),R.stroke(),R.closePath();D=J+ie,G=K})}drawText(){const R=this.context;let F=!1;const D=this,G=D.render_options.glyph_point_size;this.notes.forEach(U=>{F=!F;const W=U.getStave(),q=U.getAbsoluteX(),Y=W.getYForBottomText(D.line+3);let J=0;F?D.custom_depress_text?(J=R.measureText(D.custom_depress_text).width,R.fillText(D.custom_depress_text,q-J/2,Y)):drawPedalGlyph("pedal_depress",R,q,Y,G):D.custom_release_text?(J=R.measureText(D.custom_release_text).width,R.fillText(D.custom_release_text,q-J/2,Y)):drawPedalGlyph("pedal_release",R,q,Y,G)})}draw(){const R=this.checkContext();this.setRendered(),R.save(),R.setStrokeStyle(this.render_options.color),R.setFillStyle(this.render_options.color),R.setFont(this.font.family,this.font.size,this.font.weight),L$6("Rendering Pedal Marking"),this.style===PedalMarking.Styles.BRACKET||this.style===PedalMarking.Styles.MIXED||this.style===PedalMarking.Styles.MIXED_OPEN_END||this.style===PedalMarking.Styles.BRACKET_OPEN_BEGIN||this.style===PedalMarking.Styles.BRACKET_OPEN_END||this.style===PedalMarking.Styles.BRACKET_OPEN_BOTH?(R.setLineWidth(this.render_options.bracket_line_width),this.drawBracketed()):this.style===PedalMarking.Styles.TEXT&&this.drawText(),R.restore()}}function L$5(...B){TextBracket.DEBUG&&Vex.L("Vex.Flow.TextBracket",B)}class TextBracket extends Element$1{static get Positions(){return{TOP:1,BOTTOM:-1}}static get PositionString(){return{top:TextBracket.Positions.TOP,bottom:TextBracket.Positions.BOTTOM}}constructor({start:R,stop:F,text:D="",superscript:G="",position:U=TextBracket.Positions.TOP}){super(),this.setAttribute("type","TextBracket"),this.start=R,this.stop=F,this.text=D,this.superscript=G,this.position=typeof U=="string"?TextBracket.PositionString[U]:U,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(R){return R.setFont(this.font.family,this.font.size,this.font.weight),R.setStrokeStyle(this.render_options.color),R.setFillStyle(this.render_options.color),R.setLineWidth(this.render_options.line_width),this}setDashed(R,F){return this.render_options.dashed=R,F&&(this.render_options.dash=F),this}setFont(R){return this.font={...this.font,...R},this}setLine(R){return this.line=R,this}draw(){const R=this.context;this.setRendered();let F=0;switch(this.position){case TextBracket.Positions.TOP:F=this.start.getStave().getYForTopText(this.line);break;case TextBracket.Positions.BOTTOM:F=this.start.getStave().getYForBottomText(this.line+Flow.TEXT_HEIGHT_OFFSET_HACK);break;default:throw new Vex.RERR("InvalidPosition",`The position ${this.position} is invalid`)}const D={x:this.start.getAbsoluteX(),y:F},G={x:this.stop.getAbsoluteX(),y:F};L$5("Rendering TextBracket: start:",D,"stop:",G,"y:",F);const U=this.render_options.bracket_height*this.position;R.save(),this.applyStyle(R),R.fillText(this.text,D.x,D.y);const W=R.measureText(this.text).width,q=R.measureText("M").width,Y=D.y-q/2.5;R.setFont(this.font.family,this.font.size/1.4,this.font.weight),R.fillText(this.superscript,D.x+W+1,Y);const J=R.measureText(this.superscript).width,Z=R.measureText("M").width;let K=D.x,te=Y;const Q=G.x+this.stop.getGlyph().getWidth();this.position===TextBracket.Positions.TOP?(K+=W+J+5,te-=Z/2.7):this.position===TextBracket.Positions.BOTTOM&&(te+=Z/2.7,K+=W+2,this.render_options.underline_superscript||(K+=J)),this.render_options.dashed?(Renderer.drawDashedLine(R,K,te,Q,te,this.render_options.dash),this.render_options.show_bracket&&Renderer.drawDashedLine(R,Q,te+1*this.position,Q,te+U,this.render_options.dash)):(R.beginPath(),R.moveTo(K,te),R.lineTo(Q,te),this.render_options.show_bracket&&R.lineTo(Q,te+U),R.stroke(),R.closePath()),R.restore()}}function L$4(...B){BarNote.DEBUG&&Vex.L("Vex.Flow.BarNote",B)}class BarNote extends Note{constructor(R=Barline.type.SINGLE){super({duration:"b"}),this.setAttribute("type","BarNote"),this.metrics={widths:{}};const F=Barline.type;this.metrics.widths={[F.SINGLE]:8,[F.DOUBLE]:12,[F.END]:15,[F.REPEAT_BEGIN]:14,[F.REPEAT_END]:14,[F.REPEAT_BOTH]:18,[F.NONE]:0},this.ignore_ticks=!0,this.setType(R)}getType(){return this.type}setType(R){return this.type=typeof R=="string"?Barline.typeString[R]:R,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 Vex.RERR("NoStave","Can't draw without a stave.");L$4("Rendering bar line at: ",this.getAbsoluteX());const R=new Barline(this.type);R.setX(this.getAbsoluteX()),R.draw(this.stave),this.setRendered()}}class GhostNote extends StemmableNote{constructor(R){if(!R)throw new Vex.RuntimeError("BadArguments","Ghost note must have valid initialization data to identify duration.");let F;if(typeof R=="string")F={duration:R};else if(typeof R=="object")F=R;else throw new Vex.RuntimeError("BadArguments","Ghost note must have valid initialization data to identify duration.");super(F),this.setAttribute("type","GhostNote"),this.setWidth(0)}isRest(){return!0}setStave(R){super.setStave(R)}addToModifierContext(){return this}preFormat(){return this.setPreFormatted(!0),this}draw(){if(!this.stave)throw new Vex.RERR("NoStave","Can't draw without a stave.");this.setRendered();for(let R=0;R0||F===!0;return F&&!(U>0)&&(this.pos=G),q?this.matchSuccess():this.matchFail(G),{success:q,results:D,numMatches:U}}expectZeroOrMore(R){return this.expectOneOrMore(R,!0)}expect(R){L$2("Evaluating rules:",R);let F;if(!R)throw new X$2("Invalid Rule: "+R,R);const D=R.bind(this.grammar)();if(D.token)F=this.matchToken(D.token,D.noSpace===!0),F.success&&(this.pos+=F.incrementPos);else if(D.expect)D.oneOrMore?F=this.expectOneOrMore(D):D.zeroOrMore?F=this.expectZeroOrMore(D):F=this.expectOne(D);else throw new X$2("Bad grammar! No `token` or `expect` property",D);return F.matches=[],F.results&&F.results.forEach(G=>F.matches.push(flattenMatches(G))),D.run&&F.success&&D.run(F),F}}function L$1(...B){EasyScore.DEBUG&&Vex.L("Vex.Flow.EasyScore",B)}const X$1=Vex.MakeException("EasyScoreError");class Grammar{constructor(R){this.builder=R}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:R=>this.builder.addChord(R.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:R=>this.builder.addSingleNote(R.matches[0],R.matches[1],R.matches[2])}}ACCIDENTAL(){return{expect:[this.ACCIDENTALS],maybe:!0}}DOTS(){return{expect:[this.DOT],zeroOrMore:!0,run:R=>this.builder.setNoteDots(R.matches[0])}}TYPE(){return{expect:[this.SLASH,this.MAYBESLASH,this.TYPES],maybe:!0,run:R=>this.builder.setNoteType(R.matches[2])}}DURATION(){return{expect:[this.SLASH,this.DURATIONS],maybe:!0,run:R=>this.builder.setNoteDuration(R.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(){const R=F=>F.slice(1,-1);return{expect:[this.KEY,this.EQUALS,this.VAL],run:F=>this.builder.addNoteOption(F.matches[0],R(F.matches[2]))}}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 Builder{constructor(R){this.factory=R,this.commitHooks=[],this.reset()}reset(R={}){this.options={stem:"auto",clef:"treble"},this.elements={notes:[],accidentals:[]},this.rollingDuration="8",this.resetPiece(),Object.assign(this.options,R)}getFactory(){return this.factory}getElements(){return this.elements}addCommitHook(R){this.commitHooks.push(R)}resetPiece(){L$1("resetPiece"),this.piece={chord:[],duration:this.rollingDuration,dots:0,type:void 0,options:{}}}setNoteDots(R){L$1("setNoteDots:",R),R&&(this.piece.dots=R.length)}setNoteDuration(R){L$1("setNoteDuration:",R),this.rollingDuration=this.piece.duration=R||this.rollingDuration}setNoteType(R){L$1("setNoteType:",R),R&&(this.piece.type=R)}addNoteOption(R,F){L$1("addNoteOption: key:",R,"value:",F),this.piece.options[R]=F}addNote(R,F,D){L$1("addNote:",R,F,D),this.piece.chord.push({key:R,accid:F,octave:D})}addSingleNote(R,F,D){L$1("addSingleNote:",R,F,D),this.addNote(R,F,D)}addChord(R){L$1("startChord"),typeof R[0]!="object"?this.addSingleNote(R[0]):R.forEach(F=>{F&&this.addNote(...F)}),L$1("endChord")}commitPiece(){L$1("commitPiece");const{factory:R}=this;if(!R)return;const F={...this.options,...this.piece.options},{stem:D,clef:G}=F,U=D.toLowerCase()==="auto",W=!U&&D.toLowerCase()==="up"?StaveNote.STEM_UP:StaveNote.STEM_DOWN,{chord:q,duration:Y,dots:J,type:Z}=this.piece,K=q.map(ie=>ie.key+"/"+ie.octave),te=R.StaveNote({keys:K,duration:Y,dots:J,type:Z,clef:G,auto_stem:U});U||te.setStemDirection(W);const Q=q.map(ie=>ie.accid||null);Q.forEach((ie,se)=>{ie&&te.addAccidental(se,R.Accidental({type:ie}))});for(let ie=0;ieie(F,te,this)),this.elements.notes.push(te),this.elements.accidentals.concat(Q),this.resetPiece()}}function setId({id:B},R){B!==void 0&&R.setAttribute("id",B)}function setClass(B,R){if(!B.class)return;const F=/\s*,\s*/;B.class.split(F).forEach(D=>R.addClass(D))}class EasyScore{constructor(R={}){this.setOptions(R),this.defaults={clef:"treble",time:"4/4",stem:"auto"}}set(R){return Object.assign(this.defaults,R),this}setOptions(R){return this.options={factory:null,builder:null,commitHooks:[setId,setClass,Articulation$1.easyScoreHook],throwOnError:!1,...R},this.factory=this.options.factory,this.builder=this.options.builder||new Builder(this.factory),this.grammar=new Grammar(this.builder),this.parser=new Parser(this.grammar),this.options.commitHooks.forEach(F=>this.addCommitHook(F)),this}setContext(R){return this.factory&&this.factory.setContext(R),this}parse(R,F={}){this.builder.reset(F);const D=this.parser.parse(R);if(!D.success&&this.options.throwOnError)throw new X$1("Error parsing line: "+R,D);return D}beam(R,F={}){return this.factory.Beam({notes:R,options:F}),R}tuplet(R,F={}){return this.factory.Tuplet({notes:R,options:F}),R}notes(R,F={}){return F={clef:this.defaults.clef,stem:this.defaults.stem,...F},this.parse(R,F),this.builder.getElements().notes}voice(R,F){return F={time:this.defaults.time,...F},this.factory.Voice(F).addTickables(R)}addCommitHook(R){return this.builder.addCommitHook(R)}}function initGroup(){return{notes:[],finish:!1,total:0,staveId:""}}let _text_width=null,tone="C",group=initGroup(),_denominator="",_numerator="",ornamentGroup="";class NumberedNote extends StaveNote{static get CATEGORY(){return"numberednotes"}static accidentalAndKey(R){switch(R){case"G":return{4:"#"};case"D":return{1:"#",4:"#"};case"A":return{1:"#",4:"#",5:"#"};case"E":return{1:"#",2:"#",4:"#",5:"#"};case"B":return{1:"#",2:"#",4:"#",5:"#",6:"#"};case"F#":return{1:"#",2:"#",3:"#",4:"#",5:"#",6:"#"};case"C#":return{1:"#",2:"#",3:"#",4:"#",5:"#",6:"#",7:"#"};case"F":return{7:"b"};case"Bb":return{7:"b",3:"b"};case"Eb":return{7:"b",3:"b",6:"b"};case"Ab":return{7:"b",2:"b",3:"b",6:"b"};case"Db":return{7:"b",2:"b",3:"b",5:"b",6:"b"};case"Gb":return{7:"b",1:"b",2:"b",3:"b",5:"b",6:"b"};case"Cb":return{7:"b",1:"b",2:"b",3:"b",4:"b",5:"b",6:"b"};default:return{}}}static accidentalMap(R){switch(R){case"C":return"";case"F":case"Bb":case"Eb":case"Ab":case"Db":case"Gb":case"Cb":return{bb:"b",b:"",n:"#","#":"##"};default:return{b:"bb",n:"b","#":"","##":"#"}}}static get noteLift(){switch(tone){case"G":return["7"];case"D":return["7","3"];case"A":return["7","3","6"];case"E":return["2","6","3","7"];case"B":return["5","2","6","3","7"];case"F#":return["1","5","2","6","3","7"];case"C#":return["4","1","5","2","6","3","7"];case"F":return["4"];case"Bb":return["1","4"];case"Eb":return["5","1","4"];case"Ab":return["2","5","1","4"];case"Db":return["6","2","5","1","4"];case"Gb":return["3","6","2","5","1","4"];case"Cb":return["7","3","6","2","5","1","4"]}}static get longDurationLine(){return{1:3,2:1,6:2}}static get numberedDurationLine(){return{8:1,16:2,32:3,64:4,128:5}}static get durationTime(){return{8:6144,4:4096}}constructor(R){super(R),this.setAttribute("type","NumberedNote"),tone=R.keyString,this.ornament=!!R.ornament,this.line=0,this.keys=R.keys||[],this.fontSize=20,this.offset_x=0,this.offset_y=0,this.note_tones=[],this.duration_lines=0,this.long_duration_lines=0,this.note_size=R.note_size||16;const F=Flow.sanitizeDuration(this.duration);var D=NumberedNote.numberedDurationLine[F.toString()];if(D&&(this.duration_lines=D),D=NumberedNote.longDurationLine[F.toString()],D&&(this.long_duration_lines=D),!_text_width){var G="__$text_wraper$$__";let W=document.createElement("canvas");W.id=G,document.body.append(W);const q=document.getElementById(G),Y=q.getContext("2d");Y.font="Arial 22px";var U=Y.measureText("5");_text_width=U.width+2,document.body.removeChild(q)}}getCategory(){return NumberedNote.CATEGORY}setKeySignature(R){this.keySignature=R}preFormat(){this.preFormatted||(this.modifierContext&&this.modifierContext.preFormat(),this.setWidth(this.full_width),this.setPreFormatted(!0))}filterNote(){if(window&&window.sett&&window.sett.keySignature||!this.keys||!this.keys.length)return;const R=NumberedNote.accidentalMap(tone);if(!R)return;const F=NumberedNote.noteLift;if(!F)return;var D=this.keys[0].split("/"),G=D[0];G==="b"&&(G="R"),G=G.replaceAll("#",""),G=G.replaceAll("n",""),G.length>1&&(G=G.replaceAll("b",""));const U=NumberedNoteHead.numberedNotationMapping[G.toUpperCase()];if(F.includes(U))for(let W=0;W{switch(D.getAttribute("type")){case"Accidental":D.render_options.font_scale=this.note_width*1.4,D.x_shift=2,D.y_shift=this.unit_height/2,this.ornament&&(D.render_options.font_scale=this.note_width,D.x_shift=14,D.y_shift=-10);break;case"Stroke":D.x_shift=-1*R,D.y_shift=1*this.unit_height;break;case"Dot":D.x_shift=F*this.duration_dot_width+7,D.y_shift=1*this.unit_height,F++;break;case"Ornament":D.y_shift=-3;break;default:D.y_shift=1*this.unit_height}D.reset&&D.reset(),R+=D.getWidth()/2})}handleDeleteDot(){for(let R=0;RW),D=F.length?F[0]/F[1]:0;if(this.ornament)return;if(D===0)return this.long_duration_lines=this.intrinsicTicks/R-1,this.long_duration_lines>=_numerator&&(this.long_duration_lines=_numerator-1),_denominator==8&&(this.long_duration_lines=0,_numerator==3&&this.draw_dot(this.context,this.bottom_x+25,this.bottom_y-30,this.dot_width),_numerator==6&&(this.draw_dot(this.context,this.bottom_x+25,this.bottom_y-30,this.dot_width),new Glyph("v0",40).render(this.context,this.bottom_x+40,this.top_y),this.draw_dot(this.context,this.bottom_x+65,this.bottom_y-30,this.dot_width))),group=initGroup();let G={lines:this.duration_lines,duration:D,id:this.attrs.id,x:this.x-this.duration_line_space/2-this.left_width,y:this.y,width:this.full_width};D>R*2&&(this.long_duration_lines=parseInt(D/R)-1,this.handleDeleteDot()),ornamentGroup&&(G.x+=this.note_width),group.notes.push(G);let U=group.notes.reduce((W,q)=>W+q.duration,0);U=parseInt(U),U>R&&(U-=R),U>R-10&&Uq.lines===0).length&&(this.drawDurationLoneLine(),group=initGroup()))}draw(){if(this.checkContext(),!this.stave)throw new Vex.RERR("NoStave","Can't draw without a stave.");let R=this.context;R.save(),R.setFont("Arial",this.note_height,"normal"),this.setAttribute("el",R.openGroup("stavenote",this.getAttribute("id"))),R.openGroup("note",null,{pointerBBox:!0});let F=this.getAbsoluteX()+2.5;this.x=F;let D=this.stave.getYForLine(2)+this.note_height/2;this.y=D,this.buildToneHeads(),this.preFormatModifier(),this.applyStyle(),this.note_tones.forEach(G=>{G.draw(R)}),R.openGroup("modifier",null,{pointerBBox:!0}),this.drawModifiers(),R.closeGroup(),R.closeGroup(),R.closeGroup(),this.calcGroup(),group.staveId=this.stave.attrs.id,this.drawDurationLine(R,{}),this.drawLongDurationLines(R),this.restoreStyle(),this.setRendered(),this.ornament?ornamentGroup?ornamentGroup=Object.assign(ornamentGroup,{lines:this.duration_lines,id:this.attrs.id,x:this.x-this.duration_line_space/2-this.left_width,width:this.full_width}):ornamentGroup={lines:this.duration_lines,id:this.attrs.id,x:this.x-this.duration_line_space/2-this.left_width,width:this.full_width}:ornamentGroup=""}drawDurationLoneLine(R,F){R=R||this.context;let D=F||this.y+this.duration_line_space;for(let G=0;G<5;G++){let U=[],W=0;for(let q=0;qG)U.push(Y),W++;else{if(U.length>1){let J=U.length-1;D=U[0].y+this.duration_line_space,R.rect(U[0].x,D+G*3,U[J].x-U[0].x+U[J].width,.5)}U=[],W=q+1}}if(U.length>1){let q=U.length-1;D=U[0].y+this.duration_line_space,R.rect(U[0].x,D+G*3,U[q].x-U[0].x+U[q].width,.5)}}}draw_dot(R,F,D,G){R.openGroup("numbered-note-dot"),R.beginPath(),R.arc(F,D,G,0,2*Math.PI),R.closePath(),R.fill(),R.closeGroup()}drawDurationLine(R,F){var D=this.attrs.id+"-lines";R.openGroup("numbered_note_lines",D);var G,U;if(this.duration_lines>0){const Y=this.duration_line_space;var W=this.full_width;if(F&&F.width&&(W=F.width),W<0&&(W=this.note_width),!F||typeof F.startX=="undefined"?G=this.x-Y/2-this.left_width:G=F.startX,!F||typeof F.startY=="undefined"?U=this.y+this.duration_line_space:U=F.startY,group.finish&&(this.drawDurationLoneLine(R,U),group=initGroup()),this.ornament?(G+=12,U-=22,W=15,ornamentGroup&&(G-=10,W+=10)):ornamentGroup&&(G+=this.note_width,W-=this.note_width),W>0){for(var q=0;qq.getAttribute("type")==="Accidental"),W=this.modifiers.findIndex(q=>q.getAttribute("type")==="Accidental");G&&W>-1?this.modifiers[W].accidental.code=G==="#"?"v18":"v44":this.modifiers.splice(W,1)}}catch(G){console.log("\u{1F680} ~ error",G)}}this.setYs(R)}getFullWidth(){return this.full_width}getFullHeight(){return this.full_height}getLine(){return this.keyProps[0].line}get full_width(){return this.note_width+this.left_width+this.right_width+this.long_duration_line_width}get long_duration_line_width(){return(this.long_duration_width+this.long_duration_space)*this.long_duration_lines}get full_height(){return this.bottom_y-this.top_y}get note_width(){return this.note_size||0}get note_dot_width(){return 6}get note_height(){return this.unit_height}get unit_height(){return this.note_size||0}get note_x(){return this.x||0}get top_x(){return this.x||0}get top_y(){var R=this;return(this.y||0)-(R.note_tones.map(D=>(D.td+D.bd)*(R.dot_space+R.dot_width)).reduce((D,G)=>D+G,0)+this.note_height*this.note_tones.length-this.unit_height-this.note_tones[0].bd*(R.dot_space+R.dot_width)+(this.note_tones.length-1)*this.head_space)}get bottom_x(){return this.x||0}get bottom_y(){return(this.y||0)+this.unit_height+this.duration_lines*(this.duration_line_height+this.duration_line_space)+this.note_tones[0].meta.bd*(this.dot_width+this.dot_space)}get left_width(){return this.modifiers_width}get right_width(){return this.full_duration_dot_width}get duration_dot_width(){return 6}get full_duration_dot_width(){return this.duration_dot_width*this.getModifiersByCategory(Dot.CATEGORY).length}getModifiersByCategory(R){var F=[];return this.modifiers.forEach(D=>{D.getCategory()===R&&F.push(D)}),F}get head_space(){return 6}get duration_line_height(){return 2}get duration_line_space(){return 4}get dot_width(){return 2}get dot_space(){return 2}get long_duration_space(){return 10}get long_duration_width(){return 20}getWidth(){return this.full_width}get modifiers_width(){let R=0;return this.modifiers.forEach(F=>{R+=F.getWidth()}),R}}class NumberedNoteHead{static get numberedNotationMapping(){let R=tone;switch(window&&window.sett&&window.sett.keySignature&&(R="C"),R){case"A":return{C:"3",D:"4",E:"5",F:"6",G:"7",A:"1",B:"2",R:"0",min:2.5,max:5.5};case"B":return{C:"2",D:"3",E:"4",F:"5",G:"6",A:"7",B:"1",R:"0",min:-.5,max:2.5};case"D":return{C:"7",D:"1",E:"2",F:"3",G:"4",A:"5",B:"6",R:"0",min:.5,max:3.5};case"E":return{C:"6",D:"7",E:"1",F:"2",G:"3",A:"4",B:"5",R:"0",min:1,max:4};case"F":return{C:"5",D:"6",E:"7",F:"1",G:"2",A:"3",B:"4",R:"0",min:1.5,max:4.5};case"G":case"Gb":return{C:"4",D:"5",E:"6",F:"7",G:"1",A:"2",B:"3",R:"0",min:2,max:5};case"Eb":return{C:"6",D:"7",E:"1",F:"2",G:"3",A:"4",B:"5",R:"0",min:1,max:4};case"D#":case"Db":return{C:"7",D:"1",E:"2",F:"3",G:"4",A:"5",B:"6",R:"0",min:.5,max:3.5};case"F#":return{C:"5",D:"6",E:"7",F:"1",G:"2",A:"3",B:"4",R:"0",min:1.5,max:4.5};case"Ab":case"G#":return{C:"3",D:"4",E:"5",F:"6",G:"7",A:"1",B:"2",R:"0",min:-1,max:2};case"Bb":case"A#":return{C:"2",D:"3",E:"4",F:"5",G:"6",A:"7",B:"1",R:"0",min:-.5,max:2.5};case"C#":case"Cb":default:return{C:"1",D:"2",E:"3",F:"4",G:"5",A:"6",B:"7",R:"0",min:0,max:3}}}tone_to_numbered_key(){var R=this.key.split("/"),F=R[0];F==="b"&&(F="R"),F=F.replaceAll("#",""),F=F.replaceAll("n",""),F.length>1&&(F=F.replaceAll("b",""));let D=0,G=0;this.note.stave&&this.note.stave.options&&this.note.stave.options.keySignature&&(tone=this.note.stave.options.keySignature);const U=this.note.getLine();return UNumberedNoteHead.numberedNotationMapping.max&&(G=Math.ceil((U-NumberedNoteHead.numberedNotationMapping.max)/3.5)),F.toUpperCase()==="R"&&(D=0,G=0),{key:NumberedNoteHead.numberedNotationMapping[F.toUpperCase()],td:G,bd:D}}constructor(R){this.key=R.key,this.x=R.x||0,this.y=R.y||0,this.idx=R.idx||0,this.note=R.note||0,this.meta=this.tone_to_numbered_key(),this.noteSize=R.noteSize||16,this.td=this.meta.td,this.bd=this.meta.bd}draw(R){let F=this.y;R.openGroup("numbered-note-head");var D=this.x+(this.note.ornament?-2:0);let G=F-this.note.unit_height-this.note.dot_space-(this.note.ornament?-4:2);for(let W=0;W1&&(q-=this.note.duration_line_space),F+=q}this.draw_dot(R,D+_text_width,F,this.note.dot_width),F+=this.note.dot_width+this.note.dot_space}R.closeGroup()}get height(){return this.note.note_height+(this.meta.bd+this.meta.td)*(this.note.dot_width+this.note.dot_space)}draw_dot(R,F,D,G){R.openGroup("numbered-note-dot"),R.beginPath(),R.arc(F,D,G,0,2*Math.PI),R.closePath(),R.fill(),R.closeGroup()}}function L(...B){Factory.DEBUG&&Vex.L("Vex.Flow.Factory",B)}const X=Vex.MakeException("FactoryError");function setDefaults$1(B={},R){const F=R.options;return B=Object.assign(R,B),B.options=Object.assign(F,B.options),B}class Factory{constructor(R){L("New factory: ",R);const F={stave:{space:10},renderer:{context:null,elementId:"",backend:Renderer.Backends.SVG,width:500,height:200,background:"#FFF"},font:{face:"Arial",point:10,style:""}};this.options=F,this.setOptions(R)}static newFromElementId(R,F=500,D=200){return new Factory({renderer:{elementId:R,width:F,height:D}})}reset(){this.renderQ=[],this.systems=[],this.staves=[],this.voices=[],this.stave=null}getOptions(){return this.options}setOptions(R){for(const F of["stave","renderer","font"])Object.assign(this.options[F],R[F]);(this.options.renderer.elementId!==null||this.options.renderer.context)&&this.initRenderer(),this.reset()}initRenderer(){const{elementId:R,backend:F,width:D,height:G,background:U}=this.options.renderer;if(R==="")throw new X("HTML DOM element not set in Factory");this.context=Renderer.buildContext(R,F,D,G,U)}getContext(){return this.context}setContext(R){return this.context=R,this}getStave(){return this.stave}getVoices(){return this.voices}space(R){return this.options.stave.space*R}Stave(R){R=setDefaults$1(R,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:this.options.stave.space}});const F=new Stave(R.x,R.y,R.width,R.options);return this.staves.push(F),F.setContext(this.context),this.stave=F,F}TabStave(R){R=setDefaults$1(R,{x:0,y:0,width:this.options.renderer.width-this.space(1),options:{spacing_between_lines_px:this.options.stave.space*1.3}});const F=new TabStave(R.x,R.y,R.width,R.options);return this.staves.push(F),F.setContext(this.context),this.stave=F,F}StaveNote(R){const F=new StaveNote(R);return this.stave&&F.setStave(this.stave),F.setContext(this.context),this.renderQ.push(F),F}GhostNote(R){const F=new GhostNote(R);return this.stave&&F.setStave(this.stave),F.setContext(this.context),this.renderQ.push(F),F}TextNote(R){const F=new TextNote(R);return this.stave&&F.setStave(this.stave),F.setContext(this.context),this.renderQ.push(F),F}NumberedNote(R){const F=new NumberedNote(R);return this.stave&&F.setStave(this.stave),F.setContext(this.context),this.renderQ.push(F),F}BarNote(R){R=setDefaults$1(R,{type:"single",options:{}});const F=new BarNote(R.type);return this.stave&&F.setStave(this.stave),F.setContext(this.context),this.renderQ.push(F),F}ClefNote(R){R=setDefaults$1(R,{type:"treble",options:{size:"default"}});const F=new ClefNote(R.type,R.options.size,R.options.annotation);return this.stave&&F.setStave(this.stave),F.setContext(this.context),this.renderQ.push(F),F}TimeSigNote(R){R=setDefaults$1(R,{time:"4/4",options:{}});const F=new TimeSigNote(R.time);return this.stave&&F.setStave(this.stave),F.setContext(this.context),this.renderQ.push(F),F}KeySigNote(R){const F=new KeySigNote(R.key,R.cancelKey,R.alterKey);return this.stave&&F.setStave(this.stave),F.setContext(this.context),this.renderQ.push(F),F}TabNote(R){const F=new TabNote$1(R);return this.stave&&F.setStave(this.stave),F.setContext(this.context),this.renderQ.push(F),F}GraceNote(R){const F=new GraceNote(R);return this.stave&&F.setStave(this.stave),F.setContext(this.context),F}GraceNoteGroup(R){const F=new GraceNoteGroup(R.notes,R.slur);return F.setContext(this.context),F}Accidental(R){R=setDefaults$1(R,{type:null,options:{}});const F=new Accidental(R.type);return F.setContext(this.context),F}Annotation(R){R=setDefaults$1(R,{text:"p",vJustify:"below",hJustify:"center",fontFamily:"Times",fontSize:14,fontWeight:"bold italic",options:{}});const F=new Annotation(R.text);return F.setJustification(R.hJustify),F.setVerticalJustification(R.vJustify),F.setFont(R.fontFamily,R.fontSize,R.fontWeight),F.setContext(this.context),F}Articulation(R){R=setDefaults$1(R,{type:"a.",position:"above",options:{}});const F=new Articulation$1(R.type);return F.setPosition(R.position),F.setContext(this.context),F}TextDynamics(R){R=setDefaults$1(R,{text:"p",duration:"q",dots:0,line:0,options:{}});const F=new TextDynamics({text:R.text,line:R.line,duration:R.duration,dots:R.dots});return this.stave&&F.setStave(this.stave),F.setContext(this.context),this.renderQ.push(F),F}Fingering(R){R=setDefaults$1(R,{number:"0",position:"left",options:{}});const F=new FretHandFinger(R.number);return F.setPosition(R.position),F.setContext(this.context),F}StringNumber(R){R=setDefaults$1(R,{number:"0",position:"left",options:{}});const F=new StringNumber(R.number);return F.setPosition(R.position),F.setContext(this.context),F}TickContext(){return new TickContext().setContext(this.context)}ModifierContext(){return new ModifierContext}MultiMeasureRest(R){const F=new MultiMeasureRest(R.number_of_measures,R);return F.setContext(this.context),this.renderQ.push(F),F}Voice(R){R=setDefaults$1(R,{time:"4/4",options:{}});const F=new Voice$1(R.time);return this.voices.push(F),F}StaveConnector(R){R=setDefaults$1(R,{top_stave:null,bottom_stave:null,type:"double",options:{}});const F=new StaveConnector(R.top_stave,R.bottom_stave);return F.setType(R.type).setContext(this.context),this.renderQ.push(F),F}Formatter(){return new Formatter}Tuplet(R){R=setDefaults$1(R,{notes:[],options:{}});const F=new Tuplet$1(R.notes,R.options).setContext(this.context);return this.renderQ.push(F),F}Beam(R){R=setDefaults$1(R,{notes:[],options:{autoStem:!1,secondaryBeamBreaks:[]}});const F=new Beam$1(R.notes,R.options.autoStem).setContext(this.context);return F.breakSecondaryAt(R.options.secondaryBeamBreaks),this.renderQ.push(F),F}Curve(R){R=setDefaults$1(R,{from:null,to:null,options:{}});const F=new Curve(R.from,R.to,R.options).setContext(this.context);return this.renderQ.push(F),F}StaveTie(R){R=setDefaults$1(R,{from:null,to:null,first_indices:[0],last_indices:[0],text:null,options:{direction:void 0}});const F=new StaveTie({first_note:R.from,last_note:R.to,first_indices:R.first_indices,last_indices:R.last_indices},R.text);return R.options.direction&&F.setDirection(R.options.direction),F.setContext(this.context),this.renderQ.push(F),F}StaveLine(R){R=setDefaults$1(R,{from:null,to:null,first_indices:[0],last_indices:[0],options:{}});const F=new StaveLine({first_note:R.from,last_note:R.to,first_indices:R.first_indices,last_indices:R.last_indices});return R.options.text&&F.setText(R.options.text),R.options.font&&F.setFont(R.options.font),F.setContext(this.context),this.renderQ.push(F),F}VibratoBracket(R){R=setDefaults$1(R,{from:null,to:null,options:{harsh:!1}});const F=new VibratoBracket({start:R.from,stop:R.to});return R.options.line&&F.setLine(R.options.line),R.options.harsh&&F.setHarsh(R.options.harsh),F.setContext(this.context),this.renderQ.push(F),F}TextBracket(R){R=setDefaults$1(R,{from:null,to:null,text:"",options:{superscript:"",position:1}});const F=new TextBracket({start:R.from,stop:R.to,text:R.text,superscript:R.options.superscript,position:R.options.position});return R.options.line&&F.setLine(R.options.line),R.options.font&&F.setFont(R.options.font),F.setContext(this.context),this.renderQ.push(F),F}System(R={}){R.factory=this;const F=new System(R).setContext(this.context);return this.systems.push(F),F}EasyScore(R={}){return R.factory=this,new EasyScore(R)}PedalMarking(R={}){R=setDefaults$1(R,{notes:[],options:{style:"mixed"}});const F=new PedalMarking(R.notes);return F.setStyle(PedalMarking.StylesString[R.options.style]),F.setContext(this.context),this.renderQ.push(F),F}NoteSubGroup(R={}){R=setDefaults$1(R,{notes:[],options:{}});const F=new NoteSubGroup$1(R.notes);return F.setContext(this.context),F}draw(){this.systems.forEach(R=>R.setContext(this.context).format()),this.staves.forEach(R=>R.setContext(this.context).draw()),this.voices.forEach(R=>R.setContext(this.context).draw()),this.renderQ.forEach(R=>{R.isRendered()||R.setContext(this.context).draw()}),this.systems.forEach(R=>R.setContext(this.context).draw()),this.reset()}}function setDefaults(B,R){const F=R.options;return B=Object.assign(R,B),B.options=Object.assign(F,B.options),B}class System extends Element$1{constructor(R={}){super(),this.setAttribute("type","System"),this.setOptions(R),this.parts=[]}setOptions(R={}){this.options=setDefaults(R,{x:10,y:10,width:500,connector:null,spaceBetweenStaves:12,factory:null,debugFormatter:!1,formatIterations:0,options:{}}),this.factory=this.options.factory||new Factory({renderer:{el:null}})}setContext(R){return super.setContext(R),this.factory.setContext(R),this}addConnector(R="double"){return this.connector=this.factory.StaveConnector({top_stave:this.parts[0].stave,bottom_stave:this.parts[this.parts.length-1].stave,type:R}),this.connector}addStave(R){return R=setDefaults(R,{stave:null,voices:[],spaceAbove:0,spaceBelow:0,debugNoteMetrics:!1,options:{left_bar:!1}}),R.stave||(R.stave=this.factory.Stave({x:this.options.x,y:this.options.y,width:this.options.width,options:R.options})),R.voices.forEach(F=>F.setContext(this.context).setStave(R.stave).getTickables().forEach(D=>D.setStave(R.stave))),this.parts.push(R),R.stave}format(){const R=new Formatter;this.formatter=R;let F=this.options.y,D=0,G=[];const U=[];this.parts.forEach(q=>{F=F+q.stave.space(q.spaceAbove),q.stave.setY(F),R.joinVoices(q.voices),F=F+q.stave.space(q.spaceBelow),F=F+q.stave.space(this.options.spaceBetweenStaves),q.debugNoteMetrics&&(U.push({y:F,voice:q.voices[0]}),F+=15),G=G.concat(q.voices),D=Math.max(D,q.stave.getNoteStartX())}),this.parts.forEach(q=>q.stave.setNoteStartX(D));const W=this.options.width-(D-this.options.x)-Note.STAVEPADDING;R.format(G,W);for(let q=0;q{F.voice.getTickables().forEach(D=>Note.plotMetrics(R,D,F.y))})}}Vex.Flow=Flow;Vex.Flow.Element=Element$1;Vex.Flow.Fraction=Fraction;Vex.Flow.Renderer=Renderer;Vex.Flow.Formatter=Formatter;Vex.Flow.Music=Music;Vex.Flow.Glyph=Glyph;Vex.Flow.Stave=Stave;Vex.Flow.StaveNote=StaveNote;Vex.Flow.StaveModifier=StaveModifier;Vex.Flow.StaveTempo=StaveTempo;Vex.Flow.Voice=Voice$1;Vex.Flow.Accidental=Accidental;Vex.Flow.Beam=Beam$1;Vex.Flow.StaveTie=StaveTie;Vex.Flow.TabStave=TabStave;Vex.Flow.TabNote=TabNote$1;Vex.Flow.Bend=Bend;Vex.Flow.Vibrato=Vibrato;Vex.Flow.VibratoBracket=VibratoBracket;Vex.Flow.Note=Note;Vex.Flow.ModifierContext=ModifierContext;Vex.Flow.MultiMeasureRest=MultiMeasureRest;Vex.Flow.TickContext=TickContext;Vex.Flow.Articulation=Articulation$1;Vex.Flow.Annotation=Annotation;Vex.Flow.Barline=Barline;Vex.Flow.NoteHead=NoteHead;Vex.Flow.StaveConnector=StaveConnector;Vex.Flow.ClefNote=ClefNote;Vex.Flow.KeySignature=KeySignature;Vex.Flow.KeySigNote=KeySigNote;Vex.Flow.TimeSignature=TimeSignature;Vex.Flow.TimeSigNote=TimeSigNote;Vex.Flow.Stem=Stem;Vex.Flow.TabTie=TabTie;Vex.Flow.Clef=Clef;Vex.Flow.Dot=Dot;Vex.Flow.Modifier=Modifier;Vex.Flow.TabSlide=TabSlide;Vex.Flow.Tuplet=Tuplet$1;Vex.Flow.GraceNote=GraceNote;Vex.Flow.GraceTabNote=GraceTabNote;Vex.Flow.Tuning=Tuning;Vex.Flow.KeyManager=KeyManager;Vex.Flow.StaveHairpin=StaveHairpin;Vex.Flow.BoundingBox=BoundingBox;Vex.Flow.Stroke=Stroke;Vex.Flow.TextNote=TextNote;Vex.Flow.Curve=Curve;Vex.Flow.TextDynamics=TextDynamics;Vex.Flow.StaveLine=StaveLine;Vex.Flow.Ornament=Ornament;Vex.Flow.PedalMarking=PedalMarking;Vex.Flow.TextBracket=TextBracket;Vex.Flow.FretHandFinger=FretHandFinger;Vex.Flow.Repetition=Repetition$1;Vex.Flow.BarNote=BarNote;Vex.Flow.GhostNote=GhostNote;Vex.Flow.NoteSubGroup=NoteSubGroup$1;Vex.Flow.GraceNoteGroup=GraceNoteGroup;Vex.Flow.Tremolo=Tremolo;Vex.Flow.StringNumber=StringNumber;Vex.Flow.Crescendo=Crescendo;Vex.Flow.Volta=Volta;Vex.Flow.Font=Font;Vex.Flow.System=System;Vex.Flow.Factory=Factory;Vex.Flow.Parser=Parser;Vex.Flow.EasyScore=EasyScore;Vex.Flow.Registry=Registry;var SystemLinesEnum=(B=>(B[B.SingleThin=0]="SingleThin",B[B.DoubleThin=1]="DoubleThin",B[B.ThinBold=2]="ThinBold",B[B.BoldThinDots=3]="BoldThinDots",B[B.DotsThinBold=4]="DotsThinBold",B[B.DotsBoldBoldDots=5]="DotsBoldBoldDots",B[B.None=6]="None",B[B.Dotted=7]="Dotted",B[B.Dashed=8]="Dashed",B[B.Bold=9]="Bold",B[B.BoldThin=10]="BoldThin",B[B.DoubleBold=11]="DoubleBold",B[B.Tick=12]="Tick",B[B.Short=13]="Short",B))(SystemLinesEnum||{});class SystemLinesEnumHelper{static xmlBarlineStyleToSystemLinesEnum(R){return R==="regular"?0:R==="dotted"?7:R==="dashed"?8:R==="heavy"?9:R==="light-light"?1:R==="light-heavy"?2:R==="heavy-light"?10:R==="heavy-heavy"?11:R==="tick"?12:R==="short"?13:R==="none"?6:0}}class Matrix2D{constructor(){this.matrix=[];for(let R=0;R<2;R++){this.matrix[R]=[];for(let F=0;F<2;F++)this.matrix[R][F]=0}}static getRotationMatrix(R){const F=new Matrix2D,D=Math.cos(R),G=Math.sin(R);return F.matrix[0][0]=D,F.matrix[0][1]=-G,F.matrix[1][0]=G,F.matrix[1][1]=D,F}scalarMultiplication(R){for(let F=0;F<2;F++)for(let D=0;D<2;D++)this.matrix[F][D]*=R}getTransposeMatrix(){const R=new Matrix2D;for(let F=0;F<2;F++)for(let D=0;D<2;D++)R.matrix[F][D]=this.matrix[D][F];return R}vectorMultiplication(R){const F=new PointF2D;return F.x=R.x*this.matrix[0][0]+R.y*this.matrix[0][1],F.y=R.x*this.matrix[1][0]+R.y*this.matrix[1][1],F}}class MusicSheetErrors{constructor(){this.measureErrors={},this.errors=[],this.tempErrors=[]}finalizeMeasure(R){let F=this.measureErrors[R];F||(F=[]),this.measureErrors[R]=F.concat(this.tempErrors),this.tempErrors=[]}pushMeasureError(R){this.tempErrors.push(R)}push(R){this.errors.push(R)}}class Arpeggio{constructor(R,F=ArpeggioType.ARPEGGIO_DIRECTIONLESS){this.parentVoiceEntry=R,this.type=F,this.notes=[]}addNote(R){this.notes.push(R),R.Arpeggio=this}}var ArpeggioType=(B=>(B[B.BRUSH_DOWN=1]="BRUSH_DOWN",B[B.BRUSH_UP=2]="BRUSH_UP",B[B.ROLL_DOWN=3]="ROLL_DOWN",B[B.ROLL_UP=4]="ROLL_UP",B[B.RASQUEDO_DOWN=5]="RASQUEDO_DOWN",B[B.RASQUEDO_UP=6]="RASQUEDO_UP",B[B.ARPEGGIO_DIRECTIONLESS=7]="ARPEGGIO_DIRECTIONLESS",B))(ArpeggioType||{});class Beam{constructor(R=1,F=0){this.notes=[],this.extendedNoteList=[],this.BeamNumberOffsetToXML=0,this.BeamNumber=R,this.BeamNumberOffsetToXML=F}get Notes(){return this.notes}set Notes(R){this.notes=R}get ExtendedNoteList(){return this.extendedNoteList}set ExtendedNoteList(R){this.extendedNoteList=R}addNoteToBeam(R){R&&(R.NoteBeam=this,this.notes.push(R),this.extendedNoteList.push(R))}}class Voice{constructor(R,F){this.voiceEntries=[],this.volume=1,this.parent=R,this.visible=!0,this.audible=!0,this.following=!0,this.voiceId=F,this.uniqueVoiceId="I:"+this.parent.Id+" V: "+this.voiceId}get VoiceEntries(){return this.voiceEntries}get Parent(){return this.parent}get Visible(){return this.visible}set Visible(R){this.visible=R}get Audible(){return this.audible}set Audible(R){this.audible=R}get Following(){return this.following}set Following(R){this.following=R}get Solo(){return this.solo}set Solo(R){this.solo=R}get VoiceId(){return this.voiceId}get Volume(){return this.volume}set Volume(R){this.volume=R}toString(){return this.uniqueVoiceId}}class LinkedVoice extends Voice{constructor(R,F,D){super(R,F),this.master=D}get Master(){return this.master}}class Notehead{constructor(R,F,D=void 0){this.sourceNote=R,this.setShapeFromXml(F,D)}setShapeFromXml(R,F=void 0){this.shape=Notehead.ShapeTypeXmlToShape(R);let D=F;D===void 0&&(this.sourceNote?D=this.sourceNote.Length.Denominator>2:(log$2.warn("notehead: sourceNote and filledXmlAttribute undefined."),D=!0)),this.filled=D}get SourceNote(){return this.sourceNote}get Shape(){return this.shape}get Filled(){return this.filled}static ShapeTypeXmlToShape(R){switch(R.toLowerCase()){case"normal":return NoteHeadShape.NORMAL;case"x":return NoteHeadShape.X;case"slash":return NoteHeadShape.SLASH;case"diamond":return NoteHeadShape.DIAMOND;case"square":return NoteHeadShape.SQUARE;case"la":return NoteHeadShape.SQUARE;case"do":case"triangle":return NoteHeadShape.TRIANGLE;case"rectangle":return NoteHeadShape.RECTANGLE;case"circle-x":return NoteHeadShape.CIRCLEX;default:return log$2.info("unsupported/unhandled xml notehead '"+R+"'. Using normal notehead."),NoteHeadShape.NORMAL}}}var NoteHeadShape=(B=>(B[B.CIRCLEX=0]="CIRCLEX",B[B.DIAMOND=1]="DIAMOND",B[B.NORMAL=2]="NORMAL",B[B.RECTANGLE=3]="RECTANGLE",B[B.SLASH=4]="SLASH",B[B.SQUARE=5]="SQUARE",B[B.TRIANGLE=6]="TRIANGLE",B[B.X=7]="X",B))(NoteHeadShape||{});class ITextTranslation{static translateText(R,F){if(!this.defaultTextTranslation)return F}}var NoteType=(B=>(B[B.UNDEFINED=0]="UNDEFINED",B[B._1024th=1]="_1024th",B[B._512th=2]="_512th",B[B._256th=3]="_256th",B[B._128th=4]="_128th",B[B._64th=5]="_64th",B[B._32nd=6]="_32nd",B[B._16th=7]="_16th",B[B.EIGTH=8]="EIGTH",B[B.QUARTER=9]="QUARTER",B[B.HALF=10]="HALF",B[B.WHOLE=11]="WHOLE",B[B.BREVE=12]="BREVE",B[B.LONG=13]="LONG",B[B.MAXIMA=14]="MAXIMA",B))(NoteType||{});class NoteTypeHandler{static NoteTypeToString(R){return this.NoteTypeXmlValues[R]}static StringToNoteType(R){const F=this.NoteTypeXmlValues.indexOf(R);return F!==-1?F:0}static getNoteDurationFromType(R){switch(R){case"1024th":return new Fraction$1(1,1024);case"512th":return new Fraction$1(1,512);case"256th":return new Fraction$1(1,256);case"128th":return new Fraction$1(1,128);case"64th":return new Fraction$1(1,64);case"32th":case"32nd":return new Fraction$1(1,32);case"16th":return new Fraction$1(1,16);case"eighth":return new Fraction$1(1,8);case"quarter":return new Fraction$1(1,4);case"half":return new Fraction$1(1,2);case"whole":return new Fraction$1(1,1);case"breve":return new Fraction$1(2,1);case"long":return new Fraction$1(4,1);case"maxima":return new Fraction$1(8,1);default:{const F=ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid note duration.");throw new MusicSheetReadingException(F)}}}}NoteTypeHandler.NoteTypeXmlValues=["","1024th","512th","256th","128th","64th","32nd","16th","eigth","quarter","half","whole","breve","long","maxima"];class OrnamentContainer{constructor(R){this.placement=PlacementEnum.Above,this.accidentalAbove=AccidentalEnum.NONE,this.accidentalBelow=AccidentalEnum.NONE,this.ornament=R}get GetOrnament(){return this.ornament}get AccidentalAbove(){return this.accidentalAbove}set AccidentalAbove(R){this.accidentalAbove=R}get AccidentalBelow(){return this.accidentalBelow}set AccidentalBelow(R){this.accidentalBelow=R}}var OrnamentEnum=(B=>(B[B.Trill=0]="Trill",B[B.Turn=1]="Turn",B[B.InvertedTurn=2]="InvertedTurn",B[B.DelayedTurn=3]="DelayedTurn",B[B.DelayedInvertedTurn=4]="DelayedInvertedTurn",B[B.Mordent=5]="Mordent",B[B.InvertedMordent=6]="InvertedMordent",B))(OrnamentEnum||{});class VerticalSourceStaffEntryContainer{constructor(R,F,D){this.staffEntries=[],this.comments=[],this.timestamp=F,this.staffEntries=new Array(D),this.parentMeasure=R}$get$(R){return this.staffEntries[R]}$set$(R,F){this.staffEntries[R]=F}get Timestamp(){return this.timestamp}set Timestamp(R){this.timestamp=R}get StaffEntries(){return this.staffEntries}set StaffEntries(R){this.staffEntries=R}get Comments(){return this.comments}set Comments(R){this.comments=R}get ParentMeasure(){return this.parentMeasure}set ParentMeasure(R){this.parentMeasure=R}getAbsoluteTimestamp(){return Fraction$1.plus(this.timestamp,this.parentMeasure.AbsoluteTimestamp)}}class SourceStaffEntry{constructor(R,F){this.voiceEntries=[],this.instructions=[],this.chordSymbolContainers=[],this.verticalContainerParent=R,this.parentStaff=F}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 Fraction$1.plus(this.VerticalContainerParent.ParentMeasure.AbsoluteTimestamp,this.VerticalContainerParent.Timestamp)}get VoiceEntries(){return this.voiceEntries}set VoiceEntries(R){this.voiceEntries=R}get Link(){return this.staffEntryLink}set Link(R){this.staffEntryLink=R}get Instructions(){return this.instructions}set Instructions(R){this.instructions=R}get ChordContainers(){return this.chordSymbolContainers}set ChordContainers(R){this.chordSymbolContainers=R}removeAllInstructionsOfTypeClefInstruction(){let R=0,F=0;for(;R0)return!0;return!1}hasTie(){for(let R=0,F=this.VoiceEntries.length;RF.parentRepetition.StartIndex)return-1}if(R.alignment===AlignmentType.Begin&&F.alignment===AlignmentType.Begin){if(R.parentRepetition.EndIndexF.parentRepetition.EndIndex)return-1}}return 0}}class RepetitionInstruction{constructor(R,F,D=AlignmentType.End,G=void 0,U=void 0){this.endingIndices=void 0,this.measureIndex=R,U&&(this.endingIndices=U.slice()),this.type=F,this.alignment=D,this.parentRepetition=G}CompareTo(R){const F=R;if(this.measureIndex>F.measureIndex)return 1;if(this.measureIndex(B[B.StartLine=0]="StartLine",B[B.ForwardJump=1]="ForwardJump",B[B.BackJumpLine=2]="BackJumpLine",B[B.Ending=3]="Ending",B[B.DaCapo=4]="DaCapo",B[B.DalSegno=5]="DalSegno",B[B.Fine=6]="Fine",B[B.ToCoda=7]="ToCoda",B[B.DalSegnoAlFine=8]="DalSegnoAlFine",B[B.DaCapoAlFine=9]="DaCapoAlFine",B[B.DalSegnoAlCoda=10]="DalSegnoAlCoda",B[B.DaCapoAlCoda=11]="DaCapoAlCoda",B[B.Coda=12]="Coda",B[B.Segno=13]="Segno",B[B.None=14]="None",B))(RepetitionInstructionEnum||{}),AlignmentType=(B=>(B[B.Begin=0]="Begin",B[B.End=1]="End",B))(AlignmentType||{});let prevSourceMeasure=null;class SourceMeasure{constructor(R,F){this.printNewSystemXml=!1,this.printNewPageXml=!1,this.IsSystemStartMeasure=!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.metronomeNoteIndex=0,this.completeNumberOfStaves=R,this.implicitMeasure=!1,this.hasEndLine=!1,this.endingBarStyleXml="",this.endingBarStyleEnum=SystemLinesEnum.SingleThin,this.firstInstructionsStaffEntries=new Array(R),this.lastInstructionsStaffEntries=new Array(R),this.rules=F,this.TempoInBPM=0;for(let D=0;D1)return R[this.measureListIndex-1]}get Rules(){return this.rules}get VerticalMeasureList(){return this.verticalMeasureList}set VerticalMeasureList(R){this.verticalMeasureList=R}get TempoInBPM(){return this.tempoInBPM}set TempoInBPM(R){this.tempoInBPM=R}findOrCreateStaffEntry(R,F,D){let G,U;for(const q of this.verticalSourceStaffEntryContainers)if(q.Timestamp.Equals(R)){U=q;break}if(U)return U.StaffEntries[F]?G=U.StaffEntries[F]:(G=new SourceStaffEntry(U,D),U.StaffEntries[F]=G),{createdNewContainer:!1,staffEntry:G};const W=this.verticalSourceStaffEntryContainers[this.verticalSourceStaffEntryContainers.length-1];if(this.verticalSourceStaffEntryContainers.length===0||W.Timestamp.lt(R)){const q=new VerticalSourceStaffEntryContainer(this,R.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.push(q),G=new SourceStaffEntry(q,D),q.StaffEntries[F]=G}else for(let q=this.verticalSourceStaffEntryContainers.length-1;q>=0;q--){if(this.verticalSourceStaffEntryContainers[q].Timestamp.lt(R)){const Y=new VerticalSourceStaffEntryContainer(this,R.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(q+1,0,Y),G=new SourceStaffEntry(Y,D),Y.StaffEntries[F]=G;break}if(q===0){const Y=new VerticalSourceStaffEntryContainer(this,R.clone(),this.completeNumberOfStaves);this.verticalSourceStaffEntryContainers.splice(q,0,Y),G=new SourceStaffEntry(Y,D),Y.StaffEntries[F]=G;break}}return{createdNewContainer:!0,staffEntry:G}}findOrCreateVoiceEntry(R,F){let D,G=!1;for(const U of R.VoiceEntries)if(U.ParentVoice===F){D=U;break}return D||(D=new VoiceEntry(R.Timestamp,F,R),G=!0),{createdVoiceEntry:G,voiceEntry:D}}getPreviousSourceStaffEntryFromIndex(R,F){for(let D=F-1;D>=0;D--)if(this.verticalSourceStaffEntryContainers[D][R])return this.verticalSourceStaffEntryContainers[D][R]}getVerticalContainerIndexByTimestamp(R){for(let F=0,D=this.VerticalSourceStaffEntryContainers.length;F=0;K--){const te=this.verticalSourceStaffEntryContainers[K][q+Y];if(te!==void 0&&te.hasTie()&&W.lt(Fraction$1.plus(te.Timestamp,te.calculateMaxNoteLength()))){W=Fraction$1.plus(te.Timestamp,te.calculateMaxNoteLength());break}}}}G.push(W)}for(let U=0,W=G.length;U0)return!0}return!1}beginsWithLineRepetition(){for(let R=0,F=this.FirstRepetitionInstructions.length;R=0&&(F=this.verticalSourceStaffEntryContainers[D].StaffEntries[R],!F);D--);return F}canBeReducedToMultiRest(){var D,G,U,W,q,Y;let R=!0,F=!1;for(const J of this.verticalSourceStaffEntryContainers)if(!!J){for(const Z of J.StaffEntries)if(!(!Z||!Z.ParentStaff.ParentInstrument.Visible)){if(Z.ChordContainers.length>0||(Z.ParentStaff.hasLyrics&&(F=!0),this.firstRepetitionInstructions.length>0||this.lastRepetitionInstructions.length>0))return!1;for(const K of Z.VoiceEntries){for(const te of K.Notes)if(!te.isRest()){R=!1;break}if(!R)break}}}if(!R||F||this.hasMoodExpressions||this.tempoExpressions.length>0)return!1;for(const J of this.staffLinkedExpressions)if(J.length>0)return!1;for(const J of this.lastInstructionsStaffEntries)for(let Z=0,K=J==null?void 0:J.Instructions.length;Z=0;F--)for(let D=0;D(B[B.Fingering=0]="Fingering",B[B.String=1]="String",B))(TechnicalInstructionType||{});class TechnicalInstruction{}class PlaybackNote{constructor(R,F){this.parentEntry=R,this.parentNote=F,this.ParentNote.PlaybackNote=this,this.Length=this.ParentNote.Length,F.Pitch!==void 0?this.ParentNote.ParentStaff.ParentInstrument.MidiInstrumentId===MidiInstrument.Percussion?this.MidiKey=PlaybackNote.noteToMidiDrumKey(F):this.MidiKey=F.Pitch.getHalfTone()+12:this.MidiKey=0}setLength(){this.ParentNote.NoteTie!==void 0&&this.ParentNote.NoteTie.StartNote===this.ParentNote&&(this.Length=this.ParentNote.NoteTie.Duration)}get ParentEntry(){return this.parentEntry}get ParentNote(){return this.parentNote}static noteToMidiDrumKey(R){var G;const F=R.Pitch.getHalfTone()-12,D=(G=R.Notehead)==null?void 0:G.Shape;switch(R.Pitch.Octave){case 1:switch(R.Pitch.FundamentalNote){case NoteEnum.D:switch(D){default:return 44}case NoteEnum.E:switch(D){default:return 35}case NoteEnum.F:switch(D){default:return 36}case NoteEnum.G:switch(D){default:return 41}case NoteEnum.A:switch(D){default:return 43}case NoteEnum.B:switch(D){case NoteHeadShape.TRIANGLE:return 54;default:return 47}default:return F}case 2:switch(R.Pitch.FundamentalNote){case NoteEnum.C:switch(D){case NoteHeadShape.X:return 37;default:return 38}case NoteEnum.D:switch(D){case NoteHeadShape.X:return 59;default:return 48}case NoteEnum.E:switch(D){case NoteHeadShape.X:return 42;case NoteHeadShape.CIRCLEX:return 46;case NoteHeadShape.TRIANGLE:return 56;default:return 50}case NoteEnum.F:switch(D){case NoteHeadShape.DIAMOND:return 53;default:return 51}case NoteEnum.G:switch(D){case NoteHeadShape.CIRCLEX:case NoteHeadShape.DIAMOND:return 46;default:return 42}case NoteEnum.A:switch(D){default:return 49}case NoteEnum.B:switch(D){default:return 57}default:return F}case 3:switch(R.Pitch.FundamentalNote){case NoteEnum.C:switch(D){case NoteHeadShape.CIRCLEX:return 52;default:return 55}default:return F}default:return F}}}class PlaybackEntry{constructor(R){this.notes=[],this.TimestampShift=new Fraction$1,this.parentVoiceEntry=R;for(const F of R.Notes)this.Notes.push(new PlaybackNote(this,F))}get ParentVoiceEntry(){return this.parentVoiceEntry}get Notes(){return this.notes}get Length(){if(this.Notes.length>0)return this.Notes[0].Length}set Length(R){for(const F of this.Notes)F.Length=R}get HasNotes(){return this.Notes.length>0}}class VoiceEntry{constructor(R,F,D,G=!0,U=!1,W=!1,q=!1){if(this.notes=[],this.graceVoiceEntriesBefore=[],this.graceVoiceEntriesAfter=[],this.articulations=[],this.playbackEntries=[],this.technicalInstructions=[],this.lyricsEntries=new Dictionary,this.wantedStemDirection=StemDirectionType.Undefined,this.stemDirectionXml=StemDirectionType.Undefined,this.stemDirection=StemDirectionType.Undefined,this.timestamp=R,this.parentVoice=F,this.parentSourceStaffEntry=D,this.isGrace=U,this.graceAfterMainNote=!1,this.graceNoteSlash=W,this.graceSlur=q,U||F.VoiceEntries.push(this),G&&D!==void 0){const Y=D.VoiceEntries;Y.indexOf(this)===-1&&Y.push(this)}this.mainPlaybackEntry=new PlaybackEntry(this),this.PlaybackEntries.push(this.mainPlaybackEntry)}get ParentSourceStaffEntry(){return this.parentSourceStaffEntry}get ParentVoice(){return this.parentVoice}get Timestamp(){return this.timestamp}set Timestamp(R){this.timestamp=R}get Notes(){return this.notes}addNote(R){this.notes.push(R),!R.isRest()&&(R.NoteTie===void 0||R.NoteTie.StartNote===R)&&this.MainPlaybackEntry.Notes.push(new PlaybackNote(this.MainPlaybackEntry,R))}get GraceVoiceEntriesBefore(){return this.graceVoiceEntriesBefore}set GraceVoiceEntriesBefore(R){this.graceVoiceEntriesBefore=R;for(const F of this.graceVoiceEntriesBefore)F.parentSourceStaffEntry=this.ParentSourceStaffEntry}get GraceVoiceEntriesAfter(){return this.graceVoiceEntriesAfter}set GraceVoiceEntriesAfter(R){this.graceVoiceEntriesAfter=R;for(const F of this.graceVoiceEntriesAfter)F.parentSourceStaffEntry=this.ParentSourceStaffEntry}get IsGrace(){return this.isGrace}set IsGrace(R){this.isGrace=R}get GraceAfterMainNote(){return this.graceAfterMainNote}set GraceAfterMainNote(R){this.graceAfterMainNote=R}get GraceNoteSlash(){return this.graceNoteSlash}set GraceNoteSlash(R){this.graceNoteSlash=R}get GraceSlur(){return this.graceSlur}set GraceSlur(R){this.graceSlur=R}get Articulations(){return this.articulations}get PlaybackEntries(){return this.playbackEntries}get Fermata(){return this.fermata}get MainPlaybackEntry(){return this.mainPlaybackEntry}set MainPlaybackEntry(R){this.mainPlaybackEntry=R}removeMainPlaybackEntry(){this.mainPlaybackEntry!==void 0&&this.removePlaybackEntry(this.mainPlaybackEntry)}removePlaybackEntry(R){this.mainPlaybackEntry===R&&(this.mainPlaybackEntry=void 0);const F=this.playbackEntries.indexOf(R);F>-1&&this.playbackEntries.splice(F,1)}get TechnicalInstructions(){return this.technicalInstructions}get LyricsEntries(){return this.lyricsEntries}get Arpeggio(){return this.arpeggio}set Arpeggio(R){this.arpeggio=R}get OrnamentContainer(){return this.ornamentContainer}set OrnamentContainer(R){this.ornamentContainer=R}set WantedStemDirection(R){this.wantedStemDirection=R}get WantedStemDirection(){return this.wantedStemDirection}set StemDirectionXml(R){this.stemDirectionXml=R}get StemDirectionXml(){return this.stemDirectionXml}set StemDirection(R){this.stemDirection=R}get StemDirection(){return this.stemDirection}get StemColorXml(){return this.stemColorXml}set StemColorXml(R){this.stemColorXml=R}get StemColor(){return this.stemColor}set StemColor(R){this.stemColor=R}get VolumeModifier(){return this.volumeModifier}set VolumeModifier(R){this.volumeModifier=R}get DurationModifier(){return this.durationModifier}set DurationModifier(R){this.durationModifier=R}hasArticulation(R){for(const F of this.articulations)if(F.Equals(R))return!0;return!1}static isSupportedArticulation(R){switch(R){case ArticulationEnum.accent:case ArticulationEnum.strongaccent:case ArticulationEnum.invertedstrongaccent:case ArticulationEnum.staccato:case ArticulationEnum.staccatissimo:case ArticulationEnum.spiccato:case ArticulationEnum.tenuto:case ArticulationEnum.fermata:case ArticulationEnum.invertedfermata:case ArticulationEnum.breathmark:case ArticulationEnum.caesura:case ArticulationEnum.lefthandpizzicato:case ArticulationEnum.naturalharmonic:case ArticulationEnum.snappizzicato:case ArticulationEnum.upbow:case ArticulationEnum.downbow:case ArticulationEnum.bend:case ArticulationEnum.detachedlegato:return!0;default:return!1}}hasTie(){for(let R=0,F=this.Notes.length;R0)return!0;return!1}isStaccato(){for(const R of this.Articulations)if(R.articulationEnum===ArticulationEnum.staccato)return!0;return!1}isAccent(){for(const R of this.Articulations)if(R.articulationEnum===ArticulationEnum.accent||R.articulationEnum===ArticulationEnum.strongaccent)return!0;return!1}getVerseNumberForLyricEntry(R){let F=1;return this.lyricsEntries.forEach((D,G)=>{R===G&&(F=D)}),F}}var ArticulationEnum=(B=>(B[B.accent=0]="accent",B[B.strongaccent=1]="strongaccent",B[B.marcatoup=2]="marcatoup",B[B.marcatodown=3]="marcatodown",B[B.invertedstrongaccent=4]="invertedstrongaccent",B[B.staccato=5]="staccato",B[B.staccatissimo=6]="staccatissimo",B[B.spiccato=7]="spiccato",B[B.tenuto=8]="tenuto",B[B.fermata=9]="fermata",B[B.invertedfermata=10]="invertedfermata",B[B.breathmark=11]="breathmark",B[B.caesura=12]="caesura",B[B.lefthandpizzicato=13]="lefthandpizzicato",B[B.naturalharmonic=14]="naturalharmonic",B[B.snappizzicato=15]="snappizzicato",B[B.upbow=16]="upbow",B[B.downbow=17]="downbow",B[B.scoop=18]="scoop",B[B.plop=19]="plop",B[B.doit=20]="doit",B[B.falloff=21]="falloff",B[B.stress=22]="stress",B[B.unstress=23]="unstress",B[B.detachedlegato=24]="detachedlegato",B[B.otherarticulation=25]="otherarticulation",B[B.bend=26]="bend",B))(ArticulationEnum||{}),StemDirectionType=(B=>(B[B.Undefined=-1]="Undefined",B[B.Up=0]="Up",B[B.Down=1]="Down",B[B.None=2]="None",B[B.Double=3]="Double",B))(StemDirectionType||{}),SystemLinePosition=(B=>(B[B.MeasureBegin=0]="MeasureBegin",B[B.MeasureEnd=1]="MeasureEnd",B))(SystemLinePosition||{});class GraphicalLabel extends Clickable{constructor(R,F,D,G,U=void 0){super(),this.label=R,this.boundingBox=new BoundingBox$1(this,U),this.label.fontHeight=F,this.label.textAlignment=D,this.rules=G,this.rules.MpatMode&&this.label.text==="TRIO"&&(this.label.fontFamily="Arial")}get Label(){return this.label}toString(){return`${this.label.text} (${this.boundingBox.RelativePosition.x},${this.boundingBox.RelativePosition.y})`}setLabelPositionAndShapeBorders(){var q,Y;if(this.Label.text.trim()==="")return;this.TextLines=[];const R=(Y=(q=this.rules)==null?void 0:q.LabelMarginBorderFactor)!=null?Y:.1,F=this.Label.text.split(/[\n\r]+/g),D=F.length;let G=0;for(let J=0;J0&&this.TextLines.length>1&&(U+=this.rules.SpacingBetweenTextLines*D/10);const W=this.PositionAndShape;switch(this.Label.textAlignment){case TextAlignmentEnum.CenterBottom:W.BorderTop=-U,W.BorderLeft=-G/2,W.BorderBottom=0,W.BorderRight=G/2;break;case TextAlignmentEnum.CenterCenter:W.BorderTop=-U/2,W.BorderLeft=-G/2,W.BorderBottom=U/2,W.BorderRight=G/2;break;case TextAlignmentEnum.CenterTop:W.BorderTop=0,W.BorderLeft=-G/2,W.BorderBottom=U,W.BorderRight=G/2;break;case TextAlignmentEnum.LeftBottom:W.BorderTop=-U,W.BorderLeft=0,W.BorderBottom=0,W.BorderRight=G;break;case TextAlignmentEnum.LeftCenter:W.BorderTop=-U/2,W.BorderLeft=0,W.BorderBottom=U/2,W.BorderRight=G;break;case TextAlignmentEnum.LeftTop:W.BorderTop=0,W.BorderLeft=0,W.BorderBottom=U,W.BorderRight=G;break;case TextAlignmentEnum.RightBottom:W.BorderTop=-U,W.BorderLeft=-G,W.BorderBottom=0,W.BorderRight=0;break;case TextAlignmentEnum.RightCenter:W.BorderTop=-U/2,W.BorderLeft=-G,W.BorderBottom=U/2,W.BorderRight=0;break;case TextAlignmentEnum.RightTop:W.BorderTop=0,W.BorderLeft=-G,W.BorderBottom=U,W.BorderRight=0;break}W.BorderMarginTop=W.BorderTop-U*R,W.BorderMarginLeft=W.BorderLeft-U*R,W.BorderMarginBottom=W.BorderBottom+U*R,W.BorderMarginRight=W.BorderRight+U*R}}class Label{constructor(R="",F=TextAlignmentEnum.CenterBottom,D=void 0,G=!0){this.IsCreditLabel=!1,this.text=R,this.print=G,this.textAlignment=F,this.font=D,this.fontFamily=void 0}set font(R){this.fontEnumValue=R,this.fontFamily=FontStringNames[R]}get font(){return this.fontEnumValue}ToString(){return this.text}}const SpeedTag={Grava:40,Largo:46,Lento:52,Adagio:56,Larghetto:60,Andante:66,Anderato:69,Andantino:69,Moderato:88,Allegretto:108,"Allegro Moderato":108,Allegro:132,Vivace:152,Vivo:160,Vivacissimo:168,Presto:184,Prestissimo:208},SpecialMarks=["\u7EAF\u5F8B","\u7EAF\u5F8B\u7ED3\u675F"],HideWords=["\u8DF3\u8FC7\u4E0B\u4E00\u4E2A","b","#","\xA7","\xBA","X"],GradientWords=["poco rit.","rall.","rit.","accel.","molto rit.","molto rall","lentando","poco accel.","calando"],GRADIENT_SPEED_CLOSE_TAG="\u7ED3\u675F\u8303\u56F4\u901F\u5EA6",GRADIENT_SPEED_RESET_TAG="a tempo",SpecialWords=[GRADIENT_SPEED_CLOSE_TAG],SpeedKeyword="\u901F\u5EA6 ",SpeedHiddenKeyword="\u4EC5\u6587\u672C\u901F\u5EA6 ";function isSpeedKeyword(B){return B.indexOf(SpeedKeyword)===0}function isSpeedHiddenKeyword(B){return B.indexOf(SpeedHiddenKeyword)===0}function formatSpeedKeyword(B){return B.replace(SpeedHiddenKeyword,"").replace(SpeedKeyword,"")}function isGradientWords(B){return GradientWords.includes(B)}function isSpecialMark(B){return[...Object.keys(SpeedTag),...SpecialMarks,...SpecialWords,...HideWords].map(R=>R.trim().toLocaleUpperCase()).includes(B.toLocaleUpperCase().trim())}function isTopFont(B){return[TextAlignmentEnum.CenterTop,TextAlignmentEnum.RightTop].includes(B)}var MusicSymbol=(B=>(B[B.Unused_first_Symbol=0]="Unused_first_Symbol",B[B.BLACK_HEAD=1]="BLACK_HEAD",B[B.UPWARDS_TAIL=2]="UPWARDS_TAIL",B[B.DOWNWARDS_TAIL=3]="DOWNWARDS_TAIL",B[B.UPWARDS_DOUBLE_TAIL=4]="UPWARDS_DOUBLE_TAIL",B[B.DOWNWARDS_DOUBLE_TAIL=5]="DOWNWARDS_DOUBLE_TAIL",B[B.UPWARDS_TRIPLE_TAIL=6]="UPWARDS_TRIPLE_TAIL",B[B.DOWNWARDS_TRIPLE_TAIL=7]="DOWNWARDS_TRIPLE_TAIL",B[B.UPWARDS_QUAD_TAIL=8]="UPWARDS_QUAD_TAIL",B[B.DOWNWARDS_QUAD_TAIL=9]="DOWNWARDS_QUAD_TAIL",B[B.ROUND_HEAD=10]="ROUND_HEAD",B[B.WHITE_HEAD=11]="WHITE_HEAD",B[B.G_CLEF=12]="G_CLEF",B[B.F_CLEF=13]="F_CLEF",B[B.C_CLEF=14]="C_CLEF",B[B.BREVE=15]="BREVE",B[B.BREVE_REST=16]="BREVE_REST",B[B.COMMON_TIME=17]="COMMON_TIME",B[B.CUT_TIME=18]="CUT_TIME",B[B.WHOLE_REST=19]="WHOLE_REST",B[B.HALF_REST=20]="HALF_REST",B[B.QUARTER_REST=21]="QUARTER_REST",B[B.EIGHTH_REST=22]="EIGHTH_REST",B[B.SIXTEENTH_REST=23]="SIXTEENTH_REST",B[B.THIRTYSECOND_REST=24]="THIRTYSECOND_REST",B[B.SIXTYFOURTH_REST=25]="SIXTYFOURTH_REST",B[B.FLAT=26]="FLAT",B[B.SHARP=27]="SHARP",B[B.NATURAL=28]="NATURAL",B[B.DOUBLE_FLAT=29]="DOUBLE_FLAT",B[B.DOUBLE_SHARP=30]="DOUBLE_SHARP",B[B.ZERO=31]="ZERO",B[B.ONE=32]="ONE",B[B.TWO=33]="TWO",B[B.THREE=34]="THREE",B[B.FOUR=35]="FOUR",B[B.FIVE=36]="FIVE",B[B.SIX=37]="SIX",B[B.SEVEN=38]="SEVEN",B[B.EIGHT=39]="EIGHT",B[B.NINE=40]="NINE",B[B.DOT=41]="DOT",B[B.FERMATA=42]="FERMATA",B[B.INVERTED_FERMATA=43]="INVERTED_FERMATA",B[B.SPICCATO=44]="SPICCATO",B[B.TENUTO=45]="TENUTO",B[B.MARCATO=46]="MARCATO",B[B.MARCATISSIMO=47]="MARCATISSIMO",B[B.INVERTED_MARCATISSIMO=48]="INVERTED_MARCATISSIMO",B[B.P=49]="P",B[B.F=50]="F",B[B.S=51]="S",B[B.Z=52]="Z",B[B.M=53]="M",B[B.R=54]="R",B[B.SEGNO=55]="SEGNO",B[B.CODA=56]="CODA",B[B.DRUM_CLEF=57]="DRUM_CLEF",B[B.G_CLEF_SUB8=58]="G_CLEF_SUB8",B[B.G_CLEF_SUPER8=59]="G_CLEF_SUPER8",B[B.G_CLEF_SUB15=60]="G_CLEF_SUB15",B[B.G_CLEF_SUPER15=61]="G_CLEF_SUPER15",B[B.F_CLEF_SUB8=62]="F_CLEF_SUB8",B[B.F_CLEF_SUPER8=63]="F_CLEF_SUPER8",B[B.F_CLEF_SUB15=64]="F_CLEF_SUB15",B[B.F_CLEF_SUPER15=65]="F_CLEF_SUPER15",B[B.DOWN_BOW=66]="DOWN_BOW",B[B.MORDENT=67]="MORDENT",B[B.INVERTED_MORDENT=68]="INVERTED_MORDENT",B[B.TURN=69]="TURN",B[B.INVERTED_TURN=70]="INVERTED_TURN",B[B.LEFTHAND_PIZZICATO=71]="LEFTHAND_PIZZICATO",B[B.RELEASE_PED=72]="RELEASE_PED",B[B.ENGAGE_PED=73]="ENGAGE_PED",B[B.VA8=74]="VA8",B[B.VB8=75]="VB8",B[B.TRILL=76]="TRILL",B[B.MA15=77]="MA15",B[B.MB15=78]="MB15",B[B.HIGH=79]="HIGH",B[B.PLAY=80]="PLAY",B[B.MIC=81]="MIC",B[B.SNAP_PIZZICATO=82]="SNAP_PIZZICATO",B[B.NATURAL_HARMONIC=83]="NATURAL_HARMONIC",B[B.EditPen=84]="EditPen",B[B.PEDAL_BRACKET=85]="PEDAL_BRACKET",B[B.PEDAL_MIXED=86]="PEDAL_MIXED",B[B.PEDAL_SYMBOL=87]="PEDAL_SYMBOL",B))(MusicSymbol||{}),MusicSymbolDrawingStyle=(B=>(B[B.Normal=0]="Normal",B[B.Disabled=1]="Disabled",B[B.Selected=2]="Selected",B[B.Clickable=3]="Clickable",B[B.PlaybackSymbols=4]="PlaybackSymbols",B[B.FollowSymbols=5]="FollowSymbols",B[B.QFeedbackNotFound=6]="QFeedbackNotFound",B[B.QFeedbackOk=7]="QFeedbackOk",B[B.QFeedbackPerfect=8]="QFeedbackPerfect",B[B.Debug1=9]="Debug1",B[B.Debug2=10]="Debug2",B[B.Debug3=11]="Debug3",B))(MusicSymbolDrawingStyle||{}),PhonicScoreModes=(B=>(B[B.Following=0]="Following",B[B.Midi=1]="Midi",B[B.Manual=2]="Manual",B))(PhonicScoreModes||{});class LabelRenderSpecs{}class MusicSheetDrawer{constructor(R,F){this.drawableBoundingBoxElement="None",this.skyLineVisible=!1,this.bottomLineVisible=!1,this.phonicScoreMode=PhonicScoreModes.Manual,this.textMeasurer=R,this.splitScreenLineColor=-1,this.drawingParameters=F,this.rules=F.Rules}set Mode(R){this.phonicScoreMode=R}drawSheet(R){if(this.graphicalMusicSheet=R,this.rules=R.ParentMusicSheet.Rules,this.drawSplitScreenLine(),this.drawingParameters.drawCursors)for(const D of R.Cursors){if(!D)continue;const G=new BoundingBox$1(D);G.AbsolutePosition=D.Start,G.BorderBottom=D.End.y-D.Start.y,G.BorderRight=D.Width/2,G.BorderLeft=-D.Width/2,this.isVisible(G)&&this.drawLineAsVerticalRectangle(D,GraphicalLayers.Cursor)}this.drawingParameters.drawScrollIndicator&&this.drawScrollIndicator();const F=Math.min(this.graphicalMusicSheet.MusicPages.length,this.rules.MaxPageToDrawNumber);for(let D=0;D0&&(isTopFont(R.Label.textAlignment)||[TextAlignmentEnum.CenterBottom].includes(R.Label.textAlignment))){let ne=-1,re=!1;for(const ae of(q==null?void 0:q.AbstractExpressions)||[])if(ae.Label===R?ne=(ie=ae==null?void 0:ae.parentMeasure)==null?void 0:ie.measureListIndex:(se=ae.expression)!=null&&se.TempoInBpm&&(re=ae.expression.TempoInBpm>0),re&&ne>-1){U.ScreenPosition.y-=4*10;break}}this.rules.DYMusicScoreType==="jianpu"?isNaN(parseInt(R.Label.text,10))&&this.renderLabel(R,F,U):this.renderLabel(R,F,U)}calculateLabel(R){const F=new LabelRenderSpecs,D=R.Label,G=new BoundingBox$1(this);G.AbsolutePosition.x=R.PositionAndShape.AbsolutePosition.x,G.AbsolutePosition.y=R.PositionAndShape.AbsolutePosition.y||R.PositionAndShape.Parent.AbsolutePosition.y,F.ScreenPosition=this.applyScreenTransformation(G.AbsolutePosition),F.FontHeightInPixel=this.calculatePixelDistance(D.fontHeight);const U=this.calculatePixelDistance(R.PositionAndShape.Size.width);switch(F.BitmapWidth=Math.ceil(U),F.BitmapHeight=R.TextLines?Math.ceil(F.FontHeightInPixel*(.2+R.TextLines.length)):10,D.textAlignment){case TextAlignmentEnum.LeftTop:F.ScreenPosition.x-=F.BitmapWidth/2,F.ScreenPosition.y+=F.BitmapHeight*1.5;break;case TextAlignmentEnum.LeftCenter:F.ScreenPosition.y-=F.BitmapHeight/2;break;case TextAlignmentEnum.LeftBottom:F.ScreenPosition.y-=F.BitmapHeight;break;case TextAlignmentEnum.CenterTop:F.ScreenPosition.x-=F.BitmapWidth/2;break;case TextAlignmentEnum.CenterCenter:F.ScreenPosition.x-=F.BitmapWidth/2,F.ScreenPosition.y-=F.BitmapHeight/2;break;case TextAlignmentEnum.CenterBottom:F.ScreenPosition.x-=F.BitmapWidth/2,F.ScreenPosition.y-=F.BitmapHeight;break;case TextAlignmentEnum.RightTop:F.ScreenPosition.x-=F.BitmapWidth;break;case TextAlignmentEnum.RightCenter:F.ScreenPosition.x-=F.BitmapWidth,F.ScreenPosition.y-=F.BitmapHeight/2;break;case TextAlignmentEnum.RightBottom:F.ScreenPosition.x-=F.BitmapWidth,F.ScreenPosition.y-=F.BitmapHeight;break;default:throw new ArgumentOutOfRangeException("")}return F}applyScreenTransformations(R){const F=[];for(const D of R)F.push(this.applyScreenTransformation(D));return F}drawSplitScreenLine(){}renderRectangle(R,F,D,G=void 0,U=1){throw new Error("not implemented")}drawScrollIndicator(){}drawSelectionStartSymbol(R){}drawSelectionEndSymbol(R){}renderLabel(R,F,D){throw new Error("not implemented")}renderSystemToScreen(R,F,D){}drawSkyLine(R){}drawBottomLine(R){}drawInstrumentBrace(R,F){}drawGroupBracket(R,F){}isVisible(R){return!0}drawMusicSystem(R){const F=this.getSystemAbsBoundingRect(R),D=this.getSytemBoundingBoxInPixels(F);this.drawMusicSystemComponents(R,D,F)}getSytemBoundingBoxInPixels(R){const F=this.applyScreenTransformationForRect(R);return F.x=Math.round(F.x),F.y=Math.round(F.y),F}getSystemAbsBoundingRect(R){const F=R.PositionAndShape.BoundingRectangle;return new RectangleF2D(R.PositionAndShape.AbsolutePosition.x+R.PositionAndShape.BorderLeft-1,R.PositionAndShape.AbsolutePosition.y+R.PositionAndShape.BorderTop-1,F.width+6,F.height+2)}drawMusicSystemComponents(R,F,D){const G=this.graphicalMusicSheet.SelectionStartSymbol,U=this.graphicalMusicSheet.SelectionEndSymbol;this.drawingParameters.drawSelectionStartSymbol&&G!==void 0&&this.isVisible(G.PositionAndShape)&&this.drawSelectionStartSymbol(G),this.drawingParameters.drawSelectionEndSymbol&&U!==void 0&&this.isVisible(U.PositionAndShape)&&this.drawSelectionEndSymbol(U);for(const Y of R.StaffLines)this.drawStaffLine(Y),this.rules.RenderLyrics&&(Y.LyricsDashes.length>0&&this.drawDashes(Y.LyricsDashes),Y.LyricLines.length>0&&this.drawLyricLines(Y.LyricLines,Y));for(const Y of R.SystemLines)this.drawSystemLineObject(Y);if(R.Parent===R.Parent.Parent.MusicPages[0])for(const Y of R.Labels)Y.SVGNode=this.drawLabel(Y,GraphicalLayers.Notes);const W=this.graphicalMusicSheet.ParentMusicSheet.Instruments,q=W.filter(Y=>Y.Visible).length;for(const Y of R.InstrumentBrackets)this.drawInstrumentBrace(Y,R);if(W.length>0)if(q>1)for(const Y of R.GroupBrackets)this.drawGroupBracket(Y,R);else for(const Y of R.GroupBrackets)Y.Visible=!1;if(!this.leadSheet)for(const Y of R.MeasureNumberLabels)Y.SVGNode=this.drawLabel(Y,GraphicalLayers.Notes);for(const Y of R.StaffLines)this.drawStaffLineSymbols(Y);this.drawingParameters.drawMarkedAreas&&this.drawMarkedAreas(R)}activateSystemRendering(R,F,D,G){return!0}drawSystemLineObject(R){}drawStaffLine(R){for(const F of R.Measures)this.drawMeasure(F);this.rules.RenderLyrics&&R.LyricsDashes.length>0&&this.drawDashes(R.LyricsDashes),this.drawOctaveShifts(R),this.drawPedals(R),this.drawWavyLines(R),this.drawExpressions(R),this.skyLineVisible&&this.drawSkyLine(R),this.bottomLineVisible&&this.drawBottomLine(R)}drawLyricLines(R,F){F.LyricLines.forEach(D=>{D.Start.y+=F.PositionAndShape.AbsolutePosition.y,D.End.y+=F.PositionAndShape.AbsolutePosition.y,D.Start.x+=F.PositionAndShape.AbsolutePosition.x,D.End.x+=F.PositionAndShape.AbsolutePosition.x,this.drawGraphicalLine(D,this.rules.LyricUnderscoreLineWidth)})}drawExpressions(R){}drawGraphicalLine(R,F,D="black"){return this.drawLine(R.Start,R.End,D,F)}drawLine(R,F,D="#FF0000FF",G){}drawDashes(R){R.forEach(F=>F.SVGNode=this.drawLabel(F,GraphicalLayers.Notes))}drawOctaveShifts(R){}drawStaffLines(R){if(R.StaffLines){const F=R.PositionAndShape.AbsolutePosition;for(let D=0;D<5;D++)this.drawLineAsHorizontalRectangleWithOffset(R.StaffLines[D],F,GraphicalLayers.Notes)}}drawSymbol(R,F,D,G=1,U=GraphicalLayers.Notes){}get leadSheet(){return this.graphicalMusicSheet.LeadSheet}set leadSheet(R){this.graphicalMusicSheet.LeadSheet=R}drawPage(R){if(!!this.isVisible(R.PositionAndShape)){for(const F of R.MusicSystems)this.isVisible(F.PositionAndShape)&&this.drawMusicSystem(F);if(R===R.Parent.MusicPages[0])for(const F of R.Labels)F.SVGNode=this.drawLabel(F,GraphicalLayers.Notes);this.drawableBoundingBoxElement&&this.drawBoundingBoxes(R.PositionAndShape,0,this.drawableBoundingBoxElement)}}drawBoundingBoxes(R,F=0,D="all"){const G=R.DataObject.constructor.name;let U=!1;D==="all"&&(U=!0),(U||G===D)&&this.drawBoundingBox(R,void 0,!0,G,F),F++,R.ChildElements.forEach(W=>this.drawBoundingBoxes(W,F,D))}drawBoundingBox(R,F=void 0,D=!1,G=void 0,U=0){let W=new RectangleF2D(R.AbsolutePosition.x+R.BorderMarginLeft,R.AbsolutePosition.y+R.BorderMarginTop,R.BorderMarginRight-R.BorderMarginLeft,R.BorderMarginBottom-R.BorderMarginTop);D&&(this.drawLineAsHorizontalRectangle(new GraphicalLine(new PointF2D(R.AbsolutePosition.x-1,R.AbsolutePosition.y),new PointF2D(R.AbsolutePosition.x+1,R.AbsolutePosition.y),.1,OutlineAndFillStyleEnum.BaseWritingColor,F),U-1),this.drawLineAsVerticalRectangle(new GraphicalLine(new PointF2D(R.AbsolutePosition.x,R.AbsolutePosition.y-1),new PointF2D(R.AbsolutePosition.x,R.AbsolutePosition.y+1),.1,OutlineAndFillStyleEnum.BaseWritingColor,F),U-1)),W=this.applyScreenTransformationForRect(W);const q=this.renderRectangle(W,GraphicalLayers.Background,U,F,.5);if(G){const Y=new Label(G),J=new LabelRenderSpecs;J.BitmapWidth=W.width,J.BitmapHeight=W.height,J.FontHeightInPixel=W.height,J.ScreenPosition=new PointF2D(W.x,W.y+12),this.renderLabel(new GraphicalLabel(Y,.8,TextAlignmentEnum.CenterCenter,this.rules),U,J)}return q}drawMarkedAreas(R){for(const F of R.GraphicalMarkedAreas)F&&(F.systemRectangle&&this.drawRectangle(F.systemRectangle,GraphicalLayers.Background),F.settings&&(F.settings.SVGNode=this.drawLabel(F.settings,GraphicalLayers.Comment)),F.labelRectangle&&this.drawRectangle(F.labelRectangle,GraphicalLayers.Background),F.label&&(F.label.SVGNode=this.drawLabel(F.label,GraphicalLayers.Comment)))}drawStaffLineSymbols(R){const F=R.ParentStaff.ParentInstrument,D=R.PositionAndShape.AbsolutePosition.x,G=R.PositionAndShape.AbsolutePosition.y+2,U=R.PositionAndShape.BorderRight;F.highlight&&this.drawingParameters.drawHighlights&&this.drawLineAsHorizontalRectangle(new GraphicalLine(new PointF2D(D,G),new PointF2D(D+U,G),4,OutlineAndFillStyleEnum.Highlighted),GraphicalLayers.Highlight);let W=MusicSymbolDrawingStyle.Disabled,q=MusicSymbol.PLAY,Y=this.drawingParameters.drawActivitySymbols;switch(this.phonicScoreMode){case PhonicScoreModes.Midi:q=MusicSymbol.PLAY,this.midiPlaybackAvailable&&R.ParentStaff.audible&&(W=MusicSymbolDrawingStyle.PlaybackSymbols);break;case PhonicScoreModes.Following:q=MusicSymbol.MIC,R.ParentStaff.following&&(W=MusicSymbolDrawingStyle.FollowSymbols);break;default:Y=!1;break}if(Y){const J=new PointF2D(D+U+2,G);this.drawSymbol(q,W,J)}if(this.drawingParameters.drawErrors)for(const J of R.Measures){const Z=J.PositionAndShape,K=Z.AbsolutePosition.x,te=Z.AbsolutePosition.y+2;J.hasError&&this.graphicalMusicSheet.ParentMusicSheet.DrawErroneousMeasures&&this.drawLineAsHorizontalRectangle(new GraphicalLine(new PointF2D(K,te),new PointF2D(K+Z.BorderRight,te),4,OutlineAndFillStyleEnum.ErrorUnderlay),GraphicalLayers.MeasureError)}}}class VexFlowTextMeasurer{constructor(R){this.fontSize=20,this.fontSizeStandard=this.fontSize;const F=document.createElement("canvas");this.context=F.getContext("2d"),this.rules=R}computeTextWidthToHeightRatio(R,F,D,G=void 0,U=this.fontSize){return this.context.font=VexFlowConverter.font(U,D,F,this.rules,G),this.context.measureText(R).width/U}setFontSize(R=this.fontSizeStandard){return this.fontSize=R,R}}class AbstractGraphicalExpression extends GraphicalObject{constructor(R,F,D){super(),this.expression=F,this.parentMeasure=D,this.boundingBox=new BoundingBox$1(this,R.PositionAndShape),this.parentStaffLine=R,this.parentStaffLine.AbstractExpressions.push(this),this.rules=R.ParentMusicSystem.rules}get Label(){return this.label}get ParentStaffLine(){return this.parentStaffLine}get SourceExpression(){return this.expression}get Placement(){return this.expression.Placement}}class GraphicalInstantaneousTempoExpression extends AbstractGraphicalExpression{constructor(R,F){super(F.PositionAndShape.Parent.DataObject,R,R.parentMeasure),this.label=F}get GraphicalLabel(){return this.label}updateSkyBottomLine(){}}class GraphicalInstantaneousDynamicExpression extends AbstractGraphicalExpression{constructor(R,F,D){super(F,R,D.parentSourceMeasure),this.mInstantaneousDynamicExpression=R,this.mMeasure=D}updateSkyBottomLine(){const R=this.parentStaffLine.SkyBottomLineCalculator,F=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginLeft,D=this.PositionAndShape.RelativePosition.x+this.PositionAndShape.BorderMarginRight;let G=0;switch(this.Placement){case PlacementEnum.Above:G=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginTop,R.updateSkyLineInRange(F,D,G);break;case PlacementEnum.Below:G=this.PositionAndShape.RelativePosition.y+this.PositionAndShape.BorderMarginBottom,R.updateBottomLineInRange(F,D,G);break;default:log$2.error("Placement for GraphicalInstantaneousDynamicExpression is unknown")}}}class GraphicalContinuousDynamicExpression extends AbstractGraphicalExpression{constructor(R,F,D){super(F,R,D),this.lines=[],this.isSplittedPart=!1,this.notToBeRemoved=!1}get StartMeasure(){return this.startMeasure}set StartMeasure(R){this.startMeasure=R}get EndMeasure(){return this.endMeasure}set EndMeasure(R){this.endMeasure=R}get EndStaffLine(){return this.endMeasure?this.endMeasure.ParentStaffLine:void 0}get IsSplittedPart(){return this.isSplittedPart}set IsSplittedPart(R){this.isSplittedPart=R}get IsVerbal(){return this.ContinuousDynamic.Label&&this.ContinuousDynamic.Label.length>0}get NotToBeRemoved(){return this.notToBeRemoved}set NotToBeRemoved(R){this.notToBeRemoved=R}get Lines(){return this.lines}get ContinuousDynamic(){return this.SourceExpression}updateSkyBottomLine(){var G;const R=this.parentStaffLine.SkyBottomLineCalculator,F=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft:0,D=this.IsVerbal?this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight:0;switch(!this.IsVerbal&&this.lines.length<2&&log$2.warn("Not enough lines for SkyBottomLine calculation"),this.IsVerbal||this.ContinuousDynamic.DynamicType!==ContDynamicEnum.crescendo&&this.ContinuousDynamic.DynamicType!==ContDynamicEnum.diminuendo&&log$2.warn("GraphicalContinuousDynamicExpression.updateSkyBottomLine(): unhandled continuous dynamic type. start measure: "+((G=this.startMeasure)==null?void 0:G.MeasureNumber)),this.Placement){case PlacementEnum.Above:if(!this.IsVerbal)this.ContinuousDynamic.DynamicType===ContDynamicEnum.crescendo?R.updateSkyLineWithWedge(this.lines[0].Start,this.lines[0].End):this.ContinuousDynamic.DynamicType===ContDynamicEnum.diminuendo&&R.updateSkyLineWithWedge(this.lines[0].End,this.lines[0].Start);else{const U=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;R.updateSkyLineInRange(F,D,U)}break;case PlacementEnum.Below:if(!this.IsVerbal)this.ContinuousDynamic.DynamicType===ContDynamicEnum.crescendo?R.updateBottomLineWithWedge(this.lines[1].Start,this.lines[1].End):this.ContinuousDynamic.DynamicType===ContDynamicEnum.diminuendo&&R.updateBottomLineWithWedge(this.lines[1].End,this.lines[1].Start);else{const U=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;R.updateBottomLineInRange(F,D,U)}break;default:log$2.error("Placement for GraphicalContinuousDynamicExpression is unknown")}}createCrescendoLines(R,F,D,G=this.rules.WedgeOpeningLength,U=this.rules.WedgeLineWidth){const W=new PointF2D(R,D),q=new PointF2D(F,D-G/2),Y=new PointF2D(F,D+G/2);this.addWedgeLines(W,q,Y,U)}createFirstHalfCrescendoLines(R,F,D,G=this.rules.WedgeMeasureEndOpeningLength,U=this.rules.WedgeLineWidth){const W=new PointF2D(R,D),q=new PointF2D(F,D-G/2),Y=new PointF2D(F,D+G/2);this.addWedgeLines(W,q,Y,U)}createSecondHalfCrescendoLines(R,F,D,G=this.rules.WedgeMeasureBeginOpeningLength,U=this.rules.WedgeOpeningLength,W=this.rules.WedgeLineWidth){const q=new PointF2D(R,D-G/2),Y=new PointF2D(R,D+G/2),J=new PointF2D(F,D-U/2),Z=new PointF2D(F,D+U/2);this.addDoubleLines(q,J,Y,Z,W)}recalculateCrescendoLines(R,F,D){const G=Math.abs(this.lines[0].Start.y-this.lines[1].Start.y)>1e-4;this.lines.clear(),G?this.createSecondHalfCrescendoLines(R,F,D):this.isSplittedPart?this.createFirstHalfCrescendoLines(R,F,D):this.createCrescendoLines(R,F,D)}createDiminuendoLines(R,F,D,G=this.rules.WedgeOpeningLength,U=this.rules.WedgeLineWidth){const W=new PointF2D(R,D-G/2),q=new PointF2D(R,D+G/2),Y=new PointF2D(F,D);this.addWedgeLines(Y,W,q,U)}createFirstHalfDiminuendoLines(R,F,D,G=this.rules.WedgeOpeningLength,U=this.rules.WedgeMeasureEndOpeningLength,W=this.rules.WedgeLineWidth){const q=new PointF2D(R,D-G/2),Y=new PointF2D(R,D+G/2),J=new PointF2D(F,D-U/2),Z=new PointF2D(F,D+U/2);this.addDoubleLines(q,J,Y,Z,W)}createSecondHalfDiminuendoLines(R,F,D,G=this.rules.WedgeMeasureBeginOpeningLength,U=this.rules.WedgeLineWidth){const W=new PointF2D(R,D-G/2),q=new PointF2D(R,D+G/2),Y=new PointF2D(F,D);this.addWedgeLines(Y,W,q,U)}recalculateDiminuendoLines(R,F,D){const G=Math.abs(this.lines[0].End.y-this.lines[1].End.y)>1e-4;this.lines.clear(),G?this.createFirstHalfDiminuendoLines(R,F,D):this.isSplittedPart?this.createSecondHalfDiminuendoLines(R,F,D):this.createDiminuendoLines(R,F,D)}calcPsi(){if(this.IsVerbal){this.PositionAndShape.calculateBoundingBox();return}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===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(R){this.IsVerbal?(this.PositionAndShape.RelativePosition.y+=R,this.PositionAndShape.calculateBoundingBox()):(this.lines[0].Start.y+=R,this.lines[0].End.y+=R,this.lines[1].End.y+=R)}squeeze(R){this.IsVerbal||Math.abs(this.lines[0].End.x-this.lines[0].Start.x)0?this.lines[0].Start.x+=R:(this.lines[0].End.x+=R,this.lines[1].End.x+=R):R<0?this.lines[0].Start.x+=R:(this.lines[0].End.x+=R,this.lines[1].End.x+=R),this.calcPsi())}addWedgeLines(R,F,D,G){const U=new GraphicalLine(R,F,G),W=new GraphicalLine(R,D,G);this.lines.push(U),this.lines.push(W)}addDoubleLines(R,F,D,G,U){const W=new GraphicalLine(R,F,U),q=new GraphicalLine(D,G,U);this.lines.push(W),this.lines.push(q)}}class GraphicalUnknownExpression extends AbstractGraphicalExpression{constructor(R,F,D,G,U=void 0){super(R,new AbstractExpression(D),G),this.label=F,this.sourceMultiExpression=U}updateSkyBottomLine(){const R=this.parentStaffLine.SkyBottomLineCalculator,F=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginLeft,D=this.label.PositionAndShape.RelativePosition.x+this.label.PositionAndShape.BorderMarginRight;switch(this.Placement){case PlacementEnum.Above:const G=this.label.PositionAndShape.BorderMarginTop+this.label.PositionAndShape.RelativePosition.y;R.updateSkyLineInRange(F,D,G);break;case PlacementEnum.Below:const U=this.label.PositionAndShape.BorderMarginBottom+this.label.PositionAndShape.RelativePosition.y;R.updateBottomLineInRange(F,D,U);break;default:log$2.error("Placement for GraphicalUnknownExpression is unknown")}}}Vex.Flow;const unitInPixels=10;class VexFlowMusicSheetDrawer extends MusicSheetDrawer{constructor(R=new DrawingParameters){super(new VexFlowTextMeasurer(R.Rules),R),this.backends=[],this.zoom=1,this.pageIdx=0,this.getDotId=(F,D)=>D?String(F.Label.PositionAndShape.RelativePosition[D]):String(F.Label.PositionAndShape.RelativePosition.x)+String(F.Label.PositionAndShape.RelativePosition.y),this.hasDot=(F,D,G,U)=>{const W=D||Object.values(U);for(const q of W){if(G)return F.x===q.x&&F.y===q.y;if(F.x===q.x)return!0}return!1}}get Zoom(){return this.zoom}get Backends(){return this.backends}initializeBackendForPage(R){this.backend=this.backends[R.PageNumber-1]}drawSheet(R){var F,D,G;this.rules.DefaultVexFlowNoteFont==="gonville"&&(Vex.Flow.DEFAULT_FONT_STACK=[(F=Vex.Flow.Fonts)==null?void 0:F.Gonville,(D=Vex.Flow.Fonts)==null?void 0:D.Bravura,(G=Vex.Flow.Fonts)==null?void 0:G.Custom]),Vex.Flow.STAVE_LINE_THICKNESS=this.rules.StaffLineWidth*unitInPixels,Vex.Flow.STEM_WIDTH=this.rules.StemWidth*unitInPixels,Vex.Flow.DEFAULT_NOTATION_FONT_SCALE=this.rules.VexFlowDefaultNotationFontScale,Vex.Flow.DEFAULT_TAB_FONT_SCALE=this.rules.VexFlowDefaultTabFontScale,this.pageIdx=0;for(const U of R.MusicPages){if(U.PageNumber>this.rules.MaxPageToDrawNumber)break;const W=this.backends[this.pageIdx];W.graphicalMusicPage=U,W.scale(this.zoom),this.pageIdx+=1}this.pageIdx=0,this.backend=this.backends[0],super.drawSheet(R)}drawPage(R){!R||(this.backend=this.backends[R.PageNumber-1],super.drawPage(R),this.pageIdx+=1)}clear(){for(const R of this.backends)R.clear()}setZoom(R){this.zoom=R}calculatePixelDistance(R){return R*unitInPixels}drawStaffLine(R){const F=this.backend.getContext().openGroup();F&&F.classList.add("staffline"),super.drawStaffLine(R);const D=R.PositionAndShape.AbsolutePosition;this.rules.RenderSlurs&&this.drawSlurs(R,D),this.backend.getContext().closeGroup()}drawSlurs(R,F){for(const D of R.GraphicalSlurs)D.slur.isCrossed()||this.drawSlur(D,F)}drawSlur(R,F){const D=[];let G,U,W,q;this.rules.DYMusicScoreType==="jianpu"?((R.placement>0||R.bezierStartPt.y>0)&&(R.bezierStartPt.y=-.8,R.bezierStartControlPt.y=-2.5),G=new PointF2D(R.bezierStartPt.x+F.x,R.bezierStartPt.y+F.y),U=new PointF2D(R.bezierStartControlPt.x+F.x,R.bezierStartControlPt.y+F.y),W=new PointF2D(R.bezierEndControlPt.x+F.x,R.bezierStartControlPt.y+F.y),q=new PointF2D(R.bezierEndPt.x+F.x,R.bezierStartPt.y+F.y)):(G=new PointF2D(R.bezierStartPt.x+F.x,R.bezierStartPt.y+F.y),U=new PointF2D(R.bezierStartControlPt.x+F.x,R.bezierStartControlPt.y+F.y),W=new PointF2D(R.bezierEndControlPt.x+F.x,R.bezierEndControlPt.y+F.y),q=new PointF2D(R.bezierEndPt.x+F.x,R.bezierEndPt.y+F.y)),D.push(this.applyScreenTransformation(G)),D.push(this.applyScreenTransformation(U)),D.push(this.applyScreenTransformation(W)),D.push(this.applyScreenTransformation(q)),R.placement===PlacementEnum.Above?(G.y-=.05,U.y-=.3,W.y-=.3,q.y-=.05):(G.y+=.05,U.y+=.3,W.y+=.3,q.y+=.05),D.push(this.applyScreenTransformation(G)),D.push(this.applyScreenTransformation(U)),D.push(this.applyScreenTransformation(W)),D.push(this.applyScreenTransformation(q)),R.SVGElement=this.backend.renderCurve(D)}drawMeasure(R){R.setAbsoluteCoordinates(R.PositionAndShape.AbsolutePosition.x*unitInPixels,R.PositionAndShape.AbsolutePosition.y*unitInPixels);const F=this.backend.getContext();try{R.draw(F)}catch(D){log$2.warn("VexFlowMusicSheetDrawer.drawMeasure",D)}for(const D of R.staffEntries)this.drawStaffEntry(D)}drawLine(R,F,D="#FF0000FF",G=.2){return R=this.applyScreenTransformation(R),F=this.applyScreenTransformation(F),this.backend.renderLine(R,F,D,G*unitInPixels)}DrawOverlayLine(R,F,D,G="#FF0000FF",U=.2){if(!D.PageNumber||D.PageNumber>this.backends.length||D.PageNumber<1){console.log("VexFlowMusicSheetDrawer.drawOverlayLine: invalid page number / music page number doesn't correspond to an existing backend.");return}const W=D.PageNumber-1,q=this.backends[W];return R=this.applyScreenTransformation(R),F=this.applyScreenTransformation(F),q.renderLine(R,F,G,U*unitInPixels)}drawSkyLine(R){const F=R.PositionAndShape.AbsolutePosition,D=R.PositionAndShape.Size.width;this.drawSampledLine(R.SkyLine,F,D)}drawBottomLine(R){const F=new PointF2D(R.PositionAndShape.AbsolutePosition.x,R.PositionAndShape.AbsolutePosition.y),D=R.PositionAndShape.Size.width;this.drawSampledLine(R.BottomLine,F,D,"#0000FFFF")}drawSampledLine(R,F,D,G="#FF0000FF"){const U=[];let W=0;for(let Y=0;Y0){const Y=this.rules.SamplingUnit;let J=new PointF2D(q.x,q.y),Z=new PointF2D(U[0]/Y+q.x,q.y);this.drawLine(J,Z,G);let K,te;R[0]>=0&&(K=new PointF2D(U[0]/Y+q.x,q.y),te=new PointF2D(U[0]/Y+q.x,q.y+R[U[0]]),this.drawLine(K,te,G));for(let Q=1;Q0)for(const F of R.FingeringEntries)F.SVGNode=this.drawLabel(F,GraphicalLayers.Notes);if(R.graphicalChordContainers!==void 0&&R.graphicalChordContainers.length>0)for(const F of R.graphicalChordContainers){const D=F.GraphicalLabel;D.SVGNode=this.drawLabel(D,GraphicalLayers.Notes)}this.rules.RenderLyrics&&R.LyricsEntries.length>0&&this.drawLyrics(R.LyricsEntries,GraphicalLayers.Notes)}drawLyrics(R,F){R.forEach(D=>{const G=D.GraphicalLabel;G.SVGNode=this.drawLabel(G,F)})}drawInstrumentBrace(R,F){R.draw(this.backend.getContext())}drawGroupBracket(R,F){R.draw(this.backend.getContext())}drawOctaveShifts(R){for(const F of R.OctaveShifts)if(F){const D=F,G=this.backend.getContext(),U=D.getTextBracket();U.setContext(G);try{U.draw()}catch(W){log$2.warn(W)}}}drawPedals(R){for(const F of R.Pedals)if(F){const D=F,G=this.backend.getContext(),U=D.getPedalMarking();U.setContext(G),U.draw()}}drawWavyLines(R){for(const F of R.WavyLines)if(F){const D=F,G=this.backend.getContext(),U=D.getVibratoBracket();U.setContext(G),U.draw()}}getMaxExpressionsYAndDots(R){var Y,J;const F=[];let D=0;for(const Z of R.measures)F.push(Z.measureNumber);const G={},U={},W={};for(const Z of R.AbstractExpressions)if(Z instanceof GraphicalUnknownExpression&&F.includes(Z.parentMeasure.MeasureNumber)){const K=this.getDotId(Z),te=this.getDotId(Z,"x");U[K]||(U[K]=[]),W[te]||(W[te]=[]),this.hasDot(Z.Label.PositionAndShape.RelativePosition,U[K],!0)||(U[K].push(Z.Label.PositionAndShape.RelativePosition),W[te].push(Z.Label.PositionAndShape.RelativePosition)),G[K]=Z.Label.PositionAndShape.RelativePosition}let q=0;for(const Z of R.AbstractExpressions){const K=(Y=Z.parentMeasure)==null?void 0:Y.MeasureNumber;if(Z instanceof GraphicalUnknownExpression&&F.includes(K)){const te=(J=Z.parentMeasure.verticalMeasureList[0])==null?void 0:J.stave,Q=(te==null?void 0:te.end_x)-(te==null?void 0:te.x),ie=this.getDotId(Z,"x");if((W[ie]||[]).length===1&&q!==K){const se=Z.Label.PositionAndShape.AbsolutePosition.y;D=D===0?se:Math.min(D,se)}(W[ie]||[]).length!==1&&Q/101){let D=Math.min(...R.Lines.map(G=>G.Start.x));R.Lines[0].Start.x=D,R.Lines[1].Start.x=D,[R.Lines[0].Start.y,R.Lines[1].Start.y]=[R.Lines[1].Start.y,R.Lines[0].Start.y],R.Lines[0].End.y+=this.rules.WedgeOpeningLength/2,R.Lines[1].End.y+=this.rules.WedgeOpeningLength}}catch{}const F=this.backend.getContext();F.openGroup("lineGroup");for(const D of R.Lines){const G=new PointF2D(R.ParentStaffLine.PositionAndShape.AbsolutePosition.x+D.Start.x,R.ParentStaffLine.PositionAndShape.AbsolutePosition.y+D.Start.y),U=new PointF2D(R.ParentStaffLine.PositionAndShape.AbsolutePosition.x+D.End.x,R.ParentStaffLine.PositionAndShape.AbsolutePosition.y+D.End.y);this.drawLine(G,U,"black",D.Width)}F.closeGroup()}}renderLabel(R,F,D){return this._renderLabel(R,D)}_renderLabel(R,F){var J;if(!R.Label.print)return;const D=R.Label.fontHeight*unitInPixels,{font:G}=R.Label;let U;this.rules.ColoringEnabled&&(U=R.Label.colorDefault,R.Label.color&&(U=R.Label.color.toString()),U||(U=this.rules.DefaultColorLabel));let{fontStyle:W,fontFamily:q}=R.Label;W||(W=this.rules.DefaultFontStyle),q||(q=this.rules.DefaultFontFamily);let Y;for(let Z=0;Z<((J=R.TextLines)==null?void 0:J.length);Z++){const K=R.TextLines[Z],te=this.calculatePixelDistance(K.xOffset),Q=new PointF2D(F.ScreenPosition.x+te,F.ScreenPosition.y),ie=this.backend.renderText(D,W,G,K.text,F.FontHeightInPixel,Q,U,R.Label.fontFamily);Y?Y.appendChild(ie):Y=ie,F.ScreenPosition.y=F.ScreenPosition.y+F.FontHeightInPixel,R.TextLines.length>1&&(F.ScreenPosition.y+=this.rules.SpacingBetweenTextLines)}return Y}renderRectangle(R,F,D,G,U){return this.backend.renderRectangle(R,D,G,U)}applyScreenTransformation(R){return new PointF2D(R.x*unitInPixels,R.y*unitInPixels)}applyScreenTransformationForRect(R){return new RectangleF2D(R.x*unitInPixels,R.y*unitInPixels,R.width*unitInPixels,R.height*unitInPixels)}}const VF$c=Vex.Flow,_VexFlowConverter=class{static durations(B,R){const F=[],D=B.clone();for(;D.RealValue>0;){const G=D.RealValue;if(G>=2)F.push("1/2"),D.Sub(new Fraction$1(2,1));else if(G>=1)F.push("w"),D.Sub(new Fraction$1(1,1));else if(G<1&&G>=.5){if(R&&G>.5)return["w"];F.push("h"),D.Sub(new Fraction$1(1,2))}else if(G<.5&&G>=.25){if(R&&G>.25)return["h"];F.push("q"),D.Sub(new Fraction$1(1,4))}else if(G<.25&&G>=.125){if(R&&G>.125)return["q"];F.push("8"),D.Sub(new Fraction$1(1,8))}else if(G<.125&&G>=.0625){if(R&&G>.0625)return["8"];F.push("16"),D.Sub(new Fraction$1(1,16))}else if(G<.0625&&G>=.03125){if(R&&G>.03125)return["16"];F.push("32"),D.Sub(new Fraction$1(1,32))}else if(G<.03125&&G>=.015625){if(R&&G>.015625)return["32"];F.push("64"),D.Sub(new Fraction$1(1,64))}else{if(R)return["64"];F.push("128"),D.Sub(new Fraction$1(1,128))}}return F}static pitch(B,R,F,D=void 0,G=void 0){let U=G;G===void 0&&(U=3),R&&G===void 0&&(U=0,F.ClefType===ClefEnum.F&&(U=2),F.ClefType===ClefEnum.C&&(U=2));const W=NoteEnum[B.FundamentalNote].toLowerCase(),q=Pitch.accidentalVexflow(B.Accidental),Y=B.Octave-F.OctaveOffset+U;let J="";return D&&(J=this.NoteHeadCode(D)),[W+"n/"+Y+J,q,F]}static restToNotePitch(B,R){let F=B.Octave;switch(R){case ClefEnum.C:case ClefEnum.F:{F+=2;break}case ClefEnum.G:}return new Pitch(B.FundamentalNote,F,AccidentalEnum.NONE)}static NoteHeadCode(B){const R="/",F=B.Filled?"2":"1";switch(B.Shape){case NoteHeadShape.NORMAL:return"";case NoteHeadShape.DIAMOND:return R+"D"+F;case NoteHeadShape.TRIANGLE:return R+"T"+F;case NoteHeadShape.X:return R+"X"+F;case NoteHeadShape.CIRCLEX:return R+"X3";case NoteHeadShape.RECTANGLE:return R+"R"+F;case NoteHeadShape.SQUARE:return R+"S"+F;case NoteHeadShape.SLASH:return"";default:return""}}static GhostNotes(B){const R=[],F=_VexFlowConverter.durations(B,!1);for(const D of F)R.push(new VF$c.GhostNote({duration:D}));return R}static StaveNote(B){var fe,be,ue,ge,ve,Se,pe,ye,Ee,de,we,Oe,Me,Pe,Ne,ke;B.sortForVexflow();const R=B.notes,F=B.parentStaffEntry.parentMeasure.parentSourceMeasure.Rules,D=R[0];let G=[],U;const W=[],q=D.graphicalNoteLength,Y=D.sourceNote.NoteTuplet!==void 0;let J=_VexFlowConverter.durations(q,Y)[0];D.sourceNote.TypeLength!==void 0&&D.sourceNote.TypeLength!==q&&D.sourceNote.TypeLength.RealValue!==0&&(J=_VexFlowConverter.durations(D.sourceNote.TypeLength,Y)[0],D.numberOfDots=D.sourceNote.DotsXml);let Z,K=D.numberOfDots,te=!1,Q=0,ie=!1,se=!1,ne;for(const Ae of R){if(K=1&&Ge.length-1>=Ze+1&&(We=(ve=(ge=Ge[Ze-1])==null?void 0:ge.graphicalVoiceEntries[0])==null?void 0:ve.parentVoiceEntry,Ve=(pe=(Se=Ge[Ze+1])==null?void 0:Se.graphicalVoiceEntries[0])==null?void 0:pe.parentVoiceEntry,We&&Ve)){const nt=We.Notes[0],at=Ve.Notes[0];if(((ye=nt.NoteBeam)==null?void 0:ye.Notes.includes(at))&&at.ParentStaffEntry.ParentStaff.StafflineCount!==1){const ct=We.Notes.last().Pitch,De=Ae.Clef(),xe=_VexFlowConverter.pitch(_VexFlowConverter.restToNotePitch(ct.getTransposedPitch(-2),De.ClefType),!1,De);ct.FundamentalNote===4&&(G=[xe[0]])}}}}if(q.RealValue===Ae.sourceNote.SourceMeasure.ActiveTimeSignature.RealValue&&(G=F.DYMusicScoreType==="staff"?["d/5"]:["R/5"],J="w",K=0,te=!0,Q=F.WholeRestXShiftVexflow*unitInPixels),[...Ae.sourceNote.ParentStaff.Voices].filter(Ce=>(Ce==null?void 0:Ce.VoiceId)!=1).length){const Ce=Ae.parentVoiceEntry.parentStaffEntry.graphicalVoiceEntries,Ge=Ae.parentVoiceEntry.parentVoiceEntry.ParentVoice.VoiceId;let We,Ve;for(const Ze of Ce)for(const nt of Ze.notes){if(nt===Ae||nt.sourceNote.isRest()||!nt.sourceNote.PrintObject){Ae.lineShift=-2;continue}const at=nt.parentVoiceEntry.parentVoiceEntry.WantedStemDirection,ct=Ge===1||Ge===5,De=ct?1:-1,ze=nt.sourceNote.Pitch.getHalfTone(),qe=De===1&&ze>We,Re=De===-1&&ze0){let Ze=3;const nt=Ae.Clef();switch(nt.ClefType){case ClefEnum.F:Ze=5;break;case ClefEnum.C:Ze=4;break}ne=Pitch.fromHalftone(We),G=[_VexFlowConverter.pitch(ne,!0,nt,void 0,Ze)[0]]}}break}Ae.sourceNote.Notehead&&Ae.sourceNote.Notehead.Shape===NoteHeadShape.SLASH&&(ie=!0);const _e=Ae.vfpitch;if((de=(Ee=_e[2])==null?void 0:Ee.Parent)!=null&&de.Instructions)for(let Fe=0,Ye=_e[2].Parent.Instructions.length;FeB.notes[_e].staffLine=Ae),(F.LedgerLineWidth||F.LedgerLineStrokeStyle)&&(re.ledgerLineStyle||(re.ledgerLineStyle={}),F.LedgerLineWidth&&(re.ledgerLineStyle.lineWidth=F.LedgerLineWidth),F.LedgerLineStrokeStyle&&(re.ledgerLineStyle.strokeStyle=F.LedgerLineStrokeStyle)),F.ColoringEnabled){const Ae=F.DefaultColorStem;let _e=B.parentVoiceEntry.StemColor;!_e&&Ae&&(_e=Ae);const Fe={fillStyle:_e,strokeStyle:_e};_e&&(re.setStemStyle(Fe),re.flag&&F.ColorFlags&&re.setFlagStyle(Fe))}if(re.x_shift=Q,B.parentVoiceEntry.IsGrace&&B.notes[0].sourceNote.NoteBeam&&(B.parentVoiceEntry.WantedStemDirection=B.notes[0].sourceNote.NoteBeam.Notes[0].ParentVoiceEntry.WantedStemDirection),B.parentVoiceEntry)switch(B.parentVoiceEntry.WantedStemDirection){case StemDirectionType.Up:re.setStemDirection(VF$c.Stem.UP),B.parentVoiceEntry.StemDirection=StemDirectionType.Up;break;case StemDirectionType.Down:re.setStemDirection(VF$c.Stem.DOWN),B.parentVoiceEntry.StemDirection=StemDirectionType.Down;break}for(let Ae=0,_e=R.length;Ae<_e;Ae+=1){if(R[Ae].setIndex(re,Ae),W[Ae]){if(W[Ae]==="###"){re.addAccidental(Ae,new VF$c.Accidental("##")),re.addAccidental(Ae,new VF$c.Accidental("#"));continue}else if(W[Ae]==="bbs"){re.addAccidental(Ae,new VF$c.Accidental("bb")),re.addAccidental(Ae,new VF$c.Accidental("b"));continue}re.addAccidental(Ae,new VF$c.Accidental(W[Ae]))}const Fe=R[Ae].sourceNote.TremoloStrokes,Ye=R[Ae].sourceNote.TremoloType;if(Fe>0&&Ye==="single"){const Ce=new VF$c.Tremolo(Fe);Ce.extra_stroke_scale=F.TremoloStrokeScale,Ce.y_spacing_scale=F.TremoloYSpacingScale,re&&re.duration==="w"&&re.stem.setExtension(-9),re.addModifier(Ae,Ce)}if(Fe>0&&Ye==="start"&&this.noteTremoloList.push(re),Fe>0&&Ye==="stop"){this.noteTremoloList.push(re);const Ce=new VF$c.Tremolo(Fe,[...this.noteTremoloList]);Ce.extra_stroke_scale=1.2,Ce.y_spacing_scale=1.2,Ce.x_shift=-30,re.addModifier(Ae,Ce),this.noteTremoloList=[]}this.glissandoList.length&&(re.setVibrato(this.glissandoList[0].vfnote[0]),((Me=(Oe=(we=this.glissandoList[0])==null?void 0:we.sourceNote)==null?void 0:Oe.SourceMeasure)==null?void 0:Me.MeasureNumberXML)!=((ke=(Ne=(Pe=R[Ae])==null?void 0:Pe.sourceNote)==null?void 0:Ne.SourceMeasure)==null?void 0:ke.MeasureNumberXML),this.glissandoList=[]),R[Ae].sourceNote.glissandoType==="start"&&this.glissandoList.push(R[Ae])}if(ce.Length.RealValue===.25&&ce.Notehead&&ce.Notehead.Filled===!1){const Ae=re.getKeyProps();for(let _e=0;_e1&&re.getKeyProps().filter(_e=>!_e.code&&_e.line>3).length===G.length&&re.setStemDirection(-1),F.DYMusicScoreType==="jianpu"&&window&&window.sett&&window.sett.keySignature&&re.addAccidental(0,new VF$c.Accidental("#"));try{const Ae=["b","#","\xA7","\xBA","X"],_e={b:"b","#":"#","\xA7":"n",\u00BA:"bb",X:"##"};for(const Fe of R){const Ye=Fe.sourceNote.voiceEntry.Timestamp;for(const Ce of Fe.sourceNote.SourceMeasure.StaffLinkedExpressions)for(const Ge of Ce){const We=Fraction$1.Equal(Ye,Ge.Timestamp),Ze=Ge.EntriesList.map(nt=>nt.label).filter(nt=>Ae.includes(nt)).map(nt=>_e[nt]);if(We){for(const nt of Ze)nt&&re.addAnnotation(0,new VF$c.Annotation(nt));break}}}}catch{}return re}static generateArticulations(B,R,F){var D,G;if(!(!B||B.getAttribute("type")==="GhostNote"))for(const U of R){let W=VF$c.Modifier.Position.ABOVE;B.getStemDirection()===VF$c.Stem.UP&&(W=VF$c.Modifier.Position.BELOW);let q;const Y=U.articulationEnum;switch(F.ArticulationPlacementFromXML&&(U.placement===PlacementEnum.Above?W=VF$c.Modifier.Position.ABOVE:U.placement===PlacementEnum.Below&&(W=VF$c.Modifier.Position.BELOW)),Y){case ArticulationEnum.accent:{q=new VF$c.Articulation("a>");break}case ArticulationEnum.downbow:{q=new VF$c.Articulation("am"),U.placement===void 0&&(W=VF$c.Modifier.Position.ABOVE);break}case ArticulationEnum.fermata:{q=new VF$c.Articulation("a@a"),W=VF$c.Modifier.Position.ABOVE;break}case ArticulationEnum.marcatodown:{q=new VF$c.Articulation("a|");break}case ArticulationEnum.marcatoup:{q=new VF$c.Articulation("a^");break}case ArticulationEnum.invertedfermata:{q=new VF$c.Articulation("a@u"),W=VF$c.Modifier.Position.BELOW;break}case ArticulationEnum.lefthandpizzicato:{q=new VF$c.Articulation("a+");break}case ArticulationEnum.naturalharmonic:{q=new VF$c.Articulation("ah");break}case ArticulationEnum.snappizzicato:{q=new VF$c.Articulation("ao");break}case ArticulationEnum.staccatissimo:{q=new VF$c.Articulation("av");break}case ArticulationEnum.staccato:{q=new VF$c.Articulation("a.");break}case ArticulationEnum.tenuto:{q=new VF$c.Articulation("a-");break}case ArticulationEnum.upbow:{q=new VF$c.Articulation("a|"),U.placement===void 0&&(W=VF$c.Modifier.Position.ABOVE);break}case ArticulationEnum.strongaccent:{q=new VF$c.Articulation("a^");break}}q&&(!B.hasStem()&&!B.isRest()&&Y==ArticulationEnum.accent&&B.getLineNumber()>=3&&(W=VF$c.Modifier.Position.ABOVE,(G=(D=B==null?void 0:B.modifiers)==null?void 0:D.filter(J=>["TREMOLO"].includes(J.getCategory().toLocaleUpperCase())))!=null&&G.length&&q.setYShift(-16)),Y===ArticulationEnum.strongaccent&&(W=VF$c.Modifier.Position.ABOVE),q.setPosition(W),B.addModifier(0,q))}}static generateOrnaments(B,R){let F=VF$c.Modifier.Position.ABOVE;R.placement===PlacementEnum.Below&&(F=VF$c.Modifier.Position.BELOW);let D;switch(R.GetOrnament){case OrnamentEnum.DelayedInvertedTurn:{D=new VF$c.Ornament("turn_inverted"),D.setDelayed(!0);break}case OrnamentEnum.DelayedTurn:{D=new VF$c.Ornament("turn"),D.setDelayed(!0);break}case OrnamentEnum.InvertedMordent:{D=new VF$c.Ornament("mordent"),D.setDelayed(!1);break}case OrnamentEnum.InvertedTurn:{D=new VF$c.Ornament("turn_inverted"),D.setDelayed(!1);break}case OrnamentEnum.Mordent:{D=new VF$c.Ornament("mordent_inverted"),D.setDelayed(!1);break}case OrnamentEnum.Trill:{D=new VF$c.Ornament("tr"),D.setDelayed(!1);break}case OrnamentEnum.Turn:{D=new VF$c.Ornament("turn"),D.setDelayed(!1);break}default:{log$2.warn("unhandled OrnamentEnum type: "+R.GetOrnament);return}}D&&(R.AccidentalBelow!==AccidentalEnum.NONE&&D.setLowerAccidental(Pitch.accidentalVexflow(R.AccidentalBelow)),R.AccidentalAbove!==AccidentalEnum.NONE&&D.setUpperAccidental(Pitch.accidentalVexflow(R.AccidentalAbove)),D.setPosition(F),B.addModifier(0,D))}static StrokeTypeFromArpeggioType(B){switch(B){case ArpeggioType.ARPEGGIO_DIRECTIONLESS:return VF$c.Stroke.Type.ARPEGGIO_DIRECTIONLESS;case ArpeggioType.BRUSH_DOWN:return VF$c.Stroke.Type.BRUSH_UP;case ArpeggioType.BRUSH_UP:return VF$c.Stroke.Type.BRUSH_DOWN;case ArpeggioType.RASQUEDO_DOWN:return VF$c.Stroke.Type.RASQUEDO_UP;case ArpeggioType.RASQUEDO_UP:return VF$c.Stroke.Type.RASQUEDO_DOWN;case ArpeggioType.ROLL_DOWN:return VF$c.Stroke.Type.ROLL_UP;case ArpeggioType.ROLL_UP:return VF$c.Stroke.Type.ROLL_DOWN;default:return VF$c.Stroke.Type.ARPEGGIO_DIRECTIONLESS}}static CreateTabNote(B){const R=[],F=B.notes.reverse(),D=[],G=B.notes[0].graphicalNoteLength,U=B.notes[0].sourceNote.NoteTuplet!==void 0;let W=_VexFlowConverter.durations(G,U)[0],q=0;for(const J of B.notes){const Z=J.sourceNote,K={str:Z.StringNumberTab,fret:Z.FretNumber};R.push(K),Z.BendArray&&Z.BendArray.forEach(function(te){let Q;const ie=te.bendalter-K.fret;ie>1?Q="Full":ie===1?Q="1/2":Q="1/4",te.direction==="up"?D.push({type:VF$c.Bend.UP,text:Q,width:10}):D.push({type:VF$c.Bend.DOWN,text:Q,width:10})}),q(B[B.VA8=0]="VA8",B[B.VB8=1]="VB8",B[B.MA15=2]="MA15",B[B.MB15=3]="MB15",B[B.NONE=4]="NONE",B))(OctaveEnum||{});class AbstractTempoExpression extends AbstractExpression{constructor(R,F,D,G){super(F),this.label=R,this.staffNumber=D,this.parentMultiTempoExpression=G}get Label(){return this.label}set Label(R){this.label=R}get Placement(){return this.placement}set Placement(R){this.placement=R}get StaffNumber(){return this.staffNumber}set StaffNumber(R){this.staffNumber=R}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}static isStringInStringList(R,F){for(const D of R)if(AbstractTempoExpression.stringContainsSeparatedWord(F.toLowerCase().trim(),D.toLowerCase().trim()))return!0;return!1}static stringContainsSeparatedWord(R,F){return R===F||R.indexOf(" "+F)!==-1||R.indexOf(F+" ")!==-1}}const _InstantaneousTempoExpression=class extends AbstractTempoExpression{constructor(B,R,F,D,G,U=!1){super(B,R,F,G),this.setTempoAndTempoType(D)}static getDefaultValueForTempoType(B){switch(B){case TempoEnum.larghissimo:return 20;case TempoEnum.grave:return 30;case TempoEnum.lento:return 48;case TempoEnum.largo:return 52;case TempoEnum.larghetto:return 63;case TempoEnum.adagio:return 70;case TempoEnum.adagietto:return 75;case TempoEnum.andanteModerato:return 88;case TempoEnum.andante:return 92;case TempoEnum.andantino:return 96;case TempoEnum.moderato:return 106;case TempoEnum.allegretto:return 112;case TempoEnum.allegroModerato:return 118;case TempoEnum.allegro:return 130;case TempoEnum.vivace:return 140;case TempoEnum.vivacissimo:return 155;case TempoEnum.allegrissimo:return 170;case TempoEnum.presto:return 184;case TempoEnum.prestissimo:return 200;default:throw new ArgumentOutOfRangeException("tempoEnum")}}static isInputStringInstantaneousTempo(B){return B?_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoLarghissimo,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoGrave,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoLento,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoLargo,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoLarghetto,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAdagio,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAdagietto,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAndanteModerato,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAndante,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAndantino,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoModerato,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAllegretto,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAllegroModerato,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAllegro,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoVivace,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoVivacissimo,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAllegrissimo,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoPresto,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoPrestissimo,B)||_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoChangesGeneral,B):!1}get Label(){return this.label}set Label(B){this.label=B}get Placement(){return this.placement}set Placement(B){this.placement=B}get StaffNumber(){return this.staffNumber}set StaffNumber(B){this.staffNumber=B}get Enum(){return this.tempoEnum}get TempoInBpm(){return this.tempoInBpm}set TempoInBpm(B){this.tempoInBpm=B}get ParentMultiTempoExpression(){return this.parentMultiTempoExpression}getAbsoluteTimestamp(){return Fraction$1.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp)}getAbsoluteFloatTimestamp(){return Fraction$1.plus(this.ParentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.ParentMultiTempoExpression.Timestamp).RealValue}setTempoAndTempoType(B){if(!this.label){this.tempoInBpm=B,this.tempoEnum=TempoEnum.metronomeMark;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoLarghissimo,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.larghissimo)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.larghissimo;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoGrave,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.grave)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.grave;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoLento,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.lento)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.lento;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoLargo,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.largo)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.largo;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoLarghetto,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.larghetto)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.larghetto;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAdagio,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.adagio)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.adagio;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAdagietto,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.adagietto)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.adagietto;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAndanteModerato,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.andanteModerato)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.andanteModerato;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAndante,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.andante)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.andante;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAndantino,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.andantino)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.andantino;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoModerato,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.moderato)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.moderato;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAllegretto,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.allegretto)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.allegretto;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAllegroModerato,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.allegroModerato)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.allegroModerato;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAllegro,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.allegro)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.allegro;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoVivace,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.vivace)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.vivace;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoVivacissimo,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.vivacissimo)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.vivacissimo;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAllegrissimo,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.allegrissimo)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.allegrissimo;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoPresto,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.presto)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.presto;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoPrestissimo,this.label)){B===0&&(B=_InstantaneousTempoExpression.getDefaultValueForTempoType(TempoEnum.prestissimo)),this.tempoInBpm=B,this.tempoEnum=TempoEnum.prestissimo;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoAddons,this.label)){this.tempoInBpm=0,this.tempoEnum=TempoEnum.addon;return}if(_InstantaneousTempoExpression.isStringInStringList(_InstantaneousTempoExpression.listInstantaneousTempoChangesGeneral,this.label)){this.tempoInBpm=0,this.tempoEnum=TempoEnum.changes;return}}};let InstantaneousTempoExpression=_InstantaneousTempoExpression;InstantaneousTempoExpression.listInstantaneousTempoLarghissimo=["Larghissimo","Sehr breit","very, very slow"];InstantaneousTempoExpression.listInstantaneousTempoGrave=["Grave","Schwer","slow and solemn"];InstantaneousTempoExpression.listInstantaneousTempoLento=["Lento","Lent","Langsam","slowly"];InstantaneousTempoExpression.listInstantaneousTempoLargo=["Largo","Breit","broadly"];InstantaneousTempoExpression.listInstantaneousTempoLarghetto=["Larghetto","Etwas breit","rather broadly"];InstantaneousTempoExpression.listInstantaneousTempoAdagio=["Adagio","Langsam","Ruhig","slow and stately"];InstantaneousTempoExpression.listInstantaneousTempoAdagietto=["Adagietto","Ziemlich ruhig","Ziemlich langsam","rather slow"];InstantaneousTempoExpression.listInstantaneousTempoAndanteModerato=["Andante moderato"];InstantaneousTempoExpression.listInstantaneousTempoAndante=["Andante","Gehend","Schreitend","at a walking pace"];InstantaneousTempoExpression.listInstantaneousTempoAndantino=["Andantino"];InstantaneousTempoExpression.listInstantaneousTempoModerato=["Moderato","M\xE4\xDFig","Mod\uFFFDr\uFFFD","moderately"];InstantaneousTempoExpression.listInstantaneousTempoAllegretto=["Allegretto","fast"];InstantaneousTempoExpression.listInstantaneousTempoAllegroModerato=["Allegro moderato"];InstantaneousTempoExpression.listInstantaneousTempoAllegro=["Allegro","Rapide","Vite","Rasch","Schnell","Fr\uFFFDhlich"];InstantaneousTempoExpression.listInstantaneousTempoVivace=["Vivace","Lebhaft","Lebendig","lively and fast"];InstantaneousTempoExpression.listInstantaneousTempoVivacissimo=["Vivacissimo","Sehr lebhaft","Sehr lebendig"];InstantaneousTempoExpression.listInstantaneousTempoAllegrissimo=["Allegrissimo","very fast"];InstantaneousTempoExpression.listInstantaneousTempoPresto=["Presto","Sehr schnell","Geschwind"];InstantaneousTempoExpression.listInstantaneousTempoPrestissimo=["Prestissimo","\xE4u\xDFerst schnell"];InstantaneousTempoExpression.listInstantaneousTempoChangesGeneral=["tempo primo","a tempo","tempo i","rubato","doppio movimento"];InstantaneousTempoExpression.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\xF6s","gesanglich","mit Schwung","mit Feuer","mit Schmerz","mit Ausdruck","mit Bewegung","geistvoll","ausdrucksvoll","freudig","verspielt","angemessen","grazi\xF6s","mit Grazie","flink","beh\xE4nde","traurig","klagend","majest\xE4tisch","aber nicht zu sehr","markant","gem\xE4\xDFigt","viel","sehr","ersterbend","bewegt","nicht zu sehr","mehr","ein wenig","gleichsam","entschlossen","zupackend","heiter","nachdr\xFCcklich","getragen","gewichtig","zart","z\xE4rtlich","im angemessenen Zeitma\xDF","ruhig","ein wenig","alla marcia","ad libitum","alla breve"];var TempoEnum=(B=>(B[B.none=0]="none",B[B.larghissimo=1]="larghissimo",B[B.grave=2]="grave",B[B.lento=3]="lento",B[B.largo=4]="largo",B[B.larghetto=5]="larghetto",B[B.adagio=6]="adagio",B[B.adagietto=7]="adagietto",B[B.andanteModerato=8]="andanteModerato",B[B.andante=9]="andante",B[B.andantino=10]="andantino",B[B.moderato=11]="moderato",B[B.allegretto=12]="allegretto",B[B.allegroModerato=13]="allegroModerato",B[B.allegro=14]="allegro",B[B.vivace=15]="vivace",B[B.vivacissimo=16]="vivacissimo",B[B.allegrissimo=17]="allegrissimo",B[B.presto=18]="presto",B[B.prestissimo=19]="prestissimo",B[B.lastRealTempo=20]="lastRealTempo",B[B.addon=21]="addon",B[B.changes=22]="changes",B[B.metronomeMark=23]="metronomeMark",B))(TempoEnum||{});const _MoodExpression=class extends AbstractExpression{constructor(B,R,F){super(R),this.label=B,this.staffNumber=F,this.setMoodType()}static isInputStringMood(B){return B?_MoodExpression.isStringInStringList(_MoodExpression.listMoodAffettuoso,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodAgitato,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodAnimato,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodAppassionato,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodBrillante,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodCantabile,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodDolce,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodEnergico,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodEroico,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodEspressivo,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodFurioso,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodGiocoso,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodGioioso,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodGrandioso,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodGrazioso,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodLacrimoso,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodLeggiero,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodMaestoso,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodMalinconico,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodMarcato,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodMarziale,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodMesto,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodMorendo,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodNobilmente,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodPatetico,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodPesante,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodSaltando,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodSautille,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodScherzando,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodSostenuto,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodSpiccato,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodTenerezza,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodTranquillamente,B)||_MoodExpression.isStringInStringList(_MoodExpression.listMoodTrionfante,B):!1}get Label(){return this.label}set Label(B){this.label=B}get Mood(){return this.moodType}set Mood(B){this.moodType=B}get StaffNumber(){return this.staffNumber}set StaffNumber(B){this.staffNumber=B}get Placement(){return this.placement}set Placement(B){this.placement=B}setMoodType(){_MoodExpression.isStringInStringList(_MoodExpression.listMoodAffettuoso,this.label)?this.moodType=MoodEnum.Affettuoso:_MoodExpression.isStringInStringList(_MoodExpression.listMoodAgitato,this.label)?this.moodType=MoodEnum.Agitato:_MoodExpression.isStringInStringList(_MoodExpression.listMoodAnimato,this.label)?this.moodType=MoodEnum.Animato:_MoodExpression.isStringInStringList(_MoodExpression.listMoodAppassionato,this.label)?this.moodType=MoodEnum.Appassionato:_MoodExpression.isStringInStringList(_MoodExpression.listMoodBrillante,this.label)?this.moodType=MoodEnum.Brillante:_MoodExpression.isStringInStringList(_MoodExpression.listMoodCantabile,this.label)?this.moodType=MoodEnum.Cantabile:_MoodExpression.isStringInStringList(_MoodExpression.listMoodDolce,this.label)?this.moodType=MoodEnum.Dolce:_MoodExpression.isStringInStringList(_MoodExpression.listMoodEnergico,this.label)?this.moodType=MoodEnum.Energico:_MoodExpression.isStringInStringList(_MoodExpression.listMoodEroico,this.label)?this.moodType=MoodEnum.Eroico:_MoodExpression.isStringInStringList(_MoodExpression.listMoodEspressivo,this.label)?this.moodType=MoodEnum.Espressivo:_MoodExpression.isStringInStringList(_MoodExpression.listMoodFurioso,this.label)?this.moodType=MoodEnum.Furioso:_MoodExpression.isStringInStringList(_MoodExpression.listMoodGiocoso,this.label)?this.moodType=MoodEnum.Giocoso:_MoodExpression.isStringInStringList(_MoodExpression.listMoodGioioso,this.label)?this.moodType=MoodEnum.Gioioso:_MoodExpression.isStringInStringList(_MoodExpression.listMoodGrandioso,this.label)?this.moodType=MoodEnum.Grandioso:_MoodExpression.isStringInStringList(_MoodExpression.listMoodGrazioso,this.label)?this.moodType=MoodEnum.Grazioso:_MoodExpression.isStringInStringList(_MoodExpression.listMoodLacrimoso,this.label)?this.moodType=MoodEnum.Lacrimoso:_MoodExpression.isStringInStringList(_MoodExpression.listMoodLeggiero,this.label)?this.moodType=MoodEnum.Leggiero:_MoodExpression.isStringInStringList(_MoodExpression.listMoodMaestoso,this.label)?this.moodType=MoodEnum.Maestoso:_MoodExpression.isStringInStringList(_MoodExpression.listMoodMalinconico,this.label)?this.moodType=MoodEnum.Malinconico:_MoodExpression.isStringInStringList(_MoodExpression.listMoodMarcato,this.label)?this.moodType=MoodEnum.Marcato:_MoodExpression.isStringInStringList(_MoodExpression.listMoodMarziale,this.label)?this.moodType=MoodEnum.Marziale:_MoodExpression.isStringInStringList(_MoodExpression.listMoodMesto,this.label)?this.moodType=MoodEnum.Mesto:_MoodExpression.isStringInStringList(_MoodExpression.listMoodMorendo,this.label)?this.moodType=MoodEnum.Morendo:_MoodExpression.isStringInStringList(_MoodExpression.listMoodNobilmente,this.label)?this.moodType=MoodEnum.Nobilmente:_MoodExpression.isStringInStringList(_MoodExpression.listMoodPatetico,this.label)?this.moodType=MoodEnum.Patetico:_MoodExpression.isStringInStringList(_MoodExpression.listMoodPesante,this.label)?this.moodType=MoodEnum.Pesante:_MoodExpression.isStringInStringList(_MoodExpression.listMoodSaltando,this.label)?this.moodType=MoodEnum.Saltando:_MoodExpression.isStringInStringList(_MoodExpression.listMoodSautille,this.label)?this.moodType=MoodEnum.Sautille:_MoodExpression.isStringInStringList(_MoodExpression.listMoodScherzando,this.label)?this.moodType=MoodEnum.Scherzando:_MoodExpression.isStringInStringList(_MoodExpression.listMoodSostenuto,this.label)?this.moodType=MoodEnum.Sostenuto:_MoodExpression.isStringInStringList(_MoodExpression.listMoodSpiccato,this.label)?this.moodType=MoodEnum.Spiccato:_MoodExpression.isStringInStringList(_MoodExpression.listMoodTenerezza,this.label)?this.moodType=MoodEnum.Tenerezza:_MoodExpression.isStringInStringList(_MoodExpression.listMoodTranquillamente,this.label)?this.moodType=MoodEnum.Tranquillamente:_MoodExpression.isStringInStringList(_MoodExpression.listMoodTrionfante,this.label)&&(this.moodType=MoodEnum.Trionfante)}};let MoodExpression=_MoodExpression;MoodExpression.listMoodAffettuoso=["affettuoso"];MoodExpression.listMoodAgitato=["agitato"];MoodExpression.listMoodAppassionato=["appassionato"];MoodExpression.listMoodAnimato=["animato","lively"];MoodExpression.listMoodBrillante=["brillante"];MoodExpression.listMoodCantabile=["cantabile"];MoodExpression.listMoodDolce=["dolce"];MoodExpression.listMoodEnergico=["energico"];MoodExpression.listMoodEroico=["eroico"];MoodExpression.listMoodEspressivo=["espressivo"];MoodExpression.listMoodFurioso=["furioso"];MoodExpression.listMoodGiocoso=["giocoso"];MoodExpression.listMoodGioioso=["gioioso"];MoodExpression.listMoodLacrimoso=["lacrimoso"];MoodExpression.listMoodGrandioso=["grandioso"];MoodExpression.listMoodGrazioso=["grazioso"];MoodExpression.listMoodLeggiero=["leggiero"];MoodExpression.listMoodMaestoso=["maestoso"];MoodExpression.listMoodMalinconico=["malinconico"];MoodExpression.listMoodMarcato=["marcato"];MoodExpression.listMoodMarziale=["marziale"];MoodExpression.listMoodMesto=["mesto"];MoodExpression.listMoodMorendo=["morendo"];MoodExpression.listMoodNobilmente=["nobilmente"];MoodExpression.listMoodPatetico=["patetico"];MoodExpression.listMoodPesante=["pesante"];MoodExpression.listMoodSautille=["sautille"];MoodExpression.listMoodSaltando=["saltando"];MoodExpression.listMoodScherzando=["scherzando"];MoodExpression.listMoodSostenuto=["sostenuto"];MoodExpression.listMoodSpiccato=["spiccato"];MoodExpression.listMoodTenerezza=["tenerezza"];MoodExpression.listMoodTranquillamente=["tranquillamente"];MoodExpression.listMoodTrionfante=["trionfante"];var MoodEnum=(B=>(B[B.Affettuoso=0]="Affettuoso",B[B.Agitato=1]="Agitato",B[B.Appassionato=2]="Appassionato",B[B.Animato=3]="Animato",B[B.Brillante=4]="Brillante",B[B.Cantabile=5]="Cantabile",B[B.Dolce=6]="Dolce",B[B.Energico=7]="Energico",B[B.Eroico=8]="Eroico",B[B.Espressivo=9]="Espressivo",B[B.Furioso=10]="Furioso",B[B.Giocoso=11]="Giocoso",B[B.Gioioso=12]="Gioioso",B[B.Lacrimoso=13]="Lacrimoso",B[B.Grandioso=14]="Grandioso",B[B.Grazioso=15]="Grazioso",B[B.Leggiero=16]="Leggiero",B[B.Maestoso=17]="Maestoso",B[B.Malinconico=18]="Malinconico",B[B.Marcato=19]="Marcato",B[B.Marziale=20]="Marziale",B[B.Mesto=21]="Mesto",B[B.Morendo=22]="Morendo",B[B.Nobilmente=23]="Nobilmente",B[B.Patetico=24]="Patetico",B[B.Pesante=25]="Pesante",B[B.Sautille=26]="Sautille",B[B.Saltando=27]="Saltando",B[B.Scherzando=28]="Scherzando",B[B.Sostenuto=29]="Sostenuto",B[B.Spiccato=30]="Spiccato",B[B.Tenerezza=31]="Tenerezza",B[B.Tranquillamente=32]="Tranquillamente",B[B.Trionfante=33]="Trionfante",B[B.Vivace=34]="Vivace",B))(MoodEnum||{});class UnknownExpression extends AbstractExpression{constructor(R,F,D,G){super(F),this.label=R,this.staffNumber=G,D===void 0&&(D=TextAlignmentEnum.LeftBottom),this.textAlignment=D}get Label(){return this.label}get Placement(){return this.placement}set Placement(R){this.placement=R}get StaffNumber(){return this.staffNumber}set StaffNumber(R){this.staffNumber=R}get TextAlignment(){return this.textAlignment}}class MultiExpression{constructor(R,F){this.unknownList=[],this.moodList=[],this.expressions=[],this.sourceMeasure=R,this.timestamp=F}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(R){this.sourceMeasure=R}get StaffNumber(){return this.staffNumber}set StaffNumber(R){this.staffNumber=R}get Timestamp(){return this.timestamp}set Timestamp(R){this.timestamp=R}get AbsoluteTimestamp(){return Fraction$1.plus(this.timestamp,this.sourceMeasure.AbsoluteTimestamp)}get InstantaneousDynamic(){return this.instantaneousDynamic}set InstantaneousDynamic(R){this.instantaneousDynamic=R}get EndingContinuousDynamic(){return this.endingContinuousDynamic}set EndingContinuousDynamic(R){this.endingContinuousDynamic=R}get StartingContinuousDynamic(){return this.startingContinuousDynamic}set StartingContinuousDynamic(R){this.startingContinuousDynamic=R}get MoodList(){return this.moodList}get UnknownList(){return this.unknownList}get EntriesList(){return this.expressions}get OctaveShiftStart(){return this.octaveShiftStart}set OctaveShiftStart(R){this.octaveShiftStart=R}get OctaveShiftEnd(){return this.octaveShiftEnd}set OctaveShiftEnd(R){this.octaveShiftEnd=R}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(R){this.combinedExpressionsText=R}getPlacementOfFirstEntry(){let R=PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].expression instanceof InstantaneousDynamicExpression?R=this.expressions[0].expression.Placement:this.expressions[0].expression instanceof ContinuousDynamicExpression?R=this.expressions[0].expression.Placement:this.expressions[0].expression instanceof MoodExpression?R=this.expressions[0].expression.Placement:this.expressions[0].expression instanceof UnknownExpression&&(R=this.expressions[0].expression.Placement)),R}getFontstyleOfFirstEntry(){var F;let R=FontStyles.Regular;return this.expressions.length>0&&(this.expressions[0].expression instanceof ContinuousDynamicExpression||this.expressions[0].expression instanceof MoodExpression?R=FontStyles.Italic:this.expressions[0].expression instanceof UnknownExpression&&(R=(F=this.expressions[0].expression.fontStyle)!=null?F:FontStyles.Regular)),R}addExpression(R,F){R instanceof InstantaneousDynamicExpression?(this.instantaneousDynamic&&this.removeExpressionFromEntryList(this.InstantaneousDynamic),this.instantaneousDynamic=R,this.instantaneousDynamic.ParentMultiExpression=this):R instanceof ContinuousDynamicExpression?this.startingContinuousDynamic=R:R instanceof MoodExpression?this.moodList.push(R):R instanceof UnknownExpression&&this.unknownList.push(R),this.addExpressionToEntryList(R,F)}CompareTo(R){return this.Timestamp.RealValue>R.Timestamp.RealValue?1:this.Timestamp.RealValue=ContinuousTempoType.allargando&&B<=ContinuousTempoType.ritenuto}get TempoType(){return this.tempoType}set TempoType(B){this.tempoType=B}get StartTempo(){return this.startTempo}set StartTempo(B){this.startTempo=B}get EndTempo(){return this.endTempo}set EndTempo(B){this.endTempo=B}get AbsoluteEndTimestamp(){return this.absoluteEndTimestamp}set AbsoluteEndTimestamp(B){this.absoluteEndTimestamp=B}get AbsoluteTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp}getAbsoluteFloatTimestamp(){return this.ParentMultiTempoExpression.AbsoluteTimestamp.RealValue}getInterpolatedTempo(B){const R=Fraction$1.plus(this.parentMultiTempoExpression.SourceMeasureParent.AbsoluteTimestamp,this.parentMultiTempoExpression.Timestamp);if(B.lt(R))return-1;if(this.absoluteEndTimestamp.lt(B))return-2;const F=Fraction$1.minus(B,R).RealValue/Fraction$1.minus(this.absoluteEndTimestamp,R).RealValue;return Math.max(0,Math.min(250,this.startTempo+(this.endTempo-this.startTempo)*F))}setTempoType(){_ContinuousTempoExpression.isStringInStringList(_ContinuousTempoExpression.listContinuousTempoFaster,this.label)?this.tempoType=ContinuousTempoType.accelerando:_ContinuousTempoExpression.isStringInStringList(_ContinuousTempoExpression.listContinuousTempoSlower,this.label)&&(this.tempoType=ContinuousTempoType.ritardando)}};let ContinuousTempoExpression=_ContinuousTempoExpression;ContinuousTempoExpression.listContinuousTempoFaster=["accelerando","piu mosso","poco piu","stretto"];ContinuousTempoExpression.listContinuousTempoSlower=["poco meno","meno mosso","piu lento","rallentando","ritardando","ritenuto","ritard.","ritard","riten.","riten"];var ContinuousTempoType=(B=>(B[B.accelerando=0]="accelerando",B[B.stretto=1]="stretto",B[B.stringendo=2]="stringendo",B[B.mosso=3]="mosso",B[B.piuMosso=4]="piuMosso",B[B.allargando=5]="allargando",B[B.calando=6]="calando",B[B.menoMosso=7]="menoMosso",B[B.rallentando=8]="rallentando",B[B.ritardando=9]="ritardando",B[B.ritard=10]="ritard",B[B.rit=11]="rit",B[B.ritenuto=12]="ritenuto",B[B.rubato=13]="rubato",B[B.precipitando=14]="precipitando",B))(ContinuousTempoType||{});class MultiTempoExpression{constructor(R,F){this.expressions=[],this.sourceMeasure=R,this.timestamp=F}get Timestamp(){return this.timestamp}get AbsoluteTimestamp(){return Fraction$1.plus(this.sourceMeasure.AbsoluteTimestamp,this.timestamp)}get SourceMeasureParent(){return this.sourceMeasure}set SourceMeasureParent(R){this.sourceMeasure=R}get InstantaneousTempo(){return this.instantaneousTempo}get ContinuousTempo(){return this.continuousTempo}get EntriesList(){return this.expressions}get CombinedExpressionsText(){return this.combinedExpressionsText}set CombinedExpressionsText(R){this.combinedExpressionsText=R}getPlacementOfFirstEntry(){let R=PlacementEnum.Above;return this.expressions.length>0&&(this.expressions[0].Expression instanceof InstantaneousTempoExpression?R=this.expressions[0].Expression.Placement:this.expressions[0].Expression instanceof ContinuousTempoExpression&&(R=this.expressions[0].Expression.Placement)),R}getFontstyleOfFirstEntry(){let R=FontStyles.Regular;return this.expressions[0].Expression instanceof InstantaneousTempoExpression?R=FontStyles.Bold:this.expressions[0].Expression instanceof ContinuousTempoExpression&&(R=FontStyles.Italic),R}addExpression(R,F){if(this.checkIfAlreadyExists(R))return;R instanceof InstantaneousTempoExpression?this.instantaneousTempo=R:R instanceof ContinuousTempoExpression&&(this.continuousTempo=R);const D=new TempoExpressionEntry;D.prefix=F,D.Expression=R,D.label=R.Label,this.expressions.push(D)}CompareTo(R){return this.Timestamp.RealValue>R.Timestamp.RealValue?1:this.Timestamp.RealValue0){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 R of this.musicSystems)this.optimizeDistanceBetweenStaffLines(R);this.calculateMusicSystemsRelativePositions()}setMeasureWidth(R,F,D,G){for(let U=0,W=R.length;U0&&(q.beginInstructionsWidth=D),G>0&&(q.endInstructionsWidth=G)}}finalizeCurrentAndCreateNewSystem(R,F=!1,D=!0,G=!1){this.finalizeCurrentSystem(R,F,D,G),this.currentSystemParams=new SystemBuildParameters,R!==void 0&&this.measureListIndex=1){const F=this.currentSystemParams.currentSystem.GraphicalMeasures[this.currentSystemParams.currentSystem.GraphicalMeasures.length-1];let D=0;const G=R[R.length-1];G.endLine===SystemLinesEnum.DotsBoldBoldDots&&(G.endLine=SystemLinesEnum.DotsThinBold,D=F[0].getLineWidth(SystemLinesEnum.DotsBoldBoldDots)/2-F[0].getLineWidth(SystemLinesEnum.DotsThinBold)),this.currentSystemParams.currentSystemFixWidth-=D;for(let U=0,W=F.length;U1){W=!0;break}}let q=0;for(let Y=0;Y=0&&this.measureList[ne]){const ae=(Q=this.measureList[ne][0])==null?void 0:Q.parentSourceMeasure;(ae==null?void 0:ae.ImplicitMeasure)&&(ae==null?void 0:ae.RhythmPrinted)&&(ie=!1)}ie&&(F.addRhythmAtBegin(J),F.parentSourceMeasure.RhythmPrinted=J,te=!0)}return(Z||K||te)&&(W+=F.beginInstructionsWidth,te&&(W+=this.rules.RhythmRightMargin)),W}addInstructionsAtMeasureEnd(R,F,D){if(!R||!R.Instructions||R.Instructions.length===0)return 0;for(let G=0,U=R.Instructions.length;G0&&(this.currentSystemParams.systemMeasures.push({beginLine:SystemLinesEnum.None,endLine:SystemLinesEnum.None}),this.currentSystemParams.currentWidth+=G,this.currentSystemParams.currentSystemFixWidth+=G)}addExtraInstructionMeasure(R,F,D){const G=this.currentSystemParams.currentSystem,U=MusicSheetCalculator.symbolFactory.createExtraGraphicalMeasure(G.StaffLines[R]);F&&U.addKeyAtBegin(F,this.activeKeys[R],this.activeClefs[R]),D!==void 0&&D.PrintObject&&U.addRhythmAtBegin(D),U.PositionAndShape.BorderLeft=0,U.PositionAndShape.BorderTop=0,U.PositionAndShape.BorderBottom=this.rules.StaffHeight;const W=this.rules.MeasureLeftMargin+U.beginInstructionsWidth+this.rules.MeasureRightMargin;return U.PositionAndShape.BorderRight=W,G.StaffLines[R].Measures.push(U),W}addStaveMeasuresToSystem(R){if(R[0]){const F=[];for(let G=0;G1){const q=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,R.measureListIndex+R.multipleRestMeasures-1);R=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[q]}}finally{}const F=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures,D=F[this.measureListIndex];let G=!1;return D.allRests&&(G=(W=(U=F[this.measureListIndex+D.multipleRestMeasures-1])==null?void 0:U.endsWithLineRepetition)==null?void 0:W.call(U)),this.nextMeasureBeginsLineRepetition()&&this.thisMeasureEndsLineRepetition()?SystemLinesEnum.DotsBoldBoldDots:this.thisMeasureEndsLineRepetition()||G?SystemLinesEnum.DotsThinBold:this.nextMeasureHasKeyInstructionChange()||this.thisMeasureEndsWordRepetition()||this.nextMeasureBeginsWordRepetition()?SystemLinesEnum.DoubleThin:R&&R.endingBarStyleEnum!==void 0?R.endingBarStyleEnum:SystemLinesEnum.SingleThin}getLineWidth(R,F,D){let G=R.getLineWidth(F);return F===SystemLinesEnum.DotsBoldBoldDots&&(G/=2),D&&F===SystemLinesEnum.BoldThinDots&&(G+=this.rules.DistanceBetweenLastInstructionAndRepetitionBarline),G}previousMeasureEndsLineRepetition(){if(this.measureListIndex===0)return!1;for(let R=0,F=this.measureList[this.measureListIndex-1].length;R=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||!this.measureList[R])return!1;for(let F=0,D=this.measureList[R].length;F=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length||R>this.measureList.length-1)return!1;for(let F=0,D=this.measureList[R].length;F1)for(let q=1;qU&&(U=Z)}for(let q=0;qthis.rules.PageHeight-this.rules.PageBottomMargin&&(G++,G<=4&&console.log(`warning: could not fit a single system on page ${R.PageNumber} and measure number ${D.GraphicalMeasures[0][0].MeasureNumber}. The PageFormat may be too small for this sheet." Will not give further warnings for all pages, only total.`))}else{const Y=this.musicSystems[q-1],J=Y.StaffLines[Y.StaffLines.length-1],Z=J.PositionAndShape;let K=this.findRequiredDistanceWithSkyBottomLine(Y,D);K=Math.max(U,K),K+=this.rules.MinSkyBottomDistBetweenSystems,((W=window==null?void 0:window.appName)==null?void 0:W.toLocaleUpperCase())==="GYM"&&(K=K<16?16:K);const te=this.hasExpressionCounts(D);te.TempoCount>0&&this.rules.MetronomeMarksDrawn&&(K+=2),te.OtherCount>0&&this.rules.MetronomeMarksDrawn&&(K+=2),K=Math.max(K,this.rules.MinimumDistanceBetweenSystems+J.StaffHeight);const Q=F+Z.RelativePosition.y+K,ie=Q+D.PositionAndShape.BorderMarginBottom;if(!(this.rules.NewPageAtXMLNewPageAttribute&&Y.breaksPage)&&ie0&&console.log(`total amount of pages that couldn't fit a single music system: ${G} of ${R.PageNumber}`)}findRequiredDistanceWithSkyBottomLine(R,F){const D=R.StaffLines[R.StaffLines.length-1],G=F.StaffLines[0],U=D.BottomLine,W=G.SkyLine,q=D.PositionAndShape,Y=G.PositionAndShape,J=1/this.rules.SamplingUnit;let Z=0;for(let K=0;K=W.length)break;const ie=Math.max(0,Q-6),se=Math.min(W.length-1,Q+6);let ne=0;for(let ae=ie;ae<=se;ae++)ne=Math.min(ne,W[ae]);const re=te-ne;Z=Math.max(re,Z)}return Z===0&&(Z=q.BorderBottom-Y.BorderTop),Z}}class SystemBuildParameters{constructor(){this.systemMeasures=[],this.systemMeasureIndex=0,this.currentWidth=0,this.currentSystemFixWidth=0,this.currentSystemVarWidth=0,this.maxLabelLength=0}IsSystemStartMeasure(){return this.systemMeasureIndex===0}}class OctaveShiftParams{constructor(R,F,D){this.getOpenOctaveShift=R,this.getAbsoluteStartTimestamp=F,this.getAbsoluteEndTimestamp=D}}class AccidentalCalculator{constructor(){this.keySignatureNoteAlterationsDict=new Dictionary,this.currentAlterationsComparedToKeyInstructionList=[],this.currentInMeasureNoteAlterationsDict=new Dictionary}get ActiveKeyInstruction(){return this.activeKeyInstruction}set ActiveKeyInstruction(R){this.activeKeyInstruction=R,this.reactOnKeyInstructionChange()}doCalculationsAtEndOfMeasure(){this.currentInMeasureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.clear();for(const R of this.keySignatureNoteAlterationsDict.keys())this.currentInMeasureNoteAlterationsDict.setValue(R,this.keySignatureNoteAlterationsDict.getValue(R))}checkAccidental(R,F){if(!F)return;const D=F.FundamentalNote+F.Octave*12,G=this.currentAlterationsComparedToKeyInstructionList.indexOf(D)>=0;if(this.currentInMeasureNoteAlterationsDict.containsKey(D)){if(G&&this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(D),1),this.currentInMeasureNoteAlterationsDict.getValue(D)!==F.AccidentalHalfTones){this.keySignatureNoteAlterationsDict.containsKey(D)&&this.keySignatureNoteAlterationsDict.getValue(D)!==F.AccidentalHalfTones?(this.currentAlterationsComparedToKeyInstructionList.push(D),this.currentInMeasureNoteAlterationsDict.setValue(D,F.AccidentalHalfTones)):F.Accidental!==AccidentalEnum.NONE&&this.currentInMeasureNoteAlterationsDict.remove(D);const U=this.currentInMeasureNoteAlterationsDict.getValue(D);if(F.Accidental===AccidentalEnum.NONE&&(Math.abs(U)===.5?F=new Pitch(F.FundamentalNote,F.Octave,AccidentalEnum.NONE):F=new Pitch(F.FundamentalNote,F.Octave,AccidentalEnum.NATURAL)),this.isAlterAmbiguousAccidental(F.Accidental)&&!F.AccidentalXml)return;MusicSheetCalculator.symbolFactory.addGraphicalAccidental(R,F)}}else if(F.Accidental!==AccidentalEnum.NONE){if(G||this.currentAlterationsComparedToKeyInstructionList.push(D),this.currentInMeasureNoteAlterationsDict.setValue(D,F.AccidentalHalfTones),this.isAlterAmbiguousAccidental(F.Accidental)&&!F.AccidentalXml)return;MusicSheetCalculator.symbolFactory.addGraphicalAccidental(R,F)}else G&&(F=new Pitch(F.FundamentalNote,F.Octave,AccidentalEnum.NATURAL),this.currentAlterationsComparedToKeyInstructionList.splice(this.currentAlterationsComparedToKeyInstructionList.indexOf(D),1),MusicSheetCalculator.symbolFactory.addGraphicalAccidental(R,F))}isAlterAmbiguousAccidental(R){return R===AccidentalEnum.SLASHFLAT||R===AccidentalEnum.QUARTERTONEFLAT}reactOnKeyInstructionChange(){const R=this.activeKeyInstruction.AlteratedNotes;let F;this.activeKeyInstruction.Key>0?F=AccidentalEnum.SHARP:F=AccidentalEnum.FLAT,this.keySignatureNoteAlterationsDict.clear(),this.currentAlterationsComparedToKeyInstructionList.length=0;for(let D=-9;D<9;D++)for(let G=0;G0?(D=J-1,R.push({startIndex:F,endIndex:D}),F=J):te.HasEndLine&&this.rules.NewPartAndSystemAfterFinalBarline&&(D=J,R.push({startIndex:F,endIndex:D}),F=J+1)}Fie&&he%2===0?(U.push(he),ce=ue,he=1):he++:ce>ie?(U.push(he),ce=ue,he=1):he++,ue>ie?ve=fe+1:ve=Math.ceil(ve),re===ve?ae+=1:(G.push(ae),re=ve,ae=1)}G.push(ae),U.push(he),U=U.filter(Boolean),console.log(U,G)}return this.buildPreparedMusicSystems(U)}buildPreparedMusicSystems(R){let F=!1;this.currentSystemParams=new SystemBuildParameters,this.currentSystemParams.currentSystem=this.initMusicSystem();for(let D=0,G=this.measureList.length;D0&&this.rules.RenderMultipleRestMeasures){K.isReducedToMultiRest=!0,K.multipleRestMeasureNumber=1;const Q=K.multipleRestMeasures-1;J+=Q;for(let ie=1;ie<=Q;ie++){const se=R.SourceMeasures[K.MeasureNumber-1+ie];se.multipleRestMeasureNumber=ie+1,se.isReducedToMultiRest=!0,F.push([void 0])}}}if(this.rules.AutoGenerateMutipleRestMeasuresFromRestMeasures&&this.rules.RenderMultipleRestMeasures){let J,Z=0;for(let K=0,te=R.SourceMeasures.length;K0){J.isReducedToMultiRest=!0,J.multipleRestMeasureNumber=1,Z++,Q.multipleRestMeasureNumber=Z,Q.isReducedToMultiRest=!0;for(let ie=0;ie1){J.multipleRestMeasures=Z;const ie=this.createGraphicalMeasuresForSourceMeasure(J,D,U,q,G);F[J.measureListIndex]=ie,Z=0,J=void 0}else Z=0,J=void 0}if(Z>1){J.multipleRestMeasures=Z,J.isReducedToMultiRest=!0;const K=this.createGraphicalMeasuresForSourceMeasure(J,D,U,q,G);F[J.measureListIndex]=K,Z=0,J=void 0}}const Y=G.map(J=>J.ClefType===ClefEnum.percussion);this.handleStaffEntries(Y),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(),GraphicalMusicSheet.transformRelativeToAbsolutePosition(this.graphicalMusicSheet)}calculateXLayout(R,F){let D=0;const G=this.rules.MaxInstructionsConstValue;if(this.graphicalMusicSheet.MeasureList.length>0){let U=this.graphicalMusicSheet.MeasureList[0],W=this.calculateMeasureXLayout(U);W=this.calculateMeasureWidthFromStaffEntries(U,W),MusicSheetCalculator.setMeasuresMinStaffEntriesWidth(U,W),D=W*1.2+F+G;for(let q=1;q0)return;const W=F.Measures[U];(W.MeasureNumber===0||W.MeasureNumber===1)&&(D=W.MeasureNumber),W!==F.Measures[0]&&this.rules.MeasureNumberLabelXOffset?G=this.rules.MeasureNumberLabelXOffset:G=0;const q=this.rules.UseXMLMeasureNumbers&&W.MeasureNumber===1&&W.parentSourceMeasure.getPrintedMeasureNumber()!==1;((W.MeasureNumber===D||W.MeasureNumber>=D+this.rules.MeasureNumberLabelOffset)&&!W.parentSourceMeasure.ImplicitMeasure||q)&&((W.MeasureNumber!==1||W.MeasureNumber===1&&W!==F.Measures[0]||q)&&this.calculateSingleMeasureNumberPlacement(W,F,R,G),D=W.MeasureNumber)}}calculateSingleMeasureNumberPlacement(R,F,D,G=0){const U=R.parentSourceMeasure.getPrintedMeasureNumber().toString(),W=new Label(U),q=new GraphicalLabel(W,this.rules.MeasureNumberLabelHeight,TextAlignmentEnum.LeftBottom,this.rules),Y=F.SkyBottomLineCalculator;q.setLabelPositionAndShapeBorders(),q.PositionAndShape.Parent=D.PositionAndShape;const J=F.PositionAndShape.RelativePosition.x+R.PositionAndShape.RelativePosition.x-q.PositionAndShape.BorderMarginLeft+G;let Z,K=J,te=J-q.PositionAndShape.BorderLeft+q.PositionAndShape.BorderRight;K-=F.PositionAndShape.RelativePosition.x,te-=F.PositionAndShape.RelativePosition.x;const Q=K+.5,ie=te-.5,se=Y.getSkyLineMinInRange(Q,ie);if(R===F.Measures[0]){let ne=0;if(D.GroupBrackets.length>0)for(const re of D.GroupBrackets)ne=Math.min(ne,re.PositionAndShape.BorderTop);Z=Math.min(se,ne)}else Z=se;Z=Math.min(0,Z),q.PositionAndShape.RelativePosition=new PointF2D(J,Z),D.MeasureNumberLabels.push(q)}calculateMeasureNumberSkyline(R){const F=R.StaffLines[0];for(const D of R.MeasureNumberLabels){let G=D.PositionAndShape.RelativePosition.x,U=G-D.PositionAndShape.BorderLeft+D.PositionAndShape.BorderRight;G-=F.PositionAndShape.RelativePosition.x,U-=F.PositionAndShape.RelativePosition.x,F.SkyBottomLineCalculator.updateSkyLineInRange(G,U,D.PositionAndShape.RelativePosition.y+D.PositionAndShape.BorderMarginTop)}}layoutGraphicalTie(R,F,D){throw new Error(this.abstractNotImplementedErrorMessage)}calculateSingleStaffLineLyricsPosition(R,F){let D=0,G=this.rules.StaffHeight;const U=[],W=R.SkyBottomLineCalculator;let q=R.Measures.length;for(let J=0;J0){U.push(ie),D=Math.max(D,ie.LyricsEntries.length);const se=ie.PositionAndShape.RelativePosition.x+K.x;let ne=Number.MAX_VALUE,re=Number.MIN_VALUE;for(let ce=0;ce0){const J=R.PositionAndShape.Size.width;let Z=U[0].PositionAndShape.RelativePosition.x+U[0].PositionAndShape.BorderMarginLeft+U[0].parentMeasure.PositionAndShape.RelativePosition.x;Z=Z>J?J:Z,W.updateBottomLineInRange(Z,J,Y)}return U}calculateLyricsExtendsAndDashes(R){for(let F=0,D=R.length;F0||R.UnknownList.length>0){let Y="";for(let Q=0,ie=R.EntriesList.length;QR.length-1&&(log$2.debug("minimum measure to draw index out of range. resetting min measure index to limit."),this.rules.MinMeasureToDrawIndex=R.length-1);const F=[];for(let W=this.rules.MinMeasureToDrawIndex,q=R.length;W0)&&(G=D.getSkyLineMinInRange(K,te));let Q=0;q===0?(Q+=this.rules.ChordSymbolYOffset,Q+=.1):Q+=this.rules.ChordSymbolYPadding,Q*=-1;const ie=Y.GraphicalLabel;ie.PositionAndShape.RelativePosition.y=G+Q,ie.setLabelPositionAndShapeBorders(),ie.PositionAndShape.calculateBoundingBox(),D.updateSkyLineInRange(K,te,G+ie.PositionAndShape.BorderMarginTop)}}}}calculateAlignedChordSymbolsOffset(R,F){let D=Number.MAX_SAFE_INTEGER;for(const G of R)for(const U of G.graphicalChordContainers){const W=G.PositionAndShape,q=U.PositionAndShape,Y=q.BorderMarginLeft+W.AbsolutePosition.x,J=q.BorderMarginRight+W.AbsolutePosition.x;D=Math.min(D,F.getSkyLineMinInRange(Y,J))}return D}layoutMeasureWithWholeRest(R,F,D){}layoutBeams(R){}layoutArticulationMarks(R,F,D){}layoutOrnament(R,F,D){}calculateRestNotePlacementWithinGraphicalBeam(R,F,D,G,U){}calculateTupletNumbers(){}calculateSlurs(){}calculateDynamicExpressionsForMultiExpression(R,F,D){}calculateGraphicalVerbalContinuousDynamic(R,F){const D=R.Label,G=F.x+D.PositionAndShape.BorderMarginLeft,U=F.x+D.PositionAndShape.BorderMarginRight,W=R.ContinuousDynamic.Placement,Y=R.ParentStaffLine.SkyBottomLineCalculator;let J;W===PlacementEnum.Below?(J=Y.getBottomLineMaxInRange(G,U),D.PositionAndShape.RelativePosition=new PointF2D(F.x,J-D.PositionAndShape.BorderMarginTop)):(J=Y.getSkyLineMinInRange(G,U),D.PositionAndShape.RelativePosition=new PointF2D(F.x,J-D.PositionAndShape.BorderMarginBottom))}calculateGraphicalContinuousDynamic(R,F){var de,we,Oe;const D=R.ParentStaffLine.ParentStaff.idInMusicSheet,G=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(R.ContinuousDynamic.EndMultiExpression.SourceMeasureParent,D);if(!G){log$2.warn("MusicSheetCalculator.calculateGraphicalContinuousDynamic: No endMeasure found");return}R.EndMeasure=G;const U=R.ParentStaffLine,W=G.ParentStaffLine,q=W&&U===W;let Y=!1;W?Y=W==null?void 0:W.isPartOfMultiStaffInstrument():U&&(Y=U==null?void 0:U.isPartOfMultiStaffInstrument());const J=Fraction$1.createFromFraction(R.ContinuousDynamic.EndMultiExpression.AbsoluteTimestamp),Z=this.graphicalMusicSheet.GetVerticalContainerFromTimestamp(J),K=Z.getFirstNonNullStaffEntry().parentMeasure,te=K.PositionAndShape.AbsolutePosition.x+K.PositionAndShape.BorderRight;let Q=new Fraction$1(0,0,0);for(const Me of Z.StaffEntries){const Pe=(de=Me==null?void 0:Me.sourceStaffEntry)==null?void 0:de.calculateMaxNoteLength();Pe!=null&&Pe.gt(Q)&&(Q=Pe)}const ie=this.getRelativePositionInStaffLineFromTimestamp(J,D,W,Y,0),se=Fraction$1.plus(J,Q),ne=this.getRelativePositionInStaffLineFromTimestamp(se,D,W,Y,0);ne.x>ie.x&&ne.xce){const ke=ae.StaffLines[Me].PositionAndShape.RelativePosition.y-U.PositionAndShape.RelativePosition.y-this.rules.StaffHeight;ye=this.rules.StaffHeight+ke/2}else ye=this.rules.WedgePlacementBelowY;ye-=this.rules.WedgeOpeningLength/2,q||(Ee=ye);let Pe=he.getBottomLineMaxInRange(ge,Se);if(Pe>ye&&(ye=Pe),ceEe&&(Ee=Pe),Ee+=this.rules.WedgeOpeningLength/2,Ee+=this.rules.WedgeVerticalMargin),ye+=this.rules.WedgeOpeningLength/2,ye+=this.rules.WedgeVerticalMargin}else if(fe===PlacementEnum.Above){if(U.ParentStaff.ParentInstrument.Staves.length===1)ye=this.rules.WedgePlacementAboveY;else{let Pe=0;ce>0&&(Pe=ce-1);const Ne=ae.StaffLines[Pe];ye=-(U.PositionAndShape.RelativePosition.y-Ne.PositionAndShape.RelativePosition.y-this.rules.StaffHeight)/2}ye+=this.rules.WedgeOpeningLength/2,q||(Ee=ye);let Me=he.getSkyLineMinInRange(ge,Se);if(Me1&&ce>0){const Pe=U.findClosestStaffEntry(ge),Ne=U.findClosestStaffEntry(Se);Pe&&Ne&&Pe.parentVerticalContainer}q||(Me=W.SkyBottomLineCalculator.getSkyLineMinInRange(ve,pe),Me-K/2?Y=-K/2:Y=J-R.PositionAndShape.BorderMarginBottom}else Y=J-R.PositionAndShape.BorderMarginBottom;R.PositionAndShape.RelativePosition=new PointF2D(F.x,Y)}else if(R.Placement===PlacementEnum.Below){const J=q.getBottomLineMaxInRange(U,W),Z=G.ParentStaff.ParentInstrument.Staves[G.ParentStaff.ParentInstrument.Staves.length-1];if(G.isPartOfMultiStaffInstrument()&&G.ParentStaff!==Z){const te=G.ParentMusicSystem.StaffLines[G.ParentMusicSystem.StaffLines.indexOf(G)+1].PositionAndShape.RelativePosition.y-G.PositionAndShape.RelativePosition.y-this.rules.StaffHeight,Q=R.PositionAndShape.BorderMarginBottom;J+QR.PositionAndShape.Size.width&&(te=R.PositionAndShape.Size.width-this.rules.MeasureRightMargin,K=te-J.PositionAndShape.MarginSize.width,F.x=K-J.PositionAndShape.BorderMarginLeft);let Q;const ie=R.SkyBottomLineCalculator;return U===PlacementEnum.Below?Q=ie.getBottomLineMaxInRange(K,te):Q=ie.getSkyLineMinInRange(K,te),J.PositionAndShape.RelativePosition=new PointF2D(F.x,Q),U===PlacementEnum.Below?ie.updateBottomLineInRange(K,te,J.PositionAndShape.BorderMarginBottom+Q):ie.updateSkyLineInRange(K,te,J.PositionAndShape.BorderMarginTop+Q),J}calculateTempoExpressionsForMultiTempoExpression(R,F,D,G){metronomeMarks={};const U=Fraction$1.plus(R.AbsoluteTimestamp,F.Timestamp),W=this.graphicalMusicSheet.MeasureList[D];let q=new PointF2D;if(F.ContinuousTempo||F.InstantaneousTempo){if(this.rules.MinMeasureToDrawIndex>0||!W[0])return;let Y=W[0].ParentStaffLine,J=W[0].PositionAndShape.RelativePosition.x,Z=0;for(let K=0;K0){Y=W[K].ParentStaffLine,J=W[K].PositionAndShape.RelativePosition.x,Z=K;break}if(q=this.getRelativePositionInStaffLineFromTimestamp(U,Z,Y,Y.isPartOfMultiStaffInstrument(),J),F.EntriesList.length>0&&F.EntriesList[0].Expression instanceof InstantaneousTempoExpression){const K=F.EntriesList[0].Expression;if(K.Placement=PlacementEnum.Above,Y.Measures[0].staffEntries.length>0&&Math.abs(q.x-Y.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x)===0&&Y.ParentMusicSystem===this.musicSystems[0]){const te=Y.Measures[0].FirstInstructionStaffEntry;if(te){const Q=te.GraphicalInstructions.last();q.x=Q.PositionAndShape.RelativePosition.x}this.rules.CompactMode&&(q.x=Y.PositionAndShape.RelativePosition.x+Y.Measures[0].PositionAndShape.RelativePosition.x)}}for(const K of F.EntriesList){let te=TextAlignmentEnum.CenterBottom;this.rules.CompactMode&&(te=TextAlignmentEnum.LeftBottom);const Q=this.calculateLabel(Y,q,K.label,F.getFontstyleOfFirstEntry(),K.Expression.Placement,this.rules.UnknownTextHeight,te);if(K.Expression instanceof InstantaneousTempoExpression){for(const se of Y.AbstractExpressions)se instanceof GraphicalInstantaneousTempoExpression&&(se.SourceExpression.Label,K.Expression.Label);new GraphicalInstantaneousTempoExpression(K.Expression,Q).ParentStaffLine||log$2.warn("Adding staffline didn't work"),K.Expression.Enum===TempoEnum.metronomeMark&&(metronomeMarks[D]=K.Expression)}else K.Expression instanceof ContinuousTempoExpression;if(G===R.TempoExpressions.length-1)for(const ie of Object.values(metronomeMarks))this.createMetronomeMark(ie,D)}}}createMetronomeMark(R,F){throw new Error(this.abstractNotImplementedErrorMessage)}graphicalMeasureCreatedCalculations(R){}clearSystemsAndMeasures(){for(let R=0,F=this.graphicalMusicSheet.MusicPages.length;R-1&&te.PositionAndShape.ChildElements.splice(Q,1),te.FirstInstructionStaffEntry=void 0,te.beginInstructionsWidth=0}if(te.LastInstructionStaffEntry){const Q=te.PositionAndShape.ChildElements.indexOf(te.LastInstructionStaffEntry.PositionAndShape);Q>-1&&te.PositionAndShape.ChildElements.splice(Q,1),te.LastInstructionStaffEntry=void 0,te.endInstructionsWidth=0}}J.Measures=[],J.PositionAndShape.ChildElements=[]}W.StaffLines.length=0,W.PositionAndShape.ChildElements=[]}D.MusicSystems=[],D.PositionAndShape.ChildElements=[]}this.graphicalMusicSheet.MusicPages=[]}handleVoiceEntry(R,F,D,G,U,W,q,Y,J,Z=void 0,K=void 0){R.StemDirectionXml!==StemDirectionType.Undefined&&this.rules.SetWantedStemDirectionByXml&&R.StemDirectionXml!==void 0?R.WantedStemDirection=R.StemDirectionXml:this.calculateStemDirectionFromVoices(R);const te=F.findOrCreateGraphicalVoiceEntry(R);te.octaveShiftValue=Y;const Q=F.tabStaffEntry;let ie;Q&&(ie=Q.findOrCreateGraphicalVoiceEntry(R));for(let se=0,ne=R.Notes.length;se-1)continue;let ae;if(R.IsGrace?ae=MusicSheetCalculator.symbolFactory.createGraceNote(re,te,U,this.rules,Y):(ae=MusicSheetCalculator.symbolFactory.createNote(re,te,U,Y,this.rules,void 0),MusicSheetCalculator.stafflineNoteCalculator.trackNote(ae)),re.Pitch&&this.checkNoteForAccidental(ae,D,U,Y),this.resetYPositionForLeadSheet(ae.PositionAndShape),F.addGraphicalNoteToListAtCorrectYPosition(te,ae),ae.PositionAndShape.calculateBoundingBox(),this.leadSheet||(re.NoteBeam!==void 0&&re.PrintObject&&this.handleBeam(ae,re.NoteBeam,q),re.NoteTuplet!==void 0&&re.PrintObject&&this.handleTuplet(ae,re.NoteTuplet,W)),ie){const ce=MusicSheetCalculator.symbolFactory.createNote(re,ie,U,Y,this.rules,void 0);Q.addGraphicalNoteToListAtCorrectYPosition(ie,ce),ce.PositionAndShape.calculateBoundingBox(),this.leadSheet||re.NoteTuplet&&this.handleTuplet(ce,re.NoteTuplet,W)}}return R.Articulations.length>0&&this.handleVoiceEntryArticulations(R.Articulations,R,F),R.TechnicalInstructions.length>0&&this.handleVoiceEntryTechnicalInstructions(R.TechnicalInstructions,R,F),R.LyricsEntries.size()>0&&this.handleVoiceEntryLyrics(R,F,G),R.OrnamentContainer&&this.handleVoiceEntryOrnaments(R.OrnamentContainer,R,F),Y}resetYPositionForLeadSheet(R){this.leadSheet&&(R.RelativePosition=new PointF2D(R.RelativePosition.x,0))}layoutVoiceEntries(R,F){if(R.PositionAndShape.RelativePosition=new PointF2D(0,0),!this.leadSheet)for(const D of R.graphicalVoiceEntries){const G=D.notes;if(G.length===0)continue;const U=G[0].sourceNote.ParentVoiceEntry,W=G[0].sourceNote.Pitch!==void 0;this.layoutVoiceEntry(U,G,R,W)}}maxInstrNameLabelLength(){var F;let R=0;for(const D of this.graphicalMusicSheet.ParentMusicSheet.Instruments)if(((F=D.NameLabel)==null?void 0:F.print)&&D.Voices.length>0&&D.Voices[0].Visible){let G=D.NameLabel;this.rules.RenderPartNames||(G=new Label("",G.textAlignment,G.font));const U=new GraphicalLabel(G,this.rules.InstrumentLabelTextHeight,TextAlignmentEnum.LeftCenter,this.rules);U.setLabelPositionAndShapeBorders(),R=Math.max(R,U.PositionAndShape.MarginSize.width)}return this.rules.RenderPartNames?R:0}calculateSheetLabelBoundingBoxes(){var G;const R=this.graphicalMusicSheet.ParentMusicSheet,F=this.rules.DefaultColorTitle;if(R.Title!==void 0&&this.rules.RenderTitle){const U=new GraphicalLabel(R.Title,this.rules.SheetTitleHeight,TextAlignmentEnum.CenterBottom,this.rules);U.Label.IsCreditLabel=!0,U.Label.colorDefault=F,this.graphicalMusicSheet.Title=U,U.setLabelPositionAndShapeBorders()}else this.rules.RenderTitle||(this.graphicalMusicSheet.Title=void 0);if(R.Subtitle!==void 0&&this.rules.RenderSubtitle){const U=new GraphicalLabel(R.Subtitle,this.rules.SheetSubtitleHeight,TextAlignmentEnum.CenterCenter,this.rules);U.Label.IsCreditLabel=!0,U.Label.colorDefault=F,this.graphicalMusicSheet.Subtitle=U,U.setLabelPositionAndShapeBorders()}else this.rules.RenderSubtitle||(this.graphicalMusicSheet.Subtitle=void 0);if(R.Composer!==void 0&&this.rules.RenderComposer){const U=new GraphicalLabel(R.Composer,this.rules.SheetComposerHeight,TextAlignmentEnum.RightCenter,this.rules);U.Label.IsCreditLabel=!0,U.Label.colorDefault=F,this.graphicalMusicSheet.Composer=U,U.setLabelPositionAndShapeBorders()}else this.rules.RenderComposer||(this.graphicalMusicSheet.Composer=void 0);if(R.Lyricist!==void 0&&this.rules.RenderLyricist){const U=new GraphicalLabel(R.Lyricist,this.rules.SheetAuthorHeight,TextAlignmentEnum.LeftCenter,this.rules);U.Label.IsCreditLabel=!0,U.Label.colorDefault=F,this.graphicalMusicSheet.Lyricist=U,U.setLabelPositionAndShapeBorders()}else this.rules.RenderLyricist||(this.graphicalMusicSheet.Lyricist=void 0);const D=(G=this.graphicalMusicSheet.musicSheet.sourceMeasures)==null?void 0:G[0];if(D&&D.FirstInstructionsStaffEntries.length>0){const U=D.FirstInstructionsStaffEntries[0];let W,q;for(let Y=0,J=U.Instructions.length;Y0&&Z.graphicalVoiceEntries[0].notes.length===1){const K=Z.graphicalVoiceEntries[0].notes[0];!K.sourceNote.Pitch&&new Fraction$1(1,2).lt(K.sourceNote.Length)&&this.layoutMeasureWithWholeRest(K,Z,J)}}}}}}optimizeRestNotePlacement(R,F){if(R.graphicalVoiceEntries.length===0)return;const D=R.graphicalVoiceEntries[0].notes;if(D.length===0)return;const G=D[0],U=G.sourceNote.isRest();if(R.graphicalVoiceEntries.length===2){let W=!1;const q=R.graphicalVoiceEntries[1].notes;q.length>0&&(W=q[0].sourceNote.isRest()),U&&W?this.calculateTwoRestNotesPlacementWithCollisionDetection(R):(U||W)&&this.calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(R)}else if(U&&R!==F.staffEntries[0]&&R!==F.staffEntries[F.staffEntries.length-1]){const W=F.staffEntries.indexOf(R),q=F.staffEntries[W-1],Y=F.staffEntries[W+1];if(q.graphicalVoiceEntries.length===1){const J=q.graphicalVoiceEntries[0].notes[0];if(J.sourceNote.NoteBeam!==void 0&&Y.graphicalVoiceEntries.length===1){const Z=Y.graphicalVoiceEntries[0].notes[0];Z.sourceNote.NoteBeam!==void 0&&J.sourceNote.NoteBeam===Z.sourceNote.NoteBeam&&(this.calculateRestNotePlacementWithinGraphicalBeam(R,G,J,Y,Z),R.PositionAndShape.calculateBoundingBox())}}}}getRelativePositionInStaffLineFromTimestamp(R,F,D,G,U=0){let W=new PointF2D,q,Y;const J=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,Z=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(R),K=Math.min(Math.floor(Z),J-1),te=Math.min(Math.ceil(Z),J-1);if(K<0||F<0)return W;if(q=this.getFirstLeftNotNullStaffEntryFromContainer(K,F,G),Y=this.getFirstRightNotNullStaffEntryFromContainer(te,F,G),q&&Y){let Q=q.parentMeasure.PositionAndShape.RelativePosition.x;U>0&&(Q=U);let ie=q.PositionAndShape.RelativePosition.x+Q,se=Y.PositionAndShape.RelativePosition.x+Y.parentMeasure.PositionAndShape.RelativePosition.x;U>0&&(se=Y.PositionAndShape.RelativePosition.x+Q);let ne=0;if(q!==Y){const re=q.getAbsoluteTimestamp(),ae=Y.getAbsoluteTimestamp();ne=Fraction$1.minus(R,re).RealValue/Fraction$1.minus(ae,re).RealValue}q.parentMeasure.ParentStaffLine!==Y.parentMeasure.ParentStaffLine&&(q.parentMeasure.ParentStaffLine===D?se=D.PositionAndShape.Size.width:ie=D.PositionAndShape.RelativePosition.x),W=new PointF2D(ie+(se-ie)*ne,0)}return W}getRelativeXPositionFromTimestamp(R){const F=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length,D=this.graphicalMusicSheet.GetInterpolatedIndexInVerticalContainers(R),G=Math.max(0,Math.min(Math.round(D),F-1)),U=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[G].getFirstNonNullStaffEntry();return U.PositionAndShape.RelativePosition.x+U.parentMeasure.PositionAndShape.RelativePosition.x}calculatePageLabels(R){var W;this.rules.RenderSingleHorizontalStaffline&&(R.PositionAndShape.BorderRight=R.PositionAndShape.Size.width,R.PositionAndShape.calculateBoundingBox(),this.graphicalMusicSheet.ParentMusicSheet.pageWidth=R.PositionAndShape.Size.width);let F=10;if(R.MusicSystems.length>0){const q=R.MusicSystems[0];F=q.PositionAndShape.RelativePosition.y+q.PositionAndShape.BorderTop}if(this.graphicalMusicSheet.Title){const q=this.graphicalMusicSheet.Title;q.PositionAndShape.Parent=R.PositionAndShape;const Y=new PointF2D;Y.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,Y.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight,q.PositionAndShape.RelativePosition=Y,R.Labels.push(q)}if(this.graphicalMusicSheet.Subtitle){const q=this.graphicalMusicSheet.Subtitle;q.PositionAndShape.Parent=R.PositionAndShape;const Y=new PointF2D;Y.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth/2,Y.y=this.rules.TitleTopDistance+this.rules.SheetTitleHeight+this.rules.SheetMinimumDistanceBetweenTitleAndSubtitle,q.PositionAndShape.RelativePosition=Y,R.Labels.push(q)}const D=this.graphicalMusicSheet.Composer;let G;if(D){D.PositionAndShape.Parent=R.PositionAndShape,D.setLabelPositionAndShapeBorders();const q=new PointF2D;q.x=this.graphicalMusicSheet.ParentMusicSheet.pageWidth-this.rules.PageRightMargin,q.y=F,q.y-=this.rules.SystemComposerDistance;const Y=(W=D.TextLines)==null?void 0:W.length;Y>1&&(q.y-=D.PositionAndShape.BorderBottom*(Y-1)/Y),G=q.y,D.PositionAndShape.RelativePosition=q,R.Labels.push(D)}const U=this.graphicalMusicSheet.Lyricist;if(U){U.PositionAndShape.Parent=R.PositionAndShape,U.setLabelPositionAndShapeBorders();const q=new PointF2D;q.x=this.rules.PageLeftMargin,q.y=F,q.y+=U.PositionAndShape.BorderBottom,q.y=Math.min(q.y,G!=null?G:Number.MAX_SAFE_INTEGER),U.PositionAndShape.RelativePosition=q,R.Labels.push(U)}}createGraphicalTies(){for(let R=0;R=0&&this.staffEntriesWithGraphicalTies.push(U)}U=q}}setTieDirections(R){if(!R)return;const F=R.ties;if(F.length>1){let D;for(const G of F){const U=G.Notes[0];(!D||U.Pitch.getHalfTone()>D.Pitch.getHalfTone())&&(D=U)}for(const G of F)G.TieDirection===PlacementEnum.NotYetDefined&&(G.Notes[0]===D?G.TieDirection=PlacementEnum.Above:G.TieDirection=PlacementEnum.Below)}}createAccidentalCalculators(){const R=[],F=this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();if(F)for(let D=0;D1)return;K=MusicSheetCalculator.symbolFactory.createGraphicalMeasure(R,Z)}if(K.hasError=R.getErrorInMeasure(Y),R.FirstInstructionsStaffEntries[Y])for(let ce=0,he=R.FirstInstructionsStaffEntries[Y].Instructions.length;ce0){const ge=he.Instructions[0];MusicSheetCalculator.symbolFactory.createInStaffClef(fe,ge)}this.rules.RenderChordSymbols&&((ae=he.ChordContainers)==null?void 0:ae.length)>0&&(he.ParentStaff.ParentInstrument.HasChordSymbols=!0,MusicSheetCalculator.symbolFactory.createChordSymbols(he,fe,G.ActiveKeyInstruction,this.graphicalMusicSheet.ParentMusicSheet.Transpose))}}if(G.doCalculationsAtEndOfMeasure(),R.LastInstructionsStaffEntries[Y]){const ce=R.LastInstructionsStaffEntries[Y];for(let he=0,fe=ce.Instructions.length;he=1&&K.staffEntries.length===0){const ce=new SourceStaffEntry(new VerticalSourceStaffEntryContainer(K.parentSourceMeasure,K.parentSourceMeasure.AbsoluteTimestamp,K.parentSourceMeasure.CompleteNumberOfStaves),Z),he=new VoiceEntry(new Fraction$1(0,1),Z.Voices[0],ce),fe=new Note$1(he,ce,Fraction$1.createFromFraction(R.Duration),void 0,R);fe.PrintObject=this.rules.FillEmptyMeasuresWithWholeRest===FillEmptyMeasuresWithWholeRests.YesVisible,he.addNote(fe);const be=MusicSheetCalculator.symbolFactory.createStaffEntry(ce,K);K.addGraphicalStaffEntry(be),be.relInMeasureTimestamp=he.Timestamp;const ue=MusicSheetCalculator.symbolFactory.createVoiceEntry(he,be);be.graphicalVoiceEntries.push(ue);const ge=MusicSheetCalculator.symbolFactory.createNote(fe,ue,new ClefInstruction,OctaveEnum.NONE,void 0);MusicSheetCalculator.stafflineNoteCalculator.trackNote(ge),ue.notes.push(ge)}K.hasOnlyRests=!0;for(const ce of K.staffEntries)if(K.hasOnlyRests=ce.hasOnlyRests(),!K.hasOnlyRests)break;return K}checkNoteForAccidental(R,F,D,G){let U=R.sourceNote.Pitch;const W=R.parentVoiceEntry.parentStaffEntry.parentMeasure.getTransposedHalftones();W!==0&&R.sourceNote.ParentStaffEntry.ParentStaff.ParentInstrument.MidiInstrumentId!==MidiInstrument.Percussion&&(U=R.Transpose(F.ActiveKeyInstruction,D,W,G),R.sourceNote.TransposedPitch=U),R.sourceNote.halfTone=U.getHalfTone(),F.checkAccidental(R,U)}handleStaffEntries(R){for(let F=0,D=this.graphicalMusicSheet.MeasureList.length;F0&&Y.graphicalVoiceEntries[0].notes.length>0&&(this.layoutVoiceEntries(Y,U),this.layoutStaffEntry(Y));this.graphicalMeasureCreatedCalculations(q)}}}}calculateSkyBottomLines(){for(const R of this.musicSystems)for(const F of R.StaffLines)F.SkyBottomLineCalculator.calculateLines()}calculateExpressionAlignements(){}calculateStaffEntryArticulationMarks(){for(let R=0,F=this.musicSystems.length;R0&&this.layoutArticulationMarks(se.Articulations,se,te)}}}}}}calculateOrnaments(){for(let R=0,F=this.musicSystems.length;R0&&G.LyricVersesNumbers.sort()}for(let F=0,D=this.musicSystems.length;F=0&&(G=F.GraphicalLyricsEntries[D+1]),!G)return;const U=R.StaffEntryParent.parentMeasure.ParentStaffLine,W=G.StaffEntryParent.parentMeasure.ParentStaffLine,q=R.StaffEntryParent,Y=G.StaffEntryParent;if(R.StaffEntryParent.parentMeasure.ParentStaffLine===G.StaffEntryParent.parentMeasure.ParentStaffLine){const J=q.parentMeasure.PositionAndShape.RelativePosition.x+q.PositionAndShape.RelativePosition.x+R.GraphicalLabel.PositionAndShape.RelativePosition.x+R.GraphicalLabel.PositionAndShape.BorderMarginRight,Z=Y.parentMeasure.PositionAndShape.RelativePosition.x+Y.PositionAndShape.RelativePosition.x+R.GraphicalLabel.PositionAndShape.RelativePosition.x+G.GraphicalLabel.PositionAndShape.BorderMarginLeft,K=R.GraphicalLabel.PositionAndShape.RelativePosition.y;let te=1;Z-J>this.rules.MinimumDistanceBetweenDashes*3&&(te=Math.floor((Z-J)/this.rules.MinimumDistanceBetweenDashes)-1),te===1?this.calculateSingleDashForLyricWord(U,J,Z,K):this.calculateDashes(U,J,Z,K)}else{const J=q.parentMeasure.PositionAndShape.RelativePosition.x+q.PositionAndShape.RelativePosition.x+R.GraphicalLabel.PositionAndShape.BorderMarginRight,Z=U.Measures[U.Measures.length-1],K=Z.PositionAndShape.RelativePosition.x+Z.PositionAndShape.Size.width;let te=R.GraphicalLabel.PositionAndShape.RelativePosition.y;if(this.calculateDashes(U,J,K,te),W&&W.Measures[0]&&Y.parentMeasure.ParentStaffLine&&!(Y===Y.parentMeasure.staffEntries[0]&&Y.parentMeasure===Y.parentMeasure.ParentStaffLine.Measures[0])){const Q=W.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,ie=Y.parentMeasure.PositionAndShape.RelativePosition.x+Y.PositionAndShape.RelativePosition.x+G.GraphicalLabel.PositionAndShape.BorderMarginLeft;te=G.GraphicalLabel.PositionAndShape.RelativePosition.y,this.calculateDashes(W,Q,ie,te)}}}calculateDashes(R,F,D,G){let U=D-F;if(UF;)U=this.calculateRightAndLeftDashesForLyricWord(R,F,D,G),F+=q,D-=q,Y++;U>q*2&&this.calculateSingleDashForLyricWord(R,F,D,G)}}calculateSingleDashForLyricWord(R,F,D,G){const U=new Label("-"),W=new GraphicalLabel(U,this.rules.LyricsHeight,TextAlignmentEnum.CenterBottom,this.rules);W.setLabelPositionAndShapeBorders(),R.LyricsDashes.push(W),this.staffLinesWithLyricWords.indexOf(R)===-1&&this.staffLinesWithLyricWords.push(R),W.PositionAndShape.Parent=R.PositionAndShape;const q=new PointF2D(F+(D-F)/2,G);W.PositionAndShape.RelativePosition=q}calculateLyricExtend(R){let F=R.GraphicalLabel.PositionAndShape.RelativePosition.y;const D=R.StaffEntryParent,G=D.parentMeasure.ParentStaffLine;let U,W;const q=D.parentMeasure.ParentStaff.idInMusicSheet;for(let Y=D.parentVerticalContainer.Index+1;Y0)break;U=J,W=U.parentMeasure.ParentStaffLine,W||(W=D.parentMeasure.ParentStaffLine)}}if(!(!U||!W))if(G===W&&U.parentMeasure.ParentStaffLine){const Y=D.parentMeasure.PositionAndShape.RelativePosition.x+D.PositionAndShape.RelativePosition.x+R.GraphicalLabel.PositionAndShape.BorderMarginRight,J=U.parentMeasure.PositionAndShape.RelativePosition.x+U.PositionAndShape.RelativePosition.x+U.PositionAndShape.BorderMarginRight;F-=R.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(G,Y,J,F)}else{const Y=G.Measures[G.Measures.length-1].PositionAndShape,J=D.parentMeasure.PositionAndShape.RelativePosition.x+D.PositionAndShape.RelativePosition.x+R.GraphicalLabel.PositionAndShape.BorderMarginRight,Z=Y.RelativePosition.x+Y.Size.width;if(F-=R.GraphicalLabel.PositionAndShape.Size.height/4,this.calculateSingleLyricWordWithUnderscore(G,J,Z,F),!U)return;if(U.parentMeasure.ParentStaffLine&&U.parentMeasure.staffEntries&&!(U===U.parentMeasure.staffEntries[0]&&U.parentMeasure===U.parentMeasure.ParentStaffLine.Measures[0])){const K=W.Measures[0].staffEntries[0].PositionAndShape.RelativePosition.x,te=U.parentMeasure.PositionAndShape.RelativePosition.x+U.PositionAndShape.RelativePosition.x+U.PositionAndShape.BorderMarginRight;this.calculateSingleLyricWordWithUnderscore(W,K,te,F)}}}calculateSingleLyricWordWithUnderscore(R,F,D,G){const U=new PointF2D(F,G),W=new PointF2D(D,G),q=new GraphicalLine(U,W,this.rules.LyricUnderscoreLineWidth);R.LyricLines.push(q),this.staffLinesWithLyricWords.indexOf(R)===-1&&this.staffLinesWithLyricWords.push(R)}calculateRightAndLeftDashesForLyricWord(R,F,D,G){const U=new Label("-"),W=new GraphicalLabel(U,this.rules.LyricsHeight,TextAlignmentEnum.CenterBottom,this.rules);W.setLabelPositionAndShapeBorders(),R.LyricsDashes.push(W),this.staffLinesWithLyricWords.indexOf(R)===-1&&this.staffLinesWithLyricWords.push(R),W.PositionAndShape.Parent=R.PositionAndShape;const q=new PointF2D(F,G);W.PositionAndShape.RelativePosition=q;const Y=new Label("-"),J=new GraphicalLabel(Y,this.rules.LyricsHeight,TextAlignmentEnum.CenterBottom,this.rules);J.setLabelPositionAndShapeBorders(),R.LyricsDashes.push(J),J.PositionAndShape.Parent=R.PositionAndShape;const Z=new PointF2D(D,G);return J.PositionAndShape.RelativePosition=Z,J.PositionAndShape.RelativePosition.x-W.PositionAndShape.RelativePosition.x}calculateDynamicExpressions(){const R=Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length-1,this.rules.MaxMeasureToDrawIndex),F=Math.min(this.rules.MinMeasureToDrawIndex,this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length);for(let D=F;D<=R;D++){const G=this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[D];this.dynamicExpressionMap.clear();for(let U=0;U=0;W--)if((U=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[W])!=null&&U.StaffEntries[F])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[W].StaffEntries[F]}getFirstRightNotNullStaffEntryFromContainer(R,F,D){var G,U;if((G=this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[R])!=null&&G.StaffEntries[F])return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[R].StaffEntries[F];for(let W=R+1;W0||F.StaffLinkedExpressions[D][G].UnknownList.length>0)&&this.calculateMoodAndUnknownExpression(F.StaffLinkedExpressions[D][G],R,D)}}calculateStemDirectionFromVoices(R){if(R.ParentSourceStaffEntry.Link!==void 0)if(R===R.ParentSourceStaffEntry.VoiceEntries[0]){R.WantedStemDirection=StemDirectionType.Up;return}else{R.WantedStemDirection=StemDirectionType.Down;return}else R.ParentVoice instanceof LinkedVoice?R.WantedStemDirection=StemDirectionType.Down:R.ParentSourceStaffEntry.VoiceEntries.length>1&&(R.WantedStemDirection=StemDirectionType.Up)}setBeamNotesWantedStemDirections(R){if(!(R.Notes.length>0))return;const F=R.Notes[0].NoteBeam;if(F){for(const D of F.Notes)if(D.ParentVoiceEntry.WantedStemDirection!==StemDirectionType.Undefined&&D.ParentVoiceEntry.ParentSourceStaffEntry.ParentStaff.Id===R.ParentSourceStaffEntry.ParentStaff.Id){R.WantedStemDirection=D.ParentVoiceEntry.WantedStemDirection;break}}}}class ChordSymbolContainer{constructor(R,F,D,G,U){this.rootPitch=R,this.chordKind=F,this.bassPitch=D,this.degrees=G,this.rules=U}get RootPitch(){return this.rootPitch}get ChordKind(){return this.chordKind}get BassPitch(){return this.bassPitch}get ChordDegrees(){return this.degrees}static calculateChordText(R,F,D){let G=R.RootPitch;if(MusicSheetCalculator.transposeCalculator&&(G=MusicSheetCalculator.transposeCalculator.transposePitch(R.RootPitch,D,F)),R.ChordKind===ChordSymbolEnum.none)return R.getTextFromChordKindEnum(R.ChordKind);let U=Pitch.getNoteEnumString(G.FundamentalNote);G.Accidental!==AccidentalEnum.NONE&&(U+=this.getTextForAccidental(G.Accidental));const W={adds:[],alts:[],subs:[]};for(const Z of R.ChordDegrees)if(Z){let K="";switch(Z.alteration!==AccidentalEnum.NONE&&(K+=this.getTextForAccidental(Z.alteration)),K+=Z.value,Z.text){case ChordDegreeText.add:W.adds.push(K);break;case ChordDegreeText.alter:W.alts.push(K);break;case ChordDegreeText.subtract:W.subs.push(K);break}}let q=R.getTextFromChordKindEnum(R.ChordKind);const Y=["adds","alts","subs"],J=R.rules.CustomChords;for(const Z of J){if(Z.chordKind!==R.chordKind)continue;let K=!0;for(const te of Y){for(const Q of Z.degrees[te]||[])if(W[te].indexOf(Q)<0){K=!1;break}if(!K)break}if(K){for(const te of Y)for(const Q of Z.degrees[te]||[])W[te].splice(W[te].indexOf(Q),1);q=Z.alternateName}}if(U+=q,W.adds.length>0&&(U+="("+W.adds.join(",")+")"),W.alts.length>0&&(U+="(alt "+W.alts.join(",")+")"),W.subs.length>0&&(U+="(omit "+W.subs.join(",")+")"),R.BassPitch){let Z=R.BassPitch;MusicSheetCalculator.transposeCalculator&&(Z=MusicSheetCalculator.transposeCalculator.transposePitch(R.BassPitch,D,F)),U+="/",U+=Pitch.getNoteEnumString(Z.FundamentalNote),U+=this.getTextForAccidental(Z.Accidental)}return U}static getTextForAccidental(R){let F="";switch(R){case AccidentalEnum.DOUBLEFLAT:F+="bb";break;case AccidentalEnum.FLAT:F+="b";break;case AccidentalEnum.SHARP:F+="#";break;case AccidentalEnum.DOUBLESHARP:F+="x";break}return F}getTextFromChordKindEnum(R){var F;return(F=this.rules.ChordSymbolLabelTexts.getValue(R))!=null?F:""}}class Degree{constructor(R,F,D){this.value=R,this.alteration=F,this.text=D}}class CustomChord{constructor(R,F,D){this.alternateName=R,this.chordKind=F,this.degrees=D}static createCustomChord(R,F,D){return new CustomChord(R,F,D)}static renameCustomChord(R,F,D){for(const G of D)G.alternateName===R&&(G.alternateName=F)}}var ChordDegreeText=(B=>(B[B.add=0]="add",B[B.alter=1]="alter",B[B.subtract=2]="subtract",B))(ChordDegreeText||{}),ChordSymbolEnum=(B=>(B[B.major=0]="major",B[B.minor=1]="minor",B[B.augmented=2]="augmented",B[B.diminished=3]="diminished",B[B.dominant=4]="dominant",B[B.majorseventh=5]="majorseventh",B[B.minorseventh=6]="minorseventh",B[B.diminishedseventh=7]="diminishedseventh",B[B.augmentedseventh=8]="augmentedseventh",B[B.halfdiminished=9]="halfdiminished",B[B.majorminor=10]="majorminor",B[B.majorsixth=11]="majorsixth",B[B.minorsixth=12]="minorsixth",B[B.dominantninth=13]="dominantninth",B[B.majorninth=14]="majorninth",B[B.minorninth=15]="minorninth",B[B.dominant11th=16]="dominant11th",B[B.major11th=17]="major11th",B[B.minor11th=18]="minor11th",B[B.dominant13th=19]="dominant13th",B[B.major13th=20]="major13th",B[B.minor13th=21]="minor13th",B[B.suspendedsecond=22]="suspendedsecond",B[B.suspendedfourth=23]="suspendedfourth",B[B.Neapolitan=24]="Neapolitan",B[B.Italian=25]="Italian",B[B.French=26]="French",B[B.German=27]="German",B[B.pedal=28]="pedal",B[B.power=29]="power",B[B.Tristan=30]="Tristan",B[B.none=31]="none",B))(ChordSymbolEnum||{});class GraphicalNote extends GraphicalObject{constructor(R,F,D,G=void 0){super(),this.DrawnAccidental=AccidentalEnum.NONE,this.lineShift=0,this.sourceNote=R,this.parentVoiceEntry=F,this.PositionAndShape=new BoundingBox$1(this,F.PositionAndShape),G?this.graphicalNoteLength=G:this.graphicalNoteLength=R.Length,this.numberOfDots=this.calculateNumberOfNeededDots(this.graphicalNoteLength),this.rules=D,this.rules.addGraphicalNoteToNoteMap(R,this)}Transpose(R,F,D,G){let U=this.sourceNote.Pitch;return MusicSheetCalculator.transposeCalculator&&(U=MusicSheetCalculator.transposeCalculator.transposePitch(this.sourceNote.Pitch,R,D)),U}calculateNumberOfNeededDots(R){return!this.sourceNote||!this.sourceNote.NoteTuplet?R.calculateNumberOfNeededDots():0}get ParentMusicPage(){return this.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentMusicSystem.Parent}static FromNote(R,F){return F.NoteToGraphicalNoteMap.getValue(R.NoteToGraphicalNoteObjectId)}}const _EngravingRules=class{constructor(){this.DYSlursStartingAtSameStaffEntryYOffset=0,this.DYMinNoteWidth=0,this.DYWorkId=0,this.DYWorkSpecial=!1,this.DYContainerId="osmdCanvasPage",this.DYSVGContainerId="osmdSvgPage",this.DYMusicScoreType="staff",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.PlayAlreadyStartedNotesFromCursorPosition=!1,this.PlaybackSkipNotesSafetyInterval=.02,this.UseDefaultVoiceInteractionListener=!0,this.loadDefaultValues()}loadDefaultValues(){this.SamplingUnit=_EngravingRules.unit*3,this.MpatMode=!0,this.SheetTitleHeight=4,this.SheetSubtitleHeight=2,this.SheetMinimumDistanceBetweenTitleAndSubtitle=1,this.SheetComposerHeight=2,this.SheetAuthorHeight=2,this.CompactMode=!1,this.PagePlacementEnum=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=_EngravingRules.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.AutoBeamTabs=!1,this.BeamWidth=_EngravingRules.unit/2,this.BeamSpaceWidth=_EngravingRules.unit/3,this.BeamForwardLength=1.25*_EngravingRules.unit,this.FlatBeams=!1,this.FlatBeamOffset=20,this.FlatBeamOffsetPerBeam=10,this.ClefLeftMargin=.5,this.ClefRightMargin=.75,this.PercussionOneLineCutoff=3,this.PercussionForceVoicesOneLineCutoff=1,this.PercussionUseXMLDisplayStep=!0,this.PercussionXMLDisplayStepNoteValueShift=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.WedgeEndDistanceBetweenTimestampsFactor=1.75,this.DistanceBetweenAdjacentDynamics=.75,this.TempoChangeMeasureValidity=4,this.TempoContinousFactor=.7,this.StaccatoScalingFactor=.8,this.BetweenDotsDistance=.8,this.OrnamentAccidentalScalingFactor=.65,this.ChordSymbolTextHeight=2,this.ChordSymbolTextAlignment=TextAlignmentEnum.LeftBottom,this.ChordSymbolRelativeXOffset=-1,this.ChordSymbolXSpacing=1,this.ChordOverlapAllowedIntoNextMeasure=0,this.ChordSymbolYOffset=.1,this.ChordSymbolYPadding=0,this.ChordSymbolYAlignment=!0,this.ChordSymbolYAlignmentScope="staffline",this.ChordSymbolLabelTexts=new 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*_EngravingRules.unit,this.MeasureNumberLabelOffset=2,this.MeasureNumberLabelXOffset=-.5,this.TupletsRatioed=!1,this.TupletsBracketed=!1,this.TripletsBracketed=!1,this.TupletNumberLabelHeight=1.5*_EngravingRules.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.SlurMaximumYControlPointDistance=void 0,this.RepetitionEndingLabelHeight=2,this.RepetitionEndingLabelXOffset=.5,this.RepetitionEndingLabelYOffset=.3,this.RepetitionEndingLineYLowerOffset=.5,this.RepetitionEndingLineYUpperOffset=.3,this.VoltaOffset=2.5,this.LyricsAlignmentStandard=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=_EngravingRules.unit/2,this.SystemRepetitionEndingLineWidth=.12,this.SystemDotWidth=_EngravingRules.unit/2,this.DistanceBetweenVerticalSystemLines=.35,this.DistanceBetweenDotAndLine=.7,this.RepeatEndStartPadding=2,this.OctaveShiftLineWidth=.12,this.OctaveShiftVerticalLineLength=_EngravingRules.unit,this.GraceLineWidth=this.StaffLineWidth*this.GraceNoteScalingFactor,this.MultipleRestMeasureDefaultWidth=4,this.MinimumCrossedBeamDifferenceMargin=1e-4,this.SheetMaximumWidth=32767,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.StaggerSameWholeNotes=!0,this.AlignRests=AlignRestOption.Never,this.RestCollisionYPadding=0,this.FillEmptyMeasuresWithWholeRest=FillEmptyMeasuresWithWholeRests.No,this.ArpeggiosGoAcrossVoices=!1,this.RenderArpeggios=!0,this.RenderSlurs=!0,this.ColoringMode=ColoringModes.XML,this.ColoringEnabled=!0,this.ColorStemsLikeNoteheads=!1,this.ColorBeams=!0,this.ColorFlags=!0,this.applyDefaultColorMusic("#000000"),this.DefaultColorCursor="#33e02f",this.DefaultFontFamily="Times New Roman",this.DefaultFontStyle=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.RenderClefsAtBeginningOfStaffline=!0,this.RenderKeySignatures=!0,this.RenderTimeSignatures=!0,this.ArticulationPlacementFromXML=!0,this.FingeringPosition=PlacementEnum.AboveOrBelow,this.FingeringPositionFromXML=!0,this.FingeringPositionGrace=PlacementEnum.Left,this.FingeringInsideStafflines=!1,this.FingeringLabelFontHeight=1.7,this.FingeringOffsetX=0,this.FingeringOffsetY=0,this.FingeringPaddingY=-.2,this.FingeringTextSize=1.5,this.RenderStringNumbersClassical=!0,this.StringNumberOffsetY=0,this.NewSystemAtXMLNewSystemAttribute=!1,this.NewPageAtXMLNewPageAttribute=!1,this.RestoreCursorAfterRerender=!0,this.StretchLastSystemLine=!1,_EngravingRules.FixStafflineBoundingBox=!1,this.PageFormat=PageFormat.UndefinedPageFormat,this.PageBackgroundColor=void 0,this.PerformanceMode=!1,this.RenderSingleHorizontalStaffline=!1,this.SpacingBetweenTextLines=0,this.NoteToGraphicalNoteMap=new Dictionary,this.NoteToGraphicalNoteMapObjectCount=0;try{this.MaxInstructionsConstValue=this.ClefLeftMargin+this.ClefRightMargin+this.KeyRightMargin+this.RhythmRightMargin+11}catch(B){log$2.info("EngravingRules()",B)}this.MpatMode&&(this.NewPartAndSystemAfterFinalBarline=!0)}applyDefaultColorMusic(B){this.DefaultColorMusic=B,this.DefaultColorNotehead=this.DefaultColorMusic,this.DefaultColorRest=this.DefaultColorNotehead,this.DefaultColorStem=this.DefaultColorNotehead,this.DefaultColorLabel=this.DefaultColorNotehead,this.DefaultColorTitle=this.DefaultColorNotehead,this.LedgerLineColorDefault=this.DefaultColorNotehead}addGraphicalNoteToNoteMap(B,R){B.NoteToGraphicalNoteObjectId=this.NoteToGraphicalNoteMapObjectCount,this.NoteToGraphicalNoteMap.setValue(B.NoteToGraphicalNoteObjectId,R),this.NoteToGraphicalNoteMapObjectCount++}GNote(B){return GraphicalNote.FromNote(B,this)}clearMusicSheetObjects(){this.NoteToGraphicalNoteMap=new Dictionary,this.NoteToGraphicalNoteMapObjectCount=0}setChordSymbolLabelText(B,R){this.ChordSymbolLabelTexts.setValue(B,R)}resetChordSymbolLabelTexts(B){return B.setValue(ChordSymbolEnum.minor,"m"),B.setValue(ChordSymbolEnum.augmented,"aug"),B.setValue(ChordSymbolEnum.diminished,"dim"),B.setValue(ChordSymbolEnum.dominant,"7"),B.setValue(ChordSymbolEnum.majorseventh,"maj7"),B.setValue(ChordSymbolEnum.minorseventh,"m7"),B.setValue(ChordSymbolEnum.diminishedseventh,"dim7"),B.setValue(ChordSymbolEnum.augmentedseventh,"aug7"),B.setValue(ChordSymbolEnum.halfdiminished,"m7b5"),B.setValue(ChordSymbolEnum.majorminor,"m(maj7)"),B.setValue(ChordSymbolEnum.majorsixth,"maj6"),B.setValue(ChordSymbolEnum.minorsixth,"m6"),B.setValue(ChordSymbolEnum.dominantninth,"9"),B.setValue(ChordSymbolEnum.majorninth,"maj9"),B.setValue(ChordSymbolEnum.minorninth,"m9"),B.setValue(ChordSymbolEnum.dominant11th,"11"),B.setValue(ChordSymbolEnum.major11th,"maj11"),B.setValue(ChordSymbolEnum.minor11th,"m11"),B.setValue(ChordSymbolEnum.dominant13th,"13"),B.setValue(ChordSymbolEnum.major13th,"maj13"),B.setValue(ChordSymbolEnum.minor13th,"m13"),B.setValue(ChordSymbolEnum.suspendedsecond,"sus2"),B.setValue(ChordSymbolEnum.suspendedfourth,"sus4"),B.setValue(ChordSymbolEnum.power,"5"),B.setValue(ChordSymbolEnum.none,"N.C."),B}addChordName(B,R,F,D,G){if(ChordSymbolEnum[R]!==void 0){const U={adds:F,alts:D,subs:G};this.CustomChords.push(CustomChord.createCustomChord(B,ChordSymbolEnum[R],U))}}renameChord(B,R){CustomChord.renameCustomChord(B,R,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 B=0;B(B[B.XML=0]="XML",B[B.AutoColoring=1]="AutoColoring",B[B.CustomColorSet=2]="CustomColorSet",B))(ColoringModes||{}),DrawingParametersEnum=(B=>(B.allon="allon",B.compact="compact",B.compacttight="compacttight",B.default="default",B.leadsheet="leadsheet",B.preview="preview",B.thumbnail="thumbnail",B))(DrawingParametersEnum||{});class DrawingParameters{constructor(R="default"){this.rules=new EngravingRules,this.drawCursors=!0,this.drawTitle=!0,this.drawSubtitle=!0,this.drawLyricist=!0,this.drawComposer=!0,this.drawCredits=!0,this.drawPartNames=!0,this.fingeringPosition=PlacementEnum.Left,this.drawHiddenNotes=!1,this.DrawingParametersEnum=R}set DrawingParametersEnum(R){switch(this.drawingParametersEnum=R,R){case"allon":this.setForAllOn();break;case"thumbnail":this.setForThumbnail();break;case"leadsheet":this.setForLeadsheet();break;case"compact":this.setForCompactMode();break;case"compacttight":this.setForCompactTightMode();break;case"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.drawAnnotations=!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.drawAnnotations=!0,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.drawAnnotations=!0,this.drawComments=!0,this.drawMarkedAreas=!0}get DrawCredits(){return this.drawCredits}set DrawCredits(R){this.drawCredits=R,this.DrawComposer=R,this.DrawTitle=R,this.DrawSubtitle=R,this.DrawLyricist=R}get DrawTitle(){return this.drawTitle}set DrawTitle(R){this.drawTitle=R,this.rules.RenderTitle=R,R||(this.DrawSubtitle=!1)}get DrawSubtitle(){return this.drawSubtitle}set DrawSubtitle(R){this.drawSubtitle=R,this.rules.RenderSubtitle=R,R&&(this.DrawTitle=!0)}get DrawComposer(){return this.drawComposer}set DrawComposer(R){this.drawComposer=R,this.rules.RenderComposer=R}get DrawLyricist(){return this.drawLyricist}set DrawLyricist(R){this.drawLyricist=R,this.rules.RenderLyricist=R}get DrawPartNames(){return this.drawPartNames}set DrawPartNames(R){this.drawPartNames=R,this.rules.RenderPartNames=R,this.rules.RenderPartNames||(this.rules.RenderPartAbbreviations=!1)}get FingeringPosition(){return this.fingeringPosition}set FingeringPosition(R){this.fingeringPosition=R,this.rules.FingeringPosition=R}get Rules(){return this.rules}set Rules(R){this.rules=R}}var AlignRestOption=(B=>(B[B.Never=0]="Never",B[B.Always=1]="Always",B[B.Auto=2]="Auto",B))(AlignRestOption||{}),FillEmptyMeasuresWithWholeRests=(B=>(B[B.No=0]="No",B[B.YesVisible=1]="YesVisible",B[B.YesInvisible=2]="YesInvisible",B))(FillEmptyMeasuresWithWholeRests||{}),BackendType=(B=>(B[B.SVG=0]="SVG",B[B.Canvas=1]="Canvas",B))(BackendType||{});class OSMDOptions{static OSMDOptionsStandard(){return{autoResize:!0,backend:"svg",drawingParameters:DrawingParametersEnum.default}}static BackendTypeFromString(R){return R&&R.toLowerCase()==="canvas"?1:0}}class IXmlElement{constructor(R){if(this.hasAttributes=!1,!R)throw new Error("IXmlElement: expected Element, got undefined");this.elem=R,this.name=R.nodeName.toLowerCase(),R.hasAttributes()&&(this.hasAttributes=!0,this.firstAttribute=R.attributes[0]),this.hasElements=R.hasChildNodes(),R.childNodes.length===1&&R.childNodes[0].nodeType===Node.TEXT_NODE?this.value=R.childNodes[0].nodeValue:this.value=""}attribute(R){return this.elem.attributes.getNamedItem(R)}attributes(){if(!this.attrs){const R=this.elem.attributes,F=[];for(let D=0;D0?this.Voices[0].Visible:!1}set Visible(R){for(let F=0,D=this.Voices.length;F-1&&this.parent.MusicSystems.splice(F,1)}this.parent=R,this.boundingBox.Parent=R.PositionAndShape}get NextSystem(){const R=this.Parent.MusicSystems.indexOf(this);return R!==this.Parent.MusicSystems.length?this.Parent.MusicSystems[R+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 SystemLines(){return this.systemLines}get Id(){return this.id}createSystemLeftLine(R,F,D){let G=-R/2;D&&(G=this.maxLabelLength+F-R/2);const U=this.staffLines[0].Measures[0];let W;this.staffLines.length>1&&(W=this.staffLines[this.staffLines.length-1].Measures[0]);const q=this.createSystemLine(G,R,SystemLinesEnum.SingleThin,SystemLinePosition.MeasureBegin,this,U,W);this.SystemLines.push(q),q.PositionAndShape.RelativePosition=new PointF2D(G,0),q.PositionAndShape.BorderLeft=0,q.PositionAndShape.BorderRight=R,q.PositionAndShape.BorderTop=0,q.PositionAndShape.BorderBottom=this.boundingBox.Size.height,this.createLinesForSystemLine(q)}createVerticalLineForMeasure(R,F,D,G,U,W){const q=W.ParentStaffLine,Y=new PointF2D(q.PositionAndShape.RelativePosition.x,q.PositionAndShape.RelativePosition.y),J=q.ParentStaff.ParentInstrument.Staves;if(q.ParentStaff===J[0]){let Z;J.length>1&&(Z=this.getBottomStaffLine(q).Measures[U]);const K=this.createSystemLine(R,F,D,G,this,W,Z),te=Y.x+R;K.PositionAndShape.RelativePosition=new PointF2D(te,0),K.PositionAndShape.BorderLeft=0,K.PositionAndShape.BorderRight=F,this.SystemLines.push(K)}}setYPositionsToVerticalLineObjectsAndCreateLines(R){}calculateBorders(R){}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(R){for(let F=0,D=R.length;F1){let W,q;for(let Y=0,J=this.staffLines.length;Ythis.maxLabelLength&&(this.maxLabelLength=Z.PositionAndShape.Size.width,F=U)}this.updateMusicSystemStaffLineXPosition(F)}setMusicSystemLabelsYPosition(){this.labels.forEach((R,F)=>{let D=0,G=0;for(let U=0;U0&&(F.PositionAndShape.RelativePosition=new PointF2D(0,D/G+2))})}checkStaffEntriesForStaffEntryLink(){let R=!1,F=!1;for(let D=0;D=0;D--){if(F=R.InstrumentalGroups[D],F instanceof Instrument){if(F.Visible===!0)return F;continue}return this.findLastVisibleInstrumentInInstrumentalGroup(F)}}updateMusicSystemStaffLineXPosition(R){for(let F=0,D=this.StaffLines.length;F1}isVisible(){return this.ParentStaff.ParentInstrument.Visible}getGraphicalMeasureDurationFromStaffEntries(){let R=new Fraction$1(0,1);const F=[];for(let D=0,G=this.staffEntries.length;D0&&W.Add(Y.notes[0].graphicalNoteLength);R.lt(W)&&(R=Fraction$1.createFromFraction(W))}return R}addGraphicalStaffEntry(R){this.staffEntries.push(R)}addGraphicalStaffEntryAtTimestamp(R){if(R)if(this.staffEntries.length===0||this.staffEntries[this.staffEntries.length-1].relInMeasureTimestamp.lt(R.relInMeasureTimestamp))this.staffEntries.push(R);else for(let F=this.staffEntries.length-1;F>=0;F--){if(this.staffEntries[F].relInMeasureTimestamp.lt(R.relInMeasureTimestamp)){this.staffEntries.splice(F+1,0,R);break}F===0&&this.staffEntries.splice(F,0,R)}}isPianoRightHand(){return this.isUpperStaffOfInstrument()}isPianoLeftHand(){return this.isLowerStaffOfInstrument()}isUpperStaffOfInstrument(){return this.parentStaff.ParentInstrument.Staves.length===1?!0:this.ParentStaff===this.parentStaff.ParentInstrument.Staves[0]}isLowerStaffOfInstrument(){return this.parentStaff.ParentInstrument.Staves.length===1?!1:this.ParentStaff===this.ParentStaff.ParentInstrument.Staves.last()}beginsWithLineRepetition(){const R=this.parentSourceMeasure;return R?R.beginsWithLineRepetition():!1}endsWithLineRepetition(){const R=this.parentSourceMeasure;return R?R.endsWithLineRepetition():!1}beginsWithWordRepetition(){const R=this.parentSourceMeasure;return R?R.beginsWithWordRepetition():!1}endsWithWordRepetition(){const R=this.parentSourceMeasure;return R?R.endsWithWordRepetition():!1}getTransposedHalftones(){return this.parentStaff.ParentInstrument.GetMusicSheet.Transpose+this.parentStaff.ParentInstrument.Transpose}}Vex.Flow;class VexFlowVoiceEntry extends GraphicalVoiceEntry{constructor(R,F){super(R,F)}applyBordersFromVexflow(){const R=this.vfStaveNote;if(!R.getNoteHeadBeginX)return;const F=R.getBoundingBox(),D=R.getNoteHeadBeginX()-F.x;this.PositionAndShape.RelativePosition.y=F.y/unitInPixels,this.PositionAndShape.BorderTop=0,this.PositionAndShape.BorderBottom=F.h/unitInPixels,this.PositionAndShape.BorderLeft=-(D+R.width/2)/unitInPixels,this.PositionAndShape.BorderRight=(F.w-D)/unitInPixels}set vfStaveNote(R){this.mVexFlowStaveNote=R}get vfStaveNote(){return this.mVexFlowStaveNote}color(){var te;const R=this.rules.DefaultColorNotehead,F=this.rules.DefaultColorRest,D=this.rules.DefaultColorStem,G="#00000000";let U,W;const q=this.vfStaveNote;for(let Q=0;QY.symbol_type===F))return;const q=new VF$9.Repetition(F,G,-this.rules.RepetitionSymbolsYOffset);this.stave.addModifier(q,D);return}this.addVolta(R)}addVolta(R){var D;let F=VF$9.Volta.type.BEGIN;if(R.type===RepetitionInstructionEnum.Ending){switch(R.alignment){case AlignmentType.Begin:this.parentSourceMeasure.endsRepetitionEnding()?F=VF$9.Volta.type.BEGIN_END:F=VF$9.Volta.type.BEGIN;break;case AlignmentType.End:if(this.parentSourceMeasure.beginsRepetitionEnding())return;F=VF$9.Volta.type.END;break}const G=this.ParentStaffLine.SkyBottomLineCalculator,U=this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginLeft+.4,W=Math.max(this.PositionAndShape.AbsolutePosition.x+this.PositionAndShape.BorderMarginRight,U+.4),q=G.getSkyLineMinInRange(U,W)-2;let Y=-6.1+this.rules.VoltaOffset,J=this.rules.VoltaOffset;q0){log$2.trace(`Ghost Found in between (measure ${this.MeasureNumber})`);const K=this.createGhostGves(Z);D.splice(W,0,...K),W+=K.length}}else{const Z=Fraction$1.minus(Y,this.parentSourceMeasure.AbsoluteTimestamp);if(Z.RealValue>0){log$2.trace(`Ghost Found at start (measure ${this.MeasureNumber})`);const K=this.createGhostGves(Z);D.splice(0,0,...K),W+=K.length}}F=J}const G=Fraction$1.plus(this.parentSourceMeasure.AbsoluteTimestamp,this.parentSourceMeasure.Duration),U=Fraction$1.minus(G,F);if(U.RealValue>0){log$2.trace(`Ghost Found at end (measure ${this.MeasureNumber})`);const W=this.createGhostGves(U);D=D.concat(W)}return D}createGhostGves(R){const F=VexFlowConverter.GhostNotes(R),D=[];for(const G of F){const U=new VexFlowVoiceEntry(void 0,void 0);U.vfStaveNote=G,D.push(U)}return D}handleBeam(R,F){const D=R.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;let G=this.beams[D];G||(G=this.beams[D]=[]);let U;for(const q of G)q[0]===F&&(U=q);U||(U=[F,[]],G.push(U));const W=R.parentVoiceEntry;U[1].indexOf(W)<0&&U[1].push(W)}handleTuplet(R,F){const D=R.sourceNote.ParentVoiceEntry.ParentVoice.VoiceId;F=R.sourceNote.NoteTuplet;let G=this.tuplets[D];G||(G=this.tuplets[D]=[]);let U;for(const q of G)q[0]===F&&(U=q);U||(U=[F,[]],G.push(U));const W=R.parentVoiceEntry;U[1].indexOf(W)<0&&U[1].push(W)}finalizeBeams(){this.vfbeams={};const R=[];for(const F in this.beams)if(this.beams.hasOwnProperty(F)){let D=this.vfbeams[F];D||(D=this.vfbeams[F]=[]);for(const G of this.beams[F]){let U=!1;for(const Q of G[0].Notes)if(Q.Length.RealValue>=new Fraction$1(1,4).RealValue&&(!Q.TypeLength||Q.TypeLength.RealValue>.125)){U=!0;break}if(U){log$2.debug("Beam between note >= quarter, likely tremolo, currently unsupported. continuing.");continue}const W=[],q=G[0],Y=G[1];let J=!0;for(const Q of Y)Q.parentVoiceEntry.ParentVoice===q.Notes[0].ParentVoiceEntry.ParentVoice&&(J=Q.parentVoiceEntry.WantedStemDirection===StemDirectionType.Undefined);let Z=!1,K;const te=[];for(const Q of Y){const ie=Q.vfStaveNote;ie&&(W.push(ie),R.push(ie)),Q.parentVoiceEntry.IsGrace&&(Z=!0),Q.parentVoiceEntry.StemColor&&this.rules.ColoringEnabled&&te.push(Q.parentVoiceEntry.StemColor)}if(W.length>1){const Q=new VF$9.Beam(W,J);if(Z&&(Q.render_options.beam_width=3,Q.render_options.partial_beam_length=4),te.length>=2&&this.rules.ColorBeams){K=te[0];for(const ie of te)if(ie!==K){K=void 0;break}Q.setStyle({fillStyle:K,strokeStyle:K})}this.rules.FlatBeams&&(Q.render_options.flat_beams=!0,Q.render_options.flat_beam_offset=this.rules.FlatBeamOffset,Q.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),D.push(Q)}else log$2.debug("Warning! Beam with no notes!")}}this.rules.AutoBeamNotes&&this.autoBeamNotes(R)}autoBeamNotes(R){if(!this.rules.AutoBeamTabs&&this.isTabMeasure)return;let F=[],D=[],G,U=[];this.autoTupletVfBeams=[];const W=[];this.autoVfBeams=[];let q=this.parentSourceMeasure.ActiveTimeSignature;q||(q=this.parentSourceMeasure.Duration);for(const Z of this.staffEntries)for(const K of Z.graphicalVoiceEntries){const te=K.vfStaveNote,Q=K.notes[0],ie=Z.relInMeasureTimestamp.isOnBeat(q),se=D.length>=2,ne=Q.sourceNote.Length.RealValue-new Fraction$1(1,4).RealValue>-Fraction$1.FloatInaccuracyTolerance,re=K.parentVoiceEntry.IsGrace||ne||R.contains(te);if(re||ie){if(se){for(const ce of D)F.push(ce);W.push(F.slice()),F=[]}if(D=[],re)continue}const ae=K.notes[0].sourceNote.NoteTuplet;if(ae){let ce=!1;for(const he of ae.Notes){for(const fe of he)if(fe.NoteTypeXml>=NoteType.QUARTER||fe.ParentVoiceEntry.IsGrace||fe.isRest()&&!this.rules.AutoBeamOptions.beam_rests){ce=!0;break}if(ce)break}if(!G)G=ae;else if(G!==ae){if(U.length>1){const he=new VF$9.Beam(U,!0);this.rules.FlatBeams&&(he.render_options.flat_beams=!0,he.render_options.flat_beam_offset=this.rules.FlatBeamOffset,he.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(he)}U=[],G=ae}ce||U.push(te);continue}else G=void 0;D.push(te)}if(U.length>=2){const Z=new VF$9.Beam(U,!0);this.rules.FlatBeams&&(Z.render_options.flat_beams=!0,Z.render_options.flat_beam_offset=this.rules.FlatBeamOffset,Z.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoTupletVfBeams.push(Z)}if(D.length>=2){for(const Z of D)F.push(Z);W.push(F)}const Y=this.rules.AutoBeamOptions,J={beam_middle_only:Y.beam_middle_rests_only,beam_rests:Y.beam_rests,maintain_stem_directions:Y.maintain_stem_directions};if(Y.groups&&Y.groups.length){const Z=[];for(const K of Y.groups)Z.push(new VF$9.Fraction(K[0],K[1]));J.groups=Z}for(const Z of W){const K=VF$9.Beam.generateBeams(Z,J);for(const te of K)this.rules.FlatBeams&&(te.render_options.flat_beams=!0,te.render_options.flat_beam_offset=this.rules.FlatBeamOffset,te.render_options.flat_beam_offset_per_beam=this.rules.FlatBeamOffsetPerBeam),this.autoVfBeams.push(te)}}finalizeTuplets(){this.vftuplets={};for(const R in this.tuplets)if(this.tuplets.hasOwnProperty(R)){let F=this.vftuplets[R];F||(F=this.vftuplets[R]=[]);for(const D of this.tuplets[R]){const G=[],U=D[1];for(const W of U)G.push(W.vfStaveNote);if(G.length>1){const W=D[0],q=W.Notes[0][0].NormalNotes,Y=W.Bracket||W.TupletLabelNumber===3&&this.rules.TripletsBracketed||W.TupletLabelNumber!==3&&this.rules.TupletsBracketed;let J=VF$9.Tuplet.LOCATION_TOP;W.tupletLabelNumberPlacement===PlacementEnum.Below&&(J=VF$9.Tuplet.LOCATION_BOTTOM),F.push(new VF$9.Tuplet(G,{bracketed:Y,location:J,notes_occupied:q,num_notes:W.TupletLabelNumber,ratioed:this.rules.TupletsRatioed}))}else log$2.debug("Warning! Tuplet with no notes! Trying to ignore, but this is a serious problem.")}}}layoutStaffEntry(R){}graphicalMeasureCreatedCalculations(){let R,F=[];const D=[];for(const U of this.staffEntries){R=!1,F=[];for(const W of U.graphicalVoiceEntries){if(W.parentVoiceEntry.IsGrace){F.push(W),D.push(W),R||(R=W.parentVoiceEntry.GraceSlur);continue}if(W.vfStaveNote=VexFlowConverter.StaveNote(W),F.length>0){const q=[];for(let J=0;J0&&(Z.GraceSlash=!1);const K=VexFlowConverter.StaveNote(Z);Z.vfStaveNote=K,q.push(K)}const Y=new VF$9.GraceNoteGroup(q,R);W.vfStaveNote.addModifier(0,Y),F=[]}}}if(F.length>0)for(const U of F)U.vfStaveNote=VexFlowConverter.StaveNote(U),U.parentVoiceEntry.GraceAfterMainNote=!0;this.finalizeBeams(),this.finalizeTuplets();const G=this.getVoicesWithinMeasure();if(this.rules.RenderFingerings)for(const U of this.staffEntries)U.setModifierXOffsets();for(const U of G){if(!U)continue;this.vfVoices[U.VoiceId]=new VF$9.Voice({beat_value:this.parentSourceMeasure.Duration.Denominator,num_beats:this.parentSourceMeasure.Duration.Numerator,resolution:VF$9.RESOLUTION}).setMode(VF$9.Voice.Mode.SOFT);const W=this.getRestFilledVexFlowStaveNotesPerVoice(U);for(const q of W){if(q.parentVoiceEntry&&q.parentVoiceEntry.IsGrace&&!q.parentVoiceEntry.GraceAfterMainNote)continue;const Y=q;if(Y.vfStaveNote.ticks.denominator===0)continue;if(q.notes.length===0||!q.notes[0]||!q.notes[0].sourceNote.PrintObject){this.vfVoices[U.VoiceId].addTickable(Y.vfStaveNote);continue}const J=Y.parentStaffEntry;if(J&&J.vfClefBefore){const Z=new NoteSubGroup([J.vfClefBefore]);Y.vfStaveNote.getCategory&&Y.vfStaveNote.getCategory()==="stavenotes"&&Y.vfStaveNote.addModifier(0,Z)}q.parentVoiceEntry&&this.rules.RenderFingerings&&((this.rules.FingeringPosition===PlacementEnum.Left||this.rules.FingeringPosition===PlacementEnum.Right)&&this.createFingerings(q),this.createStringNumber(q)),this.createArpeggio(q),this.vfVoices[U.VoiceId].addTickable(Y.vfStaveNote)}}this.setStemDirectionFromVexFlow();for(const U of D)this.createFingerings(U),this.createStringNumber(U),this.createArpeggio(U);this.createArticulations(),this.createOrnaments()}createArpeggio(R){if(R.parentVoiceEntry&&R.parentVoiceEntry.Arpeggio){const F=R.parentVoiceEntry.Arpeggio;if(R.notes&&R.notes.length>1){const D=VexFlowConverter.StrokeTypeFromArpeggioType(F.type),G=new VF$9.Stroke(D,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&R.vfStaveNote.addStroke(0,G)}else log$2.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn. voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`)}}setStemDirectionFromVexFlow(){for(const R of this.staffEntries)for(const F of R.graphicalVoiceEntries)for(const D of F.notes){const G=D.vfnote;if(!G||!G[0])continue;switch(G[0].getStemDirection()){case VF$9.Stem.UP:F.parentVoiceEntry.StemDirection=StemDirectionType.Up;break;case VF$9.Stem.DOWN:F.parentVoiceEntry.StemDirection=StemDirectionType.Down;break}}}createArticulations(){for(let R=0,F=this.staffEntries.length;R1||R.parentStaffEntry.graphicalVoiceEntries.length>1?J=VF$9.StaveModifier.Position.LEFT:K.idInMusicSheet===0?(J=VF$9.StaveModifier.Position.ABOVE,q=PlacementEnum.Above):(J=VF$9.StaveModifier.Position.BELOW,q=PlacementEnum.Below)}const Z=new VF$9.FretHandFinger(W.value);if(Z.setPosition(J),Z.setOffsetX(Y),q===PlacementEnum.Above||q===PlacementEnum.Below){const K=q===PlacementEnum.Above?-1:1,te=q===PlacementEnum.Above?G:D-1-G;if(this.rules.FingeringInsideStafflines&&D>1){const Q=Z.getWidth()/2,ie=D*2.5;Z.setOffsetY(K*(te+ie)*Q)}else if(!this.rules.FingeringInsideStafflines){const Q=new VF$9.StringNumber(W.value);Q.radius=0,Q.setPosition(J),Q.setOffsetY(K*te*Q.getWidth()*2/3),F.vfStaveNote.addModifier(G,Q);continue}}F.vfStaveNote.addModifier(G,Z)}}createStringNumber(R){if(!this.rules.RenderStringNumbersClassical)return;const F=R;R.notes.forEach((D,G)=>{const U=D.sourceNote.StringInstruction;if(U){let W=U.value;switch(W){case"1":W="I";break;case"2":W="II";break;case"3":W="III";break;case"4":W="IV";break;case"5":W="V";break;case"6":W="VI";break}const q=new VF$9.StringNumber(W);q.radius=0;const Y=-this.rules.StringNumberOffsetY;R.notes.length>1||R.parentStaffEntry.graphicalVoiceEntries.length>1?(q.setOffsetX(D.baseStringNumberXOffset*13),q.setPosition(VF$9.Modifier.Position.RIGHT)):q.setPosition(VF$9.Modifier.Position.ABOVE),q.setOffsetY(Y),F.vfStaveNote.addModifier(G,q)}})}lineTo(R,F){const D=new VF$9.StaveConnector(R.getVFStave(),this.stave);D.setType(F),this.connectors.push(D)}getVFStave(){return this.stave}updateInstructionWidth(){let R=0,F=0;const D=this.stave.getModifiers();for(const G of D)G.getPosition()===StavePositionEnum.BEGIN?R+=G.getWidth()+G.getPadding(void 0):G.getPosition()===StavePositionEnum.END&&(F+=G.getWidth()+G.getPadding(void 0));this.beginInstructionsWidth=(R!=null?R:0)/unitInPixels,this.endInstructionsWidth=(F!=null?F:0)/unitInPixels}addStaveTie(R,F){this.vfTies.push(R),F.vfTie=R}}var StavePositionEnum=(B=>(B[B.LEFT=1]="LEFT",B[B.RIGHT=2]="RIGHT",B[B.ABOVE=3]="ABOVE",B[B.BELOW=4]="BELOW",B[B.BEGIN=5]="BEGIN",B[B.END=6]="END",B))(StavePositionEnum||{});class GraphicalStaffEntry extends GraphicalObject{constructor(R,F=void 0,D=void 0){super(),this.graphicalChordContainers=[],this.tabStaffEntry=void 0,this.MaxAccidentals=0,this.graphicalInstructions=[],this.ties=[],this.graphicalTies=[],this.lyricsEntries=[],this.parentMeasure=R,this.graphicalVoiceEntries=[],this.sourceStaffEntry=F,D?(this.staffEntryParent=D,this.parentVerticalContainer=D.parentVerticalContainer,this.PositionAndShape=new BoundingBox$1(this,D.PositionAndShape)):this.PositionAndShape=new BoundingBox$1(this,R.PositionAndShape),F&&(this.relInMeasureTimestamp=F.Timestamp),this.FingeringEntries=[]}get GraphicalInstructions(){return this.graphicalInstructions}get GraphicalTies(){return this.graphicalTies}get LyricsEntries(){return this.lyricsEntries}set LyricsEntries(R){this.lyricsEntries=R}getAbsoluteTimestamp(){const R=this.parentMeasure.parentSourceMeasure.AbsoluteTimestamp.clone();return this.relInMeasureTimestamp&&R.Add(this.relInMeasureTimestamp),R}findTieGraphicalNoteFromNote(R){for(const F of this.graphicalVoiceEntries)for(const D of F.notes){const G=D.sourceNote;if(!G.isRest()&&G.Pitch.FundamentalNote===R.Pitch.FundamentalNote&&G.Pitch.Octave===R.Pitch.Octave&&G.getAbsoluteTimestamp().Equals(R.getAbsoluteTimestamp()))return D}}findEndTieGraphicalNoteFromNoteWithStartingSlur(R,F){if(!!R){for(const D of this.graphicalVoiceEntries)if(D.parentVoiceEntry===R.ParentVoiceEntry)for(const G of D.notes){const U=G.sourceNote;if(U.NoteTie&&U.NoteSlurs.indexOf(F)!==-1)return G}}}findGraphicalNoteFromGraceNote(R){if(!!R){for(const F of this.graphicalVoiceEntries)if(F.parentVoiceEntry===R.ParentVoiceEntry){for(const D of F.notes)if(D.sourceNote===R)return D}}}findGraphicalNoteFromNote(R){if(!!R){for(const F of this.graphicalVoiceEntries)if(F.parentVoiceEntry===R.ParentVoiceEntry){for(const D of F.notes)if(D.sourceNote===R&&this.getAbsoluteTimestamp().Equals(R.getAbsoluteTimestamp()))return D}}}getGraphicalNoteDurationFromVoice(R){for(const F of this.graphicalVoiceEntries)if(F.parentVoiceEntry.ParentVoice===R)return F.notes[0].graphicalNoteLength;return new Fraction$1(0,1)}findVoiceEntryGraphicalNotes(R){for(const F of this.graphicalVoiceEntries)if(F.parentVoiceEntry===R)return F.notes}isVoiceEntryPartOfLinkedVoiceEntry(R){if(this.sourceStaffEntry.Link)for(let F=0,D=this.sourceStaffEntry.Link.LinkStaffEntries.length;F0&&(R=G)}return R}findStaffEntryMaxNoteLength(){let R=new Fraction$1(0,1);for(const F of this.graphicalVoiceEntries)for(const D of F.notes){const G=D.graphicalNoteLength;R.lt(G)&&G.GetExpandedNumerator()>0&&(R=G)}return R}findOrCreateGraphicalVoiceEntry(R){for(const D of this.graphicalVoiceEntries)if(D.parentVoiceEntry===R)return D;const F=MusicSheetCalculator.symbolFactory.createVoiceEntry(R,this);return this.graphicalVoiceEntries.push(F),F}findOrCreateGraphicalVoiceEntryFromGraphicalNote(R){for(const D of this.graphicalVoiceEntries)if(D===R.parentVoiceEntry)return D;const F=MusicSheetCalculator.symbolFactory.createVoiceEntry(R.sourceNote.ParentVoiceEntry,this);return this.graphicalVoiceEntries.push(F),F}addGraphicalNoteToListAtCorrectYPosition(R,F){const D=R.notes;if(D.length===0||F.PositionAndShape.RelativePosition.y=0;G--){if(D[G].PositionAndShape.RelativePosition.y>F.PositionAndShape.RelativePosition.y){D.splice(G+1,0,F);break}if(G===0){D.splice(0,0,F);break}}}hasOnlyRests(){for(const F of this.graphicalVoiceEntries)for(const D of F.notes)if(!D.sourceNote.isRest())return!1;return!0}getSkylineMin(){var G;const R=(G=this.parentMeasure)==null?void 0:G.ParentStaffLine.SkyBottomLineCalculator;if(!R)return;const[F,D]=this.getAbsoluteStartAndEnd();return R.getSkyLineMinInRange(F,D)}getHighestYAtEntry(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getSkylineMin()}getLowestYAtEntry(){return this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.y+this.getBottomlineMax()}getBottomlineMax(){var G;const R=(G=this.parentMeasure)==null?void 0:G.ParentStaffLine.SkyBottomLineCalculator;if(!R)return;const[F,D]=this.getAbsoluteStartAndEnd();return R.getBottomLineMaxInRange(F,D)}getAbsoluteStartAndEnd(){let R=this.PositionAndShape.AbsolutePosition.x;R-=this.parentMeasure.ParentStaffLine.PositionAndShape.AbsolutePosition.x;const F=R+this.PositionAndShape.Size.width;return[R,F]}}const VF$8=Vex.Flow;class VexFlowStaffEntry extends GraphicalStaffEntry{constructor(R,F,D){super(R,F,D)}calculateXPosition(){const R=this.parentMeasure.getVFStave();let F=0;for(const D of this.graphicalVoiceEntries)if(D.vfStaveNote){if(D.vfStaveNote.setStave(R),R&&R.getLines&&R.getLines()===1&&D.vfStaveNote.getStemDirection()<0&&(D.vfStaveNote.setStemDirection(VF$8.Stem.UP),D.parentVoiceEntry.StemDirection=StemDirectionType.Up),!D.vfStaveNote.preFormatted)continue;D.applyBordersFromVexflow(),this.parentMeasure.ParentStaff.isTab?this.PositionAndShape.RelativePosition.x=(D.vfStaveNote.getAbsoluteX()+D.vfStaveNote.glyph.getWidth())/unitInPixels:this.PositionAndShape.RelativePosition.x=D.vfStaveNote.getBoundingBox().getX()/unitInPixels;const G=D.notes[0].sourceNote;G.isRest()&&G.Length.RealValue===this.parentMeasure.parentSourceMeasure.ActiveTimeSignature.RealValue&&(this.PositionAndShape.RelativePosition.x+=this.parentMeasure.parentSourceMeasure.Rules.WholeRestXShiftVexflow-.1,D.PositionAndShape.BorderLeft=-.7,D.PositionAndShape.BorderRight=.7),D.PositionAndShape.BorderLeftU.staffLine),D=this.calculateModifierXOffsets(F,1),G=this.calculateModifierXOffsets(F,.5);R.forEach((U,W)=>{U.baseFingeringXOffset=G[W],U.baseStringNumberXOffset=D[W]})}calculateModifierXOffsets(R,F){const D=[];for(let G=0;G=0;q--){if(Math.abs(R[G]-R[q])<=F&&U===D[q]){U++,W=!0;break}W=!1}D.push(U)}return D}}Vex.Flow;class VexFlowGraphicalNote extends GraphicalNote{constructor(R,F,D,G=OctaveEnum.NONE,U,W=void 0){if(super(R,F,U,W),this.clef=D,this.octaveShift=G,R.Pitch){const q=R.isRest()?R.Pitch:OctaveShift.getPitchFromOctaveShift(R.Pitch,G);this.vfpitch=VexFlowConverter.pitch(q,R.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0}}setAccidental(R){const F=this.drawPitch(R);this.vfpitch=VexFlowConverter.pitch(F,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.DrawnAccidental=F.Accidental}drawPitch(R){return OctaveShift.getPitchFromOctaveShift(R,this.octaveShift)}Transpose(R,F,D,G){const U=super.Transpose(R,F,D,G),W=OctaveShift.getPitchFromOctaveShift(U,this.octaveShift);return this.vfpitch=VexFlowConverter.pitch(W,this.sourceNote.isRest(),this.clef,this.sourceNote.Notehead),this.vfpitch[1]=void 0,W}setIndex(R,F){this.vfnote=[R,F],this.vfnoteIndex=F}notehead(R=void 0){let F=R;F||(F=this.vfnote[0]);const D=F.note_heads;return D&&D.length>this.vfnoteIndex&&D[this.vfnoteIndex]?F.note_heads[this.vfnoteIndex]:{line:0}}Clef(){return this.clef}getSVGId(){if(!!this.vfnote)return this.vfnote[0].getAttribute("id")}getSVGGElement(){if(!!this.vfnote)return this.vfnote[0].getAttribute("el")}getStemSVG(){return document.getElementById("vf-"+this.getSVGId()+"-stem")}getBeamSVGs(){const R=[];for(let F=0;;F++){const D=document.getElementById(`vf-${this.getSVGId()}-beam${F}`);if(!D)break;R.push(D)}return R}}class GraphicalChordSymbolContainer extends GraphicalObject{constructor(R,F,D,G,U,W){super(),this.chordSymbolContainer=R,this.boundingBox=new BoundingBox$1(this,F),this.rules=W,this.calculateLabel(D,U,G)}get GetChordSymbolContainer(){return this.chordSymbolContainer}get GraphicalLabel(){return this.graphicalLabel}calculateLabel(R,F,D){const G=ChordSymbolContainer.calculateChordText(this.chordSymbolContainer,F,D);this.graphicalLabel=new GraphicalLabel(new Label(G),R,this.rules.ChordSymbolTextAlignment,this.rules,this.boundingBox),this.graphicalLabel.PositionAndShape.RelativePosition=new PointF2D(this.rules.ChordSymbolRelativeXOffset,0),this.graphicalLabel.Label.colorDefault=this.rules.DefaultColorChordSymbol}}const VF$7=Vex.Flow;class VexFlowTabMeasure extends VexFlowMeasure{constructor(R,F=void 0,D=void 0){super(R,F,D),this.isTabMeasure=!0}resetLayout(){var F;const R=(F=this.ParentStaff.StafflineCount)!=null?F:6;this.stave=new VF$7.TabStave(0,0,0,{space_above_staff_ln:0,space_below_staff_ln:0,num_lines:R}),this.updateInstructionWidth()}graphicalMeasureCreatedCalculations(){for(let F=0,D=this.staffEntries.length;F1){const q=VexFlowConverter.StrokeTypeFromArpeggioType(W.type),Y=new VF$7.Stroke(q,{all_voices:this.rules.ArpeggiosGoAcrossVoices});this.rules.RenderArpeggios&&U.vfStaveNote.addStroke(0,Y)}else log$2.debug(`[OSMD] arpeggio in measure ${this.MeasureNumber} could not be drawn. voice entry had less than two notes, arpeggio is likely between voice entries, not currently supported in Vexflow.`)}this.vfVoices[F.VoiceId].addTickable(U.vfStaveNote)}}}}class StaffLine extends GraphicalObject{constructor(R,F){super(),this.measures=[],this.staffLines=new Array(5),this.octaveShifts=[],this.lyricLines=[],this.lyricsDashes=[],this.abstractExpressions=[],this.graphicalSlurs=[],this.Pedals=[],this.WavyLines=[],this.parentMusicSystem=R,this.parentStaff=F,this.boundingBox=new BoundingBox$1(this,R.PositionAndShape),this.skyBottomLine=MusicSheetCalculator.symbolFactory.createSkyBottomLineCalculator(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=this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight*6;break;default:this.staffHeight=this.bottomLineOffset=this.ParentStaff.ParentInstrument.GetMusicSheet.Rules.TabStaffInterlineHeight*this.ParentStaff.StafflineCount;break}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;break}}get Measures(){return this.measures}set Measures(R){this.measures=R}get StaffLines(){return this.staffLines}set StaffLines(R){this.staffLines=R}get Index(){return this.parentMusicSystem.StaffLines.indexOf(this)}get NextStaffLine(){const R=this.Index;return R!==this.parentMusicSystem.StaffLines.length?this.parentMusicSystem.StaffLines[R+1]:void 0}get LyricLines(){return this.lyricLines}get AbstractExpressions(){return this.abstractExpressions}set AbstractExpressions(R){this.abstractExpressions=R}set LyricLines(R){this.lyricLines=R}get LyricsDashes(){return this.lyricsDashes}set LyricsDashes(R){this.lyricsDashes=R}get ParentMusicSystem(){return this.parentMusicSystem}set ParentMusicSystem(R){this.parentMusicSystem=R}get ParentStaff(){return this.parentStaff}set ParentStaff(R){this.parentStaff=R}get SkyBottomLineCalculator(){return this.skyBottomLine}get SkyLine(){return this.skyBottomLine.SkyLine}get BottomLine(){return this.skyBottomLine.BottomLine}get OctaveShifts(){return this.octaveShifts}set OctaveShifts(R){this.octaveShifts=R}get StaffHeight(){return this.staffHeight}get TopLineOffset(){return this.topLineOffset}get BottomLineOffset(){return this.bottomLineOffset}get GraphicalSlurs(){return this.graphicalSlurs}addSlurToStaffline(R){this.graphicalSlurs.push(R)}addActivitySymbolClickArea(){const R=new StaffLineActivitySymbol(this),F=this.PositionAndShape;R.PositionAndShape.RelativePosition=new PointF2D(F.RelativePosition.x+F.BorderRight+.5,F.RelativePosition.y+.5),R.PositionAndShape.Parent=this.parentMusicSystem.PositionAndShape}isPartOfMultiStaffInstrument(){return this.parentStaff.ParentInstrument.Staves.length>1}findClosestStaffEntry(R){let F;for(let D=0,G=this.Measures.length;D0){const W=U.map(Y=>Y.PositionAndShape.Center.y),q=Math.max(...W);for(let Y=0;Y0?U[Y-1]:void 0;if(K){const Q=this.getOverlap(J.PositionAndShape,K.PositionAndShape);J.squeeze(-(Q.x+this.rules.DynamicExpressionSpacer))}if(te){const Q=this.getOverlap(te.PositionAndShape,J.PositionAndShape);J.squeeze(Q.x+this.rules.DynamicExpressionSpacer)}}}}}getDistance(R,F){const D=R.RelativePosition.x+R.BorderMarginRight,G=F.RelativePosition.x+F.BorderMarginLeft,U=R.RelativePosition.y+R.BorderMarginBottom,W=F.RelativePosition.y+F.BorderMarginTop;return new PointF2D(G-D,W-U)}getOverlap(R,F){return new PointF2D(R.RelativePosition.x+R.BorderMarginRight-(F.RelativePosition.x+F.BorderMarginLeft),R.RelativePosition.y+R.BorderMarginBottom-(F.RelativePosition.y+F.BorderMarginTop))}}class VexFlowStaffLine extends StaffLine{constructor(R,F){super(R,F),this.slursInVFStaffLine=[],this.alignmentManager=new AlignmentManager(this)}get SlursInVFStaffLine(){return this.slursInVFStaffLine}addVFSlurToVFStaffline(R){this.slursInVFStaffLine.push(R)}get AlignmentManager(){return this.alignmentManager}}const VF$6=Vex.Flow;class VexFlowMultiRestMeasure extends VexFlowMeasure{constructor(R,F=void 0,D=void 0){super(R,F,D),this.minimumStaffEntriesWidth=-1,D?this.rules=D.ParentMusicSystem.rules:F&&(this.rules=F.Rules),this.resetLayout(),this.multiRestElement=new VF$6.MultiMeasureRest(F.multipleRestMeasures,{})}draw(R){var U,W,q,Y,J;const F=R.openGroup();(U=F==null?void 0:F.classList)==null||U.add("vf-measure");const D=R.openGroup();(W=D==null?void 0:D.classList)==null||W.add("vf-stave"),D==null||D.setAttribute("id",(Y=(q=this.stave)==null?void 0:q.attrs)==null?void 0:Y.id),this.stave.setContext(R).draw(),R.closeGroup();const G=R.openGroup();(J=G==null?void 0:G.classList)==null||J.add("vf-voices"),this.multiRestElement.setStave(this.stave),this.multiRestElement.setContext(R),this.multiRestElement.draw(),R.closeGroup();for(const Z of this.connectors)Z.setContext(R).draw();return R.closeGroup(),F}format(){}getVoicesWithinMeasure(){return[]}getGraphicalVoiceEntriesPerVoice(R){return[]}getRestFilledVexFlowStaveNotesPerVoice(R){return[]}handleBeam(R,F){}handleTuplet(R,F){}finalizeBeams(){}finalizeTuplets(){}layoutStaffEntry(R){}graphicalMeasureCreatedCalculations(){}createArticulations(){}createOrnaments(){}createFingerings(R){}getVFStave(){return this.stave}}const VF$5=Vex.Flow;class VexFlowBackend{getInnerElement(){return this.inner}getCanvas(){return this.canvas}getRenderElement(){let R=this.canvas;return this.getVexflowBackendType()===VF$5.Renderer.Backends.CANVAS&&(R=this.inner),R}getRenderer(){return this.renderer}removeAllChildrenFromContainer(R){for(;R.children.length!==0;)R.removeChild(R.children.item(0))}removeFromContainer(R){const F=this.getRenderElement();for(let D=0;D \r<`)),U.download="opensheetmusicdisplay_download.svg",U.innerHTML=window.location.href+"/download",document.body.appendChild(U)}}class VexFlowInstantaneousDynamicExpression extends GraphicalInstantaneousDynamicExpression{constructor(R,F,D){super(R,F,D);const G=new Label(this.Expression);this.label=new GraphicalLabel(G,this.rules.ContinuousDynamicTextHeight,TextAlignmentEnum.CenterCenter,this.rules,this.PositionAndShape),this.label.Label.fontStyle=FontStyles.BoldItalic,this.label.setLabelPositionAndShapeBorders(),this.PositionAndShape.calculateBoundingBox()}get InstantaneousDynamic(){return this.mInstantaneousDynamicExpression}get Expression(){return DynamicEnum[this.mInstantaneousDynamicExpression.DynEnum]}}class GraphicalOctaveShift extends GraphicalObject{constructor(R,F){super(),this.getOctaveShift=R,this.setSymbol(),this.PositionAndShape=new BoundingBox$1(this,F)}setSymbol(){switch(this.getOctaveShift.Type){case OctaveEnum.VA8:this.octaveSymbol=MusicSymbol.VA8;break;case OctaveEnum.VB8:this.octaveSymbol=MusicSymbol.VB8;break;case OctaveEnum.MA15:this.octaveSymbol=MusicSymbol.MA15;break;case OctaveEnum.MB15:this.octaveSymbol=MusicSymbol.MB15;break;default:throw new ArgumentOutOfRangeException("")}}}const VF$2=Vex.Flow;class VexFlowOctaveShift extends GraphicalOctaveShift{constructor(R,F){switch(super(R,F),R.Type){case OctaveEnum.VA8:this.position=VF$2.TextBracket.Positions.TOP,this.supscript="va",this.text="8";break;case OctaveEnum.MA15:this.position=VF$2.TextBracket.Positions.TOP,this.supscript="ma",this.text="15";break;case OctaveEnum.VB8:this.position=VF$2.TextBracket.Positions.BOTTOM,this.supscript="vb",this.text="8";break;case OctaveEnum.MB15:this.position=VF$2.TextBracket.Positions.BOTTOM,this.supscript="mb",this.text="15";break;default:log$2.error("Unknown or NONE octaveshift. This should not be called!");break}}setStartNote(R){for(const F of R.graphicalVoiceEntries){const D=F;if(D!=null&&D.vfStaveNote)return this.startNote=D.vfStaveNote,!0}return!1}setEndNote(R){for(const F of R.graphicalVoiceEntries){const D=F;if(D!=null&&D.vfStaveNote)return this.endNote=D.vfStaveNote,!0}return!1}getTextBracket(){return new VF$2.TextBracket({position:this.position,start:this.startNote,stop:this.endNote,superscript:this.supscript,text:this.text})}}Vex.Flow;class VexflowStafflineNoteCalculator{constructor(R){this.staffPitchListMapping=new Dictionary,this.baseLineNote=NoteEnum.B,this.baseLineOctave=1,this.rules=R}trackNote(R){if(!(R instanceof VexFlowGraphicalNote)||R.Clef().ClefType!==ClefEnum.percussion||R.sourceNote.isRest()||this.rules.PercussionOneLineCutoff===0||this.rules.PercussionForceVoicesOneLineCutoff===-1)return;const F=R.parentVoiceEntry.parentStaffEntry.sourceStaffEntry.ParentStaff.idInMusicSheet;let D;this.staffPitchListMapping.containsKey(F)||this.staffPitchListMapping.setValue(F,new Array),D=this.staffPitchListMapping.getValue(F);const G=R.sourceNote.Pitch;VexflowStafflineNoteCalculator.findOrInsert(D,G)}static PitchIndexOf(R,F,D=0){if(D>R.length-1)return-1;for(let G=D;Gthis.rules.PercussionOneLineCutoff&&!G)return R;const U=R,W=R.sourceNote.Pitch;let q=this.baseLineNote,Y=this.baseLineOctave;if(this.rules.PercussionUseXMLDisplayStep&&R.sourceNote.displayStepUnpitched!==void 0&&(q=R.sourceNote.displayStepUnpitched,Y=R.sourceNote.displayOctaveUnpitched+this.rules.PercussionOneLineXMLDisplayStepOctaveOffset),D.length<=this.rules.PercussionForceVoicesOneLineCutoff)U.setAccidental(new Pitch(q,Y,W.Accidental));else{const J=VexflowStafflineNoteCalculator.PitchIndexOf(D,W);if(J>-1){const Z=Math.ceil(D.length/2);if(!this.rules.PercussionUseXMLDisplayStep)if(J>=Z)switch(Y=2,(J-Z)%5){case 1:q=NoteEnum.E;break;case 2:q=NoteEnum.G;break;case 3:q=NoteEnum.B;break;case 4:q=NoteEnum.D,Y=3;break;default:q=NoteEnum.C;break}else switch(J%5){case 1:q=NoteEnum.F;break;case 2:q=NoteEnum.D;break;case 3:q=NoteEnum.B,Y=0;break;case 4:q=NoteEnum.G,Y=0;break;default:q=NoteEnum.A;break}const K=new Pitch(q,Y,W.Accidental);U.setAccidental(K);const te=U.parentVoiceEntry.parentVoiceEntry;!this.rules.SetWantedStemDirectionByXml&&te.Notes.length<2&&(K.Octave>this.baseLineOctave||K.FundamentalNote===this.baseLineNote&&K.Octave===this.baseLineOctave?U.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=StemDirectionType.Up:U.parentVoiceEntry.parentVoiceEntry.WantedStemDirection=StemDirectionType.Down)}}return U}getStafflineUniquePositionCount(R){return this.staffPitchListMapping.containsKey(R)?this.staffPitchListMapping.getValue(R).length:0}}class SkyBottomLineCalculator{constructor(R){this.mStaffLineParent=R,this.mRules=R.ParentMusicSystem.rules}calculateLines(){const R=Math.max(Math.ceil(this.StaffLineParent.PositionAndShape.Size.width*this.SamplingUnit),1);this.mSkyLine=[],this.mBottomLine=[];const F=new CanvasVexFlowBackend(this.StaffLineParent.ParentMusicSystem.rules);for(const W of this.StaffLineParent.Measures){W.PositionAndShape.calculateAbsolutePositionsRecursive(0,0);const q=W.getVFStave();let Y=q.getWidth();if(!(Y>0)&&!W.IsExtraGraphicalMeasure&&(log$2.warn("SkyBottomLineCalculator: width not > 0 in measure "+W.MeasureNumber),Y=50),!(Y>=50)&&W.IsExtraGraphicalMeasure)continue;F.initializeHeadless(Y);const J=F.getContext(),Z=F.getCanvas();Y=Z.width;const K=Z.height;this.mRules.DYMusicScoreType==="jianpu"?q.setY(q.y-50):q.setY(q.y+100);const te=q.getWidth();q.setWidth(Y),W.format(),q.setWidth(te);try{W.draw(J)}catch(ae){log$2.warn("SkyBottomLineCalculator.calculateLines.draw",ae)}const Q=J.getImageData(0,0,Y,K),ie=4,se=Math.max(Math.ceil(W.PositionAndShape.Size.width*this.mRules.SamplingUnit),1),ne=new Array(se),re=new Array(se);for(let ae=0;ae0){ne[ae]=ce;break}}for(let ce=K;ce>0;ce--){const fe=ce*Y*ie+ae*ie;if(Q.data[fe+3]>0){re[ae]=ce;break}}}for(let ae=0;ae(W-Math.max(...this.mSkyLine))/unitInPixels+this.StaffLineParent.TopLineOffset),this.mBottomLine=this.mBottomLine.map(W=>(W-Math.min(...this.mBottomLine))/unitInPixels+this.StaffLineParent.BottomLineOffset)}findPreviousValidNumber(R,F){for(let D=R;D>=0;D--)if(!isNaN(F[D]))return F[D];return 0}findNextValidNumber(R,F){if(R>=F.length)return F[R-1];for(let D=R;D=this.BottomLine.length&&(D=this.BottomLine.length-1),G<0&&(G=0),G>=this.BottomLine.length&&(G=this.BottomLine.length),this.SkyLine[D]=R.y;for(let W=D+1;W=this.BottomLine.length&&(D=this.BottomLine.length-1),G<0&&(G=0),G>=this.BottomLine.length&&(G=this.BottomLine.length),this.BottomLine[D]=R.y;for(let W=D+1;WR)}setBottomLineWithValue(R){this.BottomLine.forEach(F=>R)}getLeftIndexForPointX(R,F){const D=Math.floor(R*this.SamplingUnit);return D<0?0:D>=F?F-1:D}getRightIndexForPointX(R,F){const D=Math.ceil(R*this.SamplingUnit);return D<0?0:D>=F?F-1:D}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(R=>!isNaN(R)))}getSkyLineMinAtPoint(R){const F=Math.round(R*this.SamplingUnit);return this.mSkyLine[F]}getSkyLineMinInRange(R,F){return this.getMinInRange(this.SkyLine,R,F)}getBottomLineMax(){return Math.max(...this.BottomLine.filter(R=>!isNaN(R)))}getBottomLineMaxAtPoint(R){const F=Math.round(R*this.SamplingUnit);return this.mBottomLine[F]}getBottomLineMaxInRange(R,F){return this.getMaxInRange(this.BottomLine,R,F)}getBottomLineMaxInBoundingBox(R){const F=Math.floor(R.AbsolutePosition.x+R.BorderLeft),D=Math.ceil(R.AbsolutePosition.x+R.BorderRight);return this.getMaxInRange(this.mBottomLine,F,D)}updateWithBoundingBoxRecursively(R){if(R.ChildElements&&R.ChildElements.length>0)for(const F of R.ChildElements)this.updateWithBoundingBoxRecursively(F);else{const F=R.BorderTop+R.AbsolutePosition.y,D=R.BorderBottom+R.AbsolutePosition.y;if(F<0){const G=Math.floor(R.AbsolutePosition.x+R.BorderLeft),U=Math.ceil(R.AbsolutePosition.x+R.BorderRight);this.updateInRange(this.mSkyLine,G,U,F)}else if(D>this.StaffLineParent.StaffHeight){const G=Math.floor(R.AbsolutePosition.x+R.BorderLeft),U=Math.ceil(R.AbsolutePosition.x+R.BorderRight);this.updateInRange(this.mBottomLine,G,U,D)}}}updateInRange(R,F=0,D=R.length,G=0){if(F=Math.floor(F*this.SamplingUnit),D=Math.ceil(D*this.SamplingUnit),DR.length&&(D=R.length);for(let U=F;UMath.abs(R[U])?G:R[U]}setInRange(R,F=0,D=R.length,G=0){if(F=Math.floor(F*this.SamplingUnit),D=Math.ceil(D*this.SamplingUnit),DR.length&&(D=R.length);for(let U=F;U=R.length&&(F=R.length-1),D<0&&(D=0),D>=R.length&&(D=R.length),F>=0&&D<=R.length)return Math.min(...R.slice(F,D+1))}getMaxInRange(R,F,D){if(F=Math.floor(F*this.SamplingUnit),D=Math.ceil(D*this.SamplingUnit),!R)return Number.MIN_VALUE;if(F<0&&(F=0),F>=R.length&&(F=R.length-1),D<0&&(D=0),D>=R.length&&(D=R.length),F>=0&&D<=R.length)return Math.max(...R.slice(F,D+1))}get SamplingUnit(){return this.mRules.SamplingUnit}get StaffLineParent(){return this.mStaffLineParent}get SkyLine(){return this.mSkyLine}get BottomLine(){return this.mBottomLine}}var parser$3={exports:{}};/*! * d-path-parser - v1.0.0 * by Massimo Artizzu (MaxArt2501) * * https://github.com/MaxArt2501/d-path-parser * * Licensed under the MIT License * See LICENSE for details */(function(B,R){(function(F,D){B.exports=D()})(commonjsGlobal$1,function(){return function(D){for(var G={command:/\s*([achlmqstvz])/gi,number:/\s*([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/gi,comma:/\s*(?:(,)|\s)/g,flag:/\s*([01])/g},U={number:function(se){return+Q("number",se)},"coordinate pair":function(se){var ne=Q("number",se);if(ne===null&&!se)return null;Q("comma");var re=Q("number",!0);return{x:+ne,y:+re}},"arc definition":function(se){var ne=U["coordinate pair"](se);if(!ne&&!se)return null;Q("comma");var re=+Q("number",!0);Q("comma",!0);var ae=!!+Q("flag",!0);Q("comma");var ce=!!+Q("flag",!0);Q("comma");var he=U["coordinate pair"](!0);return{radii:ne,rotation:re,large:ae,clockwise:ce,end:he}}},W=0,q=[];WF.bottom)switch(R.tagName.toLowerCase()){case"g":for(const te of R.children)this.recursiveUpdate(te,F,D,G);break;case"circle":case"rect":case"line":case"path":let Z=Math.floor((U.x-D.x)/unitInPixels*this.mRules.SamplingUnit);const K=Z+Math.ceil(U.width/unitInPixels*this.mRules.SamplingUnit);if(R.parentElement.classList.contains("vf-beams")&&R.hasAttribute("d")){const te=parse$3(R.getAttribute("d"));if(te.length===5){const Q=te[0],ie=te[3],se=(ie.end.y-Q.end.y)/(ie.end.x-Q.end.x);let ne=Q.end.y/unitInPixels;for(Z;Z<=K;Z++)neJ[Z]&&(J[Z]=ne),ne+=se/this.mRules.SamplingUnit}}else for(Z;Z<=K;Z++)WJ[Z]&&(J[Z]=q);break}}calculateLinesForMeasure(R,F){var be,ue,ge;const D=F.getBBox(),G=Math.max(Math.round(R.PositionAndShape.Size.width*this.mRules.SamplingUnit),1),U=D.height/unitInPixels,q=F.getElementsByClassName("vf-stave")[0].getBBox();let Y=(q==null?void 0:q.height)/unitInPixels,J=(q==null?void 0:q.y)/unitInPixels;const Z=R.getVFStave();let K=((be=Z.options)!=null&&be.num_lines?Z.options.num_lines:5)-1,te=-1,Q=0;const ie=[K];for(const ve of(ue=Z.options)==null?void 0:ue.line_config)ve.visible?(te===-1&&(te=Q),ie.push(Q)):K--,Q++;const se=ie.pop();te===-1&&(te=0),K=se-te;const ne=(ge=Z.options)==null?void 0:ge.spacing_between_lines_px,re=K*ne/unitInPixels;Y-re>.2&&(Y=re,J=te*ne/unitInPixels);const ae=J+Y,ce=new Array(G).fill(J),he=new Array(G).fill(ae),fe=[ce,he];if(U>Y)for(const ve of F.children)this.recursiveUpdate(ve,{top:J,bottom:ae},D,[ce,he]);return fe}calculateLines(){this.mSkyLine=[],this.mBottomLine=[];const R=document.createElement("div");document.body.append(R);const F=new SvgVexFlowBackend(this.mRules);F.initialize(R,1,"0");const D=F.getContext(),G=D.openGroup();G.classList.add("staffline");for(const U of this.StaffLineParent.Measures){U.PositionAndShape.calculateAbsolutePositionsRecursive(0,0),U.setAbsoluteCoordinates(U.PositionAndShape.AbsolutePosition.x*unitInPixels,U.PositionAndShape.AbsolutePosition.y*unitInPixels);const W=U.draw(D),[q,Y]=this.calculateLinesForMeasure(U,W);this.mSkyLine.push(...q),this.mBottomLine.push(...Y)}D.closeGroup();for(const U of G.getElementsByClassName("vf-ties"))for(const W of U.childNodes)if(W.nodeName.toLowerCase()==="path"){const q=W.getBBox();let Y=Math.floor(q.x/unitInPixels*this.mRules.SamplingUnit);const J=Y+Math.ceil(q.width/unitInPixels*this.mRules.SamplingUnit),Z=q.y/unitInPixels,K=q.height/unitInPixels+Z;for(Y;Y<=J;Y++)Zthis.mBottomLine[Y]&&(this.mBottomLine[Y]=K)}F.clear(),R.remove()}}const VF$1=Vex.Flow;class VexFlowGraphicalSymbolFactory{constructor(){this.hasBBox=!1,document.createElementNS("http://www.w3.org/2000/svg","g").getBBox!==void 0&&(this.hasBBox=!0)}createMusicSystem(R,F){return new VexFlowMusicSystem(R,F)}createStaffLine(R,F){return new VexFlowStaffLine(R,F)}createSkyBottomLineCalculator(R){return R.ParentMusicSystem.rules.PerformanceMode&&this.hasBBox?new SkyBottomLineCalculatorSVG(R):new SkyBottomLineCalculator(R)}createGraphicalMeasure(R,F,D=!1){return new VexFlowMeasure(F,R,void 0)}createMultiRestMeasure(R,F,D){return new VexFlowMultiRestMeasure(F,R,D)}createTabStaffMeasure(R,F){return new VexFlowTabMeasure(F,R)}createExtraGraphicalMeasure(R){const F=new VexFlowMeasure(R.ParentStaff,void 0,R);return F.IsExtraGraphicalMeasure=!0,F.ExtraGraphicalMeasurePreviousMeasure=R.Measures.last(),F}createStaffEntry(R,F){return new VexFlowStaffEntry(F,R,void 0)}createVoiceEntry(R,F){return new VexFlowVoiceEntry(R,F)}createNote(R,F,D,G=OctaveEnum.NONE,U,W=void 0){return new VexFlowGraphicalNote(R,F,D,G,U,W)}createGraceNote(R,F,D,G,U=OctaveEnum.NONE){return new VexFlowGraphicalNote(R,F,D,U,G)}addGraphicalAccidental(R,F){R.setAccidental(F)}addFermataAtTiedEndNote(R,F){}createInStaffClef(R,F){const D=R,G=VexFlowConverter.Clef(F,"small");D.vfClefBefore=new VF$1.ClefNote(G.type,G.size,G.annotation)}createChordSymbols(R,F,D,G){const U=F.parentMeasure.parentSourceMeasure.Rules;let W=0;const q=U.ChordSymbolXSpacing;for(const Y of R.ChordContainers){const J=new GraphicalChordSymbolContainer(Y,F.PositionAndShape,U.ChordSymbolTextHeight,D,G,F.parentMeasure.parentSourceMeasure.Rules),Z=J.GraphicalLabel;Z.PositionAndShape.RelativePosition.y-=U.ChordSymbolYOffset,Z.PositionAndShape.RelativePosition.x+=W,Z.setLabelPositionAndShapeBorders(),J.PositionAndShape.calculateBoundingBox(),F.graphicalChordContainers.push(J),W+=Z.PositionAndShape.Size.width+q}}createGraphicalTechnicalInstruction(R,F){}}Vex.Flow;class GraphicalTie{constructor(R,F=void 0,D=void 0){this.tie=R,this.startNote=F,this.endNote=D}get SVGElement(){return this.vfTie.getAttribute("el")}get GetTie(){return this.tie}get StartNote(){return this.startNote}get Tie(){return this.tie}set StartNote(R){this.startNote=R}get EndNote(){return this.endNote}set EndNote(R){this.endNote=R}}class GraphicalLyricEntry{constructor(R,F,D,G){this.lyricsEntry=R,this.graphicalStaffEntry=F;const U=F.parentMeasure.parentSourceMeasure.Rules.LyricsAlignmentStandard;R.Text.length>=4&&R.Parent.Notes[0].Length.Denominator>4&&TextAlignmentEnum.LeftBottom;const W=new Label(R.Text);this.graphicalLabel=new GraphicalLabel(W,D,U,this.graphicalStaffEntry.parentMeasure.parentSourceMeasure.Rules,F.PositionAndShape),this.graphicalLabel.PositionAndShape.RelativePosition=new PointF2D(0,G),U===TextAlignmentEnum.LeftBottom&&(this.graphicalLabel.PositionAndShape.RelativePosition.x-=1)}get LyricsEntry(){return this.lyricsEntry}get ParentLyricWord(){return this.graphicalLyricWord}set ParentLyricWord(R){this.graphicalLyricWord=R}get GraphicalLabel(){return this.graphicalLabel}set GraphicalLabel(R){this.graphicalLabel=R}get StaffEntryParent(){return this.graphicalStaffEntry}set StaffEntryParent(R){this.graphicalStaffEntry=R}}class GraphicalLyricWord{constructor(R){this.graphicalLyricsEntries=[],this.lyricWord=R,this.initialize()}get GetLyricWord(){return this.lyricWord}get GraphicalLyricsEntries(){return this.graphicalLyricsEntries}set GraphicalLyricsEntries(R){this.graphicalLyricsEntries=R}isFilled(){for(let R=0;R=_GraphicalCurve.bezierCurveStepSize?new PointF2D:new PointF2D(_GraphicalCurve.oneMinusTPow3[R]*this.bezierStartPt.x+_GraphicalCurve.bezierFactorOne[R]*this.bezierStartControlPt.x+_GraphicalCurve.bezierFactorTwo[R]*this.bezierEndControlPt.x+_GraphicalCurve.tPow3[R]*this.bezierEndPt.x,_GraphicalCurve.oneMinusTPow3[R]*this.bezierStartPt.y+_GraphicalCurve.bezierFactorOne[R]*this.bezierStartControlPt.y+_GraphicalCurve.bezierFactorTwo[R]*this.bezierEndControlPt.y+_GraphicalCurve.tPow3[R]*this.bezierEndPt.y)}};let GraphicalCurve=_GraphicalCurve;GraphicalCurve.bezierCurveStepSize=1e3;const _GraphicalSlur=class extends GraphicalCurve{constructor(B,R){super(),this.staffEntries=[],this.slur=B,this.rules=R}static Compare(B,R){if(B.staffEntries.length<1)return-1;if(R.staffEntries.length<1)return 1;const F=Fraction$1.minus(B.staffEntries[B.staffEntries.length-1].getAbsoluteTimestamp(),B.staffEntries[0].getAbsoluteTimestamp()),D=Fraction$1.minus(R.staffEntries[R.staffEntries.length-1].getAbsoluteTimestamp(),R.staffEntries[0].getAbsoluteTimestamp());return F.RealValue>D.RealValue?1:D.RealValue>F.RealValue?-1:0}calculateCurve(B){const R=this.staffEntries[0],F=this.staffEntries[this.staffEntries.length-1];let D=R.findGraphicalNoteFromNote(this.slur.StartNote);!D&&this.graceStart&&(D=R.findGraphicalNoteFromGraceNote(this.slur.StartNote)),D||(D=R.findEndTieGraphicalNoteFromNoteWithStartingSlur(this.slur.StartNote,this.slur));let G=F.findGraphicalNoteFromNote(this.slur.EndNote);!G&&this.graceEnd&&(G=F.findGraphicalNoteFromGraceNote(this.slur.EndNote));const U=R.parentMeasure.ParentStaffLine,W=U.SkyBottomLineCalculator;this.calculatePlacement(W,U);const q=this.calculateStartAndEnd(D,G,U,B,W),Y=q.startX,J=q.endX;let Z=q.startY,K=q.endY;const te=B.SlurTangentMinAngle,Q=B.SlurTangentMaxAngle;let ie;if(this.placement===PlacementEnum.Above){Z-=B.SlurNoteHeadYOffset,K-=B.SlurNoteHeadYOffset;const se=new PointF2D(this.staffEntries[0].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[0].PositionAndShape.RelativePosition.x,Z);D?se.x+=this.staffEntries[0].PositionAndShape.BorderRight:se.x=this.staffEntries[0].parentMeasure.beginInstructionsWidth,this.graceStart&&(se.x+=F.PositionAndShape.RelativePosition.x);const ne=new PointF2D(this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].PositionAndShape.RelativePosition.x,K);if(G?ne.x+=this.staffEntries[this.staffEntries.length-1].PositionAndShape.BorderLeft:ne.x=this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.RelativePosition.x+this.staffEntries[this.staffEntries.length-1].parentMeasure.PositionAndShape.Size.width,this.graceEnd&&(ne.x+=F.staffEntryParent.PositionAndShape.RelativePosition.x),ie=this.calculateTopPoints(se,ne,U,W),ie.length===0){const Ge=new PointF2D((ne.x-se.x)/2+se.x,(ne.y-se.y)/2+se.y);ie.push(Ge)}const re=Math.atan((K-Z)/(J-Y)),ae=new PointF2D(0,0);let ce=new PointF2D(J-Y,-(K-Z));const he=Matrix2D.getRotationMatrix(re),fe=he.getTransposeMatrix();ce=he.vectorMultiplication(ce);const be=this.calculateTranslatedAndRotatedPointListAbove(ie,Y,Z,he);let ue=this.calculateMaxLeftSlope(be,ae,ce),ge=this.calculateMaxRightSlope(be,ae,ce);const ve=ae.y-ae.x*ue,Se=ce.y-ce.x*ge,pe=new PointF2D;let ye=!1;Math.abs(Math.abs(ue)-Math.abs(ge))<1e-4?(pe.x=ce.x/2,pe.y=0,ye=!0):(pe.x=(Se-ve)/(ue-ge),pe.y=ue*pe.x+ve);const Ee=this.calculateHeightWidthRatio(ce.x,be);let de=0,we=0;if(Math.abs(Ee)>.001){const Ge=Math.abs(ue/(Ee*2)),We=Math.abs(ue);de=Math.max(0,We*(Math.min(10,Ge-1)/10)),ue-=de;const Ve=Math.abs(ge/(Ee*2)),Ze=Math.abs(ge);we=Math.max(0,Ze*(Math.min(10,Ve-1)/10)),ge+=we}let Oe=te,Me=-te;if(!ye){const Ge=this.calculateAngles(te,ue,ge,Q);Oe=Ge.startAngle,Me=Ge.endAngle}const Pe=this.calculateControlPoints(ce.x,Oe,Me,be,Ee,Z,K);let Ne=Pe.startControlPoint,ke=Pe.endControlPoint;Ne=fe.vectorMultiplication(Ne),Ne.x+=Y,Ne.y=-Ne.y+Z,ke=fe.vectorMultiplication(ke),ke.x+=Y,ke.y=-ke.y+Z,this.bezierStartPt=new PointF2D(Y,Z-de),this.bezierStartControlPt=new PointF2D(Ne.x,Ne.y-de),this.bezierEndControlPt=new PointF2D(ke.x,ke.y-we),this.bezierEndPt=new PointF2D(J,K-we);const Ae=U.SkyLine.length,_e=W.getLeftIndexForPointX(this.bezierStartPt.x,Ae),Fe=W.getLeftIndexForPointX(this.bezierEndPt.x,Ae),Ye=this.bezierEndPt.x-this.bezierStartPt.x,Ce=W.SamplingUnit;for(let Ge=_e;Ge=_e&&(U.SkyLine[Ze]=Math.min(U.SkyLine[Ze],Ve.y)),Ze++,Ze.001){const Ge=Math.abs(ue/(Ee*2)),We=Math.abs(ue);de=Math.max(0,We*(Math.min(10,Ge-1)/10)),ue-=de;const Ve=Math.abs(ge/(Ee*2)),Ze=Math.abs(ge);we=Math.max(0,Ze*(Math.min(10,Ve-1)/10)),ge+=we}let Oe=te,Me=-te;if(!ye){const Ge=this.calculateAngles(te,ue,ge,Q);Oe=Ge.startAngle,Me=Ge.endAngle}const Pe=this.calculateControlPoints(ce.x,Oe,Me,be,Ee,Z,K);let Ne=Pe.startControlPoint,ke=Pe.endControlPoint;Ne=fe.vectorMultiplication(Ne),Ne.x+=Y,Ne.y+=Z,ke=fe.vectorMultiplication(ke),ke.x+=Y,ke.y+=Z,this.bezierStartPt=new PointF2D(Y,Z+de),this.bezierStartControlPt=new PointF2D(Ne.x,Ne.y+de),this.bezierEndControlPt=new PointF2D(ke.x,ke.y+we),this.bezierEndPt=new PointF2D(J,K+we);const Ae=U.BottomLine.length,_e=W.getLeftIndexForPointX(this.bezierStartPt.x,Ae),Fe=W.getLeftIndexForPointX(this.bezierEndPt.x,Ae),Ye=this.bezierEndPt.x-this.bezierStartPt.x,Ce=W.SamplingUnit;for(let Ge=_e;Ge=_e&&(U.BottomLine[Ze]=Math.max(U.BottomLine[Ze],Ve.y)),Ze++,Ze0){this.placement=PlacementEnum.Above;return}const F=this.staffEntries[0],D=this.staffEntries[this.staffEntries.length-1],G=F.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection,U=D.graphicalVoiceEntries[0].parentVoiceEntry.StemDirection;if(G===U)this.placement=G===StemDirectionType.Up?PlacementEnum.Below:PlacementEnum.Above;else{let W=F.PositionAndShape.BorderLeft+F.PositionAndShape.RelativePosition.x+F.parentMeasure.PositionAndShape.RelativePosition.x,q=D.PositionAndShape.BorderRight+D.PositionAndShape.RelativePosition.x+D.parentMeasure.PositionAndShape.RelativePosition.x;this.graceStart&&(W+=D.PositionAndShape.RelativePosition.x),this.graceEnd&&(q+=D.staffEntryParent.PositionAndShape.RelativePosition.x);const Y=B.getSkyLineMinInRange(W,q)*-1;B.getBottomLineMaxInRange(W,q)-R.StaffHeight>Y?this.placement=PlacementEnum.Above:this.placement=PlacementEnum.Below}}calculateTopPoints(B,R,F,D){const G=[];let U=D.getRightIndexForPointX(B.x,F.SkyLine.length),W=D.getLeftIndexForPointX(R.x,F.SkyLine.length);U<0&&(U=0),W>=F.SkyLine.length&&(W=F.SkyLine.length-1);for(let q=U;q=F.BottomLine.length&&(W=F.BottomLine.length-1);for(let q=U;qJ&&B>Z&&(Y+=B/70*this.rules.SlurHeightFlattenLongSlursFactorByWidth,Y*=1+R/30*this.rules.SlurHeightFlattenLongSlursFactorByAngle,q/=Y);const K=Math.min(.5,Math.max(.1,1.7*R/80*q*Math.pow(Math.max(G,.05),.4))),te=Math.min(.5,Math.max(.1,1.7*-F/80*q*Math.pow(Math.max(G,.05),.4))),Q=new PointF2D;Q.x=B*K*Math.cos(R*_GraphicalSlur.degreesToRadiansFactor),Q.y=B*K*Math.sin(R*_GraphicalSlur.degreesToRadiansFactor);const ie=new PointF2D;ie.x=B-B*te*Math.cos(F*_GraphicalSlur.degreesToRadiansFactor),ie.y=-(B*te*Math.sin(F*_GraphicalSlur.degreesToRadiansFactor));let se=Q.y-ie.y;for(;this.rules.SlurMaximumYControlPointDistance&&Math.abs(se)>this.rules.SlurMaximumYControlPointDistance;)se<0?(Q.y+=1,ie.y-=1):(Q.y-=1,ie.y+=1),se=Q.y-ie.y;return{startControlPoint:Q,endControlPoint:ie}}calculateAngles(B,R,F,D){let U=Math.atan(R)/_GraphicalSlur.degreesToRadiansFactor;R>0?U+=20:U-=20;let W=Math.atan(F)/_GraphicalSlur.degreesToRadiansFactor;F<0?W-=20:W+=20;const q=Math.min(Math.max(B,U),D),Y=Math.max(Math.min(-B,W),-D);return{startAngle:q,endAngle:Y}}};let GraphicalSlur=_GraphicalSlur;GraphicalSlur.degreesToRadiansFactor=Math.PI/180;class GraphicalPedal extends GraphicalObject{constructor(R,F){super(),this.getPedal=R,this.setSymbol(),this.PositionAndShape=new BoundingBox$1(this,F)}setSymbol(){!this.getPedal.IsLine&&this.getPedal.IsSign?this.pedalSymbol=MusicSymbol.PEDAL_SYMBOL:this.getPedal.IsLine&&this.getPedal.IsSign?this.pedalSymbol=MusicSymbol.PEDAL_MIXED:this.pedalSymbol=MusicSymbol.PEDAL_BRACKET}}class VexFlowPedal extends GraphicalPedal{constructor(R,F,D=!1,G=!1){switch(super(R,F),this.vfStyle=Vex.Flow.PedalMarking.Styles.BRACKET,this.ChangeBegin=!1,this.ChangeEnd=!1,this.line=-3,this.EndSymbolPositionAndShape=void 0,this.ChangeBegin=R.ChangeBegin,this.ChangeEnd=R.ChangeEnd,this.pedalSymbol){case MusicSymbol.PEDAL_SYMBOL:this.vfStyle=Vex.Flow.PedalMarking.Styles.TEXT,this.EndSymbolPositionAndShape=new BoundingBox$1(this,F);break;case MusicSymbol.PEDAL_MIXED:D&&G?this.vfStyle=Vex.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:D?this.vfStyle=Vex.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:G?this.vfStyle=Vex.Flow.PedalMarking.Styles.MIXED_OPEN_END:this.vfStyle=Vex.Flow.PedalMarking.Styles.MIXED;break;case MusicSymbol.PEDAL_BRACKET:default:D&&G?this.vfStyle=Vex.Flow.PedalMarking.Styles.BRACKET_OPEN_BOTH:D?this.vfStyle=Vex.Flow.PedalMarking.Styles.BRACKET_OPEN_BEGIN:G?this.vfStyle=Vex.Flow.PedalMarking.Styles.BRACKET_OPEN_END:this.vfStyle=Vex.Flow.PedalMarking.Styles.BRACKET;break}}setStartNote(R){if(!R)return!1;for(const F of R.graphicalVoiceEntries){const D=F;if(D!=null&&D.vfStaveNote)return this.startNote=D.vfStaveNote,this.startVfVoiceEntry=D,!0}return!1}setEndNote(R){if(!R)return!1;for(const F of R.graphicalVoiceEntries){const D=F;if(D!=null&&D.vfStaveNote)return this.endNote=D.vfStaveNote,this.endVfVoiceEntry=D,!0}return!1}setEndMeasure(R){this.endMeasure=R}CalculateBoundingBox(){}setLine(R){this.line=R}getPedalMarking(){var F,D,G,U;const R=new Vex.Flow.PedalMarking([this.startNote,this.endNote]);return this.endMeasure&&R.setEndStave(this.endMeasure.getVFStave()),R.setStyle(this.vfStyle),R.setLine(this.line),R.setCustomText(this.DepressText,this.ReleaseText),(((F=this.endVfVoiceEntry)==null?void 0:F.parentStaffEntry)===((U=(G=(D=this.endVfVoiceEntry)==null?void 0:D.parentStaffEntry)==null?void 0:G.parentMeasure)==null?void 0:U.staffEntries.last())||!this.endVfVoiceEntry)&&(R.EndsStave=!0),R.ChangeBegin=this.ChangeBegin,R.ChangeEnd=this.ChangeEnd,R}}class GraphicalWavyLine extends GraphicalObject{constructor(R,F){super(),this.getWavyLine=R,this.PositionAndShape=new BoundingBox$1(this,F)}}class VexflowVibratoBracket extends GraphicalWavyLine{constructor(R,F,D=!1){super(R,F),this.line=1,this.isVibrato=!1,this.toEndOfStopStave=!1,this.isVibrato=D}get ToEndOfStopStave(){return this.toEndOfStopStave}setStartNote(R){for(const F of R.graphicalVoiceEntries){const D=F;if(D!=null&&D.vfStaveNote)return this.startNote=D.vfStaveNote,this.startVfVoiceEntry=D,!0}return!1}setEndNote(R){for(const F of R.graphicalVoiceEntries){const D=F;if(D!=null&&D.vfStaveNote){this.endNote=D.vfStaveNote,this.endVfVoiceEntry=D;const G=this.endVfVoiceEntry.parentStaffEntry.parentMeasure.staffEntries,U=G[G.length-1];return this.toEndOfStopStave=U===this.endVfVoiceEntry.parentStaffEntry,!0}}return!1}CalculateBoundingBox(){const R=this.getVibratoBracket();this.boundingBox.Size.height=R.render_options.wave_height*.2}getVibratoBracket(){const R=new Vex.Flow.VibratoBracket({start:this.startNote,stop:this.endNote,toEndOfStopStave:this.toEndOfStopStave});return R.setLine(this.line),this.isVibrato?R.render_options.vibrato_width=20:R.render_options.wave_girth=4,R}}const VF=Vex.Flow;class VexFlowMusicSheetCalculator extends MusicSheetCalculator{constructor(R){var F,D,G,U,W,q,Y,J;super(),this.beamsNeedUpdate=!1,this.rules=R,MusicSheetCalculator.symbolFactory=new VexFlowGraphicalSymbolFactory,MusicSheetCalculator.TextMeasurer=new VexFlowTextMeasurer(this.rules),MusicSheetCalculator.stafflineNoteCalculator=new VexflowStafflineNoteCalculator(this.rules),((F=this.rules.DefaultVexFlowNoteFont)==null?void 0:F.toLowerCase())==="gonville"?Vex.Flow.DEFAULT_FONT_STACK=[(D=Vex.Flow.Fonts)==null?void 0:D.Gonville,(G=Vex.Flow.Fonts)==null?void 0:G.Bravura,(U=Vex.Flow.Fonts)==null?void 0:U.Custom]:((W=this.rules.DefaultVexFlowNoteFont)==null?void 0:W.toLowerCase())==="petaluma"&&(Vex.Flow.DEFAULT_FONT_STACK=[(q=Vex.Flow.Fonts)==null?void 0:q.Petaluma,(Y=Vex.Flow.Fonts)==null?void 0:Y.Gonville,(J=Vex.Flow.Fonts)==null?void 0:J.Bravura])}clearRecreatedObjects(){super.clearRecreatedObjects(),MusicSheetCalculator.stafflineNoteCalculator=new VexflowStafflineNoteCalculator(this.rules);for(const R of this.graphicalMusicSheet.MeasureList)for(const F of R)F==null||F.clean()}formatMeasures(){for(const R of this.graphicalMusicSheet.MeasureList){if(!R||!R[0])continue;R[0].format();for(const D of R){for(const G of D.staffEntries)G.calculateXPosition();D.finalizeBeams()}}this.beamsNeedUpdate=!1}calculateMeasureXLayout(R){const F=[];for(const Z of R)Z&&F.push(Z);if(F.length===0)return 0;R=F;const D=[],G=new VF.Formatter({softmaxFactor:this.rules.SoftmaxFactorVexFlow});let U=R[0].staffEntries.length,W=1;for(const Z of R){if(!Z)continue;let K=0;for(const ie of Z.staffEntries)K+=ie.setMaxAccidentals();Z.parentSourceMeasure.ImplicitMeasure&&(U=Math.max(Z.staffEntries.length,U),W=Math.max(Z.staffEntries.length+K,W));const te=Z.vfVoices,Q=[];for(const ie in te)te.hasOwnProperty(ie)&&(Q.push(te[ie]),D.push(te[ie]));if(Q.length===0){log$2.debug("Found a measure with no voices. Continuing anyway.",te);continue}G.joinVoices(Q)}let q=12;const Y=R[0].parentSourceMeasure,J=.3;if(D.length>0){q=G.preCalculateMinTotalWidth(D)/unitInPixels*this.rules.VoiceSpacingMultiplierVexflow+this.rules.VoiceSpacingAddendVexflow+U*J,Y!=null&&Y.ImplicitMeasure&&(q=Y.Duration.RealValue/Y.ActiveTimeSignature.RealValue*q,U>1&&(q+=W*J*1.5),q*=this.rules.PickupMeasureWidthMultiplier),MusicSheetCalculator.setMeasuresMinStaffEntriesWidth(R,q);const Z=(te,Q)=>{G.formatToStave(D,Q.getVFStave())},K=(te,Q)=>{G.formatToStave(D,Q.getVFStave(),{align_rests:!0,context:void 0})};for(const te of R){if(this.rules.AlignRests===AlignRestOption.Never)te.formatVoices=Z;else if(this.rules.AlignRests===AlignRestOption.Always)te.formatVoices=K;else if(this.rules.AlignRests===AlignRestOption.Auto){let Q=!1;for(const ie of te.staffEntries){let se=0,ne=0;for(const re of ie.graphicalVoiceEntries)if(re.parentVoiceEntry.IsGrace||re&&re.notes&&re.notes[0]&&re.notes[0].sourceNote&&re.notes[0].sourceNote.PrintObject&&se++,re&&re.notes&&re.notes[0]&&re.notes[0].sourceNote&&re.notes[0].sourceNote.isRest()&&re.notes[0].sourceNote.PrintObject&&ne++,se>1&&ne>=1){Q=!0;break}if(Q)break}Q?te.formatVoices=K:te.formatVoices=Z}if(te===R[0]){const Q=te;Q.formatVoices(q*unitInPixels,Q)}}}for(const Z of R)if(!!Z)for(const K of Z.staffEntries)K.calculateXPosition();for(const Z of R){if(!Z)continue;const K=Z.vfVoices,te=[];for(const Q in K)K.hasOwnProperty(Q)&&te.push(K[Q]);if(te.length===0){log$2.debug("Found a measure with no voices. Continuing anyway.",K);continue}G.joinVoices(te)}return q}calculateElongationFactor(R,F,D,G,U,W,q,Y){let J=U,Z=0;for(const K of R){const te=K.GraphicalLabel.Label.textAlignment;let Q=q,ie=Y;if(K instanceof GraphicalLyricEntry&&K.ParentLyricWord){K.LyricsEntry.SyllableIndex>0&&(Q=this.rules.BetweenSyllableMinimumDistance,TextAlignment.IsCenterAligned(te)&&(Q+=1));const ye=K.ParentLyricWord.GetLyricWord.Syllables;ye.length>1&&K.LyricsEntry.SyllableIndex4&&(Se*=1.1)}}else D[Z]&&(Se=ce/he);ge=Math.max(ve,Se),J=Math.max(J,ge);let pe=Math.max(ce-he||0,0);D[Z]&&(pe+=D[Z].cumulativeOverlap),D[Z]={cumulativeOverlap:pe,extend:K instanceof GraphicalLyricEntry?K.LyricsEntry.extend:!1,labelWidth:ne,measureNumber:W,sourceNoteDuration:K instanceof GraphicalLyricEntry?K.LyricsEntry&&K.LyricsEntry.Parent.Notes[0].Length:!1,text:K instanceof GraphicalLyricEntry?K.LyricsEntry.Text:K.GraphicalLabel.Label.text,xPosition:ae},Z++}return J}calculateElongationFactorFromStaffEntries(R,F,D,G){let U=D;const W={},q={};for(const Y of R)Y.LyricsEntries.length>0&&(U=this.calculateElongationFactor(Y.LyricsEntries,Y,W,F,U,G,this.rules.HorizontalBetweenLyricsDistance,this.rules.LyricOverlapAllowedIntoNextMeasure)),Y.graphicalChordContainers.length>0&&(U=this.calculateElongationFactor(Y.graphicalChordContainers,Y,q,F,U,G,this.rules.ChordSymbolXSpacing,this.rules.ChordOverlapAllowedIntoNextMeasure));return U}calculateMeasureWidthFromStaffEntries(R,F){let D=1;for(const U of R)!U||U.staffEntries.length===0||(D=this.calculateElongationFactorFromStaffEntries(U.staffEntries,F,D,U.MeasureNumber));return D=Math.min(D,this.rules.MaximumLyricsElongationFactor),F*D}createGraphicalTie(R,F,D,G,U){return new GraphicalTie(R,G,U)}updateStaffLineBorders(R){R.SkyBottomLineCalculator.updateStaffLineBorders()}graphicalMeasureCreatedCalculations(R){R.rules=this.rules,R.graphicalMeasureCreatedCalculations()}layoutVoiceEntry(R,F,D,G){for(let U=0;U=2&&(W=G.vfnote[0],q=G.vfnote[1]);let Y,J=0;if(U&&U.vfnote&&U.vfnote.length>=2&&(Y=U.vfnote[0],J=U.vfnote[1]),F){if(W){const Z=new VF.StaveTie({first_indices:[q],first_note:W});G.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(Z,R)}if(Y){const Z=new VF.StaveTie({last_indices:[J],last_note:Y});U.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(Z,R)}}else if(W||Y){let Z;if(D)if(R.Tie.Type==="S"){const te=R.StartNote.sourceNote,Q=R.EndNote.sourceNote;let ie=1;te.FretNumber>Q.FretNumber&&(ie=-1),Z=new VF.TabSlide({first_indices:[q],first_note:W,last_indices:[J],last_note:Y},ie)}else Z=new VF.TabTie({first_indices:[q],first_note:W,last_indices:[J],last_note:Y},R.Tie.Type);else{Z=new VF.StaveTie({first_indices:[q],first_note:W,last_indices:[J],last_note:Y});const te=R.Tie.getTieDirection(G.sourceNote);te===PlacementEnum.Below?Z.setDirection(1):te===PlacementEnum.Above&&Z.setDirection(-1);try{Math.abs((W==null?void 0:W.getTieRightX())-(Y==null?void 0:Y.getTieLeftX()))<10&&(Z.render_options.first_x_shift=-3,Z.render_options.last_x_shift=3)}catch(Q){console.log(Q)}}U.parentVoiceEntry.parentStaffEntry.parentMeasure.addStaveTie(Z,R)}}calculateDynamicExpressionsForMultiExpression(R,F,D){if(Fthis.rules.MaxMeasureToDrawIndex)return;const G=R.AbsoluteTimestamp,U=this.graphicalMusicSheet.MeasureList[F],W=U[D].ParentStaffLine,q=U[D];if(!W)return;const Y=this.getRelativePositionInStaffLineFromTimestamp(G,D,W,W==null?void 0:W.isPartOfMultiStaffInstrument());if(Y.x<=0&&(Y.x=q.beginInstructionsWidth+this.rules.RhythmRightMargin),R.InstantaneousDynamic){const J=new VexFlowInstantaneousDynamicExpression(R.InstantaneousDynamic,W,q);this.calculateGraphicalInstantaneousDynamicExpression(J,Y,G),this.dynamicExpressionMap.set(G.RealValue,J.PositionAndShape)}if(R.StartingContinuousDynamic){const J=R.StartingContinuousDynamic,Z=new VexFlowContinuousDynamicExpression(R.StartingContinuousDynamic,W,q.parentSourceMeasure);if(Z.StartMeasure=q,!Z.IsVerbal&&J.EndMultiExpression)try{this.calculateGraphicalContinuousDynamic(Z,Y),Z.updateSkyBottomLine()}catch{}else Z.IsVerbal?this.calculateGraphicalVerbalContinuousDynamic(Z,Y):log$2.warn("This continuous dynamic is not covered. measure"+R.SourceMeasureParent.MeasureNumber)}}createMetronomeMark(R,F){var ae,ce,he,fe,be,ue,ge,ve,Se;const D=Math.max(R.ParentMultiTempoExpression.SourceMeasureParent.MeasureNumber-1,0),G=F||D,U=Math.max(R.StaffNumber-1,0),W=this.graphicalMusicSheet.MeasureList[G][U].getVFStave();let q="q";if(R.beatUnit){const pe=NoteTypeHandler.getNoteDurationFromType(R.beatUnit);q=VexFlowConverter.durations(pe,!1)[0]}let Y=this.rules.MetronomeMarkYShift,J=!1;const Z=[];if(R.parentMeasure){for(const pe of R.parentMeasure.StaffLinkedExpressions)for(const ye of pe)ye&&ye instanceof UnknownExpression&&Z.push(ye);for(const pe of R.parentMeasure.TempoExpressions){const ye=((ae=pe.InstantaneousTempo)==null?void 0:ae.Enum)===TempoEnum.metronomeMark;if(!R.beatUnit&&pe.InstantaneousTempo.beatUnit){const Ee=NoteTypeHandler.getNoteDurationFromType(R.beatUnit);q=VexFlowConverter.durations(Ee,!1)[0]}if(pe.getPlacementOfFirstEntry()===PlacementEnum.Above&&!ye){J=!0;break}}}J&&(Y-=1.4);const K=(ce=this.graphicalMusicSheet.MeasureList[0][0].ParentStaffLine)==null?void 0:ce.SkyLine;let te=R.TempoInBpm,Q="",ie="",se="";for(const pe of this.graphicalMusicSheet.MeasureList[G][U].parentSourceMeasure.TempoExpressions){if(ie=pe.CombinedExpressionsText,isSpecialMark(pe.CombinedExpressionsText)){Q=pe.CombinedExpressionsText;break}if(isSpeedKeyword(pe.CombinedExpressionsText)||isSpeedHiddenKeyword(pe.CombinedExpressionsText)){Q=formatSpeedKeyword(pe.CombinedExpressionsText),te=pe.sourceMeasure.TempoInBPM,isSpeedKeyword(pe.CombinedExpressionsText)&&(se=q);break}}const ne={bpm:R.TempoInBpm,dots:R.dotted,duration:q,name:Q};Q&&(ne.bpm=te/(ne.dots?1.5:1),isSpeedKeyword(ie)?ne.duration=se:(te===SpeedTag[Q]||!SpeedTag[Q])&&(ne.duration=""));const re=((fe=(he=this.graphicalMusicSheet.MeasureList[G][U].vfVoices)==null?void 0:he[1])==null?void 0:fe.boundingBox.y)||0;if(this.rules.MetronomeMarksDrawn){if(K){const de=((ue=(be=this.graphicalMusicSheet.MeasureList[0])==null?void 0:be[U])==null?void 0:ue.ParentStaffLine).Measures.map(we=>we.MeasureNumber-1);if(re&&de.includes(G)&&(isSpeedKeyword(ie)||isSpeedHiddenKeyword(ie))){const we=K.slice(0,9);let Oe=Math.min(...we);Oe=Oe<0?Oe-1:Oe,Y+=Oe}de.includes(G)&&Z.length?K[0]=Math.min(K[0],-4.5+Y-4):K[0]=Math.min(K[0],-4.5+Y)}W.options.line_config.reduce((Ee,de)=>(de.visible&&Ee++,Ee),0)<5&&(Y-=2),W.setTempo(ne,Y*unitInPixels);let ye=0;try{ye+=((Se=(ve=(ge=this.graphicalMusicSheet.MeasureList[G][U])==null?void 0:ge.vfVoices)==null?void 0:ve[1])==null?void 0:Se.getTickables())[R.parentMeasure.metronomeNoteIndex].getBoundingBox().getX()-W.getNoteStartX()}catch{}W.getModifiers()[W.getModifiers().length-1].setShiftX(ye)}}calculateRehearsalMark(R){var te,Q,ie,se,ne;const F=R.rehearsalExpression;if(!F)return;const D=this.graphicalMusicSheet.MeasureList[0][0].MeasureNumber,G=Math.max(R.measureListIndex+1-D,0),U=0,W=(te=this.graphicalMusicSheet.MeasureList[G][U])==null?void 0:te.getVFStave();if(!W)return;const q=-this.rules.RehearsalMarkYOffsetDefault-this.rules.RehearsalMarkYOffset;let Y=this.rules.RehearsalMarkXOffsetDefault+this.rules.RehearsalMarkXOffset;R.IsSystemStartMeasure&&(Y+=this.rules.RehearsalMarkXOffsetSystemStartMeasure);const J=this.rules.RehearsalMarkFontSize,Z=W.getModifiers(),K=Z.find(re=>re.getCategory().toLocaleLowerCase()==="repetitions");if(K&&K.setShiftY(K.y_shift-10),W.setSection(F.label,q,Y,J),(Q=this.graphicalMusicSheet.MeasureList[G][U])!=null&&Q.ParentStaffLine.AbstractExpressions){const re=Z.find(ae=>ae.getCategory().toLocaleLowerCase()==="stavesection");for(let ae of((ne=(se=(ie=R==null?void 0:R.VerticalMeasureList)==null?void 0:ie[0])==null?void 0:se.ParentStaffLine)==null?void 0:ne.AbstractExpressions)||[])ae instanceof GraphicalUnknownExpression&&(re&&(ae.Label.PositionAndShape.RelativePosition.y-=.5),K&&(ae.Label.PositionAndShape.RelativePosition.y-=1.7))}}calculateSingleOctaveShift(R,F,D,G){var ie;const U=F.OctaveShiftStart,W=U.ParentStartMultiExpression.Timestamp,q=(ie=U.ParentEndMultiExpression)==null?void 0:ie.Timestamp,Y=this.rules.MinMeasureToDrawIndex,J=this.rules.MaxMeasureToDrawIndex;let Z=this.graphicalMusicSheet.MeasureList[D][G].ParentStaffLine;Z||(Z=this.graphicalMusicSheet.MeasureList[Y][G].ParentStaffLine);let K;U.ParentEndMultiExpression?K=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(U.ParentEndMultiExpression.SourceMeasureParent,G):K=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(G,!0),K.MeasureNumber>J+1&&(K=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(G,!0));let te;if(U.ParentEndMultiExpression?te=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(U.ParentStartMultiExpression.SourceMeasureParent,G):te=this.graphicalMusicSheet.MeasureList[Y][G],te.MeasureNumberJ||K.parentSourceMeasure.measureListIndexJ)return;let Q=K.ParentStaffLine;if(Q||(Q=Z),K&&Z&&Q){const se=new VexFlowOctaveShift(U,Z.PositionAndShape);if(!se.startNote){let ae;for(const ce of te.staffEntries)if(ce){ae=ce;break}if(!ae||(se.setStartNote(ae),!se.startNote))return}if(!se.endNote){let ae;for(let ce=K.staffEntries.length-1;ce>=0;ce++)if(K.staffEntries[ce]){ae=K.staffEntries[ce];break}if(se.setEndNote(ae),!se.endNote)return}let ne=te.findGraphicalStaffEntryFromTimestamp(W);ne||(ne=te.staffEntries[0]);let re=K.findGraphicalStaffEntryFromTimestamp(q);if(re||(re=K.staffEntries[K.staffEntries.length-1]),se.setStartNote(ne),Q!==Z){se.endsOnDifferentStaffLine=!0;let ae=Z.Measures[Z.Measures.length-1];ae===void 0&&(ae=K);const ce=ae.staffEntries[ae.staffEntries.length-1];se.setEndNote(ce);const he=Q.ParentMusicSystem.Id-Z.ParentMusicSystem.Id;if(he>0)for(let fe=Z.ParentMusicSystem.Id;feJ+1&&(K=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(G,!0));let te;if(U.ParentEndMultiExpression?te=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(U.ParentStartMultiExpression.SourceMeasureParent,G):(te=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(U.ParentStartMultiExpression.SourceMeasureParent,G),te||(te=this.graphicalMusicSheet.MeasureList[Y][G])),te.MeasureNumberJ||K.parentSourceMeasure.measureListIndexJ)return;let Q=K.ParentStaffLine;if(Q||(Q=Z),K&&Z&&Q){let se=!1;Z!==Q&&(se=!0);const ne=new VexFlowPedal(U,Z.PositionAndShape,!1,se);let re=te.findGraphicalStaffEntryFromTimestamp(W);re||(re=te.staffEntries[0]);let ae=K.findGraphicalStaffEntryFromTimestamp(q);if(ae||(ae=K.staffEntries[K.staffEntries.length-1]),!ne.setStartNote(re))return;if(Q!==Z)if(ne.pedalSymbol===MusicSymbol.PEDAL_SYMBOL){ne.setEndNote(ae),ne.setEndMeasure(K),ne.ReleaseText=" ",ne.CalculateBoundingBox(),this.calculatePedalSkyBottomLine(ne.startVfVoiceEntry,ne.endVfVoiceEntry,ne,Z);const ce=Q.Measures[0],he=new VexFlowPedal(U,ce.PositionAndShape),fe=ce.staffEntries[0];if(!he.setStartNote(fe))return;he.setEndNote(ae),ne.setEndMeasure(K),Q.Pedals.push(he),he.CalculateBoundingBox(),he.DepressText=" ",this.calculatePedalSkyBottomLine(he.startVfVoiceEntry,he.endVfVoiceEntry,he,Q)}else{let ce=Z.Measures[Z.Measures.length-1];ce===void 0&&(ce=K);const he=ce.staffEntries[ce.staffEntries.length-1];ne.setEndNote(he),ne.setEndMeasure(K),ne.ChangeEnd=!1;const fe=Q.ParentMusicSystem.Id-Z.ParentMusicSystem.Id;if(fe>0){let be=1;for(let ue=Z.ParentMusicSystem.Id;ueJ+1&&(K=this.graphicalMusicSheet.getLastGraphicalMeasureFromIndex(G,!0));let te;if(U.ParentEndMultiExpression?te=this.graphicalMusicSheet.getGraphicalMeasureFromSourceMeasureAndIndex(U.ParentStartMultiExpression.SourceMeasureParent,G):te=this.graphicalMusicSheet.MeasureList[Y][G],te.MeasureNumberJ||K.parentSourceMeasure.measureListIndexJ)return;let Q=K.ParentStaffLine;if(Q||(Q=Z),K&&Z&&Q){const ne=new VexflowVibratoBracket(U,Z.PositionAndShape,te.ParentStaff.isTab);let re=te.findGraphicalStaffEntryFromTimestamp(W);re||(re=te.staffEntries[0]);let ae=K.findGraphicalStaffEntryFromTimestamp(q);if(ae||(ae=K.staffEntries[K.staffEntries.length-1]),ne.setStartNote(re),Q!==Z){let ce=Z.Measures[Z.Measures.length-1];ce===void 0&&(ce=K);const he=ce.staffEntries[ce.staffEntries.length-1];if(ne.setEndNote(he),Q.ParentMusicSystem.Id-Z.ParentMusicSystem.Id>0)for(let be=Z.ParentMusicSystem.Id;beK){const ce=K;K=Z,Z=ce}G.SkyBottomLineCalculator.updateBottomLineInRange(Z,K,te+re)}for(const re of G.Pedals){const ae=re,ce=ae.getPedalMarking(),he=ce.line+3+(G.StaffLines.length-1);if(te>he){const fe=ce.render_options.text_margin_right/10;let be=ae.startVfVoiceEntry.PositionAndShape.AbsolutePosition.x-fe,ue;ae.setLine(te-3-(G.StaffLines.length-1));let ge=(ie=ae.endVfVoiceEntry)==null?void 0:ie.PositionAndShape;if(ge||(ge=ae.endMeasure.PositionAndShape),ae.EndSymbolPositionAndShape){const ve=q.render_options.glyph_point_size/20;ue=be+3.4;const Se=ge.AbsolutePosition.x-fe,pe=Se+1.5;G.SkyBottomLineCalculator.updateBottomLineInRange(be,ue,te+ve),G.SkyBottomLineCalculator.updateBottomLineInRange(Se,pe,te+ve)}else{const ve=ce.render_options.bracket_height/10;if(ce.EndsStave)ue=ge.AbsolutePosition.x+ge.Size.width-fe;else switch(q.style){case W.BRACKET_OPEN_END:case W.BRACKET_OPEN_BOTH:case W.MIXED_OPEN_END:ue=ge.AbsolutePosition.x+ge.BorderRight-fe;break;default:ue=ge.AbsolutePosition.x+ge.BorderLeft-fe;break}const Se=(ne=(se=ae.endVfVoiceEntry)==null?void 0:se.parentStaffEntry)==null?void 0:ne.vfClefBefore;if(Se&&(ue+=Se.getWidth()/10),be>ue){const pe=be;be=ue,ue=pe}G.SkyBottomLineCalculator.updateBottomLineInRange(be,ue,te+ve)}}}}calculateOctaveShiftSkyBottomLine(R,F,D,G){if(!F){log$2.warn("octaveshift: no endStaffEntry");return}let U=R.PositionAndShape.Size.width,W=F.PositionAndShape.Size.width;R.hasOnlyRests()?U=-U:U/=2,F.hasOnlyRests()?W*=2:W/=2,R===F&&(W*=2);const q=R.PositionAndShape.AbsolutePosition.x-U,Y=F.PositionAndShape.AbsolutePosition.x+W;D.PositionAndShape.Size.width=q-Y;const J=D.getTextBracket(),Z=J.font.size/10;if(J.position===VF.TextBracket.Positions.TOP){const K=Math.ceil(G.SkyBottomLineCalculator.getSkyLineMinInRange(q,Y));if(K===1/0)return;J.start.getStave().options.top_text_position=Math.abs(K),G.SkyBottomLineCalculator.updateSkyLineInRange(q,Y,K-Z*2)}else{const K=G.SkyBottomLineCalculator.getBottomLineMaxInRange(q,Y);if(K===1/0)return;J.start.getStave().options.bottom_text_position=K,R.parentMeasure!==F.parentMeasure&&(J.stop.getStave().options.bottom_text_position=K),G.SkyBottomLineCalculator.updateBottomLineInRange(q,Y,K+Z*1.5)}}calculateWordRepetitionInstruction(R,F){let D;const G=this.graphicalMusicSheet.MeasureList[F];for(let U=0,W=G.length;U{D.updateSkyBottomLine()})}catch{}}handleTiedGraphicalNote(R,F,D,G,U,W,q,Y){}handleBeam(R,F,D){R.parentVoiceEntry.parentStaffEntry.parentMeasure.handleBeam(R,F)}handleVoiceEntryLyrics(R,F,D){R.LyricsEntries.forEach((G,U)=>{const W=new GraphicalLyricEntry(U,F,this.rules.LyricsHeight,this.rules.StaffHeight);if(F.LyricsEntries.push(W),W.GraphicalLabel.setLabelPositionAndShapeBorders(),U.Word){const Y=U.Word.Syllables.indexOf(U);let J=D.indexOf(U.Word);if(J===-1&&(D.push(U.Word),J=D.indexOf(U.Word)),this.graphicalLyricWords.length===0||J>this.graphicalLyricWords.length-1){const Z=new GraphicalLyricWord(U.Word);W.ParentLyricWord=Z,Z.GraphicalLyricsEntries[Y]=W,this.graphicalLyricWords.push(Z)}else{const Z=this.graphicalLyricWords[J];W.ParentLyricWord=Z,Z.GraphicalLyricsEntries[Y]=W,Z.isFilled()&&(D.splice(J,1),this.graphicalLyricWords.splice(this.graphicalLyricWords.indexOf(Z),1))}}})}handleVoiceEntryOrnaments(R,F,D){}handleVoiceEntryArticulations(R,F,D){}handleVoiceEntryTechnicalInstructions(R,F,D){}handleTuplet(R,F,D){R.parentVoiceEntry.parentStaffEntry.parentMeasure.handleTuplet(R,F)}findIndexGraphicalSlurFromSlur(R,F){for(let D=0;D=0){const K=G[Z];K.staffEntries.indexOf(W)===-1&&K.staffEntries.push(W),G.splice(Z,1)}}}for(const q of G)q.staffEntries.indexOf(W)===-1&&q.staffEntries.push(W)}}for(const F of this.musicSystems)for(const D of F.StaffLines){const G=D.GraphicalSlurs.sort(GraphicalSlur.Compare);for(const U of G)U.slur.isCrossed()||U.calculateCurve(this.rules)}}}class MusicPartManager{constructor(R){this.musicSheet=R}reInit(){this.init()}init(){this.parts=this.musicSheet.Repetitions.slice(),this.sheetStart=this.musicSheet.SelectionStart=new Fraction$1(0,1),this.sheetEnd=this.musicSheet.SelectionEnd=this.musicSheet.SheetEndTimestamp,this.calcMapping()}getCurrentRepetitionTimestampTransform(R){let F;for(let D=this.timestamps.length-1;D>=0;D--)if(F=this.timestamps[D],R.gte(F.from))return F;return this.timestamps[0]}absoluteEnrolledToSheetTimestamp(R){if(this.timestamps.length===0)return R;const F=this.getCurrentRepetitionTimestampTransform(R);return Fraction$1.plus(R,Fraction$1.minus(F.to,F.from))}get Parts(){return this.parts}get MusicSheet(){return this.musicSheet}getIterator(R){return R?new MusicPartManagerIterator(this.musicSheet,R,void 0):new MusicPartManagerIterator(this.musicSheet,this.musicSheet.SelectionStart,this.musicSheet.SelectionEnd)}setSelectionStart(R){this.musicSheet.SelectionStart=R,this.musicSheet.SelectionEnd=void 0}setSelectionRange(R,F){this.musicSheet.SelectionStart=R!=null?R:this.sheetStart,this.musicSheet.SelectionEnd=F!=null?F:this.sheetEnd}calcMapping(){this.timestamps=[];const R=this.getIterator();let F=R.CurrentRepetition,D=new TimestampTransform(R.CurrentEnrolledTimestamp.clone(),R.CurrentSourceTimestamp.clone(),void 0,0);for(this.timestamps.push(D);!R.EndReached;){if(R.JumpOccurred||F!==R.CurrentRepetition){if(F=R.CurrentRepetition,R.backJumpOccurred){const G=R.JumpResponsibleRepetition;D.nextBackJump=R.CurrentEnrolledTimestamp,D.curRepetition=G,D.curRepetitionIteration=R.CurrentJumpResponsibleRepetitionIterationBeforeJump;for(let U=this.timestamps.length-2;U>=0&&!(G.AbsoluteTimestamp.gt(this.timestamps[U].to)||this.timestamps[U].curRepetition);U--)this.timestamps[U].nextBackJump=D.nextBackJump,this.timestamps[U].curRepetition=G,this.timestamps[U].curRepetitionIteration=D.curRepetitionIteration}D=new TimestampTransform(R.CurrentEnrolledTimestamp.clone(),R.CurrentSourceTimestamp.clone(),void 0,0),this.timestamps.push(D)}R.moveToNext()}}}class TimestampTransform{constructor(R,F,D,G){this.from=R,this.to=F,this.curRepetition=D,this.curRepetitionIteration=G,this.nextBackJump=void 0,this.nextForwardJump=void 0}}class PartListEntry{constructor(R){this.enrolledTimestamps=[],this.visible=!0,this.musicSheet=R}get Visible(){return this.visible}set Visible(R){this.visible=R}getFirstSourceMeasure(){return this.musicSheet.SourceMeasures[this.startIndex]}getLastSourceMeasure(){return this.musicSheet.SourceMeasures[this.endIndex]}}class SourceMusicPart extends PartListEntry{constructor(R,F,D){super(R),this.musicSheet=R,this.startIndex=F,this.endIndex=D}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(R){this.parentRepetition=R}get AbsoluteTimestamp(){return Fraction$1.createFromFraction(this.musicSheet.SourceMeasures[this.startIndex].AbsoluteTimestamp)}setStartIndex(R){this.startIndex=R}setEndIndex(R){this.endIndex=R}}class Repetition extends PartListEntry{constructor(R,F=!1){super(R),this.backwardJumpInstructions=[],this.endingParts=[],this.endingIndexDict={},this.userNumberOfRepetitions=0,this.visibles=[],this.fromWords=!1,this.repetitonIterationOrder=[],this.numberOfEndings=1,this.musicSheet2=R,this.virtualOverallRepetition=F}get BackwardJumpInstructions(){return this.backwardJumpInstructions}get EndingIndexDict(){return this.endingIndexDict}get EndingParts(){return this.endingParts}get Visibles(){return this.visibles}set Visibles(R){this.visibles=R}get DefaultNumberOfRepetitions(){let R=2;return this.virtualOverallRepetition&&(R=1),Math.max(R,Object.keys(this.endingIndexDict).length,this.checkRepetitionForMultipleLyricVerses())}get UserNumberOfRepetitions(){return this.userNumberOfRepetitions}set UserNumberOfRepetitions(R){this.userNumberOfRepetitions=R,this.repetitonIterationOrder=[];const F=this.userNumberOfRepetitions-this.NumberOfEndings;for(let D=1;D<=this.userNumberOfRepetitions;D++)D<=F?this.repetitonIterationOrder.push(1):this.repetitonIterationOrder.push(D-F)}getForwardJumpTargetForIteration(R){const F=this.repetitonIterationOrder[R-1];return this.endingIndexDict[F]?this.endingIndexDict[F].part.StartIndex:-1}getBackwardJumpTarget(){return this.startMarker.measureIndex}setEndingsStartIndex(R,F){const D=new RepetitionEndingPart(new SourceMusicPart(this.musicSheet2,F,F));this.endingParts.push(D);for(const G of R)try{this.endingIndexDict[G]=D,D.endingIndices.push(G),this.numberOfEndings0&&(G=1),U.Add(new Fraction$1(G,F)),U}}class MusicSheet$1{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 MusicSheetErrors,this.staves=[],this.playbackDataDict=new Dictionary,this.transpose=0,this.defaultStartTempoInBpm=0,this.drawErroneousMeasures=!1,this.hasBeenOpenedForTheFirstTime=!1,this.currentEnrolledPosition=new Fraction$1(0,1),this.soundTempos=new Map,this.playbackSettings=new PlaybackSettings,this.playbackSettings.rhythm=new Fraction$1(4,4,0,!1),this.userStartTempoInBPM=100,this.pageWidth=120,this.MusicPartManager=new MusicPartManager(this),this.hasBPMInfo=!1}get SoundTempos(){return this.soundTempos}set SoundTempos(R){this.soundTempos=R}static getIndexFromStaff(R){return R.idInMusicSheet}get CurrentKeyInstruction(){return this.currentKeyInstruction}set CurrentKeyInstruction(R){this.currentKeyInstruction=R}get SourceMeasures(){return this.sourceMeasures}set SourceMeasures(R){this.sourceMeasures=R}get Repetitions(){return this.repetitions}set Repetitions(R){this.repetitions=R}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(R){this.playbackSettings=R}get DrawErroneousMeasures(){return this.drawErroneousMeasures}set DrawErroneousMeasures(R){this.drawErroneousMeasures=R}get HasBeenOpenedForTheFirstTime(){return this.hasBeenOpenedForTheFirstTime}set HasBeenOpenedForTheFirstTime(R){this.hasBeenOpenedForTheFirstTime=R}InitializeStartTempoInBPM(R){this.playbackSettings.BeatsPerMinute=R,this.userStartTempoInBPM=R}get DefaultStartTempoInBpm(){return this.defaultStartTempoInBpm}set DefaultStartTempoInBpm(R){this.defaultStartTempoInBpm=R,this.InitializeStartTempoInBPM(R)}get Path(){return this.path}set Path(R){this.path=R}get Staves(){return this.staves}get TitleString(){return this.title?this.title.text:""}set TitleString(R){this.Title=new Label(R)}get SubtitleString(){return this.subtitle?this.subtitle.text:""}set SubtitleString(R){this.Subtitle=new Label(R)}get ComposerString(){return this.composer?this.composer.text:""}set ComposerString(R){this.Composer=new Label(R)}get LyricistString(){return this.lyricist?this.lyricist.text:""}set LyricistString(R){this.Lyricist=new Label(R)}get Title(){return this.title}set Title(R){this.title=R}get Subtitle(){return this.subtitle}set Subtitle(R){this.subtitle=R}get Composer(){return this.composer}set Composer(R){this.composer=R}get Lyricist(){return this.lyricist}set Lyricist(R){this.lyricist=R}get Rules(){return this.rules||(log$2.debug("warning: sheet.Rules was undefined. Creating new EngravingRules."),this.rules=new EngravingRules),this.rules}set Rules(R){this.rules=R}get SheetErrors(){return this.musicSheetErrors}get PlaybackDataDict(){return this.playbackDataDict}get SelectionStart(){return this.selectionStart}set SelectionStart(R){this.selectionStart=R.clone(),this.currentEnrolledPosition=R.clone()}get SelectionEnd(){return this.selectionEnd}set SelectionEnd(R){this.selectionEnd=R}set HasBPMInfo(R){this.hasBPMInfo=R}get HasBPMInfo(){return this.hasBPMInfo}addMeasure(R){this.sourceMeasures.push(R),R.measureListIndex=this.sourceMeasures.length-1}checkForInstrumentWithNoVoice(){for(let R=0,F=this.instruments.length;R0){const R=this.TimestampSortedTempoExpressionsList[0];if(R.InstantaneousTempo)return R.InstantaneousTempo.TempoInBpm;if(R.ContinuousTempo)return R.ContinuousTempo.StartTempo}return this.userStartTempoInBPM}get Errors(){return this.musicSheetErrors.measureErrors}get FirstMeasureNumber(){try{return this.getFirstSourceMeasure().MeasureNumber}catch(R){return log$2.info("MusicSheet.FirstMeasureNumber: ",R),0}}get LastMeasureNumber(){try{return this.getLastSourceMeasure().MeasureNumber}catch(R){return log$2.info("MusicSheet.LastMeasureNumber: ",R),0}}get CurrentEnrolledPosition(){return this.currentEnrolledPosition.clone()}set CurrentEnrolledPosition(R){this.currentEnrolledPosition=R.clone()}get Transpose(){return this.transpose}set Transpose(R){this.transpose=R}get FullNameString(){return this.ComposerString+" "+this.TitleString}get IdString(){return this.idString}set IdString(R){this.idString=R}getEnrolledSelectionStartTimeStampWorkaround(){const R=this.MusicPartManager.getIterator(this.SelectionStart);return Fraction$1.createFromFraction(R.CurrentEnrolledTimestamp)}get SheetEndTimestamp(){const R=this.getLastSourceMeasure();return Fraction$1.plus(R.AbsoluteTimestamp,R.Duration)}getSourceMeasureFromTimeStamp(R){for(let F=0,D=this.sourceMeasures.length;F0&&G.Voices[0].Visible&&R.push(G)}return R}}MusicSheet$1.defaultTitle="[no title given]";class LyricWord{constructor(){this.syllables=[]}get Syllables(){return this.syllables}containsVoiceEntry(R){for(let F=0,D=this.Syllables.length;F=0&&(this.syllableIndex=U)}get Text(){return this.text}set Text(R){this.text=R}get Word(){return this.word}get Parent(){return this.parent}set Parent(R){this.parent=R}get VerseNumber(){return this.verseNumber}get SyllableIndex(){return this.syllableIndex}}class LyricsReader{constructor(R){this.openLyricWords={},this.musicSheet=R}addLyricEntry(R,F){var D,G;if(R){const U=R;for(let W=0,q=U.length;W0)for(let he=re;he1&&(Q=parseInt(ne[1],10))}catch{const re=ITextTranslation.translateText("ReaderErrorMessages/LyricVerseNumberError","Invalid lyric verse number");this.musicSheet.SheetErrors.pushMeasureError(re);continue}}let se;if(J==="single"||J==="end"){if(this.openLyricWords[Q]){this.currentLyricWord=this.openLyricWords[Q];const ne=this.currentLyricWord.Syllables.length;se=new LyricsEntry(K,Q,this.currentLyricWord,F,ne),this.currentLyricWord.Syllables.push(se),delete this.openLyricWords[Q],this.currentLyricWord=void 0}else se=new LyricsEntry(K,Q,void 0,F);se.extend=Y.element("extend")!==void 0}else if(J==="begin")this.openLyricWords[Q]&&(delete this.openLyricWords[Q],this.currentLyricWord=void 0),this.currentLyricWord=new LyricWord,this.openLyricWords[Q]=this.currentLyricWord,se=new LyricsEntry(K,Q,this.currentLyricWord,F,0),this.currentLyricWord.Syllables.push(se);else if(J==="middle")if(this.openLyricWords[Q]){this.currentLyricWord=this.openLyricWords[Q];const ne=this.currentLyricWord.Syllables.length;se=new LyricsEntry(K,Q,this.currentLyricWord,F,ne),this.currentLyricWord.Syllables.push(se)}else se=new LyricsEntry(K,Q,void 0,F);se&&(F.LyricsEntries[Q]||(F.LyricsEntries.setValue(Q,se),(G=(D=F.ParentSourceStaffEntry)==null?void 0:D.VerticalContainerParent)!=null&&G.ParentMeasure&&(F.ParentSourceStaffEntry.VerticalContainerParent.ParentMeasure.hasLyrics=!0)),F.ParentVoice.Parent.LyricVersesNumbers[Q]||F.ParentVoice.Parent.LyricVersesNumbers.push(Q))}}}catch{const Z=ITextTranslation.translateText("ReaderErrorMessages/LyricError","Error while reading lyric entry.");this.musicSheet.SheetErrors.pushMeasureError(Z);continue}}F.ParentVoice.Parent.LyricVersesNumbers=F.ParentVoice.Parent.LyricVersesNumbers.filter((W,q,Y)=>Y.indexOf(W)===q)}}}class Articulation{constructor(R,F){this.articulationEnum=R,this.placement=F}Equals(R){return R.articulationEnum===this.articulationEnum&&R.placement===this.placement}}class ArticulationReader{constructor(R){this.rules=R}getAccEnumFromString(R){switch(R){case"sharp":return AccidentalEnum.SHARP;case"flat":return AccidentalEnum.FLAT;case"natural":return AccidentalEnum.NATURAL;case"double-sharp":case"sharp-sharp":return AccidentalEnum.DOUBLESHARP;case"double-flat":case"flat-flat":return AccidentalEnum.DOUBLEFLAT;case"triple-sharp":return AccidentalEnum.TRIPLESHARP;case"triple-flat":return AccidentalEnum.TRIPLEFLAT;case"quarter-sharp":return AccidentalEnum.QUARTERTONESHARP;case"quarter-flat":return AccidentalEnum.QUARTERTONEFLAT;case"three-quarters-sharp":return AccidentalEnum.THREEQUARTERSSHARP;case"three-quarters-flat":return AccidentalEnum.THREEQUARTERSFLAT;case"slash-quarter-sharp":return AccidentalEnum.SLASHQUARTERSHARP;case"slash-sharp":return AccidentalEnum.SLASHSHARP;case"double-slash-flat":return AccidentalEnum.DOUBLESLASHFLAT;case"sori":return AccidentalEnum.SORI;case"koron":return AccidentalEnum.KORON;default:return AccidentalEnum.NONE}}addArticulationExpression(R,F){var D,G;if(R!==void 0&&R.elements().length>0){const U=R.elements();for(let W=0,q=U.length;W0&&F.Articulations[0].articulationEnum!==ArticulationEnum.staccato&&F.Articulations.splice(0,0,Q),J==="strongaccent"){const ie=(G=Y==null?void 0:Y.attribute("type"))==null?void 0:G.value;ie==="up"?Q.articulationEnum=ArticulationEnum.marcatoup:ie==="down"&&(Q.articulationEnum=ArticulationEnum.marcatodown)}if(J==="detachedlegato"){const ie=new Articulation(ArticulationEnum.staccato,K),se=new Articulation(ArticulationEnum.tenuto,K);F.Articulations.push(ie,se)}if(!F.hasArticulation(Q))switch(F.Articulations.push(Q),Q.articulationEnum){case ArticulationEnum.staccato:case ArticulationEnum.staccatissimo:F.DurationModifier=Q;break;case ArticulationEnum.accent:case ArticulationEnum.strongaccent:F.VolumeModifier=Q;break;default:break}}}catch(Z){const K="Invalid note articulation.";log$2.debug("addArticulationExpression",K,Z);return}}}}addFermata(R,F){var U;let D=ArticulationEnum.fermata;R.attributes().length>0&&R.attribute("type")&&R.attribute("type").value==="inverted"&&(D=ArticulationEnum.invertedfermata);let G=PlacementEnum.Above;((U=R.attribute("placement"))==null?void 0:U.value)==="below"&&(G=PlacementEnum.Below),F.Articulations.push(new Articulation(D,G))}addTechnicalArticulations(R,F,D){var q,Y;const G={bend:ArticulationEnum.bend,"down-bow":ArticulationEnum.downbow,"open-string":ArticulationEnum.naturalharmonic,"snap-pizzicato":ArticulationEnum.snappizzicato,stopped:ArticulationEnum.lefthandpizzicato,"up-bow":ArticulationEnum.upbow};for(const J in G){if(!G.hasOwnProperty(J))continue;const Z=G[J],K=R.element(J);if(K){let te;((q=K.attribute("placement"))==null?void 0:q.value)==="above"&&(te=PlacementEnum.Above),((Y=K.attribute("placement"))==null?void 0:Y.value)==="below"&&(te=PlacementEnum.Below);const Q=new Articulation(Z,te);F.hasArticulation(Q)||F.Articulations.push(Q)}}const U=R.element("fingering");if(U){const J=this.createTechnicalInstruction(U,D);J.type=TechnicalInstructionType.Fingering,D.Fingering=J,F.TechnicalInstructions.push(J)}const W=R.element("string");if(W){const J=this.createTechnicalInstruction(W,D);J.type=TechnicalInstructionType.String,D.StringInstruction=J,F.TechnicalInstructions.push(J)}}createTechnicalInstruction(R,F){const D=new TechnicalInstruction;D.sourceNote=F,D.value=R.value;const G=R.attribute("placement");return this.rules.FingeringPositionFromXML&&(D.placement=this.getPlacement(G)),D}getPlacement(R,F=PlacementEnum.NotYetDefined){if(F!==PlacementEnum.NotYetDefined)return F;if(R)switch(R.value){case"above":return PlacementEnum.Above;case"below":return PlacementEnum.Below;case"left":return PlacementEnum.Left;case"right":return PlacementEnum.Right;default:return PlacementEnum.NotYetDefined}else return PlacementEnum.NotYetDefined}addOrnament(R,F){if(R){let D;const G={"delayed-inverted-turn":OrnamentEnum.DelayedInvertedTurn,"delayed-turn":OrnamentEnum.DelayedTurn,"inverted-mordent":OrnamentEnum.InvertedMordent,"inverted-turn":OrnamentEnum.InvertedTurn,mordent:OrnamentEnum.Mordent,"trill-mark":OrnamentEnum.Trill,turn:OrnamentEnum.Turn};for(const U in G){if(!G.hasOwnProperty(U))continue;const W=R.element(U);if(W){D=new OrnamentContainer(G[U]);const q=W.attribute("placement");q&&q.value==="below"&&(D.placement=PlacementEnum.Below)}}if(D){const U=R.elements("accidental-mark");if(U){let W=PlacementEnum.Below,q=AccidentalEnum.NONE;const Y=U;for(let J=0,Z=Y.length;J0&&(this.currentVoiceEntry.GraceVoiceEntriesBefore=this.graceVoiceEntriesTempList,this.graceVoiceEntriesTempList=[]))}finalizeReadingMeasure(){this.graceVoiceEntriesTempList.length>0&&this.currentNormalVoiceEntry!==void 0&&this.currentNormalVoiceEntry.GraceVoiceEntriesAfter.concat(this.graceVoiceEntriesTempList),this.graceVoiceEntriesTempList=[],this.pluginManager.processVoiceMeasureReadPlugins(this.currMeasureVoiceEntries,this.activeKey,this.activeRhythm),this.currMeasureVoiceEntries.length=0,this.openBeams.length>1&&this.handleOpenBeam()}read(R,F,D,G,U,W,q,Y,J,Z,K,te,Q,ie,se,ne,re,ae,ce,he,fe,be){this.currentStaffEntry=q,this.currentMeasure=Y;try{this.currentNote=W?this.addRestNote(R.element("rest"),F,G,U,Q,ie,ce):this.addSingleNote(R,F,G,D,U,K,te,Q,ie,se,ne,re,ae,ce,fe,be),this.currentNote.DotsXml=he;const ue=R.elements("lyric");this.lyricsReader!==void 0&&ue&&(this.lyricsReader.addLyricEntry(ue,this.currentVoiceEntry),this.voice.Parent.HasLyrics=!0);let ge=!1;const ve=R.element("notations");if(ve){this.articulationReader&&this.readArticulations(ve,this.currentVoiceEntry,this.currentNote);const Se=ve.elements("slur");this.slurReader!==void 0&&Se.length>0&&!this.currentNote.ParentVoiceEntry.IsGrace&&this.slurReader.addSlur(Se,this.currentNote);const pe=ve.elements("tuplet");pe.length>0&&(this.openTupletNumber=this.addTuplet(R,pe),ge=!0);const ye=ve.element("arpeggiate");if(ye!==void 0){let Oe;if(this.currentVoiceEntry.Arpeggio)Oe=this.currentVoiceEntry.Arpeggio;else{let Me=!1;for(const Pe of this.currentStaffEntry.VoiceEntries)if(Pe.Arpeggio){Me=!0,Oe=Pe.Arpeggio;break}if(!Me){let Pe=ArpeggioType.ARPEGGIO_DIRECTIONLESS;const Ne=ye.attribute("direction");if(Ne)switch(Ne.value){case"up":Pe=ArpeggioType.ROLL_UP;break;case"down":Pe=ArpeggioType.ROLL_DOWN;break;default:Pe=ArpeggioType.ARPEGGIO_DIRECTIONLESS}Oe=new Arpeggio(this.currentVoiceEntry,Pe),this.currentVoiceEntry.Arpeggio=Oe}}Oe.addNote(this.currentNote)}const Ee=ve.elements("tied");Ee.length>0&&this.addTie(Ee,J,Z,TieTypes.SIMPLE);const de=ve.elements("slide");de.length>0&&this.addTie(de,J,Z,TieTypes.SLIDE);const we=ve.element("technical");if(we){const Oe=we.elements("hammer-on");Oe.length>0&&this.addTie(Oe,J,Z,TieTypes.HAMMERON);const Me=we.elements("pull-off");Me.length>0&&this.addTie(Me,J,Z,TieTypes.PULLOFF)}}R.element("time-modification")!==void 0&&!ge&&this.handleTimeModificationNode(R)}catch(ue){log$2.warn(ue);const ge=ITextTranslation.translateText("ReaderErrorMessages/NoteError","Ignored erroneous Note.");this.musicSheet.SheetErrors.pushMeasureError(ge),this.musicSheet.SheetErrors.pushMeasureError(ue)}return this.currentNote}checkForStaffEntryLink(R,F,D,G){const U=new StaffEntryLink(this.currentVoiceEntry);U.LinkStaffEntries.push(D),D.Link=U;const W=this.currentVoiceEntry.Timestamp.clone(),q=G.getVerticalContainerByTimestamp(W);return D=q.StaffEntries[R],D||(D=new SourceStaffEntry(q,F),q.StaffEntries[R]=D),D.VoiceEntries.push(this.currentVoiceEntry),U.LinkStaffEntries.push(D),D.Link=U,D}checkForOpenBeam(){this.openBeams.length>0&&this.currentNote&&this.handleOpenBeam()}checkOpenTies(){const R=this.openTieDict;for(const F in R)if(R.hasOwnProperty(F)){const D=R[F];Fraction$1.plus(D.StartNote.ParentStaffEntry.Timestamp,D.Duration).lt(D.StartNote.SourceMeasure.Duration)&&delete R[F]}}hasVoiceEntry(){return this.currentVoiceEntry!==void 0}readArticulations(R,F,D){const G=R.element("articulations");G&&this.articulationReader.addArticulationExpression(G,F);const U=R.element("fermata");U&&this.articulationReader.addFermata(U,F);const W=R.element("technical");W&&this.articulationReader.addTechnicalArticulations(W,F,D);const q=R.element("ornaments");q&&this.articulationReader.addOrnament(q,F)}addSingleNote(R,F,D,G,U,W,q,Y,J,Z,K,te,Q,ie,se,ne){let re=0,ae,ce=AccidentalEnum.NONE,he=NoteEnum.C,fe=NoteEnum.C,be=0,ue=0,ge,ve,Se;const pe=R.elements();for(let Ne=0,ke=pe.length;Ne0&&this.openBeams.last().ExtendedNoteList.push(ie),ie}addNoteInfo(R,F,D,G,U,W,q,Y,J){R.NoteTypeXml=F,R.PrintObject=D,R.IsCueNote=G,R.NormalNotes=U,R.displayStepUnpitched=W,R.displayOctaveUnpitched=q,R.NoteheadColorXml=Y,R.NoteheadColor=Y}createBeam(R,F){var D;try{const G=R.element("beam");let U;if(G!==void 0&&G.hasAttributes&&(U=G.attribute("number")),U){let W=parseInt(U.value,10);const q=R.elements("beam"),Y=q[0].value;q&&(Y==="begin"?(W===((D=this.openBeams.last())==null?void 0:D.BeamNumber)?(this.beamNumberOffset++,W+=this.beamNumberOffset):this.openBeams.last()&&this.handleOpenBeam(),this.openBeams.push(new Beam(W,this.beamNumberOffset))):W+=this.beamNumberOffset);let J=!1;if(!(W>0&&W<=this.openBeams.length)||!this.openBeams[W-1]){log$2.debug("[OSMD] invalid beamnumber");return}for(let Z=0,K=this.openBeams[W-1].Notes.length;Z1){let G=R.element("time-modification");G&&(G=G.element("actual-notes"));const U=F;for(let W=0,q=U.length;W1&&this.openTupletNumber--),this.tupletDict[K]=Q;const se=[];se.push(this.currentNote),Q.Notes.push(se),Q.Fractions.push(this.getTupletNoteDurationFromType(R)),this.currentNote.NoteTuplet=Q,this.openTupletNumber=K}else if(Z.value==="stop"){let K=1;Y.attribute("number")&&(K=parseInt(Y.attribute("number").value,10));const te=this.tupletDict[K];if(te){const Q=Y.attribute("placement");Q&&(Q.value==="below"?te.tupletLabelNumberPlacement=PlacementEnum.Below:te.tupletLabelNumberPlacement=PlacementEnum.Above,te.PlacementFromXml=!0);const ie=[];if(ie.push(this.currentNote),te.Notes.push(ie),!te.PlacementFromXml){let se=!1;for(const ne of te.Notes){for(const re of ne)if(!re.isRest()){re.StemDirectionXml===StemDirectionType.Down?te.tupletLabelNumberPlacement=PlacementEnum.Below:te.tupletLabelNumberPlacement=PlacementEnum.Above,se=!0;break}if(se)break}}te.Fractions.push(this.getTupletNoteDurationFromType(R)),this.currentNote.NoteTuplet=te,delete this.tupletDict[K],Object.keys(this.tupletDict).length===0?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--}}}}}else if(F[0]){const G=F[0];if(G.hasAttributes){const U=G.attribute("type").value;let W=1;G.attribute("number")&&(W=parseInt(G.attribute("number").value,10));const q=isNaN(W),Y=G.attribute("bracket");if(Y&&Y.value==="yes"&&(D=!0),U==="start"){let J=0,Z=R.element("time-modification");if(Z&&(Z=Z.element("actual-notes")),Z&&(J=parseInt(Z.value,10),isNaN(J))){const ie=ITextTranslation.translateText("ReaderErrorMessages/TupletNoteDurationError","Invalid tuplet note duration.");throw this.musicSheet.SheetErrors.pushMeasureError(ie),new MusicSheetReadingException(ie)}q&&(this.openTupletNumber++,W=this.openTupletNumber);let K=this.tupletDict[W];K||(K=this.tupletDict[W]=new Tuplet(J,D),K.tupletLabelNumberPlacement=PlacementEnum.Above);const te=G.attribute("placement");te&&(te.value==="below"?K.tupletLabelNumberPlacement=PlacementEnum.Below:K.tupletLabelNumberPlacement=PlacementEnum.Above,K.PlacementFromXml=!0);const Q=[];Q.push(this.currentNote),K.Notes.push(Q),K.Fractions.push(this.getTupletNoteDurationFromType(R)),this.currentNote.NoteTuplet=K,this.openTupletNumber=W}else if(U==="stop"){q&&(W=this.openTupletNumber);const J=this.tupletDict[this.openTupletNumber];if(J){const Z=G.attribute("placement");Z&&(Z.value==="below"?J.tupletLabelNumberPlacement=PlacementEnum.Below:J.tupletLabelNumberPlacement=PlacementEnum.Above,J.PlacementFromXml=!0);const K=[];if(K.push(this.currentNote),J.Notes.push(K),!J.PlacementFromXml){let te=!1;for(const Q of J.Notes){for(const ie of Q)if(!ie.isRest()){ie.StemDirectionXml===StemDirectionType.Down?J.tupletLabelNumberPlacement=PlacementEnum.Below:J.tupletLabelNumberPlacement=PlacementEnum.Above,te=!0;break}if(te)break}}J.Fractions.push(this.getTupletNoteDurationFromType(R)),this.currentNote.NoteTuplet=J,Object.keys(this.tupletDict).length===0?this.openTupletNumber=0:Object.keys(this.tupletDict).length>1&&this.openTupletNumber--,delete this.tupletDict[W]}}}}return this.openTupletNumber}handleTimeModificationNode(R){if(this.tupletDict[this.openTupletNumber])try{const F=this.tupletDict[this.openTupletNumber],D=CollectionUtil.last(F.Notes),G=D[0].ParentVoiceEntry;let U;G.Timestamp.Equals(this.currentVoiceEntry.Timestamp)?U=D:(U=[],F.Notes.push(U),F.Fractions.push(this.getTupletNoteDurationFromType(R))),U.push(this.currentNote),this.currentNote.NoteTuplet=F}catch(F){const D=ITextTranslation.translateText("ReaderErrorMessages/TupletNumberError","Invalid tuplet number.");throw this.musicSheet.SheetErrors.pushMeasureError(D),F}else if(this.currentVoiceEntry.Notes.length>0){const F=this.currentVoiceEntry.Notes[0];if(F.NoteTuplet){const D=F.NoteTuplet;CollectionUtil.last(D.Notes).push(this.currentNote),this.currentNote.NoteTuplet=D}}}addTie(R,F,D,G){if(R){if(R.length===1){const U=R[0];if(U!==void 0&&U.attributes()){const W=this.getTieDirection(U),q=U.attribute("type").value;try{if(q==="start"){const Y=this.findCurrentNoteInTieDict(this.currentNote);Y<0&&delete this.openTieDict[Y];const J=this.getNextAvailableNumberForTie(),Z=new Tie(this.currentNote,G);this.openTieDict[J]=Z,Z.TieNumber=J,Z.TieDirection=W}else if(q==="stop"){const Y=this.findCurrentNoteInTieDict(this.currentNote),J=this.openTieDict[Y];J&&(J.AddNote(this.currentNote),delete this.openTieDict[Y])}}catch{const J=ITextTranslation.translateText("ReaderErrorMessages/TieError","Error while reading tie.");this.musicSheet.SheetErrors.pushMeasureError(J)}}}else if(R.length===2){const U=this.findCurrentNoteInTieDict(this.currentNote);if(U>=0){const W=this.openTieDict[U];W.AddNote(this.currentNote);for(const q of R)if(q.attribute("type").value==="start"){const J=this.getTieDirection(q);W.NoteIndexToTieDirection[W.Notes.length-1]=J}}}}}getTieDirection(R){let F=PlacementEnum.NotYetDefined;const D=R.attribute("placement");D&&(D.value==="above"?F=PlacementEnum.Above:D.value==="below"&&(F=PlacementEnum.Below));const G=R.attribute("orientation");return G&&(G.value==="over"?F=PlacementEnum.Above:G.value==="under"&&(F=PlacementEnum.Below)),F}getNextAvailableNumberForTie(){const R=Object.keys(this.openTieDict);if(R.length===0)return 1;R.sort((F,D)=>+F-+D);for(let F=0;F0?G.RealValue>0?(J=Fraction$1.multiply(Fraction$1.minus(G,U),J),this.directionTimestamp=Fraction$1.plus(J,G)):this.directionTimestamp=Fraction$1.createFromFraction(J):this.offsetDivisions<0&&(G.RealValue>0?(J=Fraction$1.multiply(Fraction$1.minus(G,U),J),this.directionTimestamp=Fraction$1.minus(G,J)):this.directionTimestamp=Fraction$1.createFromFraction(J));const Z=R.attribute("placement");if(Z)try{const K=Z.value;K==="below"?this.placement=PlacementEnum.Below:K==="above"&&(this.placement=PlacementEnum.Above)}catch(K){const te=ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement -> set to default.");log$2.debug("ExpressionReader.readExpressionParameters",te,K),this.musicSheet.SheetErrors.pushMeasureError(te),this.placement=PlacementEnum.Below}if(this.placement===PlacementEnum.NotYetDefined)try{const K=R.element("direction-type");if(K){const te=K.element("dynamics");if(te){const ne=te.attribute("default-y");ne&&this.readExpressionPlacement(ne,"read dynamics y pos")}const Q=K.element("wedge");if(Q){const ne=Q.attribute("default-y");ne&&this.readExpressionPlacement(ne,"read wedge y pos")}const ie=K.element("words");if(ie){const ne=ie.attribute("default-y");ne&&this.readExpressionPlacement(ne,"read words y pos")}const se=K.element("rehearsal");if(se){const ne=se.attribute("default-y");ne&&this.readExpressionPlacement(ne,"read rehearsal pos")}}}catch(K){const te=ITextTranslation.translateText("ReaderErrorMessages/ExpressionPlacementError","Invalid expression placement -> set to default.");log$2.debug("ExpressionReader.readExpressionParameters",te,K),this.musicSheet.SheetErrors.pushMeasureError(te),this.placement=PlacementEnum.Below}this.placement===PlacementEnum.NotYetDefined&&(F.Staves.length>1?this.placement=PlacementEnum.Below:F.HasLyrics?this.placement=PlacementEnum.Above:this.placement=PlacementEnum.Below)}read(R,F,D,G=void 0,U=0){let W=!1,q=!1;const Y=R.element("sound");if(Y){const K=Y.attribute("tempo"),te=Y.attribute("dynamics");if(K){const Q=K.value.match(/^(\d+)(\.\d+)?$/);(Q==null?void 0:Q.length)>0?this.soundTempo=Math.round(Number.parseFloat(K.value)):(log$2.info("invalid xml tempo: "+K.value),this.soundTempo=100),F.TempoInBPM=this.soundTempo,this.musicSheet.DefaultStartTempoInBpm===0&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,W=!0}if(te){const Q=te.value.match(/\d+/);this.soundDynamic=Q!==void 0?parseInt(Q[0],10):100,q=!0}}const J=R.element("direction-type");if(!J)return;let Z=J.element("metronome");if(Z){F.metronomeNoteIndex=U;const K=Z.element("beat-unit"),te=Z.element("beat-unit-dot")!==void 0,Q=Z.element("per-minute");if(K!==void 0&&Q){Z.hasAttributes&&Z.attribute("default-x")!==void 0&&(this.directionTimestamp=Fraction$1.createFromFraction(D));const se=parseFloat(Q.value);this.createNewTempoExpressionIfNeeded(F);const ne=new InstantaneousTempoExpression(void 0,this.placement,this.staffNumber,se,this.currentMultiTempoExpression,!0);ne.parentMeasure=F,this.soundTempo=se,F.TempoInBPM=this.soundTempo*(te?1.5:1),this.musicSheet.DefaultStartTempoInBpm===0&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),F.MeasureNumberXML===1&&this.musicSheet.SourceMeasures.length===0&&(this.musicSheet.DefaultStartTempoInBpm=this.soundTempo),this.musicSheet.HasBPMInfo=!0,ne.dotted=te,ne.beatUnit=K.value,this.currentMultiTempoExpression.addExpression(ne,""),this.currentMultiTempoExpression.CombinedExpressionsText="test"}return}if(Z=J.element("dynamics"),Z){const K=R.element("notations")!==void 0;this.interpretInstantaneousDynamics(Z,F,D,K);return}if(Z=J.element("words"),Z){const K=J.elements("words");let te="";for(const Q of K)te+=Q.value;if(Z.value=te,W||isSpeedKeyword(Z.value)||isSpeedHiddenKeyword(Z.value)){this.createNewTempoExpressionIfNeeded(F),this.currentMultiTempoExpression.CombinedExpressionsText=Z.value,(isSpeedKeyword(Z.value)||isSpeedHiddenKeyword(Z.value))&&(Z.value=void 0);const Q=new InstantaneousTempoExpression(Z.value,this.placement,this.staffNumber,this.soundTempo,this.currentMultiTempoExpression);this.currentMultiTempoExpression.addExpression(Q,"")}else q||this.interpretWords(Z,F,D);return}if(Z=J.element("wedge"),Z){this.interpretWedge(Z,F,G,F.MeasureNumber);return}if(Z=J.element("rehearsal"),Z){this.interpretRehearsalMark(Z,F,D,F.MeasureNumber);return}}closeOpenExpressions(R,F){for(const D of this.openContinuousDynamicExpressions)this.createNewMultiExpressionIfNeeded(R,D.NumberXml,F),this.closeOpenContinuousDynamic(D,R,F);this.openContinuousTempoExpression&&this.closeOpenContinuousTempo(Fraction$1.plus(R.AbsoluteTimestamp,F))}addOctaveShift(R,F,D){var q;let G=1;const U=R.element("staff");if(U)try{G=parseInt(U.value,10)}catch(Y){const J=ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftStaffError","Invalid octave shift staff number -> set to default");this.musicSheet.SheetErrors.pushMeasureError(J),G=1,log$2.debug("ExpressionReader.addOctaveShift",J,Y)}const W=R.element("direction-type");if(W){const Y=W.element("octave-shift"),J=this.readPlacement(R);if(Y!==void 0&&Y.hasAttributes)try{const Z=this.readNumber(Y);if(Y.attribute("size")){const K=parseInt(Y.attribute("size").value,10);let te=0;K===8?te=1:K===15&&(te=2);let Q=(q=Y.attribute("type"))==null?void 0:q.value;if(Q||(J===PlacementEnum.Above?Q="down":J===PlacementEnum.Below&&(Q="up")),Q==="up"||Q==="down"){const ie=new OctaveShift(Q,te);ie.StaffNumber=G,this.getMultiExpression=this.createNewMultiExpressionIfNeeded(F,Z),this.getMultiExpression.OctaveShiftStart=ie,ie.ParentStartMultiExpression=this.getMultiExpression,this.openOctaveShift=ie}else if(Q==="stop"){if(this.openOctaveShift){this.getMultiExpression=this.createNewMultiExpressionIfNeeded(F,this.openOctaveShift.numberXml,D);const ie=this.getMultiExpression;ie.OctaveShiftEnd=this.openOctaveShift,this.openOctaveShift.ParentEndMultiExpression=this.getMultiExpression,this.openOctaveShift=void 0}}else Q||log$2.debug("octave-shift missing type in xml")}}catch(Z){const K=ITextTranslation.translateText("ReaderErrorMessages/OctaveShiftError","Error while reading octave shift.");this.musicSheet.SheetErrors.pushMeasureError(K),log$2.debug("ExpressionReader.addOctaveShift",K,Z)}}}addPedalMarking(R,F,D){var U,W,q,Y;const G=R.element("direction-type");if(G){const J=G.element("pedal");if(J!==void 0&&J.hasAttributes){let Z=!1,K=!1;try{switch(((U=J.attribute("line"))==null?void 0:U.value)==="yes"?K=!0:((W=J.attribute("line"))==null?void 0:W.value)==="no"&&(K=!1,Z=!0),((q=J.attribute("sign"))==null?void 0:q.value)==="yes"?Z=!0:((Y=J.attribute("sign"))==null?void 0:Y.value)==="no"&&(Z=!1,K=!0),J.attribute("type").value){case"start":this.openPedal&&this.openPedal.IsLine&&this.endOpenPedal(F),this.createNewMultiExpressionIfNeeded(F,-1),this.openPedal=new Pedal(K,Z),this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression;break;case"stop":this.openPedal&&this.endOpenPedal(F);break;case"change":this.openPedal&&this.openPedal.IsLine&&(this.openPedal.ChangeEnd=!0,this.createNewMultiExpressionIfNeeded(F,-1),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.createNewMultiExpressionIfNeeded(F,-1),this.openPedal=new Pedal(K,Z),this.openPedal.ChangeBegin=!0,this.getMultiExpression.PedalStart=this.openPedal,this.openPedal.ParentStartMultiExpression=this.getMultiExpression);break;case"continue":break;default:break}}catch(te){const Q=ITextTranslation.translateText("ReaderErrorMessages/PedalError","Error while reading pedal.");this.musicSheet.SheetErrors.pushMeasureError(Q),log$2.debug("ExpressionReader.addPedalMarking",Q,te)}}}}endOpenPedal(R){this.createNewMultiExpressionIfNeeded(R,-1),this.getMultiExpression.PedalEnd=this.openPedal,this.openPedal.ParentEndMultiExpression=this.getMultiExpression,this.openPedal=void 0}addWavyLine(R,F,D,G){if(R&&R.hasAttributes)try{switch(R.attribute("type").value){case"start":this.createNewMultiExpressionIfNeeded(F,-1),this.openWavyLine=new WavyLine(this.placement),this.getMultiExpression.WavyLineStart=this.openWavyLine,this.openWavyLine.ParentStartMultiExpression=this.getMultiExpression;break;case"stop":this.openWavyLine&&(this.createNewMultiExpressionIfNeeded(F,-1,D),this.getMultiExpression.WavyLineEnd=this.openWavyLine,this.openWavyLine.ParentEndMultiExpression=this.getMultiExpression,this.openWavyLine=void 0);break;case"continue":break;default:break}}catch(U){const W=ITextTranslation.translateText("ReaderErrorMessages/WavyLineError","Error while reading wavy-line.");this.musicSheet.SheetErrors.pushMeasureError(W),log$2.debug("ExpressionReader.addWavyLine",W,U)}}initialize(){this.placement=PlacementEnum.NotYetDefined,this.soundTempo=0,this.soundDynamic=0,this.offsetDivisions=0}readPlacement(R){var D;const F=(D=R.attribute("placement"))==null?void 0:D.value;return F==="above"?PlacementEnum.Above:F==="below"?PlacementEnum.Below:PlacementEnum.NotYetDefined}readExpressionPlacement(R,F){try{const D=parseInt(R.value,10);D<0?this.placement=PlacementEnum.Below:D>0&&(this.placement=PlacementEnum.Above)}catch(D){log$2.debug("ExpressionReader.readExpressionParameters",F,D)}}interpretInstantaneousDynamics(R,F,D,G){if(R.hasElements){R.hasAttributes&&R.attribute("default-x")&&(this.directionTimestamp=Fraction$1.createFromFraction(D));const U=this.readNumber(R);let W=R.elements()[0].name;if(W==="other-dynamics"&&(W=R.elements()[0].value),W){G?this.createNewMultiExpressionIfNeeded(F,U,Fraction$1.createFromFraction(D)):this.createNewMultiExpressionIfNeeded(F,U);const q=new InstantaneousDynamicExpression(W,this.soundDynamic,this.placement,this.staffNumber,F);q.InMeasureTimestamp=D.clone(),this.getMultiExpression.addExpression(q,""),this.initialize(),this.activeInstantaneousDynamic?this.activeInstantaneousDynamic.DynEnum=q.DynEnum:this.activeInstantaneousDynamic=new InstantaneousDynamicExpression(W,0,PlacementEnum.NotYetDefined,1,F)}}}interpretWords(R,F,D){const G=R.value;let U;const W=R.attribute("font-style");if(W&&W.value==="italic"&&(U=FontStyles.Italic),G.length>0){if(R.hasAttributes&&R.attribute("default-x")&&(this.directionTimestamp=Fraction$1.createFromFraction(D)),this.checkIfWordsNodeIsRepetitionInstruction(G))return;this.fillMultiOrTempoExpression(G,F,D,U),this.initialize()}}readNumber(R){var G;let F=1;const D=(G=R.attribute("number"))==null?void 0:G.value;return D&&(F=Number.parseInt(D,10)),F}interpretWedge(R,F,D,G){var W,q;R!==void 0&&R.hasAttributes&&R.attribute("default-x")&&(this.directionTimestamp=Fraction$1.createFromFraction(D));const U=this.readNumber(R);((q=(W=R.attribute("type"))==null?void 0:W.value)==null?void 0:q.toLowerCase())==="stop"?this.createNewMultiExpressionIfNeeded(F,U,D):this.createNewMultiExpressionIfNeeded(F,U),this.addWedge(R,F,D),this.initialize()}interpretRehearsalMark(R,F,D,G){F.rehearsalExpression=new RehearsalExpression(R.value,this.placement)}createNewMultiExpressionIfNeeded(R,F,D=void 0){D||(D=this.directionTimestamp);let G=this.getMultiExpression;return(!G||G&&(G.SourceMeasureParent!==R||G.numberXml!==F||G.SourceMeasureParent===R&&G.Timestamp!==D))&&(this.getMultiExpression=G=new MultiExpression(R,Fraction$1.createFromFraction(D)),R.StaffLinkedExpressions[this.globalStaffIndex].push(G)),G}createNewTempoExpressionIfNeeded(R){(!this.currentMultiTempoExpression||this.currentMultiTempoExpression.SourceMeasureParent!==R||this.currentMultiTempoExpression.Timestamp!==this.directionTimestamp)&&(this.currentMultiTempoExpression=new MultiTempoExpression(R,Fraction$1.createFromFraction(this.directionTimestamp)),R.TempoExpressions.push(this.currentMultiTempoExpression))}addWedge(R,F,D){if(R!==void 0&&R.hasAttributes){const G=this.readNumber(R),U=R.attribute("type").value.toLowerCase();try{if(U==="crescendo"||U==="diminuendo"){const W=new ContinuousDynamicExpression(ContDynamicEnum[U],this.placement,this.staffNumber,F,this.activeInstantaneousDynamic,G);this.openContinuousDynamicExpressions.push(W);let q=this.getMultiExpression;q||(q=this.createNewMultiExpressionIfNeeded(F,G)),q.StartingContinuousDynamic=W,W.StartMultiExpression=q,this.activeInstantaneousDynamic!==void 0&&this.activeInstantaneousDynamic.StaffNumber===W.StaffNumber&&(this.activeInstantaneousDynamic=void 0)}else if(U==="stop")for(const W of this.openContinuousDynamicExpressions)W.NumberXml===G&&W.NumberXml===G&&this.closeOpenContinuousDynamic(W,F,D)}catch(W){const q="ReaderErrorMessages/WedgeError, Error while reading Crescendo / Diminuendo.";this.musicSheet.SheetErrors.pushMeasureError(q),log$2.debug("ExpressionReader.addWedge",q,W)}}}fillMultiOrTempoExpression(R,F,D,G){if(!R)return;const U=R.trim();this.createExpressionFromString("",U,F,D,R,G)}createExpressionFromString(R,F,D,G,U,W){if(InstantaneousTempoExpression.isInputStringInstantaneousTempo(F)||ContinuousTempoExpression.isInputStringContinuousTempo(F)){if(D.TempoExpressions.length>0)for(let Z=0,K=D.TempoExpressions.length;Z0)for(let Z=0,K=D.TempoExpressions.length;Z0&&!this.hasDigit(F)&&this.globalStaffIndex>0){if(te.EntriesList[0].label.indexOf(F)>=0)return!1;break}}let Y=TextAlignmentEnum.CenterBottom;this.musicSheet.Rules.CompactMode&&(Y=TextAlignmentEnum.LeftBottom);const J=new UnknownExpression(F,this.placement,Y,this.staffNumber);return J.fontStyle=W,q.addExpression(J,R),!1}closeOpenContinuousDynamic(R,F,D){if(!R)return;const G=R.NumberXml;R.EndMultiExpression=this.createNewMultiExpressionIfNeeded(F,G,D),R.StartMultiExpression.EndingContinuousDynamic=R,this.openContinuousDynamicExpressions=this.openContinuousDynamicExpressions.filter(U=>U!==R)}closeOpenContinuousTempo(R){this.openContinuousTempoExpression.AbsoluteEndTimestamp=R,this.openContinuousTempoExpression=void 0}checkIfWordsNodeIsRepetitionInstruction(R){return R=R.trim().toLowerCase(),R==="coda"||R==="tocoda"||R==="to coda"||R==="fine"||R==="d.c."||R==="dacapo"||R==="da capo"||R==="d.s."||R==="dalsegno"||R==="dal segno"||R==="d.c. al fine"||R==="d.s. al fine"||R==="d.c. al coda"||R==="d.s. al coda"}hasDigit(R){return/\d/.test(R)}}class Slur{constructor(){}get StartNote(){return this.startNote}set StartNote(R){this.startNote=R}get EndNote(){return this.endNote}set EndNote(R){this.endNote=R}startNoteHasMoreStartingSlurs(){if(!this.startNote)return!1;for(let R=0,F=this.startNote.NoteSlurs.length;R0){const G=D.attribute("type").value;let U=1;try{D.attribute("number")&&(U=parseInt(D.attribute("number").value,10))}catch(J){log$2.debug("VoiceGenerator.addSlur number: ",J)}let W=PlacementEnum.NotYetDefined;const q=D.attribute("placement");q&&q.value&&(q.value==="above"?W=PlacementEnum.Above:q.value==="below"&&(W=PlacementEnum.Below));const Y=D.attribute("orientation");if(Y&&Y.value&&(Y.value==="over"?W=PlacementEnum.Above:Y.value==="under"&&(W=PlacementEnum.Below)),G==="start"){let J=this.openSlurDict[U];J||(J=new Slur,this.openSlurDict[U]=J),J.StartNote=F,J.PlacementXml=W}else if(G==="stop"){const J=this.openSlurDict[U];J&&(J.EndNote=F,F.checkForDoubleSlur(J)||(F.NoteSlurs.push(J),J.StartNote.NoteSlurs.push(J)),delete this.openSlurDict[U])}}}}catch{const G=ITextTranslation.translateText("ReaderErrorMessages/SlurError","Error while reading slur.");this.musicSheet.SheetErrors.pushMeasureError(G)}}}class InstrumentReader{constructor(R,F,D,G){this.voiceGeneratorsDict={},this.staffMainVoiceGeneratorDict={},this.divisions=0,this.currentClefNumber=1,this.currentXmlMeasureIndex=0,this.activeKeyHasBeenInitialized=!1,this.abstractInstructions=[],this.openChordSymbolContainers=[],this.soundTempos=new Map,this.xmlNotes=[],this.repetitionInstructionReader=F,this.xmlMeasureList=D,this.musicSheet=G.GetMusicSheet,this.instrument=G,this.activeClefs=new Array(G.Staves.length),this.activeClefsHaveBeenInitialized=new Array(G.Staves.length);for(let U=0;U=this.xmlMeasureList.length)return!1;this.currentMeasure=R,this.followingMultirestMeasures=Math.max(this.followingMultirestMeasures-1,0),this.inSourceMeasureInstrumentIndex=this.musicSheet.getGlobalStaffIndexOfFirstStaff(this.instrument),this.repetitionInstructionReader&&this.repetitionInstructionReader.prepareReadingMeasure(R,this.currentXmlMeasureIndex);let G=new Fraction$1(0,1),U=new Fraction$1(0,1),W=!1;this.maxTieNoteFraction=new Fraction$1(0,1);let q=!1;const Y=[];try{const ce=this.xmlMeasureList[this.currentXmlMeasureIndex],he=ce.elements();if(R.Rules.UseXMLMeasureNumbers&&!Number.isInteger(R.MeasureNumberXML)){const be=parseInt((J=ce.attribute("number"))==null?void 0:J.value,10);Number.isInteger(be)&&(R.MeasureNumberXML=be)}let fe;for(let be=0;be0&&(fe=he[be-1]),ue.name==="print"){const ge=ue.attribute("new-system");(ge==null?void 0:ge.value)==="yes"&&(R.printNewSystemXml=!0);const ve=ue.attribute("new-page");(ve==null?void 0:ve.value)==="yes"&&(R.printNewPageXml=!0)}else if(ue.name==="note"){ue.element("grace")||(this.xmlNotes.push(ue),Y.push(ue));let ge=!0;((Z=ue.attribute("print-object"))==null?void 0:Z.value)==="no"&&(ge=!1);let ve=1;this.instrument.Staves.length>1&&ue.element("staff")&&(ve=parseInt(ue.element("staff").value,10),isNaN(ve)&&(log$2.debug("InstrumentReader.readNextXmlMeasure.get staff number"),ve=1)),this.currentStaff=this.instrument.Staves[ve-1];const Se=ue.element("chord")!==void 0;if(ue.element("voice")){const Le=parseInt(ue.element("voice").value,10);this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(Le,ve-1)}else(!Se||!this.currentVoiceGenerator)&&(this.currentVoiceGenerator=this.getOrCreateVoiceGenerator(1,ve-1));let pe=0,ye=new Fraction$1(0,1),Ee=2,de,we=!1;if(ue.element("duration")){if(pe=parseInt(ue.element("duration").value,10),isNaN(pe)){const Le=ITextTranslation.translateText("ReaderErrorMessages/NoteDurationError","Invalid Note Duration.");this.musicSheet.SheetErrors.pushMeasureError(Le),log$2.debug("InstrumentReader.readNextXmlMeasure",Le);continue}else if(ye=new Fraction$1(pe,4*this.divisions),pe===0?ye=this.getNoteDurationFromTypeNode(ue):de=this.getNoteDurationFromTypeNode(ue),ue.element("time-modification")){ye=this.getNoteDurationForTuplet(ue);const Le=ue.element("time-modification");Le!=null&&Le.element("normal-notes")&&(Ee=parseInt(Le.element("normal-notes").value,10)),we=!0}}const Oe=ue.element("rest")!==void 0,Me=ue.element("notations"),Pe=ue.element("grace")!==void 0||pe===0||Se&&q;let Ne=!1,ke=!1;if(Pe){const Le=ue.element("duration"),je=ue.element("grace");je&&je.attributes()&&je.attribute("slash")&&je.attribute("slash").value==="yes"&&(Ne=!0),Le||(ye=this.getNoteDurationFromTypeNode(ue));const Xe=ue.element("notations");Xe&&Xe.element("slur")&&(ke=!0)}let Ae=!1;ue.element("cue")&&(Ae=!0);const Fe=ue.element("type");let Ye=NoteType.UNDEFINED;if(Fe){const Le=Fe.attribute("size");(Le==null?void 0:Le.value)==="cue"&&(Ae=!0),Ye=NoteTypeHandler.StringToNoteType(Fe.value)}let Ce=StemDirectionType.Undefined,Ge;const We=ue.element("stem");if(We){switch(We.value){case"down":Ce=StemDirectionType.Down;break;case"up":Ce=StemDirectionType.Up;break;case"double":Ce=StemDirectionType.Double;break;case"none":Ce=StemDirectionType.None;break;default:Ce=StemDirectionType.Undefined}const Le=We.attribute("color");Le&&(Ge=this.parseXmlColor(Le.value))}let Ve=0,Ze="",nt="";if(Me){const Le=Me.element("ornaments");if(Le){const Xe=Le.element("tremolo");if(Xe){const He=Xe.attribute("type");if(Ze=He.value,He){const tt=parseInt(Xe.value,10);tt>0&&(Ve=tt),(He.value==="start"||He.value==="stop")&&(ye=new Fraction$1(parseInt(ue.element("duration").value,10),4*this.divisions))}}const Qe=Le.elements("wavy-line");if(Qe!==void 0)for(const He of Qe){const tt=this.expressionReaders[this.readExpressionStaffNumber(ue)-1];tt&&(tt.readExpressionParameters(He,this.instrument,this.divisions,G,U,this.currentMeasure.MeasureNumber,!1),tt.addWavyLine(He,this.currentMeasure,G,U))}}const je=Me.element("glissando");je&&je.attribute("type").value==="start"&&(nt="start")}let at;const ct=ue.element("notehead");if(ct){const Le=ct.attribute("color");Le&&(at=this.parseXmlColor(Le.value))}let De;const xe=ue.attribute("color");xe&&(De=this.parseXmlColor(xe.value),at||(at=De),Ge||(Ge=De));let ze=G.clone();Se&&(ze=U.clone()),this.currentStaffEntry=this.currentMeasure.findOrCreateStaffEntry(ze,this.inSourceMeasureInstrumentIndex+ve-1,this.currentStaff).staffEntry,(!this.currentVoiceGenerator.hasVoiceEntry()||!Se&&!Pe&&!q||Pe&&!q||Pe&&!Se||!Pe&&q)&&this.currentVoiceGenerator.createVoiceEntry(ze,this.currentStaffEntry,this.activeKey,this.ActiveRhythm,Pe,Ne,ke),!Pe&&!Se&&(U=G.clone(),G.Add(ye)),Se&&this.currentStaffEntry!==void 0&&this.currentStaffEntry.ParentStaff!==this.currentStaff&&(this.currentStaffEntry=this.currentVoiceGenerator.checkForStaffEntryLink(this.inSourceMeasureInstrumentIndex+ve-1,this.currentStaff,this.currentStaffEntry,this.currentMeasure));const qe=this.currentStaffEntry!==void 0&&this.currentStaffEntry.Timestamp!==void 0&&this.currentStaffEntry.Timestamp.Equals(new Fraction$1(0,1))&&!this.currentStaffEntry.hasNotes();this.saveAbstractInstructionList(this.instrument.Staves.length,qe),this.openChordSymbolContainers.length!==0&&(this.currentStaffEntry.ChordContainers=this.openChordSymbolContainers,this.openChordSymbolContainers=[]),this.activeRhythm,!we&&!Pe&&(ye=new Fraction$1(pe,4*this.divisions));const Re=ue.elements("dot").length;if(this.currentVoiceGenerator.read(ue,ye,de,Ye,Ee,Oe,this.currentStaffEntry,this.currentMeasure,F,this.maxTieNoteFraction,Se,D,ge,Ae,Pe,Ce,Ve,Ge,at,Re,Ze,nt),Me!==void 0&&Me.element("dynamics")){const Le=this.expressionReaders[this.readExpressionStaffNumber(ue)-1];Le&&(Le.readExpressionParameters(ue,this.instrument,this.divisions,G,U,this.currentMeasure.MeasureNumber,!1),Le.read(ue,this.currentMeasure,U,void 0,Y.length))}q=Pe}else if(ue.name==="attributes"){const ge=ue.element("divisions");if(ge&&(this.divisions=parseInt(ge.value,10),isNaN(this.divisions))){const pe=ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(log$2.debug("InstrumentReader.readNextXmlMeasure",pe),this.divisions=this.readDivisionsFromNotes(),this.divisions>0)this.musicSheet.SheetErrors.push(pe+this.instrument.Name);else throw W=!0,new MusicSheetReadingException(pe+this.instrument.Name)}if(!ue.element("divisions")&&this.divisions===0&&this.currentXmlMeasureIndex===0){const pe=ITextTranslation.translateText("ReaderErrorMessages/DivisionError","Invalid divisions value at Instrument: ");if(this.divisions=this.readDivisionsFromNotes(),this.divisions>0)this.musicSheet.SheetErrors.push(pe+this.instrument.Name);else throw W=!0,new MusicSheetReadingException(pe+this.instrument.Name)}this.addAbstractInstruction(ue,D,fe,G.clone()),G.Equals(new Fraction$1(0,1))&&this.isAttributesNodeAtBeginOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],ue)&&this.saveAbstractInstructionList(this.instrument.Staves.length,!0),this.isAttributesNodeAtEndOfMeasure(this.xmlMeasureList[this.currentXmlMeasureIndex],ue)&&this.saveClefInstructionAtEndOfMeasure();const ve=ue.elements("staff-details");for(const pe of ve){const ye=pe.element("staff-lines");if(ye){let Ee=1;const de=pe.attribute("number");de&&(Ee=parseInt(de.value,10)),this.instrument.Staves[Ee-1].StafflineCount=parseInt(ye.value,10)}}const Se=ue.element("measure-style");if(Se){const pe=Se.element("multiple-rest");if(pe){const ye=pe.value;let Ee=0;try{Ee=Number.parseInt(ye,10),R.multipleRestMeasures!==void 0&&Ee!==R.multipleRestMeasures?R.multipleRestMeasures=0:(R.multipleRestMeasures=Ee,this.currentMultirestStartMeasure=R,this.followingMultirestMeasures=Ee+1)}catch(de){console.log("multirest parse error: "+de)}}}}else if(ue.name==="forward"){const ge=parseInt(ue.element("duration").value,10);G.Add(new Fraction$1(ge,4*this.divisions))}else if(ue.name==="backup"){const ge=parseInt(ue.element("duration").value,10);G.Sub(new Fraction$1(ge,4*this.divisions)),G.IsNegative()&&(G=new Fraction$1(0,1)),U.Sub(new Fraction$1(ge,4*this.divisions)),U.IsNegative()&&(U=new Fraction$1(0,1))}else if(ue.name==="direction"){const ge=ue.elements("direction-type"),ve=ue.element("direction-type");let Se=Math.min(1,G.RealValue);this.activeRhythm!==void 0&&this.activeRhythm.Rhythm&&(Se/=this.activeRhythm.Rhythm.RealValue);let pe=!1;if(this.repetitionInstructionReader&&(pe=this.repetitionInstructionReader.handleRepetitionInstructionsFromWordsOrSymbols(ve,Se)),!pe){let ye=this.expressionReaders[0];const Ee=this.readExpressionStaffNumber(ue)-1;if(EeOe==null?void 0:Oe.toLocaleLowerCase()).includes((K=de.value)==null?void 0:K.toLocaleLowerCase())&&(this.currentGradualChangeMeasure=this.currentMeasure,this.currentMeasure.speedInfo={startWord:(te=de.value)==null?void 0:te.toLocaleLowerCase(),startXmlNoteIndex:Y.length,endXmlNoteIndex:0,resetXmlNoteIndex:0,startMeasureListIndex:this.currentXmlMeasureIndex,endMeasureListIndex:0,resetMeasureListIndex:0},this.xmlNotes=[]),de.value.startsWith(GRADIENT_SPEED_CLOSE_TAG)&&((Q=this.currentGradualChangeMeasure)==null?void 0:Q.speedInfo)&&(this.currentGradualChangeMeasure.speedInfo={...this.currentGradualChangeMeasure.speedInfo,endXmlNoteIndex:this.xmlNotes.length,endMeasureListIndex:this.currentXmlMeasureIndex}),((ie=de.value)==null?void 0:ie.toLocaleLowerCase())==="a tempo".toLocaleLowerCase()&&((se=this.currentGradualChangeMeasure)==null?void 0:se.speedInfo))){const{endXmlNoteIndex:Oe,resetXmlNoteIndex:Me,endMeasureListIndex:Pe}=this.currentGradualChangeMeasure.speedInfo;Me===0&&(this.currentGradualChangeMeasure.speedInfo={...this.currentGradualChangeMeasure.speedInfo,endXmlNoteIndex:Oe||this.xmlNotes.length,endMeasureListIndex:Pe||this.currentXmlMeasureIndex,resetXmlNoteIndex:this.xmlNotes.length,resetMeasureListIndex:this.currentXmlMeasureIndex}),this.xmlNotes=[]}if(ge.find(we=>we.element("metronome"))&&((ne=this.currentGradualChangeMeasure)==null?void 0:ne.speedInfo)){const{endXmlNoteIndex:we,resetXmlNoteIndex:Oe,endMeasureListIndex:Me}=this.currentGradualChangeMeasure.speedInfo;Oe===0&&(this.currentGradualChangeMeasure.speedInfo={...this.currentGradualChangeMeasure.speedInfo,endXmlNoteIndex:we||this.xmlNotes.length,endMeasureListIndex:Me||this.currentXmlMeasureIndex,resetXmlNoteIndex:this.xmlNotes.length,resetMeasureListIndex:this.currentXmlMeasureIndex}),this.xmlNotes=[]}ye.readExpressionParameters(ue,this.instrument,this.divisions,G,U,this.currentMeasure.MeasureNumber,!1),ye.read(ue,this.currentMeasure,G,U.clone(),Y.length)}}}else if(ue.name==="barline"){this.repetitionInstructionReader&&this.repetitionInstructionReader.handleLineRepetitionInstructions(ue)&&(this.currentMeasure.HasEndLine=!0);const ge=ue.attribute("location");if(be===he.length-1||ge&&ge.value==="right"){const Se=(re=ue.element("bar-style"))==null?void 0:re.value;if(Se&&(this.currentMeasure.endingBarStyleXml=Se,this.currentMeasure.endingBarStyleEnum=SystemLinesEnumHelper.xmlBarlineStyleToSystemLinesEnum(Se),(ae=this.currentGradualChangeMeasure)!=null&&ae.speedInfo)){const{endXmlNoteIndex:pe,resetXmlNoteIndex:ye,endMeasureListIndex:Ee}=this.currentGradualChangeMeasure.speedInfo;ye===0&&(this.currentGradualChangeMeasure.speedInfo={...this.currentGradualChangeMeasure.speedInfo,endXmlNoteIndex:pe||this.xmlNotes.length,endMeasureListIndex:Ee||this.currentXmlMeasureIndex,resetXmlNoteIndex:this.xmlNotes.length,resetMeasureListIndex:this.currentXmlMeasureIndex}),this.currentGradualChangeMeasure=void 0,this.xmlNotes=[]}}}else if(ue.name==="sound")try{if(ue.attribute("tempo")){const ge=parseFloat(ue.attribute("tempo").value);ue.element("offset")&&(this.soundTempos.has(this.currentXmlMeasureIndex)||this.soundTempos.set(this.currentXmlMeasureIndex,[]),this.soundTempos.get(this.currentXmlMeasureIndex).push(ge)),this.currentXmlMeasureIndex===0&&(this.musicSheet.DefaultStartTempoInBpm=ge,this.musicSheet.HasBPMInfo=!0)}}catch(ge){log$2.debug("InstrumentReader.readTempoInstruction",ge)}else ue.name==="harmony"&&this.openChordSymbolContainers.push(ChordSymbolReader.readChordSymbol(ue,this.musicSheet,this.activeKey))}for(const be in this.voiceGeneratorsDict)this.voiceGeneratorsDict.hasOwnProperty(be)&&this.voiceGeneratorsDict[be].checkForOpenBeam();if(this.currentXmlMeasureIndex===this.xmlMeasureList.length-1){for(let be=0;be{this.voiceGeneratorsDict[be].finalizeReadingMeasure()}),this.musicSheet.HasBPMInfo?R.TempoInBPM===0&&this.previousMeasure&&(this.currentMeasure.TempoInBPM=this.previousMeasure.TempoInBPM):this.currentMeasure.TempoInBPM=120,this.currentMeasure.TempoInBPM||(this.currentMeasure.TempoInBPM=this.musicSheet.DefaultStartTempoInBpm)}catch(ce){if(W)throw new MusicSheetReadingException(ce.Message);const he=ITextTranslation.translateText("ReaderErrorMessages/MeasureError","Error while reading Measure.");this.musicSheet.SheetErrors.pushMeasureError(he),log$2.debug("InstrumentReader.readNextXmlMeasure",he,ce)}return this.previousMeasure=this.currentMeasure,this.currentXmlMeasureIndex+=1,!0}parseXmlColor(R){if(!!R)return R.length===7?R:R.length===9?"#"+R.substr(3):void 0}doCalculationsAfterDurationHasBeenSet(){for(const R in this.voiceGeneratorsDict)this.voiceGeneratorsDict.hasOwnProperty(R)&&this.voiceGeneratorsDict[R].checkOpenTies()}getOrCreateVoiceGenerator(R,F){const D=this.instrument.Staves[F];let G=this.voiceGeneratorsDict[R];if(G)D.Voices.indexOf(G.GetVoice)===-1&&D.Voices.push(G.GetVoice);else{const U=this.staffMainVoiceGeneratorDict[F];U?(G=new VoiceGenerator(this.pluginManager,D,R,this.slurReader,U.GetVoice),D.Voices.push(G.GetVoice),this.voiceGeneratorsDict[R]=G):(G=new VoiceGenerator(this.pluginManager,D,R,this.slurReader),D.Voices.push(G.GetVoice),this.voiceGeneratorsDict[R]=G,this.staffMainVoiceGeneratorDict[F]=G)}return G}createExpressionGenerators(R){this.expressionReaders=new Array(R);for(let F=0;F0?F=this.musicSheet.SourceMeasures[0]:F=this.currentMeasure;const D=new ClefInstruction(ClefEnum.G,0,2);let G;F.FirstInstructionsStaffEntries[R]?(G=F.FirstInstructionsStaffEntries[R],G.removeFirstInstructionOfTypeClefInstruction()):(G=new SourceStaffEntry(void 0,void 0),F.FirstInstructionsStaffEntries[R]=G),D.Parent=G,G.Instructions.splice(0,0,D)}createDefaultKeyInstruction(){let R;this.musicSheet.SourceMeasures.length>0?R=this.musicSheet.SourceMeasures[0]:R=this.currentMeasure;const F=new KeyInstruction(void 0,0,KeyEnum.major);for(let D=this.inSourceMeasureInstrumentIndex;D0&&D[G-1].name==="backup")return!0;let U=-1;for(let W=0;W0||U<0}isAttributesNodeAtEndOfMeasure(R,F){const D=R.elements().slice();let G=0;for(let W=0;WU}getNoteDurationFromTypeNode(R){const F=R.element("type");if(F){const D=F.value;return NoteTypeHandler.getNoteDurationFromType(D)}return new Fraction$1(0,4*this.divisions)}addAbstractInstruction(R,F,D,G){if(R.element("divisions")&&R.elements().length===1)return;const U=R.element("transpose");if(U){const Y=U.element("chromatic");Y&&(this.instrument.PlaybackTranspose=parseInt(Y.value,10))}const W=R.elements("clef");let q;if(W.length>0)for(let Y=0,J=W.length;Y using default clef line."),this.musicSheet.SheetErrors.pushMeasureError(q),te=2,log$2.debug("InstrumentReader.addAbstractInstruction",q,ce)}const ne=Z.element("sign");if(ne)try{K=ClefEnum[ne.value],ClefInstruction.isSupportedClef(K)||(q=ITextTranslation.translateText("ReaderErrorMessages/ClefError","Unsupported clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(q),K=ClefEnum.G,te=2),K===ClefEnum.TAB&&(ie=-1)}catch(ce){q=ITextTranslation.translateText("ReaderErrorMessages/ClefError","Invalid clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(q),K=ClefEnum.G,te=2,log$2.debug("InstrumentReader.addAbstractInstruction",q,ce)}const re=Z.element("clef-octave-change");if(re)try{ie=parseInt(re.value,10)}catch{q=ITextTranslation.translateText("ReaderErrorMessages/ClefOctaveError","Invalid clef octave found -> using default clef octave."),this.musicSheet.SheetErrors.pushMeasureError(q),ie=0}if(Z.hasAttributes&&Z.attribute("number"))try{Q=parseInt(Z.attribute("number").value,10),Q>this.currentClefNumber&&(Q=this.currentClefNumber),this.currentClefNumber=Q+1}catch{q=ITextTranslation.translateText("ReaderErrorMessages/ClefError","Invalid clef found -> using default clef."),this.musicSheet.SheetErrors.pushMeasureError(q),Q=1,this.currentClefNumber=Q+1}const ae=new ClefInstruction(K,ie,te);this.abstractInstructions.push([Q,ae,G])}if(R.element("key")!==void 0&&this.instrument.MidiInstrumentId!==MidiInstrument.Percussion){let Y=0;const J=R.element("key").element("fifths");if(J)try{Y=parseInt(J.value,10)}catch(Q){q=ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key found -> set to default."),this.musicSheet.SheetErrors.pushMeasureError(q),Y=0,log$2.debug("InstrumentReader.addAbstractInstruction",q,Q)}let Z=KeyEnum.none,K=R.element("key");if(K&&(K=K.element("mode")),K)try{Z=KeyEnum[K.value]}catch(Q){q=ITextTranslation.translateText("ReaderErrorMessages/KeyError","Invalid key found -> set to default."),this.musicSheet.SheetErrors.pushMeasureError(q),Z=KeyEnum.major,log$2.debug("InstrumentReader.addAbstractInstruction",q,Q)}const te=new KeyInstruction(void 0,Y,Z);this.abstractInstructions.push([1,te,G])}if(R.element("time")){const Y=R.element("time");let J=RhythmSymbolEnum.NONE,Z=!0;if(Y!==void 0&&Y.hasAttributes){const re=Y.attribute("symbol");re&&(re.value==="common"?J=RhythmSymbolEnum.COMMON:re.value==="cut"&&(J=RhythmSymbolEnum.CUT));const ae=Y.attribute("print-object");ae&&ae.value==="no"&&(Z=!1)}let K=0,te=0;const Q=Y&&Y.element("senza-misura")!==void 0,ie=R.elements("time"),se=[],ne=[];for(let re=0,ae=ie.length;re0&&ne!==void 0&&se.length===ne.length){const ae=se.length,ce=new Array(ae);let he=0;for(let fe=0;fe set to default."),this.musicSheet.SheetErrors.pushMeasureError(q),K=4,te=4,log$2.debug("InstrumentReader.addAbstractInstruction",q,ae)}const re=new RhythmInstruction(new Fraction$1(K,te,0,!1),J);re.PrintObject=Z,this.abstractInstructions.push([1,re,G])}}}saveAbstractInstructionList(R,F){for(let D=this.abstractInstructions.length-1;D>=0;D--){const G=this.abstractInstructions[D],U=G[0],W=G[1],q=G[2];if(W instanceof ClefInstruction){const Y=W;if(this.currentXmlMeasureIndex===0||U<=this.activeClefs.length&&Y!==this.activeClefs[U-1])if(!F&&this.currentStaffEntry!==void 0&&!this.currentStaffEntry.hasNotes()&&U-1===this.instrument.Staves.indexOf(this.currentStaffEntry.ParentStaff)){const J=Y,Z=this.currentStaffEntry;if(q&&Math.abs(q.RealValue-Z.Timestamp.RealValue)>.01)continue;J.Parent=Z,Z.removeFirstInstructionOfTypeClefInstruction(),Z.Instructions.push(J),this.activeClefs[U-1]=Y,this.abstractInstructions.splice(D,1)}else if(F){if(q.RealValue!==0)continue;let J;if(this.currentMeasure){const Z=Y,K=this.inSourceMeasureInstrumentIndex+U-1,te=this.currentMeasure.FirstInstructionsStaffEntries[K];if(this.currentXmlMeasureIndex===0)if(!te)J=new SourceStaffEntry(void 0,void 0),this.currentMeasure.FirstInstructionsStaffEntries[K]=J,Z.Parent=J,J.Instructions.push(Z),this.activeClefsHaveBeenInitialized[U-1]=!0;else if(this.currentMeasure.FirstInstructionsStaffEntries[K]!==void 0&&!(te.Instructions[0]instanceof ClefInstruction))J=te,Z.Parent=J,J.removeFirstInstructionOfTypeClefInstruction(),J.Instructions.splice(0,0,Z),this.activeClefsHaveBeenInitialized[U-1]=!0;else{const Q=new SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[K]=Q,Z.Parent=Q,Q.Instructions.push(Z)}else if(this.activeClefsHaveBeenInitialized[U-1]){let Q=this.previousMeasure;this.followingMultirestMeasures>0&&this.currentMeasure.Rules.RenderMultipleRestMeasures&&(Q=this.currentMultirestStartMeasure);const ie=new SourceStaffEntry(void 0,void 0);Q.LastInstructionsStaffEntries[K]=ie,Z.Parent=ie,ie.Instructions.push(Z)}else{const Q=this.musicSheet.SourceMeasures[0];Q.FirstInstructionsStaffEntries[K]?(J=Q.FirstInstructionsStaffEntries[K],J.removeFirstInstructionOfTypeClefInstruction()):J=new SourceStaffEntry(void 0,void 0),Z.Parent=J,J.Instructions.splice(0,0,Z),this.activeClefsHaveBeenInitialized[U-1]=!0}this.activeClefs[U-1]=Y,this.abstractInstructions.splice(D,1)}}else{let J;const Z=this.activeRhythm.Rhythm;Z.RealValue>0&&q.RealValue/Z.RealValue>.9&&(this.currentMeasure.LastInstructionsStaffEntries[U-1]||(this.currentMeasure.LastInstructionsStaffEntries[U-1]=new SourceStaffEntry(void 0,this.instrument.Staves[U-1])),J=this.currentMeasure.LastInstructionsStaffEntries[U-1]),J&&(Y.Parent=J,J.Instructions.push(Y),this.activeClefs[U-1]=Y,this.abstractInstructions.splice(D,1))}else U<=this.activeClefs.length&&Y===this.activeClefs[U-1]&&this.abstractInstructions.splice(D,1)}if(W instanceof KeyInstruction){const Y=W;if(!this.activeKey||this.activeKey.Key!==Y.Key){this.activeKey=Y,this.abstractInstructions.splice(D,1);let J;if(this.activeKeyHasBeenInitialized?J=this.currentMeasure:(this.activeKeyHasBeenInitialized=!0,this.currentXmlMeasureIndex>0?J=this.musicSheet.SourceMeasures[0]:J=this.currentMeasure),J)for(let Z=this.inSourceMeasureInstrumentIndex;Z=0;R--){const F=this.abstractInstructions[R][0],D=this.abstractInstructions[R][1];if(D instanceof ClefInstruction){const G=D;if(!this.activeClefs[F-1]||G.ClefType!==this.activeClefs[F-1].ClefType||G.ClefType===this.activeClefs[F-1].ClefType&&G.Line!==this.activeClefs[F-1].Line){const U=new SourceStaffEntry(void 0,void 0);this.currentMeasure.LastInstructionsStaffEntries[this.inSourceMeasureInstrumentIndex+F-1]=U;const W=G;W.Parent=U,U.Instructions.push(W),this.activeClefs[F-1]=G,this.abstractInstructions.splice(R,1)}}}}getNoteDurationForTuplet(R){let F=new Fraction$1(0,1);const D=this.getNoteDurationFromTypeNode(R);if(R.element("time-modification")){const G=R.element("time-modification");if(G&&G.element("actual-notes")!==void 0&&G.element("normal-notes")){const U=G.element("actual-notes"),W=G.element("normal-notes");if(U!==void 0&&W){const q=parseInt(U.value,10),Y=parseInt(W.value,10);F=new Fraction$1(Y*D.Numerator,q*D.Denominator)}}}return F}readExpressionStaffNumber(R){let F=1;if(R.element("staff")){const D=R.element("staff");if(D)try{F=parseInt(D.value,10)}catch(G){const U=ITextTranslation.translateText("ReaderErrorMessages/ExpressionStaffError","Invalid Expression staff number -> set to default.");this.musicSheet.SheetErrors.pushMeasureError(U),F=1,log$2.debug("InstrumentReader.readExpressionStaffNumber",U,G)}}return F}readDivisionsFromNotes(){let R=0,F=this.currentXmlMeasureIndex,D=!1;for(;!D;){const G=this.xmlMeasureList[F].elements();for(let U=0,W=G.length;U0){D=!0;break}}if(R===0&&(F++,F===this.xmlMeasureList.length)){const U=ITextTranslation.translateText("ReaderErrorMEssages/DivisionsError","Invalid divisions value at Instrument: ");throw new MusicSheetReadingException(U+this.instrument.Name)}}return R}}const _SubInstrument=class{constructor(B){this.parentInstrument=B,this.fixedKey=-1,this.name=this.parseMidiInstrument(this.parentInstrument.Name),this.midiInstrumentID=_SubInstrument.midiInstrument[this.name],this.volume=1}get ParentInstrument(){return this.parentInstrument}static isPianoInstrument(B){return B===MidiInstrument.Acoustic_Grand_Piano||B===MidiInstrument.Bright_Acoustic_Piano||B===MidiInstrument.Electric_Grand_Piano||B===MidiInstrument.Electric_Piano_1||B===MidiInstrument.Electric_Piano_2}setMidiInstrument(B){this.midiInstrumentID=_SubInstrument.midiInstrument[this.parseMidiInstrument(B)]}parseMidiInstrument(B){try{if(B){let R=B.toLowerCase().trim();R=R.replace(/\s+/g,"_");for(const F in _SubInstrument.midiInstrument)if(R.indexOf(F)!==-1)return F}if(this.parentInstrument.Name){let R=this.parentInstrument.Name.toLowerCase().trim();R=R.replace(/\s+/g,"_");for(const F in _SubInstrument.midiInstrument)if(R.indexOf(F)!==-1)return F}}catch{log$2.error("Error parsing MIDI Instrument. Default to Grand Piano.")}return"unnamed"}};let SubInstrument=_SubInstrument;SubInstrument.midiInstrument={alto_saxophone:MidiInstrument.Alto_Sax,baritone_saxophone:MidiInstrument.Baritone_Sax,horn_in_f:MidiInstrument.French_Horn,english_horn:MidiInstrument.English_Horn,euphonium:MidiInstrument.Euphonium,clarinet_in_bb:MidiInstrument.clarinet_in_bb,clarinet_in_eb:MidiInstrument.clarinet_in_eb,clarinet:MidiInstrument.Clarinet,alto_clarinet:MidiInstrument.Alto_Clarinet,bass_clarinet:MidiInstrument.Bass_Clarinet,bassoon:MidiInstrument.Bassoon,bass_trombone:MidiInstrument.Bass_Trombone,alt:MidiInstrument.Synth_Voice,alto:MidiInstrument.Synth_Voice,banjo:MidiInstrument.Banjo,bariton:MidiInstrument.Synth_Voice,baritone:MidiInstrument.Synth_Voice,bass:MidiInstrument.Synth_Voice,blockfl\u00F6te:MidiInstrument.Recorder,brass:MidiInstrument.Trombone,bratsche:MidiInstrument.Viola,cello:MidiInstrument.Cello,contrabass:MidiInstrument.Contrabass,drums:MidiInstrument.Percussion,flute:MidiInstrument.Flute,fl\u00F6te:MidiInstrument.Flute,frenchhorn:MidiInstrument.French_Horn,gitarre:MidiInstrument.Acoustic_Guitar_nylon,guitar:MidiInstrument.Acoustic_Guitar_nylon,harfe:MidiInstrument.Orchestral_Harp,harp:MidiInstrument.Orchestral_Harp,klarinette:MidiInstrument.Clarinet,klavier:MidiInstrument.Acoustic_Grand_Piano,kontrabass:MidiInstrument.Contrabass,oboe:MidiInstrument.Oboe,organ:MidiInstrument.Church_Organ,orgel:MidiInstrument.Church_Organ,orgue:MidiInstrument.Church_Organ,percussion:MidiInstrument.Synth_Drum,\u5C0F\u519B\u9F13:MidiInstrument.Synth_Drum,snare_drum:MidiInstrument.Synth_Drum,bass_drum:MidiInstrument.Synth_Drum,side_drum:MidiInstrument.Synth_Drum,piano:MidiInstrument.Acoustic_Grand_Piano,piccolo:MidiInstrument.Piccolo,posaune:MidiInstrument.Trombone,recorder:MidiInstrument.Recorder,sax:MidiInstrument.Tenor_Sax,schlagwerk:MidiInstrument.Percussion,schlagzeug:MidiInstrument.Percussion,sopran:MidiInstrument.Synth_Voice,steeldrum:MidiInstrument.Steel_Drums,streicher:MidiInstrument.String_Ensemble_1,strings:MidiInstrument.String_Ensemble_1,tenor:MidiInstrument.Synth_Voice,tpt:MidiInstrument.Trumpet,trombone:MidiInstrument.Trombone,trompete:MidiInstrument.Trumpet,trumpet:MidiInstrument.Trumpet,tuba:MidiInstrument.Tuba,unnamed:MidiInstrument.Acoustic_Grand_Piano,viola:MidiInstrument.Viola,violin:MidiInstrument.Violin,"violon-c":MidiInstrument.Cello,"violon.":MidiInstrument.Violin,voice:MidiInstrument.Synth_Voice,woodblock:MidiInstrument.Woodblock,alto_clarinet_in_eb:MidiInstrument.AltoClarinetInEb,trumpet_in_bb:MidiInstrument.TrumpetInBb,tenor_saxophone:MidiInstrument.TenorSaxophone};class StringUtil{static StringContainsSeparatedWord(R,F,D=!1){return new RegExp("( |^)"+F+"([ .]|$)",D?"i":void 0).test(R)}}class RepetitionInstructionReader{set MusicSheet(R){this.musicSheet=R,this.xmlMeasureList=new Array(this.musicSheet.Instruments.length),this.repetitionInstructions=[]}prepareReadingMeasure(R,F){this.currentMeasureIndex=F}handleLineRepetitionInstructions(R){let F=!1;if(R.elements().length>0){let D="",G=!1,U="",W="",q="";const Y=[],J=R.element("bar-style");J&&(q=J.value),R.attributes().length>0&&R.attribute("location")?D=R.attribute("location").value:D="right";const Z=R.elements();for(let K=0,te=Z.length;K0)if(D==="left"){if(W==="start"){const K=new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.Ending,AlignmentType.Begin,void 0,Y);this.addInstruction(this.repetitionInstructions,K)}if(U==="forward"){const K=new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.StartLine);this.addInstruction(this.repetitionInstructions,K)}}else{if(W==="stop"){const K=new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.Ending,AlignmentType.End,void 0,Y);this.addInstruction(this.repetitionInstructions,K)}if(U==="backward"){const K=new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.BackJumpLine);this.addInstruction(this.repetitionInstructions,K)}}}return F}handleRepetitionInstructionsFromWordsOrSymbols(R,F){const D=R.element("words"),G=this.currentMeasureIndex;if(D){const U="d\\s?\\.s\\.",W=D.value.trim().toLowerCase();if(StringUtil.StringContainsSeparatedWord(W,U+" al fine",!0)){const Y=new RepetitionInstruction(G,RepetitionInstructionEnum.DalSegnoAlFine);return this.addInstruction(this.repetitionInstructions,Y),!0}if(StringUtil.StringContainsSeparatedWord(W,U+" al coda",!0)){const Y=new RepetitionInstruction(G,RepetitionInstructionEnum.DalSegnoAlCoda);return this.addInstruction(this.repetitionInstructions,Y),!0}const q="d\\.\\s?c\\.";if(StringUtil.StringContainsSeparatedWord(W,q+" al fine",!0)){const Y=new RepetitionInstruction(G,RepetitionInstructionEnum.DaCapoAlFine);return this.addInstruction(this.repetitionInstructions,Y),!0}if(StringUtil.StringContainsSeparatedWord(W,q+" al coda",!0)){const Y=new RepetitionInstruction(G,RepetitionInstructionEnum.DaCapoAlCoda);return this.addInstruction(this.repetitionInstructions,Y),!0}if(StringUtil.StringContainsSeparatedWord(W,q)||StringUtil.StringContainsSeparatedWord(W,"da\\s?capo",!0)){const Y=new RepetitionInstruction(G,RepetitionInstructionEnum.DaCapo);return this.addInstruction(this.repetitionInstructions,Y),!0}if(StringUtil.StringContainsSeparatedWord(W,U,!0)||StringUtil.StringContainsSeparatedWord(W,"dal\\s?segno",!0)){let Y;return StringUtil.StringContainsSeparatedWord(W,"al\\s?coda",!0)?Y=new RepetitionInstruction(G,RepetitionInstructionEnum.DalSegnoAlCoda):Y=new RepetitionInstruction(G,RepetitionInstructionEnum.DalSegno),this.addInstruction(this.repetitionInstructions,Y),!0}if(StringUtil.StringContainsSeparatedWord(W,"to\\s?coda",!0)||StringUtil.StringContainsSeparatedWord(W,"a (la )?coda",!0)){const Y=new RepetitionInstruction(G,RepetitionInstructionEnum.ToCoda);return this.addInstruction(this.repetitionInstructions,Y),!0}if(StringUtil.StringContainsSeparatedWord(W,"fine",!0)){const Y=new RepetitionInstruction(G,RepetitionInstructionEnum.Fine);return this.addInstruction(this.repetitionInstructions,Y),!0}if(StringUtil.StringContainsSeparatedWord(W,"coda",!0)){const Y=new RepetitionInstruction(G,RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,Y),!0}if(StringUtil.StringContainsSeparatedWord(W,"segno",!0)){const Y=new RepetitionInstruction(G,RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,Y),!0}}else if(R.element("segno")){const U=new RepetitionInstruction(G,RepetitionInstructionEnum.Segno);return this.addInstruction(this.repetitionInstructions,U),!0}else if(R.element("coda")){const U=new RepetitionInstruction(G,RepetitionInstructionEnum.Coda);return this.addInstruction(this.repetitionInstructions,U),!0}return!1}removeRedundantInstructions(){let R=0,F=0,D=0,G=0;for(let U=0;U0&&this.findInstructionInPreviousMeasure(U,W.measureIndex,RepetitionInstructionEnum.ToCoda)&&(W.type=RepetitionInstructionEnum.None),F===0&&D===0&&(W.type=RepetitionInstructionEnum.ToCoda,W.alignment=AlignmentType.End,W.measureIndex--);break;case RepetitionInstructionEnum.Segno:if(R-G>0){let q=!1;for(let Y=0,J=this.repetitionInstructions.length;Y0?Z.type=RepetitionInstructionEnum.DalSegnoAlCoda:Z.type=RepetitionInstructionEnum.DalSegno,W.type=RepetitionInstructionEnum.None,q=!0;break;case RepetitionInstructionEnum.DalSegno:case RepetitionInstructionEnum.DalSegnoAlFine:case RepetitionInstructionEnum.DalSegnoAlCoda:W.type=RepetitionInstructionEnum.None,q=!0;break}if(q)break}if(q)break;D-F>0?W.type=RepetitionInstructionEnum.DalSegnoAlCoda:W.type=RepetitionInstructionEnum.DalSegno,W.alignment=AlignmentType.End,W.measureIndex--}break}if(this.backwardSearchForPreviousIdenticalInstruction(U,W)||W.type===RepetitionInstructionEnum.None)this.repetitionInstructions.splice(U,1),U--;else switch(W.type){case RepetitionInstructionEnum.Fine:break;case RepetitionInstructionEnum.ToCoda:D++;break;case RepetitionInstructionEnum.Coda:F++;break;case RepetitionInstructionEnum.Segno:R++;break;case RepetitionInstructionEnum.DalSegnoAlFine:case RepetitionInstructionEnum.DalSegnoAlCoda:G++;break}}this.repetitionInstructions.sort(RepetitionInstructionComparer.Compare)}findInstructionInPreviousMeasure(R,F,D){for(let G=R-1;G>=0;G--){const U=this.repetitionInstructions[G];if(F-U.measureIndex===1&&U.type===D)return!0}return!1}backwardSearchForPreviousIdenticalInstruction(R,F){for(let D=R-1;D>=0;D--)if(this.repetitionInstructions[D].equals(F))return!0;return!1}addInstruction(R,F){let D=!0;for(let G=0,U=R.length;G0;)try{const q=this.openRepetitions.last();if(q.RepetitonUnderConstruction.FromWords){if(q.WaitingForCoda){let Y=q.RepetitonUnderConstruction.BackwardJumpInstructions.last().measureIndex+1;Y>=this.musicSheet.SourceMeasures.length&&(Y=-1),q.RepetitonUnderConstruction.setEndingStartIndex(2,Y)}else if(q.RepetitonUnderConstruction.BackwardJumpInstructions.length===0){this.openRepetitions.splice(this.openRepetitions.length-1,1);continue}}else if(q.RepetitonUnderConstruction.BackwardJumpInstructions.length===0){const Y=D.length-1,J=new RepetitionInstruction(Y,RepetitionInstructionEnum.BackJumpLine,AlignmentType.End,q.RepetitonUnderConstruction);q.RepetitonUnderConstruction.BackwardJumpInstructions.push(J),D[Y].LastRepetitionInstructions.push(J)}this.finalizeRepetition(this.openRepetitions.last())}catch{try{const Y=this.openRepetitions.last().RepetitonUnderConstruction;for(const J of this.repetitionInstructions)J.parentRepetition===Y&&(J.parentRepetition=void 0);this.openRepetitions.splice(this.openRepetitions.length-1,1)}catch(Y){log$2.error("RepetitionCalculator: calculateRepetitions2",Y)}}let G=!1;const U=0,W=this.musicSheet.SourceMeasures.length-1;for(const q of this.musicSheet.Repetitions)if(q.StartIndex===U&&q.EndIndex===W){G=!0;break}if(!G){const q=new Repetition(this.musicSheet,!0);q.FromWords=!0,q.startMarker=new RepetitionInstruction(U,RepetitionInstructionEnum.StartLine),q.startMarker.parentRepetition=q,this.musicSheet.SourceMeasures[U].FirstRepetitionInstructions.push(q.startMarker),q.endMarker=new RepetitionInstruction(W,RepetitionInstructionEnum.BackJumpLine),q.endMarker.parentRepetition=q,q.BackwardJumpInstructions.push(q.endMarker),q.UserNumberOfRepetitions=q.DefaultNumberOfRepetitions,this.musicSheet.Repetitions.push(q)}for(let q=0,Y=this.musicSheet.SourceMeasures.length;q1&&J.FirstRepetitionInstructions.sort(RepetitionInstructionComparer.Compare),J.LastRepetitionInstructions.length>1&&J.LastRepetitionInstructions.sort(RepetitionInstructionComparer.Compare)}}handleRepetitionInstructions(R){let F;switch(R.type){case RepetitionInstructionEnum.StartLine:F=this.createNewRepetition(this.currentMeasureIndex),R.parentRepetition=F.RepetitonUnderConstruction,F.RepetitonUnderConstruction.FromWords=!1,F.RepetitonUnderConstruction.startMarker=R,this.currentMeasure.FirstRepetitionInstructions.push(R);break;case RepetitionInstructionEnum.BackJumpLine:F=this.getOrCreateCurrentRepetition2(!1),R.parentRepetition=F.RepetitonUnderConstruction,F.RepetitonUnderConstruction.BackwardJumpInstructions.push(R),this.currentMeasure.LastRepetitionInstructions.push(R),F.RepetitonUnderConstruction.EndingParts.length===0&&this.finalizeRepetition(F);break;case RepetitionInstructionEnum.Ending:if(F=this.getOrCreateCurrentRepetition(),R.parentRepetition=F.RepetitonUnderConstruction,R.endingIndices.contains(1)&&R.alignment===AlignmentType.Begin){if(F.RepetitonUnderConstruction.BackwardJumpInstructions.length>0||F.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)){F=void 0;for(let G=this.openRepetitions.length-1;G>=0;G--){const U=this.openRepetitions[G];if(U.RepetitonUnderConstruction.BackwardJumpInstructions.length===0)for(F=U;this.openRepetitions.length-1>G;){const W=this.openRepetitions.last();this.finalizeRepetition(W)}}F===void 0&&(F=this.createNewRepetition(0),F.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None))}F.RepetitonUnderConstruction.forwardJumpInstruction===void 0&&(F.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(this.currentMeasureIndex-1,RepetitionInstructionEnum.ForwardJump,AlignmentType.End,F.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[this.currentMeasureIndex-1].LastRepetitionInstructions.push(F.RepetitonUnderConstruction.forwardJumpInstruction))}if(R.alignment===AlignmentType.Begin)F.RepetitonUnderConstruction.setEndingsStartIndex(R.endingIndices,this.currentMeasureIndex),this.currentMeasure.FirstRepetitionInstructions.push(R);else for(let G=0,U=R.endingIndices.length;G0&&Math.abs(F.RepetitonUnderConstruction.BackwardJumpInstructions.last().measureIndex-this.currentMeasureIndex)<=1||this.openRepetitions.length&&this.openRepetitions.find(G=>G.RepetitonUnderConstruction.startMarker.type===RepetitionInstructionEnum.StartLine).RepetitonUnderConstruction.StartIndex===this.currentMeasureIndex)break;F=this.createNewRepetition(this.currentMeasureIndex),R.parentRepetition=F.RepetitonUnderConstruction,F.RepetitonUnderConstruction.FromWords=!0,F.SegnoFound=!0,F.RepetitonUnderConstruction.startMarker=R,this.currentMeasure.FirstRepetitionInstructions.push(R);break;case RepetitionInstructionEnum.Fine:if(this.openRepetitions.length===0||(F=this.getCurrentRepetition(!0),F===void 0))break;R.parentRepetition=F.RepetitonUnderConstruction,F.RepetitonUnderConstruction.FromWords=!0,F.RepetitonUnderConstruction.forwardJumpInstruction===void 0?(F.FineFound=!0,F.RepetitonUnderConstruction.forwardJumpInstruction=R,F.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.currentMeasure.LastRepetitionInstructions.push(R)):this.currentMeasure.LastRepetitionInstructions.push(new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.Fine,AlignmentType.End,void 0));break;case RepetitionInstructionEnum.ToCoda:if(this.openRepetitions.length===0||(F=this.getCurrentRepetition(!0),F===void 0))break;F.RepetitonUnderConstruction.forwardJumpInstruction===void 0&&(R.parentRepetition=F.RepetitonUnderConstruction,F.RepetitonUnderConstruction.FromWords=!0,F.ToCodaFound=!0,F.RepetitonUnderConstruction.forwardJumpInstruction=R,this.currentMeasure.LastRepetitionInstructions.push(R));break;case RepetitionInstructionEnum.Coda:if(this.openRepetitions.length===0)break;F=this.getOrCreateCurrentRepetition2(!0),R.parentRepetition=F.RepetitonUnderConstruction,F.WaitingForCoda?(F.CodaFound=!0,F.RepetitonUnderConstruction.setEndingStartIndex(2,this.currentMeasureIndex),this.currentMeasure.LastRepetitionInstructions.push(R),this.finalizeRepetition(F),this.currentMeasureIndex>0&&(this.musicSheet.SourceMeasures[this.currentMeasureIndex-1].printNewSystemXml=!0)):F.ToCodaFound||(F.RepetitonUnderConstruction.BackwardJumpInstructions.length===0?(F.ToCodaFound=!0,F.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.ToCoda,AlignmentType.End,F.RepetitonUnderConstruction),this.currentMeasure.LastRepetitionInstructions.push(F.RepetitonUnderConstruction.forwardJumpInstruction)):this.currentMeasure.LastRepetitionInstructions.push(new RepetitionInstruction(this.currentMeasureIndex,RepetitionInstructionEnum.Coda,AlignmentType.Begin,void 0)));break;case RepetitionInstructionEnum.DaCapo:F=this.getOrCreateCurrentRepetition(),F.RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&this.finalizeRepetition(F),F.RepetitonUnderConstruction.StartIndex!==0&&(F=this.createNewRepetition(0)),R.parentRepetition=F.RepetitonUnderConstruction,F.RepetitonUnderConstruction.FromWords=!0,F.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None,AlignmentType.Begin,F.RepetitonUnderConstruction),F.RepetitonUnderConstruction.BackwardJumpInstructions.push(R),this.currentMeasure.LastRepetitionInstructions.push(R),F.RepetitonUnderConstruction.EndingParts.length===0&&this.finalizeRepetition(F);break;case RepetitionInstructionEnum.DalSegno:if(F=this.getOrCreateCurrentRepetition2(!0),F.RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&(this.finalizeRepetition(F),F=this.createNewRepetition(0),F.RepetitonUnderConstruction.FromWords=!0,F.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None,AlignmentType.Begin,F.RepetitonUnderConstruction)),R.parentRepetition=F.RepetitonUnderConstruction,!F.SegnoFound){const G=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Segno,R.measureIndex);G>=0&&(F.SegnoFound=!0,F.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(G,RepetitionInstructionEnum.Segno,AlignmentType.Begin,F.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[G].FirstRepetitionInstructions.splice(0,0,F.RepetitonUnderConstruction.startMarker))}F.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)&&F.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),F.RepetitonUnderConstruction.BackwardJumpInstructions.push(R),this.currentMeasure.LastRepetitionInstructions.push(R);break;case RepetitionInstructionEnum.DalSegnoAlFine:if(this.openRepetitions.length===0)break;if(F=this.getOrCreateCurrentRepetition2(!0),R.parentRepetition=F.RepetitonUnderConstruction,!F.SegnoFound){const G=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Segno,R.measureIndex);G>=0&&(F.SegnoFound=!0,F.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(G,RepetitionInstructionEnum.Segno,AlignmentType.Begin,F.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[G].FirstRepetitionInstructions.splice(0,0,F.RepetitonUnderConstruction.startMarker))}if(!F.FineFound){const G=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Fine,R.measureIndex);G>=0&&(F.FineFound=!0,F.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(G,RepetitionInstructionEnum.Fine,AlignmentType.Begin,F.RepetitonUnderConstruction),F.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.musicSheet.SourceMeasures[G].LastRepetitionInstructions.splice(0,0,F.RepetitonUnderConstruction.forwardJumpInstruction))}F.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||F.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),F.RepetitonUnderConstruction.BackwardJumpInstructions.push(R),this.currentMeasure.LastRepetitionInstructions.push(R);break;case RepetitionInstructionEnum.DaCapoAlFine:if(F=this.getOrCreateCurrentRepetition(),F.RepetitonUnderConstruction.BackwardJumpInstructions.length>0&&(this.finalizeRepetition(F),F=this.createNewRepetition(0)),F.RepetitonUnderConstruction.startMarker!==void 0&&F.RepetitonUnderConstruction.StartIndex!==0&&(F=this.createNewRepetition(0)),F.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None,AlignmentType.Begin,F.RepetitonUnderConstruction),F.RepetitonUnderConstruction.FromWords=!0,R.parentRepetition=F.RepetitonUnderConstruction,!F.FineFound){const G=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Fine,R.measureIndex);G>=0&&(F.FineFound=!0,F.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(G,RepetitionInstructionEnum.Fine,AlignmentType.Begin,F.RepetitonUnderConstruction),F.RepetitonUnderConstruction.setEndingStartIndex(2,-2),this.musicSheet.SourceMeasures[G].LastRepetitionInstructions.splice(0,0,F.RepetitonUnderConstruction.forwardJumpInstruction))}F.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||F.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),F.RepetitonUnderConstruction.BackwardJumpInstructions.push(R),this.currentMeasure.LastRepetitionInstructions.push(R);break;case RepetitionInstructionEnum.DalSegnoAlCoda:if(this.openRepetitions.length===0)break;if(F=this.getOrCreateCurrentRepetition2(!0),R.parentRepetition=F.RepetitonUnderConstruction,!F.SegnoFound){const G=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Segno,R.measureIndex);G>=0&&(F.SegnoFound=!0,F.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(G,RepetitionInstructionEnum.Segno,AlignmentType.Begin,F.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[G].FirstRepetitionInstructions.splice(0,0,F.RepetitonUnderConstruction.startMarker))}if(!F.ToCodaFound){const G=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.ToCoda,R.measureIndex);if(G>=0)F.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(G,RepetitionInstructionEnum.ToCoda,AlignmentType.Begin,F.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[G].LastRepetitionInstructions.splice(0,0,F.RepetitonUnderConstruction.forwardJumpInstruction),F.ToCodaFound=!0;else{const U=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Coda,R.measureIndex);U>=0&&(F.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(U,RepetitionInstructionEnum.ToCoda,AlignmentType.Begin,F.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[U].LastRepetitionInstructions.splice(0,0,F.RepetitonUnderConstruction.forwardJumpInstruction),F.ToCodaFound=!0)}}F.ToCodaFound&&(F.WaitingForCoda=!0),F.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||F.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),F.RepetitonUnderConstruction.BackwardJumpInstructions.push(R),this.currentMeasure.LastRepetitionInstructions.push(R);break;case RepetitionInstructionEnum.DaCapoAlCoda:if(F=this.getOrCreateCurrentRepetition(),F.RepetitonUnderConstruction.BackwardJumpInstructions.length>0?(this.finalizeRepetition(F),F=this.createNewRepetition(0)):F.RepetitonUnderConstruction.EndingParts.length===0&&(this.finalizeRepetition(F),F=this.createNewRepetition(0)),F.RepetitonUnderConstruction.startMarker!==void 0&&F.RepetitonUnderConstruction.StartIndex!==0&&(F=this.createNewRepetition(0)),F.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None,AlignmentType.Begin,F.RepetitonUnderConstruction),F.RepetitonUnderConstruction.FromWords=!0,R.parentRepetition=F.RepetitonUnderConstruction,!F.ToCodaFound){const G=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.ToCoda,R.measureIndex);if(G>=0)F.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(G,RepetitionInstructionEnum.ToCoda,AlignmentType.Begin,F.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[G].LastRepetitionInstructions.splice(0,0,F.RepetitonUnderConstruction.forwardJumpInstruction),F.ToCodaFound=!0;else{const U=this.findInstructionInMainListBackwards(RepetitionInstructionEnum.Coda,R.measureIndex);U>=0&&(F.RepetitonUnderConstruction.forwardJumpInstruction=new RepetitionInstruction(U,RepetitionInstructionEnum.ToCoda,AlignmentType.Begin,F.RepetitonUnderConstruction),this.musicSheet.SourceMeasures[U].LastRepetitionInstructions.splice(0,0,F.RepetitonUnderConstruction.forwardJumpInstruction),F.ToCodaFound=!0)}}F.ToCodaFound&&(F.WaitingForCoda=!0),F.RepetitonUnderConstruction.EndingIndexDict.hasOwnProperty(1)||F.RepetitonUnderConstruction.setEndingEndIndex(1,this.currentMeasureIndex),F.RepetitonUnderConstruction.BackwardJumpInstructions.push(R),this.currentMeasure.LastRepetitionInstructions.push(R);break;case RepetitionInstructionEnum.None:break;default:throw new ArgumentOutOfRangeException("currentRepetitionInstruction")}return!0}findInstructionInMainListBackwards(R,F){for(let D=this.repetitionInstructions.length-1;D>=0;D--){const G=this.repetitionInstructions[D];if(G.measureIndex<=F&&G.type===R)return G.measureIndex}return-1}finalizeRepetition(R){const F=R.RepetitonUnderConstruction;if(F.BackwardJumpInstructions.length>0){let D=!0;const G=this.getLastFinalizedRepetition();if(G!==void 0&&F.coversIdenticalMeasures(G)){if(F.NumberOfEndings>G.NumberOfEndings){const U=this.musicSheet.Repetitions.indexOf(G,0);U>-1&&this.musicSheet.Repetitions.splice(U,1),G.removeFromRepetitionInstructions(),this.musicSheet.Repetitions.push(F)}D=!1,F.removeFromRepetitionInstructions()}else this.musicSheet.Repetitions.push(F);D&&(F.startMarker.type===RepetitionInstructionEnum.None&&this.musicSheet.SourceMeasures[F.StartIndex].FirstRepetitionInstructions.push(F.startMarker),F.UserNumberOfRepetitions=F.DefaultNumberOfRepetitions)}this.openRepetitions.splice(this.openRepetitions.length-1,1)}getCurrentRepetition(R){let F;for(let D=this.openRepetitions.length-1;D>=0;D--)if(this.openRepetitions[D].RepetitonUnderConstruction.FromWords===R){for(F=this.openRepetitions[D];D0)return this.openRepetitions.last();const R=this.createNewRepetition(0);return R.RepetitonUnderConstruction.startMarker=new RepetitionInstruction(0,RepetitionInstructionEnum.None,AlignmentType.Begin,R.RepetitonUnderConstruction),R}getOrCreateCurrentRepetition2(R){let F;if(this.openRepetitions.length&&this.openRepetitions.last().RepetitonUnderConstruction.EndingParts.length<2){for(let G=this.openRepetitions.length-1;G>=0;G--)if(F=this.openRepetitions[G],F.RepetitonUnderConstruction.FromWords===R){for(;G0){const D=this.openRepetitions.last(),G=D.RepetitonUnderConstruction;if(G.BackwardJumpInstructions.length>0){const U=Object.keys(G.EndingIndexDict);(U.length===0||G.EndingIndexDict[U[U.length-1]].part.EndIndex>=0)&&this.finalizeRepetition(D)}}const F=new RepetitionBuildingContainer(this.musicSheet);return this.lastRepetitionCommonPartStartIndex=R,this.openRepetitions.push(F),F}getLastFinalizedRepetition(){if(this.musicSheet.Repetitions.length>0)return this.musicSheet.Repetitions.last()}}class RepetitionBuildingContainer{constructor(R){this.RepetitonUnderConstruction=new Repetition(R)}}class MusicSymbolModuleFactory{static createRepetitionInstructionReader(){return new RepetitionInstructionReader}static createRepetitionCalculator(){return new RepetitionCalculator}}class ReaderPluginManager{constructor(){this.voiceMeasureReadPlugins=[]}addVoiceMeasureReadPlugin(R){this.voiceMeasureReadPlugins.push(R)}processVoiceMeasureReadPlugins(R,F,D){for(const G of this.voiceMeasureReadPlugins)try{G.measureReadCalculations(R,F,D)}catch(U){log$2.info("VoiceGenerator.addSingleNote: ",U)}}}class MusicSheetReader{constructor(R=void 0,F=new EngravingRules){this.completeNumberOfStaves=0,this.pluginManager=new ReaderPluginManager,R?this.afterSheetReadingModules=R:this.afterSheetReadingModules=[],this.repetitionInstructionReader=MusicSymbolModuleFactory.createRepetitionInstructionReader(),this.repetitionCalculator=MusicSymbolModuleFactory.createRepetitionCalculator(),this.rules=F}get PluginManager(){return this.pluginManager}get CompleteNumberOfStaves(){return this.completeNumberOfStaves}static doCalculationsAfterDurationHasBeenSet(R){for(const F of R)F.doCalculationsAfterDurationHasBeenSet()}createMusicSheet(R,F){try{return this._createMusicSheet(R,F)}catch(D){log$2.error("MusicSheetReader.CreateMusicSheet",D);return}}_removeFromArray(R,F){const D=R.indexOf(F);D!==-1&&R.splice(D,1)}trimString(R){return R.replace(/^\s+|\s+$/g,"")}_lastElement(R){return R[R.length-1]}_createMusicSheet(R,F){var K;const D=[];let G=0;if(this.musicSheet=new MusicSheet$1,this.musicSheet.Path=F,this.musicSheet.Rules=this.rules,!R)throw new MusicSheetReadingException("Undefined root element");this.pushSheetLabels(R,F);const U=R.element("part-list");if(!U)throw new MusicSheetReadingException("Undefined partListNode");const W=R.elements("part"),q=U.elements();this.initializeReading(q,W,D);let Y=!0;this.currentFraction=new Fraction$1(0,1);let J=!1,Z=R.element("identification");for(Z&&(Z=Z.element("encoding")),Z&&(Z=Z.element("software")),Z!==void 0&&Z.value==="Guitar Pro 5"&&(J=!0);Y;){this.currentMeasure!==void 0&&this.currentMeasure.HasEndLine&&this.rules.NewPartAndSystemAfterFinalBarline&&(G=0),this.currentMeasure=new SourceMeasure(this.completeNumberOfStaves,this.musicSheet.Rules);for(const te of D)try{Y=Y&&te.readNextXmlMeasure(this.currentMeasure,this.currentFraction,J)}catch(Q){const ie=ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading instruments.");throw new MusicSheetReadingException(ie,Q)}Y&&(this.musicSheet.addMeasure(this.currentMeasure),this.checkIfRhythmInstructionsAreSetAndEqual(D),this.checkSourceMeasureForNullEntries(),G=this.setSourceMeasureDuration(D,G),MusicSheetReader.doCalculationsAfterDurationHasBeenSet(D),this.currentMeasure.AbsoluteTimestamp=this.currentFraction.clone(),this.musicSheet.SheetErrors.finalizeMeasure(this.currentMeasure.MeasureNumber),this.currentFraction.Add(this.currentMeasure.Duration),this.previousMeasure=this.currentMeasure,this.musicSheet.SoundTempos=(K=D[0])==null?void 0:K.SoundTempos)}this.repetitionInstructionReader&&(this.repetitionInstructionReader.removeRedundantInstructions(),this.repetitionCalculator&&this.repetitionCalculator.calculateRepetitions(this.musicSheet,this.repetitionInstructionReader.repetitionInstructions)),this.musicSheet.DefaultStartTempoInBpm===0&&(this.musicSheet.DefaultStartTempoInBpm=100),this.musicSheet.checkForInstrumentWithNoVoice(),this.musicSheet.fillStaffList();for(let te=0,Q=this.afterSheetReadingModules.length;teD){if(this.areRhythmInstructionsMixed(F)&&q.SymbolEnum!==RhythmSymbolEnum.NONE)continue;D=q.Rhythm.RealValue,G=F.indexOf(q)}}if(F.length>0&&F.lengthR.Denominator){const D=F.Denominator/R.Denominator;R.expand(D)}}checkIfMeasureIsImplicit(R,F){return!this.previousMeasure&&R.lt(F)?!0:this.previousMeasure?Fraction$1.plus(this.previousMeasure.Duration,R).Equals(F):!1}allInstrumentsHaveSameDuration(R,F){let D=0;for(let G=0,U=R.length;G=0;R--)for(let F=this.currentMeasure.VerticalSourceStaffEntryContainers[R].StaffEntries.length-1;F>=0;F--){const D=this.currentMeasure.VerticalSourceStaffEntryContainers[R].StaffEntries[F];if(D)for(let G=D.VoiceEntries.length-1;G>=0;G--){const U=D.VoiceEntries[G];U.Notes.length===0&&(this._removeFromArray(U.ParentVoice.VoiceEntries,U),this._removeFromArray(D.VoiceEntries,U))}D!==void 0&&D.VoiceEntries.length===0&&(this.currentMeasure.VerticalSourceStaffEntryContainers[R].StaffEntries[F]=void 0)}for(let R=this.currentMeasure.VerticalSourceStaffEntryContainers.length-1;R>=0;R--){let F=0;for(let D=0,G=this.currentMeasure.VerticalSourceStaffEntryContainers[R].StaffEntries.length;DF){if(!this.musicSheet.Title){const ce=ie.attribute("font-size").value,he=parseFloat(ce);D0&&Z.MidiInstrumentId!==MidiInstrument.Percussion&&(se.midiInstrumentID=Math.max(0,parseInt(ce.value,10)-1));else if(ce.name==="midi-unpitched")se.fixedKey=Math.max(0,parseInt(ce.value,10));else if(ce.name==="volume")try{const he=parseFloat(ce.value);se.volume=he/127}catch(he){log$2.debug("ExpressionReader.readExpressionParameters","read volume",he)}else if(ce.name==="pan")try{const he=parseFloat(ce.value);se.pan=he/64}catch(he){log$2.debug("ExpressionReader.readExpressionParameters","read pan",he)}}catch(he){log$2.info("MusicSheetReader.createInstrumentGroups midi settings: ",he)}}}}catch(se){log$2.info("MusicSheetReader.createInstrumentGroups: ",se)}}if(Z.SubInstruments.length===0){const te=new SubInstrument(Z);Z.SubInstruments.push(te)}D[J]=Z,G?(G.InstrumentalGroups.push(Z),this.musicSheet.Instruments.push(Z)):(this.musicSheet.InstrumentalGroups.push(Z),this.musicSheet.Instruments.push(Z))}else if(Y.name==="part-group"&&Y.attribute("type").value==="start"){const J=new InstrumentalGroup("group",this.musicSheet,G);G?G.InstrumentalGroups.push(J):this.musicSheet.InstrumentalGroups.push(J),G=J}else if(Y.name==="part-group"&&Y.attribute("type").value==="stop"&&G){if(G.InstrumentalGroups.length===1){const J=G.InstrumentalGroups[0];G.Parent?(G.Parent.InstrumentalGroups.push(J),this._removeFromArray(G.Parent.InstrumentalGroups,G)):(this.musicSheet.InstrumentalGroups.push(J),this._removeFromArray(this.musicSheet.InstrumentalGroups,G))}G=G.Parent}}}catch(U){const W=ITextTranslation.translateText("ReaderErrorMessages/InstrumentError","Error while reading Instruments");throw new MusicSheetReadingException(W,U)}for(let U=0,W=this.musicSheet.Instruments.length;U0){const U=G[0];if(U){let W=U.element("attributes");W&&(W=W.element("staves")),W?F+=parseInt(W.value,10):F++}}}if(isNaN(F)||F<=0){const D=ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of staves.");throw new MusicSheetReadingException(D)}return F}getInstrumentNumberOfStavesFromXml(R){let F=0;const D=R.element("measure");if(D){const G=D.element("attributes");let U;G&&(U=G.element("staves")),!G||!U?F=1:F=parseInt(U.value,10)}if(isNaN(F)||F<=0){const G=ITextTranslation.translateText("ReaderErrorMessages/StaffError","Invalid number of Staves.");throw new MusicSheetReadingException(G)}return F}}var jszip_min={exports:{}};/*! JSZip v3.7.1 - A JavaScript class for generating and reading zip files (c) 2009-2016 Stuart Knightley Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown. JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/master/LICENSE */(function(B,R){(function(F){B.exports=F()})(function(){return function F(D,G,U){function W(J,Z){if(!G[J]){if(!D[J]){var K=typeof commonjsRequire$1=="function"&&commonjsRequire$1;if(!Z&&K)return K(J,!0);if(q)return q(J,!0);var te=new Error("Cannot find module '"+J+"'");throw te.code="MODULE_NOT_FOUND",te}var Q=G[J]={exports:{}};D[J][0].call(Q.exports,function(ie){var se=D[J][1][ie];return W(se||ie)},Q,Q.exports,F,D,G,U)}return G[J].exports}for(var q=typeof commonjsRequire$1=="function"&&commonjsRequire$1,Y=0;Y>2,Q=(3&J)<<4|Z>>4,ie=1>6:64,se=2>4,Z=(15&te)<<4|(Q=q.indexOf(Y.charAt(se++)))>>2,K=(3&Q)<<6|(ie=q.indexOf(Y.charAt(se++))),ae[ne++]=J,Q!==64&&(ae[ne++]=Z),ie!==64&&(ae[ne++]=K);return ae}},{"./support":30,"./utils":32}],2:[function(F,D,G){var U=F("./external"),W=F("./stream/DataWorker"),q=F("./stream/Crc32Probe"),Y=F("./stream/DataLengthProbe");function J(Z,K,te,Q,ie){this.compressedSize=Z,this.uncompressedSize=K,this.crc32=te,this.compression=Q,this.compressedContent=ie}J.prototype={getContentWorker:function(){var Z=new W(U.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new Y("data_length")),K=this;return Z.on("end",function(){if(this.streamInfo.data_length!==K.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),Z},getCompressedWorker:function(){return new W(U.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},J.createWorkerFrom=function(Z,K,te){return Z.pipe(new q).pipe(new Y("uncompressedSize")).pipe(K.compressWorker(te)).pipe(new Y("compressedSize")).withStreamInfo("compression",K)},D.exports=J},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(F,D,G){var U=F("./stream/GenericWorker");G.STORE={magic:"\0\0",compressWorker:function(W){return new U("STORE compression")},uncompressWorker:function(){return new U("STORE decompression")}},G.DEFLATE=F("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(F,D,G){var U=F("./utils"),W=function(){for(var q,Y=[],J=0;J<256;J++){q=J;for(var Z=0;Z<8;Z++)q=1&q?3988292384^q>>>1:q>>>1;Y[J]=q}return Y}();D.exports=function(q,Y){return q!==void 0&&q.length?U.getTypeOf(q)!=="string"?function(J,Z,K,te){var Q=W,ie=te+K;J^=-1;for(var se=te;se>>8^Q[255&(J^Z[se])];return-1^J}(0|Y,q,q.length,0):function(J,Z,K,te){var Q=W,ie=te+K;J^=-1;for(var se=te;se>>8^Q[255&(J^Z.charCodeAt(se))];return-1^J}(0|Y,q,q.length,0):0}},{"./utils":32}],5:[function(F,D,G){G.base64=!1,G.binary=!1,G.dir=!1,G.createFolders=!0,G.date=null,G.compression=null,G.compressionOptions=null,G.comment=null,G.unixPermissions=null,G.dosPermissions=null},{}],6:[function(F,D,G){var U=null;U=typeof Promise!="undefined"?Promise:F("lie"),D.exports={Promise:U}},{lie:37}],7:[function(F,D,G){var U=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Uint32Array!="undefined",W=F("pako"),q=F("./utils"),Y=F("./stream/GenericWorker"),J=U?"uint8array":"array";function Z(K,te){Y.call(this,"FlateWorker/"+K),this._pako=null,this._pakoAction=K,this._pakoOptions=te,this.meta={}}G.magic="\b\0",q.inherits(Z,Y),Z.prototype.processChunk=function(K){this.meta=K.meta,this._pako===null&&this._createPako(),this._pako.push(q.transformTo(J,K.data),!1)},Z.prototype.flush=function(){Y.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},Z.prototype.cleanUp=function(){Y.prototype.cleanUp.call(this),this._pako=null},Z.prototype._createPako=function(){this._pako=new W[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var K=this;this._pako.onData=function(te){K.push({data:te,meta:K.meta})}},G.compressWorker=function(K){return new Z("Deflate",K)},G.uncompressWorker=function(){return new Z("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(F,D,G){function U(Q,ie){var se,ne="";for(se=0;se>>=8;return ne}function W(Q,ie,se,ne,re,ae){var ce,he,fe=Q.file,be=Q.compression,ue=ae!==J.utf8encode,ge=q.transformTo("string",ae(fe.name)),ve=q.transformTo("string",J.utf8encode(fe.name)),Se=fe.comment,pe=q.transformTo("string",ae(Se)),ye=q.transformTo("string",J.utf8encode(Se)),Ee=ve.length!==fe.name.length,de=ye.length!==Se.length,we="",Oe="",Me="",Pe=fe.dir,Ne=fe.date,ke={crc32:0,compressedSize:0,uncompressedSize:0};ie&&!se||(ke.crc32=Q.crc32,ke.compressedSize=Q.compressedSize,ke.uncompressedSize=Q.uncompressedSize);var Ae=0;ie&&(Ae|=8),ue||!Ee&&!de||(Ae|=2048);var _e=0,Fe=0;Pe&&(_e|=16),re==="UNIX"?(Fe=798,_e|=function(Ce,Ge){var We=Ce;return Ce||(We=Ge?16893:33204),(65535&We)<<16}(fe.unixPermissions,Pe)):(Fe=20,_e|=function(Ce){return 63&(Ce||0)}(fe.dosPermissions)),ce=Ne.getUTCHours(),ce<<=6,ce|=Ne.getUTCMinutes(),ce<<=5,ce|=Ne.getUTCSeconds()/2,he=Ne.getUTCFullYear()-1980,he<<=4,he|=Ne.getUTCMonth()+1,he<<=5,he|=Ne.getUTCDate(),Ee&&(Oe=U(1,1)+U(Z(ge),4)+ve,we+="up"+U(Oe.length,2)+Oe),de&&(Me=U(1,1)+U(Z(pe),4)+ye,we+="uc"+U(Me.length,2)+Me);var Ye="";return Ye+=` \0`,Ye+=U(Ae,2),Ye+=be.magic,Ye+=U(ce,2),Ye+=U(he,2),Ye+=U(ke.crc32,4),Ye+=U(ke.compressedSize,4),Ye+=U(ke.uncompressedSize,4),Ye+=U(ge.length,2),Ye+=U(we.length,2),{fileRecord:K.LOCAL_FILE_HEADER+Ye+ge+we,dirRecord:K.CENTRAL_FILE_HEADER+U(Fe,2)+Ye+U(pe.length,2)+"\0\0\0\0"+U(_e,4)+U(ne,4)+ge+we+pe}}var q=F("../utils"),Y=F("../stream/GenericWorker"),J=F("../utf8"),Z=F("../crc32"),K=F("../signature");function te(Q,ie,se,ne){Y.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=ie,this.zipPlatform=se,this.encodeFileName=ne,this.streamFiles=Q,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}q.inherits(te,Y),te.prototype.push=function(Q){var ie=Q.meta.percent||0,se=this.entriesCount,ne=this._sources.length;this.accumulate?this.contentBuffer.push(Q):(this.bytesWritten+=Q.data.length,Y.prototype.push.call(this,{data:Q.data,meta:{currentFile:this.currentFile,percent:se?(ie+100*(se-ne-1))/se:100}}))},te.prototype.openedSource=function(Q){this.currentSourceOffset=this.bytesWritten,this.currentFile=Q.file.name;var ie=this.streamFiles&&!Q.file.dir;if(ie){var se=W(Q,ie,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:se.fileRecord,meta:{percent:0}})}else this.accumulate=!0},te.prototype.closedSource=function(Q){this.accumulate=!1;var ie=this.streamFiles&&!Q.file.dir,se=W(Q,ie,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(se.dirRecord),ie)this.push({data:function(ne){return K.DATA_DESCRIPTOR+U(ne.crc32,4)+U(ne.compressedSize,4)+U(ne.uncompressedSize,4)}(Q),meta:{percent:100}});else for(this.push({data:se.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},te.prototype.flush=function(){for(var Q=this.bytesWritten,ie=0;ie=this.index;Y--)J=(J<<8)+this.byteAt(Y);return this.index+=q,J},readString:function(q){return U.transformTo("string",this.readData(q))},readData:function(q){},lastIndexOfSignature:function(q){},readAndCheckSignature:function(q){},readDate:function(){var q=this.readInt(4);return new Date(Date.UTC(1980+(q>>25&127),(q>>21&15)-1,q>>16&31,q>>11&31,q>>5&63,(31&q)<<1))}},D.exports=W},{"../utils":32}],19:[function(F,D,G){var U=F("./Uint8ArrayReader");function W(q){U.call(this,q)}F("../utils").inherits(W,U),W.prototype.readData=function(q){this.checkOffset(q);var Y=this.data.slice(this.zero+this.index,this.zero+this.index+q);return this.index+=q,Y},D.exports=W},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(F,D,G){var U=F("./DataReader");function W(q){U.call(this,q)}F("../utils").inherits(W,U),W.prototype.byteAt=function(q){return this.data.charCodeAt(this.zero+q)},W.prototype.lastIndexOfSignature=function(q){return this.data.lastIndexOf(q)-this.zero},W.prototype.readAndCheckSignature=function(q){return q===this.readData(4)},W.prototype.readData=function(q){this.checkOffset(q);var Y=this.data.slice(this.zero+this.index,this.zero+this.index+q);return this.index+=q,Y},D.exports=W},{"../utils":32,"./DataReader":18}],21:[function(F,D,G){var U=F("./ArrayReader");function W(q){U.call(this,q)}F("../utils").inherits(W,U),W.prototype.readData=function(q){if(this.checkOffset(q),q===0)return new Uint8Array(0);var Y=this.data.subarray(this.zero+this.index,this.zero+this.index+q);return this.index+=q,Y},D.exports=W},{"../utils":32,"./ArrayReader":17}],22:[function(F,D,G){var U=F("../utils"),W=F("../support"),q=F("./ArrayReader"),Y=F("./StringReader"),J=F("./NodeBufferReader"),Z=F("./Uint8ArrayReader");D.exports=function(K){var te=U.getTypeOf(K);return U.checkSupport(te),te!=="string"||W.uint8array?te==="nodebuffer"?new J(K):W.uint8array?new Z(U.transformTo("uint8array",K)):new q(U.transformTo("array",K)):new Y(K)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(F,D,G){G.LOCAL_FILE_HEADER="PK",G.CENTRAL_FILE_HEADER="PK",G.CENTRAL_DIRECTORY_END="PK",G.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",G.ZIP64_CENTRAL_DIRECTORY_END="PK",G.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(F,D,G){var U=F("./GenericWorker"),W=F("../utils");function q(Y){U.call(this,"ConvertWorker to "+Y),this.destType=Y}W.inherits(q,U),q.prototype.processChunk=function(Y){this.push({data:W.transformTo(this.destType,Y.data),meta:Y.meta})},D.exports=q},{"../utils":32,"./GenericWorker":28}],25:[function(F,D,G){var U=F("./GenericWorker"),W=F("../crc32");function q(){U.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}F("../utils").inherits(q,U),q.prototype.processChunk=function(Y){this.streamInfo.crc32=W(Y.data,this.streamInfo.crc32||0),this.push(Y)},D.exports=q},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(F,D,G){var U=F("../utils"),W=F("./GenericWorker");function q(Y){W.call(this,"DataLengthProbe for "+Y),this.propName=Y,this.withStreamInfo(Y,0)}U.inherits(q,W),q.prototype.processChunk=function(Y){if(Y){var J=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=J+Y.data.length}W.prototype.processChunk.call(this,Y)},D.exports=q},{"../utils":32,"./GenericWorker":28}],27:[function(F,D,G){var U=F("../utils"),W=F("./GenericWorker");function q(Y){W.call(this,"DataWorker");var J=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,Y.then(function(Z){J.dataIsReady=!0,J.data=Z,J.max=Z&&Z.length||0,J.type=U.getTypeOf(Z),J.isPaused||J._tickAndRepeat()},function(Z){J.error(Z)})}U.inherits(q,W),q.prototype.cleanUp=function(){W.prototype.cleanUp.call(this),this.data=null},q.prototype.resume=function(){return!!W.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,U.delay(this._tickAndRepeat,[],this)),!0)},q.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(U.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},q.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var Y=null,J=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":Y=this.data.substring(this.index,J);break;case"uint8array":Y=this.data.subarray(this.index,J);break;case"array":case"nodebuffer":Y=this.data.slice(this.index,J)}return this.index=J,this.push({data:Y,meta:{percent:this.max?this.index/this.max*100:0}})},D.exports=q},{"../utils":32,"./GenericWorker":28}],28:[function(F,D,G){function U(W){this.name=W||"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}U.prototype={push:function(W){this.emit("data",W)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(W){this.emit("error",W)}return!0},error:function(W){return!this.isFinished&&(this.isPaused?this.generatedError=W:(this.isFinished=!0,this.emit("error",W),this.previous&&this.previous.error(W),this.cleanUp()),!0)},on:function(W,q){return this._listeners[W].push(q),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(W,q){if(this._listeners[W])for(var Y=0;Y "+W:W}},D.exports=U},{}],29:[function(F,D,G){var U=F("../utils"),W=F("./ConvertWorker"),q=F("./GenericWorker"),Y=F("../base64"),J=F("../support"),Z=F("../external"),K=null;if(J.nodestream)try{K=F("../nodejs/NodejsStreamOutputAdapter")}catch{}function te(ie,se){return new Z.Promise(function(ne,re){var ae=[],ce=ie._internalType,he=ie._outputType,fe=ie._mimeType;ie.on("data",function(be,ue){ae.push(be),se&&se(ue)}).on("error",function(be){ae=[],re(be)}).on("end",function(){try{var be=function(ue,ge,ve){switch(ue){case"blob":return U.newBlob(U.transformTo("arraybuffer",ge),ve);case"base64":return Y.encode(ge);default:return U.transformTo(ue,ge)}}(he,function(ue,ge){var ve,Se=0,pe=null,ye=0;for(ve=0;ve>>6:(ne<65536?se[ce++]=224|ne>>>12:(se[ce++]=240|ne>>>18,se[ce++]=128|ne>>>12&63),se[ce++]=128|ne>>>6&63),se[ce++]=128|63&ne);return se}(Q)},G.utf8decode=function(Q){return W.nodebuffer?U.transformTo("nodebuffer",Q).toString("utf-8"):function(ie){var se,ne,re,ae,ce=ie.length,he=new Array(2*ce);for(se=ne=0;se>10&1023,he[ne++]=56320|1023&re)}return he.length!==ne&&(he.subarray?he=he.subarray(0,ne):he.length=ne),U.applyFromCharCode(he)}(Q=U.transformTo(W.uint8array?"uint8array":"array",Q))},U.inherits(K,Y),K.prototype.processChunk=function(Q){var ie=U.transformTo(W.uint8array?"uint8array":"array",Q.data);if(this.leftOver&&this.leftOver.length){if(W.uint8array){var se=ie;(ie=new Uint8Array(se.length+this.leftOver.length)).set(this.leftOver,0),ie.set(se,this.leftOver.length)}else ie=this.leftOver.concat(ie);this.leftOver=null}var ne=function(ae,ce){var he;for((ce=ce||ae.length)>ae.length&&(ce=ae.length),he=ce-1;0<=he&&(192&ae[he])==128;)he--;return he<0||he===0?ce:he+J[ae[he]]>ce?he:ce}(ie),re=ie;ne!==ie.length&&(W.uint8array?(re=ie.subarray(0,ne),this.leftOver=ie.subarray(ne,ie.length)):(re=ie.slice(0,ne),this.leftOver=ie.slice(ne,ie.length))),this.push({data:G.utf8decode(re),meta:Q.meta})},K.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:G.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},G.Utf8DecodeWorker=K,U.inherits(te,Y),te.prototype.processChunk=function(Q){this.push({data:G.utf8encode(Q.data),meta:Q.meta})},G.Utf8EncodeWorker=te},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(F,D,G){var U=F("./support"),W=F("./base64"),q=F("./nodejsUtils"),Y=F("set-immediate-shim"),J=F("./external");function Z(ne){return ne}function K(ne,re){for(var ae=0;ae>8;this.dir=!!(16&this.externalFileAttributes),Q==0&&(this.dosPermissions=63&this.externalFileAttributes),Q==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(Q){if(this.extraFields[1]){var ie=U(this.extraFields[1].value);this.uncompressedSize===W.MAX_VALUE_32BITS&&(this.uncompressedSize=ie.readInt(8)),this.compressedSize===W.MAX_VALUE_32BITS&&(this.compressedSize=ie.readInt(8)),this.localHeaderOffset===W.MAX_VALUE_32BITS&&(this.localHeaderOffset=ie.readInt(8)),this.diskNumberStart===W.MAX_VALUE_32BITS&&(this.diskNumberStart=ie.readInt(4))}},readExtraFields:function(Q){var ie,se,ne,re=Q.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});Q.index+4>>6:(Q<65536?te[ne++]=224|Q>>>12:(te[ne++]=240|Q>>>18,te[ne++]=128|Q>>>12&63),te[ne++]=128|Q>>>6&63),te[ne++]=128|63&Q);return te},G.buf2binstring=function(K){return Z(K,K.length)},G.binstring2buf=function(K){for(var te=new U.Buf8(K.length),Q=0,ie=te.length;Q>10&1023,ae[ie++]=56320|1023&se)}return Z(ae,ie)},G.utf8border=function(K,te){var Q;for((te=te||K.length)>K.length&&(te=K.length),Q=te-1;0<=Q&&(192&K[Q])==128;)Q--;return Q<0||Q===0?te:Q+Y[K[Q]]>te?Q:te}},{"./common":41}],43:[function(F,D,G){D.exports=function(U,W,q,Y){for(var J=65535&U|0,Z=U>>>16&65535|0,K=0;q!==0;){for(q-=K=2e3>>1:W>>>1;q[Y]=W}return q}();D.exports=function(W,q,Y,J){var Z=U,K=J+Y;W^=-1;for(var te=J;te>>8^Z[255&(W^q[te])];return-1^W}},{}],46:[function(F,D,G){var U,W=F("../utils/common"),q=F("./trees"),Y=F("./adler32"),J=F("./crc32"),Z=F("./messages"),K=0,te=4,Q=0,ie=-2,se=-1,ne=4,re=2,ae=8,ce=9,he=286,fe=30,be=19,ue=2*he+1,ge=15,ve=3,Se=258,pe=Se+ve+1,ye=42,Ee=113,de=1,we=2,Oe=3,Me=4;function Pe(xe,ze){return xe.msg=Z[ze],ze}function Ne(xe){return(xe<<1)-(4xe.avail_out&&(qe=xe.avail_out),qe!==0&&(W.arraySet(xe.output,ze.pending_buf,ze.pending_out,qe,xe.next_out),xe.next_out+=qe,ze.pending_out+=qe,xe.total_out+=qe,xe.avail_out-=qe,ze.pending-=qe,ze.pending===0&&(ze.pending_out=0))}function _e(xe,ze){q._tr_flush_block(xe,0<=xe.block_start?xe.block_start:-1,xe.strstart-xe.block_start,ze),xe.block_start=xe.strstart,Ae(xe.strm)}function Fe(xe,ze){xe.pending_buf[xe.pending++]=ze}function Ye(xe,ze){xe.pending_buf[xe.pending++]=ze>>>8&255,xe.pending_buf[xe.pending++]=255&ze}function Ce(xe,ze){var qe,Re,Le=xe.max_chain_length,je=xe.strstart,Xe=xe.prev_length,Qe=xe.nice_match,He=xe.strstart>xe.w_size-pe?xe.strstart-(xe.w_size-pe):0,tt=xe.window,ot=xe.w_mask,rt=xe.prev,ft=xe.strstart+Se,St=tt[je+Xe-1],lt=tt[je+Xe];xe.prev_length>=xe.good_match&&(Le>>=2),Qe>xe.lookahead&&(Qe=xe.lookahead);do if(tt[(qe=ze)+Xe]===lt&&tt[qe+Xe-1]===St&&tt[qe]===tt[je]&&tt[++qe]===tt[je+1]){je+=2,qe++;do;while(tt[++je]===tt[++qe]&&tt[++je]===tt[++qe]&&tt[++je]===tt[++qe]&&tt[++je]===tt[++qe]&&tt[++je]===tt[++qe]&&tt[++je]===tt[++qe]&&tt[++je]===tt[++qe]&&tt[++je]===tt[++qe]&&jeHe&&--Le!=0);return Xe<=xe.lookahead?Xe:xe.lookahead}function Ge(xe){var ze,qe,Re,Le,je,Xe,Qe,He,tt,ot,rt=xe.w_size;do{if(Le=xe.window_size-xe.lookahead-xe.strstart,xe.strstart>=rt+(rt-pe)){for(W.arraySet(xe.window,xe.window,rt,rt,0),xe.match_start-=rt,xe.strstart-=rt,xe.block_start-=rt,ze=qe=xe.hash_size;Re=xe.head[--ze],xe.head[ze]=rt<=Re?Re-rt:0,--qe;);for(ze=qe=rt;Re=xe.prev[--ze],xe.prev[ze]=rt<=Re?Re-rt:0,--qe;);Le+=rt}if(xe.strm.avail_in===0)break;if(Xe=xe.strm,Qe=xe.window,He=xe.strstart+xe.lookahead,tt=Le,ot=void 0,ot=Xe.avail_in,tt=ve)for(je=xe.strstart-xe.insert,xe.ins_h=xe.window[je],xe.ins_h=(xe.ins_h<=ve&&(xe.ins_h=(xe.ins_h<=ve)if(Re=q._tr_tally(xe,xe.strstart-xe.match_start,xe.match_length-ve),xe.lookahead-=xe.match_length,xe.match_length<=xe.max_lazy_match&&xe.lookahead>=ve){for(xe.match_length--;xe.strstart++,xe.ins_h=(xe.ins_h<=ve&&(xe.ins_h=(xe.ins_h<=ve&&xe.match_length<=xe.prev_length){for(Le=xe.strstart+xe.lookahead-ve,Re=q._tr_tally(xe,xe.strstart-1-xe.prev_match,xe.prev_length-ve),xe.lookahead-=xe.prev_length-1,xe.prev_length-=2;++xe.strstart<=Le&&(xe.ins_h=(xe.ins_h<xe.pending_buf_size-5&&(qe=xe.pending_buf_size-5);;){if(xe.lookahead<=1){if(Ge(xe),xe.lookahead===0&&ze===K)return de;if(xe.lookahead===0)break}xe.strstart+=xe.lookahead,xe.lookahead=0;var Re=xe.block_start+qe;if((xe.strstart===0||xe.strstart>=Re)&&(xe.lookahead=xe.strstart-Re,xe.strstart=Re,_e(xe,!1),xe.strm.avail_out===0)||xe.strstart-xe.block_start>=xe.w_size-pe&&(_e(xe,!1),xe.strm.avail_out===0))return de}return xe.insert=0,ze===te?(_e(xe,!0),xe.strm.avail_out===0?Oe:Me):(xe.strstart>xe.block_start&&(_e(xe,!1),xe.strm.avail_out),de)}),new Ze(4,4,8,4,We),new Ze(4,5,16,8,We),new Ze(4,6,32,32,We),new Ze(4,4,16,16,Ve),new Ze(8,16,32,32,Ve),new Ze(8,16,128,128,Ve),new Ze(8,32,128,256,Ve),new Ze(32,128,258,1024,Ve),new Ze(32,258,258,4096,Ve)],G.deflateInit=function(xe,ze){return De(xe,ze,ae,15,8,0)},G.deflateInit2=De,G.deflateReset=ct,G.deflateResetKeep=at,G.deflateSetHeader=function(xe,ze){return xe&&xe.state?xe.state.wrap!==2?ie:(xe.state.gzhead=ze,Q):ie},G.deflate=function(xe,ze){var qe,Re,Le,je;if(!xe||!xe.state||5>8&255),Fe(Re,Re.gzhead.time>>16&255),Fe(Re,Re.gzhead.time>>24&255),Fe(Re,Re.level===9?2:2<=Re.strategy||Re.level<2?4:0),Fe(Re,255&Re.gzhead.os),Re.gzhead.extra&&Re.gzhead.extra.length&&(Fe(Re,255&Re.gzhead.extra.length),Fe(Re,Re.gzhead.extra.length>>8&255)),Re.gzhead.hcrc&&(xe.adler=J(xe.adler,Re.pending_buf,Re.pending,0)),Re.gzindex=0,Re.status=69):(Fe(Re,0),Fe(Re,0),Fe(Re,0),Fe(Re,0),Fe(Re,0),Fe(Re,Re.level===9?2:2<=Re.strategy||Re.level<2?4:0),Fe(Re,3),Re.status=Ee);else{var Xe=ae+(Re.w_bits-8<<4)<<8;Xe|=(2<=Re.strategy||Re.level<2?0:Re.level<6?1:Re.level===6?2:3)<<6,Re.strstart!==0&&(Xe|=32),Xe+=31-Xe%31,Re.status=Ee,Ye(Re,Xe),Re.strstart!==0&&(Ye(Re,xe.adler>>>16),Ye(Re,65535&xe.adler)),xe.adler=1}if(Re.status===69)if(Re.gzhead.extra){for(Le=Re.pending;Re.gzindex<(65535&Re.gzhead.extra.length)&&(Re.pending!==Re.pending_buf_size||(Re.gzhead.hcrc&&Re.pending>Le&&(xe.adler=J(xe.adler,Re.pending_buf,Re.pending-Le,Le)),Ae(xe),Le=Re.pending,Re.pending!==Re.pending_buf_size));)Fe(Re,255&Re.gzhead.extra[Re.gzindex]),Re.gzindex++;Re.gzhead.hcrc&&Re.pending>Le&&(xe.adler=J(xe.adler,Re.pending_buf,Re.pending-Le,Le)),Re.gzindex===Re.gzhead.extra.length&&(Re.gzindex=0,Re.status=73)}else Re.status=73;if(Re.status===73)if(Re.gzhead.name){Le=Re.pending;do{if(Re.pending===Re.pending_buf_size&&(Re.gzhead.hcrc&&Re.pending>Le&&(xe.adler=J(xe.adler,Re.pending_buf,Re.pending-Le,Le)),Ae(xe),Le=Re.pending,Re.pending===Re.pending_buf_size)){je=1;break}je=Re.gzindexLe&&(xe.adler=J(xe.adler,Re.pending_buf,Re.pending-Le,Le)),je===0&&(Re.gzindex=0,Re.status=91)}else Re.status=91;if(Re.status===91)if(Re.gzhead.comment){Le=Re.pending;do{if(Re.pending===Re.pending_buf_size&&(Re.gzhead.hcrc&&Re.pending>Le&&(xe.adler=J(xe.adler,Re.pending_buf,Re.pending-Le,Le)),Ae(xe),Le=Re.pending,Re.pending===Re.pending_buf_size)){je=1;break}je=Re.gzindexLe&&(xe.adler=J(xe.adler,Re.pending_buf,Re.pending-Le,Le)),je===0&&(Re.status=103)}else Re.status=103;if(Re.status===103&&(Re.gzhead.hcrc?(Re.pending+2>Re.pending_buf_size&&Ae(xe),Re.pending+2<=Re.pending_buf_size&&(Fe(Re,255&xe.adler),Fe(Re,xe.adler>>8&255),xe.adler=0,Re.status=Ee)):Re.status=Ee),Re.pending!==0){if(Ae(xe),xe.avail_out===0)return Re.last_flush=-1,Q}else if(xe.avail_in===0&&Ne(ze)<=Ne(qe)&&ze!==te)return Pe(xe,-5);if(Re.status===666&&xe.avail_in!==0)return Pe(xe,-5);if(xe.avail_in!==0||Re.lookahead!==0||ze!==K&&Re.status!==666){var Qe=Re.strategy===2?function(He,tt){for(var ot;;){if(He.lookahead===0&&(Ge(He),He.lookahead===0)){if(tt===K)return de;break}if(He.match_length=0,ot=q._tr_tally(He,0,He.window[He.strstart]),He.lookahead--,He.strstart++,ot&&(_e(He,!1),He.strm.avail_out===0))return de}return He.insert=0,tt===te?(_e(He,!0),He.strm.avail_out===0?Oe:Me):He.last_lit&&(_e(He,!1),He.strm.avail_out===0)?de:we}(Re,ze):Re.strategy===3?function(He,tt){for(var ot,rt,ft,St,lt=He.window;;){if(He.lookahead<=Se){if(Ge(He),He.lookahead<=Se&&tt===K)return de;if(He.lookahead===0)break}if(He.match_length=0,He.lookahead>=ve&&0He.lookahead&&(He.match_length=He.lookahead)}if(He.match_length>=ve?(ot=q._tr_tally(He,1,He.match_length-ve),He.lookahead-=He.match_length,He.strstart+=He.match_length,He.match_length=0):(ot=q._tr_tally(He,0,He.window[He.strstart]),He.lookahead--,He.strstart++),ot&&(_e(He,!1),He.strm.avail_out===0))return de}return He.insert=0,tt===te?(_e(He,!0),He.strm.avail_out===0?Oe:Me):He.last_lit&&(_e(He,!1),He.strm.avail_out===0)?de:we}(Re,ze):U[Re.level].func(Re,ze);if(Qe!==Oe&&Qe!==Me||(Re.status=666),Qe===de||Qe===Oe)return xe.avail_out===0&&(Re.last_flush=-1),Q;if(Qe===we&&(ze===1?q._tr_align(Re):ze!==5&&(q._tr_stored_block(Re,0,0,!1),ze===3&&(ke(Re.head),Re.lookahead===0&&(Re.strstart=0,Re.block_start=0,Re.insert=0))),Ae(xe),xe.avail_out===0))return Re.last_flush=-1,Q}return ze!==te?Q:Re.wrap<=0?1:(Re.wrap===2?(Fe(Re,255&xe.adler),Fe(Re,xe.adler>>8&255),Fe(Re,xe.adler>>16&255),Fe(Re,xe.adler>>24&255),Fe(Re,255&xe.total_in),Fe(Re,xe.total_in>>8&255),Fe(Re,xe.total_in>>16&255),Fe(Re,xe.total_in>>24&255)):(Ye(Re,xe.adler>>>16),Ye(Re,65535&xe.adler)),Ae(xe),0=qe.w_size&&(je===0&&(ke(qe.head),qe.strstart=0,qe.block_start=0,qe.insert=0),tt=new W.Buf8(qe.w_size),W.arraySet(tt,ze,ot-qe.w_size,qe.w_size,0),ze=tt,ot=qe.w_size),Xe=xe.avail_in,Qe=xe.next_in,He=xe.input,xe.avail_in=ot,xe.next_in=0,xe.input=ze,Ge(qe);qe.lookahead>=ve;){for(Re=qe.strstart,Le=qe.lookahead-(ve-1);qe.ins_h=(qe.ins_h<>>=ve=ge>>>24,ce-=ve,(ve=ge>>>16&255)===0)we[Z++]=65535≥else{if(!(16&ve)){if((64&ve)==0){ge=he[(65535&ge)+(ae&(1<>>=ve,ce-=ve),ce<15&&(ae+=de[Y++]<>>=ve=ge>>>24,ce-=ve,!(16&(ve=ge>>>16&255))){if((64&ve)==0){ge=fe[(65535&ge)+(ae&(1<>>=ve,ce-=ve,(ve=Z-K)>3,ae&=(1<<(ce-=Se<<3))-1,U.next_in=Y,U.next_out=Z,U.avail_in=Y>>24&255)+(ye>>>8&65280)+((65280&ye)<<8)+((255&ye)<<24)}function ae(){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 U.Buf16(320),this.work=new U.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ce(ye){var Ee;return ye&&ye.state?(Ee=ye.state,ye.total_in=ye.total_out=Ee.total=0,ye.msg="",Ee.wrap&&(ye.adler=1&Ee.wrap),Ee.mode=ie,Ee.last=0,Ee.havedict=0,Ee.dmax=32768,Ee.head=null,Ee.hold=0,Ee.bits=0,Ee.lencode=Ee.lendyn=new U.Buf32(se),Ee.distcode=Ee.distdyn=new U.Buf32(ne),Ee.sane=1,Ee.back=-1,te):Q}function he(ye){var Ee;return ye&&ye.state?((Ee=ye.state).wsize=0,Ee.whave=0,Ee.wnext=0,ce(ye)):Q}function fe(ye,Ee){var de,we;return ye&&ye.state?(we=ye.state,Ee<0?(de=0,Ee=-Ee):(de=1+(Ee>>4),Ee<48&&(Ee&=15)),Ee&&(Ee<8||15=Me.wsize?(U.arraySet(Me.window,Ee,de-Me.wsize,Me.wsize,0),Me.wnext=0,Me.whave=Me.wsize):(we<(Oe=Me.wsize-Me.wnext)&&(Oe=we),U.arraySet(Me.window,Ee,de-we,Oe,Me.wnext),(we-=Oe)?(U.arraySet(Me.window,Ee,de-we,we,0),Me.wnext=we,Me.whave=Me.wsize):(Me.wnext+=Oe,Me.wnext===Me.wsize&&(Me.wnext=0),Me.whave>>8&255,de.check=q(de.check,je,2,0),_e=Ae=0,de.mode=2;break}if(de.flags=0,de.head&&(de.head.done=!1),!(1&de.wrap)||(((255&Ae)<<8)+(Ae>>8))%31){ye.msg="incorrect header check",de.mode=30;break}if((15&Ae)!=8){ye.msg="unknown compression method",de.mode=30;break}if(_e-=4,xe=8+(15&(Ae>>>=4)),de.wbits===0)de.wbits=xe;else if(xe>de.wbits){ye.msg="invalid window size",de.mode=30;break}de.dmax=1<>8&1),512&de.flags&&(je[0]=255&Ae,je[1]=Ae>>>8&255,de.check=q(de.check,je,2,0)),_e=Ae=0,de.mode=3;case 3:for(;_e<32;){if(Ne===0)break e;Ne--,Ae+=we[Me++]<<_e,_e+=8}de.head&&(de.head.time=Ae),512&de.flags&&(je[0]=255&Ae,je[1]=Ae>>>8&255,je[2]=Ae>>>16&255,je[3]=Ae>>>24&255,de.check=q(de.check,je,4,0)),_e=Ae=0,de.mode=4;case 4:for(;_e<16;){if(Ne===0)break e;Ne--,Ae+=we[Me++]<<_e,_e+=8}de.head&&(de.head.xflags=255&Ae,de.head.os=Ae>>8),512&de.flags&&(je[0]=255&Ae,je[1]=Ae>>>8&255,de.check=q(de.check,je,2,0)),_e=Ae=0,de.mode=5;case 5:if(1024&de.flags){for(;_e<16;){if(Ne===0)break e;Ne--,Ae+=we[Me++]<<_e,_e+=8}de.length=Ae,de.head&&(de.head.extra_len=Ae),512&de.flags&&(je[0]=255&Ae,je[1]=Ae>>>8&255,de.check=q(de.check,je,2,0)),_e=Ae=0}else de.head&&(de.head.extra=null);de.mode=6;case 6:if(1024&de.flags&&(Ne<(Ce=de.length)&&(Ce=Ne),Ce&&(de.head&&(xe=de.head.extra_len-de.length,de.head.extra||(de.head.extra=new Array(de.head.extra_len)),U.arraySet(de.head.extra,we,Me,Ce,xe)),512&de.flags&&(de.check=q(de.check,we,Ce,Me)),Ne-=Ce,Me+=Ce,de.length-=Ce),de.length))break e;de.length=0,de.mode=7;case 7:if(2048&de.flags){if(Ne===0)break e;for(Ce=0;xe=we[Me+Ce++],de.head&&xe&&de.length<65536&&(de.head.name+=String.fromCharCode(xe)),xe&&Ce>9&1,de.head.done=!0),ye.adler=de.check=0,de.mode=12;break;case 10:for(;_e<32;){if(Ne===0)break e;Ne--,Ae+=we[Me++]<<_e,_e+=8}ye.adler=de.check=re(Ae),_e=Ae=0,de.mode=11;case 11:if(de.havedict===0)return ye.next_out=Pe,ye.avail_out=ke,ye.next_in=Me,ye.avail_in=Ne,de.hold=Ae,de.bits=_e,2;ye.adler=de.check=1,de.mode=12;case 12:if(Ee===5||Ee===6)break e;case 13:if(de.last){Ae>>>=7&_e,_e-=7&_e,de.mode=27;break}for(;_e<3;){if(Ne===0)break e;Ne--,Ae+=we[Me++]<<_e,_e+=8}switch(de.last=1&Ae,_e-=1,3&(Ae>>>=1)){case 0:de.mode=14;break;case 1:if(Se(de),de.mode=20,Ee!==6)break;Ae>>>=2,_e-=2;break e;case 2:de.mode=17;break;case 3:ye.msg="invalid block type",de.mode=30}Ae>>>=2,_e-=2;break;case 14:for(Ae>>>=7&_e,_e-=7&_e;_e<32;){if(Ne===0)break e;Ne--,Ae+=we[Me++]<<_e,_e+=8}if((65535&Ae)!=(Ae>>>16^65535)){ye.msg="invalid stored block lengths",de.mode=30;break}if(de.length=65535&Ae,_e=Ae=0,de.mode=15,Ee===6)break e;case 15:de.mode=16;case 16:if(Ce=de.length){if(Ne>>=5,_e-=5,de.ndist=1+(31&Ae),Ae>>>=5,_e-=5,de.ncode=4+(15&Ae),Ae>>>=4,_e-=4,286>>=3,_e-=3}for(;de.have<19;)de.lens[Xe[de.have++]]=0;if(de.lencode=de.lendyn,de.lenbits=7,qe={bits:de.lenbits},ze=J(0,de.lens,0,19,de.lencode,0,de.work,qe),de.lenbits=qe.bits,ze){ye.msg="invalid code lengths set",de.mode=30;break}de.have=0,de.mode=19;case 19:for(;de.have>>16&255,nt=65535&Le,!((Ve=Le>>>24)<=_e);){if(Ne===0)break e;Ne--,Ae+=we[Me++]<<_e,_e+=8}if(nt<16)Ae>>>=Ve,_e-=Ve,de.lens[de.have++]=nt;else{if(nt===16){for(Re=Ve+2;_e>>=Ve,_e-=Ve,de.have===0){ye.msg="invalid bit length repeat",de.mode=30;break}xe=de.lens[de.have-1],Ce=3+(3&Ae),Ae>>>=2,_e-=2}else if(nt===17){for(Re=Ve+3;_e>>=Ve)),Ae>>>=3,_e-=3}else{for(Re=Ve+7;_e>>=Ve)),Ae>>>=7,_e-=7}if(de.have+Ce>de.nlen+de.ndist){ye.msg="invalid bit length repeat",de.mode=30;break}for(;Ce--;)de.lens[de.have++]=xe}}if(de.mode===30)break;if(de.lens[256]===0){ye.msg="invalid code -- missing end-of-block",de.mode=30;break}if(de.lenbits=9,qe={bits:de.lenbits},ze=J(Z,de.lens,0,de.nlen,de.lencode,0,de.work,qe),de.lenbits=qe.bits,ze){ye.msg="invalid literal/lengths set",de.mode=30;break}if(de.distbits=6,de.distcode=de.distdyn,qe={bits:de.distbits},ze=J(K,de.lens,de.nlen,de.ndist,de.distcode,0,de.work,qe),de.distbits=qe.bits,ze){ye.msg="invalid distances set",de.mode=30;break}if(de.mode=20,Ee===6)break e;case 20:de.mode=21;case 21:if(6<=Ne&&258<=ke){ye.next_out=Pe,ye.avail_out=ke,ye.next_in=Me,ye.avail_in=Ne,de.hold=Ae,de.bits=_e,Y(ye,Ye),Pe=ye.next_out,Oe=ye.output,ke=ye.avail_out,Me=ye.next_in,we=ye.input,Ne=ye.avail_in,Ae=de.hold,_e=de.bits,de.mode===12&&(de.back=-1);break}for(de.back=0;Ze=(Le=de.lencode[Ae&(1<>>16&255,nt=65535&Le,!((Ve=Le>>>24)<=_e);){if(Ne===0)break e;Ne--,Ae+=we[Me++]<<_e,_e+=8}if(Ze&&(240&Ze)==0){for(at=Ve,ct=Ze,De=nt;Ze=(Le=de.lencode[De+((Ae&(1<>at)])>>>16&255,nt=65535&Le,!(at+(Ve=Le>>>24)<=_e);){if(Ne===0)break e;Ne--,Ae+=we[Me++]<<_e,_e+=8}Ae>>>=at,_e-=at,de.back+=at}if(Ae>>>=Ve,_e-=Ve,de.back+=Ve,de.length=nt,Ze===0){de.mode=26;break}if(32&Ze){de.back=-1,de.mode=12;break}if(64&Ze){ye.msg="invalid literal/length code",de.mode=30;break}de.extra=15&Ze,de.mode=22;case 22:if(de.extra){for(Re=de.extra;_e>>=de.extra,_e-=de.extra,de.back+=de.extra}de.was=de.length,de.mode=23;case 23:for(;Ze=(Le=de.distcode[Ae&(1<>>16&255,nt=65535&Le,!((Ve=Le>>>24)<=_e);){if(Ne===0)break e;Ne--,Ae+=we[Me++]<<_e,_e+=8}if((240&Ze)==0){for(at=Ve,ct=Ze,De=nt;Ze=(Le=de.distcode[De+((Ae&(1<>at)])>>>16&255,nt=65535&Le,!(at+(Ve=Le>>>24)<=_e);){if(Ne===0)break e;Ne--,Ae+=we[Me++]<<_e,_e+=8}Ae>>>=at,_e-=at,de.back+=at}if(Ae>>>=Ve,_e-=Ve,de.back+=Ve,64&Ze){ye.msg="invalid distance code",de.mode=30;break}de.offset=nt,de.extra=15&Ze,de.mode=24;case 24:if(de.extra){for(Re=de.extra;_e>>=de.extra,_e-=de.extra,de.back+=de.extra}if(de.offset>de.dmax){ye.msg="invalid distance too far back",de.mode=30;break}de.mode=25;case 25:if(ke===0)break e;if(Ce=Ye-ke,de.offset>Ce){if((Ce=de.offset-Ce)>de.whave&&de.sane){ye.msg="invalid distance too far back",de.mode=30;break}Ge=Ce>de.wnext?(Ce-=de.wnext,de.wsize-Ce):de.wnext-Ce,Ce>de.length&&(Ce=de.length),We=de.window}else We=Oe,Ge=Pe-de.offset,Ce=de.length;for(keue?(ve=Ge[We+ne[Ee]],_e[Fe+ne[Ee]]):(ve=96,0),ae=1<>Pe)+(ce-=ae)]=ge<<24|ve<<16|Se|0,ce!==0;);for(ae=1<>=1;if(ae!==0?(Ae&=ae-1,Ae+=ae):Ae=0,Ee++,--Ye[ye]==0){if(ye===we)break;ye=K[te+ne[Ee]]}if(Oe>>7)]}function Fe(Le,je){Le.pending_buf[Le.pending++]=255&je,Le.pending_buf[Le.pending++]=je>>>8&255}function Ye(Le,je,Xe){Le.bi_valid>re-Xe?(Le.bi_buf|=je<>re-Le.bi_valid,Le.bi_valid+=Xe-re):(Le.bi_buf|=je<>>=1,Xe<<=1,0<--je;);return Xe>>>1}function We(Le,je,Xe){var Qe,He,tt=new Array(ne+1),ot=0;for(Qe=1;Qe<=ne;Qe++)tt[Qe]=ot=ot+Xe[Qe-1]<<1;for(He=0;He<=je;He++){var rt=Le[2*He+1];rt!==0&&(Le[2*He]=Ge(tt[rt]++,rt))}}function Ve(Le){var je;for(je=0;je>1;1<=Xe;Xe--)at(Le,tt,Xe);for(He=ft;Xe=Le.heap[1],Le.heap[1]=Le.heap[Le.heap_len--],at(Le,tt,1),Qe=Le.heap[1],Le.heap[--Le.heap_max]=Xe,Le.heap[--Le.heap_max]=Qe,tt[2*He]=tt[2*Xe]+tt[2*Qe],Le.depth[He]=(Le.depth[Xe]>=Le.depth[Qe]?Le.depth[Xe]:Le.depth[Qe])+1,tt[2*Xe+1]=tt[2*Qe+1]=He,Le.heap[1]=He++,at(Le,tt,1),2<=Le.heap_len;);Le.heap[--Le.heap_max]=Le.heap[1],function(lt,vt){var Et,Lt,Qt,Dt,qt,ei,gt=vt.dyn_tree,Wt=vt.max_code,ri=vt.stat_desc.static_tree,ti=vt.stat_desc.has_stree,zi=vt.stat_desc.extra_bits,vi=vt.stat_desc.extra_base,jt=vt.stat_desc.max_length,Ji=0;for(Dt=0;Dt<=ne;Dt++)lt.bl_count[Dt]=0;for(gt[2*lt.heap[lt.heap_max]+1]=0,Et=lt.heap_max+1;Et>=7;He>>=1)if(1&St&&rt.dyn_ltree[2*ft]!==0)return W;if(rt.dyn_ltree[18]!==0||rt.dyn_ltree[20]!==0||rt.dyn_ltree[26]!==0)return q;for(ft=32;ft>>3,(tt=Le.static_len+3+7>>>3)<=He&&(He=tt)):He=tt=Xe+5,Xe+4<=He&&je!==-1?Re(Le,je,Xe,Qe):Le.strategy===4||tt===He?(Ye(Le,2+(Qe?1:0),3),ct(Le,pe,ye)):(Ye(Le,4+(Qe?1:0),3),function(rt,ft,St,lt){var vt;for(Ye(rt,ft-257,5),Ye(rt,St-1,5),Ye(rt,lt-4,4),vt=0;vt>>8&255,Le.pending_buf[Le.d_buf+2*Le.last_lit+1]=255&je,Le.pending_buf[Le.l_buf+Le.last_lit]=255&Xe,Le.last_lit++,je===0?Le.dyn_ltree[2*Xe]++:(Le.matches++,je--,Le.dyn_ltree[2*(de[Xe]+K+1)]++,Le.dyn_dtree[2*_e(je)]++),Le.last_lit===Le.lit_bufsize-1},G._tr_align=function(Le){Ye(Le,2,3),Ce(Le,ce,pe),function(je){je.bi_valid===16?(Fe(je,je.bi_buf),je.bi_buf=0,je.bi_valid=0):8<=je.bi_valid&&(je.pending_buf[je.pending++]=255&je.bi_buf,je.bi_buf>>=8,je.bi_valid-=8)}(Le)}},{"../utils/common":41}],53:[function(F,D,G){D.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(F,D,G){D.exports=typeof setImmediate=="function"?setImmediate:function(){var U=[].slice.apply(arguments);U.splice(1,0,0),setTimeout.apply(null,U)}},{}]},{},[10])(10)})})(jszip_min);var JSZip=jszip_min.exports;class MXLHelper{static MXLtoIXmlElement(R){const F=new JSZip;return F.loadAsync(R).then(U=>F.file("META-INF/container.xml").async("text"),U=>{throw U}).then(U=>{const Y=new DOMParser().parseFromString(U,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return F.file(Y).async("text")},U=>{throw U}).then(U=>{const q=new DOMParser().parseFromString(U,"text/xml"),Y=new IXmlElement(q.documentElement);return Promise.resolve(Y)},U=>{throw U}).then(U=>U,U=>{throw new Error("extractSheetFromMxl: "+U.message)})}static MXLtoXMLstring(R){const F=new JSZip;return F.loadAsync(R).then(D=>F.file("META-INF/container.xml").async("text"),D=>{throw log$2.error(D),D}).then(D=>{const W=new DOMParser().parseFromString(D,"text/xml").getElementsByTagName("rootfile")[0].getAttribute("full-path");return F.file(W).async("text")},D=>{throw D})}}class PlaybackNoteGenerator{calculate(R){const F=new MusicPartManagerIterator(R);for(;!F.EndReached;){const D=F.CurrentEnrolledTimestamp,G=F.CurrentAudibleVoiceEntries();for(const U of G)this.handleVoiceEntry(R,U,D);F.moveToNext()}}handleVoiceEntry(R,F,D){if(F.IsGrace)return;const G=F.ParentVoice;let U;R.PlaybackDataDict.containsKey(G)?U=R.PlaybackDataDict.getValue(G):(U=[],R.PlaybackDataDict.setValue(G,U));for(const W of F.PlaybackEntries)if(W.HasNotes){for(const Y of W.Notes)Y.setLength();const q=Fraction$1.plus(D,W.TimestampShift);PlaybackNoteGenerator.addEntrySorted(U,W,q)}}static addEntrySorted(R,F,D){if(R.length===0)R.push({enrolledTimestamp:D,playbackEntry:F});else for(let G=R.length-1;G>=0;G--){const U=R[G];if(D.RealValue>U.enrolledTimestamp.RealValue)if(G===R.length-1){R.push({enrolledTimestamp:D,playbackEntry:F});break}else{R.splice(G+1,0,{enrolledTimestamp:D,playbackEntry:F});break}}}}class ScreenViewingRegion{constructor(R,F,D,G){this.psi=new BoundingBox$1(void 0),this.displaySizeInPixel=R,this.RelativeDisplaySize=F,this.RelativeDisplayPosition=D,this.WidthInUnits=G}static createWithRelativeDefaults(R,F){return new ScreenViewingRegion(R,new SizeF2D(1,1),new PointF2D(0,0),F)}static createWithDefaults(){return new ScreenViewingRegion(new SizeF2D(1,1),new SizeF2D(1,1),new PointF2D(0,0),1)}get UpperLeftPositionInUnits(){return this.psi.AbsolutePosition}set UpperLeftPositionInUnits(R){this.psi.AbsolutePosition=R}get DisplaySizeInPixel(){return this.displaySizeInPixel}set DisplaySizeInPixel(R){this.displaySizeInPixel=R,this.regionSizeInPixel=new SizeF2D(this.displaySizeInPixel.width*this.relativeRegionSize.width,this.displaySizeInPixel.height*this.relativeRegionSize.height),this.recalculateDependentVariables()}get RelativeDisplaySize(){return this.relativeRegionSize}set RelativeDisplaySize(R){this.relativeRegionSize=R,this.regionSizeInPixel=new SizeF2D(this.displaySizeInPixel.width*this.relativeRegionSize.width,this.displaySizeInPixel.height*this.relativeRegionSize.height),this.recalculateDependentVariables()}get RegionSizeInPixel(){return this.regionSizeInPixel}get WidthInUnits(){return this.psi.BorderRight}set WidthInUnits(R){this.psi.BorderRight=R,this.recalculateDependentVariables()}get ViewRegionInUnits(){return new SizeF2D(this.psi.BorderRight,this.psi.BorderBottom)}isVisible(R,F){const D=this.psi.collisionDetection(R);return this.psi.liesInsideBorders(R),D}isInsideDisplayArea(R,F){return this.RelativeDisplayPosition.x<=R&&R<=this.RelativeDisplayPosition.x+this.RelativeDisplaySize.width&&this.RelativeDisplayPosition.y<=F&&F<=this.RelativeDisplayPosition.y+this.RelativeDisplaySize.height}transformToUnitCoordinates(R){return new PointF2D(this.UpperLeftPositionInUnits.x+this.ViewRegionInUnits.width*((R.x-this.RelativeDisplayPosition.x)/this.RelativeDisplaySize.width),this.UpperLeftPositionInUnits.y+this.ViewRegionInUnits.height*((R.y-this.RelativeDisplayPosition.y)/this.RelativeDisplaySize.height))}transformLengthXToUnitCoordinates(R){return R/this.horizontalUnitToPixelRatio}transformLengthYToUnitCoordinates(R){return R/this.verticalUnitToPixelRatio}recalculateDependentVariables(){const R=this.regionSizeInPixel.width/this.regionSizeInPixel.height;this.psi.BorderBottom=this.psi.BorderRight/R,this.horizontalUnitToPixelRatio=this.regionSizeInPixel.width/this.ViewRegionInUnits.width,this.verticalUnitToPixelRatio=this.regionSizeInPixel.height/this.ViewRegionInUnits.height}}class AbstractZoomView{constructor(R){this.aspectRatio=1,this.zoomViews=[],this.mouseZoomMode=!1,this.autoScrollY=!0,this.displayInteractionManager=R,this.displayInteractionManager.addListener(this),this.offsetXMin=Number.MIN_VALUE,this.offsetYMin=Number.MIN_VALUE,this.rangeXMin=1,this.rangeYMin=1,this.offsetXMax=Number.MAX_VALUE,this.offsetYMax=Number.MAX_VALUE,this.rangeXMax=1e9,this.rangeYMax=1e9,this.XScrollingEnabled=!1,this.YScrollingEnabled=!0}positionTouched(R,F){if(!this.convertToUnitsReady())return;const D=this.getPositionInUnits(R,F);this.unitPosTouched(D,R,F)}get TouchActive(){return this.displayInteractionManager.TouchActive}get TouchMoving(){return this.displayInteractionManager.TouchMoving}positionDoubleTouched(R,F){if(!this.convertToUnitsReady())return;const D=this.getPositionInUnits(R,F);this.unitPosDoubleTouched(D,R,F)}get UsesManuallyControlledZoomMode(){return this.usesManuallyControlledZoomMode}set UsesManuallyControlledZoomMode(R){this.usesManuallyControlledZoomMode=R}mouseDown(R,F,D=!1){if(!this.convertToUnitsReady())return;this.selectScrollControllerY(!1),this.lastRangeX=Math.max(1,this.RangeX),this.lastRangeY=Math.max(1,this.RangeY),this.lastOffsetX=this.OffsetX,this.lastOffsetY=this.OffsetY;const G=this.getPositionInUnits(R,F);this.unitPosTouchDown(G,R,F),this.usesManuallyControlledZoomMode||(D?this.mouseZoomMode=!0:this.mouseZoomMode=!1)}mouseUp(R,F){const D=this.getPositionInUnits(R,F);this.unitPosTouchUp(D,R,F)}mouseMove(R,F,D,G){this.mouseZoomMode?(Math.abs(D-0)>1e-8&&(this.RangeX=Math.abs(this.lastRangeX/(1+D))),!this.lockRanges&&Math.abs(G-0)>1e-8&&(this.RangeY=Math.abs(this.lastRangeY/(1-G)))):(Math.abs(D-0)>1e-8&&(this.OffsetX=this.lastOffsetX-D*this.RangeX),Math.abs(G-0)>1e-8&&(this.OffsetY=this.lastOffsetY-G*this.RangeY));const U=this.getPositionInUnits(R,F);this.unitPosMove(U,R,F)}zoom(R){this.RangeX=Math.abs(this.lastRangeX/R)}addZoomView(R){this.zoomViews.push(R)}get OffsetX(){return this.offsetX}set OffsetX(R){this.offsetX=Math.min(this.offsetXMax,Math.max(this.offsetXMin,R));for(const F of this.zoomViews)F.viewportXChanged(this.offsetX,this.RangeX)}get OffsetY(){return this.offsetY}set OffsetY(R){this.offsetY=R,this.offsetY>this.offsetYMax?this.offsetY=this.offsetYMax:this.offsetY(B[B.SingleTouch=0]="SingleTouch",B[B.DoubleTouch=1]="DoubleTouch",B[B.TouchUp=2]="TouchUp",B[B.TouchDown=3]="TouchDown",B[B.Move=4]="Move",B))(InteractionType||{});class VoiceEntryInteractionListener{constructor(R){this.renderingManager=R}userDisplayInteraction(R,F,D){var G,U;switch(D){case InteractionType.TouchDown:case InteractionType.SingleTouch:case InteractionType.DoubleTouch:{const W=this.renderingManager.GraphicalMusicSheet.GetNearestVoiceEntry(F);W&&W.parentStaffEntry.parentVerticalContainer!==void 0&&((G=W.notes[0])==null?void 0:G.sourceNote.Pitch)!==void 0&&((U=this.renderingManager.PlaybackManager)==null||U.playVoiceEntry(W.parentVoiceEntry));break}}}}class SheetRenderingManager extends AbstractZoomView{constructor(R,F){super(R),this.mainViewingRegion=ScreenViewingRegion.createWithDefaults(),this.tryAgainToRenderCount=0,this.yOffsetMouseDown=Number.MIN_VALUE,this.unlockCursorDistancePixel=50,this.relativeTopPosition=.06,this.internalPreviewImageScale=3,this.listeners=[],this.LockDisplayToCursor=!0,this.ZoomActive=!1,this.rules=F,this.addZoomView(this),this.lockRanges=!0,this.TopBarHeightInPixel=70,this.BottomBarHeightInPixel=0,this.rules.UseDefaultVoiceInteractionListener&&this.listeners.push(new VoiceEntryInteractionListener(this))}addListener(R){this.listeners.push(R)}get Listeners(){return this.listeners}convertToUnitsReady(){return this.graphicalMusicSheet!==void 0}unitPosTouched(R,F,D){if(!this.SingleTouchDisabled){const G=new PointF2D(F,D);this.handleUserDisplayInteraction(G,R,InteractionType.SingleTouch)}}unitPosDoubleTouched(R,F,D){if(!this.DoubleTouchDisabled){const G=new PointF2D(F,D);this.handleUserDisplayInteraction(G,R,InteractionType.DoubleTouch)}}unitPosTouchDown(R,F,D){const G=new PointF2D(F,D);this.handleUserDisplayInteraction(G,R,InteractionType.TouchDown),this.yOffsetMouseDown=R.y}unitPosTouchUp(R,F,D){const G=new PointF2D(F,D);this.handleUserDisplayInteraction(G,R,InteractionType.TouchUp),this.displayInteractionManager.WasZoomGestureActive===!1&&this.unlockFromCursorIfNecessary(R),this.yOffsetMouseDown=Number.MIN_VALUE}unitPosMove(R,F,D){const G=new PointF2D(F,D);this.handleUserDisplayInteraction(G,R,InteractionType.Move),this.unlockFromCursorIfNecessary(R)}get MainViewingRegion(){return this.mainViewingRegion}setMusicSheet(R){this.graphicalMusicSheet=R,this.adaptDisplayLimitsToSheet(),this.setYOffset(0,!0)}viewportXChanged(R,F){this.graphicalMusicSheet!==void 0&&this.horizontalViewportChanged(R,F)}viewportYChanged(R,F){this.graphicalMusicSheet!==void 0&&(this.yOffsetMouseDown<=Number.MIN_VALUE+.5&&(this.yOffsetMouseDown=R),this.verticalViewportChanged(R,F))}displaySizeChanged(R,F){super.viewSizeChanged(R,F),!(Math.abs(R-0)<1e-7||Math.abs(F-0)<1e-7)&&(this.graphicalMusicSheet!==void 0&&this.graphicalMusicSheet.EnforceRedrawOfMusicSystems(),this.mainViewingRegion.DisplaySizeInPixel=new SizeF2D(R,F),this.adaptDisplayLimitsToSheet())}calcDisplayYPosition(R){return R.PositionAndShape.AbsolutePosition.y+R.PositionAndShape.BorderMarginTop-this.topBarHeightInUnits()-this.relativeTopPosition*this.heightWithoutTopBottomBarsInUnits()}yPositionForLastSystem(R){return R.PositionAndShape.AbsolutePosition.y+R.PositionAndShape.BorderMarginBottom-this.topBarHeightInUnits()-(1-this.relativeTopPosition)*this.heightWithoutTopBottomBarsInUnits()}scorePositionChanged(R,F,D,G,U,W){const q=this.calcDisplayYPosition(G);this.setYPosition(q,W)}setXPosition(R,F){this.LockDisplayToCursor&&this.setXOffset(R,F)}setYPosition(R,F){this.LockDisplayToCursor&&this.setYOffset(R,F)}get DrawingParameters(){return this.musicSheetDrawer.drawingParameters}topBarHeightInUnits(){return this.mainViewingRegion.transformLengthYToUnitCoordinates(this.TopBarHeightInPixel)}bottomBarHeightInUnits(){return this.mainViewingRegion.transformLengthYToUnitCoordinates(this.BottomBarHeightInPixel)}heightWithoutTopBottomBarsInUnits(){return this.mainViewingRegion.ViewRegionInUnits.height-this.topBarHeightInUnits()-this.bottomBarHeightInUnits()}activePositionToBottomBarHeight(){return(this.mainViewingRegion.ViewRegionInUnits.height-this.topBarHeightInUnits()-this.bottomBarHeightInUnits())*(1-2*this.relativeTopPosition)}getClickPosition(R,F){return this.mainViewingRegion.transformToUnitCoordinates(new PointF2D(R,F))}graphicalObjectIsVisible(R){return this.mainViewingRegion.isVisible(R,!1)}adaptDisplayLimitsToSheet(){if(this.graphicalMusicSheet===void 0||this.graphicalMusicSheet.MusicPages.length===0||this.graphicalMusicSheet.MusicPages[0].MusicSystems.length===0)return;this.offsetXMin=0,this.rangeXMin=this.graphicalMusicSheet.MinAllowedSystemWidth,this.rangeXMax=300,this.offsetYMin=-.3*this.RangeY;const R=this.graphicalMusicSheet.MusicPages.last().PositionAndShape;this.offsetYMax=Math.max(0,R.BorderMarginBottom-.7*this.RangeY),this.OffsetY>this.offsetYMax&&this.setYOffset(this.offsetYMax,!0)}horizontalViewportChanged(R,F){this.mainViewingRegion.WidthInUnits!==F&&(this.mainViewingRegion.WidthInUnits=F)}verticalViewportChanged(R,F){this.mainViewingRegion.UpperLeftPositionInUnits=new PointF2D(this.mainViewingRegion.UpperLeftPositionInUnits.x,R)}unlockFromCursorIfNecessary(R){if(this.LockDisplayToCursor===!1||this.ZoomActive||this.displayInteractionManager.ZoomGestureActive||this.displayInteractionManager.WasZoomGestureActive)return;Math.abs((R.y-this.yOffsetMouseDown)*this.mainViewingRegion.RegionSizeInPixel.height/this.mainViewingRegion.ViewRegionInUnits.height)>this.unlockCursorDistancePixel&&(this.LockDisplayToCursor=!1)}getPositionInUnits(R,F){return this.mainViewingRegion.transformToUnitCoordinates(new PointF2D(R,F))}handleUserDisplayInteraction(R,F,D){switch(D){case InteractionType.TouchDown:case InteractionType.SingleTouch:case InteractionType.DoubleTouch:{const G=this.graphicalMusicSheet.GetNearestVoiceEntry(F);if(G){const U=new CustomEvent("note-click",{detail:{...G,setAvtivePlay:()=>{var W,q;if(G.parentStaffEntry.parentVerticalContainer!==void 0){const Y=G.parentStaffEntry.parentVerticalContainer.AbsoluteTimestamp;this.setStartPosition(Y),((W=G.notes[0])==null?void 0:W.sourceNote.Pitch)!==void 0&&(console.log("playback clicked note",G.parentVoiceEntry),(q=this.PlaybackManager)==null||q.playVoiceEntry(G.parentVoiceEntry))}}}});window.dispatchEvent(U)}}case InteractionType.TouchUp:case InteractionType.TouchDown:case InteractionType.Move:for(const G of this.listeners)G.userDisplayInteraction(R,F,D);break;default:throw new Error("type")}}setStartPosition(R){var F;this.graphicalMusicSheet!==void 0&&(this.graphicalMusicSheet.ParentMusicSheet.SelectionStart=R,(F=this.PlaybackManager)==null||F.reset())}get GraphicalMusicSheet(){return this.graphicalMusicSheet}}class WebSheetRenderingManager extends SheetRenderingManager{mouseMove(R,F,D,G){const U=this.getPositionInUnits(R,F);this.unitPosMove(U,R,F)}}class AbstractDisplayInteractionManager{constructor(){this.listeners=[],this.zoomGestureActive=!1,this.touchCount=0,this.touchActive=!1,this.touchMoving=!1,this.displayWidth=1,this.displayHeight=1,this.displayDpi=96,this.maxNumerOfFingers=2,this.movementThreshInch=.075,this.interactionWasZoomGesture=!1}addListener(R){this.listeners.push(R)}get ZoomGestureActive(){return this.zoomGestureActive}get WasZoomGestureActive(){return this.interactionWasZoomGesture}displaySizeChanged(R,F){this.displayWidth=R,this.displayHeight=F;for(const D of this.listeners)D.displaySizeChanged(this.displayWidth,this.displayHeight)}Dispose(){this.dispose()}Initialize(){this.initialize()}get DisplayDpi(){return this.displayDpi}get TouchActive(){return this.touchActive}get TouchMoving(){return this.touchMoving}touchDown(R,F,D){this.interactionWasZoomGesture=!1;const G=R/this.displayWidth,U=F/this.displayHeight;this.lastRelPosX=G,this.lastRelPosY=U,this.lastPixelX=R,this.lastPixelY=F,this.touchActive=!0,this.touchMoving=!1,this.touchCount=Math.min(this.touchCount+1,this.maxNumerOfFingers);for(const W of this.listeners)W.mouseDown(G,U,!D)}move(R,F){if(this.touchActive&&!this.zoomGestureActive){const D=R/this.displayWidth,G=F/this.displayHeight,U=D-this.lastRelPosX,W=G-this.lastRelPosY;this.touchMoving=!0;for(const q of this.listeners)q.mouseMove(D,G,U,W)}}zoomGestureStarted(){this.zoomGestureActive=!0}zoomGestureCompleted(){this.zoomGestureActive=!1,this.interactionWasZoomGesture=!0}zoomGestureMove(R){this.zoomGestureActive&&this.listeners.forEach(function(F){F.zoom(R)})}touchUp(R,F){this.touchActive=!1,this.touchMoving=!1,this.touchCount=Math.max(0,this.touchCount-1);const D=R/this.displayWidth,G=F/this.displayHeight;for(const U of this.listeners)U.mouseUp(D,G)}click(R,F){if(!this.mouseDidMove(this.lastPixelX,R,this.lastPixelY,F)&&!this.ZoomGestureActive){const D=R/this.displayWidth,G=F/this.displayHeight;for(const U of this.listeners)U.positionTouched(D,G)}}doubleClick(R,F){if(!this.mouseDidMove(this.lastPixelX,R,this.lastPixelY,F)&&!this.ZoomGestureActive){const D=R/this.displayWidth,G=F/this.displayHeight;for(const U of this.listeners)U.positionDoubleTouched(D,G)}}mouseDidMove(R,F,D,G){const U=Math.abs(R-F)/this.displayDpi,W=Math.abs(D-G)/this.displayDpi;return U>this.movementThreshInch||W>this.movementThreshInch}}class WebDisplayInteractionManager extends AbstractDisplayInteractionManager{constructor(R){super(),this.fullOffsetLeft=0,this.fullOffsetTop=0,this.fullScrollTop=0,this.fullScrollLeft=0,this.parentScrollMap=new Map,this.scrollCallbackMap=new Map,this.timeout=void 0,this.resizeObserver=void 0,this.EventCallbackMap=new Dictionary,this.DOUBLE_CLICK_WINDOW=200,this.lastClick=0,this.osmdSheetMusicContainer=R,this.listenForInteractions()}get FullOffsetTop(){return this.fullOffsetTop}get FullScrollTop(){return this.fullScrollTop}get FullOffsetLeft(){return this.fullOffsetLeft}get FullScrollLeft(){return this.fullScrollLeft}static resizeCallback(R,F){clearTimeout(F.timeout),F.timeout=setTimeout(()=>{F.fullOffsetLeft=0,F.fullOffsetTop=0;let D=F.osmdSheetMusicContainer;for(;D;)F.fullOffsetLeft+=D.offsetLeft,F.fullOffsetTop+=D.offsetTop,D=D.offsetParent;F.resizeEventListener(),F.deregisterScrollOffsets(),F.registerScrollOffsets()},500)}registerScrollOffsets(){let R=this.osmdSheetMusicContainer;this.fullScrollTop=0,this.fullScrollLeft=0;const F=this;for(;R&&R!==document.documentElement;){if(this.parentScrollMap.set(R,[R.scrollTop,R.scrollLeft]),this.fullScrollLeft+=R.scrollLeft,this.fullScrollTop+=R.scrollTop,R.scrollHeight>R.clientHeight){const D=function(G){const U=F.parentScrollMap.get(this),W=U[0],q=U[1];F.fullScrollTop=F.fullScrollTop-W+this.scrollTop,F.fullScrollLeft=F.fullScrollLeft-q+this.scrollLeft,F.parentScrollMap.set(this,[this.scrollTop,this.scrollLeft])};this.scrollCallbackMap.set(R,D),R.addEventListener("scroll",D)}R=R.parentElement}}deregisterScrollOffsets(){for(const R of this.scrollCallbackMap.keys())R.removeEventListener("scroll",this.scrollCallbackMap.get(R));this.scrollCallbackMap.clear()}initialize(){this.fullOffsetLeft=0,this.fullOffsetTop=0;let R=this.osmdSheetMusicContainer;const F=[],D=this;for(window.ResizeObserver&&(this.resizeObserver=new ResizeObserver(G=>{WebDisplayInteractionManager.resizeCallback(G,D)}));R;)this.fullOffsetLeft+=R.offsetLeft,this.fullOffsetTop+=R.offsetTop,this.resizeObserver?this.resizeObserver.observe(R):F.push(R),R=R.offsetParent;if(this.resizeObserver)this.disposeResizeListener=()=>{D.resizeObserver.disconnect(),D.resizeObserver=void 0};else{let G=()=>{WebDisplayInteractionManager.resizeCallback(F,D)};window.addEventListener("resize",G),this.disposeResizeListener=()=>{window.removeEventListener("resize",G),G=void 0}}D.registerScrollOffsets()}dispose(){this.disposeResizeListener();for(const R of this.EventCallbackMap.keys()){const F=this.EventCallbackMap.getValue(R);F[0].removeEventListener(R,F[1])}this.EventCallbackMap.clear(),this.deregisterScrollOffsets(),this.scrollCallbackMap.clear(),this.parentScrollMap.clear()}isTouch(){if("ontouchstart"in window||window.DocumentTouch)return!0;if(!window.matchMedia)return!1;const F=["(",["-webkit-","-moz-","-o-","-ms-"].join("touch-enabled),("),"heartz",")"].join("");return window.matchMedia(F).matches}get downEventName(){return this.isTouch()?"touchstart":"mousedown"}get moveEventName(){return this.isTouch()?"touchmove":"mousemove"}listenForInteractions(){const R=this.downEventListener.bind(this),F=this.touchEndEventListener.bind(this),D=this.moveEventListener.bind(this);this.osmdSheetMusicContainer.addEventListener("mousedown",R),this.osmdSheetMusicContainer.addEventListener("touchend",F),document.addEventListener(this.moveEventName,D),this.EventCallbackMap.setValue("mousedown",[this.osmdSheetMusicContainer,R]),this.EventCallbackMap.setValue("touchend",[this.osmdSheetMusicContainer,F]),this.EventCallbackMap.setValue(this.moveEventName,[document,D])}downEventListener(R){const F=new Date().getTime(),D=F-this.lastClick;clearTimeout(this.clickTimeout);let G=0,U=0;this.isTouch()&&R instanceof TouchEvent?(G=R.touches[0].pageX,U=R.touches[0].pageY):R instanceof MouseEvent&&(G=R.pageX,U=R.pageY);const W=this.getOffsetCoordinates(G,U);if(D0)this.doubleClick(W.x,W.y);else{const q=this;this.clickTimeout=setTimeout(function(){clearTimeout(this.clickTimeout),q.isTouch()?q.touchDown(W.x,W.y,void 0):q.click(W.x,W.y)},this.DOUBLE_CLICK_WINDOW)}this.lastClick=F}moveEventListener(R){let F=0,D=0;if(this.isTouch()&&R instanceof TouchEvent){let U;R.touches&&R.touches.length>0?U=R.touches[0]:R.changedTouches&&R.changedTouches.length>0&&(U=R.changedTouches[0]),F=U==null?void 0:U.clientX,D=U==null?void 0:U.clientY}else R instanceof MouseEvent&&(F=R.clientX,D=R.clientY);const G=this.getOffsetCoordinates(F,D);this.move(G.x,G.y)}touchEndEventListener(R){let F;R.touches&&R.touches.length>0?F=R.touches[0]:R.changedTouches&&R.changedTouches.length>0&&(F=R.changedTouches[0]);const D=this.getOffsetCoordinates(F==null?void 0:F.pageX,F==null?void 0:F.pageY);this.touchUp(D.x,D.y)}resizeEventListener(){this.displaySizeChanged(this.osmdSheetMusicContainer.clientWidth,this.osmdSheetMusicContainer.clientHeight)}getOffsetCoordinates(R,F){const D=R-this.fullOffsetLeft+this.fullScrollLeft,G=F-this.fullOffsetTop+this.fullScrollTop;return new PointF2D(D,G)}}class DynamicsCalculator{static fillDynamicsList(R,F,D){for(let G=0;G=0&&D[Y].push(new DynamicsContainer(q.InstantaneousDynamic,Y))}if(q.StartingContinuousDynamic!==void 0){D[G].push(new DynamicsContainer(q.StartingContinuousDynamic,q.StaffNumber));const Y=this.getOtherStaffIndexIfLinkedStavesAreDetected(R,G,q.StartingContinuousDynamic.Placement);Y>=0&&D[Y].push(new DynamicsContainer(q.StartingContinuousDynamic,Y))}}}}static getOtherStaffIndexIfLinkedStavesAreDetected(R,F,D){const G=R.getStaffFromIndex(F),U=G.ParentInstrument.Staves.indexOf(G),W=G.ParentInstrument.Staves.length;return W>1&&U===0&&D===PlacementEnum.Below?F+1:W>1&&U===1&&D===PlacementEnum.Above?F-1:-1}static fillDynamicExpressions(R){const F=R.DynListStaves,D=R.getCompleteNumberOfStaves(),G=R.TimestampSortedDynamicExpressionsList;for(let U=0;U{R(this.processStringXml(D))},D=>{log$2.error(new Error("[OSMD] Invalid MXL file: "+D)),F(new Error("[OSMD] Invalid MXL file: "+D))})}processStringXml(B){const R=new DOMParser;if(B.substr(0,3)==="\uF7EF\uF7BB\uF7BF")return log$2.debug("[OSMD] UTF with BOM detected, truncate first three bytes and pass along: "+B),R.parseFromString(B.substr(3),"application/xml");if(B.substr(0,6).includes("{F.isMxl(K)?F.processMxl(K,q,Y):q(F.processStringXml(K))},K=>{throw Y(K),K});else{const K=new Error("[OSMD] osmd.load(string): Could not process string. Did not find {R.init(this.sheet.MusicPartManager,this.graphic)}),this.renderingManager.setMusicSheet(this.graphic),this.interactionManager.Initialize()}render(){var R;if(!this.graphic)throw new Error("OpenSheetMusicDisplay: Before rendering a music sheet, please load a MusicXML file");(R=this.drawer)==null||R.clear();let B=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(B=this.rules.SheetMaximumWidth),this.sheet.pageWidth=B/this.zoom/10,this.renderingManager.MainViewingRegion.WidthInUnits=this.sheet.pageWidth,this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?(this.rules.PageHeight=this.sheet.pageWidth/this.rules.PageFormat.aspectRatio,log$2.debug("[OSMD] PageHeight: "+this.rules.PageHeight)):(log$2.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.enableOrDisableCursors(this.drawingParameters.drawCursors),this.drawingParameters.drawCursors&&this.cursors.forEach(F=>{F.update()}),this.zoomUpdated=!1,this.interactionManager.displaySizeChanged(this.container.clientWidth,this.container.clientHeight)}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 VexFlowMusicSheetDrawer(this.drawingParameters),this.drawer.drawableBoundingBoxElement=this.DrawBoundingBox,this.drawer.bottomLineVisible=this.drawBottomLine,this.drawer.skyLineVisible=this.drawSkyLine;let B=this.container.offsetWidth;this.rules.RenderSingleHorizontalStaffline&&(B=this.graphic.MusicPages[0].PositionAndShape.Size.width*10*this.zoom);let R;const F=32767;for(const D of this.graphic.MusicPages){if(D.PageNumber>this.rules.MaxPageToDrawNumber)break;const G=this.createBackend(this.backendType,D),U=" exceeds CanvasBackend limit of 32767. Cutting off score.";G.getOSMDBackendType()===BackendType.Canvas&&B>F&&(log$2.warn("[OSMD] Warning: width of "+B+U),B=F),this.rules.PageFormat&&!this.rules.PageFormat.IsUndefined?R=B/this.rules.PageFormat.aspectRatio:(R=D.PositionAndShape.Size.height,R+=this.rules.PageBottomMargin,R+=this.rules.CompactMode?this.rules.PageTopMarginNarrow:this.rules.PageTopMargin,this.rules.RenderTitle&&(R+=this.rules.TitleTopDistance),R*=this.zoom*10),G.getOSMDBackendType()===BackendType.Canvas&&R>F&&(log$2.warn("[OSMD] Warning: height of "+R+U),R=Math.min(R,F)),G.resize(B,R),G.clear(),this.drawer.Backends.push(G),this.graphic.drawer=this.drawer}}exportSVG(){var B;for(const R of(B=this.drawer)==null?void 0:B.Backends)R instanceof SvgVexFlowBackend&&R.export()}IsReadyToRender(){return this.graphic!==void 0}clear(){var B;(B=this.drawer)==null||B.clear(),this.reset()}dispose(){this.disposeResizeListener&&this.disposeResizeListener(),this.InteractionManager&&this.InteractionManager.Dispose()}setOptions(B){if(this.rules||(this.rules=new EngravingRules),this.drawingParameters||(this.drawingParameters=new DrawingParameters,this.drawingParameters.Rules=this.rules),B==null){log$2.warn(`warning: osmd.setOptions() called without an options parameter, has no effect. example usage: osmd.setOptions({drawCredits: false, drawPartNames: false})`);return}this.OnXMLRead=function(G){return G},B.onXMLRead&&(this.OnXMLRead=B.onXMLRead),B.drawingParameters&&(this.drawingParameters.DrawingParametersEnum=DrawingParametersEnum[B.drawingParameters.toLowerCase()]);let F=!this.drawer||!this.drawer.Backends||this.drawer.Backends.length<1;if(B.backend!==void 0){const G=OSMDOptions.BackendTypeFromString(B.backend);F=F||this.backendType!==G,this.backendType=G}this.needBackendUpdate=F,B.autoBeam!==void 0&&(this.rules.AutoBeamNotes=B.autoBeam);const D=B.autoBeamOptions;if(D&&(D.maintain_stem_directions===void 0&&(D.maintain_stem_directions=!1),this.rules.AutoBeamOptions=D,D.groups&&D.groups.length)){for(const G of D.groups)if(G.length!==2)throw new Error("Each fraction in autoBeamOptions.groups must be of length 2, e.g. [3,4] for beaming three fourths")}B.percussionOneLineCutoff!==void 0&&(this.rules.PercussionOneLineCutoff=B.percussionOneLineCutoff),this.rules.PercussionOneLineCutoff!==0&&B.percussionForceVoicesOneLineCutoff!==void 0&&(this.rules.PercussionForceVoicesOneLineCutoff=B.percussionForceVoicesOneLineCutoff),B.alignRests!==void 0&&(this.rules.AlignRests=B.alignRests),B.coloringMode!==void 0&&this.setColoringMode(B),B.coloringEnabled!==void 0&&(this.rules.ColoringEnabled=B.coloringEnabled),B.colorStemsLikeNoteheads!==void 0&&(this.rules.ColorStemsLikeNoteheads=B.colorStemsLikeNoteheads),B.disableCursor&&(this.drawingParameters.drawCursors=!1),B.drawHiddenNotes&&(this.drawingParameters.drawHiddenNotes=!0),B.drawCredits!==void 0&&(this.drawingParameters.DrawCredits=B.drawCredits),B.drawComposer!==void 0&&(this.drawingParameters.DrawComposer=B.drawComposer),B.drawTitle!==void 0&&(this.drawingParameters.DrawTitle=B.drawTitle),B.drawSubtitle!==void 0&&(this.drawingParameters.DrawSubtitle=B.drawSubtitle),B.drawLyricist!==void 0&&(this.drawingParameters.DrawLyricist=B.drawLyricist),B.drawMetronomeMarks!==void 0&&(this.rules.MetronomeMarksDrawn=B.drawMetronomeMarks),B.drawPartNames!==void 0&&(this.drawingParameters.DrawPartNames=B.drawPartNames,B.drawPartAbbreviations||(this.rules.RenderPartAbbreviations=B.drawPartNames)),B.drawPartAbbreviations!==void 0&&(this.rules.RenderPartAbbreviations=B.drawPartAbbreviations),B.drawFingerings===!1&&(this.rules.RenderFingerings=!1),B.drawMeasureNumbers!==void 0&&(this.rules.RenderMeasureNumbers=B.drawMeasureNumbers),B.drawMeasureNumbersOnlyAtSystemStart&&(this.rules.RenderMeasureNumbersOnlyAtSystemStart=B.drawMeasureNumbersOnlyAtSystemStart),B.drawLyrics!==void 0&&(this.rules.RenderLyrics=B.drawLyrics),B.drawTimeSignatures!==void 0&&(this.rules.RenderTimeSignatures=B.drawTimeSignatures),B.drawSlurs!==void 0&&(this.rules.RenderSlurs=B.drawSlurs),B.measureNumberInterval!==void 0&&(this.rules.MeasureNumberLabelOffset=B.measureNumberInterval),B.useXMLMeasureNumbers!==void 0&&(this.rules.UseXMLMeasureNumbers=B.useXMLMeasureNumbers),B.fingeringPosition!==void 0&&(this.rules.FingeringPosition=AbstractExpression.PlacementEnumFromString(B.fingeringPosition)),B.fingeringInsideStafflines!==void 0&&(this.rules.FingeringInsideStafflines=B.fingeringInsideStafflines),B.newSystemFromXML!==void 0&&(this.rules.NewSystemAtXMLNewSystemAttribute=B.newSystemFromXML),B.newPageFromXML!==void 0&&(this.rules.NewPageAtXMLNewPageAttribute=B.newPageFromXML),B.fillEmptyMeasuresWithWholeRest!==void 0&&(this.rules.FillEmptyMeasuresWithWholeRest=B.fillEmptyMeasuresWithWholeRest),B.followCursor!==void 0&&(this.FollowCursor=B.followCursor),B.setWantedStemDirectionByXml!==void 0&&(this.rules.SetWantedStemDirectionByXml=B.setWantedStemDirectionByXml),B.darkMode?(this.rules.applyDefaultColorMusic("#FFFFFF"),this.rules.PageBackgroundColor="#000000"):B.darkMode===!1&&(this.rules.applyDefaultColorMusic("#000000"),this.rules.PageBackgroundColor=void 0),B.defaultColorMusic&&this.rules.applyDefaultColorMusic(B.defaultColorMusic),B.defaultColorNotehead&&(this.rules.DefaultColorNotehead=B.defaultColorNotehead),B.defaultColorRest&&(this.rules.DefaultColorRest=B.defaultColorRest),B.defaultColorStem&&(this.rules.DefaultColorStem=B.defaultColorStem),B.defaultColorLabel&&(this.rules.DefaultColorLabel=B.defaultColorLabel),B.defaultColorTitle&&(this.rules.DefaultColorTitle=B.defaultColorTitle),B.defaultFontFamily&&(this.rules.DefaultFontFamily=B.defaultFontFamily),B.defaultFontStyle&&(this.rules.DefaultFontStyle=B.defaultFontStyle),B.drawUpToMeasureNumber&&(this.rules.MaxMeasureToDrawIndex=B.drawUpToMeasureNumber-1),B.drawFromMeasureNumber&&(this.rules.MinMeasureToDrawIndex=B.drawFromMeasureNumber-1),B.drawUpToPageNumber&&(this.rules.MaxPageToDrawNumber=B.drawUpToPageNumber),B.drawUpToSystemNumber&&(this.rules.MaxSystemToDrawNumber=B.drawUpToSystemNumber),B.tupletsRatioed&&(this.rules.TupletsRatioed=!0),B.tupletsBracketed&&(this.rules.TupletsBracketed=!0),B.tripletsBracketed&&(this.rules.TripletsBracketed=!0),B.autoResize?(this.resizeHandlerAttached||this.autoResize(),this.autoResizeEnabled=!0):B.autoResize===!1&&(this.autoResizeEnabled=!1),B.pageFormat!==void 0&&this.setPageFormat(B.pageFormat),B.pageBackgroundColor!==void 0&&(this.rules.PageBackgroundColor=B.pageBackgroundColor),B.performanceMode!==void 0&&(this.rules.PerformanceMode=B.performanceMode),B.renderSingleHorizontalStaffline!==void 0&&(this.rules.RenderSingleHorizontalStaffline=B.renderSingleHorizontalStaffline),B.spacingFactorSoftmax!==void 0&&(this.rules.SoftmaxFactorVexFlow=B.spacingFactorSoftmax),B.spacingBetweenTextLines!==void 0&&(this.rules.SpacingBetweenTextLines=B.spacingBetweenTextLines),B.stretchLastSystemLine!==void 0&&(this.rules.StretchLastSystemLine=B.stretchLastSystemLine),B.autoGenerateMutipleRestMeasuresFromRestMeasures!==void 0&&(this.rules.AutoGenerateMutipleRestMeasuresFromRestMeasures=B.autoGenerateMutipleRestMeasuresFromRestMeasures),B.cursorsOptions!==void 0?this.cursorsOptions=B.cursorsOptions:this.cursorsOptions=[{type:0,color:this.EngravingRules.DefaultColorCursor,alpha:.5,follow:!0}]}setColoringMode(B){if(B.coloringMode===ColoringModes.XML){this.rules.ColoringMode=ColoringModes.XML;return}const R=[NoteEnum.C,NoteEnum.D,NoteEnum.E,NoteEnum.F,NoteEnum.G,NoteEnum.A,NoteEnum.B,-1];let F;if(B.coloringMode===ColoringModes.CustomColorSet){if(!B.coloringSetCustom||B.coloringSetCustom.length!==8)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 G of B.coloringSetCustom)if(!/^\#[0-9a-fA-F]{6}$/.test(G))throw new Error(`One of the color strings in options.coloringSetCustom was not a valid HTML Hex color: `+G);F=B.coloringSetCustom}else if(B.coloringMode===ColoringModes.AutoColoring){F=[];const G=Object.keys(AutoColorSet);for(let U=0;U{B.hide()}),this.sheet=void 0,this.graphic=void 0,this.zoom=1}autoResize(){const B=this;this.handleResize(()=>{},()=>{var R;((R=this.graphic)==null?void 0:R.GetCalculator)instanceof VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=!0),B.IsReadyToRender()&&B.render()})}handleResize(B,R){let F,D;const U=this;function W(){!U.AutoResizeEnabled||(F=new Date().getTime(),D||(B(),F=new Date().getTime(),D=window.setTimeout(q,200)))}function q(){D=void 0,window.clearTimeout(D),new Date().getTime()-F<200?D=window.setTimeout(q,200):R()}window.attachEvent?window.attachEvent("onresize",W):window.addEventListener("resize",W),this.disposeResizeListener=()=>{window.detachEvent?window.detachEvent("onresize",W):window.removeEventListener("resize",W),this.resizeHandlerAttached=!1},this.resizeHandlerAttached=!0,window.setTimeout(B,0),window.setTimeout(R,1)}enableOrDisableCursors(B){var R,F,D,G,U,W;if(this.drawingParameters.drawCursors=B,B){for(let q=0;q{q.hide()})}createBackend(B,R){let F;return B===void 0||B===BackendType.SVG?F=new SvgVexFlowBackend(this.rules):F=new CanvasVexFlowBackend(this.rules),F.graphicalMusicPage=R,F.initialize(this.container,this.zoom),F.getContext().setFillStyle(this.rules.DefaultColorMusic),F.getContext().setStrokeStyle(this.rules.DefaultColorMusic),F}static StringToPageFormat(B){let R=PageFormat.UndefinedPageFormat;if(B.match("^[0-9]+x[0-9]+$")){const F=B.split("x"),D=Number.parseInt(F[0],10),G=Number.parseInt(F[1],10);D>0&&D<32768&&G>0&&G<32768&&(R=new PageFormat(D,G,`customPageFormat${B}`))}return B=B.replace(" ","_"),B=B.replace("Landscape","L"),B=B.replace("Portrait","P"),_OpenSheetMusicDisplay.PageFormatStandards.hasOwnProperty(B)&&(R=_OpenSheetMusicDisplay.PageFormatStandards[B]),R}setPageFormat(B){const R=_OpenSheetMusicDisplay.StringToPageFormat(B);this.needBackendUpdate=!R.Equals(this.rules.PageFormat),this.rules.PageFormat=R}setCustomPageFormat(B,R){if(B>0&&R>0){const F=new PageFormat(B,R);this.rules.PageFormat=F}}set DrawSkyLine(B){this.drawSkyLine=B,this.drawer&&(this.drawer.skyLineVisible=B)}get DrawSkyLine(){return this.drawer.skyLineVisible}set DrawBottomLine(B){this.drawBottomLine=B,this.drawer&&(this.drawer.bottomLineVisible=B)}get DrawBottomLine(){return this.drawer.bottomLineVisible}set DrawBoundingBox(B){this.setDrawBoundingBox(B,!0)}get DrawBoundingBox(){return this.drawBoundingBox}setDrawBoundingBox(B,R=!1){this.drawBoundingBox=B,this.drawer&&(this.drawer.drawableBoundingBoxElement=B),R&&this.render()}get AutoResizeEnabled(){return this.autoResizeEnabled}set AutoResizeEnabled(B){this.autoResizeEnabled=B}get Zoom(){return this.zoom}set Zoom(B){var R;this.zoom=B,this.zoomUpdated=!0,((R=this.graphic)==null?void 0:R.GetCalculator)instanceof VexFlowMusicSheetCalculator&&(this.graphic.GetCalculator.beamsNeedUpdate=this.zoomUpdated)}set FollowCursor(B){this.followCursor=B}get FollowCursor(){return this.followCursor}set TransposeCalculator(B){MusicSheetCalculator.transposeCalculator=B}get TransposeCalculator(){return 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 InteractionManager(){return this.interactionManager}get Version(){return this.version}};let OpenSheetMusicDisplay=_OpenSheetMusicDisplay;OpenSheetMusicDisplay.PageFormatStandards={A3_L:new PageFormat(420,297,"A3_L"),A3_P:new PageFormat(297,420,"A3_P"),A4_L:new PageFormat(297,210,"A4_L"),A4_P:new PageFormat(210,297,"A4_P"),A5_L:new PageFormat(210,148,"A5_L"),A5_P:new PageFormat(148,210,"A5_P"),A6_L:new PageFormat(148,105,"A6_L"),A6_P:new PageFormat(105,148,"A6_P"),Endless:PageFormat.UndefinedPageFormat,Letter_L:new PageFormat(279.4,215.9,"Letter_L"),Letter_P:new PageFormat(215.9,279.4,"Letter_P")};var handlebars={exports:{}},handlebars_runtime={exports:{}},base$1={},utils={};utils.__esModule=!0;utils.extend=extend;utils.indexOf=indexOf;utils.escapeExpression=escapeExpression;utils.isEmpty=isEmpty;utils.createFrame=createFrame;utils.blockParams=blockParams;utils.appendContextPath=appendContextPath;var escape$1={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},badChars=/[&<>"'`=]/g,possible=/[&<>"'`=]/;function escapeChar(B){return escape$1[B]}function extend(B){for(var R=1;R0?(U.ids&&(U.ids=[U.name]),D.helpers.each(G,U)):W(this);if(U.data&&U.ids){var Y=F.createFrame(U.data);Y.contextPath=F.appendContextPath(U.data.contextPath,U.name),U={data:Y}}return q(G,U)})},B.exports=R.default})(blockHelperMissing,blockHelperMissing.exports);var each={exports:{}};(function(B,R){R.__esModule=!0;function F(W){return W&&W.__esModule?W:{default:W}}var D=utils,G=exception.exports,U=F(G);R.default=function(W){W.registerHelper("each",function(q,Y){if(!Y)throw new U.default("Must pass iterator to #each");var J=Y.fn,Z=Y.inverse,K=0,te="",Q=void 0,ie=void 0;Y.data&&Y.ids&&(ie=D.appendContextPath(Y.data.contextPath,Y.ids[0])+"."),D.isFunction(q)&&(q=q.call(this)),Y.data&&(Q=D.createFrame(Y.data));function se(he,fe,be){Q&&(Q.key=he,Q.index=fe,Q.first=fe===0,Q.last=!!be,ie&&(Q.contextPath=ie+he)),te=te+J(q[he],{data:Q,blockParams:D.blockParams([q[he],he],[ie+he,null])})}if(q&&typeof q=="object")if(D.isArray(q))for(var ne=q.length;K=0?U=W:U=parseInt(U,10)}return U},log:function(U){if(U=D.lookupLevel(U),typeof console!="undefined"&&D.lookupLevel(D.level)<=U){var W=D.methodMap[U];console[W]||(W="log");for(var q=arguments.length,Y=Array(q>1?q-1:0),J=1;J= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};base$1.REVISION_CHANGES=REVISION_CHANGES;var objectType="[object Object]";function HandlebarsEnvironment(B,R,F){this.helpers=B||{},this.partials=R||{},this.decorators=F||{},_helpers$2.registerDefaultHelpers(this),_decorators.registerDefaultDecorators(this)}HandlebarsEnvironment.prototype={constructor:HandlebarsEnvironment,logger:_logger2.default,log:_logger2.default.log,registerHelper:function B(R,F){if(_utils$3.toString.call(R)===objectType){if(F)throw new _exception2$3.default("Arg not supported with multiple helpers");_utils$3.extend(this.helpers,R)}else this.helpers[R]=F},unregisterHelper:function B(R){delete this.helpers[R]},registerPartial:function B(R,F){if(_utils$3.toString.call(R)===objectType)_utils$3.extend(this.partials,R);else{if(typeof F=="undefined")throw new _exception2$3.default('Attempting to register a partial called "'+R+'" as undefined');this.partials[R]=F}},unregisterPartial:function B(R){delete this.partials[R]},registerDecorator:function B(R,F){if(_utils$3.toString.call(R)===objectType){if(F)throw new _exception2$3.default("Arg not supported with multiple decorators");_utils$3.extend(this.decorators,R)}else this.decorators[R]=F},unregisterDecorator:function B(R){delete this.decorators[R]},resetLoggedPropertyAccesses:function B(){_internalProtoAccess$1.resetLoggedProperties()}};var log=_logger2.default.log;base$1.log=log;base$1.createFrame=_utils$3.createFrame;base$1.logger=_logger2.default;var safeString={exports:{}};(function(B,R){R.__esModule=!0;function F(D){this.string=D}F.prototype.toString=F.prototype.toHTML=function(){return""+this.string},R.default=F,B.exports=R.default})(safeString,safeString.exports);var runtime={},wrapHelper$1={};wrapHelper$1.__esModule=!0;wrapHelper$1.wrapHelper=wrapHelper;function wrapHelper(B,R){if(typeof B!="function")return B;var F=function(){var G=arguments[arguments.length-1];return arguments[arguments.length-1]=R(G),B.apply(this,arguments)};return F}runtime.__esModule=!0;runtime.checkRevision=checkRevision;runtime.template=template;runtime.wrapProgram=wrapProgram;runtime.resolvePartial=resolvePartial;runtime.invokePartial=invokePartial;runtime.noop=noop;function _interopRequireDefault$3(B){return B&&B.__esModule?B:{default:B}}function _interopRequireWildcard$1(B){if(B&&B.__esModule)return B;var R={};if(B!=null)for(var F in B)Object.prototype.hasOwnProperty.call(B,F)&&(R[F]=B[F]);return R.default=B,R}var _utils$2=utils,Utils=_interopRequireWildcard$1(_utils$2),_exception$2=exception.exports,_exception2$2=_interopRequireDefault$3(_exception$2),_base=base$1,_helpers$1=helpers$1,_internalWrapHelper=wrapHelper$1,_internalProtoAccess=protoAccess;function checkRevision(B){var R=B&&B[0]||1,F=_base.COMPILER_REVISION;if(!(R>=_base.LAST_COMPATIBLE_COMPILER_REVISION&&R<=_base.COMPILER_REVISION))if(R<_base.LAST_COMPATIBLE_COMPILER_REVISION){var D=_base.REVISION_CHANGES[F],G=_base.REVISION_CHANGES[R];throw new _exception2$2.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+D+") or downgrade your runtime to an older version ("+G+").")}else throw new _exception2$2.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+B[1]+").")}function template(B,R){if(!R)throw new _exception2$2.default("No environment passed to template");if(!B||!B.main)throw new _exception2$2.default("Unknown template object: "+typeof B);B.main.decorator=B.main_d,R.VM.checkRevision(B.compiler);var F=B.compiler&&B.compiler[0]===7;function D(W,q,Y){Y.hash&&(q=Utils.extend({},q,Y.hash),Y.ids&&(Y.ids[0]=!0)),W=R.VM.resolvePartial.call(this,W,q,Y);var J=Utils.extend({},Y,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),Z=R.VM.invokePartial.call(this,W,q,J);if(Z==null&&R.compile&&(Y.partials[Y.name]=R.compile(W,B.compilerOptions,R),Z=Y.partials[Y.name](q,J)),Z!=null){if(Y.indent){for(var K=Z.split(` `),te=0,Q=K.length;te2&&pe.push("'"+this.terminals_[ge]+"'");this.lexer.showPosition?ye="Parse error on line "+(ie+1)+`: `+this.lexer.showPosition()+` Expecting `+pe.join(", ")+", got '"+(this.terminals_[ce]||ce)+"'":ye="Parse error on line "+(ie+1)+": Unexpected "+(ce==1?"end of input":"'"+(this.terminals_[ce]||ce)+"'"),this.parseError(ye,{text:this.lexer.match,token:this.terminals_[ce]||ce,line:this.lexer.yylineno,loc:ne,expected:pe})}}if(fe[0]instanceof Array&&fe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+he+", token: "+ce);switch(fe[0]){case 1:J.push(ce),Z.push(this.lexer.yytext),K.push(this.lexer.yylloc),J.push(fe[1]),ce=null,se=this.lexer.yyleng,Q=this.lexer.yytext,ie=this.lexer.yylineno,ne=this.lexer.yylloc;break;case 2:if(ve=this.productions_[fe[1]][1],ue.$=Z[Z.length-ve],ue._$={first_line:K[K.length-(ve||1)].first_line,last_line:K[K.length-1].last_line,first_column:K[K.length-(ve||1)].first_column,last_column:K[K.length-1].last_column},re&&(ue._$.range=[K[K.length-(ve||1)].range[0],K[K.length-1].range[1]]),be=this.performAction.call(ue,Q,se,ie,this.yy,fe[1],Z,K),typeof be!="undefined")return be;ve&&(J=J.slice(0,-1*ve*2),Z=Z.slice(0,-1*ve),K=K.slice(0,-1*ve)),J.push(this.productions_[fe[1]][0]),Z.push(ue.$),K.push(ue._$),Se=te[J[J.length-2]][J[J.length-1]],J.push(Se);break;case 3:return!0}}return!0}},G=function(){var W={EOF:1,parseError:function(Y,J){if(this.yy.parser)this.yy.parser.parseError(Y,J);else throw new Error(Y)},setInput:function(Y){return this._input=Y,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var Y=this._input[0];this.yytext+=Y,this.yyleng++,this.offset++,this.match+=Y,this.matched+=Y;var J=Y.match(/(?:\r\n?|\n).*/g);return J?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Y},unput:function(Y){var J=Y.length,Z=Y.split(/(?:\r\n?|\n)/g);this._input=Y+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-J-1),this.offset-=J;var K=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),Z.length-1&&(this.yylineno-=Z.length-1);var te=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:Z?(Z.length===K.length?this.yylloc.first_column:0)+K[K.length-Z.length].length-Z[0].length:this.yylloc.first_column-J},this.options.ranges&&(this.yylloc.range=[te[0],te[0]+this.yyleng-J]),this},more:function(){return this._more=!0,this},less:function(Y){this.unput(this.match.slice(Y))},pastInput:function(){var Y=this.matched.substr(0,this.matched.length-this.match.length);return(Y.length>20?"...":"")+Y.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var Y=this.match;return Y.length<20&&(Y+=this._input.substr(0,20-Y.length)),(Y.substr(0,20)+(Y.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var Y=this.pastInput(),J=new Array(Y.length+1).join("-");return Y+this.upcomingInput()+` `+J+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Y,J,Z,K,te;this._more||(this.yytext="",this.match="");for(var Q=this._currentRules(),ie=0;ieJ[0].length)&&(J=Z,K=ie,!this.options.flex)));ie++);return J?(te=J[0].match(/(?:\r\n?|\n).*/g),te&&(this.yylineno+=te.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:te?te[te.length-1].length-te[te.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+J[0].length},this.yytext+=J[0],this.match+=J[0],this.matches=J,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(J[0].length),this.matched+=J[0],Y=this.performAction.call(this,this.yy,this,Q[K],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Y||void 0):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var Y=this.next();return typeof Y!="undefined"?Y:this.lex()},begin:function(Y){this.conditionStack.push(Y)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(Y){this.begin(Y)}};return W.options={},W.performAction=function(Y,J,Z,K){function te(Q,ie){return J.yytext=J.yytext.substring(Q,J.yyleng-ie+Q)}switch(Z){case 0:if(J.yytext.slice(-2)==="\\\\"?(te(0,1),this.begin("mu")):J.yytext.slice(-1)==="\\"?(te(0,1),this.begin("emu")):this.begin("mu"),J.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw"?15:(te(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(J.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return J.yytext=te(1,2).replace(/\\"/g,'"'),80;case 32:return J.yytext=te(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return J.yytext=J.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},W.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],W.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},W}();D.lexer=G;function U(){this.yy={}}return U.prototype=D,D.Parser=U,new U}();R.default=F,B.exports=R.default})(parser$2,parser$2.exports);var whitespaceControl={exports:{}},visitor={exports:{}};(function(B,R){R.__esModule=!0;function F(J){return J&&J.__esModule?J:{default:J}}var D=exception.exports,G=F(D);function U(){this.parents=[]}U.prototype={constructor:U,mutating:!1,acceptKey:function(Z,K){var te=this.accept(Z[K]);if(this.mutating){if(te&&!U.prototype[te.type])throw new G.default('Unexpected node type "'+te.type+'" found when accepting '+K+" on "+Z.type);Z[K]=te}},acceptRequired:function(Z,K){if(this.acceptKey(Z,K),!Z[K])throw new G.default(Z.type+" requires "+K)},acceptArray:function(Z){for(var K=0,te=Z.length;K0)throw new _exception2$1.default("Invalid path: "+D,{loc:F});Y===".."&&U++}else G.push(Y)}return{type:"PathExpression",data:B,depth:U,parts:G,original:D,loc:F}}function prepareMustache(B,R,F,D,G,U){var W=D.charAt(3)||D.charAt(2),q=W!=="{"&&W!=="&",Y=/\*/.test(D);return{type:Y?"Decorator":"MustacheStatement",path:B,params:R,hash:F,escaped:q,strip:G,loc:this.locInfo(U)}}function prepareRawBlock(B,R,F,D){validateClose(B,F),D=this.locInfo(D);var G={type:"Program",body:R,strip:{},loc:D};return{type:"BlockStatement",path:B.path,params:B.params,hash:B.hash,program:G,openStrip:{},inverseStrip:{},closeStrip:{},loc:D}}function prepareBlock(B,R,F,D,G,U){D&&D.path&&validateClose(B,D);var W=/\*/.test(B.open);R.blockParams=B.blockParams;var q=void 0,Y=void 0;if(F){if(W)throw new _exception2$1.default("Unexpected inverse block on decorator",F);F.chain&&(F.program.body[0].closeStrip=D.strip),Y=F.strip,q=F.program}return G&&(G=q,q=R,R=G),{type:W?"DecoratorBlock":"BlockStatement",path:B.path,params:B.params,hash:B.hash,program:R,inverse:q,openStrip:B.strip,inverseStrip:Y,closeStrip:D&&D.strip,loc:this.locInfo(U)}}function prepareProgram(B,R){if(!R&&B.length){var F=B[0].loc,D=B[B.length-1].loc;F&&D&&(R={source:F.source,start:{line:F.start.line,column:F.start.column},end:{line:D.end.line,column:D.end.column}})}return{type:"Program",body:B,strip:{},loc:R}}function preparePartialBlock(B,R,F,D){return validateClose(B,F),{type:"PartialBlockStatement",name:B.path,params:B.params,hash:B.hash,program:R,openStrip:B.strip,closeStrip:F&&F.strip,loc:this.locInfo(D)}}base.__esModule=!0;base.parseWithoutProcessing=parseWithoutProcessing;base.parse=parse$2;function _interopRequireWildcard(B){if(B&&B.__esModule)return B;var R={};if(B!=null)for(var F in B)Object.prototype.hasOwnProperty.call(B,F)&&(R[F]=B[F]);return R.default=B,R}function _interopRequireDefault$1(B){return B&&B.__esModule?B:{default:B}}var _parser=parser$2.exports,_parser2=_interopRequireDefault$1(_parser),_whitespaceControl=whitespaceControl.exports,_whitespaceControl2=_interopRequireDefault$1(_whitespaceControl),_helpers=helpers,Helpers=_interopRequireWildcard(_helpers),_utils$1=utils;base.parser=_parser2.default;var yy={};_utils$1.extend(yy,Helpers);function parseWithoutProcessing(B,R){if(B.type==="Program")return B;_parser2.default.yy=yy,yy.locInfo=function(D){return new yy.SourceLocation(R&&R.srcName,D)};var F=_parser2.default.parse(B);return F}function parse$2(B,R){var F=parseWithoutProcessing(B,R),D=new _whitespaceControl2.default(R);return D.accept(F)}var compiler={};compiler.__esModule=!0;compiler.Compiler=Compiler;compiler.precompile=precompile;compiler.compile=compile;function _interopRequireDefault(B){return B&&B.__esModule?B:{default:B}}var _exception=exception.exports,_exception2=_interopRequireDefault(_exception),_utils=utils,_ast=ast.exports,_ast2=_interopRequireDefault(_ast),slice=[].slice;function Compiler(){}Compiler.prototype={compiler:Compiler,equals:function B(R){var F=this.opcodes.length;if(R.opcodes.length!==F)return!1;for(var D=0;D1)throw new _exception2.default("Unsupported number of partial arguments: "+D.length,R);D.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):D.push({type:"PathExpression",parts:[],depth:0}));var G=R.name.original,U=R.name.type==="SubExpression";U&&this.accept(R.name),this.setupFullMustacheParams(R,F,void 0,!0);var W=R.indent||"";this.options.preventIndent&&W&&(this.opcode("appendContent",W),W=""),this.opcode("invokePartial",U,G,W),this.opcode("append")},PartialBlockStatement:function B(R){this.PartialStatement(R)},MustacheStatement:function B(R){this.SubExpression(R),R.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function B(R){this.DecoratorBlock(R)},ContentStatement:function B(R){R.value&&this.opcode("appendContent",R.value)},CommentStatement:function B(){},SubExpression:function B(R){transformLiteralToPath(R);var F=this.classifySexpr(R);F==="simple"?this.simpleSexpr(R):F==="helper"?this.helperSexpr(R):this.ambiguousSexpr(R)},ambiguousSexpr:function B(R,F,D){var G=R.path,U=G.parts[0],W=F!=null||D!=null;this.opcode("getContext",G.depth),this.opcode("pushProgram",F),this.opcode("pushProgram",D),G.strict=!0,this.accept(G),this.opcode("invokeAmbiguous",U,W)},simpleSexpr:function B(R){var F=R.path;F.strict=!0,this.accept(F),this.opcode("resolvePossibleLambda")},helperSexpr:function B(R,F,D){var G=this.setupFullMustacheParams(R,F,D),U=R.path,W=U.parts[0];if(this.options.knownHelpers[W])this.opcode("invokeKnownHelper",G.length,W);else{if(this.options.knownHelpersOnly)throw new _exception2.default("You specified knownHelpersOnly, but used the unknown helper "+W,R);U.strict=!0,U.falsy=!0,this.accept(U),this.opcode("invokeHelper",G.length,U.original,_ast2.default.helpers.simpleId(U))}},PathExpression:function B(R){this.addDepth(R.depth),this.opcode("getContext",R.depth);var F=R.parts[0],D=_ast2.default.helpers.scopedId(R),G=!R.depth&&!D&&this.blockParamIndex(F);G?this.opcode("lookupBlockParam",G,R.parts):F?R.data?(this.options.data=!0,this.opcode("lookupData",R.depth,R.parts,R.strict)):this.opcode("lookupOnContext",R.parts,R.falsy,R.strict,D):this.opcode("pushContext")},StringLiteral:function B(R){this.opcode("pushString",R.value)},NumberLiteral:function B(R){this.opcode("pushLiteral",R.value)},BooleanLiteral:function B(R){this.opcode("pushLiteral",R.value)},UndefinedLiteral:function B(){this.opcode("pushLiteral","undefined")},NullLiteral:function B(){this.opcode("pushLiteral","null")},Hash:function B(R){var F=R.pairs,D=0,G=F.length;for(this.opcode("pushHash");D=0)return[F,U]}}};function precompile(B,R,F){if(B==null||typeof B!="string"&&B.type!=="Program")throw new _exception2.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+B);R=R||{},"data"in R||(R.data=!0),R.compat&&(R.useDepths=!0);var D=F.parse(B,R),G=new F.Compiler().compile(D,R);return new F.JavaScriptCompiler().compile(G,R)}function compile(B,R,F){if(R===void 0&&(R={}),B==null||typeof B!="string"&&B.type!=="Program")throw new _exception2.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+B);R=_utils.extend({},R),"data"in R||(R.data=!0),R.compat&&(R.useDepths=!0);var D=void 0;function G(){var W=F.parse(B,R),q=new F.Compiler().compile(W,R),Y=new F.JavaScriptCompiler().compile(q,R,void 0,!0);return F.template(Y)}function U(W,q){return D||(D=G()),D.call(this,W,q)}return U._setup=function(W){return D||(D=G()),D._setup(W)},U._child=function(W,q,Y,J){return D||(D=G()),D._child(W,q,Y,J)},U}function argEquals(B,R){if(B===R)return!0;if(_utils.isArray(B)&&_utils.isArray(R)&&B.length===R.length){for(var F=0;F0&&(se+=", "+ne.join(", "));var re=0;Object.keys(this.aliases).forEach(function(he){var fe=ie.aliases[he];fe.children&&fe.referenceCount>1&&(se+=", alias"+ ++re+"="+he,fe.children[0]="alias"+re)}),this.lookupPropertyFunctionIsUsed&&(se+=", "+this.lookupPropertyFunctionVarDeclaration());var ae=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&ae.push("blockParams"),this.useDepths&&ae.push("depths");var ce=this.mergeSource(se);return Q?(ae.push(ce),Function.apply(this,ae)):this.source.wrap(["function(",ae.join(","),`) { `,ce,"}"])},mergeSource:function(Q){var ie=this.environment.isSimple,se=!this.forceBuffer,ne=void 0,re=void 0,ae=void 0,ce=void 0;return this.source.each(function(he){he.appendToBuffer?(ae?he.prepend(" + "):ae=he,ce=he):(ae&&(re?ae.prepend("buffer += "):ne=!0,ce.add(";"),ae=ce=void 0),re=!0,ie||(se=!1))}),se?ae?(ae.prepend("return "),ce.add(";")):re||this.source.push('return "";'):(Q+=", buffer = "+(ne?"":this.initializeBuffer()),ae?(ae.prepend("return buffer + "),ce.add(";")):this.source.push("return buffer;")),Q&&this.source.prepend("var "+Q.substring(2)+(ne?"":`; `)),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return` lookupProperty = container.lookupProperty || function(parent, propertyName) { if (Object.prototype.hasOwnProperty.call(parent, propertyName)) { return parent[propertyName]; } return undefined } `.trim()},blockValue:function(Q){var ie=this.aliasable("container.hooks.blockHelperMissing"),se=[this.contextName(0)];this.setupHelperArgs(Q,0,se);var ne=this.popStack();se.splice(1,0,ne),this.push(this.source.functionCall(ie,"call",se))},ambiguousBlockValue:function(){var Q=this.aliasable("container.hooks.blockHelperMissing"),ie=[this.contextName(0)];this.setupHelperArgs("",0,ie,!0),this.flushInline();var se=this.topStack();ie.splice(1,0,se),this.pushSource(["if (!",this.lastHelper,") { ",se," = ",this.source.functionCall(Q,"call",ie),"}"])},appendContent:function(Q){this.pendingContent?Q=this.pendingContent+Q:this.pendingLocation=this.source.currentLocation,this.pendingContent=Q},append:function(){if(this.isInline())this.replaceStack(function(ie){return[" != null ? ",ie,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var Q=this.popStack();this.pushSource(["if (",Q," != null) { ",this.appendToBuffer(Q,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(Q){this.lastContext=Q},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(Q,ie,se,ne){var re=0;!ne&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(Q[re++])):this.pushContext(),this.resolvePath("context",Q,re,ie,se)},lookupBlockParam:function(Q,ie){this.useBlockParams=!0,this.push(["blockParams[",Q[0],"][",Q[1],"]"]),this.resolvePath("context",ie,1)},lookupData:function(Q,ie,se){Q?this.pushStackLiteral("container.data(data, "+Q+")"):this.pushStackLiteral("data"),this.resolvePath("data",ie,0,!0,se)},resolvePath:function(Q,ie,se,ne,re){var ae=this;if(this.options.strict||this.options.assumeObjects){this.push(K(this.options.strict&&re,this,ie,Q));return}for(var ce=ie.length;sethis.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var Q=this.inlineStack;this.inlineStack=[];for(var ie=0,se=Q.length;ieB!==null&&B.isSecureContext,createNativeAudioBufferConstructor=B=>B===null?null:B.hasOwnProperty("AudioBuffer")?B.AudioBuffer:null,createNativeAudioContextConstructor=B=>B===null?null:B.hasOwnProperty("AudioContext")?B.AudioContext:B.hasOwnProperty("webkitAudioContext")?B.webkitAudioContext:null,createNativeAudioWorkletNodeConstructor=B=>B===null?null:B.hasOwnProperty("AudioWorkletNode")?B.AudioWorkletNode:null,createNativeOfflineAudioContextConstructor=B=>B===null?null:B.hasOwnProperty("OfflineAudioContext")?B.OfflineAudioContext:B.hasOwnProperty("webkitOfflineAudioContext")?B.webkitOfflineAudioContext:null,createWindow=()=>typeof window=="undefined"?null:window,window$1=createWindow();createNativeOfflineAudioContextConstructor(window$1);createNativeAudioContextConstructor(window$1);createNativeAudioWorkletNodeConstructor(window$1);createNativeAudioBufferConstructor(window$1);createIsSecureContext(window$1);var lib$2={exports:{}},lib$1={exports:{}};function b64ToUint6(B){return B>64&&B<91?B-65:B>96&&B<123?B-71:B>47&&B<58?B+4:B===43?62:B===47?63:0}function decode(B,R){for(var F=B.replace(/[^A-Za-z0-9\+\/]/g,""),D=F.length,G=R?Math.ceil((D*3+1>>2)/R)*R:D*3+1>>2,U=new Uint8Array(G),W,q,Y=0,J=0,Z=0;Z>>(16>>>W&24)&255;Y=0}return U}var base64={decode},fetch$1=function(B,R){return new Promise(function(F,D){var G=new XMLHttpRequest;R&&(G.responseType=R),G.open("GET",B),G.onload=function(){G.status===200?F(G.response):D(Error(G.statusText))},G.onerror=function(){D(Error("Network Error"))},G.send()})};(function(B){var R=base64,F=fetch$1;function D(ue){return function(ge){return typeof ge=="string"&&ue.test(ge)}}function G(ue,ge){return typeof ue=="string"?ue+ge:typeof ue=="function"?ue(ge):ge}function U(ue,ge,ve,Se){var pe=W(ge)?q:Y(ge)?J:Z(ge)?K:te(ge)?Q:ie(ge)?se:ne(ge)?re:ae(ge)?ce:he(ge)?fe:null,ye=ve||{};return pe?pe(ue,ge,ye):Se?Promise.resolve(Se):Promise.reject("Source not valid ("+ge+")")}U.fetch=F;function W(ue){return ue instanceof ArrayBuffer}function q(ue,ge,ve){return new Promise(function(Se,pe){ue.decodeAudioData(ge,function(ye){Se(ye)},function(){pe("Can't decode audio data ("+ge.slice(0,30)+"...)")})})}var Y=D(/\.(mp3|wav|ogg)(\?.*)?$/i);function J(ue,ge,ve){var Se=G(ve.from,ge);return U(ue,U.fetch(Se,"arraybuffer"),ve)}function Z(ue){return ue&&typeof ue.then=="function"}function K(ue,ge,ve){return ge.then(function(Se){return U(ue,Se,ve)})}var te=Array.isArray;function Q(ue,ge,ve){return Promise.all(ge.map(function(Se){return U(ue,Se,ve,Se)}))}function ie(ue){return ue&&typeof ue=="object"}function se(ue,ge,ve){var Se={},pe=Object.keys(ge).map(function(ye){if(ve.only&&ve.only.indexOf(ye)===-1)return null;var Ee=ge[ye];return U(ue,Ee,ve,Ee).then(function(de){Se[ye]=de})});return Promise.all(pe).then(function(){return Se})}var ne=D(/\.json(\?.*)?$/i);function re(ue,ge,ve){var Se=G(ve.from,ge);return U(ue,U.fetch(Se,"text").then(JSON.parse),ve)}var ae=D(/^data:audio/);function ce(ue,ge,ve){var Se=ge.indexOf(",");return U(ue,R.decode(ge.slice(Se+1)).buffer,ve)}var he=D(/\.js(\?.*)?$/i);function fe(ue,ge,ve){var Se=G(ve.from,ge);return U(ue,U.fetch(Se,"text").then(be),ve)}function be(ue){var ge=ue.indexOf("MIDI.Soundfont.");if(ge<0)throw Error("Invalid MIDI.js Soundfont format");ge=ue.indexOf("=",ge)+2;var ve=ue.lastIndexOf(",");return JSON.parse(ue.slice(ge,ve)+"}")}B.exports&&(B.exports=U),typeof window!="undefined"&&(window.loadAudio=U)})(lib$1);var lib={exports:{}},adsr=ADSR$1;function ADSR$1(B){var R=B.createGain(),F=R._voltage=getVoltage(B),D=scale(F),G=scale(F),U=scale(F);return R._startAmount=scale(G),R._endAmount=scale(U),R._multiplier=scale(D),R._multiplier.connect(R),R._startAmount.connect(R),R._endAmount.connect(R),R.value=D.gain,R.startValue=G.gain,R.endValue=U.gain,R.startValue.value=0,R.endValue.value=0,Object.defineProperties(R,props),R}var props={attack:{value:0,writable:!0},decay:{value:0,writable:!0},sustain:{value:1,writable:!0},release:{value:0,writable:!0},getReleaseDuration:{value:function(){return this.release}},start:{value:function(B){var R=this._multiplier.gain,F=this._startAmount.gain,D=this._endAmount.gain;this._voltage.start(B),this._decayFrom=this._decayFrom=B+this.attack,this._startedAt=B;var G=this.sustain;R.cancelScheduledValues(B),F.cancelScheduledValues(B),D.cancelScheduledValues(B),D.setValueAtTime(0,B),this.attack?(R.setValueAtTime(0,B),R.linearRampToValueAtTime(1,B+this.attack),F.setValueAtTime(1,B),F.linearRampToValueAtTime(0,B+this.attack)):(R.setValueAtTime(1,B),F.setValueAtTime(0,B)),this.decay&&R.setTargetAtTime(G,this._decayFrom,getTimeConstant(this.decay))}},stop:{value:function(B,R){R&&(B=B-this.release);var F=B+this.release;if(this.release){var D=this._multiplier.gain,G=this._startAmount.gain,U=this._endAmount.gain;D.cancelScheduledValues(B),G.cancelScheduledValues(B),U.cancelScheduledValues(B);var W=getTimeConstant(this.release);if(this.attack&&B=R&&(J=R),J}var ADSR=adsr,EMPTY={},DEFAULTS={gain:1,attack:.01,decay:.1,sustain:.9,release:.3,loop:!1,cents:0,loopStart:0,loopEnd:0};function SamplePlayer(B,R,F){var D=!1,G=0,U={},W=B.createGain();W.gain.value=1;var q=Object.assign({},DEFAULTS,F),Y={context:B,out:W,opts:q};return R instanceof AudioBuffer?Y.buffer=R:Y.buffers=R,Y.start=function(K,te,Q){if(Y.buffer&&K!==null)return Y.start(null,K,te);var ie=K?Y.buffers[K]:Y.buffer;if(ie){if(!D){console.warn("SamplePlayer not connected to any node.");return}}else{console.warn("Buffer "+K+" not found.");return}var se=Q||EMPTY;te=Math.max(B.currentTime,te||0),Y.emit("start",te,K,se);var ne=Z(K,ie,se);return ne.id=J(K,ne),ne.env.start(te),ne.source.start(te),Y.emit("started",te,ne.id,ne),se.duration&&ne.stop(te+se.duration),ne},Y.play=function(K,te,Q){return Y.start(K,te,Q)},Y.stop=function(K,te){var Q;return te=te||Object.keys(U),te.map(function(ie){return Q=U[ie],Q?(Q.stop(K),Q.id):null})},Y.connect=function(K){return D=!0,W.connect(K),Y},Y.emit=function(K,te,Q,ie){Y.onevent&&Y.onevent(K,te,Q,ie);var se=Y["on"+K];se&&se(te,Q,ie)},Y;function J(K,te){return te.id=G++,U[te.id]=te,te.source.onended=function(){var Q=B.currentTime;te.source.disconnect(),te.env.disconnect(),te.disconnect(),Y.emit("ended",Q,te.id,te)},te.id}function Z(K,te,Q){var ie=B.createGain();return ie.gain.value=0,ie.connect(W),ie.env=envelope(B,Q,q),ie.env.connect(ie.gain),ie.source=B.createBufferSource(),ie.source.buffer=te,ie.source.connect(ie),ie.source.loop=Q.loop||q.loop,ie.source.playbackRate.value=centsToRate(Q.cents||q.cents),ie.source.loopStart=Q.loopStart||q.loopStart,ie.source.loopEnd=Q.loopEnd||q.loopEnd,ie.stop=function(se){var ne=se||B.currentTime;Y.emit("stop",ne,K);var re=ie.env.stop(ne);ie.source.stop(re)},ie}}function isNum$1(B){return typeof B=="number"}var PARAMS=["attack","decay","sustain","release"];function envelope(B,R,F){var D=ADSR(B),G=R.adsr||F.adsr;return PARAMS.forEach(function(U,W){G?D[U]=G[W]:D[U]=R[U]||F[U]}),D.value.value=isNum$1(R.gain)?R.gain:isNum$1(F.gain)?F.gain:1,D}function centsToRate(B){return B?Math.pow(2,B/1200):1}var player=SamplePlayer,events=function(B){return B.on=function(R,F){if(arguments.length===1&&typeof R=="function")return B.on("event",R);var D="on"+R,G=B[D];return B[D]=G?chain(G,F):F,B},B};function chain(B,R){return function(F,D,G,U){B(F,D,G,U),R(F,D,G,U)}}var REGEX$1=/^([a-gA-G])(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)\s*$/;function regex$1(){return REGEX$1}var SEMITONES$1=[0,2,4,5,7,9,11];function parse$1(B,R,F){if(typeof B!="string")return null;var D=REGEX$1.exec(B);if(!D||!R&&D[4])return null;var G={letter:D[1].toUpperCase(),acc:D[2].replace(/x/g,"##")};return G.pc=G.letter+G.acc,G.step=(G.letter.charCodeAt(0)+3)%7,G.alt=G.acc[0]==="b"?-G.acc.length:G.acc.length,G.chroma=SEMITONES$1[G.step]+G.alt,D[3]&&(G.oct=+D[3],G.midi=G.chroma+12*(G.oct+1),G.freq=midiToFreq$1(G.midi,F)),R&&(G.tonicOf=D[4]),G}function midiToFreq$1(B,R){return Math.pow(2,(B-69)/12)*(R||440)}var parser$1={parse:parse$1,regex:regex$1,midiToFreq:midiToFreq$1},FNS=["letter","acc","pc","step","alt","chroma","oct","midi","freq"];FNS.forEach(function(B){parser$1[B]=function(R){var F=parse$1(R);return F&&typeof F[B]!="undefined"?F[B]:null}});var noteParser$1=parser$1,note=noteParser$1,isMidi=function(B){return B!==null&&B!==[]&&B>=0&&B<129},toMidi=function(B){return isMidi(B)?+B:note.midi(B)},notes=function(B){if(B.buffers){var R=B.opts.map,F=typeof R=="function"?R:toMidi,D=function(U){return U?F(U)||U:null};B.buffers=mapBuffers(B.buffers,D);var G=B.start;B.start=function(U,W,q){var Y=D(U),J=Y%1;return J&&(Y=Math.floor(Y),q=Object.assign(q||{},{cents:Math.floor(J*100)})),G(Y,W,q)}}return B};function mapBuffers(B,R){return Object.keys(B).reduce(function(F,D){return F[R(D)]=B[D],F},{})}var isArr=Array.isArray,isObj=function(B){return B&&typeof B=="object"},OPTS={},scheduler=function(B){return B.schedule=function(R,F){var D=B.context.currentTime,G=R6?null:LETTERS.charAt(B)+accStr(R)+octStr(F)}function midi(B){if((isNum(B)||isStr(B))&&B>=0&&B<128)return+B;var R=parse(B);return R&&isDef(R.midi)?R.midi:null}function freq(B,R){var F=midi(B);return F===null?null:midiToFreq(F,R)}function letter(B){return(parse(B)||{}).letter}function acc(B){return(parse(B)||{}).acc}function pc(B){return(parse(B)||{}).pc}function step(B){return(parse(B)||{}).step}function alt(B){return(parse(B)||{}).alt}function chroma(B){return(parse(B)||{}).chroma}function oct(B){return(parse(B)||{}).oct}var noteParser=Object.freeze(Object.defineProperty({__proto__:null,regex,parse,build,midi,freq,letter,acc,pc,step,alt,chroma,oct},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(noteParser),parser=require$$0;function Soundfont(B,R){if(console.warn("new Soundfont() is deprected"),console.log("Please use Soundfont.instrument() instead of new Soundfont().instrument()"),!(this instanceof Soundfont))return new Soundfont(B);this.nameToUrl=R||Soundfont.nameToUrl,this.ctx=B,this.instruments={},this.promises=[]}Soundfont.prototype.onready=function(B){console.warn("deprecated API"),console.log("Please use Promise.all(Soundfont.instrument(), Soundfont.instrument()).then() instead of new Soundfont().onready()"),Promise.all(this.promises).then(B)};Soundfont.prototype.instrument=function(B,R){console.warn("new Soundfont().instrument() is deprecated."),console.log("Please use Soundfont.instrument() instead.");var F=this.ctx;if(B=B||"default",B in this.instruments)return this.instruments[B];var D={name:B,play:oscillatorPlayer(F,R)};if(this.instruments[B]=D,B!=="default"){var G=Soundfont.instrument(F,B,R).then(function(U){return D.play=U.play,D});this.promises.push(G),D.onready=function(U){console.warn("onready is deprecated. Use Soundfont.instrument().then()"),G.then(U)}}else D.onready=function(U){console.warn("onready is deprecated. Use Soundfont.instrument().then()"),U()};return D};function loadBuffers(B,R,F){return console.warn("Soundfont.loadBuffers is deprecate."),console.log("Use Soundfont.instrument(..) and get buffers properties from the result."),Soundfont.instrument(B,R,F).then(function(D){return D.buffers})}Soundfont.loadBuffers=loadBuffers;function oscillatorPlayer(B,R){return R=R||{},function(F,D,G,U){console.warn("The oscillator player is deprecated."),console.log("Starting with version 0.9.0 you will have to wait until the soundfont is loaded to play sounds.");var W=F>0&&F<129?+F:parser.midi(F),q=W?parser.midiToFreq(W,440):null;if(!!q){G=G||.2,U=U||{};var Y=U.destination||R.destination||B.destination,J=U.vcoType||R.vcoType||"sine",Z=U.gain||R.gain||.4,K=B.createOscillator();K.type=J,K.frequency.value=q;var te=B.createGain();return te.gain.value=Z,K.connect(te),te.connect(Y),K.start(D),G>0&&K.stop(D+G),K}}}Soundfont.noteToMidi=parser.midi;var legacy=Soundfont;(function(B){var R=lib$1.exports,F=lib.exports;function D(q,Y,J){if(arguments.length===1)return function(ie,se){return D(q,ie,se)};var Z=J||{},K=Z.isSoundfontURL||G,te=Z.nameToUrl||U,Q=K(Y)?Y:te(Y,Z.soundfont,Z.format);return R(q,Q,{only:Z.only||Z.notes}).then(function(ie){var se=F(q,ie,Z).connect(Z.destination?Z.destination:q.destination);return se.url=Q,se.name=Y,se})}function G(q){return/\.js(\?.*)?$/i.test(q)}function U(q,Y,J){return J=J==="ogg"?J:"mp3",Y=Y==="FluidR3_GM"?Y:"MusyngKite","https://gleitz.github.io/midi-js-soundfonts/"+Y+"/"+q+"-"+J+".js"}var W=legacy;W.instrument=D,W.nameToUrl=U,B.exports&&(B.exports=W),typeof window!="undefined"&&(window.Soundfont=W)})(lib$2);NoteEnum.C,NoteEnum.D,NoteEnum.E,NoteEnum.F,NoteEnum.G,NoteEnum.A,NoteEnum.B;const browserInfo$2=browser(),getLinkId=()=>location.hash.split("?")[0].split("/").pop()||"",retain=B=>Math.ceil(B*1e6)/1e6,formatLyricsEntries=B=>{var D,G;const R=((D=B.parentStaffEntry)==null?void 0:D.voiceEntries)||[],F=[];for(const U of R)if((G=U.lyricsEntries)!=null&&G.table){const W=Object.values(U.lyricsEntries.table);for(const q of W)F.push(q==null?void 0:q.value.text)}return F},getMeasureDurationDiff=B=>{const{realValue:R}=B.activeTimeSignature,{realValue:F}=B.duration;return R-F},getAllNodes=B=>{var J,Z,K,te,Q,ie,se,ne,re,ae,ce,he,fe,be,ue,ge,ve,Se,pe,ye,Ee,de,we,Oe,Me,Pe,Ne,ke,Ae,_e,Fe,Ye,Ce,Ge,We,Ve,Ze,nt,at,ct,De;const R=getLinkId();let F=browserInfo$2.huawei?.08:0;const D=[],G=[],U=[],{baseSpeed:W=100}=state$2,q=(xe,ze)=>{var je,Xe,Qe,He,tt,ot;return["906"].includes(R)?((je=ze.measures[0])==null?void 0:je.realKey)||xe:["782","784"].includes(R)&&[14,16,30,32].includes((Xe=ze.firstVerticalMeasure)==null?void 0:Xe.measureNumber)?((Qe=D[D.length-1])==null?void 0:Qe.realKey)||xe:["900","901","640","641","739","740","800","801","773","774","869","872","714","715"].includes(R)&&(((He=ze.firstVerticalMeasure)==null?void 0:He.measureNumber)===3||((tt=ze.firstVerticalMeasure)==null?void 0:tt.measureNumber)===9)&&((ot=ze.measures[0])==null?void 0:ot.realKey)||xe};if(B!=null&&B.cursor){try{B.cursor.reset()}catch{}const xe=B.cursor.iterator;let ze=0,qe=0,Re=[],Le=[],je=0,Xe=0,Qe=0,He="quarter",tt=1,ot=0,rt=0,ft=0,St=0,lt=!1,vt=0;for(;!xe.endReached;){const Et=B.cursor.cursorElement,Lt={move:!1};Et&&(Lt.move=!0,Lt.x=Et.offsetLeft,Lt.y=Et.offsetTop,Lt.w=Et.offsetWidth,Lt.h=Et.offsetHeight);const Qt=(J=xe.currentVoiceEntries)!=null&&J[0]?[(Z=xe.currentVoiceEntries)==null?void 0:Z[0]]:[],Dt=(K=xe.currentVoiceEntries)==null?void 0:K[1];let qt=!1;for(const ei of Qt){let gt=ei.notes[0];if(["Piano"].includes((te=state$2.activeDetail)==null?void 0:te.code)){let Wt=[];try{Wt=(Q=xe.currentVoiceEntries)==null?void 0:Q.map(ri=>ri.notes).flat().sort((ri,ti)=>ri.Length.realValue-ti.Length.realValue),gt=Wt[0]}catch{}}if(gt){if(qe===0&&U.push(gt.sourceMeasure),qe===0&&state$2.isSpecialBookCategory)for(const Gt of(ie=gt.sourceMeasure)==null?void 0:ie.TempoExpressions)(se=Gt==null?void 0:Gt.InstantaneousTempo)!=null&&se.beatUnit&&(He=Gt.InstantaneousTempo.beatUnit);tt=(ne=gt.sourceMeasure)==null?void 0:ne.MeasureNumberXML,rt==((re=gt.sourceMeasure)==null?void 0:re.MeasureNumberXML)?ft++:(rt=(ae=gt.sourceMeasure)==null?void 0:ae.MeasureNumberXML,ft=0);let Wt=gt.sourceMeasure.tempoInBPM;const{metronomeNoteIndex:ri}=xe.currentMeasure;ri!==0&&ri>qe&&(Wt=((ce=D[D.length-1])==null?void 0:ce.speed)||100);const ti=[(he=gt.sourceMeasure.verticalMeasureList)==null?void 0:he[0]],{realValue:zi}=xe.currentTimeStamp,{RealValue:vi,Denominator:jt}=formatDuration(xe.currentMeasure.activeTimeSignature,xe.currentMeasure.duration);let{wholeValue:Ji,numerator:ln,denominator:cn,realValue:es}=gt.length,Zi=je,Ui=(state$2.isSpecialBookCategory?getTimeByBeatUnit(He,Wt,xe.currentMeasure.activeTimeSignature.Denominator):W)||1,mn=(state$2.isSpecialBookCategory?Wt:W)||1;ze===0&&(F+=getFixTime(Ui));let Pi=(ln===0&>.isRestFlag?vi:(Ji+ln)/cn)*jt*(60/Ui);const un=vi*jt*(60/Ui);["Piano"].includes((fe=state$2.activeDetail)==null?void 0:fe.code)&&(Pi=(xe.currentTimeStamp.realValue-St||(ln===0?vi:(Ji+ln)/cn))*jt*(60/Ui)),gt.isRestFlag&&((be=gt==null?void 0:gt.sourceMeasure)==null?void 0:be.allRests)&&(vt=(ue=gt==null?void 0:gt.sourceMeasure)==null?void 0:ue.multipleRestMeasures),vt>0&&(vt-=1,Pi=un),gt.isRestFlag&&Pi>un&&(Pi=un),gt.DotsXml&>.tuplet&&(Pi=Pi*1.5),lt&&(Pi=1e-7,lt=!1,qt=!0);const ws=(ge=gt.sourceMeasure.staffLinkedExpressions)==null?void 0:ge[0];for(const Gt of ws||[])if(Gt&&((ve=Gt.expressions)==null?void 0:ve.find(Bn=>Bn.label==="\u8DF3\u8FC7\u4E0B\u4E00\u4E2A"))&&Fraction$1.Equal((Se=gt.voiceEntry)==null?void 0:Se.Timestamp,Gt.Timestamp)){lt=!0;break}St=xe.currentTimeStamp.realValue,je+=Pi,Xe+=Pi;let Pn=Pi+Zi;const ts=gt.ParentVoiceEntry.ParentVoice.Parent.SubInstruments[0].fixedKey||0,gi=(ye=(pe=ti[0])==null?void 0:pe.vfVoices["1"])==null?void 0:ye.tickables[ft];if(D.length&&D[D.length-1].relativeTime===Zi)continue;if(ze===0){const Gt=getMeasureDurationDiff(xe.currentMeasure);console.log("diff",Gt),Gt>0&&(Qe=Gt*jt*(60/Ui),((Ee=state$2.activeDetail)==null?void 0:Ee.audioType)==="MIDI"&&(Qe=0),F+=Qe)}const Si={skipMode:qt,NoteToGraphicalNoteObjectId:gt.NoteToGraphicalNoteObjectId,cursorBox:Lt,skipNextNote:lt,measureNumberPrinted:tt,difftime:Qe,octaveOffset:(de=ti[0])==null?void 0:de.octaveOffset,frequency:(we=gt.pitch)==null?void 0:we.frequency,speed:mn,beatSpeed:Ui,i:ze,si:qe,stepSpeeds:Le,indexOfMeasures:ot,measureOpenIndex:U.length-1,measures:Re,tempoInBPM:gt.sourceMeasure.tempoInBPM,measureLength:un,relaMeasureLength:Xe,id:gi==null?void 0:gi.attrs.id,note:gt.halfTone+12,relativeTime:retain(Zi),time:retain(Zi+F),endtime:retain(Pn+F),relaEndtime:retain(Pn),realValue:zi,halfTone:gt.halfTone,voiceEntry:{isStaccato:gt.voiceEntry.isStaccato(),Timestamp:{...gt.voiceEntry.Timestamp},ornamentContainer:gt.voiceEntry.ornamentContainer?{...gt.voiceEntry.ornamentContainer}:""},noteElement:{NoteToGraphicalNoteObjectId:gt.NoteToGraphicalNoteObjectId,notehead:gt.notehead?{filled:gt.notehead.filled,shape:gt.notehead.shape,sourceNote:(Oe=gt.notehead.sourceNote)==null?void 0:Oe.NoteToGraphicalNoteObjectId}:"",noteheadColor:gt.noteheadColor,isRestFlag:gt.isRestFlag,sourceMeasure:{measureListIndex:(Me=gt==null?void 0:gt.SourceMeasure)==null?void 0:Me.measureListIndex,MeasureNumberXML:(Pe=gt==null?void 0:gt.SourceMeasure)==null?void 0:Pe.MeasureNumberXML,allRests:(Ne=gt==null?void 0:gt.SourceMeasure)==null?void 0:Ne.allRests,isRestFlag:(ke=gt==null?void 0:gt.SourceMeasure)==null?void 0:ke.isRestFlag,multipleRestMeasures:(Ae=gt==null?void 0:gt.SourceMeasure)==null?void 0:Ae.multipleRestMeasures,verticalMeasureList:Array.isArray((_e=gt==null?void 0:gt.SourceMeasure)==null?void 0:_e.verticalMeasureList)?gt.SourceMeasure.verticalMeasureList.map(Gt=>{const{x:ns,y:Bn,width:ss,height:Ts,start_x:Bi,end_x:Ps}=(Gt==null?void 0:Gt.stave)||{};return Gt?{stave:{x:ns,y:Bn,width:ss,height:Ts,start_x:Bi,end_x:Ps},boundingBox:Gt&&Gt.boundingBox?{absolutePosition:{...Gt.boundingBox.absolutePosition},size:{...Gt.boundingBox.size}}:""}:void 0}):[],activeTimeSignature:{...gt.activeTimeSignature}},tie:gt.tie?{StartNote:{NoteToGraphicalNoteObjectId:gt.tie.StartNote.NoteToGraphicalNoteObjectId},notes:Array.isArray(gt.tie.notes)&&((Fe=gt.tie.notes)==null?void 0:Fe.map(Gt=>({NoteToGraphicalNoteObjectId:Gt.NoteToGraphicalNoteObjectId})))||[]}:"",slurs:Array.isArray(gt.slurs)?gt.slurs.map(Gt=>({startNote:{NoteToGraphicalNoteObjectId:Gt.startNote.NoteToGraphicalNoteObjectId},endNote:{NoteToGraphicalNoteObjectId:Gt.endNote.NoteToGraphicalNoteObjectId}})):[],pitch:{prevFrequency:(Ye=gt.pitch)==null?void 0:Ye.prevFrequency,nextFrequency:(Ce=gt.pitch)==null?void 0:Ce.nextFrequency,frequency:(Ge=gt.pitch)==null?void 0:Ge.frequency},Length:{...gt.Length}},svgElelent:gi?{bbox:((We=gi.getBoundingBox)==null?void 0:We.call(gi))||"",top_y:gi.top_y,note_height:gi.note_height}:"",fixedKey:ts,realKey:0,duration:0,formatLyricsEntries:formatLyricsEntries(gt),stave:ti[0]&&ti[0].stave?{attrs:ti[0].stave?{...ti[0].stave.attrs}:{}}:"",firstVerticalMeasure:{measureNumber:(Ve=ti==null?void 0:ti[0])==null?void 0:Ve.measureNumber},noteLength:1,halfTone1:Array.isArray(ei.notes)?ei.notes.map(Gt=>Gt.halfTone+12).filter(Boolean):[],halfTone2:Dt&&Array.isArray(Dt.notes)?Dt.notes.map(Gt=>Gt.halfTone+12).filter(Boolean):[]};Si.realKey=q(gt.halfTone-ts*12,Si),Si.duration=Si.endtime-Si.time;const is=((nt=(Ze=ti[0])==null?void 0:Ze.vfVoices["1"])==null?void 0:nt.tickables)||[],Wi=((De=(ct=(at=gt.sourceMeasure.verticalMeasureList)==null?void 0:at[0])==null?void 0:ct.staffEntries)==null?void 0:De.length)||is.length;Si.noteLength=Wi||1,D.push(Si),G.push(Si.id),Re.push({realKey:Si.realKey,NoteToGraphicalNoteObjectId:gt.NoteToGraphicalNoteObjectId}),qexe.relativeTime-ze.relativeTime).map((xe,ze)=>({...xe,i:ze}));for(let xe=0;xe{if(B.product){if(R||R===0)if(F&&R-F===1)B.cursor.setPosition({...state$2.times[R].cursorBox});else if(F&&R-F>0)for(;R-F>0;)F++,R-F>0&&B.cursor.setPosition({...state$2.times[F].cursorBox});else B.cursor.setPosition({...state$2.times[R].cursorBox})}else if(R||R===0)if(F&&R-F===1)B.cursor.next();else if(F&&R-F>0)for(;R-F>0;)F++,B.cursor.next();else{let D=0;for(B.cursor.reset();D{if(R>state$2.times[state$2.times.length-1].endtime)return-1;let F=0;const D=B.filter((G,U)=>{const W=B[U-1];return(W==null?void 0:W.skipNextNote)===!1});for(let G=0;G=U.time)(!W||U.time!=W.time)&&(F=U.i);else break}if(state$2.sectionStatus&&state$2.section.length===2){const G=state$2.befireSection||state$2.section[0];F=Math.min(Math.max(F,G.i),state$2.section[1].i),console.log("endIndex",F)}return F},getSlursNote=(B,R)=>{var D,G;let F=R==="end"?(D=B.noteElement.slurs[0])==null?void 0:D.endNote:(G=B.noteElement.slurs[0])==null?void 0:G.startNote;if(!!F)return state$2.times.find(U=>U.NoteToGraphicalNoteObjectId==F.NoteToGraphicalNoteObjectId)},getNoteBySlursStart=(B,R,F)=>{let D=B,G=getSlursNote(D,F);if(!G&&R)for(const U of D.measures){const W=state$2.times.find(q=>q.NoteToGraphicalNoteObjectId==U.NoteToGraphicalNoteObjectId);W.noteElement.slurs.length&&(G=getSlursNote(W,F),D=W)}if(D&&G!==D.noteElement){for(const U of state$2.times)if(G===U.noteElement)return U}return D},getParentNote=B=>{let R;if(B){for(const F of state$2.times)if(B.NoteToGraphicalNoteObjectId===F.noteElement.NoteToGraphicalNoteObjectId)return F}return R},getNoteByMeasuresSlursStart=B=>{let R=B,F;if(B.noteElement.tie&&B.noteElement.tie.StartNote&&(F=B.noteElement.tie.StartNote),R&&F&&F!==R.noteElement){for(const D of state$2.times)if(F.NoteToGraphicalNoteObjectId===D.noteElement.NoteToGraphicalNoteObjectId)return D}return R},getActtiveNoteByTimes=B=>{var G;const R=(G=B.target)==null?void 0:G.dataset,F={};for(const U of state$2.times)U.id&&(F[U.id]=U);return F[R.id||""]},getPrevHasSourceNote=B=>{const R=Math.max(state$2.times.indexOf(B)-1,0);for(let F=R;F>=0;F--){const D=state$2.times[F];if(D!=null&&D.stave)return D}},getBoundingBoxByverticalNote=B=>{var D,G,U,W,q,Y,J,Z,K;let R=(G=(D=B==null?void 0:B.noteElement)==null?void 0:D.sourceMeasure)==null?void 0:G.verticalMeasureList;R=!R||!R[0]?((U=B==null?void 0:B.noteElement)==null?void 0:U.isRestFlag)&&((Y=(q=(W=getPrevHasSourceNote(B))==null?void 0:W.noteElement)==null?void 0:q.sourceMeasure)==null?void 0:Y.verticalMeasureList):R;let F=0;if(R){const te=R[state.partIndex];for(let Q=0;Q0&&(F+=(J=R[Q-1])==null?void 0:J.stave.height),F+=se;const{x:ne,y:re,width:ae,context:ce,start_x:he,end_x:fe}=te==null?void 0:te.stave;return{measureIndex:((Z=B==null?void 0:B.noteElement)==null?void 0:Z.sourceMeasure.measureListIndex)||0,MeasureNumberXML:((K=B==null?void 0:B.noteElement)==null?void 0:K.sourceMeasure.MeasureNumberXML)||1,start_x:he,end_x:fe,height:F,x:ne,y:re,width:ae,context:ce}}}}return{measureIndex:0,height:F,start_x:0,end_x:0,x:0,y:0,width:0,context:{element:null}}},getDuration=B=>{var R;if(B){const F=(R=B==null?void 0:B.graphic)==null?void 0:R.measureList[0][0];if(F){const{duration:D,tempoInBPM:G,activeTimeSignature:U}=F==null?void 0:F.parentSourceMeasure;if(D)return{...formatDuration(U),tempoInBPM:G}}}return{}},formatDuration=(B,R)=>B,getTimeByBeatUnit=(B,R,F)=>{let D=4;switch(B){case"1024th":D=1024;break;case"512th":D=512;break;case"256th":D=256;break;case"128th":D=128;break;case"64th":D=64;break;case"32nd":D=32;break;case"16th":D=16;break;case"eighth":D=8;break;case"quarter":D=4;break;case"half":D=2;break;case"whole":D=1;break;case"breve":D=.5;break;case"long":D=.25;break;case"maxima":D=.125;break}return F/D*R},getEnvHostname=()=>location.origin.indexOf("online")>-1?"https://mstuonline.dayaedu.com":location.origin.indexOf("dev")>-1?"http://mstudev.dayaedu.com":"https://mstutest.dayaedu.com",getTvIconUrl=()=>location.origin.indexOf("online")>-1?"https://mteaonline.dayaedu.com/#/guide":location.origin.indexOf("dev")>-1?"http://mteadev.dayaedu.com/#/guide":"https://mteatest.dayaedu.com/#/guide",setPrefix=B=>B?"?"+B:"",formatXML=(B,R)=>{var Y,J,Z;if(!B)return"";const F=new DOMParser().parseFromString(B,"text/xml"),D=F.getElementsByTagName("measure");let G=-1,U=-1;const W=document.createElement("direction"),q=` quarter 100 1 1`;W.innerHTML=q,F.getElementsByTagName("per-minute").length===0&&((Y=D[0])==null||Y.insertAdjacentElement("afterbegin",W));for(const K of D){G===-1&&K.getElementsByTagName("beats").length&&(G=parseInt(K.getElementsByTagName("beats")[0].textContent||"4")),U===-1&&K.getElementsByTagName("beat-type").length&&(U=parseInt(K.getElementsByTagName("beat-type")[0].textContent||"4"));const te=parseInt(((J=K.getElementsByTagName("divisions")[0])==null?void 0:J.textContent)||"256");if(K.getElementsByTagName("note").length===0){const Q=(Z=K.getElementsByTagName("forward")[0])==null?void 0:Z.getElementsByTagName("duration")[0];Q&&(Q.textContent="0"),K.innerHTML=K.innerHTML+` ${te*G} 1 whole `}}if(R){const K=F.querySelector("work-title");K&&R.title&&(K.textContent=R.title)}return new XMLSerializer().serializeToString(F)},getCustomInfo=B=>{var G,U,W;const R={showSpeed:!0,parsedXML:B,code:""},F=new DOMParser().parseFromString(B,"text/xml"),D=F.getElementsByTagName("words");for(const q of D)q&&((G=q.textContent)==null?void 0:G.trim())==="\u9690\u85CF\u901F\u5EA6"&&(R.showSpeed=!1,q.textContent=""),q&&((U=q.textContent)==null?void 0:U.trim())==="@"&&(q.textContent="segno");return R.parsedXML=new XMLSerializer().serializeToString(F),R.code=((W=F.querySelector("part-name"))==null?void 0:W.innerHTML)||"",R},setElementNoteBefore=(B,R,F)=>{let D=0;if(!!R){for(let G=0;G0){let G=0;for(let U=0;U{if(B){const R=B.toLocaleLowerCase(),F="d\\s?\\.s\\.",D="d\\.\\s?c\\.";return R==="@"||StringUtil.StringContainsSeparatedWord(R,F+" al fine",!0)||StringUtil.StringContainsSeparatedWord(R,F+" al coda",!0)||StringUtil.StringContainsSeparatedWord(R,D+" al fine",!0)||StringUtil.StringContainsSeparatedWord(R,D+" al coda",!0)||StringUtil.StringContainsSeparatedWord(R,D)||StringUtil.StringContainsSeparatedWord(R,"da\\s?capo",!0)||StringUtil.StringContainsSeparatedWord(R,F,!0)||StringUtil.StringContainsSeparatedWord(R,"dal\\s?segno",!0)||StringUtil.StringContainsSeparatedWord(R,"al\\s?coda",!0)||StringUtil.StringContainsSeparatedWord(R,"to\\s?coda",!0)||StringUtil.StringContainsSeparatedWord(R,"a (la )?coda",!0)||StringUtil.StringContainsSeparatedWord(R,"fine",!0)||StringUtil.StringContainsSeparatedWord(R,"coda",!0)||StringUtil.StringContainsSeparatedWord(R,"segno",!0)}return!1},onlyVisible=(B,R)=>{var K,te,Q,ie,se,ne;if(!B)return"";const F=new DOMParser().parseFromString(B,"text/xml"),D=((te=(K=F.getElementsByTagName("part-list"))==null?void 0:K[0])==null?void 0:te.getElementsByTagName("score-part"))||[],G=Array.from(D).map(re=>{var ae;return((ae=re.getElementsByTagName("part-name"))==null?void 0:ae[0].textContent)||""}),U=F.getElementsByTagName("part")||[];if(!U.length)return"";const W=[...(Q=U[0])==null?void 0:Q.getElementsByTagName("measure")],q=[...(ie=U[0])==null?void 0:ie.getElementsByTagName("metronome")],Y=[...(se=U[0])==null?void 0:se.getElementsByTagName("words")],J=[...(ne=U[0])==null?void 0:ne.getElementsByTagName("rehearsal")],Z=D[R];if(state$2.partListNames=G,Z){const re=Z.getAttribute("id");Array.from(U).forEach(he=>{var fe,be,ue,ge,ve;if(he&&he.getAttribute("id")!==re)(fe=he.parentNode)==null||fe.removeChild(he);else if(he&&he.getAttribute("id")!=="P1"){const Se={};for(let pe=0;pe{var Oe;const ye=(Oe=pe.parentElement)==null?void 0:Oe.parentElement,Ee=ye==null?void 0:ye.parentElement,de=[...(Ee==null?void 0:Ee.childNodes)||[]],we=ye?de.indexOf(ye):-1;if(Ee&&we>-1){const Me=W.indexOf(Ee),Pe=he.getElementsByTagName("measure")[Me];setElementNoteBefore(ye,Ee,Pe)}}),Y.forEach(pe=>{var Ee;const ye=pe.textContent||"";if((isSpecialMark(ye)||isSpeedKeyword(ye)||isGradientWords(ye)||isRepeatWord(ye)||GRADIENT_SPEED_RESET_TAG)&&ye){const de=(Ee=pe.parentElement)==null?void 0:Ee.parentElement,we=de==null?void 0:de.parentElement,Oe=[...(we==null?void 0:we.childNodes)||[]],Me=de?Oe.indexOf(de):-1;if(de&&we&&Me>-1){const Pe=W.indexOf(we),Ne=he.getElementsByTagName("measure")[Pe];setElementNoteBefore(de,we,Ne)}}}),J.forEach(pe=>{var de,we;const ye=(de=pe.parentElement)==null?void 0:de.parentElement,Ee=ye==null?void 0:ye.parentElement;if(Ee){const Oe=W.indexOf(Ee);(we=he.getElementsByTagName("measure")[Oe])==null||we.appendChild(ye.cloneNode(!0))}})}if(he&&he.getAttribute("id")===re){const Se=he.getElementsByTagName("barline"),pe=(ge=Se[Se.length-1])==null?void 0:ge.parentElement;if(((ve=pe==null?void 0:pe.lastElementChild)==null?void 0:ve.tagName)!=="barline"){const ye=(pe==null?void 0:pe.children)||[];for(let Ee of ye)if(Ee.tagName==="barline"){pe==null||pe.appendChild(Ee);break}}}}),Array.from(D).forEach(he=>{var fe;he&&he.getAttribute("id")!==re&&((fe=he.parentNode)==null||fe.removeChild(he))});const ae=F.getElementsByTagName("note"),ce=he=>{var ue;let fe=ae[he+1];for(let ge=he;ge{var ue;const be=he.getElementsByTagName("grace");be&&be.length&&he.appendChild((ue=ce(fe))==null?void 0:ue.cloneNode(!0))})}return new XMLSerializer().serializeToString(F)},appoggianceFormate=B=>{var G,U,W,q;if(!B)return B;const R=new DOMParser().parseFromString(B,"text/xml"),F=R.querySelectorAll("grace");if(!F.length)return B;const D=Y=>Y.querySelector("grace")?D(Y==null?void 0:Y.nextElementSibling):Y;for(let Y of F){const J=(G=Y.parentElement)==null?void 0:G.querySelector("notations");if(J&&J.querySelectorAll("slur").length>1){let Z=D((U=Y.parentElement)==null?void 0:U.nextElementSibling);if(Z&&Z.querySelectorAll("slur").length>0){const K=Array.from(((W=Z.querySelector("notations"))==null?void 0:W.children)||[]).map(Q=>Q.getAttribute("number")),te=J.querySelectorAll("slur");for(let Q of te)K.includes(Q.getAttribute("number"))||(q=Z.querySelector("notations"))==null||q.appendChild(Q)}}}return new XMLSerializer().serializeToString(R)},getVoicePartInfo=()=>{const{MusicalInstrumentClassification:B,chinesePartName:R}=state$4;let F=-1;const{partListNames:D,partIndex:G}=state$2;if(D.filter(W=>(W||"").trim()!=="").length)for(const W of Object.entries(B)){const[q,Y]=W,J=D[G],Z=Y.filter(K=>K&&J.indexOf(K||"")>-1);if(J&&(Z.length||Y.includes(J)))return isNaN(+q)||(F=+q),{realPartListNames:D,subjectId:F,partListNames:Y,partName:J,chinesePartName:R[J]||J}}return{subjectId:F,partListNames:[]}},classids=[1,30],idIsInClassIds=(B,R,F=!1)=>{if(!B)return!1;let D=!1;for(const G of B){if(G.id===R&&(F||classids.includes(G.id))){D=!0;break}if(G.sysMusicScoreCategoriesList&&(D=idIsInClassIds(G.sysMusicScoreCategoriesList,R,F||classids.includes(G.id)),D))break}return D},getFeature=B=>B.feature?B.feature:B.lessonTrainingId?"LESSON_TRAINING":"PRACTICE",useOriginSearch=()=>{const B=location.search||location.hash.replaceAll("#/",""),R=queryString.parse(B);if(R.Authorization&&sessionStorage.setItem("Authorization",R.Authorization||""),R.setting)try{R.setting=JSON.parse(decodeURIComponent(R.setting))}catch{}return R.feature=getFeature(R),R},useReload=()=>{const B=useOriginSearch(),R=queryString.stringify({...B,_t:Date.now()},{});location.search="?"+R},useMenu=()=>{const B=ref(!0);return useEventListener("click",R=>{const F=R.path||R.composedPath(),D=F[0];if(D){const G=D.dataset.id&&D.dataset.id.indexOf("auto")>-1,U=F.find(W=>{var q;return W.tagName==="BUTTON"||((q=W.getAttribute)==null?void 0:q.call(W,"role"))==="button"});if(G||U)return}B.value=!B.value},{target:document.body.querySelector("#app")}),watch(()=>state.playState,(R,F)=>{console.log("newRuntime",F);let D=F;D==="suspend"&&(D="pause"),B.value=D!=="pause"}),[B]};var dayjs_min={exports:{}};(function(B,R){(function(F,D){B.exports=D()})(commonjsGlobal$1,function(){var F=1e3,D=6e4,G=36e5,U="millisecond",W="second",q="minute",Y="hour",J="day",Z="week",K="month",te="quarter",Q="year",ie="date",se="Invalid Date",ne=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,re=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ae={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},ce=function(Ee,de,we){var Oe=String(Ee);return!Oe||Oe.length>=de?Ee:""+Array(de+1-Oe.length).join(we)+Ee},he={s:ce,z:function(Ee){var de=-Ee.utcOffset(),we=Math.abs(de),Oe=Math.floor(we/60),Me=we%60;return(de<=0?"+":"-")+ce(Oe,2,"0")+":"+ce(Me,2,"0")},m:function Ee(de,we){if(de.date()1)return Ee(Ne[0])}else{var ke=de.name;be[ke]=de,Me=ke}return!Oe&&Me&&(fe=Me),Me||!Oe&&fe},ve=function(Ee,de){if(ue(Ee))return Ee.clone();var we=typeof de=="object"?de:{};return we.date=Ee,we.args=arguments,new pe(we)},Se=he;Se.l=ge,Se.i=ue,Se.w=function(Ee,de){return ve(Ee,{locale:de.$L,utc:de.$u,x:de.$x,$offset:de.$offset})};var pe=function(){function Ee(we){this.$L=ge(we.locale,null,!0),this.parse(we)}var de=Ee.prototype;return de.parse=function(we){this.$d=function(Oe){var Me=Oe.date,Pe=Oe.utc;if(Me===null)return new Date(NaN);if(Se.u(Me))return new Date;if(Me instanceof Date)return new Date(Me);if(typeof Me=="string"&&!/Z$/i.test(Me)){var Ne=Me.match(ne);if(Ne){var ke=Ne[2]-1||0,Ae=(Ne[7]||"0").substring(0,3);return Pe?new Date(Date.UTC(Ne[1],ke,Ne[3]||1,Ne[4]||0,Ne[5]||0,Ne[6]||0,Ae)):new Date(Ne[1],ke,Ne[3]||1,Ne[4]||0,Ne[5]||0,Ne[6]||0,Ae)}}return new Date(Me)}(we),this.$x=we.x||{},this.init()},de.init=function(){var we=this.$d;this.$y=we.getFullYear(),this.$M=we.getMonth(),this.$D=we.getDate(),this.$W=we.getDay(),this.$H=we.getHours(),this.$m=we.getMinutes(),this.$s=we.getSeconds(),this.$ms=we.getMilliseconds()},de.$utils=function(){return Se},de.isValid=function(){return this.$d.toString()!==se},de.isSame=function(we,Oe){var Me=ve(we);return this.startOf(Oe)<=Me&&Me<=this.endOf(Oe)},de.isAfter=function(we,Oe){return ve(we){var R;B.EngravingRules.CompactMode=!0,B.EngravingRules.DYMinNoteWidth=3,B.EngravingRules.VoiceSpacingMultiplierVexflow=.65,B.EngravingRules.VoiceSpacingAddendVexflow=2,B.EngravingRules.MinSkyBottomDistBetweenStaves=2,B.EngravingRules.MinSkyBottomDistBetweenSystems=2,B.EngravingRules.MinimumStaffLineDistance=4,B.EngravingRules.BetweenStaffDistance=2.5,B.EngravingRules.StaffDistance=3.5,B.EngravingRules.MinimumDistanceBetweenSystems=1,B.EngravingRules.PageBottomMargin=0,B.EngravingRules.PageLeftMargin=2,B.EngravingRules.PageRightMargin=2,B.EngravingRules.PageTopMarginNarrow=3,B.EngravingRules.WedgeEndDistanceBetweenTimestampsFactor=1,B.EngravingRules.RehearsalMarkXOffset=-18,B.EngravingRules.RehearsalMarkYOffset=10,B.EngravingRules.DYWorkId=((R=state$2.activeDetail)==null?void 0:R.parentCategoriesId)||0},useEngravingRules=(B,R)=>{onMounted(()=>{setEngravingRules(B);for(const F in R)if(Object.prototype.hasOwnProperty.call(R,F)){let D=F;const G=R[D];B.EngravingRules[D]=G}})},useOsmd=(B,R,F={})=>{const D=ref();if(B.value){const G=new EngravingRules;for(const[U,W]of Object.entries(F))G[U]=W;D.value=new OpenSheetMusicDisplay(B.value,{followCursor:!1,autoResize:!0,drawSubtitle:!1,drawTitle:!1,autoBeam:!0,drawMetronomeMarks:!1,drawMeasureNumbers:!1,drawComposer:!1,drawLyricist:!1,...R},G)}return D},useOsmdLoader=async(B,R)=>{if(!R)throw"score is required";const F=Toast("\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u7A0D\u540E...");try{R&&B&&(await B.load(R),B.zoom=formatZoom(),await B.render())}catch{}F.close()},container$1="_container_15puc_1",eyeProtection="_eyeProtection_15puc_22";var styles$3={container:container$1,eyeProtection};const section="_section_fxysl_1",measure="_measure_fxysl_1",dontTransition="_dontTransition_fxysl_5",after="_after_fxysl_5",img="_img_fxysl_22",font="_font_fxysl_30",bad="_bad_fxysl_35",good="_good_fxysl_43",great="_great_fxysl_51",perfect="_perfect_fxysl_58",noteWrap="_noteWrap_fxysl_80",noteBase="_noteBase_fxysl_86",noteRight="_noteRight_fxysl_89",noteError="_noteError_fxysl_92",flash="_flash_fxysl_124",restFlag="_restFlag_fxysl_127",restFlagActive="_restFlagActive_fxysl_141",flicker$1="_flicker_fxysl_1";var styles$2={section,measure,dontTransition,after,img,font,bad,good,great,perfect,noteWrap,noteBase,noteRight,noteError,flash,restFlag,restFlagActive,flicker:flicker$1};const restPromptData=reactive({list:[]}),restPromptMain=B=>{calculateMergeRest(B)};function calculateMergeRest(B){var U,W,q,Y,J,Z,K,te,Q;const R=[],F=document.querySelector("#osmdSvgPage1"),D=((U=F.getAttribute("viewBox"))==null?void 0:U.split(" "))||[];let G=Number(F.getAttribute("width"))/Number(D[2]);G=isNaN(G)?1:G;for(let ie=0;iehe.measureNumberXML===ne)&&ae&&re>1){const he=getStaveBox((Q=(te=se==null?void 0:se.stave)==null?void 0:te.attrs)==null?void 0:Q.id,G);R.push({measureNumberXML:ne,allRests:ae,multipleRestMeasures:re,staveBox:he})}}restPromptData.list=R}function getStaveBox(B,R){var D;if(!B)return{};const F=document.querySelector("#"+B);if(F){const G=(D=F==null?void 0:F.nextElementSibling)==null?void 0:D.getBBox();return{left:G.x*R+"px",top:G.y*R+"px",width:G.width*R+"px",height:G.height*R+"px"}}return{}}function _isSlot(B){return typeof B=="function"||Object.prototype.toString.call(B)==="[object Object]"&&!isVNode(B)}const sectionRef=ref(null),noteInfoItems=reactive({duration:!1,numerator:!1,denominator:!1,i:!1,time:!1,speed:!1});window.setNoteInfoItems=B=>{for(const R in B)Object.prototype.hasOwnProperty.call(B,R)&&(noteInfoItems[R]=B[R])};const uniqueByPosition=B=>{const R={};for(const F of B)F&&F.start_x&&(R[`${F.x}-${F.y}`]=F);return R};watchEffect(()=>{state$2.sectionStatus?state$2.section.length?state$2.section.length===1&&(Toast.clear(),Toast({duration:0,message:"\u8BF7\u9009\u62E9\u7ED3\u675F\u8282\u70B9",position:"top"})):(state$2.befireSection=null,Toast.clear(),Toast({duration:0,message:"\u8BF7\u9009\u62E9\u5F00\u59CB\u8282\u70B9",position:"top"})):(state$2.section=[],state$2.sectionBoundingBoxs=[],Toast.clear())});var Section=defineComponent({name:"section-box",props:{type:{type:String,default:"evaluating"},top:{type:Number,default:0},left:{type:Number,default:0}},data(){return{sectionTop:0,sectionLeft:0}},methods:{getBoundingBoxByNote(B,R){var G,U,W,q,Y,J,Z,K,te,Q,ie;const F=(W=(U=(G=B.sourceMeasure)==null?void 0:G.verticalMeasureList)==null?void 0:U[0])==null?void 0:W.boundingBox;if(!F)return null;const D={...F.absolutePosition,...F.size,...R};return D.x=D.x*10,D.y=D.y*10,D.width=D.width*10,D.height=D.height*10,(Z=(J=(Y=(q=B==null?void 0:B.sourceMeasure)==null?void 0:q.verticalMeasureList)==null?void 0:Y[0])==null?void 0:J.stave)!=null&&Z.height&&(D.height=(ie=(Q=(te=(K=B.sourceMeasure)==null?void 0:K.verticalMeasureList)==null?void 0:te[0])==null?void 0:Q.stave)==null?void 0:ie.height),D},setSettionBackground(){var U,W,q,Y,J;state$2.sectionBoundingBoxs=[];const[B,R]=state$2.section.sort((Z,K)=>Z.i-K.i),F=Math.abs(R.i-B.i)+1;R.noteLength;const D=[],G=[];for(let Z=0;Z(Z.height=Math.max(...G),Z))},setSection(B){const R=getActtiveNoteByTimes(B);if(console.log("\u{1F680} ~ activeNote",R),R&&state$2.section.length<2){const F=state$2.section.length;if(F===0){const D=getNoteBySlursStart(R,!0);state$2.section.push(state$2.times[D.i-D.si])}if(F===1){const D=getNoteBySlursStart(R,!0,"end");state$2.section.push(state$2.times[D.i-D.si+D.noteLength-1])}}state$2.section.length===2&&(Toast.clear(),this.setSettionBackground())},sectionClick(B){if(state$2.sectionStatus)this.setSection(B);else{if(state$2.mode!=="contact"||state.evaluatingStatus)return;event.emit("section-click",B)}},filterTimes(B){const R=[];return B.filter(F=>{const D=R.includes(F.id);return R.push(F.id),!D})}},mounted(){var B,R;Toast.clear(),state$2.section=[],this.sectionTop=(B=sectionRef.value)==null?void 0:B.getBoundingClientRect().top,this.sectionLeft=(R=sectionRef.value)==null?void 0:R.getBoundingClientRect().left},beforeUnmount(){Toast.clear(),state$2.sectionStatus=!1,state$2.section=[]},render(){var W,q,Y;let B;const R=state$3.sett.eyeProtection?"var(--eye-section-border-color)":"var(--section-border-color)",F=J=>state$3.sett.eyeProtection?J.before?"var(--section-background-color)":"var(--eye-section-background-color)":J.before?"var(--eye-section-background-color)":"var(--section-background-color)",D=((Y=(q=(W=state$2.times[state.activeIndex])==null?void 0:W.noteElement)==null?void 0:q.sourceMeasure)==null?void 0:Y.MeasureNumberXML)||-2,G=restPromptData.list.find(J=>{const Z=D-J.measureNumberXML;return J.allRests&&Z>=0&&Z{var ne,re,ae,ce;if(!J.svgElelent)return null;let Z;try{Z=J.svgElelent.bbox||((re=(ne=J.svgElelent).getBoundingBox)==null?void 0:re.call(ne)),!Z&&((ce=(ae=J.svgElelent)==null?void 0:ae.attrs)==null?void 0:ce.el)&&(Z=J.svgElelent.attrs.el.getBBox(),Z.w=Z.width<15?15:Z.width,Z.h=Z.height<11?11:Z.height)}catch(he){console.log(he)}if(!Z)return null;state$3.sett.type==="jianpu"&&J.svgElelent&&J.svgElelent.top_y&&J.svgElelent.note_height&&(Z.y=J.svgElelent.top_y-J.svgElelent.note_height);let{x:K,y:te,h:Q,w:ie}=Z,se=null;return J.si===0&&(se=this.getBoundingBoxByNote(J.noteElement)),createVNode(Fragment,null,[J.si===0&&se&&createVNode("div",{"data-id":J.id,style:{position:"absolute",top:formatZoom(se.y)+"px",left:formatZoom(se.x)+"px",height:formatZoom(se.height)+"px",width:formatZoom(se.width)+"px"},onClick:state$2.sectionStatus?this.sectionClick:void 0},null),createVNode("div",{"data-id":J.id,"data-vf":"vf"+J.id,class:styles$2.noteWrap,style:{position:"absolute",top:formatZoom(te)+"px",left:formatZoom(K)+"px",height:formatZoom(Q)+"px",width:formatZoom(ie)+"px",background:Object.values(noteInfoItems).find(he=>he===!0)?"rgba(255, 255, 255, 0.8)":""},onClick:this.sectionClick},[noteInfoItems.duration&&createVNode(Fragment,null,[parseInt(J.duration*100+"")/100,createVNode("br",null,null)]),noteInfoItems.time&&createVNode(Fragment,null,[J.time.toFixed(2),createVNode("br",null,null)]),noteInfoItems.numerator&&createVNode(Fragment,null,[J.noteElement.sourceMeasure.activeTimeSignature.numerator,createVNode("br",null,null),createVNode("br",null,null)]),noteInfoItems.denominator&&createVNode(Fragment,null,[J.noteElement.sourceMeasure.activeTimeSignature.denominator,createVNode("br",null,null),createVNode("br",null,null)]),noteInfoItems.i&&createVNode(Fragment,null,[J.i,createVNode("br",null,null),createVNode("br",null,null)]),noteInfoItems.speed&&createVNode(Fragment,null,[J.speed.toFixed(0),createVNode("br",null,null),createVNode("br",null,null)]),createVNode("div",{class:[styles$2.noteBase,styles$2.noteRight]},[createVNode(Icon,{name:"success",size:"16",color:"var(--primary-color)"},null)]),createVNode("div",{class:[styles$2.noteBase,styles$2.noteError]},[createVNode(Icon,{name:"cross",size:"16",color:"red"},null)])])])}),state$2.section.map((J,Z)=>{var Q;const K=getBoundingBoxByverticalNote(J);let te;try{const ie=J.svgElelent.bbox||((Q=J.svgElelent)==null?void 0:Q.getBoundingBox());te=formatZoom((ie==null?void 0:ie.x)||(Z===0?K.start_x:K.end_x))}catch(ie){console.log(ie)}return te?Z===0&&K?createVNode("div",{style:{position:"absolute",top:formatZoom(K.y)-5+"px",left:formatZoom(K.x)+"px",height:formatZoom(K.height)+"px",border:`5px solid ${R}`,borderColor:`${R} transparent ${R} ${R}`,borderRight:"none",width:"5px"}},null):Z===1&&K?(K.width=formatZoom(te-K.x+15),createVNode("div",{style:{position:"absolute",top:formatZoom(K.y-5)+"px",left:formatZoom(K.end_x-3)-5+"px",height:formatZoom(K.height)+"px",border:`5px solid ${R}`,borderColor:`${R} ${R} ${R} transparent`,borderLeft:"none",width:"5px"}},null)):null:null}),state$2.sectionBoundingBoxs.map(J=>{var Z;return createVNode("div",{class:{[styles$2.flash]:J.before&&state$2.sectionFlash&&state.playState==="play"},style:{position:"absolute",top:formatZoom(J.y)+"px",left:formatZoom(J.x)+"px",height:formatZoom((Z=getBoundingBoxByverticalNote(state$2.section[0]))==null?void 0:Z.height)+"px",width:formatZoom(J.width)+"px",backgroundColor:F(J)}},null)}),createVNode(TransitionGroup,{name:"list",duration:800},_isSlot(B=Object.values(uniqueByPosition(Object.values(state$2.evaluatings))).map(J=>J?createVNode("div",{key:J.y+J.x+J.text,class:classNames(styles$2[J.text],styles$2.measure,{[styles$2.dontTransition]:J.dontTransition}),style:{position:"absolute",top:formatZoom(J.y)+this.top+"px",left:formatZoom(J.x)+this.left+"px",height:formatZoom(J.height)+"px",width:formatZoom(J.width)+"px"}},[this.type==="evaluating"?createVNode("span",{class:styles$2.after},[createVNode("span",{class:styles$2.img},null),createVNode("span",{class:styles$2.font},[J.score])]):null]):createVNode("span",null,null)))?B:{default:()=>[B]}),G&&createVNode("div",{class:["dotWrap",styles$2.restMeasure],style:G.staveBox},[createVNode("div",{class:"dot"},[U])])])}});class Cursor{constructor(R){this.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAABCAYAAAASC7TOAAAAAXNSR0IArs4c6QAAABdJREFUGFdj3Pp5c0Ptm2oGdNAs0soAAHslBd3n2kNUAAAAAElFTkSuQmCC",this.x=R.x,this.y=R.y,this.width=R.w,this.height=R.h,this.img=document.createElement("img"),this.img.src=this.src,this.img.style.position="absolute",this.img.style.zIndex="-1",this.setValue()}reset(){var F,D;const R=(D=(F=state$2.times)==null?void 0:F[0])==null?void 0:D.cursorBox;R&&this.setPosition(R)}show(){this.img.style.display=""}hide(){this.img.style.display="none"}setPosition({x:R,y:F,w:D,h:G}){this.x=R,this.y=F,this.width=D,this.height=G,this.setValue()}setValue(){this.img.style.left=this.x+"px",this.img.style.top=this.y+"px",this.img.style.width=this.width+"px",this.img.style.height=this.height+"px",this.show()}}const rendered=ref(!1);var MusicSheet=defineComponent({name:"music-score",props:{isSoundEffect:{type:Boolean,default:!1},score:{type:String,default:""},showPartNames:{type:Boolean,default:!1},opotions:{type:Object,default:()=>{}},EngravingRules:{type:Object,default:()=>{}},showSection:{type:Boolean,default:!0}},emits:["rerender","startRender","renderError","loaddingEnd"],setup(B,{emit:R,expose:F}){const D=async ae=>{var he;event.off("section-click",noteClick),R("startRender");const ce=await request$1$1.get(ae);if(J.value){let fe=document.createElement("div");fe.innerHTML=ce,(he=J.value)==null||he.appendChild(fe.firstElementChild);let be=document.querySelector("#osmdSvgPage1");const ue=document.getElementById("svgContainer");let ge=be==null?void 0:be.getAttribute("width"),ve=be==null?void 0:be.getAttribute("height");if(ge=isNaN(Number(ge))?0:Number(ge),ve=isNaN(Number(ve))?0:Number(ve),ge&&ve){let Se=ve/ge,pe=(ue==null?void 0:ue.offsetWidth)||document.body.clientWidth;state$2.zoom=pe/ge,be==null||be.setAttribute("width",pe),be==null||be.setAttribute("height",pe*Se+"")}R("loaddingEnd")}},G=async ae=>{var he,fe,be,ue,ge,ve,Se,pe,ye,Ee,de,we,Oe,Me,Pe,Ne,ke;const ce=await request$1$1.get(ae);if(state$3.sett.scoreSize=((he=ce==null?void 0:ce.osmd)==null?void 0:he.scoreSize)||"middle",ce&&Array.isArray(ce.times)){for(let Ae=0;Ae{event.off("section-click",noteClick),R("startRender"),Z.value=useOsmd(J,{...W.value,drawPartNames:q.value},U.value).value,Z.value&&(useEngravingRules(Z.value,U.value),state.isFirstPlay=!1,event.on("section-click",noteClick))},te=async ae=>{await D(ae.svg),G(ae.json)};onMounted(async()=>{var ce,he,fe,be,ue,ge;if(rendered.value)return;if(state$3.sett.type==="staff"&&!((ce=state$2==null?void 0:state$2.activeDetail)!=null&&ce.musicSvg)||state$3.sett.type==="jianpu"&&state$3.sett.keySignature&&!((he=state$2==null?void 0:state$2.activeDetail)!=null&&he.musicFirstSvg)||state$3.sett.type==="jianpu"&&!state$3.sett.keySignature&&!((fe=state$2==null?void 0:state$2.activeDetail)!=null&&fe.musicJianSvg)){K();return}let ae=null;try{state$3.sett.type==="staff"&&((be=state$2.activeDetail)==null?void 0:be.musicSvg)?ae=JSON.parse(state$2.activeDetail.musicSvg):state$3.sett.keySignature&&((ue=state$2.activeDetail)==null?void 0:ue.musicFirstSvg)?ae=JSON.parse(state$2.activeDetail.musicFirstSvg):(ge=state$2.activeDetail)!=null&&ge.musicJianSvg&&(ae=JSON.parse(state$2.activeDetail.musicJianSvg))}catch(ve){console.error(ve),state$2.renderType="native"}ae&&!B.isSoundEffect?te(ae):K()}),onUnmounted(()=>{event.off("section-click",noteClick)}),watch([Y,Z],async()=>{if(Z&&Z.value&&Y.value)try{R("startRender"),await useOsmdLoader(Z.value,Y.value),R("rerender",Z.value),event.emit("loaded"),se()}catch(ae){console.error(ae),R("renderError")}},{immediate:!0});const Q=async({score:ae}={})=>{const ce=ae||Y.value;Toast("\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u7A0D\u540E..."),setTimeout(async()=>{if(Z&&Z.value&&ce){await Z.value.clear(),K();try{state$2.section=[],state$2.sectionStatus=!1,await useOsmdLoader(Z.value,ce),R("rerender",Z.value),event.emit("loaded"),se()}catch(he){console.error(he),R("renderError")}}},100)},ie=async()=>{var ae;await((ae=Z.value)==null?void 0:ae.render())},se=()=>{var he,fe;const ae=Array.from(J.value.querySelectorAll(".staffline")),ce=4;for(let be=0,ue=ae.length;be .vf-voices")),de=Array.from(ge.querySelectorAll(".vf-measure > .vf-beams")),we=Array.from(ge.querySelectorAll(".vf-ties")),Oe=Array.from(ge.querySelectorAll(".vf-line")),Me=Array.from(ge.querySelectorAll(".vf-measure > .vf-stave text"));Array.from(ge.querySelectorAll(".vf-measure > .vf-stave rect[fill=none]"));const Pe=Array.from(ge.querySelectorAll(".vf-measure .vf-staveSection")),Ne=["To Coda","D.S. al Coda","Coda"];Me.filter(Ce=>Ne.includes(Ce.textContent||"")).forEach(Ce=>{de.forEach(Ge=>{var Ze;const We=re(Ce,Ge),Ve=Ce==null?void 0:Ce.previousSibling;if(We.isCollision){const nt=Number(Ce.getAttribute("y"))-(We.b1-We.t2)-ce+"";Ce.setAttribute("y",nt),Ve&&Ve.getAttribute("stroke-width")==="0.3"&&Ve.getAttribute("stroke")==="none"&&(((Ze=Ve.getAttribute("d"))==null?void 0:Ze.length)||0)>3e3&&(Ve.style.transform=`translateY(${-(We.b1-We.t2+ce)}px)`)}}),Ee.forEach(Ge=>{var Ze;const We=re(Ce,Ge),Ve=Ce==null?void 0:Ce.previousSibling;if(We.isCollision){const nt=Number(Ce.getAttribute("y"))-(We.b1-We.t2)-ce+"";Ce.setAttribute("y",nt),Ve&&Ve.getAttribute("stroke-width")==="0.3"&&Ve.getAttribute("stroke")==="none"&&(((Ze=Ve.getAttribute("d"))==null?void 0:Ze.length)||0)>3e3&&(Ve.style.transform=`translateY(${-(We.b1-We.t2+ce)}px)`)}})}),Pe.forEach(Ce=>{let Ge=0;[...ye,...we,...Ee].forEach(We=>{const Ve=re(Ce,We);Ve.isCollision&&(Ge=Math.min(Ge,Ve.t2-Ve.b1-ce))}),Ce.style.transform=`translateY(${Ge}px)`});let ke=Array.from(ge.querySelectorAll(".vf-text > text")).filter(Ce=>Ce.getBBox().y text")).filter(Ce=>Ce.getBBox().y{const Ge=Ce.getBBox();Ge.y1&&_e.forEach(Ce=>{Ce.setAttribute("y",Ae+"")}),ke.forEach(Ce=>{[...ye,...pe,...Oe].forEach(Ge=>{let We=re(Ce,Ge);if(We.isCollision&&We.b1{ke.forEach(Ge=>{if(Ce.parentNode!==Ge.parentNode&&!["marcato","legato"].includes(Ce.textContent))if(["marcato","legato"].includes(Ge.textContent)){if(re(Ce,Ge,30,30).isCollision){const Ve=Ce.getBBox();Ge.setAttribute("x",Ve.x+Ve.width+5+""),Ge.setAttribute("y",Ve.y+Ve.height-5+"")}}else{const We=re(Ce,Ge);if(We.isCollision){const Ve=Number(Ce.getAttribute("y")),Ze=We.b2-We.t2<24?24:We.b2-We.t2;Ge.setAttribute("y",Ve-Ze-.5+"")}}})});const Fe=Array.from(ge.querySelectorAll(".vf-text > text")).filter(Ce=>Ce.getBBox().y>Se),Ye=Array.from(ge.querySelectorAll(".vf-line")).filter(Ce=>Ce.getBBox().y>Se);for(let Ce=0;Ce{[...pe].forEach(Ge=>{let We=re(Ce,Ge);We.isCollision&&Ce.setAttribute("y",We.b2+Math.abs(We.t1-Number(Ce.getAttribute("y")))+"")})}),Ye.forEach(Ce=>{var We;const Ge=[];if((We=Ce.nextElementSibling)!=null&&We.classList.contains("vf-line")&&Fe.forEach(Ve=>{let Ze=re(Ce,Ve,20,20);Ze.isCollision&&Ge.push({text:Ve,result:Ze})}),Ge.length===1){const Ve=Ge[0].result,Ze=Ge[0].text;Ve.x2+Ve.w2Ve.x1+Ve.w1?Math.abs(Ve.y2-Ve.y1)>10&&Ze.setAttribute("y",Ve.y1+Ve.h2/2+""):Math.abs(Ve.x2-Ve.x1)10&&Ze.setAttribute("y",Ve.y1+Ve.h2/2+"")):(Ze.setAttribute("x",Ve.x1+Ve.w1+5+""),Math.abs(Ve.y2-Ve.y1)>10&&Ze.setAttribute("y",Ve.y1+Ve.h2/2+""))}else if(Ge.length===2){const Ve=Ge[0].result,Ze=Ge[0].text,nt=Ge[1].result,at=Ge[1].text;Ze.setAttribute("x",Ve.x1-Ve.w2-5+""),Math.abs(Ve.y2-Ve.y1)>10&&Ze.setAttribute("y",Ve.y1+Ve.h2/2+""),at.setAttribute("x",nt.x1+nt.w1+5+""),Math.abs(nt.y2-nt.y1)>10&&at.setAttribute("y",nt.y1+nt.h2/2+"")}}),Fe.forEach(Ce=>{Fe.forEach(Ge=>{if(Ce.parentNode!==Ge.parentNode&&!["marcato","legato","cresc.","Cantabile"].includes(Ce.textContent))if(["marcato","legato","cresc.","Cantabile"].includes(Ge.textContent)){if(re(Ce,Ge,30,30).isCollision){const Ve=Ce.getBBox();Ge.setAttribute("x",Ve.x+Ve.width+5+""),Ge.setAttribute("y",Ve.y+Ve.height-5+"")}}else{const We=re(Ce,Ge);We.isCollision&&Ge.setAttribute("y",We.y1+We.h1+We.h2+"")}})})}setTimeout(()=>ne())},ne=()=>{if(!J.value)return;const ae=J.value.querySelector("svg");if(!ae)return;const ce=ae.getBBox();let he=Array.from(J.value.querySelectorAll(".vf-stavetempo")).reduce((ve,Se)=>{var pe;return ve.find(ye=>ye.outerHTML===Se.outerHTML)?(pe=Se==null?void 0:Se.parentNode)==null||pe.removeChild(Se):ve.push(Se),ve},[]);const fe=Array.from(J.value.querySelectorAll(".staffline")),be=Array.from(J.value.querySelectorAll(".staffline > .vf-measure")),ue=Array.from(J.value.querySelectorAll(".staffline > .vf-text")),ge=Array.from(J.value.querySelectorAll(".staffline > .vf-curve"));he.forEach(ve=>{let Se=0;[...be,...ue,...ge].forEach(Ee=>{const de=re(ve,Ee);de.isCollision&&(de.b1de.l2||de.l10&&([...fe,...he].forEach(Ee=>{if(ve!=Ee){const de=re(ve,Ee,Math.abs(ye),Math.abs(Se));de.isCollision&&(Se=de.t2-de.b1)}}),ve.style.transform=`translate(-${ye/.7}px,${Se}px)`)}),ce.y<0&&ae.setAttribute("height",Number(ae.getAttribute("height"))-ce.y+10+"")},re=(ae,ce,he=0,fe=0)=>{const be=ae.getBBox(),ue=ce.getBBox();let ge=be.y-fe,ve=be.x-he,Se=be.x+be.width+he,pe=be.y+be.height+fe,ye=ue.y,Ee=ue.x,de=ue.x+ue.width,we=ue.y+ue.height;return pede||ge>we||SecreateVNode("div",{id:"svgContainer",class:styles$3.container,style:{position:"relative"}},[createVNode("div",{ref:J},null),B.showSection&&createVNode(Section,{style:{position:"absolute",width:"100%",height:"100%",zIndex:1,top:0,left:0}},null)])}});const box="_box_17q9v_1",button="_button_17q9v_10",iconSound$1="_iconSound_17q9v_27",skepBtn="_skepBtn_17q9v_33",skepItems="_skepItems_17q9v_55",bottom="_bottom_17q9v_76",wrap="_wrap_17q9v_83",staff="_staff_17q9v_96",des="_des_17q9v_109",lampWrap="_lampWrap_17q9v_113",lamp="_lamp_17q9v_113",flickerAnimate="_flickerAnimate_17q9v_128",flicker="_flicker_17q9v_128";var styles$1={box,button,iconSound:iconSound$1,skepBtn,skepItems,bottom,wrap,staff,des,lampWrap,lamp,flickerAnimate,flicker},iconArrow="/orchestra-music-score/assets/icon-arrow.15f5e430.svg",iconBottom="/orchestra-music-score/assets/icon-bottom.d54a9994.png",iconRed="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAABGtJREFUSEu1ls1vVFUYxn/n494z93amH1CQ1jIEiJoYaCREIFEgwSiSxrjQGAQEU4OsNNEQwcQ/wIVBWRkWRl0oxoUi0QVI0PC1c4c1LMB0WhqEKDQt7czce+4x585MoRSIC5nNTGZu3t95nud93zOC+7wuXbq0RCm1VQixSQjxuHNugX9cCHHNOTfknDtprf1m2bJlw/cqI+72w9jYWDlN0w+BVwB1v0MAFvhWa72/t7e3cuezcwCVSuVVIcQh51yp9bAJQ8IwRKkGy1pLvV6nVq/P1BNCTDjn9pTL5cO3Q2YBRkdH382y7CPvgn+oVCwST0+RnTtLeuECWXUapwLkvPmoFSvQ/f1MKcXE5GSrppNS7u3r6zvQ+mIG4E8OfOWL+5POLxiyzz8jOXmCJIBUK5I4QjqNkAZZbCcICpgNG9DPbuLviYlcGeCA7S0lOcB7bq09723xxbvThPp7e7H/XGaqU+GcAqdJozakVSANdl4nZsHDxIuX4JQiHtjCtep0DvF2KaVW+ExyQKVS+RrwClgYxyS7B0luXiYtQSoNwhfNNKmJEZnOAaq/n3mvD3q5OGupnj6HGdjM1evXW+4cLpfL24RvRa31Rd8t3nPzycfUf/mBrNvhrMYSIFLlSdgwanwWIYVdO4jWr2/EFWhqv55FdXVRW72ylYlN03S5GB4e3ieE8C3JosxSffEF7HKHQ+FSSeZ8AB6gsIFXo3OA3rCe0q7X/FDgpGTiu58IpmpEb27nyo0buQrn3H5RqVSOAc/5Vmw/eoT0y4OkvSIv6JIGQCSyAdAGckBA2tlBYfWT6EcfofbXVez1CcJCRDywifHO9lYLHxcjIyMjzrm+3J7392H/PEVWUpDIBiDTOcBZhSPIs3AiIIuLCGUgjLCLe1AmQreVMGv7qa19IrdJCDHqFVQB09nRgRocJKudxxYk1BsW+cIkKg86cxpckANssYTQBYiKRHt2IIKQ+pnfMI8txT7zFDfGx71LtdmANwbJqr83AE0FeEBd4t+d0zjCBqDUDtogy0vo+OAdhJBM/niCsLsLu3HdLcBci06TlQQuadrkAbkSf3qN8wrQZG2lHEAYE7y0BRkWyIYuYtbMtWgm5I6jR0i+OIj1ITcV5IXTpgKCXAWE2KLPoAAmIlvcgzRxHnLh5ecZn991K+R7tqlrds5MF0ky73nmF16Yd5HPQJgYW+5BF9ooGEO0e8fsNp07aAdIfv4eu8hP6B1z4D1vdpFt70DIEBE2FBihiZ9eR3VNo4P80s0Hbe6qiEh27iSdHsO2SzIRzliUhjGyOclegWwCZM9CooUPEe7cytXxxpABjVVx12WX1Km//Rbp+BWq3WEear6LCs1dpAy2qwslQow2hMuXEm/beu9l11Qxe10bQ3boU5Ljx0gLfg8FJG0xwmkkIbKtiA4jzMaNqIHN91/XLU13vXAmJ8nOnMIO/UE2NQUqQCzoRq3sR69axc0w+G8XTgvyQK/MFuSBXvq3X9j/x9+WfwGl6lzvWSMVSAAAAABJRU5ErkJggg==",iconGreen="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAABAZJREFUSEu1lk1oHGUYx3/vzOzmi91s6qZt4jIJqRpsS2lj0IMHxYMeqigIYlqkByuC3kRIQHrqpYp6UxAVRKgRoQehl3jwJtHSlhZLxTYJ7mabahNMatr9yO7MI887s0nWfOjBLiyzzLzz/N7///l417DNZ2Zmps913ZeNMU8ZY/aKSLcuN8bMi8hVEfk+CIKvBwYG8luFMZs9mJub8+v1+ingJcDdbhNAAHzjed5Yb29v4Z9rNwAKhcKIMeYTEUnp4pqEnFu+zaW7y/y+UrXv7062cLAjxaOpThLGsfeMMcsi8rrv++PrIU2AYrH4VhiG7+v6ahjy+R9FPlu4wYITgBhMwkNqAnXAM2RD4Xh3L6/uytHiWJA4jvN2Lpf7sAFZBejOgdMa/LdKmdemrvCrW8a0u1AVqIK4HlQUYKA1CTUgrDHY7vHpnr30t7ZZCHC0ocQC1PMgCK6oLRr8xalLzKdr2IfiRkFXAeEq4IFkB/vSGSbv3EYqS5wZPGAhapfruvs1JzZGoVD4ChhRW5795SLXdpSw0dXy0IGywIpqcxFVUzcM7+zmi6FhPGNYlJDnz52nK1jm7MOHGnaN+75/xGgpep43rdXy8c0C75ZnIA1U4q/aoQoUooBypOCdoQO80t8fWe0YRq9e59u5PGO5nbzR4+vdoF6v7zH5fH7UGHNKq+Wxn3/kT7+K2KBx4Fp8rQiiaqwCONzn88HwIRtfl78weZGpUoVs611+2j9sq0tExkyhUJgAnv7hr0VG5i/jZAWxQYl2rb9LYlVIaCLbNLktCQ739HIwex8TS4ucX1oGx4X2FcZzfTye7lL2d2Z2dnZWRHIf3SzwXjiN6QDRIA2A/a2AKLCsxFDPjeBiINMeXbUnuxxGd2d4s8fXZBdVgb7aciJ/nS/bi5iEBjHR7sua6Gj39msBsYJEAgKDa1xOPvGIVgAnLl8jSDkcyyQ52fegKqg2AzqKGI/IIguIytNaVJVImTaZPk96FtCXTjPx3JNWwTOTF8hLlWMpbw2wqUW6S919AxBfrT0NBV4EQByODg9awOnpG9C50aK1JN+Kk9wA2AZbq6Imi9YByLRZkJYxOwLG/f61JG8s0xVEbbBJjv1WBQoLnajRbBUlIwU4UZL16jhkk3eay/RfG02Dxcle7QO9l0xE+dDeUICWsFNlzN/V3GgbR8UFrmVKUYc2BpvtakG0DO29WIFOVrWmUwEBg611zu4bah4VWw27hbRuM96hAtQax0MUoNaoRdrCOrTaPLrDEmce2mLYxSo2jmtTisd1PPhcBYRRmdpxrXmpMZhKbj+uG4fDpgfOreLqgYPrRmUaRk2bDeF4z/3/7cBpQO7pkdmA3NNDf/2B/X/8bfkbLfmH7810f6kAAAAASUVORK5CYII=",iconWhite="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAYCAYAAAAPtVbGAAAAAXNSR0IArs4c6QAAA5xJREFUSEu1lr9uG0cQxr+5I++OPMkULTuNcIAaIbADOAHSJoXhwlWqwHa6AHoIdzEEd4YfIGXKFO4MA0bgB7A7AwaSIta/I+mjREuiFDEUySNvg2+jIY4UCbnxAgSWu7fz25n5Zu4El4xGo/F1lmX3AXwvIl8aY6oikgJoGmPeOY7zhzHmWRRFR/NMybyNJEm+HY1GT40xty+7CIAugF/DMHy8vLz8z/TzFyDGGKnVao9E5BcALg+ICHzfh1cswnEca2M4HKI/GCBN6dR41LMse7C6uvo6vzgBIaBer/8G4Gc+RIOLi4souC7+7XQwSFNkxqBYLMJ1XZR8H0XPQ6fTQffsTO2eiciPURS91IUJSBzHT0TkITc9z8PVpSXst1ro9fv2v3rFeZZl9j+9K5dKdn7YbsMYw2nXdd3vVlZW3tozSms0GneyLHvFNYYmLJXwodm0xnjzeRA+y3DS22KhgI+Hhwr6u9/v31pbW+tbyMbGhrO+vv4OwFeu46BSqWBnd9caZ8gIyEMKhYKFB0GAcrls7zkajWyeYAyO2m31+mEURU8tJI7jH0TkOedXq1UcHBwgHQ6tAcaeRgnUwTUapRfc42CY+gxroYD2yYmdG2P2tre3Iwup1Wq/A/iJh5cqFbzf3MTCwgJKpdIYQGMMC40phGCF07Ner2c9d0Vs2M7HXQup1+v7xpgvFsIQp6enOD45sZAwDMeQvCeE0RPNF8GUMtc5ykGAvVbL7ovIE2k2m9fTNG1xc7latWqiTPOe0AveUD1RCEF5oNYQFdc+PrYhE5EXEsfxTRH5k5Dr165hN45tOBSiIeGaQjTRhOicz9EjrlFlp6ydbpdn3kiSJDeGw+FfCtnc2rIhYhEy8SpfQnhTGuKPSlIIz1IEXGde6MkEZDpce/v7YDkxH0w8IYTO80TDpaFiHi6EazrxZ72ebRP0RNVFSF6q0zmx9XHe47gXeN5k4i9I+MoVvN/amlAXCzEvYd6aodLE8/YMlZWv686W8HQxHh4d2ZhP14kWHQ3RMCE0rBCuB74/VtZEMU63lWq1iiRJ4Pm+vZnmRdWlbYXG82IggGsz2wpvON0gtaB421m967zb2ktwTgATPrdBav3PavUMHcVAEI3Rm3yrZ01Q6ibLLm/15/Ge+dLyPc8W1mAw+L+VeB4cqigIrCDYij75paWgz/r6HfdygIn/fB8SeRDnOzs737iuey//ScTvCBFJPvWT6D9cJW2Lx33GagAAAABJRU5ErkJggg==",iconSound="/orchestra-music-score/assets/icon-sound.d38d70bd.png",score=B=>B==12||B==4?{xml:` Click to add Title Click to add Composer Click to add Copyright 2021-08-27 SmartMusic 6.5000 40 1827.3 1292 61.2 61.5 379.6 61.3 1.0000 1.0000 5.0000 1.0000 1.0000 3.4199 1.0000 60 50 Music Music wind.flutes.flute Finale Default Bank 60 0 40 system 3840 0 major G 2 C 5 15360 1 whole `,text:""}:B==5||B==6?{xml:` Click to add Title Click to add Composer Click to add Copyright 2021-08-27 SmartMusic 6.5000 40 1827.4 1292.1 61.3 61.5 355.6 61.4 1.0000 1.0000 5.0000 1.0000 1.0000 3.4199 1.0000 60 50 Music Music wind.flutes.flute Finale Default Bank 60 0 40 system 3840 1 major G 2 C 5 15360 1 whole `,text:"C"}:B==13?{xml:` Click to add Title Click to add Composer Click to add Copyright 2021-08-27 SmartMusic 6.5000 40 1827.4 1292.1 61.3 61.5 355.6 61.4 1.0000 1.0000 5.0000 1.0000 1.0000 3.4199 1.0000 60 50 Music Music wind.flutes.flute Finale Default Bank 60 0 40 system 3840 -1 major G 2 F 4 15360 1 whole `,text:"F"}:B==14||B==15?{xml:` Click to add Title Click to add Composer Click to add Copyright 2021-08-27 SmartMusic 6.5000 40 1827.4 1292.1 61.3 61.5 355.6 61.4 1.0000 1.0000 5.0000 1.0000 1.0000 3.4199 1.0000 60 50 Music Music wind.flutes.flute Finale Default Bank 60 0 40 system 3840 -2 major F 4 B -1 2 15360 1 whole `,text:"S"}:B==120?{xml:` Click to add Title Click to add Composer Click to add Copyright 2021-08-27 SmartMusic 6.5000 40 1827.3 1292 61.2 61.5 379.6 61.3 1.0000 1.0000 5.0000 1.0000 1.0000 3.4199 1.0000 60 50 Music Music wind.flutes.flute Finale Default Bank 60 0 40 system 3840 0 major G 2 A 5 15360 1 whole `,text:"A"}:{xml:` Click to add Title Click to add Composer Click to add Copyright 2021-08-27 SmartMusic 6.5000 40 1827.4 1292.1 61.3 61.5 355.6 61.4 1.0000 1.0000 5.0000 1.0000 1.0000 3.4199 1.0000 60 50 Music Music wind.flutes.flute Finale Default Bank 60 0 40 system 3840 -2 major G 2 B -1 4 15360 1 whole `,text:"Bb"};const checkStatus=ref("checking"),checkFrequency=ref(0),dotIcons=ref([iconWhite,iconWhite,iconWhite]),trend=ref(-1),time=ref(0),useStart=B=>{const R=getAllNodes(B);checkFrequency.value=R[0].frequency,postMessage({api:"proxyServiceMessage",content:{header:{status:200,commond:"xmlInfo",type:"SOUND_CHECK"},body:{frequency:checkFrequency.value}}}),postMessage({api:"startSoundCheck"},()=>{checkStatus.value="checking";try{localStorage.setItem(storeKeys.lastCheckTime,""+new Date().valueOf())}catch{}})},useEnd=()=>{postMessage({api:"endSoundCheck"})},useLister=()=>{const B=R=>{var D;const F=(D=R==null?void 0:R.content)==null?void 0:D.body.frequency;console.log("frequency",F,checkFrequency.value),trend.value=Math.abs(F-checkFrequency.value)<=5?0:F-checkFrequency.value>0?1:-1,dotIcons.value=[iconWhite,iconWhite,iconWhite],dotIcons.value[trend.value+1]=trend.value===0?iconGreen:iconRed,trend.value!==0&&(time.value=new Date().getTime()),new Date().getTime()-time.value>3e3&&(useEnd(),checkStatus.value="success",dotIcons.value=[iconGreen,iconGreen,iconGreen],setTimeout(()=>{soundEffectShow.value=!1},1e3))};onMounted(()=>{listenerMessage("sendResult",B)}),onBeforeUnmount(()=>{removeListenerMessage("sendResult",B)})},soundEffectShow=ref(!1);var SoundEffect=defineComponent({name:"ColexiuSoundEffect",emits:["success","close","pass","fail"],setup(B,{emit:R}){const F=ref(!1),D=ref(!1),G=U=>{U.text==="\u5173\u95ED\u6821\u97F3"&&(state$3.sett.tuning=!1),R("pass"),soundEffectShow.value=!1};return useLister(),watch([soundEffectShow,checkStatus],()=>{checkStatus.value==="success"&&R("success"),checkStatus.value==="fail"&&R("fail"),soundEffectShow.value===!1&&(F.value=!1,R("close"),useEnd())}),()=>{const U=score(2),W=(U==null?void 0:U.xml)||"";return createVNode(Popup,{position:"bottom",show:soundEffectShow.value,"onUpdate:show":q=>soundEffectShow.value=q,onOpen:()=>F.value=!0,onClosed:()=>F.value=!1,teleport:"body"},{default:()=>[createVNode("div",{class:styles$1.box},[createVNode("img",{class:styles$1.iconSound,src:iconSound},null),createVNode("div",{class:styles$1.wrap},[createVNode("div",{class:styles$1.staff},[F.value&&createVNode(MusicSheet,{isSoundEffect:!0,opotions:{stretchLastSystemLine:!0,drawMetronomeMarks:!1,drawPartAbbreviations:!1,drawPartNames:!1,drawSlurs:!1,drawTimeSignatures:!1,followCursor:!1},score:W,showSection:!1,onRerender:useStart},null)]),createVNode("div",{class:styles$1.des},[createTextVNode("\u8BF7\u6F14\u594F "),createVNode("span",{style:{color:"var(--primary-color)"}},[U.text]),createTextVNode("\u76F4\u5230\u7EFF\u706F\u5168\u90E8\u4EAE\u8D77")]),createVNode("div",{class:styles$1.lampWrap},[dotIcons.value.map((q,Y)=>createVNode("div",{class:styles$1.lamp,key:Y},[createVNode("img",{class:[checkStatus.value==="checking"&&styles$1.flickerAnimate],src:q},null)]))])]),createVNode("img",{class:styles$1.bottom,src:iconBottom},null),createVNode(Button,{class:styles$1.button,icon:iconBack,onClick:()=>soundEffectShow.value=!1},null),createVNode(Popover,{class:styles$1.skepItems,show:D.value,"onUpdate:show":q=>D.value=q,actions:[{text:"\u8DF3\u8FC7\u672C\u6B21"},{text:"\u5173\u95ED\u6821\u97F3"}],onSelect:q=>G(q),showArrow:!1},{reference:()=>createVNode(Button,{class:styles$1.skepBtn,icon:iconArrow,iconPosition:"right"},{default:()=>[createTextVNode("\u8DF3\u8FC7\u672C\u6B21")]})})])]})}}});const soundNeedShow=()=>{if(state.evaluatingStatus&&!permissionPopup.show){let B=-1;const R=localStorage.getItem(storeKeys.lastCheckTime);try{const F=dayjs(parseFloat(R||"0"));F.isValid()&&(B=Math.abs(F.diff(dayjs(new Date().valueOf()),"day")))}catch{}(state$3.sett.tuning||B>0||!R)&&(soundEffectShow.value=!0)}},setWiredStatus=B=>{state.evaluatingStatus?(permissionPopup.active="earphone",permissionPopup.show=!(B!=null&&B.content.checkIsWired),soundNeedShow()):permissionPopup.show=!1},useWiredHeadsetCheck=()=>{const B=ref(!1);return watch(()=>state.evaluatingStatus,()=>{postMessage({api:"isWiredHeadsetOn"},setWiredStatus)}),watch(()=>permissionPopup.show,()=>{soundNeedShow()}),watch([()=>state.evaluatingStatus],()=>{Toast.clear(),state.evaluatingStatus||(state.evaluatingTips=!1,pause(),setCurrentTime(0)),state$3.sett.fingering&&event$1.emit("settingFingeringChange")}),watch([()=>state.evaluatingStatus,()=>permissionPopup.show,()=>soundEffectShow.value],([R,F,D])=>{B.value=R&&!F&&!D,state.evaluatingStatus||(state$2.evaluatings={},evaluatingShow.value=!1)}),onMounted(()=>{listenerMessage("listenerWiredStatus",setWiredStatus)}),onBeforeUnmount(()=>{removeListenerMessage("listenerWiredStatus",setWiredStatus)}),[B]},browserInfo$1=browser(),useFee=(B,R)=>{var J,Z,K;console.log("maxtime",B,R);const F=((J=state$2.activeDetail)==null?void 0:J.orderStatus)||R,G=useOriginSearch().setting||{};if(((Z=state$2.activeDetail)==null?void 0:Z.play)||G.feeType==="FREE")return;const U=useClientType();if(!browserInfo$1.isApp&&U==="web"||(B==null?void 0:B.includes("VIP"))&&((K=state$4.user)==null?void 0:K.membershipDays)>0||(B==null?void 0:B.includes("CHARGE"))&&F==="PAID")return;const W=ref(-1),q=state$2.times[state$2.times.length-1];q&&(W.value=Math.max(10,q.time*state$2.freeRate));const Y=te=>{var ie,se,ne;const Q=((ie=state$2.activeDetail)==null?void 0:ie.orderStatus)||R;U!="web"&&W.value>=0&&state.currentTimeNum>=W.value&&((B==null?void 0:B.includes("CHARGE"))&&B.includes("VIP")?Q!=="PAID"&&!(((se=state$4.user)==null?void 0:se.membershipDays)>0)&&(permissionPopup.active="memberAndDemand",permissionPopup.show=!0,pause()):B==="CHARGE"?Q!=="PAID"&&(permissionPopup.active="demand",permissionPopup.show=!0,pause()):B==="VIP"&&(((ne=state$4.user)==null?void 0:ne.membershipDays)>0||(permissionPopup.active="member",permissionPopup.show=!0,pause())))};state.audiosInstance.event.on("timeupdate",Y),listenerMessage("cloudTimeUpdae",Y),onBeforeUnmount(()=>{state.audiosInstance.event.off("timeupdate",Y),removeListenerMessage("cloudTimeUpdae",Y)})},search$1=useOriginSearch(),browserInfo=browser(),useClientType=()=>{const B=useOriginSearch();if(B.client)return B.client;let R=location.pathname.indexOf("/orchestra-student/")===0||browserInfo.isStudent,F=location.pathname.indexOf("/orchestra-teacher/")===0||browserInfo.isTeacher;return R?"student":F?"teacher":"web"},MemberDefaultData={membershipDays:1},useUpdateMember=()=>{const B=getRequestHostname();request.get(`/musicSheet/detail/${search$1.id}`,{prefix:B}).then(R=>{state$2.activeDetail&&(state$2.activeDetail.orderStatus=R.data.orderStatus,state$2.activeDetail.play=R.data.play)})},useUser=()=>{const B=usePageVisibility(),R=async()=>{try{const F=useClientType();if(F==="student"){const{data:D}=await request.get("/appLoginUser/getUserInfo");state$4.user=D}if(F==="teacher"){const{data:D}=await request.get("/appLoginUser/getUserInfo",{prefix:"/api-teacher"});state$4.user={...MemberDefaultData,...D}}F==="web"&&(state$4.user={...MemberDefaultData})}catch{}};R(),watch(B,async F=>{var D,G;permissionPopup.show=!1,F==="visible"&&((D=state$4.user)==null?void 0:D.membershipDays)===0&&R(),F==="visible"&&((G=state$2.activeDetail)==null?void 0:G.orderStatus)!=="PAID"&&useUpdateMember()})},typeById={2:{name:"flute",direction:"transverse"},4:{name:"clarinet",direction:"vertical",width:"1rem",paddingLeft:"0rem"},5:{name:"saxophone",direction:"vertical",width:"2rem"},6:{name:"saxophone",direction:"vertical",width:"2rem"},12:{name:"trumpet",direction:"transverse",height:"80px"},13:{name:"horn",direction:"vertical",width:"3.5rem"},14:{name:"trombone",direction:"transverse",height:"80px"},15:{name:"up-bass-horn",direction:"vertical",width:"3rem"},17:{name:"tuba",direction:"vertical",width:"3rem"},120:{name:"piccolo",direction:"vertical",width:"1rem"},136:{name:"hulusi-flute",direction:"vertical",width:"1.2rem"},135:{name:"pan-flute",direction:"vertical",width:"2.5rem"},134:{name:"ocarina",direction:"vertical",width:"2rem"},137:{name:"melodica",direction:"transverse"},130:{name:"ukulele",direction:"vertical",width:"2rem"},140:{name:"mouthorgan",direction:"transverse",height:"80px"},150:{name:"piano",direction:"transverse",height:"80px"}},relationships={flute17:{59:[27,26,25,15,24,22,17,20],60:[1,2,3,5,7,9,11,12,13,15],1060:[1,2,3,5,7,9,1011,12,13,15],61:[1,2,3,5,7,9,13,15],1061:[1,2,3,5,7,9,1013,15],62:[1,2,3,5,7,9,15],1062:[1,2,3,5,7,9,1010,15],63:[1,2,3,5,7,9,10,15],1063:[1,2,3,5,7,1009,10,15],64:[1,2,3,5,7,10,15],1064:[1,2,3,5,1007,10,15],65:[1,2,3,5,10,15],1065:[1,2,3,1005,9,10,15],66:[1,2,3,9,10,15],1066:[1,2,3,1009,10,15],67:[1,2,3,10,15],1067:[1,2,3,1004,10,15],68:[1,2,3,4,10,15],1068:[[1,2,1003,4,10,15],[1,2,1003,1004,10,15]],69:[1,2,10,15],1069:[1,1002,10,14],70:[[1,5,10,15],[1,10,14]],1070:[1,1005,10,15],71:[1,10,15],1071:[1,10,1015],72:[1,10],1072:[1001,10],73:[13],1073:[1006,13],74:[2,3,5,7,9,15],1074:[2,3,5,7,9,1013,15],75:[2,3,5,7,9,10,15],1075:[2,3,5,7,9,10,15],76:[1,2,3,5,7,10,15],1076:[1,2,3,5,1007,10,15],77:[1,2,3,5,10,15],1077:[1,2,3,1005,9,10,15],78:[1,2,3,9,10,15],1078:[1,2,3,1009,10,15],79:[1,2,3,10,15],1079:[1,2,3,4,10,15],80:[1,2,3,4,10,15],1080:[1,2,1003,4,10,15],81:[1,2,10,15],1081:[1,1002,10,15],82:[[1,5,10],[1,10,14]],1082:[1,1005,10,15],83:[1,10,15],1083:[1,10,1015],84:[1,10],1084:[1001,10],85:[10],1085:[1006,10],86:[2,3,10,15],1086:[2,3,1008,10,15],87:[1,2,3,4,5,7,8,10,15],1087:[1,2,1003,4,5,7,8,10,15],88:[1,2,5,7,10,15],1088:[1,1002,5,7,10,15],89:[1,3,5,10,15],1089:[1,3,1005,9,10,15],90:[1,3,9,10,15],1090:[1,3,9,10,1015],91:[1,2,3,10],1091:[1,2,3,1006,10],92:[2,3,4,10],1092:[2,3,4,1006,10],93:[2,5,10,15],1093:[1002,5,10,15],94:[5,6,15],1094:[1,3,1005,1006,8,15],95:[1,3,8,15],1095:[1,3,8,10,1015],96:[1,2,3,4,5,11],1096:[1001,2,3,4,5,11]},flute:{59:[27,26,25,15,24,22,17,20],60:[27,26,25,15,24,22,17,20],61:[27,26,25,15,24,22,17,21],62:[27,26,25,15,24,22,17],63:[27,26,25,15,24,22,17,19],64:[27,26,25,15,24,22,19],65:[27,26,25,15,24,19],66:[27,26,25,15,17,19],67:[27,26,25,15,19],68:[27,26,25,15,18,19],69:[27,26,15,19],70:[[27,14,19],[27,24,15,19]],71:[27,15,19],72:[27,19],73:[19],74:[26,25,24,22,17,15],75:[26,25,24,22,17,19,15],76:[27,26,25,15,24,22,19],77:[27,26,25,15,24,19],78:[27,26,25,15,17,19],79:[27,26,25,15,19],80:[27,26,25,15,18,19],81:[27,26,15,19],82:[[27,14,19],[27,24,15,19]],83:[27,15,19],84:[27,19],85:[19],86:[26,25,15,19],87:[27,26,25,15,24,22,17,18,19],88:[27,26,15,24,22,19],89:[27,25,24,15,19],90:[27,25,17,15,19],91:[27,26,25,19],92:[26,25,18,19],93:[26,24,15,19],94:[23,24,15,19],95:[27,25,15,16],96:[27,26,25,18,24,19]},clarinet:{52:[[3,4,6,8,9,11,14,18,20],[3,4,6,8,9,11,14,20]],53:[[3,4,6,8,9,11,12,20],[3,4,6,8,9,11,18,20]],54:[[3,4,6,8,9,11,13,18,20],[3,4,6,8,9,11,13,20],[3,4,6,8,9,11,15]],55:[3,4,6,8,9,11,20],56:[3,4,6,8,9,11,16,20],57:[3,4,6,8,9,20],58:[3,4,6,8,20],59:[[3,4,6,9,20],[3,4,6,8,10,20]],60:[3,4,6,20],61:[3,4,6,7,20],62:[3,4,20],63:[[3,4,20,24],[3,4,5,20],[3,8,20]],64:[3,20],65:[20],66:[[3],[20,23,24]],67:[],68:[2],69:[1],70:[1,19],71:[[3,4,6,8,9,11,14,18,19,20],[3,4,6,8,9,11,14,19,20]],72:[[3,4,6,8,9,11,12,19,20],[3,4,6,8,9,11,18,19,20]],73:[[3,4,6,8,9,11,13,19,20],[3,4,6,8,9,11,13,18,19,20],[3,4,6,8,9,11,15,19,20]],74:[3,4,6,8,9,11,19,20],75:[3,4,6,8,9,11,16,19,20],76:[3,4,6,8,9,19,20],77:[3,4,6,8,19,20],78:[[3,4,6,9,19,20],[3,4,6,8,10,19,20]],79:[3,4,6,19,20],80:[3,4,6,7,19,20],81:[3,4,19,20],82:[[3,4,19,20,24],[3,4,5,19,20],[3,4,8,19,20]],83:[3,19,20],84:[19,20],85:[4,6,8,9,19,20],86:[4,6,8,16,19,20],87:[[4,6,8,10,16,19,20],[4,6,9,16,19,20]],88:[4,6,16,19,20],89:[4,6,7,16,19,20]},trumpet:{0:[1,2,3],54:[4,5,6],55:[4,2,6],56:[1,5,6],57:[4,5,3],58:[4,2,3],59:[1,5,3],60:[1,2,3],61:[4,5,6],62:[4,2,6],63:[1,5,6],64:[4,5,3],65:[4,2,3],66:[1,5,3],67:[1,2,3],68:[1,5,6],69:[4,5,3],70:[4,2,3],71:[1,5,3],72:[1,2,3],73:[4,5,3],74:[4,2,3],75:[1,5,3],76:[1,2,3],77:[4,2,3],78:[1,4,3],79:[1,2,3],80:[1,5,6],81:[4,5,3],82:[4,2,3],83:[1,5,3],84:[1,2,3]},horn:{53:[1],54:[2],55:[],56:[2,3],57:[1,2],58:[1],59:[2],60:[],61:[1,2],62:[1],63:[2],64:[],65:[1],66:[2],67:[],68:[0,2,3],69:[0,1,2],70:[0,1],71:[0,2],72:[0],73:[0,2,3],74:[0,1,2],75:[0,1],76:[0,2],77:[0],78:[0,2],79:[0],80:[0,2,3],81:[0,1,2],82:[0,1],83:[0,2],84:[0]},upBassHorn:{0:[1,2,3],40:[4,5,6],41:[4,2,6],42:[1,5,6],43:[4,5,3],44:[4,2,3],45:[1,5,3],46:[1,2,3],47:[4,5,6],48:[4,2,6],49:[1,5,6],50:[4,5,3],51:[4,2,3],52:[1,5,3],53:[1,2,3],54:[1,5,6],55:[4,5,3],56:[4,2,3],57:[1,5,3],58:[1,2,3],59:[4,5,3],60:[4,2,3],61:[1,5,3],62:[1,2,3],63:[4,2,3],64:[1,5,3],65:[1,2,3],66:[1,5,6],67:[4,5,3],68:[4,2,3],69:[1,5,3],70:[1,2,3]},trombone:{0:[1],40:[22],41:[11],42:[5],43:[4],44:[3],45:[2],46:[1],47:[22],48:[11],49:[5],50:[4],51:[3],52:[2],53:[1],54:[5],55:[4],56:[3],57:[2],58:[1],59:[4],60:[3],61:[2],62:[1],63:[3],64:[2],65:[1],66:[5],67:[4],68:[3],69:[2],70:[1]},saxophone:{58:[2,4,5,13,17,18,19,23],59:[2,4,5,11,17,18,19,23],60:[2,4,5,17,18,19,23],61:[2,4,5,12,17,18,19,23],62:[2,4,5,17,18,19],63:[2,4,5,17,18,19,22],64:[2,4,5,17,18],65:[2,4,5,17],66:[[2,4,5,18],[2,4,5,17,21]],67:[2,4,5],68:[2,4,5,10],69:[2,4],70:[[2,4,16],[2,17],[2,3]],71:[2],72:[[4],[2,15]],73:[],74:[2,4,5,6,17,18,19],75:[2,4,5,6,17,18,19,22],76:[2,4,5,6,17,18],77:[2,4,5,6,17],78:[[2,4,5,6,18],[2,4,5,6,17,21]],79:[2,4,5,6],80:[2,4,5,6,10],81:[2,4,6],82:[[2,4,6,16],[2,6,17],[2,3,6]],83:[2,6],84:[[4,6],[2,6,15]],85:[6],86:[6,9],87:[6,7,8],88:[6,8,9,14],89:[[6,7,8,9,14],[1,4,6]]},tuba:{0:[1,2,3],28:[4,5,6],29:[4,2,6],30:[1,5,6],31:[4,5,3],32:[4,2,3],33:[1,5,3],34:[1,2,3],35:[4,5,6],36:[4,2,6],37:[1,5,6],38:[4,5,3],39:[4,2,3],40:[1,5,3],41:[1,2,3],42:[1,5,6],43:[4,5,3],44:[4,2,3],45:[1,5,3],46:[1,2,3],47:[4,5,3],48:[4,2,3],49:[1,5,3],50:[1,2,3],51:[4,2,3],52:[1,5,3],53:[1,2,3],54:[1,5,6],55:[4,5,3],56:[4,2,3],57:[1,5,3],58:[1,2,3]},piccolo:{72:[11,2,33,4,5,6,7,8],73:[11,2,33,4,5,6,7,88],74:[11,2,33,4,5,6,7],75:[11,2,33,4,5,6,77],76:[11,2,33,4,5,6],77:[11,2,33,4,5,7,8],78:[11,2,33,4,6,7],79:[11,2,33,4],80:[11,2,33,5,6,77],81:[11,2,33],82:[[11,2,4,5],[11,3,4,5]],83:[[11,2],[11,33,4]],84:[11,33],85:[[2,33],[11]],86:[33],87:[33,4,5,6,7],88:[1,2,33,4,5,6],89:[1,2,33,4,5,7],90:[1,2,33,4,6],91:[1,2,33,4],92:[1,2,33,5],93:[1,2,33],94:[1,2,33,5,6,7],95:[1,2,33,5,6],96:[1,2,5,6],97:[1,2,4,5,7,8],98:[1,2,4]},smallDrum:{0:["active","active-left","active-right"],64:["left","right"]},hulusi:{59:[7,6,5,4,3,2,1],60:[7,6,5,4,3,2],61:[7,6,5,4,3],62:[7,6,5,4],63:[7,6,5],64:[7,6],65:[[7,5,4,3,2,1],[7,5,4,3,2],[7,66]],66:[7]},pan:{54:[21],56:[20],58:[19],60:[18],62:[17],64:[16],66:[15],68:[14],70:[13],72:[12],74:[11],76:[10],78:[9],80:[8],82:[7],84:[6],86:[5],88:[4],90:[3],92:[2],94:[1]},ocarina:{57:[1,2,3,4,5,6,7,8,9,10,11,12],58:[1,2,3,4,5,6,8,9,10,11,12],59:[1,2,4,5,6,8,9,10,11,12],60:[1,2,4,5,6,11,12],61:[1,2,4,5,6,7,8,9,11,12],62:[1,2,4,5,6,8,9,11,12],63:[1,2,4,5,6,8,10,11,12],64:[1,2,4,5,6,8,11,12],65:[1,2,4,5,6,11,12],66:[1,2,4,6,9,11,12],67:[1,2,4,6,11,12],68:[1,2,6,9,11,12],69:[1,2,6,11,12],70:[1,2,6,9,11,12],71:[1,6,9,11,12],72:[6,11,12],73:[2,6,12],74:[6,12],75:[2,6],76:[6],77:[]},melodica:{56:[1],57:[2],58:[3],59:[4],60:[5],61:[6],62:[7],63:[8],64:[9],65:[10],66:[11],67:[12],68:[13],69:[14],70:[15],71:[16],72:[17],73:[18],74:[19],75:[20],76:[21],77:[22],78:[23],79:[24],80:[25],81:[26],82:[27],83:[28],84:[29],85:[30],86:[31],87:[32]},ukulele:{60:[3,300],61:[3,301],62:[3,302],63:[3,303],64:[2,200],65:[2,201],66:[2,202],67:[2,203],68:[2,204],69:[1,100],70:[1,101],71:[1,102],72:[1,103],73:[1,104],74:[1,105],75:[1,106],76:[1,107],77:[1,108],78:[1,109],79:[1,110],80:[1,111],81:[1,112],82:[1,113],83:[1,114],84:[1,115],85:[1,116],86:[1,117]},mouthorgan:{53:[101],54:[1],55:[102],56:[2],57:[103],58:[3],59:[104],60:[105],61:[4],62:[106],63:[5],64:[107],65:[108],66:[6],67:[109],68:[7],69:[110],70:[8],71:[111],72:[112],73:[9],74:[113],75:[10],76:[114],77:[115],78:[11],79:[116],80:[12],81:[117],82:[13],83:[118],84:[119],85:[14],86:[120],87:[15],88:[121],89:[122]},piano:{21:[101],22:[1],23:[102],24:[103],25:[2],26:[104],27:[3],28:[105],29:[106],30:[4],31:[107],32:[5],33:[108],34:[6],35:[109],36:[110],37:[7],38:[111],39:[8],40:[112],41:[113],42:[9],43:[114],44:[10],45:[115],46:[11],47:[116],48:[117],49:[12],50:[118],51:[13],52:[119],53:[120],54:[14],55:[121],56:[15],57:[122],58:[16],59:[123],60:[124],61:[17],62:[125],63:[18],64:[126],65:[127],66:[19],67:[128],68:[20],69:[129],70:[21],71:[130],72:[131],73:[22],74:[132],75:[23],76:[133],77:[134],78:[24],79:[135],80:[25],81:[136],82:[26],83:[137],84:[138],85:[27],86:[139],87:[28],88:[140],89:[141],90:[29],91:[142],92:[30],93:[143],94:[31],95:[144],96:[145],97:[32],98:[146],99:[33],100:[147],101:[148],102:[34],103:[149],104:[35],105:[150],106:[36],107:[151],108:[152]}};var getTypes=async B=>{switch(B){case"flute":return{json:(await __vitePreload(()=>import("./index.9827614a.js"),[])).default,relationship:relationships.flute,height:"60px",styles:{}};case"clarinet":return{json:(await __vitePreload(()=>import("./index.81bcab95.js"),[])).default,relationship:relationships.clarinet,styles:{marginLeft:".4rem",marginRight:".7rem"}};case"trumpet":return{json:(await __vitePreload(()=>import("./index.562e6907.js"),[])).default,relationship:relationships.trumpet};case"horn":return{json:(await __vitePreload(()=>import("./index.677031cc.js"),[])).default,relationship:relationships.horn,height:"212px",width:"252px"};case"tuba":return{json:(await __vitePreload(()=>import("./index.5c50a9f0.js"),[])).default,relationship:relationships.tuba};case"piccolo":return{json:(await __vitePreload(()=>import("./index.f292a388.js"),[])).default,relationship:relationships.piccolo};case"up-bass-horn":return{json:(await __vitePreload(()=>import("./index.50d887bb.js"),[])).default,relationship:relationships.upBassHorn};case"trombone":return{json:(await __vitePreload(()=>import("./index.65d4cb1f.js"),[])).default,relationship:relationships.trombone};case"saxophone":return{json:(await __vitePreload(()=>import("./index.66139d6f.js"),[])).default,relationship:relationships.saxophone,styles:{marginLeft:".2rem",marginRight:".3rem"}};case"small-drum":return{json:(await __vitePreload(()=>import("./index.c980c934.js"),[])).default,relationship:relationships.smallDrum,width:"180px"};case"hulusi-flute":return{json:(await __vitePreload(()=>import("./index.1c832d4b.js"),[])).default,relationship:relationships.hulusi,styles:{marginLeft:".6rem",marginRight:".7rem"}};case"pan-flute":return{json:(await __vitePreload(()=>import("./index.065f17dc.js"),[])).default,relationship:relationships.pan,width:"240px",styles:{marginTop:"auto",marginLeft:".6rem",marginRight:".7rem"}};case"ocarina":return{json:(await __vitePreload(()=>import("./index.b1ee2f73.js"),[])).default,relationship:relationships.ocarina,width:"180px",styles:{marginTop:"auto"}};case"melodica":return{json:(await __vitePreload(()=>import("./index.150cabd9.js"),[])).default,relationship:relationships.melodica,height:"80px",styles:{marginTop:"auto"}};case"ukulele":return{json:(await __vitePreload(()=>import("./index.db14ec83.js"),[])).default,relationship:relationships.ukulele};case"mouthorgan":return{json:(await __vitePreload(()=>import("./index.3b668adc.js"),[])).default,relationship:relationships.mouthorgan};case"piano":return{json:(await __vitePreload(()=>import("./index.b7f1e2a7.js"),[])).default,relationship:relationships.piano};default:return null}};const container="_container_ajal8_1",changeIndex="_changeIndex_ajal8_6",activeopacity="_activeopacity_ajal8_1",leftrotates="_leftrotates_ajal8_1",rightrotates="_rightrotates_ajal8_1";var styles={container,changeIndex,activeopacity,leftrotates,rightrotates};const getImageSize=B=>new Promise((R,F)=>{const D=new Image;D.src=B,D.onload=()=>{R(D)},D.onerror=G=>R(D)}),formatFixedKey=(B,R)=>B==="piccolo"&&state$2.times[0]?ref(R+(1-state$2.times[0].octaveOffset)*12):ref(R),formatRelationship=(B,R)=>{let F=B[R]||B[0]||[];return typeof F[0]=="number"||typeof F[0]=="string"?[F]:typeof F[0]=="object"?F:[[]]},useFingeringSrc=(B,R,F)=>{const D=ref("");return B&&R==="trombone"&&!B.relationship[F]?(D.value=B.json.full2,D):(D.value=B.json.full,D)};var FingeringComponent=defineComponent({name:"fingering",props:{type:{type:String,default:""},fixedKey:{type:Number,default:0},fingeringInfo:{type:Object},loaded:{type:Function,default:()=>{}},viewInfo:{type:Object}},setup(B,{expose:R}){const F=toRefs(B),D=ref(null),G=ref(null),U=ref(0),W=ref(0);return R({container:D,containerWidth:U}),()=>{var K,te,Q,ie,se,ne,re,ae,ce,he,fe,be,ue,ge,ve;if(!((K=F.viewInfo.value)!=null&&K.activeType))return null;const q=formatFixedKey((te=B.fingeringInfo)==null?void 0:te.name,F.fixedKey.value).value,Y=formatRelationship((ie=(Q=F.viewInfo.value)==null?void 0:Q.activeType)==null?void 0:ie.relationship,q||0),J=()=>{let Se=W.value===Y.length-1?0:W.value+1;W.value=Se},Z=Y[W.value]||[];return createVNode("div",{ref:D,class:classNames((se=B.fingeringInfo)==null?void 0:se.name,styles.container),style:{width:((ne=B.fingeringInfo)==null?void 0:ne.direction)==="vertical"?(re=B.fingeringInfo)==null?void 0:re.width:"",height:((ae=B.fingeringInfo)==null?void 0:ae.direction)==="transverse"?((ce=B.fingeringInfo)==null?void 0:ce.height)||"":"100%",display:"flex",paddingLeft:((he=B.fingeringInfo)==null?void 0:he.direction)==="vertical"?(fe=B.fingeringInfo)==null?void 0:fe.paddingLeft:"",paddingRight:((be=B.fingeringInfo)==null?void 0:be.direction)==="vertical"?(ue=B.fingeringInfo)==null?void 0:ue.paddingRight:""}},[Z.includes(0)?createVNode("span",{style:{position:"absolute",top:".5vh",right:".5vw",color:"rgb(1, 193, 181)",fontWeight:"bold"}},[createTextVNode("\u8F6C\u8C03")]):null,createVNode("img",{ref:G,src:(ge=F.viewInfo.value)==null?void 0:ge.fullsrc,style:{width:"auto",maxWidth:"100%",maxHeight:((ve=B.fingeringInfo)==null?void 0:ve.name)=="ukulele"?"110%":"100%"}},null),Z.map((Se,pe)=>{var Ee,de,we,Oe,Me,Pe,Ne,ke;const ye=typeof Se=="string"?Se.replace("active-",""):String(Se);return createVNode("img",{"data-index":ye,style:{position:"absolute",top:((Ee=G.value)==null?void 0:Ee.offsetTop)+"px",left:((de=G.value)==null?void 0:de.offsetLeft)+"px",zIndex:pe,height:((we=G.value)==null?void 0:we.height)+"px",width:((Oe=G.value)==null?void 0:Oe.width)+"px",maxWidth:"100%",maxHeight:((Me=B.fingeringInfo)==null?void 0:Me.name)=="ukulele"?"110%":"100%"},src:(ke=(Ne=(Pe=F.viewInfo.value)==null?void 0:Pe.activeType)==null?void 0:Ne.json)==null?void 0:ke[ye]},null)}),Y.length>1?createVNode("div",{role:"button",onClick:J,class:["substituteFinger",styles.changeIndex]},[createTextVNode("\u66FF\u6307")]):null])}}});const formatdata={Flute:2,Clarinet:4,Trombone:14,Tuba:17,Trumpet:12,Horn:13,AltoSaxophone:6,TenorSaxophone:6,Saxophone:6,UpBassHorn:15,Melodica:137,HulusiFlute:136,PanFlute:135,Ocarina:134,Recorder:120,Ukulele:130,Mouthorgan:140,Piano:150};var formatId=B=>formatdata[B]||-1;const fingeringWidth=ref(0),fingeringStatus=ref("hidden"),fingeringViewInfo=async B=>{const R=B;if(R){const F=await getTypes(R.name);if(F){const D=formatFixedKey(R.name,state$2.fixedKey),G=useFingeringSrc(F,R.name,D.value),{width:U,height:W}=await getImageSize(G.value),q=document.getElementById("colexiu-detail-music-sheet").clientHeight||0,Y=state.evaluatingStatus?0:U,J=q/W;return fingeringWidth.value=q?J*Y:Y,U&&(fingeringStatus.value="show"),reactive({width:U,height:W,scale:J,usedFixedKey:D.value,fullsrc:G.value,activeType:F,detail:R})}}else fingeringStatus.value="hidden"},useFingering=async(B="")=>{const R=ref({}),F=ref({}),D=await fingeringViewInfo(typeById[formatId(B)]);return R.value=(D==null?void 0:D.activeType)||{},F.value=(D==null?void 0:D.detail)||{},[fingeringStatus,fingeringWidth,R,F]},ee=new EventEmitter;let playStartTime=0;class MultipleAudio{constructor(R){this.audios={},this.audioList=[],this.length=0,this.status="init",this.speed=90,this.muted=!1,this.audio=null,this.event=ee,this.currentTime=0,this.duration=0,this.timer=null,this.accelerateRefreshPlayer=()=>{if(this.timer)return;const F=this.currentTime;let D=new Date().getTime();this.timer=setInterval(()=>{this.currentTime=(new Date().getTime()-D)/1e3+F,this.event.emit("timeupdate",this)},10)},this.clearAccelerateRefreshPlayer=()=>{clearInterval(this.timer),this.timer=null},this.setVolume=(F,D)=>{let G=setInterval(()=>{Object.values(this.audios).map(U=>{F?(U.volume-=.01,U.volume<=.01&&(U.volume=0,clearInterval(G),D&&D())):(U.volume+=.01,U.volume>=1&&(U.volume=1,clearInterval(G),D&&D())),console.log(U.volume)})},16.7)},this.setSongs(R)}async setSongs(R){this.audioList=R.filter(G=>!!G).map(G=>G),this.audio=null,this.event.removeAllListeners(),this.audios={};const F=R.filter(G=>!!G).map(async G=>({url:G})),D=await Promise.all(F);for(const G of D){const U=new Audio(G.url);U.load(),this.audios[G.url]=U,this.audio||(this.audio=U)}this.length=F.length,this.audio&&(this.audio.addEventListener("loadedmetadata",G=>{this.setDuration()}),this.audio.addEventListener("timeupdate",G=>{var W;this.currentTime=((W=this.audio)==null?void 0:W.currentTime)||0,this.event.emit("timeupdate",G);let U=!1;this.currentTime===this.duration&&!U&&(U=!0)})),R.length&&(this.status=this.getStatus()),this.event.on("allWaiting",()=>{this.hasWaitng()&&this.event.emit("waiting")}),this.event.on("allPlaying",()=>{this.hasWaitng()||this.event.emit("playing")}),this.syncEvent()}setDuration(R){var D;const F=Object.values(R||this.audios||{});if(F.length){const G=[];for(const W of F){const q=W.duration;q>0&&G.push(q)}const U=Math.floor(Math.max(...G)-Math.min(...G));U>=1&&console.log("\u8BE5\u6559\u7A0B\u539F\u97F3\u4E0E\u4F34\u594F\u65F6\u957F\u8D85\u8FC7"+U+"\u79D2\uFF0C\u8BF7\u4FEE\u6539\u540E\u4F7F\u7528"),this.duration=Math.min(...G),this.duration>0&&((D=this.event)==null||D.emit("loadedmetadata",null,this.duration))}}destroyed(){this.pause(),this.event.removeAllListeners(),this.audio=null,this.audios={}}hasWaitng(){let R=!1;for(const F of Object.values(this.audios))if(F.dataset.status==="waiting"){R=!0;break}return R}syncEvent(){let R=!1;const F=q=>{var Y;R=!1,console.log("\u5F00\u59CB\u89E6\u53D1play\u4E8B\u4EF6",new Date().getTime()),this.event.emit("play",q),((Y=q.target)==null?void 0:Y.src)===this.audioList[0]&&(playStartTime=new Date().getTime())},D=async q=>{var Y;if(await this.pause(),this.event.emit("pause",q),((Y=q.target)==null?void 0:Y.src)===this.audioList[0]){const J=new Date().getTime()-playStartTime;this.event.emit("updatePlayTime",J/1e3)}},G=q=>{this.status==="play"&&(q.target.dataset.status="waiting"),this.event.emit("allWaiting")},U=q=>{q.target.dataset.status="",this.event.emit("allPlaying")},W=async q=>{R||(R=!0,await this.pause());for(const Y in this.audios)Object.prototype.hasOwnProperty.call(this.audios,Y)&&this.event.emit("ended",{target:this.audios[Y]})};for(const q of Object.values(this.audios))q.addEventListener("loadedmetadata",()=>this.setDuration(this.audios)),q.addEventListener("play",F),q.addEventListener("pause",D),q.addEventListener("waiting",G),q.addEventListener("playing",U),q.addEventListener("ended",W)}getStatus(){var R;return this.audio?(R=this.audio)!=null&&R.paused?"pause":"play":"init"}play(R){return this.getStatus()!=="play"?new Promise(F=>{setTimeout(()=>{new Date().getTime(),Object.values(this.audios).map(async(D,G)=>{console.log("play duration",D.duration),await D.play()}),F(this.audios)},R||100)}):(this.status=this.getStatus(),Promise.resolve())}pause(){return this.status=this.getStatus(),Promise.all(Object.values(this.audios).map(async R=>await R.pause())).then(R=>(this.status=this.getStatus(),R))}setMute(R,F){F?this.audios[F]&&(this.audios[F].muted=R):(this.muted=R,Object.values(this.audios).map(D=>D.muted=R))}setSpeed(R,F){F?this.audios[F]&&(this.audios[F].playbackRate=R):(this.speed=R,Object.values(this.audios).map(D=>(D.playbackRate=R,D)))}setCurrentTime(R){this.currentTime=R,Object.values(this.audios).map(F=>F.currentTime=R)}toggleMute(R){R?this.audios[R]&&(this.audios[R].muted=!this.audios[R].muted):(Object.values(this.audios).map(F=>F.muted=!this.muted),this.muted=!this.muted)}async togglePlay(R){if(this.getStatus()==="pause")return await this.play(R);if(this.getStatus()==="play")return this.setMute(!0),await this.pause()}}const search=useOriginSearch(),skpList=["Ukulele"],useXml=async(B,R)=>{let F=ref("");try{const D=await request$1$1(B),G=getCustomInfo(D);if(skpList.includes(G.code))F.value=D;else{F.value=formatXML(G.parsedXML,{title:R.musicSheetName});const U=Number(search["part-index"])||0;F.value=onlyVisible(F.value,U)}}catch{}return F},useMp3s=async B=>{var Y;const F=useOriginSearch()["part-index"]||0,D=(Y=B.background)==null?void 0:Y[F];state.songs={background:encodeURI(B.audioFileUrl||B.metronomeUrl||B.url||""),music:encodeURI((D==null?void 0:D.audioFileUrl)||(D==null?void 0:D.metronomeUrl)||"")},console.log("backgroundUrl",state.songs.background),console.log("musicUrl",state.songs.music),state$2.isAppPlay=B.audioType==="MIDI";let G={skipTick:!1,repeatedBeats:!0,scoreSize:"middle"},U={};state$2.activeDetail={...B,examSongId:B.id,originalSpeed:90,isAppPlay:B.audioType==="MIDI",extConfigJson:{...G}},state$3.sett.hertz=B.aiDefaultFrequency&&parseInt(""+B.aiDefaultFrequency||"440")||440;try{U=JSON.parse((B==null?void 0:B.extConfigJson)||"")}catch{}state$2.activeDetail.extConfigJson={...state$2.activeDetail.extConfigJson,...U};const W=state$2.activeDetail.extConfigJson.scoreSize,q=store_legacy.get("zooms")||{};W&&!q[""+B.id]&&(store_legacy.set("zooms",{...q,[""+B.id]:W}),state$3.sett.scoreSize=W),state$2.needTick=B.audioType==="MP3"&&B.mp3Type==="MP3"||B.audioType==="MIDI",state$2.skipTick=state$2.activeDetail.extConfigJson.skipTick,state$2.repeatedBeats=state$2.activeDetail.extConfigJson.repeatedBeats,state.songs.music||changeMode("background"),state.audiosInstance||(state.audiosInstance=new MultipleAudio(Object.values(state.songs)))},useSpecialShapedScreen=()=>{const B=ref(0);return postMessage({api:"isSpecialShapedScreen"},R=>{const F=R==null?void 0:R.content.notchHeight;state$2.notchHeight=(browser().ios?F*2:F)||((R==null?void 0:R.content.isSpecialShapedScreen)&&browser().ios?100:0),B.value=state$2.notchHeight,state$2.isSpecialShapedScreen=R==null?void 0:R.content.isSpecialShapedScreen}),[B]},useDetail=B=>{const R=getRequestHostname(),F=ref("loading"),D=ref({});return F.value="loading",request.get(`/musicSheet/detail/${B}`,{prefix:R}).then(G=>{useMp3s(G.data),D.value={...G.data},D.value.notation==0&&(state$3.sett.type="staff"),state$2.subjectId=(G.data.musicSubject||"").split(",")[0]||0,window.DYSubjectId=formatId(G.data.code),F.value="success"}).catch(()=>F.value="error"),[F,D]},useSuspendPlay=()=>{listenerMessage("suspendPlay",()=>{state$2.activeTick>-1&&stopTick(),console.log(state.playState),state.playState==="play"&&(resetPlayStatus(),state.evaluatingStatus&&evaluatStopPlay(!1))})};export{NoticeBar as $,state as A,Button as B,getAllNodes as C,getParentNote as D,request$1$1 as E,Fragment as F,Grid as G,getCustomInfo as H,formatXML as I,onlyVisible as J,getBoundingBoxByverticalNote as K,getLeveByScoreMeasure as L,MusicSheet as M,postMessage as N,classNames as O,Popup as P,getVoiceChinesName as Q,truthProp as R,Section as S,Toast as T,createNamespace as U,getSizeStyle as V,addUnit as W,withInstall as X,reactive as Y,store_legacy as Z,__vitePreload as _,useClientType as a,useFingering as a$,event as a0,OpenSheetMusicDisplay as a1,styles$3 as a2,queryString as a3,mergeProps as a4,BackIcon as a5,index as a6,Canvg as a7,PageFormat as a8,Dialog as a9,refreshIndex as aA,iconColse as aB,pause as aC,isVNode as aD,Tabs as aE,Tab as aF,typeById as aG,FingeringComponent as aH,formatId as aI,getTypes as aJ,formatFixedKey as aK,useFingeringSrc as aL,getImageSize as aM,CellGroup as aN,Cell as aO,modelType as aP,useDetail as aQ,event$1 as aR,useUser as aS,useSuspendPlay as aT,Buttons as aU,SoundEffect as aV,HelperPopup as aW,useFee as aX,changeSpeed as aY,setAudioInit as aZ,restPromptMain as a_,startRun as aa,getCurrentInstance as ab,computed as ac,inBrowser$1 as ad,onBeforeUnmount as ae,withDirectives as af,resolveDirective as ag,isDef$1 as ah,Icon as ai,useXml as aj,nextTick as ak,svgtopng as al,Transition as am,changeMode as an,getDuration as ao,useWiredHeadsetCheck as ap,onUnmounted as aq,setPlayState as ar,styles$4 as as,evaluatingRef as at,startButtonShow as au,ButtonIcon as av,Teleport as aw,setCurrentTime as ax,ended as ay,permissionPopup as az,useOriginSearch as b,lodash as b$,onChangeModelType as b0,stopTick as b1,useScrollParent as b2,onUpdated as b3,useEventListener as b4,useTabStatus as b5,useRect as b6,isHidden as b7,Loading as b8,useExpose as b9,setCaptureMode as bA,clearIntervalTimeline as bB,getNoteByMeasuresSlursStart as bC,listenerMessage as bD,removeListenerMessage as bE,getLeveByScore as bF,Switch as bG,noteClick as bH,sectionChange as bI,Speed as bJ,EventEmitter as bK,setPrefix as bL,useReload as bM,noop$4 as bN,relationships as bO,getVoicePartInfo as bP,MultipleAudio as bQ,idIsInClassIds as bR,appoggianceFormate as bS,useParent as bT,useChildren as bU,unitToPx as bV,BORDER_UNSET_TOP_BOTTOM as bW,useClickAway as bX,getZIndexStyle as bY,vShow as bZ,fieldProps as b_,getRandomKey as ba,setTongjiTag as bb,cancelRaf as bc,raf$2 as bd,isObject$1 as be,useTouch as bf,SwipeItem as bg,preventDefault as bh,clamp as bi,unknownProp as bj,useWindowSize as bk,pick as bl,Swipe as bm,callInterceptor as bn,extend$2 as bo,mountComponent as bp,usePopupState as bq,Field as br,getTvIconUrl as bs,getEnvHostname as bt,score as bu,Popover as bv,Player as bw,changeAllMode as bx,resetPlayStatus as by,getFixTime as bz,createVNode as c,toNext as c0,Sticky as c1,Vex as c2,defineComponent as d,getPlatform as e,browser as f,getRequestHostname as g,resolveComponent as h,createRouter as i,createWebHistory as j,formatZoom as k,close$1 as l,createApp as m,ref as n,onMounted as o,promisefiyPostMessage as p,GridItem as q,request as r,state$4 as s,toRefs as t,useRoute$1 as u,createTextVNode as v,watch as w,useSpecialShapedScreen as x,state$2 as y,state$3 as z};