@vue-skuilder/cli 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +8 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/studio.d.ts +3 -0
- package/dist/commands/studio.d.ts.map +1 -0
- package/dist/commands/studio.js +396 -0
- package/dist/commands/studio.js.map +1 -0
- package/dist/commands/unpack.d.ts +3 -0
- package/dist/commands/unpack.d.ts.map +1 -0
- package/dist/commands/unpack.js +228 -0
- package/dist/commands/unpack.js.map +1 -0
- package/dist/studio-ui-assets/assets/BrowseView-BJbixGOU.js +2 -0
- package/dist/studio-ui-assets/assets/BrowseView-BJbixGOU.js.map +1 -0
- package/dist/studio-ui-assets/assets/BrowseView-CM4HBO4j.css +1 -0
- package/dist/studio-ui-assets/assets/BulkImportView-DB6DYDJU.js +2 -0
- package/dist/studio-ui-assets/assets/BulkImportView-DB6DYDJU.js.map +1 -0
- package/dist/studio-ui-assets/assets/BulkImportView-g4wQUfPA.css +1 -0
- package/dist/studio-ui-assets/assets/CourseEditorView-BIlhlhw1.js +2 -0
- package/dist/studio-ui-assets/assets/CourseEditorView-BIlhlhw1.js.map +1 -0
- package/dist/studio-ui-assets/assets/CourseEditorView-WuPNLVKp.css +1 -0
- package/dist/studio-ui-assets/assets/CreateCardView-CyNOKCkm.css +1 -0
- package/dist/studio-ui-assets/assets/CreateCardView-DPjPvzzt.js +2 -0
- package/dist/studio-ui-assets/assets/CreateCardView-DPjPvzzt.js.map +1 -0
- package/dist/studio-ui-assets/assets/edit-ui.es-DiUxqbgF.js +330 -0
- package/dist/studio-ui-assets/assets/edit-ui.es-DiUxqbgF.js.map +1 -0
- package/dist/studio-ui-assets/assets/index--zY88pg6.css +14 -0
- package/dist/studio-ui-assets/assets/index-BnAv1C72.js +287 -0
- package/dist/studio-ui-assets/assets/index-BnAv1C72.js.map +1 -0
- package/dist/studio-ui-assets/assets/index-DHMXQY3-.js +192 -0
- package/dist/studio-ui-assets/assets/index-DHMXQY3-.js.map +1 -0
- package/dist/studio-ui-assets/assets/materialdesignicons-webfont-B7mPwVP_.ttf +0 -0
- package/dist/studio-ui-assets/assets/materialdesignicons-webfont-CSr8KVlo.eot +0 -0
- package/dist/studio-ui-assets/assets/materialdesignicons-webfont-Dp5v-WZN.woff2 +0 -0
- package/dist/studio-ui-assets/assets/materialdesignicons-webfont-PXm3-2wK.woff +0 -0
- package/dist/studio-ui-assets/assets/vue-DZcMATiC.js +28 -0
- package/dist/studio-ui-assets/assets/vue-DZcMATiC.js.map +1 -0
- package/dist/studio-ui-assets/assets/vuetify-qg7mRxy_.js +6 -0
- package/dist/studio-ui-assets/assets/vuetify-qg7mRxy_.js.map +1 -0
- package/dist/studio-ui-assets/index.html +16 -0
- package/dist/utils/NodeFileSystemAdapter.d.ts +14 -0
- package/dist/utils/NodeFileSystemAdapter.d.ts.map +1 -0
- package/dist/utils/NodeFileSystemAdapter.js +55 -0
- package/dist/utils/NodeFileSystemAdapter.js.map +1 -0
- package/dist/utils/template.d.ts +1 -1
- package/dist/utils/template.d.ts.map +1 -1
- package/dist/utils/template.js +19 -5
- package/dist/utils/template.js.map +1 -1
- package/package.json +7 -4
- package/src/cli.ts +8 -0
- package/src/commands/studio.ts +497 -0
- package/src/commands/unpack.ts +259 -0
- package/src/utils/NodeFileSystemAdapter.ts +72 -0
- package/src/utils/template.ts +26 -7
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DHMXQY3-.js","assets/vue-DZcMATiC.js","assets/vuetify-qg7mRxy_.js","assets/index--zY88pg6.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{S as Jt,c as Vn,d as x4,N as To,v as b7,F as pr,D as di,i as y7,b as Wb,T as w7,e as k4,f as S7,h as yu,Q as pi,l as C7,s as x7,j as k7,A as Gb,R as zh,u as $n,k as Wn,m as M7,U as cu,n as E7,o as A7}from"./index-DHMXQY3-.js";import{h as qr,X as vt,an as Rr,aj as st,ao as St,am as br,m as ft,Q as Yt,ak as pt,ai as _t,V as ir,F as Gr,as as Ai,ap as lh,U as su,aq as Yb,at as M4,N as T7,c as Nr,d as Qt,w as E4,x as oa,av as I7,R as Hh,A as P7,q as A4,H as N7,W as L7,ar as Hn}from"./vue-DZcMATiC.js";import{V as T4}from"./index-BnAv1C72.js";const rw=t=>parseFloat(t),nw=t=>parseInt(t,10),vu={string:{databaseConverter:t=>t,previewConverter:t=>t},chess_puzzle:{databaseConverter:t=>t,previewConverter:t=>t},number:{databaseConverter:rw,previewConverter:rw},int:{databaseConverter:nw,previewConverter:nw},image:{databaseConverter:t=>t,previewConverter:t=>t?t.data:new Blob},audio:{databaseConverter:t=>t,previewConverter:t=>t?t.data:new Blob},midi:{databaseConverter:t=>t,previewConverter:t=>t},markdown:{databaseConverter:t=>t,previewConverter:t=>t},uploads:{databaseConverter:t=>t,previewConverter:t=>t}},gh={tagIdentifier:"tags:",eloIdentifier:"elo:"},O7=`
|
|
3
|
+
---
|
|
4
|
+
---
|
|
5
|
+
`;function D7(t,r=gh){const a=t.trim();if(!a)return null;const l=a.split(`
|
|
6
|
+
`);let u=[],c;const f=[...l];let p=0;const y=r.tagIdentifier||gh.tagIdentifier,S=r.eloIdentifier||gh.eloIdentifier;for(let M=l.length-1;M>=0&&M>=l.length-2;M--){const w=l[M].trim();if(w.toLowerCase().startsWith(y.toLowerCase()))u=w.substring(y.length).split(",").map(_=>_.trim()).filter(_=>_),p++;else if(w.toLowerCase().startsWith(S.toLowerCase())){const _=w.substring(S.length).trim(),C=parseInt(_,10);isNaN(C)||(c=C),p++}}p>0&&f.splice(f.length-p);const A=f.join(`
|
|
7
|
+
`).trim();return A?{markdown:A,tags:u,elo:c}:null}function I4(t){return t.split(O7).map(r=>r.trim()).filter(r=>r)}function R7(t,r=gh){const a=I4(t),l=[];for(const u of a){const c=D7(u,r);c&&l.push(c)}return l}function B7(t){const r=I4(t);return r.length>0&&r.some(a=>!!a.trim())}function F7(t){return r=>{const a=t(r);return a.status===Jt.ok?!0:a.msg}}var q7=Object.defineProperty,z7=(t,r,a)=>r in t?q7(t,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[r]=a,lt=(t,r,a)=>z7(t,typeof r!="symbol"?r+"":r,a),uh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function H7(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var r=t.default;if(typeof r=="function"){var a=function l(){return this instanceof l?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};a.prototype=r.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(t).forEach(function(l){var u=Object.getOwnPropertyDescriptor(t,l);Object.defineProperty(a,l,u.get?u:{enumerable:!0,get:function(){return t[l]}})}),a}var q0={exports:{}};/**
|
|
8
|
+
* @license
|
|
9
|
+
* Lodash <https://lodash.com/>
|
|
10
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
11
|
+
* Released under MIT license <https://lodash.com/license>
|
|
12
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
13
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
14
|
+
*/var V7=q0.exports,iw;function U7(){return iw||(iw=1,function(t,r){(function(){var a,l="4.17.21",u=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",f="Expected a function",p="Invalid `variable` option passed into `_.template`",y="__lodash_hash_undefined__",S=500,A="__lodash_placeholder__",M=1,w=2,_=4,C=1,m=2,T=1,L=2,N=4,B=8,W=16,G=32,R=64,ye=128,q=256,se=512,ve=30,he="...",ce=800,de=16,K=1,Q=2,le=3,Ee=1/0,Me=9007199254740991,H=17976931348623157e292,Y=NaN,X=4294967295,xe=X-1,De=X>>>1,$e=[["ary",ye],["bind",T],["bindKey",L],["curry",B],["curryRight",W],["flip",se],["partial",G],["partialRight",R],["rearg",q]],Re="[object Arguments]",ut="[object Array]",Lt="[object AsyncFunction]",it="[object Boolean]",Ct="[object Date]",It="[object DOMException]",at="[object Error]",Gt="[object Function]",Dt="[object GeneratorFunction]",ct="[object Map]",gr="[object Number]",vr="[object Null]",er="[object Object]",Cr="[object Promise]",Wr="[object Proxy]",kr="[object RegExp]",Ue="[object Set]",Je="[object String]",Ye="[object Symbol]",Qe="[object Undefined]",rt="[object WeakMap]",o="[object WeakSet]",h="[object ArrayBuffer]",b="[object DataView]",x="[object Float32Array]",E="[object Float64Array]",I="[object Int8Array]",F="[object Int16Array]",D="[object Int32Array]",z="[object Uint8Array]",U="[object Uint8ClampedArray]",J="[object Uint16Array]",te="[object Uint32Array]",ee=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,pe=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ie=/&(?:amp|lt|gt|quot|#39);/g,fe=/[&<>"']/g,ne=RegExp(ie.source),ae=RegExp(fe.source),Z=/<%-([\s\S]+?)%>/g,ue=/<%([\s\S]+?)%>/g,me=/<%=([\s\S]+?)%>/g,we=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ge=/^\w*$/,Ae=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ie=/[\\^$.*+?()[\]{}|]/g,Oe=RegExp(Ie.source),qe=/^\s+/,Pe=/\s/,Fe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ve=/\{\n\/\* \[wrapped with (.+)\] \*/,Ke=/,? & /,Xe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,je=/[()=,{}\[\]\/\s]/,gt=/\\(\\)?/g,xt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Mt=/\w*$/,Bt=/^[-+]0x[0-9a-f]+$/i,ot=/^0b[01]+$/i,ht=/^\[object .+?Constructor\]$/,Tt=/^0o[0-7]+$/i,zt=/^(?:0|[1-9]\d*)$/,Ft=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zt=/($^)/,rr=/['\n\r\u2028\u2029\\]/g,sr="\\ud800-\\udfff",fr="\\u0300-\\u036f",ur="\\ufe20-\\ufe2f",ln="\\u20d0-\\u20ff",sn=fr+ur+ln,gn="\\u2700-\\u27bf",Et="a-z\\xdf-\\xf6\\xf8-\\xff",Lr="\\xac\\xb1\\xd7\\xf7",Br="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Gn="\\u2000-\\u206f",vn=" \\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",On="A-Z\\xc0-\\xd6\\xd8-\\xde",Ti="\\ufe0e\\ufe0f",Zn=Lr+Br+Gn+vn,Pn="['’]",Yn="["+sr+"]",Nn="["+Zn+"]",an="["+sn+"]",jr="\\d+",ca="["+gn+"]",Os="["+Et+"]",ha="[^"+sr+Zn+jr+gn+Et+On+"]",ws="\\ud83c[\\udffb-\\udfff]",Fo="(?:"+an+"|"+ws+")",fa="[^"+sr+"]",bi="(?:\\ud83c[\\udde6-\\uddff]){2}",Zi="[\\ud800-\\udbff][\\udc00-\\udfff]",Dn="["+On+"]",as="\\u200d",yi="(?:"+Os+"|"+ha+")",mr="(?:"+Dn+"|"+ha+")",gi="(?:"+Pn+"(?:d|ll|m|re|s|t|ve))?",Kn="(?:"+Pn+"(?:D|LL|M|RE|S|T|VE))?",vi=Fo+"?",jn="["+Ti+"]?",Ss="(?:"+as+"(?:"+[fa,bi,Zi].join("|")+")"+jn+vi+")*",Na="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",La="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",g=jn+vi+Ss,P="(?:"+[ca,bi,Zi].join("|")+")"+g,re="(?:"+[fa+an+"?",an,bi,Zi,Yn].join("|")+")",_e=RegExp(Pn,"g"),Le=RegExp(an,"g"),Ze=RegExp(ws+"(?="+ws+")|"+re+g,"g"),tt=RegExp([Dn+"?"+Os+"+"+gi+"(?="+[Nn,Dn,"$"].join("|")+")",mr+"+"+Kn+"(?="+[Nn,Dn+yi,"$"].join("|")+")",Dn+"?"+yi+"+"+gi,Dn+"+"+Kn,La,Na,jr,P].join("|"),"g"),kt=RegExp("["+as+sr+sn+Ti+"]"),Nt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,_r=["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"],cr=-1,Ut={};Ut[x]=Ut[E]=Ut[I]=Ut[F]=Ut[D]=Ut[z]=Ut[U]=Ut[J]=Ut[te]=!0,Ut[Re]=Ut[ut]=Ut[h]=Ut[it]=Ut[b]=Ut[Ct]=Ut[at]=Ut[Gt]=Ut[ct]=Ut[gr]=Ut[er]=Ut[kr]=Ut[Ue]=Ut[Je]=Ut[rt]=!1;var jt={};jt[Re]=jt[ut]=jt[h]=jt[b]=jt[it]=jt[Ct]=jt[x]=jt[E]=jt[I]=jt[F]=jt[D]=jt[ct]=jt[gr]=jt[er]=jt[kr]=jt[Ue]=jt[Je]=jt[Ye]=jt[z]=jt[U]=jt[J]=jt[te]=!0,jt[at]=jt[Gt]=jt[rt]=!1;var Ds={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Cs={"&":"&","<":"<",">":">",'"':""","'":"'"},Rs={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ii={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},xs=parseFloat,Ou=parseInt,qo=typeof uh=="object"&&uh&&uh.Object===Object&&uh,zo=typeof self=="object"&&self&&self.Object===Object&&self,Or=qo||zo||Function("return this")(),Oa=r&&!r.nodeType&&r,mi=Oa&&!0&&t&&!t.nodeType&&t,tl=mi&&mi.exports===Oa,da=tl&&qo.process,un=function(){try{var Ce=mi&&mi.require&&mi.require("util").types;return Ce||da&&da.binding&&da.binding("util")}catch{}}(),pa=un&&un.isArrayBuffer,ks=un&&un.isDate,ga=un&&un.isMap,Ho=un&&un.isRegExp,os=un&&un.isSet,Vo=un&&un.isTypedArray;function wr(Ce,Be,Ne){switch(Ne.length){case 0:return Ce.call(Be);case 1:return Ce.call(Be,Ne[0]);case 2:return Ce.call(Be,Ne[0],Ne[1]);case 3:return Ce.call(Be,Ne[0],Ne[1],Ne[2])}return Ce.apply(Be,Ne)}function Du(Ce,Be,Ne,Se){for(var Te=-1,Ge=Ce==null?0:Ce.length;++Te<Ge;){var et=Ce[Te];Be(Se,et,Ne(et),Ce)}return Se}function Jr(Ce,Be){for(var Ne=-1,Se=Ce==null?0:Ce.length;++Ne<Se&&Be(Ce[Ne],Ne,Ce)!==!1;);return Ce}function va(Ce,Be){for(var Ne=Ce==null?0:Ce.length;Ne--&&Be(Ce[Ne],Ne,Ce)!==!1;);return Ce}function rl(Ce,Be){for(var Ne=-1,Se=Ce==null?0:Ce.length;++Ne<Se;)if(!Be(Ce[Ne],Ne,Ce))return!1;return!0}function Jn(Ce,Be){for(var Ne=-1,Se=Ce==null?0:Ce.length,Te=0,Ge=[];++Ne<Se;){var et=Ce[Ne];Be(et,Ne,Ce)&&(Ge[Te++]=et)}return Ge}function Bs(Ce,Be){var Ne=Ce==null?0:Ce.length;return!!Ne&&Pi(Ce,Be,0)>-1}function Da(Ce,Be,Ne){for(var Se=-1,Te=Ce==null?0:Ce.length;++Se<Te;)if(Ne(Be,Ce[Se]))return!0;return!1}function hr(Ce,Be){for(var Ne=-1,Se=Ce==null?0:Ce.length,Te=Array(Se);++Ne<Se;)Te[Ne]=Be(Ce[Ne],Ne,Ce);return Te}function ei(Ce,Be){for(var Ne=-1,Se=Be.length,Te=Ce.length;++Ne<Se;)Ce[Te+Ne]=Be[Ne];return Ce}function Ra(Ce,Be,Ne,Se){var Te=-1,Ge=Ce==null?0:Ce.length;for(Se&&Ge&&(Ne=Ce[++Te]);++Te<Ge;)Ne=Be(Ne,Ce[Te],Te,Ce);return Ne}function Ru(Ce,Be,Ne,Se){var Te=Ce==null?0:Ce.length;for(Se&&Te&&(Ne=Ce[--Te]);Te--;)Ne=Be(Ne,Ce[Te],Te,Ce);return Ne}function Ba(Ce,Be){for(var Ne=-1,Se=Ce==null?0:Ce.length;++Ne<Se;)if(Be(Ce[Ne],Ne,Ce))return!0;return!1}var Fs=_a("length");function Ln(Ce){return Ce.split("")}function gu(Ce){return Ce.match(Xe)||[]}function qs(Ce,Be,Ne){var Se;return Ne(Ce,function(Te,Ge,et){if(Be(Te,Ge,et))return Se=Ge,!1}),Se}function zs(Ce,Be,Ne,Se){for(var Te=Ce.length,Ge=Ne+(Se?1:-1);Se?Ge--:++Ge<Te;)if(Be(Ce[Ge],Ge,Ce))return Ge;return-1}function Pi(Ce,Be,Ne){return Be===Be?sl(Ce,Be,Ne):zs(Ce,ma,Ne)}function Bu(Ce,Be,Ne,Se){for(var Te=Ne-1,Ge=Ce.length;++Te<Ge;)if(Se(Ce[Te],Be))return Te;return-1}function ma(Ce){return Ce!==Ce}function Ms(Ce,Be){var Ne=Ce==null?0:Ce.length;return Ne?ya(Ce,Be)/Ne:Y}function _a(Ce){return function(Be){return Be==null?a:Be[Ce]}}function ba(Ce){return function(Be){return Ce==null?a:Ce[Be]}}function Ir(Ce,Be,Ne,Se,Te){return Te(Ce,function(Ge,et,mt){Ne=Se?(Se=!1,Ge):Be(Ne,Ge,et,mt)}),Ne}function nl(Ce,Be){var Ne=Ce.length;for(Ce.sort(Be);Ne--;)Ce[Ne]=Ce[Ne].value;return Ce}function ya(Ce,Be){for(var Ne,Se=-1,Te=Ce.length;++Se<Te;){var Ge=Be(Ce[Se]);Ge!==a&&(Ne=Ne===a?Ge:Ne+Ge)}return Ne}function wa(Ce,Be){for(var Ne=-1,Se=Array(Ce);++Ne<Ce;)Se[Ne]=Be(Ne);return Se}function Rn(Ce,Be){return hr(Be,function(Ne){return[Ne,Ce[Ne]]})}function ji(Ce){return Ce&&Ce.slice(0,za(Ce)+1).replace(qe,"")}function Kt(Ce){return function(Be){return Ce(Be)}}function Hs(Ce,Be){return hr(Be,function(Ne){return Ce[Ne]})}function zr(Ce,Be){return Ce.has(Be)}function Sa(Ce,Be){for(var Ne=-1,Se=Ce.length;++Ne<Se&&Pi(Be,Ce[Ne],0)>-1;);return Ne}function ls(Ce,Be){for(var Ne=Ce.length;Ne--&&Pi(Be,Ce[Ne],0)>-1;);return Ne}function xn(Ce,Be){for(var Ne=Ce.length,Se=0;Ne--;)Ce[Ne]===Be&&++Se;return Se}var us=ba(Ds),Uo=ba(Cs);function Fu(Ce){return"\\"+Ii[Ce]}function il(Ce,Be){return Ce==null?a:Ce[Be]}function Bi(Ce){return kt.test(Ce)}function Fi(Ce){return Nt.test(Ce)}function Fa(Ce){for(var Be,Ne=[];!(Be=Ce.next()).done;)Ne.push(Be.value);return Ne}function cs(Ce){var Be=-1,Ne=Array(Ce.size);return Ce.forEach(function(Se,Te){Ne[++Be]=[Te,Se]}),Ne}function qa(Ce,Be){return function(Ne){return Ce(Be(Ne))}}function Xn(Ce,Be){for(var Ne=-1,Se=Ce.length,Te=0,Ge=[];++Ne<Se;){var et=Ce[Ne];(et===Be||et===A)&&(Ce[Ne]=A,Ge[Te++]=Ne)}return Ge}function Es(Ce){var Be=-1,Ne=Array(Ce.size);return Ce.forEach(function(Se){Ne[++Be]=Se}),Ne}function Qn(Ce){var Be=-1,Ne=Array(Ce.size);return Ce.forEach(function(Se){Ne[++Be]=[Se,Se]}),Ne}function sl(Ce,Be,Ne){for(var Se=Ne-1,Te=Ce.length;++Se<Te;)if(Ce[Se]===Be)return Se;return-1}function qu(Ce,Be,Ne){for(var Se=Ne+1;Se--;)if(Ce[Se]===Be)return Se;return Se}function qi(Ce){return Bi(Ce)?Ha(Ce):Fs(Ce)}function cn(Ce){return Bi(Ce)?al(Ce):Ln(Ce)}function za(Ce){for(var Be=Ce.length;Be--&&Pe.test(Ce.charAt(Be)););return Be}var zu=ba(Rs);function Ha(Ce){for(var Be=Ze.lastIndex=0;Ze.test(Ce);)++Be;return Be}function al(Ce){return Ce.match(Ze)||[]}function Hu(Ce){return Ce.match(tt)||[]}var Vu=function Ce(Be){Be=Be==null?Or:Ni.defaults(Or.Object(),Be,Ni.pick(Or,_r));var Ne=Be.Array,Se=Be.Date,Te=Be.Error,Ge=Be.Function,et=Be.Math,mt=Be.Object,or=Be.RegExp,dr=Be.String,ar=Be.TypeError,Bn=Ne.prototype,Vs=Ge.prototype,wi=mt.prototype,Ji=Be["__core-js_shared__"],Us=Vs.toString,nr=wi.hasOwnProperty,af=0,Uu=function(){var e=/[^.]+$/.exec(Ji&&Ji.keys&&Ji.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Va=wi.toString,of=Us.call(mt),lf=Or._,uf=or("^"+Us.call(nr).replace(Ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ua=tl?Be.Buffer:a,Si=Be.Symbol,$a=Be.Uint8Array,$u=Ua?Ua.allocUnsafe:a,Wa=qa(mt.getPrototypeOf,mt),Wu=mt.create,Gu=wi.propertyIsEnumerable,Ga=Bn.splice,Yu=Si?Si.isConcatSpreadable:a,$s=Si?Si.iterator:a,zi=Si?Si.toStringTag:a,Ya=function(){try{var e=Wi(mt,"defineProperty");return e({},"",{}),e}catch{}}(),cf=Be.clearTimeout!==Or.clearTimeout&&Be.clearTimeout,hf=Se&&Se.now!==Or.Date.now&&Se.now,ff=Be.setTimeout!==Or.setTimeout&&Be.setTimeout,Ka=et.ceil,Xa=et.floor,ol=mt.getOwnPropertySymbols,df=Ua?Ua.isBuffer:a,Ku=Be.isFinite,pf=Bn.join,gf=qa(mt.keys,mt),Pr=et.max,Ur=et.min,vf=Se.now,mf=Be.parseInt,Xu=et.random,_f=Bn.reverse,ll=Wi(Be,"DataView"),Ws=Wi(Be,"Map"),ul=Wi(Be,"Promise"),hs=Wi(Be,"Set"),Gs=Wi(Be,"WeakMap"),Ys=Wi(mt,"create"),Qa=Gs&&new Gs,fs={},bf=Gi(ll),yf=Gi(Ws),wf=Gi(ul),Sf=Gi(hs),Cf=Gi(Gs),Za=Si?Si.prototype:a,Ks=Za?Za.valueOf:a,Qu=Za?Za.toString:a;function V(e){if(Sr(e)&&!Pt(e)&&!(e instanceof $t)){if(e instanceof mn)return e;if(nr.call(e,"__wrapped__"))return Zc(e)}return new mn(e)}var ds=function(){function e(){}return function(n){if(!yr(n))return{};if(Wu)return Wu(n);e.prototype=n;var d=new e;return e.prototype=a,d}}();function ja(){}function mn(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=a}V.templateSettings={escape:Z,evaluate:ue,interpolate:me,variable:"",imports:{_:V}},V.prototype=ja.prototype,V.prototype.constructor=V,mn.prototype=ds(ja.prototype),mn.prototype.constructor=mn;function $t(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=X,this.__views__=[]}function xf(){var e=new $t(this.__wrapped__);return e.__actions__=en(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=en(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=en(this.__views__),e}function kf(){if(this.__filtered__){var e=new $t(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Mf(){var e=this.__wrapped__.value(),n=this.__dir__,d=Pt(e),k=n<0,O=d?e.length:0,$=Fd(0,O,this.__views__),oe=$.start,be=$.end,ke=be-oe,ze=k?be:oe-1,He=this.__iteratees__,We=He.length,nt=0,dt=Ur(ke,this.__takeCount__);if(!d||!k&&O==ke&&dt==ke)return yc(e,this.__actions__);var yt=[];e:for(;ke--&&nt<dt;){ze+=n;for(var Rt=-1,wt=e[ze];++Rt<We;){var Ht=He[Rt],Wt=Ht.iteratee,dn=Ht.type,Zr=Wt(wt);if(dn==Q)wt=Zr;else if(!Zr){if(dn==K)continue e;break e}}yt[nt++]=wt}return yt}$t.prototype=ds(ja.prototype),$t.prototype.constructor=$t;function Hi(e){var n=-1,d=e==null?0:e.length;for(this.clear();++n<d;){var k=e[n];this.set(k[0],k[1])}}function Ef(){this.__data__=Ys?Ys(null):{},this.size=0}function Af(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}function Tf(e){var n=this.__data__;if(Ys){var d=n[e];return d===y?a:d}return nr.call(n,e)?n[e]:a}function If(e){var n=this.__data__;return Ys?n[e]!==a:nr.call(n,e)}function Pf(e,n){var d=this.__data__;return this.size+=this.has(e)?0:1,d[e]=Ys&&n===a?y:n,this}Hi.prototype.clear=Ef,Hi.prototype.delete=Af,Hi.prototype.get=Tf,Hi.prototype.has=If,Hi.prototype.set=Pf;function ti(e){var n=-1,d=e==null?0:e.length;for(this.clear();++n<d;){var k=e[n];this.set(k[0],k[1])}}function Nf(){this.__data__=[],this.size=0}function Lf(e){var n=this.__data__,d=Ja(n,e);if(d<0)return!1;var k=n.length-1;return d==k?n.pop():Ga.call(n,d,1),--this.size,!0}function Of(e){var n=this.__data__,d=Ja(n,e);return d<0?a:n[d][1]}function Df(e){return Ja(this.__data__,e)>-1}function Rf(e,n){var d=this.__data__,k=Ja(d,e);return k<0?(++this.size,d.push([e,n])):d[k][1]=n,this}ti.prototype.clear=Nf,ti.prototype.delete=Lf,ti.prototype.get=Of,ti.prototype.has=Df,ti.prototype.set=Rf;function ri(e){var n=-1,d=e==null?0:e.length;for(this.clear();++n<d;){var k=e[n];this.set(k[0],k[1])}}function Bf(){this.size=0,this.__data__={hash:new Hi,map:new(Ws||ti),string:new Hi}}function Ff(e){var n=ho(this,e).delete(e);return this.size-=n?1:0,n}function qf(e){return ho(this,e).get(e)}function zf(e){return ho(this,e).has(e)}function Hf(e,n){var d=ho(this,e),k=d.size;return d.set(e,n),this.size+=d.size==k?0:1,this}ri.prototype.clear=Bf,ri.prototype.delete=Ff,ri.prototype.get=qf,ri.prototype.has=zf,ri.prototype.set=Hf;function Vi(e){var n=-1,d=e==null?0:e.length;for(this.__data__=new ri;++n<d;)this.add(e[n])}function Vf(e){return this.__data__.set(e,y),this}function Uf(e){return this.__data__.has(e)}Vi.prototype.add=Vi.prototype.push=Vf,Vi.prototype.has=Uf;function En(e){var n=this.__data__=new ti(e);this.size=n.size}function $f(){this.__data__=new ti,this.size=0}function Wf(e){var n=this.__data__,d=n.delete(e);return this.size=n.size,d}function Gf(e){return this.__data__.get(e)}function Yf(e){return this.__data__.has(e)}function Kf(e,n){var d=this.__data__;if(d instanceof ti){var k=d.__data__;if(!Ws||k.length<u-1)return k.push([e,n]),this.size=++d.size,this;d=this.__data__=new ri(k)}return d.set(e,n),this.size=d.size,this}En.prototype.clear=$f,En.prototype.delete=Wf,En.prototype.get=Gf,En.prototype.has=Yf,En.prototype.set=Kf;function Zu(e,n){var d=Pt(e),k=!d&&Yi(e),O=!d&&!k&&Ei(e),$=!d&&!k&&!O&&ms(e),oe=d||k||O||$,be=oe?wa(e.length,dr):[],ke=be.length;for(var ze in e)(n||nr.call(e,ze))&&!(oe&&(ze=="length"||O&&(ze=="offset"||ze=="parent")||$&&(ze=="buffer"||ze=="byteLength"||ze=="byteOffset")||ai(ze,ke)))&&be.push(ze);return be}function ju(e){var n=e.length;return n?e[yl(0,n-1)]:a}function Xf(e,n){return fo(en(e),Ui(n,0,e.length))}function Qf(e){return fo(en(e))}function cl(e,n,d){(d!==a&&!An(e[n],d)||d===a&&!(n in e))&&ni(e,n,d)}function Xs(e,n,d){var k=e[n];(!(nr.call(e,n)&&An(k,d))||d===a&&!(n in e))&&ni(e,n,d)}function Ja(e,n){for(var d=e.length;d--;)if(An(e[d][0],n))return d;return-1}function Zf(e,n,d,k){return Ci(e,function(O,$,oe){n(k,O,d(O),oe)}),k}function Ju(e,n){return e&&qn(n,Dr(n),e)}function jf(e,n){return e&&qn(n,rn(n),e)}function ni(e,n,d){n=="__proto__"&&Ya?Ya(e,n,{configurable:!0,enumerable:!0,value:d,writable:!0}):e[n]=d}function hl(e,n){for(var d=-1,k=n.length,O=Ne(k),$=e==null;++d<k;)O[d]=$?a:Wl(e,n[d]);return O}function Ui(e,n,d){return e===e&&(d!==a&&(e=e<=d?e:d),n!==a&&(e=e>=n?e:n)),e}function _n(e,n,d,k,O,$){var oe,be=n&M,ke=n&w,ze=n&_;if(d&&(oe=O?d(e,k,O,$):d(e)),oe!==a)return oe;if(!yr(e))return e;var He=Pt(e);if(He){if(oe=zd(e),!be)return en(e,oe)}else{var We=$r(e),nt=We==Gt||We==Dt;if(Ei(e))return Cc(e,be);if(We==er||We==Re||nt&&!O){if(oe=ke||nt?{}:Vc(e),!be)return ke?Td(e,jf(oe,e)):Ad(e,Ju(oe,e))}else{if(!jt[We])return O?e:{};oe=Hd(e,We,be)}}$||($=new En);var dt=$.get(e);if(dt)return dt;$.set(e,oe),m0(e)?e.forEach(function(wt){oe.add(_n(wt,n,d,wt,e,$))}):g0(e)&&e.forEach(function(wt,Ht){oe.set(Ht,_n(wt,n,d,Ht,e,$))});var yt=ze?ke?Pl:Il:ke?rn:Dr,Rt=He?a:yt(e);return Jr(Rt||e,function(wt,Ht){Rt&&(Ht=wt,wt=e[Ht]),Xs(oe,Ht,_n(wt,n,d,Ht,e,$))}),oe}function Jf(e){var n=Dr(e);return function(d){return ec(d,e,n)}}function ec(e,n,d){var k=d.length;if(e==null)return!k;for(e=mt(e);k--;){var O=d[k],$=n[O],oe=e[O];if(oe===a&&!(O in e)||!$(oe))return!1}return!0}function tc(e,n,d){if(typeof e!="function")throw new ar(f);return ra(function(){e.apply(a,d)},n)}function Qs(e,n,d,k){var O=-1,$=Bs,oe=!0,be=e.length,ke=[],ze=n.length;if(!be)return ke;d&&(n=hr(n,Kt(d))),k?($=Da,oe=!1):n.length>=u&&($=zr,oe=!1,n=new Vi(n));e:for(;++O<be;){var He=e[O],We=d==null?He:d(He);if(He=k||He!==0?He:0,oe&&We===We){for(var nt=ze;nt--;)if(n[nt]===We)continue e;ke.push(He)}else $(n,We,k)||ke.push(He)}return ke}var Ci=Ac(Fn),rc=Ac(dl,!0);function ed(e,n){var d=!0;return Ci(e,function(k,O,$){return d=!!n(k,O,$),d}),d}function eo(e,n,d){for(var k=-1,O=e.length;++k<O;){var $=e[k],oe=n($);if(oe!=null&&(be===a?oe===oe&&!fn(oe):d(oe,be)))var be=oe,ke=$}return ke}function td(e,n,d,k){var O=e.length;for(d=Ot(d),d<0&&(d=-d>O?0:O+d),k=k===a||k>O?O:Ot(k),k<0&&(k+=O),k=d>k?0:b0(k);d<k;)e[d++]=n;return e}function nc(e,n){var d=[];return Ci(e,function(k,O,$){n(k,O,$)&&d.push(k)}),d}function Hr(e,n,d,k,O){var $=-1,oe=e.length;for(d||(d=Ud),O||(O=[]);++$<oe;){var be=e[$];n>0&&d(be)?n>1?Hr(be,n-1,d,k,O):ei(O,be):k||(O[O.length]=be)}return O}var fl=Tc(),ic=Tc(!0);function Fn(e,n){return e&&fl(e,n,Dr)}function dl(e,n){return e&&ic(e,n,Dr)}function to(e,n){return Jn(n,function(d){return oi(e[d])})}function $i(e,n){n=ki(n,e);for(var d=0,k=n.length;e!=null&&d<k;)e=e[zn(n[d++])];return d&&d==k?e:a}function sc(e,n,d){var k=n(e);return Pt(e)?k:ei(k,d(e))}function Xr(e){return e==null?e===a?Qe:vr:zi&&zi in mt(e)?Bd(e):Qd(e)}function pl(e,n){return e>n}function rd(e,n){return e!=null&&nr.call(e,n)}function nd(e,n){return e!=null&&n in mt(e)}function id(e,n,d){return e>=Ur(n,d)&&e<Pr(n,d)}function gl(e,n,d){for(var k=d?Da:Bs,O=e[0].length,$=e.length,oe=$,be=Ne($),ke=1/0,ze=[];oe--;){var He=e[oe];oe&&n&&(He=hr(He,Kt(n))),ke=Ur(He.length,ke),be[oe]=!d&&(n||O>=120&&He.length>=120)?new Vi(oe&&He):a}He=e[0];var We=-1,nt=be[0];e:for(;++We<O&&ze.length<ke;){var dt=He[We],yt=n?n(dt):dt;if(dt=d||dt!==0?dt:0,!(nt?zr(nt,yt):k(ze,yt,d))){for(oe=$;--oe;){var Rt=be[oe];if(!(Rt?zr(Rt,yt):k(e[oe],yt,d)))continue e}nt&&nt.push(yt),ze.push(dt)}}return ze}function sd(e,n,d,k){return Fn(e,function(O,$,oe){n(k,d(O),$,oe)}),k}function Zs(e,n,d){n=ki(n,e),e=Gc(e,n);var k=e==null?e:e[zn(yn(n))];return k==null?a:wr(k,e,d)}function ac(e){return Sr(e)&&Xr(e)==Re}function ad(e){return Sr(e)&&Xr(e)==h}function od(e){return Sr(e)&&Xr(e)==Ct}function js(e,n,d,k,O){return e===n?!0:e==null||n==null||!Sr(e)&&!Sr(n)?e!==e&&n!==n:ld(e,n,d,k,js,O)}function ld(e,n,d,k,O,$){var oe=Pt(e),be=Pt(n),ke=oe?ut:$r(e),ze=be?ut:$r(n);ke=ke==Re?er:ke,ze=ze==Re?er:ze;var He=ke==er,We=ze==er,nt=ke==ze;if(nt&&Ei(e)){if(!Ei(n))return!1;oe=!0,He=!1}if(nt&&!He)return $||($=new En),oe||ms(e)?qc(e,n,d,k,O,$):Dd(e,n,ke,d,k,O,$);if(!(d&C)){var dt=He&&nr.call(e,"__wrapped__"),yt=We&&nr.call(n,"__wrapped__");if(dt||yt){var Rt=dt?e.value():e,wt=yt?n.value():n;return $||($=new En),O(Rt,wt,d,k,$)}}return nt?($||($=new En),Rd(e,n,d,k,O,$)):!1}function ud(e){return Sr(e)&&$r(e)==ct}function vl(e,n,d,k){var O=d.length,$=O,oe=!k;if(e==null)return!$;for(e=mt(e);O--;){var be=d[O];if(oe&&be[2]?be[1]!==e[be[0]]:!(be[0]in e))return!1}for(;++O<$;){be=d[O];var ke=be[0],ze=e[ke],He=be[1];if(oe&&be[2]){if(ze===a&&!(ke in e))return!1}else{var We=new En;if(k)var nt=k(ze,He,ke,e,n,We);if(!(nt===a?js(He,ze,C|m,k,We):nt))return!1}}return!0}function oc(e){if(!yr(e)||Wd(e))return!1;var n=oi(e)?uf:ht;return n.test(Gi(e))}function cd(e){return Sr(e)&&Xr(e)==kr}function hd(e){return Sr(e)&&$r(e)==Ue}function fd(e){return Sr(e)&&bo(e.length)&&!!Ut[Xr(e)]}function lc(e){return typeof e=="function"?e:e==null?nn:typeof e=="object"?Pt(e)?hc(e[0],e[1]):cc(e):I0(e)}function ml(e){if(!ta(e))return gf(e);var n=[];for(var d in mt(e))nr.call(e,d)&&d!="constructor"&&n.push(d);return n}function dd(e){if(!yr(e))return Xd(e);var n=ta(e),d=[];for(var k in e)k=="constructor"&&(n||!nr.call(e,k))||d.push(k);return d}function _l(e,n){return e<n}function uc(e,n){var d=-1,k=tn(e)?Ne(e.length):[];return Ci(e,function(O,$,oe){k[++d]=n(O,$,oe)}),k}function cc(e){var n=Ll(e);return n.length==1&&n[0][2]?$c(n[0][0],n[0][1]):function(d){return d===e||vl(d,e,n)}}function hc(e,n){return Dl(e)&&Uc(n)?$c(zn(e),n):function(d){var k=Wl(d,e);return k===a&&k===n?Gl(d,e):js(n,k,C|m)}}function ro(e,n,d,k,O){e!==n&&fl(n,function($,oe){if(O||(O=new En),yr($))pd(e,n,oe,d,ro,k,O);else{var be=k?k(Bl(e,oe),$,oe+"",e,n,O):a;be===a&&(be=$),cl(e,oe,be)}},rn)}function pd(e,n,d,k,O,$,oe){var be=Bl(e,d),ke=Bl(n,d),ze=oe.get(ke);if(ze){cl(e,d,ze);return}var He=$?$(be,ke,d+"",e,n,oe):a,We=He===a;if(We){var nt=Pt(ke),dt=!nt&&Ei(ke),yt=!nt&&!dt&&ms(ke);He=ke,nt||dt||yt?Pt(be)?He=be:Mr(be)?He=en(be):dt?(We=!1,He=Cc(ke,!0)):yt?(We=!1,He=xc(ke,!0)):He=[]:na(ke)||Yi(ke)?(He=be,Yi(be)?He=y0(be):(!yr(be)||oi(be))&&(He=Vc(ke))):We=!1}We&&(oe.set(ke,He),O(He,ke,k,$,oe),oe.delete(ke)),cl(e,d,He)}function fc(e,n){var d=e.length;if(d)return n+=n<0?d:0,ai(n,d)?e[n]:a}function dc(e,n,d){n.length?n=hr(n,function($){return Pt($)?function(oe){return $i(oe,$.length===1?$[0]:$)}:$}):n=[nn];var k=-1;n=hr(n,Kt(bt()));var O=uc(e,function($,oe,be){var ke=hr(n,function(ze){return ze($)});return{criteria:ke,index:++k,value:$}});return nl(O,function($,oe){return Ed($,oe,d)})}function gd(e,n){return pc(e,n,function(d,k){return Gl(e,k)})}function pc(e,n,d){for(var k=-1,O=n.length,$={};++k<O;){var oe=n[k],be=$i(e,oe);d(be,oe)&&Js($,ki(oe,e),be)}return $}function vd(e){return function(n){return $i(n,e)}}function bl(e,n,d,k){var O=k?Bu:Pi,$=-1,oe=n.length,be=e;for(e===n&&(n=en(n)),d&&(be=hr(e,Kt(d)));++$<oe;)for(var ke=0,ze=n[$],He=d?d(ze):ze;(ke=O(be,He,ke,k))>-1;)be!==e&&Ga.call(be,ke,1),Ga.call(e,ke,1);return e}function gc(e,n){for(var d=e?n.length:0,k=d-1;d--;){var O=n[d];if(d==k||O!==$){var $=O;ai(O)?Ga.call(e,O,1):Cl(e,O)}}return e}function yl(e,n){return e+Xa(Xu()*(n-e+1))}function md(e,n,d,k){for(var O=-1,$=Pr(Ka((n-e)/(d||1)),0),oe=Ne($);$--;)oe[k?$:++O]=e,e+=d;return oe}function wl(e,n){var d="";if(!e||n<1||n>Me)return d;do n%2&&(d+=e),n=Xa(n/2),n&&(e+=e);while(n);return d}function qt(e,n){return Fl(Wc(e,n,nn),e+"")}function _d(e){return ju(_s(e))}function bd(e,n){var d=_s(e);return fo(d,Ui(n,0,d.length))}function Js(e,n,d,k){if(!yr(e))return e;n=ki(n,e);for(var O=-1,$=n.length,oe=$-1,be=e;be!=null&&++O<$;){var ke=zn(n[O]),ze=d;if(ke==="__proto__"||ke==="constructor"||ke==="prototype")return e;if(O!=oe){var He=be[ke];ze=k?k(He,ke,be):a,ze===a&&(ze=yr(He)?He:ai(n[O+1])?[]:{})}Xs(be,ke,ze),be=be[ke]}return e}var vc=Qa?function(e,n){return Qa.set(e,n),e}:nn,yd=Ya?function(e,n){return Ya(e,"toString",{configurable:!0,enumerable:!1,value:Kl(n),writable:!0})}:nn;function wd(e){return fo(_s(e))}function bn(e,n,d){var k=-1,O=e.length;n<0&&(n=-n>O?0:O+n),d=d>O?O:d,d<0&&(d+=O),O=n>d?0:d-n>>>0,n>>>=0;for(var $=Ne(O);++k<O;)$[k]=e[k+n];return $}function Sd(e,n){var d;return Ci(e,function(k,O,$){return d=n(k,O,$),!d}),!!d}function no(e,n,d){var k=0,O=e==null?k:e.length;if(typeof n=="number"&&n===n&&O<=De){for(;k<O;){var $=k+O>>>1,oe=e[$];oe!==null&&!fn(oe)&&(d?oe<=n:oe<n)?k=$+1:O=$}return O}return Sl(e,n,nn,d)}function Sl(e,n,d,k){var O=0,$=e==null?0:e.length;if($===0)return 0;n=d(n);for(var oe=n!==n,be=n===null,ke=fn(n),ze=n===a;O<$;){var He=Xa((O+$)/2),We=d(e[He]),nt=We!==a,dt=We===null,yt=We===We,Rt=fn(We);if(oe)var wt=k||yt;else ze?wt=yt&&(k||nt):be?wt=yt&&nt&&(k||!dt):ke?wt=yt&&nt&&!dt&&(k||!Rt):dt||Rt?wt=!1:wt=k?We<=n:We<n;wt?O=He+1:$=He}return Ur($,xe)}function mc(e,n){for(var d=-1,k=e.length,O=0,$=[];++d<k;){var oe=e[d],be=n?n(oe):oe;if(!d||!An(be,ke)){var ke=be;$[O++]=oe===0?0:oe}}return $}function _c(e){return typeof e=="number"?e:fn(e)?Y:+e}function hn(e){if(typeof e=="string")return e;if(Pt(e))return hr(e,hn)+"";if(fn(e))return Qu?Qu.call(e):"";var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function xi(e,n,d){var k=-1,O=Bs,$=e.length,oe=!0,be=[],ke=be;if(d)oe=!1,O=Da;else if($>=u){var ze=n?null:Ld(e);if(ze)return Es(ze);oe=!1,O=zr,ke=new Vi}else ke=n?[]:be;e:for(;++k<$;){var He=e[k],We=n?n(He):He;if(He=d||He!==0?He:0,oe&&We===We){for(var nt=ke.length;nt--;)if(ke[nt]===We)continue e;n&&ke.push(We),be.push(He)}else O(ke,We,d)||(ke!==be&&ke.push(We),be.push(He))}return be}function Cl(e,n){return n=ki(n,e),e=Gc(e,n),e==null||delete e[zn(yn(n))]}function bc(e,n,d,k){return Js(e,n,d($i(e,n)),k)}function io(e,n,d,k){for(var O=e.length,$=k?O:-1;(k?$--:++$<O)&&n(e[$],$,e););return d?bn(e,k?0:$,k?$+1:O):bn(e,k?$+1:0,k?O:$)}function yc(e,n){var d=e;return d instanceof $t&&(d=d.value()),Ra(n,function(k,O){return O.func.apply(O.thisArg,ei([k],O.args))},d)}function xl(e,n,d){var k=e.length;if(k<2)return k?xi(e[0]):[];for(var O=-1,$=Ne(k);++O<k;)for(var oe=e[O],be=-1;++be<k;)be!=O&&($[O]=Qs($[O]||oe,e[be],n,d));return xi(Hr($,1),n,d)}function wc(e,n,d){for(var k=-1,O=e.length,$=n.length,oe={};++k<O;){var be=k<$?n[k]:a;d(oe,e[k],be)}return oe}function kl(e){return Mr(e)?e:[]}function Ml(e){return typeof e=="function"?e:nn}function ki(e,n){return Pt(e)?e:Dl(e,n)?[e]:Qc(tr(e))}var Cd=qt;function Mi(e,n,d){var k=e.length;return d=d===a?k:d,!n&&d>=k?e:bn(e,n,d)}var Sc=cf||function(e){return Or.clearTimeout(e)};function Cc(e,n){if(n)return e.slice();var d=e.length,k=$u?$u(d):new e.constructor(d);return e.copy(k),k}function El(e){var n=new e.constructor(e.byteLength);return new $a(n).set(new $a(e)),n}function xd(e,n){var d=n?El(e.buffer):e.buffer;return new e.constructor(d,e.byteOffset,e.byteLength)}function kd(e){var n=new e.constructor(e.source,Mt.exec(e));return n.lastIndex=e.lastIndex,n}function Md(e){return Ks?mt(Ks.call(e)):{}}function xc(e,n){var d=n?El(e.buffer):e.buffer;return new e.constructor(d,e.byteOffset,e.length)}function kc(e,n){if(e!==n){var d=e!==a,k=e===null,O=e===e,$=fn(e),oe=n!==a,be=n===null,ke=n===n,ze=fn(n);if(!be&&!ze&&!$&&e>n||$&&oe&&ke&&!be&&!ze||k&&oe&&ke||!d&&ke||!O)return 1;if(!k&&!$&&!ze&&e<n||ze&&d&&O&&!k&&!$||be&&d&&O||!oe&&O||!ke)return-1}return 0}function Ed(e,n,d){for(var k=-1,O=e.criteria,$=n.criteria,oe=O.length,be=d.length;++k<oe;){var ke=kc(O[k],$[k]);if(ke){if(k>=be)return ke;var ze=d[k];return ke*(ze=="desc"?-1:1)}}return e.index-n.index}function Mc(e,n,d,k){for(var O=-1,$=e.length,oe=d.length,be=-1,ke=n.length,ze=Pr($-oe,0),He=Ne(ke+ze),We=!k;++be<ke;)He[be]=n[be];for(;++O<oe;)(We||O<$)&&(He[d[O]]=e[O]);for(;ze--;)He[be++]=e[O++];return He}function Ec(e,n,d,k){for(var O=-1,$=e.length,oe=-1,be=d.length,ke=-1,ze=n.length,He=Pr($-be,0),We=Ne(He+ze),nt=!k;++O<He;)We[O]=e[O];for(var dt=O;++ke<ze;)We[dt+ke]=n[ke];for(;++oe<be;)(nt||O<$)&&(We[dt+d[oe]]=e[O++]);return We}function en(e,n){var d=-1,k=e.length;for(n||(n=Ne(k));++d<k;)n[d]=e[d];return n}function qn(e,n,d,k){var O=!d;d||(d={});for(var $=-1,oe=n.length;++$<oe;){var be=n[$],ke=k?k(d[be],e[be],be,d,e):a;ke===a&&(ke=e[be]),O?ni(d,be,ke):Xs(d,be,ke)}return d}function Ad(e,n){return qn(e,Ol(e),n)}function Td(e,n){return qn(e,zc(e),n)}function so(e,n){return function(d,k){var O=Pt(d)?Du:Zf,$=n?n():{};return O(d,e,bt(k,2),$)}}function ps(e){return qt(function(n,d){var k=-1,O=d.length,$=O>1?d[O-1]:a,oe=O>2?d[2]:a;for($=e.length>3&&typeof $=="function"?(O--,$):a,oe&&Qr(d[0],d[1],oe)&&($=O<3?a:$,O=1),n=mt(n);++k<O;){var be=d[k];be&&e(n,be,k,$)}return n})}function Ac(e,n){return function(d,k){if(d==null)return d;if(!tn(d))return e(d,k);for(var O=d.length,$=n?O:-1,oe=mt(d);(n?$--:++$<O)&&k(oe[$],$,oe)!==!1;);return d}}function Tc(e){return function(n,d,k){for(var O=-1,$=mt(n),oe=k(n),be=oe.length;be--;){var ke=oe[e?be:++O];if(d($[ke],ke,$)===!1)break}return n}}function Id(e,n,d){var k=n&T,O=ea(e);function $(){var oe=this&&this!==Or&&this instanceof $?O:e;return oe.apply(k?d:this,arguments)}return $}function Ic(e){return function(n){n=tr(n);var d=Bi(n)?cn(n):a,k=d?d[0]:n.charAt(0),O=d?Mi(d,1).join(""):n.slice(1);return k[e]()+O}}function gs(e){return function(n){return Ra(A0(E0(n).replace(_e,"")),e,"")}}function ea(e){return function(){var n=arguments;switch(n.length){case 0:return new e;case 1:return new e(n[0]);case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[1],n[2]);case 4:return new e(n[0],n[1],n[2],n[3]);case 5:return new e(n[0],n[1],n[2],n[3],n[4]);case 6:return new e(n[0],n[1],n[2],n[3],n[4],n[5]);case 7:return new e(n[0],n[1],n[2],n[3],n[4],n[5],n[6])}var d=ds(e.prototype),k=e.apply(d,n);return yr(k)?k:d}}function Pd(e,n,d){var k=ea(e);function O(){for(var $=arguments.length,oe=Ne($),be=$,ke=vs(O);be--;)oe[be]=arguments[be];var ze=$<3&&oe[0]!==ke&&oe[$-1]!==ke?[]:Xn(oe,ke);if($-=ze.length,$<d)return Dc(e,n,ao,O.placeholder,a,oe,ze,a,a,d-$);var He=this&&this!==Or&&this instanceof O?k:e;return wr(He,this,oe)}return O}function Pc(e){return function(n,d,k){var O=mt(n);if(!tn(n)){var $=bt(d,3);n=Dr(n),d=function(be){return $(O[be],be,O)}}var oe=e(n,d,k);return oe>-1?O[$?n[oe]:oe]:a}}function Nc(e){return si(function(n){var d=n.length,k=d,O=mn.prototype.thru;for(e&&n.reverse();k--;){var $=n[k];if(typeof $!="function")throw new ar(f);if(O&&!oe&&co($)=="wrapper")var oe=new mn([],!0)}for(k=oe?k:d;++k<d;){$=n[k];var be=co($),ke=be=="wrapper"?Nl($):a;ke&&Rl(ke[0])&&ke[1]==(ye|B|G|q)&&!ke[4].length&&ke[9]==1?oe=oe[co(ke[0])].apply(oe,ke[3]):oe=$.length==1&&Rl($)?oe[be]():oe.thru($)}return function(){var ze=arguments,He=ze[0];if(oe&&ze.length==1&&Pt(He))return oe.plant(He).value();for(var We=0,nt=d?n[We].apply(this,ze):He;++We<d;)nt=n[We].call(this,nt);return nt}})}function ao(e,n,d,k,O,$,oe,be,ke,ze){var He=n&ye,We=n&T,nt=n&L,dt=n&(B|W),yt=n&se,Rt=nt?a:ea(e);function wt(){for(var Ht=arguments.length,Wt=Ne(Ht),dn=Ht;dn--;)Wt[dn]=arguments[dn];if(dt)var Zr=vs(wt),pn=xn(Wt,Zr);if(k&&(Wt=Mc(Wt,k,O,dt)),$&&(Wt=Ec(Wt,$,oe,dt)),Ht-=pn,dt&&Ht<ze){var Er=Xn(Wt,Zr);return Dc(e,n,ao,wt.placeholder,d,Wt,Er,be,ke,ze-Ht)}var Tn=We?d:this,ui=nt?Tn[e]:e;return Ht=Wt.length,be?Wt=Zd(Wt,be):yt&&Ht>1&&Wt.reverse(),He&&ke<Ht&&(Wt.length=ke),this&&this!==Or&&this instanceof wt&&(ui=Rt||ea(ui)),ui.apply(Tn,Wt)}return wt}function Lc(e,n){return function(d,k){return sd(d,e,n(k),{})}}function oo(e,n){return function(d,k){var O;if(d===a&&k===a)return n;if(d!==a&&(O=d),k!==a){if(O===a)return k;typeof d=="string"||typeof k=="string"?(d=hn(d),k=hn(k)):(d=_c(d),k=_c(k)),O=e(d,k)}return O}}function Al(e){return si(function(n){return n=hr(n,Kt(bt())),qt(function(d){var k=this;return e(n,function(O){return wr(O,k,d)})})})}function lo(e,n){n=n===a?" ":hn(n);var d=n.length;if(d<2)return d?wl(n,e):n;var k=wl(n,Ka(e/qi(n)));return Bi(n)?Mi(cn(k),0,e).join(""):k.slice(0,e)}function Nd(e,n,d,k){var O=n&T,$=ea(e);function oe(){for(var be=-1,ke=arguments.length,ze=-1,He=k.length,We=Ne(He+ke),nt=this&&this!==Or&&this instanceof oe?$:e;++ze<He;)We[ze]=k[ze];for(;ke--;)We[ze++]=arguments[++be];return wr(nt,O?d:this,We)}return oe}function Oc(e){return function(n,d,k){return k&&typeof k!="number"&&Qr(n,d,k)&&(d=k=a),n=li(n),d===a?(d=n,n=0):d=li(d),k=k===a?n<d?1:-1:li(k),md(n,d,k,e)}}function uo(e){return function(n,d){return typeof n=="string"&&typeof d=="string"||(n=wn(n),d=wn(d)),e(n,d)}}function Dc(e,n,d,k,O,$,oe,be,ke,ze){var He=n&B,We=He?oe:a,nt=He?a:oe,dt=He?$:a,yt=He?a:$;n|=He?G:R,n&=~(He?R:G),n&N||(n&=-4);var Rt=[e,n,O,dt,We,yt,nt,be,ke,ze],wt=d.apply(a,Rt);return Rl(e)&&Yc(wt,Rt),wt.placeholder=k,Kc(wt,e,n)}function Tl(e){var n=et[e];return function(d,k){if(d=wn(d),k=k==null?0:Ur(Ot(k),292),k&&Ku(d)){var O=(tr(d)+"e").split("e"),$=n(O[0]+"e"+(+O[1]+k));return O=(tr($)+"e").split("e"),+(O[0]+"e"+(+O[1]-k))}return n(d)}}var Ld=hs&&1/Es(new hs([,-0]))[1]==Ee?function(e){return new hs(e)}:Zl;function Rc(e){return function(n){var d=$r(n);return d==ct?cs(n):d==Ue?Qn(n):Rn(n,e(n))}}function ii(e,n,d,k,O,$,oe,be){var ke=n&L;if(!ke&&typeof e!="function")throw new ar(f);var ze=k?k.length:0;if(ze||(n&=-97,k=O=a),oe=oe===a?oe:Pr(Ot(oe),0),be=be===a?be:Ot(be),ze-=O?O.length:0,n&R){var He=k,We=O;k=O=a}var nt=ke?a:Nl(e),dt=[e,n,d,k,O,He,We,$,oe,be];if(nt&&Kd(dt,nt),e=dt[0],n=dt[1],d=dt[2],k=dt[3],O=dt[4],be=dt[9]=dt[9]===a?ke?0:e.length:Pr(dt[9]-ze,0),!be&&n&(B|W)&&(n&=-25),!n||n==T)var yt=Id(e,n,d);else n==B||n==W?yt=Pd(e,n,be):(n==G||n==(T|G))&&!O.length?yt=Nd(e,n,d,k):yt=ao.apply(a,dt);var Rt=nt?vc:Yc;return Kc(Rt(yt,dt),e,n)}function Bc(e,n,d,k){return e===a||An(e,wi[d])&&!nr.call(k,d)?n:e}function Fc(e,n,d,k,O,$){return yr(e)&&yr(n)&&($.set(n,e),ro(e,n,a,Fc,$),$.delete(n)),e}function Od(e){return na(e)?a:e}function qc(e,n,d,k,O,$){var oe=d&C,be=e.length,ke=n.length;if(be!=ke&&!(oe&&ke>be))return!1;var ze=$.get(e),He=$.get(n);if(ze&&He)return ze==n&&He==e;var We=-1,nt=!0,dt=d&m?new Vi:a;for($.set(e,n),$.set(n,e);++We<be;){var yt=e[We],Rt=n[We];if(k)var wt=oe?k(Rt,yt,We,n,e,$):k(yt,Rt,We,e,n,$);if(wt!==a){if(wt)continue;nt=!1;break}if(dt){if(!Ba(n,function(Ht,Wt){if(!zr(dt,Wt)&&(yt===Ht||O(yt,Ht,d,k,$)))return dt.push(Wt)})){nt=!1;break}}else if(!(yt===Rt||O(yt,Rt,d,k,$))){nt=!1;break}}return $.delete(e),$.delete(n),nt}function Dd(e,n,d,k,O,$,oe){switch(d){case b:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case h:return!(e.byteLength!=n.byteLength||!$(new $a(e),new $a(n)));case it:case Ct:case gr:return An(+e,+n);case at:return e.name==n.name&&e.message==n.message;case kr:case Je:return e==n+"";case ct:var be=cs;case Ue:var ke=k&C;if(be||(be=Es),e.size!=n.size&&!ke)return!1;var ze=oe.get(e);if(ze)return ze==n;k|=m,oe.set(e,n);var He=qc(be(e),be(n),k,O,$,oe);return oe.delete(e),He;case Ye:if(Ks)return Ks.call(e)==Ks.call(n)}return!1}function Rd(e,n,d,k,O,$){var oe=d&C,be=Il(e),ke=be.length,ze=Il(n),He=ze.length;if(ke!=He&&!oe)return!1;for(var We=ke;We--;){var nt=be[We];if(!(oe?nt in n:nr.call(n,nt)))return!1}var dt=$.get(e),yt=$.get(n);if(dt&&yt)return dt==n&&yt==e;var Rt=!0;$.set(e,n),$.set(n,e);for(var wt=oe;++We<ke;){nt=be[We];var Ht=e[nt],Wt=n[nt];if(k)var dn=oe?k(Wt,Ht,nt,n,e,$):k(Ht,Wt,nt,e,n,$);if(!(dn===a?Ht===Wt||O(Ht,Wt,d,k,$):dn)){Rt=!1;break}wt||(wt=nt=="constructor")}if(Rt&&!wt){var Zr=e.constructor,pn=n.constructor;Zr!=pn&&"constructor"in e&&"constructor"in n&&!(typeof Zr=="function"&&Zr instanceof Zr&&typeof pn=="function"&&pn instanceof pn)&&(Rt=!1)}return $.delete(e),$.delete(n),Rt}function si(e){return Fl(Wc(e,a,e0),e+"")}function Il(e){return sc(e,Dr,Ol)}function Pl(e){return sc(e,rn,zc)}var Nl=Qa?function(e){return Qa.get(e)}:Zl;function co(e){for(var n=e.name+"",d=fs[n],k=nr.call(fs,n)?d.length:0;k--;){var O=d[k],$=O.func;if($==null||$==e)return O.name}return n}function vs(e){var n=nr.call(V,"placeholder")?V:e;return n.placeholder}function bt(){var e=V.iteratee||Xl;return e=e===Xl?lc:e,arguments.length?e(arguments[0],arguments[1]):e}function ho(e,n){var d=e.__data__;return $d(n)?d[typeof n=="string"?"string":"hash"]:d.map}function Ll(e){for(var n=Dr(e),d=n.length;d--;){var k=n[d],O=e[k];n[d]=[k,O,Uc(O)]}return n}function Wi(e,n){var d=il(e,n);return oc(d)?d:a}function Bd(e){var n=nr.call(e,zi),d=e[zi];try{e[zi]=a;var k=!0}catch{}var O=Va.call(e);return k&&(n?e[zi]=d:delete e[zi]),O}var Ol=ol?function(e){return e==null?[]:(e=mt(e),Jn(ol(e),function(n){return Gu.call(e,n)}))}:jl,zc=ol?function(e){for(var n=[];e;)ei(n,Ol(e)),e=Wa(e);return n}:jl,$r=Xr;(ll&&$r(new ll(new ArrayBuffer(1)))!=b||Ws&&$r(new Ws)!=ct||ul&&$r(ul.resolve())!=Cr||hs&&$r(new hs)!=Ue||Gs&&$r(new Gs)!=rt)&&($r=function(e){var n=Xr(e),d=n==er?e.constructor:a,k=d?Gi(d):"";if(k)switch(k){case bf:return b;case yf:return ct;case wf:return Cr;case Sf:return Ue;case Cf:return rt}return n});function Fd(e,n,d){for(var k=-1,O=d.length;++k<O;){var $=d[k],oe=$.size;switch($.type){case"drop":e+=oe;break;case"dropRight":n-=oe;break;case"take":n=Ur(n,e+oe);break;case"takeRight":e=Pr(e,n-oe);break}}return{start:e,end:n}}function qd(e){var n=e.match(Ve);return n?n[1].split(Ke):[]}function Hc(e,n,d){n=ki(n,e);for(var k=-1,O=n.length,$=!1;++k<O;){var oe=zn(n[k]);if(!($=e!=null&&d(e,oe)))break;e=e[oe]}return $||++k!=O?$:(O=e==null?0:e.length,!!O&&bo(O)&&ai(oe,O)&&(Pt(e)||Yi(e)))}function zd(e){var n=e.length,d=new e.constructor(n);return n&&typeof e[0]=="string"&&nr.call(e,"index")&&(d.index=e.index,d.input=e.input),d}function Vc(e){return typeof e.constructor=="function"&&!ta(e)?ds(Wa(e)):{}}function Hd(e,n,d){var k=e.constructor;switch(n){case h:return El(e);case it:case Ct:return new k(+e);case b:return xd(e,d);case x:case E:case I:case F:case D:case z:case U:case J:case te:return xc(e,d);case ct:return new k;case gr:case Je:return new k(e);case kr:return kd(e);case Ue:return new k;case Ye:return Md(e)}}function Vd(e,n){var d=n.length;if(!d)return e;var k=d-1;return n[k]=(d>1?"& ":"")+n[k],n=n.join(d>2?", ":" "),e.replace(Fe,`{
|
|
15
|
+
/* [wrapped with `+n+`] */
|
|
16
|
+
`)}function Ud(e){return Pt(e)||Yi(e)||!!(Yu&&e&&e[Yu])}function ai(e,n){var d=typeof e;return n=n??Me,!!n&&(d=="number"||d!="symbol"&&zt.test(e))&&e>-1&&e%1==0&&e<n}function Qr(e,n,d){if(!yr(d))return!1;var k=typeof n;return(k=="number"?tn(d)&&ai(n,d.length):k=="string"&&n in d)?An(d[n],e):!1}function Dl(e,n){if(Pt(e))return!1;var d=typeof e;return d=="number"||d=="symbol"||d=="boolean"||e==null||fn(e)?!0:ge.test(e)||!we.test(e)||n!=null&&e in mt(n)}function $d(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function Rl(e){var n=co(e),d=V[n];if(typeof d!="function"||!(n in $t.prototype))return!1;if(e===d)return!0;var k=Nl(d);return!!k&&e===k[0]}function Wd(e){return!!Uu&&Uu in e}var Gd=Ji?oi:Jl;function ta(e){var n=e&&e.constructor,d=typeof n=="function"&&n.prototype||wi;return e===d}function Uc(e){return e===e&&!yr(e)}function $c(e,n){return function(d){return d==null?!1:d[e]===n&&(n!==a||e in mt(d))}}function Yd(e){var n=mo(e,function(k){return d.size===S&&d.clear(),k}),d=n.cache;return n}function Kd(e,n){var d=e[1],k=n[1],O=d|k,$=O<(T|L|ye),oe=k==ye&&d==B||k==ye&&d==q&&e[7].length<=n[8]||k==(ye|q)&&n[7].length<=n[8]&&d==B;if(!($||oe))return e;k&T&&(e[2]=n[2],O|=d&T?0:N);var be=n[3];if(be){var ke=e[3];e[3]=ke?Mc(ke,be,n[4]):be,e[4]=ke?Xn(e[3],A):n[4]}return be=n[5],be&&(ke=e[5],e[5]=ke?Ec(ke,be,n[6]):be,e[6]=ke?Xn(e[5],A):n[6]),be=n[7],be&&(e[7]=be),k&ye&&(e[8]=e[8]==null?n[8]:Ur(e[8],n[8])),e[9]==null&&(e[9]=n[9]),e[0]=n[0],e[1]=O,e}function Xd(e){var n=[];if(e!=null)for(var d in mt(e))n.push(d);return n}function Qd(e){return Va.call(e)}function Wc(e,n,d){return n=Pr(n===a?e.length-1:n,0),function(){for(var k=arguments,O=-1,$=Pr(k.length-n,0),oe=Ne($);++O<$;)oe[O]=k[n+O];O=-1;for(var be=Ne(n+1);++O<n;)be[O]=k[O];return be[n]=d(oe),wr(e,this,be)}}function Gc(e,n){return n.length<2?e:$i(e,bn(n,0,-1))}function Zd(e,n){for(var d=e.length,k=Ur(n.length,d),O=en(e);k--;){var $=n[k];e[k]=ai($,d)?O[$]:a}return e}function Bl(e,n){if(!(n==="constructor"&&typeof e[n]=="function")&&n!="__proto__")return e[n]}var Yc=Xc(vc),ra=ff||function(e,n){return Or.setTimeout(e,n)},Fl=Xc(yd);function Kc(e,n,d){var k=n+"";return Fl(e,Vd(k,jd(qd(k),d)))}function Xc(e){var n=0,d=0;return function(){var k=vf(),O=de-(k-d);if(d=k,O>0){if(++n>=ce)return arguments[0]}else n=0;return e.apply(a,arguments)}}function fo(e,n){var d=-1,k=e.length,O=k-1;for(n=n===a?k:n;++d<n;){var $=yl(d,O),oe=e[$];e[$]=e[d],e[d]=oe}return e.length=n,e}var Qc=Yd(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(Ae,function(d,k,O,$){n.push(O?$.replace(gt,"$1"):k||d)}),n});function zn(e){if(typeof e=="string"||fn(e))return e;var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function Gi(e){if(e!=null){try{return Us.call(e)}catch{}try{return e+""}catch{}}return""}function jd(e,n){return Jr($e,function(d){var k="_."+d[0];n&d[1]&&!Bs(e,k)&&e.push(k)}),e.sort()}function Zc(e){if(e instanceof $t)return e.clone();var n=new mn(e.__wrapped__,e.__chain__);return n.__actions__=en(e.__actions__),n.__index__=e.__index__,n.__values__=e.__values__,n}function Jd(e,n,d){(d?Qr(e,n,d):n===a)?n=1:n=Pr(Ot(n),0);var k=e==null?0:e.length;if(!k||n<1)return[];for(var O=0,$=0,oe=Ne(Ka(k/n));O<k;)oe[$++]=bn(e,O,O+=n);return oe}function e1(e){for(var n=-1,d=e==null?0:e.length,k=0,O=[];++n<d;){var $=e[n];$&&(O[k++]=$)}return O}function t1(){var e=arguments.length;if(!e)return[];for(var n=Ne(e-1),d=arguments[0],k=e;k--;)n[k-1]=arguments[k];return ei(Pt(d)?en(d):[d],Hr(n,1))}var r1=qt(function(e,n){return Mr(e)?Qs(e,Hr(n,1,Mr,!0)):[]}),n1=qt(function(e,n){var d=yn(n);return Mr(d)&&(d=a),Mr(e)?Qs(e,Hr(n,1,Mr,!0),bt(d,2)):[]}),i1=qt(function(e,n){var d=yn(n);return Mr(d)&&(d=a),Mr(e)?Qs(e,Hr(n,1,Mr,!0),a,d):[]});function s1(e,n,d){var k=e==null?0:e.length;return k?(n=d||n===a?1:Ot(n),bn(e,n<0?0:n,k)):[]}function a1(e,n,d){var k=e==null?0:e.length;return k?(n=d||n===a?1:Ot(n),n=k-n,bn(e,0,n<0?0:n)):[]}function o1(e,n){return e&&e.length?io(e,bt(n,3),!0,!0):[]}function l1(e,n){return e&&e.length?io(e,bt(n,3),!0):[]}function u1(e,n,d,k){var O=e==null?0:e.length;return O?(d&&typeof d!="number"&&Qr(e,n,d)&&(d=0,k=O),td(e,n,d,k)):[]}function jc(e,n,d){var k=e==null?0:e.length;if(!k)return-1;var O=d==null?0:Ot(d);return O<0&&(O=Pr(k+O,0)),zs(e,bt(n,3),O)}function Jc(e,n,d){var k=e==null?0:e.length;if(!k)return-1;var O=k-1;return d!==a&&(O=Ot(d),O=d<0?Pr(k+O,0):Ur(O,k-1)),zs(e,bt(n,3),O,!0)}function e0(e){var n=e==null?0:e.length;return n?Hr(e,1):[]}function c1(e){var n=e==null?0:e.length;return n?Hr(e,Ee):[]}function h1(e,n){var d=e==null?0:e.length;return d?(n=n===a?1:Ot(n),Hr(e,n)):[]}function f1(e){for(var n=-1,d=e==null?0:e.length,k={};++n<d;){var O=e[n];k[O[0]]=O[1]}return k}function t0(e){return e&&e.length?e[0]:a}function d1(e,n,d){var k=e==null?0:e.length;if(!k)return-1;var O=d==null?0:Ot(d);return O<0&&(O=Pr(k+O,0)),Pi(e,n,O)}function p1(e){var n=e==null?0:e.length;return n?bn(e,0,-1):[]}var g1=qt(function(e){var n=hr(e,kl);return n.length&&n[0]===e[0]?gl(n):[]}),v1=qt(function(e){var n=yn(e),d=hr(e,kl);return n===yn(d)?n=a:d.pop(),d.length&&d[0]===e[0]?gl(d,bt(n,2)):[]}),m1=qt(function(e){var n=yn(e),d=hr(e,kl);return n=typeof n=="function"?n:a,n&&d.pop(),d.length&&d[0]===e[0]?gl(d,a,n):[]});function _1(e,n){return e==null?"":pf.call(e,n)}function yn(e){var n=e==null?0:e.length;return n?e[n-1]:a}function b1(e,n,d){var k=e==null?0:e.length;if(!k)return-1;var O=k;return d!==a&&(O=Ot(d),O=O<0?Pr(k+O,0):Ur(O,k-1)),n===n?qu(e,n,O):zs(e,ma,O,!0)}function y1(e,n){return e&&e.length?fc(e,Ot(n)):a}var w1=qt(r0);function r0(e,n){return e&&e.length&&n&&n.length?bl(e,n):e}function S1(e,n,d){return e&&e.length&&n&&n.length?bl(e,n,bt(d,2)):e}function C1(e,n,d){return e&&e.length&&n&&n.length?bl(e,n,a,d):e}var x1=si(function(e,n){var d=e==null?0:e.length,k=hl(e,n);return gc(e,hr(n,function(O){return ai(O,d)?+O:O}).sort(kc)),k});function k1(e,n){var d=[];if(!(e&&e.length))return d;var k=-1,O=[],$=e.length;for(n=bt(n,3);++k<$;){var oe=e[k];n(oe,k,e)&&(d.push(oe),O.push(k))}return gc(e,O),d}function ql(e){return e==null?e:_f.call(e)}function M1(e,n,d){var k=e==null?0:e.length;return k?(d&&typeof d!="number"&&Qr(e,n,d)?(n=0,d=k):(n=n==null?0:Ot(n),d=d===a?k:Ot(d)),bn(e,n,d)):[]}function E1(e,n){return no(e,n)}function A1(e,n,d){return Sl(e,n,bt(d,2))}function T1(e,n){var d=e==null?0:e.length;if(d){var k=no(e,n);if(k<d&&An(e[k],n))return k}return-1}function I1(e,n){return no(e,n,!0)}function P1(e,n,d){return Sl(e,n,bt(d,2),!0)}function N1(e,n){var d=e==null?0:e.length;if(d){var k=no(e,n,!0)-1;if(An(e[k],n))return k}return-1}function L1(e){return e&&e.length?mc(e):[]}function O1(e,n){return e&&e.length?mc(e,bt(n,2)):[]}function D1(e){var n=e==null?0:e.length;return n?bn(e,1,n):[]}function R1(e,n,d){return e&&e.length?(n=d||n===a?1:Ot(n),bn(e,0,n<0?0:n)):[]}function B1(e,n,d){var k=e==null?0:e.length;return k?(n=d||n===a?1:Ot(n),n=k-n,bn(e,n<0?0:n,k)):[]}function F1(e,n){return e&&e.length?io(e,bt(n,3),!1,!0):[]}function q1(e,n){return e&&e.length?io(e,bt(n,3)):[]}var z1=qt(function(e){return xi(Hr(e,1,Mr,!0))}),H1=qt(function(e){var n=yn(e);return Mr(n)&&(n=a),xi(Hr(e,1,Mr,!0),bt(n,2))}),V1=qt(function(e){var n=yn(e);return n=typeof n=="function"?n:a,xi(Hr(e,1,Mr,!0),a,n)});function U1(e){return e&&e.length?xi(e):[]}function $1(e,n){return e&&e.length?xi(e,bt(n,2)):[]}function W1(e,n){return n=typeof n=="function"?n:a,e&&e.length?xi(e,a,n):[]}function zl(e){if(!(e&&e.length))return[];var n=0;return e=Jn(e,function(d){if(Mr(d))return n=Pr(d.length,n),!0}),wa(n,function(d){return hr(e,_a(d))})}function n0(e,n){if(!(e&&e.length))return[];var d=zl(e);return n==null?d:hr(d,function(k){return wr(n,a,k)})}var G1=qt(function(e,n){return Mr(e)?Qs(e,n):[]}),Y1=qt(function(e){return xl(Jn(e,Mr))}),K1=qt(function(e){var n=yn(e);return Mr(n)&&(n=a),xl(Jn(e,Mr),bt(n,2))}),X1=qt(function(e){var n=yn(e);return n=typeof n=="function"?n:a,xl(Jn(e,Mr),a,n)}),Q1=qt(zl);function Z1(e,n){return wc(e||[],n||[],Xs)}function j1(e,n){return wc(e||[],n||[],Js)}var J1=qt(function(e){var n=e.length,d=n>1?e[n-1]:a;return d=typeof d=="function"?(e.pop(),d):a,n0(e,d)});function i0(e){var n=V(e);return n.__chain__=!0,n}function ep(e,n){return n(e),e}function po(e,n){return n(e)}var tp=si(function(e){var n=e.length,d=n?e[0]:0,k=this.__wrapped__,O=function($){return hl($,e)};return n>1||this.__actions__.length||!(k instanceof $t)||!ai(d)?this.thru(O):(k=k.slice(d,+d+(n?1:0)),k.__actions__.push({func:po,args:[O],thisArg:a}),new mn(k,this.__chain__).thru(function($){return n&&!$.length&&$.push(a),$}))});function rp(){return i0(this)}function np(){return new mn(this.value(),this.__chain__)}function ip(){this.__values__===a&&(this.__values__=_0(this.value()));var e=this.__index__>=this.__values__.length,n=e?a:this.__values__[this.__index__++];return{done:e,value:n}}function sp(){return this}function ap(e){for(var n,d=this;d instanceof ja;){var k=Zc(d);k.__index__=0,k.__values__=a,n?O.__wrapped__=k:n=k;var O=k;d=d.__wrapped__}return O.__wrapped__=e,n}function op(){var e=this.__wrapped__;if(e instanceof $t){var n=e;return this.__actions__.length&&(n=new $t(this)),n=n.reverse(),n.__actions__.push({func:po,args:[ql],thisArg:a}),new mn(n,this.__chain__)}return this.thru(ql)}function lp(){return yc(this.__wrapped__,this.__actions__)}var up=so(function(e,n,d){nr.call(e,d)?++e[d]:ni(e,d,1)});function cp(e,n,d){var k=Pt(e)?rl:ed;return d&&Qr(e,n,d)&&(n=a),k(e,bt(n,3))}function hp(e,n){var d=Pt(e)?Jn:nc;return d(e,bt(n,3))}var fp=Pc(jc),dp=Pc(Jc);function pp(e,n){return Hr(go(e,n),1)}function gp(e,n){return Hr(go(e,n),Ee)}function vp(e,n,d){return d=d===a?1:Ot(d),Hr(go(e,n),d)}function s0(e,n){var d=Pt(e)?Jr:Ci;return d(e,bt(n,3))}function a0(e,n){var d=Pt(e)?va:rc;return d(e,bt(n,3))}var mp=so(function(e,n,d){nr.call(e,d)?e[d].push(n):ni(e,d,[n])});function _p(e,n,d,k){e=tn(e)?e:_s(e),d=d&&!k?Ot(d):0;var O=e.length;return d<0&&(d=Pr(O+d,0)),yo(e)?d<=O&&e.indexOf(n,d)>-1:!!O&&Pi(e,n,d)>-1}var bp=qt(function(e,n,d){var k=-1,O=typeof n=="function",$=tn(e)?Ne(e.length):[];return Ci(e,function(oe){$[++k]=O?wr(n,oe,d):Zs(oe,n,d)}),$}),yp=so(function(e,n,d){ni(e,d,n)});function go(e,n){var d=Pt(e)?hr:uc;return d(e,bt(n,3))}function wp(e,n,d,k){return e==null?[]:(Pt(n)||(n=n==null?[]:[n]),d=k?a:d,Pt(d)||(d=d==null?[]:[d]),dc(e,n,d))}var Sp=so(function(e,n,d){e[d?0:1].push(n)},function(){return[[],[]]});function Cp(e,n,d){var k=Pt(e)?Ra:Ir,O=arguments.length<3;return k(e,bt(n,4),d,O,Ci)}function xp(e,n,d){var k=Pt(e)?Ru:Ir,O=arguments.length<3;return k(e,bt(n,4),d,O,rc)}function kp(e,n){var d=Pt(e)?Jn:nc;return d(e,_o(bt(n,3)))}function Mp(e){var n=Pt(e)?ju:_d;return n(e)}function Ep(e,n,d){(d?Qr(e,n,d):n===a)?n=1:n=Ot(n);var k=Pt(e)?Xf:bd;return k(e,n)}function Ap(e){var n=Pt(e)?Qf:wd;return n(e)}function Tp(e){if(e==null)return 0;if(tn(e))return yo(e)?qi(e):e.length;var n=$r(e);return n==ct||n==Ue?e.size:ml(e).length}function Ip(e,n,d){var k=Pt(e)?Ba:Sd;return d&&Qr(e,n,d)&&(n=a),k(e,bt(n,3))}var Pp=qt(function(e,n){if(e==null)return[];var d=n.length;return d>1&&Qr(e,n[0],n[1])?n=[]:d>2&&Qr(n[0],n[1],n[2])&&(n=[n[0]]),dc(e,Hr(n,1),[])}),vo=hf||function(){return Or.Date.now()};function Np(e,n){if(typeof n!="function")throw new ar(f);return e=Ot(e),function(){if(--e<1)return n.apply(this,arguments)}}function o0(e,n,d){return n=d?a:n,n=e&&n==null?e.length:n,ii(e,ye,a,a,a,a,n)}function l0(e,n){var d;if(typeof n!="function")throw new ar(f);return e=Ot(e),function(){return--e>0&&(d=n.apply(this,arguments)),e<=1&&(n=a),d}}var Hl=qt(function(e,n,d){var k=T;if(d.length){var O=Xn(d,vs(Hl));k|=G}return ii(e,k,n,d,O)}),u0=qt(function(e,n,d){var k=T|L;if(d.length){var O=Xn(d,vs(u0));k|=G}return ii(n,k,e,d,O)});function c0(e,n,d){n=d?a:n;var k=ii(e,B,a,a,a,a,a,n);return k.placeholder=c0.placeholder,k}function h0(e,n,d){n=d?a:n;var k=ii(e,W,a,a,a,a,a,n);return k.placeholder=h0.placeholder,k}function f0(e,n,d){var k,O,$,oe,be,ke,ze=0,He=!1,We=!1,nt=!0;if(typeof e!="function")throw new ar(f);n=wn(n)||0,yr(d)&&(He=!!d.leading,We="maxWait"in d,$=We?Pr(wn(d.maxWait)||0,n):$,nt="trailing"in d?!!d.trailing:nt);function dt(Er){var Tn=k,ui=O;return k=O=a,ze=Er,oe=e.apply(ui,Tn),oe}function yt(Er){return ze=Er,be=ra(Ht,n),He?dt(Er):oe}function Rt(Er){var Tn=Er-ke,ui=Er-ze,P0=n-Tn;return We?Ur(P0,$-ui):P0}function wt(Er){var Tn=Er-ke,ui=Er-ze;return ke===a||Tn>=n||Tn<0||We&&ui>=$}function Ht(){var Er=vo();if(wt(Er))return Wt(Er);be=ra(Ht,Rt(Er))}function Wt(Er){return be=a,nt&&k?dt(Er):(k=O=a,oe)}function dn(){be!==a&&Sc(be),ze=0,k=ke=O=be=a}function Zr(){return be===a?oe:Wt(vo())}function pn(){var Er=vo(),Tn=wt(Er);if(k=arguments,O=this,ke=Er,Tn){if(be===a)return yt(ke);if(We)return Sc(be),be=ra(Ht,n),dt(ke)}return be===a&&(be=ra(Ht,n)),oe}return pn.cancel=dn,pn.flush=Zr,pn}var Lp=qt(function(e,n){return tc(e,1,n)}),Op=qt(function(e,n,d){return tc(e,wn(n)||0,d)});function Dp(e){return ii(e,se)}function mo(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new ar(f);var d=function(){var k=arguments,O=n?n.apply(this,k):k[0],$=d.cache;if($.has(O))return $.get(O);var oe=e.apply(this,k);return d.cache=$.set(O,oe)||$,oe};return d.cache=new(mo.Cache||ri),d}mo.Cache=ri;function _o(e){if(typeof e!="function")throw new ar(f);return function(){var n=arguments;switch(n.length){case 0:return!e.call(this);case 1:return!e.call(this,n[0]);case 2:return!e.call(this,n[0],n[1]);case 3:return!e.call(this,n[0],n[1],n[2])}return!e.apply(this,n)}}function Rp(e){return l0(2,e)}var Bp=Cd(function(e,n){n=n.length==1&&Pt(n[0])?hr(n[0],Kt(bt())):hr(Hr(n,1),Kt(bt()));var d=n.length;return qt(function(k){for(var O=-1,$=Ur(k.length,d);++O<$;)k[O]=n[O].call(this,k[O]);return wr(e,this,k)})}),Vl=qt(function(e,n){var d=Xn(n,vs(Vl));return ii(e,G,a,n,d)}),d0=qt(function(e,n){var d=Xn(n,vs(d0));return ii(e,R,a,n,d)}),Fp=si(function(e,n){return ii(e,q,a,a,a,n)});function qp(e,n){if(typeof e!="function")throw new ar(f);return n=n===a?n:Ot(n),qt(e,n)}function zp(e,n){if(typeof e!="function")throw new ar(f);return n=n==null?0:Pr(Ot(n),0),qt(function(d){var k=d[n],O=Mi(d,0,n);return k&&ei(O,k),wr(e,this,O)})}function Hp(e,n,d){var k=!0,O=!0;if(typeof e!="function")throw new ar(f);return yr(d)&&(k="leading"in d?!!d.leading:k,O="trailing"in d?!!d.trailing:O),f0(e,n,{leading:k,maxWait:n,trailing:O})}function Vp(e){return o0(e,1)}function Up(e,n){return Vl(Ml(n),e)}function $p(){if(!arguments.length)return[];var e=arguments[0];return Pt(e)?e:[e]}function Wp(e){return _n(e,_)}function Gp(e,n){return n=typeof n=="function"?n:a,_n(e,_,n)}function Yp(e){return _n(e,M|_)}function Kp(e,n){return n=typeof n=="function"?n:a,_n(e,M|_,n)}function Xp(e,n){return n==null||ec(e,n,Dr(n))}function An(e,n){return e===n||e!==e&&n!==n}var Qp=uo(pl),Zp=uo(function(e,n){return e>=n}),Yi=ac(function(){return arguments}())?ac:function(e){return Sr(e)&&nr.call(e,"callee")&&!Gu.call(e,"callee")},Pt=Ne.isArray,jp=pa?Kt(pa):ad;function tn(e){return e!=null&&bo(e.length)&&!oi(e)}function Mr(e){return Sr(e)&&tn(e)}function Jp(e){return e===!0||e===!1||Sr(e)&&Xr(e)==it}var Ei=df||Jl,eg=ks?Kt(ks):od;function tg(e){return Sr(e)&&e.nodeType===1&&!na(e)}function rg(e){if(e==null)return!0;if(tn(e)&&(Pt(e)||typeof e=="string"||typeof e.splice=="function"||Ei(e)||ms(e)||Yi(e)))return!e.length;var n=$r(e);if(n==ct||n==Ue)return!e.size;if(ta(e))return!ml(e).length;for(var d in e)if(nr.call(e,d))return!1;return!0}function ng(e,n){return js(e,n)}function ig(e,n,d){d=typeof d=="function"?d:a;var k=d?d(e,n):a;return k===a?js(e,n,a,d):!!k}function Ul(e){if(!Sr(e))return!1;var n=Xr(e);return n==at||n==It||typeof e.message=="string"&&typeof e.name=="string"&&!na(e)}function sg(e){return typeof e=="number"&&Ku(e)}function oi(e){if(!yr(e))return!1;var n=Xr(e);return n==Gt||n==Dt||n==Lt||n==Wr}function p0(e){return typeof e=="number"&&e==Ot(e)}function bo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Me}function yr(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}function Sr(e){return e!=null&&typeof e=="object"}var g0=ga?Kt(ga):ud;function ag(e,n){return e===n||vl(e,n,Ll(n))}function og(e,n,d){return d=typeof d=="function"?d:a,vl(e,n,Ll(n),d)}function lg(e){return v0(e)&&e!=+e}function ug(e){if(Gd(e))throw new Te(c);return oc(e)}function cg(e){return e===null}function hg(e){return e==null}function v0(e){return typeof e=="number"||Sr(e)&&Xr(e)==gr}function na(e){if(!Sr(e)||Xr(e)!=er)return!1;var n=Wa(e);if(n===null)return!0;var d=nr.call(n,"constructor")&&n.constructor;return typeof d=="function"&&d instanceof d&&Us.call(d)==of}var $l=Ho?Kt(Ho):cd;function fg(e){return p0(e)&&e>=-9007199254740991&&e<=Me}var m0=os?Kt(os):hd;function yo(e){return typeof e=="string"||!Pt(e)&&Sr(e)&&Xr(e)==Je}function fn(e){return typeof e=="symbol"||Sr(e)&&Xr(e)==Ye}var ms=Vo?Kt(Vo):fd;function dg(e){return e===a}function pg(e){return Sr(e)&&$r(e)==rt}function gg(e){return Sr(e)&&Xr(e)==o}var vg=uo(_l),mg=uo(function(e,n){return e<=n});function _0(e){if(!e)return[];if(tn(e))return yo(e)?cn(e):en(e);if($s&&e[$s])return Fa(e[$s]());var n=$r(e),d=n==ct?cs:n==Ue?Es:_s;return d(e)}function li(e){if(!e)return e===0?e:0;if(e=wn(e),e===Ee||e===-1/0){var n=e<0?-1:1;return n*H}return e===e?e:0}function Ot(e){var n=li(e),d=n%1;return n===n?d?n-d:n:0}function b0(e){return e?Ui(Ot(e),0,X):0}function wn(e){if(typeof e=="number")return e;if(fn(e))return Y;if(yr(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=yr(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=ji(e);var d=ot.test(e);return d||Tt.test(e)?Ou(e.slice(2),d?2:8):Bt.test(e)?Y:+e}function y0(e){return qn(e,rn(e))}function _g(e){return e?Ui(Ot(e),-9007199254740991,Me):e===0?e:0}function tr(e){return e==null?"":hn(e)}var bg=ps(function(e,n){if(ta(n)||tn(n)){qn(n,Dr(n),e);return}for(var d in n)nr.call(n,d)&&Xs(e,d,n[d])}),w0=ps(function(e,n){qn(n,rn(n),e)}),wo=ps(function(e,n,d,k){qn(n,rn(n),e,k)}),yg=ps(function(e,n,d,k){qn(n,Dr(n),e,k)}),wg=si(hl);function Sg(e,n){var d=ds(e);return n==null?d:Ju(d,n)}var Cg=qt(function(e,n){e=mt(e);var d=-1,k=n.length,O=k>2?n[2]:a;for(O&&Qr(n[0],n[1],O)&&(k=1);++d<k;)for(var $=n[d],oe=rn($),be=-1,ke=oe.length;++be<ke;){var ze=oe[be],He=e[ze];(He===a||An(He,wi[ze])&&!nr.call(e,ze))&&(e[ze]=$[ze])}return e}),xg=qt(function(e){return e.push(a,Fc),wr(S0,a,e)});function kg(e,n){return qs(e,bt(n,3),Fn)}function Mg(e,n){return qs(e,bt(n,3),dl)}function Eg(e,n){return e==null?e:fl(e,bt(n,3),rn)}function Ag(e,n){return e==null?e:ic(e,bt(n,3),rn)}function Tg(e,n){return e&&Fn(e,bt(n,3))}function Ig(e,n){return e&&dl(e,bt(n,3))}function Pg(e){return e==null?[]:to(e,Dr(e))}function Ng(e){return e==null?[]:to(e,rn(e))}function Wl(e,n,d){var k=e==null?a:$i(e,n);return k===a?d:k}function Lg(e,n){return e!=null&&Hc(e,n,rd)}function Gl(e,n){return e!=null&&Hc(e,n,nd)}var Og=Lc(function(e,n,d){n!=null&&typeof n.toString!="function"&&(n=Va.call(n)),e[n]=d},Kl(nn)),Dg=Lc(function(e,n,d){n!=null&&typeof n.toString!="function"&&(n=Va.call(n)),nr.call(e,n)?e[n].push(d):e[n]=[d]},bt),Rg=qt(Zs);function Dr(e){return tn(e)?Zu(e):ml(e)}function rn(e){return tn(e)?Zu(e,!0):dd(e)}function Bg(e,n){var d={};return n=bt(n,3),Fn(e,function(k,O,$){ni(d,n(k,O,$),k)}),d}function Fg(e,n){var d={};return n=bt(n,3),Fn(e,function(k,O,$){ni(d,O,n(k,O,$))}),d}var qg=ps(function(e,n,d){ro(e,n,d)}),S0=ps(function(e,n,d,k){ro(e,n,d,k)}),zg=si(function(e,n){var d={};if(e==null)return d;var k=!1;n=hr(n,function($){return $=ki($,e),k||(k=$.length>1),$}),qn(e,Pl(e),d),k&&(d=_n(d,M|w|_,Od));for(var O=n.length;O--;)Cl(d,n[O]);return d});function Hg(e,n){return C0(e,_o(bt(n)))}var Vg=si(function(e,n){return e==null?{}:gd(e,n)});function C0(e,n){if(e==null)return{};var d=hr(Pl(e),function(k){return[k]});return n=bt(n),pc(e,d,function(k,O){return n(k,O[0])})}function Ug(e,n,d){n=ki(n,e);var k=-1,O=n.length;for(O||(O=1,e=a);++k<O;){var $=e==null?a:e[zn(n[k])];$===a&&(k=O,$=d),e=oi($)?$.call(e):$}return e}function $g(e,n,d){return e==null?e:Js(e,n,d)}function Wg(e,n,d,k){return k=typeof k=="function"?k:a,e==null?e:Js(e,n,d,k)}var x0=Rc(Dr),k0=Rc(rn);function Gg(e,n,d){var k=Pt(e),O=k||Ei(e)||ms(e);if(n=bt(n,4),d==null){var $=e&&e.constructor;O?d=k?new $:[]:yr(e)?d=oi($)?ds(Wa(e)):{}:d={}}return(O?Jr:Fn)(e,function(oe,be,ke){return n(d,oe,be,ke)}),d}function Yg(e,n){return e==null?!0:Cl(e,n)}function Kg(e,n,d){return e==null?e:bc(e,n,Ml(d))}function Xg(e,n,d,k){return k=typeof k=="function"?k:a,e==null?e:bc(e,n,Ml(d),k)}function _s(e){return e==null?[]:Hs(e,Dr(e))}function Qg(e){return e==null?[]:Hs(e,rn(e))}function Zg(e,n,d){return d===a&&(d=n,n=a),d!==a&&(d=wn(d),d=d===d?d:0),n!==a&&(n=wn(n),n=n===n?n:0),Ui(wn(e),n,d)}function jg(e,n,d){return n=li(n),d===a?(d=n,n=0):d=li(d),e=wn(e),id(e,n,d)}function Jg(e,n,d){if(d&&typeof d!="boolean"&&Qr(e,n,d)&&(n=d=a),d===a&&(typeof n=="boolean"?(d=n,n=a):typeof e=="boolean"&&(d=e,e=a)),e===a&&n===a?(e=0,n=1):(e=li(e),n===a?(n=e,e=0):n=li(n)),e>n){var k=e;e=n,n=k}if(d||e%1||n%1){var O=Xu();return Ur(e+O*(n-e+xs("1e-"+((O+"").length-1))),n)}return yl(e,n)}var ev=gs(function(e,n,d){return n=n.toLowerCase(),e+(d?M0(n):n)});function M0(e){return Yl(tr(e).toLowerCase())}function E0(e){return e=tr(e),e&&e.replace(Ft,us).replace(Le,"")}function tv(e,n,d){e=tr(e),n=hn(n);var k=e.length;d=d===a?k:Ui(Ot(d),0,k);var O=d;return d-=n.length,d>=0&&e.slice(d,O)==n}function rv(e){return e=tr(e),e&&ae.test(e)?e.replace(fe,Uo):e}function nv(e){return e=tr(e),e&&Oe.test(e)?e.replace(Ie,"\\$&"):e}var iv=gs(function(e,n,d){return e+(d?"-":"")+n.toLowerCase()}),sv=gs(function(e,n,d){return e+(d?" ":"")+n.toLowerCase()}),av=Ic("toLowerCase");function ov(e,n,d){e=tr(e),n=Ot(n);var k=n?qi(e):0;if(!n||k>=n)return e;var O=(n-k)/2;return lo(Xa(O),d)+e+lo(Ka(O),d)}function lv(e,n,d){e=tr(e),n=Ot(n);var k=n?qi(e):0;return n&&k<n?e+lo(n-k,d):e}function uv(e,n,d){e=tr(e),n=Ot(n);var k=n?qi(e):0;return n&&k<n?lo(n-k,d)+e:e}function cv(e,n,d){return d||n==null?n=0:n&&(n=+n),mf(tr(e).replace(qe,""),n||0)}function hv(e,n,d){return(d?Qr(e,n,d):n===a)?n=1:n=Ot(n),wl(tr(e),n)}function fv(){var e=arguments,n=tr(e[0]);return e.length<3?n:n.replace(e[1],e[2])}var dv=gs(function(e,n,d){return e+(d?"_":"")+n.toLowerCase()});function pv(e,n,d){return d&&typeof d!="number"&&Qr(e,n,d)&&(n=d=a),d=d===a?X:d>>>0,d?(e=tr(e),e&&(typeof n=="string"||n!=null&&!$l(n))&&(n=hn(n),!n&&Bi(e))?Mi(cn(e),0,d):e.split(n,d)):[]}var gv=gs(function(e,n,d){return e+(d?" ":"")+Yl(n)});function vv(e,n,d){return e=tr(e),d=d==null?0:Ui(Ot(d),0,e.length),n=hn(n),e.slice(d,d+n.length)==n}function mv(e,n,d){var k=V.templateSettings;d&&Qr(e,n,d)&&(n=a),e=tr(e),n=wo({},n,k,Bc);var O=wo({},n.imports,k.imports,Bc),$=Dr(O),oe=Hs(O,$),be,ke,ze=0,He=n.interpolate||Zt,We="__p += '",nt=or((n.escape||Zt).source+"|"+He.source+"|"+(He===me?xt:Zt).source+"|"+(n.evaluate||Zt).source+"|$","g"),dt="//# sourceURL="+(nr.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++cr+"]")+`
|
|
17
|
+
`;e.replace(nt,function(wt,Ht,Wt,dn,Zr,pn){return Wt||(Wt=dn),We+=e.slice(ze,pn).replace(rr,Fu),Ht&&(be=!0,We+=`' +
|
|
18
|
+
__e(`+Ht+`) +
|
|
19
|
+
'`),Zr&&(ke=!0,We+=`';
|
|
20
|
+
`+Zr+`;
|
|
21
|
+
__p += '`),Wt&&(We+=`' +
|
|
22
|
+
((__t = (`+Wt+`)) == null ? '' : __t) +
|
|
23
|
+
'`),ze=pn+wt.length,wt}),We+=`';
|
|
24
|
+
`;var yt=nr.call(n,"variable")&&n.variable;if(!yt)We=`with (obj) {
|
|
25
|
+
`+We+`
|
|
26
|
+
}
|
|
27
|
+
`;else if(je.test(yt))throw new Te(p);We=(ke?We.replace(ee,""):We).replace(j,"$1").replace(pe,"$1;"),We="function("+(yt||"obj")+`) {
|
|
28
|
+
`+(yt?"":`obj || (obj = {});
|
|
29
|
+
`)+"var __t, __p = ''"+(be?", __e = _.escape":"")+(ke?`, __j = Array.prototype.join;
|
|
30
|
+
function print() { __p += __j.call(arguments, '') }
|
|
31
|
+
`:`;
|
|
32
|
+
`)+We+`return __p
|
|
33
|
+
}`;var Rt=T0(function(){return Ge($,dt+"return "+We).apply(a,oe)});if(Rt.source=We,Ul(Rt))throw Rt;return Rt}function _v(e){return tr(e).toLowerCase()}function bv(e){return tr(e).toUpperCase()}function yv(e,n,d){if(e=tr(e),e&&(d||n===a))return ji(e);if(!e||!(n=hn(n)))return e;var k=cn(e),O=cn(n),$=Sa(k,O),oe=ls(k,O)+1;return Mi(k,$,oe).join("")}function wv(e,n,d){if(e=tr(e),e&&(d||n===a))return e.slice(0,za(e)+1);if(!e||!(n=hn(n)))return e;var k=cn(e),O=ls(k,cn(n))+1;return Mi(k,0,O).join("")}function Sv(e,n,d){if(e=tr(e),e&&(d||n===a))return e.replace(qe,"");if(!e||!(n=hn(n)))return e;var k=cn(e),O=Sa(k,cn(n));return Mi(k,O).join("")}function Cv(e,n){var d=ve,k=he;if(yr(n)){var O="separator"in n?n.separator:O;d="length"in n?Ot(n.length):d,k="omission"in n?hn(n.omission):k}e=tr(e);var $=e.length;if(Bi(e)){var oe=cn(e);$=oe.length}if(d>=$)return e;var be=d-qi(k);if(be<1)return k;var ke=oe?Mi(oe,0,be).join(""):e.slice(0,be);if(O===a)return ke+k;if(oe&&(be+=ke.length-be),$l(O)){if(e.slice(be).search(O)){var ze,He=ke;for(O.global||(O=or(O.source,tr(Mt.exec(O))+"g")),O.lastIndex=0;ze=O.exec(He);)var We=ze.index;ke=ke.slice(0,We===a?be:We)}}else if(e.indexOf(hn(O),be)!=be){var nt=ke.lastIndexOf(O);nt>-1&&(ke=ke.slice(0,nt))}return ke+k}function xv(e){return e=tr(e),e&&ne.test(e)?e.replace(ie,zu):e}var kv=gs(function(e,n,d){return e+(d?" ":"")+n.toUpperCase()}),Yl=Ic("toUpperCase");function A0(e,n,d){return e=tr(e),n=d?a:n,n===a?Fi(e)?Hu(e):gu(e):e.match(n)||[]}var T0=qt(function(e,n){try{return wr(e,a,n)}catch(d){return Ul(d)?d:new Te(d)}}),Mv=si(function(e,n){return Jr(n,function(d){d=zn(d),ni(e,d,Hl(e[d],e))}),e});function Ev(e){var n=e==null?0:e.length,d=bt();return e=n?hr(e,function(k){if(typeof k[1]!="function")throw new ar(f);return[d(k[0]),k[1]]}):[],qt(function(k){for(var O=-1;++O<n;){var $=e[O];if(wr($[0],this,k))return wr($[1],this,k)}})}function Av(e){return Jf(_n(e,M))}function Kl(e){return function(){return e}}function Tv(e,n){return e==null||e!==e?n:e}var Iv=Nc(),Pv=Nc(!0);function nn(e){return e}function Xl(e){return lc(typeof e=="function"?e:_n(e,M))}function Nv(e){return cc(_n(e,M))}function Lv(e,n){return hc(e,_n(n,M))}var Ov=qt(function(e,n){return function(d){return Zs(d,e,n)}}),Dv=qt(function(e,n){return function(d){return Zs(e,d,n)}});function Ql(e,n,d){var k=Dr(n),O=to(n,k);d==null&&!(yr(n)&&(O.length||!k.length))&&(d=n,n=e,e=this,O=to(n,Dr(n)));var $=!(yr(d)&&"chain"in d)||!!d.chain,oe=oi(e);return Jr(O,function(be){var ke=n[be];e[be]=ke,oe&&(e.prototype[be]=function(){var ze=this.__chain__;if($||ze){var He=e(this.__wrapped__),We=He.__actions__=en(this.__actions__);return We.push({func:ke,args:arguments,thisArg:e}),He.__chain__=ze,He}return ke.apply(e,ei([this.value()],arguments))})}),e}function Rv(){return Or._===this&&(Or._=lf),this}function Zl(){}function Bv(e){return e=Ot(e),qt(function(n){return fc(n,e)})}var Fv=Al(hr),qv=Al(rl),zv=Al(Ba);function I0(e){return Dl(e)?_a(zn(e)):vd(e)}function Hv(e){return function(n){return e==null?a:$i(e,n)}}var Vv=Oc(),Uv=Oc(!0);function jl(){return[]}function Jl(){return!1}function $v(){return{}}function Wv(){return""}function Gv(){return!0}function Yv(e,n){if(e=Ot(e),e<1||e>Me)return[];var d=X,k=Ur(e,X);n=bt(n),e-=X;for(var O=wa(k,n);++d<e;)n(d);return O}function Kv(e){return Pt(e)?hr(e,zn):fn(e)?[e]:en(Qc(tr(e)))}function Xv(e){var n=++af;return tr(e)+n}var Qv=oo(function(e,n){return e+n},0),Zv=Tl("ceil"),jv=oo(function(e,n){return e/n},1),Jv=Tl("floor");function em(e){return e&&e.length?eo(e,nn,pl):a}function tm(e,n){return e&&e.length?eo(e,bt(n,2),pl):a}function rm(e){return Ms(e,nn)}function nm(e,n){return Ms(e,bt(n,2))}function im(e){return e&&e.length?eo(e,nn,_l):a}function sm(e,n){return e&&e.length?eo(e,bt(n,2),_l):a}var am=oo(function(e,n){return e*n},1),om=Tl("round"),lm=oo(function(e,n){return e-n},0);function um(e){return e&&e.length?ya(e,nn):0}function cm(e,n){return e&&e.length?ya(e,bt(n,2)):0}return V.after=Np,V.ary=o0,V.assign=bg,V.assignIn=w0,V.assignInWith=wo,V.assignWith=yg,V.at=wg,V.before=l0,V.bind=Hl,V.bindAll=Mv,V.bindKey=u0,V.castArray=$p,V.chain=i0,V.chunk=Jd,V.compact=e1,V.concat=t1,V.cond=Ev,V.conforms=Av,V.constant=Kl,V.countBy=up,V.create=Sg,V.curry=c0,V.curryRight=h0,V.debounce=f0,V.defaults=Cg,V.defaultsDeep=xg,V.defer=Lp,V.delay=Op,V.difference=r1,V.differenceBy=n1,V.differenceWith=i1,V.drop=s1,V.dropRight=a1,V.dropRightWhile=o1,V.dropWhile=l1,V.fill=u1,V.filter=hp,V.flatMap=pp,V.flatMapDeep=gp,V.flatMapDepth=vp,V.flatten=e0,V.flattenDeep=c1,V.flattenDepth=h1,V.flip=Dp,V.flow=Iv,V.flowRight=Pv,V.fromPairs=f1,V.functions=Pg,V.functionsIn=Ng,V.groupBy=mp,V.initial=p1,V.intersection=g1,V.intersectionBy=v1,V.intersectionWith=m1,V.invert=Og,V.invertBy=Dg,V.invokeMap=bp,V.iteratee=Xl,V.keyBy=yp,V.keys=Dr,V.keysIn=rn,V.map=go,V.mapKeys=Bg,V.mapValues=Fg,V.matches=Nv,V.matchesProperty=Lv,V.memoize=mo,V.merge=qg,V.mergeWith=S0,V.method=Ov,V.methodOf=Dv,V.mixin=Ql,V.negate=_o,V.nthArg=Bv,V.omit=zg,V.omitBy=Hg,V.once=Rp,V.orderBy=wp,V.over=Fv,V.overArgs=Bp,V.overEvery=qv,V.overSome=zv,V.partial=Vl,V.partialRight=d0,V.partition=Sp,V.pick=Vg,V.pickBy=C0,V.property=I0,V.propertyOf=Hv,V.pull=w1,V.pullAll=r0,V.pullAllBy=S1,V.pullAllWith=C1,V.pullAt=x1,V.range=Vv,V.rangeRight=Uv,V.rearg=Fp,V.reject=kp,V.remove=k1,V.rest=qp,V.reverse=ql,V.sampleSize=Ep,V.set=$g,V.setWith=Wg,V.shuffle=Ap,V.slice=M1,V.sortBy=Pp,V.sortedUniq=L1,V.sortedUniqBy=O1,V.split=pv,V.spread=zp,V.tail=D1,V.take=R1,V.takeRight=B1,V.takeRightWhile=F1,V.takeWhile=q1,V.tap=ep,V.throttle=Hp,V.thru=po,V.toArray=_0,V.toPairs=x0,V.toPairsIn=k0,V.toPath=Kv,V.toPlainObject=y0,V.transform=Gg,V.unary=Vp,V.union=z1,V.unionBy=H1,V.unionWith=V1,V.uniq=U1,V.uniqBy=$1,V.uniqWith=W1,V.unset=Yg,V.unzip=zl,V.unzipWith=n0,V.update=Kg,V.updateWith=Xg,V.values=_s,V.valuesIn=Qg,V.without=G1,V.words=A0,V.wrap=Up,V.xor=Y1,V.xorBy=K1,V.xorWith=X1,V.zip=Q1,V.zipObject=Z1,V.zipObjectDeep=j1,V.zipWith=J1,V.entries=x0,V.entriesIn=k0,V.extend=w0,V.extendWith=wo,Ql(V,V),V.add=Qv,V.attempt=T0,V.camelCase=ev,V.capitalize=M0,V.ceil=Zv,V.clamp=Zg,V.clone=Wp,V.cloneDeep=Yp,V.cloneDeepWith=Kp,V.cloneWith=Gp,V.conformsTo=Xp,V.deburr=E0,V.defaultTo=Tv,V.divide=jv,V.endsWith=tv,V.eq=An,V.escape=rv,V.escapeRegExp=nv,V.every=cp,V.find=fp,V.findIndex=jc,V.findKey=kg,V.findLast=dp,V.findLastIndex=Jc,V.findLastKey=Mg,V.floor=Jv,V.forEach=s0,V.forEachRight=a0,V.forIn=Eg,V.forInRight=Ag,V.forOwn=Tg,V.forOwnRight=Ig,V.get=Wl,V.gt=Qp,V.gte=Zp,V.has=Lg,V.hasIn=Gl,V.head=t0,V.identity=nn,V.includes=_p,V.indexOf=d1,V.inRange=jg,V.invoke=Rg,V.isArguments=Yi,V.isArray=Pt,V.isArrayBuffer=jp,V.isArrayLike=tn,V.isArrayLikeObject=Mr,V.isBoolean=Jp,V.isBuffer=Ei,V.isDate=eg,V.isElement=tg,V.isEmpty=rg,V.isEqual=ng,V.isEqualWith=ig,V.isError=Ul,V.isFinite=sg,V.isFunction=oi,V.isInteger=p0,V.isLength=bo,V.isMap=g0,V.isMatch=ag,V.isMatchWith=og,V.isNaN=lg,V.isNative=ug,V.isNil=hg,V.isNull=cg,V.isNumber=v0,V.isObject=yr,V.isObjectLike=Sr,V.isPlainObject=na,V.isRegExp=$l,V.isSafeInteger=fg,V.isSet=m0,V.isString=yo,V.isSymbol=fn,V.isTypedArray=ms,V.isUndefined=dg,V.isWeakMap=pg,V.isWeakSet=gg,V.join=_1,V.kebabCase=iv,V.last=yn,V.lastIndexOf=b1,V.lowerCase=sv,V.lowerFirst=av,V.lt=vg,V.lte=mg,V.max=em,V.maxBy=tm,V.mean=rm,V.meanBy=nm,V.min=im,V.minBy=sm,V.stubArray=jl,V.stubFalse=Jl,V.stubObject=$v,V.stubString=Wv,V.stubTrue=Gv,V.multiply=am,V.nth=y1,V.noConflict=Rv,V.noop=Zl,V.now=vo,V.pad=ov,V.padEnd=lv,V.padStart=uv,V.parseInt=cv,V.random=Jg,V.reduce=Cp,V.reduceRight=xp,V.repeat=hv,V.replace=fv,V.result=Ug,V.round=om,V.runInContext=Ce,V.sample=Mp,V.size=Tp,V.snakeCase=dv,V.some=Ip,V.sortedIndex=E1,V.sortedIndexBy=A1,V.sortedIndexOf=T1,V.sortedLastIndex=I1,V.sortedLastIndexBy=P1,V.sortedLastIndexOf=N1,V.startCase=gv,V.startsWith=vv,V.subtract=lm,V.sum=um,V.sumBy=cm,V.template=mv,V.times=Yv,V.toFinite=li,V.toInteger=Ot,V.toLength=b0,V.toLower=_v,V.toNumber=wn,V.toSafeInteger=_g,V.toString=tr,V.toUpper=bv,V.trim=yv,V.trimEnd=wv,V.trimStart=Sv,V.truncate=Cv,V.unescape=xv,V.uniqueId=Xv,V.upperCase=kv,V.upperFirst=Yl,V.each=s0,V.eachRight=a0,V.first=t0,Ql(V,function(){var e={};return Fn(V,function(n,d){nr.call(V.prototype,d)||(e[d]=n)}),e}(),{chain:!1}),V.VERSION=l,Jr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){V[e].placeholder=V}),Jr(["drop","take"],function(e,n){$t.prototype[e]=function(d){d=d===a?1:Pr(Ot(d),0);var k=this.__filtered__&&!n?new $t(this):this.clone();return k.__filtered__?k.__takeCount__=Ur(d,k.__takeCount__):k.__views__.push({size:Ur(d,X),type:e+(k.__dir__<0?"Right":"")}),k},$t.prototype[e+"Right"]=function(d){return this.reverse()[e](d).reverse()}}),Jr(["filter","map","takeWhile"],function(e,n){var d=n+1,k=d==K||d==le;$t.prototype[e]=function(O){var $=this.clone();return $.__iteratees__.push({iteratee:bt(O,3),type:d}),$.__filtered__=$.__filtered__||k,$}}),Jr(["head","last"],function(e,n){var d="take"+(n?"Right":"");$t.prototype[e]=function(){return this[d](1).value()[0]}}),Jr(["initial","tail"],function(e,n){var d="drop"+(n?"":"Right");$t.prototype[e]=function(){return this.__filtered__?new $t(this):this[d](1)}}),$t.prototype.compact=function(){return this.filter(nn)},$t.prototype.find=function(e){return this.filter(e).head()},$t.prototype.findLast=function(e){return this.reverse().find(e)},$t.prototype.invokeMap=qt(function(e,n){return typeof e=="function"?new $t(this):this.map(function(d){return Zs(d,e,n)})}),$t.prototype.reject=function(e){return this.filter(_o(bt(e)))},$t.prototype.slice=function(e,n){e=Ot(e);var d=this;return d.__filtered__&&(e>0||n<0)?new $t(d):(e<0?d=d.takeRight(-e):e&&(d=d.drop(e)),n!==a&&(n=Ot(n),d=n<0?d.dropRight(-n):d.take(n-e)),d)},$t.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},$t.prototype.toArray=function(){return this.take(X)},Fn($t.prototype,function(e,n){var d=/^(?:filter|find|map|reject)|While$/.test(n),k=/^(?:head|last)$/.test(n),O=V[k?"take"+(n=="last"?"Right":""):n],$=k||/^find/.test(n);O&&(V.prototype[n]=function(){var oe=this.__wrapped__,be=k?[1]:arguments,ke=oe instanceof $t,ze=be[0],He=ke||Pt(oe),We=function(Ht){var Wt=O.apply(V,ei([Ht],be));return k&&nt?Wt[0]:Wt};He&&d&&typeof ze=="function"&&ze.length!=1&&(ke=He=!1);var nt=this.__chain__,dt=!!this.__actions__.length,yt=$&&!nt,Rt=ke&&!dt;if(!$&&He){oe=Rt?oe:new $t(this);var wt=e.apply(oe,be);return wt.__actions__.push({func:po,args:[We],thisArg:a}),new mn(wt,nt)}return yt&&Rt?e.apply(this,be):(wt=this.thru(We),yt?k?wt.value()[0]:wt.value():wt)})}),Jr(["pop","push","shift","sort","splice","unshift"],function(e){var n=Bn[e],d=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",k=/^(?:pop|shift)$/.test(e);V.prototype[e]=function(){var O=arguments;if(k&&!this.__chain__){var $=this.value();return n.apply(Pt($)?$:[],O)}return this[d](function(oe){return n.apply(Pt(oe)?oe:[],O)})}}),Fn($t.prototype,function(e,n){var d=V[n];if(d){var k=d.name+"";nr.call(fs,k)||(fs[k]=[]),fs[k].push({name:n,func:d})}}),fs[ao(a,L).name]=[{name:"wrapper",func:a}],$t.prototype.clone=xf,$t.prototype.reverse=kf,$t.prototype.value=Mf,V.prototype.at=tp,V.prototype.chain=rp,V.prototype.commit=np,V.prototype.next=ip,V.prototype.plant=ap,V.prototype.reverse=op,V.prototype.toJSON=V.prototype.valueOf=V.prototype.value=lp,V.prototype.first=V.prototype.head,$s&&(V.prototype[$s]=sp),V},Ni=Vu();mi?((mi.exports=Ni)._=Ni,Oa._=Ni):Or._=Ni}).call(V7)}(q0,q0.exports)),q0.exports}var $7=U7();const Cu=Vh($7);function ko(t,r){return Math.floor(Math.random()*(r-t+1))+t}function N0(t){return Math.cos(P4(t))}function L0(t){return Math.sin(P4(t))}function P4(t){return t/360*2*Math.PI}function W7(t,r){const a=new Array(r.length).fill("_"),l=t.split("");console.log(t,r),console.log("Attempt char codes:",t.split("").map(u=>u.charCodeAt(0))),console.log("Answer char codes:",r.split("").map(u=>u.charCodeAt(0)));for(let u=0;u<r.length;u++)u<l.length&&l[u]===r[u]&&(a[u]=l[u],l[u]="");for(let u=r.length-1;u>=0;u--)if(a[u]==="_"){const c=l.findIndex(f=>f===r[u]);c!==-1&&(a[u]=r[u],l[c]="")}return console.log(a.join(" ")),a.join(" ")}const G7=qr({name:"FillInView",components:{MarkdownRenderer:I7(()=>M7(()=>import("./index-DHMXQY3-.js").then(t=>t.p),__vite__mapDeps([0,1,2,3])).then(t=>t.MarkdownRenderer)),RadioMultipleChoice:zh,AudioAutoPlayer:Gb},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"FillInView"),l=Wn(a);l.question.value=new xu(t.data);const u=Qt(),c=Nr(()=>{if(!l.question.value)throw a.logger.error("Question not initialized"),new Error("Question not initialized");return l.question.value});oa(()=>{try{if(l.question.value||(l.question.value=new xu(t.data)),l.question.value.options){const L=m();u.value=Cu.shuffle(L)}}catch(L){a.logger.error("Failed to initialize question:",L)}}),Hh(()=>{l.question.value=void 0});const f=Nr(()=>u.value),p=Nr(()=>!!t.data[0]["image-1"]),y=Nr(()=>{if(!p.value)return[""];const L=[];let N=1;for(;t.data[0][`image-${N}`];)L.push(URL.createObjectURL(t.data[0][`image-${N}`])),N++;return L}),S=Nr(()=>!!t.data[0]["audio-1"]),A=Nr(()=>{var L;return((L=c.value)==null?void 0:L.mdText)||""}),M=Nr(()=>{if(!S.value)return[""];const L=[];let N=1;for(;t.data[0][`audio-${N}`];)L.push(URL.createObjectURL(t.data[0][`audio-${N}`])),N++;return L}),w=Nr(()=>{if(c.value.answers)return c.value.answers[Math.floor(c.value.answers.length*Math.random())];throw new Error("No answers provided")}),_=Nr(()=>{var L;const N=w.value;if(console.log(`Prior answers: ${l.priorAnswers.value}`),N&&((L=l.priorAnswers.value[0])!=null&&L[0])&&l.priorAnswers.value[0][1]==="UserInputString")return W7(l.priorAnswers.value[0][0],N);if(console.log("found no UserInputString"),w.value){let B="";for(let W=0;W<w.value.length;W++)B+="_ ";return B}return""}),C=Nr(()=>!!(c.value.answers&&c.value.answers.length>0)),m=()=>{var L;if(!((L=c.value)!=null&&L.options))return;if(c.value.options.length<=6)return c.value.options;const N=[];N.push(c.value.answers[Math.floor(Math.random()*c.value.answers.length)]);let B=Cu.shuffle(c.value.options.filter(W=>{var G;return((G=c.value.answers)==null?void 0:G.indexOf(W))===-1}));return t.modifyDifficulty&&(console.log(`Modifying difficulty: ${t.modifyDifficulty}`),t.modifyDifficulty<-200?B=B.slice(0,1):t.modifyDifficulty<-150?B=B.slice(0,2):t.modifyDifficulty<-100?B=B.slice(0,3):t.modifyDifficulty<-50?B=B.slice(0,4):B=B.slice(0,5)),N.push(...B.slice(0,5)),N},T=()=>{l.submitAnswer("")};return E4(()=>t.data,L=>{var N;try{if(l.question.value=new xu(L),(N=l.question.value)!=null&&N.options){const B=m();u.value=Cu.shuffle(B)}}catch(B){a.logger.error("Failed to initialize/update question:",B)}},{deep:!0}),{...a,...l,question:c,truncatedOptions:f,hasImage:p,imageURLs:y,hasAudio:S,audioURL:M,obscuredAnswer:_,someAnswer:w,isQuestion:C,handleNext:T,markdownText:A}}}),Mn=(t,r)=>{const a=t.__vccOpts||t;for(const[l,u]of r)a[l]=u;return a},Y7={"data-viewable":"FillInView"},K7=["src"],X7={key:4,class:"text-center text-h6"},Q7={key:5,class:"text-center text-h6"};function Z7(t,r,a,l,u,c){var f;const p=vt("audio-auto-player"),y=vt("markdown-renderer"),S=vt("radio-multiple-choice"),A=vt("v-spacer"),M=vt("v-btn"),w=vt("v-card-actions");return st(),_t("div",Y7,[t.hasAudio?(st(),Rr(p,{key:0,src:t.audioURL},null,8,["src"])):br("",!0),t.hasImage?(st(!0),_t(Gr,{key:1},Ai(t.imageURLs,(_,C)=>(st(),_t("img",{key:C,src:_},null,8,K7))),128)):br("",!0),t.markdownText?(st(),Rr(y,{key:2,md:t.markdownText},null,8,["md"])):br("",!0),(f=t.question)!=null&&f.options?(st(),Rr(S,{key:3,"choice-list":t.truncatedOptions},null,8,["choice-list"])):t.priorAttempts==1?(st(),_t("div",X7,[pt("span",null,ir(t.obscuredAnswer),1)])):t.priorAttempts==2?(st(),_t("div",Q7,[pt("span",null,ir(t.someAnswer),1)])):br("",!0),t.isQuestion?br("",!0):(st(),Rr(w,{key:6},{default:St(()=>[ft(A),ft(M,{color:"primary",autofocus:"autofocus",onClick:t.handleNext},{default:St(()=>r[0]||(r[0]=[Yt(" Next ")])),_:1},8,["onClick"])]),_:1}))])}const j7=Mn(G7,[["render",Z7],["__scopeId","data-v-23c3a587"]]),wu=[{name:di.Blanks,fields:[{name:"Input",type:pr.MARKDOWN},{name:"Uploads",type:pr.MEDIA_UPLOADS}]}];function sw(t,r,a){const l=t.split(r),u=l[0],c=l[1].split(a),f=c[0],p=c[1];return{left:u,middle:f,right:p}}const Kb=class ub extends pi{constructor(r){var a;super(r),lt(this,"mdText",""),lt(this,"answers",null),lt(this,"options",null),this.mdText=r[0].Input,this.mdText===void 0&&(this.mdText="");const l=x7(this.mdText,"{{","}}"),u=[];for(let c=0;c<l.length;c++)try{const f=this.optionsFromString(l[c]);this.answers=f.answers,this.options=f.options,(a=this.options)!=null&&a.length?u.push("{{ || }}"):u.push("{{ }}")}catch{u.push(l[c])}this.mdText=u.join("")}splitTextToken(r){if(k7(r)){const a=sw(r.text,"{{","}}"),l=sw(r.raw,"{{","}}"),u=[];return l.left.length>0&&u.push({type:"text",raw:l.left,text:a.left}),l.middle.length>0&&u.push({type:"text",raw:"{{"+l.middle+"}}",text:"{{"+a.middle+"}}"}),l.right.length>0&&u.push({type:"text",raw:l.right,text:a.right}),u}else return[r]}optionsFromString(r){if(!r.startsWith("{{")||!r.endsWith("}}"))throw new Error(`string ${r} is not fill-in text - must look like "{{someText}}"`);r=r.substring(2,r.length-2);const a=r.split("||");if(a.length>1){const l=a[0].split("|").map(f=>f.trim()),c=a[1].split("|").map(f=>f.trim()).filter(f=>!l.includes(f));return c.push(l[ko(0,l.length-1)]),{answers:l,options:Cu.shuffle(c)}}else return{answers:[r.trim()],options:null}}isCorrect(r){if(console.log(`answers:${this.answers}
|
|
34
|
+
user answer: ${JSON.stringify(r)}`),typeof r=="string"){if(this.answers)return this.answers.includes(r);if(r==="")return!0;throw new Error("Question has no configured answers!")}else if(Array.isArray(r)){if(this.answers)return r.every(a=>this.answers.includes(a));throw new Error("Question has no configured answers!")}else return this.isCorrectRadio(r)}dataShapes(){return ub.dataShapes}views(){return ub.views}isCorrectRadio(r){return this.answers?this.answers.includes(r.choiceList[r.selection]):!1}};lt(Kb,"dataShapes",wu);lt(Kb,"views",[j7]);let xu=Kb;class Oo{constructor(r,a){lt(this,"name"),lt(this,"questionList"),this.name=r,this.questionList=a,this.questionList=this.questionList.concat(this.getBaseQTypes())}get questions(){return this.questionList}get allViews(){const r=new Array;return this.questionList.forEach(a=>{a.views.forEach(l=>{r.push(l)})}),r}get allViewsMap(){const r={};return this.allViews.forEach(a=>{if(a.name)r[a.name]=a;else throw new Error("View has no name")}),r}getQuestion(r){return this.questionList.find(a=>{const l=a.name.replace(/^_/,"").replace(/\d+$/,""),u=r.replace(/^_/,"").replace(/\d+$/,"");return a.name===r||l===u||a.name.includes(u)||r.includes(l)})}getBaseQTypes(){return[xu]}}const J7=new Oo("default",[xu]),e8=["cg-white","cg-black"],Mh=["a","b","c","d","e","f","g","h"],Eh=["1","2","3","4","5","6","7","8"],t8=[...Eh].reverse(),Xb=Array.prototype.concat(...Mh.map(t=>Eh.map(r=>t+r))),Ts=t=>Xb[8*t[0]+t[1]],In=t=>[t.charCodeAt(0)-97,t.charCodeAt(1)-49],N4=Xb.map(In);function r8(t){let r;const a=()=>(r===void 0&&(r=t()),r);return a.clear=()=>{r=void 0},a}const n8=()=>{let t;return{start(){t=performance.now()},cancel(){t=void 0},stop(){if(!t)return 0;const r=performance.now()-t;return t=void 0,r}}},Qb=t=>t==="cg-white"?"cg-black":"cg-white",$0=(t,r)=>{const a=t[0]-r[0],l=t[1]-r[1];return a*a+l*l},cb=(t,r)=>t.role===r.role&&t.color===r.color,Q0=t=>(r,a)=>[(a?r[0]:7-r[0])*t.width/8,(a?7-r[1]:r[1])*t.height/8],xa=(t,r)=>{t.style.transform=`translate(${r[0]}px,${r[1]}px)`},L4=(t,r,a=1)=>{t.style.transform=`translate(${r[0]}px,${r[1]}px) scale(${a})`},Zb=(t,r)=>{t.style.visibility=r?"visible":"hidden"},hu=t=>{var r;if(t.clientX||t.clientX===0)return[t.clientX,t.clientY];if((r=t.targetTouches)!=null&&r[0])return[t.targetTouches[0].clientX,t.targetTouches[0].clientY]},O4=t=>t.button===2,Mo=(t,r)=>{const a=document.createElement(t);return r&&(a.className=r),a};function D4(t,r,a){const l=In(t);return r||(l[0]=7-l[0],l[1]=7-l[1]),[a.left+a.width*l[0]/8+a.width/16,a.top+a.height*(7-l[1])/8+a.height/16]}const lu=(t,r)=>Math.abs(t-r),i8=t=>(r,a,l,u)=>lu(r,l)<2&&(t==="cg-white"?u===a+1||a<=1&&u===a+2&&r===l:u===a-1||a>=6&&u===a-2&&r===l),R4=(t,r,a,l)=>{const u=lu(t,a),c=lu(r,l);return u===1&&c===2||u===2&&c===1},B4=(t,r,a,l)=>lu(t,a)===lu(r,l),F4=(t,r,a,l)=>t===a||r===l,q4=(t,r,a,l)=>B4(t,r,a,l)||F4(t,r,a,l),s8=(t,r,a)=>(l,u,c,f)=>lu(l,c)<2&&lu(u,f)<2||a&&u===f&&u===(t==="cg-white"?0:7)&&(l===4&&(c===2&&r.includes(0)||c===6&&r.includes(7))||r.includes(c));function a8(t,r){const a=r==="cg-white"?"1":"8",l=[];for(const[u,c]of t)u[1]===a&&c.color===r&&c.role==="rook"&&l.push(In(u)[0]);return l}function z4(t,r,a){const l=t.get(r);if(!l)return[];const u=In(r),c=l.role,f=c==="pawn"?i8(l.color):c==="knight"?R4:c==="bishop"?B4:c==="rook"?F4:c==="queen"?q4:s8(l.color,a8(t,l.color),a);return N4.filter(p=>(u[0]!==p[0]||u[1]!==p[1])&&f(u[0],u[1],p[0],p[1])).map(Ts)}function ns(t,...r){t&&setTimeout(()=>t(...r),1)}function o8(t){t.orientation=Qb(t.orientation),t.animation.current=t.draggable.current=t.selected=void 0}function l8(t,r){for(const[a,l]of r)l?t.pieces.set(a,l):t.pieces.delete(a)}function u8(t,r){if(t.check=void 0,r===!0&&(r=t.turnColor),r)for(const[a,l]of t.pieces)l.role==="king"&&l.color===r&&(t.check=a)}function c8(t,r,a,l){jo(t),t.premovable.current=[r,a],ns(t.premovable.events.set,r,a,l)}function Zo(t){t.premovable.current&&(t.premovable.current=void 0,ns(t.premovable.events.unset))}function h8(t,r,a){Zo(t),t.predroppable.current={role:r,key:a},ns(t.predroppable.events.set,r,a)}function jo(t){const r=t.predroppable;r.current&&(r.current=void 0,ns(r.events.unset))}function f8(t,r,a){if(!t.autoCastle)return!1;const l=t.pieces.get(r);if(!l||l.role!=="king")return!1;const u=In(r),c=In(a);if(u[1]!==0&&u[1]!==7||u[1]!==c[1])return!1;u[0]===4&&!t.pieces.has(a)&&(c[0]===6?a=Ts([7,c[1]]):c[0]===2&&(a=Ts([0,c[1]])));const f=t.pieces.get(a);return!f||f.color!==l.color||f.role!=="rook"?!1:(t.pieces.delete(r),t.pieces.delete(a),u[0]<c[0]?(t.pieces.set(Ts([6,c[1]]),l),t.pieces.set(Ts([5,c[1]]),f)):(t.pieces.set(Ts([2,c[1]]),l),t.pieces.set(Ts([3,c[1]]),f)),!0)}function H4(t,r,a){const l=t.pieces.get(r),u=t.pieces.get(a);if(r===a||!l)return!1;const c=u&&u.color!==l.color?u:void 0;return a===t.selected&&Ps(t),ns(t.events.move,r,a,c),f8(t,r,a)||(t.pieces.set(a,l),t.pieces.delete(r)),t.lastMove=[r,a],t.check=void 0,ns(t.events.change),c||!0}function jb(t,r,a,l){if(t.pieces.has(a))if(l)t.pieces.delete(a);else return!1;return ns(t.events.dropNewPiece,r,a),t.pieces.set(a,r),t.lastMove=[a],t.check=void 0,ns(t.events.change),t.movable.dests=void 0,t.turnColor=Qb(t.turnColor),!0}function V4(t,r,a){const l=H4(t,r,a);return l&&(t.movable.dests=void 0,t.turnColor=Qb(t.turnColor),t.animation.current=void 0),l}function U4(t,r,a){if(Jb(t,r,a)){const l=V4(t,r,a);if(l){const u=t.hold.stop();Ps(t);const c={premove:!1,ctrlKey:t.stats.ctrlKey,holdTime:u};return l!==!0&&(c.captured=l),ns(t.movable.events.after,r,a,c),!0}}else if(p8(t,r,a))return c8(t,r,a,{ctrlKey:t.stats.ctrlKey}),Ps(t),!0;return Ps(t),!1}function $4(t,r,a,l){const u=t.pieces.get(r);u&&(d8(t,r,a)||l)?(t.pieces.delete(r),jb(t,u,a,l),ns(t.movable.events.afterNewPiece,u.role,a,{premove:!1,predrop:!1})):u&&g8(t,r,a)?h8(t,u.role,a):(Zo(t),jo(t)),t.pieces.delete(r),Ps(t)}function hb(t,r,a){if(ns(t.events.select,r),t.selected){if(t.selected===r&&!t.draggable.enabled){Ps(t),t.hold.cancel();return}else if((t.selectable.enabled||a)&&t.selected!==r&&U4(t,t.selected,r)){t.stats.dragged=!1;return}}(t.selectable.enabled||t.draggable.enabled)&&(G4(t,r)||ey(t,r))&&(W4(t,r),t.hold.start())}function W4(t,r){t.selected=r,ey(t,r)?t.premovable.customDests||(t.premovable.dests=z4(t.pieces,r,t.premovable.castle)):t.premovable.dests=void 0}function Ps(t){t.selected=void 0,t.premovable.dests=void 0,t.hold.cancel()}function G4(t,r){const a=t.pieces.get(r);return!!a&&(t.movable.color==="both"||t.movable.color===a.color&&t.turnColor===a.color)}const Jb=(t,r,a)=>{var l,u;return r!==a&&G4(t,r)&&(t.movable.free||!!((u=(l=t.movable.dests)==null?void 0:l.get(r))!=null&&u.includes(a)))};function d8(t,r,a){const l=t.pieces.get(r);return!!l&&(r===a||!t.pieces.has(a))&&(t.movable.color==="both"||t.movable.color===l.color&&t.turnColor===l.color)}function ey(t,r){const a=t.pieces.get(r);return!!a&&t.premovable.enabled&&t.movable.color===a.color&&t.turnColor!==a.color}function p8(t,r,a){var l;const u=((l=t.premovable.customDests)==null?void 0:l.get(r))??z4(t.pieces,r,t.premovable.castle);return r!==a&&ey(t,r)&&u.includes(a)}function g8(t,r,a){const l=t.pieces.get(r),u=t.pieces.get(a);return!!l&&(!u||u.color!==t.movable.color)&&t.predroppable.enabled&&(l.role!=="pawn"||a[1]!=="1"&&a[1]!=="8")&&t.movable.color===l.color&&t.turnColor!==l.color}function v8(t,r){const a=t.pieces.get(r);return!!a&&t.draggable.enabled&&(t.movable.color==="both"||t.movable.color===a.color&&(t.turnColor===a.color||t.premovable.enabled))}function m8(t){const r=t.premovable.current;if(!r)return!1;const a=r[0],l=r[1];let u=!1;if(Jb(t,a,l)){const c=V4(t,a,l);if(c){const f={premove:!0};c!==!0&&(f.captured=c),ns(t.movable.events.after,a,l,f),u=!0}}return Zo(t),u}function _8(t,r){const a=t.predroppable.current;let l=!1;if(!a)return!1;if(r(a)){const u={role:a.role,color:t.movable.color};jb(t,u,a.key)&&(ns(t.movable.events.afterNewPiece,a.role,a.key,{premove:!1,predrop:!0}),l=!0)}return jo(t),l}function ty(t){Zo(t),jo(t),Ps(t)}function aw(t){t.movable.color=t.movable.dests=t.animation.current=void 0,ty(t)}function fu(t,r,a){let l=Math.floor(8*(t[0]-a.left)/a.width);r||(l=7-l);let u=7-Math.floor(8*(t[1]-a.top)/a.height);return r||(u=7-u),l>=0&&l<8&&u>=0&&u<8?Ts([l,u]):void 0}function b8(t,r,a,l){const u=In(t),c=N4.filter(S=>q4(u[0],u[1],S[0],S[1])||R4(u[0],u[1],S[0],S[1])),p=c.map(S=>D4(Ts(S),a,l)).map(S=>$0(r,S)),[,y]=p.reduce((S,A,M)=>S[0]<A?S:[A,M],[p[0],0]);return Ts(c[y])}const is=t=>t.orientation==="cg-white",Y4="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR",y8={p:"pawn",r:"rook",n:"knight",b:"bishop",q:"queen",k:"king"},w8={pawn:"p",rook:"r",knight:"n",bishop:"b",queen:"q",king:"k"};function K4(t){t==="start"&&(t=Y4);const r=new Map;let a=7,l=0;for(const u of t)switch(u){case" ":case"[":return r;case"/":if(--a,a<0)return r;l=0;break;case"~":{const c=r.get(Ts([l-1,a]));c&&(c.promoted=!0);break}default:{const c=u.charCodeAt(0);if(c<57)l+=c-48;else{const f=u.toLowerCase();r.set(Ts([l,a]),{role:y8[f],color:u===f?"cg-black":"cg-white"}),++l}}}return r}function S8(t){return t8.map(r=>Mh.map(a=>{const l=t.get(a+r);if(l){let u=w8[l.role];return l.color==="cg-white"&&(u=u.toUpperCase()),l.promoted&&(u+="~"),u}else return"1"}).join("")).join("/").replace(/1{2,}/g,r=>r.length.toString())}function X4(t,r){r.animation&&(ry(t.animation,r.animation),(t.animation.duration||0)<70&&(t.animation.enabled=!1))}function Q4(t,r){var a,l,u;if((a=r.movable)!=null&&a.dests&&(t.movable.dests=void 0),(l=r.drawable)!=null&&l.autoShapes&&(t.drawable.autoShapes=[]),ry(t,r),r.fen&&(t.pieces=K4(r.fen),t.drawable.shapes=((u=r.drawable)==null?void 0:u.shapes)||[]),"check"in r&&u8(t,r.check||!1),"lastMove"in r&&!r.lastMove?t.lastMove=void 0:r.lastMove&&(t.lastMove=r.lastMove),t.selected&&W4(t,t.selected),X4(t,r),!t.movable.rookCastle&&t.movable.dests){const c=t.movable.color==="cg-white"?"1":"8",f="e"+c,p=t.movable.dests.get(f),y=t.pieces.get(f);if(!p||!y||y.role!=="king")return;t.movable.dests.set(f,p.filter(S=>!(S==="a"+c&&p.includes("c"+c))&&!(S==="h"+c&&p.includes("g"+c))))}}function ry(t,r){for(const a in r)Object.prototype.hasOwnProperty.call(r,a)&&(Object.prototype.hasOwnProperty.call(t,a)&&ow(t[a])&&ow(r[a])?ry(t[a],r[a]):t[a]=r[a])}function ow(t){if(typeof t!="object"||t===null)return!1;const r=Object.getPrototypeOf(t);return r===Object.prototype||r===null}const nu=(t,r)=>r.animation.enabled?k8(t,r):Go(t,r);function Go(t,r){const a=t(r);return r.dom.redraw(),a}const hm=(t,r)=>({key:t,pos:In(t),piece:r}),C8=(t,r)=>r.sort((a,l)=>$0(t.pos,a.pos)-$0(t.pos,l.pos))[0];function x8(t,r){const a=new Map,l=[],u=new Map,c=[],f=[],p=new Map;let y,S,A;for(const[M,w]of t)p.set(M,hm(M,w));for(const M of Xb)y=r.pieces.get(M),S=p.get(M),y?S?cb(y,S.piece)||(c.push(S),f.push(hm(M,y))):f.push(hm(M,y)):S&&c.push(S);for(const M of f)S=C8(M,c.filter(w=>cb(M.piece,w.piece))),S&&(A=[S.pos[0]-M.pos[0],S.pos[1]-M.pos[1]],a.set(M.key,A.concat(A)),l.push(S.key));for(const M of c)l.includes(M.key)||u.set(M.key,M.piece);return{anims:a,fadings:u}}function Z4(t,r){const a=t.animation.current;if(a===void 0){t.dom.destroyed||t.dom.redrawNow();return}const l=1-(r-a.start)*a.frequency;if(l<=0)t.animation.current=void 0,t.dom.redrawNow();else{const u=M8(l);for(const c of a.plan.anims.values())c[2]=c[0]*u,c[3]=c[1]*u;t.dom.redrawNow(!0),requestAnimationFrame((c=performance.now())=>Z4(t,c))}}function k8(t,r){const a=new Map(r.pieces),l=t(r),u=x8(a,r);if(u.anims.size||u.fadings.size){const c=r.animation.current&&r.animation.current.start;r.animation.current={start:performance.now(),frequency:1/r.animation.duration,plan:u},c||Z4(r,performance.now())}else r.dom.redraw();return l}const M8=t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1,E8=["green","red","blue","yellow"];function A8(t,r){if(r.touches&&r.touches.length>1)return;r.stopPropagation(),r.preventDefault(),r.ctrlKey?Ps(t):ty(t);const a=hu(r),l=fu(a,is(t),t.dom.bounds());l&&(t.drawable.current={orig:l,pos:a,brush:N8(r),snapToValidMove:t.drawable.defaultSnapToValidMove},j4(t))}function j4(t){requestAnimationFrame(()=>{const r=t.drawable.current;if(r){const a=fu(r.pos,is(t),t.dom.bounds());a||(r.snapToValidMove=!1);const l=r.snapToValidMove?b8(r.orig,r.pos,is(t),t.dom.bounds()):a;l!==r.mouseSq&&(r.mouseSq=l,r.dest=l!==r.orig?l:void 0,t.dom.redrawNow()),j4(t)}})}function T8(t,r){t.drawable.current&&(t.drawable.current.pos=hu(r))}function I8(t){const r=t.drawable.current;r&&(r.mouseSq&&L8(t.drawable,r),J4(t))}function J4(t){t.drawable.current&&(t.drawable.current=void 0,t.dom.redraw())}function P8(t){t.drawable.shapes.length&&(t.drawable.shapes=[],t.dom.redraw(),e2(t.drawable))}function N8(t){var r;const a=(t.shiftKey||t.ctrlKey)&&O4(t),l=t.altKey||t.metaKey||((r=t.getModifierState)==null?void 0:r.call(t,"AltGraph"));return E8[(a?1:0)+(l?2:0)]}function L8(t,r){const a=u=>u.orig===r.orig&&u.dest===r.dest,l=t.shapes.find(a);l&&(t.shapes=t.shapes.filter(u=>!a(u))),(!l||l.brush!==r.brush)&&t.shapes.push({orig:r.orig,dest:r.dest,brush:r.brush}),e2(t)}function e2(t){t.onChange&&t.onChange(t.shapes)}function O8(t,r){if(!(t.trustAllEvents||r.isTrusted)||r.buttons!==void 0&&r.buttons>1||r.touches&&r.touches.length>1)return;const a=t.dom.bounds(),l=hu(r),u=fu(l,is(t),a);if(!u)return;const c=t.pieces.get(u),f=t.selected;if(!f&&t.drawable.enabled&&(t.drawable.eraseOnClick||!c||c.color!==t.turnColor)&&P8(t),r.cancelable!==!1&&(!r.touches||t.blockTouchScroll||c||f||D8(t,l)))r.preventDefault();else if(r.touches)return;const p=!!t.premovable.current,y=!!t.predroppable.current;t.stats.ctrlKey=r.ctrlKey,t.selected&&Jb(t,t.selected,u)?nu(M=>hb(M,u),t):hb(t,u);const S=t.selected===u,A=r2(t,u);if(c&&A&&S&&v8(t,u)){t.draggable.current={orig:u,piece:c,origPos:l,pos:l,started:t.draggable.autoDistance&&t.stats.dragged,element:A,previouslySelected:f,originTarget:r.target,keyHasChanged:!1},A.cgDragging=!0,A.classList.add("dragging");const M=t.dom.elements.ghost;M&&(M.className=`ghost ${c.color} ${c.role}`,xa(M,Q0(a)(In(u),is(t))),Zb(M,!0)),ny(t)}else p&&Zo(t),y&&jo(t);t.dom.redraw()}function D8(t,r){const a=is(t),l=t.dom.bounds(),u=Math.pow(l.width/8,2);for(const c of t.pieces.keys()){const f=D4(c,a,l);if($0(f,r)<=u)return!0}return!1}function R8(t,r,a,l){const u="a0";t.pieces.set(u,r),t.dom.redraw();const c=hu(a);t.draggable.current={orig:u,piece:r,origPos:c,pos:c,started:!0,element:()=>r2(t,u),originTarget:a.target,newPiece:!0,force:!!l,keyHasChanged:!1},ny(t)}function ny(t){requestAnimationFrame(()=>{var r;const a=t.draggable.current;if(!a)return;(r=t.animation.current)!=null&&r.plan.anims.has(a.orig)&&(t.animation.current=void 0);const l=t.pieces.get(a.orig);if(!l||!cb(l,a.piece))Ah(t);else if(!a.started&&$0(a.pos,a.origPos)>=Math.pow(t.draggable.distance,2)&&(a.started=!0),a.started){if(typeof a.element=="function"){const c=a.element();if(!c)return;c.cgDragging=!0,c.classList.add("dragging"),a.element=c}const u=t.dom.bounds();xa(a.element,[a.pos[0]-u.left-u.width/16,a.pos[1]-u.top-u.height/16]),a.keyHasChanged=a.keyHasChanged||a.orig!==fu(a.pos,is(t),u)}ny(t)})}function B8(t,r){t.draggable.current&&(!r.touches||r.touches.length<2)&&(t.draggable.current.pos=hu(r))}function F8(t,r){const a=t.draggable.current;if(!a)return;if(r.type==="touchend"&&r.cancelable!==!1&&r.preventDefault(),r.type==="touchend"&&a.originTarget!==r.target&&!a.newPiece){t.draggable.current=void 0;return}Zo(t),jo(t);const l=hu(r)||a.pos,u=fu(l,is(t),t.dom.bounds());u&&a.started&&a.orig!==u?a.newPiece?$4(t,a.orig,u,a.force):(t.stats.ctrlKey=r.ctrlKey,U4(t,a.orig,u)&&(t.stats.dragged=!0)):a.newPiece?t.pieces.delete(a.orig):t.draggable.deleteOnDropOff&&!u&&(t.pieces.delete(a.orig),ns(t.events.change)),(a.orig===a.previouslySelected||a.keyHasChanged)&&(a.orig===u||!u)?Ps(t):t.selectable.enabled||Ps(t),t2(t),t.draggable.current=void 0,t.dom.redraw()}function Ah(t){const r=t.draggable.current;r&&(r.newPiece&&t.pieces.delete(r.orig),t.draggable.current=void 0,Ps(t),t2(t),t.dom.redraw())}function t2(t){const r=t.dom.elements;r.ghost&&Zb(r.ghost,!1)}function r2(t,r){let a=t.dom.elements.board.firstChild;for(;a;){if(a.cgKey===r&&a.tagName==="PIECE")return a;a=a.nextSibling}}function q8(t,r){t.exploding={stage:1,keys:r},t.dom.redraw(),setTimeout(()=>{lw(t,2),setTimeout(()=>lw(t,void 0),120)},120)}function lw(t,r){t.exploding&&(r?t.exploding.stage=r:t.exploding=void 0,t.dom.redraw())}function z8(t,r){function a(){o8(t),r()}return{set(l){l.orientation&&l.orientation!==t.orientation&&a(),X4(t,l),(l.fen?nu:Go)(u=>Q4(u,l),t)},state:t,getFen:()=>S8(t.pieces),toggleOrientation:a,setPieces(l){nu(u=>l8(u,l),t)},selectSquare(l,u){l?nu(c=>hb(c,l,u),t):t.selected&&(Ps(t),t.dom.redraw())},move(l,u){nu(c=>H4(c,l,u),t)},newPiece(l,u){nu(c=>jb(c,l,u),t)},playPremove(){if(t.premovable.current){if(nu(m8,t))return!0;t.dom.redraw()}return!1},playPredrop(l){if(t.predroppable.current){const u=_8(t,l);return t.dom.redraw(),u}return!1},cancelPremove(){Go(Zo,t)},cancelPredrop(){Go(jo,t)},cancelMove(){Go(l=>{ty(l),Ah(l)},t)},stop(){Go(l=>{aw(l),Ah(l)},t)},explode(l){q8(t,l)},setAutoShapes(l){Go(u=>u.drawable.autoShapes=l,t)},setShapes(l){Go(u=>u.drawable.shapes=l,t)},getKeyAtDomPos(l){return fu(l,is(t),t.dom.bounds())},redrawAll:r,dragNewPiece(l,u,c){R8(t,l,u,c)},destroy(){aw(t),t.dom.unbind&&t.dom.unbind(),t.dom.destroyed=!0}}}function H8(){return{pieces:K4(Y4),orientation:"cg-white",turnColor:"cg-white",coordinates:!0,coordinatesOnSquares:!1,ranksPosition:"right",autoCastle:!0,viewOnly:!1,disableContextMenu:!1,addPieceZIndex:!1,blockTouchScroll:!1,pieceKey:!1,trustAllEvents:!1,highlight:{lastMove:!0,check:!0},animation:{enabled:!0,duration:200},movable:{free:!0,color:"both",showDests:!0,events:{},rookCastle:!0},premovable:{enabled:!0,showDests:!0,castle:!0,events:{}},predroppable:{enabled:!1,events:{}},draggable:{enabled:!0,distance:3,autoDistance:!0,showGhost:!0,deleteOnDropOff:!1},dropmode:{active:!1},selectable:{enabled:!0},stats:{dragged:!("ontouchstart"in window)},events:{},drawable:{enabled:!0,visible:!0,defaultSnapToValidMove:!0,eraseOnClick:!0,shapes:[],autoShapes:[],brushes:{green:{key:"g",color:"#15781B",opacity:1,lineWidth:10},red:{key:"r",color:"#882020",opacity:1,lineWidth:10},blue:{key:"b",color:"#003088",opacity:1,lineWidth:10},yellow:{key:"y",color:"#e68f00",opacity:1,lineWidth:10},paleBlue:{key:"pb",color:"#003088",opacity:.4,lineWidth:15},paleGreen:{key:"pg",color:"#15781B",opacity:.4,lineWidth:15},paleRed:{key:"pr",color:"#882020",opacity:.4,lineWidth:15},paleGrey:{key:"pgr",color:"#4a4a4a",opacity:.35,lineWidth:15},purple:{key:"purple",color:"#68217a",opacity:.65,lineWidth:10},pink:{key:"pink",color:"#ee2080",opacity:.5,lineWidth:10},white:{key:"white",color:"white",opacity:1,lineWidth:10}},prevSvgHash:""},hold:n8()}}const uw={hilitePrimary:{key:"hilitePrimary",color:"#3291ff",opacity:1,lineWidth:1},hiliteWhite:{key:"hiliteWhite",color:"#ffffff",opacity:1,lineWidth:1}};function V8(){const t=hi("defs"),r=Xi(hi("filter"),{id:"cg-filter-blur"});return r.appendChild(Xi(hi("feGaussianBlur"),{stdDeviation:"0.019"})),t.appendChild(r),t}function U8(t,r,a){const l=t.drawable,u=l.current,c=u&&u.mouseSq?u:void 0,f=new Map,p=t.dom.bounds(),y=l.autoShapes.filter(w=>!w.piece);for(const w of l.shapes.concat(y).concat(c?[c]:[])){if(!w.dest)continue;const _=f.get(w.dest)??new Set,C=Ph(Ih(In(w.orig),t.orientation),p),m=Ph(Ih(In(w.dest),t.orientation),p);_.add(db(C,m)),f.set(w.dest,_)}const S=l.shapes.concat(y).map(w=>({shape:w,current:!1,hash:cw(w,fb(w.dest,f),!1,p)}));c&&S.push({shape:c,current:!0,hash:cw(c,fb(c.dest,f),!0,p)});const A=S.map(w=>w.hash).join(";");if(A===t.drawable.prevSvgHash)return;t.drawable.prevSvgHash=A;const M=r.querySelector("defs");$8(l,S,M),W8(S,r.querySelector("g"),a.querySelector("g"),w=>K8(t,w,l.brushes,f,p))}function $8(t,r,a){var l;const u=new Map;let c;for(const y of r.filter(S=>S.shape.dest&&S.shape.brush))c=n2(t.brushes[y.shape.brush],y.shape.modifiers),(l=y.shape.modifiers)!=null&&l.hilite&&u.set(Th(c).key,Th(c)),u.set(c.key,c);const f=new Set;let p=a.firstElementChild;for(;p;)f.add(p.getAttribute("cgKey")),p=p.nextElementSibling;for(const[y,S]of u.entries())f.has(y)||a.appendChild(Z8(S))}function W8(t,r,a,l){const u=new Map;for(const c of t)u.set(c.hash,!1);for(const c of[r,a]){const f=[];let p=c.firstElementChild,y;for(;p;)y=p.getAttribute("cgHash"),u.has(y)?u.set(y,!0):f.push(p),p=p.nextElementSibling;for(const S of f)c.removeChild(S)}for(const c of t.filter(f=>!u.get(f.hash)))for(const f of l(c))f.isCustom?a.appendChild(f.el):r.appendChild(f.el)}function cw({orig:t,dest:r,brush:a,piece:l,modifiers:u,customSvg:c,label:f},p,y,S){var A;return[S.width,S.height,y,t,r,a,p&&"-",l&&G8(l),u&&Y8(u),c&&`custom-${hw(c.html)},${((A=c.center)==null?void 0:A[0])??"o"}`,f&&`label-${hw(f.text)}`].filter(M=>M).join(",")}function G8(t){return[t.color,t.role,t.scale].filter(r=>r).join(",")}function Y8(t){return[t.lineWidth,t.hilite&&"*"].filter(r=>r).join(",")}function hw(t){let r=0;for(let a=0;a<t.length;a++)r=(r<<5)-r+t.charCodeAt(a)>>>0;return r.toString()}function K8(t,{shape:r,current:a,hash:l},u,c,f){const p=Ph(Ih(In(r.orig),t.orientation),f),y=r.dest?Ph(Ih(In(r.dest),t.orientation),f):p,S=r.brush&&n2(u[r.brush],r.modifiers),A=c.get(r.dest),M=[];if(S){const w=Xi(hi("g"),{cgHash:l});M.push({el:w}),p[0]!==y[0]||p[1]!==y[1]?w.appendChild(Q8(r,S,p,y,a,fb(r.dest,c))):w.appendChild(X8(u[r.brush],p,a,f))}if(r.label){const w=r.label;w.fill||r.brush&&u[r.brush]&&(w.fill=u[r.brush].color);const _=r.brush?void 0:"tr";M.push({el:j8(w,l,p,y,A,_),isCustom:!0})}if(r.customSvg){const w=r.customSvg.center??"orig",[_,C]=w==="label"?s2(p,y,A).map(T=>T-.5):w==="dest"?y:p,m=Xi(hi("g"),{transform:`translate(${_},${C})`,cgHash:l});m.innerHTML=`<svg width="1" height="1" viewBox="0 0 100 100">${r.customSvg.html}</svg>`,M.push({el:m,isCustom:!0})}return M}function X8(t,r,a,l){const u=J8(),c=(l.width+l.height)/(4*Math.max(l.width,l.height));return Xi(hi("circle"),{stroke:t.color,"stroke-width":u[a?0:1],fill:"none",opacity:i2(t,a),cx:r[0],cy:r[1],r:c-u[1]/2})}function Th(t){return["#ffffff","#fff","white"].includes(t.color)?uw.hilitePrimary:uw.hiliteWhite}function Q8(t,r,a,l,u,c){var f;function p(A){var M;const w=tS(c&&!u),_=l[0]-a[0],C=l[1]-a[1],m=Math.atan2(C,_),T=Math.cos(m)*w,L=Math.sin(m)*w;return Xi(hi("line"),{stroke:A?Th(r).color:r.color,"stroke-width":eS(r,u)+(A?.04:0),"stroke-linecap":"round","marker-end":`url(#arrowhead-${A?Th(r).key:r.key})`,opacity:(M=t.modifiers)!=null&&M.hilite?1:i2(r,u),x1:a[0],y1:a[1],x2:l[0]-T,y2:l[1]-L})}if(!((f=t.modifiers)!=null&&f.hilite))return p(!1);const y=hi("g"),S=Xi(hi("g"),{filter:"url(#cg-filter-blur)"});return S.appendChild(rS(a,l)),S.appendChild(p(!0)),y.appendChild(S),y.appendChild(p(!1)),y}function Z8(t){const r=Xi(hi("marker"),{id:"arrowhead-"+t.key,orient:"auto",overflow:"visible",markerWidth:4,markerHeight:4,refX:t.key.startsWith("hilite")?1.86:2.05,refY:2});return r.appendChild(Xi(hi("path"),{d:"M0,0 V4 L3,2 Z",fill:t.color})),r.setAttribute("cgKey",t.key),r}function j8(t,r,a,l,u,c){const p=.4*.75**t.text.length,y=s2(a,l,u),S=c==="tr"?.4:0,A=Xi(hi("g"),{transform:`translate(${y[0]+S},${y[1]-S})`,cgHash:r});A.appendChild(Xi(hi("circle"),{r:.4/2,"fill-opacity":c?1:.8,"stroke-opacity":c?1:.7,"stroke-width":.03,fill:t.fill??"#666",stroke:"white"}));const M=Xi(hi("text"),{"font-size":p,"font-family":"Noto Sans","text-anchor":"middle",fill:"white",y:.13*.75**t.text.length});return M.innerHTML=t.text,A.appendChild(M),A}function Ih(t,r){return r==="cg-white"?t:[7-t[0],7-t[1]]}function fb(t,r){return(t&&r.has(t)&&r.get(t).size>1)===!0}function hi(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Xi(t,r){for(const a in r)Object.prototype.hasOwnProperty.call(r,a)&&t.setAttribute(a,r[a]);return t}function n2(t,r){return r?{color:t.color,opacity:Math.round(t.opacity*10)/10,lineWidth:Math.round(r.lineWidth||t.lineWidth),key:[t.key,r.lineWidth].filter(a=>a).join("")}:t}function J8(){return[3/64,4/64]}function eS(t,r){return(t.lineWidth||10)*(r?.85:1)/64}function i2(t,r){return(t.opacity||1)*(r?.9:1)}function tS(t){return(t?20:10)/64}function Ph(t,r){const a=Math.min(1,r.width/r.height),l=Math.min(1,r.height/r.width);return[(t[0]-3.5)*a,(3.5-t[1])*l]}function rS(t,r){const a={from:[Math.floor(Math.min(t[0],r[0])),Math.floor(Math.min(t[1],r[1]))],to:[Math.ceil(Math.max(t[0],r[0])),Math.ceil(Math.max(t[1],r[1]))]};return Xi(hi("rect"),{x:a.from[0],y:a.from[1],width:a.to[0]-a.from[0],height:a.to[1]-a.from[1],fill:"none",stroke:"none"})}function db(t,r,a=!0){const l=Math.atan2(r[1]-t[1],r[0]-t[0])+Math.PI;return a?(Math.round(l*8/Math.PI)+16)%16:l}function nS(t,r){return Math.sqrt([t[0]-r[0],t[1]-r[1]].reduce((a,l)=>a+l*l,0))}function s2(t,r,a){let l=nS(t,r);const u=db(t,r,!1);if(a&&(l-=33/64,a.size>1)){l-=10/64;const c=db(t,r);(a.has((c+1)%16)||a.has((c+15)%16))&&c&1&&(l-=.4)}return[t[0]-Math.cos(u)*l,t[1]-Math.sin(u)*l].map(c=>c+.5)}function iS(t,r){t.innerHTML="",t.classList.add("cg-wrap");for(const y of e8)t.classList.toggle("orientation-"+y,r.orientation===y);t.classList.toggle("manipulable",!r.viewOnly);const a=Mo("cg-container");t.appendChild(a);const l=Mo("cg-board");a.appendChild(l);let u,c,f;if(r.drawable.visible&&(u=Xi(hi("svg"),{class:"cg-shapes",viewBox:"-4 -4 8 8",preserveAspectRatio:"xMidYMid slice"}),u.appendChild(V8()),u.appendChild(hi("g")),c=Xi(hi("svg"),{class:"cg-custom-svgs",viewBox:"-3.5 -3.5 8 8",preserveAspectRatio:"xMidYMid slice"}),c.appendChild(hi("g")),f=Mo("cg-auto-pieces"),a.appendChild(u),a.appendChild(c),a.appendChild(f)),r.coordinates){const y=r.orientation==="cg-black"?" black":"",S=r.ranksPosition==="left"?" left":"";if(r.coordinatesOnSquares){const A=r.orientation==="cg-white"?M=>M+1:M=>8-M;Mh.forEach((M,w)=>a.appendChild(fm(Eh.map(_=>M+_),"squares rank"+A(w)+y+S)))}else a.appendChild(fm(Eh,"ranks"+y+S)),a.appendChild(fm(Mh,"files"+y))}let p;return r.draggable.enabled&&r.draggable.showGhost&&(p=Mo("piece","ghost"),Zb(p,!1),a.appendChild(p)),{board:l,container:a,wrap:t,ghost:p,svg:u,customSvg:c,autoPieces:f}}function fm(t,r){const a=Mo("coords",r);let l;for(const u of t)l=Mo("coord"),l.textContent=u,a.appendChild(l);return a}function sS(t,r){if(!t.dropmode.active)return;Zo(t),jo(t);const a=t.dropmode.piece;if(a){t.pieces.set("a0",a);const l=hu(r),u=l&&fu(l,is(t),t.dom.bounds());u&&$4(t,"a0",u)}t.dom.redraw()}function aS(t){const r=t.dom.elements.board;if((t.disableContextMenu||t.drawable.enabled)&&r.addEventListener("contextmenu",l=>l.preventDefault()),t.viewOnly)return;const a=lS(t);r.addEventListener("touchstart",a,{passive:!1}),r.addEventListener("mousedown",a,{passive:!1})}function oS(t,r){const a=[];if("ResizeObserver"in window||a.push(O0(document.body,"chessground.resize",r)),!t.viewOnly){const l=fw(t,B8,T8),u=fw(t,F8,I8);for(const f of["touchmove","mousemove"])a.push(O0(document,f,l));for(const f of["touchend","mouseup"])a.push(O0(document,f,u));const c=()=>t.dom.bounds.clear();a.push(O0(document,"scroll",c,{capture:!0,passive:!0})),a.push(O0(window,"resize",c,{passive:!0}))}return()=>a.forEach(l=>l())}function O0(t,r,a,l){return t.addEventListener(r,a,l),()=>t.removeEventListener(r,a,l)}const lS=t=>r=>{t.draggable.current?Ah(t):t.drawable.current?J4(t):r.shiftKey||O4(r)?t.drawable.enabled&&A8(t,r):t.viewOnly||(t.dropmode.active?sS(t,r):O8(t,r))},fw=(t,r,a)=>l=>{t.drawable.current?t.drawable.enabled&&a(t,l):t.viewOnly||r(t,l)};function uS(t){const r=is(t),a=Q0(t.dom.bounds()),l=t.dom.elements.board,u=t.pieces,c=t.animation.current,f=c?c.plan.anims:new Map,p=c?c.plan.fadings:new Map,y=t.draggable.current,S=hS(t),A=new Set,M=new Set,w=new Map,_=new Map;let C,m,T,L,N,B,W,G,R,ye;for(m=l.firstChild;m;){if(C=m.cgKey,a2(m))if(T=u.get(C),N=f.get(C),B=p.get(C),L=m.cgPiece,m.cgDragging&&(!y||y.orig!==C)&&(m.classList.remove("dragging"),xa(m,a(In(C),r)),m.cgDragging=!1),!B&&m.cgFading&&(m.cgFading=!1,m.classList.remove("fading")),T){if(N&&m.cgAnimating&&L===D0(T)){const q=In(C);q[0]+=N[2],q[1]+=N[3],m.classList.add("anim"),xa(m,a(q,r))}else m.cgAnimating&&(m.cgAnimating=!1,m.classList.remove("anim"),xa(m,a(In(C),r)),t.addPieceZIndex&&(m.style.zIndex=dm(In(C),r)));L===D0(T)&&(!B||!m.cgFading)?A.add(C):B&&L===D0(B)?(m.classList.add("fading"),m.cgFading=!0):pm(w,L,m)}else pm(w,L,m);else if(o2(m)){const q=m.className;S.get(C)===q?M.add(C):pm(_,q,m)}m=m.nextSibling}for(const[q,se]of S)if(!M.has(q)){R=_.get(se),ye=R&&R.pop();const ve=a(In(q),r);if(ye)ye.cgKey=q,xa(ye,ve);else{const he=Mo("square",se);he.cgKey=q,xa(he,ve),l.insertBefore(he,l.firstChild)}}for(const[q,se]of u)if(N=f.get(q),!A.has(q))if(W=w.get(D0(se)),G=W&&W.pop(),G){G.cgKey=q,G.cgFading&&(G.classList.remove("fading"),G.cgFading=!1);const ve=In(q);t.addPieceZIndex&&(G.style.zIndex=dm(ve,r)),N&&(G.cgAnimating=!0,G.classList.add("anim"),ve[0]+=N[2],ve[1]+=N[3]),xa(G,a(ve,r))}else{const ve=D0(se),he=Mo("piece",ve),ce=In(q);he.cgPiece=ve,he.cgKey=q,N&&(he.cgAnimating=!0,ce[0]+=N[2],ce[1]+=N[3]),xa(he,a(ce,r)),t.addPieceZIndex&&(he.style.zIndex=dm(ce,r)),l.appendChild(he)}for(const q of w.values())pw(t,q);for(const q of _.values())pw(t,q)}function cS(t){const r=is(t),a=Q0(t.dom.bounds());let l=t.dom.elements.board.firstChild;for(;l;)(a2(l)&&!l.cgAnimating||o2(l))&&xa(l,a(In(l.cgKey),r)),l=l.nextSibling}function dw(t){var r,a;const l=t.dom.elements.wrap.getBoundingClientRect(),u=t.dom.elements.container,c=l.height/l.width,f=Math.floor(l.width*window.devicePixelRatio/8)*8/window.devicePixelRatio,p=f*c;u.style.width=f+"px",u.style.height=p+"px",t.dom.bounds.clear(),(r=t.addDimensionsCssVarsTo)==null||r.style.setProperty("---cg-width",f+"px"),(a=t.addDimensionsCssVarsTo)==null||a.style.setProperty("---cg-height",p+"px")}const a2=t=>t.tagName==="PIECE",o2=t=>t.tagName==="SQUARE";function pw(t,r){for(const a of r)t.dom.elements.board.removeChild(a)}function dm(t,r){const l=t[1];return`${r?10-l:3+l}`}const D0=t=>`${t.color} ${t.role}`;function hS(t){var r,a;const l=new Map;if(t.lastMove&&t.highlight.lastMove)for(const f of t.lastMove)So(l,f,"last-move");if(t.check&&t.highlight.check&&So(l,t.check,"check"),t.selected&&(So(l,t.selected,"selected"),t.movable.showDests)){const f=(r=t.movable.dests)==null?void 0:r.get(t.selected);if(f)for(const y of f)So(l,y,"move-dest"+(t.pieces.has(y)?" oc":""));const p=((a=t.premovable.customDests)==null?void 0:a.get(t.selected))??t.premovable.dests;if(p)for(const y of p)So(l,y,"premove-dest"+(t.pieces.has(y)?" oc":""))}const u=t.premovable.current;if(u)for(const f of u)So(l,f,"current-premove");else t.predroppable.current&&So(l,t.predroppable.current.key,"current-premove");const c=t.exploding;if(c)for(const f of c.keys)So(l,f,"exploding"+c.stage);return t.highlight.custom&&t.highlight.custom.forEach((f,p)=>{So(l,p,f)}),l}function So(t,r,a){const l=t.get(r);l?t.set(r,`${l} ${a}`):t.set(r,a)}function pm(t,r,a){const l=t.get(r);l?l.push(a):t.set(r,[a])}function fS(t,r,a){const l=new Map,u=[];for(const p of t)l.set(p.hash,!1);let c=r.firstElementChild,f;for(;c;)f=c.getAttribute("cgHash"),l.has(f)?l.set(f,!0):u.push(c),c=c.nextElementSibling;for(const p of u)r.removeChild(p);for(const p of t)l.get(p.hash)||r.appendChild(a(p))}function dS(t,r){const l=t.drawable.autoShapes.filter(u=>u.piece).map(u=>({shape:u,hash:vS(u),current:!1}));fS(l,r,u=>gS(t,u,t.dom.bounds()))}function pS(t){var r;const a=is(t),l=Q0(t.dom.bounds());let u=(r=t.dom.elements.autoPieces)==null?void 0:r.firstChild;for(;u;)L4(u,l(In(u.cgKey),a),u.cgScale),u=u.nextSibling}function gS(t,{shape:r,hash:a},l){var u,c,f;const p=r.orig,y=(u=r.piece)==null?void 0:u.role,S=(c=r.piece)==null?void 0:c.color,A=(f=r.piece)==null?void 0:f.scale,M=Mo("piece",`${y} ${S}`);return M.setAttribute("cgHash",a),M.cgKey=p,M.cgScale=A,L4(M,Q0(l)(In(p),is(t)),A),M}const vS=t=>{var r,a,l;return[t.orig,(r=t.piece)==null?void 0:r.role,(a=t.piece)==null?void 0:a.color,(l=t.piece)==null?void 0:l.scale].join(",")};function mS(t,r){const a=H8();Q4(a,r||{});function l(){const u="dom"in a?a.dom.unbind:void 0,c=iS(t,a),f=r8(()=>c.board.getBoundingClientRect()),p=A=>{uS(S),c.autoPieces&&dS(S,c.autoPieces),!A&&c.svg&&U8(S,c.svg,c.customSvg)},y=()=>{dw(S),cS(S),c.autoPieces&&pS(S)},S=a;return S.dom={elements:c,bounds:f,redraw:_S(p),redrawNow:p,unbind:u},S.drawable.prevSvgHash="",dw(S),p(!1),aS(S),u||(S.dom.unbind=oS(S,y)),S.events.insert&&S.events.insert(c),S}return z8(l(),l)}function _S(t){let r=!1;return()=>{r||(r=!0,requestAnimationFrame(()=>{t(),r=!1}))}}/**
|
|
35
|
+
* @license
|
|
36
|
+
* Copyright (c) 2025, Jeff Hlywa (jhlywa@gmail.com)
|
|
37
|
+
* All rights reserved.
|
|
38
|
+
*
|
|
39
|
+
* Redistribution and use in source and binary forms, with or without
|
|
40
|
+
* modification, are permitted provided that the following conditions are met:
|
|
41
|
+
*
|
|
42
|
+
* 1. Redistributions of source code must retain the above copyright notice,
|
|
43
|
+
* this list of conditions and the following disclaimer.
|
|
44
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
45
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
46
|
+
* and/or other materials provided with the distribution.
|
|
47
|
+
*
|
|
48
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
49
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
50
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
51
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
52
|
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
53
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
54
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
55
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
56
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
57
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
58
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
59
|
+
*/const Li="w",As="b",_i="p",pb="n",vh="b",z0="r",Yo="q",ci="k",gm="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";class ch{constructor(r,a){lt(this,"color"),lt(this,"from"),lt(this,"to"),lt(this,"piece"),lt(this,"captured"),lt(this,"promotion"),lt(this,"flags"),lt(this,"san"),lt(this,"lan"),lt(this,"before"),lt(this,"after");const{color:l,piece:u,from:c,to:f,flags:p,captured:y,promotion:S}=a,A=Oi(c),M=Oi(f);this.color=l,this.piece=u,this.from=A,this.to=M,this.san=r._moveToSan(a,r._moves({legal:!0})),this.lan=A+M,this.before=r.fen(),r._makeMove(a),this.after=r.fen(),r._undoMove(),this.flags="";for(const w in Ar)Ar[w]&p&&(this.flags+=eu[w]);y&&(this.captured=y),S&&(this.promotion=S,this.lan+=S)}isCapture(){return this.flags.indexOf(eu.CAPTURE)>-1}isPromotion(){return this.flags.indexOf(eu.PROMOTION)>-1}isEnPassant(){return this.flags.indexOf(eu.EP_CAPTURE)>-1}isKingsideCastle(){return this.flags.indexOf(eu.KSIDE_CASTLE)>-1}isQueensideCastle(){return this.flags.indexOf(eu.QSIDE_CASTLE)>-1}isBigPawn(){return this.flags.indexOf(eu.BIG_PAWN)>-1}}const es=-1,eu={NORMAL:"n",CAPTURE:"c",BIG_PAWN:"b",EP_CAPTURE:"e",PROMOTION:"p",KSIDE_CASTLE:"k",QSIDE_CASTLE:"q"},bS=["a8","b8","c8","d8","e8","f8","g8","h8","a7","b7","c7","d7","e7","f7","g7","h7","a6","b6","c6","d6","e6","f6","g6","h6","a5","b5","c5","d5","e5","f5","g5","h5","a4","b4","c4","d4","e4","f4","g4","h4","a3","b3","c3","d3","e3","f3","g3","h3","a2","b2","c2","d2","e2","f2","g2","h2","a1","b1","c1","d1","e1","f1","g1","h1"],Ar={NORMAL:1,CAPTURE:2,BIG_PAWN:4,EP_CAPTURE:8,PROMOTION:16,KSIDE_CASTLE:32,QSIDE_CASTLE:64},xr={a8:0,b8:1,c8:2,d8:3,e8:4,f8:5,g8:6,h8:7,a7:16,b7:17,c7:18,d7:19,e7:20,f7:21,g7:22,h7:23,a6:32,b6:33,c6:34,d6:35,e6:36,f6:37,g6:38,h6:39,a5:48,b5:49,c5:50,d5:51,e5:52,f5:53,g5:54,h5:55,a4:64,b4:65,c4:66,d4:67,e4:68,f4:69,g4:70,h4:71,a3:80,b3:81,c3:82,d3:83,e3:84,f3:85,g3:86,h3:87,a2:96,b2:97,c2:98,d2:99,e2:100,f2:101,g2:102,h2:103,a1:112,b1:113,c1:114,d1:115,e1:116,f1:117,g1:118,h1:119},vm={b:[16,32,17,15],w:[-16,-32,-17,-15]},gw={n:[-18,-33,-31,-14,18,33,31,14],b:[-17,-15,17,15],r:[-16,1,16,-1],q:[-17,-16,-15,1,17,16,15,-1],k:[-17,-16,-15,1,17,16,15,-1]},yS=[20,0,0,0,0,0,0,24,0,0,0,0,0,0,20,0,0,20,0,0,0,0,0,24,0,0,0,0,0,20,0,0,0,0,20,0,0,0,0,24,0,0,0,0,20,0,0,0,0,0,0,20,0,0,0,24,0,0,0,20,0,0,0,0,0,0,0,0,20,0,0,24,0,0,20,0,0,0,0,0,0,0,0,0,0,20,2,24,2,20,0,0,0,0,0,0,0,0,0,0,0,2,53,56,53,2,0,0,0,0,0,0,24,24,24,24,24,24,56,0,56,24,24,24,24,24,24,0,0,0,0,0,0,2,53,56,53,2,0,0,0,0,0,0,0,0,0,0,0,20,2,24,2,20,0,0,0,0,0,0,0,0,0,0,20,0,0,24,0,0,20,0,0,0,0,0,0,0,0,20,0,0,0,24,0,0,0,20,0,0,0,0,0,0,20,0,0,0,0,24,0,0,0,0,20,0,0,0,0,20,0,0,0,0,0,24,0,0,0,0,0,20,0,0,20,0,0,0,0,0,0,24,0,0,0,0,0,0,20],wS=[17,0,0,0,0,0,0,16,0,0,0,0,0,0,15,0,0,17,0,0,0,0,0,16,0,0,0,0,0,15,0,0,0,0,17,0,0,0,0,16,0,0,0,0,15,0,0,0,0,0,0,17,0,0,0,16,0,0,0,15,0,0,0,0,0,0,0,0,17,0,0,16,0,0,15,0,0,0,0,0,0,0,0,0,0,17,0,16,0,15,0,0,0,0,0,0,0,0,0,0,0,0,17,16,15,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,-15,-16,-17,0,0,0,0,0,0,0,0,0,0,0,0,-15,0,-16,0,-17,0,0,0,0,0,0,0,0,0,0,-15,0,0,-16,0,0,-17,0,0,0,0,0,0,0,0,-15,0,0,0,-16,0,0,0,-17,0,0,0,0,0,0,-15,0,0,0,0,-16,0,0,0,0,-17,0,0,0,0,-15,0,0,0,0,0,-16,0,0,0,0,0,-17,0,0,-15,0,0,0,0,0,0,-16,0,0,0,0,0,0,-17],SS={p:1,n:2,b:4,r:8,q:16,k:32},CS="pnbrqkPNBRQK",vw=[pb,vh,z0,Yo],xS=7,kS=6,MS=1,ES=0,hh={[ci]:Ar.KSIDE_CASTLE,[Yo]:Ar.QSIDE_CASTLE},$o={w:[{square:xr.a1,flag:Ar.QSIDE_CASTLE},{square:xr.h1,flag:Ar.KSIDE_CASTLE}],b:[{square:xr.a8,flag:Ar.QSIDE_CASTLE},{square:xr.h8,flag:Ar.KSIDE_CASTLE}]},AS={b:MS,w:kS},TS=["1-0","0-1","1/2-1/2","*"];function au(t){return t>>4}function W0(t){return t&15}function l2(t){return"0123456789".indexOf(t)!==-1}function Oi(t){const r=W0(t),a=au(t);return"abcdefgh".substring(r,r+1)+"87654321".substring(a,a+1)}function R0(t){return t===Li?As:Li}function IS(t){const r=t.split(/\s+/);if(r.length!==6)return{ok:!1,error:"Invalid FEN: must contain six space-delimited fields"};const a=parseInt(r[5],10);if(isNaN(a)||a<=0)return{ok:!1,error:"Invalid FEN: move number must be a positive integer"};const l=parseInt(r[4],10);if(isNaN(l)||l<0)return{ok:!1,error:"Invalid FEN: half move counter number must be a non-negative integer"};if(!/^(-|[abcdefgh][36])$/.test(r[3]))return{ok:!1,error:"Invalid FEN: en-passant square is invalid"};if(/[^kKqQ-]/.test(r[2]))return{ok:!1,error:"Invalid FEN: castling availability is invalid"};if(!/^(w|b)$/.test(r[1]))return{ok:!1,error:"Invalid FEN: side-to-move is invalid"};const u=r[0].split("/");if(u.length!==8)return{ok:!1,error:"Invalid FEN: piece data does not contain 8 '/'-delimited rows"};for(let f=0;f<u.length;f++){let p=0,y=!1;for(let S=0;S<u[f].length;S++)if(l2(u[f][S])){if(y)return{ok:!1,error:"Invalid FEN: piece data is invalid (consecutive number)"};p+=parseInt(u[f][S],10),y=!0}else{if(!/^[prnbqkPRNBQK]$/.test(u[f][S]))return{ok:!1,error:"Invalid FEN: piece data is invalid (invalid piece)"};p+=1,y=!1}if(p!==8)return{ok:!1,error:"Invalid FEN: piece data is invalid (too many squares in rank)"}}if(r[3][1]=="3"&&r[1]=="w"||r[3][1]=="6"&&r[1]=="b")return{ok:!1,error:"Invalid FEN: illegal en-passant square"};const c=[{color:"white",regex:/K/g},{color:"black",regex:/k/g}];for(const{color:f,regex:p}of c){if(!p.test(r[0]))return{ok:!1,error:`Invalid FEN: missing ${f} king`};if((r[0].match(p)||[]).length>1)return{ok:!1,error:`Invalid FEN: too many ${f} kings`}}return Array.from(u[0]+u[7]).some(f=>f.toUpperCase()==="P")?{ok:!1,error:"Invalid FEN: some pawns are on the edge rows"}:{ok:!0}}function PS(t,r){const a=t.from,l=t.to,u=t.piece;let c=0,f=0,p=0;for(let y=0,S=r.length;y<S;y++){const A=r[y].from,M=r[y].to,w=r[y].piece;u===w&&a!==A&&l===M&&(c++,au(a)===au(A)&&f++,W0(a)===W0(A)&&p++)}return c>0?f>0&&p>0?Oi(a):p>0?Oi(a).charAt(1):Oi(a).charAt(0):""}function Wo(t,r,a,l,u,c=void 0,f=Ar.NORMAL){const p=au(l);if(u===_i&&(p===xS||p===ES))for(let y=0;y<vw.length;y++){const S=vw[y];t.push({color:r,from:a,to:l,piece:u,captured:c,promotion:S,flags:f|Ar.PROMOTION})}else t.push({color:r,from:a,to:l,piece:u,captured:c,flags:f})}function mw(t){let r=t.charAt(0);return r>="a"&&r<="h"?t.match(/[a-h]\d.*[a-h]\d/)?void 0:_i:(r=r.toLowerCase(),r==="o"?ci:r)}function mm(t){return t.replace(/=/,"").replace(/[+#]?[?!]*$/,"")}function _m(t){return t.split(" ").slice(0,4).join(" ")}class NS{constructor(r=gm,{skipValidation:a=!1}={}){lt(this,"_board",new Array(128)),lt(this,"_turn",Li),lt(this,"_header",{}),lt(this,"_kings",{w:es,b:es}),lt(this,"_epSquare",-1),lt(this,"_halfMoves",0),lt(this,"_moveNumber",0),lt(this,"_history",[]),lt(this,"_comments",{}),lt(this,"_castling",{w:0,b:0}),lt(this,"_positionCount",{}),this.load(r,{skipValidation:a})}clear({preserveHeaders:r=!1}={}){this._board=new Array(128),this._kings={w:es,b:es},this._turn=Li,this._castling={w:0,b:0},this._epSquare=es,this._halfMoves=0,this._moveNumber=1,this._history=[],this._comments={},this._header=r?this._header:{},this._positionCount={},delete this._header.SetUp,delete this._header.FEN}load(r,{skipValidation:a=!1,preserveHeaders:l=!1}={}){let u=r.split(/\s+/);if(u.length>=2&&u.length<6){const p=["-","-","0","1"];r=u.concat(p.slice(-(6-u.length))).join(" ")}if(u=r.split(/\s+/),!a){const{ok:p,error:y}=IS(r);if(!p)throw new Error(y)}const c=u[0];let f=0;this.clear({preserveHeaders:l});for(let p=0;p<c.length;p++){const y=c.charAt(p);if(y==="/")f+=8;else if(l2(y))f+=parseInt(y,10);else{const S=y<"a"?Li:As;this._put({type:y.toLowerCase(),color:S},Oi(f)),f++}}this._turn=u[1],u[2].indexOf("K")>-1&&(this._castling.w|=Ar.KSIDE_CASTLE),u[2].indexOf("Q")>-1&&(this._castling.w|=Ar.QSIDE_CASTLE),u[2].indexOf("k")>-1&&(this._castling.b|=Ar.KSIDE_CASTLE),u[2].indexOf("q")>-1&&(this._castling.b|=Ar.QSIDE_CASTLE),this._epSquare=u[3]==="-"?es:xr[u[3]],this._halfMoves=parseInt(u[4],10),this._moveNumber=parseInt(u[5],10),this._updateSetup(r),this._incPositionCount(r)}fen(){var r,a;let l=0,u="";for(let p=xr.a8;p<=xr.h1;p++){if(this._board[p]){l>0&&(u+=l,l=0);const{color:y,type:S}=this._board[p];u+=y===Li?S.toUpperCase():S.toLowerCase()}else l++;p+1&136&&(l>0&&(u+=l),p!==xr.h1&&(u+="/"),l=0,p+=8)}let c="";this._castling[Li]&Ar.KSIDE_CASTLE&&(c+="K"),this._castling[Li]&Ar.QSIDE_CASTLE&&(c+="Q"),this._castling[As]&Ar.KSIDE_CASTLE&&(c+="k"),this._castling[As]&Ar.QSIDE_CASTLE&&(c+="q"),c=c||"-";let f="-";if(this._epSquare!==es){const p=this._epSquare+(this._turn===Li?16:-16),y=[p+1,p-1];for(const S of y){if(S&136)continue;const A=this._turn;if(((r=this._board[S])==null?void 0:r.color)===A&&((a=this._board[S])==null?void 0:a.type)===_i){this._makeMove({color:A,from:S,to:this._epSquare,piece:_i,captured:_i,flags:Ar.EP_CAPTURE});const M=!this._isKingAttacked(A);if(this._undoMove(),M){f=Oi(this._epSquare);break}}}}return[u,this._turn,c,f,this._halfMoves,this._moveNumber].join(" ")}_updateSetup(r){this._history.length>0||(r!==gm?(this._header.SetUp="1",this._header.FEN=r):(delete this._header.SetUp,delete this._header.FEN))}reset(){this.load(gm)}get(r){return this._board[xr[r]]}put({type:r,color:a},l){return this._put({type:r,color:a},l)?(this._updateCastlingRights(),this._updateEnPassantSquare(),this._updateSetup(this.fen()),!0):!1}_put({type:r,color:a},l){if(CS.indexOf(r.toLowerCase())===-1||!(l in xr))return!1;const u=xr[l];if(r==ci&&!(this._kings[a]==es||this._kings[a]==u))return!1;const c=this._board[u];return c&&c.type===ci&&(this._kings[c.color]=es),this._board[u]={type:r,color:a},r===ci&&(this._kings[a]=u),!0}remove(r){const a=this.get(r);return delete this._board[xr[r]],a&&a.type===ci&&(this._kings[a.color]=es),this._updateCastlingRights(),this._updateEnPassantSquare(),this._updateSetup(this.fen()),a}_updateCastlingRights(){var r,a,l,u,c,f,p,y,S,A,M,w;const _=((r=this._board[xr.e1])==null?void 0:r.type)===ci&&((a=this._board[xr.e1])==null?void 0:a.color)===Li,C=((l=this._board[xr.e8])==null?void 0:l.type)===ci&&((u=this._board[xr.e8])==null?void 0:u.color)===As;(!_||((c=this._board[xr.a1])==null?void 0:c.type)!==z0||((f=this._board[xr.a1])==null?void 0:f.color)!==Li)&&(this._castling.w&=-65),(!_||((p=this._board[xr.h1])==null?void 0:p.type)!==z0||((y=this._board[xr.h1])==null?void 0:y.color)!==Li)&&(this._castling.w&=-33),(!C||((S=this._board[xr.a8])==null?void 0:S.type)!==z0||((A=this._board[xr.a8])==null?void 0:A.color)!==As)&&(this._castling.b&=-65),(!C||((M=this._board[xr.h8])==null?void 0:M.type)!==z0||((w=this._board[xr.h8])==null?void 0:w.color)!==As)&&(this._castling.b&=-33)}_updateEnPassantSquare(){var r,a;if(this._epSquare===es)return;const l=this._epSquare+(this._turn===Li?-16:16),u=this._epSquare+(this._turn===Li?16:-16),c=[u+1,u-1];if(this._board[l]!==null||this._board[this._epSquare]!==null||((r=this._board[u])==null?void 0:r.color)!==R0(this._turn)||((a=this._board[u])==null?void 0:a.type)!==_i){this._epSquare=es;return}const f=p=>{var y,S;return!(p&136)&&((y=this._board[p])==null?void 0:y.color)===this._turn&&((S=this._board[p])==null?void 0:S.type)===_i};c.some(f)||(this._epSquare=es)}_attacked(r,a,l){const u=[];for(let c=xr.a8;c<=xr.h1;c++){if(c&136){c+=7;continue}if(this._board[c]===void 0||this._board[c].color!==r)continue;const f=this._board[c],p=c-a;if(p===0)continue;const y=p+119;if(yS[y]&SS[f.type]){if(f.type===_i){if(p>0&&f.color===Li||p<=0&&f.color===As)if(l)u.push(Oi(c));else return!0;continue}if(f.type==="n"||f.type==="k")if(l){u.push(Oi(c));continue}else return!0;const S=wS[y];let A=c+S,M=!1;for(;A!==a;){if(this._board[A]!=null){M=!0;break}A+=S}if(!M)if(l){u.push(Oi(c));continue}else return!0}}return l?u:!1}attackers(r,a){return a?this._attacked(a,xr[r],!0):this._attacked(this._turn,xr[r],!0)}_isKingAttacked(r){const a=this._kings[r];return a===-1?!1:this._attacked(R0(r),a)}isAttacked(r,a){return this._attacked(a,xr[r])}isCheck(){return this._isKingAttacked(this._turn)}inCheck(){return this.isCheck()}isCheckmate(){return this.isCheck()&&this._moves().length===0}isStalemate(){return!this.isCheck()&&this._moves().length===0}isInsufficientMaterial(){const r={b:0,n:0,r:0,q:0,k:0,p:0},a=[];let l=0,u=0;for(let c=xr.a8;c<=xr.h1;c++){if(u=(u+1)%2,c&136){c+=7;continue}const f=this._board[c];f&&(r[f.type]=f.type in r?r[f.type]+1:1,f.type===vh&&a.push(u),l++)}if(l===2)return!0;if(l===3&&(r[vh]===1||r[pb]===1))return!0;if(l===r[vh]+2){let c=0;const f=a.length;for(let p=0;p<f;p++)c+=a[p];if(c===0||c===f)return!0}return!1}isThreefoldRepetition(){return this._getPositionCount(this.fen())>=3}isDrawByFiftyMoves(){return this._halfMoves>=100}isDraw(){return this.isDrawByFiftyMoves()||this.isStalemate()||this.isInsufficientMaterial()||this.isThreefoldRepetition()}isGameOver(){return this.isCheckmate()||this.isStalemate()||this.isDraw()}moves({verbose:r=!1,square:a=void 0,piece:l=void 0}={}){const u=this._moves({square:a,piece:l});return r?u.map(c=>new ch(this,c)):u.map(c=>this._moveToSan(c,u))}_moves({legal:r=!0,piece:a=void 0,square:l=void 0}={}){var u;const c=l?l.toLowerCase():void 0,f=a?.toLowerCase(),p=[],y=this._turn,S=R0(y);let A=xr.a8,M=xr.h1,w=!1;if(c)if(c in xr)A=M=xr[c],w=!0;else return[];for(let C=A;C<=M;C++){if(C&136){C+=7;continue}if(!this._board[C]||this._board[C].color===S)continue;const{type:m}=this._board[C];let T;if(m===_i){if(f&&f!==m)continue;T=C+vm[y][0],this._board[T]||(Wo(p,y,C,T,_i),T=C+vm[y][1],AS[y]===au(C)&&!this._board[T]&&Wo(p,y,C,T,_i,void 0,Ar.BIG_PAWN));for(let L=2;L<4;L++)T=C+vm[y][L],!(T&136)&&(((u=this._board[T])==null?void 0:u.color)===S?Wo(p,y,C,T,_i,this._board[T].type,Ar.CAPTURE):T===this._epSquare&&Wo(p,y,C,T,_i,_i,Ar.EP_CAPTURE))}else{if(f&&f!==m)continue;for(let L=0,N=gw[m].length;L<N;L++){const B=gw[m][L];for(T=C;T+=B,!(T&136);){if(!this._board[T])Wo(p,y,C,T,m);else{if(this._board[T].color===y)break;Wo(p,y,C,T,m,this._board[T].type,Ar.CAPTURE);break}if(m===pb||m===ci)break}}}}if((f===void 0||f===ci)&&(!w||M===this._kings[y])){if(this._castling[y]&Ar.KSIDE_CASTLE){const C=this._kings[y],m=C+2;!this._board[C+1]&&!this._board[m]&&!this._attacked(S,this._kings[y])&&!this._attacked(S,C+1)&&!this._attacked(S,m)&&Wo(p,y,this._kings[y],m,ci,void 0,Ar.KSIDE_CASTLE)}if(this._castling[y]&Ar.QSIDE_CASTLE){const C=this._kings[y],m=C-2;!this._board[C-1]&&!this._board[C-2]&&!this._board[C-3]&&!this._attacked(S,this._kings[y])&&!this._attacked(S,C-1)&&!this._attacked(S,m)&&Wo(p,y,this._kings[y],m,ci,void 0,Ar.QSIDE_CASTLE)}}if(!r||this._kings[y]===-1)return p;const _=[];for(let C=0,m=p.length;C<m;C++)this._makeMove(p[C]),this._isKingAttacked(y)||_.push(p[C]),this._undoMove();return _}move(r,{strict:a=!1}={}){let l=null;if(typeof r=="string")l=this._moveFromSan(r,a);else if(typeof r=="object"){const c=this._moves();for(let f=0,p=c.length;f<p;f++)if(r.from===Oi(c[f].from)&&r.to===Oi(c[f].to)&&(!("promotion"in c[f])||r.promotion===c[f].promotion)){l=c[f];break}}if(!l)throw typeof r=="string"?new Error(`Invalid move: ${r}`):new Error(`Invalid move: ${JSON.stringify(r)}`);const u=new ch(this,l);return this._makeMove(l),this._incPositionCount(u.after),u}_push(r){this._history.push({move:r,kings:{b:this._kings.b,w:this._kings.w},turn:this._turn,castling:{b:this._castling.b,w:this._castling.w},epSquare:this._epSquare,halfMoves:this._halfMoves,moveNumber:this._moveNumber})}_makeMove(r){const a=this._turn,l=R0(a);if(this._push(r),this._board[r.to]=this._board[r.from],delete this._board[r.from],r.flags&Ar.EP_CAPTURE&&(this._turn===As?delete this._board[r.to-16]:delete this._board[r.to+16]),r.promotion&&(this._board[r.to]={type:r.promotion,color:a}),this._board[r.to].type===ci){if(this._kings[a]=r.to,r.flags&Ar.KSIDE_CASTLE){const u=r.to-1,c=r.to+1;this._board[u]=this._board[c],delete this._board[c]}else if(r.flags&Ar.QSIDE_CASTLE){const u=r.to+1,c=r.to-2;this._board[u]=this._board[c],delete this._board[c]}this._castling[a]=0}if(this._castling[a]){for(let u=0,c=$o[a].length;u<c;u++)if(r.from===$o[a][u].square&&this._castling[a]&$o[a][u].flag){this._castling[a]^=$o[a][u].flag;break}}if(this._castling[l]){for(let u=0,c=$o[l].length;u<c;u++)if(r.to===$o[l][u].square&&this._castling[l]&$o[l][u].flag){this._castling[l]^=$o[l][u].flag;break}}r.flags&Ar.BIG_PAWN?a===As?this._epSquare=r.to-16:this._epSquare=r.to+16:this._epSquare=es,r.piece===_i?this._halfMoves=0:r.flags&(Ar.CAPTURE|Ar.EP_CAPTURE)?this._halfMoves=0:this._halfMoves++,a===As&&this._moveNumber++,this._turn=l}undo(){const r=this._undoMove();if(r){const a=new ch(this,r);return this._decPositionCount(a.after),a}return null}_undoMove(){const r=this._history.pop();if(r===void 0)return null;const a=r.move;this._kings=r.kings,this._turn=r.turn,this._castling=r.castling,this._epSquare=r.epSquare,this._halfMoves=r.halfMoves,this._moveNumber=r.moveNumber;const l=this._turn,u=R0(l);if(this._board[a.from]=this._board[a.to],this._board[a.from].type=a.piece,delete this._board[a.to],a.captured)if(a.flags&Ar.EP_CAPTURE){let c;l===As?c=a.to-16:c=a.to+16,this._board[c]={type:_i,color:u}}else this._board[a.to]={type:a.captured,color:u};if(a.flags&(Ar.KSIDE_CASTLE|Ar.QSIDE_CASTLE)){let c,f;a.flags&Ar.KSIDE_CASTLE?(c=a.to+1,f=a.to-1):(c=a.to-2,f=a.to+1),this._board[c]=this._board[f],delete this._board[f]}return a}pgn({newline:r=`
|
|
60
|
+
`,maxWidth:a=0}={}){const l=[];let u=!1;for(const w in this._header)l.push("["+w+' "'+this._header[w]+'"]'+r),u=!0;u&&this._history.length&&l.push(r);const c=w=>{const _=this._comments[this.fen()];if(typeof _<"u"){const C=w.length>0?" ":"";w=`${w}${C}{${_}}`}return w},f=[];for(;this._history.length>0;)f.push(this._undoMove());const p=[];let y="";for(f.length===0&&p.push(c(""));f.length>0;){y=c(y);const w=f.pop();if(!w)break;if(!this._history.length&&w.color==="b"){const _=`${this._moveNumber}. ...`;y=y?`${y} ${_}`:_}else w.color==="w"&&(y.length&&p.push(y),y=this._moveNumber+".");y=y+" "+this._moveToSan(w,this._moves({legal:!0})),this._makeMove(w)}if(y.length&&p.push(c(y)),typeof this._header.Result<"u"&&p.push(this._header.Result),a===0)return l.join("")+p.join(" ");const S=function(){return l.length>0&&l[l.length-1]===" "?(l.pop(),!0):!1},A=function(w,_){for(const C of _.split(" "))if(C){if(w+C.length>a){for(;S();)w--;l.push(r),w=0}l.push(C),w+=C.length,l.push(" "),w++}return S()&&w--,w};let M=0;for(let w=0;w<p.length;w++){if(M+p[w].length>a&&p[w].includes("{")){M=A(M,p[w]);continue}M+p[w].length>a&&w!==0?(l[l.length-1]===" "&&l.pop(),l.push(r),M=0):w!==0&&(l.push(" "),M++),l.push(p[w]),M+=p[w].length}return l.join("")}header(...r){for(let a=0;a<r.length;a+=2)typeof r[a]=="string"&&typeof r[a+1]=="string"&&(this._header[r[a]]=r[a+1]);return this._header}setHeader(r,a){return this._header[r]=a,this._header}removeHeader(r){return r in this._header?(delete this._header[r],!0):!1}getHeaders(){return this._header}loadPgn(r,{strict:a=!1,newlineChar:l=`\r?
|
|
61
|
+
`}={}){function u(B){return B.replace(/\\/g,"\\")}function c(B){const W={},G=B.split(new RegExp(u(l)));let R="",ye="";for(let q=0;q<G.length;q++){const se=/^\s*\[\s*([A-Za-z]+)\s*"(.*)"\s*\]\s*$/;R=G[q].replace(se,"$1"),ye=G[q].replace(se,"$2"),R.trim().length>0&&(W[R]=ye)}return W}r=r.trim();const p=new RegExp("^(\\[((?:"+u(l)+")|.)*\\])((?:\\s*"+u(l)+"){2}|(?:\\s*"+u(l)+")*$)").exec(r),y=p&&p.length>=2?p[1]:"";this.reset();const S=c(y);let A="";for(const B in S)B.toLowerCase()==="fen"&&(A=S[B]),this.header(B,S[B]);if(!a)A&&this.load(A,{preserveHeaders:!0});else if(S.SetUp==="1"){if(!("FEN"in S))throw new Error("Invalid PGN: FEN tag must be supplied with SetUp tag");this.load(S.FEN,{preserveHeaders:!0})}function M(B){return Array.from(B).map(function(W){return W.charCodeAt(0)<128?W.charCodeAt(0).toString(16):encodeURIComponent(W).replace(/%/g,"").toLowerCase()}).join("")}function w(B){return B.length==0?"":decodeURIComponent("%"+(B.match(/.{1,2}/g)||[]).join("%"))}const _=function(B){return B=B.replace(new RegExp(u(l),"g")," "),`{${M(B.slice(1,B.length-1))}}`},C=function(B){if(B.startsWith("{")&&B.endsWith("}"))return w(B.slice(1,B.length-1))};let m=r.replace(y,"").replace(new RegExp(`({[^}]*})+?|;([^${u(l)}]*)`,"g"),function(B,W,G){return W!==void 0?_(W):" "+_(`{${G.slice(1)}}`)}).replace(new RegExp(u(l),"g")," ");const T=/(\([^()]+\))+?/g;for(;T.test(m);)m=m.replace(T,"");m=m.replace(/\d+\.(\.\.)?/g,""),m=m.replace(/\.\.\./g,""),m=m.replace(/\$\d+/g,"");let L=m.trim().split(new RegExp(/\s+/));L=L.filter(B=>B!=="");let N="";for(let B=0;B<L.length;B++){const W=C(L[B]);if(W!==void 0){this._comments[this.fen()]=W;continue}const G=this._moveFromSan(L[B],a);if(G==null)if(TS.indexOf(L[B])>-1)N=L[B];else throw new Error(`Invalid move in PGN: ${L[B]}`);else N="",this._makeMove(G),this._incPositionCount(this.fen())}N&&Object.keys(this._header).length&&!this._header.Result&&this.header("Result",N)}_moveToSan(r,a){let l="";if(r.flags&Ar.KSIDE_CASTLE)l="O-O";else if(r.flags&Ar.QSIDE_CASTLE)l="O-O-O";else{if(r.piece!==_i){const u=PS(r,a);l+=r.piece.toUpperCase()+u}r.flags&(Ar.CAPTURE|Ar.EP_CAPTURE)&&(r.piece===_i&&(l+=Oi(r.from)[0]),l+="x"),l+=Oi(r.to),r.promotion&&(l+="="+r.promotion.toUpperCase())}return this._makeMove(r),this.isCheck()&&(this.isCheckmate()?l+="#":l+="+"),this._undoMove(),l}_moveFromSan(r,a=!1){const l=mm(r);let u=mw(l),c=this._moves({legal:!0,piece:u});for(let w=0,_=c.length;w<_;w++)if(l===mm(this._moveToSan(c[w],c)))return c[w];if(a)return null;let f,p,y,S,A,M=!1;if(p=l.match(/([pnbrqkPNBRQK])?([a-h][1-8])x?-?([a-h][1-8])([qrbnQRBN])?/),p?(f=p[1],y=p[2],S=p[3],A=p[4],y.length==1&&(M=!0)):(p=l.match(/([pnbrqkPNBRQK])?([a-h]?[1-8]?)x?-?([a-h][1-8])([qrbnQRBN])?/),p&&(f=p[1],y=p[2],S=p[3],A=p[4],y.length==1&&(M=!0))),u=mw(l),c=this._moves({legal:!0,piece:f||u}),!S)return null;for(let w=0,_=c.length;w<_;w++)if(y){if((!f||f.toLowerCase()==c[w].piece)&&xr[y]==c[w].from&&xr[S]==c[w].to&&(!A||A.toLowerCase()==c[w].promotion))return c[w];if(M){const C=Oi(c[w].from);if((!f||f.toLowerCase()==c[w].piece)&&xr[S]==c[w].to&&(y==C[0]||y==C[1])&&(!A||A.toLowerCase()==c[w].promotion))return c[w]}}else if(l===mm(this._moveToSan(c[w],c)).replace("x",""))return c[w];return null}ascii(){let r=` +------------------------+
|
|
62
|
+
`;for(let a=xr.a8;a<=xr.h1;a++){if(W0(a)===0&&(r+=" "+"87654321"[au(a)]+" |"),this._board[a]){const l=this._board[a].type,c=this._board[a].color===Li?l.toUpperCase():l.toLowerCase();r+=" "+c+" "}else r+=" . ";a+1&136&&(r+=`|
|
|
63
|
+
`,a+=8)}return r+=` +------------------------+
|
|
64
|
+
`,r+=" a b c d e f g h",r}perft(r){const a=this._moves({legal:!1});let l=0;const u=this._turn;for(let c=0,f=a.length;c<f;c++)this._makeMove(a[c]),this._isKingAttacked(u)||(r-1>0?l+=this.perft(r-1):l++),this._undoMove();return l}turn(){return this._turn}board(){const r=[];let a=[];for(let l=xr.a8;l<=xr.h1;l++)this._board[l]==null?a.push(null):a.push({square:Oi(l),type:this._board[l].type,color:this._board[l].color}),l+1&136&&(r.push(a),a=[],l+=8);return r}squareColor(r){if(r in xr){const a=xr[r];return(au(a)+W0(a))%2===0?"light":"dark"}return null}history({verbose:r=!1}={}){const a=[],l=[];for(;this._history.length>0;)a.push(this._undoMove());for(;;){const u=a.pop();if(!u)break;r?l.push(new ch(this,u)):l.push(this._moveToSan(u,this._moves())),this._makeMove(u)}return l}_getPositionCount(r){const a=_m(r);return this._positionCount[a]||0}_incPositionCount(r){const a=_m(r);this._positionCount[a]===void 0&&(this._positionCount[a]=0),this._positionCount[a]+=1}_decPositionCount(r){const a=_m(r);this._positionCount[a]===1?delete this._positionCount[a]:this._positionCount[a]-=1}_pruneComments(){const r=[],a={},l=u=>{u in this._comments&&(a[u]=this._comments[u])};for(;this._history.length>0;)r.push(this._undoMove());for(l(this.fen());;){const u=r.pop();if(!u)break;this._makeMove(u),l(this.fen())}this._comments=a}getComment(){return this._comments[this.fen()]}setComment(r){this._comments[this.fen()]=r.replace("{","[").replace("}","]")}deleteComment(){return this.removeComment()}removeComment(){const r=this._comments[this.fen()];return delete this._comments[this.fen()],r}getComments(){return this._pruneComments(),Object.keys(this._comments).map(r=>({fen:r,comment:this._comments[r]}))}deleteComments(){return this.removeComments()}removeComments(){return this._pruneComments(),Object.keys(this._comments).map(r=>{const a=this._comments[r];return delete this._comments[r],{fen:r,comment:a}})}setCastlingRights(r,a){for(const u of[ci,Yo])a[u]!==void 0&&(a[u]?this._castling[r]|=hh[u]:this._castling[r]&=~hh[u]);this._updateCastlingRights();const l=this.getCastlingRights(r);return(a[ci]===void 0||a[ci]===l[ci])&&(a[Yo]===void 0||a[Yo]===l[Yo])}getCastlingRights(r){return{[ci]:(this._castling[r]&hh[ci])!==0,[Yo]:(this._castling[r]&hh[Yo])!==0}}moveNumber(){return this._moveNumber}}const LS=t=>{if(t.length<4||t.length>5)throw new Error(`Invalid UCI move format: ${t}`);return{from:t.substring(0,2),to:t.substring(2,4),promotion:t.length===5?t[4]:void 0}},_w=t=>{const r=new Map;return bS.forEach(a=>{const l=t.moves({square:a,verbose:!0});l.length&&r.set(a,l.map(u=>u.to))}),r},OS=t=>t==="cg-white"?"cg-black":"cg-white",bm=t=>t.turn()==="w"?"cg-white":"cg-black",DS=qr({name:"PuzzleView",props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"PuzzleView"),l=Wn(a),u=Qt(null),c=Qt(),f=Qt(),p=Qt("cg-white"),y=Qt(!1),S=Qt(null),A=300,M=[{value:"q",name:"Queen",whiteSymbol:"♕",blackSymbol:"♛"},{value:"r",name:"Rook",whiteSymbol:"♖",blackSymbol:"♜"},{value:"b",name:"Bishop",whiteSymbol:"♗",blackSymbol:"♝"},{value:"n",name:"Knight",whiteSymbol:"♘",blackSymbol:"♞"}],w=Nr(()=>{const N=["a","b","c","d","e","f","g","h"];return p.value==="cg-white"?N:N.reverse()}),_=N=>N?["q","r","b","n"].includes(N):!1,C=(N,B,W)=>{var G;if(_(W))return!1;const R=(G=c.value)==null?void 0:G.get(N);return R?.type==="p"&&(B[1]==="8"||B[1]==="1")},m=()=>{!c.value||!f.value||f.value.set({fen:c.value.fen(),turnColor:bm(c.value),movable:{color:bm(c.value),dests:_w(c.value)}})},T=N=>{if(N!=="q"&&N!=="r"&&N!=="b"&&N!=="n"){a.logger.error(`Invalid promotion piece: ${N}`);return}S.value&&(a.logger.log(`promoting to ${N}`),y.value=!1,L(S.value.from,S.value.to,N))},L=(N,B,W)=>{var G,R,ye,q,se;if(!((G=l.question.value)!=null&&G.moves.length))throw new Error("No moves");if(C(N,B,W)){S.value={from:N,to:B},y.value=!0;return}const ve=l.question.value.moves[0],he=_(W)?`${N}${B}${W}`:`${N}${B}`;ve===he?((R=c.value)==null||R.move({from:N,to:B,promotion:_(W)?W:void 0}),m(),l.question.value.moves.shift(),l.question.value.moves.length===0?l.submitAnswer(""):window.setTimeout(()=>{var ce;if(!l.question.value)return;const de=l.question.value.moves.shift(),K=LS(de);(ce=c.value)==null||ce.move(K),m()},A)):((ye=c.value)==null||ye.move({from:N,to:B,promotion:W}),(q=c.value)!=null&&q.isCheckmate()?l.submitAnswer(gb.CHECKMATE):(se=c.value)==null||se.undo(),l.submitAnswer(N+B+W),m())};return oa(()=>{if(!u.value)return;l.question.value=new gb(t.data),c.value=new NS(l.question.value.fen),p.value=OS(bm(c.value)),f.value=mS(u.value,{movable:{free:!1,showDests:!0,dests:_w(c.value),events:{after:L}},draggable:{showGhost:!0},fen:c.value.fen(),orientation:p.value,coordinates:!1,animation:{duration:A,enabled:!0}});const N=l.question.value.moves.shift();f.value.move(N.substring(0,2),N.substring(2)),c.value.move({from:N.substring(0,2),to:N.substring(2)}),m()}),Hh(()=>{var N;(N=f.value)==null||N.destroy(),c.value=void 0}),{boardElement:u,playerColor:p,files:w,showPromotionDialog:y,promotionPieces:M,handlePromotion:T,...a,...l}}}),RS={"data-viewable":"PuzzleView"},BS={class:"text-h5"},FS={class:"puzzle-board-wrapper"},qS={class:"puzzle-ranks-labels"},zS={class:"puzzle-board-and-files"},HS={id:"cg",ref:"boardElement"},VS={class:"puzzle-files-labels"},US={key:0,class:"puzzle-promotion-dialog"},$S=["onClick"];function WS(t,r,a,l,u,c){return st(),_t("div",RS,[pt("p",BS," Make the best move for "+ir(t.playerColor==="cg-white"?"White ♖♘♗♕♔♗♘♖":"Black ♜♞♝♚♛♝♞♜")+": ",1),pt("div",FS,[pt("div",qS,[(st(),_t(Gr,null,Ai(8,f=>pt("div",{key:f},ir(t.playerColor==="cg-white"?9-f:f),1)),64))]),pt("div",zS,[pt("div",HS,null,512),pt("div",VS,[(st(!0),_t(Gr,null,Ai(t.files,f=>(st(),_t("div",{key:f},ir(f),1))),128))])])]),t.showPromotionDialog?(st(),_t("div",US,[(st(!0),_t(Gr,null,Ai(t.promotionPieces,f=>(st(),_t("button",{key:f.value,onClick:p=>t.handlePromotion(f.value)},ir(t.playerColor==="cg-white"?f.whiteSymbol:f.blackSymbol)+" "+ir(f.name),9,$S))),128))])):br("",!0)])}const GS=Mn(DS,[["render",WS]]),Z0=class mh extends pi{constructor(r){super(r),lt(this,"fen"),lt(this,"id"),lt(this,"moves"),lt(this,"rating"),lt(this,"themes"),lt(this,"checkMove",(p,y)=>(alert("checkMove"),console.log("checkMove",p,y),console.log("this.moves[0]",this.moves[0]),this.moves[0]===y));const[a,l,u,c,,,,f]=r[0].puzzleData.split(",");this.id=a,this.fen=l,this.moves=u.split(" "),this.rating=parseInt(c,10),this.themes=f.split(" ")}evaluate(r,a){return{isCorrect:this.isCorrect(r),performance:this.displayedSkill(r,a)}}displayedSkill(r,a){return this.isCorrect(r)?a<5e3?1:1-Math.min(1,(a-5e3)/1e4):0}dataShapes(){return mh.dataShapes}views(){return mh.views}isCorrect(r){const a=this.moves.length===0;return r===mh.CHECKMATE||a}};lt(Z0,"dataShapes",[{name:di.CHESS_puzzle,fields:[{name:"puzzleData",type:pr.CHESS_PUZZLE,validator:{instructions:"insert a valid fen string",test:function(t){return console.log(`running puzzle validator on ${t}`),t?t.split(",").length!=10?{status:Jt.error,msg:"puzzleData must have 8 comma-separated fields"}:{status:Jt.ok,msg:""}:{status:Jt.error,msg:"no defined input"}}},tagger:()=>["test"]}]}]);lt(Z0,"views",[GS]);lt(Z0,"acceptsUserData",!0);lt(Z0,"CHECKMATE","CHECKMATE");let gb=Z0;const YS=new Oo("chess",[gb]),KS=qr({name:"AudioParseView",components:{AudioAutoPlayer:Gb},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"AudioParseView"),l=Wn(a),u=Qt("");l.question.value=new u2(t.data);const c=Nr(()=>l.question.value);return{...a,...l,answer:u,question:c,submit:()=>{c.value}}}}),XS={"data-viewable":"AudioParseView"};function QS(t,r,a,l,u,c){const f=vt("AudioAutoPlayer");return st(),_t("div",XS,[t.question?(st(),_t(Gr,{key:0},[ft(f,{src:t.getURL("audio")},null,8,["src"]),r[0]||(r[0]=pt("br",null,null,-1)),r[1]||(r[1]=pt("br",null,null,-1)),Yt(" "+ir(t.question.text),1)],64)):br("",!0)])}const ZS=Mn(KS,[["render",QS]]),iy=class vb extends pi{constructor(r){super(r),lt(this,"audio"),lt(this,"text"),this.audio=r[0].audio,this.text=r[0].text}isCorrect(r){throw new Error(`isCorrect() not implemented - cannor parse ${r}`)}dataShapes(){return vb.dataShapes}views(){return vb.views}};lt(iy,"dataShapes",[{name:di.FRENCH_AudioParse,fields:[{name:"audio",type:pr.IMAGE},{name:"text",type:pr.STRING,validator:{test:t=>{const r=t.length<45;return{msg:r?"":"It's too long!",status:r?Jt.ok:Jt.error}}}}]}]);lt(iy,"views",[ZS]);let u2=iy;const jS=qr({name:"IdentifyVocab",components:{},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"IdentifyVocab"),l=Wn(a);l.question.value=new c2(t.data);const u=Nr(()=>l.question.value);return{...a,...l,question:u}}}),JS={"data-viewable":"IdentifyVocab"};function eC(t,r,a,l,u,c){return st(),_t("div",JS,[t.question?(st(),_t(Gr,{key:0},[Yt(" This is a vocabulary question. ")],64)):br("",!0)])}const tC=Mn(jS,[["render",eC]]),rC=[{name:"word",type:pr.STRING,validator:T4.NonEmptyString},{name:"image",type:pr.IMAGE},{name:"audio",type:pr.AUDIO}],sy=class mb extends pi{isCorrect(r){throw new Error(`isCorrect() not implemented. Cannot parse ${r}`)}dataShapes(){return mb.dataShapes}views(){return mb.views}};lt(sy,"dataShapes",[{fields:rC,name:di.FRENCH_Vocab}]);lt(sy,"views",[tC]);let c2=sy;const nC=new Oo("french",[u2,c2]),iC=qr({name:"AdditionHorizontal",components:{UserInputNumber:cu},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"AdditionHorizontal"),l=Wn(a),u=Qt("");l.question.value=new ay(t.data);const c=Nr(()=>l.question.value);return{...a,...l,answer:u,question:c,submit:()=>{if(c.value){const p=c.value.isCorrect(parseInt(u.value,10));alert(p)}}}}}),sC={"data-viewable":"AdditionHorizontal"};function aC(t,r,a,l,u,c){const f=vt("UserInputNumber");return st(),_t("div",sC,[t.question?(st(),_t(Gr,{key:0},[Yt(ir(t.question.a)+" + "+ir(t.question.b)+" = ",1),ft(f,{modelValue:t.answer,"onUpdate:modelValue":r[0]||(r[0]=p=>t.answer=p)},null,8,["modelValue"])],64)):br("",!0)])}const oC=Mn(iC,[["render",aC]]),lC=qr({name:"VerbalAddition",components:{UserInputNumber:cu},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"VerbalAddition"),l=Wn(a),u=Qt("");l.question.value=new ay(t.data);const c=Nr(()=>l.question.value);return{...a,...l,answer:u,question:c,submit:()=>{if(c.value){const p=c.value.isCorrect(parseInt(u.value,10));alert(p)}}}}}),uC={"data-viewable":"VerbalAddition"};function cC(t,r,a,l,u,c){const f=vt("UserInputNumber");return st(),_t("div",uC,[t.question?(st(),_t(Gr,{key:0},[Yt(ir(t.question.a)+" plus "+ir(t.question.b)+" is ",1),ft(f,{modelValue:t.answer,"onUpdate:modelValue":r[0]||(r[0]=p=>t.answer=p)},null,8,["modelValue"])],64)):br("",!0)])}const hC=Mn(lC,[["render",cC]]),fC=[{name:"a",type:pr.INT},{name:"b",type:pr.INT}],dC=function(){const t=[];for(let r=0;r<10;r++)for(let a=0;a<10;a++)t.push({a:r,b:a});return t},j0=class _b extends pi{constructor(r){super(r),lt(this,"a"),lt(this,"b"),this.a=r[0].a,this.b=r[0].b}isCorrect(r){return 1*this.a+this.b===r}dataShapes(){return _b.dataShapes}views(){return _b.views}};lt(j0,"dataShapes",[{name:di.MATH_SingleDigitAddition,fields:fC}]);lt(j0,"views",[oC,hC]);lt(j0,"seedData",dC());lt(j0,"acceptsUserData",!1);let ay=j0;const pC=qr({name:"DivisionHorizontal",components:{UserInputNumber:cu},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"DivisionHorizontal"),l=Wn(a),u=Qt("");l.question.value=new h2(t.data);const c=Nr(()=>l.question.value);return{...a,...l,answer:u,question:c,submit:()=>{if(c.value){const p=c.value.isCorrect(parseInt(u.value,10));alert(p)}}}}}),gC={"data-viewable":"DivisionHorizontal"};function vC(t,r,a,l,u,c){const f=vt("UserInputNumber");return st(),_t("div",gC,[t.question?(st(),_t(Gr,{key:0},[Yt(ir(t.question.a*t.question.b)+" ÷ "+ir(t.question.b)+" = ",1),ft(f,{modelValue:t.answer,"onUpdate:modelValue":r[0]||(r[0]=p=>t.answer=p)},null,8,["modelValue"])],64)):br("",!0)])}const mC=Mn(pC,[["render",vC]]),_C=[{name:"a",type:pr.INT},{name:"b",type:pr.INT,validator:{instructions:"An integer between 1 and 10, inclusive.",test:t=>{const r=parseInt(t,10);return 0<r&&r<11?{status:Jt.ok,msg:""}:r===0?{status:Jt.error,msg:"Thou shalt not divide by zero."}:{status:Jt.error,msg:"Single digit division problem divisors must be between 1 and 10, inclusive."}}}}],oy=class bb extends pi{constructor(r){super(r),lt(this,"a"),lt(this,"b"),this.a=r[0].a,this.b=r[0].b}isCorrect(r){return this.a*this.b===r}dataShapes(){return bb.dataShapes}views(){return bb.views}};lt(oy,"dataShapes",[{name:di.MATH_SingleDigitDivision,fields:_C}]);lt(oy,"views",[mC]);let h2=oy;const bC=qr({name:"MultiplicationHorizontal",components:{UserInputNumber:cu},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"MultiplicationHorizontal"),l=Wn(a),u=Qt("");l.question.value=new uy(t.data);const c=Nr(()=>l.question.value);return{...a,...l,answer:u,question:c,submit:()=>{if(c.value){const p=c.value.isCorrect(parseInt(u.value,10));alert(p)}}}}}),yC={"data-viewable":"MultiplicationHorizontal"};function wC(t,r,a,l,u,c){const f=vt("UserInputNumber");return st(),_t("div",yC,[t.question?(st(),_t(Gr,{key:0},[Yt(ir(t.question.a)+" × "+ir(t.question.b)+" = ",1),ft(f,{modelValue:t.answer,"onUpdate:modelValue":r[0]||(r[0]=p=>t.answer=p)},null,8,["modelValue"])],64)):br("",!0)])}const SC=Mn(bC,[["render",wC]]),CC=qr({name:"VerbalMultiplication",components:{UserInputNumber:cu},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"VerbalMultiplication"),l=Wn(a),u=Qt("");l.question.value=new uy(t.data);const c=Nr(()=>l.question.value);return{...a,...l,answer:u,question:c,submit:()=>{if(c.value){const p=c.value.isCorrect(parseInt(u.value,10));alert(p)}}}}}),xC={"data-viewable":"VerbalMultiplication"};function kC(t,r,a,l,u,c){const f=vt("UserInputNumber");return st(),_t("div",xC,[t.question?(st(),_t(Gr,{key:0},[Yt(ir(t.question.a)+" times "+ir(t.question.b)+" is ",1),ft(f,{modelValue:t.answer,"onUpdate:modelValue":r[0]||(r[0]=p=>t.answer=p)},null,8,["modelValue"])],64)):br("",!0)])}const MC=Mn(CC,[["render",kC]]),bw={instructions:"An integer between 0 and 10, inclusive.",test:t=>{const r=parseInt(t,10);return 0<=r&&r<=10?{status:Jt.ok,msg:""}:{status:Jt.error,msg:"Single digit multiplication problem inputs must be between 0 and 10, inclusive."}}},EC=[{name:"a",type:pr.INT,validator:bw},{name:"b",type:pr.INT,validator:bw}],ly=class yb extends pi{constructor(r){super(r),lt(this,"a"),lt(this,"b"),this.a=r[0].a,this.b=r[0].b}isCorrect(r){return this.a*this.b===r}dataShapes(){return yb.dataShapes}views(){return yb.views}};lt(ly,"dataShapes",[{name:di.MATH_SingleDigitMultiplication,fields:EC}]);lt(ly,"views",[MC,SC]);let uy=ly;const AC=qr({name:"TrueFalse",components:{TFSelect:E7},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"TrueFalse"),l=Wn(a);l.question.value=new Sb(t.data);const u=Nr(()=>new Sb(t.data));return{question:u,submit:f=>{alert(u.value.isCorrect(f===0))}}}}),TC={"data-viewable":"TrueFalse"};function IC(t,r,a,l,u,c){const f=vt("TFSelect");return st(),_t("div",TC,[Yt(ir(t.question.a)+" = "+ir(t.question.b)+" ",1),ft(f,{submit:t.submit},null,8,["submit"])])}const PC=Mn(AC,[["render",IC]]),NC=[{name:"a",type:pr.STRING},{name:"b",type:pr.STRING}],cy=class wb extends pi{constructor(r){super(r),lt(this,"a"),lt(this,"b"),this.a=r[0].a,this.b=r[0].b}isCorrect(r){return this.a===this.b===r}dataShapes(){return wb.dataShapes}views(){return wb.views}};lt(cy,"dataShapes",[{name:di.MATH_EqualityTest,fields:NC}]);lt(cy,"views",[PC]);let Sb=cy;const LC=qr({name:"SolveView",components:{UserInputNumber:cu},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"Solve"),l=Wn(a),u=Qt(""),c=["a","b","d","A","z","B","d","y"],f=Qt(c[ko(0,c.length)]);l.question.value=new f2(t.data);const p=Nr(()=>l.question.value);return{...a,...l,answer:u,question:p,variable:f,submit:()=>{if(p.value){const S=p.value.isCorrect(parseInt(u.value,10));alert(S)}}}}}),OC={"data-viewable":"Solve"},DC={key:0},RC={key:1},BC={key:2},FC={key:3},qC={key:4};function zC(t,r,a,l,u,c){const f=vt("UserInputNumber");return st(),_t("div",OC,[t.question?(st(),_t(Gr,{key:0},[r[1]||(r[1]=pt("h4",null,"Solve the Equation",-1)),r[2]||(r[2]=pt("br",null,null,-1)),r[3]||(r[3]=pt("br",null,null,-1)),t.question.operation.valueOf()==="ADDITION"?(st(),_t("div",DC,ir(t.variable)+" - "+ir(t.question.a)+" = "+ir(t.question.b),1)):t.question.operation.valueOf()==="SUBTRACTION"?(st(),_t("div",RC,ir(t.variable)+" + "+ir(t.question.a)+" = "+ir(t.question.b),1)):t.question.operation.valueOf()==="MULTIPLICATION"?(st(),_t("div",BC,ir(t.variable)+" ÷ "+ir(t.question.a)+" = "+ir(t.question.b),1)):t.question.operation.valueOf()==="DIVISION"?(st(),_t("div",FC,ir(t.variable)+" * "+ir(t.question.a)+" = "+ir(t.question.b*t.question.a),1)):(st(),_t("div",qC,"No operation!? (This should never show)")),r[4]||(r[4]=pt("br",null,null,-1)),r[5]||(r[5]=pt("br",null,null,-1)),Yt(" "+ir(t.variable)+" = ",1),ft(f,{modelValue:t.answer,"onUpdate:modelValue":r[0]||(r[0]=p=>t.answer=p)},null,8,["modelValue"])],64)):br("",!0)])}const HC=Mn(LC,[["render",zC]]),yw={instructions:"An integer between 0 and 10, inclusive.",test:t=>{const r=parseInt(t,10);return 0<=r&&r<=100?{status:Jt.ok,msg:""}:{status:Jt.error,msg:"Single-step equation problem inputs must be between 0 and 100, inclusive."}}},VC={test:t=>t==="ADDITION"||t==="SUBTRACTION"||t==="MULTIPLICATION"||t==="DIVISION"?{status:Jt.ok,msg:""}:{status:Jt.error,msg:"Operation must be ADDITION, SUBTRACTION, MULTIPLICATION, or DIVISION"}},UC=[{name:"a",type:pr.INT,validator:yw},{name:"b",type:pr.INT,validator:yw},{name:"operation",type:pr.STRING,validator:VC}],hy=class Cb extends pi{constructor(r){super(r),lt(this,"a"),lt(this,"b"),lt(this,"operation"),this.a=r[0].a,this.b=r[0].b,this.operation=r[0].operation}answer(){let r=0;return this.operation==="ADDITION"?r=this.a+this.b:this.operation==="SUBTRACTION"?r=this.b-this.a:this.operation==="MULTIPLICATION"?r=this.a*this.b:this.operation==="DIVISION"&&(r=this.b),C7(`The answer is ${r}
|
|
65
|
+
The operation is ${this.operation.valueOf()}
|
|
66
|
+
this.a = ${this.a}
|
|
67
|
+
this.b = ${this.b}
|
|
68
|
+
`),r}isCorrect(r){return r===this.answer()}dataShapes(){return Cb.dataShapes}views(){return Cb.views}};lt(hy,"dataShapes",[{name:di.MATH_OneStepEquation,fields:UC}]);lt(hy,"views",[HC]);let f2=hy;const $C=qr({name:"AngleCategorizeV",components:{RadioMultipleChoice:zh},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"AngleCategorizeV"),l=Wn(a),u=Qt(null);l.question.value=new d2(t.data);const c=Nr(()=>l.question.value),f=Nr(()=>{if(!c.value)return 0;const p=c.value.angleCategory;if(p===_u.ACUTE)return ko(10,83);if(p===_u.RIGHT)return 90;if(p===_u.OBTUSE)return ko(97,173);if(p===_u.STRAIGHT)return 180;if(p===_u.REFLEX)return ko(190,350);throw new Error("Unknown Angle type on AngleCategorize question")});return oa(()=>{if(!u.value)return;const p=u.value.width,y=u.value.height,S=u.value.getContext("2d");if(!S)return;const A=ko(0,360),M=A+f.value;S.moveTo(p/2,y/2);const w=p/2+p*Math.cos(A/360*2*Math.PI),_=y/2+p*Math.sin(A/360*2*Math.PI);S.lineTo(w,_),S.stroke(),S.moveTo(p/2,y/2);const C=p/2+p*Math.cos(M/360*2*Math.PI),m=y/2+p*Math.sin(M/360*2*Math.PI);S.lineTo(C,m),S.stroke(),S.moveTo(p/2,y/2),S.beginPath(),S.arc(p/2,y/2,25,A/360*2*Math.PI,M/360*2*Math.PI),S.stroke()}),{...a,...l,canvasRef:u,question:c}}}),WC={"data-viewable":"AngleCategorizeV"},GC={ref:"canvasRef",width:"300",height:"300"};function YC(t,r,a,l,u,c){const f=vt("radio-multiple-choice");return st(),_t("div",WC,[t.question?(st(),_t(Gr,{key:0},[r[0]||(r[0]=pt("h2",null,"What kind of angle is this?",-1)),pt("canvas",GC,null,512),ft(f,{"choice-list":t.question.answers},null,8,["choice-list"])],64)):br("",!0)])}const KC=Mn($C,[["render",YC],["__scopeId","data-v-57f16e4a"]]),XC={instructions:'Must be "ACUTE", "RIGHT", "OBTUSE", "STRAIGHT", or "REFLEX".',test:t=>t==="ACUTE"||t==="OBTUSE"||t==="REFLEX"||t==="RIGHT"||t==="STRAIGHT"?{status:Jt.ok,msg:""}:{status:Jt.error,msg:'Must be "ACUTE", "RIGHT", "OBTUSE", "STRAIGHT", or "REFLEX".'}};var _u=(t=>(t.ACUTE="ACUTE",t.RIGHT="RIGHT",t.OBTUSE="OBTUSE",t.STRAIGHT="STRAIGHT",t.REFLEX="REFLEX",t))(_u||{});const QC=[{name:"Category",type:pr.STRING,validator:XC}],fy=class xb extends pi{constructor(r){super(r),lt(this,"angleCategory"),lt(this,"answers"),this.angleCategory=r[0].Category,this.answers=Cu.shuffle(["ACUTE","OBTUSE","REFLEX","RIGHT","STRAIGHT"])}isCorrect(r){return this.angleCategory.valueOf()===r.choiceList[r.selection]}dataShapes(){return xb.dataShapes}views(){return xb.views}};lt(fy,"dataShapes",[{name:di.MATH_AngleCategorize,fields:QC}]);lt(fy,"views",[KC]);let d2=fy;function ZC(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var _h={exports:{}};const jC={},JC=Object.freeze(Object.defineProperty({__proto__:null,default:jC},Symbol.toStringTag,{value:"Module"})),ww=H7(JC);var H0={exports:{}},ex=H0.exports,Sw;function tx(){return Sw||(Sw=1,function(t,r){(function(a,l){l(r)})(ex,function(a){var l=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],u=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],c="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",f="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ꟑꟑꟓꟕ-ꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",p={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},y="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",S={5:y,"5module":y+" export import",6:y+" const class extends export import super"},A=/^in(stanceof)?$/,M=new RegExp("["+f+"]"),w=new RegExp("["+f+c+"]");function _(g,P){for(var re=65536,_e=0;_e<P.length;_e+=2){if(re+=P[_e],re>g)return!1;if(re+=P[_e+1],re>=g)return!0}return!1}function C(g,P){return g<65?g===36:g<91?!0:g<97?g===95:g<123?!0:g<=65535?g>=170&&M.test(String.fromCharCode(g)):P===!1?!1:_(g,u)}function m(g,P){return g<48?g===36:g<58?!0:g<65?!1:g<91?!0:g<97?g===95:g<123?!0:g<=65535?g>=170&&w.test(String.fromCharCode(g)):P===!1?!1:_(g,u)||_(g,l)}var T=function(P,re){re===void 0&&(re={}),this.label=P,this.keyword=re.keyword,this.beforeExpr=!!re.beforeExpr,this.startsExpr=!!re.startsExpr,this.isLoop=!!re.isLoop,this.isAssign=!!re.isAssign,this.prefix=!!re.prefix,this.postfix=!!re.postfix,this.binop=re.binop||null,this.updateContext=null};function L(g,P){return new T(g,{beforeExpr:!0,binop:P})}var N={beforeExpr:!0},B={startsExpr:!0},W={};function G(g,P){return P===void 0&&(P={}),P.keyword=g,W[g]=new T(g,P)}var R={num:new T("num",B),regexp:new T("regexp",B),string:new T("string",B),name:new T("name",B),privateId:new T("privateId",B),eof:new T("eof"),bracketL:new T("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new T("]"),braceL:new T("{",{beforeExpr:!0,startsExpr:!0}),braceR:new T("}"),parenL:new T("(",{beforeExpr:!0,startsExpr:!0}),parenR:new T(")"),comma:new T(",",N),semi:new T(";",N),colon:new T(":",N),dot:new T("."),question:new T("?",N),questionDot:new T("?."),arrow:new T("=>",N),template:new T("template"),invalidTemplate:new T("invalidTemplate"),ellipsis:new T("...",N),backQuote:new T("`",B),dollarBraceL:new T("${",{beforeExpr:!0,startsExpr:!0}),eq:new T("=",{beforeExpr:!0,isAssign:!0}),assign:new T("_=",{beforeExpr:!0,isAssign:!0}),incDec:new T("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new T("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:L("||",1),logicalAND:L("&&",2),bitwiseOR:L("|",3),bitwiseXOR:L("^",4),bitwiseAND:L("&",5),equality:L("==/!=/===/!==",6),relational:L("</>/<=/>=",7),bitShift:L("<</>>/>>>",8),plusMin:new T("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:L("%",10),star:L("*",10),slash:L("/",10),starstar:new T("**",{beforeExpr:!0}),coalesce:L("??",1),_break:G("break"),_case:G("case",N),_catch:G("catch"),_continue:G("continue"),_debugger:G("debugger"),_default:G("default",N),_do:G("do",{isLoop:!0,beforeExpr:!0}),_else:G("else",N),_finally:G("finally"),_for:G("for",{isLoop:!0}),_function:G("function",B),_if:G("if"),_return:G("return",N),_switch:G("switch"),_throw:G("throw",N),_try:G("try"),_var:G("var"),_const:G("const"),_while:G("while",{isLoop:!0}),_with:G("with"),_new:G("new",{beforeExpr:!0,startsExpr:!0}),_this:G("this",B),_super:G("super",B),_class:G("class",B),_extends:G("extends",N),_export:G("export"),_import:G("import",B),_null:G("null",B),_true:G("true",B),_false:G("false",B),_in:G("in",{beforeExpr:!0,binop:7}),_instanceof:G("instanceof",{beforeExpr:!0,binop:7}),_typeof:G("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:G("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:G("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},ye=/\r\n?|\n|\u2028|\u2029/,q=new RegExp(ye.source,"g");function se(g){return g===10||g===13||g===8232||g===8233}function ve(g,P,re){re===void 0&&(re=g.length);for(var _e=P;_e<re;_e++){var Le=g.charCodeAt(_e);if(se(Le))return _e<re-1&&Le===13&&g.charCodeAt(_e+1)===10?_e+2:_e+1}return-1}var he=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,ce=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,de=Object.prototype,K=de.hasOwnProperty,Q=de.toString,le=Object.hasOwn||function(g,P){return K.call(g,P)},Ee=Array.isArray||function(g){return Q.call(g)==="[object Array]"},Me=Object.create(null);function H(g){return Me[g]||(Me[g]=new RegExp("^(?:"+g.replace(/ /g,"|")+")$"))}function Y(g){return g<=65535?String.fromCharCode(g):(g-=65536,String.fromCharCode((g>>10)+55296,(g&1023)+56320))}var X=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,xe=function(P,re){this.line=P,this.column=re};xe.prototype.offset=function(P){return new xe(this.line,this.column+P)};var De=function(P,re,_e){this.start=re,this.end=_e,P.sourceFile!==null&&(this.source=P.sourceFile)};function $e(g,P){for(var re=1,_e=0;;){var Le=ve(g,_e,P);if(Le<0)return new xe(re,P-_e);++re,_e=Le}}var Re={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},ut=!1;function Lt(g){var P={};for(var re in Re)P[re]=g&&le(g,re)?g[re]:Re[re];if(P.ecmaVersion==="latest"?P.ecmaVersion=1e8:P.ecmaVersion==null?(!ut&&typeof console=="object"&&console.warn&&(ut=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
69
|
+
Defaulting to 2020, but this will stop working in the future.`)),P.ecmaVersion=11):P.ecmaVersion>=2015&&(P.ecmaVersion-=2009),P.allowReserved==null&&(P.allowReserved=P.ecmaVersion<5),(!g||g.allowHashBang==null)&&(P.allowHashBang=P.ecmaVersion>=14),Ee(P.onToken)){var _e=P.onToken;P.onToken=function(Le){return _e.push(Le)}}return Ee(P.onComment)&&(P.onComment=it(P,P.onComment)),P}function it(g,P){return function(re,_e,Le,Ze,tt,kt){var Nt={type:re?"Block":"Line",value:_e,start:Le,end:Ze};g.locations&&(Nt.loc=new De(this,tt,kt)),g.ranges&&(Nt.range=[Le,Ze]),P.push(Nt)}}var Ct=1,It=2,at=4,Gt=8,Dt=16,ct=32,gr=64,vr=128,er=256,Cr=Ct|It|er;function Wr(g,P){return It|(g?at:0)|(P?Gt:0)}var kr=0,Ue=1,Je=2,Ye=3,Qe=4,rt=5,o=function(P,re,_e){this.options=P=Lt(P),this.sourceFile=P.sourceFile,this.keywords=H(S[P.ecmaVersion>=6?6:P.sourceType==="module"?"5module":5]);var Le="";P.allowReserved!==!0&&(Le=p[P.ecmaVersion>=6?6:P.ecmaVersion===5?5:3],P.sourceType==="module"&&(Le+=" await")),this.reservedWords=H(Le);var Ze=(Le?Le+" ":"")+p.strict;this.reservedWordsStrict=H(Ze),this.reservedWordsStrictBind=H(Ze+" "+p.strictBind),this.input=String(re),this.containsEsc=!1,_e?(this.pos=_e,this.lineStart=this.input.lastIndexOf(`
|
|
70
|
+
`,_e-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(ye).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=R.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=P.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&P.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(Ct),this.regexpState=null,this.privateNameStack=[]},h={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};o.prototype.parse=function(){var P=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(P)},h.inFunction.get=function(){return(this.currentVarScope().flags&It)>0},h.inGenerator.get=function(){return(this.currentVarScope().flags&Gt)>0&&!this.currentVarScope().inClassFieldInit},h.inAsync.get=function(){return(this.currentVarScope().flags&at)>0&&!this.currentVarScope().inClassFieldInit},h.canAwait.get=function(){for(var g=this.scopeStack.length-1;g>=0;g--){var P=this.scopeStack[g];if(P.inClassFieldInit||P.flags&er)return!1;if(P.flags&It)return(P.flags&at)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},h.allowSuper.get=function(){var g=this.currentThisScope(),P=g.flags,re=g.inClassFieldInit;return(P&gr)>0||re||this.options.allowSuperOutsideMethod},h.allowDirectSuper.get=function(){return(this.currentThisScope().flags&vr)>0},h.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},h.allowNewDotTarget.get=function(){var g=this.currentThisScope(),P=g.flags,re=g.inClassFieldInit;return(P&(It|er))>0||re},h.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&er)>0},o.extend=function(){for(var P=[],re=arguments.length;re--;)P[re]=arguments[re];for(var _e=this,Le=0;Le<P.length;Le++)_e=P[Le](_e);return _e},o.parse=function(P,re){return new this(re,P).parse()},o.parseExpressionAt=function(P,re,_e){var Le=new this(_e,P,re);return Le.nextToken(),Le.parseExpression()},o.tokenizer=function(P,re){return new this(re,P)},Object.defineProperties(o.prototype,h);var b=o.prototype,x=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;b.strictDirective=function(g){if(this.options.ecmaVersion<5)return!1;for(;;){ce.lastIndex=g,g+=ce.exec(this.input)[0].length;var P=x.exec(this.input.slice(g));if(!P)return!1;if((P[1]||P[2])==="use strict"){ce.lastIndex=g+P[0].length;var re=ce.exec(this.input),_e=re.index+re[0].length,Le=this.input.charAt(_e);return Le===";"||Le==="}"||ye.test(re[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(Le)||Le==="!"&&this.input.charAt(_e+1)==="=")}g+=P[0].length,ce.lastIndex=g,g+=ce.exec(this.input)[0].length,this.input[g]===";"&&g++}},b.eat=function(g){return this.type===g?(this.next(),!0):!1},b.isContextual=function(g){return this.type===R.name&&this.value===g&&!this.containsEsc},b.eatContextual=function(g){return this.isContextual(g)?(this.next(),!0):!1},b.expectContextual=function(g){this.eatContextual(g)||this.unexpected()},b.canInsertSemicolon=function(){return this.type===R.eof||this.type===R.braceR||ye.test(this.input.slice(this.lastTokEnd,this.start))},b.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},b.semicolon=function(){!this.eat(R.semi)&&!this.insertSemicolon()&&this.unexpected()},b.afterTrailingComma=function(g,P){if(this.type===g)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),P||this.next(),!0},b.expect=function(g){this.eat(g)||this.unexpected()},b.unexpected=function(g){this.raise(g??this.start,"Unexpected token")};var E=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};b.checkPatternErrors=function(g,P){if(g){g.trailingComma>-1&&this.raiseRecoverable(g.trailingComma,"Comma is not permitted after the rest element");var re=P?g.parenthesizedAssign:g.parenthesizedBind;re>-1&&this.raiseRecoverable(re,P?"Assigning to rvalue":"Parenthesized pattern")}},b.checkExpressionErrors=function(g,P){if(!g)return!1;var re=g.shorthandAssign,_e=g.doubleProto;if(!P)return re>=0||_e>=0;re>=0&&this.raise(re,"Shorthand property assignments are valid only in destructuring patterns"),_e>=0&&this.raiseRecoverable(_e,"Redefinition of __proto__ property")},b.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},b.isSimpleAssignTarget=function(g){return g.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(g.expression):g.type==="Identifier"||g.type==="MemberExpression"};var I=o.prototype;I.parseTopLevel=function(g){var P=Object.create(null);for(g.body||(g.body=[]);this.type!==R.eof;){var re=this.parseStatement(null,!0,P);g.body.push(re)}if(this.inModule)for(var _e=0,Le=Object.keys(this.undefinedExports);_e<Le.length;_e+=1){var Ze=Le[_e];this.raiseRecoverable(this.undefinedExports[Ze].start,"Export '"+Ze+"' is not defined")}return this.adaptDirectivePrologue(g.body),this.next(),g.sourceType=this.options.sourceType,this.finishNode(g,"Program")};var F={kind:"loop"},D={kind:"switch"};I.isLet=function(g){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;ce.lastIndex=this.pos;var P=ce.exec(this.input),re=this.pos+P[0].length,_e=this.input.charCodeAt(re);if(_e===91||_e===92)return!0;if(g)return!1;if(_e===123||_e>55295&&_e<56320)return!0;if(C(_e,!0)){for(var Le=re+1;m(_e=this.input.charCodeAt(Le),!0);)++Le;if(_e===92||_e>55295&&_e<56320)return!0;var Ze=this.input.slice(re,Le);if(!A.test(Ze))return!0}return!1},I.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;ce.lastIndex=this.pos;var g=ce.exec(this.input),P=this.pos+g[0].length,re;return!ye.test(this.input.slice(this.pos,P))&&this.input.slice(P,P+8)==="function"&&(P+8===this.input.length||!(m(re=this.input.charCodeAt(P+8))||re>55295&&re<56320))},I.parseStatement=function(g,P,re){var _e=this.type,Le=this.startNode(),Ze;switch(this.isLet(g)&&(_e=R._var,Ze="let"),_e){case R._break:case R._continue:return this.parseBreakContinueStatement(Le,_e.keyword);case R._debugger:return this.parseDebuggerStatement(Le);case R._do:return this.parseDoStatement(Le);case R._for:return this.parseForStatement(Le);case R._function:return g&&(this.strict||g!=="if"&&g!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(Le,!1,!g);case R._class:return g&&this.unexpected(),this.parseClass(Le,!0);case R._if:return this.parseIfStatement(Le);case R._return:return this.parseReturnStatement(Le);case R._switch:return this.parseSwitchStatement(Le);case R._throw:return this.parseThrowStatement(Le);case R._try:return this.parseTryStatement(Le);case R._const:case R._var:return Ze=Ze||this.value,g&&Ze!=="var"&&this.unexpected(),this.parseVarStatement(Le,Ze);case R._while:return this.parseWhileStatement(Le);case R._with:return this.parseWithStatement(Le);case R.braceL:return this.parseBlock(!0,Le);case R.semi:return this.parseEmptyStatement(Le);case R._export:case R._import:if(this.options.ecmaVersion>10&&_e===R._import){ce.lastIndex=this.pos;var tt=ce.exec(this.input),kt=this.pos+tt[0].length,Nt=this.input.charCodeAt(kt);if(Nt===40||Nt===46)return this.parseExpressionStatement(Le,this.parseExpression())}return this.options.allowImportExportEverywhere||(P||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),_e===R._import?this.parseImport(Le):this.parseExport(Le,re);default:if(this.isAsyncFunction())return g&&this.unexpected(),this.next(),this.parseFunctionStatement(Le,!0,!g);var _r=this.value,cr=this.parseExpression();return _e===R.name&&cr.type==="Identifier"&&this.eat(R.colon)?this.parseLabeledStatement(Le,_r,cr,g):this.parseExpressionStatement(Le,cr)}},I.parseBreakContinueStatement=function(g,P){var re=P==="break";this.next(),this.eat(R.semi)||this.insertSemicolon()?g.label=null:this.type!==R.name?this.unexpected():(g.label=this.parseIdent(),this.semicolon());for(var _e=0;_e<this.labels.length;++_e){var Le=this.labels[_e];if((g.label==null||Le.name===g.label.name)&&(Le.kind!=null&&(re||Le.kind==="loop")||g.label&&re))break}return _e===this.labels.length&&this.raise(g.start,"Unsyntactic "+P),this.finishNode(g,re?"BreakStatement":"ContinueStatement")},I.parseDebuggerStatement=function(g){return this.next(),this.semicolon(),this.finishNode(g,"DebuggerStatement")},I.parseDoStatement=function(g){return this.next(),this.labels.push(F),g.body=this.parseStatement("do"),this.labels.pop(),this.expect(R._while),g.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(R.semi):this.semicolon(),this.finishNode(g,"DoWhileStatement")},I.parseForStatement=function(g){this.next();var P=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(F),this.enterScope(0),this.expect(R.parenL),this.type===R.semi)return P>-1&&this.unexpected(P),this.parseFor(g,null);var re=this.isLet();if(this.type===R._var||this.type===R._const||re){var _e=this.startNode(),Le=re?"let":this.value;return this.next(),this.parseVar(_e,!0,Le),this.finishNode(_e,"VariableDeclaration"),(this.type===R._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&_e.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===R._in?P>-1&&this.unexpected(P):g.await=P>-1),this.parseForIn(g,_e)):(P>-1&&this.unexpected(P),this.parseFor(g,_e))}var Ze=this.isContextual("let"),tt=!1,kt=this.containsEsc,Nt=new E,_r=this.start,cr=P>-1?this.parseExprSubscripts(Nt,"await"):this.parseExpression(!0,Nt);return this.type===R._in||(tt=this.options.ecmaVersion>=6&&this.isContextual("of"))?(P>-1?(this.type===R._in&&this.unexpected(P),g.await=!0):tt&&this.options.ecmaVersion>=8&&(cr.start===_r&&!kt&&cr.type==="Identifier"&&cr.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(g.await=!1)),Ze&&tt&&this.raise(cr.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(cr,!1,Nt),this.checkLValPattern(cr),this.parseForIn(g,cr)):(this.checkExpressionErrors(Nt,!0),P>-1&&this.unexpected(P),this.parseFor(g,cr))},I.parseFunctionStatement=function(g,P,re){return this.next(),this.parseFunction(g,U|(re?0:J),!1,P)},I.parseIfStatement=function(g){return this.next(),g.test=this.parseParenExpression(),g.consequent=this.parseStatement("if"),g.alternate=this.eat(R._else)?this.parseStatement("if"):null,this.finishNode(g,"IfStatement")},I.parseReturnStatement=function(g){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(R.semi)||this.insertSemicolon()?g.argument=null:(g.argument=this.parseExpression(),this.semicolon()),this.finishNode(g,"ReturnStatement")},I.parseSwitchStatement=function(g){this.next(),g.discriminant=this.parseParenExpression(),g.cases=[],this.expect(R.braceL),this.labels.push(D),this.enterScope(0);for(var P,re=!1;this.type!==R.braceR;)if(this.type===R._case||this.type===R._default){var _e=this.type===R._case;P&&this.finishNode(P,"SwitchCase"),g.cases.push(P=this.startNode()),P.consequent=[],this.next(),_e?P.test=this.parseExpression():(re&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),re=!0,P.test=null),this.expect(R.colon)}else P||this.unexpected(),P.consequent.push(this.parseStatement(null));return this.exitScope(),P&&this.finishNode(P,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(g,"SwitchStatement")},I.parseThrowStatement=function(g){return this.next(),ye.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),g.argument=this.parseExpression(),this.semicolon(),this.finishNode(g,"ThrowStatement")};var z=[];I.parseCatchClauseParam=function(){var g=this.parseBindingAtom(),P=g.type==="Identifier";return this.enterScope(P?ct:0),this.checkLValPattern(g,P?Qe:Je),this.expect(R.parenR),g},I.parseTryStatement=function(g){if(this.next(),g.block=this.parseBlock(),g.handler=null,this.type===R._catch){var P=this.startNode();this.next(),this.eat(R.parenL)?P.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),P.param=null,this.enterScope(0)),P.body=this.parseBlock(!1),this.exitScope(),g.handler=this.finishNode(P,"CatchClause")}return g.finalizer=this.eat(R._finally)?this.parseBlock():null,!g.handler&&!g.finalizer&&this.raise(g.start,"Missing catch or finally clause"),this.finishNode(g,"TryStatement")},I.parseVarStatement=function(g,P,re){return this.next(),this.parseVar(g,!1,P,re),this.semicolon(),this.finishNode(g,"VariableDeclaration")},I.parseWhileStatement=function(g){return this.next(),g.test=this.parseParenExpression(),this.labels.push(F),g.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(g,"WhileStatement")},I.parseWithStatement=function(g){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),g.object=this.parseParenExpression(),g.body=this.parseStatement("with"),this.finishNode(g,"WithStatement")},I.parseEmptyStatement=function(g){return this.next(),this.finishNode(g,"EmptyStatement")},I.parseLabeledStatement=function(g,P,re,_e){for(var Le=0,Ze=this.labels;Le<Ze.length;Le+=1){var tt=Ze[Le];tt.name===P&&this.raise(re.start,"Label '"+P+"' is already declared")}for(var kt=this.type.isLoop?"loop":this.type===R._switch?"switch":null,Nt=this.labels.length-1;Nt>=0;Nt--){var _r=this.labels[Nt];if(_r.statementStart===g.start)_r.statementStart=this.start,_r.kind=kt;else break}return this.labels.push({name:P,kind:kt,statementStart:this.start}),g.body=this.parseStatement(_e?_e.indexOf("label")===-1?_e+"label":_e:"label"),this.labels.pop(),g.label=re,this.finishNode(g,"LabeledStatement")},I.parseExpressionStatement=function(g,P){return g.expression=P,this.semicolon(),this.finishNode(g,"ExpressionStatement")},I.parseBlock=function(g,P,re){for(g===void 0&&(g=!0),P===void 0&&(P=this.startNode()),P.body=[],this.expect(R.braceL),g&&this.enterScope(0);this.type!==R.braceR;){var _e=this.parseStatement(null);P.body.push(_e)}return re&&(this.strict=!1),this.next(),g&&this.exitScope(),this.finishNode(P,"BlockStatement")},I.parseFor=function(g,P){return g.init=P,this.expect(R.semi),g.test=this.type===R.semi?null:this.parseExpression(),this.expect(R.semi),g.update=this.type===R.parenR?null:this.parseExpression(),this.expect(R.parenR),g.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(g,"ForStatement")},I.parseForIn=function(g,P){var re=this.type===R._in;return this.next(),P.type==="VariableDeclaration"&&P.declarations[0].init!=null&&(!re||this.options.ecmaVersion<8||this.strict||P.kind!=="var"||P.declarations[0].id.type!=="Identifier")&&this.raise(P.start,(re?"for-in":"for-of")+" loop variable declaration may not have an initializer"),g.left=P,g.right=re?this.parseExpression():this.parseMaybeAssign(),this.expect(R.parenR),g.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(g,re?"ForInStatement":"ForOfStatement")},I.parseVar=function(g,P,re,_e){for(g.declarations=[],g.kind=re;;){var Le=this.startNode();if(this.parseVarId(Le,re),this.eat(R.eq)?Le.init=this.parseMaybeAssign(P):!_e&&re==="const"&&!(this.type===R._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!_e&&Le.id.type!=="Identifier"&&!(P&&(this.type===R._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):Le.init=null,g.declarations.push(this.finishNode(Le,"VariableDeclarator")),!this.eat(R.comma))break}return g},I.parseVarId=function(g,P){g.id=this.parseBindingAtom(),this.checkLValPattern(g.id,P==="var"?Ue:Je,!1)};var U=1,J=2,te=4;I.parseFunction=function(g,P,re,_e,Le){this.initFunction(g),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!_e)&&(this.type===R.star&&P&J&&this.unexpected(),g.generator=this.eat(R.star)),this.options.ecmaVersion>=8&&(g.async=!!_e),P&U&&(g.id=P&te&&this.type!==R.name?null:this.parseIdent(),g.id&&!(P&J)&&this.checkLValSimple(g.id,this.strict||g.generator||g.async?this.treatFunctionsAsVar?Ue:Je:Ye));var Ze=this.yieldPos,tt=this.awaitPos,kt=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Wr(g.async,g.generator)),P&U||(g.id=this.type===R.name?this.parseIdent():null),this.parseFunctionParams(g),this.parseFunctionBody(g,re,!1,Le),this.yieldPos=Ze,this.awaitPos=tt,this.awaitIdentPos=kt,this.finishNode(g,P&U?"FunctionDeclaration":"FunctionExpression")},I.parseFunctionParams=function(g){this.expect(R.parenL),g.params=this.parseBindingList(R.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},I.parseClass=function(g,P){this.next();var re=this.strict;this.strict=!0,this.parseClassId(g,P),this.parseClassSuper(g);var _e=this.enterClassBody(),Le=this.startNode(),Ze=!1;for(Le.body=[],this.expect(R.braceL);this.type!==R.braceR;){var tt=this.parseClassElement(g.superClass!==null);tt&&(Le.body.push(tt),tt.type==="MethodDefinition"&&tt.kind==="constructor"?(Ze&&this.raiseRecoverable(tt.start,"Duplicate constructor in the same class"),Ze=!0):tt.key&&tt.key.type==="PrivateIdentifier"&&ee(_e,tt)&&this.raiseRecoverable(tt.key.start,"Identifier '#"+tt.key.name+"' has already been declared"))}return this.strict=re,this.next(),g.body=this.finishNode(Le,"ClassBody"),this.exitClassBody(),this.finishNode(g,P?"ClassDeclaration":"ClassExpression")},I.parseClassElement=function(g){if(this.eat(R.semi))return null;var P=this.options.ecmaVersion,re=this.startNode(),_e="",Le=!1,Ze=!1,tt="method",kt=!1;if(this.eatContextual("static")){if(P>=13&&this.eat(R.braceL))return this.parseClassStaticBlock(re),re;this.isClassElementNameStart()||this.type===R.star?kt=!0:_e="static"}if(re.static=kt,!_e&&P>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===R.star)&&!this.canInsertSemicolon()?Ze=!0:_e="async"),!_e&&(P>=9||!Ze)&&this.eat(R.star)&&(Le=!0),!_e&&!Ze&&!Le){var Nt=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?tt=Nt:_e=Nt)}if(_e?(re.computed=!1,re.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),re.key.name=_e,this.finishNode(re.key,"Identifier")):this.parseClassElementName(re),P<13||this.type===R.parenL||tt!=="method"||Le||Ze){var _r=!re.static&&j(re,"constructor"),cr=_r&&g;_r&&tt!=="method"&&this.raise(re.key.start,"Constructor can't have get/set modifier"),re.kind=_r?"constructor":tt,this.parseClassMethod(re,Le,Ze,cr)}else this.parseClassField(re);return re},I.isClassElementNameStart=function(){return this.type===R.name||this.type===R.privateId||this.type===R.num||this.type===R.string||this.type===R.bracketL||this.type.keyword},I.parseClassElementName=function(g){this.type===R.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),g.computed=!1,g.key=this.parsePrivateIdent()):this.parsePropertyName(g)},I.parseClassMethod=function(g,P,re,_e){var Le=g.key;g.kind==="constructor"?(P&&this.raise(Le.start,"Constructor can't be a generator"),re&&this.raise(Le.start,"Constructor can't be an async method")):g.static&&j(g,"prototype")&&this.raise(Le.start,"Classes may not have a static property named prototype");var Ze=g.value=this.parseMethod(P,re,_e);return g.kind==="get"&&Ze.params.length!==0&&this.raiseRecoverable(Ze.start,"getter should have no params"),g.kind==="set"&&Ze.params.length!==1&&this.raiseRecoverable(Ze.start,"setter should have exactly one param"),g.kind==="set"&&Ze.params[0].type==="RestElement"&&this.raiseRecoverable(Ze.params[0].start,"Setter cannot use rest params"),this.finishNode(g,"MethodDefinition")},I.parseClassField=function(g){if(j(g,"constructor")?this.raise(g.key.start,"Classes can't have a field named 'constructor'"):g.static&&j(g,"prototype")&&this.raise(g.key.start,"Classes can't have a static field named 'prototype'"),this.eat(R.eq)){var P=this.currentThisScope(),re=P.inClassFieldInit;P.inClassFieldInit=!0,g.value=this.parseMaybeAssign(),P.inClassFieldInit=re}else g.value=null;return this.semicolon(),this.finishNode(g,"PropertyDefinition")},I.parseClassStaticBlock=function(g){g.body=[];var P=this.labels;for(this.labels=[],this.enterScope(er|gr);this.type!==R.braceR;){var re=this.parseStatement(null);g.body.push(re)}return this.next(),this.exitScope(),this.labels=P,this.finishNode(g,"StaticBlock")},I.parseClassId=function(g,P){this.type===R.name?(g.id=this.parseIdent(),P&&this.checkLValSimple(g.id,Je,!1)):(P===!0&&this.unexpected(),g.id=null)},I.parseClassSuper=function(g){g.superClass=this.eat(R._extends)?this.parseExprSubscripts(null,!1):null},I.enterClassBody=function(){var g={declared:Object.create(null),used:[]};return this.privateNameStack.push(g),g.declared},I.exitClassBody=function(){var g=this.privateNameStack.pop(),P=g.declared,re=g.used;if(this.options.checkPrivateFields)for(var _e=this.privateNameStack.length,Le=_e===0?null:this.privateNameStack[_e-1],Ze=0;Ze<re.length;++Ze){var tt=re[Ze];le(P,tt.name)||(Le?Le.used.push(tt):this.raiseRecoverable(tt.start,"Private field '#"+tt.name+"' must be declared in an enclosing class"))}};function ee(g,P){var re=P.key.name,_e=g[re],Le="true";return P.type==="MethodDefinition"&&(P.kind==="get"||P.kind==="set")&&(Le=(P.static?"s":"i")+P.kind),_e==="iget"&&Le==="iset"||_e==="iset"&&Le==="iget"||_e==="sget"&&Le==="sset"||_e==="sset"&&Le==="sget"?(g[re]="true",!1):_e?!0:(g[re]=Le,!1)}function j(g,P){var re=g.computed,_e=g.key;return!re&&(_e.type==="Identifier"&&_e.name===P||_e.type==="Literal"&&_e.value===P)}I.parseExportAllDeclaration=function(g,P){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(g.exported=this.parseModuleExportName(),this.checkExport(P,g.exported,this.lastTokStart)):g.exported=null),this.expectContextual("from"),this.type!==R.string&&this.unexpected(),g.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(g.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(g,"ExportAllDeclaration")},I.parseExport=function(g,P){if(this.next(),this.eat(R.star))return this.parseExportAllDeclaration(g,P);if(this.eat(R._default))return this.checkExport(P,"default",this.lastTokStart),g.declaration=this.parseExportDefaultDeclaration(),this.finishNode(g,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())g.declaration=this.parseExportDeclaration(g),g.declaration.type==="VariableDeclaration"?this.checkVariableExport(P,g.declaration.declarations):this.checkExport(P,g.declaration.id,g.declaration.id.start),g.specifiers=[],g.source=null;else{if(g.declaration=null,g.specifiers=this.parseExportSpecifiers(P),this.eatContextual("from"))this.type!==R.string&&this.unexpected(),g.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(g.attributes=this.parseWithClause());else{for(var re=0,_e=g.specifiers;re<_e.length;re+=1){var Le=_e[re];this.checkUnreserved(Le.local),this.checkLocalExport(Le.local),Le.local.type==="Literal"&&this.raise(Le.local.start,"A string literal cannot be used as an exported binding without `from`.")}g.source=null}this.semicolon()}return this.finishNode(g,"ExportNamedDeclaration")},I.parseExportDeclaration=function(g){return this.parseStatement(null)},I.parseExportDefaultDeclaration=function(){var g;if(this.type===R._function||(g=this.isAsyncFunction())){var P=this.startNode();return this.next(),g&&this.next(),this.parseFunction(P,U|te,!1,g)}else if(this.type===R._class){var re=this.startNode();return this.parseClass(re,"nullableID")}else{var _e=this.parseMaybeAssign();return this.semicolon(),_e}},I.checkExport=function(g,P,re){g&&(typeof P!="string"&&(P=P.type==="Identifier"?P.name:P.value),le(g,P)&&this.raiseRecoverable(re,"Duplicate export '"+P+"'"),g[P]=!0)},I.checkPatternExport=function(g,P){var re=P.type;if(re==="Identifier")this.checkExport(g,P,P.start);else if(re==="ObjectPattern")for(var _e=0,Le=P.properties;_e<Le.length;_e+=1){var Ze=Le[_e];this.checkPatternExport(g,Ze)}else if(re==="ArrayPattern")for(var tt=0,kt=P.elements;tt<kt.length;tt+=1){var Nt=kt[tt];Nt&&this.checkPatternExport(g,Nt)}else re==="Property"?this.checkPatternExport(g,P.value):re==="AssignmentPattern"?this.checkPatternExport(g,P.left):re==="RestElement"&&this.checkPatternExport(g,P.argument)},I.checkVariableExport=function(g,P){if(g)for(var re=0,_e=P;re<_e.length;re+=1){var Le=_e[re];this.checkPatternExport(g,Le.id)}},I.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},I.parseExportSpecifier=function(g){var P=this.startNode();return P.local=this.parseModuleExportName(),P.exported=this.eatContextual("as")?this.parseModuleExportName():P.local,this.checkExport(g,P.exported,P.exported.start),this.finishNode(P,"ExportSpecifier")},I.parseExportSpecifiers=function(g){var P=[],re=!0;for(this.expect(R.braceL);!this.eat(R.braceR);){if(re)re=!1;else if(this.expect(R.comma),this.afterTrailingComma(R.braceR))break;P.push(this.parseExportSpecifier(g))}return P},I.parseImport=function(g){return this.next(),this.type===R.string?(g.specifiers=z,g.source=this.parseExprAtom()):(g.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),g.source=this.type===R.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(g.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(g,"ImportDeclaration")},I.parseImportSpecifier=function(){var g=this.startNode();return g.imported=this.parseModuleExportName(),this.eatContextual("as")?g.local=this.parseIdent():(this.checkUnreserved(g.imported),g.local=g.imported),this.checkLValSimple(g.local,Je),this.finishNode(g,"ImportSpecifier")},I.parseImportDefaultSpecifier=function(){var g=this.startNode();return g.local=this.parseIdent(),this.checkLValSimple(g.local,Je),this.finishNode(g,"ImportDefaultSpecifier")},I.parseImportNamespaceSpecifier=function(){var g=this.startNode();return this.next(),this.expectContextual("as"),g.local=this.parseIdent(),this.checkLValSimple(g.local,Je),this.finishNode(g,"ImportNamespaceSpecifier")},I.parseImportSpecifiers=function(){var g=[],P=!0;if(this.type===R.name&&(g.push(this.parseImportDefaultSpecifier()),!this.eat(R.comma)))return g;if(this.type===R.star)return g.push(this.parseImportNamespaceSpecifier()),g;for(this.expect(R.braceL);!this.eat(R.braceR);){if(P)P=!1;else if(this.expect(R.comma),this.afterTrailingComma(R.braceR))break;g.push(this.parseImportSpecifier())}return g},I.parseWithClause=function(){var g=[];if(!this.eat(R._with))return g;this.expect(R.braceL);for(var P={},re=!0;!this.eat(R.braceR);){if(re)re=!1;else if(this.expect(R.comma),this.afterTrailingComma(R.braceR))break;var _e=this.parseImportAttribute(),Le=_e.key.type==="Identifier"?_e.key.name:_e.key.value;le(P,Le)&&this.raiseRecoverable(_e.key.start,"Duplicate attribute key '"+Le+"'"),P[Le]=!0,g.push(_e)}return g},I.parseImportAttribute=function(){var g=this.startNode();return g.key=this.type===R.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(R.colon),this.type!==R.string&&this.unexpected(),g.value=this.parseExprAtom(),this.finishNode(g,"ImportAttribute")},I.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===R.string){var g=this.parseLiteral(this.value);return X.test(g.value)&&this.raise(g.start,"An export name cannot include a lone surrogate."),g}return this.parseIdent(!0)},I.adaptDirectivePrologue=function(g){for(var P=0;P<g.length&&this.isDirectiveCandidate(g[P]);++P)g[P].directive=g[P].expression.raw.slice(1,-1)},I.isDirectiveCandidate=function(g){return this.options.ecmaVersion>=5&&g.type==="ExpressionStatement"&&g.expression.type==="Literal"&&typeof g.expression.value=="string"&&(this.input[g.start]==='"'||this.input[g.start]==="'")};var pe=o.prototype;pe.toAssignable=function(g,P,re){if(this.options.ecmaVersion>=6&&g)switch(g.type){case"Identifier":this.inAsync&&g.name==="await"&&this.raise(g.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":g.type="ObjectPattern",re&&this.checkPatternErrors(re,!0);for(var _e=0,Le=g.properties;_e<Le.length;_e+=1){var Ze=Le[_e];this.toAssignable(Ze,P),Ze.type==="RestElement"&&(Ze.argument.type==="ArrayPattern"||Ze.argument.type==="ObjectPattern")&&this.raise(Ze.argument.start,"Unexpected token")}break;case"Property":g.kind!=="init"&&this.raise(g.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(g.value,P);break;case"ArrayExpression":g.type="ArrayPattern",re&&this.checkPatternErrors(re,!0),this.toAssignableList(g.elements,P);break;case"SpreadElement":g.type="RestElement",this.toAssignable(g.argument,P),g.argument.type==="AssignmentPattern"&&this.raise(g.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":g.operator!=="="&&this.raise(g.left.end,"Only '=' operator can be used for specifying default value."),g.type="AssignmentPattern",delete g.operator,this.toAssignable(g.left,P);break;case"ParenthesizedExpression":this.toAssignable(g.expression,P,re);break;case"ChainExpression":this.raiseRecoverable(g.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!P)break;default:this.raise(g.start,"Assigning to rvalue")}else re&&this.checkPatternErrors(re,!0);return g},pe.toAssignableList=function(g,P){for(var re=g.length,_e=0;_e<re;_e++){var Le=g[_e];Le&&this.toAssignable(Le,P)}if(re){var Ze=g[re-1];this.options.ecmaVersion===6&&P&&Ze&&Ze.type==="RestElement"&&Ze.argument.type!=="Identifier"&&this.unexpected(Ze.argument.start)}return g},pe.parseSpread=function(g){var P=this.startNode();return this.next(),P.argument=this.parseMaybeAssign(!1,g),this.finishNode(P,"SpreadElement")},pe.parseRestBinding=function(){var g=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==R.name&&this.unexpected(),g.argument=this.parseBindingAtom(),this.finishNode(g,"RestElement")},pe.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case R.bracketL:var g=this.startNode();return this.next(),g.elements=this.parseBindingList(R.bracketR,!0,!0),this.finishNode(g,"ArrayPattern");case R.braceL:return this.parseObj(!0)}return this.parseIdent()},pe.parseBindingList=function(g,P,re,_e){for(var Le=[],Ze=!0;!this.eat(g);)if(Ze?Ze=!1:this.expect(R.comma),P&&this.type===R.comma)Le.push(null);else{if(re&&this.afterTrailingComma(g))break;if(this.type===R.ellipsis){var tt=this.parseRestBinding();this.parseBindingListItem(tt),Le.push(tt),this.type===R.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(g);break}else Le.push(this.parseAssignableListItem(_e))}return Le},pe.parseAssignableListItem=function(g){var P=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(P),P},pe.parseBindingListItem=function(g){return g},pe.parseMaybeDefault=function(g,P,re){if(re=re||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(R.eq))return re;var _e=this.startNodeAt(g,P);return _e.left=re,_e.right=this.parseMaybeAssign(),this.finishNode(_e,"AssignmentPattern")},pe.checkLValSimple=function(g,P,re){P===void 0&&(P=kr);var _e=P!==kr;switch(g.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(g.name)&&this.raiseRecoverable(g.start,(_e?"Binding ":"Assigning to ")+g.name+" in strict mode"),_e&&(P===Je&&g.name==="let"&&this.raiseRecoverable(g.start,"let is disallowed as a lexically bound name"),re&&(le(re,g.name)&&this.raiseRecoverable(g.start,"Argument name clash"),re[g.name]=!0),P!==rt&&this.declareName(g.name,P,g.start));break;case"ChainExpression":this.raiseRecoverable(g.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":_e&&this.raiseRecoverable(g.start,"Binding member expression");break;case"ParenthesizedExpression":return _e&&this.raiseRecoverable(g.start,"Binding parenthesized expression"),this.checkLValSimple(g.expression,P,re);default:this.raise(g.start,(_e?"Binding":"Assigning to")+" rvalue")}},pe.checkLValPattern=function(g,P,re){switch(P===void 0&&(P=kr),g.type){case"ObjectPattern":for(var _e=0,Le=g.properties;_e<Le.length;_e+=1){var Ze=Le[_e];this.checkLValInnerPattern(Ze,P,re)}break;case"ArrayPattern":for(var tt=0,kt=g.elements;tt<kt.length;tt+=1){var Nt=kt[tt];Nt&&this.checkLValInnerPattern(Nt,P,re)}break;default:this.checkLValSimple(g,P,re)}},pe.checkLValInnerPattern=function(g,P,re){switch(P===void 0&&(P=kr),g.type){case"Property":this.checkLValInnerPattern(g.value,P,re);break;case"AssignmentPattern":this.checkLValPattern(g.left,P,re);break;case"RestElement":this.checkLValPattern(g.argument,P,re);break;default:this.checkLValPattern(g,P,re)}};var ie=function(P,re,_e,Le,Ze){this.token=P,this.isExpr=!!re,this.preserveSpace=!!_e,this.override=Le,this.generator=!!Ze},fe={b_stat:new ie("{",!1),b_expr:new ie("{",!0),b_tmpl:new ie("${",!1),p_stat:new ie("(",!1),p_expr:new ie("(",!0),q_tmpl:new ie("`",!0,!0,function(g){return g.tryReadTemplateToken()}),f_stat:new ie("function",!1),f_expr:new ie("function",!0),f_expr_gen:new ie("function",!0,!1,null,!0),f_gen:new ie("function",!1,!1,null,!0)},ne=o.prototype;ne.initialContext=function(){return[fe.b_stat]},ne.curContext=function(){return this.context[this.context.length-1]},ne.braceIsBlock=function(g){var P=this.curContext();return P===fe.f_expr||P===fe.f_stat?!0:g===R.colon&&(P===fe.b_stat||P===fe.b_expr)?!P.isExpr:g===R._return||g===R.name&&this.exprAllowed?ye.test(this.input.slice(this.lastTokEnd,this.start)):g===R._else||g===R.semi||g===R.eof||g===R.parenR||g===R.arrow?!0:g===R.braceL?P===fe.b_stat:g===R._var||g===R._const||g===R.name?!1:!this.exprAllowed},ne.inGeneratorContext=function(){for(var g=this.context.length-1;g>=1;g--){var P=this.context[g];if(P.token==="function")return P.generator}return!1},ne.updateContext=function(g){var P,re=this.type;re.keyword&&g===R.dot?this.exprAllowed=!1:(P=re.updateContext)?P.call(this,g):this.exprAllowed=re.beforeExpr},ne.overrideContext=function(g){this.curContext()!==g&&(this.context[this.context.length-1]=g)},R.parenR.updateContext=R.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var g=this.context.pop();g===fe.b_stat&&this.curContext().token==="function"&&(g=this.context.pop()),this.exprAllowed=!g.isExpr},R.braceL.updateContext=function(g){this.context.push(this.braceIsBlock(g)?fe.b_stat:fe.b_expr),this.exprAllowed=!0},R.dollarBraceL.updateContext=function(){this.context.push(fe.b_tmpl),this.exprAllowed=!0},R.parenL.updateContext=function(g){var P=g===R._if||g===R._for||g===R._with||g===R._while;this.context.push(P?fe.p_stat:fe.p_expr),this.exprAllowed=!0},R.incDec.updateContext=function(){},R._function.updateContext=R._class.updateContext=function(g){g.beforeExpr&&g!==R._else&&!(g===R.semi&&this.curContext()!==fe.p_stat)&&!(g===R._return&&ye.test(this.input.slice(this.lastTokEnd,this.start)))&&!((g===R.colon||g===R.braceL)&&this.curContext()===fe.b_stat)?this.context.push(fe.f_expr):this.context.push(fe.f_stat),this.exprAllowed=!1},R.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},R.backQuote.updateContext=function(){this.curContext()===fe.q_tmpl?this.context.pop():this.context.push(fe.q_tmpl),this.exprAllowed=!1},R.star.updateContext=function(g){if(g===R._function){var P=this.context.length-1;this.context[P]===fe.f_expr?this.context[P]=fe.f_expr_gen:this.context[P]=fe.f_gen}this.exprAllowed=!0},R.name.updateContext=function(g){var P=!1;this.options.ecmaVersion>=6&&g!==R.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(P=!0),this.exprAllowed=P};var ae=o.prototype;ae.checkPropClash=function(g,P,re){if(!(this.options.ecmaVersion>=9&&g.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(g.computed||g.method||g.shorthand))){var _e=g.key,Le;switch(_e.type){case"Identifier":Le=_e.name;break;case"Literal":Le=String(_e.value);break;default:return}var Ze=g.kind;if(this.options.ecmaVersion>=6){Le==="__proto__"&&Ze==="init"&&(P.proto&&(re?re.doubleProto<0&&(re.doubleProto=_e.start):this.raiseRecoverable(_e.start,"Redefinition of __proto__ property")),P.proto=!0);return}Le="$"+Le;var tt=P[Le];if(tt){var kt;Ze==="init"?kt=this.strict&&tt.init||tt.get||tt.set:kt=tt.init||tt[Ze],kt&&this.raiseRecoverable(_e.start,"Redefinition of property")}else tt=P[Le]={init:!1,get:!1,set:!1};tt[Ze]=!0}},ae.parseExpression=function(g,P){var re=this.start,_e=this.startLoc,Le=this.parseMaybeAssign(g,P);if(this.type===R.comma){var Ze=this.startNodeAt(re,_e);for(Ze.expressions=[Le];this.eat(R.comma);)Ze.expressions.push(this.parseMaybeAssign(g,P));return this.finishNode(Ze,"SequenceExpression")}return Le},ae.parseMaybeAssign=function(g,P,re){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(g);this.exprAllowed=!1}var _e=!1,Le=-1,Ze=-1,tt=-1;P?(Le=P.parenthesizedAssign,Ze=P.trailingComma,tt=P.doubleProto,P.parenthesizedAssign=P.trailingComma=-1):(P=new E,_e=!0);var kt=this.start,Nt=this.startLoc;(this.type===R.parenL||this.type===R.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=g==="await");var _r=this.parseMaybeConditional(g,P);if(re&&(_r=re.call(this,_r,kt,Nt)),this.type.isAssign){var cr=this.startNodeAt(kt,Nt);return cr.operator=this.value,this.type===R.eq&&(_r=this.toAssignable(_r,!1,P)),_e||(P.parenthesizedAssign=P.trailingComma=P.doubleProto=-1),P.shorthandAssign>=_r.start&&(P.shorthandAssign=-1),this.type===R.eq?this.checkLValPattern(_r):this.checkLValSimple(_r),cr.left=_r,this.next(),cr.right=this.parseMaybeAssign(g),tt>-1&&(P.doubleProto=tt),this.finishNode(cr,"AssignmentExpression")}else _e&&this.checkExpressionErrors(P,!0);return Le>-1&&(P.parenthesizedAssign=Le),Ze>-1&&(P.trailingComma=Ze),_r},ae.parseMaybeConditional=function(g,P){var re=this.start,_e=this.startLoc,Le=this.parseExprOps(g,P);if(this.checkExpressionErrors(P))return Le;if(this.eat(R.question)){var Ze=this.startNodeAt(re,_e);return Ze.test=Le,Ze.consequent=this.parseMaybeAssign(),this.expect(R.colon),Ze.alternate=this.parseMaybeAssign(g),this.finishNode(Ze,"ConditionalExpression")}return Le},ae.parseExprOps=function(g,P){var re=this.start,_e=this.startLoc,Le=this.parseMaybeUnary(P,!1,!1,g);return this.checkExpressionErrors(P)||Le.start===re&&Le.type==="ArrowFunctionExpression"?Le:this.parseExprOp(Le,re,_e,-1,g)},ae.parseExprOp=function(g,P,re,_e,Le){var Ze=this.type.binop;if(Ze!=null&&(!Le||this.type!==R._in)&&Ze>_e){var tt=this.type===R.logicalOR||this.type===R.logicalAND,kt=this.type===R.coalesce;kt&&(Ze=R.logicalAND.binop);var Nt=this.value;this.next();var _r=this.start,cr=this.startLoc,Ut=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,Le),_r,cr,Ze,Le),jt=this.buildBinary(P,re,g,Ut,Nt,tt||kt);return(tt&&this.type===R.coalesce||kt&&(this.type===R.logicalOR||this.type===R.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(jt,P,re,_e,Le)}return g},ae.buildBinary=function(g,P,re,_e,Le,Ze){_e.type==="PrivateIdentifier"&&this.raise(_e.start,"Private identifier can only be left side of binary expression");var tt=this.startNodeAt(g,P);return tt.left=re,tt.operator=Le,tt.right=_e,this.finishNode(tt,Ze?"LogicalExpression":"BinaryExpression")},ae.parseMaybeUnary=function(g,P,re,_e){var Le=this.start,Ze=this.startLoc,tt;if(this.isContextual("await")&&this.canAwait)tt=this.parseAwait(_e),P=!0;else if(this.type.prefix){var kt=this.startNode(),Nt=this.type===R.incDec;kt.operator=this.value,kt.prefix=!0,this.next(),kt.argument=this.parseMaybeUnary(null,!0,Nt,_e),this.checkExpressionErrors(g,!0),Nt?this.checkLValSimple(kt.argument):this.strict&&kt.operator==="delete"&&Z(kt.argument)?this.raiseRecoverable(kt.start,"Deleting local variable in strict mode"):kt.operator==="delete"&&ue(kt.argument)?this.raiseRecoverable(kt.start,"Private fields can not be deleted"):P=!0,tt=this.finishNode(kt,Nt?"UpdateExpression":"UnaryExpression")}else if(!P&&this.type===R.privateId)(_e||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),tt=this.parsePrivateIdent(),this.type!==R._in&&this.unexpected();else{if(tt=this.parseExprSubscripts(g,_e),this.checkExpressionErrors(g))return tt;for(;this.type.postfix&&!this.canInsertSemicolon();){var _r=this.startNodeAt(Le,Ze);_r.operator=this.value,_r.prefix=!1,_r.argument=tt,this.checkLValSimple(tt),this.next(),tt=this.finishNode(_r,"UpdateExpression")}}if(!re&&this.eat(R.starstar))if(P)this.unexpected(this.lastTokStart);else return this.buildBinary(Le,Ze,tt,this.parseMaybeUnary(null,!1,!1,_e),"**",!1);else return tt};function Z(g){return g.type==="Identifier"||g.type==="ParenthesizedExpression"&&Z(g.expression)}function ue(g){return g.type==="MemberExpression"&&g.property.type==="PrivateIdentifier"||g.type==="ChainExpression"&&ue(g.expression)||g.type==="ParenthesizedExpression"&&ue(g.expression)}ae.parseExprSubscripts=function(g,P){var re=this.start,_e=this.startLoc,Le=this.parseExprAtom(g,P);if(Le.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return Le;var Ze=this.parseSubscripts(Le,re,_e,!1,P);return g&&Ze.type==="MemberExpression"&&(g.parenthesizedAssign>=Ze.start&&(g.parenthesizedAssign=-1),g.parenthesizedBind>=Ze.start&&(g.parenthesizedBind=-1),g.trailingComma>=Ze.start&&(g.trailingComma=-1)),Ze},ae.parseSubscripts=function(g,P,re,_e,Le){for(var Ze=this.options.ecmaVersion>=8&&g.type==="Identifier"&&g.name==="async"&&this.lastTokEnd===g.end&&!this.canInsertSemicolon()&&g.end-g.start===5&&this.potentialArrowAt===g.start,tt=!1;;){var kt=this.parseSubscript(g,P,re,_e,Ze,tt,Le);if(kt.optional&&(tt=!0),kt===g||kt.type==="ArrowFunctionExpression"){if(tt){var Nt=this.startNodeAt(P,re);Nt.expression=kt,kt=this.finishNode(Nt,"ChainExpression")}return kt}g=kt}},ae.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(R.arrow)},ae.parseSubscriptAsyncArrow=function(g,P,re,_e){return this.parseArrowExpression(this.startNodeAt(g,P),re,!0,_e)},ae.parseSubscript=function(g,P,re,_e,Le,Ze,tt){var kt=this.options.ecmaVersion>=11,Nt=kt&&this.eat(R.questionDot);_e&&Nt&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var _r=this.eat(R.bracketL);if(_r||Nt&&this.type!==R.parenL&&this.type!==R.backQuote||this.eat(R.dot)){var cr=this.startNodeAt(P,re);cr.object=g,_r?(cr.property=this.parseExpression(),this.expect(R.bracketR)):this.type===R.privateId&&g.type!=="Super"?cr.property=this.parsePrivateIdent():cr.property=this.parseIdent(this.options.allowReserved!=="never"),cr.computed=!!_r,kt&&(cr.optional=Nt),g=this.finishNode(cr,"MemberExpression")}else if(!_e&&this.eat(R.parenL)){var Ut=new E,jt=this.yieldPos,Ds=this.awaitPos,Cs=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Rs=this.parseExprList(R.parenR,this.options.ecmaVersion>=8,!1,Ut);if(Le&&!Nt&&this.shouldParseAsyncArrow())return this.checkPatternErrors(Ut,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=jt,this.awaitPos=Ds,this.awaitIdentPos=Cs,this.parseSubscriptAsyncArrow(P,re,Rs,tt);this.checkExpressionErrors(Ut,!0),this.yieldPos=jt||this.yieldPos,this.awaitPos=Ds||this.awaitPos,this.awaitIdentPos=Cs||this.awaitIdentPos;var Ii=this.startNodeAt(P,re);Ii.callee=g,Ii.arguments=Rs,kt&&(Ii.optional=Nt),g=this.finishNode(Ii,"CallExpression")}else if(this.type===R.backQuote){(Nt||Ze)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var xs=this.startNodeAt(P,re);xs.tag=g,xs.quasi=this.parseTemplate({isTagged:!0}),g=this.finishNode(xs,"TaggedTemplateExpression")}return g},ae.parseExprAtom=function(g,P,re){this.type===R.slash&&this.readRegexp();var _e,Le=this.potentialArrowAt===this.start;switch(this.type){case R._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),_e=this.startNode(),this.next(),this.type===R.parenL&&!this.allowDirectSuper&&this.raise(_e.start,"super() call outside constructor of a subclass"),this.type!==R.dot&&this.type!==R.bracketL&&this.type!==R.parenL&&this.unexpected(),this.finishNode(_e,"Super");case R._this:return _e=this.startNode(),this.next(),this.finishNode(_e,"ThisExpression");case R.name:var Ze=this.start,tt=this.startLoc,kt=this.containsEsc,Nt=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!kt&&Nt.name==="async"&&!this.canInsertSemicolon()&&this.eat(R._function))return this.overrideContext(fe.f_expr),this.parseFunction(this.startNodeAt(Ze,tt),0,!1,!0,P);if(Le&&!this.canInsertSemicolon()){if(this.eat(R.arrow))return this.parseArrowExpression(this.startNodeAt(Ze,tt),[Nt],!1,P);if(this.options.ecmaVersion>=8&&Nt.name==="async"&&this.type===R.name&&!kt&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return Nt=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(R.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(Ze,tt),[Nt],!0,P)}return Nt;case R.regexp:var _r=this.value;return _e=this.parseLiteral(_r.value),_e.regex={pattern:_r.pattern,flags:_r.flags},_e;case R.num:case R.string:return this.parseLiteral(this.value);case R._null:case R._true:case R._false:return _e=this.startNode(),_e.value=this.type===R._null?null:this.type===R._true,_e.raw=this.type.keyword,this.next(),this.finishNode(_e,"Literal");case R.parenL:var cr=this.start,Ut=this.parseParenAndDistinguishExpression(Le,P);return g&&(g.parenthesizedAssign<0&&!this.isSimpleAssignTarget(Ut)&&(g.parenthesizedAssign=cr),g.parenthesizedBind<0&&(g.parenthesizedBind=cr)),Ut;case R.bracketL:return _e=this.startNode(),this.next(),_e.elements=this.parseExprList(R.bracketR,!0,!0,g),this.finishNode(_e,"ArrayExpression");case R.braceL:return this.overrideContext(fe.b_expr),this.parseObj(!1,g);case R._function:return _e=this.startNode(),this.next(),this.parseFunction(_e,0);case R._class:return this.parseClass(this.startNode(),!1);case R._new:return this.parseNew();case R.backQuote:return this.parseTemplate();case R._import:return this.options.ecmaVersion>=11?this.parseExprImport(re):this.unexpected();default:return this.parseExprAtomDefault()}},ae.parseExprAtomDefault=function(){this.unexpected()},ae.parseExprImport=function(g){var P=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===R.parenL&&!g)return this.parseDynamicImport(P);if(this.type===R.dot){var re=this.startNodeAt(P.start,P.loc&&P.loc.start);return re.name="import",P.meta=this.finishNode(re,"Identifier"),this.parseImportMeta(P)}else this.unexpected()},ae.parseDynamicImport=function(g){if(this.next(),g.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(R.parenR)?g.options=null:(this.expect(R.comma),this.afterTrailingComma(R.parenR)?g.options=null:(g.options=this.parseMaybeAssign(),this.eat(R.parenR)||(this.expect(R.comma),this.afterTrailingComma(R.parenR)||this.unexpected())));else if(!this.eat(R.parenR)){var P=this.start;this.eat(R.comma)&&this.eat(R.parenR)?this.raiseRecoverable(P,"Trailing comma is not allowed in import()"):this.unexpected(P)}return this.finishNode(g,"ImportExpression")},ae.parseImportMeta=function(g){this.next();var P=this.containsEsc;return g.property=this.parseIdent(!0),g.property.name!=="meta"&&this.raiseRecoverable(g.property.start,"The only valid meta property for import is 'import.meta'"),P&&this.raiseRecoverable(g.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(g.start,"Cannot use 'import.meta' outside a module"),this.finishNode(g,"MetaProperty")},ae.parseLiteral=function(g){var P=this.startNode();return P.value=g,P.raw=this.input.slice(this.start,this.end),P.raw.charCodeAt(P.raw.length-1)===110&&(P.bigint=P.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(P,"Literal")},ae.parseParenExpression=function(){this.expect(R.parenL);var g=this.parseExpression();return this.expect(R.parenR),g},ae.shouldParseArrow=function(g){return!this.canInsertSemicolon()},ae.parseParenAndDistinguishExpression=function(g,P){var re=this.start,_e=this.startLoc,Le,Ze=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var tt=this.start,kt=this.startLoc,Nt=[],_r=!0,cr=!1,Ut=new E,jt=this.yieldPos,Ds=this.awaitPos,Cs;for(this.yieldPos=0,this.awaitPos=0;this.type!==R.parenR;)if(_r?_r=!1:this.expect(R.comma),Ze&&this.afterTrailingComma(R.parenR,!0)){cr=!0;break}else if(this.type===R.ellipsis){Cs=this.start,Nt.push(this.parseParenItem(this.parseRestBinding())),this.type===R.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else Nt.push(this.parseMaybeAssign(!1,Ut,this.parseParenItem));var Rs=this.lastTokEnd,Ii=this.lastTokEndLoc;if(this.expect(R.parenR),g&&this.shouldParseArrow(Nt)&&this.eat(R.arrow))return this.checkPatternErrors(Ut,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=jt,this.awaitPos=Ds,this.parseParenArrowList(re,_e,Nt,P);(!Nt.length||cr)&&this.unexpected(this.lastTokStart),Cs&&this.unexpected(Cs),this.checkExpressionErrors(Ut,!0),this.yieldPos=jt||this.yieldPos,this.awaitPos=Ds||this.awaitPos,Nt.length>1?(Le=this.startNodeAt(tt,kt),Le.expressions=Nt,this.finishNodeAt(Le,"SequenceExpression",Rs,Ii)):Le=Nt[0]}else Le=this.parseParenExpression();if(this.options.preserveParens){var xs=this.startNodeAt(re,_e);return xs.expression=Le,this.finishNode(xs,"ParenthesizedExpression")}else return Le},ae.parseParenItem=function(g){return g},ae.parseParenArrowList=function(g,P,re,_e){return this.parseArrowExpression(this.startNodeAt(g,P),re,!1,_e)};var me=[];ae.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var g=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===R.dot){var P=this.startNodeAt(g.start,g.loc&&g.loc.start);P.name="new",g.meta=this.finishNode(P,"Identifier"),this.next();var re=this.containsEsc;return g.property=this.parseIdent(!0),g.property.name!=="target"&&this.raiseRecoverable(g.property.start,"The only valid meta property for new is 'new.target'"),re&&this.raiseRecoverable(g.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(g.start,"'new.target' can only be used in functions and class static block"),this.finishNode(g,"MetaProperty")}var _e=this.start,Le=this.startLoc;return g.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),_e,Le,!0,!1),this.eat(R.parenL)?g.arguments=this.parseExprList(R.parenR,this.options.ecmaVersion>=8,!1):g.arguments=me,this.finishNode(g,"NewExpression")},ae.parseTemplateElement=function(g){var P=g.isTagged,re=this.startNode();return this.type===R.invalidTemplate?(P||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),re.value={raw:this.value.replace(/\r\n?/g,`
|
|
71
|
+
`),cooked:null}):re.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
72
|
+
`),cooked:this.value},this.next(),re.tail=this.type===R.backQuote,this.finishNode(re,"TemplateElement")},ae.parseTemplate=function(g){g===void 0&&(g={});var P=g.isTagged;P===void 0&&(P=!1);var re=this.startNode();this.next(),re.expressions=[];var _e=this.parseTemplateElement({isTagged:P});for(re.quasis=[_e];!_e.tail;)this.type===R.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(R.dollarBraceL),re.expressions.push(this.parseExpression()),this.expect(R.braceR),re.quasis.push(_e=this.parseTemplateElement({isTagged:P}));return this.next(),this.finishNode(re,"TemplateLiteral")},ae.isAsyncProp=function(g){return!g.computed&&g.key.type==="Identifier"&&g.key.name==="async"&&(this.type===R.name||this.type===R.num||this.type===R.string||this.type===R.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===R.star)&&!ye.test(this.input.slice(this.lastTokEnd,this.start))},ae.parseObj=function(g,P){var re=this.startNode(),_e=!0,Le={};for(re.properties=[],this.next();!this.eat(R.braceR);){if(_e)_e=!1;else if(this.expect(R.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(R.braceR))break;var Ze=this.parseProperty(g,P);g||this.checkPropClash(Ze,Le,P),re.properties.push(Ze)}return this.finishNode(re,g?"ObjectPattern":"ObjectExpression")},ae.parseProperty=function(g,P){var re=this.startNode(),_e,Le,Ze,tt;if(this.options.ecmaVersion>=9&&this.eat(R.ellipsis))return g?(re.argument=this.parseIdent(!1),this.type===R.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(re,"RestElement")):(re.argument=this.parseMaybeAssign(!1,P),this.type===R.comma&&P&&P.trailingComma<0&&(P.trailingComma=this.start),this.finishNode(re,"SpreadElement"));this.options.ecmaVersion>=6&&(re.method=!1,re.shorthand=!1,(g||P)&&(Ze=this.start,tt=this.startLoc),g||(_e=this.eat(R.star)));var kt=this.containsEsc;return this.parsePropertyName(re),!g&&!kt&&this.options.ecmaVersion>=8&&!_e&&this.isAsyncProp(re)?(Le=!0,_e=this.options.ecmaVersion>=9&&this.eat(R.star),this.parsePropertyName(re)):Le=!1,this.parsePropertyValue(re,g,_e,Le,Ze,tt,P,kt),this.finishNode(re,"Property")},ae.parseGetterSetter=function(g){g.kind=g.key.name,this.parsePropertyName(g),g.value=this.parseMethod(!1);var P=g.kind==="get"?0:1;if(g.value.params.length!==P){var re=g.value.start;g.kind==="get"?this.raiseRecoverable(re,"getter should have no params"):this.raiseRecoverable(re,"setter should have exactly one param")}else g.kind==="set"&&g.value.params[0].type==="RestElement"&&this.raiseRecoverable(g.value.params[0].start,"Setter cannot use rest params")},ae.parsePropertyValue=function(g,P,re,_e,Le,Ze,tt,kt){(re||_e)&&this.type===R.colon&&this.unexpected(),this.eat(R.colon)?(g.value=P?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,tt),g.kind="init"):this.options.ecmaVersion>=6&&this.type===R.parenL?(P&&this.unexpected(),g.kind="init",g.method=!0,g.value=this.parseMethod(re,_e)):!P&&!kt&&this.options.ecmaVersion>=5&&!g.computed&&g.key.type==="Identifier"&&(g.key.name==="get"||g.key.name==="set")&&this.type!==R.comma&&this.type!==R.braceR&&this.type!==R.eq?((re||_e)&&this.unexpected(),this.parseGetterSetter(g)):this.options.ecmaVersion>=6&&!g.computed&&g.key.type==="Identifier"?((re||_e)&&this.unexpected(),this.checkUnreserved(g.key),g.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=Le),g.kind="init",P?g.value=this.parseMaybeDefault(Le,Ze,this.copyNode(g.key)):this.type===R.eq&&tt?(tt.shorthandAssign<0&&(tt.shorthandAssign=this.start),g.value=this.parseMaybeDefault(Le,Ze,this.copyNode(g.key))):g.value=this.copyNode(g.key),g.shorthand=!0):this.unexpected()},ae.parsePropertyName=function(g){if(this.options.ecmaVersion>=6){if(this.eat(R.bracketL))return g.computed=!0,g.key=this.parseMaybeAssign(),this.expect(R.bracketR),g.key;g.computed=!1}return g.key=this.type===R.num||this.type===R.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")},ae.initFunction=function(g){g.id=null,this.options.ecmaVersion>=6&&(g.generator=g.expression=!1),this.options.ecmaVersion>=8&&(g.async=!1)},ae.parseMethod=function(g,P,re){var _e=this.startNode(),Le=this.yieldPos,Ze=this.awaitPos,tt=this.awaitIdentPos;return this.initFunction(_e),this.options.ecmaVersion>=6&&(_e.generator=g),this.options.ecmaVersion>=8&&(_e.async=!!P),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Wr(P,_e.generator)|gr|(re?vr:0)),this.expect(R.parenL),_e.params=this.parseBindingList(R.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(_e,!1,!0,!1),this.yieldPos=Le,this.awaitPos=Ze,this.awaitIdentPos=tt,this.finishNode(_e,"FunctionExpression")},ae.parseArrowExpression=function(g,P,re,_e){var Le=this.yieldPos,Ze=this.awaitPos,tt=this.awaitIdentPos;return this.enterScope(Wr(re,!1)|Dt),this.initFunction(g),this.options.ecmaVersion>=8&&(g.async=!!re),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,g.params=this.toAssignableList(P,!0),this.parseFunctionBody(g,!0,!1,_e),this.yieldPos=Le,this.awaitPos=Ze,this.awaitIdentPos=tt,this.finishNode(g,"ArrowFunctionExpression")},ae.parseFunctionBody=function(g,P,re,_e){var Le=P&&this.type!==R.braceL,Ze=this.strict,tt=!1;if(Le)g.body=this.parseMaybeAssign(_e),g.expression=!0,this.checkParams(g,!1);else{var kt=this.options.ecmaVersion>=7&&!this.isSimpleParamList(g.params);(!Ze||kt)&&(tt=this.strictDirective(this.end),tt&&kt&&this.raiseRecoverable(g.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var Nt=this.labels;this.labels=[],tt&&(this.strict=!0),this.checkParams(g,!Ze&&!tt&&!P&&!re&&this.isSimpleParamList(g.params)),this.strict&&g.id&&this.checkLValSimple(g.id,rt),g.body=this.parseBlock(!1,void 0,tt&&!Ze),g.expression=!1,this.adaptDirectivePrologue(g.body.body),this.labels=Nt}this.exitScope()},ae.isSimpleParamList=function(g){for(var P=0,re=g;P<re.length;P+=1){var _e=re[P];if(_e.type!=="Identifier")return!1}return!0},ae.checkParams=function(g,P){for(var re=Object.create(null),_e=0,Le=g.params;_e<Le.length;_e+=1){var Ze=Le[_e];this.checkLValInnerPattern(Ze,Ue,P?null:re)}},ae.parseExprList=function(g,P,re,_e){for(var Le=[],Ze=!0;!this.eat(g);){if(Ze)Ze=!1;else if(this.expect(R.comma),P&&this.afterTrailingComma(g))break;var tt=void 0;re&&this.type===R.comma?tt=null:this.type===R.ellipsis?(tt=this.parseSpread(_e),_e&&this.type===R.comma&&_e.trailingComma<0&&(_e.trailingComma=this.start)):tt=this.parseMaybeAssign(!1,_e),Le.push(tt)}return Le},ae.checkUnreserved=function(g){var P=g.start,re=g.end,_e=g.name;if(this.inGenerator&&_e==="yield"&&this.raiseRecoverable(P,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&_e==="await"&&this.raiseRecoverable(P,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&_e==="arguments"&&this.raiseRecoverable(P,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(_e==="arguments"||_e==="await")&&this.raise(P,"Cannot use "+_e+" in class static initialization block"),this.keywords.test(_e)&&this.raise(P,"Unexpected keyword '"+_e+"'"),!(this.options.ecmaVersion<6&&this.input.slice(P,re).indexOf("\\")!==-1)){var Le=this.strict?this.reservedWordsStrict:this.reservedWords;Le.test(_e)&&(!this.inAsync&&_e==="await"&&this.raiseRecoverable(P,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(P,"The keyword '"+_e+"' is reserved"))}},ae.parseIdent=function(g){var P=this.parseIdentNode();return this.next(!!g),this.finishNode(P,"Identifier"),g||(this.checkUnreserved(P),P.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=P.start)),P},ae.parseIdentNode=function(){var g=this.startNode();return this.type===R.name?g.name=this.value:this.type.keyword?(g.name=this.type.keyword,(g.name==="class"||g.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=R.name):this.unexpected(),g},ae.parsePrivateIdent=function(){var g=this.startNode();return this.type===R.privateId?g.name=this.value:this.unexpected(),this.next(),this.finishNode(g,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(g.start,"Private field '#"+g.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(g)),g},ae.parseYield=function(g){this.yieldPos||(this.yieldPos=this.start);var P=this.startNode();return this.next(),this.type===R.semi||this.canInsertSemicolon()||this.type!==R.star&&!this.type.startsExpr?(P.delegate=!1,P.argument=null):(P.delegate=this.eat(R.star),P.argument=this.parseMaybeAssign(g)),this.finishNode(P,"YieldExpression")},ae.parseAwait=function(g){this.awaitPos||(this.awaitPos=this.start);var P=this.startNode();return this.next(),P.argument=this.parseMaybeUnary(null,!0,!1,g),this.finishNode(P,"AwaitExpression")};var we=o.prototype;we.raise=function(g,P){var re=$e(this.input,g);P+=" ("+re.line+":"+re.column+")";var _e=new SyntaxError(P);throw _e.pos=g,_e.loc=re,_e.raisedAt=this.pos,_e},we.raiseRecoverable=we.raise,we.curPosition=function(){if(this.options.locations)return new xe(this.curLine,this.pos-this.lineStart)};var ge=o.prototype,Ae=function(P){this.flags=P,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};ge.enterScope=function(g){this.scopeStack.push(new Ae(g))},ge.exitScope=function(){this.scopeStack.pop()},ge.treatFunctionsAsVarInScope=function(g){return g.flags&It||!this.inModule&&g.flags&Ct},ge.declareName=function(g,P,re){var _e=!1;if(P===Je){var Le=this.currentScope();_e=Le.lexical.indexOf(g)>-1||Le.functions.indexOf(g)>-1||Le.var.indexOf(g)>-1,Le.lexical.push(g),this.inModule&&Le.flags&Ct&&delete this.undefinedExports[g]}else if(P===Qe){var Ze=this.currentScope();Ze.lexical.push(g)}else if(P===Ye){var tt=this.currentScope();this.treatFunctionsAsVar?_e=tt.lexical.indexOf(g)>-1:_e=tt.lexical.indexOf(g)>-1||tt.var.indexOf(g)>-1,tt.functions.push(g)}else for(var kt=this.scopeStack.length-1;kt>=0;--kt){var Nt=this.scopeStack[kt];if(Nt.lexical.indexOf(g)>-1&&!(Nt.flags&ct&&Nt.lexical[0]===g)||!this.treatFunctionsAsVarInScope(Nt)&&Nt.functions.indexOf(g)>-1){_e=!0;break}if(Nt.var.push(g),this.inModule&&Nt.flags&Ct&&delete this.undefinedExports[g],Nt.flags&Cr)break}_e&&this.raiseRecoverable(re,"Identifier '"+g+"' has already been declared")},ge.checkLocalExport=function(g){this.scopeStack[0].lexical.indexOf(g.name)===-1&&this.scopeStack[0].var.indexOf(g.name)===-1&&(this.undefinedExports[g.name]=g)},ge.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},ge.currentVarScope=function(){for(var g=this.scopeStack.length-1;;g--){var P=this.scopeStack[g];if(P.flags&Cr)return P}},ge.currentThisScope=function(){for(var g=this.scopeStack.length-1;;g--){var P=this.scopeStack[g];if(P.flags&Cr&&!(P.flags&Dt))return P}};var Ie=function(P,re,_e){this.type="",this.start=re,this.end=0,P.options.locations&&(this.loc=new De(P,_e)),P.options.directSourceFile&&(this.sourceFile=P.options.directSourceFile),P.options.ranges&&(this.range=[re,0])},Oe=o.prototype;Oe.startNode=function(){return new Ie(this,this.start,this.startLoc)},Oe.startNodeAt=function(g,P){return new Ie(this,g,P)};function qe(g,P,re,_e){return g.type=P,g.end=re,this.options.locations&&(g.loc.end=_e),this.options.ranges&&(g.range[1]=re),g}Oe.finishNode=function(g,P){return qe.call(this,g,P,this.lastTokEnd,this.lastTokEndLoc)},Oe.finishNodeAt=function(g,P,re,_e){return qe.call(this,g,P,re,_e)},Oe.copyNode=function(g){var P=new Ie(this,g.start,this.startLoc);for(var re in g)P[re]=g[re];return P};var Pe="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",Fe="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Ve=Fe+" Extended_Pictographic",Ke=Ve,Xe=Ke+" EBase EComp EMod EPres ExtPict",je=Xe,gt=je,xt={9:Fe,10:Ve,11:Ke,12:Xe,13:je,14:gt},Mt="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Bt={9:"",10:"",11:"",12:"",13:"",14:Mt},ot="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",ht="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Tt=ht+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",zt=Tt+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Ft=zt+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Zt=Ft+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",rr=Zt+" "+Pe,sr={9:ht,10:Tt,11:zt,12:Ft,13:Zt,14:rr},fr={};function ur(g){var P=fr[g]={binary:H(xt[g]+" "+ot),binaryOfStrings:H(Bt[g]),nonBinary:{General_Category:H(ot),Script:H(sr[g])}};P.nonBinary.Script_Extensions=P.nonBinary.Script,P.nonBinary.gc=P.nonBinary.General_Category,P.nonBinary.sc=P.nonBinary.Script,P.nonBinary.scx=P.nonBinary.Script_Extensions}for(var ln=0,sn=[9,10,11,12,13,14];ln<sn.length;ln+=1){var gn=sn[ln];ur(gn)}var Et=o.prototype,Lr=function(P,re){this.parent=P,this.base=re||this};Lr.prototype.separatedFrom=function(P){for(var re=this;re;re=re.parent)for(var _e=P;_e;_e=_e.parent)if(re.base===_e.base&&re!==_e)return!0;return!1},Lr.prototype.sibling=function(){return new Lr(this.parent,this.base)};var Br=function(P){this.parser=P,this.validFlags="gim"+(P.options.ecmaVersion>=6?"uy":"")+(P.options.ecmaVersion>=9?"s":"")+(P.options.ecmaVersion>=13?"d":"")+(P.options.ecmaVersion>=15?"v":""),this.unicodeProperties=fr[P.options.ecmaVersion>=14?14:P.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};Br.prototype.reset=function(P,re,_e){var Le=_e.indexOf("v")!==-1,Ze=_e.indexOf("u")!==-1;this.start=P|0,this.source=re+"",this.flags=_e,Le&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=Ze&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=Ze&&this.parser.options.ecmaVersion>=9)},Br.prototype.raise=function(P){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+P)},Br.prototype.at=function(P,re){re===void 0&&(re=!1);var _e=this.source,Le=_e.length;if(P>=Le)return-1;var Ze=_e.charCodeAt(P);if(!(re||this.switchU)||Ze<=55295||Ze>=57344||P+1>=Le)return Ze;var tt=_e.charCodeAt(P+1);return tt>=56320&&tt<=57343?(Ze<<10)+tt-56613888:Ze},Br.prototype.nextIndex=function(P,re){re===void 0&&(re=!1);var _e=this.source,Le=_e.length;if(P>=Le)return Le;var Ze=_e.charCodeAt(P),tt;return!(re||this.switchU)||Ze<=55295||Ze>=57344||P+1>=Le||(tt=_e.charCodeAt(P+1))<56320||tt>57343?P+1:P+2},Br.prototype.current=function(P){return P===void 0&&(P=!1),this.at(this.pos,P)},Br.prototype.lookahead=function(P){return P===void 0&&(P=!1),this.at(this.nextIndex(this.pos,P),P)},Br.prototype.advance=function(P){P===void 0&&(P=!1),this.pos=this.nextIndex(this.pos,P)},Br.prototype.eat=function(P,re){return re===void 0&&(re=!1),this.current(re)===P?(this.advance(re),!0):!1},Br.prototype.eatChars=function(P,re){re===void 0&&(re=!1);for(var _e=this.pos,Le=0,Ze=P;Le<Ze.length;Le+=1){var tt=Ze[Le],kt=this.at(_e,re);if(kt===-1||kt!==tt)return!1;_e=this.nextIndex(_e,re)}return this.pos=_e,!0},Et.validateRegExpFlags=function(g){for(var P=g.validFlags,re=g.flags,_e=!1,Le=!1,Ze=0;Ze<re.length;Ze++){var tt=re.charAt(Ze);P.indexOf(tt)===-1&&this.raise(g.start,"Invalid regular expression flag"),re.indexOf(tt,Ze+1)>-1&&this.raise(g.start,"Duplicate regular expression flag"),tt==="u"&&(_e=!0),tt==="v"&&(Le=!0)}this.options.ecmaVersion>=15&&_e&&Le&&this.raise(g.start,"Invalid regular expression flag")};function Gn(g){for(var P in g)return!0;return!1}Et.validateRegExpPattern=function(g){this.regexp_pattern(g),!g.switchN&&this.options.ecmaVersion>=9&&Gn(g.groupNames)&&(g.switchN=!0,this.regexp_pattern(g))},Et.regexp_pattern=function(g){g.pos=0,g.lastIntValue=0,g.lastStringValue="",g.lastAssertionIsQuantifiable=!1,g.numCapturingParens=0,g.maxBackReference=0,g.groupNames=Object.create(null),g.backReferenceNames.length=0,g.branchID=null,this.regexp_disjunction(g),g.pos!==g.source.length&&(g.eat(41)&&g.raise("Unmatched ')'"),(g.eat(93)||g.eat(125))&&g.raise("Lone quantifier brackets")),g.maxBackReference>g.numCapturingParens&&g.raise("Invalid escape");for(var P=0,re=g.backReferenceNames;P<re.length;P+=1){var _e=re[P];g.groupNames[_e]||g.raise("Invalid named capture referenced")}},Et.regexp_disjunction=function(g){var P=this.options.ecmaVersion>=16;for(P&&(g.branchID=new Lr(g.branchID,null)),this.regexp_alternative(g);g.eat(124);)P&&(g.branchID=g.branchID.sibling()),this.regexp_alternative(g);P&&(g.branchID=g.branchID.parent),this.regexp_eatQuantifier(g,!0)&&g.raise("Nothing to repeat"),g.eat(123)&&g.raise("Lone quantifier brackets")},Et.regexp_alternative=function(g){for(;g.pos<g.source.length&&this.regexp_eatTerm(g););},Et.regexp_eatTerm=function(g){return this.regexp_eatAssertion(g)?(g.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(g)&&g.switchU&&g.raise("Invalid quantifier"),!0):(g.switchU?this.regexp_eatAtom(g):this.regexp_eatExtendedAtom(g))?(this.regexp_eatQuantifier(g),!0):!1},Et.regexp_eatAssertion=function(g){var P=g.pos;if(g.lastAssertionIsQuantifiable=!1,g.eat(94)||g.eat(36))return!0;if(g.eat(92)){if(g.eat(66)||g.eat(98))return!0;g.pos=P}if(g.eat(40)&&g.eat(63)){var re=!1;if(this.options.ecmaVersion>=9&&(re=g.eat(60)),g.eat(61)||g.eat(33))return this.regexp_disjunction(g),g.eat(41)||g.raise("Unterminated group"),g.lastAssertionIsQuantifiable=!re,!0}return g.pos=P,!1},Et.regexp_eatQuantifier=function(g,P){return P===void 0&&(P=!1),this.regexp_eatQuantifierPrefix(g,P)?(g.eat(63),!0):!1},Et.regexp_eatQuantifierPrefix=function(g,P){return g.eat(42)||g.eat(43)||g.eat(63)||this.regexp_eatBracedQuantifier(g,P)},Et.regexp_eatBracedQuantifier=function(g,P){var re=g.pos;if(g.eat(123)){var _e=0,Le=-1;if(this.regexp_eatDecimalDigits(g)&&(_e=g.lastIntValue,g.eat(44)&&this.regexp_eatDecimalDigits(g)&&(Le=g.lastIntValue),g.eat(125)))return Le!==-1&&Le<_e&&!P&&g.raise("numbers out of order in {} quantifier"),!0;g.switchU&&!P&&g.raise("Incomplete quantifier"),g.pos=re}return!1},Et.regexp_eatAtom=function(g){return this.regexp_eatPatternCharacters(g)||g.eat(46)||this.regexp_eatReverseSolidusAtomEscape(g)||this.regexp_eatCharacterClass(g)||this.regexp_eatUncapturingGroup(g)||this.regexp_eatCapturingGroup(g)},Et.regexp_eatReverseSolidusAtomEscape=function(g){var P=g.pos;if(g.eat(92)){if(this.regexp_eatAtomEscape(g))return!0;g.pos=P}return!1},Et.regexp_eatUncapturingGroup=function(g){var P=g.pos;if(g.eat(40)){if(g.eat(63)){if(this.options.ecmaVersion>=16){var re=this.regexp_eatModifiers(g),_e=g.eat(45);if(re||_e){for(var Le=0;Le<re.length;Le++){var Ze=re.charAt(Le);re.indexOf(Ze,Le+1)>-1&&g.raise("Duplicate regular expression modifiers")}if(_e){var tt=this.regexp_eatModifiers(g);!re&&!tt&&g.current()===58&&g.raise("Invalid regular expression modifiers");for(var kt=0;kt<tt.length;kt++){var Nt=tt.charAt(kt);(tt.indexOf(Nt,kt+1)>-1||re.indexOf(Nt)>-1)&&g.raise("Duplicate regular expression modifiers")}}}}if(g.eat(58)){if(this.regexp_disjunction(g),g.eat(41))return!0;g.raise("Unterminated group")}}g.pos=P}return!1},Et.regexp_eatCapturingGroup=function(g){if(g.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(g):g.current()===63&&g.raise("Invalid group"),this.regexp_disjunction(g),g.eat(41))return g.numCapturingParens+=1,!0;g.raise("Unterminated group")}return!1},Et.regexp_eatModifiers=function(g){for(var P="",re=0;(re=g.current())!==-1&&vn(re);)P+=Y(re),g.advance();return P};function vn(g){return g===105||g===109||g===115}Et.regexp_eatExtendedAtom=function(g){return g.eat(46)||this.regexp_eatReverseSolidusAtomEscape(g)||this.regexp_eatCharacterClass(g)||this.regexp_eatUncapturingGroup(g)||this.regexp_eatCapturingGroup(g)||this.regexp_eatInvalidBracedQuantifier(g)||this.regexp_eatExtendedPatternCharacter(g)},Et.regexp_eatInvalidBracedQuantifier=function(g){return this.regexp_eatBracedQuantifier(g,!0)&&g.raise("Nothing to repeat"),!1},Et.regexp_eatSyntaxCharacter=function(g){var P=g.current();return On(P)?(g.lastIntValue=P,g.advance(),!0):!1};function On(g){return g===36||g>=40&&g<=43||g===46||g===63||g>=91&&g<=94||g>=123&&g<=125}Et.regexp_eatPatternCharacters=function(g){for(var P=g.pos,re=0;(re=g.current())!==-1&&!On(re);)g.advance();return g.pos!==P},Et.regexp_eatExtendedPatternCharacter=function(g){var P=g.current();return P!==-1&&P!==36&&!(P>=40&&P<=43)&&P!==46&&P!==63&&P!==91&&P!==94&&P!==124?(g.advance(),!0):!1},Et.regexp_groupSpecifier=function(g){if(g.eat(63)){this.regexp_eatGroupName(g)||g.raise("Invalid group");var P=this.options.ecmaVersion>=16,re=g.groupNames[g.lastStringValue];if(re)if(P)for(var _e=0,Le=re;_e<Le.length;_e+=1){var Ze=Le[_e];Ze.separatedFrom(g.branchID)||g.raise("Duplicate capture group name")}else g.raise("Duplicate capture group name");P?(re||(g.groupNames[g.lastStringValue]=[])).push(g.branchID):g.groupNames[g.lastStringValue]=!0}},Et.regexp_eatGroupName=function(g){if(g.lastStringValue="",g.eat(60)){if(this.regexp_eatRegExpIdentifierName(g)&&g.eat(62))return!0;g.raise("Invalid capture group name")}return!1},Et.regexp_eatRegExpIdentifierName=function(g){if(g.lastStringValue="",this.regexp_eatRegExpIdentifierStart(g)){for(g.lastStringValue+=Y(g.lastIntValue);this.regexp_eatRegExpIdentifierPart(g);)g.lastStringValue+=Y(g.lastIntValue);return!0}return!1},Et.regexp_eatRegExpIdentifierStart=function(g){var P=g.pos,re=this.options.ecmaVersion>=11,_e=g.current(re);return g.advance(re),_e===92&&this.regexp_eatRegExpUnicodeEscapeSequence(g,re)&&(_e=g.lastIntValue),Ti(_e)?(g.lastIntValue=_e,!0):(g.pos=P,!1)};function Ti(g){return C(g,!0)||g===36||g===95}Et.regexp_eatRegExpIdentifierPart=function(g){var P=g.pos,re=this.options.ecmaVersion>=11,_e=g.current(re);return g.advance(re),_e===92&&this.regexp_eatRegExpUnicodeEscapeSequence(g,re)&&(_e=g.lastIntValue),Zn(_e)?(g.lastIntValue=_e,!0):(g.pos=P,!1)};function Zn(g){return m(g,!0)||g===36||g===95||g===8204||g===8205}Et.regexp_eatAtomEscape=function(g){return this.regexp_eatBackReference(g)||this.regexp_eatCharacterClassEscape(g)||this.regexp_eatCharacterEscape(g)||g.switchN&&this.regexp_eatKGroupName(g)?!0:(g.switchU&&(g.current()===99&&g.raise("Invalid unicode escape"),g.raise("Invalid escape")),!1)},Et.regexp_eatBackReference=function(g){var P=g.pos;if(this.regexp_eatDecimalEscape(g)){var re=g.lastIntValue;if(g.switchU)return re>g.maxBackReference&&(g.maxBackReference=re),!0;if(re<=g.numCapturingParens)return!0;g.pos=P}return!1},Et.regexp_eatKGroupName=function(g){if(g.eat(107)){if(this.regexp_eatGroupName(g))return g.backReferenceNames.push(g.lastStringValue),!0;g.raise("Invalid named reference")}return!1},Et.regexp_eatCharacterEscape=function(g){return this.regexp_eatControlEscape(g)||this.regexp_eatCControlLetter(g)||this.regexp_eatZero(g)||this.regexp_eatHexEscapeSequence(g)||this.regexp_eatRegExpUnicodeEscapeSequence(g,!1)||!g.switchU&&this.regexp_eatLegacyOctalEscapeSequence(g)||this.regexp_eatIdentityEscape(g)},Et.regexp_eatCControlLetter=function(g){var P=g.pos;if(g.eat(99)){if(this.regexp_eatControlLetter(g))return!0;g.pos=P}return!1},Et.regexp_eatZero=function(g){return g.current()===48&&!bi(g.lookahead())?(g.lastIntValue=0,g.advance(),!0):!1},Et.regexp_eatControlEscape=function(g){var P=g.current();return P===116?(g.lastIntValue=9,g.advance(),!0):P===110?(g.lastIntValue=10,g.advance(),!0):P===118?(g.lastIntValue=11,g.advance(),!0):P===102?(g.lastIntValue=12,g.advance(),!0):P===114?(g.lastIntValue=13,g.advance(),!0):!1},Et.regexp_eatControlLetter=function(g){var P=g.current();return Pn(P)?(g.lastIntValue=P%32,g.advance(),!0):!1};function Pn(g){return g>=65&&g<=90||g>=97&&g<=122}Et.regexp_eatRegExpUnicodeEscapeSequence=function(g,P){P===void 0&&(P=!1);var re=g.pos,_e=P||g.switchU;if(g.eat(117)){if(this.regexp_eatFixedHexDigits(g,4)){var Le=g.lastIntValue;if(_e&&Le>=55296&&Le<=56319){var Ze=g.pos;if(g.eat(92)&&g.eat(117)&&this.regexp_eatFixedHexDigits(g,4)){var tt=g.lastIntValue;if(tt>=56320&&tt<=57343)return g.lastIntValue=(Le-55296)*1024+(tt-56320)+65536,!0}g.pos=Ze,g.lastIntValue=Le}return!0}if(_e&&g.eat(123)&&this.regexp_eatHexDigits(g)&&g.eat(125)&&Yn(g.lastIntValue))return!0;_e&&g.raise("Invalid unicode escape"),g.pos=re}return!1};function Yn(g){return g>=0&&g<=1114111}Et.regexp_eatIdentityEscape=function(g){if(g.switchU)return this.regexp_eatSyntaxCharacter(g)?!0:g.eat(47)?(g.lastIntValue=47,!0):!1;var P=g.current();return P!==99&&(!g.switchN||P!==107)?(g.lastIntValue=P,g.advance(),!0):!1},Et.regexp_eatDecimalEscape=function(g){g.lastIntValue=0;var P=g.current();if(P>=49&&P<=57){do g.lastIntValue=10*g.lastIntValue+(P-48),g.advance();while((P=g.current())>=48&&P<=57);return!0}return!1};var Nn=0,an=1,jr=2;Et.regexp_eatCharacterClassEscape=function(g){var P=g.current();if(ca(P))return g.lastIntValue=-1,g.advance(),an;var re=!1;if(g.switchU&&this.options.ecmaVersion>=9&&((re=P===80)||P===112)){g.lastIntValue=-1,g.advance();var _e;if(g.eat(123)&&(_e=this.regexp_eatUnicodePropertyValueExpression(g))&&g.eat(125))return re&&_e===jr&&g.raise("Invalid property name"),_e;g.raise("Invalid property name")}return Nn};function ca(g){return g===100||g===68||g===115||g===83||g===119||g===87}Et.regexp_eatUnicodePropertyValueExpression=function(g){var P=g.pos;if(this.regexp_eatUnicodePropertyName(g)&&g.eat(61)){var re=g.lastStringValue;if(this.regexp_eatUnicodePropertyValue(g)){var _e=g.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(g,re,_e),an}}if(g.pos=P,this.regexp_eatLoneUnicodePropertyNameOrValue(g)){var Le=g.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(g,Le)}return Nn},Et.regexp_validateUnicodePropertyNameAndValue=function(g,P,re){le(g.unicodeProperties.nonBinary,P)||g.raise("Invalid property name"),g.unicodeProperties.nonBinary[P].test(re)||g.raise("Invalid property value")},Et.regexp_validateUnicodePropertyNameOrValue=function(g,P){if(g.unicodeProperties.binary.test(P))return an;if(g.switchV&&g.unicodeProperties.binaryOfStrings.test(P))return jr;g.raise("Invalid property name")},Et.regexp_eatUnicodePropertyName=function(g){var P=0;for(g.lastStringValue="";Os(P=g.current());)g.lastStringValue+=Y(P),g.advance();return g.lastStringValue!==""};function Os(g){return Pn(g)||g===95}Et.regexp_eatUnicodePropertyValue=function(g){var P=0;for(g.lastStringValue="";ha(P=g.current());)g.lastStringValue+=Y(P),g.advance();return g.lastStringValue!==""};function ha(g){return Os(g)||bi(g)}Et.regexp_eatLoneUnicodePropertyNameOrValue=function(g){return this.regexp_eatUnicodePropertyValue(g)},Et.regexp_eatCharacterClass=function(g){if(g.eat(91)){var P=g.eat(94),re=this.regexp_classContents(g);return g.eat(93)||g.raise("Unterminated character class"),P&&re===jr&&g.raise("Negated character class may contain strings"),!0}return!1},Et.regexp_classContents=function(g){return g.current()===93?an:g.switchV?this.regexp_classSetExpression(g):(this.regexp_nonEmptyClassRanges(g),an)},Et.regexp_nonEmptyClassRanges=function(g){for(;this.regexp_eatClassAtom(g);){var P=g.lastIntValue;if(g.eat(45)&&this.regexp_eatClassAtom(g)){var re=g.lastIntValue;g.switchU&&(P===-1||re===-1)&&g.raise("Invalid character class"),P!==-1&&re!==-1&&P>re&&g.raise("Range out of order in character class")}}},Et.regexp_eatClassAtom=function(g){var P=g.pos;if(g.eat(92)){if(this.regexp_eatClassEscape(g))return!0;if(g.switchU){var re=g.current();(re===99||as(re))&&g.raise("Invalid class escape"),g.raise("Invalid escape")}g.pos=P}var _e=g.current();return _e!==93?(g.lastIntValue=_e,g.advance(),!0):!1},Et.regexp_eatClassEscape=function(g){var P=g.pos;if(g.eat(98))return g.lastIntValue=8,!0;if(g.switchU&&g.eat(45))return g.lastIntValue=45,!0;if(!g.switchU&&g.eat(99)){if(this.regexp_eatClassControlLetter(g))return!0;g.pos=P}return this.regexp_eatCharacterClassEscape(g)||this.regexp_eatCharacterEscape(g)},Et.regexp_classSetExpression=function(g){var P=an,re;if(!this.regexp_eatClassSetRange(g))if(re=this.regexp_eatClassSetOperand(g)){re===jr&&(P=jr);for(var _e=g.pos;g.eatChars([38,38]);){if(g.current()!==38&&(re=this.regexp_eatClassSetOperand(g))){re!==jr&&(P=an);continue}g.raise("Invalid character in character class")}if(_e!==g.pos)return P;for(;g.eatChars([45,45]);)this.regexp_eatClassSetOperand(g)||g.raise("Invalid character in character class");if(_e!==g.pos)return P}else g.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(g)){if(re=this.regexp_eatClassSetOperand(g),!re)return P;re===jr&&(P=jr)}},Et.regexp_eatClassSetRange=function(g){var P=g.pos;if(this.regexp_eatClassSetCharacter(g)){var re=g.lastIntValue;if(g.eat(45)&&this.regexp_eatClassSetCharacter(g)){var _e=g.lastIntValue;return re!==-1&&_e!==-1&&re>_e&&g.raise("Range out of order in character class"),!0}g.pos=P}return!1},Et.regexp_eatClassSetOperand=function(g){return this.regexp_eatClassSetCharacter(g)?an:this.regexp_eatClassStringDisjunction(g)||this.regexp_eatNestedClass(g)},Et.regexp_eatNestedClass=function(g){var P=g.pos;if(g.eat(91)){var re=g.eat(94),_e=this.regexp_classContents(g);if(g.eat(93))return re&&_e===jr&&g.raise("Negated character class may contain strings"),_e;g.pos=P}if(g.eat(92)){var Le=this.regexp_eatCharacterClassEscape(g);if(Le)return Le;g.pos=P}return null},Et.regexp_eatClassStringDisjunction=function(g){var P=g.pos;if(g.eatChars([92,113])){if(g.eat(123)){var re=this.regexp_classStringDisjunctionContents(g);if(g.eat(125))return re}else g.raise("Invalid escape");g.pos=P}return null},Et.regexp_classStringDisjunctionContents=function(g){for(var P=this.regexp_classString(g);g.eat(124);)this.regexp_classString(g)===jr&&(P=jr);return P},Et.regexp_classString=function(g){for(var P=0;this.regexp_eatClassSetCharacter(g);)P++;return P===1?an:jr},Et.regexp_eatClassSetCharacter=function(g){var P=g.pos;if(g.eat(92))return this.regexp_eatCharacterEscape(g)||this.regexp_eatClassSetReservedPunctuator(g)?!0:g.eat(98)?(g.lastIntValue=8,!0):(g.pos=P,!1);var re=g.current();return re<0||re===g.lookahead()&&ws(re)||Fo(re)?!1:(g.advance(),g.lastIntValue=re,!0)};function ws(g){return g===33||g>=35&&g<=38||g>=42&&g<=44||g===46||g>=58&&g<=64||g===94||g===96||g===126}function Fo(g){return g===40||g===41||g===45||g===47||g>=91&&g<=93||g>=123&&g<=125}Et.regexp_eatClassSetReservedPunctuator=function(g){var P=g.current();return fa(P)?(g.lastIntValue=P,g.advance(),!0):!1};function fa(g){return g===33||g===35||g===37||g===38||g===44||g===45||g>=58&&g<=62||g===64||g===96||g===126}Et.regexp_eatClassControlLetter=function(g){var P=g.current();return bi(P)||P===95?(g.lastIntValue=P%32,g.advance(),!0):!1},Et.regexp_eatHexEscapeSequence=function(g){var P=g.pos;if(g.eat(120)){if(this.regexp_eatFixedHexDigits(g,2))return!0;g.switchU&&g.raise("Invalid escape"),g.pos=P}return!1},Et.regexp_eatDecimalDigits=function(g){var P=g.pos,re=0;for(g.lastIntValue=0;bi(re=g.current());)g.lastIntValue=10*g.lastIntValue+(re-48),g.advance();return g.pos!==P};function bi(g){return g>=48&&g<=57}Et.regexp_eatHexDigits=function(g){var P=g.pos,re=0;for(g.lastIntValue=0;Zi(re=g.current());)g.lastIntValue=16*g.lastIntValue+Dn(re),g.advance();return g.pos!==P};function Zi(g){return g>=48&&g<=57||g>=65&&g<=70||g>=97&&g<=102}function Dn(g){return g>=65&&g<=70?10+(g-65):g>=97&&g<=102?10+(g-97):g-48}Et.regexp_eatLegacyOctalEscapeSequence=function(g){if(this.regexp_eatOctalDigit(g)){var P=g.lastIntValue;if(this.regexp_eatOctalDigit(g)){var re=g.lastIntValue;P<=3&&this.regexp_eatOctalDigit(g)?g.lastIntValue=P*64+re*8+g.lastIntValue:g.lastIntValue=P*8+re}else g.lastIntValue=P;return!0}return!1},Et.regexp_eatOctalDigit=function(g){var P=g.current();return as(P)?(g.lastIntValue=P-48,g.advance(),!0):(g.lastIntValue=0,!1)};function as(g){return g>=48&&g<=55}Et.regexp_eatFixedHexDigits=function(g,P){var re=g.pos;g.lastIntValue=0;for(var _e=0;_e<P;++_e){var Le=g.current();if(!Zi(Le))return g.pos=re,!1;g.lastIntValue=16*g.lastIntValue+Dn(Le),g.advance()}return!0};var yi=function(P){this.type=P.type,this.value=P.value,this.start=P.start,this.end=P.end,P.options.locations&&(this.loc=new De(P,P.startLoc,P.endLoc)),P.options.ranges&&(this.range=[P.start,P.end])},mr=o.prototype;mr.next=function(g){!g&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new yi(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},mr.getToken=function(){return this.next(),new yi(this)},typeof Symbol<"u"&&(mr[Symbol.iterator]=function(){var g=this;return{next:function(){var P=g.getToken();return{done:P.type===R.eof,value:P}}}}),mr.nextToken=function(){var g=this.curContext();if((!g||!g.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(R.eof);if(g.override)return g.override(this);this.readToken(this.fullCharCodeAtPos())},mr.readToken=function(g){return C(g,this.options.ecmaVersion>=6)||g===92?this.readWord():this.getTokenFromCode(g)},mr.fullCharCodeAtPos=function(){var g=this.input.charCodeAt(this.pos);if(g<=55295||g>=56320)return g;var P=this.input.charCodeAt(this.pos+1);return P<=56319||P>=57344?g:(g<<10)+P-56613888},mr.skipBlockComment=function(){var g=this.options.onComment&&this.curPosition(),P=this.pos,re=this.input.indexOf("*/",this.pos+=2);if(re===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=re+2,this.options.locations)for(var _e=void 0,Le=P;(_e=ve(this.input,Le,this.pos))>-1;)++this.curLine,Le=this.lineStart=_e;this.options.onComment&&this.options.onComment(!0,this.input.slice(P+2,re),P,this.pos,g,this.curPosition())},mr.skipLineComment=function(g){for(var P=this.pos,re=this.options.onComment&&this.curPosition(),_e=this.input.charCodeAt(this.pos+=g);this.pos<this.input.length&&!se(_e);)_e=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(P+g,this.pos),P,this.pos,re,this.curPosition())},mr.skipSpace=function(){e:for(;this.pos<this.input.length;){var g=this.input.charCodeAt(this.pos);switch(g){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(g>8&&g<14||g>=5760&&he.test(String.fromCharCode(g)))++this.pos;else break e}}},mr.finishToken=function(g,P){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var re=this.type;this.type=g,this.value=P,this.updateContext(re)},mr.readToken_dot=function(){var g=this.input.charCodeAt(this.pos+1);if(g>=48&&g<=57)return this.readNumber(!0);var P=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&g===46&&P===46?(this.pos+=3,this.finishToken(R.ellipsis)):(++this.pos,this.finishToken(R.dot))},mr.readToken_slash=function(){var g=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):g===61?this.finishOp(R.assign,2):this.finishOp(R.slash,1)},mr.readToken_mult_modulo_exp=function(g){var P=this.input.charCodeAt(this.pos+1),re=1,_e=g===42?R.star:R.modulo;return this.options.ecmaVersion>=7&&g===42&&P===42&&(++re,_e=R.starstar,P=this.input.charCodeAt(this.pos+2)),P===61?this.finishOp(R.assign,re+1):this.finishOp(_e,re)},mr.readToken_pipe_amp=function(g){var P=this.input.charCodeAt(this.pos+1);if(P===g){if(this.options.ecmaVersion>=12){var re=this.input.charCodeAt(this.pos+2);if(re===61)return this.finishOp(R.assign,3)}return this.finishOp(g===124?R.logicalOR:R.logicalAND,2)}return P===61?this.finishOp(R.assign,2):this.finishOp(g===124?R.bitwiseOR:R.bitwiseAND,1)},mr.readToken_caret=function(){var g=this.input.charCodeAt(this.pos+1);return g===61?this.finishOp(R.assign,2):this.finishOp(R.bitwiseXOR,1)},mr.readToken_plus_min=function(g){var P=this.input.charCodeAt(this.pos+1);return P===g?P===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||ye.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(R.incDec,2):P===61?this.finishOp(R.assign,2):this.finishOp(R.plusMin,1)},mr.readToken_lt_gt=function(g){var P=this.input.charCodeAt(this.pos+1),re=1;return P===g?(re=g===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+re)===61?this.finishOp(R.assign,re+1):this.finishOp(R.bitShift,re)):P===33&&g===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(P===61&&(re=2),this.finishOp(R.relational,re))},mr.readToken_eq_excl=function(g){var P=this.input.charCodeAt(this.pos+1);return P===61?this.finishOp(R.equality,this.input.charCodeAt(this.pos+2)===61?3:2):g===61&&P===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(R.arrow)):this.finishOp(g===61?R.eq:R.prefix,1)},mr.readToken_question=function(){var g=this.options.ecmaVersion;if(g>=11){var P=this.input.charCodeAt(this.pos+1);if(P===46){var re=this.input.charCodeAt(this.pos+2);if(re<48||re>57)return this.finishOp(R.questionDot,2)}if(P===63){if(g>=12){var _e=this.input.charCodeAt(this.pos+2);if(_e===61)return this.finishOp(R.assign,3)}return this.finishOp(R.coalesce,2)}}return this.finishOp(R.question,1)},mr.readToken_numberSign=function(){var g=this.options.ecmaVersion,P=35;if(g>=13&&(++this.pos,P=this.fullCharCodeAtPos(),C(P,!0)||P===92))return this.finishToken(R.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Y(P)+"'")},mr.getTokenFromCode=function(g){switch(g){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(R.parenL);case 41:return++this.pos,this.finishToken(R.parenR);case 59:return++this.pos,this.finishToken(R.semi);case 44:return++this.pos,this.finishToken(R.comma);case 91:return++this.pos,this.finishToken(R.bracketL);case 93:return++this.pos,this.finishToken(R.bracketR);case 123:return++this.pos,this.finishToken(R.braceL);case 125:return++this.pos,this.finishToken(R.braceR);case 58:return++this.pos,this.finishToken(R.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(R.backQuote);case 48:var P=this.input.charCodeAt(this.pos+1);if(P===120||P===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(P===111||P===79)return this.readRadixNumber(8);if(P===98||P===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(g);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(g);case 124:case 38:return this.readToken_pipe_amp(g);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(g);case 60:case 62:return this.readToken_lt_gt(g);case 61:case 33:return this.readToken_eq_excl(g);case 63:return this.readToken_question();case 126:return this.finishOp(R.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Y(g)+"'")},mr.finishOp=function(g,P){var re=this.input.slice(this.pos,this.pos+P);return this.pos+=P,this.finishToken(g,re)},mr.readRegexp=function(){for(var g,P,re=this.pos;;){this.pos>=this.input.length&&this.raise(re,"Unterminated regular expression");var _e=this.input.charAt(this.pos);if(ye.test(_e)&&this.raise(re,"Unterminated regular expression"),g)g=!1;else{if(_e==="[")P=!0;else if(_e==="]"&&P)P=!1;else if(_e==="/"&&!P)break;g=_e==="\\"}++this.pos}var Le=this.input.slice(re,this.pos);++this.pos;var Ze=this.pos,tt=this.readWord1();this.containsEsc&&this.unexpected(Ze);var kt=this.regexpState||(this.regexpState=new Br(this));kt.reset(re,Le,tt),this.validateRegExpFlags(kt),this.validateRegExpPattern(kt);var Nt=null;try{Nt=new RegExp(Le,tt)}catch{}return this.finishToken(R.regexp,{pattern:Le,flags:tt,value:Nt})},mr.readInt=function(g,P,re){for(var _e=this.options.ecmaVersion>=12&&P===void 0,Le=re&&this.input.charCodeAt(this.pos)===48,Ze=this.pos,tt=0,kt=0,Nt=0,_r=P??1/0;Nt<_r;++Nt,++this.pos){var cr=this.input.charCodeAt(this.pos),Ut=void 0;if(_e&&cr===95){Le&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),kt===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),Nt===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),kt=cr;continue}if(cr>=97?Ut=cr-97+10:cr>=65?Ut=cr-65+10:cr>=48&&cr<=57?Ut=cr-48:Ut=1/0,Ut>=g)break;kt=cr,tt=tt*g+Ut}return _e&&kt===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===Ze||P!=null&&this.pos-Ze!==P?null:tt};function gi(g,P){return P?parseInt(g,8):parseFloat(g.replace(/_/g,""))}function Kn(g){return typeof BigInt!="function"?null:BigInt(g.replace(/_/g,""))}mr.readRadixNumber=function(g){var P=this.pos;this.pos+=2;var re=this.readInt(g);return re==null&&this.raise(this.start+2,"Expected number in radix "+g),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(re=Kn(this.input.slice(P,this.pos)),++this.pos):C(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(R.num,re)},mr.readNumber=function(g){var P=this.pos;!g&&this.readInt(10,void 0,!0)===null&&this.raise(P,"Invalid number");var re=this.pos-P>=2&&this.input.charCodeAt(P)===48;re&&this.strict&&this.raise(P,"Invalid number");var _e=this.input.charCodeAt(this.pos);if(!re&&!g&&this.options.ecmaVersion>=11&&_e===110){var Le=Kn(this.input.slice(P,this.pos));return++this.pos,C(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(R.num,Le)}re&&/[89]/.test(this.input.slice(P,this.pos))&&(re=!1),_e===46&&!re&&(++this.pos,this.readInt(10),_e=this.input.charCodeAt(this.pos)),(_e===69||_e===101)&&!re&&(_e=this.input.charCodeAt(++this.pos),(_e===43||_e===45)&&++this.pos,this.readInt(10)===null&&this.raise(P,"Invalid number")),C(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var Ze=gi(this.input.slice(P,this.pos),re);return this.finishToken(R.num,Ze)},mr.readCodePoint=function(){var g=this.input.charCodeAt(this.pos),P;if(g===123){this.options.ecmaVersion<6&&this.unexpected();var re=++this.pos;P=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,P>1114111&&this.invalidStringToken(re,"Code point out of bounds")}else P=this.readHexChar(4);return P},mr.readString=function(g){for(var P="",re=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var _e=this.input.charCodeAt(this.pos);if(_e===g)break;_e===92?(P+=this.input.slice(re,this.pos),P+=this.readEscapedChar(!1),re=this.pos):_e===8232||_e===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(se(_e)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return P+=this.input.slice(re,this.pos++),this.finishToken(R.string,P)};var vi={};mr.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(g){if(g===vi)this.readInvalidTemplateToken();else throw g}this.inTemplateElement=!1},mr.invalidStringToken=function(g,P){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw vi;this.raise(g,P)},mr.readTmplToken=function(){for(var g="",P=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var re=this.input.charCodeAt(this.pos);if(re===96||re===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===R.template||this.type===R.invalidTemplate)?re===36?(this.pos+=2,this.finishToken(R.dollarBraceL)):(++this.pos,this.finishToken(R.backQuote)):(g+=this.input.slice(P,this.pos),this.finishToken(R.template,g));if(re===92)g+=this.input.slice(P,this.pos),g+=this.readEscapedChar(!0),P=this.pos;else if(se(re)){switch(g+=this.input.slice(P,this.pos),++this.pos,re){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:g+=`
|
|
73
|
+
`;break;default:g+=String.fromCharCode(re);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),P=this.pos}else++this.pos}},mr.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(R.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
|
|
74
|
+
`&&++this.pos;case`
|
|
75
|
+
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},mr.readEscapedChar=function(g){var P=this.input.charCodeAt(++this.pos);switch(++this.pos,P){case 110:return`
|
|
76
|
+
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Y(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),g){var re=this.pos-1;this.invalidStringToken(re,"Invalid escape sequence in template string")}default:if(P>=48&&P<=55){var _e=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],Le=parseInt(_e,8);return Le>255&&(_e=_e.slice(0,-1),Le=parseInt(_e,8)),this.pos+=_e.length-1,P=this.input.charCodeAt(this.pos),(_e!=="0"||P===56||P===57)&&(this.strict||g)&&this.invalidStringToken(this.pos-1-_e.length,g?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(Le)}return se(P)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(P)}},mr.readHexChar=function(g){var P=this.pos,re=this.readInt(16,g);return re===null&&this.invalidStringToken(P,"Bad character escape sequence"),re},mr.readWord1=function(){this.containsEsc=!1;for(var g="",P=!0,re=this.pos,_e=this.options.ecmaVersion>=6;this.pos<this.input.length;){var Le=this.fullCharCodeAtPos();if(m(Le,_e))this.pos+=Le<=65535?1:2;else if(Le===92){this.containsEsc=!0,g+=this.input.slice(re,this.pos);var Ze=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var tt=this.readCodePoint();(P?C:m)(tt,_e)||this.invalidStringToken(Ze,"Invalid Unicode escape"),g+=Y(tt),re=this.pos}else break;P=!1}return g+this.input.slice(re,this.pos)},mr.readWord=function(){var g=this.readWord1(),P=R.name;return this.keywords.test(g)&&(P=W[g]),this.finishToken(P,g)};var jn="8.14.0";o.acorn={Parser:o,version:jn,defaultOptions:Re,Position:xe,SourceLocation:De,getLineInfo:$e,Node:Ie,TokenType:T,tokTypes:R,keywordTypes:W,TokContext:ie,tokContexts:fe,isIdentifierChar:m,isIdentifierStart:C,Token:yi,isNewLine:se,lineBreak:ye,lineBreakG:q,nonASCIIwhitespace:he};function Ss(g,P){return o.parse(g,P)}function Na(g,P,re){return o.parseExpressionAt(g,P,re)}function La(g,P){return o.tokenizer(g,P)}a.Node=Ie,a.Parser=o,a.Position=xe,a.SourceLocation=De,a.TokContext=ie,a.Token=yi,a.TokenType=T,a.defaultOptions=Re,a.getLineInfo=$e,a.isIdentifierChar=m,a.isIdentifierStart=C,a.isNewLine=se,a.keywordTypes=W,a.lineBreak=ye,a.lineBreakG=q,a.nonASCIIwhitespace=he,a.parse=Ss,a.parseExpressionAt=Na,a.tokContexts=fe,a.tokTypes=R,a.tokenizer=La,a.version=jn})}(H0,H0.exports)),H0.exports}/*!
|
|
77
|
+
* Paper.js v0.12.18 - The Swiss Army Knife of Vector Graphics Scripting.
|
|
78
|
+
* http://paperjs.org/
|
|
79
|
+
*
|
|
80
|
+
* Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
|
|
81
|
+
* http://juerglehni.com/ & https://puckey.studio/
|
|
82
|
+
*
|
|
83
|
+
* Distributed under the MIT license. See LICENSE file for details.
|
|
84
|
+
*
|
|
85
|
+
* All rights reserved.
|
|
86
|
+
*
|
|
87
|
+
* Date: Wed Jul 17 14:57:24 2024 +0200
|
|
88
|
+
*
|
|
89
|
+
***
|
|
90
|
+
*
|
|
91
|
+
* Straps.js - Class inheritance library with support for bean-style accessors
|
|
92
|
+
*
|
|
93
|
+
* Copyright (c) 2006 - 2020 Jürg Lehni
|
|
94
|
+
* http://juerglehni.com/
|
|
95
|
+
*
|
|
96
|
+
* Distributed under the MIT license.
|
|
97
|
+
*
|
|
98
|
+
***
|
|
99
|
+
*
|
|
100
|
+
* Acorn.js
|
|
101
|
+
* https://marijnhaverbeke.nl/acorn/
|
|
102
|
+
*
|
|
103
|
+
* Acorn is a tiny, fast JavaScript parser written in JavaScript,
|
|
104
|
+
* created by Marijn Haverbeke and released under an MIT license.
|
|
105
|
+
*
|
|
106
|
+
*/var rx=_h.exports,Cw;function nx(){return Cw||(Cw=1,function(t){(function(r,a){r=r||ww;var l=r.window,u=r.document,c=new function(){var o=/^(statics|enumerable|beans|preserve)$/,h=[],b=h.slice,x=Object.create,E=Object.getOwnPropertyDescriptor,I=Object.defineProperty,F=h.forEach||function(ee,j){for(var pe=0,ie=this.length;pe<ie;pe++)ee.call(j,this[pe],pe,this)},D=function(ee,j){for(var pe in this)this.hasOwnProperty(pe)&&ee.call(j,this[pe],pe,this)},z=Object.assign||function(ee){for(var j=1,pe=arguments.length;j<pe;j++){var ie=arguments[j];for(var fe in ie)ie.hasOwnProperty(fe)&&(ee[fe]=ie[fe])}return ee},U=function(ee,j,pe){if(ee){var ie=E(ee,"length");(ie&&typeof ie.value=="number"?F:D).call(ee,j,pe=pe||ee)}return pe};function J(ee,j,pe,ie,fe){var ne={};function ae(ge,Ae){Ae=Ae||(Ae=E(j,ge))&&(Ae.get?Ae:Ae.value),typeof Ae=="string"&&Ae[0]==="#"&&(Ae=ee[Ae.substring(1)]||Ae);var Ie=typeof Ae=="function",Oe=Ae,qe=fe||Ie&&!Ae.base?Ae&&Ae.get?ge in ee:ee[ge]:null,Pe;(!fe||!qe)&&(Ie&&qe&&(Ae.base=qe),Ie&&ie!==!1&&(Pe=ge.match(/^([gs]et|is)(([A-Z])(.*))$/))&&(ne[Pe[3].toLowerCase()+Pe[4]]=Pe[2]),(!Oe||Ie||!Oe.get||typeof Oe.get!="function"||!te.isPlainObject(Oe))&&(Oe={value:Oe,writable:!0}),(E(ee,ge)||{configurable:!0}).configurable&&(Oe.configurable=!0,Oe.enumerable=pe??!Pe),I(ee,ge,Oe))}if(j){for(var Z in j)j.hasOwnProperty(Z)&&!o.test(Z)&&ae(Z);for(var Z in ne){var ue=ne[Z],me=ee["set"+ue],we=ee["get"+ue]||me&&ee["is"+ue];we&&(ie===!0||we.length===0)&&ae(Z,{get:we,set:me})}}return ee}function te(){for(var ee=0,j=arguments.length;ee<j;ee++){var pe=arguments[ee];pe&&z(this,pe)}return this}return J(te,{inject:function(ee){if(ee){var j=ee.statics===!0?ee:ee.statics,pe=ee.beans,ie=ee.preserve;j!==ee&&J(this.prototype,ee,ee.enumerable,pe,ie),J(this,j,null,pe,ie)}for(var fe=1,ne=arguments.length;fe<ne;fe++)this.inject(arguments[fe]);return this},extend:function(){for(var ee=this,j,pe,ie=0,fe,ne=arguments.length;ie<ne&&!(j&&pe);ie++)fe=arguments[ie],j=j||fe.initialize,pe=pe||fe.prototype;return j=j||function(){ee.apply(this,arguments)},pe=j.prototype=pe||x(this.prototype),I(pe,"constructor",{value:j,writable:!0,configurable:!0}),J(j,this),arguments.length&&this.inject.apply(j,arguments),j.base=ee,j}}).inject({enumerable:!1,initialize:te,set:te,inject:function(){for(var ee=0,j=arguments.length;ee<j;ee++){var pe=arguments[ee];pe&&J(this,pe,pe.enumerable,pe.beans,pe.preserve)}return this},extend:function(){var ee=x(this);return ee.inject.apply(ee,arguments)},each:function(ee,j){return U(this,ee,j)},clone:function(){return new this.constructor(this)},statics:{set:z,each:U,create:x,define:I,describe:E,clone:function(ee){return z(new ee.constructor,ee)},isPlainObject:function(ee){var j=ee!=null&&ee.constructor;return j&&(j===Object||j===te||j.name==="Object")},pick:function(ee,j){return ee!==a?ee:j},slice:function(ee,j,pe){return b.call(ee,j,pe)}}})};t.exports=c,c.inject({enumerable:!1,toString:function(){return this._id!=null?(this._class||"Object")+(this._name?" '"+this._name+"'":" @"+this._id):"{ "+c.each(this,function(o,h){if(!/^_/.test(h)){var b=typeof o;this.push(h+": "+(b==="number"?A.instance.number(o):b==="string"?"'"+o+"'":o))}},[]).join(", ")+" }"},getClassName:function(){return this._class||""},importJSON:function(o){return c.importJSON(o,this)},exportJSON:function(o){return c.exportJSON(this,o)},toJSON:function(){return c.serialize(this)},set:function(o,h){return o&&c.filter(this,o,h,this._prioritize),this}},{beans:!1,statics:{exports:{},extend:function o(){var h=o.base.apply(this,arguments),b=h.prototype._class;return b&&!c.exports[b]&&(c.exports[b]=h),h},equals:function(o,h){if(o===h)return!0;if(o&&o.equals)return o.equals(h);if(h&&h.equals)return h.equals(o);if(o&&h&&typeof o=="object"&&typeof h=="object"){if(Array.isArray(o)&&Array.isArray(h)){var b=o.length;if(b!==h.length)return!1;for(;b--;)if(!c.equals(o[b],h[b]))return!1}else{var x=Object.keys(o),b=x.length;if(b!==Object.keys(h).length)return!1;for(;b--;){var E=x[b];if(!(h.hasOwnProperty(E)&&c.equals(o[E],h[E])))return!1}}return!0}return!1},read:function(o,h,b,x){if(this===c){var E=this.peek(o,h);return o.__index++,E}var I=this.prototype,F=I._readIndex,D=h||F&&o.__index||0,z=o.length,U=o[D];if(x=x||z-D,U instanceof this||b&&b.readNull&&U==null&&x<=1)return F&&(o.__index=D+1),U&&b&&b.clone?U.clone():U;if(U=c.create(I),F&&(U.__read=!0),U=U.initialize.apply(U,D>0||D+x<z?c.slice(o,D,D+x):o)||U,F){o.__index=D+U.__read;var J=U.__filtered;J&&(o.__filtered=J,U.__filtered=a),U.__read=a}return U},peek:function(o,h){return o[o.__index=h||o.__index||0]},remain:function(o){return o.length-(o.__index||0)},readList:function(o,h,b,x){for(var E=[],I,F=h||0,D=x?F+x:o.length,z=F;z<D;z++)E.push(Array.isArray(I=o[z])?this.read(I,0,b):this.read(o,z,b,1));return E},readNamed:function(o,h,b,x,E){var I=this.getNamed(o,h),F=I!==a;if(F){var D=o.__filtered;if(!D){var z=this.getSource(o);D=o.__filtered=c.create(z),D.__unfiltered=z}D[h]=a}return this.read(F?[I]:o,b,x,E)},readSupported:function(o,h){var b=this.getSource(o),x=this,E=!1;return b&&Object.keys(b).forEach(function(I){if(I in h){var F=x.readNamed(o,I);F!==a&&(h[I]=F),E=!0}}),E},getSource:function(o){var h=o.__source;if(h===a){var b=o.length===1&&o[0];h=o.__source=b&&c.isPlainObject(b)?b:null}return h},getNamed:function(o,h){var b=this.getSource(o);if(b)return h?b[h]:o.__filtered||b},hasNamed:function(o,h){return!!this.getNamed(o,h)},filter:function(o,h,b,x){var E;function I(J){if(!(b&&J in b)&&!(E&&J in E)){var te=h[J];te!==a&&(o[J]=te)}}if(x){for(var F={},D=0,z,U=x.length;D<U;D++)(z=x[D])in h&&(I(z),F[z]=!0);E=F}return Object.keys(h.__unfiltered||h).forEach(I),o},isPlainValue:function(o,h){return c.isPlainObject(o)||Array.isArray(o)||h&&typeof o=="string"},serialize:function(o,h,b,x){h=h||{};var E=!x,I;if(E&&(h.formatter=new A(h.precision),x={length:0,definitions:{},references:{},add:function(te,ee){var j="#"+te._id,pe=this.references[j];if(!pe){this.length++;var ie=ee.call(te),fe=te._class;fe&&ie[0]!==fe&&ie.unshift(fe),this.definitions[j]=ie,pe=this.references[j]=[j]}return pe}}),o&&o._serialize){I=o._serialize(h,x);var F=o._class;F&&!o._compactSerialize&&(E||!b)&&I[0]!==F&&I.unshift(F)}else if(Array.isArray(o)){I=[];for(var D=0,z=o.length;D<z;D++)I[D]=c.serialize(o[D],h,b,x)}else if(c.isPlainObject(o)){I={};for(var U=Object.keys(o),D=0,z=U.length;D<z;D++){var J=U[D];I[J]=c.serialize(o[J],h,b,x)}}else typeof o=="number"?I=h.formatter.number(o,h.precision):I=o;return E&&x.length>0?[["dictionary",x.definitions],I]:I},deserialize:function(o,h,b,x,E){var I=o,F=!b,D=F&&o&&o.length&&o[0][0]==="dictionary";if(b=b||{},Array.isArray(o)){var z=o[0],U=z==="dictionary";if(o.length==1&&/^#/.test(z))return b.dictionary[z];z=c.exports[z],I=[];for(var J=z?1:0,te=o.length;J<te;J++)I.push(c.deserialize(o[J],h,b,U,D));if(z){var ee=I;h?I=h(z,ee,F||E):I=new z(ee)}}else if(c.isPlainObject(o)){I={},x&&(b.dictionary=I);for(var j in o)I[j]=c.deserialize(o[j],h,b)}return D?I[1]:I},exportJSON:function(o,h){var b=c.serialize(o,h);return h&&h.asString==!1?b:JSON.stringify(b)},importJSON:function(o,h){return c.deserialize(typeof o=="string"?JSON.parse(o):o,function(b,x,E){var I=E&&h&&h.constructor===b,F=I?h:c.create(b.prototype);if(x.length===1&&F instanceof R&&(I||!(F instanceof q))){var D=x[0];c.isPlainObject(D)&&(D.insert=!1,I&&(x=x.concat([R.INSERT])))}return(I?F.set:b).apply(F,x),I&&(h=null),F})},push:function(o,h){var b=h.length;if(b<4096)o.push.apply(o,h);else{var x=o.length;o.length+=b;for(var E=0;E<b;E++)o[x+E]=h[E]}return o},splice:function(o,h,b,x){var E=h&&h.length,I=b===a;b=I?o.length:b,b>o.length&&(b=o.length);for(var F=0;F<E;F++)h[F]._index=b+F;if(I)return c.push(o,h),[];var D=[b,x];h&&c.push(D,h);for(var z=o.splice.apply(o,D),F=0,U=z.length;F<U;F++)z[F]._index=a;for(var F=b+E,U=o.length;F<U;F++)o[F]._index=F;return z},capitalize:function(o){return o.replace(/\b[a-z]/g,function(h){return h.toUpperCase()})},camelize:function(o){return o.replace(/-(.)/g,function(h,b){return b.toUpperCase()})},hyphenate:function(o){return o.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}}});var f={on:function(o,h){if(typeof o!="string")c.each(o,function(I,F){this.on(F,I)},this);else{var b=this._eventTypes,x=b&&b[o],E=this._callbacks=this._callbacks||{};E=E[o]=E[o]||[],E.indexOf(h)===-1&&(E.push(h),x&&x.install&&E.length===1&&x.install.call(this,o))}return this},off:function(o,h){if(typeof o!="string"){c.each(o,function(F,D){this.off(D,F)},this);return}var b=this._eventTypes,x=b&&b[o],E=this._callbacks&&this._callbacks[o],I;return E&&(!h||(I=E.indexOf(h))!==-1&&E.length===1?(x&&x.uninstall&&x.uninstall.call(this,o),delete this._callbacks[o]):I!==-1&&E.splice(I,1)),this},once:function(o,h){return this.on(o,function b(){h.apply(this,arguments),this.off(o,b)})},emit:function(o,h){var b=this._callbacks&&this._callbacks[o];if(!b)return!1;var x=c.slice(arguments,1),E=h&&h.target&&!h.currentTarget;b=b.slice(),E&&(h.currentTarget=this);for(var I=0,F=b.length;I<F;I++)if(b[I].apply(this,x)==!1){h&&h.stop&&h.stop();break}return E&&delete h.currentTarget,!0},responds:function(o){return!!(this._callbacks&&this._callbacks[o])},attach:"#on",detach:"#off",fire:"#emit",_installEvents:function(o){var h=this._eventTypes,b=this._callbacks,x=o?"install":"uninstall";if(h){for(var E in b)if(b[E].length>0){var I=h[E],F=I&&I[x];F&&F.call(this,E)}}},statics:{inject:function o(h){var b=h._events;if(b){var x={};c.each(b,function(E,I){var F=typeof E=="string",D=F?E:I,z=c.capitalize(D),U=D.substring(2).toLowerCase();x[U]=F?{}:E,D="_"+D,h["get"+z]=function(){return this[D]},h["set"+z]=function(J){var te=this[D];te&&this.off(U,te),J&&this.on(U,J),this[D]=J}}),h._eventTypes=x}return o.base.apply(this,arguments)}}},p=c.extend({_class:"PaperScope",initialize:function o(){rt=this,this.settings=new c({applyMatrix:!0,insertItems:!0,handleSize:4,hitTolerance:0}),this.project=null,this.projects=[],this.tools=[],this._id=o._id++,o._scopes[this._id]=this;var h=o.prototype;if(!this.support){var b=Ue.getContext(1,1)||{};h.support={nativeDash:"setLineDash"in b||"mozDash"in b,nativeBlendModes:Je.nativeModes},Ue.release(b)}if(!this.agent){var x=r.navigator.userAgent.toLowerCase(),E=(/(darwin|win|mac|linux|freebsd|sunos)/.exec(x)||[])[0],I=E==="darwin"?"mac":E,F=h.agent=h.browser={platform:I};I&&(F[I]=!0),x.replace(/(opera|chrome|safari|webkit|firefox|msie|trident|atom|node|jsdom)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:v?([.\d]+))?/g,function(D,z,U,J,te){if(!F.chrome){var ee=z==="opera"?J:/^(node|trident)$/.test(z)?te:U;F.version=ee,F.versionNumber=parseFloat(ee),z={trident:"msie",jsdom:"node"}[z]||z,F.name=z,F[z]=!0}}),F.chrome&&delete F.webkit,F.atom&&delete F.chrome}},version:"0.12.18",getView:function(){var o=this.project;return o&&o._view},getPaper:function(){return this},execute:function(o,h){var b=rt.PaperScript.execute(o,this,h);return at.updateFocus(),b},install:function(o){var h=this;c.each(["project","view","tool"],function(x){c.define(o,x,{configurable:!0,get:function(){return h[x]}})});for(var b in this)!/^_/.test(b)&&this[b]&&(o[b]=this[b])},setup:function(o){return rt=this,this.project=new G(o),this},createCanvas:function(o,h){return Ue.getCanvas(o,h)},activate:function(){rt=this},clear:function(){for(var o=this.projects,h=this.tools,b=o.length-1;b>=0;b--)o[b].remove();for(var b=h.length-1;b>=0;b--)h[b].remove()},remove:function(){this.clear(),delete p._scopes[this._id]},statics:new function(){function o(h){return h+="Attribute",function(b,x){return b[h](x)||b[h]("data-paper-"+x)}}return{_scopes:{},_id:0,get:function(h){return this._scopes[h]||null},getAttribute:o("get"),hasAttribute:o("has")}}}),y=c.extend(f,{initialize:function(o){this._scope=rt,this._index=this._scope[this._list].push(this)-1,(o||!this._scope[this._reference])&&this.activate()},activate:function(){if(!this._scope)return!1;var o=this._scope[this._reference];return o&&o!==this&&o.emit("deactivate"),this._scope[this._reference]=this,this.emit("activate",o),!0},isActive:function(){return this._scope[this._reference]===this},remove:function(){return this._index==null?!1:(c.splice(this._scope[this._list],null,this._index,1),this._scope[this._reference]==this&&(this._scope[this._reference]=null),this._scope=null,!0)},getView:function(){return this._scope.getView()}}),S={findItemBoundsCollisions:function(o,h,b){function x(F){for(var D=new Array(F.length),z=0;z<F.length;z++){var U=F[z].getBounds();D[z]=[U.left,U.top,U.right,U.bottom]}return D}var E=x(o),I=!h||h===o?E:x(h);return this.findBoundsCollisions(E,I,b||0)},findCurveBoundsCollisions:function(o,h,b,x){function E(ee){for(var j=Math.min,pe=Math.max,ie=new Array(ee.length),fe=0;fe<ee.length;fe++){var ne=ee[fe];ie[fe]=[j(ne[0],ne[2],ne[4],ne[6]),j(ne[1],ne[3],ne[5],ne[7]),pe(ne[0],ne[2],ne[4],ne[6]),pe(ne[1],ne[3],ne[5],ne[7])]}return ie}var I=E(o),F=!h||h===o?I:E(h);if(x){for(var D=this.findBoundsCollisions(I,F,b||0,!1,!0),z=this.findBoundsCollisions(I,F,b||0,!0,!0),U=[],J=0,te=D.length;J<te;J++)U[J]={hor:D[J],ver:z[J]};return U}return this.findBoundsCollisions(I,F,b||0)},findBoundsCollisions:function(o,h,b,x,E){var I=!h||o===h,F=I?o:o.concat(h),D=o.length,z=F.length;function U(xt,Mt,Bt){for(var ot=0,ht=xt.length;ot<ht;){var Tt=ht+ot>>>1;F[xt[Tt]][Mt]<Bt?ot=Tt+1:ht=Tt}return ot-1}for(var J=x?1:0,te=J+2,ee=x?0:1,j=ee+2,pe=new Array(z),ie=0;ie<z;ie++)pe[ie]=ie;pe.sort(function(xt,Mt){return F[xt][J]-F[Mt][J]});for(var fe=[],ne=new Array(D),ie=0;ie<z;ie++){var ae=pe[ie],Z=F[ae],ue=I?ae:ae-D,me=ae<D,we=I||!me,ge=me?[]:null;if(fe.length){var Ae=U(fe,te,Z[J]-b)+1;if(fe.splice(0,Ae),I&&E){ge=ge.concat(fe);for(var Ie=0;Ie<fe.length;Ie++){var Oe=fe[Ie];ne[Oe].push(ue)}}else for(var qe=Z[j],Pe=Z[ee],Ie=0;Ie<fe.length;Ie++){var Oe=fe[Ie],Fe=F[Oe],Ve=Oe<D,Ke=I||Oe>=D;(E||(me&&Ke||we&&Ve)&&qe>=Fe[ee]-b&&Pe<=Fe[j]+b)&&(me&&Ke&&ge.push(I?Oe:Oe-D),we&&Ve&&ne[Oe].push(ue))}}if(me&&(o===h&&ge.push(ae),ne[ae]=ge),fe.length){var Xe=Z[te],je=U(fe,te,Xe);fe.splice(je+1,0,ae)}else fe.push(ae)}for(var ie=0;ie<ne.length;ie++){var gt=ne[ie];gt&>.sort(function(Mt,Bt){return Mt-Bt})}return ne}},A=c.extend({initialize:function(o){this.precision=c.pick(o,5),this.multiplier=Math.pow(10,this.precision)},number:function(o){return this.precision<16?Math.round(o*this.multiplier)/this.multiplier:o},pair:function(o,h,b){return this.number(o)+(b||",")+this.number(h)},point:function(o,h){return this.number(o.x)+(h||",")+this.number(o.y)},size:function(o,h){return this.number(o.width)+(h||",")+this.number(o.height)},rectangle:function(o,h){return this.point(o,h)+(h||",")+this.size(o,h)}});A.instance=new A;var M=new function(){var o=[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],h=[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]],b=Math.abs,x=Math.sqrt,E=Math.pow,I=Math.log2||function(te){return Math.log(te)*Math.LOG2E},F=1e-12,D=112e-18;function z(te,ee,j){return te<ee?ee:te>j?j:te}function U(te,ee,j){function pe(Ae){var Ie=Ae*134217729,Oe=Ae-Ie,qe=Oe+Ie,Pe=Ae-qe;return[qe,Pe]}var ie=ee*ee-te*j,fe=ee*ee+te*j;if(b(ie)*3<fe){var ne=pe(te),ae=pe(ee),Z=pe(j),ue=ee*ee,me=ae[0]*ae[0]-ue+2*ae[0]*ae[1]+ae[1]*ae[1],we=te*j,ge=ne[0]*Z[0]-we+ne[0]*Z[1]+ne[1]*Z[0]+ne[1]*Z[1];ie=ue-we+(me-ge)}return ie}function J(){var te=Math.max.apply(Math,arguments);return te&&(te<1e-8||te>1e8)?E(2,-Math.round(I(te))):0}return{EPSILON:F,MACHINE_EPSILON:D,CURVETIME_EPSILON:1e-8,GEOMETRIC_EPSILON:1e-7,TRIGONOMETRIC_EPSILON:1e-8,ANGULAR_EPSILON:1e-5,KAPPA:4*(x(2)-1)/3,isZero:function(te){return te>=-1e-12&&te<=F},isMachineZero:function(te){return te>=-112e-18&&te<=D},clamp:z,integrate:function(te,ee,j,pe){for(var ie=o[pe-2],fe=h[pe-2],ne=(j-ee)*.5,ae=ne+ee,Z=0,ue=pe+1>>1,me=pe&1?fe[Z++]*te(ae):0;Z<ue;){var we=ne*ie[Z];me+=fe[Z++]*(te(ae+we)+te(ae-we))}return ne*me},findRoot:function(te,ee,j,pe,ie,fe,ne){for(var ae=0;ae<fe;ae++){var Z=te(j),ue=Z/ee(j),me=j-ue;if(b(ue)<ne){j=me;break}Z>0?(ie=j,j=me<=pe?(pe+ie)*.5:me):(pe=j,j=me>=ie?(pe+ie)*.5:me)}return z(j,pe,ie)},solveQuadratic:function(te,ee,j,pe,ie,fe){var ne,ae=1/0;if(b(te)<F){if(b(ee)<F)return b(j)<F?-1:0;ne=-j/ee}else{ee*=-.5;var Z=U(te,ee,j);if(Z&&b(Z)<D){var ue=J(b(te),b(ee),b(j));ue&&(te*=ue,ee*=ue,j*=ue,Z=U(te,ee,j))}if(Z>=-112e-18){var me=Z<0?0:x(Z),we=ee+(ee<0?-me:me);we===0?(ne=j/te,ae=-ne):(ne=we/te,ae=j/we)}}var ge=0,Ae=ie==null,Ie=ie-F,Oe=fe+F;return isFinite(ne)&&(Ae||ne>Ie&&ne<Oe)&&(pe[ge++]=Ae?ne:z(ne,ie,fe)),ae!==ne&&isFinite(ae)&&(Ae||ae>Ie&&ae<Oe)&&(pe[ge++]=Ae?ae:z(ae,ie,fe)),ge},solveCubic:function(te,ee,j,pe,ie,fe,ne){var ae=J(b(te),b(ee),b(j),b(pe)),Z,ue,me,we,ge;ae&&(te*=ae,ee*=ae,j*=ae,pe*=ae);function Ae(je){Z=je;var gt=te*Z;ue=gt+ee,me=ue*Z+j,we=(gt+ue)*Z+me,ge=me*Z+pe}if(b(te)<F)te=ee,ue=j,me=pe,Z=1/0;else if(b(pe)<F)ue=ee,me=j,Z=0;else{Ae(-(ee/te)/3);var Ie=ge/te,Oe=E(b(Ie),1/3),qe=Ie<0?-1:1,Pe=-we/te,Fe=Pe>0?1.324717957244746*Math.max(Oe,x(Pe)):Oe,Ve=Z-qe*Fe;if(Ve!==Z){do Ae(Ve),Ve=we===0?Z:Z-ge/we/(1+D);while(qe*Ve>qe*Z);b(te)*Z*Z>b(pe/Z)&&(me=-pe/Z,ue=(me-j)/Z)}}var Ke=M.solveQuadratic(te,ue,me,ie,fe,ne),Xe=fe==null;return isFinite(Z)&&(Ke===0||Ke>0&&Z!==ie[0]&&Z!==ie[1])&&(Xe||Z>fe-F&&Z<ne+F)&&(ie[Ke++]=Xe?Z:z(Z,fe,ne)),Ke}}},w={_id:1,_pools:{},get:function(o){if(o){var h=this._pools[o];return h||(h=this._pools[o]={_id:1}),h._id++}else return this._id++}},_=c.extend({_class:"Point",_readIndex:!0,initialize:function(h,b){var x=typeof h,E=this.__read,I=0;if(x==="number"){var F=typeof b=="number";this._set(h,F?b:h),E&&(I=F?2:1)}else if(x==="undefined"||h===null)this._set(0,0),E&&(I=h===null?1:0);else{var D=x==="string"?h.split(/[\s,]+/)||[]:h;I=1,Array.isArray(D)?this._set(+D[0],+(D.length>1?D[1]:D[0])):"x"in D?this._set(D.x||0,D.y||0):"width"in D?this._set(D.width||0,D.height||0):"angle"in D?(this._set(D.length||0,0),this.setAngle(D.angle||0)):(this._set(0,0),I=0)}return E&&(this.__read=I),this},set:"#initialize",_set:function(o,h){return this.x=o,this.y=h,this},equals:function(o){return this===o||o&&(this.x===o.x&&this.y===o.y||Array.isArray(o)&&this.x===o[0]&&this.y===o[1])||!1},clone:function(){return new _(this.x,this.y)},toString:function(){var o=A.instance;return"{ x: "+o.number(this.x)+", y: "+o.number(this.y)+" }"},_serialize:function(o){var h=o.formatter;return[h.number(this.x),h.number(this.y)]},getLength:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},setLength:function(o){if(this.isZero()){var h=this._angle||0;this._set(Math.cos(h)*o,Math.sin(h)*o)}else{var b=o/this.getLength();M.isZero(b)&&this.getAngle(),this._set(this.x*b,this.y*b)}},getAngle:function(){return this.getAngleInRadians.apply(this,arguments)*180/Math.PI},setAngle:function(o){this.setAngleInRadians.call(this,o*Math.PI/180)},getAngleInDegrees:"#getAngle",setAngleInDegrees:"#setAngle",getAngleInRadians:function(){if(arguments.length){var o=_.read(arguments),h=this.getLength()*o.getLength();if(M.isZero(h))return NaN;var b=this.dot(o)/h;return Math.acos(b<-1?-1:b>1?1:b)}else return this.isZero()?this._angle||0:this._angle=Math.atan2(this.y,this.x)},setAngleInRadians:function(o){if(this._angle=o,!this.isZero()){var h=this.getLength();this._set(Math.cos(o)*h,Math.sin(o)*h)}},getQuadrant:function(){return this.x>=0?this.y>=0?1:4:this.y>=0?2:3}},{beans:!1,getDirectedAngle:function(){var o=_.read(arguments);return Math.atan2(this.cross(o),this.dot(o))*180/Math.PI},getDistance:function(){var o=arguments,h=_.read(o),b=h.x-this.x,x=h.y-this.y,E=b*b+x*x,I=c.read(o);return I?E:Math.sqrt(E)},normalize:function(o){o===a&&(o=1);var h=this.getLength(),b=h!==0?o/h:0,x=new _(this.x*b,this.y*b);return b>=0&&(x._angle=this._angle),x},rotate:function(o,h){if(o===0)return this.clone();o=o*Math.PI/180;var b=h?this.subtract(h):this,x=Math.sin(o),E=Math.cos(o);return b=new _(b.x*E-b.y*x,b.x*x+b.y*E),h?b.add(h):b},transform:function(o){return o?o._transformPoint(this):this},add:function(){var o=_.read(arguments);return new _(this.x+o.x,this.y+o.y)},subtract:function(){var o=_.read(arguments);return new _(this.x-o.x,this.y-o.y)},multiply:function(){var o=_.read(arguments);return new _(this.x*o.x,this.y*o.y)},divide:function(){var o=_.read(arguments);return new _(this.x/o.x,this.y/o.y)},modulo:function(){var o=_.read(arguments);return new _(this.x%o.x,this.y%o.y)},negate:function(){return new _(-this.x,-this.y)},isInside:function(){return L.read(arguments).contains(this)},isClose:function(){var o=arguments,h=_.read(o),b=c.read(o);return this.getDistance(h)<=b},isCollinear:function(){var o=_.read(arguments);return _.isCollinear(this.x,this.y,o.x,o.y)},isColinear:"#isCollinear",isOrthogonal:function(){var o=_.read(arguments);return _.isOrthogonal(this.x,this.y,o.x,o.y)},isZero:function(){var o=M.isZero;return o(this.x)&&o(this.y)},isNaN:function(){return isNaN(this.x)||isNaN(this.y)},isInQuadrant:function(o){return this.x*(o>1&&o<4?-1:1)>=0&&this.y*(o>2?-1:1)>=0},dot:function(){var o=_.read(arguments);return this.x*o.x+this.y*o.y},cross:function(){var o=_.read(arguments);return this.x*o.y-this.y*o.x},project:function(){var o=_.read(arguments),h=o.isZero()?0:this.dot(o)/o.dot(o);return new _(o.x*h,o.y*h)},statics:{min:function(){var o=arguments,h=_.read(o),b=_.read(o);return new _(Math.min(h.x,b.x),Math.min(h.y,b.y))},max:function(){var o=arguments,h=_.read(o),b=_.read(o);return new _(Math.max(h.x,b.x),Math.max(h.y,b.y))},random:function(){return new _(Math.random(),Math.random())},isCollinear:function(o,h,b,x){return Math.abs(o*x-h*b)<=Math.sqrt((o*o+h*h)*(b*b+x*x))*1e-8},isOrthogonal:function(o,h,b,x){return Math.abs(o*b+h*x)<=Math.sqrt((o*o+h*h)*(b*b+x*x))*1e-8}}},c.each(["round","ceil","floor","abs"],function(o){var h=Math[o];this[o]=function(){return new _(h(this.x),h(this.y))}},{})),C=_.extend({initialize:function(h,b,x,E){this._x=h,this._y=b,this._owner=x,this._setter=E},_set:function(o,h,b){return this._x=o,this._y=h,b||this._owner[this._setter](this),this},getX:function(){return this._x},setX:function(o){this._x=o,this._owner[this._setter](this)},getY:function(){return this._y},setY:function(o){this._y=o,this._owner[this._setter](this)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(o){this._owner._changeSelection(this._getSelection(),o)},_getSelection:function(){return this._setter==="setPosition"?4:0}}),m=c.extend({_class:"Size",_readIndex:!0,initialize:function(h,b){var x=typeof h,E=this.__read,I=0;if(x==="number"){var F=typeof b=="number";this._set(h,F?b:h),E&&(I=F?2:1)}else if(x==="undefined"||h===null)this._set(0,0),E&&(I=h===null?1:0);else{var D=x==="string"?h.split(/[\s,]+/)||[]:h;I=1,Array.isArray(D)?this._set(+D[0],+(D.length>1?D[1]:D[0])):"width"in D?this._set(D.width||0,D.height||0):"x"in D?this._set(D.x||0,D.y||0):(this._set(0,0),I=0)}return E&&(this.__read=I),this},set:"#initialize",_set:function(o,h){return this.width=o,this.height=h,this},equals:function(o){return o===this||o&&(this.width===o.width&&this.height===o.height||Array.isArray(o)&&this.width===o[0]&&this.height===o[1])||!1},clone:function(){return new m(this.width,this.height)},toString:function(){var o=A.instance;return"{ width: "+o.number(this.width)+", height: "+o.number(this.height)+" }"},_serialize:function(o){var h=o.formatter;return[h.number(this.width),h.number(this.height)]},add:function(){var o=m.read(arguments);return new m(this.width+o.width,this.height+o.height)},subtract:function(){var o=m.read(arguments);return new m(this.width-o.width,this.height-o.height)},multiply:function(){var o=m.read(arguments);return new m(this.width*o.width,this.height*o.height)},divide:function(){var o=m.read(arguments);return new m(this.width/o.width,this.height/o.height)},modulo:function(){var o=m.read(arguments);return new m(this.width%o.width,this.height%o.height)},negate:function(){return new m(-this.width,-this.height)},isZero:function(){var o=M.isZero;return o(this.width)&&o(this.height)},isNaN:function(){return isNaN(this.width)||isNaN(this.height)},statics:{min:function(o,h){return new m(Math.min(o.width,h.width),Math.min(o.height,h.height))},max:function(o,h){return new m(Math.max(o.width,h.width),Math.max(o.height,h.height))},random:function(){return new m(Math.random(),Math.random())}}},c.each(["round","ceil","floor","abs"],function(o){var h=Math[o];this[o]=function(){return new m(h(this.width),h(this.height))}},{})),T=m.extend({initialize:function(h,b,x,E){this._width=h,this._height=b,this._owner=x,this._setter=E},_set:function(o,h,b){return this._width=o,this._height=h,b||this._owner[this._setter](this),this},getWidth:function(){return this._width},setWidth:function(o){this._width=o,this._owner[this._setter](this)},getHeight:function(){return this._height},setHeight:function(o){this._height=o,this._owner[this._setter](this)}}),L=c.extend({_class:"Rectangle",_readIndex:!0,beans:!0,initialize:function(h,b,x,E){var I=arguments,F=typeof h,D;if(F==="number"?(this._set(h,b,x,E),D=4):F==="undefined"||h===null?(this._set(0,0,0,0),D=h===null?1:0):I.length===1&&(Array.isArray(h)?(this._set.apply(this,h),D=1):h.x!==a||h.width!==a?(this._set(h.x||0,h.y||0,h.width||0,h.height||0),D=1):h.from===a&&h.to===a&&(this._set(0,0,0,0),c.readSupported(I,this)&&(D=1))),D===a){var z=_.readNamed(I,"from"),U=c.peek(I),J=z.x,te=z.y,ee,j;if(U&&U.x!==a||c.hasNamed(I,"to")){var pe=_.readNamed(I,"to");ee=pe.x-J,j=pe.y-te,ee<0&&(J=pe.x,ee=-ee),j<0&&(te=pe.y,j=-j)}else{var ie=m.read(I);ee=ie.width,j=ie.height}this._set(J,te,ee,j),D=I.__index}var fe=I.__filtered;return fe&&(this.__filtered=fe),this.__read&&(this.__read=D),this},set:"#initialize",_set:function(o,h,b,x){return this.x=o,this.y=h,this.width=b,this.height=x,this},clone:function(){return new L(this.x,this.y,this.width,this.height)},equals:function(o){var h=c.isPlainValue(o)?L.read(arguments):o;return h===this||h&&this.x===h.x&&this.y===h.y&&this.width===h.width&&this.height===h.height||!1},toString:function(){var o=A.instance;return"{ x: "+o.number(this.x)+", y: "+o.number(this.y)+", width: "+o.number(this.width)+", height: "+o.number(this.height)+" }"},_serialize:function(o){var h=o.formatter;return[h.number(this.x),h.number(this.y),h.number(this.width),h.number(this.height)]},getPoint:function(o){var h=o?_:C;return new h(this.x,this.y,this,"setPoint")},setPoint:function(){var o=_.read(arguments);this.x=o.x,this.y=o.y},getSize:function(o){var h=o?m:T;return new h(this.width,this.height,this,"setSize")},_fw:1,_fh:1,setSize:function(){var o=m.read(arguments),h=this._sx,b=this._sy,x=o.width,E=o.height;h&&(this.x+=(this.width-x)*h),b&&(this.y+=(this.height-E)*b),this.width=x,this.height=E,this._fw=this._fh=1},getLeft:function(){return this.x},setLeft:function(o){if(!this._fw){var h=o-this.x;this.width-=this._sx===.5?h*2:h}this.x=o,this._sx=this._fw=0},getTop:function(){return this.y},setTop:function(o){if(!this._fh){var h=o-this.y;this.height-=this._sy===.5?h*2:h}this.y=o,this._sy=this._fh=0},getRight:function(){return this.x+this.width},setRight:function(o){if(!this._fw){var h=o-this.x;this.width=this._sx===.5?h*2:h}this.x=o-this.width,this._sx=1,this._fw=0},getBottom:function(){return this.y+this.height},setBottom:function(o){if(!this._fh){var h=o-this.y;this.height=this._sy===.5?h*2:h}this.y=o-this.height,this._sy=1,this._fh=0},getCenterX:function(){return this.x+this.width/2},setCenterX:function(o){this._fw||this._sx===.5?this.x=o-this.width/2:(this._sx&&(this.x+=(o-this.x)*2*this._sx),this.width=(o-this.x)*2),this._sx=.5,this._fw=0},getCenterY:function(){return this.y+this.height/2},setCenterY:function(o){this._fh||this._sy===.5?this.y=o-this.height/2:(this._sy&&(this.y+=(o-this.y)*2*this._sy),this.height=(o-this.y)*2),this._sy=.5,this._fh=0},getCenter:function(o){var h=o?_:C;return new h(this.getCenterX(),this.getCenterY(),this,"setCenter")},setCenter:function(){var o=_.read(arguments);return this.setCenterX(o.x),this.setCenterY(o.y),this},getArea:function(){return this.width*this.height},isEmpty:function(){return this.width===0||this.height===0},contains:function(o){return o&&o.width!==a||(Array.isArray(o)?o:arguments).length===4?this._containsRectangle(L.read(arguments)):this._containsPoint(_.read(arguments))},_containsPoint:function(o){var h=o.x,b=o.y;return h>=this.x&&b>=this.y&&h<=this.x+this.width&&b<=this.y+this.height},_containsRectangle:function(o){var h=o.x,b=o.y;return h>=this.x&&b>=this.y&&h+o.width<=this.x+this.width&&b+o.height<=this.y+this.height},intersects:function(){var o=L.read(arguments),h=c.read(arguments)||0;return o.x+o.width>this.x-h&&o.y+o.height>this.y-h&&o.x<this.x+this.width+h&&o.y<this.y+this.height+h},intersect:function(){var o=L.read(arguments),h=Math.max(this.x,o.x),b=Math.max(this.y,o.y),x=Math.min(this.x+this.width,o.x+o.width),E=Math.min(this.y+this.height,o.y+o.height);return new L(h,b,x-h,E-b)},unite:function(){var o=L.read(arguments),h=Math.min(this.x,o.x),b=Math.min(this.y,o.y),x=Math.max(this.x+this.width,o.x+o.width),E=Math.max(this.y+this.height,o.y+o.height);return new L(h,b,x-h,E-b)},include:function(){var o=_.read(arguments),h=Math.min(this.x,o.x),b=Math.min(this.y,o.y),x=Math.max(this.x+this.width,o.x),E=Math.max(this.y+this.height,o.y);return new L(h,b,x-h,E-b)},expand:function(){var o=m.read(arguments),h=o.width,b=o.height;return new L(this.x-h/2,this.y-b/2,this.width+h,this.height+b)},scale:function(o,h){return this.expand(this.width*o-this.width,this.height*(h===a?o:h)-this.height)}},c.each([["Top","Left"],["Top","Right"],["Bottom","Left"],["Bottom","Right"],["Left","Center"],["Top","Center"],["Right","Center"],["Bottom","Center"]],function(o,h){var b=o.join(""),x=/^[RL]/.test(b);h>=4&&(o[1]+=x?"Y":"X");var E=o[x?0:1],I=o[x?1:0],F="get"+E,D="get"+I,z="set"+E,U="set"+I,J="get"+b,te="set"+b;this[J]=function(ee){var j=ee?_:C;return new j(this[F](),this[D](),this,te)},this[te]=function(){var ee=_.read(arguments);this[z](ee.x),this[U](ee.y)}},{beans:!0})),N=L.extend({initialize:function(h,b,x,E,I,F){this._set(h,b,x,E,!0),this._owner=I,this._setter=F},_set:function(o,h,b,x,E){return this._x=o,this._y=h,this._width=b,this._height=x,E||this._owner[this._setter](this),this}},new function(){var o=L.prototype;return c.each(["x","y","width","height"],function(h){var b=c.capitalize(h),x="_"+h;this["get"+b]=function(){return this[x]},this["set"+b]=function(E){this[x]=E,this._dontNotify||this._owner[this._setter](this)}},c.each(["Point","Size","Center","Left","Top","Right","Bottom","CenterX","CenterY","TopLeft","TopRight","BottomLeft","BottomRight","LeftCenter","TopCenter","RightCenter","BottomCenter"],function(h){var b="set"+h;this[b]=function(){this._dontNotify=!0,o[b].apply(this,arguments),this._dontNotify=!1,this._owner[this._setter](this)}},{isSelected:function(){return!!(this._owner._selection&2)},setSelected:function(h){var b=this._owner;b._changeSelection&&b._changeSelection(2,h)}}))}),B=c.extend({_class:"Matrix",initialize:function o(h,b){var x=arguments,E=x.length,I=!0;if(E>=6?this._set.apply(this,x):E===1||E===2?h instanceof o?this._set(h._a,h._b,h._c,h._d,h._tx,h._ty,b):Array.isArray(h)?this._set.apply(this,b?h.concat([b]):h):I=!1:E?I=!1:this.reset(),!I)throw new Error("Unsupported matrix parameters");return this},set:"#initialize",_set:function(o,h,b,x,E,I,F){return this._a=o,this._b=h,this._c=b,this._d=x,this._tx=E,this._ty=I,F||this._changed(),this},_serialize:function(o,h){return c.serialize(this.getValues(),o,!0,h)},_changed:function(){var o=this._owner;o&&(o._applyMatrix?o.transform(null,!0):o._changed(25))},clone:function(){return new B(this._a,this._b,this._c,this._d,this._tx,this._ty)},equals:function(o){return o===this||o&&this._a===o._a&&this._b===o._b&&this._c===o._c&&this._d===o._d&&this._tx===o._tx&&this._ty===o._ty},toString:function(){var o=A.instance;return"[["+[o.number(this._a),o.number(this._c),o.number(this._tx)].join(", ")+"], ["+[o.number(this._b),o.number(this._d),o.number(this._ty)].join(", ")+"]]"},reset:function(o){return this._a=this._d=1,this._b=this._c=this._tx=this._ty=0,o||this._changed(),this},apply:function(o,h){var b=this._owner;return b?(b.transform(null,c.pick(o,!0),h),this.isIdentity()):!1},translate:function(){var o=_.read(arguments),h=o.x,b=o.y;return this._tx+=h*this._a+b*this._c,this._ty+=h*this._b+b*this._d,this._changed(),this},scale:function(){var o=arguments,h=_.read(o),b=_.read(o,0,{readNull:!0});return b&&this.translate(b),this._a*=h.x,this._b*=h.x,this._c*=h.y,this._d*=h.y,b&&this.translate(b.negate()),this._changed(),this},rotate:function(o){o*=Math.PI/180;var h=_.read(arguments,1),b=h.x,x=h.y,E=Math.cos(o),I=Math.sin(o),F=b-b*E+x*I,D=x-b*I-x*E,z=this._a,U=this._b,J=this._c,te=this._d;return this._a=E*z+I*J,this._b=E*U+I*te,this._c=-I*z+E*J,this._d=-I*U+E*te,this._tx+=F*z+D*J,this._ty+=F*U+D*te,this._changed(),this},shear:function(){var o=arguments,h=_.read(o),b=_.read(o,0,{readNull:!0});b&&this.translate(b);var x=this._a,E=this._b;return this._a+=h.y*this._c,this._b+=h.y*this._d,this._c+=h.x*x,this._d+=h.x*E,b&&this.translate(b.negate()),this._changed(),this},skew:function(){var o=arguments,h=_.read(o),b=_.read(o,0,{readNull:!0}),x=Math.PI/180,E=new _(Math.tan(h.x*x),Math.tan(h.y*x));return this.shear(E,b)},append:function(o,h){if(o){var b=this._a,x=this._b,E=this._c,I=this._d,F=o._a,D=o._c,z=o._b,U=o._d,J=o._tx,te=o._ty;this._a=F*b+z*E,this._c=D*b+U*E,this._b=F*x+z*I,this._d=D*x+U*I,this._tx+=J*b+te*E,this._ty+=J*x+te*I,h||this._changed()}return this},prepend:function(o,h){if(o){var b=this._a,x=this._b,E=this._c,I=this._d,F=this._tx,D=this._ty,z=o._a,U=o._c,J=o._b,te=o._d,ee=o._tx,j=o._ty;this._a=z*b+U*x,this._c=z*E+U*I,this._b=J*b+te*x,this._d=J*E+te*I,this._tx=z*F+U*D+ee,this._ty=J*F+te*D+j,h||this._changed()}return this},appended:function(o){return this.clone().append(o)},prepended:function(o){return this.clone().prepend(o)},invert:function(){var o=this._a,h=this._b,b=this._c,x=this._d,E=this._tx,I=this._ty,F=o*x-h*b,D=null;return F&&!isNaN(F)&&isFinite(E)&&isFinite(I)&&(this._a=x/F,this._b=-h/F,this._c=-b/F,this._d=o/F,this._tx=(b*I-x*E)/F,this._ty=(h*E-o*I)/F,D=this),D},inverted:function(){return this.clone().invert()},concatenate:"#append",preConcatenate:"#prepend",chain:"#appended",_shiftless:function(){return new B(this._a,this._b,this._c,this._d,0,0)},_orNullIfIdentity:function(){return this.isIdentity()?null:this},isIdentity:function(){return this._a===1&&this._b===0&&this._c===0&&this._d===1&&this._tx===0&&this._ty===0},isInvertible:function(){var o=this._a*this._d-this._c*this._b;return o&&!isNaN(o)&&isFinite(this._tx)&&isFinite(this._ty)},isSingular:function(){return!this.isInvertible()},transform:function(o,h,b){return arguments.length<3?this._transformPoint(_.read(arguments)):this._transformCoordinates(o,h,b)},_transformPoint:function(o,h,b){var x=o.x,E=o.y;return h||(h=new _),h._set(x*this._a+E*this._c+this._tx,x*this._b+E*this._d+this._ty,b)},_transformCoordinates:function(o,h,b){for(var x=0,E=2*b;x<E;x+=2){var I=o[x],F=o[x+1];h[x]=I*this._a+F*this._c+this._tx,h[x+1]=I*this._b+F*this._d+this._ty}return h},_transformCorners:function(o){var h=o.x,b=o.y,x=h+o.width,E=b+o.height,I=[h,b,x,b,x,E,h,E];return this._transformCoordinates(I,I,4)},_transformBounds:function(o,h,b){for(var x=this._transformCorners(o),E=x.slice(0,2),I=E.slice(),F=2;F<8;F++){var D=x[F],z=F&1;D<E[z]?E[z]=D:D>I[z]&&(I[z]=D)}return h||(h=new L),h._set(E[0],E[1],I[0]-E[0],I[1]-E[1],b)},inverseTransform:function(){return this._inverseTransform(_.read(arguments))},_inverseTransform:function(o,h,b){var x=this._a,E=this._b,I=this._c,F=this._d,D=this._tx,z=this._ty,U=x*F-E*I,J=null;if(U&&!isNaN(U)&&isFinite(D)&&isFinite(z)){var te=o.x-this._tx,ee=o.y-this._ty;h||(h=new _),J=h._set((te*F-ee*I)/U,(ee*x-te*E)/U,b)}return J},decompose:function(){var o=this._a,h=this._b,b=this._c,x=this._d,E=o*x-h*b,I=Math.sqrt,F=Math.atan2,D=180/Math.PI,z,U,J;if(o!==0||h!==0){var te=I(o*o+h*h);z=Math.acos(o/te)*(h>0?1:-1),U=[te,E/te],J=[F(o*b+h*x,te*te),0]}else if(b!==0||x!==0){var ee=I(b*b+x*x);z=Math.asin(b/ee)*(x>0?1:-1),U=[E/ee,ee],J=[0,F(o*b+h*x,ee*ee)]}else z=0,J=U=[0,0];return{translation:this.getTranslation(),rotation:z*D,scaling:new _(U),skewing:new _(J[0]*D,J[1]*D)}},getValues:function(){return[this._a,this._b,this._c,this._d,this._tx,this._ty]},getTranslation:function(){return new _(this._tx,this._ty)},getScaling:function(){return this.decompose().scaling},getRotation:function(){return this.decompose().rotation},applyToContext:function(o){this.isIdentity()||o.transform(this._a,this._b,this._c,this._d,this._tx,this._ty)}},c.each(["a","b","c","d","tx","ty"],function(o){var h=c.capitalize(o),b="_"+o;this["get"+h]=function(){return this[b]},this["set"+h]=function(x){this[b]=x,this._changed()}},{})),W=c.extend({_class:"Line",initialize:function(h,b,x,E,I){var F=!1;arguments.length>=4?(this._px=h,this._py=b,this._vx=x,this._vy=E,F=I):(this._px=h.x,this._py=h.y,this._vx=b.x,this._vy=b.y,F=x),F||(this._vx-=this._px,this._vy-=this._py)},getPoint:function(){return new _(this._px,this._py)},getVector:function(){return new _(this._vx,this._vy)},getLength:function(){return this.getVector().getLength()},intersect:function(o,h){return W.intersect(this._px,this._py,this._vx,this._vy,o._px,o._py,o._vx,o._vy,!0,h)},getSide:function(o,h){return W.getSide(this._px,this._py,this._vx,this._vy,o.x,o.y,!0,h)},getDistance:function(o){return Math.abs(this.getSignedDistance(o))},getSignedDistance:function(o){return W.getSignedDistance(this._px,this._py,this._vx,this._vy,o.x,o.y,!0)},isCollinear:function(o){return _.isCollinear(this._vx,this._vy,o._vx,o._vy)},isOrthogonal:function(o){return _.isOrthogonal(this._vx,this._vy,o._vx,o._vy)},statics:{intersect:function(o,h,b,x,E,I,F,D,z,U){z||(b-=o,x-=h,F-=E,D-=I);var J=b*D-x*F;if(!M.isMachineZero(J)){var te=o-E,ee=h-I,j=(F*ee-D*te)/J,pe=(b*ee-x*te)/J,ie=1e-12,fe=-ie,ne=1+ie;if(U||fe<j&&j<ne&&fe<pe&&pe<ne)return U||(j=j<=0?0:j>=1?1:j),new _(o+j*b,h+j*x)}},getSide:function(o,h,b,x,E,I,F,D){F||(b-=o,x-=h);var z=E-o,U=I-h,J=z*x-U*b;return!D&&M.isMachineZero(J)&&(J=(z*b+z*b)/(b*b+x*x),J>=0&&J<=1&&(J=0)),J<0?-1:J>0?1:0},getSignedDistance:function(o,h,b,x,E,I,F){return F||(b-=o,x-=h),b===0?x>0?E-o:o-E:x===0?b<0?I-h:h-I:((E-o)*x-(I-h)*b)/(x>b?x*Math.sqrt(1+b*b/(x*x)):b*Math.sqrt(1+x*x/(b*b)))},getDistance:function(o,h,b,x,E,I,F){return Math.abs(W.getSignedDistance(o,h,b,x,E,I,F))}}}),G=y.extend({_class:"Project",_list:"projects",_reference:"project",_compactSerialize:!0,initialize:function(h){y.call(this,!0),this._children=[],this._namedChildren={},this._activeLayer=null,this._currentStyle=new it(null,null,this),this._view=at.create(this,h||Ue.getCanvas(1,1)),this._selectionItems={},this._selectionCount=0,this._updateVersion=0},_serialize:function(o,h){return c.serialize(this._children,o,!0,h)},_changed:function(o,h){if(o&1){var b=this._view;b&&(b._needsUpdate=!0,!b._requested&&b._autoUpdate&&b.requestUpdate())}var x=this._changes;if(x&&h){var E=this._changesById,I=h._id,F=E[I];F?F.flags|=o:x.push(E[I]={item:h,flags:o})}},clear:function(){for(var o=this._children,h=o.length-1;h>=0;h--)o[h].remove()},isEmpty:function(){return!this._children.length},remove:function o(){return o.base.call(this)?(this._view&&this._view.remove(),!0):!1},getView:function(){return this._view},getCurrentStyle:function(){return this._currentStyle},setCurrentStyle:function(o){this._currentStyle.set(o)},getIndex:function(){return this._index},getOptions:function(){return this._scope.settings},getLayers:function(){return this._children},getActiveLayer:function(){return this._activeLayer||new q({project:this,insert:!0})},getSymbolDefinitions:function(){var o=[],h={};return this.getItems({class:he,match:function(b){var x=b._definition,E=x._id;return h[E]||(h[E]=!0,o.push(x)),!1}}),o},getSymbols:"getSymbolDefinitions",getSelectedItems:function(){var o=this._selectionItems,h=[];for(var b in o){var x=o[b],E=x._selection;E&1&&x.isInserted()?h.push(x):E||this._updateSelection(x)}return h},_updateSelection:function(o){var h=o._id,b=this._selectionItems;o._selection?b[h]!==o&&(this._selectionCount++,b[h]=o):b[h]===o&&(this._selectionCount--,delete b[h])},selectAll:function(){for(var o=this._children,h=0,b=o.length;h<b;h++)o[h].setFullySelected(!0)},deselectAll:function(){var o=this._selectionItems;for(var h in o)o[h].setFullySelected(!1)},addLayer:function(o){return this.insertLayer(a,o)},insertLayer:function(o,h){if(h instanceof q){h._remove(!1,!0),c.splice(this._children,[h],o,0),h._setProject(this,!0);var b=h._name;b&&h.setName(b),this._changes&&h._changed(5),this._activeLayer||(this._activeLayer=h)}else h=null;return h},_insertItem:function(o,h,b){return h=this.insertLayer(o,h)||(this._activeLayer||this._insertItem(a,new q(R.NO_INSERT),!0)).insertChild(o,h),b&&h.activate&&h.activate(),h},getItems:function(o){return R._getItems(this,o)},getItem:function(o){return R._getItems(this,o,null,null,!0)[0]||null},importJSON:function(o){this.activate();var h=this._activeLayer;return c.importJSON(o,h&&h.isEmpty()&&h)},removeOn:function(o){var h=this._removeSets;if(h){o==="mouseup"&&(h.mousedrag=null);var b=h[o];if(b){for(var x in b){var E=b[x];for(var I in h){var F=h[I];F&&F!=b&&delete F[E._id]}E.remove()}h[o]=null}}},draw:function(o,h,b){this._updateVersion++,o.save(),h.applyToContext(o);for(var x=this._children,E=new c({offset:new _(0,0),pixelRatio:b,viewMatrix:h.isIdentity()?null:h,matrices:[new B],updateMatrix:!0}),I=0,F=x.length;I<F;I++)x[I].draw(o,E);if(o.restore(),this._selectionCount>0){o.save(),o.strokeWidth=1;var D=this._selectionItems,z=this._scope.settings.handleSize,U=this._updateVersion;for(var J in D)D[J]._drawSelection(o,h,z,D,U);o.restore()}}}),R=c.extend(f,{statics:{extend:function o(h){return h._serializeFields&&(h._serializeFields=c.set({},this.prototype._serializeFields,h._serializeFields)),o.base.apply(this,arguments)},INSERT:{insert:!0},NO_INSERT:{insert:!1}},_class:"Item",_name:null,_applyMatrix:!0,_canApplyMatrix:!0,_canScaleStroke:!1,_pivot:null,_visible:!0,_blendMode:"normal",_opacity:1,_locked:!1,_guide:!1,_clipMask:!1,_selection:0,_selectBounds:!0,_selectChildren:!1,_serializeFields:{name:null,applyMatrix:null,matrix:new B,pivot:null,visible:!0,blendMode:"normal",opacity:1,locked:!1,guide:!1,clipMask:!1,selected:!1,data:{}},_prioritize:["applyMatrix"]},new function(){var o=["onMouseDown","onMouseUp","onMouseDrag","onClick","onDoubleClick","onMouseMove","onMouseEnter","onMouseLeave"];return c.each(o,function(h){this._events[h]={install:function(b){this.getView()._countItemEvent(b,1)},uninstall:function(b){this.getView()._countItemEvent(b,-1)}}},{_events:{onFrame:{install:function(){this.getView()._animateItem(this,!0)},uninstall:function(){this.getView()._animateItem(this,!1)}},onLoad:{},onError:{}},statics:{_itemHandlers:o}})},{initialize:function(){},_initialize:function(o,h){var b=o&&c.isPlainObject(o),x=b&&o.internal===!0,E=this._matrix=new B,I=b&&o.project||rt.project,F=rt.settings;return this._id=x?null:w.get(),this._parent=this._index=null,this._applyMatrix=this._canApplyMatrix&&F.applyMatrix,h&&E.translate(h),E._owner=this,this._style=new it(I._currentStyle,this,I),x||b&&o.insert==!1||!F.insertItems&&!(b&&o.insert==!0)?this._setProject(I):(b&&o.parent||I)._insertItem(a,this,!0),b&&o!==R.NO_INSERT&&o!==R.INSERT&&this.set(o,{internal:!0,insert:!0,project:!0,parent:!0}),b},_serialize:function(o,h){var b={},x=this;function E(I){for(var F in I){var D=x[F];c.equals(D,F==="leading"?I.fontSize*1.2:I[F])||(b[F]=c.serialize(D,o,F!=="data",h))}}return E(this._serializeFields),this instanceof ye||E(this._style._defaults),[this._class,b]},_changed:function(o){var h=this._symbol,b=this._parent||h,x=this._project;o&8&&(this._bounds=this._position=this._decomposed=a),o&16&&(this._globalMatrix=a),b&&o&72&&R._clearBoundsCache(b),o&2&&R._clearBoundsCache(this),x&&x._changed(o,this),h&&h._changed(o)},getId:function(){return this._id},getName:function(){return this._name},setName:function(o){if(this._name&&this._removeNamed(),o===+o+"")throw new Error("Names consisting only of numbers are not supported.");var h=this._getOwner();if(o&&h){var b=h._children,x=h._namedChildren;(x[o]=x[o]||[]).push(this),o in b||(b[o]=this)}this._name=o||a,this._changed(256)},getStyle:function(){return this._style},setStyle:function(o){this.getStyle().set(o)}},c.each(["locked","visible","blendMode","opacity","guide"],function(o){var h=c.capitalize(o),b="_"+o,x={locked:256,visible:265};this["get"+h]=function(){return this[b]},this["set"+h]=function(E){E!=this[b]&&(this[b]=E,this._changed(x[o]||257))}},{}),{beans:!0,getSelection:function(){return this._selection},setSelection:function(o){if(o!==this._selection){this._selection=o;var h=this._project;h&&(h._updateSelection(this),this._changed(257))}},_changeSelection:function(o,h){var b=this._selection;this.setSelection(h?b|o:b&~o)},isSelected:function(){if(this._selectChildren){for(var o=this._children,h=0,b=o.length;h<b;h++)if(o[h].isSelected())return!0}return!!(this._selection&1)},setSelected:function(o){if(this._selectChildren)for(var h=this._children,b=0,x=h.length;b<x;b++)h[b].setSelected(o);this._changeSelection(1,o)},isFullySelected:function(){var o=this._children,h=!!(this._selection&1);if(o&&h){for(var b=0,x=o.length;b<x;b++)if(!o[b].isFullySelected())return!1;return!0}return h},setFullySelected:function(o){var h=this._children;if(h)for(var b=0,x=h.length;b<x;b++)h[b].setFullySelected(o);this._changeSelection(1,o)},isClipMask:function(){return this._clipMask},setClipMask:function(o){this._clipMask!=(o=!!o)&&(this._clipMask=o,o&&(this.setFillColor(null),this.setStrokeColor(null)),this._changed(257),this._parent&&this._parent._changed(2048))},getData:function(){return this._data||(this._data={}),this._data},setData:function(o){this._data=o},getPosition:function(o){var h=o?_:C,b=this._position||(this._position=this._getPositionFromBounds());return new h(b.x,b.y,this,"setPosition")},setPosition:function(){this.translate(_.read(arguments).subtract(this.getPosition(!0)))},_getPositionFromBounds:function(o){return this._pivot?this._matrix._transformPoint(this._pivot):(o||this.getBounds()).getCenter(!0)},getPivot:function(){var o=this._pivot;return o?new C(o.x,o.y,this,"setPivot"):null},setPivot:function(){this._pivot=_.read(arguments,0,{clone:!0,readNull:!0}),this._position=a}},c.each({getStrokeBounds:{stroke:!0},getHandleBounds:{handle:!0},getInternalBounds:{internal:!0}},function(o,h){this[h]=function(b){return this.getBounds(b,o)}},{beans:!0,getBounds:function(o,h){var b=h||o instanceof B,x=c.set({},b?h:o,this._boundsOptions);(!x.stroke||this.getStrokeScaling())&&(x.cacheItem=this);var E=this._getCachedBounds(b&&o,x).rect;return arguments.length?E:new N(E.x,E.y,E.width,E.height,this,"setBounds")},setBounds:function(){var o=L.read(arguments),h=this.getBounds(),b=this._matrix,x=new B,E=o.getCenter();x.translate(E),(o.width!=h.width||o.height!=h.height)&&(b.isInvertible()||(b.set(b._backup||new B().translate(b.getTranslation())),h=this.getBounds()),x.scale(h.width!==0?o.width/h.width:0,h.height!==0?o.height/h.height:0)),E=h.getCenter(),x.translate(-E.x,-E.y),this.transform(x)},_getBounds:function(o,h){var b=this._children;return!b||!b.length?new L:(R._updateBoundsCache(this,h.cacheItem),R._getBounds(b,o,h))},_getBoundsCacheKey:function(o,h){return[o.stroke?1:0,o.handle?1:0,h?1:0].join("")},_getCachedBounds:function(o,h,b){o=o&&o._orNullIfIdentity();var x=h.internal&&!b,E=h.cacheItem,I=x?null:this._matrix._orNullIfIdentity(),F=E&&(!o||o.equals(I))&&this._getBoundsCacheKey(h,x),D=this._bounds;if(R._updateBoundsCache(this._parent||this._symbol,E),F&&D&&F in D){var z=D[F];return{rect:z.rect.clone(),nonscaling:z.nonscaling}}var U=this._getBounds(o||I,h),J=U.rect||U,te=this._style,ee=U.nonscaling||te.hasStroke()&&!te.getStrokeScaling();if(F){D||(this._bounds=D={});var z=D[F]={rect:J.clone(),nonscaling:ee,internal:x}}return{rect:J,nonscaling:ee}},_getStrokeMatrix:function(o,h){var b=this.getStrokeScaling()?null:h&&h.internal?this:this._parent||this._symbol&&this._symbol._item,x=b?b.getViewMatrix().invert():o;return x&&x._shiftless()},statics:{_updateBoundsCache:function(o,h){if(o&&h){var b=h._id,x=o._boundsCache=o._boundsCache||{ids:{},list:[]};x.ids[b]||(x.list.push(h),x.ids[b]=h)}},_clearBoundsCache:function(o){var h=o._boundsCache;if(h){o._bounds=o._position=o._boundsCache=a;for(var b=0,x=h.list,E=x.length;b<E;b++){var I=x[b];I!==o&&(I._bounds=I._position=a,I._boundsCache&&R._clearBoundsCache(I))}}},_getBounds:function(o,h,b){var x=1/0,E=-x,I=x,F=E,D=!1;b=b||{};for(var z=0,U=o.length;z<U;z++){var J=o[z];if(J._visible&&!J.isEmpty(!0)){var te=J._getCachedBounds(h&&h.appended(J._matrix),b,!0),ee=te.rect;x=Math.min(ee.x,x),I=Math.min(ee.y,I),E=Math.max(ee.x+ee.width,E),F=Math.max(ee.y+ee.height,F),te.nonscaling&&(D=!0)}}return{rect:isFinite(x)?new L(x,I,E-x,F-I):new L,nonscaling:D}}}}),{beans:!0,_decompose:function(){return this._applyMatrix?null:this._decomposed||(this._decomposed=this._matrix.decompose())},getRotation:function(){var o=this._decompose();return o?o.rotation:0},setRotation:function(o){var h=this.getRotation();if(h!=null&&o!=null){var b=this._decomposed;this.rotate(o-h),b&&(b.rotation=o,this._decomposed=b)}},getScaling:function(){var o=this._decompose(),h=o&&o.scaling;return new C(h?h.x:1,h?h.y:1,this,"setScaling")},setScaling:function(){var o=this.getScaling(),h=_.read(arguments,0,{clone:!0,readNull:!0});if(o&&h&&!o.equals(h)){var b=this.getRotation(),x=this._decomposed,E=new B,I=M.isZero;if(I(o.x)||I(o.y))E.translate(x.translation),b&&E.rotate(b),E.scale(h.x,h.y),this._matrix.set(E);else{var F=this.getPosition(!0);E.translate(F),b&&E.rotate(b),E.scale(h.x/o.x,h.y/o.y),b&&E.rotate(-b),E.translate(F.negate()),this.transform(E)}x&&(x.scaling=h,this._decomposed=x)}},getMatrix:function(){return this._matrix},setMatrix:function(){var o=this._matrix;o.set.apply(o,arguments)},getGlobalMatrix:function(o){var h=this._globalMatrix;if(h)for(var b=this._parent,x=[];b;){if(!b._globalMatrix){h=null;for(var E=0,I=x.length;E<I;E++)x[E]._globalMatrix=null;break}x.push(b),b=b._parent}if(!h){h=this._globalMatrix=this._matrix.clone();var b=this._parent;b&&h.prepend(b.getGlobalMatrix(!0))}return o?h:h.clone()},getViewMatrix:function(){return this.getGlobalMatrix().prepend(this.getView()._matrix)},getApplyMatrix:function(){return this._applyMatrix},setApplyMatrix:function(o){(this._applyMatrix=this._canApplyMatrix&&!!o)&&this.transform(null,!0)},getTransformContent:"#getApplyMatrix",setTransformContent:"#setApplyMatrix"},{getProject:function(){return this._project},_setProject:function(o,h){if(this._project!==o){this._project&&this._installEvents(!1),this._project=o;for(var b=this._children,x=0,E=b&&b.length;x<E;x++)b[x]._setProject(o);h=!0}h&&this._installEvents(!0)},getView:function(){return this._project._view},_installEvents:function o(h){o.base.call(this,h);for(var b=this._children,x=0,E=b&&b.length;x<E;x++)b[x]._installEvents(h)},getLayer:function(){for(var o=this;o=o._parent;)if(o instanceof q)return o;return null},getParent:function(){return this._parent},setParent:function(o){return o.addChild(this)},_getOwner:"#getParent",getChildren:function(){return this._children},setChildren:function(o){this.removeChildren(),this.addChildren(o)},getFirstChild:function(){return this._children&&this._children[0]||null},getLastChild:function(){return this._children&&this._children[this._children.length-1]||null},getNextSibling:function(){var o=this._getOwner();return o&&o._children[this._index+1]||null},getPreviousSibling:function(){var o=this._getOwner();return o&&o._children[this._index-1]||null},getIndex:function(){return this._index},setIndex:function(o){var h=this._parent,b=h&&h._children;b&&h.insertChildren(o in b?o:a,[this])},equals:function(o){return o===this||o&&this._class===o._class&&this._style.equals(o._style)&&this._matrix.equals(o._matrix)&&this._locked===o._locked&&this._visible===o._visible&&this._blendMode===o._blendMode&&this._opacity===o._opacity&&this._clipMask===o._clipMask&&this._guide===o._guide&&this._equals(o)||!1},_equals:function(o){return c.equals(this._children,o._children)},clone:function(o){var h=new this.constructor(R.NO_INSERT),b=this._children,x=c.pick(o?o.insert:a,o===a||o===!0),E=c.pick(o?o.deep:a,!0);b&&h.copyAttributes(this),(!b||E)&&h.copyContent(this),b||h.copyAttributes(this),x&&h.insertAbove(this);var I=this._name,F=this._parent;if(I&&F){for(var b=F._children,D=I,z=1;b[I];)I=D+" "+z++;I!==D&&h.setName(I)}return h},copyContent:function(o){for(var h=o._children,b=0,x=h&&h.length;b<x;b++)this.addChild(h[b].clone(!1),!0)},copyAttributes:function(o,h){this.setStyle(o._style);for(var b=["_locked","_visible","_blendMode","_opacity","_clipMask","_guide"],x=0,E=b.length;x<E;x++){var I=b[x];o.hasOwnProperty(I)&&(this[I]=o[I])}h||this._matrix.set(o._matrix,!0),this.setApplyMatrix(o._applyMatrix),this.setPivot(o._pivot),this.setSelection(o._selection);var F=o._data,D=o._name;this._data=F?c.clone(F):null,D&&this.setName(D)},rasterize:function(o,h){var b,x,E;c.isPlainObject(o)?(b=o.resolution,x=o.insert,E=o.raster):(b=o,x=h),E||(E=new ve(R.NO_INSERT));var I=this.getStrokeBounds(),F=(b||this.getView().getResolution())/72,D=I.getTopLeft().floor(),z=I.getBottomRight().ceil(),U=new m(z.subtract(D)),J=U.multiply(F);if(E.setSize(J,!0),!J.isZero()){var te=E.getContext(!0),ee=new B().scale(F).translate(D.negate());te.save(),ee.applyToContext(te),this.draw(te,new c({matrices:[ee]})),te.restore()}return E._matrix.set(new B().translate(D.add(U.divide(2))).scale(1/F)),(x===a||x)&&E.insertAbove(this),E},contains:function(){var o=this._matrix;return o.isInvertible()&&!!this._contains(o._inverseTransform(_.read(arguments)))},_contains:function(o){var h=this._children;if(h){for(var b=h.length-1;b>=0;b--)if(h[b].contains(o))return!0;return!1}return o.isInside(this.getInternalBounds())},isInside:function(){return L.read(arguments).contains(this.getBounds())},_asPathItem:function(){return new H.Rectangle({rectangle:this.getInternalBounds(),matrix:this._matrix,insert:!1})},intersects:function(o,h){return o instanceof R?this._asPathItem().getIntersections(o._asPathItem(),null,h,!0).length>0:!1}},new function(){function o(){var x=arguments;return this._hitTest(_.read(x),de.getOptions(x))}function h(){var x=arguments,E=_.read(x),I=de.getOptions(x),F=[];return this._hitTest(E,new c({all:F},I)),F}function b(x,E,I,F){var D=this._children;if(D)for(var z=D.length-1;z>=0;z--){var U=D[z],J=U!==F&&U._hitTest(x,E,I);if(J&&!E.all)return J}return null}return G.inject({hitTest:o,hitTestAll:h,_hitTest:b}),{hitTest:o,hitTestAll:h,_hitTestChildren:b}},{_hitTest:function(o,h,b){if(this._locked||!this._visible||this._guide&&!h.guides||this.isEmpty())return null;var x=this._matrix,E=b?b.appended(x):this.getGlobalMatrix().prepend(this.getView()._matrix),I=Math.max(h.tolerance,1e-12),F=h._tolerancePadding=new m(H._getStrokePadding(I,x._shiftless().invert()));if(o=x._inverseTransform(o),!o||!this._children&&!this.getBounds({internal:!0,stroke:!0,handle:!0}).expand(F.multiply(2))._containsPoint(o))return null;var D=!(h.guides&&!this._guide||h.selected&&!this.isSelected()||h.type&&h.type!==c.hyphenate(this._class)||h.class&&!(this instanceof h.class)),z=h.match,U=this,J,te;function ee(Z){return Z&&z&&!z(Z)&&(Z=null),Z&&h.all&&h.all.push(Z),Z}function j(Z,ue){var me=ue?J["get"+ue]():U.getPosition();if(o.subtract(me).divide(F).length<=1)return new de(Z,U,{name:ue?c.hyphenate(ue):Z,point:me})}var pe=h.position,ie=h.center,fe=h.bounds;if(D&&this._parent&&(pe||ie||fe)){if((ie||fe)&&(J=this.getInternalBounds()),te=pe&&j("position")||ie&&j("center","Center"),!te&&fe)for(var ne=["TopLeft","TopRight","BottomLeft","BottomRight","LeftCenter","TopCenter","RightCenter","BottomCenter"],ae=0;ae<8&&!te;ae++)te=j("bounds",ne[ae]);te=ee(te)}return te||(te=this._hitTestChildren(o,h,E)||D&&ee(this._hitTestSelf(o,h,E,this.getStrokeScaling()?null:E._shiftless().invert()))||null),te&&te.point&&(te.point=x.transform(te.point)),te},_hitTestSelf:function(o,h){if(h.fill&&this.hasFill()&&this._contains(o))return new de("fill",this)},matches:function(o,h){function b(F,D){for(var z in F)if(F.hasOwnProperty(z)){var U=F[z],J=D[z];if(c.isPlainObject(U)&&c.isPlainObject(J)){if(!b(U,J))return!1}else if(!c.equals(U,J))return!1}return!0}var x=typeof o;if(x==="object"){for(var E in o)if(o.hasOwnProperty(E)&&!this.matches(E,o[E]))return!1;return!0}else{if(x==="function")return o(this);if(o==="match")return h(this);var I=/^(empty|editable)$/.test(o)?this["is"+c.capitalize(o)]():o==="type"?c.hyphenate(this._class):this[o];if(o==="class"){if(typeof h=="function")return this instanceof h;I=this._class}if(typeof h=="function")return!!h(I);if(h){if(h.test)return h.test(I);if(c.isPlainObject(h))return b(h,I)}return c.equals(I,h)}},getItems:function(o){return R._getItems(this,o,this._matrix)},getItem:function(o){return R._getItems(this,o,this._matrix,null,!0)[0]||null},statics:{_getItems:function o(h,b,x,E,I){if(!E){var F=typeof b=="object"&&b,D=F&&F.overlapping,z=F&&F.inside,U=D||z,ee=U&&L.read([U]);E={items:[],recursive:F&&F.recursive!==!1,inside:!!z,overlapping:!!D,rect:ee,path:D&&new H.Rectangle({rectangle:ee,insert:!1})},F&&(b=c.filter({},b,{recursive:!0,inside:!0,overlapping:!0}))}var J=h._children,te=E.items,ee=E.rect;x=ee&&(x||new B);for(var j=0,pe=J&&J.length;j<pe;j++){var ie=J[j],fe=x&&x.appended(ie._matrix),ne=!0;if(ee){var U=ie.getBounds(fe);if(!ee.intersects(U))continue;ee.contains(U)||E.overlapping&&(U.contains(ee)||E.path.intersects(ie,fe))||(ne=!1)}if(ne&&ie.matches(b)&&(te.push(ie),I)||(E.recursive!==!1&&o(ie,b,fe,E,I),I&&te.length>0))break}return te}}},{importJSON:function(o){var h=c.importJSON(o,this);return h!==this?this.addChild(h):h},addChild:function(o){return this.insertChild(a,o)},insertChild:function(o,h){var b=h?this.insertChildren(o,[h]):null;return b&&b[0]},addChildren:function(o){return this.insertChildren(this._children.length,o)},insertChildren:function(o,h){var b=this._children;if(b&&h&&h.length>0){h=c.slice(h);for(var x={},E=h.length-1;E>=0;E--){var I=h[E],F=I&&I._id;!I||x[F]?h.splice(E,1):(I._remove(!1,!0),x[F]=!0)}c.splice(b,h,o,0);for(var D=this._project,z=D._changes,E=0,U=h.length;E<U;E++){var I=h[E],J=I._name;I._parent=this,I._setProject(D,!0),J&&I.setName(J),z&&I._changed(5)}this._changed(11)}else h=null;return h},_insertItem:"#insertChild",_insertAt:function(o,h){var b=o&&o._getOwner(),x=o!==this&&b?this:null;return x&&(x._remove(!1,!0),b._insertItem(o._index+h,x)),x},insertAbove:function(o){return this._insertAt(o,1)},insertBelow:function(o){return this._insertAt(o,0)},sendToBack:function(){var o=this._getOwner();return o?o._insertItem(0,this):null},bringToFront:function(){var o=this._getOwner();return o?o._insertItem(a,this):null},appendTop:"#addChild",appendBottom:function(o){return this.insertChild(0,o)},moveAbove:"#insertAbove",moveBelow:"#insertBelow",addTo:function(o){return o._insertItem(a,this)},copyTo:function(o){return this.clone(!1).addTo(o)},reduce:function(o){var h=this._children;if(h&&h.length===1){var b=h[0].reduce(o);return this._parent?(b.insertAbove(this),this.remove()):b.remove(),b}return this},_removeNamed:function(){var o=this._getOwner();if(o){var h=o._children,b=o._namedChildren,x=this._name,E=b[x],I=E?E.indexOf(this):-1;I!==-1&&(h[x]==this&&delete h[x],E.splice(I,1),E.length?h[x]=E[0]:delete b[x])}},_remove:function(o,h){var b=this._getOwner(),x=this._project,E=this._index;return this._style&&this._style._dispose(),b?(this._name&&this._removeNamed(),E!=null&&(x._activeLayer===this&&(x._activeLayer=this.getNextSibling()||this.getPreviousSibling()),c.splice(b._children,null,E,1)),this._installEvents(!1),o&&x._changes&&this._changed(5),h&&b._changed(11,this),this._parent=null,!0):!1},remove:function(){return this._remove(!0,!0)},replaceWith:function(o){var h=o&&o.insertBelow(this);return h&&this.remove(),h},removeChildren:function(o,h){if(!this._children)return null;o=o||0,h=c.pick(h,this._children.length);for(var b=c.splice(this._children,null,o,h-o),x=b.length-1;x>=0;x--)b[x]._remove(!0,!1);return b.length>0&&this._changed(11),b},clear:"#removeChildren",reverseChildren:function(){if(this._children){this._children.reverse();for(var o=0,h=this._children.length;o<h;o++)this._children[o]._index=o;this._changed(11)}},isEmpty:function(o){var h=this._children,b=h?h.length:0;if(o){for(var x=0;x<b;x++)if(!h[x].isEmpty(o))return!1;return!0}return!b},isEditable:function(){for(var o=this;o;){if(!o._visible||o._locked)return!1;o=o._parent}return!0},hasFill:function(){return this.getStyle().hasFill()},hasStroke:function(){return this.getStyle().hasStroke()},hasShadow:function(){return this.getStyle().hasShadow()},_getOrder:function(o){function h(F){var D=[];do D.unshift(F);while(F=F._parent);return D}for(var b=h(this),x=h(o),E=0,I=Math.min(b.length,x.length);E<I;E++)if(b[E]!=x[E])return b[E]._index<x[E]._index?1:-1;return 0},hasChildren:function(){return this._children&&this._children.length>0},isInserted:function(){return this._parent?this._parent.isInserted():!1},isAbove:function(o){return this._getOrder(o)===-1},isBelow:function(o){return this._getOrder(o)===1},isParent:function(o){return this._parent===o},isChild:function(o){return o&&o._parent===this},isDescendant:function(o){for(var h=this;h=h._parent;)if(h===o)return!0;return!1},isAncestor:function(o){return o?o.isDescendant(this):!1},isSibling:function(o){return this._parent===o._parent},isGroupedWith:function(o){for(var h=this._parent;h;){if(h._parent&&/^(Group|Layer|CompoundPath)$/.test(h._class)&&o.isDescendant(h))return!0;h=h._parent}return!1}},c.each(["rotate","scale","shear","skew"],function(o){var h=o==="rotate";this[o]=function(){var b=arguments,x=(h?c:_).read(b),E=_.read(b,0,{readNull:!0});return this.transform(new B()[o](x,E||this.getPosition(!0)))}},{translate:function(){var o=new B;return this.transform(o.translate.apply(o,arguments))},transform:function(o,h,b){var x=this._matrix,E=o&&!o.isIdentity(),I=b&&this._canApplyMatrix||this._applyMatrix&&(E||!x.isIdentity()||h&&this._children);if(!E&&!I)return this;if(E){!o.isInvertible()&&x.isInvertible()&&(x._backup=x.getValues()),x.prepend(o,!0);var F=this._style,D=F.getFillColor(!0),z=F.getStrokeColor(!0);D&&D.transform(o),z&&z.transform(o)}if(I&&(I=this._transformContent(x,h,b))){var U=this._pivot;U&&x._transformPoint(U,U,!0),x.reset(!0),b&&this._canApplyMatrix&&(this._applyMatrix=!0)}var J=this._bounds,te=this._position;(E||I)&&this._changed(25);var ee=E&&J&&o.decompose();if(ee&&ee.skewing.isZero()&&ee.rotation%90===0){for(var j in J){var pe=J[j];if(pe.nonscaling)delete J[j];else if(I||!pe.internal){var ie=pe.rect;o._transformBounds(ie,ie)}}this._bounds=J;var fe=J[this._getBoundsCacheKey(this._boundsOptions||{})];fe&&(this._position=this._getPositionFromBounds(fe.rect))}else E&&te&&this._pivot&&(this._position=o._transformPoint(te,te));return this},_transformContent:function(o,h,b){var x=this._children;if(x){for(var E=0,I=x.length;E<I;E++)x[E].transform(o,h,b);return!0}},globalToLocal:function(){return this.getGlobalMatrix(!0)._inverseTransform(_.read(arguments))},localToGlobal:function(){return this.getGlobalMatrix(!0)._transformPoint(_.read(arguments))},parentToLocal:function(){return this._matrix._inverseTransform(_.read(arguments))},localToParent:function(){return this._matrix._transformPoint(_.read(arguments))},fitBounds:function(o,h){o=L.read(arguments);var b=this.getBounds(),x=b.height/b.width,E=o.height/o.width,I=(h?x>E:x<E)?o.width/b.width:o.height/b.height,F=new L(new _,new m(b.width*I,b.height*I));F.setCenter(o.getCenter()),this.setBounds(F)}}),{_setStyles:function(o,h,b){var x=this._style,E=this._matrix;if(x.hasFill()&&(o.fillStyle=x.getFillColor().toCanvasStyle(o,E)),x.hasStroke()){o.strokeStyle=x.getStrokeColor().toCanvasStyle(o,E),o.lineWidth=x.getStrokeWidth();var I=x.getStrokeJoin(),F=x.getStrokeCap(),D=x.getMiterLimit();if(I&&(o.lineJoin=I),F&&(o.lineCap=F),D&&(o.miterLimit=D),rt.support.nativeDash){var z=x.getDashArray(),U=x.getDashOffset();z&&z.length&&("setLineDash"in o?(o.setLineDash(z),o.lineDashOffset=U):(o.mozDash=z,o.mozDashOffset=U))}}if(x.hasShadow()){var J=h.pixelRatio||1,te=b._shiftless().prepend(new B().scale(J,J)),ee=te.transform(new _(x.getShadowBlur(),0)),j=te.transform(this.getShadowOffset());o.shadowColor=x.getShadowColor().toCanvasStyle(o),o.shadowBlur=ee.getLength(),o.shadowOffsetX=j.x,o.shadowOffsetY=j.y}},draw:function(o,h,b){if(this._updateVersion=this._project._updateVersion,!(!this._visible||this._opacity===0)){var x=h.matrices,E=h.viewMatrix,I=this._matrix,F=x[x.length-1].appended(I);if(F.isInvertible()){E=E?E.appended(F):F,x.push(F),h.updateMatrix&&(this._globalMatrix=F);var D=this._blendMode,z=M.clamp(this._opacity,0,1),U=D==="normal",J=Je.nativeModes[D],te=U&&z===1||h.dontStart||h.clip||(J||U&&z<1)&&this._canComposite(),ee=h.pixelRatio||1,j,pe,ie;if(!te){var fe=this.getStrokeBounds(E);if(!fe.width||!fe.height){x.pop();return}ie=h.offset,pe=h.offset=fe.getTopLeft().floor(),j=o,o=Ue.getContext(fe.getSize().ceil().add(1).multiply(ee)),ee!==1&&o.scale(ee,ee)}o.save();var ne=b?b.appended(I):this._canScaleStroke&&!this.getStrokeScaling(!0)&&E,ae=!te&&h.clipItem,Z=!ne||ae;if(te?(o.globalAlpha=z,J&&(o.globalCompositeOperation=D)):Z&&o.translate(-pe.x,-pe.y),Z&&(te?I:E).applyToContext(o),ae&&h.clipItem.draw(o,h.extend({clip:!0})),ne){o.setTransform(ee,0,0,ee,0,0);var ue=h.offset;ue&&o.translate(-ue.x,-ue.y)}this._draw(o,h,E,ne),o.restore(),x.pop(),h.clip&&!h.dontFinish&&o.clip(this.getFillRule()),te||(Je.process(D,o,j,z,pe.subtract(ie).multiply(ee)),Ue.release(o),h.offset=ie)}}},_isUpdated:function(o){var h=this._parent;if(h instanceof Y)return h._isUpdated(o);var b=this._updateVersion===o;return!b&&h&&h._visible&&h._isUpdated(o)&&(this._updateVersion=o,b=!0),b},_drawSelection:function(o,h,b,x,E){var I=this._selection,F=I&1,D=I&2||F&&this._selectBounds,z=I&4;if(this._drawSelected||(F=!1),(F||D||z)&&this._isUpdated(E)){var U,J=this.getSelectedColor(!0)||(U=this.getLayer())&&U.getSelectedColor(!0),te=h.appended(this.getGlobalMatrix(!0)),ee=b/2;if(o.strokeStyle=o.fillStyle=J?J.toCanvasStyle(o):"#009dec",F&&this._drawSelected(o,te,x),z){var j=this.getPosition(!0),pe=this._parent,ie=pe?pe.localToGlobal(j):j,fe=ie.x,ne=ie.y;o.beginPath(),o.arc(fe,ne,ee,0,Math.PI*2,!0),o.stroke();for(var ae=[[0,-1],[1,0],[0,1],[-1,0]],Z=ee,ue=b+1,me=0;me<4;me++){var we=ae[me],ge=we[0],Ae=we[1];o.moveTo(fe+ge*Z,ne+Ae*Z),o.lineTo(fe+ge*ue,ne+Ae*ue),o.stroke()}}if(D){var Ie=te._transformCorners(this.getInternalBounds());o.beginPath();for(var me=0;me<8;me++)o[me?"lineTo":"moveTo"](Ie[me],Ie[++me]);o.closePath(),o.stroke();for(var me=0;me<8;me++)o.fillRect(Ie[me]-ee,Ie[++me]-ee,b,b)}}},_canComposite:function(){return!1}},c.each(["down","drag","up","move"],function(o){this["removeOn"+c.capitalize(o)]=function(){var h={};return h[o]=!0,this.removeOn(h)}},{removeOn:function(o){for(var h in o)if(o[h]){var b="mouse"+h,x=this._project,E=x._removeSets=x._removeSets||{};E[b]=E[b]||{},E[b][this._id]=this}return this}}),{tween:function(o,h,b){b||(b=h,h=o,o=null,b||(b=h,h=null));var x=b&&b.easing,E=b&&b.start,I=b!=null&&(typeof b=="number"?b:b.duration),F=new Wr(this,o,h,I,x,E);function D(z){F._handleFrame(z.time*1e3),F.running||this.off("frame",D)}return I&&this.on("frame",D),F},tweenTo:function(o,h){return this.tween(null,o,h)},tweenFrom:function(o,h){return this.tween(o,null,h)}}),ye=R.extend({_class:"Group",_selectBounds:!1,_selectChildren:!0,_serializeFields:{children:[]},initialize:function(h){this._children=[],this._namedChildren={},this._initialize(h)||this.addChildren(Array.isArray(h)?h:arguments)},_changed:function o(h){o.base.call(this,h),h&2050&&(this._clipItem=a)},_getClipItem:function(){var o=this._clipItem;if(o===a){o=null;for(var h=this._children,b=0,x=h.length;b<x;b++)if(h[b]._clipMask){o=h[b];break}this._clipItem=o}return o},isClipped:function(){return!!this._getClipItem()},setClipped:function(o){var h=this.getFirstChild();h&&h.setClipMask(o)},_getBounds:function o(h,b){var x=this._getClipItem();return x?x._getCachedBounds(x._matrix.prepended(h),c.set({},b,{stroke:!1})):o.base.call(this,h,b)},_hitTestChildren:function o(h,b,x){var E=this._getClipItem();return(!E||E.contains(h))&&o.base.call(this,h,b,x,E)},_draw:function(o,h){var b=h.clip,x=!b&&this._getClipItem();h=h.extend({clipItem:x,clip:!1}),b?(o.beginPath(),h.dontStart=h.dontFinish=!0):x&&x.draw(o,h.extend({clip:!0}));for(var E=this._children,I=0,F=E.length;I<F;I++){var D=E[I];D!==x&&D.draw(o,h)}}}),q=ye.extend({_class:"Layer",initialize:function(){ye.apply(this,arguments)},_getOwner:function(){return this._parent||this._index!=null&&this._project},isInserted:function o(){return this._parent?o.base.call(this):this._index!=null},activate:function(){this._project._activeLayer=this},_hitTestSelf:function(){}}),se=R.extend({_class:"Shape",_applyMatrix:!1,_canApplyMatrix:!1,_canScaleStroke:!0,_serializeFields:{type:null,size:null,radius:null},initialize:function(h,b){this._initialize(h,b)},_equals:function(o){return this._type===o._type&&this._size.equals(o._size)&&c.equals(this._radius,o._radius)},copyContent:function(o){this.setType(o._type),this.setSize(o._size),this.setRadius(o._radius)},getType:function(){return this._type},setType:function(o){this._type=o},getShape:"#getType",setShape:"#setType",getSize:function(){var o=this._size;return new T(o.width,o.height,this,"setSize")},setSize:function(){var o=m.read(arguments);if(!this._size)this._size=o.clone();else if(!this._size.equals(o)){var h=this._type,b=o.width,x=o.height;h==="rectangle"?this._radius.set(m.min(this._radius,o.divide(2).abs())):h==="circle"?(b=x=(b+x)/2,this._radius=b/2):h==="ellipse"&&this._radius._set(b/2,x/2),this._size._set(b,x),this._changed(9)}},getRadius:function(){var o=this._radius;return this._type==="circle"?o:new T(o.width,o.height,this,"setRadius")},setRadius:function(o){var h=this._type;if(h==="circle"){if(o===this._radius)return;var b=o*2;this._radius=o,this._size._set(b,b)}else if(o=m.read(arguments),!this._radius)this._radius=o.clone();else{if(this._radius.equals(o))return;if(this._radius.set(o),h==="rectangle"){var b=m.max(this._size,o.multiply(2));this._size.set(b)}else h==="ellipse"&&this._size._set(o.width*2,o.height*2)}this._changed(9)},isEmpty:function(){return!1},toPath:function(o){var h=new H[c.capitalize(this._type)]({center:new _,size:this._size,radius:this._radius,insert:!1});return h.copyAttributes(this),rt.settings.applyMatrix&&h.setApplyMatrix(!0),(o===a||o)&&h.insertAbove(this),h},toShape:"#clone",_asPathItem:function(){return this.toPath(!1)},_draw:function(o,h,b,x){var E=this._style,I=E.hasFill(),F=E.hasStroke(),D=h.dontFinish||h.clip,z=!x;if(I||F||D){var U=this._type,J=this._radius,te=U==="circle";if(h.dontStart||o.beginPath(),z&&te)o.arc(0,0,J,0,Math.PI*2,!0);else{var ee=te?J:J.width,j=te?J:J.height,pe=this._size,ie=pe.width,fe=pe.height;if(z&&U==="rectangle"&&ee===0&&j===0)o.rect(-ie/2,-fe/2,ie,fe);else{var ne=ie/2,ae=fe/2,Z=1-.5522847498307936,ue=ee*Z,me=j*Z,we=[-ne,-ae+j,-ne,-ae+me,-ne+ue,-ae,-ne+ee,-ae,ne-ee,-ae,ne-ue,-ae,ne,-ae+me,ne,-ae+j,ne,ae-j,ne,ae-me,ne-ue,ae,ne-ee,ae,-ne+ee,ae,-ne+ue,ae,-ne,ae-me,-ne,ae-j];x&&x.transform(we,we,32),o.moveTo(we[0],we[1]),o.bezierCurveTo(we[2],we[3],we[4],we[5],we[6],we[7]),ne!==ee&&o.lineTo(we[8],we[9]),o.bezierCurveTo(we[10],we[11],we[12],we[13],we[14],we[15]),ae!==j&&o.lineTo(we[16],we[17]),o.bezierCurveTo(we[18],we[19],we[20],we[21],we[22],we[23]),ne!==ee&&o.lineTo(we[24],we[25]),o.bezierCurveTo(we[26],we[27],we[28],we[29],we[30],we[31])}}o.closePath()}!D&&(I||F)&&(this._setStyles(o,h,b),I&&(o.fill(E.getFillRule()),o.shadowColor="rgba(0,0,0,0)"),F&&o.stroke())},_canComposite:function(){return!(this.hasFill()&&this.hasStroke())},_getBounds:function(o,h){var b=new L(this._size).setCenter(0,0),x=this._style,E=h.stroke&&x.hasStroke()&&x.getStrokeWidth();return o&&(b=o._transformBounds(b)),E?b.expand(H._getStrokePadding(E,this._getStrokeMatrix(o,h))):b}},new function(){function o(b,x,E){var I=b._radius;if(!I.isZero())for(var F=b._size.divide(2),D=1;D<=4;D++){var z=new _(D>1&&D<4?-1:1,D>2?-1:1),U=z.multiply(F),J=U.subtract(z.multiply(I)),te=new L(E?U.add(z.multiply(E)):U,J);if(te.contains(x))return{point:J,quadrant:D}}}function h(b,x,E,I){var F=b.divide(x);return(!I||F.isInQuadrant(I))&&F.subtract(F.normalize()).multiply(x).divide(E).length<=1}return{_contains:function b(x){if(this._type==="rectangle"){var E=o(this,x);return E?x.subtract(E.point).divide(this._radius).getLength()<=1:b.base.call(this,x)}else return x.divide(this.size).getLength()<=.5},_hitTestSelf:function b(x,E,I,F){var D=!1,z=this._style,U=E.stroke&&z.hasStroke(),J=E.fill&&z.hasFill();if(U||J){var te=this._type,ee=this._radius,j=U?z.getStrokeWidth()/2:0,pe=E._tolerancePadding.add(H._getStrokePadding(j,!z.getStrokeScaling()&&F));if(te==="rectangle"){var ie=pe.multiply(2),fe=o(this,x,ie);if(fe)D=h(x.subtract(fe.point),ee,pe,fe.quadrant);else{var ne=new L(this._size).setCenter(0,0),ae=ne.expand(ie),Z=ne.expand(ie.negate());D=ae._containsPoint(x)&&!Z._containsPoint(x)}}else D=h(x,ee,pe)}return D?new de(U?"stroke":"fill",this):b.base.apply(this,arguments)}}},{statics:new function(){function o(h,b,x,E,I){var F=c.create(se.prototype);return F._type=h,F._size=x,F._radius=E,F._initialize(c.getNamed(I),b),F}return{Circle:function(){var h=arguments,b=_.readNamed(h,"center"),x=c.readNamed(h,"radius");return o("circle",b,new m(x*2),x,h)},Rectangle:function(){var h=arguments,b=L.readNamed(h,"rectangle"),x=m.min(m.readNamed(h,"radius"),b.getSize(!0).divide(2));return o("rectangle",b.getCenter(!0),b.getSize(!0),x,h)},Ellipse:function(){var h=arguments,b=se._readEllipse(h),x=b.radius;return o("ellipse",b.center,x.multiply(2),x,h)},_readEllipse:function(h){var b,x;if(c.hasNamed(h,"radius"))b=_.readNamed(h,"center"),x=m.readNamed(h,"radius");else{var E=L.readNamed(h,"rectangle");b=E.getCenter(!0),x=E.getSize(!0).divide(2)}return{center:b,radius:x}}}}}),ve=R.extend({_class:"Raster",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!1,handle:!1},_serializeFields:{crossOrigin:null,source:null},_prioritize:["crossOrigin"],_smoothing:"low",beans:!0,initialize:function(h,b){if(!this._initialize(h,b!==a&&_.read(arguments))){var x,E=typeof h,I=E==="string"?u.getElementById(h):E==="object"?h:null;if(I&&I!==R.NO_INSERT){if(I.getContext||I.naturalHeight!=null)x=I;else if(I){var F=m.read(arguments);F.isZero()||(x=Ue.getCanvas(F))}}x?this.setImage(x):this.setSource(h)}this._size||(this._size=new m,this._loaded=!1)},_equals:function(o){return this.getSource()===o.getSource()},copyContent:function(o){var h=o._image,b=o._canvas;if(h)this._setImage(h);else if(b){var x=Ue.getCanvas(o._size);x.getContext("2d").drawImage(b,0,0),this._setImage(x)}this._crossOrigin=o._crossOrigin},getSize:function(){var o=this._size;return new T(o?o.width:0,o?o.height:0,this,"setSize")},setSize:function(o,h){var b=m.read(arguments);if(b.equals(this._size))h&&this.clear();else if(b.width>0&&b.height>0){var x=!h&&this.getElement();this._setImage(Ue.getCanvas(b)),x&&this.getContext(!0).drawImage(x,0,0,b.width,b.height)}else this._canvas&&Ue.release(this._canvas),this._size=b.clone()},getWidth:function(){return this._size?this._size.width:0},setWidth:function(o){this.setSize(o,this.getHeight())},getHeight:function(){return this._size?this._size.height:0},setHeight:function(o){this.setSize(this.getWidth(),o)},getLoaded:function(){return this._loaded},isEmpty:function(){var o=this._size;return!o||o.width===0&&o.height===0},getResolution:function(){var o=this._matrix,h=new _(0,0).transform(o),b=new _(1,0).transform(o).subtract(h),x=new _(0,1).transform(o).subtract(h);return new m(72/b.getLength(),72/x.getLength())},getPpi:"#getResolution",getImage:function(){return this._image},setImage:function(o){var h=this;function b(x){var E=h.getView(),I=x&&x.type||"load";E&&h.responds(I)&&(rt=E._scope,h.emit(I,new Dt(x)))}this._setImage(o),this._loaded?setTimeout(b,0):o&&It.add(o,{load:function(x){h._setImage(o),b(x)},error:b})},_setImage:function(o){this._canvas&&Ue.release(this._canvas),o&&o.getContext?(this._image=null,this._canvas=o,this._loaded=!0):(this._image=o,this._canvas=null,this._loaded=!!(o&&o.src&&o.complete)),this._size=new m(o?o.naturalWidth||o.width:0,o?o.naturalHeight||o.height:0),this._context=null,this._changed(1033)},getCanvas:function(){if(!this._canvas){var o=Ue.getContext(this._size);try{this._image&&o.drawImage(this._image,0,0),this._canvas=o.canvas}catch{Ue.release(o)}}return this._canvas},setCanvas:"#setImage",getContext:function(o){return this._context||(this._context=this.getCanvas().getContext("2d")),o&&(this._image=null,this._changed(1025)),this._context},setContext:function(o){this._context=o},getSource:function(){var o=this._image;return o&&o.src||this.toDataURL()},setSource:function(o){var h=new r.Image,b=this._crossOrigin;b&&(h.crossOrigin=b),o&&(h.src=o),this.setImage(h)},getCrossOrigin:function(){var o=this._image;return o&&o.crossOrigin||this._crossOrigin||""},setCrossOrigin:function(o){this._crossOrigin=o;var h=this._image;h&&(h.crossOrigin=o)},getSmoothing:function(){return this._smoothing},setSmoothing:function(o){this._smoothing=typeof o=="string"?o:o?"low":"off",this._changed(257)},getElement:function(){return this._canvas||this._loaded&&this._image}},{beans:!1,getSubCanvas:function(){var o=L.read(arguments),h=Ue.getContext(o.getSize());return h.drawImage(this.getCanvas(),o.x,o.y,o.width,o.height,0,0,o.width,o.height),h.canvas},getSubRaster:function(){var o=L.read(arguments),h=new ve(R.NO_INSERT);return h._setImage(this.getSubCanvas(o)),h.translate(o.getCenter().subtract(this.getSize().divide(2))),h._matrix.prepend(this._matrix),h.insertAbove(this),h},toDataURL:function(){var o=this._image,h=o&&o.src;if(/^data:/.test(h))return h;var b=this.getCanvas();return b?b.toDataURL.apply(b,arguments):null},drawImage:function(o){var h=_.read(arguments,1);this.getContext(!0).drawImage(o,h.x,h.y)},getAverageColor:function(o){var h,b;if(o?o instanceof Me?(b=o,h=o.getBounds()):typeof o=="object"&&("width"in o?h=new L(o):"x"in o&&(h=new L(o.x-.5,o.y-.5,1,1))):h=this.getBounds(),!h)return null;var x=32,E=Math.min(h.width,x),I=Math.min(h.height,x),F=ve._sampleContext;F?F.clearRect(0,0,x+1,x+1):F=ve._sampleContext=Ue.getContext(new m(x)),F.save();var D=new B().scale(E/h.width,I/h.height).translate(-h.x,-h.y);D.applyToContext(F),b&&b.draw(F,new c({clip:!0,matrices:[D]})),this._matrix.applyToContext(F);var z=this.getElement(),U=this._size;z&&F.drawImage(z,-U.width/2,-U.height/2),F.restore();for(var J=F.getImageData(.5,.5,Math.ceil(E),Math.ceil(I)).data,te=[0,0,0],ee=0,j=0,pe=J.length;j<pe;j+=4){var ie=J[j+3];ee+=ie,ie/=255,te[0]+=J[j]*ie,te[1]+=J[j+1]*ie,te[2]+=J[j+2]*ie}for(var j=0;j<3;j++)te[j]/=ee;return ee?Re.read(te):null},getPixel:function(){var o=_.read(arguments),h=this.getContext().getImageData(o.x,o.y,1,1).data;return new Re("rgb",[h[0]/255,h[1]/255,h[2]/255],h[3]/255)},setPixel:function(){var o=arguments,h=_.read(o),b=Re.read(o),x=b._convert("rgb"),E=b._alpha,I=this.getContext(!0),F=I.createImageData(1,1),D=F.data;D[0]=x[0]*255,D[1]=x[1]*255,D[2]=x[2]*255,D[3]=E!=null?E*255:255,I.putImageData(F,h.x,h.y)},clear:function(){var o=this._size;this.getContext(!0).clearRect(0,0,o.width+1,o.height+1)},createImageData:function(){var o=m.read(arguments);return this.getContext().createImageData(o.width,o.height)},getImageData:function(){var o=L.read(arguments);return o.isEmpty()&&(o=new L(this._size)),this.getContext().getImageData(o.x,o.y,o.width,o.height)},putImageData:function(o){var h=_.read(arguments,1);this.getContext(!0).putImageData(o,h.x,h.y)},setImageData:function(o){this.setSize(o),this.getContext(!0).putImageData(o,0,0)},_getBounds:function(o,h){var b=new L(this._size).setCenter(0,0);return o?o._transformBounds(b):b},_hitTestSelf:function(o){if(this._contains(o)){var h=this;return new de("pixel",h,{offset:o.add(h._size.divide(2)).round(),color:{get:function(){return h.getPixel(this.offset)}}})}},_draw:function(o,h,b){var x=this.getElement();if(x&&x.width>0&&x.height>0){o.globalAlpha=M.clamp(this._opacity,0,1),this._setStyles(o,h,b);var E=this._smoothing,I=E==="off";Ct.setPrefixed(o,I?"imageSmoothingEnabled":"imageSmoothingQuality",I?!1:E),o.drawImage(x,-this._size.width/2,-this._size.height/2)}},_canComposite:function(){return!0}}),he=R.extend({_class:"SymbolItem",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!0},_serializeFields:{symbol:null},initialize:function(h,b){this._initialize(h,b!==a&&_.read(arguments,1))||this.setDefinition(h instanceof ce?h:new ce(h))},_equals:function(o){return this._definition===o._definition},copyContent:function(o){this.setDefinition(o._definition)},getDefinition:function(){return this._definition},setDefinition:function(o){this._definition=o,this._changed(9)},getSymbol:"#getDefinition",setSymbol:"#setDefinition",isEmpty:function(){return this._definition._item.isEmpty()},_getBounds:function(o,h){var b=this._definition._item;return b._getCachedBounds(b._matrix.prepended(o),h)},_hitTestSelf:function(o,h,b){var x=h.extend({all:!1}),E=this._definition._item._hitTest(o,x,b);return E&&(E.item=this),E},_draw:function(o,h){this._definition._item.draw(o,h)}}),ce=c.extend({_class:"SymbolDefinition",initialize:function(h,b){this._id=w.get(),this.project=rt.project,h&&this.setItem(h,b)},_serialize:function(o,h){return h.add(this,function(){return c.serialize([this._class,this._item],o,!1,h)})},_changed:function(o){o&8&&R._clearBoundsCache(this),o&1&&this.project._changed(o)},getItem:function(){return this._item},setItem:function(o,h){o._symbol&&(o=o.clone()),this._item&&(this._item._symbol=null),this._item=o,o.remove(),o.setSelected(!1),h||o.setPosition(new _),o._symbol=this,this._changed(9)},getDefinition:"#getItem",setDefinition:"#setItem",place:function(o){return new he(this,o)},clone:function(){return new ce(this._item.clone(!1))},equals:function(o){return o===this||o&&this._item.equals(o._item)||!1}}),de=c.extend({_class:"HitResult",initialize:function(h,b,x){this.type=h,this.item=b,x&&this.inject(x)},statics:{getOptions:function(o){var h=o&&c.read(o);return new c({type:null,tolerance:rt.settings.hitTolerance,fill:!h,stroke:!h,segments:!h,handles:!1,ends:!1,position:!1,center:!1,bounds:!1,guides:!1,selected:!1},h)}}}),K=c.extend({_class:"Segment",beans:!0,_selection:0,initialize:function(h,b,x,E,I,F){var D=arguments.length,z,U,J,te;D>0&&(h==null||typeof h=="object"?D===1&&h&&"point"in h?(z=h.point,U=h.handleIn,J=h.handleOut,te=h.selection):(z=h,U=b,J=x,te=E):(z=[h,b],U=x!==a?[x,E]:null,J=I!==a?[I,F]:null)),new Q(z,this,"_point"),new Q(U,this,"_handleIn"),new Q(J,this,"_handleOut"),te&&this.setSelection(te)},_serialize:function(o,h){var b=this._point,x=this._selection,E=x||this.hasHandles()?[b,this._handleIn,this._handleOut]:b;return x&&E.push(x),c.serialize(E,o,!0,h)},_changed:function(o){var h=this._path;if(h){var b=h._curves,x=this._index,E;b&&((!o||o===this._point||o===this._handleIn)&&(E=x>0?b[x-1]:h._closed?b[b.length-1]:null)&&E._changed(),(!o||o===this._point||o===this._handleOut)&&(E=b[x])&&E._changed()),h._changed(41)}},getPoint:function(){return this._point},setPoint:function(){this._point.set(_.read(arguments))},getHandleIn:function(){return this._handleIn},setHandleIn:function(){this._handleIn.set(_.read(arguments))},getHandleOut:function(){return this._handleOut},setHandleOut:function(){this._handleOut.set(_.read(arguments))},hasHandles:function(){return!this._handleIn.isZero()||!this._handleOut.isZero()},isSmooth:function(){var o=this._handleIn,h=this._handleOut;return!o.isZero()&&!h.isZero()&&o.isCollinear(h)},clearHandles:function(){this._handleIn._set(0,0),this._handleOut._set(0,0)},getSelection:function(){return this._selection},setSelection:function(o){var h=this._selection,b=this._path;this._selection=o=o||0,b&&o!==h&&(b._updateSelection(this,h,o),b._changed(257))},_changeSelection:function(o,h){var b=this._selection;this.setSelection(h?b|o:b&~o)},isSelected:function(){return!!(this._selection&7)},setSelected:function(o){this._changeSelection(7,o)},getIndex:function(){return this._index!==a?this._index:null},getPath:function(){return this._path||null},getCurve:function(){var o=this._path,h=this._index;return o?(h>0&&!o._closed&&h===o._segments.length-1&&h--,o.getCurves()[h]||null):null},getLocation:function(){var o=this.getCurve();return o?new Ee(o,this===o._segment1?0:1):null},getNext:function(){var o=this._path&&this._path._segments;return o&&(o[this._index+1]||this._path._closed&&o[0])||null},smooth:function(o,h,b){var x=o||{},E=x.type,I=x.factor,F=this.getPrevious(),D=this.getNext(),z=(F||this)._point,U=this._point,J=(D||this)._point,te=z.getDistance(U),ee=U.getDistance(J);if(!E||E==="catmull-rom"){var j=I===a?.5:I,pe=Math.pow(te,j),ie=pe*pe,fe=Math.pow(ee,j),ne=fe*fe;if(!h&&F){var ae=2*ne+3*fe*pe+ie,Z=3*fe*(fe+pe);this.setHandleIn(Z!==0?new _((ne*z._x+ae*U._x-ie*J._x)/Z-U._x,(ne*z._y+ae*U._y-ie*J._y)/Z-U._y):new _)}if(!b&&D){var ae=2*ie+3*pe*fe+ne,Z=3*pe*(pe+fe);this.setHandleOut(Z!==0?new _((ie*J._x+ae*U._x-ne*z._x)/Z-U._x,(ie*J._y+ae*U._y-ne*z._y)/Z-U._y):new _)}}else if(E==="geometric"){if(F&&D){var ue=z.subtract(J),me=I===a?.4:I,we=me*te/(te+ee);h||this.setHandleIn(ue.multiply(we)),b||this.setHandleOut(ue.multiply(we-me))}}else throw new Error("Smoothing method '"+E+"' not supported.")},getPrevious:function(){var o=this._path&&this._path._segments;return o&&(o[this._index-1]||this._path._closed&&o[o.length-1])||null},isFirst:function(){return!this._index},isLast:function(){var o=this._path;return o&&this._index===o._segments.length-1||!1},reverse:function(){var o=this._handleIn,h=this._handleOut,b=o.clone();o.set(h),h.set(b)},reversed:function(){return new K(this._point,this._handleOut,this._handleIn)},remove:function(){return this._path?!!this._path.removeSegment(this._index):!1},clone:function(){return new K(this._point,this._handleIn,this._handleOut)},equals:function(o){return o===this||o&&this._class===o._class&&this._point.equals(o._point)&&this._handleIn.equals(o._handleIn)&&this._handleOut.equals(o._handleOut)||!1},toString:function(){var o=["point: "+this._point];return this._handleIn.isZero()||o.push("handleIn: "+this._handleIn),this._handleOut.isZero()||o.push("handleOut: "+this._handleOut),"{ "+o.join(", ")+" }"},transform:function(o){this._transformCoordinates(o,new Array(6),!0),this._changed()},interpolate:function(o,h,b){var x=1-b,E=b,I=o._point,F=h._point,D=o._handleIn,z=h._handleIn,U=h._handleOut,J=o._handleOut;this._point._set(x*I._x+E*F._x,x*I._y+E*F._y,!0),this._handleIn._set(x*D._x+E*z._x,x*D._y+E*z._y,!0),this._handleOut._set(x*J._x+E*U._x,x*J._y+E*U._y,!0),this._changed()},_transformCoordinates:function(o,h,b){var x=this._point,E=!b||!this._handleIn.isZero()?this._handleIn:null,I=!b||!this._handleOut.isZero()?this._handleOut:null,F=x._x,D=x._y,z=2;return h[0]=F,h[1]=D,E&&(h[z++]=E._x+F,h[z++]=E._y+D),I&&(h[z++]=I._x+F,h[z++]=I._y+D),o&&(o._transformCoordinates(h,h,z/2),F=h[0],D=h[1],b?(x._x=F,x._y=D,z=2,E&&(E._x=h[z++]-F,E._y=h[z++]-D),I&&(I._x=h[z++]-F,I._y=h[z++]-D)):(E||(h[z++]=F,h[z++]=D),I||(h[z++]=F,h[z++]=D))),h}}),Q=_.extend({initialize:function(h,b,x){var E,I,F;if(!h)E=I=0;else if((E=h[0])!==a)I=h[1];else{var D=h;(E=D.x)===a&&(D=_.read(arguments),E=D.x),I=D.y,F=D.selected}this._x=E,this._y=I,this._owner=b,b[x]=this,F&&this.setSelected(!0)},_set:function(o,h){return this._x=o,this._y=h,this._owner._changed(this),this},getX:function(){return this._x},setX:function(o){this._x=o,this._owner._changed(this)},getY:function(){return this._y},setY:function(o){this._y=o,this._owner._changed(this)},isZero:function(){var o=M.isZero;return o(this._x)&&o(this._y)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(o){this._owner._changeSelection(this._getSelection(),o)},_getSelection:function(){var o=this._owner;return this===o._point?1:this===o._handleIn?2:this===o._handleOut?4:0}}),le=c.extend({_class:"Curve",beans:!0,initialize:function(h,b,x,E,I,F,D,z){var U=arguments.length,J,te,ee,j,pe,ie;U===3?(this._path=h,J=b,te=x):U?U===1?"segment1"in h?(J=new K(h.segment1),te=new K(h.segment2)):"point1"in h?(ee=h.point1,pe=h.handle1,ie=h.handle2,j=h.point2):Array.isArray(h)&&(ee=[h[0],h[1]],j=[h[6],h[7]],pe=[h[2]-h[0],h[3]-h[1]],ie=[h[4]-h[6],h[5]-h[7]]):U===2?(J=new K(h),te=new K(b)):U===4?(ee=h,pe=b,ie=x,j=E):U===8&&(ee=[h,b],j=[D,z],pe=[x-h,E-b],ie=[I-D,F-z]):(J=new K,te=new K),this._segment1=J||new K(ee,null,pe),this._segment2=te||new K(j,ie,null)},_serialize:function(o,h){return c.serialize(this.hasHandles()?[this.getPoint1(),this.getHandle1(),this.getHandle2(),this.getPoint2()]:[this.getPoint1(),this.getPoint2()],o,!0,h)},_changed:function(){this._length=this._bounds=a},clone:function(){return new le(this._segment1,this._segment2)},toString:function(){var o=["point1: "+this._segment1._point];return this._segment1._handleOut.isZero()||o.push("handle1: "+this._segment1._handleOut),this._segment2._handleIn.isZero()||o.push("handle2: "+this._segment2._handleIn),o.push("point2: "+this._segment2._point),"{ "+o.join(", ")+" }"},classify:function(){return le.classify(this.getValues())},remove:function(){var o=!1;if(this._path){var h=this._segment2,b=h._handleOut;o=h.remove(),o&&this._segment1._handleOut.set(b)}return o},getPoint1:function(){return this._segment1._point},setPoint1:function(){this._segment1._point.set(_.read(arguments))},getPoint2:function(){return this._segment2._point},setPoint2:function(){this._segment2._point.set(_.read(arguments))},getHandle1:function(){return this._segment1._handleOut},setHandle1:function(){this._segment1._handleOut.set(_.read(arguments))},getHandle2:function(){return this._segment2._handleIn},setHandle2:function(){this._segment2._handleIn.set(_.read(arguments))},getSegment1:function(){return this._segment1},getSegment2:function(){return this._segment2},getPath:function(){return this._path},getIndex:function(){return this._segment1._index},getNext:function(){var o=this._path&&this._path._curves;return o&&(o[this._segment1._index+1]||this._path._closed&&o[0])||null},getPrevious:function(){var o=this._path&&this._path._curves;return o&&(o[this._segment1._index-1]||this._path._closed&&o[o.length-1])||null},isFirst:function(){return!this._segment1._index},isLast:function(){var o=this._path;return o&&this._segment1._index===o._curves.length-1||!1},isSelected:function(){return this.getPoint1().isSelected()&&this.getHandle1().isSelected()&&this.getHandle2().isSelected()&&this.getPoint2().isSelected()},setSelected:function(o){this.getPoint1().setSelected(o),this.getHandle1().setSelected(o),this.getHandle2().setSelected(o),this.getPoint2().setSelected(o)},getValues:function(o){return le.getValues(this._segment1,this._segment2,o)},getPoints:function(){for(var o=this.getValues(),h=[],b=0;b<8;b+=2)h.push(new _(o[b],o[b+1]));return h}},{getLength:function(){return this._length==null&&(this._length=le.getLength(this.getValues(),0,1)),this._length},getArea:function(){return le.getArea(this.getValues())},getLine:function(){return new W(this._segment1._point,this._segment2._point)},getPart:function(o,h){return new le(le.getPart(this.getValues(),o,h))},getPartLength:function(o,h){return le.getLength(this.getValues(),o,h)},divideAt:function(o){return this.divideAtTime(o&&o.curve===this?o.time:this.getTimeAt(o))},divideAtTime:function(o,h){var b=1e-8,x=1-b,E=null;if(o>=b&&o<=x){var I=le.subdivide(this.getValues(),o),F=I[0],D=I[1],z=h||this.hasHandles(),U=this._segment1,J=this._segment2,te=this._path;z&&(U._handleOut._set(F[2]-F[0],F[3]-F[1]),J._handleIn._set(D[4]-D[6],D[5]-D[7]));var ee=F[6],j=F[7],pe=new K(new _(ee,j),z&&new _(F[4]-ee,F[5]-j),z&&new _(D[2]-ee,D[3]-j));te?(te.insert(U._index+1,pe),E=this.getNext()):(this._segment2=pe,this._changed(),E=new le(pe,J))}return E},splitAt:function(o){var h=this._path;return h?h.splitAt(o):null},splitAtTime:function(o){return this.splitAt(this.getLocationAtTime(o))},divide:function(o,h){return this.divideAtTime(o===a?.5:h?o:this.getTimeAt(o))},split:function(o,h){return this.splitAtTime(o===a?.5:h?o:this.getTimeAt(o))},reversed:function(){return new le(this._segment2.reversed(),this._segment1.reversed())},clearHandles:function(){this._segment1._handleOut._set(0,0),this._segment2._handleIn._set(0,0)},statics:{getValues:function(o,h,b,x){var E=o._point,I=o._handleOut,F=h._handleIn,D=h._point,z=E.x,U=E.y,J=D.x,te=D.y,ee=x?[z,U,z,U,J,te,J,te]:[z,U,z+I._x,U+I._y,J+F._x,te+F._y,J,te];return b&&b._transformCoordinates(ee,ee,4),ee},subdivide:function(o,h){var b=o[0],x=o[1],E=o[2],I=o[3],F=o[4],D=o[5],z=o[6],U=o[7];h===a&&(h=.5);var J=1-h,te=J*b+h*E,ee=J*x+h*I,j=J*E+h*F,pe=J*I+h*D,ie=J*F+h*z,fe=J*D+h*U,ne=J*te+h*j,ae=J*ee+h*pe,Z=J*j+h*ie,ue=J*pe+h*fe,me=J*ne+h*Z,we=J*ae+h*ue;return[[b,x,te,ee,ne,ae,me,we],[me,we,Z,ue,ie,fe,z,U]]},getMonoCurves:function(o,h){var b=[],x=h?0:1,E=o[x+0],I=o[x+2],F=o[x+4],D=o[x+6];if(E>=I==I>=F&&I>=F==F>=D||le.isStraight(o))b.push(o);else{var z=3*(I-F)-E+D,U=2*(E+F)-4*I,J=I-E,te=1e-8,ee=1-te,j=[],pe=M.solveQuadratic(z,U,J,j,te,ee);if(!pe)b.push(o);else{j.sort();var ie=j[0],fe=le.subdivide(o,ie);b.push(fe[0]),pe>1&&(ie=(j[1]-ie)/(1-ie),fe=le.subdivide(fe[1],ie),b.push(fe[0])),b.push(fe[1])}}return b},solveCubic:function(o,h,b,x,E,I){var F=o[h],D=o[h+2],z=o[h+4],U=o[h+6],J=0;if(!(F<b&&U<b&&D<b&&z<b||F>b&&U>b&&D>b&&z>b)){var te=3*(D-F),ee=3*(z-D)-te,j=U-F-te-ee;J=M.solveCubic(j,ee,te,F-b,x,E,I)}return J},getTimeOf:function(o,h){var b=new _(o[0],o[1]),x=new _(o[6],o[7]),E=1e-12,I=1e-7,F=h.isClose(b,E)?0:h.isClose(x,E)?1:null;if(F===null)for(var D=[h.x,h.y],z=[],U=0;U<2;U++)for(var J=le.solveCubic(o,U,D[U],z,0,1),te=0;te<J;te++){var ee=z[te];if(h.isClose(le.getPoint(o,ee),I))return ee}return h.isClose(b,I)?0:h.isClose(x,I)?1:null},getNearestTime:function(o,h){if(le.isStraight(o)){var b=o[0],x=o[1],E=o[6],I=o[7],F=E-b,D=I-x,z=F*F+D*D;if(z===0)return 0;var U=((h.x-b)*F+(h.y-x)*D)/z;return U<1e-12?0:U>.999999999999?1:le.getTimeOf(o,new _(b+U*F,x+U*D))}var J=100,te=1/0,ee=0;function j(fe){if(fe>=0&&fe<=1){var ne=h.getDistance(le.getPoint(o,fe),!0);if(ne<te)return te=ne,ee=fe,!0}}for(var pe=0;pe<=J;pe++)j(pe/J);for(var ie=1/(J*2);ie>1e-8;)!j(ee-ie)&&!j(ee+ie)&&(ie/=2);return ee},getPart:function(o,h,b){var x=h>b;if(x){var E=h;h=b,b=E}return h>0&&(o=le.subdivide(o,h)[1]),b<1&&(o=le.subdivide(o,(b-h)/(1-h))[0]),x?[o[6],o[7],o[4],o[5],o[2],o[3],o[0],o[1]]:o},isFlatEnough:function(o,h){var b=o[0],x=o[1],E=o[2],I=o[3],F=o[4],D=o[5],z=o[6],U=o[7],J=3*E-2*b-z,te=3*I-2*x-U,ee=3*F-2*z-b,j=3*D-2*U-x;return Math.max(J*J,ee*ee)+Math.max(te*te,j*j)<=16*h*h},getArea:function(o){var h=o[0],b=o[1],x=o[2],E=o[3],I=o[4],F=o[5],D=o[6],z=o[7];return 3*((z-b)*(x+I)-(D-h)*(E+F)+E*(h-I)-x*(b-F)+z*(I+h/3)-D*(F+b/3))/20},getBounds:function(o){for(var h=o.slice(0,2),b=h.slice(),x=[0,0],E=0;E<2;E++)le._addBounds(o[E],o[E+2],o[E+4],o[E+6],E,0,h,b,x);return new L(h[0],h[1],b[0]-h[0],b[1]-h[1])},_addBounds:function(o,h,b,x,E,I,F,D,z){function U(me,we){var ge=me-we,Ae=me+we;ge<F[E]&&(F[E]=ge),Ae>D[E]&&(D[E]=Ae)}I/=2;var J=F[E]+I,te=D[E]-I;if(o<J||h<J||b<J||x<J||o>te||h>te||b>te||x>te)if(h<o!=h<x&&b<o!=b<x)U(o,0),U(x,0);else{var ee=3*(h-b)-o+x,j=2*(o+b)-4*h,pe=h-o,ie=M.solveQuadratic(ee,j,pe,z),fe=1e-8,ne=1-fe;U(x,0);for(var ae=0;ae<ie;ae++){var Z=z[ae],ue=1-Z;fe<=Z&&Z<=ne&&U(ue*ue*ue*o+3*ue*ue*Z*h+3*ue*Z*Z*b+Z*Z*Z*x,I)}}}}},c.each(["getBounds","getStrokeBounds","getHandleBounds"],function(o){this[o]=function(){this._bounds||(this._bounds={});var h=this._bounds[o];return h||(h=this._bounds[o]=H[o]([this._segment1,this._segment2],!1,this._path)),h.clone()}},{}),c.each({isStraight:function(o,h,b,x){if(h.isZero()&&b.isZero())return!0;var E=x.subtract(o);if(E.isZero())return!1;if(E.isCollinear(h)&&E.isCollinear(b)){var I=new W(o,x),F=1e-7;if(I.getDistance(o.add(h))<F&&I.getDistance(x.add(b))<F){var D=E.dot(E),z=E.dot(h)/D,U=E.dot(b)/D;return z>=0&&z<=1&&U<=0&&U>=-1}}return!1},isLinear:function(o,h,b,x){var E=x.subtract(o).divide(3);return h.equals(E)&&b.negate().equals(E)}},function(o,h){this[h]=function(b){var x=this._segment1,E=this._segment2;return o(x._point,x._handleOut,E._handleIn,E._point,b)},this.statics[h]=function(b,x){var E=b[0],I=b[1],F=b[6],D=b[7];return o(new _(E,I),new _(b[2]-E,b[3]-I),new _(b[4]-F,b[5]-D),new _(F,D),x)}},{statics:{},hasHandles:function(){return!this._segment1._handleOut.isZero()||!this._segment2._handleIn.isZero()},hasLength:function(o){return(!this.getPoint1().equals(this.getPoint2())||this.hasHandles())&&this.getLength()>(o||0)},isCollinear:function(o){return o&&this.isStraight()&&o.isStraight()&&this.getLine().isCollinear(o.getLine())},isHorizontal:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).y)<1e-8},isVertical:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).x)<1e-8}}),{beans:!1,getLocationAt:function(o,h){return this.getLocationAtTime(h?o:this.getTimeAt(o))},getLocationAtTime:function(o){return o!=null&&o>=0&&o<=1?new Ee(this,o):null},getTimeAt:function(o,h){return le.getTimeAt(this.getValues(),o,h)},getParameterAt:"#getTimeAt",getTimesWithTangent:function(){var o=_.read(arguments);return o.isZero()?[]:le.getTimesWithTangent(this.getValues(),o)},getOffsetAtTime:function(o){return this.getPartLength(0,o)},getLocationOf:function(){return this.getLocationAtTime(this.getTimeOf(_.read(arguments)))},getOffsetOf:function(){var o=this.getLocationOf.apply(this,arguments);return o?o.getOffset():null},getTimeOf:function(){return le.getTimeOf(this.getValues(),_.read(arguments))},getParameterOf:"#getTimeOf",getNearestLocation:function(){var o=_.read(arguments),h=this.getValues(),b=le.getNearestTime(h,o),x=le.getPoint(h,b);return new Ee(this,b,x,null,o.getDistance(x))},getNearestPoint:function(){var o=this.getNearestLocation.apply(this,arguments);return o&&o.getPoint()}},new function(){var o=["getPoint","getTangent","getNormal","getWeightedTangent","getWeightedNormal","getCurvature"];return c.each(o,function(h){this[h+"At"]=function(b,x){var E=this.getValues();return le[h](E,x?b:le.getTimeAt(E,b))},this[h+"AtTime"]=function(b){return le[h](this.getValues(),b)}},{statics:{_evaluateMethods:o}})},new function(){function o(x){var E=x[0],I=x[1],F=x[2],D=x[3],z=x[4],U=x[5],J=x[6],te=x[7],ee=9*(F-z)+3*(J-E),j=6*(E+z)-12*F,pe=3*(F-E),ie=9*(D-U)+3*(te-I),fe=6*(I+U)-12*D,ne=3*(D-I);return function(ae){var Z=(ee*ae+j)*ae+pe,ue=(ie*ae+fe)*ae+ne;return Math.sqrt(Z*Z+ue*ue)}}function h(x,E){return Math.max(2,Math.min(16,Math.ceil(Math.abs(E-x)*32)))}function b(x,E,I,F){if(E==null||E<0||E>1)return null;var D=x[0],z=x[1],U=x[2],J=x[3],te=x[4],ee=x[5],j=x[6],pe=x[7],ie=M.isZero;ie(U-D)&&ie(J-z)&&(U=D,J=z),ie(te-j)&&ie(ee-pe)&&(te=j,ee=pe);var fe=3*(U-D),ne=3*(te-U)-fe,ae=j-D-fe-ne,Z=3*(J-z),ue=3*(ee-J)-Z,me=pe-z-Z-ue,we,ge;if(I===0)we=E===0?D:E===1?j:((ae*E+ne)*E+fe)*E+D,ge=E===0?z:E===1?pe:((me*E+ue)*E+Z)*E+z;else{var Ae=1e-8,Ie=1-Ae;if(E<Ae?(we=fe,ge=Z):E>Ie?(we=3*(j-te),ge=3*(pe-ee)):(we=(3*ae*E+2*ne)*E+fe,ge=(3*me*E+2*ue)*E+Z),F){we===0&&ge===0&&(E<Ae||E>Ie)&&(we=te-U,ge=ee-J);var Oe=Math.sqrt(we*we+ge*ge);Oe&&(we/=Oe,ge/=Oe)}if(I===3){var te=6*ae*E+2*ne,ee=6*me*E+2*ue,qe=Math.pow(we*we+ge*ge,3/2);we=qe!==0?(we*ee-ge*te)/qe:0,ge=0}}return I===2?new _(ge,-we):new _(we,ge)}return{statics:{classify:function(x){var E=x[0],I=x[1],F=x[2],D=x[3],z=x[4],U=x[5],J=x[6],te=x[7],ee=E*(te-U)+I*(z-J)+J*U-te*z,j=F*(I-te)+D*(J-E)+E*te-I*J,pe=z*(D-I)+U*(E-F)+F*I-D*E,ie=3*pe,fe=ie-j,ne=fe-j+ee,ae=Math.sqrt(ne*ne+fe*fe+ie*ie),Z=ae!==0?1/ae:0,ue=M.isZero,me="serpentine";ne*=Z,fe*=Z,ie*=Z;function we(Oe,qe,Pe){var Fe=qe!==a,Ve=Fe&&qe>0&&qe<1,Ke=Fe&&Pe>0&&Pe<1;return Fe&&(!(Ve||Ke)||Oe==="loop"&&!(Ve&&Ke))&&(Oe="arch",Ve=Ke=!1),{type:Oe,roots:Ve||Ke?Ve&&Ke?qe<Pe?[qe,Pe]:[Pe,qe]:[Ve?qe:Pe]:null}}if(ue(ne))return ue(fe)?we(ue(ie)?"line":"quadratic"):we(me,ie/(3*fe));var ge=3*fe*fe-4*ne*ie;if(ue(ge))return we("cusp",fe/(2*ne));var Ae=ge>0?Math.sqrt(ge/3):Math.sqrt(-ge),Ie=2*ne;return we(ge>0?me:"loop",(fe+Ae)/Ie,(fe-Ae)/Ie)},getLength:function(x,E,I,F){if(E===a&&(E=0),I===a&&(I=1),le.isStraight(x)){var D=x;I<1&&(D=le.subdivide(D,I)[0],E/=I),E>0&&(D=le.subdivide(D,E)[1]);var z=D[6]-D[0],U=D[7]-D[1];return Math.sqrt(z*z+U*U)}return M.integrate(F||o(x),E,I,h(E,I))},getTimeAt:function(x,E,I){if(I===a&&(I=E<0?1:0),E===0)return I;var F=Math.abs,D=1e-12,z=E>0,U=z?I:0,J=z?1:I,te=o(x),ee=le.getLength(x,U,J,te),j=F(E)-ee;if(F(j)<D)return z?J:U;if(j>D)return null;var pe=E/ee,ie=0;function fe(ne){return ie+=M.integrate(te,I,ne,h(I,ne)),I=ne,ie-E}return M.findRoot(fe,te,I+pe,U,J,32,1e-12)},getPoint:function(x,E){return b(x,E,0,!1)},getTangent:function(x,E){return b(x,E,1,!0)},getWeightedTangent:function(x,E){return b(x,E,1,!1)},getNormal:function(x,E){return b(x,E,2,!0)},getWeightedNormal:function(x,E){return b(x,E,2,!1)},getCurvature:function(x,E){return b(x,E,3,!1).x},getPeaks:function(x){var E=x[0],I=x[1],F=x[2],D=x[3],z=x[4],U=x[5],J=x[6],te=x[7],ee=-E+3*F-3*z+J,j=3*E-6*F+3*z,pe=-3*E+3*F,ie=-I+3*D-3*U+te,fe=3*I-6*D+3*U,ne=-3*I+3*D,ae=1e-8,Z=1-ae,ue=[];return M.solveCubic(9*(ee*ee+ie*ie),9*(ee*j+fe*ie),2*(j*j+fe*fe)+3*(pe*ee+ne*ie),pe*j+fe*ne,ue,ae,Z),ue.sort()}}}},new function(){function o(j,pe,ie,fe,ne,ae,Z){var ue=!Z&&ie.getPrevious()===ne,me=!Z&&ie!==ne&&ie.getNext()===ne,we=1e-8,ge=1-we;if(fe!==null&&fe>=(ue?we:0)&&fe<=(me?ge:1)&&ae!==null&&ae>=(me?we:0)&&ae<=(ue?ge:1)){var Ae=new Ee(ie,fe,null,Z),Ie=new Ee(ne,ae,null,Z);Ae._intersection=Ie,Ie._intersection=Ae,(!pe||pe(Ae))&&Ee.insert(j,Ae,!0)}}function h(j,pe,ie,fe,ne,ae,Z,ue,me,we,ge,Ae,Ie){if(++me>=4096||++ue>=40)return me;var Oe=1e-9,qe=pe[0],Pe=pe[1],Fe=pe[6],Ve=pe[7],Ke=W.getSignedDistance,Xe=Ke(qe,Pe,Fe,Ve,pe[2],pe[3]),je=Ke(qe,Pe,Fe,Ve,pe[4],pe[5]),gt=Xe*je>0?3/4:4/9,xt=gt*Math.min(0,Xe,je),Mt=gt*Math.max(0,Xe,je),Bt=Ke(qe,Pe,Fe,Ve,j[0],j[1]),ot=Ke(qe,Pe,Fe,Ve,j[2],j[3]),ht=Ke(qe,Pe,Fe,Ve,j[4],j[5]),Tt=Ke(qe,Pe,Fe,Ve,j[6],j[7]),zt=b(Bt,ot,ht,Tt),Ft=zt[0],Zt=zt[1],rr,sr;if(Xe===0&&je===0&&Bt===0&&ot===0&&ht===0&&Tt===0||(rr=x(Ft,Zt,xt,Mt))==null||(sr=x(Ft.reverse(),Zt.reverse(),xt,Mt))==null)return me;var fr=we+(ge-we)*rr,ur=we+(ge-we)*sr;if(Math.max(Ie-Ae,ur-fr)<Oe){var ln=(fr+ur)/2,sn=(Ae+Ie)/2;o(ne,ae,Z?fe:ie,Z?sn:ln,Z?ie:fe,Z?ln:sn)}else{j=le.getPart(j,rr,sr);var gn=Ie-Ae;if(sr-rr>.8)if(ur-fr>gn){var Et=le.subdivide(j,.5),ln=(fr+ur)/2;me=h(pe,Et[0],fe,ie,ne,ae,!Z,ue,me,Ae,Ie,fr,ln),me=h(pe,Et[1],fe,ie,ne,ae,!Z,ue,me,Ae,Ie,ln,ur)}else{var Et=le.subdivide(pe,.5),sn=(Ae+Ie)/2;me=h(Et[0],j,fe,ie,ne,ae,!Z,ue,me,Ae,sn,fr,ur),me=h(Et[1],j,fe,ie,ne,ae,!Z,ue,me,sn,Ie,fr,ur)}else gn===0||gn>=Oe?me=h(pe,j,fe,ie,ne,ae,!Z,ue,me,Ae,Ie,fr,ur):me=h(j,pe,ie,fe,ne,ae,Z,ue,me,fr,ur,Ae,Ie)}return me}function b(j,pe,ie,fe){var ne=[0,j],ae=[1/3,pe],Z=[2/3,ie],ue=[1,fe],me=pe-(2*j+fe)/3,we=ie-(j+2*fe)/3,ge;if(me*we<0)ge=[[ne,ae,ue],[ne,Z,ue]];else{var Ae=me/we;ge=[Ae>=2?[ne,ae,ue]:Ae<=.5?[ne,Z,ue]:[ne,ae,Z,ue],[ne,ue]]}return(me||we)<0?ge.reverse():ge}function x(j,pe,ie,fe){return j[0][1]<ie?E(j,!0,ie):pe[0][1]>fe?E(pe,!1,fe):j[0][0]}function E(j,pe,ie){for(var fe=j[0][0],ne=j[0][1],ae=1,Z=j.length;ae<Z;ae++){var ue=j[ae][0],me=j[ae][1];if(pe?me>=ie:me<=ie)return me===ie?ue:fe+(ie-ne)*(ue-fe)/(me-ne);fe=ue,ne=me}return null}function I(j,pe,ie,fe,ne){var ae=M.isZero;if(ae(fe)&&ae(ne)){var Z=le.getTimeOf(j,new _(pe,ie));return Z===null?[]:[Z]}for(var ue=Math.atan2(-ne,fe),me=Math.sin(ue),we=Math.cos(ue),ge=[],Ae=[],Ie=0;Ie<8;Ie+=2){var Oe=j[Ie]-pe,qe=j[Ie+1]-ie;ge.push(Oe*we-qe*me,Oe*me+qe*we)}return le.solveCubic(ge,1,0,Ae,0,1),Ae}function F(j,pe,ie,fe,ne,ae,Z){for(var ue=pe[0],me=pe[1],we=pe[6],ge=pe[7],Ae=I(j,ue,me,we-ue,ge-me),Ie=0,Oe=Ae.length;Ie<Oe;Ie++){var qe=Ae[Ie],Pe=le.getPoint(j,qe),Fe=le.getTimeOf(pe,Pe);Fe!==null&&o(ne,ae,Z?fe:ie,Z?Fe:qe,Z?ie:fe,Z?qe:Fe)}}function D(j,pe,ie,fe,ne,ae){var Z=W.intersect(j[0],j[1],j[6],j[7],pe[0],pe[1],pe[6],pe[7]);Z&&o(ne,ae,ie,le.getTimeOf(j,Z),fe,le.getTimeOf(pe,Z))}function z(j,pe,ie,fe,ne,ae){var Z=1e-12,ue=Math.min,me=Math.max;if(me(j[0],j[2],j[4],j[6])+Z>ue(pe[0],pe[2],pe[4],pe[6])&&ue(j[0],j[2],j[4],j[6])-Z<me(pe[0],pe[2],pe[4],pe[6])&&me(j[1],j[3],j[5],j[7])+Z>ue(pe[1],pe[3],pe[5],pe[7])&&ue(j[1],j[3],j[5],j[7])-Z<me(pe[1],pe[3],pe[5],pe[7])){var we=te(j,pe);if(we)for(var ge=0;ge<2;ge++){var Ae=we[ge];o(ne,ae,ie,Ae[0],fe,Ae[1],!0)}else{var Ie=le.isStraight(j),Oe=le.isStraight(pe),qe=Ie&&Oe,Pe=Ie&&!Oe,Fe=ne.length;if((qe?D:Ie||Oe?F:h)(Pe?pe:j,Pe?j:pe,Pe?fe:ie,Pe?ie:fe,ne,ae,Pe,0,0,0,1,0,1),!qe||ne.length===Fe)for(var ge=0;ge<4;ge++){var Ve=ge>>1,Ke=ge&1,Xe=Ve*6,je=Ke*6,gt=new _(j[Xe],j[Xe+1]),xt=new _(pe[je],pe[je+1]);gt.isClose(xt,Z)&&o(ne,ae,ie,Ve,fe,Ke)}}}return ne}function U(j,pe,ie,fe){var ne=le.classify(j);if(ne.type==="loop"){var ae=ne.roots;o(ie,fe,pe,ae[0],pe,ae[1])}return ie}function J(j,pe,ie,fe,ne,ae){var Z=1e-7,ue=!pe;ue&&(pe=j);for(var me=j.length,we=pe.length,ge=new Array(me),Ae=ue?ge:new Array(we),Ie=[],Oe=0;Oe<me;Oe++)ge[Oe]=j[Oe].getValues(fe);if(!ue)for(var Oe=0;Oe<we;Oe++)Ae[Oe]=pe[Oe].getValues(ne);for(var qe=S.findCurveBoundsCollisions(ge,Ae,Z),Pe=0;Pe<me;Pe++){var Fe=j[Pe],Ve=ge[Pe];ue&&U(Ve,Fe,Ie,ie);var Ke=qe[Pe];if(Ke)for(var Xe=0;Xe<Ke.length;Xe++){if(ae&&Ie.length)return Ie;var je=Ke[Xe];if(!ue||je>Pe){var gt=pe[je],xt=Ae[je];z(Ve,xt,Fe,gt,Ie,ie)}}}return Ie}function te(j,pe){function ie(Tt){var zt=Tt[6]-Tt[0],Ft=Tt[7]-Tt[1];return zt*zt+Ft*Ft}var fe=Math.abs,ne=W.getDistance,ae=1e-8,Z=1e-7,ue=le.isStraight(j),me=le.isStraight(pe),we=ue&&me,ge=ie(j)<ie(pe),Ae=ge?pe:j,Ie=ge?j:pe,Oe=Ae[0],qe=Ae[1],Pe=Ae[6]-Oe,Fe=Ae[7]-qe;if(ne(Oe,qe,Pe,Fe,Ie[0],Ie[1],!0)<Z&&ne(Oe,qe,Pe,Fe,Ie[6],Ie[7],!0)<Z)!we&&ne(Oe,qe,Pe,Fe,Ae[2],Ae[3],!0)<Z&&ne(Oe,qe,Pe,Fe,Ae[4],Ae[5],!0)<Z&&ne(Oe,qe,Pe,Fe,Ie[2],Ie[3],!0)<Z&&ne(Oe,qe,Pe,Fe,Ie[4],Ie[5],!0)<Z&&(ue=me=we=!0);else if(we)return null;if(ue^me)return null;for(var Ve=[j,pe],Ke=[],Xe=0;Xe<4&&Ke.length<2;Xe++){var je=Xe&1,gt=je^1,xt=Xe>>1,Mt=le.getTimeOf(Ve[je],new _(Ve[gt][xt?6:0],Ve[gt][xt?7:1]));if(Mt!=null){var Bt=je?[xt,Mt]:[Mt,xt];(!Ke.length||fe(Bt[0]-Ke[0][0])>ae&&fe(Bt[1]-Ke[0][1])>ae)&&Ke.push(Bt)}if(Xe>2&&!Ke.length)break}if(Ke.length!==2)Ke=null;else if(!we){var ot=le.getPart(j,Ke[0][0],Ke[1][0]),ht=le.getPart(pe,Ke[0][1],Ke[1][1]);(fe(ht[2]-ot[2])>Z||fe(ht[3]-ot[3])>Z||fe(ht[4]-ot[4])>Z||fe(ht[5]-ot[5])>Z)&&(Ke=null)}return Ke}function ee(j,pe){var ie=j[0],fe=j[1],ne=j[2],ae=j[3],Z=j[4],ue=j[5],me=j[6],we=j[7],ge=pe.normalize(),Ae=ge.x,Ie=ge.y,Oe=3*me-9*Z+9*ne-3*ie,qe=3*we-9*ue+9*ae-3*fe,Pe=6*Z-12*ne+6*ie,Fe=6*ue-12*ae+6*fe,Ve=3*ne-3*ie,Ke=3*ae-3*fe,Xe=2*Oe*Ie-2*qe*Ae,je=[];if(Math.abs(Xe)<M.CURVETIME_EPSILON){var gt=Oe*Ke-qe*Ve,Xe=Oe*Fe-qe*Pe;if(Xe!=0){var xt=-gt/Xe;xt>=0&&xt<=1&&je.push(xt)}}else{var Mt=(Pe*Pe-4*Oe*Ve)*Ie*Ie+(-2*Pe*Fe+4*qe*Ve+4*Oe*Ke)*Ae*Ie+(Fe*Fe-4*qe*Ke)*Ae*Ae,Bt=Pe*Ie-Fe*Ae;if(Mt>=0&&Xe!=0){var ot=Math.sqrt(Mt),ht=-(Bt+ot)/Xe,Tt=(-Bt+ot)/Xe;ht>=0&&ht<=1&&je.push(ht),Tt>=0&&Tt<=1&&je.push(Tt)}}return je}return{getIntersections:function(j){var pe=this.getValues(),ie=j&&j!==this&&j.getValues();return ie?z(pe,ie,this,j,[]):U(pe,this,[])},statics:{getOverlaps:te,getIntersections:J,getCurveLineIntersections:I,getTimesWithTangent:ee}}}),Ee=c.extend({_class:"CurveLocation",initialize:function(h,b,x,E,I){if(b>=.99999999){var F=h.getNext();F&&(b=0,h=F)}this._setCurve(h),this._time=b,this._point=x||h.getPointAtTime(b),this._overlap=E,this._distance=I,this._intersection=this._next=this._previous=null},_setPath:function(o){this._path=o,this._version=o?o._version:0},_setCurve:function(o){this._setPath(o._path),this._curve=o,this._segment=null,this._segment1=o._segment1,this._segment2=o._segment2},_setSegment:function(o){var h=o.getCurve();h?this._setCurve(h):(this._setPath(o._path),this._segment1=o,this._segment2=null),this._segment=o,this._time=o===this._segment1?0:1,this._point=o._point.clone()},getSegment:function(){var o=this._segment;if(!o){var h=this.getCurve(),b=this.getTime();b===0?o=h._segment1:b===1?o=h._segment2:b!=null&&(o=h.getPartLength(0,b)<h.getPartLength(b,1)?h._segment1:h._segment2),this._segment=o}return o},getCurve:function(){var o=this._path,h=this;o&&o._version!==this._version&&(this._time=this._offset=this._curveOffset=this._curve=null);function b(x){var E=x&&x.getCurve();if(E&&(h._time=E.getTimeOf(h._point))!=null)return h._setCurve(E),E}return this._curve||b(this._segment)||b(this._segment1)||b(this._segment2.getPrevious())},getPath:function(){var o=this.getCurve();return o&&o._path},getIndex:function(){var o=this.getCurve();return o&&o.getIndex()},getTime:function(){var o=this.getCurve(),h=this._time;return o&&h==null?this._time=o.getTimeOf(this._point):h},getParameter:"#getTime",getPoint:function(){return this._point},getOffset:function(){var o=this._offset;if(o==null){o=0;var h=this.getPath(),b=this.getIndex();if(h&&b!=null)for(var x=h.getCurves(),E=0;E<b;E++)o+=x[E].getLength();this._offset=o+=this.getCurveOffset()}return o},getCurveOffset:function(){var o=this._curveOffset;if(o==null){var h=this.getCurve(),b=this.getTime();this._curveOffset=o=b!=null&&h&&h.getPartLength(0,b)}return o},getIntersection:function(){return this._intersection},getDistance:function(){return this._distance},divide:function(){var o=this.getCurve(),h=o&&o.divideAtTime(this.getTime());return h&&this._setSegment(h._segment1),h},split:function(){var o=this.getCurve(),h=o._path,b=o&&o.splitAtTime(this.getTime());return b&&this._setSegment(h.getLastSegment()),b},equals:function(o,h){var b=this===o;if(!b&&o instanceof Ee){var x=this.getCurve(),E=o.getCurve(),I=x._path,F=E._path;if(I===F){var D=Math.abs,z=1e-7,U=D(this.getOffset()-o.getOffset()),J=!h&&this._intersection,te=!h&&o._intersection;b=(U<z||I&&D(I.getLength()-U)<z)&&(!J&&!te||J&&te&&J.equals(te,!0))}}return b},toString:function(){var o=[],h=this.getPoint(),b=A.instance;h&&o.push("point: "+h);var x=this.getIndex();x!=null&&o.push("index: "+x);var E=this.getTime();return E!=null&&o.push("time: "+b.number(E)),this._distance!=null&&o.push("distance: "+b.number(this._distance)),"{ "+o.join(", ")+" }"},isTouching:function(){var o=this._intersection;if(o&&this.getTangent().isCollinear(o.getTangent())){var h=this.getCurve(),b=o.getCurve();return!(h.isStraight()&&b.isStraight()&&h.getLine().intersect(b.getLine()))}return!1},isCrossing:function(){var o=this._intersection;if(!o)return!1;var h=this.getTime(),b=o.getTime(),x=1e-8,E=1-x,I=h>=x&&h<=E,F=b>=x&&b<=E;if(I&&F)return!this.isTouching();var D=this.getCurve(),z=D&&h<x?D.getPrevious():D,U=o.getCurve(),J=U&&b<x?U.getPrevious():U;if(h>E&&(D=D.getNext()),b>E&&(U=U.getNext()),!z||!D||!J||!U)return!1;var te=[];function ee(Ae,Ie){var Oe=Ae.getValues(),qe=le.classify(Oe).roots||le.getPeaks(Oe),Pe=qe.length,Fe=le.getLength(Oe,Ie&&Pe?qe[Pe-1]:0,!Ie&&Pe?qe[0]:1);te.push(Pe?Fe:Fe/32)}function j(Ae,Ie,Oe){return Ie<Oe?Ae>Ie&&Ae<Oe:Ae>Ie||Ae<Oe}I||(ee(z,!0),ee(D,!1)),F||(ee(J,!0),ee(U,!1));var pe=this.getPoint(),ie=Math.min.apply(Math,te),fe=I?D.getTangentAtTime(h):D.getPointAt(ie).subtract(pe),ne=I?fe.negate():z.getPointAt(-ie).subtract(pe),ae=F?U.getTangentAtTime(b):U.getPointAt(ie).subtract(pe),Z=F?ae.negate():J.getPointAt(-ie).subtract(pe),ue=ne.getAngle(),me=fe.getAngle(),we=Z.getAngle(),ge=ae.getAngle();return!!(I?j(ue,we,ge)^j(me,we,ge)&&j(ue,ge,we)^j(me,ge,we):j(we,ue,me)^j(ge,ue,me)&&j(we,me,ue)^j(ge,me,ue))},hasOverlap:function(){return!!this._overlap}},c.each(le._evaluateMethods,function(o){var h=o+"At";this[o]=function(){var b=this.getCurve(),x=this.getTime();return x!=null&&b&&b[h](x,!0)}},{preserve:!0}),new function(){function o(h,b,x){var E=h.length,I=0,F=E-1;function D(pe,ie){for(var fe=pe+ie;fe>=-1&&fe<=E;fe+=ie){var ne=h[(fe%E+E)%E];if(!b.getPoint().isClose(ne.getPoint(),1e-7))break;if(b.equals(ne))return ne}return null}for(;I<=F;){var z=I+F>>>1,U=h[z],J;if(x&&(J=b.equals(U)?U:D(z,-1)||D(z,1)))return b._overlap&&(J._overlap=J._intersection._overlap=!0),J;var te=b.getPath(),ee=U.getPath(),j=te!==ee?te._id-ee._id:b.getIndex()+b.getTime()-(U.getIndex()+U.getTime());j<0?F=z-1:I=z+1}return h.splice(I,0,b),b}return{statics:{insert:o,expand:function(h){for(var b=h.slice(),x=h.length-1;x>=0;x--)o(b,h[x]._intersection,!1);return b}}}}),Me=R.extend({_class:"PathItem",_selectBounds:!1,_canScaleStroke:!0,beans:!0,initialize:function(){},statics:{create:function(o){var h,b,x;if(c.isPlainObject(o)?(b=o.segments,h=o.pathData):Array.isArray(o)?b=o:typeof o=="string"&&(h=o),b){var E=b[0];x=E&&Array.isArray(E[0])}else h&&(x=(h.match(/m/gi)||[]).length>1||/z\s*\S+/i.test(h));var I=x?Y:H;return new I(o)}},_asPathItem:function(){return this},isClockwise:function(){return this.getArea()>=0},setClockwise:function(o){this.isClockwise()!=(o=!!o)&&this.reverse()},setPathData:function(o){var h=o&&o.match(/[mlhvcsqtaz][^mlhvcsqtaz]*/ig),b,x=!1,E,I,F=new _,D=new _;function z(Z,ue){var me=+b[Z];return x&&(me+=F[ue]),me}function U(Z){return new _(z(Z,"x"),z(Z+1,"y"))}this.clear();for(var J=0,te=h&&h.length;J<te;J++){var ee=h[J],j=ee[0],pe=j.toLowerCase();b=ee.match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g);var ie=b&&b.length;switch(x=j===pe,E==="z"&&!/[mz]/.test(pe)&&this.moveTo(F),pe){case"m":case"l":for(var fe=pe==="m",ne=0;ne<ie;ne+=2)this[fe?"moveTo":"lineTo"](F=U(ne)),fe&&(D=F,fe=!1);I=F;break;case"h":case"v":var ae=pe==="h"?"x":"y";F=F.clone();for(var ne=0;ne<ie;ne++)F[ae]=z(ne,ae),this.lineTo(F);I=F;break;case"c":for(var ne=0;ne<ie;ne+=6)this.cubicCurveTo(U(ne),I=U(ne+2),F=U(ne+4));break;case"s":for(var ne=0;ne<ie;ne+=4)this.cubicCurveTo(/[cs]/.test(E)?F.multiply(2).subtract(I):F,I=U(ne),F=U(ne+2)),E=pe;break;case"q":for(var ne=0;ne<ie;ne+=4)this.quadraticCurveTo(I=U(ne),F=U(ne+2));break;case"t":for(var ne=0;ne<ie;ne+=2)this.quadraticCurveTo(I=/[qt]/.test(E)?F.multiply(2).subtract(I):F,F=U(ne)),E=pe;break;case"a":for(var ne=0;ne<ie;ne+=7)this.arcTo(F=U(ne+5),new m(+b[ne],+b[ne+1]),+b[ne+2],+b[ne+4],+b[ne+3]);break;case"z":this.closePath(1e-12),F=D;break}E=pe}},_canComposite:function(){return!(this.hasFill()&&this.hasStroke())},_contains:function(o){var h=o.isInside(this.getBounds({internal:!0,handle:!0}))?this._getWinding(o):{};return h.onPath||!!(this.getFillRule()==="evenodd"?h.windingL&1||h.windingR&1:h.winding)},getIntersections:function(o,h,b,x){var E=this===o||!o,I=this._matrix._orNullIfIdentity(),F=E?I:(b||o._matrix)._orNullIfIdentity();return E||this.getBounds(I).intersects(o.getBounds(F),1e-12)?le.getIntersections(this.getCurves(),!E&&o.getCurves(),h,I,F,x):[]},getCrossings:function(o){return this.getIntersections(o,function(h){return h.isCrossing()})},getNearestLocation:function(){for(var o=_.read(arguments),h=this.getCurves(),b=1/0,x=null,E=0,I=h.length;E<I;E++){var F=h[E].getNearestLocation(o);F._distance<b&&(b=F._distance,x=F)}return x},getNearestPoint:function(){var o=this.getNearestLocation.apply(this,arguments);return o&&o.getPoint()},interpolate:function(o,h,b){var x=!this._children,E=x?"_segments":"_children",I=o[E],F=h[E],D=this[E];if(!I||!F||I.length!==F.length)throw new Error("Invalid operands in interpolate() call: "+o+", "+h);var z=D.length,U=F.length;if(z<U)for(var J=x?K:H,te=z;te<U;te++)this.add(new J);else z>U&&this[x?"removeSegments":"removeChildren"](U,z);for(var te=0;te<U;te++)D[te].interpolate(I[te],F[te],b);x&&(this.setClosed(o._closed),this._changed(9))},compare:function(o){var h=!1;if(o){var b=this._children||[this],x=o._children?o._children.slice():[o],E=b.length,I=x.length,F=[],D=0;h=!0;for(var z=S.findItemBoundsCollisions(b,x,M.GEOMETRIC_EPSILON),U=E-1;U>=0&&h;U--){var J=b[U];h=!1;var te=z[U];if(te)for(var ee=te.length-1;ee>=0&&!h;ee--)J.compare(x[te[ee]])&&(F[te[ee]]||(F[te[ee]]=!0,D++),h=!0)}h=h&&D===I}return h}}),H=Me.extend({_class:"Path",_serializeFields:{segments:[],closed:!1},initialize:function(h){this._closed=!1,this._segments=[],this._version=0;var b=arguments,x=Array.isArray(h)?typeof h[0]=="object"?h:b:h&&h.size===a&&(h.x!==a||h.point!==a)?b:null;x&&x.length>0?this.setSegments(x):(this._curves=a,this._segmentSelection=0,!x&&typeof h=="string"&&(this.setPathData(h),h=null)),this._initialize(!x&&h)},_equals:function(o){return this._closed===o._closed&&c.equals(this._segments,o._segments)},copyContent:function(o){this.setSegments(o._segments),this._closed=o._closed},_changed:function o(h){if(o.base.call(this,h),h&8){if(this._length=this._area=a,h&32)this._version++;else if(this._curves)for(var b=0,x=this._curves.length;b<x;b++)this._curves[b]._changed()}else h&64&&(this._bounds=a)},getStyle:function(){var o=this._parent;return(o instanceof Y?o:this)._style},getSegments:function(){return this._segments},setSegments:function(o){var h=this.isFullySelected(),b=o&&o.length;if(this._segments.length=0,this._segmentSelection=0,this._curves=a,b){var x=o[b-1];typeof x=="boolean"&&(this.setClosed(x),b--),this._add(K.readList(o,0,{},b))}h&&this.setFullySelected(!0)},getFirstSegment:function(){return this._segments[0]},getLastSegment:function(){return this._segments[this._segments.length-1]},getCurves:function(){var o=this._curves,h=this._segments;if(!o){var b=this._countCurves();o=this._curves=new Array(b);for(var x=0;x<b;x++)o[x]=new le(this,h[x],h[x+1]||h[0])}return o},getFirstCurve:function(){return this.getCurves()[0]},getLastCurve:function(){var o=this.getCurves();return o[o.length-1]},isClosed:function(){return this._closed},setClosed:function(o){if(this._closed!=(o=!!o)){if(this._closed=o,this._curves){var h=this._curves.length=this._countCurves();o&&(this._curves[h-1]=new le(this,this._segments[h-1],this._segments[0]))}this._changed(41)}}},{beans:!0,getPathData:function(o,h){var b=this._segments,x=b.length,E=new A(h),I=new Array(6),F=!0,D,z,U,J,te,ee,j,pe,ie=[];function fe(ae,Z){if(ae._transformCoordinates(o,I),D=I[0],z=I[1],F)ie.push("M"+E.pair(D,z)),F=!1;else if(te=I[2],ee=I[3],te===D&&ee===z&&j===U&&pe===J){if(!Z){var ue=D-U,me=z-J;ie.push(ue===0?"v"+E.number(me):me===0?"h"+E.number(ue):"l"+E.pair(ue,me))}}else ie.push("c"+E.pair(j-U,pe-J)+" "+E.pair(te-U,ee-J)+" "+E.pair(D-U,z-J));U=D,J=z,j=I[4],pe=I[5]}if(!x)return"";for(var ne=0;ne<x;ne++)fe(b[ne]);return this._closed&&x>0&&(fe(b[0],!0),ie.push("z")),ie.join("")},isEmpty:function(){return!this._segments.length},_transformContent:function(o){for(var h=this._segments,b=new Array(6),x=0,E=h.length;x<E;x++)h[x]._transformCoordinates(o,b,!0);return!0},_add:function(o,F){for(var b=this._segments,x=this._curves,E=o.length,I=F==null,F=I?b.length:F,D=0;D<E;D++){var z=o[D];z._path&&(z=o[D]=z.clone()),z._path=this,z._index=F+D,z._selection&&this._updateSelection(z,0,z._selection)}if(I)c.push(b,o);else{b.splice.apply(b,[F,0].concat(o));for(var D=F+E,U=b.length;D<U;D++)b[D]._index=D}if(x){var J=this._countCurves(),te=F>0&&F+E-1===J?F-1:F,ee=te,j=Math.min(te+E,J);o._curves&&(x.splice.apply(x,[te,0].concat(o._curves)),ee+=o._curves.length);for(var D=ee;D<j;D++)x.splice(D,0,new le(this,null,null));this._adjustCurves(te,j)}return this._changed(41),o},_adjustCurves:function(o,h){for(var b=this._segments,x=this._curves,E,I=o;I<h;I++)E=x[I],E._path=this,E._segment1=b[I],E._segment2=b[I+1]||b[0],E._changed();(E=x[this._closed&&!o?b.length-1:o-1])&&(E._segment2=b[o]||b[0],E._changed()),(E=x[h])&&(E._segment1=b[h],E._changed())},_countCurves:function(){var o=this._segments.length;return!this._closed&&o>0?o-1:o},add:function(o){var h=arguments;return h.length>1&&typeof o!="number"?this._add(K.readList(h)):this._add([K.read(h)])[0]},insert:function(o,h){var b=arguments;return b.length>2&&typeof h!="number"?this._add(K.readList(b,1),o):this._add([K.read(b,1)],o)[0]},addSegment:function(){return this._add([K.read(arguments)])[0]},insertSegment:function(o){return this._add([K.read(arguments,1)],o)[0]},addSegments:function(o){return this._add(K.readList(o))},insertSegments:function(o,h){return this._add(K.readList(h),o)},removeSegment:function(o){return this.removeSegments(o,o+1)[0]||null},removeSegments:function(o,h,b){o=o||0,h=c.pick(h,this._segments.length);var x=this._segments,E=this._curves,I=x.length,F=x.splice(o,h-o),D=F.length;if(!D)return F;for(var z=0;z<D;z++){var U=F[z];U._selection&&this._updateSelection(U,U._selection,0),U._index=U._path=null}for(var z=o,J=x.length;z<J;z++)x[z]._index=z;if(E){for(var te=o>0&&h===I+(this._closed?1:0)?o-1:o,E=E.splice(te,D),z=E.length-1;z>=0;z--)E[z]._path=null;b&&(F._curves=E.slice(1)),this._adjustCurves(te,te)}return this._changed(41),F},clear:"#removeSegments",hasHandles:function(){for(var o=this._segments,h=0,b=o.length;h<b;h++)if(o[h].hasHandles())return!0;return!1},clearHandles:function(){for(var o=this._segments,h=0,b=o.length;h<b;h++)o[h].clearHandles()},getLength:function(){if(this._length==null){for(var o=this.getCurves(),h=0,b=0,x=o.length;b<x;b++)h+=o[b].getLength();this._length=h}return this._length},getArea:function(){var o=this._area;if(o==null){var h=this._segments,b=this._closed;o=0;for(var x=0,E=h.length;x<E;x++){var I=x+1===E;o+=le.getArea(le.getValues(h[x],h[I?0:x+1],null,I&&!b))}this._area=o}return o},isFullySelected:function(){var o=this._segments.length;return this.isSelected()&&o>0&&this._segmentSelection===o*7},setFullySelected:function(o){o&&this._selectSegments(!0),this.setSelected(o)},setSelection:function o(h){h&1||this._selectSegments(!1),o.base.call(this,h)},_selectSegments:function(o){var h=this._segments,b=h.length,x=o?7:0;this._segmentSelection=x*b;for(var E=0;E<b;E++)h[E]._selection=x},_updateSelection:function(o,h,b){o._selection=b;var x=this._segmentSelection+=b-h;x>0&&this.setSelected(!0)},divideAt:function(o){var h=this.getLocationAt(o),b;return h&&(b=h.getCurve().divideAt(h.getCurveOffset()))?b._segment1:null},splitAt:function(o){var h=this.getLocationAt(o),b=h&&h.index,x=h&&h.time,E=1e-8,I=1-E;x>I&&(b++,x=0);var F=this.getCurves();if(b>=0&&b<F.length){x>=E&&F[b++].divideAtTime(x);var D=this.removeSegments(b,this._segments.length,!0),z;return this._closed?(this.setClosed(!1),z=this):(z=new H(R.NO_INSERT),z.insertAbove(this),z.copyAttributes(this)),z._add(D,0),this.addSegment(D[0]),z}return null},split:function(o,h){var b,x=h===a?o:(b=this.getCurves()[o])&&b.getLocationAtTime(h);return x!=null?this.splitAt(x):null},join:function(o,h){var b=h||0;if(o&&o!==this){var x=o._segments,E=this.getLastSegment(),I=o.getLastSegment();if(!I)return this;E&&E._point.isClose(I._point,b)&&o.reverse();var F=o.getFirstSegment();if(E&&E._point.isClose(F._point,b))E.setHandleOut(F._handleOut),this._add(x.slice(1));else{var D=this.getFirstSegment();D&&D._point.isClose(F._point,b)&&o.reverse(),I=o.getLastSegment(),D&&D._point.isClose(I._point,b)?(D.setHandleIn(I._handleIn),this._add(x.slice(0,x.length-1),0)):this._add(x.slice())}o._closed&&this._add([x[0]]),o.remove()}var z=this.getFirstSegment(),U=this.getLastSegment();return z!==U&&z._point.isClose(U._point,b)&&(z.setHandleIn(U._handleIn),U.remove(),this.setClosed(!0)),this},reduce:function(o){for(var h=this.getCurves(),b=o&&o.simplify,x=b?1e-7:0,E=h.length-1;E>=0;E--){var I=h[E];!I.hasHandles()&&(!I.hasLength(x)||b&&I.isCollinear(I.getNext()))&&I.remove()}return this},reverse:function(){this._segments.reverse();for(var o=0,h=this._segments.length;o<h;o++){var b=this._segments[o],x=b._handleIn;b._handleIn=b._handleOut,b._handleOut=x,b._index=o}this._curves=null,this._changed(9)},flatten:function(o){for(var h=new X(this,o||.25,256,!0),b=h.parts,x=b.length,E=[],I=0;I<x;I++)E.push(new K(b[I].curve.slice(0,2)));!this._closed&&x>0&&E.push(new K(b[x-1].curve.slice(6))),this.setSegments(E)},simplify:function(o){var h=new xe(this).fit(o||2.5);return h&&this.setSegments(h),!!h},smooth:function(o){var h=this,b=o||{},x=b.type||"asymmetric",E=this._segments,I=E.length,F=this._closed;function D(Ft,Zt){var rr=Ft&&Ft.index;if(rr!=null){var sr=Ft.path;if(sr&&sr!==h)throw new Error(Ft._class+" "+rr+" of "+sr+" is not part of "+h);Zt&&Ft instanceof le&&rr++}else rr=typeof Ft=="number"?Ft:Zt;return Math.min(rr<0&&F?rr%I:rr<0?rr+I:rr,I-1)}var z=F&&b.from===a&&b.to===a,U=D(b.from,0),J=D(b.to,I-1);if(U>J)if(F)U-=I;else{var te=U;U=J,J=te}if(/^(?:asymmetric|continuous)$/.test(x)){var ee=x==="asymmetric",j=Math.min,pe=J-U+1,ie=pe-1,fe=z?j(pe,4):1,ne=fe,ae=fe,Z=[];if(F||(ne=j(1,U),ae=j(1,I-J-1)),ie+=ne+ae,ie<=1)return;for(var ue=0,me=U-ne;ue<=ie;ue++,me++)Z[ue]=E[(me<0?me+I:me)%I]._point;for(var we=Z[0]._x+2*Z[1]._x,ge=Z[0]._y+2*Z[1]._y,Ae=2,Ie=ie-1,Oe=[we],qe=[ge],Pe=[Ae],Fe=[],Ve=[],ue=1;ue<ie;ue++){var Ke=ue<Ie,Xe=Ke||ee?1:2,je=Ke?4:ee?2:7,gt=Ke?4:ee?3:8,xt=Ke?2:ee?0:1,Mt=Xe/Ae;Ae=Pe[ue]=je-Mt,we=Oe[ue]=gt*Z[ue]._x+xt*Z[ue+1]._x-Mt*we,ge=qe[ue]=gt*Z[ue]._y+xt*Z[ue+1]._y-Mt*ge}Fe[Ie]=Oe[Ie]/Pe[Ie],Ve[Ie]=qe[Ie]/Pe[Ie];for(var ue=ie-2;ue>=0;ue--)Fe[ue]=(Oe[ue]-Fe[ue+1])/Pe[ue],Ve[ue]=(qe[ue]-Ve[ue+1])/Pe[ue];Fe[ie]=(3*Z[ie]._x-Fe[Ie])/2,Ve[ie]=(3*Z[ie]._y-Ve[Ie])/2;for(var ue=ne,Bt=ie-ae,me=U;ue<=Bt;ue++,me++){var ot=E[me<0?me+I:me],ht=ot._point,Tt=Fe[ue]-ht._x,zt=Ve[ue]-ht._y;(z||ue<Bt)&&ot.setHandleOut(Tt,zt),(z||ue>ne)&&ot.setHandleIn(-Tt,-zt)}}else for(var ue=U;ue<=J;ue++)E[ue<0?ue+I:ue].smooth(b,!z&&ue===U,!z&&ue===J)},toShape:function(o){if(!this._closed)return null;var h=this._segments,b,x,E,I;function F(ee,j){var pe=h[ee],ie=pe.getNext(),fe=h[j],ne=fe.getNext();return pe._handleOut.isZero()&&ie._handleIn.isZero()&&fe._handleOut.isZero()&&ne._handleIn.isZero()&&ie._point.subtract(pe._point).isCollinear(ne._point.subtract(fe._point))}function D(ee){var j=h[ee],pe=j.getPrevious(),ie=j.getNext();return pe._handleOut.isZero()&&j._handleIn.isZero()&&j._handleOut.isZero()&&ie._handleIn.isZero()&&j._point.subtract(pe._point).isOrthogonal(ie._point.subtract(j._point))}function z(ee){var j=h[ee],pe=j.getNext(),ie=j._handleOut,fe=pe._handleIn,ne=.5522847498307936;if(ie.isOrthogonal(fe)){var ae=j._point,Z=pe._point,ue=new W(ae,ie,!0).intersect(new W(Z,fe,!0),!0);return ue&&M.isZero(ie.getLength()/ue.subtract(ae).getLength()-ne)&&M.isZero(fe.getLength()/ue.subtract(Z).getLength()-ne)}return!1}function U(ee,j){return h[ee]._point.getDistance(h[j]._point)}if(!this.hasHandles()&&h.length===4&&F(0,2)&&F(1,3)&&D(1)?(b=se.Rectangle,x=new m(U(0,3),U(0,1)),I=h[1]._point.add(h[2]._point).divide(2)):h.length===8&&z(0)&&z(2)&&z(4)&&z(6)&&F(1,5)&&F(3,7)?(b=se.Rectangle,x=new m(U(1,6),U(0,3)),E=x.subtract(new m(U(0,7),U(1,2))).divide(2),I=h[3]._point.add(h[4]._point).divide(2)):h.length===4&&z(0)&&z(1)&&z(2)&&z(3)&&(M.isZero(U(0,2)-U(1,3))?(b=se.Circle,E=U(0,2)/2):(b=se.Ellipse,E=new m(U(2,0)/2,U(3,1)/2)),I=h[1]._point),b){var J=this.getPosition(!0),te=new b({center:J,size:x,radius:E,insert:!1});return te.copyAttributes(this,!0),te._matrix.prepend(this._matrix),te.rotate(I.subtract(J).getAngle()+90),(o===a||o)&&te.insertAbove(this),te}return null},toPath:"#clone",compare:function o(h){if(!h||h instanceof Y)return o.base.call(this,h);var b=this.getCurves(),x=h.getCurves(),E=b.length,I=x.length;if(!E||!I)return E==I;for(var F=b[0].getValues(),D=[],z=0,U,J=0,te,ee=0;ee<I;ee++){var fe=x[ee].getValues();D.push(fe);var j=le.getOverlaps(F,fe);if(j){U=!ee&&j[0][0]>0?I-1:ee,te=j[0][1];break}}for(var pe=Math.abs,ie=1e-8,fe=D[U],ne;F&&fe;){var j=le.getOverlaps(F,fe);if(j){var ae=j[0][0];if(pe(ae-J)<ie){J=j[1][0],J===1&&(F=++z<E?b[z].getValues():null,J=0);var Z=j[0][1];if(pe(Z-te)<ie){if(ne||(ne=[U,Z]),te=j[1][1],te===1&&(++U>=I&&(U=0),fe=D[U]||x[U].getValues(),te=0),!F)return ne[0]===U&&ne[1]===te;continue}}}break}return!1},_hitTestSelf:function(o,h,b,x){var E=this,I=this.getStyle(),F=this._segments,D=F.length,z=this._closed,U=h._tolerancePadding,J=U,te,ee,j,pe,ie,fe,ne=h.stroke&&I.hasStroke(),ae=h.fill&&I.hasFill(),Z=h.curves,ue=ne?I.getStrokeWidth()/2:ae&&h.tolerance>0||Z?0:null;ue!==null&&(ue>0?(te=I.getStrokeJoin(),ee=I.getStrokeCap(),j=I.getMiterLimit(),J=J.add(H._getStrokePadding(ue,x))):te=ee="round");function me(Fe,Ve){return o.subtract(Fe).divide(Ve).length<=1}function we(Fe,Ve,Ke){if(!h.selected||Ve.isSelected()){var Xe=Fe._point;if(Ve!==Xe&&(Ve=Ve.add(Xe)),me(Ve,J))return new de(Ke,E,{segment:Fe,point:Ve})}}function ge(Fe,Ve){return(Ve||h.segments)&&we(Fe,Fe._point,"segment")||!Ve&&h.handles&&(we(Fe,Fe._handleIn,"handle-in")||we(Fe,Fe._handleOut,"handle-out"))}function Ae(Fe){pe.add(Fe)}function Ie(Fe){var Ve=z||Fe._index>0&&Fe._index<D-1;if((Ve?te:ee)==="round")return me(Fe._point,J);if(pe=new H({internal:!0,closed:!0}),Ve?Fe.isSmooth()||H._addBevelJoin(Fe,te,ue,j,null,x,Ae,!0):ee==="square"&&H._addSquareCap(Fe,ee,ue,null,x,Ae,!0),!pe.isEmpty()){var Ke;return pe.contains(o)||(Ke=pe.getNearestLocation(o))&&me(Ke.getPoint(),U)}}if(h.ends&&!h.segments&&!z){if(fe=ge(F[0],!0)||ge(F[D-1],!0))return fe}else if(h.segments||h.handles){for(var Oe=0;Oe<D;Oe++)if(fe=ge(F[Oe]))return fe}if(ue!==null){if(ie=this.getNearestLocation(o),ie){var qe=ie.getTime();qe===0||qe===1&&D>1?Ie(ie.getSegment())||(ie=null):me(ie.getPoint(),J)||(ie=null)}if(!ie&&te==="miter"&&D>1)for(var Oe=0;Oe<D;Oe++){var Pe=F[Oe];if(o.getDistance(Pe._point)<=j*ue&&Ie(Pe)){ie=Pe.getLocation();break}}}return!ie&&ae&&this._contains(o)||ie&&!ne&&!Z?new de("fill",this):ie?new de(ne?"stroke":"curve",this,{location:ie,point:ie.getPoint()}):null}},c.each(le._evaluateMethods,function(o){this[o+"At"]=function(h){var b=this.getLocationAt(h);return b&&b[o]()}},{beans:!1,getLocationOf:function(){for(var o=_.read(arguments),h=this.getCurves(),b=0,x=h.length;b<x;b++){var E=h[b].getLocationOf(o);if(E)return E}return null},getOffsetOf:function(){var o=this.getLocationOf.apply(this,arguments);return o?o.getOffset():null},getLocationAt:function(o){if(typeof o=="number"){for(var h=this.getCurves(),b=0,x=0,E=h.length;x<E;x++){var I=b,F=h[x];if(b+=F.getLength(),b>o)return F.getLocationAt(o-I)}if(h.length>0&&o<=this.getLength())return new Ee(h[h.length-1],1)}else if(o&&o.getPath&&o.getPath()===this)return o;return null},getOffsetsWithTangent:function(){var o=_.read(arguments);if(o.isZero())return[];for(var h=[],b=0,x=this.getCurves(),E=0,I=x.length;E<I;E++){for(var F=x[E],D=F.getTimesWithTangent(o),z=0,U=D.length;z<U;z++){var J=b+F.getOffsetAtTime(D[z]);h.indexOf(J)<0&&h.push(J)}b+=F.length}return h}}),new function(){function o(b,x,E,I){if(I<=0)return;var F=I/2,D=I-2,z=F-1,U=new Array(6),J,te;function ee(ae){var Z=U[ae],ue=U[ae+1];(J!=Z||te!=ue)&&(b.beginPath(),b.moveTo(J,te),b.lineTo(Z,ue),b.stroke(),b.beginPath(),b.arc(Z,ue,F,0,Math.PI*2,!0),b.fill())}for(var j=0,pe=x.length;j<pe;j++){var ie=x[j],fe=ie._selection;if(ie._transformCoordinates(E,U),J=U[0],te=U[1],fe&2&&ee(2),fe&4&&ee(4),b.fillRect(J-F,te-F,I,I),D>0&&!(fe&1)){var ne=b.fillStyle;b.fillStyle="#ffffff",b.fillRect(J-z,te-z,D,D),b.fillStyle=ne}}}function h(b,x,E){var I=x._segments,F=I.length,D=new Array(6),z=!0,U,J,te,ee,j,pe,ie,fe;function ne(Z){if(E)Z._transformCoordinates(E,D),U=D[0],J=D[1];else{var ue=Z._point;U=ue._x,J=ue._y}if(z)b.moveTo(U,J),z=!1;else{if(E)j=D[2],pe=D[3];else{var me=Z._handleIn;j=U+me._x,pe=J+me._y}j===U&&pe===J&&ie===te&&fe===ee?b.lineTo(U,J):b.bezierCurveTo(ie,fe,j,pe,U,J)}if(te=U,ee=J,E)ie=D[4],fe=D[5];else{var me=Z._handleOut;ie=te+me._x,fe=ee+me._y}}for(var ae=0;ae<F;ae++)ne(I[ae]);x._closed&&F>0&&ne(I[0])}return{_draw:function(b,x,E,I){var F=x.dontStart,D=x.dontFinish||x.clip,z=this.getStyle(),U=z.hasFill(),J=z.hasStroke(),te=z.getDashArray(),ee=!rt.support.nativeDash&&J&&te&&te.length;F||b.beginPath(),(U||J&&!ee||D)&&(h(b,this,I),this._closed&&b.closePath());function j(Z){return te[(Z%ee+ee)%ee]}if(!D&&(U||J)&&(this._setStyles(b,x,E),U&&(b.fill(z.getFillRule()),b.shadowColor="rgba(0,0,0,0)"),J)){if(ee){F||b.beginPath();for(var pe=new X(this,.25,32,!1,I),ie=pe.length,fe=-z.getDashOffset(),ne,ae=0;fe>0;)fe-=j(ae--)+j(ae--);for(;fe<ie;)ne=fe+j(ae++),(fe>0||ne>0)&&pe.drawPart(b,Math.max(fe,0),Math.max(ne,0)),fe=ne+j(ae++)}b.stroke()}},_drawSelected:function(b,x){b.beginPath(),h(b,this,x),b.stroke(),o(b,this._segments,x,rt.settings.handleSize)}}},new function(){function o(h){var b=h._segments;if(!b.length)throw new Error("Use a moveTo() command first");return b[b.length-1]}return{moveTo:function(){var h=this._segments;h.length===1&&this.removeSegment(0),h.length||this._add([new K(_.read(arguments))])},moveBy:function(){throw new Error("moveBy() is unsupported on Path items.")},lineTo:function(){this._add([new K(_.read(arguments))])},cubicCurveTo:function(){var h=arguments,b=_.read(h),x=_.read(h),E=_.read(h),I=o(this);I.setHandleOut(b.subtract(I._point)),this._add([new K(E,x.subtract(E))])},quadraticCurveTo:function(){var h=arguments,b=_.read(h),x=_.read(h),E=o(this)._point;this.cubicCurveTo(b.add(E.subtract(b).multiply(1/3)),b.add(x.subtract(b).multiply(1/3)),x)},curveTo:function(){var h=arguments,b=_.read(h),x=_.read(h),E=c.pick(c.read(h),.5),I=1-E,F=o(this)._point,D=b.subtract(F.multiply(I*I)).subtract(x.multiply(E*E)).divide(2*E*I);if(D.isNaN())throw new Error("Cannot put a curve through points with parameter = "+E);this.quadraticCurveTo(D,x)},arcTo:function(){var h=arguments,b=Math.abs,x=Math.sqrt,E=o(this),I=E._point,F=_.read(h),D,z=c.peek(h),U=c.pick(z,!0),J,te,ee,j;if(typeof U=="boolean")var pe=I.add(F).divide(2),D=pe.add(pe.subtract(I).rotate(U?-90:90));else if(c.remain(h)<=2)D=F,F=_.read(h);else if(!I.equals(F)){var ie=m.read(h),fe=M.isZero;if(fe(ie.width)||fe(ie.height))return this.lineTo(F);var ne=c.read(h),U=!!c.read(h),ae=!!c.read(h),pe=I.add(F).divide(2),Z=I.subtract(pe).rotate(-ne),ue=Z.x,me=Z.y,we=b(ie.width),ge=b(ie.height),Ae=we*we,Ie=ge*ge,Oe=ue*ue,qe=me*me,Pe=x(Oe/Ae+qe/Ie);if(Pe>1&&(we*=Pe,ge*=Pe,Ae=we*we,Ie=ge*ge),Pe=(Ae*Ie-Ae*qe-Ie*Oe)/(Ae*qe+Ie*Oe),b(Pe)<1e-12&&(Pe=0),Pe<0)throw new Error("Cannot create an arc with the given arguments");J=new _(we*me/ge,-ge*ue/we).multiply((ae===U?-1:1)*x(Pe)).rotate(ne).add(pe),j=new B().translate(J).rotate(ne).scale(we,ge),ee=j._inverseTransform(I),te=ee.getDirectedAngle(j._inverseTransform(F)),!U&&te>0?te-=360:U&&te<0&&(te+=360)}if(D){var Fe=new W(I.add(D).divide(2),D.subtract(I).rotate(90),!0),Ve=new W(D.add(F).divide(2),F.subtract(D).rotate(90),!0),Ke=new W(I,F),Xe=Ke.getSide(D);if(J=Fe.intersect(Ve,!0),!J){if(!Xe)return this.lineTo(F);throw new Error("Cannot create an arc with the given arguments")}ee=I.subtract(J),te=ee.getDirectedAngle(F.subtract(J));var je=Ke.getSide(J,!0);je===0?te=Xe*b(te):Xe===je&&(te+=te<0?360:-360)}if(te){for(var gt=1e-5,xt=b(te),Mt=xt>=360?4:Math.ceil((xt-gt)/90),Bt=te/Mt,ot=Bt*Math.PI/360,ht=4/3*Math.sin(ot)/(1+Math.cos(ot)),Tt=[],zt=0;zt<=Mt;zt++){var Z=F,Ft=null;if(zt<Mt&&(Ft=ee.rotate(90).multiply(ht),j?(Z=j._transformPoint(ee),Ft=j._transformPoint(ee.add(Ft)).subtract(Z)):Z=J.add(ee)),!zt)E.setHandleOut(Ft);else{var Zt=ee.rotate(-90).multiply(ht);j&&(Zt=j._transformPoint(ee.add(Zt)).subtract(Z)),Tt.push(new K(Z,Zt,Ft))}ee=ee.rotate(Bt)}this._add(Tt)}},lineBy:function(){var h=_.read(arguments),b=o(this)._point;this.lineTo(b.add(h))},curveBy:function(){var h=arguments,b=_.read(h),x=_.read(h),E=c.read(h),I=o(this)._point;this.curveTo(I.add(b),I.add(x),E)},cubicCurveBy:function(){var h=arguments,b=_.read(h),x=_.read(h),E=_.read(h),I=o(this)._point;this.cubicCurveTo(I.add(b),I.add(x),I.add(E))},quadraticCurveBy:function(){var h=arguments,b=_.read(h),x=_.read(h),E=o(this)._point;this.quadraticCurveTo(E.add(b),E.add(x))},arcBy:function(){var h=arguments,b=o(this)._point,x=b.add(_.read(h)),E=c.pick(c.peek(h),!0);typeof E=="boolean"?this.arcTo(x,E):this.arcTo(x,b.add(_.read(h)))},closePath:function(h){this.setClosed(!0),this.join(this,h)}}},{_getBounds:function(o,h){var b=h.handle?"getHandleBounds":h.stroke?"getStrokeBounds":"getBounds";return H[b](this._segments,this._closed,this,o,h)},statics:{getBounds:function(o,h,b,x,E,I){var F=o[0];if(!F)return new L;var D=new Array(6),z=F._transformCoordinates(x,new Array(6)),U=z.slice(0,2),J=U.slice(),te=new Array(2);function ee(ie){ie._transformCoordinates(x,D);for(var fe=0;fe<2;fe++)le._addBounds(z[fe],z[fe+4],D[fe+2],D[fe],fe,I?I[fe]:0,U,J,te);var ne=z;z=D,D=ne}for(var j=1,pe=o.length;j<pe;j++)ee(o[j]);return h&&ee(F),new L(U[0],U[1],J[0]-U[0],J[1]-U[1])},getStrokeBounds:function(o,h,b,x,E){var I=b.getStyle(),F=I.hasStroke(),D=I.getStrokeWidth(),z=F&&b._getStrokeMatrix(x,E),U=F&&H._getStrokePadding(D,z),J=H.getBounds(o,h,b,x,E,U);if(!F)return J;var te=D/2,ee=I.getStrokeJoin(),j=I.getStrokeCap(),pe=I.getMiterLimit(),ie=new L(new m(U));function fe(we){J=J.include(we)}function ne(we){J=J.unite(ie.setCenter(we._point.transform(x)))}function ae(we,ge){ge==="round"||we.isSmooth()?ne(we):H._addBevelJoin(we,ge,te,pe,x,z,fe)}function Z(we,ge){ge==="round"?ne(we):H._addSquareCap(we,ge,te,x,z,fe)}var ue=o.length-(h?0:1);if(ue>0){for(var me=1;me<ue;me++)ae(o[me],ee);h?ae(o[0],ee):(Z(o[0],j),Z(o[o.length-1],j))}return J},_getStrokePadding:function(o,h){if(!h)return[o,o];var b=new _(o,0).transform(h),x=new _(0,o).transform(h),E=b.getAngleInRadians(),I=b.getLength(),F=x.getLength(),D=Math.sin(E),z=Math.cos(E),U=Math.tan(E),J=Math.atan2(F*U,I),te=Math.atan2(F,U*I);return[Math.abs(I*Math.cos(J)*z+F*Math.sin(J)*D),Math.abs(F*Math.sin(te)*z+I*Math.cos(te)*D)]},_addBevelJoin:function(o,h,b,x,E,I,F,D){var z=o.getCurve(),U=z.getPrevious(),J=z.getPoint1().transform(E),te=U.getNormalAtTime(1).multiply(b).transform(I),ee=z.getNormalAtTime(0).multiply(b).transform(I),j=te.getDirectedAngle(ee);if((j<0||j>=180)&&(te=te.negate(),ee=ee.negate()),D&&F(J),F(J.add(te)),h==="miter"){var pe=new W(J.add(te),new _(-te.y,te.x),!0).intersect(new W(J.add(ee),new _(-ee.y,ee.x),!0),!0);pe&&J.getDistance(pe)<=x*b&&F(pe)}F(J.add(ee))},_addSquareCap:function(o,h,b,x,E,I,F){var D=o._point.transform(x),z=o.getLocation(),U=z.getNormal().multiply(z.getTime()===0?b:-b).transform(E);h==="square"&&(F&&(I(D.subtract(U)),I(D.add(U))),D=D.add(U.rotate(-90))),I(D.add(U)),I(D.subtract(U))},getHandleBounds:function(o,h,b,x,E){var I=b.getStyle(),F=E.stroke&&I.hasStroke(),D,z;if(F){var U=b._getStrokeMatrix(x,E),J=I.getStrokeWidth()/2,te=J;I.getStrokeJoin()==="miter"&&(te=J*I.getMiterLimit()),I.getStrokeCap()==="square"&&(te=Math.max(te,J*Math.SQRT2)),D=H._getStrokePadding(J,U),z=H._getStrokePadding(te,U)}for(var ee=new Array(6),j=1/0,pe=-j,ie=j,fe=pe,ne=0,ae=o.length;ne<ae;ne++){var Z=o[ne];Z._transformCoordinates(x,ee);for(var ue=0;ue<6;ue+=2){var me=ue?D:z,we=me?me[0]:0,ge=me?me[1]:0,Ae=ee[ue],Ie=ee[ue+1],Oe=Ae-we,qe=Ae+we,Pe=Ie-ge,Fe=Ie+ge;Oe<j&&(j=Oe),qe>pe&&(pe=qe),Pe<ie&&(ie=Pe),Fe>fe&&(fe=Fe)}}return new L(j,ie,pe-j,fe-ie)}}});H.inject({statics:new function(){var o=.5522847498307936,h=[new K([-1,0],[0,o],[0,-.5522847498307936]),new K([0,-1],[-.5522847498307936,0],[o,0]),new K([1,0],[0,-.5522847498307936],[0,o]),new K([0,1],[o,0],[-.5522847498307936,0])];function b(E,I,F){var D=c.getNamed(F),z=new H(D&&(D.insert==!0?R.INSERT:D.insert==!1?R.NO_INSERT:null));return z._add(E),z._closed=I,z.set(D,R.INSERT)}function x(E,I,F){for(var D=new Array(4),z=0;z<4;z++){var U=h[z];D[z]=new K(U._point.multiply(I).add(E),U._handleIn.multiply(I),U._handleOut.multiply(I))}return b(D,!0,F)}return{Line:function(){var E=arguments;return b([new K(_.readNamed(E,"from")),new K(_.readNamed(E,"to"))],!1,E)},Circle:function(){var E=arguments,I=_.readNamed(E,"center"),F=c.readNamed(E,"radius");return x(I,new m(F),E)},Rectangle:function(){var E=arguments,I=L.readNamed(E,"rectangle"),F=m.readNamed(E,"radius",0,{readNull:!0}),D=I.getBottomLeft(!0),z=I.getTopLeft(!0),U=I.getTopRight(!0),J=I.getBottomRight(!0),te;if(!F||F.isZero())te=[new K(D),new K(z),new K(U),new K(J)];else{F=m.min(F,I.getSize(!0).divide(2));var ee=F.width,j=F.height,pe=ee*o,ie=j*o;te=[new K(D.add(ee,0),null,[-pe,0]),new K(D.subtract(0,j),[0,ie]),new K(z.add(0,j),null,[0,-ie]),new K(z.add(ee,0),[-pe,0],null),new K(U.subtract(ee,0),null,[pe,0]),new K(U.add(0,j),[0,-ie],null),new K(J.subtract(0,j),null,[0,ie]),new K(J.subtract(ee,0),[pe,0])]}return b(te,!0,E)},RoundRectangle:"#Rectangle",Ellipse:function(){var E=arguments,I=se._readEllipse(E);return x(I.center,I.radius,E)},Oval:"#Ellipse",Arc:function(){var E=arguments,I=_.readNamed(E,"from"),F=_.readNamed(E,"through"),D=_.readNamed(E,"to"),z=c.getNamed(E),U=new H(z&&z.insert==!1&&R.NO_INSERT);return U.moveTo(I),U.arcTo(F,D),U.set(z)},RegularPolygon:function(){for(var E=arguments,I=_.readNamed(E,"center"),F=c.readNamed(E,"sides"),D=c.readNamed(E,"radius"),z=360/F,U=F%3===0,J=new _(0,U?-D:D),te=U?-1:.5,ee=new Array(F),j=0;j<F;j++)ee[j]=new K(I.add(J.rotate((j+te)*z)));return b(ee,!0,E)},Star:function(){for(var E=arguments,I=_.readNamed(E,"center"),F=c.readNamed(E,"points")*2,D=c.readNamed(E,"radius1"),z=c.readNamed(E,"radius2"),U=360/F,J=new _(0,-1),te=new Array(F),ee=0;ee<F;ee++)te[ee]=new K(I.add(J.rotate(U*ee).multiply(ee%2?z:D)));return b(te,!0,E)}}}});var Y=Me.extend({_class:"CompoundPath",_serializeFields:{children:[]},beans:!0,initialize:function(h){this._children=[],this._namedChildren={},this._initialize(h)||(typeof h=="string"?this.setPathData(h):this.addChildren(Array.isArray(h)?h:arguments))},insertChildren:function o(h,b){var x=b,E=x[0];E&&typeof E[0]=="number"&&(x=[x]);for(var I=b.length-1;I>=0;I--){var F=x[I];x===b&&!(F instanceof H)&&(x=c.slice(x)),Array.isArray(F)?x[I]=new H({segments:F,insert:!1}):F instanceof Y&&(x.splice.apply(x,[I,1].concat(F.removeChildren())),F.remove())}return o.base.call(this,h,x)},reduce:function o(h){for(var b=this._children,x=b.length-1;x>=0;x--){var E=b[x].reduce(h);E.isEmpty()&&E.remove()}if(!b.length){var E=new H(R.NO_INSERT);return E.copyAttributes(this),E.insertAbove(this),this.remove(),E}return o.base.call(this)},isClosed:function(){for(var o=this._children,h=0,b=o.length;h<b;h++)if(!o[h]._closed)return!1;return!0},setClosed:function(o){for(var h=this._children,b=0,x=h.length;b<x;b++)h[b].setClosed(o)},getFirstSegment:function(){var o=this.getFirstChild();return o&&o.getFirstSegment()},getLastSegment:function(){var o=this.getLastChild();return o&&o.getLastSegment()},getCurves:function(){for(var o=this._children,h=[],b=0,x=o.length;b<x;b++)c.push(h,o[b].getCurves());return h},getFirstCurve:function(){var o=this.getFirstChild();return o&&o.getFirstCurve()},getLastCurve:function(){var o=this.getLastChild();return o&&o.getLastCurve()},getArea:function(){for(var o=this._children,h=0,b=0,x=o.length;b<x;b++)h+=o[b].getArea();return h},getLength:function(){for(var o=this._children,h=0,b=0,x=o.length;b<x;b++)h+=o[b].getLength();return h},getPathData:function(o,h){for(var b=this._children,x=[],E=0,I=b.length;E<I;E++){var F=b[E],D=F._matrix;x.push(F.getPathData(o&&!D.isIdentity()?o.appended(D):o,h))}return x.join("")},_hitTestChildren:function o(h,b,x){return o.base.call(this,h,b.class===H||b.type==="path"?b:c.set({},b,{fill:!1}),x)},_draw:function(o,h,b,x){var E=this._children;if(E.length){h=h.extend({dontStart:!0,dontFinish:!0}),o.beginPath();for(var I=0,F=E.length;I<F;I++)E[I].draw(o,h,x);if(!h.clip){this._setStyles(o,h,b);var D=this._style;D.hasFill()&&(o.fill(D.getFillRule()),o.shadowColor="rgba(0,0,0,0)"),D.hasStroke()&&o.stroke()}}},_drawSelected:function(o,h,b){for(var x=this._children,E=0,I=x.length;E<I;E++){var F=x[E],D=F._matrix;b[F._id]||F._drawSelected(o,D.isIdentity()?h:h.appended(D))}}},new function(){function o(h,b){var x=h._children;if(b&&!x.length)throw new Error("Use a moveTo() command first");return x[x.length-1]}return c.each(["lineTo","cubicCurveTo","quadraticCurveTo","curveTo","arcTo","lineBy","cubicCurveBy","quadraticCurveBy","curveBy","arcBy"],function(h){this[h]=function(){var b=o(this,!0);b[h].apply(b,arguments)}},{moveTo:function(){var h=o(this),b=h&&h.isEmpty()?h:new H(R.NO_INSERT);b!==h&&this.addChild(b),b.moveTo.apply(b,arguments)},moveBy:function(){var h=o(this,!0),b=h&&h.getLastSegment(),x=_.read(arguments);this.moveTo(b?x.add(b._point):x)},closePath:function(h){o(this,!0).closePath(h)}})},c.each(["reverse","flatten","simplify","smooth"],function(o){this[o]=function(h){for(var b=this._children,x,E=0,I=b.length;E<I;E++)x=b[E][o](h)||x;return x}},{}));Me.inject(new function(){var o=Math.min,h=Math.max,b=Math.abs,x={unite:{1:!0,2:!0},intersect:{2:!0},subtract:{1:!0},exclude:{1:!0,"-1":!0}};function E(ne){return ne._children||[ne]}function I(ne,ae){var Z=ne.clone(!1).reduce({simplify:!0}).transform(null,!0,!0);if(ae){for(var ue=E(Z),me=0,we=ue.length;me<we;me++){var ne=ue[me];!ne._closed&&!ne.isEmpty()&&(ne.closePath(1e-12),ne.getFirstSegment().setHandleIn(0,0),ne.getLastSegment().setHandleOut(0,0))}Z=Z.resolveCrossings().reorient(Z.getFillRule()==="nonzero",!0)}return Z}function F(ne,ae,Z,ue,me){var we=new Y(R.NO_INSERT);return we.addChildren(ne,!0),we=we.reduce({simplify:ae}),me&&me.insert==!1||we.insertAbove(ue&&Z.isSibling(ue)&&Z.getIndex()<ue.getIndex()?ue:Z),we.copyAttributes(Z,!0),we}function D(ne){return ne.hasOverlap()||ne.isCrossing()}function z(ne,ae,Z,ue){if(ue&&(ue.trace==!1||ue.stroke)&&/^(subtract|intersect)$/.test(Z))return U(ne,ae,Z);var me=I(ne,!0),we=ae&&ne!==ae&&I(ae,!0),ge=x[Z];ge[Z]=!0,we&&(ge.subtract||ge.exclude)^(we.isClockwise()^me.isClockwise())&&we.reverse();var Ae=j(Ee.expand(me.getIntersections(we,D))),Ie=E(me),Oe=we&&E(we),qe=[],Pe=[],Fe;function Ve(Ft){for(var Zt=0,rr=Ft.length;Zt<rr;Zt++){var sr=Ft[Zt];c.push(qe,sr._segments),c.push(Pe,sr.getCurves()),sr._overlapsOnly=!0}}function Ke(Ft){for(var Zt=[],rr=0,sr=Ft&&Ft.length;rr<sr;rr++)Zt.push(Pe[Ft[rr]]);return Zt}if(Ae.length){Ve(Ie),Oe&&Ve(Oe);for(var Xe=new Array(Pe.length),je=0,gt=Pe.length;je<gt;je++)Xe[je]=Pe[je].getValues();for(var xt=S.findCurveBoundsCollisions(Xe,Xe,0,!0),Mt={},je=0;je<Pe.length;je++){var Bt=Pe[je],ot=Bt._path._id,ht=Mt[ot]=Mt[ot]||{};ht[Bt.getIndex()]={hor:Ke(xt[je].hor),ver:Ke(xt[je].ver)}}for(var je=0,gt=Ae.length;je<gt;je++)ie(Ae[je]._segment,me,we,Mt,ge);for(var je=0,gt=qe.length;je<gt;je++){var Tt=qe[je],zt=Tt._intersection;Tt._winding||ie(Tt,me,we,Mt,ge),zt&&zt._overlap||(Tt._path._overlapsOnly=!1)}Fe=fe(qe,ge)}else Fe=ee(Oe?Ie.concat(Oe):Ie.slice(),function(Ft){return!!ge[Ft]});return F(Fe,!0,ne,ae,ue)}function U(ne,ae,Z){var ue=I(ne),me=I(ae),we=ue.getIntersections(me,D),ge=Z==="subtract",Ae=Z==="divide",Ie={},Oe=[];function qe(Ve){if(!Ie[Ve._id]&&(Ae||me.contains(Ve.getPointAt(Ve.getLength()/2))^ge))return Oe.unshift(Ve),Ie[Ve._id]=!0}for(var Pe=we.length-1;Pe>=0;Pe--){var Fe=we[Pe].split();Fe&&(qe(Fe)&&Fe.getFirstSegment().setHandleIn(0,0),ue.getLastSegment().setHandleOut(0,0))}return qe(ue),F(Oe,!1,ne,ae)}function J(ne,ae){for(var Z=ne;Z;){if(Z===ae)return;Z=Z._previous}for(;ne._next&&ne._next!==ae;)ne=ne._next;if(!ne._next){for(;ae._previous;)ae=ae._previous;ne._next=ae,ae._previous=ne}}function te(ne){for(var ae=ne.length-1;ae>=0;ae--)ne[ae].clearHandles()}function ee(ne,ae,Z){var ue=ne&&ne.length;if(ue){var me=c.each(ne,function(xt,Mt){this[xt._id]={container:null,winding:xt.isClockwise()?1:-1,index:Mt}},{}),we=ne.slice().sort(function(xt,Mt){return b(Mt.getArea())-b(xt.getArea())}),ge=we[0],Ae=S.findItemBoundsCollisions(we,null,M.GEOMETRIC_EPSILON);Z==null&&(Z=ge.isClockwise());for(var Ie=0;Ie<ue;Ie++){var Oe=we[Ie],qe=me[Oe._id],Pe=0,Fe=Ae[Ie];if(Fe){for(var Ve=null,Ke=Fe.length-1;Ke>=0;Ke--)if(Fe[Ke]<Ie){Ve=Ve||Oe.getInteriorPoint();var Xe=we[Fe[Ke]];if(Xe.contains(Ve)){var je=me[Xe._id];Pe=je.winding,qe.winding+=Pe,qe.container=je.exclude?je.container:Xe;break}}}if(ae(qe.winding)===ae(Pe))qe.exclude=!0,ne[qe.index]=null;else{var gt=qe.container;Oe.setClockwise(gt?!gt.isClockwise():Z)}}}return ne}function j(ne,ae,Z){var ue=ae&&[],me=1e-8,we=1-me,ge=!1,Ae=Z||[],Ie=Z&&{},Oe,qe,Pe;function Fe(Zt){return Zt._path._id+"."+Zt._segment1._index}for(var Ve=(Z&&Z.length)-1;Ve>=0;Ve--){var Ke=Z[Ve];Ke._path&&(Ie[Fe(Ke)]=!0)}for(var Ve=ne.length-1;Ve>=0;Ve--){var Xe=ne[Ve],je=Xe._time,gt=je,xt=ae&&!ae(Xe),Ke=Xe._curve,Mt;if(Ke&&(Ke!==qe?(ge=!Ke.hasHandles()||Ie&&Ie[Fe(Ke)],Oe=[],Pe=null,qe=Ke):Pe>=me&&(je/=Pe)),xt){Oe&&Oe.push(Xe);continue}else ae&&ue.unshift(Xe);if(Pe=gt,je<me)Mt=Ke._segment1;else if(je>we)Mt=Ke._segment2;else{var Bt=Ke.divideAtTime(je,!0);ge&&Ae.push(Ke,Bt),Mt=Bt._segment1;for(var ot=Oe.length-1;ot>=0;ot--){var ht=Oe[ot];ht._time=(ht._time-je)/(1-je)}}Xe._setSegment(Mt);var Tt=Mt._intersection,zt=Xe._intersection;if(Tt){J(Tt,zt);for(var Ft=Tt;Ft;)J(Ft._intersection,Tt),Ft=Ft._next}else Mt._intersection=zt}return Z||te(Ae),ue||ne}function pe(ne,ae,Z,ue,me){var we=Array.isArray(ae)?ae:ae[Z?"hor":"ver"],ge=Z?1:0,Ae=ge^1,Ie=[ne.x,ne.y],Oe=Ie[ge],qe=Ie[Ae],Pe=1e-9,Fe=1e-6,Ve=Oe-Pe,Ke=Oe+Pe,Xe=0,je=0,gt=0,xt=0,Mt=!1,Bt=!1,ot=1,ht=[],Tt,zt;function Ft(Lr){var Br=Lr[Ae+0],Gn=Lr[Ae+6];if(!(qe<o(Br,Gn)||qe>h(Br,Gn))){var vn=Lr[ge+0],On=Lr[ge+2],Ti=Lr[ge+4],Zn=Lr[ge+6];if(Br===Gn){(vn<Ke&&Zn>Ve||Zn<Ke&&vn>Ve)&&(Mt=!0);return}var Pn=qe===Br?0:qe===Gn||Ve>h(vn,On,Ti,Zn)||Ke<o(vn,On,Ti,Zn)?1:le.solveCubic(Lr,Ae,qe,ht,0,1)>0?ht[0]:1,Yn=Pn===0?vn:Pn===1?Zn:le.getPoint(Lr,Pn)[Z?"y":"x"],Nn=Br>Gn?1:-1,an=Tt[Ae]>Tt[Ae+6]?1:-1,jr=Tt[ge+6];return qe!==Br?(Yn<Ve?gt+=Nn:Yn>Ke?xt+=Nn:Mt=!0,Yn>Oe-Fe&&Yn<Oe+Fe&&(ot/=2)):(Nn!==an?vn<Ve?gt+=Nn:vn>Ke&&(xt+=Nn):vn!=jr&&(jr<Ke&&Yn>Ke?(xt+=Nn,Mt=!0):jr>Ve&&Yn<Ve&&(gt+=Nn,Mt=!0)),ot/=4),Tt=Lr,!me&&Yn>Ve&&Yn<Ke&&le.getTangent(Lr,Pn)[Z?"x":"y"]===0&&pe(ne,ae,!Z,ue,!0)}}function Zt(Lr){var Br=Lr[Ae+0],Gn=Lr[Ae+2],vn=Lr[Ae+4],On=Lr[Ae+6];if(qe<=h(Br,Gn,vn,On)&&qe>=o(Br,Gn,vn,On)){for(var Ti=Lr[ge+0],Zn=Lr[ge+2],Pn=Lr[ge+4],Yn=Lr[ge+6],Nn=Ve>h(Ti,Zn,Pn,Yn)||Ke<o(Ti,Zn,Pn,Yn)?[Lr]:le.getMonoCurves(Lr,Z),an,jr=0,ca=Nn.length;jr<ca;jr++)if(an=Ft(Nn[jr]))return an}}for(var rr=0,sr=we.length;rr<sr;rr++){var fr=we[rr],ur=fr._path,ln=fr.getValues(),sn;if((!rr||we[rr-1]._path!==ur)&&(Tt=null,ur._closed||(zt=le.getValues(ur.getLastCurve().getSegment2(),fr.getSegment1(),null,!ue),zt[Ae]!==zt[Ae+6]&&(Tt=zt)),!Tt)){Tt=ln;for(var gn=ur.getLastCurve();gn&&gn!==fr;){var Et=gn.getValues();if(Et[Ae]!==Et[Ae+6]){Tt=Et;break}gn=gn.getPrevious()}}if(sn=Zt(ln))return sn;if(rr+1===sr||we[rr+1]._path!==ur){if(zt&&(sn=Zt(zt)))return sn;Mt&&!gt&&!xt&&(gt=xt=ur.isClockwise(ue)^Z?1:-1),Xe+=gt,je+=xt,gt=xt=0,Mt&&(Bt=!0,Mt=!1),zt=null}}return Xe=b(Xe),je=b(je),{winding:h(Xe,je),windingL:Xe,windingR:je,quality:ot,onPath:Bt}}function ie(ne,ae,Z,ue,me){var we=[],ge=ne,Ae=0,Pe;do{var Ie=ne.getCurve();if(Ie){var Oe=Ie.getLength();we.push({segment:ne,curve:Ie,length:Oe}),Ae+=Oe}ne=ne.getNext()}while(ne&&!ne._intersection&&ne!==ge);for(var qe=[.5,.25,.75],Pe={winding:0,quality:-1},Fe=.001,Ve=1-Fe,Ke=0;Ke<qe.length&&Pe.quality<.5;Ke++)for(var Oe=Ae*qe[Ke],Xe=0,je=we.length;Xe<je;Xe++){var gt=we[Xe],xt=gt.length;if(Oe<=xt){var Ie=gt.curve,Mt=Ie._path,Bt=Mt._parent,ot=Bt instanceof Y?Bt:Mt,ht=M.clamp(Ie.getTimeAt(Oe),Fe,Ve),Tt=Ie.getPointAtTime(ht),zt=b(Ie.getTangentAtTime(ht).y)<Math.SQRT1_2,Ft=null;if(me.subtract&&Z){var Zt=ot===ae?Z:ae,rr=Zt._getWinding(Tt,zt,!0);if(ot===ae&&rr.winding||ot===Z&&!rr.winding){if(rr.quality<1)continue;Ft={winding:0,quality:1}}}Ft=Ft||pe(Tt,ue[Mt._id][Ie.getIndex()],zt,!0),Ft.quality>Pe.quality&&(Pe=Ft);break}Oe-=xt}for(var Xe=we.length-1;Xe>=0;Xe--)we[Xe].segment._winding=Pe}function fe(ne,ae){var Z=[],ue;function me(sr){var fr;return!!(sr&&!sr._visited&&(!ae||ae[(fr=sr._winding||{}).winding]&&!(ae.unite&&fr.winding===2&&fr.windingL&&fr.windingR)))}function we(sr){if(sr){for(var fr=0,ur=ue.length;fr<ur;fr++)if(sr===ue[fr])return!0}return!1}function ge(sr){for(var fr=sr._segments,ur=0,ln=fr.length;ur<ln;ur++)fr[ur]._visited=!0}function Ae(sr,fr){var ur=sr._intersection,ln=ur,sn=[];fr&&(ue=[sr]);function gn(Et,Lr){for(;Et&&Et!==Lr;){var Br=Et._segment,Gn=Br&&Br._path;if(Gn){var vn=Br.getNext()||Gn.getFirstSegment(),On=vn._intersection;Br!==sr&&(we(Br)||we(vn)||vn&&me(Br)&&(me(vn)||On&&me(On._segment)))&&sn.push(Br),fr&&ue.push(Br)}Et=Et._next}}if(ur){for(gn(ur);ur&&ur._previous;)ur=ur._previous;gn(ur,ln)}return sn}ne.sort(function(sr,fr){var ur=sr._intersection,ln=fr._intersection,sn=!!(ur&&ur._overlap),gn=!!(ln&&ln._overlap),Et=sr._path,Lr=fr._path;return sn^gn?sn?1:-1:!ur^!ln?ur?1:-1:Et!==Lr?Et._id-Lr._id:sr._index-fr._index});for(var Ie=0,Oe=ne.length;Ie<Oe;Ie++){var qe=ne[Ie],Pe=me(qe),Fe=null,Ve=!1,Ke=!0,Xe=[],je,gt,xt;if(Pe&&qe._path._overlapsOnly){var Mt=qe._path,Bt=qe._intersection._segment._path;Mt.compare(Bt)&&(Mt.getArea()&&Z.push(Mt.clone(!1)),ge(Mt),ge(Bt),Pe=!1)}for(;Pe;){var ot=!Fe,ht=Ae(qe,ot),Tt=ht.shift(),Ve=!ot&&(we(qe)||we(Tt)),zt=!Ve&&Tt;if(ot&&(Fe=new H(R.NO_INSERT),je=null),Ve){(qe.isFirst()||qe.isLast())&&(Ke=qe._path._closed),qe._visited=!0;break}if(zt&&je&&(Xe.push(je),je=null),je||(zt&&ht.push(qe),je={start:Fe._segments.length,crossings:ht,visited:gt=[],handleIn:xt}),zt&&(qe=Tt),!me(qe)){Fe.removeSegments(je.start);for(var Ft=0,Zt=gt.length;Ft<Zt;Ft++)gt[Ft]._visited=!1;gt.length=0;do qe=je&&je.crossings.shift(),(!qe||!qe._path)&&(qe=null,je=Xe.pop(),je&&(gt=je.visited,xt=je.handleIn));while(je&&!me(qe));if(!qe)break}var rr=qe.getNext();Fe.add(new K(qe._point,xt,rr&&qe._handleOut)),qe._visited=!0,gt.push(qe),qe=rr||qe._path.getFirstSegment(),xt=rr&&rr._handleIn}Ve&&(Ke&&(Fe.getFirstSegment().setHandleIn(xt),Fe.setClosed(Ke)),Fe.getArea()!==0&&Z.push(Fe))}return Z}return{_getWinding:function(ne,ae,Z){return pe(ne,this.getCurves(),ae,Z)},unite:function(ne,ae){return z(this,ne,"unite",ae)},intersect:function(ne,ae){return z(this,ne,"intersect",ae)},subtract:function(ne,ae){return z(this,ne,"subtract",ae)},exclude:function(ne,ae){return z(this,ne,"exclude",ae)},divide:function(ne,ae){return ae&&(ae.trace==!1||ae.stroke)?U(this,ne,"divide"):F([this.subtract(ne,ae),this.intersect(ne,ae)],!0,this,ne,ae)},resolveCrossings:function(){var ne=this._children,ae=ne||[this];function Z(je,gt){var xt=je&&je._intersection;return xt&&xt._overlap&&xt._path===gt}var ue=!1,me=!1,we=this.getIntersections(null,function(je){return je.hasOverlap()&&(ue=!0)||je.isCrossing()&&(me=!0)}),ge=ue&&me&&[];if(we=Ee.expand(we),ue)for(var Ae=j(we,function(je){return je.hasOverlap()},ge),Ie=Ae.length-1;Ie>=0;Ie--){var Oe=Ae[Ie],qe=Oe._path,Pe=Oe._segment,Fe=Pe.getPrevious(),Ve=Pe.getNext();Z(Fe,qe)&&Z(Ve,qe)&&(Pe.remove(),Fe._handleOut._set(0,0),Ve._handleIn._set(0,0),Fe!==Pe&&!Fe.getCurve().hasLength()&&(Ve._handleIn.set(Fe._handleIn),Fe.remove()))}me&&(j(we,ue&&function(je){var gt=je.getCurve(),xt=je.getSegment(),Mt=je._intersection,Bt=Mt._curve,ot=Mt._segment;if(gt&&Bt&>._path&&Bt._path)return!0;xt&&(xt._intersection=null),ot&&(ot._intersection=null)},ge),ge&&te(ge),ae=fe(c.each(ae,function(je){c.push(this,je._segments)},[])));var Ke=ae.length,Xe;return Ke>1&&ne?(ae!==ne&&this.setChildren(ae),Xe=this):Ke===1&&!ne&&(ae[0]!==this&&this.setSegments(ae[0].removeSegments()),Xe=this),Xe||(Xe=new Y(R.NO_INSERT),Xe.addChildren(ae),Xe=Xe.reduce(),Xe.copyAttributes(this),this.replaceWith(Xe)),Xe},reorient:function(ne,ae){var Z=this._children;return Z&&Z.length?this.setChildren(ee(this.removeChildren(),function(ue){return!!(ne?ue:ue&1)},ae)):ae!==a&&this.setClockwise(ae),this},getInteriorPoint:function(){var ne=this.getBounds(),ae=ne.getCenter(!0);if(!this.contains(ae)){for(var Z=this.getCurves(),ue=ae.y,me=[],we=[],ge=0,Ae=Z.length;ge<Ae;ge++){var Ie=Z[ge].getValues(),Oe=Ie[1],qe=Ie[3],Pe=Ie[5],Fe=Ie[7];if(ue>=o(Oe,qe,Pe,Fe)&&ue<=h(Oe,qe,Pe,Fe))for(var Ve=le.getMonoCurves(Ie),Ke=0,Xe=Ve.length;Ke<Xe;Ke++){var je=Ve[Ke],gt=je[1],xt=je[7];if(gt!==xt&&(ue>=gt&&ue<=xt||ue>=xt&&ue<=gt)){var Mt=ue===gt?je[0]:ue===xt?je[6]:le.solveCubic(je,1,ue,we,0,1)===1?le.getPoint(je,we[0]).x:(je[0]+je[6])/2;me.push(Mt)}}}me.length>1&&(me.sort(function(Bt,ot){return Bt-ot}),ae.x=(me[0]+me[1])/2)}return ae}}});var X=c.extend({_class:"PathFlattener",initialize:function(o,h,b,x,E){var I=[],F=[],D=0,z=1/(b||32),U=o._segments,J=U[0],te;function ee(fe,ne){var ae=le.getValues(fe,ne,E);I.push(ae),j(ae,fe._index,0,1)}function j(fe,ne,ae,Z){if(Z-ae>z&&!(x&&le.isStraight(fe))&&!le.isFlatEnough(fe,h||.25)){var ue=le.subdivide(fe,.5),me=(ae+Z)/2;j(ue[0],ne,ae,me),j(ue[1],ne,me,Z)}else{var we=fe[6]-fe[0],ge=fe[7]-fe[1],Ae=Math.sqrt(we*we+ge*ge);Ae>0&&(D+=Ae,F.push({offset:D,curve:fe,index:ne,time:Z}))}}for(var pe=1,ie=U.length;pe<ie;pe++)te=U[pe],ee(J,te),J=te;o._closed&&ee(te||J,U[0]),this.curves=I,this.parts=F,this.length=D,this.index=0},_get:function(o){for(var h=this.parts,b=h.length,x,E=this.index;x=E,!(!E||h[--E].offset<o););for(;x<b;x++){var I=h[x];if(I.offset>=o){this.index=x;var F=h[x-1],D=F&&F.index===I.index?F.time:0,z=F?F.offset:0;return{index:I.index,time:D+(I.time-D)*(o-z)/(I.offset-z)}}}return{index:h[b-1].index,time:1}},drawPart:function(o,h,b){for(var x=this._get(h),E=this._get(b),I=x.index,F=E.index;I<=F;I++){var D=le.getPart(this.curves[I],I===x.index?x.time:0,I===E.index?E.time:1);I===x.index&&o.moveTo(D[0],D[1]),o.bezierCurveTo.apply(o,D.slice(2))}}},c.each(le._evaluateMethods,function(o){this[o+"At"]=function(h){var b=this._get(h);return le[o](this.curves[b.index],b.time)}},{})),xe=c.extend({initialize:function(o){for(var h=this.points=[],b=o._segments,x=o._closed,E=0,I,F=b.length;E<F;E++){var D=b[E].point;(!I||!I.equals(D))&&h.push(I=D.clone())}x&&(h.unshift(h[h.length-1]),h.push(h[1])),this.closed=x},fit:function(o){var h=this.points,b=h.length,x=null;return b>0&&(x=[new K(h[0])],b>1&&(this.fitCubic(x,o,0,b-1,h[1].subtract(h[0]),h[b-2].subtract(h[b-1])),this.closed&&(x.shift(),x.pop()))),x},fitCubic:function(o,h,b,x,E,I){var F=this.points;if(x-b===1){var D=F[b],z=F[x],U=D.getDistance(z)/3;this.addCurve(o,[D,D.add(E.normalize(U)),z.add(I.normalize(U)),z]);return}for(var J=this.chordLengthParameterize(b,x),te=Math.max(h,h*h),ee,j=!0,pe=0;pe<=4;pe++){var ie=this.generateBezier(b,x,J,E,I),fe=this.findMaxError(b,x,ie,J);if(fe.error<h&&j){this.addCurve(o,ie);return}if(ee=fe.index,fe.error>=te)break;j=this.reparameterize(b,x,J,ie),te=fe.error}var ne=F[ee-1].subtract(F[ee+1]);this.fitCubic(o,h,b,ee,E,ne),this.fitCubic(o,h,ee,x,ne.negate(),I)},addCurve:function(o,h){var b=o[o.length-1];b.setHandleOut(h[1].subtract(h[0])),o.push(new K(h[3],h[2].subtract(h[3])))},generateBezier:function(o,h,b,x,E){for(var I=1e-12,F=Math.abs,D=this.points,z=D[o],U=D[h],J=[[0,0],[0,0]],te=[0,0],ee=0,j=h-o+1;ee<j;ee++){var pe=b[ee],ie=1-pe,fe=3*pe*ie,ne=ie*ie*ie,ae=fe*ie,Z=fe*pe,ue=pe*pe*pe,me=x.normalize(ae),we=E.normalize(Z),ge=D[o+ee].subtract(z.multiply(ne+ae)).subtract(U.multiply(Z+ue));J[0][0]+=me.dot(me),J[0][1]+=me.dot(we),J[1][0]=J[0][1],J[1][1]+=we.dot(we),te[0]+=me.dot(ge),te[1]+=we.dot(ge)}var Ae=J[0][0]*J[1][1]-J[1][0]*J[0][1],Ie,Oe;if(F(Ae)>I){var qe=J[0][0]*te[1]-J[1][0]*te[0],Pe=te[0]*J[1][1]-te[1]*J[0][1];Ie=Pe/Ae,Oe=qe/Ae}else{var Fe=J[0][0]+J[0][1],Ve=J[1][0]+J[1][1];Ie=Oe=F(Fe)>I?te[0]/Fe:F(Ve)>I?te[1]/Ve:0}var Ke=U.getDistance(z),Xe=I*Ke,je,gt;if(Ie<Xe||Oe<Xe)Ie=Oe=Ke/3;else{var xt=U.subtract(z);je=x.normalize(Ie),gt=E.normalize(Oe),je.dot(xt)-gt.dot(xt)>Ke*Ke&&(Ie=Oe=Ke/3,je=gt=null)}return[z,z.add(je||x.normalize(Ie)),U.add(gt||E.normalize(Oe)),U]},reparameterize:function(o,h,b,x){for(var E=o;E<=h;E++)b[E-o]=this.findRoot(x,this.points[E],b[E-o]);for(var E=1,I=b.length;E<I;E++)if(b[E]<=b[E-1])return!1;return!0},findRoot:function(o,h,b){for(var x=[],E=[],I=0;I<=2;I++)x[I]=o[I+1].subtract(o[I]).multiply(3);for(var I=0;I<=1;I++)E[I]=x[I+1].subtract(x[I]).multiply(2);var F=this.evaluate(3,o,b),D=this.evaluate(2,x,b),z=this.evaluate(1,E,b),U=F.subtract(h),J=D.dot(D)+U.dot(z);return M.isMachineZero(J)?b:b-U.dot(D)/J},evaluate:function(o,h,b){for(var x=h.slice(),E=1;E<=o;E++)for(var I=0;I<=o-E;I++)x[I]=x[I].multiply(1-b).add(x[I+1].multiply(b));return x[0]},chordLengthParameterize:function(o,h){for(var b=[0],x=o+1;x<=h;x++)b[x-o]=b[x-o-1]+this.points[x].getDistance(this.points[x-1]);for(var x=1,E=h-o;x<=E;x++)b[x]/=b[E];return b},findMaxError:function(o,h,b,x){for(var E=Math.floor((h-o+1)/2),I=0,F=o+1;F<h;F++){var D=this.evaluate(3,b,x[F-o]),z=D.subtract(this.points[F]),U=z.x*z.x+z.y*z.y;U>=I&&(I=U,E=F)}return{error:I,index:E}}}),De=R.extend({_class:"TextItem",_applyMatrix:!1,_canApplyMatrix:!1,_serializeFields:{content:null},_boundsOptions:{stroke:!1,handle:!1},initialize:function(h){this._content="",this._lines=[];var b=h&&c.isPlainObject(h)&&h.x===a&&h.y===a;this._initialize(b&&h,!b&&_.read(arguments))},_equals:function(o){return this._content===o._content},copyContent:function(o){this.setContent(o._content)},getContent:function(){return this._content},setContent:function(o){this._content=""+o,this._lines=this._content.split(/\r\n|\n|\r/mg),this._changed(521)},isEmpty:function(){return!this._content},getCharacterStyle:"#getStyle",setCharacterStyle:"#setStyle",getParagraphStyle:"#getStyle",setParagraphStyle:"#setStyle"}),$e=De.extend({_class:"PointText",initialize:function(){De.apply(this,arguments)},getPoint:function(){var o=this._matrix.getTranslation();return new C(o.x,o.y,this,"setPoint")},setPoint:function(){var o=_.read(arguments);this.translate(o.subtract(this._matrix.getTranslation()))},_draw:function(o,h,b){if(this._content){this._setStyles(o,h,b);var x=this._lines,E=this._style,I=E.hasFill(),F=E.hasStroke(),D=E.getLeading(),z=o.shadowColor;o.font=E.getFontStyle(),o.textAlign=E.getJustification();for(var U=0,J=x.length;U<J;U++){o.shadowColor=z;var te=x[U];I&&(o.fillText(te,0,0),o.shadowColor="rgba(0,0,0,0)"),F&&o.strokeText(te,0,0),o.translate(0,D)}}},_getBounds:function(o,h){var b=this._style,x=this._lines,E=x.length,I=b.getJustification(),F=b.getLeading(),D=this.getView().getTextWidth(b.getFontStyle(),x),z=0;I!=="left"&&(z-=D/(I==="center"?2:1));var U=new L(z,E?-.75*F:0,D,E*F);return o?o._transformBounds(U,U):U}}),Re=c.extend(new function(){var o={gray:["gray"],rgb:["red","green","blue"],hsb:["hue","saturation","brightness"],hsl:["hue","saturation","lightness"],gradient:["gradient","origin","destination","highlight"]},h={},b={transparent:[0,0,0,0]},x;function E(D){var z=D.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})([\da-f]{2})?$/i)||D.match(/^#([\da-f])([\da-f])([\da-f])([\da-f])?$/i),U="rgb",J;if(z){var te=z[4]?4:3;J=new Array(te);for(var ee=0;ee<te;ee++){var j=z[ee+1];J[ee]=parseInt(j.length==1?j+j:j,16)/255}}else if(z=D.match(/^(rgb|hsl)a?\((.*)\)$/)){U=z[1],J=z[2].trim().split(/[,\s]+/g);for(var pe=U==="hsl",ee=0,ie=Math.min(J.length,4);ee<ie;ee++){var fe=J[ee],j=parseFloat(fe);if(pe)if(ee===0){var ne=fe.match(/([a-z]*)$/)[1];j*={turn:360,rad:180/Math.PI,grad:.9}[ne]||1}else ee<3&&(j/=100);else ee<3&&(j/=/%$/.test(fe)?100:255);J[ee]=j}}else{var ae=b[D];if(!ae)if(l){x||(x=Ue.getContext(1,1,{willReadFrequently:!0}),x.globalCompositeOperation="copy"),x.fillStyle="rgba(0,0,0,0)",x.fillStyle=D,x.fillRect(0,0,1,1);var Z=x.getImageData(0,0,1,1).data;ae=b[D]=[Z[0]/255,Z[1]/255,Z[2]/255]}else ae=[0,0,0];J=ae.slice()}return[U,J]}var I=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]],F={"rgb-hsb":function(D,z,U){var J=Math.max(D,z,U),te=Math.min(D,z,U),ee=J-te,j=ee===0?0:(J==D?(z-U)/ee+(z<U?6:0):J==z?(U-D)/ee+2:(D-z)/ee+4)*60;return[j,J===0?0:ee/J,J]},"hsb-rgb":function(D,z,U){D=(D/60%6+6)%6;var te=Math.floor(D),J=D-te,te=I[te],ee=[U,U*(1-z),U*(1-z*J),U*(1-z*(1-J))];return[ee[te[0]],ee[te[1]],ee[te[2]]]},"rgb-hsl":function(D,z,U){var J=Math.max(D,z,U),te=Math.min(D,z,U),ee=J-te,j=ee===0,pe=j?0:(J==D?(z-U)/ee+(z<U?6:0):J==z?(U-D)/ee+2:(D-z)/ee+4)*60,ie=(J+te)/2,fe=j?0:ie<.5?ee/(J+te):ee/(2-J-te);return[pe,fe,ie]},"hsl-rgb":function(D,z,U){if(D=(D/360%1+1)%1,z===0)return[U,U,U];for(var J=[D+1/3,D,D-1/3],te=U<.5?U*(1+z):U+z-U*z,ee=2*U-te,j=[],pe=0;pe<3;pe++){var ie=J[pe];ie<0&&(ie+=1),ie>1&&(ie-=1),j[pe]=6*ie<1?ee+(te-ee)*6*ie:2*ie<1?te:3*ie<2?ee+(te-ee)*(2/3-ie)*6:ee}return j},"rgb-gray":function(D,z,U){return[D*.2989+z*.587+U*.114]},"gray-rgb":function(D){return[D,D,D]},"gray-hsb":function(D){return[0,0,D]},"gray-hsl":function(D){return[0,0,D]},"gradient-rgb":function(){return[]},"rgb-gradient":function(){return[]}};return c.each(o,function(D,z){h[z]=[],c.each(D,function(U,J){var te=c.capitalize(U),ee=/^(hue|saturation)$/.test(U),j=h[z][J]=z==="gradient"?U==="gradient"?function(pe){var ie=this._components[0];return pe=ut.read(Array.isArray(pe)?pe:arguments,0,{readNull:!0}),ie!==pe&&(ie&&ie._removeOwner(this),pe&&pe._addOwner(this)),pe}:function(){return _.read(arguments,0,{readNull:U==="highlight",clone:!0})}:function(pe){return pe==null||isNaN(pe)?0:+pe};this["get"+te]=function(){return this._type===z||ee&&/^hs[bl]$/.test(this._type)?this._components[J]:this._convert(z)[J]},this["set"+te]=function(pe){this._type!==z&&!(ee&&/^hs[bl]$/.test(this._type))&&(this._components=this._convert(z),this._properties=o[z],this._type=z),this._components[J]=j.call(this,pe),this._changed()}},this)},{_class:"Color",_readIndex:!0,initialize:function D(z){var U=arguments,J=this.__read,te=0,ee,j,pe,ie;Array.isArray(z)&&(U=z,z=U[0]);var fe=z!=null&&typeof z;if(fe==="string"&&z in o&&(ee=z,z=U[1],Array.isArray(z)?(j=z,pe=U[2]):(J&&(te=1),U=c.slice(U,1),fe=typeof z)),!j){if(ie=fe==="number"?U:fe==="object"&&z.length!=null?z:null,ie){ee||(ee=ie.length>=3?"rgb":"gray");var ne=o[ee].length;pe=ie[ne],J&&(te+=ie===arguments?ne+(pe!=null?1:0):1),ie.length>ne&&(ie=c.slice(ie,0,ne))}else if(fe==="string"){var ae=E(z);ee=ae[0],j=ae[1],j.length===4&&(pe=j[3],j.length--)}else if(fe==="object")if(z.constructor===D){if(ee=z._type,j=z._components.slice(),pe=z._alpha,ee==="gradient")for(var Z=1,ue=j.length;Z<ue;Z++){var me=j[Z];me&&(j[Z]=me.clone())}}else if(z.constructor===ut)ee="gradient",ie=U;else{ee="hue"in z?"lightness"in z?"hsl":"hsb":"gradient"in z||"stops"in z||"radial"in z?"gradient":"gray"in z?"gray":"rgb";var we=o[ee],ge=h[ee];this._components=j=[];for(var Z=0,ue=we.length;Z<ue;Z++){var Ae=z[we[Z]];Ae==null&&!Z&&ee==="gradient"&&"stops"in z&&(Ae={stops:z.stops,radial:z.radial}),Ae=ge[Z].call(this,Ae),Ae!=null&&(j[Z]=Ae)}pe=z.alpha}J&&ee&&(te=1)}if(this._type=ee||"rgb",!j){this._components=j=[];for(var ge=h[this._type],Z=0,ue=ge.length;Z<ue;Z++){var Ae=ge[Z].call(this,ie&&ie[Z]);Ae!=null&&(j[Z]=Ae)}}return this._components=j,this._properties=o[this._type],this._alpha=pe,J&&(this.__read=te),this},set:"#initialize",_serialize:function(D,z){var U=this.getComponents();return c.serialize(/^(gray|rgb)$/.test(this._type)?U:[this._type].concat(U),D,!0,z)},_changed:function(){this._canvasStyle=null,this._owner&&(this._setter?this._owner[this._setter](this):this._owner._changed(129))},_convert:function(D){var z;return this._type===D?this._components.slice():(z=F[this._type+"-"+D])?z.apply(this,this._components):F["rgb-"+D].apply(this,F[this._type+"-rgb"].apply(this,this._components))},convert:function(D){return new Re(D,this._convert(D),this._alpha)},getType:function(){return this._type},setType:function(D){this._components=this._convert(D),this._properties=o[D],this._type=D},getComponents:function(){var D=this._components.slice();return this._alpha!=null&&D.push(this._alpha),D},getAlpha:function(){return this._alpha!=null?this._alpha:1},setAlpha:function(D){this._alpha=D==null?null:Math.min(Math.max(D,0),1),this._changed()},hasAlpha:function(){return this._alpha!=null},equals:function(D){var z=c.isPlainValue(D,!0)?Re.read(arguments):D;return z===this||z&&this._class===z._class&&this._type===z._type&&this.getAlpha()===z.getAlpha()&&c.equals(this._components,z._components)||!1},toString:function(){for(var D=this._properties,z=[],U=this._type==="gradient",J=A.instance,te=0,ee=D.length;te<ee;te++){var j=this._components[te];j!=null&&z.push(D[te]+": "+(U?j:J.number(j)))}return this._alpha!=null&&z.push("alpha: "+J.number(this._alpha)),"{ "+z.join(", ")+" }"},toCSS:function(D){var z=this._convert("rgb"),U=D||this._alpha==null?1:this._alpha;function J(te){return Math.round((te<0?0:te>1?1:te)*255)}return z=[J(z[0]),J(z[1]),J(z[2])],U<1&&z.push(U<0?0:U),D?"#"+((1<<24)+(z[0]<<16)+(z[1]<<8)+z[2]).toString(16).slice(1):(z.length==4?"rgba(":"rgb(")+z.join(",")+")"},toCanvasStyle:function(D,z){if(this._canvasStyle)return this._canvasStyle;if(this._type!=="gradient")return this._canvasStyle=this.toCSS();var U=this._components,J=U[0],te=J._stops,ee=U[1],j=U[2],pe=U[3],ie=z&&z.inverted(),fe;if(ie&&(ee=ie._transformPoint(ee),j=ie._transformPoint(j),pe&&(pe=ie._transformPoint(pe))),J._radial){var ne=j.getDistance(ee);if(pe){var ae=pe.subtract(ee);ae.getLength()>ne&&(pe=ee.add(ae.normalize(ne-.1)))}var Z=pe||ee;fe=D.createRadialGradient(Z.x,Z.y,0,ee.x,ee.y,ne)}else fe=D.createLinearGradient(ee.x,ee.y,j.x,j.y);for(var ue=0,me=te.length;ue<me;ue++){var we=te[ue],ge=we._offset;fe.addColorStop(ge??ue/(me-1),we._color.toCanvasStyle())}return this._canvasStyle=fe},transform:function(D){if(this._type==="gradient"){for(var z=this._components,U=1,J=z.length;U<J;U++){var te=z[U];D._transformPoint(te,te,!0)}this._changed()}},statics:{_types:o,random:function(){var D=Math.random;return new Re(D(),D(),D())},_setOwner:function(D,z,U){return D&&(D._owner&&z&&D._owner!==z&&(D=D.clone()),!D._owner^!z&&(D._owner=z||null,D._setter=U||null)),D}}})},new function(){var o={add:function(h,b){return h+b},subtract:function(h,b){return h-b},multiply:function(h,b){return h*b},divide:function(h,b){return h/b}};return c.each(o,function(h,b){this[b]=function(x){x=Re.read(arguments);for(var E=this._type,I=this._components,F=x._convert(E),D=0,z=I.length;D<z;D++)F[D]=h(I[D],F[D]);return new Re(E,F,this._alpha!=null?h(this._alpha,x.getAlpha()):null)}},{})}),ut=c.extend({_class:"Gradient",initialize:function(h,b){this._id=w.get(),h&&c.isPlainObject(h)&&(this.set(h),h=b=null),this._stops==null&&this.setStops(h||["white","black"]),this._radial==null&&this.setRadial(typeof b=="string"&&b==="radial"||b||!1)},_serialize:function(o,h){return h.add(this,function(){return c.serialize([this._stops,this._radial],o,!0,h)})},_changed:function(){for(var o=0,h=this._owners&&this._owners.length;o<h;o++)this._owners[o]._changed()},_addOwner:function(o){this._owners||(this._owners=[]),this._owners.push(o)},_removeOwner:function(o){var h=this._owners?this._owners.indexOf(o):-1;h!=-1&&(this._owners.splice(h,1),this._owners.length||(this._owners=a))},clone:function(){for(var o=[],h=0,b=this._stops.length;h<b;h++)o[h]=this._stops[h].clone();return new ut(o,this._radial)},getStops:function(){return this._stops},setStops:function(o){if(o.length<2)throw new Error("Gradient stop list needs to contain at least two stops.");var h=this._stops;if(h)for(var b=0,x=h.length;b<x;b++)h[b]._owner=a;h=this._stops=Lt.readList(o,0,{clone:!0});for(var b=0,x=h.length;b<x;b++)h[b]._owner=this;this._changed()},getRadial:function(){return this._radial},setRadial:function(o){this._radial=o,this._changed()},equals:function(o){if(o===this)return!0;if(o&&this._class===o._class){var h=this._stops,b=o._stops,x=h.length;if(x===b.length){for(var E=0;E<x;E++)if(!h[E].equals(b[E]))return!1;return!0}}return!1}}),Lt=c.extend({_class:"GradientStop",initialize:function(h,b){var x=h,E=b;typeof h=="object"&&b===a&&(Array.isArray(h)&&typeof h[0]!="number"?(x=h[0],E=h[1]):("color"in h||"offset"in h||"rampPoint"in h)&&(x=h.color,E=h.offset||h.rampPoint||0)),this.setColor(x),this.setOffset(E)},clone:function(){return new Lt(this._color.clone(),this._offset)},_serialize:function(o,h){var b=this._color,x=this._offset;return c.serialize(x==null?[b]:[b,x],o,!0,h)},_changed:function(){this._owner&&this._owner._changed(129)},getOffset:function(){return this._offset},setOffset:function(o){this._offset=o,this._changed()},getRampPoint:"#getOffset",setRampPoint:"#setOffset",getColor:function(){return this._color},setColor:function(){Re._setOwner(this._color,null),this._color=Re._setOwner(Re.read(arguments,0),this,"setColor"),this._changed()},equals:function(o){return o===this||o&&this._class===o._class&&this._color.equals(o._color)&&this._offset==o._offset||!1}}),it=c.extend(new function(){var o={fillColor:null,fillRule:"nonzero",strokeColor:null,strokeWidth:1,strokeCap:"butt",strokeJoin:"miter",strokeScaling:!0,miterLimit:10,dashOffset:0,dashArray:[],shadowColor:null,shadowBlur:0,shadowOffset:new _,selectedColor:null},h=c.set({},o,{fontFamily:"sans-serif",fontWeight:"normal",fontSize:12,leading:null,justification:"left"}),b=c.set({},h,{fillColor:new Re}),x={strokeWidth:193,strokeCap:193,strokeJoin:193,strokeScaling:201,miterLimit:193,fontFamily:9,fontWeight:9,fontSize:9,font:9,leading:9,justification:9},E={beans:!0},I={_class:"Style",beans:!0,initialize:function(D,z,U){this._values={},this._owner=z,this._project=z&&z._project||U||rt.project,this._defaults=!z||z instanceof ye?h:z instanceof De?b:o,D&&this.set(D)}};return c.each(h,function(F,D){var z=/Color$/.test(D),U=D==="shadowOffset",J=c.capitalize(D),te=x[D],ee="set"+J,j="get"+J;I[ee]=function(pe){var ie=this._owner,fe=ie&&ie._children,ne=fe&&fe.length>0&&!(ie instanceof Y);if(ne)for(var ae=0,Z=fe.length;ae<Z;ae++)fe[ae]._style[ee](pe);if((D==="selectedColor"||!ne)&&D in this._defaults){var ue=this._values[D];ue!==pe&&(z&&(ue&&(Re._setOwner(ue,null),ue._canvasStyle=null),pe&&pe.constructor===Re&&(pe=Re._setOwner(pe,ie,ne&&ee))),this._values[D]=pe,ie&&ie._changed(te||129))}},I[j]=function(pe){var ie=this._owner,fe=ie&&ie._children,ne=fe&&fe.length>0&&!(ie instanceof Y),ae;if(ne&&!pe)for(var Z=0,ue=fe.length;Z<ue;Z++){var me=fe[Z]._style[j]();if(!Z)ae=me;else if(!c.equals(ae,me))return a}else if(D in this._defaults){var ae=this._values[D];if(ae===a)ae=this._defaults[D],ae&&ae.clone&&(ae=ae.clone());else{var we=z?Re:U?_:null;we&&!(ae&&ae.constructor===we)&&(this._values[D]=ae=we.read([ae],0,{readNull:!0,clone:!0}))}}return ae&&z&&(ae=Re._setOwner(ae,ie,ne&&ee)),ae},E[j]=function(pe){return this._style[j](pe)},E[ee]=function(pe){this._style[ee](pe)}}),c.each({Font:"FontFamily",WindingRule:"FillRule"},function(F,D){var z="get"+D,U="set"+D;I[z]=E[z]="#get"+F,I[U]=E[U]="#set"+F}),R.inject(E),I},{set:function(o){var h=o instanceof it,b=h?o._values:o;if(b){for(var x in b)if(x in this._defaults){var E=b[x];this[x]=E&&h&&E.clone?E.clone():E}}},equals:function(o){function h(b,x,E){var I=b._values,F=x._values,D=x._defaults;for(var z in I){var U=I[z],J=F[z];if(!(E&&z in F)&&!c.equals(U,J===a?D[z]:J))return!1}return!0}return o===this||o&&this._class===o._class&&h(this,o)&&h(o,this,!0)||!1},_dispose:function(){var o;o=this.getFillColor(),o&&(o._canvasStyle=null),o=this.getStrokeColor(),o&&(o._canvasStyle=null),o=this.getShadowColor(),o&&(o._canvasStyle=null)},hasFill:function(){var o=this.getFillColor();return!!o&&o.alpha>0},hasStroke:function(){var o=this.getStrokeColor();return!!o&&o.alpha>0&&this.getStrokeWidth()>0},hasShadow:function(){var o=this.getShadowColor();return!!o&&o.alpha>0&&(this.getShadowBlur()>0||!this.getShadowOffset().isZero())},getView:function(){return this._project._view},getFontStyle:function(){var o=this.getFontSize();return this.getFontWeight()+" "+o+(/[a-z]/i.test(o+"")?" ":"px ")+this.getFontFamily()},getFont:"#getFontFamily",setFont:"#setFontFamily",getLeading:function o(){var h=o.base.call(this),b=this.getFontSize();return/pt|em|%|px/.test(b)&&(b=this.getView().getPixelSize(b)),h??b*1.2}}),Ct=new function(){function o(h,b,x,E){for(var I=["","webkit","moz","Moz","ms","o"],F=b[0].toUpperCase()+b.substring(1),D=0;D<6;D++){var z=I[D],U=z?z+F:b;if(U in h){if(x)h[U]=E;else return h[U];break}}}return{getStyles:function(h){var b=h&&h.nodeType!==9?h.ownerDocument:h,x=b&&b.defaultView;return x&&x.getComputedStyle(h,"")},getBounds:function(h,b){var x=h.ownerDocument,E=x.body,I=x.documentElement,F;try{F=h.getBoundingClientRect()}catch{F={left:0,top:0,width:0,height:0}}var D=F.left-(I.clientLeft||E.clientLeft||0),z=F.top-(I.clientTop||E.clientTop||0);if(!b){var U=x.defaultView;D+=U.pageXOffset||I.scrollLeft||E.scrollLeft,z+=U.pageYOffset||I.scrollTop||E.scrollTop}return new L(D,z,F.width,F.height)},getViewportBounds:function(h){var b=h.ownerDocument,x=b.defaultView,E=b.documentElement;return new L(0,0,x.innerWidth||E.clientWidth,x.innerHeight||E.clientHeight)},getOffset:function(h,b){return Ct.getBounds(h,b).getPoint()},getSize:function(h){return Ct.getBounds(h,!0).getSize()},isInvisible:function(h){return Ct.getSize(h).equals(new m(0,0))},isInView:function(h){return!Ct.isInvisible(h)&&Ct.getViewportBounds(h).intersects(Ct.getBounds(h,!0))},isInserted:function(h){return u.body.contains(h)},getPrefixed:function(h,b){return h&&o(h,b)},setPrefixed:function(h,b,x){if(typeof b=="object")for(var E in b)o(h,E,!0,b[E]);else o(h,b,!0,x)}}},It={add:function(o,h){if(o)for(var b in h)for(var x=h[b],E=b.split(/[\s,]+/g),I=0,F=E.length;I<F;I++){var D=E[I],z=o===u&&(D==="touchstart"||D==="touchmove")?{passive:!1}:!1;o.addEventListener(D,x,z)}},remove:function(o,h){if(o)for(var b in h)for(var x=h[b],E=b.split(/[\s,]+/g),I=0,F=E.length;I<F;I++)o.removeEventListener(E[I],x,!1)},getPoint:function(o){var h=o.targetTouches?o.targetTouches.length?o.targetTouches[0]:o.changedTouches[0]:o;return new _(h.pageX||h.clientX+u.documentElement.scrollLeft,h.pageY||h.clientY+u.documentElement.scrollTop)},getTarget:function(o){return o.target||o.srcElement},getRelatedTarget:function(o){return o.relatedTarget||o.toElement},getOffset:function(o,h){return It.getPoint(o).subtract(Ct.getOffset(h||It.getTarget(o)))}};It.requestAnimationFrame=new function(){var o=Ct.getPrefixed(l,"requestAnimationFrame"),h=!1,b=[],x;function E(){var I=b;b=[];for(var F=0,D=I.length;F<D;F++)I[F]();h=o&&b.length,h&&o(E)}return function(I){b.push(I),o?h||(o(E),h=!0):x||(x=setInterval(E,1e3/60))}};var at=c.extend(f,{_class:"View",initialize:function o(h,b){function x(te){return b[te]||parseInt(b.getAttribute(te),10)}function E(){var te=Ct.getSize(b);return te.isNaN()||te.isZero()?new m(x("width"),x("height")):te}var I;if(l&&b){this._id=b.getAttribute("id"),this._id==null&&b.setAttribute("id",this._id="paper-view-"+o._id++),It.add(b,this._viewEvents);var F="none";if(Ct.setPrefixed(b.style,{userDrag:F,userSelect:F,touchCallout:F,contentZooming:F,tapHighlightColor:"rgba(0,0,0,0)"}),p.hasAttribute(b,"resize")){var D=this;It.add(l,this._windowEvents={resize:function(){D.setViewSize(E())}})}if(I=E(),p.hasAttribute(b,"stats")&&typeof Stats<"u"){this._stats=new Stats;var z=this._stats.domElement,U=z.style,J=Ct.getOffset(b);U.position="absolute",U.left=J.x+"px",U.top=J.y+"px",u.body.appendChild(z)}}else I=new m(b),b=null;this._project=h,this._scope=h._scope,this._element=b,this._pixelRatio||(this._pixelRatio=l&&l.devicePixelRatio||1),this._setElementSize(I.width,I.height),this._viewSize=I,o._views.push(this),o._viewsById[this._id]=this,(this._matrix=new B)._owner=this,o._focused||(o._focused=this),this._frameItems={},this._frameItemCount=0,this._itemEvents={native:{},virtual:{}},this._autoUpdate=!rt.agent.node,this._needsUpdate=!1},remove:function(){if(!this._project)return!1;at._focused===this&&(at._focused=null),at._views.splice(at._views.indexOf(this),1),delete at._viewsById[this._id];var o=this._project;return o._view===this&&(o._view=null),It.remove(this._element,this._viewEvents),It.remove(l,this._windowEvents),this._element=this._project=null,this.off("frame"),this._animate=!1,this._frameItems={},!0},_events:c.each(R._itemHandlers.concat(["onResize","onKeyDown","onKeyUp"]),function(o){this[o]={}},{onFrame:{install:function(){this.play()},uninstall:function(){this.pause()}}}),_animate:!1,_time:0,_count:0,getAutoUpdate:function(){return this._autoUpdate},setAutoUpdate:function(o){this._autoUpdate=o,o&&this.requestUpdate()},update:function(){},draw:function(){this.update()},requestUpdate:function(){if(!this._requested){var o=this;It.requestAnimationFrame(function(){if(o._requested=!1,o._animate){o.requestUpdate();var h=o._element;(!Ct.getPrefixed(u,"hidden")||p.getAttribute(h,"keepalive")==="true")&&Ct.isInView(h)&&o._handleFrame()}o._autoUpdate&&o.update()}),this._requested=!0}},play:function(){this._animate=!0,this.requestUpdate()},pause:function(){this._animate=!1},_handleFrame:function(){rt=this._scope;var o=Date.now()/1e3,h=this._last?o-this._last:0;this._last=o,this.emit("frame",new c({delta:h,time:this._time+=h,count:this._count++})),this._stats&&this._stats.update()},_animateItem:function(o,h){var b=this._frameItems;h?(b[o._id]={item:o,time:0,count:0},++this._frameItemCount===1&&this.on("frame",this._handleFrameItems)):(delete b[o._id],--this._frameItemCount===0&&this.off("frame",this._handleFrameItems))},_handleFrameItems:function(o){for(var h in this._frameItems){var b=this._frameItems[h];b.item.emit("frame",new c(o,{time:b.time+=o.delta,count:b.count++}))}},_changed:function(){this._project._changed(4097),this._bounds=this._decomposed=a},getElement:function(){return this._element},getPixelRatio:function(){return this._pixelRatio},getResolution:function(){return this._pixelRatio*72},getViewSize:function(){var o=this._viewSize;return new T(o.width,o.height,this,"setViewSize")},setViewSize:function(){var o=m.read(arguments),h=o.subtract(this._viewSize);h.isZero()||(this._setElementSize(o.width,o.height),this._viewSize.set(o),this._changed(),this.emit("resize",{size:o,delta:h}),this._autoUpdate&&this.update())},_setElementSize:function(o,h){var b=this._element;b&&(b.width!==o&&(b.width=o),b.height!==h&&(b.height=h))},getBounds:function(){return this._bounds||(this._bounds=this._matrix.inverted()._transformBounds(new L(new _,this._viewSize))),this._bounds},getSize:function(){return this.getBounds().getSize()},isVisible:function(){return Ct.isInView(this._element)},isInserted:function(){return Ct.isInserted(this._element)},getPixelSize:function(o){var h=this._element,b;if(h){var x=h.parentNode,E=u.createElement("div");E.style.fontSize=o,x.appendChild(E),b=parseFloat(Ct.getStyles(E).fontSize),x.removeChild(E)}else b=parseFloat(b);return b},getTextWidth:function(o,h){return 0}},c.each(["rotate","scale","shear","skew"],function(o){var h=o==="rotate";this[o]=function(){var b=arguments,x=(h?c:_).read(b),E=_.read(b,0,{readNull:!0});return this.transform(new B()[o](x,E||this.getCenter(!0)))}},{_decompose:function(){return this._decomposed||(this._decomposed=this._matrix.decompose())},translate:function(){var o=new B;return this.transform(o.translate.apply(o,arguments))},getCenter:function(){return this.getBounds().getCenter()},setCenter:function(){var o=_.read(arguments);this.translate(this.getCenter().subtract(o))},getZoom:function(){var o=this._decompose().scaling;return(o.x+o.y)/2},setZoom:function(o){this.transform(new B().scale(o/this.getZoom(),this.getCenter()))},getRotation:function(){return this._decompose().rotation},setRotation:function(o){var h=this.getRotation();h!=null&&o!=null&&this.rotate(o-h)},getScaling:function(){var o=this._decompose().scaling;return new C(o.x,o.y,this,"setScaling")},setScaling:function(){var o=this.getScaling(),h=_.read(arguments,0,{clone:!0,readNull:!0});o&&h&&this.scale(h.x/o.x,h.y/o.y)},getMatrix:function(){return this._matrix},setMatrix:function(){var o=this._matrix;o.set.apply(o,arguments)},transform:function(o){this._matrix.append(o)},scrollBy:function(){this.translate(_.read(arguments).negate())}}),{projectToView:function(){return this._matrix._transformPoint(_.read(arguments))},viewToProject:function(){return this._matrix._inverseTransform(_.read(arguments))},getEventPoint:function(o){return this.viewToProject(It.getOffset(o,this._element))}},{statics:{_views:[],_viewsById:{},_id:0,create:function(o,h){u&&typeof h=="string"&&(h=u.getElementById(h));var b=l?Gt:at;return new b(o,h)}}},new function(){if(!l)return;var o,h,b=!1,x=!1;function E(Pe){var Fe=It.getTarget(Pe);return Fe.getAttribute&&at._viewsById[Fe.getAttribute("id")]}function I(){var Pe=at._focused;if(!Pe||!Pe.isVisible()){for(var Fe=0,Ve=at._views.length;Fe<Ve;Fe++)if((Pe=at._views[Fe]).isVisible()){at._focused=h=Pe;break}}}function F(Pe,Fe,Ve){Pe._handleMouseEvent("mousemove",Fe,Ve)}var D=l.navigator,z,U,J;D.pointerEnabled||D.msPointerEnabled?(z="pointerdown MSPointerDown",U="pointermove MSPointerMove",J="pointerup pointercancel MSPointerUp MSPointerCancel"):(z="touchstart",U="touchmove",J="touchend touchcancel","ontouchstart"in l&&D.userAgent.match(/mobile|tablet|ip(ad|hone|od)|android|silk/i)||(z+=" mousedown",U+=" mousemove",J+=" mouseup"));var te={},ee={mouseout:function(Pe){var Fe=at._focused,Ve=It.getRelatedTarget(Pe);if(Fe&&(!Ve||Ve.nodeName==="HTML")){var Ke=It.getOffset(Pe,Fe._element),Xe=Ke.x,je=Math.abs,gt=je(Xe),xt=1<<25,Mt=gt-xt;Ke.x=je(Mt)<gt?Mt*(Xe<0?-1:1):Xe,F(Fe,Pe,Fe.viewToProject(Ke))}},scroll:I};te[z]=function(Pe){var Fe=at._focused=E(Pe);b||(b=!0,Fe._handleMouseEvent("mousedown",Pe))},ee[U]=function(Pe){var Fe=at._focused;if(!x){var Ve=E(Pe);Ve?Fe!==Ve&&(Fe&&F(Fe,Pe),o||(o=Fe),Fe=at._focused=h=Ve):h&&h===Fe&&(o&&!o.isInserted()&&(o=null),Fe=at._focused=o,o=null,I())}Fe&&F(Fe,Pe)},ee[z]=function(){x=!0},ee[J]=function(Pe){var Fe=at._focused;Fe&&b&&Fe._handleMouseEvent("mouseup",Pe),x=b=!1},It.add(u,ee),It.add(l,{load:I});var j=!1,pe=!1,ie={doubleclick:"click",mousedrag:"mousemove"},fe=!1,ne,ae,Z,ue,me,we,ge,Ae;function Ie(Pe,Fe,Ve,Ke,Xe,je,gt){var xt=!1,Mt;function Bt(ot,ht){if(ot.responds(ht)){if(Mt||(Mt=new vr(ht,Ke,Xe,Fe||ot,je?Xe.subtract(je):null)),ot.emit(ht,Mt)&&(j=!0,Mt.prevented&&(pe=!0),Mt.stopped))return xt=!0}else{var Tt=ie[ht];if(Tt)return Bt(ot,Tt)}}for(;Pe&&Pe!==gt&&!Bt(Pe,Ve);)Pe=Pe._parent;return xt}function Oe(Pe,Fe,Ve,Ke,Xe,je){return Pe._project.removeOn(Ve),pe=j=!1,me&&Ie(me,null,Ve,Ke,Xe,je)||Fe&&Fe!==me&&!Fe.isDescendant(me)&&Ie(Fe,null,Ve==="mousedrag"?"mousemove":Ve,Ke,Xe,je,me)||Ie(Pe,me||Fe||Pe,Ve,Ke,Xe,je)}var qe={mousedown:{mousedown:1,mousedrag:1,click:1,doubleclick:1},mouseup:{mouseup:1,mousedrag:1,click:1,doubleclick:1},mousemove:{mousedrag:1,mousemove:1,mouseenter:1,mouseleave:1}};return{_viewEvents:te,_handleMouseEvent:function(Pe,Fe,Ve){var Ke=this._itemEvents,Xe=Ke.native[Pe],je=Pe==="mousemove",gt=this._scope.tool,xt=this;function Mt(Zt){return Ke.virtual[Zt]||xt.responds(Zt)||gt&>.responds(Zt)}je&&b&&Mt("mousedrag")&&(Pe="mousedrag"),Ve||(Ve=this.getEventPoint(Fe));var Bt=this.getBounds().contains(Ve),ot=Xe&&Bt&&xt._project.hitTest(Ve,{tolerance:0,fill:!0,stroke:!0}),ht=ot&&ot.item||null,Tt=!1,zt={};if(zt[Pe.substr(5)]=!0,Xe&&ht!==ue&&(ue&&Ie(ue,null,"mouseleave",Fe,Ve),ht&&Ie(ht,null,"mouseenter",Fe,Ve),ue=ht),fe^Bt&&(Ie(this,null,Bt?"mouseenter":"mouseleave",Fe,Ve),Tt=!0),(Bt||zt.drag)&&!Ve.equals(ae)&&(Oe(this,ht,je?Pe:"mousemove",Fe,Ve,ae),Tt=!0),fe=Bt,zt.down&&Bt||zt.up&&ne){if(Oe(this,ht,Pe,Fe,Ve,ne),zt.down){if(Ae=ht===we&&Date.now()-ge<300,Z=we=ht,!pe&&ht){for(var Ft=ht;Ft&&!Ft.responds("mousedrag");)Ft=Ft._parent;Ft&&(me=ht)}ne=Ve}else zt.up&&(!pe&&ht===Z&&(ge=Date.now(),Oe(this,ht,Ae?"doubleclick":"click",Fe,Ve,ne),Ae=!1),Z=me=null);fe=!1,Tt=!0}ae=Ve,Tt&>&&(j=gt._handleMouseEvent(Pe,Fe,Ve,zt)||j),Fe.cancelable!==!1&&(j&&!zt.move||zt.down&&Mt("mouseup"))&&Fe.preventDefault()},_handleKeyEvent:function(Pe,Fe,Ve,Ke){var Xe=this._scope,je=Xe.tool,gt;function xt(Mt){Mt.responds(Pe)&&(rt=Xe,Mt.emit(Pe,gt=gt||new ct(Pe,Fe,Ve,Ke)))}this.isVisible()&&(xt(this),je&&je.responds(Pe)&&xt(je))},_countItemEvent:function(Pe,Fe){var Ve=this._itemEvents,Ke=Ve.native,Xe=Ve.virtual;for(var je in qe)Ke[je]=(Ke[je]||0)+(qe[je][Pe]||0)*Fe;Xe[Pe]=(Xe[Pe]||0)+Fe},statics:{updateFocus:I,_resetState:function(){b=x=j=fe=!1,o=h=ne=ae=Z=ue=me=we=ge=Ae=null}}}}),Gt=at.extend({_class:"CanvasView",initialize:function(h,b){if(!(b instanceof l.HTMLCanvasElement)){var x=m.read(arguments,1);if(x.isZero())throw new Error("Cannot create CanvasView with the provided argument: "+c.slice(arguments,1));b=Ue.getCanvas(x)}var E=this._context=b.getContext("2d");if(E.save(),this._pixelRatio=1,!/^off|false$/.test(p.getAttribute(b,"hidpi"))){var I=l.devicePixelRatio||1,F=Ct.getPrefixed(E,"backingStorePixelRatio")||1;this._pixelRatio=I/F}at.call(this,h,b),this._needsUpdate=!0},remove:function o(){return this._context.restore(),o.base.call(this)},_setElementSize:function o(h,b){var x=this._pixelRatio;if(o.base.call(this,h*x,b*x),x!==1){var E=this._element,I=this._context;if(!p.hasAttribute(E,"resize")){var F=E.style;F.width=h+"px",F.height=b+"px"}I.restore(),I.save(),I.scale(x,x)}},getContext:function(){return this._context},getPixelSize:function o(h){var b=rt.agent,x;if(b&&b.firefox)x=o.base.call(this,h);else{var E=this._context,I=E.font;E.font=h+" serif",x=parseFloat(E.font),E.font=I}return x},getTextWidth:function(o,h){var b=this._context,x=b.font,E=0;b.font=o;for(var I=0,F=h.length;I<F;I++)E=Math.max(E,b.measureText(h[I]).width);return b.font=x,E},update:function(){if(!this._needsUpdate)return!1;var o=this._project,h=this._context,b=this._viewSize;return h.clearRect(0,0,b.width+1,b.height+1),o&&o.draw(h,this._matrix,this._pixelRatio),this._needsUpdate=!1,!0}}),Dt=c.extend({_class:"Event",initialize:function(h){this.event=h,this.type=h&&h.type},prevented:!1,stopped:!1,preventDefault:function(){this.prevented=!0,this.event.preventDefault()},stopPropagation:function(){this.stopped=!0,this.event.stopPropagation()},stop:function(){this.stopPropagation(),this.preventDefault()},getTimeStamp:function(){return this.event.timeStamp},getModifiers:function(){return gr.modifiers}}),ct=Dt.extend({_class:"KeyEvent",initialize:function(h,b,x,E){this.type=h,this.event=b,this.key=x,this.character=E},toString:function(){return"{ type: '"+this.type+"', key: '"+this.key+"', character: '"+this.character+"', modifiers: "+this.getModifiers()+" }"}}),gr=new function(){var o={" ":"tab"," ":"space","\b":"backspace","":"delete",Spacebar:"space",Del:"delete",Win:"meta",Esc:"escape"},h={tab:" ",space:" ",enter:"\r"},b={},x={},E,I,F=new c({shift:!1,control:!1,alt:!1,meta:!1,capsLock:!1,space:!1}).inject({option:{get:function(){return this.alt}},command:{get:function(){var U=rt&&rt.agent;return U&&U.mac?this.meta:this.control}}});function D(U){var J=U.key||U.keyIdentifier;return J=/^U\+/.test(J)?String.fromCharCode(parseInt(J.substr(2),16)):/^Arrow[A-Z]/.test(J)?J.substr(5):J==="Unidentified"||J===a?String.fromCharCode(U.keyCode):J,o[J]||(J.length>1?c.hyphenate(J):J.toLowerCase())}function z(U,J,te,ee){var j=at._focused,pe;if(b[J]=U,U?x[J]=te:delete x[J],J.length>1&&(pe=c.camelize(J))in F){F[pe]=U;var ie=rt&&rt.agent;if(pe==="meta"&&ie&&ie.mac)if(U)E={};else{for(var fe in E)fe in x&&z(!1,fe,E[fe],ee);E=null}}else U&&E&&(E[J]=te);j&&j._handleKeyEvent(U?"keydown":"keyup",ee,J,te)}return It.add(u,{keydown:function(U){var J=D(U),te=rt&&rt.agent;J.length>1||te&&te.chrome&&(U.altKey||te.mac&&U.metaKey||!te.mac&&U.ctrlKey)?z(!0,J,h[J]||(J.length>1?"":J),U):I=J},keypress:function(U){if(I){var J=D(U),te=U.charCode,ee=te>=32?String.fromCharCode(te):J.length>1?"":J;J!==I&&(J=ee.toLowerCase()),z(!0,J,ee,U),I=null}},keyup:function(U){var J=D(U);J in x&&z(!1,J,x[J],U)}}),It.add(l,{blur:function(U){for(var J in x)z(!1,J,x[J],U)}}),{modifiers:F,isDown:function(U){return!!b[U]}}},vr=Dt.extend({_class:"MouseEvent",initialize:function(h,b,x,E,I){this.type=h,this.event=b,this.point=x,this.target=E,this.delta=I},toString:function(){return"{ type: '"+this.type+"', point: "+this.point+", target: "+this.target+(this.delta?", delta: "+this.delta:"")+", modifiers: "+this.getModifiers()+" }"}}),er=Dt.extend({_class:"ToolEvent",_item:null,initialize:function(h,b,x){this.tool=h,this.type=b,this.event=x},_choosePoint:function(o,h){return o||(h?h.clone():null)},getPoint:function(){return this._choosePoint(this._point,this.tool._point)},setPoint:function(o){this._point=o},getLastPoint:function(){return this._choosePoint(this._lastPoint,this.tool._lastPoint)},setLastPoint:function(o){this._lastPoint=o},getDownPoint:function(){return this._choosePoint(this._downPoint,this.tool._downPoint)},setDownPoint:function(o){this._downPoint=o},getMiddlePoint:function(){return!this._middlePoint&&this.tool._lastPoint?this.tool._point.add(this.tool._lastPoint).divide(2):this._middlePoint},setMiddlePoint:function(o){this._middlePoint=o},getDelta:function(){return!this._delta&&this.tool._lastPoint?this.tool._point.subtract(this.tool._lastPoint):this._delta},setDelta:function(o){this._delta=o},getCount:function(){return this.tool[/^mouse(down|up)$/.test(this.type)?"_downCount":"_moveCount"]},setCount:function(o){this.tool[/^mouse(down|up)$/.test(this.type)?"downCount":"count"]=o},getItem:function(){if(!this._item){var o=this.tool._scope.project.hitTest(this.getPoint());if(o){for(var h=o.item,b=h._parent;/^(Group|CompoundPath)$/.test(b._class);)h=b,b=b._parent;this._item=h}}return this._item},setItem:function(o){this._item=o},toString:function(){return"{ type: "+this.type+", point: "+this.getPoint()+", count: "+this.getCount()+", modifiers: "+this.getModifiers()+" }"}}),Cr=y.extend({_class:"Tool",_list:"tools",_reference:"tool",_events:["onMouseDown","onMouseUp","onMouseDrag","onMouseMove","onActivate","onDeactivate","onEditOptions","onKeyDown","onKeyUp"],initialize:function(h){y.call(this),this._moveCount=-1,this._downCount=-1,this.set(h)},getMinDistance:function(){return this._minDistance},setMinDistance:function(o){this._minDistance=o,o!=null&&this._maxDistance!=null&&o>this._maxDistance&&(this._maxDistance=o)},getMaxDistance:function(){return this._maxDistance},setMaxDistance:function(o){this._maxDistance=o,this._minDistance!=null&&o!=null&&o<this._minDistance&&(this._minDistance=o)},getFixedDistance:function(){return this._minDistance==this._maxDistance?this._minDistance:null},setFixedDistance:function(o){this._minDistance=this._maxDistance=o},_handleMouseEvent:function(o,h,b,x){rt=this._scope,x.drag&&!this.responds(o)&&(o="mousemove");var E=x.move||x.drag,I=this.responds(o),F=!1,D=this;function z(J,te){var ee=b,j=E?D._point:D._downPoint||ee;if(E){if(D._moveCount>=0&&ee.equals(j))return!1;if(j&&(J!=null||te!=null)){var pe=ee.subtract(j),ie=pe.getLength();if(ie<(J||0))return!1;te&&(ee=j.add(pe.normalize(Math.min(ie,te))))}D._moveCount++}return D._point=ee,D._lastPoint=j||ee,x.down&&(D._moveCount=-1,D._downPoint=ee,D._downCount++),!0}function U(){I&&(F=D.emit(o,new er(D,o,h))||F)}if(x.down)z(),U();else if(x.up)z(null,this._maxDistance),U();else if(I)for(;z(this._minDistance,this._maxDistance);)U();return F}}),Wr=c.extend(f,{_class:"Tween",statics:{easings:new c({linear:function(o){return o},easeInQuad:function(o){return o*o},easeOutQuad:function(o){return o*(2-o)},easeInOutQuad:function(o){return o<.5?2*o*o:-1+2*(2-o)*o},easeInCubic:function(o){return o*o*o},easeOutCubic:function(o){return--o*o*o+1},easeInOutCubic:function(o){return o<.5?4*o*o*o:(o-1)*(2*o-2)*(2*o-2)+1},easeInQuart:function(o){return o*o*o*o},easeOutQuart:function(o){return 1- --o*o*o*o},easeInOutQuart:function(o){return o<.5?8*o*o*o*o:1-8*--o*o*o*o},easeInQuint:function(o){return o*o*o*o*o},easeOutQuint:function(o){return 1+--o*o*o*o*o},easeInOutQuint:function(o){return o<.5?16*o*o*o*o*o:1+16*--o*o*o*o*o}})},initialize:function o(h,b,x,E,I,F){this.object=h;var D=typeof I,z=D==="function";this.type=z?D:D==="string"?I:"linear",this.easing=z?I:o.easings[this.type],this.duration=E,this.running=!1,this._then=null,this._startTime=null;var U=b||x;this._keys=U?Object.keys(U):[],this._parsedKeys=this._parseKeys(this._keys),this._from=U&&this._getState(b),this._to=U&&this._getState(x),F!==!1&&this.start()},then:function(o){return this._then=o,this},start:function(){return this._startTime=null,this.running=!0,this},stop:function(){return this.running=!1,this},update:function(o){if(this.running){o>=1&&(o=1,this.running=!1);for(var h=this.easing(o),b=this._keys,x=function(J){return typeof J=="function"?J(h,o):J},E=0,I=b&&b.length;E<I;E++){var F=b[E],D=x(this._from[F]),z=x(this._to[F]),U=D&&z&&D.__add&&z.__add?z.__subtract(D).__multiply(h).__add(D):(z-D)*h+D;this._setProperty(this._parsedKeys[F],U)}this.responds("update")&&this.emit("update",new c({progress:o,factor:h})),!this.running&&this._then&&this._then(this.object)}return this},_events:{onUpdate:{}},_handleFrame:function(o){var h=this._startTime,b=h?(o-h)/this.duration:0;h||(this._startTime=o),this.update(b)},_getState:function(o){for(var h=this._keys,b={},x=0,E=h.length;x<E;x++){var I=h[x],F=this._parsedKeys[I],D=this._getProperty(F),z;if(o){var U=this._resolveValue(D,o[I]);this._setProperty(F,U),z=this._getProperty(F),z=z&&z.clone?z.clone():z,this._setProperty(F,D)}else z=D&&D.clone?D.clone():D;b[I]=z}return b},_resolveValue:function(o,h){if(h){if(Array.isArray(h)&&h.length===2){var b=h[0];return b&&b.match&&b.match(/^[+\-\*\/]=/)?this._calculate(o,b[0],h[1]):h}else if(typeof h=="string"){var x=h.match(/^[+\-*/]=(.*)/);if(x){var E=JSON.parse(x[1].replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:/g,'"$2": '));return this._calculate(o,h[0],E)}}}return h},_calculate:function(o,h,b){return rt.PaperScript.calculateBinary(o,h,b)},_parseKeys:function(o){for(var h={},b=0,x=o.length;b<x;b++){var E=o[b],I=E.replace(/\.([^.]*)/g,"/$1").replace(/\[['"]?([^'"\]]*)['"]?\]/g,"/$1");h[E]=I.split("/")}return h},_getProperty:function(o,h){for(var b=this.object,x=0,E=o.length-(h||0);x<E&&b;x++)b=b[o[x]];return b},_setProperty:function(o,h){var b=this._getProperty(o,1);b&&(b[o[o.length-1]]=h)}}),kr={request:function(o){var h=new r.XMLHttpRequest;return h.open((o.method||"get").toUpperCase(),o.url,c.pick(o.async,!0)),o.mimeType&&h.overrideMimeType(o.mimeType),h.onload=function(){var b=h.status;b===0||b===200?o.onLoad&&o.onLoad.call(h,h.responseText):h.onerror()},h.onerror=function(){var b=h.status,x='Could not load "'+o.url+'" (Status: '+b+")";if(o.onError)o.onError(x,b);else throw new Error(x)},h.send(null)}},Ue=c.exports.CanvasProvider={canvases:[],getCanvas:function(o,h,b){if(!l)return null;var x,E=!0;typeof o=="object"&&(h=o.height,o=o.width),this.canvases.length?x=this.canvases.pop():(x=u.createElement("canvas"),E=!1);var I=x.getContext("2d",b||{});if(!I)throw new Error("Canvas "+x+" is unable to provide a 2D context.");return x.width===o&&x.height===h?E&&I.clearRect(0,0,o+1,h+1):(x.width=o,x.height=h),I.save(),x},getContext:function(o,h,b){var x=this.getCanvas(o,h,b);return x?x.getContext("2d",b||{}):null},release:function(o){var h=o&&o.canvas?o.canvas:o;h&&h.getContext&&(h.getContext("2d").restore(),this.canvases.push(h))}},Je=new function(){var o=Math.min,h=Math.max,b=Math.abs,x,E,I,F,D,z,U,J,te,ee,j;function pe(me,we,ge){return .2989*me+.587*we+.114*ge}function ie(me,we,ge,Oe){var Ie=Oe-pe(me,we,ge);te=me+Ie,ee=we+Ie,j=ge+Ie;var Oe=pe(te,ee,j),qe=o(te,ee,j),Pe=h(te,ee,j);if(qe<0){var Fe=Oe-qe;te=Oe+(te-Oe)*Oe/Fe,ee=Oe+(ee-Oe)*Oe/Fe,j=Oe+(j-Oe)*Oe/Fe}if(Pe>255){var Ve=255-Oe,Ke=Pe-Oe;te=Oe+(te-Oe)*Ve/Ke,ee=Oe+(ee-Oe)*Ve/Ke,j=Oe+(j-Oe)*Ve/Ke}}function fe(me,we,ge){return h(me,we,ge)-o(me,we,ge)}function ne(me,we,ge,Ae){var Ie=[me,we,ge],Oe=h(me,we,ge),qe=o(me,we,ge),Pe;qe=qe===me?0:qe===we?1:2,Oe=Oe===me?0:Oe===we?1:2,Pe=o(qe,Oe)===0?h(qe,Oe)===1?2:1:0,Ie[Oe]>Ie[qe]?(Ie[Pe]=(Ie[Pe]-Ie[qe])*Ae/(Ie[Oe]-Ie[qe]),Ie[Oe]=Ae):Ie[Pe]=Ie[Oe]=0,Ie[qe]=0,te=Ie[0],ee=Ie[1],j=Ie[2]}var ae={multiply:function(){te=D*x/255,ee=z*E/255,j=U*I/255},screen:function(){te=D+x-D*x/255,ee=z+E-z*E/255,j=U+I-U*I/255},overlay:function(){te=D<128?2*D*x/255:255-2*(255-D)*(255-x)/255,ee=z<128?2*z*E/255:255-2*(255-z)*(255-E)/255,j=U<128?2*U*I/255:255-2*(255-U)*(255-I)/255},"soft-light":function(){var me=x*D/255;te=me+D*(255-(255-D)*(255-x)/255-me)/255,me=E*z/255,ee=me+z*(255-(255-z)*(255-E)/255-me)/255,me=I*U/255,j=me+U*(255-(255-U)*(255-I)/255-me)/255},"hard-light":function(){te=x<128?2*x*D/255:255-2*(255-x)*(255-D)/255,ee=E<128?2*E*z/255:255-2*(255-E)*(255-z)/255,j=I<128?2*I*U/255:255-2*(255-I)*(255-U)/255},"color-dodge":function(){te=D===0?0:x===255?255:o(255,255*D/(255-x)),ee=z===0?0:E===255?255:o(255,255*z/(255-E)),j=U===0?0:I===255?255:o(255,255*U/(255-I))},"color-burn":function(){te=D===255?255:x===0?0:h(0,255-(255-D)*255/x),ee=z===255?255:E===0?0:h(0,255-(255-z)*255/E),j=U===255?255:I===0?0:h(0,255-(255-U)*255/I)},darken:function(){te=D<x?D:x,ee=z<E?z:E,j=U<I?U:I},lighten:function(){te=D>x?D:x,ee=z>E?z:E,j=U>I?U:I},difference:function(){te=D-x,te<0&&(te=-te),ee=z-E,ee<0&&(ee=-ee),j=U-I,j<0&&(j=-j)},exclusion:function(){te=D+x*(255-D-D)/255,ee=z+E*(255-z-z)/255,j=U+I*(255-U-U)/255},hue:function(){ne(x,E,I,fe(D,z,U)),ie(te,ee,j,pe(D,z,U))},saturation:function(){ne(D,z,U,fe(x,E,I)),ie(te,ee,j,pe(D,z,U))},luminosity:function(){ie(D,z,U,pe(x,E,I))},color:function(){ie(x,E,I,pe(D,z,U))},add:function(){te=o(D+x,255),ee=o(z+E,255),j=o(U+I,255)},subtract:function(){te=h(D-x,0),ee=h(z-E,0),j=h(U-I,0)},average:function(){te=(D+x)/2,ee=(z+E)/2,j=(U+I)/2},negation:function(){te=255-b(255-x-D),ee=255-b(255-E-z),j=255-b(255-I-U)}},Z=this.nativeModes=c.each(["source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","lighter","darker","copy","xor"],function(me){this[me]=!0},{}),ue=Ue.getContext(1,1,{willReadFrequently:!0});ue&&(c.each(ae,function(me,we){var ge=we==="darken",Ae=!1;ue.save();try{ue.fillStyle=ge?"#300":"#a00",ue.fillRect(0,0,1,1),ue.globalCompositeOperation=we,ue.globalCompositeOperation===we&&(ue.fillStyle=ge?"#a00":"#300",ue.fillRect(0,0,1,1),Ae=ue.getImageData(0,0,1,1).data[0]!==ge?170:51)}catch{}ue.restore(),Z[we]=Ae}),Ue.release(ue)),this.process=function(me,we,ge,Ae,Ie){var Oe=we.canvas,qe=me==="normal";if(qe||Z[me])ge.save(),ge.setTransform(1,0,0,1,0,0),ge.globalAlpha=Ae,qe||(ge.globalCompositeOperation=me),ge.drawImage(Oe,Ie.x,Ie.y),ge.restore();else{var Pe=ae[me];if(!Pe)return;for(var Fe=ge.getImageData(Ie.x,Ie.y,Oe.width,Oe.height),Ve=Fe.data,Ke=we.getImageData(0,0,Oe.width,Oe.height).data,Xe=0,je=Ve.length;Xe<je;Xe+=4){x=Ke[Xe],D=Ve[Xe],E=Ke[Xe+1],z=Ve[Xe+1],I=Ke[Xe+2],U=Ve[Xe+2],F=Ke[Xe+3],J=Ve[Xe+3],Pe();var gt=F*Ae/255,xt=1-gt;Ve[Xe]=gt*te+xt*D,Ve[Xe+1]=gt*ee+xt*z,Ve[Xe+2]=gt*j+xt*U,Ve[Xe+3]=F*Ae+xt*J}ge.putImageData(Fe,Ie.x,Ie.y)}}},Ye=new function(){var o="http://www.w3.org/2000/svg",h="http://www.w3.org/2000/xmlns",b="http://www.w3.org/1999/xlink",x={href:b,xlink:h,xmlns:h+"/","xmlns:xlink":h+"/"};function E(D,z,U){return F(u.createElementNS(o,D),z,U)}function I(D,z){var U=x[z],J=U?D.getAttributeNS(U,z):D.getAttribute(z);return J==="null"?null:J}function F(D,z,U){for(var J in z){var te=z[J],ee=x[J];typeof te=="number"&&U&&(te=U.number(te)),ee?D.setAttributeNS(ee,J,te):D.setAttribute(J,te)}return D}return{svg:o,xmlns:h,xlink:b,create:E,get:I,set:F}},Qe=c.each({fillColor:["fill","color"],fillRule:["fill-rule","string"],strokeColor:["stroke","color"],strokeWidth:["stroke-width","number"],strokeCap:["stroke-linecap","string"],strokeJoin:["stroke-linejoin","string"],strokeScaling:["vector-effect","lookup",{true:"none",false:"non-scaling-stroke"},function(o,h){return!h&&(o instanceof Me||o instanceof se||o instanceof De)}],miterLimit:["stroke-miterlimit","number"],dashArray:["stroke-dasharray","array"],dashOffset:["stroke-dashoffset","number"],fontFamily:["font-family","string"],fontWeight:["font-weight","string"],fontSize:["font-size","number"],justification:["text-anchor","lookup",{left:"start",center:"middle",right:"end"}],opacity:["opacity","number"],blendMode:["mix-blend-mode","style"]},function(o,h){var b=c.capitalize(h),x=o[2];this[h]={type:o[1],property:h,attribute:o[0],toSVG:x,fromSVG:x&&c.each(x,function(E,I){this[E]=I},{}),exportFilter:o[3],get:"get"+b,set:"set"+b}},{});new function(){var o;function h(ae,Z,ue){var me=new c,we=ae.getTranslation();if(Z){var ge;ae.isInvertible()?(ae=ae._shiftless(),ge=ae._inverseTransform(we),we=null):ge=new _,me[ue?"cx":"x"]=ge.x,me[ue?"cy":"y"]=ge.y}if(!ae.isIdentity()){var Ae=ae.decompose();if(Ae){var Ie=[],Oe=Ae.rotation,qe=Ae.scaling,Pe=Ae.skewing;we&&!we.isZero()&&Ie.push("translate("+o.point(we)+")"),Oe&&Ie.push("rotate("+o.number(Oe)+")"),(!M.isZero(qe.x-1)||!M.isZero(qe.y-1))&&Ie.push("scale("+o.point(qe)+")"),Pe.x&&Ie.push("skewX("+o.number(Pe.x)+")"),Pe.y&&Ie.push("skewY("+o.number(Pe.y)+")"),me.transform=Ie.join(" ")}else me.transform="matrix("+ae.getValues().join(",")+")"}return me}function b(ae,Z){for(var ue=h(ae._matrix),me=ae._children,we=Ye.create("g",ue,o),ge=0,Ae=me.length;ge<Ae;ge++){var Ie=me[ge],Oe=fe(Ie,Z);if(Oe)if(Ie.isClipMask()){var qe=Ye.create("clipPath");qe.appendChild(Oe),pe(Ie,qe,"clip"),Ye.set(we,{"clip-path":"url(#"+qe.id+")"})}else we.appendChild(Oe)}return we}function x(ae,Z){var ue=h(ae._matrix,!0),me=ae.getSize(),we=ae.getImage();return ue.x-=me.width/2,ue.y-=me.height/2,ue.width=me.width,ue.height=me.height,ue.href=Z.embedImages==!1&&we&&we.src||ae.toDataURL(),Ye.create("image",ue,o)}function E(ae,Z){var ue=Z.matchShapes;if(ue){var me=ae.toShape(!1);if(me)return I(me)}var we=ae._segments,ge=we.length,Ae,Ie=h(ae._matrix);if(ue&&ge>=2&&!ae.hasHandles())if(ge>2){Ae=ae._closed?"polygon":"polyline";for(var Oe=[],qe=0;qe<ge;qe++)Oe.push(o.point(we[qe]._point));Ie.points=Oe.join(" ")}else{Ae="line";var Pe=we[0]._point,Fe=we[1]._point;Ie.set({x1:Pe.x,y1:Pe.y,x2:Fe.x,y2:Fe.y})}else Ae="path",Ie.d=ae.getPathData(null,Z.precision);return Ye.create(Ae,Ie,o)}function I(ae){var Z=ae._type,ue=ae._radius,me=h(ae._matrix,!0,Z!=="rectangle");if(Z==="rectangle"){Z="rect";var we=ae._size,ge=we.width,Ae=we.height;me.x-=ge/2,me.y-=Ae/2,me.width=ge,me.height=Ae,ue.isZero()&&(ue=null)}return ue&&(Z==="circle"?me.r=ue:(me.rx=ue.width,me.ry=ue.height)),Ye.create(Z,me,o)}function F(ae,Z){var ue=h(ae._matrix),me=ae.getPathData(null,Z.precision);return me&&(ue.d=me),Ye.create("path",ue,o)}function D(ae,Z){var ue=h(ae._matrix,!0),me=ae._definition,we=j(me,"symbol"),ge=me._item,Ae=ge.getStrokeBounds();return we||(we=Ye.create("symbol",{viewBox:o.rectangle(Ae)}),we.appendChild(fe(ge,Z)),pe(me,we,"symbol")),ue.href="#"+we.id,ue.x+=Ae.x,ue.y+=Ae.y,ue.width=Ae.width,ue.height=Ae.height,ue.overflow="visible",Ye.create("use",ue,o)}function z(ae){var Z=j(ae,"color");if(!Z){var ue=ae.getGradient(),me=ue._radial,we=ae.getOrigin(),ge=ae.getDestination(),Ae;if(me){Ae={cx:we.x,cy:we.y,r:we.getDistance(ge)};var Ie=ae.getHighlight();Ie&&(Ae.fx=Ie.x,Ae.fy=Ie.y)}else Ae={x1:we.x,y1:we.y,x2:ge.x,y2:ge.y};Ae.gradientUnits="userSpaceOnUse",Z=Ye.create((me?"radial":"linear")+"Gradient",Ae,o);for(var Oe=ue._stops,qe=0,Pe=Oe.length;qe<Pe;qe++){var Fe=Oe[qe],Ve=Fe._color,Ke=Ve.getAlpha(),Xe=Fe._offset;Ae={offset:Xe??qe/(Pe-1)},Ve&&(Ae["stop-color"]=Ve.toCSS(!0)),Ke<1&&(Ae["stop-opacity"]=Ke),Z.appendChild(Ye.create("stop",Ae,o))}pe(ae,Z,"color")}return"url(#"+Z.id+")"}function U(ae){var Z=Ye.create("text",h(ae._matrix,!0),o);return Z.textContent=ae._content,Z}var J={Group:b,Layer:b,Raster:x,Path:E,Shape:I,CompoundPath:F,SymbolItem:D,PointText:U};function te(ae,Z,ue,me){var we={},ge=!me&&ae.getParent(),Ae=[];return ae._name!=null&&(we.id=ae._name),c.each(Qe,function(Ie){var Oe=Ie.get,qe=Ie.type,Pe=ae[Oe]();if(Ie.exportFilter?Ie.exportFilter(ae,Pe):ue.reduceAttributes==!1||!ge||!c.equals(ge[Oe](),Pe)){if(qe==="color"&&Pe!=null){var Fe=Pe.getAlpha();Fe<1&&(we[Ie.attribute+"-opacity"]=Fe)}qe==="style"?Ae.push(Ie.attribute+": "+Pe):we[Ie.attribute]=Pe==null?"none":qe==="color"?Pe.gradient?z(Pe):Pe.toCSS(!0):qe==="array"?Pe.join(","):qe==="lookup"?Ie.toSVG[Pe]:Pe}}),Ae.length&&(we.style=Ae.join(";")),we.opacity===1&&delete we.opacity,ae._visible||(we.visibility="hidden"),Ye.set(Z,we,o)}var ee;function j(ae,Z){return ee||(ee={ids:{},svgs:{}}),ae&&ee.svgs[Z+"-"+(ae._id||ae.__id||(ae.__id=w.get("svg")))]}function pe(ae,Z,ue){ee||j();var me=ee.ids[ue]=(ee.ids[ue]||0)+1;Z.id=ue+"-"+me,ee.svgs[ue+"-"+(ae._id||ae.__id)]=Z}function ie(ae,Z){var ue=ae,me=null;if(ee){ue=ae.nodeName.toLowerCase()==="svg"&&ae;for(var we in ee.svgs)me||(ue||(ue=Ye.create("svg"),ue.appendChild(ae)),me=ue.insertBefore(Ye.create("defs"),ue.firstChild)),me.appendChild(ee.svgs[we]);ee=null}return Z.asString?new r.XMLSerializer().serializeToString(ue):ue}function fe(ae,Z,ue){var me=J[ae._class],we=me&&me(ae,Z);if(we){var ge=Z.onExport;ge&&(we=ge(ae,we,Z)||we);var Ae=JSON.stringify(ae._data);Ae&&Ae!=="{}"&&Ae!=="null"&&we.setAttribute("data-paper-data",Ae)}return we&&te(ae,we,Z,ue)}function ne(ae){return ae||(ae={}),o=new A(ae.precision),ae}R.inject({exportSVG:function(ae){return ae=ne(ae),ie(fe(this,ae,!0),ae)}}),G.inject({exportSVG:function(ae){ae=ne(ae);var Z=this._children,ue=this.getView(),me=c.pick(ae.bounds,"view"),we=ae.matrix||me==="view"&&ue._matrix,ge=we&&B.read([we]),Ae=me==="view"?new L([0,0],ue.getViewSize()):me==="content"?R._getBounds(Z,ge,{stroke:!0}).rect:L.read([me],0,{readNull:!0}),Ie={version:"1.1",xmlns:Ye.svg,"xmlns:xlink":Ye.xlink};Ae&&(Ie.width=Ae.width,Ie.height=Ae.height,(Ae.x||Ae.x===0||Ae.y||Ae.y===0)&&(Ie.viewBox=o.rectangle(Ae)));var Oe=Ye.create("svg",Ie,o),qe=Oe;ge&&!ge.isIdentity()&&(qe=Oe.appendChild(Ye.create("g",h(ge),o)));for(var Pe=0,Fe=Z.length;Pe<Fe;Pe++)qe.appendChild(fe(Z[Pe],ae,!0));return ie(Oe,ae)}})},new function(){var o={},h;function b(Z,ue,me,we,ge,Ae){var Ie=Ye.get(Z,ue)||Ae,Oe=Ie==null?we?null:me?"":0:me?Ie:parseFloat(Ie);return/%\s*$/.test(Ie)?Oe/100*(ge?1:h[/x|^width/.test(ue)?"width":"height"]):Oe}function x(Z,ue,me,we,ge,Ae,Ie){return ue=b(Z,ue||"x",!1,we,ge,Ae),me=b(Z,me||"y",!1,we,ge,Ie),we&&(ue==null||me==null)?null:new _(ue,me)}function E(Z,ue,me,we,ge){return ue=b(Z,ue||"width",!1,we,ge),me=b(Z,me||"height",!1,we,ge),we&&(ue==null||me==null)?null:new m(ue,me)}function I(Z,ue,me){return Z==="none"?null:ue==="number"?parseFloat(Z):ue==="array"?Z?Z.split(/[\s,]+/g).map(parseFloat):[]:ue==="color"?fe(Z)||Z:ue==="lookup"?me[Z]:Z}function F(Z,ue,me,we){var ge=Z.childNodes,Ae=ue==="clippath",Ie=ue==="defs",Oe=new ye,qe=Oe._project,Pe=qe._currentStyle,Fe=[];if(!Ae&&!Ie&&(Oe=ie(Oe,Z,we),qe._currentStyle=Oe._style.clone()),we)for(var Ve=Z.querySelectorAll("defs"),Ke=0,Xe=Ve.length;Ke<Xe;Ke++)ne(Ve[Ke],me,!1);for(var Ke=0,Xe=ge.length;Ke<Xe;Ke++){var je=ge[Ke],gt;je.nodeType===1&&!/^defs$/i.test(je.nodeName)&&(gt=ne(je,me,!1))&&!(gt instanceof ce)&&Fe.push(gt)}return Oe.addChildren(Fe),Ae&&(Oe=ie(Oe.reduce(),Z,we)),qe._currentStyle=Pe,(Ae||Ie)&&(Oe.remove(),Oe=null),Oe}function D(Z,ue){for(var me=Z.getAttribute("points").match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g),we=[],ge=0,Ae=me.length;ge<Ae;ge+=2)we.push(new _(parseFloat(me[ge]),parseFloat(me[ge+1])));var Ie=new H(we);return ue==="polygon"&&Ie.closePath(),Ie}function z(Z){return Me.create(Z.getAttribute("d"))}function U(Z,ue){var me=(b(Z,"href",!0)||"").substring(1),we=ue==="radialgradient",ge;if(me)ge=o[me].getGradient(),ge._radial^we&&(ge=ge.clone(),ge._radial=we);else{for(var Ae=Z.childNodes,Ie=[],Oe=0,qe=Ae.length;Oe<qe;Oe++){var Pe=Ae[Oe];Pe.nodeType===1&&Ie.push(ie(new Lt,Pe))}ge=new ut(Ie,we)}var Fe,Ve,Ke,Xe=b(Z,"gradientUnits",!0)!=="userSpaceOnUse";we?(Fe=x(Z,"cx","cy",!1,Xe,"50%","50%"),Ve=Fe.add(b(Z,"r",!1,!1,Xe,"50%"),0),Ke=x(Z,"fx","fy",!0,Xe)):(Fe=x(Z,"x1","y1",!1,Xe,"0%","0%"),Ve=x(Z,"x2","y2",!1,Xe,"100%","0%"));var je=ie(new Re(ge,Fe,Ve,Ke),Z);return je._scaleToBounds=Xe,null}var J={"#document":function(Z,ue,me,we){for(var ge=Z.childNodes,Ae=0,Ie=ge.length;Ae<Ie;Ae++){var Oe=ge[Ae];if(Oe.nodeType===1)return ne(Oe,me,we)}},g:F,svg:F,clippath:F,polygon:D,polyline:D,path:z,lineargradient:U,radialgradient:U,image:function(Z){var ue=new ve(b(Z,"href",!0));return ue.on("load",function(){var me=E(Z);this.setSize(me);var we=x(Z).add(me.divide(2));this._matrix.append(new B().translate(we))}),ue},symbol:function(Z,ue,me,we){return new ce(F(Z,ue,me,we),!0)},defs:F,use:function(Z){var ue=(b(Z,"href",!0)||"").substring(1),me=o[ue],we=x(Z);return me?me instanceof ce?me.place(we):me.clone().translate(we):null},circle:function(Z){return new se.Circle(x(Z,"cx","cy"),b(Z,"r"))},ellipse:function(Z){return new se.Ellipse({center:x(Z,"cx","cy"),radius:E(Z,"rx","ry")})},rect:function(Z){return new se.Rectangle(new L(x(Z),E(Z)),E(Z,"rx","ry"))},line:function(Z){return new H.Line(x(Z,"x1","y1"),x(Z,"x2","y2"))},text:function(Z){var ue=new $e(x(Z).add(x(Z,"dx","dy")));return ue.setContent(Z.textContent.trim()||""),ue},switch:F};function te(Z,ue,me,we){if(Z.transform){for(var ge=(we.getAttribute(me)||"").split(/\)\s*/g),Ae=new B,Ie=0,Oe=ge.length;Ie<Oe;Ie++){var qe=ge[Ie];if(!qe)break;for(var Pe=qe.split(/\(\s*/),Fe=Pe[0].trim(),Ve=Pe[1].split(/[\s,]+/g),Ke=0,Xe=Ve.length;Ke<Xe;Ke++)Ve[Ke]=parseFloat(Ve[Ke]);switch(Fe){case"matrix":Ae.append(new B(Ve[0],Ve[1],Ve[2],Ve[3],Ve[4],Ve[5]));break;case"rotate":Ae.rotate(Ve[0],Ve[1]||0,Ve[2]||0);break;case"translate":Ae.translate(Ve[0],Ve[1]||0);break;case"scale":Ae.scale(Ve);break;case"skewX":Ae.skew(Ve[0],0);break;case"skewY":Ae.skew(0,Ve[0]);break}}Z.transform(Ae)}}function ee(Z,ue,me){var we=me==="fill-opacity"?"getFillColor":"getStrokeColor",ge=Z[we]&&Z[we]();ge&&ge.setAlpha(parseFloat(ue))}var j=c.set(c.each(Qe,function(Z){this[Z.attribute]=function(ue,me){if(ue[Z.set]&&(ue[Z.set](I(me,Z.type,Z.fromSVG)),Z.type==="color")){var we=ue[Z.get]();if(we&&we._scaleToBounds){var ge=ue.getBounds();we.transform(new B().translate(ge.getPoint()).scale(ge.getSize()))}}}},{}),{id:function(Z,ue){o[ue]=Z,Z.setName&&Z.setName(ue)},"clip-path":function(Z,ue){var me=fe(ue);if(me)if(me=me.clone(),me.setClipMask(!0),Z instanceof ye)Z.insertChild(0,me);else return new ye(me,Z)},gradientTransform:te,transform:te,"fill-opacity":ee,"stroke-opacity":ee,visibility:function(Z,ue){Z.setVisible&&Z.setVisible(ue==="visible")},display:function(Z,ue){Z.setVisible&&Z.setVisible(ue!==null)},"stop-color":function(Z,ue){Z.setColor&&Z.setColor(ue)},"stop-opacity":function(Z,ue){Z._color&&Z._color.setAlpha(parseFloat(ue))},offset:function(Z,ue){if(Z.setOffset){var me=ue.match(/(.*)%$/);Z.setOffset(me?me[1]/100:parseFloat(ue))}},viewBox:function(Z,ue,me,we,ge){var Ae=new L(I(ue,"array")),Ie=E(we,null,null,!0),Oe,qe;if(Z instanceof ye){var Pe=Ie?Ie.divide(Ae.getSize()):1,qe=new B().scale(Pe).translate(Ae.getPoint().negate());Oe=Z}else Z instanceof ce&&(Ie&&Ae.setSize(Ie),Oe=Z._item);if(Oe){if(pe(we,"overflow",ge)!=="visible"){var Fe=new se.Rectangle(Ae);Fe.setClipMask(!0),Oe.addChild(Fe)}qe&&Oe.transform(qe)}}});function pe(Z,ue,me){var we=Z.attributes[ue],ge=we&&we.value;if(!ge&&Z.style){var Ae=c.camelize(ue);ge=Z.style[Ae],!ge&&me.node[Ae]!==me.parent[Ae]&&(ge=me.node[Ae])}return ge?ge==="none"?null:ge:a}function ie(Z,ue,me){var we=ue.parentNode,ge={node:Ct.getStyles(ue)||{},parent:!me&&!/^defs$/i.test(we.tagName)&&Ct.getStyles(we)||{}};return c.each(j,function(Ae,Ie){var Oe=pe(ue,Ie,ge);Z=Oe!==a&&Ae(Z,Oe,Ie,ue,ge)||Z}),Z}function fe(Z){var ue=Z&&Z.match(/\((?:["'#]*)([^"')]+)/),me=ue&&ue[1],we=me&&o[l?me.replace(l.location.href.split("#")[0]+"#",""):me];return we&&we._scaleToBounds&&(we=we.clone(),we._scaleToBounds=!0),we}function ne(Z,ue,me){var we=Z.nodeName.toLowerCase(),ge=we!=="#document",Ae=u.body,Ie,Oe,qe;me&&ge&&(h=rt.getView().getSize(),h=E(Z,null,null,!0)||h,Ie=Ye.create("svg",{style:"stroke-width: 1px; stroke-miterlimit: 10"}),Oe=Z.parentNode,qe=Z.nextSibling,Ie.appendChild(Z),Ae.appendChild(Ie));var Pe=rt.settings,Fe=Pe.applyMatrix,Ve=Pe.insertItems;Pe.applyMatrix=!1,Pe.insertItems=!1;var Ke=J[we],Xe=Ke&&Ke(Z,we,ue,me)||null;if(Pe.insertItems=Ve,Pe.applyMatrix=Fe,Xe){ge&&!(Xe instanceof ye)&&(Xe=ie(Xe,Z,me));var je=ue.onImport,gt=ge&&Z.getAttribute("data-paper-data");je&&(Xe=je(Z,Xe,ue)||Xe),ue.expandShapes&&Xe instanceof se&&(Xe.remove(),Xe=Xe.toPath()),gt&&(Xe._data=JSON.parse(gt))}return Ie&&(Ae.removeChild(Ie),Oe&&(qe?Oe.insertBefore(Z,qe):Oe.appendChild(Z))),me&&(o={},Xe&&c.pick(ue.applyMatrix,Fe)&&Xe.matrix.apply(!0,!0)),Xe}function ae(Z,ue,me){if(!Z)return null;ue=typeof ue=="function"?{onLoad:ue}:ue||{};var we=rt,ge=null;function Ae(Pe){try{var Fe=typeof Pe=="object"?Pe:new r.DOMParser().parseFromString(Pe.trim(),"image/svg+xml");if(!Fe.nodeName)throw Fe=null,new Error("Unsupported SVG source: "+Z);rt=we,ge=ne(Fe,ue,!0),(!ue||ue.insert!==!1)&&me._insertItem(a,ge);var Ve=ue.onLoad;Ve&&Ve(ge,Pe)}catch(Ke){Ie(Ke)}}function Ie(Pe,Fe){var Ve=ue.onError;if(Ve)Ve(Pe,Fe);else throw new Error(Pe)}if(typeof Z=="string"&&!/^[\s\S]*</.test(Z)){var Oe=u.getElementById(Z);Oe?Ae(Oe):kr.request({url:Z,async:!0,onLoad:Ae,onError:Ie})}else if(typeof File<"u"&&Z instanceof File){var qe=new FileReader;return qe.onload=function(){Ae(qe.result)},qe.onerror=function(){Ie(qe.error)},qe.readAsText(Z)}else Ae(Z);return ge}R.inject({importSVG:function(Z,ue){return ae(Z,ue,this)}}),G.inject({importSVG:function(Z,ue){return this.activate(),ae(Z,ue,this)}})},c.exports.PaperScript=function(){var o=this,h=o.acorn;if(!h&&typeof ZC<"u")try{h=tx()}catch{}if(!h){var b,x;h=b=x={},function(ie,fe){if(typeof b=="object"&&typeof x=="object")return fe(b);if(typeof a=="function"&&a.amd)return a(["exports"],fe);fe(ie.acorn||(ie.acorn={}))}(this,function(ie){ie.version="0.5.0";var fe,ne,ae,Z;ie.parse=function(Se,Te){return ne=String(Se),ae=ne.length,me(Te),Vo(),Fu(fe.program)};var ue=ie.defaultOptions={ecmaVersion:5,strictSemicolons:!1,allowTrailingCommas:!0,forbidReserved:!1,allowReturnOutsideFunction:!1,locations:!1,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null};function me(Se){fe=Se||{};for(var Te in ue)Object.prototype.hasOwnProperty.call(fe,Te)||(fe[Te]=ue[Te]);Z=fe.sourceFile||null}var we=ie.getLineInfo=function(Se,Te){for(var Ge=1,et=0;;){ks.lastIndex=et;var mt=ks.exec(Se);if(mt&&mt.index<Te)++Ge,et=mt.index+mt[0].length;else break}return{line:Ge,column:Te-et}};ie.tokenize=function(Se,Te){ne=String(Se),ae=ne.length,me(Te),Vo();var Ge={};function et(mt){return gt=Ie,Fs(mt),Ge.start=Ae,Ge.end=Ie,Ge.startLoc=Oe,Ge.endLoc=qe,Ge.type=Pe,Ge.value=Fe,Ge}return et.jumpTo=function(mt,or){if(ge=mt,fe.locations){Ke=1,Xe=ks.lastIndex=0;for(var dr;(dr=ks.exec(ne))&&dr.index<mt;)++Ke,Xe=dr.index+dr[0].length}Ve=or,va()},et};var ge,Ae,Ie,Oe,qe,Pe,Fe,Ve,Ke,Xe,je,gt,xt,Mt,Bt,ot;function ht(Se,Te){var Ge=we(ne,Se);Te+=" ("+Ge.line+":"+Ge.column+")";var et=new SyntaxError(Te);throw et.pos=Se,et.loc=Ge,et.raisedAt=ge,et}var Tt=[],zt={type:"num"},Ft={type:"regexp"},Zt={type:"string"},rr={type:"name"},sr={type:"eof"},fr={keyword:"break"},ur={keyword:"case",beforeExpr:!0},ln={keyword:"catch"},sn={keyword:"continue"},gn={keyword:"debugger"},Et={keyword:"default"},Lr={keyword:"do",isLoop:!0},Br={keyword:"else",beforeExpr:!0},Gn={keyword:"finally"},vn={keyword:"for",isLoop:!0},On={keyword:"function"},Ti={keyword:"if"},Zn={keyword:"return",beforeExpr:!0},Pn={keyword:"switch"},Yn={keyword:"throw",beforeExpr:!0},Nn={keyword:"try"},an={keyword:"var"},jr={keyword:"while",isLoop:!0},ca={keyword:"with"},Os={keyword:"new",beforeExpr:!0},ha={keyword:"this"},ws={keyword:"null",atomValue:null},Fo={keyword:"true",atomValue:!0},fa={keyword:"false",atomValue:!1},bi={keyword:"in",binop:7,beforeExpr:!0},Zi={break:fr,case:ur,catch:ln,continue:sn,debugger:gn,default:Et,do:Lr,else:Br,finally:Gn,for:vn,function:On,if:Ti,return:Zn,switch:Pn,throw:Yn,try:Nn,var:an,while:jr,with:ca,null:ws,true:Fo,false:fa,new:Os,in:bi,instanceof:{keyword:"instanceof",binop:7,beforeExpr:!0},this:ha,typeof:{keyword:"typeof",prefix:!0,beforeExpr:!0},void:{keyword:"void",prefix:!0,beforeExpr:!0},delete:{keyword:"delete",prefix:!0,beforeExpr:!0}},Dn={type:"[",beforeExpr:!0},as={type:"]"},yi={type:"{",beforeExpr:!0},mr={type:"}"},gi={type:"(",beforeExpr:!0},Kn={type:")"},vi={type:",",beforeExpr:!0},jn={type:";",beforeExpr:!0},Ss={type:":",beforeExpr:!0},Na={type:"."},La={type:"?",beforeExpr:!0},g={binop:10,beforeExpr:!0},P={isAssign:!0,beforeExpr:!0},re={isAssign:!0,beforeExpr:!0},_e={postfix:!0,prefix:!0,isUpdate:!0},Le={prefix:!0,beforeExpr:!0},Ze={binop:1,beforeExpr:!0},tt={binop:2,beforeExpr:!0},kt={binop:3,beforeExpr:!0},Nt={binop:4,beforeExpr:!0},_r={binop:5,beforeExpr:!0},cr={binop:6,beforeExpr:!0},Ut={binop:7,beforeExpr:!0},jt={binop:8,beforeExpr:!0},Ds={binop:9,prefix:!0,beforeExpr:!0},Cs={binop:10,beforeExpr:!0};ie.tokTypes={bracketL:Dn,bracketR:as,braceL:yi,braceR:mr,parenL:gi,parenR:Kn,comma:vi,semi:jn,colon:Ss,dot:Na,question:La,slash:g,eq:P,name:rr,eof:sr,num:zt,regexp:Ft,string:Zt};for(var Rs in Zi)ie.tokTypes["_"+Rs]=Zi[Rs];function Ii(Se){Se=Se.split(" ");var Te="",Ge=[];e:for(var et=0;et<Se.length;++et){for(var mt=0;mt<Ge.length;++mt)if(Ge[mt][0].length==Se[et].length){Ge[mt].push(Se[et]);continue e}Ge.push([Se[et]])}function or(ar){if(ar.length==1)return Te+="return str === "+JSON.stringify(ar[0])+";";Te+="switch(str){";for(var Bn=0;Bn<ar.length;++Bn)Te+="case "+JSON.stringify(ar[Bn])+":";Te+="return true}return false;"}if(Ge.length>3){Ge.sort(function(ar,Bn){return Bn.length-ar.length}),Te+="switch(str.length){";for(var et=0;et<Ge.length;++et){var dr=Ge[et];Te+="case "+dr[0].length+":",or(dr)}Te+="}"}else or(Se);return new Function("str",Te)}var xs=Ii("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile"),Ou=Ii("class enum extends super const export import"),qo=Ii("implements interface let package private protected public static yield"),zo=Ii("eval arguments"),Or=Ii("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"),Oa=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,mi="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",tl="̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_",da=new RegExp("["+mi+"]"),un=new RegExp("["+mi+tl+"]"),pa=/[\n\r\u2028\u2029]/,ks=/\r\n|[\n\r\u2028\u2029]/g,ga=ie.isIdentifierStart=function(Se){return Se<65?Se===36:Se<91?!0:Se<97?Se===95:Se<123?!0:Se>=170&&da.test(String.fromCharCode(Se))},Ho=ie.isIdentifierChar=function(Se){return Se<48?Se===36:Se<58?!0:Se<65?!1:Se<91?!0:Se<97?Se===95:Se<123?!0:Se>=170&&un.test(String.fromCharCode(Se))};function os(){this.line=Ke,this.column=ge-Xe}function Vo(){Ke=1,ge=Xe=0,Ve=!0,va()}function wr(Se,Te){Ie=ge,fe.locations&&(qe=new os),Pe=Se,va(),Fe=Te,Ve=Se.beforeExpr}function Du(){var Se=fe.onComment&&fe.locations&&new os,Te=ge,Ge=ne.indexOf("*/",ge+=2);if(Ge===-1&&ht(ge-2,"Unterminated comment"),ge=Ge+2,fe.locations){ks.lastIndex=Te;for(var et;(et=ks.exec(ne))&&et.index<ge;)++Ke,Xe=et.index+et[0].length}fe.onComment&&fe.onComment(!0,ne.slice(Te+2,Ge),Te,ge,Se,fe.locations&&new os)}function Jr(){for(var Se=ge,Te=fe.onComment&&fe.locations&&new os,Ge=ne.charCodeAt(ge+=2);ge<ae&&Ge!==10&&Ge!==13&&Ge!==8232&&Ge!==8233;)++ge,Ge=ne.charCodeAt(ge);fe.onComment&&fe.onComment(!1,ne.slice(Se+2,ge),Se,ge,Te,fe.locations&&new os)}function va(){for(;ge<ae;){var Se=ne.charCodeAt(ge);if(Se===32)++ge;else if(Se===13){++ge;var Te=ne.charCodeAt(ge);Te===10&&++ge,fe.locations&&(++Ke,Xe=ge)}else if(Se===10||Se===8232||Se===8233)++ge,fe.locations&&(++Ke,Xe=ge);else if(Se>8&&Se<14)++ge;else if(Se===47){var Te=ne.charCodeAt(ge+1);if(Te===42)Du();else if(Te===47)Jr();else break}else if(Se===160)++ge;else if(Se>=5760&&Oa.test(String.fromCharCode(Se)))++ge;else break}}function rl(){var Se=ne.charCodeAt(ge+1);return Se>=48&&Se<=57?Pi(!0):(++ge,wr(Na))}function Jn(){var Se=ne.charCodeAt(ge+1);return Ve?(++ge,gu()):Se===61?Ln(re,2):Ln(g,1)}function Bs(){var Se=ne.charCodeAt(ge+1);return Se===61?Ln(re,2):Ln(Cs,1)}function Da(Se){var Te=ne.charCodeAt(ge+1);return Te===Se?Ln(Se===124?Ze:tt,2):Te===61?Ln(re,2):Ln(Se===124?kt:_r,1)}function hr(){var Se=ne.charCodeAt(ge+1);return Se===61?Ln(re,2):Ln(Nt,1)}function ei(Se){var Te=ne.charCodeAt(ge+1);return Te===Se?Te==45&&ne.charCodeAt(ge+2)==62&&pa.test(ne.slice(gt,ge))?(ge+=3,Jr(),va(),Fs()):Ln(_e,2):Te===61?Ln(re,2):Ln(Ds,1)}function Ra(Se){var Te=ne.charCodeAt(ge+1),Ge=1;return Te===Se?(Ge=Se===62&&ne.charCodeAt(ge+2)===62?3:2,ne.charCodeAt(ge+Ge)===61?Ln(re,Ge+1):Ln(jt,Ge)):Te==33&&Se==60&&ne.charCodeAt(ge+2)==45&&ne.charCodeAt(ge+3)==45?(ge+=4,Jr(),va(),Fs()):(Te===61&&(Ge=ne.charCodeAt(ge+2)===61?3:2),Ln(Ut,Ge))}function Ru(Se){var Te=ne.charCodeAt(ge+1);return Te===61?Ln(cr,ne.charCodeAt(ge+2)===61?3:2):Ln(Se===61?P:Le,1)}function Ba(Se){switch(Se){case 46:return rl();case 40:return++ge,wr(gi);case 41:return++ge,wr(Kn);case 59:return++ge,wr(jn);case 44:return++ge,wr(vi);case 91:return++ge,wr(Dn);case 93:return++ge,wr(as);case 123:return++ge,wr(yi);case 125:return++ge,wr(mr);case 58:return++ge,wr(Ss);case 63:return++ge,wr(La);case 48:var Te=ne.charCodeAt(ge+1);if(Te===120||Te===88)return zs();case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return Pi(!1);case 34:case 39:return Bu(Se);case 47:return Jn();case 37:case 42:return Bs();case 124:case 38:return Da(Se);case 94:return hr();case 43:case 45:return ei(Se);case 60:case 62:return Ra(Se);case 61:case 33:return Ru(Se);case 126:return Ln(Le,1)}return!1}function Fs(Se){if(Se?ge=Ae+1:Ae=ge,fe.locations&&(Oe=new os),Se)return gu();if(ge>=ae)return wr(sr);var Te=ne.charCodeAt(ge);if(ga(Te)||Te===92)return ba();var Ge=Ba(Te);if(Ge===!1){var et=String.fromCharCode(Te);if(et==="\\"||da.test(et))return ba();ht(ge,"Unexpected character '"+et+"'")}return Ge}function Ln(Se,Te){var Ge=ne.slice(ge,ge+Te);ge+=Te,wr(Se,Ge)}function gu(){for(var mt="",Se,Te,Ge=ge;;){ge>=ae&&ht(Ge,"Unterminated regular expression");var et=ne.charAt(ge);if(pa.test(et)&&ht(Ge,"Unterminated regular expression"),Se)Se=!1;else{if(et==="[")Te=!0;else if(et==="]"&&Te)Te=!1;else if(et==="/"&&!Te)break;Se=et==="\\"}++ge}var mt=ne.slice(Ge,ge);++ge;var or=_a();or&&!/^[gmsiy]*$/.test(or)&&ht(Ge,"Invalid regexp flag");try{var dr=new RegExp(mt,or)}catch(ar){ar instanceof SyntaxError&&ht(Ge,ar.message),ht(ar)}return wr(Ft,dr)}function qs(Se,Te){for(var Ge=ge,et=0,mt=0,or=Te??1/0;mt<or;++mt){var dr=ne.charCodeAt(ge),ar;if(dr>=97?ar=dr-97+10:dr>=65?ar=dr-65+10:dr>=48&&dr<=57?ar=dr-48:ar=1/0,ar>=Se)break;++ge,et=et*Se+ar}return ge===Ge||Te!=null&&ge-Ge!==Te?null:et}function zs(){ge+=2;var Se=qs(16);return Se==null&&ht(Ae+2,"Expected hexadecimal number"),ga(ne.charCodeAt(ge))&&ht(ge,"Identifier directly after number"),wr(zt,Se)}function Pi(Se){var Te=ge,Ge=!1,et=ne.charCodeAt(ge)===48;!Se&&qs(10)===null&&ht(Te,"Invalid number"),ne.charCodeAt(ge)===46&&(++ge,qs(10),Ge=!0);var mt=ne.charCodeAt(ge);(mt===69||mt===101)&&(mt=ne.charCodeAt(++ge),(mt===43||mt===45)&&++ge,qs(10)===null&&ht(Te,"Invalid number"),Ge=!0),ga(ne.charCodeAt(ge))&&ht(ge,"Identifier directly after number");var or=ne.slice(Te,ge),dr;return Ge?dr=parseFloat(or):!et||or.length===1?dr=parseInt(or,10):/[89]/.test(or)||ot?ht(Te,"Invalid number"):dr=parseInt(or,8),wr(zt,dr)}function Bu(Se){ge++;for(var Te="";;){ge>=ae&&ht(Ae,"Unterminated string constant");var Ge=ne.charCodeAt(ge);if(Ge===Se)return++ge,wr(Zt,Te);if(Ge===92){Ge=ne.charCodeAt(++ge);var et=/^[0-7]+/.exec(ne.slice(ge,ge+3));for(et&&(et=et[0]);et&&parseInt(et,8)>255;)et=et.slice(0,-1);if(et==="0"&&(et=null),++ge,et)ot&&ht(ge-2,"Octal literal in strict mode"),Te+=String.fromCharCode(parseInt(et,8)),ge+=et.length-1;else switch(Ge){case 110:Te+=`
|
|
107
|
+
`;break;case 114:Te+="\r";break;case 120:Te+=String.fromCharCode(ma(2));break;case 117:Te+=String.fromCharCode(ma(4));break;case 85:Te+=String.fromCharCode(ma(8));break;case 116:Te+=" ";break;case 98:Te+="\b";break;case 118:Te+="\v";break;case 102:Te+="\f";break;case 48:Te+="\0";break;case 13:ne.charCodeAt(ge)===10&&++ge;case 10:fe.locations&&(Xe=ge,++Ke);break;default:Te+=String.fromCharCode(Ge);break}}else(Ge===13||Ge===10||Ge===8232||Ge===8233)&&ht(Ae,"Unterminated string constant"),Te+=String.fromCharCode(Ge),++ge}}function ma(Se){var Te=qs(16,Se);return Te===null&&ht(Ae,"Bad character escape sequence"),Te}var Ms;function _a(){Ms=!1;for(var Se,Te=!0,Ge=ge;;){var et=ne.charCodeAt(ge);if(Ho(et))Ms&&(Se+=ne.charAt(ge)),++ge;else if(et===92){Ms||(Se=ne.slice(Ge,ge)),Ms=!0,ne.charCodeAt(++ge)!=117&&ht(ge,"Expecting Unicode escape sequence \\uXXXX"),++ge;var mt=ma(4),or=String.fromCharCode(mt);or||ht(ge-1,"Invalid Unicode escape"),(Te?ga(mt):Ho(mt))||ht(ge-4,"Invalid Unicode escape"),Se+=or}else break;Te=!1}return Ms?Se:ne.slice(Ge,ge)}function ba(){var Se=_a(),Te=rr;return!Ms&&Or(Se)&&(Te=Zi[Se]),wr(Te,Se)}function Ir(){je=Ae,gt=Ie,xt=qe,Fs()}function nl(Se){if(ot=Se,ge=Ae,fe.locations)for(;ge<Xe;)Xe=ne.lastIndexOf(`
|
|
108
|
+
`,Xe-2)+1,--Ke;va(),Fs()}function ya(){this.type=null,this.start=Ae,this.end=null}function wa(){this.start=Oe,this.end=null,Z!==null&&(this.source=Z)}function Rn(){var Se=new ya;return fe.locations&&(Se.loc=new wa),fe.directSourceFile&&(Se.sourceFile=fe.directSourceFile),fe.ranges&&(Se.range=[Ae,0]),Se}function ji(Se){var Te=new ya;return Te.start=Se.start,fe.locations&&(Te.loc=new wa,Te.loc.start=Se.loc.start),fe.ranges&&(Te.range=[Se.range[0],0]),Te}function Kt(Se,Te){return Se.type=Te,Se.end=gt,fe.locations&&(Se.loc.end=xt),fe.ranges&&(Se.range[1]=gt),Se}function Hs(Se){return fe.ecmaVersion>=5&&Se.type==="ExpressionStatement"&&Se.expression.type==="Literal"&&Se.expression.value==="use strict"}function zr(Se){if(Pe===Se)return Ir(),!0}function Sa(){return!fe.strictSemicolons&&(Pe===sr||Pe===mr||pa.test(ne.slice(gt,Ae)))}function ls(){!zr(jn)&&!Sa()&&us()}function xn(Se){Pe===Se?Ir():us()}function us(){ht(Ae,"Unexpected token")}function Uo(Se){Se.type!=="Identifier"&&Se.type!=="MemberExpression"&&ht(Se.start,"Assigning to rvalue"),ot&&Se.type==="Identifier"&&zo(Se.name)&&ht(Se.start,"Assigning to "+Se.name+" in strict mode")}function Fu(Se){je=gt=ge,fe.locations&&(xt=new os),Mt=ot=null,Bt=[],Fs();var Te=Se||Rn(),Ge=!0;for(Se||(Te.body=[]);Pe!==sr;){var et=Fi();Te.body.push(et),Ge&&Hs(et)&&nl(!0),Ge=!1}return Kt(Te,"Program")}var il={kind:"loop"},Bi={kind:"switch"};function Fi(){(Pe===g||Pe===re&&Fe=="/=")&&Fs(!0);var Se=Pe,Te=Rn();switch(Se){case fr:case sn:Ir();var Ge=Se===fr;zr(jn)||Sa()?Te.label=null:Pe!==rr?us():(Te.label=Ne(),ls());for(var et=0;et<Bt.length;++et){var mt=Bt[et];if((Te.label==null||mt.name===Te.label.name)&&(mt.kind!=null&&(Ge||mt.kind==="loop")||Te.label&&Ge))break}return et===Bt.length&&ht(Te.start,"Unsyntactic "+Se.keyword),Kt(Te,Ge?"BreakStatement":"ContinueStatement");case gn:return Ir(),ls(),Kt(Te,"DebuggerStatement");case Lr:return Ir(),Bt.push(il),Te.body=Fi(),Bt.pop(),xn(jr),Te.test=Fa(),ls(),Kt(Te,"DoWhileStatement");case vn:if(Ir(),Bt.push(il),xn(gi),Pe===jn)return qa(Te,null);if(Pe===an){var or=Rn();return Ir(),Es(or,!0),Kt(or,"VariableDeclaration"),or.declarations.length===1&&zr(bi)?Xn(Te,or):qa(Te,or)}var or=Qn(!1,!0);return zr(bi)?(Uo(or),Xn(Te,or)):qa(Te,or);case On:return Ir(),Ce(Te,!0);case Ti:return Ir(),Te.test=Fa(),Te.consequent=Fi(),Te.alternate=zr(Br)?Fi():null,Kt(Te,"IfStatement");case Zn:return!Mt&&!fe.allowReturnOutsideFunction&&ht(Ae,"'return' outside of function"),Ir(),zr(jn)||Sa()?Te.argument=null:(Te.argument=Qn(),ls()),Kt(Te,"ReturnStatement");case Pn:Ir(),Te.discriminant=Fa(),Te.cases=[],xn(yi),Bt.push(Bi);for(var dr,ar;Pe!=mr;)if(Pe===ur||Pe===Et){var Bn=Pe===ur;dr&&Kt(dr,"SwitchCase"),Te.cases.push(dr=Rn()),dr.consequent=[],Ir(),Bn?dr.test=Qn():(ar&&ht(je,"Multiple default clauses"),ar=!0,dr.test=null),xn(Ss)}else dr||us(),dr.consequent.push(Fi());return dr&&Kt(dr,"SwitchCase"),Ir(),Bt.pop(),Kt(Te,"SwitchStatement");case Yn:return Ir(),pa.test(ne.slice(gt,Ae))&&ht(gt,"Illegal newline after throw"),Te.argument=Qn(),ls(),Kt(Te,"ThrowStatement");case Nn:if(Ir(),Te.block=cs(),Te.handler=null,Pe===ln){var Vs=Rn();Ir(),xn(gi),Vs.param=Ne(),ot&&zo(Vs.param.name)&&ht(Vs.param.start,"Binding "+Vs.param.name+" in strict mode"),xn(Kn),Vs.guard=null,Vs.body=cs(),Te.handler=Kt(Vs,"CatchClause")}return Te.guardedHandlers=Tt,Te.finalizer=zr(Gn)?cs():null,!Te.handler&&!Te.finalizer&&ht(Te.start,"Missing catch or finally clause"),Kt(Te,"TryStatement");case an:return Ir(),Es(Te),ls(),Kt(Te,"VariableDeclaration");case jr:return Ir(),Te.test=Fa(),Bt.push(il),Te.body=Fi(),Bt.pop(),Kt(Te,"WhileStatement");case ca:return ot&&ht(Ae,"'with' in strict mode"),Ir(),Te.object=Fa(),Te.body=Fi(),Kt(Te,"WithStatement");case yi:return cs();case jn:return Ir(),Kt(Te,"EmptyStatement");default:var wi=Fe,Ji=Qn();if(Se===rr&&Ji.type==="Identifier"&&zr(Ss)){for(var et=0;et<Bt.length;++et)Bt[et].name===wi&&ht(Ji.start,"Label '"+wi+"' is already declared");var Us=Pe.isLoop?"loop":Pe===Pn?"switch":null;return Bt.push({name:wi,kind:Us}),Te.body=Fi(),Bt.pop(),Te.label=Ji,Kt(Te,"LabeledStatement")}else return Te.expression=Ji,ls(),Kt(Te,"ExpressionStatement")}}function Fa(){xn(gi);var Se=Qn();return xn(Kn),Se}function cs(Se){var Te=Rn(),Ge=!0,et=!1,mt;for(Te.body=[],xn(yi);!zr(mr);){var or=Fi();Te.body.push(or),Ge&&Se&&Hs(or)&&(mt=et,nl(et=!0)),Ge=!1}return et&&!mt&&nl(!1),Kt(Te,"BlockStatement")}function qa(Se,Te){return Se.init=Te,xn(jn),Se.test=Pe===jn?null:Qn(),xn(jn),Se.update=Pe===Kn?null:Qn(),xn(Kn),Se.body=Fi(),Bt.pop(),Kt(Se,"ForStatement")}function Xn(Se,Te){return Se.left=Te,Se.right=Qn(),xn(Kn),Se.body=Fi(),Bt.pop(),Kt(Se,"ForInStatement")}function Es(Se,Te){for(Se.declarations=[],Se.kind="var";;){var Ge=Rn();if(Ge.id=Ne(),ot&&zo(Ge.id.name)&&ht(Ge.id.start,"Binding "+Ge.id.name+" in strict mode"),Ge.init=zr(P)?Qn(!0,Te):null,Se.declarations.push(Kt(Ge,"VariableDeclarator")),!zr(vi))break}return Se}function Qn(Se,Te){var Ge=sl(Te);if(!Se&&Pe===vi){var et=ji(Ge);for(et.expressions=[Ge];zr(vi);)et.expressions.push(sl(Te));return Kt(et,"SequenceExpression")}return Ge}function sl(Se){var Te=qu(Se);if(Pe.isAssign){var Ge=ji(Te);return Ge.operator=Fe,Ge.left=Te,Ir(),Ge.right=sl(Se),Uo(Te),Kt(Ge,"AssignmentExpression")}return Te}function qu(Se){var Te=qi(Se);if(zr(La)){var Ge=ji(Te);return Ge.test=Te,Ge.consequent=Qn(!0),xn(Ss),Ge.alternate=Qn(!0,Se),Kt(Ge,"ConditionalExpression")}return Te}function qi(Se){return cn(za(),-1,Se)}function cn(Se,Te,Ge){var et=Pe.binop;if(et!=null&&(!Ge||Pe!==bi)&&et>Te){var mt=ji(Se);mt.left=Se,mt.operator=Fe;var or=Pe;Ir(),mt.right=cn(za(),et,Ge);var dr=Kt(mt,or===Ze||or===tt?"LogicalExpression":"BinaryExpression");return cn(dr,Te,Ge)}return Se}function za(){if(Pe.prefix){var Se=Rn(),Te=Pe.isUpdate;return Se.operator=Fe,Se.prefix=!0,Ve=!0,Ir(),Se.argument=za(),Te?Uo(Se.argument):ot&&Se.operator==="delete"&&Se.argument.type==="Identifier"&&ht(Se.start,"Deleting local variable in strict mode"),Kt(Se,Te?"UpdateExpression":"UnaryExpression")}for(var Ge=zu();Pe.postfix&&!Sa();){var Se=ji(Ge);Se.operator=Fe,Se.prefix=!1,Se.argument=Ge,Uo(Ge),Ir(),Ge=Kt(Se,"UpdateExpression")}return Ge}function zu(){return Ha(al())}function Ha(Se,Te){if(zr(Na)){var Ge=ji(Se);return Ge.object=Se,Ge.property=Ne(!0),Ge.computed=!1,Ha(Kt(Ge,"MemberExpression"),Te)}else if(zr(Dn)){var Ge=ji(Se);return Ge.object=Se,Ge.property=Qn(),Ge.computed=!0,xn(as),Ha(Kt(Ge,"MemberExpression"),Te)}else if(!Te&&zr(gi)){var Ge=ji(Se);return Ge.callee=Se,Ge.arguments=Be(Kn,!1),Ha(Kt(Ge,"CallExpression"),Te)}else return Se}function al(){switch(Pe){case ha:var et=Rn();return Ir(),Kt(et,"ThisExpression");case rr:return Ne();case zt:case Zt:case Ft:var et=Rn();return et.value=Fe,et.raw=ne.slice(Ae,Ie),Ir(),Kt(et,"Literal");case ws:case Fo:case fa:var et=Rn();return et.value=Pe.atomValue,et.raw=Pe.keyword,Ir(),Kt(et,"Literal");case gi:var Se=Oe,Te=Ae;Ir();var Ge=Qn();return Ge.start=Te,Ge.end=Ie,fe.locations&&(Ge.loc.start=Se,Ge.loc.end=qe),fe.ranges&&(Ge.range=[Te,Ie]),xn(Kn),Ge;case Dn:var et=Rn();return Ir(),et.elements=Be(as,!0,!0),Kt(et,"ArrayExpression");case yi:return Vu();case On:var et=Rn();return Ir(),Ce(et,!1);case Os:return Hu();default:us()}}function Hu(){var Se=Rn();return Ir(),Se.callee=Ha(al(),!0),zr(gi)?Se.arguments=Be(Kn,!1):Se.arguments=Tt,Kt(Se,"NewExpression")}function Vu(){var Se=Rn(),Te=!0,Ge=!1;for(Se.properties=[],Ir();!zr(mr);){if(Te)Te=!1;else if(xn(vi),fe.allowTrailingCommas&&zr(mr))break;var et={key:Ni()},mt=!1,or;if(zr(Ss)?(et.value=Qn(!0),or=et.kind="init"):fe.ecmaVersion>=5&&et.key.type==="Identifier"&&(et.key.name==="get"||et.key.name==="set")?(mt=Ge=!0,or=et.kind=et.key.name,et.key=Ni(),Pe!==gi&&us(),et.value=Ce(Rn(),!1)):us(),et.key.type==="Identifier"&&(ot||Ge))for(var dr=0;dr<Se.properties.length;++dr){var ar=Se.properties[dr];if(ar.key.name===et.key.name){var Bn=or==ar.kind||mt&&ar.kind==="init"||or==="init"&&(ar.kind==="get"||ar.kind==="set");Bn&&!ot&&or==="init"&&ar.kind==="init"&&(Bn=!1),Bn&&ht(et.key.start,"Redefinition of property")}}Se.properties.push(et)}return Kt(Se,"ObjectExpression")}function Ni(){return Pe===zt||Pe===Zt?al():Ne(!0)}function Ce(Se,Te){Pe===rr?Se.id=Ne():Te?us():Se.id=null,Se.params=[];var Ge=!0;for(xn(gi);!zr(Kn);)Ge?Ge=!1:xn(vi),Se.params.push(Ne());var et=Mt,mt=Bt;if(Mt=!0,Bt=[],Se.body=cs(!0),Mt=et,Bt=mt,ot||Se.body.body.length&&Hs(Se.body.body[0]))for(var or=Se.id?-1:0;or<Se.params.length;++or){var dr=or<0?Se.id:Se.params[or];if((qo(dr.name)||zo(dr.name))&&ht(dr.start,"Defining '"+dr.name+"' in strict mode"),or>=0)for(var ar=0;ar<or;++ar)dr.name===Se.params[ar].name&&ht(dr.start,"Argument name clash in strict mode")}return Kt(Se,Te?"FunctionDeclaration":"FunctionExpression")}function Be(Se,Te,Ge){for(var et=[],mt=!0;!zr(Se);){if(mt)mt=!1;else if(xn(vi),Te&&fe.allowTrailingCommas&&zr(Se))break;Ge&&Pe===vi?et.push(null):et.push(Qn(!0))}return et}function Ne(Se){var Te=Rn();return Se&&fe.forbidReserved=="everywhere"&&(Se=!1),Pe===rr?(!Se&&(fe.forbidReserved&&(fe.ecmaVersion===3?xs:Ou)(Fe)||ot&&qo(Fe))&&ne.slice(Ae,Ie).indexOf("\\")==-1&&ht(Ae,"The keyword '"+Fe+"' is reserved"),Te.name=Fe):Se&&Pe.keyword?Te.name=Pe.keyword:us(),Ve=!1,Ir(),Kt(Te,"Identifier")}}),h.version||(h=null)}function E(ie,fe){return(o.acorn||h).parse(ie,fe)}var I={"+":"__add","-":"__subtract","*":"__multiply","/":"__divide","%":"__modulo","==":"__equals","!=":"__equals"},F={"-":"__negate","+":"__self"},D=c.each(["add","subtract","multiply","divide","modulo","equals","negate"],function(ie){this["__"+ie]="#"+ie},{__self:function(){return this}});_.inject(D),m.inject(D),Re.inject(D);function z(ie,fe,ne){var ae=I[fe];if(ie&&ie[ae]){var Z=ie[ae](ne);return fe==="!="?!Z:Z}switch(fe){case"+":return ie+ne;case"-":return ie-ne;case"*":return ie*ne;case"/":return ie/ne;case"%":return ie%ne;case"==":return ie==ne;case"!=":return ie!=ne}}function U(ie,fe){var ne=F[ie];if(fe&&fe[ne])return fe[ne]();switch(ie){case"+":return+fe;case"-":return-fe}}function J(ie,fe){if(!ie)return"";fe=fe||{};var ne=[];function ae(ot){for(var ht=0,Tt=ne.length;ht<Tt;ht++){var zt=ne[ht];if(zt[0]>=ot)break;ot+=zt[1]}return ot}function Z(ot){return ie.substring(ae(ot.range[0]),ae(ot.range[1]))}function ue(ot,ht){return ie.substring(ae(ot.range[1]),ae(ht.range[0]))}function me(ot,ht){for(var Tt=ae(ot.range[0]),zt=ae(ot.range[1]),Ft=0,Zt=ne.length-1;Zt>=0;Zt--)if(Tt>ne[Zt][0]){Ft=Zt+1;break}ne.splice(Ft,0,[Tt,ht.length-zt+Tt]),ie=ie.substring(0,Tt)+ht+ie.substring(zt)}function we(ot,ht){switch(ot.type){case"UnaryExpression":if(ot.operator in F&&ot.argument.type!=="Literal"){var Tt=Z(ot.argument);me(ot,'$__("'+ot.operator+'", '+Tt+")")}break;case"BinaryExpression":if(ot.operator in I&&ot.left.type!=="Literal"){var zt=Z(ot.left),Ft=Z(ot.right),Zt=ue(ot.left,ot.right),rr=ot.operator;me(ot,"__$__("+zt+","+Zt.replace(new RegExp("\\"+rr),'"'+rr+'"')+", "+Ft+")")}break;case"UpdateExpression":case"AssignmentExpression":var sr=ht&&ht.type;if(!(sr==="ForStatement"||sr==="BinaryExpression"&&/^[=!<>]/.test(ht.operator)||sr==="MemberExpression"&&ht.computed)){if(ot.type==="UpdateExpression"){var Tt=Z(ot.argument),fr="__$__("+Tt+', "'+ot.operator[0]+'", 1)',ur=Tt+" = "+fr;ot.prefix?ur="("+ur+")":(sr==="AssignmentExpression"||sr==="VariableDeclarator"||sr==="BinaryExpression")&&(Z(ht.left||ht.id)===Tt&&(ur=fr),ur=Tt+"; "+ur),me(ot,ur)}else if(/^.=$/.test(ot.operator)&&ot.left.type!=="Literal"){var zt=Z(ot.left),Ft=Z(ot.right),fr=zt+" = __$__("+zt+', "'+ot.operator[0]+'", '+Ft+")";me(ot,/^\(.*\)$/.test(Z(ot))?"("+fr+")":fr)}}break}}function ge(ot){switch(ot.type){case"ExportDefaultDeclaration":me({range:[ot.start,ot.declaration.start]},"module.exports = ");break;case"ExportNamedDeclaration":var ht=ot.declaration,Tt=ot.specifiers;if(ht){var zt=ht.declarations;zt&&(zt.forEach(function(Zt){me(Zt,"module.exports."+Z(Zt))}),me({range:[ot.start,ht.start+ht.kind.length]},""))}else if(Tt){var Ft=Tt.map(function(Zt){var rr=Z(Zt);return"module.exports."+rr+" = "+rr+"; "}).join("");Ft&&me(ot,Ft)}break}}function Ae(ot,ht,Tt){if(ot){for(var zt in ot)if(zt!=="range"&&zt!=="loc"){var Ft=ot[zt];if(Array.isArray(Ft))for(var Zt=0,rr=Ft.length;Zt<rr;Zt++)Ae(Ft[Zt],ot,Tt);else Ft&&typeof Ft=="object"&&Ae(Ft,ot,Tt)}Tt.operatorOverloading!==!1&&we(ot,ht),Tt.moduleExports!==!1&&ge(ot)}}function Ie(ot){var ht="",Tt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ot=(Math.abs(ot)<<1)+(ot<0?1:0);ot||!ht;){var zt=ot&31;ot>>=5,ot&&(zt|=32),ht+=Tt[zt]}return ht}var Oe=fe.url||"",qe=fe.sourceMaps,Pe=fe.paperFeatures||{},Fe=fe.source||ie,Ve=fe.offset||0,Ke=rt.agent,Xe=Ke.versionNumber,je=!1,gt=/\r\n|\n|\r/mg,xt;if(qe&&(Ke.chrome&&Xe>=30||Ke.webkit&&Xe>=537.76||Ke.firefox&&Xe>=23||Ke.node)){if(Ke.node)Ve-=2;else if(l&&Oe&&!l.location.href.indexOf(Oe)){var Mt=u.getElementsByTagName("html")[0].innerHTML;Ve=Mt.substr(0,Mt.indexOf(ie)+1).match(gt).length+1}je=Ve>0&&!(Ke.chrome&&Xe>=36||Ke.safari&&Xe>=600||Ke.firefox&&Xe>=40||Ke.node);var Bt=["AA"+Ie(je?0:Ve)+"A"];Bt.length=(ie.match(gt)||[]).length+1+(je?Ve:0),xt={version:3,file:Oe,names:[],mappings:Bt.join(";AACA"),sourceRoot:"",sources:[Oe],sourcesContent:[Fe]}}return(Pe.operatorOverloading!==!1||Pe.moduleExports!==!1)&&Ae(E(ie,{ranges:!0,preserveParens:!0,sourceType:"module"}),null,Pe),xt&&(je&&(ie=new Array(Ve+1).join(`
|
|
109
|
+
`)+ie),/^(inline|both)$/.test(qe)&&(ie+=`
|
|
110
|
+
//# sourceMappingURL=data:application/json;base64,`+r.btoa(unescape(encodeURIComponent(JSON.stringify(xt))))),ie+=`
|
|
111
|
+
//# sourceURL=`+(Oe||"paperscript")),{url:Oe,source:Fe,code:ie,map:xt}}function te(ie,fe,ne){rt=fe;var ae=fe.getView(),Z=/\btool\.\w+|\s+on(?:Key|Mouse)(?:Up|Down|Move|Drag)\b/.test(ie)&&!/\bnew\s+Tool\b/.test(ie)?new Cr:null,ue=Z?Z._events:[],me=["onFrame","onResize"].concat(ue),we=[],ge=[],Ae,Ie=typeof ie=="object"?ie:J(ie,ne);ie=Ie.code;function Oe(Xe,je){for(var gt in Xe)(je||!/^_/.test(gt))&&new RegExp("([\\b\\s\\W]|^)"+gt.replace(/\$/g,"\\$")+"\\b").test(ie)&&(we.push(gt),ge.push(Xe[gt]))}Oe({__$__:z,$__:U,paper:fe,tool:Z},!0),Oe(fe),ie="var module = { exports: {} }; "+ie;var Ve=c.each(me,function(Xe){new RegExp("\\s+"+Xe+"\\b").test(ie)&&(we.push(Xe),this.push("module.exports."+Xe+" = "+Xe+";"))},[]).join(`
|
|
112
|
+
`);Ve&&(ie+=`
|
|
113
|
+
`+Ve),ie+=`
|
|
114
|
+
return module.exports;`;var qe=rt.agent;if(u&&(qe.chrome||qe.firefox&&qe.versionNumber<40)){var Pe=u.createElement("script"),Fe=u.head||u.getElementsByTagName("head")[0];qe.firefox&&(ie=`
|
|
115
|
+
`+ie),Pe.appendChild(u.createTextNode("document.__paperscript__ = function("+we+") {"+ie+`
|
|
116
|
+
}`)),Fe.appendChild(Pe),Ae=u.__paperscript__,delete u.__paperscript__,Fe.removeChild(Pe)}else Ae=Function(we,ie);var Ve=Ae&&Ae.apply(fe,ge),Ke=Ve||{};return c.each(ue,function(Xe){var je=Ke[Xe];je&&(Z[Xe]=je)}),ae&&(Ke.onResize&&ae.setOnResize(Ke.onResize),ae.emit("resize",{size:ae.size,delta:new _}),Ke.onFrame&&ae.setOnFrame(Ke.onFrame),ae.requestUpdate()),Ve}function ee(ie){if(/^text\/(?:x-|)paperscript$/.test(ie.type)&&p.getAttribute(ie,"ignore")!=="true"){var fe=p.getAttribute(ie,"canvas"),ne=u.getElementById(fe),ae=ie.src||ie.getAttribute("data-src"),Z=p.hasAttribute(ie,"async"),ue="data-paper-scope";if(!ne)throw new Error('Unable to find canvas with id "'+fe+'"');var me=p.get(ne.getAttribute(ue))||new p().setup(ne);return ne.setAttribute(ue,me._id),ae?kr.request({url:ae,async:Z,mimeType:"text/plain",onLoad:function(we){te(we,me,ae)}}):te(ie.innerHTML,me,ie.baseURI),ie.setAttribute("data-paper-ignore","true"),me}}function j(){c.each(u&&u.getElementsByTagName("script"),ee)}function pe(ie){return ie?ee(ie):j()}return l&&(u.readyState==="complete"?setTimeout(j):It.add(l,{load:j})),{compile:J,execute:te,load:pe,parse:E,calculateBinary:z,calculateUnary:U}}.call(this);var rt=new(p.inject(c.exports,{Base:c,Numerical:M,Key:gr,DomEvent:It,DomElement:Ct,document:u,window:l,Symbol:ce,PlacedSymbol:he}));return rt.agent.node&&ww(rt),typeof a=="function"&&a.amd?a("paper",rt):t&&(t.exports=rt),rt}).call(rx,typeof self=="object"?self:null)}(_h)),_h.exports}var ix=nx();const tu=Vh(ix),sx=qr({name:"CalculateSupplementaryAngle",components:{UserInputNumber:cu},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"CalculateSupplementaryAngle"),l=Wn(a),u=Qt(""),c=Qt(null),f=Qt();l.question.value=new p2(t.data);const p=(y,S,A,M,w,_,C=30)=>new y.Point(S/2+C*N0(A+(M+w)/2),_/2+C*L0(A+(M+w)/2));return oa(async()=>{if(await P7(),!c.value)return;f.value=new tu.PaperScope,f.value.setup(c.value);const y=f.value,S=c.value.width,A=c.value.height,M=ko(0,360),w=S*N0(M),_=S*L0(M),C=new y.Path.Line({from:new y.Point(S/2+w,A/2+_),to:new y.Point(S/2-w,A/2-_)});C.strokeColor=new tu.Color("black");let m=0;const T=[];if(l.question.value)for(let L=0;L<l.question.value.angles.length;L++){const N=l.question.value.angles[L];m+=N,console.log(`drawing angle ${L}:
|
|
117
|
+
angle: ${N}
|
|
118
|
+
angleSum: ${m}
|
|
119
|
+
`);let B;const W=m-N;L===l.question.value.angles.length-1?B=180:B=m;const G=new y.Point(S/2+30*N0(M+W),A/2+30*L0(M+W)),R=p(y,S,M,W,B,A),ye=new y.Point(S/2+30*N0(M+B),A/2+30*L0(M+B)),q=S*N0(M+m),se=S*L0(M+m),ve=new y.Path.Line({from:new y.Point(S/2,A/2),to:new y.Point(S/2+q,A/2+se)});if(ve.strokeColor=new tu.Color(0,0,0),T.push(ve),l.question.value.targetAngleIndex===L){console.log(`drawing targetAngle at i = ${L}:
|
|
120
|
+
baseAngle: ${M}
|
|
121
|
+
targetAngle: ${N}
|
|
122
|
+
sum: ${m}
|
|
123
|
+
nextAngle: ${B}
|
|
124
|
+
`);const he=new tu.Color(.1,.5,.8,.35),ce=new y.Path.Arc({from:G,through:R,to:ye});ce.strokeColor=new tu.Color(.1,.5,.8,.75),ce.strokeWidth=3,ce.fillColor=he;const de=new y.Path;de.closed=!0,de.add(G),de.add(new tu.Point(S/2,A/2)),de.add(ye),de.fillColor=he}else{const he=new tu.PointText(R);he.content=N.toString()+"°";let ce=!0,de=20;for(;ce;)ce=!1,he.bounds.center=p(y,S,M,W,B,A,de),T.forEach(K=>{K.intersects(he)&&(ce=!0)}),de+=7}}}),A4(()=>{f.value=void 0}),{answer:u,canvasRef:c,...a,...l}}}),ax={"data-viewable":"CalculateSupplementaryAngle"},ox={ref:"canvasRef",width:"300",height:"300"};function lx(t,r,a,l,u,c){const f=vt("user-input-number");return st(),_t("div",ax,[r[1]||(r[1]=pt("h2",null,"What is the measurement of the highlighted angle?",-1)),pt("canvas",ox,null,512),r[2]||(r[2]=pt("br",null,null,-1)),ft(f,{modelValue:t.answer,"onUpdate:modelValue":r[0]||(r[0]=p=>t.answer=p)},null,8,["modelValue"])])}const ux=Mn(sx,[["render",lx],["__scopeId","data-v-4f8ac466"]]),cx={instructions:"Must be 2 or 3.",test:t=>t==="2"||t==="3"?{status:Jt.ok,msg:""}:{status:Jt.error,msg:"Must be 2 or 3."}},hx=[{name:"AngleCount",type:pr.INT,validator:cx}],dy=class kb extends pi{constructor(r){super(r),lt(this,"angles",[]),lt(this,"targetAngleIndex"),lt(this,"angleCount"),this.angleCount=r[0].AngleCount;let a=0;for(let l=0;l<=this.angleCount-2;l++){const u=ko(25,155-a);this.angles.push(u),a+=u}this.angles.push(180-a),this.targetAngleIndex=ko(0,this.angleCount-1)}isCorrect(r){return this.angles[this.targetAngleIndex]===r}dataShapes(){return kb.dataShapes}views(){return kb.views}};lt(dy,"dataShapes",[{name:di.MATH_SupplimentaryAngles,fields:hx}]);lt(dy,"views",[ux]);let p2=dy;const fx=qr({name:"VerbalAddition",props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"VerbalAddition"),l=Wn(a),u=Qt(["","","","",""]);l.question.value=new Eb(t.data);const c=Nr(()=>l.question.value?l.question.value:new Eb(t.data)),f=p=>{var y,S,A,M,w,_;console.log(`change in ${p}!
|
|
125
|
+
userAnswer: ${u.value.toString()}
|
|
126
|
+
|
|
127
|
+
qAnswer: ${(y=c.value)==null?void 0:y.answer.toString()}`),c.value&&c.value.answer[p].toString().length===u.value[p].length&&(parseInt(u.value[p])===c.value.answer[p]?((S=document.getElementById("input"+p))==null||S.classList.add("correct"),(A=document.getElementById("input"+p))==null||A.classList.remove("incorrect"),(M=document.getElementById("input"+p))==null||M.setAttribute("disabled","true"),p+1<u.value.length?(w=document.getElementById("input"+(p+1)))==null||w.focus():l.submitAnswer(u.value)):((_=document.getElementById("input"+p))==null||_.classList.add("incorrect"),l.submitAnswer(u.value),console.log(`Wrong! ${u.value[p]} !== ${c.value.answer[p]}`)))};return oa(()=>{var p;console.log("focusing..."),(p=document.getElementById("input0"))==null||p.focus()}),{...a,...l,answer:u,question:c,track:f}}}),dx={"data-viewable":"VerbalAddition",class:"text-h5"},px={class:"text-h5"},gx=["value"],vx=["id","onUpdate:modelValue","autofocus","onKeyup"],mx={key:0};function _x(t,r,a,l,u,c){var f;return st(),_t("div",dx,[pt("div",px,[r[0]||(r[0]=Yt(" Count by ")),pt("strong",null,ir((f=t.question)==null?void 0:f.n),1),r[1]||(r[1]=Yt("s: "))]),pt("input",{type:"text",disabled:"",class:"correct",value:t.question.answer[0]-t.question.n},null,8,gx),r[2]||(r[2]=Yt(", ")),(st(!0),_t(Gr,null,Ai(t.question.answer,(p,y)=>(st(),_t("span",{key:y},[N7(pt("input",{id:`input${y}`,ref_for:!0,ref:`input${y}`,class:Yb(`input${p}${y}`),"onUpdate:modelValue":S=>t.answer[y]=S,type:"text",autofocus:y===0,onKeyup:S=>t.track(y)},null,42,vx),[[L7,t.answer[y]]]),y!==t.question.answer.length-1?(st(),_t("span",mx,", ")):br("",!0)]))),128))])}const bx=Mn(fx,[["render",_x],["__scopeId","data-v-0452c3a5"]]),yx=[{name:"n",type:pr.INT},{name:"hand",type:pr.STRING,validator:{test:t=>t==="LEFT"||t==="RIGHT"?{status:Jt.ok,msg:""}:{status:Jt.error,msg:"Hand must be LEFT or RIGHT"}}}],wx=function(){const t=[];for(let r=2;r<=10;r++)t.push({n:r,hand:"LEFT"}),t.push({n:r,hand:"RIGHT"});return t};function Sx(t){return typeof t=="string"?parseInt(t):t}const J0=class Mb extends pi{constructor(r){super(r),lt(this,"n"),lt(this,"hand"),this.n=r[0].n,this.hand=r[0].hand}get answer(){const r=[],a=this.hand==="LEFT"?this.n:6*this.n;for(let l=0;l<5;l++)r.push(a+l*this.n);return r}isCorrect(r){console.log(`Solution: ${this.answer.toString()}`);for(let a=0;a<this.answer.length;a++)if(Sx(r[a])!==this.answer[a])return console.log(`answer[${a}] == ${r[a]} !== ${this.answer[a]}`),!1;return!0}dataShapes(){return Mb.dataShapes}views(){return Mb.views}};lt(J0,"dataShapes",[{name:di.MATH_CountBy,fields:yx}]);lt(J0,"views",[bx]);lt(J0,"seedData",wx());lt(J0,"acceptsUserData",!1);let Eb=J0;const Cx=new Oo("math",[h2,uy,ay,Sb,f2,d2,p2,Eb]);var bh={exports:{}},xx=bh.exports,xw;function kx(){return xw||(xw=1,function(t){(function(r){function a(){if(a.prototype._singleton)throw new Error("WebMidi is a singleton, it cannot be instantiated directly.");(a.prototype._singleton=this)._inputs=[],this._outputs=[],this._userHandlers={},this._stateChangeQueue=[],this._processingStateChange=!1,this._midiInterfaceEvents=["connected","disconnected"],this._nrpnBuffer=[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],this._nrpnEventsEnabled=!0,this._nrpnTypes=["entry","increment","decrement"],this._notes=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],this._semitones={C:0,D:2,E:4,F:5,G:7,A:9,B:11},Object.defineProperties(this,{MIDI_SYSTEM_MESSAGES:{value:{sysex:240,timecode:241,songposition:242,songselect:243,tuningrequest:246,sysexend:247,clock:248,start:250,continue:251,stop:252,activesensing:254,reset:255,midimessage:0,unknownsystemmessage:-1},writable:!1,enumerable:!0,configurable:!1},MIDI_CHANNEL_MESSAGES:{value:{noteoff:8,noteon:9,keyaftertouch:10,controlchange:11,channelmode:11,nrpn:11,programchange:12,channelaftertouch:13,pitchbend:14},writable:!1,enumerable:!0,configurable:!1},MIDI_REGISTERED_PARAMETER:{value:{pitchbendrange:[0,0],channelfinetuning:[0,1],channelcoarsetuning:[0,2],tuningprogram:[0,3],tuningbank:[0,4],modulationrange:[0,5],azimuthangle:[61,0],elevationangle:[61,1],gain:[61,2],distanceratio:[61,3],maximumdistance:[61,4],maximumdistancegain:[61,5],referencedistanceratio:[61,6],panspreadangle:[61,7],rollangle:[61,8]},writable:!1,enumerable:!0,configurable:!1},MIDI_CONTROL_CHANGE_MESSAGES:{value:{bankselectcoarse:0,modulationwheelcoarse:1,breathcontrollercoarse:2,footcontrollercoarse:4,portamentotimecoarse:5,dataentrycoarse:6,volumecoarse:7,balancecoarse:8,pancoarse:10,expressioncoarse:11,effectcontrol1coarse:12,effectcontrol2coarse:13,generalpurposeslider1:16,generalpurposeslider2:17,generalpurposeslider3:18,generalpurposeslider4:19,bankselectfine:32,modulationwheelfine:33,breathcontrollerfine:34,footcontrollerfine:36,portamentotimefine:37,dataentryfine:38,volumefine:39,balancefine:40,panfine:42,expressionfine:43,effectcontrol1fine:44,effectcontrol2fine:45,holdpedal:64,portamento:65,sustenutopedal:66,softpedal:67,legatopedal:68,hold2pedal:69,soundvariation:70,resonance:71,soundreleasetime:72,soundattacktime:73,brightness:74,soundcontrol6:75,soundcontrol7:76,soundcontrol8:77,soundcontrol9:78,soundcontrol10:79,generalpurposebutton1:80,generalpurposebutton2:81,generalpurposebutton3:82,generalpurposebutton4:83,reverblevel:91,tremololevel:92,choruslevel:93,celestelevel:94,phaserlevel:95,databuttonincrement:96,databuttondecrement:97,nonregisteredparametercoarse:98,nonregisteredparameterfine:99,registeredparametercoarse:100,registeredparameterfine:101},writable:!1,enumerable:!0,configurable:!1},MIDI_NRPN_MESSAGES:{value:{entrymsb:6,entrylsb:38,increment:96,decrement:97,paramlsb:98,parammsb:99,nullactiveparameter:127},writable:!1,enumerable:!0,configurable:!1},MIDI_CHANNEL_MODE_MESSAGES:{value:{allsoundoff:120,resetallcontrollers:121,localcontrol:122,allnotesoff:123,omnimodeoff:124,omnimodeon:125,monomodeon:126,polymodeon:127},writable:!1,enumerable:!0,configurable:!1},octaveOffset:{value:0,writable:!0,enumerable:!0,configurable:!1}}),Object.defineProperties(this,{supported:{enumerable:!0,get:function(){return"requestMIDIAccess"in navigator}},enabled:{enumerable:!0,get:function(){return this.interface!==void 0}.bind(this)},inputs:{enumerable:!0,get:function(){return this._inputs}.bind(this)},outputs:{enumerable:!0,get:function(){return this._outputs}.bind(this)},sysexEnabled:{enumerable:!0,get:function(){return!(!this.interface||!this.interface.sysexEnabled)}.bind(this)},nrpnEventsEnabled:{enumerable:!0,get:function(){return!!this._nrpnEventsEnabled}.bind(this),set:function(f){return this._nrpnEventsEnabled=f,this._nrpnEventsEnabled}},nrpnTypes:{enumerable:!0,get:function(){return this._nrpnTypes}.bind(this)},time:{enumerable:!0,get:function(){return performance.now()}}})}var l=new a;function u(f){var p=this;this._userHandlers={channel:{},system:{}},this._midiInput=f,Object.defineProperties(this,{connection:{enumerable:!0,get:function(){return p._midiInput.connection}},id:{enumerable:!0,get:function(){return p._midiInput.id}},manufacturer:{enumerable:!0,get:function(){return p._midiInput.manufacturer}},name:{enumerable:!0,get:function(){return p._midiInput.name}},state:{enumerable:!0,get:function(){return p._midiInput.state}},type:{enumerable:!0,get:function(){return p._midiInput.type}}}),this._initializeUserHandlers(),this._midiInput.onmidimessage=this._onMidiMessage.bind(this)}function c(f){var p=this;this._midiOutput=f,Object.defineProperties(this,{connection:{enumerable:!0,get:function(){return p._midiOutput.connection}},id:{enumerable:!0,get:function(){return p._midiOutput.id}},manufacturer:{enumerable:!0,get:function(){return p._midiOutput.manufacturer}},name:{enumerable:!0,get:function(){return p._midiOutput.name}},state:{enumerable:!0,get:function(){return p._midiOutput.state}},type:{enumerable:!0,get:function(){return p._midiOutput.type}}})}a.prototype.enable=function(f,p){this.enabled||(this.supported?navigator.requestMIDIAccess({sysex:p}).then(function(y){var S,A=[],M=[];this.interface=y,this._resetInterfaceUserHandlers(),this.interface.onstatechange=function(L){A.push(L)};for(var w=y.inputs.values(),_=w.next();_&&!_.done;_=w.next())M.push(_.value.open());for(var C=y.outputs.values(),m=C.next();m&&!m.done;m=C.next())M.push(m.value.open());function T(){clearTimeout(S),this._updateInputsAndOutputs(),this.interface.onstatechange=this._onInterfaceStateChange.bind(this),typeof f=="function"&&f.call(this),A.forEach(function(L){this._onInterfaceStateChange(L)}.bind(this))}S=setTimeout(T.bind(this),200),Promise&&Promise.all(M).catch(function(L){}).then(T.bind(this))}.bind(this),function(y){typeof f=="function"&&f.call(this,y)}.bind(this)):typeof f=="function"&&f(new Error("The Web MIDI API is not supported by your browser.")))},a.prototype.disable=function(){if(!this.supported)throw new Error("The Web MIDI API is not supported by your browser.");this.enabled&&(this.removeListener(),this.inputs.forEach(function(f){f.removeListener()})),this.interface&&(this.interface.onstatechange=void 0),this.interface=void 0,this._inputs=[],this._outputs=[],this._nrpnEventsEnabled=!0,this._resetInterfaceUserHandlers()},a.prototype.addListener=function(f,p){if(!this.enabled)throw new Error("WebMidi must be enabled before adding event listeners.");if(typeof p!="function")throw new TypeError("The 'listener' parameter must be a function.");if(!(0<=this._midiInterfaceEvents.indexOf(f)))throw new TypeError("The specified event type is not supported.");return this._userHandlers[f].push(p),this},a.prototype.hasListener=function(f,p){if(!this.enabled)throw new Error("WebMidi must be enabled before checking event listeners.");if(typeof p!="function")throw new TypeError("The 'listener' parameter must be a function.");if(!(0<=this._midiInterfaceEvents.indexOf(f)))throw new TypeError("The specified event type is not supported.");for(var y=0;y<this._userHandlers[f].length;y++)if(this._userHandlers[f][y]===p)return!0;return!1},a.prototype.removeListener=function(f,p){if(!this.enabled)throw new Error("WebMidi must be enabled before removing event listeners.");if(p!==void 0&&typeof p!="function")throw new TypeError("The 'listener' parameter must be a function.");if(0<=this._midiInterfaceEvents.indexOf(f))if(p)for(var y=0;y<this._userHandlers[f].length;y++)this._userHandlers[f][y]===p&&this._userHandlers[f].splice(y,1);else this._userHandlers[f]=[];else{if(f!==void 0)throw new TypeError("The specified event type is not supported.");this._resetInterfaceUserHandlers()}return this},a.prototype.toMIDIChannels=function(f){var p;if(f==="all"||f===void 0)p=["all"];else{if(f==="none")return p=[];p=Array.isArray(f)?f:[f]}return-1<p.indexOf("all")&&(p=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),p.map(function(y){return parseInt(y)}).filter(function(y){return 1<=y&&y<=16})},a.prototype.getInputById=function(f){if(!this.enabled)throw new Error("WebMidi is not enabled.");f=String(f);for(var p=0;p<this.inputs.length;p++)if(this.inputs[p].id===f)return this.inputs[p];return!1},a.prototype.getOutputById=function(f){if(!this.enabled)throw new Error("WebMidi is not enabled.");f=String(f);for(var p=0;p<this.outputs.length;p++)if(this.outputs[p].id===f)return this.outputs[p];return!1},a.prototype.getInputByName=function(f){if(!this.enabled)throw new Error("WebMidi is not enabled.");for(var p=0;p<this.inputs.length;p++)if(~this.inputs[p].name.indexOf(f))return this.inputs[p];return!1},a.prototype.getOctave=function(f){if(f!=null&&0<=f&&f<=127)return Math.floor(Math.floor(f)/12-1)+Math.floor(l.octaveOffset)},a.prototype.getOutputByName=function(f){if(!this.enabled)throw new Error("WebMidi is not enabled.");for(var p=0;p<this.outputs.length;p++)if(~this.outputs[p].name.indexOf(f))return this.outputs[p];return!1},a.prototype.guessNoteNumber=function(f){var p=!1;if(f&&f.toFixed&&0<=f&&f<=127?p=Math.round(f):0<=parseInt(f)&&parseInt(f)<=127?p=parseInt(f):(typeof f=="string"||f instanceof String)&&(p=this.noteNameToNumber(f)),p===!1)throw new Error("Invalid input value ("+f+").");return p},a.prototype.noteNameToNumber=function(f){typeof f!="string"&&(f="");var p=f.match(/([CDEFGAB])(#{0,2}|b{0,2})(-?\d+)/i);if(!p)throw new RangeError("Invalid note name.");var y=l._semitones[p[1].toUpperCase()],S=12*(parseInt(p[3])+1-Math.floor(l.octaveOffset))+y;if(-1<p[2].toLowerCase().indexOf("b")?S-=p[2].length:-1<p[2].toLowerCase().indexOf("#")&&(S+=p[2].length),S<0||127<S)throw new RangeError("Invalid note name or note outside valid range.");return S},a.prototype._updateInputsAndOutputs=function(){this._updateInputs(),this._updateOutputs()},a.prototype._updateInputs=function(){for(var f=0;f<this._inputs.length;f++){for(var p=!0,y=this.interface.inputs.values(),S=y.next();S&&!S.done;S=y.next())if(this._inputs[f]._midiInput===S.value){p=!1;break}p&&this._inputs.splice(f,1)}this.interface&&this.interface.inputs.forEach(function(A){for(var M=!0,w=0;w<this._inputs.length;w++)this._inputs[w]._midiInput===A&&(M=!1);M&&this._inputs.push(new u(A))}.bind(this))},a.prototype._updateOutputs=function(){for(var f=0;f<this._outputs.length;f++){for(var p=!0,y=this.interface.outputs.values(),S=y.next();S&&!S.done;S=y.next())if(this._outputs[f]._midiOutput===S.value){p=!1;break}p&&this._outputs.splice(f,1)}this.interface&&this.interface.outputs.forEach(function(A){for(var M=!0,w=0;w<this._outputs.length;w++)this._outputs[w]._midiOutput===A&&(M=!1);M&&this._outputs.push(new c(A))}.bind(this))},a.prototype._onInterfaceStateChange=function(f){this._updateInputsAndOutputs();var p={timestamp:f.timeStamp,type:f.port.state};this.interface&&f.port.state==="connected"?f.port.type==="output"?p.port=this.getOutputById(f.port.id):f.port.type==="input"&&(p.port=this.getInputById(f.port.id)):p.port={connection:"closed",id:f.port.id,manufacturer:f.port.manufacturer,name:f.port.name,state:f.port.state,type:f.port.type},this._userHandlers[f.port.state].forEach(function(y){y(p)})},a.prototype._resetInterfaceUserHandlers=function(){for(var f=0;f<this._midiInterfaceEvents.length;f++)this._userHandlers[this._midiInterfaceEvents[f]]=[]},u.prototype.on=u.prototype.addListener=function(f,p,y){var S=this;if(p===void 0&&(p="all"),Array.isArray(p)||(p=[p]),p.forEach(function(M){if(M!=="all"&&!(1<=M&&M<=16))throw new RangeError("The 'channel' parameter is invalid.")}),typeof y!="function")throw new TypeError("The 'listener' parameter must be a function.");if(l.MIDI_SYSTEM_MESSAGES[f]!==void 0)this._userHandlers.system[f]||(this._userHandlers.system[f]=[]),this._userHandlers.system[f].push(y);else{if(l.MIDI_CHANNEL_MESSAGES[f]===void 0)throw new TypeError("The specified event type is not supported.");if(-1<p.indexOf("all")){p=[];for(var A=1;A<=16;A++)p.push(A)}this._userHandlers.channel[f]||(this._userHandlers.channel[f]=[]),p.forEach(function(M){S._userHandlers.channel[f][M]||(S._userHandlers.channel[f][M]=[]),S._userHandlers.channel[f][M].push(y)})}return this},u.prototype.hasListener=function(f,p,y){var S=this;if(typeof y!="function")throw new TypeError("The 'listener' parameter must be a function.");if(p===void 0&&(p="all"),p.constructor!==Array&&(p=[p]),l.MIDI_SYSTEM_MESSAGES[f]!==void 0){for(var A=0;A<this._userHandlers.system[f].length;A++)if(this._userHandlers.system[f][A]===y)return!0}else if(l.MIDI_CHANNEL_MESSAGES[f]!==void 0){if(-1<p.indexOf("all")){p=[];for(var M=1;M<=16;M++)p.push(M)}return!!this._userHandlers.channel[f]&&p.every(function(w){var _=S._userHandlers.channel[f][w];return _&&-1<_.indexOf(y)})}return!1},u.prototype.removeListener=function(f,p,y){var S=this;if(y!==void 0&&typeof y!="function")throw new TypeError("The 'listener' parameter must be a function.");if(p===void 0&&(p="all"),p.constructor!==Array&&(p=[p]),l.MIDI_SYSTEM_MESSAGES[f]!==void 0)if(y===void 0)this._userHandlers.system[f]=[];else for(var A=0;A<this._userHandlers.system[f].length;A++)this._userHandlers.system[f][A]===y&&this._userHandlers.system[f].splice(A,1);else if(l.MIDI_CHANNEL_MESSAGES[f]!==void 0){if(-1<p.indexOf("all")){p=[];for(var M=1;M<=16;M++)p.push(M)}if(!this._userHandlers.channel[f])return this;p.forEach(function(w){var _=S._userHandlers.channel[f][w];if(_)if(y===void 0)S._userHandlers.channel[f][w]=[];else for(var C=0;C<_.length;C++)_[C]===y&&_.splice(C,1)})}else{if(f!==void 0)throw new TypeError("The specified event type is not supported.");this._initializeUserHandlers()}return this},u.prototype._initializeUserHandlers=function(){for(var f in l.MIDI_CHANNEL_MESSAGES)Object.prototype.hasOwnProperty.call(l.MIDI_CHANNEL_MESSAGES,f)&&(this._userHandlers.channel[f]={});for(var p in l.MIDI_SYSTEM_MESSAGES)Object.prototype.hasOwnProperty.call(l.MIDI_SYSTEM_MESSAGES,p)&&(this._userHandlers.system[p]=[])},u.prototype._onMidiMessage=function(f){if(0<this._userHandlers.system.midimessage.length){var p={target:this,data:f.data,timestamp:f.timeStamp,type:"midimessage"};this._userHandlers.system.midimessage.forEach(function(y){y(p)})}f.data[0]<240?(this._parseChannelEvent(f),this._parseNrpnEvent(f)):f.data[0]<=255&&this._parseSystemEvent(f)},u.prototype._parseNrpnEvent=function(f){var p,y,S=f.data[0]>>4,A=15&f.data[0],M=1+A;if(1<f.data.length&&(p=f.data[1],y=2<f.data.length?f.data[2]:void 0),l.nrpnEventsEnabled&&S===l.MIDI_CHANNEL_MESSAGES.controlchange&&(p>=l.MIDI_NRPN_MESSAGES.increment&&p<=l.MIDI_NRPN_MESSAGES.parammsb||p===l.MIDI_NRPN_MESSAGES.entrymsb||p===l.MIDI_NRPN_MESSAGES.entrylsb)){var w={target:this,type:"controlchange",data:f.data,timestamp:f.timeStamp,channel:M,controller:{number:p,name:this.getCcNameByNumber(p)},value:y};if(w.controller.number===l.MIDI_NRPN_MESSAGES.parammsb&&w.value!=l.MIDI_NRPN_MESSAGES.nullactiveparameter)l._nrpnBuffer[A]=[],l._nrpnBuffer[A][0]=w;else if(l._nrpnBuffer[A].length===1&&w.controller.number===l.MIDI_NRPN_MESSAGES.paramlsb)l._nrpnBuffer[A].push(w);else if(l._nrpnBuffer[A].length!==2||w.controller.number!==l.MIDI_NRPN_MESSAGES.increment&&w.controller.number!==l.MIDI_NRPN_MESSAGES.decrement&&w.controller.number!==l.MIDI_NRPN_MESSAGES.entrymsb)if(l._nrpnBuffer[A].length===3&&l._nrpnBuffer[A][2].number===l.MIDI_NRPN_MESSAGES.entrymsb&&w.controller.number===l.MIDI_NRPN_MESSAGES.entrylsb)l._nrpnBuffer[A].push(w);else if(3<=l._nrpnBuffer[A].length&&l._nrpnBuffer[A].length<=4&&w.controller.number===l.MIDI_NRPN_MESSAGES.parammsb&&w.value===l.MIDI_NRPN_MESSAGES.nullactiveparameter)l._nrpnBuffer[A].push(w);else if(4<=l._nrpnBuffer[A].length&&l._nrpnBuffer[A].length<=5&&w.controller.number===l.MIDI_NRPN_MESSAGES.paramlsb&&w.value===l.MIDI_NRPN_MESSAGES.nullactiveparameter){l._nrpnBuffer[A].push(w);var _=[];l._nrpnBuffer[A].forEach(function(N){_.push(N.data)});var C=l._nrpnBuffer[A][0].value<<7|l._nrpnBuffer[A][1].value,m=l._nrpnBuffer[A][2].value;l._nrpnBuffer[A].length===6&&(m=l._nrpnBuffer[A][2].value<<7|l._nrpnBuffer[A][3].value);var T="";switch(l._nrpnBuffer[A][2].controller.number){case l.MIDI_NRPN_MESSAGES.entrymsb:T=l._nrpnTypes[0];break;case l.MIDI_NRPN_MESSAGES.increment:T=l._nrpnTypes[1];break;case l.MIDI_NRPN_MESSAGES.decrement:T=l._nrpnTypes[2];break;default:throw new Error("The NPRN type was unidentifiable.")}var L={timestamp:w.timestamp,channel:w.channel,type:"nrpn",data:_,controller:{number:C,type:T,name:"Non-Registered Parameter "+C},value:m};l._nrpnBuffer[A]=[],this._userHandlers.channel[L.type]&&this._userHandlers.channel[L.type][L.channel]&&this._userHandlers.channel[L.type][L.channel].forEach(function(N){N(L)})}else l._nrpnBuffer[A]=[];else l._nrpnBuffer[A].push(w)}},u.prototype._parseChannelEvent=function(f){var p,y,S=f.data[0]>>4,A=1+(15&f.data[0]);1<f.data.length&&(p=f.data[1],y=2<f.data.length?f.data[2]:void 0);var M={target:this,data:f.data,timestamp:f.timeStamp,channel:A};S===l.MIDI_CHANNEL_MESSAGES.noteoff||S===l.MIDI_CHANNEL_MESSAGES.noteon&&y===0?(M.type="noteoff",M.note={number:p,name:l._notes[p%12],octave:l.getOctave(p)},M.velocity=y/127,M.rawVelocity=y):S===l.MIDI_CHANNEL_MESSAGES.noteon?(M.type="noteon",M.note={number:p,name:l._notes[p%12],octave:l.getOctave(p)},M.velocity=y/127,M.rawVelocity=y):S===l.MIDI_CHANNEL_MESSAGES.keyaftertouch?(M.type="keyaftertouch",M.note={number:p,name:l._notes[p%12],octave:l.getOctave(p)},M.value=y/127):S===l.MIDI_CHANNEL_MESSAGES.controlchange&&0<=p&&p<=119?(M.type="controlchange",M.controller={number:p,name:this.getCcNameByNumber(p)},M.value=y):S===l.MIDI_CHANNEL_MESSAGES.channelmode&&120<=p&&p<=127?(M.type="channelmode",M.controller={number:p,name:this.getChannelModeByNumber(p)},M.value=y):S===l.MIDI_CHANNEL_MESSAGES.programchange?(M.type="programchange",M.value=p):S===l.MIDI_CHANNEL_MESSAGES.channelaftertouch?(M.type="channelaftertouch",M.value=p/127):S===l.MIDI_CHANNEL_MESSAGES.pitchbend?(M.type="pitchbend",M.value=((y<<7)+p-8192)/8192):M.type="unknownchannelmessage",this._userHandlers.channel[M.type]&&this._userHandlers.channel[M.type][A]&&this._userHandlers.channel[M.type][A].forEach(function(w){w(M)})},u.prototype.getCcNameByNumber=function(f){if(!(0<=(f=Math.floor(f))&&f<=119))throw new RangeError("The control change number must be between 0 and 119.");for(var p in l.MIDI_CONTROL_CHANGE_MESSAGES)if(Object.prototype.hasOwnProperty.call(l.MIDI_CONTROL_CHANGE_MESSAGES,p)&&f===l.MIDI_CONTROL_CHANGE_MESSAGES[p])return p},u.prototype.getChannelModeByNumber=function(f){if(!(120<=(f=Math.floor(f))&&status<=127))throw new RangeError("The control change number must be between 120 and 127.");for(var p in l.MIDI_CHANNEL_MODE_MESSAGES)if(Object.prototype.hasOwnProperty.call(l.MIDI_CHANNEL_MODE_MESSAGES,p)&&f===l.MIDI_CHANNEL_MODE_MESSAGES[p])return p},u.prototype._parseSystemEvent=function(f){var p=f.data[0],y={target:this,data:f.data,timestamp:f.timeStamp};p===l.MIDI_SYSTEM_MESSAGES.sysex?y.type="sysex":p===l.MIDI_SYSTEM_MESSAGES.timecode?y.type="timecode":p===l.MIDI_SYSTEM_MESSAGES.songposition?y.type="songposition":p===l.MIDI_SYSTEM_MESSAGES.songselect?(y.type="songselect",y.song=f.data[1]):p===l.MIDI_SYSTEM_MESSAGES.tuningrequest?y.type="tuningrequest":p===l.MIDI_SYSTEM_MESSAGES.clock?y.type="clock":p===l.MIDI_SYSTEM_MESSAGES.start?y.type="start":p===l.MIDI_SYSTEM_MESSAGES.continue?y.type="continue":p===l.MIDI_SYSTEM_MESSAGES.stop?y.type="stop":p===l.MIDI_SYSTEM_MESSAGES.activesensing?y.type="activesensing":p===l.MIDI_SYSTEM_MESSAGES.reset?y.type="reset":y.type="unknownsystemmessage",this._userHandlers.system[y.type]&&this._userHandlers.system[y.type].forEach(function(S){S(y)})},c.prototype.send=function(f,p,y){if(!(128<=f&&f<=255))throw new RangeError("The status byte must be an integer between 128 (0x80) and 255 (0xFF).");p===void 0&&(p=[]),Array.isArray(p)||(p=[p]);var S=[];return p.forEach(function(A){var M=Math.floor(A);if(!(0<=M&&M<=255))throw new RangeError("Data bytes must be integers between 0 (0x00) and 255 (0xFF).");S.push(M)}),this._midiOutput.send([f].concat(S),parseFloat(y)||0),this},c.prototype.sendSysex=function(f,p,y){if(!l.sysexEnabled)throw new Error("Sysex message support must first be activated.");return y=y||{},f=[].concat(f),p.forEach(function(S){if(S<0||127<S)throw new RangeError("The data bytes of a sysex message must be integers between 0 (0x00) and 127 (0x7F).")}),p=f.concat(p,l.MIDI_SYSTEM_MESSAGES.sysexend),this.send(l.MIDI_SYSTEM_MESSAGES.sysex,p,this._parseTimeParameter(y.time)),this},c.prototype.sendTimecodeQuarterFrame=function(f,p){return p=p||{},this.send(l.MIDI_SYSTEM_MESSAGES.timecode,f,this._parseTimeParameter(p.time)),this},c.prototype.sendSongPosition=function(f,p){p=p||{};var y=(f=Math.floor(f)||0)>>7&127,S=127&f;return this.send(l.MIDI_SYSTEM_MESSAGES.songposition,[y,S],this._parseTimeParameter(p.time)),this},c.prototype.sendSongSelect=function(f,p){if(p=p||{},!(0<=(f=Math.floor(f))&&f<=127))throw new RangeError("The song number must be between 0 and 127.");return this.send(l.MIDI_SYSTEM_MESSAGES.songselect,[f],this._parseTimeParameter(p.time)),this},c.prototype.sendTuningRequest=function(f){return f=f||{},this.send(l.MIDI_SYSTEM_MESSAGES.tuningrequest,void 0,this._parseTimeParameter(f.time)),this},c.prototype.sendClock=function(f){return f=f||{},this.send(l.MIDI_SYSTEM_MESSAGES.clock,void 0,this._parseTimeParameter(f.time)),this},c.prototype.sendStart=function(f){return f=f||{},this.send(l.MIDI_SYSTEM_MESSAGES.start,void 0,this._parseTimeParameter(f.time)),this},c.prototype.sendContinue=function(f){return f=f||{},this.send(l.MIDI_SYSTEM_MESSAGES.continue,void 0,this._parseTimeParameter(f.time)),this},c.prototype.sendStop=function(f){return f=f||{},this.send(l.MIDI_SYSTEM_MESSAGES.stop,void 0,this._parseTimeParameter(f.time)),this},c.prototype.sendActiveSensing=function(f){return f=f||{},this.send(l.MIDI_SYSTEM_MESSAGES.activesensing,[],this._parseTimeParameter(f.time)),this},c.prototype.sendReset=function(f){return f=f||{},this.send(l.MIDI_SYSTEM_MESSAGES.reset,void 0,this._parseTimeParameter(f.time)),this},c.prototype.stopNote=function(f,p,y){if(f==="all")return this.sendChannelMode("allnotesoff",0,p,y);var S=64;return(y=y||{}).rawVelocity?!isNaN(y.velocity)&&0<=y.velocity&&y.velocity<=127&&(S=y.velocity):!isNaN(y.velocity)&&0<=y.velocity&&y.velocity<=1&&(S=127*y.velocity),this._convertNoteToArray(f).forEach(function(A){l.toMIDIChannels(p).forEach(function(M){this.send((l.MIDI_CHANNEL_MESSAGES.noteoff<<4)+(M-1),[A,Math.round(S)],this._parseTimeParameter(y.time))}.bind(this))}.bind(this)),this},c.prototype.playNote=function(f,p,y){var S,A=64;if((y=y||{}).rawVelocity?!isNaN(y.velocity)&&0<=y.velocity&&y.velocity<=127&&(A=y.velocity):!isNaN(y.velocity)&&0<=y.velocity&&y.velocity<=1&&(A=127*y.velocity),S=this._parseTimeParameter(y.time),this._convertNoteToArray(f).forEach(function(w){l.toMIDIChannels(p).forEach(function(_){this.send((l.MIDI_CHANNEL_MESSAGES.noteon<<4)+(_-1),[w,Math.round(A)],S)}.bind(this))}.bind(this)),!isNaN(y.duration)){y.duration<=0&&(y.duration=0);var M=64;y.rawVelocity?!isNaN(y.release)&&0<=y.release&&y.release<=127&&(M=y.release):!isNaN(y.release)&&0<=y.release&&y.release<=1&&(M=127*y.release),this._convertNoteToArray(f).forEach(function(w){l.toMIDIChannels(p).forEach(function(_){this.send((l.MIDI_CHANNEL_MESSAGES.noteoff<<4)+(_-1),[w,Math.round(M)],(S||l.time)+y.duration)}.bind(this))}.bind(this))}return this},c.prototype.sendKeyAftertouch=function(f,p,y,S){var A=this;if(S=S||{},p<1||16<p)throw new RangeError("The channel must be between 1 and 16.");(isNaN(y)||y<0||1<y)&&(y=.5);var M=Math.round(127*y);return this._convertNoteToArray(f).forEach(function(w){l.toMIDIChannels(p).forEach(function(_){A.send((l.MIDI_CHANNEL_MESSAGES.keyaftertouch<<4)+(_-1),[w,M],A._parseTimeParameter(S.time))})}),this},c.prototype.sendControlChange=function(f,p,y,S){if(S=S||{},typeof f=="string"){if((f=l.MIDI_CONTROL_CHANGE_MESSAGES[f])===void 0)throw new TypeError("Invalid controller name.")}else if(!(0<=(f=Math.floor(f))&&f<=119))throw new RangeError("Controller numbers must be between 0 and 119.");if(!(0<=(p=Math.floor(p)||0)&&p<=127))throw new RangeError("Controller value must be between 0 and 127.");return l.toMIDIChannels(y).forEach(function(A){this.send((l.MIDI_CHANNEL_MESSAGES.controlchange<<4)+(A-1),[f,p],this._parseTimeParameter(S.time))}.bind(this)),this},c.prototype._selectRegisteredParameter=function(f,p,y){var S=this;if(f[0]=Math.floor(f[0]),!(0<=f[0]&&f[0]<=127))throw new RangeError("The control65 value must be between 0 and 127");if(f[1]=Math.floor(f[1]),!(0<=f[1]&&f[1]<=127))throw new RangeError("The control64 value must be between 0 and 127");return l.toMIDIChannels(p).forEach(function(){S.sendControlChange(101,f[0],p,{time:y}),S.sendControlChange(100,f[1],p,{time:y})}),this},c.prototype._selectNonRegisteredParameter=function(f,p,y){var S=this;if(f[0]=Math.floor(f[0]),!(0<=f[0]&&f[0]<=127))throw new RangeError("The control63 value must be between 0 and 127");if(f[1]=Math.floor(f[1]),!(0<=f[1]&&f[1]<=127))throw new RangeError("The control62 value must be between 0 and 127");return l.toMIDIChannels(p).forEach(function(){S.sendControlChange(99,f[0],p,{time:y}),S.sendControlChange(98,f[1],p,{time:y})}),this},c.prototype._setCurrentRegisteredParameter=function(f,p,y){var S=this;if((f=[].concat(f))[0]=Math.floor(f[0]),!(0<=f[0]&&f[0]<=127))throw new RangeError("The msb value must be between 0 and 127");return l.toMIDIChannels(p).forEach(function(){S.sendControlChange(6,f[0],p,{time:y})}),f[1]=Math.floor(f[1]),0<=f[1]&&f[1]<=127&&l.toMIDIChannels(p).forEach(function(){S.sendControlChange(38,f[1],p,{time:y})}),this},c.prototype._deselectRegisteredParameter=function(f,p){var y=this;return l.toMIDIChannels(f).forEach(function(){y.sendControlChange(101,127,f,{time:p}),y.sendControlChange(100,127,f,{time:p})}),this},c.prototype.setRegisteredParameter=function(f,p,y,S){var A=this;if(S=S||{},!Array.isArray(f)){if(!l.MIDI_REGISTERED_PARAMETER[f])throw new Error("The specified parameter is not available.");f=l.MIDI_REGISTERED_PARAMETER[f]}return l.toMIDIChannels(y).forEach(function(){A._selectRegisteredParameter(f,y,S.time),A._setCurrentRegisteredParameter(p,y,S.time),A._deselectRegisteredParameter(y,S.time)}),this},c.prototype.setNonRegisteredParameter=function(f,p,y,S){var A=this;if(S=S||{},!(0<=f[0]&&f[0]<=127&&0<=f[1]&&f[1]<=127))throw new Error("Position 0 and 1 of the 2-position parameter array must both be between 0 and 127.");return p=[].concat(p),l.toMIDIChannels(y).forEach(function(){A._selectNonRegisteredParameter(f,y,S.time),A._setCurrentRegisteredParameter(p,y,S.time),A._deselectRegisteredParameter(y,S.time)}),this},c.prototype.incrementRegisteredParameter=function(f,p,y){var S=this;if(y=y||{},!Array.isArray(f)){if(!l.MIDI_REGISTERED_PARAMETER[f])throw new Error("The specified parameter is not available.");f=l.MIDI_REGISTERED_PARAMETER[f]}return l.toMIDIChannels(p).forEach(function(){S._selectRegisteredParameter(f,p,y.time),S.sendControlChange(96,0,p,{time:y.time}),S._deselectRegisteredParameter(p,y.time)}),this},c.prototype.decrementRegisteredParameter=function(f,p,y){if(y=y||{},!Array.isArray(f)){if(!l.MIDI_REGISTERED_PARAMETER[f])throw new TypeError("The specified parameter is not available.");f=l.MIDI_REGISTERED_PARAMETER[f]}return l.toMIDIChannels(p).forEach(function(){this._selectRegisteredParameter(f,p,y.time),this.sendControlChange(97,0,p,{time:y.time}),this._deselectRegisteredParameter(p,y.time)}.bind(this)),this},c.prototype.setPitchBendRange=function(f,p,y,S){var A=this;if(S=S||{},!(0<=(f=Math.floor(f)||0)&&f<=127))throw new RangeError("The semitones value must be between 0 and 127");if(!(0<=(p=Math.floor(p)||0)&&p<=127))throw new RangeError("The cents value must be between 0 and 127");return l.toMIDIChannels(y).forEach(function(){A.setRegisteredParameter("pitchbendrange",[f,p],y,{time:S.time})}),this},c.prototype.setModulationRange=function(f,p,y,S){var A=this;if(S=S||{},!(0<=(f=Math.floor(f)||0)&&f<=127))throw new RangeError("The semitones value must be between 0 and 127");if(!(0<=(p=Math.floor(p)||0)&&p<=127))throw new RangeError("The cents value must be between 0 and 127");return l.toMIDIChannels(y).forEach(function(){A.setRegisteredParameter("modulationrange",[f,p],y,{time:S.time})}),this},c.prototype.setMasterTuning=function(f,p,y){var S=this;if(y=y||{},(f=parseFloat(f)||0)<=-65||64<=f)throw new RangeError("The value must be a decimal number larger than -65 and smaller than 64.");var A=Math.floor(f)+64,M=f-Math.floor(f),w=(M=Math.round((M+1)/2*16383))>>7&127,_=127&M;return l.toMIDIChannels(p).forEach(function(){S.setRegisteredParameter("channelcoarsetuning",A,p,{time:y.time}),S.setRegisteredParameter("channelfinetuning",[w,_],p,{time:y.time})}),this},c.prototype.setTuningProgram=function(f,p,y){var S=this;if(y=y||{},!(0<=(f=Math.floor(f))&&f<=127))throw new RangeError("The program value must be between 0 and 127");return l.toMIDIChannels(p).forEach(function(){S.setRegisteredParameter("tuningprogram",f,p,{time:y.time})}),this},c.prototype.setTuningBank=function(f,p,y){var S=this;if(y=y||{},!(0<=(f=Math.floor(f)||0)&&f<=127))throw new RangeError("The bank value must be between 0 and 127");return l.toMIDIChannels(p).forEach(function(){S.setRegisteredParameter("tuningbank",f,p,{time:y.time})}),this},c.prototype.sendChannelMode=function(f,p,y,S){if(S=S||{},typeof f=="string"){if(!(f=l.MIDI_CHANNEL_MODE_MESSAGES[f]))throw new TypeError("Invalid channel mode message name.")}else if(!(120<=(f=Math.floor(f))&&f<=127))throw new RangeError("Channel mode numerical identifiers must be between 120 and 127.");if((p=Math.floor(p)||0)<0||127<p)throw new RangeError("Value must be an integer between 0 and 127.");return l.toMIDIChannels(y).forEach(function(A){this.send((l.MIDI_CHANNEL_MESSAGES.channelmode<<4)+(A-1),[f,p],this._parseTimeParameter(S.time))}.bind(this)),this},c.prototype.sendProgramChange=function(f,p,y){var S=this;if(y=y||{},f=Math.floor(f),isNaN(f)||f<0||127<f)throw new RangeError("Program numbers must be between 0 and 127.");return l.toMIDIChannels(p).forEach(function(A){S.send((l.MIDI_CHANNEL_MESSAGES.programchange<<4)+(A-1),[f],S._parseTimeParameter(y.time))}),this},c.prototype.sendChannelAftertouch=function(f,p,y){var S=this;y=y||{},f=parseFloat(f),(isNaN(f)||f<0||1<f)&&(f=.5);var A=Math.round(127*f);return l.toMIDIChannels(p).forEach(function(M){S.send((l.MIDI_CHANNEL_MESSAGES.channelaftertouch<<4)+(M-1),[A],S._parseTimeParameter(y.time))}),this},c.prototype.sendPitchBend=function(f,p,y){var S=this;if(y=y||{},isNaN(f)||f<-1||1<f)throw new RangeError("Pitch bend value must be between -1 and 1.");var A=Math.round((f+1)/2*16383),M=A>>7&127,w=127&A;return l.toMIDIChannels(p).forEach(function(_){S.send((l.MIDI_CHANNEL_MESSAGES.pitchbend<<4)+(_-1),[w,M],S._parseTimeParameter(y.time))}),this},c.prototype._parseTimeParameter=function(f){var p,y=parseFloat(f);return typeof f=="string"&&f.substring(0,1)==="+"?y&&0<y&&(p=l.time+y):y>l.time&&(p=y),p},c.prototype._convertNoteToArray=function(f){var p=[];return Array.isArray(f)||(f=[f]),f.forEach(function(y){p.push(l.guessNoteNumber(y))}),p},t.exports?t.exports=l:r.WebMidi||(r.WebMidi=l)})(xx)}(bh)),bh.exports}var Mx=kx();const Ex=Vh(Mx),Nh=(t,r)=>Array(Math.abs(r)+1).join(t);function g2(t){return t!==null&&typeof t=="object"&&typeof t.name=="string"}function v2(t){return t!==null&&typeof t=="object"&&typeof t.step=="number"&&typeof t.alt=="number"}const m2=[0,2,4,-1,1,3,5],_2=m2.map(t=>Math.floor(t*7/12));function b2(t){const{step:r,alt:a,oct:l,dir:u=1}=t,c=m2[r]+7*a;if(l===void 0)return[u*c];const f=l-_2[r]-4*a;return[u*c,u*f]}const Ax=[3,0,4,1,5,2,6];function y2(t){const[r,a,l]=t,u=Ax[Tx(r)],c=Math.floor((r+1)/7);if(a===void 0)return{step:u,alt:c,dir:l};const f=a+4*c+_2[u];return{step:u,alt:c,oct:f,dir:l}}function Tx(t){const r=(t+1)%7;return r<0?7+r:r}const w2={empty:!0,name:"",pc:"",acc:""},kw=new Map,Ix=t=>"CDEFGAB".charAt(t),Px=t=>t<0?Nh("b",-t):Nh("#",t),Nx=t=>t[0]==="b"?-t.length:t.length;function No(t){const r=kw.get(t);if(r)return r;const a=typeof t=="string"?Rx(t):v2(t)?No(Bx(t)):g2(t)?No(t.name):w2;return kw.set(t,a),a}const Lx=/^([a-gA-G]?)(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)$/;function Ox(t){const r=Lx.exec(t);return[r[1].toUpperCase(),r[2].replace(/x/g,"##"),r[3],r[4]]}function Ab(t){return No(y2(t))}const Dx=(t,r)=>(t%r+r)%r,ym=[0,2,4,5,7,9,11];function Rx(t){const r=Ox(t);if(r[0]===""||r[3]!=="")return w2;const a=r[0],l=r[1],u=r[2],c=(a.charCodeAt(0)+3)%7,f=Nx(l),p=u.length?+u:void 0,y=b2({step:c,alt:f,oct:p}),S=a+l+u,A=a+l,M=(ym[c]+f+120)%12,w=p===void 0?Dx(ym[c]+f,12)-12*99:ym[c]+f+12*(p+1),_=w>=0&&w<=127?w:null,C=p===void 0?null:Math.pow(2,(w-69)/12)*440;return{empty:!1,acc:l,alt:f,chroma:M,coord:y,freq:C,height:w,letter:a,midi:_,name:S,oct:p,pc:A,step:c}}function Bx(t){const{step:r,alt:a,oct:l}=t,u=Ix(r);if(!u)return"";const c=u+Px(a);return l||l===0?c+l:c}const Tb={empty:!0,name:"",acc:""},Fx="([-+]?\\d+)(d{1,4}|m|M|P|A{1,4})",qx="(AA|A|P|M|m|d|dd)([-+]?\\d+)",zx=new RegExp("^"+Fx+"|"+qx+"$");function Hx(t){const r=zx.exec(`${t}`);return r===null?["",""]:r[1]?[r[1],r[2]]:[r[4],r[3]]}const Mw={};function Qi(t){return typeof t=="string"?Mw[t]||(Mw[t]=Vx(t)):v2(t)?Qi($x(t)):g2(t)?Qi(t.name):Tb}const Ew=[0,2,4,5,7,9,11],S2="PMMPPMM";function Vx(t){const r=Hx(t);if(r[0]==="")return Tb;const a=+r[0],l=r[1],u=(Math.abs(a)-1)%7,c=S2[u];if(c==="M"&&l==="P")return Tb;const f=c==="M"?"majorable":"perfectable",p=""+a+l,y=a<0?-1:1,S=a===8||a===-8?a:y*(u+1),A=Ux(f,l),M=Math.floor((Math.abs(a)-1)/7),w=y*(Ew[u]+A+12*M),_=(y*(Ew[u]+A)%12+12)%12,C=b2({step:u,alt:A,oct:M,dir:y});return{empty:!1,name:p,num:a,q:l,step:u,alt:A,dir:y,type:f,simple:S,semitones:w,chroma:_,coord:C,oct:M}}function C2(t){const[r,a=0]=t,u=r*7+a*12<0?[-r,-a,-1]:[r,a,1];return Qi(y2(u))}function Ux(t,r){return r==="M"&&t==="majorable"||r==="P"&&t==="perfectable"?0:r==="m"&&t==="majorable"?-1:/^A+$/.test(r)?r.length:/^d+$/.test(r)?-1*(t==="perfectable"?r.length:r.length+1):0}function $x(t){const{step:r,alt:a,oct:l=0,dir:u}=t;if(!u)return"";const c=r+1+7*l,f=u<0?"-":"",p=S2[r]==="M"?"majorable":"perfectable";return f+c+Wx(p,a)}function Wx(t,r){return r===0?t==="majorable"?"M":"P":r===-1&&t==="majorable"?"m":r>0?Nh("A",r):Nh("d",t==="perfectable"?r:r+1)}function x2(t,r){const a=No(t),l=Qi(r);if(a.empty||l.empty)return"";const u=a.coord,c=l.coord,f=u.length===1?[u[0]+c[0]]:[u[0]+c[0],u[1]+c[1]];return Ab(f).name}function Gx(t,r){const a=No(t),l=No(r);if(a.empty||l.empty)return"";const u=a.coord,c=l.coord,f=c[0]-u[0],p=u.length===2&&c.length===2?c[1]-u[1]:-Math.floor(f*7/12);return C2([f,p]).name}function Yx(t,r){const a=r.length,l=(t%a+a)%a;return r.slice(l,a).concat(r.slice(0,l))}const uu={empty:!0,name:"",setNum:0,chroma:"000000000000",normalized:"000000000000",intervals:[]},k2=t=>Number(t).toString(2),Aw=t=>parseInt(t,2),Kx=/^[01]{12}$/;function M2(t){return Kx.test(t)}const Xx=t=>typeof t=="number"&&t>=0&&t<=4095,Qx=t=>t&&M2(t.chroma),Tw={[uu.chroma]:uu};function E2(t){const r=M2(t)?t:Xx(t)?k2(t):Array.isArray(t)?ek(t):Qx(t)?t.chroma:uu.chroma;return Tw[r]=Tw[r]||Jx(r)}const Zx=["1P","2m","2M","3m","3M","4P","5d","5P","6m","6M","7m","7M"];function A2(t){const r=[];for(let a=0;a<12;a++)t.charAt(a)==="1"&&r.push(Zx[a]);return r}function jx(t){const r=t.split("");return r.map((a,l)=>Yx(l,r).join(""))}function Jx(t){const r=Aw(t),a=jx(t).map(Aw).filter(c=>c>=2048).sort()[0],l=k2(a),u=A2(t);return{empty:!1,name:"",setNum:r,chroma:t,normalized:l,intervals:u}}function ek(t){if(t.length===0)return uu.chroma;let r;const a=[0,0,0,0,0,0,0,0,0,0,0,0];for(let l=0;l<t.length;l++)r=No(t[l]),r.empty&&(r=Qi(t[l])),r.empty||(a[r.chroma]=1);return a.join("")}const tk=[["1P 3M 5P","major","M ^ "],["1P 3M 5P 7M","major seventh","maj7 Δ ma7 M7 Maj7 ^7"],["1P 3M 5P 7M 9M","major ninth","maj9 Δ9 ^9"],["1P 3M 5P 7M 9M 13M","major thirteenth","maj13 Maj13 ^13"],["1P 3M 5P 6M","sixth","6 add6 add13 M6"],["1P 3M 5P 6M 9M","sixth/ninth","6/9 69 M69"],["1P 3M 6m 7M","major seventh flat sixth","M7b6 ^7b6"],["1P 3M 5P 7M 11A","major seventh sharp eleventh","maj#4 Δ#4 Δ#11 M7#11 ^7#11 maj7#11"],["1P 3m 5P","minor","m min -"],["1P 3m 5P 7m","minor seventh","m7 min7 mi7 -7"],["1P 3m 5P 7M","minor/major seventh","m/ma7 m/maj7 mM7 mMaj7 m/M7 -Δ7 mΔ -^7"],["1P 3m 5P 6M","minor sixth","m6 -6"],["1P 3m 5P 7m 9M","minor ninth","m9 -9"],["1P 3m 5P 7M 9M","minor/major ninth","mM9 mMaj9 -^9"],["1P 3m 5P 7m 9M 11P","minor eleventh","m11 -11"],["1P 3m 5P 7m 9M 13M","minor thirteenth","m13 -13"],["1P 3m 5d","diminished","dim ° o"],["1P 3m 5d 7d","diminished seventh","dim7 °7 o7"],["1P 3m 5d 7m","half-diminished","m7b5 ø -7b5 h7 h"],["1P 3M 5P 7m","dominant seventh","7 dom"],["1P 3M 5P 7m 9M","dominant ninth","9"],["1P 3M 5P 7m 9M 13M","dominant thirteenth","13"],["1P 3M 5P 7m 11A","lydian dominant seventh","7#11 7#4"],["1P 3M 5P 7m 9m","dominant flat ninth","7b9"],["1P 3M 5P 7m 9A","dominant sharp ninth","7#9"],["1P 3M 7m 9m","altered","alt7"],["1P 4P 5P","suspended fourth","sus4 sus"],["1P 2M 5P","suspended second","sus2"],["1P 4P 5P 7m","suspended fourth seventh","7sus4 7sus"],["1P 5P 7m 9M 11P","eleventh","11"],["1P 4P 5P 7m 9m","suspended fourth flat ninth","b9sus phryg 7b9sus 7b9sus4"],["1P 5P","fifth","5"],["1P 3M 5A","augmented","aug + +5 ^#5"],["1P 3m 5A","minor augmented","m#5 -#5 m+"],["1P 3M 5A 7M","augmented seventh","maj7#5 maj7+5 +maj7 ^7#5"],["1P 3M 5P 7M 9M 11A","major sharp eleventh (lydian)","maj9#11 Δ9#11 ^9#11"],["1P 2M 4P 5P","","sus24 sus4add9"],["1P 3M 5A 7M 9M","","maj9#5 Maj9#5"],["1P 3M 5A 7m","","7#5 +7 7+ 7aug aug7"],["1P 3M 5A 7m 9A","","7#5#9 7#9#5 7alt"],["1P 3M 5A 7m 9M","","9#5 9+"],["1P 3M 5A 7m 9M 11A","","9#5#11"],["1P 3M 5A 7m 9m","","7#5b9 7b9#5"],["1P 3M 5A 7m 9m 11A","","7#5b9#11"],["1P 3M 5A 9A","","+add#9"],["1P 3M 5A 9M","","M#5add9 +add9"],["1P 3M 5P 6M 11A","","M6#11 M6b5 6#11 6b5"],["1P 3M 5P 6M 7M 9M","","M7add13"],["1P 3M 5P 6M 9M 11A","","69#11"],["1P 3m 5P 6M 9M","","m69 -69"],["1P 3M 5P 6m 7m","","7b6"],["1P 3M 5P 7M 9A 11A","","maj7#9#11"],["1P 3M 5P 7M 9M 11A 13M","","M13#11 maj13#11 M13+4 M13#4"],["1P 3M 5P 7M 9m","","M7b9"],["1P 3M 5P 7m 11A 13m","","7#11b13 7b5b13"],["1P 3M 5P 7m 13M","","7add6 67 7add13"],["1P 3M 5P 7m 9A 11A","","7#9#11 7b5#9 7#9b5"],["1P 3M 5P 7m 9A 11A 13M","","13#9#11"],["1P 3M 5P 7m 9A 11A 13m","","7#9#11b13"],["1P 3M 5P 7m 9A 13M","","13#9"],["1P 3M 5P 7m 9A 13m","","7#9b13"],["1P 3M 5P 7m 9M 11A","","9#11 9+4 9#4"],["1P 3M 5P 7m 9M 11A 13M","","13#11 13+4 13#4"],["1P 3M 5P 7m 9M 11A 13m","","9#11b13 9b5b13"],["1P 3M 5P 7m 9m 11A","","7b9#11 7b5b9 7b9b5"],["1P 3M 5P 7m 9m 11A 13M","","13b9#11"],["1P 3M 5P 7m 9m 11A 13m","","7b9b13#11 7b9#11b13 7b5b9b13"],["1P 3M 5P 7m 9m 13M","","13b9"],["1P 3M 5P 7m 9m 13m","","7b9b13"],["1P 3M 5P 7m 9m 9A","","7b9#9"],["1P 3M 5P 9M","","Madd9 2 add9 add2"],["1P 3M 5P 9m","","Maddb9"],["1P 3M 5d","","Mb5"],["1P 3M 5d 6M 7m 9M","","13b5"],["1P 3M 5d 7M","","M7b5"],["1P 3M 5d 7M 9M","","M9b5"],["1P 3M 5d 7m","","7b5"],["1P 3M 5d 7m 9M","","9b5"],["1P 3M 7m","","7no5"],["1P 3M 7m 13m","","7b13"],["1P 3M 7m 9M","","9no5"],["1P 3M 7m 9M 13M","","13no5"],["1P 3M 7m 9M 13m","","9b13"],["1P 3m 4P 5P","","madd4"],["1P 3m 5P 6m 7M","","mMaj7b6"],["1P 3m 5P 6m 7M 9M","","mMaj9b6"],["1P 3m 5P 7m 11P","","m7add11 m7add4"],["1P 3m 5P 9M","","madd9"],["1P 3m 5d 6M 7M","","o7M7"],["1P 3m 5d 7M","","oM7"],["1P 3m 6m 7M","","mb6M7"],["1P 3m 6m 7m","","m7#5"],["1P 3m 6m 7m 9M","","m9#5"],["1P 3m 5A 7m 9M 11P","","m11A"],["1P 3m 6m 9m","","mb6b9"],["1P 2M 3m 5d 7m","","m9b5"],["1P 4P 5A 7M","","M7#5sus4"],["1P 4P 5A 7M 9M","","M9#5sus4"],["1P 4P 5A 7m","","7#5sus4"],["1P 4P 5P 7M","","M7sus4"],["1P 4P 5P 7M 9M","","M9sus4"],["1P 4P 5P 7m 9M","","9sus4 9sus"],["1P 4P 5P 7m 9M 13M","","13sus4 13sus"],["1P 4P 5P 7m 9m 13m","","7sus4b9b13 7b9b13sus4"],["1P 4P 7m 10m","","4 quartal"],["1P 5P 7m 9m 11P","","11b9"]];({...uu});let T2=[],yh={};function rk(t,r,a){const l=ik(t),u={...E2(t),name:a||"",quality:l,intervals:t,aliases:r};T2.push(u),u.name&&(yh[u.name]=u),yh[u.setNum]=u,yh[u.chroma]=u,u.aliases.forEach(c=>nk(u,c))}function nk(t,r){yh[r]=t}function ik(t){const r=a=>t.indexOf(a)!==-1;return r("5A")?"Augmented":r("3M")?"Major":r("5d")?"Diminished":r("3m")?"Minor":"Unknown"}tk.forEach(([t,r,a])=>rk(t.split(" "),a.split(" "),r));T2.sort((t,r)=>t.setNum-r.setNum);const sk=[["1P 2M 3M 5P 6M","major pentatonic","pentatonic"],["1P 3M 4P 5P 7M","ionian pentatonic"],["1P 3M 4P 5P 7m","mixolydian pentatonic","indian"],["1P 2M 4P 5P 6M","ritusen"],["1P 2M 4P 5P 7m","egyptian"],["1P 3M 4P 5d 7m","neopolitan major pentatonic"],["1P 3m 4P 5P 6m","vietnamese 1"],["1P 2m 3m 5P 6m","pelog"],["1P 2m 4P 5P 6m","kumoijoshi"],["1P 2M 3m 5P 6m","hirajoshi"],["1P 2m 4P 5d 7m","iwato"],["1P 2m 4P 5P 7m","in-sen"],["1P 3M 4A 5P 7M","lydian pentatonic","chinese"],["1P 3m 4P 6m 7m","malkos raga"],["1P 3m 4P 5d 7m","locrian pentatonic","minor seven flat five pentatonic"],["1P 3m 4P 5P 7m","minor pentatonic","vietnamese 2"],["1P 3m 4P 5P 6M","minor six pentatonic"],["1P 2M 3m 5P 6M","flat three pentatonic","kumoi"],["1P 2M 3M 5P 6m","flat six pentatonic"],["1P 2m 3M 5P 6M","scriabin"],["1P 3M 5d 6m 7m","whole tone pentatonic"],["1P 3M 4A 5A 7M","lydian #5P pentatonic"],["1P 3M 4A 5P 7m","lydian dominant pentatonic"],["1P 3m 4P 5P 7M","minor #7M pentatonic"],["1P 3m 4d 5d 7m","super locrian pentatonic"],["1P 2M 3m 4P 5P 7M","minor hexatonic"],["1P 2A 3M 5P 5A 7M","augmented"],["1P 2M 3m 3M 5P 6M","major blues"],["1P 2M 4P 5P 6M 7m","piongio"],["1P 2m 3M 4A 6M 7m","prometheus neopolitan"],["1P 2M 3M 4A 6M 7m","prometheus"],["1P 2m 3M 5d 6m 7m","mystery #1"],["1P 2m 3M 4P 5A 6M","six tone symmetric"],["1P 2M 3M 4A 5A 7m","whole tone","messiaen's mode #1"],["1P 2m 4P 4A 5P 7M","messiaen's mode #5"],["1P 3m 4P 5d 5P 7m","minor blues","blues"],["1P 2M 3M 4P 5d 6m 7m","locrian major","arabian"],["1P 2m 3M 4A 5P 6m 7M","double harmonic lydian"],["1P 2M 3m 4P 5P 6m 7M","harmonic minor"],["1P 2m 3m 4d 5d 6m 7m","altered","super locrian","diminished whole tone","pomeroy"],["1P 2M 3m 4P 5d 6m 7m","locrian #2","half-diminished","aeolian b5"],["1P 2M 3M 4P 5P 6m 7m","mixolydian b6","melodic minor fifth mode","hindu"],["1P 2M 3M 4A 5P 6M 7m","lydian dominant","lydian b7","overtone"],["1P 2M 3M 4A 5P 6M 7M","lydian"],["1P 2M 3M 4A 5A 6M 7M","lydian augmented"],["1P 2m 3m 4P 5P 6M 7m","dorian b2","phrygian #6","melodic minor second mode"],["1P 2M 3m 4P 5P 6M 7M","melodic minor"],["1P 2m 3m 4P 5d 6m 7m","locrian"],["1P 2m 3m 4d 5d 6m 7d","ultralocrian","superlocrian bb7","·superlocrian diminished"],["1P 2m 3m 4P 5d 6M 7m","locrian 6","locrian natural 6","locrian sharp 6"],["1P 2A 3M 4P 5P 5A 7M","augmented heptatonic"],["1P 2M 3m 5d 5P 6M 7m","romanian minor"],["1P 2M 3m 4A 5P 6M 7m","dorian #4"],["1P 2M 3m 4A 5P 6M 7M","lydian diminished"],["1P 2m 3m 4P 5P 6m 7m","phrygian"],["1P 2M 3M 4A 5A 7m 7M","leading whole tone"],["1P 2M 3M 4A 5P 6m 7m","lydian minor"],["1P 2m 3M 4P 5P 6m 7m","phrygian dominant","spanish","phrygian major"],["1P 2m 3m 4P 5P 6m 7M","balinese"],["1P 2m 3m 4P 5P 6M 7M","neopolitan major"],["1P 2M 3m 4P 5P 6m 7m","aeolian","minor"],["1P 2M 3M 4P 5P 6m 7M","harmonic major"],["1P 2m 3M 4P 5P 6m 7M","double harmonic major","gypsy"],["1P 2M 3m 4P 5P 6M 7m","dorian"],["1P 2M 3m 4A 5P 6m 7M","hungarian minor"],["1P 2A 3M 4A 5P 6M 7m","hungarian major"],["1P 2m 3M 4P 5d 6M 7m","oriental"],["1P 2m 3m 3M 4A 5P 7m","flamenco"],["1P 2m 3m 4A 5P 6m 7M","todi raga"],["1P 2M 3M 4P 5P 6M 7m","mixolydian","dominant"],["1P 2m 3M 4P 5d 6m 7M","persian"],["1P 2M 3M 4P 5P 6M 7M","major","ionian"],["1P 2m 3M 5d 6m 7m 7M","enigmatic"],["1P 2M 3M 4P 5A 6M 7M","major augmented","major #5","ionian augmented","ionian #5"],["1P 2A 3M 4A 5P 6M 7M","lydian #9"],["1P 2m 2M 4P 4A 5P 6m 7M","messiaen's mode #4"],["1P 2m 3M 4P 4A 5P 6m 7M","purvi raga"],["1P 2m 3m 3M 4P 5P 6m 7m","spanish heptatonic"],["1P 2M 3M 4P 5P 6M 7m 7M","bebop"],["1P 2M 3m 3M 4P 5P 6M 7m","bebop minor"],["1P 2M 3M 4P 5P 5A 6M 7M","bebop major"],["1P 2m 3m 4P 5d 5P 6m 7m","bebop locrian"],["1P 2M 3m 4P 5P 6m 7m 7M","minor bebop"],["1P 2M 3m 4P 5d 6m 6M 7M","diminished","whole-half diminished"],["1P 2M 3M 4P 5d 5P 6M 7M","ichikosucho"],["1P 2M 3m 4P 5P 6m 6M 7M","minor six diminished"],["1P 2m 3m 3M 4A 5P 6M 7m","half-whole diminished","dominant diminished","messiaen's mode #2"],["1P 3m 3M 4P 5P 6M 7m 7M","kafi raga"],["1P 2M 3M 4P 4A 5A 6A 7M","messiaen's mode #6"],["1P 2M 3m 3M 4P 5d 5P 6M 7m","composite blues"],["1P 2M 3m 3M 4A 5P 6m 7m 7M","messiaen's mode #3"],["1P 2m 2M 3m 4P 4A 5P 6m 6M 7M","messiaen's mode #7"],["1P 2m 2M 3m 3M 4P 5d 5P 6m 6M 7m 7M","chromatic"]];({...uu});let wh={};function ak(t,r,a=[]){const l={...E2(t),name:r,intervals:t,aliases:a};return wh[l.name]=l,wh[l.setNum]=l,wh[l.chroma]=l,l.aliases.forEach(u=>ok(l,u)),l}function ok(t,r){wh[r]=t}sk.forEach(([t,r,...a])=>ak(t.split(" "),r,a));const lk=[[.125,"dl",["large","duplex longa","maxima","octuple","octuple whole"]],[.25,"l",["long","longa"]],[.5,"d",["double whole","double","breve"]],[1,"w",["whole","semibreve"]],[2,"h",["half","minim"]],[4,"q",["quarter","crotchet"]],[8,"e",["eighth","quaver"]],[16,"s",["sixteenth","semiquaver"]],[32,"t",["thirty-second","demisemiquaver"]],[64,"sf",["sixty-fourth","hemidemisemiquaver"]],[128,"h",["hundred twenty-eighth"]],[256,"th",["two hundred fifty-sixth"]]];lk.forEach(([t,r,a])=>void 0);function uk(){return"1P 2M 3M 4P 5P 6m 7m".split(" ")}const ck=Qi,hk=t=>Qi(t).name,fk=t=>Qi(t).semitones,dk=t=>Qi(t).q,pk=t=>Qi(t).num;function gk(t){const r=Qi(t);return r.empty?"":r.simple+r.q}function vk(t){const r=Qi(t);if(r.empty)return"";const a=(7-r.step)%7,l=r.type==="perfectable"?-r.alt:-(r.alt+1);return Qi({step:a,alt:l,oct:r.oct,dir:r.dir}).name}const mk=[1,2,2,3,3,4,5,5,6,6,7,7],_k="P m M m M P d P m M m M".split(" ");function bk(t){const r=t<0?-1:1,a=Math.abs(t),l=a%12,u=Math.floor(a/12);return r*(mk[l]+7*u)+_k[l]}const yk=Gx,I2=P2((t,r)=>[t[0]+r[0],t[1]+r[1]]),wk=t=>r=>I2(t,r),Sk=P2((t,r)=>[t[0]-r[0],t[1]-r[1]]);var Ck={names:uk,get:ck,name:hk,num:pk,semitones:fk,quality:dk,fromSemitones:bk,distance:yk,invert:vk,simplify:gk,add:I2,addTo:wk,substract:Sk};function P2(t){return(r,a)=>{const l=Qi(r).coord,u=Qi(a).coord;if(l&&u){const c=t(l,u);return C2(c).name}}}const xk=Math.log(2),kk=Math.log(440);function N2(t){const r=12*(Math.log(t)-kk)/xk+69;return Math.round(r*100)/100}const Mk="C C# D D# E F F# G G# A A# B".split(" "),Ek="C Db D Eb E F Gb G Ab A Bb B".split(" ");function eh(t,r={}){if(isNaN(t)||t===-1/0||t===1/0)return"";t=Math.round(t);const l=(r.sharps===!0?Mk:Ek)[t%12];if(r.pitchClass)return l;const u=Math.floor(t/12)-1;return l+u}const Ak=["C","D","E","F","G","A","B"],L2=t=>t.name,O2=t=>t.map(No).filter(r=>!r.empty);function Tk(t){return t===void 0?Ak.slice():Array.isArray(t)?O2(t).map(L2):[]}const Ea=No,Ik=t=>Ea(t).name,Pk=t=>Ea(t).pc,Nk=t=>Ea(t).acc,Lk=t=>Ea(t).oct,Ok=t=>Ea(t).midi,Dk=t=>Ea(t).freq,Rk=t=>Ea(t).chroma;function Bk(t){return eh(t)}function Fk(t){return eh(N2(t))}function qk(t){return eh(N2(t),{sharps:!0})}function zk(t){return eh(t,{sharps:!0})}const py=x2,Hk=x2,D2=t=>r=>py(r,t),Vk=D2,R2=t=>r=>py(t,r),Uk=R2;function B2(t,r){const a=Ea(t);if(a.empty)return"";const[l,u]=a.coord;return Ab(u===void 0?[l+r]:[l+r,u]).name}const $k=B2,gy=(t,r)=>t.height-r.height,Wk=(t,r)=>r.height-t.height;function F2(t,r){return r=r||gy,O2(t).sort(r).map(L2)}function Gk(t){return F2(t,gy).filter((r,a,l)=>a===0||r!==l[a-1])}const Yk=q2(!0),Kk=q2(!1);function q2(t){return r=>{const a=Ea(r);if(a.empty)return"";const l=t?a.alt>0:a.alt<0,u=a.midi===null;return eh(a.midi||a.chroma,{sharps:l,pitchClass:u})}}var Ki={names:Tk,get:Ea,name:Ik,pitchClass:Pk,accidentals:Nk,octave:Lk,midi:Ok,ascending:gy,descending:Wk,sortedNames:F2,sortedUniqNames:Gk,fromMidi:Bk,fromMidiSharps:zk,freq:Dk,fromFreq:Fk,fromFreqSharps:qk,chroma:Rk,transpose:py,tr:Hk,transposeBy:D2,trBy:Vk,transposeFrom:R2,trFrom:Uk,transposeFifths:B2,trFifths:$k,simplify:Yk,enharmonic:Kk};const Xk=[[0,2773,0,"ionian","","Maj7","major"],[1,2902,2,"dorian","m","m7"],[2,3418,4,"phrygian","m","m7"],[3,2741,-1,"lydian","","Maj7"],[4,2774,1,"mixolydian","","7"],[5,2906,3,"aeolian","m","m7","minor"],[6,3434,5,"locrian","dim","m7b5"]];({...uu});const Qk=Xk.map(Zk),Iw={};Qk.forEach(t=>{Iw[t.name]=t,t.aliases.forEach(r=>{Iw[r]=t})});function Zk(t){const[r,a,l,u,c,f,p]=t,y=p?[p]:[],S=Number(a).toString(2);return{empty:!1,intervals:A2(S),modeNum:r,chroma:S,normalized:S,name:u,setNum:a,alt:l,triad:c,seventh:f,aliases:y}}function jk(t,r){const a={...t},l=Ki.transpose(t.note.name+t.note.octave,Ck.fromSemitones(r));return a.note={name:Ki.pitchClass(l),number:t.note.number+r,octave:Ki.octave(l)},a}function Jk(t,r){return t.map(a=>jk(a,r))}function rs(t){const r=[];t=t.filter(a=>a.type==="noteon").sort((a,l)=>a.timestamp-l.timestamp);for(let a=10;a>0;a--)for(let l=0;l<t.length-a+1;l++)try{r.push(new ku(t.slice(l,l+a))),t.splice(l,a),l=-1}catch{}return new vy(r)}class vy{constructor(r){lt(this,"syllables"),lt(this,"rootNote"),r.length>0?(this.syllables=r.sort((a,l)=>a.timestamp-l.timestamp),this.rootNote=this.syllables[0].notes.reduce((a,l)=>l.note.number<a.note.number?l:a).note):(this.syllables=[],this.rootNote={name:"C",octave:4,number:0})}append(r){if(this.syllables.length)try{const a=new ku(this.syllables[this.syllables.length-1].notes.map(l=>({note:l.note,timestamp:l.timestamp,type:l.type,velocity:l.velocity})).concat(r));this.syllables.splice(this.syllables.length-1,1,a)}catch{this.syllables.push(new ku([r]))}else this.syllables.push(new ku([r])),this.rootNote=r.note}grade(r){const a=[];for(let l=0;l<this.syllables.length;l++)a.push(this.syllables[l].grade(r.syllables[l]));return new vy(a)}toString(){let r="";return this.syllables.forEach((a,l)=>{r+=`Syllable ${l+1}: {
|
|
128
|
+
`,a.notes.forEach(u=>{r+=` ${u.note.name} ${u.note.number} ${u.timestamp} ${u.isCorrect?"":"(incorrect)"} ${u.isMissing?"(missing)":""}
|
|
129
|
+
`}),r+=`} - ${a.timestamp}, correct: ${a.isCorrect}
|
|
130
|
+
`}),r}isCorrect(){let r=!0;return this.syllables.forEach(a=>{a.isCorrect===!1?r=!1:a.notes.forEach(l=>{l.isCorrect===!1&&(r=!1)})}),r}}class ku{constructor(r){lt(this,"notes"),lt(this,"isCorrect"),r=r.filter(c=>c.type==="noteon");const a=r.reduce((c,f)=>c.timestamp<f.timestamp?c:f),u=r.reduce((c,f)=>c.timestamp>f.timestamp?c:f).timestamp-a.timestamp;if(ku.gracePeriod(r.length)<u)throw new Error(`Notes ${r.toString()} are not close enough together to be a syllable`);this.notes=r.map(c=>({...c,isCorrect:!0,isMissing:!1})).sort((c,f)=>c.note.number-f.note.number)}get timestamp(){let r=0;return this.notes.forEach(a=>{if(a.timestamp===0)return 0;r+=a.timestamp}),r/=this.notes.length,r}static gracePeriod(r){return 1.3*12*r}grade(r){return this.notes.length!==r.notes.length&&(r.isCorrect=!1),r.notes.forEach(a=>{let l=Ki.fromMidi(a.note.number),u=Ki.fromMidiSharps(a.note.number);l=Ki.pitchClass(l),u=Ki.pitchClass(u),a.isCorrect=this.notes.filter(c=>Ki.chroma(l)===Ki.chroma(c.note.name)||Ki.chroma(u)===Ki.chroma(c.note.name)).length>=1,a.isCorrect||(r.isCorrect=!1)}),this.notes.forEach(a=>{let l=Ki.fromMidi(a.note.number);l=Ki.pitchClass(l),r.notes.some(u=>Ki.chroma(u.note.name)===Ki.chroma(l))||r.notes.push({...a,isMissing:!0,isCorrect:!1})}),r}}const Uh=class Ca{constructor(r){lt(this,"recording",[]),lt(this,"webmidi",Ex),lt(this,"input"),lt(this,"output"),lt(this,"_noteonListeners",[]),lt(this,"_noteoffListeners",[]),lt(this,"midiAccess"),lt(this,"_state","initializing"),lt(this,"_userLookup"),this._userLookup=r??null}get state(){return this._state}async init(){if(!this.midiAccess)try{navigator.requestMIDIAccess().then(r=>{this.midiAccess=r,this.midiAccess.onstatechange=a=>{Vn({text:`Midi device ${a.port.name} is ${a.port.state}`,status:a.port.state==="connected"?Jt.ok:Jt.error})}})}catch(r){console.log(`Webmidi not enabled: ${r}`),this._state="notsupported"}try{this.webmidi.disable()}catch(r){console.log(`Webmidi not enabled: ${r}`),this._state="notsupported"}return new Promise((r,a)=>{this.webmidi.enable(async l=>{l?(this._state="notsupported",console.log(`Webmidi not enabled: ${l}`),a(l)):(console.log("Webmidi enabled"),console.log(`Inputs: ${JSON.stringify(this.webmidi.inputs)}`),console.log(`Outputs: ${JSON.stringify(this.webmidi.outputs)}`),this.output=this.webmidi.outputs[0],this.input=this.webmidi.inputs[0],Ca._initializedWithUserConfig||(await this.loadUserConfiguration(),Ca._initializedWithUserConfig=!0),this.input&&this.output?(console.log("midi init state: ready"),this._state="ready",this.attachListeners()):(console.log("midi init state: nodevice"),this._state="nodevice"),r(!0))})})}async loadUserConfiguration(){try{if(!this._userLookup){console.log("User lookup function not provided - using default MIDI configuration");return}const r=await this._userLookup();if(!r){console.log("No user found, using default MIDI configuration");return}const a=await r.getActiveCourses();for(const l of a){const c=await(await r.getCourseInterface(l.courseID)).getCourseSettings();if(c?.midiinput||c?.midioutput){c.midiinput&&this.webmidi.getInputById(c.midiinput.toString())&&(this.selectInput(c.midiinput.toString()),console.log(`Loaded saved MIDI input: ${c.midiinput}`)),c.midioutput&&this.webmidi.getOutputById(c.midioutput.toString())&&(this.selectOutput(c.midioutput.toString()),console.log(`Loaded saved MIDI output: ${c.midioutput}`));break}}}catch(r){console.error("Failed to load user MIDI configuration:",r)}}setStateChangeListener(r){if(this.midiAccess)this.midiAccess.onstatechange=a=>{this.init().then(()=>{console.log(`Midi state: ${this.state}`),r()}),Vn({text:`Midi device ${a.port.name} is ${a.port.state}`,status:a.port.state==="connected"?Jt.ok:Jt.error})};else try{navigator.requestMIDIAccess().then(a=>{this.midiAccess=a,this.midiAccess.onstatechange=l=>{this.init().then(()=>{console.log(`Midi state: ${this.state}`),r()}),Vn({text:`Midi device ${l.port.name} is ${l.port.state}`,status:l.port.state==="connected"?Jt.ok:Jt.error})}})}catch(a){console.log(`Webmidi not enabled: ${a}`),this._state="notsupported"}}attachListeners(){this.input&&(this._noteonListeners.forEach(r=>{var a;(a=this.input)==null||a.on("noteon","all",r)}),this._noteoffListeners.forEach(r=>{var a;(a=this.input)==null||a.on("noteoff","all",r)}))}get hasRecording(){return this.record.length>0}get configuredInput(){return this.input?`${this.input.manufacturer}: ${this.input.name}`:"(Not Sure!)"}eraseRecording(){this.recording=[]}stopRecording(){var r;(r=this.input)==null||r.removeListener()}record(){let r=0;if(this.input===void 0)throw new Error("Midi input not configured!");this.input.connection==="open"&&(this.stopRecording(),this.eraseRecording(),this.input.on("noteon","all",a=>{this.recording.length===0&&(r=a.timestamp),this.recording.push({note:a.note,type:a.type,velocity:a.velocity,timestamp:a.timestamp-r})}),this.input.on("noteoff","all",a=>{this.recording.length===0&&(r=a.timestamp),this.recording.push({note:a.note,velocity:a.velocity,type:a.type,timestamp:a.timestamp-r})}))}addNoteonListenter(r){this._noteonListeners.push(r),this.input&&this.input.on("noteon","all",r)}addNoteoffListenter(r){this._noteoffListeners.push(r),this.input&&this.input.on("noteoff","all",r)}play(r){let a=r||this.recording;a=a.map(l=>({...l,timestamp:l.timestamp+Ca.OFFSET})),a.forEach(l=>{var u,c;l.type==="noteon"?(u=this.output)==null||u.playNote(l.note.name+l.note.octave,1,{velocity:l.velocity,time:`+${l.timestamp}`,rawVelocity:!1}):(c=this.output)==null||c.stopNote(l.note.name+l.note.octave,1,{velocity:l.velocity,time:`+${l.timestamp}`,rawVelocity:!1})})}static async instance(){return Ca._instance||(console.log("Buzz, whirr, Midi instance factory is at work"),Ca._instance=new Ca,await Ca._instance.init()),Ca._instance}get inputs(){return this.webmidi.inputs}get outputs(){return this.webmidi.outputs}selectInput(r){this.webmidi.getInputById(r)!==!1?this.input=this.webmidi.getInputById(r):this.webmidi.getInputByName(r)!==!1&&(this.input=this.webmidi.getInputByName(r))}selectOutput(r){this.webmidi.getOutputById(r)!==!1?this.output=this.webmidi.getOutputById(r):this.webmidi.getOutputByName(r)!==!1&&(this.output=this.webmidi.getOutputByName(r))}};lt(Uh,"_instance");lt(Uh,"OFFSET",5);lt(Uh,"_initializedWithUserConfig",!1);let my=Uh;//! moment.js
|
|
131
|
+
//! version : 2.30.1
|
|
132
|
+
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
133
|
+
//! license : MIT
|
|
134
|
+
//! momentjs.com
|
|
135
|
+
var z2;function Vt(){return z2.apply(null,arguments)}function eM(t){z2=t}function sa(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function ou(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function Yr(t,r){return Object.prototype.hasOwnProperty.call(t,r)}function _y(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var r;for(r in t)if(Yr(t,r))return!1;return!0}function ts(t){return t===void 0}function Lo(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function th(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function H2(t,r){var a=[],l,u=t.length;for(l=0;l<u;++l)a.push(r(t[l],l));return a}function Ko(t,r){for(var a in r)Yr(r,a)&&(t[a]=r[a]);return Yr(r,"toString")&&(t.toString=r.toString),Yr(r,"valueOf")&&(t.valueOf=r.valueOf),t}function Aa(t,r,a,l){return c9(t,r,a,l,!0).utc()}function tM(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function Tr(t){return t._pf==null&&(t._pf=tM()),t._pf}var Ib;Array.prototype.some?Ib=Array.prototype.some:Ib=function(t){var r=Object(this),a=r.length>>>0,l;for(l=0;l<a;l++)if(l in r&&t.call(this,r[l],l,r))return!0;return!1};function by(t){var r=null,a=!1,l=t._d&&!isNaN(t._d.getTime());if(l&&(r=Tr(t),a=Ib.call(r.parsedDateParts,function(u){return u!=null}),l=r.overflow<0&&!r.empty&&!r.invalidEra&&!r.invalidMonth&&!r.invalidWeekday&&!r.weekdayMismatch&&!r.nullInput&&!r.invalidFormat&&!r.userInvalidated&&(!r.meridiem||r.meridiem&&a),t._strict&&(l=l&&r.charsLeftOver===0&&r.unusedTokens.length===0&&r.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=l;else return l;return t._isValid}function $h(t){var r=Aa(NaN);return t!=null?Ko(Tr(r),t):Tr(r).userInvalidated=!0,r}var Pw=Vt.momentProperties=[],wm=!1;function yy(t,r){var a,l,u,c=Pw.length;if(ts(r._isAMomentObject)||(t._isAMomentObject=r._isAMomentObject),ts(r._i)||(t._i=r._i),ts(r._f)||(t._f=r._f),ts(r._l)||(t._l=r._l),ts(r._strict)||(t._strict=r._strict),ts(r._tzm)||(t._tzm=r._tzm),ts(r._isUTC)||(t._isUTC=r._isUTC),ts(r._offset)||(t._offset=r._offset),ts(r._pf)||(t._pf=Tr(r)),ts(r._locale)||(t._locale=r._locale),c>0)for(a=0;a<c;a++)l=Pw[a],u=r[l],ts(u)||(t[l]=u);return t}function rh(t){yy(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),wm===!1&&(wm=!0,Vt.updateOffset(this),wm=!1)}function aa(t){return t instanceof rh||t!=null&&t._isAMomentObject!=null}function V2(t){Vt.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function Ns(t,r){var a=!0;return Ko(function(){if(Vt.deprecationHandler!=null&&Vt.deprecationHandler(null,t),a){var l=[],u,c,f,p=arguments.length;for(c=0;c<p;c++){if(u="",typeof arguments[c]=="object"){u+=`
|
|
136
|
+
[`+c+"] ";for(f in arguments[0])Yr(arguments[0],f)&&(u+=f+": "+arguments[0][f]+", ");u=u.slice(0,-2)}else u=arguments[c];l.push(u)}V2(t+`
|
|
137
|
+
Arguments: `+Array.prototype.slice.call(l).join("")+`
|
|
138
|
+
`+new Error().stack),a=!1}return r.apply(this,arguments)},r)}var Nw={};function U2(t,r){Vt.deprecationHandler!=null&&Vt.deprecationHandler(t,r),Nw[t]||(V2(r),Nw[t]=!0)}Vt.suppressDeprecationWarnings=!1;Vt.deprecationHandler=null;function Ta(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function rM(t){var r,a;for(a in t)Yr(t,a)&&(r=t[a],Ta(r)?this[a]=r:this["_"+a]=r);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Pb(t,r){var a=Ko({},t),l;for(l in r)Yr(r,l)&&(ou(t[l])&&ou(r[l])?(a[l]={},Ko(a[l],t[l]),Ko(a[l],r[l])):r[l]!=null?a[l]=r[l]:delete a[l]);for(l in t)Yr(t,l)&&!Yr(r,l)&&ou(t[l])&&(a[l]=Ko({},a[l]));return a}function wy(t){t!=null&&this.set(t)}var Nb;Object.keys?Nb=Object.keys:Nb=function(t){var r,a=[];for(r in t)Yr(t,r)&&a.push(r);return a};var nM={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function iM(t,r,a){var l=this._calendar[t]||this._calendar.sameElse;return Ta(l)?l.call(r,a):l}function Ma(t,r,a){var l=""+Math.abs(t),u=r-l.length,c=t>=0;return(c?a?"+":"":"-")+Math.pow(10,Math.max(0,u)).toString().substr(1)+l}var Sy=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,fh=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Sm={},Mu={};function lr(t,r,a,l){var u=l;typeof l=="string"&&(u=function(){return this[l]()}),t&&(Mu[t]=u),r&&(Mu[r[0]]=function(){return Ma(u.apply(this,arguments),r[1],r[2])}),a&&(Mu[a]=function(){return this.localeData().ordinal(u.apply(this,arguments),t)})}function sM(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function aM(t){var r=t.match(Sy),a,l;for(a=0,l=r.length;a<l;a++)Mu[r[a]]?r[a]=Mu[r[a]]:r[a]=sM(r[a]);return function(u){var c="",f;for(f=0;f<l;f++)c+=Ta(r[f])?r[f].call(u,t):r[f];return c}}function Sh(t,r){return t.isValid()?(r=$2(r,t.localeData()),Sm[r]=Sm[r]||aM(r),Sm[r](t)):t.localeData().invalidDate()}function $2(t,r){var a=5;function l(u){return r.longDateFormat(u)||u}for(fh.lastIndex=0;a>=0&&fh.test(t);)t=t.replace(fh,l),fh.lastIndex=0,a-=1;return t}var oM={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function lM(t){var r=this._longDateFormat[t],a=this._longDateFormat[t.toUpperCase()];return r||!a?r:(this._longDateFormat[t]=a.match(Sy).map(function(l){return l==="MMMM"||l==="MM"||l==="DD"||l==="dddd"?l.slice(1):l}).join(""),this._longDateFormat[t])}var uM="Invalid date";function cM(){return this._invalidDate}var hM="%d",fM=/\d{1,2}/;function dM(t){return this._ordinal.replace("%d",t)}var pM={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function gM(t,r,a,l){var u=this._relativeTime[a];return Ta(u)?u(t,r,a,l):u.replace(/%d/i,t)}function vM(t,r){var a=this._relativeTime[t>0?"future":"past"];return Ta(a)?a(r):a.replace(/%s/i,r)}var Lw={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Ls(t){return typeof t=="string"?Lw[t]||Lw[t.toLowerCase()]:void 0}function Cy(t){var r={},a,l;for(l in t)Yr(t,l)&&(a=Ls(l),a&&(r[a]=t[l]));return r}var mM={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function _M(t){var r=[],a;for(a in t)Yr(t,a)&&r.push({unit:a,priority:mM[a]});return r.sort(function(l,u){return l.priority-u.priority}),r}var W2=/\d/,ys=/\d\d/,G2=/\d{3}/,xy=/\d{4}/,Wh=/[+-]?\d{6}/,Cn=/\d\d?/,Y2=/\d\d\d\d?/,K2=/\d\d\d\d\d\d?/,Gh=/\d{1,3}/,ky=/\d{1,4}/,Yh=/[+-]?\d{1,6}/,Tu=/\d+/,Kh=/[+-]?\d+/,bM=/Z|[+-]\d\d:?\d\d/gi,Xh=/Z|[+-]\d\d(?::?\d\d)?/gi,yM=/[+-]?\d+(\.\d{1,3})?/,nh=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Iu=/^[1-9]\d?/,My=/^([1-9]\d|\d)/,Lh;Lh={};function Xt(t,r,a){Lh[t]=Ta(r)?r:function(l,u){return l&&a?a:r}}function wM(t,r){return Yr(Lh,t)?Lh[t](r._strict,r._locale):new RegExp(SM(t))}function SM(t){return Io(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(r,a,l,u,c){return a||l||u||c}))}function Io(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Is(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function Fr(t){var r=+t,a=0;return r!==0&&isFinite(r)&&(a=Is(r)),a}var Lb={};function on(t,r){var a,l=r,u;for(typeof t=="string"&&(t=[t]),Lo(r)&&(l=function(c,f){f[r]=Fr(c)}),u=t.length,a=0;a<u;a++)Lb[t[a]]=l}function ih(t,r){on(t,function(a,l,u,c){u._w=u._w||{},r(a,u._w,u,c)})}function CM(t,r,a){r!=null&&Yr(Lb,t)&&Lb[t](r,a._a,a,t)}function Qh(t){return t%4===0&&t%100!==0||t%400===0}var Di=0,Eo=1,ka=2,fi=3,ia=4,Ao=5,iu=6,xM=7,kM=8;lr("Y",0,0,function(){var t=this.year();return t<=9999?Ma(t,4):"+"+t});lr(0,["YY",2],0,function(){return this.year()%100});lr(0,["YYYY",4],0,"year");lr(0,["YYYYY",5],0,"year");lr(0,["YYYYYY",6,!0],0,"year");Xt("Y",Kh);Xt("YY",Cn,ys);Xt("YYYY",ky,xy);Xt("YYYYY",Yh,Wh);Xt("YYYYYY",Yh,Wh);on(["YYYYY","YYYYYY"],Di);on("YYYY",function(t,r){r[Di]=t.length===2?Vt.parseTwoDigitYear(t):Fr(t)});on("YY",function(t,r){r[Di]=Vt.parseTwoDigitYear(t)});on("Y",function(t,r){r[Di]=parseInt(t,10)});function U0(t){return Qh(t)?366:365}Vt.parseTwoDigitYear=function(t){return Fr(t)+(Fr(t)>68?1900:2e3)};var X2=Pu("FullYear",!0);function MM(){return Qh(this.year())}function Pu(t,r){return function(a){return a!=null?(Q2(this,t,a),Vt.updateOffset(this,r),this):G0(this,t)}}function G0(t,r){if(!t.isValid())return NaN;var a=t._d,l=t._isUTC;switch(r){case"Milliseconds":return l?a.getUTCMilliseconds():a.getMilliseconds();case"Seconds":return l?a.getUTCSeconds():a.getSeconds();case"Minutes":return l?a.getUTCMinutes():a.getMinutes();case"Hours":return l?a.getUTCHours():a.getHours();case"Date":return l?a.getUTCDate():a.getDate();case"Day":return l?a.getUTCDay():a.getDay();case"Month":return l?a.getUTCMonth():a.getMonth();case"FullYear":return l?a.getUTCFullYear():a.getFullYear();default:return NaN}}function Q2(t,r,a){var l,u,c,f,p;if(!(!t.isValid()||isNaN(a))){switch(l=t._d,u=t._isUTC,r){case"Milliseconds":return void(u?l.setUTCMilliseconds(a):l.setMilliseconds(a));case"Seconds":return void(u?l.setUTCSeconds(a):l.setSeconds(a));case"Minutes":return void(u?l.setUTCMinutes(a):l.setMinutes(a));case"Hours":return void(u?l.setUTCHours(a):l.setHours(a));case"Date":return void(u?l.setUTCDate(a):l.setDate(a));case"FullYear":break;default:return}c=a,f=t.month(),p=t.date(),p=p===29&&f===1&&!Qh(c)?28:p,u?l.setUTCFullYear(c,f,p):l.setFullYear(c,f,p)}}function EM(t){return t=Ls(t),Ta(this[t])?this[t]():this}function AM(t,r){if(typeof t=="object"){t=Cy(t);var a=_M(t),l,u=a.length;for(l=0;l<u;l++)this[a[l].unit](t[a[l].unit])}else if(t=Ls(t),Ta(this[t]))return this[t](r);return this}function TM(t,r){return(t%r+r)%r}var Un;Array.prototype.indexOf?Un=Array.prototype.indexOf:Un=function(t){var r;for(r=0;r<this.length;++r)if(this[r]===t)return r;return-1};function Ey(t,r){if(isNaN(t)||isNaN(r))return NaN;var a=TM(r,12);return t+=(r-a)/12,a===1?Qh(t)?29:28:31-a%7%2}lr("M",["MM",2],"Mo",function(){return this.month()+1});lr("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)});lr("MMMM",0,0,function(t){return this.localeData().months(this,t)});Xt("M",Cn,Iu);Xt("MM",Cn,ys);Xt("MMM",function(t,r){return r.monthsShortRegex(t)});Xt("MMMM",function(t,r){return r.monthsRegex(t)});on(["M","MM"],function(t,r){r[Eo]=Fr(t)-1});on(["MMM","MMMM"],function(t,r,a,l){var u=a._locale.monthsParse(t,l,a._strict);u!=null?r[Eo]=u:Tr(a).invalidMonth=t});var IM="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Z2="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),j2=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,PM=nh,NM=nh;function LM(t,r){return t?sa(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||j2).test(r)?"format":"standalone"][t.month()]:sa(this._months)?this._months:this._months.standalone}function OM(t,r){return t?sa(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[j2.test(r)?"format":"standalone"][t.month()]:sa(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function DM(t,r,a){var l,u,c,f=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],l=0;l<12;++l)c=Aa([2e3,l]),this._shortMonthsParse[l]=this.monthsShort(c,"").toLocaleLowerCase(),this._longMonthsParse[l]=this.months(c,"").toLocaleLowerCase();return a?r==="MMM"?(u=Un.call(this._shortMonthsParse,f),u!==-1?u:null):(u=Un.call(this._longMonthsParse,f),u!==-1?u:null):r==="MMM"?(u=Un.call(this._shortMonthsParse,f),u!==-1?u:(u=Un.call(this._longMonthsParse,f),u!==-1?u:null)):(u=Un.call(this._longMonthsParse,f),u!==-1?u:(u=Un.call(this._shortMonthsParse,f),u!==-1?u:null))}function RM(t,r,a){var l,u,c;if(this._monthsParseExact)return DM.call(this,t,r,a);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),l=0;l<12;l++){if(u=Aa([2e3,l]),a&&!this._longMonthsParse[l]&&(this._longMonthsParse[l]=new RegExp("^"+this.months(u,"").replace(".","")+"$","i"),this._shortMonthsParse[l]=new RegExp("^"+this.monthsShort(u,"").replace(".","")+"$","i")),!a&&!this._monthsParse[l]&&(c="^"+this.months(u,"")+"|^"+this.monthsShort(u,""),this._monthsParse[l]=new RegExp(c.replace(".",""),"i")),a&&r==="MMMM"&&this._longMonthsParse[l].test(t))return l;if(a&&r==="MMM"&&this._shortMonthsParse[l].test(t))return l;if(!a&&this._monthsParse[l].test(t))return l}}function J2(t,r){if(!t.isValid())return t;if(typeof r=="string"){if(/^\d+$/.test(r))r=Fr(r);else if(r=t.localeData().monthsParse(r),!Lo(r))return t}var a=r,l=t.date();return l=l<29?l:Math.min(l,Ey(t.year(),a)),t._isUTC?t._d.setUTCMonth(a,l):t._d.setMonth(a,l),t}function e9(t){return t!=null?(J2(this,t),Vt.updateOffset(this,!0),this):G0(this,"Month")}function BM(){return Ey(this.year(),this.month())}function FM(t){return this._monthsParseExact?(Yr(this,"_monthsRegex")||t9.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(Yr(this,"_monthsShortRegex")||(this._monthsShortRegex=PM),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function qM(t){return this._monthsParseExact?(Yr(this,"_monthsRegex")||t9.call(this),t?this._monthsStrictRegex:this._monthsRegex):(Yr(this,"_monthsRegex")||(this._monthsRegex=NM),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function t9(){function t(y,S){return S.length-y.length}var r=[],a=[],l=[],u,c,f,p;for(u=0;u<12;u++)c=Aa([2e3,u]),f=Io(this.monthsShort(c,"")),p=Io(this.months(c,"")),r.push(f),a.push(p),l.push(p),l.push(f);r.sort(t),a.sort(t),l.sort(t),this._monthsRegex=new RegExp("^("+l.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function zM(t,r,a,l,u,c,f){var p;return t<100&&t>=0?(p=new Date(t+400,r,a,l,u,c,f),isFinite(p.getFullYear())&&p.setFullYear(t)):p=new Date(t,r,a,l,u,c,f),p}function Y0(t){var r,a;return t<100&&t>=0?(a=Array.prototype.slice.call(arguments),a[0]=t+400,r=new Date(Date.UTC.apply(null,a)),isFinite(r.getUTCFullYear())&&r.setUTCFullYear(t)):r=new Date(Date.UTC.apply(null,arguments)),r}function Oh(t,r,a){var l=7+r-a,u=(7+Y0(t,0,l).getUTCDay()-r)%7;return-u+l-1}function r9(t,r,a,l,u){var c=(7+a-l)%7,f=Oh(t,l,u),p=1+7*(r-1)+c+f,y,S;return p<=0?(y=t-1,S=U0(y)+p):p>U0(t)?(y=t+1,S=p-U0(t)):(y=t,S=p),{year:y,dayOfYear:S}}function K0(t,r,a){var l=Oh(t.year(),r,a),u=Math.floor((t.dayOfYear()-l-1)/7)+1,c,f;return u<1?(f=t.year()-1,c=u+Po(f,r,a)):u>Po(t.year(),r,a)?(c=u-Po(t.year(),r,a),f=t.year()+1):(f=t.year(),c=u),{week:c,year:f}}function Po(t,r,a){var l=Oh(t,r,a),u=Oh(t+1,r,a);return(U0(t)-l+u)/7}lr("w",["ww",2],"wo","week");lr("W",["WW",2],"Wo","isoWeek");Xt("w",Cn,Iu);Xt("ww",Cn,ys);Xt("W",Cn,Iu);Xt("WW",Cn,ys);ih(["w","ww","W","WW"],function(t,r,a,l){r[l.substr(0,1)]=Fr(t)});function HM(t){return K0(t,this._week.dow,this._week.doy).week}var VM={dow:0,doy:6};function UM(){return this._week.dow}function $M(){return this._week.doy}function WM(t){var r=this.localeData().week(this);return t==null?r:this.add((t-r)*7,"d")}function GM(t){var r=K0(this,1,4).week;return t==null?r:this.add((t-r)*7,"d")}lr("d",0,"do","day");lr("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)});lr("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)});lr("dddd",0,0,function(t){return this.localeData().weekdays(this,t)});lr("e",0,0,"weekday");lr("E",0,0,"isoWeekday");Xt("d",Cn);Xt("e",Cn);Xt("E",Cn);Xt("dd",function(t,r){return r.weekdaysMinRegex(t)});Xt("ddd",function(t,r){return r.weekdaysShortRegex(t)});Xt("dddd",function(t,r){return r.weekdaysRegex(t)});ih(["dd","ddd","dddd"],function(t,r,a,l){var u=a._locale.weekdaysParse(t,l,a._strict);u!=null?r.d=u:Tr(a).invalidWeekday=t});ih(["d","e","E"],function(t,r,a,l){r[l]=Fr(t)});function YM(t,r){return typeof t!="string"?t:isNaN(t)?(t=r.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function KM(t,r){return typeof t=="string"?r.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Ay(t,r){return t.slice(r,7).concat(t.slice(0,r))}var XM="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),n9="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),QM="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ZM=nh,jM=nh,JM=nh;function eE(t,r){var a=sa(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(r)?"format":"standalone"];return t===!0?Ay(a,this._week.dow):t?a[t.day()]:a}function tE(t){return t===!0?Ay(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function rE(t){return t===!0?Ay(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function nE(t,r,a){var l,u,c,f=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],l=0;l<7;++l)c=Aa([2e3,1]).day(l),this._minWeekdaysParse[l]=this.weekdaysMin(c,"").toLocaleLowerCase(),this._shortWeekdaysParse[l]=this.weekdaysShort(c,"").toLocaleLowerCase(),this._weekdaysParse[l]=this.weekdays(c,"").toLocaleLowerCase();return a?r==="dddd"?(u=Un.call(this._weekdaysParse,f),u!==-1?u:null):r==="ddd"?(u=Un.call(this._shortWeekdaysParse,f),u!==-1?u:null):(u=Un.call(this._minWeekdaysParse,f),u!==-1?u:null):r==="dddd"?(u=Un.call(this._weekdaysParse,f),u!==-1||(u=Un.call(this._shortWeekdaysParse,f),u!==-1)?u:(u=Un.call(this._minWeekdaysParse,f),u!==-1?u:null)):r==="ddd"?(u=Un.call(this._shortWeekdaysParse,f),u!==-1||(u=Un.call(this._weekdaysParse,f),u!==-1)?u:(u=Un.call(this._minWeekdaysParse,f),u!==-1?u:null)):(u=Un.call(this._minWeekdaysParse,f),u!==-1||(u=Un.call(this._weekdaysParse,f),u!==-1)?u:(u=Un.call(this._shortWeekdaysParse,f),u!==-1?u:null))}function iE(t,r,a){var l,u,c;if(this._weekdaysParseExact)return nE.call(this,t,r,a);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),l=0;l<7;l++){if(u=Aa([2e3,1]).day(l),a&&!this._fullWeekdaysParse[l]&&(this._fullWeekdaysParse[l]=new RegExp("^"+this.weekdays(u,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[l]=new RegExp("^"+this.weekdaysShort(u,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[l]=new RegExp("^"+this.weekdaysMin(u,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[l]||(c="^"+this.weekdays(u,"")+"|^"+this.weekdaysShort(u,"")+"|^"+this.weekdaysMin(u,""),this._weekdaysParse[l]=new RegExp(c.replace(".",""),"i")),a&&r==="dddd"&&this._fullWeekdaysParse[l].test(t))return l;if(a&&r==="ddd"&&this._shortWeekdaysParse[l].test(t))return l;if(a&&r==="dd"&&this._minWeekdaysParse[l].test(t))return l;if(!a&&this._weekdaysParse[l].test(t))return l}}function sE(t){if(!this.isValid())return t!=null?this:NaN;var r=G0(this,"Day");return t!=null?(t=YM(t,this.localeData()),this.add(t-r,"d")):r}function aE(t){if(!this.isValid())return t!=null?this:NaN;var r=(this.day()+7-this.localeData()._week.dow)%7;return t==null?r:this.add(t-r,"d")}function oE(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var r=KM(t,this.localeData());return this.day(this.day()%7?r:r-7)}else return this.day()||7}function lE(t){return this._weekdaysParseExact?(Yr(this,"_weekdaysRegex")||Ty.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(Yr(this,"_weekdaysRegex")||(this._weekdaysRegex=ZM),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function uE(t){return this._weekdaysParseExact?(Yr(this,"_weekdaysRegex")||Ty.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Yr(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=jM),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function cE(t){return this._weekdaysParseExact?(Yr(this,"_weekdaysRegex")||Ty.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Yr(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=JM),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ty(){function t(A,M){return M.length-A.length}var r=[],a=[],l=[],u=[],c,f,p,y,S;for(c=0;c<7;c++)f=Aa([2e3,1]).day(c),p=Io(this.weekdaysMin(f,"")),y=Io(this.weekdaysShort(f,"")),S=Io(this.weekdays(f,"")),r.push(p),a.push(y),l.push(S),u.push(p),u.push(y),u.push(S);r.sort(t),a.sort(t),l.sort(t),u.sort(t),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Iy(){return this.hours()%12||12}function hE(){return this.hours()||24}lr("H",["HH",2],0,"hour");lr("h",["hh",2],0,Iy);lr("k",["kk",2],0,hE);lr("hmm",0,0,function(){return""+Iy.apply(this)+Ma(this.minutes(),2)});lr("hmmss",0,0,function(){return""+Iy.apply(this)+Ma(this.minutes(),2)+Ma(this.seconds(),2)});lr("Hmm",0,0,function(){return""+this.hours()+Ma(this.minutes(),2)});lr("Hmmss",0,0,function(){return""+this.hours()+Ma(this.minutes(),2)+Ma(this.seconds(),2)});function i9(t,r){lr(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),r)})}i9("a",!0);i9("A",!1);function s9(t,r){return r._meridiemParse}Xt("a",s9);Xt("A",s9);Xt("H",Cn,My);Xt("h",Cn,Iu);Xt("k",Cn,Iu);Xt("HH",Cn,ys);Xt("hh",Cn,ys);Xt("kk",Cn,ys);Xt("hmm",Y2);Xt("hmmss",K2);Xt("Hmm",Y2);Xt("Hmmss",K2);on(["H","HH"],fi);on(["k","kk"],function(t,r,a){var l=Fr(t);r[fi]=l===24?0:l});on(["a","A"],function(t,r,a){a._isPm=a._locale.isPM(t),a._meridiem=t});on(["h","hh"],function(t,r,a){r[fi]=Fr(t),Tr(a).bigHour=!0});on("hmm",function(t,r,a){var l=t.length-2;r[fi]=Fr(t.substr(0,l)),r[ia]=Fr(t.substr(l)),Tr(a).bigHour=!0});on("hmmss",function(t,r,a){var l=t.length-4,u=t.length-2;r[fi]=Fr(t.substr(0,l)),r[ia]=Fr(t.substr(l,2)),r[Ao]=Fr(t.substr(u)),Tr(a).bigHour=!0});on("Hmm",function(t,r,a){var l=t.length-2;r[fi]=Fr(t.substr(0,l)),r[ia]=Fr(t.substr(l))});on("Hmmss",function(t,r,a){var l=t.length-4,u=t.length-2;r[fi]=Fr(t.substr(0,l)),r[ia]=Fr(t.substr(l,2)),r[Ao]=Fr(t.substr(u))});function fE(t){return(t+"").toLowerCase().charAt(0)==="p"}var dE=/[ap]\.?m?\.?/i,pE=Pu("Hours",!0);function gE(t,r,a){return t>11?a?"pm":"PM":a?"am":"AM"}var a9={calendar:nM,longDateFormat:oM,invalidDate:uM,ordinal:hM,dayOfMonthOrdinalParse:fM,relativeTime:pM,months:IM,monthsShort:Z2,week:VM,weekdays:XM,weekdaysMin:QM,weekdaysShort:n9,meridiemParse:dE},kn={},B0={},X0;function vE(t,r){var a,l=Math.min(t.length,r.length);for(a=0;a<l;a+=1)if(t[a]!==r[a])return a;return l}function Ow(t){return t&&t.toLowerCase().replace("_","-")}function mE(t){for(var r=0,a,l,u,c;r<t.length;){for(c=Ow(t[r]).split("-"),a=c.length,l=Ow(t[r+1]),l=l?l.split("-"):null;a>0;){if(u=Zh(c.slice(0,a).join("-")),u)return u;if(l&&l.length>=a&&vE(c,l)>=a-1)break;a--}r++}return X0}function _E(t){return!!(t&&t.match("^[^/\\\\]*$"))}function Zh(t){var r=null,a;if(kn[t]===void 0&&typeof module<"u"&&module&&module.exports&&_E(t))try{r=X0._abbr,a=require,a("./locale/"+t),Qo(r)}catch{kn[t]=null}return kn[t]}function Qo(t,r){var a;return t&&(ts(r)?a=Do(t):a=Py(t,r),a?X0=a:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),X0._abbr}function Py(t,r){if(r!==null){var a,l=a9;if(r.abbr=t,kn[t]!=null)U2("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),l=kn[t]._config;else if(r.parentLocale!=null)if(kn[r.parentLocale]!=null)l=kn[r.parentLocale]._config;else if(a=Zh(r.parentLocale),a!=null)l=a._config;else return B0[r.parentLocale]||(B0[r.parentLocale]=[]),B0[r.parentLocale].push({name:t,config:r}),null;return kn[t]=new wy(Pb(l,r)),B0[t]&&B0[t].forEach(function(u){Py(u.name,u.config)}),Qo(t),kn[t]}else return delete kn[t],null}function bE(t,r){if(r!=null){var a,l,u=a9;kn[t]!=null&&kn[t].parentLocale!=null?kn[t].set(Pb(kn[t]._config,r)):(l=Zh(t),l!=null&&(u=l._config),r=Pb(u,r),l==null&&(r.abbr=t),a=new wy(r),a.parentLocale=kn[t],kn[t]=a),Qo(t)}else kn[t]!=null&&(kn[t].parentLocale!=null?(kn[t]=kn[t].parentLocale,t===Qo()&&Qo(t)):kn[t]!=null&&delete kn[t]);return kn[t]}function Do(t){var r;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return X0;if(!sa(t)){if(r=Zh(t),r)return r;t=[t]}return mE(t)}function yE(){return Nb(kn)}function Ny(t){var r,a=t._a;return a&&Tr(t).overflow===-2&&(r=a[Eo]<0||a[Eo]>11?Eo:a[ka]<1||a[ka]>Ey(a[Di],a[Eo])?ka:a[fi]<0||a[fi]>24||a[fi]===24&&(a[ia]!==0||a[Ao]!==0||a[iu]!==0)?fi:a[ia]<0||a[ia]>59?ia:a[Ao]<0||a[Ao]>59?Ao:a[iu]<0||a[iu]>999?iu:-1,Tr(t)._overflowDayOfYear&&(r<Di||r>ka)&&(r=ka),Tr(t)._overflowWeeks&&r===-1&&(r=xM),Tr(t)._overflowWeekday&&r===-1&&(r=kM),Tr(t).overflow=r),t}var wE=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,SE=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,CE=/Z|[+-]\d\d(?::?\d\d)?/,dh=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Cm=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],xE=/^\/?Date\((-?\d+)/i,kE=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,ME={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function o9(t){var r,a,l=t._i,u=wE.exec(l)||SE.exec(l),c,f,p,y,S=dh.length,A=Cm.length;if(u){for(Tr(t).iso=!0,r=0,a=S;r<a;r++)if(dh[r][1].exec(u[1])){f=dh[r][0],c=dh[r][2]!==!1;break}if(f==null){t._isValid=!1;return}if(u[3]){for(r=0,a=A;r<a;r++)if(Cm[r][1].exec(u[3])){p=(u[2]||" ")+Cm[r][0];break}if(p==null){t._isValid=!1;return}}if(!c&&p!=null){t._isValid=!1;return}if(u[4])if(CE.exec(u[4]))y="Z";else{t._isValid=!1;return}t._f=f+(p||"")+(y||""),Oy(t)}else t._isValid=!1}function EE(t,r,a,l,u,c){var f=[AE(t),Z2.indexOf(r),parseInt(a,10),parseInt(l,10),parseInt(u,10)];return c&&f.push(parseInt(c,10)),f}function AE(t){var r=parseInt(t,10);return r<=49?2e3+r:r<=999?1900+r:r}function TE(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function IE(t,r,a){if(t){var l=n9.indexOf(t),u=new Date(r[0],r[1],r[2]).getDay();if(l!==u)return Tr(a).weekdayMismatch=!0,a._isValid=!1,!1}return!0}function PE(t,r,a){if(t)return ME[t];if(r)return 0;var l=parseInt(a,10),u=l%100,c=(l-u)/100;return c*60+u}function l9(t){var r=kE.exec(TE(t._i)),a;if(r){if(a=EE(r[4],r[3],r[2],r[5],r[6],r[7]),!IE(r[1],a,t))return;t._a=a,t._tzm=PE(r[8],r[9],r[10]),t._d=Y0.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),Tr(t).rfc2822=!0}else t._isValid=!1}function NE(t){var r=xE.exec(t._i);if(r!==null){t._d=new Date(+r[1]);return}if(o9(t),t._isValid===!1)delete t._isValid;else return;if(l9(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:Vt.createFromInputFallback(t)}Vt.createFromInputFallback=Ns("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function bu(t,r,a){return t??r??a}function LE(t){var r=new Date(Vt.now());return t._useUTC?[r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()]:[r.getFullYear(),r.getMonth(),r.getDate()]}function Ly(t){var r,a,l=[],u,c,f;if(!t._d){for(u=LE(t),t._w&&t._a[ka]==null&&t._a[Eo]==null&&OE(t),t._dayOfYear!=null&&(f=bu(t._a[Di],u[Di]),(t._dayOfYear>U0(f)||t._dayOfYear===0)&&(Tr(t)._overflowDayOfYear=!0),a=Y0(f,0,t._dayOfYear),t._a[Eo]=a.getUTCMonth(),t._a[ka]=a.getUTCDate()),r=0;r<3&&t._a[r]==null;++r)t._a[r]=l[r]=u[r];for(;r<7;r++)t._a[r]=l[r]=t._a[r]==null?r===2?1:0:t._a[r];t._a[fi]===24&&t._a[ia]===0&&t._a[Ao]===0&&t._a[iu]===0&&(t._nextDay=!0,t._a[fi]=0),t._d=(t._useUTC?Y0:zM).apply(null,l),c=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[fi]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==c&&(Tr(t).weekdayMismatch=!0)}}function OE(t){var r,a,l,u,c,f,p,y,S;r=t._w,r.GG!=null||r.W!=null||r.E!=null?(c=1,f=4,a=bu(r.GG,t._a[Di],K0(Sn(),1,4).year),l=bu(r.W,1),u=bu(r.E,1),(u<1||u>7)&&(y=!0)):(c=t._locale._week.dow,f=t._locale._week.doy,S=K0(Sn(),c,f),a=bu(r.gg,t._a[Di],S.year),l=bu(r.w,S.week),r.d!=null?(u=r.d,(u<0||u>6)&&(y=!0)):r.e!=null?(u=r.e+c,(r.e<0||r.e>6)&&(y=!0)):u=c),l<1||l>Po(a,c,f)?Tr(t)._overflowWeeks=!0:y!=null?Tr(t)._overflowWeekday=!0:(p=r9(a,l,u,c,f),t._a[Di]=p.year,t._dayOfYear=p.dayOfYear)}Vt.ISO_8601=function(){};Vt.RFC_2822=function(){};function Oy(t){if(t._f===Vt.ISO_8601){o9(t);return}if(t._f===Vt.RFC_2822){l9(t);return}t._a=[],Tr(t).empty=!0;var r=""+t._i,a,l,u,c,f,p=r.length,y=0,S,A;for(u=$2(t._f,t._locale).match(Sy)||[],A=u.length,a=0;a<A;a++)c=u[a],l=(r.match(wM(c,t))||[])[0],l&&(f=r.substr(0,r.indexOf(l)),f.length>0&&Tr(t).unusedInput.push(f),r=r.slice(r.indexOf(l)+l.length),y+=l.length),Mu[c]?(l?Tr(t).empty=!1:Tr(t).unusedTokens.push(c),CM(c,l,t)):t._strict&&!l&&Tr(t).unusedTokens.push(c);Tr(t).charsLeftOver=p-y,r.length>0&&Tr(t).unusedInput.push(r),t._a[fi]<=12&&Tr(t).bigHour===!0&&t._a[fi]>0&&(Tr(t).bigHour=void 0),Tr(t).parsedDateParts=t._a.slice(0),Tr(t).meridiem=t._meridiem,t._a[fi]=DE(t._locale,t._a[fi],t._meridiem),S=Tr(t).era,S!==null&&(t._a[Di]=t._locale.erasConvertYear(S,t._a[Di])),Ly(t),Ny(t)}function DE(t,r,a){var l;return a==null?r:t.meridiemHour!=null?t.meridiemHour(r,a):(t.isPM!=null&&(l=t.isPM(a),l&&r<12&&(r+=12),!l&&r===12&&(r=0)),r)}function RE(t){var r,a,l,u,c,f,p=!1,y=t._f.length;if(y===0){Tr(t).invalidFormat=!0,t._d=new Date(NaN);return}for(u=0;u<y;u++)c=0,f=!1,r=yy({},t),t._useUTC!=null&&(r._useUTC=t._useUTC),r._f=t._f[u],Oy(r),by(r)&&(f=!0),c+=Tr(r).charsLeftOver,c+=Tr(r).unusedTokens.length*10,Tr(r).score=c,p?c<l&&(l=c,a=r):(l==null||c<l||f)&&(l=c,a=r,f&&(p=!0));Ko(t,a||r)}function BE(t){if(!t._d){var r=Cy(t._i),a=r.day===void 0?r.date:r.day;t._a=H2([r.year,r.month,a,r.hour,r.minute,r.second,r.millisecond],function(l){return l&&parseInt(l,10)}),Ly(t)}}function FE(t){var r=new rh(Ny(u9(t)));return r._nextDay&&(r.add(1,"d"),r._nextDay=void 0),r}function u9(t){var r=t._i,a=t._f;return t._locale=t._locale||Do(t._l),r===null||a===void 0&&r===""?$h({nullInput:!0}):(typeof r=="string"&&(t._i=r=t._locale.preparse(r)),aa(r)?new rh(Ny(r)):(th(r)?t._d=r:sa(a)?RE(t):a?Oy(t):qE(t),by(t)||(t._d=null),t))}function qE(t){var r=t._i;ts(r)?t._d=new Date(Vt.now()):th(r)?t._d=new Date(r.valueOf()):typeof r=="string"?NE(t):sa(r)?(t._a=H2(r.slice(0),function(a){return parseInt(a,10)}),Ly(t)):ou(r)?BE(t):Lo(r)?t._d=new Date(r):Vt.createFromInputFallback(t)}function c9(t,r,a,l,u){var c={};return(r===!0||r===!1)&&(l=r,r=void 0),(a===!0||a===!1)&&(l=a,a=void 0),(ou(t)&&_y(t)||sa(t)&&t.length===0)&&(t=void 0),c._isAMomentObject=!0,c._useUTC=c._isUTC=u,c._l=a,c._i=t,c._f=r,c._strict=l,FE(c)}function Sn(t,r,a,l){return c9(t,r,a,l,!1)}var zE=Ns("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Sn.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:$h()}),HE=Ns("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Sn.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:$h()});function h9(t,r){var a,l;if(r.length===1&&sa(r[0])&&(r=r[0]),!r.length)return Sn();for(a=r[0],l=1;l<r.length;++l)(!r[l].isValid()||r[l][t](a))&&(a=r[l]);return a}function VE(){var t=[].slice.call(arguments,0);return h9("isBefore",t)}function UE(){var t=[].slice.call(arguments,0);return h9("isAfter",t)}var $E=function(){return Date.now?Date.now():+new Date},F0=["year","quarter","month","week","day","hour","minute","second","millisecond"];function WE(t){var r,a=!1,l,u=F0.length;for(r in t)if(Yr(t,r)&&!(Un.call(F0,r)!==-1&&(t[r]==null||!isNaN(t[r]))))return!1;for(l=0;l<u;++l)if(t[F0[l]]){if(a)return!1;parseFloat(t[F0[l]])!==Fr(t[F0[l]])&&(a=!0)}return!0}function GE(){return this._isValid}function YE(){return la(NaN)}function jh(t){var r=Cy(t),a=r.year||0,l=r.quarter||0,u=r.month||0,c=r.week||r.isoWeek||0,f=r.day||0,p=r.hour||0,y=r.minute||0,S=r.second||0,A=r.millisecond||0;this._isValid=WE(r),this._milliseconds=+A+S*1e3+y*6e4+p*1e3*60*60,this._days=+f+c*7,this._months=+u+l*3+a*12,this._data={},this._locale=Do(),this._bubble()}function Ch(t){return t instanceof jh}function Ob(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function KE(t,r,a){var l=Math.min(t.length,r.length),u=Math.abs(t.length-r.length),c=0,f;for(f=0;f<l;f++)Fr(t[f])!==Fr(r[f])&&c++;return c+u}function f9(t,r){lr(t,0,0,function(){var a=this.utcOffset(),l="+";return a<0&&(a=-a,l="-"),l+Ma(~~(a/60),2)+r+Ma(~~a%60,2)})}f9("Z",":");f9("ZZ","");Xt("Z",Xh);Xt("ZZ",Xh);on(["Z","ZZ"],function(t,r,a){a._useUTC=!0,a._tzm=Dy(Xh,t)});var XE=/([\+\-]|\d\d)/gi;function Dy(t,r){var a=(r||"").match(t),l,u,c;return a===null?null:(l=a[a.length-1]||[],u=(l+"").match(XE)||["-",0,0],c=+(u[1]*60)+Fr(u[2]),c===0?0:u[0]==="+"?c:-c)}function Ry(t,r){var a,l;return r._isUTC?(a=r.clone(),l=(aa(t)||th(t)?t.valueOf():Sn(t).valueOf())-a.valueOf(),a._d.setTime(a._d.valueOf()+l),Vt.updateOffset(a,!1),a):Sn(t).local()}function Db(t){return-Math.round(t._d.getTimezoneOffset())}Vt.updateOffset=function(){};function QE(t,r,a){var l=this._offset||0,u;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=Dy(Xh,t),t===null)return this}else Math.abs(t)<16&&!a&&(t=t*60);return!this._isUTC&&r&&(u=Db(this)),this._offset=t,this._isUTC=!0,u!=null&&this.add(u,"m"),l!==t&&(!r||this._changeInProgress?g9(this,la(t-l,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,Vt.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?l:Db(this)}function ZE(t,r){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,r),this):-this.utcOffset()}function jE(t){return this.utcOffset(0,t)}function JE(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Db(this),"m")),this}function eA(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=Dy(bM,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function tA(t){return this.isValid()?(t=t?Sn(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function rA(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function nA(){if(!ts(this._isDSTShifted))return this._isDSTShifted;var t={},r;return yy(t,this),t=u9(t),t._a?(r=t._isUTC?Aa(t._a):Sn(t._a),this._isDSTShifted=this.isValid()&&KE(t._a,r.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function iA(){return this.isValid()?!this._isUTC:!1}function sA(){return this.isValid()?this._isUTC:!1}function d9(){return this.isValid()?this._isUTC&&this._offset===0:!1}var aA=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,oA=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function la(t,r){var a=t,l=null,u,c,f;return Ch(t)?a={ms:t._milliseconds,d:t._days,M:t._months}:Lo(t)||!isNaN(+t)?(a={},r?a[r]=+t:a.milliseconds=+t):(l=aA.exec(t))?(u=l[1]==="-"?-1:1,a={y:0,d:Fr(l[ka])*u,h:Fr(l[fi])*u,m:Fr(l[ia])*u,s:Fr(l[Ao])*u,ms:Fr(Ob(l[iu]*1e3))*u}):(l=oA.exec(t))?(u=l[1]==="-"?-1:1,a={y:ru(l[2],u),M:ru(l[3],u),w:ru(l[4],u),d:ru(l[5],u),h:ru(l[6],u),m:ru(l[7],u),s:ru(l[8],u)}):a==null?a={}:typeof a=="object"&&("from"in a||"to"in a)&&(f=lA(Sn(a.from),Sn(a.to)),a={},a.ms=f.milliseconds,a.M=f.months),c=new jh(a),Ch(t)&&Yr(t,"_locale")&&(c._locale=t._locale),Ch(t)&&Yr(t,"_isValid")&&(c._isValid=t._isValid),c}la.fn=jh.prototype;la.invalid=YE;function ru(t,r){var a=t&&parseFloat(t.replace(",","."));return(isNaN(a)?0:a)*r}function Dw(t,r){var a={};return a.months=r.month()-t.month()+(r.year()-t.year())*12,t.clone().add(a.months,"M").isAfter(r)&&--a.months,a.milliseconds=+r-+t.clone().add(a.months,"M"),a}function lA(t,r){var a;return t.isValid()&&r.isValid()?(r=Ry(r,t),t.isBefore(r)?a=Dw(t,r):(a=Dw(r,t),a.milliseconds=-a.milliseconds,a.months=-a.months),a):{milliseconds:0,months:0}}function p9(t,r){return function(a,l){var u,c;return l!==null&&!isNaN(+l)&&(U2(r,"moment()."+r+"(period, number) is deprecated. Please use moment()."+r+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),c=a,a=l,l=c),u=la(a,l),g9(this,u,t),this}}function g9(t,r,a,l){var u=r._milliseconds,c=Ob(r._days),f=Ob(r._months);t.isValid()&&(l=l??!0,f&&J2(t,G0(t,"Month")+f*a),c&&Q2(t,"Date",G0(t,"Date")+c*a),u&&t._d.setTime(t._d.valueOf()+u*a),l&&Vt.updateOffset(t,c||f))}var uA=p9(1,"add"),cA=p9(-1,"subtract");function v9(t){return typeof t=="string"||t instanceof String}function hA(t){return aa(t)||th(t)||v9(t)||Lo(t)||dA(t)||fA(t)||t===null||t===void 0}function fA(t){var r=ou(t)&&!_y(t),a=!1,l=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],u,c,f=l.length;for(u=0;u<f;u+=1)c=l[u],a=a||Yr(t,c);return r&&a}function dA(t){var r=sa(t),a=!1;return r&&(a=t.filter(function(l){return!Lo(l)&&v9(t)}).length===0),r&&a}function pA(t){var r=ou(t)&&!_y(t),a=!1,l=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],u,c;for(u=0;u<l.length;u+=1)c=l[u],a=a||Yr(t,c);return r&&a}function gA(t,r){var a=t.diff(r,"days",!0);return a<-6?"sameElse":a<-1?"lastWeek":a<0?"lastDay":a<1?"sameDay":a<2?"nextDay":a<7?"nextWeek":"sameElse"}function vA(t,r){arguments.length===1&&(arguments[0]?hA(arguments[0])?(t=arguments[0],r=void 0):pA(arguments[0])&&(r=arguments[0],t=void 0):(t=void 0,r=void 0));var a=t||Sn(),l=Ry(a,this).startOf("day"),u=Vt.calendarFormat(this,l)||"sameElse",c=r&&(Ta(r[u])?r[u].call(this,a):r[u]);return this.format(c||this.localeData().calendar(u,this,Sn(a)))}function mA(){return new rh(this)}function _A(t,r){var a=aa(t)?t:Sn(t);return this.isValid()&&a.isValid()?(r=Ls(r)||"millisecond",r==="millisecond"?this.valueOf()>a.valueOf():a.valueOf()<this.clone().startOf(r).valueOf()):!1}function bA(t,r){var a=aa(t)?t:Sn(t);return this.isValid()&&a.isValid()?(r=Ls(r)||"millisecond",r==="millisecond"?this.valueOf()<a.valueOf():this.clone().endOf(r).valueOf()<a.valueOf()):!1}function yA(t,r,a,l){var u=aa(t)?t:Sn(t),c=aa(r)?r:Sn(r);return this.isValid()&&u.isValid()&&c.isValid()?(l=l||"()",(l[0]==="("?this.isAfter(u,a):!this.isBefore(u,a))&&(l[1]===")"?this.isBefore(c,a):!this.isAfter(c,a))):!1}function wA(t,r){var a=aa(t)?t:Sn(t),l;return this.isValid()&&a.isValid()?(r=Ls(r)||"millisecond",r==="millisecond"?this.valueOf()===a.valueOf():(l=a.valueOf(),this.clone().startOf(r).valueOf()<=l&&l<=this.clone().endOf(r).valueOf())):!1}function SA(t,r){return this.isSame(t,r)||this.isAfter(t,r)}function CA(t,r){return this.isSame(t,r)||this.isBefore(t,r)}function xA(t,r,a){var l,u,c;if(!this.isValid())return NaN;if(l=Ry(t,this),!l.isValid())return NaN;switch(u=(l.utcOffset()-this.utcOffset())*6e4,r=Ls(r),r){case"year":c=xh(this,l)/12;break;case"month":c=xh(this,l);break;case"quarter":c=xh(this,l)/3;break;case"second":c=(this-l)/1e3;break;case"minute":c=(this-l)/6e4;break;case"hour":c=(this-l)/36e5;break;case"day":c=(this-l-u)/864e5;break;case"week":c=(this-l-u)/6048e5;break;default:c=this-l}return a?c:Is(c)}function xh(t,r){if(t.date()<r.date())return-xh(r,t);var a=(r.year()-t.year())*12+(r.month()-t.month()),l=t.clone().add(a,"months"),u,c;return r-l<0?(u=t.clone().add(a-1,"months"),c=(r-l)/(l-u)):(u=t.clone().add(a+1,"months"),c=(r-l)/(u-l)),-(a+c)||0}Vt.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";Vt.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function kA(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function MA(t){if(!this.isValid())return null;var r=t!==!0,a=r?this.clone().utc():this;return a.year()<0||a.year()>9999?Sh(a,r?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Ta(Date.prototype.toISOString)?r?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Sh(a,"Z")):Sh(a,r?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function EA(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",r="",a,l,u,c;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",r="Z"),a="["+t+'("]',l=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",u="-MM-DD[T]HH:mm:ss.SSS",c=r+'[")]',this.format(a+l+u+c)}function AA(t){t||(t=this.isUtc()?Vt.defaultFormatUtc:Vt.defaultFormat);var r=Sh(this,t);return this.localeData().postformat(r)}function TA(t,r){return this.isValid()&&(aa(t)&&t.isValid()||Sn(t).isValid())?la({to:this,from:t}).locale(this.locale()).humanize(!r):this.localeData().invalidDate()}function IA(t){return this.from(Sn(),t)}function PA(t,r){return this.isValid()&&(aa(t)&&t.isValid()||Sn(t).isValid())?la({from:this,to:t}).locale(this.locale()).humanize(!r):this.localeData().invalidDate()}function NA(t){return this.to(Sn(),t)}function m9(t){var r;return t===void 0?this._locale._abbr:(r=Do(t),r!=null&&(this._locale=r),this)}var _9=Ns("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function b9(){return this._locale}var Dh=1e3,Eu=60*Dh,Rh=60*Eu,y9=(365*400+97)*24*Rh;function Au(t,r){return(t%r+r)%r}function w9(t,r,a){return t<100&&t>=0?new Date(t+400,r,a)-y9:new Date(t,r,a).valueOf()}function S9(t,r,a){return t<100&&t>=0?Date.UTC(t+400,r,a)-y9:Date.UTC(t,r,a)}function LA(t){var r,a;if(t=Ls(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(a=this._isUTC?S9:w9,t){case"year":r=a(this.year(),0,1);break;case"quarter":r=a(this.year(),this.month()-this.month()%3,1);break;case"month":r=a(this.year(),this.month(),1);break;case"week":r=a(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":r=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":r=a(this.year(),this.month(),this.date());break;case"hour":r=this._d.valueOf(),r-=Au(r+(this._isUTC?0:this.utcOffset()*Eu),Rh);break;case"minute":r=this._d.valueOf(),r-=Au(r,Eu);break;case"second":r=this._d.valueOf(),r-=Au(r,Dh);break}return this._d.setTime(r),Vt.updateOffset(this,!0),this}function OA(t){var r,a;if(t=Ls(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(a=this._isUTC?S9:w9,t){case"year":r=a(this.year()+1,0,1)-1;break;case"quarter":r=a(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":r=a(this.year(),this.month()+1,1)-1;break;case"week":r=a(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":r=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":r=a(this.year(),this.month(),this.date()+1)-1;break;case"hour":r=this._d.valueOf(),r+=Rh-Au(r+(this._isUTC?0:this.utcOffset()*Eu),Rh)-1;break;case"minute":r=this._d.valueOf(),r+=Eu-Au(r,Eu)-1;break;case"second":r=this._d.valueOf(),r+=Dh-Au(r,Dh)-1;break}return this._d.setTime(r),Vt.updateOffset(this,!0),this}function DA(){return this._d.valueOf()-(this._offset||0)*6e4}function RA(){return Math.floor(this.valueOf()/1e3)}function BA(){return new Date(this.valueOf())}function FA(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function qA(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function zA(){return this.isValid()?this.toISOString():null}function HA(){return by(this)}function VA(){return Ko({},Tr(this))}function UA(){return Tr(this).overflow}function $A(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}lr("N",0,0,"eraAbbr");lr("NN",0,0,"eraAbbr");lr("NNN",0,0,"eraAbbr");lr("NNNN",0,0,"eraName");lr("NNNNN",0,0,"eraNarrow");lr("y",["y",1],"yo","eraYear");lr("y",["yy",2],0,"eraYear");lr("y",["yyy",3],0,"eraYear");lr("y",["yyyy",4],0,"eraYear");Xt("N",By);Xt("NN",By);Xt("NNN",By);Xt("NNNN",tT);Xt("NNNNN",rT);on(["N","NN","NNN","NNNN","NNNNN"],function(t,r,a,l){var u=a._locale.erasParse(t,l,a._strict);u?Tr(a).era=u:Tr(a).invalidEra=t});Xt("y",Tu);Xt("yy",Tu);Xt("yyy",Tu);Xt("yyyy",Tu);Xt("yo",nT);on(["y","yy","yyy","yyyy"],Di);on(["yo"],function(t,r,a,l){var u;a._locale._eraYearOrdinalRegex&&(u=t.match(a._locale._eraYearOrdinalRegex)),a._locale.eraYearOrdinalParse?r[Di]=a._locale.eraYearOrdinalParse(t,u):r[Di]=parseInt(t,10)});function WA(t,r){var a,l,u,c=this._eras||Do("en")._eras;for(a=0,l=c.length;a<l;++a){switch(typeof c[a].since){case"string":u=Vt(c[a].since).startOf("day"),c[a].since=u.valueOf();break}switch(typeof c[a].until){case"undefined":c[a].until=1/0;break;case"string":u=Vt(c[a].until).startOf("day").valueOf(),c[a].until=u.valueOf();break}}return c}function GA(t,r,a){var l,u,c=this.eras(),f,p,y;for(t=t.toUpperCase(),l=0,u=c.length;l<u;++l)if(f=c[l].name.toUpperCase(),p=c[l].abbr.toUpperCase(),y=c[l].narrow.toUpperCase(),a)switch(r){case"N":case"NN":case"NNN":if(p===t)return c[l];break;case"NNNN":if(f===t)return c[l];break;case"NNNNN":if(y===t)return c[l];break}else if([f,p,y].indexOf(t)>=0)return c[l]}function YA(t,r){var a=t.since<=t.until?1:-1;return r===void 0?Vt(t.since).year():Vt(t.since).year()+(r-t.offset)*a}function KA(){var t,r,a,l=this.localeData().eras();for(t=0,r=l.length;t<r;++t)if(a=this.clone().startOf("day").valueOf(),l[t].since<=a&&a<=l[t].until||l[t].until<=a&&a<=l[t].since)return l[t].name;return""}function XA(){var t,r,a,l=this.localeData().eras();for(t=0,r=l.length;t<r;++t)if(a=this.clone().startOf("day").valueOf(),l[t].since<=a&&a<=l[t].until||l[t].until<=a&&a<=l[t].since)return l[t].narrow;return""}function QA(){var t,r,a,l=this.localeData().eras();for(t=0,r=l.length;t<r;++t)if(a=this.clone().startOf("day").valueOf(),l[t].since<=a&&a<=l[t].until||l[t].until<=a&&a<=l[t].since)return l[t].abbr;return""}function ZA(){var t,r,a,l,u=this.localeData().eras();for(t=0,r=u.length;t<r;++t)if(a=u[t].since<=u[t].until?1:-1,l=this.clone().startOf("day").valueOf(),u[t].since<=l&&l<=u[t].until||u[t].until<=l&&l<=u[t].since)return(this.year()-Vt(u[t].since).year())*a+u[t].offset;return this.year()}function jA(t){return Yr(this,"_erasNameRegex")||Fy.call(this),t?this._erasNameRegex:this._erasRegex}function JA(t){return Yr(this,"_erasAbbrRegex")||Fy.call(this),t?this._erasAbbrRegex:this._erasRegex}function eT(t){return Yr(this,"_erasNarrowRegex")||Fy.call(this),t?this._erasNarrowRegex:this._erasRegex}function By(t,r){return r.erasAbbrRegex(t)}function tT(t,r){return r.erasNameRegex(t)}function rT(t,r){return r.erasNarrowRegex(t)}function nT(t,r){return r._eraYearOrdinalRegex||Tu}function Fy(){var t=[],r=[],a=[],l=[],u,c,f,p,y,S=this.eras();for(u=0,c=S.length;u<c;++u)f=Io(S[u].name),p=Io(S[u].abbr),y=Io(S[u].narrow),r.push(f),t.push(p),a.push(y),l.push(f),l.push(p),l.push(y);this._erasRegex=new RegExp("^("+l.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+r.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+a.join("|")+")","i")}lr(0,["gg",2],0,function(){return this.weekYear()%100});lr(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Jh(t,r){lr(0,[t,t.length],0,r)}Jh("gggg","weekYear");Jh("ggggg","weekYear");Jh("GGGG","isoWeekYear");Jh("GGGGG","isoWeekYear");Xt("G",Kh);Xt("g",Kh);Xt("GG",Cn,ys);Xt("gg",Cn,ys);Xt("GGGG",ky,xy);Xt("gggg",ky,xy);Xt("GGGGG",Yh,Wh);Xt("ggggg",Yh,Wh);ih(["gggg","ggggg","GGGG","GGGGG"],function(t,r,a,l){r[l.substr(0,2)]=Fr(t)});ih(["gg","GG"],function(t,r,a,l){r[l]=Vt.parseTwoDigitYear(t)});function iT(t){return C9.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function sT(t){return C9.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function aT(){return Po(this.year(),1,4)}function oT(){return Po(this.isoWeekYear(),1,4)}function lT(){var t=this.localeData()._week;return Po(this.year(),t.dow,t.doy)}function uT(){var t=this.localeData()._week;return Po(this.weekYear(),t.dow,t.doy)}function C9(t,r,a,l,u){var c;return t==null?K0(this,l,u).year:(c=Po(t,l,u),r>c&&(r=c),cT.call(this,t,r,a,l,u))}function cT(t,r,a,l,u){var c=r9(t,r,a,l,u),f=Y0(c.year,0,c.dayOfYear);return this.year(f.getUTCFullYear()),this.month(f.getUTCMonth()),this.date(f.getUTCDate()),this}lr("Q",0,"Qo","quarter");Xt("Q",W2);on("Q",function(t,r){r[Eo]=(Fr(t)-1)*3});function hT(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}lr("D",["DD",2],"Do","date");Xt("D",Cn,Iu);Xt("DD",Cn,ys);Xt("Do",function(t,r){return t?r._dayOfMonthOrdinalParse||r._ordinalParse:r._dayOfMonthOrdinalParseLenient});on(["D","DD"],ka);on("Do",function(t,r){r[ka]=Fr(t.match(Cn)[0])});var x9=Pu("Date",!0);lr("DDD",["DDDD",3],"DDDo","dayOfYear");Xt("DDD",Gh);Xt("DDDD",G2);on(["DDD","DDDD"],function(t,r,a){a._dayOfYear=Fr(t)});function fT(t){var r=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?r:this.add(t-r,"d")}lr("m",["mm",2],0,"minute");Xt("m",Cn,My);Xt("mm",Cn,ys);on(["m","mm"],ia);var dT=Pu("Minutes",!1);lr("s",["ss",2],0,"second");Xt("s",Cn,My);Xt("ss",Cn,ys);on(["s","ss"],Ao);var pT=Pu("Seconds",!1);lr("S",0,0,function(){return~~(this.millisecond()/100)});lr(0,["SS",2],0,function(){return~~(this.millisecond()/10)});lr(0,["SSS",3],0,"millisecond");lr(0,["SSSS",4],0,function(){return this.millisecond()*10});lr(0,["SSSSS",5],0,function(){return this.millisecond()*100});lr(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});lr(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});lr(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});lr(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});Xt("S",Gh,W2);Xt("SS",Gh,ys);Xt("SSS",Gh,G2);var Xo,k9;for(Xo="SSSS";Xo.length<=9;Xo+="S")Xt(Xo,Tu);function gT(t,r){r[iu]=Fr(("0."+t)*1e3)}for(Xo="S";Xo.length<=9;Xo+="S")on(Xo,gT);k9=Pu("Milliseconds",!1);lr("z",0,0,"zoneAbbr");lr("zz",0,0,"zoneName");function vT(){return this._isUTC?"UTC":""}function mT(){return this._isUTC?"Coordinated Universal Time":""}var At=rh.prototype;At.add=uA;At.calendar=vA;At.clone=mA;At.diff=xA;At.endOf=OA;At.format=AA;At.from=TA;At.fromNow=IA;At.to=PA;At.toNow=NA;At.get=EM;At.invalidAt=UA;At.isAfter=_A;At.isBefore=bA;At.isBetween=yA;At.isSame=wA;At.isSameOrAfter=SA;At.isSameOrBefore=CA;At.isValid=HA;At.lang=_9;At.locale=m9;At.localeData=b9;At.max=HE;At.min=zE;At.parsingFlags=VA;At.set=AM;At.startOf=LA;At.subtract=cA;At.toArray=FA;At.toObject=qA;At.toDate=BA;At.toISOString=MA;At.inspect=EA;typeof Symbol<"u"&&Symbol.for!=null&&(At[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});At.toJSON=zA;At.toString=kA;At.unix=RA;At.valueOf=DA;At.creationData=$A;At.eraName=KA;At.eraNarrow=XA;At.eraAbbr=QA;At.eraYear=ZA;At.year=X2;At.isLeapYear=MM;At.weekYear=iT;At.isoWeekYear=sT;At.quarter=At.quarters=hT;At.month=e9;At.daysInMonth=BM;At.week=At.weeks=WM;At.isoWeek=At.isoWeeks=GM;At.weeksInYear=lT;At.weeksInWeekYear=uT;At.isoWeeksInYear=aT;At.isoWeeksInISOWeekYear=oT;At.date=x9;At.day=At.days=sE;At.weekday=aE;At.isoWeekday=oE;At.dayOfYear=fT;At.hour=At.hours=pE;At.minute=At.minutes=dT;At.second=At.seconds=pT;At.millisecond=At.milliseconds=k9;At.utcOffset=QE;At.utc=jE;At.local=JE;At.parseZone=eA;At.hasAlignedHourOffset=tA;At.isDST=rA;At.isLocal=iA;At.isUtcOffset=sA;At.isUtc=d9;At.isUTC=d9;At.zoneAbbr=vT;At.zoneName=mT;At.dates=Ns("dates accessor is deprecated. Use date instead.",x9);At.months=Ns("months accessor is deprecated. Use month instead",e9);At.years=Ns("years accessor is deprecated. Use year instead",X2);At.zone=Ns("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ZE);At.isDSTShifted=Ns("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",nA);function _T(t){return Sn(t*1e3)}function bT(){return Sn.apply(null,arguments).parseZone()}function M9(t){return t}var Kr=wy.prototype;Kr.calendar=iM;Kr.longDateFormat=lM;Kr.invalidDate=cM;Kr.ordinal=dM;Kr.preparse=M9;Kr.postformat=M9;Kr.relativeTime=gM;Kr.pastFuture=vM;Kr.set=rM;Kr.eras=WA;Kr.erasParse=GA;Kr.erasConvertYear=YA;Kr.erasAbbrRegex=JA;Kr.erasNameRegex=jA;Kr.erasNarrowRegex=eT;Kr.months=LM;Kr.monthsShort=OM;Kr.monthsParse=RM;Kr.monthsRegex=qM;Kr.monthsShortRegex=FM;Kr.week=HM;Kr.firstDayOfYear=$M;Kr.firstDayOfWeek=UM;Kr.weekdays=eE;Kr.weekdaysMin=rE;Kr.weekdaysShort=tE;Kr.weekdaysParse=iE;Kr.weekdaysRegex=lE;Kr.weekdaysShortRegex=uE;Kr.weekdaysMinRegex=cE;Kr.isPM=fE;Kr.meridiem=gE;function Bh(t,r,a,l){var u=Do(),c=Aa().set(l,r);return u[a](c,t)}function E9(t,r,a){if(Lo(t)&&(r=t,t=void 0),t=t||"",r!=null)return Bh(t,r,a,"month");var l,u=[];for(l=0;l<12;l++)u[l]=Bh(t,l,a,"month");return u}function qy(t,r,a,l){typeof t=="boolean"?(Lo(r)&&(a=r,r=void 0),r=r||""):(r=t,a=r,t=!1,Lo(r)&&(a=r,r=void 0),r=r||"");var u=Do(),c=t?u._week.dow:0,f,p=[];if(a!=null)return Bh(r,(a+c)%7,l,"day");for(f=0;f<7;f++)p[f]=Bh(r,(f+c)%7,l,"day");return p}function yT(t,r){return E9(t,r,"months")}function wT(t,r){return E9(t,r,"monthsShort")}function ST(t,r,a){return qy(t,r,a,"weekdays")}function CT(t,r,a){return qy(t,r,a,"weekdaysShort")}function xT(t,r,a){return qy(t,r,a,"weekdaysMin")}Qo("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var r=t%10,a=Fr(t%100/10)===1?"th":r===1?"st":r===2?"nd":r===3?"rd":"th";return t+a}});Vt.lang=Ns("moment.lang is deprecated. Use moment.locale instead.",Qo);Vt.langData=Ns("moment.langData is deprecated. Use moment.localeData instead.",Do);var Co=Math.abs;function kT(){var t=this._data;return this._milliseconds=Co(this._milliseconds),this._days=Co(this._days),this._months=Co(this._months),t.milliseconds=Co(t.milliseconds),t.seconds=Co(t.seconds),t.minutes=Co(t.minutes),t.hours=Co(t.hours),t.months=Co(t.months),t.years=Co(t.years),this}function A9(t,r,a,l){var u=la(r,a);return t._milliseconds+=l*u._milliseconds,t._days+=l*u._days,t._months+=l*u._months,t._bubble()}function MT(t,r){return A9(this,t,r,1)}function ET(t,r){return A9(this,t,r,-1)}function Rw(t){return t<0?Math.floor(t):Math.ceil(t)}function AT(){var t=this._milliseconds,r=this._days,a=this._months,l=this._data,u,c,f,p,y;return t>=0&&r>=0&&a>=0||t<=0&&r<=0&&a<=0||(t+=Rw(Rb(a)+r)*864e5,r=0,a=0),l.milliseconds=t%1e3,u=Is(t/1e3),l.seconds=u%60,c=Is(u/60),l.minutes=c%60,f=Is(c/60),l.hours=f%24,r+=Is(f/24),y=Is(T9(r)),a+=y,r-=Rw(Rb(y)),p=Is(a/12),a%=12,l.days=r,l.months=a,l.years=p,this}function T9(t){return t*4800/146097}function Rb(t){return t*146097/4800}function TT(t){if(!this.isValid())return NaN;var r,a,l=this._milliseconds;if(t=Ls(t),t==="month"||t==="quarter"||t==="year")switch(r=this._days+l/864e5,a=this._months+T9(r),t){case"month":return a;case"quarter":return a/3;case"year":return a/12}else switch(r=this._days+Math.round(Rb(this._months)),t){case"week":return r/7+l/6048e5;case"day":return r+l/864e5;case"hour":return r*24+l/36e5;case"minute":return r*1440+l/6e4;case"second":return r*86400+l/1e3;case"millisecond":return Math.floor(r*864e5)+l;default:throw new Error("Unknown unit "+t)}}function Ro(t){return function(){return this.as(t)}}var I9=Ro("ms"),IT=Ro("s"),PT=Ro("m"),NT=Ro("h"),LT=Ro("d"),OT=Ro("w"),DT=Ro("M"),RT=Ro("Q"),BT=Ro("y"),FT=I9;function qT(){return la(this)}function zT(t){return t=Ls(t),this.isValid()?this[t+"s"]():NaN}function du(t){return function(){return this.isValid()?this._data[t]:NaN}}var HT=du("milliseconds"),VT=du("seconds"),UT=du("minutes"),$T=du("hours"),WT=du("days"),GT=du("months"),YT=du("years");function KT(){return Is(this.days()/7)}var xo=Math.round,Su={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function XT(t,r,a,l,u){return u.relativeTime(r||1,!!a,t,l)}function QT(t,r,a,l){var u=la(t).abs(),c=xo(u.as("s")),f=xo(u.as("m")),p=xo(u.as("h")),y=xo(u.as("d")),S=xo(u.as("M")),A=xo(u.as("w")),M=xo(u.as("y")),w=c<=a.ss&&["s",c]||c<a.s&&["ss",c]||f<=1&&["m"]||f<a.m&&["mm",f]||p<=1&&["h"]||p<a.h&&["hh",p]||y<=1&&["d"]||y<a.d&&["dd",y];return a.w!=null&&(w=w||A<=1&&["w"]||A<a.w&&["ww",A]),w=w||S<=1&&["M"]||S<a.M&&["MM",S]||M<=1&&["y"]||["yy",M],w[2]=r,w[3]=+t>0,w[4]=l,XT.apply(null,w)}function ZT(t){return t===void 0?xo:typeof t=="function"?(xo=t,!0):!1}function jT(t,r){return Su[t]===void 0?!1:r===void 0?Su[t]:(Su[t]=r,t==="s"&&(Su.ss=r-1),!0)}function JT(t,r){if(!this.isValid())return this.localeData().invalidDate();var a=!1,l=Su,u,c;return typeof t=="object"&&(r=t,t=!1),typeof t=="boolean"&&(a=t),typeof r=="object"&&(l=Object.assign({},Su,r),r.s!=null&&r.ss==null&&(l.ss=r.s-1)),u=this.localeData(),c=QT(this,!a,l,u),a&&(c=u.pastFuture(+this,c)),u.postformat(c)}var xm=Math.abs;function mu(t){return(t>0)-(t<0)||+t}function ef(){if(!this.isValid())return this.localeData().invalidDate();var t=xm(this._milliseconds)/1e3,r=xm(this._days),a=xm(this._months),l,u,c,f,p=this.asSeconds(),y,S,A,M;return p?(l=Is(t/60),u=Is(l/60),t%=60,l%=60,c=Is(a/12),a%=12,f=t?t.toFixed(3).replace(/\.?0+$/,""):"",y=p<0?"-":"",S=mu(this._months)!==mu(p)?"-":"",A=mu(this._days)!==mu(p)?"-":"",M=mu(this._milliseconds)!==mu(p)?"-":"",y+"P"+(c?S+c+"Y":"")+(a?S+a+"M":"")+(r?A+r+"D":"")+(u||l||t?"T":"")+(u?M+u+"H":"")+(l?M+l+"M":"")+(t?M+f+"S":"")):"P0D"}var Vr=jh.prototype;Vr.isValid=GE;Vr.abs=kT;Vr.add=MT;Vr.subtract=ET;Vr.as=TT;Vr.asMilliseconds=I9;Vr.asSeconds=IT;Vr.asMinutes=PT;Vr.asHours=NT;Vr.asDays=LT;Vr.asWeeks=OT;Vr.asMonths=DT;Vr.asQuarters=RT;Vr.asYears=BT;Vr.valueOf=FT;Vr._bubble=AT;Vr.clone=qT;Vr.get=zT;Vr.milliseconds=HT;Vr.seconds=VT;Vr.minutes=UT;Vr.hours=$T;Vr.days=WT;Vr.weeks=KT;Vr.months=GT;Vr.years=YT;Vr.humanize=JT;Vr.toISOString=ef;Vr.toString=ef;Vr.toJSON=ef;Vr.locale=m9;Vr.localeData=b9;Vr.toIsoString=Ns("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ef);Vr.lang=_9;lr("X",0,0,"unix");lr("x",0,0,"valueOf");Xt("x",Kh);Xt("X",yM);on("X",function(t,r,a){a._d=new Date(parseFloat(t)*1e3)});on("x",function(t,r,a){a._d=new Date(Fr(t))});//! moment.js
|
|
139
|
+
Vt.version="2.30.1";eM(Sn);Vt.fn=At;Vt.min=VE;Vt.max=UE;Vt.now=$E;Vt.utc=Aa;Vt.unix=_T;Vt.months=yT;Vt.isDate=th;Vt.locale=Qo;Vt.invalid=$h;Vt.duration=la;Vt.isMoment=aa;Vt.weekdays=ST;Vt.parseZone=bT;Vt.localeData=Do;Vt.isDuration=Ch;Vt.monthsShort=wT;Vt.weekdaysMin=xT;Vt.defineLocale=Py;Vt.updateLocale=bE;Vt.locales=yE;Vt.weekdaysShort=CT;Vt.normalizeUnits=Ls;Vt.relativeTimeRounding=ZT;Vt.relativeTimeThreshold=jT;Vt.calendarFormat=gA;Vt.prototype=At;Vt.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const eI=qr({name:"SyllableSeqVis",props:{seq:{type:Object,required:!0},lastTSsuggestion:{type:Number,required:!1,default:0}},setup(t){const r=Qt(0),a=Qt(0),l=Qt(0),u=Qt(500),c=S=>{console.log(`${JSON.stringify(S)}`)},f=Nr(()=>{const A=t.seq.syllables[t.seq.syllables.length-1].timestamp;return Math.max(1,A,t.lastTSsuggestion)}),p=Nr(()=>{let S=0,A=500;return t.seq.syllables.forEach(M=>{M.notes.forEach(w=>{w.note.number>S&&(S=w.note.number),w.note.number<A&&(A=w.note.number)})}),Math.max(3*(S-A)+10,0)}),y=()=>{try{r.value=t.seq.syllables[0].timestamp;const S=t.seq.syllables[t.seq.syllables.length-1].timestamp,A=r.value+t.lastTSsuggestion;a.value=Math.max(S,A)}catch(S){console.log(`[SyllableSeqVis] Error updating bounds: ${S}`)}t.seq.syllables.forEach(S=>{S.notes.forEach(A=>{A.note.number>l.value&&(l.value=A.note.number),A.note.number<u.value&&(u.value=A.note.number)})})};return oa(()=>{console.log(`SyllableSeqVis created w/ input:
|
|
140
|
+
${t.seq}`),y()}),{firstTS:r,lastTS:a,high:l,low:u,sayNote:c,getLastTS:f,getHeight:p,updateBounds:y}}}),tI=["height"],rI=["cx","cy","alt","fill","stroke","onMouseenter"];function nI(t,r,a,l,u,c){return st(),_t("div",null,[(st(),_t("svg",{width:510,height:Math.max(3*(t.high-t.low)+10,0)},[(st(!0),_t(Gr,null,Ai(t.seq.syllables,f=>(st(),_t(Gr,null,[(st(!0),_t(Gr,null,Ai(f.notes,p=>(st(),_t("circle",{key:f.timestamp+"-"+p.note.number,cx:(f.timestamp-t.firstTS)*500/(t.lastTS-t.firstTS)+4,cy:3*(t.high-p.note.number)+4,alt:p.note.name,r:"3",fill:p.isCorrect?"black":p.isMissing?"none":"red",stroke:p.isMissing?"red":"none",onMouseenter:y=>t.sayNote(p)},null,40,rI))),128))],64))),256))],8,tI))])}const P9=Mn(eI,[["render",nI],["__scopeId","data-v-2f79c080"]]),iI=qr({name:"NoteDisplay",props:{chroma:{type:Number,required:!0}},setup(t){return{style:u=>{let c="#ffffff";return u===t.chroma?c="#1976D2":(u===1||u===3||u===6||u===8||u===10||u===-2)&&(c="#000000"),{fill:c,"fill-opacity":1,stroke:"#000000","stroke-width":.79375,"stroke-miterlimit":4,"stroke-dasharray":"none","stroke-opacity":1}},white:-1,black:-2}}}),sI={id:"svg8",width:"300px",height:"auto","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:cc":"http://creativecommons.org/ns#","xmlns:rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#","xmlns:svg":"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/svg","xmlns:sodipodi":"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd","xmlns:inkscape":"http://www.inkscape.org/namespaces/inkscape","sodipodi:docname":"keys.svg","inkscape:version":"1.0rc1 (09960d6f05, 2020-04-09)",version:"1.1",viewBox:"0 0 175.24936 73.594925"},aI={id:"metadata5"},oI={id:"layer1",transform:"translate(167.75219,-151.96011)","inkscape:groupmode":"layer","inkscape:label":"Layer 1"};function lI(t,r,a,l,u,c){const f=vt("sodipodi:namedview"),p=vt("dc:format"),y=vt("dc:type"),S=vt("dc:title"),A=vt("cc:Work"),M=vt("rdf:RDF");return st(),_t("svg",sI,[r[1]||(r[1]=pt("defs",{id:"defs2"},null,-1)),ft(f,{id:"base","inkscape:window-maximized":"1","inkscape:window-y":"726","inkscape:window-x":"1491","inkscape:window-height":"1321","inkscape:window-width":"2400",showborder:"false",showgrid:"false","inkscape:document-rotation":"0","inkscape:current-layer":"layer1","inkscape:document-units":"mm","inkscape:cy":"255.88343","inkscape:cx":"754.94284","inkscape:zoom":"0.98994949","inkscape:pageshadow":"2","inkscape:pageopacity":"0.0",borderopacity:"1.0",bordercolor:"#666666",pagecolor:"#ffffff"}),pt("metadata",aI,[ft(M,null,{default:St(()=>[ft(A,{"rdf:about":""},{default:St(()=>[ft(p,null,{default:St(()=>r[0]||(r[0]=[Yt("image/svg+xml")])),_:1}),ft(y,{"rdf:resource":"http://purl.org/dc/dcmitype/StillImage"}),ft(S)]),_:1})]),_:1})]),pt("g",oI,[pt("rect",{id:"rect845",y:"152.19064",x:"-150.12129",height:"73.220116",width:"17.486626",style:Hn(t.style(0))},null,4),pt("rect",{id:"rect845-9",style:Hn(t.style(2)),width:"17.486626",height:"73.220116",x:"-132.63466",y:"152.19064"},null,4),pt("rect",{id:"rect845-6",style:Hn(t.style(4)),width:"17.486626",height:"73.220116",x:"-115.14803",y:"152.19064"},null,4),pt("rect",{id:"rect845-4",style:Hn(t.style(5)),width:"17.486626",height:"73.220116",x:"-97.661407",y:"152.19064"},null,4),pt("rect",{id:"rect845-92",style:Hn(t.style(7)),width:"17.486626",height:"73.220116",x:"-80.174782",y:"152.19064"},null,4),pt("rect",{id:"rect845-3",style:Hn(t.style(9)),width:"17.486626",height:"73.220116",x:"-62.688156",y:"152.19064"},null,4),pt("rect",{id:"rect845-0",style:Hn(t.style(11)),width:"17.486626",height:"73.220116",x:"-45.20153",y:"152.19064"},null,4),pt("rect",{id:"rect845-30",style:Hn(t.style(t.white)),width:"17.486626",height:"73.220116",x:"-27.714905",y:"152.10745"},null,4),pt("rect",{id:"rect898",ry:"0",y:"152.10744",x:"-138.43532",height:"54.415863",width:"10.466455",style:Hn(t.style(1))},null,4),pt("rect",{id:"rect898-3",style:Hn(t.style(3)),width:"10.466455",height:"54.415863",x:"-120.84978",y:"152.10744",ry:"0"},null,4),pt("rect",{id:"rect898-7",style:Hn(t.style(6)),width:"10.466455",height:"54.415863",x:"-85.678711",y:"152.10744",ry:"0"},null,4),pt("rect",{id:"rect898-8",style:Hn(t.style(8)),width:"10.466455",height:"54.415863",x:"-68.09317",y:"152.10744",ry:"0"},null,4),pt("rect",{id:"rect898-1",style:Hn(t.style(10)),width:"10.466455",height:"54.415863",x:"-50.507633",y:"152.10744",ry:"0"},null,4),pt("rect",{id:"rect845-30-1",y:"152.10745",x:"-10.228278",height:"73.220116",width:"17.486626",style:Hn(t.style(t.white))},null,4),pt("rect",{id:"rect845-30-9",y:"152.10744",x:"-167.60791",height:"73.220116",width:"17.486626",style:Hn(t.style(t.white))},null,4),pt("rect",{id:"rect898-4",style:Hn(t.style(t.black)),width:"10.466455",height:"54.415863",x:"-15.336554",y:"152.10744",ry:"0"},null,4),pt("rect",{id:"rect898-74",style:Hn(t.style(t.black)),width:"4.4679713",height:"54.415863",x:"-167.60791",y:"152.10744",ry:"0"},null,4),pt("rect",{id:"rect898-10",style:Hn(t.style(t.black)),width:"5.1863246",height:"54.507248",x:"2.2092075",y:"152.06175",ry:"0"},null,4)])])}const uI=Mn(iI,[["render",lI]]),cI=qr({name:"Playback",components:{SyllableSeqVis:P9,NoteDisplay:uI},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"Playback"),l=Wn(a),u=Qt(),c=Qt(!1),f=Qt("notSet"),p=Qt(!1),y=Qt(0),S=Qt(Vt.utc()),A=Qt(0),M=Qt(0),w=Qt(rs([])),_=Qt(!1),C=Qt(rs([])),m=Qt(0),T=Qt(""),L=Qt(0),N=Qt(0),B=Qt(),W=Qt();l.question.value=new Fb(t.data);const G=Nr(()=>new Fb(t.data)),R=Nr(()=>rs(G.value.midi).syllables[0].notes.length>1?"Lowest note of first chord:":"First note:"),ye=Nr(()=>c.value?rs(G.value.midi).rootNote.number%12:0),q=()=>{var K,Q,le;f.value?f.value!==((K=u.value)==null?void 0:K.state)&&(c.value=!1,f.value=((Q=u.value)==null?void 0:Q.state)||"notSet",c.value=!0):(f.value=((le=u.value)==null?void 0:le.state)||"notSet",c.value=!0),a.logger.log(`Playback is running init with state: ${f.value}`),f.value==="ready"&&(A.value=G.value.duration,he())},se=()=>{try{B.value&&(B.value.style.animationName="",requestAnimationFrame(()=>{requestAnimationFrame(()=>{B.value&&(B.value.style.animationDuration=A.value+"ms",B.value.style.animationName="progress")})}))}catch{setTimeout(se,50)}},ve=()=>{var K,Q,le;(K=u.value)==null||K.record(),p.value=!0,(Q=u.value)==null||Q.addNoteonListenter(Ee=>{var Me;L.value++,C.value.append(Ee),(Me=W.value)==null||Me.updateBounds(),L.value+N.value>=G.value.midi.length&&ce()}),(le=u.value)==null||le.addNoteoffListenter(()=>{N.value++,L.value+N.value>=G.value.midi.length&&ce()})},he=()=>{var K,Q,le;(K=u.value)==null||K.stopRecording(),(Q=u.value)==null||Q.eraseRecording(),S.value=Vt.utc(),L.value=0,N.value=0,p.value=!1,y.value=0,se(),(le=u.value)==null||le.play(G.value.midi),setTimeout(()=>{a.logger.log("done playback..."),ve()},G.value.lastNoteOnTimestamp)},ce=()=>{var K;if(!((K=u.value)!=null&&K.recording))return!1;const Q=rs(G.value.midi),le=rs(u.value.recording);return w.value=Q.grade(le),C.value=rs([]),l.submitAnswer(u.value.recording).isCorrect?!0:(M.value++,_.value=!0,M.value<l.maxAttemptsPerView.value&&he(),!1)},de=()=>{L.value>0?ce():he()};return oa(async()=>{try{u.value=await my.instance(),u.value.setStateChangeListener(()=>{q()}),c.value=!0}catch(K){Vn({status:Jt.error,text:"Midi device not supported"}),T.value=JSON.stringify(K),f.value="notsupported",c.value=!0}q(),yu.addBinding([{hotkey:"space",callback:de,command:"Clear attempt or play again"}])}),A4(()=>{yu.removeBinding("space")}),{...a,...l,initialized:c,state:f,recording:p,inputSeq:C,lastTSsuggestion:m,gradedSeq:w,graded:_,promptText:R,firstNoteChroma:ye,progressBar:B,inputVisRef:W,clearAttempt:de,notesOn:L}}}),hI={key:0,"data-viewable":"Playback"},fI={key:0},dI={class:"text-h4"},pI={class:"text-h5"},gI={key:0},vI={class:"progressContainer"},mI={id:"progress",ref:"progressBar"},_I={key:1},bI={key:2};function yI(t,r,a,l,u,c){const f=vt("note-display"),p=vt("v-icon"),y=vt("v-btn"),S=vt("syllable-seq-vis");return t.initialized?(st(),_t("div",hI,[t.state==="ready"?(st(),_t("div",fI,[pt("div",dI,[Yt(ir(t.promptText)+" ",1),ft(f,{chroma:t.firstNoteChroma},null,8,["chroma"])]),pt("div",pI,[r[0]||(r[0]=Yt("Listen...")),t.recording?(st(),_t("span",gI," and Repeat")):br("",!0)]),pt("div",vI,[pt("div",mI,null,512)]),ft(y,{color:"primary",autofocus:"",onClick:t.clearAttempt},{default:St(()=>[r[2]||(r[2]=Yt(" Play again ")),ft(p,{end:""},{default:St(()=>r[1]||(r[1]=[Yt("volume_up")])),_:1})]),_:1},8,["onClick"]),(st(),Rr(S,{key:0,ref:"inputVisRef",seq:t.inputSeq,"last-t-ssuggestion":t.lastTSsuggestion},null,8,["seq","last-t-ssuggestion"])),t.graded?(st(),Rr(S,{key:1,seq:t.gradedSeq},null,8,["seq"])):br("",!0)])):t.state==="nodevice"?(st(),_t("div",_I,"No midi device detected. Please attach one!")):t.state==="notsupported"?(st(),_t("div",bI,r[3]||(r[3]=[pt("p",null,"This exercise requires a midi input device, which is not supported by this browser ☹",-1),pt("div",null,[pt("p",null,"Please try again with one of the following browsers:"),pt("ul",null,[pt("li",null,[pt("a",{href:"https://www.google.com/chrome/"},"Google Chrome")]),pt("li",null,[pt("a",{href:"https://www.microsoft.com/edge"},"Microsoft Edge")]),pt("li",null,[pt("a",{href:"https://brave.com/"},"Brave")])])],-1)]))):br("",!0)])):br("",!0)}const wI=Mn(cI,[["render",yI]]),SI=[{name:"Melody",type:pr.MIDI}],zy=class Bb extends pi{constructor(r){super(r),lt(this,"midi"),this.midi=r[0].Melody}get duration(){return this.midi.reduce((r,a)=>a.timestamp>r.timestamp?a:r).timestamp}get lastNoteOnTimestamp(){return this.midi.filter(r=>r.type==="noteon").reduce((r,a)=>a.timestamp>r.timestamp?a:r).timestamp}isCorrect(r){const a=rs(this.midi),l=rs(r);try{return a.grade(l).isCorrect()}catch(u){return console.log("ERROR grading this midi sequence!",u),!1}}dataShapes(){return Bb.dataShapes}views(){return Bb.views}};lt(zy,"dataShapes",[{fields:SI,name:di.PIANO_Echo}]);lt(zy,"views",[wI]);let Fb=zy;const CI=qr({name:"NotePlayback",components:{},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"NotePlayback"),l=Wn(a),u=Qt(),c=Qt(!1),f=Qt(!1),p=Qt(0),y=Qt(Vt.utc()),S=Qt(0),A=Qt(rs([])),M=Qt(!1),w=Qt(rs([])),_=Qt("");l.question.value=new zb(t.data);const C=Nr(()=>new zb(t.data)),m=()=>{var N,B,W;(N=u.value)==null||N.record(),f.value=!0,(B=u.value)==null||B.addNoteonListenter(G=>{w.value.append(G)}),(W=u.value)==null||W.addNoteoffListenter(()=>{var G,R,ye,q;(R=(G=u.value)==null?void 0:G.recording)!=null&&R.length&&((q=(ye=u.value)==null?void 0:ye.recording)==null?void 0:q.length)>=2&&L()})},T=()=>{var N,B;(N=u.value)==null||N.stopRecording(),(B=u.value)==null||B.eraseRecording(),y.value=Vt.utc(),f.value=!1,p.value=0,m()},L=()=>{var N;return(N=u.value)!=null&&N.recording?(w.value=rs([]),l.submitAnswer(u.value.recording).isCorrect?!0:(S.value++,M.value=!0,S.value<l.maxAttemptsPerView.value&&T(),!1)):!1};return oa(async()=>{try{u.value=await my.instance(),_.value=C.value.note,T(),c.value=!0}catch(N){a.logger.error("Failed to initialize MIDI:",N)}}),{...a,...l,initialized:c,recording:f,inputSeq:w,gradedSeq:A,graded:M,note:_,attempts:S}}}),xI={"data-viewable":"NotePlayback"},kI={class:"text-h4"},MI={class:"font-weight-bold"},EI={key:0,id:"svg8",width:"300px",height:"auto","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:cc":"http://creativecommons.org/ns#","xmlns:rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#","xmlns:svg":"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/svg","xmlns:sodipodi":"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd","xmlns:inkscape":"http://www.inkscape.org/namespaces/inkscape","sodipodi:docname":"keys.svg","inkscape:version":"1.0rc1 (09960d6f05, 2020-04-09)",version:"1.1",viewBox:"0 0 175.24936 73.594925"},AI={id:"metadata5"};function TI(t,r,a,l,u,c){const f=vt("sodipodi:namedview"),p=vt("dc:format"),y=vt("dc:type"),S=vt("dc:title"),A=vt("cc:Work"),M=vt("rdf:RDF");return st(),_t("div",xI,[pt("div",kI,[r[0]||(r[0]=Yt(" Play the note: ")),pt("span",MI,ir(t.note),1)]),t.graded?(st(),_t("svg",EI,[r[2]||(r[2]=pt("defs",{id:"defs2"},null,-1)),ft(f,{id:"base","inkscape:window-maximized":"1","inkscape:window-y":"726","inkscape:window-x":"1491","inkscape:window-height":"1321","inkscape:window-width":"2400",showborder:"false",showgrid:"false","inkscape:document-rotation":"0","inkscape:current-layer":"layer1","inkscape:document-units":"mm","inkscape:cy":"255.88343","inkscape:cx":"754.94284","inkscape:zoom":"0.98994949","inkscape:pageshadow":"2","inkscape:pageopacity":"0.0",borderopacity:"1.0",bordercolor:"#666666",pagecolor:"#ffffff"}),pt("metadata",AI,[ft(M,null,{default:St(()=>[ft(A,{"rdf:about":""},{default:St(()=>[ft(p,null,{default:St(()=>r[1]||(r[1]=[Yt("image/svg+xml")])),_:1}),ft(y,{"rdf:resource":"http://purl.org/dc/dcmitype/StillImage"}),ft(S)]),_:1})]),_:1})]),r[3]||(r[3]=pt("g",{id:"layer1",transform:"translate(167.75219,-151.96011)","inkscape:groupmode":"layer","inkscape:label":"Layer 1"},[pt("rect",{id:"rect845",y:"152.19064",x:"-150.12129",height:"73.220116",width:"17.486626",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"}}),pt("rect",{id:"rect845-9",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"17.486626",height:"73.220116",x:"-132.63466",y:"152.19064"}),pt("rect",{id:"rect845-6",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"17.486626",height:"73.220116",x:"-115.14803",y:"152.19064"}),pt("rect",{id:"rect845-0",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"17.486626",height:"73.220116",x:"-45.20153",y:"152.19064"}),pt("rect",{id:"rect845-92",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"17.486626",height:"73.220116",x:"-80.174782",y:"152.19064"}),pt("rect",{id:"rect845-3",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"17.486626",height:"73.220116",x:"-62.688156",y:"152.19064"}),pt("rect",{id:"rect845-4",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"17.486626",height:"73.220116",x:"-97.661407",y:"152.19064"}),pt("rect",{id:"rect845-30",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"17.486626",height:"73.220116",x:"-27.714905",y:"152.10745"}),pt("rect",{id:"rect898",ry:"0",y:"152.10744",x:"-138.43532",height:"54.415863",width:"10.466455",style:{fill:"#000000","fill-opacity":"1",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"}}),pt("rect",{id:"rect898-3",style:{fill:"#000000","fill-opacity":"1",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"10.466455",height:"54.415863",x:"-120.84978",y:"152.10744",ry:"0"}),pt("rect",{id:"rect898-7",style:{fill:"#000000","fill-opacity":"1",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"10.466455",height:"54.415863",x:"-85.678711",y:"152.10744",ry:"0"}),pt("rect",{id:"rect898-8",style:{fill:"#000000","fill-opacity":"1",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"10.466455",height:"54.415863",x:"-68.09317",y:"152.10744",ry:"0"}),pt("rect",{id:"rect898-1",style:{fill:"#000000","fill-opacity":"1",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"10.466455",height:"54.415863",x:"-50.507633",y:"152.10744",ry:"0"}),pt("rect",{id:"rect845-30-1",y:"152.10745",x:"-10.228278",height:"73.220116",width:"17.486626",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"}}),pt("rect",{id:"rect845-30-9",y:"152.10744",x:"-167.60791",height:"73.220116",width:"17.486626",style:{fill:"#ffffff","fill-opacity":"0",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"}}),pt("rect",{id:"rect898-4",style:{fill:"#000000","fill-opacity":"1",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"10.466455",height:"54.415863",x:"-15.336554",y:"152.10744",ry:"0"}),pt("rect",{id:"rect898-74",style:{fill:"#000000","fill-opacity":"1",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"4.4679713",height:"54.415863",x:"-167.60791",y:"152.10744",ry:"0"}),pt("rect",{id:"rect898-10",style:{fill:"#000000","fill-opacity":"1",stroke:"#000000","stroke-width":"0.79375","stroke-miterlimit":"4","stroke-dasharray":"none","stroke-opacity":"1"},width:"5.1863246",height:"54.507248",x:"2.2092075",y:"152.06175",ry:"0"})],-1))])):br("",!0)])}const II=Mn(CI,[["render",TI]]),PI=[{name:"Note",type:pr.STRING}],NI=["A","B","C","D","E","F","G","A♯","C♯","D♯","F♯","G♯","D♭","E♭","G♭","A♭","B♭"],tf=class qb extends pi{constructor(r){super(r),lt(this,"note"),this.note=r[0].Note}isCorrect(r){return r[0].note.name===this.note}dataShapes(){return qb.dataShapes}views(){return qb.views}};lt(tf,"dataShapes",[{fields:PI,name:di.PIANO_PlayNote}]);lt(tf,"seedData",NI.map(t=>({Note:t})));lt(tf,"views",[II]);let zb=tf;const LI=new Oo("piano",[Fb,zb]),OI=qr({name:"IdentifyChroma",components:{RadioMultipleChoice:zh},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"IdentifyChroma"),l=Wn(a),u=Qt(""),c=Qt(new AudioContext);l.question.value=new L9(t.data);const f=Nr(()=>l.question.value),p=A=>{const M=[];let w=A/2;for(;w>100;)M.push(w),w/=2;M.push(A);let _=A*2;for(;_<5e3;)M.push(_),_*=2;return M},y=A=>{const M=c.value.createOscillator();M.type="sine",M.frequency.value=A;const w=c.value.createGain();console.log("Max Gain: "+w.gain.maxValue),w.gain.setValueAtTime(0,0),w.gain.linearRampToValueAtTime(.5,15),M.connect(w),w.connect(c.value.destination),M.start(0),M.stop(14)};return oa(()=>{p(295).forEach(A=>y(A))}),{...a,...l,answer:u,question:f,submit:()=>{f.value&&f.value.isCorrect(u.value)}}}}),DI={"data-viewable":"IdentifyChroma"};function RI(t,r,a,l,u,c){const f=vt("radio-multiple-choice");return st(),_t("div",DI,[t.question?(st(),_t(Gr,{key:0},[r[0]||(r[0]=Yt(" What note is being played? ")),ft(f,{"choice-list":t.question.choiceList},null,8,["choice-list"])],64)):br("",!0)])}const BI=Mn(OI,[["render",RI]]);var N9=(t=>(t.A="A",t.B="B",t.C="C",t.D="D",t.E="E",t.F="F",t.G="G",t))(N9||{});const FI=[{name:"Chroma",type:pr.STRING,validator:{test:t=>Object.values(N9).includes(t)?{status:Jt.ok,msg:""}:{status:Jt.error,msg:"That's not a chroma!"},instructions:"Enter a valid musical note (A-G)"}}],Hy=class Hb extends pi{constructor(r){super(r),lt(this,"chroma"),this.chroma=r[0].Chroma}get baseFreq(){return this.chroma==="A"?440:this.chroma==="B"?440*Math.pow(2,2/12):this.chroma==="C"?440*Math.pow(2,3/12):440}get choiceList(){return Cu.shuffle([this.chroma.toString(),"test","options","are","fun"])}isCorrect(r){return r.choiceList[r.selection]===this.chroma.toString()}dataShapes(){return Hb.dataShapes}views(){return Hb.views}};lt(Hy,"dataShapes",[{fields:FI,name:di.PITCH_chroma}]);lt(Hy,"views",[BI]);let L9=Hy;const qI=new Oo("pitch",[L9]);var km,Bw;function zI(){if(Bw)return km;Bw=1;var t="6.4.4";return km=t,km}var Mm,Fw;function Vy(){if(Fw)return Mm;Fw=1;var t=function(a,l){var u=this;if(l||(l={}),u.qpm=l.qpm?parseInt(l.qpm,10):null,!u.qpm){var c=a.metaText?a.metaText.tempo:null;u.qpm=a.getBpm(c)}u.extraMeasuresAtBeginning=l.extraMeasuresAtBeginning?parseInt(l.extraMeasuresAtBeginning,10):0,u.beatCallback=l.beatCallback,u.eventCallback=l.eventCallback,u.lineEndCallback=l.lineEndCallback,u.lineEndAnticipation=l.lineEndAnticipation?parseInt(l.lineEndAnticipation,10):0,u.beatSubdivisions=l.beatSubdivisions?parseInt(l.beatSubdivisions,10):1,u.joggerTimer=null,u.replaceTarget=function(p){u.noteTimings=p.setTiming(u.qpm,u.extraMeasuresAtBeginning),p.noteTimings.length===0&&(u.noteTimings=p.setTiming(0,0)),u.lineEndCallback&&(u.lineEndTimings=r(p.noteTimings,u.lineEndAnticipation)),u.startTime=null,u.currentBeat=0,u.currentEvent=0,u.currentLine=0,u.currentTime=0,u.isPaused=!1,u.isRunning=!1,u.pausedPercent=null,u.justUnpaused=!1,u.newSeekPercent=0,u.lastTimestamp=0,u.noteTimings.length!==0&&(u.millisecondsPerBeat=1e3/(u.qpm/60)/u.beatSubdivisions,u.lastMoment=u.noteTimings[u.noteTimings.length-1].milliseconds,u.totalBeats=Math.round(u.lastMoment/u.millisecondsPerBeat))},u.replaceTarget(a),u.doTiming=function(p){if(u.lastTimestamp!==p&&(u.lastTimestamp=p,u.startTime||(u.startTime=p),!u.isPaused&&u.isRunning)){for(u.currentTime=p-u.startTime,u.currentTime+=16;u.noteTimings.length>u.currentEvent&&u.noteTimings[u.currentEvent].milliseconds<u.currentTime;){if(u.eventCallback&&u.noteTimings[u.currentEvent].type==="event"){var y=u.startTime;u.eventCallback(u.noteTimings[u.currentEvent]),y!==u.startTime&&(u.currentTime=p-u.startTime)}u.currentEvent++}if(u.lineEndCallback&&u.lineEndTimings.length>u.currentLine&&u.lineEndTimings[u.currentLine].milliseconds<u.currentTime&&u.currentEvent<u.noteTimings.length){var S=u.noteTimings[u.currentEvent].milliseconds===u.currentTime?u.noteTimings[u.currentEvent]:u.noteTimings[u.currentEvent-1];u.lineEndCallback(u.lineEndTimings[u.currentLine],S,{line:u.currentLine,endTimings:u.lineEndTimings,currentTime:u.currentTime}),u.currentLine++}if(u.currentTime<u.lastMoment){if(requestAnimationFrame(u.doTiming),u.currentBeat*u.millisecondsPerBeat<u.currentTime){var A=u.doBeatCallback(p);A!==null&&(u.currentTime=A)}}else if(u.currentBeat<=u.totalBeats&&u.beatCallback){var M=u.doBeatCallback(p);M!==null&&(u.currentTime=M),requestAnimationFrame(u.doTiming)}if(u.currentTime>=u.lastMoment)if(u.eventCallback){var w=u.eventCallback(null);u.shouldStop(w).then(function(_){_&&u.stop()})}else u.stop()}},u.shouldStop=function(p){return new Promise(function(y){if(!p)return y(!0);if(p==="continue")return y(!1);p.then&&p.then(function(S){y(S!=="continue")})})},u.doBeatCallback=function(p){if(u.beatCallback){for(var y=u.currentEvent;y<u.noteTimings.length&&u.noteTimings[y].left===null;)y++;var S,A;if(y<u.noteTimings.length){for(S=u.noteTimings[y].milliseconds,y=Math.max(0,u.currentEvent-1);y>=0&&u.noteTimings[y].left===null;)y--;A=u.noteTimings[y]}var M={},w={};if(A){M.top=A.top,M.height=A.height;var _=Math.max(0,p-u.startTime-A.milliseconds),C=S-A.milliseconds,m=A.endX-A.left,T=C?_*m/C:0;M.left=A.left+T,u.currentEvent===0&&A.milliseconds>p-u.startTime&&(M.left=void 0),w={timestamp:p,startTime:u.startTime,ev:A,endMs:S,offMs:_,offPx:T,gapMs:C,gapPx:m}}else w={timestamp:p,startTime:u.startTime};var L=u.startTime;if(u.beatCallback(u.currentBeat/u.beatSubdivisions,u.totalBeats/u.beatSubdivisions,u.lastMoment,M,w),L!==u.startTime)return p-u.startTime;u.currentBeat++}return null};var f=60;u.animationJogger=function(){u.isRunning&&(u.doTiming(performance.now()),u.joggerTimer=setTimeout(u.animationJogger,f))},u.start=function(p,y){if(u.isRunning=!0,u.isPaused&&(u.isPaused=!1,p===void 0&&(u.justUnpaused=!0)),p)u.setProgress(p,y);else if(p===0)u.reset();else if(u.pausedPercent!==null){var S=performance.now();u.currentTime=u.lastMoment*u.pausedPercent,u.startTime=S-u.currentTime,u.pausedPercent=null,u.reportNext=!0}requestAnimationFrame(u.doTiming),u.joggerTimer=setTimeout(u.animationJogger,f)},u.pause=function(){u.isPaused=!0;var p=performance.now();u.pausedPercent=(p-u.startTime)/u.lastMoment,u.isRunning=!1,u.joggerTimer&&(clearTimeout(u.joggerTimer),u.joggerTimer=null)},u.currentMillisecond=function(){return u.currentTime},u.reset=function(){u.currentBeat=0,u.currentEvent=0,u.currentLine=0,u.startTime=null,u.pausedPercent=null},u.stop=function(){u.pause(),u.reset()},u.setProgress=function(p,y){var S;switch(y){case"seconds":u.currentTime=p*1e3,u.currentTime<0&&(u.currentTime=0),u.currentTime>u.lastMoment&&(u.currentTime=u.lastMoment),S=u.currentTime/u.lastMoment;break;case"beats":u.currentTime=p*u.millisecondsPerBeat*u.beatSubdivisions,u.currentTime<0&&(u.currentTime=0),u.currentTime>u.lastMoment&&(u.currentTime=u.lastMoment),S=u.currentTime/u.lastMoment;break;default:S=p,S<0&&(S=0),S>1&&(S=1),u.currentTime=u.lastMoment*S;break}u.isRunning||(u.pausedPercent=S);var A=performance.now();for(u.startTime=A-u.currentTime,u.currentEvent,u.currentEvent=0;u.noteTimings.length>u.currentEvent&&u.noteTimings[u.currentEvent].milliseconds<u.currentTime;)u.currentEvent++;if(u.lineEndCallback)for(u.currentLine=0;u.lineEndTimings.length>u.currentLine&&u.lineEndTimings[u.currentLine].milliseconds+u.lineEndAnticipation<u.currentTime;)u.currentLine++;var M=u.currentBeat;u.currentBeat=Math.floor(u.currentTime/u.millisecondsPerBeat),u.beatCallback&&M!==u.currentBeat&&u.doBeatCallback(u.startTime+u.currentTime),u.eventCallback&&u.currentEvent>=0&&u.noteTimings[u.currentEvent].type==="event"&&u.eventCallback(u.noteTimings[u.currentEvent]),u.lineEndCallback&&u.lineEndCallback(u.lineEndTimings[u.currentLine],u.noteTimings[u.currentEvent],{line:u.currentLine,endTimings:u.lineEndTimings}),u.joggerTimer=setTimeout(u.animationJogger,f)}};function r(a,l){for(var u=[],c=null,f=0;f<a.length;f++){var p=a[f];p.type!=="end"&&p.top!==c&&(u.push({measureNumber:p.measureNumber,milliseconds:p.milliseconds-l,top:p.top,bottom:p.top+p.height}),c=p.top)}return u}return Mm=t,Mm}var Em,qw;function HI(){if(qw)return Em;qw=1;var t=Vy(),r={};return function(){var a,l;r.startAnimation=function(u,c,f){a&&(a.stop(),a=void 0),f.showCursor&&(l=u.querySelector(".abcjs-cursor"),l||(l=document.createElement("DIV"),l.className="abcjs-cursor cursor",l.style.position="absolute",u.appendChild(l),u.style.position="relative"));function p(C){for(var m=0;m<C.length;m++){var T=C[m];T.classList.contains("abcjs-bar")||(T.style.display="none")}}var y;function S(C){if(y){var m=u.querySelectorAll(y);p(m)}y=C}function A(C){var m=u.querySelectorAll(C);p(m)}function M(C){f.hideCurrentMeasure?A(C):f.hideFinishedMeasures&&S(C)}function w(C){return".abcjs-l"+C.line+".abcjs-m"+C.measureNumber}function _(C){if(C){if(C.measureStart){var m=w(C);m&&M(m)}l&&(l.style.left=C.left+"px",l.style.top=C.top+"px",l.style.width=C.width+"px",l.style.height=C.height+"px")}else a.stop(),a=void 0}a=new t(c,{qpm:f.bpm,eventCallback:_}),a.start()},r.pauseAnimation=function(u){a&&(u?a.pause():a.start())},r.stopAnimation=function(){a&&(a.stop(),a=void 0)}}(),Em=r,Em}var Am,zw;function Bo(){if(zw)return Am;zw=1;var t={};return t.cloneArray=function(r){for(var a=[],l=0;l<r.length;l++)a.push(Object.assign({},r[l]));return a},t.cloneHashOfHash=function(r){var a={};for(var l in r)r.hasOwnProperty(l)&&(a[l]=Object.assign({},r[l]));return a},t.cloneHashOfArrayOfHash=function(r){var a={};for(var l in r)r.hasOwnProperty(l)&&(a[l]=t.cloneArray(r[l]));return a},t.strip=function(r){return r.replace(/^\s+/,"").replace(/\s+$/,"")},t.startsWith=function(r,a){return r.indexOf(a)===0},t.endsWith=function(r,a){var l=r.length-a.length;return l>=0&&r.lastIndexOf(a)===l},t.last=function(r){return r.length===0?null:r[r.length-1]},Am=t,Am}var Tm,Hw;function Uy(){if(Hw)return Tm;Hw=1;var t=Bo(),r={};return function(){var a,l,u,c,f;r.initialize=function(H,Y,X,xe,De){a=H,l=Y,u=X,c=xe,f=De,p()};function p(){u.annotationfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},u.gchordfont={face:"Helvetica",size:12,weight:"normal",style:"normal",decoration:"none"},u.historyfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},u.infofont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},u.measurefont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},u.partsfont={face:'"Times New Roman"',size:15,weight:"normal",style:"normal",decoration:"none"},u.repeatfont={face:'"Times New Roman"',size:13,weight:"normal",style:"normal",decoration:"none"},u.textfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},u.tripletfont={face:"Times",size:11,weight:"normal",style:"italic",decoration:"none"},u.vocalfont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},u.wordsfont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},c.formatting.composerfont={face:'"Times New Roman"',size:14,weight:"normal",style:"italic",decoration:"none"},c.formatting.subtitlefont={face:'"Times New Roman"',size:16,weight:"normal",style:"normal",decoration:"none"},c.formatting.tempofont={face:'"Times New Roman"',size:15,weight:"bold",style:"normal",decoration:"none"},c.formatting.titlefont={face:'"Times New Roman"',size:20,weight:"normal",style:"normal",decoration:"none"},c.formatting.footerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},c.formatting.headerfont={face:'"Times New Roman"',size:12,weight:"normal",style:"normal",decoration:"none"},c.formatting.voicefont={face:'"Times New Roman"',size:13,weight:"bold",style:"normal",decoration:"none"},c.formatting.tablabelfont={face:'"Trebuchet MS"',size:16,weight:"normal",style:"normal",decoration:"none"},c.formatting.tabnumberfont={face:'"Arial"',size:11,weight:"normal",style:"normal",decoration:"none"},c.formatting.tabgracefont={face:'"Arial"',size:8,weight:"normal",style:"normal",decoration:"none"},c.formatting.annotationfont=u.annotationfont,c.formatting.gchordfont=u.gchordfont,c.formatting.historyfont=u.historyfont,c.formatting.infofont=u.infofont,c.formatting.measurefont=u.measurefont,c.formatting.partsfont=u.partsfont,c.formatting.repeatfont=u.repeatfont,c.formatting.textfont=u.textfont,c.formatting.tripletfont=u.tripletfont,c.formatting.vocalfont=u.vocalfont,c.formatting.wordsfont=u.wordsfont}var y={gchordfont:!0,measurefont:!0,partsfont:!0,annotationfont:!0,composerfont:!0,historyfont:!0,infofont:!0,subtitlefont:!0,textfont:!0,titlefont:!0,voicefont:!0},S=function(H){switch(H){case"Arial-Italic":return{face:"Arial",weight:"normal",style:"italic",decoration:"none"};case"Arial-Bold":return{face:"Arial",weight:"bold",style:"normal",decoration:"none"};case"Bookman-Demi":return{face:"Bookman,serif",weight:"bold",style:"normal",decoration:"none"};case"Bookman-DemiItalic":return{face:"Bookman,serif",weight:"bold",style:"italic",decoration:"none"};case"Bookman-Light":return{face:"Bookman,serif",weight:"normal",style:"normal",decoration:"none"};case"Bookman-LightItalic":return{face:"Bookman,serif",weight:"normal",style:"italic",decoration:"none"};case"Courier":return{face:'"Courier New"',weight:"normal",style:"normal",decoration:"none"};case"Courier-Oblique":return{face:'"Courier New"',weight:"normal",style:"italic",decoration:"none"};case"Courier-Bold":return{face:'"Courier New"',weight:"bold",style:"normal",decoration:"none"};case"Courier-BoldOblique":return{face:'"Courier New"',weight:"bold",style:"italic",decoration:"none"};case"AvantGarde-Book":return{face:"AvantGarde,Arial",weight:"normal",style:"normal",decoration:"none"};case"AvantGarde-BookOblique":return{face:"AvantGarde,Arial",weight:"normal",style:"italic",decoration:"none"};case"AvantGarde-Demi":case"Avant-Garde-Demi":return{face:"AvantGarde,Arial",weight:"bold",style:"normal",decoration:"none"};case"AvantGarde-DemiOblique":return{face:"AvantGarde,Arial",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Oblique":return{face:"Helvetica",weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Bold":return{face:"Helvetica",weight:"bold",style:"normal",decoration:"none"};case"Helvetica-BoldOblique":return{face:"Helvetica",weight:"bold",style:"italic",decoration:"none"};case"Helvetica-Narrow":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"normal",decoration:"none"};case"Helvetica-Narrow-Oblique":return{face:'"Helvetica Narrow",Helvetica',weight:"normal",style:"italic",decoration:"none"};case"Helvetica-Narrow-Bold":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"normal",decoration:"none"};case"Helvetica-Narrow-BoldOblique":return{face:'"Helvetica Narrow",Helvetica',weight:"bold",style:"italic",decoration:"none"};case"Palatino-Roman":return{face:"Palatino",weight:"normal",style:"normal",decoration:"none"};case"Palatino-Italic":return{face:"Palatino",weight:"normal",style:"italic",decoration:"none"};case"Palatino-Bold":return{face:"Palatino",weight:"bold",style:"normal",decoration:"none"};case"Palatino-BoldItalic":return{face:"Palatino",weight:"bold",style:"italic",decoration:"none"};case"NewCenturySchlbk-Roman":return{face:'"New Century",serif',weight:"normal",style:"normal",decoration:"none"};case"NewCenturySchlbk-Italic":return{face:'"New Century",serif',weight:"normal",style:"italic",decoration:"none"};case"NewCenturySchlbk-Bold":return{face:'"New Century",serif',weight:"bold",style:"normal",decoration:"none"};case"NewCenturySchlbk-BoldItalic":return{face:'"New Century",serif',weight:"bold",style:"italic",decoration:"none"};case"Times":case"Times-Roman":case"Times-Narrow":case"Times-Courier":case"Times-New-Roman":return{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none"};case"Times-Italic":case"Times-Italics":return{face:'"Times New Roman"',weight:"normal",style:"italic",decoration:"none"};case"Times-Bold":return{face:'"Times New Roman"',weight:"bold",style:"normal",decoration:"none"};case"Times-BoldItalic":return{face:'"Times New Roman"',weight:"bold",style:"italic",decoration:"none"};case"ZapfChancery-MediumItalic":return{face:'"Zapf Chancery",cursive,serif',weight:"normal",style:"normal",decoration:"none"};default:return null}},A=function(H,Y,X,xe,De){function $e(){var er=parseInt(H[0].token);return H.shift(),Y?H.length===0?{face:Y.face,weight:Y.weight,style:Y.style,decoration:Y.decoration,size:er}:H.length===1&&H[0].token==="box"&&y[De]?{face:Y.face,weight:Y.weight,style:Y.style,decoration:Y.decoration,size:er,box:!0}:(l("Extra parameters in font definition.",X,xe),{face:Y.face,weight:Y.weight,style:Y.style,decoration:Y.decoration,size:er}):(l("Can't set just the size of the font since there is no default value.",X,xe),{face:'"Times New Roman"',weight:"normal",style:"normal",decoration:"none",size:er})}if(H[0].token==="*"){if(H.shift(),H[0].type==="number")return $e();l("Expected font size number after *.",X,xe)}if(H[0].type==="number")return $e();for(var Re=[],ut,Lt="normal",it="normal",Ct="none",It=!1,at="face",Gt=!1;H.length;){var Dt=H.shift(),ct=Dt.token.toLowerCase();switch(at){case"face":Gt||ct!=="utf"&&Dt.type!=="number"&&ct!=="bold"&&ct!=="italic"&&ct!=="underline"&&ct!=="box"?Re.length>0&&Dt.token==="-"?(Gt=!0,Re[Re.length-1]=Re[Re.length-1]+Dt.token):Gt?(Gt=!1,Re[Re.length-1]=Re[Re.length-1]+Dt.token):Re.push(Dt.token):Dt.type==="number"?(ut?l("Font size specified twice in font definition.",X,xe):ut=Dt.token,at="modifier"):ct==="bold"?Lt="bold":ct==="italic"?it="italic":ct==="underline"?Ct="underline":ct==="box"?(y[De]?It=!0:l(`This font style doesn't support "box"`,X,xe),at="finished"):ct==="utf"?(Dt=H.shift(),at="size"):l("Unknown parameter "+Dt.token+" in font definition.",X,xe);break;case"size":Dt.type==="number"?ut?l("Font size specified twice in font definition.",X,xe):ut=Dt.token:l("Expected font size in font definition.",X,xe),at="modifier";break;case"modifier":ct==="bold"?Lt="bold":ct==="italic"?it="italic":ct==="underline"?Ct="underline":ct==="box"?(y[De]?It=!0:l(`This font style doesn't support "box"`,X,xe),at="finished"):l("Unknown parameter "+Dt.token+" in font definition.",X,xe);break;case"finished":l('Extra characters found after "box" in font definition.',X,xe);break}}ut===void 0?Y?ut=Y.size:(l("Must specify the size of the font since there is no default value.",X,xe),ut=12):ut=parseFloat(ut),Re=Re.join(" "),Re===""&&(Y?Re=Y.face:(l("Must specify the name of the font since there is no default value.",X,xe),Re="sans-serif"));var gr=S(Re),vr={};return gr?(vr.face=gr.face,vr.weight=gr.weight,vr.style=gr.style,vr.decoration=gr.decoration,vr.size=ut,It&&(vr.box=!0),vr):(vr.face=Re,vr.weight=Lt,vr.style=it,vr.decoration=Ct,vr.size=ut,It&&(vr.box=!0),vr)},M=function(H,Y,X){return Y.length===0?'Directive "'+H+'" requires a font as a parameter.':(u[H]=A(Y,u[H],X,0,H),u.is_in_header&&(c.formatting[H]=u[H]),null)},w=function(H,Y,X){return Y.length===0?'Directive "'+H+'" requires a font as a parameter.':(c.formatting[H]=A(Y,c.formatting[H],X,0,H),null)},_=function(H,Y){var X="";Y.forEach(function(De){X+=De.token});var xe=parseFloat(X);if(isNaN(xe)||xe===0)return'Directive "'+H+'" requires a number as a parameter.';c.formatting.scale=xe},C=["acoustic-bass-drum","bass-drum-1","side-stick","acoustic-snare","hand-clap","electric-snare","low-floor-tom","closed-hi-hat","high-floor-tom","pedal-hi-hat","low-tom","open-hi-hat","low-mid-tom","hi-mid-tom","crash-cymbal-1","high-tom","ride-cymbal-1","chinese-cymbal","ride-bell","tambourine","splash-cymbal","cowbell","crash-cymbal-2","vibraslap","ride-cymbal-2","hi-bongo","low-bongo","mute-hi-conga","open-hi-conga","low-conga","high-timbale","low-timbale","high-agogo","low-agogo","cabasa","maracas","short-whistle","long-whistle","short-guiro","long-guiro","claves","hi-wood-block","low-wood-block","mute-cuica","open-cuica","mute-triangle","open-triangle"],m=function(H){var Y=H.split(/\s+/);if(Y.length!==2&&Y.length!==3)return{error:'Expected parameters "abc-note", "drum-sound", and optionally "note-head"'};var X=Y[0],xe=parseInt(Y[1],10);if((isNaN(xe)||xe<35||xe>81)&&Y[1]&&(xe=C.indexOf(Y[1].toLowerCase())+35),isNaN(xe)||xe<35||xe>81)return{error:'Expected drum name, received "'+Y[1]+'"'};var De={sound:xe};return Y.length===3&&(De.noteHead=Y[2]),{key:X,value:De}},T=function(H,Y){var X=a.getMeasurement(Y);return X.used===0||Y.length!==0?{error:'Directive "'+H+'" requires a measurement as a parameter.'}:X.value},L=function(H,Y){var X=a.getMeasurement(Y);return X.used===0||Y.length!==0?'Directive "'+H+'" requires a measurement as a parameter.':(c.formatting[H]=X.value,null)},N=function(H,Y,X,xe,De){if(X.length!==1||X[0].type!=="number")return'Directive "'+Y+'" requires a number as a parameter.';var $e=X[0].intt;return xe!==void 0&&$e<xe?'Directive "'+Y+'" requires a number greater than or equal to '+xe+" as a parameter.":De!==void 0&&$e>De?'Directive "'+Y+'" requires a number less than or equal to '+De+" as a parameter.":(u[H]=$e,null)},B=function(H,Y,X){if(X.length===1&&(X[0].token==="true"||X[0].token==="false"))return u[H]=X[0].token==="true",null;var xe=N(H,Y,X,0,1);return xe!==null?xe:(u[H]=u[H]===1,null)},W=function(H,Y,X,xe){if(X.length!==1)return'Directive "'+Y+'" requires one of [ '+xe.join(", ")+" ] as a parameter.";for(var De=X[0].token,$e=!1,Re=0;!$e&&Re<xe.length;Re++)xe[Re]===De&&($e=!0);return $e?(u[H]=De,null):'Directive "'+Y+'" requires one of [ '+xe.join(", ")+" ] as a parameter."},G=["nobarlines","barlines","beataccents","nobeataccents","droneon","droneoff","drumon","drumoff","fermatafixed","fermataproportional","gchordon","gchordoff","controlcombo","temperamentnormal","noportamento"],R=["gchord","ptstress","beatstring"],ye=["bassvol","chordvol","c","channel","beatmod","deltaloudness","drumbars","gracedivider","makechordchannels","randomchordattack","chordattack","stressmodel","transpose","rtranspose","vol","volinc","gchordbars"],q=["program"],se=["ratio","snt","bendvelocity","pitchbend","control","temperamentlinear"],ve=["beat"],he=["drone"],ce=["portamento"],de=["expand","grace","trim"],K=["drum","chordname"],Q=["bassprog","chordprog"],le=function(H,Y,X){var xe=H.shift().token,De=[];if(G.indexOf(xe)>=0)H.length!==0&&l("Unexpected parameter in MIDI "+xe,X,0);else if(R.indexOf(xe)>=0)H.length!==1?l("Expected one parameter in MIDI "+xe,X,0):De.push(H[0].token);else if(ye.indexOf(xe)>=0)H.length!==1?l("Expected one parameter in MIDI "+xe,X,0):H[0].type!=="number"?l("Expected one integer parameter in MIDI "+xe,X,0):De.push(H[0].intt);else if(q.indexOf(xe)>=0)H.length!==1&&H.length!==2?l("Expected one or two parameters in MIDI "+xe,X,0):H[0].type!=="number"||H.length===2&&H[1].type!=="number"?l("Expected integer parameter in MIDI "+xe,X,0):(De.push(H[0].intt),H.length===2&&De.push(H[1].intt));else if(se.indexOf(xe)>=0)H.length!==2?l("Expected two parameters in MIDI "+xe,X,0):H[0].type!=="number"||H[1].type!=="number"?l("Expected two integer parameters in MIDI "+xe,X,0):(De.push(H[0].intt),De.push(H[1].intt));else if(ce.indexOf(xe)>=0)H.length!==2?l("Expected two parameters in MIDI "+xe,X,0):H[0].type!=="alpha"||H[1].type!=="number"?l("Expected one string and one integer parameters in MIDI "+xe,X,0):(De.push(H[0].token),De.push(H[1].intt));else if(xe==="drummap")H.length===2&&H[0].type==="alpha"&&H[1].type==="number"?(Y.formatting||(Y.formatting={}),Y.formatting.midi||(Y.formatting.midi={}),Y.formatting.midi.drummap||(Y.formatting.midi.drummap={}),Y.formatting.midi.drummap[H[0].token]=H[1].intt,De=Y.formatting.midi.drummap):H.length===3&&H[0].type==="punct"&&H[1].type==="alpha"&&H[2].type==="number"?(Y.formatting||(Y.formatting={}),Y.formatting.midi||(Y.formatting.midi={}),Y.formatting.midi.drummap||(Y.formatting.midi.drummap={}),Y.formatting.midi.drummap[H[0].token+H[1].token]=H[2].intt,De=Y.formatting.midi.drummap):l("Expected one note name and one integer parameter in MIDI "+xe,X,0);else if(de.indexOf(xe)>=0)H.length!==3||H[0].type!=="number"||H[1].token!=="/"||H[2].type!=="number"?l("Expected fraction parameter in MIDI "+xe,X,0):(De.push(H[0].intt),De.push(H[2].intt));else if(ve.indexOf(xe)>=0)H.length!==4?l("Expected four parameters in MIDI "+xe,X,0):H[0].type!=="number"||H[1].type!=="number"||H[2].type!=="number"||H[3].type!=="number"?l("Expected four integer parameters in MIDI "+xe,X,0):(De.push(H[0].intt),De.push(H[1].intt),De.push(H[2].intt),De.push(H[3].intt));else if(he.indexOf(xe)>=0)H.length!==5?l("Expected five parameters in MIDI "+xe,X,0):H[0].type!=="number"||H[1].type!=="number"||H[2].type!=="number"||H[3].type!=="number"||H[4].type!=="number"?l("Expected five integer parameters in MIDI "+xe,X,0):(De.push(H[0].intt),De.push(H[1].intt),De.push(H[2].intt),De.push(H[3].intt),De.push(H[4].intt));else if(q.indexOf(xe)>=0)H.length!==1||H.length!==4?l("Expected one or two parameters in MIDI "+xe,X,0):H[0].type!=="number"?l("Expected integer parameter in MIDI "+xe,X,0):H.length===4?(H[1].token!=="octave"&&l("Expected octave parameter in MIDI "+xe,X,0),H[2].token!=="="&&l("Expected octave parameter in MIDI "+xe,X,0),H[3].type!=="number"&&l("Expected integer parameter for octave in MIDI "+xe,X,0)):(De.push(H[0].intt),H.length===4&&De.push(H[3].intt));else if(K.indexOf(xe)>=0)if(H.length<2)l("Expected string parameter and at least one integer parameter in MIDI "+xe,X,0);else if(H[0].type!=="alpha")l("Expected string parameter and at least one integer parameter in MIDI "+xe,X,0);else{var $e=H.shift();for(De.push($e.token);H.length>0;)$e=H.shift(),$e.type!=="number"&&l("Expected integer parameter in MIDI "+xe,X,0),De.push($e.intt)}else if(Q.indexOf(xe)>=0){if(H.length!==1&&H.length!==2)l("Expected one or two parameters in MIDI "+xe,X,0);else if(H[0].type!=="number")l("Expected integer parameter in MIDI "+xe,X,0);else if(H.length===2&&H[1].type!=="alpha")l("Expected alpha parameter in MIDI "+xe,X,0);else if(De.push(H[0].intt),H.length===2){var Re=H[1].token;Re.indexOf("octave=")!=-1?(Re=Re.replace("octave=",""),Re=parseInt(Re),isNaN(Re)?l("Expected octave value in MIDI"+xe):(Re<-1&&(l("Expected octave= in MIDI "+xe+" to be >= -1 (recv:"+Re+")"),Re=-1),Re>3&&(l("Expected octave= in MIDI "+xe+" to be <= 3 (recv:"+Re+")"),Re=3),De.push(Re))):l("Expected octave= in MIDI"+xe)}}f.hasBeginMusic()?f.appendElement("midi",-1,-1,{cmd:xe,params:De}):(Y.formatting.midi===void 0&&(Y.formatting.midi={}),Y.formatting.midi[xe]=De)};r.parseFontChangeLine=function(H){H=H.replace(/\$\$/g,"");var Y=H.split("$");if(Y.length>1&&u.setfont){var X=[];Y[0]!==""&&X.push({text:Y[0]});for(var xe=1;xe<Y.length;xe++)if(Y[xe][0]==="0")X.push({text:Y[xe].substring(1).replace(/\x03/g,"$$")});else{var De=parseInt(Y[xe][0],10);u.setfont[De]?X.push({font:u.setfont[De],text:Y[xe].substring(1).replace(/\x03/g,"$$")}):X[X.length-1].text+="$"+Y[xe].replace(/\x03/g,"$$")}return X}return H.replace(/\x03/g,"$$")};var Ee=["auto","above","below","hidden"];r.addDirective=function(H){var Y=a.tokenize(H,0,H.length);if(Y.length===0||Y[0].type!=="alpha")return null;var X=H.substring(H.indexOf(Y[0].token)+Y[0].token.length);X=a.stripComment(X);var xe=Y.shift().token.toLowerCase(),De="",$e;switch(xe){case"bagpipes":c.formatting.bagpipes=!0;break;case"flatbeams":c.formatting.flatbeams=!0;break;case"jazzchords":c.formatting.jazzchords=!0;break;case"accentAbove":c.formatting.accentAbove=!0;break;case"germanAlphabet":c.formatting.germanAlphabet=!0;break;case"landscape":u.landscape=!0;break;case"papersize":u.papersize=X;break;case"graceslurs":if(Y.length!==1)return"Directive graceslurs requires one parameter: 0 or 1";if(Y[0].token==="0"||Y[0].token==="false")c.formatting.graceSlurs=!1;else if(Y[0].token==="1"||Y[0].token==="true")c.formatting.graceSlurs=!0;else return"Directive graceslurs requires one parameter: 0 or 1 (received "+Y[0].token+")";break;case"lineThickness":var Re=Me(Y);if(Re.value!==void 0&&(c.formatting.lineThickness=Re.value),Re.error)return Re.error;break;case"stretchlast":var ut=Me(Y);if(ut.value!==void 0&&(c.formatting.stretchlast=ut.value),ut.error)return ut.error;break;case"titlecaps":u.titlecaps=!0;break;case"titleleft":c.formatting.titleleft=!0;break;case"measurebox":c.formatting.measurebox=!0;break;case"vocal":return W("vocalPosition",xe,Y,Ee);case"dynamic":return W("dynamicPosition",xe,Y,Ee);case"gchord":return W("chordPosition",xe,Y,Ee);case"ornament":return W("ornamentPosition",xe,Y,Ee);case"volume":return W("volumePosition",xe,Y,Ee);case"botmargin":case"botspace":case"composerspace":case"indent":case"leftmargin":case"linesep":case"musicspace":case"partsspace":case"pageheight":case"pagewidth":case"rightmargin":case"stafftopmargin":case"staffsep":case"staffwidth":case"subtitlespace":case"sysstaffsep":case"systemsep":case"textspace":case"titlespace":case"topmargin":case"topspace":case"vocalspace":case"wordsspace":return L(xe,Y);case"voicescale":if(Y.length!==1||Y[0].type!=="number")return"voicescale requires one float as a parameter";var Lt=Y.shift();return u.currentVoice&&(u.currentVoice.scale=Lt.floatt,f.changeVoiceScale(u.currentVoice.scale)),null;case"voicecolor":if(Y.length!==1)return"voicecolor requires one string as a parameter";var it=Y.shift();return u.currentVoice&&(u.currentVoice.color=it.token,f.changeVoiceColor(u.currentVoice.color)),null;case"vskip":var Ct=Math.round(T(xe,Y));return Ct.error?Ct.error:(f.addSpacing(Ct),null);case"scale":_(xe,Y);break;case"sep":if(Y.length===0)f.addSeparator(14,14,85,{startChar:u.iChar,endChar:u.iChar+5});else{var It=a.getMeasurement(Y);if(It.used===0)return'Directive "'+xe+'" requires 3 numbers: space above, space below, length of line';var at=It.value;if(It=a.getMeasurement(Y),It.used===0)return'Directive "'+xe+'" requires 3 numbers: space above, space below, length of line';var Gt=It.value;if(It=a.getMeasurement(Y),It.used===0||Y.length!==0)return'Directive "'+xe+'" requires 3 numbers: space above, space below, length of line';var Dt=It.value;f.addSeparator(at,Gt,Dt,{startChar:u.iChar,endChar:u.iChar+X.length})}break;case"barsperstaff":if(De=N("barsperstaff",xe,Y),De!==null)return De;break;case"staffnonote":if(Y.length!==1)return"Directive staffnonote requires one parameter: 0 or 1";if(Y[0].token==="0")u.staffnonote=!0;else if(Y[0].token==="1")u.staffnonote=!1;else return"Directive staffnonote requires one parameter: 0 or 1 (received "+Y[0].token+")";break;case"printtempo":if(De=B("printTempo",xe,Y),De!==null)return De;break;case"partsbox":if(De=B("partsBox",xe,Y),De!==null)return De;u.partsfont.box=u.partsBox;break;case"freegchord":if(De=B("freegchord",xe,Y),De!==null)return De;break;case"measurenb":case"barnumbers":if(De=N("barNumbers",xe,Y),De!==null)return De;break;case"setbarnb":if(Y.length!==1||Y[0].type!=="number")return"Directive setbarnb requires a number as a parameter.";u.currBarNumber=f.setBarNumberImmediate(Y[0].intt);break;case"begintext":var ct="";for($e=a.nextLine();$e&&$e.indexOf("%%endtext")!==0;)t.startsWith($e,"%%")?ct+=$e.substring(2)+`
|
|
141
|
+
`:ct+=$e+`
|
|
142
|
+
`,$e=a.nextLine();f.addText(ct,{startChar:u.iChar,endChar:u.iChar+ct.length+7});break;case"continueall":u.continueall=!0;break;case"beginps":for($e=a.nextLine();$e&&$e.indexOf("%%endps")!==0;)a.nextLine();l("Postscript ignored",H,0);break;case"deco":X.length>0&&u.ignoredDecorations.push(X.substring(0,X.indexOf(" "))),l("Decoration redefinition ignored",H,0);break;case"text":var gr=a.translateString(X);f.addText(r.parseFontChangeLine(gr),{startChar:u.iChar,endChar:u.iChar+X.length+7});break;case"center":var vr=a.translateString(X);f.addCentered(r.parseFontChangeLine(vr));break;case"font":break;case"setfont":var er=a.tokenize(X,0,X.length);if(er.length>=4&&er[0].token==="-"&&er[1].type==="number"){var Cr=parseInt(er[1].token);Cr>=1&&Cr<=9&&(u.setfont||(u.setfont=[]),er.shift(),er.shift(),u.setfont[Cr]=A(er,u.setfont[Cr],H,0,"setfont"))}break;case"gchordfont":case"partsfont":case"tripletfont":case"vocalfont":case"textfont":case"annotationfont":case"historyfont":case"infofont":case"measurefont":case"repeatfont":case"wordsfont":return M(xe,Y,H);case"composerfont":case"subtitlefont":case"tempofont":case"titlefont":case"voicefont":case"footerfont":case"headerfont":return w(xe,Y,H);case"barlabelfont":case"barnumberfont":case"barnumfont":return M("measurefont",Y,H);case"staves":case"score":u.score_is_present=!0;for(var Wr=function(fe,ne,ae,Z,ue){(ne||u.staves.length===0)&&u.staves.push({index:u.staves.length,numVoices:0});var me=t.last(u.staves);ae!==void 0&&me.bracket===void 0&&(me.bracket=ae),Z!==void 0&&me.brace===void 0&&(me.brace=Z),ue&&(me.connectBarLines="end"),u.voices[fe]===void 0&&(u.voices[fe]={staffNum:me.index,index:me.numVoices},me.numVoices++)},kr=!1,Ue=!1,Je=!1,Ye=!1,Qe=!1,rt=!1,o=!1,h,b=function(){if(o=!0,h){var fe="start";h.staffNum>0&&(u.staves[h.staffNum-1].connectBarLines==="start"||u.staves[h.staffNum-1].connectBarLines==="continue")&&(fe="continue"),u.staves[h.staffNum].connectBarLines=fe}};Y.length;){var x=Y.shift();switch(x.token){case"(":kr?l("Can't nest parenthesis in %%score",H,x.start):(kr=!0,Ye=!0);break;case")":!kr||Ye?l("Unexpected close parenthesis in %%score",H,x.start):kr=!1;break;case"[":Ue?l("Can't nest brackets in %%score",H,x.start):(Ue=!0,Qe=!0);break;case"]":!Ue||Qe?l("Unexpected close bracket in %%score",H,x.start):(Ue=!1,u.staves[h.staffNum].bracket="end");break;case"{":Je?l("Can't nest braces in %%score",H,x.start):(Je=!0,rt=!0);break;case"}":!Je||rt?l("Unexpected close brace in %%score",H,x.start):(Je=!1,u.staves[h.staffNum].brace="end");break;case"|":b();break;default:for(var E="";(x.type==="alpha"||x.type==="number")&&(E+=x.token,x.continueId);)x=Y.shift();var I=!kr||Ye,F=Qe?"start":Ue?"continue":void 0,D=rt?"start":Je?"continue":void 0;Wr(E,I,F,D,o),Ye=!1,Qe=!1,rt=!1,o=!1,h=u.voices[E],xe==="staves"&&b();break}}break;case"newpage":var z=a.getInt(X);f.addNewPage(z.digits===0?-1:z.value);break;case"abc":var U=X.split(" ");switch(U[0]){case"-copyright":case"-creator":case"-edited-by":case"-version":case"-charset":var J=U.shift();f.addMetaText(xe+J,U.join(" "),{startChar:u.iChar,endChar:u.iChar+X.length+5});break;default:return"Unknown directive: "+xe+U[0]}break;case"header":case"footer":var te=a.getMeat(X,0,X.length);te=X.substring(te.start,te.end),te[0]==='"'&&te[te.length-1]==='"'&&(te=te.substring(1,te.length-1));var ee=te.split(" "),j={};ee.length===1?j={left:"",center:ee[0],right:""}:ee.length===2?j={left:ee[0],center:ee[1],right:""}:j={left:ee[0],center:ee[1],right:ee[2]},ee.length>3&&l("Too many tabs in "+xe+": "+ee.length+" found.",X,0),f.addMetaTextObj(xe,j,{startChar:u.iChar,endChar:u.iChar+H.length});break;case"midi":var pe=a.tokenize(X,0,X.length,!0);pe.length>0&&pe[0].token==="="&&pe.shift(),pe.length===0?l("Expected midi command",X,0):le(pe,c,X);break;case"percmap":var ie=m(X);ie.error?l(ie.error,H,8):(c.formatting.percmap||(c.formatting.percmap={}),c.formatting.percmap[ie.key]=ie.value);break;case"map":case"playtempo":case"auquality":case"continuous":case"nobarcheck":c.formatting[xe]=X;break;default:return"Unknown directive: "+xe}return null},r.globalFormatting=function(H){for(var Y in H)if(H.hasOwnProperty(Y)){var X=""+H[Y],xe=a.tokenize(X,0,X.length),De;switch(Y){case"titlefont":case"gchordfont":case"composerfont":case"footerfont":case"headerfont":case"historyfont":case"infofont":case"measurefont":case"partsfont":case"repeatfont":case"subtitlefont":case"tempofont":case"textfont":case"voicefont":case"tripletfont":case"vocalfont":case"wordsfont":case"annotationfont":case"tablabelfont":case"tabnumberfont":case"tabgracefont":M(Y,xe,X);break;case"scale":_(Y,xe);break;case"partsbox":De=B("partsBox",Y,xe),De!==null&&l(De),u.partsfont.box=u.partsBox;break;case"freegchord":De=B("freegchord",Y,xe),De!==null&&l(De);break;case"fontboxpadding":(xe.length!==1||xe[0].type!=="number")&&l('Directive "'+Y+'" requires a number as a parameter.'),c.formatting.fontboxpadding=xe[0].floatt;break;case"stafftopmargin":(xe.length!==1||xe[0].type!=="number")&&l('Directive "'+Y+'" requires a number as a parameter.'),c.formatting.stafftopmargin=xe[0].floatt;break;case"stretchlast":var $e=Me(xe);if($e.value!==void 0&&(c.formatting.stretchlast=$e.value),$e.error)return $e.error;break;default:l("Formatting directive unrecognized: ",Y,0)}}};function Me(H){if(H.length===0)return{value:1};if(H.length===1)if(H[0].type==="number"){if(H[0].floatt>=0||H[0].floatt<=1)return{value:H[0].floatt}}else{if(H[0].token==="false")return{value:0};if(H[0].token==="true")return{value:1}}return{error:"Directive stretchlast requires zero or one parameter: false, true, or number between 0 and 1 (received "+H[0].token+")"}}}(),Tm=r,Tm}var Im,Vw;function VI(){if(Vw)return Im;Vw=1;var t={};const r=["C,,,","D,,,","E,,,","F,,,","G,,,","A,,,","B,,,","C,,","D,,","E,,","F,,","G,,","A,,","B,,","C,","D,","E,","F,","G,","A,","B,","C","D","E","F","G","A","B","c","d","e","f","g","a","b","c'","d'","e'","f'","g'","a'","b'","c''","d''","e''","f''","g''","a''","b''","c'''","d'''","e'''","f'''","g'''","a'''","b'''"];return t.pitchIndex=function(a){return r.indexOf(a)},t.noteName=function(a){return r[a]},Im=t,Im}var Pm,Uw;function O9(){if(Uw)return Pm;Uw=1;var t=["C","C♯","D","D♯","E","F","F♯","G","G♯","A","A♯","B"],r=["C","D♭","D","E♭","E","F","G♭","G","A♭","A","B♭","B"],a=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],l=["C","Db","D","Eb","E","F","Gb","G","Ab","A","Bb","B"];function u(c,f,p,y){if(!f||f%12===0)return c;for(;f<0;)f+=12;f>11&&(f=f%12);var S=c.match(/^([A-G][b#♭♯]?)([^\/]+)?\/?([A-G][b#♭♯]?)?(.+)?/);if(!S)return c;var A=S[1],M=S[2],w=S[3],_=S[4],C=t.indexOf(A);if(C<0&&(C=r.indexOf(A)),C<0&&(C=a.indexOf(A)),C<0&&(C=l.indexOf(A)),C<0)return c;if(C+=f,C=C%12,p?y?c=l[C]:c=r[C]:y?c=a[C]:c=t[C],M&&(c+=M),w){var C=t.indexOf(w);C<0&&(C=r.indexOf(w)),C<0&&(C=a.indexOf(w)),C<0&&(C=l.indexOf(w)),c+="/",C>=0?(C+=f,C=C%12,p?y?c+=l[C]:c+=r[C]:y?c+=a[C]:c+=t[C]):c+=w}return _&&(c+=_),c}return Pm=u,Pm}var Nm,$w;function D9(){if($w)return Nm;$w=1;var t={C:{modes:["CMaj","Amin","Am","GMix","DDor","EPhr","FLyd","BLoc"],stepsFromC:0},Db:{modes:["DbMaj","Bbmin","Bbm","AbMix","EbDor","FPhr","GbLyd","CLoc"],stepsFromC:1},D:{modes:["DMaj","Bmin","Bm","AMix","EDor","F#Phr","GLyd","C#Loc"],stepsFromC:2},Eb:{modes:["EbMaj","Cmin","Cm","BbMix","FDor","GPhr","AbLyd","DLoc"],stepsFromC:3},E:{modes:["EMaj","C#min","C#m","BMix","F#Dor","G#Phr","ALyd","D#Loc"],stepsFromC:4},F:{modes:["FMaj","Dmin","Dm","CMix","GDor","APhr","BbLyd","ELoc"],stepsFromC:5},Gb:{modes:["GbMaj","Ebmin","Ebm","DbMix","AbDor","BbPhr","CbLyd","FLoc"],stepsFromC:6},G:{modes:["GMaj","Emin","Em","DMix","ADor","BPhr","CLyd","F#Loc"],stepsFromC:7},Ab:{modes:["AbMaj","Fmin","Fm","EbMix","BbDor","CPhr","DbLyd","GLoc"],stepsFromC:8},A:{modes:["AMaj","F#min","F#m","EMix","BDor","C#Phr","DLyd","G#Loc"],stepsFromC:9},Bb:{modes:["BbMaj","Gmin","Gm","FMix","CDor","DPhr","EbLyd","ALoc"],stepsFromC:10},B:{modes:["BMaj","G#min","G#m","F#Mix","C#Dor","D#Phr","ELyd","A#Loc"],stepsFromC:11},"C#":{modes:["C#Maj","A#min","A#m","G#Mix","D#Dor","E#Phr","F#Lyd","B#Loc"],stepsFromC:1},"F#":{modes:["F#Maj","D#min","D#m","C#Mix","G#Dor","A#Phr","BLyd","E#Loc"],stepsFromC:6},Cb:{modes:["CbMaj","Abmin","Abm","GbMix","DbDor","EbPhr","FbLyd","BbLoc"],stepsFromC:11}},r=null;function a(){r={};for(var f=Object.keys(t),p=0;p<f.length;p++){var y=t[f[p]];r[f[p].toLowerCase()]=f[p];for(var S=0;S<y.modes.length;S++){var A=y.modes[S].toLowerCase();r[A]=f[p]}}}function l(f){r||a();var p=f.toLowerCase().match(/([a-g][b#]?)(maj|min|mix|dor|phr|lyd|loc|m)?/);if(!p||!p[2])return f;p=p[1]+p[2];var y=r[p];return y||f}function u(f,p){var y=t[f];if(!y||p==="")return f;var S=p.toLowerCase().match(/^(maj|min|mix|dor|phr|lyd|loc|m)/);if(!S)return f;for(var A=S[1],M=0;M<y.modes.length;M++){var w=y.modes[M],_=w.toLowerCase().indexOf(A);if(_!==-1&&_===w.length-A.length)return w.substring(0,w.length-A.length)}return f}function c(f,p){var y=t[f];if(!y)return f;for(;p<0;)p+=12;for(var S=(y.stepsFromC+p)%12,A=0;A<Object.keys(t).length;A++){var M=Object.keys(t)[A];if(t[M].stepsFromC===S)return M}return f}return Nm={relativeMajor:l,relativeMode:u,transposeKey:c},Nm}var Lm,Ww;function R9(){if(Ww)return Lm;Ww=1;var{relativeMajor:t}=D9(),r={acc:"sharp",note:"f"},a={acc:"sharp",note:"c"},l={acc:"sharp",note:"g"},u={acc:"sharp",note:"d"},c={acc:"sharp",note:"A"},f={acc:"sharp",note:"e"},p={acc:"sharp",note:"B"},y={acc:"flat",note:"B"},S={acc:"flat",note:"e"},A={acc:"flat",note:"A"},M={acc:"flat",note:"d"},w={acc:"flat",note:"G"},_={acc:"flat",note:"c"},C={acc:"flat",note:"F"},m={"C#":[r,a,l,u,c,f,p],"F#":[r,a,l,u,c,f],B:[r,a,l,u,c],E:[r,a,l,u],A:[r,a,l],D:[r,a],G:[r],C:[],F:[y],Bb:[y,S],Eb:[y,S,A],Cm:[y,S,A],Ab:[y,S,A,M],Db:[y,S,A,M,w],Gb:[y,S,A,M,w,_],Cb:[y,S,A,M,w,_,C],"A#":[y,S],"B#":[],"D#":[y,S,A],"E#":[y],"G#":[y,S,A,M],none:[]};function T(L){var N=m[t(L)];return N?JSON.parse(JSON.stringify(N)):null}return Lm=T,Lm}var Om,Gw;function B9(){if(Gw)return Om;Gw=1;var t=VI(),r=O9(),a=R9(),l={},u={C:0,"C#":1,Db:1,D:2,"D#":3,Eb:3,E:4,F:5,"F#":6,Gb:6,G:7,"G#":8,Ab:8,A:9,"A#":10,Bb:10,B:11},c=["C","Db","D","Eb","E","F","F#","G","Ab","A","Bb","B"],f=["C","C#","D","D#","E","F","F#","G","G#","A","Bb","B"];l.keySignature=function(w,_,C,m,T){if(w.clef.type==="perc"||w.clef.type==="none")return{accidentals:a(_),root:C,acc:m};T||(T=0),w.localTransposeVerticalMovement=0,w.localTransposePreferFlats=!1;var L=a(_);if(!L)return w.key;if(w.localTranspose=(w.globalTranspose?w.globalTranspose:0)+T,!w.localTranspose)return{accidentals:L,root:C,acc:m};if(w.globalTransposeOrigKeySig=L,w.localTranspose%12===0)return w.localTransposeVerticalMovement=w.localTranspose/12*7,{accidentals:L,root:C,acc:m};var N=_[0];_[1]==="b"||_[1]==="#"?(N+=_[1],_=_.substr(2)):_=_.substr(1);var B=u[N],W=B!==void 0;W||(B=0,N="C",_="");for(var G=B+w.localTranspose;G<0;)G+=12;G>11&&(G=G%12);var R=_[0]==="m"?f[G]:c[G],ye=R+_,q=a(ye);q.length>0&&q[0].acc==="flat"&&(w.localTransposePreferFlats=!0);var se=ye.charCodeAt(0)-N.charCodeAt(0);return w.localTranspose>0?(se<0||se===0&&(N[1]==="#"||ye[1]==="b"))&&(se+=7):w.localTranspose<0&&(se>0||se===0&&(N[1]==="b"||ye[1]==="#"))&&(se-=7),w.localTranspose>0?w.localTransposeVerticalMovement=se+Math.floor(w.localTranspose/12)*7:w.localTransposeVerticalMovement=se+Math.ceil(w.localTranspose/12)*7,W?{accidentals:q,root:R[0],acc:R.length>1?R[1]:""}:{accidentals:[],root:C,acc:m}},l.chordName=function(w,_){return r(_,w.localTranspose,w.localTransposePreferFlats,w.freegchord)};var p=["c","d","e","f","g","a","b"];function y(w,_,C,m,T){for(var L=p[(w+49)%7],N=0,B=0;B<m.length;B++)m[B].note.toLowerCase()===L&&(N=S[m[B].acc]);for(var W=S[C],G=W-N,R=p[(_+49)%7],ye=0,q=0;q<T.accidentals.length;q++)T.accidentals[q].note.toLowerCase()===R&&(ye=S[T.accidentals[q].acc]);var se=G+ye;return se<-2&&(_--,se+=R==="c"||R==="f"?1:2),se>2&&(_++,se-=R==="b"||R==="e"?1:2),[_,se]}var S={dblflat:-2,flat:-1,natural:0,sharp:1,dblsharp:2},A={"-2":"dblflat","-1":"flat",0:"natural",1:"sharp",2:"dblsharp"},M={"-2":"__","-1":"_",0:"=",1:"^",2:"^^"};return l.note=function(w,_){if(!(!w.localTranspose||w.clef.type==="perc")){var C=_.pitch;if(w.localTransposeVerticalMovement&&(_.pitch=_.pitch+w.localTransposeVerticalMovement,_.name)){var m=_.accidental?_.name.substring(1):_.name,T=_.accidental?_.name[0]:"",L=t.pitchIndex(m);_.name=T+t.noteName(L+w.localTransposeVerticalMovement)}if(_.accidental){var N=y(C,_.pitch,_.accidental,w.globalTransposeOrigKeySig,w.targetKey);_.pitch=N[0],_.accidental=A[N[1]],_.name&&(_.name=M[N[1]]+_.name.replace(/[_^=]/g,""))}}},Om=l,Om}var Dm,Yw;function $y(){if(Yw)return Dm;Yw=1;var t=Uy(),r=B9(),a={};return function(){var l,u,c,f;a.initialize=function(_,C,m,T,L){l=_,u=C,c=m,f=L},a.standardKey=function(_,C,m,T){return r.keySignature(c,_,C,m,T)};var p={treble:{clef:"treble",pitch:4,mid:0},"treble+8":{clef:"treble+8",pitch:4,mid:0},"treble-8":{clef:"treble-8",pitch:4,mid:0},"treble^8":{clef:"treble+8",pitch:4,mid:0},treble_8:{clef:"treble-8",pitch:4,mid:0},treble1:{clef:"treble",pitch:2,mid:2},treble2:{clef:"treble",pitch:4,mid:0},treble3:{clef:"treble",pitch:6,mid:-2},treble4:{clef:"treble",pitch:8,mid:-4},treble5:{clef:"treble",pitch:10,mid:-6},perc:{clef:"perc",pitch:6,mid:0},none:{clef:"none",mid:0},bass:{clef:"bass",pitch:8,mid:-12},"bass+8":{clef:"bass+8",pitch:8,mid:-12},"bass-8":{clef:"bass-8",pitch:8,mid:-12},"bass^8":{clef:"bass+8",pitch:8,mid:-12},bass_8:{clef:"bass-8",pitch:8,mid:-12},"bass+16":{clef:"bass",pitch:8,mid:-12},"bass-16":{clef:"bass",pitch:8,mid:-12},"bass^16":{clef:"bass",pitch:8,mid:-12},bass_16:{clef:"bass",pitch:8,mid:-12},bass1:{clef:"bass",pitch:2,mid:-6},bass2:{clef:"bass",pitch:4,mid:-8},bass3:{clef:"bass",pitch:6,mid:-10},bass4:{clef:"bass",pitch:8,mid:-12},bass5:{clef:"bass",pitch:10,mid:-14},tenor:{clef:"alto",pitch:8,mid:-8},tenor1:{clef:"alto",pitch:2,mid:-2},tenor2:{clef:"alto",pitch:4,mid:-4},tenor3:{clef:"alto",pitch:6,mid:-6},tenor4:{clef:"alto",pitch:8,mid:-8},tenor5:{clef:"alto",pitch:10,mid:-10},alto:{clef:"alto",pitch:6,mid:-6},alto1:{clef:"alto",pitch:2,mid:-2},alto2:{clef:"alto",pitch:4,mid:-4},alto3:{clef:"alto",pitch:6,mid:-6},alto4:{clef:"alto",pitch:8,mid:-8},alto5:{clef:"alto",pitch:10,mid:-10},"alto+8":{clef:"alto+8",pitch:6,mid:-6},"alto-8":{clef:"alto-8",pitch:6,mid:-6},"alto^8":{clef:"alto+8",pitch:6,mid:-6},alto_8:{clef:"alto-8",pitch:6,mid:-6}},y=function(_,C){var m=p[_],T=m?m.mid:0;return T+C};a.fixClef=function(_){var C=p[_.type];C&&(_.clefPos=C.pitch,_.type=C.clef)},a.deepCopyKey=function(_){var C={accidentals:[],root:_.root,acc:_.acc,mode:_.mode};return _.accidentals.forEach(function(m){C.accidentals.push(Object.assign({},m))}),C};var S={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11};a.addPosToKey=function(_,C){var m=_.verticalPos;C.accidentals.forEach(function(T){var L=S[T.note];L=L-m,T.verticalPos=L}),C.impliedNaturals&&C.impliedNaturals.forEach(function(T){var L=S[T.note];L=L-m,T.verticalPos=L}),m<-10?(C.accidentals.forEach(function(T){T.verticalPos-=7,(T.verticalPos>=11||T.verticalPos===10&&T.acc==="flat")&&(T.verticalPos-=7),T.note==="A"&&T.acc==="sharp"&&(T.verticalPos-=7),(T.note==="G"||T.note==="F")&&T.acc==="flat"&&(T.verticalPos-=7)}),C.impliedNaturals&&C.impliedNaturals.forEach(function(T){T.verticalPos-=7,(T.verticalPos>=11||T.verticalPos===10&&T.acc==="flat")&&(T.verticalPos-=7),T.note==="A"&&T.acc==="sharp"&&(T.verticalPos-=7),(T.note==="G"||T.note==="F")&&T.acc==="flat"&&(T.verticalPos-=7)})):m<-4?(C.accidentals.forEach(function(T){T.verticalPos-=7,m===-8&&(T.note==="f"||T.note==="g")&&T.acc==="sharp"&&(T.verticalPos-=7)}),C.impliedNaturals&&C.impliedNaturals.forEach(function(T){T.verticalPos-=7,m===-8&&(T.note==="f"||T.note==="g")&&T.acc==="sharp"&&(T.verticalPos-=7)})):m>=7&&(C.accidentals.forEach(function(T){T.verticalPos+=7}),C.impliedNaturals&&C.impliedNaturals.forEach(function(T){T.verticalPos+=7}))},a.fixKey=function(_,C){var m=Object.assign({},C);return a.addPosToKey(_,m),m};var A=function(_){var C=0,m=_[C++];(m==="^"||m==="_")&&(m=_[C++]);var T=S[m];for(T===void 0&&(T=6);C<_.length;C++)if(_[C]===",")T-=7;else if(_[C]==="'")T+=7;else break;return{mid:T-6,str:_.substring(C)}},M=function(_){for(var C=0;C<_.length;C++)_[C].note==="b"?_[C].note="B":_[C].note==="a"?_[C].note="A":_[C].note==="F"?_[C].note="f":_[C].note==="E"?_[C].note="e":_[C].note==="D"?_[C].note="d":_[C].note==="C"?_[C].note="c":_[C].note==="G"&&_[C].acc==="sharp"?_[C].note="g":_[C].note==="g"&&_[C].acc==="flat"&&(_[C].note="G")};a.parseKey=function(_,C){_.length===0&&(_="none");var m=l.tokenize(_,0,_.length),T={};if(m.length===0)return u("Must pass in key signature.",_,0),T;switch(m[0].token){case"HP":t.addDirective("bagpipes"),c.key={root:"HP",accidentals:[],acc:"",mode:""},T.foundKey=!0,m.shift();break;case"Hp":t.addDirective("bagpipes"),c.key={root:"Hp",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}],acc:"",mode:""},T.foundKey=!0,m.shift();break;case"none":c.key={root:"none",accidentals:[],acc:"",mode:""},T.foundKey=!0,m.shift();break;default:var L=l.getKeyPitch(m[0].token);if(L.len>0){T.foundKey=!0;var N="",B="";m[0].token.length>1?m[0].token=m[0].token.substring(1):m.shift();var W=L.token;if(m.length>0){var G=l.getSharpFlat(m[0].token);if(G.len>0&&(m[0].token.length>1?m[0].token=m[0].token.substring(1):m.shift(),W+=G.token,N=G.token),m.length>0){var R=l.getMode(m[0].token);R.len>0&&(m.shift(),W+=R.token,B=R.token)}if(a.standardKey(W,L.token,N,0)===void 0)return u("Unsupported key signature: "+W,_,0),T}var ye=a.deepCopyKey(c.key),q=!C&&c.globalTranspose?-c.globalTranspose:0,se;if(C&&(se=c.globalTransposeOrigKeySig),c.key=a.deepCopyKey(a.standardKey(W,L.token,N,q)),C&&(c.globalTransposeOrigKeySig=se),c.key.mode=B,ye){for(var ve,he=0;he<c.key.accidentals.length;he++)for(ve=0;ve<ye.accidentals.length;ve++)ye.accidentals[ve].note&&c.key.accidentals[he].note.toLowerCase()===ye.accidentals[ve].note.toLowerCase()&&(ye.accidentals[ve].note=null);for(ve=0;ve<ye.accidentals.length;ve++)ye.accidentals[ve].note&&(c.key.impliedNaturals||(c.key.impliedNaturals=[]),c.key.impliedNaturals.push({acc:"natural",note:ye.accidentals[ve].note}))}}break}if(m.length===0||(m[0].token==="exp"&&m.shift(),m.length===0)||(m[0].token==="oct"&&m.shift(),m.length===0))return T;var ce=l.getKeyAccidentals2(m);if(ce.warn&&u(ce.warn,_,0),ce.accs){T.foundKey||(T.foundKey=!0,c.key={root:"none",acc:"",mode:"",accidentals:[]}),M(ce.accs);for(var de=0;de<ce.accs.length;de++){for(var K=!1,Q=0;Q<c.key.accidentals.length&&!K;Q++)c.key.accidentals[Q].note===ce.accs[de].note&&(K=!0,c.key.accidentals[Q].acc!==ce.accs[de].acc&&(c.key.accidentals[Q].acc=ce.accs[de].acc,c.key.explicitAccidentals||(c.key.explicitAccidentals=[]),c.key.explicitAccidentals.push(ce.accs[de])));if(!K&&(c.key.explicitAccidentals||(c.key.explicitAccidentals=[]),c.key.explicitAccidentals.push(ce.accs[de]),c.key.accidentals.push(ce.accs[de]),c.key.impliedNaturals))for(var le=0;le<c.key.impliedNaturals.length;le++)c.key.impliedNaturals[le].note===ce.accs[de].note&&c.key.impliedNaturals.splice(le,1)}}for(var Ee;m.length>0;)switch(m[0].token){case"m":case"middle":if(m.shift(),m.length===0)return u("Expected = after middle",_,0),T;if(Ee=m.shift(),Ee.token!=="="){u("Expected = after middle",_,Ee.start);break}if(m.length===0)return u("Expected parameter after middle=",_,0),T;var Me=l.getPitchFromTokens(m);Me.warn&&u(Me.warn,_,0),Me.position&&(c.clef.verticalPos=Me.position-6);break;case"transpose":if(m.shift(),m.length===0)return u("Expected = after transpose",_,0),T;if(Ee=m.shift(),Ee.token!=="="){u("Expected = after transpose",_,Ee.start);break}if(m.length===0)return u("Expected parameter after transpose=",_,0),T;if(m[0].type!=="number"){u("Expected number after transpose",_,m[0].start);break}c.clef.transpose=m[0].intt,m.shift();break;case"stafflines":if(m.shift(),m.length===0)return u("Expected = after stafflines",_,0),T;if(Ee=m.shift(),Ee.token!=="="){u("Expected = after stafflines",_,Ee.start);break}if(m.length===0)return u("Expected parameter after stafflines=",_,0),T;if(m[0].type!=="number"){u("Expected number after stafflines",_,m[0].start);break}c.clef.stafflines=m[0].intt,m.shift();break;case"staffscale":if(m.shift(),m.length===0)return u("Expected = after staffscale",_,0),T;if(Ee=m.shift(),Ee.token!=="="){u("Expected = after staffscale",_,Ee.start);break}if(m.length===0)return u("Expected parameter after staffscale=",_,0),T;if(m[0].type!=="number"){u("Expected number after staffscale",_,m[0].start);break}c.clef.staffscale=m[0].floatt,m.shift();break;case"octave":if(m.shift(),m.length===0)return u("Expected = after octave",_,0),T;if(Ee=m.shift(),Ee.token!=="="){u("Expected = after octave",_,Ee.start);break}if(m.length===0)return u("Expected parameter after octave=",_,0),T;if(m[0].type!=="number"){u("Expected number after octave",_,m[0].start);break}c.octave=m[0].intt,m.shift();break;case"style":if(m.shift(),m.length===0)return u("Expected = after style",_,0),T;if(Ee=m.shift(),Ee.token!=="="){u("Expected = after style",_,Ee.start);break}if(m.length===0)return u("Expected parameter after style=",_,0),T;switch(m[0].token){case"normal":case"harmonic":case"rhythm":case"x":case"triangle":c.style=m[0].token,m.shift();break;default:u("error parsing style element: "+m[0].token,_,m[0].start);break}break;case"clef":if(m.shift(),m.length===0)return u("Expected = after clef",_,0),T;if(Ee=m.shift(),Ee.token!=="="){u("Expected = after clef",_,Ee.start);break}if(m.length===0)return u("Expected parameter after clef=",_,0),T;case"treble":case"bass":case"alto":case"tenor":case"perc":case"none":var H=m.shift();switch(H.token){case"treble":case"tenor":case"alto":case"bass":case"perc":case"none":break;case"C":H.token="alto";break;case"F":H.token="bass";break;case"G":H.token="treble";break;case"c":H.token="alto";break;case"f":H.token="bass";break;case"g":H.token="treble";break;default:u("Expected clef name. Found "+H.token,_,H.start);break}m.length>0&&m[0].type==="number"&&(H.token+=m[0].token,m.shift()),m.length>1&&(m[0].token==="-"||m[0].token==="+"||m[0].token==="^"||m[0].token==="_")&&m[1].token==="8"&&(H.token+=m[0].token+m[1].token,m.shift(),m.shift()),c.clef={type:H.token,verticalPos:y(H.token,0)},c.currentVoice&&c.currentVoice.transpose!==void 0&&(c.clef.transpose=c.currentVoice.transpose),T.foundClef=!0;break;default:u("Unknown parameter: "+m[0].token,_,m[0].start),m.shift()}return T};var w=function(_){var C=c.voices[_];if(!(c.currentVoice&&c.currentVoice.index===C.index&&c.currentVoice.staffNum===C.staffNum))return c.currentVoice=C,f.setCurrentVoice(C.staffNum,C.index,_)};a.parseVoice=function(_,C,m){var T=l.getMeat(_,C,m),L=T.start,N=T.end,B=l.getToken(_,L,N);if(B.length===0){u("Expected a voice id",_,L);return}var W=!1;c.voices[B]===void 0&&(c.voices[B]={},W=!0,c.score_is_present&&u("Can't have an unknown V: id when the %score directive is present",_,L)),L+=B.length,L+=l.eatWhiteSpace(_,L);for(var G={startStaff:W},R=function(Me){var H=l.getVoiceToken(_,L,N);H.warn!==void 0?u("Expected value for "+Me+" in voice: "+H.warn,_,L):H.err!==void 0?u("Expected value for "+Me+" in voice: "+H.err,_,L):H.token.length===0&&_[L]!=='"'?u("Expected value for "+Me+" in voice",_,L):G[Me]=H.token,L+=H.len},ye=function(Me,H,Y){var X=l.getVoiceToken(_,L,N);X.warn!==void 0?u("Expected value for "+H+" in voice: "+X.warn,_,L):X.err!==void 0?u("Expected value for "+H+" in voice: "+X.err,_,L):X.token.length===0&&_[L]!=='"'?u("Expected value for "+H+" in voice",_,L):(X.token=parseFloat(X.token),c.voices[Me][H]=X.token),L+=X.len},q=function(Me,H){var Y=l.getVoiceToken(_,L,N);if(Y.warn!==void 0)u("Expected value for "+Me+" in voice: "+Y.warn,_,L);else if(Y.err!==void 0)u("Expected value for "+Me+" in voice: "+Y.err,_,L);else if(Y.token.length===0&&_[L]!=='"')u("Expected value for "+Me+" in voice",_,L);else return Y.token;L+=Y.len},se=function(Me,H){var Y={_B:2,_E:9,_b:-10,_e:-3},X=l.getVoiceToken(_,L,N);if(X.warn!==void 0)u("Expected one of (_B, _E, _b, _e) for "+H+" in voice: "+X.warn,_,L);else if(X.token.length===0&&_[L]!=='"')u("Expected one of (_B, _E, _b, _e) for "+H+" in voice",_,L);else{var xe=Y[X.token];xe?c.voices[Me][H]=xe:u("Expected one of (_B, _E, _b, _e) for "+H+" in voice",_,L)}L+=X.len};L<N;){var ve=l.getVoiceToken(_,L,N);if(L+=ve.len,ve.warn)u("Error parsing voice: "+ve.warn,_,L);else{var he=null;switch(ve.token){case"clef":case"cl":R("clef");var ce=0;G.clef!==void 0&&(G.clef=G.clef.replace(/[',]/g,""),G.clef.indexOf("+16")!==-1&&(ce+=14,G.clef=G.clef.replace("+16","")),G.verticalPos=y(G.clef,ce));break;case"treble":case"bass":case"tenor":case"alto":case"perc":case"none":case"treble'":case"bass'":case"tenor'":case"alto'":case"none'":case"treble''":case"bass''":case"tenor''":case"alto''":case"none''":case"treble,":case"bass,":case"tenor,":case"alto,":case"none,":case"treble,,":case"bass,,":case"tenor,,":case"alto,,":case"none,,":var de=0;G.clef=ve.token.replace(/[',]/g,""),G.verticalPos=y(G.clef,de),c.voices[B].clef=ve.token;break;case"staves":case"stave":case"stv":R("staves");break;case"brace":case"brc":R("brace");break;case"bracket":case"brk":R("bracket");break;case"name":case"nm":R("name");break;case"subname":case"sname":case"snm":R("subname");break;case"merge":G.startStaff=!1;break;case"stem":case"stems":he=l.getVoiceToken(_,L,N),he.warn!==void 0?u("Expected value for stems in voice: "+he.warn,_,L):he.err!==void 0?u("Expected value for stems in voice: "+he.err,_,L):he.token==="up"||he.token==="down"?c.voices[B].stem=he.token:u("Expected up or down for voice stem",_,L),L+=he.len;break;case"up":case"down":c.voices[B].stem=ve.token;break;case"middle":case"m":R("verticalPos"),G.verticalPos=A(G.verticalPos).mid;break;case"gchords":case"gch":c.voices[B].suppressChords=!0,he=l.getVoiceToken(_,L,N),he.token==="0"&&(L=L+he.len);break;case"space":case"spc":R("spacing");break;case"scale":ye(B,"scale");break;case"score":se(B,"scoreTranspose");break;case"transpose":ye(B,"transpose");break;case"stafflines":ye(B,"stafflines");break;case"staffscale":ye(B,"staffscale");break;case"octave":ye(B,"octave");break;case"volume":ye(B,"volume");break;case"cue":var K=q("cue");K==="on"?c.voices[B].scale=.6:c.voices[B].scale=1;break;case"style":he=l.getVoiceToken(_,L,N),he.warn!==void 0?u("Expected value for style in voice: "+he.warn,_,L):he.err!==void 0?u("Expected value for style in voice: "+he.err,_,L):he.token==="normal"||he.token==="harmonic"||he.token==="rhythm"||he.token==="x"||he.token==="triangle"?c.voices[B].style=he.token:u("Expected one of [normal, harmonic, rhythm, x, triangle] for voice style",_,L),L+=he.len;break}}L+=l.eatWhiteSpace(_,L)}if((G.startStaff||c.staves.length===0)&&(c.staves.push({index:c.staves.length,meter:c.origMeter}),c.score_is_present||(c.staves[c.staves.length-1].numVoices=0)),c.voices[B].staffNum===void 0){c.voices[B].staffNum=c.staves.length-1;var Q=0;for(var le in c.voices)c.voices.hasOwnProperty(le)&&c.voices[le].staffNum===c.voices[B].staffNum&&Q++;c.voices[B].index=Q-1}var Ee=c.staves[c.voices[B].staffNum];return c.score_is_present||Ee.numVoices++,G.clef&&(Ee.clef={type:G.clef,verticalPos:G.verticalPos}),G.spacing&&(Ee.spacing_below_offset=G.spacing),G.verticalPos&&(Ee.verticalPos=G.verticalPos),G.name&&(Ee.name?Ee.name.push(G.name):Ee.name=[G.name]),G.subname&&(Ee.subname?Ee.subname.push(G.subname):Ee.subname=[G.subname]),w(B)}}(),Dm=a,Dm}var Rm,Kw;function UI(){if(Kw)return Rm;Kw=1;var t=Bo(),r=Uy(),a=$y(),l=function(u,c,f,p,y){this.reset=function(M,w,_,C){a.initialize(M,w,_,C,y),r.initialize(M,w,_,C,y)},this.reset(u,c,f,p),this.setTitle=function(M,w){f.hasMainTitle?y.addSubtitle(M,{startChar:f.iChar,endChar:f.iChar+w+2}):(y.addMetaText("title",M,{startChar:f.iChar,endChar:f.iChar+w+2}),f.hasMainTitle=!0)},this.setMeter=function(M){if(M=u.stripComment(M),M==="C")return f.havent_set_length===!0&&(f.default_length=.125,f.havent_set_length=!1),{type:"common_time"};if(M==="C|")return f.havent_set_length===!0&&(f.default_length=.125,f.havent_set_length=!1),{type:"cut_time"};if(M==="o")return f.havent_set_length===!0&&(f.default_length=.125,f.havent_set_length=!1),{type:"tempus_perfectum"};if(M==="c")return f.havent_set_length===!0&&(f.default_length=.125,f.havent_set_length=!1),{type:"tempus_imperfectum"};if(M==="o.")return f.havent_set_length===!0&&(f.default_length=.125,f.havent_set_length=!1),{type:"tempus_perfectum_prolatio"};if(M==="c.")return f.havent_set_length===!0&&(f.default_length=.125,f.havent_set_length=!1),{type:"tempus_imperfectum_prolatio"};if(M.length===0||M.toLowerCase()==="none")return f.havent_set_length===!0&&(f.default_length=.125,f.havent_set_length=!1),null;var w=u.tokenize(M,0,M.length);try{var _=function(){var B={value:0,num:""},W=w.shift();for(W.token==="("&&(W=w.shift());;){if(W.type!=="number")throw"Expected top number of meter";if(B.value+=parseInt(W.token),B.num+=W.token,w.length===0||w[0].token==="/")return B;if(W=w.shift(),W.token===")"){if(w.length===0||w[0].token==="/")return B;throw"Unexpected paren in meter"}if(W.token!=="."&&W.token!=="+"||(B.num+=W.token,w.length===0))throw"Expected top number of meter";W=w.shift()}return B},C=function(){var B=_();if(w.length===0)return B;var W=w.shift();if(W.token!=="/")throw"Expected slash in meter";if(W=w.shift(),W.type!=="number")throw"Expected bottom number of meter";return B.den=W.token,B.value=B.value/parseInt(B.den),B};if(w.length===0)throw"Expected meter definition in M: line";for(var m={type:"specified",value:[]},T=0;;){var L=C();T+=L.value;var N={num:L.num};if(L.den!==void 0&&(N.den=L.den),m.value.push(N),w.length===0)break}return f.havent_set_length===!0&&(f.default_length=T<.75?.0625:.125,f.havent_set_length=!1),m}catch(B){c(B,M,0)}return null},this.calcTempo=function(M){var w=.25;f.meter&&f.meter.type==="specified"?w=1/parseInt(f.meter.value[0].den):f.origMeter&&f.origMeter.type==="specified"&&(w=1/parseInt(f.origMeter.value[0].den));for(var _=0;_<M.duration;_++)M.duration[_]=w*M.duration[_];return M},this.resolveTempo=function(){f.tempo&&(this.calcTempo(f.tempo),p.metaText.tempo=f.tempo,delete f.tempo)},this.addUserDefinition=function(M,w,_){var C=M.indexOf("=",w);if(C===-1){c("Need an = in a macro definition",M,w);return}var m=t.strip(M.substring(w,C)),T=t.strip(M.substring(C+1));if(m.length!==1){c("Macro definitions can only be one character",M,w);return}var L="HIJKLMNOPQRSTUVWXYhijklmnopqrstuvw~";if(L.indexOf(m)===-1){c("Macro definitions must be H-Y, h-w, or tilde",M,w);return}if(T.length===0){c("Missing macro definition",M,w);return}f.macros===void 0&&(f.macros={}),f.macros[m]=T},this.setDefaultLength=function(M,w,_){var C=M.substring(w,_).replace(/ /g,""),m=C.split("/");if(m.length===2){var T=parseInt(m[0]),L=parseInt(m[1]);L>0&&(f.default_length=T/L,f.havent_set_length=!1)}else m.length===1&&m[0]==="1"&&(f.default_length=1,f.havent_set_length=!1)};var S={larghissimo:20,adagissimo:24,sostenuto:28,grave:32,largo:40,lento:50,larghetto:60,adagio:68,adagietto:74,andante:80,andantino:88,"marcia moderato":84,"andante moderato":100,moderato:112,allegretto:116,"allegro moderato":120,allegro:126,animato:132,agitato:140,veloce:148,"mosso vivo":156,vivace:164,vivacissimo:172,allegrissimo:176,presto:184,prestissimo:210};this.setTempo=function(M,w,_,C){try{var m=u.tokenize(M,w,_);if(m.length===0)throw"Missing parameter in Q: field";var T={startChar:C+w-2,endChar:C+_},L=!0,N=m.shift();if(N.type==="quote"&&(T.preString=N.token,N=m.shift(),m.length===0))return S[T.preString.toLowerCase()]&&(T.bpm=S[T.preString.toLowerCase()],T.suppressBpm=!0),{type:"immediate",tempo:T};if(N.type==="alpha"&&N.token==="C"){if(m.length===0)throw"Missing tempo after C in Q: field";if(N=m.shift(),N.type==="punct"&&N.token==="="){if(m.length===0)throw"Missing tempo after = in Q: field";if(N=m.shift(),N.type!=="number")throw"Expected number after = in Q: field";T.duration=[1],T.bpm=parseInt(N.token)}else if(N.type==="number"){if(T.duration=[parseInt(N.token)],m.length===0)throw"Missing = after duration in Q: field";if(N=m.shift(),N.type!=="punct"||N.token!=="=")throw"Expected = after duration in Q: field";if(m.length===0)throw"Missing tempo after = in Q: field";if(N=m.shift(),N.type!=="number")throw"Expected number after = in Q: field";T.bpm=parseInt(N.token)}else throw"Expected number or equal after C in Q: field"}else if(N.type==="number"){var B=parseInt(N.token);if(m.length===0||m[0].type==="quote")T.duration=[1],T.bpm=B;else{if(L=!1,N=m.shift(),N.type!=="punct"&&N.token!=="/"||(N=m.shift(),N.type!=="number"))throw"Expected fraction in Q: field";var W=parseInt(N.token);for(T.duration=[B/W];m.length>0&&m[0].token!=="="&&m[0].type!=="quote";){if(N=m.shift(),N.type!=="number"||(B=parseInt(N.token),N=m.shift(),N.type!=="punct"&&N.token!=="/")||(N=m.shift(),N.type!=="number"))throw"Expected fraction in Q: field";W=parseInt(N.token),T.duration.push(B/W)}if(N=m.shift(),N.type!=="punct"&&N.token!=="=")throw"Expected = in Q: field";if(N=m.shift(),N.type!=="number")throw"Expected tempo in Q: field";T.bpm=parseInt(N.token)}}else throw"Unknown value in Q: field";if(m.length!==0&&(N=m.shift(),N.type==="quote"&&(T.postString=N.token,N=m.shift()),m.length!==0))throw"Unexpected string at end of Q: field";return f.printTempo===!1&&(T.suppress=!0),{type:L?"delaySet":"immediate",tempo:T}}catch(G){return c(G,M,w),{type:"none"}}},this.letter_to_inline_header=function(M,w,_){var C=!1,m=u.eatWhiteSpace(M,w);if(w+=m,M.length>=w+5&&M[w]==="["&&M[w+2]===":"){var T=M.indexOf("]",w),L=f.iChar+w,N=f.iChar+T+1;switch(M.substring(w,w+3)){case"[I:":var B=r.addDirective(M.substring(w+3,T));return B&&c(B,M,w),[T-w+1+m];case"[M:":var W=this.setMeter(M.substring(w+3,T));return y.hasBeginMusic()&&W?y.appendStartingElement("meter",L,N,W):f.meter=W,[T-w+1+m];case"[K:":var G=a.parseKey(M.substring(w+3,T),!0);return G.foundClef&&y.hasBeginMusic()&&y.appendStartingElement("clef",L,N,f.clef),G.foundKey&&y.hasBeginMusic()&&y.appendStartingElement("key",L,N,a.fixKey(f.clef,f.key)),[T-w+1+m];case"[P:":var R=r.parseFontChangeLine(M.substring(w+3,T));return _||p.lines.length<=p.lineNum?f.partForNextLine={title:R,startChar:L,endChar:N}:y.appendElement("part",L,N,{title:R}),[T-w+1+m];case"[L:":return this.setDefaultLength(M,w+3,T),[T-w+1+m];case"[Q:":if(T>0){var ye=this.setTempo(M,w+3,T,f.iChar);return ye.type==="delaySet"?y.hasBeginMusic()?y.appendElement("tempo",L,N,this.calcTempo(ye.tempo)):f.tempoForNextLine=["tempo",L,N,this.calcTempo(ye.tempo)]:ye.type==="immediate"&&(!_&&y.hasBeginMusic()?y.appendElement("tempo",L,N,ye.tempo):f.tempoForNextLine=["tempo",L,N,ye.tempo]),[T-w+1+m,M[w+1],M.substring(w+3,T)]}break;case"[V:":if(T>0)return C=a.parseVoice(M,w+3,T),[T-w+1+m,M[w+1],M.substring(w+3,T),C];break;case"[r:":return[T-w+1+m]}}return[0]},this.letter_to_body_header=function(M,w){var _=!1;if(M.length>=w+3)switch(M.substring(w,w+2)){case"I:":var C=r.addDirective(M.substring(w+2));return C&&c(C,M,w),[M.length];case"M:":var m=this.setMeter(M.substring(w+2));return y.hasBeginMusic()&&m&&y.appendStartingElement("meter",f.iChar+w,f.iChar+M.length,m),[M.length];case"K:":var T=a.parseKey(M.substring(w+2),y.hasBeginMusic());return T.foundClef&&y.hasBeginMusic()&&y.appendStartingElement("clef",f.iChar+w,f.iChar+M.length,f.clef),T.foundKey&&y.hasBeginMusic()&&y.appendStartingElement("key",f.iChar+w,f.iChar+M.length,a.fixKey(f.clef,f.key)),[M.length];case"P:":return y.hasBeginMusic()&&y.appendElement("part",f.iChar+w,f.iChar+M.length,{title:M.substring(w+2)}),[M.length];case"L:":return this.setDefaultLength(M,w+2,M.length),[M.length];case"Q:":var L=M.indexOf("",w+2);L===-1&&(L=M.length);var N=this.setTempo(M,w+2,L,f.iChar);return N.type==="delaySet"?y.appendElement("tempo",f.iChar+w,f.iChar+M.length,this.calcTempo(N.tempo)):N.type==="immediate"&&y.appendElement("tempo",f.iChar+w,f.iChar+M.length,N.tempo),[L,M[w],t.strip(M.substring(w+2))];case"V:":return _=a.parseVoice(M,w+2,M.length),[M.length,M[w],t.strip(M.substring(w+2)),_]}return[0]};var A={A:"author",B:"book",C:"composer",D:"discography",F:"url",G:"group",I:"instruction",N:"notes",O:"origin",R:"rhythm",S:"source",W:"unalignedWords",Z:"transcription"};this.parseHeader=function(M){var w=A[M[0]],_=M.length-2,C=u.translateString(u.stripComment(M.substring(2)));if(w==="unalignedWords"||w==="notes")y.addMetaTextArray(w,r.parseFontChangeLine(C),{startChar:f.iChar,endChar:f.iChar+M.length});else if(w!==void 0)y.addMetaText(w,r.parseFontChangeLine(C),{startChar:f.iChar,endChar:f.iChar+M.length});else{var m=f.iChar,T=m+M.length;switch(M[0]){case"H":for(y.addMetaTextArray("history",r.parseFontChangeLine(C),{startChar:f.iChar,endChar:f.iChar+M.length}),M=u.peekLine();M&&M[1]!==":";)u.nextLine(),y.addMetaTextArray("history",r.parseFontChangeLine(u.translateString(u.stripComment(M))),{startChar:f.iChar,endChar:f.iChar+M.length}),M=u.peekLine();break;case"K":this.resolveTempo();var L=a.parseKey(M.substring(2),!1);!f.is_in_header&&y.hasBeginMusic()&&(L.foundClef&&y.appendStartingElement("clef",m,T,f.clef),L.foundKey&&y.appendStartingElement("key",m,T,a.fixKey(f.clef,f.key))),f.is_in_header=!1;break;case"L":this.setDefaultLength(M,2,M.length);break;case"M":f.origMeter=f.meter=this.setMeter(M.substring(2));break;case"P":f.is_in_header?y.addMetaText("partOrder",r.parseFontChangeLine(C),{startChar:f.iChar,endChar:f.iChar+M.length}):f.partForNextLine={title:C,startChar:m,endChar:T};break;case"Q":var N=this.setTempo(M,2,M.length,f.iChar);N.type==="delaySet"?f.tempo=N.tempo:N.type==="immediate"&&(p.metaText.tempo?f.tempoForNextLine=["tempo",m,T,N.tempo]:p.metaText.tempo=N.tempo);break;case"T":f.titlecaps&&(C=C.toUpperCase()),this.setTitle(r.parseFontChangeLine(u.theReverser(C)),_);break;case"U":this.addUserDefinition(M,2,M.length);break;case"V":if(a.parseVoice(M,2,M.length),!f.is_in_header)return{newline:!0};break;case"s":return{symbols:!0};case"w":return{words:!0};case"X":break;case"E":case"m":c("Ignored header",M,0);break;default:return{regular:!0}}}return{}}};return Rm=l,Rm}var bs={},Xw;function $I(){return Xw||(Xw=1,bs.legalAccents=["trill","lowermordent","uppermordent","mordent","pralltriller","accent","fermata","invertedfermata","tenuto","0","1","2","3","4","5","+","wedge","open","thumb","snap","turn","roll","breath","shortphrase","mediumphrase","longphrase","segno","coda","D.S.","D.C.","fine","beambr1","beambr2","slide","marcato","upbow","downbow","/","//","///","////","trem1","trem2","trem3","trem4","turnx","invertedturn","invertedturnx","trill(","trill)","arpeggio","xstem","mark","umarcato","style=normal","style=harmonic","style=rhythm","style=x","style=triangle","D.C.alcoda","D.C.alfine","D.S.alcoda","D.S.alfine","editorial","courtesy"],bs.volumeDecorations=["p","pp","f","ff","mf","mp","ppp","pppp","fff","ffff","sfz"],bs.dynamicDecorations=["crescendo(","crescendo)","diminuendo(","diminuendo)","glissando(","glissando)","~(","~)"],bs.accentPseudonyms=[["<","accent"],[">","accent"],["tr","trill"],["plus","+"],["emphasis","accent"],["^","umarcato"],["marcato","umarcato"]],bs.accentDynamicPseudonyms=[["<(","crescendo("],["<)","crescendo)"],[">(","diminuendo("],[">)","diminuendo)"]],bs.nonDecorations="ABCDEFGabcdefgxyzZ[]|^_{",bs.durations=[.5,.75,.875,.9375,.96875,.984375,.25,.375,.4375,.46875,.484375,.4921875,.125,.1875,.21875,.234375,.2421875,.24609375,.0625,.09375,.109375,.1171875,.12109375,.123046875,.03125,.046875,.0546875,.05859375,.060546875,.0615234375,.015625,.0234375,.02734375,.029296875,.0302734375,.03076171875],bs.pitches={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11},bs.rests={x:"invisible",X:"invisible-multimeasure",y:"spacer",z:"rest",Z:"multimeasure"},bs.accMap={dblflat:"__",flat:"_",natural:"=",sharp:"^",dblsharp:"^^",quarterflat:"_/",quartersharp:"^/"},bs.tripletQ={2:3,3:2,4:3,5:2,6:2,7:2,8:3,9:2}),bs}var Bm,Qw;function WI(){if(Qw)return Bm;Qw=1;var t=$y(),r=B9(),a,l,u,c,f,p,{legalAccents:y,volumeDecorations:S,dynamicDecorations:A,accentPseudonyms:M,accentDynamicPseudonyms:w,nonDecorations:_,durations:C,pitches:m,rests:T,accMap:L,tripletQ:N}=$I(),B=function(H,Y,X,xe,De,$e){a=H,l=Y,u=X,c=xe,f=De,p=$e,this.lineContinuation=!1},W=function(H,Y,X){if(H.inTie[Y]===void 0)return!1;var xe=H.currentVoice?H.currentVoice.staffNum*100+H.currentVoice.index:0;return!!(H.inTie[Y][xe]&&(X.pitches!==void 0||X.rest.type!=="spacer"))},G={};B.prototype.parseMusic=function(H){p.resolveTempo(),u.is_in_header=!1;for(var Y=0,X=u.iChar;a.isWhiteSpace(H[Y])&&Y<H.length;)Y++;if(!(Y===H.length||H[Y]==="%")){var xe=u.start_new_line;u.continueall===void 0?u.start_new_line=!0:u.start_new_line=!1;var De=0,$e=p.letter_to_body_header(H,Y);$e[0]>0&&(Y+=$e[0],$e[1]==="V"&&this.startNewLine());for(var Re=0;Y<H.length;){var ut=Y;if(H[Y]==="%")break;var Lt=p.letter_to_inline_header(H,Y,xe);if(Lt[0]>0)Y+=Lt[0],Lt[1]==="V"&&(xe=!0);else{(!f.hasBeginMusic()||xe&&!this.lineContinuation)&&(this.startNewLine(),xe=!1);for(var it;;)if(it=a.eatWhiteSpace(H,Y),it>0&&(Y+=it),Y>0&&H[Y-1]===""&&(it=p.letter_to_body_header(H,Y),it[0]>0&&(it[1]==="V"&&this.startNewLine(),Y=it[0],u.start_new_line=!1)),it=ce(H,Y),it[0]>0&&(Y+=it[0]),it=ye(H,Y),it[0]>0){G.chord||(G.chord=[]);var Ct=a.translateString(it[1]);Ct=Ct.replace(/;/g,`
|
|
143
|
+
`);for(var It=!1,at=0;at<G.chord.length;at++)G.chord[at].position===it[2]&&(It=!0,G.chord[at].name+=`
|
|
144
|
+
`+Ct);It===!1&&(it[2]===null&&it[3]?G.chord.push({name:Ct,rel_position:it[3]}):G.chord.push({name:Ct,position:it[2]})),Y+=it[0];var Gt=a.skipWhiteSpace(H.substring(Y));Gt>0&&(G.force_end_beam_last=!0),Y+=Gt}else if(_.indexOf(H[Y])===-1?it=he(H,Y):it=[0],it[0]>0)it[1]===null?Y+1<H.length&&this.startNewLine():it[1].length>0&&(it[1].indexOf("style=")===0?G.style=it[1].substr(6):(G.decoration===void 0&&(G.decoration=[]),it[1]==="beambr1"?G.beambr=1:it[1]==="beambr2"?G.beambr=2:G.decoration.push(it[1]))),Y+=it[0];else if(it=q(H,Y),it[0]>0)G.gracenotes=it[1],Y+=it[0];else break;if(it=de(H,Y),it[0]>0){Re=0,G.gracenotes!==void 0&&(G.rest={type:"spacer"},G.duration=.125,u.addFormattingOptions(G,c.formatting,"note"),f.appendElement("note",X+Y,X+Y+it[0],G),u.measureNotEmpty=!0,G={});var Dt={type:it[1]};Dt.type.length===0?l("Unknown bar type",H,Y):(u.inEnding&&Dt.type!=="bar_thin"&&(Dt.endEnding=!0,u.inEnding=!1),it[2]&&(Dt.startEnding=it[2],u.inEnding&&(Dt.endEnding=!0),u.inEnding=!0,it[1]==="bar_right_repeat"?u.restoreStartEndingHoldOvers():u.duplicateStartEndingHoldOvers()),G.decoration!==void 0&&(Dt.decoration=G.decoration),G.chord!==void 0&&(Dt.chord=G.chord),Dt.startEnding&&u.barFirstEndingNum===void 0?u.barFirstEndingNum=u.currBarNumber:Dt.startEnding&&Dt.endEnding&&u.barFirstEndingNum?u.currBarNumber=u.barFirstEndingNum:Dt.endEnding&&(u.barFirstEndingNum=void 0),Dt.type!=="bar_invisible"&&u.measureNotEmpty&&Me()&&(u.currBarNumber++,u.barNumbers&&u.currBarNumber%u.barNumbers===0&&(Dt.barNumber=u.currBarNumber)),u.addFormattingOptions(G,c.formatting,"bar"),f.appendElement("bar",X+ut,X+Y+it[0],Dt),u.measureNotEmpty=!1,G={}),Y+=it[0]}else if(H[Y]==="&")it=se(H,Y),it[0]>0&&(f.appendElement("overlay",X,X+1,{}),Y+=1,Re++);else{if(it=K(H,Y),it.consumed>0&&(it.startSlur!==void 0&&(G.startSlur=it.startSlur),it.dottedSlur&&(G.dottedSlur=!0),it.triplet!==void 0&&(De>0?l("Can't nest triplets",H,Y):(G.startTriplet=it.triplet,G.tripletMultiplier=it.tripletQ/it.triplet,G.tripletR=it.num_notes,De=it.num_notes===void 0?it.triplet:it.num_notes)),Y+=it.consumed),H[Y]==="["){Y++;for(var ct=null,gr=!1,vr=!1;!vr;){var er=he(H,Y);er[0]>0&&(Y+=er[0]);var Cr=le(H,Y,{},!1);if(Cr!==null&&Cr.pitch!==void 0)er[0]>0&&er[1].indexOf("style=")!==0&&(G.decoration===void 0&&(G.decoration=[]),G.decoration.push(er[1])),Cr.end_beam&&(G.end_beam=!0,delete Cr.end_beam),G.pitches===void 0?(G.duration=Cr.duration,G.pitches=[Cr]):G.pitches.push(Cr),delete Cr.duration,er[0]>0&&er[1].indexOf("style=")===0&&(G.pitches[G.pitches.length-1].style=er[1].substr(6)),u.inTieChord[G.pitches.length]&&(Cr.endTie=!0,u.inTieChord[G.pitches.length]=void 0),Cr.startTie&&(u.inTieChord[G.pitches.length]=!0),Y=Cr.endChar,delete Cr.endChar;else if(H[Y]===" ")l("Spaces are not allowed in chords",H,Y),Y++;else{if(Y<H.length&&H[Y]==="]"){Y++,u.next_note_duration!==0&&(G.duration=G.duration*u.next_note_duration,u.next_note_duration=0),W(u,Re,G)&&(G.pitches.forEach(function(o){o.endTie=!0}),R(u,Re,!1)),De>0&&!(G.rest&&G.rest.type==="spacer")&&(De--,De===0&&(G.endTriplet=!0));for(var Wr=!1;Y<H.length&&!Wr;){switch(H[Y]){case" ":case" ":Q(G);break;case")":G.endSlur===void 0?G.endSlur=1:G.endSlur++;break;case"-":G.pitches.forEach(function(o){o.startTie={}}),R(u,Re,!0);break;case">":case"<":var kr=Ee(H,Y);Y+=kr[0]-1,u.next_note_duration=kr[2],ct?ct=ct*kr[1]:ct=kr[1];break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"/":var Ue=a.getFraction(H,Y);ct=Ue.value,Y=Ue.index;var Je=H[Y];Je===" "&&(gr=!0),Je==="-"||Je===")"||Je===" "||Je==="<"||Je===">"?Y--:Wr=!0;break;case"0":ct=0;break;default:Wr=!0;break}Wr||Y++}}else l("Expected ']' to end the chords",H,Y);G.pitches!==void 0&&(ct!==null&&(G.duration=G.duration*ct,gr&&Q(G)),u.addFormattingOptions(G,c.formatting,"note"),f.appendElement("note",X+ut,X+Y,G),u.measureNotEmpty=!0,G={}),vr=!0}}}else{var Ye={},Qe=le(H,Y,Ye,!0);if(Ye.endTie!==void 0&&R(u,Re,!0),Qe!==null){Qe.pitch!==void 0?(G.pitches=[{}],Qe.accidental!==void 0&&(G.pitches[0].accidental=Qe.accidental),G.pitches[0].pitch=Qe.pitch,G.pitches[0].name=Qe.name,(Qe.midipitch||Qe.midipitch===0)&&(G.pitches[0].midipitch=Qe.midipitch),Qe.endSlur!==void 0&&(G.pitches[0].endSlur=Qe.endSlur),Qe.endTie!==void 0&&(G.pitches[0].endTie=Qe.endTie),Qe.startSlur!==void 0&&(G.pitches[0].startSlur=Qe.startSlur),G.startSlur!==void 0&&(G.pitches[0].startSlur=G.startSlur),G.dottedSlur!==void 0&&(G.pitches[0].dottedSlur=!0),Qe.startTie!==void 0&&(G.pitches[0].startTie=Qe.startTie),G.startTie!==void 0&&(G.pitches[0].startTie=G.startTie)):(G.rest=Qe.rest,Qe.rest.type==="multimeasure"&&Me()&&(u.currBarNumber+=Qe.rest.text-1),Qe.endSlur!==void 0&&(G.endSlur=Qe.endSlur),Qe.endTie!==void 0&&(G.rest.endTie=Qe.endTie),Qe.startSlur!==void 0&&(G.startSlur=Qe.startSlur),Qe.startTie!==void 0&&(G.rest.startTie=Qe.startTie),G.startTie!==void 0&&(G.rest.startTie=G.startTie)),Qe.chord!==void 0&&(G.chord=Qe.chord),Qe.duration!==void 0&&(G.duration=Qe.duration),Qe.decoration!==void 0&&(G.decoration=Qe.decoration),Qe.graceNotes!==void 0&&(G.graceNotes=Qe.graceNotes),delete G.startSlur,delete G.dottedSlur,W(u,Re,G)&&(G.pitches!==void 0?G.pitches[0].endTie=!0:G.rest.type!=="spacer"&&(G.rest.endTie=!0),R(u,Re,!1)),(Qe.startTie||G.startTie)&&R(u,Re,!0),Y=Qe.endChar,De>0&&!(Qe.rest&&Qe.rest.type==="spacer")&&(De--,De===0&&(G.endTriplet=!0)),Qe.end_beam&&Q(G),G.rest&&G.rest.type==="rest"&&G.duration===1&&ve(u)<=1&&(G.rest.type="whole",G.duration=ve(u)),G.duration<1&&C.indexOf(G.duration)===-1&&G.duration!==0&&(!G.rest||G.rest.type!=="spacer")&&l("Duration not representable: "+H.substring(ut,Y),H,Y),u.addFormattingOptions(G,c.formatting,"note");var rt=f.appendElement("note",X+ut,X+Y,G);rt||(this.startNewLine(),f.appendElement("note",X+ut,X+Y,G)),u.measureNotEmpty=!0,G={}}}Y===ut&&(H[Y]!==" "&&H[Y]!=="`"&&l("Unknown character ignored",H,Y),Y++)}}}this.lineContinuation=H.indexOf("")>=0||$e[0]>0,this.lineContinuation||(G={})}};var R=function(H,Y,X){var xe=H.currentVoice?H.currentVoice.staffNum*100+H.currentVoice.index:0;H.inTie[Y]===void 0&&(H.inTie[Y]=[]),H.inTie[Y][xe]=X},ye=function(H,Y){if(H[Y]==='"'){var X=a.getBrackettedSubstring(H,Y,5);if(X[2]||l("Missing the closing quote while parsing the chord symbol",H,Y),X[0]>0&&X[1].length>0&&X[1][0]==="^")X[1]=X[1].substring(1),X[2]="above";else if(X[0]>0&&X[1].length>0&&X[1][0]==="_")X[1]=X[1].substring(1),X[2]="below";else if(X[0]>0&&X[1].length>0&&X[1][0]==="<")X[1]=X[1].substring(1),X[2]="left";else if(X[0]>0&&X[1].length>0&&X[1][0]===">")X[1]=X[1].substring(1),X[2]="right";else if(X[0]>0&&X[1].length>0&&X[1][0]==="@"){X[1]=X[1].substring(1);var xe=a.getFloat(X[1]);if(xe.digits===0)return l("Missing first position in absolutely positioned annotation.",H,Y),X[1]=X[1].replace("@",""),X[2]="above",X;if(X[1]=X[1].substring(xe.digits),X[1][0]!==",")return l("Missing comma absolutely positioned annotation.",H,Y),X[1]=X[1].replace("@",""),X[2]="above",X;X[1]=X[1].substring(1);var De=a.getFloat(X[1]);if(De.digits===0)return l("Missing second position in absolutely positioned annotation.",H,Y),X[1]=X[1].replace("@",""),X[2]="above",X;X[1]=X[1].substring(De.digits);var $e=a.skipWhiteSpace(X[1]);X[1]=X[1].substring($e),X[2]=null,X[3]={x:xe.value,y:De.value}}else u.freegchord!==!0&&(X[1]=X[1].replace(/([ABCDEFG0-9])b/g,"$1♭"),X[1]=X[1].replace(/([ABCDEFG0-9])#/g,"$1♯"),X[1]=X[1].replace(/^([ABCDEFG])([♯♭]?)o([^A-Za-z])/g,"$1$2°$3"),X[1]=X[1].replace(/^([ABCDEFG])([♯♭]?)o$/g,"$1$2°"),X[1]=X[1].replace(/^([ABCDEFG])([♯♭]?)0([^A-Za-z])/g,"$1$2ø$3"),X[1]=X[1].replace(/^([ABCDEFG])([♯♭]?)\^([^A-Za-z])/g,"$1$2∆$3")),X[2]="default",X[1]=r.chordName(u,X[1]);return X}return[0,""]},q=function(H,Y){if(H[Y]==="{"){var X=a.getBrackettedSubstring(H,Y,1,"}");X[2]||l("Missing the closing '}' while parsing grace note",H,Y),H[Y+X[0]]===")"&&(X[0]++,X[1]+=")");for(var xe=[],De=0,$e=!1;De<X[1].length;){var Re=!1;X[1][De]==="/"&&(Re=!0,De++);var ut=le(X[1],De,{},!1);ut!==null?(ut.duration=ut.duration/(u.default_length*8),Re&&(ut.acciaccatura=!0),ut.rest?l("Rests not allowed as grace notes '"+X[1][De]+"' while parsing grace note",H,Y):xe.push(ut),$e&&(ut.endTie=!0,$e=!1),ut.startTie&&($e=!0),De=ut.endChar,delete ut.endChar,ut.end_beam&&(ut.endBeam=!0,delete ut.end_beam)):(X[1][De]===" "?xe.length>0&&(xe[xe.length-1].endBeam=!0):l("Unknown character '"+X[1][De]+"' while parsing grace note",H,Y),De++)}if(xe.length)return[X[0],xe]}return[0]};function se(H,Y){if(H[Y]==="&"){for(var X=Y;H[Y]&&H[Y]!==":"&&H[Y]!=="|";)Y++;return[Y-X,H.substring(X+1,Y)]}return[0]}function ve(H){var Y=H.origMeter;return!Y||Y.type!=="specified"||!Y.value||Y.value.length===0?1:parseInt(Y.value[0].num,10)/parseInt(Y.value[0].den,10)}var he=function(H,Y){var X=u.macros[H[Y]];if(X!==void 0)return(X[0]==="!"||X[0]==="+")&&(X=X.substring(1)),(X[X.length-1]==="!"||X[X.length-1]==="+")&&(X=X.substring(0,X.length-1)),y.includes(X)?[1,X]:S.includes(X)?(u.volumePosition==="hidden"&&(X=""),[1,X]):A.includes(X)?(u.dynamicPosition==="hidden"&&(X=""),[1,X]):(u.ignoredDecorations.includes(X)||l("Unknown macro: "+X,H,Y),[1,""]);switch(H[Y]){case".":if(H[Y+1]==="("||H[Y+1]==="-")break;return[1,"staccato"];case"u":return[1,"upbow"];case"v":return[1,"downbow"];case"~":return[1,"irishroll"];case"!":case"+":var xe=a.getBrackettedSubstring(H,Y,5);if(xe[1].length>1&&(xe[1][0]==="^"||xe[1][0]==="_")&&(xe[1]=xe[1].substring(1)),y.includes(xe[1]))return xe;if(S.includes(xe[1]))return u.volumePosition==="hidden"&&(xe[1]=""),xe;if(A.includes(xe[1]))return u.dynamicPosition==="hidden"&&(xe[1]=""),xe;var De=M.findIndex(function($e){return xe[1]===$e[0]});return De>=0?(xe[1]=M[De][1],xe):(De=w.findIndex(function($e){return xe[1]===$e[0]}),De>=0?(xe[1]=w[De][1],u.dynamicPosition==="hidden"&&(xe[1]=""),xe):H[Y]==="!"&&(xe[0]===1||H[Y+xe[0]-1]!=="!")?[1,null]:(l("Unknown decoration: "+xe[1],H,Y),xe[1]="",xe));case"H":return[1,"fermata"];case"J":return[1,"slide"];case"L":return[1,"accent"];case"M":return[1,"mordent"];case"O":return[1,"coda"];case"P":return[1,"pralltriller"];case"R":return[1,"roll"];case"S":return[1,"segno"];case"T":return[1,"trill"]}return[0,0]},ce=function(H,Y){for(var X=Y;a.isWhiteSpace(H[Y]);)Y++;return[Y-X]},de=function(H,Y){var X=a.getBarLine(H,Y);if(X.len===0)return[0,""];if(X.warn)return l(X.warn,H,Y),[X.len,""];for(var xe=0;xe<H.length&&H[Y+X.len+xe]===" ";xe++);var De=X.len;if(H[Y+X.len+xe]==="["&&(X.len+=xe+1),H[Y+X.len]==='"'&&H[Y+X.len-1]==="["){var $e=a.getBrackettedSubstring(H,Y+X.len,5);return[X.len+$e[0],X.token,$e[1]]}var Re=a.getTokenOf(H.substring(Y+X.len),"1234567890-,");return Re.len===0||Re.token[0]==="-"?[De,X.token]:[X.len+Re.len,X.token,Re.token]},K=function(H,Y){var X={},xe=Y;for(H[Y]==="."&&H[Y+1]==="("&&(X.dottedSlur=!0,Y++);H[Y]==="("||a.isWhiteSpace(H[Y]);)H[Y]==="("&&(Y+1<H.length&&H[Y+1]>="2"&&H[Y+1]<="9"?(X.triplet!==void 0?l("Can't nest triplets",H,Y):(X.triplet=H[Y+1]-"0",X.tripletQ=N[X.triplet],X.num_notes=X.triplet,Y+2<H.length&&H[Y+2]===":"&&(Y+3<H.length&&H[Y+3]===":"?Y+4<H.length&&H[Y+4]>="1"&&H[Y+4]<="9"?(X.num_notes=H[Y+4]-"0",Y+=3):l("expected number after the two colons after the triplet to mark the duration",H,Y):Y+3<H.length&&H[Y+3]>="1"&&H[Y+3]<="9"?(X.tripletQ=H[Y+3]-"0",Y+4<H.length&&H[Y+4]===":"?Y+5<H.length&&H[Y+5]>="1"&&H[Y+5]<="9"&&(X.num_notes=H[Y+5]-"0",Y+=4):Y+=2):l("expected number after the triplet to mark the duration",H,Y))),Y++):X.startSlur===void 0?X.startSlur=1:X.startSlur++),Y++;return X.consumed=Y-xe,X};B.prototype.startNewLine=function(){var H={startChar:-1,endChar:-1};u.partForNextLine.title&&(H.part=u.partForNextLine),H.clef=u.currentVoice&&u.staves[u.currentVoice.staffNum].clef!==void 0?Object.assign({},u.staves[u.currentVoice.staffNum].clef):Object.assign({},u.clef);var Y=u.currentVoice?u.currentVoice.scoreTranspose:0;if(H.key=t.standardKey(u.key.root+u.key.acc+u.key.mode,u.key.root,u.key.acc,Y),H.key.mode=u.key.mode,u.key.impliedNaturals&&(H.key.impliedNaturals=u.key.impliedNaturals),u.key.explicitAccidentals)for(var X=0;X<u.key.explicitAccidentals.length;X++){for(var xe=!1,De=0;De<H.key.accidentals.length;De++)H.key.accidentals[De].note===u.key.explicitAccidentals[X].note&&(H.key.accidentals[De].acc=u.key.explicitAccidentals[X].acc,xe=!0);xe||H.key.accidentals.push(u.key.explicitAccidentals[X])}if(u.targetKey=H.key,H.key.explicitAccidentals&&delete H.key.explicitAccidentals,t.addPosToKey(H.clef,H.key),u.meter!==null?(u.currentVoice?(u.staves.forEach(function(Lt){Lt.meter=u.meter}),H.meter=u.staves[u.currentVoice.staffNum].meter,u.staves[u.currentVoice.staffNum].meter=null):H.meter=u.meter,u.meter=null):u.currentVoice&&u.staves[u.currentVoice.staffNum].meter&&(H.meter=u.staves[u.currentVoice.staffNum].meter,u.staves[u.currentVoice.staffNum].meter=null),u.currentVoice&&u.currentVoice.name&&(H.name=u.currentVoice.name),u.vocalfont&&(H.vocalfont=u.vocalfont),u.tripletfont&&(H.tripletfont=u.tripletfont),u.gchordfont&&(H.gchordfont=u.gchordfont),u.style&&(H.style=u.style),u.currentVoice){var $e=u.staves[u.currentVoice.staffNum];$e.brace&&(H.brace=$e.brace),$e.bracket&&(H.bracket=$e.bracket),$e.connectBarLines&&(H.connectBarLines=$e.connectBarLines),$e.name&&(H.name=$e.name[u.currentVoice.index]),$e.subname&&(H.subname=$e.subname[u.currentVoice.index]),u.currentVoice.stem&&(H.stem=u.currentVoice.stem),u.currentVoice.stafflines&&(H.stafflines=u.currentVoice.stafflines),u.currentVoice.staffscale&&(H.staffscale=u.currentVoice.staffscale),u.currentVoice.scale&&(H.scale=u.currentVoice.scale),u.currentVoice.color&&(H.color=u.currentVoice.color),u.currentVoice.style&&(H.style=u.currentVoice.style),u.currentVoice.transpose&&(H.clef.transpose=u.currentVoice.transpose),H.currentVoice=u.currentVoice;for(var Re=Object.keys(u.voices),ut=0;ut<Re.length;ut++)H.currentVoice.staffNum===u.voices[Re[ut]].staffNum&&H.currentVoice.index===u.voices[Re[ut]].index&&(H.currentVoiceName=Re[ut])}u.barNumbers===0&&Me()&&u.currBarNumber!==1&&(H.barNumber=u.currBarNumber),f.startNewLine(H),u.key.impliedNaturals&&delete u.key.impliedNaturals,u.partForNextLine={},u.tempoForNextLine.length===4&&f.appendElement(u.tempoForNextLine[0],u.tempoForNextLine[1],u.tempoForNextLine[2],u.tempoForNextLine[3]),u.tempoForNextLine=[]};var Q=function(H){return H.duration!==void 0&&H.duration<.25&&(H.end_beam=!0),H},le=function(H,Y,X,xe){var De=function(at){return at==="octave"||at==="duration"||at==="Zduration"||at==="broken_rhythm"||at==="end_slur"},$e;H[Y]==="."&&H[Y+1]==="-"&&($e=!0,Y++);for(var Re="startSlur",ut=!1;;){switch(H[Y]){case"(":if(Re==="startSlur")X.startSlur===void 0?X.startSlur=1:X.startSlur++;else return De(Re)?(X.endChar=Y,X):null;break;case")":if(De(Re))X.endSlur===void 0?X.endSlur=1:X.endSlur++;else return null;break;case"^":if(Re==="startSlur")X.accidental="sharp",Re="sharp2";else if(Re==="sharp2")X.accidental="dblsharp",Re="pitch";else return De(Re)?(X.endChar=Y,X):null;break;case"_":if(Re==="startSlur")X.accidental="flat",Re="flat2";else if(Re==="flat2")X.accidental="dblflat",Re="pitch";else return De(Re)?(X.endChar=Y,X):null;break;case"=":if(Re==="startSlur")X.accidental="natural",Re="pitch";else return De(Re)?(X.endChar=Y,X):null;break;case"A":case"B":case"C":case"D":case"E":case"F":case"G":case"a":case"b":case"c":case"d":case"e":case"f":case"g":if(Re==="startSlur"||Re==="sharp2"||Re==="flat2"||Re==="pitch"){if(X.pitch=m[H[Y]],X.pitch+=7*(u.currentVoice&&u.currentVoice.octave!==void 0?u.currentVoice.octave:u.octave),X.name=H[Y],X.accidental&&(X.name=L[X.accidental]+X.name),r.note(u,X),Re="octave",xe&&u.next_note_duration!==0?(X.duration=u.default_length*u.next_note_duration,u.next_note_duration=0,ut=!0):X.duration=u.default_length,u.clef&&u.clef.type==="perc"||u.currentVoice&&u.currentVoice.clef==="perc"){var Lt=H[Y];X.accidental&&(Lt=L[X.accidental]+Lt),c.formatting&&c.formatting.midi&&c.formatting.midi.drummap&&(X.midipitch=c.formatting.midi.drummap[Lt])}}else return De(Re)?(X.endChar=Y,X):null;break;case",":if(Re==="octave")X.pitch-=7,X.name+=",";else return De(Re)?(X.endChar=Y,X):null;break;case"'":if(Re==="octave")X.pitch+=7,X.name+="'";else return De(Re)?(X.endChar=Y,X):null;break;case"x":case"X":case"y":case"z":case"Z":if(Re==="startSlur")X.rest={type:T[H[Y]]},delete X.accidental,delete X.startSlur,delete X.startTie,delete X.endSlur,delete X.endTie,delete X.end_beam,delete X.grace_notes,X.rest.type.indexOf("multimeasure")>=0?(X.duration=c.getBarLength(),X.rest.text=1,Re="Zduration"):(xe&&u.next_note_duration!==0?(X.duration=u.default_length*u.next_note_duration,u.next_note_duration=0,ut=!0):X.duration=u.default_length,Re="duration");else return De(Re)?(X.endChar=Y,X):null;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"0":case"/":if(Re==="octave"||Re==="duration"){var it=a.getFraction(H,Y);for(X.duration=X.duration*it.value,X.endChar=it.index;it.index<H.length&&(a.isWhiteSpace(H[it.index])||H[it.index]==="-");)H[it.index]==="-"?X.startTie={}:X=Q(X),it.index++;Y=it.index-1,Re="broken_rhythm"}else if(Re==="sharp2")X.accidental="quartersharp",Re="pitch";else if(Re==="flat2")X.accidental="quarterflat",Re="pitch";else if(Re==="Zduration"){var Ct=a.getNumber(H,Y);return X.duration=Ct.num*c.getBarLength(),X.rest.text=Ct.num,X.endChar=Ct.index,X}else return null;break;case"-":if(Re==="startSlur")f.addTieToLastNote($e),X.endTie=!0;else if(Re==="octave"||Re==="duration"||Re==="end_slur")if(X.startTie={},!ut&&xe)Re="broken_rhythm";else return a.isWhiteSpace(H[Y+1])&&Q(X),X.endChar=Y+1,X;else return Re==="broken_rhythm"?(X.endChar=Y,X):null;break;case" ":case" ":if(De(Re)){X.end_beam=!0,$e=!1;do H[Y]==="."&&H[Y+1]==="-"&&($e=!0,Y++),H[Y]==="-"&&(X.startTie={},$e&&(X.startTie.style="dotted")),Y++;while(Y<H.length&&(a.isWhiteSpace(H[Y])||H[Y]==="-")||H[Y]==="."&&H[Y+1]==="-");if(X.endChar=Y,!ut&&xe&&(H[Y]==="<"||H[Y]===">"))Y--,Re="broken_rhythm";else return X}else return null;break;case">":case"<":if(De(Re))if(xe){var It=Ee(H,Y);Y+=It[0]-1,u.next_note_duration=It[2],X.duration=It[1]*X.duration,Re="end_slur"}else return X.endChar=Y,X;else return null;break;default:return De(Re)?(X.endChar=Y,X):null}if(Y++,Y===H.length)return De(Re)?(X.endChar=Y,X):null}return null},Ee=function(H,Y){switch(H[Y]){case">":return Y<H.length-2&&H[Y+1]===">"&&H[Y+2]===">"?[3,1.875,.125]:Y<H.length-1&&H[Y+1]===">"?[2,1.75,.25]:[1,1.5,.5];case"<":return Y<H.length-2&&H[Y+1]==="<"&&H[Y+2]==="<"?[3,.125,1.875]:Y<H.length-1&&H[Y+1]==="<"?[2,.25,1.75]:[1,.5,1.5]}return null};function Me(){return u.currentVoice===void 0||u.currentVoice.staffNum===0&&u.currentVoice.index===0}return Bm=B,Bm}var Fm,Zw;function GI(){if(Zw)return Fm;Zw=1;var t=Bo(),r=function(a,l){this.lineIndex=0,this.lines=a,this.multilineVars=l,this.skipWhiteSpace=function(_){for(var C=0;C<_.length;C++)if(!this.isWhiteSpace(_[C]))return C;return _.length};var u=function(_,C){return C>=_.length};this.eatWhiteSpace=function(_,C){for(var m=C;m<_.length;m++)if(!this.isWhiteSpace(_[m]))return m-C;return m-C},this.getKeyPitch=function(_){var C=this.skipWhiteSpace(_);if(u(_,C))return{len:0};switch(_[C]){case"A":return{len:C+1,token:"A"};case"B":return{len:C+1,token:"B"};case"C":return{len:C+1,token:"C"};case"D":return{len:C+1,token:"D"};case"E":return{len:C+1,token:"E"};case"F":return{len:C+1,token:"F"};case"G":return{len:C+1,token:"G"}}return{len:0}},this.getSharpFlat=function(_){if(_==="bass")return{len:0};switch(_[0]){case"#":return{len:1,token:"#"};case"b":return{len:1,token:"b"}}return{len:0}},this.getMode=function(_){var C=function(L,N){for(;N<L.length&&(L[N]>="a"&&L[N]<="z"||L[N]>="A"&&L[N]<="Z");)N++;return N},m=this.skipWhiteSpace(_);if(u(_,m))return{len:0};var T=_.substring(m,m+3).toLowerCase();switch((T.length>1&&T[1]===" "||T[1]==="^"||T[1]==="_"||T[1]==="=")&&(T=T[0]),T){case"mix":return{len:C(_,m),token:"Mix"};case"dor":return{len:C(_,m),token:"Dor"};case"phr":return{len:C(_,m),token:"Phr"};case"lyd":return{len:C(_,m),token:"Lyd"};case"loc":return{len:C(_,m),token:"Loc"};case"aeo":return{len:C(_,m),token:"m"};case"maj":return{len:C(_,m),token:""};case"ion":return{len:C(_,m),token:""};case"min":return{len:C(_,m),token:"m"};case"m":return{len:C(_,m),token:"m"}}return{len:0}},this.getClef=function(_,C){var m=_,T=this.skipWhiteSpace(_);if(u(_,T))return{len:0};var L=!1,N=_.substring(T);if(t.startsWith(N,"clef=")&&(L=!0,N=N.substring(5),T+=5),N.length===0&&L)return{len:T+5,warn:"No clef specified: "+m};var B=this.skipWhiteSpace(N);if(u(N,B))return{len:0};B>0&&(T+=B,N=N.substring(B));var W=null;if(t.startsWith(N,"treble"))W="treble";else if(t.startsWith(N,"bass3"))W="bass3";else if(t.startsWith(N,"bass"))W="bass";else if(t.startsWith(N,"tenor"))W="tenor";else if(t.startsWith(N,"alto2"))W="alto2";else if(t.startsWith(N,"alto1"))W="alto1";else if(t.startsWith(N,"alto"))W="alto";else if(!C&&L&&t.startsWith(N,"none"))W="none";else if(t.startsWith(N,"perc"))W="perc";else if(!C&&L&&t.startsWith(N,"C"))W="tenor";else if(!C&&L&&t.startsWith(N,"F"))W="bass";else if(!C&&L&&t.startsWith(N,"G"))W="treble";else return{len:T+5,warn:"Unknown clef specified: "+m};return N=N.substring(W.length),B=this.isMatch(N,"+8"),B>0?W+="+8":(B=this.isMatch(N,"-8"),B>0&&(W+="-8")),{len:T+W.length,token:W,explicit:L}},this.getBarLine=function(_,C){switch(_[C]){case"]":switch(++C,_[C]){case"|":return{len:2,token:"bar_thick_thin"};case"[":return++C,_[C]>="1"&&_[C]<="9"||_[C]==='"'?{len:2,token:"bar_invisible"}:{len:1,warn:"Unknown bar symbol"};default:return{len:1,token:"bar_invisible"}}case":":switch(++C,_[C]){case":":return{len:2,token:"bar_dbl_repeat"};case"|":switch(++C,_[C]){case"]":switch(++C,_[C]){case"|":return++C,_[C]===":"?{len:5,token:"bar_dbl_repeat"}:{len:3,token:"bar_right_repeat"};default:return{len:3,token:"bar_right_repeat"}}case"|":return++C,_[C]===":"?{len:4,token:"bar_dbl_repeat"}:{len:3,token:"bar_right_repeat"};default:return{len:2,token:"bar_right_repeat"}}default:return{len:1,warn:"Unknown bar symbol"}}case"[":if(++C,_[C]==="|")switch(++C,_[C]){case":":return{len:3,token:"bar_left_repeat"};case"]":return{len:3,token:"bar_invisible"};default:return{len:2,token:"bar_thick_thin"}}else return _[C]>="1"&&_[C]<="9"||_[C]==='"'?{len:1,token:"bar_invisible"}:{len:0};case"|":switch(++C,_[C]){case"]":return{len:2,token:"bar_thin_thick"};case"|":return++C,_[C]===":"?{len:3,token:"bar_left_repeat"}:{len:2,token:"bar_thin_thin"};case":":for(var m=0;_[C+m]===":";)m++;return{len:1+m,token:"bar_left_repeat"};default:return{len:1,token:"bar_thin"}}}return{len:0}},this.getTokenOf=function(_,C){for(var m=0;m<_.length;m++)if(C.indexOf(_[m])<0)return{len:m,token:_.substring(0,m)};return{len:m,token:_}},this.getToken=function(_,C,m){for(var T=C;T<m&&!this.isWhiteSpace(_[T]);)T++;return _.substring(C,T)},this.isMatch=function(_,C){var m=this.skipWhiteSpace(_);return u(_,m)?0:t.startsWith(_.substring(m),C)?m+C.length:0},this.getPitchFromTokens=function(_){var C={},m={A:5,B:6,C:0,D:1,E:2,F:3,G:4,a:12,b:13,c:7,d:8,e:9,f:10,g:11};if(C.position=m[_[0].token],C.position===void 0)return{warn:"Pitch expected. Found: "+_[0].token};for(_.shift();_.length;)switch(_[0].token){case",":C.position-=7,_.shift();break;case"'":C.position+=7,_.shift();break;default:return C}return C},this.getKeyAccidentals2=function(_){for(var C;_.length>0;){var m;if(_[0].token==="^"){if(m="sharp",_.shift(),_.length===0)return{accs:C,warn:"Expected note name after "+m};switch(_[0].token){case"^":m="dblsharp",_.shift();break;case"/":m="quartersharp",_.shift();break}}else if(_[0].token==="=")m="natural",_.shift();else if(_[0].token==="_"){if(m="flat",_.shift(),_.length===0)return{accs:C,warn:"Expected note name after "+m};switch(_[0].token){case"_":m="dblflat",_.shift();break;case"/":m="quarterflat",_.shift();break}}else return{accs:C};if(_.length===0)return{accs:C,warn:"Expected note name after "+m};switch(_[0].token[0]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":C===void 0&&(C=[]),C.push({acc:m,note:_[0].token[0]}),_[0].token.length===1?_.shift():_[0].token=_[0].token.substring(1);break;default:return{accs:C,warn:"Expected note name after "+m+" Found: "+_[0].token}}}return{accs:C}},this.getKeyAccidental=function(_){var C={"^":"sharp","^^":"dblsharp","=":"natural",_:"flat",__:"dblflat","_/":"quarterflat","^/":"quartersharp"},m=this.skipWhiteSpace(_);if(u(_,m))return{len:0};var T=null;switch(_[m]){case"^":case"_":case"=":T=_[m];break;default:return{len:0}}if(m++,u(_,m))return{len:1,warn:"Expected note name after accidental"};switch(_[m]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":return{len:m+1,token:{acc:C[T],note:_[m]}};case"^":case"_":case"/":if(T+=_[m],m++,u(_,m))return{len:2,warn:"Expected note name after accidental"};switch(_[m]){case"a":case"b":case"c":case"d":case"e":case"f":case"g":case"A":case"B":case"C":case"D":case"E":case"F":case"G":return{len:m+1,token:{acc:C[T],note:_[m]}};default:return{len:2,warn:"Expected note name after accidental"}}break;default:return{len:1,warn:"Expected note name after accidental"}}},this.isWhiteSpace=function(_){return _===" "||_===" "||_===""},this.getMeat=function(_,C,m){var T=_.indexOf("%",C);for(T>=0&&T<m&&(m=T);C<m&&(_[C]===" "||_[C]===" "||_[C]==="");)C++;for(;C<m&&(_[m-1]===" "||_[m-1]===" "||_[m-1]==="");)m--;return{start:C,end:m}};var c=function(_){return _>="A"&&_<="Z"||_>="a"&&_<="z"},f=function(_){return _>="0"&&_<="9"};this.tokenize=function(_,C,m,T){var L=this.getMeat(_,C,m);C=L.start,m=L.end;for(var N=[],B;C<m;){if(_[C]==='"'){for(B=C+1;B<m&&_[B]!=='"';)B++;N.push({type:"quote",token:_.substring(C+1,B),start:C+1,end:B}),B++}else if(c(_[C])){if(B=C+1,T)for(;B<m&&!this.isWhiteSpace(_[B]);)B++;else for(;B<m&&c(_[B]);)B++;N.push({type:"alpha",token:_.substring(C,B),continueId:f(_[B]),start:C,end:B}),C=B+1}else if(_[C]==="."&&f(_[B+1])){B=C+1;for(var W=null,G=null;B<m&&f(_[B]);)B++;G=parseFloat(_.substring(C,B)),N.push({type:"number",token:_.substring(C,B),intt:W,floatt:G,continueId:c(_[B]),start:C,end:B}),C=B+1}else if(f(_[C])||_[C]==="-"&&f(_[B+1])){B=C+1;for(var R=null,ye=null;B<m&&f(_[B]);)B++;if(_[B]==="."&&f(_[B+1]))for(B++;B<m&&f(_[B]);)B++;else R=parseInt(_.substring(C,B));ye=parseFloat(_.substring(C,B)),N.push({type:"number",token:_.substring(C,B),intt:R,floatt:ye,continueId:c(_[B]),start:C,end:B}),C=B+1}else _[C]===" "||_[C]===" "||N.push({type:"punct",token:_[C],start:C,end:C+1}),B=C+1;C=B}return N},this.getVoiceToken=function(_,C,m){for(var T=C;T<m&&this.isWhiteSpace(_[T])||_[T]==="=";)T++;if(_[T]==='"'){var L=_.indexOf('"',T+1);return L===-1||L>=m?{len:1,err:"Missing close quote"}:{len:L-C+1,token:this.translateString(_.substring(T+1,L))}}else{for(var N=T;N<m&&!this.isWhiteSpace(_[N])&&_[N]!=="=";)N++;return{len:N-C+1,token:_.substring(T,N)}}};var p={"`a":"à","'a":"á","^a":"â","~a":"ã",'"a':"ä",oa:"å",aa:"å","=a":"ā",ua:"ă",";a":"ą","`e":"è","'e":"é","^e":"ê",'"e':"ë","=e":"ē",ue:"ĕ",";e":"ę",".e":"ė","`i":"ì","'i":"í","^i":"î",'"i':"ï","=i":"ī",ui:"ĭ",";i":"į","`o":"ò","'o":"ó","^o":"ô","~o":"õ",'"o':"ö","=o":"ō",uo:"ŏ","/o":"ø","`u":"ù","'u":"ú","^u":"û","~u":"ũ",'"u':"ü",ou:"ů","=u":"ū",uu:"ŭ",";u":"ų","`A":"À","'A":"Á","^A":"Â","~A":"Ã",'"A':"Ä",oA:"Å",AA:"Å","=A":"Ā",uA:"Ă",";A":"Ą","`E":"È","'E":"É","^E":"Ê",'"E':"Ë","=E":"Ē",uE:"Ĕ",";E":"Ę",".E":"Ė","`I":"Ì","'I":"Í","^I":"Î","~I":"Ĩ",'"I':"Ï","=I":"Ī",uI:"Ĭ",";I":"Į",".I":"İ","`O":"Ò","'O":"Ó","^O":"Ô","~O":"Õ",'"O':"Ö","=O":"Ō",uO:"Ŏ","/O":"Ø","`U":"Ù","'U":"Ú","^U":"Û","~U":"Ũ",'"U':"Ü",oU:"Ů","=U":"Ū",uU:"Ŭ",";U":"Ų",ae:"æ",AE:"Æ",oe:"œ",OE:"Œ",ss:"ß","'c":"ć","^c":"ĉ",uc:"č",cc:"ç",".c":"ċ",cC:"Ç","'C":"Ć","^C":"Ĉ",uC:"Č",".C":"Ċ","~N":"Ñ","~n":"ñ","=s":"š",vs:"š",DH:"Ð",dh:"ð",HO:"Ő",Ho:"ő",HU:"Ű",Hu:"ű","'Y":"Ý","'y":"ý","^Y":"Ŷ","^y":"ŷ",'"Y':"Ÿ",'"y':"ÿ",vS:"Š",vZ:"Ž",vz:"ž"},y={"#":"♯",b:"♭","=":"♮"},S={201:"♯",202:"♭",203:"♮",241:"¡",242:"¢",252:"a",262:"2",272:"o",302:"Â",312:"Ê",322:"Ò",332:"Ú",342:"â",352:"ê",362:"ò",372:"ú",243:"£",253:"«",263:"3",273:"»",303:"Ã",313:"Ë",323:"Ó",333:"Û",343:"ã",353:"ë",363:"ó",373:"û",244:"¤",254:"¬",264:" ́",274:"1⁄4",304:"Ä",314:"Ì",324:"Ô",334:"Ü",344:"ä",354:"ì",364:"ô",374:"ü",245:"¥",255:"-",265:"μ",275:"1⁄2",305:"Å",315:"Í",325:"Õ",335:"Ý",345:"å",355:"í",365:"õ",375:"ý",246:"¦",256:"®",266:"¶",276:"3⁄4",306:"Æ",316:"Î",326:"Ö",336:"Þ",346:"æ",356:"î",366:"ö",376:"þ",247:"§",257:" ̄",267:"·",277:"¿",307:"Ç",317:"Ï",327:"×",337:"ß",347:"ç",357:"ï",367:"÷",377:"ÿ",250:" ̈",260:"°",270:" ̧",300:"À",310:"È",320:"Ð",330:"Ø",340:"à",350:"è",360:"ð",370:"ø",251:"©",261:"±",271:"1",301:"Á",311:"É",321:"Ñ",331:"Ù",341:"á",351:"é",361:"ñ",371:"ù"};this.translateString=function(_){var C=_.split("\\");if(C.length===1)return _;var m=null;return C.forEach(function(T){if(m===null)m=T;else{var L=p[T.substring(0,2)];L!==void 0?m+=L+T.substring(2):(L=S[T.substring(0,3)],L!==void 0?m+=L+T.substring(3):(L=y[T.substring(0,1)],L!==void 0?m+=L+T.substring(1):m+="\\"+T))}}),m},this.getNumber=function(_,C){for(var m=0;C<_.length;)switch(_[C]){case"0":m=m*10,C++;break;case"1":m=m*10+1,C++;break;case"2":m=m*10+2,C++;break;case"3":m=m*10+3,C++;break;case"4":m=m*10+4,C++;break;case"5":m=m*10+5,C++;break;case"6":m=m*10+6,C++;break;case"7":m=m*10+7,C++;break;case"8":m=m*10+8,C++;break;case"9":m=m*10+9,C++;break;default:return{num:m,index:C}}return{num:m,index:C}},this.getFraction=function(_,C){var m=1,T=1;if(_[C]!=="/"){var L=this.getNumber(_,C);m=L.num,C=L.index}if(_[C]==="/")if(C++,_[C]==="/"){for(var N=.5;_[C++]==="/";)N=N/2;return{value:m*N,index:C-1}}else{var B=C,W=this.getNumber(_,C);W.num===0&&B===C&&(W.num=2),W.num!==0&&(T=W.num),C=W.index}return{value:m/T,index:C}};function A(_){const m=/^(\d+)\./.exec(_);return m?m[1]:null}var M=[{match:/,\s*[Tt]he$/,replace:"The "},{match:/,\s*[Aa]$/,replace:"A "},{match:/,\s*[Aa]n$/,replace:"An "}];this.theReverser=function(_){for(var C=0;C<M.length;C++){var m=M[C],T=_.match(m.match);if(T){var L=A(_);L&&(_=_.replace(L+".",""),_=_.trim());var N=T[0].length,B=m.replace+_.substring(0,_.length-N);return L&&(B=L+". "+B),B}}return _},this.stripComment=function(_){var C=_.indexOf("%");return C>=0?t.strip(_.substring(0,C)):t.strip(_)},this.getInt=function(_){var C=parseInt(_);if(isNaN(C))return{digits:0};var m=""+C,T=_.indexOf(m);return{value:C,digits:T+m.length}},this.getFloat=function(_){var C=parseFloat(_);if(isNaN(C))return{digits:0};var m=""+C,T=_.indexOf(m);return{value:C,digits:T+m.length}},this.getMeasurement=function(_){if(_.length===0)return{used:0};var C=1,m="";if(_[0].token==="-")_.shift(),m="-",C++;else if(_[0].type!=="number")return{used:0};if(m+=_.shift().token,_.length===0)return{used:1,value:parseInt(m)};var T=_.shift();if(T.token==="."){if(C++,_.length===0)return{used:C,value:parseInt(m)};if(_[0].type==="number"&&(T=_.shift(),m=m+"."+T.token,C++,_.length===0))return{used:C,value:parseFloat(m)};T=_.shift()}switch(T.token){case"pt":return{used:C+1,value:parseFloat(m)};case"px":return{used:C+1,value:parseFloat(m)};case"cm":return{used:C+1,value:parseFloat(m)/2.54*72};case"in":return{used:C+1,value:parseFloat(m)*72};default:return _.unshift(T),{used:C,value:parseFloat(m)}}};var w=function(_){return _=_.replace(/\\n/g,`
|
|
145
|
+
`),_=_.replace(/\\"/g,'"'),_};this.getBrackettedSubstring=function(_,C,m,T){for(var L=T||_[C],N=C+1,B=!1;N<_.length&&(B||_[N]!==L);)B=_[N]==="\\",++N;return _[N]===L?[N-C+1,w(_.substring(C+1,N)),!0]:(N=C+m,N>_.length-1&&(N=_.length-1),[N-C+1,w(_.substring(C+1,N)),!1])}};return r.prototype.peekLine=function(){return this.lines[this.lineIndex]},r.prototype.nextLine=function(){if(this.lineIndex>0&&(this.multilineVars.iChar+=this.lines[this.lineIndex-1].length+1),this.lineIndex<this.lines.length){var a=this.lines[this.lineIndex];return this.lineIndex++,a}return null},Fm=r,Fm}var qm,jw;function F9(){if(jw)return qm;jw=1;function t(A,M,w){if(!(!M||A.lines.length===0)){var _=A.deline({lineBreaks:!1}),C=a(_,M);A.lines=r(_,C,w),A.lineBreaks=C}}function r(A,M,w){for(var _=[],C=[],m=[],T=1,L=0;L<M.length;L++){var N=M[L];if(A[N.ogLine].staff){var B=A[N.ogLine].staff[N.staff];if(_[N.line]||(_[N.line]={staff:[]}),!_[N.line].staff[N.staff]){_[N.line].staff[N.staff]={voices:[]},w!==void 0&&N.staff===0&&N.line>0&&(_[N.line].staff[N.staff].barNumber=T);for(var W=Object.keys(B),G=0;G<W.length;G++){var R=W[G]==="voices";W[G]==="meter"&&N.line!==0&&(R=!0),R||(_[N.line].staff[N.staff][W[G]]=B[W[G]])}C[N.staff]&&(_[N.line].staff[N.staff].key=C[N.staff])}_[N.line].staff[N.staff].voices[N.voice]||(_[N.line].staff[N.staff].voices[N.voice]=[]),_[N.line].staff[N.staff].voices[N.voice]=A[N.ogLine].staff[N.staff].voices[N.voice].slice(N.start,N.end+1),m[N.staff*10+N.voice]&&_[N.line].staff[N.staff].voices[N.voice].unshift({el_type:"stem",direction:m[N.staff*10+N.voice].direction});for(var ye=_[N.line].staff[N.staff].voices[N.voice],q=ye.length-1;q>=0;q--)if(ye[q].el_type==="key"){C[N.staff]={root:ye[q].root,acc:ye[q].acc,mode:ye[q].mode,accidentals:ye[q].accidentals.filter(function(ve){return ve.acc!=="natural"})};break}for(q=ye.length-1;q>=0;q--)if(ye[q].el_type==="stem"){m[N.staff*10+N.voice]={direction:ye[q].direction};break}if(w!==void 0&&N.staff===0&&N.voice===0)for(q=0;q<ye.length;q++)ye[q].el_type==="bar"&&(T++,q===ye.length-1?delete ye[q].barNumber:ye[q].barNumber=T)}else _[N.line]=A[N.ogLine]}for(var se=0;se<_.length;se++)_[se].staff&&(_[se].staff=_[se].staff.filter(function(ve){return ve!=null}));return _}function a(A,M){for(var w=[],_=0,C=0,m=0,T=0;T<A.length;T++){var L=A[T];if(L.staff){var N=C,B=M[_];_++;for(var W=0;W<L.staff.length;W++)for(var G=L.staff[W],R=0;R<G.voices.length;R++){m=N;for(var ye=0,q=0,se=G.voices[R],ve=0,he=0;he<se.length;he++){var ce=se[he];ce.el_type==="bar"&&(B[q]===ye&&(w.push({ogLine:T,line:m,staff:W,voice:R,start:ve,end:he}),ve=he+1,m++,C=Math.max(C,m),q++),ye++)}w.push({ogLine:T,line:m,staff:W,voice:R,start:ve,end:se.length}),m++,C=Math.max(C,m)}}else w.push({ogLine:T,line:m}),m++,C=Math.max(C,m)}return w}function l(A,M){for(var w=[],_=[],C=0,m=0;m<A.length;m++){var T=A[m],L=C+T;if(L<M)C=L;else{var N=M-C,B=L-M;N<B&&C>0?(w.push(m-1),_.push(Math.round(C-T)),C=T):m<A.length-1&&(w.push(m),_.push(Math.round(C)),C=0)}}return _.push(Math.round(C)),{lineBreaks:w,totals:_}}function u(A){for(var M=[],w=0;w<A.length;w++)M.push(A[w]);return M}function c(A,M,w,_,C,m,T,L,N,B,W){for(var G=B;G<A.length;G++){var R=A[G];w+=R,_+=R;var ye=Math.abs(w-M[L]),q=Math.abs(ye-m)<M[0]/10;if(q)if(ye<m){var se=u(C),ve=u(N);ve.push(G-1),se.push(_-R),W.push({accumulator:w,lineAccumulator:R,lineWidths:se,lastVariance:Math.abs(w-M[L+1]),highestVariance:Math.max(T,m),currLine:L+1,lineBreaks:ve,startIndex:G+1})}else ye>m&&G<A.length-1&&(se=u(C),ve=u(N),W.push({accumulator:w,lineAccumulator:_,lineWidths:se,lastVariance:ye,highestVariance:Math.max(T,ye),currLine:L,lineBreaks:ve,startIndex:G+1}));ye>m?(N.push(G-1),L++,T=Math.max(T,m),m=Math.abs(w-M[L]),C.push(_-R),_=R):m=ye}C.push(_)}function f(A,M,w,_){for(var C=Math.ceil(A.total/M),m=Math.floor(A.total/C),T=[],L=0;L<C;L++)T.push(m*(L+1));var N=[];N.push({accumulator:0,lineAccumulator:0,lineWidths:[],lastVariance:999999,highestVariance:0,currLine:0,lineBreaks:[],startIndex:0});for(var B=0;B<N.length;)c(A.measureWidths,T,N[B].accumulator,N[B].lineAccumulator,N[B].lineWidths,N[B].lastVariance,N[B].highestVariance,N[B].currLine,N[B].lineBreaks,N[B].startIndex,N),B++;for(L=0;L<N.length;L++){var W=N[L];W.variances=[],W.aveVariance=0;for(var G=0;G<W.lineWidths.length;G++){var R=W.lineWidths[G];W.variances.push(R-T[0]),W.aveVariance+=Math.abs(R-T[0])}W.aveVariance=W.aveVariance/W.lineWidths.length,_.attempts.push({type:"optimizeLineWidths",lineBreaks:W.lineBreaks,variances:W.variances,aveVariance:W.aveVariance,widths:A.measureWidths})}var ye=9999999,q=-1;for(L=0;L<N.length;L++)W=N[L],W.aveVariance<ye&&(ye=W.aveVariance,q=L);return{failed:!1,lineBreaks:N[q].lineBreaks,variance:N[q].highestVariance}}function p(A,M,w){for(var _=[],C=[],m=0,T=!1,L=0;L<A.length;L++)m+=A[L],m>M&&(T=!0),L%w===w-1&&(L!==A.length-1&&_.push(L),C.push(Math.round(m)),m=0);return{failed:T,totals:C,lineBreaks:_}}function y(A,M,w){var _={lineBreaks:A,staffwidth:M};for(var C in w)w.hasOwnProperty(C)&&C!=="wrap"&&C!=="staffwidth"&&(_[C]=w[C]);return{revisedParams:_}}function S(A,M,w){if(M.length===0||w.staffwidth<M[0].left)return{reParse:!1,explanation:"Staff width is narrower than the margin",revisedParams:w};var _=w.scale?Math.max(w.scale,.1):1,C=w.wrap.minSpacing?Math.max(parseFloat(w.wrap.minSpacing),1):1,m=w.wrap.minSpacingLimit?Math.max(parseFloat(w.wrap.minSpacingLimit),1):C-.1,T=w.wrap.maxSpacing?Math.max(parseFloat(w.wrap.maxSpacing),1):void 0;w.wrap.lastLineLimit&&!T&&(T=Math.max(parseFloat(w.wrap.lastLineLimit),1));for(var L=w.wrap.preferredMeasuresPerLine?Math.max(parseInt(w.wrap.preferredMeasuresPerLine,10),0):void 0,N=[],B=[],W=0;W<M.length;W++){var G=M[W],R=w.staffwidth-G.left,ye=R/C/_,q=R/T/_,se=R/m/_,ve={widths:G,lineBreakPoint:ye,minLineSize:q,attempts:[],staffWidth:w.staffwidth,minWidth:Math.round(se)},he=null;if(L){var ce=p(G.measureWidths,ye,L);ve.attempts.push({type:"Fixed Measures Per Line",preferredMeasuresPerLine:L,lineBreaks:ce.lineBreaks,failed:ce.failed,totals:ce.totals}),ce.failed||(he=ce.lineBreaks)}if(!he){var de=l(G.measureWidths,ye);ve.attempts.push({type:"Free Form",lineBreaks:de.lineBreaks,totals:de.totals}),he=de.lineBreaks,he.length>0&&G.measureWidths.length<25&&(de=f(G,ye,he,ve),ve.attempts.push({type:"Optimize",failed:de.failed,reason:de.reason,lineBreaks:de.lineBreaks,totals:de.totals}),de.failed||(he=de.lineBreaks))}N.push(he),B.push(ve)}var K=w.staffwidth,Q=y(N,K,w);return Q.explanation=B,Q.reParse=!0,Q}return qm={wrapLines:t,calcLineWraps:S},qm}var zm,Jw;function ss(){if(Jw)return zm;Jw=1;var t={};return t.FONTEM=360,t.FONTSIZE=30,t.STEP=t.FONTSIZE*93/720,t.SPACE=10,t.TOPNOTE=15,t.STAVEHEIGHT=100,t.INDENT=50,zm=t,zm}var Hm,e5;function q9(){if(e5)return Hm;e5=1;var t,r=Bo();return function(){var a=1,l=128;t=function(m,T){T=T||{};var L,N=T.program||0,B=T.midiTranspose||0;m.visualTranspose&&(B-=m.visualTranspose);var W=T.channel||0,G=!1,R=T.drum||"",ye=T.drumBars||1,q=T.drumIntro||0,se=R!=="",ve=!!T.drumOff,he=[],ce=50;N=parseInt(N,10),B=parseInt(B,10),W=parseInt(W,10),W===10&&(N=l),R=R.split(" "),ye=parseInt(ye,10),q=parseInt(q,10);var de=m.formatting.bagpipes;de&&(N=71);var K=[];if(m.formatting.midi){var Q=m.formatting.midi;Q.program&&Q.program.length>0&&(N=Q.program[0],Q.program.length>1&&(N=Q.program[1],W=Q.program[0]),G=!0),Q.transpose&&(B=Q.transpose[0]),Q.channel&&(W=Q.channel[0],G=!0),Q.drum&&(R=Q.drum),Q.drumbars&&(ye=Q.drumbars[0]),Q.drumon&&(se=!0),W===10&&(N=l),Q.beat&&K.push({el_type:"beat",beats:Q.beat}),Q.nobeataccents&&K.push({el_type:"beataccents",value:!1})}T.qpm?L=parseInt(T.qpm,10):m.metaText.tempo?L=S(m.metaText.tempo,m.getBeatLength()):T.defaultQpm?L=T.defaultQpm:L=180;var le=[];de&&le.push({el_type:"bagpipes"}),le.push({el_type:"instrument",program:N}),W&&le.push({el_type:"channel",channel:W}),B&&le.push({el_type:"transpose",transpose:B}),le.push({el_type:"tempo",qpm:L});for(var Ee=0;Ee<K.length;Ee++)le.push(K[Ee]);var Me=[],H=[],Y=[],X=[0],xe={};xe[0]={el_type:"tempo",qpm:L,timing:0};for(var De,$e=[],Re=[],ut=!1,Lt=m.lines,it=0;it<Lt.length;it++){var Ct=Lt[it];if(Ct.staff){let ee=function(j){var pe={pppp:[15,10,5,1],ppp:[30,20,10,1],pp:[45,35,20,1],p:[60,50,35,1],mp:[75,65,50,1],mf:[90,80,65,1],f:[105,95,80,1],ff:[120,110,95,1],fff:[127,125,110,1],ffff:[127,125,110,1]},ie;if(j.decoration)if(j.decoration.indexOf("pppp")>=0?ie="pppp":j.decoration.indexOf("ppp")>=0?ie="ppp":j.decoration.indexOf("pp")>=0?ie="pp":j.decoration.indexOf("p")>=0?ie="p":j.decoration.indexOf("mp")>=0?ie="mp":j.decoration.indexOf("mf")>=0?ie="mf":j.decoration.indexOf("f")>=0?ie="f":j.decoration.indexOf("ff")>=0?ie="ff":j.decoration.indexOf("fff")>=0?ie="fff":j.decoration.indexOf("ffff")>=0&&(ie="ffff"),ie&&(De=pe[ie].slice(0),Me[at].push({el_type:"beat",beats:De.slice(0)}),H[ct]=!1,Y[ct]=!1),j.decoration.indexOf("crescendo(")>=0){var fe=u(gr,Je,"crescendo)"),ne=Math.min(127,De[0]+ce),ae=c(gr,Je+fe+1,Object.keys(pe));ae&&(ne=pe[ae][0]),fe>0?H[ct]=Math.floor((ne-De[0])/fe):H[ct]=!1,Y[ct]=!1}else if(j.decoration.indexOf("crescendo)")>=0)H[ct]=!1;else if(j.decoration.indexOf("diminuendo(")>=0){var Z=u(gr,Je,"diminuendo)"),ue=Math.max(15,De[0]-ce),me=c(gr,Je+Z+1,Object.keys(pe));me&&(ue=pe[me][0]),H[ct]=!1,Z>0?Y[ct]=Math.floor((ue-De[0])/Z):Y[ct]=!1}else j.decoration.indexOf("diminuendo)")>=0&&(Y[ct]=!1)};for(var It=Ct.staff,at=0,Gt=0;Gt<It.length;Gt++){var Dt=It[Gt];if(!(Dt.clef&&Dt.clef.type==="TAB"))for(var ct=0;ct<Dt.voices.length;ct++){var gr=Dt.voices[ct];if(!Me[at]){Me[at]=[].concat(JSON.parse(JSON.stringify(le)));var vr=y(Ct.staff,at);vr&&Me[at].unshift({el_type:"name",trackName:vr})}if(B&&Dt.clef.type==="perc"&&Me[at].push({el_type:"transpose",transpose:0}),Dt.clef&&Dt.clef.type==="perc"&&!G)for(var er=0;er<Me[at].length;er++)Me[at][er].el_type==="instrument"&&(Me[at][er].program=l);else Dt.key&&w(Me[at],Dt.key);Dt.meter&&_(Me[at],Dt.meter),!ut&&se&&(Me[at].push({el_type:"drum",params:{pattern:R,bars:ye,on:se,intro:q}}),ut=!0),Dt.clef&&Dt.clef.type!=="perc"&&Dt.clef.transpose&&(Dt.clef.el_type="clef",Me[at].push({el_type:"transpose",transpose:Dt.clef.transpose})),Dt.clef&&Dt.clef.type&&(Dt.clef.type.indexOf("-8")>=0?Me[at].push({el_type:"transpose",transpose:-12}):Dt.clef.type.indexOf("+8")>=0&&Me[at].push({el_type:"transpose",transpose:12})),m.formatting.midi&&m.formatting.midi.drumoff&&(Me[at].push({el_type:"bar"}),Me[at].push({el_type:"drum",params:{pattern:"",on:!1}}));var Cr=0,Wr=0,kr=0,Ue=0;De=[105,95,85,1];for(var Je=0;Je<gr.length;Je++){var Ye=gr[Je];switch(Ye.el_type){case"note":if(H[ct]&&(De[0]+=H[ct],De[1]+=H[ct],De[2]+=H[ct],Me[at].push({el_type:"beat",beats:De.slice(0)})),Y[ct]&&(De[0]+=Y[ct],De[1]+=Y[ct],De[2]+=Y[ct],Me[at].push({el_type:"beat",beats:De.slice(0)})),ee(Ye),!Ye.rest||Ye.rest.type!=="spacer"){var Qe={elem:Ye,el_type:"note",timing:X[at]};if(Ye.style?Qe.style=Ye.style:he[at]&&(Qe.style=he[at]),Qe.duration=Ye.duration===0?.25:Ye.duration,Ye.startTriplet){if(Wr=Ye.tripletMultiplier,kr=Ye.startTriplet*Wr*Ye.duration,Ye.startTriplet!==Ye.tripletR&&Je+Ye.tripletR<=gr.length){for(var rt=0,o=Je;o<Je+Ye.tripletR;o++)rt+=gr[o].duration;kr=Wr*rt}Qe.duration=Qe.duration*Wr,Qe.duration=Math.round(Qe.duration*1e6)/1e6,Ue=Qe.duration}else Wr&&(Ye.endTriplet?(Wr=0,Qe.duration=Math.round((kr-Ue)*1e6)/1e6):(Qe.duration=Qe.duration*Wr,Qe.duration=Math.round(Qe.duration*1e6)/1e6,Ue+=Qe.duration));Ye.rest&&(Qe.rest=Ye.rest),Ye.decoration&&(Qe.decoration=Ye.decoration.slice(0)),Ye.pitches&&(Qe.pitches=r.cloneArray(Ye.pitches)),Ye.gracenotes&&(Qe.gracenotes=r.cloneArray(Ye.gracenotes)),Ye.chord&&(Qe.chord=r.cloneArray(Ye.chord)),Me[at].push(Qe),Ye.style==="rhythm"&&p(Me),Cr++,X[at]+=Qe.duration}break;case"key":case"keySignature":w(Me[at],Ye);break;case"meter":_(Me[at],Ye);break;case"clef":Ye.transpose&&Me[at].push({el_type:"transpose",transpose:Ye.transpose}),Ye.type&&(Ye.type.indexOf("-8")>=0?Me[at].push({el_type:"transpose",transpose:-12}):Ye.type.indexOf("+8")>=0&&Me[at].push({el_type:"transpose",transpose:12}));break;case"tempo":L=S(Ye,m.getBeatLength()),Me[at].push({el_type:"tempo",qpm:L,timing:X[at]}),xe[""+X[at]]={el_type:"tempo",qpm:L,timing:X[at]};break;case"bar":Cr>0&&Me[at].push({el_type:"bar"}),ee(Ye),Cr=0;var h=Ye.type==="bar_right_repeat"||Ye.type==="bar_dbl_repeat",b=Ye.startEnding==="1",x=Ye.type==="bar_left_repeat"||Ye.type==="bar_dbl_repeat"||Ye.type==="bar_right_repeat";if(h){var E=$e[at];E||(E=0);var I=Re[at];I||(I=Me[at].length);for(var F=E;F<I;F++){var D=Object.assign({},Me[at][F]);D.pitches&&(D.pitches=r.cloneArray(D.pitches)),Me[at].push(D)}Re[at]=void 0,$e[at]=void 0}b&&(Re[at]=Me[at].length),x&&($e[at]=Me[at].length);break;case"style":he[at]=Ye.head;break;case"timeSignature":Me[at].push(A(Ye));break;case"part":break;case"stem":case"scale":case"break":case"font":break;case"midi":var z=!1;switch(Ye.cmd){case"drumon":se=!0,z=!0;break;case"drumoff":se=!1,z=!0;break;case"drum":R=Ye.params,z=!0;break;case"drumbars":ye=Ye.params[0],z=!0;break;case"drummap":break;case"channel":Ye.params[0]===10&&Me[at].push({el_type:"instrument",program:l});break;case"program":C(Me[at],{el_type:"instrument",program:Ye.params[0]}),G=!0;break;case"transpose":Me[at].push({el_type:"transpose",transpose:Ye.params[0]});break;case"gchordoff":Me[at].push({el_type:"gchordOn",tacet:!0});break;case"gchordon":Me[at].push({el_type:"gchordOn",tacet:!1});break;case"beat":Me[at].push({el_type:"beat",beats:Ye.params});break;case"nobeataccents":Me[at].push({el_type:"beataccents",value:!1});break;case"beataccents":Me[at].push({el_type:"beataccents",value:!0});break;case"vol":case"volinc":Me[at].push({el_type:Ye.cmd,volume:Ye.params[0]});break;case"swing":case"gchord":case"bassvol":case"chordvol":Me[at].push({el_type:Ye.cmd,param:Ye.params[0]});break;case"bassprog":case"chordprog":Me[at].push({el_type:Ye.cmd,value:Ye.params[0],octaveShift:Ye.params[1]});break;case"gchordbars":Me[at].push({el_type:Ye.cmd,param:Ye.params[0]});break;default:console.log("MIDI seq: midi cmd not handled: ",Ye.cmd,Ye)}z&&(Me[0].push({el_type:"drum",params:{pattern:R,bars:ye,intro:q,on:se}}),ut=!0);break;default:console.log("MIDI: element type "+Ye.el_type+" not handled.")}}at++,X[at]||(X[at]=0)}}}}if(f(Me,xe),q)for(var U=m.getPickupLength(),J=0;J<Me.length;J++){for(var te=0;Me[J][te].el_type!=="note"&&Me[J].length>te;)te++;if(Me[J].length>te){for(var o=0;o<q;o++)U===0||o<q-1?(Me[J].splice(te,0,{el_type:"note",rest:{type:"rest"},duration:a},{el_type:"bar"}),te+=2):Me[J].splice(te++,0,{el_type:"note",rest:{type:"rest"},duration:a-U});ve&&(se=!1,Me[J].splice(te++,0,{el_type:"drum",params:{pattern:R,bars:ye,intro:q,on:se}}),ve=!1)}}return Me.length>0&&Me[0].length>0&&(Me[0][0].pickupLength=m.getPickupLength()),Me};function u(m,T,L){for(var N=0,B=T+1;B<m.length;B++)if(m[B].el_type==="note"&&N++,m[B].decoration&&m[B].decoration.indexOf(L)>=0)return N;return N}function c(m,T,L){for(var N=Math.min(m.length,T+3),B=T;B<N;B++)if(m[B].el_type==="note"&&m[B].decoration){for(var W=0;W<m[B].decoration.length;W++)if(L.indexOf(m[B].decoration[W])>=0)return m[B].decoration[W]}return null}function f(m,T){if(!(!T||T.length===0))for(var L=Object.keys(T),N=0;N<m.length;N++)for(var B=m[N],W=T[0]?T[0].qpm:0,G=0;G<B.length;G++){var R=B[G];R.el_type==="tempo"&&(W=R.qpm),L.indexOf(""+R.timing)>=0&&W!==T[""+R.timing].qpm&&(W=T[""+R.timing].qpm,R.el_type==="tempo"?(R.qpm=T[""+R.timing].qpm,G++):(m[N].splice(G,0,{el_type:"tempo",qpm:T[""+R.timing].qpm,timing:R.timing}),G+=2))}}function p(m){for(var T=0;T<m.length;T++)for(var L=m[T],N=L.length-1;N>=0&&L[N].el_type!=="bar";)L[N].noChordVoice=!0,N--}function y(m,T){if(!(!m||m.length<=T||!m[T].title))return m[T].title.join(" ")}function S(m,T){var L=.25;m.duration&&(L=m.duration[0]);var N=60;return m.bpm&&(N=m.bpm),L*N/T}function A(m){var T;switch(m.type){case"common_time":T={el_type:"meter",num:4,den:4};break;case"cut_time":T={el_type:"meter",num:2,den:2};break;case"specified":T={el_type:"meter",num:m.value[0].num,den:m.value[0].den};break;default:T={el_type:"meter"}}return a=T.num/T.den,T}function M(m){for(var T=[],L=0;L<m.length;L++)m[L].acc!=="natural"&&T.push(m[L]);return T}function w(m,T){var L;T.root==="HP"?L={el_type:"key",accidentals:[{acc:"natural",note:"g"},{acc:"sharp",note:"f"},{acc:"sharp",note:"c"}]}:L={el_type:"key",accidentals:M(T.accidentals)},C(m,L)}function _(m,T){var L=A(T);C(m,L)}function C(m,T){for(var L=m.length-1;L>=0;L--)if(m[L].el_type===T.el_type){JSON.stringify(m[L])!==JSON.stringify(T)&&m.push(T);return}m.push(T)}}(),Hm=t,Hm}var Vm,t5;function YI(){if(t5)return Vm;t5=1;var t=function(S,A,M,w){this.chordTrack=[],this.chordTrackFinished=!1,this.chordChannel=S,this.currentChords=[],this.lastChord,this.chordLastBar,this.chordsOff=!!A,this.gChordTacet=this.chordsOff,this.hasRhythmHead=!1,this.transpose=0,this.lastBarTime=0,this.meter=w,this.tempoChangeFactor=1,this.bassInstrument=M.bassprog&&M.bassprog.length>=1?M.bassprog[0]:0,this.chordInstrument=M.chordprog&&M.chordprog.length>=1?M.chordprog[0]:0,this.bassOctaveShift=M.bassprog&&M.bassprog.length===2?M.bassprog[1]:0,this.chordOctaveShift=M.chordprog&&M.chordprog.length===2?M.chordprog[1]:0,this.boomVolume=M.bassvol&&M.bassvol.length===1?M.bassvol[0]:64,this.chickVolume=M.chordvol&&M.chordvol.length===1?M.chordvol[0]:48,M.gchord&&M.gchord.length>0?this.overridePattern=l(M.gchord[0]):this.overridePattern=void 0};t.prototype.setMeter=function(y){this.meter=y},t.prototype.setTempoChangeFactor=function(y){this.tempoChangeFactor=y},t.prototype.setLastBarTime=function(y){this.lastBarTime=y},t.prototype.setTranspose=function(y){this.transpose=y},t.prototype.setRhythmHead=function(y,S){this.hasRhythmHead=y;var A=[];if(y&&this.lastChord&&this.lastChord.chick)for(var M=0;M<this.lastChord.chick.length;M++){var w=Object.assign({},S.pitches[0]);w.actualPitch=this.lastChord.chick[M],A.push(w)}return A},t.prototype.barEnd=function(y){this.chordTrack.length>0&&!this.chordTrackFinished&&(this.resolveChords(this.lastBarTime,f(y.time)),this.currentChords=[]),this.chordLastBar=this.lastChord},t.prototype.gChordOn=function(y){this.chordsOff||(this.gChordTacet=y.tacet)},t.prototype.paramChange=function(y){switch(y.el_type){case"gchord":y.param&&y.param.length>0?this.overridePattern=l(y.param):this.overridePattern=void 0;break;case"bassprog":this.bassInstrument=y.value,y.octaveShift!=null&&y.octaveShift!=null?this.bassOctaveShift=y.octaveShift:this.bassOctaveShift=0;break;case"chordprog":this.chordInstrument=y.value,y.octaveShift!=null&&y.octaveShift!=null?this.chordOctaveShift=y.octaveShift:this.chordOctaveShift=0;break;case"bassvol":this.boomVolume=y.param;break;case"chordvol":this.chickVolume=y.param;break;default:console.log("unhandled midi param",y)}},t.prototype.finish=function(){this.chordTrackEmpty()||(this.chordTrackFinished=!0)},t.prototype.addTrack=function(y){this.chordTrackEmpty()||y.push(this.chordTrack)},t.prototype.findChord=function(y){if(this.gChordTacet)return"break";if(this.chordTrackFinished||!y.chord||y.chord.length===0)return null;for(var S=0;S<y.chord.length;S++){var A=y.chord[S];if(A.position==="default")return A.name;if(this.breakSynonyms.indexOf(A.name.toLowerCase())>=0)return"break"}return null},t.prototype.interpretChord=function(y){if(y.length!==0){if(y==="break")return{chick:[]};var S=y.substring(0,1);if(S==="("){if(y=y.substring(1,y.length-2),y.length===0)return;S=y.substring(0,1)}var A=this.basses[S];if(A){for(var M=this.transpose;M<-8;)M+=12;for(;M>8;)M-=12;A+=M,A<33?A+=12:A>44&&(A-=12);var w=A;A+=this.bassOctaveShift*12;var _=A-5,C;y.length===1&&(C=this.chordNotes(A,""));var m=y.substring(1),T=m.substring(0,1);T==="b"||T==="♭"?(w--,A--,_--,m=m.substring(1)):(T==="#"||T==="♯")&&(w++,A++,_++,m=m.substring(1));var L=m.split("/");if(C=this.chordNotes(w,L[0]),C.length>=3){var N=C[2]-C[0];_=_+N-7}if(L.length===2){var B=this.basses[L[1].substring(0,1)];if(B){var W=L[1].substring(1),G={"#":1,"♯":1,b:-1,"♭":-1}[W]||0;A=this.basses[L[1].substring(0,1)]+G+M,A+=this.bassOctaveShift*12,_=A}}return{boom:A,boom2:_,chick:C}}}},t.prototype.chordNotes=function(y,S){var A=this.chordIntervals[S];A||(S.slice(0,2).toLowerCase()==="ma"||S[0]==="M"?A=this.chordIntervals.M:S[0]==="m"||S[0]==="-"?A=this.chordIntervals.m:A=this.chordIntervals.M),y+=12,y+=this.chordOctaveShift*12;for(var M=[],w=0;w<A.length;w++)M.push(y+A[w]);return M},t.prototype.writeNote=function(y,S,A,M,w,_){y!==void 0&&this.chordTrack.push({cmd:"note",pitch:y,volume:A,start:this.lastBarTime+M*p(S,this.tempoChangeFactor),duration:p(w,this.tempoChangeFactor),gap:0,instrument:_})},t.prototype.chordTrackEmpty=function(){for(var y=!0,S=0;S<this.chordTrack.length&&y;S++)this.chordTrack[S].cmd==="note"&&(y=!1);return y},t.prototype.resolveChords=function(y,S){if(!this.hasRhythmHead){var A=this.meter.num,M=this.meter.den,w=1/M,_=w/2,C=parseInt(A,10)/parseInt(M,10),m=C-(S-y)/this.tempoChangeFactor;Math.abs(m)<1e-5&&(m=0),(this.currentChords.length===0||this.currentChords[0].beat!==0)&&this.currentChords.unshift({beat:0,chord:this.chordLastBar});var T=u(this.currentChords,8*A/M),L=this.overridePattern?this.overridePattern:this.rhythmPatterns[A+"/"+M];if(m){L=[];for(var N=(S-y)/this.tempoChangeFactor*8,B=0;B<N/2;B+=2)L.push("chick"),L.push("")}if(!L){L=[];for(var B=0;B<8*A/M/2;B++)L.push("chick"),L.push("")}for(var W=!0,G=Math.min(L.length,T.length),B=0;B<G;B++){B>0&&T[B-1]&&T[B]&&T[B-1].boom!==T[B].boom&&(W=!0);var R=L[B],ye=R.indexOf("boom")>=0,q=!ye&&B!==0&&L[0].indexOf("boom")>=0&&(!T[B-1]||T[B-1].boom!==T[B].boom),se=r(T[B],R,W,q);ye&&(W=!1);for(var ve=0;ve<se.length;ve++)this.writeNote(se[ve],.125,ye||q?this.boomVolume:this.chickVolume,B,_,ye||q?this.bassInstrument:this.chordInstrument),q?q=!1:ye=!1}}},t.prototype.processChord=function(y){if(!this.chordTrackFinished){var S=this.findChord(y);if(S){var A=this.interpretChord(S);if(A){this.chordTrack.length===0&&this.chordTrack.push({cmd:"program",channel:this.chordChannel,instrument:this.chordInstrument}),this.lastChord=A;var M=c(this.lastBarTime,f(y.time));this.currentChords.push({chord:this.lastChord,beat:M,start:f(y.time)})}}}};function r(y,S,A,M){var w=[];if(!y)return w;S.indexOf("boom")>=0?w.push(A?y.boom:y.boom2):M&&w.push(y.boom);var _=y.chick.length;if(S.indexOf("chick")>=0)for(var C=0;C<_;C++)w.push(y.chick[C]);switch(S){case"DO":w.push(y.chick[0]);break;case"MI":w.push(y.chick[1]);break;case"SOL":w.push(a(y,2));break;case"TI":w.push(a(y,3));break;case"TOP":w.push(a(y,4));break;case"do":w.push(y.chick[0]+12);break;case"mi":w.push(y.chick[1]+12);break;case"sol":w.push(a(y,2)+12);break;case"ti":w.push(a(y,3)+12);break;case"top":w.push(a(y,4)+12);break}return w}function a(y,S){var A=Math.floor(S/y.chick.length),M=y.chick[S%y.chick.length];return M+A*12}function l(y){for(var S=[],A=0;A<y.length;A++){var M=y[A];switch(M){case"z":S.push("");break;case"2":S.push("");break;case"c":S.push("chick");break;case"b":S.push("boom&chick");break;case"f":S.push("boom");break;case"G":S.push("DO");break;case"H":S.push("MI");break;case"I":S.push("SOL");break;case"J":S.push("TI");break;case"K":S.push("TOP");break;case"g":S.push("do");break;case"h":S.push("mi");break;case"i":S.push("sol");break;case"j":S.push("ti");break;case"k":S.push("top");break}}return S}function u(y,S,A){var M=[];if(y.length===0)return M;for(var w=y[0].chord,_=1;_<y.length;_++){for(var C=y[_];M.length<C.beat;)M.push(w);w=C.chord}for(;M.length<S;)M.push(w);return M}function c(y,S){var A=S-y;return A*8}t.prototype.breakSynonyms=["break","(break)","no chord","n.c.","tacet"],t.prototype.basses={A:33,B:35,C:36,D:38,E:40,F:41,G:43},t.prototype.chordIntervals={dim:[0,3,6],"°":[0,3,6],"˚":[0,3,6],dim7:[0,3,6,9],"°7":[0,3,6,9],"˚7":[0,3,6,9],ø7:[0,3,6,10],"m7(b5)":[0,3,6,10],m7b5:[0,3,6,10],"m7♭5":[0,3,6,10],"-7(b5)":[0,3,6,10],"-7b5":[0,3,6,10],"7b5":[0,4,6,10],"7(b5)":[0,4,6,10],"7♭5":[0,4,6,10],"7(b9,b5)":[0,4,6,10,13],"7b9,b5":[0,4,6,10,13],"7(#9,b5)":[0,4,6,10,15],"7#9b5":[0,4,6,10,15],"maj7(b5)":[0,4,6,11],maj7b5:[0,4,6,11],"13(b5)":[0,4,6,10,14,21],"13b5":[0,4,6,10,14,21],m:[0,3,7],"-":[0,3,7],m6:[0,3,7,9],"-6":[0,3,7,9],m7:[0,3,7,10],"-7":[0,3,7,10],"-(b6)":[0,3,7,8],"-b6":[0,3,7,8],"-6/9":[0,3,7,9,14],"-7(b9)":[0,3,7,10,13],"-7b9":[0,3,7,10,13],"-maj7":[0,3,7,11],"-9+7":[0,3,7,11,13],"-11":[0,3,7,11,14,17],m11:[0,3,7,11,14,17],"-maj9":[0,3,7,11,14],"-∆9":[0,3,7,11,14],mM9:[0,3,7,11,14],M:[0,4,7],6:[0,4,7,9],"6/9":[0,4,7,9,14],"6add9":[0,4,7,9,14],69:[0,4,7,9,14],7:[0,4,7,10],9:[0,4,7,10,14],11:[0,7,10,14,17],13:[0,4,7,10,14,21],"7b9":[0,4,7,10,13],"7♭9":[0,4,7,10,13],"7(b9)":[0,4,7,10,13],"7(#9)":[0,4,7,10,15],"7#9":[0,4,7,10,15],"(13)":[0,4,7,10,14,21],"7(9,13)":[0,4,7,10,14,21],"7(#9,b13)":[0,4,7,10,15,20],"7(#11)":[0,4,7,10,14,18],"7#11":[0,4,7,10,14,18],"7(b13)":[0,4,7,10,20],"7b13":[0,4,7,10,20],"9(#11)":[0,4,7,10,14,18],"9#11":[0,4,7,10,14,18],"13(#11)":[0,4,7,10,18,21],"13#11":[0,4,7,10,18,21],maj7:[0,4,7,11],"∆7":[0,4,7,11],Δ7:[0,4,7,11],maj9:[0,4,7,11,14],"maj7(9)":[0,4,7,11,14],"maj7(11)":[0,4,7,11,17],"maj7(#11)":[0,4,7,11,18],"maj7(13)":[0,4,7,14,21],"maj7(9,13)":[0,4,7,11,14,21],"7sus4":[0,5,7,10],m7sus4:[0,3,7,10,17],sus4:[0,5,7],sus2:[0,2,7],"7sus2":[0,2,7,10],"9sus4":[0,5,7,10,14],"13sus4":[0,5,7,10,14,21],aug7:[0,4,8,10],"+7":[0,4,8,10],"+":[0,4,8],"7#5":[0,4,8,10],"7♯5":[0,4,8,10],"7+5":[0,4,8,10],"9#5":[0,4,8,10,14],"9♯5":[0,4,8,10,14],"9+5":[0,4,8,10,14],"-7(#5)":[0,3,8,10],"-7#5":[0,3,8,10],"7(#5)":[0,4,8,10],"7(b9,#5)":[0,4,8,10,13],"7b9#5":[0,4,8,10,13],"maj7(#5)":[0,4,8,11],"maj7#5":[0,4,8,11],"maj7(#5,#11)":[0,4,8,11,18],"maj7#5#11":[0,4,8,11,18],"9(#5)":[0,4,8,10,14],"13(#5)":[0,4,8,10,14,21],"13#5":[0,4,8,10,14,21],5:[0,7],"5(8)":[0,7,12],"5add8":[0,7,12]},t.prototype.rhythmPatterns={"2/2":["boom","","","","chick","","",""],"3/2":["boom","","","","chick","","","","chick","","",""],"4/2":["boom","","","","chick","","","","boom","","","","chick","","",""],"2/4":["boom","","chick",""],"3/4":["boom","","chick","","chick",""],"4/4":["boom","","chick","","boom","","chick",""],"5/4":["boom","","chick","","chick","","boom","","chick",""],"6/4":["boom","","chick","","boom","","chick","","boom","","chick",""],"3/8":["boom","","chick"],"5/8":["boom","chick","chick","boom","chick"],"6/8":["boom","","chick","boom","","chick"],"7/8":["boom","chick","chick","boom","chick","boom","chick"],"9/8":["boom","","chick","boom","","chick","boom","","chick"],"10/8":["boom","chick","chick","boom","chick","chick","boom","chick","boom","chick"],"11/8":["boom","chick","chick","boom","chick","chick","boom","chick","boom","chick","chick"],"12/8":["boom","","chick","boom","","chick","boom","","chick","boom","","chick"]};function f(y){return y/1e6}function p(y,S){return Math.round(y*S*1e6)/1e6}return Vm=t,Vm}var Um,r5;function z9(){if(r5)return Um;r5=1;var t={f0:"_C",n0:"=C",s0:"^C",x0:"C",f1:"_D",n1:"=D",s1:"^D",x1:"D",f2:"_E",n2:"=E",s2:"^E",x2:"E",f3:"_F",n3:"=F",s3:"^F",x3:"F",f4:"_G",n4:"=G",s4:"^G",x4:"G",f5:"_A",n5:"=A",s5:"^A",x5:"A",f6:"_B",n6:"=B",s6:"^B",x6:"B",f7:"_c",n7:"=c",s7:"^c",x7:"c",f8:"_d",n8:"=d",s8:"^d",x8:"d",f9:"_e",n9:"=e",s9:"^e",x9:"e",f10:"_f",n10:"=f",s10:"^f",x10:"f",f11:"_g",n11:"=g",s11:"^g",x11:"g",f12:"_a",n12:"=a",s12:"^a",x12:"a",f13:"_b",n13:"=b",s13:"^b",x13:"b",f14:"_c'",n14:"=c'",s14:"^c'",x14:"c'",f15:"_d'",n15:"=d'",s15:"^d'",x15:"d'",f16:"_e'",n16:"=e'",s16:"^e'",x16:"e'"};function r(a){var l=(a.accidental?a.accidental[0]:"x")+a.verticalPos;return t[l]}return Um=r,Um}var $m,n5;function KI(){if(n5)return $m;n5=1;var t,r=YI(),a=z9();return function(){var l,u,c,f,p,y=1,S,A,M,w,_,C,m={num:4,den:4},T=128,L,N=!0,B=105,W=95,G=85,R=.25,ye,q,se=0,ve,he={},ce,de=0,K,Q=0,le=-.001,Ee=.4;t=function(Ue,Je,Ye,Qe){Je||(Je={}),Qe||(Qe={}),l=[],u=[0,0,0,0,0,0,0],f=[],p=Je.qpm,y=1,S=void 0,A=void 0,M=void 0,w=void 0,_=0,K=Ye,m={num:4,den:4},N=!0,B=105,W=95,G=85,R=.25,ye=void 0,q=void 0,se=0,ve=[],he={},ce=1,Ue.length>0&&Ue[0].length>0&&(de=Ue[0][0].pickupLength),Je.bassprog!==void 0&&!Qe.bassprog&&(Qe.bassprog=[Je.bassprog]),Je.bassvol!==void 0&&!Qe.bassvol&&(Qe.bassvol=[Je.bassvol]),Je.chordprog!==void 0&&!Qe.chordprog&&(Qe.chordprog=[Je.chordprog]),Je.chordvol!==void 0&&!Qe.chordvol&&(Qe.chordvol=[Je.chordvol]),Je.gchord!==void 0&&!Qe.gchord&&(Qe.gchord=[Je.gchord]),C=new r(Ue.length,Je.chordsOff,Qe,m),X(Ue,Je);for(var rt=0;rt<Ue.length;rt++){c=0,C.setTranspose(c);var o=Ue[rt];M=[{cmd:"program",channel:rt,instrument:S}],w=void 0,L=0,C.setLastBarTime(0);var h=!1;(Je.voicesOff===!0||Je.voicesOff&&Je.voicesOff.length&&Je.voicesOff.indexOf(rt)>=0)&&(h=!0);for(var b=0;b<o.length;b++){var x=o[b];switch(x.el_type){case"name":w={cmd:"text",type:"name",text:x.trackName};break;case"note":Lt(x,h);break;case"key":u=at(x);break;case"meter":m=x,C.setMeter(m),R=xe(m),Cr();break;case"tempo":p?y=x.qpm?p/x.qpm:1:p=x.qpm,C.setTempoChangeFactor(y);break;case"transpose":c=x.transpose,C.setTranspose(c);break;case"bar":C.barEnd(x),l=[],rt===0&&Wr(Ue.length+1),C.setRhythmHead(!1),L=H(x.time),C.setLastBarTime(L);break;case"bagpipes":break;case"instrument":if(S===void 0&&(S=x.program),A=x.program,M.length>0&&M[M.length-1].cmd==="program")M[M.length-1].instrument=x.program;else{var E;for(E=M.length-1;E>=0&&M[E].cmd!=="program";E--);(E<0||M[E].instrument!==x.program)&&M.push({cmd:"program",channel:0,instrument:x.program})}break;case"channel":Me(x.channel);break;case"drum":he=er(x.params),Cr();break;case"gchordOn":C.gChordOn(x);break;case"beat":B=x.beats[0],W=x.beats[1],G=x.beats[2];break;case"vol":ye=x.volume;break;case"volinc":q=x.volume;break;case"beataccents":N=x.value;break;case"gchord":case"bassprog":case"chordprog":case"bassvol":case"chordvol":case"gchordbars":C.paramChange(x);break;default:console.log("MIDI creation. Unknown el_type: "+x.el_type+`
|
|
146
|
+
`);break}}M[0].instrument===void 0&&(M[0].instrument=S||0),w&&M.unshift(w),f.push(M),C.finish(),ve.length>0}return Je.detuneOctave&&kr(f,parseInt(Je.detuneOctave,10)),C.addTrack(f),ve.length>0&&f.push(ve),{tempo:p,instrument:S,tracks:f,totalDuration:_}};function Me(Ue){for(var Je=M.length-1;Je>=0;Je--)if(M[Je].cmd==="program"){M[Je].channel=Ue;return}}function H(Ue){return Ue/1e6}function Y(Ue){return Math.round(Ue*y*1e6)/1e6}function X(Ue,Je){for(var Ye=0;Ye<Ue.length;Ye++){for(var Qe=Ue[Ye],rt={},o=Je.qpm,h=0,b=1,x=0;x<Qe.length;x++){var E=Qe[x];if(E.el_type==="tempo"){o?b=E.qpm?o/E.qpm:1:o=E.qpm;continue}E.time=h;var I=E.duration?E.duration:0;if(h+=Math.round(I*b*1e6),E.pitches){for(var F=0;F<E.pitches.length;F++){var D=E.pitches[F];if(D){if(D.duration=E.duration,D.startTie)rt[D.pitch]===void 0?rt[D.pitch]={el:x,pitch:F}:(Qe[rt[D.pitch].el].pitches[rt[D.pitch].pitch].duration+=D.duration,E.pitches[F]=null);else if(D.endTie){var z=rt[D.pitch];if(z){var U=D.duration;delete Qe[z.el].pitches[z.pitch].startTie,Qe[z.el].pitches[z.pitch].duration+=U,E.pitches[F]=null,delete rt[D.pitch]}else delete D.endTie}}}delete E.duration}}for(var J in rt)if(rt.hasOwnProperty(J)){var te=rt[J];delete Qe[te.el].pitches[te.pitch].startTie}}}function xe(Ue){switch(parseInt(Ue.den,10)){case 2:return .5;case 4:return .25;case 8:return Ue.num%3===0?.375:.125;case 16:return .125}return .25}function De(Ue,Je,Ye){var Qe=Ye-Ue;return Qe/Je}function $e(Ue,Je){if(Je)return 0;var Ye;if(ye!=null)Ye=ye,ye=void 0;else if(!N)Ye=W;else if(de>Ue)Ye=G;else{var Qe=De(L,xe(m),Ue);Qe===0?Ye=B:parseInt(Qe,10)===Qe?Ye=W:Ye=G}return q&&(Ye+=q,q=void 0),Ye<0&&(Ye=0),Ye>127&&(Ye=127),Je?0:Ye}function Re(Ue,Je){var Ye={};if(Ue.decoration)for(var Qe=0;Qe<Ue.decoration.length;Qe++)Ue.decoration[Qe]==="staccato"?Ye.thisBreakBetweenNotes="staccato":Ue.decoration[Qe]==="tenuto"?Ye.thisBreakBetweenNotes="tenuto":Ue.decoration[Qe]==="accent"?Ye.velocity=Math.min(127,Je*1.5):Ue.decoration[Qe]==="trill"?Ye.noteModification="trill":Ue.decoration[Qe]==="lowermordent"?Ye.noteModification="lowermordent":Ue.decoration[Qe]==="uppermordent"||Ue.decoration[Qe]==="mordent"?Ye.noteModification="mordent":Ue.decoration[Qe]==="turn"?Ye.noteModification="turn":Ue.decoration[Qe]==="roll"&&(Ye.noteModification="roll");return Ye}function ut(Ue,Je){var Ye=Je.start,Qe=Je.duration,rt=Y(1/32);switch(Ue){case"trill":for(var o=2;Qe>0;)M.push({cmd:"note",pitch:Je.pitch+o,volume:Je.volume,start:Ye,duration:rt,gap:0,instrument:A,style:"decoration"}),o=o===2?0:2,Qe-=rt,Ye+=rt;break;case"mordent":M.push({cmd:"note",pitch:Je.pitch,volume:Je.volume,start:Ye,duration:rt,gap:0,instrument:A,style:"decoration"}),Qe-=rt,Ye+=rt,M.push({cmd:"note",pitch:Je.pitch+2,volume:Je.volume,start:Ye,duration:rt,gap:0,instrument:A,style:"decoration"}),Qe-=rt,Ye+=rt,M.push({cmd:"note",pitch:Je.pitch,volume:Je.volume,start:Ye,duration:Qe,gap:0,instrument:A});break;case"lowermordent":M.push({cmd:"note",pitch:Je.pitch,volume:Je.volume,start:Ye,duration:rt,gap:0,instrument:A,style:"decoration"}),Qe-=rt,Ye+=rt,M.push({cmd:"note",pitch:Je.pitch-2,volume:Je.volume,start:Ye,duration:rt,gap:0,instrument:A,style:"decoration"}),Qe-=rt,Ye+=rt,M.push({cmd:"note",pitch:Je.pitch,volume:Je.volume,start:Ye,duration:Qe,gap:0,instrument:A});break;case"turn":rt=Je.duration/4,M.push({cmd:"note",pitch:Je.pitch+2,volume:Je.volume,start:Ye,duration:rt,gap:0,instrument:A,style:"decoration"}),M.push({cmd:"note",pitch:Je.pitch,volume:Je.volume,start:Ye+rt,duration:rt,gap:0,instrument:A,style:"decoration"}),M.push({cmd:"note",pitch:Je.pitch-1,volume:Je.volume,start:Ye+rt*2,duration:rt,gap:0,instrument:A,style:"decoration"}),M.push({cmd:"note",pitch:Je.pitch,volume:Je.volume,start:Ye+rt*3,duration:rt,gap:0,instrument:A,style:"decoration"});break;case"roll":for(;Qe>0;)M.push({cmd:"note",pitch:Je.pitch,volume:Je.volume,start:Ye,duration:rt,gap:0,instrument:A,style:"decoration"}),Qe-=rt*2,Ye+=rt*2;break}}function Lt(Ue,Je){var Ye=$e(H(Ue.time),Je);C.processChord(Ue);var Qe;if(Ue.gracenotes&&Ue.pitches&&Ue.pitches.length>0&&Ue.pitches[0]&&(Qe=Gt(Ue.gracenotes,Ue.pitches[0].duration),Ue.elem&&(Ue.elem.midiGraceNotePitches=Dt(Qe,H(Ue.time),Ye*2/3,A))),Ue.elem){var rt=H(Ue.time),o=rt/R/p*60*1e3;if(Ue.elem.currentTrackMilliseconds===void 0)Ue.elem.currentTrackMilliseconds=o,Ue.elem.currentTrackWholeNotes=rt;else if(Ue.elem.currentTrackMilliseconds.length===void 0)Ue.elem.currentTrackMilliseconds!==o&&(Ue.elem.currentTrackMilliseconds=[Ue.elem.currentTrackMilliseconds,o],Ue.elem.currentTrackWholeNotes=[Ue.elem.currentTrackWholeNotes,rt]);else{for(var h=!1,b=0;b<Ue.elem.currentTrackMilliseconds.length;b++)Ue.elem.currentTrackMilliseconds[b]===o&&(h=!0);h||(Ue.elem.currentTrackMilliseconds.push(o),Ue.elem.currentTrackWholeNotes.push(rt))}}if(Ue.pitches){var x="",E=Re(Ue,Ye);E.thisBreakBetweenNotes&&(x=E.thisBreakBetweenNotes),E.velocity&&(Ye=E.velocity);var I=Ue.pitches;Ue.style==="rhythm"&&(I=C.setRhythmHead(!0,Ue)),Ue.elem&&(Ue.elem.midiPitches=[]);for(var F=0;F<I.length;F++){var D=I[F];if(D){D.startSlur&&(se+=D.startSlur.length),D.endSlur&&(se-=D.endSlur.length);var z=D.actualPitch?D.actualPitch:It(D);if(A===T&&K){var U=a(D);U&&K[U]&&(z=K[U].sound)}var J={cmd:"note",pitch:z,volume:Ye,start:H(Ue.time),duration:Y(D.duration),instrument:A,startChar:Ue.elem.startChar,endChar:Ue.elem.endChar};if(J=ct(J),Ue.gracenotes&&(J.duration=J.duration/2,J.start=J.start+J.duration),Ue.elem&&Ue.elem.midiPitches.push(J),E.noteModification)ut(E.noteModification,J);else{switch(se>0?J.endType="tenuto":x&&(J.endType=x),J.endType){case"tenuto":J.gap=le;break;case"staccato":var te=J.duration*Ee;J.gap=p/60*te;break;default:J.gap=Q;break}M.push(J)}}}M.length-1}var ee=it(Ue);_=Math.max(_,H(Ue.time)+Y(ee))}function it(Ue){return Ue.pitches&&Ue.pitches.length>0&&Ue.pitches[0]?Ue.pitches[0].duration:Ue.elem?Ue.elem.duration:Ue.duration}var Ct=[0,2,4,5,7,9,11];function It(Ue){if(Ue.midipitch!==void 0)return Ue.midipitch;var Je=Ue.pitch;if(Ue.accidental)switch(Ue.accidental){case"sharp":l[Je]=1;break;case"flat":l[Je]=-1;break;case"natural":l[Je]=0;break;case"dblsharp":l[Je]=2;break;case"dblflat":l[Je]=-2;break;case"quartersharp":l[Je]=.25;break;case"quarterflat":l[Je]=-.25;break}var Ye=gr(Je)*12+Ct[vr(Je)]+60;return l[Je]!==void 0?Ye+=l[Je]:Ye+=u[vr(Je)],Ye+=c,Ye}function at(Ue){var Je=[0,0,0,0,0,0,0];if(!Ue.accidentals)return Je;for(var Ye=0;Ye<Ue.accidentals.length;Ye++){var Qe=Ue.accidentals[Ye],rt;switch(Qe.acc){case"flat":rt=-1;break;case"quarterflat":rt=-.25;break;case"sharp":rt=1;break;case"quartersharp":rt=.25;break;default:rt=0;break}var o=Qe.note.toLowerCase(),h=vr(o.charCodeAt(0)-99);Je[h]+=rt}return Je}function Gt(Ue,Je){for(var Ye=0,Qe=[],rt,o=0;o<Ue.length;o++)rt=Ue[o],Ye+=rt.duration;var h=Je/2/Ye;for(o=0;o<Ue.length;o++){rt=Ue[o];var b=It(rt);if(A===T&&K){var x=a(rt);x&&K[x]&&(b=K[x].sound)}var E={pitch:b,duration:rt.duration*h};E=ct(E),Qe.push(E)}return Qe}function Dt(Ue,Je,Ye,Qe){var rt=[];Ye=Math.round(Ye);for(var o=0;o<Ue.length;o++){var h=Ue[o];M.push({cmd:"note",pitch:h.pitch,volume:Ye,start:Je,duration:h.duration,gap:0,instrument:Qe,style:"grace"}),rt.push({pitch:h.pitch,durationInMeasures:h.duration,volume:Ye,instrument:Qe}),Je+=h.duration}return rt}function ct(Ue){var Je=""+Ue.pitch;return Je.indexOf(".75")>=0?(Ue.pitch=Math.round(Ue.pitch),Ue.cents=-50):Je.indexOf(".25")>=0&&(Ue.pitch=Math.round(Ue.pitch),Ue.cents=50),Ue}function gr(Ue){return Math.floor(Ue/7)}function vr(Ue){return Ue=Ue%7,Ue<0&&(Ue+=7),Ue}function er(Ue){if(Ue.pattern.length===0||Ue.on===!1)return{on:!1};for(var Je=Ue.pattern[0],Ye=[],Qe="",rt=0,o=0;o<Je.length;o++)if(Je[o]==="d"&&rt++,Je[o]==="d"||Je[o]==="z")Qe.length!==0?(Ye.push(Qe),Qe=Je[o]):Qe=Qe+Je[o];else{if(Qe.length===0)return{on:!1};Qe=Qe+Je[o]}if(Qe.length!==0&&Ye.push(Qe),Ue.pattern.length!==rt*2+1)return{on:!1};for(var h={on:!0,bars:Ue.bars,pattern:[]},b=xe(m),x=0,E=0;E<Ye.length;E++){Qe=Ye[E];for(var I=1,F=!1,D=0,z=1;z<Qe.length;z++)switch(Qe[z]){case"/":D!==0&&(I*=D),D=0,F=!0;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":D=D*10+Qe[z];break;default:return{on:!1}}F?(D===0&&(D=2),I/=D):D&&(I*=D),Qe[0]==="d"?(h.pattern.push({len:I*b,pitch:Ue.pattern[1+x],velocity:Ue.pattern[1+x+rt]}),x++):h.pattern.push({len:I*b,pitch:null})}return ce=Ue.bars?Ue.bars:1,h}function Cr(){if(!(!he||!he.pattern)){for(var Ue=he,Je=0,Ye=m.num/m.den,Qe=0;Qe<Ue.pattern.length;Qe++)Je+=Ue.pattern[Qe].len;var rt=Je/ce/Ye;for(Qe=0;Qe<Ue.pattern.length;Qe++)Ue.pattern[Qe].len=Ue.pattern[Qe].len/rt;he=Ue}}function Wr(Ue){if(!(ve.length===0&&!he.on)){var Je=m.num/m.den;if(ve.length===0){if(_<Je)return;ve.push({cmd:"program",channel:Ue,instrument:T})}if(he.on)for(var Ye=L,Qe=0;Qe<he.pattern.length;Qe++){var rt=Y(he.pattern[Qe].len);he.pattern[Qe].pitch&&ve.push({cmd:"note",pitch:he.pattern[Qe].pitch,volume:he.pattern[Qe].velocity,start:Ye,duration:rt,gap:0,instrument:T}),Ye+=rt}}}function kr(Ue,Je){for(var Ye={},Qe=0;Qe<Ue.length;Qe++)for(var rt=0;rt<Ue[Qe].length;rt++){var o=Ue[Qe][rt];o.cmd==="note"&&(Ye[o.start]===void 0&&(Ye[o.start]=[]),Ye[o.start].push({track:Qe,event:rt,pitch:o.pitch}))}var h=Object.keys(Ye);for(Qe=0;Qe<h.length;Qe++){var b=Ye[h[Qe]];if(b.length>1){b=b.sort(function(D,z){return D.pitch-z.pitch});var x=b[b.length-1],E=x.pitch%12,I=!1;for(rt=0;!I&&rt<b.length-1;rt++)b[rt].pitch%12===E&&(I=!0);if(I){var F=Ue[x.track][x.event];F.cents||(F.cents=0),F.cents+=Je}}}}}(),$m=t,$m}var Wm,i5;function XI(){if(i5)return Wm;i5=1;function t(y,S){S||(S={});for(var A=!!S.lineBreaks,M=[],w=!1,_=[],C=[],m=[],T=[],L=[],N=[],B=[],W=0;W<y.length;W++){var G=y[W];if(G.staff){if(w&&!G.vskip)for(var R=M[M.length-1],ye=0;ye<R.staff.length;ye++){var q=G.staff[ye],se=R.staff[ye];if(q&&(f(q.meter,_[ye])||(a(q.meter,q.voices),_[ye]=q.meter,delete q.meter),f(q.key,C[ye])||(l(q.key,q.voices),C[ye]=q.key,delete q.key),q.title&&(se.abbrevTitle=q.title),f(q.clef,m[ye])||(u(q.clef,q.voices),m[ye]=q.clef,delete q.clef),f(q.vocalfont,T[ye])||(c(q.vocalfont,q.voices,"vocalfont"),T[ye]=q.vocalfont,delete q.vocalfont),f(q.gchordfont,L[ye])||(c(q.gchordfont,q.voices,"gchordfont"),L[ye]=q.gchordfont,delete q.gchordfont),f(q.tripletfont,N[ye])||(c(q.tripletfont,q.voices,"tripletfont"),N[ye]=q.tripletfont,delete q.tripletfont),f(q.annotationfont,B[ye])||(c(q.annotationfont,q.voices,"annotationfont"),B[ye]=q.annotationfont,delete q.annotationfont)),q)for(var ve=0;ve<se.voices.length;ve++){var he=se.voices[ve],ce=q.voices[ve];A&&he.push({el_type:"break"}),ce&&(se.voices[ve]=he.concat(ce))}}else{for(var de=0;de<G.staff.length;de++)C[de]=G.staff[de].key,_[de]=G.staff[de].meter,m[de]=G.staff[de].clef;M.push(p(G))}w=!0}else w=!1,M.push(G)}return M}function r(y,S){return y==="abselem"?"abselem":S}function a(y,S){y.el_type="meter",y.startChar=-1,y.endChar=-1;for(var A=0;A<S.length;A++)S[A].unshift(y)}function l(y,S){y.el_type="key",y.startChar=-1,y.endChar=-1;for(var A=0;A<S.length;A++)S[A].unshift(y)}function u(y,S){y.el_type="clef",y.startChar=-1,y.endChar=-1;for(var A=0;A<S.length;A++)S[A].unshift(y)}function c(y,S,A){y.el_type="font",y.type=A,y.startChar=-1,y.endChar=-1;for(var M=0;M<S.length;M++)S[M].unshift(y)}function f(y,S){if(!y)return!0;var A=JSON.stringify(y,r),M=JSON.stringify(S,r);return A===M}function p(y){for(var S={},A=Object.keys(y),M=0;M<A.length;M++)if(A[M]!=="staff")S[A[M]]=y[A[M]];else{S.staff=[];for(var w=0;w<y.staff.length;w++){for(var _={},C=Object.keys(y.staff[w]),m=0;m<C.length;m++)if(C[m]!=="voices")_[C[m]]=y.staff[w][C[m]];else{_.voices=[];for(var T=0;T<y.staff[w].voices.length;T++)_.voices.push([].concat(y.staff[w].voices[T]))}S.staff.push(_)}}return S}return Wm=t,Wm}var Gm,s5;function H9(){if(s5)return Gm;s5=1;var t=Bo(),r=ss(),a=q9(),l=KI(),u=XI(),c=function(){this.reset=function(){this.version="1.1.0",this.media="screen",this.metaText={},this.metaTextInfo={},this.formatting={},this.lines=[],this.staffNum=0,this.voiceNum=0,this.lineNum=0,this.runningFonts={},delete this.visualTranspose},this.reset();function f(w,_,C,m){for(var T=0;T<m.length;T++)w[C][m[T]]=_[C][m[T]]}this.copyTopInfo=function(w){var _=["tempo","title","header","rhythm","origin","composer","author","partOrder"];f(this,w,"metaText",_),f(this,w,"metaTextInfo",_)},this.copyBottomInfo=function(w){var _=["unalignedWords","book","source","discography","notes","transcription","history","abc-copyright","abc-creator","abc-edited-by","footer"];f(this,w,"metaText",_),f(this,w,"metaTextInfo",_)},this.getBeatLength=function(){var w=this.getMeterFraction(),_=1;return(w.num===6||w.num===9||w.num===12||w.num===3&&w.den===8)&&(_=3),_/w.den};function p(w,_){for(var C=0,m=0;m<w.length;m++)if(w[m].staff)for(var T=0;T<w[m].staff.length;T++)for(var L=0;L<w[m].staff[T].voices.length;L++)for(var N=w[m].staff[T].voices[L],B=1,W=0;W<N.length;W++){var G=N[W].rest&&N[W].rest.type==="spacer";if(N[W].startTriplet&&(B=N[W].tripletMultiplier),N[W].duration&&!G&&N[W].el_type!=="tempo"&&(C+=N[W].duration*B),N[W].endTriplet&&(B=1),C>=_&&(C-=_),N[W].el_type==="bar")return C}return C}this.getPickupLength=function(){var w=this.getBarLength(),_=p(this.lines,w);return _<1e-8||w-_<1e-8?0:_},this.getBarLength=function(){var w=this.getMeterFraction();return w.num/w.den},this.getTotalTime=function(){return this.totalTime},this.getTotalBeats=function(){return this.totalBeats},this.millisecondsPerMeasure=function(w){var _;if(w)_=w;else{var C=this.metaText?this.metaText.tempo:null;_=this.getBpm(C)}_<=0&&(_=1);var m=this.getBeatsPerMeasure(),T=m/_;return T*6e4},this.getBeatsPerMeasure=function(){var w=this.getBeatLength(),_=this.getBarLength();return _/w},this.getMeter=function(){for(var w=0;w<this.lines.length;w++){var _=this.lines[w];if(_.staff)for(var C=0;C<_.staff.length;C++){var m=_.staff[C].meter;if(m)return m}}return{type:"common_time"}},this.getMeterFraction=function(){var w=this.getMeter(),_=4,C=4;return w&&(w.type==="specified"?(_=parseInt(w.value[0].num,10),C=parseInt(w.value[0].den,10)):w.type==="cut_time"?(_=2,C=2):w.type==="common_time"&&(_=4,C=4)),this.meter={num:_,den:C},this.meter},this.getKeySignature=function(){for(var w=0;w<this.lines.length;w++){var _=this.lines[w];if(_.staff){for(var C=0;C<_.staff.length;C++)if(_.staff[C].key)return _.staff[C].key}}return{}},this.getElementFromChar=function(w){for(var _=0;_<this.lines.length;_++){var C=this.lines[_];if(C.staff)for(var m=0;m<C.staff.length;m++)for(var T=C.staff[m],L=0;L<T.voices.length;L++)for(var N=T.voices[L],B=0;B<N.length;B++){var W=N[B];if(W.startChar&&W.endChar&&W.startChar<=w&&W.endChar>w)return W}}return null};function y(w){for(var _,C,m,T,L=w.length-1;L>=0;L--){var N=w[L];N.type==="bar"?(N.top=m,N.nextTop=_,_=m,N.bottom=T,N.nextBottom=C,C=T):N.type==="event"&&(m=N.top,T=N.top+N.height)}}function S(w){var _=[];for(var C in w)w.hasOwnProperty(C)&&_.push(w[C]);return _=_.sort(function(m,T){var L=m.milliseconds-T.milliseconds;return L!==0?L:m.type==="bar"?-1:1}),_}this.addElementToEvents=function(w,_,C,m,T,L,N,B,W,G){if(_.hint)return{isTiedState:void 0,duration:0};var R=_.durationClass?_.durationClass:_.duration;if(_.abcelem.rest&&_.abcelem.rest.type==="spacer"&&(R=0),R>0){for(var ye=[],q=0;q<_.elemset.length;q++)_.elemset[q]!==null&&ye.push(_.elemset[q]);var se=_.startTie;if(W!==void 0)w["event"+W].elements.push(ye),G&&(w["event"+C]||(w["event"+C]={type:"event",milliseconds:C,line:L,measureNumber:N,top:m,height:T,left:null,width:0,elements:[],startChar:null,endChar:null,startCharArray:[],endCharArray:[]}),w["event"+C].measureStart=!0,G=!1),se||(W=void 0);else{if(!w["event"+C])w["event"+C]={type:"event",milliseconds:C,line:L,measureNumber:N,top:m,height:T,left:_.x,width:_.w,elements:[ye],startChar:_.abcelem.startChar,endChar:_.abcelem.endChar,startCharArray:[_.abcelem.startChar],endCharArray:[_.abcelem.endChar],midiPitches:_.abcelem.midiPitches?t.cloneArray(_.abcelem.midiPitches):[]},_.abcelem.midiGraceNotePitches&&(w["event"+C].midiGraceNotePitches=t.cloneArray(_.abcelem.midiGraceNotePitches));else{if(w["event"+C].left?w["event"+C].left=Math.min(w["event"+C].left,_.x):w["event"+C].left=_.x,w["event"+C].elements.push(ye),w["event"+C].startCharArray.push(_.abcelem.startChar),w["event"+C].endCharArray.push(_.abcelem.endChar),w["event"+C].startChar===null&&(w["event"+C].startChar=_.abcelem.startChar),w["event"+C].endChar===null&&(w["event"+C].endChar=_.abcelem.endChar),_.abcelem.midiPitches&&_.abcelem.midiPitches.length){w["event"+C].midiPitches||(w["event"+C].midiPitches=[]);for(var q=0;q<_.abcelem.midiPitches.length;q++)w["event"+C].midiPitches.push(_.abcelem.midiPitches[q])}if(_.abcelem.midiGraceNotePitches&&_.abcelem.midiGraceNotePitches.length){w["event"+C].midiGraceNotePitches||(w["event"+C].midiGraceNotePitches=[]);for(var ve=0;ve<_.abcelem.midiGraceNotePitches.length;ve++)w["event"+C].midiGraceNotePitches.push(_.abcelem.midiGraceNotePitches[ve])}}G&&(w["event"+C].measureStart=!0,G=!1)}}return{isTiedState:W,duration:R/B,nextIsBar:G||_.type==="bar"}},this.makeVoicesArray=function(){for(var w=[],_=[],C={},m=0;m<this.engraver.staffgroups.length;m++){var T=this.engraver.staffgroups[m];if(T&&T.staffs&&T.staffs.length>0){var L=T.staffs[0],N=L.absoluteY,B=N-L.top*r.STEP,W=T.staffs[T.staffs.length-1];N=W.absoluteY;for(var G=N-W.bottom*r.STEP,R=G-B,ye=T.voices,q=0;q<ye.length;q++)if(!(ye[q].staff&&ye[q].staff.isTabStaff)){var se=!1;w[q]||(w[q]=[]),_[q]===void 0&&(_[q]=0);for(var ve=ye[q].children,he=0;he<ve.length;he++)ve[he].type==="tempo"&&(C[_[q]]=this.getBpm(ve[he].abcelem)),w[q].push({top:B,height:R,line:T.line,measureNumber:_[q],elem:ve[he]}),ve[he].type==="bar"&&se&&_[q]++,(ve[he].type==="note"||ve[he].type==="rest")&&(se=!0)}}}return this.tempoLocations=C,w},this.setupEvents=function(w,_,C,m){m||(m=1);for(var T=[],L={},N=w,B,W=!0,G=this.makeVoicesArray(),R=0,ye=0;ye<G.length;ye++){var q=N,se=Math.round(q*1e3),ve=0,he=-1,ce=G[ye],de=C;_=this.getBeatLength()*de/60;for(var K=-1,Q=0;Q<ce.length;Q++){var le=ce[Q].measureNumber;K!==le&&this.tempoLocations[le]&&(de=this.tempoLocations[le],_=m*this.getBeatLength()*de/60,K=le);var Ee=ce[Q].elem,Me=this.addElementToEvents(L,Ee,se,ce[Q].top,ce[Q].height,ce[Q].line,ce[Q].measureNumber,_,B,W);B=Me.isTiedState,W=Me.nextIsBar,q+=Me.duration;var H;if(Ee.duration>0&&L["event"+se]&&(H="event"+se),se=Math.round(q*1e3),Ee.type==="bar"){var Y=Ee.abcelem.type,X=Y==="bar_right_repeat"||Y==="bar_dbl_repeat",xe=Ee.abcelem.startEnding==="1",De=Y==="bar_left_repeat"||Y==="bar_dbl_repeat"||Y==="bar_right_repeat";if(X){Q>0&&(L[H].endX=Ee.x),he===-1&&(he=Q);var $e=0;K=-1;for(var Re=ve;Re<he;Re++){le=ce[Re].measureNumber,K!==le&&this.tempoLocations[le]&&(de=this.tempoLocations[le],_=m*this.getBeatLength()*de/60,K=le);var ut=ce[Re].elem;Me=this.addElementToEvents(L,ut,se,ce[Re].top,ce[Re].height,ce[Re].line,ce[Re].measureNumber,_,B,W),B=Me.isTiedState,W=Me.nextIsBar,q+=Me.duration,$e=se,se=Math.round(q*1e3)}L["event"+$e]&&(L["event"+$e].endX=ce[he].elem.x),W=!0,he=-1}xe&&(he=Q),De&&(ve=Q)}}R=Math.max(R,se)}return T=S(L),y(T),M(this.lines,T),T.push({type:"end",milliseconds:R}),this.addUsefulCallbackInfo(T,de*m),T},this.addUsefulCallbackInfo=function(w,_){for(var C=this.millisecondsPerMeasure(_),m=0;m<w.length;m++){var T=w[m];T.millisecondsPerMeasure=C}};function A(w,_){for(;_<w.length&&w[_].left===null;)_++;return w[_]}function M(w,_){if(!(_.length<1)){for(var C=0;C<_.length-1;C++){var m=_[C],T=A(_,C+1);if(m.left!==null){var L=T&&m.top===T.top?T.left:w[m.line].staffGroup.w;m.endX!==void 0?L>m.left&&(m.endX=Math.min(m.endX,L)):m.endX=L}}var N=_[_.length-1];N.endX=w[N.line].staffGroup.w}}this.getBpm=function(w){var _;if(w||(w=this.metaText?this.metaText.tempo:null),w){_=w.bpm;var C=this.getBeatLength(),m=w.duration&&w.duration.length>0?w.duration[0]:C;_=_*m/C}if(!_){_=180;var T=this.getMeterFraction();T&&T.num!==3&&T.num%3===0&&(_=120)}return _},this.setTiming=function(w,_){if(_=_||0,!this.engraver||!this.engraver.staffgroups)return console.log("setTiming cannot be called before the tune is drawn."),this.noteTimings=[],this.noteTimings;var C=this.metaText?this.metaText.tempo:null,m=this.getBpm(C),T=1;w?C&&(T=w/m):w=m;var L=this.getBeatLength(),N=w/60,B=this.getBarLength(),W=B/L*_/N;W&&(W-=this.getPickupLength()/L/N);var G=L*N;return this.noteTimings=this.setupEvents(W,G,w,T),this.noteTimings.length>0?(this.totalTime=this.noteTimings[this.noteTimings.length-1].milliseconds/1e3,this.totalBeats=this.totalTime*N):(this.totalTime=void 0,this.totalBeats=void 0),this.noteTimings},this.setUpAudio=function(w){w||(w={});var _=a(this,w);return l(_,w,this.formatting.percmap,this.formatting.midi)},this.deline=function(w){return u(this.lines,w)},this.findSelectableElement=function(w){return this.engraver&&this.engraver.selectables?this.engraver.findSelectableElement(w):null},this.getSelectableArray=function(){return this.engraver&&this.engraver.selectables?this.engraver.selectables:[]}};return Gm=c,Gm}var Ym,a5;function QI(){if(a5)return Ym;a5=1;var t=$y(),r=function(q){var se=this,ve={},he="";q.reset(),this.setVisualTranspose=function(ce){ce&&(q.visualTranspose=ce)},this.cleanUp=function(ce,de,K){_(q),delete q.runningFonts,l(q),q.metaText.tempo&&q.metaText.tempo.bpm&&!q.metaText.tempo.duration&&(q.metaText.tempo.duration=[q.getBeatLength()]);var Q=!1,le,Ee,Me;for(le=0;le<q.lines.length;le++)if(q.lines[le].staff!==void 0){var H=!1;for(Ee=0;Ee<q.lines[le].staff.length;Ee++)if(q.lines[le].staff[Ee]===void 0)Q=!0,q.lines[le].staff[Ee]=null;else for(Me=0;Me<q.lines[le].staff[Ee].voices.length;Me++)q.lines[le].staff[Ee].voices[Me]===void 0?q.lines[le].staff[Ee].voices[Me]=[]:C(q.lines[le].staff[Ee].voices[Me])&&(H=!0);H||(q.lines[le]=null,Q=!0)}if(Q&&(q.lines=q.lines.filter(function(Re){return!!Re}),q.lines.forEach(function(Re){Re.staff&&(Re.staff=Re.staff.filter(function(ut){return!!ut}))})),ce)for(;y(q.lines,ce););if(de){for(Q=!1,le=0;le<q.lines.length;le++)if(q.lines[le].staff!==void 0)for(Ee=0;Ee<q.lines[le].staff.length;Ee++){var Y=!1;for(Me=0;Me<q.lines[le].staff[Ee].voices.length;Me++)m(q.lines[le].staff[Ee].voices[Me])&&(Y=!0);Y||(Q=!0,q.lines[le].staff[Ee]=null)}Q&&q.lines.forEach(function(Re){Re.staff&&(Re.staff=Re.staff.filter(function(ut){return!!ut}))})}for(f(q.lines),le=0;le<q.lines.length;le++)if(q.lines[le].staff)for(Ee=0;Ee<q.lines[le].staff.length;Ee++)delete q.lines[le].staff[Ee].workingClef;for(;u(q););for(var le=0;le<q.lines.length;le++){var X=q.lines[le].staff;if(X)for(q.staffNum=0;q.staffNum<X.length;q.staffNum++)for(X[q.staffNum].clef&&t.fixClef(X[q.staffNum].clef),q.voiceNum=0;q.voiceNum<X[q.staffNum].voices.length;q.voiceNum++){var xe=X[q.staffNum].voices[q.voiceNum];p(xe,q.staffNum,q.voiceNum,K);for(var De=0;De<xe.length;De++)xe[De].el_type==="clef"&&t.fixClef(xe[De]);if(xe.length>0&&xe[xe.length-1].barNumber){var $e=A(q.lines,le);$e&&($e.staff[0].barNumber=xe[xe.length-1].barNumber),delete xe[xe.length-1].barNumber}}}return delete q.staffNum,delete q.voiceNum,delete q.lineNum,delete q.potentialStartBeam,delete q.potentialEndBeam,delete q.vskipPending,K},this.addTieToLastNote=function(ce){var de=M(q);return de&&de.pitches&&de.pitches.length>0?(de.pitches[0].startTie={},ce&&(de.pitches[0].startTie.style="dotted"),!0):!1},this.appendElement=function(ce,de,K,Q){if(Q.el_type=ce,de!==null&&(Q.startChar=de),K!==null&&(Q.endChar=K),ce==="note"){var le=w(Q);le>=.25||Q.force_end_beam_last&&q.potentialStartBeam!==void 0?B(q):Q.end_beam&&q.potentialStartBeam!==void 0?Q.rest===void 0?N(Q,q):B(q):Q.rest===void 0&&(q.potentialStartBeam===void 0?Q.end_beam||(q.potentialStartBeam=Q,delete q.potentialEndBeam):q.potentialEndBeam=Q)}else B(q);return delete Q.end_beam,delete Q.force_end_beam_last,Q.rest&&Q.rest.type==="invisible"&&delete Q.decoration,q.lines.length<=q.lineNum||q.lines[q.lineNum].staff.length<=q.staffNum?!1:(L(se,q,Q,ve,he),!0)},this.appendStartingElement=function(ce,de,K,Q){_(q);var le;ce==="key"&&(le=Q.impliedNaturals,delete Q.impliedNaturals,delete Q.explicitAccidentals);var Ee=Object.assign({},Q);if(q.lines[q.lineNum]){var Me=q.lines[q.lineNum].staff;if(Me){Me.length<=q.staffNum&&(Me[q.staffNum]={},Me[q.staffNum].clef=Object.assign({},Me[0].clef),Me[q.staffNum].key=Object.assign({},Me[0].key),Me[0].meter&&(Me[q.staffNum].meter=Object.assign({},Me[0].meter)),Me[q.staffNum].workingClef=Object.assign({},Me[0].workingClef),Me[q.staffNum].voices=[[]]),ce==="clef"&&(Me[q.staffNum].workingClef=Ee);for(var H=Me[q.staffNum].voices[q.voiceNum],Y=0;Y<H.length;Y++){if(H[Y].el_type==="note"||H[Y].el_type==="bar"){Ee.el_type=ce,Ee.startChar=de,Ee.endChar=K,le&&(Ee.accidentals=le.concat(Ee.accidentals)),H.push(Ee);return}if(H[Y].el_type===ce){Ee.el_type=ce,Ee.startChar=de,Ee.endChar=K,le&&(Ee.accidentals=le.concat(Ee.accidentals)),H[Y]=Ee;return}}Me[q.staffNum][ce]=Q}}},this.addSubtitle=function(ce,de){T(q,{subtitle:{text:ce,startChar:de.startChar,endChar:de.endChar}})},this.addSpacing=function(ce){q.vskipPending=ce},this.addNewPage=function(ce){T(q,{newpage:ce})},this.addSeparator=function(ce,de,K,Q){T(q,{separator:{spaceAbove:Math.round(ce),spaceBelow:Math.round(de),lineLength:Math.round(K),startChar:Q.startChar,endChar:Q.endChar}})},this.addText=function(ce,de){T(q,{text:{text:ce,startChar:de.startChar,endChar:de.endChar}})},this.addCentered=function(ce){T(q,{text:[{text:ce,center:!0}]})},this.changeVoiceScale=function(ce){se.appendElement("scale",null,null,{size:ce})},this.changeVoiceColor=function(ce){se.appendElement("color",null,null,{color:ce})},this.startNewLine=function(ce){_(q),ce.currentVoiceName&&(he=ce.currentVoiceName,ve[ce.currentVoiceName]=ce),q.lines[q.lineNum]===void 0?ye(se,q,ce):q.lines[q.lineNum].staff===void 0?(q.lineNum++,this.startNewLine(ce)):q.lines[q.lineNum].staff[q.staffNum]===void 0?R(se,q,ce):q.lines[q.lineNum].staff[q.staffNum].voices[q.voiceNum]===void 0?G(se,q,ce):C(q.lines[q.lineNum].staff[q.staffNum].voices[q.voiceNum])?(q.lineNum++,this.startNewLine(ce)):ce.part&&se.appendElement("part",ce.part.startChar,ce.part.endChar,{title:ce.part.title})},this.setRunningFont=function(ce,de){q.runningFonts[ce]=de},this.setBarNumberImmediate=function(ce){var de=this.getCurrentVoice();if(de&&de.length>0){var K=de[de.length-1];if(K.el_type==="bar")K.barNumber!==void 0&&(K.barNumber=ce);else return ce-1}return ce},this.hasBeginMusic=function(){for(var ce=0;ce<q.lines.length;ce++)if(q.lines[ce].staff)return!0;return!1},this.isFirstLine=function(ce){for(var de=ce-1;de>=0;de--)if(q.lines[de].staff!==void 0)return!1;return!0},this.getCurrentVoice=function(){var ce=S(q.lines,q.lineNum);if(!ce)return null;var de=ce.staff[q.staffNum];return de&&de.voices[q.voiceNum]!==void 0?de.voices[q.voiceNum]:null},this.setCurrentVoice=function(ce,de,K){q.staffNum=ce,q.voiceNum=de,he=K;for(var Q=0;Q<q.lines.length;Q++)if(q.lines[Q].staff&&(q.lines[Q].staff[ce]===void 0||q.lines[Q].staff[ce].voices[de]===void 0||!C(q.lines[Q].staff[ce].voices[de])))return q.lineNum=Q,!!(!q.lines[Q].staff[ce]||q.lines[Q].staff[ce].voices[de]);return q.lineNum=Q,!1},this.addMetaText=function(ce,de,K){q.metaText[ce]===void 0?(q.metaText[ce]=de,q.metaTextInfo[ce]=K):(typeof q.metaText[ce]=="string"&&typeof de=="string"?q.metaText[ce]+=`
|
|
147
|
+
`+de:(q.metaText[ce]==="string"&&(q.metaText[ce]=[{text:q.metaText[ce]}]),typeof de=="string"&&(de=[{text:de}]),q.metaText[ce]=q.metaText[ce].concat(de)),q.metaTextInfo[ce].endChar=K.endChar)},this.addMetaTextArray=function(ce,de,K){q.metaText[ce]===void 0?(q.metaText[ce]=[de],q.metaTextInfo[ce]=K):(q.metaText[ce].push(de),q.metaTextInfo[ce].endChar=K.endChar)},this.addMetaTextObj=function(ce,de,K){q.metaText[ce]=de,q.metaTextInfo[ce]=K}};function a(q){if(!q||typeof q=="string")return!1;for(var se=0;se<q.length;se++)if(typeof q[se]!="string")return!1;return!0}function l(q){a(q.metaText.notes)&&(q.metaText.notes=q.metaText.notes.join(`
|
|
148
|
+
`)),a(q.metaText.history)&&(q.metaText.history=q.metaText.history.join(`
|
|
149
|
+
`))}function u(q){for(var se=!1,ve=[],he=0;he<q.lines.length;he++){var ce=q.lines[he];if(ce.staff)for(var de=0;de<ce.staff.length;de++){for(var K=ce.staff[de],Q=[],le=0;le<K.voices.length;le++){var Ee=K.voices[le];Q.push({hasOverlay:!1,voice:[],snip:[]}),ve[he]=0;for(var Me=0,H=!1,Y=-1,X=0;X<Ee.length;X++){var xe=Ee[X];if(xe.el_type==="overlay"&&!H){se=!0,H=!0,Y=X,Q[le].hasOverlay=!0;for(var De=0;De<he;De++)ve[De]&&q.lines[De].staff&&K.voices.length>=q.lines[De].staff[0].voices.length&&q.lines[De].staff[0].voices.push([{el_type:"note",duration:ve[De],rest:{type:"invisible"},startChar:xe.startChar,endChar:xe.endChar}])}else xe.el_type==="bar"?(H?(H=!1,Q[le].snip.push({start:Y,len:X-Y}),Q[le].voice.push(xe)):(Me>0&&Q[le].voice.push({el_type:"note",duration:Me,rest:{type:"invisible"},startChar:xe.startChar,endChar:xe.endChar}),Q[le].voice.push(xe)),Me=0):xe.el_type==="note"?H?Q[le].voice.push(xe):(Me+=xe.duration,ve[he]+=xe.duration):(xe.el_type==="scale"||xe.el_type==="stem"||xe.el_type==="overlay"||xe.el_type==="style"||xe.el_type==="transpose"||xe.el_type==="color")&&Q[le].voice.push(xe)}Q[le].hasOverlay&&Q[le].snip.length===0&&Q[le].snip.push({start:Y,len:Ee.length-Y})}for(le=0;le<Q.length;le++){var $e=Q[le];if($e.hasOverlay){$e.voice.splice(0,0,{el_type:"stem",direction:"down"}),K.voices.push($e.voice);for(var Re=$e.snip.length-1;Re>=0;Re--){var ut=$e.snip[Re];K.voices[le].splice(ut.start,ut.len),K.voices[le].splice(ut.start+1,0,{el_type:"stem",direction:"auto"});var Lt=c(K.voices[le],ut.start);K.voices[le].splice(Lt,0,{el_type:"stem",direction:"up"})}for(Re=0;Re<K.voices[K.voices.length-1].length;Re++){K.voices[K.voices.length-1][Re]=Object.assign({},K.voices[K.voices.length-1][Re]);var it=K.voices[K.voices.length-1][Re];it.el_type==="bar"&&it.startEnding&&delete it.startEnding,it.el_type==="bar"&&it.endEnding&&delete it.endEnding}}}}}return se}function c(q,se){for(var ve=se-1;ve>0&&q[ve].el_type!=="bar";ve--);return ve}function f(q){for(var se=!0,ve=0;ve<q.length;ve++){var he=q[ve];if(he.staff){for(var ce=0;ce<he.staff.length;ce++){var de=he.staff[ce];if(de.title){for(var K=!1,Q=0;Q<de.title.length;Q++)de.title[Q]?(de.title[Q]=se?de.title[Q].name:de.title[Q].subname,de.title[Q]?K=!0:de.title[Q]=""):de.title[Q]="";K||delete de.title}}se=!1}}}function p(q,se,ve,he){he[se]||(he[se]=[]),he[se][ve]||(he[se][ve]=[]);for(var ce,de=function(Re,ut,Lt){if(he[se][ve][Lt]===void 0){for(ce=0;ce<he[se][ve].length;ce++)if(he[se][ve][ce]!==void 0){Lt=ce;break}if(he[se][ve][Lt]===void 0){var it=Lt*100+1;Re.endSlur.forEach(function(at){it===at&&--it}),he[se][ve][Lt]=[it]}}for(var Ct,It=0;It<ut;It++)Ct=he[se][ve][Lt].pop(),Re.endSlur.push(Ct);return he[se][ve][Lt].length===0&&delete he[se][ve][Lt],Ct},K=function(Re,ut,Lt,it){Re.startSlur=[],he[se][ve][Lt]===void 0&&(he[se][ve][Lt]=[]);for(var Ct=Lt*100+1,It=0;It<ut;It++)it&&(it.forEach(function(at){Ct===at&&++Ct}),it.forEach(function(at){Ct===at&&++Ct}),it.forEach(function(at){Ct===at&&++Ct})),he[se][ve][Lt].forEach(function(at){Ct===at&&++Ct}),he[se][ve][Lt].forEach(function(at){Ct===at&&++Ct}),he[se][ve][Lt].push(Ct),Re.startSlur.push({label:Ct}),Re.dottedSlur&&(Re.startSlur[Re.startSlur.length-1].style="dotted",delete Re.dottedSlur),Ct++},Q=0;Q<q.length;Q++){var le=q[Q];if(le.el_type==="note"){if(le.gracenotes)for(var Ee=0;Ee<le.gracenotes.length;Ee++){if(le.gracenotes[Ee].endSlur){var Me=le.gracenotes[Ee].endSlur;le.gracenotes[Ee].endSlur=[];for(var H=0;H<Me;H++)de(le.gracenotes[Ee],1,20)}le.gracenotes[Ee].startSlur&&(ce=le.gracenotes[Ee].startSlur,K(le.gracenotes[Ee],ce,20))}if(le.endSlur&&(ce=le.endSlur,le.endSlur=[],de(le,ce,0)),le.startSlur&&(ce=le.startSlur,K(le,ce,0)),le.pitches){for(var Y=[],X=0;X<le.pitches.length;X++)if(le.pitches[X].endSlur){var xe=le.pitches[X].endSlur;le.pitches[X].endSlur=[];for(var De=0;De<xe;De++){var $e=de(le.pitches[X],1,X+1);Y.push($e)}}for(X=0;X<le.pitches.length;X++)le.pitches[X].startSlur&&(ce=le.pitches[X].startSlur,K(le.pitches[X],ce,X+1,Y));le.gracenotes&&le.pitches[0].endSlur&&le.pitches[0].endSlur[0]===100&&le.pitches[0].startSlur&&(le.gracenotes[0].endSlur?le.gracenotes[0].endSlur.push(le.pitches[0].startSlur[0].label):le.gracenotes[0].endSlur=[le.pitches[0].startSlur[0].label],le.pitches[0].endSlur.length===1?delete le.pitches[0].endSlur:le.pitches[0].endSlur[0]===100?le.pitches[0].endSlur.shift():le.pitches[0].endSlur[le.pitches[0].endSlur.length-1]===100&&le.pitches[0].endSlur.pop(),he[se][ve][1].length===1?delete he[se][ve][1]:he[se][ve][1].pop())}}}}function y(q,se){for(i=0;i<q.length;i++)if(q[i].staff!==void 0)for(s=0;s<q[i].staff.length;s++){var ve=[];for(v=0;v<q[i].staff[s].voices.length;v++)for(var he=q[i].staff[s].voices[v],ce=0,de=0;de<he.length;de++)if(he[de].el_type==="bar"){if(ce++,ce>=se&&de<he.length-1){var K=A(q,i);if(!K){var Q=JSON.parse(JSON.stringify(q[i]));q.push(Object.assign({},Q)),K=q[q.length-1];for(var le=0;le<K.staff.length;le++)for(var Ee=0;Ee<K.staff[le].voices.length;Ee++)K.staff[le].voices[Ee]=[]}var Me=de+1,H=q[i].staff[s].voices[v].slice(Me);return q[i].staff[s].voices[v]=q[i].staff[s].voices[v].slice(0,Me),K.staff[s].voices[v]=ve.concat(H.concat(K.staff[s].voices[v])),!0}}else he[de].duration||ve.push(he[de])}return!1}function S(q,se){for(;se>=0;){if(q[se].staff)return q[se];se--}return null}function A(q,se){for(se++;q.length>se;){if(q[se].staff)return q[se];se++}return null}function M(q){if(!q.lines[q.lineNum]||!q.lines[q.lineNum].staff||!q.lines[q.lineNum].staff[q.staffNum])return null;var se=q.lines[q.lineNum].staff[q.staffNum].voices[q.voiceNum];if(!se)return null;for(var ve=se.length-1;ve>=0;ve--){var he=se[ve];if(he.el_type==="note")return he}return null}function w(q){return q.duration?q.duration:0}function _(q){q.potentialStartBeam&&q.potentialEndBeam&&(q.potentialStartBeam.startBeam=!0,q.potentialEndBeam.endBeam=!0),delete q.potentialStartBeam,delete q.potentialEndBeam}function C(q){for(var se=0;se<q.length;se++)if(q[se].el_type==="note"||q[se].el_type==="bar")return!0;return!1}function m(q){for(var se=0;se<q.length;se++)if(q[se].el_type==="note"&&(q[se].rest===void 0||q[se].chord!==void 0))return!0;return!1}function T(q,se){q.vskipPending&&(se.vskip=q.vskipPending,delete q.vskipPending),q.lines.push(se)}function L(q,se,ve,he,ce){var de=se.lines[se.lineNum].staff[se.staffNum];if(ve.pitches!==void 0){var K=de.workingClef.verticalPos;ve.pitches.forEach(function(le){le.verticalPos=le.pitch-K})}if(ve.gracenotes!==void 0){var Q=de.workingClef.verticalPos;ve.gracenotes.forEach(function(le){le.verticalPos=le.pitch-Q})}de.voices.length<=se.voiceNum&&(he[ce]||(he[ce]={}),G(q,se,he[ce])),de.voices[se.voiceNum].push(ve)}function N(q,se){se.potentialStartBeam.startBeam=!0,q.endBeam=!0,delete se.potentialStartBeam,delete se.potentialEndBeam}function B(q){q.potentialStartBeam!==void 0&&q.potentialEndBeam!==void 0&&(q.potentialStartBeam.startBeam=!0,q.potentialEndBeam.endBeam=!0),delete q.potentialStartBeam,delete q.potentialEndBeam}function W(q,se,ve){if(q.runningFonts[se]){for(var he=!1,ce=Object.keys(ve),de=0;de<ce.length;de++)q.runningFonts[se][ce[de]]!==ve[ce[de]]&&(he=!0);he&&(q.lines[q.lineNum].staff[q.staffNum][se]=ve)}q.runningFonts[se]=ve}function G(q,se,ve){var he=se.lines[se.lineNum].staff[se.staffNum];if(he.voices[se.voiceNum]=[],he.title||(he.title=[]),he.title[se.voiceNum]={name:ve.name,subname:ve.subname},ve.style&&q.appendElement("style",null,null,{head:ve.style}),ve.stem)q.appendElement("stem",null,null,{direction:ve.stem});else if(se.voiceNum>0){if(he.voices[0]!==void 0){for(var ce=!1,de=0;de<he.voices[0].length;de++)he.voices[0].el_type==="stem"&&(ce=!0);if(!ce){var K={el_type:"stem",direction:"up"};he.voices[0].splice(0,0,K)}}q.appendElement("stem",null,null,{direction:"down"})}ve.scale&&q.appendElement("scale",null,null,{size:ve.scale}),ve.color&&q.appendElement("color",null,null,{color:ve.color})}function R(q,se,ve){ve.key&&ve.key.impliedNaturals&&(ve.key.accidentals=ve.key.accidentals.concat(ve.key.impliedNaturals),delete ve.key.impliedNaturals),se.lines[se.lineNum].staff[se.staffNum]={voices:[],clef:ve.clef,key:ve.key,workingClef:ve.clef};var he=se.lines[se.lineNum].staff[se.staffNum];ve.stafflines!==void 0&&(he.clef.stafflines=ve.stafflines,he.workingClef.stafflines=ve.stafflines),ve.staffscale&&(he.staffscale=ve.staffscale),ve.annotationfont&&W(se,"annotationfont",ve.annotationfont),ve.gchordfont&&W(se,"gchordfont",ve.gchordfont),ve.tripletfont&&W(se,"tripletfont",ve.tripletfont),ve.vocalfont&&W(se,"vocalfont",ve.vocalfont),ve.bracket&&(he.bracket=ve.bracket),ve.brace&&(he.brace=ve.brace),ve.connectBarLines&&(he.connectBarLines=ve.connectBarLines),ve.barNumber&&(he.barNumber=ve.barNumber),G(q,se,ve),ve.part&&q.appendElement("part",ve.part.startChar,ve.part.endChar,{title:ve.part.title}),ve.meter!==void 0&&(he.meter=ve.meter),se.vskipPending&&(se.lines[se.lineNum].vskip=se.vskipPending,delete se.vskipPending)}function ye(q,se,ve){se.lines[se.lineNum]={staff:[]},R(q,se,ve)}return Ym=r,Ym}var Km,o5;function V9(){if(o5)return Km;o5=1;var t=Bo(),r=Uy(),a=UI(),l=WI(),u=GI(),c=F9(),f=H9(),p=QI(),y=function(){var S=new f,A=new p(S),M,w="",_="";this.getTune=function(){var de={formatting:S.formatting,lines:S.lines,media:S.media,metaText:S.metaText,metaTextInfo:S.metaTextInfo,version:S.version,addElementToEvents:S.addElementToEvents,addUsefulCallbackInfo:S.addUsefulCallbackInfo,getTotalTime:S.getTotalTime,getTotalBeats:S.getTotalBeats,getBarLength:S.getBarLength,getBeatLength:S.getBeatLength,getBeatsPerMeasure:S.getBeatsPerMeasure,getBpm:S.getBpm,getMeter:S.getMeter,getMeterFraction:S.getMeterFraction,getPickupLength:S.getPickupLength,getKeySignature:S.getKeySignature,getElementFromChar:S.getElementFromChar,makeVoicesArray:S.makeVoicesArray,millisecondsPerMeasure:S.millisecondsPerMeasure,setupEvents:S.setupEvents,setTiming:S.setTiming,setUpAudio:S.setUpAudio,deline:S.deline,findSelectableElement:S.findSelectableElement,getSelectableArray:S.getSelectableArray};return S.lineBreaks&&(de.lineBreaks=S.lineBreaks),S.visualTranspose&&(de.visualTranspose=S.visualTranspose),de};function C(de,K,Q){de.positioning||(de.positioning={}),de.positioning[K]=Q}function m(de,K,Q){de.fonts||(de.fonts={}),de.fonts[K]=Q}var T={reset:function(){for(var de in this)this.hasOwnProperty(de)&&typeof this[de]!="function"&&delete this[de];this.iChar=0,this.key={accidentals:[],root:"none",acc:"",mode:""},this.meter=null,this.origMeter=null,this.hasMainTitle=!1,this.default_length=.125,this.clef={type:"treble",verticalPos:0},this.octave=0,this.next_note_duration=0,this.start_new_line=!0,this.is_in_header=!0,this.partForNextLine={},this.tempoForNextLine=[],this.havent_set_length=!0,this.voices={},this.staves=[],this.macros={},this.currBarNumber=1,this.barCounter={},this.ignoredDecorations=[],this.score_is_present=!1,this.inEnding=!1,this.inTie=[],this.inTieChord={},this.vocalPosition="auto",this.dynamicPosition="auto",this.chordPosition="auto",this.ornamentPosition="auto",this.volumePosition="auto",this.openSlurs=[],this.freegchord=!1,this.endingHoldOver={}},differentFont:function(de,K){return this[de].decoration!==K[de].decoration||this[de].face!==K[de].face||this[de].size!==K[de].size||this[de].style!==K[de].style||this[de].weight!==K[de].weight},addFormattingOptions:function(de,K,Q){Q==="note"?(this.vocalPosition!=="auto"&&C(de,"vocalPosition",this.vocalPosition),this.dynamicPosition!=="auto"&&C(de,"dynamicPosition",this.dynamicPosition),this.chordPosition!=="auto"&&C(de,"chordPosition",this.chordPosition),this.ornamentPosition!=="auto"&&C(de,"ornamentPosition",this.ornamentPosition),this.volumePosition!=="auto"&&C(de,"volumePosition",this.volumePosition),this.differentFont("annotationfont",K)&&m(de,"annotationfont",this.annotationfont),this.differentFont("gchordfont",K)&&m(de,"gchordfont",this.gchordfont),this.differentFont("vocalfont",K)&&m(de,"vocalfont",this.vocalfont),this.differentFont("tripletfont",K)&&m(de,"tripletfont",this.tripletfont)):Q==="bar"&&(this.dynamicPosition!=="auto"&&C(de,"dynamicPosition",this.dynamicPosition),this.chordPosition!=="auto"&&C(de,"chordPosition",this.chordPosition),this.ornamentPosition!=="auto"&&C(de,"ornamentPosition",this.ornamentPosition),this.volumePosition!=="auto"&&C(de,"volumePosition",this.volumePosition),this.differentFont("measurefont",K)&&m(de,"measurefont",this.measurefont),this.differentFont("repeatfont",K)&&m(de,"repeatfont",this.repeatfont))},duplicateStartEndingHoldOvers:function(){this.endingHoldOver={inTie:[],inTieChord:{}};for(var de=0;de<this.inTie.length;de++)if(this.endingHoldOver.inTie.push([]),this.inTie[de])for(var K=0;K<this.inTie[de].length;K++)this.endingHoldOver.inTie[de].push(this.inTie[de][K]);for(var Q in this.inTieChord)this.inTieChord.hasOwnProperty(Q)&&(this.endingHoldOver.inTieChord[Q]=this.inTieChord[Q])},restoreStartEndingHoldOvers:function(){if(this.endingHoldOver.inTie){this.inTie=[],this.inTieChord={};for(var de=0;de<this.endingHoldOver.inTie.length;de++){this.inTie.push([]);for(var K=0;K<this.endingHoldOver.inTie[de].length;K++)this.inTie[de].push(this.endingHoldOver.inTie[de][K])}for(var Q in this.endingHoldOver.inTieChord)this.endingHoldOver.inTieChord.hasOwnProperty(Q)&&(this.inTieChord[Q]=this.endingHoldOver.inTieChord[Q])}}},L=function(de){T.warnings||(T.warnings=[]),T.warnings.push(de)},N=function(de){T.warningObjects||(T.warningObjects=[]),T.warningObjects.push(de)},B=function(de){var K=de.replace(/\x12/g," ");return K=K.replace(/&/g,"&"),K=K.replace(/</g,"<"),K.replace(/>/g,">")},W=function(de,K,Q){K||(K=" ");var le=K[Q];(le===" "||!le)&&(le="SPACE");var Ee=B(K.substring(Q-64,Q))+'<span style="text-decoration:underline;font-size:1.3em;font-weight:bold;">'+le+"</span>"+B(K.substring(Q+1).substring(0,64));L("Music Line:"+M.lineIndex+":"+(Q+1)+": "+de+": "+Ee),N({message:de,line:K,startChar:T.iChar+Q,column:Q})},G,R;this.getWarnings=function(){return T.warnings},this.getWarningObjects=function(){return T.warningObjects};var ye=function(de,K){if(K.indexOf("")>=0){w+=K;return}if(K=w+K,w="",!de){W("Can't add words before the first line of music",de,0);return}K=t.strip(K),K[K.length-1]!=="-"&&(K=K+" ");for(var Q=[],le=0,Ee=!1,Me=function(X){var xe=t.strip(K.substring(le,X));if(xe=xe.replace(/\\([-_*|~])/g,"$1"),le=X+1,xe.length>0){Ee&&(xe=xe.replace(/~/g," "));var De=K[X];return De!=="_"&&De!=="-"&&(De=" "),Q.push({syllable:M.translateString(xe),divider:De}),Ee=!1,!0}return!1},H=!1,Y=0;Y<K.length;Y++){switch(K[Y]){case" ":case"":Me(Y);break;case"-":!H&&!Me(Y)&&Q.length>0&&(t.last(Q).divider="-",Q.push({skip:!0,to:"next"}));break;case"_":H||(Me(Y),Q.push({skip:!0,to:"slur"}));break;case"*":H||(Me(Y),Q.push({skip:!0,to:"next"}));break;case"|":H||(Me(Y),Q.push({skip:!0,to:"bar"}));break;case"~":H||(Ee=!0);break}H=K[Y]==="\\"}de.forEach(function(X){if(Q.length!==0){if(Q[0].skip){switch(Q[0].to){case"next":X.el_type==="note"&&X.pitches!==null&&Q.shift();break;case"slur":X.el_type==="note"&&X.pitches!==null&&Q.shift();break;case"bar":X.el_type==="bar"&&Q.shift();break}X.el_type!=="bar"&&(X.lyric===void 0?X.lyric=[{syllable:"",divider:" "}]:X.lyric.push({syllable:"",divider:" "}))}else if(X.el_type==="note"&&X.rest===void 0){var xe=Q.shift();xe.syllable&&(xe.syllable=xe.syllable.replace(/ +/g," ")),X.lyric===void 0?X.lyric=[xe]:X.lyric.push(xe)}}})},q=function(de,K){if(K.indexOf("")>=0){_+=K;return}if(K=_+K,_="",!de){W("Can't add symbols before the first line of music",de,0);return}K=t.strip(K),K[K.length-1]!=="-"&&(K=K+" ");for(var Q=[],le=0,Ee=!1,Me=function(Y){var X=t.strip(K.substring(le,Y));if(le=Y+1,X.length>0){Ee&&(X=X.replace(/~/g," "));var xe=K[Y];return xe!=="_"&&xe!=="-"&&(xe=" "),Q.push({syllable:M.translateString(X),divider:xe}),Ee=!1,!0}return!1},H=0;H<K.length;H++)switch(K[H]){case" ":case"":Me(H);break;case"-":!Me(H)&&Q.length>0&&(t.last(Q).divider="-",Q.push({skip:!0,to:"next"}));break;case"_":Me(H),Q.push({skip:!0,to:"slur"});break;case"*":Me(H),Q.push({skip:!0,to:"next"});break;case"|":Me(H),Q.push({skip:!0,to:"bar"});break;case"~":Ee=!0;break}de.forEach(function(Y){if(Q.length!==0){if(Q[0].skip)switch(Q[0].to){case"next":Y.el_type==="note"&&Y.pitches!==null&&Q.shift();break;case"slur":Y.el_type==="note"&&Y.pitches!==null&&Q.shift();break;case"bar":Y.el_type==="bar"&&Q.shift();break}else if(Y.el_type==="note"&&Y.rest===void 0){var X=Q.shift();Y.lyric===void 0?Y.lyric=[X]:Y.lyric.push(X)}}})},se=function(de){if(t.startsWith(de,"%%")){var K=r.addDirective(de.substring(2));K&&W(K,de,2);return}var Q=de.indexOf("%");if(Q>=0&&(de=de.substring(0,Q)),de=de.replace(/\s+$/,""),de.length!==0){if(w){ye(A.getCurrentVoice(),de.substring(2));return}if(_){q(A.getCurrentVoice(),de.substring(2));return}if(de.length<2||de[1]!==":"||R.lineContinuation){R.parseMusic(de);return}var le=G.parseHeader(de);le.regular&&R.parseMusic(de),le.newline&&R.startNewLine(),le.words&&ye(A.getCurrentVoice(),de.substring(2)),le.symbols&&q(A.getCurrentVoice(),de.substring(2))}};function ve(de,K){de.push({el_type:"hint"});for(var Q=0;Q<K.length;Q++){var le=K[Q],Ee=Object.assign({},le);if(de.push(Ee),le.el_type==="bar")return}}function he(de,K){for(var Q=0;Q<de.length;Q++){var le=de[Q],Ee=K[Q];if(Ee)for(var Me=0;Me<Ee.voices.length;Me++){var H=Ee.voices[Me],Y=le.voices[Me];Y&&ve(Y,H)}}}function ce(){for(var de=0;de<S.lines.length;de++){var K=S.lines[de].staff;if(K){for(var Q=de+1;Q<S.lines.length&&S.lines[Q].staff===void 0;)Q++;if(Q<S.lines.length){var le=S.lines[Q].staff;he(K,le)}}}}this.parse=function(de,K,Q){K||(K={}),Q||(Q=0),S.reset(),de=de.replace(/\r\n?/g,`
|
|
150
|
+
`)+`
|
|
151
|
+
`;var le=de.split(`
|
|
152
|
+
\\`);if(le.length>1){for(var Ee=1;Ee<le.length;Ee++)for(;le[Ee].length>0&&le[Ee][0]!==`
|
|
153
|
+
`;)le[Ee]=le[Ee].substr(1),le[Ee-1]+=" ";de=le.join(" ")}de=de.replace(/\\([ \t]*)(%.*)*\n/g,function($e,Re,ut){var Lt=ut?Array(ut.length+1).join(" "):"";return Re+""+Lt+`
|
|
154
|
+
`});var Me=de.split(`
|
|
155
|
+
`);t.last(Me).length===0&&Me.pop(),M=new u(Me,T),G=new a(M,W,T,S,A),R=new l(M,W,T,S,A,G),K.print&&(S.media="print"),T.reset(),T.iChar=Q,K.visualTranspose?(T.globalTranspose=parseInt(K.visualTranspose),T.globalTranspose===0?T.globalTranspose=void 0:A.setVisualTranspose(K.visualTranspose)):T.globalTranspose=void 0,K.lineBreaks&&(T.lineBreaks=K.lineBreaks),G.reset(M,W,T,S);try{K.format&&r.globalFormatting(K.format);for(var H=M.nextLine();H;){if(K.header_only&&T.is_in_header===!1||K.stop_on_warning&&T.warnings)throw"normal_abort";var Y=T.is_in_header;se(H),Y&&!T.is_in_header&&(A.setRunningFont("annotationfont",T.annotationfont),A.setRunningFont("gchordfont",T.gchordfont),A.setRunningFont("tripletfont",T.tripletfont),A.setRunningFont("vocalfont",T.vocalfont)),H=M.nextLine()}w&&ye(A.getCurrentVoice(),""),_&&q(A.getCurrentVoice(),""),T.openSlurs=A.cleanUp(T.barsperstaff,T.staffnonote,T.openSlurs)}catch($e){if($e!=="normal_abort")throw $e}var X=11*72,xe=8.5*72;switch(T.papersize){case"legal":X=14*72,xe=8.5*72;break;case"A4":X=11.7*72,xe=8.3*72;break}if(T.landscape){var De=X;X=xe,xe=De}S.formatting.pagewidth||(S.formatting.pagewidth=xe),S.formatting.pageheight||(S.formatting.pageheight=X),K.hint_measures&&ce(),c.wrapLines(S,T.lineBreaks,T.barNumbers)}};return Km=y,Km}var Xm,l5;function ZI(){if(l5)return Xm;l5=1;var t=Bo(),r=function(a){var l="",u=a.match(/(\s*)/);a=t.strip(a);for(var c=a.split(`
|
|
156
|
+
X:`),f=1;f<c.length;f++)c[f]="X:"+c[f];var p=u?u[0].length:0,y=[];if(c.forEach(function(w){y.push({abc:w,startPos:p}),p+=w.length+1}),y.length>1&&!t.startsWith(y[0].abc,"X:")){var S=y.shift(),A=S.abc.split(`
|
|
157
|
+
`);A.forEach(function(w){t.startsWith(w,"%%")&&(l+=w+`
|
|
158
|
+
`)})}var M=l;return y.forEach(function(w){var _=w.abc.indexOf(`
|
|
159
|
+
|
|
160
|
+
`);_>0&&(w.abc=w.abc.substring(0,_)),w.pure=w.abc,w.abc=l+w.abc,w.title="";var C=w.pure.split("T:");C.length>1&&(C=C[1].split(`
|
|
161
|
+
`),w.title=t.strip(C[0]));var m=w.pure.substring(2,w.pure.indexOf(`
|
|
162
|
+
`));w.id=t.strip(m)}),{header:M,tunes:y}};return Xm=r,Xm}var Qm,u5;function jI(){if(u5)return Qm;u5=1;function t(r,a){this.numLines=r,this.lineSpace=a,this.verticalSize=this.numLines*this.lineSpace;var l=3;this.bar={pitch:l,pitch2:a*r,height:5}}return t.prototype.bypass=function(r){var a=r.staffGroup.voices;return!!(a.length>0&&a[0].isPercussion)},t.prototype.setRelative=function(r,a,l){switch(r.type){case"bar":a.pitch=this.bar.pitch,a.pitch2=this.bar.pitch2,a.height=this.height;break;case"symbol":var u=this.bar.pitch2/2;if(r.name=="dots.dot")return l?(a.pitch=u,!1):(a.pitch=u+this.lineSpace,!0);break}return l},Qm=t,Qm}var Zm,c5;function U9(){if(c5)return Zm;c5=1;var t=function(a,l){this.children=[],this.beams=[],this.otherchildren=[],this.w=0,this.duplicate=!1,this.voicenumber=a,this.voicetotal=l,this.bottom=7,this.top=7,this.specialY={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}};return t.prototype.addChild=function(r){if(r.type==="bar"){for(var a=!0,l=0;a&&l<this.children.length;l++)this.children[l].type.indexOf("staff-extra")<0&&this.children[l].type!=="tempo"&&(a=!1);a||(this.beams.push("bar"),this.otherchildren.push("bar"))}this.children[this.children.length]=r,this.setRange(r)},t.prototype.setLimit=function(r,a){var l=a.specialY;l||(l=a),l[r]&&(this.specialY[r]?this.specialY[r]=Math.max(this.specialY[r],l[r]):this.specialY[r]=l[r])},t.prototype.adjustRange=function(r){r.bottom!==void 0&&(this.bottom=Math.min(this.bottom,r.bottom)),r.top!==void 0&&(this.top=Math.max(this.top,r.top))},t.prototype.setRange=function(r){this.adjustRange(r),this.setLimit("tempoHeightAbove",r),this.setLimit("partHeightAbove",r),this.setLimit("volumeHeightAbove",r),this.setLimit("dynamicHeightAbove",r),this.setLimit("endingHeightAbove",r),this.setLimit("chordHeightAbove",r),this.setLimit("lyricHeightAbove",r),this.setLimit("lyricHeightBelow",r),this.setLimit("chordHeightBelow",r),this.setLimit("volumeHeightBelow",r),this.setLimit("dynamicHeightBelow",r)},t.prototype.addOther=function(r){this.otherchildren.push(r),this.setRange(r)},t.prototype.addBeam=function(r){this.beams.push(r)},t.prototype.setWidth=function(r){this.w=r},Zm=t,Zm}var jm,h5;function Wy(){if(h5)return jm;h5=1;var t=function(r,a,l,u){if(r)for(var c=0;c<r.length;c++){var f=r[c],p=f.getAttribute("highlight");p||(p="fill"),f.setAttribute(p,u);var y=f.getAttribute("class");y||(y=""),y=y.replace(l,""),y=y.replace(a,""),a.length>0&&(y.length>0&&y[y.length-1]!==" "&&(y+=" "),y+=a),f.setAttribute("class",y)}};return jm=t,jm}var Jm,f5;function $9(){if(f5)return Jm;f5=1;var t=Wy(),r=function(a,l){a===void 0&&(a="abcjs-note_selected"),l===void 0&&(l="#ff0000"),t(this.elemset,a,"",l)};return Jm=r,Jm}var e_,d5;function W9(){if(d5)return e_;d5=1;var t=Wy(),r=function(a,l){a===void 0&&(a="abcjs-note_selected"),l===void 0&&(l="#000000"),t(this.elemset,"",a,l)};return e_=r,e_}var t_,p5;function Nu(){if(p5)return t_;p5=1;var t=$9(),r=W9(),a=function(u,c,f,p,y,S){S||(S={}),this.tuneNumber=y,this.abcelem=u,this.duration=c,this.durationClass=S.durationClassOveride?S.durationClassOveride:this.duration,this.minspacing=f||0,this.x=0,this.children=[],this.heads=[],this.extra=[],this.extraw=0,this.w=0,this.right=[],this.invisible=!1,this.bottom=void 0,this.top=void 0,this.type=p,this.fixed={w:0,t:void 0,b:void 0},this.specialY={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}};return a.prototype.getFixedCoords=function(){return{x:this.x,w:this.fixed.w,t:this.fixed.t,b:this.fixed.b}},a.prototype.addExtra=function(l){this.fixed.w=Math.max(this.fixed.w,l.dx+l.w),this.fixed.t===void 0?this.fixed.t=l.top:this.fixed.t=Math.max(this.fixed.t,l.top),this.fixed.b===void 0?this.fixed.b=l.bottom:this.fixed.b=Math.min(this.fixed.b,l.bottom),l.dx<this.extraw&&(this.extraw=l.dx),this.extra[this.extra.length]=l,this._addChild(l)},a.prototype.addHead=function(l){l.dx<this.extraw&&(this.extraw=l.dx),this.heads[this.heads.length]=l,this.addRight(l)},a.prototype.addRight=function(l){this.fixed.w=Math.max(this.fixed.w,l.dx+l.w),l.top!==void 0&&(this.fixed.t===void 0?this.fixed.t=l.top:this.fixed.t=Math.max(this.fixed.t,l.top)),l.bottom!==void 0&&(this.fixed.b===void 0?this.fixed.b=l.bottom:this.fixed.b=Math.min(this.fixed.b,l.bottom)),l.dx+l.w>this.w&&(this.w=l.dx+l.w),this.right[this.right.length]=l,this._addChild(l)},a.prototype.addFixed=function(l){this._addChild(l)},a.prototype.addFixedX=function(l){this._addChild(l)},a.prototype.addCentered=function(l){var u=l.w/2;-u<this.extraw&&(this.extraw=-u),this.extra[this.extra.length]=l,l.dx+u>this.w&&(this.w=l.dx+u),this.right[this.right.length]=l,this._addChild(l)},a.prototype.setLimit=function(l,u){u[l]&&(this.specialY[l]?this.specialY[l]=Math.max(this.specialY[l],u[l]):this.specialY[l]=u[l])},a.prototype._addChild=function(l){var u=!0;this.abcelem.el_type=="clef"&&l.type=="barNumber"&&(u=!1),l.parent=this,this.children[this.children.length]=l,u&&this.pushTop(l.top),this.pushBottom(l.bottom),this.setLimit("tempoHeightAbove",l),this.setLimit("partHeightAbove",l),this.setLimit("volumeHeightAbove",l),this.setLimit("dynamicHeightAbove",l),this.setLimit("endingHeightAbove",l),this.setLimit("chordHeightAbove",l),this.setLimit("lyricHeightAbove",l),this.setLimit("lyricHeightBelow",l),this.setLimit("chordHeightBelow",l),this.setLimit("volumeHeightBelow",l),this.setLimit("dynamicHeightBelow",l)},a.prototype.pushTop=function(l){l!==void 0&&(this.top===void 0?this.top=l:this.top=Math.max(l,this.top))},a.prototype.pushBottom=function(l){l!==void 0&&(this.bottom===void 0?this.bottom=l:this.bottom=Math.min(l,this.bottom))},a.prototype.setX=function(l){this.x=l;for(var u=0;u<this.children.length;u++)this.children[u].setX(l)},a.prototype.center=function(l,u){var c=(u.x-l.x)/2+l.x;this.x=c-this.w/2;for(var f=0;f<this.children.length;f++)this.children[f].setX(this.x)},a.prototype.setHint=function(){this.hint=!0},a.prototype.highlight=function(l,u){t.bind(this)(l,u)},a.prototype.unhighlight=function(l,u){r.bind(this)(l,u)},t_=a,t_}var r_,g5;function Ia(){if(g5)return r_;g5=1;var t=function(a,l,u,c,f){switch(f=f||{},this.x=0,this.c=a,this.dx=l,this.w=u,this.pitch=c,this.scalex=f.scalex||1,this.scaley=f.scaley||1,this.type=f.type||"symbol",this.pitch2=f.pitch2,this.linewidth=f.linewidth,this.klass=f.klass,this.anchor=f.anchor?f.anchor:"middle",this.top=c,this.pitch2!==void 0&&this.pitch2>this.top&&(this.top=this.pitch2),this.bottom=c,this.pitch2!==void 0&&this.pitch2<this.bottom&&(this.bottom=this.pitch2),f.thickness&&(this.top+=f.thickness/2,this.bottom-=f.thickness/2),f.stemHeight&&(f.stemHeight>0?this.top+=f.stemHeight:this.bottom+=f.stemHeight),f.dim&&(this.dim=f.dim),f.position&&(this.position=f.position),this.height=f.height?f.height:4,f.top&&(this.top=f.top),f.bottom&&(this.bottom=f.bottom),f.name?this.name=f.name:this.c?this.name=this.c:this.name=this.type,f.realWidth?this.realWidth=f.realWidth:this.realWidth=this.w,this.centerVertically=!1,this.type){case"debug":this.chordHeightAbove=this.height;break;case"lyric":f.position&&f.position==="below"?this.lyricHeightBelow=this.height:this.lyricHeightAbove=this.height;break;case"chord":f.position&&f.position==="below"?this.chordHeightBelow=this.height:this.chordHeightAbove=this.height;break;case"text":this.pitch===void 0?f.position&&f.position==="below"?this.chordHeightBelow=this.height:this.chordHeightAbove=this.height:this.centerVertically=!0;break;case"part":this.partHeightAbove=this.height;break}};return t.prototype.getChordDim=function(){if(this.type==="debug"||!this.chordHeightAbove&&!this.chordHeightBelow)return null;var r=0,a=this.type==="chord"?this.realWidth/2:0,l=this.x-a-r,u=l+this.realWidth+r;return{left:l,right:u}},t.prototype.invertLane=function(r){this.lane===void 0&&(this.lane=0),this.lane=r-this.lane-1},t.prototype.putChordInLane=function(r){this.lane=r,this.chordHeightAbove?this.chordHeightAbove=this.height*1.25*this.lane:this.chordHeightBelow=this.height*1.25*this.lane},t.prototype.getLane=function(){return this.lane===void 0?0:this.lane},t.prototype.setX=function(r){this.x=r+this.dx},r_=t,r_}var n_,v5;function JI(){if(v5)return n_;v5=1;var t=Nu(),r=Ia();function a(m){return m!=null&&m.constructor===Object}function l(m,T){for(var L in T)T.hasOwnProperty(L)&&(Array.isArray(T[L])||a(T[L])||(m[L]=T[L]))}function u(m){var T=new t("",0,0,"",0);return l(T,m),T.top=0,T.bottom=-1,m.abcelem&&(T.abcelem={},l(T.abcelem,m.abcelem),T.abcelem.el_type==="note"&&(T.abcelem.el_type="tabNumber")),m.cloned=T,T}function c(m,T){var L=u(m);if(T)for(var N=m.children,B=!0,W=0;W<N.length;W++){var G=N[W],R=new r("",0,0,0,"");l(R,G),B=T.tablature.setRelative(G,R,B),L.children.push(R)}return L}function f(m,T,L){var N="tab.tiny",B=7.5;m.isTabBig&&(N="tab.big",B=10);var W={el_type:"tab",icon:N,Ypos:B};if(B+=m.tabSymbolOffset,!m.hideTabSymbol){var G=new t(W,0,0,"symbol",0);G.x=T;var R=new r(N,0,0,7.5,"tab");R.x=L,G.children.push(R),G.abcelem.el_type=="tab"&&(R.pitch=B)}return G}function p(m){if(m.extra)for(var T=0;T<m.extra.length;T++){var L=m.extra[T];if(L.type=="lyric")return{bottom:L.bottom,height:L.height}}return null}function y(){this.accidentals=null}function S(m){for(var T=0,L=0;L<m.length;L++)m[L].tabNameInfos||T++;return T}function A(m,T,L,N,B){var W=N.num;N.note.quarter!=null&&(W=W.toString(),W+=N.note.quarter);var G=m.semantics.stringToPitch(N.str);L.notes.push({num:W,str:N.str,pitch:N.note.emit()});var R={type:"tabNumber"},ye=new r(W,0,0,G+.3,R);return ye.x=T,ye.isGrace=B,ye.isAltered=N.note.isAltered,ye}function M(m,T){var L=0;if(m.extra){for(var N=0;N<m.extra.length;N++)if(m.extra[N].c.indexOf("noteheads")>=0){if(L===T)return m.extra[N].x+m.extra[N].w/2;L++}}return-1}function w(m){if(m.abcelem){var T=m.abcelem;if(T.rest)return T.gracenotes}return null}function _(m,T,L){var N=m.semantics.notesToNumber(T,L);if(N.error)return m.setError(N.error),N;if(N.graces&&N.notes){var B=N.notes.length-1;N.notes[B].graces=N.graces}return N}function C(m,T,L,N,B){for(var W=0;W<N.length;W++){var G={el_type:"note",startChar:L.abcelem.startChar,endChar:L.abcelem.endChar,notes:[],grace:!0},R=M(L,W),ye=N[W],q=A(m,R,G,ye,!0);T.children.push(q),B.push(G)}}return y.prototype.build=function(m,T,L,N,B,W,G){S(T);var R=T[B+N],ye=T[G],q=null,se=null;R.children[0].abcelem.el_type!="clef"&&W!="none"&&R.children.splice(0,0,W);for(var ve=0;ve<R.children.length;ve++){var he=R.children[ve],ce=he.x,de=ce;switch(he.isClef&&(ye.children.push(f(m,ce,de)),he.abcelem.type.indexOf("-8")>=0&&(m.semantics.clefTranspose=-12),he.abcelem.type.indexOf("+8")>=0&&(m.semantics.clefTranspose=12)),he.type){case"staff-extra key-signature":this.accidentals=he.abcelem.accidentals,m.semantics.accidentals=this.accidentals;break;case"bar":m.semantics.measureAccidentals={};var K=!1;ve===R.children.length-1&&(K=!0);var Q=c(he,m);if(Q.abcelem.barNumber){delete Q.abcelem.barNumber;for(var le=0;le<Q.children.length;le++)if(Q.children[le].type==="barNumber"){Q.children.splice(le,1);break}}Q.abcelem.lastBar=K,ye.children.push(Q),L.push({el_type:he.abcelem.el_type,type:he.abcelem.type,endChar:he.abcelem.endChar,startChar:he.abcelem.startChar,abselem:Q});break;case"rest":var Ee=w(he);if(Ee){if(q=_(m,null,Ee),q.error)return;Re={el_type:"note",startChar:he.abcelem.startChar,endChar:he.abcelem.endChar,notes:[],grace:!0},C(m,Me,he,q.graces,L)}break;case"note":var Me=u(he);Me.x=he.heads[0].x+he.heads[0].w/2,Me.lyricDim=p(he);var H=he.abcelem.pitches,Y=he.abcelem.gracenotes;if(Me.type="tabNumber",q=_(m,H,Y),q.error)return;if(q.graces){var X=q.notes.length-1;q.notes[X].graces=q.graces}se={el_type:"note",startChar:he.abcelem.startChar,endChar:he.abcelem.endChar,notes:[]};for(var xe=0;xe<q.notes.length;xe++){var De=q.notes[xe];if(De.graces)for(var $e=0;$e<De.graces.length;$e++){var Re={el_type:"note",startChar:he.abcelem.startChar,endChar:he.abcelem.endChar,notes:[],grace:!0},ut=M(he,$e),Lt=De.graces[$e],it=A(m,ut,Re,Lt,!0);Me.children.push(it),L.push(Re)}var Ct=A(m,Me.x+he.heads[xe].dx,se,De,!1);Me.children.push(Ct)}se.notes.length>0&&(se.abselem=Me,L.push(se),ye.children.push(Me));break}}},n_=y,n_}var i_,m5;function eP(){if(m5)return i_;m5=1;var t=U9(),r=JI(),a=ss();function l(){return{tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}}function u(m){for(var T=0,L=0;L<m.children.length;L++){var N=m.children[L];N.specialY&&N.specialY.lyricHeightBelow>T&&(T=N.specialY.lyricHeightBelow)}return T}function c(m,T,L){var N=m.semantics,B=T.controller.getTextSize,W=N.tabInfos(m),G=N.suppress(m),R=!0;if(G&&(R=!1),R){var ye=B.calc(W,"tablabelfont","text instrumentname");return L.tabNameInfos={textSize:{height:ye.height,width:ye.width},name:W},ye.height}return 0}function f(m,T){return T[m].isTabStaff?m===T.length-1?!0:!T[m+1].isTabStaff:!1}function p(m){for(var T=0,L=0;L<m.length;L++)m[L].isTabStaff||T++;return T}function y(m,T){for(var L=T;L>=0;L--)if(!m[L].isTabStaff)return L;return-1}function S(m){for(var T=0;T<m.length;T++)if(m[T].isTabStaff){var L=y(m,T);m[T].hasStaff=m[L],m[L].hasTab||(m[L].hasTab=[]),m[L].hasTab.push(m[T])}}function A(m,T){return p(m)===1&&T.voices.length>1}function M(m,T){for(var L=0,N=0,B=!0,W=0;B;){if(!T[L])return-1;if(T[L].isTabStaff||(W=T[L].voices.length),T[L].isTabStaff){if(N++,f(L,T)&&N<W)return L+1}else if(N=0,L>=m&&(L+1==T.length||!T[L+1].isTabStaff))return L+1;if(L++,L>T.length)return-1}}function w(m,T){for(var L=T;L>=0;L--)if(!m[L].isTabStaff)return m[L];return null}function _(m,T){var L=m[T],N=L.children[0].abcelem;return N.el_type==="clef"?null:T==0?"none":m[T-1].children[0]}function C(m,T,L,N){var B=new r,W={clef:{type:"TAB"}},G=m.linePitch*m.nbLines,R=L.staff;if(R){var ye=R[0];if(ye&&ye.clef&&ye.clef.stafflines==0){m.setError("No tablatures when stafflines=0");return}R.splice(R.length,0,W)}var q=L.staffGroup,se=q.voices,ve=se[0],he=u(ve),ce=3,de=N,K=q.staffs[de],Q=G+ce-K.bottom-he;K.isTabStaff&&(Q=K.top);var le={bottom:-1,isTabStaff:!0,specialY:l(),lines:m.nbLines,linePitch:m.linePitch,dy:.15,top:Q},Ee=M(N,q.staffs);if(Ee!==-1){le.parentIndex=Ee-1,q.staffs.splice(Ee,0,le),q.height+=G+ce;var Me=w(q.staffs,Ee),H=1;A(q.staffs,Me)&&(H=Me.voices.length),W.voices=[];for(var Y=0;Y<H;Y++){var X=new t(0,0);Y>0&&(X.duplicate=!0);var xe=c(m,T,X)/a.STEP;xe=Math.max(xe,1),q.staffs[N].top+=1,q.height+=xe,X.staff=le;var De=se.length;se.splice(se.length,0,X);var $e=_(se,Y+N);W.voices[Y]=[],B.build(m,se,W.voices[Y],Y,N,$e,De)}S(q.staffs)}}return i_=C,i_}var s_,_5;function G9(){if(_5)return s_;_5=1;var t={__:-2,_:-1,"_/":-.5,"=":0,"":0,"^/":.5,"^":1,"^^":2},r=["C","-","D","-","E","F","-","G","-","A","-","B","c","-","d","-","e","f","-","g","-","a","-","b"];function a(u){var c=u.match(/([_^\/]*)([ABCDEFGabcdefg])(,*)('*)/);if(c&&c.length===5){var f=t[c[1]],p=r.indexOf(c[2]),y=c[4].length-c[3].length;return 48+p+f+y*12}return 0}function l(u){u=parseInt(u,10);var c=Math.floor(u/12),f=u%12,p=r[f];if(p==="-"&&(p="^"+r[f-1]),c>4)for(p=p.toLowerCase(),c-=5;c>0;)p+="'",c--;else for(;c<4;)p+=",",c++;return p}return s_={noteToMidi:a,midiToNote:l},s_}var a_,b5;function Y9(){if(b5)return a_;b5=1;var{noteToMidi:t,midiToNote:r}=G9();function a(u,c){var f=t(u);c&&(f+=c);var p=r(f),y=!1,S=!1,A=!1,M=null,w=null,_=!1,C=0;u.startsWith("_")?(y=!0,C=-1,u[1]=="/"?(y=!1,w="v",C=0):u[1]=="_"&&(_=!0,C-=1)):u.startsWith("^")?(S=!0,C=1,u[1]=="/"?(S=!1,w="^",C=0):u[1]=="^"&&(_=!0,C+=1)):u.startsWith("=")&&(M=!0,C=0),A=y||S||w!=null,(A||M)&&(w!=null||_?p=u.slice(2):p=u.slice(1));var m=(p.match(/,/g)||[]).length,T=(p.match(/'/g)||[]).length;this.pitch=f,this.pitchAltered=0,this.name=p,this.acc=C,this.isSharp=S,this.isKeySharp=!1,this.isDouble=_,this.isAltered=A,this.isFlat=y,this.isKeyFlat=!1,this.natural=M,this.quarter=w,this.isLower=this.name==this.name.toLowerCase(),this.name=this.name[0].toUpperCase(),this.hasComma=m,this.isQuoted=T}function l(u){var c=u.name,f=new a(c);return f.pitch=u.pitch,f.hasComma=u.hasComma,f.isLower=u.isLower,f.isQuoted=u.isQuoted,f.isSharp=u.isSharp,f.isKeySharp=u.isKeySharp,f.isFlat=u.isFlat,f.isKeyFlat=u.isKeyFlat,f}return a.prototype.sameNoteAs=function(u){return u.pitch===this.pitch},a.prototype.isLowerThan=function(u){return u.pitch>this.pitch},a.prototype.checkKeyAccidentals=function(u,c){if(!(this.isAltered||this.natural)){if(c[this.name.toUpperCase()])switch(c[this.name.toUpperCase()]){case"__":this.acc=-2,this.pitchAltered=-2;return;case"_":this.acc=-1,this.pitchAltered=-1;return;case"=":this.acc=0,this.pitchAltered=0;return;case"^":this.acc=1,this.pitchAltered=1;return;case"^^":this.acc=2,this.pitchAltered=2;return}else if(u)for(var f=this.name,p=0;p<u.length;p++){var y=u[p];f==y.note.toUpperCase()&&(y.acc=="flat"&&(this.acc=-1,this.isKeyFlat=!0,this.pitchAltered=-1),y.acc=="sharp"&&(this.acc=1,this.isKeySharp=!0,this.pitchAltered=1))}}},a.prototype.getAccidentalEquiv=function(){var u=l(this);return u.isSharp||u.isKeySharp?(u=u.nextNote(),u.isFlat=!0,u.isSharp=!1,u.isKeySharp=!1):(u.isFlat||u.isKeyFlat)&&(u=u.prevNote(),u.isSharp=!0,u.isFlat=!1,u.isKeyFlat=!1),u},a.prototype.nextNote=function(){var u=r(this.pitch+1+this.pitchAltered);return new a(u)},a.prototype.prevNote=function(){var u=r(this.pitch-1+this.pitchAltered);return new a(u)},a.prototype.emitNoAccidentals=function(){var u=this.name;this.isLower&&(u=u.toLowerCase());for(var c=0;c<this.isQuoted;c++)u+="'";for(var f=0;f<this.hasComma;f++)u+=",";return u},a.prototype.emit=function(){var u=this.name;(this.isSharp||this.isKeySharp)&&(u="^"+u,this.isDouble&&(u="^"+u)),(this.isFlat||this.isKeyFlat)&&(u="_"+u,this.isDouble&&(u="_"+u)),this.quarter&&(this.quarter=="^"?u="^/"+u:u="_/"+u),this.natural&&(u="="+u);for(var c=1;c<=this.hasComma;c++)u+=",";if(this.isLower){u=u.toLowerCase();for(var f=1;f<=this.isQuoted;f++)u+="'"}return u},a_=a,a_}var o_,y5;function tP(){if(y5)return o_;y5=1;var t=Y9(),r=["A","B","C","D","E","F","G"];function a(l,u){var c=new t(l),f=new t(u);if(f.isLowerThan(c)){var p=c.emit(),y=f.emit();return{error:"Invalid string Instrument tuning : "+y+" string lower than "+p+" string"}}var S=[],A=r.indexOf(c.name),M=r.indexOf(f.name);if(A==-1||M==-1)return S;for(var w=!1;!w;)S.push(c.emit()),c=c.nextNote(),c.sameNoteAs(f)&&(w=!0);return S}return o_=a,o_}var l_,w5;function rP(){if(w5)return l_;w5=1;const{noteToMidi:t}=G9();var r=Y9(),a=tP();function l(w){var _=null,C=w.tuning;if(w.capo>0){_=[];for(var m=0;m<C.length;m++){for(var T=new r(C[m]),L=0;L<w.capo;L++)T=T.nextNote();_[m]=T.emit()}}return _}function u(w){var _=[],C=w.tuning;w.capo>0&&(C=w.capoTuning);for(var m=C.length-1,T=0;T<C.length;T++){var L=w.highestNote;T!=C.length-1&&(L=C[T+1]);var N=a(C[T],L);if(N.error)return N;_[m--]=N}return _}function c(w){var _=[];_[0]=[];for(var C=w.strings,m=1;m<C.length;m++)_[m]=C[m-1];return _}function f(w,_){for(var C=0;C<_.length-1;C++){var m=_[C],T=_[C+1];if(m.str==T.str){if(m.str==w.strings.length-1){m.num="?",T.num="?";return}T.num<m.num?(T.str++,T=y(w,T.note,T.str,w.secondPos,w.strings[T.str].length)):(m.str++,m=y(w,m.note,m.str,w.secondPos,w.strings[m.str].length)),_[C]=m,_[C+1]=T}}return null}function p(w,_){for(var C=[],m=0;m<_.length;m++)if(!_[m].endTie){var T=new r(_[m].name,w.clefTranspose);T.checkKeyAccidentals(w.accidentals,w.measureAccidentals);var L=S(w,T);C.push(L)}return f(w,C),C}function y(w,_,C,m,T){var L=w.strings;_.checkKeyAccidentals(w.accidentals,w.measureAccidentals),m&&(L=m);var N=_.emitNoAccidentals(),B=L[C].indexOf(N),W=_.acc;if(B!=-1){if(m&&(B+=T),(_.isFlat||_.acc==-1)&&B==0){var G=_.getAccidentalEquiv();C++,B=L[C].indexOf(G.emit()),W=0}return{num:B+W,str:C,note:_}}return null}function S(w,_){if(_.isAltered||_.natural){var C;_.isFlat?_.isDouble?C="__":C="_":_.isSharp?_.isDouble?C="^^":C="^":_.natural&&(C="="),w.measureAccidentals[_.name.toUpperCase()]=C}for(var m=w.stringPitches.length-1;m>=0;m--)if(_.pitch+_.pitchAltered>=w.stringPitches[m]){var T=_.pitch+_.pitchAltered-w.stringPitches[m];return _.quarter==="^"?T-=.5:_.quarter==="v"&&(T+=.5),{num:Math.round(T),str:w.stringPitches.length-1-m,note:_}}return{num:"?",str:w.stringPitches.length-1,note:_}}M.prototype.stringToPitch=function(w){var _=5.3,C=this.strings.length-1;return _+(C-w)*this.linePitch};function A(w,_){var C={num:"?",str:0,note:_};w.push(C),w.error=_.emit()+": unexpected note for instrument"}M.prototype.notesToNumber=function(w,_){var C,m,T=null,L=null;if(w&&(L=[],w.length>1?(L=p(this,w),L.error&&(T=L.error)):w[0].endTie||(C=new r(w[0].name,this.clefTranspose),C.checkKeyAccidentals(this.accidentals,this.measureAccidentals),m=S(this,C),m?L.push(m):(A(L,C),T=L.error))),T)return L;var N=null;if(_){N=[];for(var B=0;B<_.length;B++)C=new r(_[B].name,this.clefTranspose),C.checkKeyAccidentals(this.accidentals,this.measureAccidentals),m=S(this,C),m?N.push(m):(A(N,C),T=L.error)}return{notes:L,graces:N,error:T}},M.prototype.toString=function(){for(var w=[],_=0;_<this.tuning.length;_++){var C=this.tuning[_].replaceAll(",","").replaceAll("'","").toUpperCase();C[0]==="_"?C=C[1]+"b ":C[0]==="^"&&(C=C[1]+"# "),w.push(C)}return w.join("")},M.prototype.tabInfos=function(w){var _=w.params.label;if(_){var C=_.indexOf("%T"),m="";return C!=-1&&(m=this.toString(),w.capo>0&&(m+=" capo:"+w.capo),_=_.replace("%T",m)),_}return""},M.prototype.suppress=function(w){var _=w.params.suppress;return!!_};function M(w){var _=w.tuning,C=w.capo,m=w.params.highestNote;this.linePitch=w.linePitch,this.highestNote="a'",m&&(this.highestNote=m),this.measureAccidentals={},this.capo=0,C&&(this.capo=parseInt(C,10)),this.transpose=w.transpose?w.transpose:0,this.tuning=_,this.stringPitches=[];for(var T=0;T<this.tuning.length;T++){var L=t(this.tuning[T])+this.capo;this.stringPitches.push(L)}if(this.capo>0&&(this.capoTuning=l(this)),this.strings=u(this),this.strings.error){w.setError(this.strings.error),w.inError=!0;return}this.secondPos=c(this)}return l_=M,l_}var u_,S5;function nP(){if(S5)return u_;S5=1;var t=jI(),r=eP(),a=rP();l.prototype.init=function(c,f,p,y){this.tune=c,this.params=p,this.tuneNumber=f,this.inError=!1,this.abcTune=c,this.linePitch=3,this.nbLines=y.defaultTuning.length,this.isTabBig=y.isTabBig,this.tabSymbolOffset=y.tabSymbolOffset,this.capo=p.capo,this.transpose=p.visualTranspose,this.hideTabSymbol=p.hideTabSymbol,this.tablature=new t(this.nbLines,this.linePitch);var S=p.tuning;S||(S=y.defaultTuning),this.tuning=S,this.semantics=new a(this)},l.prototype.setError=function(c){c&&(this.error=c,this.inError=!0,this.tune.warnings?this.tune.warnings.push(c):this.tune.warnings=[c])},l.prototype.render=function(c,f,p){this.inError||this.tablature.bypass(f)||r(this,c,f,p)};function l(){}var u=function(){return{name:"StringTab",tablature:l}};return u_=u,u_}var c_,C5;function K9(){if(C5)return c_;C5=1;var t=nP(),r={violin:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},fiddle:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},mandolin:{name:"StringTab",defaultTuning:["G,","D","A","e"],isTabBig:!1,tabSymbolOffset:0},guitar:{name:"StringTab",defaultTuning:["E,","A,","D","G","B","e"],isTabBig:!0,tabSymbolOffset:0},fiveString:{name:"StringTab",defaultTuning:["C,","G,","D","A","e"],isTabBig:!1,tabSymbolOffset:-.95}},a={inited:!1,plugins:{},register:function(l){var u=l.name,c=l.tablature;this.plugins[u]=c},setError:function(l,u){l.warnings?l.warning.push(u):l.warnings=[u]},preparePlugins:function(l,u,c){this.inited||(this.register(new t),this.inited=!0);var f=null;if(c.tablature){var p=c.tablature;f=[];for(var y=0;y<p.length;y++){var S=p[y],A=S.instrument;if(A==null)return this.setError(l,"tablature 'instrument' is missing"),f;var M=r[A],w=null;if(M&&(w=this.plugins[M.name]),w){c.visualTranspose!=0&&(S.visualTranspose=c.visualTranspose),S.abcSrc=c.tablature.abcSrc;var _={classz:w,tuneNumber:u,params:S,instance:null,tabType:M};f.push(_)}else if(A==="")f.push(null);else return this.setError(l,"Undefined tablature plugin: "+A),f}}return f},layoutTablatures:function(u,c){var f=c.tablatures,p=0;if(f&&f.length>0)for(var y=f.length,S=0;S<y;++S)f[S]&&f[S].params.firstStaffOnly&&(f[S].params.suppress=!1);for(var A=0;A<c.lines.length;A++){var M=c.lines[A];if(M.staff&&p++,p>1&&f&&f.length>0)for(var y=f.length,S=0;S<y;++S)f[S].params.firstStaffOnly&&(f[S].params.suppress=!0);var w=M.staff;if(w){for(var _=w.length,C=0;C<w.length;C++)if(f[C]&&C<_){var m=f[C];m.instance==null&&(m.instance=new m.classz,m.instance.init(c,m.tuneNumber,m.params,m.tabType)),m.instance.render(u,M,C)}}}}};return c_=a,c_}var h_,x5;function rf(){if(x5)return h_;x5=1;var t=V9(),r=ZI(),a=K9(),l={};return function(){l.numberOfTunes=function(c){var f=c.split(`
|
|
163
|
+
X:`),p=f.length;return p===0&&(p=1),p};var u=l.TuneBook=function(c){var f=r(c);this.header=f.header,this.tunes=f.tunes};u.prototype.getTuneById=function(c){for(var f=0;f<this.tunes.length;f++)if(this.tunes[f].id===""+c)return this.tunes[f];return null},u.prototype.getTuneByTitle=function(c){for(var f=0;f<this.tunes.length;f++)if(this.tunes[f].title===c)return this.tunes[f];return null},l.parseOnly=function(c,f){for(var p=l.numberOfTunes(c),y=[],S=0;S<p;S++)y.push(1);function A(){}return l.renderEngine(A,y,c,f)},l.renderEngine=function(c,f,p,y){var S=[],A=function(B){return B&&!B.propertyIsEnumerable("length")&&typeof B=="object"&&typeof B.length=="number"};if(!(f===void 0||p===void 0)){A(f)||(f=[f]),y===void 0&&(y={});for(var M=y.startingTune?parseInt(y.startingTune,10):0,w=new u(p),_=new t,C=0;C<f.length;C++){var m=f[C];if(m==="*"||typeof m=="string"&&(m=document.getElementById(m)),m)if(M>=0&&M<w.tunes.length){_.parse(w.tunes[M].abc,y,w.tunes[M].startPos-w.header.length);var T=_.getTune();y.tablature&&(T.tablatures=a.preparePlugins(T,M,y));var L=_.getWarnings();L&&(T.warnings=L);var N=c(m,T,C,w.tunes[M].abc);S.push(N||T)}else m.innerHTML&&(m.innerHTML="");M++}return S}},l.extractMeasures=function(c){for(var f=[],p=new u(c),y=0;y<p.tunes.length;y++){for(var S=p.tunes[y],A=S.abc.split("K:"),M=A[1].split(`
|
|
164
|
+
`),w=A[0]+"K:"+M[0]+`
|
|
165
|
+
`,_=null,C=null,m=null,T=[],L=!1,N=l.parseOnly(S.abc)[0],B=N.getPickupLength()>0,W=0;W<N.lines.length;W++){var G=N.lines[W];if(G.staff)for(var R=0;R<1;R++)for(var ye=G.staff[R],q=0;q<1;q++)for(var se=ye.voices[q],ve=0;ve<se.length;ve++){var he=se[ve];if(m===null&&he.startChar>=0&&(m=he.startChar,he.chord===void 0?C=_:C=null),he.chord&&(_=he),he.el_type==="bar"){if(L){var ce=S.abc.substring(m,he.endChar),de={abc:ce};_=C&&C.chord&&C.chord.length>0?C.chord[0].name:null,_&&(de.lastChord=_),he.startEnding&&(de.startEnding=he.startEnding),he.endEnding&&(de.endEnding=he.endEnding),T.push(de),m=null,L=!1}}else he.el_type==="note"&&(L=!0)}}f.push({header:w,measures:T,hasPickup:B})}return f}}(),h_=l,h_}var f_,k5;function iP(){if(k5)return f_;k5=1;var t=R9(),{relativeMajor:r,transposeKey:a,relativeMode:l}=D9(),u=O9(),c;return function(){c=function(se,ve,he){if(ve==="TEST")return{keyAccidentals:t,relativeMajor:r,transposeKey:a,relativeMode:l,transposeChordName:u};he=parseInt(he,10);var ce=[],de;for(de=0;de<ve.length;de++)ce=ce.concat(f(se,ve[de],he));ce=ce.sort(function(le,Ee){return Ee.start-le.start});var K=se.split("");for(de=0;de<ce.length;de++){var Q=ce[de];K.splice(Q.start,Q.end-Q.start,Q.note)}return K.join("")};function f(se,ve,he){var ce=[],de=ve.getKeySignature();if(de.root==="Hp"||de.root==="HP")return ce;ce=ce.concat(p(se,he));for(var K=0;K<ve.lines.length;K++){var Q=ve.lines[K].staff;if(Q)for(var le=0;le<Q.length;le++){var Ee=Q[le];Ee.clef.type!=="perc"&&(ce=ce.concat(y(se,Ee.voices,Ee.key,he)))}}return ce}function p(se,ve){for(var he=[],ce=se.split("K:"),de=ce[0].length,K=1;K<ce.length;K++){var Q=ce[K],le=Q.match(/^( *)([A-G])([#b]?)(\w*)/);if(le){var Ee=de+2+le[1].length,Me=le[2]+le[3]+le[4],H=C({root:le[2],acc:le[3],mode:le[4]},ve),Y=H.root+H.acc+H.mode;he.push({start:Ee,end:Ee+Me.length,note:Y})}de+=Q.length+2}return he}function y(se,ve,he,ce){for(var de=[],K=C(he,ce),Q=0;Q<ve.length;Q++)de=de.concat(M(se,ve[Q],he.root,S(he),K,ce));return de}function S(se){for(var ve={},he=0;he<se.accidentals.length;he++){var ce=se.accidentals[he];ce.acc==="flat"?ve[ce.note.toUpperCase()]="_":ce.acc==="sharp"&&(ve[ce.note.toUpperCase()]="^")}return ve}function A(se,ve,he){var ce=w.indexOf(se.root)-w.indexOf(ve);return ve==="none"&&(ce=w.indexOf(se.root)),ce===0?he>2?ce+=7:he===-12&&(ce-=7):he>0&&ce<0?ce+=7:he<0&&ce>0&&(ce-=7),he>12?ce+=7:he<-12&&(ce-=7),ce}function M(se,ve,he,ce,de,K){for(var Q=[],le=A(de,he,K),Ee={},Me={},H=0;H<ve.length;H++){var Y=ve[H];if(Y.chord)for(var X=0;X<Y.chord.length;X++){var xe=Y.chord[X];if(xe.position==="default"){var De=de.accidentals.length&&de.accidentals[0].acc==="flat",$e=u(xe.name,K,De,!0);$e=$e.replace(/♭/g,"b").replace(/♯/g,"#"),$e!==xe.name&&Q.push(ye(se,Y.startChar,Y.endChar,$e))}}if(Y.el_type==="note"&&Y.pitches){for(var Re=0;Re<Y.pitches.length;Re++){var ut=W(Y.pitches[Re].name,he,ce,Ee);ut.acc&&(Ee[ut.name.toUpperCase()]=ut.acc);var Lt=m(ut,de,le,Me);Lt.acc&&(Me[Lt.upper]=Lt.acc),Q.push(G(se,Y.startChar,Y.endChar,Lt.acc+Lt.name,Re))}if(Y.gracenotes)for(var it=0;it<Y.gracenotes.length;it++){var Ct=W(Y.gracenotes[it].name,he,ce,Ee);Ct.acc&&(Ee[Ct.name.toUpperCase()]=Ct.acc);var It=m(Ct,de,le,Ee);It.acc&&(Me[It.upper]=It.acc),Q.push(R(se,Y.startChar,Y.endChar,It.acc+It.name,it))}}else Y.el_type==="bar"?(Ee={},Me={}):Y.el_type==="keySignature"&&(he=Y.root,ce=S(Y),de=C(Y,K),le=A(de,he,K))}return Q}var w="CDEFGAB",_=[",,,,",",,,",",,",",","","'","''","'''","''''"];function C(se,ve){if(se.root==="none")return{root:a("C",ve),mode:"",acc:"",accidentals:[]};var he=r(se.root+se.acc+se.mode),ce=a(he,ve),de=l(ce,se.mode),K=t(ce);return{root:de[0],mode:se.mode,acc:de.length>1?de[1]:"",accidentals:K}}function m(se,ve,he,ce){for(var de=se.pitch,K=w.indexOf(se.name),Q=w.indexOf(ve.root),le=(Q+de)%7,Ee=K+he,Me=se.oct;Ee>6;)Me++,Ee-=7;for(;Ee<0;)Me--,Ee+=7;for(var H=w[le],Y="",X=se.adj,xe="=",De=0;De<ve.accidentals.length;De++)if(ve.accidentals[De].note.toLowerCase()===H.toLowerCase()){X=X+(ve.accidentals[De].acc==="flat"?-1:1),xe=ve.accidentals[De].acc==="flat"?"_":"^";break}switch(X){case-2:Y="__";break;case-1:Y="_";break;case 0:Y="=";break;case 1:Y="^";break;case 2:Y="^^";break;case-3:var $e={};return $e.pitch=se.pitch-1,$e.oct=se.oct,$e.name=w[w.indexOf(se.name)-1],$e.name||($e.name="B",$e.oct--),$e.name==="B"||$e.name==="E"?$e.adj=se.adj+1:$e.adj=se.adj+2,m($e,ve,he+1,ce);case 3:var $e={};return $e.pitch=se.pitch+1,$e.oct=se.oct,$e.name=w[w.indexOf(se.name)+1],$e.name||($e.name="C",$e.oct++),$e.name==="C"||$e.name==="F"?$e.adj=se.adj-1:$e.adj=se.adj-2,m($e,ve,he+1,ce)}switch((ce[H]===Y||!ce[H]&&Y===xe)&&!se.courtesy&&(Y=""),Me){case 0:H=H+",,,";break;case 1:H=H+",,";break;case 2:H=H+",";break;case 4:H=H.toLowerCase();break;case 5:H=H.toLowerCase()+"'";break;case 6:H=H.toLowerCase()+"''";break;case 7:H=H.toLowerCase()+"'''";break;case 8:H=H.toLowerCase()+"''''";break}return Me>4&&(H=H.toLowerCase()),{acc:Y,name:H,upper:H.toUpperCase()}}var T=/([_^=]*)([A-Ga-g])([,']*)/,L=/([_^=]*[A-Ga-g][,']*)(\d*\/*\d*)([\>\<\-\)\.\s\\]*)/,N=/([_^=]*[A-Ga-g][,']*)?(\d*\/*\d*)?([\>\<\-\)]*)?/,B=/(\s*)$/;function W(se,ve,he,ce){var de=ve==="none"?0:w.indexOf(ve),K=se.match(T),Q=K[2].toUpperCase(),le=w.indexOf(Q)-de;le<0&&(le+=7);var Ee=_.indexOf(K[3]);Q===K[2]&&Ee--;var Me=ce[Q]||he[Q]||"=";return{acc:K[1],name:Q,pitch:le,oct:Ee,adj:q(K[1],he[Q],ce[Q]),courtesy:K[1]===Me}}function G(se,ve,he,ce,de){var K=se.substring(ve,he),Q=K.match(new RegExp(L.source+B.source),"");if(Q){var le=Q[1].length,Ee=Q[2].length+Q[3].length+Q[4].length,Me=he-ve-le-Ee;ve+=Me,he-=Ee}else{var H=/([^\[]*)/,Y=/\[/,X=/\-?](\d*\/*\d*)?([\>\<\-\)]*)/;if(Q=K.match(new RegExp(H.source+Y.source+N.source+N.source+N.source+N.source+N.source+N.source+N.source+N.source+X.source+B.source)),Q){for(var xe=1+Q[1].length,De=0;De<de;De++)Q[De*3+2]&&(xe+=Q[De*3+2].length),Q[De*3+3]&&(xe+=Q[De*3+3].length),Q[De*3+4]&&(xe+=Q[De*3+4].length);ve+=xe;var $e=Q[de*3+2]?Q[de*3+2].length:0;he=ve+$e}}return{start:ve,end:he,note:ce}}function R(se,ve,he,ce,de){var K=se.substring(ve,he),Q=/\{/,le=/\}/,Ee=/([^\{]*)/,Me=/(\/*)/,H=K.match(new RegExp(Ee.source+Q.source+Me.source+N.source+Me.source+N.source+Me.source+N.source+Me.source+N.source+Me.source+N.source+Me.source+N.source+Me.source+N.source+Me.source+N.source+le.source));if(H){for(var Y=1+H[1].length,X=0;X<de;X++)H[X*3+2]&&(Y+=H[X*3+2].length),H[X*3+3]&&(Y+=H[X*3+3].length),H[X*3+4]&&(Y+=H[X*3+4].length),H[X*3+5]&&(Y+=H[X*3+5].length);H[de*3+2]&&(Y+=H[X*3+2].length),ve+=Y;var xe=H[de*3+3]?H[de*3+3].length:0;xe+=H[de*3+4]?H[de*3+4].length:0,xe+=H[de*3+5]?H[de*3+5].length:0,he=ve+xe}return{start:ve,end:he,note:ce}}function ye(se,ve,he,ce){var de=se.substring(ve,he).match(/([^"]+)?(".+")+/);return de[1]&&(ve+=de[1].length),he=ve+de[2].length,{start:ve+1,end:he-1,note:ce}}function q(se,ve,he){if(!se&&he&&(se=he),!se)return 0;switch(ve){case void 0:switch(se){case"__":return-2;case"_":return-1;case"=":return 0;case"^":return 1;case"^^":return 2;default:return 0}case"_":switch(se){case"__":return-1;case"_":return 0;case"=":return 1;case"^":return 2;case"^^":return 3;default:return 0}case"^":switch(se){case"__":return-3;case"_":return-2;case"=":return-1;case"^":return 0;case"^^":return 1;default:return 0}}return 0}}(),f_=c,f_}var d_,M5;function sP(){if(M5)return d_;M5=1;var t=function(l,u,c,f){this.type="BeamElem",this.isflat=!!c,this.isgrace=!!(u&&u==="grace"),this.forceup=!!(this.isgrace||u&&u==="up"),this.forcedown=!!(u&&u==="down"),this.elems=[],this.total=0,this.average=6,this.allrests=!0,this.stemHeight=l,this.beams=[],f&&f.duration?(this.duration=f.duration,f.startTriplet&&(this.duration*=f.tripletMultiplier),this.duration=Math.round(this.duration*1e3)/1e3):this.duration=0};t.prototype.setHint=function(){this.hint=!0},t.prototype.runningDirection=function(a){var l=a.averagepitch;l!==void 0&&(this.total=Math.round(this.total+l),this.count||(this.count=0),this.count++)},t.prototype.add=function(a){var l=a.abcelem.averagepitch;l!==void 0&&(a.abcelem.rest||(this.allrests=!1),a.beam=this,this.elems.push(a),this.total=Math.round(this.total+l),(this.min===void 0||a.abcelem.minpitch<this.min)&&(this.min=a.abcelem.minpitch),(this.max===void 0||a.abcelem.maxpitch>this.max)&&(this.max=a.abcelem.maxpitch))},t.prototype.addBeam=function(a){this.beams.push(a)},t.prototype.setStemDirection=function(){if(this.average=r(this.total,this.count),this.forceup)this.stemsUp=!0;else if(this.forcedown)this.stemsUp=!1;else{var a=6;this.stemsUp=this.average<a}delete this.count,this.total=0},t.prototype.calcDir=function(){if(this.average=r(this.total,this.elems.length),this.forceup)this.stemsUp=!0;else if(this.forcedown)this.stemsUp=!1;else{var a=6;this.stemsUp=this.average<a}for(var l=this.stemsUp?"up":"down",u=0;u<this.elems.length;u++)for(var c=0;c<this.elems[u].heads.length;c++)this.elems[u].heads[c].stemDir=l};function r(a,l){return l?a/l:0}return d_=t,d_}var p_,E5;function aP(){if(E5)return p_;E5=1;var t=function(a,l){this.startVoice=a,this.type=l};return t.prototype.setBottomStaff=function(r){this.endVoice=r,this.startVoice.header&&!this.endVoice.header&&(this.header=this.startVoice.header,delete this.startVoice.header)},t.prototype.continuing=function(r){this.lastContinuedVoice=r},t.prototype.getWidth=function(){return 10},t.prototype.isStartVoice=function(r){return!!(this.startVoice&&this.startVoice.staff&&this.startVoice.staff.voices.length>0&&this.startVoice.staff.voices[0]===r)},p_=t,p_}var g_,A5;function Jo(){if(A5)return g_;A5=1;var t=ss(),r={0:{d:[["M",4.83,-14.97],["c",.33,-.03,1.11,0,1.47,.06],["c",1.68,.36,2.97,1.59,3.78,3.6],["c",1.2,2.97,.81,6.96,-.9,9.27],["c",-.78,1.08,-1.71,1.71,-2.91,1.95],["c",-.45,.09,-1.32,.09,-1.77,0],["c",-.81,-.18,-1.47,-.51,-2.07,-1.02],["c",-2.34,-2.07,-3.15,-6.72,-1.74,-10.2],["c",.87,-2.16,2.28,-3.42,4.14,-3.66],["z"],["m",1.11,.87],["c",-.21,-.06,-.69,-.09,-.87,-.06],["c",-.54,.12,-.87,.42,-1.17,.99],["c",-.36,.66,-.51,1.56,-.6,3],["c",-.03,.75,-.03,4.59,0,5.31],["c",.09,1.5,.27,2.4,.6,3.06],["c",.24,.48,.57,.78,.96,.9],["c",.27,.09,.78,.09,1.05,0],["c",.39,-.12,.72,-.42,.96,-.9],["c",.33,-.66,.51,-1.56,.6,-3.06],["c",.03,-.72,.03,-4.56,0,-5.31],["c",-.09,-1.47,-.27,-2.37,-.6,-3.03],["c",-.24,-.48,-.54,-.78,-.93,-.9],["z"]],w:10.78,h:14.959},1:{d:[["M",3.3,-15.06],["c",.06,-.06,.21,-.03,.66,.15],["c",.81,.39,1.08,.39,1.83,.03],["c",.21,-.09,.39,-.15,.42,-.15],["c",.12,0,.21,.09,.27,.21],["c",.06,.12,.06,.33,.06,5.94],["c",0,3.93,0,5.85,.03,6.03],["c",.06,.36,.15,.69,.27,.96],["c",.36,.75,.93,1.17,1.68,1.26],["c",.3,.03,.39,.09,.39,.3],["c",0,.15,-.03,.18,-.09,.24],["c",-.06,.06,-.09,.06,-.48,.06],["c",-.42,0,-.69,-.03,-2.1,-.24],["c",-.9,-.15,-1.77,-.15,-2.67,0],["c",-1.41,.21,-1.68,.24,-2.1,.24],["c",-.39,0,-.42,0,-.48,-.06],["c",-.06,-.06,-.06,-.09,-.06,-.24],["c",0,-.21,.06,-.27,.36,-.3],["c",.75,-.09,1.32,-.51,1.68,-1.26],["c",.12,-.27,.21,-.6,.27,-.96],["c",.03,-.18,.03,-1.59,.03,-4.29],["c",0,-3.87,0,-4.05,-.06,-4.14],["c",-.09,-.15,-.18,-.24,-.39,-.24],["c",-.12,0,-.15,.03,-.21,.06],["c",-.03,.06,-.45,.99,-.96,2.13],["c",-.48,1.14,-.9,2.1,-.93,2.16],["c",-.06,.15,-.21,.24,-.33,.24],["c",-.24,0,-.42,-.18,-.42,-.39],["c",0,-.06,3.27,-7.62,3.33,-7.74],["z"]],w:8.94,h:15.058},2:{d:[["M",4.23,-14.97],["c",.57,-.06,1.68,0,2.34,.18],["c",.69,.18,1.5,.54,2.01,.9],["c",1.35,.96,1.95,2.25,1.77,3.81],["c",-.15,1.35,-.66,2.34,-1.68,3.15],["c",-.6,.48,-1.44,.93,-3.12,1.65],["c",-1.32,.57,-1.8,.81,-2.37,1.14],["c",-.57,.33,-.57,.33,-.24,.27],["c",.39,-.09,1.26,-.09,1.68,0],["c",.72,.15,1.41,.45,2.1,.9],["c",.99,.63,1.86,.87,2.55,.75],["c",.24,-.06,.42,-.15,.57,-.3],["c",.12,-.09,.3,-.42,.3,-.51],["c",0,-.09,.12,-.21,.24,-.24],["c",.18,-.03,.39,.12,.39,.3],["c",0,.12,-.15,.57,-.3,.87],["c",-.54,1.02,-1.56,1.74,-2.79,2.01],["c",-.42,.09,-1.23,.09,-1.62,.03],["c",-.81,-.18,-1.32,-.45,-2.01,-1.11],["c",-.45,-.45,-.63,-.57,-.96,-.69],["c",-.84,-.27,-1.89,.12,-2.25,.9],["c",-.12,.21,-.21,.54,-.21,.72],["c",0,.12,-.12,.21,-.27,.24],["c",-.15,0,-.27,-.03,-.33,-.15],["c",-.09,-.21,.09,-1.08,.33,-1.71],["c",.24,-.66,.66,-1.26,1.29,-1.89],["c",.45,-.45,.9,-.81,1.92,-1.56],["c",1.29,-.93,1.89,-1.44,2.34,-1.98],["c",.87,-1.05,1.26,-2.19,1.2,-3.63],["c",-.06,-1.29,-.39,-2.31,-.96,-2.91],["c",-.36,-.33,-.72,-.51,-1.17,-.54],["c",-.84,-.03,-1.53,.42,-1.59,1.05],["c",-.03,.33,.12,.6,.57,1.14],["c",.45,.54,.54,.87,.42,1.41],["c",-.15,.63,-.54,1.11,-1.08,1.38],["c",-.63,.33,-1.2,.33,-1.83,0],["c",-.24,-.12,-.33,-.18,-.54,-.39],["c",-.18,-.18,-.27,-.3,-.36,-.51],["c",-.24,-.45,-.27,-.84,-.21,-1.38],["c",.12,-.75,.45,-1.41,1.02,-1.98],["c",.72,-.72,1.74,-1.17,2.85,-1.32],["z"]],w:10.764,h:14.97},3:{d:[["M",3.78,-14.97],["c",.3,-.03,1.41,0,1.83,.06],["c",2.22,.3,3.51,1.32,3.72,2.91],["c",.03,.33,.03,1.26,-.03,1.65],["c",-.12,.84,-.48,1.47,-1.05,1.77],["c",-.27,.15,-.36,.24,-.45,.39],["c",-.09,.21,-.09,.36,0,.57],["c",.09,.15,.18,.24,.51,.39],["c",.75,.42,1.23,1.14,1.41,2.13],["c",.06,.42,.06,1.35,0,1.71],["c",-.18,.81,-.48,1.38,-1.02,1.95],["c",-.75,.72,-1.8,1.2,-3.18,1.38],["c",-.42,.06,-1.56,.06,-1.95,0],["c",-1.89,-.33,-3.18,-1.29,-3.51,-2.64],["c",-.03,-.12,-.03,-.33,-.03,-.6],["c",0,-.36,0,-.42,.06,-.63],["c",.12,-.3,.27,-.51,.51,-.75],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.36,.33,.57,.75,.6,1.2],["c",0,.21,0,.27,-.06,.42],["c",-.09,.18,-.12,.24,-.54,.54],["c",-.51,.36,-.63,.54,-.6,.87],["c",.06,.54,.54,.9,1.38,.99],["c",.36,.06,.72,.03,.96,-.06],["c",.81,-.27,1.29,-1.23,1.44,-2.79],["c",.03,-.45,.03,-1.95,-.03,-2.37],["c",-.09,-.75,-.33,-1.23,-.75,-1.44],["c",-.33,-.18,-.45,-.18,-1.98,-.18],["c",-1.35,0,-1.41,0,-1.5,-.06],["c",-.18,-.12,-.24,-.39,-.12,-.6],["c",.12,-.15,.15,-.15,1.68,-.15],["c",1.5,0,1.62,0,1.89,-.15],["c",.18,-.09,.42,-.36,.54,-.57],["c",.18,-.42,.27,-.9,.3,-1.95],["c",.03,-1.2,-.06,-1.8,-.36,-2.37],["c",-.24,-.48,-.63,-.81,-1.14,-.96],["c",-.3,-.06,-1.08,-.06,-1.38,.03],["c",-.6,.15,-.9,.42,-.96,.84],["c",-.03,.3,.06,.45,.63,.84],["c",.33,.24,.42,.39,.45,.63],["c",.03,.72,-.57,1.5,-1.32,1.65],["c",-1.05,.27,-2.1,-.57,-2.1,-1.65],["c",0,-.45,.15,-.96,.39,-1.38],["c",.12,-.21,.54,-.63,.81,-.81],["c",.57,-.42,1.38,-.69,2.25,-.81],["z"]],w:9.735,h:14.967},4:{d:[["M",8.64,-14.94],["c",.27,-.09,.42,-.12,.54,-.03],["c",.09,.06,.15,.21,.15,.3],["c",-.03,.06,-1.92,2.31,-4.23,5.04],["c",-2.31,2.73,-4.23,4.98,-4.26,5.01],["c",-.03,.06,.12,.06,2.55,.06],["l",2.61,0],["l",0,-2.37],["c",0,-2.19,.03,-2.37,.06,-2.46],["c",.03,-.06,.21,-.18,.57,-.42],["c",1.08,-.72,1.38,-1.08,1.86,-2.16],["c",.12,-.3,.24,-.54,.27,-.57],["c",.12,-.12,.39,-.06,.45,.12],["c",.06,.09,.06,.57,.06,3.96],["l",0,3.9],["l",1.08,0],["c",1.05,0,1.11,0,1.2,.06],["c",.24,.15,.24,.54,0,.69],["c",-.09,.06,-.15,.06,-1.2,.06],["l",-1.08,0],["l",0,.33],["c",0,.57,.09,1.11,.3,1.53],["c",.36,.75,.93,1.17,1.68,1.26],["c",.3,.03,.39,.09,.39,.3],["c",0,.15,-.03,.18,-.09,.24],["c",-.06,.06,-.09,.06,-.48,.06],["c",-.42,0,-.69,-.03,-2.1,-.24],["c",-.9,-.15,-1.77,-.15,-2.67,0],["c",-1.41,.21,-1.68,.24,-2.1,.24],["c",-.39,0,-.42,0,-.48,-.06],["c",-.06,-.06,-.06,-.09,-.06,-.24],["c",0,-.21,.06,-.27,.36,-.3],["c",.75,-.09,1.32,-.51,1.68,-1.26],["c",.21,-.42,.3,-.96,.3,-1.53],["l",0,-.33],["l",-2.7,0],["c",-2.91,0,-2.85,0,-3.09,-.15],["c",-.18,-.12,-.3,-.39,-.27,-.54],["c",.03,-.06,.18,-.24,.33,-.45],["c",.75,-.9,1.59,-2.07,2.13,-3.03],["c",.33,-.54,.84,-1.62,1.05,-2.16],["c",.57,-1.41,.84,-2.64,.9,-4.05],["c",.03,-.63,.06,-.72,.24,-.81],["l",.12,-.06],["l",.45,.12],["c",.66,.18,1.02,.24,1.47,.27],["c",.6,.03,1.23,-.09,2.01,-.33],["z"]],w:11.795,h:14.994},5:{d:[["M",1.02,-14.94],["c",.12,-.09,.03,-.09,1.08,.06],["c",2.49,.36,4.35,.36,6.96,-.06],["c",.57,-.09,.66,-.06,.81,.06],["c",.15,.18,.12,.24,-.15,.51],["c",-1.29,1.26,-3.24,2.04,-5.58,2.31],["c",-.6,.09,-1.2,.12,-1.71,.12],["c",-.39,0,-.45,0,-.57,.06],["c",-.09,.06,-.15,.12,-.21,.21],["l",-.06,.12],["l",0,1.65],["l",0,1.65],["l",.21,-.21],["c",.66,-.57,1.41,-.96,2.19,-1.14],["c",.33,-.06,1.41,-.06,1.95,0],["c",2.61,.36,4.02,1.74,4.26,4.14],["c",.03,.45,.03,1.08,-.03,1.44],["c",-.18,1.02,-.78,2.01,-1.59,2.7],["c",-.72,.57,-1.62,1.02,-2.49,1.2],["c",-1.38,.27,-3.03,.06,-4.2,-.54],["c",-1.08,-.54,-1.71,-1.32,-1.86,-2.28],["c",-.09,-.69,.09,-1.29,.57,-1.74],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.36,.33,.57,.75,.6,1.2],["c",0,.21,0,.27,-.06,.42],["c",-.09,.18,-.12,.24,-.54,.54],["c",-.18,.12,-.36,.3,-.42,.33],["c",-.36,.42,-.18,.99,.36,1.26],["c",.51,.27,1.47,.36,2.01,.27],["c",.93,-.21,1.47,-1.17,1.65,-2.91],["c",.06,-.45,.06,-1.89,0,-2.31],["c",-.15,-1.2,-.51,-2.1,-1.05,-2.55],["c",-.21,-.18,-.54,-.36,-.81,-.39],["c",-.3,-.06,-.84,-.03,-1.26,.06],["c",-.93,.18,-1.65,.6,-2.16,1.2],["c",-.15,.21,-.27,.3,-.39,.3],["c",-.15,0,-.3,-.09,-.36,-.18],["c",-.06,-.09,-.06,-.15,-.06,-3.66],["c",0,-3.39,0,-3.57,.06,-3.66],["c",.03,-.06,.09,-.15,.15,-.18],["z"]],w:10.212,h:14.997},6:{d:[["M",4.98,-14.97],["c",.36,-.03,1.2,0,1.59,.06],["c",.9,.15,1.68,.51,2.25,1.05],["c",.57,.51,.87,1.23,.84,1.98],["c",-.03,.51,-.21,.9,-.6,1.26],["c",-.24,.24,-.45,.39,-.75,.51],["c",-.21,.06,-.27,.06,-.6,.06],["c",-.33,0,-.39,0,-.6,-.06],["c",-.3,-.12,-.51,-.27,-.75,-.51],["c",-.39,-.36,-.57,-.78,-.57,-1.26],["c",0,-.27,0,-.3,.09,-.42],["c",.03,-.09,.18,-.21,.3,-.3],["c",.12,-.09,.3,-.21,.39,-.27],["c",.09,-.06,.21,-.18,.27,-.24],["c",.06,-.12,.09,-.15,.09,-.33],["c",0,-.18,-.03,-.24,-.09,-.36],["c",-.24,-.39,-.75,-.6,-1.38,-.57],["c",-.54,.03,-.9,.18,-1.23,.48],["c",-.81,.72,-1.08,2.16,-.96,5.37],["l",0,.63],["l",.3,-.12],["c",.78,-.27,1.29,-.33,2.1,-.27],["c",1.47,.12,2.49,.54,3.27,1.29],["c",.48,.51,.81,1.11,.96,1.89],["c",.06,.27,.06,.42,.06,.93],["c",0,.54,0,.69,-.06,.96],["c",-.15,.78,-.48,1.38,-.96,1.89],["c",-.54,.51,-1.17,.87,-1.98,1.08],["c",-1.14,.3,-2.4,.33,-3.24,.03],["c",-1.5,-.48,-2.64,-1.89,-3.27,-4.02],["c",-.36,-1.23,-.51,-2.82,-.42,-4.08],["c",.3,-3.66,2.28,-6.3,4.95,-6.66],["z"],["m",.66,7.41],["c",-.27,-.09,-.81,-.12,-1.08,-.06],["c",-.72,.18,-1.08,.69,-1.23,1.71],["c",-.06,.54,-.06,3,0,3.54],["c",.18,1.26,.72,1.77,1.8,1.74],["c",.39,-.03,.63,-.09,.9,-.27],["c",.66,-.42,.9,-1.32,.9,-3.24],["c",0,-2.22,-.36,-3.12,-1.29,-3.42],["z"]],w:9.956,h:14.982},7:{d:[["M",.21,-14.97],["c",.21,-.06,.45,0,.54,.15],["c",.06,.09,.06,.15,.06,.39],["c",0,.24,0,.33,.06,.42],["c",.06,.12,.21,.24,.27,.24],["c",.03,0,.12,-.12,.24,-.21],["c",.96,-1.2,2.58,-1.35,3.99,-.42],["c",.15,.12,.42,.3,.54,.45],["c",.48,.39,.81,.57,1.29,.6],["c",.69,.03,1.5,-.3,2.13,-.87],["c",.09,-.09,.27,-.3,.39,-.45],["c",.12,-.15,.24,-.27,.3,-.3],["c",.18,-.06,.39,.03,.51,.21],["c",.06,.18,.06,.24,-.27,.72],["c",-.18,.24,-.54,.78,-.78,1.17],["c",-2.37,3.54,-3.54,6.27,-3.87,9],["c",-.03,.33,-.03,.66,-.03,1.26],["c",0,.9,0,1.08,.15,1.89],["c",.06,.45,.06,.48,.03,.6],["c",-.06,.09,-.21,.21,-.3,.21],["c",-.03,0,-.27,-.06,-.54,-.15],["c",-.84,-.27,-1.11,-.3,-1.65,-.3],["c",-.57,0,-.84,.03,-1.56,.27],["c",-.6,.18,-.69,.21,-.81,.15],["c",-.12,-.06,-.21,-.18,-.21,-.3],["c",0,-.15,.6,-1.44,1.2,-2.61],["c",1.14,-2.22,2.73,-4.68,5.1,-8.01],["c",.21,-.27,.36,-.48,.33,-.48],["c",0,0,-.12,.06,-.27,.12],["c",-.54,.3,-.99,.39,-1.56,.39],["c",-.75,.03,-1.2,-.18,-1.83,-.75],["c",-.99,-.9,-1.83,-1.17,-2.31,-.72],["c",-.18,.15,-.36,.51,-.45,.84],["c",-.06,.24,-.06,.33,-.09,1.98],["c",0,1.62,-.03,1.74,-.06,1.8],["c",-.15,.24,-.54,.24,-.69,0],["c",-.06,-.09,-.06,-.15,-.06,-3.57],["c",0,-3.42,0,-3.48,.06,-3.57],["c",.03,-.06,.09,-.12,.15,-.15],["z"]],w:10.561,h:15.093},8:{d:[["M",4.98,-14.97],["c",.33,-.03,1.02,-.03,1.32,0],["c",1.32,.12,2.49,.6,3.21,1.32],["c",.39,.39,.66,.81,.78,1.29],["c",.09,.36,.09,1.08,0,1.44],["c",-.21,.84,-.66,1.59,-1.59,2.55],["l",-.3,.3],["l",.27,.18],["c",1.47,.93,2.31,2.31,2.25,3.75],["c",-.03,.75,-.24,1.35,-.63,1.95],["c",-.45,.66,-1.02,1.14,-1.83,1.53],["c",-1.8,.87,-4.2,.87,-6,.03],["c",-1.62,-.78,-2.52,-2.16,-2.46,-3.66],["c",.06,-.99,.54,-1.77,1.8,-2.97],["c",.54,-.51,.54,-.54,.48,-.57],["c",-.39,-.27,-.96,-.78,-1.2,-1.14],["c",-.75,-1.11,-.87,-2.4,-.3,-3.6],["c",.69,-1.35,2.25,-2.25,4.2,-2.4],["z"],["m",1.53,.69],["c",-.42,-.09,-1.11,-.12,-1.38,-.06],["c",-.3,.06,-.6,.18,-.81,.3],["c",-.21,.12,-.6,.51,-.72,.72],["c",-.51,.87,-.42,1.89,.21,2.52],["c",.21,.21,.36,.3,1.95,1.23],["c",.96,.54,1.74,.99,1.77,1.02],["c",.09,0,.63,-.6,.99,-1.11],["c",.21,-.36,.48,-.87,.57,-1.23],["c",.06,-.24,.06,-.36,.06,-.72],["c",0,-.45,-.03,-.66,-.15,-.99],["c",-.39,-.81,-1.29,-1.44,-2.49,-1.68],["z"],["m",-1.44,8.07],["l",-1.89,-1.08],["c",-.03,0,-.18,.15,-.39,.33],["c",-1.2,1.08,-1.65,1.95,-1.59,3],["c",.09,1.59,1.35,2.85,3.21,3.24],["c",.33,.06,.45,.06,.93,.06],["c",.63,0,.81,-.03,1.29,-.27],["c",.9,-.42,1.47,-1.41,1.41,-2.4],["c",-.06,-.66,-.39,-1.29,-.9,-1.65],["c",-.12,-.09,-1.05,-.63,-2.07,-1.23],["z"]],w:10.926,h:14.989},9:{d:[["M",4.23,-14.97],["c",.42,-.03,1.29,0,1.62,.06],["c",.51,.12,.93,.3,1.38,.57],["c",1.53,1.02,2.52,3.24,2.73,5.94],["c",.18,2.55,-.48,4.98,-1.83,6.57],["c",-1.05,1.26,-2.4,1.89,-3.93,1.83],["c",-1.23,-.06,-2.31,-.45,-3.03,-1.14],["c",-.57,-.51,-.87,-1.23,-.84,-1.98],["c",.03,-.51,.21,-.9,.6,-1.26],["c",.24,-.24,.45,-.39,.75,-.51],["c",.21,-.06,.27,-.06,.6,-.06],["c",.33,0,.39,0,.6,.06],["c",.3,.12,.51,.27,.75,.51],["c",.39,.36,.57,.78,.57,1.26],["c",0,.27,0,.3,-.09,.42],["c",-.03,.09,-.18,.21,-.3,.3],["c",-.12,.09,-.3,.21,-.39,.27],["c",-.09,.06,-.21,.18,-.27,.24],["c",-.06,.12,-.06,.15,-.06,.33],["c",0,.18,0,.24,.06,.36],["c",.24,.39,.75,.6,1.38,.57],["c",.54,-.03,.9,-.18,1.23,-.48],["c",.81,-.72,1.08,-2.16,.96,-5.37],["l",0,-.63],["l",-.3,.12],["c",-.78,.27,-1.29,.33,-2.1,.27],["c",-1.47,-.12,-2.49,-.54,-3.27,-1.29],["c",-.48,-.51,-.81,-1.11,-.96,-1.89],["c",-.06,-.27,-.06,-.42,-.06,-.96],["c",0,-.51,0,-.66,.06,-.93],["c",.15,-.78,.48,-1.38,.96,-1.89],["c",.15,-.12,.33,-.27,.42,-.36],["c",.69,-.51,1.62,-.81,2.76,-.93],["z"],["m",1.17,.66],["c",-.21,-.06,-.57,-.06,-.81,-.03],["c",-.78,.12,-1.26,.69,-1.41,1.74],["c",-.12,.63,-.15,1.95,-.09,2.79],["c",.12,1.71,.63,2.4,1.77,2.46],["c",1.08,.03,1.62,-.48,1.8,-1.74],["c",.06,-.54,.06,-3,0,-3.54],["c",-.15,-1.05,-.51,-1.53,-1.26,-1.68],["z"]],w:9.959,h:14.986},"rests.multimeasure":{d:[["M",0,-4],["l",0,16],["l",1,0],["l",0,-5],["l",40,0],["l",0,5],["l",1,0],["l",0,-16],["l",-1,0],["l",0,5],["l",-40,0],["l",0,-5],["z"]],w:42,h:18},"rests.whole":{d:[["M",.06,.03],["l",.09,-.06],["l",5.46,0],["l",5.49,0],["l",.09,.06],["l",.06,.09],["l",0,2.19],["l",0,2.19],["l",-.06,.09],["l",-.09,.06],["l",-5.49,0],["l",-5.46,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-2.19],["l",0,-2.19],["z"]],w:11.25,h:4.68},"rests.half":{d:[["M",.06,-4.62],["l",.09,-.06],["l",5.46,0],["l",5.49,0],["l",.09,.06],["l",.06,.09],["l",0,2.19],["l",0,2.19],["l",-.06,.09],["l",-.09,.06],["l",-5.49,0],["l",-5.46,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-2.19],["l",0,-2.19],["z"]],w:11.25,h:4.68},"rests.quarter":{d:[["M",1.89,-11.82],["c",.12,-.06,.24,-.06,.36,-.03],["c",.09,.06,4.74,5.58,4.86,5.82],["c",.21,.39,.15,.78,-.15,1.26],["c",-.24,.33,-.72,.81,-1.62,1.56],["c",-.45,.36,-.87,.75,-.96,.84],["c",-.93,.99,-1.14,2.49,-.6,3.63],["c",.18,.39,.27,.48,1.32,1.68],["c",1.92,2.25,1.83,2.16,1.83,2.34],["c",0,.18,-.18,.36,-.36,.39],["c",-.15,0,-.27,-.06,-.48,-.27],["c",-.75,-.75,-2.46,-1.29,-3.39,-1.08],["c",-.45,.09,-.69,.27,-.9,.69],["c",-.12,.3,-.21,.66,-.24,1.14],["c",-.03,.66,.09,1.35,.3,2.01],["c",.15,.42,.24,.66,.45,.96],["c",.18,.24,.18,.33,.03,.42],["c",-.12,.06,-.18,.03,-.45,-.3],["c",-1.08,-1.38,-2.07,-3.36,-2.4,-4.83],["c",-.27,-1.05,-.15,-1.77,.27,-2.07],["c",.21,-.12,.42,-.15,.87,-.15],["c",.87,.06,2.1,.39,3.3,.9],["l",.39,.18],["l",-1.65,-1.95],["c",-2.52,-2.97,-2.61,-3.09,-2.7,-3.27],["c",-.09,-.24,-.12,-.48,-.03,-.75],["c",.15,-.48,.57,-.96,1.83,-2.01],["c",.45,-.36,.84,-.72,.93,-.78],["c",.69,-.75,1.02,-1.8,.9,-2.79],["c",-.06,-.33,-.21,-.84,-.39,-1.11],["c",-.09,-.15,-.45,-.6,-.81,-1.05],["c",-.36,-.42,-.69,-.81,-.72,-.87],["c",-.09,-.18,0,-.42,.21,-.51],["z"]],w:7.888,h:21.435},"rests.8th":{d:[["M",1.68,-6.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.12,0,.18,0,.33,-.09],["c",.39,-.18,1.32,-1.29,1.68,-1.98],["c",.09,-.21,.24,-.3,.39,-.3],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.27,1.11,-1.86,6.42],["c",-1.02,3.48,-1.89,6.39,-1.92,6.42],["c",0,.03,-.12,.12,-.24,.15],["c",-.18,.09,-.21,.09,-.45,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.15,-.57,1.68,-4.92],["c",.96,-2.67,1.74,-4.89,1.71,-4.89],["l",-.51,.15],["c",-1.08,.36,-1.74,.48,-2.55,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:7.534,h:13.883},"rests.16th":{d:[["M",3.33,-6.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.15,.39,.57,.57,.87,.42],["c",.39,-.18,1.2,-1.23,1.62,-2.07],["c",.06,-.15,.24,-.24,.36,-.24],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.45,1.86,-2.67,10.17],["c",-1.5,5.55,-2.73,10.14,-2.76,10.17],["c",-.03,.03,-.12,.12,-.24,.15],["c",-.18,.09,-.21,.09,-.45,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.12,-.57,1.44,-4.92],["c",.81,-2.67,1.47,-4.86,1.47,-4.89],["c",-.03,0,-.27,.06,-.54,.15],["c",-1.08,.36,-1.77,.48,-2.58,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.09,.09,.27,.18,.45,.21],["c",.12,0,.18,0,.33,-.09],["c",.33,-.15,1.02,-.93,1.41,-1.59],["c",.12,-.21,.18,-.39,.39,-1.08],["c",.66,-2.1,1.17,-3.84,1.17,-3.87],["c",0,0,-.21,.06,-.42,.15],["c",-.51,.15,-1.2,.33,-1.68,.42],["c",-.33,.06,-.51,.06,-.96,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:9.724,h:21.383},"rests.32nd":{d:[["M",4.23,-13.62],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.12,0,.18,0,.27,-.06],["c",.33,-.21,.99,-1.11,1.44,-1.98],["c",.09,-.24,.21,-.33,.39,-.33],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.57,2.67,-3.21,13.89],["c",-1.8,7.62,-3.3,13.89,-3.3,13.92],["c",-.03,.06,-.12,.12,-.24,.18],["c",-.21,.09,-.24,.09,-.48,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.09,-.57,1.23,-4.92],["c",.69,-2.67,1.26,-4.86,1.29,-4.89],["c",0,-.03,-.12,-.03,-.48,.12],["c",-1.17,.39,-2.22,.57,-3,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.12,.09,.3,.18,.48,.21],["c",.12,0,.18,0,.3,-.09],["c",.42,-.21,1.29,-1.29,1.56,-1.89],["c",.03,-.12,1.23,-4.59,1.23,-4.65],["c",0,-.03,-.18,.03,-.39,.12],["c",-.63,.18,-1.2,.36,-1.74,.45],["c",-.39,.06,-.54,.06,-1.02,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.18,.18,.51,.27,.72,.15],["c",.3,-.12,.69,-.57,1.08,-1.17],["c",.42,-.6,.39,-.51,1.05,-3.03],["c",.33,-1.26,.6,-2.31,.6,-2.34],["c",0,0,-.21,.03,-.45,.12],["c",-.57,.18,-1.14,.33,-1.62,.42],["c",-.33,.06,-.51,.06,-.96,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:11.373,h:28.883},"rests.64th":{d:[["M",5.13,-13.62],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.21,.54,.3,.75,.18],["c",.24,-.12,.63,-.66,1.08,-1.56],["c",.33,-.66,.39,-.72,.6,-.72],["c",.12,0,.27,.09,.33,.18],["c",.03,.06,-.69,3.66,-3.54,17.64],["c",-1.95,9.66,-3.57,17.61,-3.57,17.64],["c",-.03,.06,-.12,.12,-.24,.18],["c",-.21,.09,-.24,.09,-.48,.09],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.06,-.57,1.05,-4.95],["c",.6,-2.7,1.08,-4.89,1.08,-4.92],["c",0,0,-.24,.06,-.51,.15],["c",-.66,.24,-1.2,.36,-1.77,.48],["c",-.42,.06,-.57,.06,-1.05,.06],["c",-.69,0,-.87,-.03,-1.35,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.72,-1.05,2.22,-1.23,3.06,-.42],["c",.3,.33,.42,.6,.6,1.38],["c",.09,.45,.21,.78,.33,.9],["c",.09,.09,.27,.18,.45,.21],["c",.21,.03,.39,-.09,.72,-.42],["c",.45,-.45,1.02,-1.26,1.17,-1.65],["c",.03,-.09,.27,-1.14,.54,-2.34],["c",.27,-1.2,.48,-2.19,.51,-2.22],["c",0,-.03,-.09,-.03,-.48,.12],["c",-1.17,.39,-2.22,.57,-3,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.15,.39,.57,.57,.9,.42],["c",.36,-.18,1.2,-1.26,1.47,-1.89],["c",.03,-.09,.3,-1.2,.57,-2.43],["l",.51,-2.28],["l",-.54,.18],["c",-1.11,.36,-1.8,.48,-2.61,.48],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.21,.21,.54,.3,.75,.18],["c",.36,-.18,.93,-.93,1.29,-1.68],["c",.12,-.24,.18,-.48,.63,-2.55],["l",.51,-2.31],["c",0,-.03,-.18,.03,-.39,.12],["c",-1.14,.36,-2.1,.54,-2.82,.51],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:12.453,h:36.383},"rests.128th":{d:[["M",6.03,-21.12],["c",.66,-.09,1.23,.09,1.68,.51],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.21,0,.33,-.06,.54,-.36],["c",.15,-.21,.54,-.93,.78,-1.47],["c",.15,-.33,.18,-.39,.3,-.48],["c",.18,-.09,.45,0,.51,.15],["c",.03,.09,-7.11,42.75,-7.17,42.84],["c",-.03,.03,-.15,.09,-.24,.15],["c",-.18,.06,-.24,.06,-.45,.06],["c",-.24,0,-.3,0,-.48,-.06],["c",-.09,-.06,-.21,-.12,-.21,-.15],["c",-.06,-.03,.03,-.57,.84,-4.98],["c",.51,-2.7,.93,-4.92,.9,-4.92],["c",0,0,-.15,.06,-.36,.12],["c",-.78,.27,-1.62,.48,-2.31,.57],["c",-.15,.03,-.54,.03,-.81,.03],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.63,.48],["c",.12,0,.18,0,.3,-.09],["c",.42,-.21,1.14,-1.11,1.5,-1.83],["c",.12,-.27,.12,-.27,.54,-2.52],["c",.24,-1.23,.42,-2.25,.39,-2.25],["c",0,0,-.24,.06,-.51,.18],["c",-1.26,.39,-2.25,.57,-3.06,.54],["c",-.42,-.03,-.75,-.12,-1.11,-.3],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.21,.51,.3,.75,.18],["c",.36,-.15,1.05,-.99,1.41,-1.77],["l",.15,-.3],["l",.42,-2.25],["c",.21,-1.26,.42,-2.28,.39,-2.28],["l",-.51,.15],["c",-1.11,.39,-1.89,.51,-2.7,.51],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.15,.63,.21,.81,.33,.96],["c",.18,.18,.48,.27,.72,.21],["c",.33,-.12,1.14,-1.26,1.41,-1.95],["c",0,-.09,.21,-1.11,.45,-2.34],["c",.21,-1.2,.39,-2.22,.39,-2.28],["c",.03,-.03,0,-.03,-.45,.12],["c",-.57,.18,-1.2,.33,-1.71,.42],["c",-.3,.06,-.51,.06,-.93,.06],["c",-.66,0,-.84,-.03,-1.32,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.36,-.54,.96,-.87,1.65,-.93],["c",.54,-.03,1.02,.15,1.41,.54],["c",.27,.3,.39,.54,.57,1.26],["c",.09,.33,.18,.66,.21,.72],["c",.12,.27,.33,.45,.6,.48],["c",.18,0,.36,-.09,.57,-.33],["c",.33,-.36,.78,-1.14,.93,-1.56],["c",.03,-.12,.24,-1.2,.45,-2.4],["c",.24,-1.2,.42,-2.22,.42,-2.28],["c",.03,-.03,0,-.03,-.39,.09],["c",-1.05,.36,-1.8,.48,-2.58,.48],["c",-.63,0,-.84,-.03,-1.29,-.27],["c",-1.32,-.63,-1.77,-2.16,-1.02,-3.3],["c",.33,-.45,.84,-.81,1.38,-.9],["z"]],w:12.992,h:43.883},"accidentals.sharp":{d:[["M",5.73,-11.19],["c",.21,-.12,.54,-.03,.66,.24],["c",.06,.12,.06,.21,.06,2.31],["c",0,1.23,0,2.22,.03,2.22],["c",0,0,.27,-.12,.6,-.24],["c",.69,-.27,.78,-.3,.96,-.15],["c",.21,.15,.21,.18,.21,1.38],["c",0,1.02,0,1.11,-.06,1.2],["c",-.03,.06,-.09,.12,-.12,.15],["c",-.06,.03,-.42,.21,-.84,.36],["l",-.75,.33],["l",-.03,2.43],["c",0,1.32,0,2.43,.03,2.43],["c",0,0,.27,-.12,.6,-.24],["c",.69,-.27,.78,-.3,.96,-.15],["c",.21,.15,.21,.18,.21,1.38],["c",0,1.02,0,1.11,-.06,1.2],["c",-.03,.06,-.09,.12,-.12,.15],["c",-.06,.03,-.42,.21,-.84,.36],["l",-.75,.33],["l",-.03,2.52],["c",0,2.28,-.03,2.55,-.06,2.64],["c",-.21,.36,-.72,.36,-.93,0],["c",-.03,-.09,-.06,-.33,-.06,-2.43],["l",0,-2.31],["l",-1.29,.51],["l",-1.26,.51],["l",0,2.43],["c",0,2.58,0,2.52,-.15,2.67],["c",-.06,.09,-.27,.18,-.36,.18],["c",-.12,0,-.33,-.09,-.39,-.18],["c",-.15,-.15,-.15,-.09,-.15,-2.43],["c",0,-1.23,0,-2.22,-.03,-2.22],["c",0,0,-.27,.12,-.6,.24],["c",-.69,.27,-.78,.3,-.96,.15],["c",-.21,-.15,-.21,-.18,-.21,-1.38],["c",0,-1.02,0,-1.11,.06,-1.2],["c",.03,-.06,.09,-.12,.12,-.15],["c",.06,-.03,.42,-.21,.84,-.36],["l",.78,-.33],["l",0,-2.43],["c",0,-1.32,0,-2.43,-.03,-2.43],["c",0,0,-.27,.12,-.6,.24],["c",-.69,.27,-.78,.3,-.96,.15],["c",-.21,-.15,-.21,-.18,-.21,-1.38],["c",0,-1.02,0,-1.11,.06,-1.2],["c",.03,-.06,.09,-.12,.12,-.15],["c",.06,-.03,.42,-.21,.84,-.36],["l",.78,-.33],["l",0,-2.52],["c",0,-2.28,.03,-2.55,.06,-2.64],["c",.21,-.36,.72,-.36,.93,0],["c",.03,.09,.06,.33,.06,2.43],["l",.03,2.31],["l",1.26,-.51],["l",1.26,-.51],["l",0,-2.43],["c",0,-2.28,0,-2.43,.06,-2.55],["c",.06,-.12,.12,-.18,.27,-.24],["z"],["m",-.33,10.65],["l",0,-2.43],["l",-1.29,.51],["l",-1.26,.51],["l",0,2.46],["l",0,2.43],["l",.09,-.03],["c",.06,-.03,.63,-.27,1.29,-.51],["l",1.17,-.48],["l",0,-2.46],["z"]],w:8.25,h:22.462},"accidentals.halfsharp":{d:[["M",2.43,-10.05],["c",.21,-.12,.54,-.03,.66,.24],["c",.06,.12,.06,.21,.06,2.01],["c",0,1.05,0,1.89,.03,1.89],["l",.72,-.48],["c",.69,-.48,.69,-.51,.87,-.51],["c",.15,0,.18,.03,.27,.09],["c",.21,.15,.21,.18,.21,1.41],["c",0,1.11,-.03,1.14,-.09,1.23],["c",-.03,.03,-.48,.39,-1.02,.75],["l",-.99,.66],["l",0,2.37],["c",0,1.32,0,2.37,.03,2.37],["l",.72,-.48],["c",.69,-.48,.69,-.51,.87,-.51],["c",.15,0,.18,.03,.27,.09],["c",.21,.15,.21,.18,.21,1.41],["c",0,1.11,-.03,1.14,-.09,1.23],["c",-.03,.03,-.48,.39,-1.02,.75],["l",-.99,.66],["l",0,2.25],["c",0,1.95,0,2.28,-.06,2.37],["c",-.06,.12,-.12,.21,-.24,.27],["c",-.27,.12,-.54,.03,-.69,-.24],["c",-.06,-.12,-.06,-.21,-.06,-2.01],["c",0,-1.05,0,-1.89,-.03,-1.89],["l",-.72,.48],["c",-.69,.48,-.69,.48,-.87,.48],["c",-.15,0,-.18,0,-.27,-.06],["c",-.21,-.15,-.21,-.18,-.21,-1.41],["c",0,-1.11,.03,-1.14,.09,-1.23],["c",.03,-.03,.48,-.39,1.02,-.75],["l",.99,-.66],["l",0,-2.37],["c",0,-1.32,0,-2.37,-.03,-2.37],["l",-.72,.48],["c",-.69,.48,-.69,.48,-.87,.48],["c",-.15,0,-.18,0,-.27,-.06],["c",-.21,-.15,-.21,-.18,-.21,-1.41],["c",0,-1.11,.03,-1.14,.09,-1.23],["c",.03,-.03,.48,-.39,1.02,-.75],["l",.99,-.66],["l",0,-2.25],["c",0,-2.13,0,-2.28,.06,-2.4],["c",.06,-.12,.12,-.18,.27,-.24],["z"]],w:5.25,h:20.174},"accidentals.nat":{d:[["M",.21,-11.4],["c",.24,-.06,.78,0,.99,.15],["c",.03,.03,.03,.48,0,2.61],["c",-.03,1.44,-.03,2.61,-.03,2.61],["c",0,.03,.75,-.09,1.68,-.24],["c",.96,-.18,1.71,-.27,1.74,-.27],["c",.15,.03,.27,.15,.36,.3],["l",.06,.12],["l",.09,8.67],["c",.09,6.96,.12,8.67,.09,8.67],["c",-.03,.03,-.12,.06,-.21,.09],["c",-.24,.09,-.72,.09,-.96,0],["c",-.09,-.03,-.18,-.06,-.21,-.09],["c",-.03,-.03,-.03,-.48,0,-2.61],["c",.03,-1.44,.03,-2.61,.03,-2.61],["c",0,-.03,-.75,.09,-1.68,.24],["c",-.96,.18,-1.71,.27,-1.74,.27],["c",-.15,-.03,-.27,-.15,-.36,-.3],["l",-.06,-.15],["l",-.09,-7.53],["c",-.06,-4.14,-.09,-8.04,-.12,-8.67],["l",0,-1.11],["l",.15,-.06],["c",.09,-.03,.21,-.06,.27,-.09],["z"],["m",3.75,8.4],["c",0,-.33,0,-.42,-.03,-.42],["c",-.12,0,-2.79,.45,-2.79,.48],["c",-.03,0,-.09,6.3,-.09,6.33],["c",.03,0,2.79,-.45,2.82,-.48],["c",0,0,.09,-4.53,.09,-5.91],["z"]],w:5.4,h:22.8},"accidentals.flat":{d:[["M",-.36,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"]],w:6.75,h:18.801},"accidentals.halfflat":{d:[["M",4.83,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.6,-.12,9.06],["c",-.09,5.55,-.15,9.06,-.18,9.12],["c",-.03,.09,-.09,.18,-.15,.27],["c",-.24,.21,-.54,.24,-.81,.06],["c",-.06,-.03,-.27,-.24,-.45,-.42],["c",-.36,-.42,-.66,-.66,-1.8,-1.44],["c",-1.23,-.84,-1.83,-1.32,-2.25,-1.77],["c",-.66,-.78,-.96,-1.56,-.93,-2.46],["c",.09,-1.41,1.11,-2.58,2.4,-2.79],["c",.3,-.06,.84,-.03,1.23,.06],["c",.54,.12,1.08,.33,1.53,.63],["c",.12,.09,.24,.15,.24,.12],["c",0,0,-.12,-8.37,-.18,-9.75],["l",0,-.66],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",-1.65,10.95],["c",-.6,-.18,-1.08,.09,-1.38,.69],["c",-.27,.6,-.36,1.38,-.18,2.07],["c",.12,.42,.42,.99,.72,1.41],["c",.3,.42,.93,1.05,1.56,1.59],["l",.48,.39],["l",0,-.12],["c",.03,-.09,.03,-.48,.06,-.9],["c",.03,-.57,.03,-1.08,0,-2.22],["c",-.03,-1.62,-.03,-1.62,-.24,-2.07],["c",-.21,-.42,-.6,-.75,-1.02,-.84],["z"]],w:6.728,h:18.801},"accidentals.dblflat":{d:[["M",-.36,-14.07],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"],["m",3,-11],["c",.33,-.06,.87,0,1.08,.15],["c",.06,.03,.06,.36,-.03,5.25],["c",-.06,2.85,-.09,5.19,-.09,5.19],["c",0,.03,.12,-.03,.24,-.12],["c",.63,-.42,1.41,-.66,2.19,-.72],["c",.81,-.03,1.47,.21,2.04,.78],["c",.57,.54,.87,1.26,.93,2.04],["c",.03,.57,-.09,1.08,-.36,1.62],["c",-.42,.81,-1.02,1.38,-2.82,2.61],["c",-1.14,.78,-1.44,1.02,-1.8,1.44],["c",-.18,.18,-.39,.39,-.45,.42],["c",-.27,.18,-.57,.15,-.81,-.06],["c",-.06,-.09,-.12,-.18,-.15,-.27],["c",-.03,-.06,-.09,-3.27,-.18,-8.34],["c",-.09,-4.53,-.15,-8.58,-.18,-9.03],["l",0,-.78],["l",.12,-.06],["c",.06,-.03,.18,-.09,.27,-.12],["z"],["m",3.18,11.01],["c",-.21,-.12,-.54,-.15,-.81,-.06],["c",-.54,.15,-.99,.63,-1.17,1.26],["c",-.06,.3,-.12,2.88,-.06,3.87],["c",.03,.42,.03,.81,.06,.9],["l",.03,.12],["l",.45,-.39],["c",.63,-.54,1.26,-1.17,1.56,-1.59],["c",.3,-.42,.6,-.99,.72,-1.41],["c",.18,-.69,.09,-1.47,-.18,-2.07],["c",-.15,-.3,-.33,-.51,-.6,-.63],["z"]],w:12.1,h:18.804},"accidentals.dblsharp":{d:[["M",-.18,-3.96],["c",.06,-.03,.12,-.06,.15,-.06],["c",.09,0,2.76,.27,2.79,.3],["c",.12,.03,.15,.12,.15,.51],["c",.06,.96,.24,1.59,.57,2.1],["c",.06,.09,.15,.21,.18,.24],["l",.09,.06],["l",.09,-.06],["c",.03,-.03,.12,-.15,.18,-.24],["c",.33,-.51,.51,-1.14,.57,-2.1],["c",0,-.39,.03,-.45,.12,-.51],["c",.03,0,.66,-.09,1.44,-.15],["c",1.47,-.15,1.5,-.15,1.56,-.03],["c",.03,.06,0,.42,-.09,1.44],["c",-.09,.72,-.15,1.35,-.15,1.38],["c",0,.03,-.03,.09,-.06,.12],["c",-.06,.06,-.12,.09,-.51,.09],["c",-1.08,.06,-1.8,.3,-2.28,.75],["l",-.12,.09],["l",.09,.09],["c",.12,.15,.39,.33,.63,.45],["c",.42,.18,.96,.27,1.68,.33],["c",.39,0,.45,.03,.51,.09],["c",.03,.03,.06,.09,.06,.12],["c",0,.03,.06,.66,.15,1.38],["c",.09,1.02,.12,1.38,.09,1.44],["c",-.06,.12,-.09,.12,-1.56,-.03],["c",-.78,-.06,-1.41,-.15,-1.44,-.15],["c",-.09,-.06,-.12,-.12,-.12,-.54],["c",-.06,-.93,-.24,-1.56,-.57,-2.07],["c",-.06,-.09,-.15,-.21,-.18,-.24],["l",-.09,-.06],["l",-.09,.06],["c",-.03,.03,-.12,.15,-.18,.24],["c",-.33,.51,-.51,1.14,-.57,2.07],["c",0,.42,-.03,.48,-.12,.54],["c",-.03,0,-.66,.09,-1.44,.15],["c",-1.47,.15,-1.5,.15,-1.56,.03],["c",-.03,-.06,0,-.42,.09,-1.44],["c",.09,-.72,.15,-1.35,.15,-1.38],["c",0,-.03,.03,-.09,.06,-.12],["c",.06,-.06,.12,-.09,.51,-.09],["c",.72,-.06,1.26,-.15,1.68,-.33],["c",.24,-.12,.51,-.3,.63,-.45],["l",.09,-.09],["l",-.12,-.09],["c",-.48,-.45,-1.2,-.69,-2.28,-.75],["c",-.39,0,-.45,-.03,-.51,-.09],["c",-.03,-.03,-.06,-.09,-.06,-.12],["c",0,-.03,-.06,-.63,-.12,-1.38],["c",-.09,-.72,-.15,-1.35,-.15,-1.38],["z"]],w:7.95,h:7.977},"dots.dot":{d:[["M",1.32,-1.68],["c",.09,-.03,.27,-.06,.39,-.06],["c",.96,0,1.74,.78,1.74,1.71],["c",0,.96,-.78,1.74,-1.71,1.74],["c",-.96,0,-1.74,-.78,-1.74,-1.71],["c",0,-.78,.54,-1.5,1.32,-1.68],["z"]],w:3.45,h:3.45},"noteheads.dbl":{d:[["M",-.69,-4.02],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["c",.06,.15,.06,.18,.06,1.41],["l",0,1.23],["l",.12,-.18],["c",.72,-1.26,2.64,-2.31,4.86,-2.64],["c",.81,-.15,1.11,-.15,2.13,-.15],["c",.99,0,1.29,0,2.1,.15],["c",.75,.12,1.38,.27,2.04,.54],["c",1.35,.51,2.34,1.26,2.82,2.1],["l",.12,.18],["l",0,-1.23],["c",0,-1.2,0,-1.26,.06,-1.38],["c",.09,-.18,.15,-.24,.33,-.33],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,3.54],["l",0,3.54],["l",-.06,.15],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.06,-.12,-.06,-.18,-.06,-1.38],["l",0,-1.23],["l",-.12,.18],["c",-.48,.84,-1.47,1.59,-2.82,2.1],["c",-.84,.33,-1.71,.54,-2.85,.66],["c",-.45,.06,-2.16,.06,-2.61,0],["c",-1.14,-.12,-2.01,-.33,-2.85,-.66],["c",-1.35,-.51,-2.34,-1.26,-2.82,-2.1],["l",-.12,-.18],["l",0,1.23],["c",0,1.23,0,1.26,-.06,1.38],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["l",-.06,-.15],["l",0,-3.54],["c",0,-3.48,0,-3.54,.06,-3.66],["c",.09,-.18,.15,-.24,.33,-.33],["z"],["m",7.71,.63],["c",-.36,-.06,-.9,-.06,-1.14,0],["c",-.3,.03,-.66,.24,-.87,.42],["c",-.6,.54,-.9,1.62,-.75,2.82],["c",.12,.93,.51,1.68,1.11,2.31],["c",.75,.72,1.83,1.2,2.85,1.26],["c",1.05,.06,1.83,-.54,2.1,-1.65],["c",.21,-.9,.12,-1.95,-.24,-2.82],["c",-.36,-.81,-1.08,-1.53,-1.95,-1.95],["c",-.3,-.15,-.78,-.3,-1.11,-.39],["z"]],w:16.83,h:8.145},"noteheads.whole":{d:[["M",6.51,-4.05],["c",.51,-.03,2.01,0,2.52,.03],["c",1.41,.18,2.64,.51,3.72,1.08],["c",1.2,.63,1.95,1.41,2.19,2.31],["c",.09,.33,.09,.9,0,1.23],["c",-.24,.9,-.99,1.68,-2.19,2.31],["c",-1.08,.57,-2.28,.9,-3.75,1.08],["c",-.66,.06,-2.31,.06,-2.97,0],["c",-1.47,-.18,-2.67,-.51,-3.75,-1.08],["c",-1.2,-.63,-1.95,-1.41,-2.19,-2.31],["c",-.09,-.33,-.09,-.9,0,-1.23],["c",.24,-.9,.99,-1.68,2.19,-2.31],["c",1.2,-.63,2.61,-.99,4.23,-1.11],["z"],["m",.57,.66],["c",-.87,-.15,-1.53,0,-2.04,.51],["c",-.15,.15,-.24,.27,-.33,.48],["c",-.24,.51,-.36,1.08,-.33,1.77],["c",.03,.69,.18,1.26,.42,1.77],["c",.6,1.17,1.74,1.98,3.18,2.22],["c",1.11,.21,1.95,-.15,2.34,-.99],["c",.24,-.51,.36,-1.08,.33,-1.8],["c",-.06,-1.11,-.45,-2.04,-1.17,-2.76],["c",-.63,-.63,-1.47,-1.05,-2.4,-1.2],["z"]],w:14.985,h:8.097},"noteheads.half":{d:[["M",7.44,-4.05],["c",.06,-.03,.27,-.03,.48,-.03],["c",1.05,0,1.71,.24,2.1,.81],["c",.42,.6,.45,1.35,.18,2.4],["c",-.42,1.59,-1.14,2.73,-2.16,3.39],["c",-1.41,.93,-3.18,1.44,-5.4,1.53],["c",-1.17,.03,-1.89,-.21,-2.28,-.81],["c",-.42,-.6,-.45,-1.35,-.18,-2.4],["c",.42,-1.59,1.14,-2.73,2.16,-3.39],["c",.63,-.42,1.23,-.72,1.98,-.96],["c",.9,-.3,1.65,-.42,3.12,-.54],["z"],["m",1.29,.87],["c",-.27,-.09,-.63,-.12,-.9,-.03],["c",-.72,.24,-1.53,.69,-3.27,1.8],["c",-2.34,1.5,-3.3,2.25,-3.57,2.79],["c",-.36,.72,-.06,1.5,.66,1.77],["c",.24,.12,.69,.09,.99,0],["c",.84,-.3,1.92,-.93,4.14,-2.37],["c",1.62,-1.08,2.37,-1.71,2.61,-2.19],["c",.36,-.72,.06,-1.5,-.66,-1.77],["z"]],w:10.37,h:8.132},"noteheads.quarter":{d:[["M",6.09,-4.05],["c",.36,-.03,1.2,0,1.53,.06],["c",1.17,.24,1.89,.84,2.16,1.83],["c",.06,.18,.06,.3,.06,.66],["c",0,.45,0,.63,-.15,1.08],["c",-.66,2.04,-3.06,3.93,-5.52,4.38],["c",-.54,.09,-1.44,.09,-1.83,.03],["c",-1.23,-.27,-1.98,-.87,-2.25,-1.86],["c",-.06,-.18,-.06,-.3,-.06,-.66],["c",0,-.45,0,-.63,.15,-1.08],["c",.24,-.78,.75,-1.53,1.44,-2.22],["c",1.2,-1.2,2.85,-2.01,4.47,-2.22],["z"]],w:9.81,h:8.094},"noteheads.slash.nostem":{d:[["M",9.3,-7.77],["c",.06,-.06,.18,-.06,1.71,-.06],["l",1.65,0],["l",.09,.09],["c",.06,.06,.06,.09,.06,.15],["c",-.03,.12,-9.21,15.24,-9.3,15.33],["c",-.06,.06,-.18,.06,-1.71,.06],["l",-1.65,0],["l",-.09,-.09],["c",-.06,-.06,-.06,-.09,-.06,-.15],["c",.03,-.12,9.21,-15.24,9.3,-15.33],["z"]],w:12.81,h:15.63},"noteheads.indeterminate":{d:[["M",.78,-4.05],["c",.12,-.03,.24,-.03,.36,.03],["c",.03,.03,.93,.72,1.95,1.56],["l",1.86,1.5],["l",1.86,-1.5],["c",1.02,-.84,1.92,-1.53,1.95,-1.56],["c",.21,-.12,.33,-.09,.75,.24],["c",.3,.27,.36,.36,.36,.54],["c",0,.03,-.03,.12,-.06,.18],["c",-.03,.06,-.9,.75,-1.89,1.56],["l",-1.8,1.47],["c",0,.03,.81,.69,1.8,1.5],["c",.99,.81,1.86,1.5,1.89,1.56],["c",.03,.06,.06,.15,.06,.18],["c",0,.18,-.06,.27,-.36,.54],["c",-.42,.33,-.54,.36,-.75,.24],["c",-.03,-.03,-.93,-.72,-1.95,-1.56],["l",-1.86,-1.5],["l",-1.86,1.5],["c",-1.02,.84,-1.92,1.53,-1.95,1.56],["c",-.21,.12,-.33,.09,-.75,-.24],["c",-.3,-.27,-.36,-.36,-.36,-.54],["c",0,-.03,.03,-.12,.06,-.18],["c",.03,-.06,.9,-.75,1.89,-1.56],["l",1.8,-1.47],["c",0,-.03,-.81,-.69,-1.8,-1.5],["c",-.99,-.81,-1.86,-1.5,-1.89,-1.56],["c",-.06,-.12,-.09,-.21,-.03,-.36],["c",.03,-.09,.57,-.57,.72,-.63],["z"]],w:9.843,h:8.139},"scripts.ufermata":{d:[["M",-.75,-10.77],["c",.12,0,.45,-.03,.69,-.03],["c",2.91,-.03,5.55,1.53,7.41,4.35],["c",1.17,1.71,1.95,3.72,2.43,6.03],["c",.12,.51,.12,.57,.03,.69],["c",-.12,.21,-.48,.27,-.69,.12],["c",-.12,-.09,-.18,-.24,-.27,-.69],["c",-.78,-3.63,-3.42,-6.54,-6.78,-7.38],["c",-.78,-.21,-1.2,-.24,-2.07,-.24],["c",-.63,0,-.84,0,-1.2,.06],["c",-1.83,.27,-3.42,1.08,-4.8,2.37],["c",-1.41,1.35,-2.4,3.21,-2.85,5.19],["c",-.09,.45,-.15,.6,-.27,.69],["c",-.21,.15,-.57,.09,-.69,-.12],["c",-.09,-.12,-.09,-.18,.03,-.69],["c",.33,-1.62,.78,-3,1.47,-4.38],["c",1.77,-3.54,4.44,-5.67,7.56,-5.97],["z"],["m",.33,7.47],["c",1.38,-.3,2.58,.9,2.31,2.25],["c",-.15,.72,-.78,1.35,-1.47,1.5],["c",-1.38,.27,-2.58,-.93,-2.31,-2.31],["c",.15,-.69,.78,-1.29,1.47,-1.44],["z"]],w:19.748,h:11.289},"scripts.dfermata":{d:[["M",-9.63,-.42],["c",.15,-.09,.36,-.06,.51,.03],["c",.12,.09,.18,.24,.27,.66],["c",.78,3.66,3.42,6.57,6.78,7.41],["c",.78,.21,1.2,.24,2.07,.24],["c",.63,0,.84,0,1.2,-.06],["c",1.83,-.27,3.42,-1.08,4.8,-2.37],["c",1.41,-1.35,2.4,-3.21,2.85,-5.22],["c",.09,-.42,.15,-.57,.27,-.66],["c",.21,-.15,.57,-.09,.69,.12],["c",.09,.12,.09,.18,-.03,.69],["c",-.33,1.62,-.78,3,-1.47,4.38],["c",-1.92,3.84,-4.89,6,-8.31,6],["c",-3.42,0,-6.39,-2.16,-8.31,-6],["c",-.48,-.96,-.84,-1.92,-1.14,-2.97],["c",-.18,-.69,-.42,-1.74,-.42,-1.92],["c",0,-.12,.09,-.27,.24,-.33],["z"],["m",9.21,0],["c",1.2,-.27,2.34,.63,2.34,1.86],["c",0,.9,-.66,1.68,-1.5,1.89],["c",-1.38,.27,-2.58,-.93,-2.31,-2.31],["c",.15,-.69,.78,-1.29,1.47,-1.44],["z"]],w:19.744,h:11.274},"scripts.sforzato":{d:[["M",-6.45,-3.69],["c",.06,-.03,.15,-.06,.18,-.06],["c",.06,0,2.85,.72,6.24,1.59],["l",6.33,1.65],["c",.33,.06,.45,.21,.45,.51],["c",0,.3,-.12,.45,-.45,.51],["l",-6.33,1.65],["c",-3.39,.87,-6.18,1.59,-6.21,1.59],["c",-.21,0,-.48,-.24,-.51,-.45],["c",0,-.15,.06,-.36,.18,-.45],["c",.09,-.06,.87,-.27,3.84,-1.05],["c",2.04,-.54,3.84,-.99,4.02,-1.02],["c",.15,-.06,1.14,-.24,2.22,-.42],["c",1.05,-.18,1.92,-.36,1.92,-.36],["c",0,0,-.87,-.18,-1.92,-.36],["c",-1.08,-.18,-2.07,-.36,-2.22,-.42],["c",-.18,-.03,-1.98,-.48,-4.02,-1.02],["c",-2.97,-.78,-3.75,-.99,-3.84,-1.05],["c",-.12,-.09,-.18,-.3,-.18,-.45],["c",.03,-.15,.15,-.3,.3,-.39],["z"]],w:13.5,h:7.5},"scripts.staccato":{d:[["M",-.36,-1.47],["c",.93,-.21,1.86,.51,1.86,1.47],["c",0,.93,-.87,1.65,-1.8,1.47],["c",-.54,-.12,-1.02,-.57,-1.14,-1.08],["c",-.21,-.81,.27,-1.65,1.08,-1.86],["z"]],w:2.989,h:3.004},"scripts.tenuto":{d:[["M",-4.2,-.48],["l",.12,-.06],["l",4.08,0],["l",4.08,0],["l",.12,.06],["c",.39,.21,.39,.75,0,.96],["l",-.12,.06],["l",-4.08,0],["l",-4.08,0],["l",-.12,-.06],["c",-.39,-.21,-.39,-.75,0,-.96],["z"]],w:8.985,h:1.08},"scripts.umarcato":{d:[["M",-.15,-8.19],["c",.15,-.12,.36,-.03,.45,.15],["c",.21,.42,3.45,7.65,3.45,7.71],["c",0,.12,-.12,.27,-.21,.3],["c",-.03,.03,-.51,.03,-1.14,.03],["c",-1.05,0,-1.08,0,-1.17,-.06],["c",-.09,-.06,-.24,-.36,-1.17,-2.4],["c",-.57,-1.29,-1.05,-2.34,-1.08,-2.34],["c",0,-.03,-.51,1.02,-1.08,2.34],["c",-.93,2.07,-1.08,2.34,-1.14,2.4],["c",-.06,.03,-.15,.06,-.18,.06],["c",-.15,0,-.33,-.18,-.33,-.33],["c",0,-.06,3.24,-7.32,3.45,-7.71],["c",.03,-.06,.09,-.15,.15,-.15],["z"]],w:7.5,h:8.245},"scripts.dmarcato":{d:[["M",-3.57,.03],["c",.03,0,.57,-.03,1.17,-.03],["c",1.05,0,1.08,0,1.17,.06],["c",.09,.06,.24,.36,1.17,2.4],["c",.57,1.29,1.05,2.34,1.08,2.34],["c",0,.03,.51,-1.02,1.08,-2.34],["c",.93,-2.07,1.08,-2.34,1.14,-2.4],["c",.06,-.03,.15,-.06,.18,-.06],["c",.15,0,.33,.18,.33,.33],["c",0,.09,-3.45,7.74,-3.54,7.83],["c",-.12,.12,-.3,.12,-.42,0],["c",-.09,-.09,-3.54,-7.74,-3.54,-7.83],["c",0,-.09,.12,-.27,.18,-.3],["z"]],w:7.5,h:8.25},"scripts.stopped":{d:[["M",-.27,-4.08],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,1.5],["l",0,1.47],["l",1.47,0],["l",1.5,0],["l",.15,.06],["c",.15,.09,.21,.15,.3,.33],["c",.09,.18,.09,.36,0,.54],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.12,.06,-.18,.06,-1.62,.06],["l",-1.47,0],["l",0,1.47],["l",0,1.47],["l",-.06,.15],["c",-.09,.18,-.15,.24,-.33,.33],["c",-.18,.09,-.36,.09,-.54,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["l",-.06,-.15],["l",0,-1.47],["l",0,-1.47],["l",-1.47,0],["c",-1.44,0,-1.5,0,-1.62,-.06],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.09,-.36,0,-.54],["c",.09,-.18,.15,-.24,.33,-.33],["l",.15,-.06],["l",1.47,0],["l",1.47,0],["l",0,-1.47],["c",0,-1.44,0,-1.5,.06,-1.62],["c",.09,-.18,.15,-.24,.33,-.33],["z"]],w:8.295,h:8.295},"scripts.upbow":{d:[["M",-4.65,-15.54],["c",.12,-.09,.36,-.06,.48,.03],["c",.03,.03,.09,.09,.12,.15],["c",.03,.06,.66,2.13,1.41,4.62],["c",1.35,4.41,1.38,4.56,2.01,6.96],["l",.63,2.46],["l",.63,-2.46],["c",.63,-2.4,.66,-2.55,2.01,-6.96],["c",.75,-2.49,1.38,-4.56,1.41,-4.62],["c",.06,-.15,.18,-.21,.36,-.24],["c",.15,0,.3,.06,.39,.18],["c",.15,.21,.24,-.18,-2.1,7.56],["c",-1.2,3.96,-2.22,7.32,-2.25,7.41],["c",0,.12,-.06,.27,-.09,.3],["c",-.12,.21,-.6,.21,-.72,0],["c",-.03,-.03,-.09,-.18,-.09,-.3],["c",-.03,-.09,-1.05,-3.45,-2.25,-7.41],["c",-2.34,-7.74,-2.25,-7.35,-2.1,-7.56],["c",.03,-.03,.09,-.09,.15,-.12],["z"]],w:9.73,h:15.608},"scripts.downbow":{d:[["M",-5.55,-9.93],["l",.09,-.06],["l",5.46,0],["l",5.46,0],["l",.09,.06],["l",.06,.09],["l",0,4.77],["c",0,5.28,0,4.89,-.18,5.01],["c",-.18,.12,-.42,.06,-.54,-.12],["c",-.06,-.09,-.06,-.18,-.06,-2.97],["l",0,-2.85],["l",-4.83,0],["l",-4.83,0],["l",0,2.85],["c",0,2.79,0,2.88,-.06,2.97],["c",-.15,.24,-.51,.24,-.66,0],["c",-.06,-.09,-.06,-.21,-.06,-4.89],["l",0,-4.77],["z"]],w:11.22,h:9.992},"scripts.turn":{d:[["M",-4.77,-3.9],["c",.36,-.06,1.05,-.06,1.44,.03],["c",.78,.15,1.5,.51,2.34,1.14],["c",.6,.45,1.05,.87,2.22,2.01],["c",1.11,1.08,1.62,1.5,2.22,1.86],["c",.6,.36,1.32,.57,1.92,.57],["c",.9,0,1.71,-.57,1.89,-1.35],["c",.24,-.93,-.39,-1.89,-1.35,-2.1],["l",-.15,-.06],["l",-.09,.15],["c",-.03,.09,-.15,.24,-.24,.33],["c",-.72,.72,-2.04,.54,-2.49,-.36],["c",-.48,-.93,.03,-1.86,1.17,-2.19],["c",.3,-.09,1.02,-.09,1.35,0],["c",.99,.27,1.74,.87,2.25,1.83],["c",.69,1.41,.63,3,-.21,4.26],["c",-.21,.3,-.69,.81,-.99,1.02],["c",-.3,.21,-.84,.45,-1.17,.54],["c",-1.23,.36,-2.49,.15,-3.72,-.6],["c",-.75,-.48,-1.41,-1.02,-2.85,-2.46],["c",-1.11,-1.08,-1.62,-1.5,-2.22,-1.86],["c",-.6,-.36,-1.32,-.57,-1.92,-.57],["c",-.9,0,-1.71,.57,-1.89,1.35],["c",-.24,.93,.39,1.89,1.35,2.1],["l",.15,.06],["l",.09,-.15],["c",.03,-.09,.15,-.24,.24,-.33],["c",.72,-.72,2.04,-.54,2.49,.36],["c",.48,.93,-.03,1.86,-1.17,2.19],["c",-.3,.09,-1.02,.09,-1.35,0],["c",-.99,-.27,-1.74,-.87,-2.25,-1.83],["c",-.69,-1.41,-.63,-3,.21,-4.26],["c",.21,-.3,.69,-.81,.99,-1.02],["c",.48,-.33,1.11,-.57,1.74,-.66],["z"]],w:16.366,h:7.893},"scripts.trill":{d:[["M",-.51,-16.02],["c",.12,-.09,.21,-.18,.21,-.18],["l",-.81,4.02],["l",-.81,4.02],["c",.03,0,.51,-.27,1.08,-.6],["c",.6,-.3,1.14,-.63,1.26,-.66],["c",1.14,-.54,2.31,-.6,3.09,-.18],["c",.27,.15,.54,.36,.6,.51],["l",.06,.12],["l",.21,-.21],["c",.9,-.81,2.22,-.99,3.12,-.42],["c",.6,.42,.9,1.14,.78,2.07],["c",-.15,1.29,-1.05,2.31,-1.95,2.25],["c",-.48,-.03,-.78,-.3,-.96,-.81],["c",-.09,-.27,-.09,-.9,-.03,-1.2],["c",.21,-.75,.81,-1.23,1.59,-1.32],["l",.24,-.03],["l",-.09,-.12],["c",-.51,-.66,-1.62,-.63,-2.31,.03],["c",-.39,.42,-.3,.09,-1.23,4.77],["l",-.81,4.14],["c",-.03,0,-.12,-.03,-.21,-.09],["c",-.33,-.15,-.54,-.18,-.99,-.18],["c",-.42,0,-.66,.03,-1.05,.18],["c",-.12,.06,-.21,.09,-.21,.09],["c",0,-.03,.36,-1.86,.81,-4.11],["c",.9,-4.47,.87,-4.26,.69,-4.53],["c",-.21,-.36,-.66,-.51,-1.17,-.36],["c",-.15,.06,-2.22,1.14,-2.58,1.38],["c",-.12,.09,-.12,.09,-.21,.6],["l",-.09,.51],["l",.21,.24],["c",.63,.75,1.02,1.47,1.2,2.19],["c",.06,.27,.06,.36,.06,.81],["c",0,.42,0,.54,-.06,.78],["c",-.15,.54,-.33,.93,-.63,1.35],["c",-.18,.24,-.57,.63,-.81,.78],["c",-.24,.15,-.63,.36,-.84,.42],["c",-.27,.06,-.66,.06,-.87,.03],["c",-.81,-.18,-1.32,-1.05,-1.38,-2.46],["c",-.03,-.6,.03,-.99,.33,-2.46],["c",.21,-1.08,.24,-1.32,.21,-1.29],["c",-1.2,.48,-2.4,.75,-3.21,.72],["c",-.69,-.06,-1.17,-.3,-1.41,-.72],["c",-.39,-.75,-.12,-1.8,.66,-2.46],["c",.24,-.18,.69,-.42,1.02,-.51],["c",.69,-.18,1.53,-.15,2.31,.09],["c",.3,.09,.75,.3,.99,.45],["c",.12,.09,.15,.09,.15,.03],["c",.03,-.03,.33,-1.59,.72,-3.45],["c",.36,-1.86,.66,-3.42,.69,-3.45],["c",0,-.03,.03,-.03,.21,.03],["c",.21,.06,.27,.06,.48,.06],["c",.42,-.03,.78,-.18,1.26,-.48],["c",.15,-.12,.36,-.27,.48,-.39],["z"],["m",-5.73,7.68],["c",-.27,-.03,-.96,-.06,-1.2,-.03],["c",-.81,.12,-1.35,.57,-1.5,1.2],["c",-.18,.66,.12,1.14,.75,1.29],["c",.66,.12,1.92,-.12,3.18,-.66],["l",.33,-.15],["l",.09,-.39],["c",.06,-.21,.09,-.42,.09,-.45],["c",0,-.03,-.45,-.3,-.75,-.45],["c",-.27,-.15,-.66,-.27,-.99,-.36],["z"],["m",4.29,3.63],["c",-.24,-.39,-.51,-.75,-.51,-.69],["c",-.06,.12,-.39,1.92,-.45,2.28],["c",-.09,.54,-.12,1.14,-.06,1.38],["c",.06,.42,.21,.6,.51,.57],["c",.39,-.06,.75,-.48,.93,-1.14],["c",.09,-.33,.09,-1.05,0,-1.38],["c",-.09,-.39,-.24,-.69,-.42,-1.02],["z"]],w:17.963,h:16.49},"scripts.segno":{d:[["M",-3.72,-11.22],["c",.78,-.09,1.59,.03,2.31,.42],["c",1.2,.6,2.01,1.71,2.31,3.09],["c",.09,.42,.09,1.2,.03,1.5],["c",-.15,.45,-.39,.81,-.66,.93],["c",-.33,.18,-.84,.21,-1.23,.15],["c",-.81,-.18,-1.32,-.93,-1.26,-1.89],["c",.03,-.36,.09,-.57,.24,-.9],["c",.15,-.33,.45,-.6,.72,-.75],["c",.12,-.06,.18,-.09,.18,-.12],["c",0,-.03,-.03,-.15,-.09,-.24],["c",-.18,-.45,-.54,-.87,-.96,-1.08],["c",-1.11,-.57,-2.34,-.18,-2.88,.9],["c",-.24,.51,-.33,1.11,-.24,1.83],["c",.27,1.92,1.5,3.54,3.93,5.13],["c",.48,.33,1.26,.78,1.29,.78],["c",.03,0,1.35,-2.19,2.94,-4.89],["l",2.88,-4.89],["l",.84,0],["l",.87,0],["l",-.03,.06],["c",-.15,.21,-6.15,10.41,-6.15,10.44],["c",0,0,.21,.15,.48,.27],["c",2.61,1.47,4.35,3.03,5.13,4.65],["c",1.14,2.34,.51,5.07,-1.44,6.39],["c",-.66,.42,-1.32,.63,-2.13,.69],["c",-2.01,.09,-3.81,-1.41,-4.26,-3.54],["c",-.09,-.42,-.09,-1.2,-.03,-1.5],["c",.15,-.45,.39,-.81,.66,-.93],["c",.33,-.18,.84,-.21,1.23,-.15],["c",.81,.18,1.32,.93,1.26,1.89],["c",-.03,.36,-.09,.57,-.24,.9],["c",-.15,.33,-.45,.6,-.72,.75],["c",-.12,.06,-.18,.09,-.18,.12],["c",0,.03,.03,.15,.09,.24],["c",.18,.45,.54,.87,.96,1.08],["c",1.11,.57,2.34,.18,2.88,-.9],["c",.24,-.51,.33,-1.11,.24,-1.83],["c",-.27,-1.92,-1.5,-3.54,-3.93,-5.13],["c",-.48,-.33,-1.26,-.78,-1.29,-.78],["c",-.03,0,-1.35,2.19,-2.91,4.89],["l",-2.88,4.89],["l",-.87,0],["l",-.87,0],["l",.03,-.06],["c",.15,-.21,6.15,-10.41,6.15,-10.44],["c",0,0,-.21,-.15,-.48,-.3],["c",-2.61,-1.44,-4.35,-3,-5.13,-4.62],["c",-.9,-1.89,-.72,-4.02,.48,-5.52],["c",.69,-.84,1.68,-1.41,2.73,-1.53],["z"],["m",8.76,9.09],["c",.03,-.03,.15,-.03,.27,-.03],["c",.33,.03,.57,.18,.72,.48],["c",.09,.18,.09,.57,0,.75],["c",-.09,.18,-.21,.3,-.36,.39],["c",-.15,.06,-.21,.06,-.39,.06],["c",-.21,0,-.27,0,-.39,-.06],["c",-.3,-.15,-.48,-.45,-.48,-.75],["c",0,-.39,.24,-.72,.63,-.84],["z"],["m",-10.53,2.61],["c",.03,-.03,.15,-.03,.27,-.03],["c",.33,.03,.57,.18,.72,.48],["c",.09,.18,.09,.57,0,.75],["c",-.09,.18,-.21,.3,-.36,.39],["c",-.15,.06,-.21,.06,-.39,.06],["c",-.21,0,-.27,0,-.39,-.06],["c",-.3,-.15,-.48,-.45,-.48,-.75],["c",0,-.39,.24,-.72,.63,-.84],["z"]],w:15,h:22.504},"scripts.coda":{d:[["M",-.21,-10.47],["c",.18,-.12,.42,-.06,.54,.12],["c",.06,.09,.06,.18,.06,1.5],["l",0,1.38],["l",.18,0],["c",.39,.06,.96,.24,1.38,.48],["c",1.68,.93,2.82,3.24,3.03,6.12],["c",.03,.24,.03,.45,.03,.45],["c",0,.03,.6,.03,1.35,.03],["c",1.5,0,1.47,0,1.59,.18],["c",.09,.12,.09,.3,0,.42],["c",-.12,.18,-.09,.18,-1.59,.18],["c",-.75,0,-1.35,0,-1.35,.03],["c",0,0,0,.21,-.03,.42],["c",-.24,3.15,-1.53,5.58,-3.45,6.36],["c",-.27,.12,-.72,.24,-.96,.27],["l",-.18,0],["l",0,1.38],["c",0,1.32,0,1.41,-.06,1.5],["c",-.15,.24,-.51,.24,-.66,0],["c",-.06,-.09,-.06,-.18,-.06,-1.5],["l",0,-1.38],["l",-.18,0],["c",-.39,-.06,-.96,-.24,-1.38,-.48],["c",-1.68,-.93,-2.82,-3.24,-3.03,-6.15],["c",-.03,-.21,-.03,-.42,-.03,-.42],["c",0,-.03,-.6,-.03,-1.35,-.03],["c",-1.5,0,-1.47,0,-1.59,-.18],["c",-.09,-.12,-.09,-.3,0,-.42],["c",.12,-.18,.09,-.18,1.59,-.18],["c",.75,0,1.35,0,1.35,-.03],["c",0,0,0,-.21,.03,-.45],["c",.24,-3.12,1.53,-5.55,3.45,-6.33],["c",.27,-.12,.72,-.24,.96,-.27],["l",.18,0],["l",0,-1.38],["c",0,-1.53,0,-1.5,.18,-1.62],["z"],["m",-.18,6.93],["c",0,-2.97,0,-3.15,-.06,-3.15],["c",-.09,0,-.51,.15,-.66,.21],["c",-.87,.51,-1.38,1.62,-1.56,3.51],["c",-.06,.54,-.12,1.59,-.12,2.16],["l",0,.42],["l",1.2,0],["l",1.2,0],["l",0,-3.15],["z"],["m",1.17,-3.06],["c",-.09,-.03,-.21,-.06,-.27,-.09],["l",-.12,0],["l",0,3.15],["l",0,3.15],["l",1.2,0],["l",1.2,0],["l",0,-.81],["c",-.06,-2.4,-.33,-3.69,-.93,-4.59],["c",-.27,-.39,-.66,-.69,-1.08,-.81],["z"],["m",-1.17,10.14],["l",0,-3.15],["l",-1.2,0],["l",-1.2,0],["l",0,.81],["c",.03,.96,.06,1.47,.15,2.13],["c",.24,2.04,.96,3.12,2.13,3.36],["l",.12,0],["l",0,-3.15],["z"],["m",3.18,-2.34],["l",0,-.81],["l",-1.2,0],["l",-1.2,0],["l",0,3.15],["l",0,3.15],["l",.12,0],["c",1.17,-.24,1.89,-1.32,2.13,-3.36],["c",.09,-.66,.12,-1.17,.15,-2.13],["z"]],w:16.035,h:21.062},"scripts.comma":{d:[["M",1.14,-4.62],["c",.3,-.12,.69,-.03,.93,.15],["c",.12,.12,.36,.45,.51,.78],["c",.9,1.77,.54,4.05,-1.08,6.75],["c",-.36,.63,-.87,1.38,-.96,1.44],["c",-.18,.12,-.42,.06,-.54,-.12],["c",-.09,-.18,-.09,-.3,.12,-.6],["c",.96,-1.44,1.44,-2.97,1.38,-4.35],["c",-.06,-.93,-.3,-1.68,-.78,-2.46],["c",-.27,-.39,-.33,-.63,-.24,-.96],["c",.09,-.27,.36,-.54,.66,-.63],["z"]],w:3.042,h:9.237},"scripts.roll":{d:[["M",1.95,-6],["c",.21,-.09,.36,-.09,.57,0],["c",.39,.15,.63,.39,1.47,1.35],["c",.66,.75,.78,.87,1.08,1.05],["c",.75,.45,1.65,.42,2.4,-.06],["c",.12,-.09,.27,-.27,.54,-.6],["c",.42,-.54,.51,-.63,.69,-.63],["c",.09,0,.3,.12,.36,.21],["c",.09,.12,.12,.3,.03,.42],["c",-.06,.12,-3.15,3.9,-3.3,4.08],["c",-.06,.06,-.18,.12,-.27,.18],["c",-.27,.12,-.6,.06,-.99,-.27],["c",-.27,-.21,-.42,-.39,-1.08,-1.14],["c",-.63,-.72,-.81,-.9,-1.17,-1.08],["c",-.36,-.18,-.57,-.21,-.99,-.21],["c",-.39,0,-.63,.03,-.93,.18],["c",-.36,.15,-.51,.27,-.9,.81],["c",-.24,.27,-.45,.51,-.48,.54],["c",-.12,.09,-.27,.06,-.39,0],["c",-.24,-.15,-.33,-.39,-.21,-.6],["c",.09,-.12,3.18,-3.87,3.33,-4.02],["c",.06,-.06,.18,-.15,.24,-.21],["z"]],w:10.817,h:6.125},"scripts.prall":{d:[["M",-4.38,-3.69],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["c",.03,0,.57,-.84,1.23,-1.83],["c",1.14,-1.68,1.23,-1.83,1.35,-1.89],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["l",.48,-.69],["c",.51,-.78,.54,-.84,.69,-.9],["c",.42,-.18,.87,.15,.81,.6],["c",-.03,.12,-.3,.51,-1.5,2.37],["c",-1.38,2.07,-1.5,2.22,-1.62,2.28],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["c",-.03,0,-.57,.84,-1.23,1.83],["c",-1.14,1.68,-1.23,1.83,-1.35,1.89],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["l",-.48,.69],["c",-.51,.78,-.54,.84,-.69,.9],["c",-.42,.18,-.87,-.15,-.81,-.6],["c",.03,-.12,.3,-.51,1.5,-2.37],["c",1.38,-2.07,1.5,-2.22,1.62,-2.28],["z"]],w:15.011,h:7.5},"scripts.arpeggio":{d:[["M",1.5,0],["c",1.5,2,1.5,3,1.5,3],["s",0,1,-2,1.5],["s",-.5,3,1,5.5],["l",1.5,0],["s",-1.75,-2,-1.9,-3.25],["s",2.15,-.6,2.95,-1.6],["s",.45,-1,.5,-1.25],["s",0,-1,-2,-3.9],["l",-1.5,0],["z"]],w:5,h:10},"scripts.mordent":{d:[["M",-.21,-4.95],["c",.27,-.15,.63,0,.75,.27],["c",.06,.12,.06,.24,.06,1.44],["l",0,1.29],["l",.57,-.84],["c",.51,-.75,.57,-.84,.69,-.9],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["l",.48,-.69],["c",.51,-.78,.54,-.84,.69,-.9],["c",.42,-.18,.87,.15,.81,.6],["c",-.03,.12,-.3,.51,-1.5,2.37],["c",-1.38,2.07,-1.5,2.22,-1.62,2.28],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.83,-1.89],["c",-.81,-.99,-1.5,-1.8,-1.53,-1.86],["c",-.06,-.03,-.06,-.03,-.12,.03],["c",-.06,.06,-.06,.15,-.06,2.28],["c",0,1.95,0,2.25,-.06,2.34],["c",-.18,.45,-.81,.48,-1.05,.03],["c",-.03,-.06,-.06,-.24,-.06,-1.41],["l",0,-1.35],["l",-.57,.84],["c",-.54,.78,-.6,.87,-.72,.93],["c",-.06,.03,-.18,.06,-.24,.06],["c",-.3,0,-.27,.03,-1.89,-1.95],["l",-1.53,-1.83],["l",-.48,.69],["c",-.51,.78,-.54,.84,-.69,.9],["c",-.42,.18,-.87,-.15,-.81,-.6],["c",.03,-.12,.3,-.51,1.5,-2.37],["c",1.38,-2.07,1.5,-2.22,1.62,-2.28],["c",.06,-.03,.18,-.06,.24,-.06],["c",.3,0,.27,-.03,1.89,1.95],["l",1.53,1.83],["c",.03,0,.06,-.06,.09,-.09],["c",.06,-.12,.06,-.15,.06,-2.28],["c",0,-1.92,0,-2.22,.06,-2.31],["c",.06,-.15,.15,-.24,.3,-.3],["z"]],w:15.011,h:10.012},"flags.u8th":{d:[["M",-.42,3.75],["l",0,-3.75],["l",.21,0],["l",.21,0],["l",0,.18],["c",0,.3,.06,.84,.12,1.23],["c",.24,1.53,.9,3.12,2.13,5.16],["l",.99,1.59],["c",.87,1.44,1.38,2.34,1.77,3.09],["c",.81,1.68,1.2,3.06,1.26,4.53],["c",.03,1.53,-.21,3.27,-.75,5.01],["c",-.21,.69,-.51,1.5,-.6,1.59],["c",-.09,.12,-.27,.21,-.42,.21],["c",-.15,0,-.42,-.12,-.51,-.21],["c",-.15,-.18,-.18,-.42,-.09,-.66],["c",.15,-.33,.45,-1.2,.57,-1.62],["c",.42,-1.38,.6,-2.58,.6,-3.9],["c",0,-.66,0,-.81,-.06,-1.11],["c",-.39,-2.07,-1.8,-4.26,-4.59,-7.14],["l",-.42,-.45],["l",-.21,0],["l",-.21,0],["l",0,-3.75],["z"]],w:6.692,h:22.59},"flags.u16th":{d:[["M",-.42,7.5],["l",0,-7.5],["l",.21,0],["l",.21,0],["l",0,.39],["c",.06,1.08,.39,2.19,.99,3.39],["c",.45,.9,.87,1.59,1.95,3.12],["c",1.29,1.86,1.77,2.64,2.22,3.57],["c",.45,.93,.72,1.8,.87,2.64],["c",.06,.51,.06,1.5,0,1.92],["c",-.12,.6,-.3,1.2,-.54,1.71],["l",-.09,.24],["l",.18,.45],["c",.51,1.2,.72,2.22,.69,3.42],["c",-.06,1.53,-.39,3.03,-.99,4.53],["c",-.3,.75,-.36,.81,-.57,.9],["c",-.15,.09,-.33,.06,-.48,0],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.12,-.75],["c",.66,-1.41,1.02,-2.88,1.08,-4.32],["c",0,-.6,-.03,-1.05,-.18,-1.59],["c",-.3,-1.2,-.99,-2.4,-2.25,-3.87],["c",-.42,-.48,-1.53,-1.62,-2.19,-2.22],["l",-.45,-.42],["l",-.03,1.11],["l",0,1.11],["l",-.21,0],["l",-.21,0],["l",0,-7.5],["z"],["m",1.65,.09],["c",-.3,-.3,-.69,-.72,-.9,-.87],["l",-.33,-.33],["l",0,.15],["c",0,.3,.06,.81,.15,1.26],["c",.27,1.29,.87,2.61,2.04,4.29],["c",.15,.24,.6,.87,.96,1.38],["l",1.08,1.53],["l",.42,.63],["c",.03,0,.12,-.36,.21,-.72],["c",.06,-.33,.06,-1.2,0,-1.62],["c",-.33,-1.71,-1.44,-3.48,-3.63,-5.7],["z"]],w:6.693,h:26.337},"flags.u32nd":{d:[["M",-.42,11.25],["l",0,-11.25],["l",.21,0],["l",.21,0],["l",0,.36],["c",.09,1.68,.69,3.27,2.07,5.46],["l",.87,1.35],["c",1.02,1.62,1.47,2.37,1.86,3.18],["c",.48,1.02,.78,1.92,.93,2.88],["c",.06,.48,.06,1.5,0,1.89],["c",-.09,.42,-.21,.87,-.36,1.26],["l",-.12,.3],["l",.15,.39],["c",.69,1.56,.84,2.88,.54,4.38],["c",-.09,.45,-.27,1.08,-.45,1.47],["l",-.12,.24],["l",.18,.36],["c",.33,.72,.57,1.56,.69,2.34],["c",.12,1.02,-.06,2.52,-.42,3.84],["c",-.27,.93,-.75,2.13,-.93,2.31],["c",-.18,.15,-.45,.18,-.66,.09],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.06,-.6],["c",.21,-.36,.42,-.9,.57,-1.38],["c",.51,-1.41,.69,-3.06,.48,-4.08],["c",-.15,-.81,-.57,-1.68,-1.2,-2.55],["c",-.72,-.99,-1.83,-2.13,-3.3,-3.33],["l",-.48,-.42],["l",-.03,1.53],["l",0,1.56],["l",-.21,0],["l",-.21,0],["l",0,-11.25],["z"],["m",1.26,-3.96],["c",-.27,-.3,-.54,-.6,-.66,-.72],["l",-.18,-.21],["l",0,.42],["c",.06,.87,.24,1.74,.66,2.67],["c",.36,.87,.96,1.86,1.92,3.18],["c",.21,.33,.63,.87,.87,1.23],["c",.27,.39,.6,.84,.75,1.08],["l",.27,.39],["l",.03,-.12],["c",.12,-.45,.15,-1.05,.09,-1.59],["c",-.27,-1.86,-1.38,-3.78,-3.75,-6.33],["z"],["m",-.27,6.09],["c",-.27,-.21,-.48,-.42,-.51,-.45],["c",-.06,-.03,-.06,-.03,-.06,.21],["c",0,.9,.3,2.04,.81,3.09],["c",.48,1.02,.96,1.77,2.37,3.63],["c",.6,.78,1.05,1.44,1.29,1.77],["c",.06,.12,.15,.21,.15,.18],["c",.03,-.03,.18,-.57,.24,-.87],["c",.06,-.45,.06,-1.32,-.03,-1.74],["c",-.09,-.48,-.24,-.9,-.51,-1.44],["c",-.66,-1.35,-1.83,-2.7,-3.75,-4.38],["z"]],w:6.697,h:32.145},"flags.u64th":{d:[["M",-.42,15],["l",0,-15],["l",.21,0],["l",.21,0],["l",0,.36],["c",.06,1.2,.39,2.37,1.02,3.66],["c",.39,.81,.84,1.56,1.8,3.09],["c",.81,1.26,1.05,1.68,1.35,2.22],["c",.87,1.5,1.35,2.79,1.56,4.08],["c",.06,.54,.06,1.56,-.03,2.04],["c",-.09,.48,-.21,.99,-.36,1.35],["l",-.12,.27],["l",.12,.27],["c",.09,.15,.21,.45,.27,.66],["c",.69,1.89,.63,3.66,-.18,5.46],["l",-.18,.39],["l",.15,.33],["c",.3,.66,.51,1.44,.63,2.1],["c",.06,.48,.06,1.35,0,1.71],["c",-.15,.57,-.42,1.2,-.78,1.68],["l",-.21,.27],["l",.18,.33],["c",.57,1.05,.93,2.13,1.02,3.18],["c",.06,.72,0,1.83,-.21,2.79],["c",-.18,1.02,-.63,2.34,-1.02,3.09],["c",-.15,.33,-.48,.45,-.78,.3],["c",-.18,-.09,-.27,-.18,-.33,-.33],["c",-.09,-.18,-.06,-.3,.03,-.54],["c",.75,-1.5,1.23,-3.45,1.17,-4.89],["c",-.06,-1.02,-.42,-2.01,-1.17,-3.15],["c",-.48,-.72,-1.02,-1.35,-1.89,-2.22],["c",-.57,-.57,-1.56,-1.5,-1.92,-1.77],["l",-.12,-.09],["l",0,1.68],["l",0,1.68],["l",-.21,0],["l",-.21,0],["l",0,-15],["z"],["m",.93,-8.07],["c",-.27,-.3,-.48,-.54,-.51,-.54],["c",0,0,0,.69,.03,1.02],["c",.15,1.47,.75,2.94,2.04,4.83],["l",1.08,1.53],["c",.39,.57,.84,1.2,.99,1.44],["c",.15,.24,.3,.45,.3,.45],["c",0,0,.03,-.09,.06,-.21],["c",.36,-1.59,-.15,-3.33,-1.47,-5.4],["c",-.63,-.93,-1.35,-1.83,-2.52,-3.12],["z"],["m",.06,6.72],["c",-.24,-.21,-.48,-.42,-.51,-.45],["l",-.06,-.06],["l",0,.33],["c",0,1.2,.3,2.34,.93,3.6],["c",.45,.9,.96,1.68,2.25,3.51],["c",.39,.54,.84,1.17,1.02,1.44],["c",.21,.33,.33,.51,.33,.48],["c",.06,-.09,.21,-.63,.3,-.99],["c",.06,-.33,.06,-.45,.06,-.96],["c",0,-.6,-.03,-.84,-.18,-1.35],["c",-.3,-1.08,-1.02,-2.28,-2.13,-3.57],["c",-.39,-.45,-1.44,-1.47,-2.01,-1.98],["z"],["m",0,6.72],["c",-.24,-.21,-.48,-.39,-.51,-.42],["l",-.06,-.06],["l",0,.33],["c",0,1.41,.45,2.82,1.38,4.35],["c",.42,.72,.72,1.14,1.86,2.73],["c",.36,.45,.75,.99,.87,1.2],["c",.15,.21,.3,.36,.3,.36],["c",.06,0,.3,-.48,.39,-.75],["c",.09,-.36,.12,-.63,.12,-1.05],["c",-.06,-1.05,-.45,-2.04,-1.2,-3.18],["c",-.57,-.87,-1.11,-1.53,-2.07,-2.49],["c",-.36,-.33,-.84,-.78,-1.08,-1.02],["z"]],w:6.682,h:39.694},"flags.d8th":{d:[["M",5.67,-21.63],["c",.24,-.12,.54,-.06,.69,.15],["c",.06,.06,.21,.36,.39,.66],["c",.84,1.77,1.26,3.36,1.32,5.1],["c",.03,1.29,-.21,2.37,-.81,3.63],["c",-.6,1.23,-1.26,2.13,-3.21,4.38],["c",-1.35,1.53,-1.86,2.19,-2.4,2.97],["c",-.63,.93,-1.11,1.92,-1.38,2.79],["c",-.15,.54,-.27,1.35,-.27,1.8],["l",0,.15],["l",-.21,0],["l",-.21,0],["l",0,-3.75],["l",0,-3.75],["l",.21,0],["l",.21,0],["l",.48,-.3],["c",1.83,-1.11,3.12,-2.1,4.17,-3.12],["c",.78,-.81,1.32,-1.53,1.71,-2.31],["c",.45,-.93,.6,-1.74,.51,-2.88],["c",-.12,-1.56,-.63,-3.18,-1.47,-4.68],["c",-.12,-.21,-.15,-.33,-.06,-.51],["c",.06,-.15,.15,-.24,.33,-.33],["z"]],w:8.492,h:21.691},"flags.ugrace":{d:[["M",6.03,6.93],["c",.15,-.09,.33,-.06,.51,0],["c",.15,.09,.21,.15,.3,.33],["c",.09,.18,.06,.39,-.03,.54],["c",-.06,.15,-10.89,8.88,-11.07,8.97],["c",-.15,.09,-.33,.06,-.48,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.06,-.39,.03,-.54],["c",.06,-.15,10.89,-8.88,11.07,-8.97],["z"]],w:12.019,h:9.954},"flags.dgrace":{d:[["M",-6.06,-15.93],["c",.18,-.09,.33,-.12,.48,-.06],["c",.18,.09,14.01,8.04,14.1,8.1],["c",.12,.12,.18,.33,.18,.51],["c",-.03,.21,-.15,.39,-.36,.48],["c",-.18,.09,-.33,.12,-.48,.06],["c",-.18,-.09,-14.01,-8.04,-14.1,-8.1],["c",-.12,-.12,-.18,-.33,-.18,-.51],["c",.03,-.21,.15,-.39,.36,-.48],["z"]],w:15.12,h:9.212},"flags.d16th":{d:[["M",6.84,-22.53],["c",.27,-.12,.57,-.06,.72,.15],["c",.15,.15,.33,.87,.45,1.56],["c",.06,.33,.06,1.35,0,1.65],["c",-.06,.33,-.15,.78,-.27,1.11],["c",-.12,.33,-.45,.96,-.66,1.32],["l",-.18,.27],["l",.09,.18],["c",.48,1.02,.72,2.25,.69,3.3],["c",-.06,1.23,-.42,2.28,-1.26,3.45],["c",-.57,.87,-.99,1.32,-3,3.39],["c",-1.56,1.56,-2.22,2.4,-2.76,3.45],["c",-.42,.84,-.66,1.8,-.66,2.55],["l",0,.15],["l",-.21,0],["l",-.21,0],["l",0,-7.5],["l",0,-7.5],["l",.21,0],["l",.21,0],["l",0,1.14],["l",0,1.11],["l",.27,-.15],["c",1.11,-.57,1.77,-.99,2.52,-1.47],["c",2.37,-1.56,3.69,-3.15,4.05,-4.83],["c",.03,-.18,.03,-.39,.03,-.78],["c",0,-.6,-.03,-.93,-.24,-1.5],["c",-.06,-.18,-.12,-.39,-.15,-.45],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.63,7.5],["c",-.06,-.18,-.15,-.36,-.15,-.36],["c",-.03,0,-.03,.03,-.06,.06],["c",-.06,.12,-.96,1.02,-1.95,1.98],["c",-.63,.57,-1.26,1.17,-1.44,1.35],["c",-1.53,1.62,-2.28,2.85,-2.55,4.32],["c",-.03,.18,-.03,.54,-.06,.99],["l",0,.69],["l",.18,-.09],["c",.93,-.54,2.1,-1.29,2.82,-1.83],["c",.69,-.51,1.02,-.81,1.53,-1.29],["c",1.86,-1.89,2.37,-3.66,1.68,-5.82],["z"]],w:8.475,h:22.591},"flags.d32nd":{d:[["M",6.84,-29.13],["c",.27,-.12,.57,-.06,.72,.15],["c",.12,.12,.27,.63,.36,1.11],["c",.33,1.59,.06,3.06,-.81,4.47],["l",-.18,.27],["l",.09,.15],["c",.12,.24,.33,.69,.45,1.05],["c",.63,1.83,.45,3.57,-.57,5.22],["l",-.18,.3],["l",.15,.27],["c",.42,.87,.6,1.71,.57,2.61],["c",-.06,1.29,-.48,2.46,-1.35,3.78],["c",-.54,.81,-.93,1.29,-2.46,3],["c",-.51,.54,-1.05,1.17,-1.26,1.41],["c",-1.56,1.86,-2.25,3.36,-2.37,5.01],["l",0,.33],["l",-.21,0],["l",-.21,0],["l",0,-11.25],["l",0,-11.25],["l",.21,0],["l",.21,0],["l",0,1.35],["l",.03,1.35],["l",.78,-.39],["c",1.38,-.69,2.34,-1.26,3.24,-1.92],["c",1.38,-1.02,2.28,-2.13,2.64,-3.21],["c",.15,-.48,.18,-.72,.18,-1.29],["c",0,-.57,-.06,-.9,-.24,-1.47],["c",-.06,-.18,-.12,-.39,-.15,-.45],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.63,7.2],["c",-.09,-.18,-.12,-.21,-.12,-.15],["c",-.03,.09,-1.02,1.08,-2.04,2.04],["c",-1.17,1.08,-1.65,1.56,-2.07,2.04],["c",-.84,.96,-1.38,1.86,-1.68,2.76],["c",-.21,.57,-.27,.99,-.3,1.65],["l",0,.54],["l",.66,-.33],["c",3.57,-1.86,5.49,-3.69,5.94,-5.7],["c",.06,-.39,.06,-1.2,-.03,-1.65],["c",-.06,-.39,-.24,-.9,-.36,-1.2],["z"],["m",-.06,7.2],["c",-.06,-.15,-.12,-.33,-.15,-.45],["l",-.06,-.18],["l",-.18,.21],["l",-1.83,1.83],["c",-.87,.9,-1.77,1.8,-1.95,2.01],["c",-1.08,1.29,-1.62,2.31,-1.89,3.51],["c",-.06,.3,-.06,.51,-.09,.93],["l",0,.57],["l",.09,-.06],["c",.75,-.45,1.89,-1.26,2.52,-1.74],["c",.81,-.66,1.74,-1.53,2.22,-2.16],["c",1.26,-1.53,1.68,-3.06,1.32,-4.47],["z"]],w:8.385,h:29.191},"flags.d64th":{d:[["M",7.08,-32.88],["c",.3,-.12,.66,-.03,.78,.24],["c",.18,.33,.27,2.1,.15,2.64],["c",-.09,.39,-.21,.78,-.39,1.08],["l",-.15,.3],["l",.09,.27],["c",.03,.12,.09,.45,.12,.69],["c",.27,1.44,.18,2.55,-.3,3.6],["l",-.12,.33],["l",.06,.42],["c",.27,1.35,.33,2.82,.21,3.63],["c",-.12,.6,-.3,1.23,-.57,1.8],["l",-.15,.27],["l",.03,.42],["c",.06,1.02,.06,2.7,.03,3.06],["c",-.15,1.47,-.66,2.76,-1.74,4.41],["c",-.45,.69,-.75,1.11,-1.74,2.37],["c",-1.05,1.38,-1.5,1.98,-1.95,2.73],["c",-.93,1.5,-1.38,2.82,-1.44,4.2],["l",0,.42],["l",-.21,0],["l",-.21,0],["l",0,-15],["l",0,-15],["l",.21,0],["l",.21,0],["l",0,1.86],["l",0,1.89],["c",0,0,.21,-.03,.45,-.09],["c",2.22,-.39,4.08,-1.11,5.19,-2.01],["c",.63,-.54,1.02,-1.14,1.2,-1.8],["c",.06,-.3,.06,-1.14,-.03,-1.65],["c",-.03,-.18,-.06,-.39,-.09,-.48],["c",-.03,-.24,.12,-.48,.36,-.6],["z"],["m",-.45,6.15],["c",-.03,-.18,-.06,-.42,-.06,-.54],["l",-.03,-.18],["l",-.33,.3],["c",-.42,.36,-.87,.72,-1.68,1.29],["c",-1.98,1.38,-2.25,1.59,-2.85,2.16],["c",-.75,.69,-1.23,1.44,-1.47,2.19],["c",-.15,.45,-.18,.63,-.21,1.35],["l",0,.66],["l",.39,-.18],["c",1.83,-.9,3.45,-1.95,4.47,-2.91],["c",.93,-.9,1.53,-1.83,1.74,-2.82],["c",.06,-.33,.06,-.87,.03,-1.32],["z"],["m",-.27,4.86],["c",-.03,-.21,-.06,-.36,-.06,-.36],["c",0,-.03,-.12,.09,-.24,.24],["c",-.39,.48,-.99,1.08,-2.16,2.19],["c",-1.47,1.38,-1.92,1.83,-2.46,2.49],["c",-.66,.87,-1.08,1.74,-1.29,2.58],["c",-.09,.42,-.15,.87,-.15,1.44],["l",0,.54],["l",.48,-.33],["c",1.5,-1.02,2.58,-1.89,3.51,-2.82],["c",1.47,-1.47,2.25,-2.85,2.4,-4.26],["c",.03,-.39,.03,-1.17,-.03,-1.71],["z"],["m",-.66,7.68],["c",.03,-.15,.03,-.6,.03,-.99],["l",0,-.72],["l",-.27,.33],["l",-1.74,1.98],["c",-1.77,1.92,-2.43,2.76,-2.97,3.9],["c",-.51,1.02,-.72,1.77,-.75,2.91],["c",0,.63,0,.63,.06,.6],["c",.03,-.03,.3,-.27,.63,-.54],["c",.66,-.6,1.86,-1.8,2.31,-2.31],["c",1.65,-1.89,2.52,-3.54,2.7,-5.16],["z"]],w:8.485,h:32.932},"clefs.C":{d:[["M",.06,-14.94],["l",.09,-.06],["l",1.92,0],["l",1.92,0],["l",.09,.06],["l",.06,.09],["l",0,14.85],["l",0,14.82],["l",-.06,.09],["l",-.09,.06],["l",-1.92,0],["l",-1.92,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-14.82],["l",0,-14.85],["z"],["m",5.37,0],["c",.09,-.06,.09,-.06,.57,-.06],["c",.45,0,.45,0,.54,.06],["l",.06,.09],["l",0,7.14],["l",0,7.11],["l",.09,-.06],["c",.18,-.18,.72,-.84,.96,-1.2],["c",.3,-.45,.66,-1.17,.84,-1.65],["c",.36,-.9,.57,-1.83,.6,-2.79],["c",.03,-.48,.03,-.54,.09,-.63],["c",.12,-.18,.36,-.21,.54,-.12],["c",.18,.09,.21,.15,.24,.66],["c",.06,.87,.21,1.56,.57,2.22],["c",.51,1.02,1.26,1.68,2.22,1.92],["c",.21,.06,.33,.06,.78,.06],["c",.45,0,.57,0,.84,-.06],["c",.45,-.12,.81,-.33,1.08,-.6],["c",.57,-.57,.87,-1.41,.99,-2.88],["c",.06,-.54,.06,-3,0,-3.57],["c",-.21,-2.58,-.84,-3.87,-2.16,-4.5],["c",-.48,-.21,-1.17,-.36,-1.77,-.36],["c",-.69,0,-1.29,.27,-1.5,.72],["c",-.06,.15,-.06,.21,-.06,.42],["c",0,.24,0,.3,.06,.45],["c",.12,.24,.24,.39,.63,.66],["c",.42,.3,.57,.48,.69,.72],["c",.06,.15,.06,.21,.06,.48],["c",0,.39,-.03,.63,-.21,.96],["c",-.3,.6,-.87,1.08,-1.5,1.26],["c",-.27,.06,-.87,.06,-1.14,0],["c",-.78,-.24,-1.44,-.87,-1.65,-1.68],["c",-.12,-.42,-.09,-1.17,.09,-1.71],["c",.51,-1.65,1.98,-2.82,3.81,-3.09],["c",.84,-.09,2.46,.03,3.51,.27],["c",2.22,.57,3.69,1.8,4.44,3.75],["c",.36,.93,.57,2.13,.57,3.36],["c",0,1.44,-.48,2.73,-1.38,3.81],["c",-1.26,1.5,-3.27,2.43,-5.28,2.43],["c",-.48,0,-.51,0,-.75,-.09],["c",-.15,-.03,-.48,-.21,-.78,-.36],["c",-.69,-.36,-.87,-.42,-1.26,-.42],["c",-.27,0,-.3,0,-.51,.09],["c",-.57,.3,-.81,.9,-.81,2.1],["c",0,1.23,.24,1.83,.81,2.13],["c",.21,.09,.24,.09,.51,.09],["c",.39,0,.57,-.06,1.26,-.42],["c",.3,-.15,.63,-.33,.78,-.36],["c",.24,-.09,.27,-.09,.75,-.09],["c",2.01,0,4.02,.93,5.28,2.4],["c",.9,1.11,1.38,2.4,1.38,3.84],["c",0,1.5,-.3,2.88,-.84,3.96],["c",-.78,1.59,-2.19,2.64,-4.17,3.15],["c",-1.05,.24,-2.67,.36,-3.51,.27],["c",-1.83,-.27,-3.3,-1.44,-3.81,-3.09],["c",-.18,-.54,-.21,-1.29,-.09,-1.74],["c",.15,-.6,.63,-1.2,1.23,-1.47],["c",.36,-.18,.57,-.21,.99,-.21],["c",.42,0,.63,.03,1.02,.21],["c",.42,.21,.84,.63,1.05,1.05],["c",.18,.36,.21,.6,.21,.96],["c",0,.3,0,.36,-.06,.51],["c",-.12,.24,-.27,.42,-.69,.72],["c",-.57,.42,-.69,.63,-.69,1.08],["c",0,.24,0,.3,.06,.45],["c",.12,.21,.3,.39,.57,.54],["c",.42,.18,.87,.21,1.53,.15],["c",1.08,-.15,1.8,-.57,2.34,-1.32],["c",.54,-.75,.84,-1.83,.99,-3.51],["c",.06,-.57,.06,-3.03,0,-3.57],["c",-.12,-1.47,-.42,-2.31,-.99,-2.88],["c",-.27,-.27,-.63,-.48,-1.08,-.6],["c",-.27,-.06,-.39,-.06,-.84,-.06],["c",-.45,0,-.57,0,-.78,.06],["c",-1.14,.27,-2.01,1.17,-2.46,2.49],["c",-.21,.57,-.3,.99,-.33,1.65],["c",-.03,.51,-.06,.57,-.24,.66],["c",-.12,.06,-.27,.06,-.39,0],["c",-.21,-.09,-.21,-.15,-.24,-.75],["c",-.09,-1.92,-.78,-3.72,-2.01,-5.19],["c",-.18,-.21,-.36,-.42,-.39,-.45],["l",-.09,-.06],["l",0,7.11],["l",0,7.14],["l",-.06,.09],["c",-.09,.06,-.09,.06,-.54,.06],["c",-.48,0,-.48,0,-.57,-.06],["l",-.06,-.09],["l",0,-14.82],["l",0,-14.85],["z"]],w:20.31,h:29.97},"clefs.F":{d:[["M",6.3,-7.8],["c",.36,-.03,1.65,0,2.13,.03],["c",3.6,.42,6.03,2.1,6.93,4.86],["c",.27,.84,.36,1.5,.36,2.58],["c",0,.9,-.03,1.35,-.18,2.16],["c",-.78,3.78,-3.54,7.08,-8.37,9.96],["c",-1.74,1.05,-3.87,2.13,-6.18,3.12],["c",-.39,.18,-.75,.33,-.81,.36],["c",-.06,.03,-.15,.06,-.18,.06],["c",-.15,0,-.33,-.18,-.33,-.33],["c",0,-.15,.06,-.21,.51,-.48],["c",3,-1.77,5.13,-3.21,6.84,-4.74],["c",.51,-.45,1.59,-1.5,1.95,-1.95],["c",1.89,-2.19,2.88,-4.32,3.15,-6.78],["c",.06,-.42,.06,-1.77,0,-2.19],["c",-.24,-2.01,-.93,-3.63,-2.04,-4.71],["c",-.63,-.63,-1.29,-1.02,-2.07,-1.2],["c",-1.62,-.39,-3.36,.15,-4.56,1.44],["c",-.54,.6,-1.05,1.47,-1.32,2.22],["l",-.09,.21],["l",.24,-.12],["c",.39,-.21,.63,-.24,1.11,-.24],["c",.3,0,.45,0,.66,.06],["c",1.92,.48,2.85,2.55,1.95,4.38],["c",-.45,.99,-1.41,1.62,-2.46,1.71],["c",-1.47,.09,-2.91,-.87,-3.39,-2.25],["c",-.18,-.57,-.21,-1.32,-.03,-2.28],["c",.39,-2.25,1.83,-4.2,3.81,-5.19],["c",.69,-.36,1.59,-.6,2.37,-.69],["z"],["m",11.58,2.52],["c",.84,-.21,1.71,.3,1.89,1.14],["c",.3,1.17,-.72,2.19,-1.89,1.89],["c",-.99,-.21,-1.5,-1.32,-1.02,-2.25],["c",.18,-.39,.6,-.69,1.02,-.78],["z"],["m",0,7.5],["c",.84,-.21,1.71,.3,1.89,1.14],["c",.21,.87,-.3,1.71,-1.14,1.89],["c",-.87,.21,-1.71,-.3,-1.89,-1.14],["c",-.21,-.84,.3,-1.71,1.14,-1.89],["z"]],w:20.153,h:23.142},"clefs.G":{d:[["M",9.69,-37.41],["c",.09,-.09,.24,-.06,.36,0],["c",.12,.09,.57,.6,.96,1.11],["c",1.77,2.34,3.21,5.85,3.57,8.73],["c",.21,1.56,.03,3.27,-.45,4.86],["c",-.69,2.31,-1.92,4.47,-4.23,7.44],["c",-.3,.39,-.57,.72,-.6,.75],["c",-.03,.06,0,.15,.18,.78],["c",.54,1.68,1.38,4.44,1.68,5.49],["l",.09,.42],["l",.39,0],["c",1.47,.09,2.76,.51,3.96,1.29],["c",1.83,1.23,3.06,3.21,3.39,5.52],["c",.09,.45,.12,1.29,.06,1.74],["c",-.09,1.02,-.33,1.83,-.75,2.73],["c",-.84,1.71,-2.28,3.06,-4.02,3.72],["l",-.33,.12],["l",.03,1.26],["c",0,1.74,-.06,3.63,-.21,4.62],["c",-.45,3.06,-2.19,5.49,-4.47,6.21],["c",-.57,.18,-.9,.21,-1.59,.21],["c",-.69,0,-1.02,-.03,-1.65,-.21],["c",-1.14,-.27,-2.13,-.84,-2.94,-1.65],["c",-.99,-.99,-1.56,-2.16,-1.71,-3.54],["c",-.09,-.81,.06,-1.53,.45,-2.13],["c",.63,-.99,1.83,-1.56,3,-1.53],["c",1.5,.09,2.64,1.32,2.73,2.94],["c",.06,1.47,-.93,2.7,-2.37,2.97],["c",-.45,.06,-.84,.03,-1.29,-.09],["l",-.21,-.09],["l",.09,.12],["c",.39,.54,.78,.93,1.32,1.26],["c",1.35,.87,3.06,1.02,4.35,.36],["c",1.44,-.72,2.52,-2.28,2.97,-4.35],["c",.15,-.66,.24,-1.5,.3,-3.03],["c",.03,-.84,.03,-2.94,0,-3],["c",-.03,0,-.18,0,-.36,.03],["c",-.66,.12,-.99,.12,-1.83,.12],["c",-1.05,0,-1.71,-.06,-2.61,-.3],["c",-4.02,-.99,-7.11,-4.35,-7.8,-8.46],["c",-.12,-.66,-.12,-.99,-.12,-1.83],["c",0,-.84,0,-1.14,.15,-1.92],["c",.36,-2.28,1.41,-4.62,3.3,-7.29],["l",2.79,-3.6],["c",.54,-.66,.96,-1.2,.96,-1.23],["c",0,-.03,-.09,-.33,-.18,-.69],["c",-.96,-3.21,-1.41,-5.28,-1.59,-7.68],["c",-.12,-1.38,-.15,-3.09,-.06,-3.96],["c",.33,-2.67,1.38,-5.07,3.12,-7.08],["c",.36,-.42,.99,-1.05,1.17,-1.14],["z"],["m",2.01,4.71],["c",-.15,-.3,-.3,-.54,-.3,-.54],["c",-.03,0,-.18,.09,-.3,.21],["c",-2.4,1.74,-3.87,4.2,-4.26,7.11],["c",-.06,.54,-.06,1.41,-.03,1.89],["c",.09,1.29,.48,3.12,1.08,5.22],["c",.15,.42,.24,.78,.24,.81],["c",0,.03,.84,-1.11,1.23,-1.68],["c",1.89,-2.73,2.88,-5.07,3.15,-7.53],["c",.09,-.57,.12,-1.74,.06,-2.37],["c",-.09,-1.23,-.27,-1.92,-.87,-3.12],["z"],["m",-2.94,20.7],["c",-.21,-.72,-.39,-1.32,-.42,-1.32],["c",0,0,-1.2,1.47,-1.86,2.37],["c",-2.79,3.63,-4.02,6.3,-4.35,9.3],["c",-.03,.21,-.03,.69,-.03,1.08],["c",0,.69,0,.75,.06,1.11],["c",.12,.54,.27,.99,.51,1.47],["c",.69,1.38,1.83,2.55,3.42,3.42],["c",.96,.54,2.07,.9,3.21,1.08],["c",.78,.12,2.04,.12,2.94,-.03],["c",.51,-.06,.45,-.03,.42,-.3],["c",-.24,-3.33,-.72,-6.33,-1.62,-10.08],["c",-.09,-.39,-.18,-.75,-.18,-.78],["c",-.03,-.03,-.42,0,-.81,.09],["c",-.9,.18,-1.65,.57,-2.22,1.14],["c",-.72,.72,-1.08,1.65,-1.05,2.64],["c",.06,.96,.48,1.83,1.23,2.58],["c",.36,.36,.72,.63,1.17,.9],["c",.33,.18,.36,.21,.42,.33],["c",.18,.42,-.18,.9,-.6,.87],["c",-.18,-.03,-.84,-.36,-1.26,-.63],["c",-.78,-.51,-1.38,-1.11,-1.86,-1.83],["c",-1.77,-2.7,-.99,-6.42,1.71,-8.19],["c",.3,-.21,.81,-.48,1.17,-.63],["c",.3,-.09,1.02,-.3,1.14,-.3],["c",.06,0,.09,0,.09,-.03],["c",.03,-.03,-.51,-1.92,-1.23,-4.26],["z"],["m",3.78,7.41],["c",-.18,-.03,-.36,-.06,-.39,-.06],["c",-.03,0,0,.21,.18,1.02],["c",.75,3.18,1.26,6.3,1.5,9.09],["c",.06,.72,0,.69,.51,.42],["c",.78,-.36,1.44,-.96,1.98,-1.77],["c",1.08,-1.62,1.2,-3.69,.3,-5.55],["c",-.81,-1.62,-2.31,-2.79,-4.08,-3.15],["z"]],w:19.051,h:57.057},"clefs.perc":{d:[["M",5.07,-7.44],["l",.09,-.06],["l",1.53,0],["l",1.53,0],["l",.09,.06],["l",.06,.09],["l",0,7.35],["l",0,7.32],["l",-.06,.09],["l",-.09,.06],["l",-1.53,0],["l",-1.53,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-7.32],["l",0,-7.35],["z"],["m",6.63,0],["l",.09,-.06],["l",1.53,0],["l",1.53,0],["l",.09,.06],["l",.06,.09],["l",0,7.35],["l",0,7.32],["l",-.06,.09],["l",-.09,.06],["l",-1.53,0],["l",-1.53,0],["l",-.09,-.06],["l",-.06,-.09],["l",0,-7.32],["l",0,-7.35],["z"]],w:21,h:14.97},"tab.big":{d:[["M",20.16,-21.66],["c",.24,-.09,.66,.09,.78,.36],["c",.09,.21,.09,.24,-.18,.54],["c",-.78,.81,-1.86,1.44,-2.94,1.71],["c",-.87,.24,-1.71,.24,-2.55,.03],["l",-.06,-.03],["l",-.18,.99],["c",-.33,1.98,-.75,4.26,-.96,5.04],["c",-.42,1.65,-1.26,3.18,-2.28,4.14],["c",-.57,.57,-1.17,.9,-1.86,1.08],["c",-.18,.06,-.33,.06,-.66,.06],["c",-.54,0,-.78,-.03,-1.23,-.27],["c",-.39,-.18,-.66,-.39,-1.38,-.99],["c",-.3,-.24,-.66,-.51,-.75,-.57],["c",-.21,-.15,-.27,-.24,-.24,-.45],["c",.06,-.27,.36,-.6,.6,-.66],["c",.18,-.03,.33,.06,.9,.57],["c",.48,.42,.72,.57,.93,.69],["c",.66,.33,1.38,.21,1.95,-.36],["c",.63,-.6,1.05,-1.62,1.23,-3],["c",.03,-.18,.09,-.66,.09,-1.11],["c",.09,-1.56,.33,-3.81,.57,-5.49],["c",.06,-.33,.09,-.63,.09,-.63],["c",-.03,-.03,-.81,-.12,-1.02,-.12],["c",-.57,0,-1.32,.12,-1.8,.33],["c",-.87,.3,-1.35,.78,-1.5,1.41],["c",-.18,.63,.09,1.26,.66,1.65],["c",.12,.06,.15,.12,.18,.24],["c",.09,.27,.06,.57,-.09,.75],["c",-.03,.06,-.12,.09,-.27,.15],["c",-.72,.21,-1.44,.15,-2.1,-.18],["c",-.54,-.27,-.96,-.66,-1.2,-1.14],["c",-.39,-.75,-.33,-1.74,.15,-2.52],["c",.27,-.42,.84,-.93,1.41,-1.23],["c",1.17,-.57,2.88,-.9,4.8,-.9],["c",.69,0,.78,0,1.08,.06],["c",.45,.09,1.11,.3,2.07,.6],["c",1.47,.48,1.83,.57,2.55,.54],["c",1.02,-.06,2.04,-.45,2.94,-1.11],["c",.12,-.09,.24,-.18,.27,-.18],["z"],["m",-5.88,13.05],["c",.21,-.03,.81,0,1.08,.06],["c",.48,.12,.9,.42,.99,.69],["c",.03,.09,.03,.15,0,.27],["c",0,.09,-.03,.57,-.06,1.08],["c",-.09,2.19,-.24,5.76,-.39,8.28],["c",-.06,1.53,-.06,1.77,.03,2.01],["c",.09,.18,.15,.24,.3,.3],["c",.24,.12,.54,.06,1.23,-.27],["c",.57,-.27,.66,-.3,.75,-.24],["c",.09,.06,.18,.3,.18,.45],["c",0,.33,-.15,.51,-.45,.63],["c",-.12,.03,-.39,.15,-.6,.27],["c",-1.17,.6,-1.38,.69,-1.8,.72],["c",-.45,.03,-.78,-.09,-1.08,-.39],["c",-.39,-.42,-.66,-1.2,-1.02,-3.12],["c",-.24,-1.23,-.36,-2.07,-.54,-3.75],["l",0,-.18],["l",-.36,.45],["c",-.6,.75,-1.32,1.59,-1.95,2.25],["c",-.15,.18,-.27,.3,-.27,.33],["c",0,0,.06,.09,.15,.18],["c",.24,.33,.6,.57,1.05,.69],["c",.18,.06,.3,.06,.69,.06],["l",.48,.03],["l",.06,.12],["c",.15,.27,.03,.72,-.21,.9],["c",-.18,.12,-.93,.27,-1.41,.27],["c",-.84,0,-1.59,-.3,-1.98,-.84],["l",-.12,-.15],["l",-.45,.42],["c",-.99,.87,-1.53,1.32,-2.16,1.74],["c",-.78,.51,-1.5,.84,-2.1,.93],["c",-.69,.12,-1.2,.03,-1.95,-.42],["c",-.21,-.12,-.51,-.27,-.66,-.36],["c",-.24,-.12,-.3,-.18,-.33,-.24],["c",-.12,-.27,.15,-.78,.45,-.93],["c",.24,-.12,.33,-.09,.9,.18],["c",.6,.3,.84,.39,1.2,.36],["c",.87,-.09,1.77,-.69,3.24,-2.31],["c",2.67,-2.85,4.59,-5.94,5.7,-9.15],["c",.15,-.45,.24,-.63,.42,-.81],["c",.21,-.24,.6,-.45,.99,-.51],["z"],["m",-3.99,16.05],["c",.18,0,.69,-.03,1.17,0],["c",3.27,.03,5.37,.75,6,2.07],["c",.45,.99,.12,2.4,-.81,3.42],["c",-.24,.27,-.57,.57,-.84,.75],["c",-.09,.06,-.18,.09,-.18,.12],["c",0,0,.18,.03,.42,.09],["c",1.23,.3,2.01,.81,2.37,1.59],["c",.27,.54,.3,1.32,.09,2.1],["c",-.12,.36,-.45,1.05,-.69,1.35],["c",-.87,1.17,-2.1,1.92,-3.54,2.25],["c",-.36,.06,-.48,.06,-.96,.06],["c",-.45,0,-.66,0,-.84,-.03],["c",-.84,-.18,-1.47,-.51,-2.07,-1.11],["c",-.33,-.33,-.45,-.51,-.45,-.63],["c",0,-.06,.03,-.15,.06,-.24],["c",.18,-.33,.69,-.6,.93,-.48],["c",.03,.03,.15,.12,.27,.24],["c",.39,.42,.99,.57,1.62,.45],["c",1.05,-.21,1.98,-1.02,2.31,-2.01],["c",.48,-1.53,-.48,-2.55,-2.58,-2.67],["c",-.21,0,-.36,-.03,-.42,-.06],["c",-.15,-.09,-.21,-.51,-.06,-.78],["c",.12,-.27,.24,-.33,.6,-.36],["c",.57,-.06,1.11,-.42,1.5,-.99],["c",.48,-.72,.54,-1.59,.18,-2.31],["c",-.12,-.21,-.45,-.54,-.69,-.69],["c",-.33,-.21,-.93,-.45,-1.35,-.51],["l",-.12,-.03],["l",-.06,.48],["c",-.54,2.94,-1.14,6.24,-1.29,6.75],["c",-.33,1.35,-.93,2.61,-1.65,3.6],["c",-.3,.36,-.81,.9,-1.14,1.14],["c",-.3,.24,-.84,.48,-1.14,.57],["c",-.33,.09,-.96,.09,-1.26,.03],["c",-.45,-.12,-.87,-.39,-1.53,-.96],["c",-.24,-.15,-.51,-.39,-.63,-.48],["c",-.3,-.21,-.33,-.33,-.21,-.63],["c",.12,-.18,.27,-.36,.42,-.45],["c",.27,-.12,.36,-.09,.87,.33],["c",.78,.6,1.08,.75,1.65,.72],["c",.45,-.03,.81,-.21,1.17,-.54],["c",.87,-.9,1.38,-2.85,1.38,-5.37],["c",0,-.6,.03,-1.11,.12,-2.04],["c",.06,-.69,.24,-2.01,.33,-2.58],["c",.06,-.24,.06,-.42,.06,-.42],["c",0,0,-.12,.03,-.21,.09],["c",-1.44,.57,-2.16,1.65,-1.74,2.55],["c",.09,.15,.18,.24,.27,.33],["c",.24,.21,.3,.27,.33,.39],["c",.06,.24,0,.63,-.15,.78],["c",-.09,.12,-.54,.21,-.96,.24],["c",-1.02,.03,-2.01,-.48,-2.43,-1.32],["c",-.21,-.45,-.27,-.9,-.15,-1.44],["c",.06,-.27,.21,-.66,.39,-.93],["c",.87,-1.29,3,-2.22,5.64,-2.43],["z"]],w:19.643,h:43.325},"tab.tiny":{d:[["M",16.02,-17.25],["c",.12,-.09,.15,-.09,.27,-.09],["c",.21,.03,.51,.3,.51,.45],["c",0,.06,-.12,.18,-.3,.36],["c",-1.11,1.08,-2.55,1.59,-3.84,1.41],["c",-.15,-.03,-.33,-.06,-.39,-.09],["c",-.06,-.03,-.09,-.03,-.12,-.03],["c",0,0,-.06,.42,-.15,.93],["c",-.33,2.01,-.66,3.69,-.84,4.26],["c",-.42,1.41,-1.23,2.67,-2.16,3.33],["c",-.27,.18,-.75,.42,-.99,.48],["c",-.3,.09,-.72,.09,-1.02,.06],["c",-.45,-.09,-.84,-.33,-1.53,-.9],["c",-.21,-.18,-.51,-.39,-.63,-.48],["c",-.27,-.21,-.3,-.24,-.3,-.36],["c",0,-.12,.09,-.36,.18,-.45],["c",.09,-.09,.27,-.18,.36,-.18],["c",.12,0,.3,.12,.66,.45],["c",.57,.51,.87,.69,1.23,.72],["c",.93,.06,1.68,-.78,1.98,-2.37],["c",.09,-.39,.15,-.75,.18,-1.53],["c",.06,-.99,.24,-2.79,.42,-4.05],["c",.03,-.3,.06,-.57,.06,-.6],["c",0,-.06,-.03,-.09,-.15,-.12],["c",-.9,-.18,-2.13,.06,-2.76,.57],["c",-.36,.3,-.51,.6,-.51,1.02],["c",0,.45,.15,.75,.48,.99],["c",.06,.06,.15,.18,.18,.24],["c",.12,.24,.03,.63,-.15,.69],["c",-.24,.12,-.6,.15,-.9,.15],["c",-.36,-.03,-.57,-.09,-.87,-.24],["c",-.78,-.36,-1.23,-1.11,-1.2,-1.92],["c",.12,-1.53,1.74,-2.49,4.62,-2.7],["c",1.2,-.09,1.47,-.03,3.33,.57],["c",.9,.3,1.14,.36,1.56,.39],["c",.45,0,.93,-.06,1.38,-.21],["c",.51,-.18,.81,-.33,1.41,-.75],["z"],["m",-4.68,10.38],["c",.39,-.06,.84,0,1.2,.15],["c",.24,.12,.36,.21,.45,.36],["l",.09,.09],["l",-.06,1.41],["c",-.09,2.19,-.18,3.96,-.27,5.49],["c",-.03,.78,-.06,1.59,-.06,1.86],["c",0,.42,0,.48,.06,.57],["c",.06,.18,.18,.24,.36,.27],["c",.18,0,.39,-.06,.84,-.27],["c",.45,-.21,.54,-.24,.63,-.18],["c",.12,.12,.15,.54,.03,.69],["c",-.03,.03,-.15,.12,-.27,.18],["c",-.15,.03,-.3,.12,-.36,.15],["c",-.87,.45,-1.02,.51,-1.26,.57],["c",-.33,.09,-.6,.06,-.84,-.06],["c",-.42,-.18,-.63,-.6,-.87,-1.44],["c",-.3,-1.23,-.57,-2.97,-.66,-4.08],["c",0,-.18,-.03,-.3,-.03,-.33],["l",-.06,.06],["c",-.18,.27,-1.11,1.38,-1.68,2.01],["l",-.33,.33],["l",.06,.09],["c",.06,.15,.27,.33,.48,.42],["c",.27,.18,.51,.24,.96,.27],["l",.39,0],["l",.03,.12],["c",.12,.21,.03,.57,-.15,.69],["c",-.03,.03,-.21,.09,-.36,.15],["c",-.27,.06,-.39,.06,-.75,.06],["c",-.48,0,-.75,-.03,-1.08,-.21],["c",-.21,-.12,-.51,-.36,-.57,-.48],["l",-.03,-.09],["l",-.39,.36],["c",-1.47,1.35,-2.49,1.98,-3.42,2.13],["c",-.54,.09,-.96,-.03,-1.62,-.39],["c",-.21,-.15,-.45,-.27,-.54,-.3],["c",-.18,-.09,-.21,-.21,-.12,-.45],["c",.06,-.27,.33,-.48,.54,-.48],["c",.03,0,.27,.09,.48,.21],["c",.48,.24,.69,.27,.99,.27],["c",.6,-.06,1.17,-.42,2.1,-1.35],["c",2.22,-2.22,4.02,-4.98,4.95,-7.59],["c",.21,-.57,.3,-.78,.48,-.93],["c",.15,-.15,.42,-.27,.66,-.33],["z"],["m",-3.06,12.84],["c",.27,-.03,1.68,0,2.01,.03],["c",1.92,.18,3.15,.69,3.63,1.5],["c",.18,.33,.24,.51,.21,.93],["c",0,.45,-.06,.72,-.24,1.11],["c",-.24,.51,-.69,1.02,-1.17,1.35],["c",-.21,.15,-.21,.15,-.12,.18],["c",.72,.15,1.11,.3,1.5,.57],["c",.39,.24,.63,.57,.75,.96],["c",.09,.3,.09,.96,0,1.29],["c",-.15,.57,-.39,1.05,-.78,1.5],["c",-.66,.75,-1.62,1.32,-2.61,1.53],["c",-.27,.06,-.42,.06,-.84,.06],["c",-.48,0,-.57,0,-.81,-.06],["c",-.6,-.18,-1.05,-.42,-1.47,-.81],["c",-.36,-.39,-.42,-.51,-.3,-.75],["c",.12,-.21,.39,-.39,.6,-.39],["c",.09,0,.15,.03,.33,.18],["c",.12,.12,.27,.24,.36,.27],["c",.96,.48,2.46,-.33,2.82,-1.5],["c",.24,-.81,-.03,-1.44,-.69,-1.77],["c",-.39,-.21,-1.02,-.33,-1.53,-.33],["c",-.18,0,-.21,0,-.27,-.09],["c",-.06,-.09,-.06,-.3,-.03,-.48],["c",.06,-.18,.18,-.36,.33,-.36],["c",.39,-.06,.51,-.09,.72,-.18],["c",.69,-.36,1.11,-1.23,.99,-2.01],["c",-.09,-.51,-.42,-.9,-.93,-1.17],["c",-.24,-.12,-.6,-.27,-.87,-.3],["c",-.09,-.03,-.09,-.03,-.12,.12],["c",0,.09,-.21,1.11,-.42,2.25],["c",-.66,3.75,-.72,3.99,-1.26,5.07],["c",-.9,1.89,-2.25,2.85,-3.48,2.61],["c",-.39,-.09,-.69,-.27,-1.38,-.84],["c",-.63,-.51,-.63,-.48,-.63,-.6],["c",0,-.18,.18,-.48,.39,-.57],["c",.21,-.12,.3,-.09,.81,.33],["c",.15,.15,.39,.3,.54,.36],["c",.18,.12,.27,.12,.48,.15],["c",.99,.06,1.71,-.78,2.04,-2.46],["c",.12,-.66,.18,-1.14,.21,-2.22],["c",.03,-1.23,.12,-2.25,.36,-3.63],["c",.03,-.24,.06,-.45,.06,-.48],["c",-.06,-.03,-.66,.27,-.9,.42],["c",-.06,.06,-.21,.18,-.33,.3],["c",-.57,.57,-.6,1.35,-.06,1.74],["c",.18,.12,.24,.24,.21,.51],["c",-.03,.3,-.15,.42,-.57,.48],["c",-1.11,.24,-2.22,-.42,-2.43,-1.38],["c",-.09,-.45,.03,-1.02,.3,-1.47],["c",.18,-.24,.6,-.63,.9,-.84],["c",.9,-.6,2.28,-1.02,3.69,-1.11],["z"]],w:15.709,h:34.656},"timesig.common":{d:[["M",6.66,-7.83],["c",.72,-.06,1.41,-.03,1.98,.09],["c",1.2,.27,2.34,.96,3.09,1.92],["c",.63,.81,1.08,1.86,1.14,2.73],["c",.06,1.02,-.51,1.92,-1.44,2.22],["c",-.24,.09,-.3,.09,-.63,.09],["c",-.33,0,-.42,0,-.63,-.06],["c",-.66,-.24,-1.14,-.63,-1.41,-1.2],["c",-.15,-.3,-.21,-.51,-.24,-.9],["c",-.06,-1.08,.57,-2.04,1.56,-2.37],["c",.18,-.06,.27,-.06,.63,-.06],["l",.45,0],["c",.06,.03,.09,.03,.09,0],["c",0,0,-.09,-.12,-.24,-.27],["c",-1.02,-1.11,-2.55,-1.68,-4.08,-1.5],["c",-1.29,.15,-2.04,.69,-2.4,1.74],["c",-.36,.93,-.42,1.89,-.42,5.37],["c",0,2.97,.06,3.96,.24,4.77],["c",.24,1.08,.63,1.68,1.41,2.07],["c",.81,.39,2.16,.45,3.18,.09],["c",1.29,-.45,2.37,-1.53,3.03,-2.97],["c",.15,-.33,.33,-.87,.39,-1.17],["c",.09,-.24,.15,-.36,.3,-.39],["c",.21,-.03,.42,.15,.39,.36],["c",-.06,.39,-.42,1.38,-.69,1.89],["c",-.96,1.8,-2.49,2.94,-4.23,3.18],["c",-.99,.12,-2.58,-.06,-3.63,-.45],["c",-.96,-.36,-1.71,-.84,-2.4,-1.5],["c",-1.11,-1.11,-1.8,-2.61,-2.04,-4.56],["c",-.06,-.6,-.06,-2.01,0,-2.61],["c",.24,-1.95,.9,-3.45,2.01,-4.56],["c",.69,-.66,1.44,-1.11,2.37,-1.47],["c",.63,-.24,1.47,-.42,2.22,-.48],["z"]],w:13.038,h:15.689},"timesig.cut":{d:[["M",6.24,-10.44],["c",.09,-.06,.09,-.06,.48,-.06],["c",.36,0,.36,0,.45,.06],["l",.06,.09],["l",0,1.23],["l",0,1.26],["l",.27,0],["c",1.26,0,2.49,.45,3.48,1.29],["c",1.05,.87,1.8,2.28,1.89,3.48],["c",.06,1.02,-.51,1.92,-1.44,2.22],["c",-.24,.09,-.3,.09,-.63,.09],["c",-.33,0,-.42,0,-.63,-.06],["c",-.66,-.24,-1.14,-.63,-1.41,-1.2],["c",-.15,-.3,-.21,-.51,-.24,-.9],["c",-.06,-1.08,.57,-2.04,1.56,-2.37],["c",.18,-.06,.27,-.06,.63,-.06],["l",.45,0],["c",.06,.03,.09,.03,.09,0],["c",0,-.03,-.45,-.51,-.66,-.69],["c",-.87,-.69,-1.83,-1.05,-2.94,-1.11],["l",-.42,0],["l",0,7.17],["l",0,7.14],["l",.42,0],["c",.69,-.03,1.23,-.18,1.86,-.51],["c",1.05,-.51,1.89,-1.47,2.46,-2.7],["c",.15,-.33,.33,-.87,.39,-1.17],["c",.09,-.24,.15,-.36,.3,-.39],["c",.21,-.03,.42,.15,.39,.36],["c",-.03,.24,-.21,.78,-.39,1.2],["c",-.96,2.37,-2.94,3.9,-5.13,3.9],["l",-.3,0],["l",0,1.26],["l",0,1.23],["l",-.06,.09],["c",-.09,.06,-.09,.06,-.45,.06],["c",-.39,0,-.39,0,-.48,-.06],["l",-.06,-.09],["l",0,-1.29],["l",0,-1.29],["l",-.21,-.03],["c",-1.23,-.21,-2.31,-.63,-3.21,-1.29],["c",-.15,-.09,-.45,-.36,-.66,-.57],["c",-1.11,-1.11,-1.8,-2.61,-2.04,-4.56],["c",-.06,-.6,-.06,-2.01,0,-2.61],["c",.24,-1.95,.93,-3.45,2.04,-4.59],["c",.42,-.39,.78,-.66,1.26,-.93],["c",.75,-.45,1.65,-.75,2.61,-.9],["l",.21,-.03],["l",0,-1.29],["l",0,-1.29],["z"],["m",-.06,10.44],["c",0,-5.58,0,-6.99,-.03,-6.99],["c",-.15,0,-.63,.27,-.87,.45],["c",-.45,.36,-.75,.93,-.93,1.77],["c",-.18,.81,-.24,1.8,-.24,4.74],["c",0,2.97,.06,3.96,.24,4.77],["c",.24,1.08,.66,1.68,1.41,2.07],["c",.12,.06,.3,.12,.33,.15],["l",.09,0],["l",0,-6.96],["z"]],w:13.038,h:20.97},"timesig.imperfectum":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.imperfectum2":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.perfectum":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},"timesig.perfectum2":{d:[["M",13,-5],["a",8,8,0,1,0,0,10]],w:13.038,h:20.97},f:{d:[["M",9.93,-14.28],["c",1.53,-.18,2.88,.45,3.12,1.5],["c",.12,.51,0,1.32,-.27,1.86],["c",-.15,.3,-.42,.57,-.63,.69],["c",-.69,.36,-1.56,.03,-1.83,-.69],["c",-.09,-.24,-.09,-.69,0,-.87],["c",.06,-.12,.21,-.24,.45,-.42],["c",.42,-.24,.57,-.45,.6,-.72],["c",.03,-.33,-.09,-.39,-.63,-.42],["c",-.3,0,-.45,0,-.6,.03],["c",-.81,.21,-1.35,.93,-1.74,2.46],["c",-.06,.27,-.48,2.25,-.48,2.31],["c",0,.03,.39,.03,.9,.03],["c",.72,0,.9,0,.99,.06],["c",.42,.15,.45,.72,.03,.9],["c",-.12,.06,-.24,.06,-1.17,.06],["l",-1.05,0],["l",-.78,2.55],["c",-.45,1.41,-.87,2.79,-.96,3.06],["c",-.87,2.37,-2.37,4.74,-3.78,5.91],["c",-1.05,.9,-2.04,1.23,-3.09,1.08],["c",-1.11,-.18,-1.89,-.78,-2.04,-1.59],["c",-.12,-.66,.15,-1.71,.54,-2.19],["c",.69,-.75,1.86,-.54,2.22,.39],["c",.06,.15,.09,.27,.09,.48],["c",0,.24,-.03,.27,-.12,.42],["c",-.03,.09,-.15,.18,-.27,.27],["c",-.09,.06,-.27,.21,-.36,.27],["c",-.24,.18,-.36,.36,-.39,.6],["c",-.03,.33,.09,.39,.63,.42],["c",.42,0,.63,-.03,.9,-.15],["c",.6,-.3,.96,-.96,1.38,-2.64],["c",.09,-.42,.63,-2.55,1.17,-4.77],["l",1.02,-4.08],["c",0,-.03,-.36,-.03,-.81,-.03],["c",-.72,0,-.81,0,-.93,-.06],["c",-.42,-.18,-.39,-.75,.03,-.9],["c",.09,-.06,.27,-.06,1.05,-.06],["l",.96,0],["l",0,-.09],["c",.06,-.18,.3,-.72,.51,-1.17],["c",1.2,-2.46,3.3,-4.23,5.34,-4.5],["z"]],w:16.155,h:19.445},m:{d:[["M",2.79,-8.91],["c",.09,0,.3,-.03,.45,-.03],["c",.24,.03,.3,.03,.45,.12],["c",.36,.15,.63,.54,.75,1.02],["l",.03,.21],["l",.33,-.3],["c",.69,-.69,1.38,-1.02,2.07,-1.02],["c",.27,0,.33,0,.48,.06],["c",.21,.09,.48,.36,.63,.6],["c",.03,.09,.12,.27,.18,.42],["c",.03,.15,.09,.27,.12,.27],["c",0,0,.09,-.09,.18,-.21],["c",.33,-.39,.87,-.81,1.29,-.99],["c",.78,-.33,1.47,-.21,2.01,.33],["c",.3,.33,.48,.69,.6,1.14],["c",.09,.42,.06,.54,-.54,3.06],["c",-.33,1.29,-.57,2.4,-.57,2.43],["c",0,.12,.09,.21,.21,.21],["c",.24,0,.75,-.3,1.2,-.72],["c",.45,-.39,.6,-.45,.78,-.27],["c",.18,.18,.09,.36,-.45,.87],["c",-1.05,.96,-1.83,1.47,-2.58,1.71],["c",-.93,.33,-1.53,.21,-1.8,-.33],["c",-.06,-.15,-.06,-.21,-.06,-.45],["c",0,-.24,.03,-.48,.6,-2.82],["c",.42,-1.71,.6,-2.64,.63,-2.79],["c",.03,-.57,-.3,-.75,-.84,-.48],["c",-.24,.12,-.54,.39,-.66,.63],["c",-.03,.09,-.42,1.38,-.9,3],["c",-.9,3.15,-.84,3,-1.14,3.15],["l",-.15,.09],["l",-.78,0],["c",-.6,0,-.78,0,-.84,-.06],["c",-.09,-.03,-.18,-.18,-.18,-.27],["c",0,-.03,.36,-1.38,.84,-2.97],["c",.57,-2.04,.81,-2.97,.84,-3.12],["c",.03,-.54,-.3,-.72,-.84,-.45],["c",-.24,.12,-.57,.42,-.66,.63],["c",-.06,.09,-.51,1.44,-1.05,2.97],["c",-.51,1.56,-.99,2.85,-.99,2.91],["c",-.06,.12,-.21,.24,-.36,.3],["c",-.12,.06,-.21,.06,-.9,.06],["c",-.6,0,-.78,0,-.84,-.06],["c",-.09,-.03,-.18,-.18,-.18,-.27],["c",0,-.03,.45,-1.38,.99,-2.97],["c",1.05,-3.18,1.05,-3.18,.93,-3.45],["c",-.12,-.27,-.39,-.3,-.72,-.15],["c",-.54,.27,-1.14,1.17,-1.56,2.4],["c",-.06,.15,-.15,.3,-.18,.36],["c",-.21,.21,-.57,.27,-.72,.09],["c",-.09,-.09,-.06,-.21,.06,-.63],["c",.48,-1.26,1.26,-2.46,2.01,-3.21],["c",.57,-.54,1.2,-.87,1.83,-1.02],["z"]],w:14.687,h:9.126},p:{d:[["M",1.92,-8.7],["c",.27,-.09,.81,-.06,1.11,.03],["c",.54,.18,.93,.51,1.17,.99],["c",.09,.15,.15,.33,.18,.36],["l",0,.12],["l",.3,-.27],["c",.66,-.6,1.35,-1.02,2.13,-1.2],["c",.21,-.06,.33,-.06,.78,-.06],["c",.45,0,.51,0,.84,.09],["c",1.29,.33,2.07,1.32,2.25,2.79],["c",.09,.81,-.09,2.01,-.45,2.79],["c",-.54,1.26,-1.86,2.55,-3.18,3.03],["c",-.45,.18,-.81,.24,-1.29,.24],["c",-.69,-.03,-1.35,-.18,-1.86,-.45],["c",-.3,-.15,-.51,-.18,-.69,-.09],["c",-.09,.03,-.18,.09,-.18,.12],["c",-.09,.12,-1.05,2.94,-1.05,3.06],["c",0,.24,.18,.48,.51,.63],["c",.18,.06,.54,.15,.75,.15],["c",.21,0,.36,.06,.42,.18],["c",.12,.18,.06,.42,-.12,.54],["c",-.09,.03,-.15,.03,-.78,0],["c",-1.98,-.15,-3.81,-.15,-5.79,0],["c",-.63,.03,-.69,.03,-.78,0],["c",-.24,-.15,-.24,-.57,.03,-.66],["c",.06,-.03,.48,-.09,.99,-.12],["c",.87,-.06,1.11,-.09,1.35,-.21],["c",.18,-.06,.33,-.18,.39,-.3],["c",.06,-.12,3.24,-9.42,3.27,-9.6],["c",.06,-.33,.03,-.57,-.15,-.69],["c",-.09,-.06,-.12,-.06,-.3,-.06],["c",-.69,.06,-1.53,1.02,-2.28,2.61],["c",-.09,.21,-.21,.45,-.27,.51],["c",-.09,.12,-.33,.24,-.48,.24],["c",-.18,0,-.36,-.15,-.36,-.3],["c",0,-.24,.78,-1.83,1.26,-2.55],["c",.72,-1.11,1.47,-1.74,2.28,-1.92],["z"],["m",5.37,1.47],["c",-.27,-.12,-.75,-.03,-1.14,.21],["c",-.75,.48,-1.47,1.68,-1.89,3.15],["c",-.45,1.47,-.42,2.34,0,2.7],["c",.45,.39,1.26,.21,1.83,-.36],["c",.51,-.51,.99,-1.68,1.38,-3.27],["c",.3,-1.17,.33,-1.74,.15,-2.13],["c",-.09,-.15,-.15,-.21,-.33,-.3],["z"]],w:14.689,h:13.127},r:{d:[["M",6.33,-9.12],["c",.27,-.03,.93,0,1.2,.06],["c",.84,.21,1.23,.81,1.02,1.53],["c",-.24,.75,-.9,1.17,-1.56,.96],["c",-.33,-.09,-.51,-.3,-.66,-.75],["c",-.03,-.12,-.09,-.24,-.12,-.3],["c",-.09,-.15,-.3,-.24,-.48,-.24],["c",-.57,0,-1.38,.54,-1.65,1.08],["c",-.06,.15,-.33,1.17,-.9,3.27],["c",-.57,2.31,-.81,3.12,-.87,3.21],["c",-.03,.06,-.12,.15,-.18,.21],["l",-.12,.06],["l",-.81,.03],["c",-.69,0,-.81,0,-.9,-.03],["c",-.09,-.06,-.18,-.21,-.18,-.3],["c",0,-.06,.39,-1.62,.9,-3.51],["c",.84,-3.24,.87,-3.45,.87,-3.72],["c",0,-.21,0,-.27,-.03,-.36],["c",-.12,-.15,-.21,-.24,-.42,-.24],["c",-.24,0,-.45,.15,-.78,.42],["c",-.33,.36,-.45,.54,-.72,1.14],["c",-.03,.12,-.21,.24,-.36,.27],["c",-.12,0,-.15,0,-.24,-.06],["c",-.18,-.12,-.18,-.21,-.06,-.54],["c",.21,-.57,.42,-.93,.78,-1.32],["c",.54,-.51,1.2,-.81,1.95,-.87],["c",.81,-.03,1.53,.3,1.92,.87],["l",.12,.18],["l",.09,-.09],["c",.57,-.45,1.41,-.84,2.19,-.96],["z"]],w:9.41,h:9.132},s:{d:[["M",4.47,-8.73],["c",.09,0,.36,-.03,.57,-.03],["c",.75,.03,1.29,.24,1.71,.63],["c",.51,.54,.66,1.26,.36,1.83],["c",-.24,.42,-.63,.57,-1.11,.42],["c",-.33,-.09,-.6,-.36,-.6,-.57],["c",0,-.03,.06,-.21,.15,-.39],["c",.12,-.21,.15,-.33,.18,-.48],["c",0,-.24,-.06,-.48,-.15,-.6],["c",-.15,-.21,-.42,-.24,-.75,-.15],["c",-.27,.06,-.48,.18,-.69,.36],["c",-.39,.39,-.51,.96,-.33,1.38],["c",.09,.21,.42,.51,.78,.72],["c",1.11,.69,1.59,1.11,1.89,1.68],["c",.21,.39,.24,.78,.15,1.29],["c",-.18,1.2,-1.17,2.16,-2.52,2.52],["c",-1.02,.24,-1.95,.12,-2.7,-.42],["c",-.72,-.51,-.99,-1.47,-.6,-2.19],["c",.24,-.48,.72,-.63,1.17,-.42],["c",.33,.18,.54,.45,.57,.81],["c",0,.21,-.03,.3,-.33,.51],["c",-.33,.24,-.39,.42,-.27,.69],["c",.06,.15,.21,.27,.45,.33],["c",.3,.09,.87,.09,1.2,0],["c",.75,-.21,1.23,-.72,1.29,-1.35],["c",.03,-.42,-.15,-.81,-.54,-1.2],["c",-.24,-.24,-.48,-.42,-1.41,-1.02],["c",-.69,-.42,-1.05,-.93,-1.05,-1.47],["c",0,-.39,.12,-.87,.3,-1.23],["c",.27,-.57,.78,-1.05,1.38,-1.35],["c",.24,-.12,.63,-.27,.9,-.3],["z"]],w:6.632,h:8.758},z:{d:[["M",2.64,-7.95],["c",.36,-.09,.81,-.03,1.71,.27],["c",.78,.21,.96,.27,1.74,.3],["c",.87,.06,1.02,.03,1.38,-.21],["c",.21,-.15,.33,-.15,.48,-.06],["c",.15,.09,.21,.3,.15,.45],["c",-.03,.06,-1.26,1.26,-2.76,2.67],["l",-2.73,2.55],["l",.54,.03],["c",.54,.03,.72,.03,2.01,.15],["c",.36,.03,.9,.06,1.2,.09],["c",.66,0,.81,-.03,1.02,-.24],["c",.3,-.3,.39,-.72,.27,-1.23],["c",-.06,-.27,-.06,-.27,-.03,-.39],["c",.15,-.3,.54,-.27,.69,.03],["c",.15,.33,.27,1.02,.27,1.5],["c",0,1.47,-1.11,2.7,-2.52,2.79],["c",-.57,.03,-1.02,-.09,-2.01,-.51],["c",-1.02,-.42,-1.23,-.48,-2.13,-.54],["c",-.81,-.06,-.96,-.03,-1.26,.18],["c",-.12,.06,-.24,.12,-.27,.12],["c",-.27,0,-.45,-.3,-.36,-.51],["c",.03,-.06,1.32,-1.32,2.91,-2.79],["l",2.88,-2.73],["c",-.03,0,-.21,.03,-.42,.06],["c",-.21,.03,-.78,.09,-1.23,.12],["c",-1.11,.12,-1.23,.15,-1.95,.27],["c",-.72,.15,-1.17,.18,-1.29,.09],["c",-.27,-.18,-.21,-.75,.12,-1.26],["c",.39,-.6,.93,-1.02,1.59,-1.2],["z"]],w:8.573,h:8.743},"+":{d:[["M",3.48,-9.3],["c",.18,-.09,.36,-.09,.54,0],["c",.18,.09,.24,.15,.33,.3],["l",.06,.15],["l",0,1.29],["l",0,1.29],["l",1.29,0],["c",1.23,0,1.29,0,1.41,.06],["c",.06,.03,.15,.09,.18,.12],["c",.12,.09,.21,.33,.21,.48],["c",0,.15,-.09,.39,-.21,.48],["c",-.03,.03,-.12,.09,-.18,.12],["c",-.12,.06,-.18,.06,-1.41,.06],["l",-1.29,0],["l",0,1.29],["c",0,1.23,0,1.29,-.06,1.41],["c",-.09,.18,-.15,.24,-.3,.33],["c",-.21,.09,-.39,.09,-.57,0],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.06,-.12,-.06,-.18,-.06,-1.41],["l",0,-1.29],["l",-1.29,0],["c",-1.23,0,-1.29,0,-1.41,-.06],["c",-.18,-.09,-.24,-.15,-.33,-.33],["c",-.09,-.18,-.09,-.36,0,-.54],["c",.09,-.18,.15,-.24,.33,-.33],["l",.15,-.06],["l",1.26,0],["l",1.29,0],["l",0,-1.29],["c",0,-1.23,0,-1.29,.06,-1.41],["c",.09,-.18,.15,-.24,.33,-.33],["z"]],w:7.507,h:7.515},",":{d:[["M",1.85,-3.36],["c",.57,-.15,1.17,.03,1.59,.45],["c",.45,.45,.6,.96,.51,1.89],["c",-.09,1.23,-.42,2.46,-.99,3.93],["c",-.3,.72,-.72,1.62,-.78,1.68],["c",-.18,.21,-.51,.18,-.66,-.06],["c",-.03,-.06,-.06,-.15,-.06,-.18],["c",0,-.06,.12,-.33,.24,-.63],["c",.84,-1.8,1.02,-2.61,.69,-3.24],["c",-.12,-.24,-.27,-.36,-.75,-.6],["c",-.36,-.15,-.42,-.21,-.6,-.39],["c",-.69,-.69,-.69,-1.71,0,-2.4],["c",.21,-.21,.51,-.39,.81,-.45],["z"]],w:3.452,h:8.143},"-":{d:[["M",.18,-5.34],["c",.09,-.06,.15,-.06,2.31,-.06],["c",2.46,0,2.37,0,2.46,.21],["c",.12,.21,.03,.42,-.15,.54],["c",-.09,.06,-.15,.06,-2.28,.06],["c",-2.16,0,-2.22,0,-2.31,-.06],["c",-.27,-.15,-.27,-.54,-.03,-.69],["z"]],w:5.001,h:.81},".":{d:[["M",1.32,-3.36],["c",1.05,-.27,2.1,.57,2.1,1.65],["c",0,1.08,-1.05,1.92,-2.1,1.65],["c",-.9,-.21,-1.5,-1.14,-1.26,-2.04],["c",.12,-.63,.63,-1.11,1.26,-1.26],["z"]],w:3.413,h:3.402},"scripts.wedge":{d:[["M",-3.66,-7.44],["c",.06,-.09,0,-.09,.81,.03],["c",1.86,.3,3.84,.3,5.73,0],["c",.78,-.12,.72,-.12,.78,-.03],["c",.15,.15,.12,.24,-.24,.6],["c",-.93,.93,-1.98,2.76,-2.67,4.62],["c",-.3,.78,-.51,1.71,-.51,2.13],["c",0,.15,0,.18,-.06,.27],["c",-.12,.09,-.24,.09,-.36,0],["c",-.06,-.09,-.06,-.12,-.06,-.27],["c",0,-.42,-.21,-1.35,-.51,-2.13],["c",-.69,-1.86,-1.74,-3.69,-2.67,-4.62],["c",-.36,-.36,-.39,-.45,-.24,-.6],["z"]],w:7.49,h:7.752},"scripts.thumb":{d:[["M",-.54,-3.69],["c",.15,-.03,.36,-.06,.51,-.06],["c",1.44,0,2.58,1.11,2.94,2.85],["c",.09,.48,.09,1.32,0,1.8],["c",-.27,1.41,-1.08,2.43,-2.16,2.73],["l",-.18,.06],["l",0,.12],["c",.03,.06,.06,.45,.09,.87],["c",.03,.57,.03,.78,0,.84],["c",-.09,.27,-.39,.48,-.66,.48],["c",-.27,0,-.57,-.21,-.66,-.48],["c",-.03,-.06,-.03,-.27,0,-.84],["c",.03,-.42,.06,-.81,.09,-.87],["l",0,-.12],["l",-.18,-.06],["c",-1.08,-.3,-1.89,-1.32,-2.16,-2.73],["c",-.09,-.48,-.09,-1.32,0,-1.8],["c",.15,-.84,.51,-1.53,1.02,-2.04],["c",.39,-.39,.84,-.63,1.35,-.75],["z"],["m",1.05,.9],["c",-.15,-.09,-.21,-.09,-.45,-.12],["c",-.15,0,-.3,.03,-.39,.03],["c",-.57,.18,-.9,.72,-1.08,1.74],["c",-.06,.48,-.06,1.8,0,2.28],["c",.15,.9,.42,1.44,.9,1.65],["c",.18,.09,.21,.09,.51,.09],["c",.3,0,.33,0,.51,-.09],["c",.48,-.21,.75,-.75,.9,-1.65],["c",.03,-.27,.03,-.54,.03,-1.14],["c",0,-.6,0,-.87,-.03,-1.14],["c",-.15,-.9,-.45,-1.44,-.9,-1.65],["z"]],w:5.955,h:9.75},"scripts.open":{d:[["M",-.54,-3.69],["c",.15,-.03,.36,-.06,.51,-.06],["c",1.44,0,2.58,1.11,2.94,2.85],["c",.09,.48,.09,1.32,0,1.8],["c",-.33,1.74,-1.47,2.85,-2.91,2.85],["c",-1.44,0,-2.58,-1.11,-2.91,-2.85],["c",-.09,-.48,-.09,-1.32,0,-1.8],["c",.15,-.84,.51,-1.53,1.02,-2.04],["c",.39,-.39,.84,-.63,1.35,-.75],["z"],["m",1.11,.9],["c",-.21,-.09,-.27,-.09,-.51,-.12],["c",-.3,0,-.42,.03,-.66,.15],["c",-.24,.12,-.51,.39,-.66,.63],["c",-.54,.93,-.63,2.64,-.21,3.81],["c",.21,.54,.51,.9,.93,1.11],["c",.21,.09,.24,.09,.54,.09],["c",.3,0,.33,0,.54,-.09],["c",.42,-.21,.72,-.57,.93,-1.11],["c",.36,-.99,.36,-2.37,0,-3.36],["c",-.21,-.54,-.51,-.9,-.9,-1.11],["z"]],w:5.955,h:7.5},"scripts.longphrase":{d:[["M",1.47,-15.09],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.54,.06,11.25],["l",0,11.25],["l",-.63,.15],["c",-.66,.18,-1.44,.39,-1.5,.39],["c",-.03,0,-.03,-3.39,-.03,-11.25],["l",0,-11.25],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:23.04},"scripts.mediumphrase":{d:[["M",1.47,-7.59],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.39,.06,7.5],["l",0,7.5],["l",-.63,.15],["c",-.66,.18,-1.44,.39,-1.5,.39],["c",-.03,0,-.03,-2.28,-.03,-7.5],["l",0,-7.5],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:15.54},"scripts.shortphrase":{d:[["M",1.47,-7.59],["c",.36,-.09,.66,-.18,.69,-.18],["c",.06,0,.06,.21,.06,3.75],["l",0,3.75],["l",-.42,.09],["c",-.57,.18,-1.65,.45,-1.71,.45],["c",-.03,0,-.03,-.72,-.03,-3.75],["l",0,-3.75],["l",.36,-.09],["c",.21,-.06,.66,-.18,1.05,-.27],["z"]],w:2.16,h:8.04},"scripts.snap":{d:[["M",4.5,-3.39],["c",.36,-.03,.96,-.03,1.35,0],["c",1.56,.15,3.15,.9,4.2,2.01],["c",.24,.27,.33,.42,.33,.6],["c",0,.27,.03,.24,-2.46,2.22],["c",-1.29,1.02,-2.4,1.86,-2.49,1.92],["c",-.18,.09,-.3,.09,-.48,0],["c",-.09,-.06,-1.2,-.9,-2.49,-1.92],["c",-2.49,-1.98,-2.46,-1.95,-2.46,-2.22],["c",0,-.18,.09,-.33,.33,-.6],["c",1.05,-1.08,2.64,-1.86,4.17,-2.01],["z"],["m",1.29,1.17],["c",-1.47,-.15,-2.97,.3,-4.14,1.2],["l",-.18,.15],["l",.06,.09],["c",.15,.12,3.63,2.85,3.66,2.85],["c",.03,0,3.51,-2.73,3.66,-2.85],["l",.06,-.09],["l",-.18,-.15],["c",-.84,-.66,-1.89,-1.08,-2.94,-1.2],["z"]],w:10.38,h:6.84}};r["noteheads.slash.whole"]={d:[["M",5,-5],["l",1,1],["l",-5,5],["l",-1,-1],["z"],["m",4,6],["l",-5,-5],["l",2,-2],["l",5,5],["z"],["m",0,-2],["l",1,1],["l",-5,5],["l",-1,-1],["z"],["m",-4,6],["l",-5,-5],["l",2,-2],["l",5,5],["z"]],w:10.81,h:15.63},r["noteheads.slash.quarter"]={d:[["M",9,-6],["l",0,4],["l",-9,9],["l",0,-4],["z"]],w:9,h:9},r["noteheads.harmonic.quarter"]={d:[["M",3.63,-4.02],["c",.09,-.06,.18,-.09,.24,-.03],["c",.03,.03,.87,.93,1.83,2.01],["c",1.5,1.65,1.8,1.98,1.8,2.04],["c",0,.06,-.3,.39,-1.8,2.04],["c",-.96,1.08,-1.8,1.98,-1.83,2.01],["c",-.06,.06,-.15,.03,-.24,-.03],["c",-.12,-.09,-3.54,-3.84,-3.6,-3.93],["c",-.03,-.03,-.03,-.09,-.03,-.15],["c",.03,-.06,3.45,-3.84,3.63,-3.96],["z"]],w:7.5,h:8.165},r["noteheads.triangle.quarter"]={d:[["M",0,4],["l",9,0],["l",-4.5,-9],["z"]],w:9,h:9};var a=function(c){for(var f=[],p=0,y=c.length;p<y;p++){f[p]=[];for(var S=0,A=c[p].length;S<A;S++)f[p][S]=c[p][S]}return f},l=function(c,f,p){for(var y=0,S=c.length;y<S;y++){var A=c[y],M,w;for(M=1,w=A.length;M<w;M++)A[M]*=M%2?f:p}},u={printSymbol:function(c,f,p,y,S){if(!r[p])return null;var A=a(r[p].d);A[0][1]+=c,A[0][2]+=f;for(var M="",w=0;w<A.length;w++)M+=A[w].join(" ");return S.path=M,y.path(S)},getPathForSymbol:function(c,f,p,y,S){if(y=y||1,S=S||1,!r[p])return null;var A=a(r[p].d);return(y!==1||S!==1)&&l(A,y,S),A[0][1]+=c,A[0][2]+=f,A},getSymbolWidth:function(c){return r[c]?r[c].w:0},symbolHeightInPitches:function(c){var f=r[c]?r[c].h:0;return f/t.STEP},getSymbolAlign:function(c){return c.substring(0,7)==="scripts"&&c!=="scripts.roll"?"center":"left"},getYCorr:function(c){switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":return-2;case"timesig.common":case"timesig.cut":return 0;case"flags.d32nd":return-1;case"flags.d64th":return-2;case"flags.u32nd":return 1;case"flags.u64th":return 3;case"rests.whole":return 1;case"rests.half":return-1;case"rests.8th":return-1;case"rests.quarter":return-1;case"rests.16th":return-1;case"rests.32nd":return-1;case"rests.64th":return-1;case"f":case"m":case"p":case"s":case"z":return-4;case"scripts.trill":case"scripts.upbow":case"scripts.downbow":return-2;case"scripts.ufermata":case"scripts.wedge":case"scripts.roll":case"scripts.shortphrase":case"scripts.longphrase":return-1;case"scripts.dfermata":return 1;default:return 0}},setSymbol:function(c,f){r[c]=f}};return g_=u,g_}var v_,T5;function oP(){if(T5)return v_;T5=1;var t=Nu(),r=Jo(),a=Ia(),l=function(c,f){var p,y=0;c.el_type="clef";var S=new t(c,0,10,"staff-extra clef",f);switch(S.isClef=!0,c.type){case"treble":p="clefs.G";break;case"tenor":p="clefs.C";break;case"alto":p="clefs.C";break;case"bass":p="clefs.F";break;case"treble+8":p="clefs.G",y=1;break;case"tenor+8":p="clefs.C",y=1;break;case"bass+8":p="clefs.F",y=1;break;case"alto+8":p="clefs.C",y=1;break;case"treble-8":p="clefs.G",y=-1;break;case"tenor-8":p="clefs.C",y=-1;break;case"bass-8":p="clefs.F",y=-1;break;case"alto-8":p="clefs.C",y=-1;break;case"none":return null;case"perc":p="clefs.perc";break;default:S.addFixed(new a("clef="+c.type,0,0,void 0,{type:"debug"}))}var A=5;if(p){var M=r.symbolHeightInPitches(p),w=u(p);if(S.addRight(new a(p,A,r.getSymbolWidth(p),c.clefPos,{top:M+c.clefPos+w,bottom:c.clefPos+w})),y!==0){var _=.6666666666666666,C=(r.getSymbolWidth(p)-r.getSymbolWidth("8")*_)/2,m=y>0?S.top+3:S.bottom-1,T=y>0?S.top+3:S.bottom-3,L=T-2;c.type==="bass-8"&&(m=3,C=0),S.addRight(new a("8",A+C,r.getSymbolWidth("8")*_,m,{scalex:_,scaley:_,top:T,bottom:L}))}}return S};function u(c){switch(c){case"clefs.G":return-5;case"clefs.C":return-4;case"clefs.F":return-4;case"clefs.perc":return-2;default:return 0}}return v_=l,v_}var m_,I5;function lP(){if(I5)return m_;I5=1;var t=Nu(),r=Jo(),a=Ia(),l=function(u,c){if(u.el_type="keySignature",!u.accidentals||u.accidentals.length===0)return null;var f=new t(u,0,10,"staff-extra key-signature",c);f.isKeySig=!0;var p=0;return u.accidentals.forEach(function(y){var S,A=0;switch(y.acc){case"sharp":S="accidentals.sharp",A=-3;break;case"natural":S="accidentals.nat";break;case"flat":S="accidentals.flat",A=-1.2;break;case"quartersharp":S="accidentals.halfsharp",A=-2.5;break;case"quarterflat":S="accidentals.halfflat",A=-1.2;break;default:S="accidentals.flat"}f.addRight(new a(S,p,r.getSymbolWidth(S),y.verticalPos,{thickness:r.symbolHeightInPitches(S),top:y.verticalPos+r.symbolHeightInPitches(S)+A,bottom:y.verticalPos+A})),p+=r.getSymbolWidth(S)+2},this),f};return m_=l,m_}var __,P5;function uP(){if(P5)return __;P5=1;var t=Jo(),r=Ia(),a=function(l,u,c,f){f||(f={});var p=f.dir!==void 0?f.dir:null,y=f.headx!==void 0?f.headx:0,S=f.extrax!==void 0?f.extrax:0,A=f.flag!==void 0?f.flag:null,M=f.dot!==void 0?f.dot:0,w=f.dotshiftx!==void 0?f.dotshiftx:0,_=f.scale!==void 0?f.scale:1,C=f.accidentalSlot!==void 0?f.accidentalSlot:[],m=f.shouldExtendStem!==void 0?f.shouldExtendStem:!1,T=f.printAccidentals!==void 0?f.printAccidentals:!0,L=c.verticalPos,N,B=0,W=0,G=0;if(u===void 0)l.addFixed(new r("pitch is undefined",0,0,0,{type:"debug"}));else if(u==="")N=new r(null,0,0,L);else{var R=y;if(c.printer_shift){var ye=c.printer_shift==="same"?1:0;R=p==="down"?-t.getSymbolWidth(u)*_+ye:t.getSymbolWidth(u)*_-ye}var q={scalex:_,scaley:_,thickness:t.symbolHeightInPitches(u)*_,name:c.name};if(N=new r(u,R,t.getSymbolWidth(u)*_,L,q),N.stemDir=p,A){var se=L+(p==="down"?-7:7)*_;m&&(p==="down"&&se>6&&(se=6),p==="up"&&se<6&&(se=6));var ve=p==="down"?y:y+N.w-.6;l.addRight(new r(A,ve,t.getSymbolWidth(A)*_,se,{scalex:_,scaley:_}))}for(W=N.w+w-2+5*M;M>0;M--){var he=1-Math.abs(L)%2;l.addRight(new r("dots.dot",N.w+w-2+5*M,t.getSymbolWidth("dots.dot"),L+he))}}if(N&&(N.highestVert=c.highestVert),T&&c.accidental){var ce;switch(c.accidental){case"quartersharp":ce="accidentals.halfsharp";break;case"dblsharp":ce="accidentals.dblsharp";break;case"sharp":ce="accidentals.sharp";break;case"quarterflat":ce="accidentals.halfflat";break;case"flat":ce="accidentals.flat";break;case"dblflat":ce="accidentals.dblflat";break;case"natural":ce="accidentals.nat"}for(var de=!1,K=S,Q=0;Q<C.length;Q++)if(L-C[Q][0]>=6){C[Q][0]=L,K=C[Q][1],de=!0;break}de===!1&&(K-=t.getSymbolWidth(ce)*_+2,C.push([L,K]),B=t.getSymbolWidth(ce)*_+2);var le=t.symbolHeightInPitches(ce);l.addExtra(new r(ce,K,t.getSymbolWidth(ce),L,{scalex:_,scaley:_,top:L+le/2,bottom:L-le/2})),G=t.getSymbolWidth(ce)/2}return{notehead:N,accidentalshiftx:B,dotshiftx:W,extraLeft:G}};return __=a,__}var b_,N5;function cP(){if(N5)return b_;N5=1;var t=Nu(),r=Jo(),a=Ia(),l=function(u,c){u.el_type="timeSignature";var f=new t(u,0,10,"staff-extra time-signature",c);if(u.type==="specified")for(var p=0,y=0;y<u.value.length;y++)if(y!==0&&(f.addRight(new a("+",p+1,r.getSymbolWidth("+"),6,{thickness:r.symbolHeightInPitches("+")})),p+=r.getSymbolWidth("+")+2),u.value[y].den){for(var S=0,A=0;A<u.value[y].num.length;A++)S+=r.getSymbolWidth(u.value[y].num[A]);var M=0;for(A=0;A<u.value[y].num.length;A++)M+=r.getSymbolWidth(u.value[y].den[A]);var w=Math.max(S,M);f.addRight(new a(u.value[y].num,p+(w-S)/2,S,8,{thickness:r.symbolHeightInPitches(u.value[y].num[0])})),f.addRight(new a(u.value[y].den,p+(w-M)/2,M,4,{thickness:r.symbolHeightInPitches(u.value[y].den[0])})),p+=w}else{for(var _=0,C=0;C<u.value[y].num.length;C++)_+=r.getSymbolWidth(u.value[y].num[C]);f.addRight(new a(u.value[y].num,p,_,6,{thickness:r.symbolHeightInPitches(u.value[y].num[0])})),p+=_}else u.type==="common_time"?f.addRight(new a("timesig.common",0,r.getSymbolWidth("timesig.common"),6,{thickness:r.symbolHeightInPitches("timesig.common")})):u.type==="cut_time"?f.addRight(new a("timesig.cut",0,r.getSymbolWidth("timesig.cut"),6,{thickness:r.symbolHeightInPitches("timesig.cut")})):u.type==="tempus_imperfectum"?f.addRight(new a("timesig.imperfectum",0,r.getSymbolWidth("timesig.imperfectum"),6,{thickness:r.symbolHeightInPitches("timesig.imperfectum")})):u.type==="tempus_imperfectum_prolatio"?f.addRight(new a("timesig.imperfectum2",0,r.getSymbolWidth("timesig.imperfectum2"),6,{thickness:r.symbolHeightInPitches("timesig.imperfectum2")})):u.type==="tempus_perfectum"?f.addRight(new a("timesig.perfectum",0,r.getSymbolWidth("timesig.perfectum"),6,{thickness:r.symbolHeightInPitches("timesig.perfectum")})):u.type==="tempus_perfectum_prolatio"?f.addRight(new a("timesig.perfectum2",0,r.getSymbolWidth("timesig.perfectum2"),6,{thickness:r.symbolHeightInPitches("timesig.perfectum2")})):console.log("time signature:",u);return f};return b_=l,b_}var y_,L5;function hP(){if(L5)return y_;L5=1;var t=function(a,l,u){this.type="DynamicDecoration",this.anchor=a,this.dec=l,u==="below"?this.volumeHeightBelow=6:this.volumeHeightAbove=6,this.pitch=void 0};return y_=t,y_}var w_,O5;function fP(){if(O5)return w_;O5=1;var t=function(a,l,u,c){this.type="CrescendoElem",this.anchor1=a,this.anchor2=l,this.dir=u,c==="above"?this.dynamicHeightAbove=6:this.dynamicHeightBelow=6,this.pitch=void 0};return w_=t,w_}var S_,D5;function dP(){if(D5)return S_;D5=1;var t=function(a,l){this.type="GlissandoElem",this.anchor1=a,this.anchor2=l};return S_=t,S_}var C_,R5;function X9(){if(R5)return C_;R5=1;var t=function(a){this.type="TieElem",this.anchor1=a.anchor1,this.anchor2=a.anchor2,a.isGrace&&(this.isGrace=!0),a.fixedY&&(this.fixedY=!0),a.stemDir&&(this.stemDir=a.stemDir),a.voiceNumber!==void 0&&(this.voiceNumber=a.voiceNumber),a.style!==void 0&&(this.dotted=!0),this.internalNotes=[]};return t.prototype.addInternalNote=function(r){this.internalNotes.push(r)},t.prototype.setEndAnchor=function(r){this.anchor2=r,this.anchor1?(this.top=Math.max(this.anchor1.pitch,this.anchor2.pitch)+4,this.bottom=Math.min(this.anchor1.pitch,this.anchor2.pitch)-4):(this.top=this.anchor2.pitch+4,this.bottom=this.anchor2.pitch-4)},t.prototype.setStartX=function(r){this.startLimitX=r},t.prototype.setEndX=function(r){this.endLimitX=r},t.prototype.setHint=function(){this.hint=!0},t.prototype.calcTieDirection=function(){if(this.isGrace)this.above=!1;else if(this.voiceNumber===0)this.above=!0;else if(this.voiceNumber>0)this.above=!1;else{var r;this.anchor1?r=this.anchor1.pitch:this.anchor2?r=this.anchor2.pitch:r=14,this.anchor1&&this.anchor1.stemDir==="down"&&this.anchor2&&this.anchor2.stemDir==="down"?this.above=!0:this.anchor1&&this.anchor1.stemDir==="up"&&this.anchor2&&this.anchor2.stemDir==="up"?this.above=!1:this.anchor1&&this.anchor2?this.above=r>=6:this.anchor1?this.above=this.anchor1.stemDir==="down":this.anchor2?this.above=this.anchor2.stemDir==="down":this.above=r>=6}},t.prototype.calcSlurDirection=function(){if(this.isGrace)this.above=!1;else if(this.voiceNumber===0)this.above=!0;else if(this.voiceNumber>0)this.above=!1;else{var r=!1;this.anchor1&&this.anchor1.stemDir==="down"&&(r=!0),this.anchor2&&this.anchor2.stemDir==="down"&&(r=!0);for(var a=0;a<this.internalNotes.length;a++){var l=this.internalNotes[a];l.stemDir==="down"&&(r=!0)}this.above=r}},t.prototype.calcX=function(r,a){this.anchor1?(this.startX=this.anchor1.x,this.anchor1.scalex<1&&(this.startX-=3)):this.startLimitX?this.startX=this.startLimitX.x+this.startLimitX.w:this.anchor2?this.startX=this.anchor2.x-20:this.startX=r,!this.anchor1&&this.dotted&&(this.startX-=3),this.anchor2?this.endX=this.anchor2.x:this.endLimitX?this.endX=this.endLimitX.x:this.endX=a},t.prototype.calcTieY=function(){this.anchor1?this.startY=this.anchor1.pitch:this.anchor2?this.startY=this.anchor2.pitch:this.startY=this.above?14:0,this.anchor2?this.endY=this.anchor2.pitch:this.anchor1?this.endY=this.anchor1.pitch:this.endY=this.above?14:0},t.prototype.calcSlurY=function(){if(this.anchor1&&this.anchor2){this.above&&this.anchor1.stemDir==="up"&&!this.fixedY?(this.startY=(this.anchor1.highestVert+this.anchor1.pitch)/2,this.startX+=this.anchor1.w/2):this.startY=this.anchor1.pitch;var r=this.anchor2.parent.beam&&this.anchor2.parent.beam.stemsUp&&this.anchor2.parent.beam.elems[0]!==this.anchor2.parent,a=(this.anchor2.highestVert+this.anchor2.pitch)/2;if(this.above&&this.anchor2.stemDir==="up"&&!this.fixedY&&!r&&a<this.startY?(this.endY=a,this.endX+=Math.round(this.anchor2.w/2)):this.endY=this.above&&r?this.anchor2.highestVert:this.anchor2.pitch,this.anchor1.scalex===1){var l=!!this.anchor1.parent.beam,u=!!this.anchor2.parent.beam;if(l){var c=this.anchor1.parent===this.anchor1.parent.beam.elems[this.anchor1.parent.beam.elems.length-1];c||(this.above?this.startY=this.anchor1.parent.fixed.t:this.startY=this.anchor1.parent.fixed.b)}if(u){var f=this.anchor2.parent===this.anchor2.parent.beam.elems[0];f||(this.above?this.endY=this.anchor2.parent.fixed.t:this.endY=this.anchor2.parent.fixed.b)}}}else this.anchor1?this.startY=this.endY=this.anchor1.pitch:this.anchor2?this.startY=this.endY=this.anchor2.pitch:(this.startY=this.above?14:0,this.endY=this.above?14:0)},t.prototype.avoidCollisionAbove=function(){if(this.above){for(var r=-50,a=0;a<this.internalNotes.length;a++)this.internalNotes[a].highestVert>r&&(r=this.internalNotes[a].highestVert);r>this.startY&&r>this.endY&&(this.startY=this.endY=r-1)}},t.prototype.getYBounds=function(){var r=10,a=1e3;this.isTie?(this.calcTieDirection(),this.calcX(r,a),this.calcTieY()):(this.calcSlurDirection(),this.calcX(r,a),this.calcSlurY());var l,u;return this.above?(u=Math.min(this.startY,this.endY),l=u+3):(l=Math.min(this.startY,this.endY),u=l-3),[l,u]},C_=t,C_}var x_,B5;function pP(){if(B5)return x_;B5=1;var t=hP(),r=fP(),a=dP(),l=Jo(),u=Ia(),c=X9(),f=function(){this.startDiminuendoX=void 0,this.startCrescendoX=void 0,this.minTop=12,this.minBottom=0},p=function(w,_,C,m,T,L,N,B,W){for(var G,R=0;R<_.length;R++){if(_[R]==="staccato"||_[R]==="tenuto"||_[R]==="accent"&&!W){var ye="scripts."+_[R];if(_[R]==="accent"&&(ye="scripts.sforzato"),G===void 0?G=N==="down"?C+2:B-2:G=N==="down"?G+2:G-2,_[R]==="accent")N==="up"?G--:G++;else switch(G){case 2:case 4:case 6:case 8:case 10:N==="up"?G--:G++;break}C>9&&G++;var q=m/2;l.getSymbolAlign(ye)!=="center"&&(q-=l.getSymbolWidth(ye)/2),T.addFixedX(new u(ye,q,l.getSymbolWidth(ye),G))}if(_[R]==="slide"&&T.heads[0]){var se=T.heads[0].pitch;se-=2;var ve=new u("",-L-15,0,se-1),he=new u("",-L-5,0,se+1);T.addFixedX(ve),T.addFixedX(he),w.addOther(new c({anchor1:ve,anchor2:he,fixedY:!0}))}}return G===void 0&&(G=C),{above:G,below:T.bottom}},y=function(w,_,C,m){for(var T=0;T<_.length;T++)switch(_[T]){case"p":case"mp":case"pp":case"ppp":case"pppp":case"f":case"ff":case"fff":case"ffff":case"sfz":case"mf":var L=new t(C,_[T],m);w.addOther(L)}},S=function(w,_,C,m,T){function L(){if(m.heads.length===0)return 10;for(var G=m.heads[0].pitch,R=1;R<m.heads.length;R++)G=Math.max(G,m.heads[R].pitch);return G}function N(){if(m.heads.length===0)return 2;for(var G=m.heads[0].pitch,R=1;R<m.heads.length;R++)G=Math.min(G,m.heads[R].pitch);return G}function B(G,R){var ye=T==="down"?N()+1:L()+9;T!=="down"&&R===1&&ye--;var q=C/2;q+=T==="down"?-5:3;for(var se=0;se<R;se++)ye-=1,m.addFixedX(new u(G,q,l.getSymbolWidth(G),ye))}for(var W=0;W<w.length;W++)switch(w[W]){case"/":B("flags.ugrace",1);break;case"//":B("flags.ugrace",2);break;case"///":B("flags.ugrace",3);break;case"////":B("flags.ugrace",4);break}},A=function(w,_,C,m,T,L,N,B){function W(he,ce){he==="above"?m.above+=ce:m.below-=ce}function G(he){var ce;return he==="above"?(ce=m.above,ce<L&&(ce=L)):(ce=m.below,ce>N&&(ce=N)),ce}function R(he,ce,de){var K=G(ce),Q=2,le=5;C.addFixedX(new u(he,_/2,0,K+Q,{type:"decoration",klass:"ornament",thickness:3,anchor:de})),W(ce,le)}function ye(he,ce){var de=_/2;l.getSymbolAlign(he)!=="center"&&(de-=l.getSymbolWidth(he)/2);var K=l.symbolHeightInPitches(he)+1,Q=G(ce);Q=ce==="above"?Q+K/2:Q-K/2,C.addFixedX(new u(he,de,l.getSymbolWidth(he),Q,{klass:"ornament",thickness:l.symbolHeightInPitches(he),position:ce})),W(ce,K)}for(var q={"+":"scripts.stopped",open:"scripts.open",snap:"scripts.snap",wedge:"scripts.wedge",thumb:"scripts.thumb",shortphrase:"scripts.shortphrase",mediumphrase:"scripts.mediumphrase",longphrase:"scripts.longphrase",trill:"scripts.trill",roll:"scripts.roll",irishroll:"scripts.roll",marcato:"scripts.umarcato",dmarcato:"scripts.dmarcato",umarcato:"scripts.umarcato",turn:"scripts.turn",uppermordent:"scripts.prall",pralltriller:"scripts.prall",mordent:"scripts.mordent",lowermordent:"scripts.mordent",downbow:"scripts.downbow",upbow:"scripts.upbow",fermata:"scripts.ufermata",invertedfermata:"scripts.dfermata",breath:",",coda:"scripts.coda",segno:"scripts.segno"},se=!1,ve=0;ve<w.length;ve++)switch(w[ve]){case"0":case"1":case"2":case"3":case"4":case"5":case"D.C.":case"D.S.":R(w[ve],T,"middle"),se=!0;break;case"D.C.alcoda":R("D.C. al coda",T,"end"),se=!0;break;case"D.C.alfine":R("D.C. al fine",T,"end"),se=!0;break;case"D.S.alcoda":R("D.S. al coda",T,"end"),se=!0;break;case"D.S.alfine":R("D.S. al fine",T,"end"),se=!0;break;case"fine":R("FINE",T,"middle"),se=!0;break;case"+":case"open":case"snap":case"wedge":case"thumb":case"shortphrase":case"mediumphrase":case"longphrase":case"trill":case"roll":case"irishroll":case"marcato":case"dmarcato":case"turn":case"uppermordent":case"pralltriller":case"mordent":case"lowermordent":case"downbow":case"upbow":case"fermata":case"breath":case"umarcato":case"coda":case"segno":ye(q[w[ve]],T),se=!0;break;case"invertedfermata":ye(q[w[ve]],"below"),se=!0;break;case"mark":C.klass="mark";break;case"accent":B&&(ye("scripts.sforzato",T),se=!0);break}return se};function M(w,_,C){for(var m=0;m<w.length;m++)switch(w[m]){case"arpeggio":for(var T=_.abcelem.minpitch-1;T<=_.abcelem.maxpitch;T+=2)_.addExtra(new u("scripts.arpeggio",-l.getSymbolWidth("scripts.arpeggio")*2-C,0,T+2,{klass:"ornament",thickness:l.symbolHeightInPitches("scripts.arpeggio")}));break}}return f.prototype.dynamicDecoration=function(w,_,C,m){for(var T,L,N,B=0;B<_.length;B++)switch(_[B]){case"diminuendo(":this.startDiminuendoX=C,T=void 0;break;case"diminuendo)":T={start:this.startDiminuendoX,stop:C},this.startDiminuendoX=void 0;break;case"crescendo(":this.startCrescendoX=C,L=void 0;break;case"crescendo)":L={start:this.startCrescendoX,stop:C},this.startCrescendoX=void 0;break;case"~(":case"glissando(":this.startGlissandoX=C,N=void 0;break;case"~)":case"glissando)":N={start:this.startGlissandoX,stop:C},this.startGlissandoX=void 0;break}T&&w.addOther(new r(T.start,T.stop,">",m)),L&&w.addOther(new r(L.start,L.stop,"<",m)),N&&w.addOther(new a(N.start,N.stop))},f.prototype.createDecoration=function(w,_,C,m,T,L,N,B,W,G,R){W||(W={ornamentPosition:"above",volumePosition:G?"above":"below",dynamicPosition:G?"above":"below"}),y(w,_,T,W.volumePosition),this.dynamicDecoration(w,_,T,W.dynamicPosition),S(_,C,m,T,N);var ye=p(w,_,C,m,T,L,N,B,R);ye.above=Math.max(ye.above,this.minTop),ye.below=Math.min(ye.below,B),A(_,m,T,ye,W.ornamentPosition,this.minTop,B,R),M(_,T,L)},x_=f,x_}var k_,F5;function gP(){if(F5)return k_;F5=1;var t=function(a,l,u){this.type="EndingElem",this.text=a,this.anchor1=l,this.anchor2=u,this.endingHeightAbove=5,this.pitch=void 0};return k_=t,k_}var M_,q5;function vP(){if(q5)return M_;q5=1;var t=function(r){for(var a=0,l=0;l<r.voices.length;l++){var u=r.voices[l].staff;r.voices[l].duplicate||(a+=u.top,a+=-u.bottom)}return a};return M_=t,M_}var E_,z5;function mP(){if(z5)return E_;z5=1;var t=vP(),r=function(a){this.getTextSize=a,this.voices=[],this.staffs=[],this.brace=void 0,this.bracket=void 0};return r.prototype.setLimit=function(a,l){l.specialY[a]&&(l.staff.specialY[a]?l.staff.specialY[a]=Math.max(l.staff.specialY[a],l.specialY[a]):l.staff.specialY[a]=l.specialY[a])},r.prototype.addVoice=function(a,l,u){var c=this.voices.length;this.voices[c]=a,this.staffs[l]?this.staffs[l].voices.push(c):this.staffs[this.staffs.length]={top:10,bottom:2,lines:u,voices:[c],specialY:{tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0}},a.staff=this.staffs[l]},r.prototype.setHeight=function(){this.height=t(this)},r.prototype.setWidth=function(a){this.w=a;for(var l=0;l<this.voices.length;l++)this.voices[l].setWidth(a)},r.prototype.setStaffLimits=function(a){a.staff.top=Math.max(a.staff.top,a.top),a.staff.bottom=Math.min(a.staff.bottom,a.bottom),this.setLimit("tempoHeightAbove",a),this.setLimit("partHeightAbove",a),this.setLimit("volumeHeightAbove",a),this.setLimit("dynamicHeightAbove",a),this.setLimit("endingHeightAbove",a),this.setLimit("chordHeightAbove",a),this.setLimit("lyricHeightAbove",a),this.setLimit("lyricHeightBelow",a),this.setLimit("chordHeightBelow",a),this.setLimit("volumeHeightBelow",a),this.setLimit("dynamicHeightBelow",a)},E_=r,E_}var A_,H5;function _P(){if(H5)return A_;H5=1;var t=Nu(),r=Ia(),a=function(u,c,f){this.type="TempoElement",this.tempo=u,this.tempo.type="tempo",this.tuneNumber=c,this.totalHeightInPitches=6,this.tempoHeightAbove=this.totalHeightInPitches,this.pitch=void 0,this.tempo.duration&&!this.tempo.suppressBpm&&(this.note=this.createNote(f,u,c))};return a.prototype.setX=function(l){this.x=l},a.prototype.createNote=function(l,u,c){var f=.75,p=u.duration[0],y=new t(u,p,1,"tempo",c),S,A,M;p<=1/32?(M="noteheads.quarter",A="flags.u32nd",S=0):p<=1/16?(M="noteheads.quarter",A="flags.u16th",S=0):p<=3/32?(M="noteheads.quarter",A="flags.u16nd",S=1):p<=1/8?(M="noteheads.quarter",A="flags.u8th",S=0):p<=3/16?(M="noteheads.quarter",A="flags.u8th",S=1):p<=1/4?(M="noteheads.quarter",S=0):p<=3/8?(M="noteheads.quarter",S=1):p<=1/2?(M="noteheads.half",S=0):p<=3/4?(M="noteheads.half",S=1):p<=1?(M="noteheads.whole",S=0):p<=1.5?(M="noteheads.whole",S=1):p<=2?(M="noteheads.dbl",S=0):(M="noteheads.dbl",S=1);var w=l(y,M,{verticalPos:0},{dir:"up",flag:A,dot:S,scale:f}),_=w.notehead;y.addHead(_);var C;if(M!=="noteheads.whole"&&M!=="noteheads.dbl"){var m=.3333333333333333*f,T=5*f,L=_.dx+_.w,N=-.6;C=new r(null,L,0,m,{type:"stem",pitch2:T,linewidth:N}),y.addRight(C)}return y},A_=a,A_}var T_,V5;function bP(){if(V5)return T_;V5=1;var t=function(a,l,u){this.type="TripletElem",this.anchor1=l,this.number=a,this.durationClass=("d"+Math.round(l.parent.durationClass*1e3)/1e3).replace(/\./,"-"),this.middleElems=[],this.flatBeams=u.flatBeams};return t.prototype.isClosed=function(){return!!this.anchor2},t.prototype.middleNote=function(r){this.middleElems.push(r)},t.prototype.setCloseAnchor=function(r){this.anchor2=r,(!this.anchor1.parent.beam||this.anchor1.stemDir==="up")&&(this.endingHeightAbove=4)},T_=t,T_}var I_,U5;function yP(){if(U5)return I_;U5=1;function t(a){switch(a){case"B#":return"H#";case"B♯":return"H♯";case"B":return"H";case"Bb":return"B";case"B♭":return"B"}return a}function r(a,l,u){var c=a.split(`
|
|
166
|
+
`);for(let f=0;f<c.length;f++){let y=c[f].match(/^([ABCDEFG][♯♭]?)?([^\/]+)?(\/([ABCDEFG][#b♯♭]?))?/);if(!y)continue;let S=y[1]||"",A=y[2]||"",M=y[4]||"";u&&(S=t(S),M=t(M));const w=l?"":"",_=M?"/"+M:"";c[f]=[S,A,_].join(w)}return c.join(`
|
|
167
|
+
`)}return I_=r,I_}var P_,$5;function wP(){if($5)return P_;$5=1;var t=Ia(),r=ss();const a=yP();var l=function(c,f,p,y,S,A,M,w){for(var _=0;_<p.chord.length;_++){var C=p.chord[_].position,m=p.chord[_].rel_position,T=C==="left"||C==="right"||C==="below"||C==="above"||!!m,L,N;T?(L="annotationfont",N="abcjs-annotation"):(L="gchordfont",N="abcjs-chord");var B=c.attr(L,N),W=p.chord[_].name,G;if(typeof W=="string")G=u(W,C,m,T,L,N,B,c,f,p,y,S,A,M,w),y=G.roomTaken,S=G.roomTakenRight;else for(var R=0;R<W.length;R++)G=u(W[R].text,C,m,T,L,N,B,c,f,p,y,S,A,M,w),y=G.roomTaken,S=G.roomTakenRight}return{roomTaken:y,roomTakenRight:S}};function u(c,f,p,y,S,A,M,w,_,C,m,T,L,N,B){for(var W=c.split(`
|
|
168
|
+
`),G=W.length-1;G>=0;G--){var R=W[G],ye=0,q;y||(R=a(R,N,B));var se=w.calc(R,S,A),ve=se.width,he=se.height/r.STEP;switch(f){case"left":m+=ve+7,ye=-m,q=C.averagepitch,_.addExtra(new t(R,ye,ve+4,q,{type:"text",height:he,dim:M,position:"left"}));break;case"right":T+=4,ye=T,q=C.averagepitch,_.addRight(new t(R,ye,ve+4,q,{type:"text",height:he,dim:M,position:"right"}));break;case"below":_.addRight(new t(R,0,0,void 0,{type:"text",position:"below",height:he,dim:M,realWidth:ve}));break;case"above":_.addRight(new t(R,0,0,void 0,{type:"text",position:"above",height:he,dim:M,realWidth:ve}));break;default:if(p){var ce=p.y+3*r.STEP;_.addRight(new t(R,ye+p.x,0,C.minpitch+ce/r.STEP,{position:"relative",type:"text",height:he,dim:M}))}else{var de="above";C.positioning&&C.positioning.chordPosition&&(de=C.positioning.chordPosition),de!=="hidden"&&_.addCentered(new t(R,L/2,ve,void 0,{type:"chord",position:de,height:he,dim:M,realWidth:ve}))}}}return{roomTaken:m,roomTakenRight:T}}return P_=l,P_}var N_,W5;function SP(){if(W5)return N_;W5=1;var t=Nu(),r=sP(),a=aP(),l=oP(),u=lP(),c=uP(),f=cP(),p=pP(),y=gP(),S=Jo(),A=Ia(),M=ss(),w=mP(),_=_P(),C=X9(),m=bP(),T=U9(),L=wP(),N=z9(),B=Bo(),W=function(K){var Q=0;return K.duration&&(Q=K.duration),Q},G=!1,R={rest:{0:"rests.whole",1:"rests.half",2:"rests.quarter",3:"rests.8th",4:"rests.16th",5:"rests.32nd",6:"rests.64th",7:"rests.128th",multi:"rests.multimeasure"},note:{"-1":"noteheads.dbl",0:"noteheads.whole",1:"noteheads.half",2:"noteheads.quarter",3:"noteheads.quarter",4:"noteheads.quarter",5:"noteheads.quarter",6:"noteheads.quarter",7:"noteheads.quarter",nostem:"noteheads.quarter"},rhythm:{"-1":"noteheads.slash.whole",0:"noteheads.slash.whole",1:"noteheads.slash.whole",2:"noteheads.slash.quarter",3:"noteheads.slash.quarter",4:"noteheads.slash.quarter",5:"noteheads.slash.quarter",6:"noteheads.slash.quarter",7:"noteheads.slash.quarter",nostem:"noteheads.slash.nostem"},x:{"-1":"noteheads.indeterminate",0:"noteheads.indeterminate",1:"noteheads.indeterminate",2:"noteheads.indeterminate",3:"noteheads.indeterminate",4:"noteheads.indeterminate",5:"noteheads.indeterminate",6:"noteheads.indeterminate",7:"noteheads.indeterminate",nostem:"noteheads.indeterminate"},harmonic:{"-1":"noteheads.harmonic.quarter",0:"noteheads.harmonic.quarter",1:"noteheads.harmonic.quarter",2:"noteheads.harmonic.quarter",3:"noteheads.harmonic.quarter",4:"noteheads.harmonic.quarter",5:"noteheads.harmonic.quarter",6:"noteheads.harmonic.quarter",7:"noteheads.harmonic.quarter",nostem:"noteheads.harmonic.quarter"},triangle:{"-1":"noteheads.triangle.quarter",0:"noteheads.triangle.quarter",1:"noteheads.triangle.quarter",2:"noteheads.triangle.quarter",3:"noteheads.triangle.quarter",4:"noteheads.triangle.quarter",5:"noteheads.triangle.quarter",6:"noteheads.triangle.quarter",7:"noteheads.triangle.quarter",nostem:"noteheads.triangle.quarter"},uflags:{3:"flags.u8th",4:"flags.u16th",5:"flags.u32nd",6:"flags.u64th"},dflags:{3:"flags.d8th",4:"flags.d16th",5:"flags.d32nd",6:"flags.d64th"}},ye=function(K,Q,le){this.decoration=new p,this.getTextSize=K,this.tuneNumber=Q,this.isBagpipes=le.bagpipes,this.flatBeams=le.flatbeams,this.graceSlurs=le.graceSlurs,this.percmap=le.percmap,this.initialClef=le.initialClef,this.jazzchords=!!le.jazzchords,this.accentAbove=!!le.accentAbove,this.germanAlphabet=!!le.germanAlphabet,this.reset()};ye.prototype.reset=function(){this.slurs={},this.ties=[],this.voiceScale=1,this.voiceColor=void 0,this.slursbyvoice={},this.tiesbyvoice={},this.endingsbyvoice={},this.scaleByVoice={},this.colorByVoice={},this.tripletmultiplier=1,this.abcline=void 0,this.accidentalSlot=void 0,this.accidentalshiftx=void 0,this.dotshiftx=void 0,this.hasVocals=!1,this.minY=void 0,this.partstartelem=void 0,this.startlimitelem=void 0,this.stemdir=void 0},ye.prototype.setStemHeight=function(K){this.stemHeight=Math.round(K*10/M.STEP)/10},ye.prototype.getCurrentVoiceId=function(K,Q){return"s"+K+"v"+Q},ye.prototype.pushCrossLineElems=function(K,Q){this.slursbyvoice[this.getCurrentVoiceId(K,Q)]=this.slurs,this.tiesbyvoice[this.getCurrentVoiceId(K,Q)]=this.ties,this.endingsbyvoice[this.getCurrentVoiceId(K,Q)]=this.partstartelem,this.scaleByVoice[this.getCurrentVoiceId(K,Q)]=this.voiceScale,this.voiceColor&&(this.colorByVoice[this.getCurrentVoiceId(K,Q)]=this.voiceColor)},ye.prototype.popCrossLineElems=function(K,Q){this.slurs=this.slursbyvoice[this.getCurrentVoiceId(K,Q)]||{},this.ties=this.tiesbyvoice[this.getCurrentVoiceId(K,Q)]||[],this.partstartelem=this.endingsbyvoice[this.getCurrentVoiceId(K,Q)],this.voiceScale=this.scaleByVoice[this.getCurrentVoiceId(K,Q)],this.voiceScale===void 0&&(this.voiceScale=1),this.voiceColor=this.colorByVoice[this.getCurrentVoiceId(K,Q)]},ye.prototype.containsLyrics=function(K){for(var Q=0;Q<K.length;Q++)for(var le=0;le<K[Q].voices.length;le++)for(var Ee=0;Ee<K[Q].voices[le].length;Ee++){var Me=K[Q].voices[le][Ee];if(Me.lyric){(!Me.positioning||Me.positioning.vocalPosition==="below")&&(this.hasVocals=!0);return}}},ye.prototype.createABCLine=function(K,Q,le){this.minY=2,this.containsLyrics(K);var Ee=new w(this.getTextSize);this.tempoSet=!1;for(var Me=0;Me<K.length;Me++)G&&this.restoreState(),G=!1,this.createABCStaff(Ee,K[Me],Q,Me,le);return Ee},ye.prototype.createABCStaff=function(K,Q,le,Ee,Me){K.getTextSize.updateFonts(Q);for(var H=0;H<Q.voices.length;H++){var Y=new T(H,Q.voices.length);H===0?(Y.barfrom=Q.connectBarLines==="start"||Q.connectBarLines==="continue",Y.barto=Q.connectBarLines==="continue"||Q.connectBarLines==="end"):Y.duplicate=!0,Q.title&&Q.title[H]&&(Y.header=Q.title[H].replace(/\\n/g,`
|
|
169
|
+
`),Y.headerPosition=6+K.getTextSize.baselineToCenter(Y.header,"voicefont","staff-extra voice-name",H,Q.voices.length)/M.STEP),Q.clef&&Q.clef.type==="perc"&&(Y.isPercussion=!0);var X=(!this.initialClef||Me===0)&&l(Q.clef,this.tuneNumber);X&&(H===0&&Q.barNumber&&this.addMeasureNumber(Q.barNumber,X),Y.addChild(X),this.startlimitelem=X);var xe=u(Q.key,this.tuneNumber);if(xe&&(Y.addChild(xe),this.startlimitelem=xe),Q.meter){Q.meter.type==="specified"?this.measureLength=Q.meter.value[0].num/Q.meter.value[0].den:this.measureLength=1;var De=f(Q.meter,this.tuneNumber);Y.addChild(De),this.startlimitelem=De}Y.duplicate&&(Y.children=[]);var $e=Q.clef.stafflines||Q.clef.stafflines===0?Q.clef.stafflines:5;K.addVoice(Y,Ee,$e);var Re=$e===1;this.createABCVoice(Q.voices[H],le,Ee,H,Re,Y),K.setStaffLimits(Y),H===0&&(Q.brace==="start"||!K.brace&&Q.brace?(K.brace||(K.brace=[]),K.brace.push(new a(Y,"brace"))):Q.brace==="end"&&K.brace?K.brace[K.brace.length-1].setBottomStaff(Y):Q.brace==="continue"&&K.brace&&K.brace[K.brace.length-1].continuing(Y),Q.bracket==="start"||!K.bracket&&Q.bracket?(K.bracket||(K.bracket=[]),K.bracket.push(new a(Y,"bracket"))):Q.bracket==="end"&&K.bracket?K.bracket[K.bracket.length-1].setBottomStaff(Y):Q.bracket==="continue"&&K.bracket&&K.bracket[K.bracket.length-1].continuing(Y))}};function q(K,Q){var le=K[Q];if(le.el_type!=="note"||!le.startBeam||le.endBeam)return{count:1,elem:le};for(var Ee=[];Q<K.length&&K[Q].el_type==="note"&&(Ee.push(K[Q]),!K[Q].endBeam);)Q++;return{count:Ee.length,elem:Ee}}ye.prototype.createABCVoice=function(K,Q,le,Ee,Me,H){this.popCrossLineElems(le,Ee),this.stemdir=this.isBagpipes?"down":null,this.abcline=K,this.partstartelem&&(this.partstartelem=new y("",null,null),H.addOther(this.partstartelem));var Y=H.voicetotal<2?-1:H.voicenumber;for(var X in this.slurs)this.slurs.hasOwnProperty(X)&&(this.slurs[X]=new C({force:this.slurs[X].force,voiceNumber:Y,stemDir:this.slurs[X].stemDir,style:this.slurs[X].dotted}),G&&this.slurs[X].setHint(),H.addOther(this.slurs[X]));for(var xe=0;xe<this.ties.length;xe++)this.ties[xe]=new C({force:this.ties[xe].force,stemDir:this.ties[xe].stemDir,voiceNumber:Y,style:this.ties[xe].dotted}),G&&this.ties[xe].setHint(),H.addOther(this.ties[xe]);for(var De=0;De<this.abcline.length;De++)se(this.abcline[De]),this.minY=Math.min(this.abcline[De].minpitch,this.minY);for(var $e=le===0,Re=0;Re<this.abcline.length;){var ut=q(this.abcline,Re),Lt=this.createABCElement($e,Me,H,ut.elem);if(Lt)for(xe=0;xe<Lt.length;xe++){if(!this.tempoSet&&Q&&!Q.suppress){this.tempoSet=!0;var it=new t(Q,0,0,"tempo",this.tuneNumber,{});it.addFixedX(new _(Q,this.tuneNumber,c)),H.addChild(it)}H.addChild(Lt[xe])}Re+=ut.count}this.pushCrossLineElems(le,Ee)},ye.prototype.saveState=function(){this.tiesSave=B.cloneArray(this.ties),this.slursSave=B.cloneHashOfHash(this.slurs),this.slursbyvoiceSave=B.cloneHashOfHash(this.slursbyvoice),this.tiesbyvoiceSave=B.cloneHashOfArrayOfHash(this.tiesbyvoice)},ye.prototype.restoreState=function(){this.ties=B.cloneArray(this.tiesSave),this.slurs=B.cloneHashOfHash(this.slursSave),this.slursbyvoice=B.cloneHashOfHash(this.slursbyvoiceSave),this.tiesbyvoice=B.cloneHashOfArrayOfHash(this.tiesbyvoiceSave)},ye.prototype.createABCElement=function(K,Q,le,Ee){var Me=[];switch(Ee.el_type){case void 0:Me=this.createBeam(Q,le,Ee);break;case"note":Me[0]=this.createNote(Ee,!1,Q,le),this.triplet&&this.triplet.isClosed()&&(le.addOther(this.triplet),this.triplet=null,this.tripletmultiplier=1);break;case"bar":Me[0]=this.createBarLine(le,Ee,K),le.duplicate&&Me.length>0&&(Me[0].invisible=!0);break;case"meter":Me[0]=f(Ee,this.tuneNumber),this.startlimitelem=Me[0],le.duplicate&&Me.length>0&&(Me[0].invisible=!0);break;case"clef":if(Me[0]=l(Ee,this.tuneNumber),!Me[0])return null;le.duplicate&&Me.length>0&&(Me[0].invisible=!0);break;case"key":var H=u(Ee,this.tuneNumber);H&&(Me[0]=H,this.startlimitelem=Me[0]),le.duplicate&&Me.length>0&&(Me[0].invisible=!0);break;case"stem":this.stemdir=Ee.direction==="auto"?void 0:Ee.direction;break;case"part":var Y=new t(Ee,0,0,"part",this.tuneNumber),X=this.getTextSize.calc(Ee.title,"partsfont","part");Y.addFixedX(new A(Ee.title,0,0,void 0,{type:"part",height:X.height/M.STEP})),Me[0]=Y;break;case"tempo":var xe=new t(Ee,0,0,"tempo",this.tuneNumber);xe.addFixedX(new _(Ee,this.tuneNumber,c)),Me[0]=xe;break;case"style":Ee.head==="normal"?delete this.style:this.style=Ee.head;break;case"hint":G=!0,this.saveState();break;case"midi":break;case"scale":this.voiceScale=Ee.size;break;case"color":this.voiceColor=Ee.color,le.color=this.voiceColor;break;default:var De=new t(Ee,0,0,"unsupported",this.tuneNumber);De.addFixed(new A("element type "+Ee.el_type,0,0,void 0,{type:"debug"})),Me[0]=De}return Me};function se(K){if(K.pitches){ve(K);for(var Q=0,le=0;le<K.pitches.length;le++)Q+=K.pitches[le].verticalPos;K.averagepitch=Q/K.pitches.length,K.minpitch=K.pitches[0].verticalPos,K.maxpitch=K.pitches[K.pitches.length-1].verticalPos}}ye.prototype.createBeam=function(K,Q,le){var Ee=[],Me=new r(this.stemHeight*this.voiceScale,this.stemdir,this.flatBeams,le[0]);G&&Me.setHint();for(var H=0;H<le.length;H++)Me.runningDirection(le[H]);Me.setStemDirection();var Y=this.stemdir;for(this.stemdir=Me.stemsUp?"up":"down",H=0;H<le.length;H++){var X=le[H],xe=this.createNote(X,!0,K,Q);Ee.push(xe),Me.add(xe),this.triplet&&this.triplet.isClosed()&&(Q.addOther(this.triplet),this.triplet=null,this.tripletmultiplier=1)}return Me.calcDir(),Q.addBeam(Me),this.stemdir=Y,Ee};var ve=function(K){var Q;do{Q=!0;for(var le=0;le<K.pitches.length-1;le++)if(K.pitches[le].pitch>K.pitches[le+1].pitch){Q=!1;var Ee=K.pitches[le];K.pitches[le]=K.pitches[le+1],K.pitches[le+1]=Ee}}while(!Q)},he=function(K,Q,le,Ee,Me,H,Y,X,xe){for(var De=le;De>11;De--)De%2===0&&!Ee&&K.addFixed(new A(null,X,(Me+4)*xe,De,{type:"ledger"}));for(De=Q;De<1;De++)De%2===0&&!Ee&&K.addFixed(new A(null,X,(Me+4)*xe,De,{type:"ledger"}));for(De=0;De<H.length;De++){var $e=Me;Y==="down"&&($e=-$e),K.addFixed(new A(null,$e+X,(Me+4)*xe,H[De],{type:"ledger"}))}};ye.prototype.addGraceNotes=function(K,Q,le,Ee,Me,H,Y){var X=.6,xe=3.5/5;Me=Math.round(Me*xe);var De=null,$e;K.gracenotes.length>1&&(De=new r(Me,"grace",H),G&&De.setHint(),De.mainNote=le);var Re,ut=[];for(Re=K.gracenotes.length-1;Re>=0;Re--)Y+=10,ut[Re]=Y,K.gracenotes[Re].accidental&&(Y+=7);for(Re=0;Re<K.gracenotes.length;Re++){var Lt=K.gracenotes[Re].verticalPos;$e=De?null:R.uflags[H?5:3];var it=[],Ct=c(le,"noteheads.quarter",K.gracenotes[Re],{dir:"up",headx:-ut[Re],extrax:-ut[Re],flag:$e,scale:X*this.voiceScale,accidentalSlot:it});Ct.notehead.highestVert=Ct.notehead.pitch+Me;var It=Ct.notehead;if(this.addSlursAndTies(le,K.gracenotes[Re],It,Q,"up",!0),le.addExtra(It),K.gracenotes[Re].acciaccatura){var at=K.gracenotes[Re].verticalPos+7*X,Gt=De?5:6;le.addRight(new A("flags.ugrace",-ut[Re]+Gt,0,at,{scalex:X,scaley:X}))}if(De){var Dt=K.gracenotes[Re].duration/2;H&&(Dt/=2);var ct={heads:[It],abcelem:{averagepitch:Lt,minpitch:Lt,maxpitch:Lt,duration:Dt}};De.add(ct)}else{var gr=Lt+.3333333333333333*X,vr=Lt+7*X,er=It.dx+It.w,Cr=-.6;le.addExtra(new A(null,er,0,gr,{type:"stem",pitch2:vr,linewidth:Cr}))}he(le,Lt,Lt,!1,S.getSymbolWidth("noteheads.quarter"),[],!0,It.dx-1,.6);var Wr=K.rest&&(K.rest.type==="spacer"||K.rest.type==="invisible");Re===0&&!H&&this.graceSlurs&&!Wr&&Q.addOther(new C({anchor1:It,anchor2:Ee,isGrace:!0}))}return De&&(De.calcDir(),Q.addBeam(De)),Y};function ce(K,Q,le,Ee,Me,H,Y,X,xe){var De,$e=7,Re,ut,Lt;switch(Me&&(H==="down"&&($e=3),H==="up"&&($e=11)),Y&&(le<.5||le<1?$e=7:$e=5),Q.rest.type){case"whole":De=R.rest[0],Q.averagepitch=$e,Q.minpitch=$e,Q.maxpitch=$e,Ee=0;break;case"rest":Q.style==="rhythm"?De=R.rhythm[-X]:De=R.rest[-X],Q.averagepitch=$e,Q.minpitch=$e,Q.maxpitch=$e;break;case"invisible":case"invisible-multimeasure":case"spacer":De="",Q.averagepitch=$e,Q.minpitch=$e,Q.maxpitch=$e;break;case"multimeasure":De=R.rest.multi,Q.averagepitch=$e,Q.minpitch=$e,Q.maxpitch=$e,Ee=0;var it=S.getSymbolWidth(De);K.addHead(new A(De,it,it*2,7));var Ct=new A(""+Q.rest.text,it,it,16,{type:"multimeasure-text"});K.addExtra(Ct)}if(Q.rest.type.indexOf("multimeasure")<0&&Q.rest.type!=="invisible"){var It=c(K,De,{verticalPos:$e},{dot:Ee,scale:xe});Re=It.notehead,Re&&(K.addHead(Re),ut=It.accidentalshiftx,Lt=It.dotshiftx)}return{noteHead:Re,roomTaken:ut,roomTakenRight:Lt}}function de(K,Q){for(var le=0;le<K.length;le++)if(JSON.stringify(K[le])===JSON.stringify(Q))return;K.push(Q)}return ye.prototype.addNoteToAbcElement=function(K,Q,le,Ee,Me,H,Y,X,xe){var De=0,$e,Re=0,ut=0,Lt,it,Ct=[],It=[],at=0,Gt=Q.averagepitch>=6?"down":"up";Ee&&(Gt=Ee),Me=Q.style?Q.style:Me,(!Me||Me==="normal")&&(Me="note");var Dt;H?Dt=R[Me].nostem:Dt=R[Me][-Y],Dt||console.log("noteSymbol:",Me,Y,H);var ct;for(ct=Gt==="down"?Q.pitches.length-2:1;Gt==="down"?ct>=0:ct<Q.pitches.length;ct=Gt==="down"?ct-1:ct+1){var gr=Q.pitches[Gt==="down"?ct+1:ct-1],vr=Q.pitches[ct],er=Gt==="down"?gr.pitch-vr.pitch:vr.pitch-gr.pitch;er<=1&&!gr.printer_shift&&(vr.printer_shift=er?"different":"same",(vr.verticalPos>11||vr.verticalPos<1)&&Ct.push(vr.verticalPos-vr.verticalPos%2),Gt==="down"?Re=S.getSymbolWidth(Dt)+2:De=S.getSymbolWidth(Dt)+2)}var Cr=Q.pitches.length;for(ct=0;ct<Q.pitches.length;ct++){if(!X){var Wr;Gt==="down"&&ct!==0||Gt==="up"&&ct!==Cr-1?Wr=null:Wr=R[Gt==="down"?"dflags":"uflags"][-Y]}var kr;if(Q.pitches[ct].style)kr=R[Q.pitches[ct].style][-Y];else if(xe.isPercussion&&this.percmap){kr=Dt;var Ue=this.percmap[N(Q.pitches[ct])];Ue&&Ue.noteHead&&R[Ue.noteHead]&&(kr=R[Ue.noteHead][-Y])}else kr=Dt;Q.pitches[ct].highestVert=Q.pitches[ct].verticalPos;var Je=(Ee==="up"||Gt==="up")&&ct===0,Ye=(Ee==="down"||Gt==="down")&&ct===Cr-1;if(Je||Ye){if((Q.startSlur||Cr===1)&&(Q.pitches[ct].highestVert=Q.pitches[Cr-1].verticalPos,W(Q)<1&&(Ee==="up"||Gt==="up")&&(Q.pitches[ct].highestVert+=6)),Q.startSlur)for(Q.pitches[ct].startSlur||(Q.pitches[ct].startSlur=[]),it=0;it<Q.startSlur.length;it++)de(Q.pitches[ct].startSlur,Q.startSlur[it]);if(Q.endSlur)for(Q.pitches[ct].highestVert=Q.pitches[Cr-1].verticalPos,W(Q)<1&&(Ee==="up"||Gt==="up")&&(Q.pitches[ct].highestVert+=6),Q.pitches[ct].endSlur||(Q.pitches[ct].endSlur=[]),it=0;it<Q.endSlur.length;it++)de(Q.pitches[ct].endSlur,Q.endSlur[it])}var Qe=!X&&Y<=-1,rt=c(K,kr,Q.pitches[ct],{dir:Gt,extrax:-Re,flag:Wr,dot:le,dotshiftx:De,scale:this.voiceScale,accidentalSlot:It,shouldExtendStem:!Ee,printAccidentals:!xe.isPercussion});at=Math.max(S.getSymbolWidth(kr),at),K.extraw-=rt.extraLeft,$e=rt.notehead,$e&&(this.addSlursAndTies(K,Q.pitches[ct],$e,xe,Qe?Gt:null,!1),Q.gracenotes&&Q.gracenotes.length>0&&($e.bottom=$e.bottom-1),K.addHead($e)),Re+=rt.accidentalshiftx,ut=Math.max(ut,rt.dotshiftx)}if(Qe){var o=Math.round(70*this.voiceScale)/10,h=Gt==="down"?Q.minpitch-o:Q.minpitch+1/3;h>6&&!Ee&&(h=6);var b=Gt==="down"?Q.maxpitch-1/3:Q.maxpitch+o;b<6&&!Ee&&(b=6);var x=Gt==="down"||K.heads.length===0?0:K.heads[0].w,E=Gt==="down"?1:-1;$e&&$e.c==="noteheads.slash.quarter"&&(Gt==="down"?b-=1:h+=1),$e&&$e.c==="noteheads.triangle.quarter"&&(Gt==="down"?b-=.7:h-=1.2),K.addRight(new A(null,x,0,h,{type:"stem",pitch2:b,linewidth:E,bottom:h-1})),Lt=Math.min(h,b)}return{noteHead:$e,roomTaken:Re,roomTakenRight:ut,min:Lt,additionalLedgers:Ct,dir:Gt,symbolWidth:at}},ye.prototype.addLyric=function(K,Q){var le="";Q.lyric.forEach(function(H){var Y=H.divider===" "?"":H.divider;le+=H.syllable+Y+`
|
|
170
|
+
`});var Ee=this.getTextSize.calc(le,"vocalfont","lyric"),Me=Q.positioning?Q.positioning.vocalPosition:"below";K.addCentered(new A(le,0,Ee.width,void 0,{type:"lyric",position:Me,height:Ee.height/M.STEP,dim:this.getTextSize.attr("vocalfont","lyric")}))},ye.prototype.createNote=function(K,Q,le,Ee){var Me=null,H=0,Y=0,X=0,xe=[],De,$e=W(K),Re=!1;$e===0&&(Re=!0,$e=.25,Q=!0);for(var ut=Math.floor(Math.log($e)/Math.log(2)),Lt=0,it=Math.pow(2,ut),Ct=it/2;it<$e;Lt++,it+=Ct,Ct/=2);K.startTriplet&&(this.tripletmultiplier=K.tripletMultiplier);var It=$e*this.tripletmultiplier;K.rest&&K.rest.type==="multimeasure"&&(It=1),K.rest&&K.rest.type==="invisible-multimeasure"&&(It=this.measureLength*K.rest.text);var at=K.rest?"rest":"note",Gt=new t(K,It,1,at,this.tuneNumber,{durationClassOveride:K.duration*this.tripletmultiplier});if(G&&Gt.setHint(),K.rest){this.measureLength===$e&&K.rest.type!=="invisible"&&K.rest.type!=="spacer"&&K.rest.type.indexOf("multimeasure")<0&&(K.rest.type="whole");var Dt=ce(Gt,K,$e,Lt,Ee.voicetotal>1,this.stemdir,le,ut,this.voiceScale);Me=Dt.noteHead,H=Dt.roomTaken,Y=Dt.roomTakenRight}else{var ct=this.addNoteToAbcElement(Gt,K,Lt,this.stemdir,this.style,Re,ut,Q,Ee);ct.min!==void 0&&(this.minY=Math.min(ct.min,this.minY)),Me=ct.noteHead,H=ct.roomTaken,Y=ct.roomTakenRight,xe=ct.additionalLedgers,De=ct.dir,X=ct.symbolWidth}if(K.lyric!==void 0&&this.addLyric(Gt,K),K.gracenotes!==void 0&&(H+=this.addGraceNotes(K,Ee,Gt,Me,this.stemHeight*this.voiceScale,this.isBagpipes,H)),K.decoration){var gr=Q&&De!=="up"?Math.min(-3,Gt.bottom-6):Gt.bottom;this.decoration.createDecoration(Ee,K.decoration,Gt.top,Me?Me.w:0,Gt,H,De,gr,K.positioning,this.hasVocals,this.accentAbove)}if(K.barNumber&&Gt.addFixed(new A(K.barNumber,-10,0,0,{type:"barNumber"})),he(Gt,K.minpitch,K.maxpitch,K.rest,X,xe,De,-2,1),K.chord!==void 0){var vr=L(this.getTextSize,Gt,K,H,Y,X,this.jazzchords,this.germanAlphabet);H=vr.roomTaken,Y=vr.roomTakenRight}return K.startTriplet&&(this.triplet=new m(K.startTriplet,Me,{flatBeams:this.flatBeams})),K.endTriplet&&this.triplet&&this.triplet.setCloseAnchor(Me),this.triplet&&!K.startTriplet&&!K.endTriplet&&!(K.rest&&K.rest.type==="spacer")&&this.triplet.middleNote(Me),Gt},ye.prototype.addSlursAndTies=function(K,Q,le,Ee,Me,H){if(Q.endTie&&this.ties.length>0){for(var Y=!1,X=0;X<this.ties.length;X++)if(this.ties[X].anchor1&&this.ties[X].anchor1.pitch===le.pitch){this.ties[X].setEndAnchor(le),Ee.setRange(this.ties[X]),this.ties.splice(X,1),Y=!0;break}Y||(this.ties[0].setEndAnchor(le),Ee.setRange(this.ties[0]),this.ties.splice(0,1))}var xe=Ee.voicetotal<2?-1:Ee.voicenumber;if(Q.startTie){var De=new C({anchor1:le,force:this.stemdir==="down"||this.stemdir==="up",stemDir:this.stemdir,isGrace:H,voiceNumber:xe,style:Q.startTie.style});G&&De.setHint(),this.ties[this.ties.length]=De,Ee.addOther(De),K.startTie=!0}var $e,Re;if(Q.endSlur)for(var ut=0;ut<Q.endSlur.length;ut++)Re=Q.endSlur[ut],this.slurs[Re]?($e=this.slurs[Re],$e.setEndAnchor(le),Ee.setRange($e),delete this.slurs[Re]):($e=new C({anchor2:le,stemDir:this.stemdir,voiceNumber:xe}),G&&$e.setHint(),Ee.addOther($e)),this.startlimitelem&&$e.setStartX(this.startlimitelem);else if(!H)for(var Lt in this.slurs)this.slurs.hasOwnProperty(Lt)&&this.slurs[Lt].addInternalNote(le);if(Q.startSlur)for(ut=0;ut<Q.startSlur.length;ut++)Re=Q.startSlur[ut].label,$e=new C({anchor1:le,stemDir:this.stemdir,voiceNumber:xe,style:Q.startSlur[ut].style}),G&&$e.setHint(),this.slurs[Re]=$e,Ee.addOther($e)},ye.prototype.addMeasureNumber=function(K,Q){var le=this.getTextSize.calc(K,"measurefont","bar-number"),Ee=0;Q.isClef&&(Ee+=le.width/2);var Me=le.width>10&&Q.abcelem.type==="treble"?13.5:11;Q.addFixed(new A(K,Ee,le.width,Me+le.height/M.STEP,{type:"barNumber",dim:this.getTextSize.attr("measurefont","bar-number")}))},ye.prototype.createBarLine=function(K,Q,le){var Ee=new t(Q,0,10,"bar",this.tuneNumber),Me=null,H=0;Q.barNumber&&this.addMeasureNumber(Q.barNumber,Ee);var Y=Q.type==="bar_right_repeat"||Q.type==="bar_dbl_repeat",X=Q.type!=="bar_left_repeat"&&Q.type!=="bar_thick_thin"&&Q.type!=="bar_invisible",xe=Q.type==="bar_right_repeat"||Q.type==="bar_dbl_repeat"||Q.type==="bar_left_repeat"||Q.type==="bar_thin_thick"||Q.type==="bar_thick_thin",De=Q.type==="bar_left_repeat"||Q.type==="bar_thick_thin"||Q.type==="bar_thin_thin"||Q.type==="bar_dbl_repeat",$e=Q.type==="bar_left_repeat"||Q.type==="bar_dbl_repeat";if(Y||$e){for(var Re in this.slurs)this.slurs.hasOwnProperty(Re)&&this.slurs[Re].setEndX(Ee);this.startlimitelem=Ee}if(Y&&(Ee.addRight(new A("dots.dot",H,1,7)),Ee.addRight(new A("dots.dot",H,1,5)),H+=6),X&&(Me=new A(null,H,1,2,{type:"bar",pitch2:10,linewidth:.6}),Ee.addRight(Me)),Q.type==="bar_invisible"&&(Me=new A(null,H,1,2,{type:"none",pitch2:10,linewidth:.6}),Ee.addRight(Me)),Q.decoration&&this.decoration.createDecoration(K,Q.decoration,12,xe?3:1,Ee,0,"down",2,Q.positioning,this.hasVocals,this.accentAbove),xe&&(H+=4,Me=new A(null,H,4,2,{type:"bar",pitch2:10,linewidth:4}),Ee.addRight(Me),H+=5),this.partstartelem&&Q.endEnding&&(this.partstartelem.anchor2=Me,this.partstartelem=null),De&&(H+=3,Me=new A(null,H,1,2,{type:"bar",pitch2:10,linewidth:.6}),Ee.addRight(Me)),$e&&(H+=3,Ee.addRight(new A("dots.dot",H,1,7)),Ee.addRight(new A("dots.dot",H,1,5))),Q.startEnding&&le){var ut=this.getTextSize.calc(Q.startEnding,"repeatfont","").width;Ee.minspacing+=ut+10,this.partstartelem=new y(Q.startEnding,Me,null),K.addOther(this.partstartelem)}return Ee.extraw-=5,Q.chord!==void 0&&L(this.getTextSize,Ee,Q,0,0,0,!1,this.germanAlphabet),Ee},N_=ye,N_}var L_,G5;function CP(){if(G5)return L_;G5=1;var t="http://www.w3.org/2000/svg";function r(f){this.svg=c(),this.currentGroup=[],f.appendChild(this.svg)}r.prototype.clear=function(){if(this.svg){var f=this.svg.parentNode;this.svg=c(),this.currentGroup=[],f&&(f.innerHTML="",f.appendChild(this.svg))}},r.prototype.setTitle=function(f){var p=document.createElement("title"),y=document.createTextNode(f);p.appendChild(y),this.svg.insertBefore(p,this.svg.firstChild)},r.prototype.setResponsiveWidth=function(f,p){if(this.svg.setAttribute("viewBox","0 0 "+f+" "+p),this.svg.setAttribute("preserveAspectRatio","xMinYMin meet"),this.svg.removeAttribute("height"),this.svg.removeAttribute("width"),this.svg.style.display="inline-block",this.svg.style.position="absolute",this.svg.style.top="0",this.svg.style.left="0",this.svg.parentNode){var y=this.svg.parentNode.getAttribute("class");y?y.indexOf("abcjs-container")<0&&this.svg.parentNode.setAttribute("class",y+" abcjs-container"):this.svg.parentNode.setAttribute("class","abcjs-container"),this.svg.parentNode.style.display="inline-block",this.svg.parentNode.style.position="relative",this.svg.parentNode.style.width="100%";var S=p/f*100;this.svg.parentNode.style["padding-bottom"]=S+"%",this.svg.parentNode.style["vertical-align"]="middle",this.svg.parentNode.style.overflow="hidden"}},r.prototype.setSize=function(f,p){this.svg.setAttribute("width",f),this.svg.setAttribute("height",p)},r.prototype.setAttribute=function(f,p){this.svg.setAttribute(f,p)},r.prototype.setScale=function(f){f!==1?(this.svg.style.transform="scale("+f+","+f+")",this.svg.style["-ms-transform"]="scale("+f+","+f+")",this.svg.style["-webkit-transform"]="scale("+f+","+f+")",this.svg.style["transform-origin"]="0 0",this.svg.style["-ms-transform-origin-x"]="0",this.svg.style["-ms-transform-origin-y"]="0",this.svg.style["-webkit-transform-origin-x"]="0",this.svg.style["-webkit-transform-origin-y"]="0"):(this.svg.style.transform="",this.svg.style["-ms-transform"]="",this.svg.style["-webkit-transform"]="")},r.prototype.insertStyles=function(f){var p=document.createElementNS(t,"style");p.textContent=f,this.svg.insertBefore(p,this.svg.firstChild)},r.prototype.setParentStyles=function(f){for(var p in f)f.hasOwnProperty(p)&&this.svg.parentNode&&(this.svg.parentNode.style[p]=f[p]);if(this.dummySvg){var y=document.querySelector("body");y.removeChild(this.dummySvg),this.dummySvg=null}};function a(f,p,y){var S=y-f;return"M "+f+" "+p+" l "+S+" 0 l 0 1 l "+-S+" 0 z "}function l(f,p,y){var S=y-p;return"M "+f+" "+p+" l 0 "+S+" l 1 0 l 0 "+-S+" z "}r.prototype.rect=function(f){var p=[],y=f.x,S=f.y,A=f.x+f.width,M=f.y+f.height;return p.push(a(y,S,A)),p.push(a(y,M,A)),p.push(l(A,S,M)),p.push(l(y,M,S)),this.path({path:p.join(" "),stroke:"none","data-name":f["data-name"]})},r.prototype.dottedLine=function(f){var p=document.createElementNS(t,"line");p.setAttribute("x1",f.x1),p.setAttribute("x2",f.x2),p.setAttribute("y1",f.y1),p.setAttribute("y2",f.y2),p.setAttribute("stroke",f.stroke),p.setAttribute("stroke-dasharray","5,5"),this.svg.insertBefore(p,this.svg.firstChild)},r.prototype.rectBeneath=function(f){var p=document.createElementNS(t,"rect");p.setAttribute("x",f.x),p.setAttribute("width",f.width),p.setAttribute("y",f.y),p.setAttribute("height",f.height),f.stroke&&p.setAttribute("stroke",f.stroke),f["stroke-opacity"]&&p.setAttribute("stroke-opacity",f["stroke-opacity"]),f.fill&&p.setAttribute("fill",f.fill),f["fill-opacity"]&&p.setAttribute("fill-opacity",f["fill-opacity"]),this.svg.insertBefore(p,this.svg.firstChild)},r.prototype.text=function(f,p,y){var S=document.createElementNS(t,"text");S.setAttribute("stroke","none");for(var A in p)p.hasOwnProperty(A)&&S.setAttribute(A,p[A]);for(var M=(""+f).split(`
|
|
171
|
+
`),w=0;w<M.length;w++){var _=document.createElementNS(t,"tspan");if(_.setAttribute("x",p.x?p.x:0),w!==0&&_.setAttribute("dy","1.2em"),M[w].indexOf("")!==-1){var C=M[w].split("");if(_.textContent=C[0],C[1]){var m=document.createElementNS(t,"tspan");m.setAttribute("dy","-0.3em"),m.setAttribute("style","font-size:0.7em"),m.textContent=C[1],_.appendChild(m)}if(C[2]){var T=C[1]?"0.4em":"0.1em",L=document.createElementNS(t,"tspan");L.setAttribute("dy",T),L.setAttribute("style","font-size:0.7em"),L.textContent=C[2],_.appendChild(L)}}else _.textContent=M[w];S.appendChild(_)}return y?y.appendChild(S):this.append(S),S},r.prototype.richTextLine=function(f,p,y,S,A,M){var w=document.createElementNS(t,"text");w.setAttribute("stroke","none"),w.setAttribute("class",S),w.setAttribute("x",p),w.setAttribute("y",y),w.setAttribute("text-anchor",A),w.setAttribute("dominant-baseline","middle");for(var _=0;_<f.length;_++){for(var C=f[_],m=document.createElementNS(t,"tspan"),T=Object.keys(C.attrs),L=0;L<T.length;L++){var N=C.attrs[T[L]];N!==""&&m.setAttribute(T[L],N)}m.textContent=C.content,w.appendChild(m)}return M?M.appendChild(w):this.append(w),w},r.prototype.guessWidth=function(f,p){var y=this.createDummySvg(),S=this.text(f,p,y),A;try{A=S.getBBox(),isNaN(A.height)||!A.height?A={width:p["font-size"]/2,height:p["font-size"]+2}:A={width:A.width,height:A.height}}catch{A={width:p["font-size"]/2,height:p["font-size"]+2}}return y.removeChild(S),A},r.prototype.createDummySvg=function(){if(!this.dummySvg){this.dummySvg=c();var f=["display: block !important;","height: 1px;","width: 1px;","position: absolute;"];this.dummySvg.setAttribute("style",f.join(""));var p=document.querySelector("body");p.appendChild(this.dummySvg)}return this.dummySvg};var u={};r.prototype.getTextSize=function(f,p,y){if(typeof f=="number"&&(f=""+f),!f||f.match(/^\s+$/))return{width:0,height:0};var S;if(f.length<20&&(S=f+JSON.stringify(p),u[S]))return u[S];var A=!y;y||(y=this.text(f,p));var M;try{M=y.getBBox(),isNaN(M.height)||!M.height?M=this.guessWidth(f,p):M={width:M.width,height:M.height}}catch{M=this.guessWidth(f,p)}return A&&(this.currentGroup.length>0?this.currentGroup[0].removeChild(y):this.svg.removeChild(y)),S&&(u[S]=M),M},r.prototype.openGroup=function(f){f=f||{};var p=document.createElementNS(t,"g");return f.klass&&p.setAttribute("class",f.klass),f.fill&&p.setAttribute("fill",f.fill),f.stroke&&p.setAttribute("stroke",f.stroke),f["data-name"]&&p.setAttribute("data-name",f["data-name"]),f.prepend?this.prepend(p):this.append(p),this.currentGroup.unshift(p),p},r.prototype.closeGroup=function(){var f=this.currentGroup.shift();return f&&f.children.length===0?(f.parentElement.removeChild(f),null):f},r.prototype.path=function(f){var p=document.createElementNS(t,"path");for(var y in f)f.hasOwnProperty(y)&&(y==="path"?p.setAttributeNS(null,"d",f.path):y==="klass"?p.setAttributeNS(null,"class",f[y]):f[y]!==void 0&&p.setAttributeNS(null,y,f[y]));return this.append(p),p},r.prototype.pathToBack=function(f){var p=document.createElementNS(t,"path");for(var y in f)f.hasOwnProperty(y)&&(y==="path"?p.setAttributeNS(null,"d",f.path):y==="klass"?p.setAttributeNS(null,"class",f[y]):p.setAttributeNS(null,y,f[y]));return this.prepend(p),p},r.prototype.lineToBack=function(f){for(var p=document.createElementNS(t,"line"),y=Object.keys(f),S=0;S<y.length;S++)p.setAttribute(y[S],f[y[S]]);return this.prepend(p),p},r.prototype.append=function(f){this.currentGroup.length>0?this.currentGroup[0].appendChild(f):this.svg.appendChild(f)},r.prototype.prepend=function(f){this.currentGroup.length>0?this.currentGroup[0].appendChild(f):this.svg.insertBefore(f,this.svg.firstChild)},r.prototype.setAttributeOnElement=function(f,p){for(var y in p)p.hasOwnProperty(y)&&f.setAttributeNS(null,y,p[y])},r.prototype.moveElementToChild=function(f,p){f.appendChild(p)};function c(){var f=document.createElementNS(t,"svg");return f.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),f.setAttribute("role","img"),f.setAttribute("fill","currentColor"),f.setAttribute("stroke","currentColor"),f}return L_=r,L_}var O_,Y5;function xP(){if(Y5)return O_;Y5=1;var t=ss(),r=CP(),a=function(l){this.paper=new r(l),this.controller=null,this.space=3*t.SPACE,this.padding={},this.reset(),this.firefox112=navigator.userAgent.indexOf("Firefox/112.0")>=0};return a.prototype.reset=function(){this.paper.clear(),this.y=0,this.abctune=null,this.path=null,this.isPrint=!1,this.lineThickness=0,this.initVerticalSpace()},a.prototype.newTune=function(l){this.abctune=l,this.setVerticalSpace(l.formatting),this.isPrint=l.media==="print",this.setPadding(l)},a.prototype.setLineThickness=function(l){this.lineThickness=l},a.prototype.setPaddingOverride=function(l){this.paddingOverride={top:l.paddingtop,bottom:l.paddingbottom,right:l.paddingright,left:l.paddingleft}},a.prototype.setPadding=function(l){function u(c,f,p,y,S){l.formatting[p]!==void 0?c.padding[f]=l.formatting[p]:c.paddingOverride[f]!==void 0?c.padding[f]=c.paddingOverride[f]:c.isPrint?c.padding[f]=y:c.padding[f]=S}u(this,"top","topmargin",38,15),u(this,"bottom","botmargin",38,15),u(this,"left","leftmargin",68,15),u(this,"right","rightmargin",68,15)},a.prototype.adjustNonScaledItems=function(l){this.padding.top/=l,this.padding.bottom/=l,this.padding.left/=l,this.padding.right/=l,this.abctune.formatting.headerfont.size/=l,this.abctune.formatting.footerfont.size/=l},a.prototype.initVerticalSpace=function(){this.spacing={composer:7.56,graceBefore:8.67,graceInside:10.67,graceAfter:16,info:0,lineSkipFactor:1.1,music:7.56,paragraphSkipFactor:.4,parts:11.33,slurHeight:1,staffSeparation:61.33,staffTopMargin:0,stemHeight:26.67+10,subtitle:3.78,systemStaffSeparation:48,text:18.9,title:7.56,top:30.24,vocal:0,words:0}},a.prototype.setVerticalSpace=function(l){l.staffsep!==void 0&&(this.spacing.staffSeparation=l.staffsep*4/3),l.composerspace!==void 0&&(this.spacing.composer=l.composerspace*4/3),l.partsspace!==void 0&&(this.spacing.parts=l.partsspace*4/3),l.textspace!==void 0&&(this.spacing.text=l.textspace*4/3),l.musicspace!==void 0&&(this.spacing.music=l.musicspace*4/3),l.titlespace!==void 0&&(this.spacing.title=l.titlespace*4/3),l.sysstaffsep!==void 0&&(this.spacing.systemStaffSeparation=l.sysstaffsep*4/3),l.stafftopmargin!==void 0&&(this.spacing.staffTopMargin=l.stafftopmargin*4/3),l.subtitlespace!==void 0&&(this.spacing.subtitle=l.subtitlespace*4/3),l.topspace!==void 0&&(this.spacing.top=l.topspace*4/3),l.vocalspace!==void 0&&(this.spacing.vocal=l.vocalspace*4/3),l.wordsspace!==void 0&&(this.spacing.words=l.wordsspace*4/3)},a.prototype.calcY=function(l){return this.y-l*t.STEP},a.prototype.moveY=function(l,u){u===void 0&&(u=1),this.y+=l*u},a.prototype.absolutemoveY=function(l){this.y=l},O_=a,O_}var D_,K5;function kP(){if(K5)return D_;K5=1;function t(r,a,l,u,c,f){var p=r.text;this.rows=[];var y;a&&this.rows.push({move:a});var S=l.calc("textfont","defined-text");if(p==="")this.rows.push({move:S.attr["font-size"]*2});else if(typeof p=="string")this.rows.push({move:S.attr["font-size"]/2}),this.rows.push({left:u,text:p,font:"textfont",klass:"defined-text",anchor:"start",startChar:r.startChar,endChar:r.endChar,absElemType:"freeText",name:"free-text"}),y=f.calc(p,"textfont","defined-text"),this.rows.push({move:y.height});else if(p){for(var A=0,M=u,w="textfont",_=0;_<p.length;_++)p[_].font?w=p[_].font:w="textfont",this.rows.push({left:M,text:p[_].text,font:w,klass:"defined-text",anchor:"start",startChar:r.startChar,endChar:r.endChar,absElemType:"freeText",name:"free-text"}),y=f.calc(p[_].text,l.calc(w,"defined-text").font,"defined-text"),M+=y.width+y.height/2,A=Math.max(A,y.height);this.rows.push({move:A})}else if(r.length===1){var C=c/2;this.rows.push({left:C,text:r[0].text,font:"textfont",klass:"defined-text",anchor:"middle",startChar:r.startChar,endChar:r.endChar,absElemType:"freeText",name:"free-text"}),y=f.calc(r[0].text,"textfont","defined-text"),this.rows.push({move:y.height})}}return D_=t,D_}var R_,X5;function MP(){if(X5)return R_;X5=1;function t(r,a,l){this.rows=[],r&&this.rows.push({move:r}),this.rows.push({separator:a,absElemType:"separator"}),l&&this.rows.push({move:l})}return R_=t,R_}var B_,Q5;function EP(){if(Q5)return B_;Q5=1;function t(r,a,l,u,c,f){this.rows=[],r&&this.rows.push({move:r});var p=a.titleleft?"start":"middle",y=a.titleleft?c:u;this.rows.push({left:y,text:l.text,font:"subtitlefont",klass:"text subtitle",anchor:p,startChar:l.startChar,endChar:l.endChar,absElemType:"subtitle",name:"subtitle"});var S=f.calc(l.text,"subtitlefont","text subtitle");this.rows.push({move:S.height})}return B_=t,B_}var F_,Z5;function Gy(){if(Z5)return F_;Z5=1;function t(r,a,l){if(a.text){a.marginLeft||(a.marginLeft=0),a.klass||(a.klass=""),a.anchor||(a.anchor="start"),a.info||(a.info={startChar:-2,endChar:-2}),a.marginTop&&r.push({move:a.marginTop});var u={left:a.marginLeft,text:a.text,font:a.font,anchor:a.anchor,startChar:a.info.startChar,endChar:a.info.endChar,"dominant-baseline":a["dominant-baseline"]};a.absElemType&&(u.absElemType=a.absElemType),!a.inGroup&&a.klass&&(u.klass=a.klass),a.name&&(u.name=a.name),r.push(u);var c=l.calc("A",a.font,a.klass),f=a.text.split(`
|
|
172
|
+
`).length;if(a.text[a.text.length-1]===`
|
|
173
|
+
`&&f--,!a.noMove){var p=c.height*1.1*f;r.push({move:Math.round(p)}),a.marginBottom&&r.push({move:a.marginBottom})}}}return F_=t,F_}var q_,j5;function Q9(){if(j5)return q_;j5=1;const t=Gy();function r(a,l,u,c,f,p,y,S){var A=S.calc("i",u,c);if(l==="")a.push({move:A.height});else{if(typeof l=="string"){t(a,{marginLeft:p,text:l,font:u,klass:c,marginTop:y.marginTop,anchor:y.anchor,absElemType:y.absElemType,info:y.info,name:f},S);return}y.marginTop&&a.push({move:y.marginTop});var M=0,w={left:p,anchor:y.anchor,phrases:[]};c&&(w.klass=c),a.push(w);for(var _=0;_<l.length;_++){var C=l[_],m=C.font?C.font:S.attr(u,c).font,T={content:C.text};m&&(T.attrs={"font-family":S.getFamily(m.face),"font-size":m.size,"font-weight":m.weight,"font-style":m.style,"font-decoration":m.decoration}),w.phrases.push(T);var L=S.calc(C.text,m,c);M=Math.max(M,L.height),C.text[C.text.length-1]===" "&&A.width}a.push({move:M})}}return q_=r,q_}var z_,J5;function AP(){if(J5)return z_;J5=1;const t=Gy(),r=Q9();function a(l,u,c,f,p,y,S,A,M,w){if(this.rows=[],l.header&&y){var _=w.calc("X","headerfont","abcjs-header abcjs-meta-top").height;t(this.rows,{marginLeft:S,text:l.header.left,font:"headerfont",klass:"header meta-top",marginTop:-_,info:u.header,name:"header"},w),t(this.rows,{marginLeft:S+p/2,text:l.header.center,font:"headerfont",klass:"header meta-top",marginTop:-_,anchor:"middle",info:u.header,name:"header"},w),t(this.rows,{marginLeft:S+p,text:l.header.right,font:"headerfont",klass:"header meta-top",marginTop:-_,anchor:"end",info:u.header,name:"header"},w)}y&&this.rows.push({move:A.top});var C=c.titleleft?"start":"middle",m=c.titleleft?S:S+p/2;if(l.title){var T=M?"abcjs-title":"";r(this.rows,l.title,"titlefont",T,"title",m,{marginTop:A.title,anchor:C,absElemType:"title",info:u.title},w)}if(f.length)for(var L=0;L<f.length&&f[L].subtitle;){var T=M?"abcjs-text abcjs-subtitle":"";r(this.rows,f[L].subtitle.text,"subtitlefont",T,"subtitle",m,{marginTop:A.subtitle,anchor:C,absElemType:"subtitle",info:f[L].subtitle},w),L++}if(l.rhythm||l.origin||l.composer){if(this.rows.push({move:A.composer}),l.rhythm&&l.rhythm.length>0){var N=!!(l.composer||l.origin),T=M?"abcjs-rhythm":"";t(this.rows,{marginLeft:S,text:l.rhythm,font:"infofont",klass:T,absElemType:"rhythm",noMove:N,info:u.rhythm,name:"rhythm"},w)}l.composer&&l.composer,l.origin&&l.origin;var B=l.composer?l.composer:"";if(l.origin&&(typeof B=="string"&&typeof l.origin=="string"?B+=" ("+l.origin+")":typeof B=="string"&&typeof l.origin!="string"?(B=[{text:B}],B.push({text:" ("}),B=B.concat(l.origin),B.push({text:")"})):(B.push({text:" ("}),B=B.concat(l.origin),B.push({text:")"}))),B){var T=M?"abcjs-composer":"";r(this.rows,B,"composerfont",T,"composer",S+p,{anchor:"end",absElemType:"composer",info:u.composer,ingroup:!0},w)}}if(l.author&&l.author.length>0){var T=M?"abcjs-author":"";r(this.rows,l.author,"composerfont",T,"author",S+p,{anchor:"end",absElemType:"author",info:u.author},w)}if(l.partOrder&&l.partOrder.length>0){var T=M?"abcjs-part-order":"";r(this.rows,l.partOrder,"partsfont",T,"part-order",S,{absElemType:"partOrder",info:u.partOrder,anchor:"start"},w)}}return z_=a,z_}var H_,e6;function TP(){if(e6)return H_;e6=1;const t=Gy(),r=Q9();function a(c,f,p,y,S,A,M){this.rows=[],c.unalignedWords&&c.unalignedWords.length>0&&this.unalignedWords(c.unalignedWords,y,S,A,M),this.extraText(c,y,S,A,M),c.footer&&p&&this.footer(c.footer,f,y,M)}a.prototype.unalignedWords=function(c,f,p,y,S){var A=y?"abcjs-unaligned-words":"",M="wordsfont",w=S.calc("i",M,A);this.rows.push({move:p.words}),u(this.rows,"",c,f,M,"unalignedWords","unalignedWords",A,"unalignedWords",p,y,S),this.rows.push({move:w.height})};function l(c,f,p,y,S,A,M){p&&(f&&(typeof p=="string"?p=f+p:p=[{text:f}].concat(p)),S=A?"abcjs-extra-text "+S:"",r(c,p,"historyfont",S,"description",y,{absElemType:"extraText",anchor:"start"},M))}function u(c,f,p,y,S,A,M,w,_,C,m,T){if(p){w=m?"abcjs-extra-text "+w:"";var L=T.calc("A",S,w);if(typeof p=="string")f&&(p=f+`
|
|
174
|
+
`+p),t(c,{marginLeft:y,text:p,font:S,absElemType:"extraText",name:_,"dominant-baseline":"middle",klass:w},T);else{c.push({startGroup:M,klass:w,name:_}),c.push({move:C.info}),f&&(t(c,{marginLeft:y,text:f,font:S,absElemType:"extraText",name:_,"dominant-baseline":"middle"},T),c.push({move:L.height*3/4}));for(var N=0;N<p.length;N++)r(c,p[N],S,"",_,y,{anchor:"start"},T),N<p.length-1&&typeof p[N]=="string"&&typeof p[N+1]!="string"&&c.push({move:L.height*3/4});c.push({endGroup:M,absElemType:A,startChar:-1,endChar:-1,name:_}),c.push({move:L.height})}}}return a.prototype.extraText=function(c,f,p,y,S){l(this.rows,"Book: ",c.book,f,"abcjs-book",y,S),l(this.rows,"Source: ",c.source,f,"abcjs-source",y,S),l(this.rows,"Discography: ",c.discography,f,"abcjs-discography",y,S),u(this.rows,"Notes:",c.notes,f,"historyfont","extraText","notes","abcjs-notes","description",p,y,S),l(this.rows,"Transcription: ",c.transcription,f,"abcjs-transcription",y,S),u(this.rows,"History:",c.history,f,"historyfont","extraText","history","abcjs-history","description",p,y,S),l(this.rows,"Copyright: ",c["abc-copyright"],f,"abcjs-copyright",y,S),l(this.rows,"Creator: ",c["abc-creator"],f,"abcjs-creator",y,S),l(this.rows,"Edited By: ",c["abc-edited-by"],f,"abcjs-edited-by",y,S)},a.prototype.footer=function(c,f,p,y){var S="header meta-bottom",A="footerfont";this.rows.push({startGroup:"footer",klass:S}),t(this.rows,{marginLeft:p,text:c.left,font:A,klass:S,name:"footer"},y),t(this.rows,{marginLeft:p+f/2,text:c.center,font:A,klass:S,anchor:"middle",name:"footer"},y),t(this.rows,{marginLeft:p+f,text:c.right,font:A,klass:S,anchor:"end",name:"footer"},y)},H_=a,H_}var V_,t6;function Z9(){if(t6)return V_;t6=1;function t(a,l,u,c){if(a.indexOf(l)===0){var f=a.replace(l,""),p=parseInt(f,10);""+p===f&&(u[c]=p)}}function r(a,l){var u=[];if(a.absEl.elemset){for(var c={},f=0;f<a.absEl.elemset.length;f++){var p=a.absEl.elemset[f];if(p)for(var y=p.getAttribute("class").split(" "),S=0;S<y.length;S++)c[y[S]]=!0}for(var A=0;A<Object.keys(c).length;A++)u.push(Object.keys(c)[A])}for(var M={},w=0;w<u.length;w++)t(u[w],"abcjs-v",M,"voice"),t(u[w],"abcjs-l",M,"line"),t(u[w],"abcjs-m",M,"measure");a.staffPos&&(M.staffPos=a.staffPos);for(var _=l.target;_&&_.dataset&&!_.dataset.name&&_.tagName.toLowerCase()!=="svg";)_=_.parentNode;for(var C=l.target;C&&C.dataset&&!C.dataset.index&&C.tagName.toLowerCase()!=="svg";)C=C.parentNode;return C&&C.dataset&&(M.name=C.dataset.name,M.clickedName=_.dataset.name,M.parentClasses=C.classList),_&&_.classList&&(M.clickedClasses=_.classList),M.selectableElement=a.svgEl,{classes:u,analysis:M}}return V_=r,V_}var U_,r6;function IP(){if(r6)return U_;r6=1;var t=ss(),r=Z9();function a(q,se){if(q.rangeHighlight=B,q.dragging)for(var ve=0;ve<q.selectables.length;ve++){var he=q.selectables[ve];he.svgEl.getAttribute("selectable")==="true"&&(he.svgEl.setAttribute("tabindex",0),he.svgEl.setAttribute("data-index",ve),he.svgEl.addEventListener("keydown",c.bind(q)),he.svgEl.addEventListener("keyup",f.bind(q)),he.svgEl.addEventListener("focus",u.bind(q)))}for(var ce=0;ce<se.length;ce++)se[ce].addEventListener("touchstart",_.bind(q),{passive:!0}),se[ce].addEventListener("touchmove",C.bind(q),{passive:!0}),se[ce].addEventListener("touchend",m.bind(q),{passive:!0}),se[ce].addEventListener("mousedown",_.bind(q)),se[ce].addEventListener("mousemove",C.bind(q)),se[ce].addEventListener("mouseup",m.bind(q))}function l(q){var se=1,ve=1,he=q.target.closest("svg"),ce=0;he&&he.viewBox&&he.viewBox.baseVal&&(he.viewBox.baseVal.width!==0&&(se=he.viewBox.baseVal.width/he.clientWidth),he.viewBox.baseVal.height!==0&&(ve=he.viewBox.baseVal.height/he.clientHeight),ce=he.viewBox.baseVal.y);var de=q.target&&q.target.tagName==="svg",K,Q;return de?(K=q.offsetX,Q=q.offsetY):(K=q.layerX,Q=q.layerY),K=K*se,Q=Q*ve,[K,Q+ce]}function u(q){this.dragMechanism==="keyboard"&&this.dragYStep!==0&&this.dragTarget&&L.bind(this)(this.dragTarget,this.dragYStep,this.selectables.length,this.dragIndex,q),this.dragYStep=0}function c(q){switch(q.keyCode){case 38:case 40:q.preventDefault()}}function f(q){var se=!1,ve=q.target.dataset.index;switch(q.keyCode){case 13:case 32:se=!0,this.dragTarget=this.selectables[ve],this.dragIndex=ve,this.dragMechanism="keyboard",m.bind(this)(q);break;case 38:se=!0,this.dragTarget=this.selectables[ve],this.dragIndex=ve,this.dragTarget&&this.dragTarget.isDraggable&&(this.dragging&&this.dragTarget.isDraggable&&this.dragTarget.absEl.highlight(void 0,this.dragColor),this.dragYStep--,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+this.dragYStep*t.STEP+")"));break;case 40:se=!0,this.dragTarget=this.selectables[ve],this.dragIndex=ve,this.dragMechanism="keyboard",this.dragTarget&&this.dragTarget.isDraggable&&(this.dragging&&this.dragTarget.isDraggable&&this.dragTarget.absEl.highlight(void 0,this.dragColor),this.dragYStep++,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+this.dragYStep*t.STEP+")"));break;case 9:this.dragYStep!==0&&m.bind(this)(q);break}se&&q.preventDefault()}function p(q,se){if(!se)return-1;for(var ve=0;ve<q.length;ve++)if(se.dataset.index===q[ve].svgEl.dataset.index)return ve;return-1}function y(q,se,ve){for(var he=9999999,ce=-1,de=0;de<q.selectables.length&&he>0;de++){var K=q.selectables[de];if(q.getDim(K),K.dim.left<se&&K.dim.right>se&&K.dim.top<ve&&K.dim.bottom>ve)ce=de,he=0;else if(K.dim.top<ve&&K.dim.bottom>ve){var Q=Math.min(Math.abs(K.dim.left-se),Math.abs(K.dim.right-se));Q<he&&(he=Q,ce=de)}else if(K.dim.left<se&&K.dim.right>se){var le=Math.min(Math.abs(K.dim.top-ve),Math.abs(K.dim.bottom-ve));le<he&&(he=le,ce=de)}else{var Ee=Math.abs(se-K.dim.left)>Math.abs(se-K.dim.right)?Math.abs(se-K.dim.right):Math.abs(se-K.dim.left),Me=Math.abs(ve-K.dim.top)>Math.abs(ve-K.dim.bottom)?Math.abs(ve-K.dim.bottom):Math.abs(ve-K.dim.top),H=Math.sqrt(Ee*Ee+Me*Me);H<he&&(he=H,ce=de)}}return ce>=0&&he<=12?ce:-1}function S(q,se,ve){if(q.x<=se.offsetX&&q.x+q.width>=se.offsetX&&q.y<=se.offsetY&&q.y+q.height>=se.offsetY)return[se.offsetX,se.offsetY];var he=Math.abs(se.layerY/ve-se.offsetY);return he<3?[se.offsetX,se.offsetY]:[se.layerX,se.layerY]}function A(q){if(!q)return null;if(q.tagName==="svg")return q;if(!q.getAttribute)return null;for(var se=q.getAttribute("selectable");!se;)q.parentElement?(q=q.parentElement,q.tagName==="svg"?se=!0:se=q.getAttribute("selectable")):se=!0;return q}function M(q,se){var ve,he,ce,de=p(q.selectables,A(se.target));return de>=0?(ce=S(q.selectables[de].svgEl.getBBox(),se,q.scale),ve=ce[0],he=ce[1]):(ce=l(se),ve=ce[0],he=ce[1],de=y(q,ve,he)),{x:ve,y:he,clickedOn:de}}function w(q){if(!(!q||!q.target||!q.touches||q.touches.length<1)){var se=q.target.getBoundingClientRect(),ve=q.touches[0].pageX-se.left,he=q.touches[0].pageY-se.top;q.touches[0].offsetX=ve,q.touches[0].offsetY=he,q.touches[0].layerX=q.touches[0].pageX,q.touches[0].layerY=q.touches[0].pageY}}function _(q){var se=q;q.type==="touchstart"&&(w(q),q.touches.length>0&&(se=q.touches[0]));var ve=M(this,se);ve.clickedOn>=0&&(q.type==="touchstart"||q.button===0)&&this.selectables[ve.clickedOn]&&(this.dragTarget=this.selectables[ve.clickedOn],this.dragIndex=ve.clickedOn,this.dragMechanism="mouse",this.dragMouseStart={x:ve.x,y:ve.y},this.dragging&&this.dragTarget.isDraggable&&(R(this.renderer.paper,"abcjs-dragging-in-progress"),this.dragTarget.absEl.highlight(void 0,this.dragColor)))}function C(q){var se=q;if(q.type==="touchmove"&&(w(q),q.touches.length>0&&(se=q.touches[0])),this.lastTouchMove=q,!(!this.dragTarget||!this.dragging||!this.dragTarget.isDraggable||this.dragMechanism!=="mouse"||!this.dragMouseStart)){var ve=M(this,se),he=Math.round((ve.y-this.dragMouseStart.y)/t.STEP);he!==this.dragYStep&&(this.dragYStep=he,this.dragTarget.svgEl.setAttribute("transform","translate(0,"+he*t.STEP+")"))}}function m(q){var se=q;q.type==="touchend"&&this.lastTouchMove&&(w(this.lastTouchMove),this.lastTouchMove&&this.lastTouchMove.touches&&this.lastTouchMove.touches.length>0&&(se=this.lastTouchMove.touches[0])),this.dragTarget&&(N.bind(this)(),this.dragTarget.absEl&&this.dragTarget.absEl.highlight&&(this.selected=[this.dragTarget.absEl],this.dragTarget.absEl.highlight(void 0,this.selectionColor)),L.bind(this)(this.dragTarget,this.dragYStep,this.selectables.length,this.dragIndex,se),this.dragTarget.svgEl&&this.dragTarget.svgEl.focus&&(this.dragTarget.svgEl.focus(),this.dragTarget=null,this.dragIndex=-1),ye(this.renderer.svg,"abcjs-dragging-in-progress"))}function T(q){q>=0&&q<this.selectables.length&&(this.dragTarget=this.selectables[q],this.dragIndex=q,this.dragMechanism="keyboard",m.bind(this)({target:this.dragTarget.svgEl}))}function L(q,se,ve,he,ce){for(var de=r(q,ce),K=de.classes,Q=de.analysis,le=0;le<this.listeners.length;le++)this.listeners[le](q.absEl.abcelem,q.absEl.tuneNumber,K.join(" "),Q,{step:se,max:ve,index:he,setSelection:T.bind(this)},ce)}function N(){for(var q=0;q<this.selected.length;q++)this.selected[q].unhighlight(void 0,this.renderer.foregroundColor);this.selected=[]}function B(q,se){N.bind(this)();for(var ve=0;ve<this.staffgroups.length;ve++)for(var he=this.staffgroups[ve].voices,ce=0;ce<he.length;ce++)for(var de=he[ce].children,K=0;K<de.length;K++){var Q=de[K].abcelem.startChar,le=de[K].abcelem.endChar;(se>Q&&q<le||se===q&&se===le)&&(this.selected[this.selected.length]=de[K],de[K].highlight(void 0,this.selectionColor))}}function W(q){var se=q.getAttribute("class");se||(se="");for(var ve=se.split(" "),he={},ce=0;ce<ve.length;ce++)he[ve[ce]]=!0;return he}function G(q,se){var ve=[];for(var he in se)se.hasOwnProperty(he)&&ve.push(he);q.setAttribute("class",ve.join(" "))}function R(q,se){if(q){var ve=W(q.svg);ve[se]=!0,G(q.svg,ve)}}function ye(q,se){if(q){var ve=W(q.svg);delete ve[se],G(q.svg,ve)}}return U_=a,U_}var $_,n6;function Yy(){if(n6)return $_;n6=1;function t(r,a,l,u,c){return a+(u-a)/(l-r)*(c-r)}return $_=t,$_}var W_,i6;function PP(){if(i6)return W_;i6=1;var t=Ia(),r=ss(),a=Yy(),l=function(w){if(!(w.elems.length===0||w.allrests)){var _=p(w.stemsUp,w.isgrace),C=w.elems[0],m=w.elems[w.elems.length-1],T=0,L=w.stemsUp?C.abcelem.maxpitch:C.abcelem.minpitch;T=c(C,w.stemsUp,L,T),T=c(m,w.stemsUp,L,T),T=Math.max(w.stemHeight,T+3);var N=S(w.average,w.elems.length,T,w.stemsUp,C.abcelem.averagepitch,m.abcelem.averagepitch,w.isflat,w.min,w.max,w.isgrace),B=y(w.stemsUp,C,m);w.addBeam({startX:B[0],endX:B[1],startY:N[0],endY:N[1],dy:_});for(var W=M(w.elems,w.stemsUp,w.beams[0],w.isgrace,_),G=0;G<W.length;G++)w.addBeam(W[G]);A(w.elems,w.stemsUp,w.beams[0],_,w.mainNote)}},u=function(w){return w===void 0?0:Math.floor(Math.log(w)/Math.log(2))};function c(w,_,C,m){if(!w.children)return m;for(var T=0;T<w.children.length;T++){var L=w.children[T];_&&L.top!==void 0&&L.c==="flags.ugrace"?m=Math.max(m,L.top-C):!_&&L.bottom!==void 0&&L.c==="flags.ugrace"&&(m=Math.max(m,C-L.bottom+7))}return m}function f(w,_,C,m){if(m)return 0;var T=w-_,L=C/2;return T>L&&(T=L),T<-L&&(T=-L),T}function p(w,_){var C=w?r.STEP:-r.STEP;return _&&(C=C*.4),C}function y(w,_,C){var m=_.heads[w?0:_.heads.length-1],T=C.heads[w?0:C.heads.length-1],L=m.x;w&&(L+=m.w-.6);var N=T.x;return N+=w?T.w:.6,[L,N]}function S(w,_,C,m,T,L,N,B,W,G){var R=C-2,ye=C-2,q=Math.round(m?Math.max(w+R,W+ye):Math.min(w-R,B-ye)),se=f(T,L,_,N),ve=q+Math.floor(se/2),he=q+Math.floor(-se/2);return G||(m&&q<6||!m&&q>6)&&(ve=6,he=6),[ve,he]}function A(w,_,C,m,T){for(var L=0;L<w.length;L++){var N=w[L];if(!N.abcelem.rest){var B=!N.addExtra,W=B?T:N,G=N.heads[_?0:N.heads.length-1],R=1/5,ye=G.pitch+(_?R:-R),q=_?G.w:0;B||(q+=G.dx);var se=G.x+q,ve=a(C.startX,C.startY,C.endX,C.endY,se),he=_?-.6:.6;_||(ve-=m/2/r.STEP),B&&(q+=N.heads[0].dx),G.c==="noteheads.slash.quarter"&&(_?ye+=1:ye-=1);var ce=new t(null,q,0,ye,{type:"stem",pitch2:ve,linewidth:he});ce.setX(W.x),W.addRight(ce)}}}function M(w,_,C,m,T){for(var L=[],N=[],B=0;B<w.length;B++){var W=w[B];if(!W.abcelem.rest){var G=W.heads[_?0:W.heads.length-1],R=G.x+(_?G.w:0),ye=a(C.startX,C.startY,C.endX,C.endY,R),q=_?-1.5:1.5;m&&(q=q*2/3);var se=W.abcelem.duration;se===0&&(se=.25);for(var ve=u(se);ve<-3;ve++){var he=-4-ve;if(N[he]?N[he].single=!1:N[he]={x:R+(_?-.6:0),y:ye+q*(he+1),durlog:ve,single:!0},B>0&&W.abcelem.beambr&&W.abcelem.beambr<=he+1){N[he].split||(N[he].split=[N[he].x]);var ce=y(_,w[B-1],W);N[he].split[N[he].split.length-1]>=ce[0]&&(ce[0]+=W.w),N[he].split.push(ce[0]),N[he].split.push(ce[1])}}for(var de=N.length-1;de>=0;de--)if(B===w.length-1||u(w[B+1].abcelem.duration)>-de-4){var K=R,Q=ye+q*(de+1);N[de].single&&(K=B===0?R+5:R-5,Q=a(C.startX,C.startY,C.endX,C.endY,K)+q*(de+1));var le={startX:N[de].x,endX:K,startY:N[de].y,endY:Q,dy:T};if(N[de].split!==void 0){var Ee=N[de].split;le.endX<=Ee[Ee.length-1]&&(Ee[Ee.length-1]-=W.w),Ee.push(le.endX),le.split=N[de].split}L.push(le),N=N.slice(0,de)}}}return L}return W_=l,W_}var G_,s6;function NP(){if(s6)return G_;s6=1;var t=Yy();function r(c){if(c.anchor1&&c.anchor2){c.hasBeam=!!c.anchor1.parent.beam&&c.anchor1.parent.beam===c.anchor2.parent.beam;var f=c.anchor1.parent.beam;if(c.hasBeam&&(f.elems[0]!==c.anchor1.parent||f.elems[f.elems.length-1]!==c.anchor2.parent)&&(c.hasBeam=!1),c.hasBeam){var p=a(f)?c.anchor1.x+c.anchor1.w:c.anchor1.x;c.yTextPos=l(p,c.anchor2.x,f),c.yTextPos+=a(f)?3:-2,c.xTextPos=u(p,c.anchor2.x),c.top=c.yTextPos+1,c.bottom=c.yTextPos-2,a(f)&&(c.endingHeightAbove=4)}else{c.startNote=Math.max(c.anchor1.parent.top,9)+4,c.endNote=Math.max(c.anchor2.parent.top,9)+4,c.anchor1.parent.type==="rest"&&c.anchor2.parent.type!=="rest"?c.startNote=c.endNote:c.anchor2.parent.type==="rest"&&c.anchor1.parent.type!=="rest"&&(c.endNote=c.startNote);for(var y=0,S=0;S<c.middleElems.length;S++)y=Math.max(y,c.middleElems[S].top);y+=4,(y>c.startNote||y>c.endNote)&&(c.startNote=y,c.endNote=y),c.flatBeams&&(c.startNote=Math.max(c.startNote,c.endNote),c.endNote=Math.max(c.startNote,c.endNote)),c.yTextPos=c.startNote+(c.endNote-c.startNote)/2,c.xTextPos=c.anchor1.x+(c.anchor2.x+c.anchor2.w-c.anchor1.x)/2,c.top=c.yTextPos+1}}delete c.middleElems,delete c.flatBeams}function a(c){return c.stemsUp}function l(c,f,p){if(p.beams.length===0)return 0;p=p.beams[0];var y=c+(f-c)/2;return t(p.startX,p.startY,p.endX,p.endY,y)}function u(c,f){return c+(f-c)/2}return G_=r,G_}var Y_,a6;function LP(){if(a6)return Y_;a6=1;var t=PP(),r=Yy(),a=NP(),l=function(A){for(var M=0;M<A.beams.length;M++)if(A.beams[M].type==="BeamElem"){t(A.beams[M]),u(A.beams[M]);for(var w=0;w<A.beams[M].elems.length;w++)A.adjustRange(A.beams[M].elems[w])}for(A.staff.specialY.chordLines=f(A.children),M=0;M<A.otherchildren.length;M++){var _=A.otherchildren[M];_.type==="TripletElem"&&(a(_),A.adjustRange(_))}A.staff.top=Math.max(A.staff.top,A.top),A.staff.bottom=Math.min(A.staff.bottom,A.bottom)};function u(A){for(var M=1.5,w=0;w<A.elems.length;w++){var _=A.elems[w];if(_.top)for(var C=S(_,A),m=0;m<_.children.length;m++){var T=_.children[m];if(T.klass==="ornament"&&T.position!=="below"&&T.bottom-M<C){var L=C-T.bottom+M;T.bottom+=L,T.top+=L,T.pitch+=L,C=_.top=T.top}}}}function c(A,M){var w=M.getChordDim();if(w){for(var _=0;_<A.length;_++){var C=A[_]<w.left;if(C){_>0&&M.putChordInLane(_),A[_]=w.right;return}}A.push(w.right),M.putChordInLane(A.length-1)}}function f(A){var M=[0],w=[0],_,C,m;for(_=0;_<A.length;_++){for(C=0;C<A[_].children.length;C++)m=A[_].children[C],m.chordHeightAbove&&c(M,m);for(C=A[_].children.length-1;C>=0;C--)m=A[_].children[C],m.chordHeightBelow&&c(w,m)}return(M.length>1||w.length>1)&&y(A,M.length,w.length),{above:M.length,below:w.length}}function p(A){for(var M=0,w=0;w<A.children.length;w++){var _=A.children[w];_.chordHeightBelow&&M++}return M}function y(A,M,w){for(var _=0;_<A.length;_++){p(A[_]);for(var C=0;C<A[_].children.length;C++){var m=A[_].children[C];m.chordHeightAbove&&m.invertLane(M)}}}function S(A,M){return M=M.beams[0],r(M.startX,M.startY,M.endX,M.endY,A.x)}return Y_=l,Y_}var K_,o6;function OP(){if(o6)return K_;o6=1;var t=ss(),r=function(M,w){for(var _,C=0;C<w.staffs.length;C++){var m=w.staffs[C],T={tempoHeightAbove:0,partHeightAbove:0,volumeHeightAbove:0,dynamicHeightAbove:0,endingHeightAbove:0,chordHeightAbove:0,lyricHeightAbove:0,lyricHeightBelow:0,chordHeightBelow:0,volumeHeightBelow:0,dynamicHeightBelow:0};if(M.showDebug&&M.showDebug.indexOf("box")>=0&&(m.originalTop=m.top,m.originalBottom=m.bottom),l(m,T,"lyricHeightAbove"),l(m,T,"chordHeightAbove",m.specialY.chordLines.above),m.specialY.endingHeightAbove&&(m.specialY.chordHeightAbove?m.top+=2:m.top+=m.specialY.endingHeightAbove+a,T.endingHeightAbove=m.top),m.specialY.dynamicHeightAbove&&m.specialY.volumeHeightAbove?(m.top+=Math.max(m.specialY.dynamicHeightAbove,m.specialY.volumeHeightAbove)+a,T.dynamicHeightAbove=m.top,T.volumeHeightAbove=m.top):(l(m,T,"dynamicHeightAbove"),l(m,T,"volumeHeightAbove")),l(m,T,"partHeightAbove"),l(m,T,"tempoHeightAbove"),m.specialY.lyricHeightBelow&&(m.specialY.lyricHeightBelow+=M.spacing.vocal/t.STEP,T.lyricHeightBelow=m.bottom,m.bottom-=m.specialY.lyricHeightBelow+a),m.specialY.chordHeightBelow){T.chordHeightBelow=m.bottom;var L=m.specialY.chordHeightBelow;m.specialY.chordLines.below&&(L*=m.specialY.chordLines.below),m.bottom-=L+a}m.specialY.volumeHeightBelow&&m.specialY.dynamicHeightBelow?(T.volumeHeightBelow=m.bottom,T.dynamicHeightBelow=m.bottom,m.bottom-=Math.max(m.specialY.volumeHeightBelow,m.specialY.dynamicHeightBelow)+a):m.specialY.volumeHeightBelow?(T.volumeHeightBelow=m.bottom,m.bottom-=m.specialY.volumeHeightBelow+a):m.specialY.dynamicHeightBelow&&(T.dynamicHeightBelow=m.bottom,m.bottom-=m.specialY.dynamicHeightBelow+a),M.showDebug&&M.showDebug.indexOf("box")>=0&&(m.positionY=T);for(var N=0;N<m.voices.length;N++){var B=w.voices[m.voices[N]];u(T,B,M.spacing)}if(_!==void 0){var W=m.top-10,G=_+W,R=M.spacing.systemStaffSeparation/t.STEP,ye=R-G;ye>0&&(m.top+=ye)}m.top+=M.spacing.staffTopMargin/t.STEP,_=2-m.bottom}},a=1;function l(M,w,_,C){if(M.specialY[_]){var m=M.specialY[_];C&&(m*=C),M.top+=m+a,w[_]=M.top}}function u(M,w,_){var C,m;for(C=0;C<w.children.length;C++)m=w.children[C],c(M,m,_);for(C=0;C<w.otherchildren.length;C++)switch(m=w.otherchildren[C],m.type){case"CrescendoElem":f(M,m);break;case"DynamicDecoration":p(M,m);break;case"EndingElem":y(M,m);break;case"TieElem":var T=m.getYBounds();w.staff.top=Math.max(w.staff.top,T[0]),w.staff.top=Math.max(w.staff.top,T[1]),w.staff.bottom=Math.min(w.staff.bottom,T[0]),w.staff.bottom=Math.min(w.staff.bottom,T[1]);break}}function c(M,w,_){for(var C=0;C<w.children.length;C++){var m=w.children[C];for(var T in w.specialY)w.specialY.hasOwnProperty(T)&&m[T]&&(m.pitch=M[T],m.top===void 0&&(m.type==="TempoElement"?S(M,m):A(M,m,_),w.pushTop(m.top),w.pushBottom(m.bottom)))}}function f(M,w){w.dynamicHeightAbove?w.pitch=M.dynamicHeightAbove:w.pitch=M.dynamicHeightBelow}function p(M,w){w.volumeHeightAbove?w.pitch=M.volumeHeightAbove:w.pitch=M.volumeHeightBelow}function y(M,w){w.pitch=M.endingHeightAbove-2}function S(M,w){if(w.pitch=M.tempoHeightAbove,w.top=M.tempoHeightAbove,w.bottom=M.tempoHeightAbove,w.note){var _=w.pitch-w.totalHeightInPitches+1;w.note.top=_,w.note.bottom=_;for(var C=0;C<w.note.children.length;C++){var m=w.note.children[C];m.top+=_,m.bottom+=_,m.pitch+=_,m.pitch2!==void 0&&(m.pitch2+=_)}}}function A(M,w,_){switch(w.type){case"part":w.top=M.partHeightAbove+w.height,w.bottom=M.partHeightAbove;break;case"text":case"chord":w.chordHeightAbove?(w.top=M.chordHeightAbove,w.bottom=M.chordHeightAbove):(w.top=M.chordHeightBelow,w.bottom=M.chordHeightBelow);break;case"lyric":w.lyricHeightAbove?(w.top=M.lyricHeightAbove,w.bottom=M.lyricHeightAbove):(w.top=M.lyricHeightBelow+_.vocal/t.STEP,w.bottom=M.lyricHeightBelow+_.vocal/t.STEP,w.pitch-=_.vocal/t.STEP);break;case"debug":w.top=M.chordHeightAbove,w.bottom=M.chordHeightAbove;break}(w.pitch===void 0||w.top===void 0)&&console.error("RelativeElement position not set.",w.type,w.pitch,w.top,M)}return K_=r,K_}var X_,l6;function DP(){if(l6)return X_;l6=1;var t=function(){};t.beginLayout=function(l,u){u.i=0,u.durationindex=0,u.startx=l,u.minx=l,u.nextx=l,u.spacingduration=0},t.layoutEnded=function(l){return l.i>=l.children.length},t.getNextX=function(l){return Math.max(l.minx,l.nextx)},t.getSpacingUnits=function(l){return Math.sqrt(l.spacingduration*8)},t.layoutOneItem=function(l,u,c,f,p){var y=c.children[c.i];if(!y)return 0;var S=l-c.minx,A=c.durationindex+y.duration>0?f:0;if(y.abcelem.el_type==="note"&&!y.abcelem.rest&&c.voicenumber!==0&&p){var M=p.children[p.i],w=M&&(y.abcelem.maxpitch<=M.abcelem.maxpitch+1&&y.abcelem.maxpitch>=M.abcelem.minpitch-1||y.abcelem.minpitch<=M.abcelem.maxpitch+1&&y.abcelem.minpitch>=M.abcelem.minpitch-1);if(w&&y.abcelem.minpitch===M.abcelem.minpitch&&y.abcelem.maxpitch===M.abcelem.maxpitch&&M.heads&&M.heads.length>0&&y.heads&&y.heads.length>0&&M.heads[0].c===y.heads[0].c&&(w=!1),w){var _=M.heads&&M.heads.length>0?M.heads[0].realWidth:M.fixed.w;y.adjustedWidth||(y.adjustedWidth=_+y.w),y.w=y.adjustedWidth;for(var C=0;C<y.children.length;C++){var m=y.children[C];m.name.indexOf("accidental")<0&&(m.adjustedWidth||(m.adjustedWidth=m.dx+_),m.dx=m.adjustedWidth)}}}var T=r(y,A);return S<T&&(c.i===0||y.type!=="bar"||c.children[c.i-1].type!=="part"&&c.children[c.i-1].type!=="tempo")&&(l+=T-S),y.setX(l),c.spacingduration=y.duration,c.minx=l+a(y),c.i!==c.children.length-1&&(c.minx+=y.minspacing),this.updateNextX(l,u,c),l},t.shiftRight=function(l,u){var c=u.children[u.i];c&&(c.setX(c.x+l),u.minx+=l,u.nextx+=l)},t.updateNextX=function(l,u,c){c.nextx=l+u*this.getSpacingUnits(c)},t.updateIndices=function(l){this.layoutEnded(l)||(l.durationindex+=l.children[l.i].duration,l.children[l.i].type==="bar"&&(l.durationindex=Math.round(l.durationindex*64)/64),l.i++)};function r(l,u){var c=0;return(l.type==="note"||l.type==="bar")&&(c=u),-l.extraw+c}function a(l){return l.w}return X_=t,X_}var Q_,u6;function RP(){if(u6)return Q_;u6=1;var t=DP();function r(f){for(var p=0,y=0;y<f.length;y++){var S=f[y];if(S.children.length>0){var A=S.children.length-1,M=S.children[A];if(M.abcelem.el_type==="bar"){var w=M.children[0].x;w>p?p=w:M.children[0].x=p}}}}var a=function(f,p,y,S,A){var M=1e-7,w=0,_=1e3,C=A;S.startx=C;var m,T=0;for(y&&console.log("init layout",f),m=0;m<S.voices.length;m++)t.beginLayout(C,S.voices[m]);for(var L=0;!l(S.voices);){for(T=null,m=0;m<S.voices.length;m++)!t.layoutEnded(S.voices[m])&&(!T||u(S.voices[m])<T)&&(T=u(S.voices[m]));var N=[],B=[];for(m=0;m<S.voices.length;m++){var W=u(S.voices[m]);W-T>M?B.push(S.voices[m]):N.push(S.voices[m])}L=0;var G=0;for(m=0;m<N.length;m++)t.getNextX(N[m])>C&&(C=t.getNextX(N[m]),L=t.getSpacingUnits(N[m]),G=N[m].spacingduration);w+=L,_=Math.min(_,L),y&&console.log("currentduration: ",T,w,_);var R=void 0;for(m=0;m<N.length;m++){var ye=N[m];ye.voicenumber===0&&(R=m);var q=R!==void 0&&N[R].voicenumber!==ye.voicenumber?N[R]:void 0;c(ye,q)||(q=void 0);var se=t.layoutOneItem(C,f,ye,p,q),ve=se-C;if(ve>0){C=se;for(var he=0;he<m;he++)t.shiftRight(ve,N[he])}}for(m=0;m<B.length;m++)B[m].spacingduration-=G,t.updateNextX(C,f,B[m]);for(m=0;m<N.length;m++){var ce=N[m];t.updateIndices(ce)}}for(m=0;m<S.voices.length;m++)t.getNextX(S.voices[m])>C&&(C=t.getNextX(S.voices[m]),L=t.getSpacingUnits(S.voices[m]));return r(S.voices),w+=L,S.setWidth(C),{spacingUnits:w,minSpace:_}};function l(f){for(var p=0;p<f.length;p++)if(!t.layoutEnded(f[p]))return!1;return!0}function u(f){return f.durationindex-(f.children[f.i]&&f.children[f.i].duration>0?0:5e-7)}function c(f,p){return!f||!f.staff||!f.staff.voices||f.staff.voices.length===0||!p||!p.staff||!p.staff.voices||p.staff.voices.length===0?!1:f.staff.voices[0]===p.staff.voices[0]}return Q_=a,Q_}var Z_,c6;function j9(){if(c6)return Z_;c6=1;function t(u,c,f,p,y){var S=u.padding.left,A=0,M,w;for(M=0;M<f.length;M++)f[M].header&&(w=c.calc(f[M].header,"voicefont",""),A=Math.max(A,w.width));if(A=r(A,p,c),A=r(A,y,c),A){var _=c.calc("A","voicefont","");A+=_.width}S+=A;var C=0;return C=a(p,S,C),C=a(y,S,C),S+C}function r(u,c,f){if(c){for(var p=0;p<c.length;p++)if(c[p].header){var y=f.calc(c[p].header,"voicefont","");u=Math.max(u,y.width)}}return u}function a(u,c,f){if(u)for(var p=0;p<u.length;p++)l(c,u[p]),f=Math.max(f,u[p].getWidth());return f}function l(u,c){c.x=u}return Z_=t,Z_}var j_,h6;function BP(){if(h6)return j_;h6=1;var t=j9();function r(l,u,c){var f=t(l,u.getTextSize,u.voices,u.brace,u.bracket),p=a(u,c.minPadding),y=p.totalDuration,S=p.minSpacing,A=S*y;c.minWidth&&(A=Math.max(A,c.minWidth));var M=c.minPadding?c.minPadding/2:2;u.startx=f,u.w=A+f;for(var w=0;w<u.voices.length;w++){var _=u.voices[w];_.startx=f,_.w=A+f;for(var C=f,m=!1,T=0,L=0;L<_.children.length;L++){var N=_.children[L];m||(N.duration!==0?(m=!0,T=(A+f-C)/y,u.gridStart=C):(N.x=C,C+=N.w+N.minspacing)),m&&(c.align==="center"?N.x=C+N.duration*T/2-N.w/2:N.duration===0?N.x=C+1-N.w:N.x=C+M-N.extraw,C+=N.duration*T);for(var B=0;B<N.children.length;B++){var W=N.children[B],G=W.dx?W.dx:0;W.x=N.x+G}}u.gridEnd=C}return A}function a(l,u){for(var c=0,f=0,p=0;p<l.voices.length;p++){for(var y=0,S=l.voices[p],A=0;A<S.children.length;A++){var M=S.children[A];if(y+=M.duration,M.duration){var w=(M.w+u)/M.duration;c=Math.max(c,w)}}f=Math.max(f,y)}return{totalDuration:f,minSpacing:c}}return j_=r,j_}var J_,f6;function FP(){if(f6)return J_;f6=1;var t=LP(),r=OP(),a=RP(),l=j9(),u=BP(),c=function(S,A,M,w,_,C){var m,T,L=M;for(m=0;m<A.lines.length;m++)if(T=A.lines[m],T.staff){var N;C!==void 0?N=u(S,T.staffGroup,C):N=f(S,L,w,T.staffGroup,A.formatting,m===A.lines.length-1,!1),Math.round(N)>Math.round(L)&&(L=N,_&&(m=-1))}for(m=0;m<A.lines.length;m++)if(T=A.lines[m],T.staffGroup&&T.staffGroup.voices){for(var B=0;B<T.staffGroup.voices.length;B++)t(T.staffGroup.voices[B]);r(S,T.staffGroup)}for(m=0;m<A.lines.length;m++)T=A.lines[m],T.staffGroup&&T.staffGroup.setHeight();return L},f=function(S,A,M,w,_,C,m){for(var T=l(S,w.getTextSize,w.voices,w.brace,w.bracket),L=M,N=0;N<8;N++){var B=a(L,S.minPadding,m,w,T);if(L=p(C,_.stretchlast,A+S.padding.left,w.w,L,B.spacingUnits,B.minSpace,S.padding.left+S.padding.right),L===null)break}return y(w.voices),w.w-T};function p(S,A,M,w,_,C,m,T){if(S)if(A===void 0){if(w/M<.66)return null}else{var L=1-(w+T)/M,N=L<A;if(!N)return null}if(Math.abs(M-w)<2)return null;var B=C*_,W=w-B;return C>0?(_=(M-W)/C,_*m>50&&(_=50/m),_):null}function y(S){for(var A=0;A<S.length;A++)for(var M=S[A],w=1;w<M.children.length-1;w++){var _=M.children[w];if(_.abcelem.rest&&(_.abcelem.rest.type==="whole"||_.abcelem.rest.type==="multimeasure")){var C=M.children[w-1],m=M.children[w+1];_.center(C,m)}}}return J_=c,J_}var e3,d6;function qP(){if(d6)return e3;d6=1;var t=function(a){this.shouldAddClasses=a.shouldAddClasses,this.reset()};return t.prototype.reset=function(){this.lineNumber=null,this.voiceNumber=null,this.measureNumber=null,this.measureTotalPerLine=[],this.noteNumber=null},t.prototype.incrLine=function(){this.lineNumber===null?this.lineNumber=0:this.lineNumber++,this.voiceNumber=null,this.measureNumber=null,this.noteNumber=null},t.prototype.incrVoice=function(){this.voiceNumber===null?this.voiceNumber=0:this.voiceNumber++,this.measureNumber=null,this.noteNumber=null},t.prototype.isInMeasure=function(){return this.measureNumber!==null},t.prototype.newMeasure=function(){this.measureNumber&&(this.measureTotalPerLine[this.lineNumber]=this.measureNumber),this.measureNumber=null,this.noteNumber=null},t.prototype.startMeasure=function(){this.measureNumber=0,this.noteNumber=0},t.prototype.incrMeasure=function(){this.measureNumber++,this.noteNumber=0},t.prototype.incrNote=function(){this.noteNumber++},t.prototype.measureTotal=function(){for(var r=0,a=0;a<this.lineNumber;a++)r+=this.measureTotalPerLine[a]?this.measureTotalPerLine[a]:0;return this.measureNumber&&(r+=this.measureNumber),r},t.prototype.getCurrent=function(r){return{line:this.lineNumber,measure:this.measureNumber,measureTotal:this.measureTotal(),voice:this.voiceNumber,note:this.noteNumber}},t.prototype.generate=function(r){if(!this.shouldAddClasses)return"";var a=[];if(r&&r.length>0&&a.push(r),r==="abcjs-tab-number")return a.join(" ");if(r==="text instrument-name")return"abcjs-text abcjs-instrument-name";if(this.lineNumber!==null&&a.push("l"+this.lineNumber),this.measureNumber!==null&&a.push("m"+this.measureNumber),this.measureNumber!==null&&a.push("mm"+this.measureTotal()),this.voiceNumber!==null&&a.push("v"+this.voiceNumber),r&&(r.indexOf("note")>=0||r.indexOf("rest")>=0||r.indexOf("lyric")>=0)&&this.noteNumber!==null&&a.push("n"+this.noteNumber),a.length>0){a=a.join(" "),a=a.split(" ");for(var l=0;l<a.length;l++)a[l].indexOf("abcjs-")!==0&&a[l].length>0&&(a[l]="abcjs-"+a[l])}return a.join(" ")},e3=t,e3}var t3,p6;function zP(){if(p6)return t3;p6=1;var t=function(a,l){this.formatting=a,this.classes=l};return t.prototype.updateFonts=function(r){r.gchordfont&&(this.formatting.gchordfont=r.gchordfont),r.tripletfont&&(this.formatting.tripletfont=r.tripletfont),r.annotationfont&&(this.formatting.annotationfont=r.annotationfont),r.vocalfont&&(this.formatting.vocalfont=r.vocalfont)},t.prototype.getFamily=function(r){return r[0]==='"'&&r[r.length-1]==='"'?r.substring(1,r.length-1):r},t.prototype.calc=function(r,a){var l;typeof r=="string"?(l=this.formatting[r],l?l={face:l.face,size:Math.round(l.size*4/3),decoration:l.decoration,style:l.style,weight:l.weight,box:l.box}:l={face:"Arial",size:Math.round(12*4/3),decoration:"underline",style:"normal",weight:"normal"}):l={face:r.face,size:Math.round(r.size*4/3),decoration:r.decoration,style:r.style,weight:r.weight,box:r.box};var u=this.formatting.fontboxpadding?this.formatting.fontboxpadding:.1;l.padding=l.size*u;var c={"font-size":l.size,"font-style":l.style,"font-family":this.getFamily(l.face),"font-weight":l.weight,"text-decoration":l.decoration,class:this.classes.generate(a)};return{font:l,attr:c}},t3=t,t3}var r3,g6;function HP(){if(g6)return r3;g6=1;var t=function(a,l){this.getFontAndAttr=a,this.svg=l};return t.prototype.updateFonts=function(r){this.getFontAndAttr.updateFonts(r)},t.prototype.attr=function(r,a){return this.getFontAndAttr.calc(r,a)},t.prototype.getFamily=function(r){return r[0]==='"'&&r[r.length-1]==='"'?r.substring(1,r.length-1):r},t.prototype.calc=function(r,a,l,u){var c;typeof a=="string"?c=this.attr(a,l):c={font:{face:a.face,size:a.size,decoration:a.decoration,style:a.style,weight:a.weight},attr:{"font-size":a.size,"font-style":a.style,"font-family":this.getFamily(a.face),"font-weight":a.weight,"text-decoration":a.decoration,class:this.getFontAndAttr.classes.generate(l)}};var f=this.svg.getTextSize(r,c.attr,u);return c.font.box?{height:f.height+c.font.padding*4,width:f.width+c.font.padding*4}:f},t.prototype.baselineToCenter=function(r,a,l,u,c){var f=this.calc(r,a,l).height,p=this.attr(a,l).font.size;return f*.5+(c-u-2)*p},r3=t,r3}var n3,v6;function pu(){if(v6)return n3;v6=1;var t=function(){for(var r=0,a,l=arguments[r++],u=[],c,f,p,y;l;){if(c=/^[^\x25]+/.exec(l))u.push(c[0]);else if(c=/^\x25{2}/.exec(l))u.push("%");else if(c=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(l)){if((a=arguments[c[1]||r++])==null||a==null)throw"Too few arguments.";if(/[^s]/.test(c[7])&&typeof a!="number")throw"Expecting number but found "+typeof a;switch(c[7]){case"b":a=a.toString(2);break;case"c":a=String.fromCharCode(a);break;case"d":a=parseInt(a);break;case"e":a=c[6]?a.toExponential(c[6]):a.toExponential();break;case"f":a=c[6]?parseFloat(a).toFixed(c[6]):parseFloat(a);break;case"o":a=a.toString(8);break;case"s":a=(a=String(a))&&c[6]?a.substring(0,c[6]):a;break;case"u":a=Math.abs(a);break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase();break}a=/[def]/.test(c[7])&&c[2]&&a>0?"+"+a:a,p=c[3]?c[3]=="0"?"0":c[3][1]:" ",y=c[5]-String(a).length,f=c[5]?str_repeat(p,y):"",u.push(c[4]?a+f:f+a)}else throw"Huh ?!";l=l.substring(c[0].length)}return u.join("")};return n3=t,n3}var i3,m6;function Pa(){if(m6)return i3;m6=1;function t(r){return parseFloat(r.toFixed(2))}return i3=t,i3}var s3,_6;function el(){if(_6)return s3;_6=1;var t=Pa();function r(a,l,u){var c=l.y;if(l.phrases){var S=a.paper.richTextLine(l.phrases,l.x,l.y,l.klass,l.anchor);return S}if(l.lane){var f=l.dim.font.size*.25;c+=(l.dim.font.size+f)*l.lane}var p;l.dim?(p=l.dim,p.attr.class=l.klass):p=a.controller.getFontAndAttr.calc(l.type,l.klass),l.anchor&&(p.attr["text-anchor"]=l.anchor),l["dominant-baseline"]&&(p.attr["dominant-baseline"]=l["dominant-baseline"]),p.attr.x=l.x,p.attr.y=c,l.centerVertically||(p.attr.y+=p.font.size),l.type==="debugfont"&&(console.log("Debug msg: "+l.text),p.attr.stroke="#ff0000"),l.cursor&&(p.attr.cursor=l.cursor);var y=l.text.replace(/\n\n/g,`
|
|
175
|
+
|
|
176
|
+
`);y=y.replace(/^\n/,`
|
|
177
|
+
`),p.font.box&&(u||a.paper.openGroup({klass:p.attr.class,fill:a.foregroundColor,"data-name":l.name}),p.attr["text-anchor"]==="end"?p.attr.x-=p.font.padding:p.attr["text-anchor"]==="start"&&(p.attr.x+=p.font.padding),p.attr.y+=p.font.padding,delete p.attr.class),l.noClass&&delete p.attr.class,p.attr.x=t(p.attr.x),p.attr.y=t(p.attr.y),l.name&&(p.attr["data-name"]=l.name);var S=a.paper.text(y,p.attr);if(p.font.box){var A=S.getBBox(),M=0;p.attr["text-anchor"]==="middle"?M=A.width/2+p.font.padding:p.attr["text-anchor"]==="end"&&(M=A.width+p.font.padding*2);var w=0;l.centerVertically&&(w=A.height-p.font.padding),a.paper.rect({"data-name":"box",x:Math.round(l.x-M),y:Math.round(c-w),width:Math.round(A.width+p.font.padding*2),height:Math.round(A.height+p.font.padding*2)}),u||(S=a.paper.closeGroup())}return S}return s3=r,s3}var a3,b6;function VP(){if(b6)return a3;b6=1;var t=pu(),r=ss(),a=el();function l(y,S,A){var M=S.startVoice.staff.absoluteY-r.STEP*10;return S.endVoice&&S.endVoice.staff?S.endY=S.endVoice.staff.absoluteY-r.STEP*2:S.lastContinuedVoice&&S.lastContinuedVoice.staff?S.endY=S.lastContinuedVoice.staff.absoluteY-r.STEP*2:S.endY=S.startVoice.staff.absoluteY-r.STEP*2,p(y,S.x,M,S.endY,S.type,S.header,A)}function u(y,S,A,M,w){S+=r.STEP;var _=r.STEP*.75,C=r.STEP*.75,m=M-A,T=t("M %f %f l %f %f l %f %f l %f %f z",S,A-C,0,m+C*2,_,0,0,-(m+C*2)),L=r.STEP*2,N=r.STEP;return T+=t("M %f %f q %f %f %f %f q %f %f %f %f z",S+_,A-C,L*.6,N*.2,L,-N,-L*.1,N*.3,-L,N+r.STEP),T+=t("M %f %f q %f %f %f %f q %f %f %f %f z",S+_,A+C+m,L*.6,-N*.2,L,N,-L*.1,-N*.3,-L,-N-r.STEP),y.paper.path({path:T,stroke:y.foregroundColor,fill:y.foregroundColor,class:y.controller.classes.generate(w),"data-name":w})}function c(y,S,A,M,w){var _=M-A,C=f(S,A,[7.5,-8,21,0,18.5,-10.5,7.5],[0,_/5.5,_/3.14,_/2,_/2.93,_/4.88,0]);return C+=f(S,A,[0,17.5,-7.5,6.6,-5,20,0],[_/2,_/1.46,_/1.22,_,_/1.19,_/1.42,_/2]),y.paper.path({path:C,stroke:y.foregroundColor,fill:y.foregroundColor,class:y.controller.classes.generate(w),"data-name":w})}function f(y,S,A,M){return t("M %f %f C %f %f %f %f %f %f C %f %f %f %f %f %f z",y+A[0],S+M[0],y+A[1],S+M[1],y+A[2],S+M[2],y+A[3],S+M[3],y+A[4],S+M[4],y+A[5],S+M[5],y+A[6],S+M[6])}var p=function(y,S,A,M,w,_,C){var m;if(_){y.paper.openGroup({klass:y.controller.classes.generate("staff-extra voice-name"),"data-name":w});var T=A+(M-A)/2;T=T-y.controller.getTextSize.baselineToCenter(_,"voicefont","staff-extra voice-name",0,1),a(y,{x:y.padding.left,y:T,text:_,type:"voicefont",klass:"staff-extra voice-name",anchor:"start",centerVertically:!0})}return w==="brace"?m=c(y,S,A,M,w):w==="bracket"&&(m=u(y,S,A,M,w)),_&&(m=y.paper.closeGroup()),C.wrapSvgEl({el_type:w,startChar:-1,endChar:-1},m),m};return a3=l,a3}var o3,y6;function sh(){if(y6)return o3;y6=1;function t(r,a,l){var u=r.paper.path(a);return u}return o3=t,o3}var l3,w6;function UP(){if(w6)return l3;w6=1;var t=pu(),r=sh(),a=Pa();function l(m,T,L){(!T.anchor1||!T.anchor2||!T.anchor1.heads||!T.anchor2.heads||T.anchor1.heads.length===0||T.anchor2.heads.length===0)&&window.console.error("Glissando Element not set.");var N=4,B=m.calcY(T.anchor1.heads[0].pitch),W=m.calcY(T.anchor2.heads[0].pitch),G=T.anchor1.x+T.anchor1.w/2,R=T.anchor2.x+T.anchor2.w/2,ye=u(G,B,R,W),q=T.anchor1.w/2+N,se=T.anchor2.w/2+N,ve=c(G,B,R,W),he=f(B,ve,q);f(W,ve,-se);var ce=p(ye-q-se),de=C(m,G+q,he,ce,ve);return L.wrapSvgEl({el_type:"glissando",startChar:-1,endChar:-1},de),[de]}function u(m,T,L,N){var B=L-m,W=N-T;return Math.sqrt(B*B+W*W)}function c(m,T,L,N){return(N-T)/(L-m)}function f(m,T,L){return a(m+L*T)}function p(m){var T=5;return Math.max(2,Math.floor((m-T*2)/6))}var y=[[3.5,-4.8]],S=[[1.5,-1],[.3,-.3],[-3.5,3.8]],A=[[-1.5,2]],M=[[3,4],[3,-4]],w=[[-3,4],[-3,-4]];function _(m,T){for(var L="",N=0;N<m.length;N++)L+="l"+m[N][0]+" "+f(m[N][1],T,m[N][0]);return L}var C=function(m,T,L,N,B){var W=t("M %f %f",T,L);W+=_(y,B);var G;for(G=0;G<N;G++)W+=_(M,B);for(W+=_(S,B),G=0;G<N;G++)W+=_(w,B);return W+=_(A,B)+"z",r(m,{path:W,highlight:"stroke",stroke:m.foregroundColor,class:m.controller.classes.generate("decoration"),"data-name":"glissando"})};return l3=l,l3}var u3,S6;function $P(){if(S6)return u3;S6=1;var t=pu(),r=sh(),a=Pa();function l(c,f,p){f.pitch===void 0&&window.console.error("Crescendo Element y-coordinate not set.");var y=c.calcY(f.pitch)+4,S=8,A=f.anchor1?f.anchor1.x:0,M=f.anchor2?f.anchor2.x:800,w;return f.dir==="<"?w=u(c,y+S/2,y,y+S/2,y+S,A,M):w=u(c,y,y+S/2,y+S,y+S/2,A,M),p.wrapSvgEl({el_type:"dynamicDecoration",startChar:-1,endChar:-1},w),[w]}var u=function(c,f,p,y,S,A,M){f=a(f),p=a(p),y=a(y),S=a(S),A=a(A),M=a(M);var w=t("M %f %f L %f %f M %f %f L %f %f",A,f,M,p,A,y,M,S);return r(c,{path:w,highlight:"stroke",stroke:c.foregroundColor,class:c.controller.classes.generate("dynamics decoration"),"data-name":"dynamics"})};return u3=l,u3}var c3,C6;function Ky(){if(C6)return c3;C6=1;var t=Pa();function r(){this.ingroup=!1}r.prototype.beginGroup=function(l,u){this.paper=l,this.controller=u,this.path=[],this.lastM=[0,0],this.ingroup=!0,this.paper.openGroup()},r.prototype.isInGroup=function(){return this.ingroup},r.prototype.addPath=function(l){if(l=l||[],l.length!==0){l[0][0]="m",l[0][1]=t(l[0][1]-this.lastM[0]),l[0][2]=t(l[0][2]-this.lastM[1]),this.lastM[0]+=l[0][1],this.lastM[1]+=l[0][2],this.path.push(l[0]);for(var u=1,c=l.length;u<c;u++)l[u][0]==="m"&&(this.lastM[0]+=l[u][1],this.lastM[1]+=l[u][2]),this.path.push(l[u])}},r.prototype.endGroup=function(l,u){this.ingroup=!1;for(var c="",f=0;f<this.path.length;f++)c+=this.path[f].join(" ");this.path=[];var p=this.paper.closeGroup();return p&&(p.setAttribute("class",this.controller.classes.generate(l)),p.setAttribute("fill",this.controller.renderer.foregroundColor),p.setAttribute("stroke","none"),p.setAttribute("data-name",u)),p};var a=new r;return c3=a,c3}var h3,x6;function J9(){if(x6)return h3;x6=1;var t=el(),r=Jo(),a=Ky();function l(c,f,p,y,S){var A,M;if(!y)return null;if(y.length>1&&y.indexOf(".")<0){var w=a.isInGroup()?"":S.klass;c.paper.openGroup({"data-name":S.name,klass:w});for(var _=0,C=0;C<y.length;C++){var m=y[C];M=r.getYCorr(m),A=r.printSymbol(f+_,c.calcY(p+M),m,c.paper,{stroke:S.stroke,fill:S.fill}),A?C<y.length-1&&(_+=u(m,y[C+1],r.getSymbolWidth(m))):t(c,{x:f,y:c.y,text:"no symbol:"+y,type:"debugfont",klass:"debug-msg",anchor:"start"},!1)}var T=c.paper.closeGroup();return T}else return M=r.getYCorr(y),a.isInGroup()?A=r.printSymbol(f,c.calcY(p+M),y,c.paper,{"data-name":S.name}):A=r.printSymbol(f,c.calcY(p+M),y,c.paper,{klass:S.klass,stroke:S.stroke,fill:S.fill,"data-name":S.name}),A||(t(c,{x:f,y:c.y,text:"no symbol:"+y,type:"debugfont",klass:"debug-msg",anchor:"start"},!1),null)}function u(c,f,p){var y=p;return c==="f"&&f==="f"&&(y=y*2/3),c==="p"&&f==="p"&&(y=y*5/6),c==="f"&&f==="z"&&(y=y*5/8),y}return h3=l,h3}var f3,k6;function WP(){if(k6)return f3;k6=1;var t=J9();function r(a,l,u){l.pitch===void 0&&window.console.error("Dynamic Element y-coordinate not set.");var c=1,f=1,p=t(a,l.anchor.x,l.pitch,l.dec,{scalex:c,scaley:f,klass:a.controller.classes.generate("decoration dynamics"),fill:a.foregroundColor,stroke:"none",name:"dynamics"});return u.wrapSvgEl({el_type:"dynamicDecoration",startChar:-1,endChar:-1,decoration:l.dec},p),[p]}return f3=r,f3}var d3,M6;function GP(){if(M6)return d3;M6=1;var t=pu(),r=el(),a=sh(),l=Pa();function u(p,y,S){p.paper.openGroup({klass:p.controller.classes.generate("triplet "+y.durationClass),"data-name":"triplet"}),y.hasBeam||f(p,y.anchor1.x,y.startNote,y.anchor2.x+y.anchor2.w,y.endNote),r(p,{x:y.xTextPos,y:p.calcY(y.yTextPos-1),text:""+y.number,type:"tripletfont",anchor:"middle",centerVertically:!0,noClass:!0,name:""+y.number},!0);var A=p.paper.closeGroup();return S.wrapSvgEl({el_type:"triplet",startChar:-1,endChar:-1},A),A}function c(p,y,S,A){return t("M %f %f L %f %f",l(p),l(y),l(S),l(A))}function f(p,y,S,A,M){S=p.calcY(S),M=p.calcY(M);var w=5,_="";_+=c(y,S,y,S+w),_+=c(A,M,A,M+w);var C=y+(A-y)/2,m=8,T=(M-S)/(A-y),L=C-m,N=S+(L-y)*T;_+=c(y,S,L,N);var B=C+m,W=S+(B-y)*T;_+=c(B,W,A,M),a(p,{path:_,stroke:p.foregroundColor,"data-name":"triplet-bracket"})}return d3=u,d3}var p3,E6;function YP(){if(E6)return p3;E6=1;var t=pu(),r=el(),a=sh(),l=Pa();function u(c,f,p,y,S){f.pitch===void 0&&window.console.error("Ending Element y-coordinate not set.");var A=l(c.calcY(f.pitch)),M=20,w="";f.anchor1&&(p=l(f.anchor1.x+f.anchor1.w),w+=t("M %f %f L %f %f ",p,A,p,l(A+M))),f.anchor2&&(y=l(f.anchor2.x),w+=t("M %f %f L %f %f ",y,A,y,l(A+M))),w+=t("M %f %f L %f %f ",p,A,y,A),c.paper.openGroup({klass:c.controller.classes.generate("ending"),"data-name":"ending"}),a(c,{path:w,stroke:c.foregroundColor,fill:c.foregroundColor,"data-name":"line"}),f.anchor1&&r(c,{x:l(p+5),y:l(c.calcY(f.pitch-.5)),text:f.text,type:"repeatfont",klass:"ending",anchor:"start",noClass:!0,name:f.text});var _=c.paper.closeGroup();return S.wrapSvgEl({el_type:"ending",startChar:-1,endChar:-1},_),[_]}return p3=u,p3}var g3,A6;function KP(){if(A6)return g3;A6=1;var t=pu(),r=Pa();function a(c,f,p,y,S){l(f,p,y);var A="";f.anchor1?A+="abcjs-start-m"+f.anchor1.parent.counters.measure+"-n"+f.anchor1.parent.counters.note:A+="abcjs-start-edge",f.anchor2?A+=" abcjs-end-m"+f.anchor2.parent.counters.measure+"-n"+f.anchor2.parent.counters.note:A+=" abcjs-end-edge",f.hint&&(A="abcjs-hint");var M=f.fixedY?1.5:0,w=u(c,f.startX,f.endX,f.startY+M,f.endY+M,f.above,A,f.isTie,f.dotted),_=-1;f.anchor1&&!f.isTie&&(_=f.anchor1.parent.abcelem.startChar-1);var C=-1;return f.anchor2&&!f.isTie&&(C=f.anchor2.parent.abcelem.endChar+1),S.wrapSvgEl({el_type:"slur",startChar:_,endChar:C},w),[w]}var l=function(c,f,p){!c.anchor1||!c.anchor2||c.anchor1.pitch===c.anchor2.pitch&&c.internalNotes.length===0?c.isTie=!0:c.isTie=!1,c.isTie?(c.calcTieDirection(),c.calcX(f,p),c.calcTieY()):(c.calcSlurDirection(),c.calcX(f,p),c.calcSlurY()),c.avoidCollisionAbove()},u=function(c,f,p,y,S,A,M,w,_){var C=w?1.2:1.5;f=r(f+6),p=r(p+4),y=y+(A?C:-C),S=S+(A?C:-C);var m=r(c.calcY(y)),T=r(c.calcY(S)),L=p-f,N=T-m,B=Math.sqrt(L*L+N*N),W=L/B,G=N/B,R=B/3.5,ye=w?10:25,q=(A?-1:1)*Math.min(ye,Math.max(4,R)),se=r(f+R*W-q*G),ve=r(m+R*G+q*W),he=r(p-R*W-q*G),ce=r(T-R*G+q*W),de=2;M?M+=" slur":M="slur",M+=w?" tie":" legato";var K;if(_){M+=" dotted";var Q=t("M %f %f C %f %f %f %f %f %f",f,m,se,ve,he,ce,p,T);K=c.paper.path({path:Q,stroke:c.foregroundColor,fill:"none","stroke-dasharray":"5 5",class:c.controller.classes.generate(M),"data-name":w?"tie":"slur"})}else{var le=t("M %f %f C %f %f %f %f %f %f C %f %f %f %f %f %f z",f,m,se,ve,he,ce,p,T,r(he-de*G),r(ce+de*W),r(se-de*G),r(ve+de*W),f,m);K=c.paper.path({path:le,stroke:"none",fill:c.foregroundColor,class:c.controller.classes.generate(M),"data-name":w?"tie":"slur"})}return K};return g3=a,g3}var v3,T6;function XP(){if(T6)return v3;T6=1;var t=sh(),r=Pa();function a(f,p){if(p.beams.length!==0){for(var y="",S=0;S<p.beams.length;S++){var A=p.beams[S];if(A.split){for(var M=u(f,A.startX,A.startY,A.endX,A.endY),w=[],_=0;_<A.split.length;_+=2)w.push([A.split[_],A.split[_+1]]);for(_=0;_<w.length;_++){var C=c(A.startX,A.startY,M,w[_][0]),m=c(A.startX,A.startY,M,w[_][1]);y+=l(f,w[_][0],C,w[_][1],m,A.dy)}}else y+=l(f,A.startX,A.startY,A.endX,A.endY,A.dy)}var T=("abcjs-d"+p.duration).replace(/\./g,"-"),L=f.controller.classes.generate("beam-elem "+T),N=t(f,{path:y,stroke:"none",fill:f.foregroundColor,class:L});return[N]}}function l(f,p,y,S,A,M){y=r(f.calcY(y)),A=r(f.calcY(A)),p=r(p),S=r(S);var w=r(y+M),_=r(A+M);return"M"+p+" "+y+" L"+S+" "+A+"L"+S+" "+_+" L"+p+" "+w+"z"}function u(f,p,y,S,A){return(A-y)/(S-p)}function c(f,p,y,S){var A=S-f;return p+A*y}return v3=a,v3}var m3,I6;function e7(){if(I6)return m3;I6=1;var t=Ky(),r=Pa();function a(l,u,c,f,p,y,S){if(c<0||f<p){var A=r(p);p=r(f),f=A}else f=r(f),p=r(p);u=r(u);var M=r(u+c);if(l.firefox112){u+=c/2;var _={x1:u,x2:u,y1:f,y2:p,stroke:l.foregroundColor,"stroke-width":Math.abs(c)};return y&&(_.class=y),S&&(_["data-name"]=S),l.paper.lineToBack(_)}for(var w=[["M",u,f],["L",u,p],["L",M,p],["L",M,f],["z"]],_={path:""},C=0;C<w.length;C++)_.path+=w[C].join(" ");return y&&(_.class=y),S&&(_["data-name"]=S),t.isInGroup()||(_.stroke="none",_.fill=l.foregroundColor),l.paper.pathToBack(_)}return m3=a,m3}var _3,P6;function QP(){if(P6)return _3;P6=1;var t=pu(),r=Pa();function a(l,u,c,f,p,y,S){var A=l.foregroundColor;u=r(u),c=r(c);var M=r(f-S),w=r(f+S);if(l.firefox112){f+=S/2;var _={x1:u,x2:c,y1:f,y2:f,stroke:l.foregroundColor,"stroke-width":Math.abs(S*2)};return p&&(_.class=p),y&&(_["data-name"]=y),l.paper.lineToBack(_)}var C=t("M %f %f L %f %f L %f %f L %f %f z",u,M,c,M,c,w,u,w),m={path:C,stroke:"none",fill:A};y&&(m["data-name"]=y),p&&(m.class=p);var T=l.paper.pathToBack(m);return T}return _3=a,_3}var b3,N6;function t7(){if(N6)return b3;N6=1;var t=QP();function r(a,l,u,c,f,p,y){var S=a.calcY(c);return t(a,l,u,S,f,p,y)}return b3=r,b3}var y3,L6;function r7(){if(L6)return y3;L6=1;var t=el(),r=e7(),a=t7(),l=J9();function u(f,p,y){p.pitch===void 0&&window.console.error(p.type+" Relative Element y-coordinate not set.");var S=f.calcY(p.pitch);switch(p.type){case"symbol":if(p.c===null)return null;var A="symbol";p.klass&&(A+=" "+p.klass),p.graphelem=l(f,p.x,p.pitch,p.c,{scalex:p.scalex,scaley:p.scaley,klass:f.controller.classes.generate(A),name:p.name});break;case"debug":p.graphelem=t(f,{x:p.x,y:f.calcY(15),text:""+p.c,type:"debugfont",klass:f.controller.classes.generate("debug-msg"),anchor:"start",centerVertically:!1,dim:p.dim},!1);break;case"tabNumber":var M="middle",w="tabnumberfont",_="abcjs-tab-number";p.isGrace&&(w="tabgracefont",S+=2.5,_="tab-grace"),p.graphelem=t(f,{x:p.x,y:S,text:""+p.c,type:w,klass:f.controller.classes.generate(_),anchor:M,centerVertically:!1,dim:p.dim,cursor:"default"},!1);break;case"barNumber":p.graphelem=t(f,{x:p.x,y:S,text:""+p.c,type:"measurefont",klass:f.controller.classes.generate("bar-number"),anchor:"middle",dim:p.dim,name:"bar-number"},!0);break;case"lyric":p.graphelem=t(f,{x:p.x,y:S,text:p.c,type:"vocalfont",klass:f.controller.classes.generate("lyric"),anchor:"middle",dim:p.dim,name:"lyric"},!1);break;case"chord":p.graphelem=t(f,{x:p.x,y:S,text:p.c,type:"gchordfont",klass:f.controller.classes.generate("chord"),anchor:"middle",dim:p.dim,lane:p.getLane(),name:"chord"},!1);break;case"decoration":p.graphelem=t(f,{x:p.x,y:S+6,text:p.c,type:"annotationfont",klass:f.controller.classes.generate("annotation"),anchor:p.anchor,centerVertically:!0,dim:p.dim},!1);break;case"text":p.graphelem=t(f,{x:p.x,y:S,text:p.c,type:"annotationfont",klass:f.controller.classes.generate("annotation"),anchor:"start",centerVertically:p.centerVertically,dim:p.dim,lane:p.getLane(),name:"annotation"},!1);break;case"multimeasure-text":p.graphelem=t(f,{x:p.x+p.w/2,y:S,text:p.c,type:"tempofont",klass:f.controller.classes.generate("rest"),anchor:"middle",centerVertically:!1,dim:p.dim},!1);break;case"part":p.graphelem=t(f,{x:p.x,y:S,text:p.c,type:"partsfont",klass:f.controller.classes.generate("part"),anchor:"start",dim:p.dim,name:p.c},!0);break;case"bar":p.graphelem=r(f,p.x,p.linewidth+f.lineThickness,S,y||f.calcY(p.pitch2),null,"bar");break;case"stem":var C=p.linewidth>0?p.linewidth+f.lineThickness:p.linewidth-f.lineThickness;p.graphelem=r(f,p.x,C,S,f.calcY(p.pitch2),"abcjs-stem","stem");break;case"ledger":p.graphelem=a(f,p.x,p.x+p.w,p.pitch,"abcjs-ledger","ledger",.35+f.lineThickness);break}return p.scalex!==1&&p.graphelem&&c(f.paper,p.graphelem,p.scalex,p.scaley,p.x,S),p.graphelem}function c(f,p,y,S,A,M){f.setAttributeOnElement(p,{style:"transform:scale("+y+","+S+");transform-origin:"+A+"px "+M+"px;"})}return y3=u,y3}var w3,O6;function ZP(){if(O6)return w3;O6=1;var t=r7(),r=el();function a(l,u){var c=u.x;u.pitch===void 0&&window.console.error("Tempo Element y-coordinate not set."),u.tempo.el_type="tempo";var f=l.calcY(u.pitch)+2,p,y;if(u.tempo.preString){p=r(l,{x:c,y:f,text:u.tempo.preString,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"pre"},!0),y=l.controller.getTextSize.calc(u.tempo.preString,"tempofont","tempo",p);var S=y.width,A=S/u.tempo.preString.length;c+=S+A}if(u.note){u.note.setX(c);for(var M=0;M<u.note.children.length;M++)t(l,u.note.children[M],c);c+=u.note.w+5;var w="= "+u.tempo.bpm;p=r(l,{x:c,y:f,text:w,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"beats"}),y=l.controller.getTextSize.calc(w,"tempofont","tempo",p);var _=y.width,C=_/w.length;c+=_+C}u.tempo.postString&&r(l,{x:c,y:f,text:u.tempo.postString,type:"tempofont",klass:"abcjs-tempo",anchor:"start",noClass:!0,name:"post"},!0)}return w3=a,w3}var S3,D6;function jP(){if(D6)return S3;D6=1;var t=ZP(),r=r7(),a=ss(),l=Wy(),u=Ky();function c(f,p,y,S,A){if(!p.invisible){var M=p.children.length>0&&p.children[0].type==="TempoElement";p.elemset=[],u.beginGroup(f.paper,f.controller);for(var w=0;w<p.children.length;w++){var _=p.children[w];switch(_.type){case"TempoElement":t(f,_);break;default:var C=r(f,_,y);_.type==="symbol"&&_.c&&_.c.indexOf("notehead")>=0&&C.setAttribute("class","abcjs-notehead")}}var m=p.type;if((p.type==="note"||p.type==="rest")&&(p.counters=f.controller.classes.getCurrent(),m+=" d"+Math.round(p.durationClass*1e3)/1e3,m=m.replace(/\./g,"-"),p.abcelem.pitches))for(var T=0;T<p.abcelem.pitches.length;T++)m+=" p"+p.abcelem.pitches[T].pitch;var L=u.endGroup(m,p.type);if(L){if(p.cloned&&(p.cloned.overrideClasses=L.className.baseVal),p.overrideClasses){var N=L.classList&&L.classList.length>0?L.classList[0]+" ":"";L.setAttribute("class",N+p.overrideClasses)}if(M)p.startChar=p.abcelem.startChar,p.endChar=p.abcelem.endChar,S.add(p,L,!1,A);else{p.elemset.push(L);var B=!1;(p.type==="note"||p.type==="tabNumber")&&(B=!0),S.add(p,L,B,A)}}else p.elemset.length>0&&S.add(p,p.elemset[0],p.type==="note",A);if(p.klass&&l(p.elemset,"mark","","#00ff00"),p.hint&&l(p.elemset,"abcjs-hint","",null),p.abcelem.abselem=p,p.heads&&p.heads.length>0){p.notePositions=[];for(var W=0;W<p.heads.length;W++)p.notePositions.push({x:p.heads[W].x+p.heads[W].w/2,y:A.zero-p.heads[W].pitch*a.STEP})}}}return S3=c,S3}var C3,R6;function JP(){if(R6)return C3;R6=1;var t=UP(),r=$P(),a=WP(),l=GP(),u=YP(),c=KP(),f=XP(),p=el(),y=jP();function S(M,w,_,C,m){var T=w.w-1;M.staffbottom=w.staff.bottom;var L=M.foregroundColor;if(w.color&&(M.foregroundColor=w.color),w.header){var N=p(M,{x:M.padding.left,y:M.calcY(w.headerPosition),text:w.header,type:"voicefont",klass:"staff-extra voice-name",anchor:"start",centerVertically:!0,name:"voice-name"},!0);C.wrapSvgEl({el_type:"voiceName",startChar:-1,endChar:-1,text:w.header},N)}var B,W,G=!1;for(B=0;B<w.children.length;B++){W=w.children[B],(W.type==="note"||W.type==="rest")&&(G=!0);var R=!1;W.type!=="staff-extra"&&!M.controller.classes.isInMeasure()&&(M.controller.classes.startMeasure(),R=!0),w.staff.isTabStaff&&(W.invisible=!1,W.type=="bar"&&W.abcelem.lastBar&&(_=w.topLine)),y(M,W,w.barto||B===w.children.length-1?_:0,C,m),(W.type==="note"||A(W))&&M.controller.classes.incrNote(),W.type==="bar"&&!R&&G&&M.controller.classes.incrMeasure()}for(M.controller.classes.startMeasure(),B=0;B<w.beams.length;B++){var ye=w.beams[B];ye==="bar"?M.controller.classes.incrMeasure():f(M,ye,C)}for(M.controller.classes.startMeasure(),B=0;B<w.otherchildren.length;B++)if(W=w.otherchildren[B],W==="bar")M.controller.classes.incrMeasure();else switch(W.type){case"GlissandoElem":W.elemset=t(M,W,C);break;case"CrescendoElem":W.elemset=r(M,W,C);break;case"DynamicDecoration":W.elemset=a(M,W,C);break;case"TripletElem":l(M,W,C);break;case"EndingElem":W.elemset=u(M,W,w.startx+10,T,C);break;case"TieElem":W.elemset=c(M,W,w.startx+10,T,C);break;default:console.log(W),y(M,W,w.startx+10,T,C,m)}M.foregroundColor=L}function A(M){return M.type!=="rest"?!1:!!(M.abcelem&&M.abcelem.rest&&M.abcelem.rest.type!=="spacer")}return C3=S,C3}var x3,B6;function eN(){if(B6)return x3;B6=1;var t=t7();function r(a,l,u,c,f,p){var y="abcjs-top-line",S=2;f&&(S=f),a.paper.openGroup({prepend:!0,klass:a.controller.classes.generate("abcjs-staff")});var A=0,M=0;if(c===1)t(a,l,u,6,y,null,p+a.lineThickness),A=a.calcY(10),M=a.calcY(2);else for(var w=c-1;w>=0;w--){var _=(w+1)*S;M=a.calcY(_),A===0&&(A=M),t(a,l,u,_,y,null,p+a.lineThickness),y=void 0}return a.paper.closeGroup(),[A,M]}return x3=r,x3}var k3,F6;function tN(){if(F6)return k3;F6=1;function t(r,a,l){var u=r.paper.rectBeneath(a);return l&&r.paper.text(l,{x:0,y:a.y+7,"text-anchor":"start","font-size":"14px",fill:"rgba(0,0,255,.4)",stroke:"rgba(0,0,255,.4)"}),u}return k3=t,k3}var M3,q6;function rN(){if(q6)return M3;q6=1;function t(r,a){var l="rgba(0,0,0,255)",u="rgba(0,0,0,0)",c=Math.round(r.y),f=r.controller.width,p=(f-a)/2,y=p+a,S="M "+p+" "+c+" L "+y+" "+c+" L "+y+" "+(c+1)+" L "+p+" "+(c+1)+" L "+p+" "+c+" z";r.paper.pathToBack({path:S,stroke:u,fill:l,class:r.controller.classes.generate("defined-text")})}return M3=t,M3}var E3,z6;function n7(){if(z6)return E3;z6=1;var t=rN(),r=el();function a(l,u,c){for(var f=0;f<u.rows.length;f++){var p=u.rows[f];if(p.absmove)l.absolutemoveY(p.absmove);else if(p.move)l.moveY(p.move);else if(p.text||p.phrases){var y=p.left?p.left:0,S=r(l,{x:y,y:l.y,text:p.text,phrases:p.phrases,"dominant-baseline":p["dominant-baseline"],type:p.font,klass:p.klass,name:p.name,anchor:p.anchor});p.absElemType&&c.wrapSvgEl({el_type:p.absElemType,name:p.name,startChar:p.startChar,endChar:p.endChar,text:p.text},S)}else if(p.separator)t(l,p.separator);else if(p.startGroup)l.paper.openGroup({klass:p.klass,"data-name":p.name});else if(p.endGroup){var A=l.paper.closeGroup();p.absElemType&&c.wrapSvgEl({el_type:p.absElemType,name:p.name,startChar:p.startChar,endChar:p.endChar,text:""},A)}}}return E3=a,E3}var A3,H6;function nN(){if(H6)return A3;H6=1;var t=ss(),r=VP(),a=JP(),l=eN(),u=tN(),c=e7(),f=n7();function p(A,M,w,_){for(var C,m=A.y,T=0;T<M.staffs.length;T++){var L=M.staffs[T];A.moveY(t.STEP,L.top),L.absoluteY=A.y,A.showDebug&&(A.showDebug.indexOf("box")>=0&&L.voices&&S(A,M.voices,L.voices),A.showDebug.indexOf("grid")>=0&&(A.paper.dottedLine({x1:A.padding.left,x2:A.padding.left+A.controller.width,y1:m,y2:m,stroke:"#0000ff"}),u(A,{x:A.padding.left,y:A.calcY(L.originalTop),width:A.controller.width,height:A.calcY(L.originalBottom)-A.calcY(L.originalTop),fill:A.foregroundColor,stroke:A.foregroundColor,"fill-opacity":.1,"stroke-opacity":.1}),C=0,K(L,"chordHeightAbove"),K(L,"chordHeightBelow"),K(L,"dynamicHeightAbove"),K(L,"dynamicHeightBelow"),K(L,"endingHeightAbove"),K(L,"lyricHeightAbove"),K(L,"lyricHeightBelow"),K(L,"partHeightAbove"),K(L,"tempoHeightAbove"),K(L,"volumeHeightAbove"),K(L,"volumeHeightBelow"))),A.moveY(t.STEP,-L.bottom),A.showDebug&&A.showDebug.indexOf("grid")>=0&&A.paper.dottedLine({x1:A.padding.left,x2:A.padding.left+A.controller.width,y1:A.y,y2:A.y,stroke:"#0000aa"})}for(var N,B,W=2,G=0,R=0;R<M.voices.length;R++){var ye=M.voices[R].staff,q=M.voices[R].tabNameInfos;if(A.y=ye.absoluteY,A.controller.classes.incrVoice(),!M.voices[R].duplicate){if(N||(N=A.calcY(10)),B=A.calcY(W),ye.lines!==0){ye.linePitch&&(W=ye.linePitch),A.controller.classes.newMeasure();var se=l(A,M.startx,M.w,ye.lines,ye.linePitch,.35);B=se[1],ye.bottomLine=B,ye.topLine=se[0],ye.hasTab&&(G=ye.topLine),ye.hasStaff&&(G=ye.hasStaff.topLine,M.voices[R].barto=!0,M.voices[R].topLine=N)}y(A,ye.absoluteY,M.brace,R,w),y(A,ye.absoluteY,M.bracket,R,w)}a(A,M.voices[R],G,w,{top:m,zero:A.y,height:M.height*t.STEP});var ve=0;if(q){var he={rows:[]};he.rows.push({absmove:B+2});var ce=8;he.rows.push({left:M.startx+ce,text:q.name,font:"tablabelfont",klass:"text instrument-name",anchor:"start"}),he.rows.push({move:q.textSize.height}),f(A,he),ve=q.textSize.height}A.controller.classes.newMeasure(),M.voices[R].duplicate||(G=A.calcY(2+ve))}A.controller.classes.newMeasure();var de=M.staffs.length;de>1&&(N=M.staffs[0].topLine,B=M.staffs[de-1].bottomLine,c(A,M.startx,.6,N,B,null)),A.y=m;function K(Q,le){var Ee=["rgb(207,27,36)","rgb(168,214,80)","rgb(110,161,224)","rgb(191,119,218)","rgb(195,30,151)","rgb(31,170,177)","rgb(220,166,142)"];if(Q.positionY&&Q.positionY[le]){var Me=Q.specialY[le]*t.STEP;le==="chordHeightAbove"&&Q.specialY.chordLines&&Q.specialY.chordLines.above&&(Me*=Q.specialY.chordLines.above),le==="chordHeightBelow"&&Q.specialY.chordLines&&Q.specialY.chordLines.below&&(Me*=Q.specialY.chordLines.below),u(A,{x:A.padding.left,y:A.calcY(Q.positionY[le]),width:A.controller.width,height:Me,fill:Ee[C],stroke:Ee[C],"fill-opacity":.4,"stroke-opacity":.4},le.substr(0,4)),C+=1,C>6&&(C=0)}}}function y(A,M,w,_,C){if(w)for(var m=0;m<w.length;m++)w[m].isStartVoice(_)&&(w[m].startY=M-t.STEP*10,w[m].elemset=r(A,w[m],C))}function S(A,M,w){for(var _=0;_<w.length;_++)for(var C=M[w[_]].children,m=0;m<C.length;m++){var T=C[m],L=T.getFixedCoords();if(!(T.invisible||L.t===void 0||L.b===void 0)){var N=(L.t-L.b)*t.STEP;u(A,{x:L.x,y:A.calcY(L.t),width:L.w,height:N,fill:"#88e888","fill-opacity":.4,stroke:"#4aa93d","stroke-opacity":.8});for(var B=0;B<T.children.length;B++){var W=T.children[B],G=W.getChordDim();if(G){var R=A.calcY(W.pitch);R+=W.dim.font.size*W.getLane(),u(A,{x:G.left,y:R,width:G.right-G.left,height:W.dim.font.size,fill:"none",stroke:"#4aa93d","stroke-opacity":.8})}}}}}return A3=p,A3}var T3,V6;function iN(){if(V6)return T3;V6=1;function t(r,a,l,u){var c=(a+r.padding.left+r.padding.right)*l,f=(r.y+r.padding.bottom)*l;if(r.isPrint&&(f=Math.max(f,1056)),r.ariaLabel!==""){var p="Sheet Music";r.abctune&&r.abctune.metaText&&r.abctune.metaText.title&&(p+=' for "'+r.abctune.metaText.title+'"'),r.paper.setTitle(p);var y=r.ariaLabel?r.ariaLabel:p;r.paper.setAttribute("aria-label",y)}var S=["-webkit-touch-callout: none;","-webkit-user-select: none;","-khtml-user-select: none;","-moz-user-select: none;","-ms-user-select: none;","user-select: none;"];r.paper.insertStyles(".abcjs-dragging-in-progress text, .abcjs-dragging-in-progress tspan {"+S.join(" ")+"}");var A={overflow:"hidden"};u==="resize"?r.paper.setResponsiveWidth(c,f):(A.width="",A.height=f+"px",l<1?(A.width=c+"px",r.paper.setSize(c/l,f/l)):r.paper.setSize(c,f)),r.paper.setScale(l),r.paper.setParentStyles(A)}return T3=t,T3}var I3,U6;function sN(){if(U6)return I3;U6=1;var t=$9(),r=W9();function a(l,u,c){this.elements=[],this.paper=l,this.tuneNumber=c,this.selectTypes=u}return a.prototype.getElements=function(){return this.elements},a.prototype.add=function(l,u,c,f){if(this.canSelect(l)){var p;this.selectTypes===void 0?p={selectable:!1,"data-index":this.elements.length}:p={selectable:!0,tabindex:0,"data-index":this.elements.length},this.paper.setAttributeOnElement(u,p);var y={absEl:l,svgEl:u,isDraggable:c};f!==void 0&&(y.staffPos=f),this.elements.push(y)}},a.prototype.canSelect=function(l){return this.selectTypes===!1||!l||!l.abcelem?!1:this.selectTypes===!0?!0:this.selectTypes===void 0?l.abcelem.el_type==="note"||l.abcelem.el_type==="tabNumber":this.selectTypes.indexOf(l.abcelem.el_type)>=0},a.prototype.wrapSvgEl=function(l,u){var c={tuneNumber:this.tuneNumber,abcelem:l,elemset:[u],highlight:t,unhighlight:r};this.add(c,u,!1)},I3=a,I3}var P3,$6;function aN(){if($6)return P3;$6=1;var t=nN(),r=iN(),a=n7(),l=ss(),u=sN();function c(y,S,A,M,w,_,C,m,T,L){var N=new u(y.paper,m,T),B={};S.shouldAddClasses&&(B.klass="abcjs-meta-top"),y.paper.openGroup(B),y.moveY(y.padding.top),a(y,A.topText,N),y.paper.closeGroup(),y.moveY(y.spacing.music);for(var W=[],G=0;G<A.lines.length;G++){S.incrLine();var R=A.lines[G];if(R.staff){S.shouldAddClasses&&(B.klass="abcjs-staff-wrapper abcjs-l"+S.lineNumber),y.paper.openGroup(B),R.vskip&&y.moveY(R.vskip),W.length>=1&&p(y,y.spacing.staffSeparation,W[W.length-1],R.staffGroup);var ye=f(y,R.staffGroup,N,G);ye.line=L+G,W.push(ye),y.paper.closeGroup()}else R.nonMusic&&(S.shouldAddClasses&&(B.klass="abcjs-non-music"),y.paper.openGroup(B),a(y,R.nonMusic,N),y.paper.closeGroup())}return S.reset(),A.bottomText&&A.bottomText.rows&&A.bottomText.rows.length>0&&(S.shouldAddClasses&&(B.klass="abcjs-meta-bottom"),y.paper.openGroup(B),y.moveY(24),a(y,A.bottomText,N),y.paper.closeGroup()),r(y,w,C,_),{staffgroups:W,selectables:N.getElements()}}function f(y,S,A,M){t(y,S,A,M);var w=S.height*l.STEP;return y.y+=w,S}function p(y,S,A,M){var w=A.staffs[A.staffs.length-1],_=-(w.bottom-2),C=M.staffs[0].top-10,m=C+_,T=m*l.STEP;T<S&&y.moveY(S-T)}return P3=c,P3}var N3,W6;function oN(){if(W6)return N3;W6=1;var t=Z9();function r(a){for(var l=a;l&&l.attributes&&l.tagName.toLowerCase()!=="svg"&&!l.attributes.selectable;)l=l.parentNode;if(l&&l.attributes&&l.attributes.selectable){var u=l.attributes["data-index"].nodeValue;if(u&&(u=parseInt(u,10),u>=0&&u<this.selectables.length)){var c=this.selectables[u],f=t(c,a);return f.index=u,f.element=c,f}}return null}return N3=r,N3}var L3,G6;function i7(){if(G6)return L3;G6=1;var t=ss(),r=SP(),a=xP(),l=kP(),u=MP(),c=EP(),f=AP(),p=TP(),y=IP(),S=FP(),A=qP(),M=zP(),w=HP(),_=aN(),C=K9(),m=oN(),T=function(B,W){W=W||{},this.findSelectableElement=m,this.oneSvgPerLine=W.oneSvgPerLine,this.selectionColor=W.selectionColor,this.dragColor=W.dragColor?W.dragColor:W.selectionColor,this.dragging=!!W.dragging,this.selectTypes=W.selectTypes,this.responsive=W.responsive,this.space=3*t.SPACE,this.initialClef=W.initialClef,this.timeBasedLayout=W.timeBasedLayout,this.expandToWidest=!!W.expandToWidest,this.scale=W.scale?parseFloat(W.scale):0,this.classes=new A({shouldAddClasses:W.add_classes}),this.scale>.1||(this.scale=void 0),W.staffwidth?(this.staffwidthScreen=W.staffwidth,this.staffwidthPrint=W.staffwidth):(this.staffwidthScreen=740,this.staffwidthPrint=680),this.listeners=[],W.clickListener&&this.addSelectListener(W.clickListener),this.renderer=new a(B),this.renderer.setPaddingOverride(W),W.showDebug&&(this.renderer.showDebug=W.showDebug),W.jazzchords&&(this.jazzchords=W.jazzchords),W.accentAbove&&(this.accentAbove=W.accentAbove),W.germanAlphabet&&(this.germanAlphabet=W.germanAlphabet),W.lineThickness&&(this.lineThickness=W.lineThickness),this.renderer.controller=this,this.renderer.foregroundColor=W.foregroundColor?W.foregroundColor:"currentColor",W.ariaLabel!==void 0&&(this.renderer.ariaLabel=W.ariaLabel),this.renderer.minPadding=W.minPadding?W.minPadding:0,this.reset()};T.prototype.reset=function(){this.selected=[],this.staffgroups=[],this.engraver&&this.engraver.reset(),this.engraver=null,this.renderer.reset(),this.dragTarget=null,this.dragIndex=-1,this.dragMouseStart={x:-1,y:-1},this.dragYStep=0,this.lineThickness&&this.renderer.setLineThickness(this.lineThickness)},T.prototype.engraveABC=function(B,W,G){B[0]===void 0&&(B=[B]),this.reset();for(var R=0;R<B.length;R++)W===void 0&&(W=R),this.getFontAndAttr=new M(B[R].formatting,this.classes),this.getTextSize=new w(this.getFontAndAttr,this.renderer.paper),this.engraveTune(B[R],W,G)},T.prototype.adjustNonScaledItems=function(B){this.width/=B,this.renderer.adjustNonScaledItems(B)},T.prototype.getMeasureWidths=function(B){this.reset(),this.getFontAndAttr=new M(B.formatting,this.classes),this.getTextSize=new w(this.getFontAndAttr,this.renderer.paper);var W=this.jazzchords;this.setupTune(B,0),this.constructTuneElements(B),S(this.renderer,B,0,this.space,this.timeBasedLayout);for(var G=[],R,ye=!0,q=0;q<B.lines.length;q++){var se=B.lines[q];if(se.staff){if(ye&&(R={left:0,measureWidths:[],total:0},G.push(R),ye=!1),se.staffGroup.voices.length>0)for(var ve=se.staffGroup.voices[0],he=!1,ce=0,de=0;de<ve.children.length;de++){var K=ve.children[de];!he&&!K.isClef&&!K.isKeySig&&(he=!0,R.left=K.x,ce=K.x),K.type==="bar"&&(R.measureWidths.push(K.x-ce),R.total+=K.x-ce,ce=K.x)}}else ye=!0}return this.jazzchords=W,G},T.prototype.setupTune=function(B,W){this.classes.reset(),B.formatting.jazzchords!==void 0&&(this.jazzchords=B.formatting.jazzchords),B.formatting.accentAbove!==void 0&&(this.accentAbove=B.formatting.accentAbove),this.renderer.newTune(B),this.engraver=new r(this.getTextSize,W,{bagpipes:B.formatting.bagpipes,flatbeams:B.formatting.flatbeams,graceSlurs:B.formatting.graceSlurs!==!1,percmap:B.formatting.percmap,initialClef:this.initialClef,jazzchords:this.jazzchords,timeBasedLayout:this.timeBasedLayout,accentAbove:this.accentAbove,germanAlphabet:this.germanAlphabet}),this.engraver.setStemHeight(this.renderer.spacing.stemHeight),this.engraver.measureLength=B.getMeterFraction().num/B.getMeterFraction().den,B.formatting.staffwidth?this.width=B.formatting.staffwidth*1.33:this.width=this.renderer.isPrint?this.staffwidthPrint:this.staffwidthScreen;var G=B.formatting.scale?B.formatting.scale:this.scale;return this.responsive==="resize"&&(G=void 0),G===void 0&&(G=this.renderer.isPrint?.75:1),this.adjustNonScaledItems(G),G},T.prototype.constructTuneElements=function(B){B.topText=new f(B.metaText,B.metaTextInfo,B.formatting,B.lines,this.width,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize);var W,G,R=!1,ye=!1;for(W=0;W<B.lines.length;W++)if(G=B.lines[W],G.staff)ye=!0,G.staffGroup=this.engraver.createABCLine(G.staff,R?null:B.metaText.tempo,W),R=!0;else if(G.subtitle){if(ye){var q=this.width/2+this.renderer.padding.left;G.nonMusic=new c(this.renderer.spacing.subtitle,B.formatting,G.subtitle,q,this.renderer.padding.left,this.getTextSize)}}else G.text!==void 0?(ye=!0,G.nonMusic=new l(G.text,G.vskip,this.getFontAndAttr,this.renderer.padding.left,this.width,this.getTextSize)):G.separator!==void 0&&G.separator.lineLength&&(ye=!0,G.nonMusic=new u(G.separator.spaceAbove,G.separator.lineLength,G.separator.spaceBelow));B.bottomText=new p(B.metaText,this.width,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize)},T.prototype.engraveTune=function(B,W,G){var R=this.jazzchords,ye=this.setupTune(B,W);this.constructTuneElements(B);var q=S(this.renderer,B,this.width,this.space,this.expandToWidest,this.timeBasedLayout);if(this.expandToWidest&&q>this.width+1&&(B.topText=new f(B.metaText,B.metaTextInfo,B.formatting,B.lines,q,this.renderer.isPrint,this.renderer.padding.left,this.renderer.spacing,this.classes.shouldAddClasses,this.getTextSize),B.lines&&B.lines.length>0))for(var se=B.lines.length,ve=0;ve<se;++ve){var he=B.lines[ve];if(he.nonMusic&&he.nonMusic.rows&&he.nonMusic.rows.length>0)for(var ce=he.nonMusic.rows.length,de=0;de<ce;++de){var K=he.nonMusic.rows[de];K.left&&(he.subtitle?K.left=q/2+this.renderer.padding.left:he.text&&he.text.length>0&&he.text[0].center&&(K.left=q/2+this.renderer.padding.left))}}B.tablatures&&C.layoutTablatures(this.renderer,B);var Q=_(this.renderer,this.classes,B,this.width,q,this.responsive,ye,this.selectTypes,W,G);if(this.staffgroups=Q.staffgroups,this.selectables=Q.selectables,this.oneSvgPerLine){var le=this.renderer.paper.svg.parentNode;this.svgs=L(this.renderer,le,B.metaText.title,this.responsive,ye)}else this.svgs=[this.renderer.paper.svg];y(this,this.svgs),this.jazzchords=R};function L(B,W,G,R,ye){G||(G="Untitled");var q=W.querySelector("svg");R==="resize"&&(W.style.paddingBottom="");for(var se=q.querySelector("style"),ve=R==="resize"?q.viewBox.baseVal.width:q.getAttribute("width"),he=W.querySelectorAll("svg > g"),ce=0,de=[],K=0;K<he.length;K++){var Q=he[K],le=Q.getBBox(),Ee=le.y-ce,Me=le.height+Ee,H=document.createElement("div"),Y="overflow: hidden;";R!=="resize"&&(Y+="height:"+Me*ye+"px;"),H.setAttribute("style",Y);var X=N(q),xe='Sheet Music for "'+G+'" section '+(K+1);X.setAttribute("aria-label",xe),R!=="resize"&&X.setAttribute("height",Me),R==="resize"&&(X.style.position="");var De=B.firefox112?Me+1:Me;X.setAttribute("viewBox","0 "+ce+" "+ve+" "+De),X.appendChild(se.cloneNode(!0));var $e=document.createElement("title");$e.innerText=xe,X.appendChild($e),X.appendChild(Q),H.appendChild(X),de.push(X),W.appendChild(H),ce=le.y+le.height}return W.removeChild(q),de}function N(B){for(var W="http://www.w3.org/2000/svg",G=document.createElementNS(W,"svg"),R=0;R<B.attributes.length;R++){var ye=B.attributes[R];ye.name!=="height"&&ye.name!="aria-label"&&G.setAttribute(ye.name,ye.value)}return G}return T.prototype.getDim=function(B){if(!B.dim){var W=B.svgEl.getBBox();B.dim={left:Math.round(W.x),top:Math.round(W.y),right:Math.round(W.x+W.width),bottom:Math.round(W.y+W.height)}}return B.dim},T.prototype.addSelectListener=function(B){this.listeners[this.listeners.length]=B},L3=T,L3}var O3,Y6;function s7(){if(Y6)return O3;Y6=1;var t=rf();H9();var r=i7(),a=V9(),l=F9(),u={};function c(){var S=window.innerWidth;for(var A in u)if(u.hasOwnProperty(A)){var M=u[A],w=M.offsetLeft;S-=w*2,M.style.width=S+"px"}}try{window.addEventListener("resize",c),window.addEventListener("orientationChange",c)}catch{}function f(S,A,M,w,_){M.viewportHorizontal?(S.innerHTML='<div class="abcjs-inner"></div>',M.scrollHorizontal?(S.style.overflowX="auto",S.style.overflowY="hidden"):S.style.overflow="hidden",u[S.id]=S,S=S.children[0]):M.viewportVertical?(S.innerHTML='<div class="abcjs-inner scroll-amount"></div>',S.style.overflowX="hidden",S.style.overflowY="auto",S=S.children[0]):S.innerHTML="";var C=new r(S,M);if(C.engraveABC(A,w,_),A.engraver=C,M.viewportVertical||M.viewportHorizontal){var m=S.parentNode;m.style.width=S.style.width}}var p=function(S,A,M,w,_){var C={},m;if(M){for(m in M)M.hasOwnProperty(m)&&(C[m]=M[m]);C.warnings_id&&C.tablature&&(C.tablature.warning_id=C.warnings_id)}if(w)for(m in w)w.hasOwnProperty(m)&&(m==="listener"?w[m].highlight&&(C.clickListener=w[m].highlight):C[m]=w[m]);if(_)for(m in _)_.hasOwnProperty(m)&&(C[m]=_[m]);function T(L,N,B,W){var G=!1;return L==="*"&&(G=!0,L=document.createElement("div"),L.setAttribute("style","visibility: hidden;"),document.body.appendChild(L)),!G&&C.wrap&&C.staffwidth?(N=y(L,N,B,W,C),N):(C.afterParsing&&C.afterParsing(N,B,W),f(L,N,C,B,0),G&&L.parentNode.removeChild(L),null)}return t.renderEngine(T,S,A,C)};function y(S,A,M,w,_){var C=new r(S,_),m=C.getMeasureWidths(A),T=l.calcLineWraps(A,m,_);if(T.reParse){var L=new a;L.parse(w,T.revisedParams),A=L.getTune();var N=L.getWarnings();N&&(A.warnings=N)}return _.afterParsing&&_.afterParsing(A,M,w),f(S,A,T.revisedParams,M,0),A.explanation=T.explanation,A}return O3=p,O3}var D3,K6;function lN(){if(K6)return D3;K6=1;var t=rf(),r=i7(),a=function(l,u){function c(f,p,y,S){f=document.createElement("div"),f.setAttribute("style","visibility: hidden;"),document.body.appendChild(f);var A=new r(f,u),M=A.getMeasureWidths(p);return f.parentNode.removeChild(f),{sections:M}}return t.renderEngine(c,"*",l,u)};return D3=a,D3}var R3,X6;function Xy(){if(X6)return R3;X6=1;var t={};return R3=t,R3}var B3,Q6;function uN(){if(Q6)return B3;Q6=1;var t=Xy(),r=function(a,l,u,c){t[l]||(t[l]={});var f=t[l];return f[u]||(f[u]=new Promise(function(p,y){var S=new XMLHttpRequest;let A=a+l+"-mp3/"+u+".mp3";S.open("GET",A,!0),S.responseType="arraybuffer",S.onload=function(){if(S.status!==200){y(Error("Can't load sound at "+A+" status="+S.status));return}var M=function(_){p({instrument:l,name:u,status:"loaded",audioBuffer:_})},w=c.decodeAudioData(S.response,M,function(){y(Error("Can't decode sound at "+A))});w&&typeof w.catch=="function"&&w.catch(y)},S.onerror=function(){y(Error("Can't load sound at "+A))},S.send()}).catch(p=>{throw console.error("Didn't load note",l,u,":",p.message),p})),f[u]};return B3=r,B3}var F3,Z6;function Qy(){if(Z6)return F3;Z6=1;var t=["acoustic_grand_piano","bright_acoustic_piano","electric_grand_piano","honkytonk_piano","electric_piano_1","electric_piano_2","harpsichord","clavinet","celesta","glockenspiel","music_box","vibraphone","marimba","xylophone","tubular_bells","dulcimer","drawbar_organ","percussive_organ","rock_organ","church_organ","reed_organ","accordion","harmonica","tango_accordion","acoustic_guitar_nylon","acoustic_guitar_steel","electric_guitar_jazz","electric_guitar_clean","electric_guitar_muted","overdriven_guitar","distortion_guitar","guitar_harmonics","acoustic_bass","electric_bass_finger","electric_bass_pick","fretless_bass","slap_bass_1","slap_bass_2","synth_bass_1","synth_bass_2","violin","viola","cello","contrabass","tremolo_strings","pizzicato_strings","orchestral_harp","timpani","string_ensemble_1","string_ensemble_2","synth_strings_1","synth_strings_2","choir_aahs","voice_oohs","synth_choir","orchestra_hit","trumpet","trombone","tuba","muted_trumpet","french_horn","brass_section","synth_brass_1","synth_brass_2","soprano_sax","alto_sax","tenor_sax","baritone_sax","oboe","english_horn","bassoon","clarinet","piccolo","flute","recorder","pan_flute","blown_bottle","shakuhachi","whistle","ocarina","lead_1_square","lead_2_sawtooth","lead_3_calliope","lead_4_chiff","lead_5_charang","lead_6_voice","lead_7_fifths","lead_8_bass_lead","pad_1_new_age","pad_2_warm","pad_3_polysynth","pad_4_choir","pad_5_bowed","pad_6_metallic","pad_7_halo","pad_8_sweep","fx_1_rain","fx_2_soundtrack","fx_3_crystal","fx_4_atmosphere","fx_5_brightness","fx_6_goblins","fx_7_echoes","fx_8_scifi","sitar","banjo","shamisen","koto","kalimba","bagpipe","fiddle","shanai","tinkle_bell","agogo","steel_drums","woodblock","taiko_drum","melodic_tom","synth_drum","reverse_cymbal","guitar_fret_noise","breath_noise","seashore","bird_tweet","telephone_ring","helicopter","applause","gunshot","percussion"];return F3=t,F3}var q3,j6;function cN(){if(j6)return q3;j6=1;var t=Qy(),r=function(a){for(var l=[],u=0;u<a.tracks.length;u++)l.push([]);var c=t[0];return a.tracks.forEach(function(f,p){f.forEach(function(y){switch(y.cmd){case"note":var S=y.instrument!==void 0?t[y.instrument]:c;if(y.duration>0){var A=y.gap?y.gap:0,M=y.duration;A=Math.min(A,M*2/3);var w={pitch:y.pitch,instrument:S,start:Math.round(y.start*1e6)/1e6,end:Math.round((y.start+M-A)*1e6)/1e6,volume:y.volume};y.startChar&&(w.startChar=y.startChar),y.endChar&&(w.endChar=y.endChar),y.style&&(w.style=y.style),y.cents&&(w.cents=y.cents),l[p].push(w)}break;case"program":c=t[y.instrument];break;case"text":break;default:console.log("Unhandled midi event",y)}})}),l};return q3=r,q3}var z3,J6;function nf(){if(J6)return z3;J6=1;function t(r){if(r)window.abcjsAudioContext=r;else if(!window.abcjsAudioContext){var a=window.AudioContext||window.webkitAudioContext;if(a)window.abcjsAudioContext=new a;else return!1}return window.abcjsAudioContext.state!=="suspended"}return z3=t,z3}var H3,e4;function Lu(){if(e4)return H3;e4=1;var t=nf();function r(){return window.abcjsAudioContext||t(),window.abcjsAudioContext}return H3=r,H3}var V3,t4;function sf(){if(t4)return V3;t4=1;var t=Lu();function r(){if(!window.Promise||!window.AudioContext&&!window.webkitAudioContext&&!navigator.mozAudioContext&&!navigator.msAudioContext)return!1;var a=t();if(a)return a.resume!==void 0}return V3=r,V3}var U3,r4;function Zy(){if(r4)return U3;r4=1;var t={21:"A0",22:"Bb0",23:"B0",24:"C1",25:"Db1",26:"D1",27:"Eb1",28:"E1",29:"F1",30:"Gb1",31:"G1",32:"Ab1",33:"A1",34:"Bb1",35:"B1",36:"C2",37:"Db2",38:"D2",39:"Eb2",40:"E2",41:"F2",42:"Gb2",43:"G2",44:"Ab2",45:"A2",46:"Bb2",47:"B2",48:"C3",49:"Db3",50:"D3",51:"Eb3",52:"E3",53:"F3",54:"Gb3",55:"G3",56:"Ab3",57:"A3",58:"Bb3",59:"B3",60:"C4",61:"Db4",62:"D4",63:"Eb4",64:"E4",65:"F4",66:"Gb4",67:"G4",68:"Ab4",69:"A4",70:"Bb4",71:"B4",72:"C5",73:"Db5",74:"D5",75:"Eb5",76:"E5",77:"F5",78:"Gb5",79:"G5",80:"Ab5",81:"A5",82:"Bb5",83:"B5",84:"C6",85:"Db6",86:"D6",87:"Eb6",88:"E6",89:"F6",90:"Gb6",91:"G6",92:"Ab6",93:"A6",94:"Bb6",95:"B6",96:"C7",97:"Db7",98:"D7",99:"Eb7",100:"E7",101:"F7",102:"Gb7",103:"G7",104:"Ab7",105:"A7",106:"Bb7",107:"B7",108:"C8",109:"Db8",110:"D8",111:"Eb8",112:"E8",113:"F8",114:"Gb8",115:"G8",116:"Ab8",117:"A8",118:"Bb8",119:"B8",120:"C9",121:"Db9"};return U3=t,U3}var $3,n4;function hN(){if(n4)return $3;n4=1;var t=function(a){return window.URL.createObjectURL(r(a.audioBuffers))};function r(a){var l=a[0],u=l.numberOfChannels,c=l.length*u*2+44,f=new ArrayBuffer(c),p=new DataView(f),y=[],S,A,M=0,w=0;for(C(1179011410),C(c-8),C(1163280727),C(544501094),C(16),_(1),_(u),C(l.sampleRate),C(l.sampleRate*2*u),_(u*2),_(16),C(1635017060),C(c-w-4),S=0;S<u;S++)y.push(l.getChannelData(S));for(;w<c;){for(S=0;S<y.length;S++)A=Math.max(-1,Math.min(1,y[S][M])),A=(.5+A<0?A*32768:A*32767)|0,p.setInt16(w,A,!0),w+=2;M++}return new Blob([f],{type:"audio/wav"});function _(m){p.setUint16(w,m,!0),w+=2}function C(m){p.setUint32(w,m,!0),w+=4}}return $3=t,$3}var W3,i4;function a7(){if(i4)return W3;i4=1;function t(r){return Math.pow(2,r/1200)}return W3=t,W3}var G3,s4;function fN(){if(s4)return G3;s4=1;var t=Xy(),r=Zy(),a=a7();function l(c,f,p,y,S,A,M,w,_){var C=window.OfflineAudioContext||window.webkitOfflineAudioContext,m=p.len*p.tempoMultiplier;A&&(m+=A/1e3),m-=w,m<0&&(m=.005);var T=new C(2,Math.floor((m+M)*f),f),L=r[p.pitch];if(!t[p.instrument])return _&&_("placeNote skipped (instrument empty): "+p.instrument+":"+L),Promise.resolve();var N=t[p.instrument][L];return N?N.then(function(B){var W=T.createBufferSource();W.buffer=B.audioBuffer;var G=p.volume/96*S;W.gainNode=T.createGain(),p.pan&&T.createStereoPanner&&(W.panNode=T.createStereoPanner(),W.panNode.pan.setValueAtTime(p.pan,0)),W.gainNode.gain.value=G,W.gainNode.gain.linearRampToValueAtTime(W.gainNode.gain.value,m),W.gainNode.gain.linearRampToValueAtTime(0,m+M),p.cents&&(W.playbackRate.value=a(p.cents)),W.panNode?(W.panNode.connect(T.destination),W.gainNode.connect(W.panNode)):W.gainNode.connect(T.destination),W.connect(W.gainNode),W.start(0),W.noteOff?W.noteOff(m+M):W.stop(m+M);var R;return T.oncomplete=function(ye){if(ye.renderedBuffer&&ye.renderedBuffer.getChannelData)for(var q=0;q<y.length;q++){var se=y[q]*p.tempoMultiplier;A&&(se-=A/1e3),se<0&&(se=0),se=Math.floor(se*f),u(c,ye.renderedBuffer,se)}_&&_("placeNote: "+p.instrument+":"+L),R()},T.startRendering(),new Promise(function(ye){R=ye})}).catch(function(B){return _&&_("placeNote catch: "+B.message),Promise.resolve()}):(_&&_("placeNote skipped: "+p.instrument+":"+L),Promise.resolve())}var u=function(c,f,p){for(var y=0;y<2;y++)for(var S=f.getChannelData(y),A=c.getChannelData(y),M=0;M<S.length;M++)A[M+p]+=S[M]};return G3=l,G3}var Y3,a4;function jy(){if(a4)return Y3;a4=1;var t=uN(),r=cN(),a=nf(),l=Lu(),u=sf(),c=Zy(),f=Qy(),p=hN(),y=fN(),S=Xy(),A="MIDI is not supported in this browser.",M="https://paulrosen.github.io/midi-js-soundfonts/abcjs/",w="https://paulrosen.github.io/midi-js-soundfonts/FluidR3_GM/",_="https://paulrosen.github.io/midi-js-soundfonts/MusyngKite/";function C(){var m=this;m.audioBufferPossible=void 0,m.directSource=[],m.startTimeSec=void 0,m.pausedTimeSec=void 0,m.audioBuffers=[],m.duration=void 0,m.isRunning=!1,m.options=void 0,m.pickupLength=0,m.init=function(N){N||(N={}),N.options&&(m.options=N.options),a(N.audioContext);var B=l().currentTime;if(m.debugCallback=N.debugCallback,m.debugCallback&&m.debugCallback("init called"),m.audioBufferPossible=m._deviceCapable(),!m.audioBufferPossible)return Promise.reject({status:"NotSupported",message:A});var W=N.options?N.options:{};m.soundFontUrl=W.soundFontUrl?W.soundFontUrl:w,m.soundFontUrl[m.soundFontUrl.length-1]!=="/"&&(m.soundFontUrl+="/"),W.soundFontVolumeMultiplier||W.soundFontVolumeMultiplier===0?m.soundFontVolumeMultiplier=W.soundFontVolumeMultiplier:m.soundFontUrl===w||m.soundFontUrl===_?m.soundFontVolumeMultiplier=3:m.soundFontUrl===M?m.soundFontVolumeMultiplier=.4:m.soundFontVolumeMultiplier=1,W.programOffsets?m.programOffsets=W.programOffsets:m.soundFontUrl===M?m.programOffsets={bright_acoustic_piano:20,honkytonk_piano:20,electric_piano_1:30,electric_piano_2:30,harpsichord:40,clavinet:20,celesta:20,glockenspiel:40,vibraphone:30,marimba:35,xylophone:30,tubular_bells:35,dulcimer:30,drawbar_organ:20,percussive_organ:25,rock_organ:20,church_organ:40,reed_organ:40,accordion:40,harmonica:40,acoustic_guitar_nylon:20,acoustic_guitar_steel:30,electric_guitar_jazz:25,electric_guitar_clean:15,electric_guitar_muted:35,overdriven_guitar:25,distortion_guitar:20,guitar_harmonics:30,electric_bass_finger:15,electric_bass_pick:30,fretless_bass:40,violin:105,viola:50,cello:40,contrabass:60,trumpet:10,trombone:90,alto_sax:20,tenor_sax:20,clarinet:20,flute:50,banjo:50,woodblock:20}:m.programOffsets={};var G=W.fadeLength!==void 0?parseInt(W.fadeLength,10):NaN;if(m.fadeLength=isNaN(G)?200:G,G=W.noteEnd!==void 0?parseInt(W.noteEnd,10):NaN,m.noteEnd=isNaN(G)?0:G,m.pan=W.pan,m.meterSize=1,N.visualObj){m.flattened=N.visualObj.setUpAudio(W);var R=N.visualObj.getMeterFraction();R.den&&(m.meterSize=N.visualObj.getMeterFraction().num/N.visualObj.getMeterFraction().den),m.pickupLength=N.visualObj.getPickupLength()}else if(N.sequence)m.flattened=N.sequence;else return Promise.reject(new Error("Must pass in either a visualObj or a sequence"));m.millisecondsPerMeasure=N.millisecondsPerMeasure?N.millisecondsPerMeasure:N.visualObj?N.visualObj.millisecondsPerMeasure(m.flattened.tempo):1e3,m.beatsPerMeasure=N.visualObj?N.visualObj.getBeatsPerMeasure():4,m.sequenceCallback=W.sequenceCallback,m.callbackContext=W.callbackContext,m.onEnded=W.onEnded,m.meterFraction=N.visualObj?N.visualObj.getMeterFraction():{den:1};var ye={},q=[],se=[],ve=f[0];m.flattened.tracks.forEach(function(Q){Q.forEach(function(le){if(le.cmd==="program"&&f[le.instrument]&&(ve=f[le.instrument]),le.pitch!==void 0){var Ee=le.pitch,Me=c[Ee],H=le.instrument!==void 0?f[le.instrument]:ve;if(Me)if(ye[H]||(ye[H]={}),!S[H]||!S[H][Me])ye[H][Me]=!0;else{var Y=H+":"+Me;q.indexOf(Y)<0&&q.push(Y)}else{var X=H+":"+Me;console.log("Can't find note: ",Ee,X),se.indexOf(X)<0&&se.push(X)}}})}),m.debugCallback&&m.debugCallback("note gathering time = "+Math.floor((l().currentTime-B)*1e3)+"ms"),B=l().currentTime;var he=[];Object.keys(ye).forEach(function(Q){Object.keys(ye[Q]).forEach(function(le){he.push({instrument:Q,note:le})})}),m.debugCallback&&m.debugCallback("notes "+JSON.stringify(he));for(var ce=[],de=256,K=0;K<he.length;K+=de)ce.push(he.slice(K,K+de));return new Promise(function(Q,le){var Ee={cached:q,error:se,loaded:[]},Me=0,H=function(){m.debugCallback&&m.debugCallback("loadBatch idx="+Me+" len="+ce.length),Me<ce.length?m._loadBatch(ce[Me],m.soundFontUrl,B).then(function(Y){m.debugCallback&&m.debugCallback("loadBatch then"),B=l().currentTime,Y&&(Y.error&&(Ee.error=Ee.error.concat(Y.error)),Y.loaded&&(Ee.loaded=Ee.loaded.concat(Y.loaded))),Me++,H()},le):(m.debugCallback&&m.debugCallback("resolve init"),Q(Ee))};H()})},m._loadBatch=function(N,B,W,G){var R=[];return N.forEach(function(ye){m.debugCallback&&m.debugCallback("getNote "+ye.instrument+":"+ye.note),R.push(t(B,ye.instrument,ye.note,l()))}),Promise.all(R).then(function(ye){m.debugCallback&&m.debugCallback("mp3 load time = "+Math.floor((l().currentTime-W)*1e3)+"ms");for(var q=[],se=[],ve=[],he=[],ce=0;ce<ye.length;ce++){var de=ye[ce],K=de.instrument+":"+de.name;de.status==="loaded"?q.push(K):de.status==="pending"?ve.push(K):de.status==="cached"?se.push(K):he.push(K+" "+de.message)}if(ve.length>0){if(m.debugCallback&&m.debugCallback("pending "+JSON.stringify(ve)),G?G=G*2:G=50,G<9e4)return new Promise(function(Ee,Me){setTimeout(function(){var H=[];for(ce=0;ce<ve.length;ce++)K=ve[ce].split(":"),H.push({instrument:K[0],note:K[1]});m.debugCallback&&m.debugCallback("retry "+JSON.stringify(H)),m._loadBatch(H,B,W,G).then(function(Y){Ee(Y)}).catch(function(Y){Me(Y)})},G)});for(var Q=[],le=0;le<N.length;le++)Q.push(N[le].instrument+"/"+N[le].note);return m.debugCallback&&m.debugCallback("loadBatch timeout"),Promise.reject(new Error("timeout attempting to load: "+Q.join(", ")))}else return m.debugCallback&&m.debugCallback("loadBatch resolve"),Promise.resolve({loaded:q,cached:se,error:he})}).catch(function(ye){m.debugCallback&&m.debugCallback("loadBatch catch "+ye.message)})},m.prime=function(){var N=m.fadeLength/1e3;return m.isRunning=!1,m.audioBufferPossible?(m.debugCallback&&m.debugCallback("prime called"),new Promise(function(B){var W=l().currentTime,G=m.millisecondsPerMeasure/1e3/m.meterSize;if(m.duration=m.flattened.totalDuration*G,m.duration<=0)return m.audioBuffers=[],B({status:"empty",seconds:0});m.duration+=N;var R=Math.floor(l().sampleRate*m.duration);m.stop();var ye=r(m.flattened);m.options.swing&&L(ye,m.options.swing,m.meterFraction,m.pickupLength),m.sequenceCallback&&m.sequenceCallback(ye,m.callbackContext);var q=T(ye.length,m.pan),se={};ye.forEach(function(Ee,Me){var H=q&&q.length>Me?q[Me]:0;Ee.forEach(function(Y){var X=Y.instrument+":"+Y.pitch+":"+Y.volume+":"+Math.round((Y.end-Y.start)*1e3)/1e3+":"+H+":"+G+":"+(Y.cents?Y.cents:0);m.debugCallback&&m.debugCallback("noteMapTrack "+X),se[X]||(se[X]=[]),se[X].push(Y.start)})});for(var ve=[],he=l().createBuffer(2,R,l().sampleRate),ce=0;ce<Object.keys(se).length;ce++){var de=Object.keys(se)[ce],K=de.split(":"),Q=K[6]!==void 0?parseFloat(K[6]):0;K={instrument:K[0],pitch:parseInt(K[1],10),volume:parseInt(K[2],10),len:parseFloat(K[3]),pan:parseFloat(K[4]),tempoMultiplier:parseFloat(K[5]),cents:Q},ve.push(y(he,l().sampleRate,K,se[de],m.soundFontVolumeMultiplier,m.programOffsets[K.instrument],N,m.noteEnd/1e3,m.debugCallback))}m.audioBuffers=[he],m.debugCallback&&(m.debugCallback("sampleRate = "+l().sampleRate),m.debugCallback("totalSamples = "+R),m.debugCallback("creationTime = "+Math.floor((l().currentTime-W)*1e3)+"ms"));function le(Ee){var Me=Ee&&Ee.audioBuffers&&Ee.audioBuffers.length>0?Ee.audioBuffers[0].duration:0;return{status:l().state,duration:Me}}Promise.all(ve).then(function(){l().state==="suspended"?l().resume().then(function(){B(le(m))}):l().state==="interrupted"?l().suspend().then(function(){l().resume().then(function(){B(le(m))})}):B(le(m))})})):Promise.reject(new Error(A))};function T(N,B){if(B==null)return null;var W=[];if(B.length){for(var G=0;G<N;G++)if(G<B.length){var R=parseFloat(B[G]);R<-1?R=-1:R>1&&(R=1),W.push(R)}else W.push(0);return W}else{var ye=parseFloat(B);if(ye*(N-1)>2)return null;for(var q=N%2===0,se=q?0-ye/2:0,ve=se+ye,he=0;he<N;he++)q=he%2===0,q?(W.push(se),se-=ye):(W.push(ve),ve+=ye);return W}}m.start=function(){if(!m.audioBufferPossible)throw new Error(A);m.debugCallback&&m.debugCallback("start called");var N=m.pausedTimeSec?m.pausedTimeSec:0;m._kickOffSound(N),m.startTimeSec=l().currentTime-N,m.pausedTimeSec=void 0,m.debugCallback&&m.debugCallback("MIDI STARTED",m.startTimeSec)},m.pause=function(){if(!m.audioBufferPossible)throw new Error(A);return m.debugCallback&&m.debugCallback("pause called"),m.pausedTimeSec=m.stop(),m.pausedTimeSec},m.resume=function(){m.start()},m.seek=function(N,B){var W;switch(B){case"seconds":W=N;break;case"beats":W=N*m.millisecondsPerMeasure/m.beatsPerMeasure/1e3;break;default:W=(m.duration-m.fadeLength/1e3)*N;break}if(!m.audioBufferPossible)throw new Error(A);m.debugCallback&&m.debugCallback("seek called sec="+W),m.isRunning?(m.stop(),m._kickOffSound(W)):m.pausedTimeSec=W,m.pausedTimeSec=W},m.stop=function(){m.isRunning=!1,m.pausedTimeSec=void 0,m.directSource.forEach(function(B){try{B.stop()}catch(W){console.log("direct source didn't stop:",W)}}),m.directSource=[];var N=l().currentTime-m.startTimeSec;return N},m.finished=function(){m.startTimeSec=void 0,m.pausedTimeSec=void 0,m.isRunning=!1},m.download=function(){return p(m)},m.getAudioBuffer=function(){return m.audioBuffers[0]},m.getIsRunning=function(){return m.isRunning},m._deviceCapable=function(){return u()?!0:(console.warn(A),m.debugCallback&&m.debugCallback(A),!1)},m._kickOffSound=function(N){m.isRunning=!0,m.directSource=[],m.audioBuffers.forEach(function(B,W){m.directSource[W]=l().createBufferSource(),m.directSource[W].buffer=B,m.directSource[W].connect(l().destination)}),m.directSource.forEach(function(B){B.start(0,N)}),m.onEnded&&(m.directSource[0].onended=function(){m.onEnded(m.callbackContext)})};function L(N,B,W,G){if(!(W.den!=4&&W.den!=8)&&(B=parseFloat(B),!(isNaN(B)||B<=50))){B>75&&(B=75),B=B/50-1;var R=0,ye=.25;W.den===8&&(ye=ye/2);for(var q=ye/2,se=q*B,ve=0;ve<N.length;ve++)for(var he=N[ve],ce=0;ce<he.length;ce++){var de=he[ce];if((de.start-G)%q==0&&(de.start-G)%ye!=0&&(ce==0||he[ce-1].start<=he[ce].start-q)&&(ce==he.length-1||he[ce+1].start>=he[ce].start+q)){var K=de.start;de.start+=se,de.volume*=1+R,ce>0&&he[ce-1].end==K&&(he[ce-1].end=de.start,he[ce-1].volume*=1-R)}}}}}return Y3=C,Y3}var K3,o4;function o7(){if(o4)return K3;o4=1;var t=function(){var r=this;r.tracks=[],r.totalDuration=0,r.currentInstrument=[],r.starts=[],r.addTrack=function(){return r.tracks.push([]),r.currentInstrument.push(0),r.starts.push(0),r.tracks.length-1},r.setInstrument=function(a,l){r.tracks[a].push({channel:0,cmd:"program",instrument:l}),r.currentInstrument[a]=l},r.appendNote=function(a,l,u,c,f){var p={cmd:"note",duration:u,gap:0,instrument:r.currentInstrument[a],pitch:l,start:r.starts[a],volume:c};f&&(p.cents=f),r.tracks[a].push(p),r.starts[a]+=u,r.totalDuration=Math.max(r.totalDuration,r.starts[a])}};return K3=t,K3}var X3,l4;function dN(){if(l4)return X3;l4=1;var t=`
|
|
178
|
+
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 700" preserveAspectRatio="xMidYMid meet">
|
|
179
|
+
<g transform="translate(0,700) scale(0.1,-0.1)" >
|
|
180
|
+
<path d="M3111 6981 c-20 -37 -90 -55 -364 -96 -120 -18 -190 -33 -244 -55
|
|
181
|
+
-42 -17 -124 -42 -182 -56 -78 -18 -119 -34 -157 -60 -28 -19 -86 -46 -128
|
|
182
|
+
-60 -43 -13 -107 -42 -144 -64 -37 -23 -84 -46 -106 -52 -21 -7 -56 -29 -79
|
|
183
|
+
-50 -22 -22 -61 -50 -86 -63 -26 -13 -67 -40 -91 -60 -24 -20 -65 -47 -90 -60
|
|
184
|
+
-25 -13 -53 -31 -61 -41 -8 -9 -32 -30 -54 -46 -75 -54 -486 -460 -512 -507
|
|
185
|
+
-15 -25 -48 -69 -75 -98 -26 -28 -48 -57 -48 -63 0 -6 -18 -29 -39 -53 -21
|
|
186
|
+
-23 -56 -71 -77 -107 -20 -36 -50 -80 -65 -97 -16 -18 -33 -52 -40 -75 -12
|
|
187
|
+
-47 -47 -115 -84 -166 -13 -18 -30 -56 -38 -83 -8 -27 -34 -80 -56 -118 -33
|
|
188
|
+
-53 -46 -91 -62 -167 -12 -63 -34 -127 -59 -179 -42 -84 -60 -166 -60 -270 0
|
|
189
|
+
-90 26 -122 125 -154 54 -17 96 -19 430 -20 305 -1 381 2 430 14 82 22 140 51
|
|
190
|
+
153 78 6 12 22 47 37 77 14 30 38 77 54 103 15 27 34 73 40 103 7 30 28 78 48
|
|
191
|
+
107 19 28 44 74 55 101 10 28 34 67 53 87 18 20 49 61 68 90 19 30 44 63 57
|
|
192
|
+
74 13 11 36 40 52 65 59 94 232 270 306 313 20 11 57 37 82 58 25 20 70 52
|
|
193
|
+
100 72 30 19 66 47 79 61 13 14 49 35 80 46 30 12 80 37 111 56 31 19 95 45
|
|
194
|
+
143 58 48 12 110 37 139 55 63 40 127 55 323 76 83 9 208 28 279 41 156 29
|
|
195
|
+
165 29 330 4 453 -71 514 -84 606 -130 31 -16 83 -36 116 -45 32 -9 84 -34
|
|
196
|
+
115 -56 31 -21 82 -48 113 -60 32 -11 72 -33 89 -48 18 -16 59 -45 92 -65 33
|
|
197
|
+
-21 74 -51 90 -66 17 -15 49 -40 73 -54 52 -32 65 -61 50 -113 -8 -31 -61 -90
|
|
198
|
+
-277 -308 -300 -303 -361 -382 -369 -481 -2 -29 0 -66 6 -81 13 -40 88 -138
|
|
199
|
+
115 -151 12 -6 54 -26 92 -44 l70 -33 945 -2 c520 -1 975 2 1012 7 64 8 191
|
|
200
|
+
50 231 76 11 7 33 34 50 60 22 34 42 51 65 58 l32 9 0 1101 0 1102 -32 9 c-21
|
|
201
|
+
7 -44 26 -64 55 -60 84 -77 97 -140 110 -44 9 -76 10 -127 2 -59 -9 -77 -17
|
|
202
|
+
-134 -62 -37 -28 -172 -155 -301 -281 -129 -127 -249 -237 -267 -245 -25 -10
|
|
203
|
+
-41 -11 -71 -2 -58 15 -112 45 -124 69 -6 11 -35 35 -64 54 -28 18 -58 41 -66
|
|
204
|
+
50 -8 9 -41 35 -75 58 -33 22 -77 56 -99 75 -21 18 -64 46 -95 61 -31 14 -73
|
|
205
|
+
39 -93 55 -20 15 -70 40 -110 55 -40 15 -97 44 -127 64 -29 21 -78 44 -107 53
|
|
206
|
+
-30 8 -77 31 -105 51 -42 28 -73 39 -173 60 -68 14 -154 39 -196 58 -95 43
|
|
207
|
+
-131 51 -343 76 -209 24 -242 32 -279 70 l-30 29 -328 0 c-312 0 -330 -1 -339
|
|
208
|
+
-19z"></path>
|
|
209
|
+
<path d="M254 2875 c-89 -16 -107 -26 -145 -78 -32 -44 -62 -66 -91 -67 -17 0
|
|
210
|
+
-18 -61 -18 -1140 l0 -1140 24 0 c16 0 41 -17 72 -50 40 -42 61 -55 117 -72
|
|
211
|
+
l69 -21 82 23 c44 12 96 30 114 39 18 9 148 132 290 272 141 141 267 261 279
|
|
212
|
+
268 51 26 86 14 176 -61 32 -26 62 -48 66 -48 5 0 36 -25 70 -55 34 -30 74
|
|
213
|
+
-61 89 -69 15 -8 37 -28 50 -45 12 -17 50 -45 84 -62 34 -17 78 -44 98 -60 19
|
|
214
|
+
-16 61 -37 93 -48 32 -11 81 -37 107 -56 27 -20 76 -45 109 -56 33 -12 75 -31
|
|
215
|
+
93 -44 62 -45 93 -58 191 -82 54 -12 130 -37 168 -54 68 -29 180 -58 226 -59
|
|
216
|
+
62 0 183 -64 183 -96 0 -12 88 -14 639 -14 l639 0 12 30 c18 44 76 66 233 89
|
|
217
|
+
89 14 160 30 200 47 34 15 106 42 159 60 54 18 112 44 130 57 47 35 85 52 146
|
|
218
|
+
67 29 7 76 28 105 48 29 20 77 48 107 63 30 15 66 39 80 54 14 15 50 40 81 56
|
|
219
|
+
31 15 78 46 104 69 26 22 61 46 79 54 17 7 43 26 56 42 14 16 41 41 60 56 64
|
|
220
|
+
48 380 362 408 405 15 23 40 51 55 63 15 12 36 38 46 58 11 21 37 57 58 82 22
|
|
221
|
+
25 49 62 62 83 13 20 38 56 57 78 19 23 50 74 69 113 19 39 46 86 59 104 14
|
|
222
|
+
18 34 62 46 98 12 36 32 77 45 92 31 38 60 97 80 167 9 33 26 76 37 95 29 50
|
|
223
|
+
47 103 68 206 10 52 32 117 51 155 29 56 33 74 34 140 0 94 -10 108 -101 138
|
|
224
|
+
-61 20 -83 21 -463 21 -226 0 -421 -4 -451 -10 -63 -12 -86 -30 -110 -85 -10
|
|
225
|
+
-22 -33 -63 -52 -92 -21 -31 -42 -80 -53 -123 -11 -44 -32 -93 -56 -128 -20
|
|
226
|
+
-32 -47 -83 -59 -115 -12 -32 -37 -77 -56 -100 -19 -23 -50 -65 -69 -94 -19
|
|
227
|
+
-29 -44 -57 -54 -63 -11 -5 -29 -27 -42 -47 -52 -85 -234 -277 -300 -315 -25
|
|
228
|
+
-15 -53 -38 -62 -51 -9 -14 -42 -39 -74 -57 -32 -18 -75 -48 -95 -66 -21 -18
|
|
229
|
+
-59 -44 -85 -58 -26 -13 -72 -40 -100 -59 -35 -24 -78 -41 -128 -52 -47 -11
|
|
230
|
+
-99 -31 -139 -56 -69 -42 -94 -49 -391 -110 -245 -51 -425 -66 -595 -50 -168
|
|
231
|
+
16 -230 27 -330 61 -47 16 -123 35 -170 44 -98 17 -123 25 -172 58 -20 14 -71
|
|
232
|
+
37 -114 53 -44 15 -95 40 -115 56 -20 16 -70 42 -110 59 -40 16 -88 45 -108
|
|
233
|
+
63 -20 19 -55 46 -78 61 -24 14 -49 35 -55 47 -7 11 -34 33 -60 49 -50 31 -65
|
|
234
|
+
61 -53 102 4 13 130 147 281 298 236 238 277 283 299 335 15 32 35 71 46 86
|
|
235
|
+
12 18 19 44 19 76 0 42 -8 63 -53 138 -92 151 11 139 -1207 141 -798 2 -1030
|
|
236
|
+
0 -1086 -11z"></path>
|
|
237
|
+
</g>
|
|
238
|
+
</svg>
|
|
239
|
+
`;return X3=t,X3}var Q3,u4;function pN(){if(u4)return Q3;u4=1;var t=`
|
|
240
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" class="abcjs-play-svg">
|
|
241
|
+
<g>
|
|
242
|
+
<polygon points="4 0 23 12.5 4 25"/>
|
|
243
|
+
</g>
|
|
244
|
+
</svg>
|
|
245
|
+
`;return Q3=t,Q3}var Z3,c4;function gN(){if(c4)return Z3;c4=1;var t=`
|
|
246
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25" class="abcjs-pause-svg">
|
|
247
|
+
<g>
|
|
248
|
+
<rect width="8.23" height="25"/>
|
|
249
|
+
<rect width="8.23" height="25" x="17"/>
|
|
250
|
+
</g>
|
|
251
|
+
</svg>
|
|
252
|
+
`;return Z3=t,Z3}var j3,h4;function vN(){if(h4)return j3;h4=1;var t=`
|
|
253
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" class="abcjs-loading-svg">
|
|
254
|
+
<circle cx="50" cy="50" fill="none" stroke-width="20" r="35" stroke-dasharray="160 55"></circle>
|
|
255
|
+
</svg>
|
|
256
|
+
`;return j3=t,j3}var J3,f4;function mN(){if(f4)return J3;f4=1;var t=`
|
|
257
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 25">
|
|
258
|
+
<g>
|
|
259
|
+
<polygon points="5 12.5 24 0 24 25"/>
|
|
260
|
+
<rect width="3" height="25" x="0" y="0"/>
|
|
261
|
+
</g>
|
|
262
|
+
</svg>
|
|
263
|
+
`;return J3=t,J3}var eb,d4;function l7(){if(d4)return eb;d4=1;var t=sf(),r=nf(),a=Lu(),l=dN(),u=pN(),c=gN(),f=vN(),p=mN();function y(_,C){var m=this;if(typeof _=="string"){var T=_;if(_=document.querySelector(T),!_)throw new Error('Cannot find element "'+T+'" in the DOM.')}else if(!(_ instanceof HTMLElement))throw new Error("The first parameter must be a valid element or selector in the DOM.");if(m.parent=_,m.options={},C&&(m.options=Object.assign({},C)),m.options.ac&&r(m.options.ac),S(m.parent,m.options),w(m),m.disable=function(N){var B=m.parent.querySelector(".abcjs-inline-audio");N?B.classList.add("abcjs-disabled"):B.classList.remove("abcjs-disabled")},m.setWarp=function(N,B){var W=m.parent.querySelector(".abcjs-midi-tempo");W.value=Math.round(B),m.setTempo(N)},m.setTempo=function(N){var B=m.parent.querySelector(".abcjs-midi-current-tempo");B&&(B.innerHTML=Math.round(N))},m.resetAll=function(){for(var N=m.parent.querySelectorAll(".abcjs-pushed"),B=0;B<N.length;B++){var W=N[B];W.classList.remove("abcjs-pushed")}},m.pushPlay=function(N){var B=m.parent.querySelector(".abcjs-midi-start");B&&(N?B.classList.add("abcjs-pushed"):B.classList.remove("abcjs-pushed"))},m.pushLoop=function(N){var B=m.parent.querySelector(".abcjs-midi-loop");B&&(N?B.classList.add("abcjs-pushed"):B.classList.remove("abcjs-pushed"))},m.setProgress=function(N,B){var W=m.parent.querySelector(".abcjs-midi-progress-background"),G=m.parent.querySelector(".abcjs-midi-progress-indicator");if(!(!W||!G)){var R=W.clientWidth,ye=R*N;G.style.left=ye+"px";var q=m.parent.querySelector(".abcjs-midi-clock");if(q){var se=B*N/1e3,ve=Math.floor(se/60),he=Math.floor(se%60),ce=he<10?"0"+he:he;q.innerHTML=ve+":"+ce}}},m.options.afterResume){var L=!1;m.options.ac?L=m.options.ac.state!=="suspended":a()&&(L=a().state!=="suspended"),L&&m.options.afterResume()}}function S(_,C){var m=!!C.loopHandler,T=!!C.restartHandler,L=!!C.playHandler||!!C.playPromiseHandler,N=!!C.progressHandler,B=!!C.warpHandler,W=C.hasClock!==!1,G=`<div class="abcjs-inline-audio">
|
|
264
|
+
`;if(m){var R=C.repeatTitle?C.repeatTitle:"Click to toggle play once/repeat.",ye=C.repeatAria?C.repeatAria:R;G+='<button type="button" class="abcjs-midi-loop abcjs-btn" title="'+R+'" aria-label="'+ye+'">'+l+`</button>
|
|
265
|
+
`}if(T){var q=C.restartTitle?C.restartTitle:"Click to go to beginning.",se=C.restartAria?C.restartAria:q;G+='<button type="button" class="abcjs-midi-reset abcjs-btn" title="'+q+'" aria-label="'+se+'">'+p+`</button>
|
|
266
|
+
`}if(L){var ve=C.playTitle?C.playTitle:"Click to play/pause.",he=C.playAria?C.playAria:ve;G+='<button type="button" class="abcjs-midi-start abcjs-btn" title="'+ve+'" aria-label="'+he+'">'+u+c+f+`</button>
|
|
267
|
+
`}if(N){var ce=C.randomTitle?C.randomTitle:"Click to change the playback position.",de=C.randomAria?C.randomAria:ce;G+='<button type="button" class="abcjs-midi-progress-background" title="'+ce+'" aria-label="'+de+`"><span class="abcjs-midi-progress-indicator"></span></button>
|
|
268
|
+
`}if(W&&(G+=`<span class="abcjs-midi-clock"></span>
|
|
269
|
+
`),B){var K=C.warpTitle?C.warpTitle:"Change the playback speed.",Q=C.warpAria?C.warpAria:K,le=C.bpm?C.bpm:"BPM";G+='<span class="abcjs-tempo-wrapper"><label><input class="abcjs-midi-tempo" type="number" min="1" max="300" value="100" title="'+K+'" aria-label="'+Q+'">%</label><span> (<span class="abcjs-midi-current-tempo"></span> '+le+`)</span></span>
|
|
270
|
+
`}G+='<div class="abcjs-css-warning" style="font-size: 12px;color:red;border: 1px solid red;text-align: center;width: 300px;margin-top: 4px;font-weight: bold;border-radius: 4px;">CSS required: load abcjs-audio.css</div>',G+=`</div>
|
|
271
|
+
`,_.innerHTML=G}function A(_,C,m,T,L){var N=!0;if(a()?N=a().state==="suspended":r(),!t())throw{status:"NotSupported",message:"This browser does not support audio."};(N||L)&&m&&m.classList.add("abcjs-loading"),N?a().resume().then(function(){T?T().then(function(B){M(_,C,m,L)}):M(_,C,m,L)}):M(_,C,m,L)}function M(_,C,m,T){T?_(C).then(function(){m&&m.classList.remove("abcjs-loading")}):(_(C),m&&m.classList.remove("abcjs-loading"))}function w(_){var C=!!_.options.loopHandler,m=!!_.options.restartHandler,T=!!_.options.playHandler||!!_.options.playPromiseHandler,L=!!_.options.progressHandler,N=!!_.options.warpHandler,B=_.parent.querySelector(".abcjs-midi-start");C&&_.parent.querySelector(".abcjs-midi-loop").addEventListener("click",function(W){A(_.options.loopHandler,W,B,_.options.afterResume)}),m&&_.parent.querySelector(".abcjs-midi-reset").addEventListener("click",function(W){A(_.options.restartHandler,W,B,_.options.afterResume)}),T&&B.addEventListener("click",function(W){A(_.options.playPromiseHandler||_.options.playHandler,W,B,_.options.afterResume,!!_.options.playPromiseHandler)}),L&&_.parent.querySelector(".abcjs-midi-progress-background").addEventListener("click",function(W){A(_.options.progressHandler,W,B,_.options.afterResume)}),N&&_.parent.querySelector(".abcjs-midi-tempo").addEventListener("change",function(W){A(_.options.warpHandler,W,B,_.options.afterResume)})}return eb=y,eb}var tb,p4;function _N(){if(p4)return tb;p4=1;var t=o7(),r=jy(),a=Lu();function l(c,f,p,y,S){for(var A=new t,M=0;M<c.length;M++){var w=c[M],_=A.addTrack();if(A.setInstrument(_,w.instrument),M===0&&f)for(var C=0;C<f.length;C++){var m=f[C];A.appendNote(_,m.pitch,1/64,m.volume,m.cents)}A.appendNote(_,w.pitch,w.duration,w.volume,w.cents)}var T=a();return T.state==="suspended"?T.resume().then(function(){return u(A,p,y,S)}):u(A,p,y,S)}function u(c,f,p,y){var S=new r;return S.init({sequence:c,millisecondsPerMeasure:f,options:{soundFontUrl:p},debugCallback:y}).then(function(){return S.prime()}).then(function(){return S.start(),Promise.resolve()})}return tb=l,tb}var rb,g4;function u7(){if(g4)return rb;g4=1;var t=l7(),r=jy(),a=Vy(),l=Lu();function u(){var c=this;c.warp=100,c.cursorControl=null,c.visualObj=null,c.timer=null,c.midiBuffer=null,c.options=null,c.currentTempo=null,c.control=null,c.isLooping=!1,c.isStarted=!1,c.isLoaded=!1,c.isLoading=!1,c.load=function(p,y,S){S||(S={}),S.displayPlay===void 0&&(S.displayPlay=!0),S.displayProgress===void 0&&(S.displayProgress=!0),c.control=new t(p,{loopHandler:S.displayLoop?c.toggleLoop:void 0,restartHandler:S.displayRestart?c.restart:void 0,playPromiseHandler:S.displayPlay?c.play:void 0,progressHandler:S.displayProgress?c.randomAccess:void 0,warpHandler:S.displayWarp?c.onWarp:void 0,afterResume:c.init}),c.cursorControl=y,c.disable(!0)},c.disable=function(p){c.control&&c.control.disable(p)},c.setTune=function(p,y,S){return c.visualObj=p,c.disable(!1),c.options=S||{},c.control&&(c.pause(),c.setProgress(0,1),c.control.resetAll(),c.restart(),c.isStarted=!1),c.isLooping=!1,y?c.go():Promise.resolve({status:"no-audio-context"})},c.go=function(){c.isLoading=!0;var p=c.visualObj.millisecondsPerMeasure()*100/c.warp;c.currentTempo=Math.round(c.visualObj.getBeatsPerMeasure()/p*6e4),c.control&&c.control.setTempo(c.currentTempo),c.percent=0;var y;return c.midiBuffer||(c.midiBuffer=new r),l().resume().then(function(S){return c.midiBuffer.init({visualObj:c.visualObj,options:c.options,millisecondsPerMeasure:p})}).then(function(S){return y=S,c.midiBuffer.prime()}).then(function(){var S=16;return c.cursorControl&&c.cursorControl.beatSubdivisions!==void 0&&parseInt(c.cursorControl.beatSubdivisions,10)>=1&&parseInt(c.cursorControl.beatSubdivisions,10)<=64&&(S=parseInt(c.cursorControl.beatSubdivisions,10)),c.timer=new a(c.visualObj,{beatCallback:c.beatCallback,eventCallback:c.eventCallback,lineEndCallback:c.lineEndCallback,qpm:c.currentTempo,extraMeasuresAtBeginning:c.cursorControl?c.cursorControl.extraMeasuresAtBeginning:void 0,lineEndAnticipation:c.cursorControl?c.cursorControl.lineEndAnticipation:0,beatSubdivisions:S}),c.cursorControl&&c.cursorControl.onReady&&typeof c.cursorControl.onReady=="function"&&c.cursorControl.onReady(c),c.isLoaded=!0,c.isLoading=!1,Promise.resolve({status:"created",notesStatus:y})})},c.destroy=function(){c.timer&&(c.timer.reset(),c.timer.stop(),c.timer=null),c.midiBuffer&&(c.midiBuffer.stop(),c.midiBuffer=null),c.setProgress(0,1),c.control&&c.control.resetAll()},c.play=function(){return c.runWhenReady(c._play,void 0)};function f(p){return new Promise(function(y){setTimeout(y,p)})}c.runWhenReady=function(p,y){return c.visualObj?c.isLoading?f(500).then(function(){return c.isLoading?c.runWhenReady(p,y):p(y)}):c.isLoaded?p(y):c.go().then(function(){return p(y)}):Promise.resolve({status:"loading"})},c._play=function(){return l().resume().then(function(){return c.isStarted=!c.isStarted,c.isStarted?(c.cursorControl&&c.cursorControl.onStart&&typeof c.cursorControl.onStart=="function"&&c.cursorControl.onStart(),c.midiBuffer.start(),c.timer.start(c.percent),c.control&&c.control.pushPlay(!0)):c.pause(),Promise.resolve({status:"ok"})})},c.pause=function(){c.timer&&(c.timer.pause(),c.midiBuffer.pause(),c.control&&c.control.pushPlay(!1))},c.toggleLoop=function(){c.isLooping=!c.isLooping,c.control&&c.control.pushLoop(c.isLooping)},c.restart=function(){c.timer&&(c.timer.setProgress(0),c.midiBuffer.seek(0))},c.randomAccess=function(p){return c.runWhenReady(c._randomAccess,p)},c._randomAccess=function(p){var y=p.target.classList.contains("abcjs-midi-progress-indicator")?p.target.parentNode:p.target,S=(p.x-y.getBoundingClientRect().left)/y.offsetWidth;return S<0&&(S=0),S>1&&(S=1),c.seek(S),Promise.resolve({status:"ok"})},c.seek=function(p,y){c.timer&&c.midiBuffer&&(c.timer.setProgress(p,y),c.midiBuffer.seek(p,y))},c.setWarp=function(p){if(parseInt(p,10)>0){c.warp=parseInt(p,10);var y=c.isStarted,S=c.percent;return c.destroy(),c.isStarted=!1,c.go().then(function(){return c.setProgress(S,c.midiBuffer.duration*1e3),c.control&&c.control.setWarp(c.currentTempo,c.warp),y?c.play().then(function(){return c.seek(S),Promise.resolve()}):(c.seek(S),Promise.resolve())})}return Promise.resolve()},c.onWarp=function(p){var y=p.target.value;return c.setWarp(y)},c.setProgress=function(p,y){c.percent=p,c.control&&c.control.setProgress(p,y)},c.finished=function(){if(c.timer.reset(),c.isLooping)return c.timer.start(0),c.midiBuffer.finished(),c.midiBuffer.start(),"continue";c.timer.stop(),c.isStarted&&(c.control&&c.control.pushPlay(!1),c.isStarted=!1,c.midiBuffer.finished(),c.cursorControl&&c.cursorControl.onFinished&&typeof c.cursorControl.onFinished=="function"&&c.cursorControl.onFinished(),c.setProgress(0,1))},c.beatCallback=function(p,y,S,A){var M=p/y;c.setProgress(M,S),c.cursorControl&&c.cursorControl.onBeat&&typeof c.cursorControl.onBeat=="function"&&c.cursorControl.onBeat(p,y,S,A)},c.eventCallback=function(p){if(p)c.cursorControl&&c.cursorControl.onEvent&&typeof c.cursorControl.onEvent=="function"&&c.cursorControl.onEvent(p);else return c.finished()},c.lineEndCallback=function(p,y){c.cursorControl&&c.cursorControl.onLineEnd&&typeof c.cursorControl.onLineEnd=="function"&&c.cursorControl.onLineEnd(p,y)},c.getUrl=function(){return c.midiBuffer.download()},c.download=function(p){var y=c.getUrl(),S=document.createElement("a");document.body.appendChild(S),S.setAttribute("style","display: none;"),S.href=y,S.download=p||"output.wav",S.click(),window.URL.revokeObjectURL(y),document.body.removeChild(S)}}return rb=u,rb}var nb,v4;function c7(){if(v4)return nb;v4=1;var t=a7(),r;return function(){function a(w,_){for(var C in _)_.hasOwnProperty(C)&&w.setAttribute(C,_[C]);return w}function l(){this.trackstrings="",this.trackcount=0,this.noteOnAndChannel="%90",this.noteOffAndChannel="%80"}l.prototype.setTempo=function(w){this.trackcount===0&&(this.startTrack(),this.track+="%00%FF%51%03"+S(Math.round(6e7/w),6),this.endTrack())},l.prototype.setGlobalInfo=function(w,_,C,m){if(this.trackcount===0){this.startTrack();var T=Math.round(6e7/w);this.track+="%00%FF%51%03"+S(T,6),C&&(this.track+=f(C)),m&&(this.track+=p(m)),_&&(this.track+=c(_,"%01")),this.endTrack()}},l.prototype.startTrack=function(){this.noteWarped={},this.track="",this.trackName="",this.trackInstrument="",this.silencelength=0,this.trackcount++,this.instrument&&this.setInstrument(this.instrument)},l.prototype.endTrack=function(){this.track=this.trackName+this.trackInstrument+this.track;var w=S(this.track.length/3+4,8);this.track="MTrk"+w+this.track+"%00%FF%2F%00",this.trackstrings+=this.track},l.prototype.setText=function(w,_){switch(w){case"name":this.trackName=c(_,"%03");break}},l.prototype.setInstrument=function(w){this.trackInstrument="%00%C0"+S(w,2),this.instrument=w},l.prototype.setChannel=function(w,_){this.channel=w;var C="%00%B"+this.channel.toString(16);this.track+=C+"%79%00",this.track+=C+"%40%00",this.track+=C+"%5B%30",_||(_=0),_=Math.round((_+1)*64),this.track+=C+"%0A"+S(_,2),this.track+=C+"%07%64",this.noteOnAndChannel="%9"+this.channel.toString(16),this.noteOffAndChannel="%8"+this.channel.toString(16)};var u=4096;l.prototype.startNote=function(w,_,C){if(this.track+=M(this.silencelength),this.silencelength=0,C){this.track+="%e"+this.channel.toString(16);var m=Math.round(t(C)*u);this.track+=A(8192+m),this.track+=M(0),this.noteWarped[w]=!0}this.track+=this.noteOnAndChannel,this.track+="%"+w.toString(16)+S(_,2)},l.prototype.endNote=function(w){this.track+=M(this.silencelength),this.silencelength=0,this.noteWarped[w]&&(this.track+="%e"+this.channel.toString(16),this.track+=A(8192),this.track+=M(0),this.noteWarped[w]=!1),this.track+=this.noteOffAndChannel,this.track+="%"+w.toString(16)+"%00"},l.prototype.addRest=function(w){this.silencelength+=w,this.silencelength<0&&(this.silencelength=0)},l.prototype.getData=function(){return"data:audio/midi,MThd%00%00%00%06%00%01"+S(this.trackcount,4)+"%01%e0"+this.trackstrings},l.prototype.embed=function(w,_){var C=this.getData(),m=a(document.createElement("a"),{href:C});if(m.innerHTML="download midi",w.insertBefore(m,w.firstChild),!_){var T=a(document.createElement("embed"),{src:C,type:"video/quicktime",controller:"true",autoplay:"false",loop:"false",enablejavascript:"true",style:"display:block; height: 20px;"});w.insertBefore(T,w.firstChild)}};function c(w,_){for(var C="",m=0;m<w.length;m++)C+=S(w.charCodeAt(m),2);return"%00%FF"+_+S(C.length/3,2)+C}function f(w){if(!w||!w.accidentals)return"";for(var _="%00%FF%59%02",C=0,m=256,T=0;T<w.accidentals.length;T++)w.accidentals[T].acc==="sharp"?C++:w.accidentals[T].acc==="flat"&&m--;var L=S(m!==256?m:C,2),N=w.mode==="m"?"%01":"%00";return _+L+N}function p(w){var _="%00%FF%58%04"+S(w.num,2),C={1:0,2:1,4:2,8:3,16:4,32:5},m=C[w.den];if(!m)return"";_+=S(m,2);var T;switch(w.num+"/"+w.den){case"2/4":case"3/4":case"4/4":case"5/4":T=24;break;case"6/4":T=72;break;case"2/2":case"3/2":case"4/2":T=48;break;case"3/8":case"6/8":case"9/8":case"12/8":T=36;break}return T?(_+=S(T,2),_+"%08"):""}function y(w){for(var _="",C=0;C<w.length;C+=2)_+="%",_+=w.substr(C,2);return _}function S(w,_){var C=w.toString(16);for(C=C.split(".")[0];C.length<_;)C="0"+C;return C.length>_&&(C=C.substring(0,_)),y(C)}function A(w){w=Math.round(w);var _=w%128,C=w-_;return S(C*2+_,4)}function M(w){var _=0,C=[];for(w=Math.round(w);w!==0;)C.push(w&127),w=w>>7;for(var m=C.length-1;m>=0;m--){_=_<<8;var T=C[m];m!==0&&(T=T|128),_=_|T}var L=_.toString(16).length;return L+=L%2,S(_,L)}r=function(){return new l}}(),nb=r,nb}var ib,m4;function bN(){if(m4)return ib;m4=1;var t=c7(),r;return function(){var a=1920;r=function(c,f){f===void 0&&(f={});var p=c.setUpAudio(f),y=t(),S=c.metaText?c.metaText.title:void 0;S&&S.length>128&&(S=S.substring(0,124)+"...");var A=c.getKeySignature(),M=c.getMeterFraction(),w=p.tempo,_=w/60;if(M.den==8){var C=c.millisecondsPerMeasure();w=6e4/(C/M.num)/2,_=w/60}y.setGlobalInfo(w,S,A,M);for(var m=0;m<p.tracks.length;m++){y.startTrack();for(var T={},L=0;L<p.tracks[m].length;L++){var N=p.tracks[m][L];switch(N.cmd){case"text":y.setText(N.type,N.text);break;case"program":var B=0;f.pan&&f.pan.length>m&&(B=f.pan[m]),N.instrument===128?(y.setChannel(9,B),y.setInstrument(0)):(y.setChannel(N.channel,B),y.setInstrument(N.instrument));break;case"note":var W=N.gap*_,G=N.start,R=G+N.duration-W;T[G]||(T[G]=[]),T[G].push({pitch:N.pitch,volume:N.volume,cents:N.cents}),T[R]||(T[R]=[]),T[R].push({pitch:N.pitch,volume:0});break;default:console.log("MIDI create Unknown: "+N.cmd)}}l(y,T,a),y.endTrack()}return y.getData()};function l(u,c,f){for(var p=Object.keys(c),y=0;y<p.length;y++)p[y]=parseFloat(p[y]);p.sort(function(m,T){return m-T});for(var S=0,A=0;A<p.length;A++){var M=c[p[A]];if(p[A]>S){var w=(p[A]-S)*f;u.addRest(w),S=p[A]}for(var _=0;_<M.length;_++){var C=M[_];C.volume?u.startNote(C.pitch,C.volume,C.cents):u.endNote(C.pitch)}}}}(),ib=r,ib}var sb,_4;function yN(){if(_4)return sb;_4=1;var t=rf(),r=bN(),a=function(c,f){var p={};if(f)for(var y in f)f.hasOwnProperty(y)&&(p[y]=f[y]);p.generateInline=!1;function S(A,M,w){var _=r(M,p);switch(p.midiOutputType){case"encoded":return _;case"binary":var C=_.replace("data:audio/midi,","");C=C.replace(/MThd/g,"%4d%54%68%64"),C=C.replace(/MTrk/g,"%4d%54%72%6b");for(var m=new ArrayBuffer(C.length/3),T=new Uint8Array(m),L=0;L<C.length/3;L++){var N=L*3+1,B=parseInt(C.substring(N,N+2),16);T[L]=B}return T;case"link":default:return u(M,p,_,w)}}return typeof c=="string"?t.renderEngine(S,"*",c,p):S(null,c,0)};function l(c){var f={};return c&&f.toString.call(c)==="[object Function]"}var u=function(c,f,p,y){var S=["abcjs-download-midi","abcjs-midi-"+y];f.downloadClass&&S.push(f.downloadClass);var A='<div class="'+S.join(" ")+'">';f.preTextDownload&&(A+=f.preTextDownload);var M=c.metaText&&c.metaText.title?c.metaText.title:"Untitled",w;f.downloadLabel&&l(f.downloadLabel)?w=f.downloadLabel(c,y):f.downloadLabel?w=f.downloadLabel.replace(/%T/,M):w='Download MIDI for "'+M+'"',M=M.toLowerCase().replace(/'/g,"").replace(/\W/g,"_").replace(/__/g,"_");var _=f.fileName?f.fileName:M+".midi";return A+='<a download="'+_+'" href="'+p+'">'+w+"</a>",f.postTextDownload&&(A+=f.postTextDownload),A+"</div>"};return sb=a,sb}var ab,b4;function h7(){if(b4)return ab;b4=1;try{if(typeof window.CustomEvent!="function"){var t=function(a,l){l=l||{bubbles:!1,cancelable:!1,detail:void 0};var u=document.createEvent("CustomEvent");return u.initCustomEvent(a,l.bubbles,l.cancelable,l.detail),u};t.prototype=window.Event.prototype,window.CustomEvent=t}}catch{}var r=function(a){typeof a=="string"?this.textarea=document.getElementById(a):this.textarea=a,this.initialText=this.textarea.value,this.isDragging=!1};return r.prototype.addSelectionListener=function(a){this.textarea.onmousemove=function(l){this.isDragging&&a.fireSelectionChanged()}},r.prototype.addChangeListener=function(a){this.changelistener=a,this.textarea.onkeyup=function(){a.fireChanged()},this.textarea.onmousedown=function(){this.isDragging=!0,a.fireSelectionChanged()},this.textarea.onmouseup=function(){this.isDragging=!1,a.fireChanged()},this.textarea.onchange=function(){a.fireChanged()}},r.prototype.getSelection=function(){return{start:this.textarea.selectionStart,end:this.textarea.selectionEnd}},r.prototype.setSelection=function(a,l){if(this.textarea.setSelectionRange)this.textarea.setSelectionRange(a,l);else if(this.textarea.createTextRange){var u=this.textarea.createTextRange();u.collapse(!0),u.moveEnd("character",l),u.moveStart("character",a),u.select()}this.textarea.focus()},r.prototype.getString=function(){return this.textarea.value},r.prototype.setString=function(a){this.textarea.value=a,this.initialText=this.getString(),this.changelistener&&this.changelistener.fireChanged()},r.prototype.getElem=function(){return this.textarea},ab=r,ab}var ob,y4;function wN(){if(y4)return ob;y4=1;var t=Bo(),r=u7(),a=sf(),l=s7(),u=h7();function c(p){var y={},S;if(p.abcjsParams)for(S in p.abcjsParams)p.abcjsParams.hasOwnProperty(S)&&(y[S]=p.abcjsParams[S]);if(p.midi_options)for(S in p.midi_options)p.midi_options.hasOwnProperty(S)&&(y[S]=p.midi_options[S]);if(p.parser_options)for(S in p.parser_options)p.parser_options.hasOwnProperty(S)&&(y[S]=p.parser_options[S]);if(p.render_options)for(S in p.render_options)p.render_options.hasOwnProperty(S)&&(y[S]=p.render_options[S]);return y.tablature&&p.warnings_id&&(y.tablature.warnings_id=p.warnings_id),y}var f=function(p,y){this.abcjsParams=c(y),y.indicate_changed&&(this.indicate_changed=!0),typeof p=="string"?this.editarea=new u(p):this.editarea=p,this.editarea.addSelectionListener(this),this.editarea.addChangeListener(this),y.canvas_id?this.div=y.canvas_id:y.paper_id?this.div=y.paper_id:(this.div=document.createElement("DIV"),this.editarea.getElem().parentNode.insertBefore(this.div,this.editarea.getElem())),typeof this.div=="string"&&(this.div=document.getElementById(this.div)),y.selectionChangeCallback&&(this.selectionChangeCallback=y.selectionChangeCallback),this.clientClickListener=this.abcjsParams.clickListener,this.abcjsParams.clickListener=this.highlight.bind(this),y.synth&&a()&&(this.synth={el:y.synth.el,cursorControl:y.synth.cursorControl,options:y.synth.options}),y.generate_midi&&(this.generate_midi=y.generate_midi,this.abcjsParams.generateDownload&&(typeof y.midi_download_id=="string"?this.downloadMidi=document.getElementById(y.midi_download_id):y.midi_download_id&&(this.downloadMidi=y.midi_download_id)),this.abcjsParams.generateInline!==!1&&(typeof y.midi_id=="string"?this.inlineMidi=document.getElementById(y.midi_id):y.midi_id&&(this.inlineMidi=y.midi_id))),y.warnings_id?typeof y.warnings_id=="string"?this.warningsdiv=document.getElementById(y.warnings_id):this.warningsdiv=y.warnings_id:y.generate_warnings&&(this.warningsdiv=document.createElement("div"),this.div.parentNode.insertBefore(this.warningsdiv,this.div)),this.onchangeCallback=y.onchange,this.currentAbc="",this.tunes=[],this.bReentry=!1,this.parseABC(),this.modelChanged(),this.addClassName=function(S,A){var M=function(w,_){var C=w.className;return C.length>0&&(C===_||new RegExp("(^|\\s)"+_+"(\\s|$)").test(C))};return M(S,A)||(S.className+=(S.className?" ":"")+A),S},this.removeClassName=function(S,A){return S.className=t.strip(S.className.replace(new RegExp("(^|\\s+)"+A+"(\\s+|$)")," ")),S},this.setReadOnly=function(S){var A="abc_textarea_readonly",M=this.editarea.getElem();S?(M.setAttribute("readonly","yes"),this.addClassName(M,A)):(M.removeAttribute("readonly"),this.removeClassName(M,A))}};return f.prototype.redrawMidi=function(){if(this.generate_midi&&!this.midiPause){var p=new window.CustomEvent("generateMidi",{detail:{tunes:this.tunes,abcjsParams:this.abcjsParams,downloadMidiEl:this.downloadMidi,inlineMidiEl:this.inlineMidi,engravingEl:this.div}});window.dispatchEvent(p)}if(this.synth){var y=this.synth.synthControl;this.synth.synthControl||(this.synth.synthControl=new r,this.synth.synthControl.load(this.synth.el,this.synth.cursorControl,this.synth.options)),this.synth.synthControl.setTune(this.tunes[0],y,this.synth.options)}},f.prototype.modelChanged=function(){if(!this.bReentry){this.bReentry=!0;try{this.timerId=null,this.synth&&this.synth.synthControl&&this.synth.synthControl.disable(!0),this.tunes=l(this.div,this.currentAbc,this.abcjsParams),this.tunes.length>0&&(this.warnings=this.tunes[0].warnings),this.redrawMidi()}catch(p){console.error("ABCJS error: ",p),this.warnings||(this.warnings=[]),this.warnings.push(p.message)}this.warningsdiv&&(this.warningsdiv.innerHTML=this.warnings?this.warnings.join("<br />"):"No errors"),this.updateSelection(),this.bReentry=!1}},f.prototype.paramChanged=function(p){if(p)for(var y in p)p.hasOwnProperty(y)&&(this.abcjsParams[y]=p[y]);this.currentAbc="",this.fireChanged()},f.prototype.synthParamChanged=function(p){if(this.synth){if(this.synth.options={},p)for(var y in p)p.hasOwnProperty(y)&&(this.synth.options[y]=p[y]);this.currentAbc="",this.fireChanged()}},f.prototype.parseABC=function(){var p=this.editarea.getString();return p===this.currentAbc?(this.updateSelection(),!1):(this.currentAbc=p,!0)},f.prototype.updateSelection=function(){var p=this.editarea.getSelection();try{this.tunes.length>0&&this.tunes[0].engraver&&this.tunes[0].engraver.rangeHighlight(p.start,p.end)}catch{}this.selectionChangeCallback&&this.selectionChangeCallback(p.start,p.end)},f.prototype.fireSelectionChanged=function(){this.updateSelection()},f.prototype.setDirtyStyle=function(p){if(this.indicate_changed!==void 0){var y=function(w,_){var C=function(m,T){var L=m.className;return L.length>0&&(L===T||new RegExp("(^|\\s)"+T+"(\\s|$)").test(L))};return C(w,_)||(w.className+=(w.className?" ":"")+_),w},S=function(w,_){return w.className=t.strip(w.className.replace(new RegExp("(^|\\s+)"+_+"(\\s+|$)")," ")),w},A="abc_textarea_dirty",M=this.editarea.getElem();p?y(M,A):S(M,A)}},f.prototype.fireChanged=function(){if(!this.bIsPaused&&this.parseABC()){var p=this;this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout(function(){p.modelChanged()},300);var y=this.isDirty();this.wasDirty!==y&&(this.wasDirty=y,this.setDirtyStyle(y)),this.onchangeCallback&&this.onchangeCallback(this)}},f.prototype.setNotDirty=function(){this.editarea.initialText=this.editarea.getString(),this.wasDirty=!1,this.setDirtyStyle(!1)},f.prototype.isDirty=function(){return this.indicate_changed===void 0?!1:this.editarea.initialText!==this.editarea.getString()},f.prototype.highlight=function(p,y,S,A,M,w){this.editarea.setSelection(p.startChar,p.endChar),this.selectionChangeCallback&&this.selectionChangeCallback(p.startChar,p.endChar),this.clientClickListener&&this.clientClickListener(p,y,S,A,M,w)},f.prototype.pause=function(p){this.bIsPaused=p,p||this.fireChanged()},f.prototype.millisecondsPerMeasure=function(){return!this.synth||!this.synth.synthControl||!this.synth.synthControl.visualObj?0:this.synth.synthControl.visualObj.millisecondsPerMeasure()},f.prototype.pauseMidi=function(p){this.midiPause=p,p||this.redrawMidi()},ob=f,ob}var lb,w4;function SN(){if(w4)return lb;w4=1;var t=zI(),r=HI(),a=rf(),l=q9(),u=iP(),c={};c.signature="abcjs-basic v"+t,Object.keys(r).forEach(function(B){c[B]=r[B]}),Object.keys(a).forEach(function(B){c[B]=a[B]}),c.renderAbc=s7(),c.tuneMetrics=lN(),c.TimingCallbacks=Vy();var f=Jo();c.setGlyph=f.setSymbol,c.strTranspose=u;var p=jy(),y=Qy(),S=Zy(),A=o7(),M=l7(),w=nf(),_=Lu(),C=sf(),m=_N(),T=u7(),L=yN(),N=c7();return c.synth={CreateSynth:p,instrumentIndexToName:y,pitchToNoteName:S,SynthController:T,SynthSequence:A,CreateSynthControl:M,registerAudioContext:w,activeAudioContext:_,supportsAudio:C,playEvent:m,getMidiFile:L,sequence:l,midiRenderer:N},c.Editor=wN(),c.EditArea=h7(),lb=c,lb}var CN=SN();const xN=Vh(CN),kN=qr({name:"MusicScoreRenderer",props:{abcString:{type:String,required:!0}},mounted(){xN.renderAbc("abc",this.abcString)}}),MN={id:"abc"};function EN(t,r,a,l,u,c){return st(),_t("div",MN)}const AN=Mn(kN,[["render",EN]]);function TN(){const t=[];for(let r=0;r<5;r++)t.push(Fh[Math.floor(Math.random()*Fh.length)]);return t}const IN=qr({name:"IdentifyKeyView",components:{RadioMultipleChoice:zh,MusicScoreRenderer:AN},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"IdentifyKeyView"),l=Wn(a),u=Qt("");l.question.value=new f7(t.data);const c=Nr(()=>l.question.value),f=Nr(()=>{var y,S;const A=TN();return A.includes(((y=c.value)==null?void 0:y.key)||"")||(A[Math.floor(Math.random()*A.length)]=((S=c.value)==null?void 0:S.key)||""),A});return{...a,...l,answer:u,question:c,choices:f,submit:()=>{}}}}),PN={"data-viewable":"IdentifyKeyView"};function NN(t,r,a,l,u,c){const f=vt("MusicScoreRenderer"),p=vt("RadioMultipleChoice");return st(),_t("div",PN,[t.question?(st(),_t(Gr,{key:0},[ft(f,{"key-signature":`X:1
|
|
272
|
+
K:${t.question.key}
|
|
273
|
+
||`,"abc-string":"''"},null,8,["key-signature"]),r[0]||(r[0]=Yt(" This signature is for the major key: _____ ")),ft(p,{"choice-list":t.choices},null,8,["choice-list"])],64)):br("",!0)])}const LN=Mn(IN,[["render",NN]]),Fh=["C","G","D","A","E","B","F#","C#","F","Bb","Eb","Ab","Db","Gb","Cb"],Jy=class kh extends pi{constructor(r){super(r),lt(this,"key"),this.key=kh.getKey(r[0].key)}static getKey(r){return Fh[r]}isCorrect(r){return console.log(`answer: ${JSON.stringify(r)}, key: ${this.key}`),this.key===r.choiceList[r.selection]}dataShapes(){return kh.dataShapes}views(){return kh.views}};lt(Jy,"dataShapes",[{name:di.SIGHTSING_IdentifyKey,fields:[{name:"key",type:pr.NUMBER,validator:{test:t=>{const r=parseInt(t);return r>=0&&r<=Fh.length?{msg:"",status:Jt.ok}:{msg:"Please enter a number between 0 and 11",status:Jt.error}}}}]}]);lt(Jy,"views",[LN]);let f7=Jy;const ON=new Oo("sightSing",[f7]),DN=qr({name:"LetterQuestionView",props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"LetterQuestionView"),l=Wn(a),u=Qt(null);l.question.value=new d7(t.data);const c=Nr(()=>l.question.value),f=p=>{var y;if(!c.value)return;const S=p.key.toLowerCase(),A=c.value.letter.toLowerCase();if(S===A){(y=u.value)==null||y.classList.add("pressed");const M=w=>{var _;w.key.toLowerCase()===A&&((_=u.value)==null||_.classList.remove("pressed"),l.submitAnswer(S),window.removeEventListener("keyup",M))};window.addEventListener("keyup",M)}else l.submitAnswer(S)};return oa(()=>{window.addEventListener("keypress",f)}),Hh(()=>{window.removeEventListener("keypress",f)}),{...l,...a,letterDisplay:u,question:c}}}),RN={"data-viewable":"LetterQuestionView"};function BN(t,r,a,l,u,c){return st(),_t("div",RN,[t.question?(st(),_t(Gr,{key:0},[r[0]||(r[0]=pt("p",{class:"text-h5"},"Type this letter!",-1)),pt("div",{ref:"letterDisplay",class:"letter-display"},ir(t.question.letter),513)],64)):br("",!0)])}const FN=Mn(DN,[["render",BN],["__scopeId","data-v-4ae4db54"]]),qN=function(){const t=[];for(let r=0;r<26;r++)t.push({letter:String.fromCharCode(65+r)});return t},ah=class Vb extends pi{constructor(r){super(r),lt(this,"letter"),this.letter=r[0].letter}evaluate(r,a){return{isCorrect:this.isCorrect(r),performance:this.displayedSkill(r,a)}}displayedSkill(r,a){return this.isCorrect(r)?a<3e3?1:1-(a-3e3)/7e3*.75:0}dataShapes(){return Vb.dataShapes}views(){return Vb.views}isCorrect(r){const a=r.toLowerCase()===this.letter.toLowerCase();return console.log(`singleLetter Q isCorrect: ${a}`),a}};lt(ah,"dataShapes",[{name:di.TYPING_singleLetter,fields:[{name:"letter",type:pr.STRING,validator:{instructions:"Enter a single letter",test:function(t){return!t||t.length!==1||!/[a-zA-Z]/.test(t)?{status:Jt.error,msg:"Input must be a single letter"}:{status:Jt.ok,msg:""}}}}]}]);lt(ah,"views",[FN]);lt(ah,"acceptsUserData",!0);lt(ah,"seedData",qN());let d7=ah;const zN=qr({name:"FallingLettersView",props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"FallingLettersView"),l=Wn(a),u=Qt(null),c=Qt([]),f=Qt(!1),p=Qt(""),y=Qt(30),S=Qt(0),A=Qt([]),M=Qt([]),w=Qt({currentSpeed:2,letterId:0,gameLoop:null,lastSpawn:0,lastUpdate:0,spawnInterval:1e3}),_=()=>{A.value=Array.from({length:7},(W,G)=>({id:G,left:20+G*Math.random()*30-10,height:100+Math.random()*120,scale:1+Math.random()*2}))},C=()=>{if(!u.value)return;const W={id:w.value.letterId++,char:String.fromCharCode(65+Math.floor(Math.random()*26)),x:Math.random()*(u.value.clientWidth-30),y:-30};c.value.push(W)},m=()=>{f.value=!0,p.value="You Win!",l.submitAnswer({lettersTyped:S.value,win:!0,percentage:1})},T=()=>{var W;f.value=!0,p.value="Game Over!",l.submitAnswer({lettersTyped:S.value,percentage:y.value/(((W=l.question.value)==null?void 0:W.gameLength)||30),win:!1})},L=W=>{if(f.value)return;const G=(W-w.value.lastUpdate)/1e3;if(w.value.lastUpdate=W,y.value-=G,l.question.value&&(w.value.currentSpeed+=l.question.value.acceleration*G),y.value<=0){m();return}W-w.value.lastSpawn>=w.value.spawnInterval&&(C(),w.value.lastSpawn=W,w.value.spawnInterval=Math.max(500,w.value.spawnInterval-10)),u.value&&(c.value=c.value.filter(R=>(R.y+=w.value.currentSpeed,R.y>u.value.clientHeight?(T(),!1):!0))),w.value.gameLoop=requestAnimationFrame(L)},N=W=>{if(f.value)return;const G=W.key.toUpperCase(),R=c.value.findIndex(ye=>ye.char===G);R!==-1&&(M.value.push({id:Date.now(),x:c.value[R].x,y:c.value[R].y}),setTimeout(()=>{M.value=M.value.filter(ye=>ye.id!==M.value[M.value.length-1].id)},300),c.value.splice(R,1),S.value++)},B=()=>{if(!l.question.value){a.logger.error("Question not initialized");return}y.value=l.question.value.gameLength,S.value=0,c.value=[],f.value=!1,p.value="",w.value={currentSpeed:l.question.value.initialSpeed,letterId:0,gameLoop:null,lastSpawn:performance.now(),lastUpdate:performance.now(),spawnInterval:l.question.value.spawnInterval*1e3},w.value.gameLoop=requestAnimationFrame(L)};return oa(()=>{try{l.question.value=new p7(t.data),l.maxAttemptsPerView.value=1,window.addEventListener("keypress",N),_(),B()}catch(W){a.logger.error("Error initializing game:",W)}}),Hh(()=>{window.removeEventListener("keypress",N),w.value.gameLoop&&cancelAnimationFrame(w.value.gameLoop)}),{...l,gameArea:u,letters:c,gameOver:f,gameOverMessage:p,timeLeft:y,score:S,treePositions:A,explosions:M}}}),HN={class:"game-container"},VN={class:"stats"},UN={class:"time"},$N={class:"score"},WN={ref:"gameArea",class:"game-area"},GN={class:"letter-text"},YN={class:"trees"},KN={key:0,class:"game-over"};function XN(t,r,a,l,u,c){return st(),_t("div",HN,[pt("div",VN,[pt("div",UN,"Time: "+ir(t.timeLeft.toFixed(1))+"s",1),pt("div",$N,"Score: "+ir(t.score),1)]),pt("div",WN,[(st(!0),_t(Gr,null,Ai(t.letters,f=>(st(),_t("div",{key:f.id,class:"falling-letter",style:Hn({left:f.x+"px",top:f.y+"px"})},[r[0]||(r[0]=pt("div",{class:"meteor-effect"},null,-1)),pt("span",GN,ir(f.char),1)],4))),128)),(st(!0),_t(Gr,null,Ai(t.explosions,f=>(st(),_t("div",{key:f.id,class:"explosion",style:Hn({left:f.x+"px",top:f.y+"px"})},[(st(),_t(Gr,null,Ai(12,p=>pt("div",{key:p,class:"particle"})),64))],4))),128)),r[2]||(r[2]=pt("div",{class:"grass-container"},[pt("div",{class:"grass"}),pt("div",{class:"grass-overlay"})],-1)),pt("div",YN,[(st(!0),_t(Gr,null,Ai(t.treePositions,f=>(st(),_t("div",{key:f.id,class:"tree",style:Hn({left:`${f.left}%`,height:`${f.height}px`,transform:`scale(${f.scale})`})},r[1]||(r[1]=[pt("div",{class:"tree-crown"},null,-1),pt("div",{class:"tree-trunk"},null,-1)]),4))),128))])],512),t.gameOver?(st(),_t("div",KN,ir(t.gameOverMessage),1)):br("",!0)])}const QN=Mn(zN,[["render",XN],["__scopeId","data-v-3c9f2af5"]]),ZN=function(){return[{gameLength:30,initialSpeed:2,acceleration:.1,spawnInterval:1}]},oh=class Ub extends pi{constructor(r){super(r),lt(this,"gameLength"),lt(this,"initialSpeed"),lt(this,"acceleration"),lt(this,"spawnInterval"),this.gameLength=r[0].gameLength,this.initialSpeed=r[0].initialSpeed,this.acceleration=r[0].acceleration,this.spawnInterval=r[0].spawnInterval}evaluate(r){return{isCorrect:this.isCorrect(r),performance:this.displayedSkill(r)}}displayedSkill(r){return r.win?1:r.percentage}dataShapes(){return Ub.dataShapes}views(){return Ub.views}isCorrect(r){return r.win}};lt(oh,"dataShapes",[{name:di.TYPING_fallingLetters,fields:[{name:"gameLength",type:pr.NUMBER},{name:"initialSpeed",type:pr.NUMBER},{name:"acceleration",type:pr.NUMBER},{name:"spawnInterval",type:pr.NUMBER,validator:{instructions:"How often should a new letter spawn? (in seconds)",test:t=>typeof t=="string"?parseFloat(t)>0?{status:Jt.ok,msg:""}:{status:Jt.error,msg:"Must be greater than 0"}:{status:Jt.error,msg:"Unexpected non-string input."},placeholder:"1"}}]}]);lt(oh,"views",[QN]);lt(oh,"acceptsUserData",!0);lt(oh,"seedData",ZN());let p7=oh;const jN=new Oo("typing",[d7,p7]),JN=qr({name:"IdentifyVocab",components:{AudioAutoPlayer:Gb,UserInputString:A7},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:r}){const a=$n(t,r,"IdentifyVocab"),l=Wn(a),u=Qt("");l.question.value=new g7(t.data);const c=Nr(()=>l.question.value);return{...a,...l,answer:u,question:c,submit:()=>{c.value&&l.submitAnswer(u.value)}}}}),eL={"data-viewable":"IdentifyVocab"},tL={key:0,class:"text-h6"};function rL(t,r,a,l,u,c){const f=vt("UserInputString"),p=vt("center"),y=vt("audio-auto-player");return st(),_t("div",eL,[t.question?(st(),_t(Gr,{key:0},[r[1]||(r[1]=pt("span",{class:"text-h5"}," Spell the word: ",-1)),ft(f,{modelValue:t.answer,"onUpdate:modelValue":r[0]||(r[0]=S=>t.answer=S)},null,8,["modelValue"]),ft(p,null,{default:St(()=>[t.priorAttempts?(st(),_t("span",tL,ir(t.question.word),1)):br("",!0)]),_:1}),ft(p,null,{default:St(()=>[ft(y,{src:[t.getURL("WordAudio"),t.getURL("SentenceAudio"),t.getURL("WordAudio")]},null,8,["src"])]),_:1})],64)):br("",!0)])}const nL=Mn(JN,[["render",rL]]),iL=[{name:"Word",type:pr.STRING,validator:T4.NonEmptyString},{name:"ExampleSentence",type:pr.STRING},{name:"WordAudio",type:pr.AUDIO},{name:"SentenceAudio",type:pr.AUDIO}],ew=class $b extends pi{constructor(r){super(r),lt(this,"word"),lt(this,"sentence"),lt(this,"audio_word"),lt(this,"audio_sentence"),this.word=r[0].Word,this.sentence=r[0].Sentence,this.audio_word=r[0].WordAudio,this.audio_sentence=r[0].SentenceAudio}isCorrect(r){return r===this.word}dataShapes(){return $b.dataShapes}views(){return $b.views}};lt(ew,"dataShapes",[{fields:iL,name:di.WORDWORK_Spelling}]);lt(ew,"views",[nL]);let g7=ew;const sL=new Oo("wordWork",[g7]);class aL{constructor(r){lt(this,"courseList"),lt(this,"cachedRawViews",null),this.courseList=r}get courses(){return this.courseList}getCourse(r){return this.courseList.find(a=>a.name===r)}allViewsRaw(){if(!this.cachedRawViews){const r=this.allViews();this.cachedRawViews=Object.fromEntries(Object.entries(r).map(([a,l])=>[a,T7(l)]))}return this.cachedRawViews}allViews(){const r={};return this.courseList.forEach(a=>{Object.assign(r,a.allViewsMap)}),r}getView(r){let a;typeof r=="string"?a=To.getViewDescriptor(r):a=r;const l=this.getCourse(a.course);if(l){const u=l.getQuestion(a.questionType);if(u){const c=u.views.find(f=>f.name===a.view);if(c)return c;throw console.error(`QuestionView ${a.view} not found in course ${a.course}
|
|
274
|
+
|
|
275
|
+
descriptor: ${JSON.stringify(a)}
|
|
276
|
+
|
|
277
|
+
course: ${l.name}
|
|
278
|
+
question: ${u.name}
|
|
279
|
+
views: ${u.views.map(f=>f.name).join(", ")}
|
|
280
|
+
`),new Error(`view ${a.view} does not exist.`)}else throw console.error(`Question ${a.questionType} not found in course ${a.course}
|
|
281
|
+
|
|
282
|
+
descriptor: ${JSON.stringify(a)}
|
|
283
|
+
|
|
284
|
+
course: ${l.name}
|
|
285
|
+
questions: ${l.questions.map(c=>c.name).join(", ")}
|
|
286
|
+
`),new Error(`question ${a.questionType} does not exist.`)}else throw console.error(`Course ${a.course} not found.
|
|
287
|
+
|
|
288
|
+
descriptor: ${JSON.stringify(a)}`),new Error(`course ${a.course} does not exist.`)}toString(){let r="";return this.courses.forEach(a=>{r+=`Course: ${a.name}
|
|
289
|
+
`,a.questions.forEach(l=>{r+=` Question: ${l.name}
|
|
290
|
+
`,l.views.forEach(u=>{r+=` View: ${u.name}
|
|
291
|
+
`})})}),r}allDataShapesRaw(){const r=[];return this.courseList.forEach(a=>{a.questions.forEach(l=>{l.dataShapes.forEach(u=>{r.includes(u)||r.push(u)})})}),r}allDataShapes(){const r=[];return this.courseList.forEach(a=>{a.questions.forEach(l=>{l.dataShapes.forEach(u=>{r.findIndex(c=>c.course===a.name&&c.dataShape===u.name)===-1&&r.push({course:a.name,dataShape:u.name,displayable:l})})})}),r}getDataShape(r){let a;if(this.getCourse(r.course).questions.forEach(l=>{l.dataShapes.forEach(u=>{u.name===r.dataShape&&(a=u)})}),a)return a;throw new Error(`DataShape ${To.getDataShapeString(r)} not found`)}}const tw=new aL([Cx,sL,nC,J7,LI,qI,ON,YS,jN]);function oL(t){return t!==null&&typeof t=="object"&&"clearData"in t&&"validate"in t&&typeof t.clearData=="function"&&typeof t.validate=="function"}var ph=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lL(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var V0={exports:{}};/**
|
|
292
|
+
* @license
|
|
293
|
+
* Lodash <https://lodash.com/>
|
|
294
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
295
|
+
* Released under MIT license <https://lodash.com/license>
|
|
296
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
297
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
298
|
+
*/var uL=V0.exports,S4;function cL(){return S4||(S4=1,function(t,r){(function(){var a,l="4.17.21",u=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",f="Expected a function",p="Invalid `variable` option passed into `_.template`",y="__lodash_hash_undefined__",S=500,A="__lodash_placeholder__",M=1,w=2,_=4,C=1,m=2,T=1,L=2,N=4,B=8,W=16,G=32,R=64,ye=128,q=256,se=512,ve=30,he="...",ce=800,de=16,K=1,Q=2,le=3,Ee=1/0,Me=9007199254740991,H=17976931348623157e292,Y=NaN,X=4294967295,xe=X-1,De=X>>>1,$e=[["ary",ye],["bind",T],["bindKey",L],["curry",B],["curryRight",W],["flip",se],["partial",G],["partialRight",R],["rearg",q]],Re="[object Arguments]",ut="[object Array]",Lt="[object AsyncFunction]",it="[object Boolean]",Ct="[object Date]",It="[object DOMException]",at="[object Error]",Gt="[object Function]",Dt="[object GeneratorFunction]",ct="[object Map]",gr="[object Number]",vr="[object Null]",er="[object Object]",Cr="[object Promise]",Wr="[object Proxy]",kr="[object RegExp]",Ue="[object Set]",Je="[object String]",Ye="[object Symbol]",Qe="[object Undefined]",rt="[object WeakMap]",o="[object WeakSet]",h="[object ArrayBuffer]",b="[object DataView]",x="[object Float32Array]",E="[object Float64Array]",I="[object Int8Array]",F="[object Int16Array]",D="[object Int32Array]",z="[object Uint8Array]",U="[object Uint8ClampedArray]",J="[object Uint16Array]",te="[object Uint32Array]",ee=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,pe=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ie=/&(?:amp|lt|gt|quot|#39);/g,fe=/[&<>"']/g,ne=RegExp(ie.source),ae=RegExp(fe.source),Z=/<%-([\s\S]+?)%>/g,ue=/<%([\s\S]+?)%>/g,me=/<%=([\s\S]+?)%>/g,we=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ge=/^\w*$/,Ae=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ie=/[\\^$.*+?()[\]{}|]/g,Oe=RegExp(Ie.source),qe=/^\s+/,Pe=/\s/,Fe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ve=/\{\n\/\* \[wrapped with (.+)\] \*/,Ke=/,? & /,Xe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,je=/[()=,{}\[\]\/\s]/,gt=/\\(\\)?/g,xt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Mt=/\w*$/,Bt=/^[-+]0x[0-9a-f]+$/i,ot=/^0b[01]+$/i,ht=/^\[object .+?Constructor\]$/,Tt=/^0o[0-7]+$/i,zt=/^(?:0|[1-9]\d*)$/,Ft=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zt=/($^)/,rr=/['\n\r\u2028\u2029\\]/g,sr="\\ud800-\\udfff",fr="\\u0300-\\u036f",ur="\\ufe20-\\ufe2f",ln="\\u20d0-\\u20ff",sn=fr+ur+ln,gn="\\u2700-\\u27bf",Et="a-z\\xdf-\\xf6\\xf8-\\xff",Lr="\\xac\\xb1\\xd7\\xf7",Br="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Gn="\\u2000-\\u206f",vn=" \\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",On="A-Z\\xc0-\\xd6\\xd8-\\xde",Ti="\\ufe0e\\ufe0f",Zn=Lr+Br+Gn+vn,Pn="['’]",Yn="["+sr+"]",Nn="["+Zn+"]",an="["+sn+"]",jr="\\d+",ca="["+gn+"]",Os="["+Et+"]",ha="[^"+sr+Zn+jr+gn+Et+On+"]",ws="\\ud83c[\\udffb-\\udfff]",Fo="(?:"+an+"|"+ws+")",fa="[^"+sr+"]",bi="(?:\\ud83c[\\udde6-\\uddff]){2}",Zi="[\\ud800-\\udbff][\\udc00-\\udfff]",Dn="["+On+"]",as="\\u200d",yi="(?:"+Os+"|"+ha+")",mr="(?:"+Dn+"|"+ha+")",gi="(?:"+Pn+"(?:d|ll|m|re|s|t|ve))?",Kn="(?:"+Pn+"(?:D|LL|M|RE|S|T|VE))?",vi=Fo+"?",jn="["+Ti+"]?",Ss="(?:"+as+"(?:"+[fa,bi,Zi].join("|")+")"+jn+vi+")*",Na="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",La="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",g=jn+vi+Ss,P="(?:"+[ca,bi,Zi].join("|")+")"+g,re="(?:"+[fa+an+"?",an,bi,Zi,Yn].join("|")+")",_e=RegExp(Pn,"g"),Le=RegExp(an,"g"),Ze=RegExp(ws+"(?="+ws+")|"+re+g,"g"),tt=RegExp([Dn+"?"+Os+"+"+gi+"(?="+[Nn,Dn,"$"].join("|")+")",mr+"+"+Kn+"(?="+[Nn,Dn+yi,"$"].join("|")+")",Dn+"?"+yi+"+"+gi,Dn+"+"+Kn,La,Na,jr,P].join("|"),"g"),kt=RegExp("["+as+sr+sn+Ti+"]"),Nt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,_r=["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"],cr=-1,Ut={};Ut[x]=Ut[E]=Ut[I]=Ut[F]=Ut[D]=Ut[z]=Ut[U]=Ut[J]=Ut[te]=!0,Ut[Re]=Ut[ut]=Ut[h]=Ut[it]=Ut[b]=Ut[Ct]=Ut[at]=Ut[Gt]=Ut[ct]=Ut[gr]=Ut[er]=Ut[kr]=Ut[Ue]=Ut[Je]=Ut[rt]=!1;var jt={};jt[Re]=jt[ut]=jt[h]=jt[b]=jt[it]=jt[Ct]=jt[x]=jt[E]=jt[I]=jt[F]=jt[D]=jt[ct]=jt[gr]=jt[er]=jt[kr]=jt[Ue]=jt[Je]=jt[Ye]=jt[z]=jt[U]=jt[J]=jt[te]=!0,jt[at]=jt[Gt]=jt[rt]=!1;var Ds={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Cs={"&":"&","<":"<",">":">",'"':""","'":"'"},Rs={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ii={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},xs=parseFloat,Ou=parseInt,qo=typeof ph=="object"&&ph&&ph.Object===Object&&ph,zo=typeof self=="object"&&self&&self.Object===Object&&self,Or=qo||zo||Function("return this")(),Oa=r&&!r.nodeType&&r,mi=Oa&&!0&&t&&!t.nodeType&&t,tl=mi&&mi.exports===Oa,da=tl&&qo.process,un=function(){try{var Ce=mi&&mi.require&&mi.require("util").types;return Ce||da&&da.binding&&da.binding("util")}catch{}}(),pa=un&&un.isArrayBuffer,ks=un&&un.isDate,ga=un&&un.isMap,Ho=un&&un.isRegExp,os=un&&un.isSet,Vo=un&&un.isTypedArray;function wr(Ce,Be,Ne){switch(Ne.length){case 0:return Ce.call(Be);case 1:return Ce.call(Be,Ne[0]);case 2:return Ce.call(Be,Ne[0],Ne[1]);case 3:return Ce.call(Be,Ne[0],Ne[1],Ne[2])}return Ce.apply(Be,Ne)}function Du(Ce,Be,Ne,Se){for(var Te=-1,Ge=Ce==null?0:Ce.length;++Te<Ge;){var et=Ce[Te];Be(Se,et,Ne(et),Ce)}return Se}function Jr(Ce,Be){for(var Ne=-1,Se=Ce==null?0:Ce.length;++Ne<Se&&Be(Ce[Ne],Ne,Ce)!==!1;);return Ce}function va(Ce,Be){for(var Ne=Ce==null?0:Ce.length;Ne--&&Be(Ce[Ne],Ne,Ce)!==!1;);return Ce}function rl(Ce,Be){for(var Ne=-1,Se=Ce==null?0:Ce.length;++Ne<Se;)if(!Be(Ce[Ne],Ne,Ce))return!1;return!0}function Jn(Ce,Be){for(var Ne=-1,Se=Ce==null?0:Ce.length,Te=0,Ge=[];++Ne<Se;){var et=Ce[Ne];Be(et,Ne,Ce)&&(Ge[Te++]=et)}return Ge}function Bs(Ce,Be){var Ne=Ce==null?0:Ce.length;return!!Ne&&Pi(Ce,Be,0)>-1}function Da(Ce,Be,Ne){for(var Se=-1,Te=Ce==null?0:Ce.length;++Se<Te;)if(Ne(Be,Ce[Se]))return!0;return!1}function hr(Ce,Be){for(var Ne=-1,Se=Ce==null?0:Ce.length,Te=Array(Se);++Ne<Se;)Te[Ne]=Be(Ce[Ne],Ne,Ce);return Te}function ei(Ce,Be){for(var Ne=-1,Se=Be.length,Te=Ce.length;++Ne<Se;)Ce[Te+Ne]=Be[Ne];return Ce}function Ra(Ce,Be,Ne,Se){var Te=-1,Ge=Ce==null?0:Ce.length;for(Se&&Ge&&(Ne=Ce[++Te]);++Te<Ge;)Ne=Be(Ne,Ce[Te],Te,Ce);return Ne}function Ru(Ce,Be,Ne,Se){var Te=Ce==null?0:Ce.length;for(Se&&Te&&(Ne=Ce[--Te]);Te--;)Ne=Be(Ne,Ce[Te],Te,Ce);return Ne}function Ba(Ce,Be){for(var Ne=-1,Se=Ce==null?0:Ce.length;++Ne<Se;)if(Be(Ce[Ne],Ne,Ce))return!0;return!1}var Fs=_a("length");function Ln(Ce){return Ce.split("")}function gu(Ce){return Ce.match(Xe)||[]}function qs(Ce,Be,Ne){var Se;return Ne(Ce,function(Te,Ge,et){if(Be(Te,Ge,et))return Se=Ge,!1}),Se}function zs(Ce,Be,Ne,Se){for(var Te=Ce.length,Ge=Ne+(Se?1:-1);Se?Ge--:++Ge<Te;)if(Be(Ce[Ge],Ge,Ce))return Ge;return-1}function Pi(Ce,Be,Ne){return Be===Be?sl(Ce,Be,Ne):zs(Ce,ma,Ne)}function Bu(Ce,Be,Ne,Se){for(var Te=Ne-1,Ge=Ce.length;++Te<Ge;)if(Se(Ce[Te],Be))return Te;return-1}function ma(Ce){return Ce!==Ce}function Ms(Ce,Be){var Ne=Ce==null?0:Ce.length;return Ne?ya(Ce,Be)/Ne:Y}function _a(Ce){return function(Be){return Be==null?a:Be[Ce]}}function ba(Ce){return function(Be){return Ce==null?a:Ce[Be]}}function Ir(Ce,Be,Ne,Se,Te){return Te(Ce,function(Ge,et,mt){Ne=Se?(Se=!1,Ge):Be(Ne,Ge,et,mt)}),Ne}function nl(Ce,Be){var Ne=Ce.length;for(Ce.sort(Be);Ne--;)Ce[Ne]=Ce[Ne].value;return Ce}function ya(Ce,Be){for(var Ne,Se=-1,Te=Ce.length;++Se<Te;){var Ge=Be(Ce[Se]);Ge!==a&&(Ne=Ne===a?Ge:Ne+Ge)}return Ne}function wa(Ce,Be){for(var Ne=-1,Se=Array(Ce);++Ne<Ce;)Se[Ne]=Be(Ne);return Se}function Rn(Ce,Be){return hr(Be,function(Ne){return[Ne,Ce[Ne]]})}function ji(Ce){return Ce&&Ce.slice(0,za(Ce)+1).replace(qe,"")}function Kt(Ce){return function(Be){return Ce(Be)}}function Hs(Ce,Be){return hr(Be,function(Ne){return Ce[Ne]})}function zr(Ce,Be){return Ce.has(Be)}function Sa(Ce,Be){for(var Ne=-1,Se=Ce.length;++Ne<Se&&Pi(Be,Ce[Ne],0)>-1;);return Ne}function ls(Ce,Be){for(var Ne=Ce.length;Ne--&&Pi(Be,Ce[Ne],0)>-1;);return Ne}function xn(Ce,Be){for(var Ne=Ce.length,Se=0;Ne--;)Ce[Ne]===Be&&++Se;return Se}var us=ba(Ds),Uo=ba(Cs);function Fu(Ce){return"\\"+Ii[Ce]}function il(Ce,Be){return Ce==null?a:Ce[Be]}function Bi(Ce){return kt.test(Ce)}function Fi(Ce){return Nt.test(Ce)}function Fa(Ce){for(var Be,Ne=[];!(Be=Ce.next()).done;)Ne.push(Be.value);return Ne}function cs(Ce){var Be=-1,Ne=Array(Ce.size);return Ce.forEach(function(Se,Te){Ne[++Be]=[Te,Se]}),Ne}function qa(Ce,Be){return function(Ne){return Ce(Be(Ne))}}function Xn(Ce,Be){for(var Ne=-1,Se=Ce.length,Te=0,Ge=[];++Ne<Se;){var et=Ce[Ne];(et===Be||et===A)&&(Ce[Ne]=A,Ge[Te++]=Ne)}return Ge}function Es(Ce){var Be=-1,Ne=Array(Ce.size);return Ce.forEach(function(Se){Ne[++Be]=Se}),Ne}function Qn(Ce){var Be=-1,Ne=Array(Ce.size);return Ce.forEach(function(Se){Ne[++Be]=[Se,Se]}),Ne}function sl(Ce,Be,Ne){for(var Se=Ne-1,Te=Ce.length;++Se<Te;)if(Ce[Se]===Be)return Se;return-1}function qu(Ce,Be,Ne){for(var Se=Ne+1;Se--;)if(Ce[Se]===Be)return Se;return Se}function qi(Ce){return Bi(Ce)?Ha(Ce):Fs(Ce)}function cn(Ce){return Bi(Ce)?al(Ce):Ln(Ce)}function za(Ce){for(var Be=Ce.length;Be--&&Pe.test(Ce.charAt(Be)););return Be}var zu=ba(Rs);function Ha(Ce){for(var Be=Ze.lastIndex=0;Ze.test(Ce);)++Be;return Be}function al(Ce){return Ce.match(Ze)||[]}function Hu(Ce){return Ce.match(tt)||[]}var Vu=function Ce(Be){Be=Be==null?Or:Ni.defaults(Or.Object(),Be,Ni.pick(Or,_r));var Ne=Be.Array,Se=Be.Date,Te=Be.Error,Ge=Be.Function,et=Be.Math,mt=Be.Object,or=Be.RegExp,dr=Be.String,ar=Be.TypeError,Bn=Ne.prototype,Vs=Ge.prototype,wi=mt.prototype,Ji=Be["__core-js_shared__"],Us=Vs.toString,nr=wi.hasOwnProperty,af=0,Uu=function(){var e=/[^.]+$/.exec(Ji&&Ji.keys&&Ji.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Va=wi.toString,of=Us.call(mt),lf=Or._,uf=or("^"+Us.call(nr).replace(Ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ua=tl?Be.Buffer:a,Si=Be.Symbol,$a=Be.Uint8Array,$u=Ua?Ua.allocUnsafe:a,Wa=qa(mt.getPrototypeOf,mt),Wu=mt.create,Gu=wi.propertyIsEnumerable,Ga=Bn.splice,Yu=Si?Si.isConcatSpreadable:a,$s=Si?Si.iterator:a,zi=Si?Si.toStringTag:a,Ya=function(){try{var e=Wi(mt,"defineProperty");return e({},"",{}),e}catch{}}(),cf=Be.clearTimeout!==Or.clearTimeout&&Be.clearTimeout,hf=Se&&Se.now!==Or.Date.now&&Se.now,ff=Be.setTimeout!==Or.setTimeout&&Be.setTimeout,Ka=et.ceil,Xa=et.floor,ol=mt.getOwnPropertySymbols,df=Ua?Ua.isBuffer:a,Ku=Be.isFinite,pf=Bn.join,gf=qa(mt.keys,mt),Pr=et.max,Ur=et.min,vf=Se.now,mf=Be.parseInt,Xu=et.random,_f=Bn.reverse,ll=Wi(Be,"DataView"),Ws=Wi(Be,"Map"),ul=Wi(Be,"Promise"),hs=Wi(Be,"Set"),Gs=Wi(Be,"WeakMap"),Ys=Wi(mt,"create"),Qa=Gs&&new Gs,fs={},bf=Gi(ll),yf=Gi(Ws),wf=Gi(ul),Sf=Gi(hs),Cf=Gi(Gs),Za=Si?Si.prototype:a,Ks=Za?Za.valueOf:a,Qu=Za?Za.toString:a;function V(e){if(Sr(e)&&!Pt(e)&&!(e instanceof $t)){if(e instanceof mn)return e;if(nr.call(e,"__wrapped__"))return Zc(e)}return new mn(e)}var ds=function(){function e(){}return function(n){if(!yr(n))return{};if(Wu)return Wu(n);e.prototype=n;var d=new e;return e.prototype=a,d}}();function ja(){}function mn(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=a}V.templateSettings={escape:Z,evaluate:ue,interpolate:me,variable:"",imports:{_:V}},V.prototype=ja.prototype,V.prototype.constructor=V,mn.prototype=ds(ja.prototype),mn.prototype.constructor=mn;function $t(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=X,this.__views__=[]}function xf(){var e=new $t(this.__wrapped__);return e.__actions__=en(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=en(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=en(this.__views__),e}function kf(){if(this.__filtered__){var e=new $t(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Mf(){var e=this.__wrapped__.value(),n=this.__dir__,d=Pt(e),k=n<0,O=d?e.length:0,$=Fd(0,O,this.__views__),oe=$.start,be=$.end,ke=be-oe,ze=k?be:oe-1,He=this.__iteratees__,We=He.length,nt=0,dt=Ur(ke,this.__takeCount__);if(!d||!k&&O==ke&&dt==ke)return yc(e,this.__actions__);var yt=[];e:for(;ke--&&nt<dt;){ze+=n;for(var Rt=-1,wt=e[ze];++Rt<We;){var Ht=He[Rt],Wt=Ht.iteratee,dn=Ht.type,Zr=Wt(wt);if(dn==Q)wt=Zr;else if(!Zr){if(dn==K)continue e;break e}}yt[nt++]=wt}return yt}$t.prototype=ds(ja.prototype),$t.prototype.constructor=$t;function Hi(e){var n=-1,d=e==null?0:e.length;for(this.clear();++n<d;){var k=e[n];this.set(k[0],k[1])}}function Ef(){this.__data__=Ys?Ys(null):{},this.size=0}function Af(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}function Tf(e){var n=this.__data__;if(Ys){var d=n[e];return d===y?a:d}return nr.call(n,e)?n[e]:a}function If(e){var n=this.__data__;return Ys?n[e]!==a:nr.call(n,e)}function Pf(e,n){var d=this.__data__;return this.size+=this.has(e)?0:1,d[e]=Ys&&n===a?y:n,this}Hi.prototype.clear=Ef,Hi.prototype.delete=Af,Hi.prototype.get=Tf,Hi.prototype.has=If,Hi.prototype.set=Pf;function ti(e){var n=-1,d=e==null?0:e.length;for(this.clear();++n<d;){var k=e[n];this.set(k[0],k[1])}}function Nf(){this.__data__=[],this.size=0}function Lf(e){var n=this.__data__,d=Ja(n,e);if(d<0)return!1;var k=n.length-1;return d==k?n.pop():Ga.call(n,d,1),--this.size,!0}function Of(e){var n=this.__data__,d=Ja(n,e);return d<0?a:n[d][1]}function Df(e){return Ja(this.__data__,e)>-1}function Rf(e,n){var d=this.__data__,k=Ja(d,e);return k<0?(++this.size,d.push([e,n])):d[k][1]=n,this}ti.prototype.clear=Nf,ti.prototype.delete=Lf,ti.prototype.get=Of,ti.prototype.has=Df,ti.prototype.set=Rf;function ri(e){var n=-1,d=e==null?0:e.length;for(this.clear();++n<d;){var k=e[n];this.set(k[0],k[1])}}function Bf(){this.size=0,this.__data__={hash:new Hi,map:new(Ws||ti),string:new Hi}}function Ff(e){var n=ho(this,e).delete(e);return this.size-=n?1:0,n}function qf(e){return ho(this,e).get(e)}function zf(e){return ho(this,e).has(e)}function Hf(e,n){var d=ho(this,e),k=d.size;return d.set(e,n),this.size+=d.size==k?0:1,this}ri.prototype.clear=Bf,ri.prototype.delete=Ff,ri.prototype.get=qf,ri.prototype.has=zf,ri.prototype.set=Hf;function Vi(e){var n=-1,d=e==null?0:e.length;for(this.__data__=new ri;++n<d;)this.add(e[n])}function Vf(e){return this.__data__.set(e,y),this}function Uf(e){return this.__data__.has(e)}Vi.prototype.add=Vi.prototype.push=Vf,Vi.prototype.has=Uf;function En(e){var n=this.__data__=new ti(e);this.size=n.size}function $f(){this.__data__=new ti,this.size=0}function Wf(e){var n=this.__data__,d=n.delete(e);return this.size=n.size,d}function Gf(e){return this.__data__.get(e)}function Yf(e){return this.__data__.has(e)}function Kf(e,n){var d=this.__data__;if(d instanceof ti){var k=d.__data__;if(!Ws||k.length<u-1)return k.push([e,n]),this.size=++d.size,this;d=this.__data__=new ri(k)}return d.set(e,n),this.size=d.size,this}En.prototype.clear=$f,En.prototype.delete=Wf,En.prototype.get=Gf,En.prototype.has=Yf,En.prototype.set=Kf;function Zu(e,n){var d=Pt(e),k=!d&&Yi(e),O=!d&&!k&&Ei(e),$=!d&&!k&&!O&&ms(e),oe=d||k||O||$,be=oe?wa(e.length,dr):[],ke=be.length;for(var ze in e)(n||nr.call(e,ze))&&!(oe&&(ze=="length"||O&&(ze=="offset"||ze=="parent")||$&&(ze=="buffer"||ze=="byteLength"||ze=="byteOffset")||ai(ze,ke)))&&be.push(ze);return be}function ju(e){var n=e.length;return n?e[yl(0,n-1)]:a}function Xf(e,n){return fo(en(e),Ui(n,0,e.length))}function Qf(e){return fo(en(e))}function cl(e,n,d){(d!==a&&!An(e[n],d)||d===a&&!(n in e))&&ni(e,n,d)}function Xs(e,n,d){var k=e[n];(!(nr.call(e,n)&&An(k,d))||d===a&&!(n in e))&&ni(e,n,d)}function Ja(e,n){for(var d=e.length;d--;)if(An(e[d][0],n))return d;return-1}function Zf(e,n,d,k){return Ci(e,function(O,$,oe){n(k,O,d(O),oe)}),k}function Ju(e,n){return e&&qn(n,Dr(n),e)}function jf(e,n){return e&&qn(n,rn(n),e)}function ni(e,n,d){n=="__proto__"&&Ya?Ya(e,n,{configurable:!0,enumerable:!0,value:d,writable:!0}):e[n]=d}function hl(e,n){for(var d=-1,k=n.length,O=Ne(k),$=e==null;++d<k;)O[d]=$?a:Wl(e,n[d]);return O}function Ui(e,n,d){return e===e&&(d!==a&&(e=e<=d?e:d),n!==a&&(e=e>=n?e:n)),e}function _n(e,n,d,k,O,$){var oe,be=n&M,ke=n&w,ze=n&_;if(d&&(oe=O?d(e,k,O,$):d(e)),oe!==a)return oe;if(!yr(e))return e;var He=Pt(e);if(He){if(oe=zd(e),!be)return en(e,oe)}else{var We=$r(e),nt=We==Gt||We==Dt;if(Ei(e))return Cc(e,be);if(We==er||We==Re||nt&&!O){if(oe=ke||nt?{}:Vc(e),!be)return ke?Td(e,jf(oe,e)):Ad(e,Ju(oe,e))}else{if(!jt[We])return O?e:{};oe=Hd(e,We,be)}}$||($=new En);var dt=$.get(e);if(dt)return dt;$.set(e,oe),m0(e)?e.forEach(function(wt){oe.add(_n(wt,n,d,wt,e,$))}):g0(e)&&e.forEach(function(wt,Ht){oe.set(Ht,_n(wt,n,d,Ht,e,$))});var yt=ze?ke?Pl:Il:ke?rn:Dr,Rt=He?a:yt(e);return Jr(Rt||e,function(wt,Ht){Rt&&(Ht=wt,wt=e[Ht]),Xs(oe,Ht,_n(wt,n,d,Ht,e,$))}),oe}function Jf(e){var n=Dr(e);return function(d){return ec(d,e,n)}}function ec(e,n,d){var k=d.length;if(e==null)return!k;for(e=mt(e);k--;){var O=d[k],$=n[O],oe=e[O];if(oe===a&&!(O in e)||!$(oe))return!1}return!0}function tc(e,n,d){if(typeof e!="function")throw new ar(f);return ra(function(){e.apply(a,d)},n)}function Qs(e,n,d,k){var O=-1,$=Bs,oe=!0,be=e.length,ke=[],ze=n.length;if(!be)return ke;d&&(n=hr(n,Kt(d))),k?($=Da,oe=!1):n.length>=u&&($=zr,oe=!1,n=new Vi(n));e:for(;++O<be;){var He=e[O],We=d==null?He:d(He);if(He=k||He!==0?He:0,oe&&We===We){for(var nt=ze;nt--;)if(n[nt]===We)continue e;ke.push(He)}else $(n,We,k)||ke.push(He)}return ke}var Ci=Ac(Fn),rc=Ac(dl,!0);function ed(e,n){var d=!0;return Ci(e,function(k,O,$){return d=!!n(k,O,$),d}),d}function eo(e,n,d){for(var k=-1,O=e.length;++k<O;){var $=e[k],oe=n($);if(oe!=null&&(be===a?oe===oe&&!fn(oe):d(oe,be)))var be=oe,ke=$}return ke}function td(e,n,d,k){var O=e.length;for(d=Ot(d),d<0&&(d=-d>O?0:O+d),k=k===a||k>O?O:Ot(k),k<0&&(k+=O),k=d>k?0:b0(k);d<k;)e[d++]=n;return e}function nc(e,n){var d=[];return Ci(e,function(k,O,$){n(k,O,$)&&d.push(k)}),d}function Hr(e,n,d,k,O){var $=-1,oe=e.length;for(d||(d=Ud),O||(O=[]);++$<oe;){var be=e[$];n>0&&d(be)?n>1?Hr(be,n-1,d,k,O):ei(O,be):k||(O[O.length]=be)}return O}var fl=Tc(),ic=Tc(!0);function Fn(e,n){return e&&fl(e,n,Dr)}function dl(e,n){return e&&ic(e,n,Dr)}function to(e,n){return Jn(n,function(d){return oi(e[d])})}function $i(e,n){n=ki(n,e);for(var d=0,k=n.length;e!=null&&d<k;)e=e[zn(n[d++])];return d&&d==k?e:a}function sc(e,n,d){var k=n(e);return Pt(e)?k:ei(k,d(e))}function Xr(e){return e==null?e===a?Qe:vr:zi&&zi in mt(e)?Bd(e):Qd(e)}function pl(e,n){return e>n}function rd(e,n){return e!=null&&nr.call(e,n)}function nd(e,n){return e!=null&&n in mt(e)}function id(e,n,d){return e>=Ur(n,d)&&e<Pr(n,d)}function gl(e,n,d){for(var k=d?Da:Bs,O=e[0].length,$=e.length,oe=$,be=Ne($),ke=1/0,ze=[];oe--;){var He=e[oe];oe&&n&&(He=hr(He,Kt(n))),ke=Ur(He.length,ke),be[oe]=!d&&(n||O>=120&&He.length>=120)?new Vi(oe&&He):a}He=e[0];var We=-1,nt=be[0];e:for(;++We<O&&ze.length<ke;){var dt=He[We],yt=n?n(dt):dt;if(dt=d||dt!==0?dt:0,!(nt?zr(nt,yt):k(ze,yt,d))){for(oe=$;--oe;){var Rt=be[oe];if(!(Rt?zr(Rt,yt):k(e[oe],yt,d)))continue e}nt&&nt.push(yt),ze.push(dt)}}return ze}function sd(e,n,d,k){return Fn(e,function(O,$,oe){n(k,d(O),$,oe)}),k}function Zs(e,n,d){n=ki(n,e),e=Gc(e,n);var k=e==null?e:e[zn(yn(n))];return k==null?a:wr(k,e,d)}function ac(e){return Sr(e)&&Xr(e)==Re}function ad(e){return Sr(e)&&Xr(e)==h}function od(e){return Sr(e)&&Xr(e)==Ct}function js(e,n,d,k,O){return e===n?!0:e==null||n==null||!Sr(e)&&!Sr(n)?e!==e&&n!==n:ld(e,n,d,k,js,O)}function ld(e,n,d,k,O,$){var oe=Pt(e),be=Pt(n),ke=oe?ut:$r(e),ze=be?ut:$r(n);ke=ke==Re?er:ke,ze=ze==Re?er:ze;var He=ke==er,We=ze==er,nt=ke==ze;if(nt&&Ei(e)){if(!Ei(n))return!1;oe=!0,He=!1}if(nt&&!He)return $||($=new En),oe||ms(e)?qc(e,n,d,k,O,$):Dd(e,n,ke,d,k,O,$);if(!(d&C)){var dt=He&&nr.call(e,"__wrapped__"),yt=We&&nr.call(n,"__wrapped__");if(dt||yt){var Rt=dt?e.value():e,wt=yt?n.value():n;return $||($=new En),O(Rt,wt,d,k,$)}}return nt?($||($=new En),Rd(e,n,d,k,O,$)):!1}function ud(e){return Sr(e)&&$r(e)==ct}function vl(e,n,d,k){var O=d.length,$=O,oe=!k;if(e==null)return!$;for(e=mt(e);O--;){var be=d[O];if(oe&&be[2]?be[1]!==e[be[0]]:!(be[0]in e))return!1}for(;++O<$;){be=d[O];var ke=be[0],ze=e[ke],He=be[1];if(oe&&be[2]){if(ze===a&&!(ke in e))return!1}else{var We=new En;if(k)var nt=k(ze,He,ke,e,n,We);if(!(nt===a?js(He,ze,C|m,k,We):nt))return!1}}return!0}function oc(e){if(!yr(e)||Wd(e))return!1;var n=oi(e)?uf:ht;return n.test(Gi(e))}function cd(e){return Sr(e)&&Xr(e)==kr}function hd(e){return Sr(e)&&$r(e)==Ue}function fd(e){return Sr(e)&&bo(e.length)&&!!Ut[Xr(e)]}function lc(e){return typeof e=="function"?e:e==null?nn:typeof e=="object"?Pt(e)?hc(e[0],e[1]):cc(e):I0(e)}function ml(e){if(!ta(e))return gf(e);var n=[];for(var d in mt(e))nr.call(e,d)&&d!="constructor"&&n.push(d);return n}function dd(e){if(!yr(e))return Xd(e);var n=ta(e),d=[];for(var k in e)k=="constructor"&&(n||!nr.call(e,k))||d.push(k);return d}function _l(e,n){return e<n}function uc(e,n){var d=-1,k=tn(e)?Ne(e.length):[];return Ci(e,function(O,$,oe){k[++d]=n(O,$,oe)}),k}function cc(e){var n=Ll(e);return n.length==1&&n[0][2]?$c(n[0][0],n[0][1]):function(d){return d===e||vl(d,e,n)}}function hc(e,n){return Dl(e)&&Uc(n)?$c(zn(e),n):function(d){var k=Wl(d,e);return k===a&&k===n?Gl(d,e):js(n,k,C|m)}}function ro(e,n,d,k,O){e!==n&&fl(n,function($,oe){if(O||(O=new En),yr($))pd(e,n,oe,d,ro,k,O);else{var be=k?k(Bl(e,oe),$,oe+"",e,n,O):a;be===a&&(be=$),cl(e,oe,be)}},rn)}function pd(e,n,d,k,O,$,oe){var be=Bl(e,d),ke=Bl(n,d),ze=oe.get(ke);if(ze){cl(e,d,ze);return}var He=$?$(be,ke,d+"",e,n,oe):a,We=He===a;if(We){var nt=Pt(ke),dt=!nt&&Ei(ke),yt=!nt&&!dt&&ms(ke);He=ke,nt||dt||yt?Pt(be)?He=be:Mr(be)?He=en(be):dt?(We=!1,He=Cc(ke,!0)):yt?(We=!1,He=xc(ke,!0)):He=[]:na(ke)||Yi(ke)?(He=be,Yi(be)?He=y0(be):(!yr(be)||oi(be))&&(He=Vc(ke))):We=!1}We&&(oe.set(ke,He),O(He,ke,k,$,oe),oe.delete(ke)),cl(e,d,He)}function fc(e,n){var d=e.length;if(d)return n+=n<0?d:0,ai(n,d)?e[n]:a}function dc(e,n,d){n.length?n=hr(n,function($){return Pt($)?function(oe){return $i(oe,$.length===1?$[0]:$)}:$}):n=[nn];var k=-1;n=hr(n,Kt(bt()));var O=uc(e,function($,oe,be){var ke=hr(n,function(ze){return ze($)});return{criteria:ke,index:++k,value:$}});return nl(O,function($,oe){return Ed($,oe,d)})}function gd(e,n){return pc(e,n,function(d,k){return Gl(e,k)})}function pc(e,n,d){for(var k=-1,O=n.length,$={};++k<O;){var oe=n[k],be=$i(e,oe);d(be,oe)&&Js($,ki(oe,e),be)}return $}function vd(e){return function(n){return $i(n,e)}}function bl(e,n,d,k){var O=k?Bu:Pi,$=-1,oe=n.length,be=e;for(e===n&&(n=en(n)),d&&(be=hr(e,Kt(d)));++$<oe;)for(var ke=0,ze=n[$],He=d?d(ze):ze;(ke=O(be,He,ke,k))>-1;)be!==e&&Ga.call(be,ke,1),Ga.call(e,ke,1);return e}function gc(e,n){for(var d=e?n.length:0,k=d-1;d--;){var O=n[d];if(d==k||O!==$){var $=O;ai(O)?Ga.call(e,O,1):Cl(e,O)}}return e}function yl(e,n){return e+Xa(Xu()*(n-e+1))}function md(e,n,d,k){for(var O=-1,$=Pr(Ka((n-e)/(d||1)),0),oe=Ne($);$--;)oe[k?$:++O]=e,e+=d;return oe}function wl(e,n){var d="";if(!e||n<1||n>Me)return d;do n%2&&(d+=e),n=Xa(n/2),n&&(e+=e);while(n);return d}function qt(e,n){return Fl(Wc(e,n,nn),e+"")}function _d(e){return ju(_s(e))}function bd(e,n){var d=_s(e);return fo(d,Ui(n,0,d.length))}function Js(e,n,d,k){if(!yr(e))return e;n=ki(n,e);for(var O=-1,$=n.length,oe=$-1,be=e;be!=null&&++O<$;){var ke=zn(n[O]),ze=d;if(ke==="__proto__"||ke==="constructor"||ke==="prototype")return e;if(O!=oe){var He=be[ke];ze=k?k(He,ke,be):a,ze===a&&(ze=yr(He)?He:ai(n[O+1])?[]:{})}Xs(be,ke,ze),be=be[ke]}return e}var vc=Qa?function(e,n){return Qa.set(e,n),e}:nn,yd=Ya?function(e,n){return Ya(e,"toString",{configurable:!0,enumerable:!1,value:Kl(n),writable:!0})}:nn;function wd(e){return fo(_s(e))}function bn(e,n,d){var k=-1,O=e.length;n<0&&(n=-n>O?0:O+n),d=d>O?O:d,d<0&&(d+=O),O=n>d?0:d-n>>>0,n>>>=0;for(var $=Ne(O);++k<O;)$[k]=e[k+n];return $}function Sd(e,n){var d;return Ci(e,function(k,O,$){return d=n(k,O,$),!d}),!!d}function no(e,n,d){var k=0,O=e==null?k:e.length;if(typeof n=="number"&&n===n&&O<=De){for(;k<O;){var $=k+O>>>1,oe=e[$];oe!==null&&!fn(oe)&&(d?oe<=n:oe<n)?k=$+1:O=$}return O}return Sl(e,n,nn,d)}function Sl(e,n,d,k){var O=0,$=e==null?0:e.length;if($===0)return 0;n=d(n);for(var oe=n!==n,be=n===null,ke=fn(n),ze=n===a;O<$;){var He=Xa((O+$)/2),We=d(e[He]),nt=We!==a,dt=We===null,yt=We===We,Rt=fn(We);if(oe)var wt=k||yt;else ze?wt=yt&&(k||nt):be?wt=yt&&nt&&(k||!dt):ke?wt=yt&&nt&&!dt&&(k||!Rt):dt||Rt?wt=!1:wt=k?We<=n:We<n;wt?O=He+1:$=He}return Ur($,xe)}function mc(e,n){for(var d=-1,k=e.length,O=0,$=[];++d<k;){var oe=e[d],be=n?n(oe):oe;if(!d||!An(be,ke)){var ke=be;$[O++]=oe===0?0:oe}}return $}function _c(e){return typeof e=="number"?e:fn(e)?Y:+e}function hn(e){if(typeof e=="string")return e;if(Pt(e))return hr(e,hn)+"";if(fn(e))return Qu?Qu.call(e):"";var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function xi(e,n,d){var k=-1,O=Bs,$=e.length,oe=!0,be=[],ke=be;if(d)oe=!1,O=Da;else if($>=u){var ze=n?null:Ld(e);if(ze)return Es(ze);oe=!1,O=zr,ke=new Vi}else ke=n?[]:be;e:for(;++k<$;){var He=e[k],We=n?n(He):He;if(He=d||He!==0?He:0,oe&&We===We){for(var nt=ke.length;nt--;)if(ke[nt]===We)continue e;n&&ke.push(We),be.push(He)}else O(ke,We,d)||(ke!==be&&ke.push(We),be.push(He))}return be}function Cl(e,n){return n=ki(n,e),e=Gc(e,n),e==null||delete e[zn(yn(n))]}function bc(e,n,d,k){return Js(e,n,d($i(e,n)),k)}function io(e,n,d,k){for(var O=e.length,$=k?O:-1;(k?$--:++$<O)&&n(e[$],$,e););return d?bn(e,k?0:$,k?$+1:O):bn(e,k?$+1:0,k?O:$)}function yc(e,n){var d=e;return d instanceof $t&&(d=d.value()),Ra(n,function(k,O){return O.func.apply(O.thisArg,ei([k],O.args))},d)}function xl(e,n,d){var k=e.length;if(k<2)return k?xi(e[0]):[];for(var O=-1,$=Ne(k);++O<k;)for(var oe=e[O],be=-1;++be<k;)be!=O&&($[O]=Qs($[O]||oe,e[be],n,d));return xi(Hr($,1),n,d)}function wc(e,n,d){for(var k=-1,O=e.length,$=n.length,oe={};++k<O;){var be=k<$?n[k]:a;d(oe,e[k],be)}return oe}function kl(e){return Mr(e)?e:[]}function Ml(e){return typeof e=="function"?e:nn}function ki(e,n){return Pt(e)?e:Dl(e,n)?[e]:Qc(tr(e))}var Cd=qt;function Mi(e,n,d){var k=e.length;return d=d===a?k:d,!n&&d>=k?e:bn(e,n,d)}var Sc=cf||function(e){return Or.clearTimeout(e)};function Cc(e,n){if(n)return e.slice();var d=e.length,k=$u?$u(d):new e.constructor(d);return e.copy(k),k}function El(e){var n=new e.constructor(e.byteLength);return new $a(n).set(new $a(e)),n}function xd(e,n){var d=n?El(e.buffer):e.buffer;return new e.constructor(d,e.byteOffset,e.byteLength)}function kd(e){var n=new e.constructor(e.source,Mt.exec(e));return n.lastIndex=e.lastIndex,n}function Md(e){return Ks?mt(Ks.call(e)):{}}function xc(e,n){var d=n?El(e.buffer):e.buffer;return new e.constructor(d,e.byteOffset,e.length)}function kc(e,n){if(e!==n){var d=e!==a,k=e===null,O=e===e,$=fn(e),oe=n!==a,be=n===null,ke=n===n,ze=fn(n);if(!be&&!ze&&!$&&e>n||$&&oe&&ke&&!be&&!ze||k&&oe&&ke||!d&&ke||!O)return 1;if(!k&&!$&&!ze&&e<n||ze&&d&&O&&!k&&!$||be&&d&&O||!oe&&O||!ke)return-1}return 0}function Ed(e,n,d){for(var k=-1,O=e.criteria,$=n.criteria,oe=O.length,be=d.length;++k<oe;){var ke=kc(O[k],$[k]);if(ke){if(k>=be)return ke;var ze=d[k];return ke*(ze=="desc"?-1:1)}}return e.index-n.index}function Mc(e,n,d,k){for(var O=-1,$=e.length,oe=d.length,be=-1,ke=n.length,ze=Pr($-oe,0),He=Ne(ke+ze),We=!k;++be<ke;)He[be]=n[be];for(;++O<oe;)(We||O<$)&&(He[d[O]]=e[O]);for(;ze--;)He[be++]=e[O++];return He}function Ec(e,n,d,k){for(var O=-1,$=e.length,oe=-1,be=d.length,ke=-1,ze=n.length,He=Pr($-be,0),We=Ne(He+ze),nt=!k;++O<He;)We[O]=e[O];for(var dt=O;++ke<ze;)We[dt+ke]=n[ke];for(;++oe<be;)(nt||O<$)&&(We[dt+d[oe]]=e[O++]);return We}function en(e,n){var d=-1,k=e.length;for(n||(n=Ne(k));++d<k;)n[d]=e[d];return n}function qn(e,n,d,k){var O=!d;d||(d={});for(var $=-1,oe=n.length;++$<oe;){var be=n[$],ke=k?k(d[be],e[be],be,d,e):a;ke===a&&(ke=e[be]),O?ni(d,be,ke):Xs(d,be,ke)}return d}function Ad(e,n){return qn(e,Ol(e),n)}function Td(e,n){return qn(e,zc(e),n)}function so(e,n){return function(d,k){var O=Pt(d)?Du:Zf,$=n?n():{};return O(d,e,bt(k,2),$)}}function ps(e){return qt(function(n,d){var k=-1,O=d.length,$=O>1?d[O-1]:a,oe=O>2?d[2]:a;for($=e.length>3&&typeof $=="function"?(O--,$):a,oe&&Qr(d[0],d[1],oe)&&($=O<3?a:$,O=1),n=mt(n);++k<O;){var be=d[k];be&&e(n,be,k,$)}return n})}function Ac(e,n){return function(d,k){if(d==null)return d;if(!tn(d))return e(d,k);for(var O=d.length,$=n?O:-1,oe=mt(d);(n?$--:++$<O)&&k(oe[$],$,oe)!==!1;);return d}}function Tc(e){return function(n,d,k){for(var O=-1,$=mt(n),oe=k(n),be=oe.length;be--;){var ke=oe[e?be:++O];if(d($[ke],ke,$)===!1)break}return n}}function Id(e,n,d){var k=n&T,O=ea(e);function $(){var oe=this&&this!==Or&&this instanceof $?O:e;return oe.apply(k?d:this,arguments)}return $}function Ic(e){return function(n){n=tr(n);var d=Bi(n)?cn(n):a,k=d?d[0]:n.charAt(0),O=d?Mi(d,1).join(""):n.slice(1);return k[e]()+O}}function gs(e){return function(n){return Ra(A0(E0(n).replace(_e,"")),e,"")}}function ea(e){return function(){var n=arguments;switch(n.length){case 0:return new e;case 1:return new e(n[0]);case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[1],n[2]);case 4:return new e(n[0],n[1],n[2],n[3]);case 5:return new e(n[0],n[1],n[2],n[3],n[4]);case 6:return new e(n[0],n[1],n[2],n[3],n[4],n[5]);case 7:return new e(n[0],n[1],n[2],n[3],n[4],n[5],n[6])}var d=ds(e.prototype),k=e.apply(d,n);return yr(k)?k:d}}function Pd(e,n,d){var k=ea(e);function O(){for(var $=arguments.length,oe=Ne($),be=$,ke=vs(O);be--;)oe[be]=arguments[be];var ze=$<3&&oe[0]!==ke&&oe[$-1]!==ke?[]:Xn(oe,ke);if($-=ze.length,$<d)return Dc(e,n,ao,O.placeholder,a,oe,ze,a,a,d-$);var He=this&&this!==Or&&this instanceof O?k:e;return wr(He,this,oe)}return O}function Pc(e){return function(n,d,k){var O=mt(n);if(!tn(n)){var $=bt(d,3);n=Dr(n),d=function(be){return $(O[be],be,O)}}var oe=e(n,d,k);return oe>-1?O[$?n[oe]:oe]:a}}function Nc(e){return si(function(n){var d=n.length,k=d,O=mn.prototype.thru;for(e&&n.reverse();k--;){var $=n[k];if(typeof $!="function")throw new ar(f);if(O&&!oe&&co($)=="wrapper")var oe=new mn([],!0)}for(k=oe?k:d;++k<d;){$=n[k];var be=co($),ke=be=="wrapper"?Nl($):a;ke&&Rl(ke[0])&&ke[1]==(ye|B|G|q)&&!ke[4].length&&ke[9]==1?oe=oe[co(ke[0])].apply(oe,ke[3]):oe=$.length==1&&Rl($)?oe[be]():oe.thru($)}return function(){var ze=arguments,He=ze[0];if(oe&&ze.length==1&&Pt(He))return oe.plant(He).value();for(var We=0,nt=d?n[We].apply(this,ze):He;++We<d;)nt=n[We].call(this,nt);return nt}})}function ao(e,n,d,k,O,$,oe,be,ke,ze){var He=n&ye,We=n&T,nt=n&L,dt=n&(B|W),yt=n&se,Rt=nt?a:ea(e);function wt(){for(var Ht=arguments.length,Wt=Ne(Ht),dn=Ht;dn--;)Wt[dn]=arguments[dn];if(dt)var Zr=vs(wt),pn=xn(Wt,Zr);if(k&&(Wt=Mc(Wt,k,O,dt)),$&&(Wt=Ec(Wt,$,oe,dt)),Ht-=pn,dt&&Ht<ze){var Er=Xn(Wt,Zr);return Dc(e,n,ao,wt.placeholder,d,Wt,Er,be,ke,ze-Ht)}var Tn=We?d:this,ui=nt?Tn[e]:e;return Ht=Wt.length,be?Wt=Zd(Wt,be):yt&&Ht>1&&Wt.reverse(),He&&ke<Ht&&(Wt.length=ke),this&&this!==Or&&this instanceof wt&&(ui=Rt||ea(ui)),ui.apply(Tn,Wt)}return wt}function Lc(e,n){return function(d,k){return sd(d,e,n(k),{})}}function oo(e,n){return function(d,k){var O;if(d===a&&k===a)return n;if(d!==a&&(O=d),k!==a){if(O===a)return k;typeof d=="string"||typeof k=="string"?(d=hn(d),k=hn(k)):(d=_c(d),k=_c(k)),O=e(d,k)}return O}}function Al(e){return si(function(n){return n=hr(n,Kt(bt())),qt(function(d){var k=this;return e(n,function(O){return wr(O,k,d)})})})}function lo(e,n){n=n===a?" ":hn(n);var d=n.length;if(d<2)return d?wl(n,e):n;var k=wl(n,Ka(e/qi(n)));return Bi(n)?Mi(cn(k),0,e).join(""):k.slice(0,e)}function Nd(e,n,d,k){var O=n&T,$=ea(e);function oe(){for(var be=-1,ke=arguments.length,ze=-1,He=k.length,We=Ne(He+ke),nt=this&&this!==Or&&this instanceof oe?$:e;++ze<He;)We[ze]=k[ze];for(;ke--;)We[ze++]=arguments[++be];return wr(nt,O?d:this,We)}return oe}function Oc(e){return function(n,d,k){return k&&typeof k!="number"&&Qr(n,d,k)&&(d=k=a),n=li(n),d===a?(d=n,n=0):d=li(d),k=k===a?n<d?1:-1:li(k),md(n,d,k,e)}}function uo(e){return function(n,d){return typeof n=="string"&&typeof d=="string"||(n=wn(n),d=wn(d)),e(n,d)}}function Dc(e,n,d,k,O,$,oe,be,ke,ze){var He=n&B,We=He?oe:a,nt=He?a:oe,dt=He?$:a,yt=He?a:$;n|=He?G:R,n&=~(He?R:G),n&N||(n&=-4);var Rt=[e,n,O,dt,We,yt,nt,be,ke,ze],wt=d.apply(a,Rt);return Rl(e)&&Yc(wt,Rt),wt.placeholder=k,Kc(wt,e,n)}function Tl(e){var n=et[e];return function(d,k){if(d=wn(d),k=k==null?0:Ur(Ot(k),292),k&&Ku(d)){var O=(tr(d)+"e").split("e"),$=n(O[0]+"e"+(+O[1]+k));return O=(tr($)+"e").split("e"),+(O[0]+"e"+(+O[1]-k))}return n(d)}}var Ld=hs&&1/Es(new hs([,-0]))[1]==Ee?function(e){return new hs(e)}:Zl;function Rc(e){return function(n){var d=$r(n);return d==ct?cs(n):d==Ue?Qn(n):Rn(n,e(n))}}function ii(e,n,d,k,O,$,oe,be){var ke=n&L;if(!ke&&typeof e!="function")throw new ar(f);var ze=k?k.length:0;if(ze||(n&=-97,k=O=a),oe=oe===a?oe:Pr(Ot(oe),0),be=be===a?be:Ot(be),ze-=O?O.length:0,n&R){var He=k,We=O;k=O=a}var nt=ke?a:Nl(e),dt=[e,n,d,k,O,He,We,$,oe,be];if(nt&&Kd(dt,nt),e=dt[0],n=dt[1],d=dt[2],k=dt[3],O=dt[4],be=dt[9]=dt[9]===a?ke?0:e.length:Pr(dt[9]-ze,0),!be&&n&(B|W)&&(n&=-25),!n||n==T)var yt=Id(e,n,d);else n==B||n==W?yt=Pd(e,n,be):(n==G||n==(T|G))&&!O.length?yt=Nd(e,n,d,k):yt=ao.apply(a,dt);var Rt=nt?vc:Yc;return Kc(Rt(yt,dt),e,n)}function Bc(e,n,d,k){return e===a||An(e,wi[d])&&!nr.call(k,d)?n:e}function Fc(e,n,d,k,O,$){return yr(e)&&yr(n)&&($.set(n,e),ro(e,n,a,Fc,$),$.delete(n)),e}function Od(e){return na(e)?a:e}function qc(e,n,d,k,O,$){var oe=d&C,be=e.length,ke=n.length;if(be!=ke&&!(oe&&ke>be))return!1;var ze=$.get(e),He=$.get(n);if(ze&&He)return ze==n&&He==e;var We=-1,nt=!0,dt=d&m?new Vi:a;for($.set(e,n),$.set(n,e);++We<be;){var yt=e[We],Rt=n[We];if(k)var wt=oe?k(Rt,yt,We,n,e,$):k(yt,Rt,We,e,n,$);if(wt!==a){if(wt)continue;nt=!1;break}if(dt){if(!Ba(n,function(Ht,Wt){if(!zr(dt,Wt)&&(yt===Ht||O(yt,Ht,d,k,$)))return dt.push(Wt)})){nt=!1;break}}else if(!(yt===Rt||O(yt,Rt,d,k,$))){nt=!1;break}}return $.delete(e),$.delete(n),nt}function Dd(e,n,d,k,O,$,oe){switch(d){case b:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case h:return!(e.byteLength!=n.byteLength||!$(new $a(e),new $a(n)));case it:case Ct:case gr:return An(+e,+n);case at:return e.name==n.name&&e.message==n.message;case kr:case Je:return e==n+"";case ct:var be=cs;case Ue:var ke=k&C;if(be||(be=Es),e.size!=n.size&&!ke)return!1;var ze=oe.get(e);if(ze)return ze==n;k|=m,oe.set(e,n);var He=qc(be(e),be(n),k,O,$,oe);return oe.delete(e),He;case Ye:if(Ks)return Ks.call(e)==Ks.call(n)}return!1}function Rd(e,n,d,k,O,$){var oe=d&C,be=Il(e),ke=be.length,ze=Il(n),He=ze.length;if(ke!=He&&!oe)return!1;for(var We=ke;We--;){var nt=be[We];if(!(oe?nt in n:nr.call(n,nt)))return!1}var dt=$.get(e),yt=$.get(n);if(dt&&yt)return dt==n&&yt==e;var Rt=!0;$.set(e,n),$.set(n,e);for(var wt=oe;++We<ke;){nt=be[We];var Ht=e[nt],Wt=n[nt];if(k)var dn=oe?k(Wt,Ht,nt,n,e,$):k(Ht,Wt,nt,e,n,$);if(!(dn===a?Ht===Wt||O(Ht,Wt,d,k,$):dn)){Rt=!1;break}wt||(wt=nt=="constructor")}if(Rt&&!wt){var Zr=e.constructor,pn=n.constructor;Zr!=pn&&"constructor"in e&&"constructor"in n&&!(typeof Zr=="function"&&Zr instanceof Zr&&typeof pn=="function"&&pn instanceof pn)&&(Rt=!1)}return $.delete(e),$.delete(n),Rt}function si(e){return Fl(Wc(e,a,e0),e+"")}function Il(e){return sc(e,Dr,Ol)}function Pl(e){return sc(e,rn,zc)}var Nl=Qa?function(e){return Qa.get(e)}:Zl;function co(e){for(var n=e.name+"",d=fs[n],k=nr.call(fs,n)?d.length:0;k--;){var O=d[k],$=O.func;if($==null||$==e)return O.name}return n}function vs(e){var n=nr.call(V,"placeholder")?V:e;return n.placeholder}function bt(){var e=V.iteratee||Xl;return e=e===Xl?lc:e,arguments.length?e(arguments[0],arguments[1]):e}function ho(e,n){var d=e.__data__;return $d(n)?d[typeof n=="string"?"string":"hash"]:d.map}function Ll(e){for(var n=Dr(e),d=n.length;d--;){var k=n[d],O=e[k];n[d]=[k,O,Uc(O)]}return n}function Wi(e,n){var d=il(e,n);return oc(d)?d:a}function Bd(e){var n=nr.call(e,zi),d=e[zi];try{e[zi]=a;var k=!0}catch{}var O=Va.call(e);return k&&(n?e[zi]=d:delete e[zi]),O}var Ol=ol?function(e){return e==null?[]:(e=mt(e),Jn(ol(e),function(n){return Gu.call(e,n)}))}:jl,zc=ol?function(e){for(var n=[];e;)ei(n,Ol(e)),e=Wa(e);return n}:jl,$r=Xr;(ll&&$r(new ll(new ArrayBuffer(1)))!=b||Ws&&$r(new Ws)!=ct||ul&&$r(ul.resolve())!=Cr||hs&&$r(new hs)!=Ue||Gs&&$r(new Gs)!=rt)&&($r=function(e){var n=Xr(e),d=n==er?e.constructor:a,k=d?Gi(d):"";if(k)switch(k){case bf:return b;case yf:return ct;case wf:return Cr;case Sf:return Ue;case Cf:return rt}return n});function Fd(e,n,d){for(var k=-1,O=d.length;++k<O;){var $=d[k],oe=$.size;switch($.type){case"drop":e+=oe;break;case"dropRight":n-=oe;break;case"take":n=Ur(n,e+oe);break;case"takeRight":e=Pr(e,n-oe);break}}return{start:e,end:n}}function qd(e){var n=e.match(Ve);return n?n[1].split(Ke):[]}function Hc(e,n,d){n=ki(n,e);for(var k=-1,O=n.length,$=!1;++k<O;){var oe=zn(n[k]);if(!($=e!=null&&d(e,oe)))break;e=e[oe]}return $||++k!=O?$:(O=e==null?0:e.length,!!O&&bo(O)&&ai(oe,O)&&(Pt(e)||Yi(e)))}function zd(e){var n=e.length,d=new e.constructor(n);return n&&typeof e[0]=="string"&&nr.call(e,"index")&&(d.index=e.index,d.input=e.input),d}function Vc(e){return typeof e.constructor=="function"&&!ta(e)?ds(Wa(e)):{}}function Hd(e,n,d){var k=e.constructor;switch(n){case h:return El(e);case it:case Ct:return new k(+e);case b:return xd(e,d);case x:case E:case I:case F:case D:case z:case U:case J:case te:return xc(e,d);case ct:return new k;case gr:case Je:return new k(e);case kr:return kd(e);case Ue:return new k;case Ye:return Md(e)}}function Vd(e,n){var d=n.length;if(!d)return e;var k=d-1;return n[k]=(d>1?"& ":"")+n[k],n=n.join(d>2?", ":" "),e.replace(Fe,`{
|
|
299
|
+
/* [wrapped with `+n+`] */
|
|
300
|
+
`)}function Ud(e){return Pt(e)||Yi(e)||!!(Yu&&e&&e[Yu])}function ai(e,n){var d=typeof e;return n=n??Me,!!n&&(d=="number"||d!="symbol"&&zt.test(e))&&e>-1&&e%1==0&&e<n}function Qr(e,n,d){if(!yr(d))return!1;var k=typeof n;return(k=="number"?tn(d)&&ai(n,d.length):k=="string"&&n in d)?An(d[n],e):!1}function Dl(e,n){if(Pt(e))return!1;var d=typeof e;return d=="number"||d=="symbol"||d=="boolean"||e==null||fn(e)?!0:ge.test(e)||!we.test(e)||n!=null&&e in mt(n)}function $d(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function Rl(e){var n=co(e),d=V[n];if(typeof d!="function"||!(n in $t.prototype))return!1;if(e===d)return!0;var k=Nl(d);return!!k&&e===k[0]}function Wd(e){return!!Uu&&Uu in e}var Gd=Ji?oi:Jl;function ta(e){var n=e&&e.constructor,d=typeof n=="function"&&n.prototype||wi;return e===d}function Uc(e){return e===e&&!yr(e)}function $c(e,n){return function(d){return d==null?!1:d[e]===n&&(n!==a||e in mt(d))}}function Yd(e){var n=mo(e,function(k){return d.size===S&&d.clear(),k}),d=n.cache;return n}function Kd(e,n){var d=e[1],k=n[1],O=d|k,$=O<(T|L|ye),oe=k==ye&&d==B||k==ye&&d==q&&e[7].length<=n[8]||k==(ye|q)&&n[7].length<=n[8]&&d==B;if(!($||oe))return e;k&T&&(e[2]=n[2],O|=d&T?0:N);var be=n[3];if(be){var ke=e[3];e[3]=ke?Mc(ke,be,n[4]):be,e[4]=ke?Xn(e[3],A):n[4]}return be=n[5],be&&(ke=e[5],e[5]=ke?Ec(ke,be,n[6]):be,e[6]=ke?Xn(e[5],A):n[6]),be=n[7],be&&(e[7]=be),k&ye&&(e[8]=e[8]==null?n[8]:Ur(e[8],n[8])),e[9]==null&&(e[9]=n[9]),e[0]=n[0],e[1]=O,e}function Xd(e){var n=[];if(e!=null)for(var d in mt(e))n.push(d);return n}function Qd(e){return Va.call(e)}function Wc(e,n,d){return n=Pr(n===a?e.length-1:n,0),function(){for(var k=arguments,O=-1,$=Pr(k.length-n,0),oe=Ne($);++O<$;)oe[O]=k[n+O];O=-1;for(var be=Ne(n+1);++O<n;)be[O]=k[O];return be[n]=d(oe),wr(e,this,be)}}function Gc(e,n){return n.length<2?e:$i(e,bn(n,0,-1))}function Zd(e,n){for(var d=e.length,k=Ur(n.length,d),O=en(e);k--;){var $=n[k];e[k]=ai($,d)?O[$]:a}return e}function Bl(e,n){if(!(n==="constructor"&&typeof e[n]=="function")&&n!="__proto__")return e[n]}var Yc=Xc(vc),ra=ff||function(e,n){return Or.setTimeout(e,n)},Fl=Xc(yd);function Kc(e,n,d){var k=n+"";return Fl(e,Vd(k,jd(qd(k),d)))}function Xc(e){var n=0,d=0;return function(){var k=vf(),O=de-(k-d);if(d=k,O>0){if(++n>=ce)return arguments[0]}else n=0;return e.apply(a,arguments)}}function fo(e,n){var d=-1,k=e.length,O=k-1;for(n=n===a?k:n;++d<n;){var $=yl(d,O),oe=e[$];e[$]=e[d],e[d]=oe}return e.length=n,e}var Qc=Yd(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(Ae,function(d,k,O,$){n.push(O?$.replace(gt,"$1"):k||d)}),n});function zn(e){if(typeof e=="string"||fn(e))return e;var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function Gi(e){if(e!=null){try{return Us.call(e)}catch{}try{return e+""}catch{}}return""}function jd(e,n){return Jr($e,function(d){var k="_."+d[0];n&d[1]&&!Bs(e,k)&&e.push(k)}),e.sort()}function Zc(e){if(e instanceof $t)return e.clone();var n=new mn(e.__wrapped__,e.__chain__);return n.__actions__=en(e.__actions__),n.__index__=e.__index__,n.__values__=e.__values__,n}function Jd(e,n,d){(d?Qr(e,n,d):n===a)?n=1:n=Pr(Ot(n),0);var k=e==null?0:e.length;if(!k||n<1)return[];for(var O=0,$=0,oe=Ne(Ka(k/n));O<k;)oe[$++]=bn(e,O,O+=n);return oe}function e1(e){for(var n=-1,d=e==null?0:e.length,k=0,O=[];++n<d;){var $=e[n];$&&(O[k++]=$)}return O}function t1(){var e=arguments.length;if(!e)return[];for(var n=Ne(e-1),d=arguments[0],k=e;k--;)n[k-1]=arguments[k];return ei(Pt(d)?en(d):[d],Hr(n,1))}var r1=qt(function(e,n){return Mr(e)?Qs(e,Hr(n,1,Mr,!0)):[]}),n1=qt(function(e,n){var d=yn(n);return Mr(d)&&(d=a),Mr(e)?Qs(e,Hr(n,1,Mr,!0),bt(d,2)):[]}),i1=qt(function(e,n){var d=yn(n);return Mr(d)&&(d=a),Mr(e)?Qs(e,Hr(n,1,Mr,!0),a,d):[]});function s1(e,n,d){var k=e==null?0:e.length;return k?(n=d||n===a?1:Ot(n),bn(e,n<0?0:n,k)):[]}function a1(e,n,d){var k=e==null?0:e.length;return k?(n=d||n===a?1:Ot(n),n=k-n,bn(e,0,n<0?0:n)):[]}function o1(e,n){return e&&e.length?io(e,bt(n,3),!0,!0):[]}function l1(e,n){return e&&e.length?io(e,bt(n,3),!0):[]}function u1(e,n,d,k){var O=e==null?0:e.length;return O?(d&&typeof d!="number"&&Qr(e,n,d)&&(d=0,k=O),td(e,n,d,k)):[]}function jc(e,n,d){var k=e==null?0:e.length;if(!k)return-1;var O=d==null?0:Ot(d);return O<0&&(O=Pr(k+O,0)),zs(e,bt(n,3),O)}function Jc(e,n,d){var k=e==null?0:e.length;if(!k)return-1;var O=k-1;return d!==a&&(O=Ot(d),O=d<0?Pr(k+O,0):Ur(O,k-1)),zs(e,bt(n,3),O,!0)}function e0(e){var n=e==null?0:e.length;return n?Hr(e,1):[]}function c1(e){var n=e==null?0:e.length;return n?Hr(e,Ee):[]}function h1(e,n){var d=e==null?0:e.length;return d?(n=n===a?1:Ot(n),Hr(e,n)):[]}function f1(e){for(var n=-1,d=e==null?0:e.length,k={};++n<d;){var O=e[n];k[O[0]]=O[1]}return k}function t0(e){return e&&e.length?e[0]:a}function d1(e,n,d){var k=e==null?0:e.length;if(!k)return-1;var O=d==null?0:Ot(d);return O<0&&(O=Pr(k+O,0)),Pi(e,n,O)}function p1(e){var n=e==null?0:e.length;return n?bn(e,0,-1):[]}var g1=qt(function(e){var n=hr(e,kl);return n.length&&n[0]===e[0]?gl(n):[]}),v1=qt(function(e){var n=yn(e),d=hr(e,kl);return n===yn(d)?n=a:d.pop(),d.length&&d[0]===e[0]?gl(d,bt(n,2)):[]}),m1=qt(function(e){var n=yn(e),d=hr(e,kl);return n=typeof n=="function"?n:a,n&&d.pop(),d.length&&d[0]===e[0]?gl(d,a,n):[]});function _1(e,n){return e==null?"":pf.call(e,n)}function yn(e){var n=e==null?0:e.length;return n?e[n-1]:a}function b1(e,n,d){var k=e==null?0:e.length;if(!k)return-1;var O=k;return d!==a&&(O=Ot(d),O=O<0?Pr(k+O,0):Ur(O,k-1)),n===n?qu(e,n,O):zs(e,ma,O,!0)}function y1(e,n){return e&&e.length?fc(e,Ot(n)):a}var w1=qt(r0);function r0(e,n){return e&&e.length&&n&&n.length?bl(e,n):e}function S1(e,n,d){return e&&e.length&&n&&n.length?bl(e,n,bt(d,2)):e}function C1(e,n,d){return e&&e.length&&n&&n.length?bl(e,n,a,d):e}var x1=si(function(e,n){var d=e==null?0:e.length,k=hl(e,n);return gc(e,hr(n,function(O){return ai(O,d)?+O:O}).sort(kc)),k});function k1(e,n){var d=[];if(!(e&&e.length))return d;var k=-1,O=[],$=e.length;for(n=bt(n,3);++k<$;){var oe=e[k];n(oe,k,e)&&(d.push(oe),O.push(k))}return gc(e,O),d}function ql(e){return e==null?e:_f.call(e)}function M1(e,n,d){var k=e==null?0:e.length;return k?(d&&typeof d!="number"&&Qr(e,n,d)?(n=0,d=k):(n=n==null?0:Ot(n),d=d===a?k:Ot(d)),bn(e,n,d)):[]}function E1(e,n){return no(e,n)}function A1(e,n,d){return Sl(e,n,bt(d,2))}function T1(e,n){var d=e==null?0:e.length;if(d){var k=no(e,n);if(k<d&&An(e[k],n))return k}return-1}function I1(e,n){return no(e,n,!0)}function P1(e,n,d){return Sl(e,n,bt(d,2),!0)}function N1(e,n){var d=e==null?0:e.length;if(d){var k=no(e,n,!0)-1;if(An(e[k],n))return k}return-1}function L1(e){return e&&e.length?mc(e):[]}function O1(e,n){return e&&e.length?mc(e,bt(n,2)):[]}function D1(e){var n=e==null?0:e.length;return n?bn(e,1,n):[]}function R1(e,n,d){return e&&e.length?(n=d||n===a?1:Ot(n),bn(e,0,n<0?0:n)):[]}function B1(e,n,d){var k=e==null?0:e.length;return k?(n=d||n===a?1:Ot(n),n=k-n,bn(e,n<0?0:n,k)):[]}function F1(e,n){return e&&e.length?io(e,bt(n,3),!1,!0):[]}function q1(e,n){return e&&e.length?io(e,bt(n,3)):[]}var z1=qt(function(e){return xi(Hr(e,1,Mr,!0))}),H1=qt(function(e){var n=yn(e);return Mr(n)&&(n=a),xi(Hr(e,1,Mr,!0),bt(n,2))}),V1=qt(function(e){var n=yn(e);return n=typeof n=="function"?n:a,xi(Hr(e,1,Mr,!0),a,n)});function U1(e){return e&&e.length?xi(e):[]}function $1(e,n){return e&&e.length?xi(e,bt(n,2)):[]}function W1(e,n){return n=typeof n=="function"?n:a,e&&e.length?xi(e,a,n):[]}function zl(e){if(!(e&&e.length))return[];var n=0;return e=Jn(e,function(d){if(Mr(d))return n=Pr(d.length,n),!0}),wa(n,function(d){return hr(e,_a(d))})}function n0(e,n){if(!(e&&e.length))return[];var d=zl(e);return n==null?d:hr(d,function(k){return wr(n,a,k)})}var G1=qt(function(e,n){return Mr(e)?Qs(e,n):[]}),Y1=qt(function(e){return xl(Jn(e,Mr))}),K1=qt(function(e){var n=yn(e);return Mr(n)&&(n=a),xl(Jn(e,Mr),bt(n,2))}),X1=qt(function(e){var n=yn(e);return n=typeof n=="function"?n:a,xl(Jn(e,Mr),a,n)}),Q1=qt(zl);function Z1(e,n){return wc(e||[],n||[],Xs)}function j1(e,n){return wc(e||[],n||[],Js)}var J1=qt(function(e){var n=e.length,d=n>1?e[n-1]:a;return d=typeof d=="function"?(e.pop(),d):a,n0(e,d)});function i0(e){var n=V(e);return n.__chain__=!0,n}function ep(e,n){return n(e),e}function po(e,n){return n(e)}var tp=si(function(e){var n=e.length,d=n?e[0]:0,k=this.__wrapped__,O=function($){return hl($,e)};return n>1||this.__actions__.length||!(k instanceof $t)||!ai(d)?this.thru(O):(k=k.slice(d,+d+(n?1:0)),k.__actions__.push({func:po,args:[O],thisArg:a}),new mn(k,this.__chain__).thru(function($){return n&&!$.length&&$.push(a),$}))});function rp(){return i0(this)}function np(){return new mn(this.value(),this.__chain__)}function ip(){this.__values__===a&&(this.__values__=_0(this.value()));var e=this.__index__>=this.__values__.length,n=e?a:this.__values__[this.__index__++];return{done:e,value:n}}function sp(){return this}function ap(e){for(var n,d=this;d instanceof ja;){var k=Zc(d);k.__index__=0,k.__values__=a,n?O.__wrapped__=k:n=k;var O=k;d=d.__wrapped__}return O.__wrapped__=e,n}function op(){var e=this.__wrapped__;if(e instanceof $t){var n=e;return this.__actions__.length&&(n=new $t(this)),n=n.reverse(),n.__actions__.push({func:po,args:[ql],thisArg:a}),new mn(n,this.__chain__)}return this.thru(ql)}function lp(){return yc(this.__wrapped__,this.__actions__)}var up=so(function(e,n,d){nr.call(e,d)?++e[d]:ni(e,d,1)});function cp(e,n,d){var k=Pt(e)?rl:ed;return d&&Qr(e,n,d)&&(n=a),k(e,bt(n,3))}function hp(e,n){var d=Pt(e)?Jn:nc;return d(e,bt(n,3))}var fp=Pc(jc),dp=Pc(Jc);function pp(e,n){return Hr(go(e,n),1)}function gp(e,n){return Hr(go(e,n),Ee)}function vp(e,n,d){return d=d===a?1:Ot(d),Hr(go(e,n),d)}function s0(e,n){var d=Pt(e)?Jr:Ci;return d(e,bt(n,3))}function a0(e,n){var d=Pt(e)?va:rc;return d(e,bt(n,3))}var mp=so(function(e,n,d){nr.call(e,d)?e[d].push(n):ni(e,d,[n])});function _p(e,n,d,k){e=tn(e)?e:_s(e),d=d&&!k?Ot(d):0;var O=e.length;return d<0&&(d=Pr(O+d,0)),yo(e)?d<=O&&e.indexOf(n,d)>-1:!!O&&Pi(e,n,d)>-1}var bp=qt(function(e,n,d){var k=-1,O=typeof n=="function",$=tn(e)?Ne(e.length):[];return Ci(e,function(oe){$[++k]=O?wr(n,oe,d):Zs(oe,n,d)}),$}),yp=so(function(e,n,d){ni(e,d,n)});function go(e,n){var d=Pt(e)?hr:uc;return d(e,bt(n,3))}function wp(e,n,d,k){return e==null?[]:(Pt(n)||(n=n==null?[]:[n]),d=k?a:d,Pt(d)||(d=d==null?[]:[d]),dc(e,n,d))}var Sp=so(function(e,n,d){e[d?0:1].push(n)},function(){return[[],[]]});function Cp(e,n,d){var k=Pt(e)?Ra:Ir,O=arguments.length<3;return k(e,bt(n,4),d,O,Ci)}function xp(e,n,d){var k=Pt(e)?Ru:Ir,O=arguments.length<3;return k(e,bt(n,4),d,O,rc)}function kp(e,n){var d=Pt(e)?Jn:nc;return d(e,_o(bt(n,3)))}function Mp(e){var n=Pt(e)?ju:_d;return n(e)}function Ep(e,n,d){(d?Qr(e,n,d):n===a)?n=1:n=Ot(n);var k=Pt(e)?Xf:bd;return k(e,n)}function Ap(e){var n=Pt(e)?Qf:wd;return n(e)}function Tp(e){if(e==null)return 0;if(tn(e))return yo(e)?qi(e):e.length;var n=$r(e);return n==ct||n==Ue?e.size:ml(e).length}function Ip(e,n,d){var k=Pt(e)?Ba:Sd;return d&&Qr(e,n,d)&&(n=a),k(e,bt(n,3))}var Pp=qt(function(e,n){if(e==null)return[];var d=n.length;return d>1&&Qr(e,n[0],n[1])?n=[]:d>2&&Qr(n[0],n[1],n[2])&&(n=[n[0]]),dc(e,Hr(n,1),[])}),vo=hf||function(){return Or.Date.now()};function Np(e,n){if(typeof n!="function")throw new ar(f);return e=Ot(e),function(){if(--e<1)return n.apply(this,arguments)}}function o0(e,n,d){return n=d?a:n,n=e&&n==null?e.length:n,ii(e,ye,a,a,a,a,n)}function l0(e,n){var d;if(typeof n!="function")throw new ar(f);return e=Ot(e),function(){return--e>0&&(d=n.apply(this,arguments)),e<=1&&(n=a),d}}var Hl=qt(function(e,n,d){var k=T;if(d.length){var O=Xn(d,vs(Hl));k|=G}return ii(e,k,n,d,O)}),u0=qt(function(e,n,d){var k=T|L;if(d.length){var O=Xn(d,vs(u0));k|=G}return ii(n,k,e,d,O)});function c0(e,n,d){n=d?a:n;var k=ii(e,B,a,a,a,a,a,n);return k.placeholder=c0.placeholder,k}function h0(e,n,d){n=d?a:n;var k=ii(e,W,a,a,a,a,a,n);return k.placeholder=h0.placeholder,k}function f0(e,n,d){var k,O,$,oe,be,ke,ze=0,He=!1,We=!1,nt=!0;if(typeof e!="function")throw new ar(f);n=wn(n)||0,yr(d)&&(He=!!d.leading,We="maxWait"in d,$=We?Pr(wn(d.maxWait)||0,n):$,nt="trailing"in d?!!d.trailing:nt);function dt(Er){var Tn=k,ui=O;return k=O=a,ze=Er,oe=e.apply(ui,Tn),oe}function yt(Er){return ze=Er,be=ra(Ht,n),He?dt(Er):oe}function Rt(Er){var Tn=Er-ke,ui=Er-ze,P0=n-Tn;return We?Ur(P0,$-ui):P0}function wt(Er){var Tn=Er-ke,ui=Er-ze;return ke===a||Tn>=n||Tn<0||We&&ui>=$}function Ht(){var Er=vo();if(wt(Er))return Wt(Er);be=ra(Ht,Rt(Er))}function Wt(Er){return be=a,nt&&k?dt(Er):(k=O=a,oe)}function dn(){be!==a&&Sc(be),ze=0,k=ke=O=be=a}function Zr(){return be===a?oe:Wt(vo())}function pn(){var Er=vo(),Tn=wt(Er);if(k=arguments,O=this,ke=Er,Tn){if(be===a)return yt(ke);if(We)return Sc(be),be=ra(Ht,n),dt(ke)}return be===a&&(be=ra(Ht,n)),oe}return pn.cancel=dn,pn.flush=Zr,pn}var Lp=qt(function(e,n){return tc(e,1,n)}),Op=qt(function(e,n,d){return tc(e,wn(n)||0,d)});function Dp(e){return ii(e,se)}function mo(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new ar(f);var d=function(){var k=arguments,O=n?n.apply(this,k):k[0],$=d.cache;if($.has(O))return $.get(O);var oe=e.apply(this,k);return d.cache=$.set(O,oe)||$,oe};return d.cache=new(mo.Cache||ri),d}mo.Cache=ri;function _o(e){if(typeof e!="function")throw new ar(f);return function(){var n=arguments;switch(n.length){case 0:return!e.call(this);case 1:return!e.call(this,n[0]);case 2:return!e.call(this,n[0],n[1]);case 3:return!e.call(this,n[0],n[1],n[2])}return!e.apply(this,n)}}function Rp(e){return l0(2,e)}var Bp=Cd(function(e,n){n=n.length==1&&Pt(n[0])?hr(n[0],Kt(bt())):hr(Hr(n,1),Kt(bt()));var d=n.length;return qt(function(k){for(var O=-1,$=Ur(k.length,d);++O<$;)k[O]=n[O].call(this,k[O]);return wr(e,this,k)})}),Vl=qt(function(e,n){var d=Xn(n,vs(Vl));return ii(e,G,a,n,d)}),d0=qt(function(e,n){var d=Xn(n,vs(d0));return ii(e,R,a,n,d)}),Fp=si(function(e,n){return ii(e,q,a,a,a,n)});function qp(e,n){if(typeof e!="function")throw new ar(f);return n=n===a?n:Ot(n),qt(e,n)}function zp(e,n){if(typeof e!="function")throw new ar(f);return n=n==null?0:Pr(Ot(n),0),qt(function(d){var k=d[n],O=Mi(d,0,n);return k&&ei(O,k),wr(e,this,O)})}function Hp(e,n,d){var k=!0,O=!0;if(typeof e!="function")throw new ar(f);return yr(d)&&(k="leading"in d?!!d.leading:k,O="trailing"in d?!!d.trailing:O),f0(e,n,{leading:k,maxWait:n,trailing:O})}function Vp(e){return o0(e,1)}function Up(e,n){return Vl(Ml(n),e)}function $p(){if(!arguments.length)return[];var e=arguments[0];return Pt(e)?e:[e]}function Wp(e){return _n(e,_)}function Gp(e,n){return n=typeof n=="function"?n:a,_n(e,_,n)}function Yp(e){return _n(e,M|_)}function Kp(e,n){return n=typeof n=="function"?n:a,_n(e,M|_,n)}function Xp(e,n){return n==null||ec(e,n,Dr(n))}function An(e,n){return e===n||e!==e&&n!==n}var Qp=uo(pl),Zp=uo(function(e,n){return e>=n}),Yi=ac(function(){return arguments}())?ac:function(e){return Sr(e)&&nr.call(e,"callee")&&!Gu.call(e,"callee")},Pt=Ne.isArray,jp=pa?Kt(pa):ad;function tn(e){return e!=null&&bo(e.length)&&!oi(e)}function Mr(e){return Sr(e)&&tn(e)}function Jp(e){return e===!0||e===!1||Sr(e)&&Xr(e)==it}var Ei=df||Jl,eg=ks?Kt(ks):od;function tg(e){return Sr(e)&&e.nodeType===1&&!na(e)}function rg(e){if(e==null)return!0;if(tn(e)&&(Pt(e)||typeof e=="string"||typeof e.splice=="function"||Ei(e)||ms(e)||Yi(e)))return!e.length;var n=$r(e);if(n==ct||n==Ue)return!e.size;if(ta(e))return!ml(e).length;for(var d in e)if(nr.call(e,d))return!1;return!0}function ng(e,n){return js(e,n)}function ig(e,n,d){d=typeof d=="function"?d:a;var k=d?d(e,n):a;return k===a?js(e,n,a,d):!!k}function Ul(e){if(!Sr(e))return!1;var n=Xr(e);return n==at||n==It||typeof e.message=="string"&&typeof e.name=="string"&&!na(e)}function sg(e){return typeof e=="number"&&Ku(e)}function oi(e){if(!yr(e))return!1;var n=Xr(e);return n==Gt||n==Dt||n==Lt||n==Wr}function p0(e){return typeof e=="number"&&e==Ot(e)}function bo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Me}function yr(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}function Sr(e){return e!=null&&typeof e=="object"}var g0=ga?Kt(ga):ud;function ag(e,n){return e===n||vl(e,n,Ll(n))}function og(e,n,d){return d=typeof d=="function"?d:a,vl(e,n,Ll(n),d)}function lg(e){return v0(e)&&e!=+e}function ug(e){if(Gd(e))throw new Te(c);return oc(e)}function cg(e){return e===null}function hg(e){return e==null}function v0(e){return typeof e=="number"||Sr(e)&&Xr(e)==gr}function na(e){if(!Sr(e)||Xr(e)!=er)return!1;var n=Wa(e);if(n===null)return!0;var d=nr.call(n,"constructor")&&n.constructor;return typeof d=="function"&&d instanceof d&&Us.call(d)==of}var $l=Ho?Kt(Ho):cd;function fg(e){return p0(e)&&e>=-9007199254740991&&e<=Me}var m0=os?Kt(os):hd;function yo(e){return typeof e=="string"||!Pt(e)&&Sr(e)&&Xr(e)==Je}function fn(e){return typeof e=="symbol"||Sr(e)&&Xr(e)==Ye}var ms=Vo?Kt(Vo):fd;function dg(e){return e===a}function pg(e){return Sr(e)&&$r(e)==rt}function gg(e){return Sr(e)&&Xr(e)==o}var vg=uo(_l),mg=uo(function(e,n){return e<=n});function _0(e){if(!e)return[];if(tn(e))return yo(e)?cn(e):en(e);if($s&&e[$s])return Fa(e[$s]());var n=$r(e),d=n==ct?cs:n==Ue?Es:_s;return d(e)}function li(e){if(!e)return e===0?e:0;if(e=wn(e),e===Ee||e===-1/0){var n=e<0?-1:1;return n*H}return e===e?e:0}function Ot(e){var n=li(e),d=n%1;return n===n?d?n-d:n:0}function b0(e){return e?Ui(Ot(e),0,X):0}function wn(e){if(typeof e=="number")return e;if(fn(e))return Y;if(yr(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=yr(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=ji(e);var d=ot.test(e);return d||Tt.test(e)?Ou(e.slice(2),d?2:8):Bt.test(e)?Y:+e}function y0(e){return qn(e,rn(e))}function _g(e){return e?Ui(Ot(e),-9007199254740991,Me):e===0?e:0}function tr(e){return e==null?"":hn(e)}var bg=ps(function(e,n){if(ta(n)||tn(n)){qn(n,Dr(n),e);return}for(var d in n)nr.call(n,d)&&Xs(e,d,n[d])}),w0=ps(function(e,n){qn(n,rn(n),e)}),wo=ps(function(e,n,d,k){qn(n,rn(n),e,k)}),yg=ps(function(e,n,d,k){qn(n,Dr(n),e,k)}),wg=si(hl);function Sg(e,n){var d=ds(e);return n==null?d:Ju(d,n)}var Cg=qt(function(e,n){e=mt(e);var d=-1,k=n.length,O=k>2?n[2]:a;for(O&&Qr(n[0],n[1],O)&&(k=1);++d<k;)for(var $=n[d],oe=rn($),be=-1,ke=oe.length;++be<ke;){var ze=oe[be],He=e[ze];(He===a||An(He,wi[ze])&&!nr.call(e,ze))&&(e[ze]=$[ze])}return e}),xg=qt(function(e){return e.push(a,Fc),wr(S0,a,e)});function kg(e,n){return qs(e,bt(n,3),Fn)}function Mg(e,n){return qs(e,bt(n,3),dl)}function Eg(e,n){return e==null?e:fl(e,bt(n,3),rn)}function Ag(e,n){return e==null?e:ic(e,bt(n,3),rn)}function Tg(e,n){return e&&Fn(e,bt(n,3))}function Ig(e,n){return e&&dl(e,bt(n,3))}function Pg(e){return e==null?[]:to(e,Dr(e))}function Ng(e){return e==null?[]:to(e,rn(e))}function Wl(e,n,d){var k=e==null?a:$i(e,n);return k===a?d:k}function Lg(e,n){return e!=null&&Hc(e,n,rd)}function Gl(e,n){return e!=null&&Hc(e,n,nd)}var Og=Lc(function(e,n,d){n!=null&&typeof n.toString!="function"&&(n=Va.call(n)),e[n]=d},Kl(nn)),Dg=Lc(function(e,n,d){n!=null&&typeof n.toString!="function"&&(n=Va.call(n)),nr.call(e,n)?e[n].push(d):e[n]=[d]},bt),Rg=qt(Zs);function Dr(e){return tn(e)?Zu(e):ml(e)}function rn(e){return tn(e)?Zu(e,!0):dd(e)}function Bg(e,n){var d={};return n=bt(n,3),Fn(e,function(k,O,$){ni(d,n(k,O,$),k)}),d}function Fg(e,n){var d={};return n=bt(n,3),Fn(e,function(k,O,$){ni(d,O,n(k,O,$))}),d}var qg=ps(function(e,n,d){ro(e,n,d)}),S0=ps(function(e,n,d,k){ro(e,n,d,k)}),zg=si(function(e,n){var d={};if(e==null)return d;var k=!1;n=hr(n,function($){return $=ki($,e),k||(k=$.length>1),$}),qn(e,Pl(e),d),k&&(d=_n(d,M|w|_,Od));for(var O=n.length;O--;)Cl(d,n[O]);return d});function Hg(e,n){return C0(e,_o(bt(n)))}var Vg=si(function(e,n){return e==null?{}:gd(e,n)});function C0(e,n){if(e==null)return{};var d=hr(Pl(e),function(k){return[k]});return n=bt(n),pc(e,d,function(k,O){return n(k,O[0])})}function Ug(e,n,d){n=ki(n,e);var k=-1,O=n.length;for(O||(O=1,e=a);++k<O;){var $=e==null?a:e[zn(n[k])];$===a&&(k=O,$=d),e=oi($)?$.call(e):$}return e}function $g(e,n,d){return e==null?e:Js(e,n,d)}function Wg(e,n,d,k){return k=typeof k=="function"?k:a,e==null?e:Js(e,n,d,k)}var x0=Rc(Dr),k0=Rc(rn);function Gg(e,n,d){var k=Pt(e),O=k||Ei(e)||ms(e);if(n=bt(n,4),d==null){var $=e&&e.constructor;O?d=k?new $:[]:yr(e)?d=oi($)?ds(Wa(e)):{}:d={}}return(O?Jr:Fn)(e,function(oe,be,ke){return n(d,oe,be,ke)}),d}function Yg(e,n){return e==null?!0:Cl(e,n)}function Kg(e,n,d){return e==null?e:bc(e,n,Ml(d))}function Xg(e,n,d,k){return k=typeof k=="function"?k:a,e==null?e:bc(e,n,Ml(d),k)}function _s(e){return e==null?[]:Hs(e,Dr(e))}function Qg(e){return e==null?[]:Hs(e,rn(e))}function Zg(e,n,d){return d===a&&(d=n,n=a),d!==a&&(d=wn(d),d=d===d?d:0),n!==a&&(n=wn(n),n=n===n?n:0),Ui(wn(e),n,d)}function jg(e,n,d){return n=li(n),d===a?(d=n,n=0):d=li(d),e=wn(e),id(e,n,d)}function Jg(e,n,d){if(d&&typeof d!="boolean"&&Qr(e,n,d)&&(n=d=a),d===a&&(typeof n=="boolean"?(d=n,n=a):typeof e=="boolean"&&(d=e,e=a)),e===a&&n===a?(e=0,n=1):(e=li(e),n===a?(n=e,e=0):n=li(n)),e>n){var k=e;e=n,n=k}if(d||e%1||n%1){var O=Xu();return Ur(e+O*(n-e+xs("1e-"+((O+"").length-1))),n)}return yl(e,n)}var ev=gs(function(e,n,d){return n=n.toLowerCase(),e+(d?M0(n):n)});function M0(e){return Yl(tr(e).toLowerCase())}function E0(e){return e=tr(e),e&&e.replace(Ft,us).replace(Le,"")}function tv(e,n,d){e=tr(e),n=hn(n);var k=e.length;d=d===a?k:Ui(Ot(d),0,k);var O=d;return d-=n.length,d>=0&&e.slice(d,O)==n}function rv(e){return e=tr(e),e&&ae.test(e)?e.replace(fe,Uo):e}function nv(e){return e=tr(e),e&&Oe.test(e)?e.replace(Ie,"\\$&"):e}var iv=gs(function(e,n,d){return e+(d?"-":"")+n.toLowerCase()}),sv=gs(function(e,n,d){return e+(d?" ":"")+n.toLowerCase()}),av=Ic("toLowerCase");function ov(e,n,d){e=tr(e),n=Ot(n);var k=n?qi(e):0;if(!n||k>=n)return e;var O=(n-k)/2;return lo(Xa(O),d)+e+lo(Ka(O),d)}function lv(e,n,d){e=tr(e),n=Ot(n);var k=n?qi(e):0;return n&&k<n?e+lo(n-k,d):e}function uv(e,n,d){e=tr(e),n=Ot(n);var k=n?qi(e):0;return n&&k<n?lo(n-k,d)+e:e}function cv(e,n,d){return d||n==null?n=0:n&&(n=+n),mf(tr(e).replace(qe,""),n||0)}function hv(e,n,d){return(d?Qr(e,n,d):n===a)?n=1:n=Ot(n),wl(tr(e),n)}function fv(){var e=arguments,n=tr(e[0]);return e.length<3?n:n.replace(e[1],e[2])}var dv=gs(function(e,n,d){return e+(d?"_":"")+n.toLowerCase()});function pv(e,n,d){return d&&typeof d!="number"&&Qr(e,n,d)&&(n=d=a),d=d===a?X:d>>>0,d?(e=tr(e),e&&(typeof n=="string"||n!=null&&!$l(n))&&(n=hn(n),!n&&Bi(e))?Mi(cn(e),0,d):e.split(n,d)):[]}var gv=gs(function(e,n,d){return e+(d?" ":"")+Yl(n)});function vv(e,n,d){return e=tr(e),d=d==null?0:Ui(Ot(d),0,e.length),n=hn(n),e.slice(d,d+n.length)==n}function mv(e,n,d){var k=V.templateSettings;d&&Qr(e,n,d)&&(n=a),e=tr(e),n=wo({},n,k,Bc);var O=wo({},n.imports,k.imports,Bc),$=Dr(O),oe=Hs(O,$),be,ke,ze=0,He=n.interpolate||Zt,We="__p += '",nt=or((n.escape||Zt).source+"|"+He.source+"|"+(He===me?xt:Zt).source+"|"+(n.evaluate||Zt).source+"|$","g"),dt="//# sourceURL="+(nr.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++cr+"]")+`
|
|
301
|
+
`;e.replace(nt,function(wt,Ht,Wt,dn,Zr,pn){return Wt||(Wt=dn),We+=e.slice(ze,pn).replace(rr,Fu),Ht&&(be=!0,We+=`' +
|
|
302
|
+
__e(`+Ht+`) +
|
|
303
|
+
'`),Zr&&(ke=!0,We+=`';
|
|
304
|
+
`+Zr+`;
|
|
305
|
+
__p += '`),Wt&&(We+=`' +
|
|
306
|
+
((__t = (`+Wt+`)) == null ? '' : __t) +
|
|
307
|
+
'`),ze=pn+wt.length,wt}),We+=`';
|
|
308
|
+
`;var yt=nr.call(n,"variable")&&n.variable;if(!yt)We=`with (obj) {
|
|
309
|
+
`+We+`
|
|
310
|
+
}
|
|
311
|
+
`;else if(je.test(yt))throw new Te(p);We=(ke?We.replace(ee,""):We).replace(j,"$1").replace(pe,"$1;"),We="function("+(yt||"obj")+`) {
|
|
312
|
+
`+(yt?"":`obj || (obj = {});
|
|
313
|
+
`)+"var __t, __p = ''"+(be?", __e = _.escape":"")+(ke?`, __j = Array.prototype.join;
|
|
314
|
+
function print() { __p += __j.call(arguments, '') }
|
|
315
|
+
`:`;
|
|
316
|
+
`)+We+`return __p
|
|
317
|
+
}`;var Rt=T0(function(){return Ge($,dt+"return "+We).apply(a,oe)});if(Rt.source=We,Ul(Rt))throw Rt;return Rt}function _v(e){return tr(e).toLowerCase()}function bv(e){return tr(e).toUpperCase()}function yv(e,n,d){if(e=tr(e),e&&(d||n===a))return ji(e);if(!e||!(n=hn(n)))return e;var k=cn(e),O=cn(n),$=Sa(k,O),oe=ls(k,O)+1;return Mi(k,$,oe).join("")}function wv(e,n,d){if(e=tr(e),e&&(d||n===a))return e.slice(0,za(e)+1);if(!e||!(n=hn(n)))return e;var k=cn(e),O=ls(k,cn(n))+1;return Mi(k,0,O).join("")}function Sv(e,n,d){if(e=tr(e),e&&(d||n===a))return e.replace(qe,"");if(!e||!(n=hn(n)))return e;var k=cn(e),O=Sa(k,cn(n));return Mi(k,O).join("")}function Cv(e,n){var d=ve,k=he;if(yr(n)){var O="separator"in n?n.separator:O;d="length"in n?Ot(n.length):d,k="omission"in n?hn(n.omission):k}e=tr(e);var $=e.length;if(Bi(e)){var oe=cn(e);$=oe.length}if(d>=$)return e;var be=d-qi(k);if(be<1)return k;var ke=oe?Mi(oe,0,be).join(""):e.slice(0,be);if(O===a)return ke+k;if(oe&&(be+=ke.length-be),$l(O)){if(e.slice(be).search(O)){var ze,He=ke;for(O.global||(O=or(O.source,tr(Mt.exec(O))+"g")),O.lastIndex=0;ze=O.exec(He);)var We=ze.index;ke=ke.slice(0,We===a?be:We)}}else if(e.indexOf(hn(O),be)!=be){var nt=ke.lastIndexOf(O);nt>-1&&(ke=ke.slice(0,nt))}return ke+k}function xv(e){return e=tr(e),e&&ne.test(e)?e.replace(ie,zu):e}var kv=gs(function(e,n,d){return e+(d?" ":"")+n.toUpperCase()}),Yl=Ic("toUpperCase");function A0(e,n,d){return e=tr(e),n=d?a:n,n===a?Fi(e)?Hu(e):gu(e):e.match(n)||[]}var T0=qt(function(e,n){try{return wr(e,a,n)}catch(d){return Ul(d)?d:new Te(d)}}),Mv=si(function(e,n){return Jr(n,function(d){d=zn(d),ni(e,d,Hl(e[d],e))}),e});function Ev(e){var n=e==null?0:e.length,d=bt();return e=n?hr(e,function(k){if(typeof k[1]!="function")throw new ar(f);return[d(k[0]),k[1]]}):[],qt(function(k){for(var O=-1;++O<n;){var $=e[O];if(wr($[0],this,k))return wr($[1],this,k)}})}function Av(e){return Jf(_n(e,M))}function Kl(e){return function(){return e}}function Tv(e,n){return e==null||e!==e?n:e}var Iv=Nc(),Pv=Nc(!0);function nn(e){return e}function Xl(e){return lc(typeof e=="function"?e:_n(e,M))}function Nv(e){return cc(_n(e,M))}function Lv(e,n){return hc(e,_n(n,M))}var Ov=qt(function(e,n){return function(d){return Zs(d,e,n)}}),Dv=qt(function(e,n){return function(d){return Zs(e,d,n)}});function Ql(e,n,d){var k=Dr(n),O=to(n,k);d==null&&!(yr(n)&&(O.length||!k.length))&&(d=n,n=e,e=this,O=to(n,Dr(n)));var $=!(yr(d)&&"chain"in d)||!!d.chain,oe=oi(e);return Jr(O,function(be){var ke=n[be];e[be]=ke,oe&&(e.prototype[be]=function(){var ze=this.__chain__;if($||ze){var He=e(this.__wrapped__),We=He.__actions__=en(this.__actions__);return We.push({func:ke,args:arguments,thisArg:e}),He.__chain__=ze,He}return ke.apply(e,ei([this.value()],arguments))})}),e}function Rv(){return Or._===this&&(Or._=lf),this}function Zl(){}function Bv(e){return e=Ot(e),qt(function(n){return fc(n,e)})}var Fv=Al(hr),qv=Al(rl),zv=Al(Ba);function I0(e){return Dl(e)?_a(zn(e)):vd(e)}function Hv(e){return function(n){return e==null?a:$i(e,n)}}var Vv=Oc(),Uv=Oc(!0);function jl(){return[]}function Jl(){return!1}function $v(){return{}}function Wv(){return""}function Gv(){return!0}function Yv(e,n){if(e=Ot(e),e<1||e>Me)return[];var d=X,k=Ur(e,X);n=bt(n),e-=X;for(var O=wa(k,n);++d<e;)n(d);return O}function Kv(e){return Pt(e)?hr(e,zn):fn(e)?[e]:en(Qc(tr(e)))}function Xv(e){var n=++af;return tr(e)+n}var Qv=oo(function(e,n){return e+n},0),Zv=Tl("ceil"),jv=oo(function(e,n){return e/n},1),Jv=Tl("floor");function em(e){return e&&e.length?eo(e,nn,pl):a}function tm(e,n){return e&&e.length?eo(e,bt(n,2),pl):a}function rm(e){return Ms(e,nn)}function nm(e,n){return Ms(e,bt(n,2))}function im(e){return e&&e.length?eo(e,nn,_l):a}function sm(e,n){return e&&e.length?eo(e,bt(n,2),_l):a}var am=oo(function(e,n){return e*n},1),om=Tl("round"),lm=oo(function(e,n){return e-n},0);function um(e){return e&&e.length?ya(e,nn):0}function cm(e,n){return e&&e.length?ya(e,bt(n,2)):0}return V.after=Np,V.ary=o0,V.assign=bg,V.assignIn=w0,V.assignInWith=wo,V.assignWith=yg,V.at=wg,V.before=l0,V.bind=Hl,V.bindAll=Mv,V.bindKey=u0,V.castArray=$p,V.chain=i0,V.chunk=Jd,V.compact=e1,V.concat=t1,V.cond=Ev,V.conforms=Av,V.constant=Kl,V.countBy=up,V.create=Sg,V.curry=c0,V.curryRight=h0,V.debounce=f0,V.defaults=Cg,V.defaultsDeep=xg,V.defer=Lp,V.delay=Op,V.difference=r1,V.differenceBy=n1,V.differenceWith=i1,V.drop=s1,V.dropRight=a1,V.dropRightWhile=o1,V.dropWhile=l1,V.fill=u1,V.filter=hp,V.flatMap=pp,V.flatMapDeep=gp,V.flatMapDepth=vp,V.flatten=e0,V.flattenDeep=c1,V.flattenDepth=h1,V.flip=Dp,V.flow=Iv,V.flowRight=Pv,V.fromPairs=f1,V.functions=Pg,V.functionsIn=Ng,V.groupBy=mp,V.initial=p1,V.intersection=g1,V.intersectionBy=v1,V.intersectionWith=m1,V.invert=Og,V.invertBy=Dg,V.invokeMap=bp,V.iteratee=Xl,V.keyBy=yp,V.keys=Dr,V.keysIn=rn,V.map=go,V.mapKeys=Bg,V.mapValues=Fg,V.matches=Nv,V.matchesProperty=Lv,V.memoize=mo,V.merge=qg,V.mergeWith=S0,V.method=Ov,V.methodOf=Dv,V.mixin=Ql,V.negate=_o,V.nthArg=Bv,V.omit=zg,V.omitBy=Hg,V.once=Rp,V.orderBy=wp,V.over=Fv,V.overArgs=Bp,V.overEvery=qv,V.overSome=zv,V.partial=Vl,V.partialRight=d0,V.partition=Sp,V.pick=Vg,V.pickBy=C0,V.property=I0,V.propertyOf=Hv,V.pull=w1,V.pullAll=r0,V.pullAllBy=S1,V.pullAllWith=C1,V.pullAt=x1,V.range=Vv,V.rangeRight=Uv,V.rearg=Fp,V.reject=kp,V.remove=k1,V.rest=qp,V.reverse=ql,V.sampleSize=Ep,V.set=$g,V.setWith=Wg,V.shuffle=Ap,V.slice=M1,V.sortBy=Pp,V.sortedUniq=L1,V.sortedUniqBy=O1,V.split=pv,V.spread=zp,V.tail=D1,V.take=R1,V.takeRight=B1,V.takeRightWhile=F1,V.takeWhile=q1,V.tap=ep,V.throttle=Hp,V.thru=po,V.toArray=_0,V.toPairs=x0,V.toPairsIn=k0,V.toPath=Kv,V.toPlainObject=y0,V.transform=Gg,V.unary=Vp,V.union=z1,V.unionBy=H1,V.unionWith=V1,V.uniq=U1,V.uniqBy=$1,V.uniqWith=W1,V.unset=Yg,V.unzip=zl,V.unzipWith=n0,V.update=Kg,V.updateWith=Xg,V.values=_s,V.valuesIn=Qg,V.without=G1,V.words=A0,V.wrap=Up,V.xor=Y1,V.xorBy=K1,V.xorWith=X1,V.zip=Q1,V.zipObject=Z1,V.zipObjectDeep=j1,V.zipWith=J1,V.entries=x0,V.entriesIn=k0,V.extend=w0,V.extendWith=wo,Ql(V,V),V.add=Qv,V.attempt=T0,V.camelCase=ev,V.capitalize=M0,V.ceil=Zv,V.clamp=Zg,V.clone=Wp,V.cloneDeep=Yp,V.cloneDeepWith=Kp,V.cloneWith=Gp,V.conformsTo=Xp,V.deburr=E0,V.defaultTo=Tv,V.divide=jv,V.endsWith=tv,V.eq=An,V.escape=rv,V.escapeRegExp=nv,V.every=cp,V.find=fp,V.findIndex=jc,V.findKey=kg,V.findLast=dp,V.findLastIndex=Jc,V.findLastKey=Mg,V.floor=Jv,V.forEach=s0,V.forEachRight=a0,V.forIn=Eg,V.forInRight=Ag,V.forOwn=Tg,V.forOwnRight=Ig,V.get=Wl,V.gt=Qp,V.gte=Zp,V.has=Lg,V.hasIn=Gl,V.head=t0,V.identity=nn,V.includes=_p,V.indexOf=d1,V.inRange=jg,V.invoke=Rg,V.isArguments=Yi,V.isArray=Pt,V.isArrayBuffer=jp,V.isArrayLike=tn,V.isArrayLikeObject=Mr,V.isBoolean=Jp,V.isBuffer=Ei,V.isDate=eg,V.isElement=tg,V.isEmpty=rg,V.isEqual=ng,V.isEqualWith=ig,V.isError=Ul,V.isFinite=sg,V.isFunction=oi,V.isInteger=p0,V.isLength=bo,V.isMap=g0,V.isMatch=ag,V.isMatchWith=og,V.isNaN=lg,V.isNative=ug,V.isNil=hg,V.isNull=cg,V.isNumber=v0,V.isObject=yr,V.isObjectLike=Sr,V.isPlainObject=na,V.isRegExp=$l,V.isSafeInteger=fg,V.isSet=m0,V.isString=yo,V.isSymbol=fn,V.isTypedArray=ms,V.isUndefined=dg,V.isWeakMap=pg,V.isWeakSet=gg,V.join=_1,V.kebabCase=iv,V.last=yn,V.lastIndexOf=b1,V.lowerCase=sv,V.lowerFirst=av,V.lt=vg,V.lte=mg,V.max=em,V.maxBy=tm,V.mean=rm,V.meanBy=nm,V.min=im,V.minBy=sm,V.stubArray=jl,V.stubFalse=Jl,V.stubObject=$v,V.stubString=Wv,V.stubTrue=Gv,V.multiply=am,V.nth=y1,V.noConflict=Rv,V.noop=Zl,V.now=vo,V.pad=ov,V.padEnd=lv,V.padStart=uv,V.parseInt=cv,V.random=Jg,V.reduce=Cp,V.reduceRight=xp,V.repeat=hv,V.replace=fv,V.result=Ug,V.round=om,V.runInContext=Ce,V.sample=Mp,V.size=Tp,V.snakeCase=dv,V.some=Ip,V.sortedIndex=E1,V.sortedIndexBy=A1,V.sortedIndexOf=T1,V.sortedLastIndex=I1,V.sortedLastIndexBy=P1,V.sortedLastIndexOf=N1,V.startCase=gv,V.startsWith=vv,V.subtract=lm,V.sum=um,V.sumBy=cm,V.template=mv,V.times=Yv,V.toFinite=li,V.toInteger=Ot,V.toLength=b0,V.toLower=_v,V.toNumber=wn,V.toSafeInteger=_g,V.toString=tr,V.toUpper=bv,V.trim=yv,V.trimEnd=wv,V.trimStart=Sv,V.truncate=Cv,V.unescape=xv,V.uniqueId=Xv,V.upperCase=kv,V.upperFirst=Yl,V.each=s0,V.eachRight=a0,V.first=t0,Ql(V,function(){var e={};return Fn(V,function(n,d){nr.call(V.prototype,d)||(e[d]=n)}),e}(),{chain:!1}),V.VERSION=l,Jr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){V[e].placeholder=V}),Jr(["drop","take"],function(e,n){$t.prototype[e]=function(d){d=d===a?1:Pr(Ot(d),0);var k=this.__filtered__&&!n?new $t(this):this.clone();return k.__filtered__?k.__takeCount__=Ur(d,k.__takeCount__):k.__views__.push({size:Ur(d,X),type:e+(k.__dir__<0?"Right":"")}),k},$t.prototype[e+"Right"]=function(d){return this.reverse()[e](d).reverse()}}),Jr(["filter","map","takeWhile"],function(e,n){var d=n+1,k=d==K||d==le;$t.prototype[e]=function(O){var $=this.clone();return $.__iteratees__.push({iteratee:bt(O,3),type:d}),$.__filtered__=$.__filtered__||k,$}}),Jr(["head","last"],function(e,n){var d="take"+(n?"Right":"");$t.prototype[e]=function(){return this[d](1).value()[0]}}),Jr(["initial","tail"],function(e,n){var d="drop"+(n?"":"Right");$t.prototype[e]=function(){return this.__filtered__?new $t(this):this[d](1)}}),$t.prototype.compact=function(){return this.filter(nn)},$t.prototype.find=function(e){return this.filter(e).head()},$t.prototype.findLast=function(e){return this.reverse().find(e)},$t.prototype.invokeMap=qt(function(e,n){return typeof e=="function"?new $t(this):this.map(function(d){return Zs(d,e,n)})}),$t.prototype.reject=function(e){return this.filter(_o(bt(e)))},$t.prototype.slice=function(e,n){e=Ot(e);var d=this;return d.__filtered__&&(e>0||n<0)?new $t(d):(e<0?d=d.takeRight(-e):e&&(d=d.drop(e)),n!==a&&(n=Ot(n),d=n<0?d.dropRight(-n):d.take(n-e)),d)},$t.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},$t.prototype.toArray=function(){return this.take(X)},Fn($t.prototype,function(e,n){var d=/^(?:filter|find|map|reject)|While$/.test(n),k=/^(?:head|last)$/.test(n),O=V[k?"take"+(n=="last"?"Right":""):n],$=k||/^find/.test(n);O&&(V.prototype[n]=function(){var oe=this.__wrapped__,be=k?[1]:arguments,ke=oe instanceof $t,ze=be[0],He=ke||Pt(oe),We=function(Ht){var Wt=O.apply(V,ei([Ht],be));return k&&nt?Wt[0]:Wt};He&&d&&typeof ze=="function"&&ze.length!=1&&(ke=He=!1);var nt=this.__chain__,dt=!!this.__actions__.length,yt=$&&!nt,Rt=ke&&!dt;if(!$&&He){oe=Rt?oe:new $t(this);var wt=e.apply(oe,be);return wt.__actions__.push({func:po,args:[We],thisArg:a}),new mn(wt,nt)}return yt&&Rt?e.apply(this,be):(wt=this.thru(We),yt?k?wt.value()[0]:wt.value():wt)})}),Jr(["pop","push","shift","sort","splice","unshift"],function(e){var n=Bn[e],d=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",k=/^(?:pop|shift)$/.test(e);V.prototype[e]=function(){var O=arguments;if(k&&!this.__chain__){var $=this.value();return n.apply(Pt($)?$:[],O)}return this[d](function(oe){return n.apply(Pt(oe)?oe:[],O)})}}),Fn($t.prototype,function(e,n){var d=V[n];if(d){var k=d.name+"";nr.call(fs,k)||(fs[k]=[]),fs[k].push({name:n,func:d})}}),fs[ao(a,L).name]=[{name:"wrapper",func:a}],$t.prototype.clone=xf,$t.prototype.reverse=kf,$t.prototype.value=Mf,V.prototype.at=tp,V.prototype.chain=rp,V.prototype.commit=np,V.prototype.next=ip,V.prototype.plant=ap,V.prototype.reverse=op,V.prototype.toJSON=V.prototype.valueOf=V.prototype.value=lp,V.prototype.first=V.prototype.head,$s&&(V.prototype[$s]=sp),V},Ni=Vu();mi?((mi.exports=Ni)._=Ni,Oa._=Ni):Or._=Ni}).call(uL)}(V0,V0.exports)),V0.exports}var hL=cL();const fL=lL(hL),v7={status:Jt.ok,msg:""};function qh(t){const r={status:Jt.error,msg:"This input must be a number"};return dL(t)?v7:r}function C4(t){const r={status:Jt.error,msg:"This input must be an integer (..., -2, -1, 0, 1, 2, ...)."};return qh(t).status===Jt.error?qh(t):pL(t)?v7:r}function dL(t){return!isNaN(t-parseFloat(t))}function pL(t){return/^[+,-]?\s?\d+$/.test(t)}const m7=M4("fieldStore",{state:()=>({dataShape:null,inputs:{},mediaInputs:{},inputIsValid:!1,validation:{},convertedInput:{},previewInput:{}}),getters:{isValidated(){return this.inputIsValid},getPreview:t=>t.inputIsValid?t.previewInput:{},getConverted:t=>t.inputIsValid?t.convertedInput:{}},actions:{$reset(){console.log("[FieldInputStore].reset()"),this.inputs={},this.mediaInputs={},this.validation={},this.convertedInput={},this.previewInput={},this.inputIsValid=!1;const t=10;for(let r=1;r<=t;r++){const a=`audio-${r}`,l=`image-${r}`;delete this.mediaInputs[a],delete this.mediaInputs[l]}},setFieldValue(t,r){this.inputs[t]=r,this.validate(),this.convert()},setMedia(t,r){console.log(`[FieldInputStore].setMedia: ${t}`),this.mediaInputs[t]=r,this.convert()},validate(){if(this.validation={},this.dataShape===null){this.inputIsValid=!1;return}this.inputIsValid=!0;for(const t of this.dataShape.fields)t.validator&&(t.validator.test(this.inputs[t.name]).status===Jt.ok?this.validation[t.name]=!0:(this.inputIsValid=!1,this.validation[t.name]=!1))},convert(){this.convertedInput={},this.dataShape?.fields.forEach(t=>{this.convertedInput[t.name]=vu[t.type].databaseConverter(this.inputs[t.name]),this.previewInput[t.name]=vu[t.type].previewConverter(this.inputs[t.name])});for(let t=1;t<11;t++){const r=`audio-${t}`,a=this.mediaInputs[r];if(a)this.convertedInput[r]=vu[pr.AUDIO].databaseConverter(a),this.previewInput[r]=vu[pr.AUDIO].previewConverter(a);else break}for(let t=1;t<11;t++){const r=`image-${t}`,a=this.mediaInputs[r];if(a)this.convertedInput[r]=vu[pr.IMAGE].databaseConverter(a),this.previewInput[r]=vu[pr.IMAGE].previewConverter(a);else break}},clearMediaEntries(){for(let t=1;t<=10;t++)delete this.mediaInputs[`audio-${t}`],delete this.mediaInputs[`image-${t}`],delete this.convertedInput[`audio-${t}`],delete this.convertedInput[`image-${t}`],delete this.previewInput[`audio-${t}`],delete this.previewInput[`image-${t}`]},clearField(t){delete this.inputs[t],delete this.validation[t],delete this.convertedInput[t],delete this.previewInput[t]}}}),Ri=qr({name:"FieldInput",props:{autofocus:Boolean,field:{type:Object,required:!0}},setup(t){const r=m7(),a=Qt(null),l=Nr({get:()=>r.inputs[t.field.name],set:w=>r.setFieldValue(t.field.name,w)});E4(l,(w,_)=>{console.log("[FieldInput] modelValue changed:",{new:w,old:_,currentStoreValue:r.inputs[t.field.name]})});const u=Nr(()=>{const w=[];return t.field?.validator&&w.push(t.field.validator.test),w}),c=()=>{a.value&&a.value.focus()},f=()=>{if(!t.field?.name)throw new Error("Field name is required for FieldInput component");return r.inputs[t.field.name]};return{inputField:a,fieldStore:r,modelValue:l,validators:u,focus:c,userInput:f,clearData:()=>{if(console.log(`[FieldInput] Running generic clearData() for ${t.field?.name} in FieldInput.ts`),a.value){if(a.value.value="",!t.field?.name)return;r.clearField(t.field.name)}},setData:w=>{if(!t.field?.name)throw new Error("Field name is required for FieldInput component");r.setFieldValue(t.field.name,w)},vuetifyRules:()=>t.field?.validator?u.value.map(w=>F7(w)):[],generateTags:()=>(console.log("[FieldInput] Running generic generateTags() in FieldInput.ts"),t.field?.tagger?t.field.tagger(f()):[]),generateELO:()=>(console.log("[FieldInput] Running generic generateELO() in FieldInput.ts"),t.field?.generateELO?t.field.generateELO(f()):void 0)}},data(){return{validationStatus:{status:Jt.ok,msg:""}}}}),gL=qr({name:"IntegerInput",extends:Ri,setup(t,r){const a=Ri.setup?.(t,r),l=Nr(()=>{const u=Ri.validators.call(this);return t.field.validator?.test&&u.push(t.field.validator.test),u?[C4,...u]:[C4]});return{...a,validators:l}}}),ua=(t,r)=>{const a=t.__vccOpts||t;for(const[l,u]of r)a[l]=u;return a};function vL(t,r,a,l,u,c){const f=vt("v-text-field");return st(),Rr(f,{ref:"inputField",modelValue:t.modelValue,"onUpdate:modelValue":r[0]||(r[0]=p=>t.modelValue=p),variant:"filled",type:"number",name:t.field.name,label:t.field.name,rules:t.vuetifyRules(),hint:t.validationStatus.msg,autofocus:t.autofocus},null,8,["modelValue","name","label","rules","hint","autofocus"])}const mL=ua(gL,[["render",vL]]),_L=qr({name:"MarkdownInput",extends:Ri,setup(t,r){return{...Ri.setup?.(t,r)}}});function bL(t,r,a,l,u,c){const f=vt("v-textarea");return st(),Rr(f,{ref:"inputField",modelValue:t.modelValue,"onUpdate:modelValue":r[0]||(r[0]=p=>t.modelValue=p),variant:"filled",name:t.field.name,label:t.field.name,rules:t.vuetifyRules(),hint:t.validationStatus.msg,autofocus:t.autofocus},null,8,["modelValue","name","label","rules","hint","autofocus"])}const yL=ua(_L,[["render",bL],["__scopeId","data-v-28ef24ff"]]),wL=qr({name:"MediaDragDropUploader",extends:Ri,setup(t,r){const a=Ri.setup?.(t,r),{fieldStore:l}=a;return{...a,fieldStore:l}},data(){return{isDragging:!1,mediaItems:[]}},computed:{hasMedia(){return this.mediaItems.length>0}},created(){},methods:{dragOverHandler(t){t.preventDefault()},dragEnterHandler(t){t.preventDefault(),this.isDragging=!0},dragLeaveHandler(t){t.preventDefault(),this.isDragging=!1},dropHandler(t){t.preventDefault(),this.isDragging=!1;const r=t.dataTransfer?.files;r&&this.processFiles(r)},triggerFileInput(){this.$refs.fileInput.click()},handleFileInput(t){const r=t.target.files;r&&this.processFiles(r)},processFiles(t){Array.from(t).forEach(r=>{this.addMediaItem(r)}),this.updateStore()},addMediaItem(t){const r=t.type.startsWith("image/")?"image":"audio",a={type:r,file:t,url:URL.createObjectURL(t)};r==="image"&&this.createThumbnail(t).then(l=>{a.thumbnailUrl=l,this.$nextTick(()=>{this.$forceUpdate()})}),this.mediaItems.push(a)},async createThumbnail(t){return new Promise(r=>{const a=new FileReader;a.onload=l=>{r(l.target?.result)},a.readAsDataURL(t)})},removeMedia(t){URL.revokeObjectURL(this.mediaItems[t].url),this.mediaItems.splice(t,1),this.updateStore()},clearData(){this.mediaItems.forEach(t=>{URL.revokeObjectURL(t.url)}),this.mediaItems=[],this.updateStore()},addMoreMedia(){console.log("addMoreMedia"),this.triggerFileInput()},updateStore(){let t=0,r=0;this.mediaItems.forEach(a=>{a.type==="image"?(t++,this.fieldStore.setMedia(`image-${t}`,{content_type:a.file.type,data:a.file})):a.type==="audio"&&(r++,this.fieldStore.setMedia(`audio-${r}`,{content_type:a.file.type,data:a.file}))})},getValidators(){return[()=>({status:this.mediaItems.length>0?Jt.ok:Jt.error,msg:this.mediaItems.length>0?"":"At least one media item is required"})]}}}),SL={class:"mr-2 mb-2"},CL=["src"],xL=["src"];function kL(t,r,a,l,u,c){const f=vt("v-label"),p=vt("v-btn");return st(),_t("div",SL,[ft(f,{class:"text-h5"},{default:St(()=>r[5]||(r[5]=[Yt("Add media:")])),_:1}),pt("div",{class:Yb(["drop-zone",{"drop-zone--over":t.isDragging}]),onDrop:r[1]||(r[1]=(...y)=>t.dropHandler&&t.dropHandler(...y)),onDragover:r[2]||(r[2]=su((...y)=>t.dragOverHandler&&t.dragOverHandler(...y),["prevent"])),onDragenter:r[3]||(r[3]=su((...y)=>t.dragEnterHandler&&t.dragEnterHandler(...y),["prevent"])),onDragleave:r[4]||(r[4]=su((...y)=>t.dragLeaveHandler&&t.dragLeaveHandler(...y),["prevent"]))},[pt("input",{ref:"fileInput",type:"file",accept:"image/*,audio/*",multiple:"",style:{display:"none"},onChange:r[0]||(r[0]=(...y)=>t.handleFileInput&&t.handleFileInput(...y))},null,544),(st(!0),_t(Gr,null,Ai(t.mediaItems,(y,S)=>(st(),_t("div",{key:S,class:"media-item"},[y.type==="image"?(st(),_t("img",{key:0,src:y.thumbnailUrl,alt:"Uploaded image thumbnail",class:"thumbnail"},null,8,CL)):y.type==="audio"?(st(),_t("audio",{key:1,controls:"",src:y.url},null,8,xL)):br("",!0),ft(p,{size:"small",onClick:A=>t.removeMedia(S)},{default:St(()=>r[6]||(r[6]=[Yt("Remove")])),_:2},1032,["onClick"])]))),128)),r[8]||(r[8]=Yt(" Drop image or audio files here... ")),ft(p,{onClick:t.triggerFileInput},{default:St(()=>r[7]||(r[7]=[Yt("Or Click to Upload")])),_:1},8,["onClick"])],34)])}const ML=ua(wL,[["render",kL],["__scopeId","data-v-e86645b6"]]),EL=qr({name:"MidiInput",components:{SyllableSeqVis:P9},extends:Ri,data(){return{midi:null,recording:!1,SylSeq:rs([]),display:!1,transpositions:!1}},async created(){try{this.midi=await my.instance(),this.record(),this.store[this.field.name]=this.getTransposedSeqs}catch(t){throw new Error(`MidiInput.created: ${t}`)}},methods:{record(){this.midi&&(this.midi.record(),this.midi.addNoteonListenter(t=>{this.SylSeq.append(t),this.$refs.inputVis.updateBounds()}),this.recording=!0)},getTransposedSeqs(){return this.midi?this.transpositions?[-5,-4,-3,-2,-1,0,1,2,3,4,5,6].map(t=>Jk(this.midi.recording,t)):[this.midi.recording]:[]},clearData(){this.midi&&(console.log("midiInput clearing data..."),this.midi.stopRecording(),this.midi.eraseRecording(),this.SylSeq=rs([]),this.record(),this.recording=!0,this.store.convertedInput[this.field.name]=this.midi.recording,this.store.validation[this.field.name]=!1,this.store[this.field.name]=this.getTransposedSeqs)},hasRecording(){return this.midi?.hasRecording??!1},reset(){this.clearData()},play(){this.midi&&(this.midi.play(),this.display=!0,this.validate())}}}),AL={key:0},TL={class:"text-h5"},IL={class:"font-weight-black"};function PL(t,r,a,l,u,c){const f=vt("syllable-seq-vis"),p=vt("v-icon"),y=vt("v-btn"),S=vt("v-checkbox");return st(),_t("div",null,[t.recording?(st(),_t("div",AL,[pt("span",TL,[r[1]||(r[1]=Yt(" Now Recording from device: ")),pt("span",IL,ir(t.midi.configuredInput),1)])])):br("",!0),(st(),Rr(f,{key:1,ref:"inputVis",seq:t.SylSeq,"last-t-ssuggestion":"5000"},null,8,["seq"])),ft(y,{color:"primary",disabled:t.hasRecording(),onClick:t.play},{default:St(()=>[r[3]||(r[3]=Yt(" Preview ")),ft(p,{end:""},{default:St(()=>r[2]||(r[2]=[Yt("volume_up")])),_:1})]),_:1},8,["disabled","onClick"]),ft(y,{color:"error",disabled:t.hasRecording(),onClick:t.reset},{default:St(()=>[r[5]||(r[5]=Yt(" Clear and try again ")),ft(p,{end:""},{default:St(()=>r[4]||(r[4]=[Yt("close")])),_:1})]),_:1},8,["disabled","onClick"]),ft(S,{modelValue:t.transpositions,"onUpdate:modelValue":r[0]||(r[0]=A=>t.transpositions=A),label:"Include Transpositions",onClickCapture:t.reset},null,8,["modelValue","onClickCapture"])])}const NL=ua(EL,[["render",PL]]),LL=qr({name:"NumberInput",extends:Ri,setup(t,r){const a=Ri.setup?.(t,r),l=Nr(()=>{const u=Ri.validators.call(this);return t.field.validator?.test&&u.push(t.field.validator.test),u?[qh,...u]:[qh]});return{...a,validators:l}}});function OL(t,r,a,l,u,c){const f=vt("v-text-field");return st(),Rr(f,{ref:"inputField",modelValue:t.modelValue,"onUpdate:modelValue":r[0]||(r[0]=p=>t.modelValue=p),variant:"filled",type:"number",name:t.field.name,label:t.field.name,rules:t.vuetifyRules(),hint:t.validationStatus.msg,autofocus:t.autofocus},null,8,["modelValue","name","label","rules","hint","autofocus"])}const DL=ua(LL,[["render",OL]]),RL=qr({name:"StringInput",extends:Ri,setup(t,r){const a=Ri.setup?.(t,r),l=Nr(()=>{const u=Ri.validators.call(this);return t.field.validator?.test&&u.push(t.field.validator.test),u||[]});return{...a,validators:l}}});function BL(t,r,a,l,u,c){const f=vt("v-text-field");return st(),Rr(f,{ref:"inputField",modelValue:t.modelValue,"onUpdate:modelValue":r[0]||(r[0]=p=>t.modelValue=p),variant:"filled",type:"text",name:t.field.name,label:t.field.name,rules:t.vuetifyRules(),hint:t.validationStatus.msg,autofocus:t.autofocus},null,8,["modelValue","name","label","rules","hint","autofocus"])}const FL=ua(RL,[["render",BL]]),qL=qr({name:"ChessPuzzleInput",extends:Ri,setup(t,r){const a=Ri.setup?.(t,r),l=()=>{if(!a)return;const c=a.modelValue.value.split(","),f=parseInt(c[3]),p=parseInt(c[6]),y={global:{score:f,count:p},tags:{},misc:{}};return u().forEach(A=>{y.tags[A]={score:f,count:p}}),console.log("generateELO",JSON.stringify(y)),y},u=()=>{if(!a)return[];console.log(`CPI.generateTags: modelValue: ${a.modelValue.value}`);const c=a.modelValue.value.split(","),f=c[7].split(" "),p=c[9].split(" ");return f.map(y=>`theme-${y}`).concat(p.map(y=>`opening-${y}`))};return{...a,generateELO:l,generateTags:u}}});function zL(t,r,a,l,u,c){const f=vt("v-text-field");return st(),Rr(f,{ref:"inputField",modelValue:t.modelValue,"onUpdate:modelValue":r[0]||(r[0]=p=>t.modelValue=p),variant:"filled",name:t.field.name,label:t.field.name,rules:t.vuetifyRules(),autofocus:t.autofocus},null,8,["modelValue","name","label","rules","autofocus"])}const HL=ua(qL,[["render",zL]]),_7=M4("dataInputForm",{state:()=>({dataInputForm:{dataShape:null,course:null,shapeViews:[],fields:[],fieldStore:m7(),uploading:!1}}),actions:{setDataShape(t){this.dataInputForm.dataShape=t,this.dataInputForm.fieldStore.dataShape=t,this.dataInputForm.fieldStore.$reset()},setCourse(t){this.dataInputForm.course=t}}}),VL=qr({name:"DataInputForm",components:{NumberInput:DL,StringInput:FL,IntegerInput:mL,MarkdownInput:yL,MidiInput:NL,CardBrowser:k4,MediaDragDropUploader:ML,TagsInput:w7,ChessPuzzleInput:HL},props:{courseCfg:{type:Object,required:!0,default:()=>({courseID:"default-test"})},dataShape:{type:Object,required:!0},previewComponent:{type:Object,required:!1,default:null}},data(){return{tag:"",tags:[],autoCompleteSuggestions:[],timer:void 0,dataInputFormStore:_7(),fieldInputRefs:[],courseDB:null}},computed:{ftString(){return pr.STRING},int(){return pr.INT},num(){return pr.NUMBER},img(){return pr.IMAGE},mkd(){return pr.MARKDOWN},audio(){return pr.AUDIO},midi(){return pr.MIDI},uploader(){return pr.MEDIA_UPLOADS},chessPuzzle(){return pr.CHESS_PUZZLE},fieldInputs(){return Array.from(this.fieldInputRefs.values())},shapeViews:{get(){return this.dataInputFormStore.dataInputForm.shapeViews},set(t){this.dataInputFormStore.dataInputForm.shapeViews=t}},allowSubmit(){return this.dataInputFormStore.dataInputForm.fieldStore.isValidated},fieldStore(){return this.dataInputFormStore.dataInputForm.fieldStore},uploading:{get(){return this.dataInputFormStore.dataInputForm.uploading},set(t){this.dataInputFormStore.dataInputForm.uploading=t}},previewInput(){return this.fieldStore.getPreview},convertedInput(){return this.fieldStore.convertedInput},inputIsValidated(){return this.dataInputFormStore.dataInputForm.fieldStore.isValidated},datashapeDescriptor(){if(!this.courseCfg||!this.courseCfg.dataShapes)return{course:"",dataShape:""};for(const t of this.courseCfg.dataShapes){const r=To.getDataShapeDescriptor(t.name);if(r.dataShape===this.dataShape.name)return r}return{course:"",dataShape:""}}},watch:{dataShape:{handler(){this.previewComponent||this.getImplementingViews()},immediate:!0},store:{handler(){this.convertInput()}},"dataShape.fields"(t){console.log(`[DataInputForm].watch(fields): newFields ${JSON.stringify(t)}`),console.log(`[DataInputForm].watch(fields): fields ${JSON.stringify(this.dataShape.fields)}`),this.fieldInputRefs=new Array(t.length).fill(null),console.log(`[DataInputForm].watch(fields): fieldRefs ${JSON.stringify(this.fieldInputRefs)}`)}},created(){this.uploading=!1,this.courseDB=Wb().getCourseDB(this.courseCfg.courseID),this.getCourseTags(),this.dataInputFormStore.setDataShape(this.dataShape),console.log(`[DataInputForm].created: fields: ${JSON.stringify(this.dataShape.fields)}`),this.fieldInputRefs=new Array(this.dataShape.fields.length).fill(null),this.previewComponent&&this.getImplementingViews()},beforeUnmount(){this.fieldInputRefs=[]},methods:{async updateTags(t){console.log(`[DataInputForm] tags updated: ${JSON.stringify(t)}`),this.tags=t},setFieldInputRef(t,r){for(console.log(`[DataInputForm].setFieldInputRef: index: ${r}`),r>=this.fieldInputRefs.length&&(this.fieldInputRefs=this.fieldInputRefs.concat(new Array(r-this.fieldInputRefs.length+1).fill(null)));this.fieldInputRefs[this.fieldInputRefs.length-1]===null;)this.fieldInputRefs.pop();this.fieldInputRefs[r]=t},async getCourseTags(){const t=await this.courseDB.getCourseTagStubs();this.autoCompleteSuggestions=t.rows.map(r=>r.doc.name)},expectedValidations(){return this.dataShape.fields.length},checkInput(){return!0},convertInput(){},inputContainsTranspositionFcns(){this.convertInput();for(const t in this.convertedInput)if(typeof this.convertedInput[t]=="function")return!0;return!1},objectContainsFunction(t){for(const r in t)if(typeof t[r]=="function")return!0;return!1},expandO(t){let r=[];if(this.objectContainsFunction(t)){for(const a in t)if(typeof t[a]=="function"){console.log(`[DataInputForm] Key ${a} is a function.`);const l=[];t[a]().forEach(u=>{let c={};c=fL.cloneDeep(t),c[a]=u,console.log(`[DataInputForm] Replaced Copy: ${JSON.stringify(c)}`),l.push(c)}),l.forEach(u=>{if(this.objectContainsFunction(u)){console.log("[DataInputForm] 2nd pass...");const c=this.expandO(u);r=r.concat(c)}else r.push(u)})}return r}else return[]},getTags(){const t=[];this.fieldInputs.forEach(a=>{if(a.generateTags){const l=a.generateTags();t.push(...l)}});const r=this.$refs.tagsInput.tags.map(a=>a.text);return t.concat(r)},getElo(){for(const t of this.fieldInputs)if(t.generateELO)return t.generateELO()},async submit(){if(this.checkInput()){console.log(`[DataInputForm] Store: ${JSON.stringify(this.fieldStore.inputs)}`),console.log(`[DataInputForm] ConvertedStore: ${JSON.stringify(this.convertedInput)}`),this.uploading=!0;let t=[];this.inputContainsTranspositionFcns()?(console.log(`[DataInputForm] Expanded input: ${JSON.stringify(this.expandO(this.convertedInput))}`),t=this.expandO(this.convertedInput)):(console.log("[DataInputForm] No Transposition fcn detected"),t=[this.convertedInput]);const r=await Promise.all(t.map(async a=>await this.courseDB.addNote(this.datashapeDescriptor.course,this.dataShape,a,(await x4()).getUsername(),this.getTags(),void 0,this.getElo())));if(r[0].status===Jt.ok){Vn({text:"Content added... Thank you!",status:Jt.ok});const a=this.$refs.tagsInput;a.tags.length&&(a.updateAvailableCourseTags(),a.tags=[]),this.reset()}else Vn({text:"A problem occurred. Content has not been added.",status:Jt.error}),console.error(`Error in DataInputForm.submit(). Result from addNote: ${JSON.stringify(r)}`),this.uploading=!1}},reset(){console.log("[DataInputForm].reset()"),this.uploading=!1,this.fieldInputs.forEach(t=>{t.clearData()}),this.fieldStore.$reset(),this.fieldInputs[0].focus(),this.convertInput()},getImplementingViews(){if(this.previewComponent){console.log("[DataInputForm] Getting previewComponent views"),this.shapeViews=this.previewComponent.views;return}for(const t of this.courseCfg.dataShapes){const r=To.getDataShapeDescriptor(t.name);if(console.log("[DataInputForm] descriptor",r),console.log("[DataInputForm] this.dataShape",this.dataShape),console.log("[DataInputForm] this.dataShape.name",this.dataShape.name),r.dataShape===this.dataShape.name){const a=tw.getCourse(r.course);this.shapeViews=[],a.getBaseQTypes().forEach(l=>{l.dataShapes[0].name===this.dataShape.name&&(this.shapeViews=this.shapeViews.concat(l.views))});for(const l of t.questionTypes){const u=To.getQuestionDescriptor(l);a.getQuestion(u.questionType).views.forEach(c=>{this.shapeViews=this.shapeViews.concat(c)})}}}},isFieldInput(t){return oL(t)}}}),UL={key:1};function $L(t,r,a,l,u,c){const f=vt("string-input"),p=vt("chess-puzzle-input"),y=vt("number-input"),S=vt("integer-input"),A=vt("markdown-input"),M=vt("midi-input"),w=vt("media-drag-drop-uploader"),_=vt("tags-input"),C=vt("v-icon"),m=vt("v-btn"),T=vt("v-form"),L=vt("v-col"),N=vt("card-browser"),B=vt("v-row"),W=vt("v-container");return st(),Rr(W,{fluid:""},{default:St(()=>[ft(B,null,{default:St(()=>[ft(L,{cols:"12",xl:"6"},{default:St(()=>[ft(T,{"ma-2":"",autocomplete:"off"},{default:St(()=>[(st(!0),_t(Gr,null,Ai(t.dataShape.fields,(G,R)=>(st(),_t("div",{key:t.dataShape.fields.indexOf(G)},[G.type===t.ftString?(st(),Rr(f,{key:0,ref_for:!0,ref:ye=>t.setFieldInputRef(ye,R),field:G,autofocus:R==0},null,8,["field","autofocus"])):G.type===t.chessPuzzle?(st(),Rr(p,{key:1,ref_for:!0,ref:ye=>t.setFieldInputRef(ye,R),field:G,autofocus:R==0},null,8,["field","autofocus"])):G.type===t.num?(st(),Rr(y,{key:2,ref_for:!0,ref:ye=>t.setFieldInputRef(ye,R),field:G,autofocus:R==0},null,8,["field","autofocus"])):G.type===t.int?(st(),Rr(S,{key:3,ref_for:!0,ref:ye=>t.setFieldInputRef(ye,R),field:G,autofocus:R==0},null,8,["field","autofocus"])):G.type===t.mkd?(st(),Rr(A,{key:4,ref_for:!0,ref:ye=>t.setFieldInputRef(ye,R),field:G,autofocus:R==0,"data-cy":"markdown-input"},null,8,["field","autofocus"])):G.type===t.midi?(st(),Rr(M,{key:5,ref_for:!0,ref:ye=>t.setFieldInputRef(ye,R),field:G,autofocus:R==0},null,8,["field","autofocus"])):G.type===t.uploader?(st(),Rr(w,{key:6,ref_for:!0,ref:ye=>t.setFieldInputRef(ye,R),field:G,autofocus:R==0},null,8,["field","autofocus"])):br("",!0)]))),128)),ft(_,{ref:"tagsInput","hide-submit":!0,"course-i-d":t.courseCfg.courseID,"card-i-d":""},null,8,["course-i-d"]),t.previewComponent?(st(),_t("div",UL,"Input validated: "+ir(t.inputIsValidated),1)):(st(),Rr(m,{key:0,"data-cy":"add-card-btn",class:"float-right",type:"submit",color:"primary",loading:t.uploading,disabled:!t.allowSubmit,onClick:su(t.submit,["prevent"])},{default:St(()=>[r[1]||(r[1]=Yt(" Add card ")),ft(C,{end:""},{default:St(()=>r[0]||(r[0]=[Yt("mdi-plus-circle")])),_:1})]),_:1},8,["loading","disabled","onClick"]))]),_:1})]),_:1}),ft(L,{cols:"12",xl:"6"},{default:St(()=>[t.inputIsValidated?(st(),Rr(N,{key:0,class:"ml-4",views:t.shapeViews,data:[t.previewInput]},null,8,["views","data"])):br("",!0)]),_:1})]),_:1})]),_:1})}const WL=ua(VL,[["render",$L]]),GL=qr({name:"CardPreviewList",components:{CardBrowser:k4,SkMouseTrap:S7},props:{parsedCards:{type:Array,required:!0,default:()=>[]},dataShape:{type:Object,required:!0},viewComponents:{type:Array,required:!1,default:()=>[]}},emits:["update:parsedCards","edit-card","delete-card"],data(){return{currentIndex:0,loading:!1,keyBindings:[],showDeleteConfirm:!1,dontAskAgain:!1,skipDeleteConfirmation:!1,shortcutsEnabled:!0}},computed:{currentCard(){return this.parsedCards.length===0||this.currentIndex>=this.parsedCards.length?null:this.parsedCards[this.currentIndex]},currentViewData(){return this.currentCard?{Input:this.currentCard.markdown}:{Input:""}}},mounted(){this.setupKeyBindings()},beforeUnmount(){this.shortcutsEnabled&&this.keyBindings.forEach(t=>{yu.removeBinding(t.hotkey)})},methods:{nextCard(){this.currentIndex<this.parsedCards.length-1&&this.currentIndex++},prevCard(){this.currentIndex>0&&this.currentIndex--},showCard(t){t>=0&&t<this.parsedCards.length&&(this.currentIndex=t)},setupKeyBindings(){this.keyBindings=[{command:"Previous Card",hotkey:"left",callback:()=>(this.prevCard(),!1)},{command:"Next Card",hotkey:"right",callback:()=>(this.nextCard(),!1)},{command:"Delete Card",hotkey:"del",callback:()=>(this.promptDelete(),!1)},{command:"Edit Card",hotkey:"e",callback:()=>(this.editCurrentCard(),!1)}],this.shortcutsEnabled&&yu.addBinding(this.keyBindings)},enableShortcuts(){this.shortcutsEnabled||(this.shortcutsEnabled=!0,yu.addBinding(this.keyBindings),console.log("[CardPreviewList] Keyboard shortcuts enabled"))},disableShortcuts(){this.shortcutsEnabled&&(this.shortcutsEnabled=!1,this.keyBindings.forEach(t=>{yu.removeBinding(t.hotkey)}),console.log("[CardPreviewList] Keyboard shortcuts disabled"))},toggleShortcuts(t){t?this.enableShortcuts():this.disableShortcuts()},promptDelete(){this.currentCard&&(this.skipDeleteConfirmation?this.deleteCurrentCard():this.showDeleteConfirm=!0)},cancelDelete(){this.showDeleteConfirm=!1},confirmDelete(){this.dontAskAgain&&(this.skipDeleteConfirmation=!0),this.showDeleteConfirm=!1,this.deleteCurrentCard()},deleteCurrentCard(){if(!this.currentCard)return;const t=[...this.parsedCards];t.splice(this.currentIndex,1),this.$emit("update:parsedCards",t),this.$emit("delete-card",this.currentIndex),this.currentIndex>=t.length&&t.length>0&&(this.currentIndex=t.length-1)},editCurrentCard(){this.currentCard&&this.$emit("edit-card",this.currentCard,this.currentIndex)}}}),YL={class:"card-preview-list"},KL={class:"d-flex align-center"},XL={class:"text-subtitle-1 mr-2"},QL={key:0,class:"d-flex justify-center align-center my-4"},ZL={key:1},jL={key:0},JL={key:0},eO={key:1},tO={class:"markdown-content"},rO={class:"card-metadata mt-2"},nO={class:"d-flex flex-wrap gap-1"},iO={key:0,class:"mt-2 text-caption"},sO={key:1,class:"text-center pa-4"};function aO(t,r,a,l,u,c){const f=vt("v-card-title"),p=vt("v-checkbox"),y=vt("v-card-text"),S=vt("v-spacer"),A=vt("v-btn"),M=vt("v-card-actions"),w=vt("v-card"),_=vt("v-dialog"),C=vt("sk-mouse-trap"),m=vt("v-progress-circular"),T=vt("card-browser"),L=vt("v-sheet"),N=vt("v-chip"),B=vt("v-icon");return st(),_t("div",YL,[ft(_,{modelValue:t.showDeleteConfirm,"onUpdate:modelValue":r[1]||(r[1]=W=>t.showDeleteConfirm=W),"max-width":"400px"},{default:St(()=>[ft(w,null,{default:St(()=>[ft(f,{class:"text-h5"},{default:St(()=>r[2]||(r[2]=[Yt("Remove Card")])),_:1}),ft(y,null,{default:St(()=>[r[3]||(r[3]=pt("p",null,"Are you sure you want to remove this card?",-1)),ft(p,{modelValue:t.dontAskAgain,"onUpdate:modelValue":r[0]||(r[0]=W=>t.dontAskAgain=W),label:"Don't ask me again","hide-details":"",class:"mt-2"},null,8,["modelValue"])]),_:1}),ft(M,null,{default:St(()=>[ft(S),ft(A,{color:"grey-darken-1",variant:"text",onClick:t.cancelDelete},{default:St(()=>r[4]||(r[4]=[Yt("Cancel")])),_:1},8,["onClick"]),ft(A,{color:"error",onClick:t.confirmDelete},{default:St(()=>r[5]||(r[5]=[Yt("Remove")])),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),t.parsedCards.length>0?(st(),Rr(w,{key:0,class:"mb-4"},{default:St(()=>[ft(f,{class:"d-flex align-center justify-space-between"},{default:St(()=>[r[6]||(r[6]=pt("span",null,"Card Preview",-1)),pt("div",KL,[pt("div",XL,ir(t.currentIndex+1)+" of "+ir(t.parsedCards.length),1),ft(C)])]),_:1}),ft(y,null,{default:St(()=>[t.loading?(st(),_t("div",QL,[ft(m,{indeterminate:"",color:"primary"})])):(st(),_t("div",ZL,[t.currentCard?(st(),_t("div",jL,[ft(L,{class:"card-content pa-4 mb-4",rounded:"",border:""},{default:St(()=>[t.viewComponents&&t.viewComponents.length>0?(st(),_t("div",JL,[ft(T,{views:t.viewComponents,data:[t.currentViewData],"suppress-spinner":!0},null,8,["views","data"])])):(st(),_t("div",eO,[r[7]||(r[7]=pt("div",{class:"mb-2 font-weight-bold"},"Card content:",-1)),pt("div",tO,ir(t.currentCard.markdown),1)]))]),_:1}),pt("div",rO,[pt("div",nO,[(st(!0),_t(Gr,null,Ai(t.currentCard.tags,W=>(st(),Rr(N,{key:W,size:"small",color:"primary",variant:"outlined",class:"mr-1 mb-1"},{default:St(()=>[Yt(ir(W),1)]),_:2},1024))),128))]),t.currentCard.elo!==void 0?(st(),_t("div",iO,"ELO: "+ir(t.currentCard.elo),1)):br("",!0)])])):(st(),_t("div",sO,"No card selected or available to preview."))]))]),_:1}),ft(M,{class:"px-4 pb-4"},{default:St(()=>[ft(A,{variant:"outlined",icon:"",disabled:t.currentIndex===0||t.loading,onClick:t.prevCard},{default:St(()=>[ft(B,null,{default:St(()=>r[8]||(r[8]=[Yt("mdi-chevron-left")])),_:1})]),_:1},8,["disabled","onClick"]),ft(S),ft(A,{variant:"tonal",color:"error","prepend-icon":"mdi-delete",class:"mx-2",disabled:!t.currentCard||t.loading,onClick:t.promptDelete},{default:St(()=>r[9]||(r[9]=[Yt(" Remove ")])),_:1},8,["disabled","onClick"]),ft(A,{variant:"tonal",color:"primary","prepend-icon":"mdi-pencil",class:"mx-2",disabled:!t.currentCard||t.loading,onClick:t.editCurrentCard},{default:St(()=>r[10]||(r[10]=[Yt(" Edit ")])),_:1},8,["disabled","onClick"]),ft(S),ft(A,{variant:"outlined",icon:"",disabled:t.currentIndex>=t.parsedCards.length-1||t.loading,onClick:t.nextCard},{default:St(()=>[ft(B,null,{default:St(()=>r[11]||(r[11]=[Yt("mdi-chevron-right")])),_:1})]),_:1},8,["disabled","onClick"])]),_:1})]),_:1})):br("",!0)])}const oO=ua(GL,[["render",aO],["__scopeId","data-v-41613480"]]),lO=qr({name:"BulkImportView",components:{CardPreviewList:oO},props:{courseCfg:{type:Object,required:!0}},data(){return{bulkText:"",parsedCards:[],parsingComplete:!1,importAttempted:!1,results:[],processing:!1,courseDB:null,dataShape:wu[0],cardViewComponents:[],editingCard:null,editingCardIndex:-1,showEditDialog:!1,editedMarkdown:"",editedTags:[],editedElo:void 0,newTagText:""}},computed:{uniqueTags(){if(!this.parsedCards||this.parsedCards.length===0)return[];const t=this.parsedCards.reduce((r,a)=>(a.tags&&a.tags.length>0&&r.push(...a.tags),r),[]);return[...new Set(t)].sort()}},created(){this.courseCfg?.courseID?(this.courseDB=Wb().getCourseDB(this.courseCfg.courseID),!this.courseCfg.dataShapes||this.courseCfg.dataShapes.length===0?(console.error("[BulkImportView] Course config does not contain any dataShapes."),Vn({text:"Course configuration has no dataShapes. Bulk import may not work correctly.",status:Jt.warning})):this.initializeCardPreviewComponents()):(console.error("[BulkImportView] Course config or Course ID is missing."),Vn({text:"Course configuration is missing. Cannot initialize bulk import.",status:Jt.error}))},methods:{handleDeleteCard(t){console.log(`[BulkImportView] Card at index ${t} was deleted`),Vn({text:"Card removed from import list",status:Jt.ok})},handleEditCard(t,r){this.$refs.cardPreviewList&&this.$refs.cardPreviewList.toggleShortcuts(!1),this.editingCard={...t},this.editingCardIndex=r,this.editedMarkdown=t.markdown,this.editedTags=[...t.tags],this.editedElo=t.elo,this.showEditDialog=!0,this.$nextTick(()=>{this.$refs.markdownTextarea&&this.$refs.markdownTextarea.$el.querySelector("textarea")?.focus()})},saveEditedCard(){if(this.editingCardIndex<0||!this.editingCard)return;const t={markdown:this.editedMarkdown,tags:this.editedTags,elo:this.editedElo},r=[...this.parsedCards];r[this.editingCardIndex]=t,this.parsedCards=r,this.closeEditDialog(),Vn({text:"Card updated successfully",status:Jt.ok})},closeEditDialog(){this.showEditDialog=!1,this.editingCard=null,this.editingCardIndex=-1,this.editedMarkdown="",this.editedTags=[],this.editedElo=void 0,setTimeout(()=>{this.$refs.cardPreviewList&&this.$refs.cardPreviewList.toggleShortcuts(!0)},100)},addTag(){const t=this.newTagText.trim();t&&!this.editedTags.includes(t)&&(this.editedTags.push(t),this.newTagText="")},removeTag(t){this.editedTags=this.editedTags.filter(r=>r!==t)},initializeCardPreviewComponents(){const t=this.courseCfg?.dataShapes?.[0];if(!t)return;this.dataShape.name!==wu[0].name&&(this.dataShape=wu[0]);const r=To.getDataShapeDescriptor(t.name),a=tw.getCourse(r.course);if(a){this.cardViewComponents=[],a.getBaseQTypes().forEach(l=>{l.dataShapes[0].name===this.dataShape?.name&&(this.cardViewComponents=this.cardViewComponents.concat(l.views))});for(const l of t.questionTypes){const u=To.getQuestionDescriptor(l),c=a.getQuestion(u.questionType)?.views||[];this.cardViewComponents=this.cardViewComponents.concat(c)}console.log(`[BulkImportView] Loaded ${this.cardViewComponents.length} view components for card preview`)}},resetToInputStage(){this.parsingComplete=!1,this.parsedCards=[],this.importAttempted=!1},startNewBulkImport(){this.bulkText="",this.results=[],this.parsedCards=[],this.parsingComplete=!1,this.importAttempted=!1},handleInitialParse(){if(!this.courseDB){Vn({text:"Database connection not available. Cannot process cards.",status:Jt.error});return}if(B7(this.bulkText)){this.processing=!0,this.results=[],this.parsedCards=[],this.parsingComplete=!1;try{if(this.parsedCards=R7(this.bulkText),this.parsedCards.length===0){Vn({text:'No cards could be parsed from the input. Please check the format and ensure cards are separated by two "---" lines and that cards have content.',status:Jt.warning}),this.processing=!1;return}this.cardViewComponents.length===0&&this.initializeCardPreviewComponents(),this.parsingComplete=!0,console.log(`[BulkImportView] Successfully parsed ${this.parsedCards.length} cards for preview`)}catch(t){console.error("[BulkImportView] Error parsing bulk text:",t),Vn({text:`Error parsing cards: ${t instanceof Error?t.message:"Unknown error"}`,status:Jt.error})}finally{this.processing=!1}}},async confirmAndImportCards(){if(!this.courseDB){Vn({text:"Database connection lost before import.",status:Jt.error}),this.processing=!1;return}if(this.parsedCards.length===0){Vn({text:"No parsed cards to import.",status:Jt.warning}),this.processing=!1;return}if(!this.courseCfg?.dataShapes||this.courseCfg.dataShapes.length===0){Vn({text:"This course has no data shapes configured. Cannot import cards.",status:Jt.error}),this.processing=!1;return}this.processing=!0,this.results=[];const r=(await x4()).getUsername(),a=wu[0];if(!a){Vn({text:"Critical: Could not find BlanksCardDataShapes. Aborting import.",status:Jt.error}),this.processing=!1;return}const l=this.courseCfg?.dataShapes?.[0];if(!l){Vn({text:"Critical: No data shapes found in course configuration. Aborting import.",status:Jt.error}),this.processing=!1;return}const u=To.getDataShapeDescriptor(l.name).course,c={dataShape:a,courseCode:u,userName:r},f=b7(c);if(!f.isValid){Vn({text:f.errorMessage||"Invalid processor configuration for import.",status:Jt.error}),this.processing=!1;return}console.log("[BulkImportView] Starting import of parsed cards:",{courseID:this.courseCfg.courseID,dataShapeToUse:a.name,courseCode:u,numberOfCards:this.parsedCards.length});try{this.results=await y7(this.parsedCards,this.courseDB,c)}catch(p){console.error("[BulkImportView] Error importing parsed cards:",p),this.results.push({originalText:"Bulk Operation Error",status:"error",message:`Critical error during import: ${p instanceof Error?p.message:"Unknown error"}`})}finally{this.processing=!1,this.importAttempted=!0}this.results.every(p=>p.status==="success")&&this.results.length>0?Vn({text:`${this.results.length} card(s) imported successfully!`,status:Jt.ok}):this.results.some(p=>p.status==="error")&&Vn({text:"Some cards failed to import. Please review the results below.",status:Jt.warning})}}}),uO={key:0},cO={key:1,class:"text--secondary"},hO={class:"my-4"},fO={class:"d-flex align-center mb-2"},dO={class:"d-flex flex-wrap"},pO={key:0,class:"ml-6"},gO={key:1,class:"ml-6"},vO={key:2,class:"ml-6"},mO={style:{"white-space":"pre-wrap","background-color":"#f5f5f5",padding:"5px"}};function _O(t,r,a,l,u,c){const f=vt("v-textarea"),p=vt("v-col"),y=vt("v-row"),S=vt("v-card-title"),A=vt("v-chip"),M=vt("v-card-text"),w=vt("v-card"),_=vt("card-preview-list"),C=vt("v-text-field"),m=vt("v-btn"),T=vt("v-form"),L=vt("v-spacer"),N=vt("v-tooltip"),B=vt("v-card-actions"),W=vt("v-dialog"),G=vt("v-icon"),R=vt("v-list-subheader"),ye=vt("v-list-item-title"),q=vt("v-list-item-subtitle"),se=vt("v-list-item"),ve=vt("v-list"),he=vt("v-container");return st(),Rr(he,{fluid:""},{default:St(()=>[t.parsingComplete?br("",!0):(st(),Rr(y,{key:0},{default:St(()=>[ft(p,{cols:"12"},{default:St(()=>[ft(f,{modelValue:t.bulkText,"onUpdate:modelValue":r[0]||(r[0]=ce=>t.bulkText=ce),label:"Bulk Card Input",placeholder:`Paste card data here.
|
|
318
|
+
Separate cards with two consecutive '---' lines on their own lines.
|
|
319
|
+
Example:
|
|
320
|
+
Card 1 Question
|
|
321
|
+
{{blank}}
|
|
322
|
+
tags: tagA, tagB
|
|
323
|
+
elo: 1500
|
|
324
|
+
---
|
|
325
|
+
---
|
|
326
|
+
Card 2 Question
|
|
327
|
+
Another {{blank}}
|
|
328
|
+
elo: 1200
|
|
329
|
+
tags: tagC`,rows:"15",variant:"outlined","data-cy":"bulk-import-textarea"},null,8,["modelValue"])]),_:1})]),_:1})),t.parsingComplete?(st(),Rr(y,{key:1,class:"mb-4"},{default:St(()=>[ft(p,{cols:"12",md:"4"},{default:St(()=>[ft(w,{border:""},{default:St(()=>[ft(S,null,{default:St(()=>r[6]||(r[6]=[Yt("Parsing Summary")])),_:1}),ft(M,null,{default:St(()=>[pt("p",null,[pt("strong",null,ir(t.parsedCards.length),1),r[7]||(r[7]=Yt(" card(s) parsed and ready for import. "))]),t.parsedCards.length>0?(st(),_t("div",uO,[r[8]||(r[8]=pt("strong",null,"Tags Found:",-1)),t.uniqueTags.length>0?(st(!0),_t(Gr,{key:0},Ai(t.uniqueTags,ce=>(st(),Rr(A,{key:ce,class:"mr-1 mb-1",size:"small",label:""},{default:St(()=>[Yt(ir(ce),1)]),_:2},1024))),128)):(st(),_t("span",cO,"No unique tags identified across parsed cards."))])):br("",!0)]),_:1})]),_:1})]),_:1}),ft(p,{cols:"12",md:"8"},{default:St(()=>[t.parsedCards.length>0?(st(),Rr(_,{key:0,ref:"cardPreviewList","parsed-cards":t.parsedCards,"onUpdate:parsedCards":r[1]||(r[1]=ce=>t.parsedCards=ce),"data-shape":t.dataShape,"view-components":t.cardViewComponents,onEditCard:t.handleEditCard,onDeleteCard:t.handleDeleteCard},null,8,["parsed-cards","data-shape","view-components","onEditCard","onDeleteCard"])):br("",!0)]),_:1})]),_:1})):br("",!0),ft(W,{modelValue:t.showEditDialog,"onUpdate:modelValue":r[5]||(r[5]=ce=>t.showEditDialog=ce),"max-width":"800px"},{default:St(()=>[ft(w,null,{default:St(()=>[ft(S,null,{default:St(()=>r[9]||(r[9]=[Yt("Edit Card")])),_:1}),ft(M,null,{default:St(()=>[ft(T,{onSubmit:su(t.saveEditedCard,["prevent"]),onKeydown:lh(t.closeEditDialog,["esc"])},{default:St(()=>[ft(f,{ref:"markdownTextarea",modelValue:t.editedMarkdown,"onUpdate:modelValue":r[2]||(r[2]=ce=>t.editedMarkdown=ce),label:"Card Content",rows:"6","auto-grow":"",variant:"outlined",onKeydown:lh(su(t.saveEditedCard,["ctrl"]),["enter"])},null,8,["modelValue","onKeydown"]),pt("div",hO,[pt("div",fO,[r[11]||(r[11]=pt("h3",{class:"text-subtitle-1 mr-2"},"Tags",-1)),ft(C,{modelValue:t.newTagText,"onUpdate:modelValue":r[3]||(r[3]=ce=>t.newTagText=ce),density:"compact","hide-details":"",placeholder:"Add a tag",variant:"outlined",class:"mr-2",onKeydown:[lh(su(t.addTag,["prevent"]),["enter"]),lh(t.closeEditDialog,["esc"])]},null,8,["modelValue","onKeydown"]),ft(m,{size:"small",color:"primary",variant:"text",onClick:t.addTag},{default:St(()=>r[10]||(r[10]=[Yt("Add")])),_:1},8,["onClick"])]),pt("div",dO,[(st(!0),_t(Gr,null,Ai(t.editedTags,ce=>(st(),Rr(A,{key:ce,closable:"",class:"mr-1 mb-1","onClick:close":de=>t.removeTag(ce)},{default:St(()=>[Yt(ir(ce),1)]),_:2},1032,["onClick:close"]))),128))])]),ft(C,{modelValue:t.editedElo,"onUpdate:modelValue":r[4]||(r[4]=ce=>t.editedElo=ce),modelModifiers:{number:!0},label:"ELO Rating (optional)",type:"number",variant:"outlined",min:"0",max:"3000"},null,8,["modelValue"])]),_:1},8,["onSubmit","onKeydown"])]),_:1}),ft(B,null,{default:St(()=>[ft(L),ft(m,{color:"grey",variant:"text",onClick:t.closeEditDialog},{default:St(()=>[r[13]||(r[13]=Yt(" Cancel ")),ft(N,{activator:"parent",location:"top"},{default:St(()=>r[12]||(r[12]=[Yt("Press ESC")])),_:1})]),_:1},8,["onClick"]),ft(m,{color:"primary",onClick:t.saveEditedCard},{default:St(()=>[r[15]||(r[15]=Yt(" Save ")),ft(N,{activator:"parent",location:"top"},{default:St(()=>r[14]||(r[14]=[Yt("Press Ctrl+Enter")])),_:1})]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),ft(y,null,{default:St(()=>[ft(p,{cols:"12"},{default:St(()=>[t.parsingComplete?br("",!0):(st(),Rr(m,{key:0,color:"primary",loading:t.processing,disabled:!t.bulkText.trim()||t.processing,"data-cy":"bulk-import-parse-btn",onClick:t.handleInitialParse},{default:St(()=>[r[17]||(r[17]=Yt(" Parse Cards ")),ft(G,{end:""},{default:St(()=>r[16]||(r[16]=[Yt("mdi-play-circle-outline")])),_:1})]),_:1},8,["loading","disabled","onClick"])),t.parsingComplete?(st(),_t(Gr,{key:1},[ft(m,{color:"primary",class:"mr-2",loading:t.processing,disabled:t.parsedCards.length===0||t.processing||t.importAttempted,"data-cy":"bulk-import-confirm-btn",onClick:t.confirmAndImportCards},{default:St(()=>[Yt(" Confirm and Import "+ir(t.parsedCards.length)+" Card(s) ",1),ft(G,{end:""},{default:St(()=>r[18]||(r[18]=[Yt("mdi-check-circle-outline")])),_:1})]),_:1},8,["loading","disabled","onClick"]),t.importAttempted?br("",!0):(st(),Rr(m,{key:0,variant:"outlined",color:"grey-darken-1",disabled:t.processing,"data-cy":"bulk-import-edit-again-btn",onClick:t.resetToInputStage},{default:St(()=>[ft(G,{start:""},{default:St(()=>r[19]||(r[19]=[Yt("mdi-pencil")])),_:1}),r[20]||(r[20]=Yt(" Back to bulk-editor. "))]),_:1},8,["disabled","onClick"])),t.importAttempted?(st(),Rr(m,{key:1,variant:"outlined",color:"blue-darken-1",disabled:t.processing,"data-cy":"bulk-import-add-another-btn",onClick:t.startNewBulkImport},{default:St(()=>[ft(G,{start:""},{default:St(()=>r[21]||(r[21]=[Yt("mdi-plus-circle-outline")])),_:1}),r[22]||(r[22]=Yt(" Add Another Bulk Import "))]),_:1},8,["disabled","onClick"])):br("",!0)],64)):br("",!0)]),_:1})]),_:1}),t.results.length>0?(st(),Rr(y,{key:2},{default:St(()=>[ft(p,{cols:"12"},{default:St(()=>[ft(ve,{density:"compact"},{default:St(()=>[ft(R,null,{default:St(()=>r[23]||(r[23]=[Yt("Import Results")])),_:1}),(st(!0),_t(Gr,null,Ai(t.results,(ce,de)=>(st(),Rr(se,{key:de,class:Yb({"lime-lighten-5":ce.status==="success","red-lighten-5":ce.status==="error","force-dark-text":ce.status==="success"||ce.status==="error"})},{default:St(()=>[ft(ye,null,{default:St(()=>[ft(G,{color:ce.status==="success"?"green":"red"},{default:St(()=>[Yt(ir(ce.status==="success"?"mdi-check-circle":"mdi-alert-circle"),1)]),_:2},1032,["color"]),Yt(" Card "+ir(de+1),1)]),_:2},1024),ft(q,null,{default:St(()=>[ce.message?(st(),_t("div",pO,ir(ce.message),1)):br("",!0),ce.cardId?(st(),_t("div",gO,"ID: "+ir(ce.cardId),1)):br("",!0),ce.status==="error"&&ce.originalText?(st(),_t("details",vO,[r[24]||(r[24]=pt("summary",null,"Original Input",-1)),pt("pre",mO,ir(ce.originalText),1)])):br("",!0)]),_:2},1024)]),_:2},1032,["class"]))),128))]),_:1})]),_:1})]),_:1})):br("",!0)]),_:1})}const bO=ua(lO,[["render",_O],["__scopeId","data-v-3689f51b"]]),yO=qr({name:"CourseEditor",components:{DataInputForm:WL,BulkImportView:bO},props:{course:{type:String,required:!0}},data(){return{registeredDataShapes:[],dataShapes:[],selectedShape:xu.dataShapes[0].name,courseConfig:null,dataShape:wu[0],loading:!0,currentTab:"single",dataInputFormStore:_7()}},watch:{selectedShape:{handler(t){t&&(this.dataShape=this.getDataShape(t),this.dataInputFormStore.setDataShape(this.dataShape),this.dataInputFormStore.dataInputForm.course=this.courseConfig)}}},async created(){this.courseConfig=await Wb().getCoursesDB().getCourseConfig(this.course),tw.courses.forEach(t=>{t.questions.forEach(r=>{r.dataShapes.forEach(a=>{this.dataShapes.push(a)})})}),this.courseConfig&&this.courseConfig.dataShapes&&this.courseConfig.dataShapes.forEach(t=>{this.registeredDataShapes.push(this.dataShapes.find(r=>r.name===To.getDataShapeDescriptor(t.name).dataShape))}),this.loading=!1},methods:{getDataShape(t){return this.dataShapes.find(r=>r.name===t)}}}),wO={key:0,class:"courseEditor"},SO={key:0},CO={key:1},xO={class:"text-h4"};function kO(t,r,a,l,u,c){const f=vt("v-progress-circular"),p=vt("router-link"),y=vt("v-tab"),S=vt("v-tabs"),A=vt("v-select"),M=vt("data-input-form"),w=vt("v-container"),_=vt("v-window-item"),C=vt("bulk-import-view"),m=vt("component-registration"),T=vt("navigation-strategy-editor"),L=vt("v-window");return t.course?(st(),_t("div",wO,[t.loading?(st(),_t("div",SO,[ft(f,{indeterminate:"",color:"secondary"})])):(st(),_t("div",CO,[pt("h1",xO,[ft(p,{to:"/q"},{default:St(()=>r[3]||(r[3]=[Yt("Quilts")])),_:1}),r[4]||(r[4]=Yt(" / ")),ft(p,{to:`/q/${t.courseConfig?t.courseConfig.name:t.course}`},{default:St(()=>[Yt(ir(t.courseConfig?.name),1)]),_:1},8,["to"])]),ft(S,{modelValue:t.currentTab,"onUpdate:modelValue":r[0]||(r[0]=N=>t.currentTab=N),"bg-color":"primary",grow:""},{default:St(()=>[ft(y,{value:"single"},{default:St(()=>r[5]||(r[5]=[Yt("Single Card Input")])),_:1}),ft(y,{value:"bulk"},{default:St(()=>r[6]||(r[6]=[Yt("Bulk Import")])),_:1}),ft(y,{value:"registration"},{default:St(()=>r[7]||(r[7]=[Yt("Navigation")])),_:1}),ft(y,{value:"registration"},{default:St(()=>r[8]||(r[8]=[Yt("Component Registration")])),_:1})]),_:1},8,["modelValue"]),ft(L,{modelValue:t.currentTab,"onUpdate:modelValue":r[2]||(r[2]=N=>t.currentTab=N)},{default:St(()=>[ft(_,{value:"single"},{default:St(()=>[ft(w,{fluid:""},{default:St(()=>[ft(A,{modelValue:t.selectedShape,"onUpdate:modelValue":r[1]||(r[1]=N=>t.selectedShape=N),label:"What kind of content are you adding?",items:t.registeredDataShapes.map(N=>N.name),class:"mt-4"},null,8,["modelValue","items"]),t.selectedShape!==""&&t.courseConfig&&t.dataShape?(st(),Rr(M,{key:0,"data-shape":t.dataShape,"course-cfg":t.courseConfig},null,8,["data-shape","course-cfg"])):br("",!0)]),_:1})]),_:1}),ft(_,{value:"bulk"},{default:St(()=>[ft(w,{fluid:""},{default:St(()=>[t.courseConfig?(st(),Rr(C,{key:0,"course-cfg":t.courseConfig,class:"mt-4"},null,8,["course-cfg"])):br("",!0)]),_:1})]),_:1}),ft(_,{value:"registration"},{default:St(()=>[ft(w,{fluid:""},{default:St(()=>[ft(m,{course:t.course,class:"mt-4"},null,8,["course"])]),_:1})]),_:1}),ft(_,{value:"navigation"},{default:St(()=>[ft(w,{fluid:""},{default:St(()=>[ft(T,{"course-id":t.course},null,8,["course-id"])]),_:1})]),_:1})]),_:1},8,["modelValue"])]))])):br("",!0)}const TO=ua(yO,[["render",kO],["__scopeId","data-v-e17c0876"]]);export{bO as B,TO as C,WL as D};
|
|
330
|
+
//# sourceMappingURL=edit-ui.es-DiUxqbgF.js.map
|