@werckmeister/components 1.1.6-121 → 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.
package/package.json
CHANGED
|
@@ -33,7 +33,7 @@ var e=require("codemirror/lib/codemirror.js");require("codemirror/addon/mode/sim
|
|
|
33
33
|
},{"codemirror/lib/codemirror.js":"tQq4","codemirror/addon/mode/simple.js":"YCgH"}],"PWBo":[function(require,module,exports) {
|
|
34
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={"&":"&","<":"<",">":">","'":"'",""":'"'};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"},"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) `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({"&":"&","<":"<",">":">",'"':""","'":"'"});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({"&":"&","<":"<",">":">",""":'"',"'":"'"}),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))&>.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"]);
|
|
@@ -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) {
|