@werckmeister/components 1.1.6-119 → 1.1.6-122

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.
@@ -31,9 +31,9 @@ var t;!function(e){"object"==typeof exports&&"object"==typeof module?e(require("
31
31
  },{"../../lib/codemirror":"tQq4"}],"edJQ":[function(require,module,exports) {
32
32
  var e=require("codemirror/lib/codemirror.js");require("codemirror/addon/mode/simple.js"),e.defineSimpleMode("sheet",{start:[{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/(?:\w+):/,token:"keyword",next:"wmCommandValues"},{regex:/.*--WM-HIDDEN-LINE\s*$/,token:"comment wm-hidden-line"},{regex:/using/,token:"keyword"},{regex:/\\[pf]{1,5}/,token:"atom"},{regex:/--.*/,token:"comment"}],wmCommandValues:[{regex:/;|\//,token:"text",next:"start"},{regex:/[^;\/]*/,token:"variable"}],meta:{dontIndentStates:["comment"],lineComment:"--"}});
33
33
  },{"codemirror/lib/codemirror.js":"tQq4","codemirror/addon/mode/simple.js":"YCgH"}],"PWBo":[function(require,module,exports) {
34
- var e=require("codemirror/lib/codemirror.js");require("codemirror/addon/mode/simple.js");var t=["fromPosition","toPosition","onBeat","fromPitch","toPitch","pitch","instrument","fromBeat","toBeat","fromBar","toBar","onBar","nthBar","channel","all","withTag"],o=["velocity","timeOffset","duration","pitch"];e.defineSimpleMode("conductions",{start:[{regex:new RegExp("".concat(t.join("|"))),token:"tag"},{regex:new RegExp("".concat(o.join("|"))),token:"property"},{regex:/[0-9]\s*%{0,1}/,token:"number"},{regex:/@{0,1}\w+/,token:"string"},{regex:/--.*/,token:"comment"},{regex:/.*--WM-HIDDEN-LINE\s*$/,token:"comment wm-hidden-line"}],meta:{dontIndentStates:["comment"],lineComment:"--"}});
34
+ var e=require("codemirror/lib/codemirror.js");require("codemirror/addon/mode/simple.js");var o=["fromPosition","toPosition","onBeat","fromPitch","toPitch","pitch","instrument","fromBeat","toBeat","fromBar","toBar","onBar","nthBar","channel","all","withTag","degree","chord","octave"],t=["velocity","timeOffset","duration","pitch"];e.defineSimpleMode("conductions",{start:[{regex:new RegExp("".concat(o.join("|"))),token:"tag"},{regex:new RegExp("".concat(t.join("|"))),token:"property"},{regex:/[0-9]\s*%{0,1}/,token:"number"},{regex:/@{0,1}\w+/,token:"string"},{regex:/--.*/,token:"comment"},{regex:/.*--WM-HIDDEN-LINE\s*$/,token:"comment wm-hidden-line"}],meta:{dontIndentStates:["comment"],lineComment:"--"}});
35
35
  },{"codemirror/lib/codemirror.js":"tQq4","codemirror/addon/mode/simple.js":"YCgH"}],"BzA4":[function(require,module,exports) {
36
- "use strict";function e(e,r){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=t(e))||r&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return u=e.done,e},e:function(e){l=!0,a=e},f:function(){try{u||null==n.return||n.return()}finally{if(l)throw a}}}}function t(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}var a=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),u=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return u(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{l(n.next(e))}catch(t){o(t)}}function u(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,u)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Editor=exports.Mode=void 0;var c=require("./SourceDocumentImpl"),f=l(require("lodash")),h=require("codemirror/lib/codemirror.js");require("codemirror/addon/hint/show-hint.js"),require("codemirror/mode/lua/lua.js"),require("./SheetMode"),require("./ConductionsSheetMode");var d,m="base16-dark";function v(e,t){var r=f.map(t,function(e){return"".concat(e,"?")}).join("");r=r.replace(/\./g,"\\.").replace(/\(/g,"\\(").replace(/\)/g,"\\)").replace(/\{/g,"\\{").replace(/\}/g,"\\}").replace(/\[/g,"\\[").replace(/\[/g,"\\]");var n=new RegExp("(".concat(r,")$"),"g");return(e.match(n)||[])[0]}function p(e,t){return(e.match(/.*="?(.*)/)||[])[1]}!function(e){e.sheet="sheet",e.text="text",e.lua="lua",e.conductions="conductions"}(d=exports.Mode||(exports.Mode={}));var y=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0;n(this,t),this.element=e,this.eventMarkClass="wm-marked",this.errorClass="wm-error",this.warningClass="wm-warning",i=i||{theme:"default"},this.editor=h(e,{value:r,theme:i.theme,mode:d[d.sheet],lineNumbers:i.lineNumbers})}return o(t,[{key:"activateAutoCompletion",value:function(e,t){var r=this;this.languageFeatures=e,h.registerHelper("hint","wmAutoComplete",function(e,n){return s(r,void 0,void 0,regeneratorRuntime.mark(function r(){var n,i,o,a,u,l,s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n=e.getCursor(),i=n.ch,o=i,a=new c.ActiveSourceDocument(e,t),r.next=5,this.languageFeatures.autoComplete(a);case 5:return u=r.sent,l=function(e){return e.file?e.file.isDirectory?"isFolder":"isFile":""},s={list:u.map(function(e){return{text:e.displayText,replaceText:e.text,isValueSuggestion:!!e.parameter,className:l(e),hint:function(e,t,r){var i=r.isValueSuggestion,a=e.getRange({line:n.line,ch:0},{line:n.line,ch:n.ch}),u=r.replaceText,l=((i?p(a,u):v(a,u))||"").length,s=o-l,c=o+l;s!==c&&(c-=1),e.replaceRange(r.replaceText,h.Pos(n.line,s),h.Pos(n.line,c))}}}),from:h.Pos(n.line,o),to:h.Pos(n.line,i)},r.abrupt("return",s);case 9:case"end":return r.stop()}},r,this)}))}),h.commands.autocomplete=function(e){e.showHint({hint:h.hint.wmAutoComplete,container:r.element})};var n=function(e,t){var r=t.getCursor();t.replaceRange(e,r),h.commands.autocomplete(t)};this.editor.setOption("extraKeys",{"Ctrl-Space":"autocomplete","'\"'":n.bind(null,'"'),"'/'":n.bind(null,"/"),"'_'":n.bind(null,"_"),"'='":n.bind(null,"=")})}},{key:"setMode",value:function(e){e!==d.text?this.editor.setOption("mode",d[e]):this.editor.setOption("mode",null)}},{key:"getValue",value:function(){return this.editor.getValue()}},{key:"setValue",value:function(e){this.editor.setValue(e)}},{key:"clearEventMarkers",value:function(){var t,r=e(this.editor.getAllMarks());try{for(r.s();!(t=r.n()).done;){var n=t.value;n.className!==this.warningClass&&n.className!==this.errorClass&&n.clear()}}catch(i){r.e(i)}finally{r.f()}}},{key:"clearAllMarkers",value:function(){var t,r=e(this.editor.getAllMarks());try{for(r.s();!(t=r.n()).done;){t.value.clear()}}catch(n){r.e(n)}finally{r.f()}}},{key:"setMarker",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,i=this.editor.posFromIndex(e),o=this.editor.posFromIndex(t+1);return this.editor.markText(i,o,{className:r,attributes:n})}},{key:"setEventMarker",value:function(e,t){return this.setMarker(e,t,this.eventMarkClass)}},{key:"setErrorMarker",value:function(e,t){return this.setMarker(e,t,this.errorClass)}},{key:"setWarningMarker",value:function(e,t,r){return this.setMarker(t,r,this.warningClass,{title:e})}},{key:"update",value:function(){this.editor.refresh()}},{key:"isClean",value:function(){return this.editor.isClean()}},{key:"markClean",value:function(){this.editor.markClean()}},{key:"clearHistory",value:function(){this.editor.clearHistory()}}]),t}();exports.Editor=y;
36
+ "use strict";function e(e,r){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=t(e))||r&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return u=e.done,e},e:function(e){l=!0,a=e},f:function(){try{u||null==n.return||n.return()}finally{if(l)throw a}}}}function t(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}var a=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),u=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return u(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{l(n.next(e))}catch(t){o(t)}}function u(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,u)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Editor=exports.Mode=void 0;var c=require("./SourceDocumentImpl"),f=l(require("lodash")),h=require("codemirror/lib/codemirror.js");require("codemirror/addon/hint/show-hint.js"),require("codemirror/mode/lua/lua.js"),require("./SheetMode"),require("./ConductionsSheetMode");var d,m="base16-dark";function v(e,t){var r=f.map(t,function(e){return"".concat(e,"?")}).join("");r=r.replace(/\./g,"\\.").replace(/\(/g,"\\(").replace(/\)/g,"\\)").replace(/\{/g,"\\{").replace(/\}/g,"\\}").replace(/\[/g,"\\[").replace(/\[/g,"\\]");var n=new RegExp("(".concat(r,")$"),"g");return(e.match(n)||[])[0]}function p(e,t){return(e.match(/.*="?(.*)/)||[])[1]}!function(e){e.sheet="sheet",e.text="text",e.lua="lua",e.conductions="conductions"}(d=exports.Mode||(exports.Mode={}));var y=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0;n(this,t),this.element=e,this.eventMarkClass="wm-marked",this.errorClass="wm-error",this.warningClass="wm-warning",i=i||{theme:"default"},this.editor=h(e,{value:r,theme:i.theme,mode:d[d.sheet],lineNumbers:i.lineNumbers})}return o(t,[{key:"activateAutoCompletion",value:function(e,t){var r=this;this.languageFeatures=e,h.registerHelper("hint","wmAutoComplete",function(e,n){return s(r,void 0,void 0,regeneratorRuntime.mark(function r(){var n,i,o,a,u,l,s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n=e.getCursor(),i=n.ch,o=i,a=new c.ActiveSourceDocument(e,t),r.next=5,this.languageFeatures.autoComplete(a);case 5:return u=r.sent,l=function(e){return e.file?e.file.isDirectory?"isFolder":"isFile":""},s={list:u.map(function(e){return{text:e.displayText,replaceText:e.text,isValueSuggestion:!!e.parameter,className:l(e),hint:function(e,t,r){var i=r.isValueSuggestion,a=e.getRange({line:n.line,ch:0},{line:n.line,ch:n.ch}),u=r.replaceText,l=((i?p(a,u):v(a,u))||"").length,s=o-l,c=o+l;s!==c&&(c-=1),e.replaceRange(r.replaceText,h.Pos(n.line,s),h.Pos(n.line,c))}}}),from:h.Pos(n.line,o),to:h.Pos(n.line,i)},r.abrupt("return",s);case 9:case"end":return r.stop()}},r,this)}))}),h.commands.autocomplete=function(e){e.showHint({hint:h.hint.wmAutoComplete,container:r.element})};var n=function(e,t){var r=t.getCursor();t.replaceRange(e,r),h.commands.autocomplete(t)};this.editor.setOption("extraKeys",{"Ctrl-Space":"autocomplete","'\"'":n.bind(null,'"'),"'/'":n.bind(null,"/"),"'_'":n.bind(null,"_"),"'='":n.bind(null,"=")})}},{key:"setMode",value:function(e){e!==d.text?this.editor.setOption("mode",d[e]):this.editor.setOption("mode",null)}},{key:"getValue",value:function(){return this.editor.getValue()}},{key:"setValue",value:function(e){this.editor.setValue(e)}},{key:"clearEventMarkers",value:function(){var t,r=e(this.editor.getAllMarks());try{for(r.s();!(t=r.n()).done;){var n=t.value;n.className!==this.warningClass&&n.className!==this.errorClass&&n.clear()}}catch(i){r.e(i)}finally{r.f()}}},{key:"clearAllMarkers",value:function(){var t,r=e(this.editor.getAllMarks());try{for(r.s();!(t=r.n()).done;){t.value.clear()}}catch(n){r.e(n)}finally{r.f()}}},{key:"setMarker",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,i=this.editor.posFromIndex(e),o=this.editor.posFromIndex(t+1);return this.editor.markText(i,o,{className:r,attributes:n})}},{key:"setEventMarker",value:function(e,t){return this.setMarker(e,t,this.eventMarkClass,{"wm-doc-pos":e})}},{key:"setErrorMarker",value:function(e,t){return this.setMarker(e,t,this.errorClass)}},{key:"setWarningMarker",value:function(e,t,r){return this.setMarker(t,r,this.warningClass,{title:e})}},{key:"update",value:function(){this.editor.refresh()}},{key:"isClean",value:function(){return this.editor.isClean()}},{key:"markClean",value:function(){this.editor.markClean()}},{key:"clearHistory",value:function(){this.editor.clearHistory()}}]),t}();exports.Editor=y;
37
37
  },{"./SourceDocumentImpl":"Glli","lodash":"B1iE","codemirror/lib/codemirror.js":"tQq4","codemirror/addon/hint/show-hint.js":"rbVD","codemirror/mode/lua/lua.js":"JTrO","./SheetMode":"edJQ","./ConductionsSheetMode":"PWBo"}],"LghJ":[function(require,module,exports) {
38
38
  var define;
39
39
  var t;parcelRequire=function(e,n,r,i){var o,u="function"==typeof parcelRequire&&parcelRequire,a="function"==typeof require&&require;function c(t,r){if(!n[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!r&&i)return i(t,!0);if(u)return u(t,!0);if(a&&"string"==typeof t)return a(t);var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}s.resolve=function(n){return e[t][1][n]||n},s.cache={};var f=n[t]=new c.Module(t);e[t][0].call(f.exports,s,f,f.exports,this)}return n[t].exports;function s(t){return c(s.resolve(t))}}c.isParcelRequire=!0,c.Module=function(t){this.id=t,this.bundle=c,this.exports={}},c.modules=e,c.cache=n,c.parent=u,c.register=function(t,n){e[t]=[function(t,e){e.exports=n},{}]};for(var f=0;f<r.length;f++)try{c(r[f])}catch(e){o||(o=e)}if(r.length){var s=c(r[r.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=s:"function"==typeof t&&t.amd&&t(function(){return s})}if(parcelRequire=c,o)throw o;return c}({sarP:[function(t,e,n){!function(t){var e={"&amp;":"&","&lt;":"<","&gt;":">","&apos;":"'","&quot;":'"'};function r(t){return t&&t.replace(/^\s+|\s+$/g,"")}function i(t){return t.replace(/(&(?:lt|gt|amp|apos|quot|#(?:\d{1,6}|x[0-9a-fA-F]{1,5}));)/g,function(t){if("#"===t[1]){var n="x"===t[2]?parseInt(t.substr(3),16):parseInt(t.substr(2),10);if(n>-1)return String.fromCharCode(n)}return e[t]||t})}function o(t,e,n){if(void 0!==n){var r=t[e];r instanceof Array?r.push(n):t[e]=e in t?[r,n]:n}}("object"==typeof n&&n||{}).fromXML=function(t,e){return function t(e,n){if("string"==typeof e)return e;var u=e.r;if(u)return u;var a,c=function(t,e){if(t.t){for(var n,u,a=t.t.split(/([^\s='"]+(?:\s*=\s*(?:'[\S\s]*?'|"[\S\s]*?"|[^\s'"]*))?)/),c=a.length,f=0;f<c;f++){var s=r(a[f]);if(s){n||(n={});var l=s.indexOf("=");if(l<0)s="@"+s,u=null;else{u=s.substr(l+1).replace(/^\s+/,""),s="@"+s.substr(0,l).replace(/\s+$/,"");var p=u[0];p!==u[u.length-1]||"'"!==p&&'"'!==p||(u=u.substr(1,u.length-2)),u=i(u)}e&&(u=e(s,u)),o(n,s,u)}}return n}}(e,n),f=e.f,s=f.length;if(c||s>1)a=c||{},f.forEach(function(e){"string"==typeof e?o(a,"#",e):o(a,e.n,t(e,n))});else if(s){var l=f[0];if(a=t(l,n),l.n){var p={};p[l.n]=a,a=p}}else a=e.c?null:"";return n&&(a=n(e.n||"",a)),a}(function(t){for(var e=String.prototype.split.call(t,/<([^!<>?](?:'[\S\s]*?'|"[\S\s]*?"|[^'"<>])*|!(?:--[\S\s]*?--|\[[^\[\]'"<>]+\[[\S\s]*?]]|DOCTYPE[^\[<>]*?\[[\S\s]*?]|(?:ENTITY[^"<>]*?"[\S\s]*?")?[\S\s]*?)|\?[\S\s]*?\?)>/),n=e.length,o={f:[]},u=o,a=[],c=0;c<n;){var f=e[c++];f&&h(f);var s=e[c++];s&&l(s)}return o;function l(t){var e=t.length,n=t[0];if("/"===n)for(var r=t.replace(/^\/|[\s\/].*$/g,"").toLowerCase();a.length;){var i=u.n&&u.n.toLowerCase();if(u=a.pop(),i===r)break}else if("?"===n)p({n:"?",r:t.substr(1,e-2)});else if("!"===n)"[CDATA["===t.substr(1,7)&&"]]"===t.substr(-2)?h(t.substr(8,e-10)):p({n:"!",r:t.substr(1)});else{var o=function(t){var e={f:[]},n=(t=t.replace(/\s*\/?$/,"")).search(/[\s='"\/]/);return n<0?e.n=t:(e.n=t.substr(0,n),e.t=t.substr(n)),e}(t);p(o),"/"===t[e-1]?o.c=1:(a.push(u),u=o)}}function p(t){u.f.push(t)}function h(t){(t=r(t))&&p(i(t))}}(t),e)}}()},{}],ol4r:[function(t,e,n){"use strict";function r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=i(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,u=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw u}}}}function i(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function c(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t}Object.defineProperty(n,"__esModule",{value:!0}),n.DocParser=n.parseCommandDbJson=void 0;var f=t("from-xml"),s="https://werckme.github.io",l=function(){function t(e){u(this,t),this.rawObject=e}return c(t,[{key:"getName",value:function(){return(this.rawObject||{})["@name"]}},{key:"getIsOptional",value:function(){return"1"===(this.rawObject||{})["@optional"]}},{key:"getType",value:function(){return(this.rawObject||{})["@type"]}},{key:"getDescription",value:function(){var t=(this.rawObject||{})["#"];return t&&t.join?t.join("\n"):t}},{key:"getIsDeprecated",value:function(){return(this.rawObject||{})["@deprecated"].length>0}},{key:"getDeprecatedText",value:function(){return(this.rawObject||{})["@deprecated"]}}]),t}(),p=function(){function t(e){u(this,t),this.rawObject=e}return c(t,[{key:"getDocumentContext",value:function(){var t,e,n=((null===(e=null===(t=this.rawObject)||void 0===t?void 0:t.doc)||void 0===e?void 0:e.command)||{})["@where"];return n?n.split(",").map(function(t){return t.trim()}):[]}},{key:"getName",value:function(){var t,e;return((null===(e=null===(t=this.rawObject)||void 0===t?void 0:t.doc)||void 0===e?void 0:e.command)||{})["@name"]}},{key:"getUrl",value:function(){return"https://werckme.github.io/manual#".concat(this.getName())}},{key:"getDescription",value:function(){var t,e,n=((null===(e=null===(t=this.rawObject)||void 0===t?void 0:t.doc)||void 0===e?void 0:e.command)||{})["#"];return n&&n.join&&(n=n.join("\n")),n}},{key:"getParameter",value:function(){var t,e,n=null===(e=null===(t=this.rawObject)||void 0===t?void 0:t.doc)||void 0===e?void 0:e.param;return n?(Array.isArray(n)||(n=[n]),(n||[]).map(function(t){return new l(t)})):[]}}]),t}();n.parseCommandDbJson=function(t){var e={},n=JSON.parse(t);for(var r in n)e[r]=new p(n[r].rawObject);return e};var h=function(){function t(){u(this,t),this.commandDb={}}return c(t,[{key:"getDocComment",value:function(t,e){var n,i=[],o=!1,u=r(t.split("\n"));try{for(u.s();!(n=u.n()).done;){var a=n.value,c=a.trim().startsWith(e);if(!o&&c&&(o=!0),o&&!c)break;c&&i.push(a.replace(e,"").trim())}}catch(p){u.e(p)}finally{u.f()}return i.join("\n")}},{key:"normalizeText",value:function(t){return t.replace(/(\[.*\])\(\s*\/{0,1}manual(.*)\)/g,"$1(".concat(s,"/manual$2)")).replace(/(\[.*\])\((?!(\s*http|\s*https|\s*ftp))\s*(.*)\)/g,"$1(".concat(s,"/manual$3)")).replace(/\\n/g,"")}},{key:"parseDocumentText",value:function(t){t=this.normalizeText(t);var e=f.fromXML("<doc>".concat(t,"</doc>")),n=new p(e),r=n.getName();r&&(this.commandDb[r]=n)}},{key:"parseLua",value:function(t){t=this.normalizeText(t);var e=this.getDocComment(t,"--");e&&this.parseDocumentText(e)}},{key:"parseHpp",value:function(t){t=this.normalizeText(t);var e=this.getDocComment(t,"///");e&&this.parseDocumentText(e)}}]),t}();n.DocParser=h},{"from-xml":"sarP"}],f88W:[function(t,e,n){},{}],Y3F9:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getPreInstalledAuxFiles=n.getAutoHintDb=void 0;var r=t("./parser/docParser"),i=(t("fs"),r.parseCommandDbJson('{"device":{"rawObject":{"doc":{"command":{"@name":"device","@where":"document","#":"Defines a device which can be used when adding instruments (see [instrumentDef](https://werckme.github.io/manual#instrumentDef))\\nsee [instrumentDef](https://werckme.github.io/manual#instrumentDef), [instrument](https://werckme.github.io/manual#instrument)\\n### example\\ndefine an device, an instrument and assign it to a track.\\n```\\ndevice: MyDevice midi 0;\\ninstrumentDef: organ _onDevice=MyDevice _ch=0 _pc=16;\\n[\\ninstrument: organ;\\n{\\nc d e f\\n}\\n]\\n```\\n**Fluidsynth**\\nIf you want to use [fluidSynth](http://www.fluidsynth.org) as output device, you can achieve this with a command like this:\\n`device: MyDevice fluidSynth _useFont=\\"PATH OF A SOUNDFONT FILE\\";`\\nOn mac, make sure that you have fluidsynth installed."},"param":[{"@name":"setName","@position":"0","@type":"text","#":"An arbitary name."},{"@name":"isType","@position":"1","@type":"[midi,fluidSynth]","#":"The type of the device."},{"@name":"usePort","@position":"2","@type":"0..N","#":"The midi port id of your device. You can get a list of your connected devices, by executing `sheetp --list`"},{"@name":"withOffset","@position":"","@optional":"1","@type":"0..N","#":"Defines an offset in milliseconds. Can be used to keep different devices in sync."},{"@name":"useFont","@position":"","@optional":"1","@type":"a file path","#":"Only valid if isType=`fluidsynth`. Sets the location of the soundfont file, which will be used by FluidSynth"}]}}},"instrumentConf":{"rawObject":{"doc":{"command":{"@name":"instrumentConf","@where":"document","#":"With `instrumentConf` you are able to setup a specific instrument.\\nFollowing settings can be applied:\\n* volume\\n* pan\\n* voicing strategy\\n* mod\\n* velocity remap\\n### examples\\n#### mixed settings\\n`instrumentConf: piano volume 100 pan 50;`\\n#### setup a mod\\n`instrumentConf: piano mod myLuaMod someValue; --the `someValue` argument belongs to \\"myLuaMod\\"`\\n#### setup a velocity remap\\nWith `remapVelocity` you are able to change the velocity values behind `ppppp..fffff` for a specific instrument.\\nIn the example below the velocity for `p` will be set to 100 and the value for `f` will be set to 10.\\nThe value range is 0..100. (100=127 Midi velocity)\\n`instrumentConf: _set=remapVelocity _p=100 _f=10;`"},"param":{"@name":"for","@position":"0","#":"The name of the target instrument. This is the only \\"unique\\" parameter for this command. All further parameters are specific to its related setting."}}}},"mod":{"rawObject":{"doc":{"command":{"@name":"mod","@where":"voice","#":"Adds a modification to the track. Every `mod` statement adds a further modification to the related voice.\\nIf you want to use ony one modification at the time use [do](https://werckme.github.io/manual#do) instead.\\n### examples\\n`/mod: arpeggio/`\\nMods can be external lua scripts, or one of these internal mods:\\n#### Bend\\nPerforms a pitch bend from or to the pitch of a note. The value range is 0..100 where 50 means the pichbend center.\\n```language=Werckmeister,type=single,tempo=140\\n/doOnce: bend _from=0/ c1 | /doOnce: bend _to=0/ c1\\n```\\n#### Arpeggio\\nPerforms an arpeggio over a given chord.\\n**Arpeggio is deprecated. Use the lua mod [myArpeggio](https://werckme.github.io/manual#myarpeggio) instead.**"},"param":{"@name":"use","@position":"0","@type":"text","#":"The name of the modification to load. This is the only \\"unique\\" parameter for this command. All further parameters are specific to its related modification."}}}},"modOnce":{"rawObject":{"doc":{"command":{"@name":"modOnce","@where":"voice","#":"Like [mod](https://werckme.github.io/manual#mod). But with the difference, that the loaded mod will be only executed once for the following event.\\n### examples\\n`/modOnce: arpeggio/`"},"param":{"@name":"use","@position":"0","@type":"text","#":"The name of the modification to load. This is the only \\"unique\\" parameter for this command. All further parameters are specific to its related modification."}}}},"cue":{"rawObject":{"doc":{"command":{"@name":"cue","@where":"voice","#":"adds a cue meta message to the corresponding midi track\\n### examples\\n`/cue: _text=\\"cue text\\"/`"},"param":{"@name":"text","@type":"text","#":"the text which appears in the MIDI message"}}}},"instrumentSection":{"rawObject":{"doc":{"command":{"@name":"instrumentSection","@where":"document","#":["Layers arbitrary instruments into one.\\nsee [instrumentDef](#instrumentDef), [instrument](https://werckme.github.io/manual#instrument), [device](https://werckme.github.io/manual#device)\\n### example\\ncreate 3 instruments and assign them to the section `myNewInstrument`.","```language=Werckmeister\\ntempo: 120;\\ndevice: MyDevice midi _usePort=0;\\ninstrumentDef:piano _onDevice=MyDevice _ch=0 _pc=0;\\ninstrumentDef:guitar _onDevice=MyDevice _ch=1 _pc=29;\\ninstrumentDef:organ _onDevice=MyDevice _ch=2 _pc=16;\\ninstrumentSection: myNewInstrument piano guitar organ;\\n\\n[\\ninstrument: myNewInstrument;\\n{\\na,,1 | a, | d#,~ | &\\n}\\n]\\n```"]},"param":{"@name":"setName","@position":"0","@type":"text","#":"An arbitary name."}}}},"instrumentDef":{"rawObject":{"doc":{"command":{"@name":"instrumentDef","@where":"document","#":"Adds a new MIDI instrument.\\nsee [instrument](https://werckme.github.io/manual#instrument), [device](https://werckme.github.io/manual#device)\\n### example\\ndefine an device, an instrument and assign it to a track.\\n```\\ndevice: MyDevice midi 0;\\ninstrumentDef: organ _onDevice=MyDevice _ch=0 _pc=16;\\n[\\ninstrument: organ;\\n{\\nc d e f\\n}\\n]\\n```"},"param":[{"@name":"setName","@position":"0","@type":"text","#":"An arbitary name."},{"@name":"onDevice","@position":"1","@type":"text","#":"The device which to use (The name of the device, see [device](https://werckme.github.io/manual#device))."},{"@name":"ch","@position":"2","@type":"0..15","#":"The MIDI channel."},{"@name":"bankMsb","@position":"3","@type":"0..127","#":"A MIDI `bank select MSB` value."},{"@name":"pc","@position":"4","@type":"0..127","#":"A MIDI `program change` value."},{"@name":"bankLsb","@type":"0..127","#":"A MIDI `bank select LSB` value."},{"@name":"cc","@type":"0..127","@deprecated":"use bankMsb instead","#":"A MIDI `bank select MSB. Deprecated use bankMsb instead` value."}]}}},"fill":{"rawObject":{"doc":{"command":{"@name":"fill","@where":"accomp","#":["Plays a template only once. Is also able to replace the performance of another template during its playback.\\nUseful for fill ins.","```language=Werckmeister\\nusing \\"chords/default.chords\\";\\ntempo: 90;\\ndevice: MyDevice midi _usePort=0;\\ninstrumentDef:drums _onDevice=MyDevice _ch=9 _pc=0;\\n\\n[\\ntype: template;\\nname: drums.fill;\\ninstrument: drums;\\n{\\n(c, & &)4 (b,, & &)4 (a,, & &)4 (g,, & &)4 |\\n}\\n]\\n\\n[\\ntype: template;\\nname: drums.main;\\ninstrument: drums;\\n{\\nr8 f#,, r & r & r & |\\n}\\n{\\nr4 d,, r4 & |\\n}\\n{\\nc,,4 r & r |\\n}\\n]\\n\\n[\\ntype: accomp;\\n{\\n/template: drums.main/\\nC |\\n/fill: drums.fill/ -- play fill and drum beat together\\nC | C |\\n/fill: drums.fill _replace=\\"drums.main\\"/ -- play only the fill in\\nC | C |\\n}\\n]\\n```"]},"param":{"@name":"replace","@type":"text","#":"the name of the template to be replaced by the fill"}}}},"jump":{"rawObject":{"doc":{"command":{"@name":"jump","@where":"voice","#":["Jumps to a previous defined mark See [mark](https://werckme.github.io/manual/#mark).\\n### example","```language=Werckmeister\\ndevice: _usePort=0 _setName=MyDevice _isType=midi;\\ninstrumentDef: _setName=piano _onDevice=MyDevice _ch=0 _pc=1 _cc=8;\\n[\\ninstrument: piano;\\n{\\n/signature: 5 4/\\n/mark: A/ -- valid & unique to this voice\\nc4 d e f g |\\n/jump: A/ -- jumps to A once\\na b c\'2\\n}\\n]\\n```"]},"param":[{"@name":"to","@position":"0","@type":"text","#":"the destination marker"},{"@name":"ignore","@position":"","@optional":"1","@type":"0..100","#":"Ignores the jump N times"},{"@name":"repeat","@position":"","@optional":"1","@type":"0..100","#":"Repeats the jump N times. (A repeat value of 1 performs 2 jumps)"}]}}},"mark":{"rawObject":{"doc":{"command":{"@name":"mark","@where":"voice","#":["adds a mark to the voice. Us it in combination with [jump](https://werckme.github.io/manual/#jump).\\n### examples","```language=Werckmeister\\ndevice: _usePort=0 _setName=MyDevice _isType=midi;\\ninstrumentDef: _setName=piano _onDevice=MyDevice _ch=0 _pc=1 _cc=8;\\n[\\ninstrument: piano;\\n{\\n/signature: 5 4/\\n/mark: A/ -- valid & unique to this voice\\nc4 d e f g |\\n/jump: A/ -- jumps to A once\\na b c\'2\\n}\\n]\\n```"]},"param":{"@name":"name","@position":"0","@type":"word","#":"the name of the mark"}}}},"fade":{"rawObject":{"doc":{"command":{"@name":"fade","@where":"voice","#":"Fades the volume over a given duration in quarters.\\n### example\\n```language=Werckmeister,type=full\\ndevice: myDevice midi _usePort=0;\\ninstrumentDef: organ myDevice _ch=0 _pc=16;\\ntempo: 75;\\n[\\ninstrument: organ;\\n{\\n\\\\fff\\n/fade: _from=0 _to=100 _duration=4/\\nc1 |\\n/fade: _from=0 _to=100 _duration=4 _curve=\\"quad\\"/\\nc1 |\\n/fade: _from=0 _to=100 _duration=4 _curve=\\"cub\\"/\\nc1 |\\n/fade: _from=0 _to=100 _duration=4 _curve=\\"quart\\"/\\nc1 |\\n/fade: _from=0 _to=100 _duration=4 _curve=\\"quint\\"/\\nc1 |\\n/fade: _from=0 _to=100 _duration=4 _curve=\\"exp\\"/\\nc1 |\\n}\\n]\\n```\\n![supported curve types](https://raw.githubusercontent.com/werckme/werckmeister/main/assets/curve-types.png)"},"param":[{"@name":"duration","@position":"0","@type":"0..N","#":"the duration in quarters."},{"@name":"from","@position":"1","@default":"0","@type":"0..100","#":"The source volume value."},{"@name":"to","@position":"2","@default":"100","@type":"0..100","#":"The target volume value."},{"@name":"curve","@position":"3","@default":"lin","@type":"lin,quad,cub,quart,quint,exp","#":"The fade curve type."}]}}},"instrument":{"rawObject":{"doc":{"command":{"@name":"instrument","@where":"track, voice","#":"Set or change the instrument of a track.\\n### examples\\n**set an instrument for a track**\\n```\\n[\\ninstrument: myInstrument;\\n{\\nc d e f\\n}\\n]\\n```\\n**change current instrument within a track**\\n```\\n[\\n{\\nc d e f |\\n/instrument: myOtherInstrument/\\nc d e f\\n}\\n]\\n```"},"param":{"@name":"use","@position":"0","@type":"text","#":"The instrument name."}}}},"pan":{"rawObject":{"doc":{"command":{"@name":"pan","@where":"voice","#":"set the pan of the current track\\n### example\\n`/pan: 50/`"},"param":{"@name":"to","@position":"0","@type":"0..100","#":"The pan value. Where 50 means the center"}}}},"signature":{"rawObject":{"doc":{"command":{"@name":"signature","@where":"voice","#":"Set the time signature of the current track.\\n### example\\n`/signature: 3 4/`"},"param":[{"@name":"upper","@position":"0","#":"The upper value of the signature."},{"@name":"lower","@position":"1","#":"The lower value of the signature."}]}}},"do":{"rawObject":{"doc":{"command":{"@name":"do","@where":"voice","#":"Such as [mod](https://werckme.github.io/manual#mod)&nbsp;`do` adds a modification to the track.\\nThe difference is: every `mod` command adds a further modification to a voice.\\n`do` replaces the previous modification.\\n### example\\n`/do: arpeggio/`"},"param":{"@name":"use","@position":"0","@type":"text","#":"The name of the modification to load. This is the only \\"unique\\" parameter for this command. All further parameters are specific to its related modification."}}}},"doOnce":{"rawObject":{"doc":{"command":{"@name":"doOnce","@where":"voice","#":"Like [do](https://werckme.github.io/manual#do). But with the difference, that the loaded mod will be only executed once for the following event.\\n### example\\n`/doOnce: arpeggio/`"},"param":{"@name":"use","@position":"0","@type":"text","#":"The name of the modification to load. This is the only \\"unique\\" parameter for this command. All further parameters are specific to its related modification."}}}},"tempo":{"rawObject":{"doc":{"command":{"@name":"tempo","@where":"document, track","#":"`tempo` defines or changes the current tempo.\\n### example\\n`tempo: 120;`\\nIt is also possible to set different tempo values for several tracks:\\n[see here](https://werckme.github.io/manual#tempo)"},"param":{"@name":"bpm","@position":"0","#":"The tempo bpm value."}}}},"voicingStrategy":{"rawObject":{"doc":{"command":{"@name":"voicingStrategy","@where":"voice","#":"Adds a modification to the track.\\n### example\\n`/voicingStrategy: asNotated/`\\nVoicing strategies can be external lua scripts, or one of these internal strategies:\\n* asNotated\\n* simpleGuitar"},"param":{"@name":"use","@position":"0","@type":"text","#":"The name of the strategy to load. This is the only \\"unique\\" parameter for this command. All further parameters are specific to its related strategy."}}}},"volume":{"rawObject":{"doc":{"command":{"@name":"volume","@where":"voice","#":"set the volume of the current instrument\\n### examples\\n`/volume: 50/`"},"param":{"@name":"to","@position":"0","@type":"0..100","#":"The volume value."}}}},"drumRudiments":{"rawObject":{"doc":{"command":{"@name":"drumRudiments","@where":"mod","@using":"lua/mod/drumRudiments.lua","#":"Implements a collection of different drum rudiments. ([see Wikipedia](https://en.wikipedia.org/wiki/Drum_rudiment))\\nYou can specify which notes are for `L` and `R` and performing duration.\\nThis will be achieved by using an chord as source material.\\nThe chord pitches will be used for `L` and `R`.\\nThe length of the chord event defines over which time the rudiment will be peformed.\\nAn event tag specifies which rudiment will be performed.\\nFor example:\\nThis plays one paradiddle over a length of 1 quarter\\nusing `sn1` for R and `sn2` for L:\\n```\\n/mod: drumRudiments/\\nR L\\n\\"paradiddle\\"@<\\"sn1\\" \\"sn2\\">4\\n```\\nExamples:\\n**a single paradiddle**\\n```language=Werckmeister\\nusing \\"lua/mods/drumRudiments.lua\\";\\ntempo: 150;\\ndevice: MyDevice midi 0;\\ninstrumentDef:piano MyDevice _ch=0 _pc=118;\\n[\\ninstrument: piano;\\n{\\n/mod: drumRudiments/\\n-- a paradiddle (RLRR) with c\' for R and c for L\\n\\"paradiddle\\"@<c\' c>1\\n}\\n]\\n```\\n**repeating**\\n```language=Werckmeister\\nusing \\"lua/mods/drumRudiments.lua\\";\\ntempo: 120;\\ndevice: MyDevice midi 0;\\ninstrumentDef:piano MyDevice _ch=0 _pc=118;\\n[\\ninstrument: piano;\\n{\\n/mod: drumRudiments/\\n-- performs 4 paradiddles (RLRR LRLL RLRR LRLL) with c\' for R and c for L\\n\\"4x paradiddle\\"@<c\' c>1\\n}\\n]\\n```\\n**orchestration**\\nIf you want to orchestrate a rudiment over a drum set,\\nyou are able to define more R & L notes. *(The total number of the notes has to be even.)*\\n```language=Werckmeister\\nusing \\"lua/mods/drumRudiments.lua\\";\\ntempo: 120;\\ndevice: MyDevice midi 0;\\ninstrumentDef:piano MyDevice _ch=0 _pc=118;\\n[\\ninstrument: piano;\\n{\\n/mod: drumRudiments/\\n-- performs 4 paradiddles (RLRR LRLL RLRR LRLL) with\\n-- c\' for R1 and c for L1\\n-- and c, for R2 and c,, for L2.\\n-- The final sequence will be: c\'(R1) c(L1) c,(R2) c,,(R1) ...\\n\\"4x paradiddle\\"@<c\' c c, c,,>1\\n}\\n]\\n```\\n**Supported Rudiments**\\n<ul style=\\"font-size: 0.9em;\\">\\n<li>singleStrokeRoll</li>\\n<li>doubleStrokeRoll</li>\\n<li>trippleStrokeRoll</li>\\n<li>fiveStrokeRoll</li>\\n<li>singleStrokeFour</li>\\n<li>singleStrokeSeven</li>\\n<li>multipleBounceRoll</li>\\n<li>sixStrokeRoll</li>\\n<li>sevenStrokeRoll</li>\\n<li>nineStrokeRoll</li>\\n<li>tenStrokeRoll</li>\\n<li>elevenStrokeRoll</li>\\n<li>thirteenStrokeRoll</li>\\n<li>fifteenStrokeRoll</li>\\n<li>seventeenStrokeRoll</li>\\n<li>paradiddle</li>\\n<li>doubleParadiddle</li>\\n<li>trippleParadiddle</li>\\n<li>paradiddlediddle</li>\\n<li>flam</li>\\n<li>flamAccent</li>\\n<li>flamTap</li>\\n<li>flamacue</li>\\n<li>flamParadiddle</li>\\n<li>singleFlammedMill</li>\\n<li>pataflafla</li>\\n<li>swissArmytriplet</li>\\n<li>invertedFlamTap</li>\\n<li>flamDrag</li>\\n<li>singleDragTap</li>\\n<li>doubleDragTap</li>\\n<li>lesson25</li>\\n<li>singleDragadiddle</li>\\n<li>dragParadiddle1</li>\\n<li>dragParadiddle2</li>\\n<li>singleRatamacue</li>\\n<li>doubleRatamacue</li>\\n<li>trippleRatamacue</li>\\n</ul>"},"param":[{"@name":"velocityFactorAccented","@optional":"1","@type":"0..1","#":"The velocity factor for accented notes (Default=1)"},{"@name":"velocityFactorUnaccented","@optional":"1","@type":"0..1","#":"The velocity factor for unaccented notes (Default=0.7)"},{"@name":"velocityFactorGraceNote","@optional":"1","@type":"0..1","#":"The velocity factor for accented notes (Default=1)"},{"@name":"flamOffset","@optional":"1","@type":"0..N","#":"The offset in quartes when to perform the grace note before the actual note (Default=0.05)"},{"@name":"dragOffset","@optional":"1","@type":"0..N","#":"The offset in quartes when to perform the two grace notes before the actual note (Default=0.05)"}]}}},"guitarStroke":{"rawObject":{"doc":{"command":{"@name":"guitarStroke","@where":"mod","@using":"lua/mod/guitarStroke.lua","#":"Simulates guitar strokes as mini arpeggios.\\n*Note: the alternate mode works only if this mod is set via instrumentConf.*\\n```\\n-- does not work:\\n[\\n{\\n/mod: guitarStroke _mode=alternate/\\n}\\n]\\n```\\n```\\n-- does work:\\ninstrumentConf: myInstrument mod guitarStroke _mode=alternate;\\n```\\n**Example**\\n```language=Werckmeister\\nusing \\"lua/mods/guitarStroke.lua\\";\\ntempo: 120;\\ndevice: MyDevice midi 0;\\ninstrumentDef: piano MyDevice _ch=0 _pc=24;\\ninstrumentConf: piano mod guitarStroke _mode=alternate _value=16;\\n[\\ninstrument: piano;\\n{\\n<c e g b>4 <c e g b>4 <c eb g bb>2 | <c eb g bb>2 <c eb g bb>2\\n}\\n]\\n```"},"param":[{"@name":"direction","@optional":"1","@type":"[up,down]","#":"Specifies the start direction of the stroke"},{"@name":"value","@optional":"1","@type":"[1,2,4,8,...]","#":"the duration of one arpeggio event. (Default=64)"},{"@name":"mode","@optional":"1","@type":"[normal,alternate]","#":"Perform only one stroke direction (normal) or alternates between up and down. (Default=normal)"}]}}},"legato":{"rawObject":{"doc":{"command":{"@name":"legato","@where":"mod","@using":"lua/mod/legato.lua","#":"Performs every note legato. It is also possible to tag single notes.\\nIf a tag is given, only the tagged notes are performed legato.\\n```language=Werckmeister\\nusing \\"lua/mods/legato.lua\\";\\ntempo: 140;\\ndevice: MyDevice midi 0;\\ninstrumentDef:piano MyDevice _ch=0 _pc=0;\\n[\\ninstrument: piano;\\n{\\n/mod: legato _forTag=leg _amount=100/\\n-- only the `d` will be performed legato.\\nc \\"leg\\"@d e f\\n}\\n]\\n```"},"param":[{"@name":"forTag","@optional":"1","@type":"text","#":"Specifies a tag name. If set only events with this tag name will be affected by the legato mod."},{"@name":"amount","@optional":"1","@type":"0..100","#":"The ammount of the legato effect"}]}}},"myArpeggio":{"rawObject":{"doc":{"command":{"@name":"myArpeggio","@where":"mod","@using":"lua/mod/myArpeggio.lua","#":"A simple arpeggio implementation.\\n**Example**\\n```language=Werckmeister\\nusing \\"lua/mods/myArpeggio.lua\\";\\ntempo: 120;\\ndevice: MyDevice midi 0;\\ninstrumentDef: piano MyDevice _ch=0 _pc=0;\\n[\\ninstrument: piano;\\n{\\n/do: myArpeggio/\\n<c e g b>2\\n/do: myArpeggio _direction=down/\\n<c eb g bb>2\\n}\\n]\\n```"},"param":[{"@name":"style","@optional":"1","@type":"[normal,legato]","#":"Performs the arpeggio normal or legato"},{"@name":"direction","@optional":"1","@type":"[up,down]","#":"the direction of the arpeggio. (Default=up)"}]}}},"staccato":{"rawObject":{"doc":{"command":{"@name":"staccato","@where":"mod","@using":"lua/mod/staccato.lua","#":"Performs every note staccato. It is also possible to tag single notes.\\nIf a tag is given, only the tagged notes are performed staccato.\\n```language=Werckmeister\\nusing \\"lua/mods/staccato.lua\\";\\ntempo: 140;\\ndevice: MyDevice midi 0;\\ninstrumentDef:piano MyDevice _ch=0 _pc=0;\\n[\\ninstrument: piano;\\n{\\n/mod: staccato _forTag=stac _amount=100/\\n-- only the `d` will be performed staccato.\\nc \\"stac\\"@d e f\\n}\\n]\\n```"},"param":[{"@name":"forTag","@optional":"1","@type":"text","#":"Specifies a tag name. If set only events with this tag name will be affected by the staccato mod."},{"@name":"amount","@optional":"1","@type":"0..100","#":"The ammount of the staccato effect"}]}}},"swing":{"rawObject":{"doc":{"command":{"@name":"swing","@where":"mod","@using":"lua/mod/swing.lua","#":"Performs a swing groove.\\n```language=Werckmeister\\nusing \\"lua/mods/swing.lua\\";\\ntempo: 120;\\ndevice: MyDevice midi 0;\\ninstrumentDef: piano MyDevice _ch=0 _pc=0;\\n[\\ninstrument: piano;\\n{\\n/mod: swing/\\nc8 c c c c c c c\\n}\\n]\\n```"},"param":[{"@name":"grid","@optional":"1","@type":"[8, 16]","#":"Performs the swing offset either on 8th or 16th. (Default=8)"},{"@name":"offset","@optional":"1","@type":"0..100","#":"The ammount of the swing offset"}]}}},"guitar":{"rawObject":{"doc":{"command":{"@name":"guitar","@where":"voicingStrategy","@using":"lua/voicings/guitar.lua","#":"Tries to simulate the chord voicing of an guitar.\\n```language=Werckmeister\\nusing \\"lua/voicings/guitar.lua\\";\\nusing \\"chords/default.chords\\";\\ntempo: 120;\\ndevice: MyDevice midi 0;\\ninstrumentDef:piano MyDevice _ch=0 _pc=0;\\n[\\ntype: template;\\nname: myTemplate;\\ninstrument: piano;\\n{\\n/voicingStrategy: guitar/\\n<I II III IV V VI VII>1\\n}\\n]\\n[\\ntype: accomp;\\n{\\nC | F | G | C |\\n}\\n]\\n```"},"param":{"@name":"range","@optional":"1","@type":"[contrabass,bass,baritone,tenor,alto,mezzosoprano,soprano]","#":"If given the strategy tries to keeps the range by shifting the octave of the chord."}}}},"simple":{"rawObject":{"doc":{"command":{"@name":"simple","@where":"voicingStrategy","@using":"lua/voicings/simple.lua","#":"The simple approach with no strategy.\\n```language=Werckmeister\\nusing \\"lua/voicings/simple.lua\\";\\nusing \\"chords/default.chords\\";\\ntempo: 120;\\ndevice: MyDevice midi 0;\\ninstrumentDef:piano MyDevice _ch=0 _pc=0;\\n[\\ntype: template;\\nname: myTemplate;\\ninstrument: piano;\\n{\\n/voicingStrategy: simple/\\n<I II III IV V VI VII>1\\n}\\n]\\n[\\ntype: accomp;\\n{\\nC | F | G | C |\\n}\\n]\\n```"},"param":{"@name":"range","@optional":"1","@type":"[contrabass,bass,baritone,tenor,alto,mezzosoprano,soprano]","#":"If given the strategy tries to keeps the range by shifting the octave of the chord."}}}},"voicelead":{"rawObject":{"doc":{"command":{"@name":"voicelead","@where":"voicingStrategy","@using":"lua/voicings/voicelead.lua","#":"Tries to simulates a voice leading approach:\\nthe octaves of a chord are rearranged, so that the actual pitch distance between the previous chord is kept minimal.\\n```language=Werckmeister\\nusing \\"lua/voicings/voicelead.lua\\";\\nusing \\"chords/default.chords\\";\\ntempo: 120;\\ndevice: MyDevice midi 0;\\ninstrumentDef:piano MyDevice _ch=0 _pc=0;\\n[\\ntype: template;\\nname: myTemplate;\\ninstrument: piano;\\n{\\n/voicingStrategy: voicelead/\\n<I II III IV V VI VII>1\\n}\\n]\\n[\\ntype: accomp;\\n{\\nC | F | G | C |\\n}\\n]\\n```"},"param":{"@name":"range","@optional":"1","@type":"[contrabass,bass,baritone,tenor,alto,mezzosoprano,soprano]","#":"If given the strategy tries to keeps the range by shifting the octave of the chord."}}}}}'));n.getAutoHintDb=function(){return i};var o=JSON.parse('{"/":[{"name":"chords","isDirectory":true},{"name":"lua","isDirectory":true},{"name":"pitchmaps","isDirectory":true},{"name":"templates","isDirectory":true}],"/chords":[{"name":"default.chords"}],"/lua/com":[{"name":"com.lua"},{"name":"globals.lua"},{"name":"inspect.lua"},{"name":"tests.lua"}],"/lua/mods":[{"name":"drumRudiments.lua"},{"name":"guitarStroke.lua"},{"name":"legato.lua"},{"name":"myArpeggio.lua"},{"name":"staccato.lua"},{"name":"swing.lua"}],"/lua/voicings":[{"name":"solvers","isDirectory":true},{"name":"config.lua"},{"name":"guitar.lua"},{"name":"simple.lua"},{"name":"voicelead.lua"}],"/lua/voicings/solvers":[{"name":"asolver.lua"},{"name":"config.lua"},{"name":"guitar.lua"},{"name":"simple.lua"},{"name":"voicelead.lua"}],"/pitchmaps":[{"name":"battery3.tight.pitchmap"},{"name":"defaultMIDI.pitchmap"},{"name":"defaultMidiDrumMap.pitchmap"}],"/templates":[{"name":"bass.blues.template"},{"name":"bass.bossanova.template"},{"name":"bass.country.template"},{"name":"bass.disco.template"},{"name":"bass.jazzSwing.template"},{"name":"bass.reggae.template"},{"name":"bass.soca.template"},{"name":"bossanova.template"},{"name":"countryschlager1.template"},{"name":"drums.bossanova.template"},{"name":"drums.country.template"},{"name":"drums.disco.template"},{"name":"drums.jazzSwing.template"},{"name":"drums.purdie.template"},{"name":"drums.reggae.template"},{"name":"drums.soca.template"},{"name":"ennio.template"},{"name":"guitar.bossanova.template"},{"name":"guitar.country.template"},{"name":"rhythm.bossanova.template"},{"name":"rhythm.country.template"},{"name":"rhythm.jazzSwing.template"},{"name":"rhythm.reggae.template"}]}');n.getPreInstalledAuxFiles=function(){return o}},{"./parser/docParser":"ol4r",fs:"f88W"}],yh9p:[function(t,e,n){"use strict";n.byteLength=function(t){var e=f(t),n=e[0],r=e[1];return 3*(n+r)/4-r},n.toByteArray=function(t){var e,n,r=f(t),u=r[0],a=r[1],c=new o(function(t,e,n){return 3*(e+n)/4-n}(0,u,a)),s=0,l=a>0?u-4:u;for(n=0;n<l;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],c[s++]=e>>16&255,c[s++]=e>>8&255,c[s++]=255&e;return 2===a&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,c[s++]=255&e),1===a&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,c[s++]=e>>8&255,c[s++]=255&e),c},n.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],u=0,a=n-i;u<a;u+=16383)o.push(l(t,u,u+16383>a?a:u+16383));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=u.length;a<c;++a)r[a]=u[a],i[u.charCodeAt(a)]=a;function f(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function s(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function l(t,e,n){for(var r,i=[],o=e;o<n;o+=3)r=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),i.push(s(r));return i.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],JgNJ:[function(t,e,n){n.read=function(t,e,n,r,i){var o,u,a=8*i-r-1,c=(1<<a)-1,f=c>>1,s=-7,l=n?i-1:0,p=n?-1:1,h=t[e+l];for(l+=p,o=h&(1<<-s)-1,h>>=-s,s+=a;s>0;o=256*o+t[e+l],l+=p,s-=8);for(u=o&(1<<-s)-1,o>>=-s,s+=r;s>0;u=256*u+t[e+l],l+=p,s-=8);if(0===o)o=1-f;else{if(o===c)return u?NaN:1/0*(h?-1:1);u+=Math.pow(2,r),o-=f}return(h?-1:1)*u*Math.pow(2,o-r)},n.write=function(t,e,n,r,i,o){var u,a,c,f=8*o-i-1,s=(1<<f)-1,l=s>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,m=r?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=s):(u=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-u))<1&&(u--,c*=2),(e+=u+l>=1?p/c:p*Math.pow(2,1-l))*c>=2&&(u++,c/=2),u+l>=s?(a=0,u=s):u+l>=1?(a=(e*c-1)*Math.pow(2,i),u+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),u=0));i>=8;t[n+h]=255&a,h+=m,a/=256,i-=8);for(u=u<<i|a,f+=i;f>0;t[n+h]=255&u,h+=m,u/=256,f-=8);t[n+h-m]|=128*d}},{}],REa7:[function(t,e,n){var r={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},{}],dskh:[function(t,e,n){arguments[3];var r=arguments[3],i=t("base64-js"),o=t("ieee754"),u=t("isarray");function a(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function c(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=f.prototype:(null===t&&(t=new f(e)),t.length=e),t}function f(t,e,n){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return p(this,t)}return s(this,t,e,n)}function s(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r),f.TYPED_ARRAY_SUPPORT?(t=e).__proto__=f.prototype:t=h(t,e),t}(t,e,n,r):"string"==typeof e?function(t,e,n){if("string"==typeof n&&""!==n||(n="utf8"),!f.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|g(e,n),i=(t=c(t,r)).write(e,n);return i!==r&&(t=t.slice(0,i)),t}(t,e,n):m(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function p(t,e){if(l(e),t=c(t,e<0?0:0|d(e)),!f.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function h(t,e){var n=e.length<0?0:0|d(e.length);t=c(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function m(t,e){if(f.isBuffer(e)){var n=0|d(e.length);return 0===(t=c(t,n)).length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||function(t){return t!=t}(e.length)?c(t,0):h(t,e);if("Buffer"===e.type&&u(e.data))return h(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function g(t,e){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(t).length;default:if(r)return W(t).length;e=(""+e).toLowerCase(),r=!0}}function v(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function y(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=f.from(e,r)),f.isBuffer(e))return 0===e.length?-1:_(t,e,n,r,i);if("number"==typeof e)return e&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):_(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function _(t,e,n,r,i){var o,u=1,a=t.length,c=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;u=2,a/=2,c/=2,n/=2}function f(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(i){var s=-1;for(o=n;o<a;o++)if(f(t,o)===f(e,-1===s?0:o-s)){if(-1===s&&(s=o),o-s+1===c)return s*u}else-1!==s&&(o-=o-s),s=-1}else for(n+c>a&&(n=a-c),o=n;o>=0;o--){for(var l=!0,p=0;p<c;p++)if(f(t,o+p)!==f(e,p)){l=!1;break}if(l)return o}return-1}function b(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var u=0;u<r;++u){var a=parseInt(e.substr(2*u,2),16);if(isNaN(a))return u;t[n+u]=a}return u}function w(t,e,n,r){return q(W(e,t.length-n),t,n,r)}function x(t,e,n,r){return q(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function A(t,e,n,r){return x(t,e,n,r)}function k(t,e,n,r){return q(Y(e),t,n,r)}function S(t,e,n,r){return q(function(t,e){for(var n,r,i,o=[],u=0;u<t.length&&!((e-=2)<0);++u)r=(n=t.charCodeAt(u))>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function R(t,e,n){return 0===e&&n===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,n))}function D(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,u,a,c,f=t[i],s=null,l=f>239?4:f>223?3:f>191?2:1;if(i+l<=n)switch(l){case 1:f<128&&(s=f);break;case 2:128==(192&(o=t[i+1]))&&(c=(31&f)<<6|63&o)>127&&(s=c);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(c=(15&f)<<12|(63&o)<<6|63&u)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:o=t[i+1],u=t[i+2],a=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&a)&&(c=(15&f)<<18|(63&o)<<12|(63&u)<<6|63&a)>65535&&c<1114112&&(s=c)}null===s?(s=65533,l=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=l}return function(t){var e=t.length;if(e<=E)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=E));return n}(r)}n.Buffer=f,n.SlowBuffer=function(t){return+t!=t&&(t=0),f.alloc(+t)},n.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==r.TYPED_ARRAY_SUPPORT?r.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(i){return!1}}(),n.kMaxLength=a(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,e,n){return s(null,t,e,n)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,e,n){return function(t,e,n,r){return l(e),e<=0?c(t,e):void 0!==n?"string"==typeof r?c(t,e).fill(n,r):c(t,e).fill(n):c(t,e)}(null,t,e,n)},f.allocUnsafe=function(t){return p(null,t)},f.allocUnsafeSlow=function(t){return p(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,e){if(!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!u(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=f.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(!f.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},f.byteLength=g,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)v(this,e,e+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},f.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?D(this,0,t):function(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,n);case"utf8":case"utf-8":return D(this,e,n);case"ascii":return I(this,e,n);case"latin1":case"binary":return j(this,e,n);case"base64":return R(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",e=n.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,e,n,r,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),u=(n>>>=0)-(e>>>=0),a=Math.min(o,u),c=this.slice(r,i),s=t.slice(e,n),l=0;l<a;++l)if(c[l]!==s[l]){o=c[l],u=s[l];break}return o<u?-1:u<o?1:0},f.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},f.prototype.indexOf=function(t,e,n){return y(this,t,e,n,!0)},f.prototype.lastIndexOf=function(t,e,n){return y(this,t,e,n,!1)},f.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return w(this,t,e,n);case"ascii":return x(this,t,e,n);case"latin1":case"binary":return A(this,t,e,n);case"base64":return k(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function I(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function j(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function O(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=F(t[o]);return i}function T(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function P(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,n,r,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function M(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function B(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function L(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(t,e,n,r,i){return i||L(t,0,n,4),o.write(t,e,n,r,23,4),n+4}function z(t,e,n,r,i){return i||L(t,0,n,8),o.write(t,e,n,r,52,8),n+8}f.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),f.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=f.prototype;else{var i=e-t;n=new f(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},f.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},f.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},f.prototype.readUInt8=function(t,e){return e||P(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,e){return e||P(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,e){return e||P(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,e){return e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,e){return e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},f.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){e||P(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},f.prototype.readInt16BE=function(t,e){e||P(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},f.prototype.readInt32LE=function(t,e){return e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,e){return e||P(t,4,this.length),o.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return e||P(t,4,this.length),o.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return e||P(t,8,this.length),o.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return e||P(t,8,this.length),o.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,e,n,r){t=+t,e|=0,n|=0,r||C(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},f.prototype.writeUIntBE=function(t,e,n,r){t=+t,e|=0,n|=0,r||C(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},f.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},f.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},f.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},f.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},f.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},f.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);C(this,t,e,n,i-1,-i)}var o=0,u=1,a=0;for(this[e]=255&t;++o<n&&(u*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/u>>0)-a&255;return e+n},f.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);C(this,t,e,n,i-1,-i)}var o=n-1,u=1,a=0;for(this[e+o]=255&t;--o>=0&&(u*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/u>>0)-a&255;return e+n},f.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},f.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},f.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},f.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},f.prototype.writeFloatLE=function(t,e,n){return U(this,t,e,!0,n)},f.prototype.writeFloatBE=function(t,e,n){return U(this,t,e,!1,n)},f.prototype.writeDoubleLE=function(t,e,n){return z(this,t,e,!0,n)},f.prototype.writeDoubleBE=function(t,e,n){return z(this,t,e,!1,n)},f.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},f.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!f.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var u=f.isBuffer(t)?t:W(new f(t,r).toString()),a=u.length;for(o=0;o<n-e;++o)this[o+e]=u[o%a]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function F(t){return t<16?"0"+t.toString(16):t.toString(16)}function W(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],u=0;u<r;++u){if((n=t.charCodeAt(u))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(u+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Y(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}},{"base64-js":"yh9p",ieee754:"JgNJ",isarray:"REa7",buffer:"dskh"}],B1iE:[function(t,e,n){arguments[3],t("buffer").Buffer;var r=arguments[3];t("buffer").Buffer;(function(){var t,i=200,o="Expected a function",u="__lodash_hash_undefined__",a="__lodash_placeholder__",c=1,f=2,s=4,l=1,p=2,h=1,m=2,d=4,g=8,v=16,y=32,_=64,b=128,w=256,x=512,A=800,k=16,S=1/0,R=9007199254740991,D=1.7976931348623157e308,E=NaN,I=4294967295,j=I-1,O=I>>>1,T=[["ary",b],["bind",h],["bindKey",m],["curry",g],["curryRight",v],["flip",x],["partial",y],["partialRight",_],["rearg",w]],P="[object Arguments]",C="[object Array]",M="[object AsyncFunction]",B="[object Boolean]",L="[object Date]",U="[object DOMException]",z="[object Error]",N="[object Function]",F="[object GeneratorFunction]",W="[object Map]",Y="[object Number]",q="[object Null]",$="[object Object]",V="[object Proxy]",G="[object RegExp]",H="[object Set]",K="[object String]",Z="[object Symbol]",J="[object Undefined]",X="[object WeakMap]",Q="[object ArrayBuffer]",tt="[object DataView]",et="[object Float32Array]",nt="[object Float64Array]",rt="[object Int8Array]",it="[object Int16Array]",ot="[object Int32Array]",ut="[object Uint8Array]",at="[object Uint8ClampedArray]",ct="[object Uint16Array]",ft="[object Uint32Array]",st=/\b__p \+= '';/g,lt=/\b(__p \+=) '' \+/g,pt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ht=/&(?:amp|lt|gt|quot|#39);/g,mt=/[&<>"']/g,dt=RegExp(ht.source),gt=RegExp(mt.source),vt=/<%-([\s\S]+?)%>/g,yt=/<%([\s\S]+?)%>/g,_t=/<%=([\s\S]+?)%>/g,bt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wt=/^\w*$/,xt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,At=/[\\^$.*+?()[\]{}|]/g,kt=RegExp(At.source),St=/^\s+/,Rt=/\s/,Dt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Et=/\{\n\/\* \[wrapped with (.+)\] \*/,It=/,? & /,jt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ot=/[()=,{}\[\]\/\s]/,Tt=/\\(\\)?/g,Pt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ct=/\w*$/,Mt=/^[-+]0x[0-9a-f]+$/i,Bt=/^0b[01]+$/i,Lt=/^\[object .+?Constructor\]$/,Ut=/^0o[0-7]+$/i,zt=/^(?:0|[1-9]\d*)$/,Nt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ft=/($^)/,Wt=/['\n\r\u2028\u2029\\]/g,Yt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",qt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$t="["+qt+"]",Vt="["+Yt+"]",Gt="\\d+",Ht="[a-z\\xdf-\\xf6\\xf8-\\xff]",Kt="[^\\ud800-\\udfff"+qt+Gt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Zt="\\ud83c[\\udffb-\\udfff]",Jt="[^\\ud800-\\udfff]",Xt="(?:\\ud83c[\\udde6-\\uddff]){2}",Qt="[\\ud800-\\udbff][\\udc00-\\udfff]",te="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ee="(?:"+Ht+"|"+Kt+")",ne="(?:"+te+"|"+Kt+")",re="(?:"+Vt+"|"+Zt+")?",ie="[\\ufe0e\\ufe0f]?"+re+"(?:\\u200d(?:"+[Jt,Xt,Qt].join("|")+")[\\ufe0e\\ufe0f]?"+re+")*",oe="(?:"+["[\\u2700-\\u27bf]",Xt,Qt].join("|")+")"+ie,ue="(?:"+[Jt+Vt+"?",Vt,Xt,Qt,"[\\ud800-\\udfff]"].join("|")+")",ae=RegExp("['’]","g"),ce=RegExp(Vt,"g"),fe=RegExp(Zt+"(?="+Zt+")|"+ue+ie,"g"),se=RegExp([te+"?"+Ht+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[$t,te,"$"].join("|")+")",ne+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[$t,te+ee,"$"].join("|")+")",te+"?"+ee+"+(?:['’](?:d|ll|m|re|s|t|ve))?",te+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Gt,oe].join("|"),"g"),le=RegExp("[\\u200d\\ud800-\\udfff"+Yt+"\\ufe0e\\ufe0f]"),pe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,he=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],me=-1,de={};de[et]=de[nt]=de[rt]=de[it]=de[ot]=de[ut]=de[at]=de[ct]=de[ft]=!0,de[P]=de[C]=de[Q]=de[B]=de[tt]=de[L]=de[z]=de[N]=de[W]=de[Y]=de[$]=de[G]=de[H]=de[K]=de[X]=!1;var ge={};ge[P]=ge[C]=ge[Q]=ge[tt]=ge[B]=ge[L]=ge[et]=ge[nt]=ge[rt]=ge[it]=ge[ot]=ge[W]=ge[Y]=ge[$]=ge[G]=ge[H]=ge[K]=ge[Z]=ge[ut]=ge[at]=ge[ct]=ge[ft]=!0,ge[z]=ge[N]=ge[X]=!1;var ve={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ye=parseFloat,_e=parseInt,be="object"==typeof r&&r&&r.Object===Object&&r,we="object"==typeof self&&self&&self.Object===Object&&self,xe=be||we||Function("return this")(),Ae="object"==typeof n&&n&&!n.nodeType&&n,ke=Ae&&"object"==typeof e&&e&&!e.nodeType&&e,Se=ke&&ke.exports===Ae,Re=Se&&be.process,De=function(){try{return ke&&ke.require&&ke.require("util").types||Re&&Re.binding&&Re.binding("util")}catch(r){}}(),Ee=De&&De.isArrayBuffer,Ie=De&&De.isDate,je=De&&De.isMap,Oe=De&&De.isRegExp,Te=De&&De.isSet,Pe=De&&De.isTypedArray;function Ce(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Me(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var u=t[i];e(r,u,n(u),t)}return r}function Be(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Le(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Ue(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var u=t[n];e(u,n,t)&&(o[i++]=u)}return o}function ze(t,e){return!(null==t||!t.length)&&Ke(t,e,0)>-1}function Ne(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Fe(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function We(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Ye(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function qe(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function $e(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Ve=Qe("length");function Ge(t,e,n){var r;return n(t,function(t,n,i){if(e(t,n,i))return r=n,!1}),r}function He(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Ke(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):He(t,Je,n)}function Ze(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}function Je(t){return t!=t}function Xe(t,e){var n=null==t?0:t.length;return n?nn(t,e)/n:E}function Qe(e){return function(n){return null==n?t:n[e]}}function tn(e){return function(n){return null==e?t:e[n]}}function en(t,e,n,r,i){return i(t,function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)}),n}function nn(e,n){for(var r,i=-1,o=e.length;++i<o;){var u=n(e[i]);u!==t&&(r=r===t?u:r+u)}return r}function rn(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function on(t){return t?t.slice(0,wn(t)+1).replace(St,""):t}function un(t){return function(e){return t(e)}}function an(t,e){return Fe(e,function(e){return t[e]})}function cn(t,e){return t.has(e)}function fn(t,e){for(var n=-1,r=t.length;++n<r&&Ke(e,t[n],0)>-1;);return n}function sn(t,e){for(var n=t.length;n--&&Ke(e,t[n],0)>-1;);return n}var ln=tn({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),pn=tn({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function hn(t){return"\\"+ve[t]}function mn(t){return le.test(t)}function dn(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function gn(t,e){return function(n){return t(e(n))}}function vn(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var u=t[n];u!==e&&u!==a||(t[n]=a,o[i++]=n)}return o}function yn(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function _n(t){return mn(t)?function(t){for(var e=fe.lastIndex=0;fe.test(t);)++e;return e}(t):Ve(t)}function bn(t){return mn(t)?function(t){return t.match(fe)||[]}(t):function(t){return t.split("")}(t)}function wn(t){for(var e=t.length;e--&&Rt.test(t.charAt(e)););return e}var xn=tn({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),An=function e(n){var r,Rt=(n=null==n?xe:An.defaults(xe.Object(),n,An.pick(xe,he))).Array,Yt=n.Date,qt=n.Error,$t=n.Function,Vt=n.Math,Gt=n.Object,Ht=n.RegExp,Kt=n.String,Zt=n.TypeError,Jt=Rt.prototype,Xt=$t.prototype,Qt=Gt.prototype,te=n["__core-js_shared__"],ee=Xt.toString,ne=Qt.hasOwnProperty,re=0,ie=(r=/[^.]+$/.exec(te&&te.keys&&te.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",oe=Qt.toString,ue=ee.call(Gt),fe=xe._,le=Ht("^"+ee.call(ne).replace(At,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ve=Se?n.Buffer:t,be=n.Symbol,we=n.Uint8Array,Ae=ve?ve.allocUnsafe:t,ke=gn(Gt.getPrototypeOf,Gt),Re=Gt.create,De=Qt.propertyIsEnumerable,Ve=Jt.splice,tn=be?be.isConcatSpreadable:t,kn=be?be.iterator:t,Sn=be?be.toStringTag:t,Rn=function(){try{var t=So(Gt,"defineProperty");return t({},"",{}),t}catch(n){}}(),Dn=n.clearTimeout!==xe.clearTimeout&&n.clearTimeout,En=Yt&&Yt.now!==xe.Date.now&&Yt.now,In=n.setTimeout!==xe.setTimeout&&n.setTimeout,jn=Vt.ceil,On=Vt.floor,Tn=Gt.getOwnPropertySymbols,Pn=ve?ve.isBuffer:t,Cn=n.isFinite,Mn=Jt.join,Bn=gn(Gt.keys,Gt),Ln=Vt.max,Un=Vt.min,zn=Yt.now,Nn=n.parseInt,Fn=Vt.random,Wn=Jt.reverse,Yn=So(n,"DataView"),qn=So(n,"Map"),$n=So(n,"Promise"),Vn=So(n,"Set"),Gn=So(n,"WeakMap"),Hn=So(Gt,"create"),Kn=Gn&&new Gn,Zn={},Jn=Jo(Yn),Xn=Jo(qn),Qn=Jo($n),tr=Jo(Vn),er=Jo(Gn),nr=be?be.prototype:t,rr=nr?nr.valueOf:t,ir=nr?nr.toString:t;function or(t){if(ma(t)&&!ra(t)&&!(t instanceof fr)){if(t instanceof cr)return t;if(ne.call(t,"__wrapped__"))return Xo(t)}return new cr(t)}var ur=function(){function e(){}return function(n){if(!ha(n))return{};if(Re)return Re(n);e.prototype=n;var r=new e;return e.prototype=t,r}}();function ar(){}function cr(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=t}function fr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=I,this.__views__=[]}function sr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function lr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function pr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function hr(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new pr;++e<n;)this.add(t[e])}function mr(t){var e=this.__data__=new lr(t);this.size=e.size}function dr(t,e){var n=ra(t),r=!n&&na(t),i=!n&&!r&&aa(t),o=!n&&!r&&!i&&xa(t),u=n||r||i||o,a=u?rn(t.length,Kt):[],c=a.length;for(var f in t)!e&&!ne.call(t,f)||u&&("length"==f||i&&("offset"==f||"parent"==f)||o&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||To(f,c))||a.push(f);return a}function gr(e){var n=e.length;return n?e[si(0,n-1)]:t}function vr(e,n,r){(r===t||Qu(e[n],r))&&(r!==t||n in e)||xr(e,n,r)}function yr(e,n,r){var i=e[n];ne.call(e,n)&&Qu(i,r)&&(r!==t||n in e)||xr(e,n,r)}function _r(t,e){for(var n=t.length;n--;)if(Qu(t[n][0],e))return n;return-1}function br(t,e,n,r){return Ir(t,function(t,i,o){e(r,t,n(t),o)}),r}function wr(t,e){return t&&Yi(e,qa(e),t)}function xr(t,e,n){"__proto__"==e&&Rn?Rn(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Ar(e,n){for(var r=-1,i=n.length,o=Rt(i),u=null==e;++r<i;)o[r]=u?t:za(e,n[r]);return o}function kr(e,n,r){return e==e&&(r!==t&&(e=e<=r?e:r),n!==t&&(e=e>=n?e:n)),e}function Sr(e,n,r,i,o,u){var a,l=n&c,p=n&f,h=n&s;if(r&&(a=o?r(e,i,o,u):r(e)),a!==t)return a;if(!ha(e))return e;var m=ra(e);if(m){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&ne.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!l)return Wi(e,a)}else{var d=Eo(e),g=d==N||d==F;if(aa(e))return Bi(e,l);if(d==$||d==P||g&&!o){if(a=p||g?{}:jo(e),!l)return p?function(t,e){return Yi(t,Do(t),e)}(e,function(t,e){return t&&Yi(e,$a(e),t)}(a,e)):function(t,e){return Yi(t,Ro(t),e)}(e,wr(a,e))}else{if(!ge[d])return o?e:{};a=function(t,e,n){var r,i,o,u=t.constructor;switch(e){case Q:return Li(t);case B:case L:return new u(+t);case tt:return function(t,e){var n=e?Li(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case et:case nt:case rt:case it:case ot:case ut:case at:case ct:case ft:return Ui(t,n);case W:return new u;case Y:case K:return new u(t);case G:return(o=new(i=t).constructor(i.source,Ct.exec(i))).lastIndex=i.lastIndex,o;case H:return new u;case Z:return r=t,rr?Gt(rr.call(r)):{}}}(e,d,l)}}u||(u=new mr);var v=u.get(e);if(v)return v;u.set(e,a),_a(e)?e.forEach(function(t){a.add(Sr(t,n,r,t,e,u))}):da(e)&&e.forEach(function(t,i){a.set(i,Sr(t,n,r,i,e,u))});var y=m?t:(h?p?yo:vo:p?$a:qa)(e);return Be(y||e,function(t,i){y&&(t=e[i=t]),yr(a,i,Sr(t,n,r,i,e,u))}),a}function Rr(e,n,r){var i=r.length;if(null==e)return!i;for(e=Gt(e);i--;){var o=r[i],u=n[o],a=e[o];if(a===t&&!(o in e)||!u(a))return!1}return!0}function Dr(e,n,r){if("function"!=typeof e)throw new Zt(o);return qo(function(){e.apply(t,r)},n)}function Er(t,e,n,r){var o=-1,u=ze,a=!0,c=t.length,f=[],s=e.length;if(!c)return f;n&&(e=Fe(e,un(n))),r?(u=Ne,a=!1):e.length>=i&&(u=cn,a=!1,e=new hr(e));t:for(;++o<c;){var l=t[o],p=null==n?l:n(l);if(l=r||0!==l?l:0,a&&p==p){for(var h=s;h--;)if(e[h]===p)continue t;f.push(l)}else u(e,p,r)||f.push(l)}return f}or.templateSettings={escape:vt,evaluate:yt,interpolate:_t,variable:"",imports:{_:or}},or.prototype=ar.prototype,or.prototype.constructor=or,cr.prototype=ur(ar.prototype),cr.prototype.constructor=cr,fr.prototype=ur(ar.prototype),fr.prototype.constructor=fr,sr.prototype.clear=function(){this.__data__=Hn?Hn(null):{},this.size=0},sr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},sr.prototype.get=function(e){var n=this.__data__;if(Hn){var r=n[e];return r===u?t:r}return ne.call(n,e)?n[e]:t},sr.prototype.has=function(e){var n=this.__data__;return Hn?n[e]!==t:ne.call(n,e)},sr.prototype.set=function(e,n){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Hn&&n===t?u:n,this},lr.prototype.clear=function(){this.__data__=[],this.size=0},lr.prototype.delete=function(t){var e=this.__data__,n=_r(e,t);return!(n<0||(n==e.length-1?e.pop():Ve.call(e,n,1),--this.size,0))},lr.prototype.get=function(e){var n=this.__data__,r=_r(n,e);return r<0?t:n[r][1]},lr.prototype.has=function(t){return _r(this.__data__,t)>-1},lr.prototype.set=function(t,e){var n=this.__data__,r=_r(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},pr.prototype.clear=function(){this.size=0,this.__data__={hash:new sr,map:new(qn||lr),string:new sr}},pr.prototype.delete=function(t){var e=Ao(this,t).delete(t);return this.size-=e?1:0,e},pr.prototype.get=function(t){return Ao(this,t).get(t)},pr.prototype.has=function(t){return Ao(this,t).has(t)},pr.prototype.set=function(t,e){var n=Ao(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},hr.prototype.add=hr.prototype.push=function(t){return this.__data__.set(t,u),this},hr.prototype.has=function(t){return this.__data__.has(t)},mr.prototype.clear=function(){this.__data__=new lr,this.size=0},mr.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},mr.prototype.get=function(t){return this.__data__.get(t)},mr.prototype.has=function(t){return this.__data__.has(t)},mr.prototype.set=function(t,e){var n=this.__data__;if(n instanceof lr){var r=n.__data__;if(!qn||r.length<i-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new pr(r)}return n.set(t,e),this.size=n.size,this};var Ir=Vi(Lr),jr=Vi(Ur,!0);function Or(t,e){var n=!0;return Ir(t,function(t,r,i){return n=!!e(t,r,i)}),n}function Tr(e,n,r){for(var i=-1,o=e.length;++i<o;){var u=e[i],a=n(u);if(null!=a&&(c===t?a==a&&!wa(a):r(a,c)))var c=a,f=u}return f}function Pr(t,e){var n=[];return Ir(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function Cr(t,e,n,r,i){var o=-1,u=t.length;for(n||(n=Oo),i||(i=[]);++o<u;){var a=t[o];e>0&&n(a)?e>1?Cr(a,e-1,n,r,i):We(i,a):r||(i[i.length]=a)}return i}var Mr=Gi(),Br=Gi(!0);function Lr(t,e){return t&&Mr(t,e,qa)}function Ur(t,e){return t&&Br(t,e,qa)}function zr(t,e){return Ue(e,function(e){return sa(t[e])})}function Nr(e,n){for(var r=0,i=(n=Ti(n,e)).length;null!=e&&r<i;)e=e[Zo(n[r++])];return r&&r==i?e:t}function Fr(t,e,n){var r=e(t);return ra(t)?r:We(r,n(t))}function Wr(e){return null==e?e===t?J:q:Sn&&Sn in Gt(e)?function(e){var n=ne.call(e,Sn),r=e[Sn];try{e[Sn]=t;var i=!0}catch(u){}var o=oe.call(e);return i&&(n?e[Sn]=r:delete e[Sn]),o}(e):function(t){return oe.call(t)}(e)}function Yr(t,e){return t>e}function qr(t,e){return null!=t&&ne.call(t,e)}function $r(t,e){return null!=t&&e in Gt(t)}function Vr(e,n,r){for(var i=r?Ne:ze,o=e[0].length,u=e.length,a=u,c=Rt(u),f=1/0,s=[];a--;){var l=e[a];a&&n&&(l=Fe(l,un(n))),f=Un(l.length,f),c[a]=!r&&(n||o>=120&&l.length>=120)?new hr(a&&l):t}l=e[0];var p=-1,h=c[0];t:for(;++p<o&&s.length<f;){var m=l[p],d=n?n(m):m;if(m=r||0!==m?m:0,!(h?cn(h,d):i(s,d,r))){for(a=u;--a;){var g=c[a];if(!(g?cn(g,d):i(e[a],d,r)))continue t}h&&h.push(d),s.push(m)}}return s}function Gr(e,n,r){var i=null==(e=Fo(e,n=Ti(n,e)))?e:e[Zo(fu(n))];return null==i?t:Ce(i,e,r)}function Hr(t){return ma(t)&&Wr(t)==P}function Kr(e,n,r,i,o){return e===n||(null==e||null==n||!ma(e)&&!ma(n)?e!=e&&n!=n:function(e,n,r,i,o,u){var a=ra(e),c=ra(n),f=a?C:Eo(e),s=c?C:Eo(n),h=(f=f==P?$:f)==$,m=(s=s==P?$:s)==$,d=f==s;if(d&&aa(e)){if(!aa(n))return!1;a=!0,h=!1}if(d&&!h)return u||(u=new mr),a||xa(e)?mo(e,n,r,i,o,u):function(t,e,n,r,i,o,u){switch(n){case tt:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Q:return!(t.byteLength!=e.byteLength||!o(new we(t),new we(e)));case B:case L:case Y:return Qu(+t,+e);case z:return t.name==e.name&&t.message==e.message;case G:case K:return t==e+"";case W:var a=dn;case H:var c=r&l;if(a||(a=yn),t.size!=e.size&&!c)return!1;var f=u.get(t);if(f)return f==e;r|=p,u.set(t,e);var s=mo(a(t),a(e),r,i,o,u);return u.delete(t),s;case Z:if(rr)return rr.call(t)==rr.call(e)}return!1}(e,n,f,r,i,o,u);if(!(r&l)){var g=h&&ne.call(e,"__wrapped__"),v=m&&ne.call(n,"__wrapped__");if(g||v){var y=g?e.value():e,_=v?n.value():n;return u||(u=new mr),o(y,_,r,i,u)}}return!!d&&(u||(u=new mr),function(e,n,r,i,o,u){var a=r&l,c=vo(e),f=c.length;if(f!=vo(n).length&&!a)return!1;for(var s=f;s--;){var p=c[s];if(!(a?p in n:ne.call(n,p)))return!1}var h=u.get(e),m=u.get(n);if(h&&m)return h==n&&m==e;var d=!0;u.set(e,n),u.set(n,e);for(var g=a;++s<f;){var v=e[p=c[s]],y=n[p];if(i)var _=a?i(y,v,p,n,e,u):i(v,y,p,e,n,u);if(!(_===t?v===y||o(v,y,r,i,u):_)){d=!1;break}g||(g="constructor"==p)}if(d&&!g){var b=e.constructor,w=n.constructor;b!=w&&"constructor"in e&&"constructor"in n&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(d=!1)}return u.delete(e),u.delete(n),d}(e,n,r,i,o,u))}(e,n,r,i,Kr,o))}function Zr(e,n,r,i){var o=r.length,u=o,a=!i;if(null==e)return!u;for(e=Gt(e);o--;){var c=r[o];if(a&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++o<u;){var f=(c=r[o])[0],s=e[f],h=c[1];if(a&&c[2]){if(s===t&&!(f in e))return!1}else{var m=new mr;if(i)var d=i(s,h,f,e,n,m);if(!(d===t?Kr(h,s,l|p,i,m):d))return!1}}return!0}function Jr(t){return!(!ha(t)||(e=t,ie&&ie in e))&&(sa(t)?le:Lt).test(Jo(t));var e}function Xr(t){return"function"==typeof t?t:null==t?gc:"object"==typeof t?ra(t)?ri(t[0],t[1]):ni(t):Sc(t)}function Qr(t){if(!Lo(t))return Bn(t);var e=[];for(var n in Gt(t))ne.call(t,n)&&"constructor"!=n&&e.push(n);return e}function ti(t,e){return t<e}function ei(t,e){var n=-1,r=oa(t)?Rt(t.length):[];return Ir(t,function(t,i,o){r[++n]=e(t,i,o)}),r}function ni(t){var e=ko(t);return 1==e.length&&e[0][2]?zo(e[0][0],e[0][1]):function(n){return n===t||Zr(n,t,e)}}function ri(e,n){return Co(e)&&Uo(n)?zo(Zo(e),n):function(r){var i=za(r,e);return i===t&&i===n?Na(r,e):Kr(n,i,l|p)}}function ii(e,n,r,i,o){e!==n&&Mr(n,function(u,a){if(o||(o=new mr),ha(u))!function(e,n,r,i,o,u,a){var c=Wo(e,r),f=Wo(n,r),s=a.get(f);if(s)vr(e,r,s);else{var l=u?u(c,f,r+"",e,n,a):t,p=l===t;if(p){var h=ra(f),m=!h&&aa(f),d=!h&&!m&&xa(f);l=f,h||m||d?ra(c)?l=c:ua(c)?l=Wi(c):m?(p=!1,l=Bi(f,!0)):d?(p=!1,l=Ui(f,!0)):l=[]:va(f)||na(f)?(l=c,na(c)?l=ja(c):ha(c)&&!sa(c)||(l=jo(f))):p=!1}p&&(a.set(f,l),o(l,f,i,u,a),a.delete(f)),vr(e,r,l)}}(e,n,a,r,ii,i,o);else{var c=i?i(Wo(e,a),u,a+"",e,n,o):t;c===t&&(c=u),vr(e,a,c)}},$a)}function oi(e,n){var r=e.length;if(r)return To(n+=n<0?r:0,r)?e[n]:t}function ui(t,e,n){e=e.length?Fe(e,function(t){return ra(t)?function(e){return Nr(e,1===t.length?t[0]:t)}:t}):[gc];var r=-1;return e=Fe(e,un(xo())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(ei(t,function(t,n,i){return{criteria:Fe(e,function(e){return e(t)}),index:++r,value:t}}),function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,u=i.length,a=n.length;++r<u;){var c=zi(i[r],o[r]);if(c)return r>=a?c:c*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)})}function ai(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var u=e[r],a=Nr(t,u);n(a,u)&&hi(o,Ti(u,t),a)}return o}function ci(t,e,n,r){var i=r?Ze:Ke,o=-1,u=e.length,a=t;for(t===e&&(e=Wi(e)),n&&(a=Fe(t,un(n)));++o<u;)for(var c=0,f=e[o],s=n?n(f):f;(c=i(a,s,c,r))>-1;)a!==t&&Ve.call(a,c,1),Ve.call(t,c,1);return t}function fi(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;To(i)?Ve.call(t,i,1):ki(t,i)}}return t}function si(t,e){return t+On(Fn()*(e-t+1))}function li(t,e){var n="";if(!t||e<1||e>R)return n;do{e%2&&(n+=t),(e=On(e/2))&&(t+=t)}while(e);return n}function pi(t,e){return $o(No(t,e,gc),t+"")}function hi(e,n,r,i){if(!ha(e))return e;for(var o=-1,u=(n=Ti(n,e)).length,a=u-1,c=e;null!=c&&++o<u;){var f=Zo(n[o]),s=r;if("__proto__"===f||"constructor"===f||"prototype"===f)return e;if(o!=a){var l=c[f];(s=i?i(l,f,c):t)===t&&(s=ha(l)?l:To(n[o+1])?[]:{})}yr(c,f,s),c=c[f]}return e}var mi=Kn?function(t,e){return Kn.set(t,e),t}:gc,di=Rn?function(t,e){return Rn(t,"toString",{configurable:!0,enumerable:!1,value:hc(e),writable:!0})}:gc;function gi(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Rt(i);++r<i;)o[r]=t[r+e];return o}function vi(t,e){var n;return Ir(t,function(t,r,i){return!(n=e(t,r,i))}),!!n}function yi(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=O){for(;r<i;){var o=r+i>>>1,u=t[o];null!==u&&!wa(u)&&(n?u<=e:u<e)?r=o+1:i=o}return i}return _i(t,e,gc,n)}function _i(e,n,r,i){var o=0,u=null==e?0:e.length;if(0===u)return 0;for(var a=(n=r(n))!=n,c=null===n,f=wa(n),s=n===t;o<u;){var l=On((o+u)/2),p=r(e[l]),h=p!==t,m=null===p,d=p==p,g=wa(p);if(a)var v=i||d;else v=s?d&&(i||h):c?d&&h&&(i||!m):f?d&&h&&!m&&(i||!g):!m&&!g&&(i?p<=n:p<n);v?o=l+1:u=l}return Un(u,j)}function bi(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var u=t[n],a=e?e(u):u;if(!n||!Qu(a,c)){var c=a;o[i++]=0===u?0:u}}return o}function wi(t){return"number"==typeof t?t:wa(t)?E:+t}function xi(t){if("string"==typeof t)return t;if(ra(t))return Fe(t,xi)+"";if(wa(t))return ir?ir.call(t):"";var e=t+"";return"0"==e&&1/t==-S?"-0":e}function Ai(t,e,n){var r=-1,o=ze,u=t.length,a=!0,c=[],f=c;if(n)a=!1,o=Ne;else if(u>=i){var s=e?null:co(t);if(s)return yn(s);a=!1,o=cn,f=new hr}else f=e?[]:c;t:for(;++r<u;){var l=t[r],p=e?e(l):l;if(l=n||0!==l?l:0,a&&p==p){for(var h=f.length;h--;)if(f[h]===p)continue t;e&&f.push(p),c.push(l)}else o(f,p,n)||(f!==c&&f.push(p),c.push(l))}return c}function ki(t,e){return null==(t=Fo(t,e=Ti(e,t)))||delete t[Zo(fu(e))]}function Si(t,e,n,r){return hi(t,e,n(Nr(t,e)),r)}function Ri(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?gi(t,r?0:o,r?o+1:i):gi(t,r?o+1:0,r?i:o)}function Di(t,e){var n=t;return n instanceof fr&&(n=n.value()),Ye(e,function(t,e){return e.func.apply(e.thisArg,We([t],e.args))},n)}function Ei(t,e,n){var r=t.length;if(r<2)return r?Ai(t[0]):[];for(var i=-1,o=Rt(r);++i<r;)for(var u=t[i],a=-1;++a<r;)a!=i&&(o[i]=Er(o[i]||u,t[a],e,n));return Ai(Cr(o,1),e,n)}function Ii(e,n,r){for(var i=-1,o=e.length,u=n.length,a={};++i<o;){var c=i<u?n[i]:t;r(a,e[i],c)}return a}function ji(t){return ua(t)?t:[]}function Oi(t){return"function"==typeof t?t:gc}function Ti(t,e){return ra(t)?t:Co(t,e)?[t]:Ko(Oa(t))}var Pi=pi;function Ci(e,n,r){var i=e.length;return r=r===t?i:r,!n&&r>=i?e:gi(e,n,r)}var Mi=Dn||function(t){return xe.clearTimeout(t)};function Bi(t,e){if(e)return t.slice();var n=t.length,r=Ae?Ae(n):new t.constructor(n);return t.copy(r),r}function Li(t){var e=new t.constructor(t.byteLength);return new we(e).set(new we(t)),e}function Ui(t,e){var n=e?Li(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function zi(e,n){if(e!==n){var r=e!==t,i=null===e,o=e==e,u=wa(e),a=n!==t,c=null===n,f=n==n,s=wa(n);if(!c&&!s&&!u&&e>n||u&&a&&f&&!c&&!s||i&&a&&f||!r&&f||!o)return 1;if(!i&&!u&&!s&&e<n||s&&r&&o&&!i&&!u||c&&r&&o||!a&&o||!f)return-1}return 0}function Ni(t,e,n,r){for(var i=-1,o=t.length,u=n.length,a=-1,c=e.length,f=Ln(o-u,0),s=Rt(c+f),l=!r;++a<c;)s[a]=e[a];for(;++i<u;)(l||i<o)&&(s[n[i]]=t[i]);for(;f--;)s[a++]=t[i++];return s}function Fi(t,e,n,r){for(var i=-1,o=t.length,u=-1,a=n.length,c=-1,f=e.length,s=Ln(o-a,0),l=Rt(s+f),p=!r;++i<s;)l[i]=t[i];for(var h=i;++c<f;)l[h+c]=e[c];for(;++u<a;)(p||i<o)&&(l[h+n[u]]=t[i++]);return l}function Wi(t,e){var n=-1,r=t.length;for(e||(e=Rt(r));++n<r;)e[n]=t[n];return e}function Yi(e,n,r,i){var o=!r;r||(r={});for(var u=-1,a=n.length;++u<a;){var c=n[u],f=i?i(r[c],e[c],c,r,e):t;f===t&&(f=e[c]),o?xr(r,c,f):yr(r,c,f)}return r}function qi(t,e){return function(n,r){var i=ra(n)?Me:br,o=e?e():{};return i(n,t,xo(r,2),o)}}function $i(e){return pi(function(n,r){var i=-1,o=r.length,u=o>1?r[o-1]:t,a=o>2?r[2]:t;for(u=e.length>3&&"function"==typeof u?(o--,u):t,a&&Po(r[0],r[1],a)&&(u=o<3?t:u,o=1),n=Gt(n);++i<o;){var c=r[i];c&&e(n,c,i,u)}return n})}function Vi(t,e){return function(n,r){if(null==n)return n;if(!oa(n))return t(n,r);for(var i=n.length,o=e?i:-1,u=Gt(n);(e?o--:++o<i)&&!1!==r(u[o],o,u););return n}}function Gi(t){return function(e,n,r){for(var i=-1,o=Gt(e),u=r(e),a=u.length;a--;){var c=u[t?a:++i];if(!1===n(o[c],c,o))break}return e}}function Hi(e){return function(n){var r=mn(n=Oa(n))?bn(n):t,i=r?r[0]:n.charAt(0),o=r?Ci(r,1).join(""):n.slice(1);return i[e]()+o}}function Ki(t){return function(e){return Ye(sc(nc(e).replace(ae,"")),t,"")}}function Zi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=ur(t.prototype),r=t.apply(n,e);return ha(r)?r:n}}function Ji(e){return function(n,r,i){var o=Gt(n);if(!oa(n)){var u=xo(r,3);n=qa(n),r=function(t){return u(o[t],t,o)}}var a=e(n,r,i);return a>-1?o[u?n[a]:a]:t}}function Xi(e){return go(function(n){var r=n.length,i=r,u=cr.prototype.thru;for(e&&n.reverse();i--;){var a=n[i];if("function"!=typeof a)throw new Zt(o);if(u&&!c&&"wrapper"==bo(a))var c=new cr([],!0)}for(i=c?i:r;++i<r;){var f=bo(a=n[i]),s="wrapper"==f?_o(a):t;c=s&&Mo(s[0])&&s[1]==(b|g|y|w)&&!s[4].length&&1==s[9]?c[bo(s[0])].apply(c,s[3]):1==a.length&&Mo(a)?c[f]():c.thru(a)}return function(){var t=arguments,e=t[0];if(c&&1==t.length&&ra(e))return c.plant(e).value();for(var i=0,o=r?n[i].apply(this,t):e;++i<r;)o=n[i].call(this,o);return o}})}function Qi(e,n,r,i,o,u,a,c,f,s){var l=n&b,p=n&h,d=n&m,y=n&(g|v),_=n&x,w=d?t:Zi(e);return function h(){for(var m=arguments.length,g=Rt(m),v=m;v--;)g[v]=arguments[v];if(y)var b=wo(h),x=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(g,b);if(i&&(g=Ni(g,i,o,y)),u&&(g=Fi(g,u,a,y)),m-=x,y&&m<s){var A=vn(g,b);return uo(e,n,Qi,h.placeholder,r,g,A,c,f,s-m)}var k=p?r:this,S=d?k[e]:e;return m=g.length,c?g=function(e,n){for(var r=e.length,i=Un(n.length,r),o=Wi(e);i--;){var u=n[i];e[i]=To(u,r)?o[u]:t}return e}(g,c):_&&m>1&&g.reverse(),l&&f<m&&(g.length=f),this&&this!==xe&&this instanceof h&&(S=w||Zi(S)),S.apply(k,g)}}function to(t,e){return function(n,r){return function(t,e,n,r){return Lr(t,function(t,i,o){e(r,n(t),i,o)}),r}(n,t,e(r),{})}}function eo(e,n){return function(r,i){var o;if(r===t&&i===t)return n;if(r!==t&&(o=r),i!==t){if(o===t)return i;"string"==typeof r||"string"==typeof i?(r=xi(r),i=xi(i)):(r=wi(r),i=wi(i)),o=e(r,i)}return o}}function no(t){return go(function(e){return e=Fe(e,un(xo())),pi(function(n){var r=this;return t(e,function(t){return Ce(t,r,n)})})})}function ro(e,n){var r=(n=n===t?" ":xi(n)).length;if(r<2)return r?li(n,e):n;var i=li(n,jn(e/_n(n)));return mn(n)?Ci(bn(i),0,e).join(""):i.slice(0,e)}function io(e){return function(n,r,i){return i&&"number"!=typeof i&&Po(n,r,i)&&(r=i=t),n=Ra(n),r===t?(r=n,n=0):r=Ra(r),function(t,e,n,r){for(var i=-1,o=Ln(jn((e-t)/(n||1)),0),u=Rt(o);o--;)u[r?o:++i]=t,t+=n;return u}(n,r,i=i===t?n<r?1:-1:Ra(i),e)}}function oo(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=Ia(e),n=Ia(n)),t(e,n)}}function uo(e,n,r,i,o,u,a,c,f,s){var l=n&g;n|=l?y:_,(n&=~(l?_:y))&d||(n&=~(h|m));var p=[e,n,o,l?u:t,l?a:t,l?t:u,l?t:a,c,f,s],v=r.apply(t,p);return Mo(e)&&Yo(v,p),v.placeholder=i,Vo(v,e,n)}function ao(t){var e=Vt[t];return function(t,n){if(t=Ia(t),(n=null==n?0:Un(Da(n),292))&&Cn(t)){var r=(Oa(t)+"e").split("e");return+((r=(Oa(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var co=Vn&&1/yn(new Vn([,-0]))[1]==S?function(t){return new Vn(t)}:wc;function fo(t){return function(e){var n=Eo(e);return n==W?dn(e):n==H?function(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=[t,t]}),n}(e):function(t,e){return Fe(e,function(e){return[e,t[e]]})}(e,t(e))}}function so(e,n,r,i,u,c,f,s){var l=n&m;if(!l&&"function"!=typeof e)throw new Zt(o);var p=i?i.length:0;if(p||(n&=~(y|_),i=u=t),f=f===t?f:Ln(Da(f),0),s=s===t?s:Da(s),p-=u?u.length:0,n&_){var x=i,A=u;i=u=t}var k=l?t:_o(e),S=[e,n,r,i,u,x,A,c,f,s];if(k&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<(h|m|b),u=r==b&&n==g||r==b&&n==w&&t[7].length<=e[8]||r==(b|w)&&e[7].length<=e[8]&&n==g;if(!o&&!u)return t;r&h&&(t[2]=e[2],i|=n&h?0:d);var c=e[3];if(c){var f=t[3];t[3]=f?Ni(f,c,e[4]):c,t[4]=f?vn(t[3],a):e[4]}(c=e[5])&&(f=t[5],t[5]=f?Fi(f,c,e[6]):c,t[6]=f?vn(t[5],a):e[6]),(c=e[7])&&(t[7]=c),r&b&&(t[8]=null==t[8]?e[8]:Un(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(S,k),e=S[0],n=S[1],r=S[2],i=S[3],u=S[4],!(s=S[9]=S[9]===t?l?0:e.length:Ln(S[9]-p,0))&&n&(g|v)&&(n&=~(g|v)),n&&n!=h)R=n==g||n==v?function(e,n,r){var i=Zi(e);return function o(){for(var u=arguments.length,a=Rt(u),c=u,f=wo(o);c--;)a[c]=arguments[c];var s=u<3&&a[0]!==f&&a[u-1]!==f?[]:vn(a,f);return(u-=s.length)<r?uo(e,n,Qi,o.placeholder,t,a,s,t,t,r-u):Ce(this&&this!==xe&&this instanceof o?i:e,this,a)}}(e,n,s):n!=y&&n!=(h|y)||u.length?Qi.apply(t,S):function(t,e,n,r){var i=e&h,o=Zi(t);return function e(){for(var u=-1,a=arguments.length,c=-1,f=r.length,s=Rt(f+a),l=this&&this!==xe&&this instanceof e?o:t;++c<f;)s[c]=r[c];for(;a--;)s[c++]=arguments[++u];return Ce(l,i?n:this,s)}}(e,n,r,i);else var R=function(t,e,n){var r=e&h,i=Zi(t);return function e(){return(this&&this!==xe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(e,n,r);return Vo((k?mi:Yo)(R,S),e,n)}function lo(e,n,r,i){return e===t||Qu(e,Qt[r])&&!ne.call(i,r)?n:e}function po(e,n,r,i,o,u){return ha(e)&&ha(n)&&(u.set(n,e),ii(e,n,t,po,u),u.delete(n)),e}function ho(e){return va(e)?t:e}function mo(e,n,r,i,o,u){var a=r&l,c=e.length,f=n.length;if(c!=f&&!(a&&f>c))return!1;var s=u.get(e),h=u.get(n);if(s&&h)return s==n&&h==e;var m=-1,d=!0,g=r&p?new hr:t;for(u.set(e,n),u.set(n,e);++m<c;){var v=e[m],y=n[m];if(i)var _=a?i(y,v,m,n,e,u):i(v,y,m,e,n,u);if(_!==t){if(_)continue;d=!1;break}if(g){if(!$e(n,function(t,e){if(!cn(g,e)&&(v===t||o(v,t,r,i,u)))return g.push(e)})){d=!1;break}}else if(v!==y&&!o(v,y,r,i,u)){d=!1;break}}return u.delete(e),u.delete(n),d}function go(e){return $o(No(e,t,iu),e+"")}function vo(t){return Fr(t,qa,Ro)}function yo(t){return Fr(t,$a,Do)}var _o=Kn?function(t){return Kn.get(t)}:wc;function bo(t){for(var e=t.name+"",n=Zn[e],r=ne.call(Zn,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function wo(t){return(ne.call(or,"placeholder")?or:t).placeholder}function xo(){var t=or.iteratee||vc;return t=t===vc?Xr:t,arguments.length?t(arguments[0],arguments[1]):t}function Ao(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function ko(t){for(var e=qa(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Uo(i)]}return e}function So(e,n){var r=function(e,n){return null==e?t:e[n]}(e,n);return Jr(r)?r:t}var Ro=Tn?function(t){return null==t?[]:(t=Gt(t),Ue(Tn(t),function(e){return De.call(t,e)}))}:Ec,Do=Tn?function(t){for(var e=[];t;)We(e,Ro(t)),t=ke(t);return e}:Ec,Eo=Wr;function Io(t,e,n){for(var r=-1,i=(e=Ti(e,t)).length,o=!1;++r<i;){var u=Zo(e[r]);if(!(o=null!=t&&n(t,u)))break;t=t[u]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&pa(i)&&To(u,i)&&(ra(t)||na(t))}function jo(t){return"function"!=typeof t.constructor||Lo(t)?{}:ur(ke(t))}function Oo(t){return ra(t)||na(t)||!!(tn&&t&&t[tn])}function To(t,e){var n=typeof t;return!!(e=null==e?R:e)&&("number"==n||"symbol"!=n&&zt.test(t))&&t>-1&&t%1==0&&t<e}function Po(t,e,n){if(!ha(n))return!1;var r=typeof e;return!!("number"==r?oa(n)&&To(e,n.length):"string"==r&&e in n)&&Qu(n[e],t)}function Co(t,e){if(ra(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!wa(t))||wt.test(t)||!bt.test(t)||null!=e&&t in Gt(e)}function Mo(t){var e=bo(t),n=or[e];if("function"!=typeof n||!(e in fr.prototype))return!1;if(t===n)return!0;var r=_o(n);return!!r&&t===r[0]}(Yn&&Eo(new Yn(new ArrayBuffer(1)))!=tt||qn&&Eo(new qn)!=W||$n&&"[object Promise]"!=Eo($n.resolve())||Vn&&Eo(new Vn)!=H||Gn&&Eo(new Gn)!=X)&&(Eo=function(e){var n=Wr(e),r=n==$?e.constructor:t,i=r?Jo(r):"";if(i)switch(i){case Jn:return tt;case Xn:return W;case Qn:return"[object Promise]";case tr:return H;case er:return X}return n});var Bo=te?sa:Ic;function Lo(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Qt)}function Uo(t){return t==t&&!ha(t)}function zo(e,n){return function(r){return null!=r&&r[e]===n&&(n!==t||e in Gt(r))}}function No(e,n,r){return n=Ln(n===t?e.length-1:n,0),function(){for(var t=arguments,i=-1,o=Ln(t.length-n,0),u=Rt(o);++i<o;)u[i]=t[n+i];i=-1;for(var a=Rt(n+1);++i<n;)a[i]=t[i];return a[n]=r(u),Ce(e,this,a)}}function Fo(t,e){return e.length<2?t:Nr(t,gi(e,0,-1))}function Wo(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Yo=Go(mi),qo=In||function(t,e){return xe.setTimeout(t,e)},$o=Go(di);function Vo(t,e,n){var r=e+"";return $o(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Dt,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Be(T,function(n){var r="_."+n[0];e&n[1]&&!ze(t,r)&&t.push(r)}),t.sort()}(function(t){var e=r.match(Et);return e?e[1].split(It):[]}(),n)))}function Go(e){var n=0,r=0;return function(){var i=zn(),o=k-(i-r);if(r=i,o>0){if(++n>=A)return arguments[0]}else n=0;return e.apply(t,arguments)}}function Ho(e,n){var r=-1,i=e.length,o=i-1;for(n=n===t?i:n;++r<n;){var u=si(r,o),a=e[u];e[u]=e[r],e[r]=a}return e.length=n,e}var Ko=function(t){var e=Gu(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(xt,function(t,n,r,i){e.push(r?i.replace(Tt,"$1"):n||t)}),e},function(t){return 500===n.size&&n.clear(),t}),n=e.cache;return e}();function Zo(t){if("string"==typeof t||wa(t))return t;var e=t+"";return"0"==e&&1/t==-S?"-0":e}function Jo(t){if(null!=t){try{return ee.call(t)}catch(n){}try{return t+""}catch(n){}}return""}function Xo(t){if(t instanceof fr)return t.clone();var e=new cr(t.__wrapped__,t.__chain__);return e.__actions__=Wi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Qo=pi(function(t,e){return ua(t)?Er(t,Cr(e,1,ua,!0)):[]}),tu=pi(function(e,n){var r=fu(n);return ua(r)&&(r=t),ua(e)?Er(e,Cr(n,1,ua,!0),xo(r,2)):[]}),eu=pi(function(e,n){var r=fu(n);return ua(r)&&(r=t),ua(e)?Er(e,Cr(n,1,ua,!0),t,r):[]});function nu(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Da(n);return i<0&&(i=Ln(r+i,0)),He(t,xo(e,3),i)}function ru(e,n,r){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return r!==t&&(o=Da(r),o=r<0?Ln(i+o,0):Un(o,i-1)),He(e,xo(n,3),o,!0)}function iu(t){return null!=t&&t.length?Cr(t,1):[]}function ou(e){return e&&e.length?e[0]:t}var uu=pi(function(t){var e=Fe(t,ji);return e.length&&e[0]===t[0]?Vr(e):[]}),au=pi(function(e){var n=fu(e),r=Fe(e,ji);return n===fu(r)?n=t:r.pop(),r.length&&r[0]===e[0]?Vr(r,xo(n,2)):[]}),cu=pi(function(e){var n=fu(e),r=Fe(e,ji);return(n="function"==typeof n?n:t)&&r.pop(),r.length&&r[0]===e[0]?Vr(r,t,n):[]});function fu(e){var n=null==e?0:e.length;return n?e[n-1]:t}var su=pi(lu);function lu(t,e){return t&&t.length&&e&&e.length?ci(t,e):t}var pu=go(function(t,e){var n=null==t?0:t.length,r=Ar(t,e);return fi(t,Fe(e,function(t){return To(t,n)?+t:t}).sort(zi)),r});function hu(t){return null==t?t:Wn.call(t)}var mu=pi(function(t){return Ai(Cr(t,1,ua,!0))}),du=pi(function(e){var n=fu(e);return ua(n)&&(n=t),Ai(Cr(e,1,ua,!0),xo(n,2))}),gu=pi(function(e){var n=fu(e);return n="function"==typeof n?n:t,Ai(Cr(e,1,ua,!0),t,n)});function vu(t){if(!t||!t.length)return[];var e=0;return t=Ue(t,function(t){if(ua(t))return e=Ln(t.length,e),!0}),rn(e,function(e){return Fe(t,Qe(e))})}function yu(e,n){if(!e||!e.length)return[];var r=vu(e);return null==n?r:Fe(r,function(e){return Ce(n,t,e)})}var _u=pi(function(t,e){return ua(t)?Er(t,e):[]}),bu=pi(function(t){return Ei(Ue(t,ua))}),wu=pi(function(e){var n=fu(e);return ua(n)&&(n=t),Ei(Ue(e,ua),xo(n,2))}),xu=pi(function(e){var n=fu(e);return n="function"==typeof n?n:t,Ei(Ue(e,ua),t,n)}),Au=pi(vu),ku=pi(function(e){var n=e.length,r=n>1?e[n-1]:t;return r="function"==typeof r?(e.pop(),r):t,yu(e,r)});function Su(t){var e=or(t);return e.__chain__=!0,e}function Ru(t,e){return e(t)}var Du=go(function(e){var n=e.length,r=n?e[0]:0,i=this.__wrapped__,o=function(t){return Ar(t,e)};return!(n>1||this.__actions__.length)&&i instanceof fr&&To(r)?((i=i.slice(r,+r+(n?1:0))).__actions__.push({func:Ru,args:[o],thisArg:t}),new cr(i,this.__chain__).thru(function(e){return n&&!e.length&&e.push(t),e})):this.thru(o)}),Eu=qi(function(t,e,n){ne.call(t,n)?++t[n]:xr(t,n,1)}),Iu=Ji(nu),ju=Ji(ru);function Ou(t,e){return(ra(t)?Be:Ir)(t,xo(e,3))}function Tu(t,e){return(ra(t)?function(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}:jr)(t,xo(e,3))}var Pu=qi(function(t,e,n){ne.call(t,n)?t[n].push(e):xr(t,n,[e])}),Cu=pi(function(t,e,n){var r=-1,i="function"==typeof e,o=oa(t)?Rt(t.length):[];return Ir(t,function(t){o[++r]=i?Ce(e,t,n):Gr(t,e,n)}),o}),Mu=qi(function(t,e,n){xr(t,n,e)});function Bu(t,e){return(ra(t)?Fe:ei)(t,xo(e,3))}var Lu=qi(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),Uu=pi(function(t,e){if(null==t)return[];var n=e.length;return n>1&&Po(t,e[0],e[1])?e=[]:n>2&&Po(e[0],e[1],e[2])&&(e=[e[0]]),ui(t,Cr(e,1),[])}),zu=En||function(){return xe.Date.now()};function Nu(e,n,r){return n=r?t:n,n=e&&null==n?e.length:n,so(e,b,t,t,t,t,n)}function Fu(e,n){var r;if("function"!=typeof n)throw new Zt(o);return e=Da(e),function(){return--e>0&&(r=n.apply(this,arguments)),e<=1&&(n=t),r}}var Wu=pi(function(t,e,n){var r=h;if(n.length){var i=vn(n,wo(Wu));r|=y}return so(t,r,e,n,i)}),Yu=pi(function(t,e,n){var r=h|m;if(n.length){var i=vn(n,wo(Yu));r|=y}return so(e,r,t,n,i)});function qu(e,n,r){var i,u,a,c,f,s,l=0,p=!1,h=!1,m=!0;if("function"!=typeof e)throw new Zt(o);function d(n){var r=i,o=u;return i=u=t,l=n,c=e.apply(o,r)}function g(e){var r=e-s;return s===t||r>=n||r<0||h&&e-l>=a}function v(){var t=zu();if(g(t))return y(t);f=qo(v,function(t){var e=n-(t-s);return h?Un(e,a-(t-l)):e}(t))}function y(e){return f=t,m&&i?d(e):(i=u=t,c)}function _(){var e=zu(),r=g(e);if(i=arguments,u=this,s=e,r){if(f===t)return function(t){return l=t,f=qo(v,n),p?d(t):c}(s);if(h)return Mi(f),f=qo(v,n),d(s)}return f===t&&(f=qo(v,n)),c}return n=Ia(n)||0,ha(r)&&(p=!!r.leading,a=(h="maxWait"in r)?Ln(Ia(r.maxWait)||0,n):a,m="trailing"in r?!!r.trailing:m),_.cancel=function(){f!==t&&Mi(f),l=0,i=s=u=f=t},_.flush=function(){return f===t?c:y(zu())},_}var $u=pi(function(t,e){return Dr(t,1,e)}),Vu=pi(function(t,e,n){return Dr(t,Ia(e)||0,n)});function Gu(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Zt(o);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var u=t.apply(this,r);return n.cache=o.set(i,u)||o,u};return n.cache=new(Gu.Cache||pr),n}function Hu(t){if("function"!=typeof t)throw new Zt(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Gu.Cache=pr;var Ku=Pi(function(t,e){var n=(e=1==e.length&&ra(e[0])?Fe(e[0],un(xo())):Fe(Cr(e,1),un(xo()))).length;return pi(function(r){for(var i=-1,o=Un(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return Ce(t,this,r)})}),Zu=pi(function(e,n){var r=vn(n,wo(Zu));return so(e,y,t,n,r)}),Ju=pi(function(e,n){var r=vn(n,wo(Ju));return so(e,_,t,n,r)}),Xu=go(function(e,n){return so(e,w,t,t,t,n)});function Qu(t,e){return t===e||t!=t&&e!=e}var ta=oo(Yr),ea=oo(function(t,e){return t>=e}),na=Hr(function(){return arguments}())?Hr:function(t){return ma(t)&&ne.call(t,"callee")&&!De.call(t,"callee")},ra=Rt.isArray,ia=Ee?un(Ee):function(t){return ma(t)&&Wr(t)==Q};function oa(t){return null!=t&&pa(t.length)&&!sa(t)}function ua(t){return ma(t)&&oa(t)}var aa=Pn||Ic,ca=Ie?un(Ie):function(t){return ma(t)&&Wr(t)==L};function fa(t){if(!ma(t))return!1;var e=Wr(t);return e==z||e==U||"string"==typeof t.message&&"string"==typeof t.name&&!va(t)}function sa(t){if(!ha(t))return!1;var e=Wr(t);return e==N||e==F||e==M||e==V}function la(t){return"number"==typeof t&&t==Da(t)}function pa(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=R}function ha(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ma(t){return null!=t&&"object"==typeof t}var da=je?un(je):function(t){return ma(t)&&Eo(t)==W};function ga(t){return"number"==typeof t||ma(t)&&Wr(t)==Y}function va(t){if(!ma(t)||Wr(t)!=$)return!1;var e=ke(t);if(null===e)return!0;var n=ne.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&ee.call(n)==ue}var ya=Oe?un(Oe):function(t){return ma(t)&&Wr(t)==G},_a=Te?un(Te):function(t){return ma(t)&&Eo(t)==H};function ba(t){return"string"==typeof t||!ra(t)&&ma(t)&&Wr(t)==K}function wa(t){return"symbol"==typeof t||ma(t)&&Wr(t)==Z}var xa=Pe?un(Pe):function(t){return ma(t)&&pa(t.length)&&!!de[Wr(t)]},Aa=oo(ti),ka=oo(function(t,e){return t<=e});function Sa(t){if(!t)return[];if(oa(t))return ba(t)?bn(t):Wi(t);if(kn&&t[kn])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[kn]());var e=Eo(t);return(e==W?dn:e==H?yn:Qa)(t)}function Ra(t){return t?(t=Ia(t))===S||t===-S?(t<0?-1:1)*D:t==t?t:0:0===t?t:0}function Da(t){var e=Ra(t),n=e%1;return e==e?n?e-n:e:0}function Ea(t){return t?kr(Da(t),0,I):0}function Ia(t){if("number"==typeof t)return t;if(wa(t))return E;if(ha(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ha(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=on(t);var n=Bt.test(t);return n||Ut.test(t)?_e(t.slice(2),n?2:8):Mt.test(t)?E:+t}function ja(t){return Yi(t,$a(t))}function Oa(t){return null==t?"":xi(t)}var Ta=$i(function(t,e){if(Lo(e)||oa(e))Yi(e,qa(e),t);else for(var n in e)ne.call(e,n)&&yr(t,n,e[n])}),Pa=$i(function(t,e){Yi(e,$a(e),t)}),Ca=$i(function(t,e,n,r){Yi(e,$a(e),t,r)}),Ma=$i(function(t,e,n,r){Yi(e,qa(e),t,r)}),Ba=go(Ar),La=pi(function(e,n){e=Gt(e);var r=-1,i=n.length,o=i>2?n[2]:t;for(o&&Po(n[0],n[1],o)&&(i=1);++r<i;)for(var u=n[r],a=$a(u),c=-1,f=a.length;++c<f;){var s=a[c],l=e[s];(l===t||Qu(l,Qt[s])&&!ne.call(e,s))&&(e[s]=u[s])}return e}),Ua=pi(function(e){return e.push(t,po),Ce(Ga,t,e)});function za(e,n,r){var i=null==e?t:Nr(e,n);return i===t?r:i}function Na(t,e){return null!=t&&Io(t,e,$r)}var Fa=to(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=oe.call(e)),t[e]=n},hc(gc)),Wa=to(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=oe.call(e)),ne.call(t,e)?t[e].push(n):t[e]=[n]},xo),Ya=pi(Gr);function qa(t){return oa(t)?dr(t):Qr(t)}function $a(t){return oa(t)?dr(t,!0):function(t){if(!ha(t))return function(t){var e=[];if(null!=t)for(var n in Gt(t))e.push(n);return e}(t);var e=Lo(t),n=[];for(var r in t)("constructor"!=r||!e&&ne.call(t,r))&&n.push(r);return n}(t)}var Va=$i(function(t,e,n){ii(t,e,n)}),Ga=$i(function(t,e,n,r){ii(t,e,n,r)}),Ha=go(function(t,e){var n={};if(null==t)return n;var r=!1;e=Fe(e,function(e){return e=Ti(e,t),r||(r=e.length>1),e}),Yi(t,yo(t),n),r&&(n=Sr(n,c|f|s,ho));for(var i=e.length;i--;)ki(n,e[i]);return n}),Ka=go(function(t,e){return null==t?{}:function(t,e){return ai(t,e,function(e,n){return Na(t,n)})}(t,e)});function Za(t,e){if(null==t)return{};var n=Fe(yo(t),function(t){return[t]});return e=xo(e),ai(t,n,function(t,n){return e(t,n[0])})}var Ja=fo(qa),Xa=fo($a);function Qa(t){return null==t?[]:an(t,qa(t))}var tc=Ki(function(t,e,n){return e=e.toLowerCase(),t+(n?ec(e):e)});function ec(t){return fc(Oa(t).toLowerCase())}function nc(t){return(t=Oa(t))&&t.replace(Nt,ln).replace(ce,"")}var rc=Ki(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),ic=Ki(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),oc=Hi("toLowerCase"),uc=Ki(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),ac=Ki(function(t,e,n){return t+(n?" ":"")+fc(e)}),cc=Ki(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),fc=Hi("toUpperCase");function sc(e,n,r){return e=Oa(e),(n=r?t:n)===t?function(t){return pe.test(t)}(e)?function(t){return t.match(se)||[]}(e):function(t){return t.match(jt)||[]}(e):e.match(n)||[]}var lc=pi(function(e,n){try{return Ce(e,t,n)}catch(i){return fa(i)?i:new qt(i)}}),pc=go(function(t,e){return Be(e,function(e){e=Zo(e),xr(t,e,Wu(t[e],t))}),t});function hc(t){return function(){return t}}var mc=Xi(),dc=Xi(!0);function gc(t){return t}function vc(t){return Xr("function"==typeof t?t:Sr(t,c))}var yc=pi(function(t,e){return function(n){return Gr(n,t,e)}}),_c=pi(function(t,e){return function(n){return Gr(t,n,e)}});function bc(t,e,n){var r=qa(e),i=zr(e,r);null!=n||ha(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=zr(e,qa(e)));var o=!(ha(n)&&"chain"in n&&!n.chain),u=sa(t);return Be(i,function(n){var r=e[n];t[n]=r,u&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=Wi(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,We([this.value()],arguments))})}),t}function wc(){}var xc=no(Fe),Ac=no(Le),kc=no($e);function Sc(t){return Co(t)?Qe(Zo(t)):function(t){return function(e){return Nr(e,t)}}(t)}var Rc=io(),Dc=io(!0);function Ec(){return[]}function Ic(){return!1}var jc,Oc=eo(function(t,e){return t+e},0),Tc=ao("ceil"),Pc=eo(function(t,e){return t/e},1),Cc=ao("floor"),Mc=eo(function(t,e){return t*e},1),Bc=ao("round"),Lc=eo(function(t,e){return t-e},0);return or.after=function(t,e){if("function"!=typeof e)throw new Zt(o);return t=Da(t),function(){if(--t<1)return e.apply(this,arguments)}},or.ary=Nu,or.assign=Ta,or.assignIn=Pa,or.assignInWith=Ca,or.assignWith=Ma,or.at=Ba,or.before=Fu,or.bind=Wu,or.bindAll=pc,or.bindKey=Yu,or.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return ra(t)?t:[t]},or.chain=Su,or.chunk=function(e,n,r){n=(r?Po(e,n,r):n===t)?1:Ln(Da(n),0);var i=null==e?0:e.length;if(!i||n<1)return[];for(var o=0,u=0,a=Rt(jn(i/n));o<i;)a[u++]=gi(e,o,o+=n);return a},or.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},or.concat=function(){var t=arguments.length;if(!t)return[];for(var e=Rt(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return We(ra(n)?Wi(n):[n],Cr(e,1))},or.cond=function(t){var e=null==t?0:t.length,n=xo();return t=e?Fe(t,function(t){if("function"!=typeof t[1])throw new Zt(o);return[n(t[0]),t[1]]}):[],pi(function(n){for(var r=-1;++r<e;){var i=t[r];if(Ce(i[0],this,n))return Ce(i[1],this,n)}})},or.conforms=function(t){return function(t){var e=qa(t);return function(n){return Rr(n,t,e)}}(Sr(t,c))},or.constant=hc,or.countBy=Eu,or.create=function(t,e){var n=ur(t);return null==e?n:wr(n,e)},or.curry=function e(n,r,i){var o=so(n,g,t,t,t,t,t,r=i?t:r);return o.placeholder=e.placeholder,o},or.curryRight=function e(n,r,i){var o=so(n,v,t,t,t,t,t,r=i?t:r);return o.placeholder=e.placeholder,o},or.debounce=qu,or.defaults=La,or.defaultsDeep=Ua,or.defer=$u,or.delay=Vu,or.difference=Qo,or.differenceBy=tu,or.differenceWith=eu,or.drop=function(e,n,r){var i=null==e?0:e.length;return i?gi(e,(n=r||n===t?1:Da(n))<0?0:n,i):[]},or.dropRight=function(e,n,r){var i=null==e?0:e.length;return i?gi(e,0,(n=i-(n=r||n===t?1:Da(n)))<0?0:n):[]},or.dropRightWhile=function(t,e){return t&&t.length?Ri(t,xo(e,3),!0,!0):[]},or.dropWhile=function(t,e){return t&&t.length?Ri(t,xo(e,3),!0):[]},or.fill=function(e,n,r,i){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&Po(e,n,r)&&(r=0,i=o),function(e,n,r,i){var o=e.length;for((r=Da(r))<0&&(r=-r>o?0:o+r),(i=i===t||i>o?o:Da(i))<0&&(i+=o),i=r>i?0:Ea(i);r<i;)e[r++]=n;return e}(e,n,r,i)):[]},or.filter=function(t,e){return(ra(t)?Ue:Pr)(t,xo(e,3))},or.flatMap=function(t,e){return Cr(Bu(t,e),1)},or.flatMapDeep=function(t,e){return Cr(Bu(t,e),S)},or.flatMapDepth=function(e,n,r){return r=r===t?1:Da(r),Cr(Bu(e,n),r)},or.flatten=iu,or.flattenDeep=function(t){return null!=t&&t.length?Cr(t,S):[]},or.flattenDepth=function(e,n){return null!=e&&e.length?Cr(e,n=n===t?1:Da(n)):[]},or.flip=function(t){return so(t,x)},or.flow=mc,or.flowRight=dc,or.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},or.functions=function(t){return null==t?[]:zr(t,qa(t))},or.functionsIn=function(t){return null==t?[]:zr(t,$a(t))},or.groupBy=Pu,or.initial=function(t){return null!=t&&t.length?gi(t,0,-1):[]},or.intersection=uu,or.intersectionBy=au,or.intersectionWith=cu,or.invert=Fa,or.invertBy=Wa,or.invokeMap=Cu,or.iteratee=vc,or.keyBy=Mu,or.keys=qa,or.keysIn=$a,or.map=Bu,or.mapKeys=function(t,e){var n={};return e=xo(e,3),Lr(t,function(t,r,i){xr(n,e(t,r,i),t)}),n},or.mapValues=function(t,e){var n={};return e=xo(e,3),Lr(t,function(t,r,i){xr(n,r,e(t,r,i))}),n},or.matches=function(t){return ni(Sr(t,c))},or.matchesProperty=function(t,e){return ri(t,Sr(e,c))},or.memoize=Gu,or.merge=Va,or.mergeWith=Ga,or.method=yc,or.methodOf=_c,or.mixin=bc,or.negate=Hu,or.nthArg=function(t){return t=Da(t),pi(function(e){return oi(e,t)})},or.omit=Ha,or.omitBy=function(t,e){return Za(t,Hu(xo(e)))},or.once=function(t){return Fu(2,t)},or.orderBy=function(e,n,r,i){return null==e?[]:(ra(n)||(n=null==n?[]:[n]),ra(r=i?t:r)||(r=null==r?[]:[r]),ui(e,n,r))},or.over=xc,or.overArgs=Ku,or.overEvery=Ac,or.overSome=kc,or.partial=Zu,or.partialRight=Ju,or.partition=Lu,or.pick=Ka,or.pickBy=Za,or.property=Sc,or.propertyOf=function(e){return function(n){return null==e?t:Nr(e,n)}},or.pull=su,or.pullAll=lu,or.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?ci(t,e,xo(n,2)):t},or.pullAllWith=function(e,n,r){return e&&e.length&&n&&n.length?ci(e,n,t,r):e},or.pullAt=pu,or.range=Rc,or.rangeRight=Dc,or.rearg=Xu,or.reject=function(t,e){return(ra(t)?Ue:Pr)(t,Hu(xo(e,3)))},or.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=xo(e,3);++r<o;){var u=t[r];e(u,r,t)&&(n.push(u),i.push(r))}return fi(t,i),n},or.rest=function(e,n){if("function"!=typeof e)throw new Zt(o);return pi(e,n=n===t?n:Da(n))},or.reverse=hu,or.sampleSize=function(e,n,r){return n=(r?Po(e,n,r):n===t)?1:Da(n),(ra(e)?function(t,e){return Ho(Wi(t),kr(e,0,t.length))}:function(t,e){var n=Qa(t);return Ho(n,kr(e,0,n.length))})(e,n)},or.set=function(t,e,n){return null==t?t:hi(t,e,n)},or.setWith=function(e,n,r,i){return i="function"==typeof i?i:t,null==e?e:hi(e,n,r,i)},or.shuffle=function(t){return(ra(t)?function(t){return Ho(Wi(t))}:function(t){return Ho(Qa(t))})(t)},or.slice=function(e,n,r){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&Po(e,n,r)?(n=0,r=i):(n=null==n?0:Da(n),r=r===t?i:Da(r)),gi(e,n,r)):[]},or.sortBy=Uu,or.sortedUniq=function(t){return t&&t.length?bi(t):[]},or.sortedUniqBy=function(t,e){return t&&t.length?bi(t,xo(e,2)):[]},or.split=function(e,n,r){return r&&"number"!=typeof r&&Po(e,n,r)&&(n=r=t),(r=r===t?I:r>>>0)?(e=Oa(e))&&("string"==typeof n||null!=n&&!ya(n))&&!(n=xi(n))&&mn(e)?Ci(bn(e),0,r):e.split(n,r):[]},or.spread=function(t,e){if("function"!=typeof t)throw new Zt(o);return e=null==e?0:Ln(Da(e),0),pi(function(n){var r=n[e],i=Ci(n,0,e);return r&&We(i,r),Ce(t,this,i)})},or.tail=function(t){var e=null==t?0:t.length;return e?gi(t,1,e):[]},or.take=function(e,n,r){return e&&e.length?gi(e,0,(n=r||n===t?1:Da(n))<0?0:n):[]},or.takeRight=function(e,n,r){var i=null==e?0:e.length;return i?gi(e,(n=i-(n=r||n===t?1:Da(n)))<0?0:n,i):[]},or.takeRightWhile=function(t,e){return t&&t.length?Ri(t,xo(e,3),!1,!0):[]},or.takeWhile=function(t,e){return t&&t.length?Ri(t,xo(e,3)):[]},or.tap=function(t,e){return e(t),t},or.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new Zt(o);return ha(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),qu(t,e,{leading:r,maxWait:e,trailing:i})},or.thru=Ru,or.toArray=Sa,or.toPairs=Ja,or.toPairsIn=Xa,or.toPath=function(t){return ra(t)?Fe(t,Zo):wa(t)?[t]:Wi(Ko(Oa(t)))},or.toPlainObject=ja,or.transform=function(t,e,n){var r=ra(t),i=r||aa(t)||xa(t);if(e=xo(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:ha(t)&&sa(o)?ur(ke(t)):{}}return(i?Be:Lr)(t,function(t,r,i){return e(n,t,r,i)}),n},or.unary=function(t){return Nu(t,1)},or.union=mu,or.unionBy=du,or.unionWith=gu,or.uniq=function(t){return t&&t.length?Ai(t):[]},or.uniqBy=function(t,e){return t&&t.length?Ai(t,xo(e,2)):[]},or.uniqWith=function(e,n){return n="function"==typeof n?n:t,e&&e.length?Ai(e,t,n):[]},or.unset=function(t,e){return null==t||ki(t,e)},or.unzip=vu,or.unzipWith=yu,or.update=function(t,e,n){return null==t?t:Si(t,e,Oi(n))},or.updateWith=function(e,n,r,i){return i="function"==typeof i?i:t,null==e?e:Si(e,n,Oi(r),i)},or.values=Qa,or.valuesIn=function(t){return null==t?[]:an(t,$a(t))},or.without=_u,or.words=sc,or.wrap=function(t,e){return Zu(Oi(e),t)},or.xor=bu,or.xorBy=wu,or.xorWith=xu,or.zip=Au,or.zipObject=function(t,e){return Ii(t||[],e||[],yr)},or.zipObjectDeep=function(t,e){return Ii(t||[],e||[],hi)},or.zipWith=ku,or.entries=Ja,or.entriesIn=Xa,or.extend=Pa,or.extendWith=Ca,bc(or,or),or.add=Oc,or.attempt=lc,or.camelCase=tc,or.capitalize=ec,or.ceil=Tc,or.clamp=function(e,n,r){return r===t&&(r=n,n=t),r!==t&&(r=(r=Ia(r))==r?r:0),n!==t&&(n=(n=Ia(n))==n?n:0),kr(Ia(e),n,r)},or.clone=function(t){return Sr(t,s)},or.cloneDeep=function(t){return Sr(t,c|s)},or.cloneDeepWith=function(e,n){return Sr(e,c|s,n="function"==typeof n?n:t)},or.cloneWith=function(e,n){return Sr(e,s,n="function"==typeof n?n:t)},or.conformsTo=function(t,e){return null==e||Rr(t,e,qa(e))},or.deburr=nc,or.defaultTo=function(t,e){return null==t||t!=t?e:t},or.divide=Pc,or.endsWith=function(e,n,r){e=Oa(e),n=xi(n);var i=e.length,o=r=r===t?i:kr(Da(r),0,i);return(r-=n.length)>=0&&e.slice(r,o)==n},or.eq=Qu,or.escape=function(t){return(t=Oa(t))&&gt.test(t)?t.replace(mt,pn):t},or.escapeRegExp=function(t){return(t=Oa(t))&&kt.test(t)?t.replace(At,"\\$&"):t},or.every=function(e,n,r){var i=ra(e)?Le:Or;return r&&Po(e,n,r)&&(n=t),i(e,xo(n,3))},or.find=Iu,or.findIndex=nu,or.findKey=function(t,e){return Ge(t,xo(e,3),Lr)},or.findLast=ju,or.findLastIndex=ru,or.findLastKey=function(t,e){return Ge(t,xo(e,3),Ur)},or.floor=Cc,or.forEach=Ou,or.forEachRight=Tu,or.forIn=function(t,e){return null==t?t:Mr(t,xo(e,3),$a)},or.forInRight=function(t,e){return null==t?t:Br(t,xo(e,3),$a)},or.forOwn=function(t,e){return t&&Lr(t,xo(e,3))},or.forOwnRight=function(t,e){return t&&Ur(t,xo(e,3))},or.get=za,or.gt=ta,or.gte=ea,or.has=function(t,e){return null!=t&&Io(t,e,qr)},or.hasIn=Na,or.head=ou,or.identity=gc,or.includes=function(t,e,n,r){t=oa(t)?t:Qa(t),n=n&&!r?Da(n):0;var i=t.length;return n<0&&(n=Ln(i+n,0)),ba(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Ke(t,e,n)>-1},or.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Da(n);return i<0&&(i=Ln(r+i,0)),Ke(t,e,i)},or.inRange=function(e,n,r){return n=Ra(n),r===t?(r=n,n=0):r=Ra(r),function(t,e,n){return t>=Un(e,n)&&t<Ln(e,n)}(e=Ia(e),n,r)},or.invoke=Ya,or.isArguments=na,or.isArray=ra,or.isArrayBuffer=ia,or.isArrayLike=oa,or.isArrayLikeObject=ua,or.isBoolean=function(t){return!0===t||!1===t||ma(t)&&Wr(t)==B},or.isBuffer=aa,or.isDate=ca,or.isElement=function(t){return ma(t)&&1===t.nodeType&&!va(t)},or.isEmpty=function(t){if(null==t)return!0;if(oa(t)&&(ra(t)||"string"==typeof t||"function"==typeof t.splice||aa(t)||xa(t)||na(t)))return!t.length;var e=Eo(t);if(e==W||e==H)return!t.size;if(Lo(t))return!Qr(t).length;for(var n in t)if(ne.call(t,n))return!1;return!0},or.isEqual=function(t,e){return Kr(t,e)},or.isEqualWith=function(e,n,r){var i=(r="function"==typeof r?r:t)?r(e,n):t;return i===t?Kr(e,n,t,r):!!i},or.isError=fa,or.isFinite=function(t){return"number"==typeof t&&Cn(t)},or.isFunction=sa,or.isInteger=la,or.isLength=pa,or.isMap=da,or.isMatch=function(t,e){return t===e||Zr(t,e,ko(e))},or.isMatchWith=function(e,n,r){return r="function"==typeof r?r:t,Zr(e,n,ko(n),r)},or.isNaN=function(t){return ga(t)&&t!=+t},or.isNative=function(t){if(Bo(t))throw new qt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Jr(t)},or.isNil=function(t){return null==t},or.isNull=function(t){return null===t},or.isNumber=ga,or.isObject=ha,or.isObjectLike=ma,or.isPlainObject=va,or.isRegExp=ya,or.isSafeInteger=function(t){return la(t)&&t>=-R&&t<=R},or.isSet=_a,or.isString=ba,or.isSymbol=wa,or.isTypedArray=xa,or.isUndefined=function(e){return e===t},or.isWeakMap=function(t){return ma(t)&&Eo(t)==X},or.isWeakSet=function(t){return ma(t)&&"[object WeakSet]"==Wr(t)},or.join=function(t,e){return null==t?"":Mn.call(t,e)},or.kebabCase=rc,or.last=fu,or.lastIndexOf=function(e,n,r){var i=null==e?0:e.length;if(!i)return-1;var o=i;return r!==t&&(o=(o=Da(r))<0?Ln(i+o,0):Un(o,i-1)),n==n?function(t,e,n){for(var r=o+1;r--;)if(t[r]===e)return r;return r}(e,n):He(e,Je,o,!0)},or.lowerCase=ic,or.lowerFirst=oc,or.lt=Aa,or.lte=ka,or.max=function(e){return e&&e.length?Tr(e,gc,Yr):t},or.maxBy=function(e,n){return e&&e.length?Tr(e,xo(n,2),Yr):t},or.mean=function(t){return Xe(t,gc)},or.meanBy=function(t,e){return Xe(t,xo(e,2))},or.min=function(e){return e&&e.length?Tr(e,gc,ti):t},or.minBy=function(e,n){return e&&e.length?Tr(e,xo(n,2),ti):t},or.stubArray=Ec,or.stubFalse=Ic,or.stubObject=function(){return{}},or.stubString=function(){return""},or.stubTrue=function(){return!0},or.multiply=Mc,or.nth=function(e,n){return e&&e.length?oi(e,Da(n)):t},or.noConflict=function(){return xe._===this&&(xe._=fe),this},or.noop=wc,or.now=zu,or.pad=function(t,e,n){t=Oa(t);var r=(e=Da(e))?_n(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return ro(On(i),n)+t+ro(jn(i),n)},or.padEnd=function(t,e,n){t=Oa(t);var r=(e=Da(e))?_n(t):0;return e&&r<e?t+ro(e-r,n):t},or.padStart=function(t,e,n){t=Oa(t);var r=(e=Da(e))?_n(t):0;return e&&r<e?ro(e-r,n)+t:t},or.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),Nn(Oa(t).replace(St,""),e||0)},or.random=function(e,n,r){if(r&&"boolean"!=typeof r&&Po(e,n,r)&&(n=r=t),r===t&&("boolean"==typeof n?(r=n,n=t):"boolean"==typeof e&&(r=e,e=t)),e===t&&n===t?(e=0,n=1):(e=Ra(e),n===t?(n=e,e=0):n=Ra(n)),e>n){var i=e;e=n,n=i}if(r||e%1||n%1){var o=Fn();return Un(e+o*(n-e+ye("1e-"+((o+"").length-1))),n)}return si(e,n)},or.reduce=function(t,e,n){var r=ra(t)?Ye:en,i=arguments.length<3;return r(t,xo(e,4),n,i,Ir)},or.reduceRight=function(t,e,n){var r=ra(t)?qe:en,i=arguments.length<3;return r(t,xo(e,4),n,i,jr)},or.repeat=function(e,n,r){return n=(r?Po(e,n,r):n===t)?1:Da(n),li(Oa(e),n)},or.replace=function(){var t=arguments,e=Oa(t[0]);return t.length<3?e:e.replace(t[1],t[2])},or.result=function(e,n,r){var i=-1,o=(n=Ti(n,e)).length;for(o||(o=1,e=t);++i<o;){var u=null==e?t:e[Zo(n[i])];u===t&&(i=o,u=r),e=sa(u)?u.call(e):u}return e},or.round=Bc,or.runInContext=e,or.sample=function(t){return(ra(t)?gr:function(t){return gr(Qa(t))})(t)},or.size=function(t){if(null==t)return 0;if(oa(t))return ba(t)?_n(t):t.length;var e=Eo(t);return e==W||e==H?t.size:Qr(t).length},or.snakeCase=uc,or.some=function(e,n,r){var i=ra(e)?$e:vi;return r&&Po(e,n,r)&&(n=t),i(e,xo(n,3))},or.sortedIndex=function(t,e){return yi(t,e)},or.sortedIndexBy=function(t,e,n){return _i(t,e,xo(n,2))},or.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=yi(t,e);if(r<n&&Qu(t[r],e))return r}return-1},or.sortedLastIndex=function(t,e){return yi(t,e,!0)},or.sortedLastIndexBy=function(t,e,n){return _i(t,e,xo(n,2),!0)},or.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=yi(t,e,!0)-1;if(Qu(t[n],e))return n}return-1},or.startCase=ac,or.startsWith=function(t,e,n){return t=Oa(t),n=null==n?0:kr(Da(n),0,t.length),e=xi(e),t.slice(n,n+e.length)==e},or.subtract=Lc,or.sum=function(t){return t&&t.length?nn(t,gc):0},or.sumBy=function(t,e){return t&&t.length?nn(t,xo(e,2)):0},or.template=function(e,n,r){var i=or.templateSettings;r&&Po(e,n,r)&&(n=t),e=Oa(e),n=Ca({},n,i,lo);var o,u,a=Ca({},n.imports,i.imports,lo),c=qa(a),f=an(a,c),s=0,l=n.interpolate||Ft,p="__p += '",h=Ht((n.escape||Ft).source+"|"+l.source+"|"+(l===_t?Pt:Ft).source+"|"+(n.evaluate||Ft).source+"|$","g"),m="//# sourceURL="+(ne.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++me+"]")+"\n";e.replace(h,function(t,n,r,i,a,c){return r||(r=i),p+=e.slice(s,c).replace(Wt,hn),n&&(o=!0,p+="' +\n__e("+n+") +\n'"),a&&(u=!0,p+="';\n"+a+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=c+t.length,t}),p+="';\n";var d=ne.call(n,"variable")&&n.variable;if(d){if(Ot.test(d))throw new qt("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(u?p.replace(st,""):p).replace(lt,"$1").replace(pt,"$1;"),p="function("+(d||"obj")+") {\n"+(d?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=lc(function(){return $t(c,m+"return "+p).apply(t,f)});if(g.source=p,fa(g))throw g;return g},or.times=function(t,e){if((t=Da(t))<1||t>R)return[];var n=I,r=Un(t,I);e=xo(e),t-=I;for(var i=rn(r,e);++n<t;)e(n);return i},or.toFinite=Ra,or.toInteger=Da,or.toLength=Ea,or.toLower=function(t){return Oa(t).toLowerCase()},or.toNumber=Ia,or.toSafeInteger=function(t){return t?kr(Da(t),-R,R):0===t?t:0},or.toString=Oa,or.toUpper=function(t){return Oa(t).toUpperCase()},or.trim=function(e,n,r){if((e=Oa(e))&&(r||n===t))return on(e);if(!e||!(n=xi(n)))return e;var i=bn(e),o=bn(n);return Ci(i,fn(i,o),sn(i,o)+1).join("")},or.trimEnd=function(e,n,r){if((e=Oa(e))&&(r||n===t))return e.slice(0,wn(e)+1);if(!e||!(n=xi(n)))return e;var i=bn(e);return Ci(i,0,sn(i,bn(n))+1).join("")},or.trimStart=function(e,n,r){if((e=Oa(e))&&(r||n===t))return e.replace(St,"");if(!e||!(n=xi(n)))return e;var i=bn(e);return Ci(i,fn(i,bn(n))).join("")},or.truncate=function(e,n){var r=30,i="...";if(ha(n)){var o="separator"in n?n.separator:o;r="length"in n?Da(n.length):r,i="omission"in n?xi(n.omission):i}var u=(e=Oa(e)).length;if(mn(e)){var a=bn(e);u=a.length}if(r>=u)return e;var c=r-_n(i);if(c<1)return i;var f=a?Ci(a,0,c).join(""):e.slice(0,c);if(o===t)return f+i;if(a&&(c+=f.length-c),ya(o)){if(e.slice(c).search(o)){var s,l=f;for(o.global||(o=Ht(o.source,Oa(Ct.exec(o))+"g")),o.lastIndex=0;s=o.exec(l);)var p=s.index;f=f.slice(0,p===t?c:p)}}else if(e.indexOf(xi(o),c)!=c){var h=f.lastIndexOf(o);h>-1&&(f=f.slice(0,h))}return f+i},or.unescape=function(t){return(t=Oa(t))&&dt.test(t)?t.replace(ht,xn):t},or.uniqueId=function(t){var e=++re;return Oa(t)+e},or.upperCase=cc,or.upperFirst=fc,or.each=Ou,or.eachRight=Tu,or.first=ou,bc(or,(jc={},Lr(or,function(t,e){ne.call(or.prototype,e)||(jc[e]=t)}),jc),{chain:!1}),or.VERSION="4.17.21",Be(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){or[t].placeholder=or}),Be(["drop","take"],function(e,n){fr.prototype[e]=function(r){r=r===t?1:Ln(Da(r),0);var i=this.__filtered__&&!n?new fr(this):this.clone();return i.__filtered__?i.__takeCount__=Un(r,i.__takeCount__):i.__views__.push({size:Un(r,I),type:e+(i.__dir__<0?"Right":"")}),i},fr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),Be(["filter","map","takeWhile"],function(t,e){var n=e+1,r=1==n||3==n;fr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:xo(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}}),Be(["head","last"],function(t,e){var n="take"+(e?"Right":"");fr.prototype[t]=function(){return this[n](1).value()[0]}}),Be(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");fr.prototype[t]=function(){return this.__filtered__?new fr(this):this[n](1)}}),fr.prototype.compact=function(){return this.filter(gc)},fr.prototype.find=function(t){return this.filter(t).head()},fr.prototype.findLast=function(t){return this.reverse().find(t)},fr.prototype.invokeMap=pi(function(t,e){return"function"==typeof t?new fr(this):this.map(function(n){return Gr(n,t,e)})}),fr.prototype.reject=function(t){return this.filter(Hu(xo(t)))},fr.prototype.slice=function(e,n){e=Da(e);var r=this;return r.__filtered__&&(e>0||n<0)?new fr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),n!==t&&(r=(n=Da(n))<0?r.dropRight(-n):r.take(n-e)),r)},fr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},fr.prototype.toArray=function(){return this.take(I)},Lr(fr.prototype,function(e,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),i=/^(?:head|last)$/.test(n),o=or[i?"take"+("last"==n?"Right":""):n],u=i||/^find/.test(n);o&&(or.prototype[n]=function(){var n=this.__wrapped__,a=i?[1]:arguments,c=n instanceof fr,f=a[0],s=c||ra(n),l=function(t){var e=o.apply(or,We([t],a));return i&&p?e[0]:e};s&&r&&"function"==typeof f&&1!=f.length&&(c=s=!1);var p=this.__chain__,h=!!this.__actions__.length,m=u&&!p,d=c&&!h;if(!u&&s){n=d?n:new fr(this);var g=e.apply(n,a);return g.__actions__.push({func:Ru,args:[l],thisArg:t}),new cr(g,p)}return m&&d?e.apply(this,a):(g=this.thru(l),m?i?g.value()[0]:g.value():g)})}),Be(["pop","push","shift","sort","splice","unshift"],function(t){var e=Jt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);or.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(ra(i)?i:[],t)}return this[n](function(n){return e.apply(ra(n)?n:[],t)})}}),Lr(fr.prototype,function(t,e){var n=or[e];if(n){var r=n.name+"";ne.call(Zn,r)||(Zn[r]=[]),Zn[r].push({name:e,func:n})}}),Zn[Qi(t,m).name]=[{name:"wrapper",func:t}],fr.prototype.clone=function(){var t=new fr(this.__wrapped__);return t.__actions__=Wi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Wi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Wi(this.__views__),t},fr.prototype.reverse=function(){if(this.__filtered__){var t=new fr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},fr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=ra(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],u=o.size;switch(o.type){case"drop":t+=u;break;case"dropRight":e-=u;break;case"take":e=Un(e,t+u);break;case"takeRight":t=Ln(t,e-u)}}return{start:t,end:e}}(0,i,this.__views__),u=o.start,a=o.end,c=a-u,f=r?a:u-1,s=this.__iteratees__,l=s.length,p=0,h=Un(c,this.__takeCount__);if(!n||!r&&i==c&&h==c)return Di(t,this.__actions__);var m=[];t:for(;c--&&p<h;){for(var d=-1,g=t[f+=e];++d<l;){var v=s[d],y=v.iteratee,_=v.type,b=y(g);if(2==_)g=b;else if(!b){if(1==_)continue t;break t}}m[p++]=g}return m},or.prototype.at=Du,or.prototype.chain=function(){return Su(this)},or.prototype.commit=function(){return new cr(this.value(),this.__chain__)},or.prototype.next=function(){this.__values__===t&&(this.__values__=Sa(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},or.prototype.plant=function(e){for(var n,r=this;r instanceof ar;){var i=Xo(r);i.__index__=0,i.__values__=t,n?o.__wrapped__=i:n=i;var o=i;r=r.__wrapped__}return o.__wrapped__=e,n},or.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof fr){var n=e;return this.__actions__.length&&(n=new fr(this)),(n=n.reverse()).__actions__.push({func:Ru,args:[hu],thisArg:t}),new cr(n,this.__chain__)}return this.thru(hu)},or.prototype.toJSON=or.prototype.valueOf=or.prototype.value=function(){return Di(this.__wrapped__,this.__actions__)},or.prototype.first=or.prototype.head,kn&&(or.prototype[kn]=function(){return this}),or}();ke?((ke.exports=An)._=An,Ae._=An):xe._=An}).call(this)},{buffer:"dskh"}],I6jy:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(){o=function(t,e){return new n(t,void 0,e)};var t=RegExp.prototype,e=new WeakMap;function n(t,r,i){var o=new RegExp(t,r);return e.set(o,i||e.get(t)),u(o,n.prototype)}function i(t,n){var r=e.get(n);return Object.keys(r).reduce(function(e,n){return e[n]=t[r[n]],e},Object.create(null))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(n,RegExp),n.prototype.exec=function(e){var n=t.exec.call(this,e);return n&&(n.groups=i(n,this)),n},n.prototype[Symbol.replace]=function(n,o){if("string"==typeof o){var u=e.get(this);return t[Symbol.replace].call(this,n,o.replace(/\$<([^>]+)>/g,function(t,e){return"$"+u[e]}))}if("function"==typeof o){var a=this;return t[Symbol.replace].call(this,n,function(){var t=arguments;return"object"!==r(t[t.length-1])&&(t=[].slice.call(t)).push(i(t,a)),o.apply(this,t)})}return t[Symbol.replace].call(this,n,o)},o.apply(this,arguments)}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var a=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),c=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),f=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&a(e,t,n);return c(e,t),e},s=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function u(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(u,a)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(n,"__esModule",{value:!0}),n.getExpressionDocContext=n.getExpressionLine=n.getFileExtension=n.SupportedFileExtensions=n.AllMetaCommands=n.AllKeywords=n.Keywords=n.MetaCommands=n.SupportedUsingFileExtensions=n.SupportedDocumentContextValues=void 0;var l=t("./WerckmeisterAutoHintDb"),p=f(t("lodash"));n.SupportedDocumentContextValues={voice:"voice",document:"document",track:"track",accomp:"accomp",mod:"mod",voicingStrategy:"voicingStrategy"},n.SupportedUsingFileExtensions=[".lua",".template",".chords",".pitchmap",".config",".conductions"],n.MetaCommands=p.fromPairs(p.map(l.getAutoHintDb(),function(t,e){return[e,e]})),n.Keywords=Object.assign({using:"using"},n.MetaCommands),n.AllKeywords=p.values(n.Keywords),n.AllMetaCommands=p.values(n.MetaCommands);var h=["(".concat(n.AllMetaCommands.join("|"),")\\s*:\\s*[^/;]*$"),"".concat(n.Keywords.using,"[^;]*$")],m=new RegExp(".*?(".concat(h.join("|"),")"),"s"),d=o(/(.*\/([0-9A-Z_a-z]+$))|(^([A-Za-z]+)$)/,{a:2,b:4}),g=/\.*?\{[^}]*$/,v=/\.*?\[[^\]]*$/;n.SupportedFileExtensions=[].concat(function(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(n.SupportedUsingFileExtensions),[".sheet"]),n.getFileExtension=function(t){if(t)return(t.match(/^.*(\.\w+)$/)||[])[1]},n.getExpressionLine=function(t,e){var n;return s(this,void 0,void 0,regeneratorRuntime.mark(function r(){var i,o,u,a,c,f,s,l;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:i=e.line;case 1:if(!(i>=0)){r.next=16;break}return o={line:i,col:0},r.next=5,t.getRange(o,e);case 5:if(u=r.sent,!(a=m.exec(u))){r.next=10;break}return c=a[1],r.abrupt("return",c.replace(/\n/g," "));case 10:if(!(p.findIndex(u,function(t){return"]"===t||"}"===t||";"===t})>=0)){r.next=13;break}return r.abrupt("break",16);case 13:--i,r.next=1;break;case 16:return r.next=18,t.getRange({line:e.line,col:0},e);case 18:if(f=r.sent,s=(null===(n=f.match(d))||void 0===n?void 0:n.groups)||{},!(l=s.a||s.b)){r.next=23;break}return r.abrupt("return",l);case 23:return r.abrupt("return","");case 24:case"end":return r.stop()}},r)}))},n.getExpressionDocContext=function(t,e){return s(this,void 0,void 0,regeneratorRuntime.mark(function r(){var i,o;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return i={line:0,col:0},r.next=3,t.getRange(i,e);case 3:if(!(o=r.sent).match(g)){r.next=6;break}return r.abrupt("return",n.SupportedDocumentContextValues.voice);case 6:if(!o.match(v)){r.next=8;break}return r.abrupt("return",n.SupportedDocumentContextValues.track);case 8:return r.abrupt("return",n.SupportedDocumentContextValues.document);case 9:case"end":return r.stop()}},r)}))}},{"./WerckmeisterAutoHintDb":"Y3F9",lodash:"B1iE"}],zyF4:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.GMInstruments=void 0,n.GMInstruments=["Acoustic Grand Piano","Bright Acoustic Piano","Electric Grand Piano","Honky-tonk Piano","Electric Piano 1","Electric Piano 2","Harpsichord","Clavi","Celesta","Glockenspiel","Music Box","Vibraphone","Marimba","Xylophone","Tubular Bells","Dulcimer","Drawbar Organ","Percussive Organ","Rock Organ","Church Organ","Reed Organ","Accordion","Harmonica","Tango Accordion","Acoustic Guitar Nylon","Acoustic Guitar Steel","Electric Guitar Jazz","Electric Guitar Clean","Electric Guitar Muted","Overdriven Guitar","Distortion Guitar","Guitar harmonics","Acoustic Bass","Electric Bass Finger","Electric Bass Pick","Fretless Bass","Slap Bass 1","Slap Bass 2","Synth Bass 1","Synth Bass 2","Violin","Viola","Cello","Contrabass","Tremolo Strings","Pizzicato Strings","Orchestral Harp","Timpani","String Ensemble 1","String Ensemble 2","SynthStrings 1","SynthStrings 2","Choir Aahs","Voice Oohs","Synth Voice","Orchestra Hit","Trumpet","Trombone","Tuba","Muted Trumpet","French Horn","Brass Section","SynthBrass 1","SynthBrass 2","Soprano Sax","Alto Sax","Tenor Sax","Baritone Sax","Oboe","English Horn","Bassoon","Clarinet","Piccolo","Flute","Recorder","Pan Flute","Blown Bottle","Shakuhachi","Whistle","Ocarina","Lead 1 Square","Lead 2 Sawtooth","Lead 3 Calliope","Lead 4 Chiff","Lead 5 Charang","Lead 6 Voice","Lead 7 Fifths","Lead 8 Bass+Lead","Pad 1 New Age","Pad 2 Warm","Pad 3 Polysynth","Pad 4 Choir","Pad 5 Bowed","Pad 6 Metallic","Pad 7 Halo","Pad 8 Sweep","FX 1 Rain","FX 2 Soundtrack","FX 3 Crystal","FX 4 Atmosphere","FX 5 Brightness","FX 6 Goblins","FX 7 Echoes","FX 8 Sci-Fi","Sitar","Banjo","Shamisen","Koto","Kalimba","Bag pipe","Fiddle","Shanai","Tinkle Bell","Agogo","Steel Drums","Woodblock","Taiko Drum","Melodic Tom","Synth Drum","Reverse Cymbal","Guitar Fret Noise","Breath Noise","Seashore","Bird Tweet","Telephone Ring","Helicopter","Applause","Gunshot"]},{}],ykR4:[function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}var o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function u(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(u,a)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(n,"__esModule",{value:!0}),n.CommandArgument=void 0;var u=t("../../Common"),a=t("./GMInstruments"),c=t("../../WerckmeisterAutoHintDb"),f=[u.Keywords.mod,u.Keywords.voicingStrategy,u.Keywords.do,u.Keywords.doOnce],s=[u.Keywords.volume,u.Keywords.pan],l=[].concat(s,f),p=function(){function t(){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.autoHintDb=c.getAutoHintDb()}return i(t,[{key:"getModName",value:function(t){t=t||"";var e=l.join("|"),n=new RegExp("\\s*(".concat(u.Keywords.modOnce,"|").concat(e,')\\s*:.*_use="?([a-zA-Z0-9]+)"?')).exec(t);return n||(n=new RegExp("\\s*(".concat(u.Keywords.modOnce,"|").concat(e,")\\s*:\\s*([a-zA-Z0-9]+)")).exec(t)),!n||n.length<2?"":n[2]}},{key:"getInstrumentConfModName",value:function(t){t=t||"";var e=l.join("|"),n=(new RegExp(".*(".concat(e,").*")).exec(t)||[])[1];if(n&&s.includes(n))return n;e=l.map(function(t){return"".concat(t,".*")}).join("|");var r=(new RegExp(".*(".concat(e,")")).exec(t)||[])[1];if(r){var i=r.match(/\s*_use="?([a-zA-Z0-9]+)"?/);return i&&i.length>1?i[1]:(e=l.join("|"),!(i=new RegExp("\\s*(".concat(e,")\\s*([a-zA-Z0-9]+)")).exec(r))||i.length<2?"":i[2])}}},{key:"isMod",value:function(t){return t===u.Keywords.mod||t===u.Keywords.modOnce||t===u.Keywords.voicingStrategy}},{key:"isInstrumentConf",value:function(t){return t===u.Keywords.instrumentConf}},{key:"getParameterSuggestion",value:function(t,e){var n=t.getParameter();return e&&(n=n.filter(function(t){return t.getName().startsWith(e)})),n.sort(function(t,e){return t.getName().localeCompare(e.getName())}).map(function(e){return{displayText:e.getName(),text:"_".concat(e.getName()),deprecated:e.getDeprecatedText(),command:t,description:e.getDescription()}})}},{key:"getInstrumentDefPcSuggestions",value:function(t,e,n){var r=a.GMInstruments.map(function(n,r){return{displayText:"".concat(n," (").concat(r,")"),text:r.toString(),command:t,parameter:e}});return n&&(r=r.filter(function(t){return t.displayText.toLowerCase().indexOf(n.toLowerCase())>=0})),r}},{key:"getValueSuggestion",value:function(t,e,n){var r=t.getParameter().filter(function(t){return t.getName()===e})[0];if(!r)return[];if(t.getName()===u.Keywords.instrumentDef&&"pc"==e)return this.getInstrumentDefPcSuggestions(t,r,n);var i=(r.getType()||"").match(/\[(.*)\]/);if(!i||!i[1])return[];var o=i[1].split(",").map(function(t){return t.trim()});return n&&(o=o.filter(function(t){return t.startsWith(n)})),o.map(function(e){return{displayText:e,text:'"'.concat(e,'"'),command:t,parameter:r}})}},{key:"getSuggestions",value:function(t,e,n){return o(this,void 0,void 0,regeneratorRuntime.mark(function e(){var n,r,i,o,u,a,c;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return",[]);case 2:if(n=t.match(/.*?(\w+)\s*:.*?_(\w*)(="?(\w*))?$/)){e.next=5;break}return e.abrupt("return",[]);case 5:if(r=(n[1]||"").trim(),i=void 0!==n[3],o=(n[2]||"").trim(),this.isMod(r)&&(r=this.getModName(t)),this.isInstrumentConf(r)&&(r=this.getInstrumentConfModName(t)),u=this.autoHintDb[r]){e.next=13;break}return e.abrupt("return",[]);case 13:if(!i){e.next=17;break}return a=(n[2]||"").trim(),c=(n[4]||"").trim(),e.abrupt("return",this.getValueSuggestion(u,a,c));case 17:return e.abrupt("return",this.getParameterSuggestion(u,o));case 18:case"end":return e.stop()}},e,this)}))}}]),t}();n.CommandArgument=p},{"../../Common":"I6jy","./GMInstruments":"zyF4","../../WerckmeisterAutoHintDb":"Y3F9"}],nviV:[function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}var o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function u(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(u,a)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(n,"__esModule",{value:!0}),n.Command=void 0;var u=t("lodash"),a=t("../../WerckmeisterAutoHintDb"),c=function(){function t(){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.commandDb=a.getAutoHintDb()}return i(t,[{key:"getSuggestions",value:function(t,e,n){return o(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.toLowerCase(),i=u(this.commandDb).filter(function(t,e){return e.toLowerCase().indexOf(r)>=0&&t.getDocumentContext().includes(n)}).value(),e.abrupt("return",i.map(function(t){return{displayText:t.getName(),text:t.getName(),description:t.getDescription(),url:t.getUrl()}}));case 3:case"end":return e.stop()}},e,this)}))}}]),t}();n.Command=c},{lodash:"B1iE","../../WerckmeisterAutoHintDb":"Y3F9"}],Tlxz:[function(t,e,n){"use strict";function r(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var u=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),c=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&u(e,t,n);return a(e,t),e},f=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function u(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(u,a)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(n,"__esModule",{value:!0}),n.Using=void 0;var s=t("../../Common"),l=c(t("lodash")),p=t("../../WerckmeisterAutoHintDb").getPreInstalledAuxFiles(),h=function(){function t(e){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.fileInspector=e}return function(t,e,n){e&&o(t.prototype,e),n&&o(t,n)}(t,[{key:"ls",value:function(t){return f(this,void 0,void 0,regeneratorRuntime.mark(function e(){var n,i,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=t.trim(),e.next=3,this.fileInspector.ls(t);case 3:return n=e.sent,t.endsWith("/")&&t.length>1&&(t=l.trimEnd(t,"/")),(i=p[t])&&(o=n).push.apply(o,r(i.map(function(t){return{name:t.name,isDirectory:t.isDirectory||!1}}))),n=l.uniqBy(n,function(t){return t.name}),e.abrupt("return",n);case 9:case"end":return e.stop()}},e,this)}))}},{key:"getSuggestions",value:function(t,e,n){return f(this,void 0,void 0,regeneratorRuntime.mark(function n(){var r,i,o,u,a,c;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(t){n.next=2;break}return n.abrupt("return",[]);case 2:if(t.match(/^\s*using\s*"{0,1}[^"]*$/)){n.next=5;break}return n.abrupt("return",[]);case 5:if(r=(t.match(/.+"(.*)/)||[])[1]){n.next=8;break}return n.abrupt("return",[]);case 8:return i=r?l.last(r.split("/")):"",n.next=11,e.getAbsolutePath();case 11:return o=n.sent,n.next=14,this.fileInspector.getParentPath(o);case 14:if(o=n.sent,u=r,!i){n.next=20;break}return n.next=19,this.fileInspector.getParentPath(r);case 19:u=n.sent;case 20:return n.next=22,this.fileInspector.resolve(o,u);case 22:return u=n.sent,n.next=25,this.ls(u);case 25:return a=n.sent,c=a.filter(function(t){return t.isDirectory||s.SupportedUsingFileExtensions.includes(s.getFileExtension(t.name))}),i&&(c=c.filter(function(t){return t.name.startsWith(i)})),n.abrupt("return",c.sort(function(t,e){return t.isDirectory&&!e.isDirectory?-1:!t.isDirectory&&e.isDirectory?1:t.name.localeCompare(e.name)}).map(function(t){return{displayText:t.name,text:t.name,file:t}}));case 29:case"end":return n.stop()}},n,this)}))}}]),t}();n.Using=h},{"../../Common":"I6jy",lodash:"B1iE","../../WerckmeisterAutoHintDb":"Y3F9"}],bvdo:[function(t,e,n){"use strict";function r(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,u=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw u}}}}function o(t,e){if(t){if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var c=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,o){function u(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(u,a)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(n,"__esModule",{value:!0}),n.LanguageFeatures=void 0;var f=t("./Common"),s=t("./features/autocomplete/CommandArgument"),l=t("./features/autocomplete/Command"),p=t("./features/autocomplete/Using"),h=function(){function t(e){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.fileSystemInspector=e,this.features={autoCompletes:[new p.Using(this.fileSystemInspector),new l.Command,new s.CommandArgument]}}return function(t,e,n){e&&a(t.prototype,e),n&&a(t,n)}(t,[{key:"autoComplete",value:function(t){return c(this,void 0,void 0,regeneratorRuntime.mark(function e(){var n,o,u,a,c,s,l,p;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getCursor();case 2:return n=e.sent,e.next=5,f.getExpressionLine(t,n);case 5:if(o=e.sent){e.next=8;break}return e.abrupt("return",[]);case 8:return e.next=10,f.getExpressionDocContext(t,n);case 10:u=e.sent,a=[],c=i(this.features.autoCompletes),e.prev=13,c.s();case 15:if((s=c.n()).done){e.next=25;break}return l=s.value,e.next=19,l.getSuggestions(o,t,u);case 19:if(p=e.sent){e.next=22;break}return e.abrupt("continue",23);case 22:a.push.apply(a,r(p));case 23:e.next=15;break;case 25:e.next=30;break;case 27:e.prev=27,e.t0=e.catch(13),c.e(e.t0);case 30:return e.prev=30,c.f(),e.finish(30);case 33:return e.abrupt("return",a);case 34:case"end":return e.stop()}},e,this,[[13,27,30,33]])}))}}]),t}();n.LanguageFeatures=h},{"./Common":"I6jy","./features/autocomplete/CommandArgument":"ykR4","./features/autocomplete/Command":"nviV","./features/autocomplete/Using":"Tlxz"}]},{},["bvdo"]);
@@ -487,7 +487,7 @@ var process = require("process");
487
487
  var __dirname = "/home/runner/work/werckmeister-component/werckmeister-component/node_modules/@werckmeister/compilerjs";
488
488
  var Buffer = require("buffer").Buffer;
489
489
  var define;
490
- var r,t="/home/runner/work/werckmeister-component/werckmeister-component/node_modules/@werckmeister/compilerjs/werckmeister.js",e=require("process"),n="/home/runner/work/werckmeister-component/werckmeister-component/node_modules/@werckmeister/compilerjs",o=require("buffer").Buffer,a=(()=>{var r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return void 0!==t&&(r=r||t),function(t){var a,i,s=void 0!==(t=t||{})?t:{},u=Object.assign;s.ready=new Promise(function(r,t){a=r,i=t});var c,l,f,d,h,m,p=u({},s),w=[],v="./this.program",g=(r,t)=>{throw t},y="object"==typeof window,_="function"==typeof importScripts,E="object"==typeof e&&"object"==typeof e.versions&&"string"==typeof e.versions.node,b="";E?(b=_?require("path").dirname(b)+"/":n+"/",m=(()=>{h||(d=require("fs"),h=require("path"))}),c=function(r,t){return m(),r=h.normalize(r),d.readFileSync(r,t?null:"utf8")},f=(r=>{var t=c(r,!0);return t.buffer||(t=new Uint8Array(t)),t}),l=((r,t,e)=>{m(),r=h.normalize(r),d.readFile(r,function(r,n){r?e(r):t(n.buffer)})}),e.argv.length>1&&(v=e.argv[1].replace(/\\/g,"/")),w=e.argv.slice(2),e.on("uncaughtException",function(r){if(!(r instanceof yt))throw r}),e.on("unhandledRejection",function(r){throw r}),g=((r,t)=>{if(tr())throw e.exitCode=r,t;!function(r){if(r instanceof yt)return;j("exiting due to exception: "+r)}(t),e.exit(r)}),s.inspect=function(){return"[Emscripten Module object]"}):(y||_)&&(_?b=self.location.href:"undefined"!=typeof document&&document.currentScript&&(b=document.currentScript.src),r&&(b=r),b=0!==b.indexOf("blob:")?b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):"",c=(r=>{var t=new XMLHttpRequest;return t.open("GET",r,!1),t.send(null),t.responseText}),_&&(f=(r=>{var t=new XMLHttpRequest;return t.open("GET",r,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)})),l=((r,t,e)=>{var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=(()=>{200==n.status||0==n.status&&n.response?t(n.response):e()}),n.onerror=e,n.send(null)}));var k=s.print||console.log.bind(console),j=s.printErr||console.warn.bind(console);u(s,p),p=null,s.arguments&&(w=s.arguments),s.thisProgram&&(v=s.thisProgram),s.quit&&(g=s.quit);var D,S=0,F=r=>{S=r},M=()=>S;s.wasmBinary&&(D=s.wasmBinary);var A,P=s.noExitRuntime||!0;"object"!=typeof WebAssembly&&ur("no native wasm support detected");var T,x=!1;function C(r){return s["_"+r]}function R(r,t,e,n,o){var a={string:function(r){var t=0;if(null!=r&&0!==r){var e=1+(r.length<<2);q(r,t=Qr(e),e)}return t},array:function(r){var t=Qr(r.length);return V(r,t),t}};var i=C(r),s=[],u=0;if(n)for(var c=0;c<n.length;c++){var l=a[e[c]];l?(0===u&&(u=$r()),s[c]=l(n[c])):s[c]=n[c]}var f=i.apply(null,s);return f=function(r){return 0!==u&&Zr(u),function(r){return"string"===t?H(r):"boolean"===t?Boolean(r):r}(r)}(f)}var z,O,B,N,I,U="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function L(r,t,e){for(var n=t+e,o=t;r[o]&&!(o>=n);)++o;if(o-t>16&&r.subarray&&U)return U.decode(r.subarray(t,o));for(var a="";t<o;){var i=r[t++];if(128&i){var s=63&r[t++];if(192!=(224&i)){var u=63&r[t++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&r[t++])<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a}function H(r,t){return r?L(B,r,t):""}function Y(r,t,e,n){if(!(n>0))return 0;for(var o=e,a=e+n-1,i=0;i<r.length;++i){var s=r.charCodeAt(i);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&r.charCodeAt(++i);if(s<=127){if(e>=a)break;t[e++]=s}else if(s<=2047){if(e+1>=a)break;t[e++]=192|s>>6,t[e++]=128|63&s}else if(s<=65535){if(e+2>=a)break;t[e++]=224|s>>12,t[e++]=128|s>>6&63,t[e++]=128|63&s}else{if(e+3>=a)break;t[e++]=240|s>>18,t[e++]=128|s>>12&63,t[e++]=128|s>>6&63,t[e++]=128|63&s}}return t[e]=0,e-o}function q(r,t,e){return Y(r,B,t,e)}function W(r){for(var t=0,e=0;e<r.length;++e){var n=r.charCodeAt(e);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&r.charCodeAt(++e)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}function G(r){var t=W(r)+1,e=Vr(t);return e&&Y(r,O,e,t),e}function X(r){var t=W(r)+1,e=Qr(t);return Y(r,O,e,t),e}function V(r,t){O.set(r,t)}s.INITIAL_MEMORY;var K,J=[],$=[],Z=[],Q=[],rr=0;function tr(){return P||rr>0}var er=0,nr=null,or=null;function ar(r){return r}function ir(r){er++,s.monitorRunDependencies&&s.monitorRunDependencies(er)}function sr(r){if(er--,s.monitorRunDependencies&&s.monitorRunDependencies(er),0==er&&(null!==nr&&(clearInterval(nr),nr=null),or)){var t=or;or=null,t()}}function ur(r){s.onAbort&&s.onAbort(r),j(r="Aborted("+r+")"),x=!0,T=1,r+=". Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(r);throw i(t),t}s.preloadedImages={},s.preloadedAudios={};var cr,lr,fr,dr,hr,mr="data:application/octet-stream;base64,";function pr(r){return r.startsWith(mr)}function wr(r){return r.startsWith("file://")}function vr(r){try{if(r==cr&&D)return new Uint8Array(D);if(f)return f(r);throw"both async and sync fetching of the wasm failed"}catch(j){ur(j)}}function gr(r){for(;r.length>0;){var t=r.shift();if("function"!=typeof t){var e=t.func;"number"==typeof e?void 0===t.arg?yr(e)():yr(e)(t.arg):e(void 0===t.arg?null:t.arg)}else t(s)}}function yr(r){return K.get(r)}pr(cr="werckmeister.wasm")||(lr=cr,cr=s.locateFile?s.locateFile(lr,b):b+lr),hr=E?()=>{var r=e.hrtime();return 1e3*r[0]+r[1]/1e6}:()=>performance.now();var _r=!0;function Er(r){return I[Kr()>>2]=r,r}function br(r){this.excPtr=r,this.ptr=r-16,this.set_type=function(r){I[this.ptr+4>>2]=r},this.get_type=function(){return I[this.ptr+4>>2]},this.set_destructor=function(r){I[this.ptr+8>>2]=r},this.get_destructor=function(){return I[this.ptr+8>>2]},this.set_refcount=function(r){I[this.ptr>>2]=r},this.set_caught=function(r){r=r?1:0,O[this.ptr+12>>0]=r},this.get_caught=function(){return 0!=O[this.ptr+12>>0]},this.set_rethrown=function(r){r=r?1:0,O[this.ptr+13>>0]=r},this.get_rethrown=function(){return 0!=O[this.ptr+13>>0]},this.init=function(r,t){this.set_type(r),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var r=I[this.ptr>>2];I[this.ptr>>2]=r+1},this.release_ref=function(){var r=I[this.ptr>>2];return I[this.ptr>>2]=r-1,1===r}}function kr(r){this.free=function(){Xr(this.ptr),this.ptr=0},this.set_base_ptr=function(r){I[this.ptr>>2]=r},this.get_base_ptr=function(){return I[this.ptr>>2]},this.set_adjusted_ptr=function(r){I[this.ptr+4>>2]=r},this.get_adjusted_ptr_addr=function(){return this.ptr+4},this.get_adjusted_ptr=function(){return I[this.ptr+4>>2]},this.get_exception_ptr=function(){if(tt(this.get_exception_info().get_type()))return I[this.get_base_ptr()>>2];var r=this.get_adjusted_ptr();return 0!==r?r:this.get_base_ptr()},this.get_exception_info=function(){return new br(this.get_base_ptr())},void 0===r?(this.ptr=Vr(8),this.set_adjusted_ptr(0)):this.ptr=r}var jr=[];var Dr=0;var Sr=0;function Fr(r){try{return Xr(new br(r).ptr)}catch(t){}}var Mr={splitPath:function(r){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(r).slice(1)},normalizeArray:function(r,t){for(var e=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),e++):e&&(r.splice(n,1),e--)}if(t)for(;e;e--)r.unshift("..");return r},normalize:function(r){var t="/"===r.charAt(0),e="/"===r.substr(-1);return(r=Mr.normalizeArray(r.split("/").filter(function(r){return!!r}),!t).join("/"))||t||(r="."),r&&e&&(r+="/"),(t?"/":"")+r},dirname:function(r){var t=Mr.splitPath(r),e=t[0],n=t[1];return e||n?(n&&(n=n.substr(0,n.length-1)),e+n):"."},basename:function(r){if("/"===r)return"/";var t=(r=(r=Mr.normalize(r)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?r:r.substr(t+1)},extname:function(r){return Mr.splitPath(r)[3]},join:function(){var r=Array.prototype.slice.call(arguments,0);return Mr.normalize(r.join("/"))},join2:function(r,t){return Mr.normalize(r+"/"+t)}};var Ar={resolve:function(){for(var r="",t=!1,e=arguments.length-1;e>=-1&&!t;e--){var n=e>=0?arguments[e]:Cr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,t="/"===n.charAt(0)}return(t?"/":"")+(r=Mr.normalizeArray(r.split("/").filter(function(r){return!!r}),!t).join("/"))||"."},relative:function(r,t){function e(r){for(var t=0;t<r.length&&""===r[t];t++);for(var e=r.length-1;e>=0&&""===r[e];e--);return t>e?[]:r.slice(t,e-t+1)}r=Ar.resolve(r).substr(1),t=Ar.resolve(t).substr(1);for(var n=e(r.split("/")),o=e(t.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(i))).join("/")}},Pr={ttys:[],init:function(){},shutdown:function(){},register:function(r,t){Pr.ttys[r]={input:[],output:[],ops:t},Cr.registerDevice(r,Pr.stream_ops)},stream_ops:{open:function(r){var t=Pr.ttys[r.node.rdev];if(!t)throw new Cr.ErrnoError(43);r.tty=t,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,t,e,n,o){if(!r.tty||!r.tty.ops.get_char)throw new Cr.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(u){throw new Cr.ErrnoError(29)}if(void 0===s&&0===a)throw new Cr.ErrnoError(6);if(null==s)break;a++,t[e+i]=s}return a&&(r.node.timestamp=Date.now()),a},write:function(r,t,e,n,o){if(!r.tty||!r.tty.ops.put_char)throw new Cr.ErrnoError(60);try{for(var a=0;a<n;a++)r.tty.ops.put_char(r.tty,t[e+a])}catch(i){throw new Cr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:function(r){if(!r.input.length){var t=null;if(E){var n=o.alloc(256),a=0;try{a=d.readSync(e.stdin.fd,n,0,256,null)}catch(i){if(!i.toString().includes("EOF"))throw i;a=0}t=a>0?n.slice(0,a).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;r.input=qr(t,!0)}return r.input.shift()},put_char:function(r,t){null===t||10===t?(k(L(r.output,0)),r.output=[]):0!=t&&r.output.push(t)},flush:function(r){r.output&&r.output.length>0&&(k(L(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,t){null===t||10===t?(j(L(r.output,0)),r.output=[]):0!=t&&r.output.push(t)},flush:function(r){r.output&&r.output.length>0&&(j(L(r.output,0)),r.output=[])}}};var Tr={ops_table:null,mount:function(r){return Tr.createNode(null,"/",16895,0)},createNode:function(r,t,e,n){if(Cr.isBlkdev(e)||Cr.isFIFO(e))throw new Cr.ErrnoError(63);Tr.ops_table||(Tr.ops_table={dir:{node:{getattr:Tr.node_ops.getattr,setattr:Tr.node_ops.setattr,lookup:Tr.node_ops.lookup,mknod:Tr.node_ops.mknod,rename:Tr.node_ops.rename,unlink:Tr.node_ops.unlink,rmdir:Tr.node_ops.rmdir,readdir:Tr.node_ops.readdir,symlink:Tr.node_ops.symlink},stream:{llseek:Tr.stream_ops.llseek}},file:{node:{getattr:Tr.node_ops.getattr,setattr:Tr.node_ops.setattr},stream:{llseek:Tr.stream_ops.llseek,read:Tr.stream_ops.read,write:Tr.stream_ops.write,allocate:Tr.stream_ops.allocate,mmap:Tr.stream_ops.mmap,msync:Tr.stream_ops.msync}},link:{node:{getattr:Tr.node_ops.getattr,setattr:Tr.node_ops.setattr,readlink:Tr.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Tr.node_ops.getattr,setattr:Tr.node_ops.setattr},stream:Cr.chrdev_stream_ops}});var o=Cr.createNode(r,t,e,n);return Cr.isDir(o.mode)?(o.node_ops=Tr.ops_table.dir.node,o.stream_ops=Tr.ops_table.dir.stream,o.contents={}):Cr.isFile(o.mode)?(o.node_ops=Tr.ops_table.file.node,o.stream_ops=Tr.ops_table.file.stream,o.usedBytes=0,o.contents=null):Cr.isLink(o.mode)?(o.node_ops=Tr.ops_table.link.node,o.stream_ops=Tr.ops_table.link.stream):Cr.isChrdev(o.mode)&&(o.node_ops=Tr.ops_table.chrdev.node,o.stream_ops=Tr.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[t]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,t){var e=r.contents?r.contents.length:0;if(!(e>=t)){t=Math.max(t,e*(e<1048576?2:1.125)>>>0),0!=e&&(t=Math.max(t,256));var n=r.contents;r.contents=new Uint8Array(t),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,t){if(r.usedBytes!=t)if(0==t)r.contents=null,r.usedBytes=0;else{var e=r.contents;r.contents=new Uint8Array(t),e&&r.contents.set(e.subarray(0,Math.min(t,r.usedBytes))),r.usedBytes=t}},node_ops:{getattr:function(r){var t={};return t.dev=Cr.isChrdev(r.mode)?r.id:1,t.ino=r.id,t.mode=r.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=r.rdev,Cr.isDir(r.mode)?t.size=4096:Cr.isFile(r.mode)?t.size=r.usedBytes:Cr.isLink(r.mode)?t.size=r.link.length:t.size=0,t.atime=new Date(r.timestamp),t.mtime=new Date(r.timestamp),t.ctime=new Date(r.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(r,t){void 0!==t.mode&&(r.mode=t.mode),void 0!==t.timestamp&&(r.timestamp=t.timestamp),void 0!==t.size&&Tr.resizeFileStorage(r,t.size)},lookup:function(r,t){throw Cr.genericErrors[44]},mknod:function(r,t,e,n){return Tr.createNode(r,t,e,n)},rename:function(r,t,e){if(Cr.isDir(r.mode)){var n;try{n=Cr.lookupNode(t,e)}catch(a){}if(n)for(var o in n.contents)throw new Cr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=e,t.contents[e]=r,t.timestamp=r.parent.timestamp,r.parent=t},unlink:function(r,t){delete r.contents[t],r.timestamp=Date.now()},rmdir:function(r,t){var e=Cr.lookupNode(r,t);for(var n in e.contents)throw new Cr.ErrnoError(55);delete r.contents[t],r.timestamp=Date.now()},readdir:function(r){var t=[".",".."];for(var e in r.contents)r.contents.hasOwnProperty(e)&&t.push(e);return t},symlink:function(r,t,e){var n=Tr.createNode(r,t,41471,0);return n.link=e,n},readlink:function(r){if(!Cr.isLink(r.mode))throw new Cr.ErrnoError(28);return r.link}},stream_ops:{read:function(r,t,e,n,o){var a=r.node.contents;if(o>=r.node.usedBytes)return 0;var i=Math.min(r.node.usedBytes-o,n);if(i>8&&a.subarray)t.set(a.subarray(o,o+i),e);else for(var s=0;s<i;s++)t[e+s]=a[o+s];return i},write:function(r,t,e,n,o,a){if(!n)return 0;var i=r.node;if(i.timestamp=Date.now(),t.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=t.subarray(e,e+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=t.slice(e,e+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(t.subarray(e,e+n),o),n}if(Tr.expandFileStorage(i,o+n),i.contents.subarray&&t.subarray)i.contents.set(t.subarray(e,e+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=t[e+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek:function(r,t,e){var n=t;if(1===e?n+=r.position:2===e&&Cr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new Cr.ErrnoError(28);return n},allocate:function(r,t,e){Tr.expandFileStorage(r.node,t+e),r.node.usedBytes=Math.max(r.node.usedBytes,t+e)},mmap:function(r,t,e,n,o,a){if(0!==t)throw new Cr.ErrnoError(28);if(!Cr.isFile(r.node.mode))throw new Cr.ErrnoError(43);var i,s,u=r.node.contents;if(2&a||u.buffer!==z){if((n>0||n+e<u.length)&&(u=u.subarray?u.subarray(n,n+e):Array.prototype.slice.call(u,n,n+e)),s=!0,!(i=void ur()))throw new Cr.ErrnoError(48);O.set(u,i)}else s=!1,i=u.byteOffset;return{ptr:i,allocated:s}},msync:function(r,t,e,n,o){if(!Cr.isFile(r.node.mode))throw new Cr.ErrnoError(43);if(2&o)return 0;Tr.stream_ops.write(r,t,0,n,e,!1);return 0}}};function xr(r,t,e,n){var o=n?"":ar("al "+r);l(r,function(e){var n;n='Loading data file "'+r+'" failed (no arrayBuffer).',e||ur(n),t(new Uint8Array(e)),o&&sr()},function(t){if(!e)throw'Loading data file "'+r+'" failed.';e()}),o&&ir()}var Cr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(r,t={})=>{if(!(r=Ar.resolve(Cr.cwd(),r)))return{path:"",node:null};var e={follow_mount:!0,recurse_count:0};for(var n in e)void 0===t[n]&&(t[n]=e[n]);if(t.recurse_count>8)throw new Cr.ErrnoError(32);for(var o=Mr.normalizeArray(r.split("/").filter(r=>!!r),!1),a=Cr.root,i="/",s=0;s<o.length;s++){var u=s===o.length-1;if(u&&t.parent)break;if(a=Cr.lookupNode(a,o[s]),i=Mr.join2(i,o[s]),Cr.isMountpoint(a)&&(!u||u&&t.follow_mount)&&(a=a.mounted.root),!u||t.follow)for(var c=0;Cr.isLink(a.mode);){var l=Cr.readlink(i);if(i=Ar.resolve(Mr.dirname(i),l),a=Cr.lookupPath(i,{recurse_count:t.recurse_count}).node,c++>40)throw new Cr.ErrnoError(32)}}return{path:i,node:a}},getPath:r=>{for(var t;;){if(Cr.isRoot(r)){var e=r.mount.mountpoint;return t?"/"!==e[e.length-1]?e+"/"+t:e+t:e}t=t?r.name+"/"+t:r.name,r=r.parent}},hashName:(r,t)=>{for(var e=0,n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n)|0;return(r+e>>>0)%Cr.nameTable.length},hashAddNode:r=>{var t=Cr.hashName(r.parent.id,r.name);r.name_next=Cr.nameTable[t],Cr.nameTable[t]=r},hashRemoveNode:r=>{var t=Cr.hashName(r.parent.id,r.name);if(Cr.nameTable[t]===r)Cr.nameTable[t]=r.name_next;else for(var e=Cr.nameTable[t];e;){if(e.name_next===r){e.name_next=r.name_next;break}e=e.name_next}},lookupNode:(r,t)=>{var e=Cr.mayLookup(r);if(e)throw new Cr.ErrnoError(e,r);for(var n=Cr.hashName(r.id,t),o=Cr.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===r.id&&a===t)return o}return Cr.lookup(r,t)},createNode:(r,t,e,n)=>{var o=new Cr.FSNode(r,t,e,n);return Cr.hashAddNode(o),o},destroyNode:r=>{Cr.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>32768==(61440&r),isDir:r=>16384==(61440&r),isLink:r=>40960==(61440&r),isChrdev:r=>8192==(61440&r),isBlkdev:r=>24576==(61440&r),isFIFO:r=>4096==(61440&r),isSocket:r=>49152==(49152&r),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:r=>{var t=Cr.flagModes[r];if(void 0===t)throw new Error("Unknown file open mode: "+r);return t},flagsToPermissionString:r=>{var t=["r","w","rw"][3&r];return 512&r&&(t+="w"),t},nodePermissions:(r,t)=>Cr.ignorePermissions?0:(!t.includes("r")||292&r.mode)&&(!t.includes("w")||146&r.mode)&&(!t.includes("x")||73&r.mode)?0:2,mayLookup:r=>{var t=Cr.nodePermissions(r,"x");return t||(r.node_ops.lookup?0:2)},mayCreate:(r,t)=>{try{Cr.lookupNode(r,t);return 20}catch(e){}return Cr.nodePermissions(r,"wx")},mayDelete:(r,t,e)=>{var n;try{n=Cr.lookupNode(r,t)}catch(a){return a.errno}var o=Cr.nodePermissions(r,"wx");if(o)return o;if(e){if(!Cr.isDir(n.mode))return 54;if(Cr.isRoot(n)||Cr.getPath(n)===Cr.cwd())return 10}else if(Cr.isDir(n.mode))return 31;return 0},mayOpen:(r,t)=>r?Cr.isLink(r.mode)?32:Cr.isDir(r.mode)&&("r"!==Cr.flagsToPermissionString(t)||512&t)?31:Cr.nodePermissions(r,Cr.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(r=0,t=Cr.MAX_OPEN_FDS)=>{for(var e=r;e<=t;e++)if(!Cr.streams[e])return e;throw new Cr.ErrnoError(33)},getStream:r=>Cr.streams[r],createStream:(r,t,e)=>{Cr.FSStream||(Cr.FSStream=function(){},Cr.FSStream.prototype={object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var n=new Cr.FSStream;for(var o in r)n[o]=r[o];r=n;var a=Cr.nextfd(t,e);return r.fd=a,Cr.streams[a]=r,r},closeStream:r=>{Cr.streams[r]=null},chrdev_stream_ops:{open:r=>{var t=Cr.getDevice(r.node.rdev);r.stream_ops=t.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:()=>{throw new Cr.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,t)=>r<<8|t,registerDevice:(r,t)=>{Cr.devices[r]={stream_ops:t}},getDevice:r=>Cr.devices[r],getMounts:r=>{for(var t=[],e=[r];e.length;){var n=e.pop();t.push(n),e.push.apply(e,n.mounts)}return t},syncfs:(r,t)=>{"function"==typeof r&&(t=r,r=!1),Cr.syncFSRequests++,Cr.syncFSRequests>1&&j("warning: "+Cr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var e=Cr.getMounts(Cr.root.mount),n=0;function o(r){return Cr.syncFSRequests--,t(r)}function a(r){if(r)return a.errored?void 0:(a.errored=!0,o(r));++n>=e.length&&o(null)}e.forEach(t=>{if(!t.type.syncfs)return a(null);t.type.syncfs(t,r,a)})},mount:(r,t,e)=>{var n,o="/"===e,a=!e;if(o&&Cr.root)throw new Cr.ErrnoError(10);if(!o&&!a){var i=Cr.lookupPath(e,{follow_mount:!1});if(e=i.path,n=i.node,Cr.isMountpoint(n))throw new Cr.ErrnoError(10);if(!Cr.isDir(n.mode))throw new Cr.ErrnoError(54)}var s={type:r,opts:t,mountpoint:e,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?Cr.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:r=>{var t=Cr.lookupPath(r,{follow_mount:!1});if(!Cr.isMountpoint(t.node))throw new Cr.ErrnoError(28);var e=t.node,n=e.mounted,o=Cr.getMounts(n);Object.keys(Cr.nameTable).forEach(r=>{for(var t=Cr.nameTable[r];t;){var e=t.name_next;o.includes(t.mount)&&Cr.destroyNode(t),t=e}}),e.mounted=null;var a=e.mount.mounts.indexOf(n);e.mount.mounts.splice(a,1)},lookup:(r,t)=>r.node_ops.lookup(r,t),mknod:(r,t,e)=>{var n=Cr.lookupPath(r,{parent:!0}).node,o=Mr.basename(r);if(!o||"."===o||".."===o)throw new Cr.ErrnoError(28);var a=Cr.mayCreate(n,o);if(a)throw new Cr.ErrnoError(a);if(!n.node_ops.mknod)throw new Cr.ErrnoError(63);return n.node_ops.mknod(n,o,t,e)},create:(r,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Cr.mknod(r,t,0)),mkdir:(r,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Cr.mknod(r,t,0)),mkdirTree:(r,t)=>{for(var e=r.split("/"),n="",o=0;o<e.length;++o)if(e[o]){n+="/"+e[o];try{Cr.mkdir(n,t)}catch(a){if(20!=a.errno)throw a}}},mkdev:(r,t,e)=>(void 0===e&&(e=t,t=438),t|=8192,Cr.mknod(r,t,e)),symlink:(r,t)=>{if(!Ar.resolve(r))throw new Cr.ErrnoError(44);var e=Cr.lookupPath(t,{parent:!0}).node;if(!e)throw new Cr.ErrnoError(44);var n=Mr.basename(t),o=Cr.mayCreate(e,n);if(o)throw new Cr.ErrnoError(o);if(!e.node_ops.symlink)throw new Cr.ErrnoError(63);return e.node_ops.symlink(e,n,r)},rename:(r,t)=>{var e,n,o=Mr.dirname(r),a=Mr.dirname(t),i=Mr.basename(r),s=Mr.basename(t);if(e=Cr.lookupPath(r,{parent:!0}).node,n=Cr.lookupPath(t,{parent:!0}).node,!e||!n)throw new Cr.ErrnoError(44);if(e.mount!==n.mount)throw new Cr.ErrnoError(75);var u,c=Cr.lookupNode(e,i),l=Ar.relative(r,a);if("."!==l.charAt(0))throw new Cr.ErrnoError(28);if("."!==(l=Ar.relative(t,o)).charAt(0))throw new Cr.ErrnoError(55);try{u=Cr.lookupNode(n,s)}catch(h){}if(c!==u){var f=Cr.isDir(c.mode),d=Cr.mayDelete(e,i,f);if(d)throw new Cr.ErrnoError(d);if(d=u?Cr.mayDelete(n,s,f):Cr.mayCreate(n,s))throw new Cr.ErrnoError(d);if(!e.node_ops.rename)throw new Cr.ErrnoError(63);if(Cr.isMountpoint(c)||u&&Cr.isMountpoint(u))throw new Cr.ErrnoError(10);if(n!==e&&(d=Cr.nodePermissions(e,"w")))throw new Cr.ErrnoError(d);Cr.hashRemoveNode(c);try{e.node_ops.rename(c,n,s)}catch(h){throw h}finally{Cr.hashAddNode(c)}}},rmdir:r=>{var t=Cr.lookupPath(r,{parent:!0}).node,e=Mr.basename(r),n=Cr.lookupNode(t,e),o=Cr.mayDelete(t,e,!0);if(o)throw new Cr.ErrnoError(o);if(!t.node_ops.rmdir)throw new Cr.ErrnoError(63);if(Cr.isMountpoint(n))throw new Cr.ErrnoError(10);t.node_ops.rmdir(t,e),Cr.destroyNode(n)},readdir:r=>{var t=Cr.lookupPath(r,{follow:!0}).node;if(!t.node_ops.readdir)throw new Cr.ErrnoError(54);return t.node_ops.readdir(t)},unlink:r=>{var t=Cr.lookupPath(r,{parent:!0}).node;if(!t)throw new Cr.ErrnoError(44);var e=Mr.basename(r),n=Cr.lookupNode(t,e),o=Cr.mayDelete(t,e,!1);if(o)throw new Cr.ErrnoError(o);if(!t.node_ops.unlink)throw new Cr.ErrnoError(63);if(Cr.isMountpoint(n))throw new Cr.ErrnoError(10);t.node_ops.unlink(t,e),Cr.destroyNode(n)},readlink:r=>{var t=Cr.lookupPath(r).node;if(!t)throw new Cr.ErrnoError(44);if(!t.node_ops.readlink)throw new Cr.ErrnoError(28);return Ar.resolve(Cr.getPath(t.parent),t.node_ops.readlink(t))},stat:(r,t)=>{var e=Cr.lookupPath(r,{follow:!t}).node;if(!e)throw new Cr.ErrnoError(44);if(!e.node_ops.getattr)throw new Cr.ErrnoError(63);return e.node_ops.getattr(e)},lstat:r=>Cr.stat(r,!0),chmod:(r,t,e)=>{var n;"string"==typeof r?n=Cr.lookupPath(r,{follow:!e}).node:n=r;if(!n.node_ops.setattr)throw new Cr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(r,t)=>{Cr.chmod(r,t,!0)},fchmod:(r,t)=>{var e=Cr.getStream(r);if(!e)throw new Cr.ErrnoError(8);Cr.chmod(e.node,t)},chown:(r,t,e,n)=>{var o;"string"==typeof r?o=Cr.lookupPath(r,{follow:!n}).node:o=r;if(!o.node_ops.setattr)throw new Cr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(r,t,e)=>{Cr.chown(r,t,e,!0)},fchown:(r,t,e)=>{var n=Cr.getStream(r);if(!n)throw new Cr.ErrnoError(8);Cr.chown(n.node,t,e)},truncate:(r,t)=>{if(t<0)throw new Cr.ErrnoError(28);var e;"string"==typeof r?e=Cr.lookupPath(r,{follow:!0}).node:e=r;if(!e.node_ops.setattr)throw new Cr.ErrnoError(63);if(Cr.isDir(e.mode))throw new Cr.ErrnoError(31);if(!Cr.isFile(e.mode))throw new Cr.ErrnoError(28);var n=Cr.nodePermissions(e,"w");if(n)throw new Cr.ErrnoError(n);e.node_ops.setattr(e,{size:t,timestamp:Date.now()})},ftruncate:(r,t)=>{var e=Cr.getStream(r);if(!e)throw new Cr.ErrnoError(8);if(0==(2097155&e.flags))throw new Cr.ErrnoError(28);Cr.truncate(e.node,t)},utime:(r,t,e)=>{var n=Cr.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,e)})},open:(r,t,e,n,o)=>{if(""===r)throw new Cr.ErrnoError(44);var a;if(e=void 0===e?438:e,e=64&(t="string"==typeof t?Cr.modeStringToFlags(t):t)?4095&e|32768:0,"object"==typeof r)a=r;else{r=Mr.normalize(r);try{a=Cr.lookupPath(r,{follow:!(131072&t)}).node}catch(l){}}var i=!1;if(64&t)if(a){if(128&t)throw new Cr.ErrnoError(20)}else a=Cr.mknod(r,e,0),i=!0;if(!a)throw new Cr.ErrnoError(44);if(Cr.isChrdev(a.mode)&&(t&=-513),65536&t&&!Cr.isDir(a.mode))throw new Cr.ErrnoError(54);if(!i){var u=Cr.mayOpen(a,t);if(u)throw new Cr.ErrnoError(u)}512&t&&Cr.truncate(a,0),t&=-131713;var c=Cr.createStream({node:a,path:Cr.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,o);return c.stream_ops.open&&c.stream_ops.open(c),!s.logReadFiles||1&t||(Cr.readFiles||(Cr.readFiles={}),r in Cr.readFiles||(Cr.readFiles[r]=1)),c},close:r=>{if(Cr.isClosed(r))throw new Cr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(t){throw t}finally{Cr.closeStream(r.fd)}r.fd=null},isClosed:r=>null===r.fd,llseek:(r,t,e)=>{if(Cr.isClosed(r))throw new Cr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new Cr.ErrnoError(70);if(0!=e&&1!=e&&2!=e)throw new Cr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,t,e),r.ungotten=[],r.position},read:(r,t,e,n,o)=>{if(n<0||o<0)throw new Cr.ErrnoError(28);if(Cr.isClosed(r))throw new Cr.ErrnoError(8);if(1==(2097155&r.flags))throw new Cr.ErrnoError(8);if(Cr.isDir(r.node.mode))throw new Cr.ErrnoError(31);if(!r.stream_ops.read)throw new Cr.ErrnoError(28);var a=void 0!==o;if(a){if(!r.seekable)throw new Cr.ErrnoError(70)}else o=r.position;var i=r.stream_ops.read(r,t,e,n,o);return a||(r.position+=i),i},write:(r,t,e,n,o,a)=>{if(n<0||o<0)throw new Cr.ErrnoError(28);if(Cr.isClosed(r))throw new Cr.ErrnoError(8);if(0==(2097155&r.flags))throw new Cr.ErrnoError(8);if(Cr.isDir(r.node.mode))throw new Cr.ErrnoError(31);if(!r.stream_ops.write)throw new Cr.ErrnoError(28);r.seekable&&1024&r.flags&&Cr.llseek(r,0,2);var i=void 0!==o;if(i){if(!r.seekable)throw new Cr.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,t,e,n,o,a);return i||(r.position+=s),s},allocate:(r,t,e)=>{if(Cr.isClosed(r))throw new Cr.ErrnoError(8);if(t<0||e<=0)throw new Cr.ErrnoError(28);if(0==(2097155&r.flags))throw new Cr.ErrnoError(8);if(!Cr.isFile(r.node.mode)&&!Cr.isDir(r.node.mode))throw new Cr.ErrnoError(43);if(!r.stream_ops.allocate)throw new Cr.ErrnoError(138);r.stream_ops.allocate(r,t,e)},mmap:(r,t,e,n,o,a)=>{if(0!=(2&o)&&0==(2&a)&&2!=(2097155&r.flags))throw new Cr.ErrnoError(2);if(1==(2097155&r.flags))throw new Cr.ErrnoError(2);if(!r.stream_ops.mmap)throw new Cr.ErrnoError(43);return r.stream_ops.mmap(r,t,e,n,o,a)},msync:(r,t,e,n,o)=>r&&r.stream_ops.msync?r.stream_ops.msync(r,t,e,n,o):0,munmap:r=>0,ioctl:(r,t,e)=>{if(!r.stream_ops.ioctl)throw new Cr.ErrnoError(59);return r.stream_ops.ioctl(r,t,e)},readFile:(r,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var e,n=Cr.open(r,t.flags),o=Cr.stat(r).size,a=new Uint8Array(o);return Cr.read(n,a,0,o,0),"utf8"===t.encoding?e=L(a,0):"binary"===t.encoding&&(e=a),Cr.close(n),e},writeFile:(r,t,e={})=>{e.flags=e.flags||577;var n=Cr.open(r,e.flags,e.mode);if("string"==typeof t){var o=new Uint8Array(W(t)+1),a=Y(t,o,0,o.length);Cr.write(n,o,0,a,void 0,e.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Cr.write(n,t,0,t.byteLength,void 0,e.canOwn)}Cr.close(n)},cwd:()=>Cr.currentPath,chdir:r=>{var t=Cr.lookupPath(r,{follow:!0});if(null===t.node)throw new Cr.ErrnoError(44);if(!Cr.isDir(t.node.mode))throw new Cr.ErrnoError(54);var e=Cr.nodePermissions(t.node,"x");if(e)throw new Cr.ErrnoError(e);Cr.currentPath=t.path},createDefaultDirectories:()=>{Cr.mkdir("/tmp"),Cr.mkdir("/home"),Cr.mkdir("/home/web_user")},createDefaultDevices:()=>{Cr.mkdir("/dev"),Cr.registerDevice(Cr.makedev(1,3),{read:()=>0,write:(r,t,e,n,o)=>n}),Cr.mkdev("/dev/null",Cr.makedev(1,3)),Pr.register(Cr.makedev(5,0),Pr.default_tty_ops),Pr.register(Cr.makedev(6,0),Pr.default_tty1_ops),Cr.mkdev("/dev/tty",Cr.makedev(5,0)),Cr.mkdev("/dev/tty1",Cr.makedev(6,0));var r=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var r=new Uint8Array(1);return function(){return crypto.getRandomValues(r),r[0]}}if(E)try{var t=require("crypto");return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){ur("randomDevice")}}();Cr.createDevice("/dev","random",r),Cr.createDevice("/dev","urandom",r),Cr.mkdir("/dev/shm"),Cr.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{Cr.mkdir("/proc");var r=Cr.mkdir("/proc/self");Cr.mkdir("/proc/self/fd"),Cr.mount({mount:()=>{var t=Cr.createNode(r,"fd",16895,73);return t.node_ops={lookup:(r,t)=>{var e=+t,n=Cr.getStream(e);if(!n)throw new Cr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{s.stdin?Cr.createDevice("/dev","stdin",s.stdin):Cr.symlink("/dev/tty","/dev/stdin"),s.stdout?Cr.createDevice("/dev","stdout",null,s.stdout):Cr.symlink("/dev/tty","/dev/stdout"),s.stderr?Cr.createDevice("/dev","stderr",null,s.stderr):Cr.symlink("/dev/tty1","/dev/stderr");Cr.open("/dev/stdin",0),Cr.open("/dev/stdout",1),Cr.open("/dev/stderr",1)},ensureErrnoError:()=>{Cr.ErrnoError||(Cr.ErrnoError=function(r,t){this.node=t,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},Cr.ErrnoError.prototype=new Error,Cr.ErrnoError.prototype.constructor=Cr.ErrnoError,[44].forEach(r=>{Cr.genericErrors[r]=new Cr.ErrnoError(r),Cr.genericErrors[r].stack="<generic error, no stack>"}))},staticInit:()=>{Cr.ensureErrnoError(),Cr.nameTable=new Array(4096),Cr.mount(Tr,{},"/"),Cr.createDefaultDirectories(),Cr.createDefaultDevices(),Cr.createSpecialDirectories(),Cr.filesystems={MEMFS:Tr}},init:(r,t,e)=>{Cr.init.initialized=!0,Cr.ensureErrnoError(),s.stdin=r||s.stdin,s.stdout=t||s.stdout,s.stderr=e||s.stderr,Cr.createStandardStreams()},quit:()=>{Cr.init.initialized=!1;for(var r=0;r<Cr.streams.length;r++){var t=Cr.streams[r];t&&Cr.close(t)}},getMode:(r,t)=>{var e=0;return r&&(e|=365),t&&(e|=146),e},findObject:(r,t)=>{var e=Cr.analyzePath(r,t);return e.exists?e.object:null},analyzePath:(r,t)=>{try{r=(n=Cr.lookupPath(r,{follow:!t})).path}catch(o){}var e={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Cr.lookupPath(r,{parent:!0});e.parentExists=!0,e.parentPath=n.path,e.parentObject=n.node,e.name=Mr.basename(r),n=Cr.lookupPath(r,{follow:!t}),e.exists=!0,e.path=n.path,e.object=n.node,e.name=n.node.name,e.isRoot="/"===n.path}catch(o){e.error=o.errno}return e},createPath:(r,t,e,n)=>{r="string"==typeof r?r:Cr.getPath(r);for(var o=t.split("/").reverse();o.length;){var a=o.pop();if(a){var i=Mr.join2(r,a);try{Cr.mkdir(i)}catch(s){}r=i}}return i},createFile:(r,t,e,n,o)=>{var a=Mr.join2("string"==typeof r?r:Cr.getPath(r),t),i=Cr.getMode(n,o);return Cr.create(a,i)},createDataFile:(r,t,e,n,o,a)=>{var i=t;r&&(r="string"==typeof r?r:Cr.getPath(r),i=t?Mr.join2(r,t):r);var s=Cr.getMode(n,o),u=Cr.create(i,s);if(e){if("string"==typeof e){for(var c=new Array(e.length),l=0,f=e.length;l<f;++l)c[l]=e.charCodeAt(l);e=c}Cr.chmod(u,146|s);var d=Cr.open(u,577);Cr.write(d,e,0,e.length,0,a),Cr.close(d),Cr.chmod(u,s)}return u},createDevice:(r,t,e,n)=>{var o=Mr.join2("string"==typeof r?r:Cr.getPath(r),t),a=Cr.getMode(!!e,!!n);Cr.createDevice.major||(Cr.createDevice.major=64);var i=Cr.makedev(Cr.createDevice.major++,0);return Cr.registerDevice(i,{open:r=>{r.seekable=!1},close:r=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(r,t,n,o,a)=>{for(var i=0,s=0;s<o;s++){var u;try{u=e()}catch(c){throw new Cr.ErrnoError(29)}if(void 0===u&&0===i)throw new Cr.ErrnoError(6);if(null==u)break;i++,t[n+s]=u}return i&&(r.node.timestamp=Date.now()),i},write:(r,t,e,o,a)=>{for(var i=0;i<o;i++)try{n(t[e+i])}catch(s){throw new Cr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),i}}),Cr.mkdev(o,a,i)},forceLoadFile:r=>{if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!c)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=qr(c(r.url),!0),r.usedBytes=r.contents.length}catch(t){throw new Cr.ErrnoError(29)}},createLazyFile:(r,t,e,n,o)=>{function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(r){if(!(r>this.length-1||r<0)){var t=r%this.chunkSize,e=r/this.chunkSize|0;return this.getter(e)[t]}},a.prototype.setDataGetter=function(r){this.getter=r},a.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",e,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn't load "+e+". Status: "+r.status);var t,n=Number(r.getResponseHeader("Content-length")),o=(t=r.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=(t=r.getResponseHeader("Content-Encoding"))&&"gzip"===t,i=1048576;o||(i=n);var s=this;s.setDataGetter(r=>{var t=r*i,o=(r+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[r]&&(s.chunks[r]=((r,t)=>{if(r>t)throw new Error("invalid range ("+r+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",e,!1),n!==i&&o.setRequestHeader("Range","bytes="+r+"-"+t),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+e+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):qr(o.responseText||"",!0)})(t,o)),void 0===s.chunks[r])throw new Error("doXHR failed!");return s.chunks[r]}),!a&&n||(i=n=1,n=this.getter(0).length,i=n,k("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!_)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i=new a;Object.defineProperties(i,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:i}}else s={isDevice:!1,url:e};var u=Cr.createFile(r,t,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};return Object.keys(u.stream_ops).forEach(r=>{var t=u.stream_ops[r];c[r]=function(){return Cr.forceLoadFile(u),t.apply(null,arguments)}}),c.read=((r,t,e,n,o)=>{Cr.forceLoadFile(u);var a=r.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)t[e+s]=a[o+s];else for(s=0;s<i;s++)t[e+s]=a.get(o+s);return i}),u.stream_ops=c,u},createPreloadedFile:(r,t,e,n,o,a,i,s,u,c)=>{var l=t?Ar.resolve(Mr.join2(r,t)):r;ar("cp "+l);function f(e){function f(e){c&&c(),s||Cr.createDataFile(r,t,e,n,o,u),a&&a(),sr()}Browser.handledByPreloadPlugin(e,l,f,()=>{i&&i(),sr()})||f(e)}ir(),"string"==typeof e?xr(e,r=>f(r),i):f(e)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(r,t,e)=>{t=t||(()=>{}),e=e||(()=>{});var n=Cr.indexedDB();try{var o=n.open(Cr.DB_NAME(),Cr.DB_VERSION)}catch(a){return e(a)}o.onupgradeneeded=(()=>{k("creating db"),o.result.createObjectStore(Cr.DB_STORE_NAME)}),o.onsuccess=(()=>{var n=o.result.transaction([Cr.DB_STORE_NAME],"readwrite"),a=n.objectStore(Cr.DB_STORE_NAME),i=0,s=0,u=r.length;function c(){0==s?t():e()}r.forEach(r=>{var t=a.put(Cr.analyzePath(r).object.contents,r);t.onsuccess=(()=>{++i+s==u&&c()}),t.onerror=(()=>{i+ ++s==u&&c()})}),n.onerror=e}),o.onerror=e},loadFilesFromDB:(r,t,e)=>{t=t||(()=>{}),e=e||(()=>{});var n=Cr.indexedDB();try{var o=n.open(Cr.DB_NAME(),Cr.DB_VERSION)}catch(a){return e(a)}o.onupgradeneeded=e,o.onsuccess=(()=>{var n=o.result;try{var i=n.transaction([Cr.DB_STORE_NAME],"readonly")}catch(a){return void e(a)}var s=i.objectStore(Cr.DB_STORE_NAME),u=0,c=0,l=r.length;function f(){0==c?t():e()}r.forEach(r=>{var t=s.get(r);t.onsuccess=(()=>{Cr.analyzePath(r).exists&&Cr.unlink(r),Cr.createDataFile(Mr.dirname(r),Mr.basename(r),t.result,!0,!0,!0),++u+c==l&&f()}),t.onerror=(()=>{u+ ++c==l&&f()})}),i.onerror=e}),o.onerror=e}},Rr={mappings:{},DEFAULT_POLLMASK:5,calculateAt:function(r,t,e){if("/"===t[0])return t;var n;if(-100===r)n=Cr.cwd();else{var o=Cr.getStream(r);if(!o)throw new Cr.ErrnoError(8);n=o.path}if(0==t.length){if(!e)throw new Cr.ErrnoError(44);return n}return Mr.join2(n,t)},doStat:function(r,t,e){try{var n=r(t)}catch(o){if(o&&o.node&&Mr.normalize(t)!==Mr.normalize(Cr.getPath(o.node)))return-54;throw o}return I[e>>2]=n.dev,I[e+4>>2]=0,I[e+8>>2]=n.ino,I[e+12>>2]=n.mode,I[e+16>>2]=n.nlink,I[e+20>>2]=n.uid,I[e+24>>2]=n.gid,I[e+28>>2]=n.rdev,I[e+32>>2]=0,dr=[n.size>>>0,(fr=n.size,+Math.abs(fr)>=1?fr>0?(0|Math.min(+Math.floor(fr/4294967296),4294967295))>>>0:~~+Math.ceil((fr-+(~~fr>>>0))/4294967296)>>>0:0)],I[e+40>>2]=dr[0],I[e+44>>2]=dr[1],I[e+48>>2]=4096,I[e+52>>2]=n.blocks,I[e+56>>2]=n.atime.getTime()/1e3|0,I[e+60>>2]=0,I[e+64>>2]=n.mtime.getTime()/1e3|0,I[e+68>>2]=0,I[e+72>>2]=n.ctime.getTime()/1e3|0,I[e+76>>2]=0,dr=[n.ino>>>0,(fr=n.ino,+Math.abs(fr)>=1?fr>0?(0|Math.min(+Math.floor(fr/4294967296),4294967295))>>>0:~~+Math.ceil((fr-+(~~fr>>>0))/4294967296)>>>0:0)],I[e+80>>2]=dr[0],I[e+84>>2]=dr[1],0},doMsync:function(r,t,e,n,o){var a=B.slice(r,r+e);Cr.msync(t,a,o,e,n)},doMkdir:function(r,t){return"/"===(r=Mr.normalize(r))[r.length-1]&&(r=r.substr(0,r.length-1)),Cr.mkdir(r,t,0),0},doMknod:function(r,t,e){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return Cr.mknod(r,t,e),0},doReadlink:function(r,t,e){if(e<=0)return-28;var n=Cr.readlink(r),o=Math.min(e,W(n)),a=O[t+o];return q(n,t,e+1),O[t+o]=a,o},doAccess:function(r,t){if(-8&t)return-28;var e=Cr.lookupPath(r,{follow:!0}).node;if(!e)return-44;var n="";return 4&t&&(n+="r"),2&t&&(n+="w"),1&t&&(n+="x"),n&&Cr.nodePermissions(e,n)?-2:0},doDup:function(r,t,e){var n=Cr.getStream(e);return n&&Cr.close(n),Cr.open(r,t,0,e,e).fd},doReadv:function(r,t,e,n){for(var o=0,a=0;a<e;a++){var i=I[t+8*a>>2],s=I[t+(8*a+4)>>2],u=Cr.read(r,O,i,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o},doWritev:function(r,t,e,n){for(var o=0,a=0;a<e;a++){var i=I[t+8*a>>2],s=I[t+(8*a+4)>>2],u=Cr.write(r,O,i,s,n);if(u<0)return-1;o+=u}return o},varargs:void 0,get:function(){return Rr.varargs+=4,I[Rr.varargs-4>>2]},getStr:function(r){return H(r)},getStreamFromFD:function(r){var t=Cr.getStream(r);if(!t)throw new Cr.ErrnoError(8);return t},get64:function(r,t){return r}};var zr={};function Or(){if(!Or.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:v||"./this.program"};for(var t in zr)void 0===zr[t]?delete r[t]:r[t]=zr[t];var e=[];for(var t in r)e.push(t+"="+r[t]);Or.strings=e}return Or.strings}function Br(r){return r%4==0&&(r%100!=0||r%400==0)}function Nr(r,t){for(var e=0,n=0;n<=t;e+=r[n++]);return e}var Ir=[31,29,31,30,31,30,31,31,30,31,30,31],Ur=[31,28,31,30,31,30,31,31,30,31,30,31];function Lr(r,t){for(var e=new Date(r.getTime());t>0;){var n=Br(e.getFullYear()),o=e.getMonth(),a=(n?Ir:Ur)[o];if(!(t>a-e.getDate()))return e.setDate(e.getDate()+t),e;t-=a-e.getDate()+1,e.setDate(1),o<11?e.setMonth(o+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}function Hr(r,t,e,n){var o=I[n+40>>2],a={tm_sec:I[n>>2],tm_min:I[n+4>>2],tm_hour:I[n+8>>2],tm_mday:I[n+12>>2],tm_mon:I[n+16>>2],tm_year:I[n+20>>2],tm_wday:I[n+24>>2],tm_yday:I[n+28>>2],tm_isdst:I[n+32>>2],tm_gmtoff:I[n+36>>2],tm_zone:o?H(o):""},i=H(e),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)i=i.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function f(r,t,e){for(var n="number"==typeof r?r.toString():r||"";n.length<t;)n=e[0]+n;return n}function d(r,t){return f(r,t,"0")}function h(r,t){function e(r){return r<0?-1:r>0?1:0}var n;return 0===(n=e(r.getFullYear()-t.getFullYear()))&&0===(n=e(r.getMonth()-t.getMonth()))&&(n=e(r.getDate()-t.getDate())),n}function m(r){switch(r.getDay()){case 0:return new Date(r.getFullYear()-1,11,29);case 1:return r;case 2:return new Date(r.getFullYear(),0,3);case 3:return new Date(r.getFullYear(),0,2);case 4:return new Date(r.getFullYear(),0,1);case 5:return new Date(r.getFullYear()-1,11,31);case 6:return new Date(r.getFullYear()-1,11,30)}}function p(r){var t=Lr(new Date(r.tm_year+1900,0,1),r.tm_yday),e=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=m(e),a=m(n);return h(o,t)<=0?h(a,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var w={"%a":function(r){return c[r.tm_wday].substring(0,3)},"%A":function(r){return c[r.tm_wday]},"%b":function(r){return l[r.tm_mon].substring(0,3)},"%B":function(r){return l[r.tm_mon]},"%C":function(r){return d((r.tm_year+1900)/100|0,2)},"%d":function(r){return d(r.tm_mday,2)},"%e":function(r){return f(r.tm_mday,2," ")},"%g":function(r){return p(r).toString().substring(2)},"%G":function(r){return p(r)},"%H":function(r){return d(r.tm_hour,2)},"%I":function(r){var t=r.tm_hour;return 0==t?t=12:t>12&&(t-=12),d(t,2)},"%j":function(r){return d(r.tm_mday+Nr(Br(r.tm_year+1900)?Ir:Ur,r.tm_mon-1),3)},"%m":function(r){return d(r.tm_mon+1,2)},"%M":function(r){return d(r.tm_min,2)},"%n":function(){return"\n"},"%p":function(r){return r.tm_hour>=0&&r.tm_hour<12?"AM":"PM"},"%S":function(r){return d(r.tm_sec,2)},"%t":function(){return"\t"},"%u":function(r){return r.tm_wday||7},"%U":function(r){var t=new Date(r.tm_year+1900,0,1),e=0===t.getDay()?t:Lr(t,7-t.getDay()),n=new Date(r.tm_year+1900,r.tm_mon,r.tm_mday);if(h(e,n)<0){var o=Nr(Br(n.getFullYear())?Ir:Ur,n.getMonth()-1)-31,a=31-e.getDate()+o+n.getDate();return d(Math.ceil(a/7),2)}return 0===h(e,t)?"01":"00"},"%V":function(r){var t,e=new Date(r.tm_year+1900,0,4),n=new Date(r.tm_year+1901,0,4),o=m(e),a=m(n),i=Lr(new Date(r.tm_year+1900,0,1),r.tm_yday);return h(i,o)<0?"53":h(a,i)<=0?"01":(t=o.getFullYear()<r.tm_year+1900?r.tm_yday+32-o.getDate():r.tm_yday+1-o.getDate(),d(Math.ceil(t/7),2))},"%w":function(r){return r.tm_wday},"%W":function(r){var t=new Date(r.tm_year,0,1),e=1===t.getDay()?t:Lr(t,0===t.getDay()?1:7-t.getDay()+1),n=new Date(r.tm_year+1900,r.tm_mon,r.tm_mday);if(h(e,n)<0){var o=Nr(Br(n.getFullYear())?Ir:Ur,n.getMonth()-1)-31,a=31-e.getDate()+o+n.getDate();return d(Math.ceil(a/7),2)}return 0===h(e,t)?"01":"00"},"%y":function(r){return(r.tm_year+1900).toString().substring(2)},"%Y":function(r){return r.tm_year+1900},"%z":function(r){var t=r.tm_gmtoff,e=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(e?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(r){return r.tm_zone},"%%":function(){return"%"}};for(var u in w)i.includes(u)&&(i=i.replace(new RegExp(u,"g"),w[u](a)));var v=qr(i,!1);return v.length>t?0:(V(v,r),v.length-1)}var Yr=function(r,t,e,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=Cr.nextInode++,this.name=t,this.mode=e,this.node_ops={},this.stream_ops={},this.rdev=n};function qr(r,t,e){var n=e>0?e:W(r)+1,o=new Array(n),a=Y(r,o,0,o.length);return t&&(o.length=a),o}Object.defineProperties(Yr.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(r){r?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(r){r?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return Cr.isDir(this.mode)}},isDevice:{get:function(){return Cr.isChrdev(this.mode)}}}),Cr.FSNode=Yr,Cr.staticInit();var Wr,Gr={qa:function(r,t){return function(r,t){var e;if(0===r)e=Date.now();else{if(1!==r&&4!==r||!_r)return Er(28),-1;e=hr()}return I[t>>2]=e/1e3|0,I[t+4>>2]=e%1e3*1e3*1e3|0,0}(r,t)},k:function(r){return Vr(r+16)+16},q:function(r){var t=new kr(r),e=t.get_exception_info();return e.get_caught()||(e.set_caught(!0),Dr--),e.set_rethrown(!1),jr.push(t),function(r){r.add_ref()}(e),t.get_exception_ptr()},v:function(){Jr(0);var r=jr.pop();!function(r){if(r.release_ref()&&!r.get_rethrown()){var t=r.get_destructor();t&&yr(t)(r.excPtr),Fr(r.excPtr)}}(r.get_exception_info()),r.free(),Sr=0},b:function(){var r=Sr;if(!r)return F(0),0;var t=new br(r).get_type(),e=new kr;if(e.set_base_ptr(r),e.set_adjusted_ptr(r),!t)return F(0),0|e.ptr;for(var n=Array.prototype.slice.call(arguments),o=0;o<n.length;o++){var a=n[o];if(0===a||a===t)break;if(rt(a,t,e.get_adjusted_ptr_addr()))return F(a),0|e.ptr}return F(t),0|e.ptr},g:function(){var r=Sr;if(!r)return F(0),0;var t=new br(r).get_type(),e=new kr;if(e.set_base_ptr(r),e.set_adjusted_ptr(r),!t)return F(0),0|e.ptr;for(var n=Array.prototype.slice.call(arguments),o=0;o<n.length;o++){var a=n[o];if(0===a||a===t)break;if(rt(a,t,e.get_adjusted_ptr_addr()))return F(a),0|e.ptr}return F(t),0|e.ptr},B:function(){var r=Sr;if(!r)return F(0),0;var t=new br(r).get_type(),e=new kr;if(e.set_base_ptr(r),e.set_adjusted_ptr(r),!t)return F(0),0|e.ptr;for(var n=Array.prototype.slice.call(arguments),o=0;o<n.length;o++){var a=n[o];if(0===a||a===t)break;if(rt(a,t,e.get_adjusted_ptr_addr()))return F(a),0|e.ptr}return F(t),0|e.ptr},K:function(){var r=Sr;if(!r)return F(0),0;var t=new br(r).get_type(),e=new kr;if(e.set_base_ptr(r),e.set_adjusted_ptr(r),!t)return F(0),0|e.ptr;for(var n=Array.prototype.slice.call(arguments),o=0;o<n.length;o++){var a=n[o];if(0===a||a===t)break;if(rt(a,t,e.get_adjusted_ptr_addr()))return F(a),0|e.ptr}return F(t),0|e.ptr},m:Fr,V:function(){var r=jr.pop();r||ur("no exception to throw");var t=r.get_exception_info(),e=r.get_base_ptr();throw t.get_rethrown()?r.free():(jr.push(r),t.set_rethrown(!0),t.set_caught(!1),Dr++),Sr=e,e},s:function(r,t,e){throw new br(r).init(t,e),Sr=r,Dr++,r},na:function(){return Dr},c:function(r){var t=new kr(r),e=t.get_base_ptr();throw Sr||(Sr=e),t.free(),e},ya:function(r,t,e){try{var n=Rr.getStreamFromFD(r);return n.fd===t?-28:Rr.doDup(n.path,n.flags,t)}catch(o){if(void 0===Cr||!(o instanceof Cr.ErrnoError))throw o;return-o.errno}},I:function(r,t,e){Rr.varargs=e;try{var n=Rr.getStreamFromFD(r);switch(t){case 0:return(o=Rr.get())<0?-28:Cr.open(n.path,n.flags,0,o).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:var o=Rr.get();return n.flags|=o,0;case 5:return o=Rr.get(),N[o+0>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return Er(28),-1;default:return-28}}catch(a){if(void 0===Cr||!(a instanceof Cr.ErrnoError))throw a;return-a.errno}},Ba:function(r,t,e,n){try{t=Rr.getStr(t);var o=256&n,a=4096&n;return n&=-4353,t=Rr.calculateAt(r,t,a),Rr.doStat(o?Cr.lstat:Cr.stat,t,e)}catch(i){if(void 0===Cr||!(i instanceof Cr.ErrnoError))throw i;return-i.errno}},xa:function(r,t){try{if(0===t)return-28;var e=Cr.cwd();return t<W(e)+1?-68:(q(e,r,t),r)}catch(n){if(void 0===Cr||!(n instanceof Cr.ErrnoError))throw n;return-n.errno}},Aa:function(r,t,e){Rr.varargs=e;try{var n=Rr.getStreamFromFD(r);switch(t){case 21509:case 21505:return n.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=Rr.get();return I[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=Rr.get(),Cr.ioctl(n,t,o);case 21523:case 21524:return n.tty?0:-59;default:ur("bad ioctl syscall "+t)}}catch(a){if(void 0===Cr||!(a instanceof Cr.ErrnoError))throw a;return-a.errno}},P:function(r,t){try{return r=Rr.getStr(r),Rr.doStat(Cr.lstat,r,t)}catch(e){if(void 0===Cr||!(e instanceof Cr.ErrnoError))throw e;return-e.errno}},R:function(r,t,e){Rr.varargs=e;try{var n=Rr.getStr(r),o=e?Rr.get():0;return Cr.open(n,t,o).fd}catch(a){if(void 0===Cr||!(a instanceof Cr.ErrnoError))throw a;return-a.errno}},ta:function(r,t,e){try{return r=Rr.getStr(r),Rr.doReadlink(r,t,e)}catch(n){if(void 0===Cr||!(n instanceof Cr.ErrnoError))throw n;return-n.errno}},ra:function(r,t){try{return r=Rr.getStr(r),t=Rr.getStr(t),Cr.rename(r,t),0}catch(e){if(void 0===Cr||!(e instanceof Cr.ErrnoError))throw e;return-e.errno}},sa:function(r){try{return r=Rr.getStr(r),Cr.rmdir(r),0}catch(t){if(void 0===Cr||!(t instanceof Cr.ErrnoError))throw t;return-t.errno}},ua:function(r,t){try{return r=Rr.getStr(r),Rr.doStat(Cr.stat,r,t)}catch(e){if(void 0===Cr||!(e instanceof Cr.ErrnoError))throw e;return-e.errno}},O:function(r){try{return r=Rr.getStr(r),Cr.unlink(r),0}catch(t){if(void 0===Cr||!(t instanceof Cr.ErrnoError))throw t;return-t.errno}},oa:function(){throw"longjmp"},Ca:function(r,t){var e=new Date(1e3*I[r>>2]);I[t>>2]=e.getUTCSeconds(),I[t+4>>2]=e.getUTCMinutes(),I[t+8>>2]=e.getUTCHours(),I[t+12>>2]=e.getUTCDate(),I[t+16>>2]=e.getUTCMonth(),I[t+20>>2]=e.getUTCFullYear()-1900,I[t+24>>2]=e.getUTCDay();var n=Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0),o=(e.getTime()-n)/864e5|0;I[t+28>>2]=o},Da:function(r,t){var e=new Date(1e3*I[r>>2]);I[t>>2]=e.getSeconds(),I[t+4>>2]=e.getMinutes(),I[t+8>>2]=e.getHours(),I[t+12>>2]=e.getDate(),I[t+16>>2]=e.getMonth(),I[t+20>>2]=e.getFullYear()-1900,I[t+24>>2]=e.getDay();var n=new Date(e.getFullYear(),0,1),o=(e.getTime()-n.getTime())/864e5|0;I[t+28>>2]=o,I[t+36>>2]=-60*e.getTimezoneOffset();var a=new Date(e.getFullYear(),6,1).getTimezoneOffset(),i=n.getTimezoneOffset(),s=0|(a!=i&&e.getTimezoneOffset()==Math.min(i,a));I[t+32>>2]=s},Ea:function(r){var t=new Date(I[r+20>>2]+1900,I[r+16>>2],I[r+12>>2],I[r+8>>2],I[r+4>>2],I[r>>2],0),e=I[r+32>>2],n=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=Math.min(i,a);if(e<0)I[r+32>>2]=Number(a!=i&&s==n);else if(e>0!=(s==n)){var u=Math.max(i,a),c=e>0?s:u;t.setTime(t.getTime()+6e4*(c-n))}I[r+24>>2]=t.getDay();var l=(t.getTime()-o.getTime())/864e5|0;return I[r+28>>2]=l,I[r>>2]=t.getSeconds(),I[r+4>>2]=t.getMinutes(),I[r+8>>2]=t.getHours(),I[r+12>>2]=t.getDate(),I[r+16>>2]=t.getMonth(),t.getTime()/1e3|0},Fa:function r(t,e,n){r.called||(r.called=!0,function(r,t,e){var n=(new Date).getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),i=o.getTimezoneOffset(),s=a.getTimezoneOffset(),u=Math.max(i,s);function c(r){var t=r.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}I[r>>2]=60*u,I[t>>2]=Number(i!=s);var l=c(o),f=c(a),d=G(l),h=G(f);s<i?(I[e>>2]=d,I[e+4>>2]=h):(I[e>>2]=h,I[e+4>>2]=d)}(t,e,n))},G:function(){ur("")},S:function r(){return void 0===r.start&&(r.start=Date.now()),1e3*(Date.now()-r.start)|0},Ia:function(r,t){return r-t},pa:function(r){B.length,ur("OOM")},va:function(r,t){var e=0;return Or().forEach(function(n,o){var a=t+e;I[r+4*o>>2]=a,function(r,t,e){for(var n=0;n<r.length;++n)O[t++>>0]=r.charCodeAt(n);e||(O[t>>0]=0)}(n,a),e+=n.length+1}),0},wa:function(r,t){var e=Or();I[r>>2]=e.length;var n=0;return e.forEach(function(r){n+=r.length+1}),I[t>>2]=n,0},Ga:function(r){bt(r)},J:function(r){try{var t=Rr.getStreamFromFD(r);return Cr.close(t),0}catch(e){if(void 0===Cr||!(e instanceof Cr.ErrnoError))throw e;return e.errno}},za:function(r,t,e,n){try{var o=Rr.getStreamFromFD(r),a=Rr.doReadv(o,t,e);return I[n>>2]=a,0}catch(i){if(void 0===Cr||!(i instanceof Cr.ErrnoError))throw i;return i.errno}},Y:function(r,t,e,n,o){try{var a=Rr.getStreamFromFD(r),i=4294967296*e+(t>>>0);return i<=-9007199254740992||i>=9007199254740992?-61:(Cr.llseek(a,i,n),dr=[a.position>>>0,(fr=a.position,+Math.abs(fr)>=1?fr>0?(0|Math.min(+Math.floor(fr/4294967296),4294967295))>>>0:~~+Math.ceil((fr-+(~~fr>>>0))/4294967296)>>>0:0)],I[o>>2]=dr[0],I[o+4>>2]=dr[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0)}catch(s){if(void 0===Cr||!(s instanceof Cr.ErrnoError))throw s;return s.errno}},Q:function(r,t,e,n){try{var o=Rr.getStreamFromFD(r),a=Rr.doWritev(o,t,e);return I[n>>2]=a,0}catch(i){if(void 0===Cr||!(i instanceof Cr.ErrnoError))throw i;return i.errno}},a:function(){return M()},w:function(r,t){var e=$r();try{return yr(r)(t)}catch(n){if(Zr(e),n!==n+0&&"longjmp"!==n)throw n;Jr(1,0)}},L:function(r,t,e,n){var o=$r();try{return yr(r)(t,e,n)}catch(a){if(Zr(o),a!==a+0&&"longjmp"!==a)throw a;Jr(1,0)}},M:function(r,t,e,n){var o=$r();try{return yr(r)(t,e,n)}catch(a){if(Zr(o),a!==a+0&&"longjmp"!==a)throw a;Jr(1,0)}},r:function(r){var t=$r();try{return yr(r)()}catch(e){if(Zr(t),e!==e+0&&"longjmp"!==e)throw e;Jr(1,0)}},i:function(r,t){var e=$r();try{return yr(r)(t)}catch(n){if(Zr(e),n!==n+0&&"longjmp"!==n)throw n;Jr(1,0)}},d:function(r,t,e){var n=$r();try{return yr(r)(t,e)}catch(o){if(Zr(n),o!==o+0&&"longjmp"!==o)throw o;Jr(1,0)}},h:function(r,t,e,n){var o=$r();try{return yr(r)(t,e,n)}catch(a){if(Zr(o),a!==a+0&&"longjmp"!==a)throw a;Jr(1,0)}},j:function(r,t,e,n,o){var a=$r();try{return yr(r)(t,e,n,o)}catch(i){if(Zr(a),i!==i+0&&"longjmp"!==i)throw i;Jr(1,0)}},u:function(r,t,e,n,o,a){var i=$r();try{return yr(r)(t,e,n,o,a)}catch(s){if(Zr(i),s!==s+0&&"longjmp"!==s)throw s;Jr(1,0)}},x:function(r,t,e,n,o,a,i){var s=$r();try{return yr(r)(t,e,n,o,a,i)}catch(u){if(Zr(s),u!==u+0&&"longjmp"!==u)throw u;Jr(1,0)}},N:function(r,t,e,n,o,a,i,s){var u=$r();try{return yr(r)(t,e,n,o,a,i,s)}catch(c){if(Zr(u),c!==c+0&&"longjmp"!==c)throw c;Jr(1,0)}},La:function(r,t,e,n,o,a,i,s,u,c,l){var f=$r();try{return yr(r)(t,e,n,o,a,i,s,u,c,l)}catch(d){if(Zr(f),d!==d+0&&"longjmp"!==d)throw d;Jr(1,0)}},E:function(r,t,e,n,o,a,i,s,u,c,l,f){var d=$r();try{return yr(r)(t,e,n,o,a,i,s,u,c,l,f)}catch(h){if(Zr(d),h!==h+0&&"longjmp"!==h)throw h;Jr(1,0)}},T:function(r,t,e,n,o,a,i,s,u,c,l,f,d){var h=$r();try{return yr(r)(t,e,n,o,a,i,s,u,c,l,f,d)}catch(m){if(Zr(h),m!==m+0&&"longjmp"!==m)throw m;Jr(1,0)}},X:function(r,t,e,n,o,a,i,s,u){var c=$r();try{return vt(r,t,e,n,o,a,i,s,u)}catch(l){if(Zr(c),l!==l+0&&"longjmp"!==l)throw l;Jr(1,0)}},ia:function(r,t,e,n,o,a){var i=$r();try{return at(r,t,e,n,o,a)}catch(s){if(Zr(i),s!==s+0&&"longjmp"!==s)throw s;Jr(1,0)}},ha:function(r,t,e,n,o,a,i,s){var u=$r();try{return it(r,t,e,n,o,a,i,s)}catch(c){if(Zr(u),c!==c+0&&"longjmp"!==c)throw c;Jr(1,0)}},_:function(r,t,e,n){var o=$r();try{return pt(r,t,e,n)}catch(a){if(Zr(o),a!==a+0&&"longjmp"!==a)throw a;Jr(1,0)}},W:function(r,t,e,n,o){var a=$r();try{return gt(r,t,e,n,o)}catch(i){if(Zr(a),i!==i+0&&"longjmp"!==i)throw i;Jr(1,0)}},l:function(r){var t=$r();try{yr(r)()}catch(e){if(Zr(t),e!==e+0&&"longjmp"!==e)throw e;Jr(1,0)}},p:function(r,t){var e=$r();try{yr(r)(t)}catch(n){if(Zr(e),n!==n+0&&"longjmp"!==n)throw n;Jr(1,0)}},z:function(r,t,e){var n=$r();try{yr(r)(t,e)}catch(o){if(Zr(n),o!==o+0&&"longjmp"!==o)throw o;Jr(1,0)}},aa:function(r,t,e,n,o,a,i){var s=$r();try{ft(r,t,e,n,o,a,i)}catch(u){if(Zr(s),u!==u+0&&"longjmp"!==u)throw u;Jr(1,0)}},e:function(r,t,e){var n=$r();try{yr(r)(t,e)}catch(o){if(Zr(n),o!==o+0&&"longjmp"!==o)throw o;Jr(1,0)}},f:function(r,t,e,n){var o=$r();try{yr(r)(t,e,n)}catch(a){if(Zr(o),a!==a+0&&"longjmp"!==a)throw a;Jr(1,0)}},H:function(r,t,e,n,o,a,i,s,u,c,l,f){var d=$r();try{yr(r)(t,e,n,o,a,i,s,u,c,l,f)}catch(h){if(Zr(d),h!==h+0&&"longjmp"!==h)throw h;Jr(1,0)}},n:function(r,t,e,n,o){var a=$r();try{yr(r)(t,e,n,o)}catch(i){if(Zr(a),i!==i+0&&"longjmp"!==i)throw i;Jr(1,0)}},o:function(r,t,e,n,o,a){var i=$r();try{yr(r)(t,e,n,o,a)}catch(s){if(Zr(i),s!==s+0&&"longjmp"!==s)throw s;Jr(1,0)}},Ka:function(r,t,e,n,o,a,i){var s=$r();try{yr(r)(t,e,n,o,a,i)}catch(u){if(Zr(s),u!==u+0&&"longjmp"!==u)throw u;Jr(1,0)}},y:function(r,t,e,n,o,a,i,s){var u=$r();try{yr(r)(t,e,n,o,a,i,s)}catch(c){if(Zr(u),c!==c+0&&"longjmp"!==c)throw c;Jr(1,0)}},U:function(r,t,e,n,o,a,i,s,u){var c=$r();try{yr(r)(t,e,n,o,a,i,s,u)}catch(l){if(Zr(c),l!==l+0&&"longjmp"!==l)throw l;Jr(1,0)}},A:function(r,t,e,n,o,a,i,s,u,c,l){var f=$r();try{yr(r)(t,e,n,o,a,i,s,u,c,l)}catch(d){if(Zr(f),d!==d+0&&"longjmp"!==d)throw d;Jr(1,0)}},D:function(r,t,e,n,o,a,i,s,u,c,l,f,d,h,m,p){var w=$r();try{yr(r)(t,e,n,o,a,i,s,u,c,l,f,d,h,m,p)}catch(v){if(Zr(w),v!==v+0&&"longjmp"!==v)throw v;Jr(1,0)}},da:function(r,t,e,n,o,a,i){var s=$r();try{lt(r,t,e,n,o,a,i)}catch(u){if(Zr(s),u!==u+0&&"longjmp"!==u)throw u;Jr(1,0)}},ea:function(r,t,e,n,o,a,i,s){var u=$r();try{ct(r,t,e,n,o,a,i,s)}catch(c){if(Zr(u),c!==c+0&&"longjmp"!==c)throw c;Jr(1,0)}},ba:function(r,t,e,n,o,a,i,s,u){var c=$r();try{dt(r,t,e,n,o,a,i,s,u)}catch(l){if(Zr(c),l!==l+0&&"longjmp"!==l)throw l;Jr(1,0)}},ca:function(r,t,e,n,o,a,i,s,u,c,l,f){var d=$r();try{ht(r,t,e,n,o,a,i,s,u,c,l,f)}catch(h){if(Zr(d),h!==h+0&&"longjmp"!==h)throw h;Jr(1,0)}},ka:function(r,t,e,n,o,a,i,s){var u=$r();try{nt(r,t,e,n,o,a,i,s)}catch(c){if(Zr(u),c!==c+0&&"longjmp"!==c)throw c;Jr(1,0)}},fa:function(r,t,e,n,o,a,i,s,u){var c=$r();try{ut(r,t,e,n,o,a,i,s,u)}catch(l){if(Zr(c),l!==l+0&&"longjmp"!==l)throw l;Jr(1,0)}},ja:function(r,t,e,n,o,a,i,s,u,c){var l=$r();try{ot(r,t,e,n,o,a,i,s,u,c)}catch(f){if(Zr(l),f!==f+0&&"longjmp"!==f)throw f;Jr(1,0)}},$:function(r,t,e,n){var o=$r();try{mt(r,t,e,n)}catch(a){if(Zr(o),a!==a+0&&"longjmp"!==a)throw a;Jr(1,0)}},ga:function(r,t,e,n,o,a){var i=$r();try{st(r,t,e,n,o,a)}catch(s){if(Zr(i),s!==s+0&&"longjmp"!==s)throw s;Jr(1,0)}},Z:function(r,t,e,n,o,a,i){var s=$r();try{wt(r,t,e,n,o,a,i)}catch(u){if(Zr(s),u!==u+0&&"longjmp"!==u)throw u;Jr(1,0)}},la:function(r,t,e,n,o,a,i,s,u,c){var l=$r();try{et(r,t,e,n,o,a,i,s,u,c)}catch(f){if(Zr(l),f!==f+0&&"longjmp"!==f)throw f;Jr(1,0)}},t:function(r){return r},C:function(r){F(r)},Ja:Hr,ma:function(r,t,e,n){return Hr(r,t,e,n)},Ha:function(r){if(E){if(!r)return 1;var t=H(r);if(!t.length)return 0;var e=require("child_process").spawnSync(t,[],{shell:!0,stdio:"inherit"}),n=(r,t)=>r<<8|t;return null===e.status?n(0,(r=>{switch(r){case"SIGHUP":return 1;case"SIGINT":return 2;case"SIGQUIT":return 3;case"SIGFPE":return 8;case"SIGKILL":return 9;case"SIGALRM":return 14;case"SIGTERM":return 15}return 2})(e.signal)):n(e.status,0)}return r?(Er(52),-1):0},F:function(r){var t=Date.now()/1e3|0;return r&&(I[r>>2]=t),t}},Xr=(function(){var r={a:Gr};function t(r,t){var e,n,o=r.exports;s.asm=o,A=s.asm.Ma,e=A.buffer,z=e,s.HEAP8=O=new Int8Array(e),s.HEAP16=N=new Int16Array(e),s.HEAP32=I=new Int32Array(e),s.HEAPU8=B=new Uint8Array(e),s.HEAPU16=new Uint16Array(e),s.HEAPU32=new Uint32Array(e),s.HEAPF32=new Float32Array(e),s.HEAPF64=new Float64Array(e),K=s.asm.Qa,n=s.asm.Na,$.unshift(n),sr()}function e(r){t(r.instance)}function n(t){return function(){if(!D&&(y||_)){if("function"==typeof fetch&&!wr(cr))return fetch(cr,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+cr+"'";return r.arrayBuffer()}).catch(function(){return vr(cr)});if(l)return new Promise(function(r,t){l(cr,function(t){r(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return vr(cr)})}().then(function(t){return WebAssembly.instantiate(t,r)}).then(function(r){return r}).then(t,function(r){j("failed to asynchronously prepare wasm: "+r),ur(r)})}if(ir(),s.instantiateWasm)try{return s.instantiateWasm(r,t)}catch(o){return j("Module.instantiateWasm callback failed with error: "+o),!1}(D||"function"!=typeof WebAssembly.instantiateStreaming||pr(cr)||wr(cr)||"function"!=typeof fetch?n(e):fetch(cr,{credentials:"same-origin"}).then(function(t){return WebAssembly.instantiateStreaming(t,r).then(e,function(r){return j("wasm streaming compile failed: "+r),j("falling back to ArrayBuffer instantiation"),n(e)})})).catch(i)}(),s.___wasm_call_ctors=function(){return(s.___wasm_call_ctors=s.asm.Na).apply(null,arguments)},s._create_compile_result=function(){return(s._create_compile_result=s.asm.Oa).apply(null,arguments)},s._main=function(){return(s._main=s.asm.Pa).apply(null,arguments)},s._free=function(){return(Xr=s._free=s.asm.Ra).apply(null,arguments)}),Vr=s._malloc=function(){return(Vr=s._malloc=s.asm.Sa).apply(null,arguments)},Kr=s.___errno_location=function(){return(Kr=s.___errno_location=s.asm.Ta).apply(null,arguments)},Jr=s._setThrew=function(){return(Jr=s._setThrew=s.asm.Ua).apply(null,arguments)},$r=s.stackSave=function(){return($r=s.stackSave=s.asm.Va).apply(null,arguments)},Zr=s.stackRestore=function(){return(Zr=s.stackRestore=s.asm.Wa).apply(null,arguments)},Qr=s.stackAlloc=function(){return(Qr=s.stackAlloc=s.asm.Xa).apply(null,arguments)},rt=s.___cxa_can_catch=function(){return(rt=s.___cxa_can_catch=s.asm.Ya).apply(null,arguments)},tt=s.___cxa_is_pointer_type=function(){return(tt=s.___cxa_is_pointer_type=s.asm.Za).apply(null,arguments)},et=s.dynCall_vijjjj=function(){return(et=s.dynCall_vijjjj=s.asm._a).apply(null,arguments)},nt=s.dynCall_viijji=function(){return(nt=s.dynCall_viijji=s.asm.$a).apply(null,arguments)},ot=s.dynCall_viijjiii=function(){return(ot=s.dynCall_viijjiii=s.asm.ab).apply(null,arguments)},at=s.dynCall_iijj=function(){return(at=s.dynCall_iijj=s.asm.bb).apply(null,arguments)},it=s.dynCall_iijjii=function(){return(it=s.dynCall_iijjii=s.asm.cb).apply(null,arguments)},st=s.dynCall_vijj=function(){return(st=s.dynCall_vijj=s.asm.db).apply(null,arguments)},ut=s.dynCall_viijjii=function(){return(ut=s.dynCall_viijjii=s.asm.eb).apply(null,arguments)},ct=s.dynCall_viijjd=function(){return(ct=s.dynCall_viijjd=s.asm.fb).apply(null,arguments)},lt=s.dynCall_viijj=function(){return(lt=s.dynCall_viijj=s.asm.gb).apply(null,arguments)},ft=s.dynCall_vidjj=function(){return(ft=s.dynCall_vidjj=s.asm.hb).apply(null,arguments)},dt=s.dynCall_viijjdi=function(){return(dt=s.dynCall_viijjdi=s.asm.ib).apply(null,arguments)},ht=s.dynCall_viijjdjj=function(){return(ht=s.dynCall_viijjdjj=s.asm.jb).apply(null,arguments)},mt=s.dynCall_vij=function(){return(mt=s.dynCall_vij=s.asm.kb).apply(null,arguments)},pt=s.dynCall_jiii=function(){return(pt=s.dynCall_jiii=s.asm.lb).apply(null,arguments)},wt=s.dynCall_vijji=function(){return(wt=s.dynCall_vijji=s.asm.mb).apply(null,arguments)},vt=s.dynCall_iiiiijj=function(){return(vt=s.dynCall_iiiiijj=s.asm.nb).apply(null,arguments)},gt=s.dynCall_jiiii=function(){return(gt=s.dynCall_jiiii=s.asm.ob).apply(null,arguments)};function yt(r){this.name="ExitStatus",this.message="Program terminated with exit("+r+")",this.status=r}s.cwrap=function(r,t,e,n){var o=(e=e||[]).every(function(r){return"number"===r});return"string"!==t&&o&&!n?C(r):function(){return R(r,t,e,arguments)}},s.UTF8ToString=H,s.FS=Cr;function _t(r){var t=s._main,e=(r=r||[]).length+1,n=Qr(4*(e+1));I[n>>2]=X(v);for(var o=1;o<e;o++)I[(n>>2)+o]=X(r[o-1]);I[(n>>2)+e]=0;try{var a=t(e,n);return bt(a,!0),a}catch(i){return function(r){if(r instanceof yt||"unwind"==r)return T;g(1,r)}(i)}finally{!0}}function Et(r){function t(){Wr||(Wr=!0,s.calledRun=!0,x||(!0,s.noFSInit||Cr.init.initialized||Cr.init(),Cr.ignorePermissions=!1,Pr.init(),gr($),gr(Z),a(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),kt&&_t(r),function(){if(s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;)r=s.postRun.shift(),Q.unshift(r);var r;gr(Q)}()))}r=r||w,er>0||(!function(){if(s.preRun)for("function"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)r=s.preRun.shift(),J.unshift(r);var r;gr(J)}(),er>0||(s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),t()},1)):t()))}function bt(r,t){T=r,tr()||!0,function(r){T=r,tr()||(s.onExit&&s.onExit(r),x=!0);g(r,new yt(r))}(r)}if(or=function r(){Wr||Et(),Wr||(or=r)},s.run=Et,s.preInit)for("function"==typeof s.preInit&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();var kt=!0;return s.noInitialRun&&(kt=!1),Et(),t.ready}})();"object"==typeof exports&&"object"==typeof module?module.exports=a:"function"==typeof r&&r.amd?r([],function(){return a}):"object"==typeof exports&&(exports.startWerckmeisterJs=a);
490
+ var r,t="/home/runner/work/werckmeister-component/werckmeister-component/node_modules/@werckmeister/compilerjs/werckmeister.js",e=require("process"),n="/home/runner/work/werckmeister-component/werckmeister-component/node_modules/@werckmeister/compilerjs",o=require("buffer").Buffer,a=(()=>{var r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return void 0!==t&&(r=r||t),function(t){var a,i,s=void 0!==(t=t||{})?t:{};s.ready=new Promise(function(r,t){a=r,i=t});var u,c,f,l,d,h,m=Object.assign({},s),p=[],w="./this.program",v=(r,t)=>{throw t},y="object"==typeof window,g="function"==typeof importScripts,_="object"==typeof e&&"object"==typeof e.versions&&"string"==typeof e.versions.node,E="";_?(E=g?require("path").dirname(E)+"/":n+"/",h=(()=>{d||(l=require("fs"),d=require("path"))}),u=function(r,t){return h(),r=d.normalize(r),l.readFileSync(r,t?void 0:"utf8")},f=(r=>{var t=u(r,!0);return t.buffer||(t=new Uint8Array(t)),t}),c=((r,t,e)=>{h(),r=d.normalize(r),l.readFile(r,function(r,n){r?e(r):t(n.buffer)})}),e.argv.length>1&&(w=e.argv[1].replace(/\\/g,"/")),p=e.argv.slice(2),e.on("uncaughtException",function(r){if(!(r instanceof yt))throw r}),e.on("unhandledRejection",function(r){throw r}),v=((r,t)=>{if(rr())throw e.exitCode=r,t;!function(r){if(r instanceof yt)return;k("exiting due to exception: "+r)}(t),e.exit(r)}),s.inspect=function(){return"[Emscripten Module object]"}):(y||g)&&(g?E=self.location.href:"undefined"!=typeof document&&document.currentScript&&(E=document.currentScript.src),r&&(E=r),E=0!==E.indexOf("blob:")?E.substr(0,E.replace(/[?#].*/,"").lastIndexOf("/")+1):"",u=(r=>{var t=new XMLHttpRequest;return t.open("GET",r,!1),t.send(null),t.responseText}),g&&(f=(r=>{var t=new XMLHttpRequest;return t.open("GET",r,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)})),c=((r,t,e)=>{var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=(()=>{200==n.status||0==n.status&&n.response?t(n.response):e()}),n.onerror=e,n.send(null)}));var b=s.print||console.log.bind(console),k=s.printErr||console.warn.bind(console);Object.assign(s,m),m=null,s.arguments&&(p=s.arguments),s.thisProgram&&(w=s.thisProgram),s.quit&&(v=s.quit);var D,S=0,j=r=>{S=r},F=()=>S;s.wasmBinary&&(D=s.wasmBinary);var M,A=s.noExitRuntime||!0;"object"!=typeof WebAssembly&&sr("no native wasm support detected");var P,T=!1;function x(r){return s["_"+r]}function C(r,t,e,n,o){var a={string:function(r){var t=0;if(null!=r&&0!==r){var e=1+(r.length<<2);Y(r,t=Zr(e),e)}return t},array:function(r){var t=Zr(r.length);return X(r,t),t}};var i=x(r),s=[],u=0;if(n)for(var c=0;c<n.length;c++){var f=a[e[c]];f?(0===u&&(u=Jr()),s[c]=f(n[c])):s[c]=n[c]}var l=i.apply(null,s);return l=function(r){return 0!==u&&$r(u),function(r){return"string"===t?L(r):"boolean"===t?Boolean(r):r}(r)}(l)}var R,O,z,B,N,I="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function U(r,t,e){for(var n=t+e,o=t;r[o]&&!(o>=n);)++o;if(o-t>16&&r.subarray&&I)return I.decode(r.subarray(t,o));for(var a="";t<o;){var i=r[t++];if(128&i){var s=63&r[t++];if(192!=(224&i)){var u=63&r[t++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&r[t++])<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a}function L(r,t){return r?U(z,r,t):""}function H(r,t,e,n){if(!(n>0))return 0;for(var o=e,a=e+n-1,i=0;i<r.length;++i){var s=r.charCodeAt(i);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&r.charCodeAt(++i);if(s<=127){if(e>=a)break;t[e++]=s}else if(s<=2047){if(e+1>=a)break;t[e++]=192|s>>6,t[e++]=128|63&s}else if(s<=65535){if(e+2>=a)break;t[e++]=224|s>>12,t[e++]=128|s>>6&63,t[e++]=128|63&s}else{if(e+3>=a)break;t[e++]=240|s>>18,t[e++]=128|s>>12&63,t[e++]=128|s>>6&63,t[e++]=128|63&s}}return t[e]=0,e-o}function Y(r,t,e){return H(r,z,t,e)}function q(r){for(var t=0,e=0;e<r.length;++e){var n=r.charCodeAt(e);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&r.charCodeAt(++e)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}function W(r){var t=q(r)+1,e=Xr(t);return e&&H(r,O,e,t),e}function G(r){var t=q(r)+1,e=Zr(t);return H(r,O,e,t),e}function X(r,t){O.set(r,t)}s.INITIAL_MEMORY;var V,K=[],J=[],$=[],Z=[],Q=0;function rr(){return A||Q>0}var tr=0,er=null,nr=null;function or(r){return r}function ar(r){tr++,s.monitorRunDependencies&&s.monitorRunDependencies(tr)}function ir(r){if(tr--,s.monitorRunDependencies&&s.monitorRunDependencies(tr),0==tr&&(null!==er&&(clearInterval(er),er=null),nr)){var t=nr;nr=null,t()}}function sr(r){s.onAbort&&s.onAbort(r),k(r="Aborted("+r+")"),T=!0,P=1,r+=". Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(r);throw i(t),t}s.preloadedImages={},s.preloadedAudios={};var ur,cr,fr,lr,dr,hr="data:application/octet-stream;base64,";function mr(r){return r.startsWith(hr)}function pr(r){return r.startsWith("file://")}function wr(r){try{if(r==ur&&D)return new Uint8Array(D);if(f)return f(r);throw"both async and sync fetching of the wasm failed"}catch(k){sr(k)}}function vr(r){for(;r.length>0;){var t=r.shift();if("function"!=typeof t){var e=t.func;"number"==typeof e?void 0===t.arg?yr(e)():yr(e)(t.arg):e(void 0===t.arg?null:t.arg)}else t(s)}}function yr(r){return V.get(r)}mr(ur="werckmeister.wasm")||(cr=ur,ur=s.locateFile?s.locateFile(cr,E):E+cr),dr=_?()=>{var r=e.hrtime();return 1e3*r[0]+r[1]/1e6}:()=>performance.now();var gr=!0;function _r(r){return N[Vr()>>2]=r,r}function Er(r){this.excPtr=r,this.ptr=r-16,this.set_type=function(r){N[this.ptr+4>>2]=r},this.get_type=function(){return N[this.ptr+4>>2]},this.set_destructor=function(r){N[this.ptr+8>>2]=r},this.get_destructor=function(){return N[this.ptr+8>>2]},this.set_refcount=function(r){N[this.ptr>>2]=r},this.set_caught=function(r){r=r?1:0,O[this.ptr+12>>0]=r},this.get_caught=function(){return 0!=O[this.ptr+12>>0]},this.set_rethrown=function(r){r=r?1:0,O[this.ptr+13>>0]=r},this.get_rethrown=function(){return 0!=O[this.ptr+13>>0]},this.init=function(r,t){this.set_type(r),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var r=N[this.ptr>>2];N[this.ptr>>2]=r+1},this.release_ref=function(){var r=N[this.ptr>>2];return N[this.ptr>>2]=r-1,1===r}}function br(r){this.free=function(){Gr(this.ptr),this.ptr=0},this.set_base_ptr=function(r){N[this.ptr>>2]=r},this.get_base_ptr=function(){return N[this.ptr>>2]},this.set_adjusted_ptr=function(r){N[this.ptr+4>>2]=r},this.get_adjusted_ptr_addr=function(){return this.ptr+4},this.get_adjusted_ptr=function(){return N[this.ptr+4>>2]},this.get_exception_ptr=function(){if(rt(this.get_exception_info().get_type()))return N[this.get_base_ptr()>>2];var r=this.get_adjusted_ptr();return 0!==r?r:this.get_base_ptr()},this.get_exception_info=function(){return new Er(this.get_base_ptr())},void 0===r?(this.ptr=Xr(8),this.set_adjusted_ptr(0)):this.ptr=r}var kr=[];var Dr=0;var Sr=0;function jr(r){try{return Gr(new Er(r).ptr)}catch(t){}}var Fr={splitPath:function(r){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(r).slice(1)},normalizeArray:function(r,t){for(var e=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),e++):e&&(r.splice(n,1),e--)}if(t)for(;e;e--)r.unshift("..");return r},normalize:function(r){var t="/"===r.charAt(0),e="/"===r.substr(-1);return(r=Fr.normalizeArray(r.split("/").filter(function(r){return!!r}),!t).join("/"))||t||(r="."),r&&e&&(r+="/"),(t?"/":"")+r},dirname:function(r){var t=Fr.splitPath(r),e=t[0],n=t[1];return e||n?(n&&(n=n.substr(0,n.length-1)),e+n):"."},basename:function(r){if("/"===r)return"/";var t=(r=(r=Fr.normalize(r)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?r:r.substr(t+1)},extname:function(r){return Fr.splitPath(r)[3]},join:function(){var r=Array.prototype.slice.call(arguments,0);return Fr.normalize(r.join("/"))},join2:function(r,t){return Fr.normalize(r+"/"+t)}};var Mr={resolve:function(){for(var r="",t=!1,e=arguments.length-1;e>=-1&&!t;e--){var n=e>=0?arguments[e]:xr.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,t="/"===n.charAt(0)}return(t?"/":"")+(r=Fr.normalizeArray(r.split("/").filter(function(r){return!!r}),!t).join("/"))||"."},relative:function(r,t){function e(r){for(var t=0;t<r.length&&""===r[t];t++);for(var e=r.length-1;e>=0&&""===r[e];e--);return t>e?[]:r.slice(t,e-t+1)}r=Mr.resolve(r).substr(1),t=Mr.resolve(t).substr(1);for(var n=e(r.split("/")),o=e(t.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(i))).join("/")}},Ar={ttys:[],init:function(){},shutdown:function(){},register:function(r,t){Ar.ttys[r]={input:[],output:[],ops:t},xr.registerDevice(r,Ar.stream_ops)},stream_ops:{open:function(r){var t=Ar.ttys[r.node.rdev];if(!t)throw new xr.ErrnoError(43);r.tty=t,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,t,e,n,o){if(!r.tty||!r.tty.ops.get_char)throw new xr.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(u){throw new xr.ErrnoError(29)}if(void 0===s&&0===a)throw new xr.ErrnoError(6);if(null==s)break;a++,t[e+i]=s}return a&&(r.node.timestamp=Date.now()),a},write:function(r,t,e,n,o){if(!r.tty||!r.tty.ops.put_char)throw new xr.ErrnoError(60);try{for(var a=0;a<n;a++)r.tty.ops.put_char(r.tty,t[e+a])}catch(i){throw new xr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:function(r){if(!r.input.length){var t=null;if(_){var n=o.alloc(256),a=0;try{a=l.readSync(e.stdin.fd,n,0,256,-1)}catch(i){if(!i.toString().includes("EOF"))throw i;a=0}t=a>0?n.slice(0,a).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;r.input=Yr(t,!0)}return r.input.shift()},put_char:function(r,t){null===t||10===t?(b(U(r.output,0)),r.output=[]):0!=t&&r.output.push(t)},flush:function(r){r.output&&r.output.length>0&&(b(U(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,t){null===t||10===t?(k(U(r.output,0)),r.output=[]):0!=t&&r.output.push(t)},flush:function(r){r.output&&r.output.length>0&&(k(U(r.output,0)),r.output=[])}}};var Pr={ops_table:null,mount:function(r){return Pr.createNode(null,"/",16895,0)},createNode:function(r,t,e,n){if(xr.isBlkdev(e)||xr.isFIFO(e))throw new xr.ErrnoError(63);Pr.ops_table||(Pr.ops_table={dir:{node:{getattr:Pr.node_ops.getattr,setattr:Pr.node_ops.setattr,lookup:Pr.node_ops.lookup,mknod:Pr.node_ops.mknod,rename:Pr.node_ops.rename,unlink:Pr.node_ops.unlink,rmdir:Pr.node_ops.rmdir,readdir:Pr.node_ops.readdir,symlink:Pr.node_ops.symlink},stream:{llseek:Pr.stream_ops.llseek}},file:{node:{getattr:Pr.node_ops.getattr,setattr:Pr.node_ops.setattr},stream:{llseek:Pr.stream_ops.llseek,read:Pr.stream_ops.read,write:Pr.stream_ops.write,allocate:Pr.stream_ops.allocate,mmap:Pr.stream_ops.mmap,msync:Pr.stream_ops.msync}},link:{node:{getattr:Pr.node_ops.getattr,setattr:Pr.node_ops.setattr,readlink:Pr.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Pr.node_ops.getattr,setattr:Pr.node_ops.setattr},stream:xr.chrdev_stream_ops}});var o=xr.createNode(r,t,e,n);return xr.isDir(o.mode)?(o.node_ops=Pr.ops_table.dir.node,o.stream_ops=Pr.ops_table.dir.stream,o.contents={}):xr.isFile(o.mode)?(o.node_ops=Pr.ops_table.file.node,o.stream_ops=Pr.ops_table.file.stream,o.usedBytes=0,o.contents=null):xr.isLink(o.mode)?(o.node_ops=Pr.ops_table.link.node,o.stream_ops=Pr.ops_table.link.stream):xr.isChrdev(o.mode)&&(o.node_ops=Pr.ops_table.chrdev.node,o.stream_ops=Pr.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[t]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,t){var e=r.contents?r.contents.length:0;if(!(e>=t)){t=Math.max(t,e*(e<1048576?2:1.125)>>>0),0!=e&&(t=Math.max(t,256));var n=r.contents;r.contents=new Uint8Array(t),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,t){if(r.usedBytes!=t)if(0==t)r.contents=null,r.usedBytes=0;else{var e=r.contents;r.contents=new Uint8Array(t),e&&r.contents.set(e.subarray(0,Math.min(t,r.usedBytes))),r.usedBytes=t}},node_ops:{getattr:function(r){var t={};return t.dev=xr.isChrdev(r.mode)?r.id:1,t.ino=r.id,t.mode=r.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=r.rdev,xr.isDir(r.mode)?t.size=4096:xr.isFile(r.mode)?t.size=r.usedBytes:xr.isLink(r.mode)?t.size=r.link.length:t.size=0,t.atime=new Date(r.timestamp),t.mtime=new Date(r.timestamp),t.ctime=new Date(r.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(r,t){void 0!==t.mode&&(r.mode=t.mode),void 0!==t.timestamp&&(r.timestamp=t.timestamp),void 0!==t.size&&Pr.resizeFileStorage(r,t.size)},lookup:function(r,t){throw xr.genericErrors[44]},mknod:function(r,t,e,n){return Pr.createNode(r,t,e,n)},rename:function(r,t,e){if(xr.isDir(r.mode)){var n;try{n=xr.lookupNode(t,e)}catch(a){}if(n)for(var o in n.contents)throw new xr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=e,t.contents[e]=r,t.timestamp=r.parent.timestamp,r.parent=t},unlink:function(r,t){delete r.contents[t],r.timestamp=Date.now()},rmdir:function(r,t){var e=xr.lookupNode(r,t);for(var n in e.contents)throw new xr.ErrnoError(55);delete r.contents[t],r.timestamp=Date.now()},readdir:function(r){var t=[".",".."];for(var e in r.contents)r.contents.hasOwnProperty(e)&&t.push(e);return t},symlink:function(r,t,e){var n=Pr.createNode(r,t,41471,0);return n.link=e,n},readlink:function(r){if(!xr.isLink(r.mode))throw new xr.ErrnoError(28);return r.link}},stream_ops:{read:function(r,t,e,n,o){var a=r.node.contents;if(o>=r.node.usedBytes)return 0;var i=Math.min(r.node.usedBytes-o,n);if(i>8&&a.subarray)t.set(a.subarray(o,o+i),e);else for(var s=0;s<i;s++)t[e+s]=a[o+s];return i},write:function(r,t,e,n,o,a){if(!n)return 0;var i=r.node;if(i.timestamp=Date.now(),t.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=t.subarray(e,e+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=t.slice(e,e+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(t.subarray(e,e+n),o),n}if(Pr.expandFileStorage(i,o+n),i.contents.subarray&&t.subarray)i.contents.set(t.subarray(e,e+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=t[e+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek:function(r,t,e){var n=t;if(1===e?n+=r.position:2===e&&xr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new xr.ErrnoError(28);return n},allocate:function(r,t,e){Pr.expandFileStorage(r.node,t+e),r.node.usedBytes=Math.max(r.node.usedBytes,t+e)},mmap:function(r,t,e,n,o,a){if(0!==t)throw new xr.ErrnoError(28);if(!xr.isFile(r.node.mode))throw new xr.ErrnoError(43);var i,s,u=r.node.contents;if(2&a||u.buffer!==R){if((n>0||n+e<u.length)&&(u=u.subarray?u.subarray(n,n+e):Array.prototype.slice.call(u,n,n+e)),s=!0,!(i=void sr()))throw new xr.ErrnoError(48);O.set(u,i)}else s=!1,i=u.byteOffset;return{ptr:i,allocated:s}},msync:function(r,t,e,n,o){if(!xr.isFile(r.node.mode))throw new xr.ErrnoError(43);if(2&o)return 0;Pr.stream_ops.write(r,t,0,n,e,!1);return 0}}};function Tr(r,t,e,n){var o=n?"":or("al "+r);c(r,function(e){var n;n='Loading data file "'+r+'" failed (no arrayBuffer).',e||sr(n),t(new Uint8Array(e)),o&&ir()},function(t){if(!e)throw'Loading data file "'+r+'" failed.';e()}),o&&ar()}var xr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(r,t={})=>{if(!(r=Mr.resolve(xr.cwd(),r)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new xr.ErrnoError(32);for(var e=Fr.normalizeArray(r.split("/").filter(r=>!!r),!1),n=xr.root,o="/",a=0;a<e.length;a++){var i=a===e.length-1;if(i&&t.parent)break;if(n=xr.lookupNode(n,e[a]),o=Fr.join2(o,e[a]),xr.isMountpoint(n)&&(!i||i&&t.follow_mount)&&(n=n.mounted.root),!i||t.follow)for(var s=0;xr.isLink(n.mode);){var u=xr.readlink(o);if(o=Mr.resolve(Fr.dirname(o),u),n=xr.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new xr.ErrnoError(32)}}return{path:o,node:n}},getPath:r=>{for(var t;;){if(xr.isRoot(r)){var e=r.mount.mountpoint;return t?"/"!==e[e.length-1]?e+"/"+t:e+t:e}t=t?r.name+"/"+t:r.name,r=r.parent}},hashName:(r,t)=>{for(var e=0,n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n)|0;return(r+e>>>0)%xr.nameTable.length},hashAddNode:r=>{var t=xr.hashName(r.parent.id,r.name);r.name_next=xr.nameTable[t],xr.nameTable[t]=r},hashRemoveNode:r=>{var t=xr.hashName(r.parent.id,r.name);if(xr.nameTable[t]===r)xr.nameTable[t]=r.name_next;else for(var e=xr.nameTable[t];e;){if(e.name_next===r){e.name_next=r.name_next;break}e=e.name_next}},lookupNode:(r,t)=>{var e=xr.mayLookup(r);if(e)throw new xr.ErrnoError(e,r);for(var n=xr.hashName(r.id,t),o=xr.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===r.id&&a===t)return o}return xr.lookup(r,t)},createNode:(r,t,e,n)=>{var o=new xr.FSNode(r,t,e,n);return xr.hashAddNode(o),o},destroyNode:r=>{xr.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>32768==(61440&r),isDir:r=>16384==(61440&r),isLink:r=>40960==(61440&r),isChrdev:r=>8192==(61440&r),isBlkdev:r=>24576==(61440&r),isFIFO:r=>4096==(61440&r),isSocket:r=>49152==(49152&r),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:r=>{var t=xr.flagModes[r];if(void 0===t)throw new Error("Unknown file open mode: "+r);return t},flagsToPermissionString:r=>{var t=["r","w","rw"][3&r];return 512&r&&(t+="w"),t},nodePermissions:(r,t)=>xr.ignorePermissions?0:(!t.includes("r")||292&r.mode)&&(!t.includes("w")||146&r.mode)&&(!t.includes("x")||73&r.mode)?0:2,mayLookup:r=>{var t=xr.nodePermissions(r,"x");return t||(r.node_ops.lookup?0:2)},mayCreate:(r,t)=>{try{xr.lookupNode(r,t);return 20}catch(e){}return xr.nodePermissions(r,"wx")},mayDelete:(r,t,e)=>{var n;try{n=xr.lookupNode(r,t)}catch(a){return a.errno}var o=xr.nodePermissions(r,"wx");if(o)return o;if(e){if(!xr.isDir(n.mode))return 54;if(xr.isRoot(n)||xr.getPath(n)===xr.cwd())return 10}else if(xr.isDir(n.mode))return 31;return 0},mayOpen:(r,t)=>r?xr.isLink(r.mode)?32:xr.isDir(r.mode)&&("r"!==xr.flagsToPermissionString(t)||512&t)?31:xr.nodePermissions(r,xr.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(r=0,t=xr.MAX_OPEN_FDS)=>{for(var e=r;e<=t;e++)if(!xr.streams[e])return e;throw new xr.ErrnoError(33)},getStream:r=>xr.streams[r],createStream:(r,t,e)=>{xr.FSStream||(xr.FSStream=function(){},xr.FSStream.prototype={object:{get:function(){return this.node},set:function(r){this.node=r}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}}),r=Object.assign(new xr.FSStream,r);var n=xr.nextfd(t,e);return r.fd=n,xr.streams[n]=r,r},closeStream:r=>{xr.streams[r]=null},chrdev_stream_ops:{open:r=>{var t=xr.getDevice(r.node.rdev);r.stream_ops=t.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:()=>{throw new xr.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,t)=>r<<8|t,registerDevice:(r,t)=>{xr.devices[r]={stream_ops:t}},getDevice:r=>xr.devices[r],getMounts:r=>{for(var t=[],e=[r];e.length;){var n=e.pop();t.push(n),e.push.apply(e,n.mounts)}return t},syncfs:(r,t)=>{"function"==typeof r&&(t=r,r=!1),xr.syncFSRequests++,xr.syncFSRequests>1&&k("warning: "+xr.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var e=xr.getMounts(xr.root.mount),n=0;function o(r){return xr.syncFSRequests--,t(r)}function a(r){if(r)return a.errored?void 0:(a.errored=!0,o(r));++n>=e.length&&o(null)}e.forEach(t=>{if(!t.type.syncfs)return a(null);t.type.syncfs(t,r,a)})},mount:(r,t,e)=>{var n,o="/"===e,a=!e;if(o&&xr.root)throw new xr.ErrnoError(10);if(!o&&!a){var i=xr.lookupPath(e,{follow_mount:!1});if(e=i.path,n=i.node,xr.isMountpoint(n))throw new xr.ErrnoError(10);if(!xr.isDir(n.mode))throw new xr.ErrnoError(54)}var s={type:r,opts:t,mountpoint:e,mounts:[]},u=r.mount(s);return u.mount=s,s.root=u,o?xr.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:r=>{var t=xr.lookupPath(r,{follow_mount:!1});if(!xr.isMountpoint(t.node))throw new xr.ErrnoError(28);var e=t.node,n=e.mounted,o=xr.getMounts(n);Object.keys(xr.nameTable).forEach(r=>{for(var t=xr.nameTable[r];t;){var e=t.name_next;o.includes(t.mount)&&xr.destroyNode(t),t=e}}),e.mounted=null;var a=e.mount.mounts.indexOf(n);e.mount.mounts.splice(a,1)},lookup:(r,t)=>r.node_ops.lookup(r,t),mknod:(r,t,e)=>{var n=xr.lookupPath(r,{parent:!0}).node,o=Fr.basename(r);if(!o||"."===o||".."===o)throw new xr.ErrnoError(28);var a=xr.mayCreate(n,o);if(a)throw new xr.ErrnoError(a);if(!n.node_ops.mknod)throw new xr.ErrnoError(63);return n.node_ops.mknod(n,o,t,e)},create:(r,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,xr.mknod(r,t,0)),mkdir:(r,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,xr.mknod(r,t,0)),mkdirTree:(r,t)=>{for(var e=r.split("/"),n="",o=0;o<e.length;++o)if(e[o]){n+="/"+e[o];try{xr.mkdir(n,t)}catch(a){if(20!=a.errno)throw a}}},mkdev:(r,t,e)=>(void 0===e&&(e=t,t=438),t|=8192,xr.mknod(r,t,e)),symlink:(r,t)=>{if(!Mr.resolve(r))throw new xr.ErrnoError(44);var e=xr.lookupPath(t,{parent:!0}).node;if(!e)throw new xr.ErrnoError(44);var n=Fr.basename(t),o=xr.mayCreate(e,n);if(o)throw new xr.ErrnoError(o);if(!e.node_ops.symlink)throw new xr.ErrnoError(63);return e.node_ops.symlink(e,n,r)},rename:(r,t)=>{var e,n,o=Fr.dirname(r),a=Fr.dirname(t),i=Fr.basename(r),s=Fr.basename(t);if(e=xr.lookupPath(r,{parent:!0}).node,n=xr.lookupPath(t,{parent:!0}).node,!e||!n)throw new xr.ErrnoError(44);if(e.mount!==n.mount)throw new xr.ErrnoError(75);var u,c=xr.lookupNode(e,i),f=Mr.relative(r,a);if("."!==f.charAt(0))throw new xr.ErrnoError(28);if("."!==(f=Mr.relative(t,o)).charAt(0))throw new xr.ErrnoError(55);try{u=xr.lookupNode(n,s)}catch(h){}if(c!==u){var l=xr.isDir(c.mode),d=xr.mayDelete(e,i,l);if(d)throw new xr.ErrnoError(d);if(d=u?xr.mayDelete(n,s,l):xr.mayCreate(n,s))throw new xr.ErrnoError(d);if(!e.node_ops.rename)throw new xr.ErrnoError(63);if(xr.isMountpoint(c)||u&&xr.isMountpoint(u))throw new xr.ErrnoError(10);if(n!==e&&(d=xr.nodePermissions(e,"w")))throw new xr.ErrnoError(d);xr.hashRemoveNode(c);try{e.node_ops.rename(c,n,s)}catch(h){throw h}finally{xr.hashAddNode(c)}}},rmdir:r=>{var t=xr.lookupPath(r,{parent:!0}).node,e=Fr.basename(r),n=xr.lookupNode(t,e),o=xr.mayDelete(t,e,!0);if(o)throw new xr.ErrnoError(o);if(!t.node_ops.rmdir)throw new xr.ErrnoError(63);if(xr.isMountpoint(n))throw new xr.ErrnoError(10);t.node_ops.rmdir(t,e),xr.destroyNode(n)},readdir:r=>{var t=xr.lookupPath(r,{follow:!0}).node;if(!t.node_ops.readdir)throw new xr.ErrnoError(54);return t.node_ops.readdir(t)},unlink:r=>{var t=xr.lookupPath(r,{parent:!0}).node;if(!t)throw new xr.ErrnoError(44);var e=Fr.basename(r),n=xr.lookupNode(t,e),o=xr.mayDelete(t,e,!1);if(o)throw new xr.ErrnoError(o);if(!t.node_ops.unlink)throw new xr.ErrnoError(63);if(xr.isMountpoint(n))throw new xr.ErrnoError(10);t.node_ops.unlink(t,e),xr.destroyNode(n)},readlink:r=>{var t=xr.lookupPath(r).node;if(!t)throw new xr.ErrnoError(44);if(!t.node_ops.readlink)throw new xr.ErrnoError(28);return Mr.resolve(xr.getPath(t.parent),t.node_ops.readlink(t))},stat:(r,t)=>{var e=xr.lookupPath(r,{follow:!t}).node;if(!e)throw new xr.ErrnoError(44);if(!e.node_ops.getattr)throw new xr.ErrnoError(63);return e.node_ops.getattr(e)},lstat:r=>xr.stat(r,!0),chmod:(r,t,e)=>{var n;"string"==typeof r?n=xr.lookupPath(r,{follow:!e}).node:n=r;if(!n.node_ops.setattr)throw new xr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(r,t)=>{xr.chmod(r,t,!0)},fchmod:(r,t)=>{var e=xr.getStream(r);if(!e)throw new xr.ErrnoError(8);xr.chmod(e.node,t)},chown:(r,t,e,n)=>{var o;"string"==typeof r?o=xr.lookupPath(r,{follow:!n}).node:o=r;if(!o.node_ops.setattr)throw new xr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(r,t,e)=>{xr.chown(r,t,e,!0)},fchown:(r,t,e)=>{var n=xr.getStream(r);if(!n)throw new xr.ErrnoError(8);xr.chown(n.node,t,e)},truncate:(r,t)=>{if(t<0)throw new xr.ErrnoError(28);var e;"string"==typeof r?e=xr.lookupPath(r,{follow:!0}).node:e=r;if(!e.node_ops.setattr)throw new xr.ErrnoError(63);if(xr.isDir(e.mode))throw new xr.ErrnoError(31);if(!xr.isFile(e.mode))throw new xr.ErrnoError(28);var n=xr.nodePermissions(e,"w");if(n)throw new xr.ErrnoError(n);e.node_ops.setattr(e,{size:t,timestamp:Date.now()})},ftruncate:(r,t)=>{var e=xr.getStream(r);if(!e)throw new xr.ErrnoError(8);if(0==(2097155&e.flags))throw new xr.ErrnoError(28);xr.truncate(e.node,t)},utime:(r,t,e)=>{var n=xr.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,e)})},open:(r,t,e,n,o)=>{if(""===r)throw new xr.ErrnoError(44);var a;if(e=void 0===e?438:e,e=64&(t="string"==typeof t?xr.modeStringToFlags(t):t)?4095&e|32768:0,"object"==typeof r)a=r;else{r=Fr.normalize(r);try{a=xr.lookupPath(r,{follow:!(131072&t)}).node}catch(f){}}var i=!1;if(64&t)if(a){if(128&t)throw new xr.ErrnoError(20)}else a=xr.mknod(r,e,0),i=!0;if(!a)throw new xr.ErrnoError(44);if(xr.isChrdev(a.mode)&&(t&=-513),65536&t&&!xr.isDir(a.mode))throw new xr.ErrnoError(54);if(!i){var u=xr.mayOpen(a,t);if(u)throw new xr.ErrnoError(u)}512&t&&xr.truncate(a,0),t&=-131713;var c=xr.createStream({node:a,path:xr.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,o);return c.stream_ops.open&&c.stream_ops.open(c),!s.logReadFiles||1&t||(xr.readFiles||(xr.readFiles={}),r in xr.readFiles||(xr.readFiles[r]=1)),c},close:r=>{if(xr.isClosed(r))throw new xr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(t){throw t}finally{xr.closeStream(r.fd)}r.fd=null},isClosed:r=>null===r.fd,llseek:(r,t,e)=>{if(xr.isClosed(r))throw new xr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new xr.ErrnoError(70);if(0!=e&&1!=e&&2!=e)throw new xr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,t,e),r.ungotten=[],r.position},read:(r,t,e,n,o)=>{if(n<0||o<0)throw new xr.ErrnoError(28);if(xr.isClosed(r))throw new xr.ErrnoError(8);if(1==(2097155&r.flags))throw new xr.ErrnoError(8);if(xr.isDir(r.node.mode))throw new xr.ErrnoError(31);if(!r.stream_ops.read)throw new xr.ErrnoError(28);var a=void 0!==o;if(a){if(!r.seekable)throw new xr.ErrnoError(70)}else o=r.position;var i=r.stream_ops.read(r,t,e,n,o);return a||(r.position+=i),i},write:(r,t,e,n,o,a)=>{if(n<0||o<0)throw new xr.ErrnoError(28);if(xr.isClosed(r))throw new xr.ErrnoError(8);if(0==(2097155&r.flags))throw new xr.ErrnoError(8);if(xr.isDir(r.node.mode))throw new xr.ErrnoError(31);if(!r.stream_ops.write)throw new xr.ErrnoError(28);r.seekable&&1024&r.flags&&xr.llseek(r,0,2);var i=void 0!==o;if(i){if(!r.seekable)throw new xr.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,t,e,n,o,a);return i||(r.position+=s),s},allocate:(r,t,e)=>{if(xr.isClosed(r))throw new xr.ErrnoError(8);if(t<0||e<=0)throw new xr.ErrnoError(28);if(0==(2097155&r.flags))throw new xr.ErrnoError(8);if(!xr.isFile(r.node.mode)&&!xr.isDir(r.node.mode))throw new xr.ErrnoError(43);if(!r.stream_ops.allocate)throw new xr.ErrnoError(138);r.stream_ops.allocate(r,t,e)},mmap:(r,t,e,n,o,a)=>{if(0!=(2&o)&&0==(2&a)&&2!=(2097155&r.flags))throw new xr.ErrnoError(2);if(1==(2097155&r.flags))throw new xr.ErrnoError(2);if(!r.stream_ops.mmap)throw new xr.ErrnoError(43);return r.stream_ops.mmap(r,t,e,n,o,a)},msync:(r,t,e,n,o)=>r&&r.stream_ops.msync?r.stream_ops.msync(r,t,e,n,o):0,munmap:r=>0,ioctl:(r,t,e)=>{if(!r.stream_ops.ioctl)throw new xr.ErrnoError(59);return r.stream_ops.ioctl(r,t,e)},readFile:(r,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var e,n=xr.open(r,t.flags),o=xr.stat(r).size,a=new Uint8Array(o);return xr.read(n,a,0,o,0),"utf8"===t.encoding?e=U(a,0):"binary"===t.encoding&&(e=a),xr.close(n),e},writeFile:(r,t,e={})=>{e.flags=e.flags||577;var n=xr.open(r,e.flags,e.mode);if("string"==typeof t){var o=new Uint8Array(q(t)+1),a=H(t,o,0,o.length);xr.write(n,o,0,a,void 0,e.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");xr.write(n,t,0,t.byteLength,void 0,e.canOwn)}xr.close(n)},cwd:()=>xr.currentPath,chdir:r=>{var t=xr.lookupPath(r,{follow:!0});if(null===t.node)throw new xr.ErrnoError(44);if(!xr.isDir(t.node.mode))throw new xr.ErrnoError(54);var e=xr.nodePermissions(t.node,"x");if(e)throw new xr.ErrnoError(e);xr.currentPath=t.path},createDefaultDirectories:()=>{xr.mkdir("/tmp"),xr.mkdir("/home"),xr.mkdir("/home/web_user")},createDefaultDevices:()=>{xr.mkdir("/dev"),xr.registerDevice(xr.makedev(1,3),{read:()=>0,write:(r,t,e,n,o)=>n}),xr.mkdev("/dev/null",xr.makedev(1,3)),Ar.register(xr.makedev(5,0),Ar.default_tty_ops),Ar.register(xr.makedev(6,0),Ar.default_tty1_ops),xr.mkdev("/dev/tty",xr.makedev(5,0)),xr.mkdev("/dev/tty1",xr.makedev(6,0));var r=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var r=new Uint8Array(1);return function(){return crypto.getRandomValues(r),r[0]}}if(_)try{var t=require("crypto");return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){sr("randomDevice")}}();xr.createDevice("/dev","random",r),xr.createDevice("/dev","urandom",r),xr.mkdir("/dev/shm"),xr.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{xr.mkdir("/proc");var r=xr.mkdir("/proc/self");xr.mkdir("/proc/self/fd"),xr.mount({mount:()=>{var t=xr.createNode(r,"fd",16895,73);return t.node_ops={lookup:(r,t)=>{var e=+t,n=xr.getStream(e);if(!n)throw new xr.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{s.stdin?xr.createDevice("/dev","stdin",s.stdin):xr.symlink("/dev/tty","/dev/stdin"),s.stdout?xr.createDevice("/dev","stdout",null,s.stdout):xr.symlink("/dev/tty","/dev/stdout"),s.stderr?xr.createDevice("/dev","stderr",null,s.stderr):xr.symlink("/dev/tty1","/dev/stderr");xr.open("/dev/stdin",0),xr.open("/dev/stdout",1),xr.open("/dev/stderr",1)},ensureErrnoError:()=>{xr.ErrnoError||(xr.ErrnoError=function(r,t){this.node=t,this.setErrno=function(r){this.errno=r},this.setErrno(r),this.message="FS error"},xr.ErrnoError.prototype=new Error,xr.ErrnoError.prototype.constructor=xr.ErrnoError,[44].forEach(r=>{xr.genericErrors[r]=new xr.ErrnoError(r),xr.genericErrors[r].stack="<generic error, no stack>"}))},staticInit:()=>{xr.ensureErrnoError(),xr.nameTable=new Array(4096),xr.mount(Pr,{},"/"),xr.createDefaultDirectories(),xr.createDefaultDevices(),xr.createSpecialDirectories(),xr.filesystems={MEMFS:Pr}},init:(r,t,e)=>{xr.init.initialized=!0,xr.ensureErrnoError(),s.stdin=r||s.stdin,s.stdout=t||s.stdout,s.stderr=e||s.stderr,xr.createStandardStreams()},quit:()=>{xr.init.initialized=!1;for(var r=0;r<xr.streams.length;r++){var t=xr.streams[r];t&&xr.close(t)}},getMode:(r,t)=>{var e=0;return r&&(e|=365),t&&(e|=146),e},findObject:(r,t)=>{var e=xr.analyzePath(r,t);return e.exists?e.object:null},analyzePath:(r,t)=>{try{r=(n=xr.lookupPath(r,{follow:!t})).path}catch(o){}var e={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=xr.lookupPath(r,{parent:!0});e.parentExists=!0,e.parentPath=n.path,e.parentObject=n.node,e.name=Fr.basename(r),n=xr.lookupPath(r,{follow:!t}),e.exists=!0,e.path=n.path,e.object=n.node,e.name=n.node.name,e.isRoot="/"===n.path}catch(o){e.error=o.errno}return e},createPath:(r,t,e,n)=>{r="string"==typeof r?r:xr.getPath(r);for(var o=t.split("/").reverse();o.length;){var a=o.pop();if(a){var i=Fr.join2(r,a);try{xr.mkdir(i)}catch(s){}r=i}}return i},createFile:(r,t,e,n,o)=>{var a=Fr.join2("string"==typeof r?r:xr.getPath(r),t),i=xr.getMode(n,o);return xr.create(a,i)},createDataFile:(r,t,e,n,o,a)=>{var i=t;r&&(r="string"==typeof r?r:xr.getPath(r),i=t?Fr.join2(r,t):r);var s=xr.getMode(n,o),u=xr.create(i,s);if(e){if("string"==typeof e){for(var c=new Array(e.length),f=0,l=e.length;f<l;++f)c[f]=e.charCodeAt(f);e=c}xr.chmod(u,146|s);var d=xr.open(u,577);xr.write(d,e,0,e.length,0,a),xr.close(d),xr.chmod(u,s)}return u},createDevice:(r,t,e,n)=>{var o=Fr.join2("string"==typeof r?r:xr.getPath(r),t),a=xr.getMode(!!e,!!n);xr.createDevice.major||(xr.createDevice.major=64);var i=xr.makedev(xr.createDevice.major++,0);return xr.registerDevice(i,{open:r=>{r.seekable=!1},close:r=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(r,t,n,o,a)=>{for(var i=0,s=0;s<o;s++){var u;try{u=e()}catch(c){throw new xr.ErrnoError(29)}if(void 0===u&&0===i)throw new xr.ErrnoError(6);if(null==u)break;i++,t[n+s]=u}return i&&(r.node.timestamp=Date.now()),i},write:(r,t,e,o,a)=>{for(var i=0;i<o;i++)try{n(t[e+i])}catch(s){throw new xr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),i}}),xr.mkdev(o,a,i)},forceLoadFile:r=>{if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!u)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=Yr(u(r.url),!0),r.usedBytes=r.contents.length}catch(t){throw new xr.ErrnoError(29)}},createLazyFile:(r,t,e,n,o)=>{function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(r){if(!(r>this.length-1||r<0)){var t=r%this.chunkSize,e=r/this.chunkSize|0;return this.getter(e)[t]}},a.prototype.setDataGetter=function(r){this.getter=r},a.prototype.cacheLength=function(){var r=new XMLHttpRequest;if(r.open("HEAD",e,!1),r.send(null),!(r.status>=200&&r.status<300||304===r.status))throw new Error("Couldn't load "+e+". Status: "+r.status);var t,n=Number(r.getResponseHeader("Content-length")),o=(t=r.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=(t=r.getResponseHeader("Content-Encoding"))&&"gzip"===t,i=1048576;o||(i=n);var s=this;s.setDataGetter(r=>{var t=r*i,o=(r+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[r]&&(s.chunks[r]=((r,t)=>{if(r>t)throw new Error("invalid range ("+r+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",e,!1),n!==i&&o.setRequestHeader("Range","bytes="+r+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+e+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Yr(o.responseText||"",!0)})(t,o)),void 0===s.chunks[r])throw new Error("doXHR failed!");return s.chunks[r]}),!a&&n||(i=n=1,n=this.getter(0).length,i=n,b("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!g)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i=new a;Object.defineProperties(i,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:i}}else s={isDevice:!1,url:e};var u=xr.createFile(r,t,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};return Object.keys(u.stream_ops).forEach(r=>{var t=u.stream_ops[r];c[r]=function(){return xr.forceLoadFile(u),t.apply(null,arguments)}}),c.read=((r,t,e,n,o)=>{xr.forceLoadFile(u);var a=r.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)t[e+s]=a[o+s];else for(s=0;s<i;s++)t[e+s]=a.get(o+s);return i}),u.stream_ops=c,u},createPreloadedFile:(r,t,e,n,o,a,i,s,u,c)=>{var f=t?Mr.resolve(Fr.join2(r,t)):r;or("cp "+f);function l(e){function l(e){c&&c(),s||xr.createDataFile(r,t,e,n,o,u),a&&a(),ir()}Browser.handledByPreloadPlugin(e,f,l,()=>{i&&i(),ir()})||l(e)}ar(),"string"==typeof e?Tr(e,r=>l(r),i):l(e)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(r,t,e)=>{t=t||(()=>{}),e=e||(()=>{});var n=xr.indexedDB();try{var o=n.open(xr.DB_NAME(),xr.DB_VERSION)}catch(a){return e(a)}o.onupgradeneeded=(()=>{b("creating db"),o.result.createObjectStore(xr.DB_STORE_NAME)}),o.onsuccess=(()=>{var n=o.result.transaction([xr.DB_STORE_NAME],"readwrite"),a=n.objectStore(xr.DB_STORE_NAME),i=0,s=0,u=r.length;function c(){0==s?t():e()}r.forEach(r=>{var t=a.put(xr.analyzePath(r).object.contents,r);t.onsuccess=(()=>{++i+s==u&&c()}),t.onerror=(()=>{i+ ++s==u&&c()})}),n.onerror=e}),o.onerror=e},loadFilesFromDB:(r,t,e)=>{t=t||(()=>{}),e=e||(()=>{});var n=xr.indexedDB();try{var o=n.open(xr.DB_NAME(),xr.DB_VERSION)}catch(a){return e(a)}o.onupgradeneeded=e,o.onsuccess=(()=>{var n=o.result;try{var i=n.transaction([xr.DB_STORE_NAME],"readonly")}catch(a){return void e(a)}var s=i.objectStore(xr.DB_STORE_NAME),u=0,c=0,f=r.length;function l(){0==c?t():e()}r.forEach(r=>{var t=s.get(r);t.onsuccess=(()=>{xr.analyzePath(r).exists&&xr.unlink(r),xr.createDataFile(Fr.dirname(r),Fr.basename(r),t.result,!0,!0,!0),++u+c==f&&l()}),t.onerror=(()=>{u+ ++c==f&&l()})}),i.onerror=e}),o.onerror=e}},Cr={DEFAULT_POLLMASK:5,calculateAt:function(r,t,e){if("/"===t[0])return t;var n;if(-100===r)n=xr.cwd();else{var o=xr.getStream(r);if(!o)throw new xr.ErrnoError(8);n=o.path}if(0==t.length){if(!e)throw new xr.ErrnoError(44);return n}return Fr.join2(n,t)},doStat:function(r,t,e){try{var n=r(t)}catch(o){if(o&&o.node&&Fr.normalize(t)!==Fr.normalize(xr.getPath(o.node)))return-54;throw o}return N[e>>2]=n.dev,N[e+4>>2]=0,N[e+8>>2]=n.ino,N[e+12>>2]=n.mode,N[e+16>>2]=n.nlink,N[e+20>>2]=n.uid,N[e+24>>2]=n.gid,N[e+28>>2]=n.rdev,N[e+32>>2]=0,lr=[n.size>>>0,(fr=n.size,+Math.abs(fr)>=1?fr>0?(0|Math.min(+Math.floor(fr/4294967296),4294967295))>>>0:~~+Math.ceil((fr-+(~~fr>>>0))/4294967296)>>>0:0)],N[e+40>>2]=lr[0],N[e+44>>2]=lr[1],N[e+48>>2]=4096,N[e+52>>2]=n.blocks,N[e+56>>2]=n.atime.getTime()/1e3|0,N[e+60>>2]=0,N[e+64>>2]=n.mtime.getTime()/1e3|0,N[e+68>>2]=0,N[e+72>>2]=n.ctime.getTime()/1e3|0,N[e+76>>2]=0,lr=[n.ino>>>0,(fr=n.ino,+Math.abs(fr)>=1?fr>0?(0|Math.min(+Math.floor(fr/4294967296),4294967295))>>>0:~~+Math.ceil((fr-+(~~fr>>>0))/4294967296)>>>0:0)],N[e+80>>2]=lr[0],N[e+84>>2]=lr[1],0},doMsync:function(r,t,e,n,o){var a=z.slice(r,r+e);xr.msync(t,a,o,e,n)},doMkdir:function(r,t){return"/"===(r=Fr.normalize(r))[r.length-1]&&(r=r.substr(0,r.length-1)),xr.mkdir(r,t,0),0},doMknod:function(r,t,e){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return xr.mknod(r,t,e),0},doReadlink:function(r,t,e){if(e<=0)return-28;var n=xr.readlink(r),o=Math.min(e,q(n)),a=O[t+o];return Y(n,t,e+1),O[t+o]=a,o},doAccess:function(r,t){if(-8&t)return-28;var e=xr.lookupPath(r,{follow:!0}).node;if(!e)return-44;var n="";return 4&t&&(n+="r"),2&t&&(n+="w"),1&t&&(n+="x"),n&&xr.nodePermissions(e,n)?-2:0},doDup:function(r,t,e){var n=xr.getStream(e);return n&&xr.close(n),xr.open(r,t,0,e,e).fd},doReadv:function(r,t,e,n){for(var o=0,a=0;a<e;a++){var i=N[t+8*a>>2],s=N[t+(8*a+4)>>2],u=xr.read(r,O,i,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o},doWritev:function(r,t,e,n){for(var o=0,a=0;a<e;a++){var i=N[t+8*a>>2],s=N[t+(8*a+4)>>2],u=xr.write(r,O,i,s,n);if(u<0)return-1;o+=u}return o},varargs:void 0,get:function(){return Cr.varargs+=4,N[Cr.varargs-4>>2]},getStr:function(r){return L(r)},getStreamFromFD:function(r){var t=xr.getStream(r);if(!t)throw new xr.ErrnoError(8);return t},get64:function(r,t){return r}};var Rr={};function Or(){if(!Or.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:w||"./this.program"};for(var t in Rr)void 0===Rr[t]?delete r[t]:r[t]=Rr[t];var e=[];for(var t in r)e.push(t+"="+r[t]);Or.strings=e}return Or.strings}function zr(r){return r%4==0&&(r%100!=0||r%400==0)}function Br(r,t){for(var e=0,n=0;n<=t;e+=r[n++]);return e}var Nr=[31,29,31,30,31,30,31,31,30,31,30,31],Ir=[31,28,31,30,31,30,31,31,30,31,30,31];function Ur(r,t){for(var e=new Date(r.getTime());t>0;){var n=zr(e.getFullYear()),o=e.getMonth(),a=(n?Nr:Ir)[o];if(!(t>a-e.getDate()))return e.setDate(e.getDate()+t),e;t-=a-e.getDate()+1,e.setDate(1),o<11?e.setMonth(o+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}function Lr(r,t,e,n){var o=N[n+40>>2],a={tm_sec:N[n>>2],tm_min:N[n+4>>2],tm_hour:N[n+8>>2],tm_mday:N[n+12>>2],tm_mon:N[n+16>>2],tm_year:N[n+20>>2],tm_wday:N[n+24>>2],tm_yday:N[n+28>>2],tm_isdst:N[n+32>>2],tm_gmtoff:N[n+36>>2],tm_zone:o?L(o):""},i=L(e),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)i=i.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"];function l(r,t,e){for(var n="number"==typeof r?r.toString():r||"";n.length<t;)n=e[0]+n;return n}function d(r,t){return l(r,t,"0")}function h(r,t){function e(r){return r<0?-1:r>0?1:0}var n;return 0===(n=e(r.getFullYear()-t.getFullYear()))&&0===(n=e(r.getMonth()-t.getMonth()))&&(n=e(r.getDate()-t.getDate())),n}function m(r){switch(r.getDay()){case 0:return new Date(r.getFullYear()-1,11,29);case 1:return r;case 2:return new Date(r.getFullYear(),0,3);case 3:return new Date(r.getFullYear(),0,2);case 4:return new Date(r.getFullYear(),0,1);case 5:return new Date(r.getFullYear()-1,11,31);case 6:return new Date(r.getFullYear()-1,11,30)}}function p(r){var t=Ur(new Date(r.tm_year+1900,0,1),r.tm_yday),e=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=m(e),a=m(n);return h(o,t)<=0?h(a,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var w={"%a":function(r){return c[r.tm_wday].substring(0,3)},"%A":function(r){return c[r.tm_wday]},"%b":function(r){return f[r.tm_mon].substring(0,3)},"%B":function(r){return f[r.tm_mon]},"%C":function(r){return d((r.tm_year+1900)/100|0,2)},"%d":function(r){return d(r.tm_mday,2)},"%e":function(r){return l(r.tm_mday,2," ")},"%g":function(r){return p(r).toString().substring(2)},"%G":function(r){return p(r)},"%H":function(r){return d(r.tm_hour,2)},"%I":function(r){var t=r.tm_hour;return 0==t?t=12:t>12&&(t-=12),d(t,2)},"%j":function(r){return d(r.tm_mday+Br(zr(r.tm_year+1900)?Nr:Ir,r.tm_mon-1),3)},"%m":function(r){return d(r.tm_mon+1,2)},"%M":function(r){return d(r.tm_min,2)},"%n":function(){return"\n"},"%p":function(r){return r.tm_hour>=0&&r.tm_hour<12?"AM":"PM"},"%S":function(r){return d(r.tm_sec,2)},"%t":function(){return"\t"},"%u":function(r){return r.tm_wday||7},"%U":function(r){var t=new Date(r.tm_year+1900,0,1),e=0===t.getDay()?t:Ur(t,7-t.getDay()),n=new Date(r.tm_year+1900,r.tm_mon,r.tm_mday);if(h(e,n)<0){var o=Br(zr(n.getFullYear())?Nr:Ir,n.getMonth()-1)-31,a=31-e.getDate()+o+n.getDate();return d(Math.ceil(a/7),2)}return 0===h(e,t)?"01":"00"},"%V":function(r){var t,e=new Date(r.tm_year+1900,0,4),n=new Date(r.tm_year+1901,0,4),o=m(e),a=m(n),i=Ur(new Date(r.tm_year+1900,0,1),r.tm_yday);return h(i,o)<0?"53":h(a,i)<=0?"01":(t=o.getFullYear()<r.tm_year+1900?r.tm_yday+32-o.getDate():r.tm_yday+1-o.getDate(),d(Math.ceil(t/7),2))},"%w":function(r){return r.tm_wday},"%W":function(r){var t=new Date(r.tm_year,0,1),e=1===t.getDay()?t:Ur(t,0===t.getDay()?1:7-t.getDay()+1),n=new Date(r.tm_year+1900,r.tm_mon,r.tm_mday);if(h(e,n)<0){var o=Br(zr(n.getFullYear())?Nr:Ir,n.getMonth()-1)-31,a=31-e.getDate()+o+n.getDate();return d(Math.ceil(a/7),2)}return 0===h(e,t)?"01":"00"},"%y":function(r){return(r.tm_year+1900).toString().substring(2)},"%Y":function(r){return r.tm_year+1900},"%z":function(r){var t=r.tm_gmtoff,e=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(e?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(r){return r.tm_zone},"%%":function(){return"%"}};for(var u in i=i.replace(/%%/g,"\0\0"),w)i.includes(u)&&(i=i.replace(new RegExp(u,"g"),w[u](a)));var v=Yr(i=i.replace(/\0\0/g,"%"),!1);return v.length>t?0:(X(v,r),v.length-1)}var Hr=function(r,t,e,n){r||(r=this),this.parent=r,this.mount=r.mount,this.mounted=null,this.id=xr.nextInode++,this.name=t,this.mode=e,this.node_ops={},this.stream_ops={},this.rdev=n};function Yr(r,t,e){var n=e>0?e:q(r)+1,o=new Array(n),a=H(r,o,0,o.length);return t&&(o.length=a),o}Object.defineProperties(Hr.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(r){r?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(r){r?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return xr.isDir(this.mode)}},isDevice:{get:function(){return xr.isChrdev(this.mode)}}}),xr.FSNode=Hr,xr.staticInit();var qr,Wr={ra:function(r,t){return function(r,t){var e;if(0===r)e=Date.now();else{if(1!==r&&4!==r||!gr)return _r(28),-1;e=dr()}return N[t>>2]=e/1e3|0,N[t+4>>2]=e%1e3*1e3*1e3|0,0}(r,t)},k:function(r){return Xr(r+16)+16},q:function(r){var t=new br(r),e=t.get_exception_info();return e.get_caught()||(e.set_caught(!0),Dr--),e.set_rethrown(!1),kr.push(t),function(r){r.add_ref()}(e),t.get_exception_ptr()},w:function(){Kr(0);var r=kr.pop();!function(r){if(r.release_ref()&&!r.get_rethrown()){var t=r.get_destructor();t&&yr(t)(r.excPtr),jr(r.excPtr)}}(r.get_exception_info()),r.free(),Sr=0},b:function(){var r=Sr;if(!r)return j(0),0;var t=new Er(r).get_type(),e=new br;if(e.set_base_ptr(r),e.set_adjusted_ptr(r),!t)return j(0),0|e.ptr;for(var n=Array.prototype.slice.call(arguments),o=0;o<n.length;o++){var a=n[o];if(0===a||a===t)break;if(Qr(a,t,e.get_adjusted_ptr_addr()))return j(a),0|e.ptr}return j(t),0|e.ptr},h:function(){var r=Sr;if(!r)return j(0),0;var t=new Er(r).get_type(),e=new br;if(e.set_base_ptr(r),e.set_adjusted_ptr(r),!t)return j(0),0|e.ptr;for(var n=Array.prototype.slice.call(arguments),o=0;o<n.length;o++){var a=n[o];if(0===a||a===t)break;if(Qr(a,t,e.get_adjusted_ptr_addr()))return j(a),0|e.ptr}return j(t),0|e.ptr},B:function(){var r=Sr;if(!r)return j(0),0;var t=new Er(r).get_type(),e=new br;if(e.set_base_ptr(r),e.set_adjusted_ptr(r),!t)return j(0),0|e.ptr;for(var n=Array.prototype.slice.call(arguments),o=0;o<n.length;o++){var a=n[o];if(0===a||a===t)break;if(Qr(a,t,e.get_adjusted_ptr_addr()))return j(a),0|e.ptr}return j(t),0|e.ptr},L:function(){var r=Sr;if(!r)return j(0),0;var t=new Er(r).get_type(),e=new br;if(e.set_base_ptr(r),e.set_adjusted_ptr(r),!t)return j(0),0|e.ptr;for(var n=Array.prototype.slice.call(arguments),o=0;o<n.length;o++){var a=n[o];if(0===a||a===t)break;if(Qr(a,t,e.get_adjusted_ptr_addr()))return j(a),0|e.ptr}return j(t),0|e.ptr},l:jr,W:function(){var r=kr.pop();r||sr("no exception to throw");var t=r.get_exception_info(),e=r.get_base_ptr();throw t.get_rethrown()?r.free():(kr.push(r),t.set_rethrown(!0),t.set_caught(!1),Dr++),Sr=e,e},u:function(r,t,e){throw new Er(r).init(t,e),Sr=r,Dr++,r},oa:function(){return Dr},c:function(r){var t=new br(r),e=t.get_base_ptr();throw Sr||(Sr=e),t.free(),e},za:function(r,t,e){try{var n=Cr.getStreamFromFD(r);return n.fd===t?-28:Cr.doDup(n.path,n.flags,t)}catch(o){if(void 0===xr||!(o instanceof xr.ErrnoError))throw o;return-o.errno}},I:function(r,t,e){Cr.varargs=e;try{var n=Cr.getStreamFromFD(r);switch(t){case 0:return(o=Cr.get())<0?-28:xr.open(n.path,n.flags,0,o).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:var o=Cr.get();return n.flags|=o,0;case 5:return o=Cr.get(),B[o+0>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return _r(28),-1;default:return-28}}catch(a){if(void 0===xr||!(a instanceof xr.ErrnoError))throw a;return-a.errno}},Ca:function(r,t,e,n){try{t=Cr.getStr(t);var o=256&n,a=4096&n;return n&=-4353,t=Cr.calculateAt(r,t,a),Cr.doStat(o?xr.lstat:xr.stat,t,e)}catch(i){if(void 0===xr||!(i instanceof xr.ErrnoError))throw i;return-i.errno}},ya:function(r,t){try{if(0===t)return-28;var e=xr.cwd();return t<q(e)+1?-68:(Y(e,r,t),r)}catch(n){if(void 0===xr||!(n instanceof xr.ErrnoError))throw n;return-n.errno}},Ba:function(r,t,e){Cr.varargs=e;try{var n=Cr.getStreamFromFD(r);switch(t){case 21509:case 21505:return n.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=Cr.get();return N[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=Cr.get(),xr.ioctl(n,t,o);case 21523:case 21524:return n.tty?0:-59;default:sr("bad ioctl syscall "+t)}}catch(a){if(void 0===xr||!(a instanceof xr.ErrnoError))throw a;return-a.errno}},Q:function(r,t){try{return r=Cr.getStr(r),Cr.doStat(xr.lstat,r,t)}catch(e){if(void 0===xr||!(e instanceof xr.ErrnoError))throw e;return-e.errno}},S:function(r,t,e){Cr.varargs=e;try{var n=Cr.getStr(r),o=e?Cr.get():0;return xr.open(n,t,o).fd}catch(a){if(void 0===xr||!(a instanceof xr.ErrnoError))throw a;return-a.errno}},ua:function(r,t,e){try{return r=Cr.getStr(r),Cr.doReadlink(r,t,e)}catch(n){if(void 0===xr||!(n instanceof xr.ErrnoError))throw n;return-n.errno}},sa:function(r,t){try{return r=Cr.getStr(r),t=Cr.getStr(t),xr.rename(r,t),0}catch(e){if(void 0===xr||!(e instanceof xr.ErrnoError))throw e;return-e.errno}},ta:function(r){try{return r=Cr.getStr(r),xr.rmdir(r),0}catch(t){if(void 0===xr||!(t instanceof xr.ErrnoError))throw t;return-t.errno}},va:function(r,t){try{return r=Cr.getStr(r),Cr.doStat(xr.stat,r,t)}catch(e){if(void 0===xr||!(e instanceof xr.ErrnoError))throw e;return-e.errno}},P:function(r){try{return r=Cr.getStr(r),xr.unlink(r),0}catch(t){if(void 0===xr||!(t instanceof xr.ErrnoError))throw t;return-t.errno}},pa:function(){throw 1/0},Da:function(r,t){var e=new Date(1e3*N[r>>2]);N[t>>2]=e.getUTCSeconds(),N[t+4>>2]=e.getUTCMinutes(),N[t+8>>2]=e.getUTCHours(),N[t+12>>2]=e.getUTCDate(),N[t+16>>2]=e.getUTCMonth(),N[t+20>>2]=e.getUTCFullYear()-1900,N[t+24>>2]=e.getUTCDay();var n=Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0),o=(e.getTime()-n)/864e5|0;N[t+28>>2]=o},Ea:function(r,t){var e=new Date(1e3*N[r>>2]);N[t>>2]=e.getSeconds(),N[t+4>>2]=e.getMinutes(),N[t+8>>2]=e.getHours(),N[t+12>>2]=e.getDate(),N[t+16>>2]=e.getMonth(),N[t+20>>2]=e.getFullYear()-1900,N[t+24>>2]=e.getDay();var n=new Date(e.getFullYear(),0,1),o=(e.getTime()-n.getTime())/864e5|0;N[t+28>>2]=o,N[t+36>>2]=-60*e.getTimezoneOffset();var a=new Date(e.getFullYear(),6,1).getTimezoneOffset(),i=n.getTimezoneOffset(),s=0|(a!=i&&e.getTimezoneOffset()==Math.min(i,a));N[t+32>>2]=s},Fa:function(r){var t=new Date(N[r+20>>2]+1900,N[r+16>>2],N[r+12>>2],N[r+8>>2],N[r+4>>2],N[r>>2],0),e=N[r+32>>2],n=t.getTimezoneOffset(),o=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=Math.min(i,a);if(e<0)N[r+32>>2]=Number(a!=i&&s==n);else if(e>0!=(s==n)){var u=Math.max(i,a),c=e>0?s:u;t.setTime(t.getTime()+6e4*(c-n))}N[r+24>>2]=t.getDay();var f=(t.getTime()-o.getTime())/864e5|0;return N[r+28>>2]=f,N[r>>2]=t.getSeconds(),N[r+4>>2]=t.getMinutes(),N[r+8>>2]=t.getHours(),N[r+12>>2]=t.getDate(),N[r+16>>2]=t.getMonth(),t.getTime()/1e3|0},Ga:function r(t,e,n){r.called||(r.called=!0,function(r,t,e){var n=(new Date).getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),i=o.getTimezoneOffset(),s=a.getTimezoneOffset(),u=Math.max(i,s);function c(r){var t=r.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}N[r>>2]=60*u,N[t>>2]=Number(i!=s);var f=c(o),l=c(a),d=W(f),h=W(l);s<i?(N[e>>2]=d,N[e+4>>2]=h):(N[e>>2]=h,N[e+4>>2]=d)}(t,e,n))},G:function(){sr("")},T:function r(){return void 0===r.start&&(r.start=Date.now()),1e3*(Date.now()-r.start)|0},Ja:function(r,t){return r-t},qa:function(r){z.length,sr("OOM")},wa:function(r,t){var e=0;return Or().forEach(function(n,o){var a=t+e;N[r+4*o>>2]=a,function(r,t,e){for(var n=0;n<r.length;++n)O[t++>>0]=r.charCodeAt(n);e||(O[t>>0]=0)}(n,a),e+=n.length+1}),0},xa:function(r,t){var e=Or();N[r>>2]=e.length;var n=0;return e.forEach(function(r){n+=r.length+1}),N[t>>2]=n,0},Ha:function(r){Et(r)},J:function(r){try{var t=Cr.getStreamFromFD(r);return xr.close(t),0}catch(e){if(void 0===xr||!(e instanceof xr.ErrnoError))throw e;return e.errno}},Aa:function(r,t,e,n){try{var o=Cr.getStreamFromFD(r),a=Cr.doReadv(o,t,e);return N[n>>2]=a,0}catch(i){if(void 0===xr||!(i instanceof xr.ErrnoError))throw i;return i.errno}},Z:function(r,t,e,n,o){try{var a=Cr.getStreamFromFD(r),i=4294967296*e+(t>>>0);return i<=-9007199254740992||i>=9007199254740992?-61:(xr.llseek(a,i,n),lr=[a.position>>>0,(fr=a.position,+Math.abs(fr)>=1?fr>0?(0|Math.min(+Math.floor(fr/4294967296),4294967295))>>>0:~~+Math.ceil((fr-+(~~fr>>>0))/4294967296)>>>0:0)],N[o>>2]=lr[0],N[o+4>>2]=lr[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0)}catch(s){if(void 0===xr||!(s instanceof xr.ErrnoError))throw s;return s.errno}},R:function(r,t,e,n){try{var o=Cr.getStreamFromFD(r),a=Cr.doWritev(o,t,e);return N[n>>2]=a,0}catch(i){if(void 0===xr||!(i instanceof xr.ErrnoError))throw i;return i.errno}},a:function(){return F()},v:function(r,t){var e=Jr();try{return yr(r)(t)}catch(n){if($r(e),n!==n+0)throw n;Kr(1,0)}},M:function(r,t,e,n){var o=Jr();try{return yr(r)(t,e,n)}catch(a){if($r(o),a!==a+0)throw a;Kr(1,0)}},N:function(r,t,e,n){var o=Jr();try{return yr(r)(t,e,n)}catch(a){if($r(o),a!==a+0)throw a;Kr(1,0)}},r:function(r){var t=Jr();try{return yr(r)()}catch(e){if($r(t),e!==e+0)throw e;Kr(1,0)}},i:function(r,t){var e=Jr();try{return yr(r)(t)}catch(n){if($r(e),n!==n+0)throw n;Kr(1,0)}},d:function(r,t,e){var n=Jr();try{return yr(r)(t,e)}catch(o){if($r(n),o!==o+0)throw o;Kr(1,0)}},g:function(r,t,e,n){var o=Jr();try{return yr(r)(t,e,n)}catch(a){if($r(o),a!==a+0)throw a;Kr(1,0)}},j:function(r,t,e,n,o){var a=Jr();try{return yr(r)(t,e,n,o)}catch(i){if($r(a),i!==i+0)throw i;Kr(1,0)}},t:function(r,t,e,n,o,a){var i=Jr();try{return yr(r)(t,e,n,o,a)}catch(s){if($r(i),s!==s+0)throw s;Kr(1,0)}},x:function(r,t,e,n,o,a,i){var s=Jr();try{return yr(r)(t,e,n,o,a,i)}catch(u){if($r(s),u!==u+0)throw u;Kr(1,0)}},O:function(r,t,e,n,o,a,i,s){var u=Jr();try{return yr(r)(t,e,n,o,a,i,s)}catch(c){if($r(u),c!==c+0)throw c;Kr(1,0)}},La:function(r,t,e,n,o,a,i,s,u,c,f){var l=Jr();try{return yr(r)(t,e,n,o,a,i,s,u,c,f)}catch(d){if($r(l),d!==d+0)throw d;Kr(1,0)}},E:function(r,t,e,n,o,a,i,s,u,c,f,l){var d=Jr();try{return yr(r)(t,e,n,o,a,i,s,u,c,f,l)}catch(h){if($r(d),h!==h+0)throw h;Kr(1,0)}},U:function(r,t,e,n,o,a,i,s,u,c,f,l,d){var h=Jr();try{return yr(r)(t,e,n,o,a,i,s,u,c,f,l,d)}catch(m){if($r(h),m!==m+0)throw m;Kr(1,0)}},Y:function(r,t,e,n,o,a,i,s,u){var c=Jr();try{return wt(r,t,e,n,o,a,i,s,u)}catch(f){if($r(c),f!==f+0)throw f;Kr(1,0)}},ja:function(r,t,e,n,o,a){var i=Jr();try{return ot(r,t,e,n,o,a)}catch(s){if($r(i),s!==s+0)throw s;Kr(1,0)}},ia:function(r,t,e,n,o,a,i,s){var u=Jr();try{return at(r,t,e,n,o,a,i,s)}catch(c){if($r(u),c!==c+0)throw c;Kr(1,0)}},$:function(r,t,e,n){var o=Jr();try{return mt(r,t,e,n)}catch(a){if($r(o),a!==a+0)throw a;Kr(1,0)}},X:function(r,t,e,n,o){var a=Jr();try{return vt(r,t,e,n,o)}catch(i){if($r(a),i!==i+0)throw i;Kr(1,0)}},o:function(r){var t=Jr();try{yr(r)()}catch(e){if($r(t),e!==e+0)throw e;Kr(1,0)}},p:function(r,t){var e=Jr();try{yr(r)(t)}catch(n){if($r(e),n!==n+0)throw n;Kr(1,0)}},z:function(r,t,e){var n=Jr();try{yr(r)(t,e)}catch(o){if($r(n),o!==o+0)throw o;Kr(1,0)}},ba:function(r,t,e,n,o,a,i){var s=Jr();try{ft(r,t,e,n,o,a,i)}catch(u){if($r(s),u!==u+0)throw u;Kr(1,0)}},e:function(r,t,e){var n=Jr();try{yr(r)(t,e)}catch(o){if($r(n),o!==o+0)throw o;Kr(1,0)}},f:function(r,t,e,n){var o=Jr();try{yr(r)(t,e,n)}catch(a){if($r(o),a!==a+0)throw a;Kr(1,0)}},H:function(r,t,e,n,o,a,i,s,u,c,f,l){var d=Jr();try{yr(r)(t,e,n,o,a,i,s,u,c,f,l)}catch(h){if($r(d),h!==h+0)throw h;Kr(1,0)}},n:function(r,t,e,n,o){var a=Jr();try{yr(r)(t,e,n,o)}catch(i){if($r(a),i!==i+0)throw i;Kr(1,0)}},m:function(r,t,e,n,o,a){var i=Jr();try{yr(r)(t,e,n,o,a)}catch(s){if($r(i),s!==s+0)throw s;Kr(1,0)}},K:function(r,t,e,n,o,a,i){var s=Jr();try{yr(r)(t,e,n,o,a,i)}catch(u){if($r(s),u!==u+0)throw u;Kr(1,0)}},y:function(r,t,e,n,o,a,i,s){var u=Jr();try{yr(r)(t,e,n,o,a,i,s)}catch(c){if($r(u),c!==c+0)throw c;Kr(1,0)}},V:function(r,t,e,n,o,a,i,s,u){var c=Jr();try{yr(r)(t,e,n,o,a,i,s,u)}catch(f){if($r(c),f!==f+0)throw f;Kr(1,0)}},A:function(r,t,e,n,o,a,i,s,u,c,f){var l=Jr();try{yr(r)(t,e,n,o,a,i,s,u,c,f)}catch(d){if($r(l),d!==d+0)throw d;Kr(1,0)}},D:function(r,t,e,n,o,a,i,s,u,c,f,l,d,h,m,p){var w=Jr();try{yr(r)(t,e,n,o,a,i,s,u,c,f,l,d,h,m,p)}catch(v){if($r(w),v!==v+0)throw v;Kr(1,0)}},ea:function(r,t,e,n,o,a,i){var s=Jr();try{ct(r,t,e,n,o,a,i)}catch(u){if($r(s),u!==u+0)throw u;Kr(1,0)}},fa:function(r,t,e,n,o,a,i,s){var u=Jr();try{ut(r,t,e,n,o,a,i,s)}catch(c){if($r(u),c!==c+0)throw c;Kr(1,0)}},ca:function(r,t,e,n,o,a,i,s,u){var c=Jr();try{lt(r,t,e,n,o,a,i,s,u)}catch(f){if($r(c),f!==f+0)throw f;Kr(1,0)}},da:function(r,t,e,n,o,a,i,s,u,c,f,l){var d=Jr();try{dt(r,t,e,n,o,a,i,s,u,c,f,l)}catch(h){if($r(d),h!==h+0)throw h;Kr(1,0)}},la:function(r,t,e,n,o,a,i,s){var u=Jr();try{et(r,t,e,n,o,a,i,s)}catch(c){if($r(u),c!==c+0)throw c;Kr(1,0)}},ga:function(r,t,e,n,o,a,i,s,u){var c=Jr();try{st(r,t,e,n,o,a,i,s,u)}catch(f){if($r(c),f!==f+0)throw f;Kr(1,0)}},ka:function(r,t,e,n,o,a,i,s,u,c){var f=Jr();try{nt(r,t,e,n,o,a,i,s,u,c)}catch(l){if($r(f),l!==l+0)throw l;Kr(1,0)}},aa:function(r,t,e,n){var o=Jr();try{ht(r,t,e,n)}catch(a){if($r(o),a!==a+0)throw a;Kr(1,0)}},ha:function(r,t,e,n,o,a){var i=Jr();try{it(r,t,e,n,o,a)}catch(s){if($r(i),s!==s+0)throw s;Kr(1,0)}},_:function(r,t,e,n,o,a,i){var s=Jr();try{pt(r,t,e,n,o,a,i)}catch(u){if($r(s),u!==u+0)throw u;Kr(1,0)}},ma:function(r,t,e,n,o,a,i,s,u,c){var f=Jr();try{tt(r,t,e,n,o,a,i,s,u,c)}catch(l){if($r(f),l!==l+0)throw l;Kr(1,0)}},s:function(r){return r},C:function(r){j(r)},Ka:Lr,na:function(r,t,e,n){return Lr(r,t,e,n)},Ia:function(r){if(_){if(!r)return 1;var t=L(r);if(!t.length)return 0;var e=require("child_process").spawnSync(t,[],{shell:!0,stdio:"inherit"}),n=(r,t)=>r<<8|t;return null===e.status?n(0,(r=>{switch(r){case"SIGHUP":return 1;case"SIGINT":return 2;case"SIGQUIT":return 3;case"SIGFPE":return 8;case"SIGKILL":return 9;case"SIGALRM":return 14;case"SIGTERM":return 15}return 2})(e.signal)):n(e.status,0)}return r?(_r(52),-1):0},F:function(r){var t=Date.now()/1e3|0;return r&&(N[r>>2]=t),t}},Gr=(function(){var r={a:Wr};function t(r,t){var e,n,o=r.exports;s.asm=o,M=s.asm.Ma,e=M.buffer,R=e,s.HEAP8=O=new Int8Array(e),s.HEAP16=B=new Int16Array(e),s.HEAP32=N=new Int32Array(e),s.HEAPU8=z=new Uint8Array(e),s.HEAPU16=new Uint16Array(e),s.HEAPU32=new Uint32Array(e),s.HEAPF32=new Float32Array(e),s.HEAPF64=new Float64Array(e),V=s.asm.Qa,n=s.asm.Na,J.unshift(n),ir()}function e(r){t(r.instance)}function n(t){return function(){if(!D&&(y||g)){if("function"==typeof fetch&&!pr(ur))return fetch(ur,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+ur+"'";return r.arrayBuffer()}).catch(function(){return wr(ur)});if(c)return new Promise(function(r,t){c(ur,function(t){r(new Uint8Array(t))},t)})}return Promise.resolve().then(function(){return wr(ur)})}().then(function(t){return WebAssembly.instantiate(t,r)}).then(function(r){return r}).then(t,function(r){k("failed to asynchronously prepare wasm: "+r),sr(r)})}if(ar(),s.instantiateWasm)try{return s.instantiateWasm(r,t)}catch(o){return k("Module.instantiateWasm callback failed with error: "+o),!1}(D||"function"!=typeof WebAssembly.instantiateStreaming||mr(ur)||pr(ur)||"function"!=typeof fetch?n(e):fetch(ur,{credentials:"same-origin"}).then(function(t){return WebAssembly.instantiateStreaming(t,r).then(e,function(r){return k("wasm streaming compile failed: "+r),k("falling back to ArrayBuffer instantiation"),n(e)})})).catch(i)}(),s.___wasm_call_ctors=function(){return(s.___wasm_call_ctors=s.asm.Na).apply(null,arguments)},s._create_compile_result=function(){return(s._create_compile_result=s.asm.Oa).apply(null,arguments)},s._main=function(){return(s._main=s.asm.Pa).apply(null,arguments)},s._free=function(){return(Gr=s._free=s.asm.Ra).apply(null,arguments)}),Xr=s._malloc=function(){return(Xr=s._malloc=s.asm.Sa).apply(null,arguments)},Vr=s.___errno_location=function(){return(Vr=s.___errno_location=s.asm.Ta).apply(null,arguments)},Kr=s._setThrew=function(){return(Kr=s._setThrew=s.asm.Ua).apply(null,arguments)},Jr=s.stackSave=function(){return(Jr=s.stackSave=s.asm.Va).apply(null,arguments)},$r=s.stackRestore=function(){return($r=s.stackRestore=s.asm.Wa).apply(null,arguments)},Zr=s.stackAlloc=function(){return(Zr=s.stackAlloc=s.asm.Xa).apply(null,arguments)},Qr=s.___cxa_can_catch=function(){return(Qr=s.___cxa_can_catch=s.asm.Ya).apply(null,arguments)},rt=s.___cxa_is_pointer_type=function(){return(rt=s.___cxa_is_pointer_type=s.asm.Za).apply(null,arguments)},tt=s.dynCall_vijjjj=function(){return(tt=s.dynCall_vijjjj=s.asm._a).apply(null,arguments)},et=s.dynCall_viijji=function(){return(et=s.dynCall_viijji=s.asm.$a).apply(null,arguments)},nt=s.dynCall_viijjiii=function(){return(nt=s.dynCall_viijjiii=s.asm.ab).apply(null,arguments)},ot=s.dynCall_iijj=function(){return(ot=s.dynCall_iijj=s.asm.bb).apply(null,arguments)},at=s.dynCall_iijjii=function(){return(at=s.dynCall_iijjii=s.asm.cb).apply(null,arguments)},it=s.dynCall_vijj=function(){return(it=s.dynCall_vijj=s.asm.db).apply(null,arguments)},st=s.dynCall_viijjii=function(){return(st=s.dynCall_viijjii=s.asm.eb).apply(null,arguments)},ut=s.dynCall_viijjd=function(){return(ut=s.dynCall_viijjd=s.asm.fb).apply(null,arguments)},ct=s.dynCall_viijj=function(){return(ct=s.dynCall_viijj=s.asm.gb).apply(null,arguments)},ft=s.dynCall_vidjj=function(){return(ft=s.dynCall_vidjj=s.asm.hb).apply(null,arguments)},lt=s.dynCall_viijjdi=function(){return(lt=s.dynCall_viijjdi=s.asm.ib).apply(null,arguments)},dt=s.dynCall_viijjdjj=function(){return(dt=s.dynCall_viijjdjj=s.asm.jb).apply(null,arguments)},ht=s.dynCall_vij=function(){return(ht=s.dynCall_vij=s.asm.kb).apply(null,arguments)},mt=s.dynCall_jiii=function(){return(mt=s.dynCall_jiii=s.asm.lb).apply(null,arguments)},pt=s.dynCall_vijji=function(){return(pt=s.dynCall_vijji=s.asm.mb).apply(null,arguments)},wt=s.dynCall_iiiiijj=function(){return(wt=s.dynCall_iiiiijj=s.asm.nb).apply(null,arguments)},vt=s.dynCall_jiiii=function(){return(vt=s.dynCall_jiiii=s.asm.ob).apply(null,arguments)};function yt(r){this.name="ExitStatus",this.message="Program terminated with exit("+r+")",this.status=r}s.cwrap=function(r,t,e,n){var o=(e=e||[]).every(function(r){return"number"===r});return"string"!==t&&o&&!n?x(r):function(){return C(r,t,e,arguments)}},s.UTF8ToString=L,s.FS=xr;function gt(r){var t=s._main,e=(r=r||[]).length+1,n=Zr(4*(e+1));N[n>>2]=G(w);for(var o=1;o<e;o++)N[(n>>2)+o]=G(r[o-1]);N[(n>>2)+e]=0;try{var a=t(e,n);return Et(a,!0),a}catch(i){return function(r){if(r instanceof yt||"unwind"==r)return P;v(1,r)}(i)}finally{!0}}function _t(r){function t(){qr||(qr=!0,s.calledRun=!0,T||(!0,s.noFSInit||xr.init.initialized||xr.init(),xr.ignorePermissions=!1,Ar.init(),vr(J),vr($),a(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),bt&&gt(r),function(){if(s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;)r=s.postRun.shift(),Z.unshift(r);var r;vr(Z)}()))}r=r||p,tr>0||(!function(){if(s.preRun)for("function"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)r=s.preRun.shift(),K.unshift(r);var r;vr(K)}(),tr>0||(s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),t()},1)):t()))}function Et(r,t){P=r,rr()||!0,function(r){P=r,rr()||(s.onExit&&s.onExit(r),T=!0);v(r,new yt(r))}(r)}if(nr=function r(){qr||_t(),qr||(nr=r)},s.run=_t,s.preInit)for("function"==typeof s.preInit&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();var bt=!0;return s.noInitialRun&&(bt=!1),_t(),t.ready}})();"object"==typeof exports&&"object"==typeof module?module.exports=a:"function"==typeof r&&r.amd?r([],function(){return a}):"object"==typeof exports&&(exports.startWerckmeisterJs=a);
491
491
  },{"path":"UUq2","fs":"rDCW","crypto":"mRF4","child_process":"rDCW","process":"pBGv","buffer":"dskh"}],"RSuL":[function(require,module,exports) {
492
492
  "use strict";function n(n,t){var a;if("undefined"==typeof Symbol||null==n[Symbol.iterator]){if(Array.isArray(n)||(a=e(n))||t&&n&&"number"==typeof n.length){a&&(n=a);var r=0,o=function(){};return{s:o,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(n){throw n},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,l=!1;return{s:function(){a=n[Symbol.iterator]()},n:function(){var n=a.next();return s=n.done,n},e:function(n){l=!0,i=n},f:function(){try{s||null==a.return||a.return()}finally{if(l)throw i}}}}function e(n,e){if(n){if("string"==typeof n)return t(n,e);var a=Object.prototype.toString.call(n).slice(8,-1);return"Object"===a&&n.constructor&&(a=n.constructor.name),"Map"===a||"Set"===a?Array.from(n):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?t(n,e):void 0}}function t(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,a=new Array(e);t<e;t++)a[t]=n[t];return a}function a(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function r(n,e){for(var t=0;t<e.length;t++){var a=e[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(n,a.key,a)}}function o(n,e,t){return e&&r(n.prototype,e),t&&r(n,t),n}var i=this&&this.__awaiter||function(n,e,t,a){return new(t||(t=Promise))(function(r,o){function i(n){try{l(a.next(n))}catch(e){o(e)}}function s(n){try{l(a.throw(n))}catch(e){o(e)}}function l(n){var e;n.done?r(n.value):(e=n.value,e instanceof t?e:new t(function(n){n(e)})).then(i,s)}l((a=a.apply(n,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.WerckmeisterCompiler=exports.CompilerError=void 0;var s=require("@werckmeister/compilerjs/werckmeister"),l=require("fs"),c=JSON.parse('[{"path": "chords/default.chords", "data": "------------------------------------------------------------------\\nX: \\t\\t\\tI=0\\t \\t\\tIII=4 \\t\\t\\tV=7\\nXmin: \\t\\tI=0 \\t\\tIII=3 \\t\\t\\tV=7\\nX-: \\t\\tI=0 \\t\\tIII=3 \\t\\t\\tV=7\\nX/7: \\t\\tI=0 \\t\\tIII=4 \\t\\t\\tV=7 \\t\\t\\tVII=-2\\nX-/7: \\t\\tI=0 \\t\\tIII=3 \\t\\t\\tV=7 \\t\\t\\tVII=-2\\nX/maj7: \\tI=0 \\tIII=4 \\t\\t\\tV=7 \\t\\t\\tVII=-1\\nX/5: \\t\\tI=0\\t \\t\\tIII=4 \\t\\t\\tV=-5\\nX-/5: \\t\\tI=0\\t \\t\\tIII=3 \\t\\t\\tV=-5\\nX/4: \\t\\tI=0\\t \\t\\tIII=4 \\tIV=-7\\tV=7\\nX-/4: \\t\\tI=0\\t \\t\\tIII=3 \\tIV=-7\\tV=7\\nX/3: \\t\\tI=0\\t \\t\\tIII=-8 \\t \\tV=7\\nX-/3: \\t\\tI=0\\t \\t\\tIII=-9 \\t \\tV=7\\nX/2: \\t\\tI=0\\t II=-10\\tIII=4 \\t \\tV=7\\nX-7b5/b5: \\tI=0 \\t\\tIII=3 \\t\\t\\tV=-6 \\t\\t\\tVII=10\\n------------------------------------------------------------------\\nXsus4: I=0 IV=5 V=7\\nX7sus4: I=0 IV=5 V=7 VII=10\\nX9sus4: I=0 II=2 IV=5 V=7 VII=10\\nXsus2: I=0 II=2 V=7\\n------------------------------------------------------------------\\nX6: I=0 \\t\\tIII=4 \\t\\t\\tV=7 VI=9\\nX-6: I=0 \\t\\tIII=3 \\t\\t\\tV=7 VI=9\\nX-6/9: I=0 II=2\\tIII=3 \\t\\t\\tV=7 VI=9\\n------------------------------------------------------------------\\nX7: \\t\\tI=0 \\t\\tIII=4 \\t\\t\\tV=7 \\t\\t\\tVII=10\\nXmin7: \\t\\tI=0 \\t\\tIII=3 \\t\\t\\tV=7 \\t\\t\\tVII=10\\nX-7: \\t\\tI=0 \\t\\tIII=3 \\t\\t\\tV=7 \\t\\t\\tVII=10\\nXmaj7: \\t\\tI=0 \\t\\tIII=4 \\t\\t\\tV=7 \\t\\t\\tVII=11\\nXmaj7b5:\\tI=0 \\t\\tIII=4 \\t\\t\\tV=6 \\t\\t\\tVII=11\\nX-7b5: \\tI=0 \\t\\tIII=3 \\t\\t\\tV=6 \\t\\t\\tVII=10\\nXmaj7#11: \\tI=0 \\t\\tIII=4 \\tIV=6\\t \\t\\t\\tVII=11\\nX7b5: \\t\\tI=0 \\t\\tIII=4 \\t\\t\\tV=6 \\t\\t\\tVII=10\\nX7#5: \\t\\tI=0 \\t\\tIII=4 \\t\\t\\tV=8 \\t\\t\\tVII=10\\nX07: \\t\\tI=0 \\t\\tIII=3 \\t\\t\\tV=6 \\t\\t\\tVII=9\\n-- II=3 and III=3 was intended\\nX7#5#9:\\t\\tI=0 II=3 III=3 \\tV=8 \\t\\t\\tVII=10\\n------------------------------------------------------------------\\nX2: \\t\\tI=0 III=2 \\t\\t\\tV=7 \\t\\t\\t\\nX9: \\t\\tI=0 II=2 III=4 \\t\\t\\tV=7 \\t\\t\\tVII=10\\n# to distinguish between Xb9 (Xflat and 9) and Xb9 (X and flat 9)\\n# we write Xflat9 for the latter. (same for 11 and 13)\\nXflat9: \\tI=0 II=1 III=4 \\t\\t\\tV=7 \\t\\t\\t\\nXmin9: \\t\\tI=0 II=2\\tIII=3 \\t\\t\\tV=7 \\t\\t\\tVII=10\\nX-9: \\t\\tI=0 II=2\\tIII=3 \\t\\t\\tV=7 \\t\\t\\tVII=10\\nXminAdd9:\\tI=0 II=2\\tIII=3 \\t\\t\\tV=7 \\t\\t\\t\\nX-add9:\\t\\tI=0 II=2\\tIII=3 \\t\\t\\tV=7 \\t\\t\\t\\n\\n\\nXmaj9: \\t\\tI=0 II=2\\tIII=4 \\t\\t\\tV=7 \\t\\t\\tVII=11\\n-- II=3 and III=3 was intended\\nX7#9: \\t\\tI=0 II=3\\tIII=4 \\t\\t\\tV=7 \\t\\t\\tVII=10\\nX7b9: I=0 II=1 III=4 \\t\\t\\tV=7 \\t\\t\\tVII=10\\nXmaj7b9: I=0 II=1 III=4 \\t\\t\\tV=7 \\t\\t\\tVII=11\\n------------------------------------------------------------------\\nX11: \\t\\tI=0 \\tIII=4 \\tIV=5\\tV=7 \\t\\t\\tVII=10\\nXflat11: I=0 \\tIII=3 \\tIV=4\\tV=7 \\t\\t\\t\\nXmin11:\\t\\tI=0 \\tIII=3 \\tIV=5\\tV=7 \\t\\t\\tVII=10\\nX-11:\\t\\tI=0 \\tIII=3 \\tIV=5\\tV=7 \\t\\t\\tVII=10\\nXmaj11:\\t\\tI=0 \\tIII=4 \\tIV=5\\tV=7 \\t\\t\\tVII=11\\n------------------------------------------------------------------\\nX13: \\t\\tI=0 \\tIII=4 \\t \\tV=7 \\tVI=9\\tVII=10\\nXflat13:\\tI=0 \\tIII=4 \\t \\t \\tVI=8\\t\\nXmin13:\\t\\tI=0 \\tIII=3 \\t\\t V=7 \\tVI=9\\tVII=10\\nX-13:\\t\\tI=0 \\tIII=3 \\t\\t V=7 \\tVI=9\\tVII=10\\nXmaj13:\\t\\tI=0 \\tIII=4 \\t\\t V=7 \\tVI=9\\tVII=11"}, {"path": "lua/com/com.lua", "data": "local _inspect = require \\"lua/com/inspect\\"\\n\\nlocal MidiSchluesselCOffset = 60\\nParameterValueNoTag = \'__noTagValue\'\\n\\nfunction istable(t) return type(t) == \'table\' end\\nfunction isnumber(t) return type(t) == \'number\' end\\nfunction inspect(x) return print(_inspect(x)) end\\nfunction dump(x) print(inspect(x)) end\\n\\n\\nfunction checkLegacyNamedParams(params, ...)\\n local args = table.pack(...)\\n for k, v in pairs(params) do\\n if contains(args, v) then\\n local msg = \\"Error: legacy named parameter with the argument \'\\" .. v .. \\"\'. \\"\\n msg = msg .. \\" Use this expression instead: _\\" .. v .. \\"=...\\" \\n error(msg)\\n end\\n end\\nend\\n\\n-- returns the minimum amount of semitones between the relative pitches x and y.\\n-- e.g.: from c(0) to b(11) = -1\\nfunction relpitchdiff(x, y)\\n x = x % 12\\n y = y % 12\\n if math.abs(x-y) < 6 then\\n return -(x-y)\\n end\\n if x < 6 then \\n x = x + 12 \\n end\\n if y < 6 then\\n y = y + 12\\n end\\n return -(x-y)\\nend\\n\\n-- [a, 1, b, 2, c, 3] => {a=1, b=2, c=3}\\n-- @deprecated use the native named parameter feature: _name=value\\nfunction tokeyvalue(args)\\n assert(#args % 2 == 0)\\n local result = {}\\n for i=1, #args, 2 do\\n result[ args[i] ] = args[i+1]\\n end\\n return result\\nend\\n\\nfunction toMidiPitch(pitch)\\n return MidiSchluesselCOffset + pitch.pitch + (pitch.octave * 12)\\nend\\n\\nfunction deepcopy(o, seen)\\n seen = seen or {}\\n if o == nil then return nil end\\n if seen[o] then return seen[o] end\\n \\n local no\\n if type(o) == \'table\' then\\n no = {}\\n seen[o] = no\\n \\n for k, v in next, o, nil do\\n no[deepcopy(k, seen)] = deepcopy(v, seen)\\n end\\n setmetatable(no, deepcopy(getmetatable(o), seen))\\n else -- number, string, boolean, etc\\n no = o\\n end\\n return no\\nend\\n\\nfunction contains(table, value)\\n if table == nil then\\n return false\\n end\\n for k, v in pairs(table) do\\n if v == value then\\n return true\\n end\\n end\\n return false\\nend\\n\\n-- https://stackoverflow.com/questions/1426954/split-string-in-lua#1426970\\nfunction split(pString, pPattern)\\n local Table = {} -- NOTE: use {n = 0} in Lua-5.0\\n local fpat = \\"(.-)\\" .. pPattern\\n local last_end = 1\\n local s, e, cap = pString:find(fpat, 1)\\n while s do\\n if s ~= 1 or cap ~= \\"\\" then\\n table.insert(Table,cap)\\n end\\n last_end = e+1\\n s, e, cap = pString:find(fpat, last_end)\\n end\\n if last_end <= #pString then\\n cap = pString:sub(last_end)\\n table.insert(Table, cap)\\n end\\n return Table\\n end"}, {"path": "lua/com/globals.lua", "data": "I = 1\\nII = 2\\nIII = 3\\nIV = 4\\nV = 5\\nVI = 6\\nVII = 7\\n\\nDegreeStringValues = {\\n I = I,\\n II = II,\\n III = III,\\n IV = IV,\\n V = V,\\n VI = VI,\\n VII = VII\\n}\\n\\nMajorScaleSemitones = {\\n I = 0,\\n II = 2,\\n III = 4,\\n IV = 5,\\n V = 7,\\n VI = 9,\\n VII = 11\\n}\\n\\nC = 0\\nCIS = 1\\nDES = 1\\nD = 2\\nDIS = 3\\nES = 3\\nE = 4\\nFES = 4\\nF = 5\\nFIS = 6\\nGES = 6\\nG = 7\\nGIS = 8\\nAS = 8\\nA = 9\\nAIS = 10\\nBES = 10\\nB = 11\\nCES = 11\\n"}, {"path": "lua/com/inspect.lua", "data": "local inspect ={\\n _VERSION = \'inspect.lua 3.1.0\',\\n _URL = \'http://github.com/kikito/inspect.lua\',\\n _DESCRIPTION = \'human-readable representations of tables\',\\n _LICENSE = [[\\n MIT LICENSE\\n\\n Copyright (c) 2013 Enrique Garc\\u00eda Cota\\n\\n Permission is hereby granted, free of charge, to any person obtaining a\\n copy of this software and associated documentation files (the\\n \\"Software\\"), to deal in the Software without restriction, including\\n without limitation the rights to use, copy, modify, merge, publish,\\n distribute, sublicense, and/or sell copies of the Software, and to\\n permit persons to whom the Software is furnished to do so, subject to\\n the following conditions:\\n\\n The above copyright notice and this permission notice shall be included\\n in all copies or substantial portions of the Software.\\n\\n THE SOFTWARE IS PROVIDED \\"AS IS\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\n OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\\n IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\\n CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\\n TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\\n SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n ]]\\n}\\n\\nlocal tostring = tostring\\n\\ninspect.KEY = setmetatable({}, {__tostring = function() return \'inspect.KEY\' end})\\ninspect.METATABLE = setmetatable({}, {__tostring = function() return \'inspect.METATABLE\' end})\\n\\nlocal function rawpairs(t)\\n return next, t, nil\\nend\\n\\n-- Apostrophizes the string if it has quotes, but not aphostrophes\\n-- Otherwise, it returns a regular quoted string\\nlocal function smartQuote(str)\\n if str:match(\'\\"\') and not str:match(\\"\'\\") then\\n return \\"\'\\" .. str .. \\"\'\\"\\n end\\n return \'\\"\' .. str:gsub(\'\\"\', \'\\\\\\\\\\"\') .. \'\\"\'\\nend\\n\\n-- \\\\a => \'\\\\\\\\a\', \\\\0 => \'\\\\\\\\0\', 31 => \'\\\\31\'\\nlocal shortControlCharEscapes = {\\n [\\"\\\\a\\"] = \\"\\\\\\\\a\\", [\\"\\\\b\\"] = \\"\\\\\\\\b\\", [\\"\\\\f\\"] = \\"\\\\\\\\f\\", [\\"\\\\n\\"] = \\"\\\\\\\\n\\",\\n [\\"\\\\r\\"] = \\"\\\\\\\\r\\", [\\"\\\\t\\"] = \\"\\\\\\\\t\\", [\\"\\\\v\\"] = \\"\\\\\\\\v\\"\\n}\\nlocal longControlCharEscapes = {} -- \\\\a => nil, \\\\0 => \\\\000, 31 => \\\\031\\nfor i=0, 31 do\\n local ch = string.char(i)\\n if not shortControlCharEscapes[ch] then\\n shortControlCharEscapes[ch] = \\"\\\\\\\\\\"..i\\n longControlCharEscapes[ch] = string.format(\\"\\\\\\\\%03d\\", i)\\n end\\nend\\n\\nlocal function escape(str)\\n return (str:gsub(\\"\\\\\\\\\\", \\"\\\\\\\\\\\\\\\\\\")\\n :gsub(\\"(%c)%f[0-9]\\", longControlCharEscapes)\\n :gsub(\\"%c\\", shortControlCharEscapes))\\nend\\n\\nlocal function isIdentifier(str)\\n return type(str) == \'string\' and str:match( \\"^[_%a][_%a%d]*$\\" )\\nend\\n\\nlocal function isSequenceKey(k, sequenceLength)\\n return type(k) == \'number\'\\n and 1 <= k\\n and k <= sequenceLength\\n and math.floor(k) == k\\nend\\n\\nlocal defaultTypeOrders = {\\n [\'number\'] = 1, [\'boolean\'] = 2, [\'string\'] = 3, [\'table\'] = 4,\\n [\'function\'] = 5, [\'userdata\'] = 6, [\'thread\'] = 7\\n}\\n\\nlocal function sortKeys(a, b)\\n local ta, tb = type(a), type(b)\\n\\n -- strings and numbers are sorted numerically/alphabetically\\n if ta == tb and (ta == \'string\' or ta == \'number\') then return a < b end\\n\\n local dta, dtb = defaultTypeOrders[ta], defaultTypeOrders[tb]\\n -- Two default types are compared according to the defaultTypeOrders table\\n if dta and dtb then return defaultTypeOrders[ta] < defaultTypeOrders[tb]\\n elseif dta then return true -- default types before custom ones\\n elseif dtb then return false -- custom types after default ones\\n end\\n\\n -- custom types are sorted out alphabetically\\n return ta < tb\\nend\\n\\n-- For implementation reasons, the behavior of rawlen & # is \\"undefined\\" when\\n-- tables aren\'t pure sequences. So we implement our own # operator.\\nlocal function getSequenceLength(t)\\n local len = 1\\n local v = rawget(t,len)\\n while v ~= nil do\\n len = len + 1\\n v = rawget(t,len)\\n end\\n return len - 1\\nend\\n\\nlocal function getNonSequentialKeys(t)\\n local keys, keysLength = {}, 0\\n local sequenceLength = getSequenceLength(t)\\n for k,_ in rawpairs(t) do\\n if not isSequenceKey(k, sequenceLength) then\\n keysLength = keysLength + 1\\n keys[keysLength] = k\\n end\\n end\\n table.sort(keys, sortKeys)\\n return keys, keysLength, sequenceLength\\nend\\n\\nlocal function countTableAppearances(t, tableAppearances)\\n tableAppearances = tableAppearances or {}\\n\\n if type(t) == \'table\' then\\n if not tableAppearances[t] then\\n tableAppearances[t] = 1\\n for k,v in rawpairs(t) do\\n countTableAppearances(k, tableAppearances)\\n countTableAppearances(v, tableAppearances)\\n end\\n countTableAppearances(getmetatable(t), tableAppearances)\\n else\\n tableAppearances[t] = tableAppearances[t] + 1\\n end\\n end\\n\\n return tableAppearances\\nend\\n\\nlocal copySequence = function(s)\\n local copy, len = {}, #s\\n for i=1, len do copy[i] = s[i] end\\n return copy, len\\nend\\n\\nlocal function makePath(path, ...)\\n local keys = {...}\\n local newPath, len = copySequence(path)\\n for i=1, #keys do\\n newPath[len + i] = keys[i]\\n end\\n return newPath\\nend\\n\\nlocal function processRecursive(process, item, path, visited)\\n if item == nil then return nil end\\n if visited[item] then return visited[item] end\\n\\n local processed = process(item, path)\\n if type(processed) == \'table\' then\\n local processedCopy = {}\\n visited[item] = processedCopy\\n local processedKey\\n\\n for k,v in rawpairs(processed) do\\n processedKey = processRecursive(process, k, makePath(path, k, inspect.KEY), visited)\\n if processedKey ~= nil then\\n processedCopy[processedKey] = processRecursive(process, v, makePath(path, processedKey), visited)\\n end\\n end\\n\\n local mt = processRecursive(process, getmetatable(processed), makePath(path, inspect.METATABLE), visited)\\n if type(mt) ~= \'table\' then mt = nil end -- ignore not nil/table __metatable field\\n setmetatable(processedCopy, mt)\\n processed = processedCopy\\n end\\n return processed\\nend\\n\\n\\n\\n-------------------------------------------------------------------\\n\\nlocal Inspector = {}\\nlocal Inspector_mt = {__index = Inspector}\\n\\nfunction Inspector:puts(...)\\n local args = {...}\\n local buffer = self.buffer\\n local len = #buffer\\n for i=1, #args do\\n len = len + 1\\n buffer[len] = args[i]\\n end\\nend\\n\\nfunction Inspector:down(f)\\n self.level = self.level + 1\\n f()\\n self.level = self.level - 1\\nend\\n\\nfunction Inspector:tabify()\\n self:puts(self.newline, string.rep(self.indent, self.level))\\nend\\n\\nfunction Inspector:alreadyVisited(v)\\n return self.ids[v] ~= nil\\nend\\n\\nfunction Inspector:getId(v)\\n local id = self.ids[v]\\n if not id then\\n local tv = type(v)\\n id = (self.maxIds[tv] or 0) + 1\\n self.maxIds[tv] = id\\n self.ids[v] = id\\n end\\n return tostring(id)\\nend\\n\\nfunction Inspector:putKey(k)\\n if isIdentifier(k) then return self:puts(k) end\\n self:puts(\\"[\\")\\n self:putValue(k)\\n self:puts(\\"]\\")\\nend\\n\\nfunction Inspector:putTable(t)\\n if t == inspect.KEY or t == inspect.METATABLE then\\n self:puts(tostring(t))\\n elseif self:alreadyVisited(t) then\\n self:puts(\'<table \', self:getId(t), \'>\')\\n elseif self.level >= self.depth then\\n self:puts(\'{...}\')\\n else\\n if self.tableAppearances[t] > 1 then self:puts(\'<\', self:getId(t), \'>\') end\\n\\n local nonSequentialKeys, nonSequentialKeysLength, sequenceLength = getNonSequentialKeys(t)\\n local mt = getmetatable(t)\\n\\n self:puts(\'{\')\\n self:down(function()\\n local count = 0\\n for i=1, sequenceLength do\\n if count > 0 then self:puts(\',\') end\\n self:puts(\' \')\\n self:putValue(t[i])\\n count = count + 1\\n end\\n\\n for i=1, nonSequentialKeysLength do\\n local k = nonSequentialKeys[i]\\n if count > 0 then self:puts(\',\') end\\n self:tabify()\\n self:putKey(k)\\n self:puts(\' = \')\\n self:putValue(t[k])\\n count = count + 1\\n end\\n\\n if type(mt) == \'table\' then\\n if count > 0 then self:puts(\',\') end\\n self:tabify()\\n self:puts(\'<metatable> = \')\\n self:putValue(mt)\\n end\\n end)\\n\\n if nonSequentialKeysLength > 0 or type(mt) == \'table\' then -- result is multi-lined. Justify closing }\\n self:tabify()\\n elseif sequenceLength > 0 then -- array tables have one extra space before closing }\\n self:puts(\' \')\\n end\\n\\n self:puts(\'}\')\\n end\\nend\\n\\nfunction Inspector:putValue(v)\\n local tv = type(v)\\n\\n if tv == \'string\' then\\n self:puts(smartQuote(escape(v)))\\n elseif tv == \'number\' or tv == \'boolean\' or tv == \'nil\' or\\n tv == \'cdata\' or tv == \'ctype\' then\\n self:puts(tostring(v))\\n elseif tv == \'table\' then\\n self:putTable(v)\\n else\\n self:puts(\'<\', tv, \' \', self:getId(v), \'>\')\\n end\\nend\\n\\n-------------------------------------------------------------------\\n\\nfunction inspect.inspect(root, options)\\n options = options or {}\\n\\n local depth = options.depth or math.huge\\n local newline = options.newline or \'\\\\n\'\\n local indent = options.indent or \' \'\\n local process = options.process\\n\\n if process then\\n root = processRecursive(process, root, {}, {})\\n end\\n\\n local inspector = setmetatable({\\n depth = depth,\\n level = 0,\\n buffer = {},\\n ids = {},\\n maxIds = {},\\n newline = newline,\\n indent = indent,\\n tableAppearances = countTableAppearances(root)\\n }, Inspector_mt)\\n\\n inspector:putValue(root)\\n\\n return table.concat(inspector.buffer)\\nend\\n\\nsetmetatable(inspect, { __call = function(_, ...) return inspect.inspect(...) end })\\n\\nreturn inspect\\n"}, {"path": "lua/com/tests.lua", "data": "require \\"com/com\\"\\nrequire \\"com/globals\\"\\n\\nfunction testpitchdiff(a, b, expected)\\n local diff = relpitchdiff(a, b)\\n if diff ~= expected then\\n print(\\"pitchdiff: \\" .. a .. \\"-\\" .. b .. \\"~=\\" .. expected .. \\"(\\" .. diff .. \\")\\" )\\n end\\nend\\n\\ntestpitchdiff( 0, 0, 0)\\ntestpitchdiff( 0, 5, 5)\\ntestpitchdiff( 5, 0, -5)\\ntestpitchdiff( 0, 6, -6)\\ntestpitchdiff( 6, 0, 6)\\ntestpitchdiff( 7, 0, 5)\\ntestpitchdiff( 0, 7, -5)\\ntestpitchdiff( 7, 1, 6)\\ntestpitchdiff( 1, 7, -6)\\ntestpitchdiff( 7, 11, 4)\\ntestpitchdiff(11, 7, -4)\\ntestpitchdiff( 0, 10, -2)\\ntestpitchdiff(10, 0, 2)\\ntestpitchdiff( 5, 9, 4)\\ntestpitchdiff( 9, 5, -4)\\ntestpitchdiff( 5, 11, -6)\\ntestpitchdiff(11, 5, 6)\\ntestpitchdiff( 9, 11, 2)\\ntestpitchdiff(11, 9, -2)\\ntestpitchdiff(11, 1, 2)\\ntestpitchdiff( 1, 11, -2)\\ntestpitchdiff( 12, 24, 0)\\n\\n\\nx = tokeyvalue({\\"a\\", 100, \\"b\\", 200, \\"c\\", 300})\\nassert(x.a == 100)\\nassert(x.b == 200)\\nassert(x.c == 300)\\n\\n\\nassert( toMidiPitch({pitch=C, octave=0}) == 60)\\nassert( toMidiPitch({pitch=C, octave=1}) == 72)\\nassert( toMidiPitch({pitch=CIS, octave=1}) == 73)\\nassert( toMidiPitch({pitch=C, octave=-1}) == 48)"}, {"path": "lua/mods/_drumRudimentsRepository.lua", "data": "-- A definition of drum rudiments.\\n-- The actual rudiment duration dosen\'t matter. At the end, the sequence\\n-- will be ajdusted, so that it fits into the duration of the related event.\\n-- The relations between the different durations is what matters.\\n-- For example\\n-- A rudiment with four quarters, played over the duration of one eight:\\n-- every rudiment quarter will become eventually a 32th\\nR=\\"R\\"\\nL=\\"L\\"\\n\\nFlamType = \\"flam\\"\\nDragType = \\"drag\\"\\n\\n-- durations\\nlocal _4 = 1\\nlocal _8 = 1/2\\nlocal _16 = 1/4\\nlocal _32 = 1/8 \\nlocal _4t = _4 / 3\\nlocal _8t = _8 / 3\\nlocal _16t = _16 / 3\\nlocal _32t = _32 / 3\\n-- velocity factors\\nAccent = \\"accent\\"\\nUnaccented = \\"unaccented\\"\\nGraceNote = \\"grace note\\"\\n\\nlocal ac = Accent\\nlocal un = Unaccented\\n\\n\\n-- create a rudiment sequence event\\nlocal function Stroke(which, duration, velocityClass)\\n if velocityClass == nil then\\n velocityClass = Accent\\n end\\n return { which=which, duration=duration, velocityClass = velocityClass }\\nend\\n\\nlocal function Flam(which, duration, velocityClass)\\n if velocityClass == nil then\\n velocityClass = Accent\\n end\\n return { which=which, duration=duration, velocityClass = velocityClass, type = FlamType}\\nend\\n\\nlocal function Drag(which, duration, velocityClass)\\n if velocityClass == nil then\\n velocityClass = Accent\\n end\\n return { which=which, duration=duration, velocityClass = velocityClass, type = DragType}\\nend\\n\\nlocal S = Stroke\\n\\nlocal function Diddle(which, duration)\\n return {\\n S(which, duration, un), S(which, duration, un)\\n }\\nend\\n\\n-- returns L for R and R for L.\\nfunction Alt(which)\\n if which == L then\\n return R\\n elseif which == R then\\n return L\\n end\\n return nil\\nend\\n\\n-- alternates the \\"Hand\\" value (which).\\n-- \\"L\\" -> \\"R\\"\\n-- \\"R\\" -> \\"L\\"\\nfunction AlternateEvent(event)\\n local copy = deepcopy(event)\\n copy.which = Alt(event.which)\\n return copy\\nend\\n\\n-- Creates a alternating stroke sequence RL...n or LR...n.\\n-- @param startingEvent: the first event. All further created events are unaccented.\\n-- @param numberOfPerformances: the number of the total performances. One RL means one performance.\\nlocal function Alternate(startingEvent, numberOfPerformances)\\n if numberOfPerformances == nil then\\n numberOfPerformances = 1\\n end\\n local result = {startingEvent}\\n local which = startingEvent.which\\n for i = 0, (numberOfPerformances-1)*2, 1 do\\n which = Alt(which)\\n table.insert(result, S(which, startingEvent.duration, un))\\n end\\n return result\\nend\\n\\n-- Creates a sequence of variable args.\\n-- An argument can be either a array of events or a single event\\nlocal function Seq(...)\\n local args = table.pack(...)\\n local result = {}\\n for i=1,args.n do\\n local arg = args[i]\\n local isEvent = arg.which ~= nil\\n if isEvent then\\n table.insert(result, arg)\\n else\\n for key, event in pairs(arg) do\\n table.insert(result, event)\\n end\\n end\\n end\\n return result\\nend\\n\\nRudiments = {\\n [\\"singleStrokeRoll\\"] =\\n { S(R, _4), S(L, _4) },\\n [\\"doubleStrokeRoll\\"] =\\n { S(R, _4), S(R, _4), S(L, _4), S(L, _4) },\\n [\\"trippleStrokeRoll\\"] =\\n { S(R, _4), S(R, _4), S(R, _4), S(L, _4), S(L, _4), S(L, _4) },\\n [\\"fiveStrokeRoll\\"] =\\n { S(R, _32, un), S(R, _32, un), S(L, _32, un), S(L, _32, un), S(R, _8, ac) },\\n [\\"singleStrokeFour\\"] =\\n { S(R, _4t), S(L, _4t), S(R, _4t), S(L, _4) },\\n [\\"singleStrokeSeven\\"] =\\n { S(R, _8t), S(L, _8t), S(R, _8t), S(L, _8t), S(R, _8t), S(L, _8t), S(R, _4) },\\n [\\"multipleBounceRoll\\"] =\\n { S(R, _32, un), S(R, _32, un), S(R, _32, un), S(R, _32, un),\\n S(L, _32, un), S(L, _32, un), S(L, _32, un), S(L, _32, un)},\\n [\\"sixStrokeRoll\\"] =\\n Seq(S(R, _8, ac), Diddle(L, _16), Diddle(R, _16), S(L, _8, ac)),\\n [\\"sevenStrokeRoll\\"] =\\n Seq(Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), S(R, _8, ac)),\\n [\\"nineStrokeRoll\\"] =\\n Seq(Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), S(R, _8, ac)),\\n [\\"tenStrokeRoll\\"] =\\n Seq(Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), S(R, _8, ac), S(L, _8, ac)),\\n [\\"elevenStrokeRoll\\"] =\\n Seq(Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), S(L, _8, ac)),\\n [\\"thirteenStrokeRoll\\"] =\\n Seq(Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), S(R, _8, ac)),\\n [\\"fifteenStrokeRoll\\"] =\\n Seq(Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), S(L, _8, ac)),\\n [\\"seventeenStrokeRoll\\"] =\\n Seq(Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), Diddle(R, _16), Diddle(L, _16), S(R, _8, ac)),\\n [\\"paradiddle\\"] =\\n Seq(Alternate(S(R, _16, ac)), Diddle(R, _16)),\\n [\\"doubleParadiddle\\"] =\\n Seq(Alternate(S(R, _16, ac), 2), Diddle(R, _16)),\\n [\\"trippleParadiddle\\"] =\\n Seq(Alternate(S(R, _16, ac), 3), Diddle(R, _16)),\\n [\\"paradiddlediddle\\"] =\\n Seq(Alternate(S(R, _16, ac)), Diddle(R, _16), Diddle(L, _16)),\\n [\\"flam\\"] =\\n Seq(Flam(R, _4)),\\n [\\"flamAccent\\"] =\\n Seq(Flam(R, _8, ac), S(L, _8, un), S(R, _8, un)),\\n [\\"flamTap\\"] =\\n Seq(Flam(R, _16, ac), S(R, _16, un)),\\n [\\"flamacue\\"] =\\n Seq(Flam(R, _16, un), S(L, _16, ac), S(R, _16, un), S(L, _16, un), Flam(R, _4, un)),\\n [\\"flamParadiddle\\"] =\\n Seq(Flam(R, _16, ac), S(L, _16, un), Diddle(R, _16)),\\n [\\"singleFlammedMill\\"] =\\n Seq(Flam(R, _16, ac), S(R, _16, un), S(L, _16, un), S(R, _16, un)),\\n [\\"pataflafla\\"] =\\n Seq(Flam(R, _16, ac), S(L, _16, un), Diddle(R, _16), Flam(L, _16, ac)),\\n [\\"swissArmytriplet\\"] =\\n Seq(Flam(R, _16t, ac), S(R, _16t, un), S(L, _16t, un)),\\n [\\"invertedFlamTap\\"] =\\n Seq(Flam(R, _16, ac), S(L, _16, un)),\\n [\\"flamDrag\\"] =\\n Seq(Flam(R, _8, ac), S(L, _16, un), S(L, _16, un), S(R, _8, un)),\\n [\\"drag\\"] =\\n Seq(Drag(R, _4, ac)),\\n [\\"singleDragTap\\"] =\\n Seq(Drag(R, _8, un), S(L, _8, ac)),\\n [\\"doubleDragTap\\"] =\\n Seq(Drag(R, _8, un), Drag(R, _8, un), S(L, _8, ac)),\\n [\\"lesson25\\"] =\\n Seq(Drag(R, _16, un), S(L, _16, un), S(R, _8, ac)),\\n [\\"singleDragadiddle\\"] =\\n Seq(Drag(R, _16, ac), S(L, _16, un), Diddle(R, _16)),\\n [\\"dragParadiddle1\\"] =\\n Seq(S(R, _8, ac), Drag(R, _16, un), S(L, _16, un), Diddle(R, _16)),\\n [\\"dragParadiddle2\\"] =\\n Seq(S(R, _8, ac), Drag(R, _8, un), Drag(R, _16, un), S(L, _16, un), Diddle(R, _16)),\\n [\\"singleRatamacue\\"] =\\n Seq(Drag(R, _8t, un), S(L, _8t, un), S(R, _8t, un), S(L, _8, ac)),\\n [\\"doubleRatamacue\\"] =\\n Seq(Drag(R, _8, un), Drag(R, _8t, un), S(L, _8t, un), S(R, _8t, un), S(L, _8, ac)),\\n [\\"trippleRatamacue\\"] =\\n Seq(Drag(R, _8, un), Drag(R, _8, un), Drag(R, _8t, un), S(L, _8t, un), S(R, _8t, un), S(L, _8, ac)) \\n}\\n"}, {"path": "lua/mods/_events.lua", "data": "\\nNote = {}\\n\\nfunction Note:new()\\n local o = {}\\n setmetatable(o, self)\\n self.__index = self\\n o.duration = 0\\n o.isTied = false\\n o.offset = 0\\n o.pitches = {}\\n o.type = \\"note\\"\\n o.velocity = 0\\n return o \\nend\\n\\nfunction Note:addPitch(pitch, octave)\\n table.insert(self.pitches, {pitch=pitch, octave=octave})\\nend\\n\\nfunction pitchCompare(a, b)\\n a = a.pitch + (a.octave * 12)\\n b = b.pitch + (b.octave * 12)\\n return a < b\\nend\\n\\nfunction pitchCompareReversed(a, b)\\n a = a.pitch + (a.octave * 12)\\n b = b.pitch + (b.octave * 12)\\n return a > b\\nend\\n"}, {"path": "lua/mods/drumRudiments.lua", "data": "-- <command name=\\"drumRudiments\\" where=\\"mod\\" using=\\"lua/mod/drumRudiments.lua\\">\\n-- <![CDATA[\\n-- Implements a collection of different drum rudiments. ([see Wikipedia](https://en.wikipedia.org/wiki/Drum_rudiment))\\n-- You can specify which notes are for `L` and `R` and performing duration.\\n-- This will be achieved by using an chord as source material.\\n-- The chord pitches will be used for `L` and `R`.\\n-- The length of the chord event defines over which time the rudiment will be peformed.\\n-- An event tag specifies which rudiment will be performed.\\n-- For example:\\n-- This plays one paradiddle over a length of 1 quarter\\n-- using `sn1` for R and `sn2` for L:\\n-- ```\\n-- /mod: drumRudiments/\\\\n\\n-- R L \\\\n\\n-- \\"paradiddle\\"@<\\"sn1\\" \\"sn2\\">4\\\\n\\n-- ```\\n-- Examples:\\n-- **a single paradiddle**\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/mods/drumRudiments.lua\\";\\\\n\\n--tempo: 150;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef:piano MyDevice _ch=0 _pc=118;\\\\n\\n--[\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /mod: drumRudiments/\\\\n\\n-- -- a paradiddle (RLRR) with c\' for R and c for L\\\\n\\n-- \\"paradiddle\\"@<c\' c>1\\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- **repeating**\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/mods/drumRudiments.lua\\";\\\\n\\n--tempo: 120;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef:piano MyDevice _ch=0 _pc=118;\\\\n\\n--[\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /mod: drumRudiments/\\\\n\\n-- -- performs 4 paradiddles (RLRR LRLL RLRR LRLL) with c\' for R and c for L\\\\n\\n-- \\"4x paradiddle\\"@<c\' c>1\\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- **orchestration**\\n-- If you want to orchestrate a rudiment over a drum set,\\n-- you are able to define more R & L notes. *(The total number of the notes has to be even.)*\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/mods/drumRudiments.lua\\";\\\\n\\n--tempo: 120;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef:piano MyDevice _ch=0 _pc=118;\\\\n\\n--[\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /mod: drumRudiments/\\\\n\\n-- -- performs 4 paradiddles (RLRR LRLL RLRR LRLL) with \\\\n\\n-- -- c\' for R1 and c for L1\\\\n\\n-- -- and c, for R2 and c,, for L2.\\\\n\\n-- -- The final sequence will be: c\'(R1) c(L1) c,(R2) c,,(R1) ... \\\\n\\n-- \\"4x paradiddle\\"@<c\' c c, c,,>1\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- **Supported Rudiments**\\n--<ul style=\\"font-size: 0.9em;\\">\\n--<li>singleStrokeRoll</li>\\n--<li>doubleStrokeRoll</li>\\n--<li>trippleStrokeRoll</li>\\n--<li>fiveStrokeRoll</li>\\n--<li>singleStrokeFour</li>\\n--<li>singleStrokeSeven</li>\\n--<li>multipleBounceRoll</li>\\n--<li>sixStrokeRoll</li>\\n--<li>sevenStrokeRoll</li>\\n--<li>nineStrokeRoll</li>\\n--<li>tenStrokeRoll</li>\\n--<li>elevenStrokeRoll</li>\\n--<li>thirteenStrokeRoll</li>\\n--<li>fifteenStrokeRoll</li>\\n--<li>seventeenStrokeRoll</li>\\n--<li>paradiddle</li>\\n--<li>doubleParadiddle</li>\\n--<li>trippleParadiddle</li>\\n--<li>paradiddlediddle</li>\\n--<li>flam</li>\\n--<li>flamAccent</li>\\n--<li>flamTap</li>\\n--<li>flamacue</li>\\n--<li>flamParadiddle</li>\\n--<li>singleFlammedMill</li>\\n--<li>pataflafla</li>\\n--<li>swissArmytriplet</li>\\n--<li>invertedFlamTap</li>\\n--<li>flamDrag</li>\\n--<li>singleDragTap</li>\\n--<li>doubleDragTap</li>\\n--<li>lesson25</li>\\n--<li>singleDragadiddle</li>\\n--<li>dragParadiddle1</li>\\n--<li>dragParadiddle2</li>\\n--<li>singleRatamacue</li>\\n--<li>doubleRatamacue</li>\\n--<li>trippleRatamacue</li>\\n--</ul>\\n-- ]]>\\n-- </command>\\n-- <param name=\\"velocityFactorAccented\\" optional=\\"1\\" type=\\"0..1\\">The velocity factor for accented notes (Default=1)</param>\\n-- <param name=\\"velocityFactorUnaccented\\" optional=\\"1\\" type=\\"0..1\\">The velocity factor for unaccented notes (Default=0.7)</param>\\n-- <param name=\\"velocityFactorGraceNote\\" optional=\\"1\\" type=\\"0..1\\">The velocity factor for accented notes (Default=1)</param>\\n-- <param name=\\"flamOffset\\" optional=\\"1\\" type=\\"0..N\\">The offset in quartes when to perform the grace note before the actual note (Default=0.05)</param>\\n-- <param name=\\"dragOffset\\" optional=\\"1\\" type=\\"0..N\\">The offset in quartes when to perform the two grace notes before the actual note (Default=0.05)</param>\\n\\n\\n\\nrequire \\"lua/com/com\\"\\nrequire \\"_drumRudimentsRepository\\"\\nrequire \\"_events\\"\\n\\nparameters = {\\n { name=\\"velocityFactorAccented\\", default=\\"1\\" },\\n { name=\\"velocityFactorUnaccented\\", default=\\"0.7\\" },\\n { name=\\"velocityFactorGraceNote\\", default=\\"0.2\\" },\\n { name=\\"flamOffset\\", default=\\"0.05\\" },\\n { name=\\"dragOffset\\", default=\\"0.05\\" },\\n}\\n\\n\\nSupportedRepeatTags = {\\n [\\"2x\\"] = 2,\\n [\\"3x\\"] = 3,\\n [\\"4x\\"] = 4,\\n [\\"5x\\"] = 5,\\n [\\"6x\\"] = 6,\\n [\\"7x\\"] = 7,\\n [\\"8x\\"] = 8,\\n [\\"9x\\"] = 9,\\n [\\"10x\\"] = 10,\\n [\\"11x\\"] = 11,\\n [\\"12x\\"] = 12,\\n [\\"13x\\"] = 13,\\n [\\"14x\\"] = 14,\\n [\\"15x\\"] = 15,\\n [\\"16x\\"] = 16,\\n [\\"17x\\"] = 17,\\n [\\"18x\\"] = 18,\\n [\\"19x\\"] = 19,\\n [\\"20x\\"] = 20,\\n [\\"21x\\"] = 21,\\n [\\"22x\\"] = 22,\\n [\\"23x\\"] = 23,\\n [\\"24x\\"] = 24,\\n [\\"25x\\"] = 25,\\n [\\"26x\\"] = 26,\\n [\\"27x\\"] = 27,\\n [\\"28x\\"] = 28,\\n [\\"29x\\"] = 29,\\n [\\"30x\\"] = 30,\\n [\\"31x\\"] = 31,\\n [\\"32x\\"] = 32,\\n}\\n\\nlocal tiedEventCache = {\\n [\\"offset\\"] = 0,\\n [\\"duration\\"] = 0,\\n [\\"originEvent\\"] = nil\\n}\\n\\nlocal function newTiedEventCache(event)\\n tiedEventCache.duration = event.duration\\n tiedEventCache.originEvent = event\\nend\\n\\nlocal function isTiedEventCacheEmpty()\\n return tiedEventCache.originEvent == nil\\nend\\n\\nlocal function clearTiedEventCache()\\n tiedEventCache.originEvent = nil\\n tiedEventCache.duration = 0\\n tiedEventCache.offset = 0\\nend\\n\\nlocal function getPossibleRudimentEvent(events)\\n local firstEvent = events[1]\\n if not isTiedEventCacheEmpty() then\\n tiedEventCache.duration = tiedEventCache.duration + firstEvent.duration\\n tiedEventCache.offset = tiedEventCache.offset - firstEvent.duration\\n if firstEvent.isTied then\\n return nil\\n end\\n end\\n if not isTiedEventCacheEmpty() and not firstEvent.isTied then\\n firstEvent = tiedEventCache.originEvent\\n firstEvent.isTied = false\\n firstEvent.offset = tiedEventCache.offset\\n firstEvent.duration = tiedEventCache.duration\\n clearTiedEventCache()\\n end\\n return firstEvent\\nend\\n\\n\\nfunction perform(events, params, timeinfo)\\n local firstEvent = getPossibleRudimentEvent(events)\\n if (firstEvent == nil) then\\n return {}\\n end\\n if #events == 0 or #firstEvent.tags == 0 then\\n return events\\n end\\n if firstEvent.duration == 0 then\\n return events\\n end\\n local rudimentPerformer = RudimentPerformer:new()\\n rudimentPerformer.velocityFactorAccented = tonumber(params.velocityFactorAccented)\\n rudimentPerformer.velocityFactorUnaccented = tonumber(params.velocityFactorUnaccented)\\n rudimentPerformer.velocityFactorGraceNote = tonumber(params.velocityFactorGraceNote)\\n rudimentPerformer.flamOffset = tonumber(params.flamOffset)\\n rudimentPerformer.dragOffset = tonumber(params.dragOffset)\\n rudimentPerformer:setSourceEvent(firstEvent)\\n if rudimentPerformer.rudiment == nil then\\n return events\\n end\\n if firstEvent.isTied then\\n newTiedEventCache(firstEvent)\\n return {}\\n end\\n local rudimentEvents = rudimentPerformer:perform();\\n return rudimentEvents\\nend\\n\\nRudimentPerformer = {}\\nfunction RudimentPerformer:new(o)\\n local o = o or {}\\n setmetatable(o, self)\\n self.__index = self\\n self.idxL = 1\\n self.idxR = 1\\n self.offset = 0\\n self.velocityFactorAccented = 1\\n self.velocityFactorUnaccented = 0.7\\n self.velocityFactorGraceNote = 0.2\\n self.flamOffset = 0.05\\n self.dragOffset = 0.05\\n return o\\nend\\n\\nfunction RudimentPerformer:findRudimentName(tags)\\n for idx, tag in pairs(tags) do\\n local val = Rudiments[tag]\\n if val ~= nil then\\n return tag\\n end\\n end\\n return nil\\nend\\n\\nfunction RudimentPerformer:findRepeatTagValue(tags)\\n for idx, tag in pairs(tags) do\\n local val = SupportedRepeatTags[tag]\\n if val ~= nil then\\n return val\\n end\\n end\\n return nil\\nend\\n\\nfunction RudimentPerformer:setSourceEvent(event)\\n local rudimentName = self:findRudimentName(event.tags)\\n local source = event.pitches\\n self.offset = event.offset\\n self.rudiment = Rudiments[rudimentName]\\n if self.rudiment == nil then\\n return\\n end\\n if #source % 2 ~= 0 then\\n -- not enough events\\n error(\\"not enough chord pitches for rudiment \\" .. rudimentName)\\n end\\n local repeatCount = self:findRepeatTagValue(event.tags)\\n if repeatCount ~= nil then\\n self:repeat_(repeatCount)\\n end\\n self.duration = event.duration\\n self.ls = {}\\n self.rs = {}\\n self.velocity = event.velocity\\n for idx, pitch in pairs(source) do\\n if idx % 2 == 0 then\\n table.insert(self.ls, pitch)\\n else\\n table.insert(self.rs, pitch)\\n end\\n end\\nend\\n\\nfunction RudimentPerformer:repeat_(count)\\n local sequence = {}\\n for i=1,count do\\n local useAlternation = i % 2 == 1\\n for idx, rudimentEvent in pairs(self.rudiment) do\\n local event = rudimentEvent\\n if (useAlternation) then\\n event = AlternateEvent(event)\\n end\\n table.insert(sequence, event)\\n end\\n end\\n self.rudiment = sequence\\nend\\n\\nfunction RudimentPerformer:l()\\n local l = self.ls[self.idxL]\\n self.idxL = self.idxL + 1\\n if self.idxL > #self.ls then\\n self.idxL = 1\\n end\\n return l\\nend\\n\\nfunction RudimentPerformer:r()\\n local r = self.rs[self.idxR]\\n self.idxR = self.idxR + 1\\n if self.idxR > #self.ls then\\n self.idxR = 1\\n end\\n return r\\nend\\n\\nfunction RudimentPerformer:nextPitch(lOrR)\\n if lOrR == nil then\\n error(\\"invalid L R value for rudiment: nil\\")\\n end\\n if lOrR == L then\\n return self:l()\\n elseif lOrR == R then\\n return self:r()\\n end\\n error(\\"invalid L R value for rudiment: \\" .. lOrR)\\nend\\n\\n-- duration of the rudiment definition\\nfunction RudimentPerformer:defDuration()\\n local duration = 0\\n for idx, rudiment in pairs(self.rudiment) do\\n duration = duration + rudiment.duration\\n end\\n return duration\\nend\\n\\nfunction RudimentPerformer:getVelocityFactor(rudiment)\\n if rudiment.velocityClass == Accent then\\n return self.velocityFactorAccented\\n end\\n if rudiment.velocityClass == Unaccented then\\n return self.velocityFactorUnaccented\\n end\\n if rudiment.velocityClass == GraceNote then\\n return self.velocityFactorGraceNote\\n end\\n error(\\"no velocity value for class \\" .. rudiment.velocityClass)\\nend\\n\\nfunction RudimentPerformer:perform()\\n local events = {}\\n local offset = self.offset\\n local durationFactor = self.duration / self:defDuration()\\n for idx, rudiment in pairs(self.rudiment) do\\n local type = rudiment.type\\n local which = rudiment.which\\n local duration = rudiment.duration\\n local velocityFactor = self:getVelocityFactor(rudiment)\\n local note = Note:new()\\n note.duration = duration * durationFactor\\n note.velocity = self.velocity * velocityFactor\\n note.offset = offset\\n local pitch = self:nextPitch(which)\\n note:addPitch(pitch.pitch, pitch.octave)\\n if type == FlamType then\\n self:performFlam(events, note, Alt(which))\\n end\\n if type == DragType then\\n self:performDrag(events, note, Alt(which))\\n end \\n table.insert(events, note)\\n offset = offset + note.duration\\n end\\n return events\\nend\\n\\n\\nfunction RudimentPerformer:performFlam(events, note, which)\\n local flamDuration = self.flamOffset\\n local flam = Note:new()\\n local pitch = self:nextPitch(which)\\n flam:addPitch(pitch.pitch, pitch.octave)\\n flam.duration = flamDuration\\n flam.velocity = note.velocity * self.velocityFactorGraceNote\\n flam.offset = note.offset\\n note.offset = note.offset + flamDuration\\n note.duration = note.duration\\n table.insert(events, flam)\\nend\\n\\nfunction RudimentPerformer:performDrag(events, note, which)\\n local flamDuration = self.dragOffset\\n local pitch = self:nextPitch(which)\\n local flam = Note:new()\\n flam:addPitch(pitch.pitch, pitch.octave)\\n flam.duration = flamDuration\\n flam.velocity = note.velocity * self.velocityFactorGraceNote\\n flam.offset = note.offset\\n table.insert(events, flam)\\n\\n flam = Note:new()\\n flam:addPitch(pitch.pitch, pitch.octave)\\n flam.duration = flamDuration\\n flam.velocity = note.velocity * self.velocityFactorGraceNote\\n flam.offset = note.offset + flamDuration\\n table.insert(events, flam)\\n\\n note.offset = note.offset + flamDuration * 2\\n note.duration = note.duration\\n\\nend\\n"}, {"path": "lua/mods/guitarStroke.lua", "data": "-- <command name=\\"guitarStroke\\" where=\\"mod\\" using=\\"lua/mod/guitarStroke.lua\\">\\n-- <![CDATA[\\n-- Simulates guitar strokes as mini arpeggios.\\n-- *Note: the alternate mode works only if this mod is set via instrumentConf.*\\n-- ```\\n-- -- does not work: \\\\n\\n-- [ \\\\n\\n-- { \\\\n\\n-- /mod: guitarStroke _mode=alternate/\\\\n\\n-- } \\\\n\\n-- ] \\\\n\\n-- ```\\n-- ```\\n-- -- does work: \\\\n\\n-- instrumentConf: myInstrument mod guitarStroke _mode=alternate; \\\\n\\n-- ```\\n-- **Example**\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/mods/guitarStroke.lua\\";\\\\n\\n--tempo: 120;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef: piano MyDevice _ch=0 _pc=24;\\\\n\\n--instrumentConf: piano mod guitarStroke _mode=alternate _value=16; \\\\n\\n--[\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- <c e g b>4 <c e g b>4 <c eb g bb>2 | <c eb g bb>2 <c eb g bb>2\\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- ]]>\\n-- </command>\\n-- <param name=\\"direction\\" optional=\\"1\\" type=\\"[up,down]\\">Specifies the start direction of the stroke</param>\\n-- <param name=\\"value\\" optional=\\"1\\" type=\\"[1,2,4,8,...]\\">the duration of one arpeggio event. (Default=64)</param>\\n-- <param name=\\"mode\\" optional=\\"1\\" type=\\"[normal,alternate]\\">Perform only one stroke direction (normal) or alternates between up and down. (Default=normal)</param>\\n\\nrequire \\"lua/com/com\\"\\nrequire \\"_events\\"\\n\\n\\nparameters = {\\n -- can be up, down\\n { name=\\"direction\\", default=\\"up\\" },\\n -- can be 1, 2, 4, 8, 16, 32, 64, ...\\n { name=\\"value\\", default=\\"64\\" },\\n -- can be normal, alternate\\n { name=\\"mode\\", default=\\"normal\\" }\\n\\n}\\n\\nlocal direction = nil\\nlocal mode = nil\\n\\nfunction perform(eventsOrigin, params, timeinfo)\\n if #eventsOrigin > 2 then\\n return eventsOrigin\\n end\\n checkLegacyNamedParams(params, \\"direction\\", \\"mode\\", \\"value\\")\\n local directionParam = params.direction\\n local modeParam = params.mode\\n local value = params.value\\n value = tonumber(value)\\n local event = eventsOrigin[1]\\n local events = { }\\n local comparer = pitchCompare\\n \\n if mode == nil then\\n mode = modeParam\\n end\\n\\n if direction ==nil then\\n direction = directionParam\\n end\\n\\n if direction == \\"down\\" then\\n comparer = pitchCompareReversed\\n if mode == \\"alternate\\" then\\n direction = \\"up\\"\\n end\\n else\\n comparer = pitchCompare\\n if mode == \\"alternate\\" then\\n direction = \\"down\\"\\n end\\n end\\n\\n local duration = 1 / value\\n table.sort( event.pitches, comparer)\\n for i, pitch in pairs(event.pitches) do\\n local note = Note:new()\\n local newOffset = event.offset + (i-1) * duration\\n note.offset = newOffset\\n note.duration = event.duration - newOffset\\n note.isTied = event.isTied\\n note.velocity = event.velocity\\n note:addPitch(pitch.pitch, pitch.octave)\\n table.insert(events, note) \\n end\\n return events\\nend"}, {"path": "lua/mods/legato.lua", "data": "-- <command name=\\"legato\\" where=\\"mod\\" using=\\"lua/mod/legato.lua\\">\\n-- Performs every note legato. It is also possible to tag single notes.\\n-- If a tag is given, only the tagged notes are performed legato.\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/mods/legato.lua\\";\\\\n\\n--tempo: 140;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef:piano MyDevice _ch=0 _pc=0;\\\\n\\n--[\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /mod: legato _forTag=leg _amount=100/\\\\n\\n-- -- only the `d` will be performed legato. \\\\n\\n-- c \\"leg\\"@d e f\\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- </command>\\n-- <param name=\\"forTag\\" optional=\\"1\\" type=\\"text\\">Specifies a tag name. If set only events with this tag name will be affected by the legato mod.</param>\\n-- <param name=\\"amount\\" optional=\\"1\\" type=\\"0..100\\">The ammount of the legato effect</param>\\n\\nrequire \\"lua/com/com\\"\\n\\nlocal defaultAmountValue = 50\\n\\nparameters = {\\n -- specify a tag name. If set only events with this tag name will be affected by the staccato mod. \\n { name=\\"forTag\\", default=ParameterValueNoTag },\\n -- the ammount of the staccato mod. Can be between 0 and 100\\n { name=\\"amount\\", default=\\"50\\" }\\n}\\n\\nfunction perform(events, params, timeinfo) \\n checkLegacyNamedParams(params, \\"forTag\\", \\"amount\\")\\n local tag = params.forTag\\n if tag == ParameterValueNoTag then\\n tag = nil\\n end\\n local amount = tonumber(params.amount)\\n local factor = 100 - ((amount/100) * 90)\\n factor = factor / 100\\n for i, event in pairs(events) do\\n if tag == nil or contains(event.tags, tag) then\\n event.duration = event.duration / factor\\n end\\n end\\n return events\\nend"}, {"path": "lua/mods/myArpeggio.lua", "data": "-- <command name=\\"myArpeggio\\" where=\\"mod\\" using=\\"lua/mod/myArpeggio.lua\\">\\n-- <![CDATA[\\n-- A simple arpeggio implementation.\\n-- **Example**\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/mods/myArpeggio.lua\\";\\\\n\\n--tempo: 120;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef: piano MyDevice _ch=0 _pc=0;\\\\n\\n--[\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /do: myArpeggio/ \\\\n\\n-- <c e g b>2 \\\\n\\n-- /do: myArpeggio _direction=down/ \\\\n\\n-- <c eb g bb>2 \\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- ]]>\\n-- </command>\\n-- <param name=\\"style\\" optional=\\"1\\" type=\\"[normal,legato]\\">Performs the arpeggio normal or legato</param>\\n-- <param name=\\"direction\\" optional=\\"1\\" type=\\"[up,down]\\">the direction of the arpeggio. (Default=up)</param>\\n\\nrequire \\"lua/com/com\\"\\nrequire \\"_events\\"\\n\\n\\nparameters = {\\n -- can be legato, normal\\n { name=\\"style\\", default=\\"normal\\" },\\n -- can be up, down\\n { name=\\"direction\\", default=\\"up\\" }\\n}\\n\\nfunction perform(eventsOrigin, params, timeinfo)\\n checkLegacyNamedParams(params, \\"direction\\", \\"style\\")\\n local event = eventsOrigin[1]\\n local events = { }\\n local comparer = pitchCompare\\n local direction = params.direction\\n local style = params.style\\n\\n if direction == \\"down\\" then\\n comparer = pitchCompareReversed\\n end\\n local duration = event.duration / #event.pitches\\n table.sort( event.pitches, comparer)\\n for i, pitch in pairs(event.pitches) do\\n local note = Note:new()\\n note.duration = duration\\n if style == \\"legato\\" then\\n note.duration = event.duration\\n end\\n note.velocity = event.velocity\\n note.offset = (i-1) * duration\\n note.isTied = event.isTied\\n note:addPitch(pitch.pitch, pitch.octave)\\n table.insert(events, note) \\n end\\n return events\\nend"}, {"path": "lua/mods/staccato.lua", "data": "-- <command name=\\"staccato\\" where=\\"mod\\" using=\\"lua/mod/staccato.lua\\">\\n-- Performs every note staccato. It is also possible to tag single notes.\\n-- If a tag is given, only the tagged notes are performed staccato.\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/mods/staccato.lua\\";\\\\n\\n--tempo: 140;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef:piano MyDevice _ch=0 _pc=0;\\\\n\\n--[\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /mod: staccato _forTag=stac _amount=100/\\\\n\\n-- -- only the `d` will be performed staccato. \\\\n\\n-- c \\"stac\\"@d e f\\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ``` \\n-- </command>\\n-- <param name=\\"forTag\\" optional=\\"1\\" type=\\"text\\">Specifies a tag name. If set only events with this tag name will be affected by the staccato mod.</param>\\n-- <param name=\\"amount\\" optional=\\"1\\" type=\\"0..100\\">The ammount of the staccato effect</param>\\n\\nrequire \\"lua/com/com\\"\\n\\n\\nparameters = {\\n -- specify a tag name. If set only events with this tag name will be affected by the staccato mod. \\n { name=\\"forTag\\", default=ParameterValueNoTag },\\n -- the ammount of the staccato mod. Can be between 0 and 100\\n { name=\\"amount\\", default=\\"50\\" }\\n}\\n\\nfunction perform(events, params, timeinfo)\\n checkLegacyNamedParams(params, \\"forTag\\", \\"amount\\")\\n local tag = params.forTag\\n if tag == ParameterValueNoTag then\\n tag = nil\\n end\\n local amount = tonumber(params.amount)\\n local factor = 100 - ((amount/100) * 90)\\n factor = factor / 100\\n for i, event in pairs(events) do\\n if tag == nil or contains(event.tags, tag) then\\n event.duration = event.duration * factor\\n end\\n end\\n return events\\nend"}, {"path": "lua/mods/swing.lua", "data": "-- <command name=\\"swing\\" where=\\"mod\\" using=\\"lua/mod/swing.lua\\">\\n-- Performs a swing groove.\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/mods/swing.lua\\";\\\\n\\n--tempo: 120;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef: piano MyDevice _ch=0 _pc=0;\\\\n\\n--[\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /mod: swing/\\\\n\\n-- c8 c c c c c c c\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- </command>\\n-- <param name=\\"grid\\" optional=\\"1\\" type=\\"[8, 16]\\">Performs the swing offset either on 8th or 16th. (Default=8)</param>\\n-- <param name=\\"offset\\" optional=\\"1\\" type=\\"0..100\\">The ammount of the swing offset</param>\\n\\nrequire \\"lua/com/com\\"\\n\\nparameters = {\\n -- can be 8, 16\\n { name=\\"grid\\", default=\\"8\\" },\\n -- can be between 0 and 100\\n { name=\\"offset\\", default=\\"100\\" }\\n}\\n\\n\\nfunction compareQuarters(a, b)\\n return math.abs(a-b) <= 0.1\\nend\\n\\nfunction isLaidBack(timeinfo, grid)\\n local q = timeinfo.quarterPosition\\n q = q - math.floor(q)\\n if grid == 16 then\\n return compareQuarters(q, 0.25) or compareQuarters(q, 0.75)\\n end\\n return compareQuarters(q, 0.5)\\nend\\n\\nfunction offset(grid, offset)\\n if offset == nil then\\n offset = 100\\n end\\n offset = offset / 100\\n local max = 0.25\\n if grid == 16 then\\n max = 0.09\\n end\\n return offset * max\\nend\\n\\nfunction perform(events, params, timeinfo)\\n checkLegacyNamedParams(params, \\"grid\\", \\"offset\\")\\n local gridValue = tonumber(params.grid)\\n local offsetValue = tonumber(params.offset)\\n for i, event in pairs(events) do\\n if isLaidBack(timeinfo, gridValue) then\\n event.offset = offset(gridValue, offsetValue)\\n event.velocity = event.velocity\\n end\\n end\\n return events\\nend"}, {"path": "lua/voicings/config.lua", "data": "PitchRanges = {\\n contrabass = { min=28, max=55 },\\n bass = { min=40, max=60 },\\n baritone = { min=45, max=69 },\\n tenor = { min=48, max=72 },\\n alto = { min=53, max=77 },\\n mezzosoprano = { min=57, max=81 },\\n soprano = { min=60, max=84 }\\n}"}, {"path": "lua/voicings/guitar.lua", "data": "-- <command name=\\"guitar\\" where=\\"voicingStrategy\\" using=\\"lua/voicings/guitar.lua\\">\\n-- <![CDATA[\\n-- Tries to simulate the chord voicing of an guitar.\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/voicings/guitar.lua\\";\\\\n\\n--using \\"chords/default.chords\\";\\n--tempo: 120;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef:piano MyDevice _ch=0 _pc=0;\\\\n\\n--[\\\\n\\n--type: template;\\\\n\\n--name: myTemplate;\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /voicingStrategy: guitar/\\\\n\\n-- <I II III IV V VI VII>1\\\\n\\n--}\\\\n\\n--]\\\\n\\n--[\\\\n\\n--type: accomp;\\n--{\\\\n\\n-- C | F | G | C |\\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- ]]>\\n-- </command>\\n-- <param name=\\"range\\" optional=\\"1\\" type=\\"[contrabass,bass,baritone,tenor,alto,mezzosoprano,soprano]\\">If given the strategy tries to keeps the range by shifting the octave of the chord.</param>\\n\\nrequire \\"lua/com/com\\"\\nrequire \\"lua/com/globals\\"\\nrequire \\"solvers/guitar\\"\\n\\nparameters = {\\n table.unpack(ASolverDefaultParameter)\\n}\\n\\nlocal solver = GuitarSolver:new()\\n\\nfunction solve(chord, degrees, params, timeinfo)\\n return solver:solve(chord, degrees, params)\\nend"}, {"path": "lua/voicings/simple.lua", "data": "-- <command name=\\"simple\\" where=\\"voicingStrategy\\" using=\\"lua/voicings/simple.lua\\">\\n-- <![CDATA[\\n-- The simple approach with no strategy.\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/voicings/simple.lua\\";\\\\n\\n--using \\"chords/default.chords\\";\\n--tempo: 120;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef:piano MyDevice _ch=0 _pc=0;\\\\n\\n--[\\\\n\\n--type: template;\\\\n\\n--name: myTemplate;\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /voicingStrategy: simple/\\\\n\\n-- <I II III IV V VI VII>1\\\\n\\n--}\\\\n\\n--]\\\\n\\n--[\\\\n\\n--type: accomp;\\n--{\\\\n\\n-- C | F | G | C |\\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- ]]>\\n-- </command>\\n-- <param name=\\"range\\" optional=\\"1\\" type=\\"[contrabass,bass,baritone,tenor,alto,mezzosoprano,soprano]\\">If given the strategy tries to keeps the range by shifting the octave of the chord.</param>\\n\\nrequire \\"lua/com/com\\"\\nrequire \\"solvers/simple\\"\\nrequire \\"solvers/asolver\\"\\n\\nparameters = {\\n table.unpack(ASolverDefaultParameter)\\n}\\n\\nlocal solver = Simple:new()\\n\\nfunction solve(chord, degrees, parameters)\\n return solver:solve(chord, degrees, parameters)\\nend"}, {"path": "lua/voicings/voicelead.lua", "data": "-- <command name=\\"voicelead\\" where=\\"voicingStrategy\\" using=\\"lua/voicings/voicelead.lua\\">\\n-- <![CDATA[\\n-- Tries to simulates a voice leading approach:\\n-- the octaves of a chord are rearranged, so that the actual pitch distance between the previous chord is kept minimal.\\n-- ```language=Werckmeister\\\\n\\n--using \\"lua/voicings/voicelead.lua\\";\\\\n\\n--using \\"chords/default.chords\\";\\n--tempo: 120;\\\\n\\n--device: MyDevice midi 0;\\\\n\\n--instrumentDef:piano MyDevice _ch=0 _pc=0;\\\\n\\n--[\\\\n\\n--type: template;\\\\n\\n--name: myTemplate;\\\\n\\n--instrument: piano;\\\\n\\n--{\\\\n\\n-- /voicingStrategy: voicelead/\\\\n\\n-- <I II III IV V VI VII>1\\\\n\\n--}\\\\n\\n--]\\\\n\\n--[\\\\n\\n--type: accomp;\\n--{\\\\n\\n-- C | F | G | C |\\\\n\\n--}\\\\n\\n--]\\\\n\\n-- ```\\n-- ]]>\\n-- </command>\\n-- <param name=\\"range\\" optional=\\"1\\" type=\\"[contrabass,bass,baritone,tenor,alto,mezzosoprano,soprano]\\">If given the strategy tries to keeps the range by shifting the octave of the chord.</param>\\n\\nrequire \\"lua/com/com\\"\\nrequire \\"lua/com/globals\\"\\nrequire \\"solvers/voicelead\\"\\n\\nparameters = {\\n table.unpack(ASolverDefaultParameter)\\n}\\n\\nlocal solver = VoiceLeadSolver:new()\\n\\nfunction solve(chord, degrees, params)\\n return solver:solve(chord, degrees, params)\\nend"}, {"path": "lua/voicings/solvers/asolver.lua", "data": "require \\"config\\"\\nrequire \\"lua/com/com\\"\\n\\nNoRangeSet = \\"__noRangeSet\\"\\nNoImportantDegreesSet = \\"_noImportantDegreesSet\\"\\n\\nASolverDefaultParameter = {\\n -- can be contrabass, bass, baritone, tenor, alto, mezzosoprano, soprano\\n { name=\\"range\\", default=NoRangeSet },\\n { name=\\"importantDegrees\\", default=NoImportantDegreesSet },\\n { name=\\"importantDegree\\", default=NoImportantDegreesSet },\\n}\\nASolver = {}\\n\\nfunction ASolver:new(o)\\n local o = o or {}\\n setmetatable(o, self)\\n self.__index = self\\n return o\\nend\\n\\nfunction ASolver:checkForLegacyParameters(params)\\n checkLegacyNamedParams(params, \\"range\\", \\"importantDegrees\\", \\"importantDegree\\")\\nend\\n\\n-- returns the a degree def from the given degree def collection\\n-- if more than one degree def defined, it will return the first one\\nfunction ASolver:getDefaultDegreeDef(degreeValue, degrees)\\n local default = degrees[degreeValue]\\n if default == nil \\n then\\n return nil\\n end\\n return default[1]\\nend\\n\\n-- creates a absolute pitch using the given chord\\nfunction ASolver:createPitch(chord, degreeDef, octave)\\n if degreeDef == nil or degreeDef.degreeValue == nil\\n then\\n return nil\\n end\\n return { [\\"pitch\\"]= self:degreeToPitch(degreeDef, chord), [\\"octave\\"]=octave }\\nend\\n\\nfunction ASolver:degreeToPitch(degreeDef, chord)\\n return chord.rootPitch + degreeDef.degreeValue\\nend\\n\\nfunction ASolver:getAbsolutePitch(pitch)\\n return pitch.pitch + (pitch.octave * 12)\\nend\\n\\nfunction ASolver:_addImportantDegree(degrees, degreeVal, semitone)\\n local degreeInfo = self:getDefaultDegreeDef(degreeVal, degrees)\\n if degreeInfo==nil then\\n return\\n end\\n local degrObj = {\\n degreeValue= semitone,\\n octave= degreeInfo.octave\\n }\\n degrees[degreeVal] = {degrObj}\\nend\\n\\n-- set important degrees if defined in params\\n-- more informations about important degrees:\\n-- https://github.com/werckme/werckmeister/issues/123\\nfunction ASolver:_setImportantDegreesIfExists(params, degrees)\\n local strDegree = params.importantDegree\\n if (strDegree == nil or strDegree == NoImportantDegreesSet) then\\n strDegree = params.importantDegrees\\n if strDegree == nil or strDegree == NoImportantDegreesSet then\\n return\\n end\\n end\\n local strDegrees = split(strDegree, \\" \\")\\n for i, degree in pairs(strDegrees) do \\n local degreeVal = DegreeStringValues[degree]\\n if degreeVal ~= nil then\\n local semitone = MajorScaleSemitones[degree]\\n self:_addImportantDegree(degrees, degreeVal, semitone)\\n end\\n end\\nend\\n\\n-- solves degrees into absolute pitches\\n-- @param chord: the current cord informations\\n-- @param degrees: the current degree event including the semitone informations from \\n-- the chord definition eg.: { II= {degreeValue, octave} }\\n-- If the current chord has no information about a degree\\n-- the value is empty eg.: II= {} \\nfunction ASolver:solve(chord, degrees, params)\\n self:checkForLegacyParameters(params)\\n self:_setImportantDegreesIfExists(params, degrees)\\n local result = self:_solveImpl(chord, degrees, params)\\n if params.range ~= nil and params.range ~=NoRangeSet then\\n self:_keepRange(result, params.range)\\n end\\n return result\\nend\\n\\nfunction ASolver:_solveImpl(chord, degrees, args)\\n error(\\"this is an abstract function\\")\\nend\\n\\nfunction ASolver:_transpose(pitches, numOctaves)\\n for i, pitch in pairs(pitches) do\\n pitch.octave = pitch.octave + numOctaves\\n end\\nend\\n\\nfunction ASolver:_keepRange(pitches, strRange)\\n local destinationRange = PitchRanges[strRange]\\n if destinationRange == nil then\\n error(\\"strRange \\" .. strRange .. \\" not defined\\")\\n end\\n local nbUnder = 0\\n local nbOver = 0\\n local mindiff = math.maxinteger\\n local maxdiff = math.mininteger\\n for i, pitch in pairs(pitches) do\\n local midipitch = toMidiPitch(pitch)\\n if midipitch > destinationRange.max then\\n local diff = midipitch - destinationRange.max\\n if diff > maxdiff then\\n maxdiff = diff\\n end\\n nbOver = nbOver + 1\\n end\\n if midipitch < destinationRange.min then\\n local diff = destinationRange.min - midipitch\\n if diff < mindiff then\\n mindiff = diff\\n end\\n nbUnder = nbUnder + 1\\n end\\n end\\n if nbUnder > nbOver then\\n local octaves = math.ceil(mindiff/12)\\n self:_transpose(pitches, octaves)\\n end\\n if nbUnder < nbOver then\\n local octaves = -math.ceil(maxdiff/12)\\n self:_transpose(pitches, octaves)\\n end\\nend"}, {"path": "lua/voicings/solvers/config.lua", "data": "PitchRanges = {\\n contrabass = { min=28, max=55 },\\n bass = { min=40, max=60 },\\n baritone = { min=45, max=69 },\\n tenor = { min=48, max=72 },\\n alto = { min=53, max=77 },\\n mezzosoprano = { min=57, max=81 },\\n soprano = { min=60, max=84 }\\n}"}, {"path": "lua/voicings/solvers/guitar.lua", "data": "require \\"lua/voicings/solvers/asolver\\"\\nrequire \\"lua/com/globals\\"\\n\\n-- https://www.8notes.com \\n-- https://www.oolimo.de/gitarrenakkorde/find\\n-- https://www.scales-chords.com/chord/piano/\\nVoicingMatrix = {\\n [\\"1234567/bass\\"] = nil,\\n [\\"1010100\\"] = {I, V, I, III, I}, -- base\\n [\\"1100100\\"] = {I, V, I, II }, -- sus2\\n [\\"1001100\\"] = {I, V, I, IV, V }, -- sus4\\n [\\"1001101\\"] = {I, V, VII, IV, V}, -- 7sus4\\n [\\"1101101\\"] = {I, IV, VII, II, V}, -- 9sus4\\n [\\"1010110\\"] = {I, VI, III, V}, -- 6\\n [\\"1110110\\"] = {I, VI, III, V, II}, -- 6/9\\n [\\"1010101\\"] = {I, V, VII, III, I}, -- 7\\n [\\"1110101\\"] = {I, III, VII, II}, -- 9\\n [\\"1110100\\"] = {I, V, II, III}, -- add9\\n [\\"1011101\\"] = {I, IV, VII, III}, -- 11\\n [\\"1011001\\"] = {I, VII, III, IV}, -- 7#11\\n [\\"1010111\\"] = {I, V, VII, III, VI}, -- 13\\n [\\"1010101/7\\"] = {VII, V, I, III}, -- /7\\n [\\"1010100/5\\"] = {V, I, III, V}, -- /5\\n [\\"1011100/4\\"] = {IV, V, I, III}, -- /4\\n [\\"1010100/3\\"] = {III, V, I, III}, -- /3\\n [\\"1110100/2\\"] = {II, V, I, III}, -- /2\\n}\\n\\n\\n-- returns the degrees defined for a chord as a bit string.\\n-- e.g.: Xmaj\'s degrees are defined as I III V\\n-- 1234567\\n-- as bitstring = 1010100\\n-- if chord is a slash chord, the degree value will be appended as number.\\n-- e.g.: X/V = 1010100/5\\nfunction chordToHashString(chord)\\n bits = {}\\n slashAppendings = {}\\n local degree = chord.degrees\\n for i=1, 7 do\\n if degree[i] == nil then\\n bits[i] = 0\\n else\\n bits[i] = 1\\n if chord.degrees[i] < 0 then\\n table.insert(slashAppendings, i)\\n end\\n end\\n end\\n if #slashAppendings == 0 then\\n return table.concat(bits)\\n end\\n return table.concat(bits) .. \\"/\\" .. table.concat(slashAppendings)\\nend\\n\\nGuitarSolver = ASolver:new()\\n\\nfunction GuitarSolver:degreeToPitch(degreeDef, chord)\\n return chord.rootPitch + (degreeDef.degreeValue % 12)\\nend\\n\\nfunction GuitarSolver:_solveImpl(chord, degrees, params)\\n local d = function(degreeValue) return self:getDefaultDegreeDef(degreeValue, degrees) end\\n local strDegrees = chordToHashString(chord)\\n local voicing = VoicingMatrix[strDegrees]\\n if voicing == nil then\\n error(\\"no voicing found defined for \\" .. chord.strBase .. chord.strOptions .. \\" \\" .. strDegrees)\\n end\\n local result = {}\\n local octave = -1\\n local lastDegree = -1\\n for idx, degree in pairs(voicing) do\\n if degree <= lastDegree then \\n octave = octave + 1\\n end\\n lastDegree = degree\\n result[idx] = self:createPitch(chord, d(degree ), octave)\\n end\\n return result\\nend"}, {"path": "lua/voicings/solvers/simple.lua", "data": "require \\"lua/voicings/solvers/asolver\\"\\nrequire \\"lua/com/globals\\"\\n\\nSimple = ASolver:new()\\n\\nfunction Simple:degreeToPitch(degreeDef, chord)\\n return chord.rootPitch + degreeDef.degreeValue\\nend\\n\\nfunction Simple:_solveImpl(chord, degrees, parameters)\\n local pitches = {}\\n for degree, degreeDefs in pairs(degrees)\\n do\\n if isnumber(degree)\\n then\\n for idx, degreeDef in pairs(degreeDefs)\\n do\\n table.insert(pitches, self:createPitch(chord, degreeDef, degreeDef.octave))\\n end\\n end\\n end\\n return pitches\\nend"}, {"path": "lua/voicings/solvers/voicelead.lua", "data": "require \\"simple\\"\\nrequire \\"lua/com/globals\\"\\n\\nVoiceLeadSolver = Simple:new()\\n\\nfunction VoiceLeadSolver:getPitchWithMinDistance(pitch, pitches)\\n local min = math.maxinteger\\n local minPitch = nil\\n local relPitch = pitch.pitch % 12\\n for i, refpitch in pairs(pitches) do\\n local diff = relpitchdiff(refpitch.pitch, relPitch)\\n diff = math.abs(diff)\\n if (diff < min) then\\n minPitch = refpitch\\n min = diff\\n end\\n end\\n return minPitch\\nend\\n\\n-- changes the octave of pitch, so that the interval\\n-- between pitch and targetPitch is minimal\\nfunction VoiceLeadSolver:toPitchNextTo(pitch, targetPitch)\\n if targetPitch == nil then\\n return pitch\\n end\\n local diff = pitch.pitch - targetPitch.pitch\\n pitch.octave = targetPitch.octave\\n --print(pitch.pitch, targetPitch.pitch, diff)\\n if (diff > 6) then\\n pitch.octave = pitch.octave - 1\\n end\\n if (diff < -6) then\\n pitch.octave = pitch.octave + 1\\n end\\n return pitch\\nend\\n\\n\\n-- compare pitches with a reference and adjust octaves\\nfunction VoiceLeadSolver:adjustOctaves(pitches, reference)\\n for i, pitch in pairs(pitches) do\\n local min = self:getPitchWithMinDistance(pitch, reference) \\n self:toPitchNextTo(pitch, min)\\n end\\n return pitches\\nend\\n\\nfunction VoiceLeadSolver:_solveImpl(chord, degrees, params)\\n local pitches = Simple:_solveImpl(chord, degrees, params)\\n if #pitches < 2\\n then\\n return pitches\\n end\\n if self.previous ~= nil \\n then\\n pitches = self:adjustOctaves(pitches, self.previous)\\n end\\n return pitches\\nend\\n\\nfunction VoiceLeadSolver:solve(chord, degrees, params)\\n self:checkForLegacyParameters(params)\\n local result = self:_solveImpl(chord, degrees, params)\\n if params.range ~=nil and params.range ~=NoRangeSet then\\n self:_keepRange(result, params.range)\\n end\\n self.previous = result\\n return result\\nend"}, {"path": "pitchmaps/battery3.tight.pitchmap", "data": "\\"bd\\": c,,\\n\\"sn\\": d,,\\n\\"sng\\": g# --snare ghost notes\\n\\"ss\\": c#,, -- sidestick\\n\\"hc\\": d#,, -- handclap\\n\\"ht\\": f#,, -- hihat closed\\n\\"hf\\": g#,, -- hihat foot\\n\\"ho\\": bb,, -- hihat open\\n\\"ho1\\": g\' -- hihat half open1\\n\\"ho2\\": g#\' -- hihat half open2\\n\\"ho3\\": a\' -- hihat half open3\\n\\"cy\\": c#,\\n\\"hto\\": c,\\n\\"hto1\\": c,\\n\\"hto2\\": d,\\n\\"mto\\": b,,\\n\\"mto1\\": b,,\\n\\"mto2\\": a,,\\n\\"lto\\": g,,\\n\\"lto1\\": g,,\\n\\"lto2\\": f,,\\n\\"rdbell\\": f#,\\n\\"mtr\\": ab\'\\n\\"otr\\": a\'\\n-- r&l\\n\\"snl\\": d,,\\n\\"snr\\": e,,\\n\\"riml\\": c#,,\\n\\"rimr\\": d#,,\\n\\"htol\\": e,\\n\\"htor\\": f,\\n\\"mtol\\": c,\\n\\"mtor\\": d,\\n\\"ltol\\": b,,\\n\\"ltor\\": a,,\\n\\"ftol\\": g,,\\n\\"ftor\\": f,,\\n"}, {"path": "pitchmaps/defaultMIDI.pitchmap", "data": "\\"bd\\": c,,,,\\n\\"bd2\\": b,,,\\n\\"o\\": b,,,\\n\\"sn\\": d,,\\n\\"x\\": d,,\\n\\"sn2\\": e,,\\n\\"esn\\": e,, -- electric snare\\n\\"sng\\": d,, --snare ghost notes\\n\\"ss\\": c#,, -- sidestick\\n\\"hc\\": d#,, -- handclap\\n\\"ht\\": f#,, -- hihat closed\\n\\"h\\": f#,, -- hihat closed\\n\\"hf\\": g#,, -- hihat foot\\n\\"h,\\": g#,, -- hihat foot\\n\\"ho\\": bb,, -- hihat open\\n\\"h\'\\": bb,, -- hihat open\\n\\"ho1\\": bb,, -- hihat half open1\\n\\"ho2\\": bb,, -- hihat half open2\\n\\"ho3\\": bb,, -- hihat half open3\\n\\"cy\\": c#, -- crash cymbal\\n\\"spl\\": g, -- splash cymbal\\n\\"hto\\": c, -- high tom \\n\\"m\'\\": c, -- high tom \\n\\"hto1\\": c,\\n\\"hto2\\": d,\\n\\"mto\\": b,, -- middle tom\\n\\"m\\": b,, -- middle tom\\n\\"mto1\\": b,,\\n\\"mto2\\": a,,\\n\\"lto\\": g,, -- low tom\\n\\"m,\\": g,, -- low tom\\n\\"lto1\\": g,,\\n\\"lto2\\": f,,\\n\\"rcym1\\": d#, -- ride cymbal 1\\n\\"rcym2\\": b, -- ride cymbal 2\\n\\"rbell\\": f, -- ride bell\\n\\"mtr\\": ab\' -- muted triangle\\n\\"otr\\": a\' -- open triangle\\n\\"bo1\\": c --bongo 1\\n\\"bo2\\": c# --bongo 2\\n\\"tim1\\": f --timbale 1\\n\\"tim2\\": f# --timbale 2\\n\\"ago1\\": g --agogo 1\\n\\"ago2\\": g# --agogo 2\\n\\"cui1\\": f#\' -- cuica 1\\n\\"cui2\\": g\' -- cuica 2\\n\\"cwb\\": g#, -- cowbell\\n\\"cla\\": d#\' -- claves\\n\\"mcon\\":d -- mute high conga\\n\\"ocon\\":d# -- open conga\\n\\"lcon\\":e -- low conga\\n\\"tmb\\":f#, -- tambourine \\n\\n\\n\\"brsw\\": e,, -- brush swirl\\n\\"brtp\\": d,, -- brush tap\\n\\"brsp\\": d#,, -- brush slap"}, {"path": "pitchmaps/defaultMidiDrumMap.pitchmap", "data": "\\"bd\\": c,,,,\\n\\"sn\\": d,,\\n\\"sng\\": d,, --snare ghost notes\\n\\"ss\\": c#,, -- sidestick\\n\\"hc\\": d#,, -- handclap\\n\\"ht\\": f#,, -- hihat closed\\n\\"hf\\": g#,, -- hihat foot\\n\\"ho\\": bb,, -- hihat open\\n\\"ho1\\": bb,, -- hihat half open1\\n\\"ho2\\": bb,, -- hihat half open2\\n\\"ho2\\": bb,, -- hihat half open3\\n\\"cy\\": c#, -- crash cymal\\n\\"spl\\": g, -- splash cymal\\n\\"hto\\": c, -- high tom \\n\\"hto1\\": c,\\n\\"hto2\\": d,\\n\\"mto\\": b,, -- middle tom\\n\\"mto1\\": b,,\\n\\"mto2\\": a,,\\n\\"lto\\": g,, -- low tom\\n\\"lto1\\": g,,\\n\\"lto2\\": f,,\\n\\"rdbell\\": b,\\n\\"mtr\\": ab\' -- muted triangle\\n\\"otr\\": a\' -- open triangle\\n\\"bo1\\": c --bongo 1\\n\\"bo2\\": c# --bongo 2\\n\\"tim1\\": f --timbale 1\\n\\"tim2\\": f# --timbale 2\\n\\"ago1\\": g --agogo 1\\n\\"ago2\\": g# --agogo 2\\n\\"cui1\\": f#\' -- cuica 1\\n\\"cui2\\": g\' -- cuica 2\\n\\"cwb\\": g#, -- cowbell\\n\\"cla\\": d#\' -- claves\\n\\n\\"cr\\": c#, -- crash cymal\\n\\"t1\\": c, -- high tom \\n\\"t2\\": b,, -- middle tom\\n\\"t3\\": g,, -- low tom\\n\\"t4\\": f,,"}, {"path": "templates/bass.blues.template", "data": "[\\ntype: template;\\nname: bass.blues.normal; \\ninstrument: bass;\\n{\\n /do: swing _grid=8 _offset =60/\\n I,,,8 & I,,& VII,,,& V,,,& |\\n}\\n]"}, {"path": "templates/bass.bossanova.template", "data": "[\\ntype: template;\\nname: bass.bossanova.normal;\\ninstrument: bass; \\n{\\n \\\\fff\\n I,,4. V,,8 V,,4. I,,8 |\\n I,,4. V,,8 V,,4 I,,4 |\\n I,,4. V,,8 V,,4. I,,8 |\\n I,,4. V,,8 V,,4 I,,8 V,,8 |\\n} \\n] \\n"}, {"path": "templates/bass.country.template", "data": "[\\ntype: template;\\nname: bass.country.normal;\\ninstrument: bass; \\n{\\n I,,4. I,,8 V,,,4. V,,,8 |\\n} \\n] \\n\\n[\\ntype: template;\\nname: bass.country.ende;\\ninstrument: bass; \\n{\\n I,,1 |\\n} \\n] "}, {"path": "templates/bass.disco.template", "data": "[\\ntype: template;\\nname: bass.disco.normal;\\ninstrument: bass;\\n{\\n \\\\ffff\\n I,,8 I,16 I,16 I,,8 I,16 I,16 I,,8 I,16 I,16 I,,8 I,16 I,16 |\\n} \\n]\\n"}, {"path": "templates/bass.jazzSwing.template", "data": "-- tempo: 155\\n-- signature: 4/4\\n-- parts: normal\\n[\\ntype: template;\\nname: bass.jazzSwing.normal;\\ninstrument: bass; \\n{\\n I,,2 V,, | \\n I,, V,,,4 I,, |\\n}\\n\\n]\\n"}, {"path": "templates/bass.reggae.template", "data": "using \\"lua/mods/swing.lua\\";\\n\\n[\\ntype: template;\\nname: bass.reggae.normal;\\ninstrument: bass;\\n{\\n /do: swing _grid=8 _offset =30/\\n I,,16 r16 I,,8 r2 V,,,4 |\\n I,,16 r16 r8 I,,8 r4. V,,,4 |\\n I,,16 r16 I,,8 r2 V,,,4 |\\n I,,16 r16 I,,8 r2 V,,,4 |\\n}\\n]"}, {"path": "templates/bass.soca.template", "data": "[\\ntype: template;\\nname: bass.soca.normal;\\ninstrument: bass;\\n{\\n r8 r16 I,,32 r32 I,,8 I,,16 r \\n r8 r16 I,,32 r32 r16 I,,32 r V,,, r I,, r |\\n}\\n]"}, {"path": "templates/bossanova.template", "data": "using \\"lua/voicings/voicelead.lua\\";\\nusing \\"lua/voicings/simple.lua\\";\\nusing \\"lua/voicings/guitar.lua\\";\\nusing \\"lua/mods/guitarStroke.lua\\";\\n\\n[\\ntype: template;\\nname: bossanova.normal;\\ninstrument: drums;\\n{\\n \\"ht\\"8 !f\\"ht\\" \\"ht\\" !f\\"ht\\" \\"ht\\" \\"ht\\" \\"ht\\" !f\\"ht\\" |\\n} \\n{\\n \\\\fff\\n r4 \\"ss\\"8 r4 \\"ss\\"8 r4 | \\"ss\\"4. \\"ss\\"8 r4 \\"ss\\" |\\n} \\n{\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"4. \\"bd\\"8 |\\n} \\n]\\n\\n[\\ntype: template;\\nname: bossanova.normal;\\ninstrument: guitar; \\n{\\n /do: guitarStroke _value=32/\\n /voicingStrategy: guitar/\\n \\\\f\\n <I II III IV V VI VII>4 <I II III IV V VI VII>4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 |\\n r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 r4 <I II III IV V VI VII>4 |\\n <I II III IV V VI VII>4 <I II III IV V VI VII>4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 |\\n r4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>4. |\\n} \\n] \\n\\n[\\ntype: template;\\nname: bossanova.normal;\\ninstrument: piano; \\n{\\n -- /voicingStrategy: simple _range=tenor/\\n <VII, VII>4 <III, V,>8 <V, V>8 r8 <III, V,>8 r8 <V, V> | r8 <III, V,>8 r8 <V, V> r8 <III, V,> r8 <VII, VII> |\\n} \\n] \\n\\n[\\ntype: template;\\nname: bossanova.normal;\\ninstrument: bass; \\n{\\n \\\\fff\\n I,,4. V,,8 V,,4. I,,8 |\\n I,,4. V,,8 V,,4 I,,4 |\\n I,,4. V,,8 V,,4. I,,8 |\\n I,,4. V,,8 V,,4 I,,8 V,,8 |\\n} \\n] \\n"}, {"path": "templates/countryschlager1.template", "data": "using \\"lua/voicings/guitar.lua\\";\\nusing \\"lua/voicings/voicelead.lua\\";\\nusing \\"lua/mods/guitarStroke.lua\\";\\n\\n[\\ntype: template;\\nname: countryschlager1.normal;\\ninstrument: guitar; \\n{\\n /do: guitarStroke/\\n /voicingStrategy: guitar _range=tenor/\\n \\\\f\\n <I II III IV V VI VII>8 <I II III IV V VI VII>8 r8 \\n <I II III IV V VI VII>4 <I II III IV V VI VII>8 <I II III IV V VI VII>8 <I II III IV V VI VII>8 |\\n} \\n]\\n\\n[\\ntype: template;\\nname: countryschlager1.normal;\\ninstrument: slide; \\n{\\n \\\\f\\n /modOnce: bend from 0/\\n r1 |\\n r1 |\\n r1 |\\n <I\' II\' III\' IV\' V\' VI\' VII\'>1 |\\n r1 |\\n r1 |\\n r1 |\\n /modOnce: bend to 100/\\n <I\' II\' III\' IV\' V\' VI\' VII\'>1 |\\n} \\n] \\n\\n[\\ntype: template;\\nname: countryschlager1.normal;\\ninstrument: bass; \\n{\\n I,,4. I,,8 V,,,4. V,,,8 |\\n} \\n] \\n\\n[\\ntype: template;\\nname: countryschlager1.normal;\\ninstrument: drums;\\n{\\n \\"ht\\"8 !f\\"ht\\"8 \\"ht\\"8 !f\\"ht\\"8 \\"ht\\"8 !f\\"ht\\"8 \\"ht\\"8 !f\\"ht\\"8 |\\n} \\n{\\n r4 \\"sn\\" r \\"sn\\" |\\n}\\n{\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"4. \\"bd\\"8 |\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"4. \\"bd\\"8 |\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"8 !f\\"bd\\"8 r8 \\"bd\\"8 |\\n} \\n] \\n\\n[\\ntype: template;\\nname: countryschlager1.ende;\\ninstrument: guitar; \\n{\\n /do: guitarStroke _value=8/\\n <I II III IV V VI VII>1 |\\n} \\n] \\n\\n[\\ntype: template;\\nname: countryschlager1.ende;\\ninstrument: bass; \\n{\\n I,,1 |\\n} \\n] \\n\\n[\\ntype: template;\\nname: countryschlager1.ende;\\ninstrument: drums;\\n{\\n \\"cy\\"1 |\\n} \\n{\\n \\"bd\\"1|\\n} \\n]\\n\\n[\\ntype: template;\\nname: countryschlager1.ende;\\ninstrument: slide; \\n{\\n \\\\f\\n /modOnce: bend from 1/\\n <I\' II\' III\' IV\' V\' VI\' VII\'>1 |\\n} \\n] \\n"}, {"path": "templates/drums.bossanova.template", "data": "[\\ntype: template;\\nname: drums.bossanova.normal;\\ninstrument: drums;\\n{\\n \\"ht\\"8 !f\\"ht\\" \\"ht\\" !f\\"ht\\" \\"ht\\" \\"ht\\" \\"ht\\" !f\\"ht\\" |\\n} \\n{\\n \\\\fff\\n r4 \\"ss\\"8 r4 \\"ss\\"8 r4 | \\"ss\\"4. \\"ss\\"8 r4 \\"ss\\" |\\n} \\n{\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"4. \\"bd\\"8 |\\n} \\n]"}, {"path": "templates/drums.country.template", "data": "[\\ntype: template;\\nname: drums.country.normal;\\ninstrument: drums;\\n{\\n \\"ht\\"8 !f\\"ht\\"8 \\"ht\\"8 !f\\"ht\\"8 \\"ht\\"8 !f\\"ht\\"8 \\"ht\\"8 !f\\"ht\\"8 |\\n} \\n{\\n r4 \\"sn\\" r \\"sn\\" |\\n}\\n{\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"4. \\"bd\\"8 |\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"4. \\"bd\\"8 |\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"8 !f\\"bd\\"8 r8 \\"bd\\"8 |\\n} \\n] \\n\\n[\\ntype: template;\\nname: drums.country.cymbal;\\ninstrument: drums;\\n{\\n \\"cy\\"4 \\"ht\\"8 !f\\"ht\\"8 \\"ht\\"8 !f\\"ht\\"8 \\"ht\\"8 !f\\"ht\\"8 |\\n} \\n{\\n r4 \\"sn\\" r \\"sn\\" |\\n}\\n{\\n \\"bd\\"4. \\"bd\\"8 \\"bd\\"4. \\"bd\\"8 |\\n} \\n] \\n\\n[\\ntype: template;\\nname: drums.country.ende;\\ninstrument: drums;\\n{\\n \\"cy\\"1 |\\n} \\n{\\n \\"bd\\"1|\\n} \\n]"}, {"path": "templates/drums.disco.template", "data": "[\\ntype: template;\\nname: drums.disco.normal;\\ninstrument: drums;\\n{\\n r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 |\\n r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 !ffff<\\"sn\\" \\"ht\\">16 !fffff\\"sn\\"16 |\\n \\"cy\\"8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 |\\n r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 <\\"sn\\" \\"ht\\">16 !fffff\\"sn\\"16 |\\n} \\n{\\n \\"bd\\"4 \\"bd\\" \\"bd\\" \\"bd\\" |\\n} \\n] \\n\\n[\\ntype: template;\\nname: drums.disco.solo;\\ninstrument: drums;\\n{\\n \\"bd\\"4 \\"bd\\" \\"bd\\" \\"bd\\" |\\n} \\n] \\n\\n[\\ntype: template;\\nname: drums.disco.solo2;\\ninstrument: drums;\\n{\\n \\"cy\\"8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 |\\n r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 \\"ht\\"16 \\"ht\\"16 r8 \\"ht\\"16 \\"ht\\"16 !ffff\\"sn\\"8 <\\"sn\\" \\"ht\\">16 !fffff\\"sn\\"16 |\\n} \\n{\\n \\"bd\\"4 \\"bd\\" \\"bd\\" \\"bd\\" |\\n} \\n] "}, {"path": "templates/drums.jazzSwing.template", "data": "-- tempo: 155\\n-- signature: 4/4\\n-- parts: normal, bridge\\n[\\ntype: template;\\nname: drums.jazzSwing.bridge;\\ninstrument: drumsBrushes; \\n{\\n (!ff\\"rcym1\\" r r)4 (\\"rcym1\\" r !p\\"rcym1\\") (!ff\\"rcym1\\" r r) (\\"rcym1\\" r !p\\"rcym1\\")\\n}\\n{\\n (r r \\"brtp\\")4 r4 (r r !p\\"brtp\\")4 r4 |\\n (r r !p\\"brtp\\")4 r4 (r r !p\\"brtp\\")4 r4 |\\n (r r !p\\"brtp\\")4 r4 (r r !p\\"brtp\\")4 r4 |\\n (r r !p\\"brtp\\")4 (r !pp\\"brtp\\"4 r) (r r !p\\"brtp\\")4 r4 |\\n}\\n{\\n \\\\pp\\n \\"bd2\\"4 (r r \\"bd2\\")4 r2 |\\n}\\n]\\n\\n[\\ntype: template;\\nname: drums.jazzSwing.normal;\\ninstrument: drumsBrushes; \\n{\\n \\\\pp\\n (\\"brtp\\" !pppp\\"brsw\\" r)4 (!ppp\\"brsp\\" r \\"brtp\\") (\\"brtp\\" !pppp\\"brsw\\" r) (!pp\\"brsp\\" r !p\\"brtp\\") \\n}\\n{\\n \\\\p\\n r4 \\"ht\\" r &\\n}\\n{\\n !pp\\"bd2\\"1 |\\n}\\n]"}, {"path": "templates/drums.purdie.template", "data": "[\\ntype: template;\\nname: drums.purdie.normal;\\ninstrument: drums; \\n{\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n \\\\p\\"ho\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t r8t !pp\\"ho\\"8t !pp\\"ht\\"8t |\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n \\\\p\\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n \\\\f\\"ho\\"8t \\"ht\\"8t \\"bd\\"8t \\\\f\\"ho\\"8t \\"ht\\"8t r8t \\"ht\\"8t r8t !pp\\"ht\\"8t \\"ht\\"8t r8t !pp\\"ht\\"8t |\\n}\\n{\\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t |\\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t | \\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !ppp\\"sn\\"8t !pp\\"sn\\"8t |\\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t |\\n\\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t |\\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t | \\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r4t r8t | \\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t |\\n\\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t |\\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t | \\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !ppp\\"sn\\"8t !pp\\"sn\\"8t |\\n r8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t \\\\ff\\"sn\\"8t !pppp\\"sng\\"8t r8t r8t !pppp\\"sng\\"8t r8t | \\n}\\n{\\n \\"bd\\"4t r8t r4t \\"bd\\"8t r4t r8t \\"bd\\"4t r8t |\\n}\\n]"}, {"path": "templates/drums.reggae.template", "data": "using \\"lua/mods/swing.lua\\";\\n\\n\\n[\\ntype: template;\\nname: drums.reggae.normal;\\ninstrument: drums; \\n{\\n\\n}\\n{\\n /do: swing _grid=8 _offset =50/\\n !f\\"ht\\"4 &8 !p& \\"ht\\"4 &8 !p&|\\n !f\\"ht\\"4 \\"ht\\"8t & & \\"ht\\"4 &8 !p&|\\n !f\\"ht\\"4 !pp\\"ho1\\"4 \\"ht\\"4 &8 !p&|\\n}\\n{\\n r r \\"bd\\"4 r |\\n r r \\"sn\\"4 r |\\n}\\n]\\n\\n--\\n\\n[\\ntype: template;\\nname: drums.reggae.fill1;\\ninstrument: drums; \\n{\\n\\n}\\n{\\n /do: swing _grid=8 _offset =50/\\n !f\\"ht\\"4 !p\\"ho2\\"4 r2 |\\n}\\n{\\n /do: swing _grid=8 _offset =50/\\n r \\"hto1\\"64->\\"hto1\\"4. \\"mto1\\"8 \\"mto1\\"8t r \\"mto1\\" |\\n}\\n]\\n\\n[\\ntype: template;\\nname: drums.reggae.fill2;\\ninstrument: drums; \\n{\\n\\n}\\n{\\n /do: swing _grid=8 _offset =50/\\n !f\\"ht\\"4 \\"ht\\"4 r2 |\\n}\\n{\\n /do: swing _grid=16 _offset =50/\\n !f\\"tim1\\"32->!p\\"tim2\\"8t & & \\"hto1\\"4 r2 |\\n}\\n]\\n"}, {"path": "templates/drums.soca.template", "data": "[\\ntype: template;\\nname: drums.soca.normal;\\ninstrument: drums;\\n{\\n \\"ago1\\"16 & \\"ago2\\" & \\"ago1\\" & \\"ago2\\" & \\"ago1\\"16 & \\"ago2\\" & \\"ago1\\" & \\"ago2\\" & |\\n}\\n{\\n \\"cwb\\"8 & &16 & r \\"cwb\\" r16 \\"cwb\\" r \\"cwb\\" \\"cwb\\" r & r | \\n}\\n{\\n \\\\p\\n \\"ht\\"16 & \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 |\\n}\\n{\\n \\\\ffff\\n r8. \\"sn\\"16 r8 \\"sn\\" r8. \\"sn\\"16 r8 \\"sn\\" |\\n}\\n{\\n \\"bd\\"4 \\"bd\\" \\"bd\\" \\"bd\\" |\\n}\\n]\\n\\n[\\ntype: template;\\nname: drums.soca.bridge;\\ninstrument: drums;\\n{\\n \\"ago1\\"16 & \\"ago2\\" & \\"ago1\\" & \\"ago2\\" & \\"ago1\\"16 & \\"ago2\\" & \\"ago1\\" & \\"ago2\\" & |\\n}\\n{\\n \\"cwb\\"8 & &16 & r \\"cwb\\" r16 \\"cwb\\" r \\"cwb\\" \\"cwb\\" r & r | \\n}\\n{\\n \\\\fff\\n \\"mtr\\"16 & \\"otr\\"8 \\"mtr\\"16 & \\"otr\\"8 \\"mtr\\"16 & \\"otr\\"8 \\"mtr\\"16 & \\"otr\\"8 |\\n}\\n{\\n \\\\p\\n !ff\\"spl\\"16 \\"ht\\" \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 |\\n \\"ht\\"16 & \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 \\"ht\\"16 & \\"ho\\"8 |\\n}\\n{\\n \\\\f\\n r4 r16 \\"bo1\\" \\"bo2\\" & r4 r16 \\"bo1\\" \\"bo2\\" & |\\n}\\n{\\n \\\\pp\\n r4 r16 \\"cla\\" r8 \\"cla\\" r16 \\"cla\\"16 r4 |\\n}\\n{\\n \\\\fffff\\n r8. \\"sn\\"16 r8 \\"sn\\" r8. \\"sn\\"16 r8 \\"sn\\" |\\n r8. \\"sn\\"16 r8 \\"sn\\" r4 r16 !fff\\"sn\\" !ffff& !fffff& |\\n}\\n{\\n \\"bd\\"4 \\"bd\\" \\"bd\\" \\"bd\\" |\\n}\\n]"}, {"path": "templates/ennio.template", "data": "[\\ntype: template;\\nname: ennio.normal;\\ninstrument: piano; \\n{\\n !ffffI,,4 <II, III, IV, V, VI, VII,> <II, III, IV, V, VI, VII,> !fffV,,, |\\n}\\n] \\n\\n"}, {"path": "templates/guitar.bossanova.template", "data": "[\\ntype: template;\\nname: guitar.bossanova.normal;\\ninstrument: guitar; \\n{\\n /voicingStrategy: simpleGuitar/\\n \\\\f\\n <I II III IV V VI VII>4 <I II III IV V VI VII>4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 |\\n r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 r4 <I II III IV V VI VII>4 |\\n <I II III IV V VI VII>4 <I II III IV V VI VII>4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 |\\n r4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>4. |\\n} \\n] "}, {"path": "templates/guitar.country.template", "data": "using \\"lua/voicings/guitar.lua\\";\\n\\n[\\ntype: template;\\nname: guitar.country.normal;\\ninstrument: guitar; \\n{\\n /voicingStrategy: guitar _range=mezzosoprano/\\n \\\\f\\n <I II III IV V VI VII>8 <I II III IV V VI VII>8 r8 \\n <I II III IV V VI VII>4 <I II III IV V VI VII>8 <I II III IV V VI VII>8 <I II III IV V VI VII>8 |\\n} \\n]\\n\\n[\\ntype: template;\\nname: guitar.country.ende;\\ninstrument: guitar; \\n{\\n <I II III IV V VI VII>1 |\\n} \\n] \\n"}, {"path": "templates/rhythm.bossanova.template", "data": "[\\ntype: template;\\nname: rhythm.bossanova.normal;\\ninstrument: rhythm; \\n{\\n \\\\f\\n <I II III IV V VI VII>4 <I II III IV V VI VII>4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 |\\n r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 r4 <I II III IV V VI VII>4 |\\n <I II III IV V VI VII>4 <I II III IV V VI VII>4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>8 |\\n r4 r8 <I II III IV V VI VII>8 r8 <I II III IV V VI VII>4. |\\n} \\n] "}, {"path": "templates/rhythm.country.template", "data": "using \\"lua/voicings/guitar.lua\\";\\n\\n[\\ntype: template;\\nname: rhythm.country.normal;\\ninstrument: rhythm; \\n{\\n \\\\f\\n <I II III IV V VI VII>8 <I II III IV V VI VII>8 r8 \\n <I II III IV V VI VII>4 <I II III IV V VI VII>8 <I II III IV V VI VII>8 <I II III IV V VI VII>8 |\\n} \\n]\\n\\n[\\ntype: template;\\nname: rhythm.country.ende;\\ninstrument: rhythm; \\n{\\n /doOnce: arpeggio/\\n <I II III IV V VI VII>4~ <I II III IV V VI VII>2. |\\n} \\n] \\n"}, {"path": "templates/rhythm.jazzSwing.template", "data": "-- tempo: 155\\n-- signature: 4/4\\n-- parts: normal\\n[\\ntype: template;\\nname: rhythm.jazzSwing.normal;\\ninstrument: rhythm2; \\n{\\n \\\\f\\n <I,, V, VII, I III>1~ | &4 (r r &) r2 |\\n\\n (<V, VII, I III> r r)4 r <V, VII, I III>4 r |\\n \\n (<V, VII, I III> r I,,)4 r <V, VII, I III>4 r |\\n\\n <I,, V, VII, I III>1~ | &4 (r r &) r2 |\\n\\n (<V, VII, I III> r r)4 r <V, VII, I III>4 r |\\n\\n <V, VII, I III> r I,,4 (I,, r <V, VII, I III>~) (<V, VII, I III> r I,,) |\\n}\\n]\\n"}, {"path": "templates/rhythm.reggae.template", "data": "using \\"lua/mods/swing.lua\\";\\nusing \\"lua/mods/staccato.lua\\";\\n\\n[\\ntype: template;\\nname: rhythm.reggae.normal;\\ninstrument: rhythm;\\n{\\n \\\\f\\n /do: swing _grid=8 _offset =40/\\n r4 /modOnce: staccato _amount=100/ <I II III IV V VI VII>8 /modOnce: staccato _amount=40/ <I II III IV V VI VII>8 \\n r4 /modOnce: staccato _amount=100/ <I II III IV V VI VII>8 /modOnce: staccato _amount=40/ <I II III IV V VI VII>8 \\n |\\n\\n}\\n]"}]'),d=require("lodash"),p=function(){function n(e){a(this,n),this.module=e,this.blacklist=["/dev","/home","/proc","/tmp"]}return o(n,[{key:"resolve",value:function(n,e){return i(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.replace("./",n));case 1:case"end":return t.stop()}},t)}))}},{key:"ls",value:function(n){return i(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,a,r,o,i,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.module.FS,a=t.analyzePath(n,!1),a.exists&&a.object&&a.object.isFolder){e.next=5;break}return e.abrupt("return",[]);case 5:r=[],o=a.object.contents,e.t0=regeneratorRuntime.keys(o);case 8:if((e.t1=e.t0()).done){e.next=18;break}if(i=e.t1.value,s=o[i],!this.blacklist.includes("".concat(a.parentPath).concat(i))){e.next=13;break}return e.abrupt("continue",8);case 13:if("_"!==i[0]&&"."!==i[0]){e.next=15;break}return e.abrupt("continue",8);case 15:r.push({name:i,isDirectory:s.isFolder}),e.next=8;break;case 18:return e.abrupt("return",r);case 19:case"end":return e.stop()}},e,this)}))}},{key:"getParentPath",value:function(n){return i(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.module.FS,a=t.analyzePath(n,!1),e.abrupt("return",a.parentPath);case 3:case"end":return e.stop()}},e,this)}))}}]),n}(),u=function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";a(this,n),this.errorMessage=e};exports.CompilerError=u;var I=function(){function e(){var n=this;a(this,e),this.cwdFiles=[],this.module=s().then(function(e){return i(n,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.init(e);case 2:return n.abrupt("return",e);case 3:case"end":return n.stop()}},n,this)}))})}return o(e,[{key:"init",value:function(n){return i(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.prepareModule(n),e.next=3,this.prepareFileSystem(n);case 3:case"end":return e.stop()}},e,this)}))}},{key:"getFileSystemInspector",value:function(){return i(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.t0=p,n.next=3,this.module;case 3:return n.t1=n.sent,n.abrupt("return",new n.t0(n.t1));case 5:case"end":return n.stop()}},n,this)}))}},{key:"prepareModule",value:function(n){this.createCompileResult=n.cwrap("create_compile_result","number",["string","number"])}},{key:"mkdir_p",value:function(n,e){for(var t=n.split("/"),a=[],r=0;r<t.length&&r!==t.length-1;++r){var o=t[r];a.push(o);var i=a.join("/");e.FS.analyzePath(i,!1).exists||e.FS.mkdir(i)}}},{key:"prepareFileSystem",value:function(e){return i(this,void 0,void 0,regeneratorRuntime.mark(function t(){var a,r,o,i,s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:a=d.cloneDeep(c),r=e.FS,o=n(a);try{for(o.s();!(i=o.n()).done;){s=i.value;try{this.mkdir_p(s.path,e),r.writeFile(s.path,s.data)}catch(l){console.error(l)}}}catch(p){o.e(p)}finally{o.f()}case 4:case"end":return t.stop()}},t,this)}))}},{key:"writeFileToFS",value:function(n,e){return i(this,void 0,void 0,regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.module;case 2:t.sent.FS.writeFile(n,e),this.cwdFiles.push(n);case 5:case"end":return t.stop()}},t,this)}))}},{key:"cleanCWD",value:function(){return i(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,a,r,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.module;case 2:t=e.sent.FS,a=n(this.cwdFiles);try{for(a.s();!(r=a.n()).done;)o=r.value,t.analyzePath(o,!1).exists&&t.unlink(o)}catch(i){a.e(i)}finally{a.f()}this.cwdFiles.splice(0,this.cwdFiles.length);case 6:case"end":return e.stop()}},e,this)}))}},{key:"compile",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return i(this,void 0,void 0,regeneratorRuntime.mark(function a(){var r,o,i,s,l,c,d,p;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.cleanCWD();case 2:if(e&&0!==e.length){a.next=4;break}throw new u("no content to compile");case 4:return a.next=6,this.module;case 6:r=a.sent,o=0,i=null,s=n(e),a.prev=10,s.s();case 12:if((l=s.n()).done){a.next=21;break}if((c=l.value).path&&c.path.trim()){a.next=16;break}throw new u("sheet file has no path");case 16:return a.next=18,this.writeFileToFS(c.path,c.data);case 18:c.path.trim().endsWith(".sheet")&&(i=c);case 19:a.next=12;break;case 21:a.next=26;break;case 23:a.prev=23,a.t0=a.catch(10),s.e(a.t0);case 26:return a.prev=26,s.f(),a.finish(26);case 29:if(i){a.next=31;break}throw new u("missing main sheet file (.sheet)");case 31:if(o=this.createCompileResult(i.path,t),d=r.UTF8ToString(o),r._free(o),!(p=JSON.parse(d)).errorMessage){a.next=37;break}throw{error:p};case 37:return a.abrupt("return",p);case 38:case"end":return a.stop()}},a,this,[[10,23,26,29]])}))}}]),e}();exports.WerckmeisterCompiler=I;
493
493
  },{"@werckmeister/compilerjs/werckmeister":"ouOZ","fs":"rDCW","lodash":"B1iE"}],"X3ym":[function(require,module,exports) {
@@ -502,13 +502,13 @@ var A;parcelRequire=function(e,t,n,r){var i,o="function"==typeof parcelRequire&&
502
502
  },{"@werckmeister/midiplayer":"X3ym","../shared/midiEvent":"vkzS","../shared/player":"FYcy"}],"ooUX":[function(require,module,exports) {
503
503
  "use strict";var e=this&&this.__awaiter||function(e,r,t,n){return new(t||(t=Promise))(function(o,i){function s(e){try{p(n.next(e))}catch(r){i(r)}}function a(e){try{p(n.throw(e))}catch(r){i(r)}}function p(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t(function(e){e(r)})).then(s,a)}p((n=n.apply(e,r||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.resetCompiler=exports.WM_Player=exports.WM_Compiler=void 0;var r=require("./compiler/Compiler"),t=require("./player/Player");function n(){return e(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:exports.WM_Compiler=new r.WerckmeisterCompiler;case 1:case"end":return e.stop()}},e)}))}exports.WM_Compiler=new r.WerckmeisterCompiler,exports.WM_Player=new t.Player,exports.resetCompiler=n;
504
504
  },{"./compiler/Compiler":"RSuL","./player/Player":"WYYH"}],"bSo5":[function(require,module,exports) {
505
- "use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(e)}function e(n,e){var t;if("undefined"==typeof Symbol||null==n[Symbol.iterator]){if(Array.isArray(n)||(t=r(n))||e&&n&&"number"==typeof n.length){t&&(n=t);var o=0,i=function(){};return{s:i,n:function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}},e:function(n){throw n},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){t=n[Symbol.iterator]()},n:function(){var n=t.next();return c=n.done,n},e:function(n){s=!0,a=n},f:function(){try{c||null==t.return||t.return()}finally{if(s)throw a}}}}function r(n,e){if(n){if("string"==typeof n)return t(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(n,e):void 0}}function t(n,e){(null==e||e>n.length)&&(e=n.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=n[r];return t}function o(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function i(n,e){for(var r=0;r<e.length;r++){var t=e[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,t.key,t)}}function a(n,e,r){return e&&i(n.prototype,e),r&&i(n,r),n}function c(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&h(n,e)}function s(n){var e=m();return function(){var r,t=b(n);if(e){var o=b(this).constructor;r=Reflect.construct(t,arguments,o)}else r=t.apply(this,arguments);return l(this,r)}}function l(e,r){return!r||"object"!==n(r)&&"function"!=typeof r?d(e):r}function d(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function u(n){var e="function"==typeof Map?new Map:void 0;return(u=function(n){if(null===n||!f(n))return n;if("function"!=typeof n)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(n))return e.get(n);e.set(n,r)}function r(){return p(n,arguments,b(this).constructor)}return r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),h(r,n)})(n)}function p(n,e,r){return(p=m()?Reflect.construct:function(n,e,r){var t=[null];t.push.apply(t,e);var o=new(Function.bind.apply(n,t));return r&&h(o,r.prototype),o}).apply(null,arguments)}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(n){return!1}}function f(n){return-1!==Function.toString.call(n).indexOf("[native code]")}function h(n,e){return(h=Object.setPrototypeOf||function(n,e){return n.__proto__=e,n})(n,e)}function b(n){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}var g=this&&this.__awaiter||function(n,e,r,t){return new(r||(r=Promise))(function(o,i){function a(n){try{s(t.next(n))}catch(e){i(e)}}function c(n){try{s(t.throw(n))}catch(e){i(e)}}function s(n){var e;n.done?o(n.value):(e=n.value,e instanceof r?e:new r(function(n){n(e)})).then(a,c)}s((t=t.apply(n,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Editor=void 0;var v=require("../../editor/Editor"),y=require("@werckmeister/language-features"),M=require("../../shared/http"),w=require("../../Global"),k=require("lodash"),C=require("fs"),x='#editor {\n border: 2px solid grey;\n width: 100%;\n height: 100%;\n}\n\n\n.CodeMirror {\n width: 100%;\n height: 100%;\n}\n\n#wm-snippet {\n margin-bottom: 1.5em;\n}\n\n\n.wm-marked::before {\n content: " ";\n position: absolute;\n border-top: 4px solid #ff0;\n border-left: 4px solid #ff0;\n border-radius: 0;\n height: 8px;\n width: 8px;\n transform: rotate(-135deg);\n margin-top: -11px;\n margin-left: 8px;\n}\n\n.wm-error::before {\n content: " ";\n position: absolute;\n border-top: 4px solid red;\n border-left: 4px solid red;\n border-radius: 0;\n height: 8px;\n width: 8px;\n transform: rotate(-135deg);\n margin-top: -11px;\n margin-left: 8px;\n}\n\n.wm-warning::before {\n content: " ";\n position: absolute;\n border-bottom: 2px dotted orange;\n width: 16px;\n height: 1em;\n margin-top: 5px;\n margin-left: -3px;\n cursor: default;\n}\n\n.wm-warning.wm-marked::before {\n display: none;\n border-bottom: none;\n height: 8px;\n width: 8px;\n margin-top: -11px;\n margin-left: 8px;\n}\n\n\n#btnPlay, #btnStop {\n cursor: pointer;\n}\n\n.wm-state-playing #btnPlay {\n display: none;\n}\n\n.wm-state-stopped #btnStop {\n display: none;\n}\n\n.wm-player-fetching #btnStop\n, .wm-player-fetching #btnPlay\n{\n display: none;\n}\n\n#fetching {\n display: none;\n}\n\n@keyframes spin { 100% { transform:rotate(360deg); } }\n#fetching svg {\n animation:spin 2s linear infinite;\n}\n\n.wm-player-fetching #fetching {\n display: block;\n}\n\n.icon {\n vertical-align: top;\n}\n\n.CodeMirror-hint.isFolder::before {\n content: \'[\';\n}\n.CodeMirror-hint.isFolder::after {\n content: \']\';\n}',z='<div id="editor">\n</div>\n',S="dracula",I="/* BASICS */\n\n.CodeMirror {\n /* Set height, width, borders, and global font properties here */\n font-family: monospace;\n height: 300px;\n color: black;\n direction: ltr;\n}\n\n/* PADDING */\n\n.CodeMirror-lines {\n padding: 4px 0; /* Vertical padding around content */\n}\n.CodeMirror pre.CodeMirror-line,\n.CodeMirror pre.CodeMirror-line-like {\n padding: 0 4px; /* Horizontal padding of content */\n}\n\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n background-color: white; /* The little square between H and V scrollbars */\n}\n\n/* GUTTER */\n\n.CodeMirror-gutters {\n border-right: 1px solid #ddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n}\n.CodeMirror-linenumbers {}\n.CodeMirror-linenumber {\n padding: 0 3px 0 5px;\n min-width: 20px;\n text-align: right;\n color: #999;\n white-space: nowrap;\n}\n\n.CodeMirror-guttermarker { color: black; }\n.CodeMirror-guttermarker-subtle { color: #999; }\n\n/* CURSOR */\n\n.CodeMirror-cursor {\n border-left: 1px solid black;\n border-right: none;\n width: 0;\n}\n/* Shown when moving in bi-directional text */\n.CodeMirror div.CodeMirror-secondarycursor {\n border-left: 1px solid silver;\n}\n.cm-fat-cursor .CodeMirror-cursor {\n width: auto;\n border: 0 !important;\n background: #7e7;\n}\n.cm-fat-cursor div.CodeMirror-cursors {\n z-index: 1;\n}\n.cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n}\n.cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #7e7;\n}\n@-moz-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@-webkit-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n\n/* Can style cursor different in overwrite (non-insert) mode */\n.CodeMirror-overwrite .CodeMirror-cursor {}\n\n.cm-tab { display: inline-block; text-decoration: inherit; }\n\n.CodeMirror-rulers {\n position: absolute;\n left: 0; right: 0; top: -50px; bottom: 0;\n overflow: hidden;\n}\n.CodeMirror-ruler {\n border-left: 1px solid #ccc;\n top: 0; bottom: 0;\n position: absolute;\n}\n\n/* DEFAULT THEME */\n\n.cm-s-default .cm-header {color: blue;}\n.cm-s-default .cm-quote {color: #090;}\n.cm-negative {color: #d44;}\n.cm-positive {color: #292;}\n.cm-header, .cm-strong {font-weight: bold;}\n.cm-em {font-style: italic;}\n.cm-link {text-decoration: underline;}\n.cm-strikethrough {text-decoration: line-through;}\n\n.cm-s-default .cm-keyword {color: #708;}\n.cm-s-default .cm-atom {color: #219;}\n.cm-s-default .cm-number {color: #164;}\n.cm-s-default .cm-def {color: #00f;}\n.cm-s-default .cm-variable,\n.cm-s-default .cm-punctuation,\n.cm-s-default .cm-property,\n.cm-s-default .cm-operator {}\n.cm-s-default .cm-variable-2 {color: #05a;}\n.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}\n.cm-s-default .cm-comment {color: #a50;}\n.cm-s-default .cm-string {color: #a11;}\n.cm-s-default .cm-string-2 {color: #f50;}\n.cm-s-default .cm-meta {color: #555;}\n.cm-s-default .cm-qualifier {color: #555;}\n.cm-s-default .cm-builtin {color: #30a;}\n.cm-s-default .cm-bracket {color: #997;}\n.cm-s-default .cm-tag {color: #170;}\n.cm-s-default .cm-attribute {color: #00c;}\n.cm-s-default .cm-hr {color: #999;}\n.cm-s-default .cm-link {color: #00c;}\n\n.cm-s-default .cm-error {color: #f00;}\n.cm-invalidchar {color: #f00;}\n\n.CodeMirror-composing { border-bottom: 2px solid; }\n\n/* Default styles for common addons */\n\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}\n.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }\n.CodeMirror-activeline-background {background: #e8f2ff;}\n\n/* STOP */\n\n/* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n.CodeMirror {\n position: relative;\n overflow: hidden;\n background: white;\n}\n\n.CodeMirror-scroll {\n overflow: scroll !important; /* Things will break if this is overridden */\n /* 50px is the magic margin used to hide the element's real scrollbars */\n /* See overflow: hidden in .CodeMirror */\n margin-bottom: -50px; margin-right: -50px;\n padding-bottom: 50px;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n}\n.CodeMirror-sizer {\n position: relative;\n border-right: 50px solid transparent;\n}\n\n/* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n}\n.CodeMirror-vscrollbar {\n right: 0; top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n.CodeMirror-hscrollbar {\n bottom: 0; left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n}\n.CodeMirror-scrollbar-filler {\n right: 0; bottom: 0;\n}\n.CodeMirror-gutter-filler {\n left: 0; bottom: 0;\n}\n\n.CodeMirror-gutters {\n position: absolute; left: 0; top: 0;\n min-height: 100%;\n z-index: 3;\n}\n.CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n margin-bottom: -50px;\n}\n.CodeMirror-gutter-wrapper {\n position: absolute;\n z-index: 4;\n background: none !important;\n border: none !important;\n}\n.CodeMirror-gutter-background {\n position: absolute;\n top: 0; bottom: 0;\n z-index: 4;\n}\n.CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n}\n.CodeMirror-gutter-wrapper ::selection { background-color: transparent }\n.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }\n\n.CodeMirror-lines {\n cursor: text;\n min-height: 1px; /* prevents collapsing before first draw */\n}\n.CodeMirror pre.CodeMirror-line,\n.CodeMirror pre.CodeMirror-line-like {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n}\n.CodeMirror-wrap pre.CodeMirror-line,\n.CodeMirror-wrap pre.CodeMirror-line-like {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n}\n\n.CodeMirror-linebackground {\n position: absolute;\n left: 0; right: 0; top: 0; bottom: 0;\n z-index: 0;\n}\n\n.CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n padding: 0.1px; /* Force widget margins to stay inside of the container */\n}\n\n.CodeMirror-widget {}\n\n.CodeMirror-rtl pre { direction: rtl; }\n\n.CodeMirror-code {\n outline: none;\n}\n\n/* Force content-box sizing for the elements where we expect it */\n.CodeMirror-scroll,\n.CodeMirror-sizer,\n.CodeMirror-gutter,\n.CodeMirror-gutters,\n.CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n}\n\n.CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n}\n\n.CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n}\n.CodeMirror-measure pre { position: static; }\n\ndiv.CodeMirror-cursors {\n visibility: hidden;\n position: relative;\n z-index: 3;\n}\ndiv.CodeMirror-dragcursors {\n visibility: visible;\n}\n\n.CodeMirror-focused div.CodeMirror-cursors {\n visibility: visible;\n}\n\n.CodeMirror-selected { background: #d9d9d9; }\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\n.CodeMirror-crosshair { cursor: crosshair; }\n.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }\n.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }\n\n.cm-searching {\n background-color: #ffa;\n background-color: rgba(255, 255, 0, .4);\n}\n\n/* Used to force a border model for a node */\n.cm-force-border { padding-right: .1px; }\n\n@media print {\n /* Hide the cursor when printing */\n .CodeMirror div.CodeMirror-cursors {\n visibility: hidden;\n }\n}\n\n/* See issue #2901 */\n.cm-tab-wrap-hack:after { content: ''; }\n\n/* Help users use markselection to safely style text background */\nspan.CodeMirror-selectedtext { background: none; }\n";I+="/*\n\n Name: dracula\n Author: Michael Kaminsky (http://github.com/mkaminsky11)\n\n Original dracula color scheme by Zeno Rocha (https://github.com/zenorocha/dracula-theme)\n\n*/\n\n\n.cm-s-dracula.CodeMirror, .cm-s-dracula .CodeMirror-gutters {\n background-color: #282a36 !important;\n color: #f8f8f2 !important;\n border: none;\n}\n.cm-s-dracula .CodeMirror-gutters { color: #282a36; }\n.cm-s-dracula .CodeMirror-cursor { border-left: solid thin #f8f8f0; }\n.cm-s-dracula .CodeMirror-linenumber { color: #6D8A88; }\n.cm-s-dracula .CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }\n.cm-s-dracula .CodeMirror-line::selection, .cm-s-dracula .CodeMirror-line > span::selection, .cm-s-dracula .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); }\n.cm-s-dracula .CodeMirror-line::-moz-selection, .cm-s-dracula .CodeMirror-line > span::-moz-selection, .cm-s-dracula .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); }\n.cm-s-dracula span.cm-comment { color: #6272a4; }\n.cm-s-dracula span.cm-string, .cm-s-dracula span.cm-string-2 { color: #f1fa8c; }\n.cm-s-dracula span.cm-number { color: #bd93f9; }\n.cm-s-dracula span.cm-variable { color: #50fa7b; }\n.cm-s-dracula span.cm-variable-2 { color: white; }\n.cm-s-dracula span.cm-def { color: #50fa7b; }\n.cm-s-dracula span.cm-operator { color: #ff79c6; }\n.cm-s-dracula span.cm-keyword { color: #ff79c6; }\n.cm-s-dracula span.cm-atom { color: #bd93f9; }\n.cm-s-dracula span.cm-meta { color: #f8f8f2; }\n.cm-s-dracula span.cm-tag { color: #ff79c6; }\n.cm-s-dracula span.cm-attribute { color: #50fa7b; }\n.cm-s-dracula span.cm-qualifier { color: #50fa7b; }\n.cm-s-dracula span.cm-property { color: #66d9ef; }\n.cm-s-dracula span.cm-builtin { color: #50fa7b; }\n.cm-s-dracula span.cm-variable-3, .cm-s-dracula span.cm-type { color: #ffb86c; }\n\n.cm-s-dracula .CodeMirror-activeline-background { background: rgba(255,255,255,0.1); }\n.cm-s-dracula .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }\n",I+=".CodeMirror-hints {\n position: absolute;\n z-index: 10;\n overflow: hidden;\n list-style: none;\n\n margin: 0;\n padding: 2px;\n\n -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n border-radius: 3px;\n border: 1px solid silver;\n\n background: white;\n font-size: 90%;\n font-family: monospace;\n\n max-height: 20em;\n overflow-y: auto;\n}\n\n.CodeMirror-hint {\n margin: 0;\n padding: 0 4px;\n border-radius: 2px;\n white-space: pre;\n color: black;\n cursor: pointer;\n}\n\nli.CodeMirror-hint-active {\n background: #08f;\n color: white;\n}\n";var E=document.createElement("template");E.innerHTML="\n<style>\n ".concat(I,"\n ").concat(x,"\n</style>\n").concat(z,"\n");var R=function(n){c(t,u(HTMLElement));var r=s(t);function t(){var n;return o(this,t),(n=r.call(this)).eventMarkers=[],n.initiated=new Promise(function(e){n.createElement(e)}),n}return a(t,[{key:"filename",get:function(){return this._filename}},{key:"setFilename",value:function(n){this._filename=n}},{key:"editorElement",get:function(){return this.shadowRoot.getElementById("editor")}},{key:"clearAllMarkers",value:function(){this.editorImpl.clearAllMarkers()}},{key:"clearEventMarkers",value:function(){this.editorImpl.clearEventMarkers()}},{key:"createElement",value:function(n){return g(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r,t=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.attachShadow({mode:"open"}),r=E.content.cloneNode(!0),this.shadowRoot.appendChild(r),setTimeout(function(){t.init(),n()});case 4:case"end":return e.stop()}},e,this)}))}},{key:"setWerckmeisterMode",value:function(){return g(this,void 0,void 0,regeneratorRuntime.mark(function n(){var e,r;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,w.WM_Compiler.getFileSystemInspector();case 2:e=n.sent,r=new y.LanguageFeatures(e),this.editorImpl.setMode(v.Mode.sheet),this.editorImpl.activateAutoCompletion(r,this.filename);case 6:case"end":return n.stop()}},n,this)}))}},{key:"updateMode",value:function(){return g(this,void 0,void 0,regeneratorRuntime.mark(function n(){var e,r;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(this.filename){n.next=3;break}return this.editorImpl.setMode(v.Mode.text),n.abrupt("return");case 3:if((e=this.filename.match(/.*(\.[^.]*$)/))&&!(e.length<2)){n.next=7;break}return this.editorImpl.setMode(v.Mode.text),n.abrupt("return");case 7:r=e[1],n.t0=r,n.next=".sheet"===n.t0?11:".template"===n.t0?11:".lua"===n.t0?14:".conductions"===n.t0?15:16;break;case 11:return n.next=13,this.setWerckmeisterMode();case 13:return n.abrupt("return",n.sent);case 14:return n.abrupt("return",this.editorImpl.setMode(v.Mode.lua));case 15:return n.abrupt("return",this.editorImpl.setMode(v.Mode.conductions));case 16:return n.abrupt("return",this.editorImpl.setMode(v.Mode.text));case 17:case"end":return n.stop()}},n,this)}))}},{key:"initListener",value:function(){}},{key:"getScriptText",value:function(){return this.editorImpl.getValue().trim()}},{key:"setScriptText",value:function(n){this.editorImpl.setValue(n)}},{key:"setError",value:function(n){this.clearAllMarkers(),this.editorImpl.setErrorMarker(n.positionBegin,n.positionBegin+1)}},{key:"addWarning",value:function(n){this.editorImpl.setWarningMarker(n.message,n.positionBegin,n.positionBegin+1)}},{key:"getScriptContent",value:function(n){var e=this.attributes.getNamedItem("wm-data");if(e)return atob(e.value);var r=n.match(/\[CDATA\[([\s\S]*)\]\]/);return r?r[1]:n}},{key:"init",value:function(){var n=this.shadowRoot.getElementById("editor"),e=this.getScriptContent(this.innerHTML);this.editorImpl=new v.Editor(n,e,{theme:S,lineNumbers:!0}),this.initListener(),this.readAttributes()}},{key:"loadExternalCss",value:function(n){return g(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r,t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M.fetchText(n);case 2:r=e.sent,(t=document.createElement("style")).innerText=r,this.shadowRoot.appendChild(t);case 6:case"end":return e.stop()}},e,this)}))}},{key:"readAttributes",value:function(){return g(this,void 0,void 0,regeneratorRuntime.mark(function n(){var e,r,t;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:(e=this.attributes.getNamedItem("wm-style"))&&this.editorElement.setAttribute("style",e.value),(r=this.attributes.getNamedItem("wm-css-url"))&&this.loadExternalCss(r.value),(t=this.attributes.getNamedItem("wm-filename"))&&(this.setFilename(t.value),this.updateMode());case 6:case"end":return n.stop()}},n,this)}))}},{key:"addMarkers",value:function(n){var r,t=e(n);try{for(t.s();!(r=t.n()).done;){var o=r.value,i=this.editorImpl.setEventMarker(o.beginPosition,o.beginPosition+1);this.eventMarkers.push(i)}}catch(a){t.e(a)}finally{t.f()}}},{key:"update",value:function(){return g(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return this.editorImpl.update(),n.next=3,this.updateMode();case 3:case"end":return n.stop()}},n,this)}))}},{key:"isClean",value:function(){return this.editorImpl.isClean()}},{key:"markClean",value:function(){this.editorImpl.markClean()}},{key:"clearHistory",value:function(){this.editorImpl.clearHistory()}}]),t}();exports.Editor=R;
505
+ "use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(e)}function e(n,e){var t;if("undefined"==typeof Symbol||null==n[Symbol.iterator]){if(Array.isArray(n)||(t=r(n))||e&&n&&"number"==typeof n.length){t&&(n=t);var o=0,i=function(){};return{s:i,n:function(){return o>=n.length?{done:!0}:{done:!1,value:n[o++]}},e:function(n){throw n},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){t=n[Symbol.iterator]()},n:function(){var n=t.next();return c=n.done,n},e:function(n){s=!0,a=n},f:function(){try{c||null==t.return||t.return()}finally{if(s)throw a}}}}function r(n,e){if(n){if("string"==typeof n)return t(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(n,e):void 0}}function t(n,e){(null==e||e>n.length)&&(e=n.length);for(var r=0,t=new Array(e);r<e;r++)t[r]=n[r];return t}function o(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function i(n,e){for(var r=0;r<e.length;r++){var t=e[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,t.key,t)}}function a(n,e,r){return e&&i(n.prototype,e),r&&i(n,r),n}function c(n,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&h(n,e)}function s(n){var e=m();return function(){var r,t=b(n);if(e){var o=b(this).constructor;r=Reflect.construct(t,arguments,o)}else r=t.apply(this,arguments);return l(this,r)}}function l(e,r){return!r||"object"!==n(r)&&"function"!=typeof r?d(e):r}function d(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function u(n){var e="function"==typeof Map?new Map:void 0;return(u=function(n){if(null===n||!f(n))return n;if("function"!=typeof n)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(n))return e.get(n);e.set(n,r)}function r(){return p(n,arguments,b(this).constructor)}return r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),h(r,n)})(n)}function p(n,e,r){return(p=m()?Reflect.construct:function(n,e,r){var t=[null];t.push.apply(t,e);var o=new(Function.bind.apply(n,t));return r&&h(o,r.prototype),o}).apply(null,arguments)}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(n){return!1}}function f(n){return-1!==Function.toString.call(n).indexOf("[native code]")}function h(n,e){return(h=Object.setPrototypeOf||function(n,e){return n.__proto__=e,n})(n,e)}function b(n){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}var g=this&&this.__awaiter||function(n,e,r,t){return new(r||(r=Promise))(function(o,i){function a(n){try{s(t.next(n))}catch(e){i(e)}}function c(n){try{s(t.throw(n))}catch(e){i(e)}}function s(n){var e;n.done?o(n.value):(e=n.value,e instanceof r?e:new r(function(n){n(e)})).then(a,c)}s((t=t.apply(n,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Editor=void 0;var v=require("../../editor/Editor"),y=require("@werckmeister/language-features"),M=require("../../shared/http"),w=require("../../Global"),k=require("lodash"),C=require("fs"),x='#editor {\n border: 2px solid grey;\n width: 100%;\n height: 100%;\n}\n\n\n.CodeMirror {\n width: 100%;\n height: 100%;\n}\n\n#wm-snippet {\n margin-bottom: 1.5em;\n}\n\n\n.wm-marked::before {\n content: " ";\n position: absolute;\n border-top: 4px solid #ff0;\n border-left: 4px solid #ff0;\n border-radius: 0;\n height: 8px;\n width: 8px;\n transform: rotate(-135deg);\n margin-top: -11px;\n margin-left: 8px;\n}\n\n.wm-error::before {\n content: " ";\n position: absolute;\n border-top: 4px solid red;\n border-left: 4px solid red;\n border-radius: 0;\n height: 8px;\n width: 8px;\n transform: rotate(-135deg);\n margin-top: -11px;\n margin-left: 8px;\n}\n\n.wm-warning::before {\n content: " ";\n position: absolute;\n border-bottom: 2px dotted orange;\n width: 16px;\n height: 1em;\n margin-top: 5px;\n margin-left: -3px;\n cursor: default;\n}\n\n.wm-warning.wm-marked::before {\n display: none;\n border-bottom: none;\n height: 8px;\n width: 8px;\n margin-top: -11px;\n margin-left: 8px;\n}\n\n\n#btnPlay, #btnStop {\n cursor: pointer;\n}\n\n.wm-state-playing #btnPlay {\n display: none;\n}\n\n.wm-state-stopped #btnStop {\n display: none;\n}\n\n.wm-player-fetching #btnStop\n, .wm-player-fetching #btnPlay\n{\n display: none;\n}\n\n#fetching {\n display: none;\n}\n\n@keyframes spin { 100% { transform:rotate(360deg); } }\n#fetching svg {\n animation:spin 2s linear infinite;\n}\n\n.wm-player-fetching #fetching {\n display: block;\n}\n\n.icon {\n vertical-align: top;\n}\n\n.CodeMirror-hint.isFolder::before {\n content: \'[\';\n}\n.CodeMirror-hint.isFolder::after {\n content: \']\';\n}',S='<div id="editor">\n</div>\n',z="dracula",I="/* BASICS */\n\n.CodeMirror {\n /* Set height, width, borders, and global font properties here */\n font-family: monospace;\n height: 300px;\n color: black;\n direction: ltr;\n}\n\n/* PADDING */\n\n.CodeMirror-lines {\n padding: 4px 0; /* Vertical padding around content */\n}\n.CodeMirror pre.CodeMirror-line,\n.CodeMirror pre.CodeMirror-line-like {\n padding: 0 4px; /* Horizontal padding of content */\n}\n\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n background-color: white; /* The little square between H and V scrollbars */\n}\n\n/* GUTTER */\n\n.CodeMirror-gutters {\n border-right: 1px solid #ddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n}\n.CodeMirror-linenumbers {}\n.CodeMirror-linenumber {\n padding: 0 3px 0 5px;\n min-width: 20px;\n text-align: right;\n color: #999;\n white-space: nowrap;\n}\n\n.CodeMirror-guttermarker { color: black; }\n.CodeMirror-guttermarker-subtle { color: #999; }\n\n/* CURSOR */\n\n.CodeMirror-cursor {\n border-left: 1px solid black;\n border-right: none;\n width: 0;\n}\n/* Shown when moving in bi-directional text */\n.CodeMirror div.CodeMirror-secondarycursor {\n border-left: 1px solid silver;\n}\n.cm-fat-cursor .CodeMirror-cursor {\n width: auto;\n border: 0 !important;\n background: #7e7;\n}\n.cm-fat-cursor div.CodeMirror-cursors {\n z-index: 1;\n}\n.cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n}\n.cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #7e7;\n}\n@-moz-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@-webkit-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n\n/* Can style cursor different in overwrite (non-insert) mode */\n.CodeMirror-overwrite .CodeMirror-cursor {}\n\n.cm-tab { display: inline-block; text-decoration: inherit; }\n\n.CodeMirror-rulers {\n position: absolute;\n left: 0; right: 0; top: -50px; bottom: 0;\n overflow: hidden;\n}\n.CodeMirror-ruler {\n border-left: 1px solid #ccc;\n top: 0; bottom: 0;\n position: absolute;\n}\n\n/* DEFAULT THEME */\n\n.cm-s-default .cm-header {color: blue;}\n.cm-s-default .cm-quote {color: #090;}\n.cm-negative {color: #d44;}\n.cm-positive {color: #292;}\n.cm-header, .cm-strong {font-weight: bold;}\n.cm-em {font-style: italic;}\n.cm-link {text-decoration: underline;}\n.cm-strikethrough {text-decoration: line-through;}\n\n.cm-s-default .cm-keyword {color: #708;}\n.cm-s-default .cm-atom {color: #219;}\n.cm-s-default .cm-number {color: #164;}\n.cm-s-default .cm-def {color: #00f;}\n.cm-s-default .cm-variable,\n.cm-s-default .cm-punctuation,\n.cm-s-default .cm-property,\n.cm-s-default .cm-operator {}\n.cm-s-default .cm-variable-2 {color: #05a;}\n.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}\n.cm-s-default .cm-comment {color: #a50;}\n.cm-s-default .cm-string {color: #a11;}\n.cm-s-default .cm-string-2 {color: #f50;}\n.cm-s-default .cm-meta {color: #555;}\n.cm-s-default .cm-qualifier {color: #555;}\n.cm-s-default .cm-builtin {color: #30a;}\n.cm-s-default .cm-bracket {color: #997;}\n.cm-s-default .cm-tag {color: #170;}\n.cm-s-default .cm-attribute {color: #00c;}\n.cm-s-default .cm-hr {color: #999;}\n.cm-s-default .cm-link {color: #00c;}\n\n.cm-s-default .cm-error {color: #f00;}\n.cm-invalidchar {color: #f00;}\n\n.CodeMirror-composing { border-bottom: 2px solid; }\n\n/* Default styles for common addons */\n\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}\n.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }\n.CodeMirror-activeline-background {background: #e8f2ff;}\n\n/* STOP */\n\n/* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n.CodeMirror {\n position: relative;\n overflow: hidden;\n background: white;\n}\n\n.CodeMirror-scroll {\n overflow: scroll !important; /* Things will break if this is overridden */\n /* 50px is the magic margin used to hide the element's real scrollbars */\n /* See overflow: hidden in .CodeMirror */\n margin-bottom: -50px; margin-right: -50px;\n padding-bottom: 50px;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n}\n.CodeMirror-sizer {\n position: relative;\n border-right: 50px solid transparent;\n}\n\n/* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n}\n.CodeMirror-vscrollbar {\n right: 0; top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n.CodeMirror-hscrollbar {\n bottom: 0; left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n}\n.CodeMirror-scrollbar-filler {\n right: 0; bottom: 0;\n}\n.CodeMirror-gutter-filler {\n left: 0; bottom: 0;\n}\n\n.CodeMirror-gutters {\n position: absolute; left: 0; top: 0;\n min-height: 100%;\n z-index: 3;\n}\n.CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n margin-bottom: -50px;\n}\n.CodeMirror-gutter-wrapper {\n position: absolute;\n z-index: 4;\n background: none !important;\n border: none !important;\n}\n.CodeMirror-gutter-background {\n position: absolute;\n top: 0; bottom: 0;\n z-index: 4;\n}\n.CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n}\n.CodeMirror-gutter-wrapper ::selection { background-color: transparent }\n.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }\n\n.CodeMirror-lines {\n cursor: text;\n min-height: 1px; /* prevents collapsing before first draw */\n}\n.CodeMirror pre.CodeMirror-line,\n.CodeMirror pre.CodeMirror-line-like {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n}\n.CodeMirror-wrap pre.CodeMirror-line,\n.CodeMirror-wrap pre.CodeMirror-line-like {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n}\n\n.CodeMirror-linebackground {\n position: absolute;\n left: 0; right: 0; top: 0; bottom: 0;\n z-index: 0;\n}\n\n.CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n padding: 0.1px; /* Force widget margins to stay inside of the container */\n}\n\n.CodeMirror-widget {}\n\n.CodeMirror-rtl pre { direction: rtl; }\n\n.CodeMirror-code {\n outline: none;\n}\n\n/* Force content-box sizing for the elements where we expect it */\n.CodeMirror-scroll,\n.CodeMirror-sizer,\n.CodeMirror-gutter,\n.CodeMirror-gutters,\n.CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n}\n\n.CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n}\n\n.CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n}\n.CodeMirror-measure pre { position: static; }\n\ndiv.CodeMirror-cursors {\n visibility: hidden;\n position: relative;\n z-index: 3;\n}\ndiv.CodeMirror-dragcursors {\n visibility: visible;\n}\n\n.CodeMirror-focused div.CodeMirror-cursors {\n visibility: visible;\n}\n\n.CodeMirror-selected { background: #d9d9d9; }\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\n.CodeMirror-crosshair { cursor: crosshair; }\n.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }\n.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }\n\n.cm-searching {\n background-color: #ffa;\n background-color: rgba(255, 255, 0, .4);\n}\n\n/* Used to force a border model for a node */\n.cm-force-border { padding-right: .1px; }\n\n@media print {\n /* Hide the cursor when printing */\n .CodeMirror div.CodeMirror-cursors {\n visibility: hidden;\n }\n}\n\n/* See issue #2901 */\n.cm-tab-wrap-hack:after { content: ''; }\n\n/* Help users use markselection to safely style text background */\nspan.CodeMirror-selectedtext { background: none; }\n";I+="/*\n\n Name: dracula\n Author: Michael Kaminsky (http://github.com/mkaminsky11)\n\n Original dracula color scheme by Zeno Rocha (https://github.com/zenorocha/dracula-theme)\n\n*/\n\n\n.cm-s-dracula.CodeMirror, .cm-s-dracula .CodeMirror-gutters {\n background-color: #282a36 !important;\n color: #f8f8f2 !important;\n border: none;\n}\n.cm-s-dracula .CodeMirror-gutters { color: #282a36; }\n.cm-s-dracula .CodeMirror-cursor { border-left: solid thin #f8f8f0; }\n.cm-s-dracula .CodeMirror-linenumber { color: #6D8A88; }\n.cm-s-dracula .CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }\n.cm-s-dracula .CodeMirror-line::selection, .cm-s-dracula .CodeMirror-line > span::selection, .cm-s-dracula .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); }\n.cm-s-dracula .CodeMirror-line::-moz-selection, .cm-s-dracula .CodeMirror-line > span::-moz-selection, .cm-s-dracula .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); }\n.cm-s-dracula span.cm-comment { color: #6272a4; }\n.cm-s-dracula span.cm-string, .cm-s-dracula span.cm-string-2 { color: #f1fa8c; }\n.cm-s-dracula span.cm-number { color: #bd93f9; }\n.cm-s-dracula span.cm-variable { color: #50fa7b; }\n.cm-s-dracula span.cm-variable-2 { color: white; }\n.cm-s-dracula span.cm-def { color: #50fa7b; }\n.cm-s-dracula span.cm-operator { color: #ff79c6; }\n.cm-s-dracula span.cm-keyword { color: #ff79c6; }\n.cm-s-dracula span.cm-atom { color: #bd93f9; }\n.cm-s-dracula span.cm-meta { color: #f8f8f2; }\n.cm-s-dracula span.cm-tag { color: #ff79c6; }\n.cm-s-dracula span.cm-attribute { color: #50fa7b; }\n.cm-s-dracula span.cm-qualifier { color: #50fa7b; }\n.cm-s-dracula span.cm-property { color: #66d9ef; }\n.cm-s-dracula span.cm-builtin { color: #50fa7b; }\n.cm-s-dracula span.cm-variable-3, .cm-s-dracula span.cm-type { color: #ffb86c; }\n\n.cm-s-dracula .CodeMirror-activeline-background { background: rgba(255,255,255,0.1); }\n.cm-s-dracula .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }\n",I+=".CodeMirror-hints {\n position: absolute;\n z-index: 10;\n overflow: hidden;\n list-style: none;\n\n margin: 0;\n padding: 2px;\n\n -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n border-radius: 3px;\n border: 1px solid silver;\n\n background: white;\n font-size: 90%;\n font-family: monospace;\n\n max-height: 20em;\n overflow-y: auto;\n}\n\n.CodeMirror-hint {\n margin: 0;\n padding: 0 4px;\n border-radius: 2px;\n white-space: pre;\n color: black;\n cursor: pointer;\n}\n\nli.CodeMirror-hint-active {\n background: #08f;\n color: white;\n}\n";var E="additional-style",R=document.createElement("template");R.innerHTML="\n<style>\n ".concat(I,"\n ").concat(x,"\n</style>\n").concat(S,"\n");var T=function(n){c(t,u(HTMLElement));var r=s(t);function t(){var n;return o(this,t),(n=r.call(this)).eventMarkers=[],n.initiated=new Promise(function(e){n.createElement(e)}),n}return a(t,[{key:"filename",get:function(){return this._filename}},{key:"setAdditionalCssText",value:function(n){var e=this.shadowRoot.querySelector("#".concat(E));e||((e=document.createElement("style")).id="additional-style",this.shadowRoot.appendChild(e)),e.innerText=n}},{key:"setFilename",value:function(n){this._filename=n}},{key:"editorElement",get:function(){return this.shadowRoot.getElementById("editor")}},{key:"clearAllMarkers",value:function(){this.editorImpl.clearAllMarkers()}},{key:"clearEventMarkers",value:function(){this.editorImpl.clearEventMarkers()}},{key:"createElement",value:function(n){return g(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r,t=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.attachShadow({mode:"open"}),r=R.content.cloneNode(!0),this.shadowRoot.appendChild(r),setTimeout(function(){t.init(),n()});case 4:case"end":return e.stop()}},e,this)}))}},{key:"setWerckmeisterMode",value:function(){return g(this,void 0,void 0,regeneratorRuntime.mark(function n(){var e,r;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,w.WM_Compiler.getFileSystemInspector();case 2:e=n.sent,r=new y.LanguageFeatures(e),this.editorImpl.setMode(v.Mode.sheet),this.editorImpl.activateAutoCompletion(r,this.filename);case 6:case"end":return n.stop()}},n,this)}))}},{key:"updateMode",value:function(){return g(this,void 0,void 0,regeneratorRuntime.mark(function n(){var e,r;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(this.filename){n.next=3;break}return this.editorImpl.setMode(v.Mode.text),n.abrupt("return");case 3:if((e=this.filename.match(/.*(\.[^.]*$)/))&&!(e.length<2)){n.next=7;break}return this.editorImpl.setMode(v.Mode.text),n.abrupt("return");case 7:r=e[1],n.t0=r,n.next=".sheet"===n.t0?11:".template"===n.t0?11:".lua"===n.t0?14:".conductions"===n.t0?15:16;break;case 11:return n.next=13,this.setWerckmeisterMode();case 13:return n.abrupt("return",n.sent);case 14:return n.abrupt("return",this.editorImpl.setMode(v.Mode.lua));case 15:return n.abrupt("return",this.editorImpl.setMode(v.Mode.conductions));case 16:return n.abrupt("return",this.editorImpl.setMode(v.Mode.text));case 17:case"end":return n.stop()}},n,this)}))}},{key:"initListener",value:function(){}},{key:"getScriptText",value:function(){return this.editorImpl.getValue().trim()}},{key:"setScriptText",value:function(n){this.editorImpl.setValue(n)}},{key:"setError",value:function(n){this.clearAllMarkers(),this.editorImpl.setErrorMarker(n.positionBegin,n.positionBegin+1)}},{key:"addWarning",value:function(n){this.editorImpl.setWarningMarker(n.message,n.positionBegin,n.positionBegin+1)}},{key:"getScriptContent",value:function(n){var e=this.attributes.getNamedItem("wm-data");if(e)return atob(e.value);var r=n.match(/\[CDATA\[([\s\S]*)\]\]/);return r?r[1]:n}},{key:"init",value:function(){var n=this.shadowRoot.getElementById("editor"),e=this.getScriptContent(this.innerHTML);this.editorImpl=new v.Editor(n,e,{theme:z,lineNumbers:!0}),this.initListener(),this.readAttributes()}},{key:"loadExternalCss",value:function(n){return g(this,void 0,void 0,regeneratorRuntime.mark(function e(){var r,t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M.fetchText(n);case 2:r=e.sent,(t=document.createElement("style")).innerText=r,this.shadowRoot.appendChild(t);case 6:case"end":return e.stop()}},e,this)}))}},{key:"readAttributes",value:function(){return g(this,void 0,void 0,regeneratorRuntime.mark(function n(){var e,r,t;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:(e=this.attributes.getNamedItem("wm-style"))&&this.editorElement.setAttribute("style",e.value),(r=this.attributes.getNamedItem("wm-css-url"))&&this.loadExternalCss(r.value),(t=this.attributes.getNamedItem("wm-filename"))&&(this.setFilename(t.value),this.updateMode());case 6:case"end":return n.stop()}},n,this)}))}},{key:"addMarkers",value:function(n){var r,t=e(n);try{for(t.s();!(r=t.n()).done;){var o=r.value,i=this.editorImpl.setEventMarker(o.beginPosition,o.beginPosition+1);this.eventMarkers.push(i)}}catch(a){t.e(a)}finally{t.f()}}},{key:"update",value:function(){return g(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return this.editorImpl.update(),n.next=3,this.updateMode();case 3:case"end":return n.stop()}},n,this)}))}},{key:"isClean",value:function(){return this.editorImpl.isClean()}},{key:"markClean",value:function(){this.editorImpl.markClean()}},{key:"clearHistory",value:function(){this.editorImpl.clearHistory()}}]),t}();exports.Editor=T;
506
506
  },{"../../editor/Editor":"BzA4","@werckmeister/language-features":"LghJ","../../shared/http":"vSbS","../../Global":"ooUX","lodash":"B1iE","fs":"rDCW"}],"F8Qk":[function(require,module,exports) {
507
507
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.snippetTemplate=exports.singleSnippetTemplate=void 0;var e="\ntempo: $tempo;\ndevice: MyDevice midi 1;\n$defLines\n[\ninstrument: ex1;\n{\n$code\n}\n]",n="\n$defLines\n$code";exports.singleSnippetTemplate=function(n,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;i=i||"instrumentDef:ex1 MyDevice 0 0 0;";var r=e.replace("$tempo",t.toString()).replace("$defLines",i),p=r.indexOf("$code");return{script:r=r.replace("$code",n),charOffset:p}},exports.snippetTemplate=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;i=i||"instrumentDef:ex1 MyDevice 0 0 0;";var r=n.replace("$tempo",t.toString()).replace("$defLines",i),p=r.indexOf("$code");return{script:r=r.replace("$code",e),charOffset:p}};
508
508
  },{}],"Ii2z":[function(require,module,exports) {
509
509
  "use strict";function e(n){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(n)}function n(e){return o(e)||t(e)||a(e)||r()}function r(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function t(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function o(e){if(Array.isArray(e))return s(e)}function i(e,n){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=a(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var t=0,o=function(){};return{s:o,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw i}}}}function a(e,n){if(e){if("string"==typeof e)return s(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,n):void 0}}function s(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=new Array(n);r<n;r++)t[r]=e[r];return t}function c(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function l(e,n){for(var r=0;r<n.length;r++){var t=n[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}function d(e,n,r){return n&&l(e.prototype,n),r&&l(e,r),e}function u(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&y(e,n)}function p(e){var n=b();return function(){var r,t=w(e);if(n){var o=w(this).constructor;r=Reflect.construct(t,arguments,o)}else r=t.apply(this,arguments);return m(this,r)}}function m(n,r){return!r||"object"!==e(r)&&"function"!=typeof r?f(n):r}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){var n="function"==typeof Map?new Map:void 0;return(h=function(e){if(null===e||!v(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,r)}function r(){return g(e,arguments,w(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),y(r,e)})(e)}function g(e,n,r){return(g=b()?Reflect.construct:function(e,n,r){var t=[null];t.push.apply(t,n);var o=new(Function.bind.apply(e,t));return r&&y(o,r.prototype),o}).apply(null,arguments)}function b(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function v(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function y(e,n){return(y=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e})(e,n)}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var k=this&&this.__awaiter||function(e,n,r,t){return new(r||(r=Promise))(function(o,i){function a(e){try{c(t.next(e))}catch(n){i(n)}}function s(e){try{c(t.throw(e))}catch(n){i(n)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r(function(e){e(n)})).then(a,s)}c((t=t.apply(e,n||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Snippet=void 0;var M=require("../../editor/Editor"),C=require("../../Global"),x=require("../../shared/midiEvent"),S=require("../../shared/player"),E=require("./templates"),z=require("../../shared/http"),R=require("lodash"),P="dracula",I="main.sheet",T=require("fs"),A="/* BASICS */\n\n.CodeMirror {\n /* Set height, width, borders, and global font properties here */\n font-family: monospace;\n height: 300px;\n color: black;\n direction: ltr;\n}\n\n/* PADDING */\n\n.CodeMirror-lines {\n padding: 4px 0; /* Vertical padding around content */\n}\n.CodeMirror pre.CodeMirror-line,\n.CodeMirror pre.CodeMirror-line-like {\n padding: 0 4px; /* Horizontal padding of content */\n}\n\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n background-color: white; /* The little square between H and V scrollbars */\n}\n\n/* GUTTER */\n\n.CodeMirror-gutters {\n border-right: 1px solid #ddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n}\n.CodeMirror-linenumbers {}\n.CodeMirror-linenumber {\n padding: 0 3px 0 5px;\n min-width: 20px;\n text-align: right;\n color: #999;\n white-space: nowrap;\n}\n\n.CodeMirror-guttermarker { color: black; }\n.CodeMirror-guttermarker-subtle { color: #999; }\n\n/* CURSOR */\n\n.CodeMirror-cursor {\n border-left: 1px solid black;\n border-right: none;\n width: 0;\n}\n/* Shown when moving in bi-directional text */\n.CodeMirror div.CodeMirror-secondarycursor {\n border-left: 1px solid silver;\n}\n.cm-fat-cursor .CodeMirror-cursor {\n width: auto;\n border: 0 !important;\n background: #7e7;\n}\n.cm-fat-cursor div.CodeMirror-cursors {\n z-index: 1;\n}\n.cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n}\n.cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #7e7;\n}\n@-moz-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@-webkit-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n\n/* Can style cursor different in overwrite (non-insert) mode */\n.CodeMirror-overwrite .CodeMirror-cursor {}\n\n.cm-tab { display: inline-block; text-decoration: inherit; }\n\n.CodeMirror-rulers {\n position: absolute;\n left: 0; right: 0; top: -50px; bottom: 0;\n overflow: hidden;\n}\n.CodeMirror-ruler {\n border-left: 1px solid #ccc;\n top: 0; bottom: 0;\n position: absolute;\n}\n\n/* DEFAULT THEME */\n\n.cm-s-default .cm-header {color: blue;}\n.cm-s-default .cm-quote {color: #090;}\n.cm-negative {color: #d44;}\n.cm-positive {color: #292;}\n.cm-header, .cm-strong {font-weight: bold;}\n.cm-em {font-style: italic;}\n.cm-link {text-decoration: underline;}\n.cm-strikethrough {text-decoration: line-through;}\n\n.cm-s-default .cm-keyword {color: #708;}\n.cm-s-default .cm-atom {color: #219;}\n.cm-s-default .cm-number {color: #164;}\n.cm-s-default .cm-def {color: #00f;}\n.cm-s-default .cm-variable,\n.cm-s-default .cm-punctuation,\n.cm-s-default .cm-property,\n.cm-s-default .cm-operator {}\n.cm-s-default .cm-variable-2 {color: #05a;}\n.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}\n.cm-s-default .cm-comment {color: #a50;}\n.cm-s-default .cm-string {color: #a11;}\n.cm-s-default .cm-string-2 {color: #f50;}\n.cm-s-default .cm-meta {color: #555;}\n.cm-s-default .cm-qualifier {color: #555;}\n.cm-s-default .cm-builtin {color: #30a;}\n.cm-s-default .cm-bracket {color: #997;}\n.cm-s-default .cm-tag {color: #170;}\n.cm-s-default .cm-attribute {color: #00c;}\n.cm-s-default .cm-hr {color: #999;}\n.cm-s-default .cm-link {color: #00c;}\n\n.cm-s-default .cm-error {color: #f00;}\n.cm-invalidchar {color: #f00;}\n\n.CodeMirror-composing { border-bottom: 2px solid; }\n\n/* Default styles for common addons */\n\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}\n.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }\n.CodeMirror-activeline-background {background: #e8f2ff;}\n\n/* STOP */\n\n/* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n.CodeMirror {\n position: relative;\n overflow: hidden;\n background: white;\n}\n\n.CodeMirror-scroll {\n overflow: scroll !important; /* Things will break if this is overridden */\n /* 50px is the magic margin used to hide the element's real scrollbars */\n /* See overflow: hidden in .CodeMirror */\n margin-bottom: -50px; margin-right: -50px;\n padding-bottom: 50px;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n}\n.CodeMirror-sizer {\n position: relative;\n border-right: 50px solid transparent;\n}\n\n/* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n}\n.CodeMirror-vscrollbar {\n right: 0; top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n.CodeMirror-hscrollbar {\n bottom: 0; left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n}\n.CodeMirror-scrollbar-filler {\n right: 0; bottom: 0;\n}\n.CodeMirror-gutter-filler {\n left: 0; bottom: 0;\n}\n\n.CodeMirror-gutters {\n position: absolute; left: 0; top: 0;\n min-height: 100%;\n z-index: 3;\n}\n.CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n margin-bottom: -50px;\n}\n.CodeMirror-gutter-wrapper {\n position: absolute;\n z-index: 4;\n background: none !important;\n border: none !important;\n}\n.CodeMirror-gutter-background {\n position: absolute;\n top: 0; bottom: 0;\n z-index: 4;\n}\n.CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n}\n.CodeMirror-gutter-wrapper ::selection { background-color: transparent }\n.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }\n\n.CodeMirror-lines {\n cursor: text;\n min-height: 1px; /* prevents collapsing before first draw */\n}\n.CodeMirror pre.CodeMirror-line,\n.CodeMirror pre.CodeMirror-line-like {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n}\n.CodeMirror-wrap pre.CodeMirror-line,\n.CodeMirror-wrap pre.CodeMirror-line-like {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n}\n\n.CodeMirror-linebackground {\n position: absolute;\n left: 0; right: 0; top: 0; bottom: 0;\n z-index: 0;\n}\n\n.CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n padding: 0.1px; /* Force widget margins to stay inside of the container */\n}\n\n.CodeMirror-widget {}\n\n.CodeMirror-rtl pre { direction: rtl; }\n\n.CodeMirror-code {\n outline: none;\n}\n\n/* Force content-box sizing for the elements where we expect it */\n.CodeMirror-scroll,\n.CodeMirror-sizer,\n.CodeMirror-gutter,\n.CodeMirror-gutters,\n.CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n}\n\n.CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n}\n\n.CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n}\n.CodeMirror-measure pre { position: static; }\n\ndiv.CodeMirror-cursors {\n visibility: hidden;\n position: relative;\n z-index: 3;\n}\ndiv.CodeMirror-dragcursors {\n visibility: visible;\n}\n\n.CodeMirror-focused div.CodeMirror-cursors {\n visibility: visible;\n}\n\n.CodeMirror-selected { background: #d9d9d9; }\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\n.CodeMirror-crosshair { cursor: crosshair; }\n.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }\n.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }\n\n.cm-searching {\n background-color: #ffa;\n background-color: rgba(255, 255, 0, .4);\n}\n\n/* Used to force a border model for a node */\n.cm-force-border { padding-right: .1px; }\n\n@media print {\n /* Hide the cursor when printing */\n .CodeMirror div.CodeMirror-cursors {\n visibility: hidden;\n }\n}\n\n/* See issue #2901 */\n.cm-tab-wrap-hack:after { content: ''; }\n\n/* Help users use markselection to safely style text background */\nspan.CodeMirror-selectedtext { background: none; }\n";A+="/*\n\n Name: dracula\n Author: Michael Kaminsky (http://github.com/mkaminsky11)\n\n Original dracula color scheme by Zeno Rocha (https://github.com/zenorocha/dracula-theme)\n\n*/\n\n\n.cm-s-dracula.CodeMirror, .cm-s-dracula .CodeMirror-gutters {\n background-color: #282a36 !important;\n color: #f8f8f2 !important;\n border: none;\n}\n.cm-s-dracula .CodeMirror-gutters { color: #282a36; }\n.cm-s-dracula .CodeMirror-cursor { border-left: solid thin #f8f8f0; }\n.cm-s-dracula .CodeMirror-linenumber { color: #6D8A88; }\n.cm-s-dracula .CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }\n.cm-s-dracula .CodeMirror-line::selection, .cm-s-dracula .CodeMirror-line > span::selection, .cm-s-dracula .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); }\n.cm-s-dracula .CodeMirror-line::-moz-selection, .cm-s-dracula .CodeMirror-line > span::-moz-selection, .cm-s-dracula .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); }\n.cm-s-dracula span.cm-comment { color: #6272a4; }\n.cm-s-dracula span.cm-string, .cm-s-dracula span.cm-string-2 { color: #f1fa8c; }\n.cm-s-dracula span.cm-number { color: #bd93f9; }\n.cm-s-dracula span.cm-variable { color: #50fa7b; }\n.cm-s-dracula span.cm-variable-2 { color: white; }\n.cm-s-dracula span.cm-def { color: #50fa7b; }\n.cm-s-dracula span.cm-operator { color: #ff79c6; }\n.cm-s-dracula span.cm-keyword { color: #ff79c6; }\n.cm-s-dracula span.cm-atom { color: #bd93f9; }\n.cm-s-dracula span.cm-meta { color: #f8f8f2; }\n.cm-s-dracula span.cm-tag { color: #ff79c6; }\n.cm-s-dracula span.cm-attribute { color: #50fa7b; }\n.cm-s-dracula span.cm-qualifier { color: #50fa7b; }\n.cm-s-dracula span.cm-property { color: #66d9ef; }\n.cm-s-dracula span.cm-builtin { color: #50fa7b; }\n.cm-s-dracula span.cm-variable-3, .cm-s-dracula span.cm-type { color: #ffb86c; }\n\n.cm-s-dracula .CodeMirror-activeline-background { background: rgba(255,255,255,0.1); }\n.cm-s-dracula .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }\n";var O,_='#editor {\n border: 1px solid black;\n width: 100%;\n height: 100%;\n}\n\n.CodeMirror {\n width: 100%;\n height: 100%;\n font-size: 14px;\n}\n\n#messages span {\n margin: 0.5em 0;\n padding: 8px 15px 8px 15px;\n color: black;\n font-size: 14px;\n font-variant: tabular-nums;\n line-height: 1.5;\n list-style: none;\n font-feature-settings: \'tnum\';\n display: block;\n position: relative;\n right: -2px;\n}\n\n#messages .error {\n background-color: #fff1f0;\n}\n\n#messages .error::before {\n --size: 20px;\n content: "!";\n margin-right: 1em;\n color: white;\n background: red;\n border-radius: var(--size);\n width: var(--size);\n display: inline-block;\n height: var(--size);\n text-align: center;\n}\n\n#wm-snippet {\n margin-bottom: 1.5em;\n font-family: Helvetica, Arial, sans-serif;\n}\n\n.wm-marked::before {\n content: " ";\n position: absolute;\n border-top: 4px solid #ff0;\n border-left: 4px solid #ff0;\n border-radius: 0;\n height: 8px;\n width: 8px;\n transform: rotate(-135deg);\n margin-top: -11px;\n margin-left: 8px;\n}\n\n\n.wm-error::before {\n content: " ";\n position: absolute;\n border-top: 4px solid red;\n border-left: 4px solid red;\n border-radius: 0;\n height: 8px;\n width: 8px;\n transform: rotate(-135deg);\n margin-top: -11px;\n margin-left: 8px;\n}\n\n#btnPlay, #btnStop {\n cursor: pointer;\n user-select: none;\n}\n\n.wm-state-playing #btnPlay {\n display: none;\n}\n\n.wm-state-stopped #btnStop {\n display: none;\n}\n\n.wm-player-fetching #btnStop\n, .wm-player-fetching #btnPlay\n{\n display: none;\n}\n\n#fetching {\n display: none;\n}\n\n@keyframes spin { 100% { transform:rotate(360deg); } }\n#fetching svg {\n animation:spin 2s linear infinite;\n}\n\n.wm-player-fetching #fetching {\n display: block;\n}\n\n.icon {\n vertical-align: top;\n}\n\n.whomai {\n display: block;\n width: 100%;\n text-align: right;\n font-size: 13px;\n font-style: italic;\n}',N='<div id="wm-snippet">\n <div id="wm-controls">\n <a id="btnPlay">\n <svg class="icon" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-play-fill" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path d="M11.596 8.697l-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"/>\n </svg>\n Play\n </a>\n <a id="btnStop">\n <svg class="icon" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-stop-fill" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path d="M5 3.5h6A1.5 1.5 0 0 1 12.5 5v6a1.5 1.5 0 0 1-1.5 1.5H5A1.5 1.5 0 0 1 3.5 11V5A1.5 1.5 0 0 1 5 3.5z"/>\n </svg>\n Stop\n </a>\n <span id="fetching">\n <svg class="icon" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-gear" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" d="M8.837 1.626c-.246-.835-1.428-.835-1.674 0l-.094.319A1.873 1.873 0 0 1 4.377 3.06l-.292-.16c-.764-.415-1.6.42-1.184 1.185l.159.292a1.873 1.873 0 0 1-1.115 2.692l-.319.094c-.835.246-.835 1.428 0 1.674l.319.094a1.873 1.873 0 0 1 1.115 2.693l-.16.291c-.415.764.42 1.6 1.185 1.184l.292-.159a1.873 1.873 0 0 1 2.692 1.116l.094.318c.246.835 1.428.835 1.674 0l.094-.319a1.873 1.873 0 0 1 2.693-1.115l.291.16c.764.415 1.6-.42 1.184-1.185l-.159-.291a1.873 1.873 0 0 1 1.116-2.693l.318-.094c.835-.246.835-1.428 0-1.674l-.319-.094a1.873 1.873 0 0 1-1.115-2.692l.16-.292c.415-.764-.42-1.6-1.185-1.184l-.291.159A1.873 1.873 0 0 1 8.93 1.945l-.094-.319zm-2.633-.283c.527-1.79 3.065-1.79 3.592 0l.094.319a.873.873 0 0 0 1.255.52l.292-.16c1.64-.892 3.434.901 2.54 2.541l-.159.292a.873.873 0 0 0 .52 1.255l.319.094c1.79.527 1.79 3.065 0 3.592l-.319.094a.873.873 0 0 0-.52 1.255l.16.292c.893 1.64-.902 3.434-2.541 2.54l-.292-.159a.873.873 0 0 0-1.255.52l-.094.319c-.527 1.79-3.065 1.79-3.592 0l-.094-.319a.873.873 0 0 0-1.255-.52l-.292.16c-1.64.893-3.433-.902-2.54-2.541l.159-.292a.873.873 0 0 0-.52-1.255l-.319-.094c-1.79-.527-1.79-3.065 0-3.592l.319-.094a.873.873 0 0 0 .52-1.255l-.16-.292c-.892-1.64.902-3.433 2.541-2.54l.292.159a.873.873 0 0 0 1.255-.52l.094-.319z"/>\n <path fill-rule="evenodd" d="M8 5.754a2.246 2.246 0 1 0 0 4.492 2.246 2.246 0 0 0 0-4.492zM4.754 8a3.246 3.246 0 1 1 6.492 0 3.246 3.246 0 0 1-6.492 0z"/>\n </svg>\n Play\n </span>\n </div>\n <div id="messages">\n\n </div>\n <div id="editor">\n </div>\n <span class="whomai">\n powered by <a href="https://github.com/werckme/werckmeister-component">werckmeister snippet</a>\n </span>\n</div>';!function(e){e[e.single=0]="single",e[e.default=1]="default"}(O||(O={}));var L=0,B=new Map,H=document.createElement("template");H.innerHTML="\n<style>\n ".concat(A,"\n ").concat(_,"\n</style>\n").concat(N,"\n");var j=function(e){u(t,h(HTMLElement));var r=p(t);function t(){var e;return c(this,t),(e=r.call(this)).snippetId=L++,e.bpm=120,e.type=O.default,e.eventMarkers=[],e.playingStateName="wm-state-playing",e.stoppedStateName="wm-state-stopped",e.snippetName="noname.sheet",e.scriptToSnippetCharOffset=0,e.createElement(),e}return d(t,[{key:"playerIsFetching",get:function(){return this._playerIsFetching},set:function(e){this._playerIsFetching=e;var n=this.snippetElement;e?n.classList.add("wm-player-fetching"):n.classList.remove("wm-player-fetching")}},{key:"snippetElement",get:function(){return this.shadowRoot.getElementById("wm-snippet")}},{key:"messagesElement",get:function(){return this.shadowRoot.getElementById("messages")}},{key:"playButtonElement",get:function(){return this.shadowRoot.getElementById("btnPlay")}},{key:"stopButtonElement",get:function(){return this.shadowRoot.getElementById("btnStop")}},{key:"createElement",value:function(){return k(this,void 0,void 0,regeneratorRuntime.mark(function e(){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.attachShadow({mode:"open"}),n=H.content.cloneNode(!0),this.shadowRoot.appendChild(n),setTimeout(this.init.bind(this));case 4:case"end":return e.stop()}},e,this)}))}},{key:"initListener",value:function(){this.playButtonElement.addEventListener("click",this.onPlayClicked.bind(this)),this.stopButtonElement.addEventListener("click",this.onStopClicked.bind(this))}},{key:"onMidiEvent",value:function(e){e.midiEvent.eventType===x.EventType.NoteOn&&this.updateMarkers(e.position)}},{key:"stopAllSippets",value:function(){return k(this,void 0,void 0,regeneratorRuntime.mark(function e(){var n,r,t,o;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=Array.from(B.values()),r=0,t=n;case 2:if(!(r<t.length)){e.next=9;break}return o=t[r],e.next=6,o.stop();case 6:r++,e.next=2;break;case 9:return e.abrupt("return",new Promise(function(e){setTimeout(e,100)}));case 10:case"end":return e.stop()}},e)}))}},{key:"onPlayerState",value:function(e,n){n===S.PlayerState.Playing&&(B.set(this.snippetId,this),this.setControlsStatePlaying()),n===S.PlayerState.Stopped&&(B.delete(this.snippetId),this.clearEventMarkers(),this.setControlsStateStopped()),this.onPlayerStateChanged&&this.onPlayerStateChanged(e,n)}},{key:"setControlsStateStopped",value:function(){var e=this.snippetElement;e.classList.remove(this.playingStateName),e.classList.add(this.stoppedStateName)}},{key:"setControlsStatePlaying",value:function(){var e=this.snippetElement;e.classList.remove(this.stoppedStateName),e.classList.add(this.playingStateName)}},{key:"clearEventMarkers",value:function(){var e,n=i(this.eventMarkers);try{for(n.s();!(e=n.n()).done;){e.value.clear()}}catch(r){n.e(r)}finally{n.f()}}},{key:"updateMarkers",value:function(e){this.clearEventMarkers();var n=R(this.document.eventInfos).map(function(n){return{diff:Math.abs(e-n.sheetTime),sheetEvents:n.sheetEventInfos}}).minBy(function(e){return e.diff});if(n){var r,t=this.scriptToSnippetCharOffset,o=i(n.sheetEvents);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(a.sourceId===this.snippetDocumentId){var s=this.editor.setEventMarker(a.beginPosition-t,a.beginPosition-t+1);this.eventMarkers.push(s)}}}catch(c){o.e(c)}finally{o.f()}}}},{key:"getPlayerImpl",value:function(){return C.WM_Player}},{key:"getScriptText",value:function(){var e=this.editor.getValue();if(!e.trim())return"";this.scriptToSnippetCharOffset=0;var n=void 0;if(this._defLines&&(n=atob(this._defLines)),this.type===O.single){var r=E.singleSnippetTemplate(e,this.bpm,n);return this.scriptToSnippetCharOffset=r.charOffset,r.script.trim()}if(n){var t=E.snippetTemplate(e,this.bpm,n);return this.scriptToSnippetCharOffset=t.charOffset,t.script.trim()}return e.trim()}},{key:"onPlayClicked",value:function(e){return k(this,void 0,void 0,regeneratorRuntime.mark(function n(){return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,this.stopAllSippets();case 3:return n.next=5,this.startPlayer(e);case 5:n.next=11;break;case 7:return n.prev=7,n.t0=n.catch(0),n.t0.error?this.onError(n.t0.error):console.log(n.t0),n.abrupt("return");case 11:case"end":return n.stop()}},n,this,[[0,7]])}))}},{key:"getWorkspaceFormUrl",value:function(e){return k(this,void 0,void 0,regeneratorRuntime.mark(function n(){var r,t,o;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,fetch(e);case 2:return r=n.sent,n.next=5,r.json();case 5:return t=n.sent,o=t.files,n.abrupt("return",o);case 8:case"end":return n.stop()}},n)}))}},{key:"getAdditionalSources",value:function(){if(this._addSources)return this._addSources;if(!this._addSourcesBase64String)return[];var e=atob(this._addSourcesBase64String),n=JSON.parse(e);return Array.isArray(n)?n:[]}},{key:"startPlayer",value:function(e){return k(this,void 0,void 0,regeneratorRuntime.mark(function r(){var t,o,i=this;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,C.WM_Player.prepare(e);case 2:return r.next=4,C.resetCompiler();case 4:if(this.editor.clearEventMarkers(),this.clearMessages(),t=this.getScriptText()){r.next=9;break}return r.abrupt("return");case 9:return this.snippetDocumentId=null,this.playerIsFetching=!0,r.prev=11,o=[{path:this.snippetName,data:t}].concat(n(this.getAdditionalSources())),r.next=15,C.WM_Compiler.compile(o);case 15:this.document=r.sent,r.next=23;break;case 18:return r.prev=18,r.t0=r.catch(11),r.t0.error?this.onError(r.t0.error):console.log(r.t0),this.playerIsFetching=!1,r.abrupt("return");case 23:return this.snippetDocumentId=R(this.document.midi.sources).find(function(e){return e.path==="/".concat(i.snippetName)}).sourceId,this.snippetDocumentId||console.error("werckmeister compiler could not assign main document"),C.WM_Player.tempo=this.document.midi.bpm,r.prev=26,r.next=29,C.WM_Player.play(this.document.midi.midiData,e,this.onMidiEvent.bind(this),this.onPlayerState.bind(this));case 29:return r.prev=29,this.playerIsFetching=!1,r.finish(29);case 32:case"end":return r.stop()}},r,this,[[11,18],[26,,29,32]])}))}},{key:"onStopClicked",value:function(e){return k(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.stop();case 1:case"end":return e.stop()}},e,this)}))}},{key:"stop",value:function(){return k(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,C.WM_Player.stop();case 2:case"end":return e.stop()}},e)}))}},{key:"editorOverlappingWorkaround",value:function(e){this.snippetElement.style.marginBottom=e?"".concat(e,"px"):""}},{key:"setMessage",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",r=this.messagesElement;r.innerHTML='<span class="'.concat(n,'">').concat(e,"</span>"),this.editorOverlappingWorkaround(2*r.clientHeight)}},{key:"clearMessages",value:function(){this.messagesElement.innerHTML="",this.editorOverlappingWorkaround(0)}},{key:"onError",value:function(e){var n=this.scriptToSnippetCharOffset;this.editor.setErrorMarker(e.positionBegin-n,e.positionBegin-n+1),console.error("werckmeister compiler error: ".concat(e.errorMessage)),this.setMessage("".concat(e.errorMessage),"error")}},{key:"getScriptContent",value:function(e){return k(this,void 0,void 0,regeneratorRuntime.mark(function n(){var r,t,o,i,a;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!(r=this.attributes.getNamedItem("wm-workspace-url"))){n.next=8;break}return n.next=4,this.getWorkspaceFormUrl(r.value);case 4:return t=n.sent,o=t.find(function(e){return e.path===I}),this._addSources=t.filter(function(e){return e.path!==I}),n.abrupt("return",o.data);case 8:if(!(i=this.attributes.getNamedItem("wm-data"))){n.next=11;break}return n.abrupt("return",atob(i.value));case 11:if(!(a=e.match(/\[CDATA\[([\s\S]*)\]\]/))){n.next=14;break}return n.abrupt("return",a[1]);case 14:return n.abrupt("return",e);case 15:case"end":return n.stop()}},n,this)}))}},{key:"init",value:function(){return k(this,void 0,void 0,regeneratorRuntime.mark(function e(){var n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.shadowRoot.getElementById("editor"),e.next=3,this.getScriptContent(this.innerHTML);case 3:r=e.sent,this.editor=new M.Editor(n,r,{theme:P}),this.setControlsStateStopped(),this.initListener(),this.readAttributes(),this.applyHiddenLineHack();case 9:case"end":return e.stop()}},e,this)}))}},{key:"applyHiddenLineHack",value:function(){for(var e=this.shadowRoot.querySelectorAll(".cm-wm-hidden-line"),n=0,r=Array.from(e);n<r.length;n++){r[n].parentElement.parentElement.classList.add("wm-hidden-line")}}},{key:"loadExternalCss",value:function(e){return k(this,void 0,void 0,regeneratorRuntime.mark(function n(){var r,t;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,z.fetchText(e);case 2:r=n.sent,(t=document.createElement("style")).innerText=r,this.shadowRoot.appendChild(t);case 6:case"end":return n.stop()}},n,this)}))}},{key:"readAttributes",value:function(){return k(this,void 0,void 0,regeneratorRuntime.mark(function e(){var n,r,t,o,i,a,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:(n=this.attributes.getNamedItem("wm-type"))&&"single"===n.value&&(this.type=O.single),(r=this.attributes.getNamedItem("wm-tempo"))&&(this.bpm=Number.parseFloat(r.value)),(t=this.attributes.getNamedItem("wm-style"))&&this.snippetElement.setAttribute("style",t.value),(o=this.attributes.getNamedItem("wm-css-url"))&&this.loadExternalCss(o.value),(i=this.attributes.getNamedItem("wm-def"))&&(this._defLines=i.value),(a=this.attributes.getNamedItem("wm-add-sources"))&&(this._addSourcesBase64String=a.value),(s=this.attributes.getNamedItem("wm-soundfont-url"))&&C.WM_Player.setSoundfontRepoUrl(s.value);case 14:case"end":return e.stop()}},e,this)}))}}]),t}();exports.Snippet=j;
510
510
  },{"../../editor/Editor":"BzA4","../../Global":"ooUX","../../shared/midiEvent":"vkzS","../../shared/player":"FYcy","./templates":"F8Qk","../../shared/http":"vSbS","lodash":"B1iE","fs":"rDCW"}],"DsX5":[function(require,module,exports) {
511
- "use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=n(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function n(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}function c(e){var t=d();return function(){var n,r=y(e);if(t){var i=y(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u(this,n)}}function u(t,n){return!n||"object"!==e(n)&&"function"!=typeof n?l(t):n}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){var t="function"==typeof Map?new Map:void 0;return(f=function(e){if(null===e||!h(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return p(e,arguments,y(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),m(n,e)})(e)}function p(e,t,n){return(p=d()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&m(i,n.prototype),i}).apply(null,arguments)}function d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function h(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Workspace=void 0;var g=require("../../Global"),w=require("../../shared/midiEvent"),b=require("../../shared/player"),k=require("../../shared/http"),E=require("lodash"),M=require("fs"),S="#wm-controls a {\n cursor: pointer;\n user-select: none;\n}\n\n.wm-state-playing #btnPlay {\n display: none;\n}\n \n.wm-state-stopped #btnStop {\n display: none;\n}\n \n.wm-player-fetching #btnStop\n, .wm-player-fetching #btnPlay\n{\n display: none;\n}\n \n#fetching {\n display: none;\n}\n\n@keyframes spin { 100% { transform:rotate(360deg); } }\n#fetching svg {\n animation:spin 2s linear infinite;\n}\n\n.wm-player-fetching #fetching {\n display: block;\n}\n",x='<div id="wm-controls" class="wm-state-stopped">\n <a id="btnPlay">\n <svg class="icon" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-play-fill" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path d="M11.596 8.697l-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"/>\n </svg>\n Play\n </a>\n <a id="btnStop">\n <svg class="icon" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-stop-fill" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path d="M5 3.5h6A1.5 1.5 0 0 1 12.5 5v6a1.5 1.5 0 0 1-1.5 1.5H5A1.5 1.5 0 0 1 3.5 11V5A1.5 1.5 0 0 1 5 3.5z"/>\n </svg>\n Stop\n </a>\n <span id="fetching">\n <svg class="icon" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-gear" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" d="M8.837 1.626c-.246-.835-1.428-.835-1.674 0l-.094.319A1.873 1.873 0 0 1 4.377 3.06l-.292-.16c-.764-.415-1.6.42-1.184 1.185l.159.292a1.873 1.873 0 0 1-1.115 2.692l-.319.094c-.835.246-.835 1.428 0 1.674l.319.094a1.873 1.873 0 0 1 1.115 2.693l-.16.291c-.415.764.42 1.6 1.185 1.184l.292-.159a1.873 1.873 0 0 1 2.692 1.116l.094.318c.246.835 1.428.835 1.674 0l.094-.319a1.873 1.873 0 0 1 2.693-1.115l.291.16c.764.415 1.6-.42 1.184-1.185l-.159-.291a1.873 1.873 0 0 1 1.116-2.693l.318-.094c.835-.246.835-1.428 0-1.674l-.319-.094a1.873 1.873 0 0 1-1.115-2.692l.16-.292c.415-.764-.42-1.6-1.185-1.184l-.291.159A1.873 1.873 0 0 1 8.93 1.945l-.094-.319zm-2.633-.283c.527-1.79 3.065-1.79 3.592 0l.094.319a.873.873 0 0 0 1.255.52l.292-.16c1.64-.892 3.434.901 2.54 2.541l-.159.292a.873.873 0 0 0 .52 1.255l.319.094c1.79.527 1.79 3.065 0 3.592l-.319.094a.873.873 0 0 0-.52 1.255l.16.292c.893 1.64-.902 3.434-2.541 2.54l-.292-.159a.873.873 0 0 0-1.255.52l-.094.319c-.527 1.79-3.065 1.79-3.592 0l-.094-.319a.873.873 0 0 0-1.255-.52l-.292.16c-1.64.893-3.433-.902-2.54-2.541l.159-.292a.873.873 0 0 0-.52-1.255l-.319-.094c-1.79-.527-1.79-3.065 0-3.592l.319-.094a.873.873 0 0 0 .52-1.255l-.16-.292c-.892-1.64.902-3.433 2.541-2.54l.292.159a.873.873 0 0 0 1.255-.52l.094-.319z"/>\n <path fill-rule="evenodd" d="M8 5.754a2.246 2.246 0 1 0 0 4.492 2.246 2.246 0 0 0 0-4.492zM4.754 8a3.246 3.246 0 1 1 6.492 0 3.246 3.246 0 0 1-6.492 0z"/>\n </svg>\n Play\n </span> \n</div>',P=document.createElement("template");P.innerHTML="\n<style>\n".concat(S,"\n</style>\n").concat(x,"\n");var C=function(e){s(r,f(HTMLElement));var n=c(r);function r(){var e;return i(this,r),(e=n.call(this)).bpm=120,e.onError=function(e){},e.onWarnings=function(e){},e.onCompiled=function(e){},e.onStateChanged=function(e,t){},e.updateMarkersDebounceMillis=50,e.editors=[],e.sourceIdEditorMap=new Map,e.lastEventTimeQuarters=0,e.updateMarkersDebounced=E.debounce(e.updateMarkersImpl.bind(l(e)),e.updateMarkersDebounceMillis),e._beginQuarters=0,e.playerState=b.PlayerState.Stopped,e.createElement(),e}return a(r,[{key:"beginQuarters",get:function(){return this._beginQuarters},set:function(e){this._beginQuarters=Math.max(0,e)}},{key:"getEditorByFileName",value:function(e){var t=this.editors.map(function(e){return"/".concat(e.filename)}).indexOf(e);if(!(t<0))return this.editors[t]}},{key:"playerIsFetching",get:function(){return this._playerIsFetching},set:function(e){this._playerIsFetching=e;var t=this.workspaceControlsElement;e?t.classList.add("wm-player-fetching"):t.classList.remove("wm-player-fetching")}},{key:"workspaceControlsElement",get:function(){return this.shadowRoot.getElementById("wm-controls")}},{key:"playButtonElement",get:function(){return this.shadowRoot.getElementById("btnPlay")}},{key:"stopButtonElement",get:function(){return this.shadowRoot.getElementById("btnStop")}},{key:"createElement",value:function(){return v(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.attachShadow({mode:"open"}),t=P.content.cloneNode(!0),this.shadowRoot.appendChild(t),setTimeout(this.init.bind(this));case 4:case"end":return e.stop()}},e,this)}))}},{key:"initListener",value:function(){this.playButtonElement.addEventListener("click",this.onPlayClicked.bind(this)),this.stopButtonElement.addEventListener("click",this.onStopClicked.bind(this))}},{key:"updateMarkers",value:function(e){this.lastEventTimeQuarters=e,this.updateMarkersDebounced()}},{key:"updateMarkersImpl",value:function(){var e=this.lastEventTimeQuarters;this.clearAllEventMarkers();var n=E(this.document.eventInfos).map(function(t){return{diff:Math.abs(e-t.sheetTime),sheetEvents:t.sheetEventInfos}}).minBy(function(e){return e.diff});if(n){var r,i=t(n.sheetEvents);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=this.sourceIdEditorMap.get(o.sourceId);a&&a.addMarkers([o])}}catch(s){i.e(s)}finally{i.f()}}}},{key:"onMidiEvent",value:function(e){e.midiEvent.eventType===w.EventType.NoteOn&&this.updateMarkers(e.position+this.beginQuarters)}},{key:"onPlayerState",value:function(e,t){t===b.PlayerState.Stopped&&(this.clearAllEventMarkers(),this.workspaceControlsElement.classList.remove("wm-state-playing"),this.workspaceControlsElement.classList.add("wm-state-stopped")),t===b.PlayerState.Playing&&(this.workspaceControlsElement.classList.remove("wm-state-stopped"),this.workspaceControlsElement.classList.add("wm-state-playing")),this.playerState=t,this.onStateChanged(e,t)}},{key:"updateSourceIdMap",value:function(e){var n=this;this.sourceIdEditorMap.clear();var r,i=t(e.midi.sources);try{var o=function(){var e=r.value,t=n.editors.find(function(t){return"/"+t.filename===e.path});if(!t)return"continue";n.sourceIdEditorMap.set(e.sourceId,t)};for(i.s();!(r=i.n()).done;)o()}catch(a){i.e(a)}finally{i.f()}}},{key:"onPlayClicked",value:function(e){this.play(e)}},{key:"play",value:function(e){return v(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.WM_Player.prepare(e);case 2:return t.next=4,g.resetCompiler();case 4:this.playerIsFetching=!0,this.onPlayerState(this.playerState,b.PlayerState.Preparing),setTimeout(function(){return v(n,void 0,void 0,regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=this.editors.map(function(e){return{path:e.filename,data:e.getScriptText()}}),this.clearAllEditorMarkers(),t.next=5,g.WM_Compiler.compile(n,this.beginQuarters);case 5:this.document=t.sent,this.onCompiled(this.document),this.updateSourceIdMap(this.document),this.document.midi.warnings&&this.document.midi.warnings.length>0&&this._onWarnings(this.document.midi.warnings),t.next=17;break;case 11:return t.prev=11,t.t0=t.catch(0),this._onError(t.t0.error||t.t0),this.playerIsFetching=!1,this.onPlayerState(this.playerState,b.PlayerState.Stopped),t.abrupt("return");case 17:return g.WM_Player.tempo=this.document.midi.bpm,t.next=20,g.WM_Player.play(this.document.midi.midiData,e,this.onMidiEvent.bind(this),this.onPlayerState.bind(this));case 20:this.playerIsFetching=!1;case 21:case"end":return t.stop()}},t,this,[[0,11]])}))});case 7:case"end":return t.stop()}},t,this)}))}},{key:"download",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"WerckmeisterMidi.mid";return v(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n,r,i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.resetCompiler();case 2:return t.prev=2,n=this.editors.map(function(e){return{path:e.filename,data:e.getScriptText()}}),t.next=6,g.WM_Compiler.compile(n);case 6:this.document=t.sent,t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(2),this._onError(t.t0.error||t.t0),t.abrupt("return");case 13:r="data:midi;base64,".concat(this.document.midi.midiData),(i=document.createElement("a")).href=r,i.download=e,i.click();case 18:case"end":return t.stop()}},t,this,[[2,9]])}))}},{key:"onStopClicked",value:function(e){this.stop()}},{key:"stop",value:function(){return v(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,g.WM_Player.stop();case 2:case"end":return e.stop()}},e)}))}},{key:"clearAllEditorMarkers",value:function(){var e,n=t(this.editors);try{for(n.s();!(e=n.n()).done;){e.value.clearAllMarkers()}}catch(r){n.e(r)}finally{n.f()}}},{key:"clearAllEventMarkers",value:function(){var e,n=t(this.editors);try{for(n.s();!(e=n.n()).done;){e.value.clearEventMarkers()}}catch(r){n.e(r)}finally{n.f()}}},{key:"_onError",value:function(e){if(e instanceof Error)console.error("".concat(e));else{this.onError(e),console.error("".concat(e.sourceFile,'": ').concat(e.errorMessage));var t=this.getEditorByFileName(e.sourceFile);t&&t.setError(e)}}},{key:"_onWarnings",value:function(e){var n,r=t(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;console.warn(i.message),this.getEditorByFileName(i.sourceFile).addWarning(i)}}catch(o){r.e(o)}finally{r.f()}this.onWarnings(e)}},{key:"init",value:function(){this.initListener(),this.readAttributes()}},{key:"loadExternalCss",value:function(e){return v(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n,r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,k.fetchText(e);case 2:n=t.sent,(r=document.createElement("style")).innerText=n,this.shadowRoot.appendChild(r);case 6:case"end":return t.stop()}},t,this)}))}},{key:"readAttributes",value:function(){return v(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:(t=this.attributes.getNamedItem("wm-onerror"))&&console.error(t),(n=this.attributes.getNamedItem("wm-css-url"))&&this.loadExternalCss(n.value),(r=this.attributes.getNamedItem("wm-soundfont-url"))&&g.WM_Player.setSoundfontRepoUrl(r.value);case 6:case"end":return e.stop()}},e,this)}))}},{key:"registerEditor",value:function(e){this.editors.push(e),e.initiated.then(function(){var t=e.filename,n=e.getScriptText();g.WM_Compiler.writeFileToFS(t,n)})}},{key:"unregisterEditor",value:function(e){var t=this.editors.indexOf(e);t<0||this.editors.splice(t,1)}},{key:"getPlayerImpl",value:function(){return g.WM_Player}},{key:"isClean",value:function(){return E.every(this.editors,function(e){return e.isClean()})}},{key:"markClean",value:function(){var e,n=t(this.editors);try{for(n.s();!(e=n.n()).done;){e.value.markClean()}}catch(r){n.e(r)}finally{n.f()}}}]),r}();exports.Workspace=C;
511
+ "use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=n(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function n(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}function c(e){var t=p();return function(){var n,r=m(e);if(t){var i=m(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u(this,n)}}function u(t,n){return!n||"object"!==e(n)&&"function"!=typeof n?l(t):n}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){var t="function"==typeof Map?new Map:void 0;return(f=function(e){if(null===e||!h(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return d(e,arguments,m(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),y(n,e)})(e)}function d(e,t,n){return(d=p()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&y(i,n.prototype),i}).apply(null,arguments)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}function h(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var v=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{c(r.next(e))}catch(t){o(t)}}function s(e){try{c(r.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Workspace=void 0;var g=require("../../Global"),w=require("../../shared/midiEvent"),b=require("../../shared/player"),k=require("../../shared/http"),E=require("lodash"),M=require("fs"),S="#wm-controls a {\n cursor: pointer;\n user-select: none;\n}\n\n.wm-state-playing #btnPlay {\n display: none;\n}\n \n.wm-state-stopped #btnStop {\n display: none;\n}\n \n.wm-player-fetching #btnStop\n, .wm-player-fetching #btnPlay\n{\n display: none;\n}\n \n#fetching {\n display: none;\n}\n\n@keyframes spin { 100% { transform:rotate(360deg); } }\n#fetching svg {\n animation:spin 2s linear infinite;\n}\n\n.wm-player-fetching #fetching {\n display: block;\n}\n",x='<div id="wm-controls" class="wm-state-stopped">\n <a id="btnPlay">\n <svg class="icon" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-play-fill" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path d="M11.596 8.697l-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"/>\n </svg>\n Play\n </a>\n <a id="btnStop">\n <svg class="icon" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-stop-fill" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path d="M5 3.5h6A1.5 1.5 0 0 1 12.5 5v6a1.5 1.5 0 0 1-1.5 1.5H5A1.5 1.5 0 0 1 3.5 11V5A1.5 1.5 0 0 1 5 3.5z"/>\n </svg>\n Stop\n </a>\n <span id="fetching">\n <svg class="icon" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-gear" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" d="M8.837 1.626c-.246-.835-1.428-.835-1.674 0l-.094.319A1.873 1.873 0 0 1 4.377 3.06l-.292-.16c-.764-.415-1.6.42-1.184 1.185l.159.292a1.873 1.873 0 0 1-1.115 2.692l-.319.094c-.835.246-.835 1.428 0 1.674l.319.094a1.873 1.873 0 0 1 1.115 2.693l-.16.291c-.415.764.42 1.6 1.185 1.184l.292-.159a1.873 1.873 0 0 1 2.692 1.116l.094.318c.246.835 1.428.835 1.674 0l.094-.319a1.873 1.873 0 0 1 2.693-1.115l.291.16c.764.415 1.6-.42 1.184-1.185l-.159-.291a1.873 1.873 0 0 1 1.116-2.693l.318-.094c.835-.246.835-1.428 0-1.674l-.319-.094a1.873 1.873 0 0 1-1.115-2.692l.16-.292c.415-.764-.42-1.6-1.185-1.184l-.291.159A1.873 1.873 0 0 1 8.93 1.945l-.094-.319zm-2.633-.283c.527-1.79 3.065-1.79 3.592 0l.094.319a.873.873 0 0 0 1.255.52l.292-.16c1.64-.892 3.434.901 2.54 2.541l-.159.292a.873.873 0 0 0 .52 1.255l.319.094c1.79.527 1.79 3.065 0 3.592l-.319.094a.873.873 0 0 0-.52 1.255l.16.292c.893 1.64-.902 3.434-2.541 2.54l-.292-.159a.873.873 0 0 0-1.255.52l-.094.319c-.527 1.79-3.065 1.79-3.592 0l-.094-.319a.873.873 0 0 0-1.255-.52l-.292.16c-1.64.893-3.433-.902-2.54-2.541l.159-.292a.873.873 0 0 0-.52-1.255l-.319-.094c-1.79-.527-1.79-3.065 0-3.592l.319-.094a.873.873 0 0 0 .52-1.255l-.16-.292c-.892-1.64.902-3.433 2.541-2.54l.292.159a.873.873 0 0 0 1.255-.52l.094-.319z"/>\n <path fill-rule="evenodd" d="M8 5.754a2.246 2.246 0 1 0 0 4.492 2.246 2.246 0 0 0 0-4.492zM4.754 8a3.246 3.246 0 1 1 6.492 0 3.246 3.246 0 0 1-6.492 0z"/>\n </svg>\n Play\n </span> \n</div>',C="_editor.css",P="\n<style>\n".concat(S,"\n</style>\n").concat(x,"\n"),_=document.createElement("template");_.innerHTML=P;var I=function(e){s(r,f(HTMLElement));var n=c(r);function r(){var e;return i(this,r),(e=n.call(this)).bpm=120,e.onError=function(e){},e.onWarnings=function(e){},e.onCompiled=function(e){},e.onStateChanged=function(e,t){},e.updateMarkersDebounceMillis=50,e.editors=[],e.sourceIdEditorMap=new Map,e.lastEventTimeQuarters=0,e.updateMarkersDebounced=E.debounce(e.updateMarkersImpl.bind(l(e)),e.updateMarkersDebounceMillis),e._beginQuarters=0,e.playerState=b.PlayerState.Stopped,e.createElement(),e}return a(r,[{key:"beginQuarters",get:function(){return this._beginQuarters},set:function(e){this._beginQuarters=Math.max(0,e)}},{key:"setAdditionalCssText",value:function(e){var n,r=t(this.editors);try{for(r.s();!(n=r.n()).done;){n.value.setAdditionalCssText(e)}}catch(i){r.e(i)}finally{r.f()}}},{key:"getEditorByFileName",value:function(e){var t=this.editors.map(function(e){return"/".concat(e.filename)}).indexOf(e);if(!(t<0))return this.editors[t]}},{key:"playerIsFetching",get:function(){return this._playerIsFetching},set:function(e){this._playerIsFetching=e;var t=this.workspaceControlsElement;e?t.classList.add("wm-player-fetching"):t.classList.remove("wm-player-fetching")}},{key:"workspaceControlsElement",get:function(){return this.shadowRoot.getElementById("wm-controls")}},{key:"playButtonElement",get:function(){return this.shadowRoot.getElementById("btnPlay")}},{key:"stopButtonElement",get:function(){return this.shadowRoot.getElementById("btnStop")}},{key:"createElement",value:function(){return v(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.attachShadow({mode:"open"}),t=_.content.cloneNode(!0),this.shadowRoot.appendChild(t),setTimeout(this.init.bind(this));case 4:case"end":return e.stop()}},e,this)}))}},{key:"initListener",value:function(){this.playButtonElement.addEventListener("click",this.onPlayClicked.bind(this)),this.stopButtonElement.addEventListener("click",this.onStopClicked.bind(this))}},{key:"updateMarkers",value:function(e){this.lastEventTimeQuarters=e,this.updateMarkersDebounced()}},{key:"updateMarkersImpl",value:function(){var e=this.lastEventTimeQuarters;this.clearAllEventMarkers();var n=E(this.document.eventInfos).map(function(t){return{diff:Math.abs(e-t.sheetTime),sheetEvents:t.sheetEventInfos}}).minBy(function(e){return e.diff});if(n){var r,i=t(n.sheetEvents);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=this.sourceIdEditorMap.get(o.sourceId);a&&a.addMarkers([o])}}catch(s){i.e(s)}finally{i.f()}}}},{key:"onMidiEvent",value:function(e){e.midiEvent.eventType===w.EventType.NoteOn&&this.updateMarkers(e.position+this.beginQuarters)}},{key:"onPlayerState",value:function(e,t){t===b.PlayerState.Stopped&&(this.clearAllEventMarkers(),this.workspaceControlsElement.classList.remove("wm-state-playing"),this.workspaceControlsElement.classList.add("wm-state-stopped")),t===b.PlayerState.Playing&&(this.workspaceControlsElement.classList.remove("wm-state-stopped"),this.workspaceControlsElement.classList.add("wm-state-playing")),this.playerState=t,this.onStateChanged(e,t)}},{key:"updateSourceIdMap",value:function(e){var n=this;this.sourceIdEditorMap.clear();var r,i=t(e.midi.sources);try{var o=function(){var e=r.value,t=n.editors.find(function(t){return"/"+t.filename===e.path});if(!t)return"continue";n.sourceIdEditorMap.set(e.sourceId,t)};for(i.s();!(r=i.n()).done;)o()}catch(a){i.e(a)}finally{i.f()}}},{key:"onPlayClicked",value:function(e){this.play(e)}},{key:"getEditorFiles",value:function(){var e=this.editors.map(function(e){return{path:e.filename,data:e.getScriptText()}}),t=e.find(function(e){return e.path===C});return t&&this.setAdditionalCssText(t.data),e.filter(function(e){return e.path!==C})}},{key:"play",value:function(e){return v(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.WM_Player.prepare(e);case 2:return t.next=4,g.resetCompiler();case 4:this.playerIsFetching=!0,this.onPlayerState(this.playerState,b.PlayerState.Preparing),setTimeout(function(){return v(n,void 0,void 0,regeneratorRuntime.mark(function t(){var n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=this.getEditorFiles(),this.clearAllEditorMarkers(),t.next=5,g.WM_Compiler.compile(n,this.beginQuarters);case 5:this.document=t.sent,this.onCompiled(this.document),this.updateSourceIdMap(this.document),this.document.midi.warnings&&this.document.midi.warnings.length>0&&this._onWarnings(this.document.midi.warnings),t.next=17;break;case 11:return t.prev=11,t.t0=t.catch(0),this._onError(t.t0.error||t.t0),this.playerIsFetching=!1,this.onPlayerState(this.playerState,b.PlayerState.Stopped),t.abrupt("return");case 17:return g.WM_Player.tempo=this.document.midi.bpm,t.next=20,g.WM_Player.play(this.document.midi.midiData,e,this.onMidiEvent.bind(this),this.onPlayerState.bind(this));case 20:this.playerIsFetching=!1;case 21:case"end":return t.stop()}},t,this,[[0,11]])}))});case 7:case"end":return t.stop()}},t,this)}))}},{key:"download",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"WerckmeisterMidi.mid";return v(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n,r,i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.resetCompiler();case 2:return t.prev=2,n=this.editors.map(function(e){return{path:e.filename,data:e.getScriptText()}}),t.next=6,g.WM_Compiler.compile(n);case 6:this.document=t.sent,t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(2),this._onError(t.t0.error||t.t0),t.abrupt("return");case 13:r="data:midi;base64,".concat(this.document.midi.midiData),(i=document.createElement("a")).href=r,i.download=e,i.click();case 18:case"end":return t.stop()}},t,this,[[2,9]])}))}},{key:"onStopClicked",value:function(e){this.stop()}},{key:"stop",value:function(){return v(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,g.WM_Player.stop();case 2:case"end":return e.stop()}},e)}))}},{key:"clearAllEditorMarkers",value:function(){var e,n=t(this.editors);try{for(n.s();!(e=n.n()).done;){e.value.clearAllMarkers()}}catch(r){n.e(r)}finally{n.f()}}},{key:"clearAllEventMarkers",value:function(){var e,n=t(this.editors);try{for(n.s();!(e=n.n()).done;){e.value.clearEventMarkers()}}catch(r){n.e(r)}finally{n.f()}}},{key:"_onError",value:function(e){if(e instanceof Error)console.error("".concat(e));else{this.onError(e),console.error("".concat(e.sourceFile,'": ').concat(e.errorMessage));var t=this.getEditorByFileName(e.sourceFile);t&&t.setError(e)}}},{key:"_onWarnings",value:function(e){var n,r=t(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;console.warn(i.message),this.getEditorByFileName(i.sourceFile).addWarning(i)}}catch(o){r.e(o)}finally{r.f()}this.onWarnings(e)}},{key:"init",value:function(){this.initListener(),this.readAttributes()}},{key:"loadExternalCss",value:function(e){return v(this,void 0,void 0,regeneratorRuntime.mark(function t(){var n,r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,k.fetchText(e);case 2:n=t.sent,(r=document.createElement("style")).innerText=n,this.shadowRoot.appendChild(r);case 6:case"end":return t.stop()}},t,this)}))}},{key:"readAttributes",value:function(){return v(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t,n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:(t=this.attributes.getNamedItem("wm-onerror"))&&console.error(t),(n=this.attributes.getNamedItem("wm-css-url"))&&this.loadExternalCss(n.value),(r=this.attributes.getNamedItem("wm-soundfont-url"))&&g.WM_Player.setSoundfontRepoUrl(r.value);case 6:case"end":return e.stop()}},e,this)}))}},{key:"registerEditor",value:function(e){this.editors.push(e),e.initiated.then(function(){var t=e.filename,n=e.getScriptText();g.WM_Compiler.writeFileToFS(t,n)})}},{key:"unregisterEditor",value:function(e){var t=this.editors.indexOf(e);t<0||this.editors.splice(t,1)}},{key:"getPlayerImpl",value:function(){return g.WM_Player}},{key:"isClean",value:function(){return E.every(this.editors,function(e){return e.isClean()})}},{key:"markClean",value:function(){var e,n=t(this.editors);try{for(n.s();!(e=n.n()).done;){e.value.markClean()}}catch(r){n.e(r)}finally{n.f()}}}]),r}();exports.Workspace=I;
512
512
  },{"../../Global":"ooUX","../../shared/midiEvent":"vkzS","../../shared/player":"FYcy","../../shared/http":"vSbS","lodash":"B1iE","fs":"rDCW"}],"Rngn":[function(require,module,exports) {
513
513
  "use strict";exports.__esModule=!0,exports.default=function(){},module.exports=exports.default;
514
514
  },{}],"rbXO":[function(require,module,exports) {