@vue-skuilder/platform-ui 0.2.35 → 0.2.36
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/assets/{About-BWM7KlDK.js → About-74htcNLT.js} +2 -2
- package/dist/assets/{About-BWM7KlDK.js.map → About-74htcNLT.js.map} +1 -1
- package/dist/assets/AdminDashboard-B00qno2M.js +2 -0
- package/dist/assets/{AdminDashboard-CO2rxkF5.js.map → AdminDashboard-B00qno2M.js.map} +1 -1
- package/dist/assets/AdminLearner-SJNtSyJ_.js +2 -0
- package/dist/assets/{AdminLearner-CZO2Hlk1.js.map → AdminLearner-SJNtSyJ_.js.map} +1 -1
- package/dist/assets/BaseUserDB-CV2ZPZOR.js +1 -0
- package/dist/assets/ClassroomCtrlPanel-BSAG3h8B.js +2 -0
- package/dist/assets/{ClassroomCtrlPanel-cj6bokz5.js.map → ClassroomCtrlPanel-BSAG3h8B.js.map} +1 -1
- package/dist/assets/{Classrooms-BIC1PGz0.js → Classrooms-DXNEbtsM.js} +3 -3
- package/dist/assets/{Classrooms-BIC1PGz0.js.map → Classrooms-DXNEbtsM.js.map} +1 -1
- package/dist/assets/CouchDBSyncStrategy-BjM7ROXC.js +1 -0
- package/dist/assets/CourseRouter-CsVa_92r.js +7 -0
- package/dist/assets/{CourseRouter-CMMxD9us.js.map → CourseRouter-CsVa_92r.js.map} +1 -1
- package/dist/assets/CourseSyncService-CPU_Ll1h.js +1 -0
- package/dist/assets/CourseWare-BTFRjgBR-DBp_fIwH.js +3 -0
- package/dist/assets/{CourseWare-BTFRjgBR-C3wi5YHa.js.map → CourseWare-BTFRjgBR-DBp_fIwH.js.map} +1 -1
- package/dist/assets/{Courses-Dw7mgMnI.js → Courses-CB6GGtdm.js} +3 -3
- package/dist/assets/{Courses-Dw7mgMnI.js.map → Courses-CB6GGtdm.js.map} +1 -1
- package/dist/assets/EloModeration-DUBgs-Vh.js +2 -0
- package/dist/assets/{EloModeration-COgCrvb8.js.map → EloModeration-DUBgs-Vh.js.map} +1 -1
- package/dist/assets/{JoinCode-Fu9Tks7r.js → JoinCode-BBvYapCA.js} +2 -2
- package/dist/assets/{JoinCode-Fu9Tks7r.js.map → JoinCode-BBvYapCA.js.map} +1 -1
- package/dist/assets/MarkdownRenderer-WG9YrHpe.js +1 -0
- package/dist/assets/MarkdownRenderer-borh39Lq.js +53 -0
- package/dist/assets/MarkdownRenderer-borh39Lq.js.map +1 -0
- package/dist/assets/NewCourseDialog-DBgFVnt3.js +2 -0
- package/dist/assets/{NewCourseDialog-C11dSwWM.js.map → NewCourseDialog-DBgFVnt3.js.map} +1 -1
- package/dist/assets/PipelineDebugger-BHaqzqZw.js +177 -0
- package/dist/assets/PipelineDebugger-BHaqzqZw.js.map +1 -0
- package/dist/assets/PouchDataLayerProvider-DxsnSIKd.js +2 -0
- package/dist/assets/PouchDataLayerProvider-DxsnSIKd.js.map +1 -0
- package/dist/assets/{ReleaseNotes-CeTkuF5d.js → ReleaseNotes-Dg6mLL1C.js} +2 -2
- package/dist/assets/{ReleaseNotes-CeTkuF5d.js.map → ReleaseNotes-Dg6mLL1C.js.map} +1 -1
- package/dist/assets/RequestPasswordReset-CcFMTnTc.js +2 -0
- package/dist/assets/{RequestPasswordReset-vTzfGItp.js.map → RequestPasswordReset-CcFMTnTc.js.map} +1 -1
- package/dist/assets/ResetPassword-Dw_cBJU2.js +2 -0
- package/dist/assets/{ResetPassword-CmGaVYsI.js.map → ResetPassword-Dw_cBJU2.js.map} +1 -1
- package/dist/assets/StaticDataLayerProvider-CtgU3VBh.js +2 -0
- package/dist/assets/StaticDataLayerProvider-CtgU3VBh.js.map +1 -0
- package/dist/assets/Study-DDsGQCTJ.js +2 -0
- package/dist/assets/{Study-CkJvraIv.js.map → Study-DDsGQCTJ.js.map} +1 -1
- package/dist/assets/TagInformation-DBLoXA2a.js +2 -0
- package/dist/assets/{TagInformation-xZcQ1C1t.js.map → TagInformation-DBLoXA2a.js.map} +1 -1
- package/dist/assets/User-DfXUXjFb.js +2 -0
- package/dist/assets/User-DfXUXjFb.js.map +1 -0
- package/dist/assets/UserDBDebugger-DPqlc4O_.js +23 -0
- package/dist/assets/UserDBDebugger-DPqlc4O_.js.map +1 -0
- package/dist/assets/UserDBDebugger-xmycWjck.js +1 -0
- package/dist/assets/UserStats-C04YVYv7.js +2 -0
- package/dist/assets/{UserStats-CioNBbmL.js.map → UserStats-C04YVYv7.js.map} +1 -1
- package/dist/assets/VerifyEmail-Y05BSR57.js +2 -0
- package/dist/assets/{VerifyEmail-Bh-T9191.js.map → VerifyEmail-Y05BSR57.js.map} +1 -1
- package/dist/assets/admin-DcFjvYJw.js +21 -0
- package/dist/assets/admin-DcFjvYJw.js.map +1 -0
- package/dist/assets/chess-E2uOAyQS-BZi0vihz.js +7 -0
- package/dist/assets/{chess-E2uOAyQS-C8213VIQ.js.map → chess-E2uOAyQS-BZi0vihz.js.map} +1 -1
- package/dist/assets/chess-Lfm7Fsvs-DgN08Qx9.js +1 -0
- package/dist/assets/contentSource-DwznMSMs.js +34 -0
- package/dist/assets/contentSource-DwznMSMs.js.map +1 -0
- package/dist/assets/defineProperty-y9rbOPYz.js +1 -0
- package/dist/assets/dist-BcwaOf54.js +1 -0
- package/dist/assets/dist-BsRvt0gH.js +38 -0
- package/dist/assets/dist-BsRvt0gH.js.map +1 -0
- package/dist/assets/dist-CAHkbl3M.js +18 -0
- package/dist/assets/dist-CAHkbl3M.js.map +1 -0
- package/dist/assets/dist-CgW7D_Gh.js +1 -0
- package/dist/assets/dist-Dnehy0sn.js +1 -0
- package/dist/assets/dist-Dp6eBE2S.js +64 -0
- package/dist/assets/dist-Dp6eBE2S.js.map +1 -0
- package/dist/assets/edit-ui.es-BWqvElsJ.js +1 -0
- package/dist/assets/edit-ui.es-UaQFL_My.js +41 -0
- package/dist/assets/edit-ui.es-UaQFL_My.js.map +1 -0
- package/dist/assets/elo-B5qCwvSC.js +2 -0
- package/dist/assets/elo-B5qCwvSC.js.map +1 -0
- package/dist/assets/elo-COgu6Hu5.js +2 -0
- package/dist/assets/elo-COgu6Hu5.js.map +1 -0
- package/dist/assets/elo-Cwa8a3Yo.js +1 -0
- package/dist/assets/eloDistance-BV7vfiK5.js +2 -0
- package/dist/assets/eloDistance-BV7vfiK5.js.map +1 -0
- package/dist/assets/eloDistance-MReQeAuj.js +1 -0
- package/dist/assets/french-Dk7YG8Td-CD7Hms2j.js +2 -0
- package/dist/assets/{french-Dk7YG8Td-D9eV2DXL.js.map → french-Dk7YG8Td-CD7Hms2j.js.map} +1 -1
- package/dist/assets/french-evUMlbbq-nGCjilG6.js +1 -0
- package/dist/assets/hierarchyDefinition-DLC5DjaA.js +2 -0
- package/dist/assets/hierarchyDefinition-DLC5DjaA.js.map +1 -0
- package/dist/assets/{index-NFrxkZjT.css → index-B7mmpKZd.css} +1 -1
- package/dist/assets/index-CK-rfSIx.js +4 -0
- package/dist/assets/{index-CDxzcoT1.js.map → index-CK-rfSIx.js.map} +1 -1
- package/dist/assets/interferenceMitigator-D78KgOxz.js +2 -0
- package/dist/assets/interferenceMitigator-D78KgOxz.js.map +1 -0
- package/dist/assets/logshim-YQI0WloD.js +2 -0
- package/dist/assets/logshim-YQI0WloD.js.map +1 -0
- package/dist/assets/math-DR3fXDcX-C9KfHLHP.js +1 -0
- package/dist/assets/math-D_8HiEQR-E4QDLrWp.js +34 -0
- package/dist/assets/{math-D_8HiEQR-DdtcYQLB.js.map → math-D_8HiEQR-E4QDLrWp.js.map} +1 -1
- package/dist/assets/moment-DbT30ZpG.js +5 -0
- package/dist/assets/moment-DbT30ZpG.js.map +1 -0
- package/dist/assets/piano-BN5Btq91-CnKhyLGE.js +1 -0
- package/dist/assets/piano-DF1g6yaX-Ck3BH5EK.js +2 -0
- package/dist/assets/{piano-DF1g6yaX-B7f_kt1X.js.map → piano-DF1g6yaX-Ck3BH5EK.js.map} +1 -1
- package/dist/assets/pitch-CgGJFkZ1-Dd0LzmEe.js +2 -0
- package/dist/assets/{pitch-CgGJFkZ1-CuezrVTg.js.map → pitch-CgGJFkZ1-Dd0LzmEe.js.map} +1 -1
- package/dist/assets/pitch-Dn0iNqiS-BxAdpDDb.js +1 -0
- package/dist/assets/prescribed-BWO17Gan.js +2 -0
- package/dist/assets/prescribed-BWO17Gan.js.map +1 -0
- package/dist/assets/relativePriority-DwPMECAp.js +2 -0
- package/dist/assets/relativePriority-DwPMECAp.js.map +1 -0
- package/dist/assets/server-CqR7xtQy.js +2 -0
- package/dist/assets/server-CqR7xtQy.js.map +1 -0
- package/dist/assets/{sightsing-BFQ7HRig-CLh3Xcy7.js → sightsing-BFQ7HRig-DV69ELZf.js} +23 -23
- package/dist/assets/{sightsing-BFQ7HRig-CLh3Xcy7.js.map → sightsing-BFQ7HRig-DV69ELZf.js.map} +1 -1
- package/dist/assets/sightsing-CJX3k0Fd-CG94OiDr.js +1 -0
- package/dist/assets/srs-DGscV6W4.js +1 -0
- package/dist/assets/srs-DOsG9Y-i.js +2 -0
- package/dist/assets/srs-DOsG9Y-i.js.map +1 -0
- package/dist/assets/tagRoles-jR-PJAgj.js +2 -0
- package/dist/assets/tagRoles-jR-PJAgj.js.map +1 -0
- package/dist/assets/typing-BevtfWlp-CvStu5BY.js +2 -0
- package/dist/assets/{typing-BevtfWlp-B__x_Ia1.js.map → typing-BevtfWlp-CvStu5BY.js.map} +1 -1
- package/dist/assets/typing-k-ojjO7G-AF8vU_q7.js +1 -0
- package/dist/assets/userDBKeys-DYLGKnVC.js +4 -0
- package/dist/assets/userDBKeys-DYLGKnVC.js.map +1 -0
- package/dist/assets/userTagPreference-cZCPqadC.js +2 -0
- package/dist/assets/userTagPreference-cZCPqadC.js.map +1 -0
- package/dist/assets/validators-lpYAHmRR.js +2 -0
- package/dist/assets/validators-lpYAHmRR.js.map +1 -0
- package/dist/assets/word-work-BOnRlZgd-CCGZdwyf.js +2 -0
- package/dist/assets/{word-work-BOnRlZgd-CxcTzMPz.js.map → word-work-BOnRlZgd-CCGZdwyf.js.map} +1 -1
- package/dist/assets/word-work-Dd6tIKrt-BNTSCq5F.js +1 -0
- package/dist/assets/{workbox-window.prod.es5-r2bRTooK.js → workbox-window.prod.es5-YsLcd14J.js} +1 -1
- package/dist/assets/{workbox-window.prod.es5-r2bRTooK.js.map → workbox-window.prod.es5-YsLcd14J.js.map} +1 -1
- package/dist/index.html +17 -7
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/package.json +7 -7
- package/dist/assets/AdminDashboard-CO2rxkF5.js +0 -2
- package/dist/assets/AdminLearner-CZO2Hlk1.js +0 -2
- package/dist/assets/ClassroomCtrlPanel-cj6bokz5.js +0 -2
- package/dist/assets/CourseRouter-CMMxD9us.js +0 -7
- package/dist/assets/CourseWare-BTFRjgBR-C3wi5YHa.js +0 -3
- package/dist/assets/EloModeration-COgCrvb8.js +0 -2
- package/dist/assets/MarkdownRenderer-U_iPiA2x-DDruDu7E.js +0 -53
- package/dist/assets/MarkdownRenderer-U_iPiA2x-DDruDu7E.js.map +0 -1
- package/dist/assets/MarkdownRenderer-U_iPiA2x-VCa5mXh1.js +0 -1
- package/dist/assets/NewCourseDialog-C11dSwWM.js +0 -2
- package/dist/assets/RequestPasswordReset-vTzfGItp.js +0 -2
- package/dist/assets/ResetPassword-CmGaVYsI.js +0 -2
- package/dist/assets/Study-CkJvraIv.js +0 -2
- package/dist/assets/TagInformation-xZcQ1C1t.js +0 -2
- package/dist/assets/User-MzKFSneO.js +0 -3
- package/dist/assets/User-MzKFSneO.js.map +0 -1
- package/dist/assets/UserStats-CioNBbmL.js +0 -2
- package/dist/assets/VerifyEmail-Bh-T9191.js +0 -2
- package/dist/assets/admin-Dt07rW2C.js +0 -21
- package/dist/assets/admin-Dt07rW2C.js.map +0 -1
- package/dist/assets/chess-E2uOAyQS-C8213VIQ.js +0 -7
- package/dist/assets/chess-Lfm7Fsvs-6ElY3d5h.js +0 -1
- package/dist/assets/common-ui.es-B9r6QiWN.js +0 -38
- package/dist/assets/common-ui.es-B9r6QiWN.js.map +0 -1
- package/dist/assets/common-ui.es-j6sezLNk.js +0 -1
- package/dist/assets/dist-BeppzTWu.js +0 -380
- package/dist/assets/dist-BeppzTWu.js.map +0 -1
- package/dist/assets/dist-C1hpwy00.js +0 -1
- package/dist/assets/dist-CKO_fXB-.js +0 -18
- package/dist/assets/dist-CKO_fXB-.js.map +0 -1
- package/dist/assets/dist-CkRURFlm.js +0 -1
- package/dist/assets/dist-V9Xbab2f.js +0 -12
- package/dist/assets/dist-V9Xbab2f.js.map +0 -1
- package/dist/assets/edit-ui.es-B00e6OcT.js +0 -36
- package/dist/assets/edit-ui.es-B00e6OcT.js.map +0 -1
- package/dist/assets/edit-ui.es-BGTYLTZO.js +0 -1
- package/dist/assets/french-Dk7YG8Td-D9eV2DXL.js +0 -2
- package/dist/assets/french-evUMlbbq-DOmp0PEx.js +0 -1
- package/dist/assets/index-CDxzcoT1.js +0 -4
- package/dist/assets/math-DR3fXDcX-Clr1rrj8.js +0 -1
- package/dist/assets/math-D_8HiEQR-DdtcYQLB.js +0 -34
- package/dist/assets/piano-BN5Btq91-BO9b38qV.js +0 -1
- package/dist/assets/piano-DF1g6yaX-B7f_kt1X.js +0 -2
- package/dist/assets/pitch-CgGJFkZ1-CuezrVTg.js +0 -2
- package/dist/assets/pitch-Dn0iNqiS-L0LRhcjZ.js +0 -1
- package/dist/assets/server-BP-NvFg7.js +0 -2
- package/dist/assets/server-BP-NvFg7.js.map +0 -1
- package/dist/assets/sightsing-CJX3k0Fd-DiVzeNly.js +0 -1
- package/dist/assets/typing-BevtfWlp-B__x_Ia1.js +0 -2
- package/dist/assets/typing-k-ojjO7G-Dn4uH4pS.js +0 -1
- package/dist/assets/word-work-BOnRlZgd-CxcTzMPz.js +0 -2
- package/dist/assets/word-work-Dd6tIKrt-BOmhWlr6.js +0 -1
- /package/dist/assets/{common-ui-BY2Ut5jf.css → dist-BY2Ut5jf.css} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./vue.runtime.esm-bundler--Fxmd6l9.js";import"./dist-V9Xbab2f.js";import"./MarkdownRenderer-U_iPiA2x-DDruDu7E.js";import"./dist-BeppzTWu.js";import"./common-ui.es-B9r6QiWN.js";import"./CourseWare-BTFRjgBR-C3wi5YHa.js";import{o as e}from"./piano-DF1g6yaX-B7f_kt1X.js";export{e as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./chunk-D6hFPZc3.js";import{$ as e,C as t,H as n,Ht as r,I as i,K as a,S as o,T as s,W as c,_ as l,b as u,f as d,g as f,ut as p,v as m,y as h,z as g,zt as _}from"./vue.runtime.esm-bundler--Fxmd6l9.js";import{A as v,E as y,b,k as x,n as S}from"./dist-V9Xbab2f.js";import{C as ee,n as te,w as ne}from"./MarkdownRenderer-U_iPiA2x-DDruDu7E.js";import{h as C,v as w}from"./common-ui.es-B9r6QiWN.js";import{d as T,l as E,n as D,t as O,u as k}from"./CourseWare-BTFRjgBR-C3wi5YHa.js";var A,j,M,re=E(((e,t)=>{(function(e){function WebMidi(){if(WebMidi.prototype._singleton)throw Error(`WebMidi is a singleton, it cannot be instantiated directly.`);(WebMidi.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(e){return this._nrpnEventsEnabled=e,this._nrpnEventsEnabled}},nrpnTypes:{enumerable:!0,get:function(){return this._nrpnTypes}.bind(this)},time:{enumerable:!0,get:function(){return performance.now()}}})}var n=new WebMidi;function Input(e){var t=this;this._userHandlers={channel:{},system:{}},this._midiInput=e,Object.defineProperties(this,{connection:{enumerable:!0,get:function(){return t._midiInput.connection}},id:{enumerable:!0,get:function(){return t._midiInput.id}},manufacturer:{enumerable:!0,get:function(){return t._midiInput.manufacturer}},name:{enumerable:!0,get:function(){return t._midiInput.name}},state:{enumerable:!0,get:function(){return t._midiInput.state}},type:{enumerable:!0,get:function(){return t._midiInput.type}}}),this._initializeUserHandlers(),this._midiInput.onmidimessage=this._onMidiMessage.bind(this)}function Output(e){var t=this;this._midiOutput=e,Object.defineProperties(this,{connection:{enumerable:!0,get:function(){return t._midiOutput.connection}},id:{enumerable:!0,get:function(){return t._midiOutput.id}},manufacturer:{enumerable:!0,get:function(){return t._midiOutput.manufacturer}},name:{enumerable:!0,get:function(){return t._midiOutput.name}},state:{enumerable:!0,get:function(){return t._midiOutput.state}},type:{enumerable:!0,get:function(){return t._midiOutput.type}}})}WebMidi.prototype.enable=function(e,t){this.enabled||(this.supported?navigator.requestMIDIAccess({sysex:t}).then(function(t){var n,r=[],i=[];this.interface=t,this._resetInterfaceUserHandlers(),this.interface.onstatechange=function(e){r.push(e)};for(var a=t.inputs.values(),o=a.next();o&&!o.done;o=a.next())i.push(o.value.open());for(var s=t.outputs.values(),c=s.next();c&&!c.done;c=s.next())i.push(c.value.open());function onPortsOpen(){clearTimeout(n),this._updateInputsAndOutputs(),this.interface.onstatechange=this._onInterfaceStateChange.bind(this),typeof e==`function`&&e.call(this),r.forEach(function(e){this._onInterfaceStateChange(e)}.bind(this))}n=setTimeout(onPortsOpen.bind(this),200),Promise&&Promise.all(i).catch(function(e){}).then(onPortsOpen.bind(this))}.bind(this),function(t){typeof e==`function`&&e.call(this,t)}.bind(this)):typeof e==`function`&&e(Error(`The Web MIDI API is not supported by your browser.`)))},WebMidi.prototype.disable=function(){if(!this.supported)throw Error(`The Web MIDI API is not supported by your browser.`);this.enabled&&(this.removeListener(),this.inputs.forEach(function(e){e.removeListener()})),this.interface&&(this.interface.onstatechange=void 0),this.interface=void 0,this._inputs=[],this._outputs=[],this._nrpnEventsEnabled=!0,this._resetInterfaceUserHandlers()},WebMidi.prototype.addListener=function(e,t){if(!this.enabled)throw Error(`WebMidi must be enabled before adding event listeners.`);if(typeof t!=`function`)throw TypeError(`The 'listener' parameter must be a function.`);if(!(0<=this._midiInterfaceEvents.indexOf(e)))throw TypeError(`The specified event type is not supported.`);return this._userHandlers[e].push(t),this},WebMidi.prototype.hasListener=function(e,t){if(!this.enabled)throw Error(`WebMidi must be enabled before checking event listeners.`);if(typeof t!=`function`)throw TypeError(`The 'listener' parameter must be a function.`);if(!(0<=this._midiInterfaceEvents.indexOf(e)))throw TypeError(`The specified event type is not supported.`);for(var n=0;n<this._userHandlers[e].length;n++)if(this._userHandlers[e][n]===t)return!0;return!1},WebMidi.prototype.removeListener=function(e,t){if(!this.enabled)throw Error(`WebMidi must be enabled before removing event listeners.`);if(t!==void 0&&typeof t!=`function`)throw TypeError(`The 'listener' parameter must be a function.`);if(0<=this._midiInterfaceEvents.indexOf(e))if(t)for(var n=0;n<this._userHandlers[e].length;n++)this._userHandlers[e][n]===t&&this._userHandlers[e].splice(n,1);else this._userHandlers[e]=[];else{if(e!==void 0)throw TypeError(`The specified event type is not supported.`);this._resetInterfaceUserHandlers()}return this},WebMidi.prototype.toMIDIChannels=function(e){var t;if(e===`all`||e===void 0)t=[`all`];else{if(e===`none`)return t=[];t=Array.isArray(e)?e:[e]}return-1<t.indexOf(`all`)&&(t=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),t.map(function(e){return parseInt(e)}).filter(function(e){return 1<=e&&e<=16})},WebMidi.prototype.getInputById=function(e){if(!this.enabled)throw Error(`WebMidi is not enabled.`);e=String(e);for(var t=0;t<this.inputs.length;t++)if(this.inputs[t].id===e)return this.inputs[t];return!1},WebMidi.prototype.getOutputById=function(e){if(!this.enabled)throw Error(`WebMidi is not enabled.`);e=String(e);for(var t=0;t<this.outputs.length;t++)if(this.outputs[t].id===e)return this.outputs[t];return!1},WebMidi.prototype.getInputByName=function(e){if(!this.enabled)throw Error(`WebMidi is not enabled.`);for(var t=0;t<this.inputs.length;t++)if(~this.inputs[t].name.indexOf(e))return this.inputs[t];return!1},WebMidi.prototype.getOctave=function(e){if(e!=null&&0<=e&&e<=127)return Math.floor(Math.floor(e)/12-1)+Math.floor(n.octaveOffset)},WebMidi.prototype.getOutputByName=function(e){if(!this.enabled)throw Error(`WebMidi is not enabled.`);for(var t=0;t<this.outputs.length;t++)if(~this.outputs[t].name.indexOf(e))return this.outputs[t];return!1},WebMidi.prototype.guessNoteNumber=function(e){var t=!1;if(e&&e.toFixed&&0<=e&&e<=127?t=Math.round(e):0<=parseInt(e)&&parseInt(e)<=127?t=parseInt(e):(typeof e==`string`||e instanceof String)&&(t=this.noteNameToNumber(e)),!1===t)throw Error(`Invalid input value (`+e+`).`);return t},WebMidi.prototype.noteNameToNumber=function(e){typeof e!=`string`&&(e=``);var t=e.match(/([CDEFGAB])(#{0,2}|b{0,2})(-?\d+)/i);if(!t)throw RangeError(`Invalid note name.`);var r=n._semitones[t[1].toUpperCase()],i=12*(parseInt(t[3])+1-Math.floor(n.octaveOffset))+r;if(-1<t[2].toLowerCase().indexOf(`b`)?i-=t[2].length:-1<t[2].toLowerCase().indexOf(`#`)&&(i+=t[2].length),i<0||127<i)throw RangeError(`Invalid note name or note outside valid range.`);return i},WebMidi.prototype._updateInputsAndOutputs=function(){this._updateInputs(),this._updateOutputs()},WebMidi.prototype._updateInputs=function(){for(var e=0;e<this._inputs.length;e++){for(var t=!0,n=this.interface.inputs.values(),r=n.next();r&&!r.done;r=n.next())if(this._inputs[e]._midiInput===r.value){t=!1;break}t&&this._inputs.splice(e,1)}this.interface&&this.interface.inputs.forEach(function(e){for(var t=!0,n=0;n<this._inputs.length;n++)this._inputs[n]._midiInput===e&&(t=!1);t&&this._inputs.push(new Input(e))}.bind(this))},WebMidi.prototype._updateOutputs=function(){for(var e=0;e<this._outputs.length;e++){for(var t=!0,n=this.interface.outputs.values(),r=n.next();r&&!r.done;r=n.next())if(this._outputs[e]._midiOutput===r.value){t=!1;break}t&&this._outputs.splice(e,1)}this.interface&&this.interface.outputs.forEach(function(e){for(var t=!0,n=0;n<this._outputs.length;n++)this._outputs[n]._midiOutput===e&&(t=!1);t&&this._outputs.push(new Output(e))}.bind(this))},WebMidi.prototype._onInterfaceStateChange=function(e){this._updateInputsAndOutputs();var t={timestamp:e.timeStamp,type:e.port.state};this.interface&&e.port.state===`connected`?e.port.type===`output`?t.port=this.getOutputById(e.port.id):e.port.type===`input`&&(t.port=this.getInputById(e.port.id)):t.port={connection:`closed`,id:e.port.id,manufacturer:e.port.manufacturer,name:e.port.name,state:e.port.state,type:e.port.type},this._userHandlers[e.port.state].forEach(function(e){e(t)})},WebMidi.prototype._resetInterfaceUserHandlers=function(){for(var e=0;e<this._midiInterfaceEvents.length;e++)this._userHandlers[this._midiInterfaceEvents[e]]=[]},Input.prototype.on=Input.prototype.addListener=function(e,t,r){var i=this;if(t===void 0&&(t=`all`),Array.isArray(t)||(t=[t]),t.forEach(function(e){if(e!==`all`&&!(1<=e&&e<=16))throw RangeError(`The 'channel' parameter is invalid.`)}),typeof r!=`function`)throw TypeError(`The 'listener' parameter must be a function.`);if(n.MIDI_SYSTEM_MESSAGES[e]!==void 0)this._userHandlers.system[e]||(this._userHandlers.system[e]=[]),this._userHandlers.system[e].push(r);else{if(n.MIDI_CHANNEL_MESSAGES[e]===void 0)throw TypeError(`The specified event type is not supported.`);if(-1<t.indexOf(`all`)){t=[];for(var a=1;a<=16;a++)t.push(a)}this._userHandlers.channel[e]||(this._userHandlers.channel[e]=[]),t.forEach(function(t){i._userHandlers.channel[e][t]||(i._userHandlers.channel[e][t]=[]),i._userHandlers.channel[e][t].push(r)})}return this},Input.prototype.hasListener=function(e,t,r){var i=this;if(typeof r!=`function`)throw TypeError(`The 'listener' parameter must be a function.`);if(t===void 0&&(t=`all`),t.constructor!==Array&&(t=[t]),n.MIDI_SYSTEM_MESSAGES[e]!==void 0){for(var a=0;a<this._userHandlers.system[e].length;a++)if(this._userHandlers.system[e][a]===r)return!0}else if(n.MIDI_CHANNEL_MESSAGES[e]!==void 0){if(-1<t.indexOf(`all`)){t=[];for(var o=1;o<=16;o++)t.push(o)}return!!this._userHandlers.channel[e]&&t.every(function(t){var n=i._userHandlers.channel[e][t];return n&&-1<n.indexOf(r)})}return!1},Input.prototype.removeListener=function(e,t,r){var i=this;if(r!==void 0&&typeof r!=`function`)throw TypeError(`The 'listener' parameter must be a function.`);if(t===void 0&&(t=`all`),t.constructor!==Array&&(t=[t]),n.MIDI_SYSTEM_MESSAGES[e]!==void 0)if(r===void 0)this._userHandlers.system[e]=[];else for(var a=0;a<this._userHandlers.system[e].length;a++)this._userHandlers.system[e][a]===r&&this._userHandlers.system[e].splice(a,1);else if(n.MIDI_CHANNEL_MESSAGES[e]!==void 0){if(-1<t.indexOf(`all`)){t=[];for(var o=1;o<=16;o++)t.push(o)}if(!this._userHandlers.channel[e])return this;t.forEach(function(t){var n=i._userHandlers.channel[e][t];if(n)if(r===void 0)i._userHandlers.channel[e][t]=[];else for(var a=0;a<n.length;a++)n[a]===r&&n.splice(a,1)})}else{if(e!==void 0)throw TypeError(`The specified event type is not supported.`);this._initializeUserHandlers()}return this},Input.prototype._initializeUserHandlers=function(){for(var e in n.MIDI_CHANNEL_MESSAGES)Object.prototype.hasOwnProperty.call(n.MIDI_CHANNEL_MESSAGES,e)&&(this._userHandlers.channel[e]={});for(var t in n.MIDI_SYSTEM_MESSAGES)Object.prototype.hasOwnProperty.call(n.MIDI_SYSTEM_MESSAGES,t)&&(this._userHandlers.system[t]=[])},Input.prototype._onMidiMessage=function(e){if(0<this._userHandlers.system.midimessage.length){var t={target:this,data:e.data,timestamp:e.timeStamp,type:`midimessage`};this._userHandlers.system.midimessage.forEach(function(e){e(t)})}e.data[0]<240?(this._parseChannelEvent(e),this._parseNrpnEvent(e)):e.data[0]<=255&&this._parseSystemEvent(e)},Input.prototype._parseNrpnEvent=function(e){var t,r,i=e.data[0]>>4,a=15&e.data[0],o=1+a;if(1<e.data.length&&(t=e.data[1],r=2<e.data.length?e.data[2]:void 0),n.nrpnEventsEnabled&&i===n.MIDI_CHANNEL_MESSAGES.controlchange&&(t>=n.MIDI_NRPN_MESSAGES.increment&&t<=n.MIDI_NRPN_MESSAGES.parammsb||t===n.MIDI_NRPN_MESSAGES.entrymsb||t===n.MIDI_NRPN_MESSAGES.entrylsb)){var s={target:this,type:`controlchange`,data:e.data,timestamp:e.timeStamp,channel:o,controller:{number:t,name:this.getCcNameByNumber(t)},value:r};if(s.controller.number===n.MIDI_NRPN_MESSAGES.parammsb&&s.value!=n.MIDI_NRPN_MESSAGES.nullactiveparameter)n._nrpnBuffer[a]=[],n._nrpnBuffer[a][0]=s;else if(n._nrpnBuffer[a].length===1&&s.controller.number===n.MIDI_NRPN_MESSAGES.paramlsb)n._nrpnBuffer[a].push(s);else if(n._nrpnBuffer[a].length!==2||s.controller.number!==n.MIDI_NRPN_MESSAGES.increment&&s.controller.number!==n.MIDI_NRPN_MESSAGES.decrement&&s.controller.number!==n.MIDI_NRPN_MESSAGES.entrymsb)if(n._nrpnBuffer[a].length===3&&n._nrpnBuffer[a][2].number===n.MIDI_NRPN_MESSAGES.entrymsb&&s.controller.number===n.MIDI_NRPN_MESSAGES.entrylsb)n._nrpnBuffer[a].push(s);else if(3<=n._nrpnBuffer[a].length&&n._nrpnBuffer[a].length<=4&&s.controller.number===n.MIDI_NRPN_MESSAGES.parammsb&&s.value===n.MIDI_NRPN_MESSAGES.nullactiveparameter)n._nrpnBuffer[a].push(s);else if(4<=n._nrpnBuffer[a].length&&n._nrpnBuffer[a].length<=5&&s.controller.number===n.MIDI_NRPN_MESSAGES.paramlsb&&s.value===n.MIDI_NRPN_MESSAGES.nullactiveparameter){n._nrpnBuffer[a].push(s);var c=[];n._nrpnBuffer[a].forEach(function(e){c.push(e.data)});var l=n._nrpnBuffer[a][0].value<<7|n._nrpnBuffer[a][1].value,u=n._nrpnBuffer[a][2].value;n._nrpnBuffer[a].length===6&&(u=n._nrpnBuffer[a][2].value<<7|n._nrpnBuffer[a][3].value);var d=``;switch(n._nrpnBuffer[a][2].controller.number){case n.MIDI_NRPN_MESSAGES.entrymsb:d=n._nrpnTypes[0];break;case n.MIDI_NRPN_MESSAGES.increment:d=n._nrpnTypes[1];break;case n.MIDI_NRPN_MESSAGES.decrement:d=n._nrpnTypes[2];break;default:throw Error(`The NPRN type was unidentifiable.`)}var f={timestamp:s.timestamp,channel:s.channel,type:`nrpn`,data:c,controller:{number:l,type:d,name:`Non-Registered Parameter `+l},value:u};n._nrpnBuffer[a]=[],this._userHandlers.channel[f.type]&&this._userHandlers.channel[f.type][f.channel]&&this._userHandlers.channel[f.type][f.channel].forEach(function(e){e(f)})}else n._nrpnBuffer[a]=[];else n._nrpnBuffer[a].push(s)}},Input.prototype._parseChannelEvent=function(e){var t,r,i=e.data[0]>>4,a=1+(15&e.data[0]);1<e.data.length&&(t=e.data[1],r=2<e.data.length?e.data[2]:void 0);var o={target:this,data:e.data,timestamp:e.timeStamp,channel:a};i===n.MIDI_CHANNEL_MESSAGES.noteoff||i===n.MIDI_CHANNEL_MESSAGES.noteon&&r===0?(o.type=`noteoff`,o.note={number:t,name:n._notes[t%12],octave:n.getOctave(t)},o.velocity=r/127,o.rawVelocity=r):i===n.MIDI_CHANNEL_MESSAGES.noteon?(o.type=`noteon`,o.note={number:t,name:n._notes[t%12],octave:n.getOctave(t)},o.velocity=r/127,o.rawVelocity=r):i===n.MIDI_CHANNEL_MESSAGES.keyaftertouch?(o.type=`keyaftertouch`,o.note={number:t,name:n._notes[t%12],octave:n.getOctave(t)},o.value=r/127):i===n.MIDI_CHANNEL_MESSAGES.controlchange&&0<=t&&t<=119?(o.type=`controlchange`,o.controller={number:t,name:this.getCcNameByNumber(t)},o.value=r):i===n.MIDI_CHANNEL_MESSAGES.channelmode&&120<=t&&t<=127?(o.type=`channelmode`,o.controller={number:t,name:this.getChannelModeByNumber(t)},o.value=r):i===n.MIDI_CHANNEL_MESSAGES.programchange?(o.type=`programchange`,o.value=t):i===n.MIDI_CHANNEL_MESSAGES.channelaftertouch?(o.type=`channelaftertouch`,o.value=t/127):i===n.MIDI_CHANNEL_MESSAGES.pitchbend?(o.type=`pitchbend`,o.value=((r<<7)+t-8192)/8192):o.type=`unknownchannelmessage`,this._userHandlers.channel[o.type]&&this._userHandlers.channel[o.type][a]&&this._userHandlers.channel[o.type][a].forEach(function(e){e(o)})},Input.prototype.getCcNameByNumber=function(e){if(!(0<=(e=Math.floor(e))&&e<=119))throw RangeError(`The control change number must be between 0 and 119.`);for(var t in n.MIDI_CONTROL_CHANGE_MESSAGES)if(Object.prototype.hasOwnProperty.call(n.MIDI_CONTROL_CHANGE_MESSAGES,t)&&e===n.MIDI_CONTROL_CHANGE_MESSAGES[t])return t},Input.prototype.getChannelModeByNumber=function(e){if(!(120<=(e=Math.floor(e))&&status<=127))throw RangeError(`The control change number must be between 120 and 127.`);for(var t in n.MIDI_CHANNEL_MODE_MESSAGES)if(Object.prototype.hasOwnProperty.call(n.MIDI_CHANNEL_MODE_MESSAGES,t)&&e===n.MIDI_CHANNEL_MODE_MESSAGES[t])return t},Input.prototype._parseSystemEvent=function(e){var t=e.data[0],r={target:this,data:e.data,timestamp:e.timeStamp};t===n.MIDI_SYSTEM_MESSAGES.sysex?r.type=`sysex`:t===n.MIDI_SYSTEM_MESSAGES.timecode?r.type=`timecode`:t===n.MIDI_SYSTEM_MESSAGES.songposition?r.type=`songposition`:t===n.MIDI_SYSTEM_MESSAGES.songselect?(r.type=`songselect`,r.song=e.data[1]):t===n.MIDI_SYSTEM_MESSAGES.tuningrequest?r.type=`tuningrequest`:t===n.MIDI_SYSTEM_MESSAGES.clock?r.type=`clock`:t===n.MIDI_SYSTEM_MESSAGES.start?r.type=`start`:t===n.MIDI_SYSTEM_MESSAGES.continue?r.type=`continue`:t===n.MIDI_SYSTEM_MESSAGES.stop?r.type=`stop`:t===n.MIDI_SYSTEM_MESSAGES.activesensing?r.type=`activesensing`:t===n.MIDI_SYSTEM_MESSAGES.reset?r.type=`reset`:r.type=`unknownsystemmessage`,this._userHandlers.system[r.type]&&this._userHandlers.system[r.type].forEach(function(e){e(r)})},Output.prototype.send=function(e,t,n){if(!(128<=e&&e<=255))throw RangeError(`The status byte must be an integer between 128 (0x80) and 255 (0xFF).`);t===void 0&&(t=[]),Array.isArray(t)||(t=[t]);var r=[];return t.forEach(function(e){var t=Math.floor(e);if(!(0<=t&&t<=255))throw RangeError(`Data bytes must be integers between 0 (0x00) and 255 (0xFF).`);r.push(t)}),this._midiOutput.send([e].concat(r),parseFloat(n)||0),this},Output.prototype.sendSysex=function(e,t,r){if(!n.sysexEnabled)throw Error(`Sysex message support must first be activated.`);return r||(r={}),e=[].concat(e),t.forEach(function(e){if(e<0||127<e)throw RangeError(`The data bytes of a sysex message must be integers between 0 (0x00) and 127 (0x7F).`)}),t=e.concat(t,n.MIDI_SYSTEM_MESSAGES.sysexend),this.send(n.MIDI_SYSTEM_MESSAGES.sysex,t,this._parseTimeParameter(r.time)),this},Output.prototype.sendTimecodeQuarterFrame=function(e,t){return t||(t={}),this.send(n.MIDI_SYSTEM_MESSAGES.timecode,e,this._parseTimeParameter(t.time)),this},Output.prototype.sendSongPosition=function(e,t){t||(t={});var r=(e=Math.floor(e)||0)>>7&127,i=127&e;return this.send(n.MIDI_SYSTEM_MESSAGES.songposition,[r,i],this._parseTimeParameter(t.time)),this},Output.prototype.sendSongSelect=function(e,t){if(t||(t={}),!(0<=(e=Math.floor(e))&&e<=127))throw RangeError(`The song number must be between 0 and 127.`);return this.send(n.MIDI_SYSTEM_MESSAGES.songselect,[e],this._parseTimeParameter(t.time)),this},Output.prototype.sendTuningRequest=function(e){return e||(e={}),this.send(n.MIDI_SYSTEM_MESSAGES.tuningrequest,void 0,this._parseTimeParameter(e.time)),this},Output.prototype.sendClock=function(e){return e||(e={}),this.send(n.MIDI_SYSTEM_MESSAGES.clock,void 0,this._parseTimeParameter(e.time)),this},Output.prototype.sendStart=function(e){return e||(e={}),this.send(n.MIDI_SYSTEM_MESSAGES.start,void 0,this._parseTimeParameter(e.time)),this},Output.prototype.sendContinue=function(e){return e||(e={}),this.send(n.MIDI_SYSTEM_MESSAGES.continue,void 0,this._parseTimeParameter(e.time)),this},Output.prototype.sendStop=function(e){return e||(e={}),this.send(n.MIDI_SYSTEM_MESSAGES.stop,void 0,this._parseTimeParameter(e.time)),this},Output.prototype.sendActiveSensing=function(e){return e||(e={}),this.send(n.MIDI_SYSTEM_MESSAGES.activesensing,[],this._parseTimeParameter(e.time)),this},Output.prototype.sendReset=function(e){return e||(e={}),this.send(n.MIDI_SYSTEM_MESSAGES.reset,void 0,this._parseTimeParameter(e.time)),this},Output.prototype.stopNote=function(e,t,r){if(e===`all`)return this.sendChannelMode(`allnotesoff`,0,t,r);var i=64;return(r||(r={})).rawVelocity?!isNaN(r.velocity)&&0<=r.velocity&&r.velocity<=127&&(i=r.velocity):!isNaN(r.velocity)&&0<=r.velocity&&r.velocity<=1&&(i=127*r.velocity),this._convertNoteToArray(e).forEach(function(e){n.toMIDIChannels(t).forEach(function(t){this.send((n.MIDI_CHANNEL_MESSAGES.noteoff<<4)+(t-1),[e,Math.round(i)],this._parseTimeParameter(r.time))}.bind(this))}.bind(this)),this},Output.prototype.playNote=function(e,t,r){var i,a=64;if((r||(r={})).rawVelocity?!isNaN(r.velocity)&&0<=r.velocity&&r.velocity<=127&&(a=r.velocity):!isNaN(r.velocity)&&0<=r.velocity&&r.velocity<=1&&(a=127*r.velocity),i=this._parseTimeParameter(r.time),this._convertNoteToArray(e).forEach(function(e){n.toMIDIChannels(t).forEach(function(t){this.send((n.MIDI_CHANNEL_MESSAGES.noteon<<4)+(t-1),[e,Math.round(a)],i)}.bind(this))}.bind(this)),!isNaN(r.duration)){r.duration<=0&&(r.duration=0);var o=64;r.rawVelocity?!isNaN(r.release)&&0<=r.release&&r.release<=127&&(o=r.release):!isNaN(r.release)&&0<=r.release&&r.release<=1&&(o=127*r.release),this._convertNoteToArray(e).forEach(function(e){n.toMIDIChannels(t).forEach(function(t){this.send((n.MIDI_CHANNEL_MESSAGES.noteoff<<4)+(t-1),[e,Math.round(o)],(i||n.time)+r.duration)}.bind(this))}.bind(this))}return this},Output.prototype.sendKeyAftertouch=function(e,t,r,i){var a=this;if(i||(i={}),t<1||16<t)throw RangeError(`The channel must be between 1 and 16.`);(isNaN(r)||r<0||1<r)&&(r=.5);var o=Math.round(127*r);return this._convertNoteToArray(e).forEach(function(e){n.toMIDIChannels(t).forEach(function(t){a.send((n.MIDI_CHANNEL_MESSAGES.keyaftertouch<<4)+(t-1),[e,o],a._parseTimeParameter(i.time))})}),this},Output.prototype.sendControlChange=function(e,t,r,i){if(i||(i={}),typeof e==`string`){if((e=n.MIDI_CONTROL_CHANGE_MESSAGES[e])===void 0)throw TypeError(`Invalid controller name.`)}else if(!(0<=(e=Math.floor(e))&&e<=119))throw RangeError(`Controller numbers must be between 0 and 119.`);if(!(0<=(t=Math.floor(t)||0)&&t<=127))throw RangeError(`Controller value must be between 0 and 127.`);return n.toMIDIChannels(r).forEach(function(r){this.send((n.MIDI_CHANNEL_MESSAGES.controlchange<<4)+(r-1),[e,t],this._parseTimeParameter(i.time))}.bind(this)),this},Output.prototype._selectRegisteredParameter=function(e,t,r){var i=this;if(e[0]=Math.floor(e[0]),!(0<=e[0]&&e[0]<=127))throw RangeError(`The control65 value must be between 0 and 127`);if(e[1]=Math.floor(e[1]),!(0<=e[1]&&e[1]<=127))throw RangeError(`The control64 value must be between 0 and 127`);return n.toMIDIChannels(t).forEach(function(){i.sendControlChange(101,e[0],t,{time:r}),i.sendControlChange(100,e[1],t,{time:r})}),this},Output.prototype._selectNonRegisteredParameter=function(e,t,r){var i=this;if(e[0]=Math.floor(e[0]),!(0<=e[0]&&e[0]<=127))throw RangeError(`The control63 value must be between 0 and 127`);if(e[1]=Math.floor(e[1]),!(0<=e[1]&&e[1]<=127))throw RangeError(`The control62 value must be between 0 and 127`);return n.toMIDIChannels(t).forEach(function(){i.sendControlChange(99,e[0],t,{time:r}),i.sendControlChange(98,e[1],t,{time:r})}),this},Output.prototype._setCurrentRegisteredParameter=function(e,t,r){var i=this;if((e=[].concat(e))[0]=Math.floor(e[0]),!(0<=e[0]&&e[0]<=127))throw RangeError(`The msb value must be between 0 and 127`);return n.toMIDIChannels(t).forEach(function(){i.sendControlChange(6,e[0],t,{time:r})}),e[1]=Math.floor(e[1]),0<=e[1]&&e[1]<=127&&n.toMIDIChannels(t).forEach(function(){i.sendControlChange(38,e[1],t,{time:r})}),this},Output.prototype._deselectRegisteredParameter=function(e,t){var r=this;return n.toMIDIChannels(e).forEach(function(){r.sendControlChange(101,127,e,{time:t}),r.sendControlChange(100,127,e,{time:t})}),this},Output.prototype.setRegisteredParameter=function(e,t,r,i){var a=this;if(i||(i={}),!Array.isArray(e)){if(!n.MIDI_REGISTERED_PARAMETER[e])throw Error(`The specified parameter is not available.`);e=n.MIDI_REGISTERED_PARAMETER[e]}return n.toMIDIChannels(r).forEach(function(){a._selectRegisteredParameter(e,r,i.time),a._setCurrentRegisteredParameter(t,r,i.time),a._deselectRegisteredParameter(r,i.time)}),this},Output.prototype.setNonRegisteredParameter=function(e,t,r,i){var a=this;if(i||(i={}),!(0<=e[0]&&e[0]<=127&&0<=e[1]&&e[1]<=127))throw Error(`Position 0 and 1 of the 2-position parameter array must both be between 0 and 127.`);return t=[].concat(t),n.toMIDIChannels(r).forEach(function(){a._selectNonRegisteredParameter(e,r,i.time),a._setCurrentRegisteredParameter(t,r,i.time),a._deselectRegisteredParameter(r,i.time)}),this},Output.prototype.incrementRegisteredParameter=function(e,t,r){var i=this;if(r||(r={}),!Array.isArray(e)){if(!n.MIDI_REGISTERED_PARAMETER[e])throw Error(`The specified parameter is not available.`);e=n.MIDI_REGISTERED_PARAMETER[e]}return n.toMIDIChannels(t).forEach(function(){i._selectRegisteredParameter(e,t,r.time),i.sendControlChange(96,0,t,{time:r.time}),i._deselectRegisteredParameter(t,r.time)}),this},Output.prototype.decrementRegisteredParameter=function(e,t,r){if(r||(r={}),!Array.isArray(e)){if(!n.MIDI_REGISTERED_PARAMETER[e])throw TypeError(`The specified parameter is not available.`);e=n.MIDI_REGISTERED_PARAMETER[e]}return n.toMIDIChannels(t).forEach(function(){this._selectRegisteredParameter(e,t,r.time),this.sendControlChange(97,0,t,{time:r.time}),this._deselectRegisteredParameter(t,r.time)}.bind(this)),this},Output.prototype.setPitchBendRange=function(e,t,r,i){var a=this;if(i||(i={}),!(0<=(e=Math.floor(e)||0)&&e<=127))throw RangeError(`The semitones value must be between 0 and 127`);if(!(0<=(t=Math.floor(t)||0)&&t<=127))throw RangeError(`The cents value must be between 0 and 127`);return n.toMIDIChannels(r).forEach(function(){a.setRegisteredParameter(`pitchbendrange`,[e,t],r,{time:i.time})}),this},Output.prototype.setModulationRange=function(e,t,r,i){var a=this;if(i||(i={}),!(0<=(e=Math.floor(e)||0)&&e<=127))throw RangeError(`The semitones value must be between 0 and 127`);if(!(0<=(t=Math.floor(t)||0)&&t<=127))throw RangeError(`The cents value must be between 0 and 127`);return n.toMIDIChannels(r).forEach(function(){a.setRegisteredParameter(`modulationrange`,[e,t],r,{time:i.time})}),this},Output.prototype.setMasterTuning=function(e,t,r){var i=this;if(r||(r={}),(e=parseFloat(e)||0)<=-65||64<=e)throw RangeError(`The value must be a decimal number larger than -65 and smaller than 64.`);var a=Math.floor(e)+64,o=e-Math.floor(e),s=(o=Math.round((o+1)/2*16383))>>7&127,c=127&o;return n.toMIDIChannels(t).forEach(function(){i.setRegisteredParameter(`channelcoarsetuning`,a,t,{time:r.time}),i.setRegisteredParameter(`channelfinetuning`,[s,c],t,{time:r.time})}),this},Output.prototype.setTuningProgram=function(e,t,r){var i=this;if(r||(r={}),!(0<=(e=Math.floor(e))&&e<=127))throw RangeError(`The program value must be between 0 and 127`);return n.toMIDIChannels(t).forEach(function(){i.setRegisteredParameter(`tuningprogram`,e,t,{time:r.time})}),this},Output.prototype.setTuningBank=function(e,t,r){var i=this;if(r||(r={}),!(0<=(e=Math.floor(e)||0)&&e<=127))throw RangeError(`The bank value must be between 0 and 127`);return n.toMIDIChannels(t).forEach(function(){i.setRegisteredParameter(`tuningbank`,e,t,{time:r.time})}),this},Output.prototype.sendChannelMode=function(e,t,r,i){if(i||(i={}),typeof e==`string`){if(!(e=n.MIDI_CHANNEL_MODE_MESSAGES[e]))throw TypeError(`Invalid channel mode message name.`)}else if(!(120<=(e=Math.floor(e))&&e<=127))throw RangeError(`Channel mode numerical identifiers must be between 120 and 127.`);if((t=Math.floor(t)||0)<0||127<t)throw RangeError(`Value must be an integer between 0 and 127.`);return n.toMIDIChannels(r).forEach(function(r){this.send((n.MIDI_CHANNEL_MESSAGES.channelmode<<4)+(r-1),[e,t],this._parseTimeParameter(i.time))}.bind(this)),this},Output.prototype.sendProgramChange=function(e,t,r){var i=this;if(r||(r={}),e=Math.floor(e),isNaN(e)||e<0||127<e)throw RangeError(`Program numbers must be between 0 and 127.`);return n.toMIDIChannels(t).forEach(function(t){i.send((n.MIDI_CHANNEL_MESSAGES.programchange<<4)+(t-1),[e],i._parseTimeParameter(r.time))}),this},Output.prototype.sendChannelAftertouch=function(e,t,r){var i=this;r||(r={}),e=parseFloat(e),(isNaN(e)||e<0||1<e)&&(e=.5);var a=Math.round(127*e);return n.toMIDIChannels(t).forEach(function(e){i.send((n.MIDI_CHANNEL_MESSAGES.channelaftertouch<<4)+(e-1),[a],i._parseTimeParameter(r.time))}),this},Output.prototype.sendPitchBend=function(e,t,r){var i=this;if(r||(r={}),isNaN(e)||e<-1||1<e)throw RangeError(`Pitch bend value must be between -1 and 1.`);var a=Math.round((e+1)/2*16383),o=a>>7&127,s=127&a;return n.toMIDIChannels(t).forEach(function(e){i.send((n.MIDI_CHANNEL_MESSAGES.pitchbend<<4)+(e-1),[s,o],i._parseTimeParameter(r.time))}),this},Output.prototype._parseTimeParameter=function(e){var t,r=parseFloat(e);return typeof e==`string`&&e.substring(0,1)===`+`?r&&0<r&&(t=n.time+r):r>n.time&&(t=r),t},Output.prototype._convertNoteToArray=function(e){var t=[];return Array.isArray(e)||(e=[e]),e.forEach(function(e){t.push(n.guessNoteNumber(e))}),t},typeof define==`function`&&typeof define.amd==`object`?define([],function(){return n}):t!==void 0&&t.exports?t.exports=n:e.WebMidi||(e.WebMidi=n)})(e)})),fillStr=(e,t)=>Array(Math.abs(t)+1).join(e);function isNamed(e){return!!(typeof e==`object`&&e&&typeof e.name==`string`)}function isPitch(e){return!!(typeof e==`object`&&e&&typeof e.step==`number`&&typeof e.alt==`number`)}var ie=[0,2,4,-1,1,3,5],ae=ie.map(e=>Math.floor(e*7/12));function encode(e){let{step:t,alt:n,oct:r,dir:i=1}=e,a=ie[t]+7*n;if(r===void 0)return[i*a];let o=r-ae[t]-4*n;return[i*a,i*o]}var oe=[3,0,4,1,5,2,6];function decode(e){let[t,n,r]=e,i=oe[unaltered(t)],a=Math.floor((t+1)/7);return n===void 0?{step:i,alt:a,dir:r}:{step:i,alt:a,oct:n+4*a+ae[i],dir:r}}function unaltered(e){let t=(e+1)%7;return t<0?7+t:t}var se={empty:!0,name:``,pc:``,acc:``},N=new Map,stepToLetter=e=>`CDEFGAB`.charAt(e),altToAcc=e=>e<0?fillStr(`b`,-e):fillStr(`#`,e),accToAlt=e=>e[0]===`b`?-e.length:e.length;function note(e){let t=N.get(e);if(t)return t;let n=typeof e==`string`?parse$1(e):isPitch(e)?note(pitchName(e)):isNamed(e)?note(e.name):se;return N.set(e,n),n}var ce=/^([a-gA-G]?)(#{1,}|b{1,}|x{1,}|)(-?\d*)\s*(.*)$/;function tokenizeNote(e){let t=ce.exec(e);return[t[1].toUpperCase(),t[2].replace(/x/g,`##`),t[3],t[4]]}function coordToNote(e){return note(decode(e))}var mod=(e,t)=>(e%t+t)%t,P=[0,2,4,5,7,9,11];function parse$1(e){let t=tokenizeNote(e);if(t[0]===``||t[3]!==``)return se;let n=t[0],r=t[1],i=t[2],a=(n.charCodeAt(0)+3)%7,o=accToAlt(r),s=i.length?+i:void 0,c=encode({step:a,alt:o,oct:s}),l=n+r+i,u=n+r,d=(P[a]+o+120)%12,f=s===void 0?mod(P[a]+o,12)-1188:P[a]+o+12*(s+1),p=f>=0&&f<=127?f:null;return{empty:!1,acc:r,alt:o,chroma:d,coord:c,freq:s===void 0?null:2**((f-69)/12)*440,height:f,letter:n,midi:p,name:l,oct:s,pc:u,step:a}}k(parse$1,`parse`);function pitchName(e){let{step:t,alt:n,oct:r}=e,i=stepToLetter(t);if(!i)return``;let a=i+altToAcc(n);return r||r===0?a+r:a}var F={empty:!0,name:``,acc:``},le=RegExp(`^([-+]?\\d+)(d{1,4}|m|M|P|A{1,4})|(AA|A|P|M|m|d|dd)([-+]?\\d+)$`);function tokenizeInterval(e){let t=le.exec(`${e}`);return t===null?[``,``]:t[1]?[t[1],t[2]]:[t[4],t[3]]}var I={};function interval(e){return typeof e==`string`?I[e]||(I[e]=parse$1$1(e)):isPitch(e)?interval(pitchName$1(e)):isNamed(e)?interval(e.name):F}var L=[0,2,4,5,7,9,11],R=`PMMPPMM`;function parse$1$1(e){let t=tokenizeInterval(e);if(t[0]===``)return F;let n=+t[0],r=t[1],i=(Math.abs(n)-1)%7,a=R[i];if(a===`M`&&r===`P`)return F;let o=a===`M`?`majorable`:`perfectable`,s=``+n+r,c=n<0?-1:1,l=n===8||n===-8?n:c*(i+1),u=qToAlt(o,r),d=Math.floor((Math.abs(n)-1)/7);return{empty:!1,name:s,num:n,q:r,step:i,alt:u,dir:c,type:o,simple:l,semitones:c*(L[i]+u+12*d),chroma:(c*(L[i]+u)%12+12)%12,coord:encode({step:i,alt:u,oct:d,dir:c}),oct:d}}k(parse$1$1,`parse$1`);function coordToInterval(e){let[t,n=0]=e;return interval(decode(t*7+n*12<0?[-t,-n,-1]:[t,n,1]))}function qToAlt(e,t){return t===`M`&&e===`majorable`||t===`P`&&e===`perfectable`?0:t===`m`&&e===`majorable`?-1:/^A+$/.test(t)?t.length:/^d+$/.test(t)?-1*(e===`perfectable`?t.length:t.length+1):0}function pitchName$1(e){let{step:t,alt:n,oct:r=0,dir:i}=e;if(!i)return``;let a=t+1+7*r,o=i<0?`-`:``,s=R[t]===`M`?`majorable`:`perfectable`;return o+a+altToQ(s,n)}function altToQ(e,t){return t===0?e===`majorable`?`M`:`P`:t===-1&&e===`majorable`?`m`:t>0?fillStr(`A`,t):fillStr(`d`,e===`perfectable`?t:t+1)}function transpose$2(e,t){let n=note(e),r=interval(t);if(n.empty||r.empty)return``;let i=n.coord,a=r.coord;return coordToNote(i.length===1?[i[0]+a[0]]:[i[0]+a[0],i[1]+a[1]]).name}k(transpose$2,`transpose`);function distance$1(e,t){let n=note(e),r=note(t);if(n.empty||r.empty)return``;let i=n.coord,a=r.coord,o=a[0]-i[0];return coordToInterval([o,i.length===2&&a.length===2?a[1]-i[1]:-Math.floor(o*7/12)]).name}k(distance$1,`distance`);function rotate(e,t){let n=t.length,r=(e%n+n)%n;return t.slice(r,n).concat(t.slice(0,r))}var z={empty:!0,name:``,setNum:0,chroma:`000000000000`,normalized:`000000000000`,intervals:[]},setNumToChroma=e=>Number(e).toString(2),chromaToNumber=e=>parseInt(e,2),ue=/^[01]{12}$/;function isChroma(e){return ue.test(e)}var isPcsetNum=e=>typeof e==`number`&&e>=0&&e<=4095,isPcset=e=>e&&isChroma(e.chroma),B={[z.chroma]:z};function get$8(e){let t=isChroma(e)?e:isPcsetNum(e)?setNumToChroma(e):Array.isArray(e)?listToChroma(e):isPcset(e)?e.chroma:z.chroma;return B[t]=B[t]||chromaToPcset(t)}k(get$8,`get`);var de=[`1P`,`2m`,`2M`,`3m`,`3M`,`4P`,`5d`,`5P`,`6m`,`6M`,`7m`,`7M`];function chromaToIntervals(e){let t=[];for(let n=0;n<12;n++)e.charAt(n)===`1`&&t.push(de[n]);return t}function chromaRotations(e){let t=e.split(``);return t.map((e,n)=>rotate(n,t).join(``))}function chromaToPcset(e){let t=chromaToNumber(e),n=chromaRotations(e).map(chromaToNumber).filter(e=>e>=2048).sort()[0];return{empty:!1,name:``,setNum:t,chroma:e,normalized:setNumToChroma(n),intervals:chromaToIntervals(e)}}function listToChroma(e){if(e.length===0)return z.chroma;let t,n=[0,0,0,0,0,0,0,0,0,0,0,0];for(let r=0;r<e.length;r++)t=note(e[r]),t.empty&&(t=interval(e[r])),t.empty||(n[t.chroma]=1);return n.join(``)}var fe=[[`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`]],pe={...z,name:``,quality:`Unknown`,intervals:[],aliases:[]},V=[],H={};function get$7(e){return H[e]||pe}k(get$7,`get`);function all$2(){return V.slice()}k(all$2,`all`);function add$3(e,t,n){let r=getQuality(e),i={...get$8(e),name:n||``,quality:r,intervals:e,aliases:t};V.push(i),i.name&&(H[i.name]=i),H[i.setNum]=i,H[i.chroma]=i,i.aliases.forEach(e=>addAlias$1(i,e))}k(add$3,`add`);function addAlias$1(e,t){H[t]=e}k(addAlias$1,`addAlias`);function getQuality(e){let has=t=>e.indexOf(t)!==-1;return has(`5A`)?`Augmented`:has(`3M`)?`Major`:has(`5d`)?`Diminished`:has(`3m`)?`Minor`:`Unknown`}fe.forEach(([e,t,n])=>add$3(e.split(` `),n.split(` `),t)),V.sort((e,t)=>e.setNum-t.setNum);var me=[[`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`]],he={...z,intervals:[],aliases:[]},ge=[],U={};function get$6(e){return U[e]||he}k(get$6,`get`);function all$1(){return ge.slice()}k(all$1,`all`);function add$2(e,t,n=[]){let r={...get$8(e),name:t,intervals:e,aliases:n};return ge.push(r),U[r.name]=r,U[r.setNum]=r,U[r.chroma]=r,r.aliases.forEach(e=>addAlias(r,e)),r}k(add$2,`add`);function addAlias(e,t){U[t]=e}me.forEach(([e,t,...n])=>add$2(e.split(` `),t,n));var W={empty:!0,name:``,symbol:``,root:``,rootDegree:0,type:``,tonic:null,setNum:NaN,quality:`Unknown`,chroma:``,normalized:``,aliases:[],notes:[],intervals:[]},_e=/^(6|64|7|9|11|13)$/;function tokenize$2(e){let[t,n,r,i]=tokenizeNote(e);return t===``?[``,e]:t===`A`&&i===`ug`?[``,`aug`]:!i&&(r===`4`||r===`5`)?[t+n,r]:_e.test(r)?[t+n,r+i]:[t+n+r,i]}k(tokenize$2,`tokenize`);function get$5(e){if(e===``)return W;if(Array.isArray(e)&&e.length===2)return getChord(e[1],e[0]);{let[t,n]=tokenize$2(e),r=getChord(n,t);return r.empty?getChord(e):r}}k(get$5,`get`);function getChord(e,t,n){let r=get$7(e),i=note(t||``),a=note(n||``);if(r.empty||t&&i.empty||n&&a.empty)return W;let o=distance$1(i.pc,a.pc),s=r.intervals.indexOf(o)+1;if(!a.empty&&!s)return W;let c=Array.from(r.intervals);for(let e=1;e<s;e++){let e=c[0][0],t=c[0][1],n=parseInt(e,10)+7;c.push(`${n}${t}`),c.shift()}let l=i.empty?[]:c.map(e=>transpose$2(i,e));e=r.aliases.indexOf(e)===-1?r.aliases[0]:e;let u=`${i.empty?``:i.pc}${e}${a.empty||s<=1?``:`/`+a.pc}`,d=`${t?i.pc+` `:``}${r.name}${s>1&&n?` over `+a.pc:``}`;return{...r,name:d,symbol:u,type:r.name,root:a.name,intervals:c,rootDegree:s,tonic:i.name,notes:l}}var ve=[[.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`]]],ye=[];ve.forEach(([e,t,n])=>add$1(e,t,n));function add$1(e,t,n){ye.push({empty:!1,dots:``,name:``,value:1/e,fraction:e<1?[1/e,1]:[1,e],shorthand:t,names:n})}k(add$1,`add`);function names$1(){return`1P 2M 3M 4P 5P 6m 7m`.split(` `)}k(names$1,`names`);var be=interval,xe=k(e=>interval(e).name,`name`),semitones=e=>interval(e).semitones,quality=e=>interval(e).q,num=e=>interval(e).num;function simplify$1(e){let t=interval(e);return t.empty?``:t.simple+t.q}k(simplify$1,`simplify`);function invert(e){let t=interval(e);return t.empty?``:interval({step:(7-t.step)%7,alt:t.type===`perfectable`?-t.alt:-(t.alt+1),oct:t.oct,dir:t.dir}).name}var Se=[1,2,2,3,3,4,5,5,6,6,7,7],Ce=`P m M m M P d P m M m M`.split(` `);function fromSemitones(e){let t=e<0?-1:1,n=Math.abs(e),r=n%12,i=Math.floor(n/12);return t*(Se[r]+7*i)+Ce[r]}var we=distance$1,Te=combinator((e,t)=>[e[0]+t[0],e[1]+t[1]]),addTo=e=>t=>Te(e,t),Ee={names:names$1,get:be,name:xe,num,semitones,quality,fromSemitones,distance:we,invert,simplify:simplify$1,add:Te,addTo,substract:combinator((e,t)=>[e[0]-t[0],e[1]-t[1]])};function combinator(e){return(t,n)=>{let r=interval(t).coord,i=interval(n).coord;if(r&&i)return coordToInterval(e(r,i)).name}}var De=Math.log(2),Oe=Math.log(440);function freqToMidi(e){let t=12*(Math.log(e)-Oe)/De+69;return Math.round(t*100)/100}var ke=`C C# D D# E F F# G G# A A# B`.split(` `),Ae=`C Db D Eb E F Gb G Ab A Bb B`.split(` `);function midiToNoteName(e,t={}){if(isNaN(e)||e===-1/0||e===1/0)return``;e=Math.round(e);let n=(t.sharps===!0?ke:Ae)[e%12];return t.pitchClass?n:n+(Math.floor(e/12)-1)}var je=[`C`,`D`,`E`,`F`,`G`,`A`,`B`],toName=e=>e.name,onlyNotes=e=>e.map(note).filter(e=>!e.empty);function names(e){return e===void 0?je.slice():Array.isArray(e)?onlyNotes(e).map(toName):[]}var G=note,name=e=>G(e).name,pitchClass=e=>G(e).pc,accidentals=e=>G(e).acc,octave=e=>G(e).oct,midi=e=>G(e).midi,freq=e=>G(e).freq,chroma=e=>G(e).chroma;function fromMidi(e){return midiToNoteName(e)}function fromFreq(e){return midiToNoteName(freqToMidi(e))}function fromFreqSharps(e){return midiToNoteName(freqToMidi(e),{sharps:!0})}function fromMidiSharps(e){return midiToNoteName(e,{sharps:!0})}var K=transpose$2,Me=transpose$2,transposeBy=e=>t=>K(t,e),Ne=transposeBy,transposeFrom=e=>t=>K(e,t),Pe=transposeFrom;function transposeFifths(e,t){let n=G(e);if(n.empty)return``;let[r,i]=n.coord;return coordToNote(i===void 0?[r+t]:[r+t,i]).name}var Fe=transposeFifths,ascending=(e,t)=>e.height-t.height,descending=(e,t)=>t.height-e.height;function sortedNames(e,t){return t||(t=ascending),onlyNotes(e).sort(t).map(toName)}function sortedUniqNames(e){return sortedNames(e,ascending).filter((e,t,n)=>t===0||e!==n[t-1])}var Ie=nameBuilder(!0),Le=nameBuilder(!1);function nameBuilder(e){return t=>{let n=G(t);if(n.empty)return``;let r=e?n.alt>0:n.alt<0,i=n.midi===null;return midiToNoteName(n.midi||n.chroma,{sharps:r,pitchClass:i})}}var q={names,get:G,name,pitchClass,accidentals,octave,midi,ascending,descending,sortedNames,sortedUniqNames,fromMidi,fromMidiSharps,freq,fromFreq,fromFreqSharps,chroma,transpose:K,tr:Me,transposeBy,trBy:Ne,transposeFrom,trFrom:Pe,transposeFifths,trFifths:Fe,simplify:Ie,enharmonic:Le},Re={empty:!0,name:``,chordType:``},ze={};function get$2(e){return typeof e==`string`?ze[e]||(ze[e]=parse(e)):typeof e==`number`?get$2(J[e]||``):isPitch(e)?fromPitch(e):isNamed(e)?get$2(e.name):Re}k(get$2,`get`);function fromPitch(e){return get$2(altToAcc(e.alt)+J[e.step])}var Be=/^(#{1,}|b{1,}|x{1,}|)(IV|I{1,3}|VI{0,2}|iv|i{1,3}|vi{0,2})([^IViv]*)$/;function tokenize$1(e){return Be.exec(e)||[``,``,``,``]}k(tokenize$1,`tokenize`);var Ve=`I II III IV V VI VII`,J=Ve.split(` `);Ve.toLowerCase().split(` `);function parse(e){let[t,n,r,i]=tokenize$1(e);if(!r)return Re;let a=r.toUpperCase(),o=J.indexOf(a),s=accToAlt(n);return{empty:!1,name:t,roman:r,interval:interval({step:o,alt:s,dir:1}).name,acc:n,chordType:i,alt:s,step:o,major:r===a,oct:0,dir:1}}var He=[[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`]],Ue={...z,name:``,alt:0,modeNum:NaN,triad:``,seventh:``,aliases:[]},We=He.map(toMode),Y={};We.forEach(e=>{Y[e.name]=e,e.aliases.forEach(t=>{Y[t]=e})});function get$1(e){return typeof e==`string`?Y[e.toLowerCase()]||Ue:e&&e.name?get$1(e.name):Ue}k(get$1,`get`);function toMode(e){let[t,n,r,i,a,o,s]=e,c=s?[s]:[],l=Number(n).toString(2);return{empty:!1,intervals:chromaToIntervals(l),modeNum:t,chroma:l,normalized:l,name:i,setNum:n,alt:r,triad:a,seventh:o,aliases:c}}var Ge=T(re(),1);function transpose(e,t){let n={...e},r=q.transpose(e.note.name+e.note.octave,Ee.fromSemitones(t));return n.note={name:q.pitchClass(r),number:e.note.number+t,octave:q.octave(r)},n}function transposeSyllableSeq(e,t){return e.map(e=>transpose(e,t))}function eventsToSyllableSequence(e){let t=[];e=e.filter(e=>e.type===`noteon`).sort((e,t)=>e.timestamp-t.timestamp);for(let n=10;n>0;n--)for(let r=0;r<e.length-n+1;r++)try{t.push(new X(e.slice(r,r+n))),e.splice(r,n),r=-1}catch{}return new Ke(t)}var Ke=class SyllableSequence{append(e){if(this.syllables.length)try{let t=new X(this.syllables[this.syllables.length-1].notes.map(e=>({note:e.note,timestamp:e.timestamp,type:e.type,velocity:e.velocity})).concat(e));this.syllables.splice(this.syllables.length-1,1,t)}catch{this.syllables.push(new X([e]))}else this.syllables.push(new X([e])),this.rootNote=e.note}constructor(e){b(this,`syllables`,void 0),b(this,`rootNote`,void 0),e.length>0?(this.syllables=e.sort((e,t)=>e.timestamp-t.timestamp),this.rootNote=this.syllables[0].notes.reduce((e,t)=>t.note.number<e.note.number?t:e).note):(this.syllables=[],this.rootNote={name:`C`,octave:4,number:0})}grade(e){let t=[];for(let n=0;n<this.syllables.length;n++)t.push(this.syllables[n].grade(e.syllables[n]));return new SyllableSequence(t)}toString(){let e=``;return this.syllables.forEach((t,n)=>{e+=`Syllable ${n+1}: {\n`,t.notes.forEach(t=>{e+=`\t${t.note.name}\t${t.note.number}\t${t.timestamp} ${t.isCorrect?``:`(incorrect)`} ${t.isMissing?`(missing)`:``}\n`}),e+=`} - ${t.timestamp}, correct: ${t.isCorrect}\n`}),e}isCorrect(){let e=!0;return this.syllables.forEach(t=>{t.isCorrect===!1?e=!1:t.notes.forEach(t=>{t.isCorrect===!1&&(e=!1)})}),e}},X=class Syllable{get timestamp(){let e=0;return this.notes.forEach(t=>{if(t.timestamp===0)return 0;e+=t.timestamp}),e/=this.notes.length,e}constructor(e){b(this,`notes`,void 0),b(this,`isCorrect`,void 0),e=e.filter(e=>e.type===`noteon`);let t=e.reduce((e,t)=>e.timestamp<t.timestamp?e:t),n=e.reduce((e,t)=>e.timestamp>t.timestamp?e:t).timestamp-t.timestamp;if(Syllable.gracePeriod(e.length)<n)throw Error(`Notes ${e.toString()} are not close enough together to be a syllable`);this.notes=e.map(e=>({...e,isCorrect:!0,isMissing:!1})).sort((e,t)=>e.note.number-t.note.number)}static gracePeriod(e){return 1.3*12*e}grade(e){return this.notes.length!==e.notes.length&&(e.isCorrect=!1),e.notes.forEach(t=>{let n=q.fromMidi(t.note.number),r=q.fromMidiSharps(t.note.number);n=q.pitchClass(n),r=q.pitchClass(r),t.isCorrect=this.notes.filter(e=>q.chroma(n)===q.chroma(e.note.name)||q.chroma(r)===q.chroma(e.note.name)).length>=1,t.isCorrect||(e.isCorrect=!1)}),this.notes.forEach(t=>{let n=q.fromMidi(t.note.number);n=q.pitchClass(n),e.notes.some(e=>q.chroma(e.note.name)===q.chroma(n))||e.notes.push({...t,isMissing:!0,isCorrect:!1})}),e}},Z=(A=class SkMidi{get state(){return this._state}constructor(e){b(this,`recording`,[]),b(this,`webmidi`,Ge.default),b(this,`input`,void 0),b(this,`output`,void 0),b(this,`_noteonListeners`,[]),b(this,`_noteoffListeners`,[]),b(this,`midiAccess`,void 0),b(this,`_state`,`initializing`),b(this,`_userLookup`,void 0),this._userLookup=e??null}async init(){if(!this.midiAccess)try{navigator.requestMIDIAccess().then(e=>{this.midiAccess=e,this.midiAccess.onstatechange=e=>{w({text:`Midi device ${e.port.name} is ${e.port.state}`,status:e.port.state===`connected`?x.ok:x.error})}})}catch(e){console.log(`Webmidi not enabled: ${e}`),this._state=`notsupported`}try{this.webmidi.disable()}catch(e){console.log(`Webmidi not enabled: ${e}`),this._state=`notsupported`}return new Promise((e,t)=>{this.webmidi.enable(async n=>{n?(this._state=`notsupported`,console.log(`Webmidi not enabled: ${n}`),t(n)):(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],SkMidi._initializedWithUserConfig||(SkMidi._initializedWithUserConfig=(await this.loadUserConfiguration(),!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`),e(!0))})})}async loadUserConfiguration(){try{if(!this._userLookup){console.log(`User lookup function not provided - using default MIDI configuration`);return}let e=await this._userLookup();if(!e){console.log(`No user found, using default MIDI configuration`);return}let t=await e.getActiveCourses();for(let n of t){let t=await(await e.getCourseInterface(n.courseID)).getCourseSettings();if(t?.midiinput||t?.midioutput){t.midiinput&&this.webmidi.getInputById(t.midiinput.toString())&&(this.selectInput(t.midiinput.toString()),console.log(`Loaded saved MIDI input: ${t.midiinput}`)),t.midioutput&&this.webmidi.getOutputById(t.midioutput.toString())&&(this.selectOutput(t.midioutput.toString()),console.log(`Loaded saved MIDI output: ${t.midioutput}`));break}}}catch(e){console.error(`Failed to load user MIDI configuration:`,e)}}setStateChangeListener(e){if(this.midiAccess)this.midiAccess.onstatechange=t=>{this.init().then(()=>{console.log(`Midi state: ${this.state}`),e()}),w({text:`Midi device ${t.port.name} is ${t.port.state}`,status:t.port.state===`connected`?x.ok:x.error})};else try{navigator.requestMIDIAccess().then(t=>{this.midiAccess=t,this.midiAccess.onstatechange=t=>{this.init().then(()=>{console.log(`Midi state: ${this.state}`),e()}),w({text:`Midi device ${t.port.name} is ${t.port.state}`,status:t.port.state===`connected`?x.ok:x.error})}})}catch(e){console.log(`Webmidi not enabled: ${e}`),this._state=`notsupported`}}attachListeners(){this.input&&(this._noteonListeners.forEach(e=>{this.input?.on(`noteon`,`all`,e)}),this._noteoffListeners.forEach(e=>{this.input?.on(`noteoff`,`all`,e)}))}get hasRecording(){return this.record.length>0}get configuredInput(){return this.input?`${this.input.manufacturer}: ${this.input.name}`:`(Not Sure!)`}eraseRecording(){this.recording=[]}stopRecording(){this.input?.removeListener()}record(){let e=0;if(this.input===void 0)throw Error(`Midi input not configured!`);this.input.connection===`open`&&(this.stopRecording(),this.eraseRecording(),this.input.on(`noteon`,`all`,t=>{this.recording.length===0&&(e=t.timestamp),this.recording.push({note:t.note,type:t.type,velocity:t.velocity,timestamp:t.timestamp-e})}),this.input.on(`noteoff`,`all`,t=>{this.recording.length===0&&(e=t.timestamp),this.recording.push({note:t.note,velocity:t.velocity,type:t.type,timestamp:t.timestamp-e})}))}addNoteonListenter(e){this._noteonListeners.push(e),this.input&&this.input.on(`noteon`,`all`,e)}addNoteoffListenter(e){this._noteoffListeners.push(e),this.input&&this.input.on(`noteoff`,`all`,e)}play(e){let t=e||this.recording;t=t.map(e=>({...e,timestamp:e.timestamp+SkMidi.OFFSET})),t.forEach(e=>{e.type===`noteon`?this.output?.playNote(e.note.name+e.note.octave,1,{velocity:e.velocity,time:`+${e.timestamp}`,rawVelocity:!1}):this.output?.stopNote(e.note.name+e.note.octave,1,{velocity:e.velocity,time:`+${e.timestamp}`,rawVelocity:!1})})}static async instance(){return SkMidi._instance?SkMidi._instance:(console.log(`Buzz, whirr, Midi instance factory is at work`),SkMidi._instance=new SkMidi,await SkMidi._instance.init(),SkMidi._instance)}get inputs(){return this.webmidi.inputs}get outputs(){return this.webmidi.outputs}selectInput(e){this.webmidi.getInputById(e)===!1?this.webmidi.getInputByName(e)!==!1&&(this.input=this.webmidi.getInputByName(e)):this.input=this.webmidi.getInputById(e)}selectOutput(e){this.webmidi.getOutputById(e)===!1?this.webmidi.getOutputByName(e)!==!1&&(this.output=this.webmidi.getOutputByName(e)):this.output=this.webmidi.getOutputById(e)}},b(A,`_instance`,void 0),b(A,`OFFSET`,5),b(A,`_initializedWithUserConfig`,!1),A),qe=s({name:`SyllableSeqVis`,props:{seq:{type:Object,required:!0},lastTSsuggestion:{type:Number,required:!1,default:0}},setup(e){let t=p(0),n=p(0),r=p(0),i=p(500),sayNote=e=>{console.log(`${JSON.stringify(e)}`)},a=f(()=>{let t=e.seq.syllables[e.seq.syllables.length-1].timestamp;return Math.max(1,t,e.lastTSsuggestion)}),o=f(()=>{let t=0,n=500;return e.seq.syllables.forEach(e=>{e.notes.forEach(e=>{e.note.number>t&&(t=e.note.number),e.note.number<n&&(n=e.note.number)})}),Math.max(3*(t-n)+10,0)}),updateBounds=()=>{try{t.value=e.seq.syllables[0].timestamp;let r=e.seq.syllables[e.seq.syllables.length-1].timestamp,i=t.value+e.lastTSsuggestion;n.value=Math.max(r,i)}catch(e){console.log(`[SyllableSeqVis] Error updating bounds: ${e}`)}e.seq.syllables.forEach(e=>{e.notes.forEach(e=>{e.note.number>r.value&&(r.value=e.note.number),e.note.number<i.value&&(i.value=e.note.number)})})};return g(()=>{console.log(`SyllableSeqVis created w/ input: \n${e.seq}`),updateBounds()}),{firstTS:t,lastTS:n,high:r,low:i,sayNote,getLastTS:a,getHeight:o,updateBounds}}}),Je=[`height`],Ye=[`cx`,`cy`,`alt`,`fill`,`stroke`,`onMouseenter`];function _sfc_render$3(e,t,r,i,a,o){return n(),u(`div`,null,[(n(),u(`svg`,{width:510,height:Math.max(3*(e.high-e.low)+10,0)},[(n(!0),u(d,null,c(e.seq.syllables,t=>(n(),u(d,null,[(n(!0),u(d,null,c(t.notes,r=>(n(),u(`circle`,{key:t.timestamp+`-`+r.note.number,cx:(t.timestamp-e.firstTS)*500/(e.lastTS-e.firstTS)+4,cy:3*(e.high-r.note.number)+4,alt:r.note.name,r:`3`,fill:r.isCorrect?`black`:r.isMissing?`none`:`red`,stroke:r.isMissing?`red`:`none`,onMouseenter:t=>e.sayNote(r)},null,40,Ye))),128))],64))),256))],8,Je))])}k(_sfc_render$3,`_sfc_render`);var Xe=O(qe,[[`render`,_sfc_render$3],[`__scopeId`,`data-v-2f79c080`]]),Ze=s({name:`NoteDisplay`,props:{chroma:{type:Number,required:!0}},setup(e){let style=t=>{let n=`#ffffff`;return t===e.chroma?n=`#1976D2`:(t===1||t===3||t===6||t===8||t===10||t===-2)&&(n=`#000000`),{fill:n,"fill-opacity":1,stroke:`#000000`,"stroke-width":.79375,"stroke-miterlimit":4,"stroke-dasharray":`none`,"stroke-opacity":1}};return{style,white:-1,black:-2}}}),Qe={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`},$e={id:`metadata5`},et={id:`layer1`,transform:`translate(167.75219,-151.96011)`,"inkscape:groupmode":`layer`,"inkscape:label":`Layer 1`};function _sfc_render$2(r,i,s,c,d,f){let p=a(`sodipodi:namedview`),m=a(`dc:format`),h=a(`dc:type`),g=a(`dc:title`),v=a(`cc:Work`),y=a(`rdf:RDF`);return n(),u(`svg`,Qe,[i[1]||(i[1]=l(`defs`,{id:`defs2`},null,-1)),t(p,{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`}),l(`metadata`,$e,[t(y,null,{default:e(()=>[t(v,{"rdf:about":``},{default:e(()=>[t(m,null,{default:e(()=>i[0]||(i[0]=[o(`image/svg+xml`)])),_:1}),t(h,{"rdf:resource":`http://purl.org/dc/dcmitype/StillImage`}),t(g)]),_:1})]),_:1})]),l(`g`,et,[l(`rect`,{id:`rect845`,y:`152.19064`,x:`-150.12129`,height:`73.220116`,width:`17.486626`,style:_(r.style(0))},null,4),l(`rect`,{id:`rect845-9`,style:_(r.style(2)),width:`17.486626`,height:`73.220116`,x:`-132.63466`,y:`152.19064`},null,4),l(`rect`,{id:`rect845-6`,style:_(r.style(4)),width:`17.486626`,height:`73.220116`,x:`-115.14803`,y:`152.19064`},null,4),l(`rect`,{id:`rect845-4`,style:_(r.style(5)),width:`17.486626`,height:`73.220116`,x:`-97.661407`,y:`152.19064`},null,4),l(`rect`,{id:`rect845-92`,style:_(r.style(7)),width:`17.486626`,height:`73.220116`,x:`-80.174782`,y:`152.19064`},null,4),l(`rect`,{id:`rect845-3`,style:_(r.style(9)),width:`17.486626`,height:`73.220116`,x:`-62.688156`,y:`152.19064`},null,4),l(`rect`,{id:`rect845-0`,style:_(r.style(11)),width:`17.486626`,height:`73.220116`,x:`-45.20153`,y:`152.19064`},null,4),l(`rect`,{id:`rect845-30`,style:_(r.style(r.white)),width:`17.486626`,height:`73.220116`,x:`-27.714905`,y:`152.10745`},null,4),l(`rect`,{id:`rect898`,ry:`0`,y:`152.10744`,x:`-138.43532`,height:`54.415863`,width:`10.466455`,style:_(r.style(1))},null,4),l(`rect`,{id:`rect898-3`,style:_(r.style(3)),width:`10.466455`,height:`54.415863`,x:`-120.84978`,y:`152.10744`,ry:`0`},null,4),l(`rect`,{id:`rect898-7`,style:_(r.style(6)),width:`10.466455`,height:`54.415863`,x:`-85.678711`,y:`152.10744`,ry:`0`},null,4),l(`rect`,{id:`rect898-8`,style:_(r.style(8)),width:`10.466455`,height:`54.415863`,x:`-68.09317`,y:`152.10744`,ry:`0`},null,4),l(`rect`,{id:`rect898-1`,style:_(r.style(10)),width:`10.466455`,height:`54.415863`,x:`-50.507633`,y:`152.10744`,ry:`0`},null,4),l(`rect`,{id:`rect845-30-1`,y:`152.10745`,x:`-10.228278`,height:`73.220116`,width:`17.486626`,style:_(r.style(r.white))},null,4),l(`rect`,{id:`rect845-30-9`,y:`152.10744`,x:`-167.60791`,height:`73.220116`,width:`17.486626`,style:_(r.style(r.white))},null,4),l(`rect`,{id:`rect898-4`,style:_(r.style(r.black)),width:`10.466455`,height:`54.415863`,x:`-15.336554`,y:`152.10744`,ry:`0`},null,4),l(`rect`,{id:`rect898-74`,style:_(r.style(r.black)),width:`4.4679713`,height:`54.415863`,x:`-167.60791`,y:`152.10744`,ry:`0`},null,4),l(`rect`,{id:`rect898-10`,style:_(r.style(r.black)),width:`5.1863246`,height:`54.507248`,x:`2.2092075`,y:`152.06175`,ry:`0`},null,4)])])}k(_sfc_render$2,`_sfc_render`);var tt=s({name:`Playback`,components:{SyllableSeqVis:Xe,NoteDisplay:O(Ze,[[`render`,_sfc_render$2]])},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){let n=ne(e,t,`Playback`),r=ee(n),a=p(),o=p(!1),s=p(`notSet`),c=p(!1),l=p(0),u=p(v.utc()),d=p(0),m=p(0),h=p(eventsToSyllableSequence([])),_=p(!1),y=p(eventsToSyllableSequence([])),b=p(0),S=p(``),C=p(0),T=p(0),E=p(),D=p();r.question.value=new Q(e.data);let O=f(()=>new Q(e.data)),k=f(()=>eventsToSyllableSequence(O.value.midi).syllables[0].notes.length>1?`Lowest note of first chord:`:`First note:`),A=f(()=>o.value?eventsToSyllableSequence(O.value.midi).rootNote.number%12:0),init=()=>{s.value?s.value!==a.value?.state&&(o.value=!1,s.value=a.value?.state||`notSet`,o.value=!0):(s.value=a.value?.state||`notSet`,o.value=!0),n.logger.log(`Playback is running init with state: ${s.value}`),s.value===`ready`&&(d.value=O.value.duration,play())},runProgressBar=()=>{try{E.value&&(E.value.style.animationName=``,requestAnimationFrame(()=>{requestAnimationFrame(()=>{E.value&&(E.value.style.animationDuration=d.value+`ms`,E.value.style.animationName=`progress`)})}))}catch{setTimeout(runProgressBar,50)}},record=()=>{a.value?.record(),c.value=!0,a.value?.addNoteonListenter(e=>{C.value++,y.value.append(e),D.value?.updateBounds(),C.value+T.value>=O.value.midi.length&&submit()}),a.value?.addNoteoffListenter(()=>{T.value++,C.value+T.value>=O.value.midi.length&&submit()})},play=()=>{a.value?.stopRecording(),a.value?.eraseRecording(),u.value=v.utc(),C.value=0,T.value=0,c.value=!1,l.value=0,runProgressBar(),a.value?.play(O.value.midi),setTimeout(()=>{n.logger.log(`done playback...`),record()},O.value.lastNoteOnTimestamp)},submit=()=>{if(!a.value?.recording)return!1;let e=eventsToSyllableSequence(O.value.midi),t=eventsToSyllableSequence(a.value.recording);return h.value=e.grade(t),y.value=eventsToSyllableSequence([]),r.submitAnswer(a.value.recording).isCorrect?!0:(m.value++,_.value=!0,m.value<r.maxAttemptsPerView.value&&play(),!1)},clearAttempt=()=>{C.value>0?submit():play()};return g(async()=>{try{a.value=await Z.instance(),a.value.setStateChangeListener(()=>{init()}),o.value=!0}catch(e){w({status:x.error,text:`Midi device not supported`}),S.value=JSON.stringify(e),s.value=`notsupported`,o.value=!0}init(),te.addBinding([{hotkey:`space`,callback:clearAttempt,command:`Clear attempt or play again`}])}),i(()=>{te.removeBinding(`space`)}),{...n,...r,initialized:o,state:s,recording:c,inputSeq:y,lastTSsuggestion:b,gradedSeq:h,graded:_,promptText:k,firstNoteChroma:A,progressBar:E,inputVisRef:D,clearAttempt,notesOn:C}}}),nt={key:0,"data-viewable":`Playback`},rt={key:0},it={class:`text-h4`},at={class:`text-h5`},ot={key:0},st={class:`progressContainer`},ct={id:`progress`,ref:`progressBar`},lt={key:1},ut={key:2};function _sfc_render$1(i,s,c,d,f,p){let g=a(`note-display`),_=a(`v-icon`),v=a(`v-btn`),y=a(`syllable-seq-vis`);return i.initialized?(n(),u(`div`,nt,[i.state===`ready`?(n(),u(`div`,rt,[l(`div`,it,[o(r(i.promptText)+` `,1),t(g,{chroma:i.firstNoteChroma},null,8,[`chroma`])]),l(`div`,at,[s[0]||(s[0]=o(`Listen...`)),i.recording?(n(),u(`span`,ot,` and Repeat`)):h(``,!0)]),l(`div`,st,[l(`div`,ct,null,512)]),t(v,{color:`primary`,autofocus:``,onClick:i.clearAttempt},{default:e(()=>[s[2]||(s[2]=o(` Play again `)),t(_,{end:``},{default:e(()=>s[1]||(s[1]=[o(`volume_up`)])),_:1})]),_:1},8,[`onClick`]),(n(),m(y,{key:0,ref:`inputVisRef`,seq:i.inputSeq,"last-t-ssuggestion":i.lastTSsuggestion},null,8,[`seq`,`last-t-ssuggestion`])),i.graded?(n(),m(y,{key:1,seq:i.gradedSeq},null,8,[`seq`])):h(``,!0)])):i.state===`nodevice`?(n(),u(`div`,lt,`No midi device detected. Please attach one!`)):i.state===`notsupported`?(n(),u(`div`,ut,s[3]||(s[3]=[l(`p`,null,`This exercise requires a midi input device, which is not supported by this browser ☹`,-1),l(`div`,null,[l(`p`,null,`Please try again with one of the following browsers:`),l(`ul`,null,[l(`li`,null,[l(`a`,{href:`https://www.google.com/chrome/`},`Google Chrome`)]),l(`li`,null,[l(`a`,{href:`https://www.microsoft.com/edge`},`Microsoft Edge`)]),l(`li`,null,[l(`a`,{href:`https://brave.com/`},`Brave`)])])],-1)]))):h(``,!0)])):h(``,!0)}k(_sfc_render$1,`_sfc_render`);var dt=O(tt,[[`render`,_sfc_render$1]]),ft=[{name:`Melody`,type:y.MIDI}],Q=(j=class EchoQuestion extends C{constructor(e){var _super=(...e)=>(super(...e),b(this,`midi`,void 0),this);_super(e),this.midi=e[0].Melody}get duration(){return this.midi.reduce((e,t)=>t.timestamp>e.timestamp?t:e).timestamp}get lastNoteOnTimestamp(){return this.midi.filter(e=>e.type===`noteon`).reduce((e,t)=>t.timestamp>e.timestamp?t:e).timestamp}isCorrect(e){let t=eventsToSyllableSequence(this.midi),n=eventsToSyllableSequence(e);try{return t.grade(n).isCorrect()}catch(e){return console.log(`ERROR grading this midi sequence!`,e),!1}}dataShapes(){return EchoQuestion.dataShapes}views(){return EchoQuestion.views}},b(j,`dataShapes`,[{fields:ft,name:S.PIANO_Echo}]),b(j,`views`,[dt]),j),pt=s({name:`NotePlayback`,components:{},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){let n=ne(e,t,`NotePlayback`),r=ee(n),i=p(),a=p(!1),o=p(!1),s=p(0),c=p(v.utc()),l=p(0),u=p(eventsToSyllableSequence([])),d=p(!1),m=p(eventsToSyllableSequence([])),h=p(``);r.question.value=new $(e.data);let _=f(()=>new $(e.data)),record=()=>{i.value?.record(),o.value=!0,i.value?.addNoteonListenter(e=>{m.value.append(e)}),i.value?.addNoteoffListenter(()=>{i.value?.recording?.length&&i.value?.recording?.length>=2&&submit()})},play=()=>{i.value?.stopRecording(),i.value?.eraseRecording(),c.value=v.utc(),o.value=!1,s.value=0,record()},submit=()=>i.value?.recording?(m.value=eventsToSyllableSequence([]),r.submitAnswer(i.value.recording).isCorrect?!0:(l.value++,d.value=!0,l.value<r.maxAttemptsPerView.value&&play(),!1)):!1;return g(async()=>{try{i.value=await Z.instance(),h.value=_.value.note,play(),a.value=!0}catch(e){n.logger.error(`Failed to initialize MIDI:`,e)}}),{...n,...r,initialized:a,recording:o,inputSeq:m,gradedSeq:u,graded:d,note:h,attempts:l}}}),mt={"data-viewable":`NotePlayback`},ht={class:`text-h4`},gt={class:`font-weight-bold`},_t={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`},vt={id:`metadata5`};function _sfc_render(i,s,c,d,f,p){let m=a(`sodipodi:namedview`),g=a(`dc:format`),_=a(`dc:type`),v=a(`dc:title`),y=a(`cc:Work`),b=a(`rdf:RDF`);return n(),u(`div`,mt,[l(`div`,ht,[s[0]||(s[0]=o(` Play the note: `)),l(`span`,gt,r(i.note),1)]),i.graded?(n(),u(`svg`,_t,[s[2]||(s[2]=l(`defs`,{id:`defs2`},null,-1)),t(m,{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`}),l(`metadata`,vt,[t(b,null,{default:e(()=>[t(y,{"rdf:about":``},{default:e(()=>[t(g,null,{default:e(()=>s[1]||(s[1]=[o(`image/svg+xml`)])),_:1}),t(_,{"rdf:resource":`http://purl.org/dc/dcmitype/StillImage`}),t(v)]),_:1})]),_:1})]),s[3]||(s[3]=l(`g`,{id:`layer1`,transform:`translate(167.75219,-151.96011)`,"inkscape:groupmode":`layer`,"inkscape:label":`Layer 1`},[l(`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`}}),l(`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`}),l(`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`}),l(`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`}),l(`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`}),l(`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`}),l(`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`}),l(`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`}),l(`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`}}),l(`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`}),l(`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`}),l(`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`}),l(`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`}),l(`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`}}),l(`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`}}),l(`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`}),l(`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`}),l(`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))])):h(``,!0)])}var yt=O(pt,[[`render`,_sfc_render]]),bt=[{name:`Note`,type:y.STRING}],$=(M=class PlayNote extends C{constructor(e){var _super2=(...e)=>(super(...e),b(this,`note`,void 0),this);_super2(e),this.note=e[0].Note}isCorrect(e){return e[0].note.name===this.note}dataShapes(){return PlayNote.dataShapes}views(){return PlayNote.views}},b(M,`dataShapes`,[{fields:bt,name:S.PIANO_PlayNote}]),b(M,`seedData`,[`A`,`B`,`C`,`D`,`E`,`F`,`G`,`A♯`,`C♯`,`D♯`,`F♯`,`G♯`,`D♭`,`E♭`,`G♭`,`A♭`,`B♭`].map(e=>({Note:e}))),b(M,`views`,[yt]),M),xt=new D(`piano`,[Q,$]);export{transposeSyllableSeq as a,eventsToSyllableSequence as i,Xe as n,xt as o,Z as r,Ke as t};
|
|
2
|
-
//# sourceMappingURL=piano-DF1g6yaX-B7f_kt1X.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./chunk-D6hFPZc3.js";import{C as e,H as t,K as n,S as r,T as i,b as a,f as o,g as s,ut as c,y as l,z as u}from"./vue.runtime.esm-bundler--Fxmd6l9.js";import{E as d,b as f,k as p,n as m}from"./dist-V9Xbab2f.js";import{C as h,w as g}from"./MarkdownRenderer-U_iPiA2x-DDruDu7E.js";import{D as _,h as v}from"./common-ui.es-B9r6QiWN.js";import{n as y,s as b,t as x}from"./CourseWare-BTFRjgBR-C3wi5YHa.js";var S,C=i({name:`IdentifyChroma`,components:{RadioMultipleChoice:_},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){let n=g(e,t,`IdentifyChroma`),r=h(n),i=c(``),a=c(new AudioContext);r.question.value=new O(e.data);let o=s(()=>r.question.value),octaves=e=>{let t=[],n=e/2;for(;n>100;)t.push(n),n/=2;t.push(e);let r=e*2;for(;r<5e3;)t.push(r),r*=2;return t},tone=e=>{let t=a.value.createOscillator();t.type=`sine`,t.frequency.value=e;let n=a.value.createGain();console.log(`Max Gain: `+n.gain.maxValue),n.gain.setValueAtTime(0,0),n.gain.linearRampToValueAtTime(.5,15),t.connect(n),n.connect(a.value.destination),t.start(0),t.stop(14)};u(()=>{octaves(295).forEach(e=>tone(e))});let submit=()=>{o.value&&o.value.isCorrect(i.value)};return{...n,...r,answer:i,question:o,submit}}}),w={"data-viewable":`IdentifyChroma`};function _sfc_render(i,s,c,u,d,f){let p=n(`radio-multiple-choice`);return t(),a(`div`,w,[i.question?(t(),a(o,{key:0},[s[0]||(s[0]=r(` What note is being played? `)),e(p,{"choice-list":i.question.choiceList},null,8,[`choice-list`])],64)):l(``,!0)])}var T=x(C,[[`render`,_sfc_render]]),E=function(e){return e.A=`A`,e.B=`B`,e.C=`C`,e.D=`D`,e.E=`E`,e.F=`F`,e.G=`G`,e}(E||{}),D=[{name:`Chroma`,type:d.STRING,validator:{test:e=>Object.values(E).includes(e)?{status:p.ok,msg:``}:{status:p.error,msg:`That's not a chroma!`},instructions:`Enter a valid musical note (A-G)`}}],O=(S=class ChromaQuestion extends v{constructor(e){var _super=(...e)=>(super(...e),f(this,`chroma`,void 0),this);_super(e),this.chroma=e[0].Chroma}get baseFreq(){return this.chroma===`A`?440:this.chroma===`B`?440*2**(2/12):this.chroma===`C`?440*2**(3/12):440}get choiceList(){return b([this.chroma.toString(),`test`,`options`,`are`,`fun`])}isCorrect(e){return e.choiceList[e.selection]===this.chroma.toString()}dataShapes(){return ChromaQuestion.dataShapes}views(){return ChromaQuestion.views}},f(S,`dataShapes`,[{fields:D,name:m.PITCH_chroma}]),f(S,`views`,[T]),S),k=new y(`pitch`,[O]);export{k as t};
|
|
2
|
-
//# sourceMappingURL=pitch-CgGJFkZ1-CuezrVTg.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./vue.runtime.esm-bundler--Fxmd6l9.js";import"./dist-V9Xbab2f.js";import"./MarkdownRenderer-U_iPiA2x-DDruDu7E.js";import"./dist-BeppzTWu.js";import"./common-ui.es-B9r6QiWN.js";import"./CourseWare-BTFRjgBR-C3wi5YHa.js";import{t as e}from"./pitch-CgGJFkZ1-CuezrVTg.js";export{e as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./chunk-D6hFPZc3.js";import{k as t}from"./dist-V9Xbab2f.js";import{r as n}from"./index-CDxzcoT1.js";var r=e(((e,t)=>{(function(e,n,r){if(!e)return;for(var i={8:`backspace`,9:`tab`,13:`enter`,16:`shift`,17:`ctrl`,18:`alt`,20:`capslock`,27:`esc`,32:`space`,33:`pageup`,34:`pagedown`,35:`end`,36:`home`,37:`left`,38:`up`,39:`right`,40:`down`,45:`ins`,46:`del`,91:`meta`,93:`meta`,224:`meta`},a={106:`*`,107:`+`,109:`-`,110:`.`,111:`/`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},o={"~":"`","!":`1`,"@":`2`,"#":`3`,$:`4`,"%":`5`,"^":`6`,"&":`7`,"*":`8`,"(":`9`,")":`0`,_:`-`,"+":`=`,":":`;`,'"':`'`,"<":`,`,">":`.`,"?":`/`,"|":`\\`},s={option:`alt`,command:`meta`,return:`enter`,escape:`esc`,plus:`+`,mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?`meta`:`ctrl`},c,l=1;l<20;++l)i[111+l]=`f`+l;for(l=0;l<=9;++l)i[l+96]=l.toString();function _addEvent(e,t,n){if(e.addEventListener){e.addEventListener(t,n,!1);return}e.attachEvent(`on`+t,n)}function _characterFromEvent(e){if(e.type==`keypress`){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return i[e.which]?i[e.which]:a[e.which]?a[e.which]:String.fromCharCode(e.which).toLowerCase()}function _modifiersMatch(e,t){return e.sort().join(`,`)===t.sort().join(`,`)}function _eventModifiers(e){var t=[];return e.shiftKey&&t.push(`shift`),e.altKey&&t.push(`alt`),e.ctrlKey&&t.push(`ctrl`),e.metaKey&&t.push(`meta`),t}function _preventDefault(e){if(e.preventDefault){e.preventDefault();return}e.returnValue=!1}function _stopPropagation(e){if(e.stopPropagation){e.stopPropagation();return}e.cancelBubble=!0}function _isModifier(e){return e==`shift`||e==`ctrl`||e==`alt`||e==`meta`}function _getReverseMap(){if(!c)for(var e in c={},i)e>95&&e<112||i.hasOwnProperty(e)&&(c[i[e]]=e);return c}function _pickBestAction(e,t,n){return n||(n=_getReverseMap()[e]?`keydown`:`keypress`),n==`keypress`&&t.length&&(n=`keydown`),n}function _keysFromString(e){return e===`+`?[`+`]:(e=e.replace(/\+{2}/g,`+plus`),e.split(`+`))}function _getKeyInfo(e,t){var n,r,i,a=[];for(n=_keysFromString(e),i=0;i<n.length;++i)r=n[i],s[r]&&(r=s[r]),t&&t!=`keypress`&&o[r]&&(r=o[r],a.push(`shift`)),_isModifier(r)&&a.push(r);return t=_pickBestAction(r,a,t),{key:r,modifiers:a,action:t}}function _belongsTo(e,t){return e===null||e===n?!1:e===t?!0:_belongsTo(e.parentNode,t)}function Mousetrap(e){var t=this;if(e=e||n,!(t instanceof Mousetrap))return new Mousetrap(e);t.target=e,t._callbacks={},t._directMap={};var r={},i,a=!1,o=!1,s=!1;function _resetSequences(e){e=e||{};var t=!1,n;for(n in r){if(e[n]){t=!0;continue}r[n]=0}t||(s=!1)}function _getMatches(e,n,i,a,o,s){var c,l,u=[],d=i.type;if(!t._callbacks[e])return[];for(d==`keyup`&&_isModifier(e)&&(n=[e]),c=0;c<t._callbacks[e].length;++c)if(l=t._callbacks[e][c],!(!a&&l.seq&&r[l.seq]!=l.level)&&d==l.action&&(d==`keypress`&&!i.metaKey&&!i.ctrlKey||_modifiersMatch(n,l.modifiers))){var f=!a&&l.combo==o,p=a&&l.seq==a&&l.level==s;(f||p)&&t._callbacks[e].splice(c,1),u.push(l)}return u}function _fireCallback(e,n,r,i){t.stopCallback(n,n.target||n.srcElement,r,i)||e(n,r)===!1&&(_preventDefault(n),_stopPropagation(n))}t._handleKey=function(e,t,n){var r=_getMatches(e,t,n),i,a={},c=0,l=!1;for(i=0;i<r.length;++i)r[i].seq&&(c=Math.max(c,r[i].level));for(i=0;i<r.length;++i){if(r[i].seq){if(r[i].level!=c)continue;l=!0,a[r[i].seq]=1,_fireCallback(r[i].callback,n,r[i].combo,r[i].seq);continue}l||_fireCallback(r[i].callback,n,r[i].combo)}var u=n.type==`keypress`&&o;n.type==s&&!_isModifier(e)&&!u&&_resetSequences(a),o=l&&n.type==`keydown`};function _handleKeyEvent(e){typeof e.which!=`number`&&(e.which=e.keyCode);var n=_characterFromEvent(e);if(n){if(e.type==`keyup`&&a===n){a=!1;return}t.handleKey(n,_eventModifiers(e),e)}}function _resetSequenceTimer(){clearTimeout(i),i=setTimeout(_resetSequences,1e3)}function _bindSequence(e,t,n,i){r[e]=0;function _increaseSequence(t){return function(){s=t,++r[e],_resetSequenceTimer()}}function _callbackAndReset(t){_fireCallback(n,t,e),i!==`keyup`&&(a=_characterFromEvent(t)),setTimeout(_resetSequences,10)}for(var o=0;o<t.length;++o){var c=o+1===t.length?_callbackAndReset:_increaseSequence(i||_getKeyInfo(t[o+1]).action);_bindSingle(t[o],c,i,e,o)}}function _bindSingle(e,n,r,i,a){t._directMap[e+`:`+r]=n,e=e.replace(/\s+/g,` `);var o=e.split(` `),s;if(o.length>1){_bindSequence(e,o,n,r);return}s=_getKeyInfo(e,r),t._callbacks[s.key]=t._callbacks[s.key]||[],_getMatches(s.key,s.modifiers,{type:s.action},i,e,a),t._callbacks[s.key][i?`unshift`:`push`]({callback:n,modifiers:s.modifiers,action:s.action,seq:i,level:a,combo:e})}t._bindMultiple=function(e,t,n){for(var r=0;r<e.length;++r)_bindSingle(e[r],t,n)},_addEvent(e,`keypress`,_handleKeyEvent),_addEvent(e,`keydown`,_handleKeyEvent),_addEvent(e,`keyup`,_handleKeyEvent)}Mousetrap.prototype.bind=function(e,t,n){var r=this;return e=e instanceof Array?e:[e],r._bindMultiple.call(r,e,t,n),r},Mousetrap.prototype.unbind=function(e,t){var n=this;return n.bind.call(n,e,function(){},t)},Mousetrap.prototype.trigger=function(e,t){var n=this;return n._directMap[e+`:`+t]&&n._directMap[e+`:`+t]({},e),n},Mousetrap.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},Mousetrap.prototype.stopCallback=function(e,t){var n=this;if((` `+t.className+` `).indexOf(` mousetrap `)>-1||_belongsTo(t,n.target))return!1;if(`composedPath`in e&&typeof e.composedPath==`function`){var r=e.composedPath()[0];r!==e.target&&(t=r)}return t.tagName==`INPUT`||t.tagName==`SELECT`||t.tagName==`TEXTAREA`||t.isContentEditable},Mousetrap.prototype.handleKey=function(){var e=this;return e._handleKey.apply(e,arguments)},Mousetrap.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);c=null},Mousetrap.init=function(){var e=Mousetrap(n);for(var t in e)t.charAt(0)!==`_`&&(Mousetrap[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},Mousetrap.init(),e.Mousetrap=Mousetrap,t!==void 0&&t.exports&&(t.exports=Mousetrap),typeof define==`function`&&define.amd&&define(function(){return Mousetrap})})(typeof window<`u`?window:null,typeof window<`u`?document:null)})),i=n.EXPRESS_SERVER_PROTOCOL+`://`+n.EXPRESS_SERVER_URL;async function serverRequest(e){return new Promise(n=>{try{let r=new XMLHttpRequest;r.withCredentials=!0,r.open(`POST`,i,!0),r.setRequestHeader(`Content-Type`,`application/json`),r.timeout=e.timeout||7e3,r.onload=function(){try{e.response=JSON.parse(r.responseText),n(e)}catch(r){e.response={status:t.error,ok:!1,errorText:`Failed to parse response: ${r instanceof Error?r.message:JSON.stringify(r)}`},n(e)}},r.onerror=function(){e.response={status:t.error,ok:!1,errorText:`Network error occurred`},n(e)},r.ontimeout=function(){e.response={status:t.error,ok:!1,errorText:`Request timed out`},n(e)},r.send(JSON.stringify(e))}catch(r){e.response={status:t.error,ok:!1,errorText:r instanceof Error?r.message:JSON.stringify(r)},n(e)}})}export{r as n,serverRequest as t};
|
|
2
|
-
//# sourceMappingURL=server-BP-NvFg7.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server-BP-NvFg7.js","names":[],"sources":["../../../../node_modules/mousetrap/mousetrap.js","../../src/server/index.ts"],"sourcesContent":["/*global define:false */\n/**\n * Copyright 2012-2017 Craig Campbell\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Mousetrap is a simple keyboard shortcut library for Javascript with\n * no external dependencies\n *\n * @version 1.6.5\n * @url craig.is/killing/mice\n */\n(function(window, document, undefined) {\n\n // Check if mousetrap is used inside browser, if not, return\n if (!window) {\n return;\n }\n\n /**\n * mapping of special keycodes to their corresponding keys\n *\n * everything in this dictionary cannot use keypress events\n * so it has to be here to map to the correct keycodes for\n * keyup/keydown events\n *\n * @type {Object}\n */\n var _MAP = {\n 8: 'backspace',\n 9: 'tab',\n 13: 'enter',\n 16: 'shift',\n 17: 'ctrl',\n 18: 'alt',\n 20: 'capslock',\n 27: 'esc',\n 32: 'space',\n 33: 'pageup',\n 34: 'pagedown',\n 35: 'end',\n 36: 'home',\n 37: 'left',\n 38: 'up',\n 39: 'right',\n 40: 'down',\n 45: 'ins',\n 46: 'del',\n 91: 'meta',\n 93: 'meta',\n 224: 'meta'\n };\n\n /**\n * mapping for special characters so they can support\n *\n * this dictionary is only used incase you want to bind a\n * keyup or keydown event to one of these keys\n *\n * @type {Object}\n */\n var _KEYCODE_MAP = {\n 106: '*',\n 107: '+',\n 109: '-',\n 110: '.',\n 111 : '/',\n 186: ';',\n 187: '=',\n 188: ',',\n 189: '-',\n 190: '.',\n 191: '/',\n 192: '`',\n 219: '[',\n 220: '\\\\',\n 221: ']',\n 222: '\\''\n };\n\n /**\n * this is a mapping of keys that require shift on a US keypad\n * back to the non shift equivelents\n *\n * this is so you can use keyup events with these keys\n *\n * note that this will only work reliably on US keyboards\n *\n * @type {Object}\n */\n var _SHIFT_MAP = {\n '~': '`',\n '!': '1',\n '@': '2',\n '#': '3',\n '$': '4',\n '%': '5',\n '^': '6',\n '&': '7',\n '*': '8',\n '(': '9',\n ')': '0',\n '_': '-',\n '+': '=',\n ':': ';',\n '\\\"': '\\'',\n '<': ',',\n '>': '.',\n '?': '/',\n '|': '\\\\'\n };\n\n /**\n * this is a list of special strings you can use to map\n * to modifier keys when you specify your keyboard shortcuts\n *\n * @type {Object}\n */\n var _SPECIAL_ALIASES = {\n 'option': 'alt',\n 'command': 'meta',\n 'return': 'enter',\n 'escape': 'esc',\n 'plus': '+',\n 'mod': /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'meta' : 'ctrl'\n };\n\n /**\n * variable to store the flipped version of _MAP from above\n * needed to check if we should use keypress or not when no action\n * is specified\n *\n * @type {Object|undefined}\n */\n var _REVERSE_MAP;\n\n /**\n * loop through the f keys, f1 to f19 and add them to the map\n * programatically\n */\n for (var i = 1; i < 20; ++i) {\n _MAP[111 + i] = 'f' + i;\n }\n\n /**\n * loop through to map numbers on the numeric keypad\n */\n for (i = 0; i <= 9; ++i) {\n\n // This needs to use a string cause otherwise since 0 is falsey\n // mousetrap will never fire for numpad 0 pressed as part of a keydown\n // event.\n //\n // @see https://github.com/ccampbell/mousetrap/pull/258\n _MAP[i + 96] = i.toString();\n }\n\n /**\n * cross browser add event method\n *\n * @param {Element|HTMLDocument} object\n * @param {string} type\n * @param {Function} callback\n * @returns void\n */\n function _addEvent(object, type, callback) {\n if (object.addEventListener) {\n object.addEventListener(type, callback, false);\n return;\n }\n\n object.attachEvent('on' + type, callback);\n }\n\n /**\n * takes the event and returns the key character\n *\n * @param {Event} e\n * @return {string}\n */\n function _characterFromEvent(e) {\n\n // for keypress events we should return the character as is\n if (e.type == 'keypress') {\n var character = String.fromCharCode(e.which);\n\n // if the shift key is not pressed then it is safe to assume\n // that we want the character to be lowercase. this means if\n // you accidentally have caps lock on then your key bindings\n // will continue to work\n //\n // the only side effect that might not be desired is if you\n // bind something like 'A' cause you want to trigger an\n // event when capital A is pressed caps lock will no longer\n // trigger the event. shift+a will though.\n if (!e.shiftKey) {\n character = character.toLowerCase();\n }\n\n return character;\n }\n\n // for non keypress events the special maps are needed\n if (_MAP[e.which]) {\n return _MAP[e.which];\n }\n\n if (_KEYCODE_MAP[e.which]) {\n return _KEYCODE_MAP[e.which];\n }\n\n // if it is not in the special map\n\n // with keydown and keyup events the character seems to always\n // come in as an uppercase character whether you are pressing shift\n // or not. we should make sure it is always lowercase for comparisons\n return String.fromCharCode(e.which).toLowerCase();\n }\n\n /**\n * checks if two arrays are equal\n *\n * @param {Array} modifiers1\n * @param {Array} modifiers2\n * @returns {boolean}\n */\n function _modifiersMatch(modifiers1, modifiers2) {\n return modifiers1.sort().join(',') === modifiers2.sort().join(',');\n }\n\n /**\n * takes a key event and figures out what the modifiers are\n *\n * @param {Event} e\n * @returns {Array}\n */\n function _eventModifiers(e) {\n var modifiers = [];\n\n if (e.shiftKey) {\n modifiers.push('shift');\n }\n\n if (e.altKey) {\n modifiers.push('alt');\n }\n\n if (e.ctrlKey) {\n modifiers.push('ctrl');\n }\n\n if (e.metaKey) {\n modifiers.push('meta');\n }\n\n return modifiers;\n }\n\n /**\n * prevents default for this event\n *\n * @param {Event} e\n * @returns void\n */\n function _preventDefault(e) {\n if (e.preventDefault) {\n e.preventDefault();\n return;\n }\n\n e.returnValue = false;\n }\n\n /**\n * stops propogation for this event\n *\n * @param {Event} e\n * @returns void\n */\n function _stopPropagation(e) {\n if (e.stopPropagation) {\n e.stopPropagation();\n return;\n }\n\n e.cancelBubble = true;\n }\n\n /**\n * determines if the keycode specified is a modifier key or not\n *\n * @param {string} key\n * @returns {boolean}\n */\n function _isModifier(key) {\n return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';\n }\n\n /**\n * reverses the map lookup so that we can look for specific keys\n * to see what can and can't use keypress\n *\n * @return {Object}\n */\n function _getReverseMap() {\n if (!_REVERSE_MAP) {\n _REVERSE_MAP = {};\n for (var key in _MAP) {\n\n // pull out the numeric keypad from here cause keypress should\n // be able to detect the keys from the character\n if (key > 95 && key < 112) {\n continue;\n }\n\n if (_MAP.hasOwnProperty(key)) {\n _REVERSE_MAP[_MAP[key]] = key;\n }\n }\n }\n return _REVERSE_MAP;\n }\n\n /**\n * picks the best action based on the key combination\n *\n * @param {string} key - character for key\n * @param {Array} modifiers\n * @param {string=} action passed in\n */\n function _pickBestAction(key, modifiers, action) {\n\n // if no action was picked in we should try to pick the one\n // that we think would work best for this key\n if (!action) {\n action = _getReverseMap()[key] ? 'keydown' : 'keypress';\n }\n\n // modifier keys don't work as expected with keypress,\n // switch to keydown\n if (action == 'keypress' && modifiers.length) {\n action = 'keydown';\n }\n\n return action;\n }\n\n /**\n * Converts from a string key combination to an array\n *\n * @param {string} combination like \"command+shift+l\"\n * @return {Array}\n */\n function _keysFromString(combination) {\n if (combination === '+') {\n return ['+'];\n }\n\n combination = combination.replace(/\\+{2}/g, '+plus');\n return combination.split('+');\n }\n\n /**\n * Gets info for a specific key combination\n *\n * @param {string} combination key combination (\"command+s\" or \"a\" or \"*\")\n * @param {string=} action\n * @returns {Object}\n */\n function _getKeyInfo(combination, action) {\n var keys;\n var key;\n var i;\n var modifiers = [];\n\n // take the keys from this pattern and figure out what the actual\n // pattern is all about\n keys = _keysFromString(combination);\n\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n\n // normalize key names\n if (_SPECIAL_ALIASES[key]) {\n key = _SPECIAL_ALIASES[key];\n }\n\n // if this is not a keypress event then we should\n // be smart about using shift keys\n // this will only work for US keyboards however\n if (action && action != 'keypress' && _SHIFT_MAP[key]) {\n key = _SHIFT_MAP[key];\n modifiers.push('shift');\n }\n\n // if this key is a modifier then add it to the list of modifiers\n if (_isModifier(key)) {\n modifiers.push(key);\n }\n }\n\n // depending on what the key combination is\n // we will try to pick the best event for it\n action = _pickBestAction(key, modifiers, action);\n\n return {\n key: key,\n modifiers: modifiers,\n action: action\n };\n }\n\n function _belongsTo(element, ancestor) {\n if (element === null || element === document) {\n return false;\n }\n\n if (element === ancestor) {\n return true;\n }\n\n return _belongsTo(element.parentNode, ancestor);\n }\n\n function Mousetrap(targetElement) {\n var self = this;\n\n targetElement = targetElement || document;\n\n if (!(self instanceof Mousetrap)) {\n return new Mousetrap(targetElement);\n }\n\n /**\n * element to attach key events to\n *\n * @type {Element}\n */\n self.target = targetElement;\n\n /**\n * a list of all the callbacks setup via Mousetrap.bind()\n *\n * @type {Object}\n */\n self._callbacks = {};\n\n /**\n * direct map of string combinations to callbacks used for trigger()\n *\n * @type {Object}\n */\n self._directMap = {};\n\n /**\n * keeps track of what level each sequence is at since multiple\n * sequences can start out with the same sequence\n *\n * @type {Object}\n */\n var _sequenceLevels = {};\n\n /**\n * variable to store the setTimeout call\n *\n * @type {null|number}\n */\n var _resetTimer;\n\n /**\n * temporary state where we will ignore the next keyup\n *\n * @type {boolean|string}\n */\n var _ignoreNextKeyup = false;\n\n /**\n * temporary state where we will ignore the next keypress\n *\n * @type {boolean}\n */\n var _ignoreNextKeypress = false;\n\n /**\n * are we currently inside of a sequence?\n * type of action (\"keyup\" or \"keydown\" or \"keypress\") or false\n *\n * @type {boolean|string}\n */\n var _nextExpectedAction = false;\n\n /**\n * resets all sequence counters except for the ones passed in\n *\n * @param {Object} doNotReset\n * @returns void\n */\n function _resetSequences(doNotReset) {\n doNotReset = doNotReset || {};\n\n var activeSequences = false,\n key;\n\n for (key in _sequenceLevels) {\n if (doNotReset[key]) {\n activeSequences = true;\n continue;\n }\n _sequenceLevels[key] = 0;\n }\n\n if (!activeSequences) {\n _nextExpectedAction = false;\n }\n }\n\n /**\n * finds all callbacks that match based on the keycode, modifiers,\n * and action\n *\n * @param {string} character\n * @param {Array} modifiers\n * @param {Event|Object} e\n * @param {string=} sequenceName - name of the sequence we are looking for\n * @param {string=} combination\n * @param {number=} level\n * @returns {Array}\n */\n function _getMatches(character, modifiers, e, sequenceName, combination, level) {\n var i;\n var callback;\n var matches = [];\n var action = e.type;\n\n // if there are no events related to this keycode\n if (!self._callbacks[character]) {\n return [];\n }\n\n // if a modifier key is coming up on its own we should allow it\n if (action == 'keyup' && _isModifier(character)) {\n modifiers = [character];\n }\n\n // loop through all callbacks for the key that was pressed\n // and see if any of them match\n for (i = 0; i < self._callbacks[character].length; ++i) {\n callback = self._callbacks[character][i];\n\n // if a sequence name is not specified, but this is a sequence at\n // the wrong level then move onto the next match\n if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) {\n continue;\n }\n\n // if the action we are looking for doesn't match the action we got\n // then we should keep going\n if (action != callback.action) {\n continue;\n }\n\n // if this is a keypress event and the meta key and control key\n // are not pressed that means that we need to only look at the\n // character, otherwise check the modifiers as well\n //\n // chrome will not fire a keypress if meta or control is down\n // safari will fire a keypress if meta or meta+shift is down\n // firefox will fire a keypress if meta or control is down\n if ((action == 'keypress' && !e.metaKey && !e.ctrlKey) || _modifiersMatch(modifiers, callback.modifiers)) {\n\n // when you bind a combination or sequence a second time it\n // should overwrite the first one. if a sequenceName or\n // combination is specified in this call it does just that\n //\n // @todo make deleting its own method?\n var deleteCombo = !sequenceName && callback.combo == combination;\n var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level;\n if (deleteCombo || deleteSequence) {\n self._callbacks[character].splice(i, 1);\n }\n\n matches.push(callback);\n }\n }\n\n return matches;\n }\n\n /**\n * actually calls the callback function\n *\n * if your callback function returns false this will use the jquery\n * convention - prevent default and stop propogation on the event\n *\n * @param {Function} callback\n * @param {Event} e\n * @returns void\n */\n function _fireCallback(callback, e, combo, sequence) {\n\n // if this event should not happen stop here\n if (self.stopCallback(e, e.target || e.srcElement, combo, sequence)) {\n return;\n }\n\n if (callback(e, combo) === false) {\n _preventDefault(e);\n _stopPropagation(e);\n }\n }\n\n /**\n * handles a character key event\n *\n * @param {string} character\n * @param {Array} modifiers\n * @param {Event} e\n * @returns void\n */\n self._handleKey = function(character, modifiers, e) {\n var callbacks = _getMatches(character, modifiers, e);\n var i;\n var doNotReset = {};\n var maxLevel = 0;\n var processedSequenceCallback = false;\n\n // Calculate the maxLevel for sequences so we can only execute the longest callback sequence\n for (i = 0; i < callbacks.length; ++i) {\n if (callbacks[i].seq) {\n maxLevel = Math.max(maxLevel, callbacks[i].level);\n }\n }\n\n // loop through matching callbacks for this key event\n for (i = 0; i < callbacks.length; ++i) {\n\n // fire for all sequence callbacks\n // this is because if for example you have multiple sequences\n // bound such as \"g i\" and \"g t\" they both need to fire the\n // callback for matching g cause otherwise you can only ever\n // match the first one\n if (callbacks[i].seq) {\n\n // only fire callbacks for the maxLevel to prevent\n // subsequences from also firing\n //\n // for example 'a option b' should not cause 'option b' to fire\n // even though 'option b' is part of the other sequence\n //\n // any sequences that do not match here will be discarded\n // below by the _resetSequences call\n if (callbacks[i].level != maxLevel) {\n continue;\n }\n\n processedSequenceCallback = true;\n\n // keep a list of which sequences were matches for later\n doNotReset[callbacks[i].seq] = 1;\n _fireCallback(callbacks[i].callback, e, callbacks[i].combo, callbacks[i].seq);\n continue;\n }\n\n // if there were no sequence matches but we are still here\n // that means this is a regular match so we should fire that\n if (!processedSequenceCallback) {\n _fireCallback(callbacks[i].callback, e, callbacks[i].combo);\n }\n }\n\n // if the key you pressed matches the type of sequence without\n // being a modifier (ie \"keyup\" or \"keypress\") then we should\n // reset all sequences that were not matched by this event\n //\n // this is so, for example, if you have the sequence \"h a t\" and you\n // type \"h e a r t\" it does not match. in this case the \"e\" will\n // cause the sequence to reset\n //\n // modifier keys are ignored because you can have a sequence\n // that contains modifiers such as \"enter ctrl+space\" and in most\n // cases the modifier key will be pressed before the next key\n //\n // also if you have a sequence such as \"ctrl+b a\" then pressing the\n // \"b\" key will trigger a \"keypress\" and a \"keydown\"\n //\n // the \"keydown\" is expected when there is a modifier, but the\n // \"keypress\" ends up matching the _nextExpectedAction since it occurs\n // after and that causes the sequence to reset\n //\n // we ignore keypresses in a sequence that directly follow a keydown\n // for the same character\n var ignoreThisKeypress = e.type == 'keypress' && _ignoreNextKeypress;\n if (e.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {\n _resetSequences(doNotReset);\n }\n\n _ignoreNextKeypress = processedSequenceCallback && e.type == 'keydown';\n };\n\n /**\n * handles a keydown event\n *\n * @param {Event} e\n * @returns void\n */\n function _handleKeyEvent(e) {\n\n // normalize e.which for key events\n // @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion\n if (typeof e.which !== 'number') {\n e.which = e.keyCode;\n }\n\n var character = _characterFromEvent(e);\n\n // no character found then stop\n if (!character) {\n return;\n }\n\n // need to use === for the character check because the character can be 0\n if (e.type == 'keyup' && _ignoreNextKeyup === character) {\n _ignoreNextKeyup = false;\n return;\n }\n\n self.handleKey(character, _eventModifiers(e), e);\n }\n\n /**\n * called to set a 1 second timeout on the specified sequence\n *\n * this is so after each key press in the sequence you have 1 second\n * to press the next key before you have to start over\n *\n * @returns void\n */\n function _resetSequenceTimer() {\n clearTimeout(_resetTimer);\n _resetTimer = setTimeout(_resetSequences, 1000);\n }\n\n /**\n * binds a key sequence to an event\n *\n * @param {string} combo - combo specified in bind call\n * @param {Array} keys\n * @param {Function} callback\n * @param {string=} action\n * @returns void\n */\n function _bindSequence(combo, keys, callback, action) {\n\n // start off by adding a sequence level record for this combination\n // and setting the level to 0\n _sequenceLevels[combo] = 0;\n\n /**\n * callback to increase the sequence level for this sequence and reset\n * all other sequences that were active\n *\n * @param {string} nextAction\n * @returns {Function}\n */\n function _increaseSequence(nextAction) {\n return function() {\n _nextExpectedAction = nextAction;\n ++_sequenceLevels[combo];\n _resetSequenceTimer();\n };\n }\n\n /**\n * wraps the specified callback inside of another function in order\n * to reset all sequence counters as soon as this sequence is done\n *\n * @param {Event} e\n * @returns void\n */\n function _callbackAndReset(e) {\n _fireCallback(callback, e, combo);\n\n // we should ignore the next key up if the action is key down\n // or keypress. this is so if you finish a sequence and\n // release the key the final key will not trigger a keyup\n if (action !== 'keyup') {\n _ignoreNextKeyup = _characterFromEvent(e);\n }\n\n // weird race condition if a sequence ends with the key\n // another sequence begins with\n setTimeout(_resetSequences, 10);\n }\n\n // loop through keys one at a time and bind the appropriate callback\n // function. for any key leading up to the final one it should\n // increase the sequence. after the final, it should reset all sequences\n //\n // if an action is specified in the original bind call then that will\n // be used throughout. otherwise we will pass the action that the\n // next key in the sequence should match. this allows a sequence\n // to mix and match keypress and keydown events depending on which\n // ones are better suited to the key provided\n for (var i = 0; i < keys.length; ++i) {\n var isFinal = i + 1 === keys.length;\n var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i + 1]).action);\n _bindSingle(keys[i], wrappedCallback, action, combo, i);\n }\n }\n\n /**\n * binds a single keyboard combination\n *\n * @param {string} combination\n * @param {Function} callback\n * @param {string=} action\n * @param {string=} sequenceName - name of sequence if part of sequence\n * @param {number=} level - what part of the sequence the command is\n * @returns void\n */\n function _bindSingle(combination, callback, action, sequenceName, level) {\n\n // store a direct mapped reference for use with Mousetrap.trigger\n self._directMap[combination + ':' + action] = callback;\n\n // make sure multiple spaces in a row become a single space\n combination = combination.replace(/\\s+/g, ' ');\n\n var sequence = combination.split(' ');\n var info;\n\n // if this pattern is a sequence of keys then run through this method\n // to reprocess each pattern one key at a time\n if (sequence.length > 1) {\n _bindSequence(combination, sequence, callback, action);\n return;\n }\n\n info = _getKeyInfo(combination, action);\n\n // make sure to initialize array if this is the first time\n // a callback is added for this key\n self._callbacks[info.key] = self._callbacks[info.key] || [];\n\n // remove an existing match if there is one\n _getMatches(info.key, info.modifiers, {type: info.action}, sequenceName, combination, level);\n\n // add this call back to the array\n // if it is a sequence put it at the beginning\n // if not put it at the end\n //\n // this is important because the way these are processed expects\n // the sequence ones to come first\n self._callbacks[info.key][sequenceName ? 'unshift' : 'push']({\n callback: callback,\n modifiers: info.modifiers,\n action: info.action,\n seq: sequenceName,\n level: level,\n combo: combination\n });\n }\n\n /**\n * binds multiple combinations to the same callback\n *\n * @param {Array} combinations\n * @param {Function} callback\n * @param {string|undefined} action\n * @returns void\n */\n self._bindMultiple = function(combinations, callback, action) {\n for (var i = 0; i < combinations.length; ++i) {\n _bindSingle(combinations[i], callback, action);\n }\n };\n\n // start!\n _addEvent(targetElement, 'keypress', _handleKeyEvent);\n _addEvent(targetElement, 'keydown', _handleKeyEvent);\n _addEvent(targetElement, 'keyup', _handleKeyEvent);\n }\n\n /**\n * binds an event to mousetrap\n *\n * can be a single key, a combination of keys separated with +,\n * an array of keys, or a sequence of keys separated by spaces\n *\n * be sure to list the modifier keys first to make sure that the\n * correct key ends up getting bound (the last key in the pattern)\n *\n * @param {string|Array} keys\n * @param {Function} callback\n * @param {string=} action - 'keypress', 'keydown', or 'keyup'\n * @returns void\n */\n Mousetrap.prototype.bind = function(keys, callback, action) {\n var self = this;\n keys = keys instanceof Array ? keys : [keys];\n self._bindMultiple.call(self, keys, callback, action);\n return self;\n };\n\n /**\n * unbinds an event to mousetrap\n *\n * the unbinding sets the callback function of the specified key combo\n * to an empty function and deletes the corresponding key in the\n * _directMap dict.\n *\n * TODO: actually remove this from the _callbacks dictionary instead\n * of binding an empty function\n *\n * the keycombo+action has to be exactly the same as\n * it was defined in the bind method\n *\n * @param {string|Array} keys\n * @param {string} action\n * @returns void\n */\n Mousetrap.prototype.unbind = function(keys, action) {\n var self = this;\n return self.bind.call(self, keys, function() {}, action);\n };\n\n /**\n * triggers an event that has already been bound\n *\n * @param {string} keys\n * @param {string=} action\n * @returns void\n */\n Mousetrap.prototype.trigger = function(keys, action) {\n var self = this;\n if (self._directMap[keys + ':' + action]) {\n self._directMap[keys + ':' + action]({}, keys);\n }\n return self;\n };\n\n /**\n * resets the library back to its initial state. this is useful\n * if you want to clear out the current keyboard shortcuts and bind\n * new ones - for example if you switch to another page\n *\n * @returns void\n */\n Mousetrap.prototype.reset = function() {\n var self = this;\n self._callbacks = {};\n self._directMap = {};\n return self;\n };\n\n /**\n * should we stop this event before firing off callbacks\n *\n * @param {Event} e\n * @param {Element} element\n * @return {boolean}\n */\n Mousetrap.prototype.stopCallback = function(e, element) {\n var self = this;\n\n // if the element has the class \"mousetrap\" then no need to stop\n if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {\n return false;\n }\n\n if (_belongsTo(element, self.target)) {\n return false;\n }\n\n // Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,\n // not the initial event target in the shadow tree. Note that not all events cross the\n // shadow boundary.\n // For shadow trees with `mode: 'open'`, the initial event target is the first element in\n // the event’s composed path. For shadow trees with `mode: 'closed'`, the initial event\n // target cannot be obtained.\n if ('composedPath' in e && typeof e.composedPath === 'function') {\n // For open shadow trees, update `element` so that the following check works.\n var initialEventTarget = e.composedPath()[0];\n if (initialEventTarget !== e.target) {\n element = initialEventTarget;\n }\n }\n\n // stop for input, select, and textarea\n return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;\n };\n\n /**\n * exposes _handleKey publicly so it can be overwritten by extensions\n */\n Mousetrap.prototype.handleKey = function() {\n var self = this;\n return self._handleKey.apply(self, arguments);\n };\n\n /**\n * allow custom key mappings\n */\n Mousetrap.addKeycodes = function(object) {\n for (var key in object) {\n if (object.hasOwnProperty(key)) {\n _MAP[key] = object[key];\n }\n }\n _REVERSE_MAP = null;\n };\n\n /**\n * Init the global mousetrap functions\n *\n * This method is needed to allow the global mousetrap functions to work\n * now that mousetrap is a constructor function.\n */\n Mousetrap.init = function() {\n var documentMousetrap = Mousetrap(document);\n for (var method in documentMousetrap) {\n if (method.charAt(0) !== '_') {\n Mousetrap[method] = (function(method) {\n return function() {\n return documentMousetrap[method].apply(documentMousetrap, arguments);\n };\n } (method));\n }\n }\n };\n\n Mousetrap.init();\n\n // expose mousetrap to the global object\n window.Mousetrap = Mousetrap;\n\n // expose as a common js module\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Mousetrap;\n }\n\n // expose mousetrap as an AMD module\n if (typeof define === 'function' && define.amd) {\n define(function() {\n return Mousetrap;\n });\n }\n}) (typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);\n","import { Status } from '@vue-skuilder/common';\nimport ENV from '../ENVIRONMENT_VARS';\nimport { ServerRequest } from '@vue-skuilder/common';\n\nconst SERVER = ENV.EXPRESS_SERVER_PROTOCOL + '://' + ENV.EXPRESS_SERVER_URL;\n\n/**\n* Makes an authenticated request to the express backend and returns the response.\n\n* @param requestData\n* @returns\n*/\nexport default async function serverRequest<T extends ServerRequest>(requestData: T): Promise<T> {\n return new Promise<T>((resolve) => {\n try {\n const xml = new XMLHttpRequest();\n xml.withCredentials = true;\n xml.open('POST', SERVER, true);\n xml.setRequestHeader('Content-Type', 'application/json');\n xml.timeout = requestData.timeout || 7000;\n\n // Handle the response when it completes\n xml.onload = function () {\n try {\n requestData.response = JSON.parse(xml.responseText);\n resolve(requestData);\n } catch (parseError) {\n requestData.response = {\n status: Status.error,\n ok: false,\n errorText: `Failed to parse response: ${\n parseError instanceof Error ? parseError.message : JSON.stringify(parseError)\n }`,\n };\n resolve(requestData);\n }\n };\n\n // Handle network errors\n xml.onerror = function () {\n requestData.response = {\n status: Status.error,\n ok: false,\n errorText: 'Network error occurred',\n };\n resolve(requestData);\n };\n\n // Handle timeouts\n xml.ontimeout = function () {\n requestData.response = {\n status: Status.error,\n ok: false,\n errorText: 'Request timed out',\n };\n resolve(requestData);\n };\n\n // Send the request\n xml.send(JSON.stringify(requestData));\n } catch (error) {\n // Handle any errors that occur during setup\n requestData.response = {\n status: Status.error,\n ok: false,\n errorText: error instanceof Error ? error.message : JSON.stringify(error),\n };\n resolve(requestData);\n }\n });\n}\n"],"x_google_ignoreList":[0],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./vue.runtime.esm-bundler--Fxmd6l9.js";import"./dist-V9Xbab2f.js";import"./MarkdownRenderer-U_iPiA2x-DDruDu7E.js";import"./dist-BeppzTWu.js";import"./common-ui.es-B9r6QiWN.js";import"./CourseWare-BTFRjgBR-C3wi5YHa.js";import{t as e}from"./sightsing-BFQ7HRig-CLh3Xcy7.js";export{e as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./chunk-D6hFPZc3.js";import{B as e,H as t,Ht as n,T as r,_ as i,b as a,f as o,g as s,ut as c,y as l,z as u}from"./vue.runtime.esm-bundler--Fxmd6l9.js";import{E as d,b as f,k as p,n as m}from"./dist-V9Xbab2f.js";import{C as h,w as g}from"./MarkdownRenderer-U_iPiA2x-DDruDu7E.js";import{h as _}from"./common-ui.es-B9r6QiWN.js";import{n as v,t as y,u as b}from"./CourseWare-BTFRjgBR-C3wi5YHa.js";var x,S,C=r({name:`LetterQuestionView`,props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(t,{emit:n}){let r=g(t,n,`LetterQuestionView`),i=h(r),a=c(null);i.question.value=new D(t.data);let o=s(()=>i.question.value),handleKeyPress=e=>{if(!o.value)return;let t=e.key.toLowerCase(),n=o.value.letter.toLowerCase();if(t===n){a.value?.classList.add(`pressed`);let handleKeyUp=e=>{e.key.toLowerCase()===n&&(a.value?.classList.remove(`pressed`),i.submitAnswer(t),window.removeEventListener(`keyup`,handleKeyUp))};window.addEventListener(`keyup`,handleKeyUp)}else i.submitAnswer(t)};return u(()=>{window.addEventListener(`keypress`,handleKeyPress)}),e(()=>{window.removeEventListener(`keypress`,handleKeyPress)}),{...i,...r,letterDisplay:a,question:o}}}),w={"data-viewable":`LetterQuestionView`};function _sfc_render(e,r,s,c,u,d){return t(),a(`div`,w,[e.question?(t(),a(o,{key:0},[r[0]||(r[0]=i(`p`,{class:`text-h5`},`Type this letter!`,-1)),i(`div`,{ref:`letterDisplay`,class:`letter-display`},n(e.question.letter),513)],64)):l(``,!0)])}var T=y(C,[[`render`,_sfc_render],[`__scopeId`,`data-v-4ae4db54`]]),E=b(function(){let e=[];for(let t=0;t<26;t++)e.push({letter:String.fromCharCode(65+t)});return e},`data`),D=(x=class TypeLetterQuestion extends _{constructor(e){var _super=(...e)=>(super(...e),f(this,`letter`,void 0),this);_super(e),this.letter=e[0].letter}evaluate(e,t){return{isCorrect:this.isCorrect(e),performance:this.displayedSkill(e,t)}}displayedSkill(e,t){if(this.isCorrect(e)){if(t<3e3)return 1;{let e=1-(t-3e3)/7e3*.75;return Math.max(.25,e)}}return 0}dataShapes(){return TypeLetterQuestion.dataShapes}views(){return TypeLetterQuestion.views}isCorrect(e){let t=e.toLowerCase()===this.letter.toLowerCase();return console.log(`singleLetter Q isCorrect: ${t}`),t}},f(x,`dataShapes`,[{name:m.TYPING_singleLetter,fields:[{name:`letter`,type:d.STRING,validator:{instructions:`Enter a single letter`,test:function(e){return!e||e.length!==1||!/[a-zA-Z]/.test(e)?{status:p.error,msg:`Input must be a single letter`}:{status:p.ok,msg:``}}}}]}]),f(x,`views`,[T]),f(x,`acceptsUserData`,!0),f(x,`seedData`,E()),x),data=function(){return[{gameLength:30,initialSpeed:2,acceleration:.1,spawnInterval:1}]},O=new v(`typing`,[D,(S=class FallingLettersQuestion extends _{constructor(e){var _super2=(...e)=>(super(...e),f(this,`gameLength`,void 0),f(this,`initialSpeed`,void 0),f(this,`acceleration`,void 0),f(this,`spawnInterval`,void 0),this);_super2(e),this.gameLength=e[0].gameLength,this.initialSpeed=e[0].initialSpeed,this.acceleration=e[0].acceleration,this.spawnInterval=e[0].spawnInterval}evaluate(e){return{isCorrect:this.isCorrect(e),performance:this.displayedSkill(e)}}displayedSkill(e){return e.win?1:e.percentage}dataShapes(){return FallingLettersQuestion.dataShapes}views(){return FallingLettersQuestion.views}isCorrect(e){return e.win}},f(S,`dataShapes`,[{name:m.TYPING_fallingLetters,fields:[{name:`gameLength`,type:d.NUMBER},{name:`initialSpeed`,type:d.NUMBER},{name:`acceleration`,type:d.NUMBER},{name:`spawnInterval`,type:d.NUMBER,validator:{instructions:`How often should a new letter spawn? (in seconds)`,test:e=>typeof e==`string`?parseFloat(e)>0?{status:p.ok,msg:``}:{status:p.error,msg:`Must be greater than 0`}:{status:p.error,msg:`Unexpected non-string input.`},placeholder:`1`}}]}]),f(S,`views`,[]),f(S,`acceptsUserData`,!0),f(S,`seedData`,data()),S)]);export{O as t};
|
|
2
|
-
//# sourceMappingURL=typing-BevtfWlp-B__x_Ia1.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./vue.runtime.esm-bundler--Fxmd6l9.js";import"./dist-V9Xbab2f.js";import"./MarkdownRenderer-U_iPiA2x-DDruDu7E.js";import"./dist-BeppzTWu.js";import"./common-ui.es-B9r6QiWN.js";import"./CourseWare-BTFRjgBR-C3wi5YHa.js";import{t as e}from"./typing-BevtfWlp-B__x_Ia1.js";export{e as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import"./chunk-D6hFPZc3.js";import{$ as e,C as t,H as n,Ht as r,K as i,T as a,_ as o,b as s,f as c,g as l,ut as u,y as d}from"./vue.runtime.esm-bundler--Fxmd6l9.js";import{E as f,b as p,d as m,n as h}from"./dist-V9Xbab2f.js";import{C as g,d as _,u as v,w as y}from"./MarkdownRenderer-U_iPiA2x-DDruDu7E.js";import{h as b}from"./common-ui.es-B9r6QiWN.js";import{n as x,t as S}from"./CourseWare-BTFRjgBR-C3wi5YHa.js";var C,w=a({name:`IdentifyVocab`,components:{AudioAutoPlayer:v,UserInputString:_},props:{data:{type:Array,required:!0},modifyDifficulty:{type:Number,required:!1,default:0}},setup(e,{emit:t}){let n=y(e,t,`IdentifyVocab`),r=g(n),i=u(``);r.question.value=new k(e.data);let a=l(()=>r.question.value),submit=()=>{a.value&&r.submitAnswer(i.value)};return{...n,...r,answer:i,question:a,submit}}}),T={"data-viewable":`IdentifyVocab`},E={key:0,class:`text-h6`};function _sfc_render(a,l,u,f,p,m){let h=i(`UserInputString`),g=i(`center`),_=i(`audio-auto-player`);return n(),s(`div`,T,[a.question?(n(),s(c,{key:0},[l[1]||(l[1]=o(`span`,{class:`text-h5`},` Spell the word: `,-1)),t(h,{modelValue:a.answer,"onUpdate:modelValue":l[0]||(l[0]=e=>a.answer=e)},null,8,[`modelValue`]),t(g,null,{default:e(()=>[a.priorAttempts?(n(),s(`span`,E,r(a.question.word),1)):d(``,!0)]),_:1}),t(g,null,{default:e(()=>[t(_,{src:[a.getURL(`WordAudio`),a.getURL(`SentenceAudio`),a.getURL(`WordAudio`)]},null,8,[`src`])]),_:1})],64)):d(``,!0)])}var D=S(w,[[`render`,_sfc_render]]),O=[{name:`Word`,type:f.STRING,validator:m.NonEmptyString},{name:`ExampleSentence`,type:f.STRING},{name:`WordAudio`,type:f.AUDIO},{name:`SentenceAudio`,type:f.AUDIO}],k=(C=class SpellingQuestion extends b{constructor(e){var _super=(...e)=>(super(...e),p(this,`word`,void 0),p(this,`sentence`,void 0),p(this,`audio_word`,void 0),p(this,`audio_sentence`,void 0),this);_super(e),this.word=e[0].Word,this.sentence=e[0].Sentence,this.audio_word=e[0].WordAudio,this.audio_sentence=e[0].SentenceAudio}isCorrect(e){return e===this.word}dataShapes(){return SpellingQuestion.dataShapes}views(){return SpellingQuestion.views}},p(C,`dataShapes`,[{fields:O,name:h.WORDWORK_Spelling}]),p(C,`views`,[D]),C),A=new x(`wordWork`,[k]);export{A as t};
|
|
2
|
-
//# sourceMappingURL=word-work-BOnRlZgd-CxcTzMPz.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./vue.runtime.esm-bundler--Fxmd6l9.js";import"./dist-V9Xbab2f.js";import"./MarkdownRenderer-U_iPiA2x-DDruDu7E.js";import"./dist-BeppzTWu.js";import"./common-ui.es-B9r6QiWN.js";import"./CourseWare-BTFRjgBR-C3wi5YHa.js";import{t as e}from"./word-work-BOnRlZgd-CxcTzMPz.js";export{e as default};
|
|
File without changes
|